From 6782df917acf9f39a7f85bc653a02cdaf80cad19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 25 Mar 2024 17:56:20 +0900 Subject: [PATCH 001/325] Utilize next slot cache in block rewards rpc (#13684) * Utilize next slot cache in block rewards rpc * msg fix * tests --- beacon-chain/rpc/eth/rewards/BUILD.bazel | 9 +++- beacon-chain/rpc/eth/rewards/handlers_test.go | 26 +++++++++-- beacon-chain/rpc/eth/rewards/service.go | 19 ++++++++ beacon-chain/rpc/eth/rewards/service_test.go | 46 +++++++++++++++++++ beacon-chain/rpc/service.go | 2 +- 5 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 beacon-chain/rpc/eth/rewards/service_test.go diff --git a/beacon-chain/rpc/eth/rewards/BUILD.bazel b/beacon-chain/rpc/eth/rewards/BUILD.bazel index f9c9d2f768fe..a41bb4e7d562 100644 --- a/beacon-chain/rpc/eth/rewards/BUILD.bazel +++ b/beacon-chain/rpc/eth/rewards/BUILD.bazel @@ -15,7 +15,9 @@ go_library( "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library", + "//beacon-chain/core/transition:go_default_library", "//beacon-chain/core/validators:go_default_library", + "//beacon-chain/db:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/state:go_default_library", @@ -35,7 +37,10 @@ go_library( go_test( name = "go_default_test", - srcs = ["handlers_test.go"], + srcs = [ + "handlers_test.go", + "service_test.go", + ], embed = [":go_default_library"], deps = [ "//api/server/structs:go_default_library", @@ -43,6 +48,8 @@ go_test( "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/signing:go_default_library", + "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/db/testing:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen/mock:go_default_library", diff --git a/beacon-chain/rpc/eth/rewards/handlers_test.go b/beacon-chain/rpc/eth/rewards/handlers_test.go index c94a1ec0307c..aa41b308a5b6 100644 --- a/beacon-chain/rpc/eth/rewards/handlers_test.go +++ b/beacon-chain/rpc/eth/rewards/handlers_test.go @@ -18,6 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" @@ -192,6 +193,7 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int } func TestBlockRewards(t *testing.T) { + db := dbutil.SetupDB(t) phase0block, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlock()) require.NoError(t, err) t.Run("phase 0", func(t *testing.T) { @@ -227,7 +229,10 @@ func TestBlockRewards(t *testing.T) { }}, OptimisticModeFetcher: mockChainService, FinalizationFetcher: mockChainService, - BlockRewardFetcher: &BlockRewardService{Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st))}, + BlockRewardFetcher: &BlockRewardService{ + Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), + DB: db, + }, } url := "http://only.the.slot.number.at.the.end.is.important/2" @@ -260,7 +265,10 @@ func TestBlockRewards(t *testing.T) { }}, OptimisticModeFetcher: mockChainService, FinalizationFetcher: mockChainService, - BlockRewardFetcher: &BlockRewardService{Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st))}, + BlockRewardFetcher: &BlockRewardService{ + Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), + DB: db, + }, } url := "http://only.the.slot.number.at.the.end.is.important/2" @@ -293,7 +301,10 @@ func TestBlockRewards(t *testing.T) { }}, OptimisticModeFetcher: mockChainService, FinalizationFetcher: mockChainService, - BlockRewardFetcher: &BlockRewardService{Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st))}, + BlockRewardFetcher: &BlockRewardService{ + Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), + DB: db, + }, } url := "http://only.the.slot.number.at.the.end.is.important/2" @@ -326,7 +337,10 @@ func TestBlockRewards(t *testing.T) { }}, OptimisticModeFetcher: mockChainService, FinalizationFetcher: mockChainService, - BlockRewardFetcher: &BlockRewardService{Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st))}, + BlockRewardFetcher: &BlockRewardService{ + Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), + DB: db, + }, } url := "http://only.the.slot.number.at.the.end.is.important/2" @@ -715,7 +729,9 @@ func TestSyncCommiteeRewards(t *testing.T) { }}, OptimisticModeFetcher: mockChainService, FinalizationFetcher: mockChainService, - BlockRewardFetcher: &BlockRewardService{Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st))}, + BlockRewardFetcher: &BlockRewardService{ + Replayer: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), + DB: dbutil.SetupDB(t)}, } t.Run("ok - filtered vals", func(t *testing.T) { diff --git a/beacon-chain/rpc/eth/rewards/service.go b/beacon-chain/rpc/eth/rewards/service.go index 85f586be6fb3..1e6c12a3f317 100644 --- a/beacon-chain/rpc/eth/rewards/service.go +++ b/beacon-chain/rpc/eth/rewards/service.go @@ -8,7 +8,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" coreblocks "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -26,6 +28,7 @@ type BlockRewardsFetcher interface { // BlockRewardService implements BlockRewardsFetcher and can be declared to access the underlying functions type BlockRewardService struct { Replayer stategen.ReplayerBuilder + DB db.HeadAccessDatabase } // GetBlockRewardsData returns the BlockRewards object which is used for the BlockRewardsResponse and ProduceBlockV3. @@ -124,6 +127,22 @@ func (rs *BlockRewardService) GetStateForRewards(ctx context.Context, blk interf // We want to run several block processing functions that update the proposer's balance. // This will allow us to calculate proposer rewards for each operation (atts, slashings etc). // To do this, we replay the state up to the block's slot, but before processing the block. + + // Try getting the state from the next slot cache first. + _, prevSlotRoots, err := rs.DB.BlockRootsBySlot(ctx, slots.PrevSlot(blk.Slot())) + if err != nil { + return nil, &httputil.DefaultJsonError{ + Message: "Could not get roots for previous slot: " + err.Error(), + Code: http.StatusInternalServerError, + } + } + for _, r := range prevSlotRoots { + s := transition.NextSlotState(r[:], blk.Slot()) + if s != nil { + return s, nil + } + } + st, err := rs.Replayer.ReplayerForSlot(slots.PrevSlot(blk.Slot())).ReplayToSlot(ctx, blk.Slot()) if err != nil { return nil, &httputil.DefaultJsonError{ diff --git a/beacon-chain/rpc/eth/rewards/service_test.go b/beacon-chain/rpc/eth/rewards/service_test.go new file mode 100644 index 000000000000..e7202d49a376 --- /dev/null +++ b/beacon-chain/rpc/eth/rewards/service_test.go @@ -0,0 +1,46 @@ +package rewards + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestGetStateForRewards_NextSlotCacheHit(t *testing.T) { + ctx := context.Background() + db := dbutil.SetupDB(t) + + st, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + b := util.HydrateSignedBeaconBlockDeneb(util.NewBeaconBlockDeneb()) + parent, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + require.NoError(t, db.SaveBlock(ctx, parent)) + + r, err := parent.Block().HashTreeRoot() + require.NoError(t, err) + require.NoError(t, transition.UpdateNextSlotCache(ctx, r[:], st)) + + s := &BlockRewardService{ + Replayer: nil, // setting to nil because replayer must not be invoked + DB: db, + } + b = util.HydrateSignedBeaconBlockDeneb(util.NewBeaconBlockDeneb()) + sbb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + sbb.SetSlot(parent.Block().Slot() + 1) + result, err := s.GetStateForRewards(ctx, sbb.Block()) + require.NoError(t, err) + _, lcs := transition.LastCachedState() + expected, err := lcs.HashTreeRoot(ctx) + require.NoError(t, err) + actual, err := result.HashTreeRoot(ctx) + require.NoError(t, err) + assert.DeepEqual(t, expected, actual) +} diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 16b3150b275d..49890335a990 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -215,7 +215,7 @@ func NewService(ctx context.Context, cfg *Config) *Service { GenesisTimeFetcher: s.cfg.GenesisTimeFetcher, BlobStorage: s.cfg.BlobStorage, } - rewardFetcher := &rewards.BlockRewardService{Replayer: ch} + rewardFetcher := &rewards.BlockRewardService{Replayer: ch, DB: s.cfg.BeaconDB} coreService := &core.Service{ HeadFetcher: s.cfg.HeadFetcher, GenesisTimeFetcher: s.cfg.GenesisTimeFetcher, From 14d7416c1646551d258e0ecbf15a353e4cee1792 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:10:32 +0100 Subject: [PATCH 002/325] Spec test coverage report hack (#13718) * Spec test report hack * no export * fix shell complaint * shell fix? * shell again? * chmod +x ./hack/spectest-report.sh * Review + improvements * Remove unwanted change * Add exclusion list * Fix path + add eip6110 to exclusion * Fix bazel path nonsense * Add extra detail about specific test * Cleanup exclusion list * Add fail conditions * Add mkdir * Shorten filename + mkdir only if new * Fix names * Add to exclusion list * Add report to .gitignore * Back to stupid names * Add Bazel flags option --------- Co-authored-by: Preston Van Loon --- .gitignore | 3 + bazel.sh | 2 +- hack/spectest-report.sh | 78 ++++++++ testing/spectest/exclusions.txt | 296 +++++++++++++++++++++++++++++ testing/spectest/utils/BUILD.bazel | 1 + testing/spectest/utils/utils.go | 18 +- 6 files changed, 396 insertions(+), 2 deletions(-) create mode 100755 hack/spectest-report.sh create mode 100644 testing/spectest/exclusions.txt diff --git a/.gitignore b/.gitignore index 4756ea5614d9..40aebe42b636 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ jwt.hex # manual testing tmp + +# spectest coverage reports +report.txt diff --git a/bazel.sh b/bazel.sh index b89ac678a42a..d0239499e39d 100755 --- a/bazel.sh +++ b/bazel.sh @@ -2,7 +2,7 @@ # This script serves as a wrapper around bazel to limit the scope of environment variables that # may change the action output. Using this script should result in a higher cache hit ratio for -# cached actions with a more heremtic build. +# cached actions with a more hermetic build. env -i \ PATH=/usr/bin:/bin \ diff --git a/hack/spectest-report.sh b/hack/spectest-report.sh new file mode 100755 index 000000000000..d9fa0a7003cf --- /dev/null +++ b/hack/spectest-report.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +set -xe + +# Constants +PROJECT_ROOT=$(pwd) +PRYSM_DIR="${PROJECT_ROOT%/hack}/testing/spectest" +EXCLUSION_LIST="$PRYSM_DIR/exclusions.txt" +BAZEL_DIR="/tmp/spectest_report" +SPEC_REPO="git@github.com:ethereum/consensus-spec-tests.git" +SPEC_DIR="/tmp/consensus-spec" + +# Create directory if it doesn't already exist +mkdir -p "$BAZEL_DIR" + +# Add any passed flags to BAZEL_FLAGS +BAZEL_FLAGS="" +for flag in "$@" +do + BAZEL_FLAGS="$BAZEL_FLAGS $flag" +done + +# Run spectests +bazel test //testing/spectest/... --test_env=SPEC_TEST_REPORT_OUTPUT_DIR="$BAZEL_DIR" $BAZEL_FLAGS + +# Ensure the SPEC_DIR exists and is a git repository +if [ -d "$SPEC_DIR/.git" ]; then + echo "Repository already exists. Pulling latest changes." + (cd "$SPEC_DIR" && git pull) || exit 1 +else + echo "Cloning the GitHub repository." + git clone "$SPEC_REPO" "$SPEC_DIR" || exit 1 +fi + +# Finding all *_tests.txt files in BAZEL_DIR and concatenating them into tests.txt +find "$BAZEL_DIR" -type f -name '*_tests.txt' -exec cat {} + > "$PRYSM_DIR/tests.txt" + +# Generating spec.txt +(cd "$SPEC_DIR" && find tests -maxdepth 4 -mindepth 4 -type d > "$PRYSM_DIR/spec.txt") || exit 1 + +# Comparing spec.txt with tests.txt and generating report.txt +while IFS= read -r line; do + if grep -Fxq "$line" "$EXCLUSION_LIST"; then + # If it's excluded and we have a test for it flag as an error + if grep -q "$line" "$PRYSM_DIR/tests.txt"; then + echo "Error: Excluded item found in tests.txt: $line" + exit 1 # Exit with an error status + else + echo "Skipping excluded item: $line" + fi + continue + fi + if grep -q "$line" "$PRYSM_DIR/tests.txt"; then + echo "found $line" + else + echo "missing $line" + fi +done < "$PRYSM_DIR/spec.txt" > "$PRYSM_DIR/report.txt" + +# Formatting report.txt +{ + echo "Prysm Spectest Report" + echo "" + echo "Tests Missing" + grep '^missing' "$PRYSM_DIR/report.txt" + echo "" + echo "Tests Found" + grep '^found' "$PRYSM_DIR/report.txt" +} > "$PRYSM_DIR/report_temp.txt" && mv "$PRYSM_DIR/report_temp.txt" "$PRYSM_DIR/report.txt" + +# Check for the word "missing" in the report and exit with an error if present +if grep -q '^missing' "$PRYSM_DIR/report.txt"; then + echo "Error: 'missing' tests found in report: $PRYSM_DIR/report.txt" + exit 1 +fi + +# Clean up +rm -f "$PRYSM_DIR/tests.txt" "$PRYSM_DIR/spec.txt" diff --git a/testing/spectest/exclusions.txt b/testing/spectest/exclusions.txt new file mode 100644 index 000000000000..8e12f2dbcbb3 --- /dev/null +++ b/testing/spectest/exclusions.txt @@ -0,0 +1,296 @@ +# LightClient +tests/mainnet/altair/light_client/single_merkle_proof +tests/mainnet/bellatrix/light_client/single_merkle_proof +tests/mainnet/capella/light_client/single_merkle_proof +tests/mainnet/deneb/light_client/single_merkle_proof +tests/minimal/altair/light_client/single_merkle_proof +tests/minimal/altair/light_client/sync +tests/minimal/altair/light_client/update_ranking +tests/minimal/bellatrix/light_client/single_merkle_proof +tests/minimal/bellatrix/light_client/sync +tests/minimal/bellatrix/light_client/update_ranking +tests/minimal/capella/light_client/single_merkle_proof +tests/minimal/capella/light_client/sync +tests/minimal/capella/light_client/update_ranking +tests/minimal/deneb/light_client/single_merkle_proof +tests/minimal/deneb/light_client/sync +tests/minimal/deneb/light_client/update_ranking + +# SSZ Generic +tests/general/phase0/ssz_generic/basic_vector +tests/general/phase0/ssz_generic/bitlist +tests/general/phase0/ssz_generic/bitvector +tests/general/phase0/ssz_generic/boolean +tests/general/phase0/ssz_generic/containers +tests/general/phase0/ssz_generic/uints + +# EIP6110 +tests/mainnet/eip6110/epoch_processing/effective_balance_updates +tests/mainnet/eip6110/epoch_processing/eth1_data_reset +tests/mainnet/eip6110/epoch_processing/historical_summaries_update +tests/mainnet/eip6110/epoch_processing/inactivity_updates +tests/mainnet/eip6110/epoch_processing/justification_and_finalization +tests/mainnet/eip6110/epoch_processing/participation_flag_updates +tests/mainnet/eip6110/epoch_processing/randao_mixes_reset +tests/mainnet/eip6110/epoch_processing/registry_updates +tests/mainnet/eip6110/epoch_processing/rewards_and_penalties +tests/mainnet/eip6110/epoch_processing/slashings +tests/mainnet/eip6110/epoch_processing/slashings_reset +tests/mainnet/eip6110/finality/finality +tests/mainnet/eip6110/fork_choice/ex_ante +tests/mainnet/eip6110/fork_choice/get_head +tests/mainnet/eip6110/fork_choice/get_proposer_head +tests/mainnet/eip6110/fork_choice/on_block +tests/mainnet/eip6110/fork_choice/should_override_forkchoice_update +tests/mainnet/eip6110/operations/attestation +tests/mainnet/eip6110/operations/attester_slashing +tests/mainnet/eip6110/operations/block_header +tests/mainnet/eip6110/operations/bls_to_execution_change +tests/mainnet/eip6110/operations/deposit +tests/mainnet/eip6110/operations/deposit_receipt +tests/mainnet/eip6110/operations/execution_payload +tests/mainnet/eip6110/operations/proposer_slashing +tests/mainnet/eip6110/operations/sync_aggregate +tests/mainnet/eip6110/operations/voluntary_exit +tests/mainnet/eip6110/operations/withdrawals +tests/mainnet/eip6110/rewards/basic +tests/mainnet/eip6110/rewards/leak +tests/mainnet/eip6110/rewards/random +tests/mainnet/eip6110/sanity/blocks +tests/mainnet/eip6110/sanity/slots +tests/mainnet/eip6110/ssz_static/AggregateAndProof +tests/mainnet/eip6110/ssz_static/Attestation +tests/mainnet/eip6110/ssz_static/AttestationData +tests/mainnet/eip6110/ssz_static/AttesterSlashing +tests/mainnet/eip6110/ssz_static/BLSToExecutionChange +tests/mainnet/eip6110/ssz_static/BeaconBlock +tests/mainnet/eip6110/ssz_static/BeaconBlockBody +tests/mainnet/eip6110/ssz_static/BeaconBlockHeader +tests/mainnet/eip6110/ssz_static/BeaconState +tests/mainnet/eip6110/ssz_static/BlobIdentifier +tests/mainnet/eip6110/ssz_static/BlobSidecar +tests/mainnet/eip6110/ssz_static/Checkpoint +tests/mainnet/eip6110/ssz_static/ContributionAndProof +tests/mainnet/eip6110/ssz_static/Deposit +tests/mainnet/eip6110/ssz_static/DepositData +tests/mainnet/eip6110/ssz_static/DepositMessage +tests/mainnet/eip6110/ssz_static/DepositReceipt +tests/mainnet/eip6110/ssz_static/Eth1Block +tests/mainnet/eip6110/ssz_static/Eth1Data +tests/mainnet/eip6110/ssz_static/ExecutionPayload +tests/mainnet/eip6110/ssz_static/ExecutionPayloadHeader +tests/mainnet/eip6110/ssz_static/Fork +tests/mainnet/eip6110/ssz_static/ForkData +tests/mainnet/eip6110/ssz_static/HistoricalBatch +tests/mainnet/eip6110/ssz_static/HistoricalSummary +tests/mainnet/eip6110/ssz_static/IndexedAttestation +tests/mainnet/eip6110/ssz_static/LightClientBootstrap +tests/mainnet/eip6110/ssz_static/LightClientFinalityUpdate +tests/mainnet/eip6110/ssz_static/LightClientHeader +tests/mainnet/eip6110/ssz_static/LightClientOptimisticUpdate +tests/mainnet/eip6110/ssz_static/LightClientUpdate +tests/mainnet/eip6110/ssz_static/PendingAttestation +tests/mainnet/eip6110/ssz_static/PowBlock +tests/mainnet/eip6110/ssz_static/ProposerSlashing +tests/mainnet/eip6110/ssz_static/SignedAggregateAndProof +tests/mainnet/eip6110/ssz_static/SignedBLSToExecutionChange +tests/mainnet/eip6110/ssz_static/SignedBeaconBlock +tests/mainnet/eip6110/ssz_static/SignedBeaconBlockHeader +tests/mainnet/eip6110/ssz_static/SignedContributionAndProof +tests/mainnet/eip6110/ssz_static/SignedVoluntaryExit +tests/mainnet/eip6110/ssz_static/SigningData +tests/mainnet/eip6110/ssz_static/SyncAggregate +tests/mainnet/eip6110/ssz_static/SyncAggregatorSelectionData +tests/mainnet/eip6110/ssz_static/SyncCommittee +tests/mainnet/eip6110/ssz_static/SyncCommitteeContribution +tests/mainnet/eip6110/ssz_static/SyncCommitteeMessage +tests/mainnet/eip6110/ssz_static/Validator +tests/mainnet/eip6110/ssz_static/VoluntaryExit +tests/mainnet/eip6110/ssz_static/Withdrawal +tests/mainnet/eip6110/sync/optimistic +tests/mainnet/eip6110/transition/core +tests/minimal/eip6110/epoch_processing/effective_balance_updates +tests/minimal/eip6110/epoch_processing/eth1_data_reset +tests/minimal/eip6110/epoch_processing/historical_summaries_update +tests/minimal/eip6110/epoch_processing/inactivity_updates +tests/minimal/eip6110/epoch_processing/justification_and_finalization +tests/minimal/eip6110/epoch_processing/participation_flag_updates +tests/minimal/eip6110/epoch_processing/randao_mixes_reset +tests/minimal/eip6110/epoch_processing/registry_updates +tests/minimal/eip6110/epoch_processing/rewards_and_penalties +tests/minimal/eip6110/epoch_processing/slashings +tests/minimal/eip6110/epoch_processing/slashings_reset +tests/minimal/eip6110/epoch_processing/sync_committee_updates +tests/minimal/eip6110/finality/finality +tests/minimal/eip6110/fork_choice/ex_ante +tests/minimal/eip6110/fork_choice/get_head +tests/minimal/eip6110/fork_choice/get_proposer_head +tests/minimal/eip6110/fork_choice/on_block +tests/minimal/eip6110/fork_choice/reorg +tests/minimal/eip6110/fork_choice/should_override_forkchoice_update +tests/minimal/eip6110/fork_choice/withholding +tests/minimal/eip6110/genesis/initialization +tests/minimal/eip6110/genesis/validity +tests/minimal/eip6110/operations/attestation +tests/minimal/eip6110/operations/attester_slashing +tests/minimal/eip6110/operations/block_header +tests/minimal/eip6110/operations/bls_to_execution_change +tests/minimal/eip6110/operations/deposit +tests/minimal/eip6110/operations/deposit_receipt +tests/minimal/eip6110/operations/execution_payload +tests/minimal/eip6110/operations/proposer_slashing +tests/minimal/eip6110/operations/sync_aggregate +tests/minimal/eip6110/operations/voluntary_exit +tests/minimal/eip6110/operations/withdrawals +tests/minimal/eip6110/rewards/basic +tests/minimal/eip6110/rewards/leak +tests/minimal/eip6110/rewards/random +tests/minimal/eip6110/sanity/blocks +tests/minimal/eip6110/sanity/slots +tests/minimal/eip6110/ssz_static/AggregateAndProof +tests/minimal/eip6110/ssz_static/Attestation +tests/minimal/eip6110/ssz_static/AttestationData +tests/minimal/eip6110/ssz_static/AttesterSlashing +tests/minimal/eip6110/ssz_static/BLSToExecutionChange +tests/minimal/eip6110/ssz_static/BeaconBlock +tests/minimal/eip6110/ssz_static/BeaconBlockBody +tests/minimal/eip6110/ssz_static/BeaconBlockHeader +tests/minimal/eip6110/ssz_static/BeaconState +tests/minimal/eip6110/ssz_static/BlobIdentifier +tests/minimal/eip6110/ssz_static/BlobSidecar +tests/minimal/eip6110/ssz_static/Checkpoint +tests/minimal/eip6110/ssz_static/ContributionAndProof +tests/minimal/eip6110/ssz_static/Deposit +tests/minimal/eip6110/ssz_static/DepositData +tests/minimal/eip6110/ssz_static/DepositMessage +tests/minimal/eip6110/ssz_static/DepositReceipt +tests/minimal/eip6110/ssz_static/Eth1Block +tests/minimal/eip6110/ssz_static/Eth1Data +tests/minimal/eip6110/ssz_static/ExecutionPayload +tests/minimal/eip6110/ssz_static/ExecutionPayloadHeader +tests/minimal/eip6110/ssz_static/Fork +tests/minimal/eip6110/ssz_static/ForkData +tests/minimal/eip6110/ssz_static/HistoricalBatch +tests/minimal/eip6110/ssz_static/HistoricalSummary +tests/minimal/eip6110/ssz_static/IndexedAttestation +tests/minimal/eip6110/ssz_static/LightClientBootstrap +tests/minimal/eip6110/ssz_static/LightClientFinalityUpdate +tests/minimal/eip6110/ssz_static/LightClientHeader +tests/minimal/eip6110/ssz_static/LightClientOptimisticUpdate +tests/minimal/eip6110/ssz_static/LightClientUpdate +tests/minimal/eip6110/ssz_static/PendingAttestation +tests/minimal/eip6110/ssz_static/PowBlock +tests/minimal/eip6110/ssz_static/ProposerSlashing +tests/minimal/eip6110/ssz_static/SignedAggregateAndProof +tests/minimal/eip6110/ssz_static/SignedBLSToExecutionChange +tests/minimal/eip6110/ssz_static/SignedBeaconBlock +tests/minimal/eip6110/ssz_static/SignedBeaconBlockHeader +tests/minimal/eip6110/ssz_static/SignedContributionAndProof +tests/minimal/eip6110/ssz_static/SignedVoluntaryExit +tests/minimal/eip6110/ssz_static/SigningData +tests/minimal/eip6110/ssz_static/SyncAggregate +tests/minimal/eip6110/ssz_static/SyncAggregatorSelectionData +tests/minimal/eip6110/ssz_static/SyncCommittee +tests/minimal/eip6110/ssz_static/SyncCommitteeContribution +tests/minimal/eip6110/ssz_static/SyncCommitteeMessage +tests/minimal/eip6110/ssz_static/Validator +tests/minimal/eip6110/ssz_static/VoluntaryExit +tests/minimal/eip6110/ssz_static/Withdrawal +tests/minimal/eip6110/sync/optimistic +tests/minimal/eip6110/transition/core + +# Whisk +tests/mainnet/whisk/ssz_static/AggregateAndProof +tests/mainnet/whisk/ssz_static/Attestation +tests/mainnet/whisk/ssz_static/AttestationData +tests/mainnet/whisk/ssz_static/AttesterSlashing +tests/mainnet/whisk/ssz_static/BLSToExecutionChange +tests/mainnet/whisk/ssz_static/BeaconBlock +tests/mainnet/whisk/ssz_static/BeaconBlockBody +tests/mainnet/whisk/ssz_static/BeaconBlockHeader +tests/mainnet/whisk/ssz_static/BeaconState +tests/mainnet/whisk/ssz_static/Checkpoint +tests/mainnet/whisk/ssz_static/ContributionAndProof +tests/mainnet/whisk/ssz_static/Deposit +tests/mainnet/whisk/ssz_static/DepositData +tests/mainnet/whisk/ssz_static/DepositMessage +tests/mainnet/whisk/ssz_static/Eth1Block +tests/mainnet/whisk/ssz_static/Eth1Data +tests/mainnet/whisk/ssz_static/ExecutionPayload +tests/mainnet/whisk/ssz_static/ExecutionPayloadHeader +tests/mainnet/whisk/ssz_static/Fork +tests/mainnet/whisk/ssz_static/ForkData +tests/mainnet/whisk/ssz_static/HistoricalBatch +tests/mainnet/whisk/ssz_static/HistoricalSummary +tests/mainnet/whisk/ssz_static/IndexedAttestation +tests/mainnet/whisk/ssz_static/LightClientBootstrap +tests/mainnet/whisk/ssz_static/LightClientFinalityUpdate +tests/mainnet/whisk/ssz_static/LightClientHeader +tests/mainnet/whisk/ssz_static/LightClientOptimisticUpdate +tests/mainnet/whisk/ssz_static/LightClientUpdate +tests/mainnet/whisk/ssz_static/PendingAttestation +tests/mainnet/whisk/ssz_static/PowBlock +tests/mainnet/whisk/ssz_static/ProposerSlashing +tests/mainnet/whisk/ssz_static/SignedAggregateAndProof +tests/mainnet/whisk/ssz_static/SignedBLSToExecutionChange +tests/mainnet/whisk/ssz_static/SignedBeaconBlock +tests/mainnet/whisk/ssz_static/SignedBeaconBlockHeader +tests/mainnet/whisk/ssz_static/SignedContributionAndProof +tests/mainnet/whisk/ssz_static/SignedVoluntaryExit +tests/mainnet/whisk/ssz_static/SigningData +tests/mainnet/whisk/ssz_static/SyncAggregate +tests/mainnet/whisk/ssz_static/SyncAggregatorSelectionData +tests/mainnet/whisk/ssz_static/SyncCommittee +tests/mainnet/whisk/ssz_static/SyncCommitteeContribution +tests/mainnet/whisk/ssz_static/SyncCommitteeMessage +tests/mainnet/whisk/ssz_static/Validator +tests/mainnet/whisk/ssz_static/VoluntaryExit +tests/mainnet/whisk/ssz_static/WhiskTracker +tests/mainnet/whisk/ssz_static/Withdrawal +tests/minimal/whisk/ssz_static/AggregateAndProof +tests/minimal/whisk/ssz_static/Attestation +tests/minimal/whisk/ssz_static/AttestationData +tests/minimal/whisk/ssz_static/AttesterSlashing +tests/minimal/whisk/ssz_static/BLSToExecutionChange +tests/minimal/whisk/ssz_static/BeaconBlock +tests/minimal/whisk/ssz_static/BeaconBlockBody +tests/minimal/whisk/ssz_static/BeaconBlockHeader +tests/minimal/whisk/ssz_static/BeaconState +tests/minimal/whisk/ssz_static/Checkpoint +tests/minimal/whisk/ssz_static/ContributionAndProof +tests/minimal/whisk/ssz_static/Deposit +tests/minimal/whisk/ssz_static/DepositData +tests/minimal/whisk/ssz_static/DepositMessage +tests/minimal/whisk/ssz_static/Eth1Block +tests/minimal/whisk/ssz_static/Eth1Data +tests/minimal/whisk/ssz_static/ExecutionPayload +tests/minimal/whisk/ssz_static/ExecutionPayloadHeader +tests/minimal/whisk/ssz_static/Fork +tests/minimal/whisk/ssz_static/ForkData +tests/minimal/whisk/ssz_static/HistoricalBatch +tests/minimal/whisk/ssz_static/HistoricalSummary +tests/minimal/whisk/ssz_static/IndexedAttestation +tests/minimal/whisk/ssz_static/LightClientBootstrap +tests/minimal/whisk/ssz_static/LightClientFinalityUpdate +tests/minimal/whisk/ssz_static/LightClientHeader +tests/minimal/whisk/ssz_static/LightClientOptimisticUpdate +tests/minimal/whisk/ssz_static/LightClientUpdate +tests/minimal/whisk/ssz_static/PendingAttestation +tests/minimal/whisk/ssz_static/PowBlock +tests/minimal/whisk/ssz_static/ProposerSlashing +tests/minimal/whisk/ssz_static/SignedAggregateAndProof +tests/minimal/whisk/ssz_static/SignedBLSToExecutionChange +tests/minimal/whisk/ssz_static/SignedBeaconBlock +tests/minimal/whisk/ssz_static/SignedBeaconBlockHeader +tests/minimal/whisk/ssz_static/SignedContributionAndProof +tests/minimal/whisk/ssz_static/SignedVoluntaryExit +tests/minimal/whisk/ssz_static/SigningData +tests/minimal/whisk/ssz_static/SyncAggregate +tests/minimal/whisk/ssz_static/SyncAggregatorSelectionData +tests/minimal/whisk/ssz_static/SyncCommittee +tests/minimal/whisk/ssz_static/SyncCommitteeContribution +tests/minimal/whisk/ssz_static/SyncCommitteeMessage +tests/minimal/whisk/ssz_static/Validator +tests/minimal/whisk/ssz_static/VoluntaryExit +tests/minimal/whisk/ssz_static/WhiskTracker +tests/minimal/whisk/ssz_static/Withdrawal \ No newline at end of file diff --git a/testing/spectest/utils/BUILD.bazel b/testing/spectest/utils/BUILD.bazel index 455b928230b2..2919cb90d466 100644 --- a/testing/spectest/utils/BUILD.bazel +++ b/testing/spectest/utils/BUILD.bazel @@ -11,6 +11,7 @@ go_library( visibility = ["//testing/spectest:__subpackages__"], deps = [ "//config/params:go_default_library", + "//io/file:go_default_library", "//testing/require:go_default_library", "@com_github_ghodss_yaml//:go_default_library", "@com_github_json_iterator_go//:go_default_library", diff --git a/testing/spectest/utils/utils.go b/testing/spectest/utils/utils.go index 72603fe868e8..2dc31fdc9dd9 100644 --- a/testing/spectest/utils/utils.go +++ b/testing/spectest/utils/utils.go @@ -1,6 +1,7 @@ package utils import ( + "fmt" "os" "path" "testing" @@ -8,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/ghodss/yaml" jsoniter "github.com/json-iterator/go" + "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -42,6 +44,20 @@ func TestFolders(t testing.TB, config, forkOrPhase, folderPath string) ([]os.Dir if len(testFolders) == 0 { t.Fatalf("No test folders found at %s", testsFolderPath) } - + err = saveSpecTest(testsFolderPath) + require.NoError(t, err) return testFolders, testsFolderPath } + +func saveSpecTest(testFolder string) error { + baseDir := os.Getenv("SPEC_TEST_REPORT_OUTPUT_DIR") + if baseDir == "" { + return nil // Do nothing if spec test report not requested. + } + fullPath := path.Join(baseDir, fmt.Sprintf("%x_tests.txt", testFolder)) + err := file.WriteFile(fullPath, []byte(testFolder)) + if err != nil { + return err + } + return nil +} From 6de7df6b9d3216a5ac91e49ace522ed1a928fdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 26 Mar 2024 12:26:34 +0900 Subject: [PATCH 003/325] Get genesis only once (#13796) --- .../beacon-api/beacon_api_node_client.go | 2 +- .../beacon-api/beacon_api_validator_client.go | 2 +- validator/client/beacon-api/genesis.go | 29 ++++--- validator/client/beacon-api/genesis_test.go | 76 +++++++++++++++++++ .../beacon-api/wait_for_chain_start_test.go | 8 +- 5 files changed, 102 insertions(+), 15 deletions(-) diff --git a/validator/client/beacon-api/beacon_api_node_client.go b/validator/client/beacon-api/beacon_api_node_client.go index f995806e2da7..6dd726b1ad4f 100644 --- a/validator/client/beacon-api/beacon_api_node_client.go +++ b/validator/client/beacon-api/beacon_api_node_client.go @@ -115,7 +115,7 @@ func NewNodeClientWithFallback(jsonRestHandler JsonRestHandler, fallbackClient i b := &beaconApiNodeClient{ jsonRestHandler: jsonRestHandler, fallbackClient: fallbackClient, - genesisProvider: beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}, + genesisProvider: &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}, } b.healthTracker = beacon.NewNodeHealthTracker(b) return b diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 115053c5623d..7e59bd0ab77d 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -29,7 +29,7 @@ type beaconApiValidatorClient struct { func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...ValidatorClientOpt) iface.ValidatorClient { c := &beaconApiValidatorClient{ - genesisProvider: beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}, + genesisProvider: &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}, dutiesProvider: beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}, stateValidatorsProvider: beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler}, jsonRestHandler: jsonRestHandler, diff --git a/validator/client/beacon-api/genesis.go b/validator/client/beacon-api/genesis.go index c235e2f9fbb2..411953660e7f 100644 --- a/validator/client/beacon-api/genesis.go +++ b/validator/client/beacon-api/genesis.go @@ -4,6 +4,7 @@ import ( "context" "net/http" "strconv" + "sync" "time" "github.com/ethereum/go-ethereum/common/hexutil" @@ -19,6 +20,8 @@ type GenesisProvider interface { type beaconApiGenesisProvider struct { jsonRestHandler JsonRestHandler + genesis *structs.Genesis + once sync.Once } func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) { @@ -64,15 +67,23 @@ func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb } // GetGenesis gets the genesis information from the beacon node via the /eth/v1/beacon/genesis endpoint -func (c beaconApiGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { +func (c *beaconApiGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { genesisJson := &structs.GetGenesisResponse{} - if err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/genesis", genesisJson); err != nil { - return nil, err - } - - if genesisJson.Data == nil { - return nil, errors.New("genesis data is nil") + var doErr error + c.once.Do(func() { + if err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/genesis", genesisJson); err != nil { + doErr = err + return + } + if genesisJson.Data == nil { + doErr = errors.New("genesis data is nil") + return + } + c.genesis = genesisJson.Data + }) + if doErr != nil { + // Allow another call because the current one returned an error + c.once = sync.Once{} } - - return genesisJson.Data, nil + return c.genesis, doErr } diff --git a/validator/client/beacon-api/genesis_test.go b/validator/client/beacon-api/genesis_test.go index 4eca109f44b9..1835068dde5d 100644 --- a/validator/client/beacon-api/genesis_test.go +++ b/validator/client/beacon-api/genesis_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -66,3 +67,78 @@ func TestGetGenesis_NilData(t *testing.T) { _, err := genesisProvider.GetGenesis(ctx) assert.ErrorContains(t, "genesis data is nil", err) } + +func TestGetGenesis_EndpointCalledOnlyOnce(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ctx := context.Background() + + genesisResponseJson := structs.GetGenesisResponse{} + jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) + jsonRestHandler.EXPECT().Get( + ctx, + "/eth/v1/beacon/genesis", + &genesisResponseJson, + ).Return( + nil, + ).SetArg( + 2, + structs.GetGenesisResponse{ + Data: &structs.Genesis{ + GenesisTime: "1234", + GenesisValidatorsRoot: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + }, + }, + ).Times(1) + + genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} + _, err := genesisProvider.GetGenesis(ctx) + assert.NoError(t, err) + resp, err := genesisProvider.GetGenesis(ctx) + assert.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, "1234", resp.GenesisTime) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", resp.GenesisValidatorsRoot) +} + +func TestGetGenesis_EndpointCanBeCalledAgainAfterError(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ctx := context.Background() + + genesisResponseJson := structs.GetGenesisResponse{} + jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) + jsonRestHandler.EXPECT().Get( + ctx, + "/eth/v1/beacon/genesis", + &genesisResponseJson, + ).Return( + errors.New("foo"), + ).Times(1) + jsonRestHandler.EXPECT().Get( + ctx, + "/eth/v1/beacon/genesis", + &genesisResponseJson, + ).Return( + nil, + ).SetArg( + 2, + structs.GetGenesisResponse{ + Data: &structs.Genesis{ + GenesisTime: "1234", + GenesisValidatorsRoot: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + }, + }, + ).Times(1) + + genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} + _, err := genesisProvider.GetGenesis(ctx) + require.ErrorContains(t, "foo", err) + resp, err := genesisProvider.GetGenesis(ctx) + assert.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, "1234", resp.GenesisTime) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", resp.GenesisValidatorsRoot) +} diff --git a/validator/client/beacon-api/wait_for_chain_start_test.go b/validator/client/beacon-api/wait_for_chain_start_test.go index 5395546777a3..6b29babd9b7a 100644 --- a/validator/client/beacon-api/wait_for_chain_start_test.go +++ b/validator/client/beacon-api/wait_for_chain_start_test.go @@ -40,7 +40,7 @@ func TestWaitForChainStart_ValidGenesis(t *testing.T) { ).Times(1) genesisProvider := beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - validatorClient := beaconApiValidatorClient{genesisProvider: genesisProvider} + validatorClient := beaconApiValidatorClient{genesisProvider: &genesisProvider} resp, err := validatorClient.WaitForChainStart(ctx, &emptypb.Empty{}) assert.NoError(t, err) @@ -104,7 +104,7 @@ func TestWaitForChainStart_BadGenesis(t *testing.T) { ).Times(1) genesisProvider := beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - validatorClient := beaconApiValidatorClient{genesisProvider: genesisProvider} + validatorClient := beaconApiValidatorClient{genesisProvider: &genesisProvider} _, err := validatorClient.WaitForChainStart(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.errorMessage, err) }) @@ -127,7 +127,7 @@ func TestWaitForChainStart_JsonResponseError(t *testing.T) { ).Times(1) genesisProvider := beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - validatorClient := beaconApiValidatorClient{genesisProvider: genesisProvider} + validatorClient := beaconApiValidatorClient{genesisProvider: &genesisProvider} _, err := validatorClient.WaitForChainStart(ctx, &emptypb.Empty{}) assert.ErrorContains(t, "failed to get genesis data", err) assert.ErrorContains(t, "some specific json error", err) @@ -172,7 +172,7 @@ func TestWaitForChainStart_JsonResponseError404(t *testing.T) { ).Times(1) genesisProvider := beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - validatorClient := beaconApiValidatorClient{genesisProvider: genesisProvider} + validatorClient := beaconApiValidatorClient{genesisProvider: &genesisProvider} resp, err := validatorClient.WaitForChainStart(ctx, &emptypb.Empty{}) assert.NoError(t, err) From 97edffaff5e368c28fc8094e0193848676db557d Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 26 Mar 2024 07:58:41 -0700 Subject: [PATCH 004/325] Add bid value metrics (#13804) --- .../v1alpha1/validator/proposer_bellatrix.go | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 87b91d46d76c..c7baa85b3fb8 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -27,11 +27,20 @@ import ( "go.opencensus.io/trace" ) -// builderGetPayloadMissCount tracks the number of misses when validator tries to get a payload from builder -var builderGetPayloadMissCount = promauto.NewCounter(prometheus.CounterOpts{ - Name: "builder_get_payload_miss_count", - Help: "The number of get payload misses for validator requests to builder", -}) +var ( + builderValueGweiGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "builder_value_gwei", + Help: "Builder payload value in gwei", + }) + localValueGweiGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "local_value_gwei", + Help: "Local payload value in gwei", + }) + builderGetPayloadMissCount = promauto.NewCounter(prometheus.CounterOpts{ + Name: "builder_get_payload_miss_count", + Help: "The number of get payload misses for validator requests to builder", + }) +) // emptyTransactionsRoot represents the returned value of ssz.TransactionsRoot([][]byte{}) and // can be used as a constant to avoid recomputing this value in every call. @@ -92,6 +101,8 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc "builderBoostFactor": builderBoostFactor, }).Warn("Proposer: both local boost and builder boost are using non default values") } + builderValueGweiGauge.Set(float64(builderValueGwei)) + localValueGweiGauge.Set(float64(localValueGwei)) // If we can't get the builder value, just use local block. if higherValueBuilder && withdrawalsMatched { // Builder value is higher and withdrawals match. From cdd1d819df725416da72343d38e9b9b4eb102fd9 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Wed, 27 Mar 2024 07:36:17 -0500 Subject: [PATCH 005/325] Refactor batch verifier for sharing across packages (#13812) * refactor batch verifier to share with pending queue * unit test for batch verifier --------- Co-authored-by: Kasey Kirkham --- beacon-chain/sync/initial-sync/BUILD.bazel | 3 - beacon-chain/sync/initial-sync/round_robin.go | 5 +- beacon-chain/sync/initial-sync/service.go | 8 +- .../sync/rpc_beacon_blocks_by_root.go | 4 +- beacon-chain/verification/BUILD.bazel | 3 + .../verification.go => verification/batch.go} | 39 ++-- beacon-chain/verification/batch_test.go | 189 ++++++++++++++++++ beacon-chain/verification/blob.go | 3 + beacon-chain/verification/result_test.go | 2 +- 9 files changed, 224 insertions(+), 32 deletions(-) rename beacon-chain/{sync/initial-sync/verification.go => verification/batch.go} (72%) create mode 100644 beacon-chain/verification/batch_test.go diff --git a/beacon-chain/sync/initial-sync/BUILD.bazel b/beacon-chain/sync/initial-sync/BUILD.bazel index df9be0ad506f..8b83925a2435 100644 --- a/beacon-chain/sync/initial-sync/BUILD.bazel +++ b/beacon-chain/sync/initial-sync/BUILD.bazel @@ -12,14 +12,12 @@ go_library( "log.go", "round_robin.go", "service.go", - "verification.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//async/abool:go_default_library", "//beacon-chain/blockchain:go_default_library", - "//beacon-chain/blockchain/kzg:go_default_library", "//beacon-chain/core/feed/block:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/transition:go_default_library", @@ -41,7 +39,6 @@ go_library( "//consensus-types/primitives:go_default_library", "//container/leaky-bucket:go_default_library", "//crypto/rand:go_default_library", - "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime:go_default_library", diff --git a/beacon-chain/sync/initial-sync/round_robin.go b/beacon-chain/sync/initial-sync/round_robin.go index b9c105e5ead4..c91bd1ec4322 100644 --- a/beacon-chain/sync/initial-sync/round_robin.go +++ b/beacon-chain/sync/initial-sync/round_robin.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -167,7 +168,7 @@ func (s *Service) processFetchedDataRegSync( if len(bwb) == 0 { return } - bv := newBlobBatchVerifier(s.newBlobVerifier) + bv := verification.NewBlobBatchVerifier(s.newBlobVerifier, verification.InitsyncSidecarRequirements) avs := das.NewLazilyPersistentStore(s.cfg.BlobStorage, bv) batchFields := logrus.Fields{ "firstSlot": data.bwb[0].Block.Block().Slot(), @@ -326,7 +327,7 @@ func (s *Service) processBatchedBlocks(ctx context.Context, genesis time.Time, errParentDoesNotExist, first.Block().ParentRoot(), first.Block().Slot()) } - bv := newBlobBatchVerifier(s.newBlobVerifier) + bv := verification.NewBlobBatchVerifier(s.newBlobVerifier, verification.InitsyncSidecarRequirements) avs := das.NewLazilyPersistentStore(s.cfg.BlobStorage, bv) s.logBatchSyncStatus(genesis, first, len(bwb)) for _, bb := range bwb { diff --git a/beacon-chain/sync/initial-sync/service.go b/beacon-chain/sync/initial-sync/service.go index 3593aae24b82..e79b22a07720 100644 --- a/beacon-chain/sync/initial-sync/service.go +++ b/beacon-chain/sync/initial-sync/service.go @@ -340,7 +340,7 @@ func (s *Service) fetchOriginBlobs(pids []peer.ID) error { if len(sidecars) != len(req) { continue } - bv := newBlobBatchVerifier(s.newBlobVerifier) + bv := verification.NewBlobBatchVerifier(s.newBlobVerifier, verification.InitsyncSidecarRequirements) avs := das.NewLazilyPersistentStore(s.cfg.BlobStorage, bv) current := s.clock.CurrentSlot() if err := avs.Persist(current, sidecars...); err != nil { @@ -362,3 +362,9 @@ func shufflePeers(pids []peer.ID) { pids[i], pids[j] = pids[j], pids[i] }) } + +func newBlobVerifierFromInitializer(ini *verification.Initializer) verification.NewBlobVerifier { + return func(b blocks.ROBlob, reqs []verification.Requirement) verification.BlobVerifier { + return ini.NewBlobVerifier(b, reqs) + } +} diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_root.go b/beacon-chain/sync/rpc_beacon_blocks_by_root.go index f8f8ce94478c..ad1ffe83d292 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_root.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_root.go @@ -151,14 +151,14 @@ func (s *Service) sendAndSaveBlobSidecars(ctx context.Context, request types.Blo if len(sidecars) != len(request) { return fmt.Errorf("received %d blob sidecars, expected %d for RPC", len(sidecars), len(request)) } + bv := verification.NewBlobBatchVerifier(s.newBlobVerifier, verification.PendingQueueSidecarRequirements) for _, sidecar := range sidecars { if err := verify.BlobAlignsWithBlock(sidecar, RoBlock); err != nil { return err } log.WithFields(blobFields(sidecar)).Debug("Received blob sidecar RPC") } - - vscs, err := verification.BlobSidecarSliceNoop(sidecars) + vscs, err := bv.VerifiedROBlobs(ctx, RoBlock, sidecars) if err != nil { return err } diff --git a/beacon-chain/verification/BUILD.bazel b/beacon-chain/verification/BUILD.bazel index 7c2d6a9d97a0..fa95e5451e65 100644 --- a/beacon-chain/verification/BUILD.bazel +++ b/beacon-chain/verification/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "batch.go", "blob.go", "cache.go", "error.go", @@ -45,6 +46,7 @@ go_library( go_test( name = "go_default_test", srcs = [ + "batch_test.go", "blob_test.go", "cache_test.go", "initializer_test.go", @@ -69,5 +71,6 @@ go_test( "//testing/util:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_stretchr_testify//require:go_default_library", ], ) diff --git a/beacon-chain/sync/initial-sync/verification.go b/beacon-chain/verification/batch.go similarity index 72% rename from beacon-chain/sync/initial-sync/verification.go rename to beacon-chain/verification/batch.go index 1a2b936ed3cd..c84923769958 100644 --- a/beacon-chain/sync/initial-sync/verification.go +++ b/beacon-chain/verification/batch.go @@ -1,12 +1,10 @@ -package initialsync +package verification import ( "context" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/kzg" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) @@ -20,21 +18,17 @@ var ( ErrBatchBlockRootMismatch = errors.New("Sidecar block header root does not match signed block") ) -func newBlobVerifierFromInitializer(ini *verification.Initializer) verification.NewBlobVerifier { - return func(b blocks.ROBlob, reqs []verification.Requirement) verification.BlobVerifier { - return ini.NewBlobVerifier(b, reqs) - } -} - -func newBlobBatchVerifier(newVerifier verification.NewBlobVerifier) *BlobBatchVerifier { +// NewBlobBatchVerifier initializes a blob batch verifier. It requires the caller to correctly specify +// verification Requirements and to also pass in a NewBlobVerifier, which is a callback function that +// returns a new BlobVerifier for handling a single blob in the batch. +func NewBlobBatchVerifier(newVerifier NewBlobVerifier, reqs []Requirement) *BlobBatchVerifier { return &BlobBatchVerifier{ verifyKzg: kzg.Verify, newVerifier: newVerifier, + reqs: reqs, } } -type kzgVerifier func(b ...blocks.ROBlob) error - // BlobBatchVerifier solves problems that come from verifying batches of blobs from RPC. // First: we only update forkchoice after the entire batch has completed, so the n+1 elements in the batch // won't be in forkchoice yet. @@ -42,18 +36,17 @@ type kzgVerifier func(b ...blocks.ROBlob) error // method to BlobVerifier to verify the kzg commitments of all blob sidecars for a block together, then using the cached // result of the batch verification when verifying the individual blobs. type BlobBatchVerifier struct { - verifyKzg kzgVerifier - newVerifier verification.NewBlobVerifier + verifyKzg roblobCommitmentVerifier + newVerifier NewBlobVerifier + reqs []Requirement } -var _ das.BlobBatchVerifier = &BlobBatchVerifier{} - +// VerifiedROBlobs satisfies the das.BlobBatchVerifier interface, used by das.AvailabilityStore. func (batch *BlobBatchVerifier) VerifiedROBlobs(ctx context.Context, blk blocks.ROBlock, scs []blocks.ROBlob) ([]blocks.VerifiedROBlob, error) { if len(scs) == 0 { return nil, nil } - // We assume the proposer was validated wrt the block in batch block processing before performing the DA check. - + // We assume the proposer is validated wrt the block in batch block processing before performing the DA check. // So at this stage we just need to make sure the value being signed and signature bytes match the block. for i := range scs { if blk.Signature() != bytesutil.ToBytes96(scs[i].SignedBlockHeader.Signature) { @@ -71,7 +64,7 @@ func (batch *BlobBatchVerifier) VerifiedROBlobs(ctx context.Context, blk blocks. } vs := make([]blocks.VerifiedROBlob, len(scs)) for i := range scs { - vb, err := batch.verifyOneBlob(ctx, scs[i]) + vb, err := batch.verifyOneBlob(scs[i]) if err != nil { return nil, err } @@ -80,13 +73,13 @@ func (batch *BlobBatchVerifier) VerifiedROBlobs(ctx context.Context, blk blocks. return vs, nil } -func (batch *BlobBatchVerifier) verifyOneBlob(ctx context.Context, sc blocks.ROBlob) (blocks.VerifiedROBlob, error) { +func (batch *BlobBatchVerifier) verifyOneBlob(sc blocks.ROBlob) (blocks.VerifiedROBlob, error) { vb := blocks.VerifiedROBlob{} - bv := batch.newVerifier(sc, verification.InitsyncSidecarRequirements) + bv := batch.newVerifier(sc, batch.reqs) // We can satisfy the following 2 requirements immediately because VerifiedROBlobs always verifies commitments // and block signature for all blobs in the batch before calling verifyOneBlob. - bv.SatisfyRequirement(verification.RequireSidecarKzgProofVerified) - bv.SatisfyRequirement(verification.RequireValidProposerSignature) + bv.SatisfyRequirement(RequireSidecarKzgProofVerified) + bv.SatisfyRequirement(RequireValidProposerSignature) if err := bv.BlobIndexInBounds(); err != nil { return vb, err diff --git a/beacon-chain/verification/batch_test.go b/beacon-chain/verification/batch_test.go new file mode 100644 index 000000000000..f0e987d79739 --- /dev/null +++ b/beacon-chain/verification/batch_test.go @@ -0,0 +1,189 @@ +package verification + +import ( + "context" + "testing" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/stretchr/testify/require" +) + +func TestBatchVerifier(t *testing.T) { + ctx := context.Background() + mockCV := func(err error) roblobCommitmentVerifier { + return func(...blocks.ROBlob) error { + return err + } + } + var invCmtErr = errors.New("mock invalid commitment") + type vbcbt func() (blocks.VerifiedROBlob, error) + vbcb := func(bl blocks.ROBlob, err error) vbcbt { + return func() (blocks.VerifiedROBlob, error) { + return blocks.VerifiedROBlob{ROBlob: bl}, err + } + } + cases := []struct { + name string + nv func() NewBlobVerifier + cv roblobCommitmentVerifier + bandb func(t *testing.T, n int) (blocks.ROBlock, []blocks.ROBlob) + err error + nblobs int + reqs []Requirement + }{ + { + name: "no blobs", + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + return util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + }, + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{cbVerifiedROBlob: vbcb(bl, nil)} + } + }, + nblobs: 0, + }, + { + name: "happy path", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{cbVerifiedROBlob: vbcb(bl, nil)} + } + }, + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + return util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + }, + nblobs: 3, + }, + { + name: "partial batch", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{cbVerifiedROBlob: vbcb(bl, nil)} + } + }, + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + // Add extra blobs to the block that we won't return + blk, blbs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb+3) + return blk, blbs[0:3] + }, + nblobs: 3, + }, + { + name: "invalid commitment", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{cbVerifiedROBlob: func() (blocks.VerifiedROBlob, error) { + t.Fatal("Batch verifier should stop before this point") + return blocks.VerifiedROBlob{}, nil + }} + } + }, + cv: mockCV(invCmtErr), + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + return util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + }, + err: invCmtErr, + nblobs: 1, + }, + { + name: "signature mismatch", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{cbVerifiedROBlob: func() (blocks.VerifiedROBlob, error) { + t.Fatal("Batch verifier should stop before this point") + return blocks.VerifiedROBlob{}, nil + }} + } + }, + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + blk, blbs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + blbs[0].SignedBlockHeader.Signature = []byte("wrong") + return blk, blbs + }, + err: ErrBatchSignatureMismatch, + nblobs: 2, + }, + { + name: "root mismatch", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{cbVerifiedROBlob: func() (blocks.VerifiedROBlob, error) { + t.Fatal("Batch verifier should stop before this point") + return blocks.VerifiedROBlob{}, nil + }} + } + }, + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + blk, blbs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + wr, err := blocks.NewROBlobWithRoot(blbs[0].BlobSidecar, bytesutil.ToBytes32([]byte("wrong"))) + require.NoError(t, err) + blbs[0] = wr + return blk, blbs + }, + err: ErrBatchBlockRootMismatch, + nblobs: 1, + }, + { + name: "idx oob", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{ + ErrBlobIndexInBounds: ErrBlobIndexInvalid, + cbVerifiedROBlob: func() (blocks.VerifiedROBlob, error) { + t.Fatal("Batch verifier should stop before this point") + return blocks.VerifiedROBlob{}, nil + }} + } + }, + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + return util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + }, + nblobs: 1, + err: ErrBlobIndexInvalid, + }, + { + name: "inclusion proof invalid", + nv: func() NewBlobVerifier { + return func(bl blocks.ROBlob, reqs []Requirement) BlobVerifier { + return &MockBlobVerifier{ + ErrSidecarInclusionProven: ErrSidecarInclusionProofInvalid, + cbVerifiedROBlob: func() (blocks.VerifiedROBlob, error) { + t.Fatal("Batch verifier should stop before this point") + return blocks.VerifiedROBlob{}, nil + }} + } + }, + bandb: func(t *testing.T, nb int) (blocks.ROBlock, []blocks.ROBlob) { + return util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 0, nb) + }, + nblobs: 1, + err: ErrSidecarInclusionProofInvalid, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + blk, blbs := c.bandb(t, c.nblobs) + reqs := c.reqs + if reqs == nil { + reqs = InitsyncSidecarRequirements + } + bbv := NewBlobBatchVerifier(c.nv(), reqs) + if c.cv == nil { + bbv.verifyKzg = mockCV(nil) + } else { + bbv.verifyKzg = c.cv + } + vb, err := bbv.VerifiedROBlobs(ctx, blk, blbs) + if c.err != nil { + require.ErrorIs(t, err, c.err) + return + } + require.NoError(t, err) + require.Equal(t, c.nblobs, len(vb)) + }) + } +} diff --git a/beacon-chain/verification/blob.go b/beacon-chain/verification/blob.go index f8e1b202bbed..ff9eb37d4993 100644 --- a/beacon-chain/verification/blob.go +++ b/beacon-chain/verification/blob.go @@ -70,6 +70,9 @@ var InitsyncSidecarRequirements = requirementList(GossipSidecarRequirements).exc // BackfillSidecarRequirements is the same as InitsyncSidecarRequirements. var BackfillSidecarRequirements = requirementList(InitsyncSidecarRequirements).excluding() +// PendingQueueSidecarRequirements is the same as InitsyncSidecarRequirements, used by the pending blocks queue. +var PendingQueueSidecarRequirements = requirementList(InitsyncSidecarRequirements).excluding() + var ( ErrBlobInvalid = errors.New("blob failed verification") // ErrBlobIndexInvalid means RequireBlobIndexInBounds failed. diff --git a/beacon-chain/verification/result_test.go b/beacon-chain/verification/result_test.go index 1aa685d44ea6..5f4f7f9664f9 100644 --- a/beacon-chain/verification/result_test.go +++ b/beacon-chain/verification/result_test.go @@ -39,7 +39,7 @@ func TestResultList(t *testing.T) { func TestExportedBlobSanityCheck(t *testing.T) { // make sure all requirement lists contain the bare minimum checks sanity := []Requirement{RequireValidProposerSignature, RequireSidecarKzgProofVerified, RequireBlobIndexInBounds, RequireSidecarInclusionProven} - reqs := [][]Requirement{GossipSidecarRequirements, SpectestSidecarRequirements, InitsyncSidecarRequirements, BackfillSidecarRequirements} + reqs := [][]Requirement{GossipSidecarRequirements, SpectestSidecarRequirements, InitsyncSidecarRequirements, BackfillSidecarRequirements, PendingQueueSidecarRequirements} for i := range reqs { r := reqs[i] reqMap := make(map[Requirement]struct{}) From fad118cb04b7412a85d2c730c143a1f460f486c5 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 27 Mar 2024 11:17:16 -0300 Subject: [PATCH 006/325] Simplify ValidateAttestationTime (#13813) ValidateClock in ValidateAttestationTime is useless The check is that the attSlot is not > than the currentslot + 128 slots. Later there's a check that the attSlot start time is not > than current slot start time + clockDisparity. if attSlot > than currentSlot + 128 slots, then the second check would fail anyway. The lattest check already guarantees that the attSlot cannot be larger than the currentSlot, therefore it may never happen that attEpoch > currentEpoch. We just need to check for Deneb that attEpoch >= currentEpoch - 1. Removes also some duplicated variables like the attestation epoch being computed twice. --- beacon-chain/core/helpers/attestation.go | 19 +++---------------- beacon-chain/core/helpers/attestation_test.go | 4 ++-- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/beacon-chain/core/helpers/attestation.go b/beacon-chain/core/helpers/attestation.go index e89640495626..af153f8faf17 100644 --- a/beacon-chain/core/helpers/attestation.go +++ b/beacon-chain/core/helpers/attestation.go @@ -12,7 +12,6 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" - log "github.com/sirupsen/logrus" ) var ( @@ -133,9 +132,6 @@ func ComputeSubnetFromCommitteeAndSlot(activeValCount uint64, comIdx primitives. // // In the attestation must be within the range of 95 to 102 in the example above. func ValidateAttestationTime(attSlot primitives.Slot, genesisTime time.Time, clockDisparity time.Duration) error { - if err := slots.ValidateClock(attSlot, uint64(genesisTime.Unix())); err != nil { - return err - } attTime, err := slots.ToTime(uint64(genesisTime.Unix()), attSlot) if err != nil { return err @@ -182,24 +178,15 @@ func ValidateAttestationTime(attSlot primitives.Slot, genesisTime time.Time, clo } // EIP-7045: Starting in Deneb, allow any attestations from the current or previous epoch. - currentEpoch := slots.ToEpoch(currentSlot) - prevEpoch, err := currentEpoch.SafeSub(1) - if err != nil { - log.WithError(err).Debug("Ignoring underflow for a deneb attestation inclusion check in epoch 0") - prevEpoch = 0 - } - attSlotEpoch := slots.ToEpoch(attSlot) - if attSlotEpoch != currentEpoch && attSlotEpoch != prevEpoch { + if attEpoch+1 < currentEpoch { attError = fmt.Errorf( - "attestation epoch %d not within current epoch %d or previous epoch %d", - attSlot/params.BeaconConfig().SlotsPerEpoch, + "attestation epoch %d not within current epoch %d or previous epoch", + attEpoch, currentEpoch, - prevEpoch, ) return errors.Join(ErrTooLate, attError) } - return nil } diff --git a/beacon-chain/core/helpers/attestation_test.go b/beacon-chain/core/helpers/attestation_test.go index 66104e988ee0..5c3a34a5087a 100644 --- a/beacon-chain/core/helpers/attestation_test.go +++ b/beacon-chain/core/helpers/attestation_test.go @@ -197,7 +197,7 @@ func Test_ValidateAttestationTime(t *testing.T) { -500 * time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second, ).Add(200 * time.Millisecond), }, - wantedErr: "attestation epoch 8 not within current epoch 15 or previous epoch 14", + wantedErr: "attestation epoch 8 not within current epoch 15 or previous epoch", }, { name: "attestation.slot is well beyond current slot", @@ -205,7 +205,7 @@ func Test_ValidateAttestationTime(t *testing.T) { attSlot: 1 << 32, genesisTime: prysmTime.Now().Add(-15 * time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second), }, - wantedErr: "which exceeds max allowed value relative to the local clock", + wantedErr: "attestation slot 4294967296 not within attestation propagation range of 0 to 15 (current slot)", }, } for _, tt := range tests { From c1d75c295ae92c886b5d50793b6c7a763f539015 Mon Sep 17 00:00:00 2001 From: Afanti <127061691+threewebcode@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:43:55 +0800 Subject: [PATCH 007/325] chore: enhance comment and more readable (#13792) --- validator/rpc/handler_wallet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/rpc/handler_wallet.go b/validator/rpc/handler_wallet.go index 1f9c8958a649..e3771ac69175 100644 --- a/validator/rpc/handler_wallet.go +++ b/validator/rpc/handler_wallet.go @@ -23,7 +23,7 @@ import ( "go.opencensus.io/trace" ) -// CreateWallet via an API request, allowing a user to save a new +// CreateWallet via an API request, allowing a user to save a new wallet. func (s *Server) CreateWallet(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.CreateWallet") defer span.End() From acc307b959b36e7464416b8d6e608fe0b77fbbfe Mon Sep 17 00:00:00 2001 From: Joel Rousseau Date: Thu, 28 Mar 2024 01:15:39 +0900 Subject: [PATCH 008/325] Command-line interface for visualizing min/max span bucket (#13748) * add max/min span visualisation tool cli * go mod tidy * lint imports * remove typo * fix epoch table value * fix deepsource * add dep to bazel * fix dep import order * change command name from span to slasher-span-display * change command args style using - instead of _ * sed s/CONFIGURATION/SLASHER PARAMS// * change double neg to double pos condition * remove unused anonymous func * better function naming * add range condition * [deepsource] Fix Empty slice literal used to declare a variable GO-W1027 * correct typo * do not show incorrect epochs due to round robin * fix import --------- Co-authored-by: Manu NALEPA --- beacon-chain/db/iface/interface.go | 2 +- beacon-chain/db/slasherkv/slasher.go | 12 +- beacon-chain/db/slasherkv/slasher_test.go | 2 +- beacon-chain/slasher/BUILD.bazel | 3 + beacon-chain/slasher/detect_attestations.go | 88 +++--- beacon-chain/slasher/helpers.go | 93 ++++++ beacon-chain/slasher/params.go | 29 +- beacon-chain/slasher/params_test.go | 2 +- beacon-chain/slasher/service.go | 2 +- beacon-chain/slasher/types/BUILD.bazel | 5 +- beacon-chain/slasher/types/types.go | 12 + cmd/prysmctl/db/BUILD.bazel | 5 + cmd/prysmctl/db/cmd.go | 1 + cmd/prysmctl/db/span.go | 304 ++++++++++++++++++++ deps.bzl | 6 + go.mod | 5 +- go.sum | 10 +- 17 files changed, 525 insertions(+), 56 deletions(-) create mode 100644 cmd/prysmctl/db/span.go diff --git a/beacon-chain/db/iface/interface.go b/beacon-chain/db/iface/interface.go index 75da4d87dca1..9f56e24446a2 100644 --- a/beacon-chain/db/iface/interface.go +++ b/beacon-chain/db/iface/interface.go @@ -118,7 +118,7 @@ type HeadAccessDatabase interface { // SlasherDatabase interface for persisting data related to detecting slashable offenses on Ethereum. type SlasherDatabase interface { io.Closer - SaveLastEpochsWrittenForValidators( + SaveLastEpochWrittenForValidators( ctx context.Context, epochByValidator map[primitives.ValidatorIndex]primitives.Epoch, ) error SaveAttestationRecordsForValidators( diff --git a/beacon-chain/db/slasherkv/slasher.go b/beacon-chain/db/slasherkv/slasher.go index 05af590d98d5..e840d0a5551f 100644 --- a/beacon-chain/db/slasherkv/slasher.go +++ b/beacon-chain/db/slasherkv/slasher.go @@ -70,12 +70,12 @@ func (s *Store) LastEpochWrittenForValidators( return attestedEpochs, err } -// SaveLastEpochsWrittenForValidators updates the latest epoch a slice -// of validator indices has attested to. -func (s *Store) SaveLastEpochsWrittenForValidators( +// SaveLastEpochWrittenForValidators saves the latest epoch +// that each validator has attested to in the provided map. +func (s *Store) SaveLastEpochWrittenForValidators( ctx context.Context, epochByValIndex map[primitives.ValidatorIndex]primitives.Epoch, ) error { - ctx, span := trace.StartSpan(ctx, "BeaconDB.SaveLastEpochsWrittenForValidators") + ctx, span := trace.StartSpan(ctx, "BeaconDB.SaveLastEpochWrittenForValidators") defer span.End() const batchSize = 10000 @@ -157,7 +157,7 @@ func (s *Store) CheckAttesterDoubleVotes( attRecordsBkt := tx.Bucket(attestationRecordsBucket) encEpoch := encodeTargetEpoch(attToProcess.IndexedAttestation.Data.Target.Epoch) - localDoubleVotes := []*slashertypes.AttesterDoubleVote{} + localDoubleVotes := make([]*slashertypes.AttesterDoubleVote, 0) for _, valIdx := range attToProcess.IndexedAttestation.AttestingIndices { // Check if there is signing root in the database for this combination @@ -166,7 +166,7 @@ func (s *Store) CheckAttesterDoubleVotes( validatorEpochKey := append(encEpoch, encIdx...) attRecordsKey := signingRootsBkt.Get(validatorEpochKey) - // An attestation record key is comprised of a signing root (32 bytes). + // An attestation record key consists of a signing root (32 bytes). if len(attRecordsKey) < attestationRecordKeySize { // If there is no signing root for this combination, // then there is no double vote. We can continue to the next validator. diff --git a/beacon-chain/db/slasherkv/slasher_test.go b/beacon-chain/db/slasherkv/slasher_test.go index 2567b18c46cf..2bbac54cfae5 100644 --- a/beacon-chain/db/slasherkv/slasher_test.go +++ b/beacon-chain/db/slasherkv/slasher_test.go @@ -89,7 +89,7 @@ func TestStore_LastEpochWrittenForValidators(t *testing.T) { require.NoError(t, err) require.Equal(t, 0, len(attestedEpochs)) - err = beaconDB.SaveLastEpochsWrittenForValidators(ctx, epochsByValidator) + err = beaconDB.SaveLastEpochWrittenForValidators(ctx, epochsByValidator) require.NoError(t, err) retrievedEpochs, err := beaconDB.LastEpochWrittenForValidators(ctx, indices) diff --git a/beacon-chain/slasher/BUILD.bazel b/beacon-chain/slasher/BUILD.bazel index b2d89da5340c..00bf4aaaeacc 100644 --- a/beacon-chain/slasher/BUILD.bazel +++ b/beacon-chain/slasher/BUILD.bazel @@ -19,6 +19,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher", visibility = [ "//beacon-chain:__subpackages__", + "//cmd/prysmctl:__subpackages__", "//testing/slasher/simulator:__subpackages__", ], deps = [ @@ -27,6 +28,7 @@ go_library( "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/db:go_default_library", + "//beacon-chain/db/slasherkv:go_default_library", "//beacon-chain/operations/slashings:go_default_library", "//beacon-chain/slasher/types:go_default_library", "//beacon-chain/startup:go_default_library", @@ -45,6 +47,7 @@ go_library( "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", + "@org_golang_x_exp//maps:go_default_library", ], ) diff --git a/beacon-chain/slasher/detect_attestations.go b/beacon-chain/slasher/detect_attestations.go index 3b695d0f4d78..8bc349c9b71a 100644 --- a/beacon-chain/slasher/detect_attestations.go +++ b/beacon-chain/slasher/detect_attestations.go @@ -11,6 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" + "golang.org/x/exp/maps" ) // Takes in a list of indexed attestation wrappers and returns any @@ -131,7 +132,7 @@ func (s *Service) checkSurroundVotes( } // Update the latest updated epoch for all validators involved to the current chunk. - indexes := s.params.validatorIndexesInChunk(validatorChunkIndex) + indexes := s.params.ValidatorIndexesInChunk(validatorChunkIndex) for _, index := range indexes { s.latestEpochUpdatedForValidator[index] = currentEpoch } @@ -272,44 +273,20 @@ func (s *Service) updatedChunkByChunkIndex( // minFirstEpochToUpdate is set to the smallest first epoch to update for all validators in the chunk // corresponding to the `validatorChunkIndex`. - var minFirstEpochToUpdate *primitives.Epoch + var ( + minFirstEpochToUpdate *primitives.Epoch + neededChunkIndexesMap map[uint64]bool - neededChunkIndexesMap := map[uint64]bool{} - - validatorIndexes := s.params.validatorIndexesInChunk(validatorChunkIndex) - for _, validatorIndex := range validatorIndexes { - // Retrieve the first epoch to write for the validator index. - isAnEpochToUpdate, firstEpochToUpdate, err := s.firstEpochToUpdate(validatorIndex, currentEpoch) - if err != nil { - return nil, errors.Wrapf(err, "could not get first epoch to write for validator index %d with current epoch %d", validatorIndex, currentEpoch) - } - - if !isAnEpochToUpdate { - // If there is no epoch to write, skip. - continue - } - - // If, for this validator index, the chunk corresponding to the first epoch to write - // (and all following epochs until the current epoch) are already flagged as needed, - // skip. - if minFirstEpochToUpdate != nil && *minFirstEpochToUpdate <= firstEpochToUpdate { - continue - } - - minFirstEpochToUpdate = &firstEpochToUpdate + err error + ) + validatorIndexes := s.params.ValidatorIndexesInChunk(validatorChunkIndex) - // Add new needed chunk indexes to the map. - for i := firstEpochToUpdate; i <= currentEpoch; i++ { - chunkIndex := s.params.chunkIndex(i) - neededChunkIndexesMap[chunkIndex] = true - } + if neededChunkIndexesMap, err = s.findNeededChunkIndexes(validatorIndexes, currentEpoch, minFirstEpochToUpdate); err != nil { + return nil, errors.Wrap(err, "could not find the needed chunk indexed") } - // Get the list of needed chunk indexes. - neededChunkIndexes := make([]uint64, 0, len(neededChunkIndexesMap)) - for chunkIndex := range neededChunkIndexesMap { - neededChunkIndexes = append(neededChunkIndexes, chunkIndex) - } + // Transform the map of needed chunk indexes to a slice. + neededChunkIndexes := maps.Keys(neededChunkIndexesMap) // Retrieve needed chunks from the database. chunkByChunkIndex, err := s.loadChunksFromDisk(ctx, validatorChunkIndex, chunkKind, neededChunkIndexes) @@ -332,7 +309,7 @@ func (s *Service) updatedChunkByChunkIndex( epochToUpdate := firstEpochToUpdate for epochToUpdate <= currentEpoch { - // Get the chunk index for the ecpoh to write. + // Get the chunk index for the epoch to write. chunkIndex := s.params.chunkIndex(epochToUpdate) // Get the chunk corresponding to the chunk index from the `chunkByChunkIndex` map. @@ -363,6 +340,45 @@ func (s *Service) updatedChunkByChunkIndex( return chunkByChunkIndex, nil } +// findNeededChunkIndexes returns a map of chunk indexes +// it loops over the validator indexes and finds the first epoch to update for each validator index. +func (s *Service) findNeededChunkIndexes( + validatorIndexes []primitives.ValidatorIndex, + currentEpoch primitives.Epoch, + minFirstEpochToUpdate *primitives.Epoch, +) (map[uint64]bool, error) { + neededChunkIndexesMap := map[uint64]bool{} + + for _, validatorIndex := range validatorIndexes { + // Retrieve the first epoch to write for the validator index. + isAnEpochToUpdate, firstEpochToUpdate, err := s.firstEpochToUpdate(validatorIndex, currentEpoch) + if err != nil { + return nil, errors.Wrapf(err, "could not get first epoch to write for validator index %d with current epoch %d", validatorIndex, currentEpoch) + } + + if !isAnEpochToUpdate { + // If there is no epoch to write, skip. + continue + } + + // If, for this validator index, the chunk corresponding to the first epoch to write + // (and all following epochs until the current epoch) are already flagged as needed, + // skip. + if minFirstEpochToUpdate != nil && *minFirstEpochToUpdate <= firstEpochToUpdate { + continue + } + + minFirstEpochToUpdate = &firstEpochToUpdate + + // Add new needed chunk indexes to the map. + for i := firstEpochToUpdate; i <= currentEpoch; i++ { + chunkIndex := s.params.chunkIndex(i) + neededChunkIndexesMap[chunkIndex] = true + } + } + return neededChunkIndexesMap, nil +} + // firstEpochToUpdate, given a validator index and the current epoch, returns a boolean indicating // if there is an epoch to write. If it is the case, it returns the first epoch to write. func (s *Service) firstEpochToUpdate(validatorIndex primitives.ValidatorIndex, currentEpoch primitives.Epoch) (bool, primitives.Epoch, error) { diff --git a/beacon-chain/slasher/helpers.go b/beacon-chain/slasher/helpers.go index 534d020d365b..26768f3d961e 100644 --- a/beacon-chain/slasher/helpers.go +++ b/beacon-chain/slasher/helpers.go @@ -2,8 +2,11 @@ package slasher import ( "bytes" + "context" + "fmt" "strconv" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/slasherkv" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -159,3 +162,93 @@ func isDoubleProposal(incomingSigningRoot, existingSigningRoot [32]byte) bool { } return incomingSigningRoot != existingSigningRoot } + +type GetChunkFromDatabaseFilters struct { + ChunkKind slashertypes.ChunkKind + ValidatorIndex primitives.ValidatorIndex + SourceEpoch primitives.Epoch + IsDisplayAllValidatorsInChunk bool + IsDisplayAllEpochsInChunk bool +} + +// GetChunkFromDatabase Utility function aiming at retrieving a chunk from the +// database. +func GetChunkFromDatabase( + ctx context.Context, + dbPath string, + filters GetChunkFromDatabaseFilters, + params *Parameters, +) (lastEpochForValidatorIndex primitives.Epoch, chunkIndex, validatorChunkIndex uint64, chunk Chunker, err error) { + // init store + d, err := slasherkv.NewKVStore(ctx, dbPath) + if err != nil { + return lastEpochForValidatorIndex, chunkIndex, validatorChunkIndex, chunk, fmt.Errorf("could not open database at path %s: %w", dbPath, err) + } + defer closeDB(d) + + // init service + s := Service{ + params: params, + serviceCfg: &ServiceConfig{ + Database: d, + }, + } + + // variables + validatorIndex := filters.ValidatorIndex + sourceEpoch := filters.SourceEpoch + chunkKind := filters.ChunkKind + validatorChunkIndex = s.params.validatorChunkIndex(validatorIndex) + chunkIndex = s.params.chunkIndex(sourceEpoch) + + // before getting the chunk, we need to verify if the requested epoch is in database + lastEpochForValidator, err := s.serviceCfg.Database.LastEpochWrittenForValidators(ctx, []primitives.ValidatorIndex{validatorIndex}) + if err != nil { + return lastEpochForValidatorIndex, + chunkIndex, + validatorChunkIndex, + chunk, + fmt.Errorf("could not get last epoch written for validator %d: %w", validatorIndex, err) + } + + if len(lastEpochForValidator) == 0 { + return lastEpochForValidatorIndex, + chunkIndex, + validatorChunkIndex, + chunk, + fmt.Errorf("could not get information at epoch %d for validator %d: there's no record found in slasher database", + sourceEpoch, validatorIndex, + ) + } + lastEpochForValidatorIndex = lastEpochForValidator[0].Epoch + + // if the epoch requested is within the range, we can proceed to get the chunk, otherwise return error + atBestSmallestEpoch := lastEpochForValidatorIndex.Sub(uint64(params.historyLength)) + if sourceEpoch < atBestSmallestEpoch || sourceEpoch > lastEpochForValidatorIndex { + return lastEpochForValidatorIndex, + chunkIndex, + validatorChunkIndex, + chunk, + fmt.Errorf("requested epoch %d is outside the slasher history length %d, data can be provided within the epoch range [%d:%d] for validator %d", + sourceEpoch, params.historyLength, atBestSmallestEpoch, lastEpochForValidatorIndex, validatorIndex, + ) + } + + // fetch chunk from DB + chunk, err = s.getChunkFromDatabase(ctx, chunkKind, validatorChunkIndex, chunkIndex) + if err != nil { + return lastEpochForValidatorIndex, + chunkIndex, + validatorChunkIndex, + chunk, + fmt.Errorf("could not get chunk at index %d: %w", chunkIndex, err) + } + + return lastEpochForValidatorIndex, chunkIndex, validatorChunkIndex, chunk, nil +} + +func closeDB(d *slasherkv.Store) { + if err := d.Close(); err != nil { + log.WithError(err).Error("could not close database") + } +} diff --git a/beacon-chain/slasher/params.go b/beacon-chain/slasher/params.go index 5512c54113d9..59cf044e981a 100644 --- a/beacon-chain/slasher/params.go +++ b/beacon-chain/slasher/params.go @@ -16,6 +16,21 @@ type Parameters struct { historyLength primitives.Epoch // H - defines how many epochs we keep of min or max spans. } +// ChunkSize returns the chunk size. +func (p *Parameters) ChunkSize() uint64 { + return p.chunkSize +} + +// ValidatorChunkSize returns the validator chunk size. +func (p *Parameters) ValidatorChunkSize() uint64 { + return p.validatorChunkSize +} + +// HistoryLength returns the history length. +func (p *Parameters) HistoryLength() primitives.Epoch { + return p.historyLength +} + // DefaultParams defines default values for slasher's important parameters, defined // based on optimization analysis for best and worst case scenarios for // slasher's performance. @@ -32,7 +47,15 @@ func DefaultParams() *Parameters { } } -// Validator min and max spans are split into chunks of length C = chunkSize. +func NewParams(chunkSize, validatorChunkSize uint64, historyLength primitives.Epoch) *Parameters { + return &Parameters{ + chunkSize: chunkSize, + validatorChunkSize: validatorChunkSize, + historyLength: historyLength, + } +} + +// ChunkIndex Validator min and max spans are split into chunks of length C = chunkSize. // That is, if we are keeping N epochs worth of attesting history, finding what // chunk a certain epoch, e, falls into can be computed as (e % N) / C. For example, // if we are keeping 6 epochs worth of data, and we have chunks of size 2, then epoch @@ -139,9 +162,9 @@ func (p *Parameters) flatSliceID(validatorChunkIndex, chunkIndex uint64) []byte return ssz.MarshalUint64(make([]byte, 0), uint64(width.Mul(validatorChunkIndex).Add(chunkIndex))) } -// Given a validator chunk index, we determine all of the validator +// ValidatorIndexesInChunk Given a validator chunk index, we determine all the validators // indices that will belong in that chunk. -func (p *Parameters) validatorIndexesInChunk(validatorChunkIndex uint64) []primitives.ValidatorIndex { +func (p *Parameters) ValidatorIndexesInChunk(validatorChunkIndex uint64) []primitives.ValidatorIndex { validatorIndices := make([]primitives.ValidatorIndex, 0) low := validatorChunkIndex * p.validatorChunkSize high := (validatorChunkIndex + 1) * p.validatorChunkSize diff --git a/beacon-chain/slasher/params_test.go b/beacon-chain/slasher/params_test.go index 67140c4e1d38..bfff8fc55a11 100644 --- a/beacon-chain/slasher/params_test.go +++ b/beacon-chain/slasher/params_test.go @@ -468,7 +468,7 @@ func TestParams_validatorIndicesInChunk(t *testing.T) { c := &Parameters{ validatorChunkSize: tt.fields.validatorChunkSize, } - if got := c.validatorIndexesInChunk(tt.validatorChunkIdx); !reflect.DeepEqual(got, tt.want) { + if got := c.ValidatorIndexesInChunk(tt.validatorChunkIdx); !reflect.DeepEqual(got, tt.want) { t.Errorf("validatorIndicesInChunk() = %v, want %v", got, tt.want) } }) diff --git a/beacon-chain/slasher/service.go b/beacon-chain/slasher/service.go index be3ddfe724c4..5de7c859d10e 100644 --- a/beacon-chain/slasher/service.go +++ b/beacon-chain/slasher/service.go @@ -161,7 +161,7 @@ func (s *Service) Stop() error { ctx, innerCancel := context.WithTimeout(context.Background(), shutdownTimeout) defer innerCancel() log.Info("Flushing last epoch written for each validator to disk, please wait") - if err := s.serviceCfg.Database.SaveLastEpochsWrittenForValidators( + if err := s.serviceCfg.Database.SaveLastEpochWrittenForValidators( ctx, s.latestEpochUpdatedForValidator, ); err != nil { log.Error(err) diff --git a/beacon-chain/slasher/types/BUILD.bazel b/beacon-chain/slasher/types/BUILD.bazel index 9578171f30c4..e8b935388d1c 100644 --- a/beacon-chain/slasher/types/BUILD.bazel +++ b/beacon-chain/slasher/types/BUILD.bazel @@ -4,7 +4,10 @@ go_library( name = "go_default_library", srcs = ["types.go"], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types", - visibility = ["//beacon-chain:__subpackages__"], + visibility = [ + "//beacon-chain:__subpackages__", + "//cmd/prysmctl:__subpackages__", + ], deps = [ "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/slasher/types/types.go b/beacon-chain/slasher/types/types.go index 882cc6d3936f..c1699227e88d 100644 --- a/beacon-chain/slasher/types/types.go +++ b/beacon-chain/slasher/types/types.go @@ -14,6 +14,18 @@ const ( MaxSpan ) +// String returns the string representation of the chunk kind. +func (c ChunkKind) String() string { + switch c { + case MinSpan: + return "minspan" + case MaxSpan: + return "maxspan" + default: + return "unknown" + } +} + // IndexedAttestationWrapper contains an indexed attestation with its // data root to reduce duplicated computation. type IndexedAttestationWrapper struct { diff --git a/cmd/prysmctl/db/BUILD.bazel b/cmd/prysmctl/db/BUILD.bazel index bbecb3eb66e4..fddfd2336fd9 100644 --- a/cmd/prysmctl/db/BUILD.bazel +++ b/cmd/prysmctl/db/BUILD.bazel @@ -6,13 +6,18 @@ go_library( "buckets.go", "cmd.go", "query.go", + "span.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/db", visibility = ["//visibility:public"], deps = [ "//beacon-chain/db/kv:go_default_library", + "//beacon-chain/slasher:go_default_library", + "//beacon-chain/slasher/types:go_default_library", "//config/params:go_default_library", + "//consensus-types/primitives:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_jedib0t_go_pretty_v6//table:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", diff --git a/cmd/prysmctl/db/cmd.go b/cmd/prysmctl/db/cmd.go index d32112356579..bb0206e2016d 100644 --- a/cmd/prysmctl/db/cmd.go +++ b/cmd/prysmctl/db/cmd.go @@ -9,6 +9,7 @@ var Commands = []*cli.Command{ Subcommands: []*cli.Command{ queryCmd, bucketsCmd, + spanCmd, }, }, } diff --git a/cmd/prysmctl/db/span.go b/cmd/prysmctl/db/span.go new file mode 100644 index 000000000000..0af75000fe98 --- /dev/null +++ b/cmd/prysmctl/db/span.go @@ -0,0 +1,304 @@ +package db + +import ( + "fmt" + + "github.com/jedib0t/go-pretty/v6/table" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/urfave/cli/v2" +) + +const DefaultChunkKind = types.MinSpan + +var ( + f = struct { + Path string + ValidatorIndex uint64 + Epoch uint64 + ChunkKind string + ChunkSize uint64 + ValidatorChunkSize uint64 + HistoryLength uint64 + IsDisplayAllValidatorsInChunk bool + IsDisplayAllEpochsInChunk bool + }{} + + slasherDefaultParams = slasher.DefaultParams() +) + +var spanCmd = &cli.Command{ + Name: "slasher-span-display", + Usage: "visualise values in db span bucket", + Action: func(c *cli.Context) error { + if err := spanAction(c); err != nil { + return errors.Wrapf(err, "visualise values in db span bucket failed") + } + return nil + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "db-path-directory", + Usage: "path to directory containing slasher.db", + Destination: &f.Path, + Required: true, + }, + &cli.Uint64Flag{ + Name: "validator-index", + Usage: "filter by validator index", + Destination: &f.ValidatorIndex, + Required: true, + }, + &cli.Uint64Flag{ + Name: "epoch", + Usage: "filter by epoch", + Destination: &f.Epoch, + Required: true, + }, + &cli.StringFlag{ + Name: "chunk-kind", + Usage: "chunk kind to query (maxspan|minspan)", + Destination: &f.ChunkKind, + Value: DefaultChunkKind.String(), + DefaultText: DefaultChunkKind.String(), + }, + &cli.Uint64Flag{ + Name: "chunk-size", + Usage: "chunk size to query", + Destination: &f.ChunkSize, + DefaultText: fmt.Sprintf("%d", slasherDefaultParams.ChunkSize()), + }, + &cli.Uint64Flag{ + Name: "validator-chunk-size", + Usage: "validator chunk size to query", + Destination: &f.ValidatorChunkSize, + DefaultText: fmt.Sprintf("%d", slasherDefaultParams.ValidatorChunkSize()), + }, + &cli.Uint64Flag{ + Name: "history-length", + Usage: "history length to query", + Destination: &f.HistoryLength, + DefaultText: fmt.Sprintf("%d", slasherDefaultParams.HistoryLength()), + }, + &cli.BoolFlag{ + Name: "display-all-validators-in-chunk", + Usage: "display all validators in chunk", + Destination: &f.IsDisplayAllValidatorsInChunk, + }, + &cli.BoolFlag{ + Name: "display-all-epochs-in-chunk", + Usage: "display all epochs in chunk", + Destination: &f.IsDisplayAllEpochsInChunk, + }, + }, +} + +func spanAction(cliCtx *cli.Context) error { + var ( + chunk slasher.Chunker + validatorChunkIdx uint64 + lastEpochForValidatorIndex primitives.Epoch + + err error + ) + + // context + ctx := cliCtx.Context + + // variables + chunkKind := getChunkKind() + params := getSlasherParams() + i := primitives.ValidatorIndex(f.ValidatorIndex) + epoch := primitives.Epoch(f.Epoch) + + // display configuration + fmt.Printf("############################# SLASHER PARAMS ###############################\n") + fmt.Printf("# Chunk Size: %d\n", params.ChunkSize()) + fmt.Printf("# Validator Chunk Size: %d\n", params.ValidatorChunkSize()) + fmt.Printf("# History Length: %d\n", params.HistoryLength()) + fmt.Printf("# DB: %s\n", f.Path) + fmt.Printf("# Chunk Kind: %s\n", chunkKind) + fmt.Printf("# Validator: %d\n", i) + fmt.Printf("# Epoch: %d\n", epoch) + fmt.Printf("############################################################################\n") + + // fetch chunk in database + if lastEpochForValidatorIndex, _, validatorChunkIdx, chunk, err = slasher.GetChunkFromDatabase( + ctx, + f.Path, + slasher.GetChunkFromDatabaseFilters{ + ChunkKind: chunkKind, + ValidatorIndex: i, + SourceEpoch: epoch, + IsDisplayAllValidatorsInChunk: f.IsDisplayAllValidatorsInChunk, + IsDisplayAllEpochsInChunk: f.IsDisplayAllEpochsInChunk, + }, + params, + ); err != nil { + return errors.Wrapf(err, "could not get chunk from database") + } + + // fetch information related to chunk + fmt.Printf("\n################################ CHUNK #####################################\n") + firstValidator := params.ValidatorIndexesInChunk(validatorChunkIdx)[0] + firstEpoch := epoch - (epoch.Mod(params.ChunkSize())) + fmt.Printf("# First validator in chunk: %d\n", firstValidator) + fmt.Printf("# First epoch in chunk: %d\n\n", firstEpoch) + fmt.Printf("# Last epoch found in database for validator(%d): %d\n", i, lastEpochForValidatorIndex) + fmt.Printf("############################################################################\n\n") + + // init table + tw := table.NewWriter() + + minLowerBound := lastEpochForValidatorIndex.Sub(uint64(params.HistoryLength())) + if f.IsDisplayAllValidatorsInChunk { + if f.IsDisplayAllEpochsInChunk { + // display all validators and epochs in chunk + + // headers + addEpochsHeader(tw, params.ChunkSize(), firstEpoch) + + // rows + b := chunk.Chunk() + c := uint64(0) + for z := uint64(0); z < uint64(len(b)); z += params.ChunkSize() { + end := z + params.ChunkSize() + if end > uint64(len(b)) { + end = uint64(len(b)) + } + subChunk := b[z:end] + + row := make(table.Row, params.ChunkSize()+1) + title := firstValidator + primitives.ValidatorIndex(c) + row[0] = title + for y, span := range subChunk { + row[y+1] = getSpanOrNonApplicable(firstEpoch, y, minLowerBound, lastEpochForValidatorIndex, span) + } + tw.AppendRow(row) + + c++ + } + } else { + // display all validators but only the requested epoch in chunk + indexEpochInChunk := epoch - firstEpoch + + // headers + addEpochsHeader(tw, 1, firstEpoch) + + // rows + b := chunk.Chunk() + c := uint64(0) + for z := uint64(0); z < uint64(len(b)); z += params.ChunkSize() { + end := z + params.ChunkSize() + if end > uint64(len(b)) { + end = uint64(len(b)) + } + subChunk := b[z:end] + + row := make(table.Row, 2) + title := firstValidator + primitives.ValidatorIndex(c) + row[0] = title + row[1] = subChunk[indexEpochInChunk] + tw.AppendRow(row) + + c++ + } + } + } else { + if f.IsDisplayAllEpochsInChunk { + // display only the requested validator with all epochs in chunk + + // headers + addEpochsHeader(tw, params.ChunkSize(), firstEpoch) + + // rows + b := chunk.Chunk() + validatorFirstEpochIdx := uint64(i.Mod(params.ValidatorChunkSize())) * params.ChunkSize() + subChunk := b[validatorFirstEpochIdx : validatorFirstEpochIdx+params.ChunkSize()] + row := make(table.Row, params.ChunkSize()+1) + title := i + row[0] = title + for y, span := range subChunk { + row[y+1] = getSpanOrNonApplicable(firstEpoch, y, minLowerBound, lastEpochForValidatorIndex, span) + } + tw.AppendRow(row) + } else { + // display only the requested validator and epoch in chunk + + // headers + addEpochsHeader(tw, 1, epoch) + + // rows + b := chunk.Chunk() + validatorFirstEpochIdx := uint64(i.Mod(params.ValidatorChunkSize())) * params.ChunkSize() + subChunk := b[validatorFirstEpochIdx : validatorFirstEpochIdx+params.ChunkSize()] + row := make(table.Row, 2) + title := i + row[0] = title + indexEpochInChunk := epoch - firstEpoch + row[1] = subChunk[indexEpochInChunk] + tw.AppendRow(row) + } + } + + // display table + displayTable(tw) + + return nil +} + +// getSpanOrNonApplicable checks if there's some epoch that are not correct in chunk due to the round robin +// nature of 2D chunking when an epoch gets overwritten by an epoch eg. (params.historyLength + next_epoch) > params.historyLength +// if we are out of the range, we display a n/a value otherwise the span value +func getSpanOrNonApplicable(firstEpoch primitives.Epoch, y int, minLowerBound primitives.Epoch, lastEpochForValidatorIndex primitives.Epoch, span uint16) string { + if firstEpoch.Add(uint64(y)) < minLowerBound || firstEpoch.Add(uint64(y)) > lastEpochForValidatorIndex { + return "-" + } + return fmt.Sprintf("%d", span) +} + +func displayTable(tw table.Writer) { + tw.AppendSeparator() + fmt.Println(tw.Render()) +} + +func addEpochsHeader(tw table.Writer, nbEpoch uint64, firstEpoch primitives.Epoch) { + header := table.Row{"Validator / Epoch"} + for y := 0; uint64(y) < nbEpoch; y++ { + header = append(header, firstEpoch+primitives.Epoch(y)) + } + tw.AppendHeader(header) +} + +func getChunkKind() types.ChunkKind { + chunkKind := types.MinSpan + if f.ChunkKind == "maxspan" { + chunkKind = types.MaxSpan + } + return chunkKind +} + +func getSlasherParams() *slasher.Parameters { + var ( + chunkSize, validatorChunkSize uint64 + historyLength primitives.Epoch + ) + if f.ChunkSize != 0 && f.ChunkSize != slasherDefaultParams.ChunkSize() { + chunkSize = f.ChunkSize + } else { + chunkSize = slasherDefaultParams.ChunkSize() + } + if f.ValidatorChunkSize != 0 && f.ValidatorChunkSize != slasherDefaultParams.ValidatorChunkSize() { + validatorChunkSize = f.ValidatorChunkSize + } else { + validatorChunkSize = slasherDefaultParams.ValidatorChunkSize() + } + if f.HistoryLength != 0 && f.HistoryLength != uint64(slasherDefaultParams.HistoryLength()) { + historyLength = primitives.Epoch(f.HistoryLength) + } else { + historyLength = slasherDefaultParams.HistoryLength() + } + return slasher.NewParams(chunkSize, validatorChunkSize, historyLength) +} diff --git a/deps.bzl b/deps.bzl index 3a0e8ad7be5a..5138a698d45c 100644 --- a/deps.bzl +++ b/deps.bzl @@ -5265,6 +5265,12 @@ def prysm_deps(): sum = "h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=", version = "v1.26.0", ) + go_repository( + name = "com_github_jedib0t_go_pretty_v6", + importpath = "github.com/jedib0t/go-pretty/v6", + sum = "h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/5l91s=", + version = "v6.5.4", + ) http_archive( name = "com_github_supranational_blst", diff --git a/go.mod b/go.mod index 7125cb59cf2c..b37225eb493c 100644 --- a/go.mod +++ b/go.mod @@ -39,6 +39,7 @@ require ( github.com/holiman/uint256 v1.2.4 github.com/ianlancetaylor/cgosymbolizer v0.0.0-20200424224625-be1b05b0b279 github.com/ipfs/go-log/v2 v2.5.1 + github.com/jedib0t/go-pretty/v6 v6.5.4 github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d github.com/json-iterator/go v1.1.12 github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 @@ -237,7 +238,7 @@ require ( golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -258,7 +259,7 @@ require ( github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect github.com/prysmaticlabs/gohashtree v0.0.4-beta - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sys v0.16.0 // indirect google.golang.org/api v0.44.0 // indirect google.golang.org/appengine v1.6.7 // indirect k8s.io/klog/v2 v2.80.0 // indirect diff --git a/go.sum b/go.sum index bca04ee0f6a4..60ac9b9c6d47 100644 --- a/go.sum +++ b/go.sum @@ -569,6 +569,8 @@ github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+ github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jedib0t/go-pretty/v6 v6.5.4 h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/5l91s= +github.com/jedib0t/go-pretty/v6 v6.5.4/go.mod h1:5LQIxa52oJ/DlDSLv0HEkWOFMDGoWkJb9ss5KqPpJBg= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jhump/protoreflect v1.8.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -1412,13 +1414,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 12482eeb40ed4273a1c2bc2ad7385c18f28eb72a Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 27 Mar 2024 13:39:45 -0300 Subject: [PATCH 009/325] Remove check for duplicates in pending attestation queue (#13814) * Remove check for duplicates in pending attestation queue The current queue will only save 1 unaggregated attestation for a pending block because we wrap the object into a SignedAggregatedAttestationAndProof with a zeroed aggregator. * fix tests --- .../sync/pending_attestations_queue.go | 27 +++++++++++++++---- .../sync/pending_attestations_queue_test.go | 4 +-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index 82b80324a1e9..66d705db64d6 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -1,6 +1,7 @@ package sync import ( + "bytes" "context" "encoding/hex" "sync" @@ -157,7 +158,8 @@ func (s *Service) processAttestations(ctx context.Context, attestations []*ethpb // This defines how pending attestations is saved in the map. The key is the // root of the missing block. The value is the list of pending attestations -// that voted for that block root. +// that voted for that block root. The caller of this function is responsible +// for not sending repeated attestations to the pending queue. func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) { root := bytesutil.ToBytes32(att.Message.Aggregate.Data.BeaconBlockRoot) @@ -178,17 +180,32 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) s.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{att} return } - - // Skip if the attestation from the same aggregator already exists in the pending queue. + // Skip if the attestation from the same aggregator already exists in + // the pending queue. for _, a := range s.blkRootToPendingAtts[root] { - if a.Message.AggregatorIndex == att.Message.AggregatorIndex { + if attsAreEqual(att, a) { return } } - s.blkRootToPendingAtts[root] = append(s.blkRootToPendingAtts[root], att) } +func attsAreEqual(a, b *ethpb.SignedAggregateAttestationAndProof) bool { + if a.Signature != nil { + return b.Signature != nil && a.Message.AggregatorIndex == b.Message.AggregatorIndex + } + if b.Signature != nil { + return false + } + if a.Message.Aggregate.Data.Slot != b.Message.Aggregate.Data.Slot { + return false + } + if a.Message.Aggregate.Data.CommitteeIndex != b.Message.Aggregate.Data.CommitteeIndex { + return false + } + return bytes.Equal(a.Message.Aggregate.AggregationBits, b.Message.Aggregate.AggregationBits) +} + // This validates the pending attestations in the queue are still valid. // If not valid, a node will remove it in the queue in place. The validity // check specifies the pending attestation could not fall one epoch behind diff --git a/beacon-chain/sync/pending_attestations_queue_test.go b/beacon-chain/sync/pending_attestations_queue_test.go index 88288f310289..3f32b8fa8d51 100644 --- a/beacon-chain/sync/pending_attestations_queue_test.go +++ b/beacon-chain/sync/pending_attestations_queue_test.go @@ -399,7 +399,7 @@ func TestValidatePendingAtts_CanPruneOldAtts(t *testing.T) { assert.Equal(t, 0, len(s.blkRootToPendingAtts), "Did not delete block keys") } -func TestValidatePendingAtts_NoDuplicatingAggregatorIndex(t *testing.T) { +func TestValidatePendingAtts_NoDuplicatingAtts(t *testing.T) { s := &Service{ blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), } @@ -420,7 +420,7 @@ func TestValidatePendingAtts_NoDuplicatingAggregatorIndex(t *testing.T) { Message: ðpb.AggregateAttestationAndProof{ AggregatorIndex: 2, Aggregate: ðpb.Attestation{ - Data: ðpb.AttestationData{Slot: 3, BeaconBlockRoot: r2[:]}}}}) + Data: ðpb.AttestationData{Slot: 2, BeaconBlockRoot: r2[:]}}}}) assert.Equal(t, 1, len(s.blkRootToPendingAtts[r1]), "Did not save pending atts") assert.Equal(t, 1, len(s.blkRootToPendingAtts[r2]), "Did not save pending atts") From 1b0e09369e877ec556910891fa4a9283d2355951 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 27 Mar 2024 15:20:53 -0300 Subject: [PATCH 010/325] Add metrics to track pending attestations (#13815) --- beacon-chain/sync/metrics.go | 4 ++++ beacon-chain/sync/pending_attestations_queue.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/beacon-chain/sync/metrics.go b/beacon-chain/sync/metrics.go index 9993394812fc..07502117a458 100644 --- a/beacon-chain/sync/metrics.go +++ b/beacon-chain/sync/metrics.go @@ -150,6 +150,10 @@ var ( Help: "Time to verify gossiped blob sidecars", }, ) + pendingAttCount = promauto.NewCounter(prometheus.CounterOpts{ + Name: "gossip_pending_attestations_total", + Help: "increased when receiving a new pending attestation", + }) // Sync committee verification performance. syncMessagesForUnknownBlocks = promauto.NewCounter( diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index 66d705db64d6..cb936a9330e6 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -177,6 +177,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) _, ok := s.blkRootToPendingAtts[root] if !ok { + pendingAttCount.Inc() s.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{att} return } @@ -187,6 +188,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) return } } + pendingAttCount.Inc() s.blkRootToPendingAtts[root] = append(s.blkRootToPendingAtts[root], att) } From d6f9196707c11fdfacdc2e98d52610d8298ec1fe Mon Sep 17 00:00:00 2001 From: terence Date: Wed, 27 Mar 2024 21:14:37 -0700 Subject: [PATCH 011/325] Change goodbye message from rate limited peer to debug verbosity (#13819) --- beacon-chain/sync/rpc_goodbye.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/sync/rpc_goodbye.go b/beacon-chain/sync/rpc_goodbye.go index a32e8c884ef7..4c27e0b55cf8 100644 --- a/beacon-chain/sync/rpc_goodbye.go +++ b/beacon-chain/sync/rpc_goodbye.go @@ -42,7 +42,7 @@ func (s *Service) goodbyeRPCHandler(_ context.Context, msg interface{}, stream l return fmt.Errorf("wrong message type for goodbye, got %T, wanted *uint64", msg) } if err := s.rateLimiter.validateRequest(stream, 1); err != nil { - log.WithError(err).Warn("Goodbye message from rate-limited peer.") + log.WithError(err).Debug("Goodbye message from rate-limited peer.") } else { s.rateLimiter.add(stream, 1) } From 9b2d53b0d123e4648a5f9f2c74b6a5bec1e42abe Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Thu, 28 Mar 2024 09:38:46 +0100 Subject: [PATCH 012/325] Bump libp2p to `v0.33.1` (#13784) * Run bare `//:gazelle -- update-repos`. --> Removes some blank lines. * Update libp2p to `v0.33.1`. --- deps.bzl | 528 ++++++++++++------------------------------------------- go.mod | 62 ++++--- go.sum | 128 +++++++------- 3 files changed, 200 insertions(+), 518 deletions(-) diff --git a/deps.bzl b/deps.bzl index 5138a698d45c..d119c640e6d7 100644 --- a/deps.bzl +++ b/deps.bzl @@ -40,28 +40,24 @@ def prysm_deps(): sum = "h1:VUeHARd+9362HPYyFWjsRa6jBIAf2xWbDv6QXMRztbQ=", version = "v0.5.0-0.dev.0.20231205170804-aef76f4feee2", ) - go_repository( name = "com_github_aclements_go_moremath", importpath = "github.com/aclements/go-moremath", sum = "h1:xlwdaKcTNVW4PtpQb8aKA4Pjy0CdJHEqvFbAnvR5m2g=", version = "v0.0.0-20210112150236-f10218a38794", ) - go_repository( name = "com_github_afex_hystrix_go", importpath = "github.com/afex/hystrix-go", sum = "h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=", version = "v0.0.0-20180502004556-fa1af6a1f4f5", ) - go_repository( name = "com_github_alecthomas_kingpin_v2", importpath = "github.com/alecthomas/kingpin/v2", - sum = "h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWrKI6ocU=", - version = "v2.3.2", + sum = "h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=", + version = "v2.4.0", ) - go_repository( name = "com_github_alecthomas_template", importpath = "github.com/alecthomas/template", @@ -86,35 +82,30 @@ def prysm_deps(): sum = "h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M=", version = "v0.0.0-20190825152654-46b345b51c96", ) - go_repository( name = "com_github_andybalholm_brotli", importpath = "github.com/andybalholm/brotli", sum = "h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=", version = "v1.0.5", ) - go_repository( name = "com_github_anmitsu_go_shlex", importpath = "github.com/anmitsu/go-shlex", sum = "h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=", version = "v0.0.0-20161002113705-648efa622239", ) - go_repository( name = "com_github_antihax_optional", importpath = "github.com/antihax/optional", sum = "h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=", version = "v1.0.0", ) - go_repository( name = "com_github_apache_thrift", importpath = "github.com/apache/thrift", sum = "h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI=", version = "v0.13.0", ) - go_repository( name = "com_github_aristanetworks_fsnotify", importpath = "github.com/aristanetworks/fsnotify", @@ -127,7 +118,6 @@ def prysm_deps(): sum = "h1:Bmjk+DjIi3tTAU0wxGaFbfjGUqlxxSXARq9A96Kgoos=", version = "v0.0.0-20191112221043-67e8567f59f3", ) - go_repository( name = "com_github_aristanetworks_goarista", importpath = "github.com/aristanetworks/goarista", @@ -146,7 +136,6 @@ def prysm_deps(): sum = "h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA=", version = "v0.0.0-20150827004946-bbbad097214e", ) - go_repository( name = "com_github_armon_go_metrics", importpath = "github.com/armon/go-metrics", @@ -171,14 +160,12 @@ def prysm_deps(): sum = "h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=", version = "v0.0.0-20190424111038-f61b66f89f4a", ) - go_repository( name = "com_github_aws_aws_lambda_go", importpath = "github.com/aws/aws-lambda-go", sum = "h1:SuCy7H3NLyp+1Mrfp+m80jcbi9KYWAs9/BXwppwRDzY=", version = "v1.13.3", ) - go_repository( name = "com_github_aws_aws_sdk_go", importpath = "github.com/aws/aws-sdk-go", @@ -227,7 +214,6 @@ def prysm_deps(): sum = "h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4=", version = "v1.3.45", ) - go_repository( name = "com_github_aws_aws_sdk_go_v2_service_internal_presigned_url", importpath = "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url", @@ -252,7 +238,6 @@ def prysm_deps(): sum = "h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk=", version = "v1.17.3", ) - go_repository( name = "com_github_aws_aws_sdk_go_v2_service_sts", importpath = "github.com/aws/aws-sdk-go-v2/service/sts", @@ -271,7 +256,6 @@ def prysm_deps(): sum = "h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=", version = "v0.2.0", ) - go_repository( name = "com_github_azure_azure_sdk_for_go_sdk_azcore", importpath = "github.com/Azure/azure-sdk-for-go/sdk/azcore", @@ -296,7 +280,6 @@ def prysm_deps(): sum = "h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=", version = "v14.2.0+incompatible", ) - go_repository( name = "com_github_azure_go_autorest_autorest", importpath = "github.com/Azure/go-autorest/autorest", @@ -345,7 +328,6 @@ def prysm_deps(): sum = "h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=", version = "v1.3.5", ) - go_repository( name = "com_github_beorn7_perks", importpath = "github.com/beorn7/perks", @@ -358,7 +340,6 @@ def prysm_deps(): sum = "h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=", version = "v0.0.0-20140422174119-9fd32a8b3d3d", ) - go_repository( name = "com_github_bgentry_speakeasy", importpath = "github.com/bgentry/speakeasy", @@ -371,35 +352,30 @@ def prysm_deps(): sum = "h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k=", version = "v1.11.0", ) - go_repository( name = "com_github_bketelsen_crypt", importpath = "github.com/bketelsen/crypt", sum = "h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc=", version = "v0.0.3-0.20200106085610-5cbc8cc4026c", ) - go_repository( name = "com_github_bradfitz_go_smtpd", importpath = "github.com/bradfitz/go-smtpd", sum = "h1:ckJgFhFWywOx+YLEMIJsTb+NV6NexWICk5+AMSuz3ss=", version = "v0.0.0-20170404230938-deb6d6237625", ) - go_repository( name = "com_github_bradfitz_gomemcache", importpath = "github.com/bradfitz/gomemcache", sum = "h1:7IjN4QP3c38xhg6wz8R3YjoU+6S9e7xBc0DAVLLIpHE=", version = "v0.0.0-20170208213004-1952afaa557d", ) - go_repository( name = "com_github_btcsuite_btcd_btcec_v2", importpath = "github.com/btcsuite/btcd/btcec/v2", sum = "h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=", version = "v2.3.2", ) - go_repository( name = "com_github_btcsuite_btcd_chaincfg_chainhash", importpath = "github.com/btcsuite/btcd/chaincfg/chainhash", @@ -412,14 +388,12 @@ def prysm_deps(): sum = "h1:11zJVA0D4uJVGOC9h+oOVHrKKoBgMYIqJJ0d1Xt6oeQ=", version = "v0.37.0", ) - go_repository( name = "com_github_buger_jsonparser", importpath = "github.com/buger/jsonparser", sum = "h1:D21IyuvjDCshj1/qq+pCNd3VZOAEI9jy6Bi131YlXgI=", version = "v0.0.0-20181115193947-bf1c66bbce23", ) - go_repository( name = "com_github_burntsushi_toml", importpath = "github.com/BurntSushi/toml", @@ -432,7 +406,6 @@ def prysm_deps(): sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", version = "v0.0.0-20160522181843-27f122750802", ) - go_repository( name = "com_github_casbin_casbin_v2", importpath = "github.com/casbin/casbin/v2", @@ -445,7 +418,6 @@ def prysm_deps(): sum = "h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=", version = "v2.2.1+incompatible", ) - go_repository( name = "com_github_census_instrumentation_opencensus_proto", importpath = "github.com/census-instrumentation/opencensus-proto", @@ -458,7 +430,6 @@ def prysm_deps(): sum = "h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU=", version = "v1.1.1", ) - go_repository( name = "com_github_cespare_xxhash", importpath = "github.com/cespare/xxhash", @@ -489,7 +460,6 @@ def prysm_deps(): sum = "h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=", version = "v1.0.0", ) - go_repository( name = "com_github_chzyer_logex", importpath = "github.com/chzyer/logex", @@ -514,14 +484,12 @@ def prysm_deps(): sum = "h1:64sn2K3UKw8NbP/blsixRpF3nXuyhz/VjRlRzvlBRu4=", version = "v0.9.1", ) - go_repository( name = "com_github_clbanning_x2j", importpath = "github.com/clbanning/x2j", sum = "h1:EdRZT3IeKQmfCSrgo8SZ8V3MEnskuJP0wCYNpe+aiXo=", version = "v0.0.0-20191024224557-825249438eec", ) - go_repository( name = "com_github_client9_misspell", importpath = "github.com/client9/misspell", @@ -540,14 +508,12 @@ def prysm_deps(): sum = "h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=", version = "v0.0.0-20200109182630-33d98a066a53", ) - go_repository( name = "com_github_cloudykit_jet_v6", importpath = "github.com/CloudyKit/jet/v6", sum = "h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME=", version = "v6.2.0", ) - go_repository( name = "com_github_cncf_udpa_go", importpath = "github.com/cncf/udpa/go", @@ -560,7 +526,6 @@ def prysm_deps(): sum = "h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=", version = "v0.0.0-20230607035331-e9ce68804cb4", ) - go_repository( name = "com_github_cockroachdb_datadriven", importpath = "github.com/cockroachdb/datadriven", @@ -604,7 +569,6 @@ def prysm_deps(): sum = "h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=", version = "v0.0.0-20230807174530-cc333fc44b06", ) - go_repository( name = "com_github_codahale_hdrhistogram", importpath = "github.com/codahale/hdrhistogram", @@ -617,7 +581,6 @@ def prysm_deps(): sum = "h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=", version = "v0.0.0-20150114235600-33e0aa1cb7c0", ) - go_repository( name = "com_github_consensys_bavard", importpath = "github.com/consensys/bavard", @@ -630,7 +593,6 @@ def prysm_deps(): sum = "h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=", version = "v0.12.1", ) - go_repository( name = "com_github_containerd_cgroups", build_file_proto_mode = "disable_global", @@ -644,14 +606,12 @@ def prysm_deps(): sum = "h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s=", version = "v1.3.2", ) - go_repository( name = "com_github_coreos_etcd", importpath = "github.com/coreos/etcd", sum = "h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=", version = "v3.3.13+incompatible", ) - go_repository( name = "com_github_coreos_go_semver", importpath = "github.com/coreos/go-semver", @@ -670,14 +630,12 @@ def prysm_deps(): sum = "h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=", version = "v22.5.0", ) - go_repository( name = "com_github_coreos_pkg", importpath = "github.com/coreos/pkg", sum = "h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=", version = "v0.0.0-20180928190104-399ea9e2e55f", ) - go_repository( name = "com_github_cpuguy83_go_md2man_v2", importpath = "github.com/cpuguy83/go-md2man/v2", @@ -696,7 +654,6 @@ def prysm_deps(): sum = "h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA=", version = "v0.7.0", ) - go_repository( name = "com_github_creack_pty", importpath = "github.com/creack/pty", @@ -709,21 +666,18 @@ def prysm_deps(): sum = "h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM=", version = "v0.0.0-20141128023046-ca7fffd4298c", ) - go_repository( name = "com_github_d4l3k_messagediff", importpath = "github.com/d4l3k/messagediff", sum = "h1:ZcAIMYsUg0EAp9X+tt8/enBE/Q8Yd5kzPynLyKptt9U=", version = "v1.2.1", ) - go_repository( name = "com_github_datadog_zstd", importpath = "github.com/DataDog/zstd", sum = "h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=", version = "v1.5.5", ) - go_repository( name = "com_github_davecgh_go_spew", importpath = "github.com/davecgh/go-spew", @@ -736,14 +690,12 @@ def prysm_deps(): sum = "h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU=", version = "v0.0.0-20200604182044-b73af7476f6c", ) - go_repository( name = "com_github_deckarep_golang_set_v2", importpath = "github.com/deckarep/golang-set/v2", sum = "h1:hn6cEZtQ0h3J8kFrHR/NrzyOoTnjgW1+FmNJzQ7y/sA=", version = "v2.5.0", ) - go_repository( name = "com_github_decred_dcrd_crypto_blake256", importpath = "github.com/decred/dcrd/crypto/blake256", @@ -756,7 +708,6 @@ def prysm_deps(): sum = "h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=", version = "v4.2.0", ) - go_repository( name = "com_github_deepmap_oapi_codegen", importpath = "github.com/deepmap/oapi-codegen", @@ -769,7 +720,6 @@ def prysm_deps(): sum = "h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8=", version = "v1.6.2", ) - go_repository( name = "com_github_dgraph_io_ristretto", importpath = "github.com/dgraph-io/ristretto", @@ -782,35 +732,30 @@ def prysm_deps(): sum = "h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=", version = "v3.2.0+incompatible", ) - go_repository( name = "com_github_dgryski_go_farm", importpath = "github.com/dgryski/go-farm", sum = "h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=", version = "v0.0.0-20190423205320-6a90982ecee2", ) - go_repository( name = "com_github_dgryski_go_sip13", importpath = "github.com/dgryski/go-sip13", sum = "h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4=", version = "v0.0.0-20181026042036-e10d5fee7954", ) - go_repository( name = "com_github_dlclark_regexp2", importpath = "github.com/dlclark/regexp2", sum = "h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=", version = "v1.7.0", ) - go_repository( name = "com_github_docker_go_units", importpath = "github.com/docker/go-units", sum = "h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=", version = "v0.5.0", ) - go_repository( name = "com_github_docker_spdystream", importpath = "github.com/docker/spdystream", @@ -823,7 +768,6 @@ def prysm_deps(): sum = "h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=", version = "v0.0.0-20180111231733-ee0de3bc6815", ) - go_repository( name = "com_github_dop251_goja", importpath = "github.com/dop251/goja", @@ -836,14 +780,12 @@ def prysm_deps(): sum = "h1:W1n4DvpzZGOISgp7wWNtraLcHtnmnTwBlJidqtMIuwQ=", version = "v0.0.0-20211022123610-8dd9abb0616d", ) - go_repository( name = "com_github_dustin_go_humanize", importpath = "github.com/dustin/go-humanize", sum = "h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=", version = "v1.0.0", ) - go_repository( name = "com_github_eapache_go_resiliency", importpath = "github.com/eapache/go-resiliency", @@ -862,7 +804,6 @@ def prysm_deps(): sum = "h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=", version = "v1.1.0", ) - go_repository( name = "com_github_edsrzf_mmap_go", importpath = "github.com/edsrzf/mmap-go", @@ -875,21 +816,18 @@ def prysm_deps(): sum = "h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=", version = "v0.0.0-20171010120322-cdade1c07385", ) - go_repository( name = "com_github_elastic_gosigar", importpath = "github.com/elastic/gosigar", sum = "h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=", version = "v0.14.2", ) - go_repository( name = "com_github_elazarl_goproxy", importpath = "github.com/elazarl/goproxy", sum = "h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=", version = "v0.0.0-20180725130230-947c36da3153", ) - go_repository( name = "com_github_emicklei_dot", importpath = "github.com/emicklei/dot", @@ -902,7 +840,6 @@ def prysm_deps(): sum = "h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=", version = "v0.0.0-20170410110728-ff4f55a20633", ) - go_repository( name = "com_github_envoyproxy_go_control_plane", importpath = "github.com/envoyproxy/go-control-plane", @@ -915,7 +852,6 @@ def prysm_deps(): sum = "h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=", version = "v0.10.1", ) - go_repository( name = "com_github_ethereum_c_kzg_4844", build_directives = [ @@ -927,7 +863,6 @@ def prysm_deps(): sum = "h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY=", version = "v0.4.0", ) - go_repository( name = "com_github_ethereum_go_ethereum", build_directives = [ @@ -941,14 +876,12 @@ def prysm_deps(): sum = "h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk=", version = "v1.13.5", ) - go_repository( name = "com_github_evanphx_json_patch", importpath = "github.com/evanphx/json-patch", sum = "h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=", version = "v4.9.0+incompatible", ) - go_repository( name = "com_github_fatih_color", importpath = "github.com/fatih/color", @@ -961,7 +894,12 @@ def prysm_deps(): sum = "h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=", version = "v1.1.0", ) - + go_repository( + name = "com_github_felixge_fgprof", + importpath = "github.com/felixge/fgprof", + sum = "h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=", + version = "v0.9.3", + ) go_repository( name = "com_github_ferranbt_fastssz", importpath = "github.com/ferranbt/fastssz", @@ -974,42 +912,36 @@ def prysm_deps(): sum = "h1:bBLctRc7kr01YGvaDfgLbTwjFNW5jdp5y5rj8XXBHfY=", version = "v0.0.0-20230517082657-f9840df7b83e", ) - go_repository( name = "com_github_fjl_memsize", importpath = "github.com/fjl/memsize", sum = "h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=", version = "v0.0.0-20190710130421-bcb5799ab5e5", ) - go_repository( name = "com_github_flosch_pongo2_v4", importpath = "github.com/flosch/pongo2/v4", sum = "h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=", version = "v4.0.2", ) - go_repository( name = "com_github_flynn_go_shlex", importpath = "github.com/flynn/go-shlex", sum = "h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=", version = "v0.0.0-20150515145356-3f9db97f8568", ) - go_repository( name = "com_github_flynn_noise", importpath = "github.com/flynn/noise", - sum = "h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=", - version = "v1.0.0", + sum = "h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=", + version = "v1.1.0", ) - go_repository( name = "com_github_form3tech_oss_jwt_go", importpath = "github.com/form3tech-oss/jwt-go", sum = "h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=", version = "v3.2.2+incompatible", ) - go_repository( name = "com_github_fortytw2_leaktest", importpath = "github.com/fortytw2/leaktest", @@ -1022,7 +954,6 @@ def prysm_deps(): sum = "h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=", version = "v1.2.13", ) - go_repository( name = "com_github_franela_goblin", importpath = "github.com/franela/goblin", @@ -1035,7 +966,6 @@ def prysm_deps(): sum = "h1:a9ENSRDFBUPkJ5lCgVZh26+ZbGyoVJG7yb5SSzF5H54=", version = "v0.0.0-20171204163338-bcd34c9993f8", ) - go_repository( name = "com_github_frankban_quicktest", importpath = "github.com/frankban/quicktest", @@ -1054,14 +984,12 @@ def prysm_deps(): sum = "h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc=", version = "v0.0.0-20170306192744-1d203ffc1f61", ) - go_repository( name = "com_github_garyburd_redigo", importpath = "github.com/garyburd/redigo", sum = "h1:0VruCpn7yAIIu7pWVClQC8wxCJEcG3nyzpMSHKi1PQc=", version = "v1.6.0", ) - go_repository( name = "com_github_gballet_go_libpcsclite", importpath = "github.com/gballet/go-libpcsclite", @@ -1074,7 +1002,6 @@ def prysm_deps(): sum = "h1:vMT47RYsrftsHSTQhqXwC3BYflo38OLC3Y4LtXtLyU0=", version = "v0.0.0-20230607174250-df487255f46b", ) - go_repository( name = "com_github_gdamore_encoding", importpath = "github.com/gdamore/encoding", @@ -1087,7 +1014,6 @@ def prysm_deps(): sum = "h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg=", version = "v2.6.0", ) - go_repository( name = "com_github_getkin_kin_openapi", importpath = "github.com/getkin/kin-openapi", @@ -1106,7 +1032,6 @@ def prysm_deps(): sum = "h1:r5GgOLGbza2wVHRzK7aAj6lWZjfbAwiu/RDCVOKjRyM=", version = "v0.0.0-20171120220530-696b145b53b9", ) - go_repository( name = "com_github_ghodss_yaml", importpath = "github.com/ghodss/yaml", @@ -1125,28 +1050,24 @@ def prysm_deps(): sum = "h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=", version = "v1.8.1", ) - go_repository( name = "com_github_gliderlabs_ssh", importpath = "github.com/gliderlabs/ssh", sum = "h1:j3L6gSLQalDETeEg/Jg0mGY0/y/N6zI2xX1978P0Uqw=", version = "v0.1.1", ) - go_repository( name = "com_github_go_chi_chi_v5", importpath = "github.com/go-chi/chi/v5", sum = "h1:DBPx88FjZJH3FsICfDAfIfnb7XxKIYVGG6lOPlhENAg=", version = "v5.0.0", ) - go_repository( name = "com_github_go_errors_errors", importpath = "github.com/go-errors/errors", sum = "h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=", version = "v1.4.2", ) - go_repository( name = "com_github_go_gl_glfw", importpath = "github.com/go-gl/glfw", @@ -1171,7 +1092,6 @@ def prysm_deps(): sum = "h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=", version = "v0.2.1", ) - go_repository( name = "com_github_go_logfmt_logfmt", importpath = "github.com/go-logfmt/logfmt", @@ -1181,8 +1101,8 @@ def prysm_deps(): go_repository( name = "com_github_go_logr_logr", importpath = "github.com/go-logr/logr", - sum = "h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=", - version = "v1.2.4", + sum = "h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=", + version = "v1.3.0", ) go_repository( name = "com_github_go_martini_martini", @@ -1190,7 +1110,6 @@ def prysm_deps(): sum = "h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk=", version = "v0.0.0-20170121215854-22fa46961aab", ) - go_repository( name = "com_github_go_ole_go_ole", importpath = "github.com/go-ole/go-ole", @@ -1221,7 +1140,6 @@ def prysm_deps(): sum = "h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=", version = "v0.19.5", ) - go_repository( name = "com_github_go_playground_assert_v2", importpath = "github.com/go-playground/assert/v2", @@ -1246,7 +1164,6 @@ def prysm_deps(): sum = "h1:cFRQdfaSMCOSfGCCLB20MHvuoHb/s5G8L5pu2ppK5AQ=", version = "v10.13.0", ) - go_repository( name = "com_github_go_sourcemap_sourcemap", importpath = "github.com/go-sourcemap/sourcemap", @@ -1259,7 +1176,6 @@ def prysm_deps(): sum = "h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk=", version = "v1.4.0", ) - go_repository( name = "com_github_go_stack_stack", importpath = "github.com/go-stack/stack", @@ -1272,7 +1188,6 @@ def prysm_deps(): sum = "h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=", version = "v0.0.0-20230315185526-52ccab3ef572", ) - go_repository( name = "com_github_go_yaml_yaml", importpath = "github.com/go-yaml/yaml", @@ -1303,7 +1218,6 @@ def prysm_deps(): sum = "h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=", version = "v0.10.2", ) - go_repository( name = "com_github_godbus_dbus_v5", importpath = "github.com/godbus/dbus/v5", @@ -1316,21 +1230,18 @@ def prysm_deps(): sum = "h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=", version = "v0.8.1", ) - go_repository( name = "com_github_gofrs_uuid", importpath = "github.com/gofrs/uuid", sum = "h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=", version = "v4.0.0+incompatible", ) - go_repository( name = "com_github_gogo_googleapis", importpath = "github.com/gogo/googleapis", sum = "h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=", version = "v1.4.1", ) - go_repository( name = "com_github_gogo_protobuf", importpath = "github.com/gogo/protobuf", @@ -1343,14 +1254,12 @@ def prysm_deps(): sum = "h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=", version = "v1.1.0", ) - go_repository( name = "com_github_golang_gddo", importpath = "github.com/golang/gddo", sum = "h1:HoqgYR60VYu5+0BuG6pjeGp7LKEPZnHt+dUClx9PeIs=", version = "v0.0.0-20200528160355-8d077c1d8f4c", ) - go_repository( name = "com_github_golang_glog", importpath = "github.com/golang/glog", @@ -1363,7 +1272,6 @@ def prysm_deps(): sum = "h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=", version = "v0.0.0-20200121045136-8c9f03a8e57e", ) - go_repository( name = "com_github_golang_jwt_jwt_v4", importpath = "github.com/golang-jwt/jwt/v4", @@ -1376,7 +1284,6 @@ def prysm_deps(): sum = "h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=", version = "v0.0.0-20180702182130-06c8688daad7", ) - go_repository( name = "com_github_golang_mock", importpath = "github.com/golang/mock", @@ -1391,7 +1298,6 @@ def prysm_deps(): sum = "h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=", version = "v1.5.3", ) - go_repository( name = "com_github_golang_snappy", importpath = "github.com/golang/snappy", @@ -1404,19 +1310,17 @@ def prysm_deps(): sum = "h1:utua3L2IbQJmauC5IXdEA547bcoU5dozgQAfc8Onsg4=", version = "v0.0.0-20181222135242-d2cdd8c08219", ) - go_repository( name = "com_github_google_btree", importpath = "github.com/google/btree", sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=", version = "v1.0.0", ) - go_repository( name = "com_github_google_go_cmp", importpath = "github.com/google/go-cmp", - sum = "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=", - version = "v0.5.9", + sum = "h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=", + version = "v0.6.0", ) go_repository( name = "com_github_google_go_github", @@ -1430,7 +1334,6 @@ def prysm_deps(): sum = "h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=", version = "v1.1.0", ) - go_repository( name = "com_github_google_gofuzz", importpath = "github.com/google/gofuzz", @@ -1449,7 +1352,6 @@ def prysm_deps(): sum = "h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=", version = "v2.1.0+incompatible", ) - go_repository( name = "com_github_google_martian_v3", importpath = "github.com/google/martian/v3", @@ -1459,8 +1361,8 @@ def prysm_deps(): go_repository( name = "com_github_google_pprof", importpath = "github.com/google/pprof", - sum = "h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0=", - version = "v0.0.0-20231023181126-ff6d637d2a7b", + sum = "h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo=", + version = "v0.0.0-20240207164012-fb44976bdcd5", ) go_repository( name = "com_github_google_renameio", @@ -1468,19 +1370,17 @@ def prysm_deps(): sum = "h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=", version = "v0.1.0", ) - go_repository( name = "com_github_google_subcommands", importpath = "github.com/google/subcommands", sum = "h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=", version = "v1.2.0", ) - go_repository( name = "com_github_google_uuid", importpath = "github.com/google/uuid", - sum = "h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=", - version = "v1.3.0", + sum = "h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=", + version = "v1.4.0", ) go_repository( name = "com_github_googleapis_gax_go", @@ -1488,7 +1388,6 @@ def prysm_deps(): sum = "h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU=", version = "v2.0.0+incompatible", ) - go_repository( name = "com_github_googleapis_gax_go_v2", importpath = "github.com/googleapis/gax-go/v2", @@ -1511,7 +1410,6 @@ def prysm_deps(): sum = "h1:tlyzajkF3030q6M8SvmJSemC9DTHL/xaMa18b65+JM4=", version = "v0.0.0-20200911160855-bcd43fbb19e8", ) - go_repository( name = "com_github_gopherjs_gopherjs", importpath = "github.com/gopherjs/gopherjs", @@ -1524,7 +1422,6 @@ def prysm_deps(): sum = "h1:vc7Dmrk4JwS0ZPS6WZvWlwDflgDTA26jItmbSj83nug=", version = "v0.0.0-20200309095847-7953dde2c7bf", ) - go_repository( name = "com_github_gorilla_context", importpath = "github.com/gorilla/context", @@ -1537,14 +1434,12 @@ def prysm_deps(): sum = "h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=", version = "v1.0.0", ) - go_repository( name = "com_github_gorilla_mux", importpath = "github.com/gorilla/mux", sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", version = "v1.8.0", ) - go_repository( name = "com_github_gorilla_websocket", importpath = "github.com/gorilla/websocket", @@ -1563,7 +1458,6 @@ def prysm_deps(): sum = "h1:d2/eIbH9XjD1fFwD5SHv8x168fjbQ9PB8hvs8DSEC08=", version = "v0.3.1-0.20210208050101-bfb5c8eec0e4", ) - go_repository( name = "com_github_graph_gophers_graphql_go", importpath = "github.com/graph-gophers/graphql-go", @@ -1576,7 +1470,6 @@ def prysm_deps(): sum = "h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=", version = "v0.0.0-20180305231024-9cad4c3443a7", ) - go_repository( name = "com_github_grpc_ecosystem_go_grpc_middleware", importpath = "github.com/grpc-ecosystem/go-grpc-middleware", @@ -1615,7 +1508,6 @@ def prysm_deps(): sum = "h1:ccFnUF8xYIOUPPY3tmdvRyHqmn1MYI9iv1pLKX+/ZkQ=", version = "v0.5.5", ) - go_repository( name = "com_github_hashicorp_consul_api", importpath = "github.com/hashicorp/consul/api", @@ -1640,7 +1532,6 @@ def prysm_deps(): sum = "h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE=", version = "v0.1.10", ) - go_repository( name = "com_github_hashicorp_go_cleanhttp", importpath = "github.com/hashicorp/go-cleanhttp", @@ -1677,7 +1568,6 @@ def prysm_deps(): sum = "h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=", version = "v0.7.4", ) - go_repository( name = "com_github_hashicorp_go_rootcerts", importpath = "github.com/hashicorp/go-rootcerts", @@ -1696,7 +1586,6 @@ def prysm_deps(): sum = "h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=", version = "v1.0.0", ) - go_repository( name = "com_github_hashicorp_go_uuid", importpath = "github.com/hashicorp/go-uuid", @@ -1709,7 +1598,6 @@ def prysm_deps(): sum = "h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=", version = "v1.2.1", ) - go_repository( name = "com_github_hashicorp_golang_lru", importpath = "github.com/hashicorp/golang-lru", @@ -1722,14 +1610,12 @@ def prysm_deps(): sum = "h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGNJAg1dcN2Fpfw=", version = "v2.0.5", ) - go_repository( name = "com_github_hashicorp_golang_lru_v2", importpath = "github.com/hashicorp/golang-lru/v2", sum = "h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4=", version = "v2.0.5", ) - go_repository( name = "com_github_hashicorp_hcl", importpath = "github.com/hashicorp/hcl", @@ -1766,7 +1652,6 @@ def prysm_deps(): sum = "h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM=", version = "v1.1.2", ) - go_repository( name = "com_github_herumi_bls_eth_go_binary", importpath = "github.com/herumi/bls-eth-go-binary", @@ -1779,7 +1664,6 @@ def prysm_deps(): sum = "h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw=", version = "v0.0.0-20230718173358-1c7e68d277a7", ) - go_repository( name = "com_github_holiman_bloomfilter_v2", importpath = "github.com/holiman/bloomfilter/v2", @@ -1792,7 +1676,6 @@ def prysm_deps(): sum = "h1:J973NLskKmFIj3EGfpQ1ztUQKdwyJ+fG34638ief0eA=", version = "v0.0.0-20231201084119-c73b3c97929c", ) - go_repository( name = "com_github_holiman_uint256", importpath = "github.com/holiman/uint256", @@ -1811,21 +1694,18 @@ def prysm_deps(): sum = "h1:0U6+BtN6LhaYuTnIJq4Wyq5cpn6O2kWrxAtcqBmYY6w=", version = "v1.3.0", ) - go_repository( name = "com_github_huin_goupnp", importpath = "github.com/huin/goupnp", sum = "h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=", version = "v1.3.0", ) - go_repository( name = "com_github_hydrogen18_memlistener", importpath = "github.com/hydrogen18/memlistener", sum = "h1:JR7eDj8HD6eXrc5fWLbSUnfcQFL06PYvCc0DKQnWfaU=", version = "v1.0.0", ) - go_repository( name = "com_github_ianlancetaylor_cgosymbolizer", importpath = "github.com/ianlancetaylor/cgosymbolizer", @@ -1838,28 +1718,24 @@ def prysm_deps(): sum = "h1:BA4a7pe6ZTd9F8kXETBoijjFJ/ntaa//1wiH9BZu4zU=", version = "v0.0.0-20230524184225-eabc099b10ab", ) - go_repository( name = "com_github_imdario_mergo", importpath = "github.com/imdario/mergo", sum = "h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=", version = "v0.3.5", ) - go_repository( name = "com_github_inconshreveable_log15", importpath = "github.com/inconshreveable/log15", sum = "h1:g/SJtZVYc1cxSB8lgrgqeOlIdi4MhqNNHYRAC8y+g4c=", version = "v0.0.0-20170622235902-74a0988b5f80", ) - go_repository( name = "com_github_inconshreveable_mousetrap", importpath = "github.com/inconshreveable/mousetrap", sum = "h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=", version = "v1.0.0", ) - go_repository( name = "com_github_influxdata_influxdb1_client", importpath = "github.com/influxdata/influxdb1-client", @@ -1872,14 +1748,12 @@ def prysm_deps(): sum = "h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k=", version = "v2.4.0", ) - go_repository( name = "com_github_influxdata_line_protocol", importpath = "github.com/influxdata/line-protocol", sum = "h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM=", version = "v0.0.0-20210311194329-9aa0e372d097", ) - go_repository( name = "com_github_ipfs_go_cid", importpath = "github.com/ipfs/go-cid", @@ -1892,7 +1766,6 @@ def prysm_deps(): sum = "h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk=", version = "v0.6.0", ) - go_repository( name = "com_github_ipfs_go_ds_badger", importpath = "github.com/ipfs/go-ds-badger", @@ -1905,7 +1778,6 @@ def prysm_deps(): sum = "h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo=", version = "v0.5.0", ) - go_repository( name = "com_github_ipfs_go_log_v2", build_file_proto_mode = "disable_global", @@ -1913,21 +1785,18 @@ def prysm_deps(): sum = "h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY=", version = "v2.5.1", ) - go_repository( name = "com_github_iris_contrib_schema", importpath = "github.com/iris-contrib/schema", sum = "h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw=", version = "v0.0.6", ) - go_repository( name = "com_github_jackpal_go_nat_pmp", importpath = "github.com/jackpal/go-nat-pmp", sum = "h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=", version = "v1.0.2", ) - go_repository( name = "com_github_jbenet_go_temp_err_catcher", importpath = "github.com/jbenet/go-temp-err-catcher", @@ -1940,20 +1809,24 @@ def prysm_deps(): sum = "h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o=", version = "v0.1.4", ) - go_repository( name = "com_github_jcmturner_gofork", importpath = "github.com/jcmturner/gofork", sum = "h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=", version = "v1.0.0", ) + go_repository( + name = "com_github_jedib0t_go_pretty_v6", + importpath = "github.com/jedib0t/go-pretty/v6", + sum = "h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/5l91s=", + version = "v6.5.4", + ) go_repository( name = "com_github_jedisct1_go_minisign", importpath = "github.com/jedisct1/go-minisign", sum = "h1:TMtDYDHKYY15rFihtRfck/bfFqNfvcabqvXAFQfAUpY=", version = "v0.0.0-20230811132847-661be99b8267", ) - go_repository( name = "com_github_jellevandenhooff_dkim", importpath = "github.com/jellevandenhooff/dkim", @@ -1966,7 +1839,6 @@ def prysm_deps(): sum = "h1:z7Ciiz3Bz37zSd485fbiTW8ABafIasyOWZI0N9EUUdo=", version = "v1.8.1", ) - go_repository( name = "com_github_jmespath_go_jmespath", importpath = "github.com/jmespath/go-jmespath", @@ -1979,14 +1851,12 @@ def prysm_deps(): sum = "h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk=", version = "v1.1.3", ) - go_repository( name = "com_github_jonboulle_clockwork", importpath = "github.com/jonboulle/clockwork", sum = "h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=", version = "v0.1.0", ) - go_repository( name = "com_github_joonix_log", importpath = "github.com/joonix/log", @@ -1999,14 +1869,12 @@ def prysm_deps(): sum = "h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=", version = "v1.0.0", ) - go_repository( name = "com_github_jpillora_backoff", importpath = "github.com/jpillora/backoff", sum = "h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=", version = "v1.0.0", ) - go_repository( name = "com_github_json_iterator_go", importpath = "github.com/json-iterator/go", @@ -2020,35 +1888,30 @@ def prysm_deps(): sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=", version = "v0.9.1", ) - go_repository( name = "com_github_jtolds_gls", importpath = "github.com/jtolds/gls", sum = "h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=", version = "v4.20.0+incompatible", ) - go_repository( name = "com_github_juju_ansiterm", importpath = "github.com/juju/ansiterm", sum = "h1:FaWFmfWdAUKbSCtOU2QjDaorUexogfaMgbipgYATUMU=", version = "v0.0.0-20180109212912-720a0952cc2a", ) - go_repository( name = "com_github_julienschmidt_httprouter", importpath = "github.com/julienschmidt/httprouter", sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", version = "v1.3.0", ) - go_repository( name = "com_github_k0kubun_go_ansi", importpath = "github.com/k0kubun/go-ansi", sum = "h1:qGQQKEcAR99REcMpsXCp3lJ03zYT1PkRd3kQGPn9GVg=", version = "v0.0.0-20180517002512-3bf9e2903213", ) - go_repository( name = "com_github_karalabe_usb", importpath = "github.com/karalabe/usb", @@ -2073,7 +1936,6 @@ def prysm_deps(): sum = "h1:WzDY5nGuW/LgVaFS5BtTkW3crdSKJ/FEgWnxPnIVVLI=", version = "v12.2.0", ) - go_repository( name = "com_github_kataras_pio", importpath = "github.com/kataras/pio", @@ -2098,7 +1960,6 @@ def prysm_deps(): sum = "h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4=", version = "v0.1.0", ) - go_repository( name = "com_github_kisielk_errcheck", importpath = "github.com/kisielk/errcheck", @@ -2111,28 +1972,24 @@ def prysm_deps(): sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=", version = "v1.0.0", ) - go_repository( name = "com_github_klauspost_compress", importpath = "github.com/klauspost/compress", - sum = "h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=", - version = "v1.17.4", + sum = "h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=", + version = "v1.17.6", ) - go_repository( name = "com_github_klauspost_cpuid", importpath = "github.com/klauspost/cpuid", sum = "h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs=", version = "v1.2.3", ) - go_repository( name = "com_github_klauspost_cpuid_v2", importpath = "github.com/klauspost/cpuid/v2", - sum = "h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=", - version = "v2.2.5", + sum = "h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=", + version = "v2.2.7", ) - go_repository( name = "com_github_klauspost_pgzip", importpath = "github.com/klauspost/pgzip", @@ -2151,7 +2008,6 @@ def prysm_deps(): sum = "h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=", version = "v3.0.1-0.20171022003610-9aa49832a739+incompatible", ) - go_repository( name = "com_github_konsorten_go_windows_terminal_sequences", importpath = "github.com/konsorten/go-windows-terminal-sequences", @@ -2176,7 +2032,6 @@ def prysm_deps(): sum = "h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=", version = "v0.1.0", ) - go_repository( name = "com_github_kr_logfmt", importpath = "github.com/kr/logfmt", @@ -2201,7 +2056,6 @@ def prysm_deps(): sum = "h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=", version = "v0.2.0", ) - go_repository( name = "com_github_kylelemons_godebug", importpath = "github.com/kylelemons/godebug", @@ -2226,27 +2080,18 @@ def prysm_deps(): sum = "h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=", version = "v0.2.9", ) - go_repository( name = "com_github_leodido_go_urn", importpath = "github.com/leodido/go-urn", sum = "h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA=", version = "v1.2.3", ) - go_repository( name = "com_github_libp2p_go_buffer_pool", importpath = "github.com/libp2p/go-buffer-pool", sum = "h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=", version = "v0.1.0", ) - go_repository( - name = "com_github_libp2p_go_cidranger", - importpath = "github.com/libp2p/go-cidranger", - sum = "h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c=", - version = "v1.1.0", - ) - go_repository( name = "com_github_libp2p_go_flow_metrics", importpath = "github.com/libp2p/go-flow-metrics", @@ -2260,8 +2105,8 @@ def prysm_deps(): ], build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p", - sum = "h1:wy1J4kZIZxOaej6NveTWCZmHiJ/kY7GoAqXgqNCnPps=", - version = "v0.32.1", + sum = "h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA=", + version = "v0.33.1", ) go_repository( name = "com_github_libp2p_go_libp2p_asn_util", @@ -2275,7 +2120,6 @@ def prysm_deps(): sum = "h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8=", version = "v0.9.0", ) - go_repository( name = "com_github_libp2p_go_libp2p_pubsub", build_file_proto_mode = "disable_global", @@ -2283,14 +2127,12 @@ def prysm_deps(): sum = "h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA=", version = "v0.10.0", ) - go_repository( name = "com_github_libp2p_go_libp2p_testing", importpath = "github.com/libp2p/go-libp2p-testing", sum = "h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=", version = "v0.12.0", ) - go_repository( name = "com_github_libp2p_go_mplex", importpath = "github.com/libp2p/go-mplex", @@ -2315,14 +2157,12 @@ def prysm_deps(): sum = "h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU=", version = "v0.2.1", ) - go_repository( name = "com_github_libp2p_go_reuseport", importpath = "github.com/libp2p/go-reuseport", sum = "h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s=", version = "v0.4.0", ) - go_repository( name = "com_github_libp2p_go_yamux_v4", importpath = "github.com/libp2p/go-yamux/v4", @@ -2335,7 +2175,6 @@ def prysm_deps(): sum = "h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q=", version = "v2.2.0", ) - go_repository( name = "com_github_lightstep_lightstep_tracer_common_golang_gogo", importpath = "github.com/lightstep/lightstep-tracer-common/golang/gogo", @@ -2348,21 +2187,18 @@ def prysm_deps(): sum = "h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk=", version = "v0.18.1", ) - go_repository( name = "com_github_logrusorgru_aurora", importpath = "github.com/logrusorgru/aurora", sum = "h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=", version = "v2.0.3+incompatible", ) - go_repository( name = "com_github_lucasb_eyer_go_colorful", importpath = "github.com/lucasb-eyer/go-colorful", sum = "h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=", version = "v1.2.0", ) - go_repository( name = "com_github_lunixbochs_vtclean", importpath = "github.com/lunixbochs/vtclean", @@ -2375,7 +2211,6 @@ def prysm_deps(): sum = "h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA=", version = "v0.0.13", ) - go_repository( name = "com_github_magiconair_properties", importpath = "github.com/magiconair/properties", @@ -2388,14 +2223,12 @@ def prysm_deps(): sum = "h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw=", version = "v2.0.48", ) - go_repository( name = "com_github_mailru_easyjson", importpath = "github.com/mailru/easyjson", sum = "h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=", version = "v0.7.7", ) - go_repository( name = "com_github_manifoldco_promptui", importpath = "github.com/manifoldco/promptui", @@ -2414,42 +2247,36 @@ def prysm_deps(): sum = "h1:QDTh0xHorSykJ4+2VccBADMeRAVUbnHaWrCPIMtN+Vc=", version = "v1.3.3-0.20240227085032-f70dd7c85c97", ) - go_repository( name = "com_github_marten_seemann_tcp", importpath = "github.com/marten-seemann/tcp", sum = "h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk=", version = "v0.0.0-20210406111302-dfbc87cc63fd", ) - go_repository( name = "com_github_matryer_moq", importpath = "github.com/matryer/moq", sum = "h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk=", version = "v0.0.0-20190312154309-6cfb0558e1bd", ) - go_repository( name = "com_github_mattn_go_colorable", importpath = "github.com/mattn/go-colorable", sum = "h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=", version = "v0.1.13", ) - go_repository( name = "com_github_mattn_go_isatty", importpath = "github.com/mattn/go-isatty", sum = "h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=", version = "v0.0.20", ) - go_repository( name = "com_github_mattn_go_runewidth", importpath = "github.com/mattn/go-runewidth", sum = "h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=", version = "v0.0.15", ) - go_repository( name = "com_github_matttproud_golang_protobuf_extensions", importpath = "github.com/matttproud/golang_protobuf_extensions", @@ -2462,7 +2289,6 @@ def prysm_deps(): sum = "h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=", version = "v2.0.0", ) - go_repository( name = "com_github_mgutz_ansi", importpath = "github.com/mgutz/ansi", @@ -2481,12 +2307,11 @@ def prysm_deps(): sum = "h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=", version = "v0.6.1", ) - go_repository( name = "com_github_miekg_dns", importpath = "github.com/miekg/dns", - sum = "h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=", - version = "v1.1.56", + sum = "h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=", + version = "v1.1.58", ) go_repository( name = "com_github_mikioh_tcp", @@ -2506,7 +2331,6 @@ def prysm_deps(): sum = "h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc=", version = "v0.0.0-20190314235656-172688c1accc", ) - go_repository( name = "com_github_minio_blake2b_simd", importpath = "github.com/minio/blake2b-simd", @@ -2531,14 +2355,12 @@ def prysm_deps(): sum = "h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=", version = "v1.0.0", ) - go_repository( name = "com_github_mitchellh_colorstring", importpath = "github.com/mitchellh/colorstring", sum = "h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=", version = "v0.0.0-20190213212951-d06e56a500db", ) - go_repository( name = "com_github_mitchellh_go_homedir", importpath = "github.com/mitchellh/go-homedir", @@ -2563,7 +2385,6 @@ def prysm_deps(): sum = "h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=", version = "v1.0.0", ) - go_repository( name = "com_github_mitchellh_mapstructure", importpath = "github.com/mitchellh/mapstructure", @@ -2588,7 +2409,6 @@ def prysm_deps(): sum = "h1:jhDmAqPyebOsVDOCICJoINoLb/AnLBaUw58nFzxWS2w=", version = "v0.1.1", ) - go_repository( name = "com_github_modern_go_concurrent", importpath = "github.com/modern-go/concurrent", @@ -2601,21 +2421,18 @@ def prysm_deps(): sum = "h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=", version = "v1.0.2", ) - go_repository( name = "com_github_mohae_deepcopy", importpath = "github.com/mohae/deepcopy", sum = "h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=", version = "v0.0.0-20170929034955-c48cc78d4826", ) - go_repository( name = "com_github_mr_tron_base58", importpath = "github.com/mr-tron/base58", sum = "h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=", version = "v1.2.0", ) - go_repository( name = "com_github_multiformats_go_base32", importpath = "github.com/multiformats/go-base32", @@ -2628,12 +2445,11 @@ def prysm_deps(): sum = "h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0=", version = "v0.2.0", ) - go_repository( name = "com_github_multiformats_go_multiaddr", importpath = "github.com/multiformats/go-multiaddr", - sum = "h1:vm+BA/WZA8QZDp1pF1FWhi5CT3g1tbi5GJmqpb6wnlk=", - version = "v0.12.1", + sum = "h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24=", + version = "v0.12.2", ) go_repository( name = "com_github_multiformats_go_multiaddr_dns", @@ -2647,7 +2463,6 @@ def prysm_deps(): sum = "h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E=", version = "v0.1.0", ) - go_repository( name = "com_github_multiformats_go_multibase", importpath = "github.com/multiformats/go-multibase", @@ -2663,7 +2478,6 @@ def prysm_deps(): sum = "h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg=", version = "v0.9.0", ) - go_repository( name = "com_github_multiformats_go_multihash", importpath = "github.com/multiformats/go-multihash", @@ -2706,7 +2520,6 @@ def prysm_deps(): sum = "h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks=", version = "v0.1.0", ) - go_repository( name = "com_github_naoina_toml", importpath = "github.com/naoina/toml", @@ -2719,7 +2532,6 @@ def prysm_deps(): sum = "h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI=", version = "v0.3.2", ) - go_repository( name = "com_github_nats_io_nats_go", importpath = "github.com/nats-io/nats.go", @@ -2744,7 +2556,6 @@ def prysm_deps(): sum = "h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=", version = "v1.0.1", ) - go_repository( name = "com_github_neelance_astrewrite", importpath = "github.com/neelance/astrewrite", @@ -2757,14 +2568,12 @@ def prysm_deps(): sum = "h1:eFXv9Nu1lGbrNbj619aWwZfVF5HBrm9Plte8aNptuTI=", version = "v0.0.0-20151028013722-8c68805598ab", ) - go_repository( name = "com_github_nishanths_predeclared", importpath = "github.com/nishanths/predeclared", sum = "h1:3f0nxAmdj/VoCGN/ijdMy7bj6SBagaqYg1B0hu8clMA=", version = "v0.0.0-20200524104333-86fad755b4d3", ) - go_repository( name = "com_github_nxadm_tail", importpath = "github.com/nxadm/tail", @@ -2789,7 +2598,6 @@ def prysm_deps(): sum = "h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=", version = "v1.0.0", ) - go_repository( name = "com_github_oklog_ulid", importpath = "github.com/oklog/ulid", @@ -2817,15 +2625,14 @@ def prysm_deps(): go_repository( name = "com_github_onsi_ginkgo_v2", importpath = "github.com/onsi/ginkgo/v2", - sum = "h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=", - version = "v2.13.0", + sum = "h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=", + version = "v2.15.0", ) - go_repository( name = "com_github_onsi_gomega", importpath = "github.com/onsi/gomega", - sum = "h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=", - version = "v1.27.10", + sum = "h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=", + version = "v1.30.0", ) go_repository( name = "com_github_op_go_logging", @@ -2833,7 +2640,6 @@ def prysm_deps(): sum = "h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88=", version = "v0.0.0-20160315200505-970db520ece7", ) - go_repository( name = "com_github_openconfig_gnmi", importpath = "github.com/openconfig/gnmi", @@ -2849,10 +2655,9 @@ def prysm_deps(): go_repository( name = "com_github_opencontainers_runtime_spec", importpath = "github.com/opencontainers/runtime-spec", - sum = "h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=", - version = "v1.1.0", + sum = "h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk=", + version = "v1.2.0", ) - go_repository( name = "com_github_opentracing_basictracer_go", importpath = "github.com/opentracing/basictracer-go", @@ -2865,7 +2670,6 @@ def prysm_deps(): sum = "h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU=", version = "v0.0.0-20170622124052-a52f23424492", ) - go_repository( name = "com_github_opentracing_opentracing_go", importpath = "github.com/opentracing/opentracing-go", @@ -2902,7 +2706,6 @@ def prysm_deps(): sum = "h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc=", version = "v1.3.1", ) - go_repository( name = "com_github_pact_foundation_pact_go", importpath = "github.com/pact-foundation/pact-go", @@ -2915,7 +2718,6 @@ def prysm_deps(): sum = "h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=", version = "v0.0.0-20180627143212-57f6aae5913c", ) - go_repository( name = "com_github_patrickmn_go_cache", importpath = "github.com/patrickmn/go-cache", @@ -2934,7 +2736,6 @@ def prysm_deps(): sum = "h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=", version = "v0.0.0-20210728143218-7b4eea64cf58", ) - go_repository( name = "com_github_pborman_uuid", importpath = "github.com/pborman/uuid", @@ -2953,28 +2754,24 @@ def prysm_deps(): sum = "h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg=", version = "v2.0.5", ) - go_repository( name = "com_github_performancecopilot_speed", importpath = "github.com/performancecopilot/speed", sum = "h1:2WnRzIquHa5QxaJKShDkLM+sc0JPuwhXzK8OYOyt3Vg=", version = "v3.0.0+incompatible", ) - go_repository( name = "com_github_peterbourgon_diskv", importpath = "github.com/peterbourgon/diskv", sum = "h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=", version = "v2.0.1+incompatible", ) - go_repository( name = "com_github_peterh_liner", importpath = "github.com/peterh/liner", sum = "h1:w/UPXyl5GfahFxcTOz2j9wCIHNI+pUPr2laqpojKNCg=", version = "v1.2.0", ) - go_repository( name = "com_github_pierrec_lz4", importpath = "github.com/pierrec/lz4", @@ -2996,20 +2793,20 @@ def prysm_deps(): go_repository( name = "com_github_pion_dtls_v2", importpath = "github.com/pion/dtls/v2", - sum = "h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8=", - version = "v2.2.7", + sum = "h1:BUroldfiIbV9jSnC6cKOMnyiORRWrWWpV11JUyEu5OA=", + version = "v2.2.8", ) go_repository( name = "com_github_pion_ice_v2", importpath = "github.com/pion/ice/v2", - sum = "h1:Jgqw36cAud47iD+N6rNX225uHvrgWtAlHfVyOQc3Heg=", - version = "v2.3.6", + sum = "h1:rZjVmUwyT55cmN8ySMpL7rsS8KYsJERsrxJLLxpKhdw=", + version = "v2.3.11", ) go_repository( name = "com_github_pion_interceptor", importpath = "github.com/pion/interceptor", - sum = "h1:prJtgwFh/gB8zMqGZoOgJPHivOwVAp61i2aG61Du/1w=", - version = "v0.1.17", + sum = "h1:pwY9r7P6ToQ3+IF0bajN0xmk/fNw/suTgaTdlwTDmhc=", + version = "v0.1.25", ) go_repository( name = "com_github_pion_logging", @@ -3020,8 +2817,8 @@ def prysm_deps(): go_repository( name = "com_github_pion_mdns", importpath = "github.com/pion/mdns", - sum = "h1:P0UB4Sr6xDWEox0kTVxF0LmQihtCbSAdW0H2nEgkA3U=", - version = "v0.0.7", + sum = "h1:7Ue5KZsqq8EuqStnpPWV33vYYEH0+skdDN5L7EiEsI4=", + version = "v0.0.9", ) go_repository( name = "com_github_pion_randutil", @@ -3032,20 +2829,20 @@ def prysm_deps(): go_repository( name = "com_github_pion_rtcp", importpath = "github.com/pion/rtcp", - sum = "h1:nkr3uj+8Sp97zyItdN60tE/S6vk4al5CPRR6Gejsdjc=", - version = "v1.2.10", + sum = "h1:+EQijuisKwm/8VBs8nWllr0bIndR7Lf7cZG200mpbNo=", + version = "v1.2.13", ) go_repository( name = "com_github_pion_rtp", importpath = "github.com/pion/rtp", - sum = "h1:qcHwlmtiI50t1XivvoawdCGTP4Uiypzfrsap+bijcoA=", - version = "v1.7.13", + sum = "h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8=", + version = "v1.8.3", ) go_repository( name = "com_github_pion_sctp", importpath = "github.com/pion/sctp", - sum = "h1:JnABvFakZueGAn4KU/4PSKg+GWbF6QWbKTWZOSGJjXw=", - version = "v1.8.7", + sum = "h1:TP5ZVxV5J7rz7uZmbyvnUvsn7EJ2x/5q9uhsTtXbI3g=", + version = "v1.8.9", ) go_repository( name = "com_github_pion_sdp_v3", @@ -3056,41 +2853,39 @@ def prysm_deps(): go_repository( name = "com_github_pion_srtp_v2", importpath = "github.com/pion/srtp/v2", - sum = "h1:+tqRtXGsGwHC0G0IUIAzRmdkHvriF79IHVfZGfHrQoA=", - version = "v2.0.15", + sum = "h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo=", + version = "v2.0.18", ) go_repository( name = "com_github_pion_stun", importpath = "github.com/pion/stun", - sum = "h1:JHT/2iyGDPrFWE8NNC15wnddBN8KifsEDw8swQmrEmU=", - version = "v0.6.0", + sum = "h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4=", + version = "v0.6.1", ) go_repository( name = "com_github_pion_transport_v2", importpath = "github.com/pion/transport/v2", - sum = "h1:7qYnCBlpgSJNYMbLCKuSY9KbQdBFoETvPNETv0y4N7c=", - version = "v2.2.1", + sum = "h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo=", + version = "v2.2.4", ) go_repository( name = "com_github_pion_turn_v2", importpath = "github.com/pion/turn/v2", - sum = "h1:5wGHSgGhJhP/RpabkUb/T9PdsAjkGLS6toYz5HNzoSI=", - version = "v2.1.0", + sum = "h1:2xn8rduI5W6sCZQkEnIUDAkrBQNl2eYIBCHMZ3QMmP8=", + version = "v2.1.4", ) go_repository( name = "com_github_pion_webrtc_v3", importpath = "github.com/pion/webrtc/v3", - sum = "h1:U8NSjQDlZZ+Iy/hg42Q/u6mhEVSXYvKrOIZiZwYTfLc=", - version = "v3.2.9", + sum = "h1:GbqEuxBbVLFhXk0GwxKAoaIJYiEa9TyoZPEZC+2HZxM=", + version = "v3.2.23", ) - go_repository( name = "com_github_pkg_diff", importpath = "github.com/pkg/diff", sum = "h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=", version = "v0.0.0-20210226163009-20ebb0f2a09e", ) - go_repository( name = "com_github_pkg_errors", importpath = "github.com/pkg/errors", @@ -3100,8 +2895,8 @@ def prysm_deps(): go_repository( name = "com_github_pkg_profile", importpath = "github.com/pkg/profile", - sum = "h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug=", - version = "v1.5.0", + sum = "h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=", + version = "v1.7.0", ) go_repository( name = "com_github_pkg_sftp", @@ -3109,7 +2904,6 @@ def prysm_deps(): sum = "h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs=", version = "v1.13.1", ) - go_repository( name = "com_github_pmezard_go_difflib", importpath = "github.com/pmezard/go-difflib", @@ -3122,31 +2916,29 @@ def prysm_deps(): sum = "h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w=", version = "v1.1.1", ) - go_repository( name = "com_github_prashantv_gostub", importpath = "github.com/prashantv/gostub", sum = "h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=", version = "v1.1.0", ) - go_repository( name = "com_github_prometheus_client_golang", importpath = "github.com/prometheus/client_golang", - sum = "h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=", - version = "v1.17.0", + sum = "h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=", + version = "v1.18.0", ) go_repository( name = "com_github_prometheus_client_model", importpath = "github.com/prometheus/client_model", - sum = "h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=", - version = "v0.5.0", + sum = "h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=", + version = "v0.6.0", ) go_repository( name = "com_github_prometheus_common", importpath = "github.com/prometheus/common", - sum = "h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM=", - version = "v0.45.0", + sum = "h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k=", + version = "v0.47.0", ) go_repository( name = "com_github_prometheus_procfs", @@ -3160,7 +2952,6 @@ def prysm_deps(): sum = "h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y=", version = "v1.3.0", ) - go_repository( name = "com_github_prometheus_tsdb", importpath = "github.com/prometheus/tsdb", @@ -3173,14 +2964,12 @@ def prysm_deps(): sum = "h1:cZC+usqsYgHtlBaGulVnZ1hfKAi8iWtujBnRLQE698c=", version = "v0.0.0-20220416220906-d8552aa452c7", ) - go_repository( name = "com_github_prysmaticlabs_fastssz", importpath = "github.com/prysmaticlabs/fastssz", sum = "h1:c3p3UzV4vFA7xaCDphnDWOjpxcadrQ26l5b+ypsvyxo=", version = "v0.0.0-20221107182844-78142813af44", ) - go_repository( name = "com_github_prysmaticlabs_go_bitfield", importpath = "github.com/prysmaticlabs/go-bitfield", @@ -3193,7 +2982,6 @@ def prysm_deps(): sum = "h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=", version = "v0.0.4-beta", ) - go_repository( name = "com_github_prysmaticlabs_prombbolt", importpath = "github.com/prysmaticlabs/prombbolt", @@ -3206,7 +2994,6 @@ def prysm_deps(): sum = "h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU=", version = "v0.0.0-20230228205207-28762a7b9294", ) - go_repository( name = "com_github_puerkitobio_purell", importpath = "github.com/PuerkitoBio/purell", @@ -3228,7 +3015,6 @@ def prysm_deps(): sum = "h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=", version = "v0.4.0", ) - go_repository( name = "com_github_quic_go_qtls_go1_20", build_directives = [ @@ -3238,7 +3024,6 @@ def prysm_deps(): sum = "h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=", version = "v0.3.4", ) - go_repository( name = "com_github_quic_go_quic_go", build_directives = [ @@ -3246,8 +3031,8 @@ def prysm_deps(): "gazelle:exclude tools.go", ], importpath = "github.com/quic-go/quic-go", - sum = "h1:PelfiuG7wXEffUT2yceiqz5V6Pc0TA5ruOd1LcmFc1s=", - version = "v0.39.4", + sum = "h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM=", + version = "v0.42.0", ) go_repository( name = "com_github_quic_go_webtransport_go", @@ -3255,21 +3040,18 @@ def prysm_deps(): sum = "h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY=", version = "v0.6.0", ) - go_repository( name = "com_github_raulk_go_watchdog", importpath = "github.com/raulk/go-watchdog", sum = "h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk=", version = "v1.3.0", ) - go_repository( name = "com_github_rcrowley_go_metrics", importpath = "github.com/rcrowley/go-metrics", sum = "h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ=", version = "v0.0.0-20190826022208-cac0b30c2563", ) - go_repository( name = "com_github_rivo_tview", importpath = "github.com/rivo/tview", @@ -3286,7 +3068,6 @@ def prysm_deps(): sum = "h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=", version = "v0.4.4", ) - go_repository( name = "com_github_rogpeppe_fastuuid", importpath = "github.com/rogpeppe/fastuuid", @@ -3299,28 +3080,24 @@ def prysm_deps(): sum = "h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=", version = "v1.11.0", ) - go_repository( name = "com_github_rs_cors", importpath = "github.com/rs/cors", sum = "h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=", version = "v1.7.0", ) - go_repository( name = "com_github_russross_blackfriday", importpath = "github.com/russross/blackfriday", sum = "h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=", version = "v1.5.2", ) - go_repository( name = "com_github_russross_blackfriday_v2", importpath = "github.com/russross/blackfriday/v2", sum = "h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=", version = "v2.1.0", ) - go_repository( name = "com_github_ryanuber_columnize", importpath = "github.com/ryanuber/columnize", @@ -3333,7 +3110,6 @@ def prysm_deps(): sum = "h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU=", version = "v0.0.0-20190923202752-2cc03de413da", ) - go_repository( name = "com_github_satori_go_uuid", importpath = "github.com/satori/go.uuid", @@ -3346,42 +3122,36 @@ def prysm_deps(): sum = "h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk=", version = "v2.1.0+incompatible", ) - go_repository( name = "com_github_schollz_progressbar_v3", importpath = "github.com/schollz/progressbar/v3", sum = "h1:nMinx+JaEm/zJz4cEyClQeAw5rsYSB5th3xv+5lV6Vg=", version = "v3.3.4", ) - go_repository( name = "com_github_sean_seed", importpath = "github.com/sean-/seed", sum = "h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=", version = "v0.0.0-20170313163322-e2103e2c3529", ) - go_repository( name = "com_github_sergi_go_diff", importpath = "github.com/sergi/go-diff", sum = "h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=", version = "v1.0.0", ) - go_repository( name = "com_github_shirou_gopsutil", importpath = "github.com/shirou/gopsutil", sum = "h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=", version = "v3.21.11+incompatible", ) - go_repository( name = "com_github_shopify_goreferrer", importpath = "github.com/Shopify/goreferrer", sum = "h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0=", version = "v0.0.0-20220729165902-8cddb4f5de06", ) - go_repository( name = "com_github_shopify_sarama", importpath = "github.com/Shopify/sarama", @@ -3508,7 +3278,6 @@ def prysm_deps(): sum = "h1:LneqU9PHDsg/AkPDU3AkqMxnMYL+imaqkpflHu73us8=", version = "v0.0.0-20181006231557-f2e0b4ca5b82", ) - go_repository( name = "com_github_shurcool_sanitized_anchor_name", importpath = "github.com/shurcooL/sanitized_anchor_name", @@ -3521,21 +3290,18 @@ def prysm_deps(): sum = "h1:YGaxtkYjb8mnTvtufv2LKLwCQu2/C7qFB7UtrOlTWOY=", version = "v0.0.0-20180125191416-49c67e49c537", ) - go_repository( name = "com_github_shurcool_webdavfs", importpath = "github.com/shurcooL/webdavfs", sum = "h1:JtcyT0rk/9PKOdnKQzuDR+FSjh7SGtJwpgVpfZBRKlQ=", version = "v0.0.0-20170829043945-18c3829fa133", ) - go_repository( name = "com_github_sirupsen_logrus", importpath = "github.com/sirupsen/logrus", sum = "h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=", version = "v1.9.0", ) - go_repository( name = "com_github_smartystreets_assertions", importpath = "github.com/smartystreets/assertions", @@ -3548,7 +3314,6 @@ def prysm_deps(): sum = "h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=", version = "v1.6.4", ) - go_repository( name = "com_github_soheilhy_cmux", importpath = "github.com/soheilhy/cmux", @@ -3573,7 +3338,6 @@ def prysm_deps(): sum = "h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8=", version = "v0.0.0-20170531221838-bd320f5d308e", ) - go_repository( name = "com_github_spaolacci_murmur3", importpath = "github.com/spaolacci/murmur3", @@ -3592,7 +3356,6 @@ def prysm_deps(): sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", version = "v1.3.0", ) - go_repository( name = "com_github_spf13_cobra", importpath = "github.com/spf13/cobra", @@ -3605,7 +3368,6 @@ def prysm_deps(): sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", version = "v1.0.0", ) - go_repository( name = "com_github_spf13_pflag", importpath = "github.com/spf13/pflag", @@ -3618,7 +3380,6 @@ def prysm_deps(): sum = "h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=", version = "v1.7.0", ) - go_repository( name = "com_github_stackexchange_wmi", importpath = "github.com/StackExchange/wmi", @@ -3631,7 +3392,6 @@ def prysm_deps(): sum = "h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=", version = "v0.2.0", ) - go_repository( name = "com_github_streadway_amqp", importpath = "github.com/streadway/amqp", @@ -3644,7 +3404,6 @@ def prysm_deps(): sum = "h1:AhmOdSHeswKHBjhsLs/7+1voOxT+LLrSk/Nxvk35fug=", version = "v0.0.0-20190108123426-d5acb3125c2a", ) - go_repository( name = "com_github_stretchr_objx", importpath = "github.com/stretchr/objx", @@ -3663,7 +3422,6 @@ def prysm_deps(): sum = "h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=", version = "v1.2.0", ) - go_repository( name = "com_github_syndtr_goleveldb", importpath = "github.com/syndtr/goleveldb", @@ -3688,7 +3446,6 @@ def prysm_deps(): sum = "h1:KCkDvNUMof10e3QExio9OPZJT8SbdKojLBumw8YZycQ=", version = "v2.6.4", ) - go_repository( name = "com_github_templexxx_cpufeat", importpath = "github.com/templexxx/cpufeat", @@ -3713,14 +3470,12 @@ def prysm_deps(): sum = "h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag=", version = "v0.0.0-20200319021203-7eef512accb3", ) - go_repository( name = "com_github_thomaso_mirodin_intmath", importpath = "github.com/thomaso-mirodin/intmath", sum = "h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo=", version = "v0.0.0-20160323211736-5dc6d854e46e", ) - go_repository( name = "com_github_tjfoc_gmsm", importpath = "github.com/tjfoc/gmsm", @@ -3739,14 +3494,12 @@ def prysm_deps(): sum = "h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4=", version = "v0.7.0", ) - go_repository( name = "com_github_tmc_grpc_websocket_proxy", importpath = "github.com/tmc/grpc-websocket-proxy", sum = "h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=", version = "v0.0.0-20190109142713-0ad062ec5ee5", ) - go_repository( name = "com_github_trailofbits_go_mutexasserts", importpath = "github.com/trailofbits/go-mutexasserts", @@ -3759,28 +3512,24 @@ def prysm_deps(): sum = "h1:3fNSDoSPyq+fTrifIvGue9XM/tptzuhiGY83rxPVNUg=", version = "v7.1.0+incompatible", ) - go_repository( name = "com_github_tyler_smith_go_bip39", importpath = "github.com/tyler-smith/go-bip39", sum = "h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=", version = "v1.1.0", ) - go_repository( name = "com_github_uber_jaeger_client_go", importpath = "github.com/uber/jaeger-client-go", sum = "h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U=", version = "v2.25.0+incompatible", ) - go_repository( name = "com_github_ugorji_go_codec", importpath = "github.com/ugorji/go/codec", sum = "h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=", version = "v1.2.7", ) - go_repository( name = "com_github_urfave_cli", importpath = "github.com/urfave/cli", @@ -3799,14 +3548,12 @@ def prysm_deps(): sum = "h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=", version = "v1.0.0", ) - go_repository( name = "com_github_uudashr_gocognit", importpath = "github.com/uudashr/gocognit", sum = "h1:rrSex7oHr3/pPLQ0xoWq108XMU8s678FJcQ+aSfOHa4=", version = "v1.0.5", ) - go_repository( name = "com_github_valyala_bytebufferpool", importpath = "github.com/valyala/bytebufferpool", @@ -3819,14 +3566,12 @@ def prysm_deps(): sum = "h1:CRq/00MfruPGFLTQKY8b+8SfdK60TxNztjRMnH0t1Yc=", version = "v1.40.0", ) - go_repository( name = "com_github_valyala_fasttemplate", importpath = "github.com/valyala/fasttemplate", sum = "h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=", version = "v1.2.2", ) - go_repository( name = "com_github_viant_assertly", importpath = "github.com/viant/assertly", @@ -3839,7 +3584,6 @@ def prysm_deps(): sum = "h1:6TteTDQ68CjgcCe8wH3D3ZhUQQOJXMTbj/D9rkk2a1k=", version = "v0.24.0", ) - go_repository( name = "com_github_victoriametrics_fastcache", importpath = "github.com/VictoriaMetrics/fastcache", @@ -3864,14 +3608,12 @@ def prysm_deps(): sum = "h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=", version = "v2.0.0", ) - go_repository( name = "com_github_wealdtech_go_bytesutil", importpath = "github.com/wealdtech/go-bytesutil", sum = "h1:ocEg3Ke2GkZ4vQw5lp46rmO+pfqCCTgq35gqOy8JKVc=", version = "v1.1.1", ) - go_repository( name = "com_github_wealdtech_go_eth2_types_v2", build_directives = [ @@ -3887,21 +3629,18 @@ def prysm_deps(): sum = "h1:2INPeOR35x5LdFFpSzyw954WzTD+DFyHe3yKlJnG5As=", version = "v1.6.3", ) - go_repository( name = "com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4", importpath = "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4", sum = "h1:SxrDVSr+oXuT1x8kZt4uWqNCvv5xXEGV9zd7cuSrZS8=", version = "v1.1.3", ) - go_repository( name = "com_github_wealdtech_go_eth2_wallet_types_v2", importpath = "github.com/wealdtech/go-eth2-wallet-types/v2", sum = "h1:264/meVYWt1wFw6Mtn+xwkZkXjID42gNra4rycoiDXI=", version = "v2.8.2", ) - go_repository( name = "com_github_xdg_scram", importpath = "github.com/xdg/scram", @@ -3920,21 +3659,18 @@ def prysm_deps(): sum = "h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=", version = "v2.1.0", ) - go_repository( name = "com_github_xiang90_probing", importpath = "github.com/xiang90/probing", sum = "h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=", version = "v0.0.0-20190116061207-43a291ad63a2", ) - go_repository( name = "com_github_xrash_smetrics", importpath = "github.com/xrash/smetrics", sum = "h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=", version = "v0.0.0-20201216005158-039620a65673", ) - go_repository( name = "com_github_xtaci_kcp_go", importpath = "github.com/xtaci/kcp-go", @@ -3947,14 +3683,12 @@ def prysm_deps(): sum = "h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=", version = "v0.0.0-20190602105132-8df528c0c9ae", ) - go_repository( name = "com_github_yosssi_ace", importpath = "github.com/yosssi/ace", sum = "h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA=", version = "v0.0.5", ) - go_repository( name = "com_github_yuin_goldmark", importpath = "github.com/yuin/goldmark", @@ -3967,7 +3701,6 @@ def prysm_deps(): sum = "h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=", version = "v1.2.3", ) - go_repository( name = "com_google_cloud_go", importpath = "cloud.google.com/go", @@ -4022,7 +3755,6 @@ def prysm_deps(): sum = "h1:B9CdHFZTFjVti89tmyXXrO+7vSNo2jvZuHG8zD5trdQ=", version = "v0.6.0", ) - go_repository( name = "com_google_cloud_go_appengine", importpath = "cloud.google.com/go/appengine", @@ -4077,14 +3809,12 @@ def prysm_deps(): sum = "h1:UkY2BTZkEUAVrgqnSdOJ4p3y9ZRBPEe1LkjgC8Bj/Pc=", version = "v0.5.0", ) - go_repository( name = "com_google_cloud_go_bigquery", importpath = "cloud.google.com/go/bigquery", sum = "h1:RscMV6LbnAmhAzD893Lv9nXXy2WCaJmbxYPWDLbGqNQ=", version = "v1.50.0", ) - go_repository( name = "com_google_cloud_go_billing", importpath = "cloud.google.com/go/billing", @@ -4133,7 +3863,6 @@ def prysm_deps(): sum = "h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=", version = "v1.20.1", ) - go_repository( name = "com_google_cloud_go_compute_metadata", importpath = "cloud.google.com/go/compute/metadata", @@ -4206,7 +3935,6 @@ def prysm_deps(): sum = "h1:yFzi/YU4YAdjyo7pXkBE2FeHbgz5OQQBVDdbErEHmVQ=", version = "v0.7.0", ) - go_repository( name = "com_google_cloud_go_datastore", importpath = "cloud.google.com/go/datastore", @@ -4279,7 +4007,6 @@ def prysm_deps(): sum = "h1:ckTEXN5towyTMu4q0uQ1Mde/JwTHur0gXs8oaIZnKfw=", version = "v1.6.0", ) - go_repository( name = "com_google_cloud_go_firestore", importpath = "cloud.google.com/go/firestore", @@ -4490,7 +4217,6 @@ def prysm_deps(): sum = "h1:EPEJ1DpEGXLDnmc7mnCAqFmkwUJbIsaLAiLHVOkkwtc=", version = "v0.8.0", ) - go_repository( name = "com_google_cloud_go_pubsub", importpath = "cloud.google.com/go/pubsub", @@ -4617,7 +4343,6 @@ def prysm_deps(): sum = "h1:JEVoWGNnTF128kNty7T4aG4eqv2z86yiMJPT9Zjp+iw=", version = "v1.15.0", ) - go_repository( name = "com_google_cloud_go_storage", importpath = "cloud.google.com/go/storage", @@ -4714,21 +4439,18 @@ def prysm_deps(): sum = "h1:FfGp9w0cYnaKZJhUOMqCOJCYT/WlvYBfTQhFWV3sRKI=", version = "v1.10.0", ) - go_repository( name = "com_lukechampine_blake3", importpath = "lukechampine.com/blake3", sum = "h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=", version = "v1.2.1", ) - go_repository( name = "com_shuralyov_dmitri_app_changes", importpath = "dmitri.shuralyov.com/app/changes", sum = "h1:hJiie5Bf3QucGRa4ymsAUOxyhYwGEz1xrsVk0P8erlw=", version = "v0.0.0-20180602232624-0a106ad413e3", ) - go_repository( name = "com_shuralyov_dmitri_gpu_mtl", importpath = "dmitri.shuralyov.com/gpu/mtl", @@ -4753,7 +4475,6 @@ def prysm_deps(): sum = "h1:ivON6cwHK1OH26MZyWDCnbTRZZf0IhNsENoNAKFS1g4=", version = "v0.0.0-20180228185332-28bcc343414c", ) - go_repository( name = "com_sourcegraph_sourcegraph_appdash", importpath = "sourcegraph.com/sourcegraph/appdash", @@ -4772,7 +4493,6 @@ def prysm_deps(): sum = "h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c=", version = "v0.0.0-20180604144634-d3ebe8f20ae4", ) - go_repository( name = "in_gopkg_alecthomas_kingpin_v2", importpath = "gopkg.in/alecthomas/kingpin.v2", @@ -4785,7 +4505,6 @@ def prysm_deps(): sum = "h1:stTHdEoWg1pQ8riaP5ROrjS6zy6wewH/Q2iwnLCQUXY=", version = "v1.0.0-20160220154919-db14e161995a", ) - go_repository( name = "in_gopkg_check_v1", importpath = "gopkg.in/check.v1", @@ -4822,14 +4541,12 @@ def prysm_deps(): sum = "h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs=", version = "v1.2.3", ) - go_repository( name = "in_gopkg_inf_v0", importpath = "gopkg.in/inf.v0", sum = "h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=", version = "v0.9.1", ) - go_repository( name = "in_gopkg_ini_v1", importpath = "gopkg.in/ini.v1", @@ -4866,14 +4583,12 @@ def prysm_deps(): sum = "h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=", version = "v1.1.0", ) - go_repository( name = "in_gopkg_natefinch_lumberjack_v2", importpath = "gopkg.in/natefinch/lumberjack.v2", sum = "h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=", version = "v2.0.0", ) - go_repository( name = "in_gopkg_redis_v4", importpath = "gopkg.in/redis.v4", @@ -4886,28 +4601,24 @@ def prysm_deps(): sum = "h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI=", version = "v1.12.0", ) - go_repository( name = "in_gopkg_tomb_v1", importpath = "gopkg.in/tomb.v1", sum = "h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=", version = "v1.0.0-20141024135613-dd632973f1e7", ) - go_repository( name = "in_gopkg_warnings_v0", importpath = "gopkg.in/warnings.v0", sum = "h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=", version = "v0.1.2", ) - go_repository( name = "in_gopkg_yaml_v2", importpath = "gopkg.in/yaml.v2", sum = "h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=", version = "v2.4.0", ) - go_repository( name = "in_gopkg_yaml_v3", importpath = "gopkg.in/yaml.v3", @@ -4926,7 +4637,6 @@ def prysm_deps(): sum = "h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0=", version = "v0.0.0-20191023171146-3cf2f69b5738", ) - go_repository( name = "io_k8s_api", build_file_proto_mode = "disable_global", @@ -4955,7 +4665,6 @@ def prysm_deps(): sum = "h1:sAvhNk5RRuc6FNYGqe7Ygz3PSo/2wGWbulskmzRX8Vs=", version = "v0.0.0-20200413195148-3a45101e95ac", ) - go_repository( name = "io_k8s_klog_v2", importpath = "k8s.io/klog/v2", @@ -4974,7 +4683,6 @@ def prysm_deps(): sum = "h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8=", version = "v4.0.2", ) - go_repository( name = "io_k8s_sigs_yaml", importpath = "sigs.k8s.io/yaml", @@ -4987,7 +4695,6 @@ def prysm_deps(): sum = "h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=", version = "v0.0.0-20201110183641-67b214c5f920", ) - go_repository( name = "io_opencensus_go", importpath = "go.opencensus.io", @@ -5000,14 +4707,12 @@ def prysm_deps(): sum = "h1:yGBYzYMewVL0yO9qqJv3Z5+IRhPdU7e9o/2oKpX4YvI=", version = "v0.2.1", ) - go_repository( name = "io_rsc_binaryregexp", importpath = "rsc.io/binaryregexp", sum = "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=", version = "v0.2.0", ) - go_repository( name = "io_rsc_quote_v3", importpath = "rsc.io/quote/v3", @@ -5026,14 +4731,12 @@ def prysm_deps(): sum = "h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=", version = "v0.0.3", ) - go_repository( name = "org_apache_git_thrift_git", importpath = "git.apache.org/thrift.git", sum = "h1:OR8VhtwhcAI3U48/rzBsVOuHi0zDPzYI1xASVcdSgR8=", version = "v0.0.0-20180902110319-2566ecd5d999", ) - go_repository( name = "org_go4", importpath = "go4.org", @@ -5046,7 +4749,6 @@ def prysm_deps(): sum = "h1:tmXTu+dfa+d9Evp8NpJdgOy6+rt8/x4yG7qPBrtNfLY=", version = "v0.0.0-20170609214715-11d0a25b4919", ) - go_repository( name = "org_golang_google_api", importpath = "google.golang.org/api", @@ -5065,7 +4767,6 @@ def prysm_deps(): sum = "h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=", version = "v0.0.0-20230410155749-daa745c078e1", ) - go_repository( name = "org_golang_google_grpc", build_file_proto_mode = "disable", @@ -5079,12 +4780,11 @@ def prysm_deps(): sum = "h1:lQ+dE99pFsb8osbJB3oRfE5eW4Hx6a/lZQr8Jh+eoT4=", version = "v1.0.0", ) - go_repository( name = "org_golang_google_protobuf", importpath = "google.golang.org/protobuf", - sum = "h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=", - version = "v1.31.0", + sum = "h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=", + version = "v1.32.0", ) go_repository( name = "org_golang_x_build", @@ -5092,18 +4792,17 @@ def prysm_deps(): sum = "h1:E2M5QgjZ/Jg+ObCQAudsXxuTsLj7Nl5RV/lZcQZmKSo=", version = "v0.0.0-20190111050920-041ab4dc3f9d", ) - go_repository( name = "org_golang_x_crypto", importpath = "golang.org/x/crypto", - sum = "h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=", - version = "v0.17.0", + sum = "h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=", + version = "v0.19.0", ) go_repository( name = "org_golang_x_exp", importpath = "golang.org/x/exp", - sum = "h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4=", - version = "v0.0.0-20231214170342-aacd6d4b4611", + sum = "h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE=", + version = "v0.0.0-20240213143201-ec583247a57a", ) go_repository( name = "org_golang_x_exp_typeparams", @@ -5111,14 +4810,12 @@ def prysm_deps(): sum = "h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=", version = "v0.0.0-20231108232855-2478ac86f678", ) - go_repository( name = "org_golang_x_image", importpath = "golang.org/x/image", sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=", version = "v0.0.0-20190802002840-cff245a6509b", ) - go_repository( name = "org_golang_x_lint", importpath = "golang.org/x/lint", @@ -5131,25 +4828,23 @@ def prysm_deps(): sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=", version = "v0.0.0-20190719004257-d2bd2a29d028", ) - go_repository( name = "org_golang_x_mod", importpath = "golang.org/x/mod", - sum = "h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=", - version = "v0.14.0", + sum = "h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=", + version = "v0.15.0", ) - go_repository( name = "org_golang_x_net", importpath = "golang.org/x/net", - sum = "h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=", - version = "v0.19.0", + sum = "h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=", + version = "v0.21.0", ) go_repository( name = "org_golang_x_oauth2", importpath = "golang.org/x/oauth2", - sum = "h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=", - version = "v0.12.0", + sum = "h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=", + version = "v0.16.0", ) go_repository( name = "org_golang_x_perf", @@ -5157,26 +4852,30 @@ def prysm_deps(): sum = "h1:ObuXPmIgI4ZMyQLIz48cJYgSyWdjUXc2SZAdyJMwEAU=", version = "v0.0.0-20230113213139-801c7ef9e5c5", ) - go_repository( name = "org_golang_x_sync", importpath = "golang.org/x/sync", - sum = "h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=", - version = "v0.5.0", + sum = "h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=", + version = "v0.6.0", ) go_repository( name = "org_golang_x_sys", importpath = "golang.org/x/sys", - sum = "h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=", - version = "v0.15.0", + sum = "h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=", + version = "v0.17.0", + ) + go_repository( + name = "org_golang_x_telemetry", + importpath = "golang.org/x/telemetry", + sum = "h1:+Kc94D8UVEVxJnLXp/+FMfqQARZtWHfVrcRtcG8aT3g=", + version = "v0.0.0-20240208230135-b75ee8823808", ) go_repository( name = "org_golang_x_term", importpath = "golang.org/x/term", - sum = "h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=", - version = "v0.15.0", + sum = "h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=", + version = "v0.17.0", ) - go_repository( name = "org_golang_x_text", importpath = "golang.org/x/text", @@ -5186,30 +4885,27 @@ def prysm_deps(): go_repository( name = "org_golang_x_time", importpath = "golang.org/x/time", - sum = "h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=", - version = "v0.3.0", + sum = "h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=", + version = "v0.5.0", ) go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", - sum = "h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=", - version = "v0.16.0", + sum = "h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=", + version = "v0.18.0", ) - go_repository( name = "org_golang_x_xerrors", importpath = "golang.org/x/xerrors", sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=", version = "v0.0.0-20200804184101-5ec99f83aff1", ) - go_repository( name = "org_uber_go_atomic", importpath = "go.uber.org/atomic", sum = "h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=", version = "v1.11.0", ) - go_repository( name = "org_uber_go_automaxprocs", build_directives = [ @@ -5233,20 +4929,18 @@ def prysm_deps(): sum = "h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk=", version = "v1.20.1", ) - go_repository( name = "org_uber_go_goleak", importpath = "go.uber.org/goleak", - sum = "h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=", - version = "v1.2.0", + sum = "h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=", + version = "v1.3.0", ) go_repository( name = "org_uber_go_mock", importpath = "go.uber.org/mock", - sum = "h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=", - version = "v0.3.0", + sum = "h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=", + version = "v0.4.0", ) - go_repository( name = "org_uber_go_multierr", importpath = "go.uber.org/multierr", @@ -5262,14 +4956,8 @@ def prysm_deps(): go_repository( name = "org_uber_go_zap", importpath = "go.uber.org/zap", - sum = "h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=", - version = "v1.26.0", - ) - go_repository( - name = "com_github_jedib0t_go_pretty_v6", - importpath = "github.com/jedib0t/go-pretty/v6", - sum = "h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/5l91s=", - version = "v6.5.4", + sum = "h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=", + version = "v1.27.0", ) http_archive( diff --git a/go.mod b/go.mod index b37225eb493c..6bdc52d05f11 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.0 github.com/gostaticanalysis/comment v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 @@ -44,7 +44,7 @@ require ( github.com/json-iterator/go v1.1.12 github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 github.com/kr/pretty v0.3.1 - github.com/libp2p/go-libp2p v0.32.1 + github.com/libp2p/go-libp2p v0.33.1 github.com/libp2p/go-libp2p-mplex v0.9.0 github.com/libp2p/go-libp2p-pubsub v0.10.0 github.com/libp2p/go-mplex v0.7.0 @@ -54,15 +54,15 @@ require ( github.com/minio/highwayhash v1.0.2 github.com/minio/sha256-simd v1.0.1 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/multiformats/go-multiaddr v0.12.1 + github.com/multiformats/go-multiaddr v0.12.2 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.27.10 + github.com/onsi/gomega v1.30.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/paulbellamy/ratecounter v0.2.0 github.com/pborman/uuid v1.2.1 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.17.0 - github.com/prometheus/client_model v0.5.0 + github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_model v0.6.0 github.com/prometheus/prom2json v1.3.0 github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 @@ -86,15 +86,15 @@ require ( go.etcd.io/bbolt v1.3.6 go.opencensus.io v0.24.0 go.uber.org/automaxprocs v1.5.2 - go.uber.org/mock v0.3.0 - golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 - golang.org/x/mod v0.14.0 - golang.org/x/sync v0.5.0 - golang.org/x/tools v0.16.0 + go.uber.org/mock v0.4.0 + golang.org/x/crypto v0.19.0 + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a + golang.org/x/mod v0.15.0 + golang.org/x/sync v0.6.0 + golang.org/x/tools v0.18.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 google.golang.org/grpc v1.56.3 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gopkg.in/d4l3k/messagediff.v1 v1.2.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -135,7 +135,7 @@ require ( github.com/elastic/gosigar v0.14.2 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/ferranbt/fastssz v0.0.0-20210120143747-11b9eff30ea9 // indirect - github.com/flynn/noise v1.0.0 // indirect + github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/getsentry/sentry-go v0.25.0 // indirect github.com/go-playground/locales v0.14.1 // indirect @@ -146,9 +146,9 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gopacket v1.1.19 // indirect - github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect + github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/graph-gophers/graphql-go v1.3.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect @@ -165,8 +165,8 @@ require ( github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c // indirect - github.com/klauspost/compress v1.17.4 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/koron/go-ssdp v0.0.4 // indirect github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.3 // indirect @@ -184,8 +184,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/miekg/dns v1.1.56 // indirect + github.com/miekg/dns v1.1.58 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect @@ -206,16 +205,15 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo/v2 v2.13.0 // indirect - github.com/opencontainers/runtime-spec v1.1.0 // indirect + github.com/onsi/ginkgo/v2 v2.15.0 // indirect + github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/common v0.47.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/qtls-go1-20 v0.3.4 // indirect - github.com/quic-go/quic-go v0.39.4 // indirect + github.com/quic-go/quic-go v0.42.0 // indirect github.com/quic-go/webtransport-go v0.6.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect @@ -234,13 +232,13 @@ require ( go.uber.org/dig v1.17.1 // indirect go.uber.org/fx v1.20.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/term v0.16.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/term v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/time v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect @@ -254,12 +252,12 @@ require ( github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/fatih/color v1.13.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect github.com/prysmaticlabs/gohashtree v0.0.4-beta - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect google.golang.org/api v0.44.0 // indirect google.golang.org/appengine v1.6.7 // indirect k8s.io/klog/v2 v2.80.0 // indirect diff --git a/go.sum b/go.sum index 60ac9b9c6d47..d849c60d021e 100644 --- a/go.sum +++ b/go.sum @@ -275,8 +275,8 @@ github.com/ferranbt/fastssz v0.0.0-20210120143747-11b9eff30ea9/go.mod h1:DyEu2iu github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= -github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= +github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= +github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= @@ -317,8 +317,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -428,8 +428,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -454,16 +454,16 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0= -github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= +github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -597,11 +597,11 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= +github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -635,8 +635,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= -github.com/libp2p/go-libp2p v0.32.1 h1:wy1J4kZIZxOaej6NveTWCZmHiJ/kY7GoAqXgqNCnPps= -github.com/libp2p/go-libp2p v0.32.1/go.mod h1:hXXC3kXPlBZ1eu8Q2hptGrMB4mZ3048JUoS4EKaHW5c= +github.com/libp2p/go-libp2p v0.33.1 h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA= +github.com/libp2p/go-libp2p v0.33.1/go.mod h1:zOUTMjG4I7TXwMndNyOBn/CNtVBLlvBlnxfi+8xzx+E= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= @@ -701,15 +701,13 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE= -github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY= +github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= +github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= @@ -760,8 +758,8 @@ github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9 github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.12.1 h1:vm+BA/WZA8QZDp1pF1FWhi5CT3g1tbi5GJmqpb6wnlk= -github.com/multiformats/go-multiaddr v0.12.1/go.mod h1:7mPkiBMmLeFipt+nNSq9pHZUeJSt8lHBgH6yhj0YQzE= +github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24= +github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= @@ -810,21 +808,21 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= -github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= +github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -887,16 +885,16 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -906,8 +904,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= +github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -937,10 +935,8 @@ github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg= -github.com/quic-go/qtls-go1-20 v0.3.4/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= -github.com/quic-go/quic-go v0.39.4 h1:PelfiuG7wXEffUT2yceiqz5V6Pc0TA5ruOd1LcmFc1s= -github.com/quic-go/quic-go v0.39.4/go.mod h1:T09QsDQWjLiQ74ZmacDfqZmhY/NLnw5BC40MANNNZ1Q= +github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= +github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY= github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= @@ -1148,10 +1144,10 @@ go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk= go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -1163,8 +1159,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1189,8 +1185,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1202,8 +1198,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -1232,8 +1228,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1286,8 +1282,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1304,8 +1300,8 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1320,8 +1316,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1414,13 +1410,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1441,8 +1437,8 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1510,8 +1506,8 @@ golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0t golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1653,8 +1649,8 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7 google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8/go.mod h1:hFxJC2f0epmp1elRCiEGJTKAWbwxZ2nvqZdHl3FQXCY= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 9f17e6586031dff7ca02aef77e7ae0b68bb724e8 Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 28 Mar 2024 09:11:55 -0700 Subject: [PATCH 013/325] Fill in missing debug logs for blob p2p IGNORE/REJECT (#13825) --- beacon-chain/verification/blob.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beacon-chain/verification/blob.go b/beacon-chain/verification/blob.go index ff9eb37d4993..f90dc5245e74 100644 --- a/beacon-chain/verification/blob.go +++ b/beacon-chain/verification/blob.go @@ -163,6 +163,7 @@ func (bv *ROBlobVerifier) NotFromFutureSlot() (err error) { earliestStart := bv.clock.SlotStart(bv.blob.Slot()).Add(-1 * params.BeaconConfig().MaximumGossipClockDisparityDuration()) // If the system time is still before earliestStart, we consider the blob from a future slot and return an error. if bv.clock.Now().Before(earliestStart) { + log.WithFields(logging.BlobFields(bv.blob)).Debug("sidecar slot is too far in the future") return ErrFromFutureSlot } return nil @@ -179,6 +180,7 @@ func (bv *ROBlobVerifier) SlotAboveFinalized() (err error) { return errors.Wrapf(ErrSlotNotAfterFinalized, "error computing epoch start slot for finalized checkpoint (%d) %s", fcp.Epoch, err.Error()) } if bv.blob.Slot() <= fSlot { + log.WithFields(logging.BlobFields(bv.blob)).Debug("sidecar slot is not after finalized checkpoint") return ErrSlotNotAfterFinalized } return nil @@ -228,6 +230,7 @@ func (bv *ROBlobVerifier) SidecarParentSeen(parentSeen func([32]byte) bool) (err if bv.fc.HasNode(bv.blob.ParentRoot()) { return nil } + log.WithFields(logging.BlobFields(bv.blob)).Debug("parent root has not been seen") return ErrSidecarParentNotSeen } @@ -236,6 +239,7 @@ func (bv *ROBlobVerifier) SidecarParentSeen(parentSeen func([32]byte) bool) (err func (bv *ROBlobVerifier) SidecarParentValid(badParent func([32]byte) bool) (err error) { defer bv.recordResult(RequireSidecarParentValid, &err) if badParent != nil && badParent(bv.blob.ParentRoot()) { + log.WithFields(logging.BlobFields(bv.blob)).Debug("parent root is invalid") return ErrSidecarParentInvalid } return nil @@ -261,6 +265,7 @@ func (bv *ROBlobVerifier) SidecarParentSlotLower() (err error) { func (bv *ROBlobVerifier) SidecarDescendsFromFinalized() (err error) { defer bv.recordResult(RequireSidecarDescendsFromFinalized, &err) if !bv.fc.HasNode(bv.blob.ParentRoot()) { + log.WithFields(logging.BlobFields(bv.blob)).Debug("parent root not in forkchoice") return ErrSidecarNotFinalizedDescendent } return nil From 5b1da7353c2a94e1d2e17705457552b549ac5fbf Mon Sep 17 00:00:00 2001 From: Lorenzo <60553286+thedevbirb@users.noreply.github.com> Date: Fri, 29 Mar 2024 05:00:40 +0100 Subject: [PATCH 014/325] feat(direct peers): configure static peers to be direct peers in pubsub options (#13773) --- beacon-chain/p2p/pubsub.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/beacon-chain/p2p/pubsub.go b/beacon-chain/p2p/pubsub.go index 7b6f91c2d71c..0cc0b4f13013 100644 --- a/beacon-chain/p2p/pubsub.go +++ b/beacon-chain/p2p/pubsub.go @@ -3,6 +3,7 @@ package p2p import ( "context" "encoding/hex" + "fmt" "strings" "time" @@ -130,7 +131,7 @@ func (s *Service) peerInspector(peerMap map[peer.ID]*pubsub.PeerScoreSnapshot) { } } -// Creates a list of pubsub options to configure out router with. +// pubsubOptions creates a list of options to configure our router with. func (s *Service) pubsubOptions() []pubsub.Option { psOpts := []pubsub.Option{ pubsub.WithMessageSignaturePolicy(pubsub.StrictNoSign), @@ -147,9 +148,35 @@ func (s *Service) pubsubOptions() []pubsub.Option { pubsub.WithGossipSubParams(pubsubGossipParam()), pubsub.WithRawTracer(gossipTracer{host: s.host}), } + + if len(s.cfg.StaticPeers) > 0 { + directPeersAddrInfos, err := parsePeersEnr(s.cfg.StaticPeers) + if err != nil { + log.WithError(err).Error("Could not add direct peer option") + return psOpts + } + psOpts = append(psOpts, pubsub.WithDirectPeers(directPeersAddrInfos)) + } + return psOpts } +// parsePeersEnr takes a list of raw ENRs and converts them into a list of AddrInfos. +func parsePeersEnr(peers []string) ([]peer.AddrInfo, error) { + addrs, err := PeersFromStringAddrs(peers) + if err != nil { + return nil, fmt.Errorf("Cannot convert peers raw ENRs into multiaddresses: %v", err) + } + if len(addrs) == 0 { + return nil, fmt.Errorf("Converting peers raw ENRs into multiaddresses resulted in an empty list") + } + directAddrInfos, err := peer.AddrInfosFromP2pAddrs(addrs...) + if err != nil { + return nil, fmt.Errorf("Cannot convert peers multiaddresses into AddrInfos: %v", err) + } + return directAddrInfos, nil +} + // creates a custom gossipsub parameter set. func pubsubGossipParam() pubsub.GossipSubParams { gParams := pubsub.DefaultGossipSubParams() From f3b49d4eaf7909f7d2a3a3cd089dca13f5d0548d Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:29:39 -0500 Subject: [PATCH 015/325] Repair idx 13486 (#13831) * Revert "Modify the algorithm of `updateFinalizedBlockRoots` (#13486)" This reverts commit 32fb18339281dc9adfb0a1de67370b7baab1a0b1. * migration to fix index corruption from pr 13486 * bail as soon as we see 10 epochs without the bug --------- Co-authored-by: Kasey Kirkham --- beacon-chain/db/kv/BUILD.bazel | 1 + beacon-chain/db/kv/blocks.go | 2 +- beacon-chain/db/kv/blocks_test.go | 6 +- beacon-chain/db/kv/error.go | 4 +- beacon-chain/db/kv/finalized_block_roots.go | 204 +++++++-------- .../db/kv/finalized_block_roots_test.go | 234 +++++++++++------- beacon-chain/db/kv/migration.go | 1 + .../db/kv/migration_finalized_parent.go | 87 +++++++ beacon-chain/db/kv/state.go | 2 +- beacon-chain/state/stategen/replay_test.go | 78 +++--- 10 files changed, 379 insertions(+), 240 deletions(-) create mode 100644 beacon-chain/db/kv/migration_finalized_parent.go diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index 41560e0e44bf..a1995e31e47f 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "migration.go", "migration_archived_index.go", "migration_block_slot_index.go", + "migration_finalized_parent.go", "migration_state_validators.go", "schema.go", "state.go", diff --git a/beacon-chain/db/kv/blocks.go b/beacon-chain/db/kv/blocks.go index 3b1226cce1ce..7cf787769e0e 100644 --- a/beacon-chain/db/kv/blocks.go +++ b/beacon-chain/db/kv/blocks.go @@ -224,7 +224,7 @@ func (s *Store) DeleteBlock(ctx context.Context, root [32]byte) error { return s.db.Update(func(tx *bolt.Tx) error { bkt := tx.Bucket(finalizedBlockRootsIndexBucket) if b := bkt.Get(root[:]); b != nil { - return ErrDeleteFinalized + return ErrDeleteJustifiedAndFinalized } if err := tx.Bucket(blocksBucket).Delete(root[:]); err != nil { diff --git a/beacon-chain/db/kv/blocks_test.go b/beacon-chain/db/kv/blocks_test.go index 384e9533ecd7..67235b2aef41 100644 --- a/beacon-chain/db/kv/blocks_test.go +++ b/beacon-chain/db/kv/blocks_test.go @@ -289,7 +289,7 @@ func TestStore_DeleteBlock(t *testing.T) { require.Equal(t, b, nil) require.Equal(t, false, db.HasStateSummary(ctx, root2)) - require.ErrorIs(t, db.DeleteBlock(ctx, root), ErrDeleteFinalized) + require.ErrorIs(t, db.DeleteBlock(ctx, root), ErrDeleteJustifiedAndFinalized) } func TestStore_DeleteJustifiedBlock(t *testing.T) { @@ -309,7 +309,7 @@ func TestStore_DeleteJustifiedBlock(t *testing.T) { require.NoError(t, db.SaveBlock(ctx, blk)) require.NoError(t, db.SaveState(ctx, st, root)) require.NoError(t, db.SaveJustifiedCheckpoint(ctx, cp)) - require.ErrorIs(t, db.DeleteBlock(ctx, root), ErrDeleteFinalized) + require.ErrorIs(t, db.DeleteBlock(ctx, root), ErrDeleteJustifiedAndFinalized) } func TestStore_DeleteFinalizedBlock(t *testing.T) { @@ -329,7 +329,7 @@ func TestStore_DeleteFinalizedBlock(t *testing.T) { require.NoError(t, db.SaveState(ctx, st, root)) require.NoError(t, db.SaveGenesisBlockRoot(ctx, root)) require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) - require.ErrorIs(t, db.DeleteBlock(ctx, root), ErrDeleteFinalized) + require.ErrorIs(t, db.DeleteBlock(ctx, root), ErrDeleteJustifiedAndFinalized) } func TestStore_GenesisBlock(t *testing.T) { db := setupDB(t) diff --git a/beacon-chain/db/kv/error.go b/beacon-chain/db/kv/error.go index 957b1735796b..6d79723cc7a7 100644 --- a/beacon-chain/db/kv/error.go +++ b/beacon-chain/db/kv/error.go @@ -2,8 +2,8 @@ package kv import "github.com/pkg/errors" -// ErrDeleteFinalized is raised when we attempt to delete a finalized block/state -var ErrDeleteFinalized = errors.New("cannot delete finalized block or state") +// ErrDeleteJustifiedAndFinalized is raised when we attempt to delete a finalized block/state +var ErrDeleteJustifiedAndFinalized = errors.New("cannot delete finalized block or state") // ErrNotFound can be used directly, or as a wrapped DBError, whenever a db method needs to // indicate that a value couldn't be found. diff --git a/beacon-chain/db/kv/finalized_block_roots.go b/beacon-chain/db/kv/finalized_block_roots.go index 2d655889a112..3376abc8ef40 100644 --- a/beacon-chain/db/kv/finalized_block_roots.go +++ b/beacon-chain/db/kv/finalized_block_roots.go @@ -5,6 +5,7 @@ import ( "context" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -28,90 +29,139 @@ var containerFinalizedButNotCanonical = []byte("recent block needs reindexing to // beacon block chain using the finalized root alone as this would exclude all other blocks in the // finalized epoch from being indexed as "final and canonical". // -// The main part of the algorithm traverses parent->child block relationships in the -// `blockParentRootIndicesBucket` bucket to find the path between the last finalized checkpoint -// and the current finalized checkpoint. It relies on the invariant that there is a unique path -// between two finalized checkpoints. +// The algorithm for building the index works as follows: +// - De-index all finalized beacon block roots from previous_finalized_epoch to +// new_finalized_epoch. (I.e. delete these roots from the index, to be re-indexed.) +// - Build the canonical finalized chain by walking up the ancestry chain from the finalized block +// root until a parent is found in the index, or the parent is genesis or the origin checkpoint. +// - Add all block roots in the database where epoch(block.slot) == checkpoint.epoch. +// +// This method ensures that all blocks from the current finalized epoch are considered "final" while +// maintaining only canonical and finalized blocks older than the current finalized epoch. func (s *Store) updateFinalizedBlockRoots(ctx context.Context, tx *bolt.Tx, checkpoint *ethpb.Checkpoint) error { ctx, span := trace.StartSpan(ctx, "BeaconDB.updateFinalizedBlockRoots") defer span.End() - finalizedBkt := tx.Bucket(finalizedBlockRootsIndexBucket) + bkt := tx.Bucket(finalizedBlockRootsIndexBucket) + + root := checkpoint.Root + var previousRoot []byte + genesisRoot := tx.Bucket(blocksBucket).Get(genesisBlockRootKey) + initCheckpointRoot := tx.Bucket(blocksBucket).Get(originCheckpointBlockRootKey) + + // De-index recent finalized block roots, to be re-indexed. previousFinalizedCheckpoint := ðpb.Checkpoint{} - if b := finalizedBkt.Get(previousFinalizedCheckpointKey); b != nil { + if b := bkt.Get(previousFinalizedCheckpointKey); b != nil { if err := decode(ctx, b, previousFinalizedCheckpoint); err != nil { tracing.AnnotateError(span, err) return err } } - // Handle the case of checkpoint sync. - if previousFinalizedCheckpoint.Root == nil && bytes.Equal(checkpoint.Root, tx.Bucket(blocksBucket).Get(originCheckpointBlockRootKey)) { - container := ðpb.FinalizedBlockRootContainer{} - enc, err := encode(ctx, container) + blockRoots, err := s.BlockRoots(ctx, filters.NewFilter(). + SetStartEpoch(previousFinalizedCheckpoint.Epoch). + SetEndEpoch(checkpoint.Epoch+1), + ) + if err != nil { + tracing.AnnotateError(span, err) + return err + } + for _, root := range blockRoots { + if err := bkt.Delete(root[:]); err != nil { + tracing.AnnotateError(span, err) + return err + } + } + + // Walk up the ancestry chain until we reach a block root present in the finalized block roots + // index bucket or genesis block root. + for { + if bytes.Equal(root, genesisRoot) { + break + } + + signedBlock, err := s.Block(ctx, bytesutil.ToBytes32(root)) if err != nil { tracing.AnnotateError(span, err) return err } - if err = finalizedBkt.Put(checkpoint.Root, enc); err != nil { + if err := blocks.BeaconBlockIsNil(signedBlock); err != nil { tracing.AnnotateError(span, err) return err } - return updatePrevFinalizedCheckpoint(ctx, span, finalizedBkt, checkpoint) - } + block := signedBlock.Block() + + parentRoot := block.ParentRoot() + container := ðpb.FinalizedBlockRootContainer{ + ParentRoot: parentRoot[:], + ChildRoot: previousRoot, + } - var finalized [][]byte - if previousFinalizedCheckpoint.Root == nil { - genesisRoot := tx.Bucket(blocksBucket).Get(genesisBlockRootKey) - _, finalized = pathToFinalizedCheckpoint(ctx, [][]byte{genesisRoot}, checkpoint.Root, tx) - } else { - if err := updateChildOfPrevFinalizedCheckpoint( - ctx, - span, - finalizedBkt, - tx.Bucket(blockParentRootIndicesBucket), previousFinalizedCheckpoint.Root, - ); err != nil { + enc, err := encode(ctx, container) + if err != nil { + tracing.AnnotateError(span, err) + return err + } + if err := bkt.Put(root, enc); err != nil { + tracing.AnnotateError(span, err) return err } - _, finalized = pathToFinalizedCheckpoint(ctx, [][]byte{previousFinalizedCheckpoint.Root}, checkpoint.Root, tx) - } - for i, r := range finalized { - var container *ethpb.FinalizedBlockRootContainer - switch i { - case 0: - container = ðpb.FinalizedBlockRootContainer{ - ParentRoot: previousFinalizedCheckpoint.Root, - } - if len(finalized) > 1 { - container.ChildRoot = finalized[i+1] + // breaking here allows the initial checkpoint root to be correctly inserted, + // but stops the loop from trying to search for its parent. + if bytes.Equal(root, initCheckpointRoot) { + break + } + + // Found parent, loop exit condition. + pr := block.ParentRoot() + if parentBytes := bkt.Get(pr[:]); parentBytes != nil { + parent := ðpb.FinalizedBlockRootContainer{} + if err := decode(ctx, parentBytes, parent); err != nil { + tracing.AnnotateError(span, err) + return err } - case len(finalized) - 1: - // We don't know the finalized child of the new finalized checkpoint. - // It will be filled out in the next function call. - container = ðpb.FinalizedBlockRootContainer{} - if len(finalized) > 1 { - container.ParentRoot = finalized[i-1] + parent.ChildRoot = root + enc, err := encode(ctx, parent) + if err != nil { + tracing.AnnotateError(span, err) + return err } - default: - container = ðpb.FinalizedBlockRootContainer{ - ParentRoot: finalized[i-1], - ChildRoot: finalized[i+1], + if err := bkt.Put(pr[:], enc); err != nil { + tracing.AnnotateError(span, err) + return err } + break } + previousRoot = root + root = pr[:] + } - enc, err := encode(ctx, container) - if err != nil { - tracing.AnnotateError(span, err) - return err + // Upsert blocks from the current finalized epoch. + roots, err := s.BlockRoots(ctx, filters.NewFilter().SetStartEpoch(checkpoint.Epoch).SetEndEpoch(checkpoint.Epoch+1)) + if err != nil { + tracing.AnnotateError(span, err) + return err + } + for _, root := range roots { + root := root[:] + if bytes.Equal(root, checkpoint.Root) || bkt.Get(root) != nil { + continue } - if err = finalizedBkt.Put(r, enc); err != nil { + if err := bkt.Put(root, containerFinalizedButNotCanonical); err != nil { tracing.AnnotateError(span, err) return err } } - return updatePrevFinalizedCheckpoint(ctx, span, finalizedBkt, checkpoint) + // Update previous checkpoint + enc, err := encode(ctx, checkpoint) + if err != nil { + tracing.AnnotateError(span, err) + return err + } + + return bkt.Put(previousFinalizedCheckpointKey, enc) } // BackfillFinalizedIndex updates the finalized index for a contiguous chain of blocks that are the ancestors of the @@ -192,6 +242,8 @@ func (s *Store) BackfillFinalizedIndex(ctx context.Context, blocks []blocks.ROBl // IsFinalizedBlock returns true if the block root is present in the finalized block root index. // A beacon block root contained exists in this index if it is considered finalized and canonical. +// Note: beacon blocks from the latest finalized epoch return true, whether or not they are +// considered canonical in the "head view" of the beacon node. func (s *Store) IsFinalizedBlock(ctx context.Context, blockRoot [32]byte) bool { _, span := trace.StartSpan(ctx, "BeaconDB.IsFinalizedBlock") defer span.End() @@ -244,53 +296,3 @@ func (s *Store) FinalizedChildBlock(ctx context.Context, blockRoot [32]byte) (in tracing.AnnotateError(span, err) return blk, err } - -func pathToFinalizedCheckpoint(ctx context.Context, roots [][]byte, checkpointRoot []byte, tx *bolt.Tx) (bool, [][]byte) { - if len(roots) == 0 || (len(roots) == 1 && roots[0] == nil) { - return false, nil - } - - for _, r := range roots { - if bytes.Equal(r, checkpointRoot) { - return true, [][]byte{r} - } - children := lookupValuesForIndices(ctx, map[string][]byte{string(blockParentRootIndicesBucket): r}, tx) - if len(children) == 0 { - children = [][][]byte{nil} - } - isPath, path := pathToFinalizedCheckpoint(ctx, children[0], checkpointRoot, tx) - if isPath { - return true, append([][]byte{r}, path...) - } - } - - return false, nil -} - -func updatePrevFinalizedCheckpoint(ctx context.Context, span *trace.Span, finalizedBkt *bolt.Bucket, checkpoint *ethpb.Checkpoint) error { - enc, err := encode(ctx, checkpoint) - if err != nil { - tracing.AnnotateError(span, err) - return err - } - return finalizedBkt.Put(previousFinalizedCheckpointKey, enc) -} - -func updateChildOfPrevFinalizedCheckpoint(ctx context.Context, span *trace.Span, finalizedBkt, parentBkt *bolt.Bucket, checkpointRoot []byte) error { - container := ðpb.FinalizedBlockRootContainer{} - if err := decode(ctx, finalizedBkt.Get(checkpointRoot), container); err != nil { - tracing.AnnotateError(span, err) - return err - } - container.ChildRoot = parentBkt.Get(checkpointRoot) - enc, err := encode(ctx, container) - if err != nil { - tracing.AnnotateError(span, err) - return err - } - if err = finalizedBkt.Put(checkpointRoot, enc); err != nil { - tracing.AnnotateError(span, err) - return err - } - return nil -} diff --git a/beacon-chain/db/kv/finalized_block_roots_test.go b/beacon-chain/db/kv/finalized_block_roots_test.go index b5f45906e3bd..a9bd7780c34a 100644 --- a/beacon-chain/db/kv/finalized_block_roots_test.go +++ b/beacon-chain/db/kv/finalized_block_roots_test.go @@ -26,30 +26,38 @@ func TestStore_IsFinalizedBlock(t *testing.T) { ctx := context.Background() require.NoError(t, db.SaveGenesisBlockRoot(ctx, genesisBlockRoot)) - blks := makeBlocks(t, 0, slotsPerEpoch*2, genesisBlockRoot) + + blks := makeBlocks(t, 0, slotsPerEpoch*3, genesisBlockRoot) require.NoError(t, db.SaveBlocks(ctx, blks)) root, err := blks[slotsPerEpoch].Block().HashTreeRoot() require.NoError(t, err) + cp := ðpb.Checkpoint{ Epoch: 1, Root: root[:], } + + st, err := util.NewBeaconState() + require.NoError(t, err) + // a state is required to save checkpoint + require.NoError(t, db.SaveState(ctx, st, root)) require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) - for i := uint64(0); i <= slotsPerEpoch; i++ { - root, err = blks[i].Block().HashTreeRoot() + // All blocks up to slotsPerEpoch*2 should be in the finalized index. + for i := uint64(0); i < slotsPerEpoch*2; i++ { + root, err := blks[i].Block().HashTreeRoot() require.NoError(t, err) - assert.Equal(t, true, db.IsFinalizedBlock(ctx, root), "Block at index %d was not considered finalized", i) + assert.Equal(t, true, db.IsFinalizedBlock(ctx, root), "Block at index %d was not considered finalized in the index", i) } - for i := slotsPerEpoch + 1; i < uint64(len(blks)); i++ { - root, err = blks[i].Block().HashTreeRoot() + for i := slotsPerEpoch * 3; i < uint64(len(blks)); i++ { + root, err := blks[i].Block().HashTreeRoot() require.NoError(t, err) - assert.Equal(t, false, db.IsFinalizedBlock(ctx, root), "Block at index %d was considered finalized, but should not have", i) + assert.Equal(t, false, db.IsFinalizedBlock(ctx, root), "Block at index %d was considered finalized in the index, but should not have", i) } } -func TestStore_IsFinalizedGenesisBlock(t *testing.T) { +func TestStore_IsFinalizedBlockGenesis(t *testing.T) { db := setupDB(t) ctx := context.Background() @@ -61,114 +69,136 @@ func TestStore_IsFinalizedGenesisBlock(t *testing.T) { require.NoError(t, err) require.NoError(t, db.SaveBlock(ctx, wsb)) require.NoError(t, db.SaveGenesisBlockRoot(ctx, root)) - assert.Equal(t, true, db.IsFinalizedBlock(ctx, root)) + assert.Equal(t, true, db.IsFinalizedBlock(ctx, root), "Finalized genesis block doesn't exist in db") } -func TestStore_IsFinalizedChildBlock(t *testing.T) { +// This test scenario is to test a specific edge case where the finalized block root is not part of +// the finalized and canonical chain. +// +// Example: +// 0 1 2 3 4 5 6 slot +// a <- b <-- d <- e <- f <- g roots +// +// ^- c +// +// Imagine that epochs are 2 slots and that epoch 1, 2, and 3 are finalized. Checkpoint roots would +// be c, e, and g. In this scenario, c was a finalized checkpoint root but no block built upon it so +// it should not be considered "final and canonical" in the view at slot 6. +func TestStore_IsFinalized_ForkEdgeCase(t *testing.T) { slotsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch) - ctx := context.Background() + blocks0 := makeBlocks(t, slotsPerEpoch*0, slotsPerEpoch, genesisBlockRoot) + blocks1 := append( + makeBlocks(t, slotsPerEpoch*1, 1, bytesutil.ToBytes32(sszRootOrDie(t, blocks0[len(blocks0)-1]))), // No block builds off of the first block in epoch. + makeBlocks(t, slotsPerEpoch*1+1, slotsPerEpoch-1, bytesutil.ToBytes32(sszRootOrDie(t, blocks0[len(blocks0)-1])))..., + ) + blocks2 := makeBlocks(t, slotsPerEpoch*2, slotsPerEpoch, bytesutil.ToBytes32(sszRootOrDie(t, blocks1[len(blocks1)-1]))) + db := setupDB(t) + ctx := context.Background() + require.NoError(t, db.SaveGenesisBlockRoot(ctx, genesisBlockRoot)) + require.NoError(t, db.SaveBlocks(ctx, blocks0)) + require.NoError(t, db.SaveBlocks(ctx, blocks1)) + require.NoError(t, db.SaveBlocks(ctx, blocks2)) - blks := makeBlocks(t, 0, slotsPerEpoch*2, genesisBlockRoot) - require.NoError(t, db.SaveBlocks(ctx, blks)) - root, err := blks[slotsPerEpoch].Block().HashTreeRoot() - require.NoError(t, err) - cp := ðpb.Checkpoint{ + // First checkpoint + checkpoint1 := ðpb.Checkpoint{ + Root: sszRootOrDie(t, blocks1[0]), Epoch: 1, - Root: root[:], } - require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) - - for i := uint64(0); i < slotsPerEpoch; i++ { - root, err = blks[i].Block().HashTreeRoot() - require.NoError(t, err) - assert.Equal(t, true, db.IsFinalizedBlock(ctx, root), "Block at index %d was not considered finalized", i) - blk, err := db.FinalizedChildBlock(ctx, root) - assert.NoError(t, err) - assert.Equal(t, false, blk == nil, "Child block at index %d was not considered finalized", i) - } -} -func TestStore_ChildRootOfPrevFinalizedCheckpointIsUpdated(t *testing.T) { - slotsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch) - ctx := context.Background() - db := setupDB(t) - require.NoError(t, db.SaveGenesisBlockRoot(ctx, genesisBlockRoot)) - - blks := makeBlocks(t, 0, slotsPerEpoch*3, genesisBlockRoot) - require.NoError(t, db.SaveBlocks(ctx, blks)) - root, err := blks[slotsPerEpoch].Block().HashTreeRoot() + st, err := util.NewBeaconState() require.NoError(t, err) - cp := ðpb.Checkpoint{ - Epoch: 1, - Root: root[:], + // A state is required to save checkpoint + require.NoError(t, db.SaveState(ctx, st, bytesutil.ToBytes32(checkpoint1.Root))) + require.NoError(t, db.SaveFinalizedCheckpoint(ctx, checkpoint1)) + // All blocks in blocks0 and blocks1 should be finalized and canonical. + for i, block := range append(blocks0, blocks1...) { + root := sszRootOrDie(t, block) + assert.Equal(t, true, db.IsFinalizedBlock(ctx, bytesutil.ToBytes32(root)), "%d - Expected block %#x to be finalized", i, root) } - require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) - root2, err := blks[slotsPerEpoch*2].Block().HashTreeRoot() - require.NoError(t, err) - cp = ðpb.Checkpoint{ + + // Second checkpoint + checkpoint2 := ðpb.Checkpoint{ + Root: sszRootOrDie(t, blocks2[0]), Epoch: 2, - Root: root2[:], } - require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) - - require.NoError(t, db.db.View(func(tx *bolt.Tx) error { - container := ðpb.FinalizedBlockRootContainer{} - f := tx.Bucket(finalizedBlockRootsIndexBucket).Get(root[:]) - require.NoError(t, decode(ctx, f, container)) - r, err := blks[slotsPerEpoch+1].Block().HashTreeRoot() - require.NoError(t, err) - assert.DeepEqual(t, r[:], container.ChildRoot) - return nil - })) + // A state is required to save checkpoint + require.NoError(t, db.SaveState(ctx, st, bytesutil.ToBytes32(checkpoint2.Root))) + require.NoError(t, db.SaveFinalizedCheckpoint(ctx, checkpoint2)) + // All blocks in blocks0 and blocks2 should be finalized and canonical. + for i, block := range append(blocks0, blocks2...) { + root := sszRootOrDie(t, block) + assert.Equal(t, true, db.IsFinalizedBlock(ctx, bytesutil.ToBytes32(root)), "%d - Expected block %#x to be finalized", i, root) + } + // All blocks in blocks1 should be finalized and canonical, except blocks1[0]. + for i, block := range blocks1 { + root := sszRootOrDie(t, block) + if db.IsFinalizedBlock(ctx, bytesutil.ToBytes32(root)) == (i == 0) { + t.Errorf("Expected db.IsFinalizedBlock(ctx, blocks1[%d]) to be %v", i, i != 0) + } + } } -func TestStore_OrphanedBlockIsNotFinalized(t *testing.T) { +func TestStore_IsFinalizedChildBlock(t *testing.T) { slotsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch) - db := setupDB(t) ctx := context.Background() - require.NoError(t, db.SaveGenesisBlockRoot(ctx, genesisBlockRoot)) - blk0 := util.NewBeaconBlock() - blk0.Block.ParentRoot = genesisBlockRoot[:] - blk0Root, err := blk0.Block.HashTreeRoot() - require.NoError(t, err) - blk1 := util.NewBeaconBlock() - blk1.Block.Slot = 1 - blk1.Block.ParentRoot = blk0Root[:] - blk2 := util.NewBeaconBlock() - blk2.Block.Slot = 2 - // orphan block at index 1 - blk2.Block.ParentRoot = blk0Root[:] - blk2Root, err := blk2.Block.HashTreeRoot() - require.NoError(t, err) - sBlk0, err := consensusblocks.NewSignedBeaconBlock(blk0) - require.NoError(t, err) - sBlk1, err := consensusblocks.NewSignedBeaconBlock(blk1) - require.NoError(t, err) - sBlk2, err := consensusblocks.NewSignedBeaconBlock(blk2) - require.NoError(t, err) - blks := append([]interfaces.ReadOnlySignedBeaconBlock{sBlk0, sBlk1, sBlk2}, makeBlocks(t, 3, slotsPerEpoch*2-3, blk2Root)...) - require.NoError(t, db.SaveBlocks(ctx, blks)) + eval := func(t testing.TB, ctx context.Context, db *Store, blks []interfaces.ReadOnlySignedBeaconBlock) { + require.NoError(t, db.SaveBlocks(ctx, blks)) + root, err := blks[slotsPerEpoch].Block().HashTreeRoot() + require.NoError(t, err) - root, err := blks[slotsPerEpoch].Block().HashTreeRoot() - require.NoError(t, err) - cp := ðpb.Checkpoint{ - Epoch: 1, - Root: root[:], - } - require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) + cp := ðpb.Checkpoint{ + Epoch: 1, + Root: root[:], + } - for i := uint64(0); i <= slotsPerEpoch; i++ { - root, err = blks[i].Block().HashTreeRoot() + st, err := util.NewBeaconState() require.NoError(t, err) - if i == 1 { - assert.Equal(t, false, db.IsFinalizedBlock(ctx, root), "Block at index 1 was considered finalized, but should not have") - } else { - assert.Equal(t, true, db.IsFinalizedBlock(ctx, root), "Block at index %d was not considered finalized", i) + // a state is required to save checkpoint + require.NoError(t, db.SaveState(ctx, st, root)) + require.NoError(t, db.SaveFinalizedCheckpoint(ctx, cp)) + + // All blocks up to slotsPerEpoch should have a finalized child block. + for i := uint64(0); i < slotsPerEpoch; i++ { + root, err := blks[i].Block().HashTreeRoot() + require.NoError(t, err) + assert.Equal(t, true, db.IsFinalizedBlock(ctx, root), "Block at index %d was not considered finalized in the index", i) + blk, err := db.FinalizedChildBlock(ctx, root) + assert.NoError(t, err) + if blk == nil { + t.Error("Child block doesn't exist for valid finalized block.") + } } } + + setup := func(t testing.TB) *Store { + db := setupDB(t) + require.NoError(t, db.SaveGenesisBlockRoot(ctx, genesisBlockRoot)) + + return db + } + + t.Run("phase0", func(t *testing.T) { + db := setup(t) + + blks := makeBlocks(t, 0, slotsPerEpoch*3, genesisBlockRoot) + eval(t, ctx, db, blks) + }) + + t.Run("altair", func(t *testing.T) { + db := setup(t) + + blks := makeBlocksAltair(t, 0, slotsPerEpoch*3, genesisBlockRoot) + eval(t, ctx, db, blks) + }) +} + +func sszRootOrDie(t *testing.T, block interfaces.ReadOnlySignedBeaconBlock) []byte { + root, err := block.Block().HashTreeRoot() + require.NoError(t, err) + return root[:] } func makeBlocks(t *testing.T, i, n uint64, previousRoot [32]byte) []interfaces.ReadOnlySignedBeaconBlock { @@ -189,6 +219,24 @@ func makeBlocks(t *testing.T, i, n uint64, previousRoot [32]byte) []interfaces.R return ifaceBlocks } +func makeBlocksAltair(t *testing.T, startIdx, num uint64, previousRoot [32]byte) []interfaces.ReadOnlySignedBeaconBlock { + blocks := make([]*ethpb.SignedBeaconBlockAltair, num) + ifaceBlocks := make([]interfaces.ReadOnlySignedBeaconBlock, num) + for j := startIdx; j < num+startIdx; j++ { + parentRoot := make([]byte, fieldparams.RootLength) + copy(parentRoot, previousRoot[:]) + blocks[j-startIdx] = util.NewBeaconBlockAltair() + blocks[j-startIdx].Block.Slot = primitives.Slot(j + 1) + blocks[j-startIdx].Block.ParentRoot = parentRoot + var err error + previousRoot, err = blocks[j-startIdx].Block.HashTreeRoot() + require.NoError(t, err) + ifaceBlocks[j-startIdx], err = consensusblocks.NewSignedBeaconBlock(blocks[j-startIdx]) + require.NoError(t, err) + } + return ifaceBlocks +} + func TestStore_BackfillFinalizedIndexSingle(t *testing.T) { db := setupDB(t) ctx := context.Background() diff --git a/beacon-chain/db/kv/migration.go b/beacon-chain/db/kv/migration.go index 70c485d2c9de..4bf2ad92299c 100644 --- a/beacon-chain/db/kv/migration.go +++ b/beacon-chain/db/kv/migration.go @@ -14,6 +14,7 @@ var migrations = []migration{ migrateArchivedIndex, migrateBlockSlotIndex, migrateStateValidators, + migrateFinalizedParent, } // RunMigrations defined in the migrations array. diff --git a/beacon-chain/db/kv/migration_finalized_parent.go b/beacon-chain/db/kv/migration_finalized_parent.go new file mode 100644 index 000000000000..d375e374890f --- /dev/null +++ b/beacon-chain/db/kv/migration_finalized_parent.go @@ -0,0 +1,87 @@ +package kv + +import ( + "bytes" + "context" + "fmt" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + bolt "go.etcd.io/bbolt" +) + +var migrationFinalizedParent = []byte("parent_bug_32fb183") + +func migrateFinalizedParent(ctx context.Context, db *bolt.DB) error { + if updateErr := db.Update(func(tx *bolt.Tx) error { + mb := tx.Bucket(migrationsBucket) + if b := mb.Get(migrationFinalizedParent); bytes.Equal(b, migrationCompleted) { + return nil // Migration already completed. + } + + bkt := tx.Bucket(finalizedBlockRootsIndexBucket) + if bkt == nil { + return fmt.Errorf("unable to read %s bucket for migration", finalizedBlockRootsIndexBucket) + } + bb := tx.Bucket(blocksBucket) + if bb == nil { + return fmt.Errorf("unable to read %s bucket for migration", blocksBucket) + } + + c := bkt.Cursor() + var slotsWithoutBug primitives.Slot + maxBugSearch := params.BeaconConfig().SlotsPerEpoch * 10 + for k, v := c.Last(); k != nil; k, v = c.Prev() { + // check if context is cancelled in between + if ctx.Err() != nil { + return ctx.Err() + } + + idxEntry := ðpb.FinalizedBlockRootContainer{} + if err := decode(ctx, v, idxEntry); err != nil { + return errors.Wrapf(err, "unable to decode finalized block root container for root=%#x", k) + } + // Not one of the corrupt values + if !bytes.Equal(idxEntry.ParentRoot, k) { + slotsWithoutBug += 1 + if slotsWithoutBug > maxBugSearch { + break + } + continue + } + slotsWithoutBug = 0 + log.WithField("root", fmt.Sprintf("%#x", k)).Debug("found index entry with incorrect parent root") + + // Look up full block to get the correct parent root. + encBlk := bb.Get(k) + if encBlk == nil { + return errors.Wrapf(ErrNotFound, "could not find block for corrupt finalized index entry %#x", k) + } + blk, err := unmarshalBlock(ctx, encBlk) + if err != nil { + return errors.Wrapf(err, "unable to decode block for root=%#x", k) + } + // Replace parent root in the index with the correct value and write it back. + pr := blk.Block().ParentRoot() + idxEntry.ParentRoot = pr[:] + idxEnc, err := encode(ctx, idxEntry) + if err != nil { + return errors.Wrapf(err, "failed to encode finalized index entry for root=%#x", k) + } + if err := bkt.Put(k, idxEnc); err != nil { + return errors.Wrapf(err, "failed to update finalized index entry for root=%#x", k) + } + log.WithField("root", fmt.Sprintf("%#x", k)). + WithField("parentRoot", fmt.Sprintf("%#x", idxEntry.ParentRoot)). + Debug("updated corrupt index entry with correct parent") + } + // Mark migration complete. + return mb.Put(migrationFinalizedParent, migrationCompleted) + }); updateErr != nil { + log.WithError(updateErr).Errorf("could not run finalized parent root index repair migration") + return updateErr + } + return nil +} diff --git a/beacon-chain/db/kv/state.go b/beacon-chain/db/kv/state.go index 2e5f988945b1..56a4a2d31de8 100644 --- a/beacon-chain/db/kv/state.go +++ b/beacon-chain/db/kv/state.go @@ -458,7 +458,7 @@ func (s *Store) DeleteState(ctx context.Context, blockRoot [32]byte) error { bkt = tx.Bucket(stateBucket) // Safeguard against deleting genesis, finalized, head state. if bytes.Equal(blockRoot[:], finalized.Root) || bytes.Equal(blockRoot[:], genesisBlockRoot) || bytes.Equal(blockRoot[:], justified.Root) { - return ErrDeleteFinalized + return ErrDeleteJustifiedAndFinalized } // Nothing to delete if state doesn't exist. diff --git a/beacon-chain/state/stategen/replay_test.go b/beacon-chain/state/stategen/replay_test.go index bf66c8f96335..9d8f3c489647 100644 --- a/beacon-chain/state/stategen/replay_test.go +++ b/beacon-chain/state/stategen/replay_test.go @@ -189,7 +189,7 @@ func TestLoadBlocks_FirstBranch(t *testing.T) { roots, savedBlocks, err := tree1(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - filteredBlocks, err := s.loadBlocks(ctx, 0, 9, roots[len(roots)-1]) + filteredBlocks, err := s.loadBlocks(ctx, 0, 8, roots[len(roots)-1]) require.NoError(t, err) wanted := []*ethpb.SignedBeaconBlock{ @@ -220,7 +220,7 @@ func TestLoadBlocks_SecondBranch(t *testing.T) { roots, savedBlocks, err := tree1(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - filteredBlocks, err := s.loadBlocks(ctx, 0, 6, roots[5]) + filteredBlocks, err := s.loadBlocks(ctx, 0, 5, roots[5]) require.NoError(t, err) wanted := []*ethpb.SignedBeaconBlock{ @@ -249,7 +249,7 @@ func TestLoadBlocks_ThirdBranch(t *testing.T) { roots, savedBlocks, err := tree1(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - filteredBlocks, err := s.loadBlocks(ctx, 0, 8, roots[7]) + filteredBlocks, err := s.loadBlocks(ctx, 0, 7, roots[7]) require.NoError(t, err) wanted := []*ethpb.SignedBeaconBlock{ @@ -280,7 +280,7 @@ func TestLoadBlocks_SameSlots(t *testing.T) { roots, savedBlocks, err := tree2(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - filteredBlocks, err := s.loadBlocks(ctx, 0, 4, roots[6]) + filteredBlocks, err := s.loadBlocks(ctx, 0, 3, roots[6]) require.NoError(t, err) wanted := []*ethpb.SignedBeaconBlock{ @@ -309,7 +309,7 @@ func TestLoadBlocks_SameEndSlots(t *testing.T) { roots, savedBlocks, err := tree3(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - filteredBlocks, err := s.loadBlocks(ctx, 0, 3, roots[2]) + filteredBlocks, err := s.loadBlocks(ctx, 0, 2, roots[2]) require.NoError(t, err) wanted := []*ethpb.SignedBeaconBlock{ @@ -337,7 +337,7 @@ func TestLoadBlocks_SameEndSlotsWith2blocks(t *testing.T) { roots, savedBlocks, err := tree4(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - filteredBlocks, err := s.loadBlocks(ctx, 0, 3, roots[1]) + filteredBlocks, err := s.loadBlocks(ctx, 0, 2, roots[1]) require.NoError(t, err) wanted := []*ethpb.SignedBeaconBlock{ @@ -363,7 +363,7 @@ func TestLoadBlocks_BadStart(t *testing.T) { roots, _, err := tree1(t, beaconDB, bytesutil.PadTo([]byte{'A'}, 32)) require.NoError(t, err) - _, err = s.loadBlocks(ctx, 0, 6, roots[8]) + _, err = s.loadBlocks(ctx, 0, 5, roots[8]) assert.ErrorContains(t, "end block roots don't match", err) } @@ -374,63 +374,63 @@ func TestLoadBlocks_BadStart(t *testing.T) { // \- B7 func tree1(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, []*ethpb.SignedBeaconBlock, error) { b0 := util.NewBeaconBlock() - b0.Block.Slot = 1 + b0.Block.Slot = 0 b0.Block.ParentRoot = genesisRoot r0, err := b0.Block.HashTreeRoot() if err != nil { return nil, nil, err } b1 := util.NewBeaconBlock() - b1.Block.Slot = 2 + b1.Block.Slot = 1 b1.Block.ParentRoot = r0[:] r1, err := b1.Block.HashTreeRoot() if err != nil { return nil, nil, err } b2 := util.NewBeaconBlock() - b2.Block.Slot = 3 + b2.Block.Slot = 2 b2.Block.ParentRoot = r1[:] r2, err := b2.Block.HashTreeRoot() if err != nil { return nil, nil, err } b3 := util.NewBeaconBlock() - b3.Block.Slot = 4 + b3.Block.Slot = 3 b3.Block.ParentRoot = r1[:] r3, err := b3.Block.HashTreeRoot() if err != nil { return nil, nil, err } b4 := util.NewBeaconBlock() - b4.Block.Slot = 5 + b4.Block.Slot = 4 b4.Block.ParentRoot = r2[:] r4, err := b4.Block.HashTreeRoot() if err != nil { return nil, nil, err } b5 := util.NewBeaconBlock() - b5.Block.Slot = 6 + b5.Block.Slot = 5 b5.Block.ParentRoot = r3[:] r5, err := b5.Block.HashTreeRoot() if err != nil { return nil, nil, err } b6 := util.NewBeaconBlock() - b6.Block.Slot = 7 + b6.Block.Slot = 6 b6.Block.ParentRoot = r4[:] r6, err := b6.Block.HashTreeRoot() if err != nil { return nil, nil, err } b7 := util.NewBeaconBlock() - b7.Block.Slot = 8 + b7.Block.Slot = 7 b7.Block.ParentRoot = r6[:] r7, err := b7.Block.HashTreeRoot() if err != nil { return nil, nil, err } b8 := util.NewBeaconBlock() - b8.Block.Slot = 9 + b8.Block.Slot = 8 b8.Block.ParentRoot = r6[:] r8, err := b8.Block.HashTreeRoot() if err != nil { @@ -466,21 +466,21 @@ func tree1(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, // \- B2 -- B3 func tree2(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, []*ethpb.SignedBeaconBlock, error) { b0 := util.NewBeaconBlock() - b0.Block.Slot = 1 + b0.Block.Slot = 0 b0.Block.ParentRoot = genesisRoot r0, err := b0.Block.HashTreeRoot() if err != nil { return nil, nil, err } b1 := util.NewBeaconBlock() - b1.Block.Slot = 2 + b1.Block.Slot = 1 b1.Block.ParentRoot = r0[:] r1, err := b1.Block.HashTreeRoot() if err != nil { return nil, nil, err } b21 := util.NewBeaconBlock() - b21.Block.Slot = 3 + b21.Block.Slot = 2 b21.Block.ParentRoot = r1[:] b21.Block.StateRoot = bytesutil.PadTo([]byte{'A'}, 32) r21, err := b21.Block.HashTreeRoot() @@ -488,7 +488,7 @@ func tree2(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b22 := util.NewBeaconBlock() - b22.Block.Slot = 3 + b22.Block.Slot = 2 b22.Block.ParentRoot = r1[:] b22.Block.StateRoot = bytesutil.PadTo([]byte{'B'}, 32) r22, err := b22.Block.HashTreeRoot() @@ -496,7 +496,7 @@ func tree2(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b23 := util.NewBeaconBlock() - b23.Block.Slot = 3 + b23.Block.Slot = 2 b23.Block.ParentRoot = r1[:] b23.Block.StateRoot = bytesutil.PadTo([]byte{'C'}, 32) r23, err := b23.Block.HashTreeRoot() @@ -504,7 +504,7 @@ func tree2(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b24 := util.NewBeaconBlock() - b24.Block.Slot = 3 + b24.Block.Slot = 2 b24.Block.ParentRoot = r1[:] b24.Block.StateRoot = bytesutil.PadTo([]byte{'D'}, 32) r24, err := b24.Block.HashTreeRoot() @@ -512,7 +512,7 @@ func tree2(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b3 := util.NewBeaconBlock() - b3.Block.Slot = 4 + b3.Block.Slot = 3 b3.Block.ParentRoot = r24[:] r3, err := b3.Block.HashTreeRoot() if err != nil { @@ -549,21 +549,21 @@ func tree2(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, // \- B2 func tree3(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, []*ethpb.SignedBeaconBlock, error) { b0 := util.NewBeaconBlock() - b0.Block.Slot = 1 + b0.Block.Slot = 0 b0.Block.ParentRoot = genesisRoot r0, err := b0.Block.HashTreeRoot() if err != nil { return nil, nil, err } b1 := util.NewBeaconBlock() - b1.Block.Slot = 2 + b1.Block.Slot = 1 b1.Block.ParentRoot = r0[:] r1, err := b1.Block.HashTreeRoot() if err != nil { return nil, nil, err } b21 := util.NewBeaconBlock() - b21.Block.Slot = 3 + b21.Block.Slot = 2 b21.Block.ParentRoot = r1[:] b21.Block.StateRoot = bytesutil.PadTo([]byte{'A'}, 32) r21, err := b21.Block.HashTreeRoot() @@ -571,7 +571,7 @@ func tree3(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b22 := util.NewBeaconBlock() - b22.Block.Slot = 3 + b22.Block.Slot = 2 b22.Block.ParentRoot = r1[:] b22.Block.StateRoot = bytesutil.PadTo([]byte{'B'}, 32) r22, err := b22.Block.HashTreeRoot() @@ -579,7 +579,7 @@ func tree3(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b23 := util.NewBeaconBlock() - b23.Block.Slot = 3 + b23.Block.Slot = 2 b23.Block.ParentRoot = r1[:] b23.Block.StateRoot = bytesutil.PadTo([]byte{'C'}, 32) r23, err := b23.Block.HashTreeRoot() @@ -587,7 +587,7 @@ func tree3(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b24 := util.NewBeaconBlock() - b24.Block.Slot = 3 + b24.Block.Slot = 2 b24.Block.ParentRoot = r1[:] b24.Block.StateRoot = bytesutil.PadTo([]byte{'D'}, 32) r24, err := b24.Block.HashTreeRoot() @@ -626,14 +626,14 @@ func tree3(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, // \- B2 func tree4(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, []*ethpb.SignedBeaconBlock, error) { b0 := util.NewBeaconBlock() - b0.Block.Slot = 1 + b0.Block.Slot = 0 b0.Block.ParentRoot = genesisRoot r0, err := b0.Block.HashTreeRoot() if err != nil { return nil, nil, err } b21 := util.NewBeaconBlock() - b21.Block.Slot = 3 + b21.Block.Slot = 2 b21.Block.ParentRoot = r0[:] b21.Block.StateRoot = bytesutil.PadTo([]byte{'A'}, 32) r21, err := b21.Block.HashTreeRoot() @@ -641,7 +641,7 @@ func tree4(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b22 := util.NewBeaconBlock() - b22.Block.Slot = 3 + b22.Block.Slot = 2 b22.Block.ParentRoot = r0[:] b22.Block.StateRoot = bytesutil.PadTo([]byte{'B'}, 32) r22, err := b22.Block.HashTreeRoot() @@ -649,7 +649,7 @@ func tree4(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b23 := util.NewBeaconBlock() - b23.Block.Slot = 3 + b23.Block.Slot = 2 b23.Block.ParentRoot = r0[:] b23.Block.StateRoot = bytesutil.PadTo([]byte{'C'}, 32) r23, err := b23.Block.HashTreeRoot() @@ -657,7 +657,7 @@ func tree4(t *testing.T, beaconDB db.Database, genesisRoot []byte) ([][32]byte, return nil, nil, err } b24 := util.NewBeaconBlock() - b24.Block.Slot = 3 + b24.Block.Slot = 2 b24.Block.ParentRoot = r0[:] b24.Block.StateRoot = bytesutil.PadTo([]byte{'D'}, 32) r24, err := b24.Block.HashTreeRoot() @@ -697,17 +697,17 @@ func TestLoadFinalizedBlocks(t *testing.T) { gRoot, err := gBlock.Block.HashTreeRoot() require.NoError(t, err) util.SaveBlock(t, ctx, beaconDB, gBlock) - require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, [32]byte{})) roots, _, err := tree1(t, beaconDB, gRoot[:]) require.NoError(t, err) - filteredBlocks, err := s.loadFinalizedBlocks(ctx, 0, 9) + filteredBlocks, err := s.loadFinalizedBlocks(ctx, 0, 8) require.NoError(t, err) - require.Equal(t, 1, len(filteredBlocks)) + require.Equal(t, 0, len(filteredBlocks)) require.NoError(t, beaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Root: roots[8][:]})) require.NoError(t, s.beaconDB.SaveFinalizedCheckpoint(ctx, ðpb.Checkpoint{Root: roots[8][:]})) - filteredBlocks, err = s.loadFinalizedBlocks(ctx, 0, 9) + filteredBlocks, err = s.loadFinalizedBlocks(ctx, 0, 8) require.NoError(t, err) - require.Equal(t, 7, len(filteredBlocks)) + require.Equal(t, 10, len(filteredBlocks)) } From 65b90abdda93d714da6652440b158c8d5d1fae18 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Sat, 30 Mar 2024 22:54:11 +0800 Subject: [PATCH 016/325] Maximize Peer Capacity When Syncing (#13820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * maximize it * fix it * lint * add test * Update beacon-chain/sync/initial-sync/blocks_fetcher.go Co-authored-by: Radosław Kapka * logs * kasey's review * kasey's review --------- Co-authored-by: Radosław Kapka --- .../sync/initial-sync/blocks_fetcher.go | 65 ++++++++++++++++--- .../sync/initial-sync/blocks_fetcher_test.go | 20 ++++++ .../sync/initial-sync/blocks_fetcher_utils.go | 4 +- 3 files changed, 79 insertions(+), 10 deletions(-) diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher.go b/beacon-chain/sync/initial-sync/blocks_fetcher.go index 0390a92438c4..429fa833ec3d 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher.go @@ -312,7 +312,7 @@ func (f *blocksFetcher) handleRequest(ctx context.Context, start primitives.Slot response.bwb, response.pid, response.err = f.fetchBlocksFromPeer(ctx, start, count, peers) if response.err == nil { - bwb, err := f.fetchBlobsFromPeer(ctx, response.bwb, response.pid) + bwb, err := f.fetchBlobsFromPeer(ctx, response.bwb, response.pid, peers) if err != nil { response.err = err } @@ -336,6 +336,11 @@ func (f *blocksFetcher) fetchBlocksFromPeer( Count: count, Step: 1, } + bestPeers := f.hasSufficientBandwidth(peers, req.Count) + // We append the best peers to the front so that higher capacity + // peers are dialed first. + peers = append(bestPeers, peers...) + peers = dedupPeers(peers) for i := 0; i < len(peers); i++ { p := peers[i] blocks, err := f.requestBlocks(ctx, req, p) @@ -472,7 +477,7 @@ func missingCommitError(root [32]byte, slot primitives.Slot, missing [][]byte) e } // fetchBlobsFromPeer fetches blocks from a single randomly selected peer. -func (f *blocksFetcher) fetchBlobsFromPeer(ctx context.Context, bwb []blocks2.BlockWithROBlobs, pid peer.ID) ([]blocks2.BlockWithROBlobs, error) { +func (f *blocksFetcher) fetchBlobsFromPeer(ctx context.Context, bwb []blocks2.BlockWithROBlobs, pid peer.ID, peers []peer.ID) ([]blocks2.BlockWithROBlobs, error) { ctx, span := trace.StartSpan(ctx, "initialsync.fetchBlobsFromPeer") defer span.End() if slots.ToEpoch(f.clock.CurrentSlot()) < params.BeaconConfig().DenebForkEpoch { @@ -487,13 +492,30 @@ func (f *blocksFetcher) fetchBlobsFromPeer(ctx context.Context, bwb []blocks2.Bl if req == nil { return bwb, nil } - // Request blobs from the same peer that gave us the blob batch. - blobs, err := f.requestBlobs(ctx, req, pid) - if err != nil { - return nil, errors.Wrap(err, "could not request blobs by range") + peers = f.filterPeers(ctx, peers, peersPercentagePerRequest) + // We dial the initial peer first to ensure that we get the desired set of blobs. + wantedPeers := append([]peer.ID{pid}, peers...) + bestPeers := f.hasSufficientBandwidth(wantedPeers, req.Count) + // We append the best peers to the front so that higher capacity + // peers are dialed first. If all of them fail, we fallback to the + // initial peer we wanted to request blobs from. + peers = append(bestPeers, pid) + for i := 0; i < len(peers); i++ { + p := peers[i] + blobs, err := f.requestBlobs(ctx, req, p) + if err != nil { + log.WithField("peer", p).WithError(err).Debug("Could not request blobs by range from peer") + continue + } + f.p2p.Peers().Scorers().BlockProviderScorer().Touch(p) + robs, err := verifyAndPopulateBlobs(bwb, blobs, blobWindowStart) + if err != nil { + log.WithField("peer", p).WithError(err).Debug("Invalid BeaconBlobsByRange response") + continue + } + return robs, err } - f.p2p.Peers().Scorers().BlockProviderScorer().Touch(pid) - return verifyAndPopulateBlobs(bwb, blobs, blobWindowStart) + return nil, errNoPeersAvailable } // requestBlocks is a wrapper for handling BeaconBlocksByRangeRequest requests/streams. @@ -606,6 +628,18 @@ func (f *blocksFetcher) waitForBandwidth(pid peer.ID, count uint64) error { return nil } +func (f *blocksFetcher) hasSufficientBandwidth(peers []peer.ID, count uint64) []peer.ID { + filteredPeers := []peer.ID{} + for _, p := range peers { + if uint64(f.rateLimiter.Remaining(p.String())) < count { + continue + } + copiedP := p + filteredPeers = append(filteredPeers, copiedP) + } + return filteredPeers +} + // Determine how long it will take for us to have the required number of blocks allowed by our rate limiter. // We do this by calculating the duration till the rate limiter can request these blocks without exceeding // the provided bandwidth limits per peer. @@ -626,3 +660,18 @@ func timeToWait(wanted, rem, capacity int64, timeTillEmpty time.Duration) time.D expectedTime := int64(timeTillEmpty) * blocksNeeded / currentNumBlks return time.Duration(expectedTime) } + +// deduplicates the provided peer list. +func dedupPeers(peers []peer.ID) []peer.ID { + newPeerList := make([]peer.ID, 0, len(peers)) + peerExists := make(map[peer.ID]bool) + + for i := range peers { + if peerExists[peers[i]] { + continue + } + newPeerList = append(newPeerList, peers[i]) + peerExists[peers[i]] = true + } + return newPeerList +} diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher_test.go b/beacon-chain/sync/initial-sync/blocks_fetcher_test.go index 43e062127b5c..0852d8f7f5c5 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher_test.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher_test.go @@ -12,6 +12,7 @@ import ( libp2pcore "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbtest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" p2pm "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" @@ -1166,3 +1167,22 @@ func TestBatchLimit(t *testing.T) { assert.Equal(t, params.BeaconConfig().MaxRequestBlocksDeneb, uint64(maxBatchLimit())) } + +func TestBlockFetcher_HasSufficientBandwidth(t *testing.T) { + bf := newBlocksFetcher(context.Background(), &blocksFetcherConfig{}) + currCap := bf.rateLimiter.Capacity() + wantedAmt := currCap - 100 + bf.rateLimiter.Add(peer.ID("a").String(), wantedAmt) + bf.rateLimiter.Add(peer.ID("c").String(), wantedAmt) + bf.rateLimiter.Add(peer.ID("f").String(), wantedAmt) + bf.rateLimiter.Add(peer.ID("d").String(), wantedAmt) + + receivedPeers := bf.hasSufficientBandwidth([]peer.ID{"a", "b", "c", "d", "e", "f"}, 110) + for _, p := range receivedPeers { + switch p { + case "a", "c", "f", "d": + t.Errorf("peer has exceeded capacity: %s", p) + } + } + assert.Equal(t, 2, len(receivedPeers)) +} diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go b/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go index 5610a7ed0adc..dcdaf161ab94 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go @@ -280,7 +280,7 @@ func (f *blocksFetcher) findForkWithPeer(ctx context.Context, pid peer.ID, slot } // We need to fetch the blobs for the given alt-chain if any exist, so that we can try to verify and import // the blocks. - bwb, err := f.fetchBlobsFromPeer(ctx, altBlocks, pid) + bwb, err := f.fetchBlobsFromPeer(ctx, altBlocks, pid, []peer.ID{pid}) if err != nil { return nil, errors.Wrap(err, "unable to retrieve blobs for blocks found in findForkWithPeer") } @@ -302,7 +302,7 @@ func (f *blocksFetcher) findAncestor(ctx context.Context, pid peer.ID, b interfa if err != nil { return nil, errors.Wrap(err, "received invalid blocks in findAncestor") } - bwb, err = f.fetchBlobsFromPeer(ctx, bwb, pid) + bwb, err = f.fetchBlobsFromPeer(ctx, bwb, pid, []peer.ID{pid}) if err != nil { return nil, errors.Wrap(err, "unable to retrieve blobs for blocks found in findAncestor") } From 38f208d70dc95b12c08403f5c72009aaa10dfe2f Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Mon, 1 Apr 2024 12:37:36 +0800 Subject: [PATCH 017/325] Reject Empty Bundles (#13798) * reject it * test * add test case --- .../rpc/prysm/v1alpha1/validator/BUILD.bazel | 5 +-- .../rpc/prysm/v1alpha1/validator/unblinder.go | 15 +++++--- .../v1alpha1/validator/unblinder_test.go | 34 +++++++++++++++++++ 3 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 beacon-chain/rpc/prysm/v1alpha1/validator/unblinder_test.go diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel index f279bbb37407..12c85ee66768 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel @@ -4,10 +4,10 @@ go_library( name = "go_default_library", srcs = [ "aggregator.go", - "duties.go", "attester.go", "blocks.go", "construct_generic_block.go", + "duties.go", "exit.go", "log.go", "proposer.go", @@ -179,10 +179,10 @@ go_test( timeout = "moderate", srcs = [ "aggregator_test.go", - "duties_test.go", "attester_test.go", "blocks_test.go", "construct_generic_block_test.go", + "duties_test.go", "exit_test.go", "proposer_altair_test.go", "proposer_attestations_test.go", @@ -201,6 +201,7 @@ go_test( "status_mainnet_test.go", "status_test.go", "sync_committee_test.go", + "unblinder_test.go", "validator_test.go", ], embed = [":go_default_library"], diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder.go b/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder.go index 86e9669bd048..ccb781cd59e2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder.go @@ -13,15 +13,22 @@ import ( ) func unblindBlobsSidecars(block interfaces.SignedBeaconBlock, bundle *enginev1.BlobsBundle) ([]*ethpb.BlobSidecar, error) { - if block.Version() < version.Deneb || bundle == nil { + if block.Version() < version.Deneb { return nil, nil } - header, err := block.Header() + body := block.Block().Body() + blockCommitments, err := body.BlobKzgCommitments() if err != nil { return nil, err } - body := block.Block().Body() - blockCommitments, err := body.BlobKzgCommitments() + if len(blockCommitments) == 0 { + return nil, nil + } + // Do not allow builders to provide no blob bundles for blocks which carry commitments. + if bundle == nil { + return nil, errors.New("no valid bundle provided") + } + header, err := block.Header() if err != nil { return nil, err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder_test.go new file mode 100644 index 000000000000..8b06a0528edb --- /dev/null +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/unblinder_test.go @@ -0,0 +1,34 @@ +package validator + +import ( + "testing" + + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" +) + +func TestUnblinder_UnblindBlobSidecars_InvalidBundle(t *testing.T) { + wBlock, err := consensusblocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{ + Block: ðpb.BeaconBlockDeneb{ + Body: ðpb.BeaconBlockBodyDeneb{}, + }, + Signature: nil, + }) + assert.NoError(t, err) + _, err = unblindBlobsSidecars(wBlock, nil) + assert.NoError(t, err) + + wBlock, err = consensusblocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{ + Block: ðpb.BeaconBlockDeneb{ + Body: ðpb.BeaconBlockBodyDeneb{ + BlobKzgCommitments: [][]byte{[]byte("a"), []byte("b")}, + }, + }, + Signature: nil, + }) + assert.NoError(t, err) + _, err = unblindBlobsSidecars(wBlock, nil) + assert.ErrorContains(t, "no valid bundle provided", err) + +} From 2b4bb5d8901adc83fde513cd66b721f6880fc79f Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:12:20 +0200 Subject: [PATCH 018/325] Fixed spelling mistakes in comments (#13833) --- async/abool/abool_test.go | 12 ++++++------ async/scatter.go | 2 +- beacon-chain/blockchain/process_block_helpers.go | 2 +- .../cache/depositcache/deposits_cache_test.go | 2 +- .../cache/depositsnapshot/deposit_cache_test.go | 2 +- beacon-chain/core/helpers/rewards_penalties.go | 2 +- beacon-chain/core/signing/signing_root.go | 2 +- beacon-chain/db/slasherkv/slasher.go | 4 ++-- beacon-chain/execution/prometheus_test.go | 6 +++--- beacon-chain/p2p/peers/status.go | 12 ++++++------ beacon-chain/p2p/peers/status_test.go | 2 +- beacon-chain/slasher/chunks.go | 8 ++++---- beacon-chain/slasher/detect_attestations_test.go | 6 +++--- beacon-chain/slasher/helpers.go | 2 +- beacon-chain/sync/pending_blocks_queue_test.go | 2 +- beacon-chain/sync/service_test.go | 2 +- beacon-chain/verification/blob.go | 2 +- cmd/beacon-chain/sync/backfill/flags/flags.go | 2 +- cmd/validator/flags/flags.go | 2 +- config/proposer/settings.go | 2 +- container/doubly-linked-list/list.go | 2 +- encoding/ssz/equality/deep_equal.go | 6 +++--- hack/codecov.sh | 2 +- monitoring/clientstats/types.go | 6 +++--- testing/endtoend/evaluators/fee_recipient.go | 2 +- testing/endtoend/evaluators/operations.go | 2 +- testing/endtoend/evaluators/slashing_helper.go | 2 +- testing/util/capella_block.go | 2 +- time/slots/slottime.go | 2 +- validator/accounts/wallet_recover.go | 2 +- validator/client/beacon-api/doppelganger_test.go | 2 +- validator/db/convert_test.go | 2 +- validator/testing/protection_history.go | 2 +- 33 files changed, 55 insertions(+), 55 deletions(-) diff --git a/async/abool/abool_test.go b/async/abool/abool_test.go index 1733ccc70425..f870206abd43 100644 --- a/async/abool/abool_test.go +++ b/async/abool/abool_test.go @@ -88,7 +88,7 @@ func TestToggle(t *testing.T) { } } -func TestToogleMultipleTimes(t *testing.T) { +func TestToggleMultipleTimes(t *testing.T) { t.Parallel() v := New() @@ -101,16 +101,16 @@ func TestToogleMultipleTimes(t *testing.T) { expected := i%2 != 0 if v.IsSet() != expected { - t.Fatalf("AtomicBool.Toogle() doesn't work after %d calls, expected: %v, got %v", i, expected, v.IsSet()) + t.Fatalf("AtomicBool.Toggle() doesn't work after %d calls, expected: %v, got %v", i, expected, v.IsSet()) } if pre == v.IsSet() { - t.Fatalf("AtomicBool.Toogle() returned wrong value at the %dth calls, expected: %v, got %v", i, !v.IsSet(), pre) + t.Fatalf("AtomicBool.Toggle() returned wrong value at the %dth calls, expected: %v, got %v", i, !v.IsSet(), pre) } } } -func TestToogleAfterOverflow(t *testing.T) { +func TestToggleAfterOverflow(t *testing.T) { t.Parallel() var value int32 = math.MaxInt32 @@ -122,7 +122,7 @@ func TestToogleAfterOverflow(t *testing.T) { v.Toggle() expected := math.MaxInt32%2 == 0 if v.IsSet() != expected { - t.Fatalf("AtomicBool.Toogle() doesn't work after overflow, expected: %v, got %v", expected, v.IsSet()) + t.Fatalf("AtomicBool.Toggle() doesn't work after overflow, expected: %v, got %v", expected, v.IsSet()) } // make sure overflow happened @@ -135,7 +135,7 @@ func TestToogleAfterOverflow(t *testing.T) { v.Toggle() expected = !expected if v.IsSet() != expected { - t.Fatalf("AtomicBool.Toogle() doesn't work after the second call after overflow, expected: %v, got %v", expected, v.IsSet()) + t.Fatalf("AtomicBool.Toggle() doesn't work after the second call after overflow, expected: %v, got %v", expected, v.IsSet()) } } diff --git a/async/scatter.go b/async/scatter.go index 09b8d9d1c9f1..ac3b743d804f 100644 --- a/async/scatter.go +++ b/async/scatter.go @@ -63,7 +63,7 @@ func Scatter(inputLen int, sFunc func(int, int, *sync.RWMutex) (interface{}, err return results, nil } -// calculateChunkSize calculates a suitable chunk size for the purposes of parallelisation. +// calculateChunkSize calculates a suitable chunk size for the purposes of parallelization. func calculateChunkSize(items int) int { // Start with a simple even split chunkSize := items / runtime.GOMAXPROCS(0) diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index c367b587e695..810be735abf9 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -60,7 +60,7 @@ func (s *Service) getFCUArgsEarlyBlock(cfg *postBlockProcessConfig, fcuArgs *fcu // logNonCanonicalBlockReceived prints a message informing that the received // block is not the head of the chain. It requires the caller holds a lock on -// Foprkchoice. +// Forkchoice. func (s *Service) logNonCanonicalBlockReceived(blockRoot [32]byte, headRoot [32]byte) { receivedWeight, err := s.cfg.ForkChoiceStore.Weight(blockRoot) if err != nil { diff --git a/beacon-chain/cache/depositcache/deposits_cache_test.go b/beacon-chain/cache/depositcache/deposits_cache_test.go index c1d41bfef44b..a5d0a7b068ee 100644 --- a/beacon-chain/cache/depositcache/deposits_cache_test.go +++ b/beacon-chain/cache/depositcache/deposits_cache_test.go @@ -804,7 +804,7 @@ func TestFinalizedDeposits_ReturnsTrieCorrectly(t *testing.T) { depositTrie, err := trie.GenerateTrieFromItems(trieItems, params.BeaconConfig().DepositContractTreeDepth) assert.NoError(t, err) - // Perform this in a non-sensical ordering + // Perform this in a nonsensical ordering require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 10, [32]byte{}, 0)) require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0)) require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 3, [32]byte{}, 0)) diff --git a/beacon-chain/cache/depositsnapshot/deposit_cache_test.go b/beacon-chain/cache/depositsnapshot/deposit_cache_test.go index 66fd4f61f382..2c17e8428b5c 100644 --- a/beacon-chain/cache/depositsnapshot/deposit_cache_test.go +++ b/beacon-chain/cache/depositsnapshot/deposit_cache_test.go @@ -784,7 +784,7 @@ func TestFinalizedDeposits_ReturnsTrieCorrectly(t *testing.T) { depositTrie, err := trie.GenerateTrieFromItems(trieItems, params.BeaconConfig().DepositContractTreeDepth) assert.NoError(t, err) - // Perform this in a non-sensical ordering + // Perform this in a nonsensical ordering err = dc.InsertFinalizedDeposits(context.Background(), 1, [32]byte{}, 0) require.NoError(t, err) err = dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0) diff --git a/beacon-chain/core/helpers/rewards_penalties.go b/beacon-chain/core/helpers/rewards_penalties.go index 1e8cbd54ee34..3dc8d5bd0659 100644 --- a/beacon-chain/core/helpers/rewards_penalties.go +++ b/beacon-chain/core/helpers/rewards_penalties.go @@ -22,7 +22,7 @@ var balanceCache = cache.NewEffectiveBalanceCache() // """ // Return the combined effective balance of the ``indices``. // ``EFFECTIVE_BALANCE_INCREMENT`` Gwei minimum to avoid divisions by zero. -// Math safe up to ~10B ETH, afterwhich this overflows uint64. +// Math safe up to ~10B ETH, after which this overflows uint64. // """ // return Gwei(max(EFFECTIVE_BALANCE_INCREMENT, sum([state.validators[index].effective_balance for index in indices]))) func TotalBalance(state state.ReadOnlyValidators, indices []primitives.ValidatorIndex) uint64 { diff --git a/beacon-chain/core/signing/signing_root.go b/beacon-chain/core/signing/signing_root.go index 96b9887fb5e9..1f5e0fab53b3 100644 --- a/beacon-chain/core/signing/signing_root.go +++ b/beacon-chain/core/signing/signing_root.go @@ -59,7 +59,7 @@ func ComputeDomainAndSign(st state.ReadOnlyBeaconState, epoch primitives.Epoch, return ComputeDomainAndSignWithoutState(st.Fork(), epoch, domain, st.GenesisValidatorsRoot(), obj, key) } -// ComputeDomainAndSignWithoutState offers the same functionalit as ComputeDomainAndSign without the need to provide a BeaconState. +// ComputeDomainAndSignWithoutState offers the same functionality as ComputeDomainAndSign without the need to provide a BeaconState. // This is particularly helpful for signing values in tests. func ComputeDomainAndSignWithoutState(fork *ethpb.Fork, epoch primitives.Epoch, domain [4]byte, vr []byte, obj fssz.HashRoot, key bls.SecretKey) ([]byte, error) { // EIP-7044: Beginning in Deneb, fix the fork version to Capella for signed exits. diff --git a/beacon-chain/db/slasherkv/slasher.go b/beacon-chain/db/slasherkv/slasher.go index e840d0a5551f..15c7fcbb23be 100644 --- a/beacon-chain/db/slasherkv/slasher.go +++ b/beacon-chain/db/slasherkv/slasher.go @@ -697,7 +697,7 @@ func decodeSlasherChunk(enc []byte) ([]uint16, error) { } // Encode attestation record to bytes. -// The output encoded attestation record consists in the signing root concatened with the compressed attestation record. +// The output encoded attestation record consists in the signing root concatenated with the compressed attestation record. func encodeAttestationRecord(att *slashertypes.IndexedAttestationWrapper) ([]byte, error) { if att == nil || att.IndexedAttestation == nil { return []byte{}, errors.New("nil proposal record") @@ -716,7 +716,7 @@ func encodeAttestationRecord(att *slashertypes.IndexedAttestationWrapper) ([]byt } // Decode attestation record from bytes. -// The input encoded attestation record consists in the signing root concatened with the compressed attestation record. +// The input encoded attestation record consists in the signing root concatenated with the compressed attestation record. func decodeAttestationRecord(encoded []byte) (*slashertypes.IndexedAttestationWrapper, error) { if len(encoded) < rootSize { return nil, fmt.Errorf("wrong length for encoded attestation record, want minimum %d, got %d", rootSize, len(encoded)) diff --git a/beacon-chain/execution/prometheus_test.go b/beacon-chain/execution/prometheus_test.go index 1a8bde1cd217..83b33f117995 100644 --- a/beacon-chain/execution/prometheus_test.go +++ b/beacon-chain/execution/prometheus_test.go @@ -10,7 +10,7 @@ import ( ) // TestCleanup ensures that the cleanup function unregisters the prometheus.Collection -// also tests the interchangability of the explicit prometheus Register/Unregister +// also tests the interchangeability of the explicit prometheus Register/Unregister // and the implicit methods within the collector implementation func TestCleanup(t *testing.T) { ctx := context.Background() @@ -32,11 +32,11 @@ func TestCleanup(t *testing.T) { assert.Equal(t, true, unregistered, "prometheus.Unregister failed to unregister PowchainCollector on final cleanup") } -// TestCancelation tests that canceling the context passed into +// TestCancellation tests that canceling the context passed into // NewPowchainCollector cleans everything up as expected. This // does come at the cost of an extra channel cluttering up // PowchainCollector, just for this test. -func TestCancelation(t *testing.T) { +func TestCancellation(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) pc, err := NewPowchainCollector(ctx) assert.NoError(t, err, "Unexpected error calling NewPowchainCollector") diff --git a/beacon-chain/p2p/peers/status.go b/beacon-chain/p2p/peers/status.go index 83602a94ce30..7e487fa2a790 100644 --- a/beacon-chain/p2p/peers/status.go +++ b/beacon-chain/p2p/peers/status.go @@ -1,7 +1,7 @@ // Package peers provides information about peers at the Ethereum consensus protocol level. // // "Protocol level" is the level above the network level, so this layer never sees or interacts with -// (for example) hosts that are uncontactable due to being down, firewalled, etc. Instead, this works +// (for example) hosts that are unreachable due to being down, firewalled, etc. Instead, this works // with peers that are contactable but may or may not be of the correct fork version, not currently // required due to the number of current connections, etc. // @@ -59,8 +59,8 @@ const ( ) const ( - // ColocationLimit restricts how many peer identities we can see from a single ip or ipv6 subnet. - ColocationLimit = 5 + // CollocationLimit restricts how many peer identities we can see from a single ip or ipv6 subnet. + CollocationLimit = 5 // Additional buffer beyond current peer limit, from which we can store the relevant peer statuses. maxLimitBuffer = 150 @@ -548,7 +548,7 @@ func (p *Status) Prune() { p.store.Lock() defer p.store.Unlock() - // Default to old method if flag isnt enabled. + // Default to old method if flag isn't enabled. if !features.Get().EnablePeerScorer { p.deprecatedPrune() return @@ -961,7 +961,7 @@ func (p *Status) isfromBadIP(pid peer.ID) bool { return true } if val, ok := p.ipTracker[ip.String()]; ok { - if val > ColocationLimit { + if val > CollocationLimit { return true } } @@ -1012,7 +1012,7 @@ func (p *Status) tallyIPTracker() { } func sameIP(firstAddr, secondAddr ma.Multiaddr) bool { - // Exit early if we do get nil multiaddresses + // Exit early if we do get nil multi-addresses if firstAddr == nil || secondAddr == nil { return false } diff --git a/beacon-chain/p2p/peers/status_test.go b/beacon-chain/p2p/peers/status_test.go index 726ffab024cd..2a19b9644728 100644 --- a/beacon-chain/p2p/peers/status_test.go +++ b/beacon-chain/p2p/peers/status_test.go @@ -565,7 +565,7 @@ func TestPeerIPTracker(t *testing.T) { badIP := "211.227.218.116" var badPeers []peer.ID - for i := 0; i < peers.ColocationLimit+10; i++ { + for i := 0; i < peers.CollocationLimit+10; i++ { port := strconv.Itoa(3000 + i) addr, err := ma.NewMultiaddr("/ip4/" + badIP + "/tcp/" + port) if err != nil { diff --git a/beacon-chain/slasher/chunks.go b/beacon-chain/slasher/chunks.go index 32fc9a858369..c8f2f711bafd 100644 --- a/beacon-chain/slasher/chunks.go +++ b/beacon-chain/slasher/chunks.go @@ -208,8 +208,8 @@ func (m *MinSpanChunksSlice) CheckSlashable( } if existingAttWrapper == nil { - // This case should normally not happen. If this happen, it means we previously - // recorded in our min/max DB an distance corresponding to an attestaiton, but WITHOUT + // This case should normally not happen. If this happens, it means we previously + // recorded in our min/max DB a distance corresponding to an attestation, but WITHOUT // recording the attestation itself. As a consequence, we say there is no surrounding vote, // but we log an error. fields := logrus.Fields{ @@ -287,8 +287,8 @@ func (m *MaxSpanChunksSlice) CheckSlashable( } if existingAttWrapper == nil { - // This case should normally not happen. If this happen, it means we previously - // recorded in our min/max DB an distance corresponding to an attestaiton, but WITHOUT + // This case should normally not happen. If this happens, it means we previously + // recorded in our min/max DB a distance corresponding to an attestation, but WITHOUT // recording the attestation itself. As a consequence, we say there is no surrounded vote, // but we log an error. fields := logrus.Fields{ diff --git a/beacon-chain/slasher/detect_attestations_test.go b/beacon-chain/slasher/detect_attestations_test.go index 067299d13285..7763d205f7c9 100644 --- a/beacon-chain/slasher/detect_attestations_test.go +++ b/beacon-chain/slasher/detect_attestations_test.go @@ -1059,7 +1059,7 @@ func Test_updatedChunkByChunkIndex(t *testing.T) { // Initialize the slasher database. slasherDB := dbtest.SetupSlasherDB(t) - // Intialize the slasher service. + // Initialize the slasher service. service := &Service{ params: &Parameters{ chunkSize: tt.chunkSize, @@ -1502,7 +1502,7 @@ func runAttestationsBenchmark(b *testing.B, s *Service, numAtts, numValidators u func Benchmark_checkSurroundVotes(b *testing.B) { const ( - // Approximatively the number of Holesky active validators on 2024-02-16 + // Approximately the number of Holesky active validators on 2024-02-16 // This number is both a multiple of 32 (the number of slots per epoch) and 256 (the number of validators per chunk) validatorsCount = 1_638_400 slotsPerEpoch = 32 @@ -1526,7 +1526,7 @@ func Benchmark_checkSurroundVotes(b *testing.B) { // So for 1_638_400 validators with 32 slots per epoch, we would have 48_000 attestation wrappers per slot. // With 256 validators per chunk, we would have only 188 modified chunks. // - // In this benchmark, we use the worst case scenario where attestating validators are evenly splitted across all validators chunks. + // In this benchmark, we use the worst case scenario where attesting validators are evenly split across all validators chunks. // We also suppose that only one chunk per validator chunk index is modified. // For one given validator index, multiple chunk indexes could be modified. // diff --git a/beacon-chain/slasher/helpers.go b/beacon-chain/slasher/helpers.go index 26768f3d961e..23c544bbe8f2 100644 --- a/beacon-chain/slasher/helpers.go +++ b/beacon-chain/slasher/helpers.go @@ -79,7 +79,7 @@ func (s *Service) filterAttestations( continue } - // If an attestations's target epoch is in the future, we defer processing for later. + // If an attestation's target epoch is in the future, we defer processing for later. if attWrapper.IndexedAttestation.Data.Target.Epoch > currentEpoch { validInFuture = append(validInFuture, attWrapper) continue diff --git a/beacon-chain/sync/pending_blocks_queue_test.go b/beacon-chain/sync/pending_blocks_queue_test.go index 6266c977498f..e986d20dda86 100644 --- a/beacon-chain/sync/pending_blocks_queue_test.go +++ b/beacon-chain/sync/pending_blocks_queue_test.go @@ -646,7 +646,7 @@ func TestService_BatchRootRequest(t *testing.T) { b4Root, err := b4.Block.HashTreeRoot() require.NoError(t, err) - // Send in duplicated roots to also test deduplicaton. + // Send in duplicated roots to also test deduplication. sentRoots := p2ptypes.BeaconBlockByRootsReq{b2Root, b2Root, b3Root, b3Root, b4Root, b5Root} expectedRoots := p2ptypes.BeaconBlockByRootsReq{b2Root, b3Root, b4Root, b5Root} diff --git a/beacon-chain/sync/service_test.go b/beacon-chain/sync/service_test.go index 0970f1fa46ce..637e3cea0f46 100644 --- a/beacon-chain/sync/service_test.go +++ b/beacon-chain/sync/service_test.go @@ -219,7 +219,7 @@ func TestSyncService_StopCleanly(t *testing.T) { require.NotEqual(t, 0, len(r.cfg.p2p.PubSub().GetTopics())) require.NotEqual(t, 0, len(r.cfg.p2p.Host().Mux().Protocols())) - // Both pubsub and rpc topcis should be unsubscribed. + // Both pubsub and rpc topics should be unsubscribed. require.NoError(t, r.Stop()) // Sleep to allow pubsub topics to be deregistered. diff --git a/beacon-chain/verification/blob.go b/beacon-chain/verification/blob.go index f90dc5245e74..916ddff3bc31 100644 --- a/beacon-chain/verification/blob.go +++ b/beacon-chain/verification/blob.go @@ -126,7 +126,7 @@ func (bv *ROBlobVerifier) VerifiedROBlob() (blocks.VerifiedROBlob, error) { // For example, when batch syncing, forkchoice is only updated at the end of the batch. So the checks that use // forkchoice, like descends from finalized or parent seen, would necessarily fail. Allowing the caller to // assert the requirement has been satisfied ensures we have an easy way to audit which piece of code is satisfying -// a requireent outside of this package. +// a requirement outside of this package. func (bv *ROBlobVerifier) SatisfyRequirement(req Requirement) { bv.recordResult(req, nil) } diff --git a/cmd/beacon-chain/sync/backfill/flags/flags.go b/cmd/beacon-chain/sync/backfill/flags/flags.go index bf56f54123fe..fb89dc2054e8 100644 --- a/cmd/beacon-chain/sync/backfill/flags/flags.go +++ b/cmd/beacon-chain/sync/backfill/flags/flags.go @@ -9,7 +9,7 @@ var ( backfillWorkerCountName = "backfill-worker-count" // EnableExperimentalBackfill enables backfill for checkpoint synced nodes. - // This flag will be removed onced backfill is enabled by default. + // This flag will be removed once backfill is enabled by default. EnableExperimentalBackfill = &cli.BoolFlag{ Name: "enable-experimental-backfill", Usage: "Backfill is still experimental at this time. " + diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index 94e84b9635f1..554d5eab8803 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -312,7 +312,7 @@ var ( Usage: "(Work in progress): Enables the web portal for the validator client.", Value: false, } - // SlashingProtectionExportDirFlag allows specifying the outpt directory + // SlashingProtectionExportDirFlag allows specifying the output directory // for a validator's slashing protection history. SlashingProtectionExportDirFlag = &cli.StringFlag{ Name: "slashing-protection-export-dir", diff --git a/config/proposer/settings.go b/config/proposer/settings.go index 88338eca7dbe..eea44066c973 100644 --- a/config/proposer/settings.go +++ b/config/proposer/settings.go @@ -108,7 +108,7 @@ type Settings struct { DefaultConfig *Option } -// ShouldBeSaved goes through checks to see if the value should be saveable +// ShouldBeSaved goes through checks to see if the value should be savable // Pseudocode: conditions for being saved into the database // 1. settings are not nil // 2. proposeconfig is not nil (this defines specific settings for each validator key), default config can be nil in this case and fall back to beacon node settings diff --git a/container/doubly-linked-list/list.go b/container/doubly-linked-list/list.go index e45414366462..07c2bfb23e2e 100644 --- a/container/doubly-linked-list/list.go +++ b/container/doubly-linked-list/list.go @@ -24,7 +24,7 @@ type Node[T any] struct { next *Node[T] } -// Copy returns a copy of the origina list. +// Copy returns a copy of the original list. func (l *List[T]) Copy() *List[T] { if l == nil { return nil diff --git a/encoding/ssz/equality/deep_equal.go b/encoding/ssz/equality/deep_equal.go index 5175cc7a6b18..3a5db35151b0 100644 --- a/encoding/ssz/equality/deep_equal.go +++ b/encoding/ssz/equality/deep_equal.go @@ -10,7 +10,7 @@ import ( // During deepValueEqual, must keep track of checks that are // in progress. The comparison algorithm assumes that all -// checks in progress are true when it reencounters them. +// checks in progress are true when it re-encounters them. // Visited comparisons are stored in a map indexed by visit. type visit struct { a1 unsafe.Pointer // #nosec G103 -- Test use only @@ -27,7 +27,7 @@ type visit struct { // intricacies when determining equality of empty values. // // Tests for deep equality using reflected types. The map argument tracks -// comparisons that have already been seen, which allows short circuiting on +// comparisons that have already been seen, which allows short-circuiting on // recursive types. func deepValueEqual(v1, v2 reflect.Value, visited map[visit]bool, depth int) bool { if !v1.IsValid() || !v2.IsValid() { @@ -273,7 +273,7 @@ func deepValueBaseTypeEqual(v1, v2 reflect.Value) bool { // In general DeepEqual is a recursive relaxation of Go's == operator. // However, this idea is impossible to implement without some inconsistency. // Specifically, it is possible for a value to be unequal to itself, -// either because it is of func type (uncomparable in general) +// either because it is of func type (incomparable in general) // or because it is a floating-point NaN value (not equal to itself in floating-point comparison), // or because it is an array, struct, or interface containing // such a value. diff --git a/hack/codecov.sh b/hack/codecov.sh index a5a6b1eaeb9e..f3ce175cc56b 100644 --- a/hack/codecov.sh +++ b/hack/codecov.sh @@ -1133,7 +1133,7 @@ fi if [ "$ft_search" = "1" ]; then - # detect bower comoponents location + # detect bower components location bower_components="bower_components" bower_rc=$(cd "$git_root" && cat .bowerrc 2>/dev/null || echo "") if [ "$bower_rc" != "" ]; diff --git a/monitoring/clientstats/types.go b/monitoring/clientstats/types.go index d89e30b78d8d..d31d4f2d9415 100644 --- a/monitoring/clientstats/types.go +++ b/monitoring/clientstats/types.go @@ -20,7 +20,7 @@ type APIMessage struct { // CommonStats represent generic metrics that are expected on both // beaconnode and validator metric types. This type is used for -// marshaling metrics to the POST body sent to the metrics collcetor. +// marshaling metrics to the POST body sent to the metrics collector. // Note that some metrics are labeled NA because they are expected // to be present with their zero-value when not supported by a client. type CommonStats struct { @@ -42,7 +42,7 @@ type CommonStats struct { // BeaconNodeStats embeds CommonStats and represents metrics specific to // the beacon-node process. This type is used to marshal metrics data -// to the POST body sent to the metrics collcetor. To make the connection +// to the POST body sent to the metrics collector. To make the connection // to client-stats clear, BeaconNodeStats is also used by prometheus // collection code introduced to support client-stats. // Note that some metrics are labeled NA because they are expected @@ -66,7 +66,7 @@ type BeaconNodeStats struct { // ValidatorStats embeds CommonStats and represents metrics specific to // the validator process. This type is used to marshal metrics data -// to the POST body sent to the metrics collcetor. +// to the POST body sent to the metrics collector. // Note that some metrics are labeled NA because they are expected // to be present with their zero-value when not supported by a client. type ValidatorStats struct { diff --git a/testing/endtoend/evaluators/fee_recipient.go b/testing/endtoend/evaluators/fee_recipient.go index 29bd2277face..e3ac24a931db 100644 --- a/testing/endtoend/evaluators/fee_recipient.go +++ b/testing/endtoend/evaluators/fee_recipient.go @@ -127,7 +127,7 @@ func feeRecipientIsPresent(_ *types.EvaluationContext, conns ...*grpc.ClientConn // In e2e we generate deterministic keys by validator index, and then use a slice of their public key bytes // as the fee recipient, so that this will also be deterministic, so this test can statelessly verify it. // These should be the only keys we see. - // Otherwise something has changed in e2e and this test needs to be updated. + // Otherwise, something has changed in e2e and this test needs to be updated. _, knownKey := valkeys[pk] if !knownKey { log.WithField("pubkey", pk). diff --git a/testing/endtoend/evaluators/operations.go b/testing/endtoend/evaluators/operations.go index ce173e0da024..2dd93a3c285b 100644 --- a/testing/endtoend/evaluators/operations.go +++ b/testing/endtoend/evaluators/operations.go @@ -245,7 +245,7 @@ func activatesDepositedValidators(ec *e2etypes.EvaluationContext, conns ...*grpc } } - // Make sure every post-genesis deposit has been proecssed, resulting in a validator. + // Make sure every post-genesis deposit has been processed, resulting in a validator. if len(expected) > 0 { return fmt.Errorf("missing %d validators for post-genesis deposits", len(expected)) } diff --git a/testing/endtoend/evaluators/slashing_helper.go b/testing/endtoend/evaluators/slashing_helper.go index 4a024a8c540e..f37a7854a13b 100644 --- a/testing/endtoend/evaluators/slashing_helper.go +++ b/testing/endtoend/evaluators/slashing_helper.go @@ -27,7 +27,7 @@ type doubleAttestationHelper struct { committee []primitives.ValidatorIndex } -// Initializes helper with details needed to make a double attestation for testint purposes +// Initializes helper with details needed to make a double attestation for testing purposes // Populates the committee of that is responsible for the func (h *doubleAttestationHelper) setup(ctx context.Context) error { chainHead, err := h.beaconClient.GetChainHead(ctx, &emptypb.Empty{}) diff --git a/testing/util/capella_block.go b/testing/util/capella_block.go index e27ef6af52a8..0002fce546f3 100644 --- a/testing/util/capella_block.go +++ b/testing/util/capella_block.go @@ -208,7 +208,7 @@ func GenerateFullBlockCapella( return ðpb.SignedBeaconBlockCapella{Block: block, Signature: signature.Marshal()}, nil } -// GenerateBLSToExecutionChange generates a valid bls to exec changae for validator `val` and its private key `priv` with the given beacon state `st`. +// GenerateBLSToExecutionChange generates a valid bls to exec change for validator `val` and its private key `priv` with the given beacon state `st`. func GenerateBLSToExecutionChange(st state.BeaconState, priv bls.SecretKey, val primitives.ValidatorIndex) (*ethpb.SignedBLSToExecutionChange, error) { cred := indexToHash(uint64(val)) pubkey := priv.PublicKey().Marshal() diff --git a/time/slots/slottime.go b/time/slots/slottime.go index c0b535652f80..03c857bdac36 100644 --- a/time/slots/slottime.go +++ b/time/slots/slottime.go @@ -260,7 +260,7 @@ func SyncCommitteePeriodStartEpoch(e primitives.Epoch) (primitives.Epoch, error) return primitives.Epoch(startEpoch), nil } -// SecondsSinceSlotStart returns the number of seconds transcurred since the +// SecondsSinceSlotStart returns the number of seconds elapsed since the // given slot start time func SecondsSinceSlotStart(s primitives.Slot, genesisTime, timeStamp uint64) (uint64, error) { if timeStamp < genesisTime+uint64(s)*params.BeaconConfig().SecondsPerSlot { diff --git a/validator/accounts/wallet_recover.go b/validator/accounts/wallet_recover.go index 12cdf8306dcb..78716123ce7b 100644 --- a/validator/accounts/wallet_recover.go +++ b/validator/accounts/wallet_recover.go @@ -19,7 +19,7 @@ var ( ErrEmptyMnemonic = errors.New("phrase cannot be empty") ) -// WalletRecover uses a menmonic seed phrase to recover a wallet into the path provided. +// WalletRecover uses a mnemonic seed phrase to recover a wallet into the path provided. func (acm *CLIManager) WalletRecover(ctx context.Context) (*wallet.Wallet, error) { // Ensure that the wallet directory does not contain a wallet already dirExists, err := wallet.Exists(acm.walletDir) diff --git a/validator/client/beacon-api/doppelganger_test.go b/validator/client/beacon-api/doppelganger_test.go index a433007dac74..5db65329dcfe 100644 --- a/validator/client/beacon-api/doppelganger_test.go +++ b/validator/client/beacon-api/doppelganger_test.go @@ -228,7 +228,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { {Index: "22222", Validator: &structs.Validator{Pubkey: stringPubKey2}}, // not recent - duplicate on previous epoch {Index: "33333", Validator: &structs.Validator{Pubkey: stringPubKey3}}, // not recent - duplicate on current epoch {Index: "44444", Validator: &structs.Validator{Pubkey: stringPubKey4}}, // not recent - duplicate on both previous and current epoch - // No "55555" sicee corresponding validator does not exist + // No "55555" since corresponding validator does not exist {Index: "66666", Validator: &structs.Validator{Pubkey: stringPubKey6}}, // not recent - not duplicate }, }, diff --git a/validator/db/convert_test.go b/validator/db/convert_test.go index 012491f18427..4718891daf92 100644 --- a/validator/db/convert_test.go +++ b/validator/db/convert_test.go @@ -59,7 +59,7 @@ func TestDB_ConvertDatabase(t *testing.T) { signingRootBytes = signingRoot[:] } - // Create database directoriy path. + // Create database directory path. datadir := t.TempDir() // Run source DB preparation. diff --git a/validator/testing/protection_history.go b/validator/testing/protection_history.go index f538c916c641..06a02ecaff40 100644 --- a/validator/testing/protection_history.go +++ b/validator/testing/protection_history.go @@ -60,7 +60,7 @@ func MockAttestingAndProposalHistories(pubkeys [][fieldparams.BLSPubkeyLength]by gen := rand.NewGenerator() for v := 0; v < numValidators; v++ { latestTarget := primitives.Epoch(gen.Intn(int(params.BeaconConfig().WeakSubjectivityPeriod) / 1000)) - // If 0, we change the value to 1 as the we compute source by doing (target-1) + // If 0, we change the value to 1 as we compute source by doing (target-1) // to prevent any underflows in this setup helper. if latestTarget == 0 { latestTarget = 1 From 53fdd2d0623d8d7a89b70b82076630ab20454199 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:19:51 -0500 Subject: [PATCH 019/325] allow other pkgs to check for blobs in pruning cache (#13788) * allow other pkgs to check for blobs in pruning cache * address deepsource complaints * custom error to simplify test setup * add AllAvailable method * make storage summary slot field private * unit test and off-by-one fix * remove comment with copy of tested function --------- Co-authored-by: Kasey Kirkham --- beacon-chain/db/filesystem/BUILD.bazel | 2 + beacon-chain/db/filesystem/blob.go | 20 ++- beacon-chain/db/filesystem/cache.go | 119 +++++++++++++++++ beacon-chain/db/filesystem/cache_test.go | 150 ++++++++++++++++++++++ beacon-chain/db/filesystem/pruner.go | 103 ++++----------- beacon-chain/db/filesystem/pruner_test.go | 29 ++--- 6 files changed, 329 insertions(+), 94 deletions(-) create mode 100644 beacon-chain/db/filesystem/cache.go create mode 100644 beacon-chain/db/filesystem/cache_test.go diff --git a/beacon-chain/db/filesystem/BUILD.bazel b/beacon-chain/db/filesystem/BUILD.bazel index 49fbef671176..406857686be8 100644 --- a/beacon-chain/db/filesystem/BUILD.bazel +++ b/beacon-chain/db/filesystem/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "blob.go", + "cache.go", "ephemeral.go", "log.go", "metrics.go", @@ -33,6 +34,7 @@ go_test( name = "go_default_test", srcs = [ "blob_test.go", + "cache_test.go", "pruner_test.go", ], embed = [":go_default_library"], diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index d34f36b08215..3da9a01ab91b 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -1,6 +1,7 @@ package filesystem import ( + "context" "fmt" "os" "path" @@ -103,12 +104,29 @@ func (bs *BlobStorage) WarmCache() { return } go func() { - if err := bs.pruner.prune(0); err != nil { + start := time.Now() + if err := bs.pruner.warmCache(); err != nil { log.WithError(err).Error("Error encountered while warming up blob pruner cache") } + log.WithField("elapsed", time.Since(start)).Info("Blob filesystem cache warm-up complete.") }() } +// ErrBlobStorageSummarizerUnavailable is a sentinel error returned when there is no pruner/cache available. +// This should be used by code that optionally uses the summarizer to optimize rpc requests. Being able to +// fallback when there is no summarizer allows client code to avoid test complexity where the summarizer doesn't matter. +var ErrBlobStorageSummarizerUnavailable = errors.New("BlobStorage not initialized with a pruner or cache") + +// WaitForSummarizer blocks until the BlobStorageSummarizer is ready to use. +// BlobStorageSummarizer is not ready immediately on node startup because it needs to sample the blob filesystem to +// determine which blobs are available. +func (bs *BlobStorage) WaitForSummarizer(ctx context.Context) (BlobStorageSummarizer, error) { + if bs.pruner == nil { + return nil, ErrBlobStorageSummarizerUnavailable + } + return bs.pruner.waitForCache(ctx) +} + // Save saves blobs given a list of sidecars. func (bs *BlobStorage) Save(sidecar blocks.VerifiedROBlob) error { startTime := time.Now() diff --git a/beacon-chain/db/filesystem/cache.go b/beacon-chain/db/filesystem/cache.go new file mode 100644 index 000000000000..81de01551514 --- /dev/null +++ b/beacon-chain/db/filesystem/cache.go @@ -0,0 +1,119 @@ +package filesystem + +import ( + "sync" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) + +// blobIndexMask is a bitmask representing the set of blob indices that are currently set. +type blobIndexMask [fieldparams.MaxBlobsPerBlock]bool + +// BlobStorageSummary represents cached information about the BlobSidecars on disk for each root the cache knows about. +type BlobStorageSummary struct { + slot primitives.Slot + mask blobIndexMask +} + +// HasIndex returns true if the BlobSidecar at the given index is available in the filesystem. +func (s BlobStorageSummary) HasIndex(idx uint64) bool { + // Protect from panic, but assume callers are sophisticated enough to not need an error telling them they have an invalid idx. + if idx >= fieldparams.MaxBlobsPerBlock { + return false + } + return s.mask[idx] +} + +// AllAvailable returns true if we have all blobs for all indices from 0 to count-1. +func (s BlobStorageSummary) AllAvailable(count int) bool { + if count > fieldparams.MaxBlobsPerBlock { + return false + } + for i := 0; i < count; i++ { + if !s.mask[i] { + return false + } + } + return true +} + +// BlobStorageSummarizer can be used to receive a summary of metadata about blobs on disk for a given root. +// The BlobStorageSummary can be used to check which indices (if any) are available for a given block by root. +type BlobStorageSummarizer interface { + Summary(root [32]byte) BlobStorageSummary +} + +type blobStorageCache struct { + mu sync.RWMutex + nBlobs float64 + cache map[string]BlobStorageSummary +} + +var _ BlobStorageSummarizer = &blobStorageCache{} + +func newBlobStorageCache() *blobStorageCache { + return &blobStorageCache{ + cache: make(map[string]BlobStorageSummary, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest*fieldparams.SlotsPerEpoch), + } +} + +// Summary returns the BlobStorageSummary for `root`. The BlobStorageSummary can be used to check for the presence of +// BlobSidecars based on Index. +func (s *blobStorageCache) Summary(root [32]byte) BlobStorageSummary { + k := rootString(root) + s.mu.RLock() + defer s.mu.RUnlock() + return s.cache[k] +} + +func (s *blobStorageCache) ensure(key string, slot primitives.Slot, idx uint64) error { + if idx >= fieldparams.MaxBlobsPerBlock { + return errIndexOutOfBounds + } + s.mu.Lock() + defer s.mu.Unlock() + v := s.cache[key] + v.slot = slot + if !v.mask[idx] { + s.updateMetrics(1) + } + v.mask[idx] = true + s.cache[key] = v + return nil +} + +func (s *blobStorageCache) slot(key string) (primitives.Slot, bool) { + s.mu.RLock() + defer s.mu.RUnlock() + v, ok := s.cache[key] + if !ok { + return 0, false + } + return v.slot, ok +} + +func (s *blobStorageCache) evict(key string) { + var deleted float64 + s.mu.Lock() + v, ok := s.cache[key] + if ok { + for i := range v.mask { + if v.mask[i] { + deleted += 1 + } + } + } + delete(s.cache, key) + s.mu.Unlock() + if deleted > 0 { + s.updateMetrics(-deleted) + } +} + +func (s *blobStorageCache) updateMetrics(delta float64) { + s.nBlobs += delta + blobDiskCount.Set(s.nBlobs) + blobDiskSize.Set(s.nBlobs * bytesPerSidecar) +} diff --git a/beacon-chain/db/filesystem/cache_test.go b/beacon-chain/db/filesystem/cache_test.go new file mode 100644 index 000000000000..80c214006e23 --- /dev/null +++ b/beacon-chain/db/filesystem/cache_test.go @@ -0,0 +1,150 @@ +package filesystem + +import ( + "testing" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestSlotByRoot_Summary(t *testing.T) { + var noneSet, allSet, firstSet, lastSet, oneSet blobIndexMask + firstSet[0] = true + lastSet[len(lastSet)-1] = true + oneSet[1] = true + for i := range allSet { + allSet[i] = true + } + cases := []struct { + name string + root [32]byte + expected *blobIndexMask + }{ + { + name: "not found", + }, + { + name: "none set", + expected: &noneSet, + }, + { + name: "index 1 set", + expected: &oneSet, + }, + { + name: "all set", + expected: &allSet, + }, + { + name: "first set", + expected: &firstSet, + }, + { + name: "last set", + expected: &lastSet, + }, + } + sc := newBlobStorageCache() + for _, c := range cases { + if c.expected != nil { + key := rootString(bytesutil.ToBytes32([]byte(c.name))) + sc.cache[key] = BlobStorageSummary{slot: 0, mask: *c.expected} + } + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + key := bytesutil.ToBytes32([]byte(c.name)) + sum := sc.Summary(key) + for i := range c.expected { + ui := uint64(i) + if c.expected == nil { + require.Equal(t, false, sum.HasIndex(ui)) + } else { + require.Equal(t, c.expected[i], sum.HasIndex(ui)) + } + } + }) + } +} + +func TestAllAvailable(t *testing.T) { + idxUpTo := func(u int) []int { + r := make([]int, u) + for i := range r { + r[i] = i + } + return r + } + require.DeepEqual(t, []int{}, idxUpTo(0)) + require.DeepEqual(t, []int{0}, idxUpTo(1)) + require.DeepEqual(t, []int{0, 1, 2, 3, 4, 5}, idxUpTo(6)) + cases := []struct { + name string + idxSet []int + count int + aa bool + }{ + { + // If there are no blobs committed, then all the committed blobs are available. + name: "none in idx, 0 arg", + count: 0, + aa: true, + }, + { + name: "none in idx, 1 arg", + count: 1, + aa: false, + }, + { + name: "first in idx, 1 arg", + idxSet: []int{0}, + count: 1, + aa: true, + }, + { + name: "second in idx, 1 arg", + idxSet: []int{1}, + count: 1, + aa: false, + }, + { + name: "first missing, 2 arg", + idxSet: []int{1}, + count: 2, + aa: false, + }, + { + name: "all missing, 1 arg", + count: 6, + aa: false, + }, + { + name: "out of bound is safe", + count: fieldparams.MaxBlobsPerBlock + 1, + aa: false, + }, + { + name: "max present", + count: fieldparams.MaxBlobsPerBlock, + idxSet: idxUpTo(fieldparams.MaxBlobsPerBlock), + aa: true, + }, + { + name: "one present", + count: 1, + idxSet: idxUpTo(1), + aa: true, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + var mask blobIndexMask + for _, idx := range c.idxSet { + mask[idx] = true + } + sum := BlobStorageSummary{mask: mask} + require.Equal(t, c.aa, sum.AllAvailable(c.count)) + }) + } +} diff --git a/beacon-chain/db/filesystem/pruner.go b/beacon-chain/db/filesystem/pruner.go index 2a1dff82165f..cb5a10121b65 100644 --- a/beacon-chain/db/filesystem/pruner.go +++ b/beacon-chain/db/filesystem/pruner.go @@ -1,6 +1,7 @@ package filesystem import ( + "context" "encoding/binary" "io" "path" @@ -12,7 +13,6 @@ import ( "time" "github.com/pkg/errors" - fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -32,7 +32,8 @@ type blobPruner struct { sync.Mutex prunedBefore atomic.Uint64 windowSize primitives.Slot - slotMap *slotForRoot + cache *blobStorageCache + cacheWarmed chan struct{} fs afero.Fs } @@ -41,13 +42,14 @@ func newBlobPruner(fs afero.Fs, retain primitives.Epoch) (*blobPruner, error) { if err != nil { return nil, errors.Wrap(err, "could not set retentionSlots") } - return &blobPruner{fs: fs, windowSize: r, slotMap: newSlotForRoot()}, nil + cw := make(chan struct{}) + return &blobPruner{fs: fs, windowSize: r, cache: newBlobStorageCache(), cacheWarmed: cw}, nil } // notify updates the pruner's view of root->blob mappings. This allows the pruner to build a cache // of root->slot mappings and decide when to evict old blobs based on the age of present blobs. func (p *blobPruner) notify(root [32]byte, latest primitives.Slot, idx uint64) error { - if err := p.slotMap.ensure(rootString(root), latest, idx); err != nil { + if err := p.cache.ensure(rootString(root), latest, idx); err != nil { return err } pruned := uint64(windowMin(latest, p.windowSize)) @@ -62,7 +64,7 @@ func (p *blobPruner) notify(root [32]byte, latest primitives.Slot, idx uint64) e return nil } -func windowMin(latest primitives.Slot, offset primitives.Slot) primitives.Slot { +func windowMin(latest, offset primitives.Slot) primitives.Slot { // Safely compute the first slot in the epoch for the latest slot latest = latest - latest%params.BeaconConfig().SlotsPerEpoch if latest < offset { @@ -71,6 +73,23 @@ func windowMin(latest primitives.Slot, offset primitives.Slot) primitives.Slot { return latest - offset } +func (p *blobPruner) warmCache() error { + if err := p.prune(0); err != nil { + return err + } + close(p.cacheWarmed) + return nil +} + +func (p *blobPruner) waitForCache(ctx context.Context) (*blobStorageCache, error) { + select { + case <-p.cacheWarmed: + return p.cache, nil + case <-ctx.Done(): + return nil, ctx.Err() + } +} + // Prune prunes blobs in the base directory based on the retention epoch. // It deletes blobs older than currentEpoch - (retentionEpochs+bufferEpochs). // This is so that we keep a slight buffer and blobs are deleted after n+2 epochs. @@ -122,7 +141,7 @@ func shouldRetain(slot, pruneBefore primitives.Slot) bool { func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int, error) { root := rootFromDir(dir) - slot, slotCached := p.slotMap.slot(root) + slot, slotCached := p.cache.slot(root) // Return early if the slot is cached and doesn't need pruning. if slotCached && shouldRetain(slot, pruneBefore) { return 0, nil @@ -151,7 +170,7 @@ func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int, if err != nil { return 0, errors.Wrapf(err, "index could not be determined for blob file %s", scFiles[i]) } - if err := p.slotMap.ensure(root, slot, idx); err != nil { + if err := p.cache.ensure(root, slot, idx); err != nil { return 0, errors.Wrapf(err, "could not update prune cache for blob file %s", scFiles[i]) } } @@ -179,7 +198,7 @@ func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int, return removed, errors.Wrapf(err, "unable to remove blob directory %s", dir) } - p.slotMap.evict(rootFromDir(dir)) + p.cache.evict(rootFromDir(dir)) return len(scFiles), nil } @@ -269,71 +288,3 @@ func filterSsz(s string) bool { func filterPart(s string) bool { return filepath.Ext(s) == dotPartExt } - -func newSlotForRoot() *slotForRoot { - return &slotForRoot{ - cache: make(map[string]*slotCacheEntry, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest*fieldparams.SlotsPerEpoch), - } -} - -type slotCacheEntry struct { - slot primitives.Slot - mask [fieldparams.MaxBlobsPerBlock]bool -} - -type slotForRoot struct { - sync.RWMutex - nBlobs float64 - cache map[string]*slotCacheEntry -} - -func (s *slotForRoot) updateMetrics(delta float64) { - s.nBlobs += delta - blobDiskCount.Set(s.nBlobs) - blobDiskSize.Set(s.nBlobs * bytesPerSidecar) -} - -func (s *slotForRoot) ensure(key string, slot primitives.Slot, idx uint64) error { - if idx >= fieldparams.MaxBlobsPerBlock { - return errIndexOutOfBounds - } - s.Lock() - defer s.Unlock() - v, ok := s.cache[key] - if !ok { - v = &slotCacheEntry{} - } - v.slot = slot - if !v.mask[idx] { - s.updateMetrics(1) - } - v.mask[idx] = true - s.cache[key] = v - return nil -} - -func (s *slotForRoot) slot(key string) (primitives.Slot, bool) { - s.RLock() - defer s.RUnlock() - v, ok := s.cache[key] - if !ok { - return 0, false - } - return v.slot, ok -} - -func (s *slotForRoot) evict(key string) { - s.Lock() - defer s.Unlock() - v, ok := s.cache[key] - var deleted float64 - if ok { - for i := range v.mask { - if v.mask[i] { - deleted += 1 - } - } - s.updateMetrics(-deleted) - } - delete(s.cache, key) -} diff --git a/beacon-chain/db/filesystem/pruner_test.go b/beacon-chain/db/filesystem/pruner_test.go index 779e366ca3c3..b089ea8183d0 100644 --- a/beacon-chain/db/filesystem/pruner_test.go +++ b/beacon-chain/db/filesystem/pruner_test.go @@ -28,7 +28,7 @@ func TestTryPruneDir_CachedNotExpired(t *testing.T) { root := fmt.Sprintf("%#x", sc.BlockRoot()) // This slot is right on the edge of what would need to be pruned, so by adding it to the cache and // skipping any other test setup, we can be certain the hot cache path never touches the filesystem. - require.NoError(t, pr.slotMap.ensure(root, sc.Slot(), 0)) + require.NoError(t, pr.cache.ensure(root, sc.Slot(), 0)) pruned, err := pr.tryPruneDir(root, pr.windowSize) require.NoError(t, err) require.Equal(t, 0, pruned) @@ -45,7 +45,7 @@ func TestTryPruneDir_CachedExpired(t *testing.T) { require.NoError(t, err) root := fmt.Sprintf("%#x", sc.BlockRoot()) require.NoError(t, fs.Mkdir(root, directoryPermissions)) // make empty directory - require.NoError(t, pr.slotMap.ensure(root, sc.Slot(), 0)) + require.NoError(t, pr.cache.ensure(root, sc.Slot(), 0)) pruned, err := pr.tryPruneDir(root, slot+1) require.NoError(t, err) require.Equal(t, 0, pruned) @@ -63,7 +63,7 @@ func TestTryPruneDir_CachedExpired(t *testing.T) { // check that the root->slot is cached root := fmt.Sprintf("%#x", scs[0].BlockRoot()) - cs, cok := bs.pruner.slotMap.slot(root) + cs, cok := bs.pruner.cache.slot(root) require.Equal(t, true, cok) require.Equal(t, slot, cs) @@ -95,12 +95,12 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { // check that the root->slot is cached root := fmt.Sprintf("%#x", scs[0].BlockRoot()) - cs, ok := bs.pruner.slotMap.slot(root) + cs, ok := bs.pruner.cache.slot(root) require.Equal(t, true, ok) require.Equal(t, slot, cs) // evict it from the cache so that we trigger the file read path - bs.pruner.slotMap.evict(root) - _, ok = bs.pruner.slotMap.slot(root) + bs.pruner.cache.evict(root) + _, ok = bs.pruner.cache.slot(root) require.Equal(t, false, ok) // ensure that we see the saved files in the filesystem @@ -119,7 +119,7 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { fs, bs, err := NewEphemeralBlobStorageWithFs(t) require.NoError(t, err) // Set slot equal to the window size, so it should be retained. - var slot primitives.Slot = bs.pruner.windowSize + slot := bs.pruner.windowSize _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 2) scs, err := verification.BlobSidecarSliceNoop(sidecars) require.NoError(t, err) @@ -129,8 +129,8 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { // Evict slot mapping from the cache so that we trigger the file read path. root := fmt.Sprintf("%#x", scs[0].BlockRoot()) - bs.pruner.slotMap.evict(root) - _, ok := bs.pruner.slotMap.slot(root) + bs.pruner.cache.evict(root) + _, ok := bs.pruner.cache.slot(root) require.Equal(t, false, ok) // Ensure that we see the saved files in the filesystem. @@ -243,10 +243,8 @@ func TestListDir(t *testing.T) { } blobWithSszAndTmp := dirFiles{name: "0x1234567890", isDir: true, children: []dirFiles{{name: "5.ssz"}, {name: "0.part"}}} - fsLayout.children = append(fsLayout.children, notABlob) - fsLayout.children = append(fsLayout.children, childlessBlob) - fsLayout.children = append(fsLayout.children, blobWithSsz) - fsLayout.children = append(fsLayout.children, blobWithSszAndTmp) + fsLayout.children = append(fsLayout.children, + notABlob, childlessBlob, blobWithSsz, blobWithSszAndTmp) topChildren := make([]string, len(fsLayout.children)) for i := range fsLayout.children { @@ -282,10 +280,7 @@ func TestListDir(t *testing.T) { dirPath: ".", expected: []string{notABlob.name}, filter: func(s string) bool { - if s == notABlob.name { - return true - } - return false + return s == notABlob.name }, }, { From 9df20e616c4dc2b255b0647cfed8fb569137263d Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Tue, 2 Apr 2024 04:04:40 +0800 Subject: [PATCH 020/325] using slices.IndexFunc (#13834) --- async/event/feed.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/async/event/feed.go b/async/event/feed.go index 008f7e25f5cc..46d7f77753c8 100644 --- a/async/event/feed.go +++ b/async/event/feed.go @@ -20,6 +20,7 @@ package event import ( "errors" "reflect" + "slices" "sync" ) @@ -219,12 +220,9 @@ type caseList []reflect.SelectCase // find returns the index of a case containing the given channel. func (cs caseList) find(channel interface{}) int { - for i, cas := range cs { - if cas.Chan.Interface() == channel { - return i - } - } - return -1 + return slices.IndexFunc(cs, func(selectCase reflect.SelectCase) bool { + return selectCase.Chan.Interface() == channel + }) } // delete removes the given case from cs. From 0e1c585f7d5c0b2da930984c71cc4ba818c58714 Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Tue, 2 Apr 2024 05:10:46 +0800 Subject: [PATCH 021/325] using slices.Contains (#13837) --- config/params/loader_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 60e85f66d793..f653f8f28cd4 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -7,6 +7,7 @@ import ( "path" "path/filepath" "reflect" + "slices" "sort" "strings" "testing" @@ -401,10 +402,5 @@ func assertYamlFieldsMatch(t *testing.T, name string, fields []string, c1, c2 *p } func isPlaceholderField(field string) bool { - for _, f := range placeholderFields { - if f == field { - return true - } - } - return false + return slices.Contains(placeholderFields, field) } From a861489a837cd8db41780c9a06cb70c6a1642c40 Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Tue, 2 Apr 2024 05:15:38 +0800 Subject: [PATCH 022/325] using slices.ContainsFunc (#13838) --- cmd/validator/usage_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/validator/usage_test.go b/cmd/validator/usage_test.go index d0ed8531592d..c5bc52c2942f 100644 --- a/cmd/validator/usage_test.go +++ b/cmd/validator/usage_test.go @@ -1,6 +1,7 @@ package main import ( + "slices" "testing" "github.com/prysmaticlabs/prysm/v5/config/features" @@ -34,10 +35,7 @@ func TestAllFlagsExistInHelp(t *testing.T) { } func doesFlagExist(flag cli.Flag, flags []cli.Flag) bool { - for _, f := range flags { - if f.String() == flag.String() { - return true - } - } - return false + return slices.ContainsFunc(flags, func(f cli.Flag) bool { + return f.String() == flag.String() + }) } From 2cc3f69a3fd6f503685655eff9d4c2ce109f556d Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Tue, 2 Apr 2024 05:26:52 +0800 Subject: [PATCH 023/325] using slices.Contains (#13835) --- container/slice/slice.go | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/container/slice/slice.go b/container/slice/slice.go index c39c371d353b..1d6d6a99aa3a 100644 --- a/container/slice/slice.go +++ b/container/slice/slice.go @@ -2,6 +2,7 @@ package slice import ( "fmt" + "slices" "strings" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -140,12 +141,7 @@ func NotUint64(a, b []uint64) []uint64 { // IsInUint64 returns true if a is in b and False otherwise. func IsInUint64(a uint64, b []uint64) bool { - for _, v := range b { - if a == v { - return true - } - } - return false + return slices.Contains(b, a) } // IntersectionInt64 of any number of int64 slices with time @@ -226,12 +222,7 @@ func NotInt64(a, b []int64) []int64 { // IsInInt64 returns true if a is in b and False otherwise. func IsInInt64(a int64, b []int64) bool { - for _, v := range b { - if a == v { - return true - } - } - return false + return slices.Contains(b, a) } // UnionByteSlices returns the all elements between sets of byte slices. @@ -358,12 +349,7 @@ func NotSlot(a, b []primitives.Slot) []primitives.Slot { // IsInSlots returns true if a is in b and False otherwise. func IsInSlots(a primitives.Slot, b []primitives.Slot) bool { - for _, v := range b { - if a == v { - return true - } - } - return false + return slices.Contains(b, a) } // Unique returns an array with duplicates filtered based on the type given From d1084cbe48ee6bf80be0fdd02a802d3caa732d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Wed, 3 Apr 2024 00:32:32 +0900 Subject: [PATCH 024/325] Send correct state root with finalization event (#13842) --- beacon-chain/blockchain/receive_block.go | 15 ++++++-- beacon-chain/blockchain/receive_block_test.go | 37 +++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index bac1c0f4a5c7..dd6cba229b0b 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -170,7 +170,7 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig // Send finalized events and finalized deposits in the background if newFinalized { finalized := s.cfg.ForkChoiceStore.FinalizedCheckpoint() - go s.sendNewFinalizedEvent(blockCopy, postState) + go s.sendNewFinalizedEvent(ctx, postState) depCtx, cancel := context.WithTimeout(context.Background(), depositDeadline) go func() { s.insertFinalizedDeposits(depCtx, finalized.Root) @@ -443,7 +443,7 @@ func (s *Service) updateFinalizationOnBlock(ctx context.Context, preState, postS // sendNewFinalizedEvent sends a new finalization checkpoint event over the // event feed. It needs to be called on the background -func (s *Service) sendNewFinalizedEvent(signed interfaces.ReadOnlySignedBeaconBlock, postState state.BeaconState) { +func (s *Service) sendNewFinalizedEvent(ctx context.Context, postState state.BeaconState) { isValidPayload := false s.headLock.RLock() if s.head != nil { @@ -451,8 +451,17 @@ func (s *Service) sendNewFinalizedEvent(signed interfaces.ReadOnlySignedBeaconBl } s.headLock.RUnlock() + blk, err := s.cfg.BeaconDB.Block(ctx, bytesutil.ToBytes32(postState.FinalizedCheckpoint().Root)) + if err != nil { + log.WithError(err).Error("Could not retrieve block for finalized checkpoint root. Finalized event will not be emitted") + return + } + if blk == nil || blk.IsNil() || blk.Block() == nil || blk.Block().IsNil() { + log.WithError(err).Error("Block retrieved for finalized checkpoint root is nil. Finalized event will not be emitted") + return + } + stateRoot := blk.Block().StateRoot() // Send an event regarding the new finalized checkpoint over a common event feed. - stateRoot := signed.Block().StateRoot() s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ Type: statefeed.FinalizedCheckpoint, Data: ðpbv1.EventFinalizedCheckpoint{ diff --git a/beacon-chain/blockchain/receive_block_test.go b/beacon-chain/blockchain/receive_block_test.go index bc952a531e15..9c065d767506 100644 --- a/beacon-chain/blockchain/receive_block_test.go +++ b/beacon-chain/blockchain/receive_block_test.go @@ -8,12 +8,14 @@ import ( blockchainTesting "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/voluntaryexits" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -378,3 +380,38 @@ func TestHandleBlockBLSToExecutionChanges(t *testing.T) { require.Equal(t, false, pool.ValidatorExists(idx)) }) } + +func Test_sendNewFinalizedEvent(t *testing.T) { + s, _ := minimalTestService(t) + notifier := &blockchainTesting.MockStateNotifier{RecordEvents: true} + s.cfg.StateNotifier = notifier + finalizedSt, err := util.NewBeaconState() + require.NoError(t, err) + finalizedStRoot, err := finalizedSt.HashTreeRoot(s.ctx) + require.NoError(t, err) + b := util.NewBeaconBlock() + b.Block.StateRoot = finalizedStRoot[:] + sbb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + sbbRoot, err := sbb.Block().HashTreeRoot() + require.NoError(t, err) + require.NoError(t, s.cfg.BeaconDB.SaveBlock(s.ctx, sbb)) + st, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, st.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: 123, + Root: sbbRoot[:], + })) + + s.sendNewFinalizedEvent(s.ctx, st) + + require.Equal(t, 1, len(notifier.ReceivedEvents())) + e := notifier.ReceivedEvents()[0] + assert.Equal(t, statefeed.FinalizedCheckpoint, int(e.Type)) + fc, ok := e.Data.(*ethpbv1.EventFinalizedCheckpoint) + require.Equal(t, true, ok, "event has wrong data type") + assert.Equal(t, primitives.Epoch(123), fc.Epoch) + assert.DeepEqual(t, sbbRoot[:], fc.Block) + assert.DeepEqual(t, finalizedStRoot[:], fc.State) + assert.Equal(t, false, fc.ExecutionOptimistic) +} From 7bce1c0714c8280f21af70307d7e0bde7ac227f9 Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Wed, 3 Apr 2024 00:06:27 +0800 Subject: [PATCH 025/325] using slices.IndexFunc (#13839) --- cmd/flags.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/flags.go b/cmd/flags.go index 613db570f755..ccd907a3a99d 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -4,6 +4,7 @@ package cmd import ( "fmt" "math" + "slices" "strings" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -323,10 +324,10 @@ func ValidateNoArgs(ctx *cli.Context) error { // verifies that the provided command is in the command list. func checkCommandList(commands []*cli.Command, name string) *cli.Command { - for _, c := range commands { - if c.Name == name { - return c - } + if i := slices.IndexFunc(commands, func(c *cli.Command) bool { + return c.Name == name + }); i >= 0 { + return commands[i] } return nil } From 0c15a30a34aaa8c04caf66df3a09fc3bd302a024 Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Wed, 3 Apr 2024 00:30:05 +0800 Subject: [PATCH 026/325] using slices.Index (#13836) --- container/multi-value-slice/multi_value_slice.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/container/multi-value-slice/multi_value_slice.go b/container/multi-value-slice/multi_value_slice.go index 81d8009fb692..683ec41f5e55 100644 --- a/container/multi-value-slice/multi_value_slice.go +++ b/container/multi-value-slice/multi_value_slice.go @@ -91,6 +91,7 @@ package mvslice import ( "fmt" + "slices" "sync" "github.com/pkg/errors" @@ -578,10 +579,8 @@ func (s *Slice[V]) updateAppendedItem(obj Identifiable, index uint64, val V) err } func containsId(ids []uint64, wanted uint64) (int, bool) { - for i, id := range ids { - if id == wanted { - return i, true - } + if i := slices.Index(ids, wanted); i >= 0 { + return i, true } return 0, false } From caa8be5dd11de63acdbb015b9b539c3f9798e63a Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 2 Apr 2024 11:12:58 -0700 Subject: [PATCH 027/325] Beacon-api: broadcast blobs in the event of seen block (#13830) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Beacon-api: broadcast blobs in the event of seen block * Fix parameters * Fix test * Check forkchoice * Ran go format * Revert "Ran go format" This reverts commit 091e77e81d6e2b9861fecc27c0bad1898033f9a3. * James feedback * Radek's feedback Co-authored-by: Radosław Kapka * Fix bad tests --------- Co-authored-by: Radosław Kapka --- beacon-chain/rpc/eth/beacon/BUILD.bazel | 2 + beacon-chain/rpc/eth/beacon/handlers.go | 61 ++++++++++++++++++- beacon-chain/rpc/eth/beacon/handlers_test.go | 30 ++++++++- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../v1alpha1/validator/proposer_deneb.go | 4 +- .../v1alpha1/validator/proposer_deneb_test.go | 2 +- 6 files changed, 94 insertions(+), 7 deletions(-) diff --git a/beacon-chain/rpc/eth/beacon/BUILD.bazel b/beacon-chain/rpc/eth/beacon/BUILD.bazel index 71b7c541bb74..11ded5c96335 100644 --- a/beacon-chain/rpc/eth/beacon/BUILD.bazel +++ b/beacon-chain/rpc/eth/beacon/BUILD.bazel @@ -37,6 +37,7 @@ go_library( "//beacon-chain/rpc/eth/helpers:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", + "//beacon-chain/rpc/prysm/v1alpha1/validator:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//beacon-chain/state/stategen:go_default_library", @@ -121,6 +122,7 @@ go_test( "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", + "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_stretchr_testify//mock:go_default_library", "@org_uber_go_mock//gomock:go_default_library", ], diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index f82c9e5a4c55..03567b8be205 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -21,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/prysm/v1alpha1/validator" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" @@ -32,6 +33,7 @@ import ( eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -42,7 +44,8 @@ const ( ) var ( - errNilBlock = errors.New("nil block") + errNilBlock = errors.New("nil block") + errEquivocatedBlock = errors.New("block is equivocated") ) type handled bool @@ -1254,6 +1257,16 @@ func (s *Server) publishBlockSSZ(ctx context.Context, w http.ResponseWriter, r * }, } if err = s.validateBroadcast(ctx, r, genericBlock); err != nil { + if errors.Is(err, errEquivocatedBlock) { + b, err := blocks.NewSignedBeaconBlock(genericBlock) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + if err := s.broadcastSeenBlockSidecars(ctx, b, genericBlock.GetDeneb().Blobs, genericBlock.GetDeneb().KzgProofs); err != nil { + log.WithError(err).Error("Failed to broadcast blob sidecars") + } + } httputil.HandleError(w, err.Error(), http.StatusBadRequest) return } @@ -1383,6 +1396,16 @@ func (s *Server) publishBlock(ctx context.Context, w http.ResponseWriter, r *htt consensusBlock, err = denebBlockContents.ToGeneric() if err == nil { if err = s.validateBroadcast(ctx, r, consensusBlock); err != nil { + if errors.Is(err, errEquivocatedBlock) { + b, err := blocks.NewSignedBeaconBlock(consensusBlock) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + if err := s.broadcastSeenBlockSidecars(ctx, b, consensusBlock.GetDeneb().Blobs, consensusBlock.GetDeneb().KzgProofs); err != nil { + log.WithError(err).Error("Failed to broadcast blob sidecars") + } + } httputil.HandleError(w, err.Error(), http.StatusBadRequest) return } @@ -1547,7 +1570,7 @@ func (s *Server) validateConsensus(ctx context.Context, blk interfaces.ReadOnlyS func (s *Server) validateEquivocation(blk interfaces.ReadOnlyBeaconBlock) error { if s.ForkchoiceFetcher.HighestReceivedBlockSlot() == blk.Slot() { - return fmt.Errorf("block for slot %d already exists in fork choice", blk.Slot()) + return errors.Wrapf(errEquivocatedBlock, "block for slot %d already exists in fork choice", blk.Slot()) } return nil } @@ -2072,3 +2095,37 @@ func (s *Server) GetDepositSnapshot(w http.ResponseWriter, r *http.Request) { }, ) } + +// Broadcast blob sidecars even if the block of the same slot has been imported. +// To ensure safety, we will only broadcast blob sidecars if the header references the same block that was previously seen. +// Otherwise, a proposer could get slashed through a different blob sidecar header reference. +func (s *Server) broadcastSeenBlockSidecars( + ctx context.Context, + b interfaces.SignedBeaconBlock, + blobs [][]byte, + kzgProofs [][]byte) error { + scs, err := validator.BuildBlobSidecars(b, blobs, kzgProofs) + if err != nil { + return err + } + for _, sc := range scs { + r, err := sc.SignedBlockHeader.Header.HashTreeRoot() + if err != nil { + log.WithError(err).Error("Failed to hash block header for blob sidecar") + continue + } + if !s.FinalizationFetcher.InForkchoice(r) { + log.WithField("root", fmt.Sprintf("%#x", r)).Debug("Block header not in forkchoice, skipping blob sidecar broadcast") + continue + } + if err := s.Broadcaster.BroadcastBlob(ctx, sc.Index, sc); err != nil { + log.WithError(err).Error("Failed to broadcast blob sidecar for index ", sc.Index) + } + log.WithFields(logrus.Fields{ + "index": sc.Index, + "slot": sc.SignedBlockHeader.Header.Slot, + "kzgCommitment": fmt.Sprintf("%#x", sc.KzgCommitment), + }).Info("Broadcasted blob sidecar for already seen block") + } + return nil +} diff --git a/beacon-chain/rpc/eth/beacon/handlers_test.go b/beacon-chain/rpc/eth/beacon/handlers_test.go index 13143b9dc7fc..f984fce36bcd 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_test.go @@ -13,6 +13,8 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" + mockp2p "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" + logTest "github.com/sirupsen/logrus/hooks/test" "go.uber.org/mock/gomock" "github.com/gorilla/mux" @@ -2472,7 +2474,9 @@ func TestValidateEquivocation(t *testing.T) { require.NoError(t, err) blk.SetSlot(st.Slot()) - assert.ErrorContains(t, "already exists", server.validateEquivocation(blk.Block())) + err = server.validateEquivocation(blk.Block()) + assert.ErrorContains(t, "already exists", err) + require.ErrorIs(t, err, errEquivocatedBlock) }) } @@ -3630,3 +3634,27 @@ func TestGetDepositSnapshot(t *testing.T) { assert.Equal(t, finalized, len(resp.Finalized)) }) } + +func TestServer_broadcastBlobSidecars(t *testing.T) { + hook := logTest.NewGlobal() + blockToPropose := util.NewBeaconBlockContentsDeneb() + blockToPropose.Blobs = [][]byte{{0x01}, {0x02}, {0x03}} + blockToPropose.KzgProofs = [][]byte{{0x01}, {0x02}, {0x03}} + blockToPropose.Block.Block.Body.BlobKzgCommitments = [][]byte{bytesutil.PadTo([]byte("kc"), 48), bytesutil.PadTo([]byte("kc1"), 48), bytesutil.PadTo([]byte("kc2"), 48)} + d := ð.GenericSignedBeaconBlock_Deneb{Deneb: blockToPropose} + b := ð.GenericSignedBeaconBlock{Block: d} + + server := &Server{ + Broadcaster: &mockp2p.MockBroadcaster{}, + FinalizationFetcher: &chainMock.ChainService{NotFinalized: true}, + } + + blk, err := blocks.NewSignedBeaconBlock(b.Block) + require.NoError(t, err) + require.NoError(t, server.broadcastSeenBlockSidecars(context.Background(), blk, b.GetDeneb().Blobs, b.GetDeneb().KzgProofs)) + require.LogsDoNotContain(t, hook, "Broadcasted blob sidecar for already seen block") + + server.FinalizationFetcher = &chainMock.ChainService{NotFinalized: false} + require.NoError(t, server.broadcastSeenBlockSidecars(context.Background(), blk, b.GetDeneb().Blobs, b.GetDeneb().KzgProofs)) + require.LogsContain(t, hook, "Broadcasted blob sidecar for already seen block") +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index f354f14e5c20..b4b5156d5549 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -341,7 +341,7 @@ func (vs *Server) handleUnblindedBlock(block interfaces.SignedBeaconBlock, req * if dbBlockContents == nil { return nil, nil } - return buildBlobSidecars(block, dbBlockContents.Blobs, dbBlockContents.KzgProofs) + return BuildBlobSidecars(block, dbBlockContents.Blobs, dbBlockContents.KzgProofs) } // broadcastReceiveBlock broadcasts a block and handles its reception. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go index 66c3781d665e..ca052e431ea3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go @@ -56,8 +56,8 @@ func (c *blobsBundleCache) prune(minSlot primitives.Slot) { } } -// buildBlobSidecars given a block, builds the blob sidecars for the block. -func buildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProofs [][]byte) ([]*ethpb.BlobSidecar, error) { +// BuildBlobSidecars given a block, builds the blob sidecars for the block. +func BuildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProofs [][]byte) ([]*ethpb.BlobSidecar, error) { if blk.Version() < version.Deneb { return nil, nil // No blobs before deneb. } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go index 499fd9b7227a..dd191d1d7dfc 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go @@ -51,7 +51,7 @@ func TestServer_buildBlobSidecars(t *testing.T) { require.NoError(t, blk.SetBlobKzgCommitments(kzgCommitments)) proof, err := hexutil.Decode("0xb4021b0de10f743893d4f71e1bf830c019e832958efd6795baf2f83b8699a9eccc5dc99015d8d4d8ec370d0cc333c06a") require.NoError(t, err) - scs, err := buildBlobSidecars(blk, [][]byte{ + scs, err := BuildBlobSidecars(blk, [][]byte{ make([]byte, fieldparams.BlobLength), make([]byte, fieldparams.BlobLength), }, [][]byte{ proof, proof, From f7912e7c201b9a02b892ca9bbc6c7e301f499fc1 Mon Sep 17 00:00:00 2001 From: redistay <165581775+redistay@users.noreply.github.com> Date: Wed, 3 Apr 2024 06:19:15 +0800 Subject: [PATCH 028/325] chore: fix some comments (#13843) Signed-off-by: redistay --- beacon-chain/blockchain/head_sync_committee_info_test.go | 2 +- beacon-chain/slasher/doc.go | 2 +- beacon-chain/sync/initial-sync/blocks_fetcher.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/blockchain/head_sync_committee_info_test.go b/beacon-chain/blockchain/head_sync_committee_info_test.go index c4b06058b2f2..c44793341e62 100644 --- a/beacon-chain/blockchain/head_sync_committee_info_test.go +++ b/beacon-chain/blockchain/head_sync_committee_info_test.go @@ -61,7 +61,7 @@ func TestService_headNextSyncCommitteeIndices(t *testing.T) { indices, err := c.headNextSyncCommitteeIndices(context.Background(), 0, primitives.Slot(slot)) require.NoError(t, err) - // NextSyncCommittee should be be empty after `ProcessSyncCommitteeUpdates`. Validator should get indices. + // NextSyncCommittee should be empty after `ProcessSyncCommitteeUpdates`. Validator should get indices. require.NotEqual(t, 0, len(indices)) } diff --git a/beacon-chain/slasher/doc.go b/beacon-chain/slasher/doc.go index e2a71f15f0fc..46efb460b2af 100644 --- a/beacon-chain/slasher/doc.go +++ b/beacon-chain/slasher/doc.go @@ -135,7 +135,7 @@ With 1_048_576 validators, we need 4096 * 2MB = 8GB Storing both MIN and MAX spans for 1_048_576 validators takes 16GB. Each chunk is stored snappy-compressed in the database. -If all validators attest ideally, a MIN SPAN chunk will contain only `2`s, and and MAX SPAN chunk will contain only `0`s. +If all validators attest ideally, a MIN SPAN chunk will contain only `2`s, and MAX SPAN chunk will contain only `0`s. This will compress very well, and will let us store a lot of data in a small amount of space. */ diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher.go b/beacon-chain/sync/initial-sync/blocks_fetcher.go index 429fa833ec3d..13bb09e2ce28 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher.go @@ -236,7 +236,7 @@ func (f *blocksFetcher) loop() { // Main loop. for { - // Make sure there is are available peers before processing requests. + // Make sure there are available peers before processing requests. if _, err := f.waitForMinimumPeers(f.ctx); err != nil { log.Error(err) } From 8cf5d79852ce1e606a57b3435dd846244e562ec5 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Wed, 3 Apr 2024 21:19:17 +0200 Subject: [PATCH 029/325] Remove the Goerli/Prater support. (#13846) --- WORKSPACE | 16 ------ beacon-chain/node/node_test.go | 6 +-- cmd/prysmctl/testnet/generate_genesis.go | 2 +- cmd/prysmctl/validator/cmd.go | 1 - cmd/validator/accounts/accounts.go | 5 -- .../slashing-protection.go | 2 - cmd/validator/wallet/wallet.go | 2 - config/features/config.go | 13 +---- config/features/flags.go | 9 ---- config/params/BUILD.bazel | 4 -- config/params/init.go | 1 - config/params/testdata/e2e_config.yaml | 2 +- config/params/testnet_prater_config.go | 49 ------------------- config/params/testnet_prater_config_test.go | 28 ----------- config/params/values.go | 2 - io/logs/logutil_test.go | 4 +- tools/eth1exporter/main.go | 2 +- tools/eth1voting/README.md | 2 +- tools/eth1voting/main.go | 2 +- tools/pcli/main.go | 8 --- validator/accounts/accounts_exit.go | 2 - validator/accounts/accounts_exit_test.go | 8 --- 22 files changed, 11 insertions(+), 159 deletions(-) delete mode 100644 config/params/testnet_prater_config.go delete mode 100644 config/params/testnet_prater_config_test.go diff --git a/WORKSPACE b/WORKSPACE index 552116744e2b..fbead3591caa 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -342,22 +342,6 @@ filegroup( url = "https://github.com/eth-clients/eth2-networks/archive/934c948e69205dcf2deb87e4ae6cc140c335f94d.tar.gz", ) -http_archive( - name = "goerli_testnet", - build_file_content = """ -filegroup( - name = "configs", - srcs = [ - "prater/config.yaml", - ], - visibility = ["//visibility:public"], -) - """, - sha256 = "43fc0f55ddff7b511713e2de07aa22846a67432df997296fb4fc09cd8ed1dcdb", - strip_prefix = "goerli-6522ac6684693740cd4ddcc2a0662e03702aa4a1", - url = "https://github.com/eth-clients/goerli/archive/6522ac6684693740cd4ddcc2a0662e03702aa4a1.tar.gz", -) - http_archive( name = "holesky_testnet", build_file_content = """ diff --git a/beacon-chain/node/node_test.go b/beacon-chain/node/node_test.go index b2c9164454aa..c7aca7d8d777 100644 --- a/beacon-chain/node/node_test.go +++ b/beacon-chain/node/node_test.go @@ -217,9 +217,9 @@ func Test_hasNetworkFlag(t *testing.T) { want bool }{ { - name: "Prater testnet", - networkName: features.PraterTestnet.Name, - networkValue: "prater", + name: "Holesky testnet", + networkName: features.HoleskyTestnet.Name, + networkValue: "holesky", want: true, }, { diff --git a/cmd/prysmctl/testnet/generate_genesis.go b/cmd/prysmctl/testnet/generate_genesis.go index 679c297b26a7..8ee5905447f7 100644 --- a/cmd/prysmctl/testnet/generate_genesis.go +++ b/cmd/prysmctl/testnet/generate_genesis.go @@ -85,7 +85,7 @@ var ( }, &cli.StringFlag{ Name: "config-name", - Usage: "Config kind to be used for generating the genesis state. Default: mainnet. Options include mainnet, interop, minimal, prater, sepolia. --chain-config-file will override this flag.", + Usage: "Config kind to be used for generating the genesis state. Default: mainnet. Options include mainnet, interop, minimal, sepolia, holesky. --chain-config-file will override this flag.", Destination: &generateGenesisStateFlags.ConfigName, Value: params.MainnetName, }, diff --git a/cmd/prysmctl/validator/cmd.go b/cmd/prysmctl/validator/cmd.go index 6b804bd96b09..5c75c3835514 100644 --- a/cmd/prysmctl/validator/cmd.go +++ b/cmd/prysmctl/validator/cmd.go @@ -167,7 +167,6 @@ var Commands = []*cli.Command{ flags.ForceExitFlag, flags.VoluntaryExitJSONOutputPath, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, diff --git a/cmd/validator/accounts/accounts.go b/cmd/validator/accounts/accounts.go index c88d69154e54..1e904f0b148b 100644 --- a/cmd/validator/accounts/accounts.go +++ b/cmd/validator/accounts/accounts.go @@ -27,7 +27,6 @@ var Commands = &cli.Command{ flags.WalletPasswordFileFlag, flags.DeletePublicKeysFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, @@ -63,7 +62,6 @@ var Commands = &cli.Command{ flags.GrpcRetriesFlag, flags.GrpcRetryDelayFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, @@ -97,7 +95,6 @@ var Commands = &cli.Command{ flags.BackupPublicKeysFlag, flags.BackupPasswordFile, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, @@ -128,7 +125,6 @@ var Commands = &cli.Command{ flags.AccountPasswordFileFlag, flags.ImportPrivateKeyFileFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, @@ -171,7 +167,6 @@ var Commands = &cli.Command{ flags.ForceExitFlag, flags.VoluntaryExitJSONOutputPath, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, diff --git a/cmd/validator/slashing-protection/slashing-protection.go b/cmd/validator/slashing-protection/slashing-protection.go index 7ad11868edda..6bc5fb03564e 100644 --- a/cmd/validator/slashing-protection/slashing-protection.go +++ b/cmd/validator/slashing-protection/slashing-protection.go @@ -22,7 +22,6 @@ var Commands = &cli.Command{ cmd.DataDirFlag, flags.SlashingProtectionExportDirFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, features.EnableMinimalSlashingProtection, @@ -51,7 +50,6 @@ var Commands = &cli.Command{ cmd.DataDirFlag, flags.SlashingProtectionJSONFileFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, features.EnableMinimalSlashingProtection, diff --git a/cmd/validator/wallet/wallet.go b/cmd/validator/wallet/wallet.go index cf2b529fd4a4..007a37f48a50 100644 --- a/cmd/validator/wallet/wallet.go +++ b/cmd/validator/wallet/wallet.go @@ -31,7 +31,6 @@ var Commands = &cli.Command{ flags.Mnemonic25thWordFileFlag, flags.SkipMnemonic25thWordCheckFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, @@ -63,7 +62,6 @@ var Commands = &cli.Command{ flags.Mnemonic25thWordFileFlag, flags.SkipMnemonic25thWordCheckFlag, features.Mainnet, - features.PraterTestnet, features.SepoliaTestnet, features.HoleskyTestnet, cmd.AcceptTosFlag, diff --git a/config/features/config.go b/config/features/config.go index 43f1c3d10a67..521d18130227 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -123,14 +123,7 @@ func InitWithReset(c *Flags) func() { // configureTestnet sets the config according to specified testnet flag func configureTestnet(ctx *cli.Context) error { - if ctx.Bool(PraterTestnet.Name) { - log.Info("Running on the Prater Testnet") - if err := params.SetActive(params.PraterConfig().Copy()); err != nil { - return err - } - applyPraterFeatureFlags(ctx) - params.UsePraterNetworkConfig() - } else if ctx.Bool(SepoliaTestnet.Name) { + if ctx.Bool(SepoliaTestnet.Name) { log.Info("Running on the Sepolia Beacon Chain Testnet") if err := params.SetActive(params.SepoliaConfig().Copy()); err != nil { return err @@ -157,10 +150,6 @@ func configureTestnet(ctx *cli.Context) error { return nil } -// Insert feature flags within the function to be enabled for Prater testnet. -func applyPraterFeatureFlags(ctx *cli.Context) { -} - // Insert feature flags within the function to be enabled for Sepolia testnet. func applySepoliaFeatureFlags(ctx *cli.Context) { } diff --git a/config/features/flags.go b/config/features/flags.go index d64fb49f8bee..402e643e8186 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -8,12 +8,6 @@ import ( ) var ( - // PraterTestnet flag for the multiclient Ethereum consensus testnet. - PraterTestnet = &cli.BoolFlag{ - Name: "prater", - Usage: "Runs Prysm configured for the Prater / Goerli test network.", - Aliases: []string{"goerli"}, - } // SepoliaTestnet flag for the multiclient Ethereum consensus testnet. SepoliaTestnet = &cli.BoolFlag{ Name: "sepolia", @@ -183,7 +177,6 @@ var devModeFlags = []cli.Flag{ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{ writeWalletPasswordOnWebOnboarding, HoleskyTestnet, - PraterTestnet, SepoliaTestnet, Mainnet, dynamicKeyReloadDebounceInterval, @@ -208,7 +201,6 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c saveInvalidBlobTempFlag, disableGRPCConnectionLogging, HoleskyTestnet, - PraterTestnet, SepoliaTestnet, Mainnet, disablePeerScorer, @@ -239,7 +231,6 @@ var E2EBeaconChainFlags = []string{ // NetworkFlags contains a list of network flags. var NetworkFlags = []cli.Flag{ Mainnet, - PraterTestnet, SepoliaTestnet, HoleskyTestnet, } diff --git a/config/params/BUILD.bazel b/config/params/BUILD.bazel index a9cb1ff308be..e97f4d1f9f18 100644 --- a/config/params/BUILD.bazel +++ b/config/params/BUILD.bazel @@ -16,7 +16,6 @@ go_library( "network_config.go", "testnet_e2e_config.go", "testnet_holesky_config.go", - "testnet_prater_config.go", "testnet_sepolia_config.go", "testutils.go", "testutils_develop.go", # keep @@ -50,7 +49,6 @@ go_test( "mainnet_config_test.go", "testnet_config_test.go", "testnet_holesky_config_test.go", - "testnet_prater_config_test.go", ], data = glob(["*.yaml"]) + [ "testdata/e2e_config.yaml", @@ -58,14 +56,12 @@ go_test( "@consensus_spec_tests_mainnet//:test_data", "@consensus_spec_tests_minimal//:test_data", "@eth2_networks//:configs", - "@goerli_testnet//:configs", "@holesky_testnet//:configs", ], embed = [":go_default_library"], gotags = ["develop"], tags = ["CI_race_detection"], deps = [ - "//build/bazel:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", diff --git a/config/params/init.go b/config/params/init.go index ac81bd5540b1..fd2263b376a7 100644 --- a/config/params/init.go +++ b/config/params/init.go @@ -3,7 +3,6 @@ package params func init() { defaults := []*BeaconChainConfig{ MainnetConfig(), - PraterConfig(), MinimalSpecConfig(), E2ETestConfig(), E2EMainnetTestConfig(), diff --git a/config/params/testdata/e2e_config.yaml b/config/params/testdata/e2e_config.yaml index 58dcb120e66c..f81f94959122 100644 --- a/config/params/testdata/e2e_config.yaml +++ b/config/params/testdata/e2e_config.yaml @@ -82,7 +82,7 @@ PROPOSER_SCORE_BOOST: 40 # Deposit contract # --------------------------------------------------------------- -# Ethereum Goerli testnet +# Testnet DEPOSIT_CHAIN_ID: 1337 # Override for e2e tests DEPOSIT_NETWORK_ID: 1337 # Override for e2e tests # Configured on a per testnet basis diff --git a/config/params/testnet_prater_config.go b/config/params/testnet_prater_config.go deleted file mode 100644 index f1caffb4522d..000000000000 --- a/config/params/testnet_prater_config.go +++ /dev/null @@ -1,49 +0,0 @@ -package params - -import ( - eth1Params "github.com/ethereum/go-ethereum/params" -) - -// UsePraterNetworkConfig uses the Prater specific -// network config. -func UsePraterNetworkConfig() { - cfg := BeaconNetworkConfig().Copy() - cfg.ContractDeploymentBlock = 4367322 - cfg.BootstrapNodes = []string{ - // Prysm's bootnode - "enr:-Ku4QFmUkNp0g9bsLX2PfVeIyT-9WO-PZlrqZBNtEyofOOfLMScDjaTzGxIb1Ns9Wo5Pm_8nlq-SZwcQfTH2cgO-s88Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpDkvpOTAAAQIP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQLV_jMOIxKbjHFKgrkFvwDvpexo6Nd58TK5k7ss4Vt0IoN1ZHCCG1g", - // Lighthouse's bootnode by Afri - "enr:-LK4QH1xnjotgXwg25IDPjrqRGFnH1ScgNHA3dv1Z8xHCp4uP3N3Jjl_aYv_WIxQRdwZvSukzbwspXZ7JjpldyeVDzMCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpB53wQoAAAQIP__________gmlkgnY0gmlwhIe1te-Jc2VjcDI1NmsxoQOkcGXqbCJYbcClZ3z5f6NWhX_1YPFRYRRWQpJjwSHpVIN0Y3CCIyiDdWRwgiMo", - // Lighthouse's bootnode by Sigp - "enr:-Ly4QFPk-cTMxZ3jWTafiNblEZkQIXGF2aVzCIGW0uHp6KaEAvBMoctE8S7YU0qZtuS7By0AA4YMfKoN9ls_GJRccVpFh2F0dG5ldHOI__________-EZXRoMpCC9KcrAgAQIIS2AQAAAAAAgmlkgnY0gmlwhKh3joWJc2VjcDI1NmsxoQKrxz8M1IHwJqRIpDqdVW_U1PeixMW5SfnBD-8idYIQrIhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA", - "enr:-L64QJmwSDtaHVgGiqIxJWUtxWg6uLCipsms6j-8BdsOJfTWAs7CLF9HJnVqFE728O-JYUDCxzKvRdeMqBSauHVCMdaCAVWHYXR0bmV0c4j__________4RldGgykIL0pysCABAghLYBAAAAAACCaWSCdjSCaXCEQWxOdolzZWNwMjU2azGhA7Qmod9fK86WidPOzLsn5_8QyzL7ZcJ1Reca7RnD54vuiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo", - // Teku's bootnode By Afri - "enr:-KG4QCIzJZTY_fs_2vqWEatJL9RrtnPwDCv-jRBuO5FQ2qBrfJubWOWazri6s9HsyZdu-fRUfEzkebhf1nvO42_FVzwDhGV0aDKQed8EKAAAECD__________4JpZIJ2NIJpcISHtbYziXNlY3AyNTZrMaED4m9AqVs6F32rSCGsjtYcsyfQE2K8nDiGmocUY_iq-TSDdGNwgiMog3VkcIIjKA", - } - OverrideBeaconNetworkConfig(cfg) -} - -// PraterConfig defines the config for the -// Prater testnet. -func PraterConfig() *BeaconChainConfig { - cfg := MainnetConfig().Copy() - cfg.MinGenesisTime = 1614588812 - cfg.GenesisDelay = 1919188 - cfg.ConfigName = PraterName - cfg.GenesisForkVersion = []byte{0x00, 0x00, 0x10, 0x20} - cfg.SecondsPerETH1Block = 14 - cfg.DepositChainID = eth1Params.GoerliChainConfig.ChainID.Uint64() - cfg.DepositNetworkID = eth1Params.GoerliChainConfig.ChainID.Uint64() - cfg.AltairForkEpoch = 36660 - cfg.AltairForkVersion = []byte{0x1, 0x0, 0x10, 0x20} - cfg.BellatrixForkEpoch = 112260 - cfg.BellatrixForkVersion = []byte{0x2, 0x0, 0x10, 0x20} - cfg.CapellaForkEpoch = 162304 - cfg.CapellaForkVersion = []byte{0x3, 0x0, 0x10, 0x20} - cfg.DenebForkEpoch = 231680 // 2024-01-17 06:32:00 (UTC) - cfg.DenebForkVersion = []byte{0x4, 0x0, 0x10, 0x20} - cfg.TerminalTotalDifficulty = "10790000" - cfg.DepositContractAddress = "0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b" - cfg.InitializeForkSchedule() - return cfg -} diff --git a/config/params/testnet_prater_config_test.go b/config/params/testnet_prater_config_test.go deleted file mode 100644 index 2f0897996df7..000000000000 --- a/config/params/testnet_prater_config_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package params_test - -import ( - "path" - "testing" - - "github.com/prysmaticlabs/prysm/v5/build/bazel" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/testing/require" -) - -func TestPraterConfigMatchesUpstreamYaml(t *testing.T) { - presetFPs := presetsFilePath(t, "mainnet") - mn, err := params.ByName(params.MainnetName) - require.NoError(t, err) - cfg := mn.Copy() - for _, fp := range presetFPs { - cfg, err = params.UnmarshalConfigFile(fp, cfg) - require.NoError(t, err) - } - fPath, err := bazel.Runfile("external/goerli_testnet") - require.NoError(t, err) - configFP := path.Join(fPath, "prater", "config.yaml") - pcfg, err := params.UnmarshalConfigFile(configFP, nil) - require.NoError(t, err) - fields := fieldsFromYamls(t, append(presetFPs, configFP)) - assertYamlFieldsMatch(t, "prater", fields, pcfg, params.PraterConfig()) -} diff --git a/config/params/values.go b/config/params/values.go index 34dccb7214ed..36eda3db7b8b 100644 --- a/config/params/values.go +++ b/config/params/values.go @@ -8,8 +8,6 @@ const ( MainnetName = "mainnet" MainnetTestName = "mainnet-test" MinimalName = "minimal" - PraterName = "prater" - GoerliName = "goerli" SepoliaName = "sepolia" HoleskyName = "holesky" ) diff --git a/io/logs/logutil_test.go b/io/logs/logutil_test.go index 0612f6798c76..6ce11f14b335 100644 --- a/io/logs/logutil_test.go +++ b/io/logs/logutil_test.go @@ -13,8 +13,8 @@ var urltests = []struct { maskedUrl string }{ {"https://a:b@xyz.net", "https://***@xyz.net"}, - {"https://eth-goerli.alchemyapi.io/v2/tOZG5mjl3.zl_nZdZTNIBUzsDq62R_dkOtY", - "https://eth-goerli.alchemyapi.io/***"}, + {"https://eth-holesky.alchemyapi.io/v2/tOZG5mjl3.zl_nZdZTNIBUzsDq62R_dkOtY", + "https://eth-holesky.alchemyapi.io/***"}, {"https://google.com/search?q=golang", "https://google.com/***"}, {"https://user@example.com/foo%2fbar", "https://***@example.com/***"}, {"http://john@example.com/#x/y%2Fz", "http://***@example.com/#***"}, diff --git a/tools/eth1exporter/main.go b/tools/eth1exporter/main.go index bd00b189dec0..5d2890d6f106 100644 --- a/tools/eth1exporter/main.go +++ b/tools/eth1exporter/main.go @@ -30,7 +30,7 @@ var ( var ( port = flag.Int("port", 9090, "Port to serve /metrics") - web3URL = flag.String("web3-provider", "https://goerli.prylabs.net", "Web3 URL to access information about ETH1") + web3URL = flag.String("web3-provider", "https://holesky.prylabs.net", "Web3 URL to access information about ETH1") prefix = flag.String("prefix", "", "Metrics prefix.") addressFilePath = flag.String("addresses", "", "File path to addresses text file.") ) diff --git a/tools/eth1voting/README.md b/tools/eth1voting/README.md index 95b1652b3a40..76841888b2d6 100644 --- a/tools/eth1voting/README.md +++ b/tools/eth1voting/README.md @@ -7,7 +7,7 @@ Flags: -beacon string gRPC address of the Prysm beacon node (default "127.0.0.1:4000") -genesis uint - Genesis time. mainnet=1606824023, prater=1616508000 (default 1606824023) + Genesis time. mainnet=1606824023, holesky=1695902400 (default 1606824023) ``` Usage: diff --git a/tools/eth1voting/main.go b/tools/eth1voting/main.go index 3447369c478d..9b9caffea4be 100644 --- a/tools/eth1voting/main.go +++ b/tools/eth1voting/main.go @@ -19,7 +19,7 @@ import ( var ( beacon = flag.String("beacon", "127.0.0.1:4000", "gRPC address of the Prysm beacon node") - genesis = flag.Uint64("genesis", 1606824023, "Genesis time. mainnet=1606824023, prater=1616508000") + genesis = flag.Uint64("genesis", 1606824023, "Genesis time. mainnet=1606824023, holesky=1695902400") ) func main() { diff --git a/tools/pcli/main.go b/tools/pcli/main.go index c632db50bdc0..65667e118931 100644 --- a/tools/pcli/main.go +++ b/tools/pcli/main.go @@ -209,14 +209,6 @@ var stateTransitionCommand = &cli.Command{ Action: func(c *cli.Context) error { if network != "" { switch network { - case params.PraterName: - if err := params.SetActive(params.PraterConfig()); err != nil { - log.Fatal(err) - } - case params.GoerliName: - if err := params.SetActive(params.PraterConfig()); err != nil { - log.Fatal(err) - } case params.SepoliaName: if err := params.SetActive(params.SepoliaConfig()); err != nil { log.Fatal(err) diff --git a/validator/accounts/accounts_exit.go b/validator/accounts/accounts_exit.go index 8499b4016af6..67f0b801ea0c 100644 --- a/validator/accounts/accounts_exit.go +++ b/validator/accounts/accounts_exit.go @@ -175,8 +175,6 @@ func formatBeaconChaURL(key []byte) string { keyWithout0x := hexutil.Encode(key)[2:] switch env := params.BeaconConfig().ConfigName; env { - case params.PraterName, params.GoerliName: - return fmt.Sprintf(baseURL, "prater.", keyWithout0x) case params.HoleskyName: return fmt.Sprintf(baseURL, "holesky.", keyWithout0x) case params.SepoliaName: diff --git a/validator/accounts/accounts_exit_test.go b/validator/accounts/accounts_exit_test.go index 6d9fd98fbebf..dde30d667874 100644 --- a/validator/accounts/accounts_exit_test.go +++ b/validator/accounts/accounts_exit_test.go @@ -24,14 +24,6 @@ func TestDisplayExitInfo(t *testing.T) { displayExitInfo([][]byte{key}, []string{string(key)}) assert.LogsContain(t, logHook, "https://beaconcha.in/validator/3078313233343536") - params.BeaconConfig().ConfigName = params.GoerliName - displayExitInfo([][]byte{key}, []string{string(key)}) - assert.LogsContain(t, logHook, "https://prater.beaconcha.in/validator/3078313233343536") - - params.BeaconConfig().ConfigName = params.PraterName - displayExitInfo([][]byte{key}, []string{string(key)}) - assert.LogsContain(t, logHook, "https://prater.beaconcha.in/validator/3078313233343536") - params.BeaconConfig().ConfigName = params.HoleskyName displayExitInfo([][]byte{key}, []string{string(key)}) assert.LogsContain(t, logHook, "https://holesky.beaconcha.in/validator/3078313233343536") From be1bfcce638e8fffefecbc6ed21c0311555e29fd Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Thu, 4 Apr 2024 14:21:35 +0200 Subject: [PATCH 030/325] P2P: Add QUIC support (#13786) * (Unrelated) DoppelGanger: Improve message. * `beacon-blocks-by-range`: Add `--network` option. * `ensurePeerConnections`: Remove capital letter in error message. * `MultiAddressBuilder{WithID}`: Refactor. * `buildOptions`: Improve log. * `NewService`: Bubbles up errors. * `tcp` ==> `libp2ptcp` * `multiAddressBuilderWithID`: Add the ability to build QUIC multiaddr * `p2p Start`: Fix error message. * `p2p`: Add QUIC support. * Status: Implement `{Inbound,Outbound}Connected{TCP,QUIC}`. * Logging: Display the number of TCP/QUIC connected peers. * P2P: Implement `{Inbound,Outbound}ConnectedWithProtocol`. * Hide QUIC protocol behind the `--enable-quic` feature flag. * `e2e`: Add `--enable-quic` flag. * Add `--enable-quic` in `devModeFlag`. * `convertToMultiAddrs` ==> `retrieveMultiAddrsFromNode`. * `convertToAddrInfo`: Ensure `len(infos) == 1`. --- beacon-chain/node/node.go | 1 + beacon-chain/p2p/BUILD.bazel | 1 + beacon-chain/p2p/config.go | 1 + beacon-chain/p2p/discovery.go | 184 +++++++++++++++++---- beacon-chain/p2p/discovery_test.go | 14 +- beacon-chain/p2p/fork_test.go | 31 ++-- beacon-chain/p2p/log.go | 27 +-- beacon-chain/p2p/options.go | 113 ++++++++++--- beacon-chain/p2p/options_test.go | 79 +++++++-- beacon-chain/p2p/peers/status.go | 38 ++++- beacon-chain/p2p/peers/status_test.go | 162 ++++++++++++++++++ beacon-chain/p2p/service.go | 40 +++-- beacon-chain/p2p/service_test.go | 6 +- beacon-chain/p2p/subnets.go | 5 + beacon-chain/p2p/subnets_test.go | 12 +- beacon-chain/p2p/watch_peers.go | 2 +- beacon-chain/sync/rpc.go | 6 + cmd/beacon-chain/main.go | 1 + cmd/beacon-chain/usage.go | 1 + cmd/flags.go | 12 +- cmd/prysmctl/p2p/BUILD.bazel | 1 + cmd/prysmctl/p2p/client.go | 12 +- cmd/prysmctl/p2p/request_blobs.go | 30 ++-- cmd/prysmctl/p2p/request_blocks.go | 50 ++++-- config/features/config.go | 5 + config/features/flags.go | 11 +- testing/endtoend/components/beacon_node.go | 4 +- testing/endtoend/params/params.go | 15 +- testing/endtoend/params/params_test.go | 2 +- 29 files changed, 703 insertions(+), 163 deletions(-) diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index e87d68cf0ce9..64bef6d46363 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -707,6 +707,7 @@ func (b *BeaconNode) registerP2P(cliCtx *cli.Context) error { PrivateKey: cliCtx.String(cmd.P2PPrivKey.Name), StaticPeerID: cliCtx.Bool(cmd.P2PStaticID.Name), MetaDataDir: cliCtx.String(cmd.P2PMetadata.Name), + QUICPort: cliCtx.Uint(cmd.P2PQUICPort.Name), TCPPort: cliCtx.Uint(cmd.P2PTCPPort.Name), UDPPort: cliCtx.Uint(cmd.P2PUDPPort.Name), MaxPeers: cliCtx.Uint(cmd.P2PMaxPeers.Name), diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index af7562399143..ddbbf7b5b105 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -90,6 +90,7 @@ go_library( "@com_github_libp2p_go_libp2p//core/peerstore:go_default_library", "@com_github_libp2p_go_libp2p//core/protocol:go_default_library", "@com_github_libp2p_go_libp2p//p2p/security/noise:go_default_library", + "@com_github_libp2p_go_libp2p//p2p/transport/quic:go_default_library", "@com_github_libp2p_go_libp2p//p2p/transport/tcp:go_default_library", "@com_github_libp2p_go_libp2p_mplex//:go_default_library", "@com_github_libp2p_go_libp2p_pubsub//:go_default_library", diff --git a/beacon-chain/p2p/config.go b/beacon-chain/p2p/config.go index ca5dbfa54c89..3da7d055cbb2 100644 --- a/beacon-chain/p2p/config.go +++ b/beacon-chain/p2p/config.go @@ -24,6 +24,7 @@ type Config struct { PrivateKey string DataDir string MetaDataDir string + QUICPort uint TCPPort uint UDPPort uint MaxPeers uint diff --git a/beacon-chain/p2p/discovery.go b/beacon-chain/p2p/discovery.go index 5a08101a28ed..7fc63927ca88 100644 --- a/beacon-chain/p2p/discovery.go +++ b/beacon-chain/p2p/discovery.go @@ -15,6 +15,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" ecdsaprysm "github.com/prysmaticlabs/prysm/v5/crypto/ecdsa" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -39,6 +40,11 @@ const ( udp6 ) +type quicProtocol uint16 + +// quicProtocol is the "quic" key, which holds the QUIC port of the node. +func (quicProtocol) ENRKey() string { return "quic" } + // RefreshENR uses an epoch to refresh the enr entry for our node // with the tracked committee ids for the epoch, allowing our node // to be dynamically discoverable by others given our tracked committee ids. @@ -100,14 +106,15 @@ func (s *Service) RefreshENR() { // listen for new nodes watches for new nodes in the network and adds them to the peerstore. func (s *Service) listenForNewNodes() { - iterator := s.dv5Listener.RandomNodes() - iterator = enode.Filter(iterator, s.filterPeer) + iterator := enode.Filter(s.dv5Listener.RandomNodes(), s.filterPeer) defer iterator.Close() + for { - // Exit if service's context is canceled + // Exit if service's context is canceled. if s.ctx.Err() != nil { break } + if s.isPeerAtLimit(false /* inbound */) { // Pause the main loop for a period to stop looking // for new peers. @@ -115,16 +122,22 @@ func (s *Service) listenForNewNodes() { time.Sleep(pollingPeriod) continue } - exists := iterator.Next() - if !exists { + + if exists := iterator.Next(); !exists { break } + node := iterator.Node() peerInfo, _, err := convertToAddrInfo(node) if err != nil { log.WithError(err).Error("Could not convert to peer info") continue } + + if peerInfo == nil { + continue + } + // Make sure that peer is not dialed too often, for each connection attempt there's a backoff period. s.Peers().RandomizeBackOff(peerInfo.ID) go func(info *peer.AddrInfo) { @@ -167,8 +180,7 @@ func (s *Service) createListener( // Listen to all network interfaces // for both ip protocols. - networkVersion := "udp" - conn, err := net.ListenUDP(networkVersion, udpAddr) + conn, err := net.ListenUDP("udp", udpAddr) if err != nil { return nil, errors.Wrap(err, "could not listen to UDP") } @@ -178,6 +190,7 @@ func (s *Service) createListener( ipAddr, int(s.cfg.UDPPort), int(s.cfg.TCPPort), + int(s.cfg.QUICPort), ) if err != nil { return nil, errors.Wrap(err, "could not create local node") @@ -209,7 +222,7 @@ func (s *Service) createListener( func (s *Service) createLocalNode( privKey *ecdsa.PrivateKey, ipAddr net.IP, - udpPort, tcpPort int, + udpPort, tcpPort, quicPort int, ) (*enode.LocalNode, error) { db, err := enode.OpenDB("") if err != nil { @@ -218,11 +231,19 @@ func (s *Service) createLocalNode( localNode := enode.NewLocalNode(db, privKey) ipEntry := enr.IP(ipAddr) - udpEntry := enr.UDP(udpPort) - tcpEntry := enr.TCP(tcpPort) localNode.Set(ipEntry) + + udpEntry := enr.UDP(udpPort) localNode.Set(udpEntry) + + tcpEntry := enr.TCP(tcpPort) localNode.Set(tcpEntry) + + if features.Get().EnableQUIC { + quicEntry := quicProtocol(quicPort) + localNode.Set(quicEntry) + } + localNode.SetFallbackIP(ipAddr) localNode.SetFallbackUDP(udpPort) @@ -277,7 +298,7 @@ func (s *Service) startDiscoveryV5( // filterPeer validates each node that we retrieve from our dht. We // try to ascertain that the peer can be a valid protocol peer. // Validity Conditions: -// 1. Peer has a valid IP and TCP port set in their enr. +// 1. Peer has a valid IP and a (QUIC and/or TCP) port set in their enr. // 2. Peer hasn't been marked as 'bad'. // 3. Peer is not currently active or connected. // 4. Peer is ready to receive incoming connections. @@ -294,17 +315,13 @@ func (s *Service) filterPeer(node *enode.Node) bool { return false } - // Ignore nodes with their TCP ports not set. - if err := node.Record().Load(enr.WithEntry("tcp", new(enr.TCP))); err != nil { - if !enr.IsNotFound(err) { - log.WithError(err).Debug("Could not retrieve tcp port") - } + peerData, multiAddrs, err := convertToAddrInfo(node) + if err != nil { + log.WithError(err).Debug("Could not convert to peer data") return false } - peerData, multiAddr, err := convertToAddrInfo(node) - if err != nil { - log.WithError(err).Debug("Could not convert to peer data") + if peerData == nil || len(multiAddrs) == 0 { return false } @@ -337,6 +354,9 @@ func (s *Service) filterPeer(node *enode.Node) bool { } } + // If the peer has 2 multiaddrs, favor the QUIC address, which is in first position. + multiAddr := multiAddrs[0] + // Add peer to peer handler. s.peers.Add(nodeENR, peerData.ID, multiAddr, network.DirUnknown) @@ -380,11 +400,11 @@ func PeersFromStringAddrs(addrs []string) ([]ma.Multiaddr, error) { if err != nil { return nil, errors.Wrapf(err, "Could not get enode from string") } - addr, err := convertToSingleMultiAddr(enodeAddr) + nodeAddrs, err := retrieveMultiAddrsFromNode(enodeAddr) if err != nil { return nil, errors.Wrapf(err, "Could not get multiaddr") } - allAddrs = append(allAddrs, addr) + allAddrs = append(allAddrs, nodeAddrs...) } return allAddrs, nil } @@ -419,45 +439,139 @@ func parseGenericAddrs(addrs []string) (enodeString, multiAddrString []string) { } func convertToMultiAddr(nodes []*enode.Node) []ma.Multiaddr { - var multiAddrs []ma.Multiaddr + // Expect each node to have a TCP and a QUIC address. + multiAddrs := make([]ma.Multiaddr, 0, 2*len(nodes)) + for _, node := range nodes { - // ignore nodes with no ip address stored + // Skip nodes with no ip address stored. if node.IP() == nil { continue } - multiAddr, err := convertToSingleMultiAddr(node) + + // Get up to two multiaddrs (TCP and QUIC) for each node. + nodeMultiAddrs, err := retrieveMultiAddrsFromNode(node) if err != nil { - log.WithError(err).Error("Could not convert to multiAddr") + log.WithError(err).Errorf("Could not convert to multiAddr node %s", node) continue } - multiAddrs = append(multiAddrs, multiAddr) + + multiAddrs = append(multiAddrs, nodeMultiAddrs...) } + return multiAddrs } -func convertToAddrInfo(node *enode.Node) (*peer.AddrInfo, ma.Multiaddr, error) { - multiAddr, err := convertToSingleMultiAddr(node) +func convertToAddrInfo(node *enode.Node) (*peer.AddrInfo, []ma.Multiaddr, error) { + multiAddrs, err := retrieveMultiAddrsFromNode(node) if err != nil { return nil, nil, err } - info, err := peer.AddrInfoFromP2pAddr(multiAddr) + + if len(multiAddrs) == 0 { + return nil, nil, nil + } + + infos, err := peer.AddrInfosFromP2pAddrs(multiAddrs...) if err != nil { - return nil, nil, err + return nil, nil, errors.Wrapf(err, "could not convert to peer info: %v", multiAddrs) } - return info, multiAddr, nil + + if len(infos) != 1 { + return nil, nil, errors.Errorf("infos contains %v elements, expected exactly 1", len(infos)) + } + + return &infos[0], multiAddrs, nil } -func convertToSingleMultiAddr(node *enode.Node) (ma.Multiaddr, error) { +// retrieveMultiAddrsFromNode converts an enode.Node to a list of multiaddrs. +// If the node has a both a QUIC and a TCP port set in their ENR, then +// the multiaddr corresponding to the QUIC port is added first, followed +// by the multiaddr corresponding to the TCP port. +func retrieveMultiAddrsFromNode(node *enode.Node) ([]ma.Multiaddr, error) { + multiaddrs := make([]ma.Multiaddr, 0, 2) + + // Retrieve the node public key. pubkey := node.Pubkey() assertedKey, err := ecdsaprysm.ConvertToInterfacePubkey(pubkey) if err != nil { return nil, errors.Wrap(err, "could not get pubkey") } + + // Compute the node ID from the public key. id, err := peer.IDFromPublicKey(assertedKey) if err != nil { return nil, errors.Wrap(err, "could not get peer id") } - return multiAddressBuilderWithID(node.IP().String(), "tcp", uint(node.TCP()), id) + + if features.Get().EnableQUIC { + // If the QUIC entry is present in the ENR, build the corresponding multiaddress. + port, ok, err := getPort(node, quic) + if err != nil { + return nil, errors.Wrap(err, "could not get QUIC port") + } + + if ok { + addr, err := multiAddressBuilderWithID(node.IP(), quic, port, id) + if err != nil { + return nil, errors.Wrap(err, "could not build QUIC address") + } + + multiaddrs = append(multiaddrs, addr) + } + } + + // If the TCP entry is present in the ENR, build the corresponding multiaddress. + port, ok, err := getPort(node, tcp) + if err != nil { + return nil, errors.Wrap(err, "could not get TCP port") + } + + if ok { + addr, err := multiAddressBuilderWithID(node.IP(), tcp, port, id) + if err != nil { + return nil, errors.Wrap(err, "could not build TCP address") + } + + multiaddrs = append(multiaddrs, addr) + } + + return multiaddrs, nil +} + +// getPort retrieves the port for a given node and protocol, as well as a boolean +// indicating whether the port was found, and an error +func getPort(node *enode.Node, protocol internetProtocol) (uint, bool, error) { + var ( + port uint + err error + ) + + switch protocol { + case tcp: + var entry enr.TCP + err = node.Load(&entry) + port = uint(entry) + case udp: + var entry enr.UDP + err = node.Load(&entry) + port = uint(entry) + case quic: + var entry quicProtocol + err = node.Load(&entry) + port = uint(entry) + default: + return 0, false, errors.Errorf("invalid protocol: %v", protocol) + } + + if enr.IsNotFound(err) { + return port, false, nil + } + + if err != nil { + return 0, false, errors.Wrap(err, "could not get port") + } + + return port, true, nil } func convertToUdpMultiAddr(node *enode.Node) ([]ma.Multiaddr, error) { @@ -475,14 +589,14 @@ func convertToUdpMultiAddr(node *enode.Node) ([]ma.Multiaddr, error) { var ip4 enr.IPv4 var ip6 enr.IPv6 if node.Load(&ip4) == nil { - address, ipErr := multiAddressBuilderWithID(net.IP(ip4).String(), "udp", uint(node.UDP()), id) + address, ipErr := multiAddressBuilderWithID(net.IP(ip4), udp, uint(node.UDP()), id) if ipErr != nil { return nil, errors.Wrap(ipErr, "could not build IPv4 address") } addresses = append(addresses, address) } if node.Load(&ip6) == nil { - address, ipErr := multiAddressBuilderWithID(net.IP(ip6).String(), "udp", uint(node.UDP()), id) + address, ipErr := multiAddressBuilderWithID(net.IP(ip6), udp, uint(node.UDP()), id) if ipErr != nil { return nil, errors.Wrap(ipErr, "could not build IPv6 address") } diff --git a/beacon-chain/p2p/discovery_test.go b/beacon-chain/p2p/discovery_test.go index 31d8a23e501c..e9b8a8368870 100644 --- a/beacon-chain/p2p/discovery_test.go +++ b/beacon-chain/p2p/discovery_test.go @@ -166,8 +166,9 @@ func TestCreateLocalNode(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // Define ports. const ( - udpPort = 2000 - tcpPort = 3000 + udpPort = 2000 + tcpPort = 3000 + quicPort = 3000 ) // Create a private key. @@ -180,7 +181,7 @@ func TestCreateLocalNode(t *testing.T) { cfg: tt.cfg, } - localNode, err := service.createLocalNode(privKey, address, udpPort, tcpPort) + localNode, err := service.createLocalNode(privKey, address, udpPort, tcpPort, quicPort) if tt.expectedError { require.NotNil(t, err) return @@ -237,7 +238,7 @@ func TestMultiAddrsConversion_InvalidIPAddr(t *testing.T) { genesisTime: time.Now(), genesisValidatorsRoot: bytesutil.PadTo([]byte{'A'}, 32), } - node, err := s.createLocalNode(pkey, addr, 0, 0) + node, err := s.createLocalNode(pkey, addr, 0, 0, 0) require.NoError(t, err) multiAddr := convertToMultiAddr([]*enode.Node{node.Node()}) assert.Equal(t, 0, len(multiAddr), "Invalid ip address converted successfully") @@ -248,8 +249,9 @@ func TestMultiAddrConversion_OK(t *testing.T) { ipAddr, pkey := createAddrAndPrivKey(t) s := &Service{ cfg: &Config{ - TCPPort: 0, - UDPPort: 0, + UDPPort: 2000, + TCPPort: 3000, + QUICPort: 3000, }, genesisTime: time.Now(), genesisValidatorsRoot: bytesutil.PadTo([]byte{'A'}, 32), diff --git a/beacon-chain/p2p/fork_test.go b/beacon-chain/p2p/fork_test.go index 86541c894b2c..d5780f719901 100644 --- a/beacon-chain/p2p/fork_test.go +++ b/beacon-chain/p2p/fork_test.go @@ -28,7 +28,8 @@ import ( ) func TestStartDiscv5_DifferentForkDigests(t *testing.T) { - port := 2000 + const port = 2000 + ipAddr, pkey := createAddrAndPrivKey(t) genesisTime := time.Now() genesisValidatorsRoot := make([]byte, fieldparams.RootLength) @@ -53,7 +54,7 @@ func TestStartDiscv5_DifferentForkDigests(t *testing.T) { var listeners []*discover.UDPv5 for i := 1; i <= 5; i++ { - port = 3000 + i + port := 3000 + i cfg.UDPPort = uint(port) ipAddr, pkey := createAddrAndPrivKey(t) @@ -98,13 +99,14 @@ func TestStartDiscv5_DifferentForkDigests(t *testing.T) { s.genesisTime = genesisTime s.genesisValidatorsRoot = make([]byte, 32) s.dv5Listener = lastListener - var addrs []ma.Multiaddr - for _, n := range nodes { - if s.filterPeer(n) { - addr, err := convertToSingleMultiAddr(n) + addrs := make([]ma.Multiaddr, 0) + + for _, node := range nodes { + if s.filterPeer(node) { + nodeAddrs, err := retrieveMultiAddrsFromNode(node) require.NoError(t, err) - addrs = append(addrs, addr) + addrs = append(addrs, nodeAddrs...) } } @@ -114,10 +116,11 @@ func TestStartDiscv5_DifferentForkDigests(t *testing.T) { } func TestStartDiscv5_SameForkDigests_DifferentNextForkData(t *testing.T) { + const port = 2000 + params.SetupTestConfigCleanup(t) hook := logTest.NewGlobal() logrus.SetLevel(logrus.TraceLevel) - port := 2000 ipAddr, pkey := createAddrAndPrivKey(t) genesisTime := time.Now() genesisValidatorsRoot := make([]byte, 32) @@ -138,7 +141,7 @@ func TestStartDiscv5_SameForkDigests_DifferentNextForkData(t *testing.T) { var listeners []*discover.UDPv5 for i := 1; i <= 5; i++ { - port = 3000 + i + port := 3000 + i cfg.UDPPort = uint(port) ipAddr, pkey := createAddrAndPrivKey(t) @@ -188,13 +191,13 @@ func TestStartDiscv5_SameForkDigests_DifferentNextForkData(t *testing.T) { s.genesisTime = genesisTime s.genesisValidatorsRoot = make([]byte, 32) s.dv5Listener = lastListener - var addrs []ma.Multiaddr + addrs := make([]ma.Multiaddr, 0, len(nodes)) - for _, n := range nodes { - if s.filterPeer(n) { - addr, err := convertToSingleMultiAddr(n) + for _, node := range nodes { + if s.filterPeer(node) { + nodeAddrs, err := retrieveMultiAddrsFromNode(node) require.NoError(t, err) - addrs = append(addrs, addr) + addrs = append(addrs, nodeAddrs...) } } if len(addrs) == 0 { diff --git a/beacon-chain/p2p/log.go b/beacon-chain/p2p/log.go index 7d395f805dcb..bc848a1dbbd4 100644 --- a/beacon-chain/p2p/log.go +++ b/beacon-chain/p2p/log.go @@ -1,6 +1,7 @@ package p2p import ( + "net" "strconv" "strings" @@ -12,32 +13,32 @@ import ( var log = logrus.WithField("prefix", "p2p") func logIPAddr(id peer.ID, addrs ...ma.Multiaddr) { - var correctAddr ma.Multiaddr for _, addr := range addrs { - if strings.Contains(addr.String(), "/ip4/") || strings.Contains(addr.String(), "/ip6/") { - correctAddr = addr - break + if !(strings.Contains(addr.String(), "/ip4/") || strings.Contains(addr.String(), "/ip6/")) { + continue } - } - if correctAddr != nil { + log.WithField( "multiAddr", - correctAddr.String()+"/p2p/"+id.String(), + addr.String()+"/p2p/"+id.String(), ).Info("Node started p2p server") } } -func logExternalIPAddr(id peer.ID, addr string, port uint) { +func logExternalIPAddr(id peer.ID, addr string, tcpPort, quicPort uint) { if addr != "" { - multiAddr, err := MultiAddressBuilder(addr, port) + multiAddrs, err := MultiAddressBuilder(net.ParseIP(addr), tcpPort, quicPort) if err != nil { log.WithError(err).Error("Could not create multiaddress") return } - log.WithField( - "multiAddr", - multiAddr.String()+"/p2p/"+id.String(), - ).Info("Node started external p2p server") + + for _, multiAddr := range multiAddrs { + log.WithField( + "multiAddr", + multiAddr.String()+"/p2p/"+id.String(), + ).Info("Node started external p2p server") + } } } diff --git a/beacon-chain/p2p/options.go b/beacon-chain/p2p/options.go index 5d4b8fa31b99..9935e8e0aef4 100644 --- a/beacon-chain/p2p/options.go +++ b/beacon-chain/p2p/options.go @@ -11,40 +11,68 @@ import ( "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/security/noise" - "github.com/libp2p/go-libp2p/p2p/transport/tcp" + libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic" + libp2ptcp "github.com/libp2p/go-libp2p/p2p/transport/tcp" gomplex "github.com/libp2p/go-mplex" ma "github.com/multiformats/go-multiaddr" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/config/features" ecdsaprysm "github.com/prysmaticlabs/prysm/v5/crypto/ecdsa" + "github.com/prysmaticlabs/prysm/v5/runtime/version" ) +type internetProtocol string + +const ( + udp = "udp" + tcp = "tcp" + quic = "quic" +) + // MultiAddressBuilder takes in an ip address string and port to produce a go multiaddr format. -func MultiAddressBuilder(ipAddr string, port uint) (ma.Multiaddr, error) { - parsedIP := net.ParseIP(ipAddr) - if parsedIP.To4() == nil && parsedIP.To16() == nil { - return nil, errors.Errorf("invalid ip address provided: %s", ipAddr) +func MultiAddressBuilder(ip net.IP, tcpPort, quicPort uint) ([]ma.Multiaddr, error) { + ipType, err := extractIpType(ip) + if err != nil { + return nil, errors.Wrap(err, "unable to determine IP type") + } + + // Example: /ip4/1.2.3.4./tcp/5678 + multiaddrStr := fmt.Sprintf("/%s/%s/tcp/%d", ipType, ip, tcpPort) + multiAddrTCP, err := ma.NewMultiaddr(multiaddrStr) + if err != nil { + return nil, errors.Wrapf(err, "cannot produce TCP multiaddr format from %s:%d", ip, tcpPort) } - if parsedIP.To4() != nil { - return ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", ipAddr, port)) + + multiaddrs := []ma.Multiaddr{multiAddrTCP} + + if features.Get().EnableQUIC { + // Example: /ip4/1.2.3.4/udp/5678/quic-v1 + multiAddrQUIC, err := ma.NewMultiaddr(fmt.Sprintf("/%s/%s/udp/%d/quic-v1", ipType, ip, quicPort)) + if err != nil { + return nil, errors.Wrapf(err, "cannot produce QUIC multiaddr format from %s:%d", ip, tcpPort) + } + + multiaddrs = append(multiaddrs, multiAddrQUIC) } - return ma.NewMultiaddr(fmt.Sprintf("/ip6/%s/tcp/%d", ipAddr, port)) + + return multiaddrs, nil } // buildOptions for the libp2p host. func (s *Service) buildOptions(ip net.IP, priKey *ecdsa.PrivateKey) ([]libp2p.Option, error) { cfg := s.cfg - listen, err := MultiAddressBuilder(ip.String(), cfg.TCPPort) + multiaddrs, err := MultiAddressBuilder(ip, cfg.TCPPort, cfg.QUICPort) if err != nil { - return nil, errors.Wrapf(err, "cannot produce multiaddr format from %s:%d", ip.String(), cfg.TCPPort) + return nil, errors.Wrapf(err, "cannot produce multiaddr format from %s:%d", ip, cfg.TCPPort) } if cfg.LocalIP != "" { - if net.ParseIP(cfg.LocalIP) == nil { + localIP := net.ParseIP(cfg.LocalIP) + if localIP == nil { return nil, errors.Wrapf(err, "invalid local ip provided: %s:%d", cfg.LocalIP, cfg.TCPPort) } - listen, err = MultiAddressBuilder(cfg.LocalIP, cfg.TCPPort) + multiaddrs, err = MultiAddressBuilder(localIP, cfg.TCPPort, cfg.QUICPort) if err != nil { return nil, errors.Wrapf(err, "cannot produce multiaddr format from %s:%d", cfg.LocalIP, cfg.TCPPort) } @@ -58,40 +86,47 @@ func (s *Service) buildOptions(ip net.IP, priKey *ecdsa.PrivateKey) ([]libp2p.Op return nil, errors.Wrapf(err, "cannot get ID from public key: %s", ifaceKey.GetPublic().Type().String()) } - log.Infof("Running node with peer id of %s ", id.String()) + log.WithField("peerId", id).Info("Running node with") options := []libp2p.Option{ privKeyOption(priKey), - libp2p.ListenAddrs(listen), + libp2p.ListenAddrs(multiaddrs...), libp2p.UserAgent(version.BuildData()), libp2p.ConnectionGater(s), - libp2p.Transport(tcp.NewTCPTransport), + libp2p.Transport(libp2ptcp.NewTCPTransport), libp2p.DefaultMuxers, libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), libp2p.Security(noise.ID, noise.New), libp2p.Ping(false), // Disable Ping Service. } + if features.Get().EnableQUIC { + options = append(options, libp2p.Transport(libp2pquic.NewTransport)) + } + if cfg.EnableUPnP { options = append(options, libp2p.NATPortMap()) // Allow to use UPnP } + if cfg.RelayNodeAddr != "" { options = append(options, libp2p.AddrsFactory(withRelayAddrs(cfg.RelayNodeAddr))) } else { // Disable relay if it has not been set. options = append(options, libp2p.DisableRelay()) } + if cfg.HostAddress != "" { options = append(options, libp2p.AddrsFactory(func(addrs []ma.Multiaddr) []ma.Multiaddr { - external, err := MultiAddressBuilder(cfg.HostAddress, cfg.TCPPort) + externalMultiaddrs, err := MultiAddressBuilder(net.ParseIP(cfg.HostAddress), cfg.TCPPort, cfg.QUICPort) if err != nil { log.WithError(err).Error("Unable to create external multiaddress") } else { - addrs = append(addrs, external) + addrs = append(addrs, externalMultiaddrs...) } return addrs })) } + if cfg.HostDNS != "" { options = append(options, libp2p.AddrsFactory(func(addrs []ma.Multiaddr) []ma.Multiaddr { external, err := ma.NewMultiaddr(fmt.Sprintf("/dns4/%s/tcp/%d", cfg.HostDNS, cfg.TCPPort)) @@ -107,21 +142,47 @@ func (s *Service) buildOptions(ip net.IP, priKey *ecdsa.PrivateKey) ([]libp2p.Op if features.Get().DisableResourceManager { options = append(options, libp2p.ResourceManager(&network.NullResourceManager{})) } + return options, nil } -func multiAddressBuilderWithID(ipAddr, protocol string, port uint, id peer.ID) (ma.Multiaddr, error) { - parsedIP := net.ParseIP(ipAddr) - if parsedIP.To4() == nil && parsedIP.To16() == nil { - return nil, errors.Errorf("invalid ip address provided: %s", ipAddr) +func extractIpType(ip net.IP) (string, error) { + if ip.To4() != nil { + return "ip4", nil + } + + if ip.To16() != nil { + return "ip6", nil + } + + return "", errors.Errorf("provided IP address is neither IPv4 nor IPv6: %s", ip) +} + +func multiAddressBuilderWithID(ip net.IP, protocol internetProtocol, port uint, id peer.ID) (ma.Multiaddr, error) { + var multiaddrStr string + + if id == "" { + return nil, errors.Errorf("empty peer id given: %s", id) } - if id.String() == "" { - return nil, errors.New("empty peer id given") + + ipType, err := extractIpType(ip) + if err != nil { + return nil, errors.Wrap(err, "unable to determine IP type") } - if parsedIP.To4() != nil { - return ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/%s/%d/p2p/%s", ipAddr, protocol, port, id.String())) + + switch protocol { + case udp, tcp: + // Example with UDP: /ip4/1.2.3.4/udp/5678/p2p/16Uiu2HAkum7hhuMpWqFj3yNLcmQBGmThmqw2ohaCRThXQuKU9ohs + // Example with TCP: /ip6/1.2.3.4/tcp/5678/p2p/16Uiu2HAkum7hhuMpWqFj3yNLcmQBGmThmqw2ohaCRThXQuKU9ohs + multiaddrStr = fmt.Sprintf("/%s/%s/%s/%d/p2p/%s", ipType, ip, protocol, port, id) + case quic: + // Example: /ip4/1.2.3.4/udp/5678/quic-v1/p2p/16Uiu2HAkum7hhuMpWqFj3yNLcmQBGmThmqw2ohaCRThXQuKU9ohs + multiaddrStr = fmt.Sprintf("/%s/%s/udp/%d/quic-v1/p2p/%s", ipType, ip, port, id) + default: + return nil, errors.Errorf("unsupported protocol: %s", protocol) } - return ma.NewMultiaddr(fmt.Sprintf("/ip6/%s/%s/%d/p2p/%s", ipAddr, protocol, port, id.String())) + + return ma.NewMultiaddr(multiaddrStr) } // Adds a private key to the libp2p option if the option was provided. diff --git a/beacon-chain/p2p/options_test.go b/beacon-chain/p2p/options_test.go index 07b80e2b6897..89a7fd854bf6 100644 --- a/beacon-chain/p2p/options_test.go +++ b/beacon-chain/p2p/options_test.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/enr" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -88,30 +89,34 @@ func TestIPV6Support(t *testing.T) { lNode := enode.NewLocalNode(db, key) mockIPV6 := net.IP{0xff, 0x02, 0xAA, 0, 0x1F, 0, 0x2E, 0, 0, 0x36, 0x45, 0, 0, 0, 0, 0x02} lNode.Set(enr.IP(mockIPV6)) - ma, err := convertToSingleMultiAddr(lNode.Node()) + mas, err := retrieveMultiAddrsFromNode(lNode.Node()) if err != nil { t.Fatal(err) } - ipv6Exists := false - for _, p := range ma.Protocols() { - if p.Name == "ip4" { - t.Error("Got ip4 address instead of ip6") + + for _, ma := range mas { + ipv6Exists := false + for _, p := range ma.Protocols() { + if p.Name == "ip4" { + t.Error("Got ip4 address instead of ip6") + } + if p.Name == "ip6" { + ipv6Exists = true + } } - if p.Name == "ip6" { - ipv6Exists = true + if !ipv6Exists { + t.Error("Multiaddress did not have ipv6 protocol") } } - if !ipv6Exists { - t.Error("Multiaddress did not have ipv6 protocol") - } } func TestDefaultMultiplexers(t *testing.T) { var cfg libp2p.Config _ = cfg p2pCfg := &Config{ - TCPPort: 2000, UDPPort: 2000, + TCPPort: 3000, + QUICPort: 3000, StateNotifier: &mock.MockStateNotifier{}, } svc := &Service{cfg: p2pCfg} @@ -127,5 +132,57 @@ func TestDefaultMultiplexers(t *testing.T) { assert.Equal(t, protocol.ID("/yamux/1.0.0"), cfg.Muxers[0].ID) assert.Equal(t, protocol.ID("/mplex/6.7.0"), cfg.Muxers[1].ID) +} + +func TestMultiAddressBuilderWithID(t *testing.T) { + testCases := []struct { + name string + ip net.IP + protocol internetProtocol + port uint + id string + + expectedMultiaddrStr string + }{ + { + name: "UDP", + ip: net.IPv4(192, 168, 0, 1), + protocol: udp, + port: 5678, + id: "0025080212210204fb1ebb1aa467527d34306a4794a5171d6516405e720b909b7f816d63aef96a", + + expectedMultiaddrStr: "/ip4/192.168.0.1/udp/5678/p2p/16Uiu2HAkum7hhuMpWqFj3yNLcmQBGmThmqw2ohaCRThXQuKU9ohs", + }, + { + name: "TCP", + ip: net.IPv4(192, 168, 0, 1), + protocol: tcp, + port: 5678, + id: "0025080212210204fb1ebb1aa467527d34306a4794a5171d6516405e720b909b7f816d63aef96a", + expectedMultiaddrStr: "/ip4/192.168.0.1/tcp/5678/p2p/16Uiu2HAkum7hhuMpWqFj3yNLcmQBGmThmqw2ohaCRThXQuKU9ohs", + }, + { + name: "QUIC", + ip: net.IPv4(192, 168, 0, 1), + protocol: quic, + port: 5678, + id: "0025080212210204fb1ebb1aa467527d34306a4794a5171d6516405e720b909b7f816d63aef96a", + + expectedMultiaddrStr: "/ip4/192.168.0.1/udp/5678/quic-v1/p2p/16Uiu2HAkum7hhuMpWqFj3yNLcmQBGmThmqw2ohaCRThXQuKU9ohs", + }, + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + id, err := hex.DecodeString(tt.id) + require.NoError(t, err) + + actualMultiaddr, err := multiAddressBuilderWithID(tt.ip, tt.protocol, tt.port, peer.ID(id)) + require.NoError(t, err) + + actualMultiaddrStr := actualMultiaddr.String() + require.Equal(t, tt.expectedMultiaddrStr, actualMultiaddrStr) + }) + } } diff --git a/beacon-chain/p2p/peers/status.go b/beacon-chain/p2p/peers/status.go index 7e487fa2a790..3dda2df28815 100644 --- a/beacon-chain/p2p/peers/status.go +++ b/beacon-chain/p2p/peers/status.go @@ -26,6 +26,7 @@ import ( "context" "math" "sort" + "strings" "time" "github.com/ethereum/go-ethereum/p2p/enr" @@ -76,6 +77,13 @@ const ( MaxBackOffDuration = 5000 ) +type InternetProtocol string + +const ( + TCP = "tcp" + QUIC = "quic" +) + // Status is the structure holding the peer status information. type Status struct { ctx context.Context @@ -449,6 +457,19 @@ func (p *Status) InboundConnected() []peer.ID { return peers } +// InboundConnectedWithProtocol returns the current batch of inbound peers that are connected with a given protocol. +func (p *Status) InboundConnectedWithProtocol(protocol InternetProtocol) []peer.ID { + p.store.RLock() + defer p.store.RUnlock() + peers := make([]peer.ID, 0) + for pid, peerData := range p.store.Peers() { + if peerData.ConnState == PeerConnected && peerData.Direction == network.DirInbound && strings.Contains(peerData.Address.String(), string(protocol)) { + peers = append(peers, pid) + } + } + return peers +} + // Outbound returns the current batch of outbound peers. func (p *Status) Outbound() []peer.ID { p.store.RLock() @@ -475,7 +496,20 @@ func (p *Status) OutboundConnected() []peer.ID { return peers } -// Active returns the peers that are connecting or connected. +// OutboundConnectedWithProtocol returns the current batch of outbound peers that are connected with a given protocol. +func (p *Status) OutboundConnectedWithProtocol(protocol InternetProtocol) []peer.ID { + p.store.RLock() + defer p.store.RUnlock() + peers := make([]peer.ID, 0) + for pid, peerData := range p.store.Peers() { + if peerData.ConnState == PeerConnected && peerData.Direction == network.DirOutbound && strings.Contains(peerData.Address.String(), string(protocol)) { + peers = append(peers, pid) + } + } + return peers +} + +// Active returns the peers that are active (connecting or connected). func (p *Status) Active() []peer.ID { p.store.RLock() defer p.store.RUnlock() @@ -514,7 +548,7 @@ func (p *Status) Disconnected() []peer.ID { return peers } -// Inactive returns the peers that are disconnecting or disconnected. +// Inactive returns the peers that are inactive (disconnecting or disconnected). func (p *Status) Inactive() []peer.ID { p.store.RLock() defer p.store.RUnlock() diff --git a/beacon-chain/p2p/peers/status_test.go b/beacon-chain/p2p/peers/status_test.go index 2a19b9644728..ae57af71f107 100644 --- a/beacon-chain/p2p/peers/status_test.go +++ b/beacon-chain/p2p/peers/status_test.go @@ -1111,6 +1111,87 @@ func TestInbound(t *testing.T) { assert.Equal(t, inbound.String(), result[0].String()) } +func TestInboundConnected(t *testing.T) { + p := peers.NewStatus(context.Background(), &peers.StatusConfig{ + PeerLimit: 30, + ScorerParams: &scorers.Config{ + BadResponsesScorerConfig: &scorers.BadResponsesScorerConfig{ + Threshold: 0, + }, + }, + }) + + addr, err := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/33333") + require.NoError(t, err) + inbound := createPeer(t, p, addr, network.DirInbound, peers.PeerConnected) + createPeer(t, p, addr, network.DirInbound, peers.PeerConnecting) + + result := p.InboundConnected() + require.Equal(t, 1, len(result)) + assert.Equal(t, inbound.String(), result[0].String()) +} + +func TestInboundConnectedWithProtocol(t *testing.T) { + p := peers.NewStatus(context.Background(), &peers.StatusConfig{ + PeerLimit: 30, + ScorerParams: &scorers.Config{ + BadResponsesScorerConfig: &scorers.BadResponsesScorerConfig{ + Threshold: 0, + }, + }, + }) + + addrsTCP := []string{ + "/ip4/127.0.0.1/tcp/33333", + "/ip4/127.0.0.2/tcp/44444", + } + + addrsQUIC := []string{ + "/ip4/192.168.1.3/udp/13000/quic-v1", + "/ip4/192.168.1.4/udp/14000/quic-v1", + "/ip4/192.168.1.5/udp/14000/quic-v1", + } + + expectedTCP := make(map[string]bool, len(addrsTCP)) + for _, addr := range addrsTCP { + multiaddr, err := ma.NewMultiaddr(addr) + require.NoError(t, err) + + peer := createPeer(t, p, multiaddr, network.DirInbound, peers.PeerConnected) + expectedTCP[peer.String()] = true + } + + expectedQUIC := make(map[string]bool, len(addrsQUIC)) + for _, addr := range addrsQUIC { + multiaddr, err := ma.NewMultiaddr(addr) + require.NoError(t, err) + + peer := createPeer(t, p, multiaddr, network.DirInbound, peers.PeerConnected) + expectedQUIC[peer.String()] = true + } + + // TCP + // --- + + actualTCP := p.InboundConnectedWithProtocol(peers.TCP) + require.Equal(t, len(expectedTCP), len(actualTCP)) + + for _, actualPeer := range actualTCP { + _, ok := expectedTCP[actualPeer.String()] + require.Equal(t, true, ok) + } + + // QUIC + // ---- + actualQUIC := p.InboundConnectedWithProtocol(peers.QUIC) + require.Equal(t, len(expectedQUIC), len(actualQUIC)) + + for _, actualPeer := range actualQUIC { + _, ok := expectedQUIC[actualPeer.String()] + require.Equal(t, true, ok) + } +} + func TestOutbound(t *testing.T) { p := peers.NewStatus(context.Background(), &peers.StatusConfig{ PeerLimit: 30, @@ -1130,6 +1211,87 @@ func TestOutbound(t *testing.T) { assert.Equal(t, outbound.String(), result[0].String()) } +func TestOutboundConnected(t *testing.T) { + p := peers.NewStatus(context.Background(), &peers.StatusConfig{ + PeerLimit: 30, + ScorerParams: &scorers.Config{ + BadResponsesScorerConfig: &scorers.BadResponsesScorerConfig{ + Threshold: 0, + }, + }, + }) + + addr, err := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/33333") + require.NoError(t, err) + inbound := createPeer(t, p, addr, network.DirOutbound, peers.PeerConnected) + createPeer(t, p, addr, network.DirOutbound, peers.PeerConnecting) + + result := p.OutboundConnected() + require.Equal(t, 1, len(result)) + assert.Equal(t, inbound.String(), result[0].String()) +} + +func TestOutboundConnectedWithProtocol(t *testing.T) { + p := peers.NewStatus(context.Background(), &peers.StatusConfig{ + PeerLimit: 30, + ScorerParams: &scorers.Config{ + BadResponsesScorerConfig: &scorers.BadResponsesScorerConfig{ + Threshold: 0, + }, + }, + }) + + addrsTCP := []string{ + "/ip4/127.0.0.1/tcp/33333", + "/ip4/127.0.0.2/tcp/44444", + } + + addrsQUIC := []string{ + "/ip4/192.168.1.3/udp/13000/quic-v1", + "/ip4/192.168.1.4/udp/14000/quic-v1", + "/ip4/192.168.1.5/udp/14000/quic-v1", + } + + expectedTCP := make(map[string]bool, len(addrsTCP)) + for _, addr := range addrsTCP { + multiaddr, err := ma.NewMultiaddr(addr) + require.NoError(t, err) + + peer := createPeer(t, p, multiaddr, network.DirOutbound, peers.PeerConnected) + expectedTCP[peer.String()] = true + } + + expectedQUIC := make(map[string]bool, len(addrsQUIC)) + for _, addr := range addrsQUIC { + multiaddr, err := ma.NewMultiaddr(addr) + require.NoError(t, err) + + peer := createPeer(t, p, multiaddr, network.DirOutbound, peers.PeerConnected) + expectedQUIC[peer.String()] = true + } + + // TCP + // --- + + actualTCP := p.OutboundConnectedWithProtocol(peers.TCP) + require.Equal(t, len(expectedTCP), len(actualTCP)) + + for _, actualPeer := range actualTCP { + _, ok := expectedTCP[actualPeer.String()] + require.Equal(t, true, ok) + } + + // QUIC + // ---- + actualQUIC := p.OutboundConnectedWithProtocol(peers.QUIC) + require.Equal(t, len(expectedQUIC), len(actualQUIC)) + + for _, actualPeer := range actualQUIC { + _, ok := expectedQUIC[actualPeer.String()] + require.Equal(t, true, ok) + } +} + // addPeer is a helper to add a peer with a given connection state) func addPeer(t *testing.T, p *peers.Status, state peerdata.PeerConnectionState) peer.ID { // Set up some peers with different states diff --git a/beacon-chain/p2p/service.go b/beacon-chain/p2p/service.go index f87a99aa1f07..8192d9b0b67f 100644 --- a/beacon-chain/p2p/service.go +++ b/beacon-chain/p2p/service.go @@ -24,6 +24,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/scorers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" + "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" leakybucket "github.com/prysmaticlabs/prysm/v5/container/leaky-bucket" prysmnetwork "github.com/prysmaticlabs/prysm/v5/network" @@ -124,31 +125,34 @@ func NewService(ctx context.Context, cfg *Config) (*Service, error) { if err != nil { return nil, errors.Wrapf(err, "failed to build p2p options") } + // Sets mplex timeouts configureMplex() h, err := libp2p.New(opts...) if err != nil { - log.WithError(err).Error("Failed to create p2p host") - return nil, err + return nil, errors.Wrapf(err, "failed to create p2p host") } s.host = h + // Gossipsub registration is done before we add in any new peers // due to libp2p's gossipsub implementation not taking into // account previously added peers when creating the gossipsub // object. psOpts := s.pubsubOptions() + // Set the pubsub global parameters that we require. setPubSubParameters() + // Reinitialize them in the event we are running a custom config. attestationSubnetCount = params.BeaconConfig().AttestationSubnetCount syncCommsSubnetCount = params.BeaconConfig().SyncCommitteeSubnetCount gs, err := pubsub.NewGossipSub(s.ctx, s.host, psOpts...) if err != nil { - log.WithError(err).Error("Failed to start pubsub") - return nil, err + return nil, errors.Wrapf(err, "failed to create p2p pubsub") } + s.pubsub = gs s.peers = peers.NewStatus(ctx, &peers.StatusConfig{ @@ -213,7 +217,7 @@ func (s *Service) Start() { if len(s.cfg.StaticPeers) > 0 { addrs, err := PeersFromStringAddrs(s.cfg.StaticPeers) if err != nil { - log.WithError(err).Error("Could not connect to static peer") + log.WithError(err).Error("could not convert ENR to multiaddr") } // Set trusted peers for those that are provided as static addresses. pids := peerIdsFromMultiAddrs(addrs) @@ -232,11 +236,24 @@ func (s *Service) Start() { async.RunEvery(s.ctx, time.Duration(params.BeaconConfig().RespTimeout)*time.Second, s.updateMetrics) async.RunEvery(s.ctx, refreshRate, s.RefreshENR) async.RunEvery(s.ctx, 1*time.Minute, func() { - log.WithFields(logrus.Fields{ - "inbound": len(s.peers.InboundConnected()), - "outbound": len(s.peers.OutboundConnected()), - "activePeers": len(s.peers.Active()), - }).Info("Peer summary") + inboundQUICCount := len(s.peers.InboundConnectedWithProtocol(peers.QUIC)) + inboundTCPCount := len(s.peers.InboundConnectedWithProtocol(peers.TCP)) + outboundQUICCount := len(s.peers.OutboundConnectedWithProtocol(peers.QUIC)) + outboundTCPCount := len(s.peers.OutboundConnectedWithProtocol(peers.TCP)) + total := inboundQUICCount + inboundTCPCount + outboundQUICCount + outboundTCPCount + + fields := logrus.Fields{ + "inboundTCP": inboundTCPCount, + "outboundTCP": outboundTCPCount, + "total": total, + } + + if features.Get().EnableQUIC { + fields["inboundQUIC"] = inboundQUICCount + fields["outboundQUIC"] = outboundQUICCount + } + + log.WithFields(fields).Info("Connected peers") }) multiAddrs := s.host.Network().ListenAddresses() @@ -244,9 +261,10 @@ func (s *Service) Start() { p2pHostAddress := s.cfg.HostAddress p2pTCPPort := s.cfg.TCPPort + p2pQUICPort := s.cfg.QUICPort if p2pHostAddress != "" { - logExternalIPAddr(s.host.ID(), p2pHostAddress, p2pTCPPort) + logExternalIPAddr(s.host.ID(), p2pHostAddress, p2pTCPPort, p2pQUICPort) verifyConnectivity(p2pHostAddress, p2pTCPPort, "tcp") } diff --git a/beacon-chain/p2p/service_test.go b/beacon-chain/p2p/service_test.go index 7eabd44a3767..c09ad1db6407 100644 --- a/beacon-chain/p2p/service_test.go +++ b/beacon-chain/p2p/service_test.go @@ -102,8 +102,9 @@ func TestService_Start_OnlyStartsOnce(t *testing.T) { cs := startup.NewClockSynchronizer() cfg := &Config{ - TCPPort: 2000, UDPPort: 2000, + TCPPort: 3000, + QUICPort: 3000, ClockWaiter: cs, } s, err := NewService(context.Background(), cfg) @@ -147,8 +148,9 @@ func TestService_Start_NoDiscoverFlag(t *testing.T) { cs := startup.NewClockSynchronizer() cfg := &Config{ - TCPPort: 2000, UDPPort: 2000, + TCPPort: 3000, + QUICPort: 3000, StateNotifier: &mock.MockStateNotifier{}, NoDiscovery: true, // <-- no s.dv5Listener is created ClockWaiter: cs, diff --git a/beacon-chain/p2p/subnets.go b/beacon-chain/p2p/subnets.go index 8d313db8f558..2c6262232a00 100644 --- a/beacon-chain/p2p/subnets.go +++ b/beacon-chain/p2p/subnets.go @@ -93,6 +93,11 @@ func (s *Service) FindPeersWithSubnet(ctx context.Context, topic string, if err != nil { continue } + + if info == nil { + continue + } + wg.Add(1) go func() { if err := s.connectWithPeer(ctx, *info); err != nil { diff --git a/beacon-chain/p2p/subnets_test.go b/beacon-chain/p2p/subnets_test.go index 92f0b38107e0..2b270f731557 100644 --- a/beacon-chain/p2p/subnets_test.go +++ b/beacon-chain/p2p/subnets_test.go @@ -66,7 +66,7 @@ func TestStartDiscV5_FindPeersWithSubnet(t *testing.T) { genesisTime := time.Now() bootNodeService := &Service{ - cfg: &Config{TCPPort: 2000, UDPPort: 3000}, + cfg: &Config{UDPPort: 2000, TCPPort: 3000, QUICPort: 3000}, genesisTime: genesisTime, genesisValidatorsRoot: genesisValidatorsRoot, } @@ -89,8 +89,9 @@ func TestStartDiscV5_FindPeersWithSubnet(t *testing.T) { service, err := NewService(ctx, &Config{ Discv5BootStrapAddrs: []string{bootNodeENR}, MaxPeers: 30, - TCPPort: uint(2000 + i), - UDPPort: uint(3000 + i), + UDPPort: uint(2000 + i), + TCPPort: uint(3000 + i), + QUICPort: uint(3000 + i), }) require.NoError(t, err) @@ -133,8 +134,9 @@ func TestStartDiscV5_FindPeersWithSubnet(t *testing.T) { cfg := &Config{ Discv5BootStrapAddrs: []string{bootNodeENR}, MaxPeers: 30, - TCPPort: 2010, - UDPPort: 3010, + UDPPort: 2010, + TCPPort: 3010, + QUICPort: 3010, } service, err := NewService(ctx, cfg) diff --git a/beacon-chain/p2p/watch_peers.go b/beacon-chain/p2p/watch_peers.go index 59141b177d8f..0b493570e97a 100644 --- a/beacon-chain/p2p/watch_peers.go +++ b/beacon-chain/p2p/watch_peers.go @@ -50,7 +50,7 @@ func ensurePeerConnections(ctx context.Context, h host.Host, peers *peers.Status c := h.Network().ConnsToPeer(p.ID) if len(c) == 0 { if err := connectWithTimeout(ctx, h, p); err != nil { - log.WithField("peer", p.ID).WithField("addrs", p.Addrs).WithError(err).Errorf("Failed to reconnect to peer") + log.WithField("peer", p.ID).WithField("addrs", p.Addrs).WithError(err).Errorf("failed to reconnect to peer") continue } } diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index 9f3bd6ef3786..fb6e0530c909 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -142,7 +142,13 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { // it successfully writes a response. We don't blindly call // Close here because we may have only written a partial // response. + // About the special case for quic-v1, please see: + // https://github.com/quic-go/quic-go/issues/3291 defer func() { + if strings.Contains(stream.Conn().RemoteMultiaddr().String(), "quic-v1") { + time.Sleep(2 * time.Second) + } + _err := stream.Reset() _ = _err }() diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 56a10b5903df..c7dec5e72431 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -90,6 +90,7 @@ var appFlags = []cli.Flag{ cmd.StaticPeers, cmd.RelayNode, cmd.P2PUDPPort, + cmd.P2PQUICPort, cmd.P2PTCPPort, cmd.P2PIP, cmd.P2PHost, diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index c07e49380b41..adc4c87a3085 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -55,6 +55,7 @@ var appHelpFlagGroups = []flagGroup{ cmd.BootstrapNode, cmd.RelayNode, cmd.P2PUDPPort, + cmd.P2PQUICPort, cmd.P2PTCPPort, cmd.DataDirFlag, cmd.VerbosityFlag, diff --git a/cmd/flags.go b/cmd/flags.go index ccd907a3a99d..bd7d135f6a0f 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -113,13 +113,19 @@ var ( // P2PUDPPort defines the port to be used by discv5. P2PUDPPort = &cli.IntFlag{ Name: "p2p-udp-port", - Usage: "The port used by discv5.", + Usage: "The UDP port used by the discovery service discv5.", Value: 12000, } - // P2PTCPPort defines the port to be used by libp2p. + // P2PQUICPort defines the QUIC port to be used by libp2p. + P2PQUICPort = &cli.IntFlag{ + Name: "p2p-quic-port", + Usage: "The QUIC port used by libp2p.", + Value: 13000, + } + // P2PTCPPort defines the TCP port to be used by libp2p. P2PTCPPort = &cli.IntFlag{ Name: "p2p-tcp-port", - Usage: "The port used by libp2p.", + Usage: "The TCP port used by libp2p.", Value: 13000, } // P2PIP defines the local IP to be used by libp2p. diff --git a/cmd/prysmctl/p2p/BUILD.bazel b/cmd/prysmctl/p2p/BUILD.bazel index ec19ed30c0d9..bb04938b454f 100644 --- a/cmd/prysmctl/p2p/BUILD.bazel +++ b/cmd/prysmctl/p2p/BUILD.bazel @@ -43,6 +43,7 @@ go_library( "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_libp2p_go_libp2p//core/protocol:go_default_library", "@com_github_libp2p_go_libp2p//p2p/security/noise:go_default_library", + "@com_github_libp2p_go_libp2p//p2p/transport/quic:go_default_library", "@com_github_libp2p_go_libp2p//p2p/transport/tcp:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", diff --git a/cmd/prysmctl/p2p/client.go b/cmd/prysmctl/p2p/client.go index ede67c8595e4..146e7f0ef365 100644 --- a/cmd/prysmctl/p2p/client.go +++ b/cmd/prysmctl/p2p/client.go @@ -14,7 +14,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/libp2p/go-libp2p/p2p/security/noise" - "github.com/libp2p/go-libp2p/p2p/transport/tcp" + libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic" + libp2ptcp "github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" @@ -43,7 +44,7 @@ type client struct { nodeClient pb.NodeClient } -func newClient(beaconEndpoints []string, clientPort uint) (*client, error) { +func newClient(beaconEndpoints []string, tcpPort, quicPort uint) (*client, error) { ipAdd := ipAddr() priv, err := privKey() if err != nil { @@ -53,15 +54,16 @@ func newClient(beaconEndpoints []string, clientPort uint) (*client, error) { if err != nil { return nil, errors.Wrap(err, "could not set up p2p metadata") } - listen, err := p2p.MultiAddressBuilder(ipAdd.String(), clientPort) + multiaddrs, err := p2p.MultiAddressBuilder(ipAdd, tcpPort, quicPort) if err != nil { return nil, errors.Wrap(err, "could not set up listening multiaddr") } options := []libp2p.Option{ privKeyOption(priv), - libp2p.ListenAddrs(listen), + libp2p.ListenAddrs(multiaddrs...), libp2p.UserAgent(version.BuildData()), - libp2p.Transport(tcp.NewTCPTransport), + libp2p.Transport(libp2pquic.NewTransport), + libp2p.Transport(libp2ptcp.NewTCPTransport), } options = append(options, libp2p.Security(noise.ID, noise.New)) options = append(options, libp2p.Ping(false)) diff --git a/cmd/prysmctl/p2p/request_blobs.go b/cmd/prysmctl/p2p/request_blobs.go index 95eae8a6907f..50c9efda259e 100644 --- a/cmd/prysmctl/p2p/request_blobs.go +++ b/cmd/prysmctl/p2p/request_blobs.go @@ -22,11 +22,12 @@ import ( ) var requestBlobsFlags = struct { - Peers string - ClientPort uint - APIEndpoints string - StartSlot uint64 - Count uint64 + Peers string + ClientPortTCP uint + ClientPortQUIC uint + APIEndpoints string + StartSlot uint64 + Count uint64 }{} var requestBlobsCmd = &cli.Command{ @@ -47,9 +48,16 @@ var requestBlobsCmd = &cli.Command{ Value: "", }, &cli.UintFlag{ - Name: "client-port", - Usage: "port to use for the client as a libp2p host", - Destination: &requestBlobsFlags.ClientPort, + Name: "client-port-tcp", + Aliases: []string{"client-port"}, + Usage: "TCP port to use for the client as a libp2p host", + Destination: &requestBlobsFlags.ClientPortTCP, + Value: 13001, + }, + &cli.UintFlag{ + Name: "client-port-quic", + Usage: "QUIC port to use for the client as a libp2p host", + Destination: &requestBlobsFlags.ClientPortQUIC, Value: 13001, }, &cli.StringFlag{ @@ -60,13 +68,13 @@ var requestBlobsCmd = &cli.Command{ }, &cli.Uint64Flag{ Name: "start-slot", - Usage: "start slot for blocks by range request. If unset, will use start_slot(current_epoch-1)", + Usage: "start slot for blobs by range request. If unset, will use start_slot(current_epoch-1)", Destination: &requestBlobsFlags.StartSlot, Value: 0, }, &cli.Uint64Flag{ Name: "count", - Usage: "number of blocks to request, (default 32)", + Usage: "number of blobs to request, (default 32)", Destination: &requestBlobsFlags.Count, Value: 32, }, @@ -90,7 +98,7 @@ func cliActionRequestBlobs(cliCtx *cli.Context) error { allAPIEndpoints = strings.Split(requestBlobsFlags.APIEndpoints, ",") } var err error - c, err := newClient(allAPIEndpoints, requestBlobsFlags.ClientPort) + c, err := newClient(allAPIEndpoints, requestBlobsFlags.ClientPortTCP, requestBlobsFlags.ClientPortQUIC) if err != nil { return err } diff --git a/cmd/prysmctl/p2p/request_blocks.go b/cmd/prysmctl/p2p/request_blocks.go index 47d6ae417a93..de14d33facdf 100644 --- a/cmd/prysmctl/p2p/request_blocks.go +++ b/cmd/prysmctl/p2p/request_blocks.go @@ -23,12 +23,14 @@ import ( ) var requestBlocksFlags = struct { - Peers string - ClientPort uint - APIEndpoints string - StartSlot uint64 - Count uint64 - Step uint64 + Network string + Peers string + ClientPortTCP uint + ClientPortQUIC uint + APIEndpoints string + StartSlot uint64 + Count uint64 + Step uint64 }{} var requestBlocksCmd = &cli.Command{ @@ -42,6 +44,12 @@ var requestBlocksCmd = &cli.Command{ }, Flags: []cli.Flag{ cmd.ChainConfigFileFlag, + &cli.StringFlag{ + Name: "network", + Usage: "network to run on (mainnet, sepolia, holesky)", + Destination: &requestBlocksFlags.Network, + Value: "mainnet", + }, &cli.StringFlag{ Name: "peer-multiaddrs", Usage: "comma-separated, peer multiaddr(s) to connect to for p2p requests", @@ -49,9 +57,16 @@ var requestBlocksCmd = &cli.Command{ Value: "", }, &cli.UintFlag{ - Name: "client-port", - Usage: "port to use for the client as a libp2p host", - Destination: &requestBlocksFlags.ClientPort, + Name: "client-port-tcp", + Aliases: []string{"client-port"}, + Usage: "TCP port to use for the client as a libp2p host", + Destination: &requestBlocksFlags.ClientPortTCP, + Value: 13001, + }, + &cli.UintFlag{ + Name: "client-port-quic", + Usage: "QUIC port to use for the client as a libp2p host", + Destination: &requestBlocksFlags.ClientPortQUIC, Value: 13001, }, &cli.StringFlag{ @@ -82,6 +97,21 @@ var requestBlocksCmd = &cli.Command{ } func cliActionRequestBlocks(cliCtx *cli.Context) error { + switch requestBlocksFlags.Network { + case params.SepoliaName: + if err := params.SetActive(params.SepoliaConfig()); err != nil { + log.Fatal(err) + } + case params.HoleskyName: + if err := params.SetActive(params.HoleskyConfig()); err != nil { + log.Fatal(err) + } + case params.MainnetName: + // Do nothing + default: + log.Fatalf("Unknown network provided: %s", requestBlocksFlags.Network) + } + if cliCtx.IsSet(cmd.ChainConfigFileFlag.Name) { chainConfigFileName := cliCtx.String(cmd.ChainConfigFileFlag.Name) if err := params.LoadChainConfigFile(chainConfigFileName, nil); err != nil { @@ -98,7 +128,7 @@ func cliActionRequestBlocks(cliCtx *cli.Context) error { allAPIEndpoints = strings.Split(requestBlocksFlags.APIEndpoints, ",") } var err error - c, err := newClient(allAPIEndpoints, requestBlocksFlags.ClientPort) + c, err := newClient(allAPIEndpoints, requestBlocksFlags.ClientPortTCP, requestBlocksFlags.ClientPortQUIC) if err != nil { return err } diff --git a/config/features/config.go b/config/features/config.go index 521d18130227..605f22bc007e 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -42,6 +42,7 @@ type Flags struct { WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory. EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p. EnableLightClient bool // EnableLightClient enables light client APIs. + EnableQUIC bool // EnableQUIC specifies whether to enable QUIC transport for libp2p. WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup. EnableDoppelGanger bool // EnableDoppelGanger enables doppelganger protection on startup for the validator. EnableHistoricalSpaceRepresentation bool // EnableHistoricalSpaceRepresentation enables the saving of registry validators in separate buckets to save space @@ -254,6 +255,10 @@ func ConfigureBeaconChain(ctx *cli.Context) error { logEnabled(BlobSaveFsync) cfg.BlobSaveFsync = true } + if ctx.IsSet(EnableQUIC.Name) { + logEnabled(EnableQUIC) + cfg.EnableQUIC = true + } cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value} Init(cfg) diff --git a/config/features/flags.go b/config/features/flags.go index 402e643e8186..44329b75a63a 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -103,8 +103,8 @@ var ( } enableDoppelGangerProtection = &cli.BoolFlag{ Name: "enable-doppelganger", - Usage: `Enables the validator to perform a doppelganger check. - This is not "a foolproof method to find duplicate instances in the network. + Usage: `Enables the validator to perform a doppelganger check. + This is not a foolproof method to find duplicate instances in the network. Your validator will still be vulnerable if it is being run in unsafe configurations.`, } disableStakinContractCheck = &cli.BoolFlag{ @@ -165,12 +165,18 @@ var ( Name: "blob-save-fsync", Usage: "Forces new blob files to be fysnc'd before continuing, ensuring durable blob writes.", } + // EnableQUIC enables connection using the QUIC protocol for peers which support it. + EnableQUIC = &cli.BoolFlag{ + Name: "enable-quic", + Usage: "Enables connection using the QUIC protocol for peers which support it.", + } ) // devModeFlags holds list of flags that are set when development mode is on. var devModeFlags = []cli.Flag{ enableExperimentalState, backfill.EnableExperimentalBackfill, + EnableQUIC, } // ValidatorFlags contains a list of all the feature flags that apply to the validator client. @@ -221,6 +227,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c DisableRegistrationCache, EnableLightClient, BlobSaveFsync, + EnableQUIC, }...)...) // E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E. diff --git a/testing/endtoend/components/beacon_node.go b/testing/endtoend/components/beacon_node.go index 5eb9273114c4..54638d9c5042 100644 --- a/testing/endtoend/components/beacon_node.go +++ b/testing/endtoend/components/beacon_node.go @@ -257,6 +257,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { fmt.Sprintf("--%s=%s", flags.ExecutionJWTSecretFlag.Name, jwtPath), fmt.Sprintf("--%s=%d", flags.MinSyncPeers.Name, 1), fmt.Sprintf("--%s=%d", cmdshared.P2PUDPPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeUDPPort+index), + fmt.Sprintf("--%s=%d", cmdshared.P2PQUICPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeQUICPort+index), fmt.Sprintf("--%s=%d", cmdshared.P2PTCPPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeTCPPort+index), fmt.Sprintf("--%s=%d", cmdshared.P2PMaxPeers.Name, expectedNumOfPeers), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.PrysmBeaconNodeMetricsPort+index), @@ -275,6 +276,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { "--" + cmdshared.ForceClearDB.Name, "--" + cmdshared.AcceptTosFlag.Name, "--" + flags.EnableDebugRPCEndpoints.Name, + "--" + features.EnableQUIC.Name, } if config.UsePprof { args = append(args, "--pprof", fmt.Sprintf("--pprofport=%d", e2e.TestParams.Ports.PrysmBeaconNodePprofPort+index)) @@ -313,7 +315,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { } if config.UseFixedPeerIDs { - peerId, err := helpers.FindFollowingTextInFile(stdOutFile, "Running node with peer id of ") + peerId, err := helpers.FindFollowingTextInFile(stdOutFile, "Running node with peerId=") if err != nil { return fmt.Errorf("could not find peer id: %w", err) } diff --git a/testing/endtoend/params/params.go b/testing/endtoend/params/params.go index ac63cc9f1376..ded1c9735b53 100644 --- a/testing/endtoend/params/params.go +++ b/testing/endtoend/params/params.go @@ -46,6 +46,7 @@ type ports struct { Eth1ProxyPort int PrysmBeaconNodeRPCPort int PrysmBeaconNodeUDPPort int + PrysmBeaconNodeQUICPort int PrysmBeaconNodeTCPPort int PrysmBeaconNodeGatewayPort int PrysmBeaconNodeMetricsPort int @@ -144,10 +145,11 @@ const ( PrysmBeaconNodeRPCPort = 4150 PrysmBeaconNodeUDPPort = PrysmBeaconNodeRPCPort + portSpan - PrysmBeaconNodeTCPPort = PrysmBeaconNodeRPCPort + 2*portSpan - PrysmBeaconNodeGatewayPort = PrysmBeaconNodeRPCPort + 3*portSpan - PrysmBeaconNodeMetricsPort = PrysmBeaconNodeRPCPort + 4*portSpan - PrysmBeaconNodePprofPort = PrysmBeaconNodeRPCPort + 5*portSpan + PrysmBeaconNodeQUICPort = PrysmBeaconNodeRPCPort + 2*portSpan + PrysmBeaconNodeTCPPort = PrysmBeaconNodeRPCPort + 3*portSpan + PrysmBeaconNodeGatewayPort = PrysmBeaconNodeRPCPort + 4*portSpan + PrysmBeaconNodeMetricsPort = PrysmBeaconNodeRPCPort + 5*portSpan + PrysmBeaconNodePprofPort = PrysmBeaconNodeRPCPort + 6*portSpan LighthouseBeaconNodeP2PPort = 5150 LighthouseBeaconNodeHTTPPort = LighthouseBeaconNodeP2PPort + portSpan @@ -330,6 +332,10 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR if err != nil { return err } + beaconNodeQUICPort, err := port(PrysmBeaconNodeQUICPort, shardCount, shardIndex, existingRegistrations) + if err != nil { + return err + } beaconNodeTCPPort, err := port(PrysmBeaconNodeTCPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err @@ -367,6 +373,7 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR ports.Eth1ProxyPort = eth1ProxyPort ports.PrysmBeaconNodeRPCPort = beaconNodeRPCPort ports.PrysmBeaconNodeUDPPort = beaconNodeUDPPort + ports.PrysmBeaconNodeQUICPort = beaconNodeQUICPort ports.PrysmBeaconNodeTCPPort = beaconNodeTCPPort ports.PrysmBeaconNodeGatewayPort = beaconNodeGatewayPort ports.PrysmBeaconNodeMetricsPort = beaconNodeMetricsPort diff --git a/testing/endtoend/params/params_test.go b/testing/endtoend/params/params_test.go index a0b24dab6fc4..e0f795984b37 100644 --- a/testing/endtoend/params/params_test.go +++ b/testing/endtoend/params/params_test.go @@ -30,7 +30,7 @@ func TestStandardPorts(t *testing.T) { var existingRegistrations []int testPorts := &ports{} assert.NoError(t, initializeStandardPorts(2, 0, testPorts, &existingRegistrations)) - assert.Equal(t, 16, len(existingRegistrations)) + assert.Equal(t, 17, len(existingRegistrations)) assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeGatewayPort) assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeTCPPort) assert.NotEqual(t, 0, testPorts.JaegerTracingPort) From 04f231a40083a5c1cf501abc7c46f39e2bf132f1 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:09:43 -0500 Subject: [PATCH 031/325] Initsync skip local blobs (#13827) * wip - init-sync skip available blob req * satisfy deep source * gaz * don't need to sort blobs; simplify blobRequest stack * wip debug log to watch blob skip behavior * unit tests for new blob req generator * refactor to reduce blob req func count * log when WaitForSummarizer fails --------- Co-authored-by: Kasey Kirkham --- beacon-chain/das/availability.go | 9 + beacon-chain/das/cache.go | 16 +- beacon-chain/db/filesystem/BUILD.bazel | 2 +- beacon-chain/db/filesystem/blob.go | 2 +- .../db/filesystem/{ephemeral.go => mock.go} | 16 +- beacon-chain/db/filesystem/pruner.go | 34 +- beacon-chain/sync/initial-sync/BUILD.bazel | 3 +- .../sync/initial-sync/blocks_fetcher.go | 171 ++++++--- .../sync/initial-sync/blocks_fetcher_test.go | 347 ++++++++++++------ .../sync/initial-sync/blocks_queue.go | 10 +- .../sync/initial-sync/blocks_queue_test.go | 36 +- beacon-chain/sync/initial-sync/round_robin.go | 68 ++-- 12 files changed, 460 insertions(+), 254 deletions(-) rename beacon-chain/db/filesystem/{ephemeral.go => mock.go} (84%) diff --git a/beacon-chain/das/availability.go b/beacon-chain/das/availability.go index 1729d0410cfc..7a8a2105838a 100644 --- a/beacon-chain/das/availability.go +++ b/beacon-chain/das/availability.go @@ -94,6 +94,15 @@ func (s *LazilyPersistentStore) IsDataAvailable(ctx context.Context, current pri entry := s.cache.ensure(key) defer s.cache.delete(key) root := b.Root() + sumz, err := s.store.WaitForSummarizer(ctx) + if err != nil { + log.WithField("root", fmt.Sprintf("%#x", b.Root())). + WithError(err). + Debug("Failed to receive BlobStorageSummarizer within IsDataAvailable") + } else { + entry.setDiskSummary(sumz.Summary(root)) + } + // Verify we have all the expected sidecars, and fail fast if any are missing or inconsistent. // We don't try to salvage problematic batches because this indicates a misbehaving peer and we'd rather // ignore their response and decrease their peer score. diff --git a/beacon-chain/das/cache.go b/beacon-chain/das/cache.go index ed940c412e1c..3e8d781bead9 100644 --- a/beacon-chain/das/cache.go +++ b/beacon-chain/das/cache.go @@ -4,6 +4,7 @@ import ( "bytes" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -59,7 +60,12 @@ func (c *cache) delete(key cacheKey) { // cacheEntry holds a fixed-length cache of BlobSidecars. type cacheEntry struct { - scs [fieldparams.MaxBlobsPerBlock]*blocks.ROBlob + scs [fieldparams.MaxBlobsPerBlock]*blocks.ROBlob + diskSummary filesystem.BlobStorageSummary +} + +func (e *cacheEntry) setDiskSummary(sum filesystem.BlobStorageSummary) { + e.diskSummary = sum } // stash adds an item to the in-memory cache of BlobSidecars. @@ -81,9 +87,17 @@ func (e *cacheEntry) stash(sc *blocks.ROBlob) error { // the cache do not match those found in the block. If err is nil, then all expected // commitments were found in the cache and the sidecar slice return value can be used // to perform a DA check against the cached sidecars. +// filter only returns blobs that need to be checked. Blobs already available on disk will be excluded. func (e *cacheEntry) filter(root [32]byte, kc safeCommitmentArray) ([]blocks.ROBlob, error) { + if e.diskSummary.AllAvailable(kc.count()) { + return nil, nil + } scs := make([]blocks.ROBlob, kc.count()) for i := uint64(0); i < fieldparams.MaxBlobsPerBlock; i++ { + // We already have this blob, we don't need to write it or validate it. + if e.diskSummary.HasIndex(i) { + continue + } if kc[i] == nil { if e.scs[i] != nil { return nil, errors.Wrapf(errCommitmentMismatch, "root=%#x, index=%#x, commitment=%#x, no block commitment", root, i, e.scs[i].KzgCommitment) diff --git a/beacon-chain/db/filesystem/BUILD.bazel b/beacon-chain/db/filesystem/BUILD.bazel index 406857686be8..bc97cdd89b98 100644 --- a/beacon-chain/db/filesystem/BUILD.bazel +++ b/beacon-chain/db/filesystem/BUILD.bazel @@ -5,9 +5,9 @@ go_library( srcs = [ "blob.go", "cache.go", - "ephemeral.go", "log.go", "metrics.go", + "mock.go", "pruner.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem", diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index 3da9a01ab91b..3fa4e4ee62a3 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -121,7 +121,7 @@ var ErrBlobStorageSummarizerUnavailable = errors.New("BlobStorage not initialize // BlobStorageSummarizer is not ready immediately on node startup because it needs to sample the blob filesystem to // determine which blobs are available. func (bs *BlobStorage) WaitForSummarizer(ctx context.Context) (BlobStorageSummarizer, error) { - if bs.pruner == nil { + if bs == nil || bs.pruner == nil { return nil, ErrBlobStorageSummarizerUnavailable } return bs.pruner.waitForCache(ctx) diff --git a/beacon-chain/db/filesystem/ephemeral.go b/beacon-chain/db/filesystem/mock.go similarity index 84% rename from beacon-chain/db/filesystem/ephemeral.go rename to beacon-chain/db/filesystem/mock.go index 729f815bbc6a..ba079e7cc4dc 100644 --- a/beacon-chain/db/filesystem/ephemeral.go +++ b/beacon-chain/db/filesystem/mock.go @@ -12,7 +12,7 @@ import ( // improving test performance and simplifying cleanup. func NewEphemeralBlobStorage(t testing.TB) *BlobStorage { fs := afero.NewMemMapFs() - pruner, err := newBlobPruner(fs, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest) + pruner, err := newBlobPruner(fs, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest, withWarmedCache()) if err != nil { t.Fatal("test setup issue", err) } @@ -23,7 +23,7 @@ func NewEphemeralBlobStorage(t testing.TB) *BlobStorage { // in order to interact with it outside the parameters of the BlobStorage api. func NewEphemeralBlobStorageWithFs(t testing.TB) (afero.Fs, *BlobStorage, error) { fs := afero.NewMemMapFs() - pruner, err := newBlobPruner(fs, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest) + pruner, err := newBlobPruner(fs, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest, withWarmedCache()) if err != nil { t.Fatal("test setup issue", err) } @@ -61,3 +61,15 @@ func NewEphemeralBlobStorageWithMocker(_ testing.TB) (*BlobMocker, *BlobStorage) bs := &BlobStorage{fs: fs} return &BlobMocker{fs: fs, bs: bs}, bs } + +func NewMockBlobStorageSummarizer(t *testing.T, set map[[32]byte][]int) BlobStorageSummarizer { + c := newBlobStorageCache() + for k, v := range set { + for i := range v { + if err := c.ensure(rootString(k), 0, uint64(v[i])); err != nil { + t.Fatal(err) + } + } + } + return c +} diff --git a/beacon-chain/db/filesystem/pruner.go b/beacon-chain/db/filesystem/pruner.go index cb5a10121b65..e42855071c51 100644 --- a/beacon-chain/db/filesystem/pruner.go +++ b/beacon-chain/db/filesystem/pruner.go @@ -33,17 +33,32 @@ type blobPruner struct { prunedBefore atomic.Uint64 windowSize primitives.Slot cache *blobStorageCache - cacheWarmed chan struct{} + cacheReady chan struct{} + warmed bool fs afero.Fs } -func newBlobPruner(fs afero.Fs, retain primitives.Epoch) (*blobPruner, error) { +type prunerOpt func(*blobPruner) error + +func withWarmedCache() prunerOpt { + return func(p *blobPruner) error { + return p.warmCache() + } +} + +func newBlobPruner(fs afero.Fs, retain primitives.Epoch, opts ...prunerOpt) (*blobPruner, error) { r, err := slots.EpochStart(retain + retentionBuffer) if err != nil { return nil, errors.Wrap(err, "could not set retentionSlots") } cw := make(chan struct{}) - return &blobPruner{fs: fs, windowSize: r, cache: newBlobStorageCache(), cacheWarmed: cw}, nil + p := &blobPruner{fs: fs, windowSize: r, cache: newBlobStorageCache(), cacheReady: cw} + for _, o := range opts { + if err := o(p); err != nil { + return nil, err + } + } + return p, nil } // notify updates the pruner's view of root->blob mappings. This allows the pruner to build a cache @@ -57,6 +72,8 @@ func (p *blobPruner) notify(root [32]byte, latest primitives.Slot, idx uint64) e return nil } go func() { + p.Lock() + defer p.Unlock() if err := p.prune(primitives.Slot(pruned)); err != nil { log.WithError(err).Errorf("Failed to prune blobs from slot %d", latest) } @@ -74,16 +91,21 @@ func windowMin(latest, offset primitives.Slot) primitives.Slot { } func (p *blobPruner) warmCache() error { + p.Lock() + defer p.Unlock() if err := p.prune(0); err != nil { return err } - close(p.cacheWarmed) + if !p.warmed { + p.warmed = true + close(p.cacheReady) + } return nil } func (p *blobPruner) waitForCache(ctx context.Context) (*blobStorageCache, error) { select { - case <-p.cacheWarmed: + case <-p.cacheReady: return p.cache, nil case <-ctx.Done(): return nil, ctx.Err() @@ -94,8 +116,6 @@ func (p *blobPruner) waitForCache(ctx context.Context) (*blobStorageCache, error // It deletes blobs older than currentEpoch - (retentionEpochs+bufferEpochs). // This is so that we keep a slight buffer and blobs are deleted after n+2 epochs. func (p *blobPruner) prune(pruneBefore primitives.Slot) error { - p.Lock() - defer p.Unlock() start := time.Now() totalPruned, totalErr := 0, 0 // Customize logging/metrics behavior for the initial cache warmup when slot=0. diff --git a/beacon-chain/sync/initial-sync/BUILD.bazel b/beacon-chain/sync/initial-sync/BUILD.bazel index 8b83925a2435..3d4ab052ec1e 100644 --- a/beacon-chain/sync/initial-sync/BUILD.bazel +++ b/beacon-chain/sync/initial-sync/BUILD.bazel @@ -33,7 +33,6 @@ go_library( "//beacon-chain/verification:go_default_library", "//cmd/beacon-chain/flags:go_default_library", "//config/params:go_default_library", - "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", @@ -83,10 +82,10 @@ go_test( "//beacon-chain/p2p/types:go_default_library", "//beacon-chain/startup:go_default_library", "//beacon-chain/sync:go_default_library", - "//beacon-chain/sync/verify:go_default_library", "//beacon-chain/verification:go_default_library", "//cmd/beacon-chain/flags:go_default_library", "//config/features:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher.go b/beacon-chain/sync/initial-sync/blocks_fetcher.go index 13bb09e2ce28..396a95abb4e2 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher.go @@ -11,6 +11,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" p2pTypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" @@ -18,7 +19,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/verify" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/config/params" - consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" blocks2 "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -27,6 +27,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/rand" "github.com/prysmaticlabs/prysm/v5/math" p2ppb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -76,6 +77,7 @@ type blocksFetcherConfig struct { db db.ReadOnlyDatabase peerFilterCapacityWeight float64 mode syncMode + bs filesystem.BlobStorageSummarizer } // blocksFetcher is a service to fetch chain data from peers. @@ -91,6 +93,7 @@ type blocksFetcher struct { ctxMap prysmsync.ContextByteVersions p2p p2p.P2P db db.ReadOnlyDatabase + bs filesystem.BlobStorageSummarizer blocksPerPeriod uint64 rateLimiter *leakybucket.Collector peerLocks map[peer.ID]*peerLock @@ -149,6 +152,7 @@ func newBlocksFetcher(ctx context.Context, cfg *blocksFetcherConfig) *blocksFetc ctxMap: cfg.ctxMap, p2p: cfg.p2p, db: cfg.db, + bs: cfg.bs, blocksPerPeriod: uint64(blocksPerPeriod), rateLimiter: rateLimiter, peerLocks: make(map[peer.ID]*peerLock), @@ -372,22 +376,17 @@ func sortedBlockWithVerifiedBlobSlice(blocks []interfaces.ReadOnlySignedBeaconBl return rb, nil } -func blobRequest(bwb []blocks2.BlockWithROBlobs, blobWindowStart primitives.Slot) *p2ppb.BlobSidecarsByRangeRequest { - if len(bwb) == 0 { - return nil - } - lowest := lowestSlotNeedsBlob(blobWindowStart, bwb) - if lowest == nil { - return nil - } - highest := bwb[len(bwb)-1].Block.Block().Slot() - return &p2ppb.BlobSidecarsByRangeRequest{ - StartSlot: *lowest, - Count: uint64(highest.SubSlot(*lowest)) + 1, - } +type commitmentCount struct { + slot primitives.Slot + root [32]byte + count int } -func lowestSlotNeedsBlob(retentionStart primitives.Slot, bwb []blocks2.BlockWithROBlobs) *primitives.Slot { +type commitmentCountList []commitmentCount + +// countCommitments makes a list of all blocks that have commitments that need to be satisfied. +// This gives us a representation to finish building the request that is lightweight and readable for testing. +func countCommitments(bwb []blocks2.BlockWithROBlobs, retentionStart primitives.Slot) commitmentCountList { if len(bwb) == 0 { return nil } @@ -397,8 +396,13 @@ func lowestSlotNeedsBlob(retentionStart primitives.Slot, bwb []blocks2.BlockWith if bwb[len(bwb)-1].Block.Block().Slot() < retentionStart { return nil } - for _, b := range bwb { + fc := make([]commitmentCount, 0, len(bwb)) + for i := range bwb { + b := bwb[i] slot := b.Block.Block().Slot() + if b.Block.Version() < version.Deneb { + continue + } if slot < retentionStart { continue } @@ -406,67 +410,116 @@ func lowestSlotNeedsBlob(retentionStart primitives.Slot, bwb []blocks2.BlockWith if err != nil || len(commits) == 0 { continue } - return &slot + fc = append(fc, commitmentCount{slot: slot, root: b.Block.Root(), count: len(commits)}) } - return nil + return fc } -func sortBlobs(blobs []blocks.ROBlob) []blocks.ROBlob { - sort.Slice(blobs, func(i, j int) bool { - if blobs[i].Slot() == blobs[j].Slot() { - return blobs[i].Index < blobs[j].Index +// func slotRangeForCommitmentCounts(cc []commitmentCount, bs filesystem.BlobStorageSummarizer) *blobRange { +func (cc commitmentCountList) blobRange(bs filesystem.BlobStorageSummarizer) *blobRange { + if len(cc) == 0 { + return nil + } + // If we don't have a blob summarizer, can't check local blobs, request blobs over complete range. + if bs == nil { + return &blobRange{low: cc[0].slot, high: cc[len(cc)-1].slot} + } + for i := range cc { + hci := cc[i] + // This list is always ordered by increasing slot, per req/resp validation rules. + // Skip through slots until we find one with missing blobs. + if bs.Summary(hci.root).AllAvailable(hci.count) { + continue } - return blobs[i].Slot() < blobs[j].Slot() - }) + // The slow of the first missing blob is the lower bound. + // If we don't find an upper bound, we'll have a 1 slot request (same low/high). + needed := &blobRange{low: hci.slot, high: hci.slot} + // Iterate backward through the list to find the highest missing slot above the lower bound. + // Return the complete range as soon as we find it; if lower bound is already the last element, + // or if we never find an upper bound, we'll fall through to the bounds being equal after this loop. + for z := len(cc) - 1; z > i; z-- { + hcz := cc[z] + if bs.Summary(hcz.root).AllAvailable(hcz.count) { + continue + } + needed.high = hcz.slot + return needed + } + return needed + } + return nil +} - return blobs +type blobRange struct { + low primitives.Slot + high primitives.Slot +} + +func (r *blobRange) Request() *p2ppb.BlobSidecarsByRangeRequest { + if r == nil { + return nil + } + return &p2ppb.BlobSidecarsByRangeRequest{ + StartSlot: r.low, + Count: uint64(r.high.SubSlot(r.low)) + 1, + } } var errBlobVerification = errors.New("peer unable to serve aligned BlobSidecarsByRange and BeaconBlockSidecarsByRange responses") var errMissingBlobsForBlockCommitments = errors.Wrap(errBlobVerification, "blobs unavailable for processing block with kzg commitments") -func verifyAndPopulateBlobs(bwb []blocks2.BlockWithROBlobs, blobs []blocks.ROBlob, blobWindowStart primitives.Slot) ([]blocks2.BlockWithROBlobs, error) { - // Assumes bwb has already been sorted by sortedBlockWithVerifiedBlobSlice. - blobs = sortBlobs(blobs) - blobi := 0 - // Loop over all blocks, and each time a commitment is observed, advance the index into the blob slice. - // The assumption is that the blob slice contains a value for every commitment in the blocks it is based on, - // correctly ordered by slot and blob index. - for i, bb := range bwb { - block := bb.Block.Block() - if block.Slot() < blobWindowStart { +func verifyAndPopulateBlobs(bwb []blocks2.BlockWithROBlobs, blobs []blocks.ROBlob, req *p2ppb.BlobSidecarsByRangeRequest, bss filesystem.BlobStorageSummarizer) ([]blocks2.BlockWithROBlobs, error) { + blobsByRoot := make(map[[32]byte][]blocks.ROBlob) + for i := range blobs { + if blobs[i].Slot() < req.StartSlot { continue } - commits, err := block.Body().BlobKzgCommitments() + br := blobs[i].BlockRoot() + blobsByRoot[br] = append(blobsByRoot[br], blobs[i]) + } + for i := range bwb { + bwi, err := populateBlock(bwb[i], blobsByRoot[bwb[i].Block.Root()], req, bss) if err != nil { - if errors.Is(err, consensus_types.ErrUnsupportedField) { - log. - WithField("blockSlot", block.Slot()). - WithField("retentionStart", blobWindowStart). - Warn("block with slot within blob retention period has version which does not support commitments") + if errors.Is(err, errDidntPopulate) { continue } - return nil, err + return bwb, err } - bb.Blobs = make([]blocks.ROBlob, len(commits)) - for ci := range commits { - // There are more expected commitments in this block, but we've run out of blobs from the response - // (out-of-bound error guard). - if blobi == len(blobs) { - return nil, missingCommitError(bb.Block.Root(), bb.Block.Block().Slot(), commits[ci:]) - } - bl := blobs[blobi] - if err := verify.BlobAlignsWithBlock(bl, bb.Block); err != nil { - return nil, err - } - bb.Blobs[ci] = bl - blobi += 1 - } - bwb[i] = bb + bwb[i] = bwi } return bwb, nil } +var errDidntPopulate = errors.New("skipping population of block") + +func populateBlock(bw blocks2.BlockWithROBlobs, blobs []blocks.ROBlob, req *p2ppb.BlobSidecarsByRangeRequest, bss filesystem.BlobStorageSummarizer) (blocks2.BlockWithROBlobs, error) { + blk := bw.Block + if blk.Version() < version.Deneb || blk.Block().Slot() < req.StartSlot { + return bw, errDidntPopulate + } + commits, err := blk.Block().Body().BlobKzgCommitments() + if err != nil { + return bw, errDidntPopulate + } + if len(commits) == 0 { + return bw, errDidntPopulate + } + // Drop blobs on the floor if we already have them. + if bss != nil && bss.Summary(blk.Root()).AllAvailable(len(commits)) { + return bw, errDidntPopulate + } + if len(commits) != len(blobs) { + return bw, missingCommitError(blk.Root(), blk.Block().Slot(), commits) + } + for ci := range commits { + if err := verify.BlobAlignsWithBlock(blobs[ci], blk); err != nil { + return bw, err + } + } + bw.Blobs = blobs + return bw, nil +} + func missingCommitError(root [32]byte, slot primitives.Slot, missing [][]byte) error { missStr := make([]string, 0, len(missing)) for k := range missing { @@ -488,7 +541,7 @@ func (f *blocksFetcher) fetchBlobsFromPeer(ctx context.Context, bwb []blocks2.Bl return nil, err } // Construct request message based on observed interval of blocks in need of blobs. - req := blobRequest(bwb, blobWindowStart) + req := countCommitments(bwb, blobWindowStart).blobRange(f.bs).Request() if req == nil { return bwb, nil } @@ -508,7 +561,7 @@ func (f *blocksFetcher) fetchBlobsFromPeer(ctx context.Context, bwb []blocks2.Bl continue } f.p2p.Peers().Scorers().BlockProviderScorer().Touch(p) - robs, err := verifyAndPopulateBlobs(bwb, blobs, blobWindowStart) + robs, err := verifyAndPopulateBlobs(bwb, blobs, req, f.bs) if err != nil { log.WithField("peer", p).WithError(err).Debug("Invalid BeaconBlobsByRange response") continue diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher_test.go b/beacon-chain/sync/initial-sync/blocks_fetcher_test.go index 0852d8f7f5c5..e60f951b51a5 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher_test.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher_test.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "math" - "math/rand" "sort" "sync" "testing" @@ -14,13 +13,14 @@ import ( "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" dbtest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" p2pm "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" p2pt "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" beaconsync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/verify" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -960,28 +960,7 @@ func TestTimeToWait(t *testing.T) { } } -func TestSortBlobs(t *testing.T) { - _, blobs := util.ExtendBlocksPlusBlobs(t, []blocks.ROBlock{}, 10) - shuffled := make([]blocks.ROBlob, len(blobs)) - for i := range blobs { - shuffled[i] = blobs[i] - } - rand.Shuffle(len(shuffled), func(i, j int) { - shuffled[i], shuffled[j] = shuffled[j], shuffled[i] - }) - sorted := sortBlobs(shuffled) - require.Equal(t, len(sorted), len(shuffled)) - for i := range blobs { - expect := blobs[i] - actual := sorted[i] - require.Equal(t, expect.Slot(), actual.Slot()) - require.Equal(t, expect.Index, actual.Index) - require.Equal(t, bytesutil.ToBytes48(expect.KzgCommitment), bytesutil.ToBytes48(actual.KzgCommitment)) - require.Equal(t, expect.BlockRoot(), actual.BlockRoot()) - } -} - -func TestLowestSlotNeedsBlob(t *testing.T) { +func TestBlobRangeForBlocks(t *testing.T) { blks, _ := util.ExtendBlocksPlusBlobs(t, []blocks.ROBlock{}, 10) sbbs := make([]interfaces.ReadOnlySignedBeaconBlock, len(blks)) for i := range blks { @@ -990,12 +969,12 @@ func TestLowestSlotNeedsBlob(t *testing.T) { retentionStart := primitives.Slot(5) bwb, err := sortedBlockWithVerifiedBlobSlice(sbbs) require.NoError(t, err) - lowest := lowestSlotNeedsBlob(retentionStart, bwb) - require.Equal(t, retentionStart, *lowest) + bounds := countCommitments(bwb, retentionStart).blobRange(nil) + require.Equal(t, retentionStart, bounds.low) higher := primitives.Slot(len(blks) + 1) - lowest = lowestSlotNeedsBlob(higher, bwb) - var nilSlot *primitives.Slot - require.Equal(t, nilSlot, lowest) + bounds = countCommitments(bwb, higher).blobRange(nil) + var nilBounds *blobRange + require.Equal(t, nilBounds, bounds) blks, _ = util.ExtendBlocksPlusBlobs(t, []blocks.ROBlock{}, 10) sbbs = make([]interfaces.ReadOnlySignedBeaconBlock, len(blks)) @@ -1008,14 +987,14 @@ func TestLowestSlotNeedsBlob(t *testing.T) { next := bwb[6].Block.Block().Slot() skip := bwb[5].Block.Block() bwb[5].Block, _ = util.GenerateTestDenebBlockWithSidecar(t, skip.ParentRoot(), skip.Slot(), 0) - lowest = lowestSlotNeedsBlob(retentionStart, bwb) - require.Equal(t, next, *lowest) + bounds = countCommitments(bwb, retentionStart).blobRange(nil) + require.Equal(t, next, bounds.low) } func TestBlobRequest(t *testing.T) { var nilReq *ethpb.BlobSidecarsByRangeRequest // no blocks - req := blobRequest([]blocks.BlockWithROBlobs{}, 0) + req := countCommitments([]blocks.BlockWithROBlobs{}, 0).blobRange(nil).Request() require.Equal(t, nilReq, req) blks, _ := util.ExtendBlocksPlusBlobs(t, []blocks.ROBlock{}, 10) sbbs := make([]interfaces.ReadOnlySignedBeaconBlock, len(blks)) @@ -1027,26 +1006,180 @@ func TestBlobRequest(t *testing.T) { maxBlkSlot := primitives.Slot(len(blks) - 1) tooHigh := primitives.Slot(len(blks) + 1) - req = blobRequest(bwb, tooHigh) + req = countCommitments(bwb, tooHigh).blobRange(nil).Request() require.Equal(t, nilReq, req) - req = blobRequest(bwb, maxBlkSlot) + req = countCommitments(bwb, maxBlkSlot).blobRange(nil).Request() require.Equal(t, uint64(1), req.Count) require.Equal(t, maxBlkSlot, req.StartSlot) halfway := primitives.Slot(5) - req = blobRequest(bwb, halfway) + req = countCommitments(bwb, halfway).blobRange(nil).Request() require.Equal(t, halfway, req.StartSlot) // adding 1 to include the halfway slot itself require.Equal(t, uint64(1+maxBlkSlot-halfway), req.Count) before := bwb[0].Block.Block().Slot() allAfter := bwb[1:] - req = blobRequest(allAfter, before) + req = countCommitments(allAfter, before).blobRange(nil).Request() require.Equal(t, allAfter[0].Block.Block().Slot(), req.StartSlot) require.Equal(t, len(allAfter), int(req.Count)) } +func TestCountCommitments(t *testing.T) { + // no blocks + // blocks before retention start filtered + // blocks without commitments filtered + // pre-deneb filtered + // variety of commitment counts are accurate, from 1 to max + type testcase struct { + name string + bwb func(t *testing.T, c testcase) []blocks.BlockWithROBlobs + numBlocks int + retStart primitives.Slot + resCount int + } + cases := []testcase{ + { + name: "nil blocks is safe", + bwb: func(t *testing.T, c testcase) []blocks.BlockWithROBlobs { + return nil + }, + retStart: 0, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + bwb := c.bwb(t, c) + cc := countCommitments(bwb, c.retStart) + require.Equal(t, c.resCount, len(cc)) + }) + } +} + +func TestCommitmentCountList(t *testing.T) { + cases := []struct { + name string + cc commitmentCountList + bss func(*testing.T) filesystem.BlobStorageSummarizer + expected *blobRange + request *ethpb.BlobSidecarsByRangeRequest + }{ + { + name: "nil commitmentCount is safe", + cc: nil, + expected: nil, + request: nil, + }, + { + name: "nil bss, single slot", + cc: []commitmentCount{ + {slot: 11235, count: 1}, + }, + expected: &blobRange{low: 11235, high: 11235}, + request: ðpb.BlobSidecarsByRangeRequest{StartSlot: 11235, Count: 1}, + }, + { + name: "nil bss, sparse slots", + cc: []commitmentCount{ + {slot: 11235, count: 1}, + {slot: 11240, count: fieldparams.MaxBlobsPerBlock}, + {slot: 11250, count: 3}, + }, + expected: &blobRange{low: 11235, high: 11250}, + request: ðpb.BlobSidecarsByRangeRequest{StartSlot: 11235, Count: 16}, + }, + { + name: "AllAvailable in middle, some avail low, none high", + bss: func(t *testing.T) filesystem.BlobStorageSummarizer { + onDisk := map[[32]byte][]int{ + bytesutil.ToBytes32([]byte("0")): {0, 1}, + bytesutil.ToBytes32([]byte("1")): {0, 1, 2, 3, 4, 5}, + } + return filesystem.NewMockBlobStorageSummarizer(t, onDisk) + }, + cc: []commitmentCount{ + {slot: 0, count: 3, root: bytesutil.ToBytes32([]byte("0"))}, + {slot: 5, count: fieldparams.MaxBlobsPerBlock, root: bytesutil.ToBytes32([]byte("1"))}, + {slot: 15, count: 3}, + }, + expected: &blobRange{low: 0, high: 15}, + request: ðpb.BlobSidecarsByRangeRequest{StartSlot: 0, Count: 16}, + }, + { + name: "AllAvailable at high and low", + bss: func(t *testing.T) filesystem.BlobStorageSummarizer { + onDisk := map[[32]byte][]int{ + bytesutil.ToBytes32([]byte("0")): {0, 1}, + bytesutil.ToBytes32([]byte("2")): {0, 1, 2, 3, 4, 5}, + } + return filesystem.NewMockBlobStorageSummarizer(t, onDisk) + }, + cc: []commitmentCount{ + {slot: 0, count: 2, root: bytesutil.ToBytes32([]byte("0"))}, + {slot: 5, count: 3}, + {slot: 15, count: fieldparams.MaxBlobsPerBlock, root: bytesutil.ToBytes32([]byte("2"))}, + }, + expected: &blobRange{low: 5, high: 5}, + request: ðpb.BlobSidecarsByRangeRequest{StartSlot: 5, Count: 1}, + }, + { + name: "AllAvailable at high and low, adjacent range in middle", + bss: func(t *testing.T) filesystem.BlobStorageSummarizer { + onDisk := map[[32]byte][]int{ + bytesutil.ToBytes32([]byte("0")): {0, 1}, + bytesutil.ToBytes32([]byte("2")): {0, 1, 2, 3, 4, 5}, + } + return filesystem.NewMockBlobStorageSummarizer(t, onDisk) + }, + cc: []commitmentCount{ + {slot: 0, count: 2, root: bytesutil.ToBytes32([]byte("0"))}, + {slot: 5, count: 3}, + {slot: 6, count: 3}, + {slot: 15, count: fieldparams.MaxBlobsPerBlock, root: bytesutil.ToBytes32([]byte("2"))}, + }, + expected: &blobRange{low: 5, high: 6}, + request: ðpb.BlobSidecarsByRangeRequest{StartSlot: 5, Count: 2}, + }, + { + name: "AllAvailable at high and low, range in middle", + bss: func(t *testing.T) filesystem.BlobStorageSummarizer { + onDisk := map[[32]byte][]int{ + bytesutil.ToBytes32([]byte("0")): {0, 1}, + bytesutil.ToBytes32([]byte("1")): {0, 1}, + bytesutil.ToBytes32([]byte("2")): {0, 1, 2, 3, 4, 5}, + } + return filesystem.NewMockBlobStorageSummarizer(t, onDisk) + }, + cc: []commitmentCount{ + {slot: 0, count: 2, root: bytesutil.ToBytes32([]byte("0"))}, + {slot: 5, count: 3, root: bytesutil.ToBytes32([]byte("1"))}, + {slot: 10, count: 3}, + {slot: 15, count: fieldparams.MaxBlobsPerBlock, root: bytesutil.ToBytes32([]byte("2"))}, + }, + expected: &blobRange{low: 5, high: 10}, + request: ðpb.BlobSidecarsByRangeRequest{StartSlot: 5, Count: 6}, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + var bss filesystem.BlobStorageSummarizer + if c.bss != nil { + bss = c.bss(t) + } + br := c.cc.blobRange(bss) + require.DeepEqual(t, c.expected, br) + if c.request == nil { + require.IsNil(t, br.Request()) + } else { + req := br.Request() + require.DeepEqual(t, req.StartSlot, c.request.StartSlot) + require.DeepEqual(t, req.Count, c.request.Count) + } + }) + } +} + func testSequenceBlockWithBlob(t *testing.T, nblocks int) ([]blocks.BlockWithROBlobs, []blocks.ROBlob) { blks, blobs := util.ExtendBlocksPlusBlobs(t, []blocks.ROBlock{}, nblocks) sbbs := make([]interfaces.ReadOnlySignedBeaconBlock, len(blks)) @@ -1058,91 +1191,75 @@ func testSequenceBlockWithBlob(t *testing.T, nblocks int) ([]blocks.BlockWithROB return bwb, blobs } -func TestVerifyAndPopulateBlobs(t *testing.T) { - bwb, blobs := testSequenceBlockWithBlob(t, 10) - lastBlobIdx := len(blobs) - 1 - // Blocks are all before the retention window, blobs argument is ignored. - windowAfter := bwb[len(bwb)-1].Block.Block().Slot() + 1 - _, err := verifyAndPopulateBlobs(bwb, nil, windowAfter) - require.NoError(t, err) - - firstBlockSlot := bwb[0].Block.Block().Slot() - // slice off blobs for the last block so we hit the out of bounds / blob exhaustion check. - _, err = verifyAndPopulateBlobs(bwb, blobs[0:len(blobs)-6], firstBlockSlot) - require.ErrorIs(t, err, errMissingBlobsForBlockCommitments) - - bwb, blobs = testSequenceBlockWithBlob(t, 10) - // Misalign the slots of the blobs for the first block to simulate them being missing from the response. - offByOne := blobs[0].Slot() - for i := range blobs { - if blobs[i].Slot() == offByOne { - blobs[i].SignedBlockHeader.Header.Slot = offByOne + 1 - } +func testReqFromResp(bwb []blocks.BlockWithROBlobs) *ethpb.BlobSidecarsByRangeRequest { + return ðpb.BlobSidecarsByRangeRequest{ + StartSlot: bwb[0].Block.Block().Slot(), + Count: uint64(bwb[len(bwb)-1].Block.Block().Slot()-bwb[0].Block.Block().Slot()) + 1, } - _, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.ErrorIs(t, err, verify.ErrBlobBlockMisaligned) - - bwb, blobs = testSequenceBlockWithBlob(t, 10) - blobs[lastBlobIdx], err = blocks.NewROBlobWithRoot(blobs[lastBlobIdx].BlobSidecar, blobs[0].BlockRoot()) - require.NoError(t, err) - _, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.ErrorIs(t, err, verify.ErrBlobBlockMisaligned) - - bwb, blobs = testSequenceBlockWithBlob(t, 10) - blobs[lastBlobIdx].Index = 100 - _, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.ErrorIs(t, err, verify.ErrIncorrectBlobIndex) - - bwb, blobs = testSequenceBlockWithBlob(t, 10) - blobs[lastBlobIdx].SignedBlockHeader.Header.ProposerIndex = 100 - blobs[lastBlobIdx], err = blocks.NewROBlob(blobs[lastBlobIdx].BlobSidecar) - require.NoError(t, err) - _, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.ErrorIs(t, err, verify.ErrBlobBlockMisaligned) - - bwb, blobs = testSequenceBlockWithBlob(t, 10) - blobs[lastBlobIdx].SignedBlockHeader.Header.ParentRoot = blobs[0].SignedBlockHeader.Header.ParentRoot - blobs[lastBlobIdx], err = blocks.NewROBlob(blobs[lastBlobIdx].BlobSidecar) - require.NoError(t, err) - _, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.ErrorIs(t, err, verify.ErrBlobBlockMisaligned) - - var emptyKzg [48]byte - bwb, blobs = testSequenceBlockWithBlob(t, 10) - blobs[lastBlobIdx].KzgCommitment = emptyKzg[:] - blobs[lastBlobIdx], err = blocks.NewROBlob(blobs[lastBlobIdx].BlobSidecar) - require.NoError(t, err) - _, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.ErrorIs(t, err, verify.ErrMismatchedBlobCommitments) +} - // happy path - bwb, blobs = testSequenceBlockWithBlob(t, 10) +func TestVerifyAndPopulateBlobs(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + bwb, blobs := testSequenceBlockWithBlob(t, 10) - expectedCommits := make(map[[48]byte]bool) - for _, bl := range blobs { - expectedCommits[bytesutil.ToBytes48(bl.KzgCommitment)] = true - } - // The assertions using this map expect all commitments to be unique, so make sure that stays true. - require.Equal(t, len(blobs), len(expectedCommits)) + expectedCommits := make(map[[48]byte]bool) + for _, bl := range blobs { + expectedCommits[bytesutil.ToBytes48(bl.KzgCommitment)] = true + } + require.Equal(t, len(blobs), len(expectedCommits)) - bwb, err = verifyAndPopulateBlobs(bwb, blobs, firstBlockSlot) - require.NoError(t, err) - for _, bw := range bwb { - commits, err := bw.Block.Block().Body().BlobKzgCommitments() + bwb, err := verifyAndPopulateBlobs(bwb, blobs, testReqFromResp(bwb), nil) + require.NoError(t, err) + for _, bw := range bwb { + commits, err := bw.Block.Block().Body().BlobKzgCommitments() + require.NoError(t, err) + require.Equal(t, len(commits), len(bw.Blobs)) + for i := range commits { + bc := bytesutil.ToBytes48(commits[i]) + require.Equal(t, bc, bytesutil.ToBytes48(bw.Blobs[i].KzgCommitment)) + // Since we delete entries we've seen, duplicates will cause an error here. + _, ok := expectedCommits[bc] + // Make sure this was an expected delete, then delete it from the map so we can make sure we saw all of them. + require.Equal(t, true, ok) + delete(expectedCommits, bc) + } + } + // We delete each entry we've seen, so if we see all expected commits, the map should be empty at the end. + require.Equal(t, 0, len(expectedCommits)) + }) + t.Run("missing blobs", func(t *testing.T) { + bwb, blobs := testSequenceBlockWithBlob(t, 10) + _, err := verifyAndPopulateBlobs(bwb, blobs[1:], testReqFromResp(bwb), nil) + require.ErrorIs(t, err, errMissingBlobsForBlockCommitments) + }) + t.Run("no blobs for last block", func(t *testing.T) { + bwb, blobs := testSequenceBlockWithBlob(t, 10) + lastIdx := len(bwb) - 1 + lastBlk := bwb[lastIdx].Block + cmts, err := lastBlk.Block().Body().BlobKzgCommitments() require.NoError(t, err) - require.Equal(t, len(commits), len(bw.Blobs)) - for i := range commits { - bc := bytesutil.ToBytes48(commits[i]) - require.Equal(t, bc, bytesutil.ToBytes48(bw.Blobs[i].KzgCommitment)) - // Since we delete entries we've seen, duplicates will cause an error here. - _, ok := expectedCommits[bc] - // Make sure this was an expected delete, then delete it from the map so we can make sure we saw all of them. - require.Equal(t, true, ok) - delete(expectedCommits, bc) + blobs = blobs[0 : len(blobs)-len(cmts)] + lastBlk, _ = util.GenerateTestDenebBlockWithSidecar(t, lastBlk.Block().ParentRoot(), lastBlk.Block().Slot(), 0) + bwb[lastIdx].Block = lastBlk + _, err = verifyAndPopulateBlobs(bwb, blobs, testReqFromResp(bwb), nil) + require.NoError(t, err) + }) + t.Run("blobs not copied if all locally available", func(t *testing.T) { + bwb, blobs := testSequenceBlockWithBlob(t, 10) + // r1 only has some blobs locally available, so we'll still copy them all. + // r7 has all blobs locally available, so we shouldn't copy them. + i1, i7 := 1, 7 + r1, r7 := bwb[i1].Block.Root(), bwb[i7].Block.Root() + onDisk := map[[32]byte][]int{ + r1: {0, 1}, + r7: {0, 1, 2, 3, 4, 5}, } - } - // We delete each entry we've seen, so if we see all expected commits, the map should be empty at the end. - require.Equal(t, 0, len(expectedCommits)) + bss := filesystem.NewMockBlobStorageSummarizer(t, onDisk) + bwb, err := verifyAndPopulateBlobs(bwb, blobs, testReqFromResp(bwb), bss) + require.NoError(t, err) + require.Equal(t, 6, len(bwb[i1].Blobs)) + require.Equal(t, 0, len(bwb[i7].Blobs)) + }) } func TestBatchLimit(t *testing.T) { diff --git a/beacon-chain/sync/initial-sync/blocks_queue.go b/beacon-chain/sync/initial-sync/blocks_queue.go index 20c3248dddcb..44461bd4fd7b 100644 --- a/beacon-chain/sync/initial-sync/blocks_queue.go +++ b/beacon-chain/sync/initial-sync/blocks_queue.go @@ -7,6 +7,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" beaconsync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" @@ -69,6 +70,7 @@ type blocksQueueConfig struct { p2p p2p.P2P db db.ReadOnlyDatabase mode syncMode + bs filesystem.BlobStorageSummarizer } // blocksQueue is a priority queue that serves as a intermediary between block fetchers (producers) @@ -101,12 +103,16 @@ func newBlocksQueue(ctx context.Context, cfg *blocksQueueConfig) *blocksQueue { blocksFetcher := cfg.blocksFetcher if blocksFetcher == nil { + if cfg.bs == nil { + log.Warn("rpc fetcher starting without blob availability cache, duplicate blobs may be requested.") + } blocksFetcher = newBlocksFetcher(ctx, &blocksFetcherConfig{ ctxMap: cfg.ctxMap, chain: cfg.chain, p2p: cfg.p2p, db: cfg.db, clock: cfg.clock, + bs: cfg.bs, }) } highestExpectedSlot := cfg.highestExpectedSlot @@ -139,7 +145,7 @@ func newBlocksQueue(ctx context.Context, cfg *blocksQueueConfig) *blocksQueue { queue.smm.addEventHandler(eventDataReceived, stateScheduled, queue.onDataReceivedEvent(ctx)) queue.smm.addEventHandler(eventTick, stateDataParsed, queue.onReadyToSendEvent(ctx)) queue.smm.addEventHandler(eventTick, stateSkipped, queue.onProcessSkippedEvent(ctx)) - queue.smm.addEventHandler(eventTick, stateSent, queue.onCheckStaleEvent(ctx)) + queue.smm.addEventHandler(eventTick, stateSent, onCheckStaleEvent(ctx)) return queue } @@ -451,7 +457,7 @@ func (q *blocksQueue) onProcessSkippedEvent(ctx context.Context) eventHandlerFn // onCheckStaleEvent is an event that allows to mark stale epochs, // so that they can be re-processed. -func (_ *blocksQueue) onCheckStaleEvent(ctx context.Context) eventHandlerFn { +func onCheckStaleEvent(ctx context.Context) eventHandlerFn { return func(m *stateMachine, in interface{}) (stateID, error) { if ctx.Err() != nil { return m.state, ctx.Err() diff --git a/beacon-chain/sync/initial-sync/blocks_queue_test.go b/beacon-chain/sync/initial-sync/blocks_queue_test.go index 96833402b5ac..8a2ba65f517a 100644 --- a/beacon-chain/sync/initial-sync/blocks_queue_test.go +++ b/beacon-chain/sync/initial-sync/blocks_queue_test.go @@ -971,24 +971,12 @@ func TestBlocksQueue_onProcessSkippedEvent(t *testing.T) { } func TestBlocksQueue_onCheckStaleEvent(t *testing.T) { - blockBatchLimit := flags.Get().BlockBatchLimit - mc, p2p, _ := initializeTestServices(t, []primitives.Slot{}, []*peerData{}) - ctx, cancel := context.WithCancel(context.Background()) defer cancel() - fetcher := newBlocksFetcher(ctx, &blocksFetcherConfig{ - chain: mc, - p2p: p2p, - }) t.Run("expired context", func(t *testing.T) { ctx, cancel := context.WithCancel(ctx) - queue := newBlocksQueue(ctx, &blocksQueueConfig{ - blocksFetcher: fetcher, - chain: mc, - highestExpectedSlot: primitives.Slot(blockBatchLimit), - }) - handlerFn := queue.onCheckStaleEvent(ctx) + handlerFn := onCheckStaleEvent(ctx) cancel() updatedState, err := handlerFn(&stateMachine{ state: stateSkipped, @@ -998,16 +986,10 @@ func TestBlocksQueue_onCheckStaleEvent(t *testing.T) { }) t.Run("invalid input state", func(t *testing.T) { - queue := newBlocksQueue(ctx, &blocksQueueConfig{ - blocksFetcher: fetcher, - chain: mc, - highestExpectedSlot: primitives.Slot(blockBatchLimit), - }) - invalidStates := []stateID{stateNew, stateScheduled, stateDataParsed, stateSkipped} for _, state := range invalidStates { t.Run(state.String(), func(t *testing.T) { - handlerFn := queue.onCheckStaleEvent(ctx) + handlerFn := onCheckStaleEvent(ctx) updatedState, err := handlerFn(&stateMachine{ state: state, }, nil) @@ -1018,12 +1000,7 @@ func TestBlocksQueue_onCheckStaleEvent(t *testing.T) { }) t.Run("process non stale machine", func(t *testing.T) { - queue := newBlocksQueue(ctx, &blocksQueueConfig{ - blocksFetcher: fetcher, - chain: mc, - highestExpectedSlot: primitives.Slot(blockBatchLimit), - }) - handlerFn := queue.onCheckStaleEvent(ctx) + handlerFn := onCheckStaleEvent(ctx) updatedState, err := handlerFn(&stateMachine{ state: stateSent, updated: prysmTime.Now().Add(-staleEpochTimeout / 2), @@ -1034,12 +1011,7 @@ func TestBlocksQueue_onCheckStaleEvent(t *testing.T) { }) t.Run("process stale machine", func(t *testing.T) { - queue := newBlocksQueue(ctx, &blocksQueueConfig{ - blocksFetcher: fetcher, - chain: mc, - highestExpectedSlot: primitives.Slot(blockBatchLimit), - }) - handlerFn := queue.onCheckStaleEvent(ctx) + handlerFn := onCheckStaleEvent(ctx) updatedState, err := handlerFn(&stateMachine{ state: stateSent, updated: prysmTime.Now().Add(-staleEpochTimeout), diff --git a/beacon-chain/sync/initial-sync/round_robin.go b/beacon-chain/sync/initial-sync/round_robin.go index c91bd1ec4322..5d96478148f5 100644 --- a/beacon-chain/sync/initial-sync/round_robin.go +++ b/beacon-chain/sync/initial-sync/round_robin.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -62,7 +63,39 @@ func (s *Service) roundRobinSync(genesis time.Time) error { return s.syncToNonFinalizedEpoch(ctx, genesis) } -// syncToFinalizedEpoch sync from head to best known finalized epoch. +func (s *Service) startBlocksQueue(ctx context.Context, highestSlot primitives.Slot, mode syncMode) (*blocksQueue, error) { + vr := s.clock.GenesisValidatorsRoot() + ctxMap, err := sync.ContextByteVersionsForValRoot(vr) + if err != nil { + return nil, errors.Wrapf(err, "unable to initialize context version map using genesis validator root = %#x", vr) + } + + summarizer, err := s.cfg.BlobStorage.WaitForSummarizer(ctx) + if err != nil { + // The summarizer is an optional optimization, we can continue without, only stop if there is a different error. + if !errors.Is(err, filesystem.ErrBlobStorageSummarizerUnavailable) { + return nil, err + } + summarizer = nil // This should already be nil, but we'll set it just to be safe. + } + cfg := &blocksQueueConfig{ + p2p: s.cfg.P2P, + db: s.cfg.DB, + chain: s.cfg.Chain, + clock: s.clock, + ctxMap: ctxMap, + highestExpectedSlot: highestSlot, + mode: mode, + bs: summarizer, + } + queue := newBlocksQueue(ctx, cfg) + if err := queue.start(); err != nil { + return nil, err + } + return queue, nil +} + +// syncToFinalizedEpoch sync from head to the best known finalized epoch. func (s *Service) syncToFinalizedEpoch(ctx context.Context, genesis time.Time) error { highestFinalizedSlot, err := slots.EpochStart(s.highestFinalizedEpoch()) if err != nil { @@ -74,28 +107,12 @@ func (s *Service) syncToFinalizedEpoch(ctx context.Context, genesis time.Time) e return nil } - vr := s.clock.GenesisValidatorsRoot() - ctxMap, err := sync.ContextByteVersionsForValRoot(vr) + queue, err := s.startBlocksQueue(ctx, highestFinalizedSlot, modeStopOnFinalizedEpoch) if err != nil { - return errors.Wrapf(err, "unable to initialize context version map using genesis validator root = %#x", vr) - } - queue := newBlocksQueue(ctx, &blocksQueueConfig{ - p2p: s.cfg.P2P, - db: s.cfg.DB, - chain: s.cfg.Chain, - clock: s.clock, - ctxMap: ctxMap, - highestExpectedSlot: highestFinalizedSlot, - mode: modeStopOnFinalizedEpoch, - }) - if err := queue.start(); err != nil { return err } for data := range queue.fetchedData { - // If blobs are available. Verify blobs and blocks are consistence. - // We can't import a block if there's no associated blob within DA bound. - // The blob has to pass aggregated proof check. s.processFetchedData(ctx, genesis, s.cfg.Chain.HeadSlot(), data) } @@ -113,21 +130,8 @@ func (s *Service) syncToFinalizedEpoch(ctx context.Context, genesis time.Time) e // syncToNonFinalizedEpoch sync from head to best known non-finalized epoch supported by majority // of peers (no less than MinimumSyncPeers*2 peers). func (s *Service) syncToNonFinalizedEpoch(ctx context.Context, genesis time.Time) error { - vr := s.clock.GenesisValidatorsRoot() - ctxMap, err := sync.ContextByteVersionsForValRoot(vr) + queue, err := s.startBlocksQueue(ctx, slots.Since(genesis), modeNonConstrained) if err != nil { - return errors.Wrapf(err, "unable to initialize context version map using genesis validator root = %#x", vr) - } - queue := newBlocksQueue(ctx, &blocksQueueConfig{ - p2p: s.cfg.P2P, - db: s.cfg.DB, - chain: s.cfg.Chain, - clock: s.clock, - ctxMap: ctxMap, - highestExpectedSlot: slots.Since(genesis), - mode: modeNonConstrained, - }) - if err := queue.start(); err != nil { return err } for data := range queue.fetchedData { From 1a0c07deec614b25693f6b79af291bd017ac6634 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Mon, 8 Apr 2024 12:49:20 +0800 Subject: [PATCH 032/325] Extend Broadcast Window For Attestations (#13858) * fix it * make check better --- beacon-chain/p2p/broadcaster.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index 10b209390800..f5923d95a8c8 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -10,6 +10,7 @@ import ( "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" @@ -137,11 +138,11 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 // In the event our attestation is outdated and beyond the // acceptable threshold, we exit early and do not broadcast it. currSlot := slots.CurrentSlot(uint64(s.genesisTime.Unix())) - if att.Data.Slot+params.BeaconConfig().SlotsPerEpoch < currSlot { + if err := helpers.ValidateAttestationTime(att.Data.Slot, s.genesisTime, params.BeaconConfig().MaximumGossipClockDisparityDuration()); err != nil { log.WithFields(logrus.Fields{ "attestationSlot": att.Data.Slot, "currentSlot": currSlot, - }).Warning("Attestation is too old to broadcast, discarding it") + }).WithError(err).Warning("Attestation is too old to broadcast, discarding it") return } From bd00f851f0fbbcf93eb98ecc065655ece449c793 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Tue, 9 Apr 2024 09:51:56 +0200 Subject: [PATCH 033/325] `e2e`: Expected log `Running node with peerId=` -> `Running node with`. (#13861) Rationale: The `FindFollowingTextInFile` seems to have troubles with `logrus` fields. --- testing/endtoend/components/beacon_node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/endtoend/components/beacon_node.go b/testing/endtoend/components/beacon_node.go index 54638d9c5042..42895d2af3df 100644 --- a/testing/endtoend/components/beacon_node.go +++ b/testing/endtoend/components/beacon_node.go @@ -315,7 +315,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { } if config.UseFixedPeerIDs { - peerId, err := helpers.FindFollowingTextInFile(stdOutFile, "Running node with peerId=") + peerId, err := helpers.FindFollowingTextInFile(stdOutFile, "Running node with") if err != nil { return fmt.Errorf("could not find peer id: %w", err) } From 0d6070e6fc4807e8d33c80393326b4d4d5442050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 11 Apr 2024 23:06:00 +0900 Subject: [PATCH 034/325] Use retention period when fetching blobs (#13869) --- beacon-chain/db/filesystem/blob.go | 5 +++ beacon-chain/db/filesystem/blob_test.go | 42 +++++++++++++++++++++++++ beacon-chain/rpc/lookup/blocker.go | 2 +- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index 3fa4e4ee62a3..d2f04ce4604c 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -299,6 +299,11 @@ func (bs *BlobStorage) Clear() error { return nil } +// WithinRetentionPeriod checks if the requested epoch is within the blob retention period. +func (bs *BlobStorage) WithinRetentionPeriod(requested, current primitives.Epoch) bool { + return requested+bs.retentionEpochs >= current +} + type blobNamer struct { root [32]byte index uint64 diff --git a/beacon-chain/db/filesystem/blob_test.go b/beacon-chain/db/filesystem/blob_test.go index e23c09dafa37..fe9d655982ea 100644 --- a/beacon-chain/db/filesystem/blob_test.go +++ b/beacon-chain/db/filesystem/blob_test.go @@ -248,3 +248,45 @@ func TestNewBlobStorage(t *testing.T) { _, err = NewBlobStorage(WithBasePath(path.Join(t.TempDir(), "good"))) require.NoError(t, err) } + +func TestConfig_WithinRetentionPeriod(t *testing.T) { + retention := primitives.Epoch(16) + storage := &BlobStorage{retentionEpochs: retention} + + cases := []struct { + name string + requested primitives.Epoch + current primitives.Epoch + within bool + }{ + { + name: "before", + requested: 0, + current: retention + 1, + within: false, + }, + { + name: "same", + requested: 0, + current: 0, + within: true, + }, + { + name: "boundary", + requested: 0, + current: retention, + within: true, + }, + { + name: "one less", + requested: retention - 1, + current: retention, + within: true, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + require.Equal(t, c.within, storage.WithinRetentionPeriod(c.requested, c.current)) + }) + } +} diff --git a/beacon-chain/rpc/lookup/blocker.go b/beacon-chain/rpc/lookup/blocker.go index 0e9d6ddfb80c..39ec3aa91b46 100644 --- a/beacon-chain/rpc/lookup/blocker.go +++ b/beacon-chain/rpc/lookup/blocker.go @@ -223,7 +223,7 @@ func (p *BeaconDbBlocker) Blobs(ctx context.Context, id string, indices []uint64 return nil, &core.RpcError{Err: errors.Wrap(err, "failed to retrieve block from db"), Reason: core.Internal} } // if block is not in the retention window return 200 w/ empty list - if !params.WithinDAPeriod(slots.ToEpoch(b.Block().Slot()), slots.ToEpoch(p.GenesisTimeFetcher.CurrentSlot())) { + if !p.BlobStorage.WithinRetentionPeriod(slots.ToEpoch(b.Block().Slot()), slots.ToEpoch(p.GenesisTimeFetcher.CurrentSlot())) { return make([]*blocks.VerifiedROBlob, 0), nil } commitments, err := b.Block().Body().BlobKzgCommitments() From c0acb7d35269fb77f9a4cf759c9ae2863326612e Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:22:29 -0500 Subject: [PATCH 035/325] Backfill throttling (#13855) * add a sleep between retries as a simple throttle * unit test * deepsource --------- Co-authored-by: Kasey Kirkham --- beacon-chain/sync/backfill/batch.go | 39 ++++++++++++++++++++++-- beacon-chain/sync/backfill/batch_test.go | 22 +++++++++++++ beacon-chain/sync/backfill/pool.go | 5 +++ 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/beacon-chain/sync/backfill/batch.go b/beacon-chain/sync/backfill/batch.go index 0691fffafb8b..99098fd58340 100644 --- a/beacon-chain/sync/backfill/batch.go +++ b/beacon-chain/sync/backfill/batch.go @@ -1,6 +1,7 @@ package backfill import ( + "context" "fmt" "sort" "time" @@ -55,6 +56,8 @@ const ( batchEndSequence ) +var retryDelay = time.Second + type batchId string type batch struct { @@ -62,6 +65,7 @@ type batch struct { scheduled time.Time seq int // sequence identifier, ie how many times has the sequence() method served this batch retries int + retryAfter time.Time begin primitives.Slot end primitives.Slot // half-open interval, [begin, end), ie >= start, < end. results verifiedROBlocks @@ -74,7 +78,7 @@ type batch struct { } func (b batch) logFields() logrus.Fields { - return map[string]interface{}{ + f := map[string]interface{}{ "batchId": b.id(), "state": b.state.String(), "scheduled": b.scheduled.String(), @@ -86,6 +90,10 @@ func (b batch) logFields() logrus.Fields { "blockPid": b.blockPid, "blobPid": b.blobPid, } + if b.retries > 0 { + f["retryAfter"] = b.retryAfter.String() + } + return f } func (b batch) replaces(r batch) bool { @@ -153,7 +161,8 @@ func (b batch) withState(s batchState) batch { switch b.state { case batchErrRetryable: b.retries += 1 - log.WithFields(b.logFields()).Info("Sequencing batch for retry") + b.retryAfter = time.Now().Add(retryDelay) + log.WithFields(b.logFields()).Info("Sequencing batch for retry after delay") case batchInit, batchNil: b.firstScheduled = b.scheduled } @@ -190,8 +199,32 @@ func (b batch) availabilityStore() das.AvailabilityStore { return b.bs.store } +var batchBlockUntil = func(ctx context.Context, untilRetry time.Duration, b batch) error { + log.WithFields(b.logFields()).WithField("untilRetry", untilRetry.String()). + Debug("Sleeping for retry backoff delay") + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(untilRetry): + return nil + } +} + +func (b batch) waitUntilReady(ctx context.Context) error { + // Wait to retry a failed batch to avoid hammering peers + // if we've hit a state where batches will consistently fail. + // Avoids spamming requests and logs. + if b.retries > 0 { + untilRetry := time.Until(b.retryAfter) + if untilRetry > time.Millisecond { + return batchBlockUntil(ctx, untilRetry, b) + } + } + return nil +} + func sortBatchDesc(bb []batch) { sort.Slice(bb, func(i, j int) bool { - return bb[j].end < bb[i].end + return bb[i].end > bb[j].end }) } diff --git a/beacon-chain/sync/backfill/batch_test.go b/beacon-chain/sync/backfill/batch_test.go index 12c1563ff588..d46dbea83855 100644 --- a/beacon-chain/sync/backfill/batch_test.go +++ b/beacon-chain/sync/backfill/batch_test.go @@ -1,8 +1,11 @@ package backfill import ( + "context" "testing" + "time" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -19,3 +22,22 @@ func TestSortBatchDesc(t *testing.T) { require.Equal(t, orderOut[i], batches[i].end) } } + +func TestWaitUntilReady(t *testing.T) { + b := batch{}.withState(batchErrRetryable) + require.Equal(t, time.Time{}, b.retryAfter) + var got time.Duration + wur := batchBlockUntil + var errDerp = errors.New("derp") + batchBlockUntil = func(_ context.Context, ur time.Duration, _ batch) error { + got = ur + return errDerp + } + // retries counter and timestamp are set when we mark the batch for sequencing, if it is in the retry state + b = b.withState(batchSequenced) + require.ErrorIs(t, b.waitUntilReady(context.Background()), errDerp) + require.Equal(t, true, retryDelay-time.Until(b.retryAfter) < time.Millisecond) + require.Equal(t, true, got < retryDelay && got > retryDelay-time.Millisecond) + require.Equal(t, 1, b.retries) + batchBlockUntil = wur +} diff --git a/beacon-chain/sync/backfill/pool.go b/beacon-chain/sync/backfill/pool.go index 70f90414cd32..a6cf8fdfa5c0 100644 --- a/beacon-chain/sync/backfill/pool.go +++ b/beacon-chain/sync/backfill/pool.go @@ -143,6 +143,11 @@ func (p *p2pBatchWorkerPool) batchRouter(pa PeerAssigner) { return } for _, pid := range assigned { + if err := todo[0].waitUntilReady(p.ctx); err != nil { + log.WithError(p.ctx.Err()).Info("p2pBatchWorkerPool context canceled, shutting down") + p.shutdown(p.ctx.Err()) + return + } busy[pid] = true todo[0].busy = pid p.toWorkers <- todo[0].withPeer(pid) From 090a3e1ded6469f6ae8d63b1f84035da4856a072 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Thu, 11 Apr 2024 18:07:44 -0500 Subject: [PATCH 036/325] Fix bug from PR 13827 (#13871) * fix AS cache bug, tighten ro constructors * additional coverage on AS cache filter --------- Co-authored-by: Kasey Kirkham --- beacon-chain/das/cache.go | 4 +- beacon-chain/das/cache_test.go | 147 +++++++++++++++++++++ beacon-chain/sync/rpc_send_request_test.go | 8 +- beacon-chain/verification/batch.go | 4 +- consensus-types/blocks/kzg_test.go | 3 +- consensus-types/blocks/roblob.go | 27 ++-- consensus-types/blocks/roblob_test.go | 118 +++++++++++------ consensus-types/blocks/roblock_test.go | 102 ++++++++++++++ consensus-types/blocks/types.go | 3 + 9 files changed, 363 insertions(+), 53 deletions(-) diff --git a/beacon-chain/das/cache.go b/beacon-chain/das/cache.go index 3e8d781bead9..9702743f944e 100644 --- a/beacon-chain/das/cache.go +++ b/beacon-chain/das/cache.go @@ -92,7 +92,7 @@ func (e *cacheEntry) filter(root [32]byte, kc safeCommitmentArray) ([]blocks.ROB if e.diskSummary.AllAvailable(kc.count()) { return nil, nil } - scs := make([]blocks.ROBlob, kc.count()) + scs := make([]blocks.ROBlob, 0, kc.count()) for i := uint64(0); i < fieldparams.MaxBlobsPerBlock; i++ { // We already have this blob, we don't need to write it or validate it. if e.diskSummary.HasIndex(i) { @@ -111,7 +111,7 @@ func (e *cacheEntry) filter(root [32]byte, kc safeCommitmentArray) ([]blocks.ROB if !bytes.Equal(kc[i], e.scs[i].KzgCommitment) { return nil, errors.Wrapf(errCommitmentMismatch, "root=%#x, index=%#x, commitment=%#x, block commitment=%#x", root, i, e.scs[i].KzgCommitment, kc[i]) } - scs[i] = *e.scs[i] + scs = append(scs, *e.scs[i]) } return scs, nil diff --git a/beacon-chain/das/cache_test.go b/beacon-chain/das/cache_test.go index 923503b9895c..cd271fc516ed 100644 --- a/beacon-chain/das/cache_test.go +++ b/beacon-chain/das/cache_test.go @@ -3,9 +3,14 @@ package das import ( "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" ) func TestCacheEnsureDelete(t *testing.T) { @@ -23,3 +28,145 @@ func TestCacheEnsureDelete(t *testing.T) { var nilEntry *cacheEntry require.Equal(t, nilEntry, c.entries[k]) } + +type filterTestCaseSetupFunc func(t *testing.T) (*cacheEntry, safeCommitmentArray, []blocks.ROBlob) + +func filterTestCaseSetup(slot primitives.Slot, nBlobs int, onDisk []int, numExpected int) filterTestCaseSetupFunc { + return func(t *testing.T) (*cacheEntry, safeCommitmentArray, []blocks.ROBlob) { + blk, blobs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, nBlobs) + commits, err := commitmentsToCheck(blk, blk.Block().Slot()) + require.NoError(t, err) + entry := &cacheEntry{} + if len(onDisk) > 0 { + od := map[[32]byte][]int{blk.Root(): onDisk} + sumz := filesystem.NewMockBlobStorageSummarizer(t, od) + sum := sumz.Summary(blk.Root()) + entry.setDiskSummary(sum) + } + expected := make([]blocks.ROBlob, 0, nBlobs) + for i := 0; i < commits.count(); i++ { + if entry.diskSummary.HasIndex(uint64(i)) { + continue + } + // If we aren't telling the cache a blob is on disk, add it to the expected list and stash. + expected = append(expected, blobs[i]) + require.NoError(t, entry.stash(&blobs[i])) + } + require.Equal(t, numExpected, len(expected)) + return entry, commits, expected + } +} + +func TestFilterDiskSummary(t *testing.T) { + denebSlot, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) + require.NoError(t, err) + cases := []struct { + name string + setup filterTestCaseSetupFunc + }{ + { + name: "full blobs, all on disk", + setup: filterTestCaseSetup(denebSlot, 6, []int{0, 1, 2, 3, 4, 5}, 0), + }, + { + name: "full blobs, first on disk", + setup: filterTestCaseSetup(denebSlot, 6, []int{0}, 5), + }, + { + name: "full blobs, middle on disk", + setup: filterTestCaseSetup(denebSlot, 6, []int{2}, 5), + }, + { + name: "full blobs, last on disk", + setup: filterTestCaseSetup(denebSlot, 6, []int{5}, 5), + }, + { + name: "full blobs, none on disk", + setup: filterTestCaseSetup(denebSlot, 6, []int{}, 6), + }, + { + name: "one commitment, on disk", + setup: filterTestCaseSetup(denebSlot, 1, []int{0}, 0), + }, + { + name: "one commitment, not on disk", + setup: filterTestCaseSetup(denebSlot, 1, []int{}, 1), + }, + { + name: "two commitments, first on disk", + setup: filterTestCaseSetup(denebSlot, 2, []int{0}, 1), + }, + { + name: "two commitments, last on disk", + setup: filterTestCaseSetup(denebSlot, 2, []int{1}, 1), + }, + { + name: "two commitments, none on disk", + setup: filterTestCaseSetup(denebSlot, 2, []int{}, 2), + }, + { + name: "two commitments, all on disk", + setup: filterTestCaseSetup(denebSlot, 2, []int{0, 1}, 0), + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + entry, commits, expected := c.setup(t) + // first (root) argument doesn't matter, it is just for logs + got, err := entry.filter([32]byte{}, commits) + require.NoError(t, err) + require.Equal(t, len(expected), len(got)) + }) + } +} + +func TestFilter(t *testing.T) { + denebSlot, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) + require.NoError(t, err) + cases := []struct { + name string + setup func(t *testing.T) (*cacheEntry, safeCommitmentArray, []blocks.ROBlob) + err error + }{ + { + name: "commitments mismatch - extra sidecar", + setup: func(t *testing.T) (*cacheEntry, safeCommitmentArray, []blocks.ROBlob) { + entry, commits, expected := filterTestCaseSetup(denebSlot, 6, []int{0, 1}, 4)(t) + commits[5] = nil + return entry, commits, expected + }, + err: errCommitmentMismatch, + }, + { + name: "sidecar missing", + setup: func(t *testing.T) (*cacheEntry, safeCommitmentArray, []blocks.ROBlob) { + entry, commits, expected := filterTestCaseSetup(denebSlot, 6, []int{0, 1}, 4)(t) + entry.scs[5] = nil + return entry, commits, expected + }, + err: errMissingSidecar, + }, + { + name: "commitments mismatch - different bytes", + setup: func(t *testing.T) (*cacheEntry, safeCommitmentArray, []blocks.ROBlob) { + entry, commits, expected := filterTestCaseSetup(denebSlot, 6, []int{0, 1}, 4)(t) + entry.scs[5].KzgCommitment = []byte("nope") + return entry, commits, expected + }, + err: errCommitmentMismatch, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + entry, commits, expected := c.setup(t) + // first (root) argument doesn't matter, it is just for logs + got, err := entry.filter([32]byte{}, commits) + if c.err != nil { + require.ErrorIs(t, err, c.err) + return + } + require.NoError(t, err) + require.Equal(t, len(expected), len(got)) + }) + } +} diff --git a/beacon-chain/sync/rpc_send_request_test.go b/beacon-chain/sync/rpc_send_request_test.go index c8cabe66a645..4fb2321e60e6 100644 --- a/beacon-chain/sync/rpc_send_request_test.go +++ b/beacon-chain/sync/rpc_send_request_test.go @@ -482,7 +482,10 @@ func TestSendRequest_SendBeaconBlocksByRootRequest(t *testing.T) { func TestBlobValidatorFromRootReq(t *testing.T) { rootA := bytesutil.PadTo([]byte("valid"), 32) rootB := bytesutil.PadTo([]byte("invalid"), 32) - header := ðpb.SignedBeaconBlockHeader{} + header := ðpb.SignedBeaconBlockHeader{ + Header: ðpb.BeaconBlockHeader{Slot: 0}, + Signature: make([]byte, fieldparams.BLSSignatureLength), + } blobSidecarA0 := util.GenerateTestDenebBlobSidecar(t, bytesutil.ToBytes32(rootA), header, 0, []byte{}, make([][]byte, 0)) blobSidecarA1 := util.GenerateTestDenebBlobSidecar(t, bytesutil.ToBytes32(rootA), header, 1, []byte{}, make([][]byte, 0)) blobSidecarB0 := util.GenerateTestDenebBlobSidecar(t, bytesutil.ToBytes32(rootB), header, 0, []byte{}, make([][]byte, 0)) @@ -590,7 +593,8 @@ func TestBlobValidatorFromRangeReq(t *testing.T) { t.Run(c.name, func(t *testing.T) { vf := blobValidatorFromRangeReq(c.req) header := ðpb.SignedBeaconBlockHeader{ - Header: ðpb.BeaconBlockHeader{Slot: c.responseSlot}, + Header: ðpb.BeaconBlockHeader{Slot: c.responseSlot}, + Signature: make([]byte, fieldparams.BLSSignatureLength), } sc := util.GenerateTestDenebBlobSidecar(t, [32]byte{}, header, 0, []byte{}, make([][]byte, 0)) err := vf(sc) diff --git a/beacon-chain/verification/batch.go b/beacon-chain/verification/batch.go index c84923769958..080a74044b6e 100644 --- a/beacon-chain/verification/batch.go +++ b/beacon-chain/verification/batch.go @@ -46,10 +46,12 @@ func (batch *BlobBatchVerifier) VerifiedROBlobs(ctx context.Context, blk blocks. if len(scs) == 0 { return nil, nil } + blkSig := blk.Signature() // We assume the proposer is validated wrt the block in batch block processing before performing the DA check. // So at this stage we just need to make sure the value being signed and signature bytes match the block. for i := range scs { - if blk.Signature() != bytesutil.ToBytes96(scs[i].SignedBlockHeader.Signature) { + blobSig := bytesutil.ToBytes96(scs[i].SignedBlockHeader.Signature) + if blkSig != blobSig { return nil, ErrBatchSignatureMismatch } // Extra defensive check to make sure the roots match. This should be unnecessary in practice since the root from diff --git a/consensus-types/blocks/kzg_test.go b/consensus-types/blocks/kzg_test.go index 9febaafef908..8bc6c5498315 100644 --- a/consensus-types/blocks/kzg_test.go +++ b/consensus-types/blocks/kzg_test.go @@ -244,7 +244,8 @@ func Test_VerifyKZGInclusionProof(t *testing.T) { StateRoot: make([]byte, 32), } signedHeader := ðpb.SignedBeaconBlockHeader{ - Header: header, + Header: header, + Signature: make([]byte, fieldparams.BLSSignatureLength), } sidecar := ðpb.BlobSidecar{ Index: uint64(index), diff --git a/consensus-types/blocks/roblob.go b/consensus-types/blocks/roblob.go index bf3fbef68b90..a55a9b03bc19 100644 --- a/consensus-types/blocks/roblob.go +++ b/consensus-types/blocks/roblob.go @@ -1,35 +1,42 @@ package blocks import ( - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -var errNilBlockHeader = errors.New("received nil beacon block header") - // ROBlob represents a read-only blob sidecar with its block root. type ROBlob struct { *ethpb.BlobSidecar root [32]byte } +func roblobNilCheck(b *ethpb.BlobSidecar) error { + if b == nil { + return errNilBlob + } + if b.SignedBlockHeader == nil || b.SignedBlockHeader.Header == nil { + return errNilBlockHeader + } + if len(b.SignedBlockHeader.Signature) == 0 { + return errMissingBlockSignature + } + return nil +} + // NewROBlobWithRoot creates a new ROBlob with a given root. func NewROBlobWithRoot(b *ethpb.BlobSidecar, root [32]byte) (ROBlob, error) { - if b == nil { - return ROBlob{}, errNilBlock + if err := roblobNilCheck(b); err != nil { + return ROBlob{}, err } return ROBlob{BlobSidecar: b, root: root}, nil } // NewROBlob creates a new ROBlob by computing the HashTreeRoot of the header. func NewROBlob(b *ethpb.BlobSidecar) (ROBlob, error) { - if b == nil { - return ROBlob{}, errNilBlock - } - if b.SignedBlockHeader == nil || b.SignedBlockHeader.Header == nil { - return ROBlob{}, errNilBlockHeader + if err := roblobNilCheck(b); err != nil { + return ROBlob{}, err } root, err := b.SignedBlockHeader.Header.HashTreeRoot() if err != nil { diff --git a/consensus-types/blocks/roblob_test.go b/consensus-types/blocks/roblob_test.go index eb2490360372..12b7bfd13ff4 100644 --- a/consensus-types/blocks/roblob_test.go +++ b/consensus-types/blocks/roblob_test.go @@ -5,50 +5,94 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" ) -func TestNewROBlobWithRoot(t *testing.T) { - sidecar := ðpb.BlobSidecar{} - root := [32]byte{} - - blob, err := NewROBlobWithRoot(sidecar, root) - assert.NoError(t, err) - assert.Equal(t, root, blob.BlockRoot()) - - blob, err = NewROBlobWithRoot(nil, root) - assert.Equal(t, errNilBlock, err) -} - -// TestNewROBlob tests the NewROBlob function. -func TestNewROBlob(t *testing.T) { - h := ðpb.SignedBeaconBlockHeader{ - Header: ðpb.BeaconBlockHeader{ - ParentRoot: make([]byte, fieldparams.RootLength), - StateRoot: make([]byte, fieldparams.RootLength), - BodyRoot: make([]byte, fieldparams.RootLength), +func TestROBlobNilChecks(t *testing.T) { + cases := []struct { + name string + bfunc func(t *testing.T) *ethpb.BlobSidecar + err error + root []byte + }{ + { + name: "nil signed blob", + bfunc: func(t *testing.T) *ethpb.BlobSidecar { + return nil + }, + err: errNilBlob, + root: bytesutil.PadTo([]byte("sup"), 32), + }, + { + name: "nil signed block header", + bfunc: func(t *testing.T) *ethpb.BlobSidecar { + return ðpb.BlobSidecar{ + SignedBlockHeader: nil, + } + }, + err: errNilBlockHeader, + root: bytesutil.PadTo([]byte("sup"), 32), + }, + { + name: "nil inner header", + bfunc: func(t *testing.T) *ethpb.BlobSidecar { + return ðpb.BlobSidecar{ + SignedBlockHeader: ðpb.SignedBeaconBlockHeader{ + Header: nil, + }, + } + }, + err: errNilBlockHeader, + root: bytesutil.PadTo([]byte("sup"), 32), + }, + { + name: "nil signature", + bfunc: func(t *testing.T) *ethpb.BlobSidecar { + return ðpb.BlobSidecar{ + SignedBlockHeader: ðpb.SignedBeaconBlockHeader{ + Header: ðpb.BeaconBlockHeader{ + ParentRoot: make([]byte, fieldparams.RootLength), + StateRoot: make([]byte, fieldparams.RootLength), + BodyRoot: make([]byte, fieldparams.RootLength), + }, + Signature: nil, + }, + } + }, + err: errMissingBlockSignature, + root: bytesutil.PadTo([]byte("sup"), 32), }, - Signature: make([]byte, fieldparams.BLSSignatureLength), } - sidecar := ðpb.BlobSidecar{ - SignedBlockHeader: h, + for _, c := range cases { + t.Run(c.name+" NewROBlob", func(t *testing.T) { + b := c.bfunc(t) + bl, err := NewROBlob(b) + if c.err != nil { + require.ErrorIs(t, err, c.err) + } else { + require.NoError(t, err) + hr, err := b.SignedBlockHeader.HashTreeRoot() + require.NoError(t, err) + require.Equal(t, hr, bl.BlockRoot()) + } + }) + if len(c.root) == 0 { + continue + } + t.Run(c.name+" NewROBlobWithRoot", func(t *testing.T) { + b := c.bfunc(t) + // We want the same validation when specifying a root. + bl, err := NewROBlobWithRoot(b, bytesutil.ToBytes32(c.root)) + if c.err != nil { + require.ErrorIs(t, err, c.err) + } else { + assert.Equal(t, bytesutil.ToBytes32(c.root), bl.BlockRoot()) + } + }) } - - blob, err := NewROBlob(sidecar) - assert.NoError(t, err) - assert.NotNil(t, blob) - - _, err = NewROBlob(nil) - assert.Equal(t, errNilBlock, err) - - sidecar.SignedBlockHeader = nil - _, err = NewROBlob(sidecar) - assert.Equal(t, errNilBlockHeader, err) - - sidecar.SignedBlockHeader = ðpb.SignedBeaconBlockHeader{} - _, err = NewROBlob(sidecar) - assert.Equal(t, errNilBlockHeader, err) } func TestBlockRoot(t *testing.T) { diff --git a/consensus-types/blocks/roblock_test.go b/consensus-types/blocks/roblock_test.go index 841571cb38d9..45abcf994e8e 100644 --- a/consensus-types/blocks/roblock_test.go +++ b/consensus-types/blocks/roblock_test.go @@ -4,9 +4,11 @@ import ( "sort" "testing" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -88,3 +90,103 @@ func testROBlock(t *testing.T, slot primitives.Slot, root [32]byte) ROBlock { root: root, } } + +func TestROBlockNilChecks(t *testing.T) { + cases := []struct { + name string + bfunc func(t *testing.T) interfaces.SignedBeaconBlock + err error + root []byte + }{ + { + name: "happy path", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + b, err := NewSignedBeaconBlock(hydrateSignedBeaconBlock()) + require.NoError(t, err) + return b + }, + }, + { + name: "happy path - with root", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + b, err := NewSignedBeaconBlock(hydrateSignedBeaconBlock()) + require.NoError(t, err) + return b + }, + root: bytesutil.PadTo([]byte("sup"), 32), + }, + { + name: "nil signed block", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + return nil + }, + err: ErrNilSignedBeaconBlock, + }, + { + name: "nil signed block - with root", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + return nil + }, + err: ErrNilSignedBeaconBlock, + root: bytesutil.PadTo([]byte("sup"), 32), + }, + { + name: "nil inner block", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + return &SignedBeaconBlock{ + version: version.Deneb, + block: nil, + signature: bytesutil.ToBytes96(nil), + } + }, + err: ErrNilSignedBeaconBlock, + }, + { + name: "nil inner block", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + return &SignedBeaconBlock{ + version: version.Deneb, + block: nil, + signature: bytesutil.ToBytes96(nil), + } + }, + err: ErrNilSignedBeaconBlock, + }, + { + name: "nil block body", + bfunc: func(t *testing.T) interfaces.SignedBeaconBlock { + bb := &BeaconBlock{ + version: version.Deneb, + slot: 0, + proposerIndex: 0, + parentRoot: bytesutil.ToBytes32(nil), + stateRoot: bytesutil.ToBytes32(nil), + body: nil, + } + return &SignedBeaconBlock{ + version: version.Deneb, + block: bb, + signature: bytesutil.ToBytes96(nil), + } + }, + err: ErrNilSignedBeaconBlock, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + b := c.bfunc(t) + var err error + if len(c.root) == 0 { + _, err = NewROBlock(b) + } else { + _, err = NewROBlockWithRoot(b, bytesutil.ToBytes32(c.root)) + } + if c.err != nil { + require.ErrorIs(t, err, c.err) + return + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/consensus-types/blocks/types.go b/consensus-types/blocks/types.go index c714e297268e..0ad61da033e0 100644 --- a/consensus-types/blocks/types.go +++ b/consensus-types/blocks/types.go @@ -27,10 +27,13 @@ const ( var ( // ErrUnsupportedVersion for beacon block methods. ErrUnsupportedVersion = errors.New("unsupported beacon block version") + errNilBlob = errors.New("received nil blob sidecar") errNilBlock = errors.New("received nil beacon block") errNilBlockBody = errors.New("received nil beacon block body") errIncorrectBlockVersion = errors.New(incorrectBlockVersion) errIncorrectBodyVersion = errors.New(incorrectBodyVersion) + errNilBlockHeader = errors.New("received nil beacon block header") + errMissingBlockSignature = errors.New("received nil beacon block signature") ) // BeaconBlockBody is the main beacon block body structure. It can represent any block type. From f2ce115ade55d2c01faa10d67f48cc8ca80e7bc3 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Fri, 12 Apr 2024 14:49:01 +0800 Subject: [PATCH 037/325] Revert Peer Log Changes (#13872) --- beacon-chain/p2p/options.go | 2 +- testing/endtoend/components/beacon_node.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon-chain/p2p/options.go b/beacon-chain/p2p/options.go index 9935e8e0aef4..de213848333a 100644 --- a/beacon-chain/p2p/options.go +++ b/beacon-chain/p2p/options.go @@ -86,7 +86,7 @@ func (s *Service) buildOptions(ip net.IP, priKey *ecdsa.PrivateKey) ([]libp2p.Op return nil, errors.Wrapf(err, "cannot get ID from public key: %s", ifaceKey.GetPublic().Type().String()) } - log.WithField("peerId", id).Info("Running node with") + log.Infof("Running node with peer id of %s ", id.String()) options := []libp2p.Option{ privKeyOption(priKey), diff --git a/testing/endtoend/components/beacon_node.go b/testing/endtoend/components/beacon_node.go index 42895d2af3df..580fdccec1cf 100644 --- a/testing/endtoend/components/beacon_node.go +++ b/testing/endtoend/components/beacon_node.go @@ -315,7 +315,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { } if config.UseFixedPeerIDs { - peerId, err := helpers.FindFollowingTextInFile(stdOutFile, "Running node with") + peerId, err := helpers.FindFollowingTextInFile(stdOutFile, "Running node with peer id of ") if err != nil { return fmt.Errorf("could not find peer id: %w", err) } From 425f5387fafb980c09d37c2a25977c4732a3c41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 12 Apr 2024 16:17:12 +0900 Subject: [PATCH 038/325] Handle overflow in retention period calculation (#13874) --- beacon-chain/db/filesystem/blob.go | 5 +++++ beacon-chain/db/filesystem/blob_test.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index d2f04ce4604c..78ad550c4dd9 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -3,6 +3,7 @@ package filesystem import ( "context" "fmt" + "math" "os" "path" "strconv" @@ -301,6 +302,10 @@ func (bs *BlobStorage) Clear() error { // WithinRetentionPeriod checks if the requested epoch is within the blob retention period. func (bs *BlobStorage) WithinRetentionPeriod(requested, current primitives.Epoch) bool { + if requested > math.MaxUint64-bs.retentionEpochs { + // If there is an overflow, then the retention period was set to an extremely large number. + return true + } return requested+bs.retentionEpochs >= current } diff --git a/beacon-chain/db/filesystem/blob_test.go b/beacon-chain/db/filesystem/blob_test.go index fe9d655982ea..7c78a848989b 100644 --- a/beacon-chain/db/filesystem/blob_test.go +++ b/beacon-chain/db/filesystem/blob_test.go @@ -2,6 +2,7 @@ package filesystem import ( "bytes" + "math" "os" "path" "sync" @@ -289,4 +290,9 @@ func TestConfig_WithinRetentionPeriod(t *testing.T) { require.Equal(t, c.within, storage.WithinRetentionPeriod(c.requested, c.current)) }) } + + t.Run("overflow", func(t *testing.T) { + storage := &BlobStorage{retentionEpochs: math.MaxUint64} + require.Equal(t, true, storage.WithinRetentionPeriod(1, 1)) + }) } From 8cd05f098bb7876909aac23e51fc30917867344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 12 Apr 2024 16:19:40 +0900 Subject: [PATCH 039/325] Use read only validators in Beacon API (#13873) --- .../rpc/eth/beacon/handlers_validator.go | 11 +----- beacon-chain/state/interfaces.go | 1 + .../state/state-native/getters_validator.go | 37 +++++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/beacon-chain/rpc/eth/beacon/handlers_validator.go b/beacon-chain/rpc/eth/beacon/handlers_validator.go index 1339576450ab..bc79f890cc2a 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_validator.go +++ b/beacon-chain/rpc/eth/beacon/handlers_validator.go @@ -369,16 +369,7 @@ func decodeIds(w http.ResponseWriter, st state.BeaconState, rawIds []string, ign func valsFromIds(w http.ResponseWriter, st state.BeaconState, ids []primitives.ValidatorIndex) ([]state.ReadOnlyValidator, bool) { var vals []state.ReadOnlyValidator if len(ids) == 0 { - allVals := st.Validators() - vals = make([]state.ReadOnlyValidator, len(allVals)) - for i, val := range allVals { - readOnlyVal, err := statenative.NewValidator(val) - if err != nil { - httputil.HandleError(w, "Could not convert validator: "+err.Error(), http.StatusInternalServerError) - return nil, false - } - vals[i] = readOnlyVal - } + vals = st.ValidatorsReadOnly() } else { vals = make([]state.ReadOnlyValidator, 0, len(ids)) for _, id := range ids { diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 11d063ebf43f..0a6a92a27772 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -118,6 +118,7 @@ type ReadOnlyValidator interface { // ReadOnlyValidators defines a struct which only has read access to validators methods. type ReadOnlyValidators interface { Validators() []*ethpb.Validator + ValidatorsReadOnly() []ReadOnlyValidator ValidatorAtIndex(idx primitives.ValidatorIndex) (*ethpb.Validator, error) ValidatorAtIndexReadOnly(idx primitives.ValidatorIndex) (ReadOnlyValidator, error) ValidatorIndexByPubkey(key [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool) diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index 89cbbf461ec5..979a8d9163c6 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -21,6 +21,14 @@ func (b *BeaconState) Validators() []*ethpb.Validator { return b.validatorsVal() } +// ValidatorsReadOnly participating in consensus on the beacon chain. +func (b *BeaconState) ValidatorsReadOnly() []state.ReadOnlyValidator { + b.lock.RLock() + defer b.lock.RUnlock() + + return b.validatorsReadOnlyVal() +} + func (b *BeaconState) validatorsVal() []*ethpb.Validator { var v []*ethpb.Validator if features.Get().EnableExperimentalState { @@ -46,6 +54,35 @@ func (b *BeaconState) validatorsVal() []*ethpb.Validator { return res } +func (b *BeaconState) validatorsReadOnlyVal() []state.ReadOnlyValidator { + var v []*ethpb.Validator + if features.Get().EnableExperimentalState { + if b.validatorsMultiValue == nil { + return nil + } + v = b.validatorsMultiValue.Value(b) + } else { + if b.validators == nil { + return nil + } + v = b.validators + } + + res := make([]state.ReadOnlyValidator, len(v)) + var err error + for i := 0; i < len(res); i++ { + val := v[i] + if val == nil { + continue + } + res[i], err = NewValidator(val) + if err != nil { + continue + } + } + return res +} + // references of validators participating in consensus on the beacon chain. // This assumes that a lock is already held on BeaconState. This does not // copy fully and instead just copies the reference. From ba6dff3adb56ebf9fe46f308ae59cd7e4183f7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 12 Apr 2024 19:24:30 +0900 Subject: [PATCH 040/325] Return syncing status when node is optimistic (#13875) --- beacon-chain/rpc/eth/node/handlers.go | 11 ++++++++--- beacon-chain/rpc/eth/node/handlers_test.go | 21 ++++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/beacon-chain/rpc/eth/node/handlers.go b/beacon-chain/rpc/eth/node/handlers.go index 6143fe435899..7ccae43ed4ad 100644 --- a/beacon-chain/rpc/eth/node/handlers.go +++ b/beacon-chain/rpc/eth/node/handlers.go @@ -108,7 +108,7 @@ func (*Server) GetVersion(w http.ResponseWriter, r *http.Request) { // GetHealth returns node health status in http status codes. Useful for load balancers. func (s *Server) GetHealth(w http.ResponseWriter, r *http.Request) { - _, span := trace.StartSpan(r.Context(), "node.GetHealth") + ctx, span := trace.StartSpan(r.Context(), "node.GetHealth") defer span.End() rawSyncingStatus, syncingStatus, ok := shared.UintFromQuery(w, r, "syncing_status", false) @@ -119,10 +119,14 @@ func (s *Server) GetHealth(w http.ResponseWriter, r *http.Request) { return } - if s.SyncChecker.Synced() { + optimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx) + if err != nil { + httputil.HandleError(w, "Could not check optimistic status: "+err.Error(), http.StatusInternalServerError) + } + if s.SyncChecker.Synced() && !optimistic { return } - if s.SyncChecker.Syncing() || s.SyncChecker.Initialized() { + if s.SyncChecker.Syncing() || optimistic { if rawSyncingStatus != "" { w.WriteHeader(intSyncingStatus) } else { @@ -130,5 +134,6 @@ func (s *Server) GetHealth(w http.ResponseWriter, r *http.Request) { } return } + w.WriteHeader(http.StatusServiceUnavailable) } diff --git a/beacon-chain/rpc/eth/node/handlers_test.go b/beacon-chain/rpc/eth/node/handlers_test.go index ce53b8d5ecd4..4b5d9bf9f396 100644 --- a/beacon-chain/rpc/eth/node/handlers_test.go +++ b/beacon-chain/rpc/eth/node/handlers_test.go @@ -91,8 +91,10 @@ func TestGetVersion(t *testing.T) { func TestGetHealth(t *testing.T) { checker := &syncmock.Sync{} + optimisticFetcher := &mock.ChainService{Optimistic: false} s := &Server{ - SyncChecker: checker, + SyncChecker: checker, + OptimisticModeFetcher: optimisticFetcher, } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/health", nil) @@ -101,25 +103,30 @@ func TestGetHealth(t *testing.T) { s.GetHealth(writer, request) assert.Equal(t, http.StatusServiceUnavailable, writer.Code) - checker.IsInitialized = true - request = httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/health", nil) + checker.IsSyncing = true + checker.IsSynced = false + request = httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/node/health?syncing_status=%d", http.StatusPaymentRequired), nil) writer = httptest.NewRecorder() writer.Body = &bytes.Buffer{} s.GetHealth(writer, request) - assert.Equal(t, http.StatusPartialContent, writer.Code) + assert.Equal(t, http.StatusPaymentRequired, writer.Code) - request = httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/node/health?syncing_status=%d", http.StatusPaymentRequired), nil) + checker.IsSyncing = false + checker.IsSynced = true + request = httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/health", nil) writer = httptest.NewRecorder() writer.Body = &bytes.Buffer{} s.GetHealth(writer, request) - assert.Equal(t, http.StatusPaymentRequired, writer.Code) + assert.Equal(t, http.StatusOK, writer.Code) + checker.IsSyncing = false checker.IsSynced = true + optimisticFetcher.Optimistic = true request = httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/health", nil) writer = httptest.NewRecorder() writer.Body = &bytes.Buffer{} s.GetHealth(writer, request) - assert.Equal(t, http.StatusOK, writer.Code) + assert.Equal(t, http.StatusPartialContent, writer.Code) } func TestGetIdentity(t *testing.T) { From 5f909caedff426563b7eec2498bdb8baeeb1bde0 Mon Sep 17 00:00:00 2001 From: terence Date: Sun, 14 Apr 2024 09:38:25 -0700 Subject: [PATCH 041/325] Remove unused IsViableForCheckpoint (#13879) --- beacon-chain/blockchain/chain_info.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/beacon-chain/blockchain/chain_info.go b/beacon-chain/blockchain/chain_info.go index e9c9d6a09775..30dfeac9642b 100644 --- a/beacon-chain/blockchain/chain_info.go +++ b/beacon-chain/blockchain/chain_info.go @@ -11,7 +11,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" f "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" - forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -399,14 +398,6 @@ func (s *Service) InForkchoice(root [32]byte) bool { return s.cfg.ForkChoiceStore.HasNode(root) } -// IsViableForCheckpoint returns whether the given checkpoint is a checkpoint in any -// chain known to forkchoice -func (s *Service) IsViableForCheckpoint(cp *forkchoicetypes.Checkpoint) (bool, error) { - s.cfg.ForkChoiceStore.RLock() - defer s.cfg.ForkChoiceStore.RUnlock() - return s.cfg.ForkChoiceStore.IsViableForCheckpoint(cp) -} - // IsOptimisticForRoot takes the root as argument instead of the current head // and returns true if it is optimistic. func (s *Service) IsOptimisticForRoot(ctx context.Context, root [32]byte) (bool, error) { From aec349f75ade78be71555cfcd085196d6a1ce942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 15 Apr 2024 14:56:47 +0900 Subject: [PATCH 042/325] Upgrade the Beacon API e2e evaluator (#13868) * GET * POST * Revert "Auxiliary commit to revert individual files from 615feb104004d6a945ededf5862ae38325fc7ec2" This reverts commit 55cf071c684019f3d6124179154c10b2277fda49. * comment fix * deepsource --- .../endtoend/evaluators/beaconapi/requests.go | 284 ++++++++---------- .../endtoend/evaluators/beaconapi/types.go | 45 ++- testing/endtoend/evaluators/beaconapi/util.go | 43 +-- .../endtoend/evaluators/beaconapi/verify.go | 122 ++++++-- 4 files changed, 281 insertions(+), 213 deletions(-) diff --git a/testing/endtoend/evaluators/beaconapi/requests.go b/testing/endtoend/evaluators/beaconapi/requests.go index b2593993635d..291b70741f5c 100644 --- a/testing/endtoend/evaluators/beaconapi/requests.go +++ b/testing/endtoend/evaluators/beaconapi/requests.go @@ -10,129 +10,117 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) -var requests = map[string]endpoint{ +var getRequests = map[string]endpoint{ "/beacon/genesis": newMetadata[structs.GetGenesisResponse](v1PathTemplate), - "/beacon/states/{param1}/root": newMetadata[structs.GetStateRootResponse](v1PathTemplate, + "/beacon/states/{param1}/root": newMetadata[structs.GetStateRootResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/states/{param1}/fork": newMetadata[structs.GetStateForkResponse](v1PathTemplate, + "/beacon/states/{param1}/fork": newMetadata[structs.GetStateForkResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/states/{param1}/finality_checkpoints": newMetadata[structs.GetFinalityCheckpointsResponse](v1PathTemplate, + "/beacon/states/{param1}/finality_checkpoints": newMetadata[structs.GetFinalityCheckpointsResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), // we want to test comma-separated query params - "/beacon/states/{param1}/validators?id=0,1": newMetadata[structs.GetValidatorsResponse](v1PathTemplate, + "/beacon/states/{param1}/validators?id=0,1": newMetadata[structs.GetValidatorsResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/states/{param1}/validators/{param2}": newMetadata[structs.GetValidatorResponse](v1PathTemplate, + "/beacon/states/{param1}/validators/{param2}": newMetadata[structs.GetValidatorResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head", "0"} })), - "/beacon/states/{param1}/validator_balances?id=0,1": newMetadata[structs.GetValidatorBalancesResponse](v1PathTemplate, + "/beacon/states/{param1}/validator_balances?id=0,1": newMetadata[structs.GetValidatorBalancesResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/states/{param1}/committees?index=0": newMetadata[structs.GetCommitteesResponse](v1PathTemplate, + "/beacon/states/{param1}/committees?index=0": newMetadata[structs.GetCommitteesResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/states/{param1}/sync_committees": newMetadata[structs.GetSyncCommitteeResponse](v1PathTemplate, + "/beacon/states/{param1}/sync_committees": newMetadata[structs.GetSyncCommitteeResponse]( + v1PathTemplate, withStart(params.BeaconConfig().AltairForkEpoch), withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/states/{param1}/randao": newMetadata[structs.GetRandaoResponse](v1PathTemplate, + "/beacon/states/{param1}/randao": newMetadata[structs.GetRandaoResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), "/beacon/headers": newMetadata[structs.GetBlockHeadersResponse](v1PathTemplate), - "/beacon/headers/{param1}": newMetadata[structs.GetBlockHeaderResponse](v1PathTemplate, - withParams(func(e primitives.Epoch) []string { + "/beacon/headers/{param1}": newMetadata[structs.GetBlockHeaderResponse]( + v1PathTemplate, + withParams(func(currentEpoch primitives.Epoch) []string { slot := uint64(0) - if e > 0 { - slot = (uint64(e) * uint64(params.BeaconConfig().SlotsPerEpoch)) - 1 + if currentEpoch > 0 { + slot = (uint64(currentEpoch) * uint64(params.BeaconConfig().SlotsPerEpoch)) - 1 } return []string{fmt.Sprintf("%v", slot)} })), - "/beacon/blocks/{param1}": newMetadata[structs.GetBlockV2Response](v2PathTemplate, + "/beacon/blocks/{param1}": newMetadata[structs.GetBlockV2Response]( + v2PathTemplate, withSsz(), withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/blocks/{param1}/root": newMetadata[structs.BlockRootResponse](v1PathTemplate, + "/beacon/blocks/{param1}/root": newMetadata[structs.BlockRootResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/blocks/{param1}/attestations": newMetadata[structs.GetBlockAttestationsResponse](v1PathTemplate, + "/beacon/blocks/{param1}/attestations": newMetadata[structs.GetBlockAttestationsResponse]( + v1PathTemplate, withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/blinded_blocks/{param1}": newMetadata[structs.GetBlockV2Response](v1PathTemplate, + "/beacon/blob_sidecars/{param1}": newMetadata[structs.SidecarsResponse]( + v1PathTemplate, + withStart(params.BeaconConfig().DenebForkEpoch), withSsz(), withParams(func(_ primitives.Epoch) []string { return []string{"head"} })), - "/beacon/pool/attestations": newMetadata[structs.ListAttestationsResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.ListAttestationsResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.ListAttestationsResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil - })), - "/beacon/pool/attester_slashings": newMetadata[structs.GetAttesterSlashingsResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.GetAttesterSlashingsResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetAttesterSlashingsResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil - })), - "/beacon/pool/proposer_slashings": newMetadata[structs.GetProposerSlashingsResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.GetProposerSlashingsResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetProposerSlashingsResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil - })), - "/beacon/pool/voluntary_exits": newMetadata[structs.ListVoluntaryExitsResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.ListVoluntaryExitsResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.ListVoluntaryExitsResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil + "/beacon/blinded_blocks/{param1}": newMetadata[structs.GetBlockV2Response]( + v1PathTemplate, + withSsz(), + withParams(func(_ primitives.Epoch) []string { + return []string{"head"} })), - "/beacon/pool/bls_to_execution_changes": newMetadata[structs.BLSToExecutionChangesPoolResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.BLSToExecutionChangesPoolResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.BLSToExecutionChangesPoolResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil + "/beacon/pool/attestations": newMetadata[structs.ListAttestationsResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/beacon/pool/attester_slashings": newMetadata[structs.GetAttesterSlashingsResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/beacon/pool/proposer_slashings": newMetadata[structs.GetProposerSlashingsResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/beacon/pool/voluntary_exits": newMetadata[structs.ListVoluntaryExitsResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/beacon/pool/bls_to_execution_changes": newMetadata[structs.BLSToExecutionChangesPoolResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/builder/states/{param1}/expected_withdrawals": newMetadata[structs.ExpectedWithdrawalsResponse]( + v1PathTemplate, + withStart(params.CapellaE2EForkEpoch), + withParams(func(_ primitives.Epoch) []string { + return []string{"head"} })), - "/config/fork_schedule": newMetadata[structs.GetForkScheduleResponse](v1PathTemplate, + "/config/fork_schedule": newMetadata[structs.GetForkScheduleResponse]( + v1PathTemplate, withCustomEval(func(p interface{}, lh interface{}) error { pResp, ok := p.(*structs.GetForkScheduleResponse) if !ok { @@ -142,12 +130,6 @@ var requests = map[string]endpoint{ if !ok { return fmt.Errorf(msgWrongJson, &structs.GetForkScheduleResponse{}, lh) } - if pResp.Data == nil { - return errEmptyPrysmData - } - if lhResp.Data == nil { - return errEmptyLighthouseData - } // remove all forks with far-future epoch for i := len(pResp.Data) - 1; i >= 0; i-- { if pResp.Data[i].Epoch == fmt.Sprintf("%d", params.BeaconConfig().FarFutureEpoch) { @@ -161,69 +143,52 @@ var requests = map[string]endpoint{ } return compareJSON(pResp, lhResp) })), + "/config/spec": newMetadata[structs.GetSpecResponse]( + v1PathTemplate, + withSanityCheckOnly()), "/config/deposit_contract": newMetadata[structs.GetDepositContractResponse](v1PathTemplate), - "/debug/beacon/heads": newMetadata[structs.GetForkChoiceHeadsV2Response](v2PathTemplate), - "/node/identity": newMetadata[structs.GetIdentityResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.GetIdentityResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetIdentityResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil - })), - "/node/peers": newMetadata[structs.GetPeersResponse](v1PathTemplate, - withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.GetPeersResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetPeersResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil + "/debug/beacon/states/{param1}": newMetadata[structs.GetBeaconStateV2Response]( + v2PathTemplate, + withSanityCheckOnly(), + withSsz(), + withParams(func(_ primitives.Epoch) []string { + return []string{"head"} })), - "/node/peer_count": newMetadata[structs.GetPeerCountResponse](v1PathTemplate, + "/debug/beacon/heads": newMetadata[structs.GetForkChoiceHeadsV2Response]( + v2PathTemplate, + withSanityCheckOnly()), + "/debug/fork_choice": newMetadata[structs.GetForkChoiceDumpResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/node/identity": newMetadata[structs.GetIdentityResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/node/peers": newMetadata[structs.GetPeersResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/node/peer_count": newMetadata[structs.GetPeerCountResponse]( + v1PathTemplate, + withSanityCheckOnly()), + "/node/version": newMetadata[structs.GetVersionResponse]( + v1PathTemplate, withCustomEval(func(p interface{}, _ interface{}) error { - pResp, ok := p.(*structs.GetPeerCountResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetPeerCountResponse{}, p) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - return nil - })), - "/node/version": newMetadata[structs.GetVersionResponse](v1PathTemplate, - withCustomEval(func(p interface{}, lh interface{}) error { pResp, ok := p.(*structs.GetVersionResponse) if !ok { return fmt.Errorf(msgWrongJson, &structs.ListAttestationsResponse{}, p) } - lhResp, ok := lh.(*structs.GetVersionResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.ListAttestationsResponse{}, p) - } if pResp.Data == nil { return errEmptyPrysmData } if !strings.Contains(pResp.Data.Version, "Prysm") { return errors.New("version response does not contain Prysm client name") } - if lhResp.Data == nil { - return errEmptyLighthouseData - } - if !strings.Contains(lhResp.Data.Version, "Lighthouse") { - return errors.New("version response does not contain Lighthouse client name") - } return nil })), "/node/syncing": newMetadata[structs.SyncStatusResponse](v1PathTemplate), - "/validator/duties/proposer/{param1}": newMetadata[structs.GetProposerDutiesResponse](v1PathTemplate, - withParams(func(e primitives.Epoch) []string { - return []string{fmt.Sprintf("%v", e)} + "/validator/duties/proposer/{param1}": newMetadata[structs.GetProposerDutiesResponse]( + v1PathTemplate, + withParams(func(currentEpoch primitives.Epoch) []string { + return []string{fmt.Sprintf("%v", currentEpoch)} }), withCustomEval(func(p interface{}, lh interface{}) error { pResp, ok := p.(*structs.GetProposerDutiesResponse) @@ -241,39 +206,56 @@ var requests = map[string]endpoint{ return errEmptyLighthouseData } if lhResp.Data[0].Slot == "0" { - // remove the first item from lighthouse data since lighthouse is returning a value despite no proposer - // there is no proposer on slot 0 so prysm don't return anything for slot 0 + // Lighthouse returns a proposer for slot 0 and Prysm doesn't lhResp.Data = lhResp.Data[1:] } return compareJSON(pResp, lhResp) })), - "/validator/duties/attester/{param1}": newMetadata[structs.GetAttesterDutiesResponse](v1PathTemplate, - withParams(func(e primitives.Epoch) []string { - //ask for a future epoch to test this case - return []string{fmt.Sprintf("%v", e+1)} +} + +var postRequests = map[string]endpoint{ + "/beacon/states/{param1}/validators": newMetadata[structs.GetValidatorsResponse]( + v1PathTemplate, + withParams(func(_ primitives.Epoch) []string { + return []string{"head"} }), - withReq(func() []string { + withPOSTObj(func() interface{} { + return struct { + Ids []string `json:"ids"` + Statuses []string `json:"statuses"` + }{Ids: []string{"0", "1"}, Statuses: nil} + }())), + "/beacon/states/{param1}/validator_balances": newMetadata[structs.GetValidatorBalancesResponse]( + v1PathTemplate, + withParams(func(_ primitives.Epoch) []string { + return []string{"head"} + }), + withPOSTObj(func() []string { + return []string{"0", "1"} + }())), + "/validator/duties/attester/{param1}": newMetadata[structs.GetAttesterDutiesResponse]( + v1PathTemplate, + withParams(func(currentEpoch primitives.Epoch) []string { + return []string{fmt.Sprintf("%v", currentEpoch)} + }), + withPOSTObj(func() []string { validatorIndices := make([]string, 64) - for key := range validatorIndices { - validatorIndices[key] = fmt.Sprintf("%d", key) + for i := range validatorIndices { + validatorIndices[i] = fmt.Sprintf("%d", i) } return validatorIndices - }()), - withCustomEval(func(p interface{}, lh interface{}) error { - pResp, ok := p.(*structs.GetAttesterDutiesResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetAttesterDutiesResponse{}, p) - } - lhResp, ok := lh.(*structs.GetAttesterDutiesResponse) - if !ok { - return fmt.Errorf(msgWrongJson, &structs.GetAttesterDutiesResponse{}, lh) - } - if pResp.Data == nil { - return errEmptyPrysmData - } - if lhResp.Data == nil { - return errEmptyLighthouseData + }())), + "/validator/duties/sync/{param1}": newMetadata[structs.GetSyncCommitteeDutiesResponse]( + v1PathTemplate, + withStart(params.AltairE2EForkEpoch), + withParams(func(currentEpoch primitives.Epoch) []string { + return []string{fmt.Sprintf("%v", currentEpoch)} + }), + withPOSTObj(func() []string { + validatorIndices := make([]string, 64) + for i := range validatorIndices { + validatorIndices[i] = fmt.Sprintf("%d", i) } - return compareJSON(pResp, lhResp) - })), + return validatorIndices + }())), } diff --git a/testing/endtoend/evaluators/beaconapi/types.go b/testing/endtoend/evaluators/beaconapi/types.go index 27b122500c6a..5de88160d1f5 100644 --- a/testing/endtoend/evaluators/beaconapi/types.go +++ b/testing/endtoend/evaluators/beaconapi/types.go @@ -1,17 +1,21 @@ package beaconapi -import "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +import ( + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) type endpoint interface { getBasePath() string + sanityCheckOnlyEnabled() bool + enableSanityCheckOnly() sszEnabled() bool enableSsz() getSszResp() []byte // retrieves the Prysm SSZ response setSszResp(resp []byte) // sets the Prysm SSZ response getStart() primitives.Epoch setStart(start primitives.Epoch) - getReq() interface{} - setReq(req interface{}) + getPOSTObj() interface{} + setPOSTObj(obj interface{}) getPResp() interface{} // retrieves the Prysm JSON response getLHResp() interface{} // retrieves the Lighthouse JSON response getParams(epoch primitives.Epoch) []string @@ -22,9 +26,10 @@ type endpoint interface { type apiEndpoint[Resp any] struct { basePath string + sanity bool ssz bool start primitives.Epoch - req interface{} + postObj interface{} pResp *Resp // Prysm JSON response lhResp *Resp // Lighthouse JSON response sszResp []byte // Prysm SSZ response @@ -36,6 +41,14 @@ func (e *apiEndpoint[Resp]) getBasePath() string { return e.basePath } +func (e *apiEndpoint[Resp]) sanityCheckOnlyEnabled() bool { + return e.sanity +} + +func (e *apiEndpoint[Resp]) enableSanityCheckOnly() { + e.sanity = true +} + func (e *apiEndpoint[Resp]) sszEnabled() bool { return e.ssz } @@ -60,12 +73,12 @@ func (e *apiEndpoint[Resp]) setStart(start primitives.Epoch) { e.start = start } -func (e *apiEndpoint[Resp]) getReq() interface{} { - return e.req +func (e *apiEndpoint[Resp]) getPOSTObj() interface{} { + return e.postObj } -func (e *apiEndpoint[Resp]) setReq(req interface{}) { - e.req = req +func (e *apiEndpoint[Resp]) setPOSTObj(obj interface{}) { + e.postObj = obj } func (e *apiEndpoint[Resp]) getPResp() interface{} { @@ -109,30 +122,42 @@ func newMetadata[Resp any](basePath string, opts ...endpointOpt) *apiEndpoint[Re type endpointOpt func(endpoint) +// We only care if the request was successful, without comparing responses. +func withSanityCheckOnly() endpointOpt { + return func(e endpoint) { + e.enableSanityCheckOnly() + } +} + +// We request SSZ data too. func withSsz() endpointOpt { return func(e endpoint) { e.enableSsz() } } +// We begin issuing the request at a particular epoch. func withStart(start primitives.Epoch) endpointOpt { return func(e endpoint) { e.setStart(start) } } -func withReq(req interface{}) endpointOpt { +// We perform a POST instead of GET, sending an object. +func withPOSTObj(obj interface{}) endpointOpt { return func(e endpoint) { - e.setReq(req) + e.setPOSTObj(obj) } } +// We specify URL parameters. func withParams(f func(currentEpoch primitives.Epoch) []string) endpointOpt { return func(e endpoint) { e.setParams(f) } } +// We perform custom evaluation on responses. func withCustomEval(f func(interface{}, interface{}) error) endpointOpt { return func(e endpoint) { e.setCustomEval(f) diff --git a/testing/endtoend/evaluators/beaconapi/util.go b/testing/endtoend/evaluators/beaconapi/util.go index cf26eccc8543..5c8aa1d70fb5 100644 --- a/testing/endtoend/evaluators/beaconapi/util.go +++ b/testing/endtoend/evaluators/beaconapi/util.go @@ -25,16 +25,16 @@ const ( msgSSZUnmarshalFailed = "failed to unmarshal SSZ" ) -func doJSONGetRequest(template string, requestPath string, beaconNodeIdx int, resp interface{}, bnType ...string) error { +func doJSONGetRequest(template, requestPath string, beaconNodeIdx int, resp interface{}, bnType ...string) error { if len(bnType) == 0 { - bnType = []string{"prysm"} + bnType = []string{"Prysm"} } var port int switch bnType[0] { - case "prysm": + case "Prysm": port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort - case "lighthouse": + case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: return fmt.Errorf(msgUnknownNode, bnType[0]) @@ -55,6 +55,7 @@ func doJSONGetRequest(template string, requestPath string, beaconNodeIdx int, re return err } } else { + defer closeBody(httpResp.Body) body, err = io.ReadAll(httpResp.Body) if err != nil { return err @@ -65,17 +66,16 @@ func doJSONGetRequest(template string, requestPath string, beaconNodeIdx int, re return json.NewDecoder(httpResp.Body).Decode(&resp) } -func doSSZGetRequest(template string, requestPath string, beaconNodeIdx int, bnType ...string) ([]byte, error) { +func doSSZGetRequest(template, requestPath string, beaconNodeIdx int, bnType ...string) ([]byte, error) { if len(bnType) == 0 { - bnType = []string{"prysm"} + bnType = []string{"Prysm"} } - client := &http.Client{} var port int switch bnType[0] { - case "prysm": + case "Prysm": port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort - case "lighthouse": + case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: return nil, fmt.Errorf(msgUnknownNode, bnType[0]) @@ -83,24 +83,24 @@ func doSSZGetRequest(template string, requestPath string, beaconNodeIdx int, bnT basePath := fmt.Sprintf(template, port+beaconNodeIdx) - req, err := http.NewRequest(http.MethodGet, basePath+requestPath, nil) + req, err := http.NewRequest(http.MethodGet, basePath+requestPath, http.NoBody) if err != nil { return nil, err } req.Header.Set("Accept", "application/octet-stream") - rsp, err := client.Do(req) + resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } - if rsp.StatusCode != http.StatusOK { + if resp.StatusCode != http.StatusOK { var body interface{} - if err := json.NewDecoder(rsp.Body).Decode(&body); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, err } - return nil, fmt.Errorf(msgRequestFailed, bnType[0], rsp.StatusCode, body) + return nil, fmt.Errorf(msgRequestFailed, bnType[0], resp.StatusCode, body) } - defer closeBody(rsp.Body) - body, err := io.ReadAll(rsp.Body) + defer closeBody(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } @@ -108,23 +108,23 @@ func doSSZGetRequest(template string, requestPath string, beaconNodeIdx int, bnT return body, nil } -func doJSONPostRequest(template string, requestPath string, beaconNodeIdx int, postData, resp interface{}, bnType ...string) error { +func doJSONPostRequest(template, requestPath string, beaconNodeIdx int, postObj, resp interface{}, bnType ...string) error { if len(bnType) == 0 { - bnType = []string{"prysm"} + bnType = []string{"Prysm"} } var port int switch bnType[0] { - case "prysm": + case "Prysm": port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort - case "lighthouse": + case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: return fmt.Errorf(msgUnknownNode, bnType[0]) } basePath := fmt.Sprintf(template, port+beaconNodeIdx) - b, err := json.Marshal(postData) + b, err := json.Marshal(postObj) if err != nil { return err } @@ -144,6 +144,7 @@ func doJSONPostRequest(template string, requestPath string, beaconNodeIdx int, p return err } } else { + defer closeBody(httpResp.Body) body, err = io.ReadAll(httpResp.Body) if err != nil { return err diff --git a/testing/endtoend/evaluators/beaconapi/verify.go b/testing/endtoend/evaluators/beaconapi/verify.go index a16fbc94688b..9ee9e4d66325 100644 --- a/testing/endtoend/evaluators/beaconapi/verify.go +++ b/testing/endtoend/evaluators/beaconapi/verify.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "net/http" "reflect" "strconv" "strings" @@ -14,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + params2 "github.com/prysmaticlabs/prysm/v5/testing/endtoend/params" "github.com/prysmaticlabs/prysm/v5/testing/endtoend/policies" e2etypes "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -54,7 +56,7 @@ func run(nodeIdx int) error { } currentEpoch := slots.EpochsSinceGenesis(time.Unix(genesisTime, 0)) - for path, m := range requests { + for path, m := range getRequests { if currentEpoch < m.getStart() { continue } @@ -62,26 +64,57 @@ func run(nodeIdx int) error { if m.getParams(currentEpoch) != nil { apiPath = pathFromParams(path, m.getParams(currentEpoch)) } - fmt.Printf("executing JSON path: %s\n", apiPath) - if err = compareJSONMultiClient(nodeIdx, m.getBasePath(), apiPath, m.getReq(), m.getPResp(), m.getLHResp(), m.getCustomEval()); err != nil { - return err - } - if m.sszEnabled() { - fmt.Printf("executing SSZ path: %s\n", apiPath) - b, err := compareSSZMultiClient(nodeIdx, m.getBasePath(), apiPath) - if err != nil { + + if m.sanityCheckOnlyEnabled() { + resp := m.getPResp() + if err = doJSONGetRequest(m.getBasePath(), apiPath, nodeIdx, resp); err != nil { + return errors.Wrapf(err, "issue during Prysm JSON GET request for path %s", apiPath) + } + if resp == nil { + return fmt.Errorf("nil response from Prysm JSON GET request for path %s", apiPath) + } + if m.sszEnabled() { + sszResp, err := doSSZGetRequest(m.getBasePath(), apiPath, nodeIdx) + if err != nil { + return errors.Wrapf(err, "issue during Prysm SSZ GET request for path %s", apiPath) + } + if sszResp == nil { + return fmt.Errorf("nil response from Prysm SSZ GET request for path %s", apiPath) + } + } + } else { + if err = compareGETJSON(nodeIdx, m.getBasePath(), apiPath, m.getPResp(), m.getLHResp(), m.getCustomEval()); err != nil { return err } - m.setSszResp(b) + if m.sszEnabled() { + b, err := compareGETSSZ(nodeIdx, m.getBasePath(), apiPath) + if err != nil { + return err + } + m.setSszResp(b) + } + } + } + + for path, m := range postRequests { + if currentEpoch < m.getStart() { + continue + } + apiPath := path + if m.getParams(currentEpoch) != nil { + apiPath = pathFromParams(path, m.getParams(currentEpoch)) + } + if err = comparePOSTJSON(nodeIdx, m.getBasePath(), apiPath, m.getPOSTObj(), m.getPResp(), m.getLHResp(), m.getCustomEval()); err != nil { + return err } } - return postEvaluation(requests, currentEpoch) + return postEvaluation(nodeIdx, getRequests, currentEpoch) } // postEvaluation performs additional evaluation after all requests have been completed. // It is useful for things such as checking if specific fields match between endpoints. -func postEvaluation(requests map[string]endpoint, epoch primitives.Epoch) error { +func postEvaluation(nodeIdx int, requests map[string]endpoint, epoch primitives.Epoch) error { // verify that block SSZ responses have the correct structure blockData := requests["/beacon/blocks/{param1}"] blindedBlockData := requests["/beacon/blinded_blocks/{param1}"] @@ -147,24 +180,51 @@ func postEvaluation(requests map[string]endpoint, epoch primitives.Epoch) error return fmt.Errorf("header root %s does not match duties root %s ", header.Data.Root, duties.DependentRoot) } + // perform a health check + basePath := fmt.Sprintf(v1PathTemplate, params2.PrysmBeaconNodeGatewayPort+nodeIdx) + resp, err := http.Get(basePath + "/node/health") + if err != nil { + return errors.Wrap(err, "could not perform a health check") + } + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("health check response's status code is %d", resp.StatusCode) + } + return nil } -func compareJSONMultiClient(nodeIdx int, base, path string, req, pResp, lhResp interface{}, customEval func(interface{}, interface{}) error) error { - if req != nil { - if err := doJSONPostRequest(base, path, nodeIdx, req, pResp); err != nil { - return errors.Wrapf(err, "could not perform Prysm JSON POST request for path %s", path) - } - if err := doJSONPostRequest(base, path, nodeIdx, req, lhResp, "lighthouse"); err != nil { - return errors.Wrapf(err, "could not perform Lighthouse JSON POST request for path %s", path) - } +func compareGETJSON(nodeIdx int, base, path string, pResp, lhResp interface{}, customEval func(interface{}, interface{}) error) error { + if err := doJSONGetRequest(base, path, nodeIdx, pResp); err != nil { + return errors.Wrapf(err, "issue during Prysm JSON GET request for path %s", path) + } + if err := doJSONGetRequest(base, path, nodeIdx, lhResp, "Lighthouse"); err != nil { + return errors.Wrapf(err, "issue during Lighthouse JSON GET request for path %s", path) + } + if pResp == nil { + return errEmptyPrysmData + } + if lhResp == nil { + return errEmptyLighthouseData + } + if customEval != nil { + return customEval(pResp, lhResp) } else { - if err := doJSONGetRequest(base, path, nodeIdx, pResp); err != nil { - return errors.Wrapf(err, "could not perform Prysm JSON GET request for path %s", path) - } - if err := doJSONGetRequest(base, path, nodeIdx, lhResp, "lighthouse"); err != nil { - return errors.Wrapf(err, "could not perform Lighthouse JSON GET request for path %s", path) - } + return compareJSON(pResp, lhResp) + } +} + +func comparePOSTJSON(nodeIdx int, base, path string, postObj, pResp, lhResp interface{}, customEval func(interface{}, interface{}) error) error { + if err := doJSONPostRequest(base, path, nodeIdx, postObj, pResp); err != nil { + return errors.Wrapf(err, "issue during Prysm JSON POST request for path %s", path) + } + if err := doJSONPostRequest(base, path, nodeIdx, postObj, lhResp, "Lighthouse"); err != nil { + return errors.Wrapf(err, "issue during Lighthouse JSON POST request for path %s", path) + } + if pResp == nil { + return errEmptyPrysmData + } + if lhResp == nil { + return errEmptyLighthouseData } if customEval != nil { return customEval(pResp, lhResp) @@ -173,14 +233,14 @@ func compareJSONMultiClient(nodeIdx int, base, path string, req, pResp, lhResp i } } -func compareSSZMultiClient(nodeIdx int, base, path string) ([]byte, error) { +func compareGETSSZ(nodeIdx int, base, path string) ([]byte, error) { pResp, err := doSSZGetRequest(base, path, nodeIdx) if err != nil { - return nil, errors.Wrapf(err, "could not perform Prysm SSZ GET request for path %s", path) + return nil, errors.Wrapf(err, "issue during Prysm SSZ GET request for path %s", path) } - lhResp, err := doSSZGetRequest(base, path, nodeIdx, "lighthouse") + lhResp, err := doSSZGetRequest(base, path, nodeIdx, "Lighthouse") if err != nil { - return nil, errors.Wrapf(err, "could not perform Lighthouse SSZ GET request for path %s", path) + return nil, errors.Wrapf(err, "issue during Lighthouse SSZ GET request for path %s", path) } if !bytes.Equal(pResp, lhResp) { return nil, errors.New("Prysm SSZ response does not match Lighthouse SSZ response") @@ -188,7 +248,7 @@ func compareSSZMultiClient(nodeIdx int, base, path string) ([]byte, error) { return pResp, nil } -func compareJSON(pResp interface{}, lhResp interface{}) error { +func compareJSON(pResp, lhResp interface{}) error { if !reflect.DeepEqual(pResp, lhResp) { p, err := json.Marshal(pResp) if err != nil { From 219301339c4e62440e1f1e0e30433b3874185038 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:28:01 -0500 Subject: [PATCH 043/325] Don't return error that can be internally handled (#13887) Co-authored-by: Kasey Kirkham --- beacon-chain/db/filesystem/blob_test.go | 12 ++++-------- beacon-chain/db/filesystem/mock.go | 4 ++-- beacon-chain/db/filesystem/pruner_test.go | 12 ++++-------- beacon-chain/rpc/lookup/blocker_test.go | 3 +-- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/beacon-chain/db/filesystem/blob_test.go b/beacon-chain/db/filesystem/blob_test.go index 7c78a848989b..cd75c1fbedb4 100644 --- a/beacon-chain/db/filesystem/blob_test.go +++ b/beacon-chain/db/filesystem/blob_test.go @@ -25,8 +25,7 @@ func TestBlobStorage_SaveBlobData(t *testing.T) { require.NoError(t, err) t.Run("no error for duplicate", func(t *testing.T) { - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) existingSidecar := testSidecars[0] blobPath := namerForSidecar(existingSidecar).path() @@ -130,8 +129,7 @@ func TestBlobStorage_SaveBlobData(t *testing.T) { // pollUntil polls a condition function until it returns true or a timeout is reached. func TestBlobIndicesBounds(t *testing.T) { - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) root := [32]byte{} okIdx := uint64(fieldparams.MaxBlobsPerBlock - 1) @@ -162,8 +160,7 @@ func writeFakeSSZ(t *testing.T, fs afero.Fs, root [32]byte, idx uint64) { func TestBlobStoragePrune(t *testing.T) { currentSlot := primitives.Slot(200000) - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) t.Run("PruneOne", func(t *testing.T) { _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 300, fieldparams.MaxBlobsPerBlock) @@ -219,8 +216,7 @@ func TestBlobStoragePrune(t *testing.T) { func BenchmarkPruning(b *testing.B) { var t *testing.T - _, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + _, bs := NewEphemeralBlobStorageWithFs(t) blockQty := 10000 currentSlot := primitives.Slot(150000) diff --git a/beacon-chain/db/filesystem/mock.go b/beacon-chain/db/filesystem/mock.go index ba079e7cc4dc..53d6427f6852 100644 --- a/beacon-chain/db/filesystem/mock.go +++ b/beacon-chain/db/filesystem/mock.go @@ -21,13 +21,13 @@ func NewEphemeralBlobStorage(t testing.TB) *BlobStorage { // NewEphemeralBlobStorageWithFs can be used by tests that want access to the virtual filesystem // in order to interact with it outside the parameters of the BlobStorage api. -func NewEphemeralBlobStorageWithFs(t testing.TB) (afero.Fs, *BlobStorage, error) { +func NewEphemeralBlobStorageWithFs(t testing.TB) (afero.Fs, *BlobStorage) { fs := afero.NewMemMapFs() pruner, err := newBlobPruner(fs, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest, withWarmedCache()) if err != nil { t.Fatal("test setup issue", err) } - return fs, &BlobStorage{fs: fs, pruner: pruner}, nil + return fs, &BlobStorage{fs: fs, pruner: pruner} } type BlobMocker struct { diff --git a/beacon-chain/db/filesystem/pruner_test.go b/beacon-chain/db/filesystem/pruner_test.go index b089ea8183d0..ee5dbeb213ab 100644 --- a/beacon-chain/db/filesystem/pruner_test.go +++ b/beacon-chain/db/filesystem/pruner_test.go @@ -51,8 +51,7 @@ func TestTryPruneDir_CachedExpired(t *testing.T) { require.Equal(t, 0, pruned) }) t.Run("blobs to delete", func(t *testing.T) { - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) var slot primitives.Slot = 0 _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 2) scs, err := verification.BlobSidecarSliceNoop(sidecars) @@ -83,8 +82,7 @@ func TestTryPruneDir_CachedExpired(t *testing.T) { func TestTryPruneDir_SlotFromFile(t *testing.T) { t.Run("expired blobs deleted", func(t *testing.T) { - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) var slot primitives.Slot = 0 _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 2) scs, err := verification.BlobSidecarSliceNoop(sidecars) @@ -116,8 +114,7 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { require.Equal(t, 0, len(files)) }) t.Run("not expired, intact", func(t *testing.T) { - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) // Set slot equal to the window size, so it should be retained. slot := bs.pruner.windowSize _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 2) @@ -184,8 +181,7 @@ func TestSlotFromFile(t *testing.T) { } for _, c := range cases { t.Run(fmt.Sprintf("slot %d", c.slot), func(t *testing.T) { - fs, bs, err := NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + fs, bs := NewEphemeralBlobStorageWithFs(t) _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, c.slot, 1) sc, err := verification.BlobSidecarNoop(sidecars[0]) require.NoError(t, err) diff --git a/beacon-chain/rpc/lookup/blocker_test.go b/beacon-chain/rpc/lookup/blocker_test.go index f65e70c5c2c2..903e931db1a4 100644 --- a/beacon-chain/rpc/lookup/blocker_test.go +++ b/beacon-chain/rpc/lookup/blocker_test.go @@ -164,8 +164,7 @@ func TestGetBlob(t *testing.T) { db := testDB.SetupDB(t) denebBlock, blobs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 123, 4) require.NoError(t, db.SaveBlock(context.Background(), denebBlock)) - _, bs, err := filesystem.NewEphemeralBlobStorageWithFs(t) - require.NoError(t, err) + _, bs := filesystem.NewEphemeralBlobStorageWithFs(t) testSidecars, err := verification.BlobSidecarSliceNoop(blobs) require.NoError(t, err) for i := range testSidecars { From feb16ae4aaa41d9bcd066b54b779dcd38fc928d2 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:26:49 -0500 Subject: [PATCH 044/325] consistent auth token for validator apis (#13747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * fixing tests * adding more tests especially to handle legacy * fixing linting * fixing deepsource issues and flags * fixing some deepsource issues,pathing issues, and logs * some review items * adding additional review feedback * updating to follow updates from https://github.com/ethereum/keymanager-APIs/pull/74 * adjusting functions to match changes in keymanagers PR * Update validator/rpc/auth_token.go Co-authored-by: Radosław Kapka * Update validator/rpc/auth_token.go Co-authored-by: Radosław Kapka * Update validator/rpc/auth_token.go Co-authored-by: Radosław Kapka * review feedback --------- Co-authored-by: Radosław Kapka --- api/BUILD.bazel | 15 ++- api/constants.go | 2 + api/jwt.go | 32 ++++++ api/jwt_test.go | 13 +++ cmd/beacon-chain/jwt/BUILD.bazel | 3 +- cmd/beacon-chain/jwt/jwt.go | 18 +-- cmd/validator/flags/BUILD.bazel | 1 + cmd/validator/flags/flags.go | 10 ++ cmd/validator/main.go | 1 + cmd/validator/usage.go | 1 + cmd/validator/web/BUILD.bazel | 1 + cmd/validator/web/web.go | 10 +- validator/node/node.go | 12 ++ validator/rpc/BUILD.bazel | 2 +- validator/rpc/auth_token.go | 163 +++++++++++++------------- validator/rpc/auth_token_test.go | 170 ++++++++++++++++++++++------ validator/rpc/handlers_auth.go | 4 +- validator/rpc/handlers_auth_test.go | 7 +- validator/rpc/intercepter.go | 27 ++--- validator/rpc/intercepter_test.go | 102 +++++------------ validator/rpc/server.go | 34 +++--- 21 files changed, 378 insertions(+), 250 deletions(-) create mode 100644 api/jwt.go create mode 100644 api/jwt_test.go diff --git a/api/BUILD.bazel b/api/BUILD.bazel index 5d1e621cbaa0..38cd3a926d73 100644 --- a/api/BUILD.bazel +++ b/api/BUILD.bazel @@ -1,11 +1,24 @@ -load("@prysm//tools/go:def.bzl", "go_library") +load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ "constants.go", "headers.go", + "jwt.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/api", visibility = ["//visibility:public"], + deps = [ + "//crypto/rand:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_pkg_errors//:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["jwt_test.go"], + embed = [":go_default_library"], + deps = ["//testing/require:go_default_library"], ) diff --git a/api/constants.go b/api/constants.go index 0b981f18abeb..4f8fdcd32f9c 100644 --- a/api/constants.go +++ b/api/constants.go @@ -4,4 +4,6 @@ const ( WebUrlPrefix = "/v2/validator/" WebApiUrlPrefix = "/api/v2/validator/" KeymanagerApiPrefix = "/eth/v1" + + AuthTokenFileName = "auth-token" ) diff --git a/api/jwt.go b/api/jwt.go new file mode 100644 index 000000000000..d123aa5a8154 --- /dev/null +++ b/api/jwt.go @@ -0,0 +1,32 @@ +package api + +import ( + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/crypto/rand" +) + +// GenerateRandomHexString generates a random hex string that follows the standards for jwt token +// used for beacon node -> execution client +// used for web client -> validator client +func GenerateRandomHexString() (string, error) { + secret := make([]byte, 32) + randGen := rand.NewGenerator() + n, err := randGen.Read(secret) + if err != nil { + return "", err + } else if n != 32 { + return "", errors.New("rand: unexpected length") + } + return hexutil.Encode(secret), nil +} + +// ValidateAuthToken validating auth token for web +func ValidateAuthToken(token string) error { + b, err := hexutil.Decode(token) + // token should be hex-encoded and at least 256 bits + if err != nil || len(b) < 32 { + return errors.New("invalid auth token: token should be hex-encoded and at least 256 bits") + } + return nil +} diff --git a/api/jwt_test.go b/api/jwt_test.go new file mode 100644 index 000000000000..9296501cfccf --- /dev/null +++ b/api/jwt_test.go @@ -0,0 +1,13 @@ +package api + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestGenerateRandomHexString(t *testing.T) { + token, err := GenerateRandomHexString() + require.NoError(t, err) + require.NoError(t, ValidateAuthToken(token)) +} diff --git a/cmd/beacon-chain/jwt/BUILD.bazel b/cmd/beacon-chain/jwt/BUILD.bazel index 19ba95460629..a23f2f8c3880 100644 --- a/cmd/beacon-chain/jwt/BUILD.bazel +++ b/cmd/beacon-chain/jwt/BUILD.bazel @@ -6,10 +6,9 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/jwt", visibility = ["//visibility:public"], deps = [ + "//api:go_default_library", "//cmd:go_default_library", - "//crypto/rand:go_default_library", "//io/file:go_default_library", - "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", ], diff --git a/cmd/beacon-chain/jwt/jwt.go b/cmd/beacon-chain/jwt/jwt.go index 8fdea40391f8..d93af9c2cb38 100644 --- a/cmd/beacon-chain/jwt/jwt.go +++ b/cmd/beacon-chain/jwt/jwt.go @@ -1,12 +1,10 @@ package jwt import ( - "errors" "path/filepath" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/cmd" - "github.com/prysmaticlabs/prysm/v5/crypto/rand" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" @@ -52,7 +50,7 @@ func generateAuthSecretInFile(c *cli.Context) error { return err } } - secret, err := generateRandomHexString() + secret, err := api.GenerateRandomHexString() if err != nil { return err } @@ -62,15 +60,3 @@ func generateAuthSecretInFile(c *cli.Context) error { logrus.Infof("Successfully wrote JSON-RPC authentication secret to file %s", fileName) return nil } - -func generateRandomHexString() (string, error) { - secret := make([]byte, 32) - randGen := rand.NewGenerator() - n, err := randGen.Read(secret) - if err != nil { - return "", err - } else if n <= 0 { - return "", errors.New("rand: unexpected length") - } - return hexutil.Encode(secret), nil -} diff --git a/cmd/validator/flags/BUILD.bazel b/cmd/validator/flags/BUILD.bazel index 3c4d2b5cf35c..d83a718c4add 100644 --- a/cmd/validator/flags/BUILD.bazel +++ b/cmd/validator/flags/BUILD.bazel @@ -15,6 +15,7 @@ go_library( "//validator:__subpackages__", ], deps = [ + "//api:go_default_library", "//config/params:go_default_library", "//io/file:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index 554d5eab8803..037ffaaf95d2 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -8,6 +8,7 @@ import ( "runtime" "time" + "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/urfave/cli/v2" @@ -133,6 +134,15 @@ var ( Usage: "Port used to listening and respond metrics for Prometheus.", Value: 8081, } + + // AuthTokenPathFlag defines the path to the auth token used to secure the validator api. + AuthTokenPathFlag = &cli.StringFlag{ + Name: "keymanager-token-file", + Usage: "Path to auth token file used for validator apis.", + Value: filepath.Join(filepath.Join(DefaultValidatorDir(), WalletDefaultDirName), api.AuthTokenFileName), + Aliases: []string{"validator-api-bearer-file"}, + } + // WalletDirFlag defines the path to a wallet directory for Prysm accounts. WalletDirFlag = &cli.StringFlag{ Name: "wallet-dir", diff --git a/cmd/validator/main.go b/cmd/validator/main.go index 5692f9ec64f5..4251a720f30c 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -75,6 +75,7 @@ var appFlags = []cli.Flag{ flags.EnableWebFlag, flags.GraffitiFileFlag, flags.EnableDistributed, + flags.AuthTokenPathFlag, // Consensys' Web3Signer flags flags.Web3SignerURLFlag, flags.Web3SignerPublicValidatorKeysFlag, diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index ccc76d2617b9..900af603f12c 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -123,6 +123,7 @@ var appHelpFlagGroups = []flagGroup{ flags.BuilderGasLimitFlag, flags.ValidatorsRegistrationBatchSizeFlag, flags.EnableDistributed, + flags.AuthTokenPathFlag, }, }, { diff --git a/cmd/validator/web/BUILD.bazel b/cmd/validator/web/BUILD.bazel index bc99fe1538c5..f10c97b3f6c4 100644 --- a/cmd/validator/web/BUILD.bazel +++ b/cmd/validator/web/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/cmd/validator/web", visibility = ["//visibility:public"], deps = [ + "//api:go_default_library", "//cmd:go_default_library", "//cmd/validator/flags:go_default_library", "//config/features:go_default_library", diff --git a/cmd/validator/web/web.go b/cmd/validator/web/web.go index f36544c82cfa..34a4edb22ace 100644 --- a/cmd/validator/web/web.go +++ b/cmd/validator/web/web.go @@ -2,7 +2,9 @@ package web import ( "fmt" + "path/filepath" + "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" "github.com/prysmaticlabs/prysm/v5/config/features" @@ -24,6 +26,7 @@ var Commands = &cli.Command{ flags.WalletDirFlag, flags.GRPCGatewayHost, flags.GRPCGatewayPort, + flags.AuthTokenPathFlag, cmd.AcceptTosFlag, }), Before: func(cliCtx *cli.Context) error { @@ -43,7 +46,12 @@ var Commands = &cli.Command{ gatewayHost := cliCtx.String(flags.GRPCGatewayHost.Name) gatewayPort := cliCtx.Int(flags.GRPCGatewayPort.Name) validatorWebAddr := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) - if err := rpc.CreateAuthToken(walletDirPath, validatorWebAddr); err != nil { + authTokenPath := filepath.Join(walletDirPath, api.AuthTokenFileName) + tempAuthTokenPath := cliCtx.String(flags.AuthTokenPathFlag.Name) + if tempAuthTokenPath != "" { + authTokenPath = tempAuthTokenPath + } + if err := rpc.CreateAuthToken(authTokenPath, validatorWebAddr); err != nil { log.WithError(err).Fatal("Could not create web auth token") } return nil diff --git a/validator/node/node.go b/validator/node/node.go index 67d92e32bf63..ea2509dc0f07 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -639,6 +639,17 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { walletDir := c.cliCtx.String(flags.WalletDirFlag.Name) grpcHeaders := c.cliCtx.String(flags.GrpcHeadersFlag.Name) clientCert := c.cliCtx.String(flags.CertFlag.Name) + + authTokenPath := c.cliCtx.String(flags.AuthTokenPathFlag.Name) + // if no auth token path flag was passed try to set a default value + if authTokenPath == "" { + authTokenPath = flags.AuthTokenPathFlag.Value + // if a wallet dir is passed without an auth token then override the default with the wallet dir + if walletDir != "" { + authTokenPath = filepath.Join(walletDir, api.AuthTokenFileName) + } + } + server := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ ValDB: c.db, Host: rpcHost, @@ -648,6 +659,7 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { SyncChecker: vs, GenesisFetcher: vs, NodeGatewayEndpoint: nodeGatewayEndpoint, + AuthTokenPath: authTokenPath, WalletDir: walletDir, Wallet: c.wallet, ValidatorGatewayHost: validatorGatewayHost, diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 1c7742f68eed..2e270bdeec96 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -38,7 +38,6 @@ go_library( "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//crypto/bls:go_default_library", - "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", "//io/logs:go_default_library", @@ -148,6 +147,7 @@ go_test( "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", "@org_golang_google_grpc//:go_default_library", diff --git a/validator/rpc/auth_token.go b/validator/rpc/auth_token.go index 72a6fa571d2f..a87dbfb596df 100644 --- a/validator/rpc/auth_token.go +++ b/validator/rpc/auth_token.go @@ -15,32 +15,24 @@ import ( "github.com/fsnotify/fsnotify" "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/crypto/rand" + "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" ) -const ( - AuthTokenFileName = "auth-token" -) - // CreateAuthToken generates a new jwt key, token and writes them // to a file in the specified directory. Also, it logs out a prepared URL // for the user to navigate to and authenticate with the Prysm web interface. -func CreateAuthToken(walletDirPath, validatorWebAddr string) error { - jwtKey, err := createRandomJWTSecret() - if err != nil { - return err - } - token, err := createTokenString(jwtKey) +func CreateAuthToken(authPath, validatorWebAddr string) error { + token, err := api.GenerateRandomHexString() if err != nil { return err } - authTokenPath := filepath.Join(walletDirPath, AuthTokenFileName) - log.Infof("Generating auth token and saving it to %s", authTokenPath) - if err := saveAuthToken(walletDirPath, jwtKey, token); err != nil { + log.Infof("Generating auth token and saving it to %s", authPath) + if err := saveAuthToken(authPath, token); err != nil { return err } - logValidatorWebAuth(validatorWebAddr, token, authTokenPath) + logValidatorWebAuth(validatorWebAddr, token, authPath) return nil } @@ -49,18 +41,18 @@ func CreateAuthToken(walletDirPath, validatorWebAddr string) error { // user via stdout and the validator client should then attempt to open the default // browser. The web interface authenticates by looking for this token in the query parameters // of the URL. This token is then used as the bearer token for jwt auth. -func (s *Server) initializeAuthToken(walletDir string) (string, error) { - authTokenFile := filepath.Join(walletDir, AuthTokenFileName) - exists, err := file.Exists(authTokenFile, file.Regular) +func (s *Server) initializeAuthToken() error { + if s.authTokenPath == "" { + return errors.New("auth token path is empty") + } + exists, err := file.Exists(s.authTokenPath, file.Regular) if err != nil { - return "", errors.Wrapf(err, "could not check if file exists: %s", authTokenFile) + return errors.Wrapf(err, "could not check if file %s exists", s.authTokenPath) } - if exists { - // #nosec G304 - f, err := os.Open(authTokenFile) + f, err := os.Open(filepath.Clean(s.authTokenPath)) if err != nil { - return "", err + return err } defer func() { if err := f.Close(); err != nil { @@ -69,24 +61,18 @@ func (s *Server) initializeAuthToken(walletDir string) (string, error) { }() secret, token, err := readAuthTokenFile(f) if err != nil { - return "", err + return err } s.jwtSecret = secret - return token, nil - } - jwtKey, err := createRandomJWTSecret() - if err != nil { - return "", err + s.authToken = token + return nil } - s.jwtSecret = jwtKey - token, err := createTokenString(s.jwtSecret) + token, err := api.GenerateRandomHexString() if err != nil { - return "", err - } - if err := saveAuthToken(walletDir, jwtKey, token); err != nil { - return "", err + return err } - return token, nil + s.authToken = token + return saveAuthToken(s.authTokenPath, token) } func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenPath string) { @@ -106,16 +92,20 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP } for { select { - case <-watcher.Events: + case event := <-watcher.Events: + if event.Op.String() == "REMOVE" { + log.Error("Auth Token was removed! Restart the validator client to regenerate a token") + s.authToken = "" + continue + } // If a file was modified, we attempt to read that file // and parse it into our accounts store. - token, err := s.initializeAuthToken(s.walletDir) - if err != nil { + if err := s.initializeAuthToken(); err != nil { log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) continue } validatorWebAddr := fmt.Sprintf("%s:%d", s.validatorGatewayHost, s.validatorGatewayPort) - logValidatorWebAuth(validatorWebAddr, token, authTokenPath) + logValidatorWebAuth(validatorWebAddr, s.authToken, authTokenPath) case err := <-watcher.Errors: log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) case <-ctx.Done(): @@ -124,7 +114,7 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP } } -func logValidatorWebAuth(validatorWebAddr, token string, tokenPath string) { +func logValidatorWebAuth(validatorWebAddr, token, tokenPath string) { webAuthURLTemplate := "http://%s/initialize?token=%s" webAuthURL := fmt.Sprintf( webAuthURLTemplate, @@ -136,18 +126,11 @@ func logValidatorWebAuth(validatorWebAddr, token string, tokenPath string) { "the Prysm web interface", ) log.Info(webAuthURL) - log.Infof("Validator CLient JWT for RPC and REST authentication set at:%s", tokenPath) + log.Infof("Validator Client auth token for gRPC and REST authentication set at %s", tokenPath) } -func saveAuthToken(walletDirPath string, jwtKey []byte, token string) error { - hashFilePath := filepath.Join(walletDirPath, AuthTokenFileName) +func saveAuthToken(tokenPath string, token string) error { bytesBuf := new(bytes.Buffer) - if _, err := bytesBuf.WriteString(fmt.Sprintf("%x", jwtKey)); err != nil { - return err - } - if _, err := bytesBuf.WriteString("\n"); err != nil { - return err - } if _, err := bytesBuf.WriteString(token); err != nil { return err } @@ -155,34 +138,61 @@ func saveAuthToken(walletDirPath string, jwtKey []byte, token string) error { return err } - if err := file.MkdirAll(walletDirPath); err != nil { - return errors.Wrapf(err, "could not create directory %s", walletDirPath) + if err := file.MkdirAll(filepath.Dir(tokenPath)); err != nil { + return errors.Wrapf(err, "could not create directory %s", filepath.Dir(tokenPath)) } - - if err := file.WriteFile(hashFilePath, bytesBuf.Bytes()); err != nil { - return errors.Wrapf(err, "could not write to file %s", hashFilePath) + if err := file.WriteFile(tokenPath, bytesBuf.Bytes()); err != nil { + return errors.Wrapf(err, "could not write to file %s", tokenPath) } return nil } -func readAuthTokenFile(r io.Reader) (secret []byte, token string, err error) { - br := bufio.NewReader(r) - var jwtKeyHex string - jwtKeyHex, err = br.ReadString('\n') - if err != nil { - return - } - secret, err = hex.DecodeString(strings.TrimSpace(jwtKeyHex)) - if err != nil { - return +func readAuthTokenFile(r io.Reader) ([]byte, string, error) { + scanner := bufio.NewScanner(r) + var lines []string + var secret []byte + var token string + // Scan the file and collect lines, excluding empty lines + for scanner.Scan() { + line := scanner.Text() + if strings.TrimSpace(line) != "" { + lines = append(lines, line) + } } - tokenBytes, _, err := br.ReadLine() - if err != nil { - return + + // Check for scanning errors + if err := scanner.Err(); err != nil { + return nil, "", err } - token = strings.TrimSpace(string(tokenBytes)) - return + + // Process based on the number of lines, excluding empty ones + switch len(lines) { + case 1: + // If there is only one line, interpret it as the token + token = strings.TrimSpace(lines[0]) + case 2: + // TODO: Deprecate after a few releases + // For legacy files + // If there are two lines, the first is the jwt key and the second is the token + jwtKeyHex := strings.TrimSpace(lines[0]) + s, err := hex.DecodeString(jwtKeyHex) + if err != nil { + return nil, "", errors.Wrapf(err, "could not decode JWT secret") + } + secret = bytesutil.SafeCopyBytes(s) + token = strings.TrimSpace(lines[1]) + log.Warn("Auth token is a legacy file and should be regenerated.") + default: + return nil, "", errors.New("Auth token file format has multiple lines, please update the auth token to a single line that is a 256 bit hex string") + } + if err := api.ValidateAuthToken(token); err != nil { + log.WithError(err).Warn("Auth token does not follow our standards and should be regenerated either \n" + + "1. by removing the current token file and restarting \n" + + "2. using the `validator web generate-auth-token` command. \n" + + "Tokens can be generated through the `validator web generate-auth-token` command") + } + return secret, token, nil } // Creates a JWT token string using the JWT key. @@ -195,16 +205,3 @@ func createTokenString(jwtKey []byte) (string, error) { } return tokenString, nil } - -func createRandomJWTSecret() ([]byte, error) { - r := rand.NewGenerator() - jwtKey := make([]byte, 32) - n, err := r.Read(jwtKey) - if err != nil { - return nil, err - } - if n != len(jwtKey) { - return nil, errors.New("could not create appropriately sized random JWT secret") - } - return jwtKey, nil -} diff --git a/validator/rpc/auth_token_test.go b/validator/rpc/auth_token_test.go index efddde467a8e..35f308b38568 100644 --- a/validator/rpc/auth_token_test.go +++ b/validator/rpc/auth_token_test.go @@ -1,16 +1,22 @@ package rpc import ( + "bufio" "bytes" "context" "encoding/hex" "os" "path/filepath" + "strings" "testing" "time" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang-jwt/jwt/v4" + "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/testing/require" + logTest "github.com/sirupsen/logrus/hooks/test" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -24,11 +30,14 @@ func setupWalletDir(t testing.TB) string { func TestServer_AuthenticateUsingExistingToken(t *testing.T) { // Initializing for the first time, there is no auth token file in // the wallet directory, so we generate a jwt token and secret from scratch. - srv := &Server{} walletDir := setupWalletDir(t) - token, err := srv.initializeAuthToken(walletDir) + authTokenPath := filepath.Join(walletDir, api.AuthTokenFileName) + srv := &Server{ + authTokenPath: authTokenPath, + } + + err := srv.initializeAuthToken() require.NoError(t, err) - require.Equal(t, true, len(srv.jwtSecret) > 0) unaryInfo := &grpc.UnaryServerInfo{ FullMethod: "Proto.CreateWallet", @@ -37,78 +46,173 @@ func TestServer_AuthenticateUsingExistingToken(t *testing.T) { return nil, nil } ctxMD := map[string][]string{ - "authorization": {"Bearer " + token}, + "authorization": {"Bearer " + srv.authToken}, } ctx := context.Background() ctx = metadata.NewIncomingContext(ctx, ctxMD) - _, err = srv.JWTInterceptor()(ctx, "xyz", unaryInfo, unaryHandler) + _, err = srv.AuthTokenInterceptor()(ctx, "xyz", unaryInfo, unaryHandler) require.NoError(t, err) // Next up, we make the same request but reinitialize the server and we should still // pass with the same auth token. - srv = &Server{} - _, err = srv.initializeAuthToken(walletDir) + srv = &Server{ + authTokenPath: authTokenPath, + } + err = srv.initializeAuthToken() require.NoError(t, err) - require.Equal(t, true, len(srv.jwtSecret) > 0) - _, err = srv.JWTInterceptor()(ctx, "xyz", unaryInfo, unaryHandler) + _, err = srv.AuthTokenInterceptor()(ctx, "xyz", unaryInfo, unaryHandler) require.NoError(t, err) } -func TestServer_RefreshJWTSecretOnFileChange(t *testing.T) { +func TestServer_RefreshAuthTokenOnFileChange(t *testing.T) { // Initializing for the first time, there is no auth token file in // the wallet directory, so we generate a jwt token and secret from scratch. - srv := &Server{} walletDir := setupWalletDir(t) - _, err := srv.initializeAuthToken(walletDir) - require.NoError(t, err) - currentSecret := srv.jwtSecret - require.Equal(t, true, len(currentSecret) > 0) + authTokenPath := filepath.Join(walletDir, api.AuthTokenFileName) + srv := &Server{ + authTokenPath: authTokenPath, + } - authTokenPath := filepath.Join(walletDir, AuthTokenFileName) + err := srv.initializeAuthToken() + require.NoError(t, err) + currentToken := srv.authToken ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go srv.refreshAuthTokenFromFileChanges(ctx, authTokenPath) + go srv.refreshAuthTokenFromFileChanges(ctx, srv.authTokenPath) // Wait for service to be ready. time.Sleep(time.Millisecond * 250) // Update the auth token file with a new secret. - require.NoError(t, CreateAuthToken(walletDir, "localhost:7500")) + require.NoError(t, CreateAuthToken(srv.authTokenPath, "localhost:7500")) // The service should have picked up the file change and set the jwt secret to the new one. time.Sleep(time.Millisecond * 500) - newSecret := srv.jwtSecret - require.Equal(t, true, len(newSecret) > 0) - require.Equal(t, true, !bytes.Equal(currentSecret, newSecret)) - err = os.Remove(AuthTokenFileName) + newToken := srv.authToken + require.Equal(t, true, currentToken != newToken) + err = os.Remove(srv.authTokenPath) require.NoError(t, err) } +// TODO: remove this test when legacy files are removed +func TestServer_LegacyTokensStillWork(t *testing.T) { + hook := logTest.NewGlobal() + // Initializing for the first time, there is no auth token file in + // the wallet directory, so we generate a jwt token and secret from scratch. + walletDir := setupWalletDir(t) + authTokenPath := filepath.Join(walletDir, api.AuthTokenFileName) + + bytesBuf := new(bytes.Buffer) + _, err := bytesBuf.WriteString("b5bbbaf533b625a93741978857f13d7adeca58445a1fb00ecf3373420b92776c") + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + _, err = bytesBuf.WriteString("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.MxwOozSH-TLbW_XKepjyYDHm2IT8Ki0tD3AHuajfNMg") + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + err = file.MkdirAll(walletDir) + require.NoError(t, err) + + err = file.WriteFile(authTokenPath, bytesBuf.Bytes()) + require.NoError(t, err) + + srv := &Server{ + authTokenPath: authTokenPath, + } + + err = srv.initializeAuthToken() + require.NoError(t, err) + + require.Equal(t, hexutil.Encode(srv.jwtSecret), "0xb5bbbaf533b625a93741978857f13d7adeca58445a1fb00ecf3373420b92776c") + require.Equal(t, srv.authToken, "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.MxwOozSH-TLbW_XKepjyYDHm2IT8Ki0tD3AHuajfNMg") + + f, err := os.Open(filepath.Clean(srv.authTokenPath)) + require.NoError(t, err) + + scanner := bufio.NewScanner(f) + var lines []string + + // Scan the file and collect lines, excluding empty lines + for scanner.Scan() { + line := scanner.Text() + if strings.TrimSpace(line) != "" { + lines = append(lines, line) + } + } + require.Equal(t, len(lines), 2) + require.LogsContain(t, hook, "Auth token does not follow our standards and should be regenerated") + // Check for scanning errors + err = scanner.Err() + require.NoError(t, err) + err = f.Close() + require.NoError(t, err) + + err = os.Remove(srv.authTokenPath) + require.NoError(t, err) +} + +// TODO: remove this test when legacy files are removed +func TestServer_LegacyTokensBadSecret(t *testing.T) { + // Initializing for the first time, there is no auth token file in + // the wallet directory, so we generate a jwt token and secret from scratch. + walletDir := setupWalletDir(t) + authTokenPath := filepath.Join(walletDir, api.AuthTokenFileName) + + bytesBuf := new(bytes.Buffer) + _, err := bytesBuf.WriteString("----------------") + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + _, err = bytesBuf.WriteString("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.MxwOozSH-TLbW_XKepjyYDHm2IT8Ki0tD3AHuajfNMg") + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + err = file.MkdirAll(walletDir) + require.NoError(t, err) + + err = file.WriteFile(authTokenPath, bytesBuf.Bytes()) + require.NoError(t, err) + + srv := &Server{ + authTokenPath: authTokenPath, + } + + err = srv.initializeAuthToken() + require.ErrorContains(t, "could not decode JWT secret", err) +} + func Test_initializeAuthToken(t *testing.T) { // Initializing for the first time, there is no auth token file in // the wallet directory, so we generate a jwt token and secret from scratch. - srv := &Server{} walletDir := setupWalletDir(t) - token, err := srv.initializeAuthToken(walletDir) + authTokenPath := filepath.Join(walletDir, api.AuthTokenFileName) + srv := &Server{ + authTokenPath: authTokenPath, + } + err := srv.initializeAuthToken() require.NoError(t, err) - require.Equal(t, true, len(srv.jwtSecret) > 0) // Initializing second time, we generate something from the initial file. - srv2 := &Server{} - token2, err := srv2.initializeAuthToken(walletDir) + srv2 := &Server{ + authTokenPath: authTokenPath, + } + err = srv2.initializeAuthToken() require.NoError(t, err) - require.Equal(t, true, bytes.Equal(srv.jwtSecret, srv2.jwtSecret)) - require.Equal(t, token, token2) + require.Equal(t, srv.authToken, srv2.authToken) // Deleting the auth token and re-initializing means we create a jwt token // and secret from scratch again. - srv3 := &Server{} walletDir = setupWalletDir(t) - token3, err := srv3.initializeAuthToken(walletDir) + authTokenPath = filepath.Join(walletDir, api.AuthTokenFileName) + srv3 := &Server{ + authTokenPath: authTokenPath, + } + + err = srv3.initializeAuthToken() require.NoError(t, err) - require.Equal(t, true, len(srv.jwtSecret) > 0) - require.NotEqual(t, token, token3) + require.NotEqual(t, srv.authToken, srv3.authToken) } // "createTokenString" now uses jwt.RegisteredClaims instead of jwt.StandardClaims (deprecated), diff --git a/validator/rpc/handlers_auth.go b/validator/rpc/handlers_auth.go index 4222e10ba76a..24c29491945a 100644 --- a/validator/rpc/handlers_auth.go +++ b/validator/rpc/handlers_auth.go @@ -2,7 +2,6 @@ package rpc import ( "net/http" - "path/filepath" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/io/file" @@ -20,8 +19,7 @@ func (s *Server) Initialize(w http.ResponseWriter, r *http.Request) { httputil.HandleError(w, errors.Wrap(err, "Could not check if wallet exists").Error(), http.StatusInternalServerError) return } - authTokenPath := filepath.Join(s.walletDir, AuthTokenFileName) - exists, err := file.Exists(authTokenPath, file.Regular) + exists, err := file.Exists(s.authTokenPath, file.Regular) if err != nil { httputil.HandleError(w, errors.Wrap(err, "Could not check if auth token exists").Error(), http.StatusInternalServerError) return diff --git a/validator/rpc/handlers_auth_test.go b/validator/rpc/handlers_auth_test.go index b17cd0cae80d..473aed41eb45 100644 --- a/validator/rpc/handlers_auth_test.go +++ b/validator/rpc/handlers_auth_test.go @@ -9,6 +9,7 @@ import ( "path/filepath" "testing" + "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/accounts" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" @@ -19,7 +20,7 @@ func TestInitialize(t *testing.T) { localWalletDir := setupWalletDir(t) // Step 2: Optionally create a temporary 'auth-token' file - authTokenPath := filepath.Join(localWalletDir, AuthTokenFileName) + authTokenPath := filepath.Join(localWalletDir, api.AuthTokenFileName) _, err := os.Create(authTokenPath) require.NoError(t, err) @@ -34,7 +35,7 @@ func TestInitialize(t *testing.T) { require.NoError(t, err) _, err = acc.WalletCreate(context.Background()) require.NoError(t, err) - server := &Server{walletDir: localWalletDir} + server := &Server{walletDir: localWalletDir, authTokenPath: authTokenPath} // Step 4: Create an HTTP request and response recorder req := httptest.NewRequest(http.MethodGet, "/initialize", nil) @@ -43,6 +44,8 @@ func TestInitialize(t *testing.T) { // Step 5: Call the Initialize function server.Initialize(w, req) + require.Equal(t, w.Code, http.StatusOK) + // Step 6: Assert expectations result := w.Result() defer func() { diff --git a/validator/rpc/intercepter.go b/validator/rpc/intercepter.go index a49db2c79cb3..6dedcdaef469 100644 --- a/validator/rpc/intercepter.go +++ b/validator/rpc/intercepter.go @@ -2,11 +2,9 @@ package rpc import ( "context" - "fmt" "net/http" "strings" - "github.com/golang-jwt/jwt/v4" "github.com/prysmaticlabs/prysm/v5/api" "github.com/sirupsen/logrus" "google.golang.org/grpc" @@ -15,8 +13,8 @@ import ( "google.golang.org/grpc/status" ) -// JWTInterceptor is a gRPC unary interceptor to authorize incoming requests. -func (s *Server) JWTInterceptor() grpc.UnaryServerInterceptor { +// AuthTokenInterceptor is a gRPC unary interceptor to authorize incoming requests. +func (s *Server) AuthTokenInterceptor() grpc.UnaryServerInterceptor { return func( ctx context.Context, req interface{}, @@ -35,8 +33,8 @@ func (s *Server) JWTInterceptor() grpc.UnaryServerInterceptor { } } -// JwtHttpInterceptor is an HTTP handler to authorize a route. -func (s *Server) JwtHttpInterceptor(next http.Handler) http.Handler { +// AuthTokenHandler is an HTTP handler to authorize a route. +func (s *Server) AuthTokenHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // if it's not initialize or has a web prefix if strings.Contains(r.URL.Path, api.WebApiUrlPrefix) || strings.Contains(r.URL.Path, api.KeymanagerApiPrefix) { @@ -53,9 +51,8 @@ func (s *Server) JwtHttpInterceptor(next http.Handler) http.Handler { } token := tokenParts[1] - _, err := jwt.Parse(token, s.validateJWT) - if err != nil { - http.Error(w, fmt.Errorf("forbidden: could not parse JWT token: %v", err).Error(), http.StatusForbidden) + if strings.TrimSpace(token) != s.authToken || strings.TrimSpace(s.authToken) == "" { + http.Error(w, "Forbidden: token value is invalid", http.StatusForbidden) return } } @@ -78,16 +75,8 @@ func (s *Server) authorize(ctx context.Context) error { return status.Error(codes.Unauthenticated, "Invalid auth header, needs Bearer {token}") } token := strings.Split(authHeader[0], "Bearer ")[1] - _, err := jwt.Parse(token, s.validateJWT) - if err != nil { - return status.Errorf(codes.Unauthenticated, "Could not parse JWT token: %v", err) + if strings.TrimSpace(token) != s.authToken || strings.TrimSpace(s.authToken) == "" { + return status.Errorf(codes.Unauthenticated, "Forbidden: token value is invalid") } return nil } - -func (s *Server) validateJWT(token *jwt.Token) (interface{}, error) { - if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { - return nil, fmt.Errorf("unexpected JWT signing method: %v", token.Header["alg"]) - } - return s.jwtSecret, nil -} diff --git a/validator/rpc/intercepter_test.go b/validator/rpc/intercepter_test.go index e4fcbbdfb314..94a0461da476 100644 --- a/validator/rpc/intercepter_test.go +++ b/validator/rpc/intercepter_test.go @@ -6,18 +6,18 @@ import ( "net/http/httptest" "testing" - "github.com/golang-jwt/jwt/v4" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/testing/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) -func TestServer_JWTInterceptor_Verify(t *testing.T) { +func TestServer_AuthTokenInterceptor_Verify(t *testing.T) { + token := "cool-token" s := Server{ - jwtSecret: []byte("testKey"), + authToken: token, } - interceptor := s.JWTInterceptor() + interceptor := s.AuthTokenInterceptor() unaryInfo := &grpc.UnaryServerInfo{ FullMethod: "Proto.CreateWallet", @@ -25,22 +25,20 @@ func TestServer_JWTInterceptor_Verify(t *testing.T) { unaryHandler := func(ctx context.Context, req interface{}) (interface{}, error) { return nil, nil } - token, err := createTokenString(s.jwtSecret) - require.NoError(t, err) ctxMD := map[string][]string{ "authorization": {"Bearer " + token}, } ctx := context.Background() ctx = metadata.NewIncomingContext(ctx, ctxMD) - _, err = interceptor(ctx, "xyz", unaryInfo, unaryHandler) + _, err := interceptor(ctx, "xyz", unaryInfo, unaryHandler) require.NoError(t, err) } -func TestServer_JWTInterceptor_BadToken(t *testing.T) { +func TestServer_AuthTokenInterceptor_BadToken(t *testing.T) { s := Server{ - jwtSecret: []byte("testKey"), + authToken: "cool-token", } - interceptor := s.JWTInterceptor() + interceptor := s.AuthTokenInterceptor() unaryInfo := &grpc.UnaryServerInfo{ FullMethod: "Proto.CreateWallet", @@ -49,111 +47,65 @@ func TestServer_JWTInterceptor_BadToken(t *testing.T) { return nil, nil } - badServer := Server{ - jwtSecret: []byte("badTestKey"), - } - token, err := createTokenString(badServer.jwtSecret) - require.NoError(t, err) ctxMD := map[string][]string{ - "authorization": {"Bearer " + token}, + "authorization": {"Bearer bad-token"}, } ctx := context.Background() ctx = metadata.NewIncomingContext(ctx, ctxMD) - _, err = interceptor(ctx, "xyz", unaryInfo, unaryHandler) - require.ErrorContains(t, "signature is invalid", err) -} - -func TestServer_JWTInterceptor_InvalidSigningType(t *testing.T) { - ss := &Server{jwtSecret: make([]byte, 32)} - // Use a different signing type than the expected, HMAC. - token := jwt.NewWithClaims(jwt.SigningMethodRS256, jwt.RegisteredClaims{}) - _, err := ss.validateJWT(token) - require.ErrorContains(t, "unexpected JWT signing method", err) + _, err := interceptor(ctx, "xyz", unaryInfo, unaryHandler) + require.ErrorContains(t, "token value is invalid", err) } -func TestServer_JwtHttpInterceptor(t *testing.T) { - jwtKey, err := createRandomJWTSecret() - require.NoError(t, err) +func TestServer_AuthTokenHandler(t *testing.T) { + token := "cool-token" - s := &Server{jwtSecret: jwtKey} - testHandler := s.JwtHttpInterceptor(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + s := &Server{authToken: token} + testHandler := s.AuthTokenHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Your test handler logic here w.WriteHeader(http.StatusOK) _, err := w.Write([]byte("Test Response")) require.NoError(t, err) })) - t.Run("no jwt was sent", func(t *testing.T) { + t.Run("no auth token was sent", func(t *testing.T) { rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", nil) + req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", http.NoBody) require.NoError(t, err) testHandler.ServeHTTP(rr, req) require.Equal(t, http.StatusUnauthorized, rr.Code) }) - t.Run("wrong jwt was sent", func(t *testing.T) { + t.Run("wrong auth token was sent", func(t *testing.T) { rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", nil) + req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", http.NoBody) require.NoError(t, err) req.Header.Set("Authorization", "Bearer YOUR_JWT_TOKEN") // Replace with a valid JWT token testHandler.ServeHTTP(rr, req) require.Equal(t, http.StatusForbidden, rr.Code) }) - t.Run("jwt was sent", func(t *testing.T) { + t.Run("good auth token was sent", func(t *testing.T) { rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", nil) - require.NoError(t, err) - token, err := createTokenString(jwtKey) + req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", http.NoBody) require.NoError(t, err) req.Header.Set("Authorization", "Bearer "+token) // Replace with a valid JWT token testHandler.ServeHTTP(rr, req) require.Equal(t, http.StatusOK, rr.Code) }) - t.Run("wrong jwt format was sent", func(t *testing.T) { - rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", nil) - require.NoError(t, err) - token, err := createTokenString(jwtKey) - require.NoError(t, err) - req.Header.Set("Authorization", "Bearer"+token) // no space was added // Replace with a valid JWT token - testHandler.ServeHTTP(rr, req) - require.Equal(t, http.StatusBadRequest, rr.Code) - }) - t.Run("wrong jwt no bearer format was sent", func(t *testing.T) { - rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", nil) - require.NoError(t, err) - token, err := createTokenString(jwtKey) - require.NoError(t, err) - req.Header.Set("Authorization", token) // Replace with a valid JWT token - testHandler.ServeHTTP(rr, req) - require.Equal(t, http.StatusBadRequest, rr.Code) - }) - t.Run("broken jwt token format was sent", func(t *testing.T) { - rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/eth/v1/keystores", nil) - require.NoError(t, err) - token, err := createTokenString(jwtKey) - require.NoError(t, err) - req.Header.Set("Authorization", "Bearer "+token[0:2]+" "+token[2:]) // Replace with a valid JWT token - testHandler.ServeHTTP(rr, req) - require.Equal(t, http.StatusForbidden, rr.Code) - }) - t.Run("web endpoint needs jwt token", func(t *testing.T) { + t.Run("web endpoint needs auth token", func(t *testing.T) { rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, "/api/v2/validator/beacon/status", nil) + req, err := http.NewRequest(http.MethodGet, "/api/v2/validator/beacon/status", http.NoBody) require.NoError(t, err) testHandler.ServeHTTP(rr, req) require.Equal(t, http.StatusUnauthorized, rr.Code) }) - t.Run("initialize does not need jwt", func(t *testing.T) { + t.Run("initialize does not need auth", func(t *testing.T) { rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, api.WebUrlPrefix+"initialize", nil) + req, err := http.NewRequest(http.MethodGet, api.WebUrlPrefix+"initialize", http.NoBody) require.NoError(t, err) testHandler.ServeHTTP(rr, req) require.Equal(t, http.StatusOK, rr.Code) }) - t.Run("health does not need jwt", func(t *testing.T) { + t.Run("health does not need auth", func(t *testing.T) { rr := httptest.NewRecorder() - req, err := http.NewRequest(http.MethodGet, api.WebUrlPrefix+"health/logs", nil) + req, err := http.NewRequest(http.MethodGet, api.WebUrlPrefix+"health/logs", http.NoBody) require.NoError(t, err) testHandler.ServeHTTP(rr, req) require.Equal(t, http.StatusOK, rr.Code) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index 10cdc6de69f5..a0737d485c64 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -47,6 +47,7 @@ type Config struct { CertFlag string KeyFlag string ValDB db.Database + AuthTokenPath string WalletDir string ValidatorService *client.ValidatorService SyncChecker client.SyncChecker @@ -87,6 +88,8 @@ type Server struct { validatorService *client.ValidatorService syncChecker client.SyncChecker genesisFetcher client.GenesisFetcher + authTokenPath string + authToken string walletDir string wallet *wallet.Wallet walletInitializedFeed *event.Feed @@ -123,6 +126,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { validatorService: cfg.ValidatorService, syncChecker: cfg.SyncChecker, genesisFetcher: cfg.GenesisFetcher, + authTokenPath: cfg.AuthTokenPath, walletDir: cfg.WalletDir, walletInitializedFeed: cfg.WalletInitializedFeed, walletInitialized: cfg.Wallet != nil, @@ -136,6 +140,19 @@ func NewServer(ctx context.Context, cfg *Config) *Server { beaconApiEndpoint: cfg.BeaconApiEndpoint, router: cfg.Router, } + + if server.authTokenPath == "" && server.walletDir != "" { + server.authTokenPath = filepath.Join(server.walletDir, api.AuthTokenFileName) + } + + if server.authTokenPath != "" { + if err := server.initializeAuthToken(); err != nil { + log.WithError(err).Error("Could not initialize web auth token") + } + validatorWebAddr := fmt.Sprintf("%s:%d", server.validatorGatewayHost, server.validatorGatewayPort) + logValidatorWebAuth(validatorWebAddr, server.authToken, server.authTokenPath) + go server.refreshAuthTokenFromFileChanges(server.ctx, server.authTokenPath) + } // immediately register routes to override any catchalls if err := server.InitializeRoutes(); err != nil { log.WithError(err).Fatal("Could not initialize routes") @@ -146,7 +163,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { // Start the gRPC server. func (s *Server) Start() { // Setup the gRPC server options and TLS configuration. - address := fmt.Sprintf("%s:%s", s.host, s.port) + address := net.JoinHostPort(s.host, s.port) lis, err := net.Listen("tcp", address) if err != nil { log.WithError(err).Errorf("Could not listen to port in Start() %s", address) @@ -163,7 +180,7 @@ func (s *Server) Start() { ), grpcprometheus.UnaryServerInterceptor, grpcopentracing.UnaryServerInterceptor(), - s.JWTInterceptor(), + s.AuthTokenInterceptor(), )), } grpcprometheus.EnableHandlingTimeHistogram() @@ -198,17 +215,6 @@ func (s *Server) Start() { }() log.WithField("address", address).Info("gRPC server listening on address") - if s.walletDir != "" { - token, err := s.initializeAuthToken(s.walletDir) - if err != nil { - log.WithError(err).Error("Could not initialize web auth token") - return - } - validatorWebAddr := fmt.Sprintf("%s:%d", s.validatorGatewayHost, s.validatorGatewayPort) - authTokenPath := filepath.Join(s.walletDir, AuthTokenFileName) - logValidatorWebAuth(validatorWebAddr, token, authTokenPath) - go s.refreshAuthTokenFromFileChanges(s.ctx, authTokenPath) - } } // InitializeRoutes initializes pure HTTP REST endpoints for the validator client. @@ -218,7 +224,7 @@ func (s *Server) InitializeRoutes() error { return errors.New("no router found on server") } // Adding Auth Interceptor for the routes below - s.router.Use(s.JwtHttpInterceptor) + s.router.Use(s.AuthTokenHandler) // Register all services, HandleFunc calls, etc. // ... s.router.HandleFunc("/eth/v1/keystores", s.ListKeystores).Methods(http.MethodGet) From d5daf49a9a8d1f7e8118929730ea0e75e0b6cf2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 23 Apr 2024 01:18:07 +0900 Subject: [PATCH 045/325] Use correct port for health check in Beacon API e2e evaluator (#13892) --- .../endtoend/evaluators/beaconapi/verify.go | 2 +- testing/endtoend/params/params.go | 86 +++++++++---------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/testing/endtoend/evaluators/beaconapi/verify.go b/testing/endtoend/evaluators/beaconapi/verify.go index 9ee9e4d66325..baa9a12d2068 100644 --- a/testing/endtoend/evaluators/beaconapi/verify.go +++ b/testing/endtoend/evaluators/beaconapi/verify.go @@ -181,7 +181,7 @@ func postEvaluation(nodeIdx int, requests map[string]endpoint, epoch primitives. } // perform a health check - basePath := fmt.Sprintf(v1PathTemplate, params2.PrysmBeaconNodeGatewayPort+nodeIdx) + basePath := fmt.Sprintf(v1PathTemplate, params2.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIdx) resp, err := http.Get(basePath + "/node/health") if err != nil { return errors.Wrap(err, "could not perform a health check") diff --git a/testing/endtoend/params/params.go b/testing/endtoend/params/params.go index ded1c9735b53..8ef153c9fd61 100644 --- a/testing/endtoend/params/params.go +++ b/testing/endtoend/params/params.go @@ -134,33 +134,33 @@ var ExpectedExecEngineTxsThreshold = 0.5 const ( portSpan = 50 - BootNodePort = 2150 - BootNodeMetricsPort = BootNodePort + portSpan + bootNodePort = 2150 + bootNodeMetricsPort = bootNodePort + portSpan - Eth1Port = 3150 - Eth1RPCPort = Eth1Port + portSpan - Eth1WSPort = Eth1Port + 2*portSpan - Eth1AuthRPCPort = Eth1Port + 3*portSpan - Eth1ProxyPort = Eth1Port + 4*portSpan + eth1Port = 3150 + eth1RPCPort = eth1Port + portSpan + eth1WSPort = eth1Port + 2*portSpan + eth1AuthRPCPort = eth1Port + 3*portSpan + eth1ProxyPort = eth1Port + 4*portSpan - PrysmBeaconNodeRPCPort = 4150 - PrysmBeaconNodeUDPPort = PrysmBeaconNodeRPCPort + portSpan - PrysmBeaconNodeQUICPort = PrysmBeaconNodeRPCPort + 2*portSpan - PrysmBeaconNodeTCPPort = PrysmBeaconNodeRPCPort + 3*portSpan - PrysmBeaconNodeGatewayPort = PrysmBeaconNodeRPCPort + 4*portSpan - PrysmBeaconNodeMetricsPort = PrysmBeaconNodeRPCPort + 5*portSpan - PrysmBeaconNodePprofPort = PrysmBeaconNodeRPCPort + 6*portSpan + prysmBeaconNodeRPCPort = 4150 + prysmBeaconNodeUDPPort = prysmBeaconNodeRPCPort + portSpan + prysmBeaconNodeQUICPort = prysmBeaconNodeRPCPort + 2*portSpan + prysmBeaconNodeTCPPort = prysmBeaconNodeRPCPort + 3*portSpan + prysmBeaconNodeGatewayPort = prysmBeaconNodeRPCPort + 4*portSpan + prysmBeaconNodeMetricsPort = prysmBeaconNodeRPCPort + 5*portSpan + prysmBeaconNodePprofPort = prysmBeaconNodeRPCPort + 6*portSpan - LighthouseBeaconNodeP2PPort = 5150 - LighthouseBeaconNodeHTTPPort = LighthouseBeaconNodeP2PPort + portSpan - LighthouseBeaconNodeMetricsPort = LighthouseBeaconNodeP2PPort + 2*portSpan + lighthouseBeaconNodeP2PPort = 5150 + lighthouseBeaconNodeHTTPPort = lighthouseBeaconNodeP2PPort + portSpan + lighthouseBeaconNodeMetricsPort = lighthouseBeaconNodeP2PPort + 2*portSpan - ValidatorGatewayPort = 6150 - ValidatorMetricsPort = ValidatorGatewayPort + portSpan + validatorGatewayPort = 6150 + validatorMetricsPort = validatorGatewayPort + portSpan - JaegerTracingPort = 9150 + jaegerTracingPort = 9150 - StartupBufferSecs = 15 + startupBufferSecs = 15 ) func logDir() string { @@ -210,7 +210,7 @@ func Init(t *testing.T, beaconNodeCount int) error { return err } - genTime := uint64(time.Now().Unix()) + StartupBufferSecs + genTime := uint64(time.Now().Unix()) + startupBufferSecs TestParams = ¶ms{ TestPath: filepath.Join(testPath, fmt.Sprintf("shard-%d", testShardIndex)), LogPath: logPath, @@ -263,7 +263,7 @@ func InitMultiClient(t *testing.T, beaconNodeCount int, lighthouseNodeCount int) return err } - genTime := uint64(time.Now().Unix()) + StartupBufferSecs + genTime := uint64(time.Now().Unix()) + startupBufferSecs TestParams = ¶ms{ TestPath: filepath.Join(testPath, fmt.Sprintf("shard-%d", testShardIndex)), LogPath: logPath, @@ -296,71 +296,71 @@ func port(seed, shardCount, shardIndex int, existingRegistrations *[]int) (int, } func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingRegistrations *[]int) error { - bootnodePort, err := port(BootNodePort, shardCount, shardIndex, existingRegistrations) + bootnodePort, err := port(bootNodePort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - bootnodeMetricsPort, err := port(BootNodeMetricsPort, shardCount, shardIndex, existingRegistrations) + bootnodeMetricsPort, err := port(bootNodeMetricsPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - eth1Port, err := port(Eth1Port, shardCount, shardIndex, existingRegistrations) + eth1Port, err := port(eth1Port, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - eth1RPCPort, err := port(Eth1RPCPort, shardCount, shardIndex, existingRegistrations) + eth1RPCPort, err := port(eth1RPCPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - eth1WSPort, err := port(Eth1WSPort, shardCount, shardIndex, existingRegistrations) + eth1WSPort, err := port(eth1WSPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - eth1AuthPort, err := port(Eth1AuthRPCPort, shardCount, shardIndex, existingRegistrations) + eth1AuthPort, err := port(eth1AuthRPCPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - eth1ProxyPort, err := port(Eth1ProxyPort, shardCount, shardIndex, existingRegistrations) + eth1ProxyPort, err := port(eth1ProxyPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodeRPCPort, err := port(PrysmBeaconNodeRPCPort, shardCount, shardIndex, existingRegistrations) + beaconNodeRPCPort, err := port(prysmBeaconNodeRPCPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodeUDPPort, err := port(PrysmBeaconNodeUDPPort, shardCount, shardIndex, existingRegistrations) + beaconNodeUDPPort, err := port(prysmBeaconNodeUDPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodeQUICPort, err := port(PrysmBeaconNodeQUICPort, shardCount, shardIndex, existingRegistrations) + beaconNodeQUICPort, err := port(prysmBeaconNodeQUICPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodeTCPPort, err := port(PrysmBeaconNodeTCPPort, shardCount, shardIndex, existingRegistrations) + beaconNodeTCPPort, err := port(prysmBeaconNodeTCPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodeGatewayPort, err := port(PrysmBeaconNodeGatewayPort, shardCount, shardIndex, existingRegistrations) + beaconNodeGatewayPort, err := port(prysmBeaconNodeGatewayPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodeMetricsPort, err := port(PrysmBeaconNodeMetricsPort, shardCount, shardIndex, existingRegistrations) + beaconNodeMetricsPort, err := port(prysmBeaconNodeMetricsPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - beaconNodePprofPort, err := port(PrysmBeaconNodePprofPort, shardCount, shardIndex, existingRegistrations) + beaconNodePprofPort, err := port(prysmBeaconNodePprofPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - validatorGatewayPort, err := port(ValidatorGatewayPort, shardCount, shardIndex, existingRegistrations) + validatorGatewayPort, err := port(validatorGatewayPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - validatorMetricsPort, err := port(ValidatorMetricsPort, shardCount, shardIndex, existingRegistrations) + validatorMetricsPort, err := port(validatorMetricsPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - jaegerTracingPort, err := port(JaegerTracingPort, shardCount, shardIndex, existingRegistrations) + jaegerTracingPort, err := port(jaegerTracingPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } @@ -385,15 +385,15 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR } func initializeMulticlientPorts(shardCount, shardIndex int, ports *ports, existingRegistrations *[]int) error { - lighthouseBeaconNodeP2PPort, err := port(LighthouseBeaconNodeP2PPort, shardCount, shardIndex, existingRegistrations) + lighthouseBeaconNodeP2PPort, err := port(lighthouseBeaconNodeP2PPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - lighthouseBeaconNodeHTTPPort, err := port(LighthouseBeaconNodeHTTPPort, shardCount, shardIndex, existingRegistrations) + lighthouseBeaconNodeHTTPPort, err := port(lighthouseBeaconNodeHTTPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } - lighthouseBeaconNodeMetricsPort, err := port(LighthouseBeaconNodeMetricsPort, shardCount, shardIndex, existingRegistrations) + lighthouseBeaconNodeMetricsPort, err := port(lighthouseBeaconNodeMetricsPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } From 276b97530f526977c921c40a493b2f37e252e817 Mon Sep 17 00:00:00 2001 From: Alec Thomas <112640918+a-thomas-22@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:36:30 -0500 Subject: [PATCH 046/325] Change example.org DNS record (#13904) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DNS Changed for this record causing tests to fail Co-authored-by: Radosław Kapka --- beacon-chain/p2p/discovery_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/p2p/discovery_test.go b/beacon-chain/p2p/discovery_test.go index e9b8a8368870..8860a2d0fad5 100644 --- a/beacon-chain/p2p/discovery_test.go +++ b/beacon-chain/p2p/discovery_test.go @@ -317,7 +317,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.216.34" + exampleIP := "93.184.215.14" s := &Service{ cfg: &Config{ From 0369f70b0b803bd096b3dd2249b6406809ec8b93 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 22 Apr 2024 17:14:57 -0500 Subject: [PATCH 047/325] Electra beacon config (#13907) * Update spectests to v1.5.0 * Add electra config * Fix tests in beacon-chain/rpc/eth/config * gofmt --- WORKSPACE | 10 +- beacon-chain/rpc/eth/config/handlers_test.go | 590 ++++++++++--------- config/params/config.go | 9 + config/params/mainnet_config.go | 11 + config/params/minimal_config.go | 6 + 5 files changed, 335 insertions(+), 291 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index fbead3591caa..f30ff747773b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -243,7 +243,7 @@ filegroup( url = "https://github.com/ethereum/EIPs/archive/5480440fe51742ed23342b68cf106cefd427e39d.tar.gz", ) -consensus_spec_version = "v1.4.0" +consensus_spec_version = "v1.5.0-alpha.0" bls_test_version = "v0.1.1" @@ -259,7 +259,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - sha256 = "c282c0f86f23f3d2e0f71f5975769a4077e62a7e3c7382a16bd26a7e589811a0", + sha256 = "33c5547772b6d8d6f041dff7e7d26b0358c2392daed34394a3aa81147812a81c", url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/general.tar.gz" % consensus_spec_version, ) @@ -275,7 +275,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - sha256 = "4649c35aa3b8eb0cfdc81bee7c05649f90ef36bede5b0513e1f2e8baf37d6033", + sha256 = "06f286199cf2fedd4700487fb8feb0904e0ae18daaa4b3f70ea430ca9c388167", url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/minimal.tar.gz" % consensus_spec_version, ) @@ -291,7 +291,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - sha256 = "c5a03f724f757456ffaabd2a899992a71d2baf45ee4db65ca3518f2b7ee928c8", + sha256 = "5f2a4452b323075eba6bf950003f7d91fd04ebcbde5bd087beafb5d6f6325ad4", url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/mainnet.tar.gz" % consensus_spec_version, ) @@ -306,7 +306,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - sha256 = "cd1c9d97baccbdde1d2454a7dceb8c6c61192a3b581eee12ffc94969f2db8453", + sha256 = "fd7e83e8cbeb3e297f2aeb93776305f7d606272c97834d8d9be673984501ed36", 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/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index 521ba62d5def..d4d4f7d18c1a 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -78,6 +78,8 @@ func TestGetSpec(t *testing.T) { config.CapellaForkEpoch = 103 config.DenebForkVersion = []byte("DenebForkVersion") config.DenebForkEpoch = 105 + config.ElectraForkVersion = []byte("ElectraForkVersion") + config.ElectraForkEpoch = 107 config.BLSWithdrawalPrefixByte = byte('b') config.ETH1AddressWithdrawalPrefixByte = byte('c') config.GenesisDelay = 24 @@ -170,293 +172,309 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 129, len(data)) + assert.Equal(t, 136, len(data)) for k, v := range data { - switch k { - case "CONFIG_NAME": - assert.Equal(t, "ConfigName", v) - case "PRESET_BASE": - assert.Equal(t, "PresetBase", v) - case "MAX_COMMITTEES_PER_SLOT": - assert.Equal(t, "1", v) - case "TARGET_COMMITTEE_SIZE": - assert.Equal(t, "2", v) - case "MAX_VALIDATORS_PER_COMMITTEE": - assert.Equal(t, "3", v) - case "MIN_PER_EPOCH_CHURN_LIMIT": - assert.Equal(t, "4", v) - case "CHURN_LIMIT_QUOTIENT": - assert.Equal(t, "5", v) - case "SHUFFLE_ROUND_COUNT": - assert.Equal(t, "6", v) - case "MIN_GENESIS_ACTIVE_VALIDATOR_COUNT": - assert.Equal(t, "7", v) - case "MIN_GENESIS_TIME": - assert.Equal(t, "8", v) - case "HYSTERESIS_QUOTIENT": - assert.Equal(t, "9", v) - case "HYSTERESIS_DOWNWARD_MULTIPLIER": - assert.Equal(t, "10", v) - case "HYSTERESIS_UPWARD_MULTIPLIER": - assert.Equal(t, "11", v) - case "SAFE_SLOTS_TO_UPDATE_JUSTIFIED": - assert.Equal(t, "0", v) - case "ETH1_FOLLOW_DISTANCE": - assert.Equal(t, "13", v) - case "TARGET_AGGREGATORS_PER_COMMITTEE": - assert.Equal(t, "14", v) - case "RANDOM_SUBNETS_PER_VALIDATOR": - assert.Equal(t, "15", v) - case "EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION": - assert.Equal(t, "16", v) - case "SECONDS_PER_ETH1_BLOCK": - assert.Equal(t, "17", v) - case "DEPOSIT_CHAIN_ID": - assert.Equal(t, "18", v) - case "DEPOSIT_NETWORK_ID": - assert.Equal(t, "19", v) - case "DEPOSIT_CONTRACT_ADDRESS": - assert.Equal(t, "DepositContractAddress", v) - case "MIN_DEPOSIT_AMOUNT": - assert.Equal(t, "20", v) - case "MAX_EFFECTIVE_BALANCE": - assert.Equal(t, "21", v) - case "EJECTION_BALANCE": - assert.Equal(t, "22", v) - case "EFFECTIVE_BALANCE_INCREMENT": - assert.Equal(t, "23", v) - case "GENESIS_FORK_VERSION": - assert.Equal(t, "0x"+hex.EncodeToString([]byte("GenesisForkVersion")), v) - case "ALTAIR_FORK_VERSION": - assert.Equal(t, "0x"+hex.EncodeToString([]byte("AltairForkVersion")), v) - case "ALTAIR_FORK_EPOCH": - assert.Equal(t, "100", v) - case "BELLATRIX_FORK_VERSION": - assert.Equal(t, "0x"+hex.EncodeToString([]byte("BellatrixForkVersion")), v) - case "BELLATRIX_FORK_EPOCH": - assert.Equal(t, "101", v) - case "CAPELLA_FORK_VERSION": - assert.Equal(t, "0x"+hex.EncodeToString([]byte("CapellaForkVersion")), v) - case "CAPELLA_FORK_EPOCH": - assert.Equal(t, "103", v) - case "DENEB_FORK_VERSION": - assert.Equal(t, "0x"+hex.EncodeToString([]byte("DenebForkVersion")), v) - case "DENEB_FORK_EPOCH": - assert.Equal(t, "105", v) - case "MIN_ANCHOR_POW_BLOCK_DIFFICULTY": - assert.Equal(t, "1000", v) - case "BLS_WITHDRAWAL_PREFIX": - assert.Equal(t, "0x62", v) - case "ETH1_ADDRESS_WITHDRAWAL_PREFIX": - assert.Equal(t, "0x63", v) - case "GENESIS_DELAY": - assert.Equal(t, "24", v) - case "SECONDS_PER_SLOT": - assert.Equal(t, "25", v) - case "MIN_ATTESTATION_INCLUSION_DELAY": - assert.Equal(t, "26", v) - case "SLOTS_PER_EPOCH": - assert.Equal(t, "27", v) - case "MIN_SEED_LOOKAHEAD": - assert.Equal(t, "28", v) - case "MAX_SEED_LOOKAHEAD": - assert.Equal(t, "29", v) - case "EPOCHS_PER_ETH1_VOTING_PERIOD": - assert.Equal(t, "30", v) - case "SLOTS_PER_HISTORICAL_ROOT": - assert.Equal(t, "31", v) - case "MIN_VALIDATOR_WITHDRAWABILITY_DELAY": - assert.Equal(t, "32", v) - case "SHARD_COMMITTEE_PERIOD": - assert.Equal(t, "33", v) - case "MIN_EPOCHS_TO_INACTIVITY_PENALTY": - assert.Equal(t, "34", v) - case "EPOCHS_PER_HISTORICAL_VECTOR": - assert.Equal(t, "35", v) - case "EPOCHS_PER_SLASHINGS_VECTOR": - assert.Equal(t, "36", v) - case "HISTORICAL_ROOTS_LIMIT": - assert.Equal(t, "37", v) - case "VALIDATOR_REGISTRY_LIMIT": - assert.Equal(t, "38", v) - case "BASE_REWARD_FACTOR": - assert.Equal(t, "39", v) - case "WHISTLEBLOWER_REWARD_QUOTIENT": - assert.Equal(t, "40", v) - case "PROPOSER_REWARD_QUOTIENT": - assert.Equal(t, "41", v) - case "INACTIVITY_PENALTY_QUOTIENT": - assert.Equal(t, "42", v) - case "HF1_INACTIVITY_PENALTY_QUOTIENT": - assert.Equal(t, "43", v) - case "MIN_SLASHING_PENALTY_QUOTIENT": - assert.Equal(t, "44", v) - case "HF1_MIN_SLASHING_PENALTY_QUOTIENT": - assert.Equal(t, "45", v) - case "PROPORTIONAL_SLASHING_MULTIPLIER": - assert.Equal(t, "46", v) - case "HF1_PROPORTIONAL_SLASHING_MULTIPLIER": - assert.Equal(t, "47", v) - case "MAX_PROPOSER_SLASHINGS": - assert.Equal(t, "48", v) - case "MAX_ATTESTER_SLASHINGS": - assert.Equal(t, "49", v) - case "MAX_ATTESTATIONS": - assert.Equal(t, "50", v) - case "MAX_DEPOSITS": - assert.Equal(t, "51", v) - case "MAX_VOLUNTARY_EXITS": - assert.Equal(t, "52", v) - case "MAX_BLOBS_PER_BLOCK": - assert.Equal(t, "4", v) - case "TIMELY_HEAD_FLAG_INDEX": - assert.Equal(t, "0x35", v) - case "TIMELY_SOURCE_FLAG_INDEX": - assert.Equal(t, "0x36", v) - case "TIMELY_TARGET_FLAG_INDEX": - assert.Equal(t, "0x37", v) - case "TIMELY_HEAD_WEIGHT": - assert.Equal(t, "56", v) - case "TIMELY_SOURCE_WEIGHT": - assert.Equal(t, "57", v) - case "TIMELY_TARGET_WEIGHT": - assert.Equal(t, "58", v) - case "SYNC_REWARD_WEIGHT": - assert.Equal(t, "59", v) - case "WEIGHT_DENOMINATOR": - assert.Equal(t, "60", v) - case "TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE": - assert.Equal(t, "61", v) - case "SYNC_COMMITTEE_SUBNET_COUNT": - assert.Equal(t, "62", v) - case "SYNC_COMMITTEE_SIZE": - assert.Equal(t, "63", v) - case "SYNC_PUBKEYS_PER_AGGREGATE": - assert.Equal(t, "64", v) - case "INACTIVITY_SCORE_BIAS": - assert.Equal(t, "65", v) - case "EPOCHS_PER_SYNC_COMMITTEE_PERIOD": - assert.Equal(t, "66", v) - case "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": - assert.Equal(t, "67", v) - case "MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR": - assert.Equal(t, "68", v) - case "PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR": - assert.Equal(t, "69", v) - case "INACTIVITY_SCORE_RECOVERY_RATE": - assert.Equal(t, "70", v) - case "MIN_SYNC_COMMITTEE_PARTICIPANTS": - assert.Equal(t, "71", v) - case "PROPOSER_WEIGHT": - assert.Equal(t, "8", v) - case "DOMAIN_BEACON_PROPOSER": - assert.Equal(t, "0x30303031", v) - case "DOMAIN_BEACON_ATTESTER": - assert.Equal(t, "0x30303032", v) - case "DOMAIN_RANDAO": - assert.Equal(t, "0x30303033", v) - case "DOMAIN_DEPOSIT": - assert.Equal(t, "0x30303034", v) - case "DOMAIN_VOLUNTARY_EXIT": - assert.Equal(t, "0x30303035", v) - case "DOMAIN_SELECTION_PROOF": - assert.Equal(t, "0x30303036", v) - case "DOMAIN_AGGREGATE_AND_PROOF": - assert.Equal(t, "0x30303037", v) - case "DOMAIN_APPLICATION_MASK": - assert.Equal(t, "0x31303030", v) - case "DOMAIN_SYNC_COMMITTEE": - assert.Equal(t, "0x07000000", v) - case "DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF": - assert.Equal(t, "0x08000000", v) - case "DOMAIN_CONTRIBUTION_AND_PROOF": - assert.Equal(t, "0x09000000", v) - case "DOMAIN_BLS_TO_EXECUTION_CHANGE": - assert.Equal(t, "0x0a000000", v) - case "DOMAIN_APPLICATION_BUILDER": - assert.Equal(t, "0x00000001", v) - case "DOMAIN_BLOB_SIDECAR": - assert.Equal(t, "0x00000000", v) - case "TRANSITION_TOTAL_DIFFICULTY": - assert.Equal(t, "0", v) - case "TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH": - assert.Equal(t, "72", v) - case "TERMINAL_BLOCK_HASH": - s, ok := v.(string) - require.Equal(t, true, ok) - assert.Equal(t, common.HexToHash("TerminalBlockHash"), common.HexToHash(s)) - case "TERMINAL_TOTAL_DIFFICULTY": - assert.Equal(t, "73", v) - case "DefaultFeeRecipient": - assert.Equal(t, common.HexToAddress("DefaultFeeRecipient"), v) - case "PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX": - assert.Equal(t, "3", v) - case "MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX": - assert.Equal(t, "32", v) - case "INACTIVITY_PENALTY_QUOTIENT_BELLATRIX": - assert.Equal(t, "16777216", v) - case "PROPOSER_SCORE_BOOST": - assert.Equal(t, "40", v) - case "INTERVALS_PER_SLOT": - assert.Equal(t, "3", v) - case "MAX_WITHDRAWALS_PER_PAYLOAD": - assert.Equal(t, "74", v) - case "MAX_BLS_TO_EXECUTION_CHANGES": - assert.Equal(t, "75", v) - case "MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP": - assert.Equal(t, "76", v) - case "REORG_MAX_EPOCHS_SINCE_FINALIZATION": - assert.Equal(t, "2", v) - case "REORG_WEIGHT_THRESHOLD": - assert.Equal(t, "20", v) - case "REORG_PARENT_WEIGHT_THRESHOLD": - assert.Equal(t, "160", v) - case "MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT": - assert.Equal(t, "8", v) - case "MAX_REQUEST_LIGHT_CLIENT_UPDATES": - assert.Equal(t, "128", v) - case "SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY": - case "NODE_ID_BITS": - assert.Equal(t, "256", v) - case "ATTESTATION_SUBNET_EXTRA_BITS": - assert.Equal(t, "0", v) - case "ATTESTATION_SUBNET_PREFIX_BITS": - assert.Equal(t, "6", v) - case "SUBNETS_PER_NODE": - assert.Equal(t, "2", v) - case "EPOCHS_PER_SUBNET_SUBSCRIPTION": - assert.Equal(t, "256", v) - case "MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS": - assert.Equal(t, "4096", v) - case "MAX_REQUEST_BLOB_SIDECARS": - assert.Equal(t, "768", v) - case "MESSAGE_DOMAIN_INVALID_SNAPPY": - assert.Equal(t, "0x00000000", v) - case "MESSAGE_DOMAIN_VALID_SNAPPY": - assert.Equal(t, "0x01000000", v) - case "ATTESTATION_PROPAGATION_SLOT_RANGE": - assert.Equal(t, "32", v) - case "RESP_TIMEOUT": - assert.Equal(t, "10", v) - case "TTFB_TIMEOUT": - assert.Equal(t, "5", v) - case "MIN_EPOCHS_FOR_BLOCK_REQUESTS": - assert.Equal(t, "33024", v) - case "GOSSIP_MAX_SIZE": - assert.Equal(t, "10485760", v) - case "MAX_CHUNK_SIZE": - assert.Equal(t, "10485760", v) - case "ATTESTATION_SUBNET_COUNT": - assert.Equal(t, "64", v) - case "MAXIMUM_GOSSIP_CLOCK_DISPARITY": - assert.Equal(t, "500", v) - case "MAX_REQUEST_BLOCKS": - assert.Equal(t, "1024", v) - case "MAX_REQUEST_BLOCKS_DENEB": - assert.Equal(t, "128", v) - default: - t.Errorf("Incorrect key: %s", k) - } + t.Run(k, func(t *testing.T) { + switch k { + case "CONFIG_NAME": + assert.Equal(t, "ConfigName", v) + case "PRESET_BASE": + assert.Equal(t, "PresetBase", v) + case "MAX_COMMITTEES_PER_SLOT": + assert.Equal(t, "1", v) + case "TARGET_COMMITTEE_SIZE": + assert.Equal(t, "2", v) + case "MAX_VALIDATORS_PER_COMMITTEE": + assert.Equal(t, "3", v) + case "MIN_PER_EPOCH_CHURN_LIMIT": + assert.Equal(t, "4", v) + case "CHURN_LIMIT_QUOTIENT": + assert.Equal(t, "5", v) + case "SHUFFLE_ROUND_COUNT": + assert.Equal(t, "6", v) + case "MIN_GENESIS_ACTIVE_VALIDATOR_COUNT": + assert.Equal(t, "7", v) + case "MIN_GENESIS_TIME": + assert.Equal(t, "8", v) + case "HYSTERESIS_QUOTIENT": + assert.Equal(t, "9", v) + case "HYSTERESIS_DOWNWARD_MULTIPLIER": + assert.Equal(t, "10", v) + case "HYSTERESIS_UPWARD_MULTIPLIER": + assert.Equal(t, "11", v) + case "SAFE_SLOTS_TO_UPDATE_JUSTIFIED": + assert.Equal(t, "0", v) + case "ETH1_FOLLOW_DISTANCE": + assert.Equal(t, "13", v) + case "TARGET_AGGREGATORS_PER_COMMITTEE": + assert.Equal(t, "14", v) + case "RANDOM_SUBNETS_PER_VALIDATOR": + assert.Equal(t, "15", v) + case "EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION": + assert.Equal(t, "16", v) + case "SECONDS_PER_ETH1_BLOCK": + assert.Equal(t, "17", v) + case "DEPOSIT_CHAIN_ID": + assert.Equal(t, "18", v) + case "DEPOSIT_NETWORK_ID": + assert.Equal(t, "19", v) + case "DEPOSIT_CONTRACT_ADDRESS": + assert.Equal(t, "DepositContractAddress", v) + case "MIN_DEPOSIT_AMOUNT": + assert.Equal(t, "20", v) + case "MAX_EFFECTIVE_BALANCE": + assert.Equal(t, "21", v) + case "EJECTION_BALANCE": + assert.Equal(t, "22", v) + case "EFFECTIVE_BALANCE_INCREMENT": + assert.Equal(t, "23", v) + case "GENESIS_FORK_VERSION": + assert.Equal(t, "0x"+hex.EncodeToString([]byte("GenesisForkVersion")), v) + case "ALTAIR_FORK_VERSION": + assert.Equal(t, "0x"+hex.EncodeToString([]byte("AltairForkVersion")), v) + case "ALTAIR_FORK_EPOCH": + assert.Equal(t, "100", v) + case "BELLATRIX_FORK_VERSION": + assert.Equal(t, "0x"+hex.EncodeToString([]byte("BellatrixForkVersion")), v) + case "BELLATRIX_FORK_EPOCH": + assert.Equal(t, "101", v) + case "CAPELLA_FORK_VERSION": + assert.Equal(t, "0x"+hex.EncodeToString([]byte("CapellaForkVersion")), v) + case "CAPELLA_FORK_EPOCH": + assert.Equal(t, "103", v) + case "DENEB_FORK_VERSION": + assert.Equal(t, "0x"+hex.EncodeToString([]byte("DenebForkVersion")), v) + case "DENEB_FORK_EPOCH": + assert.Equal(t, "105", v) + case "ELECTRA_FORK_VERSION": + assert.Equal(t, "0x"+hex.EncodeToString([]byte("ElectraForkVersion")), v) + case "ELECTRA_FORK_EPOCH": + assert.Equal(t, "107", v) + case "MIN_ANCHOR_POW_BLOCK_DIFFICULTY": + assert.Equal(t, "1000", v) + case "BLS_WITHDRAWAL_PREFIX": + assert.Equal(t, "0x62", v) + case "ETH1_ADDRESS_WITHDRAWAL_PREFIX": + assert.Equal(t, "0x63", v) + case "GENESIS_DELAY": + assert.Equal(t, "24", v) + case "SECONDS_PER_SLOT": + assert.Equal(t, "25", v) + case "MIN_ATTESTATION_INCLUSION_DELAY": + assert.Equal(t, "26", v) + case "SLOTS_PER_EPOCH": + assert.Equal(t, "27", v) + case "MIN_SEED_LOOKAHEAD": + assert.Equal(t, "28", v) + case "MAX_SEED_LOOKAHEAD": + assert.Equal(t, "29", v) + case "EPOCHS_PER_ETH1_VOTING_PERIOD": + assert.Equal(t, "30", v) + case "SLOTS_PER_HISTORICAL_ROOT": + assert.Equal(t, "31", v) + case "MIN_VALIDATOR_WITHDRAWABILITY_DELAY": + assert.Equal(t, "32", v) + case "SHARD_COMMITTEE_PERIOD": + assert.Equal(t, "33", v) + case "MIN_EPOCHS_TO_INACTIVITY_PENALTY": + assert.Equal(t, "34", v) + case "EPOCHS_PER_HISTORICAL_VECTOR": + assert.Equal(t, "35", v) + case "EPOCHS_PER_SLASHINGS_VECTOR": + assert.Equal(t, "36", v) + case "HISTORICAL_ROOTS_LIMIT": + assert.Equal(t, "37", v) + case "VALIDATOR_REGISTRY_LIMIT": + assert.Equal(t, "38", v) + case "BASE_REWARD_FACTOR": + assert.Equal(t, "39", v) + case "WHISTLEBLOWER_REWARD_QUOTIENT": + assert.Equal(t, "40", v) + case "PROPOSER_REWARD_QUOTIENT": + assert.Equal(t, "41", v) + case "INACTIVITY_PENALTY_QUOTIENT": + assert.Equal(t, "42", v) + case "HF1_INACTIVITY_PENALTY_QUOTIENT": + assert.Equal(t, "43", v) + case "MIN_SLASHING_PENALTY_QUOTIENT": + assert.Equal(t, "44", v) + case "HF1_MIN_SLASHING_PENALTY_QUOTIENT": + assert.Equal(t, "45", v) + case "PROPORTIONAL_SLASHING_MULTIPLIER": + assert.Equal(t, "46", v) + case "HF1_PROPORTIONAL_SLASHING_MULTIPLIER": + assert.Equal(t, "47", v) + case "MAX_PROPOSER_SLASHINGS": + assert.Equal(t, "48", v) + case "MAX_ATTESTER_SLASHINGS": + assert.Equal(t, "49", v) + case "MAX_ATTESTATIONS": + assert.Equal(t, "50", v) + case "MAX_DEPOSITS": + assert.Equal(t, "51", v) + case "MAX_VOLUNTARY_EXITS": + assert.Equal(t, "52", v) + case "MAX_BLOBS_PER_BLOCK": + assert.Equal(t, "4", v) + case "TIMELY_HEAD_FLAG_INDEX": + assert.Equal(t, "0x35", v) + case "TIMELY_SOURCE_FLAG_INDEX": + assert.Equal(t, "0x36", v) + case "TIMELY_TARGET_FLAG_INDEX": + assert.Equal(t, "0x37", v) + case "TIMELY_HEAD_WEIGHT": + assert.Equal(t, "56", v) + case "TIMELY_SOURCE_WEIGHT": + assert.Equal(t, "57", v) + case "TIMELY_TARGET_WEIGHT": + assert.Equal(t, "58", v) + case "SYNC_REWARD_WEIGHT": + assert.Equal(t, "59", v) + case "WEIGHT_DENOMINATOR": + assert.Equal(t, "60", v) + case "TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE": + assert.Equal(t, "61", v) + case "SYNC_COMMITTEE_SUBNET_COUNT": + assert.Equal(t, "62", v) + case "SYNC_COMMITTEE_SIZE": + assert.Equal(t, "63", v) + case "SYNC_PUBKEYS_PER_AGGREGATE": + assert.Equal(t, "64", v) + case "INACTIVITY_SCORE_BIAS": + assert.Equal(t, "65", v) + case "EPOCHS_PER_SYNC_COMMITTEE_PERIOD": + assert.Equal(t, "66", v) + case "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": + assert.Equal(t, "67", v) + case "MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR": + assert.Equal(t, "68", v) + case "PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR": + assert.Equal(t, "69", v) + case "INACTIVITY_SCORE_RECOVERY_RATE": + assert.Equal(t, "70", v) + case "MIN_SYNC_COMMITTEE_PARTICIPANTS": + assert.Equal(t, "71", v) + case "PROPOSER_WEIGHT": + assert.Equal(t, "8", v) + case "DOMAIN_BEACON_PROPOSER": + assert.Equal(t, "0x30303031", v) + case "DOMAIN_BEACON_ATTESTER": + assert.Equal(t, "0x30303032", v) + case "DOMAIN_RANDAO": + assert.Equal(t, "0x30303033", v) + case "DOMAIN_DEPOSIT": + assert.Equal(t, "0x30303034", v) + case "DOMAIN_VOLUNTARY_EXIT": + assert.Equal(t, "0x30303035", v) + case "DOMAIN_SELECTION_PROOF": + assert.Equal(t, "0x30303036", v) + case "DOMAIN_AGGREGATE_AND_PROOF": + assert.Equal(t, "0x30303037", v) + case "DOMAIN_APPLICATION_MASK": + assert.Equal(t, "0x31303030", v) + case "DOMAIN_SYNC_COMMITTEE": + assert.Equal(t, "0x07000000", v) + case "DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF": + assert.Equal(t, "0x08000000", v) + case "DOMAIN_CONTRIBUTION_AND_PROOF": + assert.Equal(t, "0x09000000", v) + case "DOMAIN_BLS_TO_EXECUTION_CHANGE": + assert.Equal(t, "0x0a000000", v) + case "DOMAIN_APPLICATION_BUILDER": + assert.Equal(t, "0x00000001", v) + case "DOMAIN_BLOB_SIDECAR": + assert.Equal(t, "0x00000000", v) + case "TRANSITION_TOTAL_DIFFICULTY": + assert.Equal(t, "0", v) + case "TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH": + assert.Equal(t, "72", v) + case "TERMINAL_BLOCK_HASH": + s, ok := v.(string) + require.Equal(t, true, ok) + assert.Equal(t, common.HexToHash("TerminalBlockHash"), common.HexToHash(s)) + case "TERMINAL_TOTAL_DIFFICULTY": + assert.Equal(t, "73", v) + case "DefaultFeeRecipient": + assert.Equal(t, common.HexToAddress("DefaultFeeRecipient"), v) + case "PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX": + assert.Equal(t, "3", v) + case "MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX": + assert.Equal(t, "32", v) + case "INACTIVITY_PENALTY_QUOTIENT_BELLATRIX": + assert.Equal(t, "16777216", v) + case "PROPOSER_SCORE_BOOST": + assert.Equal(t, "40", v) + case "INTERVALS_PER_SLOT": + assert.Equal(t, "3", v) + case "MAX_WITHDRAWALS_PER_PAYLOAD": + assert.Equal(t, "74", v) + case "MAX_BLS_TO_EXECUTION_CHANGES": + assert.Equal(t, "75", v) + case "MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP": + assert.Equal(t, "76", v) + case "REORG_MAX_EPOCHS_SINCE_FINALIZATION": + assert.Equal(t, "2", v) + case "REORG_WEIGHT_THRESHOLD": + assert.Equal(t, "20", v) + case "REORG_PARENT_WEIGHT_THRESHOLD": + assert.Equal(t, "160", v) + case "MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT": + assert.Equal(t, "8", v) + case "MAX_REQUEST_LIGHT_CLIENT_UPDATES": + assert.Equal(t, "128", v) + case "SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY": + case "NODE_ID_BITS": + assert.Equal(t, "256", v) + case "ATTESTATION_SUBNET_EXTRA_BITS": + assert.Equal(t, "0", v) + case "ATTESTATION_SUBNET_PREFIX_BITS": + assert.Equal(t, "6", v) + case "SUBNETS_PER_NODE": + assert.Equal(t, "2", v) + case "EPOCHS_PER_SUBNET_SUBSCRIPTION": + assert.Equal(t, "256", v) + case "MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS": + assert.Equal(t, "4096", v) + case "MAX_REQUEST_BLOB_SIDECARS": + assert.Equal(t, "768", v) + case "MESSAGE_DOMAIN_INVALID_SNAPPY": + assert.Equal(t, "0x00000000", v) + case "MESSAGE_DOMAIN_VALID_SNAPPY": + assert.Equal(t, "0x01000000", v) + case "ATTESTATION_PROPAGATION_SLOT_RANGE": + assert.Equal(t, "32", v) + case "RESP_TIMEOUT": + assert.Equal(t, "10", v) + case "TTFB_TIMEOUT": + assert.Equal(t, "5", v) + case "MIN_EPOCHS_FOR_BLOCK_REQUESTS": + assert.Equal(t, "33024", v) + case "GOSSIP_MAX_SIZE": + assert.Equal(t, "10485760", v) + case "MAX_CHUNK_SIZE": + assert.Equal(t, "10485760", v) + case "ATTESTATION_SUBNET_COUNT": + assert.Equal(t, "64", v) + case "MAXIMUM_GOSSIP_CLOCK_DISPARITY": + assert.Equal(t, "500", v) + case "MAX_REQUEST_BLOCKS": + assert.Equal(t, "1024", v) + case "MAX_REQUEST_BLOCKS_DENEB": + assert.Equal(t, "128", v) + case "NUMBER_OF_COLUMNS": + assert.Equal(t, "128", v) + case "MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA": + assert.Equal(t, "128000000000", v) + case "MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT": + assert.Equal(t, "256000000000", v) + case "DATA_COLUMN_SIDECAR_SUBNET_COUNT": + assert.Equal(t, "32", v) + case "MAX_REQUEST_DATA_COLUMN_SIDECARS": + assert.Equal(t, "16384", v) + default: + t.Errorf("Incorrect key: %s", k) + } + }) } } diff --git a/config/params/config.go b/config/params/config.go index 7a140be77cc9..75817b273c22 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -157,6 +157,8 @@ type BeaconChainConfig struct { CapellaForkEpoch primitives.Epoch `yaml:"CAPELLA_FORK_EPOCH" spec:"true"` // CapellaForkEpoch is used to represent the assigned fork epoch for capella. DenebForkVersion []byte `yaml:"DENEB_FORK_VERSION" spec:"true"` // DenebForkVersion is used to represent the fork version for deneb. DenebForkEpoch primitives.Epoch `yaml:"DENEB_FORK_EPOCH" spec:"true"` // DenebForkEpoch is used to represent the assigned fork epoch for deneb. + ElectraForkVersion []byte `yaml:"ELECTRA_FORK_VERSION" spec:"true"` // ElectraForkVersion is used to represent the fork version for deneb. + ElectraForkEpoch primitives.Epoch `yaml:"ELECTRA_FORK_EPOCH" spec:"true"` // ElectraForkEpoch is used to represent the assigned fork epoch for deneb. ForkVersionSchedule map[[fieldparams.VersionLength]byte]primitives.Epoch // Schedule of fork epochs by version. ForkVersionNames map[[fieldparams.VersionLength]byte]string // Human-readable names of fork versions. @@ -226,6 +228,13 @@ type BeaconChainConfig struct { MaxRequestBlobSidecars uint64 `yaml:"MAX_REQUEST_BLOB_SIDECARS" spec:"true"` // MaxRequestBlobSidecars is the maximum number of blobs to request in a single request. MaxRequestBlocksDeneb uint64 `yaml:"MAX_REQUEST_BLOCKS_DENEB" spec:"true"` // MaxRequestBlocksDeneb is the maximum number of blocks in a single request after the deneb epoch. + // Values introduce in Electra upgrade + NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix. + DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol + MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn. + MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra. + MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request + // Networking Specific Parameters GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE" spec:"true"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages. MaxChunkSize uint64 `yaml:"MAX_CHUNK_SIZE" spec:"true"` // MaxChunkSize is the maximum allowed size of uncompressed req/resp chunked responses. diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 48e9060721cc..8f22c974d10d 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -27,6 +27,8 @@ const ( mainnetCapellaForkEpoch = 194048 // April 12, 2023, 22:27:35 UTC // Deneb Fork Epoch for mainnet config. mainnetDenebForkEpoch = 269568 // March 13, 2024, 13:55:35 UTC + // Electra Fork Epoch for mainnet config + mainnetElectraForkEpoch = math.MaxUint64 // Far future / to be defined ) var mainnetNetworkConfig = &NetworkConfig{ @@ -207,6 +209,8 @@ var mainnetBeaconConfig = &BeaconChainConfig{ CapellaForkEpoch: mainnetCapellaForkEpoch, DenebForkVersion: []byte{4, 0, 0, 0}, DenebForkEpoch: mainnetDenebForkEpoch, + ElectraForkVersion: []byte{5, 0, 0, 0}, + ElectraForkEpoch: mainnetElectraForkEpoch, // New values introduced in Altair hard fork 1. // Participation flag indices. @@ -265,6 +269,13 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxRequestBlobSidecars: 768, MaxRequestBlocksDeneb: 128, + // Values related to electra + NumberOfColumns: 128, + MaxRequestDataColumnSidecars: 16384, + DataColumnSidecarSubnetCount: 32, + MinPerEpochChurnLimitElectra: 128000000000, + MaxPerEpochActivationExitChurnLimit: 256000000000, + // Values related to networking parameters. GossipMaxSize: 10 * 1 << 20, // 10 MiB MaxChunkSize: 10 * 1 << 20, // 10 MiB diff --git a/config/params/minimal_config.go b/config/params/minimal_config.go index 72cd7e2da3e5..7f4eb0273ffd 100644 --- a/config/params/minimal_config.go +++ b/config/params/minimal_config.go @@ -91,12 +91,18 @@ func MinimalSpecConfig() *BeaconChainConfig { minimalConfig.CapellaForkEpoch = math.MaxUint64 minimalConfig.DenebForkVersion = []byte{4, 0, 0, 1} minimalConfig.DenebForkEpoch = math.MaxUint64 + minimalConfig.ElectraForkVersion = []byte{5, 0, 0, 1} + minimalConfig.AltairForkEpoch = math.MaxUint64 minimalConfig.SyncCommitteeSize = 32 minimalConfig.InactivityScoreBias = 4 minimalConfig.EpochsPerSyncCommitteePeriod = 8 minimalConfig.MinEpochsForBlockRequests = 272 + // New Electra params + minimalConfig.MinPerEpochChurnLimitElectra = 64000000000 + minimalConfig.MaxPerEpochActivationExitChurnLimit = 128000000000 + // Ethereum PoW parameters. minimalConfig.DepositChainID = 5 // Chain ID of eth1 goerli. minimalConfig.DepositNetworkID = 5 // Network ID of eth1 goerli. From 75857e71776b7dbd9e88530eacddb9c7a60bef6e Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 22 Apr 2024 20:09:16 -0700 Subject: [PATCH 048/325] Simplify prune invalid by reusing existing fork choice store call (#13878) --- beacon-chain/blockchain/chain_info.go | 7 ------- beacon-chain/blockchain/execution_engine.go | 2 +- beacon-chain/blockchain/receive_block.go | 5 ++++- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/beacon-chain/blockchain/chain_info.go b/beacon-chain/blockchain/chain_info.go index 30dfeac9642b..f6a6e5dec924 100644 --- a/beacon-chain/blockchain/chain_info.go +++ b/beacon-chain/blockchain/chain_info.go @@ -509,13 +509,6 @@ func (s *Service) Ancestor(ctx context.Context, root []byte, slot primitives.Slo return ar[:], nil } -// SetOptimisticToInvalid wraps the corresponding method in forkchoice -func (s *Service) SetOptimisticToInvalid(ctx context.Context, root, parent, lvh [32]byte) ([][32]byte, error) { - s.cfg.ForkChoiceStore.Lock() - defer s.cfg.ForkChoiceStore.Unlock() - return s.cfg.ForkChoiceStore.SetOptimisticToInvalid(ctx, root, parent, lvh) -} - // SetGenesisTime sets the genesis time of beacon chain. func (s *Service) SetGenesisTime(t time.Time) { s.genesisTime = t diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 6d6f85cdf78b..3d4e72442c03 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -256,7 +256,7 @@ func (s *Service) notifyNewPayload(ctx context.Context, preStateVersion int, // reportInvalidBlock deals with the event that an invalid block was detected by the execution layer func (s *Service) pruneInvalidBlock(ctx context.Context, root, parentRoot, lvh [32]byte) error { newPayloadInvalidNodeCount.Inc() - invalidRoots, err := s.SetOptimisticToInvalid(ctx, root, parentRoot, lvh) + invalidRoots, err := s.cfg.ForkChoiceStore.SetOptimisticToInvalid(ctx, root, parentRoot, lvh) if err != nil { return err } diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index dd6cba229b0b..23a6f9de1e2a 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -497,7 +497,10 @@ func (s *Service) sendBlockAttestationsToSlasher(signed interfaces.ReadOnlySigne func (s *Service) validateExecutionOnBlock(ctx context.Context, ver int, header interfaces.ExecutionData, signed interfaces.ReadOnlySignedBeaconBlock, blockRoot [32]byte) (bool, error) { isValidPayload, err := s.notifyNewPayload(ctx, ver, header, signed) if err != nil { - return false, s.handleInvalidExecutionError(ctx, err, blockRoot, signed.Block().ParentRoot()) + s.cfg.ForkChoiceStore.Lock() + err = s.handleInvalidExecutionError(ctx, err, blockRoot, signed.Block().ParentRoot()) + s.cfg.ForkChoiceStore.Unlock() + return false, err } if signed.Version() < version.Capella && isValidPayload { if err := s.validateMergeTransitionBlock(ctx, ver, header, signed); err != nil { From a0dac292ffc8c7f7512c2b0835af37509174f8d8 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Tue, 23 Apr 2024 10:09:26 +0200 Subject: [PATCH 049/325] Do not remove blobs DB in slasher. (#13881) --- beacon-chain/node/node.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 64bef6d46363..c5c66c639875 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -643,9 +643,7 @@ func (b *BeaconNode) startSlasherDB(cliCtx *cli.Context) error { if err := d.ClearDB(); err != nil { return errors.Wrap(err, "could not clear database") } - if err := b.BlobStorage.Clear(); err != nil { - return errors.Wrap(err, "could not clear blob storage") - } + d, err = slasherkv.NewKVStore(b.ctx, dbPath) if err != nil { return errors.Wrap(err, "could not create new database") From 2c669185949e444520d60cc0043889294daf18e2 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 23 Apr 2024 10:24:47 -0500 Subject: [PATCH 050/325] Refactor beacon-chain/core/helpers tests to be black box (#13906) --- beacon-chain/core/helpers/BUILD.bazel | 2 + beacon-chain/core/helpers/beacon_committee.go | 12 +- .../core/helpers/beacon_committee_test.go | 127 +++++++++--------- .../helpers/private_access_fuzz_noop_test.go | 17 +++ .../core/helpers/private_access_test.go | 17 +++ beacon-chain/core/helpers/randao_test.go | 15 ++- .../core/helpers/rewards_penalties_test.go | 53 ++++---- beacon-chain/core/helpers/sync_committee.go | 12 +- .../core/helpers/sync_committee_test.go | 81 +++++------ beacon-chain/core/helpers/validators_test.go | 85 ++++++------ 10 files changed, 231 insertions(+), 190 deletions(-) create mode 100644 beacon-chain/core/helpers/private_access_fuzz_noop_test.go create mode 100644 beacon-chain/core/helpers/private_access_test.go diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index 78b3e8bb4417..f49a5ecaeeca 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -50,6 +50,8 @@ go_test( "attestation_test.go", "beacon_committee_test.go", "block_test.go", + "private_access_fuzz_noop_test.go", # keep + "private_access_test.go", "randao_test.go", "rewards_penalties_test.go", "shuffle_test.go", diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index a5b16367f89d..715e490b7a64 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -140,7 +140,7 @@ func BeaconCommittee( } count := committeesPerSlot * uint64(params.BeaconConfig().SlotsPerEpoch) - return computeCommittee(validatorIndices, seed, indexOffset, count) + return ComputeCommittee(validatorIndices, seed, indexOffset, count) } // CommitteeAssignmentContainer represents a committee list, committee index, and to be attested slot for a given epoch. @@ -359,7 +359,7 @@ func UpdateProposerIndicesInCache(ctx context.Context, state state.ReadOnlyBeaco if err != nil { return err } - proposerIndices, err := precomputeProposerIndices(state, indices, epoch) + proposerIndices, err := PrecomputeProposerIndices(state, indices, epoch) if err != nil { return err } @@ -409,7 +409,7 @@ func ClearCache() { balanceCache.Clear() } -// computeCommittee returns the requested shuffled committee out of the total committees using +// ComputeCommittee returns the requested shuffled committee out of the total committees using // validator indices and seed. // // Spec pseudocode definition: @@ -424,7 +424,7 @@ func ClearCache() { // start = (len(indices) * index) // count // end = (len(indices) * uint64(index + 1)) // count // return [indices[compute_shuffled_index(uint64(i), uint64(len(indices)), seed)] for i in range(start, end)] -func computeCommittee( +func ComputeCommittee( indices []primitives.ValidatorIndex, seed [32]byte, index, count uint64, @@ -451,9 +451,9 @@ func computeCommittee( return shuffledList[start:end], nil } -// This computes proposer indices of the current epoch and returns a list of proposer indices, +// PrecomputeProposerIndices computes proposer indices of the current epoch and returns a list of proposer indices, // the index of the list represents the slot number. -func precomputeProposerIndices(state state.ReadOnlyBeaconState, activeIndices []primitives.ValidatorIndex, e primitives.Epoch) ([]primitives.ValidatorIndex, error) { +func PrecomputeProposerIndices(state state.ReadOnlyBeaconState, activeIndices []primitives.ValidatorIndex, e primitives.Epoch) ([]primitives.ValidatorIndex, error) { hashFunc := hash.CustomSHA256Hasher() proposerIndices := make([]primitives.ValidatorIndex, params.BeaconConfig().SlotsPerEpoch) diff --git a/beacon-chain/core/helpers/beacon_committee_test.go b/beacon-chain/core/helpers/beacon_committee_test.go index 2934a1274eb1..5de5d1bf4e38 100644 --- a/beacon-chain/core/helpers/beacon_committee_test.go +++ b/beacon-chain/core/helpers/beacon_committee_test.go @@ -1,4 +1,4 @@ -package helpers +package helpers_test import ( "context" @@ -7,6 +7,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -21,7 +22,7 @@ import ( ) func TestComputeCommittee_WithoutCache(t *testing.T) { - ClearCache() + helpers.ClearCache() // Create 10 committees committeeCount := uint64(10) @@ -48,16 +49,16 @@ func TestComputeCommittee_WithoutCache(t *testing.T) { require.NoError(t, err) epoch := time.CurrentEpoch(state) - indices, err := ActiveValidatorIndices(context.Background(), state, epoch) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, epoch) require.NoError(t, err) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) - committees, err := computeCommittee(indices, seed, 0, 1 /* Total committee*/) + committees, err := helpers.ComputeCommittee(indices, seed, 0, 1 /* Total committee*/) assert.NoError(t, err, "Could not compute committee") // Test shuffled indices are correct for index 5 committee index := uint64(5) - committee5, err := computeCommittee(indices, seed, index, committeeCount) + committee5, err := helpers.ComputeCommittee(indices, seed, index, committeeCount) assert.NoError(t, err, "Could not compute committee") start := slice.SplitOffset(validatorCount, committeeCount, index) end := slice.SplitOffset(validatorCount, committeeCount, index+1) @@ -65,7 +66,7 @@ func TestComputeCommittee_WithoutCache(t *testing.T) { // Test shuffled indices are correct for index 9 committee index = uint64(9) - committee9, err := computeCommittee(indices, seed, index, committeeCount) + committee9, err := helpers.ComputeCommittee(indices, seed, index, committeeCount) assert.NoError(t, err, "Could not compute committee") start = slice.SplitOffset(validatorCount, committeeCount, index) end = slice.SplitOffset(validatorCount, committeeCount, index+1) @@ -73,42 +74,42 @@ func TestComputeCommittee_WithoutCache(t *testing.T) { } func TestComputeCommittee_RegressionTest(t *testing.T) { - ClearCache() + helpers.ClearCache() indices := []primitives.ValidatorIndex{1, 3, 8, 16, 18, 19, 20, 23, 30, 35, 43, 46, 47, 54, 56, 58, 69, 70, 71, 83, 84, 85, 91, 96, 100, 103, 105, 106, 112, 121, 127, 128, 129, 140, 142, 144, 146, 147, 149, 152, 153, 154, 157, 160, 173, 175, 180, 182, 188, 189, 191, 194, 201, 204, 217, 221, 226, 228, 230, 231, 239, 241, 249, 250, 255} seed := [32]byte{68, 110, 161, 250, 98, 230, 161, 172, 227, 226, 99, 11, 138, 124, 201, 134, 38, 197, 0, 120, 6, 165, 122, 34, 19, 216, 43, 226, 210, 114, 165, 183} index := uint64(215) count := uint64(32) - _, err := computeCommittee(indices, seed, index, count) + _, err := helpers.ComputeCommittee(indices, seed, index, count) require.ErrorContains(t, "index out of range", err) } func TestVerifyBitfieldLength_OK(t *testing.T) { - ClearCache() + helpers.ClearCache() bf := bitfield.Bitlist{0xFF, 0x01} committeeSize := uint64(8) - assert.NoError(t, VerifyBitfieldLength(bf, committeeSize), "Bitfield is not validated when it was supposed to be") + assert.NoError(t, helpers.VerifyBitfieldLength(bf, committeeSize), "Bitfield is not validated when it was supposed to be") bf = bitfield.Bitlist{0xFF, 0x07} committeeSize = 10 - assert.NoError(t, VerifyBitfieldLength(bf, committeeSize), "Bitfield is not validated when it was supposed to be") + assert.NoError(t, helpers.VerifyBitfieldLength(bf, committeeSize), "Bitfield is not validated when it was supposed to be") } func TestCommitteeAssignments_CannotRetrieveFutureEpoch(t *testing.T) { - ClearCache() + helpers.ClearCache() epoch := primitives.Epoch(1) state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Slot: 0, // Epoch 0. }) require.NoError(t, err) - _, _, err = CommitteeAssignments(context.Background(), state, epoch+1) + _, _, err = helpers.CommitteeAssignments(context.Background(), state, epoch+1) assert.ErrorContains(t, "can't be greater than next epoch", err) } func TestCommitteeAssignments_NoProposerForSlot0(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, 4*params.BeaconConfig().SlotsPerEpoch) for i := 0; i < len(validators); i++ { @@ -127,7 +128,7 @@ func TestCommitteeAssignments_NoProposerForSlot0(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, proposerIndexToSlots, err := CommitteeAssignments(context.Background(), state, 0) + _, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), state, 0) require.NoError(t, err, "Failed to determine CommitteeAssignments") for _, ss := range proposerIndexToSlots { for _, s := range ss { @@ -198,9 +199,9 @@ func TestCommitteeAssignments_CanRetrieve(t *testing.T) { for i, tt := range tests { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { - ClearCache() + helpers.ClearCache() - validatorIndexToCommittee, proposerIndexToSlots, err := CommitteeAssignments(context.Background(), state, slots.ToEpoch(tt.slot)) + validatorIndexToCommittee, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), state, slots.ToEpoch(tt.slot)) require.NoError(t, err, "Failed to determine CommitteeAssignments") cac := validatorIndexToCommittee[tt.index] assert.Equal(t, tt.committeeIndex, cac.CommitteeIndex, "Unexpected committeeIndex for validator index %d", tt.index) @@ -215,7 +216,7 @@ func TestCommitteeAssignments_CanRetrieve(t *testing.T) { } func TestCommitteeAssignments_CannotRetrieveFuture(t *testing.T) { - ClearCache() + helpers.ClearCache() // Initialize test with 256 validators, each slot and each index gets 4 validators. validators := make([]*ethpb.Validator, 4*params.BeaconConfig().SlotsPerEpoch) @@ -237,17 +238,17 @@ func TestCommitteeAssignments_CannotRetrieveFuture(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, proposerIndxs, err := CommitteeAssignments(context.Background(), state, time.CurrentEpoch(state)) + _, proposerIndxs, err := helpers.CommitteeAssignments(context.Background(), state, time.CurrentEpoch(state)) require.NoError(t, err) require.NotEqual(t, 0, len(proposerIndxs), "wanted non-zero proposer index set") - _, proposerIndxs, err = CommitteeAssignments(context.Background(), state, time.CurrentEpoch(state)+1) + _, proposerIndxs, err = helpers.CommitteeAssignments(context.Background(), state, time.CurrentEpoch(state)+1) require.NoError(t, err) require.NotEqual(t, 0, len(proposerIndxs), "wanted non-zero proposer index set") } func TestCommitteeAssignments_CannotRetrieveOlderThanSlotsPerHistoricalRoot(t *testing.T) { - ClearCache() + helpers.ClearCache() // Initialize test with 256 validators, each slot and each index gets 4 validators. validators := make([]*ethpb.Validator, 4*params.BeaconConfig().SlotsPerEpoch) @@ -263,12 +264,12 @@ func TestCommitteeAssignments_CannotRetrieveOlderThanSlotsPerHistoricalRoot(t *t RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, _, err = CommitteeAssignments(context.Background(), state, 0) + _, _, err = helpers.CommitteeAssignments(context.Background(), state, 0) require.ErrorContains(t, "start slot 0 is smaller than the minimum valid start slot 1", err) } func TestCommitteeAssignments_EverySlotHasMin1Proposer(t *testing.T) { - ClearCache() + helpers.ClearCache() // Initialize test with 256 validators, each slot and each index gets 4 validators. validators := make([]*ethpb.Validator, 4*params.BeaconConfig().SlotsPerEpoch) @@ -285,7 +286,7 @@ func TestCommitteeAssignments_EverySlotHasMin1Proposer(t *testing.T) { }) require.NoError(t, err) epoch := primitives.Epoch(1) - _, proposerIndexToSlots, err := CommitteeAssignments(context.Background(), state, epoch) + _, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), state, epoch) require.NoError(t, err, "Failed to determine CommitteeAssignments") slotsWithProposers := make(map[primitives.Slot]bool) @@ -391,10 +392,10 @@ func TestVerifyAttestationBitfieldLengths_OK(t *testing.T) { } for i, tt := range tests { - ClearCache() + helpers.ClearCache() require.NoError(t, state.SetSlot(tt.stateSlot)) - err := VerifyAttestationBitfieldLengths(context.Background(), state, tt.attestation) + err := helpers.VerifyAttestationBitfieldLengths(context.Background(), state, tt.attestation) if tt.verificationFailure { assert.NotNil(t, err, "Verification succeeded when it was supposed to fail") } else { @@ -404,7 +405,7 @@ func TestVerifyAttestationBitfieldLengths_OK(t *testing.T) { } func TestUpdateCommitteeCache_CanUpdate(t *testing.T) { - ClearCache() + helpers.ClearCache() validatorCount := params.BeaconConfig().MinGenesisActiveValidatorCount validators := make([]*ethpb.Validator, validatorCount) @@ -421,20 +422,20 @@ func TestUpdateCommitteeCache_CanUpdate(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - require.NoError(t, UpdateCommitteeCache(context.Background(), state, time.CurrentEpoch(state))) + require.NoError(t, helpers.UpdateCommitteeCache(context.Background(), state, time.CurrentEpoch(state))) epoch := primitives.Epoch(0) idx := primitives.CommitteeIndex(1) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) - indices, err = committeeCache.Committee(context.Background(), params.BeaconConfig().SlotsPerEpoch.Mul(uint64(epoch)), seed, idx) + indices, err = helpers.CommitteeCache().Committee(context.Background(), params.BeaconConfig().SlotsPerEpoch.Mul(uint64(epoch)), seed, idx) require.NoError(t, err) assert.Equal(t, params.BeaconConfig().TargetCommitteeSize, uint64(len(indices)), "Did not save correct indices lengths") } func TestUpdateCommitteeCache_CanUpdateAcrossEpochs(t *testing.T) { - ClearCache() + helpers.ClearCache() validatorCount := params.BeaconConfig().MinGenesisActiveValidatorCount validators := make([]*ethpb.Validator, validatorCount) @@ -452,19 +453,19 @@ func TestUpdateCommitteeCache_CanUpdateAcrossEpochs(t *testing.T) { }) require.NoError(t, err) e := time.CurrentEpoch(state) - require.NoError(t, UpdateCommitteeCache(context.Background(), state, e)) + require.NoError(t, helpers.UpdateCommitteeCache(context.Background(), state, e)) - seed, err := Seed(state, e, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, e, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) - require.Equal(t, true, committeeCache.HasEntry(string(seed[:]))) + require.Equal(t, true, helpers.CommitteeCache().HasEntry(string(seed[:]))) - nextSeed, err := Seed(state, e+1, params.BeaconConfig().DomainBeaconAttester) + nextSeed, err := helpers.Seed(state, e+1, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) - require.Equal(t, false, committeeCache.HasEntry(string(nextSeed[:]))) + require.Equal(t, false, helpers.CommitteeCache().HasEntry(string(nextSeed[:]))) - require.NoError(t, UpdateCommitteeCache(context.Background(), state, e+1)) + require.NoError(t, helpers.UpdateCommitteeCache(context.Background(), state, e+1)) - require.Equal(t, true, committeeCache.HasEntry(string(nextSeed[:]))) + require.Equal(t, true, helpers.CommitteeCache().HasEntry(string(nextSeed[:]))) } func BenchmarkComputeCommittee300000_WithPreCache(b *testing.B) { @@ -481,20 +482,20 @@ func BenchmarkComputeCommittee300000_WithPreCache(b *testing.B) { require.NoError(b, err) epoch := time.CurrentEpoch(state) - indices, err := ActiveValidatorIndices(context.Background(), state, epoch) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, epoch) require.NoError(b, err) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(b, err) index := uint64(3) - _, err = computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err = helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } b.ResetTimer() for n := 0; n < b.N; n++ { - _, err := computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err := helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } @@ -515,20 +516,20 @@ func BenchmarkComputeCommittee3000000_WithPreCache(b *testing.B) { require.NoError(b, err) epoch := time.CurrentEpoch(state) - indices, err := ActiveValidatorIndices(context.Background(), state, epoch) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, epoch) require.NoError(b, err) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(b, err) index := uint64(3) - _, err = computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err = helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } b.ResetTimer() for n := 0; n < b.N; n++ { - _, err := computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err := helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } @@ -549,9 +550,9 @@ func BenchmarkComputeCommittee128000_WithOutPreCache(b *testing.B) { require.NoError(b, err) epoch := time.CurrentEpoch(state) - indices, err := ActiveValidatorIndices(context.Background(), state, epoch) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, epoch) require.NoError(b, err) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(b, err) i := uint64(0) @@ -559,7 +560,7 @@ func BenchmarkComputeCommittee128000_WithOutPreCache(b *testing.B) { b.ResetTimer() for n := 0; n < b.N; n++ { i++ - _, err := computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err := helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } @@ -584,9 +585,9 @@ func BenchmarkComputeCommittee1000000_WithOutCache(b *testing.B) { require.NoError(b, err) epoch := time.CurrentEpoch(state) - indices, err := ActiveValidatorIndices(context.Background(), state, epoch) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, epoch) require.NoError(b, err) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(b, err) i := uint64(0) @@ -594,7 +595,7 @@ func BenchmarkComputeCommittee1000000_WithOutCache(b *testing.B) { b.ResetTimer() for n := 0; n < b.N; n++ { i++ - _, err := computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err := helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } @@ -619,9 +620,9 @@ func BenchmarkComputeCommittee4000000_WithOutCache(b *testing.B) { require.NoError(b, err) epoch := time.CurrentEpoch(state) - indices, err := ActiveValidatorIndices(context.Background(), state, epoch) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, epoch) require.NoError(b, err) - seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) require.NoError(b, err) i := uint64(0) @@ -629,7 +630,7 @@ func BenchmarkComputeCommittee4000000_WithOutCache(b *testing.B) { b.ResetTimer() for n := 0; n < b.N; n++ { i++ - _, err := computeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) + _, err := helpers.ComputeCommittee(indices, seed, index, params.BeaconConfig().MaxCommitteesPerSlot) if err != nil { panic(err) } @@ -655,13 +656,13 @@ func TestBeaconCommitteeFromState_UpdateCacheForPreviousEpoch(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, err = BeaconCommitteeFromState(context.Background(), state, 1 /* previous epoch */, 0) + _, err = helpers.BeaconCommitteeFromState(context.Background(), state, 1 /* previous epoch */, 0) require.NoError(t, err) // Verify previous epoch is cached - seed, err := Seed(state, 0, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(state, 0, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) - activeIndices, err := committeeCache.ActiveIndices(context.Background(), seed) + activeIndices, err := helpers.CommitteeCache().ActiveIndices(context.Background(), seed) require.NoError(t, err) assert.NotNil(t, activeIndices, "Did not cache active indices") } @@ -680,19 +681,19 @@ func TestPrecomputeProposerIndices_Ok(t *testing.T) { }) require.NoError(t, err) - indices, err := ActiveValidatorIndices(context.Background(), state, 0) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, 0) require.NoError(t, err) - proposerIndices, err := precomputeProposerIndices(state, indices, time.CurrentEpoch(state)) + proposerIndices, err := helpers.PrecomputeProposerIndices(state, indices, time.CurrentEpoch(state)) require.NoError(t, err) var wantedProposerIndices []primitives.ValidatorIndex - seed, err := Seed(state, 0, params.BeaconConfig().DomainBeaconProposer) + seed, err := helpers.Seed(state, 0, params.BeaconConfig().DomainBeaconProposer) require.NoError(t, err) for i := uint64(0); i < uint64(params.BeaconConfig().SlotsPerEpoch); i++ { seedWithSlot := append(seed[:], bytesutil.Bytes8(i)...) seedWithSlotHash := hash.Hash(seedWithSlot) - index, err := ComputeProposerIndex(state, indices, seedWithSlotHash) + index, err := helpers.ComputeProposerIndex(state, indices, seedWithSlotHash) require.NoError(t, err) wantedProposerIndices = append(wantedProposerIndices, index) } diff --git a/beacon-chain/core/helpers/private_access_fuzz_noop_test.go b/beacon-chain/core/helpers/private_access_fuzz_noop_test.go new file mode 100644 index 000000000000..c17f1e6c93c5 --- /dev/null +++ b/beacon-chain/core/helpers/private_access_fuzz_noop_test.go @@ -0,0 +1,17 @@ +//go:build fuzz + +package helpers + +import "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + +func CommitteeCache() *cache.FakeCommitteeCache { + return committeeCache +} + +func SyncCommitteeCache() *cache.FakeSyncCommitteeCache { + return syncCommitteeCache +} + +func ProposerIndicesCache() *cache.FakeProposerIndicesCache { + return proposerIndicesCache +} diff --git a/beacon-chain/core/helpers/private_access_test.go b/beacon-chain/core/helpers/private_access_test.go new file mode 100644 index 000000000000..1a3a984d0e09 --- /dev/null +++ b/beacon-chain/core/helpers/private_access_test.go @@ -0,0 +1,17 @@ +//go:build !fuzz + +package helpers + +import "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + +func CommitteeCache() *cache.CommitteeCache { + return committeeCache +} + +func SyncCommitteeCache() *cache.SyncCommitteeCache { + return syncCommitteeCache +} + +func ProposerIndicesCache() *cache.ProposerIndicesCache { + return proposerIndicesCache +} diff --git a/beacon-chain/core/helpers/randao_test.go b/beacon-chain/core/helpers/randao_test.go index 2246d7abb09d..551331fdc05a 100644 --- a/beacon-chain/core/helpers/randao_test.go +++ b/beacon-chain/core/helpers/randao_test.go @@ -1,9 +1,10 @@ -package helpers +package helpers_test import ( "encoding/binary" "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -40,10 +41,10 @@ func TestRandaoMix_OK(t *testing.T) { }, } for _, test := range tests { - ClearCache() + helpers.ClearCache() require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(test.epoch+1)))) - mix, err := RandaoMix(state, test.epoch) + mix, err := helpers.RandaoMix(state, test.epoch) require.NoError(t, err) assert.DeepEqual(t, test.randaoMix, mix, "Incorrect randao mix") } @@ -76,10 +77,10 @@ func TestRandaoMix_CopyOK(t *testing.T) { }, } for _, test := range tests { - ClearCache() + helpers.ClearCache() require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(test.epoch+1)))) - mix, err := RandaoMix(state, test.epoch) + mix, err := helpers.RandaoMix(state, test.epoch) require.NoError(t, err) uniqueNumber := uint64(params.BeaconConfig().EpochsPerHistoricalVector.Add(1000)) binary.LittleEndian.PutUint64(mix, uniqueNumber) @@ -92,7 +93,7 @@ func TestRandaoMix_CopyOK(t *testing.T) { } func TestGenerateSeed_OK(t *testing.T) { - ClearCache() + helpers.ClearCache() randaoMixes := make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector) for i := 0; i < len(randaoMixes); i++ { @@ -107,7 +108,7 @@ func TestGenerateSeed_OK(t *testing.T) { }) require.NoError(t, err) - got, err := Seed(state, 10, params.BeaconConfig().DomainBeaconAttester) + got, err := helpers.Seed(state, 10, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) wanted := [32]byte{102, 82, 23, 40, 226, 79, 171, 11, 203, 23, 175, 7, 88, 202, 80, diff --git a/beacon-chain/core/helpers/rewards_penalties_test.go b/beacon-chain/core/helpers/rewards_penalties_test.go index 4aeeeb739498..e9cd2807ea1f 100644 --- a/beacon-chain/core/helpers/rewards_penalties_test.go +++ b/beacon-chain/core/helpers/rewards_penalties_test.go @@ -1,9 +1,10 @@ -package helpers +package helpers_test import ( "math" "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -14,7 +15,7 @@ import ( ) func TestTotalBalance_OK(t *testing.T) { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{Validators: []*ethpb.Validator{ {EffectiveBalance: 27 * 1e9}, {EffectiveBalance: 28 * 1e9}, @@ -22,19 +23,19 @@ func TestTotalBalance_OK(t *testing.T) { }}) require.NoError(t, err) - balance := TotalBalance(state, []primitives.ValidatorIndex{0, 1, 2, 3}) + balance := helpers.TotalBalance(state, []primitives.ValidatorIndex{0, 1, 2, 3}) wanted := state.Validators()[0].EffectiveBalance + state.Validators()[1].EffectiveBalance + state.Validators()[2].EffectiveBalance + state.Validators()[3].EffectiveBalance assert.Equal(t, wanted, balance, "Incorrect TotalBalance") } func TestTotalBalance_ReturnsEffectiveBalanceIncrement(t *testing.T) { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{Validators: []*ethpb.Validator{}}) require.NoError(t, err) - balance := TotalBalance(state, []primitives.ValidatorIndex{}) + balance := helpers.TotalBalance(state, []primitives.ValidatorIndex{}) wanted := params.BeaconConfig().EffectiveBalanceIncrement assert.Equal(t, wanted, balance, "Incorrect TotalBalance") } @@ -51,7 +52,7 @@ func TestGetBalance_OK(t *testing.T) { {i: 2, b: []uint64{0, 0, 0}}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{Balances: test.b}) require.NoError(t, err) @@ -68,7 +69,7 @@ func TestTotalActiveBalance(t *testing.T) { {10000}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, 0) for i := 0; i < test.vCount; i++ { @@ -76,7 +77,7 @@ func TestTotalActiveBalance(t *testing.T) { } state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{Validators: validators}) require.NoError(t, err) - bal, err := TotalActiveBalance(state) + bal, err := helpers.TotalActiveBalance(state) require.NoError(t, err) require.Equal(t, uint64(test.vCount)*params.BeaconConfig().MaxEffectiveBalance, bal) } @@ -91,7 +92,7 @@ func TestTotalActiveBal_ReturnMin(t *testing.T) { {10000}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, 0) for i := 0; i < test.vCount; i++ { @@ -99,7 +100,7 @@ func TestTotalActiveBal_ReturnMin(t *testing.T) { } state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{Validators: validators}) require.NoError(t, err) - bal, err := TotalActiveBalance(state) + bal, err := helpers.TotalActiveBalance(state) require.NoError(t, err) require.Equal(t, params.BeaconConfig().EffectiveBalanceIncrement, bal) } @@ -115,7 +116,7 @@ func TestTotalActiveBalance_WithCache(t *testing.T) { {vCount: 10000, wantCount: 10000}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, 0) for i := 0; i < test.vCount; i++ { @@ -123,7 +124,7 @@ func TestTotalActiveBalance_WithCache(t *testing.T) { } state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{Validators: validators}) require.NoError(t, err) - bal, err := TotalActiveBalance(state) + bal, err := helpers.TotalActiveBalance(state) require.NoError(t, err) require.Equal(t, uint64(test.wantCount)*params.BeaconConfig().MaxEffectiveBalance, bal) } @@ -141,7 +142,7 @@ func TestIncreaseBalance_OK(t *testing.T) { {i: 2, b: []uint64{27 * 1e9, 28 * 1e9, 32 * 1e9}, nb: 33 * 1e9, eb: 65 * 1e9}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Validators: []*ethpb.Validator{ @@ -149,7 +150,7 @@ func TestIncreaseBalance_OK(t *testing.T) { Balances: test.b, }) require.NoError(t, err) - require.NoError(t, IncreaseBalance(state, test.i, test.nb)) + require.NoError(t, helpers.IncreaseBalance(state, test.i, test.nb)) assert.Equal(t, test.eb, state.Balances()[test.i], "Incorrect Validator balance") } } @@ -167,7 +168,7 @@ func TestDecreaseBalance_OK(t *testing.T) { {i: 3, b: []uint64{27 * 1e9, 28 * 1e9, 1, 28 * 1e9}, nb: 28 * 1e9, eb: 0}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Validators: []*ethpb.Validator{ @@ -175,13 +176,13 @@ func TestDecreaseBalance_OK(t *testing.T) { Balances: test.b, }) require.NoError(t, err) - require.NoError(t, DecreaseBalance(state, test.i, test.nb)) + require.NoError(t, helpers.DecreaseBalance(state, test.i, test.nb)) assert.Equal(t, test.eb, state.Balances()[test.i], "Incorrect Validator balance") } } func TestFinalityDelay(t *testing.T) { - ClearCache() + helpers.ClearCache() base := buildState(params.BeaconConfig().SlotsPerEpoch*10, 1) base.FinalizedCheckpoint = ðpb.Checkpoint{Epoch: 3} @@ -195,25 +196,25 @@ func TestFinalityDelay(t *testing.T) { finalizedEpoch = beaconState.FinalizedCheckpointEpoch() } setVal() - d := FinalityDelay(prevEpoch, finalizedEpoch) + d := helpers.FinalityDelay(prevEpoch, finalizedEpoch) w := time.PrevEpoch(beaconState) - beaconState.FinalizedCheckpointEpoch() assert.Equal(t, w, d, "Did not get wanted finality delay") require.NoError(t, beaconState.SetFinalizedCheckpoint(ðpb.Checkpoint{Epoch: 4})) setVal() - d = FinalityDelay(prevEpoch, finalizedEpoch) + d = helpers.FinalityDelay(prevEpoch, finalizedEpoch) w = time.PrevEpoch(beaconState) - beaconState.FinalizedCheckpointEpoch() assert.Equal(t, w, d, "Did not get wanted finality delay") require.NoError(t, beaconState.SetFinalizedCheckpoint(ðpb.Checkpoint{Epoch: 5})) setVal() - d = FinalityDelay(prevEpoch, finalizedEpoch) + d = helpers.FinalityDelay(prevEpoch, finalizedEpoch) w = time.PrevEpoch(beaconState) - beaconState.FinalizedCheckpointEpoch() assert.Equal(t, w, d, "Did not get wanted finality delay") } func TestIsInInactivityLeak(t *testing.T) { - ClearCache() + helpers.ClearCache() base := buildState(params.BeaconConfig().SlotsPerEpoch*10, 1) base.FinalizedCheckpoint = ðpb.Checkpoint{Epoch: 3} @@ -227,13 +228,13 @@ func TestIsInInactivityLeak(t *testing.T) { finalizedEpoch = beaconState.FinalizedCheckpointEpoch() } setVal() - assert.Equal(t, true, IsInInactivityLeak(prevEpoch, finalizedEpoch), "Wanted inactivity leak true") + assert.Equal(t, true, helpers.IsInInactivityLeak(prevEpoch, finalizedEpoch), "Wanted inactivity leak true") require.NoError(t, beaconState.SetFinalizedCheckpoint(ðpb.Checkpoint{Epoch: 4})) setVal() - assert.Equal(t, true, IsInInactivityLeak(prevEpoch, finalizedEpoch), "Wanted inactivity leak true") + assert.Equal(t, true, helpers.IsInInactivityLeak(prevEpoch, finalizedEpoch), "Wanted inactivity leak true") require.NoError(t, beaconState.SetFinalizedCheckpoint(ðpb.Checkpoint{Epoch: 5})) setVal() - assert.Equal(t, false, IsInInactivityLeak(prevEpoch, finalizedEpoch), "Wanted inactivity leak false") + assert.Equal(t, false, helpers.IsInInactivityLeak(prevEpoch, finalizedEpoch), "Wanted inactivity leak false") } func buildState(slot primitives.Slot, validatorCount uint64) *ethpb.BeaconState { @@ -285,7 +286,7 @@ func TestIncreaseBadBalance_NotOK(t *testing.T) { {i: 2, b: []uint64{math.MaxUint64, math.MaxUint64, math.MaxUint64}, nb: 33 * 1e9}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Validators: []*ethpb.Validator{ @@ -293,6 +294,6 @@ func TestIncreaseBadBalance_NotOK(t *testing.T) { Balances: test.b, }) require.NoError(t, err) - require.ErrorContains(t, "addition overflows", IncreaseBalance(state, test.i, test.nb)) + require.ErrorContains(t, "addition overflows", helpers.IncreaseBalance(state, test.i, test.nb)) } } diff --git a/beacon-chain/core/helpers/sync_committee.go b/beacon-chain/core/helpers/sync_committee.go index 87e5a82af0b7..8c930945828d 100644 --- a/beacon-chain/core/helpers/sync_committee.go +++ b/beacon-chain/core/helpers/sync_committee.go @@ -26,7 +26,7 @@ var ( // 1. Checks if the public key exists in the sync committee cache // 2. If 1 fails, checks if the public key exists in the input current sync committee object func IsCurrentPeriodSyncCommittee(st state.BeaconState, valIdx primitives.ValidatorIndex) (bool, error) { - root, err := syncPeriodBoundaryRoot(st) + root, err := SyncPeriodBoundaryRoot(st) if err != nil { return false, err } @@ -63,7 +63,7 @@ func IsCurrentPeriodSyncCommittee(st state.BeaconState, valIdx primitives.Valida func IsNextPeriodSyncCommittee( st state.BeaconState, valIdx primitives.ValidatorIndex, ) (bool, error) { - root, err := syncPeriodBoundaryRoot(st) + root, err := SyncPeriodBoundaryRoot(st) if err != nil { return false, err } @@ -90,7 +90,7 @@ func IsNextPeriodSyncCommittee( func CurrentPeriodSyncSubcommitteeIndices( st state.BeaconState, valIdx primitives.ValidatorIndex, ) ([]primitives.CommitteeIndex, error) { - root, err := syncPeriodBoundaryRoot(st) + root, err := SyncPeriodBoundaryRoot(st) if err != nil { return nil, err } @@ -124,7 +124,7 @@ func CurrentPeriodSyncSubcommitteeIndices( func NextPeriodSyncSubcommitteeIndices( st state.BeaconState, valIdx primitives.ValidatorIndex, ) ([]primitives.CommitteeIndex, error) { - root, err := syncPeriodBoundaryRoot(st) + root, err := SyncPeriodBoundaryRoot(st) if err != nil { return nil, err } @@ -182,10 +182,10 @@ func findSubCommitteeIndices(pubKey []byte, pubKeys [][]byte) []primitives.Commi return indices } -// Retrieve the current sync period boundary root by calculating sync period start epoch +// SyncPeriodBoundaryRoot computes the current sync period boundary root by calculating sync period start epoch // and calling `BlockRoot`. // It uses the boundary slot - 1 for block root. (Ex: SlotsPerEpoch * EpochsPerSyncCommitteePeriod - 1) -func syncPeriodBoundaryRoot(st state.ReadOnlyBeaconState) ([32]byte, error) { +func SyncPeriodBoundaryRoot(st state.ReadOnlyBeaconState) ([32]byte, error) { // Can't call `BlockRoot` until the first slot. if st.Slot() == params.BeaconConfig().GenesisSlot { return params.BeaconConfig().ZeroHash, nil diff --git a/beacon-chain/core/helpers/sync_committee_test.go b/beacon-chain/core/helpers/sync_committee_test.go index f321e57862d0..60612947726d 100644 --- a/beacon-chain/core/helpers/sync_committee_test.go +++ b/beacon-chain/core/helpers/sync_committee_test.go @@ -1,4 +1,4 @@ -package helpers +package helpers_test import ( "math/rand" @@ -7,6 +7,7 @@ import ( "time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -17,7 +18,7 @@ import ( ) func TestIsCurrentEpochSyncCommittee_UsingCache(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -40,15 +41,15 @@ func TestIsCurrentEpochSyncCommittee_UsingCache(t *testing.T) { require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) r := [32]byte{'a'} - require.NoError(t, err, syncCommitteeCache.UpdatePositionsInCommittee(r, state)) + require.NoError(t, err, helpers.SyncCommitteeCache().UpdatePositionsInCommittee(r, state)) - ok, err := IsCurrentPeriodSyncCommittee(state, 0) + ok, err := helpers.IsCurrentPeriodSyncCommittee(state, 0) require.NoError(t, err) require.Equal(t, true, ok) } func TestIsCurrentEpochSyncCommittee_UsingCommittee(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -70,13 +71,13 @@ func TestIsCurrentEpochSyncCommittee_UsingCommittee(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - ok, err := IsCurrentPeriodSyncCommittee(state, 0) + ok, err := helpers.IsCurrentPeriodSyncCommittee(state, 0) require.NoError(t, err) require.Equal(t, true, ok) } func TestIsCurrentEpochSyncCommittee_DoesNotExist(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -98,13 +99,13 @@ func TestIsCurrentEpochSyncCommittee_DoesNotExist(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - ok, err := IsCurrentPeriodSyncCommittee(state, 12390192) + ok, err := helpers.IsCurrentPeriodSyncCommittee(state, 12390192) require.ErrorContains(t, "validator index 12390192 does not exist", err) require.Equal(t, false, ok) } func TestIsNextEpochSyncCommittee_UsingCache(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -127,15 +128,15 @@ func TestIsNextEpochSyncCommittee_UsingCache(t *testing.T) { require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) r := [32]byte{'a'} - require.NoError(t, err, syncCommitteeCache.UpdatePositionsInCommittee(r, state)) + require.NoError(t, err, helpers.SyncCommitteeCache().UpdatePositionsInCommittee(r, state)) - ok, err := IsNextPeriodSyncCommittee(state, 0) + ok, err := helpers.IsNextPeriodSyncCommittee(state, 0) require.NoError(t, err) require.Equal(t, true, ok) } func TestIsNextEpochSyncCommittee_UsingCommittee(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -157,13 +158,13 @@ func TestIsNextEpochSyncCommittee_UsingCommittee(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - ok, err := IsNextPeriodSyncCommittee(state, 0) + ok, err := helpers.IsNextPeriodSyncCommittee(state, 0) require.NoError(t, err) require.Equal(t, true, ok) } func TestIsNextEpochSyncCommittee_DoesNotExist(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -185,13 +186,13 @@ func TestIsNextEpochSyncCommittee_DoesNotExist(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - ok, err := IsNextPeriodSyncCommittee(state, 120391029) + ok, err := helpers.IsNextPeriodSyncCommittee(state, 120391029) require.ErrorContains(t, "validator index 120391029 does not exist", err) require.Equal(t, false, ok) } func TestCurrentEpochSyncSubcommitteeIndices_UsingCache(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -214,15 +215,15 @@ func TestCurrentEpochSyncSubcommitteeIndices_UsingCache(t *testing.T) { require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) r := [32]byte{'a'} - require.NoError(t, err, syncCommitteeCache.UpdatePositionsInCommittee(r, state)) + require.NoError(t, err, helpers.SyncCommitteeCache().UpdatePositionsInCommittee(r, state)) - index, err := CurrentPeriodSyncSubcommitteeIndices(state, 0) + index, err := helpers.CurrentPeriodSyncSubcommitteeIndices(state, 0) require.NoError(t, err) require.DeepEqual(t, []primitives.CommitteeIndex{0}, index) } func TestCurrentEpochSyncSubcommitteeIndices_UsingCommittee(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -243,27 +244,27 @@ func TestCurrentEpochSyncSubcommitteeIndices_UsingCommittee(t *testing.T) { require.NoError(t, err) require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - root, err := syncPeriodBoundaryRoot(state) + root, err := helpers.SyncPeriodBoundaryRoot(state) require.NoError(t, err) // Test that cache was empty. - _, err = syncCommitteeCache.CurrentPeriodIndexPosition(root, 0) + _, err = helpers.SyncCommitteeCache().CurrentPeriodIndexPosition(root, 0) require.Equal(t, cache.ErrNonExistingSyncCommitteeKey, err) // Test that helper can retrieve the index given empty cache. - index, err := CurrentPeriodSyncSubcommitteeIndices(state, 0) + index, err := helpers.CurrentPeriodSyncSubcommitteeIndices(state, 0) require.NoError(t, err) require.DeepEqual(t, []primitives.CommitteeIndex{0}, index) // Test that cache was able to fill on miss. time.Sleep(100 * time.Millisecond) - index, err = syncCommitteeCache.CurrentPeriodIndexPosition(root, 0) + index, err = helpers.SyncCommitteeCache().CurrentPeriodIndexPosition(root, 0) require.NoError(t, err) require.DeepEqual(t, []primitives.CommitteeIndex{0}, index) } func TestCurrentEpochSyncSubcommitteeIndices_DoesNotExist(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -285,13 +286,13 @@ func TestCurrentEpochSyncSubcommitteeIndices_DoesNotExist(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - index, err := CurrentPeriodSyncSubcommitteeIndices(state, 129301923) + index, err := helpers.CurrentPeriodSyncSubcommitteeIndices(state, 129301923) require.ErrorContains(t, "validator index 129301923 does not exist", err) require.DeepEqual(t, []primitives.CommitteeIndex(nil), index) } func TestNextEpochSyncSubcommitteeIndices_UsingCache(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -314,15 +315,15 @@ func TestNextEpochSyncSubcommitteeIndices_UsingCache(t *testing.T) { require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) r := [32]byte{'a'} - require.NoError(t, err, syncCommitteeCache.UpdatePositionsInCommittee(r, state)) + require.NoError(t, err, helpers.SyncCommitteeCache().UpdatePositionsInCommittee(r, state)) - index, err := NextPeriodSyncSubcommitteeIndices(state, 0) + index, err := helpers.NextPeriodSyncSubcommitteeIndices(state, 0) require.NoError(t, err) require.DeepEqual(t, []primitives.CommitteeIndex{0}, index) } func TestNextEpochSyncSubcommitteeIndices_UsingCommittee(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -344,13 +345,13 @@ func TestNextEpochSyncSubcommitteeIndices_UsingCommittee(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - index, err := NextPeriodSyncSubcommitteeIndices(state, 0) + index, err := helpers.NextPeriodSyncSubcommitteeIndices(state, 0) require.NoError(t, err) require.DeepEqual(t, []primitives.CommitteeIndex{0}, index) } func TestNextEpochSyncSubcommitteeIndices_DoesNotExist(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -372,43 +373,43 @@ func TestNextEpochSyncSubcommitteeIndices_DoesNotExist(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - index, err := NextPeriodSyncSubcommitteeIndices(state, 21093019) + index, err := helpers.NextPeriodSyncSubcommitteeIndices(state, 21093019) require.ErrorContains(t, "validator index 21093019 does not exist", err) require.DeepEqual(t, []primitives.CommitteeIndex(nil), index) } func TestUpdateSyncCommitteeCache_BadSlot(t *testing.T) { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Slot: 1, }) require.NoError(t, err) - err = UpdateSyncCommitteeCache(state) + err = helpers.UpdateSyncCommitteeCache(state) require.ErrorContains(t, "not at the end of the epoch to update cache", err) state, err = state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Slot: params.BeaconConfig().SlotsPerEpoch - 1, }) require.NoError(t, err) - err = UpdateSyncCommitteeCache(state) + err = helpers.UpdateSyncCommitteeCache(state) require.ErrorContains(t, "not at sync committee period boundary to update cache", err) } func TestUpdateSyncCommitteeCache_BadRoot(t *testing.T) { - ClearCache() + helpers.ClearCache() state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Slot: primitives.Slot(params.BeaconConfig().EpochsPerSyncCommitteePeriod)*params.BeaconConfig().SlotsPerEpoch - 1, LatestBlockHeader: ðpb.BeaconBlockHeader{StateRoot: params.BeaconConfig().ZeroHash[:]}, }) require.NoError(t, err) - err = UpdateSyncCommitteeCache(state) + err = helpers.UpdateSyncCommitteeCache(state) require.ErrorContains(t, "zero hash state root can't be used to update cache", err) } func TestIsCurrentEpochSyncCommittee_SameBlockRoot(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().SyncCommitteeSize) syncCommittee := ðpb.SyncCommittee{ @@ -435,7 +436,7 @@ func TestIsCurrentEpochSyncCommittee_SameBlockRoot(t *testing.T) { require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) require.NoError(t, state.SetNextSyncCommittee(syncCommittee)) - comIdxs, err := CurrentPeriodSyncSubcommitteeIndices(state, 200) + comIdxs, err := helpers.CurrentPeriodSyncSubcommitteeIndices(state, 200) require.NoError(t, err) wantedSlot := params.BeaconConfig().EpochsPerSyncCommitteePeriod.Mul(uint64(params.BeaconConfig().SlotsPerEpoch)) @@ -446,7 +447,7 @@ func TestIsCurrentEpochSyncCommittee_SameBlockRoot(t *testing.T) { syncCommittee.Pubkeys[i], syncCommittee.Pubkeys[j] = syncCommittee.Pubkeys[j], syncCommittee.Pubkeys[i] }) require.NoError(t, state.SetCurrentSyncCommittee(syncCommittee)) - newIdxs, err := CurrentPeriodSyncSubcommitteeIndices(state, 200) + newIdxs, err := helpers.CurrentPeriodSyncSubcommitteeIndices(state, 200) require.NoError(t, err) require.DeepNotEqual(t, comIdxs, newIdxs) } diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index 54a13ffbaf0e..0471e1740d64 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -1,4 +1,4 @@ -package helpers +package helpers_test import ( "context" @@ -6,6 +6,7 @@ import ( "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -32,7 +33,7 @@ func TestIsActiveValidator_OK(t *testing.T) { } for _, test := range tests { validator := ðpb.Validator{ActivationEpoch: 10, ExitEpoch: 100} - assert.Equal(t, test.b, IsActiveValidator(validator, test.a), "IsActiveValidator(%d)", test.a) + assert.Equal(t, test.b, helpers.IsActiveValidator(validator, test.a), "IsActiveValidator(%d)", test.a) } } @@ -53,7 +54,7 @@ func TestIsActiveValidatorUsingTrie_OK(t *testing.T) { for _, test := range tests { readOnlyVal, err := beaconState.ValidatorAtIndexReadOnly(0) require.NoError(t, err) - assert.Equal(t, test.b, IsActiveValidatorUsingTrie(readOnlyVal, test.a), "IsActiveValidatorUsingTrie(%d)", test.a) + assert.Equal(t, test.b, helpers.IsActiveValidatorUsingTrie(readOnlyVal, test.a), "IsActiveValidatorUsingTrie(%d)", test.a) } } @@ -81,7 +82,7 @@ func TestIsActiveNonSlashedValidatorUsingTrie_OK(t *testing.T) { require.NoError(t, err) readOnlyVal, err := beaconState.ValidatorAtIndexReadOnly(0) require.NoError(t, err) - assert.Equal(t, test.b, IsActiveNonSlashedValidatorUsingTrie(readOnlyVal, test.a), "IsActiveNonSlashedValidatorUsingTrie(%d)", test.a) + assert.Equal(t, test.b, helpers.IsActiveNonSlashedValidatorUsingTrie(readOnlyVal, test.a), "IsActiveNonSlashedValidatorUsingTrie(%d)", test.a) } } @@ -161,7 +162,7 @@ func TestIsSlashableValidator_OK(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { t.Run("without trie", func(t *testing.T) { - slashableValidator := IsSlashableValidator(test.validator.ActivationEpoch, + slashableValidator := helpers.IsSlashableValidator(test.validator.ActivationEpoch, test.validator.WithdrawableEpoch, test.validator.Slashed, test.epoch) assert.Equal(t, test.slashable, slashableValidator, "Expected active validator slashable to be %t", test.slashable) }) @@ -170,7 +171,7 @@ func TestIsSlashableValidator_OK(t *testing.T) { require.NoError(t, err) readOnlyVal, err := beaconState.ValidatorAtIndexReadOnly(0) require.NoError(t, err) - slashableValidator := IsSlashableValidatorUsingTrie(readOnlyVal, test.epoch) + slashableValidator := helpers.IsSlashableValidatorUsingTrie(readOnlyVal, test.epoch) assert.Equal(t, test.slashable, slashableValidator, "Expected active validator slashable to be %t", test.slashable) }) }) @@ -223,17 +224,17 @@ func TestBeaconProposerIndex_OK(t *testing.T) { } for _, tt := range tests { - ClearCache() + helpers.ClearCache() require.NoError(t, state.SetSlot(tt.slot)) - result, err := BeaconProposerIndex(context.Background(), state) + result, err := helpers.BeaconProposerIndex(context.Background(), state) require.NoError(t, err, "Failed to get shard and committees at slot") assert.Equal(t, tt.index, result, "Result index was an unexpected value") } } func TestBeaconProposerIndex_BadState(t *testing.T) { - ClearCache() + helpers.ClearCache() params.SetupTestConfigCleanup(t) c := params.BeaconConfig() @@ -261,12 +262,12 @@ func TestBeaconProposerIndex_BadState(t *testing.T) { // Set a very high slot, so that retrieved block root will be // non existent for the proposer cache. require.NoError(t, state.SetSlot(100)) - _, err = BeaconProposerIndex(context.Background(), state) + _, err = helpers.BeaconProposerIndex(context.Background(), state) require.NoError(t, err) } func TestComputeProposerIndex_Compatibility(t *testing.T) { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, params.BeaconConfig().MinGenesisActiveValidatorCount) for i := 0; i < len(validators); i++ { @@ -281,22 +282,22 @@ func TestComputeProposerIndex_Compatibility(t *testing.T) { }) require.NoError(t, err) - indices, err := ActiveValidatorIndices(context.Background(), state, 0) + indices, err := helpers.ActiveValidatorIndices(context.Background(), state, 0) require.NoError(t, err) var proposerIndices []primitives.ValidatorIndex - seed, err := Seed(state, 0, params.BeaconConfig().DomainBeaconProposer) + seed, err := helpers.Seed(state, 0, params.BeaconConfig().DomainBeaconProposer) require.NoError(t, err) for i := uint64(0); i < uint64(params.BeaconConfig().SlotsPerEpoch); i++ { seedWithSlot := append(seed[:], bytesutil.Bytes8(i)...) seedWithSlotHash := hash.Hash(seedWithSlot) - index, err := ComputeProposerIndex(state, indices, seedWithSlotHash) + index, err := helpers.ComputeProposerIndex(state, indices, seedWithSlotHash) require.NoError(t, err) proposerIndices = append(proposerIndices, index) } var wantedProposerIndices []primitives.ValidatorIndex - seed, err = Seed(state, 0, params.BeaconConfig().DomainBeaconProposer) + seed, err = helpers.Seed(state, 0, params.BeaconConfig().DomainBeaconProposer) require.NoError(t, err) for i := uint64(0); i < uint64(params.BeaconConfig().SlotsPerEpoch); i++ { seedWithSlot := append(seed[:], bytesutil.Bytes8(i)...) @@ -309,15 +310,15 @@ func TestComputeProposerIndex_Compatibility(t *testing.T) { } func TestDelayedActivationExitEpoch_OK(t *testing.T) { - ClearCache() + helpers.ClearCache() epoch := primitives.Epoch(9999) wanted := epoch + 1 + params.BeaconConfig().MaxSeedLookahead - assert.Equal(t, wanted, ActivationExitEpoch(epoch)) + assert.Equal(t, wanted, helpers.ActivationExitEpoch(epoch)) } func TestActiveValidatorCount_Genesis(t *testing.T) { - ClearCache() + helpers.ClearCache() c := 1000 validators := make([]*ethpb.Validator, c) @@ -334,10 +335,10 @@ func TestActiveValidatorCount_Genesis(t *testing.T) { require.NoError(t, err) // Preset cache to a bad count. - seed, err := Seed(beaconState, 0, params.BeaconConfig().DomainBeaconAttester) + seed, err := helpers.Seed(beaconState, 0, params.BeaconConfig().DomainBeaconAttester) require.NoError(t, err) - require.NoError(t, committeeCache.AddCommitteeShuffledList(context.Background(), &cache.Committees{Seed: seed, ShuffledIndices: []primitives.ValidatorIndex{1, 2, 3}})) - validatorCount, err := ActiveValidatorCount(context.Background(), beaconState, time.CurrentEpoch(beaconState)) + require.NoError(t, helpers.CommitteeCache().AddCommitteeShuffledList(context.Background(), &cache.Committees{Seed: seed, ShuffledIndices: []primitives.ValidatorIndex{1, 2, 3}})) + validatorCount, err := helpers.ActiveValidatorCount(context.Background(), beaconState, time.CurrentEpoch(beaconState)) require.NoError(t, err) assert.Equal(t, uint64(c), validatorCount, "Did not get the correct validator count") } @@ -353,7 +354,7 @@ func TestChurnLimit_OK(t *testing.T) { {validatorCount: 2000000, wantedChurn: 30 /* validatorCount/churnLimitQuotient */}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() validators := make([]*ethpb.Validator, test.validatorCount) for i := 0; i < len(validators); i++ { @@ -368,9 +369,9 @@ func TestChurnLimit_OK(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - validatorCount, err := ActiveValidatorCount(context.Background(), beaconState, time.CurrentEpoch(beaconState)) + validatorCount, err := helpers.ActiveValidatorCount(context.Background(), beaconState, time.CurrentEpoch(beaconState)) require.NoError(t, err) - resultChurn := ValidatorActivationChurnLimit(validatorCount) + resultChurn := helpers.ValidatorActivationChurnLimit(validatorCount) assert.Equal(t, test.wantedChurn, resultChurn, "ValidatorActivationChurnLimit(%d)", test.validatorCount) } } @@ -386,7 +387,7 @@ func TestChurnLimitDeneb_OK(t *testing.T) { {2000000, params.BeaconConfig().MaxPerEpochActivationChurnLimit}, } for _, test := range tests { - ClearCache() + helpers.ClearCache() // Create validators validators := make([]*ethpb.Validator, test.validatorCount) @@ -405,11 +406,11 @@ func TestChurnLimitDeneb_OK(t *testing.T) { require.NoError(t, err) // Get active validator count - validatorCount, err := ActiveValidatorCount(context.Background(), beaconState, time.CurrentEpoch(beaconState)) + validatorCount, err := helpers.ActiveValidatorCount(context.Background(), beaconState, time.CurrentEpoch(beaconState)) require.NoError(t, err) // Test churn limit calculation - resultChurn := ValidatorActivationChurnLimitDeneb(validatorCount) + resultChurn := helpers.ValidatorActivationChurnLimitDeneb(validatorCount) assert.Equal(t, test.wantedChurn, resultChurn) } } @@ -574,11 +575,11 @@ func TestActiveValidatorIndices(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ClearCache() + helpers.ClearCache() s, err := state_native.InitializeFromProtoPhase0(tt.args.state) require.NoError(t, err) - got, err := ActiveValidatorIndices(context.Background(), s, tt.args.epoch) + got, err := helpers.ActiveValidatorIndices(context.Background(), s, tt.args.epoch) if tt.wantedErr != "" { assert.ErrorContains(t, tt.wantedErr, err) return @@ -684,12 +685,12 @@ func TestComputeProposerIndex(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ClearCache() + helpers.ClearCache() bState := ðpb.BeaconState{Validators: tt.args.validators} stTrie, err := state_native.InitializeFromProtoUnsafePhase0(bState) require.NoError(t, err) - got, err := ComputeProposerIndex(stTrie, tt.args.indices, tt.args.seed) + got, err := helpers.ComputeProposerIndex(stTrie, tt.args.indices, tt.args.seed) if tt.wantedErr != "" { assert.ErrorContains(t, tt.wantedErr, err) return @@ -718,9 +719,9 @@ func TestIsEligibleForActivationQueue(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ClearCache() + helpers.ClearCache() - assert.Equal(t, tt.want, IsEligibleForActivationQueue(tt.validator), "IsEligibleForActivationQueue()") + assert.Equal(t, tt.want, helpers.IsEligibleForActivationQueue(tt.validator), "IsEligibleForActivationQueue()") }) } } @@ -747,11 +748,11 @@ func TestIsIsEligibleForActivation(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ClearCache() + helpers.ClearCache() s, err := state_native.InitializeFromProtoPhase0(tt.state) require.NoError(t, err) - assert.Equal(t, tt.want, IsEligibleForActivation(s, tt.validator), "IsEligibleForActivation()") + assert.Equal(t, tt.want, helpers.IsEligibleForActivation(s, tt.validator), "IsEligibleForActivation()") }) } } @@ -765,7 +766,7 @@ func computeProposerIndexWithValidators(validators []*ethpb.Validator, activeInd hashFunc := hash.CustomSHA256Hasher() for i := uint64(0); ; i++ { - candidateIndex, err := ComputeShuffledIndex(primitives.ValidatorIndex(i%length), length, seed, true /* shuffle */) + candidateIndex, err := helpers.ComputeShuffledIndex(primitives.ValidatorIndex(i%length), length, seed, true /* shuffle */) if err != nil { return 0, err } @@ -787,7 +788,7 @@ func computeProposerIndexWithValidators(validators []*ethpb.Validator, activeInd } func TestLastActivatedValidatorIndex_OK(t *testing.T) { - ClearCache() + helpers.ClearCache() beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{}) require.NoError(t, err) @@ -806,13 +807,13 @@ func TestLastActivatedValidatorIndex_OK(t *testing.T) { require.NoError(t, beaconState.SetValidators(validators)) require.NoError(t, beaconState.SetBalances(balances)) - index, err := LastActivatedValidatorIndex(context.Background(), beaconState) + index, err := helpers.LastActivatedValidatorIndex(context.Background(), beaconState) require.NoError(t, err) require.Equal(t, index, primitives.ValidatorIndex(3)) } func TestProposerIndexFromCheckpoint(t *testing.T) { - ClearCache() + helpers.ClearCache() e := primitives.Epoch(2) r := [32]byte{'a'} @@ -820,10 +821,10 @@ func TestProposerIndexFromCheckpoint(t *testing.T) { ids := [32]primitives.ValidatorIndex{} slot := primitives.Slot(69) // slot 5 in the Epoch ids[5] = primitives.ValidatorIndex(19) - proposerIndicesCache.Set(e, r, ids) + helpers.ProposerIndicesCache().Set(e, r, ids) c := &forkchoicetypes.Checkpoint{Root: root, Epoch: e - 1} - proposerIndicesCache.SetCheckpoint(*c, r) - id, err := ProposerIndexAtSlotFromCheckpoint(c, slot) + helpers.ProposerIndicesCache().SetCheckpoint(*c, r) + id, err := helpers.ProposerIndexAtSlotFromCheckpoint(c, slot) require.NoError(t, err) require.Equal(t, ids[5], id) } From fdbb5136d9f278a843aa05e55b2809c9fbdaac4c Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 23 Apr 2024 21:49:33 -0500 Subject: [PATCH 051/325] spectests: fail hard on missing test folders (#13913) --- testing/spectest/utils/utils.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testing/spectest/utils/utils.go b/testing/spectest/utils/utils.go index 2dc31fdc9dd9..99aad2890d65 100644 --- a/testing/spectest/utils/utils.go +++ b/testing/spectest/utils/utils.go @@ -35,9 +35,7 @@ func UnmarshalYaml(y []byte, dest interface{}) error { func TestFolders(t testing.TB, config, forkOrPhase, folderPath string) ([]os.DirEntry, string) { testsFolderPath := path.Join("tests", config, forkOrPhase, folderPath) filepath, err := bazel.Runfile(testsFolderPath) - if err != nil { - return nil, "" - } + require.NoError(t, err) testFolders, err := os.ReadDir(filepath) require.NoError(t, err) From a6f134e48ef7ad1350188ab6e0ee8d32415762b0 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Wed, 24 Apr 2024 05:56:52 +0200 Subject: [PATCH 052/325] Revert "zig: Update zig to recent main branch commit (#13142)" (#13908) This reverts commit b24b60dbd88aab0e8348c1ae6fe7af50e63f9007. --- WORKSPACE | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index f30ff747773b..a5ef0bb3039a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -29,23 +29,7 @@ http_archive( load("@hermetic_cc_toolchain//toolchain:defs.bzl", zig_toolchains = "toolchains") -# Temporarily use a nightly build until 0.12.0 is released. -# See: https://github.com/prysmaticlabs/prysm/issues/13130 -zig_toolchains( - host_platform_sha256 = { - "linux-aarch64": "45afb8e32adde825165f4f293fcea9ecea503f7f9ec0e9bf4435afe70e67fb70", - "linux-x86_64": "f136c6a8a0f6adcb057d73615fbcd6f88281b3593f7008d5f7ed514ff925c02e", - "macos-aarch64": "05d995853c05243151deff47b60bdc2674f1e794a939eaeca0f42312da031cee", - "macos-x86_64": "721754ba5a50f31e8a1f0e1a74cace26f8246576878ac4a8591b0ee7b6db1fc1", - "windows-x86_64": "93f5248b2ea8c5ee8175e15b1384e133edc1cd49870b3ea259062a2e04164343", - }, - url_formats = [ - "https://ziglang.org/builds/zig-{host_platform}-{version}.{_ext}", - "https://mirror.bazel.build/ziglang.org/builds/zig-{host_platform}-{version}.{_ext}", - "https://prysmaticlabs.com/mirror/ziglang.org/builds/zig-{host_platform}-{version}.{_ext}", - ], - version = "0.12.0-dev.1349+fa022d1ec", -) +zig_toolchains() # Register zig sdk toolchains with support for Ubuntu 20.04 (Focal Fossa) which has an EOL date of April, 2025. # For ubuntu glibc support, see https://launchpad.net/ubuntu/+source/glibc From c8d6f47749cd1898aaaafe80071b2d3a8fa47cf3 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Wed, 24 Apr 2024 15:24:51 +0200 Subject: [PATCH 053/325] Remove EnableEIP4881 flag (#13826) * Remove EnableEIP4881 flag * Gaz * Fix missing error handler * Remove old tree and fix tests * Gaz * Fix build import * Replace depositcache * Add pendingDeposit tests * Nishant's fix * Fix unsafe uint64 to int * Fix other unsafe uint64 to int * Remove: RemovePendingDeposit * Deprecate and remove DisableEIP4881 flag * Check: index not greater than deposit count * Move index check --- beacon-chain/blockchain/BUILD.bazel | 2 +- beacon-chain/blockchain/service_test.go | 4 +- beacon-chain/blockchain/setup_test.go | 6 +- beacon-chain/cache/depositcache/BUILD.bazel | 50 - .../cache/depositcache/deposits_cache.go | 327 ----- .../cache/depositcache/deposits_cache_test.go | 1074 ----------------- beacon-chain/cache/depositcache/log.go | 5 - .../cache/depositcache/pending_deposits.go | 151 --- .../cache/depositsnapshot/BUILD.bazel | 1 + .../cache/depositsnapshot/deposit_fetcher.go | 6 + .../deposit_fetcher_test.go} | 64 +- .../cache/depositsnapshot/deposit_tree.go | 16 +- beacon-chain/execution/BUILD.bazel | 3 +- beacon-chain/execution/log_processing.go | 50 +- beacon-chain/execution/log_processing_test.go | 16 +- beacon-chain/execution/service.go | 76 +- beacon-chain/execution/service_test.go | 14 +- beacon-chain/node/BUILD.bazel | 1 - beacon-chain/node/node.go | 7 +- beacon-chain/rpc/BUILD.bazel | 2 +- .../rpc/prysm/v1alpha1/validator/BUILD.bazel | 4 +- .../prysm/v1alpha1/validator/duties_test.go | 4 +- .../prysm/v1alpha1/validator/proposer_test.go | 24 +- .../rpc/prysm/v1alpha1/validator/server.go | 4 +- .../v1alpha1/validator/server_mainnet_test.go | 4 +- .../prysm/v1alpha1/validator/server_test.go | 4 +- .../v1alpha1/validator/status_mainnet_test.go | 4 +- .../prysm/v1alpha1/validator/status_test.go | 28 +- beacon-chain/rpc/service.go | 4 +- config/features/config.go | 6 - config/features/deprecated_flags.go | 6 + config/features/flags.go | 5 - .../shared/common/forkchoice/BUILD.bazel | 2 +- .../shared/common/forkchoice/service.go | 4 +- 34 files changed, 145 insertions(+), 1833 deletions(-) delete mode 100644 beacon-chain/cache/depositcache/BUILD.bazel delete mode 100644 beacon-chain/cache/depositcache/deposits_cache.go delete mode 100644 beacon-chain/cache/depositcache/deposits_cache_test.go delete mode 100644 beacon-chain/cache/depositcache/log.go delete mode 100644 beacon-chain/cache/depositcache/pending_deposits.go rename beacon-chain/cache/{depositcache/pending_deposits_test.go => depositsnapshot/deposit_fetcher_test.go} (60%) diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index 3de875446c4f..a078093903e3 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -137,7 +137,7 @@ go_test( "//async/event:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", + "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/helpers:go_default_library", diff --git a/beacon-chain/blockchain/service_test.go b/beacon-chain/blockchain/service_test.go index e2447d036183..27582f1b8ed9 100644 --- a/beacon-chain/blockchain/service_test.go +++ b/beacon-chain/blockchain/service_test.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" @@ -80,7 +80,7 @@ func setupBeaconChain(t *testing.T, beaconDB db.Database) *Service { attService, err := attestations.NewService(ctx, &attestations.Config{Pool: attestations.NewPool()}) require.NoError(t, err) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) fc := doublylinkedtree.New() diff --git a/beacon-chain/blockchain/setup_test.go b/beacon-chain/blockchain/setup_test.go index da2e4281ef60..3d3e98b3f86e 100644 --- a/beacon-chain/blockchain/setup_test.go +++ b/beacon-chain/blockchain/setup_test.go @@ -8,7 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/async/event" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" @@ -79,7 +79,7 @@ type testServiceRequirements struct { attPool attestations.Pool attSrv *attestations.Service blsPool *blstoexec.Pool - dc *depositcache.DepositCache + dc *depositsnapshot.Cache } func minimalTestService(t *testing.T, opts ...Option) (*Service, *testServiceRequirements) { @@ -94,7 +94,7 @@ func minimalTestService(t *testing.T, opts ...Option) (*Service, *testServiceReq attSrv, err := attestations.NewService(ctx, &attestations.Config{Pool: attPool}) require.NoError(t, err) blsPool := blstoexec.NewPool() - dc, err := depositcache.New() + dc, err := depositsnapshot.New() require.NoError(t, err) req := &testServiceRequirements{ ctx: ctx, diff --git a/beacon-chain/cache/depositcache/BUILD.bazel b/beacon-chain/cache/depositcache/BUILD.bazel deleted file mode 100644 index d36d70566481..000000000000 --- a/beacon-chain/cache/depositcache/BUILD.bazel +++ /dev/null @@ -1,50 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "deposits_cache.go", - "log.go", - "pending_deposits.go", - ], - importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache", - visibility = [ - "//beacon-chain:__subpackages__", - "//testing/spectest:__subpackages__", - ], - deps = [ - "//beacon-chain/cache:go_default_library", - "//config/fieldparams:go_default_library", - "//config/params:go_default_library", - "//container/trie:go_default_library", - "//crypto/hash:go_default_library", - "//encoding/bytesutil:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", - "@com_github_ethereum_go_ethereum//common:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@com_github_prometheus_client_golang//prometheus:go_default_library", - "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "deposits_cache_test.go", - "pending_deposits_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//beacon-chain/cache:go_default_library", - "//config/params:go_default_library", - "//container/trie:go_default_library", - "//encoding/bytesutil:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) diff --git a/beacon-chain/cache/depositcache/deposits_cache.go b/beacon-chain/cache/depositcache/deposits_cache.go deleted file mode 100644 index 81355110fcc7..000000000000 --- a/beacon-chain/cache/depositcache/deposits_cache.go +++ /dev/null @@ -1,327 +0,0 @@ -// Package depositcache is the source of validator deposits maintained -// in-memory by the beacon node – deposits processed from the -// eth1 powchain are then stored in this cache to be accessed by -// any other service during a beacon node's runtime. -package depositcache - -import ( - "context" - "encoding/hex" - "math/big" - "sort" - "sync" - - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/container/trie" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/sirupsen/logrus" - "go.opencensus.io/trace" -) - -var ( - historicalDepositsCount = promauto.NewCounter(prometheus.CounterOpts{ - Name: "beacondb_all_deposits", - Help: "The number of total deposits in the beaconDB in-memory database", - }) -) - -// FinalizedDeposits stores the trie of deposits that have been included -// in the beacon state up to the latest finalized checkpoint. -type FinalizedDeposits struct { - deposits *trie.SparseMerkleTrie - merkleTrieIndex int64 -} - -// DepositCache stores all in-memory deposit objects. This -// stores all the deposit related data that is required by the beacon-node. -type DepositCache struct { - // Beacon chain deposits in memory. - pendingDeposits []*ethpb.DepositContainer - deposits []*ethpb.DepositContainer - finalizedDeposits FinalizedDeposits - depositsByKey map[[fieldparams.BLSPubkeyLength]byte][]*ethpb.DepositContainer - depositsLock sync.RWMutex -} - -// New instantiates a new deposit cache -func New() (*DepositCache, error) { - finalizedDepositsTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) - if err != nil { - return nil, err - } - - // finalizedDeposits.merkleTrieIndex is initialized to -1 because it represents the index of the last trie item. - // Inserting the first item into the trie will set the value of the index to 0. - return &DepositCache{ - pendingDeposits: []*ethpb.DepositContainer{}, - deposits: []*ethpb.DepositContainer{}, - depositsByKey: map[[fieldparams.BLSPubkeyLength]byte][]*ethpb.DepositContainer{}, - finalizedDeposits: FinalizedDeposits{deposits: finalizedDepositsTrie, merkleTrieIndex: -1}, - }, nil -} - -// InsertDeposit into the database. If deposit or block number are nil -// then this method does nothing. -func (dc *DepositCache) InsertDeposit(ctx context.Context, d *ethpb.Deposit, blockNum uint64, index int64, depositRoot [32]byte) error { - _, span := trace.StartSpan(ctx, "DepositsCache.InsertDeposit") - defer span.End() - if d == nil { - log.WithFields(logrus.Fields{ - "block": blockNum, - "deposit": d, - "index": index, - "depositRoot": hex.EncodeToString(depositRoot[:]), - }).Warn("Ignoring nil deposit insertion") - return errors.New("nil deposit inserted into the cache") - } - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - - if int(index) != len(dc.deposits) { - return errors.Errorf("wanted deposit with index %d to be inserted but received %d", len(dc.deposits), index) - } - // Keep the slice sorted on insertion in order to avoid costly sorting on retrieval. - heightIdx := sort.Search(len(dc.deposits), func(i int) bool { return dc.deposits[i].Index >= index }) - depCtr := ðpb.DepositContainer{Deposit: d, Eth1BlockHeight: blockNum, DepositRoot: depositRoot[:], Index: index} - newDeposits := append( - []*ethpb.DepositContainer{depCtr}, - dc.deposits[heightIdx:]...) - dc.deposits = append(dc.deposits[:heightIdx], newDeposits...) - // Append the deposit to our map, in the event no deposits - // exist for the pubkey , it is simply added to the map. - pubkey := bytesutil.ToBytes48(d.Data.PublicKey) - dc.depositsByKey[pubkey] = append(dc.depositsByKey[pubkey], depCtr) - historicalDepositsCount.Inc() - return nil -} - -// InsertDepositContainers inserts a set of deposit containers into our deposit cache. -func (dc *DepositCache) InsertDepositContainers(ctx context.Context, ctrs []*ethpb.DepositContainer) { - _, span := trace.StartSpan(ctx, "DepositsCache.InsertDepositContainers") - defer span.End() - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - - sort.SliceStable(ctrs, func(i int, j int) bool { return ctrs[i].Index < ctrs[j].Index }) - dc.deposits = ctrs - for _, c := range ctrs { - // Use a new value, as the reference - // of c changes in the next iteration. - newPtr := c - pKey := bytesutil.ToBytes48(newPtr.Deposit.Data.PublicKey) - dc.depositsByKey[pKey] = append(dc.depositsByKey[pKey], newPtr) - } - historicalDepositsCount.Add(float64(len(ctrs))) -} - -// InsertFinalizedDeposits inserts deposits up to eth1DepositIndex (inclusive) into the finalized deposits cache. -func (dc *DepositCache) InsertFinalizedDeposits(ctx context.Context, - eth1DepositIndex int64, _ common.Hash, _ uint64) error { - _, span := trace.StartSpan(ctx, "DepositsCache.InsertFinalizedDeposits") - defer span.End() - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - - depositTrie := dc.finalizedDeposits.Deposits() - insertIndex := int(dc.finalizedDeposits.merkleTrieIndex + 1) - - // Don't insert into finalized trie if there is no deposit to - // insert. - if len(dc.deposits) == 0 { - return nil - } - // In the event we have less deposits than we need to - // finalize we finalize till the index on which we do have it. - if len(dc.deposits) <= int(eth1DepositIndex) { - eth1DepositIndex = int64(len(dc.deposits)) - 1 - } - // If we finalize to some lower deposit index, we - // ignore it. - if int(eth1DepositIndex) < insertIndex { - return nil - } - for _, d := range dc.deposits { - if d.Index <= dc.finalizedDeposits.merkleTrieIndex { - continue - } - if d.Index > eth1DepositIndex { - break - } - depHash, err := d.Deposit.Data.HashTreeRoot() - if err != nil { - return errors.Wrap(err, "could not hash deposit data") - } - if err = depositTrie.Insert(depHash[:], insertIndex); err != nil { - return errors.Wrap(err, "could not insert deposit hash") - } - insertIndex++ - } - tree, ok := depositTrie.(*trie.SparseMerkleTrie) - if !ok { - return errors.New("not a sparse merkle tree") - } - dc.finalizedDeposits = FinalizedDeposits{ - deposits: tree, - merkleTrieIndex: eth1DepositIndex, - } - return nil -} - -// AllDepositContainers returns all historical deposit containers. -func (dc *DepositCache) AllDepositContainers(ctx context.Context) []*ethpb.DepositContainer { - _, span := trace.StartSpan(ctx, "DepositsCache.AllDepositContainers") - defer span.End() - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - - // Make a shallow copy of the deposits and return that. This way, the - // caller can safely iterate over the returned list of deposits without - // the possibility of new deposits showing up. If we were to return the - // list without a copy, when a new deposit is added to the cache, it - // would also be present in the returned value. This could result in a - // race condition if the list is being iterated over. - // - // It's not necessary to make a deep copy of this list because the - // deposits in the cache should never be modified. It is still possible - // for the caller to modify one of the underlying deposits and modify - // the cache, but that's not a race condition. Also, a deep copy would - // take too long and use too much memory. - deposits := make([]*ethpb.DepositContainer, len(dc.deposits)) - copy(deposits, dc.deposits) - return deposits -} - -// AllDeposits returns a list of historical deposits until the given block number -// (inclusive). If no block is specified then this method returns all historical deposits. -func (dc *DepositCache) AllDeposits(ctx context.Context, untilBlk *big.Int) []*ethpb.Deposit { - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - - return dc.allDeposits(untilBlk) -} - -func (dc *DepositCache) allDeposits(untilBlk *big.Int) []*ethpb.Deposit { - var deposits []*ethpb.Deposit - for _, ctnr := range dc.deposits { - if untilBlk == nil || untilBlk.Uint64() >= ctnr.Eth1BlockHeight { - deposits = append(deposits, ctnr.Deposit) - } - } - return deposits -} - -// DepositsNumberAndRootAtHeight returns number of deposits made up to blockheight and the -// root that corresponds to the latest deposit at that blockheight. -func (dc *DepositCache) DepositsNumberAndRootAtHeight(ctx context.Context, blockHeight *big.Int) (uint64, [32]byte) { - _, span := trace.StartSpan(ctx, "DepositsCache.DepositsNumberAndRootAtHeight") - defer span.End() - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - heightIdx := sort.Search(len(dc.deposits), func(i int) bool { return dc.deposits[i].Eth1BlockHeight > blockHeight.Uint64() }) - // send the deposit root of the empty trie, if eth1follow distance is greater than the time of the earliest - // deposit. - if heightIdx == 0 { - return 0, [32]byte{} - } - return uint64(heightIdx), bytesutil.ToBytes32(dc.deposits[heightIdx-1].DepositRoot) -} - -// DepositByPubkey looks through historical deposits and finds one which contains -// a certain public key within its deposit data. -func (dc *DepositCache) DepositByPubkey(ctx context.Context, pubKey []byte) (*ethpb.Deposit, *big.Int) { - _, span := trace.StartSpan(ctx, "DepositsCache.DepositByPubkey") - defer span.End() - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - - var deposit *ethpb.Deposit - var blockNum *big.Int - deps, ok := dc.depositsByKey[bytesutil.ToBytes48(pubKey)] - if !ok || len(deps) == 0 { - return deposit, blockNum - } - // We always return the first deposit if a particular - // validator key has multiple deposits assigned to - // it. - deposit = deps[0].Deposit - blockNum = big.NewInt(int64(deps[0].Eth1BlockHeight)) - return deposit, blockNum -} - -// FinalizedDeposits returns the finalized deposits trie. -func (dc *DepositCache) FinalizedDeposits(ctx context.Context) (cache.FinalizedDeposits, error) { - _, span := trace.StartSpan(ctx, "DepositsCache.FinalizedDeposits") - defer span.End() - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - - return &FinalizedDeposits{ - deposits: dc.finalizedDeposits.deposits.Copy(), - merkleTrieIndex: dc.finalizedDeposits.merkleTrieIndex, - }, nil -} - -// NonFinalizedDeposits returns the list of non-finalized deposits until the given block number (inclusive). -// If no block is specified then this method returns all non-finalized deposits. -func (dc *DepositCache) NonFinalizedDeposits(ctx context.Context, lastFinalizedIndex int64, untilBlk *big.Int) []*ethpb.Deposit { - _, span := trace.StartSpan(ctx, "DepositsCache.NonFinalizedDeposits") - defer span.End() - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - - if dc.finalizedDeposits.Deposits() == nil { - return dc.allDeposits(untilBlk) - } - - var deposits []*ethpb.Deposit - for _, d := range dc.deposits { - if (d.Index > lastFinalizedIndex) && (untilBlk == nil || untilBlk.Uint64() >= d.Eth1BlockHeight) { - deposits = append(deposits, d.Deposit) - } - } - - return deposits -} - -// PruneProofs removes proofs from all deposits whose index is equal or less than untilDepositIndex. -func (dc *DepositCache) PruneProofs(ctx context.Context, untilDepositIndex int64) error { - _, span := trace.StartSpan(ctx, "DepositsCache.PruneProofs") - defer span.End() - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - - if untilDepositIndex >= int64(len(dc.deposits)) { - untilDepositIndex = int64(len(dc.deposits) - 1) - } - - for i := untilDepositIndex; i >= 0; i-- { - // Finding a nil proof means that all proofs up to this deposit have been already pruned. - if dc.deposits[i].Deposit.Proof == nil { - break - } - dc.deposits[i].Deposit.Proof = nil - } - - return nil -} - -// Deposits returns the cached internal deposit tree. -func (fd *FinalizedDeposits) Deposits() cache.MerkleTree { - if fd.deposits != nil { - return fd.deposits - } - return nil -} - -// MerkleTrieIndex represents the last finalized index in -// the finalized deposit container. -func (fd *FinalizedDeposits) MerkleTrieIndex() int64 { - return fd.merkleTrieIndex -} diff --git a/beacon-chain/cache/depositcache/deposits_cache_test.go b/beacon-chain/cache/depositcache/deposits_cache_test.go deleted file mode 100644 index a5d0a7b068ee..000000000000 --- a/beacon-chain/cache/depositcache/deposits_cache_test.go +++ /dev/null @@ -1,1074 +0,0 @@ -package depositcache - -import ( - "bytes" - "context" - "fmt" - "math/big" - "testing" - - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/container/trie" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/assert" - "github.com/prysmaticlabs/prysm/v5/testing/require" - logTest "github.com/sirupsen/logrus/hooks/test" -) - -const nilDepositErr = "Ignoring nil deposit insertion" - -var _ cache.DepositFetcher = (*DepositCache)(nil) - -func TestInsertDeposit_LogsOnNilDepositInsertion(t *testing.T) { - hook := logTest.NewGlobal() - dc, err := New() - require.NoError(t, err) - - assert.ErrorContains(t, "nil deposit inserted into the cache", dc.InsertDeposit(context.Background(), nil, 1, 0, [32]byte{})) - - require.Equal(t, 0, len(dc.deposits), "Number of deposits changed") - assert.Equal(t, nilDepositErr, hook.LastEntry().Message) -} - -func TestInsertDeposit_MaintainsSortedOrderByIndex(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - insertions := []struct { - blkNum uint64 - deposit *ethpb.Deposit - index int64 - expectedErr string - }{ - { - blkNum: 0, - deposit: ðpb.Deposit{Data: ðpb.Deposit_Data{PublicKey: []byte{'A'}}}, - index: 0, - expectedErr: "", - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Data: ðpb.Deposit_Data{PublicKey: []byte{'B'}}}, - index: 3, - expectedErr: "wanted deposit with index 1 to be inserted but received 3", - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Data: ðpb.Deposit_Data{PublicKey: []byte{'C'}}}, - index: 1, - expectedErr: "", - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Data: ðpb.Deposit_Data{PublicKey: []byte{'D'}}}, - index: 4, - expectedErr: "wanted deposit with index 2 to be inserted but received 4", - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Data: ðpb.Deposit_Data{PublicKey: []byte{'E'}}}, - index: 2, - expectedErr: "", - }, - } - - for _, ins := range insertions { - if ins.expectedErr != "" { - assert.ErrorContains(t, ins.expectedErr, dc.InsertDeposit(context.Background(), ins.deposit, ins.blkNum, ins.index, [32]byte{})) - } else { - assert.NoError(t, dc.InsertDeposit(context.Background(), ins.deposit, ins.blkNum, ins.index, [32]byte{})) - } - } - - expectedIndices := []int64{0, 1, 2} - for i, ei := range expectedIndices { - assert.Equal(t, ei, dc.deposits[i].Index, - fmt.Sprintf("dc.deposits[%d].Index = %d, wanted %d", i, dc.deposits[i].Index, ei)) - } -} - -func TestAllDeposits_ReturnsAllDeposits(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - deposits := []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 12, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 12, - Deposit: ðpb.Deposit{}, - }, - } - dc.deposits = deposits - - d := dc.AllDeposits(context.Background(), nil) - assert.Equal(t, len(deposits), len(d)) -} - -func TestAllDeposits_FiltersDepositUpToAndIncludingBlockNumber(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - deposits := []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 12, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 12, - Deposit: ðpb.Deposit{}, - }, - } - dc.deposits = deposits - - d := dc.AllDeposits(context.Background(), big.NewInt(11)) - assert.Equal(t, 5, len(d)) -} - -func TestDepositsNumberAndRootAtHeight(t *testing.T) { - wantedRoot := bytesutil.PadTo([]byte("root"), 32) - t.Run("requesting_last_item_works", func(t *testing.T) { - dc, err := New() - require.NoError(t, err) - dc.deposits = []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 10, - Index: 0, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 10, - Index: 1, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 11, - Index: 2, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 13, - Index: 3, - Deposit: ðpb.Deposit{}, - DepositRoot: wantedRoot, - }, - } - n, root := dc.DepositsNumberAndRootAtHeight(context.Background(), big.NewInt(13)) - assert.Equal(t, 4, int(n)) - require.DeepEqual(t, wantedRoot, root[:]) - }) - t.Run("only_one_item", func(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - dc.deposits = []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 10, - Index: 0, - Deposit: ðpb.Deposit{}, - DepositRoot: wantedRoot, - }, - } - n, root := dc.DepositsNumberAndRootAtHeight(context.Background(), big.NewInt(10)) - assert.Equal(t, 1, int(n)) - require.DeepEqual(t, wantedRoot, root[:]) - }) - t.Run("none_at_height_some_below", func(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - dc.deposits = []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 8, - Index: 0, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 9, - Index: 1, - Deposit: ðpb.Deposit{}, - DepositRoot: wantedRoot, - }, - { - Eth1BlockHeight: 11, - Index: 2, - Deposit: ðpb.Deposit{}, - }, - } - n, root := dc.DepositsNumberAndRootAtHeight(context.Background(), big.NewInt(10)) - assert.Equal(t, 2, int(n)) - require.DeepEqual(t, wantedRoot, root[:]) - }) - t.Run("none_at_height_none_below", func(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - dc.deposits = []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 8, - Index: 0, - Deposit: ðpb.Deposit{}, - DepositRoot: wantedRoot, - }, - } - n, root := dc.DepositsNumberAndRootAtHeight(context.Background(), big.NewInt(7)) - assert.Equal(t, 0, int(n)) - require.DeepEqual(t, params.BeaconConfig().ZeroHash, root) - }) - t.Run("none_at_height_one_below", func(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - dc.deposits = []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 8, - Index: 0, - Deposit: ðpb.Deposit{}, - DepositRoot: wantedRoot, - }, - } - n, root := dc.DepositsNumberAndRootAtHeight(context.Background(), big.NewInt(10)) - assert.Equal(t, 1, int(n)) - require.DeepEqual(t, wantedRoot, root[:]) - }) - t.Run("some_greater_some_lower", func(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - dc.deposits = []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 8, - Index: 0, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 8, - Index: 1, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 9, - Index: 2, - Deposit: ðpb.Deposit{}, - DepositRoot: wantedRoot, - }, - { - Eth1BlockHeight: 10, - Index: 3, - Deposit: ðpb.Deposit{}, - }, - { - Eth1BlockHeight: 10, - Index: 4, - Deposit: ðpb.Deposit{}, - }, - } - n, root := dc.DepositsNumberAndRootAtHeight(context.Background(), big.NewInt(9)) - assert.Equal(t, 3, int(n)) - require.DeepEqual(t, wantedRoot, root[:]) - }) -} - -func TestDepositByPubkey_ReturnsFirstMatchingDeposit(t *testing.T) { - dc, err := New() - require.NoError(t, err) - ctrs := []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 9, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte("pk0"), 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte("pk1"), 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - }, - { - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte("pk1"), 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - }, - { - Eth1BlockHeight: 12, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte("pk2"), 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - }, - } - dc.InsertDepositContainers(context.Background(), ctrs) - - pk1 := bytesutil.PadTo([]byte("pk1"), 48) - dep, blkNum := dc.DepositByPubkey(context.Background(), pk1) - - if dep == nil || !bytes.Equal(dep.Data.PublicKey, pk1) { - t.Error("Returned wrong deposit") - } - assert.Equal(t, 0, blkNum.Cmp(big.NewInt(10)), - fmt.Sprintf("Returned wrong block number %v", blkNum)) -} - -func TestFinalizedDeposits_DepositsCachedCorrectly(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - finalizedDeposits := []*ethpb.DepositContainer{ - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{0}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 0, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 1, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{2}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 2, - }, - } - dc.deposits = append(finalizedDeposits, ðpb.DepositContainer{ - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{3}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 3, - }) - - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0)) - - cachedDeposits, err := dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - require.NotNil(t, cachedDeposits, "Deposits not cached") - assert.Equal(t, int64(2), cachedDeposits.MerkleTrieIndex()) - - var deps [][]byte - for _, d := range finalizedDeposits { - hash, err := d.Deposit.Data.HashTreeRoot() - require.NoError(t, err, "Could not hash deposit data") - deps = append(deps, hash[:]) - } - generatedTrie, err := trie.GenerateTrieFromItems(deps, params.BeaconConfig().DepositContractTreeDepth) - require.NoError(t, err, "Could not generate deposit trie") - rootA, err := generatedTrie.HashTreeRoot() - require.NoError(t, err) - rootB, err := cachedDeposits.Deposits().HashTreeRoot() - require.NoError(t, err) - assert.Equal(t, rootA, rootB) -} - -func TestFinalizedDeposits_UtilizesPreviouslyCachedDeposits(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - oldFinalizedDeposits := []*ethpb.DepositContainer{ - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{0}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 0, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 1, - }, - } - newFinalizedDeposit := ðpb.DepositContainer{ - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{2}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 2, - } - dc.deposits = oldFinalizedDeposits - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 1, [32]byte{}, 0)) - - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0)) - - dc.deposits = append(dc.deposits, []*ethpb.DepositContainer{newFinalizedDeposit}...) - - cachedDeposits, err := dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - require.NotNil(t, cachedDeposits, "Deposits not cached") - assert.Equal(t, int64(1), cachedDeposits.MerkleTrieIndex()) - - var deps [][]byte - for _, d := range oldFinalizedDeposits { - hash, err := d.Deposit.Data.HashTreeRoot() - require.NoError(t, err, "Could not hash deposit data") - deps = append(deps, hash[:]) - } - generatedTrie, err := trie.GenerateTrieFromItems(deps, params.BeaconConfig().DepositContractTreeDepth) - require.NoError(t, err, "Could not generate deposit trie") - rootA, err := generatedTrie.HashTreeRoot() - require.NoError(t, err) - rootB, err := cachedDeposits.Deposits().HashTreeRoot() - require.NoError(t, err) - assert.Equal(t, rootA, rootB) -} - -func TestFinalizedDeposits_HandleZeroDeposits(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0)) - - cachedDeposits, err := dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - require.NotNil(t, cachedDeposits, "Deposits not cached") - assert.Equal(t, int64(-1), cachedDeposits.MerkleTrieIndex()) -} - -func TestFinalizedDeposits_HandleSmallerThanExpectedDeposits(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - finalizedDeposits := []*ethpb.DepositContainer{ - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{0}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 0, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 1, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{2}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 2, - }, - } - dc.deposits = finalizedDeposits - - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 5, [32]byte{}, 0)) - - cachedDeposits, err := dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - require.NotNil(t, cachedDeposits, "Deposits not cached") - assert.Equal(t, int64(2), cachedDeposits.MerkleTrieIndex()) -} - -func TestFinalizedDeposits_HandleLowerEth1DepositIndex(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - finalizedDeposits := []*ethpb.DepositContainer{ - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{0}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 0, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 1, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{2}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 2, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{3}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 3, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{4}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 4, - }, - { - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{5}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 5, - }, - } - dc.deposits = finalizedDeposits - - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 5, [32]byte{}, 0)) - - // Reinsert finalized deposits with a lower index. - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0)) - - cachedDeposits, err := dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - require.NotNil(t, cachedDeposits, "Deposits not cached") - assert.Equal(t, int64(5), cachedDeposits.MerkleTrieIndex()) -} - -func TestFinalizedDeposits_InitializedCorrectly(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - finalizedDeposits := dc.finalizedDeposits - assert.NotNil(t, finalizedDeposits) - assert.NotNil(t, finalizedDeposits.Deposits) - assert.Equal(t, int64(-1), finalizedDeposits.merkleTrieIndex) -} - -func TestNonFinalizedDeposits_ReturnsAllNonFinalizedDeposits(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - finalizedDeposits := []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{0}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 0, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 1, - }, - } - dc.deposits = append(finalizedDeposits, - ðpb.DepositContainer{ - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{2}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 2, - }, - ðpb.DepositContainer{ - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{3}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 3, - }) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 1, [32]byte{}, 0)) - - deps := dc.NonFinalizedDeposits(context.Background(), 1, nil) - assert.Equal(t, 2, len(deps)) -} - -func TestNonFinalizedDeposits_ReturnsNonFinalizedDepositsUpToBlockNumber(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - finalizedDeposits := []*ethpb.DepositContainer{ - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{0}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 0, - }, - { - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 1, - }, - } - dc.deposits = append(finalizedDeposits, - ðpb.DepositContainer{ - Eth1BlockHeight: 10, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{2}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 2, - }, - ðpb.DepositContainer{ - Eth1BlockHeight: 11, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{3}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: 3, - }) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 1, [32]byte{}, 0)) - - deps := dc.NonFinalizedDeposits(context.Background(), 1, big.NewInt(10)) - assert.Equal(t, 1, len(deps)) -} - -func TestFinalizedDeposits_ReturnsTrieCorrectly(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - generateCtr := func(height uint64, index int64) *ethpb.DepositContainer { - return ðpb.DepositContainer{ - Eth1BlockHeight: height, - Deposit: ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{uint8(index)}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - }, - Index: index, - } - } - - finalizedDeposits := []*ethpb.DepositContainer{ - generateCtr(10, 0), - generateCtr(11, 1), - generateCtr(12, 2), - generateCtr(12, 3), - generateCtr(13, 4), - generateCtr(13, 5), - generateCtr(13, 6), - generateCtr(14, 7), - } - dc.deposits = append(finalizedDeposits, - generateCtr(15, 8), - generateCtr(15, 9), - generateCtr(30, 10)) - trieItems := make([][]byte, 0, len(dc.deposits)) - for _, dep := range dc.allDeposits(big.NewInt(30)) { - depHash, err := dep.Data.HashTreeRoot() - assert.NoError(t, err) - trieItems = append(trieItems, depHash[:]) - } - depositTrie, err := trie.GenerateTrieFromItems(trieItems, params.BeaconConfig().DepositContractTreeDepth) - assert.NoError(t, err) - - // Perform this in a nonsensical ordering - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 10, [32]byte{}, 0)) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 2, [32]byte{}, 0)) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 3, [32]byte{}, 0)) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 4, [32]byte{}, 0)) - - // Mimic finalized deposit trie fetch. - fd, err := dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - deps := dc.NonFinalizedDeposits(context.Background(), fd.MerkleTrieIndex(), big.NewInt(14)) - insertIndex := fd.MerkleTrieIndex() + 1 - - for _, dep := range deps { - depHash, err := dep.Data.HashTreeRoot() - assert.NoError(t, err) - if err = fd.Deposits().Insert(depHash[:], int(insertIndex)); err != nil { - assert.NoError(t, err) - } - insertIndex++ - } - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 15, [32]byte{}, 0)) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 15, [32]byte{}, 0)) - require.NoError(t, dc.InsertFinalizedDeposits(context.Background(), 14, [32]byte{}, 0)) - - fd, err = dc.FinalizedDeposits(context.Background()) - require.NoError(t, err) - deps = dc.NonFinalizedDeposits(context.Background(), fd.MerkleTrieIndex(), big.NewInt(30)) - insertIndex = fd.MerkleTrieIndex() + 1 - - for _, dep := range deps { - depHash, err := dep.Data.HashTreeRoot() - assert.NoError(t, err) - if err = fd.Deposits().Insert(depHash[:], int(insertIndex)); err != nil { - assert.NoError(t, err) - } - insertIndex++ - } - assert.Equal(t, fd.Deposits().NumOfItems(), depositTrie.NumOfItems()) -} - -func TestPruneProofs_Ok(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - deposits := []struct { - blkNum uint64 - deposit *ethpb.Deposit - index int64 - }{ - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk0"), 48)}}, - index: 0, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk1"), 48)}}, - index: 1, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk2"), 48)}}, - index: 2, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk3"), 48)}}, - index: 3, - }, - } - - for _, ins := range deposits { - assert.NoError(t, dc.InsertDeposit(context.Background(), ins.deposit, ins.blkNum, ins.index, [32]byte{})) - } - - require.NoError(t, dc.PruneProofs(context.Background(), 1)) - - assert.DeepEqual(t, [][]byte(nil), dc.deposits[0].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[1].Deposit.Proof) - assert.NotNil(t, dc.deposits[2].Deposit.Proof) - assert.NotNil(t, dc.deposits[3].Deposit.Proof) -} - -func TestPruneProofs_SomeAlreadyPruned(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - deposits := []struct { - blkNum uint64 - deposit *ethpb.Deposit - index int64 - }{ - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: nil, Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte("pk0"), 48)}}, - index: 0, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: nil, Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte("pk1"), 48)}}, index: 1, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk2"), 48)}}, - index: 2, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk3"), 48)}}, - index: 3, - }, - } - - for _, ins := range deposits { - assert.NoError(t, dc.InsertDeposit(context.Background(), ins.deposit, ins.blkNum, ins.index, [32]byte{})) - } - - require.NoError(t, dc.PruneProofs(context.Background(), 2)) - - assert.DeepEqual(t, [][]byte(nil), dc.deposits[2].Deposit.Proof) -} - -func TestPruneProofs_PruneAllWhenDepositIndexTooBig(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - deposits := []struct { - blkNum uint64 - deposit *ethpb.Deposit - index int64 - }{ - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk0"), 48)}}, - index: 0, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk1"), 48)}}, - index: 1, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk2"), 48)}}, - index: 2, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk3"), 48)}}, - index: 3, - }, - } - - for _, ins := range deposits { - assert.NoError(t, dc.InsertDeposit(context.Background(), ins.deposit, ins.blkNum, ins.index, [32]byte{})) - } - - require.NoError(t, dc.PruneProofs(context.Background(), 99)) - - assert.DeepEqual(t, [][]byte(nil), dc.deposits[0].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[1].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[2].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[3].Deposit.Proof) -} - -func TestPruneProofs_CorrectlyHandleLastIndex(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - deposits := []struct { - blkNum uint64 - deposit *ethpb.Deposit - index int64 - }{ - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk0"), 48)}}, - index: 0, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk1"), 48)}}, - index: 1, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk2"), 48)}}, - index: 2, - }, - { - blkNum: 0, - deposit: ðpb.Deposit{Proof: makeDepositProof(), - Data: ðpb.Deposit_Data{PublicKey: bytesutil.PadTo([]byte("pk3"), 48)}}, - index: 3, - }, - } - - for _, ins := range deposits { - assert.NoError(t, dc.InsertDeposit(context.Background(), ins.deposit, ins.blkNum, ins.index, [32]byte{})) - } - - require.NoError(t, dc.PruneProofs(context.Background(), 4)) - - assert.DeepEqual(t, [][]byte(nil), dc.deposits[0].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[1].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[2].Deposit.Proof) - assert.DeepEqual(t, [][]byte(nil), dc.deposits[3].Deposit.Proof) -} - -func TestDepositMap_WorksCorrectly(t *testing.T) { - dc, err := New() - require.NoError(t, err) - - pk0 := bytesutil.PadTo([]byte("pk0"), 48) - dep, _ := dc.DepositByPubkey(context.Background(), pk0) - var nilDep *ethpb.Deposit - assert.DeepEqual(t, nilDep, dep) - - dep = ðpb.Deposit{Proof: makeDepositProof(), Data: ðpb.Deposit_Data{PublicKey: pk0, Amount: 1000}} - assert.NoError(t, dc.InsertDeposit(context.Background(), dep, 1000, 0, [32]byte{})) - - dep, _ = dc.DepositByPubkey(context.Background(), pk0) - assert.NotEqual(t, nilDep, dep) - assert.Equal(t, uint64(1000), dep.Data.Amount) - - dep = ðpb.Deposit{Proof: makeDepositProof(), Data: ðpb.Deposit_Data{PublicKey: pk0, Amount: 10000}} - assert.NoError(t, dc.InsertDeposit(context.Background(), dep, 1000, 1, [32]byte{})) - - // Make sure we have the same deposit returned over here. - dep, _ = dc.DepositByPubkey(context.Background(), pk0) - assert.NotEqual(t, nilDep, dep) - assert.Equal(t, uint64(1000), dep.Data.Amount) - - // Make sure another key doesn't work. - pk1 := bytesutil.PadTo([]byte("pk1"), 48) - dep, _ = dc.DepositByPubkey(context.Background(), pk1) - assert.DeepEqual(t, nilDep, dep) -} - -func makeDepositProof() [][]byte { - proof := make([][]byte, int(params.BeaconConfig().DepositContractTreeDepth)+1) - for i := range proof { - proof[i] = make([]byte, 32) - } - return proof -} - -func TestEmptyTree(t *testing.T) { - finalizedDepositsTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) - require.NoError(t, err) - v, err := finalizedDepositsTrie.HashTreeRoot() - require.NoError(t, err) - fmt.Printf("%x", v) -} diff --git a/beacon-chain/cache/depositcache/log.go b/beacon-chain/cache/depositcache/log.go deleted file mode 100644 index 6cf0f78a5ab2..000000000000 --- a/beacon-chain/cache/depositcache/log.go +++ /dev/null @@ -1,5 +0,0 @@ -package depositcache - -import "github.com/sirupsen/logrus" - -var log = logrus.WithField("prefix", "depositcache") diff --git a/beacon-chain/cache/depositcache/pending_deposits.go b/beacon-chain/cache/depositcache/pending_deposits.go deleted file mode 100644 index e95c5c1ca3e3..000000000000 --- a/beacon-chain/cache/depositcache/pending_deposits.go +++ /dev/null @@ -1,151 +0,0 @@ -package depositcache - -import ( - "context" - "math/big" - "sort" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/prysmaticlabs/prysm/v5/crypto/hash" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/sirupsen/logrus" - "go.opencensus.io/trace" -) - -var ( - pendingDepositsCount = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "beacondb_pending_deposits", - Help: "The number of pending deposits in the beaconDB in-memory database", - }) -) - -// PendingDepositsFetcher specifically outlines a struct that can retrieve deposits -// which have not yet been included in the chain. -type PendingDepositsFetcher interface { - PendingContainers(ctx context.Context, untilBlk *big.Int) []*ethpb.DepositContainer -} - -// InsertPendingDeposit into the database. If deposit or block number are nil -// then this method does nothing. -func (dc *DepositCache) InsertPendingDeposit(ctx context.Context, d *ethpb.Deposit, blockNum uint64, index int64, depositRoot [32]byte) { - _, span := trace.StartSpan(ctx, "DepositsCache.InsertPendingDeposit") - defer span.End() - if d == nil { - log.WithFields(logrus.Fields{ - "block": blockNum, - "deposit": d, - }).Debug("Ignoring nil deposit insertion") - return - } - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - dc.pendingDeposits = append(dc.pendingDeposits, - ðpb.DepositContainer{Deposit: d, Eth1BlockHeight: blockNum, Index: index, DepositRoot: depositRoot[:]}) - pendingDepositsCount.Inc() - span.AddAttributes(trace.Int64Attribute("count", int64(len(dc.pendingDeposits)))) -} - -// PendingDeposits returns a list of deposits until the given block number -// (inclusive). If no block is specified then this method returns all pending -// deposits. -func (dc *DepositCache) PendingDeposits(ctx context.Context, untilBlk *big.Int) []*ethpb.Deposit { - ctx, span := trace.StartSpan(ctx, "DepositsCache.PendingDeposits") - defer span.End() - - depositCntrs := dc.PendingContainers(ctx, untilBlk) - - deposits := make([]*ethpb.Deposit, 0, len(depositCntrs)) - for _, dep := range depositCntrs { - deposits = append(deposits, dep.Deposit) - } - - return deposits -} - -// PendingContainers returns a list of deposit containers until the given block number -// (inclusive). -func (dc *DepositCache) PendingContainers(ctx context.Context, untilBlk *big.Int) []*ethpb.DepositContainer { - _, span := trace.StartSpan(ctx, "DepositsCache.PendingDeposits") - defer span.End() - dc.depositsLock.RLock() - defer dc.depositsLock.RUnlock() - - depositCntrs := make([]*ethpb.DepositContainer, 0, len(dc.pendingDeposits)) - for _, ctnr := range dc.pendingDeposits { - if untilBlk == nil || untilBlk.Uint64() >= ctnr.Eth1BlockHeight { - depositCntrs = append(depositCntrs, ctnr) - } - } - // Sort the deposits by Merkle index. - sort.SliceStable(depositCntrs, func(i, j int) bool { - return depositCntrs[i].Index < depositCntrs[j].Index - }) - - span.AddAttributes(trace.Int64Attribute("count", int64(len(depositCntrs)))) - - return depositCntrs -} - -// RemovePendingDeposit from the database. The deposit is indexed by the -// Index. This method does nothing if deposit ptr is nil. -func (dc *DepositCache) RemovePendingDeposit(ctx context.Context, d *ethpb.Deposit) { - _, span := trace.StartSpan(ctx, "DepositsCache.RemovePendingDeposit") - defer span.End() - - if d == nil { - log.Debug("Ignoring nil deposit removal") - return - } - - depRoot, err := hash.Proto(d) - if err != nil { - log.WithError(err).Error("Could not remove deposit") - return - } - - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - - idx := -1 - for i, ctnr := range dc.pendingDeposits { - h, err := hash.Proto(ctnr.Deposit) - if err != nil { - log.WithError(err).Error("Could not hash deposit") - continue - } - if h == depRoot { - idx = i - break - } - } - - if idx >= 0 { - dc.pendingDeposits = append(dc.pendingDeposits[:idx], dc.pendingDeposits[idx+1:]...) - pendingDepositsCount.Dec() - } -} - -// PrunePendingDeposits removes any deposit which is older than the given deposit merkle tree index. -func (dc *DepositCache) PrunePendingDeposits(ctx context.Context, merkleTreeIndex int64) { - _, span := trace.StartSpan(ctx, "DepositsCache.PrunePendingDeposits") - defer span.End() - - if merkleTreeIndex == 0 { - log.Debug("Ignoring 0 deposit removal") - return - } - - dc.depositsLock.Lock() - defer dc.depositsLock.Unlock() - - cleanDeposits := make([]*ethpb.DepositContainer, 0, len(dc.pendingDeposits)) - for _, dp := range dc.pendingDeposits { - if dp.Index >= merkleTreeIndex { - cleanDeposits = append(cleanDeposits, dp) - } - } - - dc.pendingDeposits = cleanDeposits - pendingDepositsCount.Set(float64(len(dc.pendingDeposits))) -} diff --git a/beacon-chain/cache/depositsnapshot/BUILD.bazel b/beacon-chain/cache/depositsnapshot/BUILD.bazel index 01f593cee0ac..c300f81f31fa 100644 --- a/beacon-chain/cache/depositsnapshot/BUILD.bazel +++ b/beacon-chain/cache/depositsnapshot/BUILD.bazel @@ -34,6 +34,7 @@ go_test( name = "go_default_test", srcs = [ "deposit_cache_test.go", + "deposit_fetcher_test.go", "deposit_tree_snapshot_test.go", "merkle_tree_test.go", "spec_test.go", diff --git a/beacon-chain/cache/depositsnapshot/deposit_fetcher.go b/beacon-chain/cache/depositsnapshot/deposit_fetcher.go index 0c6406439ee5..2cf862765ea7 100644 --- a/beacon-chain/cache/depositsnapshot/deposit_fetcher.go +++ b/beacon-chain/cache/depositsnapshot/deposit_fetcher.go @@ -262,6 +262,12 @@ func toFinalizedDepositsContainer(deposits *DepositTree, index int64) finalizedD } } +// PendingDepositsFetcher specifically outlines a struct that can retrieve deposits +// which have not yet been included in the chain. +type PendingDepositsFetcher interface { + PendingContainers(ctx context.Context, untilBlk *big.Int) []*ethpb.DepositContainer +} + // PendingDeposits returns a list of deposits until the given block number // (inclusive). If no block is specified then this method returns all pending // deposits. diff --git a/beacon-chain/cache/depositcache/pending_deposits_test.go b/beacon-chain/cache/depositsnapshot/deposit_fetcher_test.go similarity index 60% rename from beacon-chain/cache/depositcache/pending_deposits_test.go rename to beacon-chain/cache/depositsnapshot/deposit_fetcher_test.go index a1747882c7ea..04c949355402 100644 --- a/beacon-chain/cache/depositcache/pending_deposits_test.go +++ b/beacon-chain/cache/depositsnapshot/deposit_fetcher_test.go @@ -1,82 +1,32 @@ -package depositcache +package depositsnapshot import ( "context" "math/big" "testing" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" - "google.golang.org/protobuf/proto" ) -var _ PendingDepositsFetcher = (*DepositCache)(nil) +var _ PendingDepositsFetcher = (*Cache)(nil) func TestInsertPendingDeposit_OK(t *testing.T) { - dc := DepositCache{} + dc := Cache{} dc.InsertPendingDeposit(context.Background(), ðpb.Deposit{}, 111, 100, [32]byte{}) assert.Equal(t, 1, len(dc.pendingDeposits), "deposit not inserted") } func TestInsertPendingDeposit_ignoresNilDeposit(t *testing.T) { - dc := DepositCache{} + dc := Cache{} dc.InsertPendingDeposit(context.Background(), nil /*deposit*/, 0 /*blockNum*/, 0, [32]byte{}) assert.Equal(t, 0, len(dc.pendingDeposits)) } -func TestRemovePendingDeposit_OK(t *testing.T) { - db := DepositCache{} - proof1 := makeDepositProof() - proof1[0] = bytesutil.PadTo([]byte{'A'}, 32) - proof2 := makeDepositProof() - proof2[0] = bytesutil.PadTo([]byte{'A'}, 32) - data := ðpb.Deposit_Data{ - PublicKey: make([]byte, 48), - WithdrawalCredentials: make([]byte, 32), - Amount: 0, - Signature: make([]byte, 96), - } - depToRemove := ðpb.Deposit{Proof: proof1, Data: data} - otherDep := ðpb.Deposit{Proof: proof2, Data: data} - db.pendingDeposits = []*ethpb.DepositContainer{ - {Deposit: depToRemove, Index: 1}, - {Deposit: otherDep, Index: 5}, - } - db.RemovePendingDeposit(context.Background(), depToRemove) - - if len(db.pendingDeposits) != 1 || !proto.Equal(db.pendingDeposits[0].Deposit, otherDep) { - t.Error("Failed to remove deposit") - } -} - -func TestRemovePendingDeposit_IgnoresNilDeposit(t *testing.T) { - dc := DepositCache{} - dc.pendingDeposits = []*ethpb.DepositContainer{{Deposit: ðpb.Deposit{}}} - dc.RemovePendingDeposit(context.Background(), nil /*deposit*/) - assert.Equal(t, 1, len(dc.pendingDeposits), "deposit unexpectedly removed") -} - -func TestPendingDeposit_RoundTrip(t *testing.T) { - dc := DepositCache{} - proof := makeDepositProof() - proof[0] = bytesutil.PadTo([]byte{'A'}, 32) - data := ðpb.Deposit_Data{ - PublicKey: make([]byte, 48), - WithdrawalCredentials: make([]byte, 32), - Amount: 0, - Signature: make([]byte, 96), - } - dep := ðpb.Deposit{Proof: proof, Data: data} - dc.InsertPendingDeposit(context.Background(), dep, 111, 100, [32]byte{}) - dc.RemovePendingDeposit(context.Background(), dep) - assert.Equal(t, 0, len(dc.pendingDeposits), "Failed to insert & delete a pending deposit") -} - func TestPendingDeposits_OK(t *testing.T) { - dc := DepositCache{} + dc := Cache{} dc.pendingDeposits = []*ethpb.DepositContainer{ {Eth1BlockHeight: 2, Deposit: ðpb.Deposit{Proof: [][]byte{[]byte("A")}}}, @@ -96,7 +46,7 @@ func TestPendingDeposits_OK(t *testing.T) { } func TestPrunePendingDeposits_ZeroMerkleIndex(t *testing.T) { - dc := DepositCache{} + dc := Cache{} dc.pendingDeposits = []*ethpb.DepositContainer{ {Eth1BlockHeight: 2, Index: 2}, @@ -120,7 +70,7 @@ func TestPrunePendingDeposits_ZeroMerkleIndex(t *testing.T) { } func TestPrunePendingDeposits_OK(t *testing.T) { - dc := DepositCache{} + dc := Cache{} dc.pendingDeposits = []*ethpb.DepositContainer{ {Eth1BlockHeight: 2, Index: 2}, diff --git a/beacon-chain/cache/depositsnapshot/deposit_tree.go b/beacon-chain/cache/depositsnapshot/deposit_tree.go index 0f5e6cc6e5df..6e3720885bd6 100644 --- a/beacon-chain/cache/depositsnapshot/deposit_tree.go +++ b/beacon-chain/cache/depositsnapshot/deposit_tree.go @@ -99,11 +99,23 @@ func (d *DepositTree) getProof(index uint64) ([32]byte, [][32]byte, error) { if d.depositCount <= 0 { return [32]byte{}, nil, ErrInvalidDepositCount } + if index >= d.depositCount { + return [32]byte{}, nil, ErrInvalidIndex + } finalizedDeposits, _ := d.tree.GetFinalized([][32]byte{}) + finalizedIdx := -1 if finalizedDeposits != 0 { - finalizedDeposits = finalizedDeposits - 1 + fd, err := math.Int(finalizedDeposits) + if err != nil { + return [32]byte{}, nil, err + } + finalizedIdx = fd - 1 + } + i, err := math.Int(index) + if err != nil { + return [32]byte{}, nil, err } - if index <= finalizedDeposits { + if finalizedDeposits > 0 && i <= finalizedIdx { return [32]byte{}, nil, ErrInvalidIndex } leaf, proof := generateProof(d.tree, index, DepositContractDepth) diff --git a/beacon-chain/execution/BUILD.bazel b/beacon-chain/execution/BUILD.bazel index 0911c1384ada..2ff3ec037916 100644 --- a/beacon-chain/execution/BUILD.bazel +++ b/beacon-chain/execution/BUILD.bazel @@ -36,7 +36,6 @@ go_library( "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//beacon-chain/state/stategen:go_default_library", - "//config/features:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", @@ -94,7 +93,7 @@ go_test( embed = [":go_default_library"], deps = [ "//async/event:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", + "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/helpers:go_default_library", diff --git a/beacon-chain/execution/log_processing.go b/beacon-chain/execution/log_processing.go index 4eb9288fd163..3b0e17d4fa34 100644 --- a/beacon-chain/execution/log_processing.go +++ b/beacon-chain/execution/log_processing.go @@ -20,9 +20,7 @@ import ( coreState "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/types" statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/container/trie" contracts "github.com/prysmaticlabs/prysm/v5/contracts/deposit" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -226,16 +224,14 @@ func (s *Service) ProcessDepositLog(ctx context.Context, depositLog *gethtypes.L "merkleTreeIndex": index, }).Info("Invalid deposit registered in deposit contract") } - if features.Get().EnableEIP4881 { - // We finalize the trie here so that old deposits are not kept around, as they make - // deposit tree htr computation expensive. - dTrie, ok := s.depositTrie.(*depositsnapshot.DepositTree) - if !ok { - return errors.Errorf("wrong trie type initialized: %T", dTrie) - } - if err := dTrie.Finalize(index, depositLog.BlockHash, depositLog.BlockNumber); err != nil { - log.WithError(err).Error("Could not finalize trie") - } + // We finalize the trie here so that old deposits are not kept around, as they make + // deposit tree htr computation expensive. + dTrie, ok := s.depositTrie.(*depositsnapshot.DepositTree) + if !ok { + return errors.Errorf("wrong trie type initialized: %T", dTrie) + } + if err := dTrie.Finalize(index, depositLog.BlockHash, depositLog.BlockNumber); err != nil { + log.WithError(err).Error("Could not finalize trie") } return nil @@ -579,25 +575,17 @@ func (s *Service) savePowchainData(ctx context.Context) error { BeaconState: pbState, // I promise not to mutate it! DepositContainers: s.cfg.depositCache.AllDepositContainers(ctx), } - if features.Get().EnableEIP4881 { - fd, err := s.cfg.depositCache.FinalizedDeposits(ctx) - if err != nil { - return errors.Errorf("could not get finalized deposit tree: %v", err) - } - tree, ok := fd.Deposits().(*depositsnapshot.DepositTree) - if !ok { - return errors.New("deposit tree was not EIP4881 DepositTree") - } - eth1Data.DepositSnapshot, err = tree.ToProto() - if err != nil { - return err - } - } else { - tree, ok := s.depositTrie.(*trie.SparseMerkleTrie) - if !ok { - return errors.New("deposit tree was not SparseMerkleTrie") - } - eth1Data.Trie = tree.ToProto() + fd, err := s.cfg.depositCache.FinalizedDeposits(ctx) + if err != nil { + return errors.Errorf("could not get finalized deposit tree: %v", err) + } + tree, ok := fd.Deposits().(*depositsnapshot.DepositTree) + if !ok { + return errors.New("deposit tree was not EIP4881 DepositTree") + } + eth1Data.DepositSnapshot, err = tree.ToProto() + if err != nil { + return err } return s.cfg.beaconDB.SaveExecutionChainData(ctx, eth1Data) } diff --git a/beacon-chain/execution/log_processing_test.go b/beacon-chain/execution/log_processing_test.go index 21973160e930..4120ca136f8e 100644 --- a/beacon-chain/execution/log_processing_test.go +++ b/beacon-chain/execution/log_processing_test.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" @@ -31,7 +31,7 @@ func TestProcessDepositLog_OK(t *testing.T) { require.NoError(t, err, "Unable to set up simulated backend") beaconDB := testDB.SetupDB(t) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() @@ -100,7 +100,7 @@ func TestProcessDepositLog_InsertsPendingDeposit(t *testing.T) { testAcc, err := mock.Setup() require.NoError(t, err, "Unable to set up simulated backend") beaconDB := testDB.SetupDB(t) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) @@ -216,7 +216,7 @@ func TestProcessETH2GenesisLog_8DuplicatePubkeys(t *testing.T) { testAcc, err := mock.Setup() require.NoError(t, err, "Unable to set up simulated backend") beaconDB := testDB.SetupDB(t) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) @@ -291,7 +291,7 @@ func TestProcessETH2GenesisLog(t *testing.T) { testAcc, err := mock.Setup() require.NoError(t, err, "Unable to set up simulated backend") beaconDB := testDB.SetupDB(t) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() @@ -384,7 +384,7 @@ func TestProcessETH2GenesisLog_CorrectNumOfDeposits(t *testing.T) { testAcc, err := mock.Setup() require.NoError(t, err, "Unable to set up simulated backend") kvStore := testDB.SetupDB(t) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) @@ -481,7 +481,7 @@ func TestProcessETH2GenesisLog_LargePeriodOfNoLogs(t *testing.T) { testAcc, err := mock.Setup() require.NoError(t, err, "Unable to set up simulated backend") kvStore := testDB.SetupDB(t) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) @@ -593,7 +593,7 @@ func TestCheckForChainstart_NoValidator(t *testing.T) { } func newPowchainService(t *testing.T, eth1Backend *mock.TestAccount, beaconDB db.Database) *Service { - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) server, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) diff --git a/beacon-chain/execution/service.go b/beacon-chain/execution/service.go index 13704c119701..d71b0b949407 100644 --- a/beacon-chain/execution/service.go +++ b/beacon-chain/execution/service.go @@ -29,7 +29,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" - "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/container/trie" contracts "github.com/prysmaticlabs/prysm/v5/contracts/deposit" @@ -164,14 +163,7 @@ func NewService(ctx context.Context, opts ...Option) (*Service, error) { _ = cancel // govet fix for lost cancel. Cancel is handled in service.Stop() var depositTrie cache.MerkleTree var err error - if features.Get().EnableEIP4881 { - depositTrie = depositsnapshot.NewDepositTree() - } else { - depositTrie, err = trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) - if err != nil { - return nil, errors.Wrap(err, "could not set up deposit trie") - } - } + depositTrie = depositsnapshot.NewDepositTree() genState, err := transition.EmptyGenesisState() if err != nil { return nil, errors.Wrap(err, "could not set up genesis state") @@ -740,20 +732,12 @@ func (s *Service) initializeEth1Data(ctx context.Context, eth1DataInDB *ethpb.ET return nil } var err error - if features.Get().EnableEIP4881 { - if eth1DataInDB.DepositSnapshot != nil { - s.depositTrie, err = depositsnapshot.DepositTreeFromSnapshotProto(eth1DataInDB.DepositSnapshot) - } else { - if err := s.migrateOldDepositTree(eth1DataInDB); err != nil { - return err - } - } + if eth1DataInDB.DepositSnapshot != nil { + s.depositTrie, err = depositsnapshot.DepositTreeFromSnapshotProto(eth1DataInDB.DepositSnapshot) } else { - if eth1DataInDB.Trie == nil && eth1DataInDB.DepositSnapshot != nil { - return errors.Errorf("trying to use old deposit trie after migration to the new trie. "+ - "Remove the --%s flag to resume normal operations.", features.DisableEIP4881.Name) + if err = s.migrateOldDepositTree(eth1DataInDB); err != nil { + return err } - s.depositTrie, err = trie.CreateTrieFromProto(eth1DataInDB.Trie) } if err != nil { return err @@ -766,21 +750,19 @@ func (s *Service) initializeEth1Data(ctx context.Context, eth1DataInDB *ethpb.ET } } s.latestEth1Data = eth1DataInDB.CurrentEth1Data - if features.Get().EnableEIP4881 { - ctrs := eth1DataInDB.DepositContainers - // Look at previously finalized index, as we are building off a finalized - // snapshot rather than the full trie. - lastFinalizedIndex := int64(s.depositTrie.NumOfItems() - 1) - // Correctly initialize missing deposits into active trie. - for _, c := range ctrs { - if c.Index > lastFinalizedIndex { - depRoot, err := c.Deposit.Data.HashTreeRoot() - if err != nil { - return err - } - if err := s.depositTrie.Insert(depRoot[:], int(c.Index)); err != nil { - return err - } + ctrs := eth1DataInDB.DepositContainers + // Look at previously finalized index, as we are building off a finalized + // snapshot rather than the full trie. + lastFinalizedIndex := int64(s.depositTrie.NumOfItems() - 1) + // Correctly initialize missing deposits into active trie. + for _, c := range ctrs { + if c.Index > lastFinalizedIndex { + depRoot, err := c.Deposit.Data.HashTreeRoot() + if err != nil { + return err + } + if err := s.depositTrie.Insert(depRoot[:], int(c.Index)); err != nil { + return err } } } @@ -847,21 +829,13 @@ func (s *Service) validPowchainData(ctx context.Context) (*ethpb.ETH1ChainData, BeaconState: pbState, DepositContainers: s.cfg.depositCache.AllDepositContainers(ctx), } - if features.Get().EnableEIP4881 { - trie, ok := s.depositTrie.(*depositsnapshot.DepositTree) - if !ok { - return nil, errors.New("deposit trie was not EIP4881 DepositTree") - } - eth1Data.DepositSnapshot, err = trie.ToProto() - if err != nil { - return nil, err - } - } else { - trie, ok := s.depositTrie.(*trie.SparseMerkleTrie) - if !ok { - return nil, errors.New("deposit trie was not SparseMerkleTrie") - } - eth1Data.Trie = trie.ToProto() + trie, ok := s.depositTrie.(*depositsnapshot.DepositTree) + if !ok { + return nil, errors.New("deposit trie was not EIP4881 DepositTree") + } + eth1Data.DepositSnapshot, err = trie.ToProto() + if err != nil { + return nil, err } if err := s.cfg.beaconDB.SaveExecutionChainData(ctx, eth1Data); err != nil { return nil, err diff --git a/beacon-chain/execution/service_test.go b/beacon-chain/execution/service_test.go index a46249dbb3f1..32e8bc56dfa4 100644 --- a/beacon-chain/execution/service_test.go +++ b/beacon-chain/execution/service_test.go @@ -15,7 +15,7 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/async/event" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/types" @@ -348,7 +348,7 @@ func TestInitDepositCache_OK(t *testing.T) { cfg: &config{beaconDB: beaconDB}, } var err error - s.cfg.depositCache, err = depositcache.New() + s.cfg.depositCache, err = depositsnapshot.New() require.NoError(t, err) require.NoError(t, s.initDepositCaches(context.Background(), ctrs)) @@ -409,7 +409,7 @@ func TestInitDepositCacheWithFinalization_OK(t *testing.T) { cfg: &config{beaconDB: beaconDB}, } var err error - s.cfg.depositCache, err = depositcache.New() + s.cfg.depositCache, err = depositsnapshot.New() require.NoError(t, err) require.NoError(t, s.initDepositCaches(context.Background(), ctrs)) @@ -553,7 +553,7 @@ func Test_batchRequestHeaders_UnderflowChecks(t *testing.T) { func TestService_EnsureConsistentPowchainData(t *testing.T) { beaconDB := dbutil.SetupDB(t) - cache, err := depositcache.New() + cache, err := depositsnapshot.New() require.NoError(t, err) srv, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) @@ -583,7 +583,7 @@ func TestService_EnsureConsistentPowchainData(t *testing.T) { func TestService_InitializeCorrectly(t *testing.T) { beaconDB := dbutil.SetupDB(t) - cache, err := depositcache.New() + cache, err := depositsnapshot.New() require.NoError(t, err) srv, endpoint, err := mockExecution.SetupRPCServer() @@ -614,7 +614,7 @@ func TestService_InitializeCorrectly(t *testing.T) { func TestService_EnsureValidPowchainData(t *testing.T) { beaconDB := dbutil.SetupDB(t) - cache, err := depositcache.New() + cache, err := depositsnapshot.New() require.NoError(t, err) srv, endpoint, err := mockExecution.SetupRPCServer() require.NoError(t, err) @@ -809,7 +809,7 @@ func (s *slowRPCClient) CallContext(_ context.Context, _ interface{}, _ string, func TestService_migrateOldDepositTree(t *testing.T) { beaconDB := dbutil.SetupDB(t) - cache, err := depositcache.New() + cache, err := depositsnapshot.New() require.NoError(t, err) srv, endpoint, err := mockExecution.SetupRPCServer() diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 5c989de08c10..114f8e759eb3 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -21,7 +21,6 @@ go_library( "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/db:go_default_library", "//beacon-chain/db/filesystem:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index c5c66c639875..5c498a717585 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -25,7 +25,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" @@ -567,11 +566,7 @@ func (b *BeaconNode) startDB(cliCtx *cli.Context, depositAddress string) error { b.db = d - if features.Get().EnableEIP4881 { - depositCache, err = depositsnapshot.New() - } else { - depositCache, err = depositcache.New() - } + depositCache, err = depositsnapshot.New() if err != nil { return errors.Wrap(err, "could not create deposit cache") } diff --git a/beacon-chain/rpc/BUILD.bazel b/beacon-chain/rpc/BUILD.bazel index 45bd6e16d053..97e28d2051c5 100644 --- a/beacon-chain/rpc/BUILD.bazel +++ b/beacon-chain/rpc/BUILD.bazel @@ -13,7 +13,7 @@ go_library( "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", + "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/core/feed/block:go_default_library", "//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/state:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel index 12c85ee66768..caec5549b905 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel @@ -37,7 +37,7 @@ go_library( "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", + "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/block:go_default_library", @@ -112,7 +112,7 @@ common_deps = [ "//beacon-chain/builder:go_default_library", "//beacon-chain/builder/testing:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", + "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/execution:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/duties_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/duties_test.go index 367ecaf72673..c42bac4d615b 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/duties_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/duties_test.go @@ -8,7 +8,7 @@ import ( mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/execution" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" @@ -334,7 +334,7 @@ func TestGetAltairDuties_UnknownPubkey(t *testing.T) { chain := &mockChain.ChainService{ State: bs, Root: genesisRoot[:], Genesis: time.Now().Add(time.Duration(-1*int64(slot-1)) * time.Second), } - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) vs := &Server{ diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 023d85717e62..37b82a7617a5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -14,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" builderTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" @@ -1000,7 +1000,7 @@ func TestProposer_PendingDeposits_OutsideEth1FollowWindow(t *testing.T) { }, } - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) @@ -1139,7 +1139,7 @@ func TestProposer_PendingDeposits_FollowsCorrectEth1Block(t *testing.T) { }, } - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) @@ -1244,7 +1244,7 @@ func TestProposer_PendingDeposits_CantReturnBelowStateEth1DepositIndex(t *testin depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) for _, dp := range append(readyDeposits, recentDeposits...) { @@ -1344,7 +1344,7 @@ func TestProposer_PendingDeposits_CantReturnMoreThanMax(t *testing.T) { depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) for _, dp := range append(readyDeposits, recentDeposits...) { @@ -1442,7 +1442,7 @@ func TestProposer_PendingDeposits_CantReturnMoreThanDepositCount(t *testing.T) { depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) for _, dp := range append(readyDeposits, recentDeposits...) { @@ -1553,7 +1553,7 @@ func TestProposer_DepositTrie_UtilizesCachedFinalizedDeposits(t *testing.T) { }, } - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) @@ -1669,7 +1669,7 @@ func TestProposer_DepositTrie_RebuildTrie(t *testing.T) { }, } - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) @@ -1810,7 +1810,7 @@ func TestProposer_Eth1Data_MajorityVote_SpansGenesis(t *testing.T) { InsertBlock(100, latestValidTime, []byte("latest")) headBlockHash := []byte("headb") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) ps := &Server{ ChainStartFetcher: p, @@ -1851,7 +1851,7 @@ func TestProposer_Eth1Data_MajorityVote(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() require.NoError(t, err) @@ -2351,7 +2351,7 @@ func TestProposer_Eth1Data_MajorityVote(t *testing.T) { BlockHash: []byte("eth1data"), } - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ @@ -2547,7 +2547,7 @@ func TestProposer_Deposits_ReturnsEmptyList_IfLatestEth1DataEqGenesisEth1Block(t depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) for _, dp := range append(readyDeposits, recentDeposits...) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go index 867503f788d9..2f2d4aee1acd 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go @@ -10,7 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" blockfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/block" opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" @@ -69,7 +69,7 @@ type Server struct { BlobReceiver blockchain.BlobReceiver MockEth1Votes bool Eth1BlockFetcher execution.POWBlockFetcher - PendingDepositsFetcher depositcache.PendingDepositsFetcher + PendingDepositsFetcher depositsnapshot.PendingDepositsFetcher OperationNotifier opfeed.Notifier StateGen stategen.StateManager ReplayerBuilder stategen.ReplayerBuilder diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server_mainnet_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server_mainnet_test.go index d33836d704f9..a49e2b3704b8 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server_mainnet_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server_mainnet_test.go @@ -5,7 +5,7 @@ import ( "testing" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -65,7 +65,7 @@ func TestWaitForActivation_ValidatorOriginallyExists(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go index e8c5f66e7ae1..58dfb2ea314b 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go @@ -8,7 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/async/event" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" @@ -70,7 +70,7 @@ func TestWaitForActivation_ContextClosed(t *testing.T) { require.NoError(t, err, "Could not get signing root") ctx, cancel := context.WithCancel(context.Background()) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) vs := &Server{ diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/status_mainnet_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status_mainnet_test.go index 47a10a6da27a..c275d7877462 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/status_mainnet_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/status_mainnet_test.go @@ -7,7 +7,7 @@ import ( "time" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -40,7 +40,7 @@ func TestValidatorStatus_Active(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/status_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status_test.go index c7c98955195e..fec7a0f5bbaa 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/status_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/status_test.go @@ -8,7 +8,7 @@ import ( "github.com/d4l3k/messagediff" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -38,7 +38,7 @@ func TestValidatorStatus_DepositedEth1(t *testing.T) { pubKey1 := deposit.Data.PublicKey depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -80,7 +80,7 @@ func TestValidatorStatus_Deposited(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -125,7 +125,7 @@ func TestValidatorStatus_PartiallyDeposited(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -178,7 +178,7 @@ func TestValidatorStatus_Pending_MultipleDeposits(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -255,7 +255,7 @@ func TestValidatorStatus_Pending(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -318,7 +318,7 @@ func TestValidatorStatus_Exiting(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -377,7 +377,7 @@ func TestValidatorStatus_Slashing(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -435,7 +435,7 @@ func TestValidatorStatus_Exited(t *testing.T) { } depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -464,7 +464,7 @@ func TestValidatorStatus_Exited(t *testing.T) { func TestValidatorStatus_UnknownStatus(t *testing.T) { pubKey := pubKey(1) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) stateObj, err := state_native.InitializeFromProtoUnsafePhase0(ðpb.BeaconState{ @@ -520,7 +520,7 @@ func TestActivationStatus_OK(t *testing.T) { dep := deposits[0] depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() @@ -659,7 +659,7 @@ func TestValidatorStatus_CorrectActivationQueue(t *testing.T) { depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) for i := 0; i < 6; i++ { @@ -751,7 +751,7 @@ func TestMultipleValidatorStatus_Pubkeys(t *testing.T) { require.NoError(t, err, "Could not get signing root") depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) dep := deposits[0] @@ -916,7 +916,7 @@ func TestValidatorStatus_Invalid(t *testing.T) { deposit.Data.Signature = deposit.Data.Signature[1:] depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not setup deposit trie") - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) root, err := depositTrie.HashTreeRoot() diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 49890335a990..39ce4ca2c302 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -20,7 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" blockfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/block" opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" @@ -127,7 +127,7 @@ type Config struct { PeerManager p2p.PeerManager MetadataProvider p2p.MetadataProvider DepositFetcher cache.DepositFetcher - PendingDepositFetcher depositcache.PendingDepositsFetcher + PendingDepositFetcher depositsnapshot.PendingDepositsFetcher StateNotifier statefeed.Notifier BlockNotifier blockfeed.Notifier OperationNotifier opfeed.Notifier diff --git a/config/features/config.go b/config/features/config.go index 605f22bc007e..fe39c9970519 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -68,7 +68,6 @@ type Flags struct { DisableStakinContractCheck bool // Disables check for deposit contract when proposing blocks EnableVerboseSigVerification bool // EnableVerboseSigVerification specifies whether to verify individual signature if batch verification fails - EnableEIP4881 bool // EnableEIP4881 specifies whether to use the deposit tree from EIP4881 PrepareAllPayloads bool // PrepareAllPayloads informs the engine to prepare a block on every slot. // BlobSaveFsync requires blob saving to block on fsync to ensure blobs are durably persisted before passing DA. @@ -242,11 +241,6 @@ func ConfigureBeaconChain(ctx *cli.Context) error { logEnabled(disableResourceManager) cfg.DisableResourceManager = true } - cfg.EnableEIP4881 = true - if ctx.IsSet(DisableEIP4881.Name) { - logEnabled(DisableEIP4881) - cfg.EnableEIP4881 = false - } if ctx.IsSet(EnableLightClient.Name) { logEnabled(EnableLightClient) cfg.EnableLightClient = true diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index 3c4c2e74b9cc..1f31876dcf61 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -42,6 +42,11 @@ var ( Usage: deprecatedUsage, Hidden: true, } + deprecatedDisableEIP4881 = &cli.BoolFlag{ + Name: "disable-eip-4881", + Usage: deprecatedUsage, + Hidden: true, + } deprecatedVerboseSigVerification = &cli.BoolFlag{ Name: "enable-verbose-sig-verification", Usage: deprecatedUsage, @@ -58,6 +63,7 @@ var deprecatedFlags = []cli.Flag{ deprecatedDisableOptionalEngineMethods, deprecatedDisableAggregateParallel, deprecatedEnableEIP4881, + deprecatedDisableEIP4881, deprecatedVerboseSigVerification, } diff --git a/config/features/flags.go b/config/features/flags.go index 44329b75a63a..af97adaaab8f 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -143,10 +143,6 @@ var ( Name: "prepare-all-payloads", Usage: "Informs the engine to prepare all local payloads. Useful for relayers and builders.", } - DisableEIP4881 = &cli.BoolFlag{ - Name: "disable-eip-4881", - Usage: "Disables the deposit tree specified in EIP-4881.", - } EnableLightClient = &cli.BoolFlag{ Name: "enable-lightclient", Usage: "Enables the light client support in the beacon node", @@ -222,7 +218,6 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c aggregateFirstInterval, aggregateSecondInterval, aggregateThirdInterval, - DisableEIP4881, disableResourceManager, DisableRegistrationCache, EnableLightClient, diff --git a/testing/spectest/shared/common/forkchoice/BUILD.bazel b/testing/spectest/shared/common/forkchoice/BUILD.bazel index 9cf4c3bd33f7..b1a8743217fc 100644 --- a/testing/spectest/shared/common/forkchoice/BUILD.bazel +++ b/testing/spectest/shared/common/forkchoice/BUILD.bazel @@ -16,7 +16,7 @@ go_library( "//beacon-chain/blockchain/kzg:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/cache/depositcache:go_default_library", + "//beacon-chain/cache/depositsnapshot:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", "//beacon-chain/db/filesystem:go_default_library", diff --git a/testing/spectest/shared/common/forkchoice/service.go b/testing/spectest/shared/common/forkchoice/service.go index d285f4d85c47..c02814f94e7e 100644 --- a/testing/spectest/shared/common/forkchoice/service.go +++ b/testing/spectest/shared/common/forkchoice/service.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/kzg" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" testDB "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" @@ -56,7 +56,7 @@ func startChainService(t testing.TB, }) require.NoError(t, err) - depositCache, err := depositcache.New() + depositCache, err := depositsnapshot.New() require.NoError(t, err) fc := doublylinkedtree.New() From a9862f32f3431fac90cb5e2a2af9fa21b557d4e2 Mon Sep 17 00:00:00 2001 From: terence Date: Wed, 24 Apr 2024 14:38:03 -0700 Subject: [PATCH 054/325] Protobufs for Electra devnet-0 (#13905) * block protos * proto and ssz * stubs * Enable Electra spec test * Pull in EIP-7251 protobuf changes From: https://github.com/prysmaticlabs/prysm/pull/13903 * All EIP7549 containers are passing * All EIP7251 containers passing * including changes from eip7002 * Everything passing except for beacon state hash tree root * fixing eletra state to use electra payload * Fix minimal test. Skip beacon state test * Perston's feedback --------- Co-authored-by: rkapka Co-authored-by: james-prysm --- beacon-chain/core/blocks/withdrawals_test.go | 188 +- proto/engine/v1/BUILD.bazel | 4 + proto/engine/v1/execution_engine.pb.go | 1496 +++- proto/engine/v1/execution_engine.proto | 68 + proto/engine/v1/generated.ssz.go | 1298 ++- proto/eth/v1/generated.ssz.go | 2 +- proto/eth/v2/generated.ssz.go | 2 +- proto/prysm/v1alpha1/BUILD.bazel | 15 + proto/prysm/v1alpha1/attestation.go | 1 + proto/prysm/v1alpha1/attestation.pb.go | 455 +- proto/prysm/v1alpha1/attestation.proto | 33 + proto/prysm/v1alpha1/beacon_block.pb.go | 4250 ++++++---- proto/prysm/v1alpha1/beacon_block.proto | 175 + proto/prysm/v1alpha1/beacon_state.pb.go | 2090 +++-- proto/prysm/v1alpha1/beacon_state.proto | 65 + proto/prysm/v1alpha1/eip_7251.pb.go | 520 ++ proto/prysm/v1alpha1/eip_7251.pb.gw.go | 4 + proto/prysm/v1alpha1/eip_7251.proto | 70 + proto/prysm/v1alpha1/generated.ssz.go | 7457 ++++++++++++----- .../validator-client/keymanager.pb.go | 222 +- .../validator-client/keymanager.proto | 4 + proto/ssz_proto_library.bzl | 18 + .../mainnet/electra/ssz_static/BUILD.bazel | 12 + .../electra/ssz_static/ssz_static_test.go | 11 + .../minimal/electra/ssz_static/BUILD.bazel | 16 + .../electra/ssz_static/ssz_static_test.go | 11 + .../shared/electra/ssz_static/BUILD.bazel | 15 + .../shared/electra/ssz_static/ssz_static.go | 170 + 28 files changed, 13581 insertions(+), 5091 deletions(-) create mode 100644 proto/prysm/v1alpha1/attestation.go create mode 100755 proto/prysm/v1alpha1/eip_7251.pb.go create mode 100755 proto/prysm/v1alpha1/eip_7251.pb.gw.go create mode 100644 proto/prysm/v1alpha1/eip_7251.proto create mode 100644 testing/spectest/mainnet/electra/ssz_static/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/ssz_static/ssz_static_test.go create mode 100644 testing/spectest/minimal/electra/ssz_static/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/ssz_static/ssz_static_test.go create mode 100644 testing/spectest/shared/electra/ssz_static/BUILD.bazel create mode 100644 testing/spectest/shared/electra/ssz_static/ssz_static.go diff --git a/beacon-chain/core/blocks/withdrawals_test.go b/beacon-chain/core/blocks/withdrawals_test.go index 5717037a9a7b..35d917614b2d 100644 --- a/beacon-chain/core/blocks/withdrawals_test.go +++ b/beacon-chain/core/blocks/withdrawals_test.go @@ -250,12 +250,12 @@ func TestProcessBlindWithdrawals(t *testing.T) { maxEffectiveBalance := params.BeaconConfig().MaxEffectiveBalance type args struct { - Name string - NextWithdrawalValidatorIndex primitives.ValidatorIndex - NextWithdrawalIndex uint64 - FullWithdrawalIndices []primitives.ValidatorIndex - PartialWithdrawalIndices []primitives.ValidatorIndex - Withdrawals []*enginev1.Withdrawal + Name string + NextWithdrawalValidatorIndex primitives.ValidatorIndex + NextWithdrawalIndex uint64 + FullWithdrawalIndices []primitives.ValidatorIndex + PendingPartialWithdrawalIndices []primitives.ValidatorIndex + Withdrawals []*enginev1.Withdrawal } type control struct { NextWithdrawalValidatorIndex primitives.ValidatorIndex @@ -283,7 +283,7 @@ func TestProcessBlindWithdrawals(t *testing.T) { Amount: withdrawalAmount(i), } } - partialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal { + PendingPartialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal { return &enginev1.Withdrawal{ Index: idx, ValidatorIndex: i, @@ -321,12 +321,12 @@ func TestProcessBlindWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success one partial withdrawal", - NextWithdrawalIndex: 21, - NextWithdrawalValidatorIndex: 120, - PartialWithdrawalIndices: []primitives.ValidatorIndex{7}, + Name: "success one partial withdrawal", + NextWithdrawalIndex: 21, + NextWithdrawalValidatorIndex: 120, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(7, 21), + PendingPartialWithdrawal(7, 21), }, }, Control: control{ @@ -386,12 +386,12 @@ func TestProcessBlindWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success many partial withdrawals", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 4, - PartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, + Name: "success many partial withdrawals", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 4, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(7, 22), partialWithdrawal(19, 23), partialWithdrawal(28, 24), + PendingPartialWithdrawal(7, 22), PendingPartialWithdrawal(19, 23), PendingPartialWithdrawal(28, 24), }, }, Control: control{ @@ -406,14 +406,14 @@ func TestProcessBlindWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success many withdrawals", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 88, - FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, - PartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15}, + Name: "success many withdrawals", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 88, + FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(89, 22), partialWithdrawal(1, 23), partialWithdrawal(2, 24), - fullWithdrawal(7, 25), partialWithdrawal(15, 26), fullWithdrawal(19, 27), + PendingPartialWithdrawal(89, 22), PendingPartialWithdrawal(1, 23), PendingPartialWithdrawal(2, 24), + fullWithdrawal(7, 25), PendingPartialWithdrawal(15, 26), fullWithdrawal(19, 27), fullWithdrawal(28, 28), }, }, @@ -453,17 +453,17 @@ func TestProcessBlindWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success more than max partially withdrawals", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 0, - PartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89}, + Name: "success more than max partially withdrawals", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 0, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(1, 22), partialWithdrawal(2, 23), partialWithdrawal(3, 24), - partialWithdrawal(4, 25), partialWithdrawal(5, 26), partialWithdrawal(6, 27), - partialWithdrawal(7, 28), partialWithdrawal(8, 29), partialWithdrawal(9, 30), - partialWithdrawal(21, 31), partialWithdrawal(22, 32), partialWithdrawal(23, 33), - partialWithdrawal(24, 34), partialWithdrawal(25, 35), partialWithdrawal(26, 36), - partialWithdrawal(27, 37), + PendingPartialWithdrawal(1, 22), PendingPartialWithdrawal(2, 23), PendingPartialWithdrawal(3, 24), + PendingPartialWithdrawal(4, 25), PendingPartialWithdrawal(5, 26), PendingPartialWithdrawal(6, 27), + PendingPartialWithdrawal(7, 28), PendingPartialWithdrawal(8, 29), PendingPartialWithdrawal(9, 30), + PendingPartialWithdrawal(21, 31), PendingPartialWithdrawal(22, 32), PendingPartialWithdrawal(23, 33), + PendingPartialWithdrawal(24, 34), PendingPartialWithdrawal(25, 35), PendingPartialWithdrawal(26, 36), + PendingPartialWithdrawal(27, 37), }, }, Control: control{ @@ -491,12 +491,12 @@ func TestProcessBlindWithdrawals(t *testing.T) { }, { Args: args{ - Name: "failure wrong number of partial withdrawal", - NextWithdrawalIndex: 21, - NextWithdrawalValidatorIndex: 37, - PartialWithdrawalIndices: []primitives.ValidatorIndex{7}, + Name: "failure wrong number of partial withdrawal", + NextWithdrawalIndex: 21, + NextWithdrawalValidatorIndex: 37, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(7, 21), partialWithdrawal(9, 22), + PendingPartialWithdrawal(7, 21), PendingPartialWithdrawal(9, 22), }, }, Control: control{ @@ -540,7 +540,7 @@ func TestProcessBlindWithdrawals(t *testing.T) { NextWithdrawalValidatorIndex: 4, FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28, 1}, Withdrawals: []*enginev1.Withdrawal{ - fullWithdrawal(7, 22), fullWithdrawal(19, 23), partialWithdrawal(28, 24), + fullWithdrawal(7, 22), fullWithdrawal(19, 23), PendingPartialWithdrawal(28, 24), fullWithdrawal(1, 25), }, }, @@ -564,10 +564,10 @@ func TestProcessBlindWithdrawals(t *testing.T) { }, { Args: args{ - Name: "failure validator not partially withdrawable", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 4, - PartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable}, + Name: "failure validator not partially withdrawable", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 4, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable}, Withdrawals: []*enginev1.Withdrawal{ fullWithdrawal(notPartiallyWithdrawable, 22), }, @@ -611,7 +611,7 @@ func TestProcessBlindWithdrawals(t *testing.T) { st.Balances[idx] = withdrawalAmount(idx) validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte } - for _, idx := range arguments.PartialWithdrawalIndices { + for _, idx := range arguments.PendingPartialWithdrawalIndices { validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte st.Balances[idx] = withdrawalAmount(idx) } @@ -629,8 +629,8 @@ func TestProcessBlindWithdrawals(t *testing.T) { if test.Args.FullWithdrawalIndices == nil { test.Args.FullWithdrawalIndices = make([]primitives.ValidatorIndex, 0) } - if test.Args.PartialWithdrawalIndices == nil { - test.Args.PartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0) + if test.Args.PendingPartialWithdrawalIndices == nil { + test.Args.PendingPartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0) } slot, err := slots.EpochStart(currentEpoch) require.NoError(t, err) @@ -673,12 +673,12 @@ func TestProcessWithdrawals(t *testing.T) { maxEffectiveBalance := params.BeaconConfig().MaxEffectiveBalance type args struct { - Name string - NextWithdrawalValidatorIndex primitives.ValidatorIndex - NextWithdrawalIndex uint64 - FullWithdrawalIndices []primitives.ValidatorIndex - PartialWithdrawalIndices []primitives.ValidatorIndex - Withdrawals []*enginev1.Withdrawal + Name string + NextWithdrawalValidatorIndex primitives.ValidatorIndex + NextWithdrawalIndex uint64 + FullWithdrawalIndices []primitives.ValidatorIndex + PendingPartialWithdrawalIndices []primitives.ValidatorIndex + Withdrawals []*enginev1.Withdrawal } type control struct { NextWithdrawalValidatorIndex primitives.ValidatorIndex @@ -706,7 +706,7 @@ func TestProcessWithdrawals(t *testing.T) { Amount: withdrawalAmount(i), } } - partialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal { + PendingPartialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal { return &enginev1.Withdrawal{ Index: idx, ValidatorIndex: i, @@ -744,12 +744,12 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success one partial withdrawal", - NextWithdrawalIndex: 21, - NextWithdrawalValidatorIndex: 120, - PartialWithdrawalIndices: []primitives.ValidatorIndex{7}, + Name: "success one partial withdrawal", + NextWithdrawalIndex: 21, + NextWithdrawalValidatorIndex: 120, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(7, 21), + PendingPartialWithdrawal(7, 21), }, }, Control: control{ @@ -809,12 +809,12 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success many partial withdrawals", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 4, - PartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, + Name: "success many partial withdrawals", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 4, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(7, 22), partialWithdrawal(19, 23), partialWithdrawal(28, 24), + PendingPartialWithdrawal(7, 22), PendingPartialWithdrawal(19, 23), PendingPartialWithdrawal(28, 24), }, }, Control: control{ @@ -829,14 +829,14 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success many withdrawals", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 88, - FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, - PartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15}, + Name: "success many withdrawals", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 88, + FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(89, 22), partialWithdrawal(1, 23), partialWithdrawal(2, 24), - fullWithdrawal(7, 25), partialWithdrawal(15, 26), fullWithdrawal(19, 27), + PendingPartialWithdrawal(89, 22), PendingPartialWithdrawal(1, 23), PendingPartialWithdrawal(2, 24), + fullWithdrawal(7, 25), PendingPartialWithdrawal(15, 26), fullWithdrawal(19, 27), fullWithdrawal(28, 28), }, }, @@ -876,17 +876,17 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "success more than max partially withdrawals", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 0, - PartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89}, + Name: "success more than max partially withdrawals", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 0, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(1, 22), partialWithdrawal(2, 23), partialWithdrawal(3, 24), - partialWithdrawal(4, 25), partialWithdrawal(5, 26), partialWithdrawal(6, 27), - partialWithdrawal(7, 28), partialWithdrawal(8, 29), partialWithdrawal(9, 30), - partialWithdrawal(21, 31), partialWithdrawal(22, 32), partialWithdrawal(23, 33), - partialWithdrawal(24, 34), partialWithdrawal(25, 35), partialWithdrawal(26, 36), - partialWithdrawal(27, 37), + PendingPartialWithdrawal(1, 22), PendingPartialWithdrawal(2, 23), PendingPartialWithdrawal(3, 24), + PendingPartialWithdrawal(4, 25), PendingPartialWithdrawal(5, 26), PendingPartialWithdrawal(6, 27), + PendingPartialWithdrawal(7, 28), PendingPartialWithdrawal(8, 29), PendingPartialWithdrawal(9, 30), + PendingPartialWithdrawal(21, 31), PendingPartialWithdrawal(22, 32), PendingPartialWithdrawal(23, 33), + PendingPartialWithdrawal(24, 34), PendingPartialWithdrawal(25, 35), PendingPartialWithdrawal(26, 36), + PendingPartialWithdrawal(27, 37), }, }, Control: control{ @@ -914,12 +914,12 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "failure wrong number of partial withdrawal", - NextWithdrawalIndex: 21, - NextWithdrawalValidatorIndex: 37, - PartialWithdrawalIndices: []primitives.ValidatorIndex{7}, + Name: "failure wrong number of partial withdrawal", + NextWithdrawalIndex: 21, + NextWithdrawalValidatorIndex: 37, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7}, Withdrawals: []*enginev1.Withdrawal{ - partialWithdrawal(7, 21), partialWithdrawal(9, 22), + PendingPartialWithdrawal(7, 21), PendingPartialWithdrawal(9, 22), }, }, Control: control{ @@ -963,7 +963,7 @@ func TestProcessWithdrawals(t *testing.T) { NextWithdrawalValidatorIndex: 4, FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28, 1}, Withdrawals: []*enginev1.Withdrawal{ - fullWithdrawal(7, 22), fullWithdrawal(19, 23), partialWithdrawal(28, 24), + fullWithdrawal(7, 22), fullWithdrawal(19, 23), PendingPartialWithdrawal(28, 24), fullWithdrawal(1, 25), }, }, @@ -987,10 +987,10 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "failure validator not partially withdrawable", - NextWithdrawalIndex: 22, - NextWithdrawalValidatorIndex: 4, - PartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable}, + Name: "failure validator not partially withdrawable", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 4, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable}, Withdrawals: []*enginev1.Withdrawal{ fullWithdrawal(notPartiallyWithdrawable, 22), }, @@ -1034,7 +1034,7 @@ func TestProcessWithdrawals(t *testing.T) { st.Balances[idx] = withdrawalAmount(idx) validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte } - for _, idx := range arguments.PartialWithdrawalIndices { + for _, idx := range arguments.PendingPartialWithdrawalIndices { validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte st.Balances[idx] = withdrawalAmount(idx) } @@ -1052,8 +1052,8 @@ func TestProcessWithdrawals(t *testing.T) { if test.Args.FullWithdrawalIndices == nil { test.Args.FullWithdrawalIndices = make([]primitives.ValidatorIndex, 0) } - if test.Args.PartialWithdrawalIndices == nil { - test.Args.PartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0) + if test.Args.PendingPartialWithdrawalIndices == nil { + test.Args.PendingPartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0) } slot, err := slots.EpochStart(currentEpoch) require.NoError(t, err) diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index fbc7c41b8bde..b9ed255a5243 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -41,9 +41,13 @@ ssz_gen_marshal( "ExecutionPayloadHeaderCapella", "ExecutionPayloadHeaderDeneb", "ExecutionPayloadDeneb", + "ExecutionPayloadHeaderElectra", + "ExecutionPayloadElectra", "BlindedBlobsBundle", "BlobsBundle", "Withdrawal", + "ExecutionLayerWithdrawalRequest", + "DepositReceipt", ], ) diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index 6ba71b3cc5a5..35ca25671afe 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -78,7 +78,7 @@ func (x PayloadStatus_Status) Number() protoreflect.EnumNumber { // Deprecated: Use PayloadStatus_Status.Descriptor instead. func (PayloadStatus_Status) EnumDescriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12, 0} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14, 0} } type ExecutionPayload struct { @@ -621,6 +621,197 @@ func (x *ExecutionPayloadDeneb) GetExcessBlobGas() uint64 { return 0 } +type ExecutionPayloadElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` + FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` + StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` + LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` + PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` + BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` + BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` + Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` + Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` + BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` + ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` + DepositReceipts []*DepositReceipt `protobuf:"bytes,18,rep,name=deposit_receipts,json=depositReceipts,proto3" json:"deposit_receipts,omitempty" ssz-max:"8192"` + WithdrawalRequests []*ExecutionLayerWithdrawalRequest `protobuf:"bytes,19,rep,name=withdrawal_requests,json=withdrawalRequests,proto3" json:"withdrawal_requests,omitempty" ssz-max:"16"` +} + +func (x *ExecutionPayloadElectra) Reset() { + *x = ExecutionPayloadElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecutionPayloadElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionPayloadElectra) ProtoMessage() {} + +func (x *ExecutionPayloadElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionPayloadElectra.ProtoReflect.Descriptor instead. +func (*ExecutionPayloadElectra) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} +} + +func (x *ExecutionPayloadElectra) GetParentHash() []byte { + if x != nil { + return x.ParentHash + } + return nil +} + +func (x *ExecutionPayloadElectra) GetFeeRecipient() []byte { + if x != nil { + return x.FeeRecipient + } + return nil +} + +func (x *ExecutionPayloadElectra) GetStateRoot() []byte { + if x != nil { + return x.StateRoot + } + return nil +} + +func (x *ExecutionPayloadElectra) GetReceiptsRoot() []byte { + if x != nil { + return x.ReceiptsRoot + } + return nil +} + +func (x *ExecutionPayloadElectra) GetLogsBloom() []byte { + if x != nil { + return x.LogsBloom + } + return nil +} + +func (x *ExecutionPayloadElectra) GetPrevRandao() []byte { + if x != nil { + return x.PrevRandao + } + return nil +} + +func (x *ExecutionPayloadElectra) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *ExecutionPayloadElectra) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit + } + return 0 +} + +func (x *ExecutionPayloadElectra) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed + } + return 0 +} + +func (x *ExecutionPayloadElectra) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *ExecutionPayloadElectra) GetExtraData() []byte { + if x != nil { + return x.ExtraData + } + return nil +} + +func (x *ExecutionPayloadElectra) GetBaseFeePerGas() []byte { + if x != nil { + return x.BaseFeePerGas + } + return nil +} + +func (x *ExecutionPayloadElectra) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *ExecutionPayloadElectra) GetTransactions() [][]byte { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *ExecutionPayloadElectra) GetWithdrawals() []*Withdrawal { + if x != nil { + return x.Withdrawals + } + return nil +} + +func (x *ExecutionPayloadElectra) GetBlobGasUsed() uint64 { + if x != nil { + return x.BlobGasUsed + } + return 0 +} + +func (x *ExecutionPayloadElectra) GetExcessBlobGas() uint64 { + if x != nil { + return x.ExcessBlobGas + } + return 0 +} + +func (x *ExecutionPayloadElectra) GetDepositReceipts() []*DepositReceipt { + if x != nil { + return x.DepositReceipts + } + return nil +} + +func (x *ExecutionPayloadElectra) GetWithdrawalRequests() []*ExecutionLayerWithdrawalRequest { + if x != nil { + return x.WithdrawalRequests + } + return nil +} + type ExecutionPayloadCapellaWithValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -633,7 +824,7 @@ type ExecutionPayloadCapellaWithValue struct { func (x *ExecutionPayloadCapellaWithValue) Reset() { *x = ExecutionPayloadCapellaWithValue{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +837,7 @@ func (x *ExecutionPayloadCapellaWithValue) String() string { func (*ExecutionPayloadCapellaWithValue) ProtoMessage() {} func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +850,7 @@ func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadCapellaWithValue.ProtoReflect.Descriptor instead. func (*ExecutionPayloadCapellaWithValue) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} } func (x *ExecutionPayloadCapellaWithValue) GetPayload() *ExecutionPayloadCapella { @@ -690,7 +881,7 @@ type ExecutionPayloadDenebWithValueAndBlobsBundle struct { func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) Reset() { *x = ExecutionPayloadDenebWithValueAndBlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -703,7 +894,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) String() string { func (*ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoMessage() {} func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -716,7 +907,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protorefle // Deprecated: Use ExecutionPayloadDenebWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. func (*ExecutionPayloadDenebWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} } func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadDeneb { @@ -771,7 +962,7 @@ type ExecutionPayloadHeader struct { func (x *ExecutionPayloadHeader) Reset() { *x = ExecutionPayloadHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -784,7 +975,7 @@ func (x *ExecutionPayloadHeader) String() string { func (*ExecutionPayloadHeader) ProtoMessage() {} func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -797,7 +988,7 @@ func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeader.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeader) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} } func (x *ExecutionPayloadHeader) GetParentHash() []byte { @@ -923,7 +1114,7 @@ type ExecutionPayloadHeaderCapella struct { func (x *ExecutionPayloadHeaderCapella) Reset() { *x = ExecutionPayloadHeaderCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -936,7 +1127,7 @@ func (x *ExecutionPayloadHeaderCapella) String() string { func (*ExecutionPayloadHeaderCapella) ProtoMessage() {} func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -949,7 +1140,7 @@ func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderCapella.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderCapella) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} } func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte { @@ -1084,7 +1275,7 @@ type ExecutionPayloadHeaderDeneb struct { func (x *ExecutionPayloadHeaderDeneb) Reset() { *x = ExecutionPayloadHeaderDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1097,7 +1288,7 @@ func (x *ExecutionPayloadHeaderDeneb) String() string { func (*ExecutionPayloadHeaderDeneb) ProtoMessage() {} func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1110,7 +1301,7 @@ func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderDeneb.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderDeneb) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} } func (x *ExecutionPayloadHeaderDeneb) GetParentHash() []byte { @@ -1232,33 +1423,49 @@ func (x *ExecutionPayloadHeaderDeneb) GetExcessBlobGas() uint64 { return 0 } -type PayloadAttributes struct { +type ExecutionPayloadHeaderElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PrevRandao []byte `protobuf:"bytes,2,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - SuggestedFeeRecipient []byte `protobuf:"bytes,3,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty" ssz-size:"20"` -} - -func (x *PayloadAttributes) Reset() { - *x = PayloadAttributes{} + ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` + FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` + StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` + LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` + PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` + BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` + BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` + TransactionsRoot []byte `protobuf:"bytes,14,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty" ssz-size:"32"` + WithdrawalsRoot []byte `protobuf:"bytes,15,opt,name=withdrawals_root,json=withdrawalsRoot,proto3" json:"withdrawals_root,omitempty" ssz-size:"32"` + BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` + ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` + DepositReceiptsRoot []byte `protobuf:"bytes,18,opt,name=deposit_receipts_root,json=depositReceiptsRoot,proto3" json:"deposit_receipts_root,omitempty" ssz-size:"32"` + WithdrawalRequestsRoot []byte `protobuf:"bytes,19,opt,name=withdrawal_requests_root,json=withdrawalRequestsRoot,proto3" json:"withdrawal_requests_root,omitempty" ssz-size:"32"` +} + +func (x *ExecutionPayloadHeaderElectra) Reset() { + *x = ExecutionPayloadHeaderElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *PayloadAttributes) String() string { +func (x *ExecutionPayloadHeaderElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PayloadAttributes) ProtoMessage() {} +func (*ExecutionPayloadHeaderElectra) ProtoMessage() {} -func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] +func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1269,83 +1476,258 @@ func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead. -func (*PayloadAttributes) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} +// Deprecated: Use ExecutionPayloadHeaderElectra.ProtoReflect.Descriptor instead. +func (*ExecutionPayloadHeaderElectra) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} } -func (x *PayloadAttributes) GetTimestamp() uint64 { +func (x *ExecutionPayloadHeaderElectra) GetParentHash() []byte { if x != nil { - return x.Timestamp + return x.ParentHash } - return 0 + return nil } -func (x *PayloadAttributes) GetPrevRandao() []byte { +func (x *ExecutionPayloadHeaderElectra) GetFeeRecipient() []byte { if x != nil { - return x.PrevRandao + return x.FeeRecipient } return nil } -func (x *PayloadAttributes) GetSuggestedFeeRecipient() []byte { +func (x *ExecutionPayloadHeaderElectra) GetStateRoot() []byte { if x != nil { - return x.SuggestedFeeRecipient + return x.StateRoot } return nil } -type PayloadAttributesV2 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PrevRandao []byte `protobuf:"bytes,2,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - SuggestedFeeRecipient []byte `protobuf:"bytes,3,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty" ssz-size:"20"` - Withdrawals []*Withdrawal `protobuf:"bytes,4,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` +func (x *ExecutionPayloadHeaderElectra) GetReceiptsRoot() []byte { + if x != nil { + return x.ReceiptsRoot + } + return nil } -func (x *PayloadAttributesV2) Reset() { - *x = PayloadAttributesV2{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *ExecutionPayloadHeaderElectra) GetLogsBloom() []byte { + if x != nil { + return x.LogsBloom } + return nil } -func (x *PayloadAttributesV2) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *ExecutionPayloadHeaderElectra) GetPrevRandao() []byte { + if x != nil { + return x.PrevRandao + } + return nil } -func (*PayloadAttributesV2) ProtoMessage() {} +func (x *ExecutionPayloadHeaderElectra) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} -func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *ExecutionPayloadHeaderElectra) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit } - return mi.MessageOf(x) + return 0 } -// Deprecated: Use PayloadAttributesV2.ProtoReflect.Descriptor instead. -func (*PayloadAttributesV2) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} +func (x *ExecutionPayloadHeaderElectra) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed + } + return 0 } -func (x *PayloadAttributesV2) GetTimestamp() uint64 { +func (x *ExecutionPayloadHeaderElectra) GetTimestamp() uint64 { if x != nil { return x.Timestamp } return 0 } -func (x *PayloadAttributesV2) GetPrevRandao() []byte { +func (x *ExecutionPayloadHeaderElectra) GetExtraData() []byte { + if x != nil { + return x.ExtraData + } + return nil +} + +func (x *ExecutionPayloadHeaderElectra) GetBaseFeePerGas() []byte { + if x != nil { + return x.BaseFeePerGas + } + return nil +} + +func (x *ExecutionPayloadHeaderElectra) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *ExecutionPayloadHeaderElectra) GetTransactionsRoot() []byte { + if x != nil { + return x.TransactionsRoot + } + return nil +} + +func (x *ExecutionPayloadHeaderElectra) GetWithdrawalsRoot() []byte { + if x != nil { + return x.WithdrawalsRoot + } + return nil +} + +func (x *ExecutionPayloadHeaderElectra) GetBlobGasUsed() uint64 { + if x != nil { + return x.BlobGasUsed + } + return 0 +} + +func (x *ExecutionPayloadHeaderElectra) GetExcessBlobGas() uint64 { + if x != nil { + return x.ExcessBlobGas + } + return 0 +} + +func (x *ExecutionPayloadHeaderElectra) GetDepositReceiptsRoot() []byte { + if x != nil { + return x.DepositReceiptsRoot + } + return nil +} + +func (x *ExecutionPayloadHeaderElectra) GetWithdrawalRequestsRoot() []byte { + if x != nil { + return x.WithdrawalRequestsRoot + } + return nil +} + +type PayloadAttributes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PrevRandao []byte `protobuf:"bytes,2,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + SuggestedFeeRecipient []byte `protobuf:"bytes,3,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty" ssz-size:"20"` +} + +func (x *PayloadAttributes) Reset() { + *x = PayloadAttributes{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayloadAttributes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayloadAttributes) ProtoMessage() {} + +func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead. +func (*PayloadAttributes) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} +} + +func (x *PayloadAttributes) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *PayloadAttributes) GetPrevRandao() []byte { + if x != nil { + return x.PrevRandao + } + return nil +} + +func (x *PayloadAttributes) GetSuggestedFeeRecipient() []byte { + if x != nil { + return x.SuggestedFeeRecipient + } + return nil +} + +type PayloadAttributesV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PrevRandao []byte `protobuf:"bytes,2,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + SuggestedFeeRecipient []byte `protobuf:"bytes,3,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty" ssz-size:"20"` + Withdrawals []*Withdrawal `protobuf:"bytes,4,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` +} + +func (x *PayloadAttributesV2) Reset() { + *x = PayloadAttributesV2{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayloadAttributesV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayloadAttributesV2) ProtoMessage() {} + +func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayloadAttributesV2.ProtoReflect.Descriptor instead. +func (*PayloadAttributesV2) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} +} + +func (x *PayloadAttributesV2) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *PayloadAttributesV2) GetPrevRandao() []byte { if x != nil { return x.PrevRandao } @@ -1381,7 +1763,7 @@ type PayloadAttributesV3 struct { func (x *PayloadAttributesV3) Reset() { *x = PayloadAttributesV3{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1394,7 +1776,7 @@ func (x *PayloadAttributesV3) String() string { func (*PayloadAttributesV3) ProtoMessage() {} func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1407,7 +1789,7 @@ func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV3.ProtoReflect.Descriptor instead. func (*PayloadAttributesV3) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} } func (x *PayloadAttributesV3) GetTimestamp() uint64 { @@ -1458,7 +1840,7 @@ type PayloadStatus struct { func (x *PayloadStatus) Reset() { *x = PayloadStatus{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1471,7 +1853,7 @@ func (x *PayloadStatus) String() string { func (*PayloadStatus) ProtoMessage() {} func (x *PayloadStatus) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1484,7 +1866,7 @@ func (x *PayloadStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadStatus.ProtoReflect.Descriptor instead. func (*PayloadStatus) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} } func (x *PayloadStatus) GetStatus() PayloadStatus_Status { @@ -1521,7 +1903,7 @@ type ForkchoiceState struct { func (x *ForkchoiceState) Reset() { *x = ForkchoiceState{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1534,7 +1916,7 @@ func (x *ForkchoiceState) String() string { func (*ForkchoiceState) ProtoMessage() {} func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1547,7 +1929,7 @@ func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkchoiceState.ProtoReflect.Descriptor instead. func (*ForkchoiceState) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} } func (x *ForkchoiceState) GetHeadBlockHash() []byte { @@ -1585,7 +1967,7 @@ type Withdrawal struct { func (x *Withdrawal) Reset() { *x = Withdrawal{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1598,7 +1980,7 @@ func (x *Withdrawal) String() string { func (*Withdrawal) ProtoMessage() {} func (x *Withdrawal) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1611,7 +1993,7 @@ func (x *Withdrawal) ProtoReflect() protoreflect.Message { // Deprecated: Use Withdrawal.ProtoReflect.Descriptor instead. func (*Withdrawal) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} } func (x *Withdrawal) GetIndex() uint64 { @@ -1655,7 +2037,7 @@ type BlobsBundle struct { func (x *BlobsBundle) Reset() { *x = BlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1668,7 +2050,7 @@ func (x *BlobsBundle) String() string { func (*BlobsBundle) ProtoMessage() {} func (x *BlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1681,7 +2063,7 @@ func (x *BlobsBundle) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobsBundle.ProtoReflect.Descriptor instead. func (*BlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} } func (x *BlobsBundle) GetKzgCommitments() [][]byte { @@ -1716,7 +2098,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1729,7 +2111,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1742,7 +2124,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message { // Deprecated: Use Blob.ProtoReflect.Descriptor instead. func (*Blob) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{18} } func (x *Blob) GetData() []byte { @@ -1763,7 +2145,7 @@ type ExchangeCapabilities struct { func (x *ExchangeCapabilities) Reset() { *x = ExchangeCapabilities{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1776,7 +2158,7 @@ func (x *ExchangeCapabilities) String() string { func (*ExchangeCapabilities) ProtoMessage() {} func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1789,7 +2171,7 @@ func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeCapabilities.ProtoReflect.Descriptor instead. func (*ExchangeCapabilities) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{19} } func (x *ExchangeCapabilities) GetSupportedMethods() []string { @@ -1799,6 +2181,148 @@ func (x *ExchangeCapabilities) GetSupportedMethods() []string { return nil } +type ExecutionLayerWithdrawalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress []byte `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" ssz-size:"20"` + ValidatorPubkey []byte `protobuf:"bytes,2,opt,name=validator_pubkey,json=validatorPubkey,proto3" json:"validator_pubkey,omitempty" ssz-size:"48"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *ExecutionLayerWithdrawalRequest) Reset() { + *x = ExecutionLayerWithdrawalRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecutionLayerWithdrawalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionLayerWithdrawalRequest) ProtoMessage() {} + +func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionLayerWithdrawalRequest.ProtoReflect.Descriptor instead. +func (*ExecutionLayerWithdrawalRequest) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} +} + +func (x *ExecutionLayerWithdrawalRequest) GetSourceAddress() []byte { + if x != nil { + return x.SourceAddress + } + return nil +} + +func (x *ExecutionLayerWithdrawalRequest) GetValidatorPubkey() []byte { + if x != nil { + return x.ValidatorPubkey + } + return nil +} + +func (x *ExecutionLayerWithdrawalRequest) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +type DepositReceipt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` + WithdrawalCredentials []byte `protobuf:"bytes,2,opt,name=withdrawal_credentials,json=withdrawalCredentials,proto3" json:"withdrawal_credentials,omitempty" ssz-size:"32"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + Index uint64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *DepositReceipt) Reset() { + *x = DepositReceipt{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DepositReceipt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DepositReceipt) ProtoMessage() {} + +func (x *DepositReceipt) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DepositReceipt.ProtoReflect.Descriptor instead. +func (*DepositReceipt) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} +} + +func (x *DepositReceipt) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +func (x *DepositReceipt) GetWithdrawalCredentials() []byte { + if x != nil { + return x.WithdrawalCredentials + } + return nil +} + +func (x *DepositReceipt) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *DepositReceipt) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *DepositReceipt) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + var File_proto_engine_v1_execution_engine_proto protoreflect.FileDescriptor var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ @@ -1940,264 +2464,397 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, - 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, - 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, - 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, - 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, - 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, - 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, - 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, - 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, - 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, - 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, - 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, - 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, - 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, - 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, - 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, - 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, - 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, - 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, - 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, - 0xc4, 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, - 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, - 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, - 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, - 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, - 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, - 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, - 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, - 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, - 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, - 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, - 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, - 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, - 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, - 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xa7, 0x02, 0x0a, - 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, - 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, - 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x11, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, - 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, - 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, 0x4e, 0x43, - 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, - 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, - 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, 0xab, 0x01, 0x0a, 0x0f, - 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0xac, 0x07, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, + 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, + 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, + 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, + 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, + 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, + 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, + 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, + 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, + 0x03, 0x3f, 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, + 0x31, 0x30, 0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x57, + 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x42, 0x08, 0x92, 0xb5, + 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x13, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x13, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, + 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, + 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, + 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, + 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, + 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, + 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, + 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, + 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, + 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, + 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, + 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, + 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0a, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x78, - 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, - 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, - 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x0e, 0x6b, - 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, - 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, - 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, - 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, - 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, - 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x14, 0x45, - 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, - 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, + 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, + 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, + 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, + 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, + 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, + 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, + 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, + 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, + 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, + 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, + 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, + 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, + 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, + 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, + 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, + 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, + 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, + 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, + 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, + 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, + 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0xc4, 0x06, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, + 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, + 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, + 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, + 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, + 0x0a, 0x15, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, + 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, + 0x11, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, + 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, + 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, + 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, + 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, + 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, + 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, + 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x32, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, + 0x60, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, + 0x0a, 0x07, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, + 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, + 0x05, 0x22, 0xab, 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, + 0xd6, 0x01, 0x0a, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, + 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, + 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, + 0x30, 0x39, 0x36, 0x52, 0x0e, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, + 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, + 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, + 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, + 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, + 0x62, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x43, 0x0a, 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x1f, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, + 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2213,43 +2870,50 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte { } var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload (*ExecutionPayloadBodyV1)(nil), // 2: ethereum.engine.v1.ExecutionPayloadBodyV1 (*ExecutionPayloadCapella)(nil), // 3: ethereum.engine.v1.ExecutionPayloadCapella (*ExecutionPayloadDeneb)(nil), // 4: ethereum.engine.v1.ExecutionPayloadDeneb - (*ExecutionPayloadCapellaWithValue)(nil), // 5: ethereum.engine.v1.ExecutionPayloadCapellaWithValue - (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 6: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle - (*ExecutionPayloadHeader)(nil), // 7: ethereum.engine.v1.ExecutionPayloadHeader - (*ExecutionPayloadHeaderCapella)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*ExecutionPayloadHeaderDeneb)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeaderDeneb - (*PayloadAttributes)(nil), // 10: ethereum.engine.v1.PayloadAttributes - (*PayloadAttributesV2)(nil), // 11: ethereum.engine.v1.PayloadAttributesV2 - (*PayloadAttributesV3)(nil), // 12: ethereum.engine.v1.PayloadAttributesV3 - (*PayloadStatus)(nil), // 13: ethereum.engine.v1.PayloadStatus - (*ForkchoiceState)(nil), // 14: ethereum.engine.v1.ForkchoiceState - (*Withdrawal)(nil), // 15: ethereum.engine.v1.Withdrawal - (*BlobsBundle)(nil), // 16: ethereum.engine.v1.BlobsBundle - (*Blob)(nil), // 17: ethereum.engine.v1.Blob - (*ExchangeCapabilities)(nil), // 18: ethereum.engine.v1.ExchangeCapabilities + (*ExecutionPayloadElectra)(nil), // 5: ethereum.engine.v1.ExecutionPayloadElectra + (*ExecutionPayloadCapellaWithValue)(nil), // 6: ethereum.engine.v1.ExecutionPayloadCapellaWithValue + (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 7: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle + (*ExecutionPayloadHeader)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeader + (*ExecutionPayloadHeaderCapella)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*ExecutionPayloadHeaderDeneb)(nil), // 10: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*ExecutionPayloadHeaderElectra)(nil), // 11: ethereum.engine.v1.ExecutionPayloadHeaderElectra + (*PayloadAttributes)(nil), // 12: ethereum.engine.v1.PayloadAttributes + (*PayloadAttributesV2)(nil), // 13: ethereum.engine.v1.PayloadAttributesV2 + (*PayloadAttributesV3)(nil), // 14: ethereum.engine.v1.PayloadAttributesV3 + (*PayloadStatus)(nil), // 15: ethereum.engine.v1.PayloadStatus + (*ForkchoiceState)(nil), // 16: ethereum.engine.v1.ForkchoiceState + (*Withdrawal)(nil), // 17: ethereum.engine.v1.Withdrawal + (*BlobsBundle)(nil), // 18: ethereum.engine.v1.BlobsBundle + (*Blob)(nil), // 19: ethereum.engine.v1.Blob + (*ExchangeCapabilities)(nil), // 20: ethereum.engine.v1.ExchangeCapabilities + (*ExecutionLayerWithdrawalRequest)(nil), // 21: ethereum.engine.v1.ExecutionLayerWithdrawalRequest + (*DepositReceipt)(nil), // 22: ethereum.engine.v1.DepositReceipt } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ - 15, // 0: ethereum.engine.v1.ExecutionPayloadBodyV1.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 15, // 1: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 15, // 2: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 3, // 3: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 4, // 4: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 16, // 5: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 15, // 6: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 15, // 7: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 0, // 8: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 17, // 0: ethereum.engine.v1.ExecutionPayloadBodyV1.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 1: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 2: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 3: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 22, // 4: ethereum.engine.v1.ExecutionPayloadElectra.deposit_receipts:type_name -> ethereum.engine.v1.DepositReceipt + 21, // 5: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.ExecutionLayerWithdrawalRequest + 3, // 6: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella + 4, // 7: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 18, // 8: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 17, // 9: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 10: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 0, // 11: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_proto_engine_v1_execution_engine_proto_init() } @@ -2307,7 +2971,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadCapellaWithValue); i { + switch v := v.(*ExecutionPayloadElectra); i { case 0: return &v.state case 1: @@ -2319,7 +2983,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { + switch v := v.(*ExecutionPayloadCapellaWithValue); i { case 0: return &v.state case 1: @@ -2331,7 +2995,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeader); i { + switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { case 0: return &v.state case 1: @@ -2343,7 +3007,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeaderCapella); i { + switch v := v.(*ExecutionPayloadHeader); i { case 0: return &v.state case 1: @@ -2355,7 +3019,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeaderDeneb); i { + switch v := v.(*ExecutionPayloadHeaderCapella); i { case 0: return &v.state case 1: @@ -2367,7 +3031,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttributes); i { + switch v := v.(*ExecutionPayloadHeaderDeneb); i { case 0: return &v.state case 1: @@ -2379,7 +3043,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttributesV2); i { + switch v := v.(*ExecutionPayloadHeaderElectra); i { case 0: return &v.state case 1: @@ -2391,7 +3055,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttributesV3); i { + switch v := v.(*PayloadAttributes); i { case 0: return &v.state case 1: @@ -2403,7 +3067,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadStatus); i { + switch v := v.(*PayloadAttributesV2); i { case 0: return &v.state case 1: @@ -2415,7 +3079,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForkchoiceState); i { + switch v := v.(*PayloadAttributesV3); i { case 0: return &v.state case 1: @@ -2427,7 +3091,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Withdrawal); i { + switch v := v.(*PayloadStatus); i { case 0: return &v.state case 1: @@ -2439,7 +3103,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobsBundle); i { + switch v := v.(*ForkchoiceState); i { case 0: return &v.state case 1: @@ -2451,7 +3115,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Blob); i { + switch v := v.(*Withdrawal); i { case 0: return &v.state case 1: @@ -2463,6 +3127,30 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlobsBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_execution_engine_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Blob); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_execution_engine_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExchangeCapabilities); i { case 0: return &v.state @@ -2474,6 +3162,30 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } + file_proto_engine_v1_execution_engine_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExecutionLayerWithdrawalRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_execution_engine_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DepositReceipt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2481,7 +3193,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc, NumEnums: 1, - NumMessages: 18, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index 5fea2f0f129a..8cfd0b60b2b2 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -86,6 +86,29 @@ message ExecutionPayloadDeneb { uint64 excess_blob_gas = 17; } +message ExecutionPayloadElectra { + bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"]; + bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"]; + bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 block_number = 7; + uint64 gas_limit = 8; + uint64 gas_used = 9; + uint64 timestamp = 10; + bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"]; + bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; + repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"]; + // MAX_WITHDRAWALS_PER_PAYLOAD + repeated Withdrawal withdrawals = 15 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"]; + uint64 blob_gas_used = 16; + uint64 excess_blob_gas = 17; + repeated DepositReceipt deposit_receipts = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_receipts"]; // new in electra, eip6110 + repeated ExecutionLayerWithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251 +} + message ExecutionPayloadCapellaWithValue { ExecutionPayloadCapella payload = 1; bytes value = 2; @@ -154,6 +177,28 @@ message ExecutionPayloadHeaderDeneb { uint64 excess_blob_gas = 17; } +message ExecutionPayloadHeaderElectra { + bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"]; + bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"]; + bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 block_number = 7; + uint64 gas_limit = 8; + uint64 gas_used = 9; + uint64 timestamp = 10; + bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"]; + bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes transactions_root = 14 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes withdrawals_root = 15 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 blob_gas_used = 16; + uint64 excess_blob_gas = 17; + bytes deposit_receipts_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110 + bytes withdrawal_requests_root = 19 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7002, eip7251 +} + message PayloadAttributes { uint64 timestamp = 1; bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"]; @@ -232,3 +277,26 @@ message Blob { message ExchangeCapabilities { repeated string supported_methods = 1; } + +// ExecutionLayerWithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address +// new in Electra +message ExecutionLayerWithdrawalRequest { + // The execution address receiving the funds + bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; + + // 48 byte BLS public key of the validator. + bytes validator_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; + + // Deposit amount in gwei. + uint64 amount = 3; +} + +// DepositReceipt is the message from the execution layer to trigger the deposit of a validator's balance to its balance +// new in Electra +message DepositReceipt { + bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"]; + bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 amount = 3; + bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"]; + uint64 index = 5; +} \ No newline at end of file diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index 6e164ada7125..2b122719efa9 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: e8f9a4c699c802862cb140f55ef852ca28470b77a6fb849b073efa92a5b1429b +// Hash: ee70c11ffb08b4e0b97fe19fdfdf1ce59c1474de33166d21d4fbd2f696c267ea package enginev1 import ( @@ -1314,15 +1314,922 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the ExecutionPayloadElectra object +func (e *ExecutionPayloadElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ExecutionPayloadElectra object to a target array +func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(536) + + // Field (0) 'ParentHash' + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + dst = append(dst, e.ParentHash...) + + // Field (1) 'FeeRecipient' + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + dst = append(dst, e.FeeRecipient...) + + // Field (2) 'StateRoot' + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, e.StateRoot...) + + // Field (3) 'ReceiptsRoot' + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) + return + } + dst = append(dst, e.ReceiptsRoot...) + + // Field (4) 'LogsBloom' + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) + return + } + dst = append(dst, e.LogsBloom...) + + // Field (5) 'PrevRandao' + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) + return + } + dst = append(dst, e.PrevRandao...) + + // Field (6) 'BlockNumber' + dst = ssz.MarshalUint64(dst, e.BlockNumber) + + // Field (7) 'GasLimit' + dst = ssz.MarshalUint64(dst, e.GasLimit) + + // Field (8) 'GasUsed' + dst = ssz.MarshalUint64(dst, e.GasUsed) + + // Field (9) 'Timestamp' + dst = ssz.MarshalUint64(dst, e.Timestamp) + + // Offset (10) 'ExtraData' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.ExtraData) + + // Field (11) 'BaseFeePerGas' + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + return + } + dst = append(dst, e.BaseFeePerGas...) + + // Field (12) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + dst = append(dst, e.BlockHash...) + + // Offset (13) 'Transactions' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(e.Transactions); ii++ { + offset += 4 + offset += len(e.Transactions[ii]) + } + + // Offset (14) 'Withdrawals' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.Withdrawals) * 44 + + // Field (15) 'BlobGasUsed' + dst = ssz.MarshalUint64(dst, e.BlobGasUsed) + + // Field (16) 'ExcessBlobGas' + dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) + + // Offset (17) 'DepositReceipts' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.DepositReceipts) * 192 + + // Offset (18) 'WithdrawalRequests' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.WithdrawalRequests) * 76 + + // Field (10) 'ExtraData' + if size := len(e.ExtraData); size > 32 { + err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) + return + } + dst = append(dst, e.ExtraData...) + + // Field (13) 'Transactions' + if size := len(e.Transactions); size > 1048576 { + err = ssz.ErrListTooBigFn("--.Transactions", size, 1048576) + return + } + { + offset = 4 * len(e.Transactions) + for ii := 0; ii < len(e.Transactions); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += len(e.Transactions[ii]) + } + } + for ii := 0; ii < len(e.Transactions); ii++ { + if size := len(e.Transactions[ii]); size > 1073741824 { + err = ssz.ErrBytesLengthFn("--.Transactions[ii]", size, 1073741824) + return + } + dst = append(dst, e.Transactions[ii]...) + } + + // Field (14) 'Withdrawals' + if size := len(e.Withdrawals); size > 16 { + err = ssz.ErrListTooBigFn("--.Withdrawals", size, 16) + return + } + for ii := 0; ii < len(e.Withdrawals); ii++ { + if dst, err = e.Withdrawals[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (17) 'DepositReceipts' + if size := len(e.DepositReceipts); size > 8192 { + err = ssz.ErrListTooBigFn("--.DepositReceipts", size, 8192) + return + } + for ii := 0; ii < len(e.DepositReceipts); ii++ { + if dst, err = e.DepositReceipts[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (18) 'WithdrawalRequests' + if size := len(e.WithdrawalRequests); size > 16 { + err = ssz.ErrListTooBigFn("--.WithdrawalRequests", size, 16) + return + } + for ii := 0; ii < len(e.WithdrawalRequests); ii++ { + if dst, err = e.WithdrawalRequests[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadElectra object +func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 536 { + return ssz.ErrSize + } + + tail := buf + var o10, o13, o14, o17, o18 uint64 + + // Field (0) 'ParentHash' + if cap(e.ParentHash) == 0 { + e.ParentHash = make([]byte, 0, len(buf[0:32])) + } + e.ParentHash = append(e.ParentHash, buf[0:32]...) + + // Field (1) 'FeeRecipient' + if cap(e.FeeRecipient) == 0 { + e.FeeRecipient = make([]byte, 0, len(buf[32:52])) + } + e.FeeRecipient = append(e.FeeRecipient, buf[32:52]...) + + // Field (2) 'StateRoot' + if cap(e.StateRoot) == 0 { + e.StateRoot = make([]byte, 0, len(buf[52:84])) + } + e.StateRoot = append(e.StateRoot, buf[52:84]...) + + // Field (3) 'ReceiptsRoot' + if cap(e.ReceiptsRoot) == 0 { + e.ReceiptsRoot = make([]byte, 0, len(buf[84:116])) + } + e.ReceiptsRoot = append(e.ReceiptsRoot, buf[84:116]...) + + // Field (4) 'LogsBloom' + if cap(e.LogsBloom) == 0 { + e.LogsBloom = make([]byte, 0, len(buf[116:372])) + } + e.LogsBloom = append(e.LogsBloom, buf[116:372]...) + + // Field (5) 'PrevRandao' + if cap(e.PrevRandao) == 0 { + e.PrevRandao = make([]byte, 0, len(buf[372:404])) + } + e.PrevRandao = append(e.PrevRandao, buf[372:404]...) + + // Field (6) 'BlockNumber' + e.BlockNumber = ssz.UnmarshallUint64(buf[404:412]) + + // Field (7) 'GasLimit' + e.GasLimit = ssz.UnmarshallUint64(buf[412:420]) + + // Field (8) 'GasUsed' + e.GasUsed = ssz.UnmarshallUint64(buf[420:428]) + + // Field (9) 'Timestamp' + e.Timestamp = ssz.UnmarshallUint64(buf[428:436]) + + // Offset (10) 'ExtraData' + if o10 = ssz.ReadOffset(buf[436:440]); o10 > size { + return ssz.ErrOffset + } + + if o10 < 536 { + return ssz.ErrInvalidVariableOffset + } + + // Field (11) 'BaseFeePerGas' + if cap(e.BaseFeePerGas) == 0 { + e.BaseFeePerGas = make([]byte, 0, len(buf[440:472])) + } + e.BaseFeePerGas = append(e.BaseFeePerGas, buf[440:472]...) + + // Field (12) 'BlockHash' + if cap(e.BlockHash) == 0 { + e.BlockHash = make([]byte, 0, len(buf[472:504])) + } + e.BlockHash = append(e.BlockHash, buf[472:504]...) + + // Offset (13) 'Transactions' + if o13 = ssz.ReadOffset(buf[504:508]); o13 > size || o10 > o13 { + return ssz.ErrOffset + } + + // Offset (14) 'Withdrawals' + if o14 = ssz.ReadOffset(buf[508:512]); o14 > size || o13 > o14 { + return ssz.ErrOffset + } + + // Field (15) 'BlobGasUsed' + e.BlobGasUsed = ssz.UnmarshallUint64(buf[512:520]) + + // Field (16) 'ExcessBlobGas' + e.ExcessBlobGas = ssz.UnmarshallUint64(buf[520:528]) + + // Offset (17) 'DepositReceipts' + if o17 = ssz.ReadOffset(buf[528:532]); o17 > size || o14 > o17 { + return ssz.ErrOffset + } + + // Offset (18) 'WithdrawalRequests' + if o18 = ssz.ReadOffset(buf[532:536]); o18 > size || o17 > o18 { + return ssz.ErrOffset + } + + // Field (10) 'ExtraData' + { + buf = tail[o10:o13] + if len(buf) > 32 { + return ssz.ErrBytesLength + } + if cap(e.ExtraData) == 0 { + e.ExtraData = make([]byte, 0, len(buf)) + } + e.ExtraData = append(e.ExtraData, buf...) + } + + // Field (13) 'Transactions' + { + buf = tail[o13:o14] + num, err := ssz.DecodeDynamicLength(buf, 1048576) + if err != nil { + return err + } + e.Transactions = make([][]byte, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if len(buf) > 1073741824 { + return ssz.ErrBytesLength + } + if cap(e.Transactions[indx]) == 0 { + e.Transactions[indx] = make([]byte, 0, len(buf)) + } + e.Transactions[indx] = append(e.Transactions[indx], buf...) + return nil + }) + if err != nil { + return err + } + } + + // Field (14) 'Withdrawals' + { + buf = tail[o14:o17] + num, err := ssz.DivideInt2(len(buf), 44, 16) + if err != nil { + return err + } + e.Withdrawals = make([]*Withdrawal, num) + for ii := 0; ii < num; ii++ { + if e.Withdrawals[ii] == nil { + e.Withdrawals[ii] = new(Withdrawal) + } + if err = e.Withdrawals[ii].UnmarshalSSZ(buf[ii*44 : (ii+1)*44]); err != nil { + return err + } + } + } + + // Field (17) 'DepositReceipts' + { + buf = tail[o17:o18] + num, err := ssz.DivideInt2(len(buf), 192, 8192) + if err != nil { + return err + } + e.DepositReceipts = make([]*DepositReceipt, num) + for ii := 0; ii < num; ii++ { + if e.DepositReceipts[ii] == nil { + e.DepositReceipts[ii] = new(DepositReceipt) + } + if err = e.DepositReceipts[ii].UnmarshalSSZ(buf[ii*192 : (ii+1)*192]); err != nil { + return err + } + } + } + + // Field (18) 'WithdrawalRequests' + { + buf = tail[o18:] + num, err := ssz.DivideInt2(len(buf), 76, 16) + if err != nil { + return err + } + e.WithdrawalRequests = make([]*ExecutionLayerWithdrawalRequest, num) + for ii := 0; ii < num; ii++ { + if e.WithdrawalRequests[ii] == nil { + e.WithdrawalRequests[ii] = new(ExecutionLayerWithdrawalRequest) + } + if err = e.WithdrawalRequests[ii].UnmarshalSSZ(buf[ii*76 : (ii+1)*76]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadElectra object +func (e *ExecutionPayloadElectra) SizeSSZ() (size int) { + size = 536 + + // Field (10) 'ExtraData' + size += len(e.ExtraData) + + // Field (13) 'Transactions' + for ii := 0; ii < len(e.Transactions); ii++ { + size += 4 + size += len(e.Transactions[ii]) + } + + // Field (14) 'Withdrawals' + size += len(e.Withdrawals) * 44 + + // Field (17) 'DepositReceipts' + size += len(e.DepositReceipts) * 192 + + // Field (18) 'WithdrawalRequests' + size += len(e.WithdrawalRequests) * 76 + + return +} + +// HashTreeRoot ssz hashes the ExecutionPayloadElectra object +func (e *ExecutionPayloadElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the ExecutionPayloadElectra object with a hasher +func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ParentHash' + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + hh.PutBytes(e.ParentHash) + + // Field (1) 'FeeRecipient' + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + hh.PutBytes(e.FeeRecipient) + + // Field (2) 'StateRoot' + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(e.StateRoot) + + // Field (3) 'ReceiptsRoot' + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) + return + } + hh.PutBytes(e.ReceiptsRoot) + + // Field (4) 'LogsBloom' + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) + return + } + hh.PutBytes(e.LogsBloom) + + // Field (5) 'PrevRandao' + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) + return + } + hh.PutBytes(e.PrevRandao) + + // Field (6) 'BlockNumber' + hh.PutUint64(e.BlockNumber) + + // Field (7) 'GasLimit' + hh.PutUint64(e.GasLimit) + + // Field (8) 'GasUsed' + hh.PutUint64(e.GasUsed) + + // Field (9) 'Timestamp' + hh.PutUint64(e.Timestamp) + + // Field (10) 'ExtraData' + { + elemIndx := hh.Index() + byteLen := uint64(len(e.ExtraData)) + if byteLen > 32 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(e.ExtraData) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) + } + } + + // Field (11) 'BaseFeePerGas' + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + return + } + hh.PutBytes(e.BaseFeePerGas) + + // Field (12) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + hh.PutBytes(e.BlockHash) + + // Field (13) 'Transactions' + { + subIndx := hh.Index() + num := uint64(len(e.Transactions)) + if num > 1048576 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.Transactions { + { + elemIndx := hh.Index() + byteLen := uint64(len(elem)) + if byteLen > 1073741824 { + err = ssz.ErrIncorrectListSize + return + } + hh.AppendBytes32(elem) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) + } + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1048576) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1048576) + } + } + + // Field (14) 'Withdrawals' + { + subIndx := hh.Index() + num := uint64(len(e.Withdrawals)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.Withdrawals { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + // Field (15) 'BlobGasUsed' + hh.PutUint64(e.BlobGasUsed) + + // Field (16) 'ExcessBlobGas' + hh.PutUint64(e.ExcessBlobGas) + + // Field (17) 'DepositReceipts' + { + subIndx := hh.Index() + num := uint64(len(e.DepositReceipts)) + if num > 8192 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.DepositReceipts { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8192) + } else { + hh.MerkleizeWithMixin(subIndx, num, 8192) + } + } + + // Field (18) 'WithdrawalRequests' + { + subIndx := hh.Index() + num := uint64(len(e.WithdrawalRequests)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.WithdrawalRequests { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the ExecutionPayloadHeader object func (e *ExecutionPayloadHeader) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(e) } -// MarshalSSZTo ssz marshals the ExecutionPayloadHeader object to a target array -func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ExecutionPayloadHeader object to a target array +func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(536) + + // Field (0) 'ParentHash' + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + dst = append(dst, e.ParentHash...) + + // Field (1) 'FeeRecipient' + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + dst = append(dst, e.FeeRecipient...) + + // Field (2) 'StateRoot' + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, e.StateRoot...) + + // Field (3) 'ReceiptsRoot' + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) + return + } + dst = append(dst, e.ReceiptsRoot...) + + // Field (4) 'LogsBloom' + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) + return + } + dst = append(dst, e.LogsBloom...) + + // Field (5) 'PrevRandao' + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) + return + } + dst = append(dst, e.PrevRandao...) + + // Field (6) 'BlockNumber' + dst = ssz.MarshalUint64(dst, e.BlockNumber) + + // Field (7) 'GasLimit' + dst = ssz.MarshalUint64(dst, e.GasLimit) + + // Field (8) 'GasUsed' + dst = ssz.MarshalUint64(dst, e.GasUsed) + + // Field (9) 'Timestamp' + dst = ssz.MarshalUint64(dst, e.Timestamp) + + // Offset (10) 'ExtraData' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.ExtraData) + + // Field (11) 'BaseFeePerGas' + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + return + } + dst = append(dst, e.BaseFeePerGas...) + + // Field (12) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + dst = append(dst, e.BlockHash...) + + // Field (13) 'TransactionsRoot' + if size := len(e.TransactionsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.TransactionsRoot", size, 32) + return + } + dst = append(dst, e.TransactionsRoot...) + + // Field (10) 'ExtraData' + if size := len(e.ExtraData); size > 32 { + err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) + return + } + dst = append(dst, e.ExtraData...) + + return +} + +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeader object +func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 536 { + return ssz.ErrSize + } + + tail := buf + var o10 uint64 + + // Field (0) 'ParentHash' + if cap(e.ParentHash) == 0 { + e.ParentHash = make([]byte, 0, len(buf[0:32])) + } + e.ParentHash = append(e.ParentHash, buf[0:32]...) + + // Field (1) 'FeeRecipient' + if cap(e.FeeRecipient) == 0 { + e.FeeRecipient = make([]byte, 0, len(buf[32:52])) + } + e.FeeRecipient = append(e.FeeRecipient, buf[32:52]...) + + // Field (2) 'StateRoot' + if cap(e.StateRoot) == 0 { + e.StateRoot = make([]byte, 0, len(buf[52:84])) + } + e.StateRoot = append(e.StateRoot, buf[52:84]...) + + // Field (3) 'ReceiptsRoot' + if cap(e.ReceiptsRoot) == 0 { + e.ReceiptsRoot = make([]byte, 0, len(buf[84:116])) + } + e.ReceiptsRoot = append(e.ReceiptsRoot, buf[84:116]...) + + // Field (4) 'LogsBloom' + if cap(e.LogsBloom) == 0 { + e.LogsBloom = make([]byte, 0, len(buf[116:372])) + } + e.LogsBloom = append(e.LogsBloom, buf[116:372]...) + + // Field (5) 'PrevRandao' + if cap(e.PrevRandao) == 0 { + e.PrevRandao = make([]byte, 0, len(buf[372:404])) + } + e.PrevRandao = append(e.PrevRandao, buf[372:404]...) + + // Field (6) 'BlockNumber' + e.BlockNumber = ssz.UnmarshallUint64(buf[404:412]) + + // Field (7) 'GasLimit' + e.GasLimit = ssz.UnmarshallUint64(buf[412:420]) + + // Field (8) 'GasUsed' + e.GasUsed = ssz.UnmarshallUint64(buf[420:428]) + + // Field (9) 'Timestamp' + e.Timestamp = ssz.UnmarshallUint64(buf[428:436]) + + // Offset (10) 'ExtraData' + if o10 = ssz.ReadOffset(buf[436:440]); o10 > size { + return ssz.ErrOffset + } + + if o10 < 536 { + return ssz.ErrInvalidVariableOffset + } + + // Field (11) 'BaseFeePerGas' + if cap(e.BaseFeePerGas) == 0 { + e.BaseFeePerGas = make([]byte, 0, len(buf[440:472])) + } + e.BaseFeePerGas = append(e.BaseFeePerGas, buf[440:472]...) + + // Field (12) 'BlockHash' + if cap(e.BlockHash) == 0 { + e.BlockHash = make([]byte, 0, len(buf[472:504])) + } + e.BlockHash = append(e.BlockHash, buf[472:504]...) + + // Field (13) 'TransactionsRoot' + if cap(e.TransactionsRoot) == 0 { + e.TransactionsRoot = make([]byte, 0, len(buf[504:536])) + } + e.TransactionsRoot = append(e.TransactionsRoot, buf[504:536]...) + + // Field (10) 'ExtraData' + { + buf = tail[o10:] + if len(buf) > 32 { + return ssz.ErrBytesLength + } + if cap(e.ExtraData) == 0 { + e.ExtraData = make([]byte, 0, len(buf)) + } + e.ExtraData = append(e.ExtraData, buf...) + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeader object +func (e *ExecutionPayloadHeader) SizeSSZ() (size int) { + size = 536 + + // Field (10) 'ExtraData' + size += len(e.ExtraData) + + return +} + +// HashTreeRoot ssz hashes the ExecutionPayloadHeader object +func (e *ExecutionPayloadHeader) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the ExecutionPayloadHeader object with a hasher +func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ParentHash' + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + hh.PutBytes(e.ParentHash) + + // Field (1) 'FeeRecipient' + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + hh.PutBytes(e.FeeRecipient) + + // Field (2) 'StateRoot' + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(e.StateRoot) + + // Field (3) 'ReceiptsRoot' + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) + return + } + hh.PutBytes(e.ReceiptsRoot) + + // Field (4) 'LogsBloom' + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) + return + } + hh.PutBytes(e.LogsBloom) + + // Field (5) 'PrevRandao' + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) + return + } + hh.PutBytes(e.PrevRandao) + + // Field (6) 'BlockNumber' + hh.PutUint64(e.BlockNumber) + + // Field (7) 'GasLimit' + hh.PutUint64(e.GasLimit) + + // Field (8) 'GasUsed' + hh.PutUint64(e.GasUsed) + + // Field (9) 'Timestamp' + hh.PutUint64(e.Timestamp) + + // Field (10) 'ExtraData' + { + elemIndx := hh.Index() + byteLen := uint64(len(e.ExtraData)) + if byteLen > 32 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(e.ExtraData) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) + } + } + + // Field (11) 'BaseFeePerGas' + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + return + } + hh.PutBytes(e.BaseFeePerGas) + + // Field (12) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + hh.PutBytes(e.BlockHash) + + // Field (13) 'TransactionsRoot' + if size := len(e.TransactionsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.TransactionsRoot", size, 32) + return + } + hh.PutBytes(e.TransactionsRoot) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the ExecutionPayloadHeaderCapella object +func (e *ExecutionPayloadHeaderCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderCapella object to a target array +func (e *ExecutionPayloadHeaderCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(536) + offset := int(568) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -1403,6 +2310,13 @@ func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error } dst = append(dst, e.TransactionsRoot...) + // Field (14) 'WithdrawalsRoot' + if size := len(e.WithdrawalsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalsRoot", size, 32) + return + } + dst = append(dst, e.WithdrawalsRoot...) + // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -1413,11 +2327,11 @@ func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeader object -func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderCapella object +func (e *ExecutionPayloadHeaderCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 536 { + if size < 568 { return ssz.ErrSize } @@ -1477,7 +2391,7 @@ func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 536 { + if o10 < 568 { return ssz.ErrInvalidVariableOffset } @@ -1499,6 +2413,12 @@ func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { } e.TransactionsRoot = append(e.TransactionsRoot, buf[504:536]...) + // Field (14) 'WithdrawalsRoot' + if cap(e.WithdrawalsRoot) == 0 { + e.WithdrawalsRoot = make([]byte, 0, len(buf[536:568])) + } + e.WithdrawalsRoot = append(e.WithdrawalsRoot, buf[536:568]...) + // Field (10) 'ExtraData' { buf = tail[o10:] @@ -1513,9 +2433,9 @@ func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeader object -func (e *ExecutionPayloadHeader) SizeSSZ() (size int) { - size = 536 +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderCapella object +func (e *ExecutionPayloadHeaderCapella) SizeSSZ() (size int) { + size = 568 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -1523,13 +2443,13 @@ func (e *ExecutionPayloadHeader) SizeSSZ() (size int) { return } -// HashTreeRoot ssz hashes the ExecutionPayloadHeader object -func (e *ExecutionPayloadHeader) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the ExecutionPayloadHeaderCapella object +func (e *ExecutionPayloadHeaderCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(e) } -// HashTreeRootWith ssz hashes the ExecutionPayloadHeader object with a hasher -func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderCapella object with a hasher +func (e *ExecutionPayloadHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' @@ -1623,6 +2543,13 @@ func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(e.TransactionsRoot) + // Field (14) 'WithdrawalsRoot' + if size := len(e.WithdrawalsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalsRoot", size, 32) + return + } + hh.PutBytes(e.WithdrawalsRoot) + if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) } else { @@ -1631,15 +2558,15 @@ func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the ExecutionPayloadHeaderCapella object -func (e *ExecutionPayloadHeaderCapella) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the ExecutionPayloadHeaderDeneb object +func (e *ExecutionPayloadHeaderDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(e) } -// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderCapella object to a target array -func (e *ExecutionPayloadHeaderCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderDeneb object to a target array +func (e *ExecutionPayloadHeaderDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(568) + offset := int(584) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -1727,6 +2654,12 @@ func (e *ExecutionPayloadHeaderCapella) MarshalSSZTo(buf []byte) (dst []byte, er } dst = append(dst, e.WithdrawalsRoot...) + // Field (15) 'BlobGasUsed' + dst = ssz.MarshalUint64(dst, e.BlobGasUsed) + + // Field (16) 'ExcessBlobGas' + dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) + // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -1737,11 +2670,11 @@ func (e *ExecutionPayloadHeaderCapella) MarshalSSZTo(buf []byte) (dst []byte, er return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderCapella object -func (e *ExecutionPayloadHeaderCapella) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderDeneb object +func (e *ExecutionPayloadHeaderDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 568 { + if size < 584 { return ssz.ErrSize } @@ -1801,7 +2734,7 @@ func (e *ExecutionPayloadHeaderCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 568 { + if o10 < 584 { return ssz.ErrInvalidVariableOffset } @@ -1829,6 +2762,12 @@ func (e *ExecutionPayloadHeaderCapella) UnmarshalSSZ(buf []byte) error { } e.WithdrawalsRoot = append(e.WithdrawalsRoot, buf[536:568]...) + // Field (15) 'BlobGasUsed' + e.BlobGasUsed = ssz.UnmarshallUint64(buf[568:576]) + + // Field (16) 'ExcessBlobGas' + e.ExcessBlobGas = ssz.UnmarshallUint64(buf[576:584]) + // Field (10) 'ExtraData' { buf = tail[o10:] @@ -1843,9 +2782,9 @@ func (e *ExecutionPayloadHeaderCapella) UnmarshalSSZ(buf []byte) error { return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderCapella object -func (e *ExecutionPayloadHeaderCapella) SizeSSZ() (size int) { - size = 568 +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderDeneb object +func (e *ExecutionPayloadHeaderDeneb) SizeSSZ() (size int) { + size = 584 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -1853,13 +2792,13 @@ func (e *ExecutionPayloadHeaderCapella) SizeSSZ() (size int) { return } -// HashTreeRoot ssz hashes the ExecutionPayloadHeaderCapella object -func (e *ExecutionPayloadHeaderCapella) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the ExecutionPayloadHeaderDeneb object +func (e *ExecutionPayloadHeaderDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(e) } -// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderCapella object with a hasher -func (e *ExecutionPayloadHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderDeneb object with a hasher +func (e *ExecutionPayloadHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' @@ -1960,6 +2899,12 @@ func (e *ExecutionPayloadHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err er } hh.PutBytes(e.WithdrawalsRoot) + // Field (15) 'BlobGasUsed' + hh.PutUint64(e.BlobGasUsed) + + // Field (16) 'ExcessBlobGas' + hh.PutUint64(e.ExcessBlobGas) + if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) } else { @@ -1968,15 +2913,15 @@ func (e *ExecutionPayloadHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } -// MarshalSSZ ssz marshals the ExecutionPayloadHeaderDeneb object -func (e *ExecutionPayloadHeaderDeneb) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the ExecutionPayloadHeaderElectra object +func (e *ExecutionPayloadHeaderElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(e) } -// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderDeneb object to a target array -func (e *ExecutionPayloadHeaderDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderElectra object to a target array +func (e *ExecutionPayloadHeaderElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(584) + offset := int(648) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -2070,6 +3015,20 @@ func (e *ExecutionPayloadHeaderDeneb) MarshalSSZTo(buf []byte) (dst []byte, err // Field (16) 'ExcessBlobGas' dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) + // Field (17) 'DepositReceiptsRoot' + if size := len(e.DepositReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositReceiptsRoot", size, 32) + return + } + dst = append(dst, e.DepositReceiptsRoot...) + + // Field (18) 'WithdrawalRequestsRoot' + if size := len(e.WithdrawalRequestsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalRequestsRoot", size, 32) + return + } + dst = append(dst, e.WithdrawalRequestsRoot...) + // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -2080,11 +3039,11 @@ func (e *ExecutionPayloadHeaderDeneb) MarshalSSZTo(buf []byte) (dst []byte, err return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderDeneb object -func (e *ExecutionPayloadHeaderDeneb) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderElectra object +func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 584 { + if size < 648 { return ssz.ErrSize } @@ -2144,7 +3103,7 @@ func (e *ExecutionPayloadHeaderDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 584 { + if o10 < 648 { return ssz.ErrInvalidVariableOffset } @@ -2178,6 +3137,18 @@ func (e *ExecutionPayloadHeaderDeneb) UnmarshalSSZ(buf []byte) error { // Field (16) 'ExcessBlobGas' e.ExcessBlobGas = ssz.UnmarshallUint64(buf[576:584]) + // Field (17) 'DepositReceiptsRoot' + if cap(e.DepositReceiptsRoot) == 0 { + e.DepositReceiptsRoot = make([]byte, 0, len(buf[584:616])) + } + e.DepositReceiptsRoot = append(e.DepositReceiptsRoot, buf[584:616]...) + + // Field (18) 'WithdrawalRequestsRoot' + if cap(e.WithdrawalRequestsRoot) == 0 { + e.WithdrawalRequestsRoot = make([]byte, 0, len(buf[616:648])) + } + e.WithdrawalRequestsRoot = append(e.WithdrawalRequestsRoot, buf[616:648]...) + // Field (10) 'ExtraData' { buf = tail[o10:] @@ -2192,9 +3163,9 @@ func (e *ExecutionPayloadHeaderDeneb) UnmarshalSSZ(buf []byte) error { return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderDeneb object -func (e *ExecutionPayloadHeaderDeneb) SizeSSZ() (size int) { - size = 584 +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderElectra object +func (e *ExecutionPayloadHeaderElectra) SizeSSZ() (size int) { + size = 648 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -2202,13 +3173,13 @@ func (e *ExecutionPayloadHeaderDeneb) SizeSSZ() (size int) { return } -// HashTreeRoot ssz hashes the ExecutionPayloadHeaderDeneb object -func (e *ExecutionPayloadHeaderDeneb) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the ExecutionPayloadHeaderElectra object +func (e *ExecutionPayloadHeaderElectra) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(e) } -// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderDeneb object with a hasher -func (e *ExecutionPayloadHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderElectra object with a hasher +func (e *ExecutionPayloadHeaderElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' @@ -2315,6 +3286,20 @@ func (e *ExecutionPayloadHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro // Field (16) 'ExcessBlobGas' hh.PutUint64(e.ExcessBlobGas) + // Field (17) 'DepositReceiptsRoot' + if size := len(e.DepositReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositReceiptsRoot", size, 32) + return + } + hh.PutBytes(e.DepositReceiptsRoot) + + // Field (18) 'WithdrawalRequestsRoot' + if size := len(e.WithdrawalRequestsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalRequestsRoot", size, 32) + return + } + hh.PutBytes(e.WithdrawalRequestsRoot) + if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) } else { @@ -2661,3 +3646,222 @@ func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { } return } + +// MarshalSSZ ssz marshals the ExecutionLayerWithdrawalRequest object +func (e *ExecutionLayerWithdrawalRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ExecutionLayerWithdrawalRequest object to a target array +func (e *ExecutionLayerWithdrawalRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SourceAddress' + if size := len(e.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) + return + } + dst = append(dst, e.SourceAddress...) + + // Field (1) 'ValidatorPubkey' + if size := len(e.ValidatorPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) + return + } + dst = append(dst, e.ValidatorPubkey...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, e.Amount) + + return +} + +// UnmarshalSSZ ssz unmarshals the ExecutionLayerWithdrawalRequest object +func (e *ExecutionLayerWithdrawalRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 76 { + return ssz.ErrSize + } + + // Field (0) 'SourceAddress' + if cap(e.SourceAddress) == 0 { + e.SourceAddress = make([]byte, 0, len(buf[0:20])) + } + e.SourceAddress = append(e.SourceAddress, buf[0:20]...) + + // Field (1) 'ValidatorPubkey' + if cap(e.ValidatorPubkey) == 0 { + e.ValidatorPubkey = make([]byte, 0, len(buf[20:68])) + } + e.ValidatorPubkey = append(e.ValidatorPubkey, buf[20:68]...) + + // Field (2) 'Amount' + e.Amount = ssz.UnmarshallUint64(buf[68:76]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionLayerWithdrawalRequest object +func (e *ExecutionLayerWithdrawalRequest) SizeSSZ() (size int) { + size = 76 + return +} + +// HashTreeRoot ssz hashes the ExecutionLayerWithdrawalRequest object +func (e *ExecutionLayerWithdrawalRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the ExecutionLayerWithdrawalRequest object with a hasher +func (e *ExecutionLayerWithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SourceAddress' + if size := len(e.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) + return + } + hh.PutBytes(e.SourceAddress) + + // Field (1) 'ValidatorPubkey' + if size := len(e.ValidatorPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) + return + } + hh.PutBytes(e.ValidatorPubkey) + + // Field (2) 'Amount' + hh.PutUint64(e.Amount) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the DepositReceipt object +func (d *DepositReceipt) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DepositReceipt object to a target array +func (d *DepositReceipt) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Pubkey' + if size := len(d.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + dst = append(dst, d.Pubkey...) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + dst = append(dst, d.WithdrawalCredentials...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, d.Signature...) + + // Field (4) 'Index' + dst = ssz.MarshalUint64(dst, d.Index) + + return +} + +// UnmarshalSSZ ssz unmarshals the DepositReceipt object +func (d *DepositReceipt) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 192 { + return ssz.ErrSize + } + + // Field (0) 'Pubkey' + if cap(d.Pubkey) == 0 { + d.Pubkey = make([]byte, 0, len(buf[0:48])) + } + d.Pubkey = append(d.Pubkey, buf[0:48]...) + + // Field (1) 'WithdrawalCredentials' + if cap(d.WithdrawalCredentials) == 0 { + d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + } + d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) + + // Field (2) 'Amount' + d.Amount = ssz.UnmarshallUint64(buf[80:88]) + + // Field (3) 'Signature' + if cap(d.Signature) == 0 { + d.Signature = make([]byte, 0, len(buf[88:184])) + } + d.Signature = append(d.Signature, buf[88:184]...) + + // Field (4) 'Index' + d.Index = ssz.UnmarshallUint64(buf[184:192]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DepositReceipt object +func (d *DepositReceipt) SizeSSZ() (size int) { + size = 192 + return +} + +// HashTreeRoot ssz hashes the DepositReceipt object +func (d *DepositReceipt) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DepositReceipt object with a hasher +func (d *DepositReceipt) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Pubkey' + if size := len(d.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + hh.PutBytes(d.Pubkey) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + hh.PutBytes(d.WithdrawalCredentials) + + // Field (2) 'Amount' + hh.PutUint64(d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(d.Signature) + + // Field (4) 'Index' + hh.PutUint64(d.Index) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index f181c9138c0f..3603865f6075 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 5890b3492dbdff08d332879e83ae45e7bd9f94da0716b1b0517f1766028a8d67 +// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c package v1 import ( diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index 498d6e2a13c5..68ff620f25be 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 2ed480e3c144fb091e0aa2757a79e78da573f90b18d0d8acd35fa9705f6c1b08 +// Hash: 6b214399116c0ca31026da23db2b85fccd78e16d7b9113c83b4a9ee4e60977f6 package eth import ( diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index afe623df9ff7..77779515b070 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -18,6 +18,7 @@ proto_library( srcs = [ "beacon_chain.proto", "debug.proto", + "eip_7251.proto", "finalized_block_root_container.proto", "health.proto", "node.proto", @@ -67,6 +68,9 @@ ssz_gen_marshal( "BeaconBlockDeneb", "BeaconBlockBodyDeneb", "SignedBeaconBlockDeneb", + "BeaconBlockElectra", + "BeaconBlockElectra", + "SignedBeaconBlockElectra", "SignedBlindedBeaconBlockCapella", "BlindedBeaconBlockCapella", "BlindedBeaconBlockBodyCapella", @@ -87,17 +91,22 @@ ssz_gen_marshal( "MetaDataV1", "Status", "AggregateAttestationAndProof", + "AggregateAttestationAndProofElectra", "Attestation", + "AttestationElectra", "AttestationData", "AttesterSlashing", + "AttesterSlashingElectra", "BeaconBlock", "BeaconBlockHeader", "Checkpoint", "Deposit", "Eth1Data", "IndexedAttestation", + "IndexedAttestationElectra", "ProposerSlashing", "SignedAggregateAttestationAndProof", + "SignedAggregateAttestationAndProofElectra", "SignedBeaconBlock", "SignedBeaconBlockHeader", "SignedVoluntaryExit", @@ -115,6 +124,7 @@ ssz_gen_marshal( "BeaconStateBellatrix", "BeaconStateCapella", "BeaconStateDeneb", + "BeaconStateElectra", "SigningData", "SyncCommittee", "SyncAggregatorSelectionData", @@ -131,6 +141,11 @@ ssz_gen_marshal( "BlobSidecars", "BlobIdentifier", "DepositSnapshot", + "PendingBalanceDeposit", + "PendingPartialWithdrawal", + "Consolidation", + "SignedConsolidation", + "PendingConsolidation", ], ) diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go new file mode 100644 index 000000000000..b11c70e5db75 --- /dev/null +++ b/proto/prysm/v1alpha1/attestation.go @@ -0,0 +1 @@ +package eth diff --git a/proto/prysm/v1alpha1/attestation.pb.go b/proto/prysm/v1alpha1/attestation.pb.go index 18aa58f54e1a..1e5694b84c61 100755 --- a/proto/prysm/v1alpha1/attestation.pb.go +++ b/proto/prysm/v1alpha1/attestation.pb.go @@ -87,6 +87,77 @@ func (x *Attestation) GetSignature() []byte { return nil } +type AttestationElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AggregationBits github_com_prysmaticlabs_go_bitfield.Bitlist `protobuf:"bytes,1,opt,name=aggregation_bits,json=aggregationBits,proto3" json:"aggregation_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitlist" ssz-max:"131072"` + Data *AttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + CommitteeBits github_com_prysmaticlabs_go_bitfield.Bitvector64 `protobuf:"bytes,4,opt,name=committee_bits,json=committeeBits,proto3" json:"committee_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector64" ssz-size:"8"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *AttestationElectra) Reset() { + *x = AttestationElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AttestationElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AttestationElectra) ProtoMessage() {} + +func (x *AttestationElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AttestationElectra.ProtoReflect.Descriptor instead. +func (*AttestationElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{1} +} + +func (x *AttestationElectra) GetAggregationBits() github_com_prysmaticlabs_go_bitfield.Bitlist { + if x != nil { + return x.AggregationBits + } + return github_com_prysmaticlabs_go_bitfield.Bitlist(nil) +} + +func (x *AttestationElectra) GetData() *AttestationData { + if x != nil { + return x.Data + } + return nil +} + +func (x *AttestationElectra) GetCommitteeBits() github_com_prysmaticlabs_go_bitfield.Bitvector64 { + if x != nil { + return x.CommitteeBits + } + return github_com_prysmaticlabs_go_bitfield.Bitvector64(nil) +} + +func (x *AttestationElectra) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + type AggregateAttestationAndProof struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -100,7 +171,7 @@ type AggregateAttestationAndProof struct { func (x *AggregateAttestationAndProof) Reset() { *x = AggregateAttestationAndProof{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -113,7 +184,7 @@ func (x *AggregateAttestationAndProof) String() string { func (*AggregateAttestationAndProof) ProtoMessage() {} func (x *AggregateAttestationAndProof) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -126,7 +197,7 @@ func (x *AggregateAttestationAndProof) ProtoReflect() protoreflect.Message { // Deprecated: Use AggregateAttestationAndProof.ProtoReflect.Descriptor instead. func (*AggregateAttestationAndProof) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{1} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{2} } func (x *AggregateAttestationAndProof) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -150,6 +221,69 @@ func (x *AggregateAttestationAndProof) GetSelectionProof() []byte { return nil } +type AggregateAttestationAndProofElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AggregatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=aggregator_index,json=aggregatorIndex,proto3" json:"aggregator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Aggregate *AttestationElectra `protobuf:"bytes,3,opt,name=aggregate,proto3" json:"aggregate,omitempty"` + SelectionProof []byte `protobuf:"bytes,2,opt,name=selection_proof,json=selectionProof,proto3" json:"selection_proof,omitempty" ssz-size:"96"` +} + +func (x *AggregateAttestationAndProofElectra) Reset() { + *x = AggregateAttestationAndProofElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregateAttestationAndProofElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregateAttestationAndProofElectra) ProtoMessage() {} + +func (x *AggregateAttestationAndProofElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregateAttestationAndProofElectra.ProtoReflect.Descriptor instead. +func (*AggregateAttestationAndProofElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{3} +} + +func (x *AggregateAttestationAndProofElectra) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.AggregatorIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *AggregateAttestationAndProofElectra) GetAggregate() *AttestationElectra { + if x != nil { + return x.Aggregate + } + return nil +} + +func (x *AggregateAttestationAndProofElectra) GetSelectionProof() []byte { + if x != nil { + return x.SelectionProof + } + return nil +} + type SignedAggregateAttestationAndProof struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -162,7 +296,7 @@ type SignedAggregateAttestationAndProof struct { func (x *SignedAggregateAttestationAndProof) Reset() { *x = SignedAggregateAttestationAndProof{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -175,7 +309,7 @@ func (x *SignedAggregateAttestationAndProof) String() string { func (*SignedAggregateAttestationAndProof) ProtoMessage() {} func (x *SignedAggregateAttestationAndProof) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -188,7 +322,7 @@ func (x *SignedAggregateAttestationAndProof) ProtoReflect() protoreflect.Message // Deprecated: Use SignedAggregateAttestationAndProof.ProtoReflect.Descriptor instead. func (*SignedAggregateAttestationAndProof) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{2} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{4} } func (x *SignedAggregateAttestationAndProof) GetMessage() *AggregateAttestationAndProof { @@ -205,6 +339,61 @@ func (x *SignedAggregateAttestationAndProof) GetSignature() []byte { return nil } +type SignedAggregateAttestationAndProofElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *AggregateAttestationAndProofElectra `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *SignedAggregateAttestationAndProofElectra) Reset() { + *x = SignedAggregateAttestationAndProofElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedAggregateAttestationAndProofElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedAggregateAttestationAndProofElectra) ProtoMessage() {} + +func (x *SignedAggregateAttestationAndProofElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedAggregateAttestationAndProofElectra.ProtoReflect.Descriptor instead. +func (*SignedAggregateAttestationAndProofElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{5} +} + +func (x *SignedAggregateAttestationAndProofElectra) GetMessage() *AggregateAttestationAndProofElectra { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedAggregateAttestationAndProofElectra) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + type AttestationData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -220,7 +409,7 @@ type AttestationData struct { func (x *AttestationData) Reset() { *x = AttestationData{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -233,7 +422,7 @@ func (x *AttestationData) String() string { func (*AttestationData) ProtoMessage() {} func (x *AttestationData) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -246,7 +435,7 @@ func (x *AttestationData) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationData.ProtoReflect.Descriptor instead. func (*AttestationData) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{3} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{6} } func (x *AttestationData) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -296,7 +485,7 @@ type Checkpoint struct { func (x *Checkpoint) Reset() { *x = Checkpoint{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -309,7 +498,7 @@ func (x *Checkpoint) String() string { func (*Checkpoint) ProtoMessage() {} func (x *Checkpoint) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -322,7 +511,7 @@ func (x *Checkpoint) ProtoReflect() protoreflect.Message { // Deprecated: Use Checkpoint.ProtoReflect.Descriptor instead. func (*Checkpoint) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{4} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{7} } func (x *Checkpoint) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -361,20 +550,58 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x40, 0x0a, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x75, 0x72, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x12, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x65, 0x0a, 0x10, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0x82, 0xb5, 0x18, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, + 0x69, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x92, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, + 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, + 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x60, 0x0a, + 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x39, 0x82, 0xb5, 0x18, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, + 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x38, + 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, + 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x40, 0x0a, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x9b, 0x02, 0x0a, 0x23, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x7a, 0x0a, + 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, @@ -388,51 +615,61 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{ 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0x90, 0x03, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0xa7, 0x01, 0x0a, 0x29, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x54, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x90, 0x03, 0x0a, 0x0f, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x78, - 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, - 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x1a, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, - 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, - 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x86, 0x01, 0x0a, + 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x04, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x42, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, + 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -447,25 +684,31 @@ func file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_attestation_proto_rawDescData } -var file_proto_prysm_v1alpha1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_prysm_v1alpha1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_proto_prysm_v1alpha1_attestation_proto_goTypes = []interface{}{ - (*Attestation)(nil), // 0: ethereum.eth.v1alpha1.Attestation - (*AggregateAttestationAndProof)(nil), // 1: ethereum.eth.v1alpha1.AggregateAttestationAndProof - (*SignedAggregateAttestationAndProof)(nil), // 2: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof - (*AttestationData)(nil), // 3: ethereum.eth.v1alpha1.AttestationData - (*Checkpoint)(nil), // 4: ethereum.eth.v1alpha1.Checkpoint + (*Attestation)(nil), // 0: ethereum.eth.v1alpha1.Attestation + (*AttestationElectra)(nil), // 1: ethereum.eth.v1alpha1.AttestationElectra + (*AggregateAttestationAndProof)(nil), // 2: ethereum.eth.v1alpha1.AggregateAttestationAndProof + (*AggregateAttestationAndProofElectra)(nil), // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra + (*SignedAggregateAttestationAndProof)(nil), // 4: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof + (*SignedAggregateAttestationAndProofElectra)(nil), // 5: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra + (*AttestationData)(nil), // 6: ethereum.eth.v1alpha1.AttestationData + (*Checkpoint)(nil), // 7: ethereum.eth.v1alpha1.Checkpoint } var file_proto_prysm_v1alpha1_attestation_proto_depIdxs = []int32{ - 3, // 0: ethereum.eth.v1alpha1.Attestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData - 0, // 1: ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate:type_name -> ethereum.eth.v1alpha1.Attestation - 1, // 2: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof - 4, // 3: ethereum.eth.v1alpha1.AttestationData.source:type_name -> ethereum.eth.v1alpha1.Checkpoint - 4, // 4: ethereum.eth.v1alpha1.AttestationData.target:type_name -> ethereum.eth.v1alpha1.Checkpoint - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 6, // 0: ethereum.eth.v1alpha1.Attestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 6, // 1: ethereum.eth.v1alpha1.AttestationElectra.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 0, // 2: ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate:type_name -> ethereum.eth.v1alpha1.Attestation + 1, // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra.aggregate:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 2, // 4: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof + 3, // 5: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra + 7, // 6: ethereum.eth.v1alpha1.AttestationData.source:type_name -> ethereum.eth.v1alpha1.Checkpoint + 7, // 7: ethereum.eth.v1alpha1.AttestationData.target:type_name -> ethereum.eth.v1alpha1.Checkpoint + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_attestation_proto_init() } @@ -487,7 +730,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AggregateAttestationAndProof); i { + switch v := v.(*AttestationElectra); i { case 0: return &v.state case 1: @@ -499,7 +742,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedAggregateAttestationAndProof); i { + switch v := v.(*AggregateAttestationAndProof); i { case 0: return &v.state case 1: @@ -511,7 +754,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AttestationData); i { + switch v := v.(*AggregateAttestationAndProofElectra); i { case 0: return &v.state case 1: @@ -523,6 +766,42 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedAggregateAttestationAndProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedAggregateAttestationAndProofElectra); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttestationData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Checkpoint); i { case 0: return &v.state @@ -541,7 +820,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_attestation_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/prysm/v1alpha1/attestation.proto b/proto/prysm/v1alpha1/attestation.proto index 290ee64e95f9..630d05f90cd7 100644 --- a/proto/prysm/v1alpha1/attestation.proto +++ b/proto/prysm/v1alpha1/attestation.proto @@ -35,6 +35,20 @@ message Attestation { bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; } +message AttestationElectra { + // A bitfield representation of validator indices that have voted exactly + // the same vote and have been aggregated into this attestation. + bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "max_attesting_indices.size", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"]; + + AttestationData data = 2; + + // TODO: doc + bytes committee_bits = 4 [(ethereum.eth.ext.ssz_size) = "committee_bits.size", (ethereum.eth.ext.cast_type) = "committee_bits.type"]; + + // 96 byte BLS aggregate signature. + bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; +} + message AggregateAttestationAndProof { // The aggregator index that submitted this aggregated attestation and proof. uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; @@ -46,6 +60,17 @@ message AggregateAttestationAndProof { bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"]; } +message AggregateAttestationAndProofElectra { + // The aggregator index that submitted this aggregated attestation and proof. + uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + + // The aggregated attestation that was submitted. + AttestationElectra aggregate = 3; + + // 96 byte selection proof signed by the aggregator, which is the signature of the slot to aggregate. + bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + message SignedAggregateAttestationAndProof { // The aggregated attestation and selection proof itself. AggregateAttestationAndProof message = 1; @@ -54,6 +79,14 @@ message SignedAggregateAttestationAndProof { bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; } +message SignedAggregateAttestationAndProofElectra { + // The aggregated attestation and selection proof itself. + AggregateAttestationAndProofElectra message = 1; + + // 96 byte BLS aggregate signature signed by the aggregator over the message. + bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + message AttestationData { // Attestation data includes information on Casper the Friendly Finality Gadget's votes // See: https://arxiv.org/pdf/1710.09437.pdf diff --git a/proto/prysm/v1alpha1/beacon_block.pb.go b/proto/prysm/v1alpha1/beacon_block.pb.go index 30530db5aae9..837b7002ad8a 100755 --- a/proto/prysm/v1alpha1/beacon_block.pb.go +++ b/proto/prysm/v1alpha1/beacon_block.pb.go @@ -40,6 +40,8 @@ type GenericSignedBeaconBlock struct { // *GenericSignedBeaconBlock_BlindedCapella // *GenericSignedBeaconBlock_Deneb // *GenericSignedBeaconBlock_BlindedDeneb + // *GenericSignedBeaconBlock_Electra + // *GenericSignedBeaconBlock_BlindedElectra Block isGenericSignedBeaconBlock_Block `protobuf_oneof:"block"` IsBlinded bool `protobuf:"varint,100,opt,name=is_blinded,json=isBlinded,proto3" json:"is_blinded,omitempty"` } @@ -139,6 +141,20 @@ func (x *GenericSignedBeaconBlock) GetBlindedDeneb() *SignedBlindedBeaconBlockDe return nil } +func (x *GenericSignedBeaconBlock) GetElectra() *SignedBeaconBlockContentsElectra { + if x, ok := x.GetBlock().(*GenericSignedBeaconBlock_Electra); ok { + return x.Electra + } + return nil +} + +func (x *GenericSignedBeaconBlock) GetBlindedElectra() *SignedBlindedBeaconBlockElectra { + if x, ok := x.GetBlock().(*GenericSignedBeaconBlock_BlindedElectra); ok { + return x.BlindedElectra + } + return nil +} + func (x *GenericSignedBeaconBlock) GetIsBlinded() bool { if x != nil { return x.IsBlinded @@ -182,6 +198,14 @@ type GenericSignedBeaconBlock_BlindedDeneb struct { BlindedDeneb *SignedBlindedBeaconBlockDeneb `protobuf:"bytes,8,opt,name=blinded_deneb,json=blindedDeneb,proto3,oneof"` } +type GenericSignedBeaconBlock_Electra struct { + Electra *SignedBeaconBlockContentsElectra `protobuf:"bytes,9,opt,name=electra,proto3,oneof"` +} + +type GenericSignedBeaconBlock_BlindedElectra struct { + BlindedElectra *SignedBlindedBeaconBlockElectra `protobuf:"bytes,10,opt,name=blinded_electra,json=blindedElectra,proto3,oneof"` +} + func (*GenericSignedBeaconBlock_Phase0) isGenericSignedBeaconBlock_Block() {} func (*GenericSignedBeaconBlock_Altair) isGenericSignedBeaconBlock_Block() {} @@ -198,6 +222,10 @@ func (*GenericSignedBeaconBlock_Deneb) isGenericSignedBeaconBlock_Block() {} func (*GenericSignedBeaconBlock_BlindedDeneb) isGenericSignedBeaconBlock_Block() {} +func (*GenericSignedBeaconBlock_Electra) isGenericSignedBeaconBlock_Block() {} + +func (*GenericSignedBeaconBlock_BlindedElectra) isGenericSignedBeaconBlock_Block() {} + type GenericBeaconBlock struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -213,6 +241,8 @@ type GenericBeaconBlock struct { // *GenericBeaconBlock_BlindedCapella // *GenericBeaconBlock_Deneb // *GenericBeaconBlock_BlindedDeneb + // *GenericBeaconBlock_Electra + // *GenericBeaconBlock_BlindedElectra Block isGenericBeaconBlock_Block `protobuf_oneof:"block"` IsBlinded bool `protobuf:"varint,100,opt,name=is_blinded,json=isBlinded,proto3" json:"is_blinded,omitempty"` PayloadValue string `protobuf:"bytes,101,opt,name=payload_value,json=payloadValue,proto3" json:"payload_value,omitempty"` @@ -313,6 +343,20 @@ func (x *GenericBeaconBlock) GetBlindedDeneb() *BlindedBeaconBlockDeneb { return nil } +func (x *GenericBeaconBlock) GetElectra() *BeaconBlockContentsElectra { + if x, ok := x.GetBlock().(*GenericBeaconBlock_Electra); ok { + return x.Electra + } + return nil +} + +func (x *GenericBeaconBlock) GetBlindedElectra() *BlindedBeaconBlockElectra { + if x, ok := x.GetBlock().(*GenericBeaconBlock_BlindedElectra); ok { + return x.BlindedElectra + } + return nil +} + func (x *GenericBeaconBlock) GetIsBlinded() bool { if x != nil { return x.IsBlinded @@ -363,6 +407,14 @@ type GenericBeaconBlock_BlindedDeneb struct { BlindedDeneb *BlindedBeaconBlockDeneb `protobuf:"bytes,8,opt,name=blinded_deneb,json=blindedDeneb,proto3,oneof"` } +type GenericBeaconBlock_Electra struct { + Electra *BeaconBlockContentsElectra `protobuf:"bytes,9,opt,name=electra,proto3,oneof"` +} + +type GenericBeaconBlock_BlindedElectra struct { + BlindedElectra *BlindedBeaconBlockElectra `protobuf:"bytes,10,opt,name=blinded_electra,json=blindedElectra,proto3,oneof"` +} + func (*GenericBeaconBlock_Phase0) isGenericBeaconBlock_Block() {} func (*GenericBeaconBlock_Altair) isGenericBeaconBlock_Block() {} @@ -379,6 +431,10 @@ func (*GenericBeaconBlock_Deneb) isGenericBeaconBlock_Block() {} func (*GenericBeaconBlock_BlindedDeneb) isGenericBeaconBlock_Block() {} +func (*GenericBeaconBlock_Electra) isGenericBeaconBlock_Block() {} + +func (*GenericBeaconBlock_BlindedElectra) isGenericBeaconBlock_Block() {} + type BeaconBlock struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -971,6 +1027,61 @@ func (x *AttesterSlashing) GetAttestation_2() *IndexedAttestation { return nil } +type AttesterSlashingElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attestation_1 *IndexedAttestationElectra `protobuf:"bytes,1,opt,name=attestation_1,json=attestation1,proto3" json:"attestation_1,omitempty"` + Attestation_2 *IndexedAttestationElectra `protobuf:"bytes,2,opt,name=attestation_2,json=attestation2,proto3" json:"attestation_2,omitempty"` +} + +func (x *AttesterSlashingElectra) Reset() { + *x = AttesterSlashingElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AttesterSlashingElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AttesterSlashingElectra) ProtoMessage() {} + +func (x *AttesterSlashingElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AttesterSlashingElectra.ProtoReflect.Descriptor instead. +func (*AttesterSlashingElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{10} +} + +func (x *AttesterSlashingElectra) GetAttestation_1() *IndexedAttestationElectra { + if x != nil { + return x.Attestation_1 + } + return nil +} + +func (x *AttesterSlashingElectra) GetAttestation_2() *IndexedAttestationElectra { + if x != nil { + return x.Attestation_2 + } + return nil +} + type Deposit struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -983,7 +1094,7 @@ type Deposit struct { func (x *Deposit) Reset() { *x = Deposit{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[10] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -996,7 +1107,7 @@ func (x *Deposit) String() string { func (*Deposit) ProtoMessage() {} func (x *Deposit) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[10] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1009,7 +1120,7 @@ func (x *Deposit) ProtoReflect() protoreflect.Message { // Deprecated: Use Deposit.ProtoReflect.Descriptor instead. func (*Deposit) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{10} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{11} } func (x *Deposit) GetProof() [][]byte { @@ -1038,7 +1149,7 @@ type VoluntaryExit struct { func (x *VoluntaryExit) Reset() { *x = VoluntaryExit{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[11] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1051,7 +1162,7 @@ func (x *VoluntaryExit) String() string { func (*VoluntaryExit) ProtoMessage() {} func (x *VoluntaryExit) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[11] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1064,7 +1175,7 @@ func (x *VoluntaryExit) ProtoReflect() protoreflect.Message { // Deprecated: Use VoluntaryExit.ProtoReflect.Descriptor instead. func (*VoluntaryExit) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{11} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{12} } func (x *VoluntaryExit) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -1093,7 +1204,7 @@ type SignedVoluntaryExit struct { func (x *SignedVoluntaryExit) Reset() { *x = SignedVoluntaryExit{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[12] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1106,7 +1217,7 @@ func (x *SignedVoluntaryExit) String() string { func (*SignedVoluntaryExit) ProtoMessage() {} func (x *SignedVoluntaryExit) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[12] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1119,7 +1230,7 @@ func (x *SignedVoluntaryExit) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedVoluntaryExit.ProtoReflect.Descriptor instead. func (*SignedVoluntaryExit) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{12} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{13} } func (x *SignedVoluntaryExit) GetExit() *VoluntaryExit { @@ -1149,7 +1260,7 @@ type Eth1Data struct { func (x *Eth1Data) Reset() { *x = Eth1Data{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[13] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1162,7 +1273,7 @@ func (x *Eth1Data) String() string { func (*Eth1Data) ProtoMessage() {} func (x *Eth1Data) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[13] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1175,7 +1286,7 @@ func (x *Eth1Data) ProtoReflect() protoreflect.Message { // Deprecated: Use Eth1Data.ProtoReflect.Descriptor instead. func (*Eth1Data) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{13} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{14} } func (x *Eth1Data) GetDepositRoot() []byte { @@ -1214,7 +1325,7 @@ type BeaconBlockHeader struct { func (x *BeaconBlockHeader) Reset() { *x = BeaconBlockHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[14] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1227,7 +1338,7 @@ func (x *BeaconBlockHeader) String() string { func (*BeaconBlockHeader) ProtoMessage() {} func (x *BeaconBlockHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[14] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1240,7 +1351,7 @@ func (x *BeaconBlockHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockHeader.ProtoReflect.Descriptor instead. func (*BeaconBlockHeader) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{14} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{15} } func (x *BeaconBlockHeader) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -1290,7 +1401,7 @@ type SignedBeaconBlockHeader struct { func (x *SignedBeaconBlockHeader) Reset() { *x = SignedBeaconBlockHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[15] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1303,7 +1414,7 @@ func (x *SignedBeaconBlockHeader) String() string { func (*SignedBeaconBlockHeader) ProtoMessage() {} func (x *SignedBeaconBlockHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[15] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1316,7 +1427,7 @@ func (x *SignedBeaconBlockHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBeaconBlockHeader.ProtoReflect.Descriptor instead. func (*SignedBeaconBlockHeader) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{15} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{16} } func (x *SignedBeaconBlockHeader) GetHeader() *BeaconBlockHeader { @@ -1346,7 +1457,7 @@ type IndexedAttestation struct { func (x *IndexedAttestation) Reset() { *x = IndexedAttestation{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[16] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1359,7 +1470,7 @@ func (x *IndexedAttestation) String() string { func (*IndexedAttestation) ProtoMessage() {} func (x *IndexedAttestation) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[16] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1372,7 +1483,7 @@ func (x *IndexedAttestation) ProtoReflect() protoreflect.Message { // Deprecated: Use IndexedAttestation.ProtoReflect.Descriptor instead. func (*IndexedAttestation) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{16} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{17} } func (x *IndexedAttestation) GetAttestingIndices() []uint64 { @@ -1396,6 +1507,69 @@ func (x *IndexedAttestation) GetSignature() []byte { return nil } +type IndexedAttestationElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestingIndices []uint64 `protobuf:"varint,1,rep,packed,name=attesting_indices,json=attestingIndices,proto3" json:"attesting_indices,omitempty" ssz-max:"131072"` + Data *AttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *IndexedAttestationElectra) Reset() { + *x = IndexedAttestationElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IndexedAttestationElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IndexedAttestationElectra) ProtoMessage() {} + +func (x *IndexedAttestationElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IndexedAttestationElectra.ProtoReflect.Descriptor instead. +func (*IndexedAttestationElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{18} +} + +func (x *IndexedAttestationElectra) GetAttestingIndices() []uint64 { + if x != nil { + return x.AttestingIndices + } + return nil +} + +func (x *IndexedAttestationElectra) GetData() *AttestationData { + if x != nil { + return x.Data + } + return nil +} + +func (x *IndexedAttestationElectra) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + type SyncAggregate struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1408,7 +1582,7 @@ type SyncAggregate struct { func (x *SyncAggregate) Reset() { *x = SyncAggregate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[17] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1421,7 +1595,7 @@ func (x *SyncAggregate) String() string { func (*SyncAggregate) ProtoMessage() {} func (x *SyncAggregate) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[17] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1434,7 +1608,7 @@ func (x *SyncAggregate) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncAggregate.ProtoReflect.Descriptor instead. func (*SyncAggregate) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{17} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{19} } func (x *SyncAggregate) GetSyncCommitteeBits() github_com_prysmaticlabs_go_bitfield.Bitvector512 { @@ -1463,7 +1637,7 @@ type SignedBeaconBlockBellatrix struct { func (x *SignedBeaconBlockBellatrix) Reset() { *x = SignedBeaconBlockBellatrix{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[18] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1476,7 +1650,7 @@ func (x *SignedBeaconBlockBellatrix) String() string { func (*SignedBeaconBlockBellatrix) ProtoMessage() {} func (x *SignedBeaconBlockBellatrix) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[18] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1489,7 +1663,7 @@ func (x *SignedBeaconBlockBellatrix) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBeaconBlockBellatrix.ProtoReflect.Descriptor instead. func (*SignedBeaconBlockBellatrix) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{18} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{20} } func (x *SignedBeaconBlockBellatrix) GetBlock() *BeaconBlockBellatrix { @@ -1521,7 +1695,7 @@ type BeaconBlockBellatrix struct { func (x *BeaconBlockBellatrix) Reset() { *x = BeaconBlockBellatrix{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[19] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1534,7 +1708,7 @@ func (x *BeaconBlockBellatrix) String() string { func (*BeaconBlockBellatrix) ProtoMessage() {} func (x *BeaconBlockBellatrix) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[19] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1547,7 +1721,7 @@ func (x *BeaconBlockBellatrix) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockBellatrix.ProtoReflect.Descriptor instead. func (*BeaconBlockBellatrix) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{19} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{21} } func (x *BeaconBlockBellatrix) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -1605,7 +1779,7 @@ type BeaconBlockBodyBellatrix struct { func (x *BeaconBlockBodyBellatrix) Reset() { *x = BeaconBlockBodyBellatrix{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[20] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1618,7 +1792,7 @@ func (x *BeaconBlockBodyBellatrix) String() string { func (*BeaconBlockBodyBellatrix) ProtoMessage() {} func (x *BeaconBlockBodyBellatrix) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[20] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1631,7 +1805,7 @@ func (x *BeaconBlockBodyBellatrix) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockBodyBellatrix.ProtoReflect.Descriptor instead. func (*BeaconBlockBodyBellatrix) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{20} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{22} } func (x *BeaconBlockBodyBellatrix) GetRandaoReveal() []byte { @@ -1716,7 +1890,7 @@ type SignedBlindedBeaconBlockBellatrix struct { func (x *SignedBlindedBeaconBlockBellatrix) Reset() { *x = SignedBlindedBeaconBlockBellatrix{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[21] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1729,7 +1903,7 @@ func (x *SignedBlindedBeaconBlockBellatrix) String() string { func (*SignedBlindedBeaconBlockBellatrix) ProtoMessage() {} func (x *SignedBlindedBeaconBlockBellatrix) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[21] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1742,7 +1916,7 @@ func (x *SignedBlindedBeaconBlockBellatrix) ProtoReflect() protoreflect.Message // Deprecated: Use SignedBlindedBeaconBlockBellatrix.ProtoReflect.Descriptor instead. func (*SignedBlindedBeaconBlockBellatrix) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{21} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{23} } func (x *SignedBlindedBeaconBlockBellatrix) GetBlock() *BlindedBeaconBlockBellatrix { @@ -1774,7 +1948,7 @@ type BlindedBeaconBlockBellatrix struct { func (x *BlindedBeaconBlockBellatrix) Reset() { *x = BlindedBeaconBlockBellatrix{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[22] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1787,7 +1961,7 @@ func (x *BlindedBeaconBlockBellatrix) String() string { func (*BlindedBeaconBlockBellatrix) ProtoMessage() {} func (x *BlindedBeaconBlockBellatrix) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[22] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1800,7 +1974,7 @@ func (x *BlindedBeaconBlockBellatrix) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindedBeaconBlockBellatrix.ProtoReflect.Descriptor instead. func (*BlindedBeaconBlockBellatrix) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{22} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{24} } func (x *BlindedBeaconBlockBellatrix) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -1858,7 +2032,7 @@ type BlindedBeaconBlockBodyBellatrix struct { func (x *BlindedBeaconBlockBodyBellatrix) Reset() { *x = BlindedBeaconBlockBodyBellatrix{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[23] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1871,7 +2045,7 @@ func (x *BlindedBeaconBlockBodyBellatrix) String() string { func (*BlindedBeaconBlockBodyBellatrix) ProtoMessage() {} func (x *BlindedBeaconBlockBodyBellatrix) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[23] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1884,7 +2058,7 @@ func (x *BlindedBeaconBlockBodyBellatrix) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindedBeaconBlockBodyBellatrix.ProtoReflect.Descriptor instead. func (*BlindedBeaconBlockBodyBellatrix) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{23} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{25} } func (x *BlindedBeaconBlockBodyBellatrix) GetRandaoReveal() []byte { @@ -1970,7 +2144,7 @@ type SignedBeaconBlockContentsDeneb struct { func (x *SignedBeaconBlockContentsDeneb) Reset() { *x = SignedBeaconBlockContentsDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[24] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1983,7 +2157,7 @@ func (x *SignedBeaconBlockContentsDeneb) String() string { func (*SignedBeaconBlockContentsDeneb) ProtoMessage() {} func (x *SignedBeaconBlockContentsDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[24] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1996,7 +2170,7 @@ func (x *SignedBeaconBlockContentsDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBeaconBlockContentsDeneb.ProtoReflect.Descriptor instead. func (*SignedBeaconBlockContentsDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{24} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{26} } func (x *SignedBeaconBlockContentsDeneb) GetBlock() *SignedBeaconBlockDeneb { @@ -2033,7 +2207,7 @@ type BeaconBlockContentsDeneb struct { func (x *BeaconBlockContentsDeneb) Reset() { *x = BeaconBlockContentsDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[25] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2046,7 +2220,7 @@ func (x *BeaconBlockContentsDeneb) String() string { func (*BeaconBlockContentsDeneb) ProtoMessage() {} func (x *BeaconBlockContentsDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[25] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2059,7 +2233,7 @@ func (x *BeaconBlockContentsDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockContentsDeneb.ProtoReflect.Descriptor instead. func (*BeaconBlockContentsDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{25} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{27} } func (x *BeaconBlockContentsDeneb) GetBlock() *BeaconBlockDeneb { @@ -2095,7 +2269,7 @@ type SignedBeaconBlockDeneb struct { func (x *SignedBeaconBlockDeneb) Reset() { *x = SignedBeaconBlockDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[26] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2108,7 +2282,7 @@ func (x *SignedBeaconBlockDeneb) String() string { func (*SignedBeaconBlockDeneb) ProtoMessage() {} func (x *SignedBeaconBlockDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[26] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2121,7 +2295,7 @@ func (x *SignedBeaconBlockDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBeaconBlockDeneb.ProtoReflect.Descriptor instead. func (*SignedBeaconBlockDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{26} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{28} } func (x *SignedBeaconBlockDeneb) GetBlock() *BeaconBlockDeneb { @@ -2153,7 +2327,7 @@ type BeaconBlockDeneb struct { func (x *BeaconBlockDeneb) Reset() { *x = BeaconBlockDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[27] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2166,7 +2340,7 @@ func (x *BeaconBlockDeneb) String() string { func (*BeaconBlockDeneb) ProtoMessage() {} func (x *BeaconBlockDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[27] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2179,7 +2353,7 @@ func (x *BeaconBlockDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockDeneb.ProtoReflect.Descriptor instead. func (*BeaconBlockDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{27} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{29} } func (x *BeaconBlockDeneb) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -2239,7 +2413,7 @@ type BeaconBlockBodyDeneb struct { func (x *BeaconBlockBodyDeneb) Reset() { *x = BeaconBlockBodyDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[28] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2252,7 +2426,7 @@ func (x *BeaconBlockBodyDeneb) String() string { func (*BeaconBlockBodyDeneb) ProtoMessage() {} func (x *BeaconBlockBodyDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[28] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2265,7 +2439,7 @@ func (x *BeaconBlockBodyDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockBodyDeneb.ProtoReflect.Descriptor instead. func (*BeaconBlockBodyDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{28} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{30} } func (x *BeaconBlockBodyDeneb) GetRandaoReveal() []byte { @@ -2364,7 +2538,7 @@ type SignedBeaconBlockCapella struct { func (x *SignedBeaconBlockCapella) Reset() { *x = SignedBeaconBlockCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[29] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2377,7 +2551,7 @@ func (x *SignedBeaconBlockCapella) String() string { func (*SignedBeaconBlockCapella) ProtoMessage() {} func (x *SignedBeaconBlockCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[29] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2390,7 +2564,7 @@ func (x *SignedBeaconBlockCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBeaconBlockCapella.ProtoReflect.Descriptor instead. func (*SignedBeaconBlockCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{29} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{31} } func (x *SignedBeaconBlockCapella) GetBlock() *BeaconBlockCapella { @@ -2422,7 +2596,7 @@ type BeaconBlockCapella struct { func (x *BeaconBlockCapella) Reset() { *x = BeaconBlockCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[30] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2435,7 +2609,7 @@ func (x *BeaconBlockCapella) String() string { func (*BeaconBlockCapella) ProtoMessage() {} func (x *BeaconBlockCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[30] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2448,7 +2622,7 @@ func (x *BeaconBlockCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockCapella.ProtoReflect.Descriptor instead. func (*BeaconBlockCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{30} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{32} } func (x *BeaconBlockCapella) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -2507,7 +2681,7 @@ type BeaconBlockBodyCapella struct { func (x *BeaconBlockBodyCapella) Reset() { *x = BeaconBlockBodyCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[31] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2520,7 +2694,7 @@ func (x *BeaconBlockBodyCapella) String() string { func (*BeaconBlockBodyCapella) ProtoMessage() {} func (x *BeaconBlockBodyCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[31] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2533,7 +2707,7 @@ func (x *BeaconBlockBodyCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockBodyCapella.ProtoReflect.Descriptor instead. func (*BeaconBlockBodyCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{31} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{33} } func (x *BeaconBlockBodyCapella) GetRandaoReveal() []byte { @@ -2625,7 +2799,7 @@ type SignedBlindedBeaconBlockCapella struct { func (x *SignedBlindedBeaconBlockCapella) Reset() { *x = SignedBlindedBeaconBlockCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[32] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2638,7 +2812,7 @@ func (x *SignedBlindedBeaconBlockCapella) String() string { func (*SignedBlindedBeaconBlockCapella) ProtoMessage() {} func (x *SignedBlindedBeaconBlockCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[32] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2651,7 +2825,7 @@ func (x *SignedBlindedBeaconBlockCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBlindedBeaconBlockCapella.ProtoReflect.Descriptor instead. func (*SignedBlindedBeaconBlockCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{32} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{34} } func (x *SignedBlindedBeaconBlockCapella) GetBlock() *BlindedBeaconBlockCapella { @@ -2683,7 +2857,7 @@ type BlindedBeaconBlockCapella struct { func (x *BlindedBeaconBlockCapella) Reset() { *x = BlindedBeaconBlockCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[33] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2696,7 +2870,7 @@ func (x *BlindedBeaconBlockCapella) String() string { func (*BlindedBeaconBlockCapella) ProtoMessage() {} func (x *BlindedBeaconBlockCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[33] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2709,7 +2883,7 @@ func (x *BlindedBeaconBlockCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindedBeaconBlockCapella.ProtoReflect.Descriptor instead. func (*BlindedBeaconBlockCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{33} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{35} } func (x *BlindedBeaconBlockCapella) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -2768,7 +2942,7 @@ type BlindedBeaconBlockBodyCapella struct { func (x *BlindedBeaconBlockBodyCapella) Reset() { *x = BlindedBeaconBlockBodyCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[34] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2781,7 +2955,7 @@ func (x *BlindedBeaconBlockBodyCapella) String() string { func (*BlindedBeaconBlockBodyCapella) ProtoMessage() {} func (x *BlindedBeaconBlockBodyCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[34] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2794,7 +2968,7 @@ func (x *BlindedBeaconBlockBodyCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindedBeaconBlockBodyCapella.ProtoReflect.Descriptor instead. func (*BlindedBeaconBlockBodyCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{34} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{36} } func (x *BlindedBeaconBlockBodyCapella) GetRandaoReveal() []byte { @@ -2886,7 +3060,7 @@ type SignedBlindedBeaconBlockDeneb struct { func (x *SignedBlindedBeaconBlockDeneb) Reset() { *x = SignedBlindedBeaconBlockDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[35] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2899,7 +3073,7 @@ func (x *SignedBlindedBeaconBlockDeneb) String() string { func (*SignedBlindedBeaconBlockDeneb) ProtoMessage() {} func (x *SignedBlindedBeaconBlockDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[35] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2912,7 +3086,7 @@ func (x *SignedBlindedBeaconBlockDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedBlindedBeaconBlockDeneb.ProtoReflect.Descriptor instead. func (*SignedBlindedBeaconBlockDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{35} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{37} } func (x *SignedBlindedBeaconBlockDeneb) GetMessage() *BlindedBeaconBlockDeneb { @@ -2944,7 +3118,7 @@ type BlindedBeaconBlockDeneb struct { func (x *BlindedBeaconBlockDeneb) Reset() { *x = BlindedBeaconBlockDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[36] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2957,7 +3131,7 @@ func (x *BlindedBeaconBlockDeneb) String() string { func (*BlindedBeaconBlockDeneb) ProtoMessage() {} func (x *BlindedBeaconBlockDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[36] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2970,7 +3144,7 @@ func (x *BlindedBeaconBlockDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindedBeaconBlockDeneb.ProtoReflect.Descriptor instead. func (*BlindedBeaconBlockDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{36} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{38} } func (x *BlindedBeaconBlockDeneb) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -3030,7 +3204,7 @@ type BlindedBeaconBlockBodyDeneb struct { func (x *BlindedBeaconBlockBodyDeneb) Reset() { *x = BlindedBeaconBlockBodyDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[37] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3043,7 +3217,7 @@ func (x *BlindedBeaconBlockBodyDeneb) String() string { func (*BlindedBeaconBlockBodyDeneb) ProtoMessage() {} func (x *BlindedBeaconBlockBodyDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[37] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3056,7 +3230,7 @@ func (x *BlindedBeaconBlockBodyDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindedBeaconBlockBodyDeneb.ProtoReflect.Descriptor instead. func (*BlindedBeaconBlockBodyDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{37} + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{39} } func (x *BlindedBeaconBlockBodyDeneb) GetRandaoReveal() []byte { @@ -3143,34 +3317,33 @@ func (x *BlindedBeaconBlockBodyDeneb) GetBlobKzgCommitments() [][]byte { return nil } -type ValidatorRegistrationV1 struct { +type SignedBeaconBlockContentsElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FeeRecipient []byte `protobuf:"bytes,1,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - GasLimit uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Pubkey []byte `protobuf:"bytes,4,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` + Block *SignedBeaconBlockElectra `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + KzgProofs [][]byte `protobuf:"bytes,2,rep,name=kzg_proofs,json=kzgProofs,proto3" json:"kzg_proofs,omitempty" ssz-max:"4096" ssz-size:"?,48"` + Blobs [][]byte `protobuf:"bytes,3,rep,name=blobs,proto3" json:"blobs,omitempty" ssz-max:"4096" ssz-size:"?,131072"` } -func (x *ValidatorRegistrationV1) Reset() { - *x = ValidatorRegistrationV1{} +func (x *SignedBeaconBlockContentsElectra) Reset() { + *x = SignedBeaconBlockContentsElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[38] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ValidatorRegistrationV1) String() string { +func (x *SignedBeaconBlockContentsElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ValidatorRegistrationV1) ProtoMessage() {} +func (*SignedBeaconBlockContentsElectra) ProtoMessage() {} -func (x *ValidatorRegistrationV1) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[38] +func (x *SignedBeaconBlockContentsElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3181,64 +3354,59 @@ func (x *ValidatorRegistrationV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ValidatorRegistrationV1.ProtoReflect.Descriptor instead. -func (*ValidatorRegistrationV1) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{38} +// Deprecated: Use SignedBeaconBlockContentsElectra.ProtoReflect.Descriptor instead. +func (*SignedBeaconBlockContentsElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{40} } -func (x *ValidatorRegistrationV1) GetFeeRecipient() []byte { +func (x *SignedBeaconBlockContentsElectra) GetBlock() *SignedBeaconBlockElectra { if x != nil { - return x.FeeRecipient + return x.Block } return nil } -func (x *ValidatorRegistrationV1) GetGasLimit() uint64 { - if x != nil { - return x.GasLimit - } - return 0 -} - -func (x *ValidatorRegistrationV1) GetTimestamp() uint64 { +func (x *SignedBeaconBlockContentsElectra) GetKzgProofs() [][]byte { if x != nil { - return x.Timestamp + return x.KzgProofs } - return 0 + return nil } -func (x *ValidatorRegistrationV1) GetPubkey() []byte { +func (x *SignedBeaconBlockContentsElectra) GetBlobs() [][]byte { if x != nil { - return x.Pubkey + return x.Blobs } return nil } -type SignedValidatorRegistrationsV1 struct { +type BeaconBlockContentsElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Messages []*SignedValidatorRegistrationV1 `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + Block *BeaconBlockElectra `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + KzgProofs [][]byte `protobuf:"bytes,2,rep,name=kzg_proofs,json=kzgProofs,proto3" json:"kzg_proofs,omitempty" ssz-max:"4096" ssz-size:"?,48"` + Blobs [][]byte `protobuf:"bytes,3,rep,name=blobs,proto3" json:"blobs,omitempty" ssz-max:"4096" ssz-size:"?,131072"` } -func (x *SignedValidatorRegistrationsV1) Reset() { - *x = SignedValidatorRegistrationsV1{} +func (x *BeaconBlockContentsElectra) Reset() { + *x = BeaconBlockContentsElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[39] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SignedValidatorRegistrationsV1) String() string { +func (x *BeaconBlockContentsElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SignedValidatorRegistrationsV1) ProtoMessage() {} +func (*BeaconBlockContentsElectra) ProtoMessage() {} -func (x *SignedValidatorRegistrationsV1) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[39] +func (x *BeaconBlockContentsElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3249,44 +3417,58 @@ func (x *SignedValidatorRegistrationsV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SignedValidatorRegistrationsV1.ProtoReflect.Descriptor instead. -func (*SignedValidatorRegistrationsV1) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{39} +// Deprecated: Use BeaconBlockContentsElectra.ProtoReflect.Descriptor instead. +func (*BeaconBlockContentsElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{41} } -func (x *SignedValidatorRegistrationsV1) GetMessages() []*SignedValidatorRegistrationV1 { +func (x *BeaconBlockContentsElectra) GetBlock() *BeaconBlockElectra { if x != nil { - return x.Messages + return x.Block } return nil } -type SignedValidatorRegistrationV1 struct { +func (x *BeaconBlockContentsElectra) GetKzgProofs() [][]byte { + if x != nil { + return x.KzgProofs + } + return nil +} + +func (x *BeaconBlockContentsElectra) GetBlobs() [][]byte { + if x != nil { + return x.Blobs + } + return nil +} + +type SignedBeaconBlockElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Message *ValidatorRegistrationV1 `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + Block *BeaconBlockElectra `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` } -func (x *SignedValidatorRegistrationV1) Reset() { - *x = SignedValidatorRegistrationV1{} +func (x *SignedBeaconBlockElectra) Reset() { + *x = SignedBeaconBlockElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[40] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SignedValidatorRegistrationV1) String() string { +func (x *SignedBeaconBlockElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SignedValidatorRegistrationV1) ProtoMessage() {} +func (*SignedBeaconBlockElectra) ProtoMessage() {} -func (x *SignedValidatorRegistrationV1) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[40] +func (x *SignedBeaconBlockElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3297,52 +3479,54 @@ func (x *SignedValidatorRegistrationV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SignedValidatorRegistrationV1.ProtoReflect.Descriptor instead. -func (*SignedValidatorRegistrationV1) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{40} +// Deprecated: Use SignedBeaconBlockElectra.ProtoReflect.Descriptor instead. +func (*SignedBeaconBlockElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{42} } -func (x *SignedValidatorRegistrationV1) GetMessage() *ValidatorRegistrationV1 { +func (x *SignedBeaconBlockElectra) GetBlock() *BeaconBlockElectra { if x != nil { - return x.Message + return x.Block } return nil } -func (x *SignedValidatorRegistrationV1) GetSignature() []byte { +func (x *SignedBeaconBlockElectra) GetSignature() []byte { if x != nil { return x.Signature } return nil } -type BuilderBid struct { +type BeaconBlockElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Header *v1.ExecutionPayloadHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty" ssz-size:"32"` - Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` + Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` + ProposerIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + ParentRoot []byte `protobuf:"bytes,3,opt,name=parent_root,json=parentRoot,proto3" json:"parent_root,omitempty" ssz-size:"32"` + StateRoot []byte `protobuf:"bytes,4,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + Body *BeaconBlockBodyElectra `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` } -func (x *BuilderBid) Reset() { - *x = BuilderBid{} +func (x *BeaconBlockElectra) Reset() { + *x = BeaconBlockElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[41] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *BuilderBid) String() string { +func (x *BeaconBlockElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BuilderBid) ProtoMessage() {} +func (*BeaconBlockElectra) ProtoMessage() {} -func (x *BuilderBid) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[41] +func (x *BeaconBlockElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3353,58 +3537,83 @@ func (x *BuilderBid) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BuilderBid.ProtoReflect.Descriptor instead. -func (*BuilderBid) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{41} +// Deprecated: Use BeaconBlockElectra.ProtoReflect.Descriptor instead. +func (*BeaconBlockElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{43} } -func (x *BuilderBid) GetHeader() *v1.ExecutionPayloadHeader { +func (x *BeaconBlockElectra) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { if x != nil { - return x.Header + return x.Slot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +func (x *BeaconBlockElectra) GetProposerIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.ProposerIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *BeaconBlockElectra) GetParentRoot() []byte { + if x != nil { + return x.ParentRoot } return nil } -func (x *BuilderBid) GetValue() []byte { +func (x *BeaconBlockElectra) GetStateRoot() []byte { if x != nil { - return x.Value + return x.StateRoot } return nil } -func (x *BuilderBid) GetPubkey() []byte { +func (x *BeaconBlockElectra) GetBody() *BeaconBlockBodyElectra { if x != nil { - return x.Pubkey + return x.Body } return nil } -type SignedBuilderBid struct { +type BeaconBlockBodyElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Message *BuilderBid `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + RandaoReveal []byte `protobuf:"bytes,1,opt,name=randao_reveal,json=randaoReveal,proto3" json:"randao_reveal,omitempty" ssz-size:"96"` + Eth1Data *Eth1Data `protobuf:"bytes,2,opt,name=eth1_data,json=eth1Data,proto3" json:"eth1_data,omitempty"` + Graffiti []byte `protobuf:"bytes,3,opt,name=graffiti,proto3" json:"graffiti,omitempty" ssz-size:"32"` + ProposerSlashings []*ProposerSlashing `protobuf:"bytes,4,rep,name=proposer_slashings,json=proposerSlashings,proto3" json:"proposer_slashings,omitempty" ssz-max:"16"` + AttesterSlashings []*AttesterSlashingElectra `protobuf:"bytes,5,rep,name=attester_slashings,json=attesterSlashings,proto3" json:"attester_slashings,omitempty" ssz-max:"1"` + Attestations []*AttestationElectra `protobuf:"bytes,6,rep,name=attestations,proto3" json:"attestations,omitempty" ssz-max:"8"` + Deposits []*Deposit `protobuf:"bytes,7,rep,name=deposits,proto3" json:"deposits,omitempty" ssz-max:"16"` + VoluntaryExits []*SignedVoluntaryExit `protobuf:"bytes,8,rep,name=voluntary_exits,json=voluntaryExits,proto3" json:"voluntary_exits,omitempty" ssz-max:"16"` + SyncAggregate *SyncAggregate `protobuf:"bytes,9,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + ExecutionPayload *v1.ExecutionPayloadElectra `protobuf:"bytes,10,opt,name=execution_payload,json=executionPayload,proto3" json:"execution_payload,omitempty"` + BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` + BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + Consolidations []*SignedConsolidation `protobuf:"bytes,13,rep,name=consolidations,proto3" json:"consolidations,omitempty" ssz-max:"1"` } -func (x *SignedBuilderBid) Reset() { - *x = SignedBuilderBid{} +func (x *BeaconBlockBodyElectra) Reset() { + *x = BeaconBlockBodyElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[42] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SignedBuilderBid) String() string { +func (x *BeaconBlockBodyElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SignedBuilderBid) ProtoMessage() {} +func (*BeaconBlockBodyElectra) ProtoMessage() {} -func (x *SignedBuilderBid) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[42] +func (x *BeaconBlockBodyElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3415,114 +3624,128 @@ func (x *SignedBuilderBid) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SignedBuilderBid.ProtoReflect.Descriptor instead. -func (*SignedBuilderBid) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{42} +// Deprecated: Use BeaconBlockBodyElectra.ProtoReflect.Descriptor instead. +func (*BeaconBlockBodyElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{44} } -func (x *SignedBuilderBid) GetMessage() *BuilderBid { +func (x *BeaconBlockBodyElectra) GetRandaoReveal() []byte { if x != nil { - return x.Message + return x.RandaoReveal } return nil } -func (x *SignedBuilderBid) GetSignature() []byte { +func (x *BeaconBlockBodyElectra) GetEth1Data() *Eth1Data { if x != nil { - return x.Signature + return x.Eth1Data } return nil } -type BuilderBidCapella struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Header *v1.ExecutionPayloadHeaderCapella `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty" ssz-size:"32"` - Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` +func (x *BeaconBlockBodyElectra) GetGraffiti() []byte { + if x != nil { + return x.Graffiti + } + return nil } -func (x *BuilderBidCapella) Reset() { - *x = BuilderBidCapella{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *BeaconBlockBodyElectra) GetProposerSlashings() []*ProposerSlashing { + if x != nil { + return x.ProposerSlashings } + return nil } -func (x *BuilderBidCapella) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *BeaconBlockBodyElectra) GetAttesterSlashings() []*AttesterSlashingElectra { + if x != nil { + return x.AttesterSlashings + } + return nil } -func (*BuilderBidCapella) ProtoMessage() {} +func (x *BeaconBlockBodyElectra) GetAttestations() []*AttestationElectra { + if x != nil { + return x.Attestations + } + return nil +} -func (x *BuilderBidCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *BeaconBlockBodyElectra) GetDeposits() []*Deposit { + if x != nil { + return x.Deposits } - return mi.MessageOf(x) + return nil } -// Deprecated: Use BuilderBidCapella.ProtoReflect.Descriptor instead. -func (*BuilderBidCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{43} +func (x *BeaconBlockBodyElectra) GetVoluntaryExits() []*SignedVoluntaryExit { + if x != nil { + return x.VoluntaryExits + } + return nil } -func (x *BuilderBidCapella) GetHeader() *v1.ExecutionPayloadHeaderCapella { +func (x *BeaconBlockBodyElectra) GetSyncAggregate() *SyncAggregate { if x != nil { - return x.Header + return x.SyncAggregate } return nil } -func (x *BuilderBidCapella) GetValue() []byte { +func (x *BeaconBlockBodyElectra) GetExecutionPayload() *v1.ExecutionPayloadElectra { if x != nil { - return x.Value + return x.ExecutionPayload } return nil } -func (x *BuilderBidCapella) GetPubkey() []byte { +func (x *BeaconBlockBodyElectra) GetBlsToExecutionChanges() []*SignedBLSToExecutionChange { if x != nil { - return x.Pubkey + return x.BlsToExecutionChanges } return nil } -type SignedBuilderBidCapella struct { +func (x *BeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { + if x != nil { + return x.BlobKzgCommitments + } + return nil +} + +func (x *BeaconBlockBodyElectra) GetConsolidations() []*SignedConsolidation { + if x != nil { + return x.Consolidations + } + return nil +} + +type SignedBlindedBeaconBlockElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Message *BuilderBidCapella `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + Message *BlindedBeaconBlockElectra `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` } -func (x *SignedBuilderBidCapella) Reset() { - *x = SignedBuilderBidCapella{} +func (x *SignedBlindedBeaconBlockElectra) Reset() { + *x = SignedBlindedBeaconBlockElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[44] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SignedBuilderBidCapella) String() string { +func (x *SignedBlindedBeaconBlockElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SignedBuilderBidCapella) ProtoMessage() {} +func (*SignedBlindedBeaconBlockElectra) ProtoMessage() {} -func (x *SignedBuilderBidCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[44] +func (x *SignedBlindedBeaconBlockElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3533,53 +3756,54 @@ func (x *SignedBuilderBidCapella) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SignedBuilderBidCapella.ProtoReflect.Descriptor instead. -func (*SignedBuilderBidCapella) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{44} +// Deprecated: Use SignedBlindedBeaconBlockElectra.ProtoReflect.Descriptor instead. +func (*SignedBlindedBeaconBlockElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{45} } -func (x *SignedBuilderBidCapella) GetMessage() *BuilderBidCapella { +func (x *SignedBlindedBeaconBlockElectra) GetMessage() *BlindedBeaconBlockElectra { if x != nil { return x.Message } return nil } -func (x *SignedBuilderBidCapella) GetSignature() []byte { +func (x *SignedBlindedBeaconBlockElectra) GetSignature() []byte { if x != nil { return x.Signature } return nil } -type BuilderBidDeneb struct { +type BlindedBeaconBlockElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Header *v1.ExecutionPayloadHeaderDeneb `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - BlobKzgCommitments [][]byte `protobuf:"bytes,2,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty" ssz-size:"32"` - Pubkey []byte `protobuf:"bytes,4,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` + Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` + ProposerIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + ParentRoot []byte `protobuf:"bytes,3,opt,name=parent_root,json=parentRoot,proto3" json:"parent_root,omitempty" ssz-size:"32"` + StateRoot []byte `protobuf:"bytes,4,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + Body *BlindedBeaconBlockBodyElectra `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` } -func (x *BuilderBidDeneb) Reset() { - *x = BuilderBidDeneb{} +func (x *BlindedBeaconBlockElectra) Reset() { + *x = BlindedBeaconBlockElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[45] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *BuilderBidDeneb) String() string { +func (x *BlindedBeaconBlockElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BuilderBidDeneb) ProtoMessage() {} +func (*BlindedBeaconBlockElectra) ProtoMessage() {} -func (x *BuilderBidDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[45] +func (x *BlindedBeaconBlockElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3590,65 +3814,82 @@ func (x *BuilderBidDeneb) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BuilderBidDeneb.ProtoReflect.Descriptor instead. -func (*BuilderBidDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{45} +// Deprecated: Use BlindedBeaconBlockElectra.ProtoReflect.Descriptor instead. +func (*BlindedBeaconBlockElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{46} } -func (x *BuilderBidDeneb) GetHeader() *v1.ExecutionPayloadHeaderDeneb { +func (x *BlindedBeaconBlockElectra) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { if x != nil { - return x.Header + return x.Slot } - return nil + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) } -func (x *BuilderBidDeneb) GetBlobKzgCommitments() [][]byte { +func (x *BlindedBeaconBlockElectra) GetProposerIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { if x != nil { - return x.BlobKzgCommitments + return x.ProposerIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *BlindedBeaconBlockElectra) GetParentRoot() []byte { + if x != nil { + return x.ParentRoot } return nil } -func (x *BuilderBidDeneb) GetValue() []byte { +func (x *BlindedBeaconBlockElectra) GetStateRoot() []byte { if x != nil { - return x.Value + return x.StateRoot } return nil } -func (x *BuilderBidDeneb) GetPubkey() []byte { +func (x *BlindedBeaconBlockElectra) GetBody() *BlindedBeaconBlockBodyElectra { if x != nil { - return x.Pubkey + return x.Body } return nil } -type SignedBuilderBidDeneb struct { +type BlindedBeaconBlockBodyElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Message *BuilderBidDeneb `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + RandaoReveal []byte `protobuf:"bytes,1,opt,name=randao_reveal,json=randaoReveal,proto3" json:"randao_reveal,omitempty" ssz-size:"96"` + Eth1Data *Eth1Data `protobuf:"bytes,2,opt,name=eth1_data,json=eth1Data,proto3" json:"eth1_data,omitempty"` + Graffiti []byte `protobuf:"bytes,3,opt,name=graffiti,proto3" json:"graffiti,omitempty" ssz-size:"32"` + ProposerSlashings []*ProposerSlashing `protobuf:"bytes,4,rep,name=proposer_slashings,json=proposerSlashings,proto3" json:"proposer_slashings,omitempty" ssz-max:"16"` + AttesterSlashings []*AttesterSlashingElectra `protobuf:"bytes,5,rep,name=attester_slashings,json=attesterSlashings,proto3" json:"attester_slashings,omitempty" ssz-max:"1"` + Attestations []*AttestationElectra `protobuf:"bytes,6,rep,name=attestations,proto3" json:"attestations,omitempty" ssz-max:"8"` + Deposits []*Deposit `protobuf:"bytes,7,rep,name=deposits,proto3" json:"deposits,omitempty" ssz-max:"16"` + VoluntaryExits []*SignedVoluntaryExit `protobuf:"bytes,8,rep,name=voluntary_exits,json=voluntaryExits,proto3" json:"voluntary_exits,omitempty" ssz-max:"16"` + SyncAggregate *SyncAggregate `protobuf:"bytes,9,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + ExecutionPayloadHeader *v1.ExecutionPayloadHeaderElectra `protobuf:"bytes,10,opt,name=execution_payload_header,json=executionPayloadHeader,proto3" json:"execution_payload_header,omitempty"` + BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` + BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` } -func (x *SignedBuilderBidDeneb) Reset() { - *x = SignedBuilderBidDeneb{} +func (x *BlindedBeaconBlockBodyElectra) Reset() { + *x = BlindedBeaconBlockBodyElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[46] + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SignedBuilderBidDeneb) String() string { +func (x *BlindedBeaconBlockBodyElectra) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SignedBuilderBidDeneb) ProtoMessage() {} +func (*BlindedBeaconBlockBodyElectra) ProtoMessage() {} -func (x *SignedBuilderBidDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[46] +func (x *BlindedBeaconBlockBodyElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3659,122 +3900,108 @@ func (x *SignedBuilderBidDeneb) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SignedBuilderBidDeneb.ProtoReflect.Descriptor instead. -func (*SignedBuilderBidDeneb) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{46} +// Deprecated: Use BlindedBeaconBlockBodyElectra.ProtoReflect.Descriptor instead. +func (*BlindedBeaconBlockBodyElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{47} } -func (x *SignedBuilderBidDeneb) GetMessage() *BuilderBidDeneb { +func (x *BlindedBeaconBlockBodyElectra) GetRandaoReveal() []byte { if x != nil { - return x.Message + return x.RandaoReveal } return nil } -func (x *SignedBuilderBidDeneb) GetSignature() []byte { +func (x *BlindedBeaconBlockBodyElectra) GetEth1Data() *Eth1Data { if x != nil { - return x.Signature + return x.Eth1Data } return nil } -type BlobSidecar struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3" json:"blob,omitempty" ssz-size:"131072"` - KzgCommitment []byte `protobuf:"bytes,3,opt,name=kzg_commitment,json=kzgCommitment,proto3" json:"kzg_commitment,omitempty" ssz-size:"48"` - KzgProof []byte `protobuf:"bytes,4,opt,name=kzg_proof,json=kzgProof,proto3" json:"kzg_proof,omitempty" ssz-size:"48"` - SignedBlockHeader *SignedBeaconBlockHeader `protobuf:"bytes,5,opt,name=signed_block_header,json=signedBlockHeader,proto3" json:"signed_block_header,omitempty"` - CommitmentInclusionProof [][]byte `protobuf:"bytes,6,rep,name=commitment_inclusion_proof,json=commitmentInclusionProof,proto3" json:"commitment_inclusion_proof,omitempty" ssz-size:"17,32"` -} - -func (x *BlobSidecar) Reset() { - *x = BlobSidecar{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *BlindedBeaconBlockBodyElectra) GetGraffiti() []byte { + if x != nil { + return x.Graffiti } + return nil } -func (x *BlobSidecar) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *BlindedBeaconBlockBodyElectra) GetProposerSlashings() []*ProposerSlashing { + if x != nil { + return x.ProposerSlashings + } + return nil } -func (*BlobSidecar) ProtoMessage() {} - -func (x *BlobSidecar) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[47] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *BlindedBeaconBlockBodyElectra) GetAttesterSlashings() []*AttesterSlashingElectra { + if x != nil { + return x.AttesterSlashings } - return mi.MessageOf(x) + return nil } -// Deprecated: Use BlobSidecar.ProtoReflect.Descriptor instead. -func (*BlobSidecar) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{47} +func (x *BlindedBeaconBlockBodyElectra) GetAttestations() []*AttestationElectra { + if x != nil { + return x.Attestations + } + return nil } -func (x *BlobSidecar) GetIndex() uint64 { +func (x *BlindedBeaconBlockBodyElectra) GetDeposits() []*Deposit { if x != nil { - return x.Index + return x.Deposits } - return 0 + return nil } -func (x *BlobSidecar) GetBlob() []byte { +func (x *BlindedBeaconBlockBodyElectra) GetVoluntaryExits() []*SignedVoluntaryExit { if x != nil { - return x.Blob + return x.VoluntaryExits } return nil } -func (x *BlobSidecar) GetKzgCommitment() []byte { +func (x *BlindedBeaconBlockBodyElectra) GetSyncAggregate() *SyncAggregate { if x != nil { - return x.KzgCommitment + return x.SyncAggregate } return nil } -func (x *BlobSidecar) GetKzgProof() []byte { +func (x *BlindedBeaconBlockBodyElectra) GetExecutionPayloadHeader() *v1.ExecutionPayloadHeaderElectra { if x != nil { - return x.KzgProof + return x.ExecutionPayloadHeader } return nil } -func (x *BlobSidecar) GetSignedBlockHeader() *SignedBeaconBlockHeader { +func (x *BlindedBeaconBlockBodyElectra) GetBlsToExecutionChanges() []*SignedBLSToExecutionChange { if x != nil { - return x.SignedBlockHeader + return x.BlsToExecutionChanges } return nil } -func (x *BlobSidecar) GetCommitmentInclusionProof() [][]byte { +func (x *BlindedBeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { if x != nil { - return x.CommitmentInclusionProof + return x.BlobKzgCommitments } return nil } -type BlobSidecars struct { +type ValidatorRegistrationV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sidecars []*BlobSidecar `protobuf:"bytes,1,rep,name=sidecars,proto3" json:"sidecars,omitempty" ssz-max:"6"` + FeeRecipient []byte `protobuf:"bytes,1,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` + GasLimit uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Pubkey []byte `protobuf:"bytes,4,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` } -func (x *BlobSidecars) Reset() { - *x = BlobSidecars{} +func (x *ValidatorRegistrationV1) Reset() { + *x = ValidatorRegistrationV1{} if protoimpl.UnsafeEnabled { mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3782,13 +4009,13 @@ func (x *BlobSidecars) Reset() { } } -func (x *BlobSidecars) String() string { +func (x *ValidatorRegistrationV1) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BlobSidecars) ProtoMessage() {} +func (*ValidatorRegistrationV1) ProtoMessage() {} -func (x *BlobSidecars) ProtoReflect() protoreflect.Message { +func (x *ValidatorRegistrationV1) ProtoReflect() protoreflect.Message { mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3800,31 +4027,49 @@ func (x *BlobSidecars) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BlobSidecars.ProtoReflect.Descriptor instead. -func (*BlobSidecars) Descriptor() ([]byte, []int) { +// Deprecated: Use ValidatorRegistrationV1.ProtoReflect.Descriptor instead. +func (*ValidatorRegistrationV1) Descriptor() ([]byte, []int) { return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{48} } -func (x *BlobSidecars) GetSidecars() []*BlobSidecar { +func (x *ValidatorRegistrationV1) GetFeeRecipient() []byte { if x != nil { - return x.Sidecars + return x.FeeRecipient } return nil } -type Deposit_Data struct { +func (x *ValidatorRegistrationV1) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit + } + return 0 +} + +func (x *ValidatorRegistrationV1) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *ValidatorRegistrationV1) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +type SignedValidatorRegistrationsV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" spec-name:"pubkey" ssz-size:"48"` - WithdrawalCredentials []byte `protobuf:"bytes,2,opt,name=withdrawal_credentials,json=withdrawalCredentials,proto3" json:"withdrawal_credentials,omitempty" ssz-size:"32"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + Messages []*SignedValidatorRegistrationV1 `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` } -func (x *Deposit_Data) Reset() { - *x = Deposit_Data{} +func (x *SignedValidatorRegistrationsV1) Reset() { + *x = SignedValidatorRegistrationsV1{} if protoimpl.UnsafeEnabled { mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3832,13 +4077,13 @@ func (x *Deposit_Data) Reset() { } } -func (x *Deposit_Data) String() string { +func (x *SignedValidatorRegistrationsV1) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Deposit_Data) ProtoMessage() {} +func (*SignedValidatorRegistrationsV1) ProtoMessage() {} -func (x *Deposit_Data) ProtoReflect() protoreflect.Message { +func (x *SignedValidatorRegistrationsV1) ProtoReflect() protoreflect.Message { mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3850,28 +4095,629 @@ func (x *Deposit_Data) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Deposit_Data.ProtoReflect.Descriptor instead. -func (*Deposit_Data) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{10, 0} +// Deprecated: Use SignedValidatorRegistrationsV1.ProtoReflect.Descriptor instead. +func (*SignedValidatorRegistrationsV1) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{49} } -func (x *Deposit_Data) GetPublicKey() []byte { +func (x *SignedValidatorRegistrationsV1) GetMessages() []*SignedValidatorRegistrationV1 { if x != nil { - return x.PublicKey + return x.Messages } return nil } -func (x *Deposit_Data) GetWithdrawalCredentials() []byte { - if x != nil { - return x.WithdrawalCredentials - } - return nil +type SignedValidatorRegistrationV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *ValidatorRegistrationV1 `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` } -func (x *Deposit_Data) GetAmount() uint64 { - if x != nil { - return x.Amount +func (x *SignedValidatorRegistrationV1) Reset() { + *x = SignedValidatorRegistrationV1{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedValidatorRegistrationV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedValidatorRegistrationV1) ProtoMessage() {} + +func (x *SignedValidatorRegistrationV1) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedValidatorRegistrationV1.ProtoReflect.Descriptor instead. +func (*SignedValidatorRegistrationV1) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{50} +} + +func (x *SignedValidatorRegistrationV1) GetMessage() *ValidatorRegistrationV1 { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedValidatorRegistrationV1) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type BuilderBid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *v1.ExecutionPayloadHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty" ssz-size:"32"` + Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` +} + +func (x *BuilderBid) Reset() { + *x = BuilderBid{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuilderBid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuilderBid) ProtoMessage() {} + +func (x *BuilderBid) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[51] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BuilderBid.ProtoReflect.Descriptor instead. +func (*BuilderBid) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{51} +} + +func (x *BuilderBid) GetHeader() *v1.ExecutionPayloadHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BuilderBid) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *BuilderBid) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +type SignedBuilderBid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *BuilderBid `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *SignedBuilderBid) Reset() { + *x = SignedBuilderBid{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedBuilderBid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedBuilderBid) ProtoMessage() {} + +func (x *SignedBuilderBid) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[52] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedBuilderBid.ProtoReflect.Descriptor instead. +func (*SignedBuilderBid) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{52} +} + +func (x *SignedBuilderBid) GetMessage() *BuilderBid { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedBuilderBid) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type BuilderBidCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *v1.ExecutionPayloadHeaderCapella `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty" ssz-size:"32"` + Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` +} + +func (x *BuilderBidCapella) Reset() { + *x = BuilderBidCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuilderBidCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuilderBidCapella) ProtoMessage() {} + +func (x *BuilderBidCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[53] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BuilderBidCapella.ProtoReflect.Descriptor instead. +func (*BuilderBidCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{53} +} + +func (x *BuilderBidCapella) GetHeader() *v1.ExecutionPayloadHeaderCapella { + if x != nil { + return x.Header + } + return nil +} + +func (x *BuilderBidCapella) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *BuilderBidCapella) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +type SignedBuilderBidCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *BuilderBidCapella `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *SignedBuilderBidCapella) Reset() { + *x = SignedBuilderBidCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedBuilderBidCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedBuilderBidCapella) ProtoMessage() {} + +func (x *SignedBuilderBidCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[54] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedBuilderBidCapella.ProtoReflect.Descriptor instead. +func (*SignedBuilderBidCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{54} +} + +func (x *SignedBuilderBidCapella) GetMessage() *BuilderBidCapella { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedBuilderBidCapella) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type BuilderBidDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *v1.ExecutionPayloadHeaderDeneb `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + BlobKzgCommitments [][]byte `protobuf:"bytes,2,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty" ssz-size:"32"` + Pubkey []byte `protobuf:"bytes,4,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` +} + +func (x *BuilderBidDeneb) Reset() { + *x = BuilderBidDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuilderBidDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuilderBidDeneb) ProtoMessage() {} + +func (x *BuilderBidDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[55] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BuilderBidDeneb.ProtoReflect.Descriptor instead. +func (*BuilderBidDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{55} +} + +func (x *BuilderBidDeneb) GetHeader() *v1.ExecutionPayloadHeaderDeneb { + if x != nil { + return x.Header + } + return nil +} + +func (x *BuilderBidDeneb) GetBlobKzgCommitments() [][]byte { + if x != nil { + return x.BlobKzgCommitments + } + return nil +} + +func (x *BuilderBidDeneb) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *BuilderBidDeneb) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +type SignedBuilderBidDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *BuilderBidDeneb `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *SignedBuilderBidDeneb) Reset() { + *x = SignedBuilderBidDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedBuilderBidDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedBuilderBidDeneb) ProtoMessage() {} + +func (x *SignedBuilderBidDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[56] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedBuilderBidDeneb.ProtoReflect.Descriptor instead. +func (*SignedBuilderBidDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{56} +} + +func (x *SignedBuilderBidDeneb) GetMessage() *BuilderBidDeneb { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedBuilderBidDeneb) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type BlobSidecar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3" json:"blob,omitempty" ssz-size:"131072"` + KzgCommitment []byte `protobuf:"bytes,3,opt,name=kzg_commitment,json=kzgCommitment,proto3" json:"kzg_commitment,omitempty" ssz-size:"48"` + KzgProof []byte `protobuf:"bytes,4,opt,name=kzg_proof,json=kzgProof,proto3" json:"kzg_proof,omitempty" ssz-size:"48"` + SignedBlockHeader *SignedBeaconBlockHeader `protobuf:"bytes,5,opt,name=signed_block_header,json=signedBlockHeader,proto3" json:"signed_block_header,omitempty"` + CommitmentInclusionProof [][]byte `protobuf:"bytes,6,rep,name=commitment_inclusion_proof,json=commitmentInclusionProof,proto3" json:"commitment_inclusion_proof,omitempty" ssz-size:"17,32"` +} + +func (x *BlobSidecar) Reset() { + *x = BlobSidecar{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlobSidecar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlobSidecar) ProtoMessage() {} + +func (x *BlobSidecar) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[57] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlobSidecar.ProtoReflect.Descriptor instead. +func (*BlobSidecar) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{57} +} + +func (x *BlobSidecar) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *BlobSidecar) GetBlob() []byte { + if x != nil { + return x.Blob + } + return nil +} + +func (x *BlobSidecar) GetKzgCommitment() []byte { + if x != nil { + return x.KzgCommitment + } + return nil +} + +func (x *BlobSidecar) GetKzgProof() []byte { + if x != nil { + return x.KzgProof + } + return nil +} + +func (x *BlobSidecar) GetSignedBlockHeader() *SignedBeaconBlockHeader { + if x != nil { + return x.SignedBlockHeader + } + return nil +} + +func (x *BlobSidecar) GetCommitmentInclusionProof() [][]byte { + if x != nil { + return x.CommitmentInclusionProof + } + return nil +} + +type BlobSidecars struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sidecars []*BlobSidecar `protobuf:"bytes,1,rep,name=sidecars,proto3" json:"sidecars,omitempty" ssz-max:"6"` +} + +func (x *BlobSidecars) Reset() { + *x = BlobSidecars{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlobSidecars) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlobSidecars) ProtoMessage() {} + +func (x *BlobSidecars) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[58] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlobSidecars.ProtoReflect.Descriptor instead. +func (*BlobSidecars) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{58} +} + +func (x *BlobSidecars) GetSidecars() []*BlobSidecar { + if x != nil { + return x.Sidecars + } + return nil +} + +type Deposit_Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" spec-name:"pubkey" ssz-size:"48"` + WithdrawalCredentials []byte `protobuf:"bytes,2,opt,name=withdrawal_credentials,json=withdrawalCredentials,proto3" json:"withdrawal_credentials,omitempty" ssz-size:"32"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *Deposit_Data) Reset() { + *x = Deposit_Data{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deposit_Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deposit_Data) ProtoMessage() {} + +func (x *Deposit_Data) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[59] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Deposit_Data.ProtoReflect.Descriptor instead. +func (*Deposit_Data) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *Deposit_Data) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *Deposit_Data) GetWithdrawalCredentials() []byte { + if x != nil { + return x.WithdrawalCredentials + } + return nil +} + +func (x *Deposit_Data) GetAmount() uint64 { + if x != nil { + return x.Amount } return 0 } @@ -3899,313 +4745,156 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x05, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, - 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, - 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, - 0x12, 0x51, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x69, 0x70, 0x5f, + 0x37, 0x32, 0x35, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x07, 0x0a, 0x18, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, + 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x48, 0x0a, 0x06, 0x61, + 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, + 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x51, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, + 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x67, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, - 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x12, 0x67, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, + 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, + 0x10, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x12, 0x4b, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x61, + 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, + 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x12, 0x4d, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x5b, 0x0a, 0x0d, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, + 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, + 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x53, 0x0a, + 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x04, 0x08, + 0x65, 0x10, 0x66, 0x22, 0x83, 0x07, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x68, + 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, + 0x52, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x4b, 0x0a, 0x09, + 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, + 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x61, 0x0a, 0x11, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x4b, 0x0a, 0x07, - 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, - 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x4d, 0x0a, 0x05, - 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, - 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x5b, 0x0a, 0x0d, 0x62, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x4a, 0x04, 0x08, 0x65, 0x10, 0x66, 0x22, 0xd7, 0x05, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, - 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x45, 0x0a, 0x07, + 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x42, 0x0a, 0x06, 0x61, - 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, - 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, - 0x4b, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, - 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x61, 0x0a, 0x11, - 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, - 0x45, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x5b, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x55, 0x0a, 0x0d, - 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, 0x6e, 0x64, - 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x22, 0xec, 0x02, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x12, 0x5b, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, + 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x12, 0x47, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x55, 0x0a, 0x0d, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x4d, 0x0a, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, - 0x73, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x38, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, - 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, - 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, - 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, - 0x7f, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x3e, 0x0a, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, - 0x61, 0x69, 0x72, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0xd1, 0x04, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, - 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, - 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, - 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, + 0x5b, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, - 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, - 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, - 0x78, 0x69, 0x74, 0x73, 0x22, 0xa4, 0x05, 0x0a, 0x15, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2b, - 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, - 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, - 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, - 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, - 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, - 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, - 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x65, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xec, 0x02, 0x0a, 0x0b, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, + 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, + 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, - 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, - 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, - 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0xa8, 0x01, 0x0a, 0x10, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x31, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x31, 0x12, 0x49, 0x0a, 0x08, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x22, 0xb2, 0x01, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x4e, 0x0a, 0x0d, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, 0x4e, 0x0a, 0x0d, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0x9a, 0x02, 0x0a, 0x07, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x33, 0x33, 0x2c, 0x33, - 0x32, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x1a, 0xb4, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, - 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x0d, 0x56, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x22, 0x75, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, - 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x65, 0x78, 0x69, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x52, 0x04, 0x65, - 0x78, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x45, 0x74, - 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xdb, 0x02, - 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x73, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x38, 0x0a, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf8, 0x02, + 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, + 0x61, 0x69, 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, @@ -4223,75 +4912,559 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x08, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x17, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x7f, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, + 0x61, 0x69, 0x72, 0x12, 0x3e, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xd1, 0x04, 0x0a, 0x0f, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, + 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, + 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, + 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, + 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, + 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, + 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, + 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, + 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x22, 0xa4, 0x05, + 0x0a, 0x15, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, + 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x22, 0xa8, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x5f, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x31, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x32, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x22, + 0xb2, 0x01, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x12, 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x31, 0x12, 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0x22, 0xc7, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0x9a, + 0x02, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x33, + 0x33, 0x2c, 0x33, 0x32, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb4, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, + 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, + 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x0d, + 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, + 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x78, 0x0a, 0x0f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x75, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, + 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x04, + 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, + 0x52, 0x04, 0x65, 0x78, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, + 0x08, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x22, 0xdb, 0x02, 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x62, 0x6f, 0x64, + 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x81, + 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x11, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x10, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x19, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0x37, 0x0a, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x0a, 0x92, 0xb5, 0x18, + 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0d, + 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, + 0x13, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, + 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, + 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, 0x52, 0x11, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x18, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x16, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x85, 0x01, 0x0a, + 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xfa, 0x05, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, + 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, + 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, + 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, + 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, + 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, + 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, + 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, + 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, + 0x51, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x21, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x48, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x1b, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x94, 0x06, 0x0a, 0x1f, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, + 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, + 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, + 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, + 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, + 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, + 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x64, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xc2, + 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x12, 0x43, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, + 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, + 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, + 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, + 0x6f, 0x62, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, + 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, + 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, + 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x7d, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0xad, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x10, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0xbe, 0x01, 0x0a, 0x0d, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, - 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, - 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, 0x52, 0x11, 0x73, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, 0x40, - 0x0a, 0x18, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x16, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0x85, 0x01, 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, - 0x41, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, + 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf6, 0x02, 0x0a, 0x10, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, + 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x22, 0xb3, 0x07, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, + 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, + 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, + 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xfa, 0x05, 0x0a, 0x18, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, - 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, + 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, + 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, + 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, + 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, + 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, + 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, + 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, + 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, + 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, + 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, + 0x02, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, + 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, + 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xf3, 0x06, 0x0a, 0x16, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, @@ -4332,23 +5505,121 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x12, 0x51, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x61, 0x74, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x21, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x48, 0x0a, 0x05, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, + 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, + 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, + 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, + 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, + 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x46, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, + 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8d, + 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, + 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, + 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, - 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8c, 0x03, 0x0a, - 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, + 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, + 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, + 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, + 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, + 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, + 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, + 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, + 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, + 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, + 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x22, 0x84, 0x03, 0x0a, 0x17, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, @@ -4367,568 +5638,410 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x4a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, + 0x46, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, - 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x94, 0x06, 0x0a, 0x1f, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, - 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, - 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, - 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, - 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, - 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, - 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, - 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, - 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, - 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, - 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, - 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, - 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, - 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xcd, 0x07, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, - 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x64, 0x0a, 0x18, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, + 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, - 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x43, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, - 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, - 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, - 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, - 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, - 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, + 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, + 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, + 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x20, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x45, 0x0a, 0x05, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x22, 0x7d, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x22, 0xba, 0x01, 0x0a, 0x1a, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, + 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, + 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, + 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x81, 0x01, + 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, - 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0xf6, 0x02, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, - 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, - 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xb3, 0x07, 0x0a, 0x14, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, - 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, - 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, - 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, - 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, - 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, - 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, - 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, - 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, - 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, - 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, - 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, - 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, - 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, - 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, - 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, - 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, - 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, - 0xf3, 0x06, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, - 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, - 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, - 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, - 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, + 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, + 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x9e, + 0x08, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, + 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, + 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, + 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, + 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, + 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, + 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, - 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, - 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, - 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, - 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, - 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, - 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x46, 0x0a, 0x05, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x22, 0x8d, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, - 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, - 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, - 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, - 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, - 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, - 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, - 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, - 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, - 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, - 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x22, 0x84, 0x03, 0x0a, 0x17, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, - 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xcd, 0x07, 0x0a, 0x1b, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, - 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, - 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, - 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, + 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x59, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, - 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, - 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, - 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, - 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, - 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, - 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, - 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, + 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x22, 0xdd, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, + 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, + 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, + 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, + 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, + 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, 0x52, + 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, + 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, + 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, + 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, + 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, + 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, + 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, + 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, + 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, + 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, + 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, + 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, + 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9c, 0x01, - 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x01, 0x0a, - 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, + 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, + 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, - 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, - 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, - 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5e, 0x0a, 0x13, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x1a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, 0x52, 0x18, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, - 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, - 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x42, 0x9b, 0x01, 0x0a, - 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, - 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, + 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, + 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, + 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, + 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, + 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, + 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, + 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, + 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, + 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, + 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, + 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, + 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, + 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, + 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, + 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, + 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4943,7 +6056,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_beacon_block_proto_rawDescData } -var file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes = make([]protoimpl.MessageInfo, 50) +var file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes = make([]protoimpl.MessageInfo, 60) var file_proto_prysm_v1alpha1_beacon_block_proto_goTypes = []interface{}{ (*GenericSignedBeaconBlock)(nil), // 0: ethereum.eth.v1alpha1.GenericSignedBeaconBlock (*GenericBeaconBlock)(nil), // 1: ethereum.eth.v1alpha1.GenericBeaconBlock @@ -4955,179 +6068,225 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_goTypes = []interface{}{ (*BeaconBlockBodyAltair)(nil), // 7: ethereum.eth.v1alpha1.BeaconBlockBodyAltair (*ProposerSlashing)(nil), // 8: ethereum.eth.v1alpha1.ProposerSlashing (*AttesterSlashing)(nil), // 9: ethereum.eth.v1alpha1.AttesterSlashing - (*Deposit)(nil), // 10: ethereum.eth.v1alpha1.Deposit - (*VoluntaryExit)(nil), // 11: ethereum.eth.v1alpha1.VoluntaryExit - (*SignedVoluntaryExit)(nil), // 12: ethereum.eth.v1alpha1.SignedVoluntaryExit - (*Eth1Data)(nil), // 13: ethereum.eth.v1alpha1.Eth1Data - (*BeaconBlockHeader)(nil), // 14: ethereum.eth.v1alpha1.BeaconBlockHeader - (*SignedBeaconBlockHeader)(nil), // 15: ethereum.eth.v1alpha1.SignedBeaconBlockHeader - (*IndexedAttestation)(nil), // 16: ethereum.eth.v1alpha1.IndexedAttestation - (*SyncAggregate)(nil), // 17: ethereum.eth.v1alpha1.SyncAggregate - (*SignedBeaconBlockBellatrix)(nil), // 18: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix - (*BeaconBlockBellatrix)(nil), // 19: ethereum.eth.v1alpha1.BeaconBlockBellatrix - (*BeaconBlockBodyBellatrix)(nil), // 20: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix - (*SignedBlindedBeaconBlockBellatrix)(nil), // 21: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix - (*BlindedBeaconBlockBellatrix)(nil), // 22: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix - (*BlindedBeaconBlockBodyBellatrix)(nil), // 23: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix - (*SignedBeaconBlockContentsDeneb)(nil), // 24: ethereum.eth.v1alpha1.SignedBeaconBlockContentsDeneb - (*BeaconBlockContentsDeneb)(nil), // 25: ethereum.eth.v1alpha1.BeaconBlockContentsDeneb - (*SignedBeaconBlockDeneb)(nil), // 26: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - (*BeaconBlockDeneb)(nil), // 27: ethereum.eth.v1alpha1.BeaconBlockDeneb - (*BeaconBlockBodyDeneb)(nil), // 28: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb - (*SignedBeaconBlockCapella)(nil), // 29: ethereum.eth.v1alpha1.SignedBeaconBlockCapella - (*BeaconBlockCapella)(nil), // 30: ethereum.eth.v1alpha1.BeaconBlockCapella - (*BeaconBlockBodyCapella)(nil), // 31: ethereum.eth.v1alpha1.BeaconBlockBodyCapella - (*SignedBlindedBeaconBlockCapella)(nil), // 32: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella - (*BlindedBeaconBlockCapella)(nil), // 33: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella - (*BlindedBeaconBlockBodyCapella)(nil), // 34: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella - (*SignedBlindedBeaconBlockDeneb)(nil), // 35: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - (*BlindedBeaconBlockDeneb)(nil), // 36: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb - (*BlindedBeaconBlockBodyDeneb)(nil), // 37: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb - (*ValidatorRegistrationV1)(nil), // 38: ethereum.eth.v1alpha1.ValidatorRegistrationV1 - (*SignedValidatorRegistrationsV1)(nil), // 39: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - (*SignedValidatorRegistrationV1)(nil), // 40: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 - (*BuilderBid)(nil), // 41: ethereum.eth.v1alpha1.BuilderBid - (*SignedBuilderBid)(nil), // 42: ethereum.eth.v1alpha1.SignedBuilderBid - (*BuilderBidCapella)(nil), // 43: ethereum.eth.v1alpha1.BuilderBidCapella - (*SignedBuilderBidCapella)(nil), // 44: ethereum.eth.v1alpha1.SignedBuilderBidCapella - (*BuilderBidDeneb)(nil), // 45: ethereum.eth.v1alpha1.BuilderBidDeneb - (*SignedBuilderBidDeneb)(nil), // 46: ethereum.eth.v1alpha1.SignedBuilderBidDeneb - (*BlobSidecar)(nil), // 47: ethereum.eth.v1alpha1.BlobSidecar - (*BlobSidecars)(nil), // 48: ethereum.eth.v1alpha1.BlobSidecars - (*Deposit_Data)(nil), // 49: ethereum.eth.v1alpha1.Deposit.Data - (*Attestation)(nil), // 50: ethereum.eth.v1alpha1.Attestation - (*AttestationData)(nil), // 51: ethereum.eth.v1alpha1.AttestationData - (*v1.ExecutionPayload)(nil), // 52: ethereum.engine.v1.ExecutionPayload - (*v1.ExecutionPayloadHeader)(nil), // 53: ethereum.engine.v1.ExecutionPayloadHeader - (*v1.ExecutionPayloadDeneb)(nil), // 54: ethereum.engine.v1.ExecutionPayloadDeneb - (*SignedBLSToExecutionChange)(nil), // 55: ethereum.eth.v1alpha1.SignedBLSToExecutionChange - (*v1.ExecutionPayloadCapella)(nil), // 56: ethereum.engine.v1.ExecutionPayloadCapella - (*v1.ExecutionPayloadHeaderCapella)(nil), // 57: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*v1.ExecutionPayloadHeaderDeneb)(nil), // 58: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*AttesterSlashingElectra)(nil), // 10: ethereum.eth.v1alpha1.AttesterSlashingElectra + (*Deposit)(nil), // 11: ethereum.eth.v1alpha1.Deposit + (*VoluntaryExit)(nil), // 12: ethereum.eth.v1alpha1.VoluntaryExit + (*SignedVoluntaryExit)(nil), // 13: ethereum.eth.v1alpha1.SignedVoluntaryExit + (*Eth1Data)(nil), // 14: ethereum.eth.v1alpha1.Eth1Data + (*BeaconBlockHeader)(nil), // 15: ethereum.eth.v1alpha1.BeaconBlockHeader + (*SignedBeaconBlockHeader)(nil), // 16: ethereum.eth.v1alpha1.SignedBeaconBlockHeader + (*IndexedAttestation)(nil), // 17: ethereum.eth.v1alpha1.IndexedAttestation + (*IndexedAttestationElectra)(nil), // 18: ethereum.eth.v1alpha1.IndexedAttestationElectra + (*SyncAggregate)(nil), // 19: ethereum.eth.v1alpha1.SyncAggregate + (*SignedBeaconBlockBellatrix)(nil), // 20: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix + (*BeaconBlockBellatrix)(nil), // 21: ethereum.eth.v1alpha1.BeaconBlockBellatrix + (*BeaconBlockBodyBellatrix)(nil), // 22: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix + (*SignedBlindedBeaconBlockBellatrix)(nil), // 23: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix + (*BlindedBeaconBlockBellatrix)(nil), // 24: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix + (*BlindedBeaconBlockBodyBellatrix)(nil), // 25: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix + (*SignedBeaconBlockContentsDeneb)(nil), // 26: ethereum.eth.v1alpha1.SignedBeaconBlockContentsDeneb + (*BeaconBlockContentsDeneb)(nil), // 27: ethereum.eth.v1alpha1.BeaconBlockContentsDeneb + (*SignedBeaconBlockDeneb)(nil), // 28: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb + (*BeaconBlockDeneb)(nil), // 29: ethereum.eth.v1alpha1.BeaconBlockDeneb + (*BeaconBlockBodyDeneb)(nil), // 30: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb + (*SignedBeaconBlockCapella)(nil), // 31: ethereum.eth.v1alpha1.SignedBeaconBlockCapella + (*BeaconBlockCapella)(nil), // 32: ethereum.eth.v1alpha1.BeaconBlockCapella + (*BeaconBlockBodyCapella)(nil), // 33: ethereum.eth.v1alpha1.BeaconBlockBodyCapella + (*SignedBlindedBeaconBlockCapella)(nil), // 34: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella + (*BlindedBeaconBlockCapella)(nil), // 35: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella + (*BlindedBeaconBlockBodyCapella)(nil), // 36: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella + (*SignedBlindedBeaconBlockDeneb)(nil), // 37: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb + (*BlindedBeaconBlockDeneb)(nil), // 38: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb + (*BlindedBeaconBlockBodyDeneb)(nil), // 39: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb + (*SignedBeaconBlockContentsElectra)(nil), // 40: ethereum.eth.v1alpha1.SignedBeaconBlockContentsElectra + (*BeaconBlockContentsElectra)(nil), // 41: ethereum.eth.v1alpha1.BeaconBlockContentsElectra + (*SignedBeaconBlockElectra)(nil), // 42: ethereum.eth.v1alpha1.SignedBeaconBlockElectra + (*BeaconBlockElectra)(nil), // 43: ethereum.eth.v1alpha1.BeaconBlockElectra + (*BeaconBlockBodyElectra)(nil), // 44: ethereum.eth.v1alpha1.BeaconBlockBodyElectra + (*SignedBlindedBeaconBlockElectra)(nil), // 45: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + (*BlindedBeaconBlockElectra)(nil), // 46: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + (*BlindedBeaconBlockBodyElectra)(nil), // 47: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra + (*ValidatorRegistrationV1)(nil), // 48: ethereum.eth.v1alpha1.ValidatorRegistrationV1 + (*SignedValidatorRegistrationsV1)(nil), // 49: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + (*SignedValidatorRegistrationV1)(nil), // 50: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 + (*BuilderBid)(nil), // 51: ethereum.eth.v1alpha1.BuilderBid + (*SignedBuilderBid)(nil), // 52: ethereum.eth.v1alpha1.SignedBuilderBid + (*BuilderBidCapella)(nil), // 53: ethereum.eth.v1alpha1.BuilderBidCapella + (*SignedBuilderBidCapella)(nil), // 54: ethereum.eth.v1alpha1.SignedBuilderBidCapella + (*BuilderBidDeneb)(nil), // 55: ethereum.eth.v1alpha1.BuilderBidDeneb + (*SignedBuilderBidDeneb)(nil), // 56: ethereum.eth.v1alpha1.SignedBuilderBidDeneb + (*BlobSidecar)(nil), // 57: ethereum.eth.v1alpha1.BlobSidecar + (*BlobSidecars)(nil), // 58: ethereum.eth.v1alpha1.BlobSidecars + (*Deposit_Data)(nil), // 59: ethereum.eth.v1alpha1.Deposit.Data + (*Attestation)(nil), // 60: ethereum.eth.v1alpha1.Attestation + (*AttestationData)(nil), // 61: ethereum.eth.v1alpha1.AttestationData + (*v1.ExecutionPayload)(nil), // 62: ethereum.engine.v1.ExecutionPayload + (*v1.ExecutionPayloadHeader)(nil), // 63: ethereum.engine.v1.ExecutionPayloadHeader + (*v1.ExecutionPayloadDeneb)(nil), // 64: ethereum.engine.v1.ExecutionPayloadDeneb + (*SignedBLSToExecutionChange)(nil), // 65: ethereum.eth.v1alpha1.SignedBLSToExecutionChange + (*v1.ExecutionPayloadCapella)(nil), // 66: ethereum.engine.v1.ExecutionPayloadCapella + (*v1.ExecutionPayloadHeaderCapella)(nil), // 67: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*v1.ExecutionPayloadHeaderDeneb)(nil), // 68: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*AttestationElectra)(nil), // 69: ethereum.eth.v1alpha1.AttestationElectra + (*v1.ExecutionPayloadElectra)(nil), // 70: ethereum.engine.v1.ExecutionPayloadElectra + (*SignedConsolidation)(nil), // 71: ethereum.eth.v1alpha1.SignedConsolidation + (*v1.ExecutionPayloadHeaderElectra)(nil), // 72: ethereum.engine.v1.ExecutionPayloadHeaderElectra } var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 3, // 0: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.phase0:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock 5, // 1: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.altair:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockAltair - 18, // 2: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.bellatrix:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix - 21, // 3: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_bellatrix:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix - 29, // 4: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.capella:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella - 32, // 5: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_capella:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella - 24, // 6: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.deneb:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockContentsDeneb - 35, // 7: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_deneb:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - 2, // 8: ethereum.eth.v1alpha1.GenericBeaconBlock.phase0:type_name -> ethereum.eth.v1alpha1.BeaconBlock - 4, // 9: ethereum.eth.v1alpha1.GenericBeaconBlock.altair:type_name -> ethereum.eth.v1alpha1.BeaconBlockAltair - 19, // 10: ethereum.eth.v1alpha1.GenericBeaconBlock.bellatrix:type_name -> ethereum.eth.v1alpha1.BeaconBlockBellatrix - 22, // 11: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_bellatrix:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix - 30, // 12: ethereum.eth.v1alpha1.GenericBeaconBlock.capella:type_name -> ethereum.eth.v1alpha1.BeaconBlockCapella - 33, // 13: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_capella:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella - 25, // 14: ethereum.eth.v1alpha1.GenericBeaconBlock.deneb:type_name -> ethereum.eth.v1alpha1.BeaconBlockContentsDeneb - 36, // 15: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb - 6, // 16: ethereum.eth.v1alpha1.BeaconBlock.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBody - 2, // 17: ethereum.eth.v1alpha1.SignedBeaconBlock.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock - 7, // 18: ethereum.eth.v1alpha1.BeaconBlockAltair.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyAltair - 4, // 19: ethereum.eth.v1alpha1.SignedBeaconBlockAltair.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockAltair - 13, // 20: ethereum.eth.v1alpha1.BeaconBlockBody.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 21: ethereum.eth.v1alpha1.BeaconBlockBody.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 22: ethereum.eth.v1alpha1.BeaconBlockBody.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 23: ethereum.eth.v1alpha1.BeaconBlockBody.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 24: ethereum.eth.v1alpha1.BeaconBlockBody.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 25: ethereum.eth.v1alpha1.BeaconBlockBody.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 13, // 26: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 27: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 28: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 29: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 30: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 31: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 32: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 15, // 33: ethereum.eth.v1alpha1.ProposerSlashing.header_1:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader - 15, // 34: ethereum.eth.v1alpha1.ProposerSlashing.header_2:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader - 16, // 35: ethereum.eth.v1alpha1.AttesterSlashing.attestation_1:type_name -> ethereum.eth.v1alpha1.IndexedAttestation - 16, // 36: ethereum.eth.v1alpha1.AttesterSlashing.attestation_2:type_name -> ethereum.eth.v1alpha1.IndexedAttestation - 49, // 37: ethereum.eth.v1alpha1.Deposit.data:type_name -> ethereum.eth.v1alpha1.Deposit.Data - 11, // 38: ethereum.eth.v1alpha1.SignedVoluntaryExit.exit:type_name -> ethereum.eth.v1alpha1.VoluntaryExit - 14, // 39: ethereum.eth.v1alpha1.SignedBeaconBlockHeader.header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader - 51, // 40: ethereum.eth.v1alpha1.IndexedAttestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData - 19, // 41: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockBellatrix - 20, // 42: ethereum.eth.v1alpha1.BeaconBlockBellatrix.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix - 13, // 43: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 44: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 45: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 46: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 47: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 48: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 49: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 52, // 50: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayload - 22, // 51: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix.block:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix - 23, // 52: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix - 13, // 53: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 54: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 55: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 56: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 57: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 58: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 59: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 53, // 60: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 26, // 61: ethereum.eth.v1alpha1.SignedBeaconBlockContentsDeneb.block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - 27, // 62: ethereum.eth.v1alpha1.BeaconBlockContentsDeneb.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb - 27, // 63: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb - 28, // 64: ethereum.eth.v1alpha1.BeaconBlockDeneb.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyDeneb - 13, // 65: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 66: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 67: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 68: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 69: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 70: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 71: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 54, // 72: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 55, // 73: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 30, // 74: ethereum.eth.v1alpha1.SignedBeaconBlockCapella.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockCapella - 31, // 75: ethereum.eth.v1alpha1.BeaconBlockCapella.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyCapella - 13, // 76: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 77: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 78: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 79: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 80: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 81: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 82: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 56, // 83: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 55, // 84: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 33, // 85: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella.block:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella - 34, // 86: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella - 13, // 87: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 88: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 89: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 90: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 91: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 92: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 93: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 57, // 94: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 55, // 95: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 36, // 96: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb - 37, // 97: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb - 13, // 98: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 99: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 9, // 100: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing - 50, // 101: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 10, // 102: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 12, // 103: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 17, // 104: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 58, // 105: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb - 55, // 106: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 40, // 107: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 - 38, // 108: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 - 53, // 109: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 41, // 110: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid - 57, // 111: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 43, // 112: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella - 58, // 113: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb - 45, // 114: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb - 15, // 115: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader - 47, // 116: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar - 117, // [117:117] is the sub-list for method output_type - 117, // [117:117] is the sub-list for method input_type - 117, // [117:117] is the sub-list for extension type_name - 117, // [117:117] is the sub-list for extension extendee - 0, // [0:117] is the sub-list for field type_name + 20, // 2: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.bellatrix:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix + 23, // 3: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_bellatrix:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix + 31, // 4: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.capella:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella + 34, // 5: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_capella:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella + 26, // 6: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.deneb:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockContentsDeneb + 37, // 7: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_deneb:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb + 40, // 8: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.electra:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockContentsElectra + 45, // 9: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.blinded_electra:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + 2, // 10: ethereum.eth.v1alpha1.GenericBeaconBlock.phase0:type_name -> ethereum.eth.v1alpha1.BeaconBlock + 4, // 11: ethereum.eth.v1alpha1.GenericBeaconBlock.altair:type_name -> ethereum.eth.v1alpha1.BeaconBlockAltair + 21, // 12: ethereum.eth.v1alpha1.GenericBeaconBlock.bellatrix:type_name -> ethereum.eth.v1alpha1.BeaconBlockBellatrix + 24, // 13: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_bellatrix:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix + 32, // 14: ethereum.eth.v1alpha1.GenericBeaconBlock.capella:type_name -> ethereum.eth.v1alpha1.BeaconBlockCapella + 35, // 15: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_capella:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella + 27, // 16: ethereum.eth.v1alpha1.GenericBeaconBlock.deneb:type_name -> ethereum.eth.v1alpha1.BeaconBlockContentsDeneb + 38, // 17: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb + 41, // 18: ethereum.eth.v1alpha1.GenericBeaconBlock.electra:type_name -> ethereum.eth.v1alpha1.BeaconBlockContentsElectra + 46, // 19: ethereum.eth.v1alpha1.GenericBeaconBlock.blinded_electra:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + 6, // 20: ethereum.eth.v1alpha1.BeaconBlock.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBody + 2, // 21: ethereum.eth.v1alpha1.SignedBeaconBlock.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock + 7, // 22: ethereum.eth.v1alpha1.BeaconBlockAltair.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyAltair + 4, // 23: ethereum.eth.v1alpha1.SignedBeaconBlockAltair.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockAltair + 14, // 24: ethereum.eth.v1alpha1.BeaconBlockBody.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 25: ethereum.eth.v1alpha1.BeaconBlockBody.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 26: ethereum.eth.v1alpha1.BeaconBlockBody.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 27: ethereum.eth.v1alpha1.BeaconBlockBody.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 28: ethereum.eth.v1alpha1.BeaconBlockBody.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 29: ethereum.eth.v1alpha1.BeaconBlockBody.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 14, // 30: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 31: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 32: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 33: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 34: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 35: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 36: ethereum.eth.v1alpha1.BeaconBlockBodyAltair.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 16, // 37: ethereum.eth.v1alpha1.ProposerSlashing.header_1:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 16, // 38: ethereum.eth.v1alpha1.ProposerSlashing.header_2:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 17, // 39: ethereum.eth.v1alpha1.AttesterSlashing.attestation_1:type_name -> ethereum.eth.v1alpha1.IndexedAttestation + 17, // 40: ethereum.eth.v1alpha1.AttesterSlashing.attestation_2:type_name -> ethereum.eth.v1alpha1.IndexedAttestation + 18, // 41: ethereum.eth.v1alpha1.AttesterSlashingElectra.attestation_1:type_name -> ethereum.eth.v1alpha1.IndexedAttestationElectra + 18, // 42: ethereum.eth.v1alpha1.AttesterSlashingElectra.attestation_2:type_name -> ethereum.eth.v1alpha1.IndexedAttestationElectra + 59, // 43: ethereum.eth.v1alpha1.Deposit.data:type_name -> ethereum.eth.v1alpha1.Deposit.Data + 12, // 44: ethereum.eth.v1alpha1.SignedVoluntaryExit.exit:type_name -> ethereum.eth.v1alpha1.VoluntaryExit + 15, // 45: ethereum.eth.v1alpha1.SignedBeaconBlockHeader.header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 61, // 46: ethereum.eth.v1alpha1.IndexedAttestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 61, // 47: ethereum.eth.v1alpha1.IndexedAttestationElectra.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 21, // 48: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockBellatrix + 22, // 49: ethereum.eth.v1alpha1.BeaconBlockBellatrix.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix + 14, // 50: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 51: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 52: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 53: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 54: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 55: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 56: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 62, // 57: ethereum.eth.v1alpha1.BeaconBlockBodyBellatrix.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayload + 24, // 58: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix.block:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix + 25, // 59: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix + 14, // 60: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 61: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 62: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 63: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 64: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 65: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 66: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 63, // 67: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyBellatrix.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 28, // 68: ethereum.eth.v1alpha1.SignedBeaconBlockContentsDeneb.block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb + 29, // 69: ethereum.eth.v1alpha1.BeaconBlockContentsDeneb.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb + 29, // 70: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb + 30, // 71: ethereum.eth.v1alpha1.BeaconBlockDeneb.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyDeneb + 14, // 72: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 73: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 74: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 75: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 76: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 77: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 78: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 64, // 79: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 65, // 80: ethereum.eth.v1alpha1.BeaconBlockBodyDeneb.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 32, // 81: ethereum.eth.v1alpha1.SignedBeaconBlockCapella.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockCapella + 33, // 82: ethereum.eth.v1alpha1.BeaconBlockCapella.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyCapella + 14, // 83: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 84: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 85: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 86: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 87: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 88: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 89: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 66, // 90: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella + 65, // 91: ethereum.eth.v1alpha1.BeaconBlockBodyCapella.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 35, // 92: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella.block:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella + 36, // 93: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella + 14, // 94: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 95: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 96: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 97: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 98: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 99: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 100: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 67, // 101: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 65, // 102: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyCapella.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 38, // 103: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb + 39, // 104: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb + 14, // 105: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 106: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 9, // 107: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashing + 60, // 108: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 11, // 109: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 110: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 111: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 68, // 112: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 65, // 113: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyDeneb.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 42, // 114: ethereum.eth.v1alpha1.SignedBeaconBlockContentsElectra.block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra + 43, // 115: ethereum.eth.v1alpha1.BeaconBlockContentsElectra.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockElectra + 43, // 116: ethereum.eth.v1alpha1.SignedBeaconBlockElectra.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockElectra + 44, // 117: ethereum.eth.v1alpha1.BeaconBlockElectra.body:type_name -> ethereum.eth.v1alpha1.BeaconBlockBodyElectra + 14, // 118: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 119: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 10, // 120: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashingElectra + 69, // 121: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 11, // 122: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 123: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 124: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 70, // 125: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra + 65, // 126: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 71, // 127: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.consolidations:type_name -> ethereum.eth.v1alpha1.SignedConsolidation + 46, // 128: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + 47, // 129: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra + 14, // 130: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 131: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 10, // 132: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashingElectra + 69, // 133: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 11, // 134: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 135: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 136: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 72, // 137: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra + 65, // 138: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 50, // 139: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 + 48, // 140: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 + 63, // 141: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 51, // 142: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid + 67, // 143: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 53, // 144: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella + 68, // 145: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 55, // 146: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb + 16, // 147: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 57, // 148: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar + 149, // [149:149] is the sub-list for method output_type + 149, // [149:149] is the sub-list for method input_type + 149, // [149:149] is the sub-list for extension type_name + 149, // [149:149] is the sub-list for extension extendee + 0, // [0:149] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_block_proto_init() } @@ -5137,6 +6296,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } file_proto_prysm_v1alpha1_attestation_proto_init() file_proto_prysm_v1alpha1_withdrawals_proto_init() + file_proto_prysm_v1alpha1_eip_7251_proto_init() if !protoimpl.UnsafeEnabled { file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenericSignedBeaconBlock); i { @@ -5259,7 +6419,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Deposit); i { + switch v := v.(*AttesterSlashingElectra); i { case 0: return &v.state case 1: @@ -5271,7 +6431,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VoluntaryExit); i { + switch v := v.(*Deposit); i { case 0: return &v.state case 1: @@ -5283,7 +6443,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedVoluntaryExit); i { + switch v := v.(*VoluntaryExit); i { case 0: return &v.state case 1: @@ -5295,7 +6455,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Eth1Data); i { + switch v := v.(*SignedVoluntaryExit); i { case 0: return &v.state case 1: @@ -5307,7 +6467,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockHeader); i { + switch v := v.(*Eth1Data); i { case 0: return &v.state case 1: @@ -5319,7 +6479,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBeaconBlockHeader); i { + switch v := v.(*BeaconBlockHeader); i { case 0: return &v.state case 1: @@ -5331,7 +6491,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IndexedAttestation); i { + switch v := v.(*SignedBeaconBlockHeader); i { case 0: return &v.state case 1: @@ -5343,7 +6503,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncAggregate); i { + switch v := v.(*IndexedAttestation); i { case 0: return &v.state case 1: @@ -5355,7 +6515,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBeaconBlockBellatrix); i { + switch v := v.(*IndexedAttestationElectra); i { case 0: return &v.state case 1: @@ -5367,7 +6527,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockBellatrix); i { + switch v := v.(*SyncAggregate); i { case 0: return &v.state case 1: @@ -5379,7 +6539,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockBodyBellatrix); i { + switch v := v.(*SignedBeaconBlockBellatrix); i { case 0: return &v.state case 1: @@ -5391,7 +6551,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBlindedBeaconBlockBellatrix); i { + switch v := v.(*BeaconBlockBellatrix); i { case 0: return &v.state case 1: @@ -5403,7 +6563,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlindedBeaconBlockBellatrix); i { + switch v := v.(*BeaconBlockBodyBellatrix); i { case 0: return &v.state case 1: @@ -5415,7 +6575,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlindedBeaconBlockBodyBellatrix); i { + switch v := v.(*SignedBlindedBeaconBlockBellatrix); i { case 0: return &v.state case 1: @@ -5427,7 +6587,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBeaconBlockContentsDeneb); i { + switch v := v.(*BlindedBeaconBlockBellatrix); i { case 0: return &v.state case 1: @@ -5439,7 +6599,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockContentsDeneb); i { + switch v := v.(*BlindedBeaconBlockBodyBellatrix); i { case 0: return &v.state case 1: @@ -5451,7 +6611,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBeaconBlockDeneb); i { + switch v := v.(*SignedBeaconBlockContentsDeneb); i { case 0: return &v.state case 1: @@ -5463,7 +6623,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockDeneb); i { + switch v := v.(*BeaconBlockContentsDeneb); i { case 0: return &v.state case 1: @@ -5475,7 +6635,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockBodyDeneb); i { + switch v := v.(*SignedBeaconBlockDeneb); i { case 0: return &v.state case 1: @@ -5487,7 +6647,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBeaconBlockCapella); i { + switch v := v.(*BeaconBlockDeneb); i { case 0: return &v.state case 1: @@ -5499,7 +6659,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockCapella); i { + switch v := v.(*BeaconBlockBodyDeneb); i { case 0: return &v.state case 1: @@ -5511,7 +6671,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockBodyCapella); i { + switch v := v.(*SignedBeaconBlockCapella); i { case 0: return &v.state case 1: @@ -5523,7 +6683,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBlindedBeaconBlockCapella); i { + switch v := v.(*BeaconBlockCapella); i { case 0: return &v.state case 1: @@ -5535,7 +6695,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlindedBeaconBlockCapella); i { + switch v := v.(*BeaconBlockBodyCapella); i { case 0: return &v.state case 1: @@ -5547,7 +6707,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlindedBeaconBlockBodyCapella); i { + switch v := v.(*SignedBlindedBeaconBlockCapella); i { case 0: return &v.state case 1: @@ -5559,7 +6719,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBlindedBeaconBlockDeneb); i { + switch v := v.(*BlindedBeaconBlockCapella); i { case 0: return &v.state case 1: @@ -5571,7 +6731,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlindedBeaconBlockDeneb); i { + switch v := v.(*BlindedBeaconBlockBodyCapella); i { case 0: return &v.state case 1: @@ -5583,7 +6743,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlindedBeaconBlockBodyDeneb); i { + switch v := v.(*SignedBlindedBeaconBlockDeneb); i { case 0: return &v.state case 1: @@ -5595,7 +6755,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorRegistrationV1); i { + switch v := v.(*BlindedBeaconBlockDeneb); i { case 0: return &v.state case 1: @@ -5607,7 +6767,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedValidatorRegistrationsV1); i { + switch v := v.(*BlindedBeaconBlockBodyDeneb); i { case 0: return &v.state case 1: @@ -5619,7 +6779,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedValidatorRegistrationV1); i { + switch v := v.(*SignedBeaconBlockContentsElectra); i { case 0: return &v.state case 1: @@ -5631,7 +6791,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BuilderBid); i { + switch v := v.(*BeaconBlockContentsElectra); i { case 0: return &v.state case 1: @@ -5643,7 +6803,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBuilderBid); i { + switch v := v.(*SignedBeaconBlockElectra); i { case 0: return &v.state case 1: @@ -5655,7 +6815,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BuilderBidCapella); i { + switch v := v.(*BeaconBlockElectra); i { case 0: return &v.state case 1: @@ -5667,7 +6827,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBuilderBidCapella); i { + switch v := v.(*BeaconBlockBodyElectra); i { case 0: return &v.state case 1: @@ -5679,7 +6839,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BuilderBidDeneb); i { + switch v := v.(*SignedBlindedBeaconBlockElectra); i { case 0: return &v.state case 1: @@ -5691,7 +6851,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedBuilderBidDeneb); i { + switch v := v.(*BlindedBeaconBlockElectra); i { case 0: return &v.state case 1: @@ -5703,7 +6863,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobSidecar); i { + switch v := v.(*BlindedBeaconBlockBodyElectra); i { case 0: return &v.state case 1: @@ -5715,7 +6875,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobSidecars); i { + switch v := v.(*ValidatorRegistrationV1); i { case 0: return &v.state case 1: @@ -5727,6 +6887,126 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedValidatorRegistrationsV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedValidatorRegistrationV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BuilderBid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedBuilderBid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BuilderBidCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedBuilderBidCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BuilderBidDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedBuilderBidDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlobSidecar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlobSidecars); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Deposit_Data); i { case 0: return &v.state @@ -5748,6 +7028,8 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { (*GenericSignedBeaconBlock_BlindedCapella)(nil), (*GenericSignedBeaconBlock_Deneb)(nil), (*GenericSignedBeaconBlock_BlindedDeneb)(nil), + (*GenericSignedBeaconBlock_Electra)(nil), + (*GenericSignedBeaconBlock_BlindedElectra)(nil), } file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[1].OneofWrappers = []interface{}{ (*GenericBeaconBlock_Phase0)(nil), @@ -5758,6 +7040,8 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { (*GenericBeaconBlock_BlindedCapella)(nil), (*GenericBeaconBlock_Deneb)(nil), (*GenericBeaconBlock_BlindedDeneb)(nil), + (*GenericBeaconBlock_Electra)(nil), + (*GenericBeaconBlock_BlindedElectra)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -5765,7 +7049,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc, NumEnums: 0, - NumMessages: 50, + NumMessages: 60, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index 4cf2fbe5f896..c7807e2003a4 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -19,6 +19,7 @@ import "proto/eth/ext/options.proto"; import "proto/prysm/v1alpha1/attestation.proto"; import "proto/prysm/v1alpha1/withdrawals.proto"; import "proto/engine/v1/execution_engine.proto"; +import "proto/prysm/v1alpha1/eip_7251.proto"; option csharp_namespace = "Ethereum.Eth.v1alpha1"; option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; @@ -50,7 +51,14 @@ message GenericSignedBeaconBlock { // Representing a signed, post-Deneb fork beacon block content. SignedBeaconBlockContentsDeneb deneb = 7; + // Representing a signed, post-Deneb fork blinded beacon block. SignedBlindedBeaconBlockDeneb blinded_deneb = 8; + + // Representing a signed, post-Electra fork beacon block content. + SignedBeaconBlockContentsElectra electra = 9; + + // Representing a signed, post-Electra fork blinded beacon block. + SignedBlindedBeaconBlockElectra blinded_electra = 10; } bool is_blinded = 100; reserved 101; // Deprecated fields @@ -79,7 +87,14 @@ message GenericBeaconBlock { // Representing a signed, post-Deneb fork beacon block content. BeaconBlockContentsDeneb deneb = 7; + // Representing a post-Deneb fork blinded beacon block. BlindedBeaconBlockDeneb blinded_deneb = 8; + + // Representing a signed, post-Electra fork beacon block content. + BeaconBlockContentsElectra electra = 9; + + // Representing a post-Electra fork blinded beacon block. + BlindedBeaconBlockElectra blinded_electra = 10; } bool is_blinded = 100; string payload_value = 101; @@ -226,6 +241,14 @@ message AttesterSlashing { IndexedAttestation attestation_2 = 2; } +message AttesterSlashingElectra { + // First conflicting attestation. + IndexedAttestationElectra attestation_1 = 1; + + // Second conflicting attestation. + IndexedAttestationElectra attestation_2 = 2; +} + // Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract. message Deposit { // DepositData that is encoded into a deposit signature. @@ -321,6 +344,15 @@ message IndexedAttestation { bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; } +message IndexedAttestationElectra { + repeated uint64 attesting_indices = 1 [(ethereum.eth.ext.ssz_max) = "max_attesting_indices.size"]; + + AttestationData data = 2; + + // 96 bytes aggregate signature. + bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; +} + // The sync aggregate object for the beacon chain to track sync committee votes and to // support light client infra. message SyncAggregate { @@ -716,6 +748,149 @@ message BlindedBeaconBlockBodyDeneb { repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; } +message SignedBeaconBlockContentsElectra { + SignedBeaconBlockElectra block = 1; + repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"]; + repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"]; +} + +message BeaconBlockContentsElectra { + BeaconBlockElectra block = 1; + repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"]; + repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"]; +} + +message SignedBeaconBlockElectra { + // The unsigned beacon block itself. + BeaconBlockElectra block = 1; + + // 96 byte BLS signature from the validator that produced this block. + bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + +message BeaconBlockElectra { + // Beacon chain slot that this block represents. + uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + + // Validator index of the validator that proposed the block header. + uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + + // 32 byte root of the parent block. + bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; + + // 32 byte root of the resulting state after processing this block. + bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The beacon block body. + BeaconBlockBodyElectra body = 5; +} + +message BeaconBlockBodyElectra { + // The validators RANDAO reveal 96 byte value. + bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"]; + + // A reference to the Ethereum 1.x chain. + Eth1Data eth1_data = 2; + + // 32 byte field of arbitrary data. This field may contain any data and + // is not used for anything other than a fun message. + bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"]; + + // Block operations + // Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block + + // At most MAX_PROPOSER_SLASHINGS. + repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"]; + + // At most MAX_ATTESTER_SLASHINGS_ELECTRA. + repeated AttesterSlashingElectra attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "1"]; + + // At most MAX_ATTESTATIONS_ELECTRA. + repeated AttestationElectra attestations = 6 [(ethereum.eth.ext.ssz_max) = "8"]; + + // At most MAX_DEPOSITS. + repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"]; + + // At most MAX_VOLUNTARY_EXITS. + repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"]; + + // Sync aggregate object for the beacon chain to track sync committee votes. New in Altair network upgrade. + SyncAggregate sync_aggregate = 9; + + // Execution payload from the execution chain. New in Bellatrix network upgrade. + ethereum.engine.v1.ExecutionPayloadElectra execution_payload = 10; + + // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade. + repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; + + repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; + + repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in EIP-7251. +} + +message SignedBlindedBeaconBlockElectra { + // The unsigned blinded beacon block itself. + BlindedBeaconBlockElectra message = 1; + + // 96 byte BLS signature from the validator that produced this blinded block. + bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + +message BlindedBeaconBlockElectra { + // Beacon chain slot that this blinded block represents. + uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + + // Validator index of the validator that proposed the block header. + uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + + // 32 byte root of the parent block. + bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; + + // 32 byte root of the resulting state after processing this blinded block. + bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The blinded beacon block body. + BlindedBeaconBlockBodyElectra body = 5; +} + +message BlindedBeaconBlockBodyElectra { + // The validators RANDAO reveal 96 byte value. + bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"]; + + // A reference to the Ethereum 1.x chain. + Eth1Data eth1_data = 2; + + // 32 byte field of arbitrary data. This field may contain any data and + // is not used for anything other than a fun message. + bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"]; + + // At most MAX_PROPOSER_SLASHINGS. + repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"]; + + // At most MAX_ATTESTER_SLASHINGS_ELECTRA. + repeated AttesterSlashingElectra attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "1"]; + + // At most MAX_ATTESTATIONS_ELECTRA. + repeated AttestationElectra attestations = 6 [(ethereum.eth.ext.ssz_max) = "8"]; + + // At most MAX_DEPOSITS. + repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"]; + + // At most MAX_VOLUNTARY_EXITS. + repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"]; + + // Sync aggregate object for the beacon chain to track sync committee votes. New in Altair network upgrade. + SyncAggregate sync_aggregate = 9; + + // Execution payload header from the execution chain. New in Bellatrix network upgrade to accommodate MEV interaction. + ethereum.engine.v1.ExecutionPayloadHeaderElectra execution_payload_header = 10; + + // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade. + repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; + + repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; +} + message ValidatorRegistrationV1 { bytes fee_recipient = 1 [(ethereum.eth.ext.ssz_size) = "20"]; uint64 gas_limit = 2; diff --git a/proto/prysm/v1alpha1/beacon_state.pb.go b/proto/prysm/v1alpha1/beacon_state.pb.go index 9269ae767649..71a2b06e9abc 100755 --- a/proto/prysm/v1alpha1/beacon_state.pb.go +++ b/proto/prysm/v1alpha1/beacon_state.pb.go @@ -1834,6 +1834,341 @@ func (x *BeaconStateDeneb) GetHistoricalSummaries() []*HistoricalSummary { return nil } +type BeaconStateElectra struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GenesisTime uint64 `protobuf:"varint,1001,opt,name=genesis_time,json=genesisTime,proto3" json:"genesis_time,omitempty"` + GenesisValidatorsRoot []byte `protobuf:"bytes,1002,opt,name=genesis_validators_root,json=genesisValidatorsRoot,proto3" json:"genesis_validators_root,omitempty" ssz-size:"32"` + Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,1003,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` + Fork *Fork `protobuf:"bytes,1004,opt,name=fork,proto3" json:"fork,omitempty"` + LatestBlockHeader *BeaconBlockHeader `protobuf:"bytes,2001,opt,name=latest_block_header,json=latestBlockHeader,proto3" json:"latest_block_header,omitempty"` + BlockRoots [][]byte `protobuf:"bytes,2002,rep,name=block_roots,json=blockRoots,proto3" json:"block_roots,omitempty" ssz-size:"8192,32"` + StateRoots [][]byte `protobuf:"bytes,2003,rep,name=state_roots,json=stateRoots,proto3" json:"state_roots,omitempty" ssz-size:"8192,32"` + HistoricalRoots [][]byte `protobuf:"bytes,2004,rep,name=historical_roots,json=historicalRoots,proto3" json:"historical_roots,omitempty" ssz-max:"16777216" ssz-size:"?,32"` + Eth1Data *Eth1Data `protobuf:"bytes,3001,opt,name=eth1_data,json=eth1Data,proto3" json:"eth1_data,omitempty"` + Eth1DataVotes []*Eth1Data `protobuf:"bytes,3002,rep,name=eth1_data_votes,json=eth1DataVotes,proto3" json:"eth1_data_votes,omitempty" ssz-max:"2048"` + Eth1DepositIndex uint64 `protobuf:"varint,3003,opt,name=eth1_deposit_index,json=eth1DepositIndex,proto3" json:"eth1_deposit_index,omitempty"` + Validators []*Validator `protobuf:"bytes,4001,rep,name=validators,proto3" json:"validators,omitempty" ssz-max:"1099511627776"` + Balances []uint64 `protobuf:"varint,4002,rep,packed,name=balances,proto3" json:"balances,omitempty" ssz-max:"1099511627776"` + RandaoMixes [][]byte `protobuf:"bytes,5001,rep,name=randao_mixes,json=randaoMixes,proto3" json:"randao_mixes,omitempty" ssz-size:"65536,32"` + Slashings []uint64 `protobuf:"varint,6001,rep,packed,name=slashings,proto3" json:"slashings,omitempty" ssz-size:"8192"` + PreviousEpochParticipation []byte `protobuf:"bytes,7001,opt,name=previous_epoch_participation,json=previousEpochParticipation,proto3" json:"previous_epoch_participation,omitempty" ssz-max:"1099511627776"` + CurrentEpochParticipation []byte `protobuf:"bytes,7002,opt,name=current_epoch_participation,json=currentEpochParticipation,proto3" json:"current_epoch_participation,omitempty" ssz-max:"1099511627776"` + JustificationBits github_com_prysmaticlabs_go_bitfield.Bitvector4 `protobuf:"bytes,8001,opt,name=justification_bits,json=justificationBits,proto3" json:"justification_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector4" ssz-size:"1"` + PreviousJustifiedCheckpoint *Checkpoint `protobuf:"bytes,8002,opt,name=previous_justified_checkpoint,json=previousJustifiedCheckpoint,proto3" json:"previous_justified_checkpoint,omitempty"` + CurrentJustifiedCheckpoint *Checkpoint `protobuf:"bytes,8003,opt,name=current_justified_checkpoint,json=currentJustifiedCheckpoint,proto3" json:"current_justified_checkpoint,omitempty"` + FinalizedCheckpoint *Checkpoint `protobuf:"bytes,8004,opt,name=finalized_checkpoint,json=finalizedCheckpoint,proto3" json:"finalized_checkpoint,omitempty"` + InactivityScores []uint64 `protobuf:"varint,9001,rep,packed,name=inactivity_scores,json=inactivityScores,proto3" json:"inactivity_scores,omitempty" ssz-max:"1099511627776"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,9002,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + NextSyncCommittee *SyncCommittee `protobuf:"bytes,9003,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` + LatestExecutionPayloadHeader *v1.ExecutionPayloadHeaderElectra `protobuf:"bytes,10001,opt,name=latest_execution_payload_header,json=latestExecutionPayloadHeader,proto3" json:"latest_execution_payload_header,omitempty"` + NextWithdrawalIndex uint64 `protobuf:"varint,11001,opt,name=next_withdrawal_index,json=nextWithdrawalIndex,proto3" json:"next_withdrawal_index,omitempty"` + NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` + DepositReceiptsStartIndex uint64 `protobuf:"varint,12001,opt,name=deposit_receipts_start_index,json=depositReceiptsStartIndex,proto3" json:"deposit_receipts_start_index,omitempty"` + DepositBalanceToConsume uint64 `protobuf:"varint,12002,opt,name=deposit_balance_to_consume,json=depositBalanceToConsume,proto3" json:"deposit_balance_to_consume,omitempty"` + ExitBalanceToConsume uint64 `protobuf:"varint,12003,opt,name=exit_balance_to_consume,json=exitBalanceToConsume,proto3" json:"exit_balance_to_consume,omitempty"` + EarliestExitEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12004,opt,name=earliest_exit_epoch,json=earliestExitEpoch,proto3" json:"earliest_exit_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` + ConsolidationBalanceToConsume uint64 `protobuf:"varint,12005,opt,name=consolidation_balance_to_consume,json=consolidationBalanceToConsume,proto3" json:"consolidation_balance_to_consume,omitempty"` + EarliestConsolidationEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12006,opt,name=earliest_consolidation_epoch,json=earliestConsolidationEpoch,proto3" json:"earliest_consolidation_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` + PendingBalanceDeposits []*PendingBalanceDeposit `protobuf:"bytes,12007,rep,name=pending_balance_deposits,json=pendingBalanceDeposits,proto3" json:"pending_balance_deposits,omitempty" ssz-max:"134217728"` + PendingPartialWithdrawals []*PendingPartialWithdrawal `protobuf:"bytes,12008,rep,name=pending_partial_withdrawals,json=pendingPartialWithdrawals,proto3" json:"pending_partial_withdrawals,omitempty" ssz-max:"134217728"` + PendingConsolidations []*PendingConsolidation `protobuf:"bytes,12009,rep,name=pending_consolidations,json=pendingConsolidations,proto3" json:"pending_consolidations,omitempty" ssz-max:"262144"` +} + +func (x *BeaconStateElectra) Reset() { + *x = BeaconStateElectra{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BeaconStateElectra) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BeaconStateElectra) ProtoMessage() {} + +func (x *BeaconStateElectra) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BeaconStateElectra.ProtoReflect.Descriptor instead. +func (*BeaconStateElectra) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_state_proto_rawDescGZIP(), []int{15} +} + +func (x *BeaconStateElectra) GetGenesisTime() uint64 { + if x != nil { + return x.GenesisTime + } + return 0 +} + +func (x *BeaconStateElectra) GetGenesisValidatorsRoot() []byte { + if x != nil { + return x.GenesisValidatorsRoot + } + return nil +} + +func (x *BeaconStateElectra) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.Slot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +func (x *BeaconStateElectra) GetFork() *Fork { + if x != nil { + return x.Fork + } + return nil +} + +func (x *BeaconStateElectra) GetLatestBlockHeader() *BeaconBlockHeader { + if x != nil { + return x.LatestBlockHeader + } + return nil +} + +func (x *BeaconStateElectra) GetBlockRoots() [][]byte { + if x != nil { + return x.BlockRoots + } + return nil +} + +func (x *BeaconStateElectra) GetStateRoots() [][]byte { + if x != nil { + return x.StateRoots + } + return nil +} + +func (x *BeaconStateElectra) GetHistoricalRoots() [][]byte { + if x != nil { + return x.HistoricalRoots + } + return nil +} + +func (x *BeaconStateElectra) GetEth1Data() *Eth1Data { + if x != nil { + return x.Eth1Data + } + return nil +} + +func (x *BeaconStateElectra) GetEth1DataVotes() []*Eth1Data { + if x != nil { + return x.Eth1DataVotes + } + return nil +} + +func (x *BeaconStateElectra) GetEth1DepositIndex() uint64 { + if x != nil { + return x.Eth1DepositIndex + } + return 0 +} + +func (x *BeaconStateElectra) GetValidators() []*Validator { + if x != nil { + return x.Validators + } + return nil +} + +func (x *BeaconStateElectra) GetBalances() []uint64 { + if x != nil { + return x.Balances + } + return nil +} + +func (x *BeaconStateElectra) GetRandaoMixes() [][]byte { + if x != nil { + return x.RandaoMixes + } + return nil +} + +func (x *BeaconStateElectra) GetSlashings() []uint64 { + if x != nil { + return x.Slashings + } + return nil +} + +func (x *BeaconStateElectra) GetPreviousEpochParticipation() []byte { + if x != nil { + return x.PreviousEpochParticipation + } + return nil +} + +func (x *BeaconStateElectra) GetCurrentEpochParticipation() []byte { + if x != nil { + return x.CurrentEpochParticipation + } + return nil +} + +func (x *BeaconStateElectra) GetJustificationBits() github_com_prysmaticlabs_go_bitfield.Bitvector4 { + if x != nil { + return x.JustificationBits + } + return github_com_prysmaticlabs_go_bitfield.Bitvector4(nil) +} + +func (x *BeaconStateElectra) GetPreviousJustifiedCheckpoint() *Checkpoint { + if x != nil { + return x.PreviousJustifiedCheckpoint + } + return nil +} + +func (x *BeaconStateElectra) GetCurrentJustifiedCheckpoint() *Checkpoint { + if x != nil { + return x.CurrentJustifiedCheckpoint + } + return nil +} + +func (x *BeaconStateElectra) GetFinalizedCheckpoint() *Checkpoint { + if x != nil { + return x.FinalizedCheckpoint + } + return nil +} + +func (x *BeaconStateElectra) GetInactivityScores() []uint64 { + if x != nil { + return x.InactivityScores + } + return nil +} + +func (x *BeaconStateElectra) GetCurrentSyncCommittee() *SyncCommittee { + if x != nil { + return x.CurrentSyncCommittee + } + return nil +} + +func (x *BeaconStateElectra) GetNextSyncCommittee() *SyncCommittee { + if x != nil { + return x.NextSyncCommittee + } + return nil +} + +func (x *BeaconStateElectra) GetLatestExecutionPayloadHeader() *v1.ExecutionPayloadHeaderElectra { + if x != nil { + return x.LatestExecutionPayloadHeader + } + return nil +} + +func (x *BeaconStateElectra) GetNextWithdrawalIndex() uint64 { + if x != nil { + return x.NextWithdrawalIndex + } + return 0 +} + +func (x *BeaconStateElectra) GetNextWithdrawalValidatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.NextWithdrawalValidatorIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *BeaconStateElectra) GetHistoricalSummaries() []*HistoricalSummary { + if x != nil { + return x.HistoricalSummaries + } + return nil +} + +func (x *BeaconStateElectra) GetDepositReceiptsStartIndex() uint64 { + if x != nil { + return x.DepositReceiptsStartIndex + } + return 0 +} + +func (x *BeaconStateElectra) GetDepositBalanceToConsume() uint64 { + if x != nil { + return x.DepositBalanceToConsume + } + return 0 +} + +func (x *BeaconStateElectra) GetExitBalanceToConsume() uint64 { + if x != nil { + return x.ExitBalanceToConsume + } + return 0 +} + +func (x *BeaconStateElectra) GetEarliestExitEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { + if x != nil { + return x.EarliestExitEpoch + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) +} + +func (x *BeaconStateElectra) GetConsolidationBalanceToConsume() uint64 { + if x != nil { + return x.ConsolidationBalanceToConsume + } + return 0 +} + +func (x *BeaconStateElectra) GetEarliestConsolidationEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { + if x != nil { + return x.EarliestConsolidationEpoch + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) +} + +func (x *BeaconStateElectra) GetPendingBalanceDeposits() []*PendingBalanceDeposit { + if x != nil { + return x.PendingBalanceDeposits + } + return nil +} + +func (x *BeaconStateElectra) GetPendingPartialWithdrawals() []*PendingPartialWithdrawal { + if x != nil { + return x.PendingPartialWithdrawals + } + return nil +} + +func (x *BeaconStateElectra) GetPendingConsolidations() []*PendingConsolidation { + if x != nil { + return x.PendingConsolidations + } + return nil +} + type PowBlock struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1847,7 +2182,7 @@ type PowBlock struct { func (x *PowBlock) Reset() { *x = PowBlock{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[15] + mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1860,7 +2195,7 @@ func (x *PowBlock) String() string { func (*PowBlock) ProtoMessage() {} func (x *PowBlock) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[15] + mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1873,7 +2208,7 @@ func (x *PowBlock) ProtoReflect() protoreflect.Message { // Deprecated: Use PowBlock.ProtoReflect.Descriptor instead. func (*PowBlock) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_state_proto_rawDescGZIP(), []int{15} + return file_proto_prysm_v1alpha1_beacon_state_proto_rawDescGZIP(), []int{16} } func (x *PowBlock) GetBlockHash() []byte { @@ -1909,7 +2244,7 @@ type HistoricalSummary struct { func (x *HistoricalSummary) Reset() { *x = HistoricalSummary{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[16] + mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1922,7 +2257,7 @@ func (x *HistoricalSummary) String() string { func (*HistoricalSummary) ProtoMessage() {} func (x *HistoricalSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[16] + mi := &file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1935,7 +2270,7 @@ func (x *HistoricalSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use HistoricalSummary.ProtoReflect.Descriptor instead. func (*HistoricalSummary) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_state_proto_rawDescGZIP(), []int{16} + return file_proto_prysm_v1alpha1_beacon_state_proto_rawDescGZIP(), []int{17} } func (x *HistoricalSummary) GetBlockSummaryRoot() []byte { @@ -1970,737 +2305,931 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x0c, 0x0a, - 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0c, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, - 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, - 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, - 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, - 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, - 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x65, 0x69, 0x70, 0x5f, 0x37, 0x32, 0x35, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x97, 0x0c, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, + 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, + 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, + 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, + 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, + 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, + 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, + 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, + 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, - 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, - 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, - 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, - 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, - 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, - 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, - 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, - 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, - 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, - 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x74, 0x0a, - 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd9, 0x36, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, - 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x19, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x72, 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, + 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, + 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, + 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, + 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, + 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, + 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, + 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, + 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x74, 0x0a, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xda, 0x36, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x73, 0x18, 0xd9, 0x36, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x18, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, - 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, - 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, - 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0xd2, 0x0d, 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x22, 0x0a, 0x0c, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, - 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, - 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x69, 0x6f, 0x6e, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x19, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x72, 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xda, 0x36, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, - 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, - 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, - 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, - 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, - 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, - 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, - 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, - 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, - 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, - 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, - 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, - 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, - 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, - 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, - 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, - 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, - 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, - 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, - 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, + 0x39, 0x36, 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x68, 0x0a, 0x12, + 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, + 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, + 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, - 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, - 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, - 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, - 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x04, - 0x46, 0x6f, 0x72, 0x6b, 0x12, 0x30, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x05, - 0x8a, 0xb5, 0x18, 0x01, 0x34, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x05, 0x8a, 0xb5, 0x18, 0x01, 0x34, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, + 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, + 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0xd2, 0x0d, 0x0a, 0x11, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x74, 0x61, 0x69, + 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x22, 0x9d, 0x03, 0x0a, 0x12, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x63, 0x0a, 0x10, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, - 0x42, 0x69, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, - 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, - 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, + 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, + 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, + 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, + 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, + 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, + 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, + 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, + 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, + 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, + 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, + 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, + 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, + 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, + 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, + 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, + 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, + 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, + 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, + 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, + 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, + 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, + 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x6e, 0x0a, 0x0f, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0e, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x76, 0x0a, 0x0e, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x22, 0x6d, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x2c, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, - 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, - 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, - 0x6f, 0x74, 0x73, 0x22, 0x7d, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, + 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, + 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, + 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, + 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, + 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, + 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x22, 0xc6, 0x01, 0x0a, 0x04, 0x46, 0x6f, 0x72, 0x6b, 0x12, 0x30, 0x0a, 0x10, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x05, 0x8a, 0xb5, 0x18, 0x01, 0x34, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, + 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x0f, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x05, 0x8a, 0xb5, 0x18, 0x01, 0x34, 0x52, 0x0e, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x9d, 0x03, 0x0a, 0x12, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x63, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x92, 0xb5, 0x18, 0x04, + 0x32, 0x30, 0x34, 0x38, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x6e, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, + 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, + 0x74, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x61, + 0x79, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x6d, 0x0a, 0x0f, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x2c, 0x0a, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x22, 0x7d, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x22, 0x56, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x69, + 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x1e, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, + 0x7a, 0x0a, 0x08, 0x46, 0x6f, 0x72, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x0f, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x05, 0x8a, 0xb5, 0x18, 0x01, 0x34, 0x52, 0x0e, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x17, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xb7, 0x01, 0x0a, 0x0b, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x75, 0x62, + 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x75, 0x62, + 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, + 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x22, 0x98, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, + 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x68, 0x0a, 0x0d, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x12, 0x24, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x35, 0x31, 0x32, 0x2c, 0x34, 0x38, 0x52, 0x07, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0xa7, 0x01, 0x0a, 0x1b, 0x53, + 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x11, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x22, 0xc9, 0x0e, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x22, 0x0a, + 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x6f, - 0x6f, 0x74, 0x22, 0x56, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x7a, 0x0a, 0x08, 0x46, 0x6f, - 0x72, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x05, 0x8a, 0xb5, 0x18, 0x01, 0x34, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xb7, 0x01, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x50, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, - 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x64, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x73, 0x12, - 0x2f, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, + 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, - 0x22, 0x98, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, - 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x68, 0x0a, 0x0d, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x24, 0x0a, 0x07, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, - 0xb5, 0x18, 0x06, 0x35, 0x31, 0x32, 0x2c, 0x34, 0x38, 0x52, 0x07, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x50, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0xa7, 0x01, 0x0a, 0x1b, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, - 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, - 0xc9, 0x0e, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, - 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6f, 0x72, - 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, 0x0a, 0x13, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, - 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, - 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, - 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, - 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, - 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, + 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, + 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, - 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, - 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, - 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, - 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, - 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, - 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, - 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, - 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, 0x18, 0x89, - 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, 0x33, 0x36, - 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, 0x65, 0x73, - 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0xf1, 0x2e, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x09, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, - 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, - 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xda, + 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, + 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, + 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, + 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, + 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, + 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, + 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, + 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, + 0xa2, 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, + 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, + 0x78, 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, + 0x36, 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x4d, 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, + 0x31, 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, + 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, - 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, - 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, 0x73, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x66, 0x0a, - 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc2, - 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, - 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x14, 0x66, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, + 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, + 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, + 0x3e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, + 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, + 0x11, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, + 0x74, 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, + 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, - 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, - 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, - 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, - 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xaa, 0x46, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x72, 0x0a, 0x1f, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x1c, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x89, 0x11, 0x0a, 0x12, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x61, 0x70, 0x65, 0x6c, - 0x6c, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, - 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, - 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, - 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, - 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, - 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, - 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, - 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, - 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, - 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, - 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, - 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, - 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, - 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, + 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, + 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, - 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, - 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, + 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xab, 0x46, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, + 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x72, 0x0a, 0x1f, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x91, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x22, 0x89, 0x11, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, 0x04, + 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, + 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, - 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, - 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, - 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, - 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, - 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, - 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, 0x0a, 0x13, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, + 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, + 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, + 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, + 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, + 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, + 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, + 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, + 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, + 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, + 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x11, + 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, + 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, + 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, 0x03, 0x28, 0x04, + 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, + 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, + 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, 0x18, 0x89, 0x27, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, 0x33, 0x36, 0x2c, + 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, 0x65, 0x73, 0x12, + 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0xf1, 0x2e, 0x20, + 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x09, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, + 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, - 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, - 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, - 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, - 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, - 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, - 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, + 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, + 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xda, 0x36, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, + 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, + 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x1d, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, - 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, - 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, - 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, - 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, - 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x12, 0x79, 0x0a, 0x1f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x1c, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, - 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, - 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, - 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, - 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0x85, 0x11, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x22, 0x0a, 0x0c, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, - 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, - 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, + 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x14, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, + 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, + 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, + 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, + 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xaa, 0x46, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, + 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, - 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, - 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, - 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x1f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, + 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, + 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, + 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0x85, 0x11, 0x0a, + 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, + 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, + 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, + 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, + 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, + 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, + 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, + 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, + 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, - 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, - 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, - 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, - 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, - 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, - 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, - 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, - 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, - 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, - 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, - 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, - 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, + 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, + 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, + 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, + 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, + 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, + 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, + 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, + 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, - 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, - 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, - 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, - 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, + 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, + 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, + 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, + 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, + 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, + 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, - 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, - 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, + 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, + 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, + 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, + 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, + 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, + 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x12, 0x77, 0x0a, 0x1f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x1c, 0x6c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0xf9, 0x55, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, + 0x01, 0x0a, 0x1f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0xfa, 0x55, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, + 0x18, 0xfb, 0x55, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, + 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x69, 0x65, 0x73, 0x22, 0xfa, 0x17, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x3f, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x5a, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x30, 0x0a, 0x04, + 0x66, 0x6f, 0x72, 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x59, + 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0b, + 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, 0x08, + 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x74, 0x68, + 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, + 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x0d, 0x65, + 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, + 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x74, 0x68, 0x31, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x0a, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, 0x1f, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, + 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, + 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, + 0x73, 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, + 0x35, 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, + 0x78, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, + 0x32, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, + 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, + 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, + 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, + 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, + 0x12, 0x66, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, - 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, - 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x77, 0x0a, 0x1f, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, - 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, - 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, - 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, - 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0a, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x10, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, - 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, - 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, - 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x55, + 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x52, 0x13, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, + 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, + 0x37, 0x37, 0x37, 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x18, 0xaa, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, + 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x1f, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, + 0x55, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, + 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, + 0x55, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, + 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, + 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, + 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, + 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, + 0x12, 0x36, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, + 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, + 0x69, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0xe4, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, + 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x48, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1d, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x1c, + 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe6, 0x5d, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, 0x65, 0x61, 0x72, + 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, + 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, + 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0xe8, + 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, + 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, + 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x73, + 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x5d, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, + 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, + 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x31, + 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, + 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, + 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, + 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, + 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2715,7 +3244,7 @@ func file_proto_prysm_v1alpha1_beacon_state_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_beacon_state_proto_rawDescData } -var file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_proto_prysm_v1alpha1_beacon_state_proto_goTypes = []interface{}{ (*BeaconState)(nil), // 0: ethereum.eth.v1alpha1.BeaconState (*BeaconStateAltair)(nil), // 1: ethereum.eth.v1alpha1.BeaconStateAltair @@ -2732,80 +3261,100 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_goTypes = []interface{}{ (*BeaconStateBellatrix)(nil), // 12: ethereum.eth.v1alpha1.BeaconStateBellatrix (*BeaconStateCapella)(nil), // 13: ethereum.eth.v1alpha1.BeaconStateCapella (*BeaconStateDeneb)(nil), // 14: ethereum.eth.v1alpha1.BeaconStateDeneb - (*PowBlock)(nil), // 15: ethereum.eth.v1alpha1.PowBlock - (*HistoricalSummary)(nil), // 16: ethereum.eth.v1alpha1.HistoricalSummary - (*BeaconBlockHeader)(nil), // 17: ethereum.eth.v1alpha1.BeaconBlockHeader - (*Eth1Data)(nil), // 18: ethereum.eth.v1alpha1.Eth1Data - (*Validator)(nil), // 19: ethereum.eth.v1alpha1.Validator - (*Checkpoint)(nil), // 20: ethereum.eth.v1alpha1.Checkpoint - (*AttestationData)(nil), // 21: ethereum.eth.v1alpha1.AttestationData - (*v1.ExecutionPayloadHeader)(nil), // 22: ethereum.engine.v1.ExecutionPayloadHeader - (*v1.ExecutionPayloadHeaderCapella)(nil), // 23: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*v1.ExecutionPayloadHeaderDeneb)(nil), // 24: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*BeaconStateElectra)(nil), // 15: ethereum.eth.v1alpha1.BeaconStateElectra + (*PowBlock)(nil), // 16: ethereum.eth.v1alpha1.PowBlock + (*HistoricalSummary)(nil), // 17: ethereum.eth.v1alpha1.HistoricalSummary + (*BeaconBlockHeader)(nil), // 18: ethereum.eth.v1alpha1.BeaconBlockHeader + (*Eth1Data)(nil), // 19: ethereum.eth.v1alpha1.Eth1Data + (*Validator)(nil), // 20: ethereum.eth.v1alpha1.Validator + (*Checkpoint)(nil), // 21: ethereum.eth.v1alpha1.Checkpoint + (*AttestationData)(nil), // 22: ethereum.eth.v1alpha1.AttestationData + (*v1.ExecutionPayloadHeader)(nil), // 23: ethereum.engine.v1.ExecutionPayloadHeader + (*v1.ExecutionPayloadHeaderCapella)(nil), // 24: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*v1.ExecutionPayloadHeaderDeneb)(nil), // 25: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*v1.ExecutionPayloadHeaderElectra)(nil), // 26: ethereum.engine.v1.ExecutionPayloadHeaderElectra + (*PendingBalanceDeposit)(nil), // 27: ethereum.eth.v1alpha1.PendingBalanceDeposit + (*PendingPartialWithdrawal)(nil), // 28: ethereum.eth.v1alpha1.PendingPartialWithdrawal + (*PendingConsolidation)(nil), // 29: ethereum.eth.v1alpha1.PendingConsolidation } var file_proto_prysm_v1alpha1_beacon_state_proto_depIdxs = []int32{ 2, // 0: ethereum.eth.v1alpha1.BeaconState.fork:type_name -> ethereum.eth.v1alpha1.Fork - 17, // 1: ethereum.eth.v1alpha1.BeaconState.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader - 18, // 2: ethereum.eth.v1alpha1.BeaconState.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 18, // 3: ethereum.eth.v1alpha1.BeaconState.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data - 19, // 4: ethereum.eth.v1alpha1.BeaconState.validators:type_name -> ethereum.eth.v1alpha1.Validator + 18, // 1: ethereum.eth.v1alpha1.BeaconState.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 19, // 2: ethereum.eth.v1alpha1.BeaconState.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 19, // 3: ethereum.eth.v1alpha1.BeaconState.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data + 20, // 4: ethereum.eth.v1alpha1.BeaconState.validators:type_name -> ethereum.eth.v1alpha1.Validator 3, // 5: ethereum.eth.v1alpha1.BeaconState.previous_epoch_attestations:type_name -> ethereum.eth.v1alpha1.PendingAttestation 3, // 6: ethereum.eth.v1alpha1.BeaconState.current_epoch_attestations:type_name -> ethereum.eth.v1alpha1.PendingAttestation - 20, // 7: ethereum.eth.v1alpha1.BeaconState.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 8: ethereum.eth.v1alpha1.BeaconState.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 9: ethereum.eth.v1alpha1.BeaconState.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 7: ethereum.eth.v1alpha1.BeaconState.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 8: ethereum.eth.v1alpha1.BeaconState.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 9: ethereum.eth.v1alpha1.BeaconState.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 2, // 10: ethereum.eth.v1alpha1.BeaconStateAltair.fork:type_name -> ethereum.eth.v1alpha1.Fork - 17, // 11: ethereum.eth.v1alpha1.BeaconStateAltair.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader - 18, // 12: ethereum.eth.v1alpha1.BeaconStateAltair.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 18, // 13: ethereum.eth.v1alpha1.BeaconStateAltair.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data - 19, // 14: ethereum.eth.v1alpha1.BeaconStateAltair.validators:type_name -> ethereum.eth.v1alpha1.Validator - 20, // 15: ethereum.eth.v1alpha1.BeaconStateAltair.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 16: ethereum.eth.v1alpha1.BeaconStateAltair.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 17: ethereum.eth.v1alpha1.BeaconStateAltair.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 18, // 11: ethereum.eth.v1alpha1.BeaconStateAltair.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 19, // 12: ethereum.eth.v1alpha1.BeaconStateAltair.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 19, // 13: ethereum.eth.v1alpha1.BeaconStateAltair.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data + 20, // 14: ethereum.eth.v1alpha1.BeaconStateAltair.validators:type_name -> ethereum.eth.v1alpha1.Validator + 21, // 15: ethereum.eth.v1alpha1.BeaconStateAltair.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 16: ethereum.eth.v1alpha1.BeaconStateAltair.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 17: ethereum.eth.v1alpha1.BeaconStateAltair.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 10, // 18: ethereum.eth.v1alpha1.BeaconStateAltair.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee 10, // 19: ethereum.eth.v1alpha1.BeaconStateAltair.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee - 21, // 20: ethereum.eth.v1alpha1.PendingAttestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 22, // 20: ethereum.eth.v1alpha1.PendingAttestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData 2, // 21: ethereum.eth.v1alpha1.CheckPtInfo.fork:type_name -> ethereum.eth.v1alpha1.Fork 2, // 22: ethereum.eth.v1alpha1.BeaconStateBellatrix.fork:type_name -> ethereum.eth.v1alpha1.Fork - 17, // 23: ethereum.eth.v1alpha1.BeaconStateBellatrix.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader - 18, // 24: ethereum.eth.v1alpha1.BeaconStateBellatrix.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 18, // 25: ethereum.eth.v1alpha1.BeaconStateBellatrix.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data - 19, // 26: ethereum.eth.v1alpha1.BeaconStateBellatrix.validators:type_name -> ethereum.eth.v1alpha1.Validator - 20, // 27: ethereum.eth.v1alpha1.BeaconStateBellatrix.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 28: ethereum.eth.v1alpha1.BeaconStateBellatrix.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 29: ethereum.eth.v1alpha1.BeaconStateBellatrix.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 18, // 23: ethereum.eth.v1alpha1.BeaconStateBellatrix.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 19, // 24: ethereum.eth.v1alpha1.BeaconStateBellatrix.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 19, // 25: ethereum.eth.v1alpha1.BeaconStateBellatrix.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data + 20, // 26: ethereum.eth.v1alpha1.BeaconStateBellatrix.validators:type_name -> ethereum.eth.v1alpha1.Validator + 21, // 27: ethereum.eth.v1alpha1.BeaconStateBellatrix.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 28: ethereum.eth.v1alpha1.BeaconStateBellatrix.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 29: ethereum.eth.v1alpha1.BeaconStateBellatrix.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 10, // 30: ethereum.eth.v1alpha1.BeaconStateBellatrix.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee 10, // 31: ethereum.eth.v1alpha1.BeaconStateBellatrix.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee - 22, // 32: ethereum.eth.v1alpha1.BeaconStateBellatrix.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 23, // 32: ethereum.eth.v1alpha1.BeaconStateBellatrix.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader 2, // 33: ethereum.eth.v1alpha1.BeaconStateCapella.fork:type_name -> ethereum.eth.v1alpha1.Fork - 17, // 34: ethereum.eth.v1alpha1.BeaconStateCapella.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader - 18, // 35: ethereum.eth.v1alpha1.BeaconStateCapella.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 18, // 36: ethereum.eth.v1alpha1.BeaconStateCapella.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data - 19, // 37: ethereum.eth.v1alpha1.BeaconStateCapella.validators:type_name -> ethereum.eth.v1alpha1.Validator - 20, // 38: ethereum.eth.v1alpha1.BeaconStateCapella.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 39: ethereum.eth.v1alpha1.BeaconStateCapella.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 40: ethereum.eth.v1alpha1.BeaconStateCapella.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 18, // 34: ethereum.eth.v1alpha1.BeaconStateCapella.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 19, // 35: ethereum.eth.v1alpha1.BeaconStateCapella.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 19, // 36: ethereum.eth.v1alpha1.BeaconStateCapella.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data + 20, // 37: ethereum.eth.v1alpha1.BeaconStateCapella.validators:type_name -> ethereum.eth.v1alpha1.Validator + 21, // 38: ethereum.eth.v1alpha1.BeaconStateCapella.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 39: ethereum.eth.v1alpha1.BeaconStateCapella.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 40: ethereum.eth.v1alpha1.BeaconStateCapella.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 10, // 41: ethereum.eth.v1alpha1.BeaconStateCapella.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee 10, // 42: ethereum.eth.v1alpha1.BeaconStateCapella.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee - 23, // 43: ethereum.eth.v1alpha1.BeaconStateCapella.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 16, // 44: ethereum.eth.v1alpha1.BeaconStateCapella.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary + 24, // 43: ethereum.eth.v1alpha1.BeaconStateCapella.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 17, // 44: ethereum.eth.v1alpha1.BeaconStateCapella.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary 2, // 45: ethereum.eth.v1alpha1.BeaconStateDeneb.fork:type_name -> ethereum.eth.v1alpha1.Fork - 17, // 46: ethereum.eth.v1alpha1.BeaconStateDeneb.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader - 18, // 47: ethereum.eth.v1alpha1.BeaconStateDeneb.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 18, // 48: ethereum.eth.v1alpha1.BeaconStateDeneb.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data - 19, // 49: ethereum.eth.v1alpha1.BeaconStateDeneb.validators:type_name -> ethereum.eth.v1alpha1.Validator - 20, // 50: ethereum.eth.v1alpha1.BeaconStateDeneb.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 51: ethereum.eth.v1alpha1.BeaconStateDeneb.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint - 20, // 52: ethereum.eth.v1alpha1.BeaconStateDeneb.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 18, // 46: ethereum.eth.v1alpha1.BeaconStateDeneb.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 19, // 47: ethereum.eth.v1alpha1.BeaconStateDeneb.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 19, // 48: ethereum.eth.v1alpha1.BeaconStateDeneb.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data + 20, // 49: ethereum.eth.v1alpha1.BeaconStateDeneb.validators:type_name -> ethereum.eth.v1alpha1.Validator + 21, // 50: ethereum.eth.v1alpha1.BeaconStateDeneb.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 51: ethereum.eth.v1alpha1.BeaconStateDeneb.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 52: ethereum.eth.v1alpha1.BeaconStateDeneb.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 10, // 53: ethereum.eth.v1alpha1.BeaconStateDeneb.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee 10, // 54: ethereum.eth.v1alpha1.BeaconStateDeneb.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee - 24, // 55: ethereum.eth.v1alpha1.BeaconStateDeneb.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb - 16, // 56: ethereum.eth.v1alpha1.BeaconStateDeneb.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary - 57, // [57:57] is the sub-list for method output_type - 57, // [57:57] is the sub-list for method input_type - 57, // [57:57] is the sub-list for extension type_name - 57, // [57:57] is the sub-list for extension extendee - 0, // [0:57] is the sub-list for field type_name + 25, // 55: ethereum.eth.v1alpha1.BeaconStateDeneb.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 17, // 56: ethereum.eth.v1alpha1.BeaconStateDeneb.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary + 2, // 57: ethereum.eth.v1alpha1.BeaconStateElectra.fork:type_name -> ethereum.eth.v1alpha1.Fork + 18, // 58: ethereum.eth.v1alpha1.BeaconStateElectra.latest_block_header:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 19, // 59: ethereum.eth.v1alpha1.BeaconStateElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 19, // 60: ethereum.eth.v1alpha1.BeaconStateElectra.eth1_data_votes:type_name -> ethereum.eth.v1alpha1.Eth1Data + 20, // 61: ethereum.eth.v1alpha1.BeaconStateElectra.validators:type_name -> ethereum.eth.v1alpha1.Validator + 21, // 62: ethereum.eth.v1alpha1.BeaconStateElectra.previous_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 63: ethereum.eth.v1alpha1.BeaconStateElectra.current_justified_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 21, // 64: ethereum.eth.v1alpha1.BeaconStateElectra.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint + 10, // 65: ethereum.eth.v1alpha1.BeaconStateElectra.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 10, // 66: ethereum.eth.v1alpha1.BeaconStateElectra.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 26, // 67: ethereum.eth.v1alpha1.BeaconStateElectra.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra + 17, // 68: ethereum.eth.v1alpha1.BeaconStateElectra.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary + 27, // 69: ethereum.eth.v1alpha1.BeaconStateElectra.pending_balance_deposits:type_name -> ethereum.eth.v1alpha1.PendingBalanceDeposit + 28, // 70: ethereum.eth.v1alpha1.BeaconStateElectra.pending_partial_withdrawals:type_name -> ethereum.eth.v1alpha1.PendingPartialWithdrawal + 29, // 71: ethereum.eth.v1alpha1.BeaconStateElectra.pending_consolidations:type_name -> ethereum.eth.v1alpha1.PendingConsolidation + 72, // [72:72] is the sub-list for method output_type + 72, // [72:72] is the sub-list for method input_type + 72, // [72:72] is the sub-list for extension type_name + 72, // [72:72] is the sub-list for extension extendee + 0, // [0:72] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_state_proto_init() } @@ -2816,6 +3365,7 @@ func file_proto_prysm_v1alpha1_beacon_state_proto_init() { file_proto_prysm_v1alpha1_attestation_proto_init() file_proto_prysm_v1alpha1_beacon_block_proto_init() file_proto_prysm_v1alpha1_validator_proto_init() + file_proto_prysm_v1alpha1_eip_7251_proto_init() if !protoimpl.UnsafeEnabled { file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BeaconState); i { @@ -2998,7 +3548,7 @@ func file_proto_prysm_v1alpha1_beacon_state_proto_init() { } } file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PowBlock); i { + switch v := v.(*BeaconStateElectra); i { case 0: return &v.state case 1: @@ -3010,6 +3560,18 @@ func file_proto_prysm_v1alpha1_beacon_state_proto_init() { } } file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PowBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_state_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HistoricalSummary); i { case 0: return &v.state @@ -3028,7 +3590,7 @@ func file_proto_prysm_v1alpha1_beacon_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index f9e35705d676..c180a12c70dd 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -7,6 +7,7 @@ import "proto/prysm/v1alpha1/beacon_block.proto"; import "proto/prysm/v1alpha1/validator.proto"; import "proto/engine/v1/execution_engine.proto"; import "proto/eth/ext/options.proto"; +import "proto/prysm/v1alpha1/eip_7251.proto"; option csharp_namespace = "Ethereum.Eth.V1Alpha1"; option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; @@ -342,6 +343,70 @@ message BeaconStateDeneb { repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"]; } +message BeaconStateElectra { + // Versioning [1001-2000] + uint64 genesis_time = 1001; + bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + Fork fork = 1004; + + // History [2001-3000] + BeaconBlockHeader latest_block_header = 2001; + repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"]; + repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"]; + repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"]; + + // Eth1 [3001-4000] + Eth1Data eth1_data = 3001; + repeated Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"]; + uint64 eth1_deposit_index = 3003; + + // Registry [4001-5000] + repeated Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; + repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; + + // Randomness [5001-6000] + repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"]; + + // Slashings [6001-7000] + repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"]; + + // Participation [7001-8000] + bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; + bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; + + // Finality [8001-9000] + // Spec type [4]Bitvector which means this would be a fixed size of 4 bits. + bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"]; + Checkpoint previous_justified_checkpoint = 8002; + Checkpoint current_justified_checkpoint = 8003; + Checkpoint finalized_checkpoint = 8004; + + // Fields introduced in Altair fork [9001-10000] + repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; + SyncCommittee current_sync_committee = 9002; + SyncCommittee next_sync_committee = 9003; + + // Fields introduced in Bellatrix fork [10001-11000] + ethereum.engine.v1.ExecutionPayloadHeaderElectra latest_execution_payload_header = 10001; // [New in Electra] + + // Fields introduced in Capella fork [11001-12000] + uint64 next_withdrawal_index = 11001; + uint64 next_withdrawal_validator_index = 11002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"]; + + // Fields introduced in EIP-7251 fork [12001-13000] + uint64 deposit_receipts_start_index = 12001; + uint64 deposit_balance_to_consume = 12002; + uint64 exit_balance_to_consume = 12003; + uint64 earliest_exit_epoch = 12004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; + uint64 consolidation_balance_to_consume = 12005; + uint64 earliest_consolidation_epoch = 12006 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; + repeated PendingBalanceDeposit pending_balance_deposits = 12007 [(ethereum.eth.ext.ssz_max) = "134217728"]; + repeated PendingPartialWithdrawal pending_partial_withdrawals = 12008 [(ethereum.eth.ext.ssz_max) = "134217728"]; + repeated PendingConsolidation pending_consolidations = 12009 [(ethereum.eth.ext.ssz_max) = "262144"]; +} + // PowBlock is a definition from Bellatrix fork choice spec to represent a block with total difficulty in the PoW chain. // Spec: // class PowBlock(Container): diff --git a/proto/prysm/v1alpha1/eip_7251.pb.go b/proto/prysm/v1alpha1/eip_7251.pb.go new file mode 100755 index 000000000000..5386d5e9f141 --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7251.pb.go @@ -0,0 +1,520 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.1 +// source: proto/prysm/v1alpha1/eip_7251.proto + +package eth + +import ( + reflect "reflect" + sync "sync" + + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PendingBalanceDeposit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *PendingBalanceDeposit) Reset() { + *x = PendingBalanceDeposit{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingBalanceDeposit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingBalanceDeposit) ProtoMessage() {} + +func (x *PendingBalanceDeposit) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PendingBalanceDeposit.ProtoReflect.Descriptor instead. +func (*PendingBalanceDeposit) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{0} +} + +func (x *PendingBalanceDeposit) GetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.Index + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *PendingBalanceDeposit) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +type PendingPartialWithdrawal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + WithdrawableEpoch uint64 `protobuf:"varint,3,opt,name=withdrawable_epoch,json=withdrawableEpoch,proto3" json:"withdrawable_epoch,omitempty"` +} + +func (x *PendingPartialWithdrawal) Reset() { + *x = PendingPartialWithdrawal{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingPartialWithdrawal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingPartialWithdrawal) ProtoMessage() {} + +func (x *PendingPartialWithdrawal) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PendingPartialWithdrawal.ProtoReflect.Descriptor instead. +func (*PendingPartialWithdrawal) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{1} +} + +func (x *PendingPartialWithdrawal) GetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.Index + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *PendingPartialWithdrawal) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *PendingPartialWithdrawal) GetWithdrawableEpoch() uint64 { + if x != nil { + return x.WithdrawableEpoch + } + return 0 +} + +type Consolidation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=source_index,json=sourceIndex,proto3" json:"source_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + TargetIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=target_index,json=targetIndex,proto3" json:"target_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Epoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` +} + +func (x *Consolidation) Reset() { + *x = Consolidation{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Consolidation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Consolidation) ProtoMessage() {} + +func (x *Consolidation) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Consolidation.ProtoReflect.Descriptor instead. +func (*Consolidation) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{2} +} + +func (x *Consolidation) GetSourceIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.SourceIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *Consolidation) GetTargetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.TargetIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *Consolidation) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { + if x != nil { + return x.Epoch + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) +} + +type SignedConsolidation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *Consolidation `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *SignedConsolidation) Reset() { + *x = SignedConsolidation{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedConsolidation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedConsolidation) ProtoMessage() {} + +func (x *SignedConsolidation) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedConsolidation.ProtoReflect.Descriptor instead. +func (*SignedConsolidation) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{3} +} + +func (x *SignedConsolidation) GetMessage() *Consolidation { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedConsolidation) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type PendingConsolidation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=source_index,json=sourceIndex,proto3" json:"source_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + TargetIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=target_index,json=targetIndex,proto3" json:"target_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` +} + +func (x *PendingConsolidation) Reset() { + *x = PendingConsolidation{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingConsolidation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingConsolidation) ProtoMessage() {} + +func (x *PendingConsolidation) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PendingConsolidation.ProtoReflect.Descriptor instead. +func (*PendingConsolidation) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{4} +} + +func (x *PendingConsolidation) GetSourceIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.SourceIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *PendingConsolidation) GetTargetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.TargetIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +var File_proto_prysm_v1alpha1_eip_7251_proto protoreflect.FileDescriptor + +var file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x69, 0x70, 0x5f, 0x37, 0x32, 0x35, 0x31, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x01, 0x0a, 0x15, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0xc8, 0x01, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, + 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, + 0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xd5, 0x02, + 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x7b, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32, 0x35, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_prysm_v1alpha1_eip_7251_proto_rawDescOnce sync.Once + file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData = file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc +) + +func file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP() []byte { + file_proto_prysm_v1alpha1_eip_7251_proto_rawDescOnce.Do(func() { + file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData) + }) + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData +} + +var file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_prysm_v1alpha1_eip_7251_proto_goTypes = []interface{}{ + (*PendingBalanceDeposit)(nil), // 0: ethereum.eth.v1alpha1.PendingBalanceDeposit + (*PendingPartialWithdrawal)(nil), // 1: ethereum.eth.v1alpha1.PendingPartialWithdrawal + (*Consolidation)(nil), // 2: ethereum.eth.v1alpha1.Consolidation + (*SignedConsolidation)(nil), // 3: ethereum.eth.v1alpha1.SignedConsolidation + (*PendingConsolidation)(nil), // 4: ethereum.eth.v1alpha1.PendingConsolidation +} +var file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs = []int32{ + 2, // 0: ethereum.eth.v1alpha1.SignedConsolidation.message:type_name -> ethereum.eth.v1alpha1.Consolidation + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_proto_prysm_v1alpha1_eip_7251_proto_init() } +func file_proto_prysm_v1alpha1_eip_7251_proto_init() { + if File_proto_prysm_v1alpha1_eip_7251_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingBalanceDeposit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingPartialWithdrawal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Consolidation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedConsolidation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingConsolidation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_prysm_v1alpha1_eip_7251_proto_goTypes, + DependencyIndexes: file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs, + MessageInfos: file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes, + }.Build() + File_proto_prysm_v1alpha1_eip_7251_proto = out.File + file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = nil + file_proto_prysm_v1alpha1_eip_7251_proto_goTypes = nil + file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs = nil +} diff --git a/proto/prysm/v1alpha1/eip_7251.pb.gw.go b/proto/prysm/v1alpha1/eip_7251.pb.gw.go new file mode 100755 index 000000000000..cdd03643f0c7 --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7251.pb.gw.go @@ -0,0 +1,4 @@ +//go:build ignore +// +build ignore + +package ignore diff --git a/proto/prysm/v1alpha1/eip_7251.proto b/proto/prysm/v1alpha1/eip_7251.proto new file mode 100644 index 000000000000..43aede682a8b --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7251.proto @@ -0,0 +1,70 @@ +// Copyright 2020 Prysmatic Labs. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package ethereum.eth.v1alpha1; + +import "proto/eth/ext/options.proto"; + +option csharp_namespace = "Ethereum.Eth.v1alpha1"; +option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; +option java_multiple_files = true; +option java_outer_classname = "EIP7251Proto"; +option java_package = "org.ethereum.eth.v1alpha1"; +option php_namespace = "Ethereum\\Eth\\v1alpha1"; + +message PendingBalanceDeposit { + // Validator index for the deposit. + uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + + // The amount of the deposit (gwei). + uint64 amount = 2; +} + +message PendingPartialWithdrawal { + // Validator index for the withdrawal. + uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + + // The amount of the withdrawal (gwei). + uint64 amount = 2; + + // A partial withdrawal is valid at this epoch or later. + uint64 withdrawable_epoch = 3; +} + + +message Consolidation { + // Validator from which the funds will be moved. + uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + // Validator to which the funds will be moved. + uint64 target_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + // A consolidation is valid at this epoch or later. + uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; +} + + +message SignedConsolidation { + // The unsigned consolidation itself. + Consolidation message = 1; + + // Validator's 96 byte signature + bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + +message PendingConsolidation { + // Validator from which the funds will be moved. + uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + // Validator to which the funds will be moved. + uint64 target_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; +} diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index 8d9fff5255e4..d1ac18d870a0 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: eec7f00cb63ce6e76f0c38f25c23206f9700f1c9ba9f295908168d59f9af3f60 +// Hash: 27607f699654c05a3711ca64479cd5d8a35ac9807f5e76116d2894a25362b20f package eth import ( @@ -141,6 +141,159 @@ func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the AttestationElectra object +func (a *AttestationElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttestationElectra object to a target array +func (a *AttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(236) + + // Offset (0) 'AggregationBits' + dst = ssz.WriteOffset(dst, offset) + offset += len(a.AggregationBits) + + // Field (1) 'Data' + if a.Data == nil { + a.Data = new(AttestationData) + } + if dst, err = a.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + dst = append(dst, a.CommitteeBits...) + + // Field (3) 'Signature' + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, a.Signature...) + + // Field (0) 'AggregationBits' + if size := len(a.AggregationBits); size > 131072 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 131072) + return + } + dst = append(dst, a.AggregationBits...) + + return +} + +// UnmarshalSSZ ssz unmarshals the AttestationElectra object +func (a *AttestationElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 236 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AggregationBits' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 236 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if a.Data == nil { + a.Data = new(AttestationData) + } + if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'CommitteeBits' + if cap(a.CommitteeBits) == 0 { + a.CommitteeBits = make([]byte, 0, len(buf[132:140])) + } + a.CommitteeBits = append(a.CommitteeBits, buf[132:140]...) + + // Field (3) 'Signature' + if cap(a.Signature) == 0 { + a.Signature = make([]byte, 0, len(buf[140:236])) + } + a.Signature = append(a.Signature, buf[140:236]...) + + // Field (0) 'AggregationBits' + { + buf = tail[o0:] + if err = ssz.ValidateBitlist(buf, 131072); err != nil { + return err + } + if cap(a.AggregationBits) == 0 { + a.AggregationBits = make([]byte, 0, len(buf)) + } + a.AggregationBits = append(a.AggregationBits, buf...) + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AttestationElectra object +func (a *AttestationElectra) SizeSSZ() (size int) { + size = 236 + + // Field (0) 'AggregationBits' + size += len(a.AggregationBits) + + return +} + +// HashTreeRoot ssz hashes the AttestationElectra object +func (a *AttestationElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AttestationElectra object with a hasher +func (a *AttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if len(a.AggregationBits) == 0 { + err = ssz.ErrEmptyBitlist + return + } + hh.PutBitlist(a.AggregationBits, 131072) + + // Field (1) 'Data' + if err = a.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + hh.PutBytes(a.CommitteeBits) + + // Field (3) 'Signature' + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(a.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the AggregateAttestationAndProof object func (a *AggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(a) @@ -263,6 +416,128 @@ func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err err return } +// MarshalSSZ ssz marshals the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AggregateAttestationAndProofElectra object to a target array +func (a *AggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(108) + + // Field (0) 'AggregatorIndex' + dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) + + // Offset (1) 'Aggregate' + dst = ssz.WriteOffset(dst, offset) + if a.Aggregate == nil { + a.Aggregate = new(AttestationElectra) + } + offset += a.Aggregate.SizeSSZ() + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + dst = append(dst, a.SelectionProof...) + + // Field (1) 'Aggregate' + if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 108 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'AggregatorIndex' + a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Offset (1) 'Aggregate' + if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { + return ssz.ErrOffset + } + + if o1 < 108 { + return ssz.ErrInvalidVariableOffset + } + + // Field (2) 'SelectionProof' + if cap(a.SelectionProof) == 0 { + a.SelectionProof = make([]byte, 0, len(buf[12:108])) + } + a.SelectionProof = append(a.SelectionProof, buf[12:108]...) + + // Field (1) 'Aggregate' + { + buf = tail[o1:] + if a.Aggregate == nil { + a.Aggregate = new(AttestationElectra) + } + if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) SizeSSZ() (size int) { + size = 108 + + // Field (1) 'Aggregate' + if a.Aggregate == nil { + a.Aggregate = new(AttestationElectra) + } + size += a.Aggregate.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AggregateAttestationAndProofElectra object with a hasher +func (a *AggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregatorIndex' + hh.PutUint64(uint64(a.AggregatorIndex)) + + // Field (1) 'Aggregate' + if err = a.Aggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + hh.PutBytes(a.SelectionProof) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the SignedAggregateAttestationAndProof object func (s *SignedAggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) @@ -376,30 +651,143 @@ func (s *SignedAggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (e return } -// MarshalSSZ ssz marshals the AttestationData object -func (a *AttestationData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) +// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) } -// MarshalSSZTo ssz marshals the AttestationData object to a target array -func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProofElectra object to a target array +func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf + offset := int(100) - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(a.Slot)) + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofElectra) + } + offset += s.Message.SizeSSZ() - // Field (1) 'CommitteeIndex' - dst = ssz.MarshalUint64(dst, uint64(a.CommitteeIndex)) + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) - // Field (2) 'BeaconBlockRoot' - if size := len(a.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { return } - dst = append(dst, a.BeaconBlockRoot...) - // Field (3) 'Source' - if a.Source == nil { + return +} + +// UnmarshalSSZ ssz unmarshals the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofElectra) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofElectra) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProofElectra object with a hasher +func (s *SignedAggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the AttestationData object +func (a *AttestationData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttestationData object to a target array +func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(a.Slot)) + + // Field (1) 'CommitteeIndex' + dst = ssz.MarshalUint64(dst, uint64(a.CommitteeIndex)) + + // Field (2) 'BeaconBlockRoot' + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + dst = append(dst, a.BeaconBlockRoot...) + + // Field (3) 'Source' + if a.Source == nil { a.Source = new(Checkpoint) } if dst, err = a.Source.MarshalSSZTo(dst); err != nil { @@ -2254,6 +2642,138 @@ func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttesterSlashingElectra object to a target array +func (a *AttesterSlashingElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(8) + + // Offset (0) 'Attestation_1' + dst = ssz.WriteOffset(dst, offset) + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestationElectra) + } + offset += a.Attestation_1.SizeSSZ() + + // Offset (1) 'Attestation_2' + dst = ssz.WriteOffset(dst, offset) + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestationElectra) + } + offset += a.Attestation_2.SizeSSZ() + + // Field (0) 'Attestation_1' + if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Attestation_2' + if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 8 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'Attestation_1' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 8 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'Attestation_2' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (0) 'Attestation_1' + { + buf = tail[o0:o1] + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestationElectra) + } + if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'Attestation_2' + { + buf = tail[o1:] + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestationElectra) + } + if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) SizeSSZ() (size int) { + size = 8 + + // Field (0) 'Attestation_1' + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestationElectra) + } + size += a.Attestation_1.SizeSSZ() + + // Field (1) 'Attestation_2' + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestationElectra) + } + size += a.Attestation_2.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AttesterSlashingElectra object with a hasher +func (a *AttesterSlashingElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Attestation_1' + if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Attestation_2' + if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { + return + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the Deposit object func (d *Deposit) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(d) @@ -2971,45 +3491,194 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the SyncAggregate object -func (s *SyncAggregate) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) +// MarshalSSZ ssz marshals the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(i) } -// MarshalSSZTo ssz marshals the SyncAggregate object to a target array -func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the IndexedAttestationElectra object to a target array +func (i *IndexedAttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf + offset := int(228) - // Field (0) 'SyncCommitteeBits' - if size := len(s.SyncCommitteeBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) + // Offset (0) 'AttestingIndices' + dst = ssz.WriteOffset(dst, offset) + offset += len(i.AttestingIndices) * 8 + + // Field (1) 'Data' + if i.Data == nil { + i.Data = new(AttestationData) + } + if dst, err = i.Data.MarshalSSZTo(dst); err != nil { return } - dst = append(dst, s.SyncCommitteeBits...) - // Field (1) 'SyncCommitteeSignature' - if size := len(s.SyncCommitteeSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) + // Field (2) 'Signature' + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } - dst = append(dst, s.SyncCommitteeSignature...) + dst = append(dst, i.Signature...) + + // Field (0) 'AttestingIndices' + if size := len(i.AttestingIndices); size > 131072 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) + return + } + for ii := 0; ii < len(i.AttestingIndices); ii++ { + dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) + } return } -// UnmarshalSSZ ssz unmarshals the SyncAggregate object -func (s *SyncAggregate) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size != 160 { + if size < 228 { return ssz.ErrSize } - // Field (0) 'SyncCommitteeBits' - if cap(s.SyncCommitteeBits) == 0 { - s.SyncCommitteeBits = make([]byte, 0, len(buf[0:64])) - } - s.SyncCommitteeBits = append(s.SyncCommitteeBits, buf[0:64]...) + tail := buf + var o0 uint64 + + // Offset (0) 'AttestingIndices' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 228 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if i.Data == nil { + i.Data = new(AttestationData) + } + if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(i.Signature) == 0 { + i.Signature = make([]byte, 0, len(buf[132:228])) + } + i.Signature = append(i.Signature, buf[132:228]...) + + // Field (0) 'AttestingIndices' + { + buf = tail[o0:] + num, err := ssz.DivideInt2(len(buf), 8, 131072) + if err != nil { + return err + } + i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) + for ii := 0; ii < num; ii++ { + i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) SizeSSZ() (size int) { + size = 228 + + // Field (0) 'AttestingIndices' + size += len(i.AttestingIndices) * 8 + + return +} + +// HashTreeRoot ssz hashes the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(i) +} + +// HashTreeRootWith ssz hashes the IndexedAttestationElectra object with a hasher +func (i *IndexedAttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestingIndices' + { + if size := len(i.AttestingIndices); size > 131072 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) + return + } + subIndx := hh.Index() + for _, i := range i.AttestingIndices { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(i.AttestingIndices)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) + } + } + + // Field (1) 'Data' + if err = i.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(i.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the SyncAggregate object +func (s *SyncAggregate) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncAggregate object to a target array +func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SyncCommitteeBits' + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) + return + } + dst = append(dst, s.SyncCommitteeBits...) + + // Field (1) 'SyncCommitteeSignature' + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) + return + } + dst = append(dst, s.SyncCommitteeSignature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncAggregate object +func (s *SyncAggregate) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 160 { + return ssz.ErrSize + } + + // Field (0) 'SyncCommitteeBits' + if cap(s.SyncCommitteeBits) == 0 { + s.SyncCommitteeBits = make([]byte, 0, len(buf[0:64])) + } + s.SyncCommitteeBits = append(s.SyncCommitteeBits, buf[0:64]...) // Field (1) 'SyncCommitteeSignature' if cap(s.SyncCommitteeSignature) == 0 { @@ -8539,101 +9208,110 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } -// MarshalSSZ ssz marshals the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) +// MarshalSSZ ssz marshals the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) } -// MarshalSSZTo ssz marshals the ValidatorRegistrationV1 object to a target array -func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the SignedBeaconBlockElectra object to a target array +func (s *SignedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf + offset := int(100) - // Field (0) 'FeeRecipient' - if size := len(v.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockElectra) } - dst = append(dst, v.FeeRecipient...) - - // Field (1) 'GasLimit' - dst = ssz.MarshalUint64(dst, v.GasLimit) + offset += s.Block.SizeSSZ() - // Field (2) 'Timestamp' - dst = ssz.MarshalUint64(dst, v.Timestamp) + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) - // Field (3) 'Pubkey' - if size := len(v.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { return } - dst = append(dst, v.Pubkey...) return } -// UnmarshalSSZ ssz unmarshals the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size != 84 { + if size < 100 { return ssz.ErrSize } - // Field (0) 'FeeRecipient' - if cap(v.FeeRecipient) == 0 { - v.FeeRecipient = make([]byte, 0, len(buf[0:20])) - } - v.FeeRecipient = append(v.FeeRecipient, buf[0:20]...) + tail := buf + var o0 uint64 - // Field (1) 'GasLimit' - v.GasLimit = ssz.UnmarshallUint64(buf[20:28]) + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } - // Field (2) 'Timestamp' - v.Timestamp = ssz.UnmarshallUint64(buf[28:36]) + if o0 < 100 { + return ssz.ErrInvalidVariableOffset + } - // Field (3) 'Pubkey' - if cap(v.Pubkey) == 0 { - v.Pubkey = make([]byte, 0, len(buf[36:84])) + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) } - v.Pubkey = append(v.Pubkey, buf[36:84]...) + s.Signature = append(s.Signature, buf[4:100]...) + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockElectra) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } return err } -// SizeSSZ returns the ssz encoded size in bytes for the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) SizeSSZ() (size int) { - size = 84 +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockElectra) + } + size += s.Block.SizeSSZ() + return } -// HashTreeRoot ssz hashes the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) +// HashTreeRoot ssz hashes the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) } -// HashTreeRootWith ssz hashes the ValidatorRegistrationV1 object with a hasher -func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the SignedBeaconBlockElectra object with a hasher +func (s *SignedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'FeeRecipient' - if size := len(v.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { return } - hh.PutBytes(v.FeeRecipient) - - // Field (1) 'GasLimit' - hh.PutUint64(v.GasLimit) - - // Field (2) 'Timestamp' - hh.PutUint64(v.Timestamp) - // Field (3) 'Pubkey' - if size := len(v.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } - hh.PutBytes(v.Pubkey) + hh.PutBytes(s.Signature) if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) @@ -8643,134 +9321,53 @@ func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) +// MarshalSSZ ssz marshals the BeaconBlockElectra object +func (b *BeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the SignedValidatorRegistrationV1 object to a target array -func (s *SignedValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BeaconBlockElectra object to a target array +func (b *BeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf + offset := int(84) - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ValidatorRegistrationV1) - } - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 180 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ValidatorRegistrationV1) - } - if err = s.Message.UnmarshalSSZ(buf[0:84]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[84:180])) - } - s.Signature = append(s.Signature, buf[84:180]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) SizeSSZ() (size int) { - size = 180 - return -} - -// HashTreeRoot ssz hashes the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedValidatorRegistrationV1 object with a hasher -func (s *SignedValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } + dst = append(dst, b.ParentRoot...) - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BuilderBid object -func (b *BuilderBid) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBid object to a target array -func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) + dst = append(dst, b.StateRoot...) - // Offset (0) 'Header' + // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - offset += b.Header.SizeSSZ() - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return + if b.Body == nil { + b.Body = new(BeaconBlockBodyElectra) } - dst = append(dst, b.Pubkey...) + offset += b.Body.SizeSSZ() - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } -// UnmarshalSSZ ssz unmarshals the BuilderBid object -func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconBlockElectra object +func (b *BeaconBlockElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { @@ -8778,82 +9375,94 @@ func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { } tail := buf - var o0 uint64 + var o4 uint64 - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - if o0 < 84 { - return ssz.ErrInvalidVariableOffset + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) } + b.StateRoot = append(b.StateRoot, buf[48:80]...) - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset } - b.Value = append(b.Value, buf[4:36]...) - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) + if o4 < 84 { + return ssz.ErrInvalidVariableOffset } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - // Field (0) 'Header' + // Field (4) 'Body' { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBodyElectra) } - if err = b.Header.UnmarshalSSZ(buf); err != nil { + if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object -func (b *BuilderBid) SizeSSZ() (size int) { +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockElectra object +func (b *BeaconBlockElectra) SizeSSZ() (size int) { size = 84 - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyElectra) } - size += b.Header.SizeSSZ() + size += b.Body.SizeSSZ() return } -// HashTreeRoot ssz hashes the BuilderBid object -func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BeaconBlockElectra object +func (b *BeaconBlockElectra) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BuilderBid object with a hasher -func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconBlockElectra object with a hasher +func (b *BeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } + hh.PutBytes(b.ParentRoot) - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } - hh.PutBytes(b.Value) + hh.PutBytes(b.StateRoot) - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { return } - hh.PutBytes(b.Pubkey) if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) @@ -8863,180 +9472,177 @@ func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the BuilderBidCapella object -func (b *BuilderBidCapella) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the BuilderBidCapella object to a target array -func (b *BuilderBidCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array +func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(84) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - offset += b.Header.SizeSSZ() + offset := int(396) - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } - dst = append(dst, b.Value...) + dst = append(dst, b.RandaoReveal...) - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } - dst = append(dst, b.Pubkey...) - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } + dst = append(dst, b.Graffiti...) - return -} + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 -// UnmarshalSSZ ssz unmarshals the BuilderBidCapella object -func (b *BuilderBidCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() } - tail := buf - var o0 uint64 - - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() } - if o0 < 84 { - return ssz.ErrInvalidVariableOffset - } + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) - } - b.Value = append(b.Value, buf[4:36]...) + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - - // Field (0) 'Header' - { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidCapella object -func (b *BuilderBidCapella) SizeSSZ() (size int) { - size = 84 - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) + // Offset (9) 'ExecutionPayload' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadElectra) } - size += b.Header.SizeSSZ() + offset += b.ExecutionPayload.SizeSSZ() - return -} + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 -// HashTreeRoot ssz hashes the BuilderBidCapella object -func (b *BuilderBidCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} + // Offset (11) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 -// HashTreeRootWith ssz hashes the BuilderBidCapella object with a hasher -func (b *BuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Offset (12) 'Consolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Consolidations) * 120 - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 1 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) return } - hh.PutBytes(b.Value) + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 8 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 8) return } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } } - return -} - -// MarshalSSZ ssz marshals the BuilderBidDeneb object -func (b *BuilderBidDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBidDeneb object to a target array -func (b *BuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(88) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } } - offset += b.Header.SizeSSZ() - // Offset (1) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (2) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } - dst = append(dst, b.Value...) + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (3) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + // Field (9) 'ExecutionPayload' + if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { return } - dst = append(dst, b.Pubkey...) - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) return } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (1) 'BlobKzgCommitments' + // Field (11) 'BlobKzgCommitments' if size := len(b.BlobKzgCommitments); size > 4096 { err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) return @@ -9049,434 +9655,512 @@ func (b *BuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = append(dst, b.BlobKzgCommitments[ii]...) } + // Field (12) 'Consolidations' + if size := len(b.Consolidations); size > 1 { + err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) + return + } + for ii := 0; ii < len(b.Consolidations); ii++ { + if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + return } -// UnmarshalSSZ ssz unmarshals the BuilderBidDeneb object -func (b *BuilderBidDeneb) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 88 { + if size < 396 { return ssz.ErrSize } tail := buf - var o0, o1 uint64 + var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - if o0 < 88 { - return ssz.ErrInvalidVariableOffset + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err } - // Offset (1) 'BlobKzgCommitments' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) } + b.Graffiti = append(b.Graffiti, buf[168:200]...) - // Field (2) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[8:40])) + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset } - b.Value = append(b.Value, buf[8:40]...) - // Field (3) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[40:88])) + if o3 < 396 { + return ssz.ErrInvalidVariableOffset } - b.Pubkey = append(b.Pubkey, buf[40:88]...) - // Field (0) 'Header' - { - buf = tail[o0:o1] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset } - // Field (1) 'BlobKzgCommitments' - { - buf = tail[o1:] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.BlobKzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.BlobKzgCommitments[ii]) == 0 { - b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset } - return err -} -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidDeneb object -func (b *BuilderBidDeneb) SizeSSZ() (size int) { - size = 88 + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset } - size += b.Header.SizeSSZ() - // Field (1) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } - return -} + // Offset (9) 'ExecutionPayload' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } -// HashTreeRoot ssz hashes the BuilderBidDeneb object -func (b *BuilderBidDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } -// HashTreeRootWith ssz hashes the BuilderBidDeneb object with a hasher -func (b *BuilderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Offset (11) 'BlobKzgCommitments' + if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { + return ssz.ErrOffset + } - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return + // Offset (12) 'Consolidations' + if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { + return ssz.ErrOffset } - // Field (1) 'BlobKzgCommitments' + // Field (3) 'ProposerSlashings' { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err } - subIndx := hh.Index() - for _, i := range b.BlobKzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err } - hh.PutBytes(i) - } - - numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) } } - // Field (2) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 1) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashingElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashingElectra) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } } - hh.PutBytes(b.Value) - // Field (3) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 8) + if err != nil { + return err + } + b.Attestations = make([]*AttestationElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(AttestationElectra) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } } - hh.PutBytes(b.Pubkey) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } } - return -} - -// MarshalSSZ ssz marshals the BlobSidecar object -func (b *BlobSidecar) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecar object to a target array -func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, b.Index) - - // Field (1) 'Blob' - if size := len(b.Blob); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) - return + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } } - dst = append(dst, b.Blob...) - // Field (2) 'KzgCommitment' - if size := len(b.KzgCommitment); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) - return + // Field (9) 'ExecutionPayload' + { + buf = tail[o9:o10] + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + } + if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { + return err + } } - dst = append(dst, b.KzgCommitment...) - // Field (3) 'KzgProof' - if size := len(b.KzgProof); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) - return + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:o11] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } } - dst = append(dst, b.KzgProof...) - // Field (4) 'SignedBlockHeader' - if b.SignedBlockHeader == nil { - b.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if dst, err = b.SignedBlockHeader.MarshalSSZTo(dst); err != nil { - return + // Field (11) 'BlobKzgCommitments' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } } - // Field (5) 'CommitmentInclusionProof' - if size := len(b.CommitmentInclusionProof); size != 17 { - err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) - return - } - for ii := 0; ii < 17; ii++ { - if size := len(b.CommitmentInclusionProof[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.CommitmentInclusionProof[ii]", size, 32) - return + // Field (12) 'Consolidations' + { + buf = tail[o12:] + num, err := ssz.DivideInt2(len(buf), 120, 1) + if err != nil { + return err + } + b.Consolidations = make([]*SignedConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.Consolidations[ii] == nil { + b.Consolidations[ii] = new(SignedConsolidation) + } + if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { + return err + } } - dst = append(dst, b.CommitmentInclusionProof[ii]...) } - - return + return err } -// UnmarshalSSZ ssz unmarshals the BlobSidecar object -func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 131928 { - return ssz.ErrSize - } +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { + size = 396 - // Field (0) 'Index' - b.Index = ssz.UnmarshallUint64(buf[0:8]) + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 - // Field (1) 'Blob' - if cap(b.Blob) == 0 { - b.Blob = make([]byte, 0, len(buf[8:131080])) + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() } - b.Blob = append(b.Blob, buf[8:131080]...) - // Field (2) 'KzgCommitment' - if cap(b.KzgCommitment) == 0 { - b.KzgCommitment = make([]byte, 0, len(buf[131080:131128])) + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() } - b.KzgCommitment = append(b.KzgCommitment, buf[131080:131128]...) - // Field (3) 'KzgProof' - if cap(b.KzgProof) == 0 { - b.KzgProof = make([]byte, 0, len(buf[131128:131176])) - } - b.KzgProof = append(b.KzgProof, buf[131128:131176]...) + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 - // Field (4) 'SignedBlockHeader' - if b.SignedBlockHeader == nil { - b.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if err = b.SignedBlockHeader.UnmarshalSSZ(buf[131176:131384]); err != nil { - return err - } + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 - // Field (5) 'CommitmentInclusionProof' - b.CommitmentInclusionProof = make([][]byte, 17) - for ii := 0; ii < 17; ii++ { - if cap(b.CommitmentInclusionProof[ii]) == 0 { - b.CommitmentInclusionProof[ii] = make([]byte, 0, len(buf[131384:131928][ii*32:(ii+1)*32])) - } - b.CommitmentInclusionProof[ii] = append(b.CommitmentInclusionProof[ii], buf[131384:131928][ii*32:(ii+1)*32]...) + // Field (9) 'ExecutionPayload' + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadElectra) } + size += b.ExecutionPayload.SizeSSZ() - return err -} + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + // Field (12) 'Consolidations' + size += len(b.Consolidations) * 120 -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecar object -func (b *BlobSidecar) SizeSSZ() (size int) { - size = 131928 return } -// HashTreeRoot ssz hashes the BlobSidecar object -func (b *BlobSidecar) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BlobSidecar object with a hasher -func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconBlockBodyElectra object with a hasher +func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'Index' - hh.PutUint64(b.Index) - - // Field (1) 'Blob' - if size := len(b.Blob); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) - return - } - hh.PutBytes(b.Blob) - - // Field (2) 'KzgCommitment' - if size := len(b.KzgCommitment); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } - hh.PutBytes(b.KzgCommitment) + hh.PutBytes(b.RandaoReveal) - // Field (3) 'KzgProof' - if size := len(b.KzgProof); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } - hh.PutBytes(b.KzgProof) - // Field (4) 'SignedBlockHeader' - if err = b.SignedBlockHeader.HashTreeRootWith(hh); err != nil { + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } + hh.PutBytes(b.Graffiti) - // Field (5) 'CommitmentInclusionProof' + // Field (3) 'ProposerSlashings' { - if size := len(b.CommitmentInclusionProof); size != 17 { - err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize return } - subIndx := hh.Index() - for _, i := range b.CommitmentInclusionProof { - if len(i) != 32 { - err = ssz.ErrBytesLength + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { return } - hh.Append(i) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) } else { - hh.Merkleize(subIndx) + hh.MerkleizeWithMixin(subIndx, num, 16) } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecars object -func (b *BlobSidecars) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecars object to a target array -func (b *BlobSidecars) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(4) - - // Offset (0) 'Sidecars' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Sidecars) * 131928 - - // Field (0) 'Sidecars' - if size := len(b.Sidecars); size > 6 { - err = ssz.ErrListTooBigFn("--.Sidecars", size, 6) - return - } - for ii := 0; ii < len(b.Sidecars); ii++ { - if dst, err = b.Sidecars[ii].MarshalSSZTo(dst); err != nil { + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 1 { + err = ssz.ErrIncorrectListSize return } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1) + } } - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecars object -func (b *BlobSidecars) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 4 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Sidecars' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 8 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8) + } else { + hh.MerkleizeWithMixin(subIndx, num, 8) + } } - if o0 < 4 { - return ssz.ErrInvalidVariableOffset + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } } - // Field (0) 'Sidecars' + // Field (7) 'VoluntaryExits' { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 131928, 6) - if err != nil { - return err + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return } - b.Sidecars = make([]*BlobSidecar, num) - for ii := 0; ii < num; ii++ { - if b.Sidecars[ii] == nil { - b.Sidecars[ii] = new(BlobSidecar) - } - if err = b.Sidecars[ii].UnmarshalSSZ(buf[ii*131928 : (ii+1)*131928]); err != nil { - return err + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return } } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecars object -func (b *BlobSidecars) SizeSSZ() (size int) { - size = 4 - - // Field (0) 'Sidecars' - size += len(b.Sidecars) * 131928 - - return -} -// HashTreeRoot ssz hashes the BlobSidecars object -func (b *BlobSidecars) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } -// HashTreeRootWith ssz hashes the BlobSidecars object with a hasher -func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Field (9) 'ExecutionPayload' + if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { + return + } - // Field (0) 'Sidecars' + // Field (10) 'BlsToExecutionChanges' { subIndx := hh.Index() - num := uint64(len(b.Sidecars)) - if num > 6 { + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { err = ssz.ErrIncorrectListSize return } - for _, elem := range b.Sidecars { + for _, elem := range b.BlsToExecutionChanges { if err = elem.HashTreeRootWith(hh); err != nil { return } } if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6) + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) } else { - hh.MerkleizeWithMixin(subIndx, num, 6) + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + // Field (11) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + } + + // Field (12) 'Consolidations' + { + subIndx := hh.Index() + num := uint64(len(b.Consolidations)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Consolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1) } } @@ -9488,112 +10172,101 @@ func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the Deposit_Data object -func (d *Deposit_Data) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) +// MarshalSSZ ssz marshals the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(v) } -// MarshalSSZTo ssz marshals the Deposit_Data object to a target array -func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ValidatorRegistrationV1 object to a target array +func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + // Field (0) 'FeeRecipient' + if size := len(v.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } - dst = append(dst, d.PublicKey...) + dst = append(dst, v.FeeRecipient...) - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) + // Field (1) 'GasLimit' + dst = ssz.MarshalUint64(dst, v.GasLimit) - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) + // Field (2) 'Timestamp' + dst = ssz.MarshalUint64(dst, v.Timestamp) - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + // Field (3) 'Pubkey' + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } - dst = append(dst, d.Signature...) + dst = append(dst, v.Pubkey...) return } -// UnmarshalSSZ ssz unmarshals the Deposit_Data object -func (d *Deposit_Data) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size != 184 { + if size != 84 { return ssz.ErrSize } - // Field (0) 'PublicKey' - if cap(d.PublicKey) == 0 { - d.PublicKey = make([]byte, 0, len(buf[0:48])) + // Field (0) 'FeeRecipient' + if cap(v.FeeRecipient) == 0 { + v.FeeRecipient = make([]byte, 0, len(buf[0:20])) } - d.PublicKey = append(d.PublicKey, buf[0:48]...) + v.FeeRecipient = append(v.FeeRecipient, buf[0:20]...) - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) + // Field (1) 'GasLimit' + v.GasLimit = ssz.UnmarshallUint64(buf[20:28]) - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) + // Field (2) 'Timestamp' + v.Timestamp = ssz.UnmarshallUint64(buf[28:36]) - // Field (3) 'Signature' - if cap(d.Signature) == 0 { - d.Signature = make([]byte, 0, len(buf[88:184])) + // Field (3) 'Pubkey' + if cap(v.Pubkey) == 0 { + v.Pubkey = make([]byte, 0, len(buf[36:84])) } - d.Signature = append(d.Signature, buf[88:184]...) + v.Pubkey = append(v.Pubkey, buf[36:84]...) return err } -// SizeSSZ returns the ssz encoded size in bytes for the Deposit_Data object -func (d *Deposit_Data) SizeSSZ() (size int) { - size = 184 +// SizeSSZ returns the ssz encoded size in bytes for the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) SizeSSZ() (size int) { + size = 84 return } -// HashTreeRoot ssz hashes the Deposit_Data object -func (d *Deposit_Data) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) +// HashTreeRoot ssz hashes the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(v) } -// HashTreeRootWith ssz hashes the Deposit_Data object with a hasher -func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ValidatorRegistrationV1 object with a hasher +func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + // Field (0) 'FeeRecipient' + if size := len(v.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } - hh.PutBytes(d.PublicKey) + hh.PutBytes(v.FeeRecipient) - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(d.WithdrawalCredentials) + // Field (1) 'GasLimit' + hh.PutUint64(v.GasLimit) - // Field (2) 'Amount' - hh.PutUint64(d.Amount) + // Field (2) 'Timestamp' + hh.PutUint64(v.Timestamp) - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + // Field (3) 'Pubkey' + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } - hh.PutBytes(d.Signature) + hh.PutBytes(v.Pubkey) if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) @@ -9603,806 +10276,728 @@ func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the BeaconState object -func (b *BeaconState) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) +// MarshalSSZ ssz marshals the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) } -// MarshalSSZTo ssz marshals the BeaconState object to a target array -func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the SignedValidatorRegistrationV1 object to a target array +func (s *SignedValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(2687377) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(ValidatorRegistrationV1) } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { return } - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } + dst = append(dst, s.Signature...) - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) + return +} + +// UnmarshalSSZ ssz unmarshals the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 180 { + return ssz.ErrSize } - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(ValidatorRegistrationV1) } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) + if err = s.Message.UnmarshalSSZ(buf[0:84]); err != nil { + return err } - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[84:180])) } + s.Signature = append(s.Signature, buf[84:180]...) - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 + return err +} - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) +// SizeSSZ returns the ssz encoded size in bytes for the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) SizeSSZ() (size int) { + size = 180 + return +} - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 +// HashTreeRoot ssz hashes the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 +// HashTreeRootWith ssz hashes the SignedValidatorRegistrationV1 object with a hasher +func (s *SignedValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { return } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } + hh.PutBytes(s.Signature) - // Offset (15) 'PreviousEpochAttestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - offset += 4 - offset += b.PreviousEpochAttestations[ii].SizeSSZ() + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) } + return +} - // Offset (16) 'CurrentEpochAttestations' +// MarshalSSZ ssz marshals the BuilderBid object +func (b *BuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBid object to a target array +func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Offset (0) 'Header' dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - offset += 4 - offset += b.CurrentEpochAttestations[ii].SizeSSZ() + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) } + offset += b.Header.SizeSSZ() - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) return } - dst = append(dst, b.JustificationBits...) + dst = append(dst, b.Value...) - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } + dst = append(dst, b.Pubkey...) - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { return } - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } + return +} - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) +// UnmarshalSSZ ssz unmarshals the BuilderBid object +func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize } - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } + tail := buf + var o0 uint64 - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset } - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return + if o0 < 84 { + return ssz.ErrInvalidVariableOffset } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) + + // Field (1) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[4:36])) } + b.Value = append(b.Value, buf[4:36]...) - // Field (15) 'PreviousEpochAttestations' - if size := len(b.PreviousEpochAttestations); size > 4096 { - err = ssz.ErrListTooBigFn("--.PreviousEpochAttestations", size, 4096) - return + // Field (2) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[36:84])) } + b.Pubkey = append(b.Pubkey, buf[36:84]...) + + // Field (0) 'Header' { - offset = 4 * len(b.PreviousEpochAttestations) - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.PreviousEpochAttestations[ii].SizeSSZ() + buf = tail[o0:] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) } - } - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - if dst, err = b.PreviousEpochAttestations[ii].MarshalSSZTo(dst); err != nil { - return + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err } } + return err +} - // Field (16) 'CurrentEpochAttestations' - if size := len(b.CurrentEpochAttestations); size > 4096 { - err = ssz.ErrListTooBigFn("--.CurrentEpochAttestations", size, 4096) - return - } - { - offset = 4 * len(b.CurrentEpochAttestations) - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.CurrentEpochAttestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - if dst, err = b.CurrentEpochAttestations[ii].MarshalSSZTo(dst); err != nil { - return - } +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object +func (b *BuilderBid) SizeSSZ() (size int) { + size = 84 + + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) } + size += b.Header.SizeSSZ() return } -// UnmarshalSSZ ssz unmarshals the BeaconState object -func (b *BeaconState) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2687377 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16 uint64 +// HashTreeRoot ssz hashes the BuilderBid object +func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) +// HashTreeRootWith ssz hashes the BuilderBid object with a hasher +func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return } + hh.PutBytes(b.Value) - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err + hh.PutBytes(b.Pubkey) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) } + return +} - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } +// MarshalSSZ ssz marshals the BuilderBidCapella object +func (b *BuilderBidCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) +// MarshalSSZTo ssz marshals the BuilderBidCapella object to a target array +func (b *BuilderBidCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderCapella) } + offset += b.Header.SizeSSZ() - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return } + dst = append(dst, b.Value...) - if o7 < 2687377 { - return ssz.ErrInvalidVariableOffset + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return } + dst = append(dst, b.Pubkey...) - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err + + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBidCapella object +func (b *BuilderBidCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize } - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + tail := buf + var o0 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { return ssz.ErrOffset } - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + if o0 < 84 { + return ssz.ErrInvalidVariableOffset + } - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset + // Field (1) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[4:36])) } + b.Value = append(b.Value, buf[4:36]...) - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset + // Field (2) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[36:84])) } + b.Pubkey = append(b.Pubkey, buf[36:84]...) - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + // Field (0) 'Header' + { + buf = tail[o0:] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderCapella) + } + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) } + return err +} - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidCapella object +func (b *BuilderBidCapella) SizeSSZ() (size int) { + size = 84 - // Offset (15) 'PreviousEpochAttestations' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderCapella) } + size += b.Header.SizeSSZ() - // Offset (16) 'CurrentEpochAttestations' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset + return +} + +// HashTreeRoot ssz hashes the BuilderBidCapella object +func (b *BuilderBidCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BuilderBidCapella object with a hasher +func (b *BuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return } - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + hh.PutBytes(b.Value) - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err + hh.PutBytes(b.Pubkey) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) } + return +} - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) +// MarshalSSZ ssz marshals the BuilderBidDeneb object +func (b *BuilderBidDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBidDeneb object to a target array +func (b *BuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(88) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderDeneb) } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err + offset += b.Header.SizeSSZ() + + // Offset (1) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Field (2) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return } + dst = append(dst, b.Value...) - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) + // Field (3) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err + dst = append(dst, b.Pubkey...) + + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return } - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + // Field (1) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return } + dst = append(dst, b.BlobKzgCommitments[ii]...) } - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBidDeneb object +func (b *BuilderBidDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 88 { + return ssz.ErrSize } - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } + tail := buf + var o0, o1 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset } - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } + if o0 < 88 { + return ssz.ErrInvalidVariableOffset } - // Field (15) 'PreviousEpochAttestations' + // Offset (1) 'BlobKzgCommitments' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (2) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[8:40])) + } + b.Value = append(b.Value, buf[8:40]...) + + // Field (3) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[40:88])) + } + b.Pubkey = append(b.Pubkey, buf[40:88]...) + + // Field (0) 'Header' { - buf = tail[o15:o16] - num, err := ssz.DecodeDynamicLength(buf, 4096) - if err != nil { - return err + buf = tail[o0:o1] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderDeneb) } - b.PreviousEpochAttestations = make([]*PendingAttestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.PreviousEpochAttestations[indx] == nil { - b.PreviousEpochAttestations[indx] = new(PendingAttestation) - } - if err = b.PreviousEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { + if err = b.Header.UnmarshalSSZ(buf); err != nil { return err } } - // Field (16) 'CurrentEpochAttestations' + // Field (1) 'BlobKzgCommitments' { - buf = tail[o16:] - num, err := ssz.DecodeDynamicLength(buf, 4096) + buf = tail[o1:] + num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err } - b.CurrentEpochAttestations = make([]*PendingAttestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.CurrentEpochAttestations[indx] == nil { - b.CurrentEpochAttestations[indx] = new(PendingAttestation) - } - if err = b.CurrentEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { - return err + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) } - return nil - }) - if err != nil { - return err + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } return err } -// SizeSSZ returns the ssz encoded size in bytes for the BeaconState object -func (b *BeaconState) SizeSSZ() (size int) { - size = 2687377 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidDeneb object +func (b *BuilderBidDeneb) SizeSSZ() (size int) { + size = 88 - // Field (15) 'PreviousEpochAttestations' - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - size += 4 - size += b.PreviousEpochAttestations[ii].SizeSSZ() + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderDeneb) } + size += b.Header.SizeSSZ() - // Field (16) 'CurrentEpochAttestations' - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - size += 4 - size += b.CurrentEpochAttestations[ii].SizeSSZ() - } + // Field (1) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 return } -// HashTreeRoot ssz hashes the BeaconState object -func (b *BeaconState) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BuilderBidDeneb object +func (b *BuilderBidDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BeaconState object with a hasher -func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BuilderBidDeneb object with a hasher +func (b *BuilderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { return } - // Field (5) 'BlockRoots' + // Field (1) 'BlobKzgCommitments' { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) return } subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { err = ssz.ErrBytesLength return } - hh.Append(i) + hh.PutBytes(i) } + numItems := uint64(len(b.BlobKzgCommitments)) if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) } else { - hh.Merkleize(subIndx) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } } - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } + // Field (2) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + hh.PutBytes(b.Value) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } + // Field (3) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return } + hh.PutBytes(b.Pubkey) - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } +// MarshalSSZ ssz marshals the BlobSidecar object +func (b *BlobSidecar) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlobSidecar object to a target array +func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, b.Index) + + // Field (1) 'Blob' + if size := len(b.Blob); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) + return } + dst = append(dst, b.Blob...) - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + // Field (2) 'KzgCommitment' + if size := len(b.KzgCommitment); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) return } + dst = append(dst, b.KzgCommitment...) - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } + // Field (3) 'KzgProof' + if size := len(b.KzgProof); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) + return } + dst = append(dst, b.KzgProof...) - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) + // Field (4) 'SignedBlockHeader' + if b.SignedBlockHeader == nil { + b.SignedBlockHeader = new(SignedBeaconBlockHeader) + } + if dst, err = b.SignedBlockHeader.MarshalSSZTo(dst); err != nil { + return + } - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize + // Field (5) 'CommitmentInclusionProof' + if size := len(b.CommitmentInclusionProof); size != 17 { + err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) + return + } + for ii := 0; ii < 17; ii++ { + if size := len(b.CommitmentInclusionProof[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.CommitmentInclusionProof[ii]", size, 32) return } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } + dst = append(dst, b.CommitmentInclusionProof[ii]...) } - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() + return +} - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } +// UnmarshalSSZ ssz unmarshals the BlobSidecar object +func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 131928 { + return ssz.ErrSize } - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } + // Field (0) 'Index' + b.Index = ssz.UnmarshallUint64(buf[0:8]) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } + // Field (1) 'Blob' + if cap(b.Blob) == 0 { + b.Blob = make([]byte, 0, len(buf[8:131080])) } + b.Blob = append(b.Blob, buf[8:131080]...) - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } + // Field (2) 'KzgCommitment' + if cap(b.KzgCommitment) == 0 { + b.KzgCommitment = make([]byte, 0, len(buf[131080:131128])) + } + b.KzgCommitment = append(b.KzgCommitment, buf[131080:131128]...) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } + // Field (3) 'KzgProof' + if cap(b.KzgProof) == 0 { + b.KzgProof = make([]byte, 0, len(buf[131128:131176])) } + b.KzgProof = append(b.KzgProof, buf[131128:131176]...) - // Field (15) 'PreviousEpochAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.PreviousEpochAttestations)) - if num > 4096 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PreviousEpochAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4096) - } + // Field (4) 'SignedBlockHeader' + if b.SignedBlockHeader == nil { + b.SignedBlockHeader = new(SignedBeaconBlockHeader) + } + if err = b.SignedBlockHeader.UnmarshalSSZ(buf[131176:131384]); err != nil { + return err } - // Field (16) 'CurrentEpochAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.CurrentEpochAttestations)) - if num > 4096 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.CurrentEpochAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4096) + // Field (5) 'CommitmentInclusionProof' + b.CommitmentInclusionProof = make([][]byte, 17) + for ii := 0; ii < 17; ii++ { + if cap(b.CommitmentInclusionProof[ii]) == 0 { + b.CommitmentInclusionProof[ii] = make([]byte, 0, len(buf[131384:131928][ii*32:(ii+1)*32])) } + b.CommitmentInclusionProof[ii] = append(b.CommitmentInclusionProof[ii], buf[131384:131928][ii*32:(ii+1)*32]...) } - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecar object +func (b *BlobSidecar) SizeSSZ() (size int) { + size = 131928 + return +} + +// HashTreeRoot ssz hashes the BlobSidecar object +func (b *BlobSidecar) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlobSidecar object with a hasher +func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Index' + hh.PutUint64(b.Index) + + // Field (1) 'Blob' + if size := len(b.Blob); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) return } - hh.PutBytes(b.JustificationBits) + hh.PutBytes(b.Blob) - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + // Field (2) 'KzgCommitment' + if size := len(b.KzgCommitment); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) return } + hh.PutBytes(b.KzgCommitment) - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + // Field (3) 'KzgProof' + if size := len(b.KzgProof); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) return } + hh.PutBytes(b.KzgProof) - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + // Field (4) 'SignedBlockHeader' + if err = b.SignedBlockHeader.HashTreeRootWith(hh); err != nil { return } + // Field (5) 'CommitmentInclusionProof' + { + if size := len(b.CommitmentInclusionProof); size != 17 { + err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) + return + } + subIndx := hh.Index() + for _, i := range b.CommitmentInclusionProof { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) } else { @@ -10411,20 +11006,250 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the BeaconStateAltair object -func (b *BeaconStateAltair) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the BlobSidecars object +func (b *BlobSidecars) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the BeaconStateAltair object to a target array -func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BlobSidecars object to a target array +func (b *BlobSidecars) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(2736629) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) + offset := int(4) - // Field (1) 'GenesisValidatorsRoot' + // Offset (0) 'Sidecars' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Sidecars) * 131928 + + // Field (0) 'Sidecars' + if size := len(b.Sidecars); size > 6 { + err = ssz.ErrListTooBigFn("--.Sidecars", size, 6) + return + } + for ii := 0; ii < len(b.Sidecars); ii++ { + if dst, err = b.Sidecars[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlobSidecars object +func (b *BlobSidecars) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 4 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Sidecars' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 4 { + return ssz.ErrInvalidVariableOffset + } + + // Field (0) 'Sidecars' + { + buf = tail[o0:] + num, err := ssz.DivideInt2(len(buf), 131928, 6) + if err != nil { + return err + } + b.Sidecars = make([]*BlobSidecar, num) + for ii := 0; ii < num; ii++ { + if b.Sidecars[ii] == nil { + b.Sidecars[ii] = new(BlobSidecar) + } + if err = b.Sidecars[ii].UnmarshalSSZ(buf[ii*131928 : (ii+1)*131928]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecars object +func (b *BlobSidecars) SizeSSZ() (size int) { + size = 4 + + // Field (0) 'Sidecars' + size += len(b.Sidecars) * 131928 + + return +} + +// HashTreeRoot ssz hashes the BlobSidecars object +func (b *BlobSidecars) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlobSidecars object with a hasher +func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Sidecars' + { + subIndx := hh.Index() + num := uint64(len(b.Sidecars)) + if num > 6 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Sidecars { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6) + } else { + hh.MerkleizeWithMixin(subIndx, num, 6) + } + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the Deposit_Data object +func (d *Deposit_Data) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the Deposit_Data object to a target array +func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + dst = append(dst, d.PublicKey...) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + dst = append(dst, d.WithdrawalCredentials...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, d.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the Deposit_Data object +func (d *Deposit_Data) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 184 { + return ssz.ErrSize + } + + // Field (0) 'PublicKey' + if cap(d.PublicKey) == 0 { + d.PublicKey = make([]byte, 0, len(buf[0:48])) + } + d.PublicKey = append(d.PublicKey, buf[0:48]...) + + // Field (1) 'WithdrawalCredentials' + if cap(d.WithdrawalCredentials) == 0 { + d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + } + d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) + + // Field (2) 'Amount' + d.Amount = ssz.UnmarshallUint64(buf[80:88]) + + // Field (3) 'Signature' + if cap(d.Signature) == 0 { + d.Signature = make([]byte, 0, len(buf[88:184])) + } + d.Signature = append(d.Signature, buf[88:184]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Deposit_Data object +func (d *Deposit_Data) SizeSSZ() (size int) { + size = 184 + return +} + +// HashTreeRoot ssz hashes the Deposit_Data object +func (d *Deposit_Data) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the Deposit_Data object with a hasher +func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + hh.PutBytes(d.PublicKey) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + hh.PutBytes(d.WithdrawalCredentials) + + // Field (2) 'Amount' + hh.PutUint64(d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(d.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the BeaconState object +func (b *BeaconState) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconState object to a target array +func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2687377) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' if size := len(b.GenesisValidatorsRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return @@ -10525,13 +11350,19 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, b.Slashings[ii]) } - // Offset (15) 'PreviousEpochParticipation' + // Offset (15) 'PreviousEpochAttestations' dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + offset += 4 + offset += b.PreviousEpochAttestations[ii].SizeSSZ() + } - // Offset (16) 'CurrentEpochParticipation' + // Offset (16) 'CurrentEpochAttestations' dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + offset += 4 + offset += b.CurrentEpochAttestations[ii].SizeSSZ() + } // Field (17) 'JustificationBits' if size := len(b.JustificationBits); size != 1 { @@ -10564,26 +11395,6 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { return } - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - // Field (7) 'HistoricalRoots' if size := len(b.HistoricalRoots); size > 16777216 { err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) @@ -10628,42 +11439,55 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, b.Balances[ii]) } - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + // Field (15) 'PreviousEpochAttestations' + if size := len(b.PreviousEpochAttestations); size > 4096 { + err = ssz.ErrListTooBigFn("--.PreviousEpochAttestations", size, 4096) return } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return + { + offset = 4 * len(b.PreviousEpochAttestations) + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.PreviousEpochAttestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + if dst, err = b.PreviousEpochAttestations[ii].MarshalSSZTo(dst); err != nil { + return + } } - dst = append(dst, b.CurrentEpochParticipation...) - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + // Field (16) 'CurrentEpochAttestations' + if size := len(b.CurrentEpochAttestations); size > 4096 { + err = ssz.ErrListTooBigFn("--.CurrentEpochAttestations", size, 4096) return } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + { + offset = 4 * len(b.CurrentEpochAttestations) + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.CurrentEpochAttestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + if dst, err = b.CurrentEpochAttestations[ii].MarshalSSZTo(dst); err != nil { + return + } } return } -// UnmarshalSSZ ssz unmarshals the BeaconStateAltair object -func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconState object +func (b *BeaconState) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 2736629 { + if size < 2687377 { return ssz.ErrSize } tail := buf - var o7, o9, o11, o12, o15, o16, o21 uint64 + var o7, o9, o11, o12, o15, o16 uint64 // Field (0) 'GenesisTime' b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) @@ -10716,7 +11540,7 @@ func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o7 < 2736629 { + if o7 < 2687377 { return ssz.ErrInvalidVariableOffset } @@ -10761,12 +11585,12 @@ func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) } - // Offset (15) 'PreviousEpochParticipation' + // Offset (15) 'PreviousEpochAttestations' if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { return ssz.ErrOffset } - // Offset (16) 'CurrentEpochParticipation' + // Offset (16) 'CurrentEpochAttestations' if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { return ssz.ErrOffset } @@ -10801,27 +11625,6 @@ func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { return err } - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - // Field (7) 'HistoricalRoots' { buf = tail[o7:o9] @@ -10887,48 +11690,55 @@ func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { } } - // Field (15) 'PreviousEpochParticipation' + // Field (15) 'PreviousEpochAttestations' { buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength + num, err := ssz.DecodeDynamicLength(buf, 4096) + if err != nil { + return err } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + b.PreviousEpochAttestations = make([]*PendingAttestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.PreviousEpochAttestations[indx] == nil { + b.PreviousEpochAttestations[indx] = new(PendingAttestation) + } + if err = b.PreviousEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) } - // Field (21) 'InactivityScores' + // Field (16) 'CurrentEpochAttestations' { - buf = tail[o21:] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + buf = tail[o16:] + num, err := ssz.DecodeDynamicLength(buf, 4096) if err != nil { return err } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + b.CurrentEpochAttestations = make([]*PendingAttestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.CurrentEpochAttestations[indx] == nil { + b.CurrentEpochAttestations[indx] = new(PendingAttestation) + } + if err = b.CurrentEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err } } return err } -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateAltair object -func (b *BeaconStateAltair) SizeSSZ() (size int) { - size = 2736629 +// SizeSSZ returns the ssz encoded size in bytes for the BeaconState object +func (b *BeaconState) SizeSSZ() (size int) { + size = 2687377 // Field (7) 'HistoricalRoots' size += len(b.HistoricalRoots) * 32 @@ -10942,25 +11752,28 @@ func (b *BeaconStateAltair) SizeSSZ() (size int) { // Field (12) 'Balances' size += len(b.Balances) * 8 - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) + // Field (15) 'PreviousEpochAttestations' + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + size += 4 + size += b.PreviousEpochAttestations[ii].SizeSSZ() + } - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 + // Field (16) 'CurrentEpochAttestations' + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + size += 4 + size += b.CurrentEpochAttestations[ii].SizeSSZ() + } return } -// HashTreeRoot ssz hashes the BeaconStateAltair object -func (b *BeaconStateAltair) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BeaconState object +func (b *BeaconState) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BeaconStateAltair object with a hasher -func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconState object with a hasher +func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'GenesisTime' @@ -11161,35 +11974,43 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } } - // Field (15) 'PreviousEpochParticipation' + // Field (15) 'PreviousEpochAttestations' { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { + subIndx := hh.Index() + num := uint64(len(b.PreviousEpochAttestations)) + if num > 4096 { err = ssz.ErrIncorrectListSize return } - hh.PutBytes(b.PreviousEpochParticipation) + for _, elem := range b.PreviousEpochAttestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + hh.MerkleizeWithMixin(subIndx, num, 4096) } } - // Field (16) 'CurrentEpochParticipation' + // Field (16) 'CurrentEpochAttestations' { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { + subIndx := hh.Index() + num := uint64(len(b.CurrentEpochAttestations)) + if num > 4096 { err = ssz.ErrIncorrectListSize return } - hh.PutBytes(b.CurrentEpochParticipation) + for _, elem := range b.CurrentEpochAttestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + hh.MerkleizeWithMixin(subIndx, num, 4096) } } @@ -11215,36 +12036,6 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) } else { @@ -11253,719 +12044,2406 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the Fork object -func (f *Fork) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(f) +// MarshalSSZ ssz marshals the BeaconStateAltair object +func (b *BeaconStateAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the Fork object to a target array -func (f *Fork) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BeaconStateAltair object to a target array +func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf + offset := int(2736629) - // Field (0) 'PreviousVersion' - if size := len(f.PreviousVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) - return - } - dst = append(dst, f.PreviousVersion...) + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) - // Field (1) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } - dst = append(dst, f.CurrentVersion...) + dst = append(dst, b.GenesisValidatorsRoot...) - // Field (2) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(f.Epoch)) + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - return -} + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } -// UnmarshalSSZ ssz unmarshals the Fork object -func (f *Fork) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return } - // Field (0) 'PreviousVersion' - if cap(f.PreviousVersion) == 0 { - f.PreviousVersion = make([]byte, 0, len(buf[0:4])) + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) } - f.PreviousVersion = append(f.PreviousVersion, buf[0:4]...) - // Field (1) 'CurrentVersion' - if cap(f.CurrentVersion) == 0 { - f.CurrentVersion = make([]byte, 0, len(buf[4:8])) + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) } - f.CurrentVersion = append(f.CurrentVersion, buf[4:8]...) - // Field (2) 'Epoch' - f.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 - return err -} + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } -// SizeSSZ returns the ssz encoded size in bytes for the Fork object -func (f *Fork) SizeSSZ() (size int) { - size = 16 - return -} + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 -// HashTreeRoot ssz hashes the Fork object -func (f *Fork) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(f) -} + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) -// HashTreeRootWith ssz hashes the Fork object with a hasher -func (f *Fork) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 - // Field (0) 'PreviousVersion' - if size := len(f.PreviousVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } - hh.PutBytes(f.PreviousVersion) + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } - // Field (1) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } - hh.PutBytes(f.CurrentVersion) - - // Field (2) 'Epoch' - hh.PutUint64(uint64(f.Epoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) } - return -} - -// MarshalSSZ ssz marshals the PendingAttestation object -func (p *PendingAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} -// MarshalSSZTo ssz marshals the PendingAttestation object to a target array -func (p *PendingAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(148) + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) - // Offset (0) 'AggregationBits' + // Offset (16) 'CurrentEpochParticipation' dst = ssz.WriteOffset(dst, offset) - offset += len(p.AggregationBits) + offset += len(b.CurrentEpochParticipation) - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(AttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } + dst = append(dst, b.JustificationBits...) - // Field (2) 'InclusionDelay' - dst = ssz.MarshalUint64(dst, uint64(p.InclusionDelay)) - - // Field (3) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(p.ProposerIndex)) - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size > 2048 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { return } - dst = append(dst, p.AggregationBits...) - return -} + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } -// UnmarshalSSZ ssz unmarshals the PendingAttestation object -func (p *PendingAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 148 { - return ssz.ErrSize + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return } - tail := buf - var o0 uint64 + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) } - - if o0 < 148 { - return ssz.ErrInvalidVariableOffset + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return } - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(AttestationData) + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) } - if err = p.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return } - // Field (2) 'InclusionDelay' - p.InclusionDelay = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[132:140])) - - // Field (3) 'ProposerIndex' - p.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[140:148])) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 2048); err != nil { - return err - } - if cap(p.AggregationBits) == 0 { - p.AggregationBits = make([]byte, 0, len(buf)) + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return } - p.AggregationBits = append(p.AggregationBits, buf...) + dst = append(dst, b.HistoricalRoots[ii]...) } - return err -} -// SizeSSZ returns the ssz encoded size in bytes for the PendingAttestation object -func (p *PendingAttestation) SizeSSZ() (size int) { - size = 148 - - // Field (0) 'AggregationBits' - size += len(p.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the PendingAttestation object -func (p *PendingAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingAttestation object with a hasher -func (p *PendingAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(p.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) return } - hh.PutBitlist(p.AggregationBits, 2048) + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) return } - - // Field (2) 'InclusionDelay' - hh.PutUint64(uint64(p.InclusionDelay)) - - // Field (3) 'ProposerIndex' - hh.PutUint64(uint64(p.ProposerIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } } - return -} - -// MarshalSSZ ssz marshals the HistoricalBatch object -func (h *HistoricalBatch) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(h) -} -// MarshalSSZTo ssz marshals the HistoricalBatch object to a target array -func (h *HistoricalBatch) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } - // Field (0) 'BlockRoots' - if size := len(h.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) return } - for ii := 0; ii < 8192; ii++ { - if size := len(h.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, h.BlockRoots[ii]...) + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return } + dst = append(dst, b.CurrentEpochParticipation...) - // Field (1) 'StateRoots' - if size := len(h.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) return } - for ii := 0; ii < 8192; ii++ { - if size := len(h.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, h.StateRoots[ii]...) + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) } return } -// UnmarshalSSZ ssz unmarshals the HistoricalBatch object -func (h *HistoricalBatch) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconStateAltair object +func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size != 524288 { + if size < 2736629 { return ssz.ErrSize } - // Field (0) 'BlockRoots' - h.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(h.BlockRoots[ii]) == 0 { - h.BlockRoots[ii] = make([]byte, 0, len(buf[0:262144][ii*32:(ii+1)*32])) - } - h.BlockRoots[ii] = append(h.BlockRoots[ii], buf[0:262144][ii*32:(ii+1)*32]...) - } + tail := buf + var o7, o9, o11, o12, o15, o16, o21 uint64 - // Field (1) 'StateRoots' - h.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(h.StateRoots[ii]) == 0 { - h.StateRoots[ii] = make([]byte, 0, len(buf[262144:524288][ii*32:(ii+1)*32])) - } - h.StateRoots[ii] = append(h.StateRoots[ii], buf[262144:524288][ii*32:(ii+1)*32]...) - } + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - return err -} + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) -// SizeSSZ returns the ssz encoded size in bytes for the HistoricalBatch object -func (h *HistoricalBatch) SizeSSZ() (size int) { - size = 524288 - return -} + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) -// HashTreeRoot ssz hashes the HistoricalBatch object -func (h *HistoricalBatch) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(h) -} + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } -// HashTreeRootWith ssz hashes the HistoricalBatch object with a hasher -func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } - // Field (0) 'BlockRoots' - { - if size := len(h.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range h.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) } - // Field (1) 'StateRoots' - { - if size := len(h.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range h.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } + if o7 < 2736629 { + return ssz.ErrInvalidVariableOffset } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err } - return -} -// MarshalSSZ ssz marshals the SigningData object -func (s *SigningData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } -// MarshalSSZTo ssz marshals the SigningData object to a target array -func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - // Field (0) 'ObjectRoot' - if size := len(s.ObjectRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) - return + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset } - dst = append(dst, s.ObjectRoot...) - // Field (1) 'Domain' - if size := len(s.Domain); size != 32 { - err = ssz.ErrBytesLengthFn("--.Domain", size, 32) - return + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset } - dst = append(dst, s.Domain...) - return -} - -// UnmarshalSSZ ssz unmarshals the SigningData object -func (s *SigningData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 64 { - return ssz.ErrSize + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) } - // Field (0) 'ObjectRoot' - if cap(s.ObjectRoot) == 0 { - s.ObjectRoot = make([]byte, 0, len(buf[0:32])) + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) } - s.ObjectRoot = append(s.ObjectRoot, buf[0:32]...) - // Field (1) 'Domain' - if cap(s.Domain) == 0 { - s.Domain = make([]byte, 0, len(buf[32:64])) + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset } - s.Domain = append(s.Domain, buf[32:64]...) - - return err -} -// SizeSSZ returns the ssz encoded size in bytes for the SigningData object -func (s *SigningData) SizeSSZ() (size int) { - size = 64 - return -} + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } -// HashTreeRoot ssz hashes the SigningData object -func (s *SigningData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) -// HashTreeRootWith ssz hashes the SigningData object with a hasher -func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } - // Field (0) 'ObjectRoot' - if size := len(s.ObjectRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) - return + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err } - hh.PutBytes(s.ObjectRoot) - // Field (1) 'Domain' - if size := len(s.Domain); size != 32 { - err = ssz.ErrBytesLengthFn("--.Domain", size, 32) - return + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err } - hh.PutBytes(s.Domain) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset } - return -} -// MarshalSSZ ssz marshals the ForkData object -func (f *ForkData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(f) -} + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } -// MarshalSSZTo ssz marshals the ForkData object to a target array -func (f *ForkData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } - // Field (0) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } } - dst = append(dst, f.CurrentVersion...) - // Field (1) 'GenesisValidatorsRoot' - if size := len(f.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } } - dst = append(dst, f.GenesisValidatorsRoot...) - return -} + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } -// UnmarshalSSZ ssz unmarshals the ForkData object -func (f *ForkData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 36 { - return ssz.ErrSize + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } } - // Field (0) 'CurrentVersion' - if cap(f.CurrentVersion) == 0 { - f.CurrentVersion = make([]byte, 0, len(buf[0:4])) + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) } - f.CurrentVersion = append(f.CurrentVersion, buf[0:4]...) - // Field (1) 'GenesisValidatorsRoot' - if cap(f.GenesisValidatorsRoot) == 0 { - f.GenesisValidatorsRoot = make([]byte, 0, len(buf[4:36])) + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) } - f.GenesisValidatorsRoot = append(f.GenesisValidatorsRoot, buf[4:36]...) + // Field (21) 'InactivityScores' + { + buf = tail[o21:] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } return err } -// SizeSSZ returns the ssz encoded size in bytes for the ForkData object -func (f *ForkData) SizeSSZ() (size int) { - size = 36 - return -} - -// HashTreeRoot ssz hashes the ForkData object -func (f *ForkData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(f) -} +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateAltair object +func (b *BeaconStateAltair) SizeSSZ() (size int) { + size = 2736629 -// HashTreeRootWith ssz hashes the ForkData object with a hasher -func (f *ForkData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 - // Field (0) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - hh.PutBytes(f.CurrentVersion) + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + return +} + +// HashTreeRoot ssz hashes the BeaconStateAltair object +func (b *BeaconStateAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateAltair object with a hasher +func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if size := len(f.GenesisValidatorsRoot); size != 32 { + if size := len(b.GenesisValidatorsRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } - hh.PutBytes(f.GenesisValidatorsRoot) + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) + } else { + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the Fork object +func (f *Fork) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(f) +} + +// MarshalSSZTo ssz marshals the Fork object to a target array +func (f *Fork) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PreviousVersion' + if size := len(f.PreviousVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) + return + } + dst = append(dst, f.PreviousVersion...) + + // Field (1) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + dst = append(dst, f.CurrentVersion...) + + // Field (2) 'Epoch' + dst = ssz.MarshalUint64(dst, uint64(f.Epoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the Fork object +func (f *Fork) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'PreviousVersion' + if cap(f.PreviousVersion) == 0 { + f.PreviousVersion = make([]byte, 0, len(buf[0:4])) + } + f.PreviousVersion = append(f.PreviousVersion, buf[0:4]...) + + // Field (1) 'CurrentVersion' + if cap(f.CurrentVersion) == 0 { + f.CurrentVersion = make([]byte, 0, len(buf[4:8])) + } + f.CurrentVersion = append(f.CurrentVersion, buf[4:8]...) + + // Field (2) 'Epoch' + f.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Fork object +func (f *Fork) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the Fork object +func (f *Fork) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(f) +} + +// HashTreeRootWith ssz hashes the Fork object with a hasher +func (f *Fork) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PreviousVersion' + if size := len(f.PreviousVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) + return + } + hh.PutBytes(f.PreviousVersion) + + // Field (1) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + hh.PutBytes(f.CurrentVersion) + + // Field (2) 'Epoch' + hh.PutUint64(uint64(f.Epoch)) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the PendingAttestation object +func (p *PendingAttestation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingAttestation object to a target array +func (p *PendingAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(148) + + // Offset (0) 'AggregationBits' + dst = ssz.WriteOffset(dst, offset) + offset += len(p.AggregationBits) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(AttestationData) + } + if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'InclusionDelay' + dst = ssz.MarshalUint64(dst, uint64(p.InclusionDelay)) + + // Field (3) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(p.ProposerIndex)) + + // Field (0) 'AggregationBits' + if size := len(p.AggregationBits); size > 2048 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) + return + } + dst = append(dst, p.AggregationBits...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingAttestation object +func (p *PendingAttestation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 148 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AggregationBits' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 148 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(AttestationData) + } + if err = p.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'InclusionDelay' + p.InclusionDelay = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[132:140])) + + // Field (3) 'ProposerIndex' + p.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[140:148])) + + // Field (0) 'AggregationBits' + { + buf = tail[o0:] + if err = ssz.ValidateBitlist(buf, 2048); err != nil { + return err + } + if cap(p.AggregationBits) == 0 { + p.AggregationBits = make([]byte, 0, len(buf)) + } + p.AggregationBits = append(p.AggregationBits, buf...) + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingAttestation object +func (p *PendingAttestation) SizeSSZ() (size int) { + size = 148 + + // Field (0) 'AggregationBits' + size += len(p.AggregationBits) + + return +} + +// HashTreeRoot ssz hashes the PendingAttestation object +func (p *PendingAttestation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingAttestation object with a hasher +func (p *PendingAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if len(p.AggregationBits) == 0 { + err = ssz.ErrEmptyBitlist + return + } + hh.PutBitlist(p.AggregationBits, 2048) + + // Field (1) 'Data' + if err = p.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'InclusionDelay' + hh.PutUint64(uint64(p.InclusionDelay)) + + // Field (3) 'ProposerIndex' + hh.PutUint64(uint64(p.ProposerIndex)) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the HistoricalBatch object +func (h *HistoricalBatch) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(h) +} + +// MarshalSSZTo ssz marshals the HistoricalBatch object to a target array +func (h *HistoricalBatch) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockRoots' + if size := len(h.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(h.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, h.BlockRoots[ii]...) + } + + // Field (1) 'StateRoots' + if size := len(h.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(h.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, h.StateRoots[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the HistoricalBatch object +func (h *HistoricalBatch) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 524288 { + return ssz.ErrSize + } + + // Field (0) 'BlockRoots' + h.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(h.BlockRoots[ii]) == 0 { + h.BlockRoots[ii] = make([]byte, 0, len(buf[0:262144][ii*32:(ii+1)*32])) + } + h.BlockRoots[ii] = append(h.BlockRoots[ii], buf[0:262144][ii*32:(ii+1)*32]...) + } + + // Field (1) 'StateRoots' + h.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(h.StateRoots[ii]) == 0 { + h.StateRoots[ii] = make([]byte, 0, len(buf[262144:524288][ii*32:(ii+1)*32])) + } + h.StateRoots[ii] = append(h.StateRoots[ii], buf[262144:524288][ii*32:(ii+1)*32]...) + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the HistoricalBatch object +func (h *HistoricalBatch) SizeSSZ() (size int) { + size = 524288 + return +} + +// HashTreeRoot ssz hashes the HistoricalBatch object +func (h *HistoricalBatch) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(h) +} + +// HashTreeRootWith ssz hashes the HistoricalBatch object with a hasher +func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BlockRoots' + { + if size := len(h.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range h.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + // Field (1) 'StateRoots' + { + if size := len(h.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range h.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the SigningData object +func (s *SigningData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SigningData object to a target array +func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ObjectRoot' + if size := len(s.ObjectRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) + return + } + dst = append(dst, s.ObjectRoot...) + + // Field (1) 'Domain' + if size := len(s.Domain); size != 32 { + err = ssz.ErrBytesLengthFn("--.Domain", size, 32) + return + } + dst = append(dst, s.Domain...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SigningData object +func (s *SigningData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 64 { + return ssz.ErrSize + } + + // Field (0) 'ObjectRoot' + if cap(s.ObjectRoot) == 0 { + s.ObjectRoot = make([]byte, 0, len(buf[0:32])) + } + s.ObjectRoot = append(s.ObjectRoot, buf[0:32]...) + + // Field (1) 'Domain' + if cap(s.Domain) == 0 { + s.Domain = make([]byte, 0, len(buf[32:64])) + } + s.Domain = append(s.Domain, buf[32:64]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SigningData object +func (s *SigningData) SizeSSZ() (size int) { + size = 64 + return +} + +// HashTreeRoot ssz hashes the SigningData object +func (s *SigningData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SigningData object with a hasher +func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ObjectRoot' + if size := len(s.ObjectRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) + return + } + hh.PutBytes(s.ObjectRoot) + + // Field (1) 'Domain' + if size := len(s.Domain); size != 32 { + err = ssz.ErrBytesLengthFn("--.Domain", size, 32) + return + } + hh.PutBytes(s.Domain) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the ForkData object +func (f *ForkData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(f) +} + +// MarshalSSZTo ssz marshals the ForkData object to a target array +func (f *ForkData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + dst = append(dst, f.CurrentVersion...) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(f.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, f.GenesisValidatorsRoot...) + + return +} + +// UnmarshalSSZ ssz unmarshals the ForkData object +func (f *ForkData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 36 { + return ssz.ErrSize + } + + // Field (0) 'CurrentVersion' + if cap(f.CurrentVersion) == 0 { + f.CurrentVersion = make([]byte, 0, len(buf[0:4])) + } + f.CurrentVersion = append(f.CurrentVersion, buf[0:4]...) + + // Field (1) 'GenesisValidatorsRoot' + if cap(f.GenesisValidatorsRoot) == 0 { + f.GenesisValidatorsRoot = make([]byte, 0, len(buf[4:36])) + } + f.GenesisValidatorsRoot = append(f.GenesisValidatorsRoot, buf[4:36]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ForkData object +func (f *ForkData) SizeSSZ() (size int) { + size = 36 + return +} + +// HashTreeRoot ssz hashes the ForkData object +func (f *ForkData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(f) +} + +// HashTreeRootWith ssz hashes the ForkData object with a hasher +func (f *ForkData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + hh.PutBytes(f.CurrentVersion) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(f.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(f.GenesisValidatorsRoot) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the DepositMessage object +func (d *DepositMessage) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DepositMessage object to a target array +func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + dst = append(dst, d.PublicKey...) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + dst = append(dst, d.WithdrawalCredentials...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, d.Amount) + + return +} + +// UnmarshalSSZ ssz unmarshals the DepositMessage object +func (d *DepositMessage) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 88 { + return ssz.ErrSize + } + + // Field (0) 'PublicKey' + if cap(d.PublicKey) == 0 { + d.PublicKey = make([]byte, 0, len(buf[0:48])) + } + d.PublicKey = append(d.PublicKey, buf[0:48]...) + + // Field (1) 'WithdrawalCredentials' + if cap(d.WithdrawalCredentials) == 0 { + d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + } + d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) + + // Field (2) 'Amount' + d.Amount = ssz.UnmarshallUint64(buf[80:88]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DepositMessage object +func (d *DepositMessage) SizeSSZ() (size int) { + size = 88 + return +} + +// HashTreeRoot ssz hashes the DepositMessage object +func (d *DepositMessage) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DepositMessage object with a hasher +func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + hh.PutBytes(d.PublicKey) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + hh.PutBytes(d.WithdrawalCredentials) + + // Field (2) 'Amount' + hh.PutUint64(d.Amount) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the SyncCommittee object +func (s *SyncCommittee) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncCommittee object to a target array +func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Pubkeys' + if size := len(s.Pubkeys); size != 512 { + err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) + return + } + for ii := 0; ii < 512; ii++ { + if size := len(s.Pubkeys[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48) + return + } + dst = append(dst, s.Pubkeys[ii]...) + } + + // Field (1) 'AggregatePubkey' + if size := len(s.AggregatePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) + return + } + dst = append(dst, s.AggregatePubkey...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncCommittee object +func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24624 { + return ssz.ErrSize + } + + // Field (0) 'Pubkeys' + s.Pubkeys = make([][]byte, 512) + for ii := 0; ii < 512; ii++ { + if cap(s.Pubkeys[ii]) == 0 { + s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48])) + } + s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...) + } + + // Field (1) 'AggregatePubkey' + if cap(s.AggregatePubkey) == 0 { + s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624])) + } + s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object +func (s *SyncCommittee) SizeSSZ() (size int) { + size = 24624 + return +} + +// HashTreeRoot ssz hashes the SyncCommittee object +func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncCommittee object with a hasher +func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Pubkeys' + { + if size := len(s.Pubkeys); size != 512 { + err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) + return + } + subIndx := hh.Index() + for _, i := range s.Pubkeys { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } + + // Field (1) 'AggregatePubkey' + if size := len(s.AggregatePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) + return + } + hh.PutBytes(s.AggregatePubkey) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncAggregatorSelectionData object to a target array +func (s *SyncAggregatorSelectionData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(s.Slot)) + + // Field (1) 'SubcommitteeIndex' + dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'Slot' + s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'SubcommitteeIndex' + s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[8:16]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncAggregatorSelectionData object with a hasher +func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(s.Slot)) + + // Field (1) 'SubcommitteeIndex' + hh.PutUint64(s.SubcommitteeIndex) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateBellatrix object to a target array +func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736633) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (24) 'LatestExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + offset += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + // Field (24) 'LatestExecutionPayloadHeader' + if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736633 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21, o24 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 < 2736633 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Offset (24) 'LatestExecutionPayloadHeader' + if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + return ssz.ErrOffset + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:o24] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + // Field (24) 'LatestExecutionPayloadHeader' + { + buf = tail[o24:] + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } } - return + return err } -// MarshalSSZ ssz marshals the DepositMessage object -func (d *DepositMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) SizeSSZ() (size int) { + size = 2736633 -// MarshalSSZTo ssz marshals the DepositMessage object to a target array -func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, d.PublicKey...) + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) + // Field (11) 'Validators' + size += len(b.Validators) * 121 - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) + // Field (12) 'Balances' + size += len(b.Balances) * 8 - return -} + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) -// UnmarshalSSZ ssz unmarshals the DepositMessage object -func (d *DepositMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 88 { - return ssz.ErrSize - } + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) - // Field (0) 'PublicKey' - if cap(d.PublicKey) == 0 { - d.PublicKey = make([]byte, 0, len(buf[0:48])) - } - d.PublicKey = append(d.PublicKey, buf[0:48]...) + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) - - return err -} + size += b.LatestExecutionPayloadHeader.SizeSSZ() -// SizeSSZ returns the ssz encoded size in bytes for the DepositMessage object -func (d *DepositMessage) SizeSSZ() (size int) { - size = 88 return } -// HashTreeRoot ssz hashes the DepositMessage object -func (d *DepositMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) +// HashTreeRoot ssz hashes the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the DepositMessage object with a hasher -func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconStateBellatrix object with a hasher +func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } - hh.PutBytes(d.PublicKey) + hh.PutBytes(b.GenesisValidatorsRoot) - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { return } - hh.PutBytes(d.WithdrawalCredentials) - // Field (2) 'Amount' - hh.PutUint64(d.Amount) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return } - return -} -// MarshalSSZ ssz marshals the SyncCommittee object -func (s *SyncCommittee) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } -// MarshalSSZTo ssz marshals the SyncCommittee object to a target array -func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } + } - // Field (0) 'Pubkeys' - if size := len(s.Pubkeys); size != 512 { - err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) - return + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } } - for ii := 0; ii < 512; ii++ { - if size := len(s.Pubkeys[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48) + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } - dst = append(dst, s.Pubkeys[ii]...) + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } } - // Field (1) 'AggregatePubkey' - if size := len(s.AggregatePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } - dst = append(dst, s.AggregatePubkey...) - return -} + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) + } else { + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + } -// UnmarshalSSZ ssz unmarshals the SyncCommittee object -func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24624 { - return ssz.ErrSize + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } } - // Field (0) 'Pubkeys' - s.Pubkeys = make([][]byte, 512) - for ii := 0; ii < 512; ii++ { - if cap(s.Pubkeys[ii]) == 0 { - s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48])) + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return } - s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...) - } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() - // Field (1) 'AggregatePubkey' - if cap(s.AggregatePubkey) == 0 { - s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624])) + numItems := uint64(len(b.Balances)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } } - s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object -func (s *SyncCommittee) SizeSSZ() (size int) { - size = 24624 - return -} - -// HashTreeRoot ssz hashes the SyncCommittee object -func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncCommittee object with a hasher -func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - // Field (0) 'Pubkeys' + // Field (13) 'RandaoMixes' { - if size := len(s.Pubkeys); size != 512 { - err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } subIndx := hh.Index() - for _, i := range s.Pubkeys { - if len(i) != 48 { + for _, i := range b.RandaoMixes { + if len(i) != 32 { err = ssz.ErrBytesLength return } - hh.PutBytes(i) + hh.Append(i) } if ssz.EnableVectorizedHTR { @@ -11975,76 +14453,112 @@ func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { } } - // Field (1) 'AggregatePubkey' - if size := len(s.AggregatePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) - return - } - hh.PutBytes(s.AggregatePubkey) + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(subIndx) + } else { + hh.Merkleize(subIndx) + } } - return -} - -// MarshalSSZ ssz marshals the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncAggregatorSelectionData object to a target array -func (s *SyncAggregatorSelectionData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - // Field (1) 'SubcommitteeIndex' - dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + } - return -} + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) + } else { + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + } -// UnmarshalSSZ ssz unmarshals the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return } + hh.PutBytes(b.JustificationBits) - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } - // Field (1) 'SubcommitteeIndex' - s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[8:16]) + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } - return err -} + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } -// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) SizeSSZ() (size int) { - size = 16 - return -} + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() -// HashTreeRoot ssz hashes the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} + numItems := uint64(len(b.InactivityScores)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + } -// HashTreeRootWith ssz hashes the SyncAggregatorSelectionData object with a hasher -func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } - // Field (1) 'SubcommitteeIndex' - hh.PutUint64(s.SubcommitteeIndex) + // Field (24) 'LatestExecutionPayloadHeader' + if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) @@ -12054,15 +14568,15 @@ func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err erro return } -// MarshalSSZ ssz marshals the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the BeaconStateCapella object +func (b *BeaconStateCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the BeaconStateBellatrix object to a target array -func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BeaconStateCapella object to a target array +func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(2736633) + offset := int(2736653) // Field (0) 'GenesisTime' dst = ssz.MarshalUint64(dst, b.GenesisTime) @@ -12230,10 +14744,20 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) // Offset (24) 'LatestExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) } offset += b.LatestExecutionPayloadHeader.SizeSSZ() + // Field (25) 'NextWithdrawalIndex' + dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) + + // Offset (27) 'HistoricalSummaries' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalSummaries) * 64 + // Field (7) 'HistoricalRoots' if size := len(b.HistoricalRoots); size > 16777216 { err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) @@ -12306,19 +14830,30 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) return } + // Field (27) 'HistoricalSummaries' + if size := len(b.HistoricalSummaries); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalSummaries); ii++ { + if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { + return + } + } + return } -// UnmarshalSSZ ssz unmarshals the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconStateCapella object +func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 2736633 { + if size < 2736653 { return ssz.ErrSize } tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24 uint64 + var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 // Field (0) 'GenesisTime' b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) @@ -12371,7 +14906,7 @@ func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o7 < 2736633 { + if o7 < 2736653 { return ssz.ErrInvalidVariableOffset } @@ -12477,8 +15012,19 @@ func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { return err } - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + // Offset (24) 'LatestExecutionPayloadHeader' + if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + return ssz.ErrOffset + } + + // Field (25) 'NextWithdrawalIndex' + b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) + + // Field (26) 'NextWithdrawalValidatorIndex' + b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) + + // Offset (27) 'HistoricalSummaries' + if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { return ssz.ErrOffset } @@ -12586,20 +15132,38 @@ func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { // Field (24) 'LatestExecutionPayloadHeader' { - buf = tail[o24:] + buf = tail[o24:o27] if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) } if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err } } + + // Field (27) 'HistoricalSummaries' + { + buf = tail[o27:] + num, err := ssz.DivideInt2(len(buf), 64, 16777216) + if err != nil { + return err + } + b.HistoricalSummaries = make([]*HistoricalSummary, num) + for ii := 0; ii < num; ii++ { + if b.HistoricalSummaries[ii] == nil { + b.HistoricalSummaries[ii] = new(HistoricalSummary) + } + if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { + return err + } + } + } return err } -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) SizeSSZ() (size int) { - size = 2736633 +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateCapella object +func (b *BeaconStateCapella) SizeSSZ() (size int) { + size = 2736653 // Field (7) 'HistoricalRoots' size += len(b.HistoricalRoots) * 32 @@ -12624,20 +15188,23 @@ func (b *BeaconStateBellatrix) SizeSSZ() (size int) { // Field (24) 'LatestExecutionPayloadHeader' if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) } size += b.LatestExecutionPayloadHeader.SizeSSZ() + // Field (27) 'HistoricalSummaries' + size += len(b.HistoricalSummaries) * 64 + return } -// HashTreeRoot ssz hashes the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BeaconStateCapella object +func (b *BeaconStateCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BeaconStateBellatrix object with a hasher -func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconStateCapella object with a hasher +func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'GenesisTime' @@ -12927,6 +15494,32 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } + // Field (25) 'NextWithdrawalIndex' + hh.PutUint64(b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) + + // Field (27) 'HistoricalSummaries' + { + subIndx := hh.Index() + num := uint64(len(b.HistoricalSummaries)) + if num > 16777216 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.HistoricalSummaries { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16777216) + } + } + if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) } else { @@ -12935,13 +15528,13 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the BeaconStateCapella object -func (b *BeaconStateCapella) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the BeaconStateDeneb object +func (b *BeaconStateDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the BeaconStateCapella object to a target array -func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BeaconStateDeneb object to a target array +func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(2736653) @@ -13111,7 +15704,7 @@ func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { // Offset (24) 'LatestExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } offset += b.LatestExecutionPayloadHeader.SizeSSZ() @@ -13211,8 +15804,8 @@ func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { return } -// UnmarshalSSZ ssz unmarshals the BeaconStateCapella object -func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconStateDeneb object +func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 2736653 { @@ -13501,7 +16094,7 @@ func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { { buf = tail[o24:o27] if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err @@ -13528,8 +16121,8 @@ func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { return err } -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateCapella object -func (b *BeaconStateCapella) SizeSSZ() (size int) { +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateDeneb object +func (b *BeaconStateDeneb) SizeSSZ() (size int) { size = 2736653 // Field (7) 'HistoricalRoots' @@ -13555,7 +16148,7 @@ func (b *BeaconStateCapella) SizeSSZ() (size int) { // Field (24) 'LatestExecutionPayloadHeader' if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } size += b.LatestExecutionPayloadHeader.SizeSSZ() @@ -13565,13 +16158,13 @@ func (b *BeaconStateCapella) SizeSSZ() (size int) { return } -// HashTreeRoot ssz hashes the BeaconStateCapella object -func (b *BeaconStateCapella) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BeaconStateDeneb object +func (b *BeaconStateDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BeaconStateCapella object with a hasher -func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconStateDeneb object with a hasher +func (b *BeaconStateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'GenesisTime' @@ -13895,15 +16488,15 @@ func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the BeaconStateDeneb object -func (b *BeaconStateDeneb) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the BeaconStateElectra object +func (b *BeaconStateElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the BeaconStateDeneb object to a target array -func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BeaconStateElectra object to a target array +func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(2736653) + offset := int(2736713) // Field (0) 'GenesisTime' dst = ssz.MarshalUint64(dst, b.GenesisTime) @@ -14071,7 +16664,7 @@ func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { // Offset (24) 'LatestExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) } offset += b.LatestExecutionPayloadHeader.SizeSSZ() @@ -14085,6 +16678,36 @@ func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.WriteOffset(dst, offset) offset += len(b.HistoricalSummaries) * 64 + // Field (28) 'DepositReceiptsStartIndex' + dst = ssz.MarshalUint64(dst, b.DepositReceiptsStartIndex) + + // Field (29) 'DepositBalanceToConsume' + dst = ssz.MarshalUint64(dst, b.DepositBalanceToConsume) + + // Field (30) 'ExitBalanceToConsume' + dst = ssz.MarshalUint64(dst, b.ExitBalanceToConsume) + + // Field (31) 'EarliestExitEpoch' + dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) + + // Field (32) 'ConsolidationBalanceToConsume' + dst = ssz.MarshalUint64(dst, b.ConsolidationBalanceToConsume) + + // Field (33) 'EarliestConsolidationEpoch' + dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) + + // Offset (34) 'PendingBalanceDeposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingBalanceDeposits) * 16 + + // Offset (35) 'PendingPartialWithdrawals' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingPartialWithdrawals) * 24 + + // Offset (36) 'PendingConsolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingConsolidations) * 16 + // Field (7) 'HistoricalRoots' if size := len(b.HistoricalRoots); size > 16777216 { err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) @@ -14168,19 +16791,52 @@ func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { } } + // Field (34) 'PendingBalanceDeposits' + if size := len(b.PendingBalanceDeposits); size > 134217728 { + err = ssz.ErrListTooBigFn("--.PendingBalanceDeposits", size, 134217728) + return + } + for ii := 0; ii < len(b.PendingBalanceDeposits); ii++ { + if dst, err = b.PendingBalanceDeposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (35) 'PendingPartialWithdrawals' + if size := len(b.PendingPartialWithdrawals); size > 134217728 { + err = ssz.ErrListTooBigFn("--.PendingPartialWithdrawals", size, 134217728) + return + } + for ii := 0; ii < len(b.PendingPartialWithdrawals); ii++ { + if dst, err = b.PendingPartialWithdrawals[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (36) 'PendingConsolidations' + if size := len(b.PendingConsolidations); size > 262144 { + err = ssz.ErrListTooBigFn("--.PendingConsolidations", size, 262144) + return + } + for ii := 0; ii < len(b.PendingConsolidations); ii++ { + if dst, err = b.PendingConsolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + return } -// UnmarshalSSZ ssz unmarshals the BeaconStateDeneb object -func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BeaconStateElectra object +func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 2736653 { + if size < 2736713 { return ssz.ErrSize } tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 + var o7, o9, o11, o12, o15, o16, o21, o24, o27, o34, o35, o36 uint64 // Field (0) 'GenesisTime' b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) @@ -14233,7 +16889,7 @@ func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o7 < 2736653 { + if o7 < 2736713 { return ssz.ErrInvalidVariableOffset } @@ -14355,6 +17011,39 @@ func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } + // Field (28) 'DepositReceiptsStartIndex' + b.DepositReceiptsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) + + // Field (29) 'DepositBalanceToConsume' + b.DepositBalanceToConsume = ssz.UnmarshallUint64(buf[2736661:2736669]) + + // Field (30) 'ExitBalanceToConsume' + b.ExitBalanceToConsume = ssz.UnmarshallUint64(buf[2736669:2736677]) + + // Field (31) 'EarliestExitEpoch' + b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736677:2736685])) + + // Field (32) 'ConsolidationBalanceToConsume' + b.ConsolidationBalanceToConsume = ssz.UnmarshallUint64(buf[2736685:2736693]) + + // Field (33) 'EarliestConsolidationEpoch' + b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736693:2736701])) + + // Offset (34) 'PendingBalanceDeposits' + if o34 = ssz.ReadOffset(buf[2736701:2736705]); o34 > size || o27 > o34 { + return ssz.ErrOffset + } + + // Offset (35) 'PendingPartialWithdrawals' + if o35 = ssz.ReadOffset(buf[2736705:2736709]); o35 > size || o34 > o35 { + return ssz.ErrOffset + } + + // Offset (36) 'PendingConsolidations' + if o36 = ssz.ReadOffset(buf[2736709:2736713]); o36 > size || o35 > o36 { + return ssz.ErrOffset + } + // Field (7) 'HistoricalRoots' { buf = tail[o7:o9] @@ -14461,7 +17150,7 @@ func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { { buf = tail[o24:o27] if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) } if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err @@ -14470,7 +17159,7 @@ func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { // Field (27) 'HistoricalSummaries' { - buf = tail[o27:] + buf = tail[o27:o34] num, err := ssz.DivideInt2(len(buf), 64, 16777216) if err != nil { return err @@ -14485,12 +17174,66 @@ func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { } } } + + // Field (34) 'PendingBalanceDeposits' + { + buf = tail[o34:o35] + num, err := ssz.DivideInt2(len(buf), 16, 134217728) + if err != nil { + return err + } + b.PendingBalanceDeposits = make([]*PendingBalanceDeposit, num) + for ii := 0; ii < num; ii++ { + if b.PendingBalanceDeposits[ii] == nil { + b.PendingBalanceDeposits[ii] = new(PendingBalanceDeposit) + } + if err = b.PendingBalanceDeposits[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { + return err + } + } + } + + // Field (35) 'PendingPartialWithdrawals' + { + buf = tail[o35:o36] + num, err := ssz.DivideInt2(len(buf), 24, 134217728) + if err != nil { + return err + } + b.PendingPartialWithdrawals = make([]*PendingPartialWithdrawal, num) + for ii := 0; ii < num; ii++ { + if b.PendingPartialWithdrawals[ii] == nil { + b.PendingPartialWithdrawals[ii] = new(PendingPartialWithdrawal) + } + if err = b.PendingPartialWithdrawals[ii].UnmarshalSSZ(buf[ii*24 : (ii+1)*24]); err != nil { + return err + } + } + } + + // Field (36) 'PendingConsolidations' + { + buf = tail[o36:] + num, err := ssz.DivideInt2(len(buf), 16, 262144) + if err != nil { + return err + } + b.PendingConsolidations = make([]*PendingConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.PendingConsolidations[ii] == nil { + b.PendingConsolidations[ii] = new(PendingConsolidation) + } + if err = b.PendingConsolidations[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { + return err + } + } + } return err } -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateDeneb object -func (b *BeaconStateDeneb) SizeSSZ() (size int) { - size = 2736653 +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateElectra object +func (b *BeaconStateElectra) SizeSSZ() (size int) { + size = 2736713 // Field (7) 'HistoricalRoots' size += len(b.HistoricalRoots) * 32 @@ -14515,23 +17258,32 @@ func (b *BeaconStateDeneb) SizeSSZ() (size int) { // Field (24) 'LatestExecutionPayloadHeader' if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) } size += b.LatestExecutionPayloadHeader.SizeSSZ() // Field (27) 'HistoricalSummaries' size += len(b.HistoricalSummaries) * 64 + // Field (34) 'PendingBalanceDeposits' + size += len(b.PendingBalanceDeposits) * 16 + + // Field (35) 'PendingPartialWithdrawals' + size += len(b.PendingPartialWithdrawals) * 24 + + // Field (36) 'PendingConsolidations' + size += len(b.PendingConsolidations) * 16 + return } -// HashTreeRoot ssz hashes the BeaconStateDeneb object -func (b *BeaconStateDeneb) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the BeaconStateElectra object +func (b *BeaconStateElectra) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the BeaconStateDeneb object with a hasher -func (b *BeaconStateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BeaconStateElectra object with a hasher +func (b *BeaconStateElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'GenesisTime' @@ -14827,23 +17579,101 @@ func (b *BeaconStateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (26) 'NextWithdrawalValidatorIndex' hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - // Field (27) 'HistoricalSummaries' + // Field (27) 'HistoricalSummaries' + { + subIndx := hh.Index() + num := uint64(len(b.HistoricalSummaries)) + if num > 16777216 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.HistoricalSummaries { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16777216) + } + } + + // Field (28) 'DepositReceiptsStartIndex' + hh.PutUint64(b.DepositReceiptsStartIndex) + + // Field (29) 'DepositBalanceToConsume' + hh.PutUint64(b.DepositBalanceToConsume) + + // Field (30) 'ExitBalanceToConsume' + hh.PutUint64(b.ExitBalanceToConsume) + + // Field (31) 'EarliestExitEpoch' + hh.PutUint64(uint64(b.EarliestExitEpoch)) + + // Field (32) 'ConsolidationBalanceToConsume' + hh.PutUint64(b.ConsolidationBalanceToConsume) + + // Field (33) 'EarliestConsolidationEpoch' + hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) + + // Field (34) 'PendingBalanceDeposits' + { + subIndx := hh.Index() + num := uint64(len(b.PendingBalanceDeposits)) + if num > 134217728 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingBalanceDeposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) + } else { + hh.MerkleizeWithMixin(subIndx, num, 134217728) + } + } + + // Field (35) 'PendingPartialWithdrawals' + { + subIndx := hh.Index() + num := uint64(len(b.PendingPartialWithdrawals)) + if num > 134217728 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingPartialWithdrawals { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) + } else { + hh.MerkleizeWithMixin(subIndx, num, 134217728) + } + } + + // Field (36) 'PendingConsolidations' { subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { + num := uint64(len(b.PendingConsolidations)) + if num > 262144 { err = ssz.ErrIncorrectListSize return } - for _, elem := range b.HistoricalSummaries { + for _, elem := range b.PendingConsolidations { if err = elem.HashTreeRootWith(hh); err != nil { return } } if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 262144) } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) + hh.MerkleizeWithMixin(subIndx, num, 262144) } } @@ -15122,6 +17952,367 @@ func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingBalanceDeposit object to a target array +func (p *PendingBalanceDeposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, uint64(p.Index)) + + // Field (1) 'Amount' + dst = ssz.MarshalUint64(dst, p.Amount) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'Index' + p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Amount' + p.Amount = ssz.UnmarshallUint64(buf[8:16]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingBalanceDeposit object with a hasher +func (p *PendingBalanceDeposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Index' + hh.PutUint64(uint64(p.Index)) + + // Field (1) 'Amount' + hh.PutUint64(p.Amount) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingPartialWithdrawal object to a target array +func (p *PendingPartialWithdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, uint64(p.Index)) + + // Field (1) 'Amount' + dst = ssz.MarshalUint64(dst, p.Amount) + + // Field (2) 'WithdrawableEpoch' + dst = ssz.MarshalUint64(dst, p.WithdrawableEpoch) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24 { + return ssz.ErrSize + } + + // Field (0) 'Index' + p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Amount' + p.Amount = ssz.UnmarshallUint64(buf[8:16]) + + // Field (2) 'WithdrawableEpoch' + p.WithdrawableEpoch = ssz.UnmarshallUint64(buf[16:24]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) SizeSSZ() (size int) { + size = 24 + return +} + +// HashTreeRoot ssz hashes the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingPartialWithdrawal object with a hasher +func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Index' + hh.PutUint64(uint64(p.Index)) + + // Field (1) 'Amount' + hh.PutUint64(p.Amount) + + // Field (2) 'WithdrawableEpoch' + hh.PutUint64(p.WithdrawableEpoch) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the Consolidation object +func (c *Consolidation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(c) +} + +// MarshalSSZTo ssz marshals the Consolidation object to a target array +func (c *Consolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SourceIndex' + dst = ssz.MarshalUint64(dst, uint64(c.SourceIndex)) + + // Field (1) 'TargetIndex' + dst = ssz.MarshalUint64(dst, uint64(c.TargetIndex)) + + // Field (2) 'Epoch' + dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the Consolidation object +func (c *Consolidation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24 { + return ssz.ErrSize + } + + // Field (0) 'SourceIndex' + c.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'TargetIndex' + c.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'Epoch' + c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Consolidation object +func (c *Consolidation) SizeSSZ() (size int) { + size = 24 + return +} + +// HashTreeRoot ssz hashes the Consolidation object +func (c *Consolidation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(c) +} + +// HashTreeRootWith ssz hashes the Consolidation object with a hasher +func (c *Consolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SourceIndex' + hh.PutUint64(uint64(c.SourceIndex)) + + // Field (1) 'TargetIndex' + hh.PutUint64(uint64(c.TargetIndex)) + + // Field (2) 'Epoch' + hh.PutUint64(uint64(c.Epoch)) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the SignedConsolidation object +func (s *SignedConsolidation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedConsolidation object to a target array +func (s *SignedConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(Consolidation) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedConsolidation object +func (s *SignedConsolidation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 120 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(Consolidation) + } + if err = s.Message.UnmarshalSSZ(buf[0:24]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[24:120])) + } + s.Signature = append(s.Signature, buf[24:120]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedConsolidation object +func (s *SignedConsolidation) SizeSSZ() (size int) { + size = 120 + return +} + +// HashTreeRoot ssz hashes the SignedConsolidation object +func (s *SignedConsolidation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedConsolidation object with a hasher +func (s *SignedConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the PendingConsolidation object +func (p *PendingConsolidation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingConsolidation object to a target array +func (p *PendingConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SourceIndex' + dst = ssz.MarshalUint64(dst, uint64(p.SourceIndex)) + + // Field (1) 'TargetIndex' + dst = ssz.MarshalUint64(dst, uint64(p.TargetIndex)) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingConsolidation object +func (p *PendingConsolidation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'SourceIndex' + p.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'TargetIndex' + p.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingConsolidation object +func (p *PendingConsolidation) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the PendingConsolidation object +func (p *PendingConsolidation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingConsolidation object with a hasher +func (p *PendingConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SourceIndex' + hh.PutUint64(uint64(p.SourceIndex)) + + // Field (1) 'TargetIndex' + hh.PutUint64(uint64(p.TargetIndex)) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the Status object func (s *Status) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go index 267ca72f5ab7..caf68d3882f1 100755 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go +++ b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go @@ -105,6 +105,8 @@ type SignRequest struct { // *SignRequest_BlindedBlockCapella // *SignRequest_BlockDeneb // *SignRequest_BlindedBlockDeneb + // *SignRequest_BlockElectra + // *SignRequest_BlindedBlockElectra Object isSignRequest_Object `protobuf_oneof:"object"` SigningSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=signing_slot,json=signingSlot,proto3" json:"signing_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` } @@ -288,6 +290,20 @@ func (x *SignRequest) GetBlindedBlockDeneb() *v1alpha1.BlindedBeaconBlockDeneb { return nil } +func (x *SignRequest) GetBlockElectra() *v1alpha1.BeaconBlockElectra { + if x, ok := x.GetObject().(*SignRequest_BlockElectra); ok { + return x.BlockElectra + } + return nil +} + +func (x *SignRequest) GetBlindedBlockElectra() *v1alpha1.BlindedBeaconBlockElectra { + if x, ok := x.GetObject().(*SignRequest_BlindedBlockElectra); ok { + return x.BlindedBlockElectra + } + return nil +} + func (x *SignRequest) GetSigningSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { if x != nil { return x.SigningSlot @@ -367,6 +383,14 @@ type SignRequest_BlindedBlockDeneb struct { BlindedBlockDeneb *v1alpha1.BlindedBeaconBlockDeneb `protobuf:"bytes,117,opt,name=blinded_block_deneb,json=blindedBlockDeneb,proto3,oneof"` } +type SignRequest_BlockElectra struct { + BlockElectra *v1alpha1.BeaconBlockElectra `protobuf:"bytes,118,opt,name=block_electra,json=blockElectra,proto3,oneof"` +} + +type SignRequest_BlindedBlockElectra struct { + BlindedBlockElectra *v1alpha1.BlindedBeaconBlockElectra `protobuf:"bytes,119,opt,name=blinded_block_electra,json=blindedBlockElectra,proto3,oneof"` +} + func (*SignRequest_Block) isSignRequest_Object() {} func (*SignRequest_AttestationData) isSignRequest_Object() {} @@ -401,6 +425,10 @@ func (*SignRequest_BlockDeneb) isSignRequest_Object() {} func (*SignRequest_BlindedBlockDeneb) isSignRequest_Object() {} +func (*SignRequest_BlockElectra) isSignRequest_Object() {} + +func (*SignRequest_BlindedBlockElectra) isSignRequest_Object() {} + type SignResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -659,7 +687,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x0d, 0x0a, 0x0b, 0x53, + 0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x0f, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67, @@ -762,85 +790,97 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x68, 0x0a, 0x0c, 0x73, - 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, - 0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a, - 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c, - 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, - 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, - 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, - 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, - 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, - 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4b, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, - 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x50, 0x0a, 0x0d, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x76, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, + 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x66, 0x0a, + 0x15, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x77, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, + 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x68, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42, + 0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, + 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, + 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, + 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, + 0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, + 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, + 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, 0x61, + 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, + 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, + 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, - 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, - 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, + 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, + 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, + 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, + 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -879,6 +919,8 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_goTypes = []inte (*v1alpha1.BlindedBeaconBlockCapella)(nil), // 18: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella (*v1alpha1.BeaconBlockDeneb)(nil), // 19: ethereum.eth.v1alpha1.BeaconBlockDeneb (*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 20: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb + (*v1alpha1.BeaconBlockElectra)(nil), // 21: ethereum.eth.v1alpha1.BeaconBlockElectra + (*v1alpha1.BlindedBeaconBlockElectra)(nil), // 22: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra } var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int32{ 7, // 0: ethereum.validator.accounts.v2.SignRequest.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock @@ -895,16 +937,18 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int3 18, // 11: ethereum.validator.accounts.v2.SignRequest.blinded_block_capella:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella 19, // 12: ethereum.validator.accounts.v2.SignRequest.block_deneb:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb 20, // 13: ethereum.validator.accounts.v2.SignRequest.blinded_block_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb - 0, // 14: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status - 4, // 15: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig - 6, // 16: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry - 3, // 17: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload - 3, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 21, // 14: ethereum.validator.accounts.v2.SignRequest.block_electra:type_name -> ethereum.eth.v1alpha1.BeaconBlockElectra + 22, // 15: ethereum.validator.accounts.v2.SignRequest.blinded_block_electra:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + 0, // 16: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status + 4, // 17: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig + 6, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry + 3, // 19: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload + 3, // 20: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload + 21, // [21:21] is the sub-list for method output_type + 21, // [21:21] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() } @@ -992,6 +1036,8 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() { (*SignRequest_BlindedBlockCapella)(nil), (*SignRequest_BlockDeneb)(nil), (*SignRequest_BlindedBlockDeneb)(nil), + (*SignRequest_BlockElectra)(nil), + (*SignRequest_BlindedBlockElectra)(nil), } file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.proto b/proto/prysm/v1alpha1/validator-client/keymanager.proto index 85500ceb840b..fc014b731393 100644 --- a/proto/prysm/v1alpha1/validator-client/keymanager.proto +++ b/proto/prysm/v1alpha1/validator-client/keymanager.proto @@ -61,6 +61,10 @@ message SignRequest { // Deneb objects. ethereum.eth.v1alpha1.BeaconBlockDeneb block_deneb = 116; ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb blinded_block_deneb = 117; + + // Electra objects. + ethereum.eth.v1alpha1.BeaconBlockElectra block_electra = 118; + ethereum.eth.v1alpha1.BlindedBeaconBlockElectra blinded_block_electra = 119; } reserved 4, 5; // Reserving old, deleted fields. uint64 signing_slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; diff --git a/proto/ssz_proto_library.bzl b/proto/ssz_proto_library.bzl index f3a31473ee75..b43fd49f616d 100644 --- a/proto/ssz_proto_library.bzl +++ b/proto/ssz_proto_library.bzl @@ -26,6 +26,15 @@ mainnet = { "max_blobs_per_block.size": "6", "max_blob_commitments.size": "4096", "kzg_commitment_inclusion_proof_depth.size": "17", + "max_withdrawal_requests_per_payload.size":"16", + "max_deposit_receipts": "8192", + "max_attesting_indices.size": "131072", + "max_committees_per_slot.size": "64", + "committee_bits.size": "8", + "committee_bits.type": "github.com/prysmaticlabs/go-bitfield.Bitvector64", + "pending_balance_deposits_limit": "134217728", + "pending_partial_withdrawals_limit": "134217728", + "pending_consolidations_limit": "262144", } minimal = { @@ -48,6 +57,15 @@ minimal = { "max_blobs_per_block.size": "6", "max_blob_commitments.size": "16", "kzg_commitment_inclusion_proof_depth.size": "9", + "max_withdrawal_requests_per_payload.size":"2", + "max_deposit_receipts": "4", + "max_attesting_indices.size": "8192", + "max_committees_per_slot.size": "4", + "committee_bits.size": "1", + "committee_bits.type": "github.com/prysmaticlabs/go-bitfield.Bitvector4", + "pending_balance_deposits_limit": "134217728", + "pending_partial_withdrawals_limit": "64", + "pending_consolidations_limit": "64", } ###### Rules definitions ####### diff --git a/testing/spectest/mainnet/electra/ssz_static/BUILD.bazel b/testing/spectest/mainnet/electra/ssz_static/BUILD.bazel new file mode 100644 index 000000000000..209851bf8c84 --- /dev/null +++ b/testing/spectest/mainnet/electra/ssz_static/BUILD.bazel @@ -0,0 +1,12 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["ssz_static_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/ssz_static:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/ssz_static/ssz_static_test.go b/testing/spectest/mainnet/electra/ssz_static/ssz_static_test.go new file mode 100644 index 000000000000..cd5c05caef3f --- /dev/null +++ b/testing/spectest/mainnet/electra/ssz_static/ssz_static_test.go @@ -0,0 +1,11 @@ +package ssz_static + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static" +) + +func TestMainnet_Electra_SSZStatic(t *testing.T) { + ssz_static.RunSSZStaticTests(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/ssz_static/BUILD.bazel b/testing/spectest/minimal/electra/ssz_static/BUILD.bazel new file mode 100644 index 000000000000..dd9d320a094b --- /dev/null +++ b/testing/spectest/minimal/electra/ssz_static/BUILD.bazel @@ -0,0 +1,16 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["ssz_static_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = [ + "minimal", + "spectest", + ], + deps = ["//testing/spectest/shared/electra/ssz_static:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/ssz_static/ssz_static_test.go b/testing/spectest/minimal/electra/ssz_static/ssz_static_test.go new file mode 100644 index 000000000000..3911c1d46287 --- /dev/null +++ b/testing/spectest/minimal/electra/ssz_static/ssz_static_test.go @@ -0,0 +1,11 @@ +package ssz_static + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static" +) + +func TestMinimal_Electra_SSZStatic(t *testing.T) { + ssz_static.RunSSZStaticTests(t, "minimal") +} diff --git a/testing/spectest/shared/electra/ssz_static/BUILD.bazel b/testing/spectest/shared/electra/ssz_static/BUILD.bazel new file mode 100644 index 000000000000..0c972544a411 --- /dev/null +++ b/testing/spectest/shared/electra/ssz_static/BUILD.bazel @@ -0,0 +1,15 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["ssz_static.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static", + visibility = ["//testing/spectest:__subpackages__"], + deps = [ + "//proto/engine/v1:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/spectest/shared/common/ssz_static:go_default_library", + "@com_github_prysmaticlabs_fastssz//:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/ssz_static/ssz_static.go b/testing/spectest/shared/electra/ssz_static/ssz_static.go new file mode 100644 index 000000000000..9f9c6593bce9 --- /dev/null +++ b/testing/spectest/shared/electra/ssz_static/ssz_static.go @@ -0,0 +1,170 @@ +package ssz_static + +import ( + "errors" + "testing" + + fssz "github.com/prysmaticlabs/fastssz" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/ssz_static" +) + +// RunSSZStaticTests executes "ssz_static" tests. +func RunSSZStaticTests(t *testing.T, config string) { + common.RunSSZStaticTests(t, config, "electra", UnmarshalledSSZ, customHtr) +} + +func customHtr(t *testing.T, htrs []common.HTR, object interface{}) []common.HTR { + // TODO: Replace BeaconStateDeneb with BeaconStateElectra below and uncomment the code + //_, ok := object.(*ethpb.BeaconStateDeneb) + //if !ok { + // return htrs + //} + // + //htrs = append(htrs, func(s interface{}) ([32]byte, error) { + // beaconState, err := state_native.InitializeFromProtoDeneb(s.(*ethpb.BeaconStateDeneb)) + // require.NoError(t, err) + // return beaconState.HashTreeRoot(context.Background()) + //}) + return htrs +} + +// UnmarshalledSSZ unmarshalls serialized input. +func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (interface{}, error) { + // TODO: Remove this check once BeaconState custom HTR function is ready + if folderName == "BeaconState" { + t.Skip("BeaconState is not ready") + } + var obj interface{} + switch folderName { + case "ExecutionPayload": + obj = &enginev1.ExecutionPayloadElectra{} + case "ExecutionPayloadHeader": + obj = &enginev1.ExecutionPayloadHeaderElectra{} + case "Attestation": + obj = ðpb.AttestationElectra{} + case "AttestationData": + obj = ðpb.AttestationData{} + case "AttesterSlashing": + obj = ðpb.AttesterSlashingElectra{} + case "AggregateAndProof": + obj = ðpb.AggregateAttestationAndProofElectra{} + case "BeaconBlock": + obj = ðpb.BeaconBlockElectra{} + case "BeaconBlockBody": + obj = ðpb.BeaconBlockBodyElectra{} + case "BeaconBlockHeader": + obj = ðpb.BeaconBlockHeader{} + case "BeaconState": + obj = ðpb.BeaconStateElectra{} + case "Checkpoint": + obj = ðpb.Checkpoint{} + case "Deposit": + obj = ðpb.Deposit{} + case "DepositMessage": + obj = ðpb.DepositMessage{} + case "DepositData": + obj = ðpb.Deposit_Data{} + case "Eth1Data": + obj = ðpb.Eth1Data{} + case "Eth1Block": + t.Skip("Unused type") + return nil, nil + case "Fork": + obj = ðpb.Fork{} + case "ForkData": + obj = ðpb.ForkData{} + case "HistoricalBatch": + obj = ðpb.HistoricalBatch{} + case "IndexedAttestation": + obj = ðpb.IndexedAttestationElectra{} + case "PendingAttestation": + obj = ðpb.PendingAttestation{} + case "ProposerSlashing": + obj = ðpb.ProposerSlashing{} + case "SignedAggregateAndProof": + obj = ðpb.SignedAggregateAttestationAndProofElectra{} + case "SignedBeaconBlock": + obj = ðpb.SignedBeaconBlockElectra{} + case "SignedBeaconBlockHeader": + obj = ðpb.SignedBeaconBlockHeader{} + case "SignedVoluntaryExit": + obj = ðpb.SignedVoluntaryExit{} + case "SigningData": + obj = ðpb.SigningData{} + case "Validator": + obj = ðpb.Validator{} + case "VoluntaryExit": + obj = ðpb.VoluntaryExit{} + case "SyncCommitteeMessage": + obj = ðpb.SyncCommitteeMessage{} + case "SyncCommitteeContribution": + obj = ðpb.SyncCommitteeContribution{} + case "ContributionAndProof": + obj = ðpb.ContributionAndProof{} + case "SignedContributionAndProof": + obj = ðpb.SignedContributionAndProof{} + case "SyncAggregate": + obj = ðpb.SyncAggregate{} + case "SyncAggregatorSelectionData": + obj = ðpb.SyncAggregatorSelectionData{} + case "SyncCommittee": + obj = ðpb.SyncCommittee{} + case "LightClientOptimisticUpdate": + t.Skip("not a beacon node type, this is a light node type") + return nil, nil + case "LightClientFinalityUpdate": + t.Skip("not a beacon node type, this is a light node type") + return nil, nil + case "LightClientBootstrap": + t.Skip("not a beacon node type, this is a light node type") + return nil, nil + case "LightClientSnapshot": + t.Skip("not a beacon node type, this is a light node type") + return nil, nil + case "LightClientUpdate": + t.Skip("not a beacon node type, this is a light node type") + return nil, nil + case "LightClientHeader": + t.Skip("not a beacon node type, this is a light node type") + return nil, nil + case "BlobIdentifier": + obj = ðpb.BlobIdentifier{} + case "BlobSidecar": + obj = ðpb.BlobSidecar{} + case "PowBlock": + obj = ðpb.PowBlock{} + case "Withdrawal": + obj = &enginev1.Withdrawal{} + case "HistoricalSummary": + obj = ðpb.HistoricalSummary{} + case "BLSToExecutionChange": + obj = ðpb.BLSToExecutionChange{} + case "SignedBLSToExecutionChange": + obj = ðpb.SignedBLSToExecutionChange{} + case "PendingBalanceDeposit": + obj = ðpb.PendingBalanceDeposit{} + case "PendingPartialWithdrawal": + obj = ðpb.PendingPartialWithdrawal{} + case "Consolidation": + obj = ðpb.Consolidation{} + case "SignedConsolidation": + obj = ðpb.SignedConsolidation{} + case "PendingConsolidation": + obj = ðpb.PendingConsolidation{} + case "ExecutionLayerWithdrawalRequest": + obj = &enginev1.ExecutionLayerWithdrawalRequest{} + case "DepositReceipt": + obj = &enginev1.DepositReceipt{} + default: + return nil, errors.New("type not found") + } + var err error + if o, ok := obj.(fssz.Unmarshaler); ok { + err = o.UnmarshalSSZ(serializedBytes) + } else { + err = errors.New("could not unmarshal object, not a fastssz compatible object") + } + return obj, err +} From 8d9024f01f62f4766db25fcc891fb903df5da9e6 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Wed, 24 Apr 2024 23:59:21 -0500 Subject: [PATCH 055/325] use [32]byte keys in the filesystem cache (#13885) Co-authored-by: Kasey Kirkham --- beacon-chain/db/filesystem/BUILD.bazel | 2 + beacon-chain/db/filesystem/blob.go | 11 +++ beacon-chain/db/filesystem/cache.go | 13 ++-- beacon-chain/db/filesystem/cache_test.go | 2 +- beacon-chain/db/filesystem/mock.go | 2 +- beacon-chain/db/filesystem/pruner.go | 18 +++-- beacon-chain/db/filesystem/pruner_test.go | 85 +++++++++++++++++------ 7 files changed, 99 insertions(+), 34 deletions(-) diff --git a/beacon-chain/db/filesystem/BUILD.bazel b/beacon-chain/db/filesystem/BUILD.bazel index bc97cdd89b98..e4008d70072e 100644 --- a/beacon-chain/db/filesystem/BUILD.bazel +++ b/beacon-chain/db/filesystem/BUILD.bazel @@ -18,10 +18,12 @@ go_library( "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", + "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/logging:go_default_library", "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index 78ad550c4dd9..f7e518022d30 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -10,11 +10,13 @@ import ( "strings" "time" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/logging" @@ -27,6 +29,7 @@ var ( errEmptyBlobWritten = errors.New("zero bytes written to disk when saving blob sidecar") errSidecarEmptySSZData = errors.New("sidecar marshalled to an empty ssz byte slice") errNoBasePath = errors.New("BlobStorage base path not specified in init") + errInvalidRootString = errors.New("Could not parse hex string as a [32]byte") ) const ( @@ -333,3 +336,11 @@ func (p blobNamer) path() string { func rootString(root [32]byte) string { return fmt.Sprintf("%#x", root) } + +func stringToRoot(str string) ([32]byte, error) { + slice, err := hexutil.Decode(str) + if err != nil { + return [32]byte{}, errors.Wrapf(errInvalidRootString, "input=%s", str) + } + return bytesutil.ToBytes32(slice), nil +} diff --git a/beacon-chain/db/filesystem/cache.go b/beacon-chain/db/filesystem/cache.go index 81de01551514..46d1f694c8f9 100644 --- a/beacon-chain/db/filesystem/cache.go +++ b/beacon-chain/db/filesystem/cache.go @@ -48,27 +48,26 @@ type BlobStorageSummarizer interface { type blobStorageCache struct { mu sync.RWMutex nBlobs float64 - cache map[string]BlobStorageSummary + cache map[[32]byte]BlobStorageSummary } var _ BlobStorageSummarizer = &blobStorageCache{} func newBlobStorageCache() *blobStorageCache { return &blobStorageCache{ - cache: make(map[string]BlobStorageSummary, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest*fieldparams.SlotsPerEpoch), + cache: make(map[[32]byte]BlobStorageSummary, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest*fieldparams.SlotsPerEpoch), } } // Summary returns the BlobStorageSummary for `root`. The BlobStorageSummary can be used to check for the presence of // BlobSidecars based on Index. func (s *blobStorageCache) Summary(root [32]byte) BlobStorageSummary { - k := rootString(root) s.mu.RLock() defer s.mu.RUnlock() - return s.cache[k] + return s.cache[root] } -func (s *blobStorageCache) ensure(key string, slot primitives.Slot, idx uint64) error { +func (s *blobStorageCache) ensure(key [32]byte, slot primitives.Slot, idx uint64) error { if idx >= fieldparams.MaxBlobsPerBlock { return errIndexOutOfBounds } @@ -84,7 +83,7 @@ func (s *blobStorageCache) ensure(key string, slot primitives.Slot, idx uint64) return nil } -func (s *blobStorageCache) slot(key string) (primitives.Slot, bool) { +func (s *blobStorageCache) slot(key [32]byte) (primitives.Slot, bool) { s.mu.RLock() defer s.mu.RUnlock() v, ok := s.cache[key] @@ -94,7 +93,7 @@ func (s *blobStorageCache) slot(key string) (primitives.Slot, bool) { return v.slot, ok } -func (s *blobStorageCache) evict(key string) { +func (s *blobStorageCache) evict(key [32]byte) { var deleted float64 s.mu.Lock() v, ok := s.cache[key] diff --git a/beacon-chain/db/filesystem/cache_test.go b/beacon-chain/db/filesystem/cache_test.go index 80c214006e23..76c8d783a1d4 100644 --- a/beacon-chain/db/filesystem/cache_test.go +++ b/beacon-chain/db/filesystem/cache_test.go @@ -48,7 +48,7 @@ func TestSlotByRoot_Summary(t *testing.T) { sc := newBlobStorageCache() for _, c := range cases { if c.expected != nil { - key := rootString(bytesutil.ToBytes32([]byte(c.name))) + key := bytesutil.ToBytes32([]byte(c.name)) sc.cache[key] = BlobStorageSummary{slot: 0, mask: *c.expected} } } diff --git a/beacon-chain/db/filesystem/mock.go b/beacon-chain/db/filesystem/mock.go index 53d6427f6852..2b894eef53a9 100644 --- a/beacon-chain/db/filesystem/mock.go +++ b/beacon-chain/db/filesystem/mock.go @@ -66,7 +66,7 @@ func NewMockBlobStorageSummarizer(t *testing.T, set map[[32]byte][]int) BlobStor c := newBlobStorageCache() for k, v := range set { for i := range v { - if err := c.ensure(rootString(k), 0, uint64(v[i])); err != nil { + if err := c.ensure(k, 0, uint64(v[i])); err != nil { t.Fatal(err) } } diff --git a/beacon-chain/db/filesystem/pruner.go b/beacon-chain/db/filesystem/pruner.go index e42855071c51..9c5be29842eb 100644 --- a/beacon-chain/db/filesystem/pruner.go +++ b/beacon-chain/db/filesystem/pruner.go @@ -64,7 +64,7 @@ func newBlobPruner(fs afero.Fs, retain primitives.Epoch, opts ...prunerOpt) (*bl // notify updates the pruner's view of root->blob mappings. This allows the pruner to build a cache // of root->slot mappings and decide when to evict old blobs based on the age of present blobs. func (p *blobPruner) notify(root [32]byte, latest primitives.Slot, idx uint64) error { - if err := p.cache.ensure(rootString(root), latest, idx); err != nil { + if err := p.cache.ensure(root, latest, idx); err != nil { return err } pruned := uint64(windowMin(latest, p.windowSize)) @@ -160,7 +160,10 @@ func shouldRetain(slot, pruneBefore primitives.Slot) bool { } func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int, error) { - root := rootFromDir(dir) + root, err := rootFromDir(dir) + if err != nil { + return 0, errors.Wrapf(err, "invalid directory, could not parse subdir as root %s", dir) + } slot, slotCached := p.cache.slot(root) // Return early if the slot is cached and doesn't need pruning. if slotCached && shouldRetain(slot, pruneBefore) { @@ -218,7 +221,7 @@ func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int, return removed, errors.Wrapf(err, "unable to remove blob directory %s", dir) } - p.cache.evict(rootFromDir(dir)) + p.cache.evict(root) return len(scFiles), nil } @@ -235,8 +238,13 @@ func idxFromPath(fname string) (uint64, error) { return strconv.ParseUint(parts[0], 10, 64) } -func rootFromDir(dir string) string { - return filepath.Base(dir) // end of the path should be the blob directory, named by hex encoding of root +func rootFromDir(dir string) ([32]byte, error) { + subdir := filepath.Base(dir) // end of the path should be the blob directory, named by hex encoding of root + root, err := stringToRoot(subdir) + if err != nil { + return root, errors.Wrapf(err, "invalid directory, could not parse subdir as root %s", dir) + } + return root, nil } // Read slot from marshaled BlobSidecar data in the given file. See slotFromBlob for details. diff --git a/beacon-chain/db/filesystem/pruner_test.go b/beacon-chain/db/filesystem/pruner_test.go index ee5dbeb213ab..ad7dace8f873 100644 --- a/beacon-chain/db/filesystem/pruner_test.go +++ b/beacon-chain/db/filesystem/pruner_test.go @@ -25,11 +25,11 @@ func TestTryPruneDir_CachedNotExpired(t *testing.T) { _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, fieldparams.MaxBlobsPerBlock) sc, err := verification.BlobSidecarNoop(sidecars[0]) require.NoError(t, err) - root := fmt.Sprintf("%#x", sc.BlockRoot()) + rootStr := rootString(sc.BlockRoot()) // This slot is right on the edge of what would need to be pruned, so by adding it to the cache and // skipping any other test setup, we can be certain the hot cache path never touches the filesystem. - require.NoError(t, pr.cache.ensure(root, sc.Slot(), 0)) - pruned, err := pr.tryPruneDir(root, pr.windowSize) + require.NoError(t, pr.cache.ensure(sc.BlockRoot(), sc.Slot(), 0)) + pruned, err := pr.tryPruneDir(rootStr, pr.windowSize) require.NoError(t, err) require.Equal(t, 0, pruned) } @@ -43,10 +43,10 @@ func TestTryPruneDir_CachedExpired(t *testing.T) { _, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 1) sc, err := verification.BlobSidecarNoop(sidecars[0]) require.NoError(t, err) - root := fmt.Sprintf("%#x", sc.BlockRoot()) - require.NoError(t, fs.Mkdir(root, directoryPermissions)) // make empty directory - require.NoError(t, pr.cache.ensure(root, sc.Slot(), 0)) - pruned, err := pr.tryPruneDir(root, slot+1) + rootStr := rootString(sc.BlockRoot()) + require.NoError(t, fs.Mkdir(rootStr, directoryPermissions)) // make empty directory + require.NoError(t, pr.cache.ensure(sc.BlockRoot(), sc.Slot(), 0)) + pruned, err := pr.tryPruneDir(rootStr, slot+1) require.NoError(t, err) require.Equal(t, 0, pruned) }) @@ -61,20 +61,21 @@ func TestTryPruneDir_CachedExpired(t *testing.T) { require.NoError(t, bs.Save(scs[1])) // check that the root->slot is cached - root := fmt.Sprintf("%#x", scs[0].BlockRoot()) - cs, cok := bs.pruner.cache.slot(root) + root := scs[0].BlockRoot() + rootStr := rootString(root) + cs, cok := bs.pruner.cache.slot(scs[0].BlockRoot()) require.Equal(t, true, cok) require.Equal(t, slot, cs) // ensure that we see the saved files in the filesystem - files, err := listDir(fs, root) + files, err := listDir(fs, rootStr) require.NoError(t, err) require.Equal(t, 2, len(files)) - pruned, err := bs.pruner.tryPruneDir(root, slot+1) + pruned, err := bs.pruner.tryPruneDir(rootStr, slot+1) require.NoError(t, err) require.Equal(t, 2, pruned) - files, err = listDir(fs, root) + files, err = listDir(fs, rootStr) require.ErrorIs(t, err, os.ErrNotExist) require.Equal(t, 0, len(files)) }) @@ -92,7 +93,8 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { require.NoError(t, bs.Save(scs[1])) // check that the root->slot is cached - root := fmt.Sprintf("%#x", scs[0].BlockRoot()) + root := scs[0].BlockRoot() + rootStr := rootString(root) cs, ok := bs.pruner.cache.slot(root) require.Equal(t, true, ok) require.Equal(t, slot, cs) @@ -102,14 +104,14 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { require.Equal(t, false, ok) // ensure that we see the saved files in the filesystem - files, err := listDir(fs, root) + files, err := listDir(fs, rootStr) require.NoError(t, err) require.Equal(t, 2, len(files)) - pruned, err := bs.pruner.tryPruneDir(root, slot+1) + pruned, err := bs.pruner.tryPruneDir(rootStr, slot+1) require.NoError(t, err) require.Equal(t, 2, pruned) - files, err = listDir(fs, root) + files, err = listDir(fs, rootStr) require.ErrorIs(t, err, os.ErrNotExist) require.Equal(t, 0, len(files)) }) @@ -125,24 +127,25 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) { require.NoError(t, bs.Save(scs[1])) // Evict slot mapping from the cache so that we trigger the file read path. - root := fmt.Sprintf("%#x", scs[0].BlockRoot()) + root := scs[0].BlockRoot() + rootStr := rootString(root) bs.pruner.cache.evict(root) _, ok := bs.pruner.cache.slot(root) require.Equal(t, false, ok) // Ensure that we see the saved files in the filesystem. - files, err := listDir(fs, root) + files, err := listDir(fs, rootStr) require.NoError(t, err) require.Equal(t, 2, len(files)) // This should use the slotFromFile code (simulating restart). // Setting pruneBefore == slot, so that the slot will be outside the window (at the boundary). - pruned, err := bs.pruner.tryPruneDir(root, slot) + pruned, err := bs.pruner.tryPruneDir(rootStr, slot) require.NoError(t, err) require.Equal(t, 0, pruned) // Ensure files are still present. - files, err = listDir(fs, root) + files, err = listDir(fs, rootStr) require.NoError(t, err) require.Equal(t, 2, len(files)) }) @@ -316,3 +319,45 @@ func TestListDir(t *testing.T) { }) } } + +func TestRootFromDir(t *testing.T) { + cases := []struct { + name string + dir string + err error + root [32]byte + }{ + { + name: "happy path", + dir: "0xffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5cb", + root: [32]byte{255, 255, 135, 94, 29, 152, 92, 92, 203, 33, 72, 148, 152, 63, 36, 40, + 237, 178, 113, 240, 248, 123, 104, 186, 112, 16, 228, 169, 157, 243, 181, 203}, + }, + { + name: "too short", + dir: "0xffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5c", + err: errInvalidRootString, + }, + { + name: "too log", + dir: "0xffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5cbb", + err: errInvalidRootString, + }, + { + name: "missing prefix", + dir: "ffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5cb", + err: errInvalidRootString, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + root, err := stringToRoot(c.dir) + if c.err != nil { + require.ErrorIs(t, err, c.err) + return + } + require.NoError(t, err) + require.Equal(t, c.root, root) + }) + } +} From 751117a3088e3aa52f14be40364e65a1f5706325 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 25 Apr 2024 19:22:54 -0500 Subject: [PATCH 056/325] Electra: full beacon config (#13918) * Electra: full beacon config Fix TestGetSpec * Fix beacon config spec compliance test so that it properly loads the config from spec tests. Tests failing for now. * fix tests and comply with spec presets --- beacon-chain/rpc/eth/config/handlers_test.go | 52 +++++++++++++++++++- config/fieldparams/mainnet.go | 5 ++ config/fieldparams/minimal.go | 5 ++ config/params/config.go | 41 ++++++++++----- config/params/loader_test.go | 13 +++++ config/params/mainnet_config.go | 28 +++++++++-- config/params/minimal_config.go | 9 +++- 7 files changed, 135 insertions(+), 18 deletions(-) diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index d4d4f7d18c1a..b269349c3960 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -133,6 +133,21 @@ func TestGetSpec(t *testing.T) { config.MaxWithdrawalsPerPayload = 74 config.MaxBlsToExecutionChanges = 75 config.MaxValidatorsPerWithdrawalsSweep = 76 + config.MinSlashingPenaltyQuotientElectra = 77 + config.MaxEffectiveBalanceElectra = 78 + config.CompoundingWithdrawalPrefixByte = byte('d') + config.WhistleBlowerRewardQuotientElectra = 79 + config.PendingPartialWithdrawalsLimit = 80 + config.MinActivationBalance = 81 + config.PendingBalanceDepositLimit = 82 + config.MaxPendingPartialsPerWithdrawalSweep = 83 + config.PendingConsolidationsLimit = 84 + config.MaxPartialWithdrawalsPerPayload = 85 + config.FullExitRequestAmount = 86 + config.MaxConsolidations = 87 + config.MaxAttesterSlashingsElectra = 88 + config.MaxAttestationsElectra = 89 + config.MaxWithdrawalRequestsPerPayload = 90 var dbp [4]byte copy(dbp[:], []byte{'0', '0', '0', '1'}) @@ -158,6 +173,9 @@ func TestGetSpec(t *testing.T) { var dam [4]byte copy(dam[:], []byte{'1', '0', '0', '0'}) config.DomainApplicationMask = dam + var dc [4]byte + copy(dc[:], []byte{'1', '1', '0', '0'}) + config.DomainConsolidation = dc params.OverrideBeaconConfig(config) @@ -172,7 +190,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 136, len(data)) + assert.Equal(t, 152, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -471,6 +489,38 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "32", v) case "MAX_REQUEST_DATA_COLUMN_SIDECARS": assert.Equal(t, "16384", v) + case "MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA": + assert.Equal(t, "77", v) + case "MAX_EFFECTIVE_BALANCE_ELECTRA": + assert.Equal(t, "78", v) + case "COMPOUNDING_WITHDRAWAL_PREFIX": + assert.Equal(t, "0x64", v) + case "WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA": + assert.Equal(t, "79", v) + case "PENDING_PARTIAL_WITHDRAWALS_LIMIT": + assert.Equal(t, "80", v) + case "MIN_ACTIVATION_BALANCE": + assert.Equal(t, "81", v) + case "PENDING_BALANCE_DEPOSITS_LIMIT": + assert.Equal(t, "82", v) + case "MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP": + assert.Equal(t, "83", v) + case "PENDING_CONSOLIDATIONS_LIMIT": + assert.Equal(t, "84", v) + case "MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD": + assert.Equal(t, "85", v) + case "FULL_EXIT_REQUEST_AMOUNT": + assert.Equal(t, "86", v) + case "MAX_CONSOLIDATIONS": + assert.Equal(t, "87", v) + case "DOMAIN_CONSOLIDATION": + assert.Equal(t, "0x31313030", v) + case "MAX_ATTESTER_SLASHINGS_ELECTRA": + assert.Equal(t, "88", v) + case "MAX_ATTESTATIONS_ELECTRA": + assert.Equal(t, "89", v) + case "MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD": + assert.Equal(t, "90", v) default: t.Errorf("Incorrect key: %s", k) } diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index 706334328313..983b35db2177 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -33,4 +33,9 @@ const ( BlobSize = 131072 // defined to match blob.size in bazel ssz codegen KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. + PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. + PendingPartialWithdrawalsLimit = 134217728 // Maximum number of pending partial withdrawals in the beacon state. + PendingConsolidationsLimit = 262144 // Maximum number of pending consolidations in the beacon state. + MaxDepositReceiptsPerPayload = 8192 // Maximum number of deposit receipts in an execution payload. + MaxWithdrawalRequestsPerPayload = 16 // Maximum number of execution layer withdrawal requests in an execution payload. ) diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index 96ec9e28f875..297d7cac255c 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -33,4 +33,9 @@ const ( BlobSize = 131072 // defined to match blob.size in bazel ssz codegen KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. + PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. + PendingPartialWithdrawalsLimit = 64 // Maximum number of pending partial withdrawals in the beacon state. + PendingConsolidationsLimit = 64 // Maximum number of pending consolidations in the beacon state. + MaxDepositReceiptsPerPayload = 4 // Maximum number of deposit receipts in an execution payload. + MaxWithdrawalRequestsPerPayload = 2 // Maximum number of execution layer withdrawal requests in an execution payload. ) diff --git a/config/params/config.go b/config/params/config.go index 75817b273c22..6b3a07b64ec1 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -41,6 +41,7 @@ type BeaconChainConfig struct { // Gwei value constants. MinDepositAmount uint64 `yaml:"MIN_DEPOSIT_AMOUNT" spec:"true"` // MinDepositAmount is the minimum amount of Gwei a validator can send to the deposit contract at once (lower amounts will be reverted). + MinActivationBalance uint64 `yaml:"MIN_ACTIVATION_BALANCE" spec:"true"` // MinActivationBalance is the minimum amount of Gwei a validator must have to be activated in the beacon state. MaxEffectiveBalance uint64 `yaml:"MAX_EFFECTIVE_BALANCE" spec:"true"` // MaxEffectiveBalance is the maximal amount of Gwei that is effective for staking. EjectionBalance uint64 `yaml:"EJECTION_BALANCE" spec:"true"` // EjectionBalance is the minimal GWei a validator needs to have before ejected. EffectiveBalanceIncrement uint64 `yaml:"EFFECTIVE_BALANCE_INCREMENT" spec:"true"` // EffectiveBalanceIncrement is used for converting the high balance into the low balance for validators. @@ -48,6 +49,7 @@ type BeaconChainConfig struct { // Initial value constants. BLSWithdrawalPrefixByte byte `yaml:"BLS_WITHDRAWAL_PREFIX" spec:"true"` // BLSWithdrawalPrefixByte is used for BLS withdrawal and it's the first byte. ETH1AddressWithdrawalPrefixByte byte `yaml:"ETH1_ADDRESS_WITHDRAWAL_PREFIX" spec:"true"` // ETH1AddressWithdrawalPrefixByte is used for withdrawals and it's the first byte. + CompoundingWithdrawalPrefixByte byte `yaml:"COMPOUNDING_WITHDRAWAL_PREFIX" spec:"true"` // CompoundingWithdrawalPrefixByteByte is used for compounding withdrawals and it's the first byte. ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array. // Time parameters constants. @@ -97,12 +99,15 @@ type BeaconChainConfig struct { ProportionalSlashingMultiplier uint64 `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER" spec:"true"` // ProportionalSlashingMultiplier is used as a multiplier on slashed penalties. // Max operations per block constants. - MaxProposerSlashings uint64 `yaml:"MAX_PROPOSER_SLASHINGS" spec:"true"` // MaxProposerSlashings defines the maximum number of slashings of proposers possible in a block. - MaxAttesterSlashings uint64 `yaml:"MAX_ATTESTER_SLASHINGS" spec:"true"` // MaxAttesterSlashings defines the maximum number of casper FFG slashings possible in a block. - MaxAttestations uint64 `yaml:"MAX_ATTESTATIONS" spec:"true"` // MaxAttestations defines the maximum allowed attestations in a beacon block. - MaxDeposits uint64 `yaml:"MAX_DEPOSITS" spec:"true"` // MaxDeposits defines the maximum number of validator deposits in a block. - MaxVoluntaryExits uint64 `yaml:"MAX_VOLUNTARY_EXITS" spec:"true"` // MaxVoluntaryExits defines the maximum number of validator exits in a block. - MaxWithdrawalsPerPayload uint64 `yaml:"MAX_WITHDRAWALS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalsPerPayload defines the maximum number of withdrawals in a block. + MaxProposerSlashings uint64 `yaml:"MAX_PROPOSER_SLASHINGS" spec:"true"` // MaxProposerSlashings defines the maximum number of slashings of proposers possible in a block. + MaxAttesterSlashings uint64 `yaml:"MAX_ATTESTER_SLASHINGS" spec:"true"` // MaxAttesterSlashings defines the maximum number of casper FFG slashings possible in a block. + MaxAttesterSlashingsElectra uint64 `yaml:"MAX_ATTESTER_SLASHINGS_ELECTRA" spec:"true"` // MaxAttesterSlashingsElectra defines the maximum number of casper FFG slashings possible in a block post Electra hard fork. + MaxAttestations uint64 `yaml:"MAX_ATTESTATIONS" spec:"true"` // MaxAttestations defines the maximum allowed attestations in a beacon block. + MaxAttestationsElectra uint64 `yaml:"MAX_ATTESTATIONS_ELECTRA" spec:"true"` // MaxAttestationsElectra defines the maximum allowed attestations in a beacon block post Electra hard fork. + MaxDeposits uint64 `yaml:"MAX_DEPOSITS" spec:"true"` // MaxDeposits defines the maximum number of validator deposits in a block. + MaxVoluntaryExits uint64 `yaml:"MAX_VOLUNTARY_EXITS" spec:"true"` // MaxVoluntaryExits defines the maximum number of validator exits in a block. + MaxWithdrawalsPerPayload uint64 `yaml:"MAX_WITHDRAWALS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalsPerPayload defines the maximum number of withdrawals in a block. + MaxPartialWithdrawalsPerPayload uint64 `yaml:"MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD" spec:"true"` MaxBlsToExecutionChanges uint64 `yaml:"MAX_BLS_TO_EXECUTION_CHANGES" spec:"true"` // MaxBlsToExecutionChanges defines the maximum number of BLS-to-execution-change objects in a block. MaxValidatorsPerWithdrawalsSweep uint64 `yaml:"MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxValidatorsPerWithdrawalsSweep bounds the size of the sweep searching for withdrawals per slot. @@ -120,6 +125,7 @@ type BeaconChainConfig struct { DomainApplicationMask [4]byte `yaml:"DOMAIN_APPLICATION_MASK" spec:"true"` // DomainApplicationMask defines the BLS signature domain for application mask. DomainApplicationBuilder [4]byte `yaml:"DOMAIN_APPLICATION_BUILDER" spec:"true"` // DomainApplicationBuilder defines the BLS signature domain for application builder. DomainBLSToExecutionChange [4]byte `yaml:"DOMAIN_BLS_TO_EXECUTION_CHANGE" spec:"true"` // DomainBLSToExecutionChange defines the BLS signature domain to change withdrawal addresses to ETH1 prefix + DomainConsolidation [4]byte `yaml:"DOMAIN_CONSOLIDATION" spec:"true"` // Prysm constants. GweiPerEth uint64 // GweiPerEth is the amount of gwei corresponding to 1 eth. @@ -139,6 +145,7 @@ type BeaconChainConfig struct { BeaconStateBellatrixFieldCount int // BeaconStateBellatrixFieldCount defines how many fields are in beacon state post upgrade to Bellatrix. BeaconStateCapellaFieldCount int // BeaconStateCapellaFieldCount defines how many fields are in beacon state post upgrade to Capella. BeaconStateDenebFieldCount int // BeaconStateDenebFieldCount defines how many fields are in beacon state post upgrade to Deneb. + BeaconStateElectraFieldCount int // BeaconStateElectraFieldCount defines how many fields are in beacon state post upgrade to Electra. // Slasher constants. WeakSubjectivityPeriod primitives.Epoch // WeakSubjectivityPeriod defines the time period expressed in number of epochs were proof of stake network should validate block headers and attestations for slashable events. @@ -229,11 +236,20 @@ type BeaconChainConfig struct { MaxRequestBlocksDeneb uint64 `yaml:"MAX_REQUEST_BLOCKS_DENEB" spec:"true"` // MaxRequestBlocksDeneb is the maximum number of blocks in a single request after the deneb epoch. // Values introduce in Electra upgrade - NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix. - DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol - MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn. - MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra. - MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request + DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol + MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn. + MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra. + MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request + MaxEffectiveBalanceElectra uint64 `yaml:"MAX_EFFECTIVE_BALANCE_ELECTRA" spec:"true"` // MaxEffectiveBalanceElectra is the maximal amount of Gwei that is effective for staking, increased in electra. + MinSlashingPenaltyQuotientElectra uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA" spec:"true"` // MinSlashingPenaltyQuotientElectra is used to calculate the minimum penalty to prevent DoS attacks, modified for electra. + WhistleBlowerRewardQuotientElectra uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA" spec:"true"` // WhistleBlowerRewardQuotientElectra is used to calculate whistle blower reward, modified in electra. + PendingBalanceDepositLimit uint64 `yaml:"PENDING_BALANCE_DEPOSITS_LIMIT" spec:"true"` // PendingBalanceDepositLimit is the maximum number of pending balance deposits allowed in the beacon state. + PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT" spec:"true"` // PendingPartialWithdrawalsLimit is the maximum number of pending partial withdrawals allowed in the beacon state. + PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT" spec:"true"` // PendingConsolidationsLimit is the maximum number of pending validator consolidations allowed in the beacon state. + MaxConsolidations uint64 `yaml:"MAX_CONSOLIDATIONS" spec:"true"` // MaxConsolidations is the maximum number of consolidations in a block. + MaxPendingPartialsPerWithdrawalSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalSweep is the maximum number of pending partial withdrawals to process per payload. + FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit. + MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload. // Networking Specific Parameters GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE" spec:"true"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages. @@ -252,6 +268,9 @@ type BeaconChainConfig struct { AttestationSubnetPrefixBits uint64 `yaml:"ATTESTATION_SUBNET_PREFIX_BITS" spec:"true"` // AttestationSubnetPrefixBits is defined as (ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS). SubnetsPerNode uint64 `yaml:"SUBNETS_PER_NODE" spec:"true"` // SubnetsPerNode is the number of long-lived subnets a beacon node should be subscribed to. NodeIdBits uint64 `yaml:"NODE_ID_BITS" spec:"true"` // NodeIdBits defines the bit length of a node id. + + // PeerDAS + NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix. } // InitializeForkSchedule initializes the schedules forks baked into the config. diff --git a/config/params/loader_test.go b/config/params/loader_test.go index f653f8f28cd4..555682e30ded 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -24,13 +24,21 @@ import ( // These are variables that we don't use in Prysm. (i.e. future hardfork, light client... etc) // IMPORTANT: Use one field per line and sort these alphabetically to reduce conflicts. var placeholderFields = []string{ + "BYTES_PER_LOGS_BLOOM", // Compile time constant on ExecutionPayload.logs_bloom. "EIP6110_FORK_EPOCH", "EIP6110_FORK_VERSION", "EIP7002_FORK_EPOCH", "EIP7002_FORK_VERSION", "EIP7594_FORK_EPOCH", "EIP7594_FORK_VERSION", + "FIELD_ELEMENTS_PER_BLOB", // Compile time constant. + "KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", // Compile time constant on BlobSidecar.commitment_inclusion_proof. "MAX_BLOBS_PER_BLOCK", + "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_DEPOSIT_RECEIPTS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.deposit_receipts. + "MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. + "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. "REORG_HEAD_WEIGHT_THRESHOLD", "UPDATE_TIMEOUT", "WHISK_EPOCHS_PER_SHUFFLING_PHASE", @@ -342,9 +350,14 @@ func configFilePath(t *testing.T, config string) string { func presetsFilePath(t *testing.T, config string) []string { fPath, err := bazel.Runfile("external/consensus_spec") require.NoError(t, err) + return []string{ path.Join(fPath, "presets", config, "phase0.yaml"), path.Join(fPath, "presets", config, "altair.yaml"), + path.Join(fPath, "presets", config, "bellatrix.yaml"), + path.Join(fPath, "presets", config, "capella.yaml"), + path.Join(fPath, "presets", config, "deneb.yaml"), + path.Join(fPath, "presets", config, "electra.yaml"), } } diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 8f22c974d10d..c7ba47f71812 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -90,6 +90,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ // Initial value constants. BLSWithdrawalPrefixByte: byte(0), ETH1AddressWithdrawalPrefixByte: byte(1), + CompoundingWithdrawalPrefixByte: byte(2), ZeroHash: [32]byte{}, // Time parameter constants. @@ -147,7 +148,9 @@ var mainnetBeaconConfig = &BeaconChainConfig{ // Max operations per block constants. MaxProposerSlashings: 16, MaxAttesterSlashings: 2, + MaxAttesterSlashingsElectra: 1, MaxAttestations: 128, + MaxAttestationsElectra: 8, MaxDeposits: 16, MaxVoluntaryExits: 16, MaxWithdrawalsPerPayload: 16, @@ -168,6 +171,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ DomainApplicationMask: bytesutil.Uint32ToBytes4(0x00000001), DomainApplicationBuilder: bytesutil.Uint32ToBytes4(0x00000001), DomainBLSToExecutionChange: bytesutil.Uint32ToBytes4(0x0A000000), + DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000), // Prysm constants. GweiPerEth: 1000000000, @@ -189,6 +193,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ BeaconStateBellatrixFieldCount: 25, BeaconStateCapellaFieldCount: 28, BeaconStateDenebFieldCount: 28, + BeaconStateElectraFieldCount: 37, // Slasher related values. WeakSubjectivityPeriod: 54000, @@ -270,11 +275,21 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxRequestBlocksDeneb: 128, // Values related to electra - NumberOfColumns: 128, - MaxRequestDataColumnSidecars: 16384, - DataColumnSidecarSubnetCount: 32, - MinPerEpochChurnLimitElectra: 128000000000, - MaxPerEpochActivationExitChurnLimit: 256000000000, + MaxRequestDataColumnSidecars: 16384, + DataColumnSidecarSubnetCount: 32, + MinPerEpochChurnLimitElectra: 128_000_000_000, + MaxPerEpochActivationExitChurnLimit: 256_000_000_000, + MaxEffectiveBalanceElectra: 2048_000_000_000, + MinSlashingPenaltyQuotientElectra: 4096, + WhistleBlowerRewardQuotientElectra: 4096, + PendingBalanceDepositLimit: 134_217_728, + PendingPartialWithdrawalsLimit: 134_217_728, + PendingConsolidationsLimit: 262_144, + MinActivationBalance: 32_000_000_000, + MaxConsolidations: 1, + MaxPendingPartialsPerWithdrawalSweep: 8, + FullExitRequestAmount: 0, + MaxWithdrawalRequestsPerPayload: 16, // Values related to networking parameters. GossipMaxSize: 10 * 1 << 20, // 10 MiB @@ -293,6 +308,9 @@ var mainnetBeaconConfig = &BeaconChainConfig{ AttestationSubnetPrefixBits: 6, SubnetsPerNode: 2, NodeIdBits: 256, + + // PeerDAS + NumberOfColumns: 128, } // MainnetTestConfig provides a version of the mainnet config that has a different name diff --git a/config/params/minimal_config.go b/config/params/minimal_config.go index 7f4eb0273ffd..e008f6fd0e29 100644 --- a/config/params/minimal_config.go +++ b/config/params/minimal_config.go @@ -64,7 +64,9 @@ func MinimalSpecConfig() *BeaconChainConfig { // Max operations per block minimalConfig.MaxProposerSlashings = 16 minimalConfig.MaxAttesterSlashings = 2 + minimalConfig.MaxAttesterSlashingsElectra = 1 minimalConfig.MaxAttestations = 128 + minimalConfig.MaxAttestationsElectra = 8 minimalConfig.MaxDeposits = 16 minimalConfig.MaxVoluntaryExits = 16 minimalConfig.MaxWithdrawalsPerPayload = 4 @@ -92,7 +94,7 @@ func MinimalSpecConfig() *BeaconChainConfig { minimalConfig.DenebForkVersion = []byte{4, 0, 0, 1} minimalConfig.DenebForkEpoch = math.MaxUint64 minimalConfig.ElectraForkVersion = []byte{5, 0, 0, 1} - minimalConfig.AltairForkEpoch = math.MaxUint64 + minimalConfig.ElectraForkEpoch = math.MaxUint64 minimalConfig.SyncCommitteeSize = 32 minimalConfig.InactivityScoreBias = 4 @@ -102,6 +104,11 @@ func MinimalSpecConfig() *BeaconChainConfig { // New Electra params minimalConfig.MinPerEpochChurnLimitElectra = 64000000000 minimalConfig.MaxPerEpochActivationExitChurnLimit = 128000000000 + minimalConfig.PendingConsolidationsLimit = 64 + minimalConfig.MaxPartialWithdrawalsPerPayload = 1 + minimalConfig.MaxWithdrawalRequestsPerPayload = 2 + minimalConfig.PendingPartialWithdrawalsLimit = 64 + minimalConfig.MaxPendingPartialsPerWithdrawalSweep = 1 // Ethereum PoW parameters. minimalConfig.DepositChainID = 5 // Chain ID of eth1 goerli. From 3233e64acee35f18984cb20c160e58b4c4e652e6 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 25 Apr 2024 21:50:58 -0500 Subject: [PATCH 057/325] beacon-chain/cache: Convert tests to cache_test blackbox testing (#13920) * beacon-chain/cache: convert to blackbox tests (package cache_test) * Move balanceCacheKey to its own file to satisify go fuzz build --- beacon-chain/cache/BUILD.bazel | 3 ++ beacon-chain/cache/active_balance.go | 37 ---------------- beacon-chain/cache/active_balance_test.go | 31 ++++++------- beacon-chain/cache/balance_cache_key.go | 43 +++++++++++++++++++ beacon-chain/cache/checkpoint_state_test.go | 11 ++--- beacon-chain/cache/private_access_test.go | 18 ++++++++ .../cache/sync_committee_head_state_test.go | 5 ++- 7 files changed, 89 insertions(+), 59 deletions(-) create mode 100644 beacon-chain/cache/balance_cache_key.go create mode 100644 beacon-chain/cache/private_access_test.go diff --git a/beacon-chain/cache/BUILD.bazel b/beacon-chain/cache/BUILD.bazel index 52256c419379..8a0b9d7a99f0 100644 --- a/beacon-chain/cache/BUILD.bazel +++ b/beacon-chain/cache/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "active_balance.go", "active_balance_disabled.go", # keep "attestation_data.go", + "balance_cache_key.go", "checkpoint_state.go", "committee.go", "committee_disabled.go", # keep @@ -70,6 +71,7 @@ go_test( "committee_fuzz_test.go", "committee_test.go", "payload_id_test.go", + "private_access_test.go", "proposer_indices_test.go", "registration_test.go", "skip_slot_cache_test.go", @@ -93,6 +95,7 @@ go_test( "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_google_gofuzz//:go_default_library", + "@com_github_hashicorp_golang_lru//:go_default_library", "@com_github_stretchr_testify//require:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], diff --git a/beacon-chain/cache/active_balance.go b/beacon-chain/cache/active_balance.go index f79f5e896131..fb1bb50b9576 100644 --- a/beacon-chain/cache/active_balance.go +++ b/beacon-chain/cache/active_balance.go @@ -3,17 +3,13 @@ package cache import ( - "encoding/binary" "sync" lru "github.com/hashicorp/golang-lru" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) const ( @@ -86,36 +82,3 @@ func (c *BalanceCache) Get(st state.ReadOnlyBeaconState) (uint64, error) { balanceCacheHit.Inc() return value.(uint64), nil } - -// Given input state `st`, balance key is constructed as: -// (block_root in `st` at epoch_start_slot - 1) + current_epoch + validator_count -func balanceCacheKey(st state.ReadOnlyBeaconState) (string, error) { - slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch - currentEpoch := st.Slot().DivSlot(slotsPerEpoch) - epochStartSlot, err := slotsPerEpoch.SafeMul(uint64(currentEpoch)) - if err != nil { - // impossible condition due to early division - return "", errors.Errorf("start slot calculation overflows: %v", err) - } - prevSlot := primitives.Slot(0) - if epochStartSlot > 1 { - prevSlot = epochStartSlot - 1 - } - r, err := st.BlockRootAtIndex(uint64(prevSlot % params.BeaconConfig().SlotsPerHistoricalRoot)) - if err != nil { - // impossible condition because index is always constrained within state - return "", err - } - - // Mix in current epoch - b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, uint64(currentEpoch)) - key := append(r, b...) - - // Mix in validator count - b = make([]byte, 8) - binary.LittleEndian.PutUint64(b, uint64(st.NumValidators())) - key = append(key, b...) - - return string(key), nil -} diff --git a/beacon-chain/cache/active_balance_test.go b/beacon-chain/cache/active_balance_test.go index b821a6d1550a..e70315ca1361 100644 --- a/beacon-chain/cache/active_balance_test.go +++ b/beacon-chain/cache/active_balance_test.go @@ -1,12 +1,13 @@ //go:build !fuzz -package cache +package cache_test import ( "encoding/binary" "math" "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -27,33 +28,33 @@ func TestBalanceCache_AddGetBalance(t *testing.T) { st, err := state_native.InitializeFromProtoPhase0(raw) require.NoError(t, err) - cache := NewEffectiveBalanceCache() - _, err = cache.Get(st) - require.ErrorContains(t, ErrNotFound.Error(), err) + cc := cache.NewEffectiveBalanceCache() + _, err = cc.Get(st) + require.ErrorContains(t, cache.ErrNotFound.Error(), err) b := uint64(100) - require.NoError(t, cache.AddTotalEffectiveBalance(st, b)) - cachedB, err := cache.Get(st) + require.NoError(t, cc.AddTotalEffectiveBalance(st, b)) + cachedB, err := cc.Get(st) require.NoError(t, err) require.Equal(t, b, cachedB) require.NoError(t, st.SetSlot(1000)) - _, err = cache.Get(st) - require.ErrorContains(t, ErrNotFound.Error(), err) + _, err = cc.Get(st) + require.ErrorContains(t, cache.ErrNotFound.Error(), err) b = uint64(200) - require.NoError(t, cache.AddTotalEffectiveBalance(st, b)) - cachedB, err = cache.Get(st) + require.NoError(t, cc.AddTotalEffectiveBalance(st, b)) + cachedB, err = cc.Get(st) require.NoError(t, err) require.Equal(t, b, cachedB) require.NoError(t, st.SetSlot(1000+params.BeaconConfig().SlotsPerHistoricalRoot)) - _, err = cache.Get(st) - require.ErrorContains(t, ErrNotFound.Error(), err) + _, err = cc.Get(st) + require.ErrorContains(t, cache.ErrNotFound.Error(), err) b = uint64(300) - require.NoError(t, cache.AddTotalEffectiveBalance(st, b)) - cachedB, err = cache.Get(st) + require.NoError(t, cc.AddTotalEffectiveBalance(st, b)) + cachedB, err = cc.Get(st) require.NoError(t, err) require.Equal(t, b, cachedB) } @@ -72,6 +73,6 @@ func TestBalanceCache_BalanceKey(t *testing.T) { require.NoError(t, err) require.NoError(t, st.SetSlot(primitives.Slot(math.MaxUint64))) - _, err = balanceCacheKey(st) + _, err = cache.BalanceCacheKey(st) require.NoError(t, err) } diff --git a/beacon-chain/cache/balance_cache_key.go b/beacon-chain/cache/balance_cache_key.go new file mode 100644 index 000000000000..9c83d54a2a17 --- /dev/null +++ b/beacon-chain/cache/balance_cache_key.go @@ -0,0 +1,43 @@ +package cache + +import ( + "encoding/binary" + "fmt" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) + +// Given input state `st`, balance key is constructed as: +// (block_root in `st` at epoch_start_slot - 1) + current_epoch + validator_count +func balanceCacheKey(st state.ReadOnlyBeaconState) (string, error) { + slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch + currentEpoch := st.Slot().DivSlot(slotsPerEpoch) + epochStartSlot, err := slotsPerEpoch.SafeMul(uint64(currentEpoch)) + if err != nil { + // impossible condition due to early division + return "", fmt.Errorf("start slot calculation overflows: %w", err) + } + prevSlot := primitives.Slot(0) + if epochStartSlot > 1 { + prevSlot = epochStartSlot - 1 + } + r, err := st.BlockRootAtIndex(uint64(prevSlot % params.BeaconConfig().SlotsPerHistoricalRoot)) + if err != nil { + // impossible condition because index is always constrained within state + return "", err + } + + // Mix in current epoch + b := make([]byte, 8) + binary.LittleEndian.PutUint64(b, uint64(currentEpoch)) + key := append(r, b...) + + // Mix in validator count + b = make([]byte, 8) + binary.LittleEndian.PutUint64(b, uint64(st.NumValidators())) + key = append(key, b...) + + return string(key), nil +} diff --git a/beacon-chain/cache/checkpoint_state_test.go b/beacon-chain/cache/checkpoint_state_test.go index 13647b5f54f4..6426d7bc8997 100644 --- a/beacon-chain/cache/checkpoint_state_test.go +++ b/beacon-chain/cache/checkpoint_state_test.go @@ -1,8 +1,9 @@ -package cache +package cache_test import ( "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -15,7 +16,7 @@ import ( ) func TestCheckpointStateCache_StateByCheckpoint(t *testing.T) { - cache := NewCheckpointStateCache() + cache := cache.NewCheckpointStateCache() cp1 := ðpb.Checkpoint{Epoch: 1, Root: bytesutil.PadTo([]byte{'A'}, 32)} st, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ @@ -58,16 +59,16 @@ func TestCheckpointStateCache_StateByCheckpoint(t *testing.T) { } func TestCheckpointStateCache_MaxSize(t *testing.T) { - c := NewCheckpointStateCache() + c := cache.NewCheckpointStateCache() st, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ Slot: 0, }) require.NoError(t, err) - for i := uint64(0); i < uint64(maxCheckpointStateSize+100); i++ { + for i := uint64(0); i < uint64(cache.MaxCheckpointStateSize()+100); i++ { require.NoError(t, st.SetSlot(primitives.Slot(i))) require.NoError(t, c.AddCheckpointState(ðpb.Checkpoint{Epoch: primitives.Epoch(i), Root: make([]byte, 32)}, st)) } - assert.Equal(t, maxCheckpointStateSize, len(c.cache.Keys())) + assert.Equal(t, cache.MaxCheckpointStateSize(), len(c.Cache().Keys())) } diff --git a/beacon-chain/cache/private_access_test.go b/beacon-chain/cache/private_access_test.go new file mode 100644 index 000000000000..673fe9a3c75b --- /dev/null +++ b/beacon-chain/cache/private_access_test.go @@ -0,0 +1,18 @@ +package cache + +import ( + lru "github.com/hashicorp/golang-lru" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" +) + +func BalanceCacheKey(st state.ReadOnlyBeaconState) (string, error) { + return balanceCacheKey(st) +} + +func MaxCheckpointStateSize() int { + return maxCheckpointStateSize +} + +func (c *CheckpointStateCache) Cache() *lru.Cache { + return c.cache +} diff --git a/beacon-chain/cache/sync_committee_head_state_test.go b/beacon-chain/cache/sync_committee_head_state_test.go index 073e174946c2..fcb2202ed55c 100644 --- a/beacon-chain/cache/sync_committee_head_state_test.go +++ b/beacon-chain/cache/sync_committee_head_state_test.go @@ -1,8 +1,9 @@ -package cache +package cache_test import ( "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -125,7 +126,7 @@ func TestSyncCommitteeHeadState(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewSyncCommitteeHeadState() + c := cache.NewSyncCommitteeHeadState() if tt.put != nil { err := c.Put(tt.put.slot, tt.put.state) if (err != nil) != tt.wantPutErr { From 0e5c2bd18e0164e63ac85ddf185ad50a2ad914bd Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 26 Apr 2024 10:57:51 -0500 Subject: [PATCH 058/325] Electra: Minor proto changes, cloner additions (#13923) * Electra: more proto changes * Roundtrip test for cloners --- proto/prysm/v1alpha1/BUILD.bazel | 9 +- proto/prysm/v1alpha1/beacon_block.pb.go | 275 ++--- proto/prysm/v1alpha1/beacon_block.proto | 6 +- proto/prysm/v1alpha1/beacon_state.proto | 8 +- proto/prysm/v1alpha1/cloners.go | 308 ++++++ proto/prysm/v1alpha1/cloners_test.go | 432 ++++++++ proto/prysm/v1alpha1/eip_7251.go | 12 + proto/prysm/v1alpha1/eip_7251.pb.go | 118 ++- proto/prysm/v1alpha1/eip_7251.proto | 4 +- proto/prysm/v1alpha1/eip_7251_test.go | 21 + proto/prysm/v1alpha1/generated.ssz.go | 972 +++++++++++++++++- .../validator-client/keymanager.proto | 2 +- 12 files changed, 1965 insertions(+), 202 deletions(-) create mode 100644 proto/prysm/v1alpha1/eip_7251.go create mode 100644 proto/prysm/v1alpha1/eip_7251_test.go diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 77779515b070..a0a18f2cb944 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -79,6 +79,9 @@ ssz_gen_marshal( "SignedBeaconBlockContentsDeneb", "BlindedBeaconBlockDeneb", "BlindedBeaconBlockBodyDeneb", + "SignedBlindedBeaconBlockElectra", + "BlindedBeaconBlockElectra", + "BlindedBeaconBlockBodyElectra", "SyncAggregate", "SyncCommitteeMessage", "SyncCommitteeContribution", @@ -203,6 +206,7 @@ go_library( name = "go_default_library", srcs = [ "cloners.go", + "eip_7251.go", "sync_committee_mainnet.go", "sync_committee_minimal.go", # keep ":ssz_generated_files", # keep @@ -256,7 +260,10 @@ ssz_proto_files( go_test( name = "go_default_test", - srcs = ["cloners_test.go"], + srcs = [ + "cloners_test.go", + "eip_7251_test.go", + ], embed = [":go_default_library"], deps = [ "//testing/assert:go_default_library", diff --git a/proto/prysm/v1alpha1/beacon_block.pb.go b/proto/prysm/v1alpha1/beacon_block.pb.go index 837b7002ad8a..215e4b842d2c 100755 --- a/proto/prysm/v1alpha1/beacon_block.pb.go +++ b/proto/prysm/v1alpha1/beacon_block.pb.go @@ -3871,6 +3871,7 @@ type BlindedBeaconBlockBodyElectra struct { ExecutionPayloadHeader *v1.ExecutionPayloadHeaderElectra `protobuf:"bytes,10,opt,name=execution_payload_header,json=executionPayloadHeader,proto3" json:"execution_payload_header,omitempty"` BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + Consolidations []*SignedConsolidation `protobuf:"bytes,13,rep,name=consolidations,proto3" json:"consolidations,omitempty" ssz-max:"1"` } func (x *BlindedBeaconBlockBodyElectra) Reset() { @@ -3989,6 +3990,13 @@ func (x *BlindedBeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { return nil } +func (x *BlindedBeaconBlockBodyElectra) GetConsolidations() []*SignedConsolidation { + if x != nil { + return x.Consolidations + } + return nil +} + type ValidatorRegistrationV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5860,7 +5868,7 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0xdd, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x22, 0xb8, 0x08, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, @@ -5922,126 +5930,132 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, - 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, - 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x12, 0x59, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x0e, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, + 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, + 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, + 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, - 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, - 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, - 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9c, 0x01, + 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x01, 0x0a, + 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, + 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, + 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, - 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, - 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, - 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, - 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, - 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, - 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, - 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, - 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, - 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, - 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, - 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, - 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, - 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, - 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, - 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, - 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, - 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, + 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, + 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, + 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, + 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5e, 0x0a, 0x13, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x1a, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, 0x52, 0x18, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, + 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x42, 0x9b, 0x01, 0x0a, + 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, + 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -6272,21 +6286,22 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 19, // 136: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate 72, // 137: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra 65, // 138: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 50, // 139: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 - 48, // 140: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 - 63, // 141: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 51, // 142: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid - 67, // 143: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 53, // 144: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella - 68, // 145: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb - 55, // 146: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb - 16, // 147: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader - 57, // 148: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar - 149, // [149:149] is the sub-list for method output_type - 149, // [149:149] is the sub-list for method input_type - 149, // [149:149] is the sub-list for extension type_name - 149, // [149:149] is the sub-list for extension extendee - 0, // [0:149] is the sub-list for field type_name + 71, // 139: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.consolidations:type_name -> ethereum.eth.v1alpha1.SignedConsolidation + 50, // 140: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 + 48, // 141: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 + 63, // 142: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 51, // 143: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid + 67, // 144: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 53, // 145: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella + 68, // 146: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 55, // 147: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb + 16, // 148: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 57, // 149: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar + 150, // [150:150] is the sub-list for method output_type + 150, // [150:150] is the sub-list for method input_type + 150, // [150:150] is the sub-list for extension type_name + 150, // [150:150] is the sub-list for extension extendee + 0, // [0:150] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_block_proto_init() } diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index c7807e2003a4..a40dba62b81c 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -825,7 +825,7 @@ message BeaconBlockBodyElectra { repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; - repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in EIP-7251. + repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in Electra EIP-7251. } message SignedBlindedBeaconBlockElectra { @@ -889,6 +889,8 @@ message BlindedBeaconBlockBodyElectra { repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; + + repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in Electra EIP-7251. } message ValidatorRegistrationV1 { @@ -952,4 +954,4 @@ message BlobSidecar { message BlobSidecars { repeated BlobSidecar sidecars = 1 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"]; -} \ No newline at end of file +} diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index c180a12c70dd..3fb67903b15c 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -402,9 +402,9 @@ message BeaconStateElectra { uint64 earliest_exit_epoch = 12004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; uint64 consolidation_balance_to_consume = 12005; uint64 earliest_consolidation_epoch = 12006 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; - repeated PendingBalanceDeposit pending_balance_deposits = 12007 [(ethereum.eth.ext.ssz_max) = "134217728"]; - repeated PendingPartialWithdrawal pending_partial_withdrawals = 12008 [(ethereum.eth.ext.ssz_max) = "134217728"]; - repeated PendingConsolidation pending_consolidations = 12009 [(ethereum.eth.ext.ssz_max) = "262144"]; + repeated PendingBalanceDeposit pending_balance_deposits = 12007 [(ethereum.eth.ext.ssz_max) = "pending_balance_deposits_limit"]; + repeated PendingPartialWithdrawal pending_partial_withdrawals = 12008 [(ethereum.eth.ext.ssz_max) = "pending_partial_withdrawals_limit"]; + repeated PendingConsolidation pending_consolidations = 12009 [(ethereum.eth.ext.ssz_max) = "pending_consolidations_limit"]; } // PowBlock is a definition from Bellatrix fork choice spec to represent a block with total difficulty in the PoW chain. @@ -423,4 +423,4 @@ message PowBlock { message HistoricalSummary { bytes block_summary_root = 1 [(ethereum.eth.ext.ssz_size) = "32"]; bytes state_summary_root = 2 [(ethereum.eth.ext.ssz_size) = "32"]; -} \ No newline at end of file +} diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index fff56d2d1158..e67abbd566c2 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -56,6 +56,19 @@ func CopyAttestation(att *Attestation) *Attestation { } } +// CopyAttestationElectra copies the provided attestation object. +func CopyAttestationElectra(att *AttestationElectra) *AttestationElectra { + if att == nil { + return nil + } + return &AttestationElectra{ + AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits), + CommitteeBits: bytesutil.SafeCopyBytes(att.CommitteeBits), + Data: CopyAttestationData(att.Data), + Signature: bytesutil.SafeCopyBytes(att.Signature), + } +} + // CopyAttestationData copies the provided AttestationData object. func CopyAttestationData(attData *AttestationData) *AttestationData { if attData == nil { @@ -232,6 +245,21 @@ func CopyAttesterSlashings(slashings []*AttesterSlashing) []*AttesterSlashing { return newSlashings } +// CopyAttesterSlashingsElectra copies the provided AttesterSlashings array. +func CopyAttesterSlashingsElectra(slashings []*AttesterSlashingElectra) []*AttesterSlashingElectra { + if slashings == nil { + return nil + } + newSlashings := make([]*AttesterSlashingElectra, len(slashings)) + for i, slashing := range slashings { + newSlashings[i] = &AttesterSlashingElectra{ + Attestation_1: CopyIndexedAttestationElectra(slashing.Attestation_1), + Attestation_2: CopyIndexedAttestationElectra(slashing.Attestation_2), + } + } + return newSlashings +} + // CopyIndexedAttestation copies the provided IndexedAttestation. func CopyIndexedAttestation(indexedAtt *IndexedAttestation) *IndexedAttestation { var indices []uint64 @@ -248,6 +276,22 @@ func CopyIndexedAttestation(indexedAtt *IndexedAttestation) *IndexedAttestation } } +// CopyIndexedAttestationElectra copies the provided IndexedAttestation. +func CopyIndexedAttestationElectra(indexedAtt *IndexedAttestationElectra) *IndexedAttestationElectra { + var indices []uint64 + if indexedAtt == nil { + return nil + } else if indexedAtt.AttestingIndices != nil { + indices = make([]uint64, len(indexedAtt.AttestingIndices)) + copy(indices, indexedAtt.AttestingIndices) + } + return &IndexedAttestationElectra{ + AttestingIndices: indices, + Data: CopyAttestationData(indexedAtt.Data), + Signature: bytesutil.SafeCopyBytes(indexedAtt.Signature), + } +} + // CopyAttestations copies the provided Attestation array. func CopyAttestations(attestations []*Attestation) []*Attestation { if attestations == nil { @@ -260,6 +304,18 @@ func CopyAttestations(attestations []*Attestation) []*Attestation { return newAttestations } +// CopyAttestations copies the provided AttestationElectra array. +func CopyAttestationsElectra(attestations []*AttestationElectra) []*AttestationElectra { + if attestations == nil { + return nil + } + newAttestations := make([]*AttestationElectra, len(attestations)) + for i, att := range attestations { + newAttestations[i] = CopyAttestationElectra(att) + } + return newAttestations +} + // CopyDeposits copies the provided deposit array. func CopyDeposits(deposits []*Deposit) []*Deposit { if deposits == nil { @@ -558,6 +614,78 @@ func CopyBlindedBeaconBlockBodyDeneb(body *BlindedBeaconBlockBodyDeneb) *Blinded } } +// CopySignedBlindedBeaconBlockElectra copies the provided SignedBlindedBeaconBlockElectra. +func CopySignedBlindedBeaconBlockElectra(sigBlock *SignedBlindedBeaconBlockElectra) *SignedBlindedBeaconBlockElectra { + if sigBlock == nil { + return nil + } + return &SignedBlindedBeaconBlockElectra{ + Message: CopyBlindedBeaconBlockElectra(sigBlock.Message), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// CopyBlindedBeaconBlockElectra copies the provided BlindedBeaconBlockElectra. +func CopyBlindedBeaconBlockElectra(block *BlindedBeaconBlockElectra) *BlindedBeaconBlockElectra { + if block == nil { + return nil + } + return &BlindedBeaconBlockElectra{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: CopyBlindedBeaconBlockBodyElectra(block.Body), + } +} + +// CopyBlindedBeaconBlockBodyElectra copies the provided BlindedBeaconBlockBodyElectra. +func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *BlindedBeaconBlockBodyElectra { + if body == nil { + return nil + } + return &BlindedBeaconBlockBodyElectra{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: CopyETH1Data(body.Eth1Data), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), + AttesterSlashings: CopyAttesterSlashingsElectra(body.AttesterSlashings), + Attestations: CopyAttestationsElectra(body.Attestations), + Deposits: CopyDeposits(body.Deposits), + VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), + SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ExecutionPayloadHeader: CopyExecutionPayloadHeaderElectra(body.ExecutionPayloadHeader), + BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + Consolidations: CopySignedConsolidations(body.Consolidations), + } +} + +func CopySignedConsolidations(c []*SignedConsolidation) []*SignedConsolidation { + if c == nil { + return nil + } + newC := make([]*SignedConsolidation, len(c)) + for i, cc := range c { + newC[i] = CopySignedConsolidation(cc) + } + return newC +} + +func CopySignedConsolidation(c *SignedConsolidation) *SignedConsolidation { + if c == nil { + return nil + } + return &SignedConsolidation{ + Message: &Consolidation{ + SourceIndex: c.Message.SourceIndex, + TargetIndex: c.Message.TargetIndex, + Epoch: c.Message.Epoch, + }, + Signature: bytesutil.SafeCopyBytes(c.Signature), + } +} + // CopyExecutionPayload copies the provided execution payload. func CopyExecutionPayload(payload *enginev1.ExecutionPayload) *enginev1.ExecutionPayload { if payload == nil { @@ -848,6 +976,142 @@ func CopyExecutionPayloadDeneb(payload *enginev1.ExecutionPayloadDeneb) *enginev } } +// CopySignedBeaconBlockElectra copies the provided SignedBeaconBlockElectra. +func CopySignedBeaconBlockElectra(sigBlock *SignedBeaconBlockElectra) *SignedBeaconBlockElectra { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlockElectra{ + Block: CopyBeaconBlockElectra(sigBlock.Block), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// CopyBeaconBlockElectra copies the provided BeaconBlockElectra. +func CopyBeaconBlockElectra(block *BeaconBlockElectra) *BeaconBlockElectra { + if block == nil { + return nil + } + return &BeaconBlockElectra{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: CopyBeaconBlockBodyElectra(block.Body), + } +} + +// CopyBeaconBlockBodyElectra copies the provided BeaconBlockBodyElectra. +func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyElectra { + if body == nil { + return nil + } + return &BeaconBlockBodyElectra{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: CopyETH1Data(body.Eth1Data), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), + AttesterSlashings: CopyAttesterSlashingsElectra(body.AttesterSlashings), + Attestations: CopyAttestationsElectra(body.Attestations), + Deposits: CopyDeposits(body.Deposits), + VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), + SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ExecutionPayload: CopyExecutionPayloadElectra(body.ExecutionPayload), + BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + Consolidations: CopySignedConsolidations(body.Consolidations), + } +} + +// CopyExecutionPayloadElectra copies the provided execution payload. +func CopyExecutionPayloadElectra(payload *enginev1.ExecutionPayloadElectra) *enginev1.ExecutionPayloadElectra { + if payload == nil { + return nil + } + return &enginev1.ExecutionPayloadElectra{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), + Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + DepositReceipts: CopyDepositReceipts(payload.DepositReceipts), + WithdrawalRequests: CopyWithdrawalRequests(payload.WithdrawalRequests), + } +} + +func CopyDepositReceipts(dr []*enginev1.DepositReceipt) []*enginev1.DepositReceipt { + if dr == nil { + return nil + } + + newDr := make([]*enginev1.DepositReceipt, len(dr)) + for i, d := range dr { + newDr[i] = &enginev1.DepositReceipt{ + Pubkey: bytesutil.SafeCopyBytes(d.Pubkey), + WithdrawalCredentials: bytesutil.SafeCopyBytes(d.WithdrawalCredentials), + Amount: d.Amount, + Signature: bytesutil.SafeCopyBytes(d.Signature), + Index: d.Index, + } + } + return newDr +} + +func CopyWithdrawalRequests(wr []*enginev1.ExecutionLayerWithdrawalRequest) []*enginev1.ExecutionLayerWithdrawalRequest { + if wr == nil { + return nil + } + newWr := make([]*enginev1.ExecutionLayerWithdrawalRequest, len(wr)) + for i, w := range wr { + newWr[i] = &enginev1.ExecutionLayerWithdrawalRequest{ + SourceAddress: bytesutil.SafeCopyBytes(w.SourceAddress), + ValidatorPubkey: bytesutil.SafeCopyBytes(w.ValidatorPubkey), + Amount: w.Amount, + } + } + + return newWr +} + +func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderElectra) *enginev1.ExecutionPayloadHeaderElectra { + if payload == nil { + return nil + } + return &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), + WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + DepositReceiptsRoot: bytesutil.SafeCopyBytes(payload.DepositReceiptsRoot), + WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), + } +} + // CopyHistoricalSummaries copies the historical summaries. func CopyHistoricalSummaries(summaries []*HistoricalSummary) []*HistoricalSummary { if summaries == nil { @@ -862,3 +1126,47 @@ func CopyHistoricalSummaries(summaries []*HistoricalSummary) []*HistoricalSummar } return newSummaries } + +// CopyPartialWithdrawals copies the provided partial withdrawals. +func CopyPendingPartialWithdrawals(pws []*PendingPartialWithdrawal) []*PendingPartialWithdrawal { + if pws == nil { + return nil + } + newPws := make([]*PendingPartialWithdrawal, len(pws)) + for i, pw := range pws { + newPws[i] = &PendingPartialWithdrawal{ + Index: pw.Index, + Amount: pw.Amount, + WithdrawableEpoch: pw.WithdrawableEpoch, + } + } + return newPws +} + +func CopyPendingConsolidations(pcs []*PendingConsolidation) []*PendingConsolidation { + if pcs == nil { + return nil + } + newPcs := make([]*PendingConsolidation, len(pcs)) + for i, pc := range pcs { + newPcs[i] = &PendingConsolidation{ + SourceIndex: pc.SourceIndex, + TargetIndex: pc.TargetIndex, + } + } + return newPcs +} + +func CopyPendingBalanceDeposits(pbd []*PendingBalanceDeposit) []*PendingBalanceDeposit { + if pbd == nil { + return nil + } + newPbd := make([]*PendingBalanceDeposit, len(pbd)) + for i, pb := range pbd { + newPbd[i] = &PendingBalanceDeposit{ + Index: pb.Index, + Amount: pb.Amount, + } + } + return newPbd +} diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 6ea6ce0dcb88..d0d5f885451c 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -568,6 +568,177 @@ func TestCopyHistoricalSummaries(t *testing.T) { } } +func TestCopyAttestationElectra(t *testing.T) { + att := genAttestationElectra() + + got := v1alpha1.CopyAttestationElectra(att) + if !reflect.DeepEqual(got, att) { + t.Errorf("TestCopyAttestationElectra() = %v, want %v", got, att) + } +} + +func TestCopyAttesterSlashingsElectra(t *testing.T) { + as := genAttesterSlashingsElectra(10) + + got := v1alpha1.CopyAttesterSlashingsElectra(as) + if !reflect.DeepEqual(got, as) { + t.Errorf("TestCopyAttesterSlashingsElectra() = %v, want %v", got, as) + } +} + +func TestCopyIndexedAttestationElectra(t *testing.T) { + ia := genIndexedAttestationElectra() + + got := v1alpha1.CopyIndexedAttestationElectra(ia) + if !reflect.DeepEqual(got, ia) { + t.Errorf("TestCopyIndexedAttestationElectra() = %v, want %v", got, ia) + } +} + +func TestCopyAttestationsElectra(t *testing.T) { + atts := genAttestationsElectra(10) + + got := v1alpha1.CopyAttestationsElectra(atts) + if !reflect.DeepEqual(got, atts) { + t.Errorf("TestCopyAttestationsElectra() = %v, want %v", got, atts) + } +} + +func TestCopySignedBlindedBeaconBlockElectra(t *testing.T) { + sbb := genSignedBlindedBeaconBlockElectra() + + got := v1alpha1.CopySignedBlindedBeaconBlockElectra(sbb) + if !reflect.DeepEqual(got, sbb) { + t.Errorf("TestCopySignedBlindedBeaconBlockElectra() = %v, want %v", got, sbb) + } +} + +func TestCopyBlindedBeaconBlockElectra(t *testing.T) { + b := genBlindedBeaconBlockElectra() + + got := v1alpha1.CopyBlindedBeaconBlockElectra(b) + if !reflect.DeepEqual(got, b) { + t.Errorf("TestCopyBlindedBeaconBlockElectra() = %v, want %v", got, b) + } +} + +func TestCopyBlindedBeaconBlockBodyElectra(t *testing.T) { + bb := genBlindedBeaconBlockBodyElectra() + + got := v1alpha1.CopyBlindedBeaconBlockBodyElectra(bb) + if !reflect.DeepEqual(got, bb) { + t.Errorf("TestCopyBlindedBeaconBlockBodyElectra() = %v, want %v", got, bb) + } +} + +func TestCopySignedConsolidations(t *testing.T) { + cs := genSignedConsolidations(10) + + got := v1alpha1.CopySignedConsolidations(cs) + if !reflect.DeepEqual(got, cs) { + t.Errorf("TestCopySignedConsolidations() = %v, want %v", got, cs) + } +} + +func TestCopySignedConsolidation(t *testing.T) { + c := genSignedConsolidation() + + got := v1alpha1.CopySignedConsolidation(c) + if !reflect.DeepEqual(got, c) { + t.Errorf("TestCopySignedConsolidation() = %v, want %v", got, c) + } +} + +func TestCopySignedBeaconBlockElectra(t *testing.T) { + sbb := genSignedBeaconBlockElectra() + + got := v1alpha1.CopySignedBeaconBlockElectra(sbb) + if !reflect.DeepEqual(got, sbb) { + t.Errorf("TestCopySignedBeaconBlockElectra() = %v, want %v", got, sbb) + } +} + +func TestCopyBeaconBlockElectra(t *testing.T) { + b := genBeaconBlockElectra() + + got := v1alpha1.CopyBeaconBlockElectra(b) + if !reflect.DeepEqual(got, b) { + t.Errorf("TestCopyBeaconBlockElectra() = %v, want %v", got, b) + } +} + +func TestCopyBeaconBlockBodyElectra(t *testing.T) { + bb := genBeaconBlockBodyElectra() + + got := v1alpha1.CopyBeaconBlockBodyElectra(bb) + if !reflect.DeepEqual(got, bb) { + t.Errorf("TestCopyBeaconBlockBodyElectra() = %v, want %v", got, bb) + } +} + +func TestCopyExecutionPayloadElectra(t *testing.T) { + p := genExecutionPayloadElectra() + + got := v1alpha1.CopyExecutionPayloadElectra(p) + if !reflect.DeepEqual(got, p) { + t.Errorf("TestCopyExecutionPayloadElectra() = %v, want %v", got, p) + } +} + +func TestCopyDepositReceipts(t *testing.T) { + drs := genDepositReceipts(10) + + got := v1alpha1.CopyDepositReceipts(drs) + if !reflect.DeepEqual(got, drs) { + t.Errorf("TestCopyDepositReceipts() = %v, want %v", got, drs) + } +} + +func TestCopyWithdrawalRequests(t *testing.T) { + wrs := genWithdrawalRequests(10) + + got := v1alpha1.CopyWithdrawalRequests(wrs) + if !reflect.DeepEqual(got, wrs) { + t.Errorf("TestCopyWithdrawalRequests() = %v, want %v", got, wrs) + } +} + +func TestCopyExecutionPayloadHeaderElectra(t *testing.T) { + p := genExecutionPayloadHeaderElectra() + + got := v1alpha1.CopyExecutionPayloadHeaderElectra(p) + if !reflect.DeepEqual(got, p) { + t.Errorf("TestCopyExecutionPayloadHeaderElectra() = %v, want %v", got, p) + } +} + +func TestCopyPendingPartialWithdrawals(t *testing.T) { + ppws := genPendingPartialWithdrawals(10) + + got := v1alpha1.CopyPendingPartialWithdrawals(ppws) + if !reflect.DeepEqual(got, ppws) { + t.Errorf("TestCopyPendingPartialWithdrawals() = %v, want %v", got, ppws) + } +} + +func TestCopyPendingConsolidations(t *testing.T) { + pcs := genPendingConsolidations(10) + + got := v1alpha1.CopyPendingConsolidations(pcs) + if !reflect.DeepEqual(got, pcs) { + t.Errorf("TestCopyPendingConsolidations() = %v, want %v", got, pcs) + } +} + +func TestCopyPendingBalanceDeposits(t *testing.T) { + pbds := genPendingBalanceDeposits(10) + + got := v1alpha1.CopyPendingBalanceDeposits(pbds) + if !reflect.DeepEqual(got, pbds) { + t.Errorf("TestCopyPendingBalanceDeposits() = %v, want %v", got, pbds) + } +} + func genAttestation() *v1alpha1.Attestation { return &v1alpha1.Attestation{ AggregationBits: bytes(32), @@ -1176,3 +1347,264 @@ func genBLSToExecutionChange() *v1alpha1.SignedBLSToExecutionChange { Signature: bytes(96), } } + +func genAttestationElectra() *v1alpha1.AttestationElectra { + return &v1alpha1.AttestationElectra{ + AggregationBits: bytes(32), + CommitteeBits: bytes(8), + Data: genAttData(), + Signature: bytes(96), + } +} + +func genAttesterSlashingsElectra(num int) []*v1alpha1.AttesterSlashingElectra { + as := make([]*v1alpha1.AttesterSlashingElectra, num) + for i := 0; i < num; i++ { + as[i] = genAttesterSlashingElectra() + } + return as +} + +func genAttesterSlashingElectra() *v1alpha1.AttesterSlashingElectra { + return &v1alpha1.AttesterSlashingElectra{ + Attestation_1: genIndexedAttestationElectra(), + Attestation_2: genIndexedAttestationElectra(), + } +} + +func genIndexedAttestationElectra() *v1alpha1.IndexedAttestationElectra { + return &v1alpha1.IndexedAttestationElectra{ + AttestingIndices: []uint64{1, 2, 3}, + Data: genAttData(), + Signature: bytes(96), + } +} + +func genAttestationsElectra(num int) []*v1alpha1.AttestationElectra { + atts := make([]*v1alpha1.AttestationElectra, num) + for i := 0; i < num; i++ { + atts[i] = genAttestationElectra() + } + return atts +} + +func genSignedBlindedBeaconBlockElectra() *v1alpha1.SignedBlindedBeaconBlockElectra { + return &v1alpha1.SignedBlindedBeaconBlockElectra{ + Message: genBlindedBeaconBlockElectra(), + Signature: bytes(96), + } +} + +func genBlindedBeaconBlockElectra() *v1alpha1.BlindedBeaconBlockElectra { + return &v1alpha1.BlindedBeaconBlockElectra{ + Slot: 123455, + ProposerIndex: 55433, + ParentRoot: bytes(32), + StateRoot: bytes(32), + Body: genBlindedBeaconBlockBodyElectra(), + } +} + +func genBlindedBeaconBlockBodyElectra() *v1alpha1.BlindedBeaconBlockBodyElectra { + return &v1alpha1.BlindedBeaconBlockBodyElectra{ + RandaoReveal: bytes(96), + Eth1Data: genEth1Data(), + Graffiti: bytes(32), + ProposerSlashings: genProposerSlashings(5), + AttesterSlashings: genAttesterSlashingsElectra(5), + Attestations: genAttestationsElectra(10), + Deposits: genDeposits(5), + VoluntaryExits: genSignedVoluntaryExits(12), + SyncAggregate: genSyncAggregate(), + ExecutionPayloadHeader: genExecutionPayloadHeaderElectra(), + BlsToExecutionChanges: genBLSToExecutionChanges(10), + BlobKzgCommitments: getKZGCommitments(4), + Consolidations: genSignedConsolidations(5), + } +} + +func genExecutionPayloadHeaderElectra() *enginev1.ExecutionPayloadHeaderElectra { + return &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: bytes(32), + FeeRecipient: bytes(20), + StateRoot: bytes(32), + ReceiptsRoot: bytes(32), + LogsBloom: bytes(256), + PrevRandao: bytes(32), + BlockNumber: 1, + GasLimit: 2, + GasUsed: 3, + Timestamp: 4, + ExtraData: bytes(32), + BaseFeePerGas: bytes(32), + BlockHash: bytes(32), + TransactionsRoot: bytes(32), + WithdrawalsRoot: bytes(32), + BlobGasUsed: 5, + ExcessBlobGas: 6, + DepositReceiptsRoot: bytes(32), + WithdrawalRequestsRoot: bytes(32), + } +} + +func genSignedConsolidations(num int) []*v1alpha1.SignedConsolidation { + cs := make([]*v1alpha1.SignedConsolidation, num) + for i := 0; i < num; i++ { + cs[i] = genSignedConsolidation() + } + return cs +} + +func genSignedConsolidation() *v1alpha1.SignedConsolidation { + return &v1alpha1.SignedConsolidation{ + Message: genConsolidation(), + Signature: bytes(96), + } +} + +func genConsolidation() *v1alpha1.Consolidation { + return &v1alpha1.Consolidation{ + SourceIndex: 1, + TargetIndex: 2, + Epoch: 3, + } +} + +func genSignedBeaconBlockElectra() *v1alpha1.SignedBeaconBlockElectra { + return &v1alpha1.SignedBeaconBlockElectra{ + Block: genBeaconBlockElectra(), + Signature: bytes(96), + } +} + +func genBeaconBlockElectra() *v1alpha1.BeaconBlockElectra { + return &v1alpha1.BeaconBlockElectra{ + Slot: 123455, + ProposerIndex: 55433, + ParentRoot: bytes(32), + StateRoot: bytes(32), + Body: genBeaconBlockBodyElectra(), + } +} + +func genBeaconBlockBodyElectra() *v1alpha1.BeaconBlockBodyElectra { + return &v1alpha1.BeaconBlockBodyElectra{ + RandaoReveal: bytes(96), + Eth1Data: genEth1Data(), + Graffiti: bytes(32), + ProposerSlashings: genProposerSlashings(5), + AttesterSlashings: genAttesterSlashingsElectra(5), + Attestations: genAttestationsElectra(10), + Deposits: genDeposits(5), + VoluntaryExits: genSignedVoluntaryExits(12), + SyncAggregate: genSyncAggregate(), + ExecutionPayload: genExecutionPayloadElectra(), + BlsToExecutionChanges: genBLSToExecutionChanges(10), + BlobKzgCommitments: getKZGCommitments(4), + Consolidations: genSignedConsolidations(5), + } +} + +func genExecutionPayloadElectra() *enginev1.ExecutionPayloadElectra { + return &enginev1.ExecutionPayloadElectra{ + ParentHash: bytes(32), + FeeRecipient: bytes(20), + StateRoot: bytes(32), + ReceiptsRoot: bytes(32), + LogsBloom: bytes(256), + PrevRandao: bytes(32), + BlockNumber: 1, + GasLimit: 2, + GasUsed: 3, + Timestamp: 4, + ExtraData: bytes(32), + BaseFeePerGas: bytes(32), + BlockHash: bytes(32), + Transactions: [][]byte{{'a'}, {'b'}, {'c'}}, + Withdrawals: genWithdrawals(10), + BlobGasUsed: 5, + ExcessBlobGas: 6, + DepositReceipts: genDepositReceipts(10), + WithdrawalRequests: genWithdrawalRequests(10), + } +} + +func genDepositReceipts(num int) []*enginev1.DepositReceipt { + drs := make([]*enginev1.DepositReceipt, num) + for i := 0; i < num; i++ { + drs[i] = genDepositReceipt() + } + return drs +} + +func genDepositReceipt() *enginev1.DepositReceipt { + return &enginev1.DepositReceipt{ + Pubkey: bytes(48), + WithdrawalCredentials: bytes(32), + Amount: 55555, + Signature: bytes(96), + Index: 123444, + } +} + +func genWithdrawalRequests(num int) []*enginev1.ExecutionLayerWithdrawalRequest { + wrs := make([]*enginev1.ExecutionLayerWithdrawalRequest, num) + for i := 0; i < num; i++ { + wrs[i] = genWithdrawalRequest() + } + return wrs +} + +func genWithdrawalRequest() *enginev1.ExecutionLayerWithdrawalRequest { + return &enginev1.ExecutionLayerWithdrawalRequest{ + SourceAddress: bytes(20), + ValidatorPubkey: bytes(48), + Amount: 55555, + } +} + +func genPendingPartialWithdrawals(num int) []*v1alpha1.PendingPartialWithdrawal { + ppws := make([]*v1alpha1.PendingPartialWithdrawal, num) + for i := 0; i < num; i++ { + ppws[i] = genPendingPartialWithdrawal() + } + return ppws +} + +func genPendingPartialWithdrawal() *v1alpha1.PendingPartialWithdrawal { + return &v1alpha1.PendingPartialWithdrawal{ + Index: 123456, + Amount: 55555, + WithdrawableEpoch: 444444, + } +} + +func genPendingConsolidations(num int) []*v1alpha1.PendingConsolidation { + pcs := make([]*v1alpha1.PendingConsolidation, num) + for i := 0; i < num; i++ { + pcs[i] = genPendingConsolidation() + } + return pcs +} + +func genPendingConsolidation() *v1alpha1.PendingConsolidation { + return &v1alpha1.PendingConsolidation{ + SourceIndex: 1, + TargetIndex: 2, + } +} + +func genPendingBalanceDeposits(num int) []*v1alpha1.PendingBalanceDeposit { + pbds := make([]*v1alpha1.PendingBalanceDeposit, num) + for i := 0; i < num; i++ { + pbds[i] = genPendingBalanceDeposit() + } + return pbds +} + +func genPendingBalanceDeposit() *v1alpha1.PendingBalanceDeposit { + return &v1alpha1.PendingBalanceDeposit{ + Index: 123456, + Amount: 55555, + } +} diff --git a/proto/prysm/v1alpha1/eip_7251.go b/proto/prysm/v1alpha1/eip_7251.go new file mode 100644 index 000000000000..cfaec4267490 --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7251.go @@ -0,0 +1,12 @@ +package eth + +func (c *Consolidation) ToPendingConsolidation() *PendingConsolidation { + if c == nil { + return nil + } + p := &PendingConsolidation{ + SourceIndex: c.SourceIndex, + TargetIndex: c.TargetIndex, + } + return p +} diff --git a/proto/prysm/v1alpha1/eip_7251.pb.go b/proto/prysm/v1alpha1/eip_7251.pb.go index 5386d5e9f141..7330ffeb7206 100755 --- a/proto/prysm/v1alpha1/eip_7251.pb.go +++ b/proto/prysm/v1alpha1/eip_7251.pb.go @@ -85,7 +85,7 @@ type PendingPartialWithdrawal struct { Index github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - WithdrawableEpoch uint64 `protobuf:"varint,3,opt,name=withdrawable_epoch,json=withdrawableEpoch,proto3" json:"withdrawable_epoch,omitempty"` + WithdrawableEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=withdrawable_epoch,json=withdrawableEpoch,proto3" json:"withdrawable_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` } func (x *PendingPartialWithdrawal) Reset() { @@ -134,11 +134,11 @@ func (x *PendingPartialWithdrawal) GetAmount() uint64 { return 0 } -func (x *PendingPartialWithdrawal) GetWithdrawableEpoch() uint64 { +func (x *PendingPartialWithdrawal) GetWithdrawableEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { if x != nil { return x.WithdrawableEpoch } - return 0 + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) } type Consolidation struct { @@ -332,7 +332,7 @@ var file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = []byte{ 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0xc8, 0x01, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, + 0x6e, 0x74, 0x22, 0x90, 0x02, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, @@ -341,66 +341,70 @@ var file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = []byte{ 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x75, 0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xd5, 0x02, - 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x7b, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, - 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xd5, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, + 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32, 0x35, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, + 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x7b, 0x0a, + 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, + 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, - 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19, + 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32, + 0x35, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/prysm/v1alpha1/eip_7251.proto b/proto/prysm/v1alpha1/eip_7251.proto index 43aede682a8b..a587337cf02e 100644 --- a/proto/prysm/v1alpha1/eip_7251.proto +++ b/proto/prysm/v1alpha1/eip_7251.proto @@ -40,10 +40,9 @@ message PendingPartialWithdrawal { uint64 amount = 2; // A partial withdrawal is valid at this epoch or later. - uint64 withdrawable_epoch = 3; + uint64 withdrawable_epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; } - message Consolidation { // Validator from which the funds will be moved. uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; @@ -53,7 +52,6 @@ message Consolidation { uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; } - message SignedConsolidation { // The unsigned consolidation itself. Consolidation message = 1; diff --git a/proto/prysm/v1alpha1/eip_7251_test.go b/proto/prysm/v1alpha1/eip_7251_test.go new file mode 100644 index 000000000000..8f571d14a86c --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7251_test.go @@ -0,0 +1,21 @@ +package eth_test + +import ( + "testing" + + v1alpha1 "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" +) + +func TestConsolidation_ToPendingConsolidation(t *testing.T) { + c := v1alpha1.Consolidation{ + SourceIndex: 1, + TargetIndex: 2, + Epoch: 3, + } + + pc := c.ToPendingConsolidation() + + assert.Equal(t, c.SourceIndex, pc.SourceIndex) + assert.Equal(t, c.TargetIndex, pc.TargetIndex) +} diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index d1ac18d870a0..3bc5fc7a64b6 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 27607f699654c05a3711ca64479cd5d8a35ac9807f5e76116d2894a25362b20f +// Hash: f5dca4cd73e0ede007a079469da9c22998b793f769c4ce4da279ac910c6fd9b2 package eth import ( @@ -10172,6 +10172,970 @@ func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockElectra object to a target array +func (s *SignedBlindedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BlindedBeaconBlockElectra) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BlindedBeaconBlockElectra) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindedBeaconBlockElectra) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockElectra object with a hasher +func (s *SignedBlindedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockElectra object to a target array +func (b *BlindedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyElectra) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 < 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyElectra) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyElectra) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockElectra object with a hasher +func (b *BlindedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array +func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(396) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + offset += b.ExecutionPayloadHeader.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Offset (11) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Offset (12) 'Consolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Consolidations) * 120 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 1 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 8 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 8) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayloadHeader' + if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.BlobKzgCommitments[ii]...) + } + + // Field (12) 'Consolidations' + if size := len(b.Consolidations); size > 1 { + err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) + return + } + for ii := 0; ii < len(b.Consolidations); ii++ { + if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 396 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 < 396 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayloadHeader' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Offset (11) 'BlobKzgCommitments' + if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Consolidations' + if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 1) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashingElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashingElectra) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 8) + if err != nil { + return err + } + b.Attestations = make([]*AttestationElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(AttestationElectra) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayloadHeader' + { + buf = tail[o9:o10] + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:o11] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + + // Field (11) 'BlobKzgCommitments' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (12) 'Consolidations' + { + buf = tail[o12:] + num, err := ssz.DivideInt2(len(buf), 120, 1) + if err != nil { + return err + } + b.Consolidations = make([]*SignedConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.Consolidations[ii] == nil { + b.Consolidations[ii] = new(SignedConsolidation) + } + if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { + size = 396 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayloadHeader' + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + size += b.ExecutionPayloadHeader.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + // Field (12) 'Consolidations' + size += len(b.Consolidations) * 120 + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyElectra object with a hasher +func (b *BlindedBeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1) + } + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 8 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8) + } else { + hh.MerkleizeWithMixin(subIndx, num, 8) + } + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayloadHeader' + if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) + } else { + hh.MerkleizeWithMixin(subIndx, num, 16) + } + } + + // Field (11) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) + } else { + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + } + + // Field (12) 'Consolidations' + { + subIndx := hh.Index() + num := uint64(len(b.Consolidations)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Consolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + if ssz.EnableVectorizedHTR { + hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) + } else { + hh.MerkleizeWithMixin(subIndx, num, 1) + } + } + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the ValidatorRegistrationV1 object func (v *ValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(v) @@ -18032,7 +18996,7 @@ func (p *PendingPartialWithdrawal) MarshalSSZTo(buf []byte) (dst []byte, err err dst = ssz.MarshalUint64(dst, p.Amount) // Field (2) 'WithdrawableEpoch' - dst = ssz.MarshalUint64(dst, p.WithdrawableEpoch) + dst = ssz.MarshalUint64(dst, uint64(p.WithdrawableEpoch)) return } @@ -18052,7 +19016,7 @@ func (p *PendingPartialWithdrawal) UnmarshalSSZ(buf []byte) error { p.Amount = ssz.UnmarshallUint64(buf[8:16]) // Field (2) 'WithdrawableEpoch' - p.WithdrawableEpoch = ssz.UnmarshallUint64(buf[16:24]) + p.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) return err } @@ -18079,7 +19043,7 @@ func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) hh.PutUint64(p.Amount) // Field (2) 'WithdrawableEpoch' - hh.PutUint64(p.WithdrawableEpoch) + hh.PutUint64(uint64(p.WithdrawableEpoch)) if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.proto b/proto/prysm/v1alpha1/validator-client/keymanager.proto index fc014b731393..455cff32a2a6 100644 --- a/proto/prysm/v1alpha1/validator-client/keymanager.proto +++ b/proto/prysm/v1alpha1/validator-client/keymanager.proto @@ -106,4 +106,4 @@ message BuilderConfig { message ProposerSettingsPayload { map proposer_config = 1; ProposerOptionPayload default_config = 2; -} \ No newline at end of file +} From bf5e667351408433bb573d306415741bb01c5961 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 26 Apr 2024 11:47:00 -0500 Subject: [PATCH 059/325] Electra: HTR util for DepositReceipt and ExecutionLayerWithdrawalRequest (#13924) * Electra: HTR utils for DepositReceipts and ExecutionLayerWithdrawalRequests * Tests for HTR utils --- encoding/ssz/BUILD.bazel | 1 + encoding/ssz/htrutils.go | 50 ++++++++++++++++++++++++ encoding/ssz/htrutils_test.go | 73 +++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) diff --git a/encoding/ssz/BUILD.bazel b/encoding/ssz/BUILD.bazel index 3f3c6641d86b..330a2658e760 100644 --- a/encoding/ssz/BUILD.bazel +++ b/encoding/ssz/BUILD.bazel @@ -40,6 +40,7 @@ go_test( "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//crypto/hash:go_default_library", + "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/encoding/ssz/htrutils.go b/encoding/ssz/htrutils.go index c7e42cdf4a35..f610d2c3a1ae 100644 --- a/encoding/ssz/htrutils.go +++ b/encoding/ssz/htrutils.go @@ -141,6 +141,56 @@ func WithdrawalSliceRoot(withdrawals []*enginev1.Withdrawal, limit uint64) ([32] return MixInLength(bytesRoot, bytesRootBufRoot), nil } +// DepositReceiptSliceRoot computes the HTR of a slice of deposit receipts. +// The limit parameter is used as input to the bitwise merkleization algorithm. +func DepositReceiptSliceRoot(depositReceipts []*enginev1.DepositReceipt, limit uint64) ([32]byte, error) { + roots := make([][32]byte, len(depositReceipts)) + for i := 0; i < len(depositReceipts); i++ { + r, err := depositReceipts[i].HashTreeRoot() + if err != nil { + return [32]byte{}, err + } + roots[i] = r + } + + bytesRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit) + if err != nil { + return [32]byte{}, errors.Wrap(err, "could not compute merkleization") + } + bytesRootBuf := new(bytes.Buffer) + if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(depositReceipts))); err != nil { + return [32]byte{}, errors.Wrap(err, "could not marshal length") + } + bytesRootBufRoot := make([]byte, 32) + copy(bytesRootBufRoot, bytesRootBuf.Bytes()) + return MixInLength(bytesRoot, bytesRootBufRoot), nil +} + +// WithdrawalRequestSliceRoot computes the HTR of a slice of withdrawal requests from the EL. +// The limit parameter is used as input to the bitwise merkleization algorithm. +func WithdrawalRequestSliceRoot(withdrawalRequests []*enginev1.ExecutionLayerWithdrawalRequest, limit uint64) ([32]byte, error) { + roots := make([][32]byte, len(withdrawalRequests)) + for i := 0; i < len(withdrawalRequests); i++ { + r, err := withdrawalRequests[i].HashTreeRoot() + if err != nil { + return [32]byte{}, err + } + roots[i] = r + } + + bytesRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit) + if err != nil { + return [32]byte{}, errors.Wrap(err, "could not compute merkleization") + } + bytesRootBuf := new(bytes.Buffer) + if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(withdrawalRequests))); err != nil { + return [32]byte{}, errors.Wrap(err, "could not marshal length") + } + bytesRootBufRoot := make([]byte, 32) + copy(bytesRootBufRoot, bytesRootBuf.Bytes()) + return MixInLength(bytesRoot, bytesRootBufRoot), nil +} + // ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N] // this func runs Chunkify + MerkleizeVector // max length is dividable by 32 ( root length ) diff --git a/encoding/ssz/htrutils_test.go b/encoding/ssz/htrutils_test.go index 94a52730db9d..a49f63932f75 100644 --- a/encoding/ssz/htrutils_test.go +++ b/encoding/ssz/htrutils_test.go @@ -5,6 +5,7 @@ import ( "testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -279,3 +280,75 @@ func TestWithrawalSliceRoot(t *testing.T) { }) } } + +func TestDepositReceiptSliceRoot(t *testing.T) { + tests := []struct { + name string + input []*enginev1.DepositReceipt + limit uint64 + want [32]byte + }{ + { + name: "empty", + input: make([]*enginev1.DepositReceipt, 0), + want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b}, + }, + { + name: "non-empty", + input: []*enginev1.DepositReceipt{ + { + Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48), + WithdrawalCredentials: bytesutil.PadTo([]byte{0x03, 0x04}, 32), + Amount: 5, + Signature: bytesutil.PadTo([]byte{0x06, 0x07}, 96), + Index: 8, + }, + }, + limit: 16, + want: [32]byte{0x34, 0xe3, 0x76, 0x5, 0xe5, 0x12, 0xe4, 0x75, 0x14, 0xf6, 0x72, 0x1c, 0x56, 0x5a, 0xa7, 0xf8, 0x8d, 0xaf, 0x84, 0xb7, 0xd7, 0x3e, 0xe6, 0x5f, 0x3f, 0xb1, 0x9f, 0x41, 0xf0, 0x10, 0x2b, 0xe6}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := ssz.DepositReceiptSliceRoot(tt.input, tt.limit) + require.NoError(t, err) + require.DeepSSZEqual(t, tt.want, got) + }) + } +} + +func TestWithdrawalRequestSliceRoot(t *testing.T) { + tests := []struct { + name string + input []*enginev1.ExecutionLayerWithdrawalRequest + limit uint64 + want [32]byte + }{ + { + name: "empty", + input: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0), + want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b}, + }, + { + name: "non-empty", + input: []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20), + ValidatorPubkey: bytesutil.PadTo([]byte{0x03, 0x04}, 48), + Amount: 5, + }, + }, + limit: 16, + want: [32]byte{0xa8, 0xab, 0xb2, 0x20, 0xe6, 0xd6, 0x5a, 0x7e, 0x56, 0x60, 0xe4, 0x9d, 0xae, 0x36, 0x17, 0x3d, 0x8b, 0xd, 0xde, 0x28, 0x96, 0x5, 0x82, 0x72, 0x18, 0xda, 0xc7, 0x5a, 0x53, 0xe0, 0x35, 0xf7}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := ssz.WithdrawalRequestSliceRoot(tt.input, tt.limit) + require.NoError(t, err) + require.DeepSSZEqual(t, tt.want, got) + }) + } +} From 8df62a537b5ad8d80c9d480e83a363aa80c085d4 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 26 Apr 2024 13:37:32 -0500 Subject: [PATCH 060/325] Electra: beacon-chain/core/helpers (#13921) * Electra helpers * Electra helper tests and other fixes * @terencechain feedback --- MODULE.bazel.lock | 21 ++ beacon-chain/core/epoch/epoch_processing.go | 2 +- beacon-chain/core/helpers/BUILD.bazel | 2 + beacon-chain/core/helpers/validator_churn.go | 52 +++ .../core/helpers/validator_churn_test.go | 71 ++++ beacon-chain/core/helpers/validators.go | 222 +++++++++++- beacon-chain/core/helpers/validators_test.go | 317 +++++++++++++++++- 7 files changed, 663 insertions(+), 24 deletions(-) create mode 100644 beacon-chain/core/helpers/validator_churn.go create mode 100644 beacon-chain/core/helpers/validator_churn_test.go diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 11bf37a4bfc0..20b916264309 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1123,6 +1123,27 @@ "recordedRepoMappingEntries": [] } }, + "@@bazel_tools//tools/test:extensions.bzl%remote_coverage_tools_extension": { + "general": { + "bzlTransitiveDigest": "l5mcjH2gWmbmIycx97bzI2stD0Q0M5gpDc0aLOHKIm8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remote_coverage_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "7006375f6756819b7013ca875eab70a541cf7d89142d9c511ed78ea4fefa38af", + "urls": [ + "https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.6.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [] + } + }, "@@rules_java~//java:extensions.bzl%toolchains": { "general": { "bzlTransitiveDigest": "tJHbmWnq7m+9eUBnUdv7jZziQ26FmcGL9C5/hU3Q9UQ=", diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 41d3e748c143..48980c6d5eae 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -99,7 +99,7 @@ func ProcessRegistryUpdates(ctx context.Context, state state.BeaconState) (state activationEligibilityEpoch := time.CurrentEpoch(state) + 1 for idx, validator := range vals { // Process the validators for activation eligibility. - if helpers.IsEligibleForActivationQueue(validator) { + if helpers.IsEligibleForActivationQueue(validator, currentEpoch) { validator.ActivationEligibilityEpoch = activationEligibilityEpoch if err := state.UpdateValidatorAtIndex(primitives.ValidatorIndex(idx), validator); err != nil { return nil, err diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index f49a5ecaeeca..bbeb7964435f 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -12,6 +12,7 @@ go_library( "rewards_penalties.go", "shuffle.go", "sync_committee.go", + "validator_churn.go", "validators.go", "weak_subjectivity.go", ], @@ -56,6 +57,7 @@ go_test( "rewards_penalties_test.go", "shuffle_test.go", "sync_committee_test.go", + "validator_churn_test.go", "validators_test.go", "weak_subjectivity_test.go", ], diff --git a/beacon-chain/core/helpers/validator_churn.go b/beacon-chain/core/helpers/validator_churn.go new file mode 100644 index 000000000000..b36fd81569f6 --- /dev/null +++ b/beacon-chain/core/helpers/validator_churn.go @@ -0,0 +1,52 @@ +package helpers + +import ( + "github.com/prysmaticlabs/prysm/v5/config/params" +) + +// BalanceChurnLimit for the current active balance, in gwei. +// New in Electra EIP-7251: https://eips.ethereum.org/EIPS/eip-7251 +// +// Spec definition: +// +// def get_balance_churn_limit(state: BeaconState) -> Gwei: +// """ +// Return the churn limit for the current epoch. +// """ +// churn = max( +// MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA, +// get_total_active_balance(state) // CHURN_LIMIT_QUOTIENT +// ) +// return churn - churn % EFFECTIVE_BALANCE_INCREMENT +func BalanceChurnLimit(activeBalanceGwei uint64) uint64 { + churn := max( + params.BeaconConfig().MinPerEpochChurnLimitElectra, + (activeBalanceGwei / params.BeaconConfig().ChurnLimitQuotient), + ) + return churn - churn%params.BeaconConfig().EffectiveBalanceIncrement +} + +// ActivationExitChurnLimit for the current active balance, in gwei. +// New in Electra EIP-7251: https://eips.ethereum.org/EIPS/eip-7251 +// +// Spec definition: +// +// def get_activation_exit_churn_limit(state: BeaconState) -> Gwei: +// """ +// Return the churn limit for the current epoch dedicated to activations and exits. +// """ +// return min(MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT, get_balance_churn_limit(state)) +func ActivationExitChurnLimit(activeBalanceGwei uint64) uint64 { + return min(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit, BalanceChurnLimit(activeBalanceGwei)) +} + +// ConsolidationChurnLimit for the current active balance, in gwei. +// New in EIP-7251: https://eips.ethereum.org/EIPS/eip-7251 +// +// Spec definition: +// +// def get_consolidation_churn_limit(state: BeaconState) -> Gwei: +// return get_balance_churn_limit(state) - get_activation_exit_churn_limit(state) +func ConsolidationChurnLimit(activeBalanceGwei uint64) uint64 { + return BalanceChurnLimit(activeBalanceGwei) - ActivationExitChurnLimit(activeBalanceGwei) +} diff --git a/beacon-chain/core/helpers/validator_churn_test.go b/beacon-chain/core/helpers/validator_churn_test.go new file mode 100644 index 000000000000..556505291a8a --- /dev/null +++ b/beacon-chain/core/helpers/validator_churn_test.go @@ -0,0 +1,71 @@ +package helpers_test + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/testing/assert" +) + +func TestBalanceChurnLimit(t *testing.T) { + tests := []struct { + name string + activeBalance uint64 + expected uint64 + }{ + { + name: "less than MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA", + activeBalance: 111, + expected: params.BeaconConfig().MinPerEpochChurnLimitElectra, + }, + { + name: "modulo EFFECTIVE_BALANCE_INCREMENT", + activeBalance: 111 + params.BeaconConfig().MinPerEpochChurnLimitElectra*params.BeaconConfig().ChurnLimitQuotient, + expected: params.BeaconConfig().MinPerEpochChurnLimitElectra, + }, + { + name: "more than MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA", + activeBalance: 2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient, + expected: 2000 * params.BeaconConfig().EffectiveBalanceIncrement, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.expected, helpers.BalanceChurnLimit(tt.activeBalance)) + }) + } +} + +func TestActivationExitChurnLimit(t *testing.T) { + tests := []struct { + name string + activeBalance uint64 + expected uint64 + }{ + { + name: "less than MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT", + activeBalance: 1, + expected: params.BeaconConfig().MinPerEpochChurnLimitElectra, + }, + { + name: "more than MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT", + activeBalance: 2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient, + expected: params.BeaconConfig().MaxPerEpochActivationExitChurnLimit, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.expected, helpers.ActivationExitChurnLimit(tt.activeBalance)) + }) + } +} + +// FuzzConsolidationChurnLimit exercises BalanceChurnLimit and ActivationExitChurnLimit +func FuzzConsolidationChurnLimit(f *testing.F) { + f.Fuzz(func(t *testing.T, activeBalance uint64) { + helpers.ConsolidationChurnLimit(activeBalance) + }) +} diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index aef32f10a9c3..d28aa39a3236 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -393,6 +393,24 @@ func ComputeProposerIndex(bState state.ReadOnlyValidators, activeIndices []primi // IsEligibleForActivationQueue checks if the validator is eligible to // be placed into the activation queue. // +// Spec definition: +// +// def is_eligible_for_activation_queue(validator: Validator) -> bool: +// """ +// Check if ``validator`` is eligible to be placed into the activation queue. +// """ +// return ( +// validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH +// and validator.effective_balance >= MIN_ACTIVATION_BALANCE # [Modified in Electra:EIP7251] +// ) +func IsEligibleForActivationQueue(validator *ethpb.Validator, currentEpoch primitives.Epoch) bool { + if currentEpoch >= params.BeaconConfig().ElectraForkEpoch { + return isEligibileForActivationQueueElectra(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) + } + return isEligibileForActivationQueue(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) +} + +// isEligibleForActivationQueue carries out the logic for IsEligibleForActivationQueue // Spec pseudocode definition: // // def is_eligible_for_activation_queue(validator: Validator) -> bool: @@ -403,20 +421,27 @@ func ComputeProposerIndex(bState state.ReadOnlyValidators, activeIndices []primi // validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH // and validator.effective_balance == MAX_EFFECTIVE_BALANCE // ) -func IsEligibleForActivationQueue(validator *ethpb.Validator) bool { - return isEligibileForActivationQueue(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) +func isEligibileForActivationQueue(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { + return activationEligibilityEpoch == params.BeaconConfig().FarFutureEpoch && + effectiveBalance == params.BeaconConfig().MaxEffectiveBalance } -// IsEligibleForActivationQueueUsingTrie checks if the read-only validator is eligible to +// IsEligibleForActivationQueue checks if the validator is eligible to // be placed into the activation queue. -func IsEligibleForActivationQueueUsingTrie(validator state.ReadOnlyValidator) bool { - return isEligibileForActivationQueue(validator.ActivationEligibilityEpoch(), validator.EffectiveBalance()) -} - -// isEligibleForActivationQueue carries out the logic for IsEligibleForActivationQueue* -func isEligibileForActivationQueue(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { +// +// Spec definition: +// +// def is_eligible_for_activation_queue(validator: Validator) -> bool: +// """ +// Check if ``validator`` is eligible to be placed into the activation queue. +// """ +// return ( +// validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH +// and validator.effective_balance >= MIN_ACTIVATION_BALANCE # [Modified in Electra:EIP7251] +// ) +func isEligibileForActivationQueueElectra(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { return activationEligibilityEpoch == params.BeaconConfig().FarFutureEpoch && - effectiveBalance == params.BeaconConfig().MaxEffectiveBalance + effectiveBalance >= params.BeaconConfig().MinActivationBalance } // IsEligibleForActivation checks if the validator is eligible for activation. @@ -471,3 +496,180 @@ func LastActivatedValidatorIndex(ctx context.Context, st state.ReadOnlyBeaconSta } return lastActivatedvalidatorIndex, nil } + +// hasETH1WithdrawalCredential returns whether the validator has an ETH1 +// Withdrawal prefix. It assumes that the caller has a lock on the state +func HasETH1WithdrawalCredential(val *ethpb.Validator) bool { + if val == nil { + return false + } + return isETH1WithdrawalCredential(val.WithdrawalCredentials) +} + +func isETH1WithdrawalCredential(creds []byte) bool { + return bytes.HasPrefix(creds, []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte}) +} + +// HasCompoundingWithdrawalCredential checks if the validator has a compounding withdrawal credential. +// New in Electra EIP-7251: https://eips.ethereum.org/EIPS/eip-7251 +// +// Spec definition: +// +// def has_compounding_withdrawal_credential(validator: Validator) -> bool: +// """ +// Check if ``validator`` has an 0x02 prefixed "compounding" withdrawal credential. +// """ +// return is_compounding_withdrawal_credential(validator.withdrawal_credentials) +func HasCompoundingWithdrawalCredential(v *ethpb.Validator) bool { + if v == nil { + return false + } + return isCompoundingWithdrawalCredential(v.WithdrawalCredentials) +} + +// isCompoundingWithdrawalCredential checks if the credentials are a compounding withdrawal credential. +// +// Spec definition: +// +// def is_compounding_withdrawal_credential(withdrawal_credentials: Bytes32) -> bool: +// return withdrawal_credentials[:1] == COMPOUNDING_WITHDRAWAL_PREFIX +func isCompoundingWithdrawalCredential(creds []byte) bool { + return bytes.HasPrefix(creds, []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}) +} + +// HasExecutionWithdrawalCredentials checks if the validator has an execution withdrawal credential or compounding credential. +// New in Electra EIP-7251: https://eips.ethereum.org/EIPS/eip-7251 +// +// Spec definition: +// +// def has_execution_withdrawal_credential(validator: Validator) -> bool: +// """ +// Check if ``validator`` has a 0x01 or 0x02 prefixed withdrawal credential. +// """ +// return has_compounding_withdrawal_credential(validator) or has_eth1_withdrawal_credential(validator) +func HasExecutionWithdrawalCredentials(v *ethpb.Validator) bool { + if v == nil { + return false + } + return HasCompoundingWithdrawalCredential(v) || HasETH1WithdrawalCredential(v) +} + +// IsSameWithdrawalCredentials returns true if both validators have the same withdrawal credentials. +// +// return a.withdrawal_credentials[12:] == b.withdrawal_credentials[12:] +func IsSameWithdrawalCredentials(a, b *ethpb.Validator) bool { + if a == nil || b == nil { + return false + } + if len(a.WithdrawalCredentials) <= 12 || len(b.WithdrawalCredentials) <= 12 { + return false + } + return bytes.Equal(a.WithdrawalCredentials[12:], b.WithdrawalCredentials[12:]) +} + +// IsFullyWithdrawableValidator returns whether the validator is able to perform a full +// withdrawal. This function assumes that the caller holds a lock on the state. +// +// Spec definition: +// +// def is_fully_withdrawable_validator(validator: Validator, balance: Gwei, epoch: Epoch) -> bool: +// """ +// Check if ``validator`` is fully withdrawable. +// """ +// return ( +// has_execution_withdrawal_credential(validator) # [Modified in Electra:EIP7251] +// and validator.withdrawable_epoch <= epoch +// and balance > 0 +// ) +func IsFullyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool { + if val == nil || balance <= 0 { + return false + } + + // Electra / EIP-7251 logic + if epoch >= params.BeaconConfig().ElectraForkEpoch { + return HasExecutionWithdrawalCredentials(val) && val.WithdrawableEpoch <= epoch + } + + return HasETH1WithdrawalCredential(val) && val.WithdrawableEpoch <= epoch +} + +// IsPartiallyWithdrawableValidator returns whether the validator is able to perform a +// partial withdrawal. This function assumes that the caller has a lock on the state. +// This method conditionally calls the fork appropriate implementation based on the epoch argument. +func IsPartiallyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool { + if val == nil { + return false + } + + if epoch < params.BeaconConfig().ElectraForkEpoch { + return isPartiallyWithdrawableValidatorCapella(val, balance, epoch) + } + + return isPartiallyWithdrawableValidatorElectra(val, balance, epoch) +} + +// isPartiallyWithdrawableValidatorElectra implements is_partially_withdrawable_validator in the +// electra fork. +// +// Spec definition: +// +// def is_partially_withdrawable_validator(validator: Validator, balance: Gwei) -> bool: +// +// """ +// Check if ``validator`` is partially withdrawable. +// """ +// max_effective_balance = get_validator_max_effective_balance(validator) +// has_max_effective_balance = validator.effective_balance == max_effective_balance # [Modified in Electra:EIP7251] +// has_excess_balance = balance > max_effective_balance # [Modified in Electra:EIP7251] +// return ( +// has_execution_withdrawal_credential(validator) # [Modified in Electra:EIP7251] +// and has_max_effective_balance +// and has_excess_balance +// ) +func isPartiallyWithdrawableValidatorElectra(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool { + maxEB := ValidatorMaxEffectiveBalance(val) + hasMaxBalance := val.EffectiveBalance == maxEB + hasExcessBalance := balance > maxEB + + return HasExecutionWithdrawalCredentials(val) && + hasMaxBalance && + hasExcessBalance +} + +// isPartiallyWithdrawableValidatorCapella implements is_partially_withdrawable_validator in the +// capella fork. +// +// Spec definition: +// +// def is_partially_withdrawable_validator(validator: Validator, balance: Gwei) -> bool: +// """ +// Check if ``validator`` is partially withdrawable. +// """ +// has_max_effective_balance = validator.effective_balance == MAX_EFFECTIVE_BALANCE +// has_excess_balance = balance > MAX_EFFECTIVE_BALANCE +// return has_eth1_withdrawal_credential(validator) and has_max_effective_balance and has_excess_balance +func isPartiallyWithdrawableValidatorCapella(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool { + hasMaxBalance := val.EffectiveBalance == params.BeaconConfig().MaxEffectiveBalance + hasExcessBalance := balance > params.BeaconConfig().MaxEffectiveBalance + return HasETH1WithdrawalCredential(val) && hasExcessBalance && hasMaxBalance +} + +// ValidatorMaxEffectiveBalance returns the maximum effective balance for a validator. +// +// Spec definition: +// +// def get_validator_max_effective_balance(validator: Validator) -> Gwei: +// """ +// Get max effective balance for ``validator``. +// """ +// if has_compounding_withdrawal_credential(validator): +// return MAX_EFFECTIVE_BALANCE_ELECTRA +// else: +// return MIN_ACTIVATION_BALANCE +func ValidatorMaxEffectiveBalance(val *ethpb.Validator) uint64 { + if HasCompoundingWithdrawalCredential(val) { + return params.BeaconConfig().MaxEffectiveBalanceElectra + } + return params.BeaconConfig().MinActivationBalance // TODO: Add test that MinActivationBalance == (old) MaxEffectiveBalance +} diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index 0471e1740d64..efa21c75cb63 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -703,25 +703,47 @@ func TestComputeProposerIndex(t *testing.T) { func TestIsEligibleForActivationQueue(t *testing.T) { tests := []struct { - name string - validator *ethpb.Validator - want bool + name string + validator *ethpb.Validator + currentEpoch primitives.Epoch + want bool }{ - {"Eligible", - ðpb.Validator{ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, - true}, - {"Incorrect activation eligibility epoch", - ðpb.Validator{ActivationEligibilityEpoch: 1, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, - false}, - {"Not enough balance", - ðpb.Validator{ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, EffectiveBalance: 1}, - false}, + { + name: "Eligible", + validator: ðpb.Validator{ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, + currentEpoch: primitives.Epoch(params.BeaconConfig().ElectraForkEpoch - 1), + want: true, + }, + { + name: "Incorrect activation eligibility epoch", + validator: ðpb.Validator{ActivationEligibilityEpoch: 1, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, + currentEpoch: primitives.Epoch(params.BeaconConfig().ElectraForkEpoch - 1), + want: false, + }, + { + name: "Not enough balance", + validator: ðpb.Validator{ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, EffectiveBalance: 1}, + currentEpoch: primitives.Epoch(params.BeaconConfig().ElectraForkEpoch - 1), + want: false, + }, + { + name: "More than max effective balance before electra", + validator: ðpb.Validator{ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance + 1}, + currentEpoch: primitives.Epoch(params.BeaconConfig().ElectraForkEpoch - 1), + want: false, + }, + { + name: "More than min activation balance after electra", + validator: ðpb.Validator{ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, EffectiveBalance: params.BeaconConfig().MinActivationBalance + 1}, + currentEpoch: primitives.Epoch(params.BeaconConfig().ElectraForkEpoch), + want: true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { helpers.ClearCache() - assert.Equal(t, tt.want, helpers.IsEligibleForActivationQueue(tt.validator), "IsEligibleForActivationQueue()") + assert.Equal(t, tt.want, helpers.IsEligibleForActivationQueue(tt.validator, tt.currentEpoch), "IsEligibleForActivationQueue()") }) } } @@ -828,3 +850,272 @@ func TestProposerIndexFromCheckpoint(t *testing.T) { require.NoError(t, err) require.Equal(t, ids[5], id) } + +func TestHasETH1WithdrawalCredentials(t *testing.T) { + creds := []byte{0xFA, 0xCC} + v := ðpb.Validator{WithdrawalCredentials: creds} + require.Equal(t, false, helpers.HasETH1WithdrawalCredential(v)) + creds = []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC} + v = ðpb.Validator{WithdrawalCredentials: creds} + require.Equal(t, true, helpers.HasETH1WithdrawalCredential(v)) + // No Withdrawal cred + v = ðpb.Validator{} + require.Equal(t, false, helpers.HasETH1WithdrawalCredential(v)) +} + +func TestHasCompoundingWithdrawalCredential(t *testing.T) { + tests := []struct { + name string + validator *ethpb.Validator + want bool + }{ + {"Has compounding withdrawal credential", + ðpb.Validator{WithdrawalCredentials: bytesutil.PadTo([]byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}, 32)}, + true}, + {"Does not have compounding withdrawal credential", + ðpb.Validator{WithdrawalCredentials: bytesutil.PadTo([]byte{0x00}, 32)}, + false}, + {"Handles nil case", nil, false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, helpers.HasCompoundingWithdrawalCredential(tt.validator)) + }) + } +} + +func TestHasExecutionWithdrawalCredentials(t *testing.T) { + tests := []struct { + name string + validator *ethpb.Validator + want bool + }{ + {"Has compounding withdrawal credential", + ðpb.Validator{WithdrawalCredentials: bytesutil.PadTo([]byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}, 32)}, + true}, + {"Has eth1 withdrawal credential", + ðpb.Validator{WithdrawalCredentials: bytesutil.PadTo([]byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte}, 32)}, + true}, + {"Does not have compounding withdrawal credential or eth1 withdrawal credential", + ðpb.Validator{WithdrawalCredentials: bytesutil.PadTo([]byte{0x00}, 32)}, + false}, + {"Handles nil case", nil, false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, helpers.HasExecutionWithdrawalCredentials(tt.validator)) + }) + } +} + +func TestIsFullyWithdrawableValidator(t *testing.T) { + tests := []struct { + name string + validator *ethpb.Validator + balance uint64 + epoch primitives.Epoch + want bool + }{ + { + name: "Handles nil case", + validator: nil, + balance: 0, + epoch: 0, + want: false, + }, + { + name: "No ETH1 prefix", + validator: ðpb.Validator{ + WithdrawalCredentials: []byte{0xFA, 0xCC}, + WithdrawableEpoch: 2, + }, + balance: params.BeaconConfig().MaxEffectiveBalance, + epoch: 3, + want: false, + }, + { + name: "Wrong withdrawable epoch", + validator: ðpb.Validator{ + WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}, + WithdrawableEpoch: 2, + }, + balance: params.BeaconConfig().MaxEffectiveBalance, + epoch: 1, + want: false, + }, + { + name: "No balance", + validator: ðpb.Validator{ + WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}, + WithdrawableEpoch: 2, + }, + balance: 0, + epoch: 3, + want: false, + }, + { + name: "Fully withdrawable", + validator: ðpb.Validator{ + WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}, + WithdrawableEpoch: 2, + }, + balance: params.BeaconConfig().MaxEffectiveBalance, + epoch: 3, + want: true, + }, + { + name: "Fully withdrawable compounding validator electra", + validator: ðpb.Validator{ + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0xCC}, + WithdrawableEpoch: 2, + }, + balance: params.BeaconConfig().MaxEffectiveBalance, + epoch: params.BeaconConfig().ElectraForkEpoch, + want: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, helpers.IsFullyWithdrawableValidator(tt.validator, tt.balance, tt.epoch)) + }) + } +} + +func TestIsPartiallyWithdrawableValidator(t *testing.T) { + tests := []struct { + name string + validator *ethpb.Validator + balance uint64 + epoch primitives.Epoch + want bool + }{ + { + name: "Handles nil case", + validator: nil, + balance: 0, + epoch: 0, + want: false, + }, + { + name: "No ETH1 prefix", + validator: ðpb.Validator{ + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawalCredentials: []byte{0xFA, 0xCC}, + }, + balance: params.BeaconConfig().MaxEffectiveBalance, + epoch: 3, + want: false, + }, + { + name: "No balance", + validator: ðpb.Validator{ + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}, + }, + balance: 0, + epoch: 3, + want: false, + }, + { + name: "Partially withdrawable", + validator: ðpb.Validator{ + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}, + }, + balance: params.BeaconConfig().MaxEffectiveBalance * 2, + epoch: 3, + want: true, + }, + { + name: "Fully withdrawable vanilla validator electra", + validator: ðpb.Validator{ + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}, + }, + balance: params.BeaconConfig().MinActivationBalance * 2, + epoch: params.BeaconConfig().ElectraForkEpoch, + want: true, + }, + { + name: "Fully withdrawable compounding validator electra", + validator: ðpb.Validator{ + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0xCC}, + }, + balance: params.BeaconConfig().MaxEffectiveBalanceElectra * 2, + epoch: params.BeaconConfig().ElectraForkEpoch, + want: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, helpers.IsPartiallyWithdrawableValidator(tt.validator, tt.balance, tt.epoch)) + }) + } +} + +func TestIsSameWithdrawalCredentials(t *testing.T) { + makeWithdrawalCredentials := func(address []byte) []byte { + b := make([]byte, 12) + return append(b, address...) + } + + tests := []struct { + name string + a *ethpb.Validator + b *ethpb.Validator + want bool + }{ + { + "Same credentials", + ðpb.Validator{WithdrawalCredentials: makeWithdrawalCredentials([]byte("same"))}, + ðpb.Validator{WithdrawalCredentials: makeWithdrawalCredentials([]byte("same"))}, + true, + }, + { + "Different credentials", + ðpb.Validator{WithdrawalCredentials: makeWithdrawalCredentials([]byte("foo"))}, + ðpb.Validator{WithdrawalCredentials: makeWithdrawalCredentials([]byte("bar"))}, + false, + }, + {"Handles nil case", nil, nil, false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, helpers.IsSameWithdrawalCredentials(tt.a, tt.b)) + }) + } +} + +func TestValidatorMaxEffectiveBalance(t *testing.T) { + tests := []struct { + name string + validator *ethpb.Validator + want uint64 + }{ + { + name: "Compounding withdrawal credential", + validator: ðpb.Validator{WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0xCC}}, + want: params.BeaconConfig().MaxEffectiveBalanceElectra, + }, + { + name: "Vanilla credentials", + validator: ðpb.Validator{WithdrawalCredentials: []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC}}, + want: params.BeaconConfig().MinActivationBalance, + }, + { + "Handles nil case", + nil, + params.BeaconConfig().MinActivationBalance, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, helpers.ValidatorMaxEffectiveBalance(tt.validator)) + }) + } + // Sanity check that MinActivationBalance equals (pre-electra) MaxEffectiveBalance + assert.Equal(t, params.BeaconConfig().MinActivationBalance, params.BeaconConfig().MaxEffectiveBalance) +} From d69be8a76662f28aa4f0b49210db3e8663d1b092 Mon Sep 17 00:00:00 2001 From: terence Date: Sat, 27 Apr 2024 19:40:26 -0700 Subject: [PATCH 061/325] Fix spelling (#13929) --- beacon-chain/core/helpers/validators.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index d28aa39a3236..e53794d45070 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -405,9 +405,9 @@ func ComputeProposerIndex(bState state.ReadOnlyValidators, activeIndices []primi // ) func IsEligibleForActivationQueue(validator *ethpb.Validator, currentEpoch primitives.Epoch) bool { if currentEpoch >= params.BeaconConfig().ElectraForkEpoch { - return isEligibileForActivationQueueElectra(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) + return isEligibleForActivationQueueElectra(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) } - return isEligibileForActivationQueue(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) + return isEligibleForActivationQueue(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) } // isEligibleForActivationQueue carries out the logic for IsEligibleForActivationQueue @@ -421,7 +421,7 @@ func IsEligibleForActivationQueue(validator *ethpb.Validator, currentEpoch primi // validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH // and validator.effective_balance == MAX_EFFECTIVE_BALANCE // ) -func isEligibileForActivationQueue(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { +func isEligibleForActivationQueue(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { return activationEligibilityEpoch == params.BeaconConfig().FarFutureEpoch && effectiveBalance == params.BeaconConfig().MaxEffectiveBalance } @@ -439,7 +439,7 @@ func isEligibileForActivationQueue(activationEligibilityEpoch primitives.Epoch, // validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH // and validator.effective_balance >= MIN_ACTIVATION_BALANCE # [Modified in Electra:EIP7251] // ) -func isEligibileForActivationQueueElectra(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { +func isEligibleForActivationQueueElectra(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool { return activationEligibilityEpoch == params.BeaconConfig().FarFutureEpoch && effectiveBalance >= params.BeaconConfig().MinActivationBalance } From ae16d5f52cd73ac7a9d9161d5d6cd3915fc768cb Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:15:07 +0200 Subject: [PATCH 062/325] Run correct test (#13935) --- .../spectest/minimal/altair/operations/sync_committee_test.go | 2 +- .../minimal/bellatrix/operations/sync_committee_test.go | 2 +- .../spectest/minimal/capella/operations/sync_committee_test.go | 2 +- .../spectest/minimal/deneb/operations/sync_committee_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/spectest/minimal/altair/operations/sync_committee_test.go b/testing/spectest/minimal/altair/operations/sync_committee_test.go index aeeefd426200..ee901a2a2dea 100644 --- a/testing/spectest/minimal/altair/operations/sync_committee_test.go +++ b/testing/spectest/minimal/altair/operations/sync_committee_test.go @@ -7,5 +7,5 @@ import ( ) func TestMinimal_Altair_Operations_SyncCommittee(t *testing.T) { - operations.RunProposerSlashingTest(t, "minimal") + operations.RunSyncCommitteeTest(t, "minimal") } diff --git a/testing/spectest/minimal/bellatrix/operations/sync_committee_test.go b/testing/spectest/minimal/bellatrix/operations/sync_committee_test.go index 832c9743a9c5..591cbde1161b 100644 --- a/testing/spectest/minimal/bellatrix/operations/sync_committee_test.go +++ b/testing/spectest/minimal/bellatrix/operations/sync_committee_test.go @@ -7,5 +7,5 @@ import ( ) func TestMinimal_Bellatrix_Operations_SyncCommittee(t *testing.T) { - operations.RunProposerSlashingTest(t, "minimal") + operations.RunSyncCommitteeTest(t, "minimal") } diff --git a/testing/spectest/minimal/capella/operations/sync_committee_test.go b/testing/spectest/minimal/capella/operations/sync_committee_test.go index 4d94b4e6b460..be5451aa6d32 100644 --- a/testing/spectest/minimal/capella/operations/sync_committee_test.go +++ b/testing/spectest/minimal/capella/operations/sync_committee_test.go @@ -7,5 +7,5 @@ import ( ) func TestMinimal_Capella_Operations_SyncCommittee(t *testing.T) { - operations.RunProposerSlashingTest(t, "minimal") + operations.RunSyncCommitteeTest(t, "minimal") } diff --git a/testing/spectest/minimal/deneb/operations/sync_committee_test.go b/testing/spectest/minimal/deneb/operations/sync_committee_test.go index 956c44522d38..e3b5073a4f9c 100644 --- a/testing/spectest/minimal/deneb/operations/sync_committee_test.go +++ b/testing/spectest/minimal/deneb/operations/sync_committee_test.go @@ -7,5 +7,5 @@ import ( ) func TestMinimal_Deneb_Operations_SyncCommittee(t *testing.T) { - operations.RunProposerSlashingTest(t, "minimal") + operations.RunSyncCommitteeTest(t, "minimal") } From 2c5a2e8ec723b8e4f1ec59e2d5fe63d2c15532e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Wed, 1 May 2024 06:29:38 +0900 Subject: [PATCH 063/325] Electra attestation interfaces (#13937) * config values * block protos * get_committee_indices * proto and ssz * attestation interface * Revert "Auxiliary commit to revert individual files from deadb2183723511721b3288c7168808a4fa97c64" This reverts commit 32ad5009537bc5ec0e6caf9f52143d380d00be85. * todos * get_attesting_indices * Revert "Auxiliary commit to revert individual files from dd2789723f90b15eb1f874b561d88d11dcc9c0bf" This reverts commit f39644ed3cb6f3964fc6c86fdf4bd5de2a9668c8. * beacon spec changes * Fix pending attestation. Build ok * Electra: add electra version * Electra: consensus types * gocognit exclusion * @potuz's suggestion * build fix * interfaces for indexed att and slashing * indexed att usage * BuildSignedBeaconBlockFromExecutionPayload * slashing usage * grpc stubs * remove unused methods * Electra attestation interfaces * cleanup * tests * make linter happy * simple casting * test fixes * Fix spectest failures * Regen pb and ssz files * Handle "not ok" type assertion cases * Setters that check version should always return an error. SetAttesterSlashings and SetAttestations * gofmt * Fix TestMinSpanChunksSlice_CheckSlashable --------- Co-authored-by: terence tsao Co-authored-by: Preston Van Loon --- beacon-chain/blockchain/head.go | 2 +- beacon-chain/blockchain/head_test.go | 13 +- beacon-chain/blockchain/metrics.go | 2 +- .../blockchain/process_attestation.go | 15 +- .../blockchain/process_attestation_test.go | 3 +- beacon-chain/blockchain/process_block.go | 10 +- beacon-chain/blockchain/process_block_test.go | 9 +- .../blockchain/receive_attestation.go | 31 +- .../blockchain/receive_attestation_test.go | 13 +- beacon-chain/blockchain/receive_block.go | 8 +- beacon-chain/blockchain/setup_test.go | 3 +- beacon-chain/blockchain/testing/mock.go | 6 +- beacon-chain/core/altair/attestation.go | 14 +- beacon-chain/core/blocks/attestation.go | 34 +- beacon-chain/core/blocks/attestation_test.go | 9 +- beacon-chain/core/blocks/attester_slashing.go | 27 +- .../core/blocks/attester_slashing_test.go | 37 +- .../core/blocks/block_operations_fuzz_test.go | 3 +- .../core/blocks/block_regression_test.go | 7 +- beacon-chain/core/blocks/signature.go | 18 +- .../core/epoch/precompute/attestation.go | 2 +- beacon-chain/core/feed/operation/BUILD.bazel | 1 + beacon-chain/core/feed/operation/events.go | 5 +- beacon-chain/core/helpers/BUILD.bazel | 2 + beacon-chain/core/helpers/attestation.go | 19 +- beacon-chain/core/helpers/attestation_test.go | 3 +- beacon-chain/core/helpers/beacon_committee.go | 8 +- beacon-chain/core/helpers/validators.go | 2 +- beacon-chain/db/slasherkv/slasher.go | 14 +- beacon-chain/db/slasherkv/slasher_test.go | 4 +- beacon-chain/monitor/process_attestation.go | 22 +- beacon-chain/monitor/process_block.go | 16 +- .../operations/attestations/BUILD.bazel | 3 +- .../operations/attestations/kv/BUILD.bazel | 3 +- .../operations/attestations/kv/aggregated.go | 50 +- .../attestations/kv/aggregated_test.go | 57 +- .../operations/attestations/kv/block.go | 20 +- .../operations/attestations/kv/block_test.go | 9 +- .../operations/attestations/kv/forkchoice.go | 16 +- .../attestations/kv/forkchoice_test.go | 9 +- beacon-chain/operations/attestations/kv/kv.go | 18 +- .../operations/attestations/kv/seen_bits.go | 18 +- .../attestations/kv/unaggregated.go | 22 +- .../attestations/kv/unaggregated_test.go | 37 +- beacon-chain/operations/attestations/pool.go | 38 +- .../attestations/prepare_forkchoice.go | 18 +- .../attestations/prepare_forkchoice_test.go | 73 +- .../operations/attestations/prune_expired.go | 6 +- .../attestations/prune_expired_test.go | 25 +- beacon-chain/operations/slashings/BUILD.bazel | 2 + .../operations/slashings/mock/BUILD.bazel | 1 + .../operations/slashings/mock/mock.go | 9 +- beacon-chain/operations/slashings/service.go | 18 +- .../slashings/service_attester_test.go | 15 +- beacon-chain/operations/slashings/types.go | 9 +- beacon-chain/p2p/BUILD.bazel | 1 + beacon-chain/p2p/broadcaster.go | 13 +- beacon-chain/p2p/interfaces.go | 3 +- beacon-chain/p2p/testing/BUILD.bazel | 1 + beacon-chain/p2p/testing/fuzz_p2p.go | 3 +- beacon-chain/p2p/testing/mock_broadcaster.go | 5 +- beacon-chain/p2p/testing/p2p.go | 3 +- beacon-chain/rpc/eth/beacon/handlers.go | 8 +- beacon-chain/rpc/eth/beacon/handlers_pool.go | 32 +- .../rpc/eth/beacon/handlers_pool_test.go | 25 +- beacon-chain/rpc/eth/events/BUILD.bazel | 1 + beacon-chain/rpc/eth/events/events.go | 13 +- beacon-chain/rpc/eth/rewards/handlers_test.go | 14 +- beacon-chain/rpc/eth/validator/BUILD.bazel | 2 + beacon-chain/rpc/eth/validator/handlers.go | 27 +- .../rpc/eth/validator/handlers_test.go | 7 +- .../rpc/prysm/v1alpha1/beacon/attestations.go | 39 +- .../v1alpha1/beacon/attestations_test.go | 60 +- .../rpc/prysm/v1alpha1/debug/block.go | 8 +- .../prysm/v1alpha1/validator/aggregator.go | 19 +- .../v1alpha1/validator/aggregator_test.go | 5 +- .../rpc/prysm/v1alpha1/validator/proposer.go | 12 +- .../validator/proposer_attestations.go | 42 +- .../validator/proposer_attestations_test.go | 15 +- .../v1alpha1/validator/proposer_deposits.go | 5 +- .../v1alpha1/validator/proposer_slashings.go | 5 +- .../validator/proposer_slashings_test.go | 3 +- .../prysm/v1alpha1/validator/proposer_test.go | 41 +- .../validator/proposer_utils_bench_test.go | 5 +- beacon-chain/slasher/BUILD.bazel | 2 + beacon-chain/slasher/chunks.go | 69 +- beacon-chain/slasher/chunks_test.go | 16 +- beacon-chain/slasher/detect_attestations.go | 80 +- .../slasher/detect_attestations_test.go | 10 +- beacon-chain/slasher/helpers.go | 33 +- beacon-chain/slasher/helpers_test.go | 12 +- beacon-chain/slasher/process_slashings.go | 19 +- .../slasher/process_slashings_test.go | 7 +- beacon-chain/slasher/receive.go | 7 +- beacon-chain/slasher/receive_test.go | 4 +- beacon-chain/slasher/service.go | 6 +- beacon-chain/slasher/types/types.go | 2 +- .../subscriber_beacon_aggregate_proof_test.go | 5 +- beacon-chain/sync/subscriber_handlers.go | 9 +- beacon-chain/sync/validate_aggregate_proof.go | 7 +- .../sync/validate_attester_slashing.go | 4 +- .../sync/validate_beacon_attestation.go | 23 +- consensus-types/blocks/execution.go | 574 ++++++ consensus-types/blocks/factory.go | 176 +- consensus-types/blocks/getters.go | 202 +- consensus-types/blocks/getters_test.go | 8 +- consensus-types/blocks/proto.go | 247 ++- consensus-types/blocks/setters.go | 62 +- consensus-types/blocks/types.go | 31 +- consensus-types/interfaces/BUILD.bazel | 1 + consensus-types/interfaces/beacon_block.go | 49 +- consensus-types/mock/block.go | 10 +- encoding/ssz/htrutils_test.go | 18 +- go.mod | 2 +- proto/engine/v1/generated.ssz.go | 2 +- proto/eth/v1/generated.ssz.go | 2 +- proto/eth/v2/generated.ssz.go | 2 +- proto/prysm/v1alpha1/BUILD.bazel | 2 + proto/prysm/v1alpha1/attestation.go | 80 + proto/prysm/v1alpha1/attestation/BUILD.bazel | 1 + .../aggregation/attestations/BUILD.bazel | 2 + .../aggregation/attestations/attestations.go | 11 +- .../attestations/attestations_test.go | 6 +- .../aggregation/attestations/maxcover.go | 29 +- .../aggregation/attestations/maxcover_test.go | 221 +-- .../aggregation/testing/BUILD.bazel | 1 + .../aggregation/testing/bitlistutils.go | 5 +- .../v1alpha1/attestation/attestation_utils.go | 26 +- proto/prysm/v1alpha1/beacon_chain.pb.go | 1692 +++++++++-------- proto/prysm/v1alpha1/beacon_chain.proto | 20 +- proto/prysm/v1alpha1/generated.ssz.go | 2 +- .../v1alpha1/slashings/surround_votes.go | 4 +- proto/prysm/v1alpha1/validator.proto | 1 - runtime/version/fork.go | 2 + testing/slasher/simulator/BUILD.bazel | 1 + testing/slasher/simulator/simulator.go | 3 +- .../altair/epoch_processing/BUILD.bazel | 3 +- .../shared/altair/epoch_processing/helpers.go | 6 +- .../shared/altair/operations/BUILD.bazel | 3 +- .../shared/altair/operations/block_header.go | 6 +- .../shared/altair/operations/helpers.go | 6 +- .../spectest/shared/altair/sanity/BUILD.bazel | 4 +- .../shared/altair/sanity/block_processing.go | 6 +- .../shared/altair/sanity/slot_processing.go | 7 +- .../bellatrix/epoch_processing/BUILD.bazel | 3 +- .../bellatrix/epoch_processing/helpers.go | 6 +- .../shared/bellatrix/operations/BUILD.bazel | 3 +- .../bellatrix/operations/block_header.go | 6 +- .../bellatrix/operations/execution_payload.go | 6 +- .../shared/bellatrix/operations/helpers.go | 6 +- .../shared/bellatrix/sanity/BUILD.bazel | 4 +- .../bellatrix/sanity/block_processing.go | 6 +- .../bellatrix/sanity/slot_processing.go | 7 +- .../capella/epoch_processing/BUILD.bazel | 3 +- .../capella/epoch_processing/helpers.go | 6 +- .../shared/capella/operations/BUILD.bazel | 3 +- .../shared/capella/operations/block_header.go | 6 +- .../shared/capella/operations/helpers.go | 6 +- .../shared/capella/sanity/BUILD.bazel | 3 +- .../shared/capella/sanity/block_processing.go | 6 +- .../shared/capella/sanity/slot_processing.go | 7 +- .../shared/common/forkchoice/builder.go | 2 +- .../spectest/shared/deneb/fork/BUILD.bazel | 2 + .../shared/deneb/fork/upgrade_to_deneb.go | 5 +- .../shared/phase0/finality/BUILD.bazel | 3 +- .../spectest/shared/phase0/finality/runner.go | 6 +- .../shared/phase0/operations/BUILD.bazel | 3 +- .../shared/phase0/operations/block_header.go | 6 +- .../shared/phase0/operations/helpers.go | 6 +- .../spectest/shared/phase0/sanity/BUILD.bazel | 3 +- .../shared/phase0/sanity/block_processing.go | 6 +- .../shared/phase0/sanity/slot_processing.go | 7 +- testing/validator-mock/node_client_mock.go | 4 +- .../beacon-api/mock/json_rest_handler_mock.go | 1 - 174 files changed, 3459 insertions(+), 1788 deletions(-) diff --git a/beacon-chain/blockchain/head.go b/beacon-chain/blockchain/head.go index 51cff3738531..bda360a84ba0 100644 --- a/beacon-chain/blockchain/head.go +++ b/beacon-chain/blockchain/head.go @@ -401,7 +401,7 @@ func (s *Service) saveOrphanedOperations(ctx context.Context, orphanedRoot [32]b } for _, a := range orphanedBlk.Block().Body().Attestations() { // if the attestation is one epoch older, it wouldn't been useful to save it. - if a.Data.Slot+params.BeaconConfig().SlotsPerEpoch < s.CurrentSlot() { + if a.GetData().Slot+params.BeaconConfig().SlotsPerEpoch < s.CurrentSlot() { continue } if helpers.IsAggregated(a) { diff --git a/beacon-chain/blockchain/head_test.go b/beacon-chain/blockchain/head_test.go index 012cb54c127d..d1e5b1c1de51 100644 --- a/beacon-chain/blockchain/head_test.go +++ b/beacon-chain/blockchain/head_test.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/blstoexec" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" @@ -312,14 +313,14 @@ func TestSaveOrphanedAtts(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []*ethpb.Attestation{ + wantAtts := []interfaces.Attestation{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], } atts := service.cfg.AttPool.AggregatedAttestations() sort.Slice(atts, func(i, j int) bool { - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot }) require.DeepEqual(t, wantAtts, atts) } @@ -389,14 +390,14 @@ func TestSaveOrphanedOps(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []*ethpb.Attestation{ + wantAtts := []interfaces.Attestation{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], } atts := service.cfg.AttPool.AggregatedAttestations() sort.Slice(atts, func(i, j int) bool { - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot }) require.DeepEqual(t, wantAtts, atts) require.Equal(t, 1, len(service.cfg.SlashingPool.PendingProposerSlashings(ctx, st, false))) @@ -517,14 +518,14 @@ func TestSaveOrphanedAtts_DoublyLinkedTrie(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []*ethpb.Attestation{ + wantAtts := []interfaces.Attestation{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], } atts := service.cfg.AttPool.AggregatedAttestations() sort.Slice(atts, func(i, j int) bool { - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot }) require.DeepEqual(t, wantAtts, atts) } diff --git a/beacon-chain/blockchain/metrics.go b/beacon-chain/blockchain/metrics.go index c712b574d04f..8abcce3a2c52 100644 --- a/beacon-chain/blockchain/metrics.go +++ b/beacon-chain/blockchain/metrics.go @@ -369,6 +369,6 @@ func reportEpochMetrics(ctx context.Context, postState, headState state.BeaconSt func reportAttestationInclusion(blk interfaces.ReadOnlyBeaconBlock) { for _, att := range blk.Body().Attestations() { - attestationInclusionDelay.Observe(float64(blk.Slot() - att.Data.Slot)) + attestationInclusionDelay.Observe(float64(blk.Slot() - att.GetData().Slot)) } } diff --git a/beacon-chain/blockchain/process_attestation.go b/beacon-chain/blockchain/process_attestation.go index c61078ff7143..c645f9ccee26 100644 --- a/beacon-chain/blockchain/process_attestation.go +++ b/beacon-chain/blockchain/process_attestation.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" @@ -36,17 +37,17 @@ import ( // // # Update latest messages for attesting indices // update_latest_messages(store, indexed_attestation.attesting_indices, attestation) -func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, disparity time.Duration) error { +func (s *Service) OnAttestation(ctx context.Context, a interfaces.Attestation, disparity time.Duration) error { ctx, span := trace.StartSpan(ctx, "blockChain.onAttestation") defer span.End() if err := helpers.ValidateNilAttestation(a); err != nil { return err } - if err := helpers.ValidateSlotTargetEpoch(a.Data); err != nil { + if err := helpers.ValidateSlotTargetEpoch(a.GetData()); err != nil { return err } - tgt := ethpb.CopyCheckpoint(a.Data.Target) + tgt := ethpb.CopyCheckpoint(a.GetData().Target) // Note that target root check is ignored here because it was performed in sync's validation pipeline: // validate_aggregate_proof.go and validate_beacon_attestation.go @@ -67,7 +68,7 @@ func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, dispa } // Verify attestation beacon block is known and not from the future. - if err := s.verifyBeaconBlock(ctx, a.Data); err != nil { + if err := s.verifyBeaconBlock(ctx, a.GetData()); err != nil { return errors.Wrap(err, "could not verify attestation beacon block") } @@ -75,12 +76,12 @@ func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, dispa // validate_aggregate_proof.go and validate_beacon_attestation.go // Verify attestations can only affect the fork choice of subsequent slots. - if err := slots.VerifyTime(genesisTime, a.Data.Slot+1, disparity); err != nil { + if err := slots.VerifyTime(genesisTime, a.GetData().Slot+1, disparity); err != nil { return err } // Use the target state to verify attesting indices are valid. - committee, err := helpers.BeaconCommitteeFromState(ctx, baseState, a.Data.Slot, a.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, baseState, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return err } @@ -97,7 +98,7 @@ func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, dispa // We assume trusted attestation in this function has verified signature. // Update forkchoice store with the new attestation for updating weight. - s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indexedAtt.AttestingIndices, bytesutil.ToBytes32(a.Data.BeaconBlockRoot), a.Data.Target.Epoch) + s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indexedAtt.GetAttestingIndices(), bytesutil.ToBytes32(a.GetData().BeaconBlockRoot), a.GetData().Target.Epoch) return nil } diff --git a/beacon-chain/blockchain/process_attestation_test.go b/beacon-chain/blockchain/process_attestation_test.go index b84298ccb1ed..9b0f722051b1 100644 --- a/beacon-chain/blockchain/process_attestation_test.go +++ b/beacon-chain/blockchain/process_attestation_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -73,7 +74,7 @@ func TestStore_OnAttestation_ErrorConditions(t *testing.T) { tests := []struct { name string - a *ethpb.Attestation + a interfaces.Attestation wantedErr string }{ { diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 34a16e39e446..3f8c94ccedfd 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -366,17 +366,17 @@ func (s *Service) handleEpochBoundary(ctx context.Context, slot primitives.Slot, func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState) error { // Feed in block's attestations to fork choice store. for _, a := range blk.Body().Attestations() { - committee, err := helpers.BeaconCommitteeFromState(ctx, st, a.Data.Slot, a.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, st, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return err } - indices, err := attestation.AttestingIndices(a.AggregationBits, committee) + indices, err := attestation.AttestingIndices(a.GetAggregationBits(), committee) if err != nil { return err } - r := bytesutil.ToBytes32(a.Data.BeaconBlockRoot) + r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) if s.cfg.ForkChoiceStore.HasNode(r) { - s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indices, r, a.Data.Target.Epoch) + s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indices, r, a.GetData().Target.Epoch) } else if err := s.cfg.AttPool.SaveBlockAttestation(a); err != nil { return err } @@ -387,7 +387,7 @@ func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.Re // InsertSlashingsToForkChoiceStore inserts attester slashing indices to fork choice store. // To call this function, it's caller's responsibility to ensure the slashing object is valid. // This function requires a write lock on forkchoice. -func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashings []*ethpb.AttesterSlashing) { +func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashings []interfaces.AttesterSlashing) { for _, slashing := range slashings { indices := blocks.SlashableAttesterIndices(slashing) for _, index := range indices { diff --git a/beacon-chain/blockchain/process_block_test.go b/beacon-chain/blockchain/process_block_test.go index 0ff6590fd5a1..fbc15a824ae8 100644 --- a/beacon-chain/blockchain/process_block_test.go +++ b/beacon-chain/blockchain/process_block_test.go @@ -824,7 +824,10 @@ func TestRemoveBlockAttestationsInPool(t *testing.T) { require.NoError(t, service.cfg.BeaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Root: r[:]})) require.NoError(t, service.cfg.BeaconDB.SaveGenesisBlockRoot(ctx, r)) - atts := b.Block.Body.Attestations + atts := make([]interfaces.Attestation, len(b.Block.Body.Attestations)) + for i, a := range b.Block.Body.Attestations { + atts[i] = a + } require.NoError(t, service.cfg.AttPool.SaveAggregatedAttestations(atts)) wsb, err := consensusblocks.NewSignedBeaconBlock(b) require.NoError(t, err) @@ -2010,12 +2013,12 @@ func TestOnBlock_HandleBlockAttestations(t *testing.T) { require.Equal(t, 1, len(wsb.Block().Body().Attestations())) a := wsb.Block().Body().Attestations()[0] - r := bytesutil.ToBytes32(a.Data.BeaconBlockRoot) + r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) require.Equal(t, true, service.cfg.ForkChoiceStore.HasNode(r)) require.Equal(t, 1, len(wsb.Block().Body().Attestations())) a3 := wsb3.Block().Body().Attestations()[0] - r3 := bytesutil.ToBytes32(a3.Data.BeaconBlockRoot) + r3 := bytesutil.ToBytes32(a3.GetData().BeaconBlockRoot) require.Equal(t, false, service.cfg.ForkChoiceStore.HasNode(r3)) require.NoError(t, service.handleBlockAttestations(ctx, wsb.Block(), st)) // fine to use the same committee as st diff --git a/beacon-chain/blockchain/receive_attestation.go b/beacon-chain/blockchain/receive_attestation.go index d94156f227ca..1d5a5763f3d5 100644 --- a/beacon-chain/blockchain/receive_attestation.go +++ b/beacon-chain/blockchain/receive_attestation.go @@ -10,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -31,7 +32,7 @@ type AttestationStateFetcher interface { // AttestationReceiver interface defines the methods of chain service receive and processing new attestations. type AttestationReceiver interface { AttestationStateFetcher - VerifyLmdFfgConsistency(ctx context.Context, att *ethpb.Attestation) error + VerifyLmdFfgConsistency(ctx context.Context, att interfaces.Attestation) error InForkchoice([32]byte) bool } @@ -51,13 +52,13 @@ func (s *Service) AttestationTargetState(ctx context.Context, target *ethpb.Chec } // VerifyLmdFfgConsistency verifies that attestation's LMD and FFG votes are consistency to each other. -func (s *Service) VerifyLmdFfgConsistency(ctx context.Context, a *ethpb.Attestation) error { - r, err := s.TargetRootForEpoch([32]byte(a.Data.BeaconBlockRoot), a.Data.Target.Epoch) +func (s *Service) VerifyLmdFfgConsistency(ctx context.Context, a interfaces.Attestation) error { + r, err := s.TargetRootForEpoch([32]byte(a.GetData().BeaconBlockRoot), a.GetData().Target.Epoch) if err != nil { return err } - if !bytes.Equal(a.Data.Target.Root, r[:]) { - return fmt.Errorf("FFG and LMD votes are not consistent, block root: %#x, target root: %#x, canonical target root: %#x", a.Data.BeaconBlockRoot, a.Data.Target.Root, r) + if !bytes.Equal(a.GetData().Target.Root, r[:]) { + return fmt.Errorf("FFG and LMD votes are not consistent, block root: %#x, target root: %#x, canonical target root: %#x", a.GetData().BeaconBlockRoot, a.GetData().Target.Root, r) } return nil } @@ -170,13 +171,13 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati // Based on the spec, don't process the attestation until the subsequent slot. // This delays consideration in the fork choice until their slot is in the past. // https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/fork-choice.md#validate_on_attestation - nextSlot := a.Data.Slot + 1 + nextSlot := a.GetData().Slot + 1 if err := slots.VerifyTime(uint64(s.genesisTime.Unix()), nextSlot, disparity); err != nil { continue } - hasState := s.cfg.BeaconDB.HasStateSummary(ctx, bytesutil.ToBytes32(a.Data.BeaconBlockRoot)) - hasBlock := s.hasBlock(ctx, bytesutil.ToBytes32(a.Data.BeaconBlockRoot)) + hasState := s.cfg.BeaconDB.HasStateSummary(ctx, bytesutil.ToBytes32(a.GetData().BeaconBlockRoot)) + hasBlock := s.hasBlock(ctx, bytesutil.ToBytes32(a.GetData().BeaconBlockRoot)) if !(hasState && hasBlock) { continue } @@ -185,17 +186,17 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati log.WithError(err).Error("Could not delete fork choice attestation in pool") } - if !helpers.VerifyCheckpointEpoch(a.Data.Target, s.genesisTime) { + if !helpers.VerifyCheckpointEpoch(a.GetData().Target, s.genesisTime) { continue } if err := s.receiveAttestationNoPubsub(ctx, a, disparity); err != nil { log.WithFields(logrus.Fields{ - "slot": a.Data.Slot, - "committeeIndex": a.Data.CommitteeIndex, - "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.Data.BeaconBlockRoot)), - "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.Data.Target.Root)), - "aggregationCount": a.AggregationBits.Count(), + "slot": a.GetData().Slot, + "committeeIndex": a.GetData().CommitteeIndex, + "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().BeaconBlockRoot)), + "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().Target.Root)), + "aggregationCount": a.GetAggregationBits().Count(), }).WithError(err).Warn("Could not process attestation for fork choice") } } @@ -206,7 +207,7 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati // 1. Validate attestation, update validator's latest vote // 2. Apply fork choice to the processed attestation // 3. Save latest head info -func (s *Service) receiveAttestationNoPubsub(ctx context.Context, att *ethpb.Attestation, disparity time.Duration) error { +func (s *Service) receiveAttestationNoPubsub(ctx context.Context, att interfaces.Attestation, disparity time.Duration) error { ctx, span := trace.StartSpan(ctx, "beacon-chain.blockchain.receiveAttestationNoPubsub") defer span.End() diff --git a/beacon-chain/blockchain/receive_attestation_test.go b/beacon-chain/blockchain/receive_attestation_test.go index 51654f4e6d6c..dd1ce2cabc8f 100644 --- a/beacon-chain/blockchain/receive_attestation_test.go +++ b/beacon-chain/blockchain/receive_attestation_test.go @@ -10,6 +10,7 @@ import ( forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -83,7 +84,11 @@ func TestProcessAttestations_Ok(t *testing.T) { state, blkRoot, err := prepareForkchoiceState(ctx, 0, tRoot, tRoot, params.BeaconConfig().ZeroHash, ojc, ofc) require.NoError(t, err) require.NoError(t, service.cfg.ForkChoiceStore.InsertNode(ctx, state, blkRoot)) - require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(atts)) + attsToSave := make([]interfaces.Attestation, len(atts)) + for i, a := range atts { + attsToSave[i] = a + } + require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(attsToSave)) service.processAttestations(ctx, 0) require.Equal(t, 0, len(service.cfg.AttPool.ForkchoiceAttestations())) require.LogsDoNotContain(t, hook, "Could not process attestation for fork choice") @@ -121,7 +126,11 @@ func TestService_ProcessAttestationsAndUpdateHead(t *testing.T) { // Generate attestations for this block in Slot 1 atts, err := util.GenerateAttestations(copied, pks, 1, 1, false) require.NoError(t, err) - require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(atts)) + attsToSave := make([]interfaces.Attestation, len(atts)) + for i, a := range atts { + attsToSave[i] = a + } + require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(attsToSave)) // Verify the target is in forkchoice require.Equal(t, true, fcs.HasNode(bytesutil.ToBytes32(atts[0].Data.BeaconBlockRoot))) require.Equal(t, tRoot, bytesutil.ToBytes32(atts[0].Data.BeaconBlockRoot)) diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index 23a6f9de1e2a..f4b05f6c35d4 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -52,7 +52,7 @@ type BlobReceiver interface { // SlashingReceiver interface defines the methods of chain service for receiving validated slashing over the wire. type SlashingReceiver interface { - ReceiveAttesterSlashing(ctx context.Context, slashings *ethpb.AttesterSlashing) + ReceiveAttesterSlashing(ctx context.Context, slashing interfaces.AttesterSlashing) } // ReceiveBlock is a function that defines the operations (minus pubsub) @@ -295,10 +295,10 @@ func (s *Service) HasBlock(ctx context.Context, root [32]byte) bool { } // ReceiveAttesterSlashing receives an attester slashing and inserts it to forkchoice -func (s *Service) ReceiveAttesterSlashing(ctx context.Context, slashing *ethpb.AttesterSlashing) { +func (s *Service) ReceiveAttesterSlashing(ctx context.Context, slashing interfaces.AttesterSlashing) { s.cfg.ForkChoiceStore.Lock() defer s.cfg.ForkChoiceStore.Unlock() - s.InsertSlashingsToForkChoiceStore(ctx, []*ethpb.AttesterSlashing{slashing}) + s.InsertSlashingsToForkChoiceStore(ctx, []interfaces.AttesterSlashing{slashing}) } // prunePostBlockOperationPools only runs on new head otherwise should return a nil. @@ -479,7 +479,7 @@ func (s *Service) sendBlockAttestationsToSlasher(signed interfaces.ReadOnlySigne // is done in the background to avoid adding more load to this critical code path. ctx := context.TODO() for _, att := range signed.Block().Body().Attestations() { - committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { log.WithError(err).Error("Could not get attestation committee") return diff --git a/beacon-chain/blockchain/setup_test.go b/beacon-chain/blockchain/setup_test.go index 3d3e98b3f86e..97c6d00f7d06 100644 --- a/beacon-chain/blockchain/setup_test.go +++ b/beacon-chain/blockchain/setup_test.go @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "google.golang.org/protobuf/proto" @@ -49,7 +50,7 @@ func (mb *mockBroadcaster) Broadcast(_ context.Context, _ proto.Message) error { return nil } -func (mb *mockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, _ *ethpb.Attestation) error { +func (mb *mockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { mb.broadcastCalled = true return nil } diff --git a/beacon-chain/blockchain/testing/mock.go b/beacon-chain/blockchain/testing/mock.go index 27083f671962..e85868c448cb 100644 --- a/beacon-chain/blockchain/testing/mock.go +++ b/beacon-chain/blockchain/testing/mock.go @@ -414,8 +414,8 @@ func (*ChainService) HeadGenesisValidatorsRoot() [32]byte { } // VerifyLmdFfgConsistency mocks VerifyLmdFfgConsistency and always returns nil. -func (*ChainService) VerifyLmdFfgConsistency(_ context.Context, a *ethpb.Attestation) error { - if !bytes.Equal(a.Data.BeaconBlockRoot, a.Data.Target.Root) { +func (*ChainService) VerifyLmdFfgConsistency(_ context.Context, a interfaces.Attestation) error { + if !bytes.Equal(a.GetData().BeaconBlockRoot, a.GetData().Target.Root) { return errors.New("LMD and FFG miss matched") } return nil @@ -495,7 +495,7 @@ func (s *ChainService) UpdateHead(ctx context.Context, slot primitives.Slot) { } // ReceiveAttesterSlashing mocks the same method in the chain service. -func (*ChainService) ReceiveAttesterSlashing(context.Context, *ethpb.AttesterSlashing) {} +func (*ChainService) ReceiveAttesterSlashing(context.Context, interfaces.AttesterSlashing) {} // IsFinalized mocks the same method in the chain service. func (s *ChainService) IsFinalized(_ context.Context, blockRoot [32]byte) bool { diff --git a/beacon-chain/core/altair/attestation.go b/beacon-chain/core/altair/attestation.go index f54a6d043924..8b123c91ca8b 100644 --- a/beacon-chain/core/altair/attestation.go +++ b/beacon-chain/core/altair/attestation.go @@ -48,7 +48,7 @@ func ProcessAttestationsNoVerifySignature( func ProcessAttestationNoVerifySignature( ctx context.Context, beaconState state.BeaconState, - att *ethpb.Attestation, + att interfaces.Attestation, totalBalance uint64, ) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "altair.ProcessAttestationNoVerifySignature") @@ -58,24 +58,24 @@ func ProcessAttestationNoVerifySignature( return nil, err } - delay, err := beaconState.Slot().SafeSubSlot(att.Data.Slot) + delay, err := beaconState.Slot().SafeSubSlot(att.GetData().Slot) if err != nil { - return nil, fmt.Errorf("att slot %d can't be greater than state slot %d", att.Data.Slot, beaconState.Slot()) + return nil, fmt.Errorf("att slot %d can't be greater than state slot %d", att.GetData().Slot, beaconState.Slot()) } - participatedFlags, err := AttestationParticipationFlagIndices(beaconState, att.Data, delay) + participatedFlags, err := AttestationParticipationFlagIndices(beaconState, att.GetData(), delay) if err != nil { return nil, err } - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err } - indices, err := attestation.AttestingIndices(att.AggregationBits, committee) + indices, err := attestation.AttestingIndices(att.GetAggregationBits(), committee) if err != nil { return nil, err } - return SetParticipationAndRewardProposer(ctx, beaconState, att.Data.Target.Epoch, indices, participatedFlags, totalBalance) + return SetParticipationAndRewardProposer(ctx, beaconState, att.GetData().Target.Epoch, indices, participatedFlags, totalBalance) } // SetParticipationAndRewardProposer retrieves and sets the epoch participation bits in state. Based on the epoch participation, it rewards diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index 96073e83e028..a704bf26050a 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -46,7 +46,7 @@ func ProcessAttestationsNoVerifySignature( func VerifyAttestationNoVerifySignature( ctx context.Context, beaconState state.ReadOnlyBeaconState, - att *ethpb.Attestation, + att interfaces.Attestation, ) error { ctx, span := trace.StartSpan(ctx, "core.VerifyAttestationNoVerifySignature") defer span.End() @@ -56,7 +56,7 @@ func VerifyAttestationNoVerifySignature( } currEpoch := time.CurrentEpoch(beaconState) prevEpoch := time.PrevEpoch(beaconState) - data := att.Data + data := att.GetData() if data.Target.Epoch != prevEpoch && data.Target.Epoch != currEpoch { return fmt.Errorf( "expected target epoch (%d) to be the previous epoch (%d) or the current epoch (%d)", @@ -76,11 +76,11 @@ func VerifyAttestationNoVerifySignature( } } - if err := helpers.ValidateSlotTargetEpoch(att.Data); err != nil { + if err := helpers.ValidateSlotTargetEpoch(att.GetData()); err != nil { return err } - s := att.Data.Slot + s := att.GetData().Slot minInclusionCheck := s+params.BeaconConfig().MinAttestationInclusionDelay <= beaconState.Slot() if !minInclusionCheck { return fmt.Errorf( @@ -102,13 +102,13 @@ func VerifyAttestationNoVerifySignature( ) } } - activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, beaconState, att.Data.Target.Epoch) + activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, beaconState, att.GetData().Target.Epoch) if err != nil { return err } c := helpers.SlotCommitteeCount(activeValidatorCount) - if uint64(att.Data.CommitteeIndex) >= c { - return fmt.Errorf("committee index %d >= committee count %d", att.Data.CommitteeIndex, c) + if uint64(att.GetData().CommitteeIndex) >= c { + return fmt.Errorf("committee index %d >= committee count %d", att.GetData().CommitteeIndex, c) } if err := helpers.VerifyAttestationBitfieldLengths(ctx, beaconState, att); err != nil { @@ -116,7 +116,7 @@ func VerifyAttestationNoVerifySignature( } // Verify attesting indices are correct. - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return err } @@ -133,7 +133,7 @@ func VerifyAttestationNoVerifySignature( func ProcessAttestationNoVerifySignature( ctx context.Context, beaconState state.BeaconState, - att *ethpb.Attestation, + att interfaces.Attestation, ) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "core.ProcessAttestationNoVerifySignature") defer span.End() @@ -143,15 +143,15 @@ func ProcessAttestationNoVerifySignature( } currEpoch := time.CurrentEpoch(beaconState) - data := att.Data - s := att.Data.Slot + data := att.GetData() + s := att.GetData().Slot proposerIndex, err := helpers.BeaconProposerIndex(ctx, beaconState) if err != nil { return nil, err } pendingAtt := ðpb.PendingAttestation{ Data: data, - AggregationBits: att.AggregationBits, + AggregationBits: att.GetAggregationBits(), InclusionDelay: beaconState.Slot() - s, ProposerIndex: proposerIndex, } @@ -171,11 +171,11 @@ func ProcessAttestationNoVerifySignature( // VerifyAttestationSignature converts and attestation into an indexed attestation and verifies // the signature in that attestation. -func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att *ethpb.Attestation) error { +func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att interfaces.Attestation) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return err } @@ -203,7 +203,7 @@ func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyB // domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) // signing_root = compute_signing_root(indexed_attestation.data, domain) // return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) -func VerifyIndexedAttestation(ctx context.Context, beaconState state.ReadOnlyBeaconState, indexedAtt *ethpb.IndexedAttestation) error { +func VerifyIndexedAttestation(ctx context.Context, beaconState state.ReadOnlyBeaconState, indexedAtt ethpb.IndexedAtt) error { ctx, span := trace.StartSpan(ctx, "core.VerifyIndexedAttestation") defer span.End() @@ -212,14 +212,14 @@ func VerifyIndexedAttestation(ctx context.Context, beaconState state.ReadOnlyBea } domain, err := signing.Domain( beaconState.Fork(), - indexedAtt.Data.Target.Epoch, + indexedAtt.GetData().Target.Epoch, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot(), ) if err != nil { return err } - indices := indexedAtt.AttestingIndices + indices := indexedAtt.GetAttestingIndices() var pubkeys []bls.PublicKey for i := 0; i < len(indices); i++ { pubkeyAtIdx := beaconState.PubkeyAtIndex(primitives.ValidatorIndex(indices[i])) diff --git a/beacon-chain/core/blocks/attestation_test.go b/beacon-chain/core/blocks/attestation_test.go index 978c46838565..3565e3ceb288 100644 --- a/beacon-chain/core/blocks/attestation_test.go +++ b/beacon-chain/core/blocks/attestation_test.go @@ -11,6 +11,7 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -386,7 +387,7 @@ func TestValidateIndexedAttestation_BadAttestationsSignatureSet(t *testing.T) { sig := keys[0].Sign([]byte{'t', 'e', 's', 't'}) list := bitfield.Bitlist{0b11111} - var atts []*ethpb.Attestation + var atts []interfaces.Attestation for i := uint64(0); i < 1000; i++ { atts = append(atts, ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -402,7 +403,7 @@ func TestValidateIndexedAttestation_BadAttestationsSignatureSet(t *testing.T) { _, err := blocks.AttestationSignatureBatch(context.Background(), beaconState, atts) assert.ErrorContains(t, want, err) - atts = []*ethpb.Attestation{} + atts = []interfaces.Attestation{} list = bitfield.Bitlist{0b10000} for i := uint64(0); i < 1000; i++ { atts = append(atts, ðpb.Attestation{ @@ -543,7 +544,7 @@ func TestRetrieveAttestationSignatureSet_VerifiesMultipleAttestations(t *testing } att2.Signature = bls.AggregateSignatures(sigs).Marshal() - set, err := blocks.AttestationSignatureBatch(ctx, st, []*ethpb.Attestation{att1, att2}) + set, err := blocks.AttestationSignatureBatch(ctx, st, []interfaces.Attestation{att1, att2}) require.NoError(t, err) verified, err := set.Verify() require.NoError(t, err) @@ -607,6 +608,6 @@ func TestRetrieveAttestationSignatureSet_AcrossFork(t *testing.T) { } att2.Signature = bls.AggregateSignatures(sigs).Marshal() - _, err = blocks.AttestationSignatureBatch(ctx, st, []*ethpb.Attestation{att1, att2}) + _, err = blocks.AttestationSignatureBatch(ctx, st, []interfaces.Attestation{att1, att2}) require.NoError(t, err) } diff --git a/beacon-chain/core/blocks/attester_slashing.go b/beacon-chain/core/blocks/attester_slashing.go index 9f97aa59aa0c..20d2291aae22 100644 --- a/beacon-chain/core/blocks/attester_slashing.go +++ b/beacon-chain/core/blocks/attester_slashing.go @@ -8,6 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -40,7 +41,7 @@ import ( func ProcessAttesterSlashings( ctx context.Context, beaconState state.BeaconState, - slashings []*ethpb.AttesterSlashing, + slashings []interfaces.AttesterSlashing, slashFunc slashValidatorFunc, ) (state.BeaconState, error) { var err error @@ -57,7 +58,7 @@ func ProcessAttesterSlashings( func ProcessAttesterSlashing( ctx context.Context, beaconState state.BeaconState, - slashing *ethpb.AttesterSlashing, + slashing interfaces.AttesterSlashing, slashFunc slashValidatorFunc, ) (state.BeaconState, error) { if err := VerifyAttesterSlashing(ctx, beaconState, slashing); err != nil { @@ -104,20 +105,20 @@ func ProcessAttesterSlashing( } // VerifyAttesterSlashing validates the attestation data in both attestations in the slashing object. -func VerifyAttesterSlashing(ctx context.Context, beaconState state.ReadOnlyBeaconState, slashing *ethpb.AttesterSlashing) error { +func VerifyAttesterSlashing(ctx context.Context, beaconState state.ReadOnlyBeaconState, slashing interfaces.AttesterSlashing) error { if slashing == nil { return errors.New("nil slashing") } - if slashing.Attestation_1 == nil || slashing.Attestation_2 == nil { + if slashing.GetFirstAttestation() == nil || slashing.GetSecondAttestation() == nil { return errors.New("nil attestation") } - if slashing.Attestation_1.Data == nil || slashing.Attestation_2.Data == nil { + if slashing.GetFirstAttestation().GetData() == nil || slashing.GetSecondAttestation().GetData() == nil { return errors.New("nil attestation data") } - att1 := slashing.Attestation_1 - att2 := slashing.Attestation_2 - data1 := att1.Data - data2 := att2.Data + att1 := slashing.GetFirstAttestation() + att2 := slashing.GetSecondAttestation() + data1 := att1.GetData() + data2 := att2.GetData() if !IsSlashableAttestationData(data1, data2) { return errors.New("attestations are not slashable") } @@ -157,11 +158,11 @@ func IsSlashableAttestationData(data1, data2 *ethpb.AttestationData) bool { } // SlashableAttesterIndices returns the intersection of attester indices from both attestations in this slashing. -func SlashableAttesterIndices(slashing *ethpb.AttesterSlashing) []uint64 { - if slashing == nil || slashing.Attestation_1 == nil || slashing.Attestation_2 == nil { +func SlashableAttesterIndices(slashing interfaces.AttesterSlashing) []uint64 { + if slashing == nil || slashing.GetFirstAttestation() == nil || slashing.GetSecondAttestation() == nil { return nil } - indices1 := slashing.Attestation_1.AttestingIndices - indices2 := slashing.Attestation_2.AttestingIndices + indices1 := slashing.GetFirstAttestation().GetAttestingIndices() + indices2 := slashing.GetSecondAttestation().GetAttestingIndices() return slice.IntersectionUint64(indices1, indices2) } diff --git a/beacon-chain/core/blocks/attester_slashing_test.go b/beacon-chain/core/blocks/attester_slashing_test.go index cfa281b0d7bc..295146c77c77 100644 --- a/beacon-chain/core/blocks/attester_slashing_test.go +++ b/beacon-chain/core/blocks/attester_slashing_test.go @@ -9,6 +9,7 @@ import ( v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -57,7 +58,11 @@ func TestProcessAttesterSlashings_DataNotSlashable(t *testing.T) { AttesterSlashings: slashings, }, } - _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) assert.ErrorContains(t, "attestations are not slashable", err) } @@ -92,7 +97,11 @@ func TestProcessAttesterSlashings_IndexedAttestationFailedToVerify(t *testing.T) }, } - _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) assert.ErrorContains(t, "validator indices count exceeds MAX_VALIDATORS_PER_COMMITTEE", err) } @@ -144,7 +153,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatus(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() @@ -213,7 +226,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusAltair(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() @@ -282,7 +299,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusBellatrix(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() @@ -351,7 +372,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusCapella(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() diff --git a/beacon-chain/core/blocks/block_operations_fuzz_test.go b/beacon-chain/core/blocks/block_operations_fuzz_test.go index d51072620b8c..8d2ac1fbbb74 100644 --- a/beacon-chain/core/blocks/block_operations_fuzz_test.go +++ b/beacon-chain/core/blocks/block_operations_fuzz_test.go @@ -10,6 +10,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -216,7 +217,7 @@ func TestFuzzProcessAttesterSlashings_10000(t *testing.T) { fuzzer.Fuzz(a) s, err := state_native.InitializeFromProtoUnsafePhase0(state) require.NoError(t, err) - r, err := ProcessAttesterSlashings(ctx, s, []*ethpb.AttesterSlashing{a}, v.SlashValidator) + r, err := ProcessAttesterSlashings(ctx, s, []interfaces.AttesterSlashing{a}, v.SlashValidator) if err != nil && r != nil { t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and slashing: %v", r, err, state, a) } diff --git a/beacon-chain/core/blocks/block_regression_test.go b/beacon-chain/core/blocks/block_regression_test.go index d85761509054..807cea81b48c 100644 --- a/beacon-chain/core/blocks/block_regression_test.go +++ b/beacon-chain/core/blocks/block_regression_test.go @@ -8,6 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -91,7 +92,11 @@ func TestProcessAttesterSlashings_RegressionSlashableIndices(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() if !newRegistry[expectedSlashedVal].Slashed { diff --git a/beacon-chain/core/blocks/signature.go b/beacon-chain/core/blocks/signature.go index 508de5f1add6..720e025d41bc 100644 --- a/beacon-chain/core/blocks/signature.go +++ b/beacon-chain/core/blocks/signature.go @@ -179,7 +179,7 @@ func randaoSigningData(ctx context.Context, beaconState state.ReadOnlyBeaconStat func createAttestationSignatureBatch( ctx context.Context, beaconState state.ReadOnlyBeaconState, - atts []*ethpb.Attestation, + atts []interfaces.Attestation, domain []byte, ) (*bls.SignatureBatch, error) { if len(atts) == 0 { @@ -191,8 +191,8 @@ func createAttestationSignatureBatch( msgs := make([][32]byte, len(atts)) descs := make([]string, len(atts)) for i, a := range atts { - sigs[i] = a.Signature - c, err := helpers.BeaconCommitteeFromState(ctx, beaconState, a.Data.Slot, a.Data.CommitteeIndex) + sigs[i] = a.GetSignature() + c, err := helpers.BeaconCommitteeFromState(ctx, beaconState, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, err } @@ -203,7 +203,7 @@ func createAttestationSignatureBatch( if err := attestation.IsValidAttestationIndices(ctx, ia); err != nil { return nil, err } - indices := ia.AttestingIndices + indices := ia.GetAttestingIndices() pubkeys := make([][]byte, len(indices)) for i := 0; i < len(indices); i++ { pubkeyAtIdx := beaconState.PubkeyAtIndex(primitives.ValidatorIndex(indices[i])) @@ -215,7 +215,7 @@ func createAttestationSignatureBatch( } pks[i] = aggP - root, err := signing.ComputeSigningRoot(ia.Data, domain) + root, err := signing.ComputeSigningRoot(ia.GetData(), domain) if err != nil { return nil, errors.Wrap(err, "could not get signing root of object") } @@ -233,7 +233,7 @@ func createAttestationSignatureBatch( // AttestationSignatureBatch retrieves all the related attestation signature data such as the relevant public keys, // signatures and attestation signing data and collate it into a signature batch object. -func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBeaconState, atts []*ethpb.Attestation) (*bls.SignatureBatch, error) { +func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBeaconState, atts []interfaces.Attestation) (*bls.SignatureBatch, error) { if len(atts) == 0 { return bls.NewSet(), nil } @@ -243,10 +243,10 @@ func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBe dt := params.BeaconConfig().DomainBeaconAttester // Split attestations by fork. Note: the signature domain will differ based on the fork. - var preForkAtts []*ethpb.Attestation - var postForkAtts []*ethpb.Attestation + var preForkAtts []interfaces.Attestation + var postForkAtts []interfaces.Attestation for _, a := range atts { - if slots.ToEpoch(a.Data.Slot) < fork.Epoch { + if slots.ToEpoch(a.GetData().Slot) < fork.Epoch { preForkAtts = append(preForkAtts, a) } else { postForkAtts = append(postForkAtts, a) diff --git a/beacon-chain/core/epoch/precompute/attestation.go b/beacon-chain/core/epoch/precompute/attestation.go index 9ec7fd0f1ffc..48087d89db85 100644 --- a/beacon-chain/core/epoch/precompute/attestation.go +++ b/beacon-chain/core/epoch/precompute/attestation.go @@ -54,7 +54,7 @@ func ProcessAttestations( return nil, nil, errors.Wrap(err, "could not check validator attested previous epoch") } - committee, err := helpers.BeaconCommitteeFromState(ctx, state, a.Data.Slot, a.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, state, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, nil, err } diff --git a/beacon-chain/core/feed/operation/BUILD.bazel b/beacon-chain/core/feed/operation/BUILD.bazel index 0d475e92d8ce..b159265e1926 100644 --- a/beacon-chain/core/feed/operation/BUILD.bazel +++ b/beacon-chain/core/feed/operation/BUILD.bazel @@ -11,6 +11,7 @@ go_library( deps = [ "//async/event:go_default_library", "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", ], ) diff --git a/beacon-chain/core/feed/operation/events.go b/beacon-chain/core/feed/operation/events.go index ce5eeb2fbc76..2a4bf6942ff1 100644 --- a/beacon-chain/core/feed/operation/events.go +++ b/beacon-chain/core/feed/operation/events.go @@ -3,6 +3,7 @@ package operation import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -37,7 +38,7 @@ const ( // UnAggregatedAttReceivedData is the data sent with UnaggregatedAttReceived events. type UnAggregatedAttReceivedData struct { // Attestation is the unaggregated attestation object. - Attestation *ethpb.Attestation + Attestation interfaces.Attestation } // AggregatedAttReceivedData is the data sent with AggregatedAttReceived events. @@ -75,5 +76,5 @@ type ProposerSlashingReceivedData struct { // AttesterSlashingReceivedData is the data sent with AttesterSlashingReceived events. type AttesterSlashingReceivedData struct { - AttesterSlashing *ethpb.AttesterSlashing + AttesterSlashing interfaces.AttesterSlashing } diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index bbeb7964435f..1912d6c2998c 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -25,6 +25,7 @@ go_library( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//container/trie:go_default_library", @@ -72,6 +73,7 @@ go_test( "//beacon-chain/state/state-native:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//crypto/hash:go_default_library", diff --git a/beacon-chain/core/helpers/attestation.go b/beacon-chain/core/helpers/attestation.go index af153f8faf17..bb620ba17969 100644 --- a/beacon-chain/core/helpers/attestation.go +++ b/beacon-chain/core/helpers/attestation.go @@ -7,6 +7,7 @@ import ( "time" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -21,20 +22,20 @@ var ( // ValidateNilAttestation checks if any composite field of input attestation is nil. // Access to these nil fields will result in run time panic, // it is recommended to run these checks as first line of defense. -func ValidateNilAttestation(attestation *ethpb.Attestation) error { +func ValidateNilAttestation(attestation interfaces.Attestation) error { if attestation == nil { return errors.New("attestation can't be nil") } - if attestation.Data == nil { + if attestation.GetData() == nil { return errors.New("attestation's data can't be nil") } - if attestation.Data.Source == nil { + if attestation.GetData().Source == nil { return errors.New("attestation's source can't be nil") } - if attestation.Data.Target == nil { + if attestation.GetData().Target == nil { return errors.New("attestation's target can't be nil") } - if attestation.AggregationBits == nil { + if attestation.GetAggregationBits() == nil { return errors.New("attestation's bitfield can't be nil") } return nil @@ -71,8 +72,8 @@ func IsAggregator(committeeCount uint64, slotSig []byte) (bool, error) { // IsAggregated returns true if the attestation is an aggregated attestation, // false otherwise. -func IsAggregated(attestation *ethpb.Attestation) bool { - return attestation.AggregationBits.Count() > 1 +func IsAggregated(attestation interfaces.Attestation) bool { + return attestation.GetAggregationBits().Count() > 1 } // ComputeSubnetForAttestation returns the subnet for which the provided attestation will be broadcasted to. @@ -90,8 +91,8 @@ func IsAggregated(attestation *ethpb.Attestation) bool { // committees_since_epoch_start = committees_per_slot * slots_since_epoch_start // // return uint64((committees_since_epoch_start + committee_index) % ATTESTATION_SUBNET_COUNT) -func ComputeSubnetForAttestation(activeValCount uint64, att *ethpb.Attestation) uint64 { - return ComputeSubnetFromCommitteeAndSlot(activeValCount, att.Data.CommitteeIndex, att.Data.Slot) +func ComputeSubnetForAttestation(activeValCount uint64, att interfaces.Attestation) uint64 { + return ComputeSubnetFromCommitteeAndSlot(activeValCount, att.GetData().CommitteeIndex, att.GetData().Slot) } // ComputeSubnetFromCommitteeAndSlot is a flattened version of ComputeSubnetForAttestation where we only pass in diff --git a/beacon-chain/core/helpers/attestation_test.go b/beacon-chain/core/helpers/attestation_test.go index 5c3a34a5087a..6ffb5f447695 100644 --- a/beacon-chain/core/helpers/attestation_test.go +++ b/beacon-chain/core/helpers/attestation_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -238,7 +239,7 @@ func TestVerifyCheckpointEpoch_Ok(t *testing.T) { func TestValidateNilAttestation(t *testing.T) { tests := []struct { name string - attestation *ethpb.Attestation + attestation interfaces.Attestation errString string }{ { diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 715e490b7a64..9cb3f11c6793 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -15,12 +15,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -257,8 +257,8 @@ func VerifyBitfieldLength(bf bitfield.Bitfield, committeeSize uint64) error { // VerifyAttestationBitfieldLengths verifies that an attestations aggregation bitfields is // a valid length matching the size of the committee. -func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att *ethpb.Attestation) error { - committee, err := BeaconCommitteeFromState(ctx, state, att.Data.Slot, att.Data.CommitteeIndex) +func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att interfaces.Attestation) error { + committee, err := BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return errors.Wrap(err, "could not retrieve beacon committees") } @@ -267,7 +267,7 @@ func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyB return errors.New("no committee exist for this attestation") } - if err := VerifyBitfieldLength(att.AggregationBits, uint64(len(committee))); err != nil { + if err := VerifyBitfieldLength(att.GetAggregationBits(), uint64(len(committee))); err != nil { return errors.Wrap(err, "failed to verify aggregation bitfield") } return nil diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index e53794d45070..2614c7d17ac0 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -671,5 +671,5 @@ func ValidatorMaxEffectiveBalance(val *ethpb.Validator) uint64 { if HasCompoundingWithdrawalCredential(val) { return params.BeaconConfig().MaxEffectiveBalanceElectra } - return params.BeaconConfig().MinActivationBalance // TODO: Add test that MinActivationBalance == (old) MaxEffectiveBalance + return params.BeaconConfig().MinActivationBalance } diff --git a/beacon-chain/db/slasherkv/slasher.go b/beacon-chain/db/slasherkv/slasher.go index 15c7fcbb23be..1c558e3c59d5 100644 --- a/beacon-chain/db/slasherkv/slasher.go +++ b/beacon-chain/db/slasherkv/slasher.go @@ -156,10 +156,10 @@ func (s *Store) CheckAttesterDoubleVotes( signingRootsBkt := tx.Bucket(attestationDataRootsBucket) attRecordsBkt := tx.Bucket(attestationRecordsBucket) - encEpoch := encodeTargetEpoch(attToProcess.IndexedAttestation.Data.Target.Epoch) + encEpoch := encodeTargetEpoch(attToProcess.IndexedAttestation.GetData().Target.Epoch) localDoubleVotes := make([]*slashertypes.AttesterDoubleVote, 0) - for _, valIdx := range attToProcess.IndexedAttestation.AttestingIndices { + for _, valIdx := range attToProcess.IndexedAttestation.GetAttestingIndices() { // Check if there is signing root in the database for this combination // of validator index and target epoch. encIdx := encodeValidatorIndex(primitives.ValidatorIndex(valIdx)) @@ -194,7 +194,7 @@ func (s *Store) CheckAttesterDoubleVotes( // Build the proof of double vote. slashAtt := &slashertypes.AttesterDoubleVote{ ValidatorIndex: primitives.ValidatorIndex(valIdx), - Target: attToProcess.IndexedAttestation.Data.Target.Epoch, + Target: attToProcess.IndexedAttestation.GetData().Target.Epoch, Wrapper_1: existingAttRecord, Wrapper_2: attToProcess, } @@ -280,7 +280,7 @@ func (s *Store) SaveAttestationRecordsForValidators( encodedRecords := make([][]byte, attWrappersCount) for i, attestation := range attWrappers { - encEpoch := encodeTargetEpoch(attestation.IndexedAttestation.Data.Target.Epoch) + encEpoch := encodeTargetEpoch(attestation.IndexedAttestation.GetData().Target.Epoch) value, err := encodeAttestationRecord(attestation) if err != nil { @@ -325,7 +325,7 @@ func (s *Store) SaveAttestationRecordsForValidators( return err } - for _, validatorIndex := range attWrapper.IndexedAttestation.AttestingIndices { + for _, validatorIndex := range attWrapper.IndexedAttestation.GetAttestingIndices() { encodedIndex := encodeValidatorIndex(primitives.ValidatorIndex(validatorIndex)) key := append(encodedTargetEpoch, encodedIndex...) @@ -638,8 +638,8 @@ func (s *Store) HighestAttestations( } highestAtt := ðpb.HighestAttestation{ ValidatorIndex: uint64(indices[i]), - HighestSourceEpoch: attWrapper.IndexedAttestation.Data.Source.Epoch, - HighestTargetEpoch: attWrapper.IndexedAttestation.Data.Target.Epoch, + HighestSourceEpoch: attWrapper.IndexedAttestation.GetData().Source.Epoch, + HighestTargetEpoch: attWrapper.IndexedAttestation.GetData().Target.Epoch, } history = append(history, highestAtt) break diff --git a/beacon-chain/db/slasherkv/slasher_test.go b/beacon-chain/db/slasherkv/slasher_test.go index 2bbac54cfae5..292e109042c2 100644 --- a/beacon-chain/db/slasherkv/slasher_test.go +++ b/beacon-chain/db/slasherkv/slasher_test.go @@ -62,7 +62,7 @@ func TestStore_AttestationRecordForValidator_SaveRetrieve(t *testing.T) { actual, err := beaconDB.AttestationRecordForValidator(ctx, validatorIndex, primitives.Epoch(i+1)) require.NoError(t, err) - require.DeepEqual(t, expected.IndexedAttestation.Data.Source.Epoch, actual.IndexedAttestation.Data.Source.Epoch) + require.DeepEqual(t, expected.IndexedAttestation.GetData().Source.Epoch, actual.IndexedAttestation.GetData().Source.Epoch) } } @@ -544,7 +544,7 @@ func BenchmarkHighestAttestations(b *testing.B) { for i := 0; i < count; i++ { indicesForAtt := make([]primitives.ValidatorIndex, valsPerAtt) for r := 0; r < valsPerAtt; r++ { - indicesForAtt[r] = primitives.ValidatorIndex(atts[i].IndexedAttestation.AttestingIndices[r]) + indicesForAtt[r] = primitives.ValidatorIndex(atts[i].IndexedAttestation.GetAttestingIndices()[r]) } allIndices = append(allIndices, indicesForAtt...) } diff --git a/beacon-chain/monitor/process_attestation.go b/beacon-chain/monitor/process_attestation.go index 9379292b9a1f..25b90b741b13 100644 --- a/beacon-chain/monitor/process_attestation.go +++ b/beacon-chain/monitor/process_attestation.go @@ -33,12 +33,12 @@ func (s *Service) canUpdateAttestedValidator(idx primitives.ValidatorIndex, slot } // attestingIndices returns the indices of validators that participated in the given aggregated attestation. -func attestingIndices(ctx context.Context, state state.BeaconState, att *ethpb.Attestation) ([]uint64, error) { - committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.Data.Slot, att.Data.CommitteeIndex) +func attestingIndices(ctx context.Context, state state.BeaconState, att interfaces.Attestation) ([]uint64, error) { + committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err } - return attestation.AttestingIndices(att.AggregationBits, committee) + return attestation.AttestingIndices(att.GetAggregationBits(), committee) } // logMessageTimelyFlagsForIndex returns the log message with performance info for the attestation (head, source, target) @@ -63,7 +63,7 @@ func (s *Service) processAttestations(ctx context.Context, state state.BeaconSta } // processIncludedAttestation logs in the event for the tracked validators' and their latest attestation gets processed. -func (s *Service) processIncludedAttestation(ctx context.Context, state state.BeaconState, att *ethpb.Attestation) { +func (s *Service) processIncludedAttestation(ctx context.Context, state state.BeaconState, att interfaces.Attestation) { attestingIndices, err := attestingIndices(ctx, state, att) if err != nil { log.WithError(err).Error("Could not get attesting indices") @@ -72,8 +72,8 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be s.Lock() defer s.Unlock() for _, idx := range attestingIndices { - if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.Data.Slot) { - logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.Data) + if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.GetData().Slot) { + logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.GetData()) balance, err := state.BalanceAtIndex(primitives.ValidatorIndex(idx)) if err != nil { log.WithError(err).Error("Could not get balance") @@ -88,7 +88,7 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be balanceChg := int64(balance - latestPerf.balance) latestPerf.balanceChange = balanceChg latestPerf.balance = balance - latestPerf.attestedSlot = att.Data.Slot + latestPerf.attestedSlot = att.GetData().Slot latestPerf.inclusionSlot = state.Slot() inclusionSlotGauge.WithLabelValues(fmt.Sprintf("%d", idx)).Set(float64(latestPerf.inclusionSlot)) aggregatedPerf.totalDistance += uint64(latestPerf.inclusionSlot - latestPerf.attestedSlot) @@ -161,10 +161,10 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be } // processUnaggregatedAttestation logs when the beacon node observes an unaggregated attestation from tracked validator. -func (s *Service) processUnaggregatedAttestation(ctx context.Context, att *ethpb.Attestation) { +func (s *Service) processUnaggregatedAttestation(ctx context.Context, att interfaces.Attestation) { s.RLock() defer s.RUnlock() - root := bytesutil.ToBytes32(att.Data.BeaconBlockRoot) + root := bytesutil.ToBytes32(att.GetData().BeaconBlockRoot) st := s.config.StateGen.StateByRootIfCachedNoCopy(root) if st == nil { log.WithField("beaconBlockRoot", fmt.Sprintf("%#x", bytesutil.Trunc(root[:]))).Debug( @@ -177,8 +177,8 @@ func (s *Service) processUnaggregatedAttestation(ctx context.Context, att *ethpb return } for _, idx := range attestingIndices { - if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.Data.Slot) { - logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.Data) + if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.GetData().Slot) { + logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.GetData()) log.WithFields(logFields).Info("Processed unaggregated attestation") } } diff --git a/beacon-chain/monitor/process_block.go b/beacon-chain/monitor/process_block.go index 65101da4c7f1..d1661a3dfb6d 100644 --- a/beacon-chain/monitor/process_block.go +++ b/beacon-chain/monitor/process_block.go @@ -124,14 +124,14 @@ func (s *Service) processSlashings(blk interfaces.ReadOnlyBeaconBlock) { log.WithFields(logrus.Fields{ "attesterIndex": idx, "blockInclusionSlot": blk.Slot(), - "attestationSlot1": slashing.Attestation_1.Data.Slot, - "beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.Attestation_1.Data.BeaconBlockRoot)), - "sourceEpoch1": slashing.Attestation_1.Data.Source.Epoch, - "targetEpoch1": slashing.Attestation_1.Data.Target.Epoch, - "attestationSlot2": slashing.Attestation_2.Data.Slot, - "beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.Attestation_2.Data.BeaconBlockRoot)), - "sourceEpoch2": slashing.Attestation_2.Data.Source.Epoch, - "targetEpoch2": slashing.Attestation_2.Data.Target.Epoch, + "attestationSlot1": slashing.GetFirstAttestation().GetData().Slot, + "beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.GetFirstAttestation().GetData().BeaconBlockRoot)), + "sourceEpoch1": slashing.GetFirstAttestation().GetData().Source.Epoch, + "targetEpoch1": slashing.GetFirstAttestation().GetData().Target.Epoch, + "attestationSlot2": slashing.GetSecondAttestation().GetData().Slot, + "beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.GetSecondAttestation().GetData().BeaconBlockRoot)), + "sourceEpoch2": slashing.GetSecondAttestation().GetData().Source.Epoch, + "targetEpoch2": slashing.GetSecondAttestation().GetData().Target.Epoch, }).Info("Attester slashing was included") } } diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index 5b4cc57b38d4..96f11a78f746 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -20,9 +20,9 @@ go_library( "//cache/lru:go_default_library", "//config/features:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", @@ -49,6 +49,7 @@ go_test( "//beacon-chain/operations/attestations/kv:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/BUILD.bazel b/beacon-chain/operations/attestations/kv/BUILD.bazel index 807bc292003f..a2daf64e8378 100644 --- a/beacon-chain/operations/attestations/kv/BUILD.bazel +++ b/beacon-chain/operations/attestations/kv/BUILD.bazel @@ -15,9 +15,9 @@ go_library( deps = [ "//beacon-chain/core/helpers:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "@com_github_patrickmn_go_cache//:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -39,6 +39,7 @@ go_test( embed = [":go_default_library"], deps = [ "//config/fieldparams:go_default_library", + "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index 2bcf16190a3f..8c11767db2ef 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" log "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -28,13 +28,13 @@ func (c *AttCaches) AggregateUnaggregatedAttestations(ctx context.Context) error return c.aggregateUnaggregatedAtts(ctx, unaggregatedAtts) } -func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedAtts []*ethpb.Attestation) error { +func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedAtts []interfaces.Attestation) error { _, span := trace.StartSpan(ctx, "operations.attestations.kv.aggregateUnaggregatedAtts") defer span.End() - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(unaggregatedAtts)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(unaggregatedAtts)) for _, att := range unaggregatedAtts { - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { return err } @@ -66,12 +66,12 @@ func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedA // aggregateParallel aggregates attestations in parallel for `atts` and saves them in the pool, // returns the unaggregated attestations that weren't able to aggregate. // Given `n` CPU cores, it creates a channel of size `n` and spawns `n` goroutines to aggregate attestations -func (c *AttCaches) aggregateParallel(atts map[[32]byte][]*ethpb.Attestation, leftOver map[[32]byte]bool) map[[32]byte]bool { +func (c *AttCaches) aggregateParallel(atts map[[32]byte][]interfaces.Attestation, leftOver map[[32]byte]bool) map[[32]byte]bool { var leftoverLock sync.Mutex wg := sync.WaitGroup{} n := runtime.GOMAXPROCS(0) // defaults to the value of runtime.NumCPU - ch := make(chan []*ethpb.Attestation, n) + ch := make(chan []interfaces.Attestation, n) wg.Add(n) for i := 0; i < n; i++ { go func() { @@ -87,7 +87,7 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]*ethpb.Attestation, le continue } if helpers.IsAggregated(aggregated) { - if err := c.SaveAggregatedAttestations([]*ethpb.Attestation{aggregated}); err != nil { + if err := c.SaveAggregatedAttestations([]interfaces.Attestation{aggregated}); err != nil { log.WithError(err).Error("could not save aggregated attestation") continue } @@ -116,7 +116,7 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]*ethpb.Attestation, le } // SaveAggregatedAttestation saves an aggregated attestation in cache. -func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveAggregatedAttestation(att interfaces.Attestation) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } @@ -139,16 +139,16 @@ func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error { return nil } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation") } - copiedAtt := ethpb.CopyAttestation(att) + copiedAtt := interfaces.CopyAttestation(att) c.aggregatedAttLock.Lock() defer c.aggregatedAttLock.Unlock() atts, ok := c.aggregatedAtt[r] if !ok { - atts := []*ethpb.Attestation{copiedAtt} + atts := []interfaces.Attestation{copiedAtt} c.aggregatedAtt[r] = atts return nil } @@ -163,7 +163,7 @@ func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error { } // SaveAggregatedAttestations saves a list of aggregated attestations in cache. -func (c *AttCaches) SaveAggregatedAttestations(atts []*ethpb.Attestation) error { +func (c *AttCaches) SaveAggregatedAttestations(atts []interfaces.Attestation) error { for _, att := range atts { if err := c.SaveAggregatedAttestation(att); err != nil { log.WithError(err).Debug("Could not save aggregated attestation") @@ -176,11 +176,11 @@ func (c *AttCaches) SaveAggregatedAttestations(atts []*ethpb.Attestation) error } // AggregatedAttestations returns the aggregated attestations in cache. -func (c *AttCaches) AggregatedAttestations() []*ethpb.Attestation { +func (c *AttCaches) AggregatedAttestations() []interfaces.Attestation { c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() - atts := make([]*ethpb.Attestation, 0) + atts := make([]interfaces.Attestation, 0) for _, a := range c.aggregatedAtt { atts = append(atts, a...) @@ -191,16 +191,16 @@ func (c *AttCaches) AggregatedAttestations() []*ethpb.Attestation { // AggregatedAttestationsBySlotIndex returns the aggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation { +func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation { _, span := trace.StartSpan(ctx, "operations.attestations.kv.AggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]*ethpb.Attestation, 0) + atts := make([]interfaces.Attestation, 0) c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() for _, a := range c.aggregatedAtt { - if slot == a[0].Data.Slot && committeeIndex == a[0].Data.CommitteeIndex { + if slot == a[0].GetData().Slot && committeeIndex == a[0].GetData().CommitteeIndex { atts = append(atts, a...) } } @@ -209,14 +209,14 @@ func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot } // DeleteAggregatedAttestation deletes the aggregated attestations in cache. -func (c *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteAggregatedAttestation(att interfaces.Attestation) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } if !helpers.IsAggregated(att) { return errors.New("attestation is not aggregated") } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation data") } @@ -232,9 +232,9 @@ func (c *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error { return nil } - filtered := make([]*ethpb.Attestation, 0) + filtered := make([]interfaces.Attestation, 0) for _, a := range attList { - if c, err := att.AggregationBits.Contains(a.AggregationBits); err != nil { + if c, err := att.GetAggregationBits().Contains(a.GetAggregationBits()); err != nil { return err } else if !c { filtered = append(filtered, a) @@ -250,11 +250,11 @@ func (c *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error { } // HasAggregatedAttestation checks if the input attestations has already existed in cache. -func (c *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, error) { +func (c *AttCaches) HasAggregatedAttestation(att interfaces.Attestation) (bool, error) { if err := helpers.ValidateNilAttestation(att); err != nil { return false, err } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return false, errors.Wrap(err, "could not tree hash attestation") } @@ -263,7 +263,7 @@ func (c *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, erro defer c.aggregatedAttLock.RUnlock() if atts, ok := c.aggregatedAtt[r]; ok { for _, a := range atts { - if c, err := a.AggregationBits.Contains(att.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return false, err } else if c { return true, nil @@ -275,7 +275,7 @@ func (c *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, erro defer c.blockAttLock.RUnlock() if atts, ok := c.blockAtt[r]; ok { for _, a := range atts { - if c, err := a.AggregationBits.Contains(att.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return false, err } else if c { return true, nil diff --git a/beacon-chain/operations/attestations/kv/aggregated_test.go b/beacon-chain/operations/attestations/kv/aggregated_test.go index 0ad4b5a43239..37a8e5013ddd 100644 --- a/beacon-chain/operations/attestations/kv/aggregated_test.go +++ b/beacon-chain/operations/attestations/kv/aggregated_test.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -30,7 +31,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) { att6 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1010}, Signature: sig1.Marshal()}) att7 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig1.Marshal()}) att8 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1001}, Signature: sig2.Marshal()}) - atts := []*ethpb.Attestation{att1, att2, att3, att4, att5, att6, att7, att8} + atts := []interfaces.Attestation{att1, att2, att3, att4, att5, att6, att7, att8} require.NoError(t, cache.SaveUnaggregatedAttestations(atts)) require.NoError(t, cache.AggregateUnaggregatedAttestations(context.Background())) @@ -41,7 +42,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { tests := []struct { name string - att *ethpb.Attestation + att interfaces.Attestation count int wantErrString string }{ @@ -118,13 +119,13 @@ func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestations(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation count int wantErrString string }{ { name: "no duplicates", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, @@ -153,13 +154,13 @@ func TestKV_Aggregated_SaveAggregatedAttestations(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestations_SomeGoodSomeBad(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation count int wantErrString string }{ { name: "the first attestation is bad", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1100}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, @@ -191,7 +192,7 @@ func TestKV_Aggregated_AggregatedAttestations(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveAggregatedAttestation(att)) @@ -199,7 +200,7 @@ func TestKV_Aggregated_AggregatedAttestations(t *testing.T) { returned := cache.AggregatedAttestations() sort.Slice(returned, func(i, j int) bool { - return returned[i].Data.Slot < returned[j].Data.Slot + return returned[i].GetData().Slot < returned[j].GetData().Slot }) assert.DeepSSZEqual(t, atts, returned) } @@ -246,13 +247,13 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11010}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11010}}) att4 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b10101}}) - atts := []*ethpb.Attestation{att1, att2, att3, att4} + atts := []interfaces.Attestation{att1, att2, att3, att4} require.NoError(t, cache.SaveAggregatedAttestations(atts)) require.NoError(t, cache.DeleteAggregatedAttestation(att1)) require.NoError(t, cache.DeleteAggregatedAttestation(att3)) returned := cache.AggregatedAttestations() - wanted := []*ethpb.Attestation{att2} + wanted := []interfaces.Attestation{att2} assert.DeepEqual(t, wanted, returned) }) @@ -262,16 +263,16 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110111}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110100}}) att4 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110101}}) - atts := []*ethpb.Attestation{att1, att2, att3, att4} + atts := []interfaces.Attestation{att1, att2, att3, att4} require.NoError(t, cache.SaveAggregatedAttestations(atts)) assert.Equal(t, 2, cache.AggregatedAttestationCount(), "Unexpected number of atts") require.NoError(t, cache.DeleteAggregatedAttestation(att4)) returned := cache.AggregatedAttestations() - wanted := []*ethpb.Attestation{att1, att2} + wanted := []interfaces.Attestation{att1, att2} sort.Slice(returned, func(i, j int) bool { - return string(returned[i].AggregationBits) < string(returned[j].AggregationBits) + return string(returned[i].GetAggregationBits()) < string(returned[j].GetAggregationBits()) }) assert.DeepEqual(t, wanted, returned) }) @@ -280,7 +281,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { tests := []struct { name string - existing []*ethpb.Attestation + existing []interfaces.Attestation input *ethpb.Attestation want bool err error @@ -319,7 +320,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with exact match", - existing: []*ethpb.Attestation{{ + existing: []interfaces.Attestation{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -334,7 +335,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with subset aggregation", - existing: []*ethpb.Attestation{{ + existing: []interfaces.Attestation{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -349,7 +350,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with superset aggregation", - existing: []*ethpb.Attestation{{ + existing: []interfaces.Attestation{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -364,14 +365,14 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with same data in cache with overlapping aggregation, input is subset", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), AggregationBits: bitfield.Bitlist{0b1111000}, }, - { + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -387,14 +388,14 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with same data in cache with overlapping aggregation and input is superset", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), AggregationBits: bitfield.Bitlist{0b1111000}, }, - { + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -410,14 +411,14 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with different data in cache", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 2, }), AggregationBits: bitfield.Bitlist{0b1111000}, }, - { + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 3, }), @@ -433,8 +434,8 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "attestations with different bitlist lengths", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 2, }), diff --git a/beacon-chain/operations/attestations/kv/block.go b/beacon-chain/operations/attestations/kv/block.go index 757fe8766b20..797deb6913c1 100644 --- a/beacon-chain/operations/attestations/kv/block.go +++ b/beacon-chain/operations/attestations/kv/block.go @@ -2,15 +2,15 @@ package kv import ( "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ) // SaveBlockAttestation saves an block attestation in cache. -func (c *AttCaches) SaveBlockAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveBlockAttestation(att interfaces.Attestation) error { if att == nil { return nil } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation") } @@ -19,26 +19,26 @@ func (c *AttCaches) SaveBlockAttestation(att *ethpb.Attestation) error { defer c.blockAttLock.Unlock() atts, ok := c.blockAtt[r] if !ok { - atts = make([]*ethpb.Attestation, 0, 1) + atts = make([]interfaces.Attestation, 0, 1) } // Ensure that this attestation is not already fully contained in an existing attestation. for _, a := range atts { - if c, err := a.AggregationBits.Contains(att.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return err } else if c { return nil } } - c.blockAtt[r] = append(atts, ethpb.CopyAttestation(att)) + c.blockAtt[r] = append(atts, interfaces.CopyAttestation(att)) return nil } // BlockAttestations returns the block attestations in cache. -func (c *AttCaches) BlockAttestations() []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, 0) +func (c *AttCaches) BlockAttestations() []interfaces.Attestation { + atts := make([]interfaces.Attestation, 0) c.blockAttLock.RLock() defer c.blockAttLock.RUnlock() @@ -50,11 +50,11 @@ func (c *AttCaches) BlockAttestations() []*ethpb.Attestation { } // DeleteBlockAttestation deletes a block attestation in cache. -func (c *AttCaches) DeleteBlockAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteBlockAttestation(att interfaces.Attestation) error { if att == nil { return nil } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation") } diff --git a/beacon-chain/operations/attestations/kv/block_test.go b/beacon-chain/operations/attestations/kv/block_test.go index 52fc996e50ef..c1a26181e925 100644 --- a/beacon-chain/operations/attestations/kv/block_test.go +++ b/beacon-chain/operations/attestations/kv/block_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -17,7 +18,7 @@ func TestKV_BlockAttestation_CanSaveRetrieve(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveBlockAttestation(att)) @@ -31,7 +32,7 @@ func TestKV_BlockAttestation_CanSaveRetrieve(t *testing.T) { returned := cache.BlockAttestations() sort.Slice(returned, func(i, j int) bool { - return returned[i].Data.Slot < returned[j].Data.Slot + return returned[i].GetData().Slot < returned[j].GetData().Slot }) assert.DeepEqual(t, atts, returned) @@ -43,7 +44,7 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveBlockAttestation(att)) @@ -53,6 +54,6 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) { require.NoError(t, cache.DeleteBlockAttestation(att3)) returned := cache.BlockAttestations() - wanted := []*ethpb.Attestation{att2} + wanted := []interfaces.Attestation{att2} assert.DeepEqual(t, wanted, returned) } diff --git a/beacon-chain/operations/attestations/kv/forkchoice.go b/beacon-chain/operations/attestations/kv/forkchoice.go index 323a2a41b098..202b6ef8998f 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice.go +++ b/beacon-chain/operations/attestations/kv/forkchoice.go @@ -2,11 +2,11 @@ package kv import ( "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ) // SaveForkchoiceAttestation saves an forkchoice attestation in cache. -func (c *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveForkchoiceAttestation(att interfaces.Attestation) error { if att == nil { return nil } @@ -15,7 +15,7 @@ func (c *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error { return errors.Wrap(err, "could not tree hash attestation") } - att = ethpb.CopyAttestation(att) + att = interfaces.CopyAttestation(att) c.forkchoiceAttLock.Lock() defer c.forkchoiceAttLock.Unlock() c.forkchoiceAtt[r] = att @@ -24,7 +24,7 @@ func (c *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error { } // SaveForkchoiceAttestations saves a list of forkchoice attestations in cache. -func (c *AttCaches) SaveForkchoiceAttestations(atts []*ethpb.Attestation) error { +func (c *AttCaches) SaveForkchoiceAttestations(atts []interfaces.Attestation) error { for _, att := range atts { if err := c.SaveForkchoiceAttestation(att); err != nil { return err @@ -35,20 +35,20 @@ func (c *AttCaches) SaveForkchoiceAttestations(atts []*ethpb.Attestation) error } // ForkchoiceAttestations returns the forkchoice attestations in cache. -func (c *AttCaches) ForkchoiceAttestations() []*ethpb.Attestation { +func (c *AttCaches) ForkchoiceAttestations() []interfaces.Attestation { c.forkchoiceAttLock.RLock() defer c.forkchoiceAttLock.RUnlock() - atts := make([]*ethpb.Attestation, 0, len(c.forkchoiceAtt)) + atts := make([]interfaces.Attestation, 0, len(c.forkchoiceAtt)) for _, att := range c.forkchoiceAtt { - atts = append(atts, ethpb.CopyAttestation(att) /* Copied */) + atts = append(atts, interfaces.CopyAttestation(att) /* Copied */) } return atts } // DeleteForkchoiceAttestation deletes a forkchoice attestation in cache. -func (c *AttCaches) DeleteForkchoiceAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteForkchoiceAttestation(att interfaces.Attestation) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/forkchoice_test.go b/beacon-chain/operations/attestations/kv/forkchoice_test.go index aa04117a1c2e..005c53f79b70 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice_test.go +++ b/beacon-chain/operations/attestations/kv/forkchoice_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -17,7 +18,7 @@ func TestKV_Forkchoice_CanSaveRetrieve(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveForkchoiceAttestation(att)) @@ -26,7 +27,7 @@ func TestKV_Forkchoice_CanSaveRetrieve(t *testing.T) { returned := cache.ForkchoiceAttestations() sort.Slice(returned, func(i, j int) bool { - return returned[i].Data.Slot < returned[j].Data.Slot + return returned[i].GetData().Slot < returned[j].GetData().Slot }) assert.DeepEqual(t, atts, returned) @@ -38,7 +39,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveForkchoiceAttestation(att)) @@ -48,7 +49,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) { require.NoError(t, cache.DeleteForkchoiceAttestation(att3)) returned := cache.ForkchoiceAttestations() - wanted := []*ethpb.Attestation{att2} + wanted := []interfaces.Attestation{att2} assert.DeepEqual(t, wanted, returned) } diff --git a/beacon-chain/operations/attestations/kv/kv.go b/beacon-chain/operations/attestations/kv/kv.go index 93bbcfef44dd..f6bd3bcd70dd 100644 --- a/beacon-chain/operations/attestations/kv/kv.go +++ b/beacon-chain/operations/attestations/kv/kv.go @@ -9,8 +9,8 @@ import ( "github.com/patrickmn/go-cache" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) var hashFn = hash.Proto @@ -20,13 +20,13 @@ var hashFn = hash.Proto // such are unaggregated, aggregated or attestations within a block. type AttCaches struct { aggregatedAttLock sync.RWMutex - aggregatedAtt map[[32]byte][]*ethpb.Attestation + aggregatedAtt map[[32]byte][]interfaces.Attestation unAggregateAttLock sync.RWMutex - unAggregatedAtt map[[32]byte]*ethpb.Attestation + unAggregatedAtt map[[32]byte]interfaces.Attestation forkchoiceAttLock sync.RWMutex - forkchoiceAtt map[[32]byte]*ethpb.Attestation + forkchoiceAtt map[[32]byte]interfaces.Attestation blockAttLock sync.RWMutex - blockAtt map[[32]byte][]*ethpb.Attestation + blockAtt map[[32]byte][]interfaces.Attestation seenAtt *cache.Cache } @@ -36,10 +36,10 @@ func NewAttCaches() *AttCaches { secsInEpoch := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) c := cache.New(secsInEpoch*time.Second, 2*secsInEpoch*time.Second) pool := &AttCaches{ - unAggregatedAtt: make(map[[32]byte]*ethpb.Attestation), - aggregatedAtt: make(map[[32]byte][]*ethpb.Attestation), - forkchoiceAtt: make(map[[32]byte]*ethpb.Attestation), - blockAtt: make(map[[32]byte][]*ethpb.Attestation), + unAggregatedAtt: make(map[[32]byte]interfaces.Attestation), + aggregatedAtt: make(map[[32]byte][]interfaces.Attestation), + forkchoiceAtt: make(map[[32]byte]interfaces.Attestation), + blockAtt: make(map[[32]byte][]interfaces.Attestation), seenAtt: c, } diff --git a/beacon-chain/operations/attestations/kv/seen_bits.go b/beacon-chain/operations/attestations/kv/seen_bits.go index 0992b52a39a9..aceb7f875362 100644 --- a/beacon-chain/operations/attestations/kv/seen_bits.go +++ b/beacon-chain/operations/attestations/kv/seen_bits.go @@ -4,11 +4,11 @@ import ( "github.com/patrickmn/go-cache" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ) -func (c *AttCaches) insertSeenBit(att *ethpb.Attestation) error { - r, err := hashFn(att.Data) +func (c *AttCaches) insertSeenBit(att interfaces.Attestation) error { + r, err := hashFn(att.GetData()) if err != nil { return err } @@ -21,7 +21,7 @@ func (c *AttCaches) insertSeenBit(att *ethpb.Attestation) error { } alreadyExists := false for _, bit := range seenBits { - if c, err := bit.Contains(att.AggregationBits); err != nil { + if c, err := bit.Contains(att.GetAggregationBits()); err != nil { return err } else if c { alreadyExists = true @@ -29,18 +29,18 @@ func (c *AttCaches) insertSeenBit(att *ethpb.Attestation) error { } } if !alreadyExists { - seenBits = append(seenBits, att.AggregationBits) + seenBits = append(seenBits, att.GetAggregationBits()) } c.seenAtt.Set(string(r[:]), seenBits, cache.DefaultExpiration /* one epoch */) return nil } - c.seenAtt.Set(string(r[:]), []bitfield.Bitlist{att.AggregationBits}, cache.DefaultExpiration /* one epoch */) + c.seenAtt.Set(string(r[:]), []bitfield.Bitlist{att.GetAggregationBits()}, cache.DefaultExpiration /* one epoch */) return nil } -func (c *AttCaches) hasSeenBit(att *ethpb.Attestation) (bool, error) { - r, err := hashFn(att.Data) +func (c *AttCaches) hasSeenBit(att interfaces.Attestation) (bool, error) { + r, err := hashFn(att.GetData()) if err != nil { return false, err } @@ -52,7 +52,7 @@ func (c *AttCaches) hasSeenBit(att *ethpb.Attestation) (bool, error) { return false, errors.New("could not convert to bitlist type") } for _, bit := range seenBits { - if c, err := bit.Contains(att.AggregationBits); err != nil { + if c, err := bit.Contains(att.GetAggregationBits()); err != nil { return false, err } else if c { return true, nil diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index 2275f6cb6143..e16e36cbc745 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -5,13 +5,13 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" ) // SaveUnaggregatedAttestation saves an unaggregated attestation in cache. -func (c *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveUnaggregatedAttestation(att interfaces.Attestation) error { if att == nil { return nil } @@ -31,7 +31,7 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error { if err != nil { return errors.Wrap(err, "could not tree hash attestation") } - att = ethpb.CopyAttestation(att) // Copied. + att = interfaces.CopyAttestation(att) // Copied. c.unAggregateAttLock.Lock() defer c.unAggregateAttLock.Unlock() c.unAggregatedAtt[r] = att @@ -40,7 +40,7 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error { } // SaveUnaggregatedAttestations saves a list of unaggregated attestations in cache. -func (c *AttCaches) SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error { +func (c *AttCaches) SaveUnaggregatedAttestations(atts []interfaces.Attestation) error { for _, att := range atts { if err := c.SaveUnaggregatedAttestation(att); err != nil { return err @@ -51,18 +51,18 @@ func (c *AttCaches) SaveUnaggregatedAttestations(atts []*ethpb.Attestation) erro } // UnaggregatedAttestations returns all the unaggregated attestations in cache. -func (c *AttCaches) UnaggregatedAttestations() ([]*ethpb.Attestation, error) { +func (c *AttCaches) UnaggregatedAttestations() ([]interfaces.Attestation, error) { c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() unAggregatedAtts := c.unAggregatedAtt - atts := make([]*ethpb.Attestation, 0, len(unAggregatedAtts)) + atts := make([]interfaces.Attestation, 0, len(unAggregatedAtts)) for _, att := range unAggregatedAtts { seen, err := c.hasSeenBit(att) if err != nil { return nil, err } if !seen { - atts = append(atts, ethpb.CopyAttestation(att) /* Copied */) + atts = append(atts, interfaces.CopyAttestation(att) /* Copied */) } } return atts, nil @@ -70,18 +70,18 @@ func (c *AttCaches) UnaggregatedAttestations() ([]*ethpb.Attestation, error) { // UnaggregatedAttestationsBySlotIndex returns the unaggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation { +func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation { _, span := trace.StartSpan(ctx, "operations.attestations.kv.UnaggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]*ethpb.Attestation, 0) + atts := make([]interfaces.Attestation, 0) c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() unAggregatedAtts := c.unAggregatedAtt for _, a := range unAggregatedAtts { - if slot == a.Data.Slot && committeeIndex == a.Data.CommitteeIndex { + if slot == a.GetData().Slot && committeeIndex == a.GetData().CommitteeIndex { atts = append(atts, a) } } @@ -90,7 +90,7 @@ func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slo } // DeleteUnaggregatedAttestation deletes the unaggregated attestations in cache. -func (c *AttCaches) DeleteUnaggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteUnaggregatedAttestation(att interfaces.Attestation) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/unaggregated_test.go b/beacon-chain/operations/attestations/kv/unaggregated_test.go index 690899ee1684..115199d1b1e5 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated_test.go +++ b/beacon-chain/operations/attestations/kv/unaggregated_test.go @@ -10,6 +10,7 @@ import ( fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -19,7 +20,7 @@ import ( func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { tests := []struct { name string - att *ethpb.Attestation + att interfaces.Attestation count int wantErrString string }{ @@ -66,8 +67,8 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { cache.seenAtt.Set(string(r[:]), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration) assert.Equal(t, 0, len(cache.unAggregatedAtt), "Invalid start pool, atts: %d", len(cache.unAggregatedAtt)) - if tt.att != nil && tt.att.Signature == nil { - tt.att.Signature = make([]byte, fieldparams.BLSSignatureLength) + if tt.att != nil && tt.att.GetSignature() == nil { + tt.att.(*ethpb.Attestation).Signature = make([]byte, fieldparams.BLSSignatureLength) } err := cache.SaveUnaggregatedAttestation(tt.att) @@ -85,13 +86,13 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { func TestKV_Unaggregated_SaveUnaggregatedAttestations(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation count int wantErrString string }{ { name: "unaggregated only", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}}), @@ -100,9 +101,9 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestations(t *testing.T) { }, { name: "has aggregated", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}}), - {AggregationBits: bitfield.Bitlist{0b1111}, Data: ðpb.AttestationData{Slot: 2}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b1111}, Data: ðpb.AttestationData{Slot: 2}}, util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}}), }, wantErrString: "attestation is aggregated", @@ -145,14 +146,14 @@ func TestKV_Unaggregated_DeleteUnaggregatedAttestation(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b110}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} require.NoError(t, cache.SaveUnaggregatedAttestations(atts)) for _, att := range atts { assert.NoError(t, cache.DeleteUnaggregatedAttestation(att)) } returned, err := cache.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{}, returned) + assert.DeepEqual(t, []interfaces.Attestation{}, returned) }) } @@ -168,7 +169,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { t.Run("none seen", func(t *testing.T) { cache := NewAttCaches() - atts := []*ethpb.Attestation{ + atts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -185,7 +186,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { t.Run("some seen", func(t *testing.T) { cache := NewAttCaches() - atts := []*ethpb.Attestation{ + atts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -202,15 +203,15 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { assert.Equal(t, 2, cache.UnaggregatedAttestationCount()) returned, err := cache.UnaggregatedAttestations() sort.Slice(returned, func(i, j int) bool { - return bytes.Compare(returned[i].AggregationBits, returned[j].AggregationBits) < 0 + return bytes.Compare(returned[i].GetAggregationBits(), returned[j].GetAggregationBits()) < 0 }) require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{atts[0], atts[2]}, returned) + assert.DeepEqual(t, []interfaces.Attestation{atts[0], atts[2]}, returned) }) t.Run("all seen", func(t *testing.T) { cache := NewAttCaches() - atts := []*ethpb.Attestation{ + atts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -229,7 +230,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { assert.Equal(t, 0, cache.UnaggregatedAttestationCount()) returned, err := cache.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{}, returned) + assert.DeepEqual(t, []interfaces.Attestation{}, returned) }) } @@ -246,9 +247,9 @@ func TestKV_Unaggregated_UnaggregatedAttestationsBySlotIndex(t *testing.T) { } ctx := context.Background() returned := cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 1) - assert.DeepEqual(t, []*ethpb.Attestation{att1}, returned) + assert.DeepEqual(t, []interfaces.Attestation{att1}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 2) - assert.DeepEqual(t, []*ethpb.Attestation{att2}, returned) + assert.DeepEqual(t, []interfaces.Attestation{att2}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 2, 1) - assert.DeepEqual(t, []*ethpb.Attestation{att3}, returned) + assert.DeepEqual(t, []interfaces.Attestation{att3}, returned) } diff --git a/beacon-chain/operations/attestations/pool.go b/beacon-chain/operations/attestations/pool.go index 55de969da7ae..d6d457079099 100644 --- a/beacon-chain/operations/attestations/pool.go +++ b/beacon-chain/operations/attestations/pool.go @@ -4,8 +4,8 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations/kv" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // Pool defines the necessary methods for Prysm attestations pool to serve @@ -15,30 +15,30 @@ import ( type Pool interface { // For Aggregated attestations AggregateUnaggregatedAttestations(ctx context.Context) error - SaveAggregatedAttestation(att *ethpb.Attestation) error - SaveAggregatedAttestations(atts []*ethpb.Attestation) error - AggregatedAttestations() []*ethpb.Attestation - AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation - DeleteAggregatedAttestation(att *ethpb.Attestation) error - HasAggregatedAttestation(att *ethpb.Attestation) (bool, error) + SaveAggregatedAttestation(att interfaces.Attestation) error + SaveAggregatedAttestations(atts []interfaces.Attestation) error + AggregatedAttestations() []interfaces.Attestation + AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation + DeleteAggregatedAttestation(att interfaces.Attestation) error + HasAggregatedAttestation(att interfaces.Attestation) (bool, error) AggregatedAttestationCount() int // For unaggregated attestations. - SaveUnaggregatedAttestation(att *ethpb.Attestation) error - SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error - UnaggregatedAttestations() ([]*ethpb.Attestation, error) - UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation - DeleteUnaggregatedAttestation(att *ethpb.Attestation) error + SaveUnaggregatedAttestation(att interfaces.Attestation) error + SaveUnaggregatedAttestations(atts []interfaces.Attestation) error + UnaggregatedAttestations() ([]interfaces.Attestation, error) + UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation + DeleteUnaggregatedAttestation(att interfaces.Attestation) error DeleteSeenUnaggregatedAttestations() (int, error) UnaggregatedAttestationCount() int // For attestations that were included in the block. - SaveBlockAttestation(att *ethpb.Attestation) error - BlockAttestations() []*ethpb.Attestation - DeleteBlockAttestation(att *ethpb.Attestation) error + SaveBlockAttestation(att interfaces.Attestation) error + BlockAttestations() []interfaces.Attestation + DeleteBlockAttestation(att interfaces.Attestation) error // For attestations to be passed to fork choice. - SaveForkchoiceAttestation(att *ethpb.Attestation) error - SaveForkchoiceAttestations(atts []*ethpb.Attestation) error - ForkchoiceAttestations() []*ethpb.Attestation - DeleteForkchoiceAttestation(att *ethpb.Attestation) error + SaveForkchoiceAttestation(att interfaces.Attestation) error + SaveForkchoiceAttestations(atts []interfaces.Attestation) error + ForkchoiceAttestations() []interfaces.Attestation + DeleteForkchoiceAttestation(att interfaces.Attestation) error ForkchoiceAttestationCount() int } diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index f0f443b6b1fb..bb0840d629c2 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -9,8 +9,8 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -67,7 +67,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { atts := append(s.cfg.Pool.AggregatedAttestations(), s.cfg.Pool.BlockAttestations()...) atts = append(atts, s.cfg.Pool.ForkchoiceAttestations()...) - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(atts)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(atts)) // Consolidate attestations by aggregating them by similar data root. for _, att := range atts { @@ -79,7 +79,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { continue } - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { return err } @@ -103,10 +103,10 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { // This aggregates a list of attestations using the aggregation algorithm defined in AggregateAttestations // and saves the attestations for fork choice. -func (s *Service) aggregateAndSaveForkChoiceAtts(atts []*ethpb.Attestation) error { - clonedAtts := make([]*ethpb.Attestation, len(atts)) +func (s *Service) aggregateAndSaveForkChoiceAtts(atts []interfaces.Attestation) error { + clonedAtts := make([]interfaces.Attestation, len(atts)) for i, a := range atts { - clonedAtts[i] = ethpb.CopyAttestation(a) + clonedAtts[i] = interfaces.CopyAttestation(a) } aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) if err != nil { @@ -118,12 +118,12 @@ func (s *Service) aggregateAndSaveForkChoiceAtts(atts []*ethpb.Attestation) erro // This checks if the attestation has previously been aggregated for fork choice // return true if yes, false if no. -func (s *Service) seen(att *ethpb.Attestation) (bool, error) { - attRoot, err := hash.Proto(att.Data) +func (s *Service) seen(att interfaces.Attestation) (bool, error) { + attRoot, err := hash.Proto(att.GetData()) if err != nil { return false, err } - incomingBits := att.AggregationBits + incomingBits := att.GetAggregationBits() savedBits, ok := s.forkChoiceProcessedRoots.Get(attRoot) if ok { savedBitlist, ok := savedBits.(bitfield.Bitlist) diff --git a/beacon-chain/operations/attestations/prepare_forkchoice_test.go b/beacon-chain/operations/attestations/prepare_forkchoice_test.go index 916fc4a04b1a..11578b7729a7 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice_test.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" @@ -25,35 +26,35 @@ func TestBatchAttestations_Multiple(t *testing.T) { sig := priv.Sign([]byte("dummy_test_data")) var mockRoot [32]byte - unaggregatedAtts := []*ethpb.Attestation{ - {Data: ðpb.AttestationData{ + unaggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 1, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 0, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, } - aggregatedAtts := []*ethpb.Attestation{ - {Data: ðpb.AttestationData{ + aggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b111000}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 1, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100011}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 0, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, @@ -93,12 +94,12 @@ func TestBatchAttestations_Multiple(t *testing.T) { } require.NoError(t, s.batchForkChoiceAtts(context.Background())) - wanted, err := attaggregation.Aggregate([]*ethpb.Attestation{aggregatedAtts[0], blockAtts[0]}) + wanted, err := attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[0], blockAtts[0]}) require.NoError(t, err) - aggregated, err := attaggregation.Aggregate([]*ethpb.Attestation{aggregatedAtts[1], blockAtts[1]}) + aggregated, err := attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[1], blockAtts[1]}) require.NoError(t, err) wanted = append(wanted, aggregated...) - aggregated, err = attaggregation.Aggregate([]*ethpb.Attestation{aggregatedAtts[2], blockAtts[2]}) + aggregated, err = attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[2], blockAtts[2]}) require.NoError(t, err) wanted = append(wanted, aggregated...) @@ -106,10 +107,10 @@ func TestBatchAttestations_Multiple(t *testing.T) { received := s.cfg.Pool.ForkchoiceAttestations() sort.Slice(received, func(i, j int) bool { - return received[i].Data.Slot < received[j].Data.Slot + return received[i].GetData().Slot < received[j].GetData().Slot }) sort.Slice(wanted, func(i, j int) bool { - return wanted[i].Data.Slot < wanted[j].Data.Slot + return wanted[i].GetData().Slot < wanted[j].GetData().Slot }) assert.DeepSSZEqual(t, wanted, received) @@ -129,18 +130,18 @@ func TestBatchAttestations_Single(t *testing.T) { Target: ðpb.Checkpoint{Root: mockRoot[:]}, } - unaggregatedAtts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, + unaggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, } - aggregatedAtts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101100}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, + aggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101100}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, } - blockAtts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, // Duplicated + blockAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, // Duplicated } require.NoError(t, s.cfg.Pool.SaveUnaggregatedAttestations(unaggregatedAtts)) require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(aggregatedAtts)) @@ -174,9 +175,9 @@ func TestAggregateAndSaveForkChoiceAtts_Single(t *testing.T) { Target: ðpb.Checkpoint{Root: mockRoot[:]}, } - atts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}} + atts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}} require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts)) wanted, err := attaggregation.Aggregate(atts) @@ -204,19 +205,19 @@ func TestAggregateAndSaveForkChoiceAtts_Multiple(t *testing.T) { require.Equal(t, true, ok, "Entity is not of type *ethpb.AttestationData") d2.Slot = 2 - atts1 := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}, + atts1 := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts1)) - atts2 := []*ethpb.Attestation{ - {Data: d1, AggregationBits: bitfield.Bitlist{0b10110}, Signature: sig.Marshal()}, - {Data: d1, AggregationBits: bitfield.Bitlist{0b11100}, Signature: sig.Marshal()}, - {Data: d1, AggregationBits: bitfield.Bitlist{0b11000}, Signature: sig.Marshal()}, + atts2 := []interfaces.Attestation{ + ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b10110}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b11100}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b11000}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts2)) - att3 := []*ethpb.Attestation{ - {Data: d2, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig.Marshal()}, + att3 := []interfaces.Attestation{ + ðpb.Attestation{Data: d2, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(att3)) @@ -230,7 +231,7 @@ func TestAggregateAndSaveForkChoiceAtts_Multiple(t *testing.T) { received := s.cfg.Pool.ForkchoiceAttestations() sort.Slice(received, func(i, j int) bool { - return received[i].Data.Slot < received[j].Data.Slot + return received[i].GetData().Slot < received[j].GetData().Slot }) for i, a := range wanted { assert.Equal(t, true, proto.Equal(a, received[i])) diff --git a/beacon-chain/operations/attestations/prune_expired.go b/beacon-chain/operations/attestations/prune_expired.go index e956fee3a61e..5bbe29c77fbc 100644 --- a/beacon-chain/operations/attestations/prune_expired.go +++ b/beacon-chain/operations/attestations/prune_expired.go @@ -29,7 +29,7 @@ func (s *Service) pruneAttsPool() { func (s *Service) pruneExpiredAtts() { aggregatedAtts := s.cfg.Pool.AggregatedAttestations() for _, att := range aggregatedAtts { - if s.expired(att.Data.Slot) { + if s.expired(att.GetData().Slot) { if err := s.cfg.Pool.DeleteAggregatedAttestation(att); err != nil { log.WithError(err).Error("Could not delete expired aggregated attestation") } @@ -46,7 +46,7 @@ func (s *Service) pruneExpiredAtts() { return } for _, att := range unAggregatedAtts { - if s.expired(att.Data.Slot) { + if s.expired(att.GetData().Slot) { if err := s.cfg.Pool.DeleteUnaggregatedAttestation(att); err != nil { log.WithError(err).Error("Could not delete expired unaggregated attestation") } @@ -56,7 +56,7 @@ func (s *Service) pruneExpiredAtts() { blockAtts := s.cfg.Pool.BlockAttestations() for _, att := range blockAtts { - if s.expired(att.Data.Slot) { + if s.expired(att.GetData().Slot) { if err := s.cfg.Pool.DeleteBlockAttestation(att); err != nil { log.WithError(err).Error("Could not delete expired block attestation") } diff --git a/beacon-chain/operations/attestations/prune_expired_test.go b/beacon-chain/operations/attestations/prune_expired_test.go index 816e4689bbe1..99397b3c13d9 100644 --- a/beacon-chain/operations/attestations/prune_expired_test.go +++ b/beacon-chain/operations/attestations/prune_expired_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/async" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -31,15 +32,15 @@ func TestPruneExpired_Ticker(t *testing.T) { ad2 := util.HydrateAttestationData(ðpb.AttestationData{Slot: 1}) - atts := []*ethpb.Attestation{ - {Data: ad1, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, - {Data: ad2, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + atts := []interfaces.Attestation{ + ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, } require.NoError(t, s.cfg.Pool.SaveUnaggregatedAttestations(atts)) require.Equal(t, 2, s.cfg.Pool.UnaggregatedAttestationCount(), "Unexpected number of attestations") - atts = []*ethpb.Attestation{ - {Data: ad1, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, - {Data: ad2, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + atts = []interfaces.Attestation{ + ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, } require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(atts)) assert.Equal(t, 2, s.cfg.Pool.AggregatedAttestationCount()) @@ -57,17 +58,17 @@ func TestPruneExpired_Ticker(t *testing.T) { atts, err := s.cfg.Pool.UnaggregatedAttestations() require.NoError(t, err) for _, attestation := range atts { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { return } } for _, attestation := range s.cfg.Pool.AggregatedAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { return } } for _, attestation := range s.cfg.Pool.BlockAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { return } } @@ -96,7 +97,7 @@ func TestPruneExpired_PruneExpiredAtts(t *testing.T) { att2 := ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1111}} att3 := ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1101}} att4 := ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1110}} - atts := []*ethpb.Attestation{att1, att2, att3, att4} + atts := []interfaces.Attestation{att1, att2, att3, att4} require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(atts)) for _, att := range atts { require.NoError(t, s.cfg.Pool.SaveBlockAttestation(att)) @@ -108,12 +109,12 @@ func TestPruneExpired_PruneExpiredAtts(t *testing.T) { s.pruneExpiredAtts() // All the attestations on slot 0 should be pruned. for _, attestation := range s.cfg.Pool.AggregatedAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { t.Error("Should be pruned") } } for _, attestation := range s.cfg.Pool.BlockAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { t.Error("Should be pruned") } } diff --git a/beacon-chain/operations/slashings/BUILD.bazel b/beacon-chain/operations/slashings/BUILD.bazel index e8d40e847377..3d158ccce832 100644 --- a/beacon-chain/operations/slashings/BUILD.bazel +++ b/beacon-chain/operations/slashings/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -47,6 +48,7 @@ go_test( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/operations/slashings/mock/BUILD.bazel b/beacon-chain/operations/slashings/mock/BUILD.bazel index 27ad01733569..d501e4c7ac9d 100644 --- a/beacon-chain/operations/slashings/mock/BUILD.bazel +++ b/beacon-chain/operations/slashings/mock/BUILD.bazel @@ -8,6 +8,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/state:go_default_library", + "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", ], ) diff --git a/beacon-chain/operations/slashings/mock/mock.go b/beacon-chain/operations/slashings/mock/mock.go index 307c5fc9f539..1498b979b8d9 100644 --- a/beacon-chain/operations/slashings/mock/mock.go +++ b/beacon-chain/operations/slashings/mock/mock.go @@ -4,17 +4,18 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // PoolMock is a fake implementation of PoolManager. type PoolMock struct { - PendingAttSlashings []*ethpb.AttesterSlashing + PendingAttSlashings []interfaces.AttesterSlashing PendingPropSlashings []*ethpb.ProposerSlashing } // PendingAttesterSlashings -- -func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*ethpb.AttesterSlashing { +func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []interfaces.AttesterSlashing { return m.PendingAttSlashings } @@ -24,7 +25,7 @@ func (m *PoolMock) PendingProposerSlashings(_ context.Context, _ state.ReadOnlyB } // InsertAttesterSlashing -- -func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *ethpb.AttesterSlashing) error { +func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing interfaces.AttesterSlashing) error { m.PendingAttSlashings = append(m.PendingAttSlashings, slashing) return nil } @@ -36,7 +37,7 @@ func (m *PoolMock) InsertProposerSlashing(_ context.Context, _ state.ReadOnlyBea } // MarkIncludedAttesterSlashing -- -func (*PoolMock) MarkIncludedAttesterSlashing(_ *ethpb.AttesterSlashing) { +func (*PoolMock) MarkIncludedAttesterSlashing(_ interfaces.AttesterSlashing) { panic("implement me") } diff --git a/beacon-chain/operations/slashings/service.go b/beacon-chain/operations/slashings/service.go index 2a808c11c738..2439d9004fac 100644 --- a/beacon-chain/operations/slashings/service.go +++ b/beacon-chain/operations/slashings/service.go @@ -11,6 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -30,7 +31,7 @@ func NewPool() *Pool { // PendingAttesterSlashings returns attester slashings that are able to be included into a block. // This method will return the amount of pending attester slashings for a block transition unless parameter `noLimit` is true // to indicate the request is for noLimit pending items. -func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.AttesterSlashing { +func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []interfaces.AttesterSlashing { p.lock.Lock() defer p.lock.Unlock() _, span := trace.StartSpan(ctx, "operations.PendingAttesterSlashing") @@ -46,7 +47,7 @@ func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnl if noLimit { maxSlashings = uint64(len(p.pendingAttesterSlashing)) } - pending := make([]*ethpb.AttesterSlashing, 0, maxSlashings) + pending := make([]interfaces.AttesterSlashing, 0, maxSlashings) for i := 0; i < len(p.pendingAttesterSlashing); i++ { if uint64(len(pending)) >= maxSlashings { break @@ -63,7 +64,10 @@ func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnl continue } attSlashing := slashing.attesterSlashing - slashedVal := slice.IntersectionUint64(attSlashing.Attestation_1.AttestingIndices, attSlashing.Attestation_2.AttestingIndices) + slashedVal := slice.IntersectionUint64( + attSlashing.GetFirstAttestation().GetAttestingIndices(), + attSlashing.GetSecondAttestation().GetAttestingIndices(), + ) for _, idx := range slashedVal { included[primitives.ValidatorIndex(idx)] = true } @@ -118,7 +122,7 @@ func (p *Pool) PendingProposerSlashings(ctx context.Context, state state.ReadOnl func (p *Pool) InsertAttesterSlashing( ctx context.Context, state state.ReadOnlyBeaconState, - slashing *ethpb.AttesterSlashing, + slashing interfaces.AttesterSlashing, ) error { p.lock.Lock() defer p.lock.Unlock() @@ -129,7 +133,7 @@ func (p *Pool) InsertAttesterSlashing( return errors.Wrap(err, "could not verify attester slashing") } - slashedVal := slice.IntersectionUint64(slashing.Attestation_1.AttestingIndices, slashing.Attestation_2.AttestingIndices) + slashedVal := slice.IntersectionUint64(slashing.GetFirstAttestation().GetAttestingIndices(), slashing.GetSecondAttestation().GetAttestingIndices()) cantSlash := make([]uint64, 0, len(slashedVal)) slashingReason := "" for _, val := range slashedVal { @@ -229,10 +233,10 @@ func (p *Pool) InsertProposerSlashing( // MarkIncludedAttesterSlashing is used when an attester slashing has been included in a beacon block. // Every block seen by this node that contains proposer slashings should call this method to include // the proposer slashings. -func (p *Pool) MarkIncludedAttesterSlashing(as *ethpb.AttesterSlashing) { +func (p *Pool) MarkIncludedAttesterSlashing(as interfaces.AttesterSlashing) { p.lock.Lock() defer p.lock.Unlock() - slashedVal := slice.IntersectionUint64(as.Attestation_1.AttestingIndices, as.Attestation_2.AttestingIndices) + slashedVal := slice.IntersectionUint64(as.GetFirstAttestation().GetAttestingIndices(), as.GetSecondAttestation().GetAttestingIndices()) for _, val := range slashedVal { i := sort.Search(len(p.pendingAttesterSlashing), func(i int) bool { return uint64(p.pendingAttesterSlashing[i].validatorToSlash) >= val diff --git a/beacon-chain/operations/slashings/service_attester_test.go b/beacon-chain/operations/slashings/service_attester_test.go index 3caa4af0fa58..a032d52d2732 100644 --- a/beacon-chain/operations/slashings/service_attester_test.go +++ b/beacon-chain/operations/slashings/service_attester_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -314,7 +315,7 @@ func TestPool_InsertAttesterSlashing_SigFailsVerify_ClearPool(t *testing.T) { // We mess up the signature of the second slashing. badSig := make([]byte, 96) copy(badSig, "muahaha") - pendingSlashings[1].attesterSlashing.Attestation_1.Signature = badSig + pendingSlashings[1].attesterSlashing.(*ethpb.AttesterSlashing).Attestation_1.Signature = badSig slashings[1].Attestation_1.Signature = badSig p := &Pool{ pendingAttesterSlashing: make([]*PendingAttesterSlashing, 0), @@ -455,7 +456,7 @@ func TestPool_PendingAttesterSlashings(t *testing.T) { params.SetupTestConfigCleanup(t) beaconState, privKeys := util.DeterministicGenesisState(t, 64) pendingSlashings := make([]*PendingAttesterSlashing, 20) - slashings := make([]*ethpb.AttesterSlashing, 20) + slashings := make([]interfaces.AttesterSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) @@ -468,14 +469,14 @@ func TestPool_PendingAttesterSlashings(t *testing.T) { tests := []struct { name string fields fields - want []*ethpb.AttesterSlashing + want []interfaces.AttesterSlashing }{ { name: "Empty list", fields: fields{ pending: []*PendingAttesterSlashing{}, }, - want: []*ethpb.AttesterSlashing{}, + want: []interfaces.AttesterSlashing{}, }, { name: "All pending", @@ -530,7 +531,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) { require.NoError(t, beaconState.UpdateValidatorAtIndex(5, val)) pendingSlashings := make([]*PendingAttesterSlashing, 20) pendingSlashings2 := make([]*PendingAttesterSlashing, 20) - slashings := make([]*ethpb.AttesterSlashing, 20) + slashings := make([]interfaces.AttesterSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) @@ -548,7 +549,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) { tests := []struct { name string fields fields - want []*ethpb.AttesterSlashing + want []interfaces.AttesterSlashing }{ { name: "One item", @@ -588,7 +589,7 @@ func TestPool_PendingAttesterSlashings_NoDuplicates(t *testing.T) { params.OverrideBeaconConfig(conf) beaconState, privKeys := util.DeterministicGenesisState(t, 64) pendingSlashings := make([]*PendingAttesterSlashing, 3) - slashings := make([]*ethpb.AttesterSlashing, 3) + slashings := make([]interfaces.AttesterSlashing, 3) for i := 0; i < 2; i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) diff --git a/beacon-chain/operations/slashings/types.go b/beacon-chain/operations/slashings/types.go index 2cb418f9923f..6bc6785f97b7 100644 --- a/beacon-chain/operations/slashings/types.go +++ b/beacon-chain/operations/slashings/types.go @@ -5,6 +5,7 @@ import ( "sync" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -14,7 +15,7 @@ type PoolInserter interface { InsertAttesterSlashing( ctx context.Context, state state.ReadOnlyBeaconState, - slashing *ethpb.AttesterSlashing, + slashing interfaces.AttesterSlashing, ) error InsertProposerSlashing( ctx context.Context, @@ -27,9 +28,9 @@ type PoolInserter interface { // This pool is used by proposers to insert data into new blocks. type PoolManager interface { PoolInserter - PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.AttesterSlashing + PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []interfaces.AttesterSlashing PendingProposerSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.ProposerSlashing - MarkIncludedAttesterSlashing(as *ethpb.AttesterSlashing) + MarkIncludedAttesterSlashing(as interfaces.AttesterSlashing) MarkIncludedProposerSlashing(ps *ethpb.ProposerSlashing) } @@ -44,6 +45,6 @@ type Pool struct { // PendingAttesterSlashing represents an attester slashing in the operation pool. // Allows for easy binary searching of included validator indexes. type PendingAttesterSlashing struct { - attesterSlashing *ethpb.AttesterSlashing + attesterSlashing interfaces.AttesterSlashing validatorToSlash primitives.ValidatorIndex } diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index ddbbf7b5b105..0ef51faed3e6 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -57,6 +57,7 @@ go_library( "//cmd/beacon-chain/flags:go_default_library", "//config/features:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/wrapper:go_default_library", "//container/leaky-bucket:go_default_library", diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index f5923d95a8c8..43a0270ee2d0 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -56,7 +57,7 @@ func (s *Service) Broadcast(ctx context.Context, msg proto.Message) error { // BroadcastAttestation broadcasts an attestation to the p2p network, the message is assumed to be // broadcasted to the current fork. -func (s *Service) BroadcastAttestation(ctx context.Context, subnet uint64, att *ethpb.Attestation) error { +func (s *Service) BroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation) error { if att == nil { return errors.New("attempted to broadcast nil attestation") } @@ -96,7 +97,7 @@ func (s *Service) BroadcastSyncCommitteeMessage(ctx context.Context, subnet uint return nil } -func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint64, att *ethpb.Attestation, forkDigest [4]byte) { +func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation, forkDigest [4]byte) { _, span := trace.StartSpan(ctx, "p2p.internalBroadcastAttestation") defer span.End() ctx = trace.NewContext(context.Background(), span) // clear parent context / deadline. @@ -112,8 +113,8 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 span.AddAttributes( trace.BoolAttribute("hasPeer", hasPeer), - trace.Int64Attribute("slot", int64(att.Data.Slot)), // lint:ignore uintcast -- It's safe to do this for tracing. - trace.Int64Attribute("subnet", int64(subnet)), // lint:ignore uintcast -- It's safe to do this for tracing. + trace.Int64Attribute("slot", int64(att.GetData().Slot)), // lint:ignore uintcast -- It's safe to do this for tracing. + trace.Int64Attribute("subnet", int64(subnet)), // lint:ignore uintcast -- It's safe to do this for tracing. ) if !hasPeer { @@ -138,9 +139,9 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 // In the event our attestation is outdated and beyond the // acceptable threshold, we exit early and do not broadcast it. currSlot := slots.CurrentSlot(uint64(s.genesisTime.Unix())) - if err := helpers.ValidateAttestationTime(att.Data.Slot, s.genesisTime, params.BeaconConfig().MaximumGossipClockDisparityDuration()); err != nil { + if err := helpers.ValidateAttestationTime(att.GetData().Slot, s.genesisTime, params.BeaconConfig().MaximumGossipClockDisparityDuration()); err != nil { log.WithFields(logrus.Fields{ - "attestationSlot": att.Data.Slot, + "attestationSlot": att.GetData().Slot, "currentSlot": currSlot, }).WithError(err).Warning("Attestation is too old to broadcast, discarding it") return diff --git a/beacon-chain/p2p/interfaces.go b/beacon-chain/p2p/interfaces.go index f08c874721f4..112eadcb2bfd 100644 --- a/beacon-chain/p2p/interfaces.go +++ b/beacon-chain/p2p/interfaces.go @@ -12,6 +12,7 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "google.golang.org/protobuf/proto" @@ -33,7 +34,7 @@ type P2P interface { // Broadcaster broadcasts messages to peers over the p2p pubsub protocol. type Broadcaster interface { Broadcast(context.Context, proto.Message) error - BroadcastAttestation(ctx context.Context, subnet uint64, att *ethpb.Attestation) error + BroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation) error BroadcastSyncCommitteeMessage(ctx context.Context, subnet uint64, sMsg *ethpb.SyncCommitteeMessage) error BroadcastBlob(ctx context.Context, subnet uint64, blob *ethpb.BlobSidecar) error } diff --git a/beacon-chain/p2p/testing/BUILD.bazel b/beacon-chain/p2p/testing/BUILD.bazel index e6c2e8fe9030..c4dea6b2b45f 100644 --- a/beacon-chain/p2p/testing/BUILD.bazel +++ b/beacon-chain/p2p/testing/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//beacon-chain/p2p/encoder:go_default_library", "//beacon-chain/p2p/peers:go_default_library", "//beacon-chain/p2p/peers/scorers:go_default_library", + "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/metadata:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", diff --git a/beacon-chain/p2p/testing/fuzz_p2p.go b/beacon-chain/p2p/testing/fuzz_p2p.go index a37445f0c11c..ce70a1c62e0d 100644 --- a/beacon-chain/p2p/testing/fuzz_p2p.go +++ b/beacon-chain/p2p/testing/fuzz_p2p.go @@ -12,6 +12,7 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "google.golang.org/protobuf/proto" @@ -134,7 +135,7 @@ func (_ *FakeP2P) Broadcast(_ context.Context, _ proto.Message) error { } // BroadcastAttestation -- fake. -func (_ *FakeP2P) BroadcastAttestation(_ context.Context, _ uint64, _ *ethpb.Attestation) error { +func (_ *FakeP2P) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { return nil } diff --git a/beacon-chain/p2p/testing/mock_broadcaster.go b/beacon-chain/p2p/testing/mock_broadcaster.go index 5f38499300b1..336fda939b62 100644 --- a/beacon-chain/p2p/testing/mock_broadcaster.go +++ b/beacon-chain/p2p/testing/mock_broadcaster.go @@ -5,6 +5,7 @@ import ( "sync" "sync/atomic" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -13,7 +14,7 @@ import ( type MockBroadcaster struct { BroadcastCalled atomic.Bool BroadcastMessages []proto.Message - BroadcastAttestations []*ethpb.Attestation + BroadcastAttestations []interfaces.Attestation msgLock sync.Mutex attLock sync.Mutex } @@ -28,7 +29,7 @@ func (m *MockBroadcaster) Broadcast(_ context.Context, msg proto.Message) error } // BroadcastAttestation records a broadcast occurred. -func (m *MockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, a *ethpb.Attestation) error { +func (m *MockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, a interfaces.Attestation) error { m.BroadcastCalled.Store(true) m.attLock.Lock() defer m.attLock.Unlock() diff --git a/beacon-chain/p2p/testing/p2p.go b/beacon-chain/p2p/testing/p2p.go index 013c369d4386..5c471ac3dd01 100644 --- a/beacon-chain/p2p/testing/p2p.go +++ b/beacon-chain/p2p/testing/p2p.go @@ -25,6 +25,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/scorers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/sirupsen/logrus" @@ -166,7 +167,7 @@ func (p *TestP2P) Broadcast(_ context.Context, _ proto.Message) error { } // BroadcastAttestation broadcasts an attestation. -func (p *TestP2P) BroadcastAttestation(_ context.Context, _ uint64, _ *ethpb.Attestation) error { +func (p *TestP2P) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { p.BroadcastCalled.Store(true) return nil } diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 03567b8be205..7e446588ab9e 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -878,7 +878,13 @@ func (s *Server) GetBlockAttestations(w http.ResponseWriter, r *http.Request) { consensusAtts := blk.Block().Body().Attestations() atts := make([]*structs.Attestation, len(consensusAtts)) for i, att := range consensusAtts { - atts[i] = structs.AttFromConsensus(att) + a, ok := att.(*eth.Attestation) + if ok { + atts[i] = structs.AttFromConsensus(a) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert consensus attestations of type %T", att), http.StatusInternalServerError) + return + } } root, err := blk.Block().HashTreeRoot() if err != nil { diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool.go b/beacon-chain/rpc/eth/beacon/handlers_pool.go index 49f6e313c532..eee3a7a70dad 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool.go @@ -58,7 +58,13 @@ func (s *Server) ListAttestations(w http.ResponseWriter, r *http.Request) { if isEmptyReq { allAtts := make([]*structs.Attestation, len(attestations)) for i, att := range attestations { - allAtts[i] = structs.AttFromConsensus(att) + a, ok := att.(*eth.Attestation) + if ok { + allAtts[i] = structs.AttFromConsensus(a) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert attestations of type %T", att), http.StatusInternalServerError) + return + } } httputil.WriteJson(w, &structs.ListAttestationsResponse{Data: allAtts}) return @@ -67,11 +73,17 @@ func (s *Server) ListAttestations(w http.ResponseWriter, r *http.Request) { bothDefined := rawSlot != "" && rawCommitteeIndex != "" filteredAtts := make([]*structs.Attestation, 0, len(attestations)) for _, att := range attestations { - committeeIndexMatch := rawCommitteeIndex != "" && att.Data.CommitteeIndex == primitives.CommitteeIndex(committeeIndex) - slotMatch := rawSlot != "" && att.Data.Slot == primitives.Slot(slot) + committeeIndexMatch := rawCommitteeIndex != "" && att.GetData().CommitteeIndex == primitives.CommitteeIndex(committeeIndex) + slotMatch := rawSlot != "" && att.GetData().Slot == primitives.Slot(slot) shouldAppend := (bothDefined && committeeIndexMatch && slotMatch) || (!bothDefined && (committeeIndexMatch || slotMatch)) if shouldAppend { - filteredAtts = append(filteredAtts, structs.AttFromConsensus(att)) + a, ok := att.(*eth.Attestation) + if ok { + filteredAtts = append(filteredAtts, structs.AttFromConsensus(a)) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert attestations of type %T", att), http.StatusInternalServerError) + return + } } } httputil.WriteJson(w, &structs.ListAttestationsResponse{Data: filteredAtts}) @@ -455,7 +467,17 @@ func (s *Server) GetAttesterSlashings(w http.ResponseWriter, r *http.Request) { return } sourceSlashings := s.SlashingsPool.PendingAttesterSlashings(ctx, headState, true /* return unlimited slashings */) - slashings := structs.AttesterSlashingsFromConsensus(sourceSlashings) + ss := make([]*eth.AttesterSlashing, 0, len(sourceSlashings)) + for _, slashing := range sourceSlashings { + s, ok := slashing.(*eth.AttesterSlashing) + if ok { + ss = append(ss, s) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert slashing of type %T", slashing), http.StatusInternalServerError) + return + } + } + slashings := structs.AttesterSlashingsFromConsensus(ss) httputil.WriteJson(w, &structs.GetAttesterSlashingsResponse{Data: slashings}) } diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool_test.go b/beacon-chain/rpc/eth/beacon/handlers_pool_test.go index 808e057db9aa..5386320c2554 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool_test.go @@ -29,6 +29,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/crypto/bls/common" @@ -115,8 +116,8 @@ func TestListAttestations(t *testing.T) { s := &Server{ AttestationsPool: attestations.NewPool(), } - require.NoError(t, s.AttestationsPool.SaveAggregatedAttestations([]*ethpbv1alpha1.Attestation{att1, att2})) - require.NoError(t, s.AttestationsPool.SaveUnaggregatedAttestations([]*ethpbv1alpha1.Attestation{att3, att4})) + require.NoError(t, s.AttestationsPool.SaveAggregatedAttestations([]interfaces.Attestation{att1, att2})) + require.NoError(t, s.AttestationsPool.SaveUnaggregatedAttestations([]interfaces.Attestation{att3, att4})) t.Run("empty request", func(t *testing.T) { url := "http://example.com" @@ -240,15 +241,15 @@ func TestSubmitAttestations(t *testing.T) { assert.Equal(t, http.StatusOK, writer.Code) assert.Equal(t, true, broadcaster.BroadcastCalled.Load()) assert.Equal(t, 1, broadcaster.NumAttestations()) - assert.Equal(t, "0x03", hexutil.Encode(broadcaster.BroadcastAttestations[0].AggregationBits)) - assert.Equal(t, "0x8146f4397bfd8fd057ebbcd6a67327bdc7ed5fb650533edcb6377b650dea0b6da64c14ecd60846d5c0a0cd43893d6972092500f82c9d8a955e2b58c5ed3cbe885d84008ace6bd86ba9e23652f58e2ec207cec494c916063257abf285b9b15b15", hexutil.Encode(broadcaster.BroadcastAttestations[0].Signature)) - assert.Equal(t, primitives.Slot(0), broadcaster.BroadcastAttestations[0].Data.Slot) - assert.Equal(t, primitives.CommitteeIndex(0), broadcaster.BroadcastAttestations[0].Data.CommitteeIndex) - assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].Data.BeaconBlockRoot)) - assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].Data.Source.Root)) - assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].Data.Source.Epoch) - assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].Data.Target.Root)) - assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].Data.Target.Epoch) + assert.Equal(t, "0x03", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetAggregationBits())) + assert.Equal(t, "0x8146f4397bfd8fd057ebbcd6a67327bdc7ed5fb650533edcb6377b650dea0b6da64c14ecd60846d5c0a0cd43893d6972092500f82c9d8a955e2b58c5ed3cbe885d84008ace6bd86ba9e23652f58e2ec207cec494c916063257abf285b9b15b15", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetSignature())) + assert.Equal(t, primitives.Slot(0), broadcaster.BroadcastAttestations[0].GetData().Slot) + assert.Equal(t, primitives.CommitteeIndex(0), broadcaster.BroadcastAttestations[0].GetData().CommitteeIndex) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetData().BeaconBlockRoot)) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetData().Source.Root)) + assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].GetData().Source.Epoch) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetData().Target.Root)) + assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].GetData().Target.Epoch) assert.Equal(t, 1, s.AttestationsPool.UnaggregatedAttestationCount()) }) t.Run("multiple", func(t *testing.T) { @@ -1060,7 +1061,7 @@ func TestGetAttesterSlashings(t *testing.T) { s := &Server{ ChainInfoFetcher: &blockchainmock.ChainService{State: bs}, - SlashingsPool: &slashingsmock.PoolMock{PendingAttSlashings: []*ethpbv1alpha1.AttesterSlashing{slashing1, slashing2}}, + SlashingsPool: &slashingsmock.PoolMock{PendingAttSlashings: []interfaces.AttesterSlashing{slashing1, slashing2}}, } request := httptest.NewRequest(http.MethodGet, "http://example.com/beacon/pool/attester_slashings", nil) diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index f795688bf5ce..419848a71cb2 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -22,6 +22,7 @@ go_library( "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 9382766d44ad..776dddf1980d 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -22,6 +22,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -173,7 +174,11 @@ func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, req if !ok { return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) } - att := structs.AttFromConsensus(attData.Attestation) + a, ok := attData.Attestation.(*eth.Attestation) + if !ok { + return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) + } + att := structs.AttFromConsensus(a) return send(w, flusher, AttestationTopic, att) case operation.ExitReceived: if _, ok := requestedTopics[VoluntaryExitTopic]; !ok { @@ -229,7 +234,11 @@ func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, req if !ok { return write(w, flusher, topicDataMismatch, event.Data, AttesterSlashingTopic) } - return send(w, flusher, AttesterSlashingTopic, structs.AttesterSlashingFromConsensus(attesterSlashingData.AttesterSlashing)) + slashing, ok := attesterSlashingData.AttesterSlashing.(*eth.AttesterSlashing) + if ok { + return send(w, flusher, AttesterSlashingTopic, structs.AttesterSlashingFromConsensus(slashing)) + } + // TODO: extend to Electra case operation.ProposerSlashingReceived: if _, ok := requestedTopics[ProposerSlashingTopic]; !ok { return nil diff --git a/beacon-chain/rpc/eth/rewards/handlers_test.go b/beacon-chain/rpc/eth/rewards/handlers_test.go index aa41b308a5b6..1acfa44b503b 100644 --- a/beacon-chain/rpc/eth/rewards/handlers_test.go +++ b/beacon-chain/rpc/eth/rewards/handlers_test.go @@ -104,18 +104,18 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int sbb.SetSlot(2) // we have to set the proposer index to the value that will be randomly chosen (fortunately it's deterministic) sbb.SetProposerIndex(12) - sbb.SetAttestations([]*eth.Attestation{ - { + require.NoError(t, sbb.SetAttestations([]interfaces.Attestation{ + ð.Attestation{ AggregationBits: bitfield.Bitlist{0b00000111}, Data: util.HydrateAttestationData(ð.AttestationData{}), Signature: make([]byte, fieldparams.BLSSignatureLength), }, - { + ð.Attestation{ AggregationBits: bitfield.Bitlist{0b00000111}, Data: util.HydrateAttestationData(ð.AttestationData{}), Signature: make([]byte, fieldparams.BLSSignatureLength), }, - }) + })) attData1 := util.HydrateAttestationData(ð.AttestationData{BeaconBlockRoot: bytesutil.PadTo([]byte("root1"), 32)}) attData2 := util.HydrateAttestationData(ð.AttestationData{BeaconBlockRoot: bytesutil.PadTo([]byte("root2"), 32)}) @@ -125,8 +125,8 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int require.NoError(t, err) sigRoot2, err := signing.ComputeSigningRoot(attData2, domain) require.NoError(t, err) - sbb.SetAttesterSlashings([]*eth.AttesterSlashing{ - { + require.NoError(t, sbb.SetAttesterSlashings([]interfaces.AttesterSlashing{ + ð.AttesterSlashing{ Attestation_1: ð.IndexedAttestation{ AttestingIndices: []uint64{0}, Data: attData1, @@ -138,7 +138,7 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int Signature: secretKeys[0].Sign(sigRoot2[:]).Marshal(), }, }, - }) + })) header1 := ð.BeaconBlockHeader{ Slot: 0, ProposerIndex: 1, diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 5ab2597a0c09..4533938fe277 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//config/params:go_default_library", "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", @@ -79,6 +80,7 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 53cff078d2b5..6bd914c365fc 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -25,6 +25,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -52,7 +53,7 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) return } - var match *ethpbalpha.Attestation + var match interfaces.Attestation var err error match, err = matchingAtt(s.AttestationsPool.AggregatedAttestations(), primitives.Slot(slot), attDataRoot) @@ -79,29 +80,29 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) response := &structs.AggregateAttestationResponse{ Data: &structs.Attestation{ - AggregationBits: hexutil.Encode(match.AggregationBits), + AggregationBits: hexutil.Encode(match.GetAggregationBits()), Data: &structs.AttestationData{ - Slot: strconv.FormatUint(uint64(match.Data.Slot), 10), - CommitteeIndex: strconv.FormatUint(uint64(match.Data.CommitteeIndex), 10), - BeaconBlockRoot: hexutil.Encode(match.Data.BeaconBlockRoot), + Slot: strconv.FormatUint(uint64(match.GetData().Slot), 10), + CommitteeIndex: strconv.FormatUint(uint64(match.GetData().CommitteeIndex), 10), + BeaconBlockRoot: hexutil.Encode(match.GetData().BeaconBlockRoot), Source: &structs.Checkpoint{ - Epoch: strconv.FormatUint(uint64(match.Data.Source.Epoch), 10), - Root: hexutil.Encode(match.Data.Source.Root), + Epoch: strconv.FormatUint(uint64(match.GetData().Source.Epoch), 10), + Root: hexutil.Encode(match.GetData().Source.Root), }, Target: &structs.Checkpoint{ - Epoch: strconv.FormatUint(uint64(match.Data.Target.Epoch), 10), - Root: hexutil.Encode(match.Data.Target.Root), + Epoch: strconv.FormatUint(uint64(match.GetData().Target.Epoch), 10), + Root: hexutil.Encode(match.GetData().Target.Root), }, }, - Signature: hexutil.Encode(match.Signature), + Signature: hexutil.Encode(match.GetSignature()), }} httputil.WriteJson(w, response) } -func matchingAtt(atts []*ethpbalpha.Attestation, slot primitives.Slot, attDataRoot []byte) (*ethpbalpha.Attestation, error) { +func matchingAtt(atts []interfaces.Attestation, slot primitives.Slot, attDataRoot []byte) (interfaces.Attestation, error) { for _, att := range atts { - if att.Data.Slot == slot { - root, err := att.Data.HashTreeRoot() + if att.GetData().Slot == slot { + root, err := att.GetData().HashTreeRoot() if err != nil { return nil, errors.Wrap(err, "could not get attestation data root") } diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 178d6fcb0c00..6ef0a4ce3db1 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -33,6 +33,7 @@ import ( mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -143,9 +144,9 @@ func TestGetAggregateAttestation(t *testing.T) { } pool := attestations.NewPool() - err := pool.SaveAggregatedAttestations([]*ethpbalpha.Attestation{attSlot1, attslot21, attslot22}) + err := pool.SaveAggregatedAttestations([]interfaces.Attestation{attSlot1, attslot21, attslot22}) assert.NoError(t, err) - err = pool.SaveUnaggregatedAttestations([]*ethpbalpha.Attestation{attslot31, attslot32}) + err = pool.SaveUnaggregatedAttestations([]interfaces.Attestation{attslot31, attslot32}) assert.NoError(t, err) s := &Server{ @@ -314,7 +315,7 @@ func TestGetAggregateAttestation_SameSlotAndRoot_ReturnMostAggregationBits(t *te Signature: sig, } pool := attestations.NewPool() - err := pool.SaveAggregatedAttestations([]*ethpbalpha.Attestation{att1, att2}) + err := pool.SaveAggregatedAttestations([]interfaces.Attestation{att1, att2}) assert.NoError(t, err) s := &Server{ AttestationsPool: pool, diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go index 28d9f5fc2713..fc8dc7b2c494 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go @@ -21,7 +21,7 @@ import ( // sortableAttestations implements the Sort interface to sort attestations // by slot as the canonical sorting attribute. -type sortableAttestations []*ethpb.Attestation +type sortableAttestations []interfaces.Attestation // Len is the number of elements in the collection. func (s sortableAttestations) Len() int { return len(s) } @@ -31,16 +31,16 @@ func (s sortableAttestations) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // Less reports whether the element with index i must sort before the element with index j. func (s sortableAttestations) Less(i, j int) bool { - return s[i].Data.Slot < s[j].Data.Slot + return s[i].GetData().Slot < s[j].GetData().Slot } -func mapAttestationsByTargetRoot(atts []*ethpb.Attestation) map[[32]byte][]*ethpb.Attestation { - attsMap := make(map[[32]byte][]*ethpb.Attestation, len(atts)) +func mapAttestationsByTargetRoot(atts []interfaces.Attestation) map[[32]byte][]interfaces.Attestation { + attsMap := make(map[[32]byte][]interfaces.Attestation, len(atts)) if len(atts) == 0 { return attsMap } for _, att := range atts { - attsMap[bytesutil.ToBytes32(att.Data.Target.Root)] = append(attsMap[bytesutil.ToBytes32(att.Data.Target.Root)], att) + attsMap[bytesutil.ToBytes32(att.GetData().Target.Root)] = append(attsMap[bytesutil.ToBytes32(att.GetData().Target.Root)], att) } return attsMap } @@ -74,7 +74,7 @@ func (bs *Server) ListAttestations( default: return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - atts := make([]*ethpb.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + atts := make([]interfaces.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) for _, blk := range blocks { atts = append(atts, blk.Block().Body().Attestations()...) } @@ -96,8 +96,15 @@ func (bs *Server) ListAttestations( if err != nil { return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) } + attestations := make([]*ethpb.Attestation, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*ethpb.Attestation) + if ok { + attestations = append(attestations, a) + } + } return ðpb.ListAttestationsResponse{ - Attestations: atts[start:end], + Attestations: attestations[start:end], TotalSize: int32(numAttestations), NextPageToken: nextPageToken, }, nil @@ -129,7 +136,7 @@ func (bs *Server) ListIndexedAttestations( return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - attsArray := make([]*ethpb.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + attsArray := make([]interfaces.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) for _, b := range blocks { attsArray = append(attsArray, b.Block().Body().Attestations()...) } @@ -166,7 +173,7 @@ func (bs *Server) ListIndexedAttestations( } for i := 0; i < len(atts); i++ { att := atts[i] - committee, err := helpers.BeaconCommitteeFromState(ctx, attState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, attState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, status.Errorf( codes.Internal, @@ -178,7 +185,10 @@ func (bs *Server) ListIndexedAttestations( if err != nil { return nil, err } - indexedAtts = append(indexedAtts, idxAtt) + a, ok := idxAtt.(*ethpb.IndexedAttestation) + if ok { + indexedAtts = append(indexedAtts, a) + } } } @@ -226,8 +236,15 @@ func (bs *Server) AttestationPool( if err != nil { return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) } + attestations := make([]*ethpb.Attestation, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*ethpb.Attestation) + if ok { + attestations = append(attestations, a) + } + } return ðpb.AttestationPoolResponse{ - Attestations: atts[start:end], + Attestations: attestations[start:end], TotalSize: int32(numAtts), NextPageToken: nextPageToken, }, nil diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go index be9ef9238967..bcc63c7c4705 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go @@ -263,7 +263,7 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { ctx := context.Background() count := params.BeaconConfig().SlotsPerEpoch * 4 - atts := make([]*ethpb.Attestation, 0, count) + atts := make([]interfaces.Attestation, 0, count) for i := primitives.Slot(0); i < params.BeaconConfig().SlotsPerEpoch; i++ { for s := primitives.CommitteeIndex(0); s < 4; s++ { blockExample := util.NewBeaconBlock() @@ -278,7 +278,11 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }), } util.SaveBlock(t, ctx, db, blockExample) - atts = append(atts, blockExample.Block.Body.Attestations...) + as := make([]interfaces.Attestation, len(blockExample.Block.Body.Attestations)) + for i, a := range blockExample.Block.Body.Attestations { + as[i] = a + } + atts = append(atts, as...) } } sort.Sort(sortableAttestations(atts)) @@ -303,9 +307,9 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }, res: ðpb.ListAttestationsResponse{ Attestations: []*ethpb.Attestation{ - atts[3], - atts[4], - atts[5], + atts[3].(*ethpb.Attestation), + atts[4].(*ethpb.Attestation), + atts[5].(*ethpb.Attestation), }, NextPageToken: strconv.Itoa(2), TotalSize: int32(count), @@ -322,7 +326,7 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }, res: ðpb.ListAttestationsResponse{ Attestations: []*ethpb.Attestation{ - atts[10], + atts[10].(*ethpb.Attestation), }, NextPageToken: strconv.Itoa(11), TotalSize: int32(count), @@ -339,14 +343,14 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }, res: ðpb.ListAttestationsResponse{ Attestations: []*ethpb.Attestation{ - atts[16], - atts[17], - atts[18], - atts[19], - atts[20], - atts[21], - atts[22], - atts[23], + atts[16].(*ethpb.Attestation), + atts[17].(*ethpb.Attestation), + atts[18].(*ethpb.Attestation), + atts[19].(*ethpb.Attestation), + atts[20].(*ethpb.Attestation), + atts[21].(*ethpb.Attestation), + atts[22].(*ethpb.Attestation), + atts[23].(*ethpb.Attestation), }, NextPageToken: strconv.Itoa(3), TotalSize: int32(count)}, @@ -460,7 +464,7 @@ func TestServer_ListAttestations_Pagination_DefaultPageSize(t *testing.T) { func TestServer_mapAttestationToTargetRoot(t *testing.T) { count := primitives.Slot(100) - atts := make([]*ethpb.Attestation, count) + atts := make([]interfaces.Attestation, count) targetRoot1 := bytesutil.ToBytes32([]byte("root1")) targetRoot2 := bytesutil.ToBytes32([]byte("root2")) @@ -548,7 +552,9 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { require.NoError(t, err) idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee) require.NoError(t, err, "Could not convert attestation to indexed") - indexedAtts[i] = idxAtt + a, ok := idxAtt.(*ethpb.IndexedAttestation) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i] = a } for i := 0; i < len(atts2); i++ { att := atts2[i] @@ -556,7 +562,9 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { require.NoError(t, err) idxAtt, err := attestation.ConvertToIndexed(ctx, atts2[i], committee) require.NoError(t, err, "Could not convert attestation to indexed") - indexedAtts[i+len(atts)] = idxAtt + a, ok := idxAtt.(*ethpb.IndexedAttestation) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i+len(atts)] = a } bs := &Server{ @@ -588,7 +596,7 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { require.NoError(t, err) assert.Equal(t, len(indexedAtts), len(res.IndexedAttestations), "Incorrect indexted attestations length") sort.Slice(indexedAtts, func(i, j int) bool { - return indexedAtts[i].Data.Slot < indexedAtts[j].Data.Slot + return indexedAtts[i].GetData().Slot < indexedAtts[j].GetData().Slot }) sort.Slice(res.IndexedAttestations, func(i, j int) bool { return res.IndexedAttestations[i].Data.Slot < res.IndexedAttestations[j].Data.Slot @@ -655,7 +663,9 @@ func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) { require.NoError(t, err) idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee) require.NoError(t, err, "Could not convert attestation to indexed") - indexedAtts[i] = idxAtt + a, ok := idxAtt.(*ethpb.IndexedAttestation) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i] = a } bs := &Server{ @@ -697,8 +707,8 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AttestationsPool: attestations.NewPool(), } - atts := []*ethpb.Attestation{ - { + atts := []interfaces.Attestation{ + ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 1, BeaconBlockRoot: bytesutil.PadTo([]byte{1}, 32), @@ -708,7 +718,7 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AggregationBits: bitfield.Bitlist{0b1101}, Signature: bytesutil.PadTo([]byte{1}, fieldparams.BLSSignatureLength), }, - { + ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: bytesutil.PadTo([]byte{2}, 32), @@ -718,7 +728,7 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AggregationBits: bitfield.Bitlist{0b1101}, Signature: bytesutil.PadTo([]byte{2}, fieldparams.BLSSignatureLength), }, - { + ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 3, BeaconBlockRoot: bytesutil.PadTo([]byte{3}, 32), @@ -746,7 +756,7 @@ func TestServer_AttestationPool_Pagination_DefaultPageSize(t *testing.T) { AttestationsPool: attestations.NewPool(), } - atts := make([]*ethpb.Attestation, params.BeaconConfig().DefaultPageSize+1) + atts := make([]interfaces.Attestation, params.BeaconConfig().DefaultPageSize+1) for i := 0; i < len(atts); i++ { att := util.NewAttestation() att.Data.Slot = primitives.Slot(i) @@ -768,7 +778,7 @@ func TestServer_AttestationPool_Pagination_CustomPageSize(t *testing.T) { } numAtts := 100 - atts := make([]*ethpb.Attestation, numAtts) + atts := make([]interfaces.Attestation, numAtts) for i := 0; i < len(atts); i++ { att := util.NewAttestation() att.Data.Slot = primitives.Slot(i) diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go index cbe4e727b451..fe2c7facd850 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go @@ -66,7 +66,7 @@ func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlot targetStates := make(map[[32]byte]state.ReadOnlyBeaconState) for _, blk := range blks { for _, a := range blk.Block().Body().Attestations() { - tr := bytesutil.ToBytes32(a.Data.Target.Root) + tr := bytesutil.ToBytes32(a.GetData().Target.Root) s, ok := targetStates[tr] if !ok { s, err = ds.StateGen.StateByRoot(ctx, tr) @@ -75,16 +75,16 @@ func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlot } targetStates[tr] = s } - c, err := helpers.BeaconCommitteeFromState(ctx, s, a.Data.Slot, a.Data.CommitteeIndex) + c, err := helpers.BeaconCommitteeFromState(ctx, s, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, status.Errorf(codes.Internal, "Could not get committee: %v", err) } - indices, err := attestation.AttestingIndices(a.AggregationBits, c) + indices, err := attestation.AttestingIndices(a.GetAggregationBits(), c) if err != nil { return nil, err } for _, i := range indices { - if req.Id == i && req.Slot == a.Data.Slot { + if req.Id == i && req.Slot == a.GetData().Slot { inclusionSlot = blk.Block().Slot() break } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index c342c3afb8c5..1d5d6d624d33 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -2,6 +2,7 @@ package validator import ( "context" + "fmt" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" @@ -85,22 +86,26 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. // The aggregator should prefer an attestation that they have signed. We check this by // looking at the attestation's committee index against the validator's committee index // and check the aggregate bits to ensure the validator's index is set. - if aggregatedAtt.Data.CommitteeIndex == req.CommitteeIndex && - aggregatedAtt.AggregationBits.BitAt(indexInCommittee) && - (!best.AggregationBits.BitAt(indexInCommittee) || - aggregatedAtt.AggregationBits.Count() > best.AggregationBits.Count()) { + if aggregatedAtt.GetData().CommitteeIndex == req.CommitteeIndex && + aggregatedAtt.GetAggregationBits().BitAt(indexInCommittee) && + (!best.GetAggregationBits().BitAt(indexInCommittee) || + aggregatedAtt.GetAggregationBits().Count() > best.GetAggregationBits().Count()) { best = aggregatedAtt } // If the "best" still doesn't contain the validator's index, check the aggregation bits to // choose the attestation with the most bits set. - if !best.AggregationBits.BitAt(indexInCommittee) && - aggregatedAtt.AggregationBits.Count() > best.AggregationBits.Count() { + if !best.GetAggregationBits().BitAt(indexInCommittee) && + aggregatedAtt.GetAggregationBits().Count() > best.GetAggregationBits().Count() { best = aggregatedAtt } } + att, ok := best.(*ethpb.Attestation) + if !ok { + return nil, fmt.Errorf("best attestation has wrong type (expected %T, got %T)", ðpb.Attestation{}, best) + } a := ðpb.AggregateAttestationAndProof{ - Aggregate: best, + Aggregate: att, SelectionProof: req.SlotSignature, AggregatorIndex: validatorIndex, } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go index e62698661678..ef72ed17ea84 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go @@ -18,6 +18,7 @@ import ( mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -336,7 +337,7 @@ func TestSubmitAggregateAndProof_PreferOwnAttestation(t *testing.T) { pubKey := v.PublicKey req := ðpb.AggregateSelectionRequest{CommitteeIndex: 1, SlotSignature: sig.Marshal(), PublicKey: pubKey} - err = aggregatorServer.AttPool.SaveAggregatedAttestations([]*ethpb.Attestation{ + err = aggregatorServer.AttPool.SaveAggregatedAttestations([]interfaces.Attestation{ att0, att1, att2, @@ -387,7 +388,7 @@ func TestSubmitAggregateAndProof_SelectsMostBitsWhenOwnAttestationNotPresent(t * pubKey := v.PublicKey req := ðpb.AggregateSelectionRequest{CommitteeIndex: 1, SlotSignature: sig.Marshal(), PublicKey: pubKey} - err = aggregatorServer.AttPool.SaveAggregatedAttestations([]*ethpb.Attestation{ + err = aggregatorServer.AttPool.SaveAggregatedAttestations([]interfaces.Attestation{ att0, att1, }) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index b4b5156d5549..a86d771186e7 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -202,17 +202,23 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed deposits, atts, err := vs.packDepositsAndAttestations(ctx, head, eth1Data) // TODO: split attestations and deposits if err != nil { sBlk.SetDeposits([]*ethpb.Deposit{}) - sBlk.SetAttestations([]*ethpb.Attestation{}) + if err := sBlk.SetAttestations([]interfaces.Attestation{}); err != nil { + log.WithError(err).Error("Could not set attestations on block") + } log.WithError(err).Error("Could not pack deposits and attestations") } else { sBlk.SetDeposits(deposits) - sBlk.SetAttestations(atts) + if err := sBlk.SetAttestations(atts); err != nil { + log.WithError(err).Error("Could not set attestations on block") + } } // Set slashings. validProposerSlashings, validAttSlashings := vs.getSlashings(ctx, head) sBlk.SetProposerSlashings(validProposerSlashings) - sBlk.SetAttesterSlashings(validAttSlashings) + if err := sBlk.SetAttesterSlashings(validAttSlashings); err != nil { + log.WithError(err).Error("Could not set attester slashings on block") + } // Set exits. sBlk.SetVoluntaryExits(vs.getExits(head, sBlk.Block().Slot())) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index b1ee701dbf9e..392113bc39c2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -10,16 +10,16 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "go.opencensus.io/trace" ) -type proposerAtts []*ethpb.Attestation +type proposerAtts []interfaces.Attestation -func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]*ethpb.Attestation, error) { +func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]interfaces.Attestation, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.packAttestations") defer span.End() @@ -46,16 +46,16 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon return nil, err } - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(atts)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(atts)) for _, att := range atts { - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { return nil, err } attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) } - attsForInclusion := proposerAtts(make([]*ethpb.Attestation, 0)) + attsForInclusion := proposerAtts(make([]interfaces.Attestation, 0)) for _, as := range attsByDataRoot { as, err := attaggregation.Aggregate(as) if err != nil { @@ -79,8 +79,8 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon // The first group passes the all the required checks for attestation to be considered for proposing. // And attestations from the second group should be deleted. func (a proposerAtts) filter(ctx context.Context, st state.BeaconState) (proposerAtts, proposerAtts) { - validAtts := make([]*ethpb.Attestation, 0, len(a)) - invalidAtts := make([]*ethpb.Attestation, 0, len(a)) + validAtts := make([]interfaces.Attestation, 0, len(a)) + invalidAtts := make([]interfaces.Attestation, 0, len(a)) for _, att := range a { if err := blocks.VerifyAttestationNoVerifySignature(ctx, st, att); err == nil { @@ -107,10 +107,10 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { var slots []primitives.Slot attsBySlot := map[primitives.Slot]proposerAtts{} for _, att := range a { - if _, ok := attsBySlot[att.Data.Slot]; !ok { - slots = append(slots, att.Data.Slot) + if _, ok := attsBySlot[att.GetData().Slot]; !ok { + slots = append(slots, att.GetData().Slot) } - attsBySlot[att.Data.Slot] = append(attsBySlot[att.Data.Slot], att) + attsBySlot[att.GetData().Slot] = append(attsBySlot[att.GetData().Slot], att) } selectAtts := func(atts proposerAtts) (proposerAtts, error) { @@ -120,7 +120,7 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { candidates := make([]*bitfield.Bitlist64, len(atts)) for i := 0; i < len(atts); i++ { var err error - candidates[i], err = atts[i].AggregationBits.ToBitlist64() + candidates[i], err = atts[i].GetAggregationBits().ToBitlist64() if err != nil { return nil, err } @@ -139,10 +139,10 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { leftoverAtts[i] = atts[key] } sort.Slice(selectedAtts, func(i, j int) bool { - return selectedAtts[i].AggregationBits.Count() > selectedAtts[j].AggregationBits.Count() + return selectedAtts[i].GetAggregationBits().Count() > selectedAtts[j].GetAggregationBits().Count() }) sort.Slice(leftoverAtts, func(i, j int) bool { - return leftoverAtts[i].AggregationBits.Count() > leftoverAtts[j].AggregationBits.Count() + return leftoverAtts[i].GetAggregationBits().Count() > leftoverAtts[j].GetAggregationBits().Count() }) return append(selectedAtts, leftoverAtts...), nil } @@ -182,22 +182,22 @@ func (a proposerAtts) dedup() (proposerAtts, error) { if len(a) < 2 { return a, nil } - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(a)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(a)) for _, att := range a { - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { continue } attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) } - uniqAtts := make([]*ethpb.Attestation, 0, len(a)) + uniqAtts := make([]interfaces.Attestation, 0, len(a)) for _, atts := range attsByDataRoot { for i := 0; i < len(atts); i++ { a := atts[i] for j := i + 1; j < len(atts); j++ { b := atts[j] - if c, err := a.AggregationBits.Contains(b.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(b.GetAggregationBits()); err != nil { return nil, err } else if c { // a contains b, b is redundant. @@ -205,7 +205,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { atts[len(atts)-1] = nil atts = atts[:len(atts)-1] j-- - } else if c, err := b.AggregationBits.Contains(a.AggregationBits); err != nil { + } else if c, err := b.GetAggregationBits().Contains(a.GetAggregationBits()); err != nil { return nil, err } else if c { // b contains a, a is redundant. @@ -224,7 +224,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { } // This filters the input attestations to return a list of valid attestations to be packaged inside a beacon block. -func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.BeaconState, atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { +func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.BeaconState, atts []interfaces.Attestation) ([]interfaces.Attestation, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.validateAndDeleteAttsInPool") defer span.End() @@ -237,7 +237,7 @@ func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.Beac // The input attestations are processed and seen by the node, this deletes them from pool // so proposers don't include them in a block for the future. -func (vs *Server) deleteAttsInPool(ctx context.Context, atts []*ethpb.Attestation) error { +func (vs *Server) deleteAttsInPool(ctx context.Context, atts []interfaces.Attestation) error { ctx, span := trace.StartSpan(ctx, "ProposerServer.deleteAttsInPool") defer span.End() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index 38414a7c5653..e1c9480a6d9f 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -14,7 +15,7 @@ import ( ) func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { - atts := proposerAtts([]*ethpb.Attestation{ + atts := proposerAtts([]interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11000000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11100000}}), @@ -22,7 +23,7 @@ func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), }) - want := proposerAtts([]*ethpb.Attestation{ + want := proposerAtts([]interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11110000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), @@ -411,13 +412,13 @@ func TestProposer_ProposerAtts_dedup(t *testing.T) { t.Error(err) } sort.Slice(atts, func(i, j int) bool { - if atts[i].AggregationBits.Count() == atts[j].AggregationBits.Count() { - if atts[i].Data.Slot == atts[j].Data.Slot { - return bytes.Compare(atts[i].AggregationBits, atts[j].AggregationBits) <= 0 + if atts[i].GetAggregationBits().Count() == atts[j].GetAggregationBits().Count() { + if atts[i].GetData().Slot == atts[j].GetData().Slot { + return bytes.Compare(atts[i].GetAggregationBits(), atts[j].GetAggregationBits()) <= 0 } - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot } - return atts[i].AggregationBits.Count() > atts[j].AggregationBits.Count() + return atts[i].GetAggregationBits().Count() > atts[j].GetAggregationBits().Count() }) assert.DeepEqual(t, tt.want, atts) }) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go index 9933be06a54b..be110d9e30fc 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/container/trie" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" @@ -18,10 +19,10 @@ import ( "google.golang.org/grpc/status" ) -func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []*ethpb.Attestation, error) { +func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []interfaces.Attestation, error) { eg, egctx := errgroup.WithContext(ctx) var deposits []*ethpb.Deposit - var atts []*ethpb.Attestation + var atts []interfaces.Attestation eg.Go(func() error { // Pack ETH1 deposits which have not been included in the beacon chain. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go index efb2beef3c12..2658140ac787 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go @@ -6,10 +6,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]*ethpb.ProposerSlashing, []*ethpb.AttesterSlashing) { +func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]*ethpb.ProposerSlashing, []interfaces.AttesterSlashing) { proposerSlashings := vs.SlashingsPool.PendingProposerSlashings(ctx, head, false /*noLimit*/) validProposerSlashings := make([]*ethpb.ProposerSlashing, 0, len(proposerSlashings)) for _, slashing := range proposerSlashings { @@ -21,7 +22,7 @@ func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]* validProposerSlashings = append(validProposerSlashings, slashing) } attSlashings := vs.SlashingsPool.PendingAttesterSlashings(ctx, head, false /*noLimit*/) - validAttSlashings := make([]*ethpb.AttesterSlashing, 0, len(attSlashings)) + validAttSlashings := make([]interfaces.AttesterSlashing, 0, len(attSlashings)) for _, slashing := range attSlashings { _, err := blocks.ProcessAttesterSlashing(ctx, head, slashing, v.SlashValidator) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go index 78f2351c0aee..3411a8b730cd 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -28,7 +29,7 @@ func TestServer_getSlashings(t *testing.T) { require.NoError(t, err) } - attSlashings := make([]*ethpb.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings) + attSlashings := make([]interfaces.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings) for i := uint64(0); i < params.BeaconConfig().MaxAttesterSlashings; i++ { attesterSlashing, err := util.GenerateAttesterSlashingForValidator( beaconState, diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 37b82a7617a5..796cdf1d1af3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -38,6 +38,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/bls" @@ -2396,22 +2397,22 @@ func TestProposer_FilterAttestation(t *testing.T) { tests := []struct { name string wantedErr string - inputAtts func() []*ethpb.Attestation - expectedAtts func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation + inputAtts func() []interfaces.Attestation + expectedAtts func(inputAtts []interfaces.Attestation) []interfaces.Attestation }{ { name: "nil attestations", - inputAtts: func() []*ethpb.Attestation { + inputAtts: func() []interfaces.Attestation { return nil }, - expectedAtts: func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation { - return []*ethpb.Attestation{} + expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { + return []interfaces.Attestation{} }, }, { name: "invalid attestations", - inputAtts: func() []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, 10) + inputAtts: func() []interfaces.Attestation { + atts := make([]interfaces.Attestation, 10) for i := 0; i < len(atts); i++ { atts[i] = util.HydrateAttestation(ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -2421,14 +2422,14 @@ func TestProposer_FilterAttestation(t *testing.T) { } return atts }, - expectedAtts: func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation { - return []*ethpb.Attestation{} + expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { + return []interfaces.Attestation{} }, }, { name: "filter aggregates ok", - inputAtts: func() []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, 10) + inputAtts: func() []interfaces.Attestation { + atts := make([]interfaces.Attestation, 10) for i := 0; i < len(atts); i++ { atts[i] = util.HydrateAttestation(ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -2437,29 +2438,29 @@ func TestProposer_FilterAttestation(t *testing.T) { }, AggregationBits: bitfield.Bitlist{0b00010010}, }) - committee, err := helpers.BeaconCommitteeFromState(context.Background(), st, atts[i].Data.Slot, atts[i].Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(context.Background(), st, atts[i].GetData().Slot, atts[i].GetData().CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(atts[i].AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(atts[i].GetAggregationBits(), committee) require.NoError(t, err) assert.NoError(t, err) domain, err := signing.Domain(st.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, params.BeaconConfig().ZeroHash[:]) require.NoError(t, err) sigs := make([]bls.Signature, len(attestingIndices)) var zeroSig [96]byte - atts[i].Signature = zeroSig[:] + atts[i].(*ethpb.Attestation).Signature = zeroSig[:] for i, indice := range attestingIndices { - hashTreeRoot, err := signing.ComputeSigningRoot(atts[i].Data, domain) + hashTreeRoot, err := signing.ComputeSigningRoot(atts[i].GetData(), domain) require.NoError(t, err) sig := privKeys[indice].Sign(hashTreeRoot[:]) sigs[i] = sig } - atts[i].Signature = bls.AggregateSignatures(sigs).Marshal() + atts[i].(*ethpb.Attestation).Signature = bls.AggregateSignatures(sigs).Marshal() } return atts }, - expectedAtts: func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation { - return []*ethpb.Attestation{inputAtts[0], inputAtts[1]} + expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { + return []interfaces.Attestation{inputAtts[0], inputAtts[1]} }, }, } @@ -2589,10 +2590,10 @@ func TestProposer_DeleteAttsInPool_Aggregated(t *testing.T) { priv, err := bls.RandKey() require.NoError(t, err) sig := priv.Sign([]byte("foo")).Marshal() - aggregatedAtts := []*ethpb.Attestation{ + aggregatedAtts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10101}, Signature: sig}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11010}, Signature: sig})} - unaggregatedAtts := []*ethpb.Attestation{ + unaggregatedAtts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10010}, Signature: sig}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10100}, Signature: sig})} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go index 00f20fe353d9..5fa5071de233 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" aggtesting "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/testing" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -44,10 +45,10 @@ func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { }, } - runner := func(atts []*ethpb.Attestation) { + runner := func(atts []interfaces.Attestation) { attsCopy := make(proposerAtts, len(atts)) for i, att := range atts { - attsCopy[i] = ethpb.CopyAttestation(att) + attsCopy[i] = ethpb.CopyAttestation(att.(*ethpb.Attestation)) } _, err := attsCopy.sortByProfitability() require.NoError(b, err, "Could not sort attestations by profitability") diff --git a/beacon-chain/slasher/BUILD.bazel b/beacon-chain/slasher/BUILD.bazel index 00bf4aaaeacc..60965a8cee7c 100644 --- a/beacon-chain/slasher/BUILD.bazel +++ b/beacon-chain/slasher/BUILD.bazel @@ -36,6 +36,7 @@ go_library( "//beacon-chain/sync:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//encoding/bytesutil:go_default_library", @@ -78,6 +79,7 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/bls/common:go_default_library", diff --git a/beacon-chain/slasher/chunks.go b/beacon-chain/slasher/chunks.go index c8f2f711bafd..dbb08035231f 100644 --- a/beacon-chain/slasher/chunks.go +++ b/beacon-chain/slasher/chunks.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" @@ -26,7 +27,7 @@ type Chunker interface { slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, attestation *slashertypes.IndexedAttestationWrapper, - ) (*ethpb.AttesterSlashing, error) + ) (interfaces.AttesterSlashing, error) Update( chunkIndex uint64, currentEpoch primitives.Epoch, @@ -185,9 +186,9 @@ func (m *MinSpanChunksSlice) CheckSlashable( slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, incomingAttWrapper *slashertypes.IndexedAttestationWrapper, -) (*ethpb.AttesterSlashing, error) { - sourceEpoch := incomingAttWrapper.IndexedAttestation.Data.Source.Epoch - targetEpoch := incomingAttWrapper.IndexedAttestation.Data.Target.Epoch +) (interfaces.AttesterSlashing, error) { + sourceEpoch := incomingAttWrapper.IndexedAttestation.GetData().Source.Epoch + targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch minTarget, err := chunkDataAtEpoch(m.params, m.data, validatorIdx, sourceEpoch) if err != nil { @@ -221,7 +222,7 @@ func (m *MinSpanChunksSlice) CheckSlashable( return nil, nil } - if existingAttWrapper.IndexedAttestation.Data.Source.Epoch <= sourceEpoch { + if existingAttWrapper.IndexedAttestation.GetData().Source.Epoch <= sourceEpoch { // This case should normally not happen, since if we have targetEpoch > minTarget, // then there is at least one attestation we surround. // However, it can happens if we have multiple attestation with the same target @@ -232,16 +233,33 @@ func (m *MinSpanChunksSlice) CheckSlashable( surroundingVotesTotal.Inc() + existing, ok := existingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "existing attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + existingAttWrapper.IndexedAttestation, + ) + } + incoming, ok := incomingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "incoming attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + incomingAttWrapper.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: existingAttWrapper.IndexedAttestation, - Attestation_2: incomingAttWrapper.IndexedAttestation, + Attestation_1: existing, + Attestation_2: incoming, } // Ensure the attestation with the lower data root is the first attestation. if bytes.Compare(existingAttWrapper.DataRoot[:], incomingAttWrapper.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: incomingAttWrapper.IndexedAttestation, - Attestation_2: existingAttWrapper.IndexedAttestation, + Attestation_1: incoming, + Attestation_2: existing, } } @@ -264,9 +282,9 @@ func (m *MaxSpanChunksSlice) CheckSlashable( slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, incomingAttWrapper *slashertypes.IndexedAttestationWrapper, -) (*ethpb.AttesterSlashing, error) { - sourceEpoch := incomingAttWrapper.IndexedAttestation.Data.Source.Epoch - targetEpoch := incomingAttWrapper.IndexedAttestation.Data.Target.Epoch +) (interfaces.AttesterSlashing, error) { + sourceEpoch := incomingAttWrapper.IndexedAttestation.GetData().Source.Epoch + targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch maxTarget, err := chunkDataAtEpoch(m.params, m.data, validatorIdx, sourceEpoch) if err != nil { @@ -300,7 +318,7 @@ func (m *MaxSpanChunksSlice) CheckSlashable( return nil, nil } - if existingAttWrapper.IndexedAttestation.Data.Source.Epoch >= sourceEpoch { + if existingAttWrapper.IndexedAttestation.GetData().Source.Epoch >= sourceEpoch { // This case should normally not happen, since if we have targetEpoch < maxTarget, // then there is at least one attestation that surrounds us. // However, it can happens if we have multiple attestation with the same target @@ -311,16 +329,33 @@ func (m *MaxSpanChunksSlice) CheckSlashable( surroundedVotesTotal.Inc() + existing, ok := existingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "existing attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + existingAttWrapper.IndexedAttestation, + ) + } + incoming, ok := incomingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "incoming attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + incomingAttWrapper.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: existingAttWrapper.IndexedAttestation, - Attestation_2: incomingAttWrapper.IndexedAttestation, + Attestation_1: existing, + Attestation_2: incoming, } // Ensure the attestation with the lower data root is the first attestation. if bytes.Compare(existingAttWrapper.DataRoot[:], incomingAttWrapper.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: incomingAttWrapper.IndexedAttestation, - Attestation_2: existingAttWrapper.IndexedAttestation, + Attestation_1: incoming, + Attestation_2: existing, } } diff --git a/beacon-chain/slasher/chunks_test.go b/beacon-chain/slasher/chunks_test.go index a9519b8a2b77..7fc1ab7a6501 100644 --- a/beacon-chain/slasher/chunks_test.go +++ b/beacon-chain/slasher/chunks_test.go @@ -115,11 +115,11 @@ func TestMinSpanChunksSlice_CheckSlashable(t *testing.T) { // based on our min chunk for either validator. slashing, err := chunk.CheckSlashable(ctx, slasherDB, validatorIdx, att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx.Sub(1), att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up we initialize an empty chunks slice and mark an attestation // with (source 1, target 2) as attested. @@ -141,11 +141,11 @@ func TestMinSpanChunksSlice_CheckSlashable(t *testing.T) { slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx, surroundingVote) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up, we save the old attestation record, then check if the // surrounding vote is indeed slashable. - attData := att.IndexedAttestation.Data + attData := att.IndexedAttestation.GetData() attRecord := createAttestationWrapperEmptySig(t, attData.Source.Epoch, attData.Target.Epoch, []uint64{uint64(validatorIdx)}, []byte{1}) err = slasherDB.SaveAttestationRecordsForValidators( ctx, @@ -193,11 +193,11 @@ func TestMaxSpanChunksSlice_CheckSlashable(t *testing.T) { // based on our max chunk for either validator. slashing, err := chunk.CheckSlashable(ctx, slasherDB, validatorIdx, att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx.Sub(1), att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up we initialize an empty chunks slice and mark an attestation // with (source 0, target 3) as attested. @@ -219,11 +219,11 @@ func TestMaxSpanChunksSlice_CheckSlashable(t *testing.T) { slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx, surroundedVote) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up, we save the old attestation record, then check if the // surroundedVote vote is indeed slashable. - attData := att.IndexedAttestation.Data + attData := att.IndexedAttestation.GetData() signingRoot := [32]byte{1} attRecord := createAttestationWrapperEmptySig( t, attData.Source.Epoch, attData.Target.Epoch, []uint64{uint64(validatorIdx)}, signingRoot[:], diff --git a/beacon-chain/slasher/detect_attestations.go b/beacon-chain/slasher/detect_attestations.go index 8bc349c9b71a..e3ed6abf3915 100644 --- a/beacon-chain/slasher/detect_attestations.go +++ b/beacon-chain/slasher/detect_attestations.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" @@ -18,8 +19,8 @@ import ( // found attester slashings to the caller. func (s *Service) checkSlashableAttestations( ctx context.Context, currentEpoch primitives.Epoch, atts []*slashertypes.IndexedAttestationWrapper, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // Double votes doubleVoteSlashings, err := s.checkDoubleVotes(ctx, atts) @@ -56,13 +57,13 @@ func (s *Service) checkSurroundVotes( ctx context.Context, attWrappers []*slashertypes.IndexedAttestationWrapper, currentEpoch primitives.Epoch, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { // With 256 validators and 16 epochs per chunk, there is 4096 `uint16` elements per chunk. // 4096 `uint16` elements = 8192 bytes = 8KB // 25_600 chunks * 8KB = 200MB const maxChunkBeforeFlush = 25_600 - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // Group attestation wrappers by validator chunk index. attWrappersByValidatorChunkIndex := s.groupByValidatorChunkIndex(attWrappers) @@ -153,7 +154,7 @@ func (s *Service) checkSurroundVotes( // Check for double votes in our database given a list of incoming attestations. func (s *Service) checkDoubleVotes( ctx context.Context, incomingAttWrappers []*slashertypes.IndexedAttestationWrapper, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.checkDoubleVotesOnDisk") defer span.End() @@ -162,15 +163,15 @@ func (s *Service) checkDoubleVotes( epoch primitives.Epoch } - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // Check each incoming attestation for double votes against other incoming attestations. existingAttWrappers := make(map[attestationInfo]*slashertypes.IndexedAttestationWrapper) for _, incomingAttWrapper := range incomingAttWrappers { - targetEpoch := incomingAttWrapper.IndexedAttestation.Data.Target.Epoch + targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch - for _, validatorIndex := range incomingAttWrapper.IndexedAttestation.AttestingIndices { + for _, validatorIndex := range incomingAttWrapper.IndexedAttestation.GetAttestingIndices() { info := attestationInfo{ validatorIndex: validatorIndex, epoch: targetEpoch, @@ -193,17 +194,33 @@ func (s *Service) checkDoubleVotes( // This is a double vote. doubleVotesTotal.Inc() + existing, ok := existingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "existing attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + existingAttWrapper.IndexedAttestation, + ) + } + incoming, ok := incomingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "incoming attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + incomingAttWrapper.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: existingAttWrapper.IndexedAttestation, - Attestation_2: incomingAttWrapper.IndexedAttestation, + Attestation_1: existing, + Attestation_2: incoming, } // Ensure the attestation with the lower data root is the first attestation. - // It will be useful for comparing with other double votes. if bytes.Compare(existingAttWrapper.DataRoot[:], incomingAttWrapper.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: incomingAttWrapper.IndexedAttestation, - Attestation_2: existingAttWrapper.IndexedAttestation, + Attestation_1: incoming, + Attestation_2: existing, } } @@ -229,16 +246,33 @@ func (s *Service) checkDoubleVotes( wrapper_1 := doubleVote.Wrapper_1 wrapper_2 := doubleVote.Wrapper_2 + att_1, ok := wrapper_1.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "first attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + wrapper_1.IndexedAttestation, + ) + } + att_2, ok := wrapper_2.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "second attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + wrapper_2.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: wrapper_1.IndexedAttestation, - Attestation_2: wrapper_2.IndexedAttestation, + Attestation_1: att_1, + Attestation_2: att_2, } // Ensure the attestation with the lower data root is the first attestation. if bytes.Compare(wrapper_1.DataRoot[:], wrapper_2.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: wrapper_2.IndexedAttestation, - Attestation_2: wrapper_1.IndexedAttestation, + Attestation_1: att_2, + Attestation_2: att_1, } } @@ -428,17 +462,17 @@ func (s *Service) updateSpans( kind slashertypes.ChunkKind, validatorChunkIndex uint64, currentEpoch primitives.Epoch, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.updateSpans") defer span.End() // Apply the attestations to the related chunks and find any // slashings along the way. - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} for _, attWrappers := range attWrapperByChunkIdx { for _, attWrapper := range attWrappers { - for _, validatorIdx := range attWrapper.IndexedAttestation.AttestingIndices { + for _, validatorIdx := range attWrapper.IndexedAttestation.GetAttestingIndices() { validatorIndex := primitives.ValidatorIndex(validatorIdx) computedValidatorChunkIdx := s.params.validatorChunkIndex(validatorIndex) @@ -493,14 +527,14 @@ func (s *Service) applyAttestationForValidator( validatorChunkIndex uint64, validatorIndex primitives.ValidatorIndex, currentEpoch primitives.Epoch, -) (*ethpb.AttesterSlashing, error) { +) (interfaces.AttesterSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.applyAttestationForValidator") defer span.End() var err error - sourceEpoch := attestation.IndexedAttestation.Data.Source.Epoch - targetEpoch := attestation.IndexedAttestation.Data.Target.Epoch + sourceEpoch := attestation.IndexedAttestation.GetData().Source.Epoch + targetEpoch := attestation.IndexedAttestation.GetData().Target.Epoch attestationDistance.Observe(float64(targetEpoch) - float64(sourceEpoch)) chunkIndex := s.params.chunkIndex(sourceEpoch) diff --git a/beacon-chain/slasher/detect_attestations_test.go b/beacon-chain/slasher/detect_attestations_test.go index 7763d205f7c9..0026f36877fc 100644 --- a/beacon-chain/slasher/detect_attestations_test.go +++ b/beacon-chain/slasher/detect_attestations_test.go @@ -668,8 +668,8 @@ func Test_processAttestations(t *testing.T) { // Create the attester slashing. expectedSlashing := ðpb.AttesterSlashing{ - Attestation_1: wrapper_1.IndexedAttestation, - Attestation_2: wrapper_2.IndexedAttestation, + Attestation_1: wrapper_1.IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: wrapper_2.IndexedAttestation.(*ethpb.IndexedAttestation), } root, err := expectedSlashing.HashTreeRoot() @@ -821,7 +821,7 @@ func Test_processQueuedAttestations_OverlappingChunkIndices(t *testing.T) { s.attsQueue = newAttestationsQueue() s.attsQueue.push(att1) s.attsQueue.push(att2) - slot, err := slots.EpochStart(att2.IndexedAttestation.Data.Target.Epoch) + slot, err := slots.EpochStart(att2.IndexedAttestation.GetData().Target.Epoch) require.NoError(t, err) mockChain.Slot = &slot s.serviceCfg.HeadStateFetcher = mockChain @@ -1164,7 +1164,7 @@ func Test_applyAttestationForValidator_MinSpanChunk(t *testing.T) { ) require.NoError(t, err) require.IsNil(t, slashing) - att.IndexedAttestation.AttestingIndices = []uint64{uint64(validatorIdx)} + att.IndexedAttestation.(*ethpb.IndexedAttestation).AttestingIndices = []uint64{uint64(validatorIdx)} err = slasherDB.SaveAttestationRecordsForValidators( ctx, []*slashertypes.IndexedAttestationWrapper{att}, @@ -1221,7 +1221,7 @@ func Test_applyAttestationForValidator_MaxSpanChunk(t *testing.T) { ) require.NoError(t, err) require.Equal(t, true, slashing == nil) - att.IndexedAttestation.AttestingIndices = []uint64{uint64(validatorIdx)} + att.IndexedAttestation.(*ethpb.IndexedAttestation).AttestingIndices = []uint64{uint64(validatorIdx)} err = slasherDB.SaveAttestationRecordsForValidators( ctx, []*slashertypes.IndexedAttestationWrapper{att}, diff --git a/beacon-chain/slasher/helpers.go b/beacon-chain/slasher/helpers.go index 23c544bbe8f2..411282a6e42c 100644 --- a/beacon-chain/slasher/helpers.go +++ b/beacon-chain/slasher/helpers.go @@ -10,6 +10,7 @@ import ( slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -28,7 +29,7 @@ func (s *Service) groupByValidatorChunkIndex( for _, attestation := range attestations { validatorChunkIndexes := make(map[uint64]bool) - for _, validatorIndex := range attestation.IndexedAttestation.AttestingIndices { + for _, validatorIndex := range attestation.IndexedAttestation.GetAttestingIndices() { validatorChunkIndex := s.params.validatorChunkIndex(primitives.ValidatorIndex(validatorIndex)) validatorChunkIndexes[validatorChunkIndex] = true } @@ -51,7 +52,7 @@ func (s *Service) groupByChunkIndex( attestationsByChunkIndex := make(map[uint64][]*slashertypes.IndexedAttestationWrapper) for _, attestation := range attestations { - chunkIndex := s.params.chunkIndex(attestation.IndexedAttestation.Data.Source.Epoch) + chunkIndex := s.params.chunkIndex(attestation.IndexedAttestation.GetData().Source.Epoch) attestationsByChunkIndex[chunkIndex] = append(attestationsByChunkIndex[chunkIndex], attestation) } @@ -74,13 +75,13 @@ func (s *Service) filterAttestations( // If an attestation's source is epoch is older than the max history length // we keep track of for slashing detection, we drop it. - if attWrapper.IndexedAttestation.Data.Source.Epoch+s.params.historyLength <= currentEpoch { + if attWrapper.IndexedAttestation.GetData().Source.Epoch+s.params.historyLength <= currentEpoch { numDropped++ continue } // If an attestation's target epoch is in the future, we defer processing for later. - if attWrapper.IndexedAttestation.Data.Target.Epoch > currentEpoch { + if attWrapper.IndexedAttestation.GetData().Target.Epoch > currentEpoch { validInFuture = append(validInFuture, attWrapper) continue } @@ -95,17 +96,17 @@ func (s *Service) filterAttestations( // source and target epochs, and that the source epoch of the attestation must // be less than the target epoch, which is a precondition for performing slashing // detection (except for the genesis epoch). -func validateAttestationIntegrity(att *ethpb.IndexedAttestation) bool { +func validateAttestationIntegrity(att ethpb.IndexedAtt) bool { // If an attestation is malformed, we drop it. if att == nil || - att.Data == nil || - att.Data.Source == nil || - att.Data.Target == nil { + att.GetData() == nil || + att.GetData().Source == nil || + att.GetData().Target == nil { return false } - sourceEpoch := att.Data.Source.Epoch - targetEpoch := att.Data.Target.Epoch + sourceEpoch := att.GetData().Source.Epoch + targetEpoch := att.GetData().Target.Epoch // The genesis epoch is a special case, since all attestations formed in it // will have source and target 0, and they should be considered valid. @@ -129,14 +130,14 @@ func validateBlockHeaderIntegrity(header *ethpb.SignedBeaconBlockHeader) bool { return true } -func logAttesterSlashing(slashing *ethpb.AttesterSlashing) { - indices := slice.IntersectionUint64(slashing.Attestation_1.AttestingIndices, slashing.Attestation_2.AttestingIndices) +func logAttesterSlashing(slashing interfaces.AttesterSlashing) { + indices := slice.IntersectionUint64(slashing.GetFirstAttestation().GetAttestingIndices(), slashing.GetSecondAttestation().GetAttestingIndices()) log.WithFields(logrus.Fields{ "validatorIndex": indices, - "prevSourceEpoch": slashing.Attestation_1.Data.Source.Epoch, - "prevTargetEpoch": slashing.Attestation_1.Data.Target.Epoch, - "sourceEpoch": slashing.Attestation_2.Data.Source.Epoch, - "targetEpoch": slashing.Attestation_2.Data.Target.Epoch, + "prevSourceEpoch": slashing.GetFirstAttestation().GetData().Source.Epoch, + "prevTargetEpoch": slashing.GetFirstAttestation().GetData().Target.Epoch, + "sourceEpoch": slashing.GetSecondAttestation().GetData().Source.Epoch, + "targetEpoch": slashing.GetSecondAttestation().GetData().Target.Epoch, }).Info("Attester slashing detected") } diff --git a/beacon-chain/slasher/helpers_test.go b/beacon-chain/slasher/helpers_test.go index 6d9bfcae09a3..0b6284195300 100644 --- a/beacon-chain/slasher/helpers_test.go +++ b/beacon-chain/slasher/helpers_test.go @@ -271,22 +271,22 @@ func Test_logSlashingEvent(t *testing.T) { { name: "Surrounding vote", slashing: ðpb.AttesterSlashing{ - Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, - Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, + Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), }, }, { name: "Surrounded vote", slashing: ðpb.AttesterSlashing{ - Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, - Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, + Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), }, }, { name: "Double vote", slashing: ðpb.AttesterSlashing{ - Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, - Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, + Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), }, }, } diff --git a/beacon-chain/slasher/process_slashings.go b/beacon-chain/slasher/process_slashings.go index e3a3d8ddf499..c98f5c0d1b11 100644 --- a/beacon-chain/slasher/process_slashings.go +++ b/beacon-chain/slasher/process_slashings.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -13,9 +14,9 @@ import ( // Verifies attester slashings, logs them, and submits them to the slashing operations pool // in the beacon node if they pass validation. func (s *Service) processAttesterSlashings( - ctx context.Context, slashings map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { - processedSlashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + ctx context.Context, slashings map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { + processedSlashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // If no slashings, return early. if len(slashings) == 0 { @@ -30,8 +31,8 @@ func (s *Service) processAttesterSlashings( for root, slashing := range slashings { // Verify the signature of the first attestation. - if err := s.verifyAttSignature(ctx, slashing.Attestation_1); err != nil { - log.WithError(err).WithField("a", slashing.Attestation_1).Warn( + if err := s.verifyAttSignature(ctx, slashing.GetFirstAttestation()); err != nil { + log.WithError(err).WithField("a", slashing.GetFirstAttestation()).Warn( "Invalid signature for attestation in detected slashing offense", ) @@ -39,8 +40,8 @@ func (s *Service) processAttesterSlashings( } // Verify the signature of the second attestation. - if err := s.verifyAttSignature(ctx, slashing.Attestation_2); err != nil { - log.WithError(err).WithField("b", slashing.Attestation_2).Warn( + if err := s.verifyAttSignature(ctx, slashing.GetSecondAttestation()); err != nil { + log.WithError(err).WithField("b", slashing.GetSecondAttestation()).Warn( "Invalid signature for attestation in detected slashing offense", ) @@ -110,8 +111,8 @@ func (s *Service) verifyBlockSignature(ctx context.Context, header *ethpb.Signed return blocks.VerifyBlockHeaderSignature(parentState, header) } -func (s *Service) verifyAttSignature(ctx context.Context, att *ethpb.IndexedAttestation) error { - preState, err := s.serviceCfg.AttestationStateFetcher.AttestationTargetState(ctx, att.Data.Target) +func (s *Service) verifyAttSignature(ctx context.Context, att ethpb.IndexedAtt) error { + preState, err := s.serviceCfg.AttestationStateFetcher.AttestationTargetState(ctx, att.GetData().Target) if err != nil { return err } diff --git a/beacon-chain/slasher/process_slashings_test.go b/beacon-chain/slasher/process_slashings_test.go index 7e45fb3b2c1d..90764497295c 100644 --- a/beacon-chain/slasher/process_slashings_test.go +++ b/beacon-chain/slasher/process_slashings_test.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -84,7 +85,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ root: slashing, } @@ -108,7 +109,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ root: slashing, } @@ -132,7 +133,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ root: slashing, } diff --git a/beacon-chain/slasher/receive.go b/beacon-chain/slasher/receive.go index 056df52369f2..66b82de0fbcc 100644 --- a/beacon-chain/slasher/receive.go +++ b/beacon-chain/slasher/receive.go @@ -7,6 +7,7 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -22,7 +23,7 @@ const ( // Receive indexed attestations from some source event feed, // validating their integrity before appending them to an attestation queue // for batch processing in a separate routine. -func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan *ethpb.IndexedAttestation) { +func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan ethpb.IndexedAtt) { defer s.wg.Done() sub := s.serviceCfg.IndexedAttestationsFeed.Subscribe(indexedAttsChan) @@ -33,7 +34,7 @@ func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan if !validateAttestationIntegrity(att) { continue } - dataRoot, err := att.Data.HashTreeRoot() + dataRoot, err := att.GetData().HashTreeRoot() if err != nil { log.WithError(err).Error("Could not get hash tree root of attestation") continue @@ -108,7 +109,7 @@ func (s *Service) processAttestations( ctx context.Context, attestations []*slashertypes.IndexedAttestationWrapper, currentSlot primitives.Slot, -) map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing { +) map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing { // Get the current epoch from the current slot. currentEpoch := slots.ToEpoch(currentSlot) diff --git a/beacon-chain/slasher/receive_test.go b/beacon-chain/slasher/receive_test.go index c8c9fa02da83..f7b0eacefcbb 100644 --- a/beacon-chain/slasher/receive_test.go +++ b/beacon-chain/slasher/receive_test.go @@ -29,7 +29,7 @@ func TestSlasher_receiveAttestations_OK(t *testing.T) { }, attsQueue: newAttestationsQueue(), } - indexedAttsChan := make(chan *ethpb.IndexedAttestation) + indexedAttsChan := make(chan ethpb.IndexedAtt) defer close(indexedAttsChan) s.wg.Add(1) @@ -212,7 +212,7 @@ func TestSlasher_receiveAttestations_OnlyValidAttestations(t *testing.T) { }, attsQueue: newAttestationsQueue(), } - indexedAttsChan := make(chan *ethpb.IndexedAttestation) + indexedAttsChan := make(chan ethpb.IndexedAtt) defer close(indexedAttsChan) s.wg.Add(1) diff --git a/beacon-chain/slasher/service.go b/beacon-chain/slasher/service.go index 5de7c859d10e..8de75eba8251 100644 --- a/beacon-chain/slasher/service.go +++ b/beacon-chain/slasher/service.go @@ -48,7 +48,7 @@ type ServiceConfig struct { type Service struct { params *Parameters serviceCfg *ServiceConfig - indexedAttsChan chan *ethpb.IndexedAttestation + indexedAttsChan chan ethpb.IndexedAtt beaconBlockHeadersChan chan *ethpb.SignedBeaconBlockHeader attsQueue *attestationsQueue blksQueue *blocksQueue @@ -68,7 +68,7 @@ func New(ctx context.Context, srvCfg *ServiceConfig) (*Service, error) { return &Service{ params: DefaultParams(), serviceCfg: srvCfg, - indexedAttsChan: make(chan *ethpb.IndexedAttestation, 1), + indexedAttsChan: make(chan ethpb.IndexedAtt, 1), beaconBlockHeadersChan: make(chan *ethpb.SignedBeaconBlockHeader, 1), attsQueue: newAttestationsQueue(), blksQueue: newBlocksQueue(), @@ -117,7 +117,7 @@ func (s *Service) run() { "Finished retrieving last epoch written per validator", ) - indexedAttsChan := make(chan *ethpb.IndexedAttestation, 1) + indexedAttsChan := make(chan ethpb.IndexedAtt, 1) beaconBlockHeadersChan := make(chan *ethpb.SignedBeaconBlockHeader, 1) s.wg.Add(1) diff --git a/beacon-chain/slasher/types/types.go b/beacon-chain/slasher/types/types.go index c1699227e88d..d2ee753174c5 100644 --- a/beacon-chain/slasher/types/types.go +++ b/beacon-chain/slasher/types/types.go @@ -29,7 +29,7 @@ func (c ChunkKind) String() string { // IndexedAttestationWrapper contains an indexed attestation with its // data root to reduce duplicated computation. type IndexedAttestationWrapper struct { - IndexedAttestation *ethpb.IndexedAttestation + IndexedAttestation ethpb.IndexedAtt DataRoot [32]byte } diff --git a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go index 3c4e2e957bec..eecc49fb9951 100644 --- a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go +++ b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -34,7 +35,7 @@ func TestBeaconAggregateProofSubscriber_CanSaveAggregatedAttestation(t *testing. Signature: make([]byte, fieldparams.BLSSignatureLength), } require.NoError(t, r.beaconAggregateProofSubscriber(context.Background(), a)) - assert.DeepSSZEqual(t, []*ethpb.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation") + assert.DeepSSZEqual(t, []interfaces.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation") } func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testing.T) { @@ -59,5 +60,5 @@ func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testin atts, err := r.cfg.attPool.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation") + assert.DeepEqual(t, []interfaces.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation") } diff --git a/beacon-chain/sync/subscriber_handlers.go b/beacon-chain/sync/subscriber_handlers.go index 7a8585f1ac1a..dd49d259abbc 100644 --- a/beacon-chain/sync/subscriber_handlers.go +++ b/beacon-chain/sync/subscriber_handlers.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -25,13 +26,13 @@ func (s *Service) voluntaryExitSubscriber(_ context.Context, msg proto.Message) } func (s *Service) attesterSlashingSubscriber(ctx context.Context, msg proto.Message) error { - aSlashing, ok := msg.(*ethpb.AttesterSlashing) + aSlashing, ok := msg.(interfaces.AttesterSlashing) if !ok { return fmt.Errorf("wrong type, expected: *ethpb.AttesterSlashing got: %T", msg) } // Do some nil checks to prevent easy DoS'ing of this handler. - aSlashing1IsNil := aSlashing == nil || aSlashing.Attestation_1 == nil || aSlashing.Attestation_1.AttestingIndices == nil - aSlashing2IsNil := aSlashing == nil || aSlashing.Attestation_2 == nil || aSlashing.Attestation_2.AttestingIndices == nil + aSlashing1IsNil := aSlashing == nil || aSlashing.GetFirstAttestation() == nil || aSlashing.GetFirstAttestation().GetAttestingIndices() == nil + aSlashing2IsNil := aSlashing == nil || aSlashing.GetSecondAttestation() == nil || aSlashing.GetSecondAttestation().GetAttestingIndices() == nil if !aSlashing1IsNil && !aSlashing2IsNil { headState, err := s.cfg.chain.HeadState(ctx) if err != nil { @@ -40,7 +41,7 @@ func (s *Service) attesterSlashingSubscriber(ctx context.Context, msg proto.Mess if err := s.cfg.slashingPool.InsertAttesterSlashing(ctx, headState, aSlashing); err != nil { return errors.Wrap(err, "could not insert attester slashing into pool") } - s.setAttesterSlashingIndicesSeen(aSlashing.Attestation_1.AttestingIndices, aSlashing.Attestation_2.AttestingIndices) + s.setAttesterSlashingIndicesSeen(aSlashing.GetFirstAttestation().GetAttestingIndices(), aSlashing.GetSecondAttestation().GetAttestingIndices()) } return nil } diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index f57b6e38972d..38f591952f15 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -176,7 +177,7 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.Signe tracing.AnnotateError(span, wrappedErr) return pubsub.ValidationIgnore, wrappedErr } - attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []*ethpb.Attestation{signed.Message.Aggregate}) + attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []interfaces.Attestation{signed.Message.Aggregate}) if err != nil { wrappedErr := errors.Wrapf(err, "Could not verify aggregator signature %d", signed.Message.AggregatorIndex) tracing.AnnotateError(span, wrappedErr) @@ -225,7 +226,7 @@ func (s *Service) setAggregatorIndexEpochSeen(epoch primitives.Epoch, aggregator // - [REJECT] The aggregate attestation has participants -- that is, len(get_attesting_indices(state, aggregate.data, aggregate.aggregation_bits)) >= 1. // - [REJECT] The aggregator's validator index is within the committee -- // i.e. `aggregate_and_proof.aggregator_index in get_beacon_committee(state, aggregate.data.slot, aggregate.data.index)`. -func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a *ethpb.Attestation, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { +func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a interfaces.Attestation, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateIndexInCommittee") defer span.End() @@ -239,7 +240,7 @@ func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnl return result, err } - if a.AggregationBits.Count() == 0 { + if a.GetAggregationBits().Count() == 0 { return pubsub.ValidationReject, errors.New("no attesting indices") } diff --git a/beacon-chain/sync/validate_attester_slashing.go b/beacon-chain/sync/validate_attester_slashing.go index 6590b7a918ca..a30499d19c3b 100644 --- a/beacon-chain/sync/validate_attester_slashing.go +++ b/beacon-chain/sync/validate_attester_slashing.go @@ -10,10 +10,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -40,7 +40,7 @@ func (s *Service) validateAttesterSlashing(ctx context.Context, pid peer.ID, msg tracing.AnnotateError(span, err) return pubsub.ValidationReject, err } - slashing, ok := m.(*ethpb.AttesterSlashing) + slashing, ok := m.(interfaces.AttesterSlashing) if !ok { return pubsub.ValidationReject, errWrongMessage } diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index c0e2a17edc17..83a5d37170ad 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -17,6 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" @@ -171,7 +172,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p } // This validates beacon unaggregated attestation has correct topic string. -func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState, t string) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState, t string) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttTopic") defer span.End() @@ -193,21 +194,21 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a *eth.Attes return pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndex(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { - valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.Data.Slot)) +func (s *Service) validateCommitteeIndex(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { + valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.GetData().Slot)) if err != nil { return 0, pubsub.ValidationIgnore, err } count := helpers.SlotCommitteeCount(valCount) - if uint64(a.Data.CommitteeIndex) > count { - return 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.Data.CommitteeIndex, count) + if uint64(a.GetData().CommitteeIndex) > count { + return 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.GetData().CommitteeIndex, count) } return valCount, pubsub.ValidationAccept, nil } // This validates beacon unaggregated attestation using the given state, the validation consists of bitfield length and count consistency // and signature verification. -func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttWithState") defer span.End() @@ -219,11 +220,11 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.A // Attestation must be unaggregated and the bit index must exist in the range of committee indices. // Note: The Ethereum Beacon chain spec suggests (len(get_attesting_indices(state, attestation.data, attestation.aggregation_bits)) == 1) // however this validation can be achieved without use of get_attesting_indices which is an O(n) lookup. - if a.AggregationBits.Count() != 1 || a.AggregationBits.BitIndices()[0] >= len(committee) { + if a.GetAggregationBits().Count() != 1 || a.GetAggregationBits().BitIndices()[0] >= len(committee) { return pubsub.ValidationReject, errors.New("attestation bitfield is invalid") } - set, err := blocks.AttestationSignatureBatch(ctx, bs, []*eth.Attestation{a}) + set, err := blocks.AttestationSignatureBatch(ctx, bs, []interfaces.Attestation{a}) if err != nil { tracing.AnnotateError(span, err) attBadSignatureBatchCount.Inc() @@ -232,14 +233,14 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.A return s.validateWithBatchVerifier(ctx, "attestation", set) } -func (s *Service) validateBitLength(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { - committee, err := helpers.BeaconCommitteeFromState(ctx, bs, a.Data.Slot, a.Data.CommitteeIndex) +func (s *Service) validateBitLength(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { + committee, err := helpers.BeaconCommitteeFromState(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, pubsub.ValidationIgnore, err } // Verify number of aggregation bits matches the committee size. - if err := helpers.VerifyBitfieldLength(a.AggregationBits, uint64(len(committee))); err != nil { + if err := helpers.VerifyBitfieldLength(a.GetAggregationBits(), uint64(len(committee))); err != nil { return nil, pubsub.ValidationReject, err } diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index deeff7045315..d4006244efed 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -187,6 +187,11 @@ func (executionPayload) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (executionPayload) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // ValueInWei -- func (executionPayload) ValueInWei() (math.Wei, error) { return nil, consensus_types.ErrUnsupportedField @@ -197,6 +202,16 @@ func (executionPayload) ValueInGwei() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// DepositReceipts -- +func (e executionPayload) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayload) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // executionPayloadHeader is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -353,6 +368,11 @@ func (e executionPayloadHeader) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (e executionPayloadHeader) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadHeader) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -378,6 +398,16 @@ func (executionPayloadHeader) ValueInGwei() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// DepositReceipts -- +func (e executionPayloadHeader) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeader) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PayloadToHeader converts `payload` into execution payload header format. func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeader, error) { txs, err := payload.Transactions() @@ -564,6 +594,11 @@ func (e executionPayloadCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (executionPayloadCapella) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadCapella) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -589,6 +624,16 @@ func (e executionPayloadCapella) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadCapella) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadCapella) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // executionPayloadHeaderCapella is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -747,6 +792,11 @@ func (e executionPayloadHeaderCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (executionPayloadHeaderCapella) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadHeaderCapella) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -772,6 +822,16 @@ func (e executionPayloadHeaderCapella) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadHeaderCapella) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeaderCapella) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PayloadToHeaderCapella converts `payload` into execution payload header format. func PayloadToHeaderCapella(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderCapella, error) { txs, err := payload.Transactions() @@ -858,6 +918,73 @@ func PayloadToHeaderDeneb(payload interfaces.ExecutionData) (*enginev1.Execution }, nil } +// PayloadToHeaderElectra converts `payload` into execution payload header format. +func PayloadToHeaderElectra(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderElectra, error) { + txs, err := payload.Transactions() + if err != nil { + return nil, err + } + txRoot, err := ssz.TransactionsRoot(txs) + if err != nil { + return nil, err + } + withdrawals, err := payload.Withdrawals() + if err != nil { + return nil, err + } + withdrawalsRoot, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, err + } + blobGasUsed, err := payload.BlobGasUsed() + if err != nil { + return nil, err + } + excessBlobGas, err := payload.ExcessBlobGas() + if err != nil { + return nil, err + } + + depositReceipts, err := payload.DepositReceipts() + if err != nil { + return nil, err + } + depositReceiptsRoot, err := ssz.DepositReceiptSliceRoot(depositReceipts, fieldparams.MaxDepositReceiptsPerPayload) + if err != nil { + return nil, err + } + withdrawalRequests, err := payload.WithdrawalRequests() + if err != nil { + return nil, err + } + withdrawalRequestsRoot, err := ssz.WithdrawalRequestSliceRoot(withdrawalRequests, fieldparams.MaxWithdrawalRequestsPerPayload) + if err != nil { + return nil, err + } + + return &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash()), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient()), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot()), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot()), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom()), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao()), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData()), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas()), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash()), + TransactionsRoot: txRoot[:], + WithdrawalsRoot: withdrawalsRoot[:], + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + DepositReceiptsRoot: depositReceiptsRoot[:], + WithdrawalRequestsRoot: withdrawalRequestsRoot[:], + }, nil +} + // IsEmptyExecutionData checks if an execution data is empty underneath. If a single field has // a non-zero value, this function will return false. func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { @@ -915,6 +1042,29 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { if data.Timestamp() != 0 { return false, nil } + + drs, err := data.DepositReceipts() + switch { + case errors.Is(err, consensus_types.ErrUnsupportedField): + case err != nil: + return false, err + default: + if len(drs) != 0 { + return false, nil + } + } + + wrs, err := data.WithdrawalRequests() + switch { + case errors.Is(err, consensus_types.ErrUnsupportedField): + case err != nil: + return false, err + default: + if len(wrs) != 0 { + return false, nil + } + } + return true, nil } @@ -1071,6 +1221,11 @@ func (e executionPayloadHeaderDeneb) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } +// PbElectra -- +func (executionPayloadHeaderDeneb) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadHeaderDeneb) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -1096,6 +1251,16 @@ func (e executionPayloadHeaderDeneb) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadHeaderDeneb) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeaderDeneb) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadHeaderDeneb) IsBlinded() bool { return true @@ -1267,6 +1432,11 @@ func (e executionPayloadDeneb) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error return e.p, nil } +// PbElectra -- +func (e executionPayloadDeneb) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // ValueInWei -- func (e executionPayloadDeneb) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -1277,11 +1447,415 @@ func (e executionPayloadDeneb) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadDeneb) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadDeneb) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadDeneb) IsBlinded() bool { return false } +// executionPayloadHeaderElectra is a convenience wrapper around a blinded beacon block body's execution header data structure. +// This wrapper allows us to conform to a common interface so that beacon +// blocks for future forks can also be applied across Prysm without issues. +type executionPayloadHeaderElectra struct { + p *enginev1.ExecutionPayloadHeaderElectra + weiValue math.Wei + gweiValue uint64 +} + +// WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. +func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra, value math.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} + if w.IsNil() { + return nil, consensus_types.ErrNilObjectWrapped + } + return w, nil +} + +// IsNil checks if the underlying data is nil. +func (e executionPayloadHeaderElectra) IsNil() bool { + return e.p == nil +} + +// MarshalSSZ -- +func (e executionPayloadHeaderElectra) MarshalSSZ() ([]byte, error) { + return e.p.MarshalSSZ() +} + +// MarshalSSZTo -- +func (e executionPayloadHeaderElectra) MarshalSSZTo(dst []byte) ([]byte, error) { + return e.p.MarshalSSZTo(dst) +} + +// SizeSSZ -- +func (e executionPayloadHeaderElectra) SizeSSZ() int { + return e.p.SizeSSZ() +} + +// UnmarshalSSZ -- +func (e executionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { + return e.p.UnmarshalSSZ(buf) +} + +// HashTreeRoot -- +func (e executionPayloadHeaderElectra) HashTreeRoot() ([32]byte, error) { + return e.p.HashTreeRoot() +} + +// HashTreeRootWith -- +func (e executionPayloadHeaderElectra) HashTreeRootWith(hh *fastssz.Hasher) error { + return e.p.HashTreeRootWith(hh) +} + +// Proto -- +func (e executionPayloadHeaderElectra) Proto() proto.Message { + return e.p +} + +// ParentHash -- +func (e executionPayloadHeaderElectra) ParentHash() []byte { + return e.p.ParentHash +} + +// FeeRecipient -- +func (e executionPayloadHeaderElectra) FeeRecipient() []byte { + return e.p.FeeRecipient +} + +// StateRoot -- +func (e executionPayloadHeaderElectra) StateRoot() []byte { + return e.p.StateRoot +} + +// ReceiptsRoot -- +func (e executionPayloadHeaderElectra) ReceiptsRoot() []byte { + return e.p.ReceiptsRoot +} + +// LogsBloom -- +func (e executionPayloadHeaderElectra) LogsBloom() []byte { + return e.p.LogsBloom +} + +// PrevRandao -- +func (e executionPayloadHeaderElectra) PrevRandao() []byte { + return e.p.PrevRandao +} + +// BlockNumber -- +func (e executionPayloadHeaderElectra) BlockNumber() uint64 { + return e.p.BlockNumber +} + +// GasLimit -- +func (e executionPayloadHeaderElectra) GasLimit() uint64 { + return e.p.GasLimit +} + +// GasUsed -- +func (e executionPayloadHeaderElectra) GasUsed() uint64 { + return e.p.GasUsed +} + +// Timestamp -- +func (e executionPayloadHeaderElectra) Timestamp() uint64 { + return e.p.Timestamp +} + +// ExtraData -- +func (e executionPayloadHeaderElectra) ExtraData() []byte { + return e.p.ExtraData +} + +// BaseFeePerGas -- +func (e executionPayloadHeaderElectra) BaseFeePerGas() []byte { + return e.p.BaseFeePerGas +} + +// BlockHash -- +func (e executionPayloadHeaderElectra) BlockHash() []byte { + return e.p.BlockHash +} + +// Transactions -- +func (executionPayloadHeaderElectra) Transactions() ([][]byte, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// TransactionsRoot -- +func (e executionPayloadHeaderElectra) TransactionsRoot() ([]byte, error) { + return e.p.TransactionsRoot, nil +} + +// Withdrawals -- +func (e executionPayloadHeaderElectra) Withdrawals() ([]*enginev1.Withdrawal, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalsRoot -- +func (e executionPayloadHeaderElectra) WithdrawalsRoot() ([]byte, error) { + return e.p.WithdrawalsRoot, nil +} + +// BlobGasUsed -- +func (e executionPayloadHeaderElectra) BlobGasUsed() (uint64, error) { + return e.p.BlobGasUsed, nil +} + +// ExcessBlobGas -- +func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { + return e.p.ExcessBlobGas, nil +} + +// PbElectra -- +func (e executionPayloadHeaderElectra) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbDeneb -- +func (executionPayloadHeaderElectra) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbBellatrix -- +func (executionPayloadHeaderElectra) PbBellatrix() (*enginev1.ExecutionPayload, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbCapella -- +func (executionPayloadHeaderElectra) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// ValueInWei -- +func (e executionPayloadHeaderElectra) ValueInWei() (math.Wei, error) { + return e.weiValue, nil +} + +// ValueInGwei -- +func (e executionPayloadHeaderElectra) ValueInGwei() (uint64, error) { + return e.gweiValue, nil +} + +// DepositReceipts -- +func (e executionPayloadHeaderElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeaderElectra) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// IsBlinded returns true if the underlying data is blinded. +func (e executionPayloadHeaderElectra) IsBlinded() bool { + return true +} + +// executionPayloadElectra is a convenience wrapper around a beacon block body's execution payload data structure +// This wrapper allows us to conform to a common interface so that beacon +// blocks for future forks can also be applied across Prysm without issues. +type executionPayloadElectra struct { + p *enginev1.ExecutionPayloadElectra + weiValue math.Wei + gweiValue uint64 +} + +// WrappedExecutionPayloadElectra is a constructor which wraps a protobuf execution payload into an interface. +func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra, value math.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} + if w.IsNil() { + return nil, consensus_types.ErrNilObjectWrapped + } + return w, nil +} + +// IsNil checks if the underlying data is nil. +func (e executionPayloadElectra) IsNil() bool { + return e.p == nil +} + +// MarshalSSZ -- +func (e executionPayloadElectra) MarshalSSZ() ([]byte, error) { + return e.p.MarshalSSZ() +} + +// MarshalSSZTo -- +func (e executionPayloadElectra) MarshalSSZTo(dst []byte) ([]byte, error) { + return e.p.MarshalSSZTo(dst) +} + +// SizeSSZ -- +func (e executionPayloadElectra) SizeSSZ() int { + return e.p.SizeSSZ() +} + +// UnmarshalSSZ -- +func (e executionPayloadElectra) UnmarshalSSZ(buf []byte) error { + return e.p.UnmarshalSSZ(buf) +} + +// HashTreeRoot -- +func (e executionPayloadElectra) HashTreeRoot() ([32]byte, error) { + return e.p.HashTreeRoot() +} + +// HashTreeRootWith -- +func (e executionPayloadElectra) HashTreeRootWith(hh *fastssz.Hasher) error { + return e.p.HashTreeRootWith(hh) +} + +// Proto -- +func (e executionPayloadElectra) Proto() proto.Message { + return e.p +} + +// ParentHash -- +func (e executionPayloadElectra) ParentHash() []byte { + return e.p.ParentHash +} + +// FeeRecipient -- +func (e executionPayloadElectra) FeeRecipient() []byte { + return e.p.FeeRecipient +} + +// StateRoot -- +func (e executionPayloadElectra) StateRoot() []byte { + return e.p.StateRoot +} + +// ReceiptsRoot -- +func (e executionPayloadElectra) ReceiptsRoot() []byte { + return e.p.ReceiptsRoot +} + +// LogsBloom -- +func (e executionPayloadElectra) LogsBloom() []byte { + return e.p.LogsBloom +} + +// PrevRandao -- +func (e executionPayloadElectra) PrevRandao() []byte { + return e.p.PrevRandao +} + +// BlockNumber -- +func (e executionPayloadElectra) BlockNumber() uint64 { + return e.p.BlockNumber +} + +// GasLimit -- +func (e executionPayloadElectra) GasLimit() uint64 { + return e.p.GasLimit +} + +// GasUsed -- +func (e executionPayloadElectra) GasUsed() uint64 { + return e.p.GasUsed +} + +// Timestamp -- +func (e executionPayloadElectra) Timestamp() uint64 { + return e.p.Timestamp +} + +// ExtraData -- +func (e executionPayloadElectra) ExtraData() []byte { + return e.p.ExtraData +} + +// BaseFeePerGas -- +func (e executionPayloadElectra) BaseFeePerGas() []byte { + return e.p.BaseFeePerGas +} + +// BlockHash -- +func (e executionPayloadElectra) BlockHash() []byte { + return e.p.BlockHash +} + +// Transactions -- +func (e executionPayloadElectra) Transactions() ([][]byte, error) { + return e.p.Transactions, nil +} + +// TransactionsRoot -- +func (e executionPayloadElectra) TransactionsRoot() ([]byte, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// Withdrawals -- +func (e executionPayloadElectra) Withdrawals() ([]*enginev1.Withdrawal, error) { + return e.p.Withdrawals, nil +} + +// WithdrawalsRoot -- +func (e executionPayloadElectra) WithdrawalsRoot() ([]byte, error) { + return nil, consensus_types.ErrUnsupportedField +} + +func (e executionPayloadElectra) BlobGasUsed() (uint64, error) { + return e.p.BlobGasUsed, nil +} + +func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { + return e.p.ExcessBlobGas, nil +} + +// PbBellatrix -- +func (e executionPayloadElectra) PbBellatrix() (*enginev1.ExecutionPayload, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbCapella -- +func (e executionPayloadElectra) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbDeneb -- +func (e executionPayloadElectra) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbElectra -- +func (e executionPayloadElectra) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return e.p, nil +} + +// ValueInWei -- +func (e executionPayloadElectra) ValueInWei() (math.Wei, error) { + return e.weiValue, nil +} + +// ValueInGwei -- +func (e executionPayloadElectra) ValueInGwei() (uint64, error) { + return e.gweiValue, nil +} + +// DepositReceipts -- +func (e executionPayloadElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return e.p.DepositReceipts, nil +} + +// WithdrawalRequests -- +func (e executionPayloadElectra) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return e.p.WithdrawalRequests, nil +} + +// IsBlinded returns true if the underlying data is blinded. +func (e executionPayloadElectra) IsBlinded() bool { + return false +} + // PayloadValueToWei returns a Wei value given the payload's value func PayloadValueToWei(value []byte) math.Wei { // We have to convert big endian to little endian because the value is coming from the execution layer. diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index ec5103d8be3c..80d266a45e15 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -67,6 +67,14 @@ func NewSignedBeaconBlock(i interface{}) (interfaces.SignedBeaconBlock, error) { return initBlindedSignedBlockFromProtoDeneb(b) case *eth.GenericSignedBeaconBlock_BlindedDeneb: return initBlindedSignedBlockFromProtoDeneb(b.BlindedDeneb) + case *eth.GenericSignedBeaconBlock_Electra: + return initSignedBlockFromProtoElectra(b.Electra.Block) + case *eth.SignedBeaconBlockElectra: + return initSignedBlockFromProtoElectra(b) + case *eth.SignedBlindedBeaconBlockElectra: + return initBlindedSignedBlockFromProtoElectra(b) + case *eth.GenericSignedBeaconBlock_BlindedElectra: + return initBlindedSignedBlockFromProtoElectra(b.BlindedElectra) default: return nil, errors.Wrapf(ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", i) } @@ -109,6 +117,14 @@ func NewBeaconBlock(i interface{}) (interfaces.ReadOnlyBeaconBlock, error) { return initBlindedBlockFromProtoDeneb(b) case *eth.GenericBeaconBlock_BlindedDeneb: return initBlindedBlockFromProtoDeneb(b.BlindedDeneb) + case *eth.GenericBeaconBlock_Electra: + return initBlockFromProtoElectra(b.Electra.Block) + case *eth.BeaconBlockElectra: + return initBlockFromProtoElectra(b) + case *eth.BlindedBeaconBlockElectra: + return initBlindedBlockFromProtoElectra(b) + case *eth.GenericBeaconBlock_BlindedElectra: + return initBlindedBlockFromProtoElectra(b.BlindedElectra) default: return nil, errors.Wrapf(errUnsupportedBeaconBlock, "unable to create block from type %T", i) } @@ -135,6 +151,10 @@ func NewBeaconBlockBody(i interface{}) (interfaces.ReadOnlyBeaconBlockBody, erro return initBlockBodyFromProtoDeneb(b) case *eth.BlindedBeaconBlockBodyDeneb: return initBlindedBlockBodyFromProtoDeneb(b) + case *eth.BeaconBlockBodyElectra: + return initBlockBodyFromProtoElectra(b) + case *eth.BlindedBeaconBlockBodyElectra: + return initBlindedBlockBodyFromProtoElectra(b) default: return nil, errors.Wrapf(errUnsupportedBeaconBlockBody, "unable to create block body from type %T", i) } @@ -201,6 +221,19 @@ func BuildSignedBeaconBlock(blk interfaces.ReadOnlyBeaconBlock, signature []byte return nil, errIncorrectBlockVersion } return NewSignedBeaconBlock(ð.SignedBeaconBlockDeneb{Block: pb, Signature: signature}) + case version.Electra: + if blk.IsBlinded() { + pb, ok := pb.(*eth.BlindedBeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + return NewSignedBeaconBlock(ð.SignedBlindedBeaconBlockElectra{Message: pb, Signature: signature}) + } + pb, ok := pb.(*eth.BeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + return NewSignedBeaconBlock(ð.SignedBeaconBlockElectra{Block: pb, Signature: signature}) default: return nil, errUnsupportedBeaconBlock } @@ -208,9 +241,7 @@ func BuildSignedBeaconBlock(blk interfaces.ReadOnlyBeaconBlock, signature []byte // BuildSignedBeaconBlockFromExecutionPayload takes a signed, blinded beacon block and converts into // a full, signed beacon block by specifying an execution payload. -func BuildSignedBeaconBlockFromExecutionPayload( - blk interfaces.ReadOnlySignedBeaconBlock, payload interface{}, -) (interfaces.SignedBeaconBlock, error) { +func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBeaconBlock, payload interface{}) (interfaces.SignedBeaconBlock, error) { // nolint:gocognit if err := BeaconBlockIsNil(blk); err != nil { return nil, err } @@ -232,6 +263,8 @@ func BuildSignedBeaconBlockFromExecutionPayload( wrappedPayload, wrapErr = WrappedExecutionPayloadCapella(p, big.NewInt(0)) case *enginev1.ExecutionPayloadDeneb: wrappedPayload, wrapErr = WrappedExecutionPayloadDeneb(p, big.NewInt(0)) + case *enginev1.ExecutionPayloadElectra: + wrappedPayload, wrapErr = WrappedExecutionPayloadElectra(p, big.NewInt(0)) default: return nil, fmt.Errorf("%T is not a type of execution payload", p) } @@ -272,6 +305,28 @@ func BuildSignedBeaconBlockFromExecutionPayload( var fullBlock interface{} switch p := payload.(type) { case *enginev1.ExecutionPayload: + var atts []*eth.Attestation + if b.Body().Attestations() != nil { + atts = make([]*eth.Attestation, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashing + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashing, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } fullBlock = ð.SignedBeaconBlockBellatrix{ Block: ð.BeaconBlockBellatrix{ Slot: b.Slot(), @@ -283,8 +338,8 @@ func BuildSignedBeaconBlockFromExecutionPayload( Eth1Data: b.Body().Eth1Data(), Graffiti: graffiti[:], ProposerSlashings: b.Body().ProposerSlashings(), - AttesterSlashings: b.Body().AttesterSlashings(), - Attestations: b.Body().Attestations(), + AttesterSlashings: attSlashings, + Attestations: atts, Deposits: b.Body().Deposits(), VoluntaryExits: b.Body().VoluntaryExits(), SyncAggregate: syncAgg, @@ -298,6 +353,28 @@ func BuildSignedBeaconBlockFromExecutionPayload( if err != nil { return nil, err } + var atts []*eth.Attestation + if b.Body().Attestations() != nil { + atts = make([]*eth.Attestation, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashing + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashing, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } fullBlock = ð.SignedBeaconBlockCapella{ Block: ð.BeaconBlockCapella{ Slot: b.Slot(), @@ -309,8 +386,8 @@ func BuildSignedBeaconBlockFromExecutionPayload( Eth1Data: b.Body().Eth1Data(), Graffiti: graffiti[:], ProposerSlashings: b.Body().ProposerSlashings(), - AttesterSlashings: b.Body().AttesterSlashings(), - Attestations: b.Body().Attestations(), + AttesterSlashings: attSlashings, + Attestations: atts, Deposits: b.Body().Deposits(), VoluntaryExits: b.Body().VoluntaryExits(), SyncAggregate: syncAgg, @@ -329,6 +406,28 @@ func BuildSignedBeaconBlockFromExecutionPayload( if err != nil { return nil, err } + var atts []*eth.Attestation + if b.Body().Attestations() != nil { + atts = make([]*eth.Attestation, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashing + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashing, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } fullBlock = ð.SignedBeaconBlockDeneb{ Block: ð.BeaconBlockDeneb{ Slot: b.Slot(), @@ -340,14 +439,73 @@ func BuildSignedBeaconBlockFromExecutionPayload( Eth1Data: b.Body().Eth1Data(), Graffiti: graffiti[:], ProposerSlashings: b.Body().ProposerSlashings(), - AttesterSlashings: b.Body().AttesterSlashings(), - Attestations: b.Body().Attestations(), + AttesterSlashings: attSlashings, + Attestations: atts, + Deposits: b.Body().Deposits(), + VoluntaryExits: b.Body().VoluntaryExits(), + SyncAggregate: syncAgg, + ExecutionPayload: p, + BlsToExecutionChanges: blsToExecutionChanges, + BlobKzgCommitments: commitments, + }, + }, + Signature: sig[:], + } + case *enginev1.ExecutionPayloadElectra: + blsToExecutionChanges, err := b.Body().BLSToExecutionChanges() + if err != nil { + return nil, err + } + commitments, err := b.Body().BlobKzgCommitments() + if err != nil { + return nil, err + } + consolidations, err := b.Body().Consolidations() + if err != nil { + return nil, err + } + var atts []*eth.AttestationElectra + if b.Body().Attestations() != nil { + atts = make([]*eth.AttestationElectra, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.AttestationElectra) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashingElectra + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashingElectra, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashingElectra) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } + fullBlock = ð.SignedBeaconBlockElectra{ + Block: ð.BeaconBlockElectra{ + Slot: b.Slot(), + ProposerIndex: b.ProposerIndex(), + ParentRoot: parentRoot[:], + StateRoot: stateRoot[:], + Body: ð.BeaconBlockBodyElectra{ + RandaoReveal: randaoReveal[:], + Eth1Data: b.Body().Eth1Data(), + Graffiti: graffiti[:], + ProposerSlashings: b.Body().ProposerSlashings(), + AttesterSlashings: attSlashings, + Attestations: atts, Deposits: b.Body().Deposits(), VoluntaryExits: b.Body().VoluntaryExits(), SyncAggregate: syncAgg, ExecutionPayload: p, BlsToExecutionChanges: blsToExecutionChanges, BlobKzgCommitments: commitments, + Consolidations: consolidations, }, }, Signature: sig[:], diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 7ca9f6e5b555..4cc0f2c20398 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -81,6 +81,14 @@ func (b *SignedBeaconBlock) Copy() (interfaces.SignedBeaconBlock, error) { } cp := eth.CopySignedBeaconBlockDeneb(pb.(*eth.SignedBeaconBlockDeneb)) return initSignedBlockFromProtoDeneb(cp) + case version.Electra: + if b.IsBlinded() { + cp := eth.CopySignedBlindedBeaconBlockElectra(pb.(*eth.SignedBlindedBeaconBlockElectra)) + return initBlindedSignedBlockFromProtoElectra(cp) + } + cp := eth.CopySignedBeaconBlockElectra(pb.(*eth.SignedBeaconBlockElectra)) + return initSignedBlockFromProtoElectra(cp) + default: return nil, errIncorrectBlockVersion } @@ -128,6 +136,15 @@ func (b *SignedBeaconBlock) PbGenericBlock() (*eth.GenericSignedBeaconBlock, err return ð.GenericSignedBeaconBlock{ Block: ð.GenericSignedBeaconBlock_Deneb{Deneb: pb.(*eth.SignedBeaconBlockContentsDeneb)}, }, nil + case version.Electra: + if b.IsBlinded() { + return ð.GenericSignedBeaconBlock{ + Block: ð.GenericSignedBeaconBlock_BlindedElectra{BlindedElectra: pb.(*eth.SignedBlindedBeaconBlockElectra)}, + }, nil + } + return ð.GenericSignedBeaconBlock{ + Block: ð.GenericSignedBeaconBlock_Electra{Electra: pb.(*eth.SignedBeaconBlockContentsElectra)}, + }, nil default: return nil, errIncorrectBlockVersion } @@ -330,6 +347,37 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e }, Signature: b.signature[:], }) + case *enginev1.ExecutionPayloadElectra: + header, err := PayloadToHeaderElectra(payload) + if err != nil { + return nil, err + } + return initBlindedSignedBlockFromProtoElectra( + ð.SignedBlindedBeaconBlockElectra{ + Message: ð.BlindedBeaconBlockElectra{ + Slot: b.block.slot, + ProposerIndex: b.block.proposerIndex, + ParentRoot: b.block.parentRoot[:], + StateRoot: b.block.stateRoot[:], + Body: ð.BlindedBeaconBlockBodyElectra{ + 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, + Consolidations: b.block.body.signedConsolidations, + }, + }, + Signature: b.signature[:], + }) + default: return nil, fmt.Errorf("%T is not an execution payload header", p) } @@ -459,6 +507,11 @@ func (b *SignedBeaconBlock) MarshalSSZ() ([]byte, error) { return pb.(*eth.SignedBlindedBeaconBlockDeneb).MarshalSSZ() } return pb.(*eth.SignedBeaconBlockDeneb).MarshalSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.SignedBlindedBeaconBlockElectra).MarshalSSZ() + } + return pb.(*eth.SignedBeaconBlockElectra).MarshalSSZ() default: return []byte{}, errIncorrectBlockVersion } @@ -491,6 +544,11 @@ func (b *SignedBeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) { return pb.(*eth.SignedBlindedBeaconBlockDeneb).MarshalSSZTo(dst) } return pb.(*eth.SignedBeaconBlockDeneb).MarshalSSZTo(dst) + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.SignedBlindedBeaconBlockElectra).MarshalSSZTo(dst) + } + return pb.(*eth.SignedBeaconBlockElectra).MarshalSSZTo(dst) default: return []byte{}, errIncorrectBlockVersion } @@ -527,6 +585,11 @@ func (b *SignedBeaconBlock) SizeSSZ() int { return pb.(*eth.SignedBlindedBeaconBlockDeneb).SizeSSZ() } return pb.(*eth.SignedBeaconBlockDeneb).SizeSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.SignedBlindedBeaconBlockElectra).SizeSSZ() + } + return pb.(*eth.SignedBeaconBlockElectra).SizeSSZ() default: panic(incorrectBlockVersion) } @@ -622,6 +685,28 @@ func (b *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error { return err } } + case version.Electra: + if b.IsBlinded() { + pb := ð.SignedBlindedBeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initBlindedSignedBlockFromProtoElectra(pb) + if err != nil { + return err + } + } else { + pb := ð.SignedBeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initSignedBlockFromProtoElectra(pb) + if err != nil { + return err + } + } default: return errIncorrectBlockVersion } @@ -695,6 +780,11 @@ func (b *BeaconBlock) HashTreeRoot() ([field_params.RootLength]byte, error) { return pb.(*eth.BlindedBeaconBlockDeneb).HashTreeRoot() } return pb.(*eth.BeaconBlockDeneb).HashTreeRoot() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).HashTreeRoot() + } + return pb.(*eth.BeaconBlockElectra).HashTreeRoot() default: return [field_params.RootLength]byte{}, errIncorrectBlockVersion } @@ -726,6 +816,11 @@ func (b *BeaconBlock) HashTreeRootWith(h *ssz.Hasher) error { return pb.(*eth.BlindedBeaconBlockDeneb).HashTreeRootWith(h) } return pb.(*eth.BeaconBlockDeneb).HashTreeRootWith(h) + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).HashTreeRootWith(h) + } + return pb.(*eth.BeaconBlockElectra).HashTreeRootWith(h) default: return errIncorrectBlockVersion } @@ -758,6 +853,11 @@ func (b *BeaconBlock) MarshalSSZ() ([]byte, error) { return pb.(*eth.BlindedBeaconBlockDeneb).MarshalSSZ() } return pb.(*eth.BeaconBlockDeneb).MarshalSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).MarshalSSZ() + } + return pb.(*eth.BeaconBlockElectra).MarshalSSZ() default: return []byte{}, errIncorrectBlockVersion } @@ -790,6 +890,11 @@ func (b *BeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) { return pb.(*eth.BlindedBeaconBlockDeneb).MarshalSSZTo(dst) } return pb.(*eth.BeaconBlockDeneb).MarshalSSZTo(dst) + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).MarshalSSZTo(dst) + } + return pb.(*eth.BeaconBlockElectra).MarshalSSZTo(dst) default: return []byte{}, errIncorrectBlockVersion } @@ -826,6 +931,11 @@ func (b *BeaconBlock) SizeSSZ() int { return pb.(*eth.BlindedBeaconBlockDeneb).SizeSSZ() } return pb.(*eth.BeaconBlockDeneb).SizeSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).SizeSSZ() + } + return pb.(*eth.BeaconBlockElectra).SizeSSZ() default: panic(incorrectBodyVersion) } @@ -921,6 +1031,28 @@ func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error { return err } } + case version.Electra: + if b.IsBlinded() { + pb := ð.BlindedBeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initBlindedBlockFromProtoElectra(pb) + if err != nil { + return err + } + } else { + pb := ð.BeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initBlockFromProtoElectra(pb) + if err != nil { + return err + } + } default: return errIncorrectBlockVersion } @@ -954,6 +1086,11 @@ func (b *BeaconBlock) AsSignRequestObject() (validatorpb.SignRequestObject, erro return &validatorpb.SignRequest_BlindedBlockDeneb{BlindedBlockDeneb: pb.(*eth.BlindedBeaconBlockDeneb)}, nil } return &validatorpb.SignRequest_BlockDeneb{BlockDeneb: pb.(*eth.BeaconBlockDeneb)}, nil + case version.Electra: + if b.IsBlinded() { + return &validatorpb.SignRequest_BlindedBlockElectra{BlindedBlockElectra: pb.(*eth.BlindedBeaconBlockElectra)}, nil + } + return &validatorpb.SignRequest_BlockElectra{BlockElectra: pb.(*eth.BeaconBlockElectra)}, nil default: return nil, errIncorrectBlockVersion } @@ -996,6 +1133,13 @@ func (b *BeaconBlock) Copy() (interfaces.ReadOnlyBeaconBlock, error) { } cp := eth.CopyBeaconBlockDeneb(pb.(*eth.BeaconBlockDeneb)) return initBlockFromProtoDeneb(cp) + case version.Electra: + if b.IsBlinded() { + cp := eth.CopyBlindedBeaconBlockElectra(pb.(*eth.BlindedBeaconBlockElectra)) + return initBlindedBlockFromProtoElectra(cp) + } + cp := eth.CopyBeaconBlockElectra(pb.(*eth.BeaconBlockElectra)) + return initBlockFromProtoElectra(cp) default: return nil, errIncorrectBlockVersion } @@ -1027,13 +1171,49 @@ func (b *BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing { } // AttesterSlashings returns the attester slashings in the block. -func (b *BeaconBlockBody) AttesterSlashings() []*eth.AttesterSlashing { - return b.attesterSlashings +func (b *BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { + var slashings []interfaces.AttesterSlashing + if b.version < version.Electra { + if b.attesterSlashings == nil { + return nil + } + slashings = make([]interfaces.AttesterSlashing, len(b.attesterSlashings)) + for i, s := range b.attesterSlashings { + slashings[i] = s + } + } else { + if b.attesterSlashingsElectra == nil { + return nil + } + slashings = make([]interfaces.AttesterSlashing, len(b.attesterSlashingsElectra)) + for i, s := range b.attesterSlashingsElectra { + slashings[i] = s + } + } + return slashings } // Attestations returns the stored attestations in the block. -func (b *BeaconBlockBody) Attestations() []*eth.Attestation { - return b.attestations +func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { + var atts []interfaces.Attestation + if b.version < version.Electra { + if b.attestations == nil { + return nil + } + atts = make([]interfaces.Attestation, len(b.attestations)) + for i, a := range b.attestations { + atts[i] = a + } + } else { + if b.attestationsElectra == nil { + return nil + } + atts = make([]interfaces.Attestation, len(b.attestationsElectra)) + for i, a := range b.attestations { + atts[i] = a + } + } + return atts } // Deposits returns the stored deposits in the block. @@ -1079,13 +1259,20 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { switch b.version { case version.Phase0, version.Altair, version.Bellatrix, version.Capella: return nil, consensus_types.ErrNotSupported("BlobKzgCommitments", b.version) - case version.Deneb: + case version.Deneb, version.Electra: return b.blobKzgCommitments, nil default: return nil, errIncorrectBlockVersion } } +func (b *BeaconBlockBody) Consolidations() ([]*eth.SignedConsolidation, error) { + if b.version < version.Electra { + return nil, consensus_types.ErrNotSupported("Consolidations", b.version) + } + return b.signedConsolidations, nil +} + // Version returns the version of the beacon block body func (b *BeaconBlockBody) Version() int { return b.version @@ -1117,6 +1304,11 @@ func (b *BeaconBlockBody) HashTreeRoot() ([field_params.RootLength]byte, error) return pb.(*eth.BlindedBeaconBlockBodyDeneb).HashTreeRoot() } return pb.(*eth.BeaconBlockBodyDeneb).HashTreeRoot() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockBodyElectra).HashTreeRoot() + } + return pb.(*eth.BeaconBlockBodyElectra).HashTreeRoot() default: return [field_params.RootLength]byte{}, errIncorrectBodyVersion } diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index b18a2caa7746..22c2fd63dde8 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -356,16 +356,16 @@ func Test_BeaconBlockBody_ProposerSlashings(t *testing.T) { } func Test_BeaconBlockBody_AttesterSlashings(t *testing.T) { - as := make([]*eth.AttesterSlashing, 0) + as := make([]interfaces.AttesterSlashing, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} - bb.SetAttesterSlashings(as) + require.NoError(t, bb.SetAttesterSlashings(as)) assert.DeepSSZEqual(t, as, bb.Block().Body().AttesterSlashings()) } func Test_BeaconBlockBody_Attestations(t *testing.T) { - a := make([]*eth.Attestation, 0) + a := make([]interfaces.Attestation, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} - bb.SetAttestations(a) + require.NoError(t, bb.SetAttestations(a)) assert.DeepSSZEqual(t, a, bb.Block().Body().Attestations()) } diff --git a/consensus-types/blocks/proto.go b/consensus-types/blocks/proto.go index e6af3a57d3b3..314fb0a5e67a 100644 --- a/consensus-types/blocks/proto.go +++ b/consensus-types/blocks/proto.go @@ -13,7 +13,7 @@ import ( ) // Proto converts the signed beacon block to a protobuf object. -func (b *SignedBeaconBlock) Proto() (proto.Message, error) { +func (b *SignedBeaconBlock) Proto() (proto.Message, error) { // nolint:gocognit if b == nil { return nil, errNilBlock } @@ -131,13 +131,40 @@ func (b *SignedBeaconBlock) Proto() (proto.Message, error) { Block: block, Signature: b.signature[:], }, nil + case version.Electra: + if b.IsBlinded() { + var block *eth.BlindedBeaconBlockElectra + if blockMessage != nil { + var ok bool + block, ok = blockMessage.(*eth.BlindedBeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + } + return ð.SignedBlindedBeaconBlockElectra{ + Message: block, + Signature: b.signature[:], + }, nil + } + var block *eth.BeaconBlockElectra + if blockMessage != nil { + var ok bool + block, ok = blockMessage.(*eth.BeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + } + return ð.SignedBeaconBlockElectra{ + Block: block, + Signature: b.signature[:], + }, nil default: return nil, errors.New("unsupported signed beacon block version") } } // Proto converts the beacon block to a protobuf object. -func (b *BeaconBlock) Proto() (proto.Message, error) { +func (b *BeaconBlock) Proto() (proto.Message, error) { // nolint:gocognit if b == nil { return nil, nil } @@ -279,6 +306,40 @@ func (b *BeaconBlock) Proto() (proto.Message, error) { StateRoot: b.stateRoot[:], Body: body, }, nil + case version.Electra: + if b.IsBlinded() { + var body *eth.BlindedBeaconBlockBodyElectra + if bodyMessage != nil { + var ok bool + body, ok = bodyMessage.(*eth.BlindedBeaconBlockBodyElectra) + if !ok { + return nil, errIncorrectBodyVersion + } + } + return ð.BlindedBeaconBlockElectra{ + Slot: b.slot, + ProposerIndex: b.proposerIndex, + ParentRoot: b.parentRoot[:], + StateRoot: b.stateRoot[:], + Body: body, + }, nil + } + var body *eth.BeaconBlockBodyElectra + if bodyMessage != nil { + var ok bool + body, ok = bodyMessage.(*eth.BeaconBlockBodyElectra) + if !ok { + return nil, errIncorrectBodyVersion + } + } + return ð.BeaconBlockElectra{ + Slot: b.slot, + ProposerIndex: b.proposerIndex, + ParentRoot: b.parentRoot[:], + StateRoot: b.stateRoot[:], + Body: body, + }, nil + default: return nil, errors.New("unsupported beacon block version") } @@ -449,6 +510,56 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) { BlsToExecutionChanges: b.blsToExecutionChanges, BlobKzgCommitments: b.blobKzgCommitments, }, nil + case version.Electra: + if b.IsBlinded() { + var ph *enginev1.ExecutionPayloadHeaderElectra + var ok bool + if b.executionPayloadHeader != nil { + ph, ok = b.executionPayloadHeader.Proto().(*enginev1.ExecutionPayloadHeaderElectra) + if !ok { + return nil, errPayloadHeaderWrongType + } + } + return ð.BlindedBeaconBlockBodyElectra{ + RandaoReveal: b.randaoReveal[:], + Eth1Data: b.eth1Data, + Graffiti: b.graffiti[:], + ProposerSlashings: b.proposerSlashings, + AttesterSlashings: b.attesterSlashingsElectra, + Attestations: b.attestationsElectra, + Deposits: b.deposits, + VoluntaryExits: b.voluntaryExits, + SyncAggregate: b.syncAggregate, + ExecutionPayloadHeader: ph, + BlsToExecutionChanges: b.blsToExecutionChanges, + BlobKzgCommitments: b.blobKzgCommitments, + Consolidations: b.signedConsolidations, + }, nil + } + var p *enginev1.ExecutionPayloadElectra + var ok bool + if b.executionPayload != nil { + p, ok = b.executionPayload.Proto().(*enginev1.ExecutionPayloadElectra) + if !ok { + return nil, errPayloadWrongType + } + } + return ð.BeaconBlockBodyElectra{ + RandaoReveal: b.randaoReveal[:], + Eth1Data: b.eth1Data, + Graffiti: b.graffiti[:], + ProposerSlashings: b.proposerSlashings, + AttesterSlashings: b.attesterSlashingsElectra, + Attestations: b.attestationsElectra, + Deposits: b.deposits, + VoluntaryExits: b.voluntaryExits, + SyncAggregate: b.syncAggregate, + ExecutionPayload: p, + BlsToExecutionChanges: b.blsToExecutionChanges, + BlobKzgCommitments: b.blobKzgCommitments, + Consolidations: b.signedConsolidations, + }, nil + default: return nil, errors.New("unsupported beacon block body version") } @@ -539,6 +650,23 @@ func initSignedBlockFromProtoDeneb(pb *eth.SignedBeaconBlockDeneb) (*SignedBeaco return b, nil } +func initSignedBlockFromProtoElectra(pb *eth.SignedBeaconBlockElectra) (*SignedBeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + block, err := initBlockFromProtoElectra(pb.Block) + if err != nil { + return nil, err + } + b := &SignedBeaconBlock{ + version: version.Electra, + block: block, + signature: bytesutil.ToBytes96(pb.Signature), + } + return b, nil +} + func initBlindedSignedBlockFromProtoBellatrix(pb *eth.SignedBlindedBeaconBlockBellatrix) (*SignedBeaconBlock, error) { if pb == nil { return nil, errNilBlock @@ -590,6 +718,23 @@ func initBlindedSignedBlockFromProtoDeneb(pb *eth.SignedBlindedBeaconBlockDeneb) return b, nil } +func initBlindedSignedBlockFromProtoElectra(pb *eth.SignedBlindedBeaconBlockElectra) (*SignedBeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + block, err := initBlindedBlockFromProtoElectra(pb.Message) + if err != nil { + return nil, err + } + b := &SignedBeaconBlock{ + version: version.Electra, + block: block, + signature: bytesutil.ToBytes96(pb.Signature), + } + return b, nil +} + func initBlockFromProtoPhase0(pb *eth.BeaconBlock) (*BeaconBlock, error) { if pb == nil { return nil, errNilBlock @@ -710,6 +855,26 @@ func initBlockFromProtoDeneb(pb *eth.BeaconBlockDeneb) (*BeaconBlock, error) { return b, nil } +func initBlockFromProtoElectra(pb *eth.BeaconBlockElectra) (*BeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + body, err := initBlockBodyFromProtoElectra(pb.Body) + if err != nil { + return nil, err + } + b := &BeaconBlock{ + version: version.Electra, + slot: pb.Slot, + proposerIndex: pb.ProposerIndex, + parentRoot: bytesutil.ToBytes32(pb.ParentRoot), + stateRoot: bytesutil.ToBytes32(pb.StateRoot), + body: body, + } + return b, nil +} + func initBlindedBlockFromProtoCapella(pb *eth.BlindedBeaconBlockCapella) (*BeaconBlock, error) { if pb == nil { return nil, errNilBlock @@ -750,6 +915,26 @@ func initBlindedBlockFromProtoDeneb(pb *eth.BlindedBeaconBlockDeneb) (*BeaconBlo return b, nil } +func initBlindedBlockFromProtoElectra(pb *eth.BlindedBeaconBlockElectra) (*BeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + body, err := initBlindedBlockBodyFromProtoElectra(pb.Body) + if err != nil { + return nil, err + } + b := &BeaconBlock{ + version: version.Electra, + slot: pb.Slot, + proposerIndex: pb.ProposerIndex, + parentRoot: bytesutil.ToBytes32(pb.ParentRoot), + stateRoot: bytesutil.ToBytes32(pb.StateRoot), + body: body, + } + return b, nil +} + func initBlockBodyFromProtoPhase0(pb *eth.BeaconBlockBody) (*BeaconBlockBody, error) { if pb == nil { return nil, errNilBlockBody @@ -950,3 +1135,61 @@ func initBlindedBlockBodyFromProtoDeneb(pb *eth.BlindedBeaconBlockBodyDeneb) (*B } return b, nil } + +func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlockBody, error) { + if pb == nil { + return nil, errNilBlockBody + } + + p, err := WrappedExecutionPayloadElectra(pb.ExecutionPayload, big.NewInt(0)) + // We allow the payload to be nil + if err != nil && err != consensus_types.ErrNilObjectWrapped { + return nil, err + } + b := &BeaconBlockBody{ + version: version.Electra, + randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), + eth1Data: pb.Eth1Data, + graffiti: bytesutil.ToBytes32(pb.Graffiti), + proposerSlashings: pb.ProposerSlashings, + attesterSlashingsElectra: pb.AttesterSlashings, + attestationsElectra: pb.Attestations, + deposits: pb.Deposits, + voluntaryExits: pb.VoluntaryExits, + syncAggregate: pb.SyncAggregate, + executionPayload: p, + blsToExecutionChanges: pb.BlsToExecutionChanges, + blobKzgCommitments: pb.BlobKzgCommitments, + signedConsolidations: pb.Consolidations, + } + return b, nil +} + +func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) (*BeaconBlockBody, error) { + if pb == nil { + return nil, errNilBlockBody + } + + ph, err := WrappedExecutionPayloadHeaderElectra(pb.ExecutionPayloadHeader, big.NewInt(0)) + // We allow the payload to be nil + if err != nil && err != consensus_types.ErrNilObjectWrapped { + return nil, err + } + b := &BeaconBlockBody{ + version: version.Electra, + randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), + eth1Data: pb.Eth1Data, + graffiti: bytesutil.ToBytes32(pb.Graffiti), + proposerSlashings: pb.ProposerSlashings, + attesterSlashingsElectra: pb.AttesterSlashings, + attestationsElectra: pb.Attestations, + deposits: pb.Deposits, + voluntaryExits: pb.VoluntaryExits, + syncAggregate: pb.SyncAggregate, + executionPayloadHeader: ph, + blsToExecutionChanges: pb.BlsToExecutionChanges, + blobKzgCommitments: pb.BlobKzgCommitments, + signedConsolidations: pb.Consolidations, + } + return b, nil +} diff --git a/consensus-types/blocks/setters.go b/consensus-types/blocks/setters.go index 0c1032cee1ff..caa1638211f0 100644 --- a/consensus-types/blocks/setters.go +++ b/consensus-types/blocks/setters.go @@ -1,6 +1,8 @@ package blocks import ( + "fmt" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -64,14 +66,56 @@ func (b *SignedBeaconBlock) SetProposerSlashings(p []*eth.ProposerSlashing) { // SetAttesterSlashings sets the attester slashings in the block. // This function is not thread safe, it is only used during block creation. -func (b *SignedBeaconBlock) SetAttesterSlashings(a []*eth.AttesterSlashing) { - b.block.body.attesterSlashings = a +func (b *SignedBeaconBlock) SetAttesterSlashings(slashings []interfaces.AttesterSlashing) error { + if b.version < version.Electra { + blockSlashings := make([]*eth.AttesterSlashing, 0, len(slashings)) + for _, slashing := range slashings { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return fmt.Errorf("slashing of type %T is not *eth.AttesterSlashing", slashing) + } + blockSlashings = append(blockSlashings, s) + } + b.block.body.attesterSlashings = blockSlashings + } else { + blockSlashings := make([]*eth.AttesterSlashingElectra, 0, len(slashings)) + for _, slashing := range slashings { + s, ok := slashing.(*eth.AttesterSlashingElectra) + if !ok { + return fmt.Errorf("slashing of type %T is not *eth.AttesterSlashingElectra", slashing) + } + blockSlashings = append(blockSlashings, s) + } + b.block.body.attesterSlashingsElectra = blockSlashings + } + return nil } // SetAttestations sets the attestations in the block. // This function is not thread safe, it is only used during block creation. -func (b *SignedBeaconBlock) SetAttestations(a []*eth.Attestation) { - b.block.body.attestations = a +func (b *SignedBeaconBlock) SetAttestations(atts []interfaces.Attestation) error { + if b.version < version.Electra { + blockAtts := make([]*eth.Attestation, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*eth.Attestation) + if !ok { + return fmt.Errorf("attestation of type %T is not *eth.Attestation", att) + } + blockAtts = append(blockAtts, a) + } + b.block.body.attestations = blockAtts + } else { + blockAtts := make([]*eth.AttestationElectra, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*eth.AttestationElectra) + if !ok { + return fmt.Errorf("attestation of type %T is not *eth.AttestationElectra", att) + } + blockAtts = append(blockAtts, a) + } + b.block.body.attestationsElectra = blockAtts + } + return nil } // SetDeposits sets the deposits in the block. @@ -122,13 +166,9 @@ func (b *SignedBeaconBlock) SetBLSToExecutionChanges(blsToExecutionChanges []*et // SetBlobKzgCommitments sets the blob kzg commitments in the block. func (b *SignedBeaconBlock) SetBlobKzgCommitments(c [][]byte) error { - switch b.version { - case version.Phase0, version.Altair, version.Bellatrix, version.Capella: + if b.version < version.Deneb { return consensus_types.ErrNotSupported("SetBlobKzgCommitments", b.version) - case version.Deneb: - b.block.body.blobKzgCommitments = c - return nil - default: - return errIncorrectBlockVersion } + b.block.body.blobKzgCommitments = c + return nil } diff --git a/consensus-types/blocks/types.go b/consensus-types/blocks/types.go index 0ad61da033e0..c6216b1d593c 100644 --- a/consensus-types/blocks/types.go +++ b/consensus-types/blocks/types.go @@ -38,20 +38,23 @@ var ( // BeaconBlockBody is the main beacon block body structure. It can represent any block type. type BeaconBlockBody struct { - version int - randaoReveal [field_params.BLSSignatureLength]byte - eth1Data *eth.Eth1Data - graffiti [field_params.RootLength]byte - proposerSlashings []*eth.ProposerSlashing - attesterSlashings []*eth.AttesterSlashing - attestations []*eth.Attestation - deposits []*eth.Deposit - voluntaryExits []*eth.SignedVoluntaryExit - syncAggregate *eth.SyncAggregate - executionPayload interfaces.ExecutionData - executionPayloadHeader interfaces.ExecutionData - blsToExecutionChanges []*eth.SignedBLSToExecutionChange - blobKzgCommitments [][]byte + version int + randaoReveal [field_params.BLSSignatureLength]byte + eth1Data *eth.Eth1Data + graffiti [field_params.RootLength]byte + proposerSlashings []*eth.ProposerSlashing + attesterSlashings []*eth.AttesterSlashing + attesterSlashingsElectra []*eth.AttesterSlashingElectra + attestations []*eth.Attestation + attestationsElectra []*eth.AttestationElectra + deposits []*eth.Deposit + voluntaryExits []*eth.SignedVoluntaryExit + syncAggregate *eth.SyncAggregate + executionPayload interfaces.ExecutionData + executionPayloadHeader interfaces.ExecutionData + blsToExecutionChanges []*eth.SignedBLSToExecutionChange + blobKzgCommitments [][]byte + signedConsolidations []*eth.SignedConsolidation } // BeaconBlock is the main beacon block structure. It can represent any block type. diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index a6fbdd5df957..84eb1c643fa2 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "//proto/prysm/v1alpha1/validator-client:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", + "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 2366c3f19599..08cc1ef88d01 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -2,6 +2,7 @@ package interfaces import ( ssz "github.com/prysmaticlabs/fastssz" + "github.com/prysmaticlabs/go-bitfield" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/math" @@ -66,8 +67,8 @@ type ReadOnlyBeaconBlockBody interface { Eth1Data() *ethpb.Eth1Data Graffiti() [field_params.RootLength]byte ProposerSlashings() []*ethpb.ProposerSlashing - AttesterSlashings() []*ethpb.AttesterSlashing - Attestations() []*ethpb.Attestation + AttesterSlashings() []AttesterSlashing + Attestations() []Attestation Deposits() []*ethpb.Deposit VoluntaryExits() []*ethpb.SignedVoluntaryExit SyncAggregate() (*ethpb.SyncAggregate, error) @@ -77,6 +78,7 @@ type ReadOnlyBeaconBlockBody interface { Execution() (ExecutionData, error) BLSToExecutionChanges() ([]*ethpb.SignedBLSToExecutionChange, error) BlobKzgCommitments() ([][]byte, error) + Consolidations() ([]*ethpb.SignedConsolidation, error) } type SignedBeaconBlock interface { @@ -87,8 +89,8 @@ type SignedBeaconBlock interface { SetSyncAggregate(*ethpb.SyncAggregate) error SetVoluntaryExits([]*ethpb.SignedVoluntaryExit) SetDeposits([]*ethpb.Deposit) - SetAttestations([]*ethpb.Attestation) - SetAttesterSlashings([]*ethpb.AttesterSlashing) + SetAttestations([]Attestation) error + SetAttesterSlashings([]AttesterSlashing) error SetProposerSlashings([]*ethpb.ProposerSlashing) SetGraffiti([]byte) SetEth1Data(*ethpb.Eth1Data) @@ -132,6 +134,45 @@ type ExecutionData interface { PbCapella() (*enginev1.ExecutionPayloadCapella, error) PbBellatrix() (*enginev1.ExecutionPayload, error) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) + PbElectra() (*enginev1.ExecutionPayloadElectra, error) ValueInWei() (math.Wei, error) ValueInGwei() (uint64, error) + DepositReceipts() ([]*enginev1.DepositReceipt, error) + WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) +} + +type Attestation interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetAggregationBits() bitfield.Bitlist + GetData() *ethpb.AttestationData + GetCommitteeBitsVal() bitfield.Bitfield + GetSignature() []byte +} + +type AttesterSlashing interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetFirstAttestation() ethpb.IndexedAtt + GetSecondAttestation() ethpb.IndexedAtt +} + +// TODO: this is ugly. The proper way to do this is to create a Copy() function on the interface and implement it. But this results in a circular dependency. +// CopyAttestation copies the provided attestation object. +func CopyAttestation(att Attestation) Attestation { + a, ok := att.(*ethpb.Attestation) + if ok { + return ethpb.CopyAttestation(a) + } + ae, ok := att.(*ethpb.AttestationElectra) + if ok { + return ethpb.CopyAttestationElectra(ae) + } + return nil } diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index f567ed6b3a2c..452c8720d55f 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -224,7 +224,7 @@ func (BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing { panic("implement me") } -func (BeaconBlockBody) AttesterSlashings() []*eth.AttesterSlashing { +func (BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { panic("implement me") } @@ -280,7 +280,7 @@ func (b *BeaconBlockBody) SetProposerSlashings([]*eth.ProposerSlashing) { panic("implement me") } -func (b *BeaconBlockBody) SetAttesterSlashings([]*eth.AttesterSlashing) { +func (b *BeaconBlockBody) SetAttesterSlashings([]interfaces.AttesterSlashing) { panic("implement me") } @@ -313,7 +313,11 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { panic("implement me") } -func (b *BeaconBlockBody) Attestations() []*eth.Attestation { +func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { + panic("implement me") +} + +func (b *BeaconBlockBody) Consolidations() ([]*eth.SignedConsolidation, error) { panic("implement me") } diff --git a/encoding/ssz/htrutils_test.go b/encoding/ssz/htrutils_test.go index a49f63932f75..50717fa8afcf 100644 --- a/encoding/ssz/htrutils_test.go +++ b/encoding/ssz/htrutils_test.go @@ -288,7 +288,7 @@ func TestDepositReceiptSliceRoot(t *testing.T) { limit uint64 want [32]byte }{ - { + { name: "empty", input: make([]*enginev1.DepositReceipt, 0), want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b}, @@ -297,15 +297,15 @@ func TestDepositReceiptSliceRoot(t *testing.T) { name: "non-empty", input: []*enginev1.DepositReceipt{ { - Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48), + Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48), WithdrawalCredentials: bytesutil.PadTo([]byte{0x03, 0x04}, 32), - Amount: 5, - Signature: bytesutil.PadTo([]byte{0x06, 0x07}, 96), - Index: 8, + Amount: 5, + Signature: bytesutil.PadTo([]byte{0x06, 0x07}, 96), + Index: 8, }, }, limit: 16, - want: [32]byte{0x34, 0xe3, 0x76, 0x5, 0xe5, 0x12, 0xe4, 0x75, 0x14, 0xf6, 0x72, 0x1c, 0x56, 0x5a, 0xa7, 0xf8, 0x8d, 0xaf, 0x84, 0xb7, 0xd7, 0x3e, 0xe6, 0x5f, 0x3f, 0xb1, 0x9f, 0x41, 0xf0, 0x10, 0x2b, 0xe6}, + want: [32]byte{0x34, 0xe3, 0x76, 0x5, 0xe5, 0x12, 0xe4, 0x75, 0x14, 0xf6, 0x72, 0x1c, 0x56, 0x5a, 0xa7, 0xf8, 0x8d, 0xaf, 0x84, 0xb7, 0xd7, 0x3e, 0xe6, 0x5f, 0x3f, 0xb1, 0x9f, 0x41, 0xf0, 0x10, 0x2b, 0xe6}, }, } @@ -334,13 +334,13 @@ func TestWithdrawalRequestSliceRoot(t *testing.T) { name: "non-empty", input: []*enginev1.ExecutionLayerWithdrawalRequest{ { - SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20), + SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20), ValidatorPubkey: bytesutil.PadTo([]byte{0x03, 0x04}, 48), - Amount: 5, + Amount: 5, }, }, limit: 16, - want: [32]byte{0xa8, 0xab, 0xb2, 0x20, 0xe6, 0xd6, 0x5a, 0x7e, 0x56, 0x60, 0xe4, 0x9d, 0xae, 0x36, 0x17, 0x3d, 0x8b, 0xd, 0xde, 0x28, 0x96, 0x5, 0x82, 0x72, 0x18, 0xda, 0xc7, 0x5a, 0x53, 0xe0, 0x35, 0xf7}, + want: [32]byte{0xa8, 0xab, 0xb2, 0x20, 0xe6, 0xd6, 0x5a, 0x7e, 0x56, 0x60, 0xe4, 0x9d, 0xae, 0x36, 0x17, 0x3d, 0x8b, 0xd, 0xde, 0x28, 0x96, 0x5, 0x82, 0x72, 0x18, 0xda, 0xc7, 0x5a, 0x53, 0xe0, 0x35, 0xf7}, }, } diff --git a/go.mod b/go.mod index 6bdc52d05f11..6bcb6ea70560 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c github.com/golang/protobuf v1.5.3 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb + github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.0 @@ -146,7 +147,6 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect github.com/gorilla/websocket v1.5.1 // indirect diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index 2b122719efa9..9022df00bdf5 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: ee70c11ffb08b4e0b97fe19fdfdf1ce59c1474de33166d21d4fbd2f696c267ea +// Hash: 88fdbdfda4571603e11174a57e65c25e06780ff2cbd795c8ae2a4709da24d9a9 package enginev1 import ( diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index 3603865f6075..d6f69e0a83a6 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c +// Hash: 6fed60156f1e57926b40b972ee25b48a82b18726a9c64fb0e974e4f638784049 package v1 import ( diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index 68ff620f25be..2674eea802fb 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6b214399116c0ca31026da23db2b85fccd78e16d7b9113c83b4a9ee4e60977f6 +// Hash: 36d05ceafa355d5aa87123eb218143987a79f5095e2cafbad7760712ad0934a3 package eth import ( diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index a0a18f2cb944..3e8f57833cf5 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -205,6 +205,7 @@ go_proto_library( go_library( name = "go_default_library", srcs = [ + "attestation.go", "cloners.go", "eip_7251.go", "sync_committee_mainnet.go", @@ -220,6 +221,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", + "//runtime/version:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index b11c70e5db75..2af00e0872d8 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -1 +1,81 @@ package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +// TODO: it would be nicer to declare this inside consensus-types, but this will result in a circular dependency +// (because the interface method returns another interface, the implementation also returns an interface) +type IndexedAtt interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetAttestingIndices() []uint64 + GetData() *AttestationData + GetSignature() []byte +} + +func (a *Attestation) Version() int { + return version.Phase0 +} + +func (a *Attestation) GetCommitteeBitsVal() bitfield.Bitfield { + return nil +} + +func (a *PendingAttestation) Version() int { + return version.Phase0 +} + +func (a *PendingAttestation) GetCommitteeBitsVal() bitfield.Bitfield { + return nil +} + +func (a *PendingAttestation) GetSignature() []byte { + return nil +} + +func (a *AttestationElectra) Version() int { + return version.Electra +} + +func (a *AttestationElectra) GetCommitteeBitsVal() bitfield.Bitfield { + return a.CommitteeBits +} + +func (a *IndexedAttestation) Version() int { + return version.Phase0 +} + +func (a *IndexedAttestationElectra) Version() int { + return version.Electra +} + +func (a *AttesterSlashing) Version() int { + return version.Phase0 +} + +func (a *AttesterSlashing) GetFirstAttestation() IndexedAtt { + return a.Attestation_1 +} + +func (a *AttesterSlashing) GetSecondAttestation() IndexedAtt { + return a.Attestation_2 +} + +func (a *AttesterSlashingElectra) Version() int { + return version.Electra +} + +func (a *AttesterSlashingElectra) GetFirstAttestation() IndexedAtt { + return a.Attestation_1 +} + +func (a *AttesterSlashingElectra) GetSecondAttestation() IndexedAtt { + return a.Attestation_2 +} diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index 33febb0f4cbc..9c45df7466c1 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -8,6 +8,7 @@ go_library( deps = [ "//beacon-chain/core/signing:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel index 1a537f2da053..53fe85d02514 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations", visibility = ["//visibility:public"], deps = [ + "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation:go_default_library", @@ -27,6 +28,7 @@ go_test( embed = [":go_default_library"], deps = [ "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//encoding/ssz/equality:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go index 7d77655744ff..c7dc7542b0b7 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go @@ -2,6 +2,7 @@ package attestations import ( "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -9,7 +10,7 @@ import ( ) // attList represents list of attestations, defined for easier en masse operations (filtering, sorting). -type attList []*ethpb.Attestation +type attList []interfaces.Attestation // BLS aggregate signature aliases for testing / benchmark substitution. These methods are // significantly more expensive than the inner logic of AggregateAttestations so they must be @@ -32,25 +33,25 @@ var ErrInvalidAttestationCount = errors.New("invalid number of attestations") // clonedAtts[i] = stateTrie.CopyAttestation(a) // } // aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) -func Aggregate(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { +func Aggregate(atts []interfaces.Attestation) ([]interfaces.Attestation, error) { return MaxCoverAttestationAggregation(atts) } // AggregateDisjointOneBitAtts aggregates unaggregated attestations with the // exact same attestation data. -func AggregateDisjointOneBitAtts(atts []*ethpb.Attestation) (*ethpb.Attestation, error) { +func AggregateDisjointOneBitAtts(atts []interfaces.Attestation) (interfaces.Attestation, error) { if len(atts) == 0 { return nil, nil } if len(atts) == 1 { return atts[0], nil } - coverage, err := atts[0].AggregationBits.ToBitlist64() + coverage, err := atts[0].GetAggregationBits().ToBitlist64() if err != nil { return nil, errors.Wrap(err, "could not get aggregation bits") } for _, att := range atts[1:] { - bits, err := att.AggregationBits.ToBitlist64() + bits, err := att.GetAggregationBits().ToBitlist64() if err != nil { return nil, errors.Wrap(err, "could not get aggregation bits") } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go index 08b51ad09af8..13d1d277c686 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go @@ -215,14 +215,14 @@ func TestAggregateAttestations_Aggregate(t *testing.T) { } require.NoError(t, err) sort.Slice(got, func(i, j int) bool { - return got[i].AggregationBits.Bytes()[0] < got[j].AggregationBits.Bytes()[0] + return got[i].GetAggregationBits().Bytes()[0] < got[j].GetAggregationBits().Bytes()[0] }) sort.Slice(tt.want, func(i, j int) bool { return tt.want[i].Bytes()[0] < tt.want[j].Bytes()[0] }) assert.Equal(t, len(tt.want), len(got)) for i, w := range tt.want { - assert.DeepEqual(t, w.Bytes(), got[i].AggregationBits.Bytes()) + assert.DeepEqual(t, w.Bytes(), got[i].GetAggregationBits().Bytes()) } } t.Run(tt.name, func(t *testing.T) { @@ -259,7 +259,7 @@ func TestAggregateAttestations_Aggregate(t *testing.T) { assert.NoError(t, err) assert.Equal(t, len(want), len(got)) for i, w := range want { - assert.DeepEqual(t, w.Bytes(), got[i].AggregationBits.Bytes()) + assert.DeepEqual(t, w.Bytes(), got[i].GetAggregationBits().Bytes()) } }) } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go index 36061552b7ac..a59b835ff285 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go @@ -5,6 +5,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -14,7 +15,7 @@ import ( // Aggregation occurs in many rounds, up until no more aggregation is possible (all attestations // are overlapping). // See https://hackmd.io/@farazdagi/in-place-attagg for design and rationale. -func MaxCoverAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { +func MaxCoverAttestationAggregation(atts []interfaces.Attestation) ([]interfaces.Attestation, error) { if len(atts) < 2 { return atts, nil } @@ -28,7 +29,7 @@ func MaxCoverAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attesta candidates := make([]*bitfield.Bitlist64, len(atts)) for i := 0; i < len(atts); i++ { var err error - candidates[i], err = atts[i].AggregationBits.ToBitlist64() + candidates[i], err = atts[i].GetAggregationBits().ToBitlist64() if err != nil { return nil, err } @@ -126,7 +127,7 @@ func (al attList) aggregate(coverage bitfield.Bitlist) (*ethpb.Attestation, erro } signs := make([]bls.Signature, len(al)) for i := 0; i < len(al); i++ { - sig, err := signatureFromBytes(al[i].Signature) + sig, err := signatureFromBytes(al[i].GetSignature()) if err != nil { return nil, err } @@ -134,7 +135,7 @@ func (al attList) aggregate(coverage bitfield.Bitlist) (*ethpb.Attestation, erro } return ðpb.Attestation{ AggregationBits: coverage, - Data: ethpb.CopyAttestationData(al[0].Data), + Data: ethpb.CopyAttestationData(al[0].GetData()), Signature: aggregateSignatures(signs).Marshal(), }, nil } @@ -149,7 +150,7 @@ func padSelectedKeys(keys []int, pad int) []int { // aggregateAttestations combines signatures of selected attestations into a single aggregate attestation, and // pushes that aggregated attestation into the position of the first of selected attestations. -func aggregateAttestations(atts []*ethpb.Attestation, keys []int, coverage *bitfield.Bitlist64) (targetIdx int, err error) { +func aggregateAttestations(atts []interfaces.Attestation, keys []int, coverage *bitfield.Bitlist64) (targetIdx int, err error) { if len(keys) < 2 || atts == nil || len(atts) < 2 { return targetIdx, errors.Wrap(ErrInvalidAttestationCount, "cannot aggregate") } @@ -160,13 +161,13 @@ func aggregateAttestations(atts []*ethpb.Attestation, keys []int, coverage *bitf var data *ethpb.AttestationData signs := make([]bls.Signature, 0, len(keys)) for i, idx := range keys { - sig, err := signatureFromBytes(atts[idx].Signature) + sig, err := signatureFromBytes(atts[idx].GetSignature()) if err != nil { return targetIdx, err } signs = append(signs, sig) if i == 0 { - data = ethpb.CopyAttestationData(atts[idx].Data) + data = ethpb.CopyAttestationData(atts[idx].GetData()) targetIdx = idx } } @@ -183,7 +184,7 @@ func aggregateAttestations(atts []*ethpb.Attestation, keys []int, coverage *bitf // rearrangeProcessedAttestations pushes processed attestations to the end of the slice, returning // the number of items re-arranged (so that caller can cut the slice, and allow processed items to be // garbage collected). -func rearrangeProcessedAttestations(atts []*ethpb.Attestation, candidates []*bitfield.Bitlist64, processedKeys []int) { +func rearrangeProcessedAttestations(atts []interfaces.Attestation, candidates []*bitfield.Bitlist64, processedKeys []int) { if atts == nil || candidates == nil || processedKeys == nil { return } @@ -215,7 +216,7 @@ func (al attList) merge(al1 attList) attList { // selectUsingKeys returns only items with specified keys. func (al attList) selectUsingKeys(keys []int) attList { - filtered := make([]*ethpb.Attestation, len(keys)) + filtered := make([]interfaces.Attestation, len(keys)) for i, key := range keys { filtered[i] = al[key] } @@ -246,7 +247,7 @@ func (al attList) selectComplementUsingKeys(keys []int) attList { // hasCoverage returns true if a given coverage is found in attestations list. func (al attList) hasCoverage(coverage bitfield.Bitlist) (bool, error) { for _, att := range al { - x, err := att.AggregationBits.Xor(coverage) + x, err := att.GetAggregationBits().Xor(coverage) if err != nil { return false, err } @@ -263,12 +264,12 @@ func (al attList) filterContained() (attList, error) { return al, nil } sort.Slice(al, func(i, j int) bool { - return al[i].AggregationBits.Count() > al[j].AggregationBits.Count() + return al[i].GetAggregationBits().Count() > al[j].GetAggregationBits().Count() }) filtered := al[:0] filtered = append(filtered, al[0]) for i := 1; i < len(al); i++ { - c, err := filtered[len(filtered)-1].AggregationBits.Contains(al[i].AggregationBits) + c, err := filtered[len(filtered)-1].GetAggregationBits().Contains(al[i].GetAggregationBits()) if err != nil { return nil, err } @@ -288,11 +289,11 @@ func (al attList) validate() error { if len(al) == 0 { return errors.Wrap(aggregation.ErrInvalidMaxCoverProblem, "empty list") } - if al[0].AggregationBits == nil || al[0].AggregationBits.Len() == 0 { + if al[0].GetAggregationBits() == nil || al[0].GetAggregationBits().Len() == 0 { return errors.Wrap(aggregation.ErrInvalidMaxCoverProblem, "bitlist cannot be nil or empty") } for i := 1; i < len(al); i++ { - if al[i].AggregationBits == nil || al[i].AggregationBits.Len() == 0 { + if al[i].GetAggregationBits() == nil || al[i].GetAggregationBits().Len() == 0 { return errors.Wrap(aggregation.ErrInvalidMaxCoverProblem, "bitlist cannot be nil or empty") } } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go index de9c607eaa4d..638c85ded6b1 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -144,138 +145,138 @@ func TestAggregateAttestations_MaxCover_AttList_validate(t *testing.T) { func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation keys []int - wantAtts []*ethpb.Attestation + wantAtts []interfaces.Attestation }{ { name: "nil attestations", }, { name: "single attestation no processed keys", - atts: []*ethpb.Attestation{ - {}, + atts: []interfaces.Attestation{ + ðpb.Attestation{}, }, - wantAtts: []*ethpb.Attestation{ - {}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{}, }, }, { name: "single attestation processed", - atts: []*ethpb.Attestation{ - {}, + atts: []interfaces.Attestation{ + ðpb.Attestation{}, }, keys: []int{0}, - wantAtts: []*ethpb.Attestation{ + wantAtts: []interfaces.Attestation{ nil, }, }, { name: "multiple processed, last attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, }, keys: []int{1, 4}, // Only attestation at index 1, should be moved, att at 4 is already at the end. - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x02}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, nil, nil, }, }, { name: "all processed", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, }, keys: []int{0, 1, 2, 3, 4}, - wantAtts: []*ethpb.Attestation{ + wantAtts: []interfaces.Attestation{ nil, nil, nil, nil, nil, }, }, { name: "operate on slice, single attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, // Assuming some attestations have been already marked as nil, during previous rounds: nil, nil, nil, }, keys: []int{2}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x04}}, - {AggregationBits: bitfield.Bitlist{0x03}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, }, }, { name: "operate on slice, non-last attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, - {AggregationBits: bitfield.Bitlist{0x05}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, // Assuming some attestations have been already marked as nil, during previous rounds: nil, nil, nil, }, keys: []int{2, 3}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x05}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, nil, nil, nil, nil, nil, }, }, { name: "operate on slice, last attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, // Assuming some attestations have been already marked as nil, during previous rounds: nil, nil, nil, }, keys: []int{2, 4}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x03}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, nil, }, }, { name: "many items, many selected, keys unsorted", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, - {AggregationBits: bitfield.Bitlist{0x05}}, - {AggregationBits: bitfield.Bitlist{0x06}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x06}}, }, keys: []int{4, 1, 2, 5, 6}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x03}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, nil, }, }, @@ -286,7 +287,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { for i := 0; i < len(tt.atts); i++ { if tt.atts[i] != nil { var err error - candidates[i], err = tt.atts[i].AggregationBits.ToBitlist64() + candidates[i], err = tt.atts[i].GetAggregationBits().ToBitlist64() if err != nil { t.Error(err) } @@ -302,8 +303,8 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { sign := bls.NewAggregateSignature().Marshal() tests := []struct { name string - atts []*ethpb.Attestation - wantAtts []*ethpb.Attestation + atts []interfaces.Attestation + wantAtts []interfaces.Attestation keys []int coverage *bitfield.Bitlist64 wantTargetIdx int @@ -317,8 +318,8 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "single attestation", - atts: []*ethpb.Attestation{ - {}, + atts: []interfaces.Attestation{ + ðpb.Attestation{}, }, wantTargetIdx: 0, wantErr: ErrInvalidAttestationCount.Error(), @@ -331,9 +332,9 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, none selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, }, wantTargetIdx: 0, wantErr: ErrInvalidAttestationCount.Error(), @@ -341,9 +342,9 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, one selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, }, wantTargetIdx: 0, wantErr: ErrInvalidAttestationCount.Error(), @@ -351,13 +352,13 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, both selected, empty coverage", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, }, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0b00000111, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000111, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, }, wantTargetIdx: 0, wantErr: "invalid or empty coverage", @@ -365,13 +366,13 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, both selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, }, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, }, wantTargetIdx: 0, keys: []int{0, 1}, @@ -385,21 +386,21 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "many attestations, several selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, - }, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010110, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, + }, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010110, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, }, wantTargetIdx: 1, keys: []int{1, 2, 4}, @@ -422,10 +423,10 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { assert.NoError(t, err) } assert.Equal(t, tt.wantTargetIdx, gotTargetIdx) - extractBitlists := func(atts []*ethpb.Attestation) []bitfield.Bitlist { + extractBitlists := func(atts []interfaces.Attestation) []bitfield.Bitlist { bl := make([]bitfield.Bitlist, len(atts)) for i, att := range atts { - bl[i] = att.AggregationBits + bl[i] = att.GetAggregationBits() } return bl } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel index 220bbe96bfba..c1e4ddcb0bb6 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel @@ -7,6 +7,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/testing", visibility = ["//visibility:public"], deps = [ + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go b/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go index 7e17c3e2c2df..c8510b5186c8 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -77,8 +78,8 @@ func Bitlists64WithMultipleBitSet(t testing.TB, n, length, count uint64) []*bitf } // MakeAttestationsFromBitlists creates list of attestations from list of bitlist. -func MakeAttestationsFromBitlists(bl []bitfield.Bitlist) []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, len(bl)) +func MakeAttestationsFromBitlists(bl []bitfield.Bitlist) []interfaces.Attestation { + atts := make([]interfaces.Attestation, len(bl)) for i, b := range bl { atts[i] = ðpb.Attestation{ AggregationBits: b, diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils.go b/proto/prysm/v1alpha1/attestation/attestation_utils.go index 77bdfb55ca49..bfa2bf64aa92 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -37,8 +38,8 @@ import ( // data=attestation.data, // signature=attestation.signature, // ) -func ConvertToIndexed(ctx context.Context, attestation *ethpb.Attestation, committee []primitives.ValidatorIndex) (*ethpb.IndexedAttestation, error) { - attIndices, err := AttestingIndices(attestation.AggregationBits, committee) +func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, committee []primitives.ValidatorIndex) (ethpb.IndexedAtt, error) { + attIndices, err := AttestingIndices(attestation.GetAggregationBits(), committee) if err != nil { return nil, err } @@ -47,8 +48,8 @@ func ConvertToIndexed(ctx context.Context, attestation *ethpb.Attestation, commi return attIndices[i] < attIndices[j] }) inAtt := ðpb.IndexedAttestation{ - Data: attestation.Data, - Signature: attestation.Signature, + Data: attestation.GetData(), + Signature: attestation.GetSignature(), AttestingIndices: attIndices, } return inAtt, err @@ -101,17 +102,17 @@ func AttestingIndices(bf bitfield.Bitfield, committee []primitives.ValidatorInde // domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) // signing_root = compute_signing_root(indexed_attestation.data, domain) // return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) -func VerifyIndexedAttestationSig(ctx context.Context, indexedAtt *ethpb.IndexedAttestation, pubKeys []bls.PublicKey, domain []byte) error { +func VerifyIndexedAttestationSig(ctx context.Context, indexedAtt ethpb.IndexedAtt, pubKeys []bls.PublicKey, domain []byte) error { _, span := trace.StartSpan(ctx, "attestationutil.VerifyIndexedAttestationSig") defer span.End() - indices := indexedAtt.AttestingIndices + indices := indexedAtt.GetAttestingIndices() - messageHash, err := signing.ComputeSigningRoot(indexedAtt.Data, domain) + messageHash, err := signing.ComputeSigningRoot(indexedAtt.GetData(), domain) if err != nil { return errors.Wrap(err, "could not get signing root of object") } - sig, err := bls.SignatureFromBytes(indexedAtt.Signature) + sig, err := bls.SignatureFromBytes(indexedAtt.GetSignature()) if err != nil { return errors.Wrap(err, "could not convert bytes to signature") } @@ -142,14 +143,17 @@ func VerifyIndexedAttestationSig(ctx context.Context, indexedAtt *ethpb.IndexedA // domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) // signing_root = compute_signing_root(indexed_attestation.data, domain) // return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) -func IsValidAttestationIndices(ctx context.Context, indexedAttestation *ethpb.IndexedAttestation) error { +func IsValidAttestationIndices(ctx context.Context, indexedAttestation ethpb.IndexedAtt) error { _, span := trace.StartSpan(ctx, "attestationutil.IsValidAttestationIndices") defer span.End() - if indexedAttestation == nil || indexedAttestation.Data == nil || indexedAttestation.Data.Target == nil || indexedAttestation.AttestingIndices == nil { + if indexedAttestation == nil || + indexedAttestation.GetData() == nil || + indexedAttestation.GetData().Target == nil || + indexedAttestation.GetAttestingIndices() == nil { return errors.New("nil or missing indexed attestation data") } - indices := indexedAttestation.AttestingIndices + indices := indexedAttestation.GetAttestingIndices() if len(indices) == 0 { return errors.New("expected non-empty attesting indices") } diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.go b/proto/prysm/v1alpha1/beacon_chain.pb.go index 0261708da029..b753957c7c6a 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.go @@ -554,6 +554,8 @@ type BeaconBlockContainer struct { // *BeaconBlockContainer_BlindedCapellaBlock // *BeaconBlockContainer_DenebBlock // *BeaconBlockContainer_BlindedDenebBlock + // *BeaconBlockContainer_ElectraBlock + // *BeaconBlockContainer_BlindedElectraBlock Block isBeaconBlockContainer_Block `protobuf_oneof:"block"` } @@ -666,6 +668,20 @@ func (x *BeaconBlockContainer) GetBlindedDenebBlock() *SignedBlindedBeaconBlockD return nil } +func (x *BeaconBlockContainer) GetElectraBlock() *SignedBeaconBlockElectra { + if x, ok := x.GetBlock().(*BeaconBlockContainer_ElectraBlock); ok { + return x.ElectraBlock + } + return nil +} + +func (x *BeaconBlockContainer) GetBlindedElectraBlock() *SignedBlindedBeaconBlockElectra { + if x, ok := x.GetBlock().(*BeaconBlockContainer_BlindedElectraBlock); ok { + return x.BlindedElectraBlock + } + return nil +} + type isBeaconBlockContainer_Block interface { isBeaconBlockContainer_Block() } @@ -702,6 +718,14 @@ type BeaconBlockContainer_BlindedDenebBlock struct { BlindedDenebBlock *SignedBlindedBeaconBlockDeneb `protobuf:"bytes,10,opt,name=blinded_deneb_block,json=blindedDenebBlock,proto3,oneof"` } +type BeaconBlockContainer_ElectraBlock struct { + ElectraBlock *SignedBeaconBlockElectra `protobuf:"bytes,11,opt,name=electra_block,json=electraBlock,proto3,oneof"` +} + +type BeaconBlockContainer_BlindedElectraBlock struct { + BlindedElectraBlock *SignedBlindedBeaconBlockElectra `protobuf:"bytes,12,opt,name=blinded_electra_block,json=blindedElectraBlock,proto3,oneof"` +} + func (*BeaconBlockContainer_Phase0Block) isBeaconBlockContainer_Block() {} func (*BeaconBlockContainer_AltairBlock) isBeaconBlockContainer_Block() {} @@ -718,6 +742,10 @@ func (*BeaconBlockContainer_DenebBlock) isBeaconBlockContainer_Block() {} func (*BeaconBlockContainer_BlindedDenebBlock) isBeaconBlockContainer_Block() {} +func (*BeaconBlockContainer_ElectraBlock) isBeaconBlockContainer_Block() {} + +func (*BeaconBlockContainer_BlindedElectraBlock) isBeaconBlockContainer_Block() {} + type ChainHead struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3174,7 +3202,7 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xd2, 0x06, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x98, 0x08, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1c, @@ -3227,408 +3255,146 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xb2, 0x09, 0x0a, 0x09, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, 0x62, 0x0a, 0x09, 0x68, 0x65, 0x61, - 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x65, 0x0a, - 0x0a, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x09, 0x68, 0x65, 0x61, 0x64, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x6c, - 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, - 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, - 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x6a, - 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, - 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x7d, 0x0a, 0x17, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, - 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, + 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6c, 0x0a, 0x15, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x22, 0xb2, 0x09, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, + 0x62, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x53, + 0x6c, 0x6f, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x49, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, - 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, - 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xef, 0x04, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x8d, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x7c, 0x0a, 0x11, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x67, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x73, 0x1a, 0x75, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfc, 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, - 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, 0x03, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x5c, 0x0a, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, - 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x4c, 0x0a, 0x08, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, - 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, - 0x1a, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0a, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, + 0x09, 0x68, 0x65, 0x61, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, + 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x83, 0x03, 0x0a, - 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, - 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x22, 0xb7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x48, - 0x00, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x0e, 0x0a, 0x0c, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xcc, 0x03, 0x0a, - 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, + 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x5b, 0x0a, 0x0e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, - 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xbb, 0x01, - 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3e, 0x0a, 0x09, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x23, - 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, - 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0xc4, 0x06, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x13, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, - 0x12, 0x7c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x36, - 0x0a, 0x12, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x10, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x76, 0x0a, 0x0e, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, - 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x0d, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, - 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, - 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x65, 0x6a, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, - 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x09, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, - 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, - 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, - 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, - 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xc6, 0x06, 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x18, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x70, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x63, 0x68, 0x52, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x7d, 0x0a, 0x17, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, + 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x18, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, + 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x78, 0x0a, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x12, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, - 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, - 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, - 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, - 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x08, 0x52, 0x12, 0x63, 0x6f, 0x72, - 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x12, - 0x47, 0x0a, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x62, 0x65, 0x66, 0x6f, - 0x72, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x52, 0x1d, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x1f, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x1c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2d, 0x0a, 0x12, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x11, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, - 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x1d, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, - 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, - 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x04, 0x52, 0x10, 0x69, - 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, - 0xc9, 0x03, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, - 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x72, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x72, 0x6e, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, - 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x34, 0x0a, 0x10, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, 0x0e, 0x65, 0x78, 0x69, - 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x1c, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, - 0x85, 0x01, 0x0a, 0x16, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, - 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x49, + 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x1a, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xef, 0x04, 0x0a, + 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xff, 0x02, 0x0a, 0x1f, - 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, - 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x8d, + 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x7c, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x67, + 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x55, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x1a, 0x75, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfc, + 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, @@ -3650,415 +3416,689 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, - 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xab, 0x07, - 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x12, 0x61, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, - 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x8a, - 0x05, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, - 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x7c, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x10, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, - 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, 0x03, + 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x18, 0x01, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x20, - 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, - 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x4c, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x83, 0x03, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, + 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xb7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x67, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x3a, 0x02, 0x18, 0x01, - 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x22, 0xf5, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, - 0x53, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x54, 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, - 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, - 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x34, 0x38, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x22, 0xcc, 0x03, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x5b, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, + 0x69, 0x7a, 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xc4, 0x06, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, + 0x38, 0x52, 0x13, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x7c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x12, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x10, 0x65, 0x78, 0x69, 0x74, + 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x76, 0x0a, 0x0e, + 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, + 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, + 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, + 0x11, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x65, 0x6a, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, + 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, - 0x63, 0x65, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, - 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, - 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, - 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xc6, 0x06, 0x0a, + 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, + 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x04, 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x70, 0x0a, 0x0f, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0e, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x78, 0x0a, + 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, + 0x74, 0x18, 0x01, 0x52, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, + 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, + 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, + 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, + 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, + 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, + 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x08, 0x52, 0x12, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x52, + 0x1d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, + 0x0a, 0x1f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x04, 0x52, 0x1c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x11, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x1d, + 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, + 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0xc9, 0x03, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x72, + 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, + 0x68, 0x75, 0x72, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x16, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, + 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x34, 0x0a, 0x10, 0x65, + 0x78, 0x69, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, + 0x01, 0x52, 0x0e, 0x65, 0x78, 0x69, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x73, 0x12, 0x91, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x16, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x02, 0x18, + 0x01, 0x22, 0xff, 0x02, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, + 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, + 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, + 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, - 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9f, 0x0a, 0x0a, 0x16, 0x49, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x10, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, - 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, - 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x0f, 0x69, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x9b, 0x09, 0x0a, - 0x0e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x12, - 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, - 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, + 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0xab, 0x07, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, + 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x61, 0x0a, 0x0b, 0x61, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, + 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x8a, 0x05, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x7c, 0x0a, 0x11, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, + 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, + 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x27, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x18, 0x01, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x1c, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x49, - 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3a, 0x0a, - 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x16, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x1b, 0x69, 0x73, 0x5f, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, - 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x39, 0x0a, 0x19, 0x69, 0x73, 0x5f, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, - 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, - 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, - 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x21, 0x69, 0x73, 0x5f, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x1d, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x69, 0x73, 0x50, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x24, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x6e, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, - 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xf5, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x53, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x54, + 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x49, 0x6e, + 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x11, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, - 0x6f, 0x72, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x69, 0x6e, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x32, 0xa3, 0x16, 0x0a, 0x0b, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9f, + 0x0a, 0x0a, 0x16, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x10, 0x69, 0x6e, 0x64, + 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, + 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, + 0x65, 0x52, 0x0f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x1a, 0x9b, 0x09, 0x0a, 0x0e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, + 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x73, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x69, 0x73, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x20, 0x69, + 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, + 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x3c, 0x0a, 0x1b, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x39, 0x0a, + 0x19, 0x69, 0x73, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x16, 0x69, 0x73, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x48, 0x0a, + 0x21, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, + 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x69, 0x73, 0x5f, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x1b, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4e, 0x0a, + 0x24, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x6e, 0x0a, + 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0d, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, + 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, + 0x18, 0x01, 0x52, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0f, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, + 0x32, 0xa3, 0x16, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x12, 0x9e, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, 0xa0, 0x01, 0x0a, 0x0f, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, + 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x92, 0x01, 0x0a, - 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x12, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, - 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x22, 0x29, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x68, - 0x65, 0x61, 0x64, 0x88, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, - 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, - 0xa1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, - 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, + 0xa0, 0x01, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x6f, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, + 0x6f, 0x6c, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, + 0x64, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x68, 0x65, 0x61, 0x64, 0x88, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, + 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x22, 0x27, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, - 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, - 0x17, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xb6, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, - 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x31, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x29, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x65, 0x74, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x12, 0x7a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x12, 0xb0, 0x01, - 0x0a, 0x17, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, - 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x0e, 0x4c, 0x69, + 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, + 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1f, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xb6, + 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, + 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x65, 0x74, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x7a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x71, 0x75, + 0x65, 0x75, 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0xad, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, + 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, - 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0xad, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0xbe, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x02, 0x01, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, + 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0xa8, 0x01, 0x0a, + 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x02, - 0x01, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, + 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, + 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, + 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, - 0x74, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, - 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, - 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x64, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, - 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, - 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, - 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4123,11 +4163,13 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_goTypes = []interface{}{ (*SignedBlindedBeaconBlockCapella)(nil), // 45: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella (*SignedBeaconBlockDeneb)(nil), // 46: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb (*SignedBlindedBeaconBlockDeneb)(nil), // 47: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - (*ValidatorParticipation)(nil), // 48: ethereum.eth.v1alpha1.ValidatorParticipation - (*Validator)(nil), // 49: ethereum.eth.v1alpha1.Validator - (*emptypb.Empty)(nil), // 50: google.protobuf.Empty - (*AttesterSlashing)(nil), // 51: ethereum.eth.v1alpha1.AttesterSlashing - (*ProposerSlashing)(nil), // 52: ethereum.eth.v1alpha1.ProposerSlashing + (*SignedBeaconBlockElectra)(nil), // 48: ethereum.eth.v1alpha1.SignedBeaconBlockElectra + (*SignedBlindedBeaconBlockElectra)(nil), // 49: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + (*ValidatorParticipation)(nil), // 50: ethereum.eth.v1alpha1.ValidatorParticipation + (*Validator)(nil), // 51: ethereum.eth.v1alpha1.Validator + (*emptypb.Empty)(nil), // 52: google.protobuf.Empty + (*AttesterSlashing)(nil), // 53: ethereum.eth.v1alpha1.AttesterSlashing + (*ProposerSlashing)(nil), // 54: ethereum.eth.v1alpha1.ProposerSlashing } var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 38, // 0: ethereum.eth.v1alpha1.ListAttestationsResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation @@ -4141,58 +4183,60 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 45, // 8: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_capella_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella 46, // 9: ethereum.eth.v1alpha1.BeaconBlockContainer.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb 47, // 10: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - 32, // 11: ethereum.eth.v1alpha1.BeaconCommittees.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry - 33, // 12: ethereum.eth.v1alpha1.ValidatorBalances.balances:type_name -> ethereum.eth.v1alpha1.ValidatorBalances.Balance - 34, // 13: ethereum.eth.v1alpha1.Validators.validator_list:type_name -> ethereum.eth.v1alpha1.Validators.ValidatorContainer - 35, // 14: ethereum.eth.v1alpha1.ValidatorAssignments.assignments:type_name -> ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment - 48, // 15: ethereum.eth.v1alpha1.ValidatorParticipationResponse.participation:type_name -> ethereum.eth.v1alpha1.ValidatorParticipation - 38, // 16: ethereum.eth.v1alpha1.AttestationPoolResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 36, // 17: ethereum.eth.v1alpha1.BeaconConfig.config:type_name -> ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry - 37, // 18: ethereum.eth.v1alpha1.IndividualVotesRespond.individual_votes:type_name -> ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote - 30, // 19: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem - 31, // 20: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry.value:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList - 49, // 21: ethereum.eth.v1alpha1.Validators.ValidatorContainer.validator:type_name -> ethereum.eth.v1alpha1.Validator - 1, // 22: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest - 0, // 23: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest - 24, // 24: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest - 4, // 25: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest - 50, // 26: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty - 8, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest - 10, // 28: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest - 12, // 29: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest - 13, // 30: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest - 15, // 31: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest - 50, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty - 17, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest - 20, // 34: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest - 22, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest - 50, // 36: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty - 51, // 37: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing - 52, // 38: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing - 28, // 39: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:input_type -> ethereum.eth.v1alpha1.IndividualVotesRequest - 2, // 40: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:output_type -> ethereum.eth.v1alpha1.ListAttestationsResponse - 3, // 41: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse - 25, // 42: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse - 5, // 43: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse - 7, // 44: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead - 9, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees - 11, // 46: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances - 14, // 47: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators - 49, // 48: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator - 16, // 49: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges - 19, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue - 18, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse - 21, // 52: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments - 23, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse - 26, // 54: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig - 27, // 55: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse - 27, // 56: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse - 29, // 57: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:output_type -> ethereum.eth.v1alpha1.IndividualVotesRespond - 40, // [40:58] is the sub-list for method output_type - 22, // [22:40] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 48, // 11: ethereum.eth.v1alpha1.BeaconBlockContainer.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra + 49, // 12: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_electra_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + 32, // 13: ethereum.eth.v1alpha1.BeaconCommittees.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry + 33, // 14: ethereum.eth.v1alpha1.ValidatorBalances.balances:type_name -> ethereum.eth.v1alpha1.ValidatorBalances.Balance + 34, // 15: ethereum.eth.v1alpha1.Validators.validator_list:type_name -> ethereum.eth.v1alpha1.Validators.ValidatorContainer + 35, // 16: ethereum.eth.v1alpha1.ValidatorAssignments.assignments:type_name -> ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment + 50, // 17: ethereum.eth.v1alpha1.ValidatorParticipationResponse.participation:type_name -> ethereum.eth.v1alpha1.ValidatorParticipation + 38, // 18: ethereum.eth.v1alpha1.AttestationPoolResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 36, // 19: ethereum.eth.v1alpha1.BeaconConfig.config:type_name -> ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry + 37, // 20: ethereum.eth.v1alpha1.IndividualVotesRespond.individual_votes:type_name -> ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote + 30, // 21: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem + 31, // 22: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry.value:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList + 51, // 23: ethereum.eth.v1alpha1.Validators.ValidatorContainer.validator:type_name -> ethereum.eth.v1alpha1.Validator + 1, // 24: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest + 0, // 25: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest + 24, // 26: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest + 4, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest + 52, // 28: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty + 8, // 29: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest + 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest + 12, // 31: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest + 13, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest + 15, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest + 52, // 34: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty + 17, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest + 20, // 36: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest + 22, // 37: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest + 52, // 38: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty + 53, // 39: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing + 54, // 40: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing + 28, // 41: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:input_type -> ethereum.eth.v1alpha1.IndividualVotesRequest + 2, // 42: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:output_type -> ethereum.eth.v1alpha1.ListAttestationsResponse + 3, // 43: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse + 25, // 44: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse + 5, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse + 7, // 46: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead + 9, // 47: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees + 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances + 14, // 49: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators + 51, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator + 16, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges + 19, // 52: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue + 18, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse + 21, // 54: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments + 23, // 55: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse + 26, // 56: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig + 27, // 57: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 27, // 58: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 29, // 59: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:output_type -> ethereum.eth.v1alpha1.IndividualVotesRespond + 42, // [42:60] is the sub-list for method output_type + 24, // [24:42] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_chain_proto_init() } @@ -4660,6 +4704,8 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { (*BeaconBlockContainer_BlindedCapellaBlock)(nil), (*BeaconBlockContainer_DenebBlock)(nil), (*BeaconBlockContainer_BlindedDenebBlock)(nil), + (*BeaconBlockContainer_ElectraBlock)(nil), + (*BeaconBlockContainer_BlindedElectraBlock)(nil), } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8].OneofWrappers = []interface{}{ (*ListCommitteesRequest_Epoch)(nil), diff --git a/proto/prysm/v1alpha1/beacon_chain.proto b/proto/prysm/v1alpha1/beacon_chain.proto index 04101d192836..0201e4c4cfa3 100644 --- a/proto/prysm/v1alpha1/beacon_chain.proto +++ b/proto/prysm/v1alpha1/beacon_chain.proto @@ -338,27 +338,35 @@ message BeaconBlockContainer { // The desired block to be returned. oneof block { - // Representing a phase 0 block. + // Representing a Phase0 block. SignedBeaconBlock phase0_block = 3; - // Representing an altair block. + // Representing an Altair block. SignedBeaconBlockAltair altair_block = 4; - // Representing a bellatrix block. + // Representing a Bellatrix block. SignedBeaconBlockBellatrix bellatrix_block = 5; - // Representing a blinded bellatrix block. + // Representing a blinded Bellatrix block. SignedBlindedBeaconBlockBellatrix blinded_bellatrix_block = 6; - // Representing a capella block. + // Representing a Capella block. SignedBeaconBlockCapella capella_block = 7; - // Representing a blinded capella block. + // Representing a blinded Capella block. SignedBlindedBeaconBlockCapella blinded_capella_block = 8; + // Representing a Deneb block. SignedBeaconBlockDeneb deneb_block = 9; + // Representing a blinded Deneb block. SignedBlindedBeaconBlockDeneb blinded_deneb_block = 10; + + // Representing an Electra block. + SignedBeaconBlockElectra electra_block = 11; + + // Representing a blinded Electra block. + SignedBlindedBeaconBlockElectra blinded_electra_block = 12; } } diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index 3bc5fc7a64b6..707521ef8345 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: f5dca4cd73e0ede007a079469da9c22998b793f769c4ce4da279ac910c6fd9b2 +// Hash: ae92821338b1fc2296cda7b35445bbd7005303c62eab0bcef3ef9c4c7cf0b9ef package eth import ( diff --git a/proto/prysm/v1alpha1/slashings/surround_votes.go b/proto/prysm/v1alpha1/slashings/surround_votes.go index d3415550f99a..1ea477199454 100644 --- a/proto/prysm/v1alpha1/slashings/surround_votes.go +++ b/proto/prysm/v1alpha1/slashings/surround_votes.go @@ -10,6 +10,6 @@ import ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" // t: target // // a surrounds b if: s_a < s_b and t_b < t_a -func IsSurround(a, b *ethpb.IndexedAttestation) bool { - return a.Data.Source.Epoch < b.Data.Source.Epoch && b.Data.Target.Epoch < a.Data.Target.Epoch +func IsSurround(a, b ethpb.IndexedAtt) bool { + return a.GetData().Source.Epoch < b.GetData().Source.Epoch && b.GetData().Target.Epoch < a.GetData().Target.Epoch } diff --git a/proto/prysm/v1alpha1/validator.proto b/proto/prysm/v1alpha1/validator.proto index 80e5e1eb7441..ac942559c1b0 100644 --- a/proto/prysm/v1alpha1/validator.proto +++ b/proto/prysm/v1alpha1/validator.proto @@ -188,7 +188,6 @@ service BeaconNodeValidator { }; } - // Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root. // the beacon node responses with an aggregate and proof object back to validator to sign over. rpc SubmitAggregateSelectionProof(AggregateSelectionRequest) returns (AggregateSelectionResponse) { diff --git a/runtime/version/fork.go b/runtime/version/fork.go index d9e9b3811d1d..902393c8bc80 100644 --- a/runtime/version/fork.go +++ b/runtime/version/fork.go @@ -8,6 +8,7 @@ const ( Bellatrix Capella Deneb + Electra ) var versionToString = map[int]string{ @@ -16,6 +17,7 @@ var versionToString = map[int]string{ Bellatrix: "bellatrix", Capella: "capella", Deneb: "deneb", + Electra: "electra", } // stringToVersion and allVersions are populated in init() diff --git a/testing/slasher/simulator/BUILD.bazel b/testing/slasher/simulator/BUILD.bazel index d8dccd2d376a..6f904214877c 100644 --- a/testing/slasher/simulator/BUILD.bazel +++ b/testing/slasher/simulator/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/sync:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/rand:go_default_library", diff --git a/testing/slasher/simulator/simulator.go b/testing/slasher/simulator/simulator.go index d0fced31b2f1..d8825701e2e4 100644 --- a/testing/slasher/simulator/simulator.go +++ b/testing/slasher/simulator/simulator.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -237,7 +238,7 @@ func (s *Simulator) verifySlashingsWereDetected(ctx context.Context) { ctx, nil, true, /* no limit */ ) detectedProposerSlashings := make(map[[32]byte]*ethpb.ProposerSlashing) - detectedAttesterSlashings := make(map[[32]byte]*ethpb.AttesterSlashing) + detectedAttesterSlashings := make(map[[32]byte]interfaces.AttesterSlashing) for _, slashing := range poolProposerSlashings { slashingRoot, err := slashing.HashTreeRoot() if err != nil { diff --git a/testing/spectest/shared/altair/epoch_processing/BUILD.bazel b/testing/spectest/shared/altair/epoch_processing/BUILD.bazel index 280be166efc0..d566fdbd43af 100644 --- a/testing/spectest/shared/altair/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/altair/epoch_processing/BUILD.bazel @@ -32,8 +32,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/epoch_processing/helpers.go b/testing/spectest/shared/altair/epoch_processing/helpers.go index da522bc0f41f..2c5fcb585c76 100644 --- a/testing/spectest/shared/altair/epoch_processing/helpers.go +++ b/testing/spectest/shared/altair/epoch_processing/helpers.go @@ -8,13 +8,14 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) @@ -62,8 +63,7 @@ func RunEpochOperationTest( pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/operations/BUILD.bazel b/testing/spectest/shared/altair/operations/BUILD.bazel index 143e93cd5dc9..a668f22b8e56 100644 --- a/testing/spectest/shared/altair/operations/BUILD.bazel +++ b/testing/spectest/shared/altair/operations/BUILD.bazel @@ -29,8 +29,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/operations/block_header.go b/testing/spectest/shared/altair/operations/block_header.go index ec9f7879a2bf..103b6e33d3aa 100644 --- a/testing/spectest/shared/altair/operations/block_header.go +++ b/testing/spectest/shared/altair/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunBlockHeaderTest(t *testing.T, config string) { @@ -72,8 +73,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/operations/helpers.go b/testing/spectest/shared/altair/operations/helpers.go index 2b9b07d38ca4..188eb237e3b8 100644 --- a/testing/spectest/shared/altair/operations/helpers.go +++ b/testing/spectest/shared/altair/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/sanity/BUILD.bazel b/testing/spectest/shared/altair/sanity/BUILD.bazel index d9588ac039e5..af8b85ac6ca0 100644 --- a/testing/spectest/shared/altair/sanity/BUILD.bazel +++ b/testing/spectest/shared/altair/sanity/BUILD.bazel @@ -20,10 +20,10 @@ go_library( "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", - "@com_github_d4l3k_messagediff//:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/sanity/block_processing.go b/testing/spectest/shared/altair/sanity/block_processing.go index 4d30d2b9bf6a..07e130c8bd5b 100644 --- a/testing/spectest/shared/altair/sanity/block_processing.go +++ b/testing/spectest/shared/altair/sanity/block_processing.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/d4l3k/messagediff" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -21,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/sanity/slot_processing.go b/testing/spectest/shared/altair/sanity/slot_processing.go index 3c68fdcf790d..f1b6edb4f133 100644 --- a/testing/spectest/shared/altair/sanity/slot_processing.go +++ b/testing/spectest/shared/altair/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -58,8 +59,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateAltair(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel b/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel index b6a93b60fe5f..03ac47eaec86 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel @@ -32,8 +32,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/epoch_processing/helpers.go b/testing/spectest/shared/bellatrix/epoch_processing/helpers.go index e24421c70331..4255c168a52f 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/helpers.go +++ b/testing/spectest/shared/bellatrix/epoch_processing/helpers.go @@ -8,13 +8,14 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) @@ -62,8 +63,7 @@ func RunEpochOperationTest( pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/operations/BUILD.bazel b/testing/spectest/shared/bellatrix/operations/BUILD.bazel index 69a47d70df67..3e5b2027dc0c 100644 --- a/testing/spectest/shared/bellatrix/operations/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/operations/BUILD.bazel @@ -30,8 +30,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/operations/block_header.go b/testing/spectest/shared/bellatrix/operations/block_header.go index 6eb7c747c9cf..51d911bedabb 100644 --- a/testing/spectest/shared/bellatrix/operations/block_header.go +++ b/testing/spectest/shared/bellatrix/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunBlockHeaderTest(t *testing.T, config string) { @@ -72,8 +73,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/operations/execution_payload.go b/testing/spectest/shared/bellatrix/operations/execution_payload.go index 68c42edb8d01..233e57175752 100644 --- a/testing/spectest/shared/bellatrix/operations/execution_payload.go +++ b/testing/spectest/shared/bellatrix/operations/execution_payload.go @@ -8,6 +8,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunExecutionPayloadTest(t *testing.T, config string) { @@ -76,8 +77,7 @@ func RunExecutionPayloadTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(gotState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(gotState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else if config.Valid { diff --git a/testing/spectest/shared/bellatrix/operations/helpers.go b/testing/spectest/shared/bellatrix/operations/helpers.go index 85e0197109b8..c234c6d0f7e9 100644 --- a/testing/spectest/shared/bellatrix/operations/helpers.go +++ b/testing/spectest/shared/bellatrix/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/sanity/BUILD.bazel b/testing/spectest/shared/bellatrix/sanity/BUILD.bazel index 7e1a24dab44a..db8a5d07dc08 100644 --- a/testing/spectest/shared/bellatrix/sanity/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/sanity/BUILD.bazel @@ -20,10 +20,10 @@ go_library( "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", - "@com_github_d4l3k_messagediff//:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/sanity/block_processing.go b/testing/spectest/shared/bellatrix/sanity/block_processing.go index ce17d70cbb8a..c3bcac59013a 100644 --- a/testing/spectest/shared/bellatrix/sanity/block_processing.go +++ b/testing/spectest/shared/bellatrix/sanity/block_processing.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/d4l3k/messagediff" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -21,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/sanity/slot_processing.go b/testing/spectest/shared/bellatrix/sanity/slot_processing.go index c9e87045ecca..97806a03f74c 100644 --- a/testing/spectest/shared/bellatrix/sanity/slot_processing.go +++ b/testing/spectest/shared/bellatrix/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -57,8 +58,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/spectest/shared/capella/epoch_processing/BUILD.bazel b/testing/spectest/shared/capella/epoch_processing/BUILD.bazel index 10d8d45c0106..9fd12223eb3e 100644 --- a/testing/spectest/shared/capella/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/capella/epoch_processing/BUILD.bazel @@ -32,8 +32,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/epoch_processing/helpers.go b/testing/spectest/shared/capella/epoch_processing/helpers.go index 92df9f8b940c..1aa188d3214c 100644 --- a/testing/spectest/shared/capella/epoch_processing/helpers.go +++ b/testing/spectest/shared/capella/epoch_processing/helpers.go @@ -8,13 +8,14 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) @@ -62,8 +63,7 @@ func RunEpochOperationTest( pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/operations/BUILD.bazel b/testing/spectest/shared/capella/operations/BUILD.bazel index bd6194f9b9f7..f3c6b5fbe260 100644 --- a/testing/spectest/shared/capella/operations/BUILD.bazel +++ b/testing/spectest/shared/capella/operations/BUILD.bazel @@ -33,9 +33,10 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/operations/block_header.go b/testing/spectest/shared/capella/operations/block_header.go index d2144d0da148..1ca2ff80d6da 100644 --- a/testing/spectest/shared/capella/operations/block_header.go +++ b/testing/spectest/shared/capella/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunBlockHeaderTest(t *testing.T, config string) { @@ -72,8 +73,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/operations/helpers.go b/testing/spectest/shared/capella/operations/helpers.go index 95065a843bcf..918fd6c86b57 100644 --- a/testing/spectest/shared/capella/operations/helpers.go +++ b/testing/spectest/shared/capella/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/sanity/BUILD.bazel b/testing/spectest/shared/capella/sanity/BUILD.bazel index cb15f84ededa..c0d1ecd87490 100644 --- a/testing/spectest/shared/capella/sanity/BUILD.bazel +++ b/testing/spectest/shared/capella/sanity/BUILD.bazel @@ -21,8 +21,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/sanity/block_processing.go b/testing/spectest/shared/capella/sanity/block_processing.go index ebc7fa5f24db..f7b490e0af39 100644 --- a/testing/spectest/shared/capella/sanity/block_processing.go +++ b/testing/spectest/shared/capella/sanity/block_processing.go @@ -10,6 +10,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -20,7 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(pbState, postBeaconState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/sanity/slot_processing.go b/testing/spectest/shared/capella/sanity/slot_processing.go index 179491515bc6..862b584a4c58 100644 --- a/testing/spectest/shared/capella/sanity/slot_processing.go +++ b/testing/spectest/shared/capella/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -57,8 +58,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateCapella(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/spectest/shared/common/forkchoice/builder.go b/testing/spectest/shared/common/forkchoice/builder.go index 8807bb4cae11..d354df5af075 100644 --- a/testing/spectest/shared/common/forkchoice/builder.go +++ b/testing/spectest/shared/common/forkchoice/builder.go @@ -126,7 +126,7 @@ func (bb *Builder) Attestation(t testing.TB, a *ethpb.Attestation) { // AttesterSlashing receives an attester slashing and feeds it to forkchoice. func (bb *Builder) AttesterSlashing(s *ethpb.AttesterSlashing) { - slashings := []*ethpb.AttesterSlashing{s} + slashings := []interfaces.AttesterSlashing{s} bb.service.InsertSlashingsToForkChoiceStore(context.TODO(), slashings) } diff --git a/testing/spectest/shared/deneb/fork/BUILD.bazel b/testing/spectest/shared/deneb/fork/BUILD.bazel index d740c3a62af6..f90f24925403 100644 --- a/testing/spectest/shared/deneb/fork/BUILD.bazel +++ b/testing/spectest/shared/deneb/fork/BUILD.bazel @@ -22,6 +22,8 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go b/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go index d5ef95cd4b8f..ccd0af5d538b 100644 --- a/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go +++ b/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/deneb" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -13,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) // RunUpgradeToDeneb is a helper function that runs Deneb's fork spec tests. @@ -51,8 +53,7 @@ func RunUpgradeToDeneb(t *testing.T, config string) { } if !proto.Equal(postStateFromFile, postStateFromFunction) { - t.Log(postStateFromFile.LatestExecutionPayloadHeader) - t.Log(postStateFromFunction.LatestExecutionPayloadHeader) + t.Log(cmp.Diff(postStateFromFile, postStateFromFunction, protocmp.Transform())) t.Fatal("Post state does not match expected") } }) diff --git a/testing/spectest/shared/phase0/finality/BUILD.bazel b/testing/spectest/shared/phase0/finality/BUILD.bazel index eb3ec6a5f20e..15a2673522e1 100644 --- a/testing/spectest/shared/phase0/finality/BUILD.bazel +++ b/testing/spectest/shared/phase0/finality/BUILD.bazel @@ -17,7 +17,8 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/finality/runner.go b/testing/spectest/shared/phase0/finality/runner.go index af7072a896a4..16fdac7bf78c 100644 --- a/testing/spectest/shared/phase0/finality/runner.go +++ b/testing/spectest/shared/phase0/finality/runner.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -16,7 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -80,8 +81,7 @@ func RunFinalityTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } }) diff --git a/testing/spectest/shared/phase0/operations/BUILD.bazel b/testing/spectest/shared/phase0/operations/BUILD.bazel index 97c7e9c29418..fd66fea0f82c 100644 --- a/testing/spectest/shared/phase0/operations/BUILD.bazel +++ b/testing/spectest/shared/phase0/operations/BUILD.bazel @@ -27,9 +27,10 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/operations/block_header.go b/testing/spectest/shared/phase0/operations/block_header.go index 64a559206166..0e95a5b66ca7 100644 --- a/testing/spectest/shared/phase0/operations/block_header.go +++ b/testing/spectest/shared/phase0/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) // RunBlockHeaderTest executes "operations/block_header" tests. @@ -74,8 +75,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/phase0/operations/helpers.go b/testing/spectest/shared/phase0/operations/helpers.go index ae7621889473..419dbbb32e9d 100644 --- a/testing/spectest/shared/phase0/operations/helpers.go +++ b/testing/spectest/shared/phase0/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/phase0/sanity/BUILD.bazel b/testing/spectest/shared/phase0/sanity/BUILD.bazel index f79f77db81dd..bf7f29d7888b 100644 --- a/testing/spectest/shared/phase0/sanity/BUILD.bazel +++ b/testing/spectest/shared/phase0/sanity/BUILD.bazel @@ -21,8 +21,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/sanity/block_processing.go b/testing/spectest/shared/phase0/sanity/block_processing.go index b0eabad62549..8acf5344426f 100644 --- a/testing/spectest/shared/phase0/sanity/block_processing.go +++ b/testing/spectest/shared/phase0/sanity/block_processing.go @@ -10,6 +10,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -20,7 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/phase0/sanity/slot_processing.go b/testing/spectest/shared/phase0/sanity/slot_processing.go index cca9e316c768..4332e42f6da8 100644 --- a/testing/spectest/shared/phase0/sanity/slot_processing.go +++ b/testing/spectest/shared/phase0/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -57,8 +58,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStatePhase0(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/validator-mock/node_client_mock.go b/testing/validator-mock/node_client_mock.go index 8f6250cd86e3..337b8e22465e 100644 --- a/testing/validator-mock/node_client_mock.go +++ b/testing/validator-mock/node_client_mock.go @@ -21,8 +21,8 @@ import ( // MockNodeClient is a mock of NodeClient interface. type MockNodeClient struct { - ctrl *gomock.Controller - recorder *MockNodeClientMockRecorder + ctrl *gomock.Controller + recorder *MockNodeClientMockRecorder healthTracker *beacon.NodeHealthTracker } diff --git a/validator/client/beacon-api/mock/json_rest_handler_mock.go b/validator/client/beacon-api/mock/json_rest_handler_mock.go index ca58f39d22da..b79df47828b9 100644 --- a/validator/client/beacon-api/mock/json_rest_handler_mock.go +++ b/validator/client/beacon-api/mock/json_rest_handler_mock.go @@ -76,4 +76,3 @@ func (mr *MockJsonRestHandlerMockRecorder) Post(ctx, endpoint, headers, data, re mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Post", reflect.TypeOf((*MockJsonRestHandler)(nil).Post), ctx, endpoint, headers, data, resp) } - From 625818d556cee7105930c588fe7336ddd50f5987 Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 2 May 2024 09:18:23 -0700 Subject: [PATCH 064/325] EIP6110: add validator index cache (#13943) * EIP6110: add validator index cache * Add tests * Radek's feedback --- beacon-chain/state/interfaces.go | 1 + beacon-chain/state/state-native/BUILD.bazel | 2 + .../state-native/beacon_state_mainnet.go | 1 + .../state-native/beacon_state_minimal.go | 1 + .../state/state-native/getters_validator.go | 4 + .../state/state-native/readonly_validator.go | 5 + .../state/state-native/setters_misc.go | 13 +++ beacon-chain/state/state-native/state_trie.go | 3 +- .../state-native/validator_index_cache.go | 96 ++++++++++++++++ .../validator_index_cache_test.go | 105 ++++++++++++++++++ config/features/config.go | 10 +- config/features/flags.go | 6 + 12 files changed, 244 insertions(+), 3 deletions(-) create mode 100644 beacon-chain/state/state-native/validator_index_cache.go create mode 100644 beacon-chain/state/state-native/validator_index_cache_test.go diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 0a6a92a27772..ff827758ae59 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -100,6 +100,7 @@ type WriteOnlyBeaconState interface { SetLatestExecutionPayloadHeader(payload interfaces.ExecutionData) error SetNextWithdrawalIndex(i uint64) error SetNextWithdrawalValidatorIndex(i primitives.ValidatorIndex) error + SaveValidatorIndices() } // ReadOnlyValidator defines a struct which only has read access to validator methods. diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 41f9f60c6441..4cfa724f4beb 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -37,6 +37,7 @@ go_library( "ssz.go", "state_trie.go", "types.go", + "validator_index_cache.go", ] + select({ "//config:mainnet": ["beacon_state_mainnet.go"], "//config:minimal": ["beacon_state_minimal.go"], @@ -102,6 +103,7 @@ go_test( "state_test.go", "state_trie_test.go", "types_test.go", + "validator_index_cache_test.go", ], data = glob(["testdata/**"]), embed = [":go_default_library"], diff --git a/beacon-chain/state/state-native/beacon_state_mainnet.go b/beacon-chain/state/state-native/beacon_state_mainnet.go index 95eff14bf1fc..dc46a233d3f5 100644 --- a/beacon-chain/state/state-native/beacon_state_mainnet.go +++ b/beacon-chain/state/state-native/beacon_state_mainnet.go @@ -67,6 +67,7 @@ type BeaconState struct { stateFieldLeaves map[types.FieldIndex]*fieldtrie.FieldTrie rebuildTrie map[types.FieldIndex]bool valMapHandler *stateutil.ValidatorMapHandler + validatorIndexCache *finalizedValidatorIndexCache merkleLayers [][][]byte sharedFieldReferences map[types.FieldIndex]*stateutil.Reference } diff --git a/beacon-chain/state/state-native/beacon_state_minimal.go b/beacon-chain/state/state-native/beacon_state_minimal.go index efddb8d5688e..f7d7c6fe8f06 100644 --- a/beacon-chain/state/state-native/beacon_state_minimal.go +++ b/beacon-chain/state/state-native/beacon_state_minimal.go @@ -67,6 +67,7 @@ type BeaconState struct { stateFieldLeaves map[types.FieldIndex]*fieldtrie.FieldTrie rebuildTrie map[types.FieldIndex]bool valMapHandler *stateutil.ValidatorMapHandler + validatorIndexCache *finalizedValidatorIndexCache merkleLayers [][][]byte sharedFieldReferences map[types.FieldIndex]*stateutil.Reference } diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index 979a8d9163c6..940e85975ab1 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -178,6 +178,10 @@ func (b *BeaconState) ValidatorIndexByPubkey(key [fieldparams.BLSPubkeyLength]by b.lock.RLock() defer b.lock.RUnlock() + if features.Get().EIP6110ValidatorIndexCache { + return b.getValidatorIndex(key) + } + var numOfVals int if features.Get().EnableExperimentalState { numOfVals = b.validatorsMultiValue.Len(b) diff --git a/beacon-chain/state/state-native/readonly_validator.go b/beacon-chain/state/state-native/readonly_validator.go index 946cad4c7102..6eb2d923d76a 100644 --- a/beacon-chain/state/state-native/readonly_validator.go +++ b/beacon-chain/state/state-native/readonly_validator.go @@ -70,6 +70,11 @@ func (v readOnlyValidator) PublicKey() [fieldparams.BLSPubkeyLength]byte { return pubkey } +// publicKeySlice returns the public key in the slice form for the read only validator. +func (v readOnlyValidator) publicKeySlice() []byte { + return v.validator.PublicKey +} + // WithdrawalCredentials returns the withdrawal credentials of the // read only validator. func (v readOnlyValidator) WithdrawalCredentials() []byte { diff --git a/beacon-chain/state/state-native/setters_misc.go b/beacon-chain/state/state-native/setters_misc.go index e5c4b4e65a43..661aa070961c 100644 --- a/beacon-chain/state/state-native/setters_misc.go +++ b/beacon-chain/state/state-native/setters_misc.go @@ -4,6 +4,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" + "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" @@ -107,6 +108,18 @@ func (b *BeaconState) SetHistoricalRoots(val [][]byte) error { return nil } +// SaveValidatorIndices save validator indices of beacon chain to cache +func (b *BeaconState) SaveValidatorIndices() { + if !features.Get().EIP6110ValidatorIndexCache { + return + } + + b.lock.Lock() + defer b.lock.Unlock() + + b.saveValidatorIndices() +} + // AppendHistoricalRoots for the beacon state. Appends the new value // to the end of list. func (b *BeaconState) AppendHistoricalRoots(root [32]byte) error { diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 03ec6d77079b..93fa41f311d7 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -759,7 +759,8 @@ func (b *BeaconState) Copy() state.BeaconState { stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), // Share the reference to validator index map. - valMapHandler: b.valMapHandler, + valMapHandler: b.valMapHandler, + validatorIndexCache: b.validatorIndexCache, } if features.Get().EnableExperimentalState { diff --git a/beacon-chain/state/state-native/validator_index_cache.go b/beacon-chain/state/state-native/validator_index_cache.go new file mode 100644 index 000000000000..dcb8ce33684f --- /dev/null +++ b/beacon-chain/state/state-native/validator_index_cache.go @@ -0,0 +1,96 @@ +package state_native + +import ( + "bytes" + "sync" + + "github.com/prysmaticlabs/prysm/v5/config/features" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +// finalizedValidatorIndexCache maintains a mapping from validator public keys to their indices within the beacon state. +// It includes a lastFinalizedIndex to track updates up to the last finalized validator index, +// and uses a mutex for concurrent read/write access to the cache. +type finalizedValidatorIndexCache struct { + indexMap map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex // Maps finalized BLS public keys to validator indices. + sync.RWMutex +} + +// newFinalizedValidatorIndexCache initializes a new validator index cache with an empty index map. +func newFinalizedValidatorIndexCache() *finalizedValidatorIndexCache { + return &finalizedValidatorIndexCache{ + indexMap: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + } +} + +// getValidatorIndex retrieves the validator index for a given public key from the cache. +// If the public key is not found in the cache, it searches through the state starting from the last finalized index. +func (b *BeaconState) getValidatorIndex(pubKey [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool) { + b.validatorIndexCache.RLock() + index, found := b.validatorIndexCache.indexMap[pubKey] + b.validatorIndexCache.RUnlock() + if found { + return index, true + } + + validatorCount := len(b.validatorIndexCache.indexMap) + vals := b.validatorsReadOnlySinceIndex(validatorCount) + for i, val := range vals { + if bytes.Equal(bytesutil.PadTo(val.publicKeySlice(), 48), pubKey[:]) { + index := primitives.ValidatorIndex(validatorCount + i) + return index, true + } + } + return 0, false +} + +// saveValidatorIndices updates the validator index cache with new indices. +// It processes validator indices starting after the last finalized index and updates the tracker. +func (b *BeaconState) saveValidatorIndices() { + b.validatorIndexCache.Lock() + defer b.validatorIndexCache.Unlock() + + validatorCount := len(b.validatorIndexCache.indexMap) + vals := b.validatorsReadOnlySinceIndex(validatorCount) + for i, val := range vals { + b.validatorIndexCache.indexMap[val.PublicKey()] = primitives.ValidatorIndex(validatorCount + i) + } +} + +// validatorsReadOnlySinceIndex constructs a list of read only validator references after a specified index. +// The indices in the returned list correspond to their respective validator indices in the state. +// It returns nil if the specified index is out of bounds. This function is read-only and does not use locks. +func (b *BeaconState) validatorsReadOnlySinceIndex(index int) []readOnlyValidator { + totalValidators := b.validatorsLen() + if index >= totalValidators { + return nil + } + + var v []*ethpb.Validator + if features.Get().EnableExperimentalState { + if b.validatorsMultiValue == nil { + return nil + } + v = b.validatorsMultiValue.Value(b) + } else { + if b.validators == nil { + return nil + } + v = b.validators + } + + result := make([]readOnlyValidator, totalValidators-index) + for i := 0; i < len(result); i++ { + val := v[i+index] + if val == nil { + continue + } + result[i] = readOnlyValidator{ + validator: val, + } + } + return result +} diff --git a/beacon-chain/state/state-native/validator_index_cache_test.go b/beacon-chain/state/state-native/validator_index_cache_test.go new file mode 100644 index 000000000000..85177f89ceeb --- /dev/null +++ b/beacon-chain/state/state-native/validator_index_cache_test.go @@ -0,0 +1,105 @@ +package state_native + +import ( + "testing" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func Test_FinalizedValidatorIndexCache(t *testing.T) { + c := newFinalizedValidatorIndexCache() + b := &BeaconState{validatorIndexCache: c} + + // What happens if you call getValidatorIndex with a public key that is not in the cache and state? + // The function will return 0 and false. + i, exists := b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{0}) + require.Equal(t, primitives.ValidatorIndex(0), i) + require.Equal(t, false, exists) + + // Validators are added to the state. They are [0, 1, 2] + b.validators = []*ethpb.Validator{ + {PublicKey: []byte{1}}, + {PublicKey: []byte{2}}, + {PublicKey: []byte{3}}, + } + // We should be able to retrieve these validators by public key even when they are not in the cache + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{1}) + require.Equal(t, primitives.ValidatorIndex(0), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{2}) + require.Equal(t, primitives.ValidatorIndex(1), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{3}) + require.Equal(t, primitives.ValidatorIndex(2), i) + require.Equal(t, true, exists) + + // State is finalized. We save [0, 1, 2 ] to the cache. + b.saveValidatorIndices() + require.Equal(t, 3, len(b.validatorIndexCache.indexMap)) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{1}) + require.Equal(t, primitives.ValidatorIndex(0), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{2}) + require.Equal(t, primitives.ValidatorIndex(1), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{3}) + require.Equal(t, primitives.ValidatorIndex(2), i) + require.Equal(t, true, exists) + + // New validators are added to the state. They are [4, 5] + b.validators = []*ethpb.Validator{ + {PublicKey: []byte{1}}, + {PublicKey: []byte{2}}, + {PublicKey: []byte{3}}, + {PublicKey: []byte{4}}, + {PublicKey: []byte{5}}, + } + // We should be able to retrieve these validators by public key even when they are not in the cache + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{4}) + require.Equal(t, primitives.ValidatorIndex(3), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{5}) + require.Equal(t, primitives.ValidatorIndex(4), i) + require.Equal(t, true, exists) + + // State is finalized. We save [4, 5] to the cache. + b.saveValidatorIndices() + require.Equal(t, 5, len(b.validatorIndexCache.indexMap)) + + // New validators are added to the state. They are [6] + b.validators = []*ethpb.Validator{ + {PublicKey: []byte{1}}, + {PublicKey: []byte{2}}, + {PublicKey: []byte{3}}, + {PublicKey: []byte{4}}, + {PublicKey: []byte{5}}, + {PublicKey: []byte{6}}, + } + // We should be able to retrieve these validators by public key even when they are not in the cache + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{6}) + require.Equal(t, primitives.ValidatorIndex(5), i) + require.Equal(t, true, exists) + + // State is finalized. We save [6] to the cache. + b.saveValidatorIndices() + require.Equal(t, 6, len(b.validatorIndexCache.indexMap)) + + // Save a few more times. + b.saveValidatorIndices() + b.saveValidatorIndices() + require.Equal(t, 6, len(b.validatorIndexCache.indexMap)) + + // Can still retrieve the validators from the cache + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{1}) + require.Equal(t, primitives.ValidatorIndex(0), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{2}) + require.Equal(t, primitives.ValidatorIndex(1), i) + require.Equal(t, true, exists) + i, exists = b.getValidatorIndex([fieldparams.BLSPubkeyLength]byte{3}) + require.Equal(t, primitives.ValidatorIndex(2), i) + require.Equal(t, true, exists) +} diff --git a/config/features/config.go b/config/features/config.go index fe39c9970519..833c562d7587 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -73,8 +73,9 @@ type Flags struct { // BlobSaveFsync requires blob saving to block on fsync to ensure blobs are durably persisted before passing DA. BlobSaveFsync bool - SaveInvalidBlock bool // SaveInvalidBlock saves invalid block to temp. - SaveInvalidBlob bool // SaveInvalidBlob saves invalid blob to temp. + SaveInvalidBlock bool // SaveInvalidBlock saves invalid block to temp. + SaveInvalidBlob bool // SaveInvalidBlob saves invalid blob to temp. + EIP6110ValidatorIndexCache bool // EIP6110ValidatorIndexCache specifies whether to use the new validator index cache. // KeystoreImportDebounceInterval specifies the time duration the validator waits to reload new keys if they have // changed on disk. This feature is for advanced use cases only. @@ -254,6 +255,11 @@ func ConfigureBeaconChain(ctx *cli.Context) error { cfg.EnableQUIC = true } + if ctx.IsSet(eip6110ValidatorCache.Name) { + logEnabled(eip6110ValidatorCache) + cfg.EIP6110ValidatorIndexCache = true + } + cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value} Init(cfg) return nil diff --git a/config/features/flags.go b/config/features/flags.go index af97adaaab8f..3c7314704434 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -166,6 +166,11 @@ var ( Name: "enable-quic", Usage: "Enables connection using the QUIC protocol for peers which support it.", } + // eip6110ValidatorCache is a flag for enabling the EIP-6110 validator cache. + eip6110ValidatorCache = &cli.BoolFlag{ + Name: "eip6110-validator-cache", + Usage: "Enables the EIP-6110 validator cache.", + } ) // devModeFlags holds list of flags that are set when development mode is on. @@ -223,6 +228,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c EnableLightClient, BlobSaveFsync, EnableQUIC, + eip6110ValidatorCache, }...)...) // E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E. From c312a88aa391ee3c62877c637ca88b77981f19b2 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Thu, 2 May 2024 15:52:27 -0500 Subject: [PATCH 065/325] Removes fork-specific concrete type getters (#13941) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * removing typed pb accessors * refactor ssz api resp handlers to avoid typed pbs * json get block handler refactor * SubmitBlindedBlock to use generic json handling * update SubmitBlindedBlock * clear out more usages of PbForkname methods * remove fork-specific getters from block interface * remove usages of payload pb methods * remove pb helpers from execution payload interface * Update beacon-chain/rpc/eth/beacon/handlers.go Co-authored-by: Radosław Kapka * Update beacon-chain/rpc/eth/beacon/handlers.go Co-authored-by: Radosław Kapka * Update api/client/builder/client.go Co-authored-by: Radosław Kapka * Update api/client/builder/client.go Co-authored-by: Radosław Kapka * Update api/client/builder/client.go Co-authored-by: Radosław Kapka * Update api/client/builder/client.go Co-authored-by: Radosław Kapka * Update api/client/builder/client.go Co-authored-by: Radosław Kapka * Radek review * fix error message * deal with wonky builder responses * :scissors: * gaz * lint * tweaks for deep source --------- Co-authored-by: Kasey Kirkham Co-authored-by: Radosław Kapka --- api/client/builder/BUILD.bazel | 3 + api/client/builder/client.go | 170 ++-- api/client/builder/client_test.go | 2 +- api/client/builder/types.go | 125 +++ api/client/builder/types_test.go | 40 +- api/server/structs/BUILD.bazel | 1 + api/server/structs/block.go | 94 +++ api/server/structs/conversions_block.go | 33 +- beacon-chain/db/kv/BUILD.bazel | 1 + beacon-chain/db/kv/blocks_test.go | 103 +-- beacon-chain/execution/engine_client_test.go | 36 +- beacon-chain/rpc/eth/beacon/BUILD.bazel | 1 + beacon-chain/rpc/eth/beacon/handlers.go | 790 ++---------------- beacon-chain/rpc/lookup/blocker_test.go | 4 +- .../rpc/prysm/v1alpha1/beacon/blocks.go | 79 +- .../rpc/prysm/v1alpha1/beacon/blocks_test.go | 9 +- .../v1alpha1/validator/proposer_deneb.go | 6 +- consensus-types/blocks/execution.go | 137 +-- consensus-types/blocks/execution_test.go | 38 - consensus-types/blocks/getters.go | 96 --- consensus-types/blocks/testing/BUILD.bazel | 1 - consensus-types/blocks/testing/mutator.go | 44 +- consensus-types/interfaces/beacon_block.go | 12 - consensus-types/mock/block.go | 32 - testing/middleware/builder/builder.go | 75 +- validator/client/propose.go | 7 +- 26 files changed, 525 insertions(+), 1414 deletions(-) diff --git a/api/client/builder/BUILD.bazel b/api/client/builder/BUILD.bazel index 5f5335a161cf..6248a2051e75 100644 --- a/api/client/builder/BUILD.bazel +++ b/api/client/builder/BUILD.bazel @@ -11,6 +11,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/api/client/builder", visibility = ["//visibility:public"], deps = [ + "//api:go_default_library", "//api/server/structs:go_default_library", "//config/fieldparams:go_default_library", "//consensus-types:go_default_library", @@ -28,6 +29,7 @@ go_library( "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", ], ) @@ -49,6 +51,7 @@ go_test( "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/api/client/builder/client.go b/api/client/builder/client.go index b9709abcd9a0..ba7c33328f36 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "math/big" "net" "net/http" "net/url" @@ -14,11 +13,11 @@ import ( "text/template" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -282,133 +281,68 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid return err } +var errResponseVersionMismatch = errors.New("builder API response uses a different version than requested in " + api.VersionHeader + " header") + // SubmitBlindedBlock calls the builder API endpoint that binds the validator to the builder and submits the block. // The response is the full execution payload used to create the blinded block. func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock) (interfaces.ExecutionData, *v1.BlobsBundle, error) { if !sb.IsBlinded() { return nil, nil, errNotBlinded } - switch sb.Version() { - case version.Bellatrix: - psb, err := sb.PbBlindedBellatrixBlock() - if err != nil { - return nil, nil, errors.Wrapf(err, "could not get protobuf block") - } - b, err := structs.SignedBlindedBeaconBlockBellatrixFromConsensus(ðpb.SignedBlindedBeaconBlockBellatrix{Block: psb.Block, Signature: bytesutil.SafeCopyBytes(psb.Signature)}) - if err != nil { - return nil, nil, errors.Wrapf(err, "could not convert SignedBlindedBeaconBlockBellatrix to json marshalable type") - } - body, err := json.Marshal(b) - if err != nil { - return nil, nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockBellatrix value body in SubmitBlindedBlock") - } - versionOpt := func(r *http.Request) { - r.Header.Add("Eth-Consensus-Version", version.String(version.Bellatrix)) - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Accept", "application/json") - } - rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), versionOpt) - if err != nil { - return nil, nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockBellatrix to the builder api") - } - ep := &ExecPayloadResponse{} - if err := json.Unmarshal(rb, ep); err != nil { - return nil, nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlock response") - } - if strings.ToLower(ep.Version) != version.String(version.Bellatrix) { - return nil, nil, errors.New("not a bellatrix payload") - } - p, err := ep.ToProto() - if err != nil { - return nil, nil, errors.Wrapf(err, "could not extract proto message from payload") - } - payload, err := blocks.WrappedExecutionPayload(p) - if err != nil { - return nil, nil, errors.Wrapf(err, "could not wrap execution payload in interface") - } - return payload, nil, nil - case version.Capella: - psb, err := sb.PbBlindedCapellaBlock() - if err != nil { - return nil, nil, errors.Wrapf(err, "could not get protobuf block") - } - b, err := structs.SignedBlindedBeaconBlockCapellaFromConsensus(ðpb.SignedBlindedBeaconBlockCapella{Block: psb.Block, Signature: bytesutil.SafeCopyBytes(psb.Signature)}) - if err != nil { - return nil, nil, errors.Wrapf(err, "could not convert SignedBlindedBeaconBlockCapella to json marshalable type") - } - body, err := json.Marshal(b) - if err != nil { - return nil, nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockCapella value body in SubmitBlindedBlockCapella") - } - versionOpt := func(r *http.Request) { - r.Header.Add("Eth-Consensus-Version", version.String(version.Capella)) - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Accept", "application/json") - } - rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), versionOpt) - - if err != nil { - return nil, nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockCapella to the builder api") - } - ep := &ExecPayloadResponseCapella{} - if err := json.Unmarshal(rb, ep); err != nil { - return nil, nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlockCapella response") - } - if strings.ToLower(ep.Version) != version.String(version.Capella) { - return nil, nil, errors.New("not a capella payload") - } - p, err := ep.ToProto() - if err != nil { - return nil, nil, errors.Wrapf(err, "could not extract proto message from payload") - } - payload, err := blocks.WrappedExecutionPayloadCapella(p, big.NewInt(0)) - if err != nil { - return nil, nil, errors.Wrapf(err, "could not wrap execution payload in interface") - } - return payload, nil, nil - case version.Deneb: - psb, err := sb.PbBlindedDenebBlock() - if err != nil { - return nil, nil, errors.Wrapf(err, "could not get protobuf block") - } - b, err := structs.SignedBlindedBeaconBlockDenebFromConsensus(ðpb.SignedBlindedBeaconBlockDeneb{Message: psb.Message, Signature: bytesutil.SafeCopyBytes(psb.Signature)}) - if err != nil { - return nil, nil, errors.Wrapf(err, "could not convert SignedBlindedBeaconBlockDeneb to json marshalable type") - } - body, err := json.Marshal(b) - if err != nil { - return nil, nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockDeneb value body in SubmitBlindedBlockDeneb") - } + // massage the proto struct type data into the api response type. + mj, err := structs.SignedBeaconBlockMessageJsoner(sb) + if err != nil { + return nil, nil, errors.Wrap(err, "error generating blinded beacon block post request") + } - versionOpt := func(r *http.Request) { - r.Header.Add("Eth-Consensus-Version", version.String(version.Deneb)) - r.Header.Set("Content-Type", "application/json") - r.Header.Set("Accept", "application/json") - } - rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), versionOpt) - if err != nil { - return nil, nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockDeneb to the builder api") - } - ep := &ExecPayloadResponseDeneb{} - if err := json.Unmarshal(rb, ep); err != nil { - return nil, nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlockDeneb response") - } - if strings.ToLower(ep.Version) != version.String(version.Deneb) { - return nil, nil, errors.New("not a deneb payload") - } - p, blobBundle, err := ep.ToProto() - if err != nil { - return nil, nil, errors.Wrapf(err, "could not extract proto message from payload") - } - payload, err := blocks.WrappedExecutionPayloadDeneb(p, big.NewInt(0)) + body, err := json.Marshal(mj) + if err != nil { + return nil, nil, errors.Wrap(err, "error marshaling blinded block post request to json") + } + postOpts := func(r *http.Request) { + r.Header.Add("Eth-Consensus-Version", version.String(sb.Version())) + r.Header.Set("Content-Type", api.JsonMediaType) + r.Header.Set("Accept", api.JsonMediaType) + } + // post the blinded block - the execution payload response should contain the unblinded payload, along with the + // blobs bundle if it is post deneb. + rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), postOpts) + if err != nil { + return nil, nil, errors.Wrap(err, "error posting the blinded block to the builder api") + } + // ExecutionPayloadResponse parses just the outer container and the Value key, enabling it to use the .Value + // key to determine which underlying data type to use to finish the unmarshaling. + ep := &ExecutionPayloadResponse{} + if err := json.Unmarshal(rb, ep); err != nil { + return nil, nil, errors.Wrap(err, "error unmarshaling the builder ExecutionPayloadResponse") + } + if strings.ToLower(ep.Version) != version.String(sb.Version()) { + return nil, nil, errors.Wrapf(errResponseVersionMismatch, "req=%s, recv=%s", strings.ToLower(ep.Version), version.String(sb.Version())) + } + // This parses the rest of the response and returns the inner data field. + pp, err := ep.ParsePayload() + if err != nil { + return nil, nil, errors.Wrapf(err, "failed to parse execution payload from builder with version=%s", ep.Version) + } + // Get the payload as a proto.Message so it can be wrapped as an execution payload interface. + pb, err := pp.PayloadProto() + if err != nil { + return nil, nil, err + } + ed, err := blocks.NewWrappedExecutionData(pb, nil) + if err != nil { + return nil, nil, err + } + bb, ok := pp.(BlobBundler) + if ok { + bbpb, err := bb.BundleProto() if err != nil { - return nil, nil, errors.Wrapf(err, "could not wrap execution payload in interface") + return nil, nil, errors.Wrapf(err, "failed to extract blobs bundle from builder response with version=%s", ep.Version) } - return payload, blobBundle, nil - default: - return nil, nil, fmt.Errorf("unsupported block version %s", version.String(sb.Version())) + return ed, bbpb, nil } + return ed, nil, nil } // Status asks the remote builder server for a health check. A response of 200 with an empty body is the success/healthy diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index 5131ec716317..eaa8f1f53068 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -432,7 +432,7 @@ func TestSubmitBlindedBlock(t *testing.T) { sbbb, err := blocks.NewSignedBeaconBlock(testSignedBlindedBeaconBlockBellatrix(t)) require.NoError(t, err) _, _, err = c.SubmitBlindedBlock(ctx, sbbb) - require.ErrorContains(t, "not a bellatrix payload", err) + require.ErrorIs(t, err, errResponseVersionMismatch) }) t.Run("not blinded", func(t *testing.T) { sbb, err := blocks.NewSignedBeaconBlock(ð.SignedBeaconBlockBellatrix{Block: ð.BeaconBlockBellatrix{Body: ð.BeaconBlockBodyBellatrix{ExecutionPayload: &v1.ExecutionPayload{}}}}) diff --git a/api/client/builder/types.go b/api/client/builder/types.go index 214e5b729837..29905096739d 100644 --- a/api/client/builder/types.go +++ b/api/client/builder/types.go @@ -9,11 +9,15 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" types "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" ) var errInvalidUint256 = errors.New("invalid Uint256") @@ -44,6 +48,9 @@ func sszBytesToUint256(b []byte) (Uint256, error) { // SSZBytes creates an ssz-style (little-endian byte slice) representation of the Uint256. func (s Uint256) SSZBytes() []byte { + if s.Int == nil { + s.Int = big.NewInt(0) + } if !math.IsValidUint256(s.Int) { return []byte{} } @@ -91,6 +98,9 @@ func (s Uint256) MarshalJSON() ([]byte, error) { // MarshalText returns a text byte representation of Uint256. func (s Uint256) MarshalText() ([]byte, error) { + if s.Int == nil { + s.Int = big.NewInt(0) + } if !math.IsValidUint256(s.Int) { return nil, errors.Wrapf(errInvalidUint256, "value=%s", s.Int) } @@ -265,6 +275,11 @@ func (r *ExecPayloadResponse) ToProto() (*v1.ExecutionPayload, error) { return r.Data.ToProto() } +func (r *ExecutionPayload) PayloadProto() (proto.Message, error) { + pb, err := r.ToProto() + return pb, err +} + // ToProto returns a ExecutionPayload Proto func (p *ExecutionPayload) ToProto() (*v1.ExecutionPayload, error) { txs := make([][]byte, len(p.Transactions)) @@ -396,6 +411,51 @@ func FromProtoDeneb(payload *v1.ExecutionPayloadDeneb) (ExecutionPayloadDeneb, e }, nil } +var errInvalidTypeConversion = errors.New("unable to translate between api and foreign type") + +// ExecutionPayloadResponseFromData converts an ExecutionData interface value to a payload response. +// This involves serializing the execution payload value so that the abstract payload envelope can be used. +func ExecutionPayloadResponseFromData(ed interfaces.ExecutionData, bundle *v1.BlobsBundle) (*ExecutionPayloadResponse, error) { + pb := ed.Proto() + var data interface{} + var err error + var ver string + switch pbStruct := pb.(type) { + case *v1.ExecutionPayload: + ver = version.String(version.Bellatrix) + data, err = FromProto(pbStruct) + if err != nil { + return nil, errors.Wrap(err, "failed to convert a Bellatrix ExecutionPayload to an API response") + } + case *v1.ExecutionPayloadCapella: + ver = version.String(version.Capella) + data, err = FromProtoCapella(pbStruct) + if err != nil { + return nil, errors.Wrap(err, "failed to convert a Capella ExecutionPayload to an API response") + } + case *v1.ExecutionPayloadDeneb: + ver = version.String(version.Deneb) + payloadStruct, err := FromProtoDeneb(pbStruct) + if err != nil { + return nil, errors.Wrap(err, "failed to convert a Deneb ExecutionPayload to an API response") + } + data = &ExecutionPayloadDenebAndBlobsBundle{ + ExecutionPayload: &payloadStruct, + BlobsBundle: FromBundleProto(bundle), + } + default: + return nil, errInvalidTypeConversion + } + encoded, err := json.Marshal(data) + if err != nil { + return nil, errors.Wrapf(err, "failed to marshal execution payload version=%s", ver) + } + return &ExecutionPayloadResponse{ + Version: ver, + Data: encoded, + }, nil +} + // ExecHeaderResponseCapella is the response of builder API /eth/v1/builder/header/{slot}/{parent_hash}/{pubkey} for Capella. type ExecHeaderResponseCapella struct { Data struct { @@ -523,6 +583,42 @@ type ExecPayloadResponseCapella struct { Data ExecutionPayloadCapella `json:"data"` } +// ExecutionPayloadResponse allows for unmarshaling just the Version field of the payload. +// This allows it to return different ExecutionPayload types based on the version field. +type ExecutionPayloadResponse struct { + Version string `json:"version"` + Data json.RawMessage `json:"data"` +} + +// ParsedPayload can retrieve the underlying protobuf message for the given execution payload response. +type ParsedPayload interface { + PayloadProto() (proto.Message, error) +} + +// BlobBundler can retrieve the underlying blob bundle protobuf message for the given execution payload response. +type BlobBundler interface { + BundleProto() (*v1.BlobsBundle, error) +} + +func (r *ExecutionPayloadResponse) ParsePayload() (ParsedPayload, error) { + var toProto ParsedPayload + switch r.Version { + case version.String(version.Bellatrix): + toProto = &ExecutionPayload{} + case version.String(version.Capella): + toProto = &ExecutionPayloadCapella{} + case version.String(version.Deneb): + toProto = &ExecutionPayloadDenebAndBlobsBundle{} + default: + return nil, consensusblocks.ErrUnsupportedVersion + } + + if err := json.Unmarshal(r.Data, toProto); err != nil { + return nil, errors.Wrap(err, "failed to unmarshal the response .Data field with the stated version schema") + } + return toProto, nil +} + // ExecutionPayloadCapella is a field of ExecPayloadResponseCapella. type ExecutionPayloadCapella struct { ParentHash hexutil.Bytes `json:"parent_hash"` @@ -547,6 +643,11 @@ func (r *ExecPayloadResponseCapella) ToProto() (*v1.ExecutionPayloadCapella, err return r.Data.ToProto() } +func (p *ExecutionPayloadCapella) PayloadProto() (proto.Message, error) { + pb, err := p.ToProto() + return pb, err +} + // ToProto returns a ExecutionPayloadCapella Proto. func (p *ExecutionPayloadCapella) ToProto() (*v1.ExecutionPayloadCapella, error) { txs := make([][]byte, len(p.Transactions)) @@ -1128,6 +1229,12 @@ func (r *ExecPayloadResponseDeneb) ToProto() (*v1.ExecutionPayloadDeneb, *v1.Blo if r.Data == nil { return nil, nil, errors.New("data field in response is empty") } + if r.Data.ExecutionPayload == nil { + return nil, nil, errors.Wrap(consensusblocks.ErrNilObject, "nil execution payload") + } + if r.Data.BlobsBundle == nil { + return nil, nil, errors.Wrap(consensusblocks.ErrNilObject, "nil blobs bundle") + } payload, err := r.Data.ExecutionPayload.ToProto() if err != nil { return nil, nil, err @@ -1139,8 +1246,26 @@ func (r *ExecPayloadResponseDeneb) ToProto() (*v1.ExecutionPayloadDeneb, *v1.Blo return payload, bundle, nil } +func (r *ExecutionPayloadDenebAndBlobsBundle) PayloadProto() (proto.Message, error) { + if r.ExecutionPayload == nil { + return nil, errors.Wrap(consensusblocks.ErrNilObject, "nil execution payload in combined deneb payload") + } + pb, err := r.ExecutionPayload.ToProto() + return pb, err +} + +func (r *ExecutionPayloadDenebAndBlobsBundle) BundleProto() (*v1.BlobsBundle, error) { + if r.BlobsBundle == nil { + return nil, errors.Wrap(consensusblocks.ErrNilObject, "nil blobs bundle") + } + return r.BlobsBundle.ToProto() +} + // ToProto returns the ExecutionPayloadDeneb Proto. func (p *ExecutionPayloadDeneb) ToProto() (*v1.ExecutionPayloadDeneb, error) { + if p == nil { + return nil, errors.Wrap(consensusblocks.ErrNilObject, "nil execution payload") + } txs := make([][]byte, len(p.Transactions)) for i := range p.Transactions { txs[i] = bytesutil.SafeCopyBytes(p.Transactions[i]) diff --git a/api/client/builder/types_test.go b/api/client/builder/types_test.go index 33efeac394d4..0bc6b1b57c50 100644 --- a/api/client/builder/types_test.go +++ b/api/client/builder/types_test.go @@ -15,9 +15,11 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/api/server/structs" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/math" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -1600,7 +1602,6 @@ func TestBuilderBidUnmarshalUint256(t *testing.T) { require.NoError(t, expectedValue.UnmarshalText([]byte(base10))) r := &ExecHeaderResponse{} require.NoError(t, json.Unmarshal([]byte(testBuilderBid), r)) - //require.Equal(t, expectedValue, r.Data.Message.Value) marshaled := r.Data.Message.Value.String() require.Equal(t, base10, marshaled) require.Equal(t, 0, expectedValue.Cmp(r.Data.Message.Value.Int)) @@ -1907,3 +1908,40 @@ func TestErrorMessage_non200Err(t *testing.T) { }) } } + +func TestEmptyResponseBody(t *testing.T) { + t.Run("empty buffer", func(t *testing.T) { + var b []byte + r := &ExecutionPayloadResponse{} + err := json.Unmarshal(b, r) + _, ok := err.(*json.SyntaxError) + require.Equal(t, true, ok) + }) + t.Run("empty object", func(t *testing.T) { + empty := []byte("{}") + emptyResponse := &ExecutionPayloadResponse{} + require.NoError(t, json.Unmarshal(empty, emptyResponse)) + _, err := emptyResponse.ParsePayload() + require.ErrorIs(t, err, consensusblocks.ErrUnsupportedVersion) + }) + versions := []int{version.Bellatrix, version.Capella, version.Deneb} + for i := range versions { + vstr := version.String(versions[i]) + t.Run("populated version without payload"+vstr, func(t *testing.T) { + in := &ExecutionPayloadResponse{Version: vstr} + encoded, err := json.Marshal(in) + require.NoError(t, err) + epr := &ExecutionPayloadResponse{} + require.NoError(t, json.Unmarshal(encoded, epr)) + pp, err := epr.ParsePayload() + require.NoError(t, err) + pb, err := pp.PayloadProto() + if err == nil { + require.NoError(t, err) + require.Equal(t, false, pb == nil) + } else { + require.ErrorIs(t, err, consensusblocks.ErrNilObject) + } + }) + } +} diff --git a/api/server/structs/BUILD.bazel b/api/server/structs/BUILD.bazel index 7727a44f1b89..df11af3b0221 100644 --- a/api/server/structs/BUILD.bazel +++ b/api/server/structs/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//api/server:go_default_library", "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//container/slice:go_default_library", diff --git a/api/server/structs/block.go b/api/server/structs/block.go index b5cfc1f27d1b..7615f3653a4e 100644 --- a/api/server/structs/block.go +++ b/api/server/structs/block.go @@ -1,10 +1,34 @@ package structs +import "encoding/json" + +// MessageJsoner describes a signed consensus type wrapper that can return the `.Message` field in a json envelope +// encoded as a []byte, for use as a json.RawMessage value when encoding the outer envelope. +type MessageJsoner interface { + MessageRawJson() ([]byte, error) +} + +// SignedMessageJsoner embeds MessageJsoner and adds a method to also retrieve the Signature field as a string. +type SignedMessageJsoner interface { + MessageJsoner + SigString() string +} + type SignedBeaconBlock struct { Message *BeaconBlock `json:"message"` Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBeaconBlock{} + +func (s *SignedBeaconBlock) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBeaconBlock) SigString() string { + return s.Signature +} + type BeaconBlock struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -29,6 +53,16 @@ type SignedBeaconBlockAltair struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBeaconBlockAltair{} + +func (s *SignedBeaconBlockAltair) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBeaconBlockAltair) SigString() string { + return s.Signature +} + type BeaconBlockAltair struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -54,6 +88,16 @@ type SignedBeaconBlockBellatrix struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBeaconBlockBellatrix{} + +func (s *SignedBeaconBlockBellatrix) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBeaconBlockBellatrix) SigString() string { + return s.Signature +} + type BeaconBlockBellatrix struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -80,6 +124,16 @@ type SignedBlindedBeaconBlockBellatrix struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBlindedBeaconBlockBellatrix{} + +func (s *SignedBlindedBeaconBlockBellatrix) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBlindedBeaconBlockBellatrix) SigString() string { + return s.Signature +} + type BlindedBeaconBlockBellatrix struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -106,6 +160,16 @@ type SignedBeaconBlockCapella struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBeaconBlockCapella{} + +func (s *SignedBeaconBlockCapella) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBeaconBlockCapella) SigString() string { + return s.Signature +} + type BeaconBlockCapella struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -133,6 +197,16 @@ type SignedBlindedBeaconBlockCapella struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBlindedBeaconBlockCapella{} + +func (s *SignedBlindedBeaconBlockCapella) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBlindedBeaconBlockCapella) SigString() string { + return s.Signature +} + type BlindedBeaconBlockCapella struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -172,6 +246,16 @@ type SignedBeaconBlockDeneb struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBeaconBlockDeneb{} + +func (s *SignedBeaconBlockDeneb) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBeaconBlockDeneb) SigString() string { + return s.Signature +} + type BeaconBlockDeneb struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` @@ -208,6 +292,16 @@ type SignedBlindedBeaconBlockDeneb struct { Signature string `json:"signature"` } +var _ SignedMessageJsoner = &SignedBlindedBeaconBlockDeneb{} + +func (s *SignedBlindedBeaconBlockDeneb) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBlindedBeaconBlockDeneb) SigString() string { + return s.Signature +} + type BlindedBeaconBlockBodyDeneb struct { RandaoReveal string `json:"randao_reveal"` Eth1Data *Eth1Data `json:"eth1_data"` diff --git a/api/server/structs/conversions_block.go b/api/server/structs/conversions_block.go index 4349d7d46ddc..6a3f4e912997 100644 --- a/api/server/structs/conversions_block.go +++ b/api/server/structs/conversions_block.go @@ -6,8 +6,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -15,6 +17,8 @@ import ( eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) +var ErrUnsupportedConversion = errors.New("Could not determine api struct type to use for value") + func (h *SignedBeaconBlockHeader) ToConsensus() (*eth.SignedBeaconBlockHeader, error) { msg, err := h.Message.ToConsensus() if err != nil { @@ -1852,7 +1856,34 @@ func BeaconBlockFromConsensus(b *eth.BeaconBlock) *BeaconBlock { } } -func SignedBeaconBlockFromConsensus(b *eth.SignedBeaconBlock) *SignedBeaconBlock { +func SignedBeaconBlockMessageJsoner(block interfaces.ReadOnlySignedBeaconBlock) (SignedMessageJsoner, error) { + pb, err := block.Proto() + if err != nil { + return nil, err + } + switch pbStruct := pb.(type) { + case *eth.SignedBeaconBlock: + return SignedBeaconBlockPhase0FromConsensus(pbStruct), nil + case *eth.SignedBeaconBlockAltair: + return SignedBeaconBlockAltairFromConsensus(pbStruct), nil + case *eth.SignedBlindedBeaconBlockBellatrix: + return SignedBlindedBeaconBlockBellatrixFromConsensus(pbStruct) + case *eth.SignedBeaconBlockBellatrix: + return SignedBeaconBlockBellatrixFromConsensus(pbStruct) + case *eth.SignedBlindedBeaconBlockCapella: + return SignedBlindedBeaconBlockCapellaFromConsensus(pbStruct) + case *eth.SignedBeaconBlockCapella: + return SignedBeaconBlockCapellaFromConsensus(pbStruct) + case *eth.SignedBlindedBeaconBlockDeneb: + return SignedBlindedBeaconBlockDenebFromConsensus(pbStruct) + case *eth.SignedBeaconBlockDeneb: + return SignedBeaconBlockDenebFromConsensus(pbStruct) + default: + return nil, ErrUnsupportedConversion + } +} + +func SignedBeaconBlockPhase0FromConsensus(b *eth.SignedBeaconBlock) *SignedBeaconBlock { return &SignedBeaconBlock{ Message: BeaconBlockFromConsensus(b.Block), Signature: hexutil.Encode(b.Signature), diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index a1995e31e47f..464a6c82e196 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -115,6 +115,7 @@ go_test( "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/testing:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", diff --git a/beacon-chain/db/kv/blocks_test.go b/beacon-chain/db/kv/blocks_test.go index 67235b2aef41..03bd37dfad5a 100644 --- a/beacon-chain/db/kv/blocks_test.go +++ b/beacon-chain/db/kv/blocks_test.go @@ -14,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -180,7 +181,7 @@ func TestStore_BlocksCRUD(t *testing.T) { retrievedBlock, err = db.Block(ctx, blockRoot) require.NoError(t, err) wanted := retrievedBlock - if _, err := retrievedBlock.PbBellatrixBlock(); err == nil { + if retrievedBlock.Version() >= version.Bellatrix { wanted, err = retrievedBlock.ToBlinded() require.NoError(t, err) } @@ -368,15 +369,7 @@ func TestStore_BlocksCRUD_NoCache(t *testing.T) { require.NoError(t, err) wanted := blk - if _, err := blk.PbBellatrixBlock(); err == nil { - wanted, err = blk.ToBlinded() - require.NoError(t, err) - } - if _, err := blk.PbCapellaBlock(); err == nil { - wanted, err = blk.ToBlinded() - require.NoError(t, err) - } - if _, err := blk.PbDenebBlock(); err == nil { + if blk.Version() >= version.Bellatrix { wanted, err = blk.ToBlinded() require.NoError(t, err) } @@ -595,15 +588,7 @@ func TestStore_SaveBlock_CanGetHighestAt(t *testing.T) { b, err := db.Block(ctx, root) require.NoError(t, err) wanted := block1 - if _, err := block1.PbBellatrixBlock(); err == nil { - wanted, err = wanted.ToBlinded() - require.NoError(t, err) - } - if _, err := block1.PbCapellaBlock(); err == nil { - wanted, err = wanted.ToBlinded() - require.NoError(t, err) - } - if _, err := block1.PbDenebBlock(); err == nil { + if block1.Version() >= version.Bellatrix { wanted, err = wanted.ToBlinded() require.NoError(t, err) } @@ -621,15 +606,7 @@ func TestStore_SaveBlock_CanGetHighestAt(t *testing.T) { b, err = db.Block(ctx, root) require.NoError(t, err) wanted2 := block2 - if _, err := block2.PbBellatrixBlock(); err == nil { - wanted2, err = block2.ToBlinded() - require.NoError(t, err) - } - if _, err := block2.PbCapellaBlock(); err == nil { - wanted2, err = block2.ToBlinded() - require.NoError(t, err) - } - if _, err := block2.PbDenebBlock(); err == nil { + if block2.Version() >= version.Bellatrix { wanted2, err = block2.ToBlinded() require.NoError(t, err) } @@ -647,15 +624,7 @@ func TestStore_SaveBlock_CanGetHighestAt(t *testing.T) { b, err = db.Block(ctx, root) require.NoError(t, err) wanted = block3 - if _, err := block3.PbBellatrixBlock(); err == nil { - wanted, err = wanted.ToBlinded() - require.NoError(t, err) - } - if _, err := block3.PbCapellaBlock(); err == nil { - wanted, err = wanted.ToBlinded() - require.NoError(t, err) - } - if _, err := block3.PbDenebBlock(); err == nil { + if block3.Version() >= version.Bellatrix { wanted, err = wanted.ToBlinded() require.NoError(t, err) } @@ -691,15 +660,7 @@ func TestStore_GenesisBlock_CanGetHighestAt(t *testing.T) { b, err := db.Block(ctx, root) require.NoError(t, err) wanted := block1 - if _, err := block1.PbBellatrixBlock(); err == nil { - wanted, err = block1.ToBlinded() - require.NoError(t, err) - } - if _, err := block1.PbCapellaBlock(); err == nil { - wanted, err = block1.ToBlinded() - require.NoError(t, err) - } - if _, err := block1.PbDenebBlock(); err == nil { + if block1.Version() >= version.Bellatrix { wanted, err = block1.ToBlinded() require.NoError(t, err) } @@ -716,15 +677,7 @@ func TestStore_GenesisBlock_CanGetHighestAt(t *testing.T) { b, err = db.Block(ctx, root) require.NoError(t, err) wanted = genesisBlock - if _, err := genesisBlock.PbBellatrixBlock(); err == nil { - wanted, err = genesisBlock.ToBlinded() - require.NoError(t, err) - } - if _, err := genesisBlock.PbCapellaBlock(); err == nil { - wanted, err = genesisBlock.ToBlinded() - require.NoError(t, err) - } - if _, err := genesisBlock.PbDenebBlock(); err == nil { + if genesisBlock.Version() >= version.Bellatrix { wanted, err = genesisBlock.ToBlinded() require.NoError(t, err) } @@ -741,15 +694,7 @@ func TestStore_GenesisBlock_CanGetHighestAt(t *testing.T) { b, err = db.Block(ctx, root) require.NoError(t, err) wanted = genesisBlock - if _, err := genesisBlock.PbBellatrixBlock(); err == nil { - wanted, err = genesisBlock.ToBlinded() - require.NoError(t, err) - } - if _, err := genesisBlock.PbCapellaBlock(); err == nil { - wanted, err = genesisBlock.ToBlinded() - require.NoError(t, err) - } - if _, err := genesisBlock.PbDenebBlock(); err == nil { + if genesisBlock.Version() >= version.Bellatrix { wanted, err = genesisBlock.ToBlinded() require.NoError(t, err) } @@ -845,15 +790,7 @@ func TestStore_BlocksBySlot_BlockRootsBySlot(t *testing.T) { require.NoError(t, err) wanted := b1 - if _, err := b1.PbBellatrixBlock(); err == nil { - wanted, err = b1.ToBlinded() - require.NoError(t, err) - } - if _, err := b1.PbCapellaBlock(); err == nil { - wanted, err = b1.ToBlinded() - require.NoError(t, err) - } - if _, err := b1.PbDenebBlock(); err == nil { + if b1.Version() >= version.Bellatrix { wanted, err = b1.ToBlinded() require.NoError(t, err) } @@ -869,15 +806,7 @@ func TestStore_BlocksBySlot_BlockRootsBySlot(t *testing.T) { t.Fatalf("Expected 2 blocks, received %d blocks", len(retrievedBlocks)) } wanted = b2 - if _, err := b2.PbBellatrixBlock(); err == nil { - wanted, err = b2.ToBlinded() - require.NoError(t, err) - } - if _, err := b2.PbCapellaBlock(); err == nil { - wanted, err = b2.ToBlinded() - require.NoError(t, err) - } - if _, err := b2.PbDenebBlock(); err == nil { + if b2.Version() >= version.Bellatrix { wanted, err = b2.ToBlinded() require.NoError(t, err) } @@ -887,15 +816,7 @@ func TestStore_BlocksBySlot_BlockRootsBySlot(t *testing.T) { require.NoError(t, err) assert.Equal(t, true, proto.Equal(wantedPb, retrieved0Pb), "Wanted: %v, received: %v", retrievedBlocks[0], wanted) wanted = b3 - if _, err := b3.PbBellatrixBlock(); err == nil { - wanted, err = b3.ToBlinded() - require.NoError(t, err) - } - if _, err := b3.PbCapellaBlock(); err == nil { - wanted, err = b3.ToBlinded() - require.NoError(t, err) - } - if _, err := b3.PbDenebBlock(); err == nil { + if b3.Version() >= version.Bellatrix { wanted, err = b3.ToBlinded() require.NoError(t, err) } diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index d7ef8d58762e..82296b5e5c32 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -16,7 +16,6 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" - gethRPC "github.com/ethereum/go-ethereum/rpc" "github.com/holiman/uint256" "github.com/pkg/errors" mocks "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" @@ -45,7 +44,7 @@ type RPCClientBad struct { } func (RPCClientBad) Close() {} -func (RPCClientBad) BatchCall([]gethRPC.BatchElem) error { +func (RPCClientBad) BatchCall([]rpc.BatchElem) error { return errors.New("rpc client is not initialized") } @@ -76,7 +75,9 @@ func TestClient_IPC(t *testing.T) { resp, _, override, err := srv.GetPayload(ctx, payloadId, 1) require.NoError(t, err) require.Equal(t, false, override) - resPb, err := resp.PbBellatrix() + pbs := resp.Proto() + resPb, ok := pbs.(*pb.ExecutionPayload) + require.Equal(t, true, ok) require.NoError(t, err) require.DeepEqual(t, want, resPb) }) @@ -87,8 +88,9 @@ func TestClient_IPC(t *testing.T) { resp, _, override, err := srv.GetPayload(ctx, payloadId, params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) require.Equal(t, false, override) - resPb, err := resp.PbCapella() - require.NoError(t, err) + pbs := resp.Proto() + resPb, ok := pbs.(*pb.ExecutionPayloadCapella) + require.Equal(t, true, ok) require.DeepEqual(t, want, resPb) }) t.Run(ForkchoiceUpdatedMethod, func(t *testing.T) { @@ -201,9 +203,10 @@ func TestClient_HTTP(t *testing.T) { resp, _, override, err := client.GetPayload(ctx, payloadId, 1) require.NoError(t, err) require.Equal(t, false, override) - pb, err := resp.PbBellatrix() - require.NoError(t, err) - require.DeepEqual(t, want, pb) + pbs := resp.Proto() + pbStruct, ok := pbs.(*pb.ExecutionPayload) + require.Equal(t, true, ok) + require.DeepEqual(t, want, pbStruct) }) t.Run(GetPayloadMethodV2, func(t *testing.T) { payloadId := [8]byte{1} @@ -246,14 +249,15 @@ func TestClient_HTTP(t *testing.T) { resp, _, override, err := client.GetPayload(ctx, payloadId, params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) require.Equal(t, false, override) - pb, err := resp.PbCapella() - require.NoError(t, err) - require.DeepEqual(t, want.ExecutionPayload.BlockHash.Bytes(), pb.BlockHash) - require.DeepEqual(t, want.ExecutionPayload.StateRoot.Bytes(), pb.StateRoot) - require.DeepEqual(t, want.ExecutionPayload.ParentHash.Bytes(), pb.ParentHash) - require.DeepEqual(t, want.ExecutionPayload.FeeRecipient.Bytes(), pb.FeeRecipient) - require.DeepEqual(t, want.ExecutionPayload.PrevRandao.Bytes(), pb.PrevRandao) - require.DeepEqual(t, want.ExecutionPayload.ParentHash.Bytes(), pb.ParentHash) + pbs := resp.Proto() + ep, ok := pbs.(*pb.ExecutionPayloadCapella) + require.Equal(t, true, ok) + require.DeepEqual(t, want.ExecutionPayload.BlockHash.Bytes(), ep.BlockHash) + require.DeepEqual(t, want.ExecutionPayload.StateRoot.Bytes(), ep.StateRoot) + require.DeepEqual(t, want.ExecutionPayload.ParentHash.Bytes(), ep.ParentHash) + require.DeepEqual(t, want.ExecutionPayload.FeeRecipient.Bytes(), ep.FeeRecipient) + require.DeepEqual(t, want.ExecutionPayload.PrevRandao.Bytes(), ep.PrevRandao) + require.DeepEqual(t, want.ExecutionPayload.ParentHash.Bytes(), ep.ParentHash) v, err := resp.ValueInGwei() require.NoError(t, err) diff --git a/beacon-chain/rpc/eth/beacon/BUILD.bazel b/beacon-chain/rpc/eth/beacon/BUILD.bazel index 11ded5c96335..d9a8037e3e71 100644 --- a/beacon-chain/rpc/eth/beacon/BUILD.bazel +++ b/beacon-chain/rpc/eth/beacon/BUILD.bazel @@ -59,6 +59,7 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 7e446588ab9e..4fc48d4eac68 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" "github.com/pkg/errors" + ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" @@ -24,7 +25,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/prysm/v1alpha1/validator" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -46,10 +46,9 @@ const ( var ( errNilBlock = errors.New("nil block") errEquivocatedBlock = errors.New("block is equivocated") + errMarshalSSZ = errors.New("could not marshal block into SSZ") ) -type handled bool - // GetBlockV2 retrieves block details for given block ID. func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetBlockV2") @@ -61,93 +60,25 @@ func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) { return } blk, err := s.Blocker.Block(ctx, []byte(blockId)) - if !shared.WriteBlockFetchError(w, blk, err) { - return - } - - if httputil.RespondWithSsz(r) { - s.getBlockSSZV2(ctx, w, blk) - } else { - s.getBlockV2(ctx, w, blk) - } -} - -// getBlockV2 returns the JSON-serialized version of the beacon block for given block ID. -func (s *Server) getBlockV2(ctx context.Context, w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { - blkRoot, err := blk.Block().HashTreeRoot() if err != nil { - httputil.HandleError(w, "Could not get block root "+err.Error(), http.StatusInternalServerError) - return - } - finalized := s.FinalizationFetcher.IsFinalized(ctx, blkRoot) - - getBlockHandler := func(get func(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error)) handled { - result, err := get(ctx, blk) - if result != nil { - result.Finalized = finalized - w.Header().Set(api.VersionHeader, result.Version) - httputil.WriteJson(w, result) - return true - } - // ErrUnsupportedField means that we have another block type - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError) - return true - } - return false - } - - if getBlockHandler(s.getBlockDeneb) { - return - } - if getBlockHandler(s.getBlockCapella) { - return - } - if getBlockHandler(s.getBlockBellatrix) { - return - } - if getBlockHandler(s.getBlockAltair) { - return - } - if getBlockHandler(s.getBlockPhase0) { + shared.WriteBlockFetchError(w, blk, err) return } - httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) -} -// getBlockSSZV2 returns the SSZ-serialized version of the beacon block for given block ID. -func (s *Server) getBlockSSZV2(ctx context.Context, w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { - getBlockHandler := func(get func(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) ([]byte, error), ver string) handled { - result, err := get(ctx, blk) - if result != nil { - w.Header().Set(api.VersionHeader, ver) - httputil.WriteSsz(w, result, "beacon_block.ssz") - return true - } - // ErrUnsupportedField means that we have another block type - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError) - return true + // Deal with block unblinding. + if blk.Version() >= version.Bellatrix && blk.IsBlinded() { + blk, err = s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) + if err != nil { + shared.WriteBlockFetchError(w, blk, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block")) + return } - return false } - if getBlockHandler(s.getBlockDenebSSZ, version.String(version.Deneb)) { - return - } - if getBlockHandler(s.getBlockCapellaSSZ, version.String(version.Capella)) { - return - } - if getBlockHandler(s.getBlockBellatrixSSZ, version.String(version.Bellatrix)) { - return - } - if getBlockHandler(s.getBlockAltairSSZ, version.String(version.Altair)) { - return - } - if getBlockHandler(s.getBlockPhase0SSZ, version.String(version.Phase0)) { - return + if httputil.RespondWithSsz(r) { + s.getBlockV2Ssz(w, blk) + } else { + s.getBlockV2Json(ctx, w, blk) } - httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) } // GetBlindedBlock retrieves blinded block for given block id. @@ -165,701 +96,100 @@ func (s *Server) GetBlindedBlock(w http.ResponseWriter, r *http.Request) { return } - if httputil.RespondWithSsz(r) { - s.getBlindedBlockSSZ(ctx, w, blk) - } else { - s.getBlindedBlock(ctx, w, blk) - } -} - -// getBlindedBlock returns the JSON-serialized version of the blinded beacon block for given block id. -func (s *Server) getBlindedBlock(ctx context.Context, w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { - blkRoot, err := blk.Block().HashTreeRoot() - if err != nil { - httputil.HandleError(w, "Could not get block root "+err.Error(), http.StatusInternalServerError) - return - } - finalized := s.FinalizationFetcher.IsFinalized(ctx, blkRoot) - - getBlockHandler := func(get func(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error)) handled { - result, err := get(ctx, blk) - if result != nil { - result.Finalized = finalized - w.Header().Set(api.VersionHeader, result.Version) - httputil.WriteJson(w, result) - return true - } - // ErrUnsupportedField means that we have another block type - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError) - return true - } - return false - } - - if getBlockHandler(s.getBlockPhase0) { - return - } - if getBlockHandler(s.getBlockAltair) { - return - } - if getBlockHandler(s.getBlindedBlockBellatrix) { - return - } - if getBlockHandler(s.getBlindedBlockCapella) { - return - } - if getBlockHandler(s.getBlindedBlockDeneb) { - return - } - httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) -} - -// getBlindedBlockSSZ returns the SSZ-serialized version of the blinded beacon block for given block id. -func (s *Server) getBlindedBlockSSZ(ctx context.Context, w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { - getBlockHandler := func(get func(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) ([]byte, error), ver string) handled { - result, err := get(ctx, blk) - if result != nil { - w.Header().Set(api.VersionHeader, ver) - httputil.WriteSsz(w, result, "beacon_block.ssz") - return true - } - // ErrUnsupportedField means that we have another block type - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError) - return true - } - return false - } - - if getBlockHandler(s.getBlockPhase0SSZ, version.String(version.Phase0)) { - return - } - if getBlockHandler(s.getBlockAltairSSZ, version.String(version.Altair)) { - return - } - if getBlockHandler(s.getBlindedBlockBellatrixSSZ, version.String(version.Bellatrix)) { - return - } - if getBlockHandler(s.getBlindedBlockCapellaSSZ, version.String(version.Capella)) { - return - } - if getBlockHandler(s.getBlindedBlockDenebSSZ, version.String(version.Deneb)) { - return - } - httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) -} - -func (*Server) getBlockPhase0(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - consensusBlk, err := blk.PbPhase0Block() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - respBlk := structs.SignedBeaconBlockFromConsensus(consensusBlk) - jsonBytes, err := json.Marshal(respBlk.Message) - if err != nil { - return nil, err - } - return &structs.GetBlockV2Response{ - Version: version.String(version.Phase0), - ExecutionOptimistic: false, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil -} - -func (*Server) getBlockAltair(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - consensusBlk, err := blk.PbAltairBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - respBlk := structs.SignedBeaconBlockAltairFromConsensus(consensusBlk) - jsonBytes, err := json.Marshal(respBlk.Message) - if err != nil { - return nil, err - } - return &structs.GetBlockV2Response{ - Version: version.String(version.Altair), - ExecutionOptimistic: false, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil -} - -func (s *Server) getBlockBellatrix(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - consensusBlk, err := blk.PbBellatrixBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - blindedConsensusBlk, err := blk.PbBlindedBellatrixBlock() - if err != nil { - return nil, err - } - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - fullBlk, err := s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) - if err != nil { - return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block") - } - consensusBlk, err = fullBlk.PbBellatrixBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err + // Convert to blinded block (if it's not already). + if blk.Version() >= version.Bellatrix && !blk.IsBlinded() { + blk, err = blk.ToBlinded() + if err != nil { + shared.WriteBlockFetchError(w, blk, errors.Wrapf(err, "could not convert block to blinded block")) + return } } - if consensusBlk == nil { - return nil, errNilBlock - } - root, err := blk.Block().HashTreeRoot() - if err != nil { - return nil, errors.Wrapf(err, "could not get block root") - } - isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, root) - if err != nil { - return nil, errors.Wrapf(err, "could not check if block is optimistic") - } - respBlk, err := structs.SignedBeaconBlockBellatrixFromConsensus(consensusBlk) - if err != nil { - return nil, err - } - jsonBytes, err := json.Marshal(respBlk.Message) - if err != nil { - return nil, err + if httputil.RespondWithSsz(r) { + s.getBlockV2Ssz(w, blk) + } else { + s.getBlockV2Json(ctx, w, blk) } - return &structs.GetBlockV2Response{ - Version: version.String(version.Bellatrix), - ExecutionOptimistic: isOptimistic, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil } -func (s *Server) getBlockCapella(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - consensusBlk, err := blk.PbCapellaBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - blindedConsensusBlk, err := blk.PbBlindedCapellaBlock() - if err != nil { - return nil, err - } - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - fullBlk, err := s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) - if err != nil { - return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block") - } - consensusBlk, err = fullBlk.PbCapellaBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if consensusBlk == nil { - return nil, errNilBlock - } - root, err := blk.Block().HashTreeRoot() +// getBlockV2Ssz returns the SSZ-serialized version of the beacon block for given block ID. +func (s *Server) getBlockV2Ssz(w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { + result, err := s.getBlockResponseBodySsz(blk) if err != nil { - return nil, errors.Wrapf(err, "could not get block root") + httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError) } - isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, root) - if err != nil { - return nil, errors.Wrapf(err, "could not check if block is optimistic") + if result == nil { + httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) } - respBlk, err := structs.SignedBeaconBlockCapellaFromConsensus(consensusBlk) - if err != nil { - return nil, err - } - jsonBytes, err := json.Marshal(respBlk.Message) - if err != nil { - return nil, err - } - return &structs.GetBlockV2Response{ - Version: version.String(version.Capella), - ExecutionOptimistic: isOptimistic, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil + w.Header().Set(api.VersionHeader, version.String(blk.Version())) + httputil.WriteSsz(w, result, "beacon_block.ssz") } -func (s *Server) getBlockDeneb(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - consensusBlk, err := blk.PbDenebBlock() +func (*Server) getBlockResponseBodySsz(blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { + err := blocks.BeaconBlockIsNil(blk) if err != nil { - // ErrUnsupportedGetter means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - blindedConsensusBlk, err := blk.PbBlindedDenebBlock() - if err != nil { - return nil, err - } - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - fullBlk, err := s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) - if err != nil { - return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block") - } - consensusBlk, err = fullBlk.PbDenebBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if consensusBlk == nil { return nil, errNilBlock } - root, err := blk.Block().HashTreeRoot() - if err != nil { - return nil, errors.Wrapf(err, "could not get block root") - } - isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, root) - if err != nil { - return nil, errors.Wrapf(err, "could not check if block is optimistic") - } - respBlk, err := structs.SignedBeaconBlockDenebFromConsensus(consensusBlk) - if err != nil { - return nil, err - } - jsonBytes, err := json.Marshal(respBlk.Message) - if err != nil { - return nil, err - } - return &structs.GetBlockV2Response{ - Version: version.String(version.Deneb), - ExecutionOptimistic: isOptimistic, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil -} - -func (*Server) getBlockPhase0SSZ(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - consensusBlk, err := blk.PbPhase0Block() + pb, err := blk.Proto() if err != nil { return nil, err } - if consensusBlk == nil { - return nil, errNilBlock - } - sszData, err := consensusBlk.MarshalSSZ() - if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") - } - return sszData, nil -} - -func (*Server) getBlockAltairSSZ(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - consensusBlk, err := blk.PbAltairBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - sszData, err := consensusBlk.MarshalSSZ() - if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") - } - return sszData, nil -} - -func (s *Server) getBlockBellatrixSSZ(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - consensusBlk, err := blk.PbBellatrixBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - blindedConsensusBlk, err := blk.PbBlindedBellatrixBlock() - if err != nil { - return nil, err - } - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - fullBlk, err := s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) - if err != nil { - return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block") - } - consensusBlk, err = fullBlk.PbBellatrixBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if consensusBlk == nil { - return nil, errNilBlock - } - sszData, err := consensusBlk.MarshalSSZ() - if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") - } - return sszData, nil -} - -func (s *Server) getBlockCapellaSSZ(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - consensusBlk, err := blk.PbCapellaBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - blindedConsensusBlk, err := blk.PbBlindedCapellaBlock() - if err != nil { - return nil, err - } - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - fullBlk, err := s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) - if err != nil { - return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block") - } - consensusBlk, err = fullBlk.PbCapellaBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if consensusBlk == nil { - return nil, errNilBlock + marshaler, ok := pb.(ssz.Marshaler) + if !ok { + return nil, errMarshalSSZ } - sszData, err := consensusBlk.MarshalSSZ() + sszData, err := marshaler.MarshalSSZ() if err != nil { return nil, errors.Wrapf(err, "could not marshal block into SSZ") } return sszData, nil } -func (s *Server) getBlockDenebSSZ(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - consensusBlk, err := blk.PbDenebBlock() - if err != nil { - // ErrUnsupportedGetter means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - blindedConsensusBlk, err := blk.PbBlindedDenebBlock() - if err != nil { - return nil, err - } - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - fullBlk, err := s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) - if err != nil { - return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block") - } - consensusBlk, err = fullBlk.PbDenebBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if consensusBlk == nil { - return nil, errNilBlock - } - sszData, err := consensusBlk.MarshalSSZ() +// getBlockV2Json returns the JSON-serialized version of the beacon block for given block ID. +func (s *Server) getBlockV2Json(ctx context.Context, w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { + result, err := s.getBlockResponseBodyJson(ctx, blk) if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") + httputil.HandleError(w, "Error processing request: "+err.Error(), http.StatusInternalServerError) } - return sszData, nil + w.Header().Set(api.VersionHeader, result.Version) + httputil.WriteJson(w, result) } -func (s *Server) getBlindedBlockBellatrix(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - blindedConsensusBlk, err := blk.PbBlindedBellatrixBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - consensusBlk, err := blk.PbBellatrixBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - blkInterface, err := blk.ToBlinded() - if err != nil { - return nil, errors.Wrapf(err, "could not convert block to blinded block") - } - blindedConsensusBlk, err = blkInterface.PbBlindedBellatrixBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - root, err := blk.Block().HashTreeRoot() - if err != nil { - return nil, errors.Wrapf(err, "could not get block root") - } - isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, root) - if err != nil { - return nil, errors.Wrapf(err, "could not check if block is optimistic") - } - respBlk, err := structs.SignedBlindedBeaconBlockBellatrixFromConsensus(blindedConsensusBlk) - if err != nil { +func (s *Server) getBlockResponseBodyJson(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { + if err := blocks.BeaconBlockIsNil(blk); err != nil { return nil, err } - jsonBytes, err := json.Marshal(respBlk.Message) - if err != nil { - return nil, err - } - return &structs.GetBlockV2Response{ - Version: version.String(version.Bellatrix), - ExecutionOptimistic: isOptimistic, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil -} - -func (s *Server) getBlindedBlockCapella(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - blindedConsensusBlk, err := blk.PbBlindedCapellaBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - consensusBlk, err := blk.PbCapellaBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - blkInterface, err := blk.ToBlinded() - if err != nil { - return nil, errors.Wrapf(err, "could not convert block to blinded block") - } - blindedConsensusBlk, err = blkInterface.PbBlindedCapellaBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - root, err := blk.Block().HashTreeRoot() - if err != nil { - return nil, errors.Wrapf(err, "could not get block root") - } - isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, root) - if err != nil { - return nil, errors.Wrapf(err, "could not check if block is optimistic") - } - respBlk, err := structs.SignedBlindedBeaconBlockCapellaFromConsensus(blindedConsensusBlk) - if err != nil { - return nil, err - } - jsonBytes, err := json.Marshal(respBlk.Message) + blkRoot, err := blk.Block().HashTreeRoot() if err != nil { - return nil, err + return nil, errors.Wrap(err, "could not get block root") } - return &structs.GetBlockV2Response{ - Version: version.String(version.Capella), - ExecutionOptimistic: isOptimistic, - Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, - }, - }, nil -} - -func (s *Server) getBlindedBlockDeneb(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.GetBlockV2Response, error) { - blindedConsensusBlk, err := blk.PbBlindedDenebBlock() - if err != nil { - // ErrUnsupportedGetter means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - consensusBlk, err := blk.PbDenebBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - blkInterface, err := blk.ToBlinded() - if err != nil { - return nil, errors.Wrapf(err, "could not convert block to blinded block") - } - blindedConsensusBlk, err = blkInterface.PbBlindedDenebBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err + finalized := s.FinalizationFetcher.IsFinalized(ctx, blkRoot) + isOptimistic := false + if blk.Version() >= version.Bellatrix { + isOptimistic, err = s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, blkRoot) + if err != nil { + return nil, errors.Wrap(err, "could not check if block is optimistic") } } - - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - root, err := blk.Block().HashTreeRoot() - if err != nil { - return nil, errors.Wrapf(err, "could not get block root") - } - isOptimistic, err := s.OptimisticModeFetcher.IsOptimisticForRoot(ctx, root) - if err != nil { - return nil, errors.Wrapf(err, "could not check if block is optimistic") - } - respBlk, err := structs.SignedBlindedBeaconBlockDenebFromConsensus(blindedConsensusBlk) + mj, err := structs.SignedBeaconBlockMessageJsoner(blk) if err != nil { return nil, err } - jsonBytes, err := json.Marshal(respBlk.Message) + jb, err := mj.MessageRawJson() if err != nil { return nil, err } return &structs.GetBlockV2Response{ - Version: version.String(version.Deneb), + Finalized: finalized, ExecutionOptimistic: isOptimistic, + Version: version.String(blk.Version()), Data: &structs.SignedBlock{ - Message: jsonBytes, - Signature: respBlk.Signature, + Message: jb, + Signature: mj.SigString(), }, }, nil } -func (*Server) getBlindedBlockBellatrixSSZ(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - blindedConsensusBlk, err := blk.PbBlindedBellatrixBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - consensusBlk, err := blk.PbBellatrixBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - blkInterface, err := blk.ToBlinded() - if err != nil { - return nil, errors.Wrapf(err, "could not convert block to blinded block") - } - blindedConsensusBlk, err = blkInterface.PbBlindedBellatrixBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - sszData, err := blindedConsensusBlk.MarshalSSZ() - if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") - } - return sszData, nil -} - -func (*Server) getBlindedBlockCapellaSSZ(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - blindedConsensusBlk, err := blk.PbBlindedCapellaBlock() - if err != nil { - // ErrUnsupportedField means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - consensusBlk, err := blk.PbCapellaBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - blkInterface, err := blk.ToBlinded() - if err != nil { - return nil, errors.Wrapf(err, "could not convert block to blinded block") - } - blindedConsensusBlk, err = blkInterface.PbBlindedCapellaBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - sszData, err := blindedConsensusBlk.MarshalSSZ() - if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") - } - return sszData, nil -} - -func (*Server) getBlindedBlockDenebSSZ(_ context.Context, blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { - blindedConsensusBlk, err := blk.PbBlindedDenebBlock() - if err != nil { - // ErrUnsupportedGetter means that we have another block type - if errors.Is(err, consensus_types.ErrUnsupportedField) { - consensusBlk, err := blk.PbDenebBlock() - if err != nil { - return nil, err - } - if consensusBlk == nil { - return nil, errNilBlock - } - blkInterface, err := blk.ToBlinded() - if err != nil { - return nil, errors.Wrapf(err, "could not convert block to blinded block") - } - blindedConsensusBlk, err = blkInterface.PbBlindedDenebBlock() - if err != nil { - return nil, errors.Wrapf(err, "could not get signed beacon block") - } - } else { - return nil, err - } - } - - if blindedConsensusBlk == nil { - return nil, errNilBlock - } - sszData, err := blindedConsensusBlk.MarshalSSZ() - if err != nil { - return nil, errors.Wrapf(err, "could not marshal block into SSZ") - } - return sszData, nil -} - // GetBlockAttestations retrieves attestation included in requested block. func (s *Server) GetBlockAttestations(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetBlockAttestations") diff --git a/beacon-chain/rpc/lookup/blocker_test.go b/beacon-chain/rpc/lookup/blocker_test.go index 903e931db1a4..93c404ca8cc4 100644 --- a/beacon-chain/rpc/lookup/blocker_test.go +++ b/beacon-chain/rpc/lookup/blocker_test.go @@ -146,8 +146,10 @@ func TestGetBlock(t *testing.T) { return } require.NoError(t, err) - pbBlock, err := result.PbPhase0Block() + pb, err := result.Proto() require.NoError(t, err) + pbBlock, ok := pb.(*ethpbalpha.SignedBeaconBlock) + require.Equal(t, true, ok) if !reflect.DeepEqual(pbBlock, tt.want) { t.Error("Expected blocks to equal") } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go index 0c1145bca135..b6315f886698 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go @@ -13,7 +13,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -90,64 +89,32 @@ func convertToBlockContainer(blk interfaces.ReadOnlySignedBeaconBlock, root [32] Canonical: isCanonical, } - switch blk.Version() { - case version.Phase0: - rBlk, err := blk.PbPhase0Block() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_Phase0Block{Phase0Block: rBlk} - case version.Altair: - rBlk, err := blk.PbAltairBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_AltairBlock{AltairBlock: rBlk} - case version.Bellatrix: - if blk.IsBlinded() { - rBlk, err := blk.PbBlindedBellatrixBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_BlindedBellatrixBlock{BlindedBellatrixBlock: rBlk} - } else { - rBlk, err := blk.PbBellatrixBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_BellatrixBlock{BellatrixBlock: rBlk} - } - case version.Capella: - if blk.IsBlinded() { - rBlk, err := blk.PbBlindedCapellaBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_BlindedCapellaBlock{BlindedCapellaBlock: rBlk} - } else { - rBlk, err := blk.PbCapellaBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_CapellaBlock{CapellaBlock: rBlk} - } - case version.Deneb: - if blk.IsBlinded() { - rBlk, err := blk.PbBlindedDenebBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_BlindedDenebBlock{BlindedDenebBlock: rBlk} - } else { - rBlk, err := blk.PbDenebBlock() - if err != nil { - return nil, err - } - ctr.Block = ðpb.BeaconBlockContainer_DenebBlock{DenebBlock: rBlk} - } + pb, err := blk.Proto() + if err != nil { + return nil, err + } + + switch pbStruct := pb.(type) { + case *ethpb.SignedBeaconBlock: + ctr.Block = ðpb.BeaconBlockContainer_Phase0Block{Phase0Block: pbStruct} + case *ethpb.SignedBeaconBlockAltair: + ctr.Block = ðpb.BeaconBlockContainer_AltairBlock{AltairBlock: pbStruct} + case *ethpb.SignedBlindedBeaconBlockBellatrix: + ctr.Block = ðpb.BeaconBlockContainer_BlindedBellatrixBlock{BlindedBellatrixBlock: pbStruct} + case *ethpb.SignedBeaconBlockBellatrix: + ctr.Block = ðpb.BeaconBlockContainer_BellatrixBlock{BellatrixBlock: pbStruct} + case *ethpb.SignedBlindedBeaconBlockCapella: + ctr.Block = ðpb.BeaconBlockContainer_BlindedCapellaBlock{BlindedCapellaBlock: pbStruct} + case *ethpb.SignedBeaconBlockCapella: + ctr.Block = ðpb.BeaconBlockContainer_CapellaBlock{CapellaBlock: pbStruct} + case *ethpb.SignedBlindedBeaconBlockDeneb: + ctr.Block = ðpb.BeaconBlockContainer_BlindedDenebBlock{BlindedDenebBlock: pbStruct} + case *ethpb.SignedBeaconBlockDeneb: + ctr.Block = ðpb.BeaconBlockContainer_DenebBlock{DenebBlock: pbStruct} default: return nil, errors.Errorf("block type is not recognized: %d", blk.Version()) } + return ctr, nil } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go index 613e8d26e7d7..fb6900d5eed1 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go @@ -265,8 +265,10 @@ func TestServer_ListBeaconBlocks_Genesis(t *testing.T) { assert.NoError(t, err) blinded, err := wrapped.ToBlinded() assert.NoError(t, err) - blindedProto, err := blinded.PbBlindedBellatrixBlock() + pb, err := blinded.Proto() assert.NoError(t, err) + blindedProto, ok := pb.(*ethpb.SignedBlindedBeaconBlockBellatrix) + require.Equal(t, true, ok) blkContainer := ðpb.BeaconBlockContainer{ Block: ðpb.BeaconBlockContainer_BlindedBellatrixBlock{BlindedBellatrixBlock: blindedProto}} runListBlocksGenesis(t, wrapped, blkContainer) @@ -279,7 +281,10 @@ func TestServer_ListBeaconBlocks_Genesis(t *testing.T) { assert.NoError(t, err) blinded, err := wrapped.ToBlinded() assert.NoError(t, err) - blindedProto, err := blinded.PbBlindedCapellaBlock() + pb, err := blinded.Proto() + assert.NoError(t, err) + blindedProto, ok := pb.(*ethpb.SignedBlindedBeaconBlockCapella) + require.Equal(t, true, ok) assert.NoError(t, err) blkContainer := ðpb.BeaconBlockContainer{ Block: ðpb.BeaconBlockContainer_BlindedCapellaBlock{BlindedCapellaBlock: blindedProto}} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go index ca052e431ea3..589f100fd692 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go @@ -61,11 +61,11 @@ func BuildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProo if blk.Version() < version.Deneb { return nil, nil // No blobs before deneb. } - denebBlk, err := blk.PbDenebBlock() + commits, err := blk.Block().Body().BlobKzgCommitments() if err != nil { return nil, err } - cLen := len(denebBlk.Block.Body.BlobKzgCommitments) + cLen := len(commits) if cLen != len(blobs) || cLen != len(kzgProofs) { return nil, errors.New("blob KZG commitments don't match number of blobs or KZG proofs") } @@ -83,7 +83,7 @@ func BuildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProo blobSidecars[i] = ðpb.BlobSidecar{ Index: uint64(i), Blob: blobs[i], - KzgCommitment: denebBlk.Block.Body.BlobKzgCommitments[i], + KzgCommitment: commits[i], KzgProof: kzgProofs[i], SignedBlockHeader: header, CommitmentInclusionProof: proof, diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index d4006244efed..9b754481b3fe 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -23,6 +23,23 @@ type executionPayload struct { p *enginev1.ExecutionPayload } +// NewWrappedExecutionData creates an appropriate execution payload wrapper based on the incoming type. +func NewWrappedExecutionData(v proto.Message, weiValue math.Wei) (interfaces.ExecutionData, error) { + if weiValue == nil { + weiValue = new(big.Int).SetInt64(0) + } + switch pbStruct := v.(type) { + case *enginev1.ExecutionPayload: + return WrappedExecutionPayload(pbStruct) + case *enginev1.ExecutionPayloadCapella: + return WrappedExecutionPayloadCapella(pbStruct, weiValue) + case *enginev1.ExecutionPayloadDeneb: + return WrappedExecutionPayloadDeneb(pbStruct, weiValue) + default: + return nil, ErrUnsupportedVersion + } +} + // WrappedExecutionPayload is a constructor which wraps a protobuf execution payload into an interface. func WrappedExecutionPayload(p *enginev1.ExecutionPayload) (interfaces.ExecutionData, error) { w := executionPayload{p: p} @@ -172,26 +189,6 @@ func (e executionPayload) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// PbBellatrix -- -func (e executionPayload) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return e.p, nil -} - -// PbCapella -- -func (executionPayload) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (executionPayload) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbElectra -- -func (executionPayload) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (executionPayload) ValueInWei() (math.Wei, error) { return nil, consensus_types.ErrUnsupportedField @@ -368,26 +365,6 @@ func (e executionPayloadHeader) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// PbElectra -- -func (e executionPayloadHeader) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (executionPayloadHeader) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (executionPayloadHeader) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbBellatrix -- -func (executionPayloadHeader) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (executionPayloadHeader) ValueInWei() (math.Wei, error) { return nil, consensus_types.ErrUnsupportedField @@ -594,26 +571,6 @@ func (e executionPayloadCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// PbElectra -- -func (executionPayloadCapella) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (executionPayloadCapella) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (e executionPayloadCapella) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return e.p, nil -} - -// PbBellatrix -- -func (executionPayloadCapella) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (e executionPayloadCapella) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -792,26 +749,6 @@ func (e executionPayloadHeaderCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// PbElectra -- -func (executionPayloadHeaderCapella) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (executionPayloadHeaderCapella) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (executionPayloadHeaderCapella) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbBellatrix -- -func (executionPayloadHeaderCapella) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (e executionPayloadHeaderCapella) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -1221,26 +1158,6 @@ func (e executionPayloadHeaderDeneb) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// PbElectra -- -func (executionPayloadHeaderDeneb) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (executionPayloadHeaderDeneb) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbBellatrix -- -func (executionPayloadHeaderDeneb) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (executionPayloadHeaderDeneb) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (e executionPayloadHeaderDeneb) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -1417,26 +1334,6 @@ func (e executionPayloadDeneb) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// PbBellatrix -- -func (e executionPayloadDeneb) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (e executionPayloadDeneb) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (e executionPayloadDeneb) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return e.p, nil -} - -// PbElectra -- -func (e executionPayloadDeneb) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (e executionPayloadDeneb) ValueInWei() (math.Wei, error) { return e.weiValue, nil diff --git a/consensus-types/blocks/execution_test.go b/consensus-types/blocks/execution_test.go index edcb1c512dd6..f9dc7cc5e75e 100644 --- a/consensus-types/blocks/execution_test.go +++ b/consensus-types/blocks/execution_test.go @@ -211,44 +211,6 @@ func TestWrapExecutionPayloadHeaderCapella_SSZ(t *testing.T) { assert.NoError(t, payload.UnmarshalSSZ(encoded)) } -func Test_executionPayload_Pb(t *testing.T) { - payload := createWrappedPayload(t) - pb, err := payload.PbBellatrix() - require.NoError(t, err) - assert.DeepEqual(t, payload.Proto(), pb) - - _, err = payload.PbCapella() - require.ErrorIs(t, err, consensus_types.ErrUnsupportedField) -} - -func Test_executionPayloadHeader_Pb(t *testing.T) { - payload := createWrappedPayloadHeader(t) - _, err := payload.PbBellatrix() - require.ErrorIs(t, err, consensus_types.ErrUnsupportedField) - - _, err = payload.PbCapella() - require.ErrorIs(t, err, consensus_types.ErrUnsupportedField) -} - -func Test_executionPayloadCapella_Pb(t *testing.T) { - payload := createWrappedPayloadCapella(t) - pb, err := payload.PbCapella() - require.NoError(t, err) - assert.DeepEqual(t, payload.Proto(), pb) - - _, err = payload.PbBellatrix() - require.ErrorIs(t, err, consensus_types.ErrUnsupportedField) -} - -func Test_executionPayloadHeaderCapella_Pb(t *testing.T) { - payload := createWrappedPayloadHeaderCapella(t) - _, err := payload.PbBellatrix() - require.ErrorIs(t, err, consensus_types.ErrUnsupportedField) - - _, err = payload.PbCapella() - require.ErrorIs(t, err, consensus_types.ErrUnsupportedField) -} - func TestWrapExecutionPayloadDeneb(t *testing.T) { data := &enginev1.ExecutionPayloadDeneb{ ParentHash: []byte("parenthash"), diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 4cc0f2c20398..2f737e80dbd0 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -150,102 +150,6 @@ func (b *SignedBeaconBlock) PbGenericBlock() (*eth.GenericSignedBeaconBlock, err } } -// PbPhase0Block returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbPhase0Block() (*eth.SignedBeaconBlock, error) { - if b.version != version.Phase0 { - return nil, consensus_types.ErrNotSupported("PbPhase0Block", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBeaconBlock), nil -} - -// PbAltairBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbAltairBlock() (*eth.SignedBeaconBlockAltair, error) { - if b.version != version.Altair { - return nil, consensus_types.ErrNotSupported("PbAltairBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBeaconBlockAltair), nil -} - -// PbBellatrixBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbBellatrixBlock() (*eth.SignedBeaconBlockBellatrix, error) { - if b.version != version.Bellatrix || b.IsBlinded() { - return nil, consensus_types.ErrNotSupported("PbBellatrixBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBeaconBlockBellatrix), nil -} - -// PbBlindedBellatrixBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbBlindedBellatrixBlock() (*eth.SignedBlindedBeaconBlockBellatrix, error) { - if b.version != version.Bellatrix || !b.IsBlinded() { - return nil, consensus_types.ErrNotSupported("PbBlindedBellatrixBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBlindedBeaconBlockBellatrix), nil -} - -// PbCapellaBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbCapellaBlock() (*eth.SignedBeaconBlockCapella, error) { - if b.version != version.Capella || b.IsBlinded() { - return nil, consensus_types.ErrNotSupported("PbCapellaBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBeaconBlockCapella), nil -} - -// PbBlindedCapellaBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbBlindedCapellaBlock() (*eth.SignedBlindedBeaconBlockCapella, error) { - if b.version != version.Capella || !b.IsBlinded() { - return nil, consensus_types.ErrNotSupported("PbBlindedCapellaBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBlindedBeaconBlockCapella), nil -} - -// PbDenebBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbDenebBlock() (*eth.SignedBeaconBlockDeneb, error) { - if b.version != version.Deneb || b.IsBlinded() { - return nil, consensus_types.ErrNotSupported("PbDenebBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBeaconBlockDeneb), nil -} - -// PbBlindedDenebBlock returns the underlying protobuf object. -func (b *SignedBeaconBlock) PbBlindedDenebBlock() (*eth.SignedBlindedBeaconBlockDeneb, error) { - if b.version != version.Deneb || !b.IsBlinded() { - return nil, consensus_types.ErrNotSupported("PbBlindedDenebBlock", b.version) - } - pb, err := b.Proto() - if err != nil { - return nil, err - } - return pb.(*eth.SignedBlindedBeaconBlockDeneb), nil -} - // ToBlinded converts a non-blinded block to its blinded equivalent. func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, error) { if b.version < version.Bellatrix { diff --git a/consensus-types/blocks/testing/BUILD.bazel b/consensus-types/blocks/testing/BUILD.bazel index e9ef642c4a39..32cb182180b0 100644 --- a/consensus-types/blocks/testing/BUILD.bazel +++ b/consensus-types/blocks/testing/BUILD.bazel @@ -14,7 +14,6 @@ go_library( "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/consensus-types/blocks/testing/mutator.go b/consensus-types/blocks/testing/mutator.go index 9a7be2bb881e..23178b31510b 100644 --- a/consensus-types/blocks/testing/mutator.go +++ b/consensus-types/blocks/testing/mutator.go @@ -5,7 +5,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/runtime/version" ) type blockMutator struct { @@ -16,38 +15,23 @@ type blockMutator struct { } func (m blockMutator) apply(b interfaces.SignedBeaconBlock) (interfaces.SignedBeaconBlock, error) { - switch b.Version() { - case version.Phase0: - bb, err := b.PbPhase0Block() - if err != nil { - return nil, err - } - m.Phase0(bb) - return blocks.NewSignedBeaconBlock(bb) - case version.Altair: - bb, err := b.PbAltairBlock() - if err != nil { - return nil, err - } - m.Altair(bb) - return blocks.NewSignedBeaconBlock(bb) - case version.Bellatrix: - bb, err := b.PbBellatrixBlock() - if err != nil { - return nil, err - } - m.Bellatrix(bb) - return blocks.NewSignedBeaconBlock(bb) - case version.Capella: - bb, err := b.PbCapellaBlock() - if err != nil { - return nil, err - } - m.Capella(bb) - return blocks.NewSignedBeaconBlock(bb) + pb, err := b.Proto() + if err != nil { + return nil, err + } + switch pbStruct := pb.(type) { + case *eth.SignedBeaconBlock: + m.Phase0(pbStruct) + case *eth.SignedBeaconBlockAltair: + m.Altair(pbStruct) + case *eth.SignedBeaconBlockBellatrix: + m.Bellatrix(pbStruct) + case *eth.SignedBeaconBlockCapella: + m.Capella(pbStruct) default: return nil, blocks.ErrUnsupportedSignedBeaconBlock } + return blocks.NewSignedBeaconBlock(pb) } // SetBlockStateRoot modifies the block's state root. diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 08cc1ef88d01..06d427b62805 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -21,15 +21,7 @@ type ReadOnlySignedBeaconBlock interface { Copy() (SignedBeaconBlock, error) Proto() (proto.Message, error) PbGenericBlock() (*ethpb.GenericSignedBeaconBlock, error) - PbPhase0Block() (*ethpb.SignedBeaconBlock, error) - PbAltairBlock() (*ethpb.SignedBeaconBlockAltair, error) ToBlinded() (ReadOnlySignedBeaconBlock, error) - PbBellatrixBlock() (*ethpb.SignedBeaconBlockBellatrix, error) - PbBlindedBellatrixBlock() (*ethpb.SignedBlindedBeaconBlockBellatrix, error) - PbCapellaBlock() (*ethpb.SignedBeaconBlockCapella, error) - PbDenebBlock() (*ethpb.SignedBeaconBlockDeneb, error) - PbBlindedCapellaBlock() (*ethpb.SignedBlindedBeaconBlockCapella, error) - PbBlindedDenebBlock() (*ethpb.SignedBlindedBeaconBlockDeneb, error) ssz.Marshaler ssz.Unmarshaler Version() int @@ -131,10 +123,6 @@ type ExecutionData interface { TransactionsRoot() ([]byte, error) Withdrawals() ([]*enginev1.Withdrawal, error) WithdrawalsRoot() ([]byte, error) - PbCapella() (*enginev1.ExecutionPayloadCapella, error) - PbBellatrix() (*enginev1.ExecutionPayload, error) - PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) - PbElectra() (*enginev1.ExecutionPayloadElectra, error) ValueInWei() (math.Wei, error) ValueInGwei() (uint64, error) DepositReceipts() ([]*enginev1.DepositReceipt, error) diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index 452c8720d55f..6c9909e595e8 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -43,38 +43,6 @@ func (SignedBeaconBlock) Proto() (proto.Message, error) { panic("implement me") } -func (SignedBeaconBlock) PbPhase0Block() (*eth.SignedBeaconBlock, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbAltairBlock() (*eth.SignedBeaconBlockAltair, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbBellatrixBlock() (*eth.SignedBeaconBlockBellatrix, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbBlindedBellatrixBlock() (*eth.SignedBlindedBeaconBlockBellatrix, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbCapellaBlock() (*eth.SignedBeaconBlockCapella, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbBlindedCapellaBlock() (*eth.SignedBlindedBeaconBlockCapella, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbDenebBlock() (*eth.SignedBeaconBlockDeneb, error) { - panic("implement me") -} - -func (SignedBeaconBlock) PbBlindedDenebBlock() (*eth.SignedBlindedBeaconBlockDeneb, error) { - panic("implement me") -} - func (SignedBeaconBlock) MarshalSSZTo(_ []byte) ([]byte, error) { panic("implement me") } diff --git a/testing/middleware/builder/builder.go b/testing/middleware/builder/builder.go index 88ce400bce90..1543dd47e905 100644 --- a/testing/middleware/builder/builder.go +++ b/testing/middleware/builder/builder.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "math/big" "net" "net/http" @@ -152,7 +151,7 @@ func New(opts ...Option) (*Builder, error) { router.HandleFunc(registerPath, p.registerValidators) router.HandleFunc(headerPath, p.handleHeaderRequest) router.HandleFunc(blindedPath, p.handleBlindedBlock) - addr := fmt.Sprintf("%s:%d", p.cfg.builderHost, p.cfg.builderPort) + addr := net.JoinHostPort(p.cfg.builderHost, strconv.Itoa(p.cfg.builderPort)) srv := &http.Server{ Handler: mux, Addr: addr, @@ -268,7 +267,7 @@ func (p *Builder) handleEngineCalls(req, resp []byte) { } payloadID := [8]byte{} status := "" - lastValHash := []byte{} + var lastValHash []byte if result.Result.PayloadId != nil { payloadID = *result.Result.PayloadId } @@ -280,7 +279,7 @@ func (p *Builder) handleEngineCalls(req, resp []byte) { } } -func (p *Builder) isBuilderCall(req *http.Request) bool { +func (*Builder) isBuilderCall(req *http.Request) bool { return strings.Contains(req.URL.Path, "/eth/v1/builder/") } @@ -523,7 +522,7 @@ func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) { return } val := builderAPI.Uint256{Int: v} - commitments := []hexutil.Bytes{} + var commitments []hexutil.Bytes for _, c := range b.BlobsBundle.KzgCommitments { copiedC := c commitments = append(commitments, copiedC) @@ -592,66 +591,14 @@ func (p *Builder) handleBlindedBlock(w http.ResponseWriter, req *http.Request) { http.Error(w, "payload not found", http.StatusInternalServerError) return } - if payload, err := p.currPayload.PbDeneb(); err == nil { - convertedPayload, err := builderAPI.FromProtoDeneb(payload) - if err != nil { - p.cfg.logger.WithError(err).Error("Could not convert the payload") - http.Error(w, "payload not found", http.StatusInternalServerError) - return - } - execResp := &builderAPI.ExecPayloadResponseDeneb{ - Version: "deneb", - Data: &builderAPI.ExecutionPayloadDenebAndBlobsBundle{ - ExecutionPayload: &convertedPayload, - BlobsBundle: builderAPI.FromBundleProto(p.blobBundle), - }, - } - err = json.NewEncoder(w).Encode(execResp) - if err != nil { - p.cfg.logger.WithError(err).Error("Could not encode full payload response") - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.WriteHeader(http.StatusOK) - return - } - if payload, err := p.currPayload.PbCapella(); err == nil { - convertedPayload, err := builderAPI.FromProtoCapella(payload) - if err != nil { - p.cfg.logger.WithError(err).Error("Could not convert the payload") - http.Error(w, "payload not found", http.StatusInternalServerError) - return - } - execResp := &builderAPI.ExecPayloadResponseCapella{ - Version: "capella", - Data: convertedPayload, - } - err = json.NewEncoder(w).Encode(execResp) - if err != nil { - p.cfg.logger.WithError(err).Error("Could not encode full payload response") - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.WriteHeader(http.StatusOK) - return - } - bellPayload, err := p.currPayload.PbBellatrix() - if err != nil { - p.cfg.logger.WithError(err).Error("Could not retrieve the payload") - http.Error(w, "payload not found", http.StatusInternalServerError) - return - } - convertedPayload, err := builderAPI.FromProto(bellPayload) + + resp, err := builderAPI.ExecutionPayloadResponseFromData(p.currPayload, p.blobBundle) if err != nil { p.cfg.logger.WithError(err).Error("Could not convert the payload") - http.Error(w, "payload not found", http.StatusInternalServerError) + http.Error(w, err.Error(), http.StatusInternalServerError) return } - execResp := &builderAPI.ExecPayloadResponse{ - Version: "bellatrix", - Data: convertedPayload, - } - err = json.NewEncoder(w).Encode(execResp) + err = json.NewEncoder(w).Encode(resp) if err != nil { p.cfg.logger.WithError(err).Error("Could not encode full payload response") http.Error(w, err.Error(), http.StatusInternalServerError) @@ -747,7 +694,7 @@ func (p *Builder) sendHttpRequest(req *http.Request, requestBytes []byte) (*http } // Set the modified request as the proxy request body. - proxyReq.Body = ioutil.NopCloser(bytes.NewBuffer(requestBytes)) + proxyReq.Body = io.NopCloser(bytes.NewBuffer(requestBytes)) // Required proxy headers for forwarding JSON-RPC requests to the execution client. proxyReq.Header.Set("Host", req.Host) @@ -768,14 +715,14 @@ func (p *Builder) sendHttpRequest(req *http.Request, requestBytes []byte) (*http // Peek into the bytes of an HTTP request's body. func parseRequestBytes(req *http.Request) ([]byte, error) { - requestBytes, err := ioutil.ReadAll(req.Body) + requestBytes, err := io.ReadAll(req.Body) if err != nil { return nil, err } if err = req.Body.Close(); err != nil { return nil, err } - req.Body = ioutil.NopCloser(bytes.NewBuffer(requestBytes)) + req.Body = io.NopCloser(bytes.NewBuffer(requestBytes)) return requestBytes, nil } diff --git a/validator/client/propose.go b/validator/client/propose.go index 12779137f0ad..986f1e66f1fe 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -128,11 +128,16 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK var genericSignedBlock *ethpb.GenericSignedBeaconBlock if blk.Version() >= version.Deneb && !blk.IsBlinded() { - denebBlock, err := blk.PbDenebBlock() + pb, err := blk.Proto() if err != nil { log.WithError(err).Error("Failed to get deneb block") return } + denebBlock, ok := pb.(*ethpb.SignedBeaconBlockDeneb) + if !ok { + log.WithError(err).Error("Failed to get deneb block - assertion failure") + return + } genericSignedBlock = ðpb.GenericSignedBeaconBlock{ Block: ðpb.GenericSignedBeaconBlock_Deneb{ Deneb: ðpb.SignedBeaconBlockContentsDeneb{ From 80bff0dc2d1e9ad655db7287320afca06fbf20cd Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Fri, 3 May 2024 12:12:27 -0500 Subject: [PATCH 066/325] Fork-specific consensus-types interfaces (#13948) * fork-specific interface for electra * add electra to wrapped payload switch * use electra body in block factory * deepsource * rm pb getters from electra payload --------- Co-authored-by: Kasey Kirkham --- consensus-types/blocks/execution.go | 158 +++++---------------- consensus-types/blocks/factory.go | 7 +- consensus-types/blocks/factory_test.go | 24 ++++ consensus-types/blocks/getters.go | 14 +- consensus-types/blocks/getters_test.go | 6 + consensus-types/blocks/types.go | 3 + consensus-types/interfaces/BUILD.bazel | 12 +- consensus-types/interfaces/beacon_block.go | 17 ++- consensus-types/interfaces/cast.go | 15 ++ consensus-types/interfaces/error.go | 27 ++++ consensus-types/interfaces/error_test.go | 14 ++ consensus-types/mock/block.go | 4 +- 12 files changed, 158 insertions(+), 143 deletions(-) create mode 100644 consensus-types/interfaces/cast.go create mode 100644 consensus-types/interfaces/error.go create mode 100644 consensus-types/interfaces/error_test.go diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index 9b754481b3fe..08cc5aeabf6d 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -35,11 +35,15 @@ func NewWrappedExecutionData(v proto.Message, weiValue math.Wei) (interfaces.Exe return WrappedExecutionPayloadCapella(pbStruct, weiValue) case *enginev1.ExecutionPayloadDeneb: return WrappedExecutionPayloadDeneb(pbStruct, weiValue) + case *enginev1.ExecutionPayloadElectra: + return WrappedExecutionPayloadElectra(pbStruct, weiValue) default: return nil, ErrUnsupportedVersion } } +var _ interfaces.ExecutionData = &executionPayload{} + // WrappedExecutionPayload is a constructor which wraps a protobuf execution payload into an interface. func WrappedExecutionPayload(p *enginev1.ExecutionPayload) (interfaces.ExecutionData, error) { w := executionPayload{p: p} @@ -199,16 +203,6 @@ func (executionPayload) ValueInGwei() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// DepositReceipts -- -func (e executionPayload) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayload) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - // executionPayloadHeader is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -216,6 +210,8 @@ type executionPayloadHeader struct { p *enginev1.ExecutionPayloadHeader } +var _ interfaces.ExecutionData = &executionPayloadHeader{} + // WrappedExecutionPayloadHeader is a constructor which wraps a protobuf execution header into an interface. func WrappedExecutionPayloadHeader(p *enginev1.ExecutionPayloadHeader) (interfaces.ExecutionData, error) { w := executionPayloadHeader{p: p} @@ -375,16 +371,6 @@ func (executionPayloadHeader) ValueInGwei() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// DepositReceipts -- -func (e executionPayloadHeader) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayloadHeader) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - // PayloadToHeader converts `payload` into execution payload header format. func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeader, error) { txs, err := payload.Transactions() @@ -422,6 +408,8 @@ type executionPayloadCapella struct { gweiValue uint64 } +var _ interfaces.ExecutionData = &executionPayloadCapella{} + // WrappedExecutionPayloadCapella is a constructor which wraps a protobuf execution payload into an interface. func WrappedExecutionPayloadCapella(p *enginev1.ExecutionPayloadCapella, value math.Wei) (interfaces.ExecutionData, error) { w := executionPayloadCapella{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} @@ -581,16 +569,6 @@ func (e executionPayloadCapella) ValueInGwei() (uint64, error) { return e.gweiValue, nil } -// DepositReceipts -- -func (e executionPayloadCapella) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayloadCapella) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - // executionPayloadHeaderCapella is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -600,6 +578,8 @@ type executionPayloadHeaderCapella struct { gweiValue uint64 } +var _ interfaces.ExecutionData = &executionPayloadHeaderCapella{} + // WrappedExecutionPayloadHeaderCapella is a constructor which wraps a protobuf execution header into an interface. func WrappedExecutionPayloadHeaderCapella(p *enginev1.ExecutionPayloadHeaderCapella, value math.Wei) (interfaces.ExecutionData, error) { w := executionPayloadHeaderCapella{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} @@ -759,16 +739,6 @@ func (e executionPayloadHeaderCapella) ValueInGwei() (uint64, error) { return e.gweiValue, nil } -// DepositReceipts -- -func (e executionPayloadHeaderCapella) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayloadHeaderCapella) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - // PayloadToHeaderCapella converts `payload` into execution payload header format. func PayloadToHeaderCapella(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderCapella, error) { txs, err := payload.Transactions() @@ -856,7 +826,7 @@ func PayloadToHeaderDeneb(payload interfaces.ExecutionData) (*enginev1.Execution } // PayloadToHeaderElectra converts `payload` into execution payload header format. -func PayloadToHeaderElectra(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderElectra, error) { +func PayloadToHeaderElectra(payload interfaces.ExecutionDataElectra) (*enginev1.ExecutionPayloadHeaderElectra, error) { txs, err := payload.Transactions() if err != nil { return nil, err @@ -882,18 +852,13 @@ func PayloadToHeaderElectra(payload interfaces.ExecutionData) (*enginev1.Executi return nil, err } - depositReceipts, err := payload.DepositReceipts() - if err != nil { - return nil, err - } + depositReceipts := payload.DepositReceipts() depositReceiptsRoot, err := ssz.DepositReceiptSliceRoot(depositReceipts, fieldparams.MaxDepositReceiptsPerPayload) if err != nil { return nil, err } - withdrawalRequests, err := payload.WithdrawalRequests() - if err != nil { - return nil, err - } + + withdrawalRequests := payload.WithdrawalRequests() withdrawalRequestsRoot, err := ssz.WithdrawalRequestSliceRoot(withdrawalRequests, fieldparams.MaxWithdrawalRequestsPerPayload) if err != nil { return nil, err @@ -980,23 +945,14 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { return false, nil } - drs, err := data.DepositReceipts() - switch { - case errors.Is(err, consensus_types.ErrUnsupportedField): - case err != nil: - return false, err - default: + epe, postElectra := data.(interfaces.ExecutionDataElectra) + if postElectra { + drs := epe.DepositReceipts() if len(drs) != 0 { return false, nil } - } - wrs, err := data.WithdrawalRequests() - switch { - case errors.Is(err, consensus_types.ErrUnsupportedField): - case err != nil: - return false, err - default: + wrs := epe.WithdrawalRequests() if len(wrs) != 0 { return false, nil } @@ -1014,6 +970,8 @@ type executionPayloadHeaderDeneb struct { gweiValue uint64 } +var _ interfaces.ExecutionData = &executionPayloadHeaderDeneb{} + // WrappedExecutionPayloadHeaderDeneb is a constructor which wraps a protobuf execution header into an interface. func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb, value math.Wei) (interfaces.ExecutionData, error) { w := executionPayloadHeaderDeneb{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} @@ -1168,16 +1126,6 @@ func (e executionPayloadHeaderDeneb) ValueInGwei() (uint64, error) { return e.gweiValue, nil } -// DepositReceipts -- -func (e executionPayloadHeaderDeneb) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayloadHeaderDeneb) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadHeaderDeneb) IsBlinded() bool { return true @@ -1192,6 +1140,8 @@ type executionPayloadDeneb struct { gweiValue uint64 } +var _ interfaces.ExecutionData = &executionPayloadDeneb{} + // WrappedExecutionPayloadDeneb is a constructor which wraps a protobuf execution payload into an interface. func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb, value math.Wei) (interfaces.ExecutionData, error) { w := executionPayloadDeneb{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} @@ -1344,16 +1294,6 @@ func (e executionPayloadDeneb) ValueInGwei() (uint64, error) { return e.gweiValue, nil } -// DepositReceipts -- -func (e executionPayloadDeneb) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayloadDeneb) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadDeneb) IsBlinded() bool { return false @@ -1368,6 +1308,9 @@ type executionPayloadHeaderElectra struct { gweiValue uint64 } +var _ interfaces.ExecutionData = &executionPayloadElectra{} +var _ interfaces.ExecutionDataElectra = &executionPayloadElectra{} + // WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra, value math.Wei) (interfaces.ExecutionData, error) { w := executionPayloadHeaderElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} @@ -1512,26 +1455,6 @@ func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// PbElectra -- -func (e executionPayloadHeaderElectra) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (executionPayloadHeaderElectra) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbBellatrix -- -func (executionPayloadHeaderElectra) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (executionPayloadHeaderElectra) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - // ValueInWei -- func (e executionPayloadHeaderElectra) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -1575,6 +1498,9 @@ func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra, value m return w, nil } +var _ interfaces.ExecutionData = &executionPayloadElectra{} +var _ interfaces.ExecutionDataElectra = &executionPayloadElectra{} + // IsNil checks if the underlying data is nil. func (e executionPayloadElectra) IsNil() bool { return e.p == nil @@ -1708,26 +1634,6 @@ func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// PbBellatrix -- -func (e executionPayloadElectra) PbBellatrix() (*enginev1.ExecutionPayload, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbCapella -- -func (e executionPayloadElectra) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbDeneb -- -func (e executionPayloadElectra) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// PbElectra -- -func (e executionPayloadElectra) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { - return e.p, nil -} - // ValueInWei -- func (e executionPayloadElectra) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -1739,13 +1645,13 @@ func (e executionPayloadElectra) ValueInGwei() (uint64, error) { } // DepositReceipts -- -func (e executionPayloadElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { - return e.p.DepositReceipts, nil +func (e executionPayloadElectra) DepositReceipts() []*enginev1.DepositReceipt { + return e.p.DepositReceipts } // WithdrawalRequests -- -func (e executionPayloadElectra) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { - return e.p.WithdrawalRequests, nil +func (e executionPayloadElectra) WithdrawalRequests() []*enginev1.ExecutionLayerWithdrawalRequest { + return e.p.WithdrawalRequests } // IsBlinded returns true if the underlying data is blinded. diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index 80d266a45e15..b7a1c826b118 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -460,10 +460,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea if err != nil { return nil, err } - consolidations, err := b.Body().Consolidations() - if err != nil { - return nil, err + electraBody, ok := b.Body().(interfaces.ROBlockBodyElectra) + if !ok { + return nil, errors.Wrapf(interfaces.ErrInvalidCast, "%T does not support electra getters", b.Body()) } + consolidations := electraBody.Consolidations() var atts []*eth.AttestationElectra if b.Body().Attestations() != nil { atts = make([]*eth.AttestationElectra, len(b.Body().Attestations())) diff --git a/consensus-types/blocks/factory_test.go b/consensus-types/blocks/factory_test.go index 2d9dc92c22ea..80a4a4f4f187 100644 --- a/consensus-types/blocks/factory_test.go +++ b/consensus-types/blocks/factory_test.go @@ -7,6 +7,7 @@ import ( "testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -537,3 +538,26 @@ func TestBuildSignedBeaconBlockFromExecutionPayload(t *testing.T) { require.DeepEqual(t, uint64(321), payload.BlobGasUsed) }) } + +func TestElectraBlockBodyCast(t *testing.T) { + t.Run("deneb cast fails", func(t *testing.T) { + pb := ð.BeaconBlockBodyDeneb{} + i, err := NewBeaconBlockBody(pb) + require.NoError(t, err) + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + assert.Equal(t, version.Deneb, b.version) + _, err = interfaces.AsROBlockBodyElectra(b) + require.ErrorIs(t, err, interfaces.ErrInvalidCast) + }) + t.Run("electra cast succeeds", func(t *testing.T) { + pb := ð.BeaconBlockBodyElectra{} + i, err := NewBeaconBlockBody(pb) + require.NoError(t, err) + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + assert.Equal(t, version.Electra, b.version) + _, err = interfaces.AsROBlockBodyElectra(b) + require.NoError(t, err) + }) +} diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 2f737e80dbd0..e45e2f7dbe90 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -252,7 +252,11 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e Signature: b.signature[:], }) case *enginev1.ExecutionPayloadElectra: - header, err := PayloadToHeaderElectra(payload) + pe, ok := payload.(interfaces.ExecutionDataElectra) + if !ok { + return nil, interfaces.ErrIncompatibleFork + } + header, err := PayloadToHeaderElectra(pe) if err != nil { return nil, err } @@ -281,7 +285,6 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e }, Signature: b.signature[:], }) - default: return nil, fmt.Errorf("%T is not an execution payload header", p) } @@ -1170,11 +1173,8 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { } } -func (b *BeaconBlockBody) Consolidations() ([]*eth.SignedConsolidation, error) { - if b.version < version.Electra { - return nil, consensus_types.ErrNotSupported("Consolidations", b.version) - } - return b.signedConsolidations, nil +func (b *BeaconBlockBody) Consolidations() []*eth.SignedConsolidation { + return b.signedConsolidations } // Version returns the version of the beacon block body diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index 22c2fd63dde8..95d9bc177d72 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -490,3 +490,9 @@ func hydrateBeaconBlockBody() *eth.BeaconBlockBody { }, } } + +func TestPreElectraFailsInterfaceAssertion(t *testing.T) { + var epd interfaces.ExecutionData = &executionPayloadDeneb{} + _, ok := epd.(interfaces.ExecutionDataElectra) + require.Equal(t, false, ok) +} diff --git a/consensus-types/blocks/types.go b/consensus-types/blocks/types.go index c6216b1d593c..b450ede83332 100644 --- a/consensus-types/blocks/types.go +++ b/consensus-types/blocks/types.go @@ -57,6 +57,9 @@ type BeaconBlockBody struct { signedConsolidations []*eth.SignedConsolidation } +var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{} +var _ interfaces.ROBlockBodyElectra = &BeaconBlockBody{} + // BeaconBlock is the main beacon block structure. It can represent any block type. type BeaconBlock struct { version int diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index 84eb1c643fa2..6dbc9a37a043 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -4,6 +4,8 @@ go_library( name = "go_default_library", srcs = [ "beacon_block.go", + "cast.go", + "error.go", "utils.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces", @@ -15,6 +17,7 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", + "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", @@ -24,14 +27,19 @@ go_library( go_test( name = "go_default_test", - srcs = ["utils_test.go"], + srcs = [ + "error_test.go", + "utils_test.go", + ], + embed = [":go_default_library"], deps = [ - ":go_default_library", "//config/fieldparams:go_default_library", "//consensus-types/blocks:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", + "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 06d427b62805..3eae02c6956f 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -1,6 +1,7 @@ package interfaces import ( + "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -12,6 +13,8 @@ import ( "google.golang.org/protobuf/proto" ) +var ErrIncompatibleFork = errors.New("Can't convert to fork-specific interface") + // ReadOnlySignedBeaconBlock is an interface describing the method set of // a signed beacon block. type ReadOnlySignedBeaconBlock interface { @@ -70,7 +73,11 @@ type ReadOnlyBeaconBlockBody interface { Execution() (ExecutionData, error) BLSToExecutionChanges() ([]*ethpb.SignedBLSToExecutionChange, error) BlobKzgCommitments() ([][]byte, error) - Consolidations() ([]*ethpb.SignedConsolidation, error) +} + +type ROBlockBodyElectra interface { + ReadOnlyBeaconBlockBody + Consolidations() []*ethpb.SignedConsolidation } type SignedBeaconBlock interface { @@ -125,8 +132,12 @@ type ExecutionData interface { WithdrawalsRoot() ([]byte, error) ValueInWei() (math.Wei, error) ValueInGwei() (uint64, error) - DepositReceipts() ([]*enginev1.DepositReceipt, error) - WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) +} + +type ExecutionDataElectra interface { + ExecutionData + DepositReceipts() []*enginev1.DepositReceipt + WithdrawalRequests() []*enginev1.ExecutionLayerWithdrawalRequest } type Attestation interface { diff --git a/consensus-types/interfaces/cast.go b/consensus-types/interfaces/cast.go new file mode 100644 index 000000000000..29f0c7a83082 --- /dev/null +++ b/consensus-types/interfaces/cast.go @@ -0,0 +1,15 @@ +package interfaces + +import "github.com/prysmaticlabs/prysm/v5/runtime/version" + +// AsROBlockBodyElectra safely asserts the ReadOnlyBeaconBlockBody to a ROBlockBodyElectra. +// This allows the caller to access methods on the block body which are only available on values after +// the Electra hard fork. If the value is for an earlier fork (based on comparing its Version() to the electra version) +// an error will be returned. Callers that want to conditionally process electra data can check for this condition +// and safely ignore it like `if err != nil && errors.Is(interfaces.ErrInvalidCast) {` +func AsROBlockBodyElectra(in ReadOnlyBeaconBlockBody) (ROBlockBodyElectra, error) { + if in.Version() >= version.Electra { + return in.(ROBlockBodyElectra), nil + } + return nil, NewInvalidCastError(in.Version(), version.Electra) +} diff --git a/consensus-types/interfaces/error.go b/consensus-types/interfaces/error.go new file mode 100644 index 000000000000..98d9da5a1781 --- /dev/null +++ b/consensus-types/interfaces/error.go @@ -0,0 +1,27 @@ +package interfaces + +import ( + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +var ErrInvalidCast = errors.New("unable to cast between types") + +type InvalidCastError struct { + from int + to int +} + +func (e *InvalidCastError) Error() string { + return errors.Wrapf(ErrInvalidCast, + "from=%s(%d), to=%s(%d)", version.String(e.from), e.from, version.String(e.to), e.to). + Error() +} + +func (*InvalidCastError) Is(err error) bool { + return errors.Is(err, ErrInvalidCast) +} + +func NewInvalidCastError(from, to int) *InvalidCastError { + return &InvalidCastError{from: from, to: to} +} diff --git a/consensus-types/interfaces/error_test.go b/consensus-types/interfaces/error_test.go new file mode 100644 index 000000000000..4bac169a255b --- /dev/null +++ b/consensus-types/interfaces/error_test.go @@ -0,0 +1,14 @@ +package interfaces + +import ( + "testing" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestNewInvalidCastError(t *testing.T) { + err := NewInvalidCastError(version.Phase0, version.Electra) + require.Equal(t, true, errors.Is(err, ErrInvalidCast)) +} diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index 6c9909e595e8..846eb42618bf 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -284,8 +284,7 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { panic("implement me") } - -func (b *BeaconBlockBody) Consolidations() ([]*eth.SignedConsolidation, error) { +func (b *BeaconBlockBody) Consolidations() []*eth.SignedConsolidation { panic("implement me") } @@ -296,3 +295,4 @@ func (b *BeaconBlockBody) Version() int { var _ interfaces.ReadOnlySignedBeaconBlock = &SignedBeaconBlock{} var _ interfaces.ReadOnlyBeaconBlock = &BeaconBlock{} var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{} +var _ interfaces.ROBlockBodyElectra = &BeaconBlockBody{} From 26355768a010206dd256758b6a4c1967033d7918 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 3 May 2024 13:53:46 -0500 Subject: [PATCH 067/325] Spectest: v1.5.0-alpha.1 (#13934) * Update spectests to v1.5.0-alpha.1 * Add PeerDAS config change --- WORKSPACE | 10 +++++----- beacon-chain/rpc/eth/config/handlers_test.go | 5 ++++- config/params/config.go | 3 ++- config/params/mainnet_config.go | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index a5ef0bb3039a..da7bd4d6f0a8 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-alpha.0" +consensus_spec_version = "v1.5.0-alpha.1" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - sha256 = "33c5547772b6d8d6f041dff7e7d26b0358c2392daed34394a3aa81147812a81c", + integrity = "sha256-bvbgNjfVVsqt3oGjfdsxXyfn33wq1Xwv1OlrVBXEea4=", 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"], ) """, - sha256 = "06f286199cf2fedd4700487fb8feb0904e0ae18daaa4b3f70ea430ca9c388167", + integrity = "sha256-6yhbVIiyE0GiLci9jYRFbq1dHhLxYiS4xnw+ZLE3XQ0=", 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"], ) """, - sha256 = "5f2a4452b323075eba6bf950003f7d91fd04ebcbde5bd087beafb5d6f6325ad4", + integrity = "sha256-Z3OBOudJhD1C1/1lpCu5ShiaLxq1QgXKs5ncLz537SY=", 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"], ) """, - sha256 = "fd7e83e8cbeb3e297f2aeb93776305f7d606272c97834d8d9be673984501ed36", + integrity = "sha256-+uaqIfJ7c2Uu+vQU5eYSzacEEWe1AixWWISycDU5ak4=", 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/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index b269349c3960..813cc7de5aae 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -148,6 +148,7 @@ func TestGetSpec(t *testing.T) { config.MaxAttesterSlashingsElectra = 88 config.MaxAttestationsElectra = 89 config.MaxWithdrawalRequestsPerPayload = 90 + config.MaxCellsInExtendedMatrix = 91 var dbp [4]byte copy(dbp[:], []byte{'0', '0', '0', '1'}) @@ -190,7 +191,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 152, len(data)) + assert.Equal(t, 153, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -521,6 +522,8 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "89", v) case "MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD": assert.Equal(t, "90", v) + case "MAX_CELLS_IN_EXTENDED_MATRIX": + assert.Equal(t, "91", v) default: t.Errorf("Incorrect key: %s", k) } diff --git a/config/params/config.go b/config/params/config.go index 6b3a07b64ec1..552ac2b9c603 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -270,7 +270,8 @@ type BeaconChainConfig struct { NodeIdBits uint64 `yaml:"NODE_ID_BITS" spec:"true"` // NodeIdBits defines the bit length of a node id. // PeerDAS - NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix. + NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix. + MaxCellsInExtendedMatrix uint64 `yaml:"MAX_CELLS_IN_EXTENDED_MATRIX" spec:"true"` // MaxCellsInExtendedMatrix is the full data of one-dimensional erasure coding extended blobs (in row major format). } // InitializeForkSchedule initializes the schedules forks baked into the config. diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index c7ba47f71812..098ceb5c7dea 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -310,7 +310,8 @@ var mainnetBeaconConfig = &BeaconChainConfig{ NodeIdBits: 256, // PeerDAS - NumberOfColumns: 128, + NumberOfColumns: 128, + MaxCellsInExtendedMatrix: 768, } // MainnetTestConfig provides a version of the mainnet config that has a different name From 9b2934f1f6e6256cc161874cf8b315e9a78714aa Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 6 May 2024 13:04:33 -0500 Subject: [PATCH 068/325] Electra: BeaconState implementation (#13919) * Electra: Beacon State * Electra: Beacon state fixes from PR 13919 * Add missing tests - part 1 * Split eip_7251_root.go into different files and reuse/share code with historical state summaries root. It's identical! * Add missing tests - part 2 * deposit receipts start index getters and setters (#13947) * adding in getters and setters for deposit receipts start index * adding tests * gaz * Add missing tests - part 3 of 3 Update the electra withdrawal example with a ssz state containing pending partial withdrawals * add tests for beacon-chain/state/state-native/getters_balance_deposits.go * Add electra field to testing/util/block.go execution payload * godoc commentary on public methods * Fix failing test * Add balances index out of bounds check and relevant tests. * Revert switch case electra * Instead of copying spectest data into testdata, use the spectest dependency * Deepsource fixes * Address @rkapka PR feedback * s/MaxPendingPartialsPerWithdrawalSweep/MaxPendingPartialsPerWithdrawalsSweep/ * Use multivalue slice compatible accessors for validator and balance in ActiveBalanceAtIndex * More @rkapka feedback. What a great reviewer! * More tests for branching logic in ExitEpochAndUpdateChurn * fix build --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- beacon-chain/blockchain/execution_engine.go | 4 +- beacon-chain/core/blocks/exit_test.go | 2 - beacon-chain/core/blocks/withdrawals.go | 2 +- beacon-chain/core/helpers/BUILD.bazel | 1 + beacon-chain/core/helpers/validator_churn.go | 15 +- .../core/helpers/validator_churn_test.go | 27 +- beacon-chain/rpc/eth/builder/handlers.go | 2 +- beacon-chain/rpc/eth/config/handlers_test.go | 2 +- beacon-chain/rpc/eth/events/events.go | 4 +- .../validator/proposer_execution_payload.go | 4 +- beacon-chain/state/BUILD.bazel | 1 + beacon-chain/state/interfaces.go | 48 +- beacon-chain/state/state-native/BUILD.bazel | 35 +- .../state-native/beacon_state_mainnet.go | 35 + .../state-native/beacon_state_minimal.go | 35 + .../state-native/getters_balance_deposits.go | 39 + .../getters_balance_deposits_test.go | 50 ++ .../state-native/getters_consolidation.go | 64 ++ .../getters_consolidation_test.go | 118 +++ .../state-native/getters_deposit_receipts.go | 16 + .../getters_deposit_receipts_test.go | 26 + .../state-native/getters_payload_header.go | 20 +- .../state/state-native/getters_state.go | 92 +- .../state/state-native/getters_validator.go | 57 ++ .../state-native/getters_validator_test.go | 79 ++ .../state/state-native/getters_withdrawal.go | 137 ++- .../state-native/getters_withdrawal_test.go | 837 +++++++----------- beacon-chain/state/state-native/hasher.go | 61 ++ .../state-native/setters_balance_deposits.go | 67 ++ .../setters_balance_deposits_test.go | 61 ++ .../state/state-native/setters_churn.go | 80 ++ .../state/state-native/setters_churn_test.go | 200 +++++ .../state-native/setters_consolidation.go | 84 ++ .../setters_consolidation_test.go | 76 ++ .../state-native/setters_deposit_receipts.go | 21 + .../setters_deposit_receipts_test.go | 27 + .../state-native/setters_payload_header.go | 42 + .../setters_payload_header_test.go | 107 +++ .../state/state-native/setters_withdrawal.go | 57 ++ .../state-native/setters_withdrawal_test.go | 66 ++ .../state/state-native/spec_parameters.go | 4 +- beacon-chain/state/state-native/state_test.go | 10 + beacon-chain/state/state-native/state_trie.go | 199 ++++- .../state/state-native/state_trie_test.go | 96 ++ .../state/state-native/types/types.go | 64 +- beacon-chain/state/stateutil/BUILD.bazel | 4 + .../stateutil/historical_summaries_root.go | 34 +- .../pending_balance_deposits_root.go | 10 + .../stateutil/pending_consolidations_root.go | 10 + .../pending_partial_withdrawals_root.go | 10 + beacon-chain/state/stateutil/slice_root.go | 41 + beacon-chain/state/stateutil/trie_helpers.go | 4 +- config/params/config.go | 30 +- config/params/interop.go | 1 + config/params/loader.go | 2 + config/params/mainnet_config.go | 33 +- config/params/minimal_config.go | 2 +- config/params/testdata/e2e_config.yaml | 3 + config/params/testnet_e2e_config.go | 7 + config/params/testnet_holesky_config.go | 4 + config/params/testnet_sepolia_config.go | 4 + encoding/ssz/detect/configfork.go | 16 + encoding/ssz/detect/configfork_test.go | 69 +- math/BUILD.bazel | 5 +- math/math_helper.go | 46 + proto/prysm/v1alpha1/BUILD.bazel | 3 + proto/prysm/v1alpha1/beacon_state.pb.go | 178 ++-- proto/prysm/v1alpha1/beacon_state.proto | 6 +- proto/prysm/v1alpha1/generated.ssz.go | 21 +- .../shared/electra/ssz_static/BUILD.bazel | 2 + .../shared/electra/ssz_static/ssz_static.go | 28 +- testing/util/BUILD.bazel | 1 + testing/util/block.go | 143 +++ testing/util/deneb.go | 17 - testing/util/electra.go | 25 + testing/util/merge.go | 9 + testing/util/state.go | 70 ++ testing/util/state_test.go | 18 + 78 files changed, 3096 insertions(+), 834 deletions(-) create mode 100644 beacon-chain/state/state-native/getters_balance_deposits.go create mode 100644 beacon-chain/state/state-native/getters_balance_deposits_test.go create mode 100644 beacon-chain/state/state-native/getters_consolidation.go create mode 100644 beacon-chain/state/state-native/getters_consolidation_test.go create mode 100644 beacon-chain/state/state-native/getters_deposit_receipts.go create mode 100644 beacon-chain/state/state-native/getters_deposit_receipts_test.go create mode 100644 beacon-chain/state/state-native/setters_balance_deposits.go create mode 100644 beacon-chain/state/state-native/setters_balance_deposits_test.go create mode 100644 beacon-chain/state/state-native/setters_churn.go create mode 100644 beacon-chain/state/state-native/setters_churn_test.go create mode 100644 beacon-chain/state/state-native/setters_consolidation.go create mode 100644 beacon-chain/state/state-native/setters_consolidation_test.go create mode 100644 beacon-chain/state/state-native/setters_deposit_receipts.go create mode 100644 beacon-chain/state/state-native/setters_deposit_receipts_test.go create mode 100644 beacon-chain/state/state-native/setters_payload_header_test.go create mode 100644 beacon-chain/state/stateutil/pending_balance_deposits_root.go create mode 100644 beacon-chain/state/stateutil/pending_consolidations_root.go create mode 100644 beacon-chain/state/stateutil/pending_partial_withdrawals_root.go create mode 100644 beacon-chain/state/stateutil/slice_root.go create mode 100644 testing/util/electra.go diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 3d4e72442c03..3ef06e3f443d 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -325,7 +325,7 @@ func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, var attr payloadattribute.Attributer switch st.Version() { case version.Deneb: - withdrawals, err := st.ExpectedWithdrawals() + withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { log.WithError(err).Error("Could not get expected withdrawals to get payload attribute") return emptyAttri @@ -342,7 +342,7 @@ func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, return emptyAttri } case version.Capella: - withdrawals, err := st.ExpectedWithdrawals() + withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { log.WithError(err).Error("Could not get expected withdrawals to get payload attribute") return emptyAttri diff --git a/beacon-chain/core/blocks/exit_test.go b/beacon-chain/core/blocks/exit_test.go index 7f589685fc7c..d40f35f7a2be 100644 --- a/beacon-chain/core/blocks/exit_test.go +++ b/beacon-chain/core/blocks/exit_test.go @@ -135,8 +135,6 @@ func TestProcessVoluntaryExits_AppliesCorrectStatus(t *testing.T) { } func TestVerifyExitAndSignature(t *testing.T) { - undo := util.HackDenebMaxuint(t) - defer undo() denebSlot, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) require.NoError(t, err) tests := []struct { diff --git a/beacon-chain/core/blocks/withdrawals.go b/beacon-chain/core/blocks/withdrawals.go index a9672c12046d..5b234d1614a8 100644 --- a/beacon-chain/core/blocks/withdrawals.go +++ b/beacon-chain/core/blocks/withdrawals.go @@ -145,7 +145,7 @@ func ValidateBLSToExecutionChange(st state.ReadOnlyBeaconState, signed *ethpb.Si // next_validator_index = ValidatorIndex(next_index % len(state.validators)) // state.next_withdrawal_validator_index = next_validator_index func ProcessWithdrawals(st state.BeaconState, executionData interfaces.ExecutionData) (state.BeaconState, error) { - expectedWithdrawals, err := st.ExpectedWithdrawals() + expectedWithdrawals, _, err := st.ExpectedWithdrawals() if err != nil { return nil, errors.Wrap(err, "could not get expected withdrawals") } diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index 1912d6c2998c..1b5709add134 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -78,6 +78,7 @@ go_test( "//container/slice:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", + "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", diff --git a/beacon-chain/core/helpers/validator_churn.go b/beacon-chain/core/helpers/validator_churn.go index b36fd81569f6..04409f08112a 100644 --- a/beacon-chain/core/helpers/validator_churn.go +++ b/beacon-chain/core/helpers/validator_churn.go @@ -2,6 +2,7 @@ package helpers import ( "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/math" ) // BalanceChurnLimit for the current active balance, in gwei. @@ -18,12 +19,12 @@ import ( // get_total_active_balance(state) // CHURN_LIMIT_QUOTIENT // ) // return churn - churn % EFFECTIVE_BALANCE_INCREMENT -func BalanceChurnLimit(activeBalanceGwei uint64) uint64 { +func BalanceChurnLimit(activeBalance math.Gwei) math.Gwei { churn := max( params.BeaconConfig().MinPerEpochChurnLimitElectra, - (activeBalanceGwei / params.BeaconConfig().ChurnLimitQuotient), + (uint64(activeBalance) / params.BeaconConfig().ChurnLimitQuotient), ) - return churn - churn%params.BeaconConfig().EffectiveBalanceIncrement + return math.Gwei(churn - churn%params.BeaconConfig().EffectiveBalanceIncrement) } // ActivationExitChurnLimit for the current active balance, in gwei. @@ -36,8 +37,8 @@ func BalanceChurnLimit(activeBalanceGwei uint64) uint64 { // Return the churn limit for the current epoch dedicated to activations and exits. // """ // return min(MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT, get_balance_churn_limit(state)) -func ActivationExitChurnLimit(activeBalanceGwei uint64) uint64 { - return min(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit, BalanceChurnLimit(activeBalanceGwei)) +func ActivationExitChurnLimit(activeBalance math.Gwei) math.Gwei { + return min(math.Gwei(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit), BalanceChurnLimit(activeBalance)) } // ConsolidationChurnLimit for the current active balance, in gwei. @@ -47,6 +48,6 @@ func ActivationExitChurnLimit(activeBalanceGwei uint64) uint64 { // // def get_consolidation_churn_limit(state: BeaconState) -> Gwei: // return get_balance_churn_limit(state) - get_activation_exit_churn_limit(state) -func ConsolidationChurnLimit(activeBalanceGwei uint64) uint64 { - return BalanceChurnLimit(activeBalanceGwei) - ActivationExitChurnLimit(activeBalanceGwei) +func ConsolidationChurnLimit(activeBalance math.Gwei) math.Gwei { + return BalanceChurnLimit(activeBalance) - ActivationExitChurnLimit(activeBalance) } diff --git a/beacon-chain/core/helpers/validator_churn_test.go b/beacon-chain/core/helpers/validator_churn_test.go index 556505291a8a..6a83b4f0168c 100644 --- a/beacon-chain/core/helpers/validator_churn_test.go +++ b/beacon-chain/core/helpers/validator_churn_test.go @@ -5,29 +5,30 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/testing/assert" ) func TestBalanceChurnLimit(t *testing.T) { tests := []struct { name string - activeBalance uint64 - expected uint64 + activeBalance math.Gwei + expected math.Gwei }{ { name: "less than MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA", activeBalance: 111, - expected: params.BeaconConfig().MinPerEpochChurnLimitElectra, + expected: math.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), }, { name: "modulo EFFECTIVE_BALANCE_INCREMENT", - activeBalance: 111 + params.BeaconConfig().MinPerEpochChurnLimitElectra*params.BeaconConfig().ChurnLimitQuotient, - expected: params.BeaconConfig().MinPerEpochChurnLimitElectra, + activeBalance: math.Gwei(111 + params.BeaconConfig().MinPerEpochChurnLimitElectra*params.BeaconConfig().ChurnLimitQuotient), + expected: math.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), }, { name: "more than MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA", - activeBalance: 2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient, - expected: 2000 * params.BeaconConfig().EffectiveBalanceIncrement, + activeBalance: math.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient), + expected: math.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement), }, } @@ -41,18 +42,18 @@ func TestBalanceChurnLimit(t *testing.T) { func TestActivationExitChurnLimit(t *testing.T) { tests := []struct { name string - activeBalance uint64 - expected uint64 + activeBalance math.Gwei + expected math.Gwei }{ { name: "less than MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT", activeBalance: 1, - expected: params.BeaconConfig().MinPerEpochChurnLimitElectra, + expected: math.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), }, { name: "more than MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT", - activeBalance: 2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient, - expected: params.BeaconConfig().MaxPerEpochActivationExitChurnLimit, + activeBalance: math.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient), + expected: math.Gwei(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit), }, } @@ -66,6 +67,6 @@ func TestActivationExitChurnLimit(t *testing.T) { // FuzzConsolidationChurnLimit exercises BalanceChurnLimit and ActivationExitChurnLimit func FuzzConsolidationChurnLimit(f *testing.F) { f.Fuzz(func(t *testing.T, activeBalance uint64) { - helpers.ConsolidationChurnLimit(activeBalance) + helpers.ConsolidationChurnLimit(math.Gwei(activeBalance)) }) } diff --git a/beacon-chain/rpc/eth/builder/handlers.go b/beacon-chain/rpc/eth/builder/handlers.go index 0d9fc4b136fc..d175d798522b 100644 --- a/beacon-chain/rpc/eth/builder/handlers.go +++ b/beacon-chain/rpc/eth/builder/handlers.go @@ -96,7 +96,7 @@ func (s *Server) ExpectedWithdrawals(w http.ResponseWriter, r *http.Request) { }) return } - withdrawals, err := st.ExpectedWithdrawals() + withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { httputil.WriteError(w, &httputil.DefaultJsonError{ Message: "could not get expected withdrawals", diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index 813cc7de5aae..c2f123d4b9f8 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -140,7 +140,7 @@ func TestGetSpec(t *testing.T) { config.PendingPartialWithdrawalsLimit = 80 config.MinActivationBalance = 81 config.PendingBalanceDepositLimit = 82 - config.MaxPendingPartialsPerWithdrawalSweep = 83 + config.MaxPendingPartialsPerWithdrawalsSweep = 83 config.PendingConsolidationsLimit = 84 config.MaxPartialWithdrawalsPerPayload = 85 config.FullExitRequestAmount = 86 diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 776dddf1980d..942b02545a8b 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -449,7 +449,7 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()), } case version.Capella: - withdrawals, err := headState.ExpectedWithdrawals() + withdrawals, _, err := headState.ExpectedWithdrawals() if err != nil { return write(w, flusher, "Could not get head state expected withdrawals: "+err.Error()) } @@ -460,7 +460,7 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite Withdrawals: structs.WithdrawalsFromConsensus(withdrawals), } case version.Deneb: - withdrawals, err := headState.ExpectedWithdrawals() + withdrawals, _, err := headState.ExpectedWithdrawals() if err != nil { return write(w, flusher, "Could not get head state expected withdrawals: "+err.Error()) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 70aa3831c245..4605901cff13 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -128,7 +128,7 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe var attr payloadattribute.Attributer switch st.Version() { case version.Deneb: - withdrawals, err := st.ExpectedWithdrawals() + withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { return nil, false, err } @@ -143,7 +143,7 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe return nil, false, err } case version.Capella: - withdrawals, err := st.ExpectedWithdrawals() + withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { return nil, false, err } diff --git a/beacon-chain/state/BUILD.bazel b/beacon-chain/state/BUILD.bazel index fa1ee84cff41..95af0712b819 100644 --- a/beacon-chain/state/BUILD.bazel +++ b/beacon-chain/state/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "//config/fieldparams:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index ff827758ae59..8dc8876f2b96 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -11,6 +11,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -56,6 +57,8 @@ type ReadOnlyBeaconState interface { ReadOnlyParticipation ReadOnlyInactivity ReadOnlySyncCommittee + ReadOnlyDeposits + ReadOnlyConsolidations ToProtoUnsafe() interface{} ToProto() interface{} GenesisTime() uint64 @@ -87,6 +90,9 @@ type WriteOnlyBeaconState interface { WriteOnlyParticipation WriteOnlyInactivity WriteOnlySyncCommittee + WriteOnlyConsolidations + WriteOnlyWithdrawals + WriteOnlyDeposits SetGenesisTime(val uint64) error SetGenesisValidatorsRoot(val []byte) error SetSlot(val primitives.Slot) error @@ -98,8 +104,6 @@ type WriteOnlyBeaconState interface { AppendHistoricalRoots(root [32]byte) error AppendHistoricalSummaries(*ethpb.HistoricalSummary) error SetLatestExecutionPayloadHeader(payload interfaces.ExecutionData) error - SetNextWithdrawalIndex(i uint64) error - SetNextWithdrawalValidatorIndex(i primitives.ValidatorIndex) error SaveValidatorIndices() } @@ -134,6 +138,7 @@ type ReadOnlyBalances interface { Balances() []uint64 BalanceAtIndex(idx primitives.ValidatorIndex) (uint64, error) BalancesLength() int + ActiveBalanceAtIndex(idx primitives.ValidatorIndex) (uint64, error) } // ReadOnlyCheckpoint defines a struct which only has read access to checkpoint methods. @@ -182,9 +187,11 @@ type ReadOnlyAttestations interface { // ReadOnlyWithdrawals defines a struct which only has read access to withdrawal methods. type ReadOnlyWithdrawals interface { - ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) + ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, error) NextWithdrawalValidatorIndex() (primitives.ValidatorIndex, error) NextWithdrawalIndex() (uint64, error) + PendingBalanceToWithdraw(idx primitives.ValidatorIndex) (uint64, error) + NumPendingPartialWithdrawals() (uint64, error) } // ReadOnlyParticipation defines a struct which only has read access to participation methods. @@ -204,6 +211,19 @@ type ReadOnlySyncCommittee interface { NextSyncCommittee() (*ethpb.SyncCommittee, error) } +type ReadOnlyDeposits interface { + DepositBalanceToConsume() (math.Gwei, error) + DepositReceiptsStartIndex() (uint64, error) + PendingBalanceDeposits() ([]*ethpb.PendingBalanceDeposit, error) +} + +type ReadOnlyConsolidations interface { + ConsolidationBalanceToConsume() (math.Gwei, error) + EarliestConsolidationEpoch() (primitives.Epoch, error) + PendingConsolidations() ([]*ethpb.PendingConsolidation, error) + NumPendingConsolidations() (uint64, error) +} + // WriteOnlyBlockRoots defines a struct which only has write access to block roots methods. type WriteOnlyBlockRoots interface { SetBlockRoots(val [][]byte) error @@ -222,6 +242,7 @@ type WriteOnlyEth1Data interface { SetEth1DataVotes(val []*ethpb.Eth1Data) error AppendEth1DataVotes(val *ethpb.Eth1Data) error SetEth1DepositIndex(val uint64) error + ExitEpochAndUpdateChurn(exitBalance math.Gwei) (primitives.Epoch, error) } // WriteOnlyValidators defines a struct which only has write access to validators methods. @@ -283,3 +304,24 @@ type WriteOnlySyncCommittee interface { SetCurrentSyncCommittee(val *ethpb.SyncCommittee) error SetNextSyncCommittee(val *ethpb.SyncCommittee) error } + +type WriteOnlyWithdrawals interface { + AppendPendingPartialWithdrawal(ppw *ethpb.PendingPartialWithdrawal) error + DequeuePartialWithdrawals(num uint64) error + SetNextWithdrawalIndex(i uint64) error + SetNextWithdrawalValidatorIndex(i primitives.ValidatorIndex) error +} + +type WriteOnlyConsolidations interface { + AppendPendingConsolidation(val *ethpb.PendingConsolidation) error + SetConsolidationBalanceToConsume(math.Gwei) error + SetEarliestConsolidationEpoch(epoch primitives.Epoch) error + SetPendingConsolidations(val []*ethpb.PendingConsolidation) error +} + +type WriteOnlyDeposits interface { + AppendPendingBalanceDeposit(index primitives.ValidatorIndex, amount uint64) error + SetDepositReceiptsStartIndex(index uint64) error + SetPendingBalanceDeposits(val []*ethpb.PendingBalanceDeposit) error + SetDepositBalanceToConsume(math.Gwei) error +} diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 4cfa724f4beb..1d16f099eee1 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -3,11 +3,16 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "beacon_state_mainnet.go", + "beacon_state_minimal.go", # keep "doc.go", "error.go", "getters_attestation.go", + "getters_balance_deposits.go", "getters_block.go", "getters_checkpoint.go", + "getters_consolidation.go", + "getters_deposit_receipts.go", "getters_eth1.go", "getters_misc.go", "getters_participation.go", @@ -22,8 +27,12 @@ go_library( "proofs.go", "readonly_validator.go", "setters_attestation.go", + "setters_balance_deposits.go", "setters_block.go", "setters_checkpoint.go", + "setters_churn.go", + "setters_consolidation.go", + "setters_deposit_receipts.go", "setters_eth1.go", "setters_misc.go", "setters_participation.go", @@ -38,13 +47,11 @@ go_library( "state_trie.go", "types.go", "validator_index_cache.go", - ] + select({ - "//config:mainnet": ["beacon_state_mainnet.go"], - "//config:minimal": ["beacon_state_minimal.go"], - }), + ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native", visibility = ["//visibility:public"], deps = [ + "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/fieldtrie:go_default_library", @@ -82,8 +89,11 @@ go_test( name = "go_default_test", srcs = [ "getters_attestation_test.go", + "getters_balance_deposits_test.go", "getters_block_test.go", "getters_checkpoint_test.go", + "getters_consolidation_test.go", + "getters_deposit_receipts_test.go", "getters_participation_test.go", "getters_test.go", "getters_validator_test.go", @@ -94,9 +104,14 @@ go_test( "readonly_validator_test.go", "references_test.go", "setters_attestation_test.go", + "setters_balance_deposits_test.go", + "setters_churn_test.go", + "setters_consolidation_test.go", + "setters_deposit_receipts_test.go", "setters_eth1_test.go", "setters_misc_test.go", "setters_participation_test.go", + "setters_payload_header_test.go", "setters_validator_test.go", "setters_withdrawal_test.go", "state_fuzz_test.go", @@ -105,9 +120,12 @@ go_test( "types_test.go", "validator_index_cache_test.go", ], - data = glob(["testdata/**"]), + data = glob(["testdata/**"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], embed = [":go_default_library"], deps = [ + "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/transition:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native/types:go_default_library", @@ -116,11 +134,14 @@ go_test( "//config/features:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/trie:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", + "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/interop:go_default_library", @@ -128,9 +149,13 @@ go_test( "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/beacon-chain/state/state-native/beacon_state_mainnet.go b/beacon-chain/state/state-native/beacon_state_mainnet.go index dc46a233d3f5..4ceb16a65518 100644 --- a/beacon-chain/state/state-native/beacon_state_mainnet.go +++ b/beacon-chain/state/state-native/beacon_state_mainnet.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -57,9 +58,21 @@ type BeaconState struct { latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb + latestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra nextWithdrawalIndex uint64 nextWithdrawalValidatorIndex primitives.ValidatorIndex + // Electra fields + depositReceiptsStartIndex uint64 + depositBalanceToConsume math.Gwei + exitBalanceToConsume math.Gwei + earliestExitEpoch primitives.Epoch + consolidationBalanceToConsume math.Gwei + earliestConsolidationEpoch primitives.Epoch + pendingBalanceDeposits []*ethpb.PendingBalanceDeposit // pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] + pendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal // pending_partial_withdrawals: List[PartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] + pendingConsolidations []*ethpb.PendingConsolidation // pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] + id uint64 lock sync.RWMutex dirtyFields map[types.FieldIndex]bool @@ -103,8 +116,19 @@ type beaconStateMarshalable struct { NextSyncCommittee *ethpb.SyncCommittee `json:"next_sync_committee" yaml:"next_sync_committee"` LatestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader `json:"latest_execution_payload_header" yaml:"latest_execution_payload_header"` LatestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella `json:"latest_execution_payload_header_capella" yaml:"latest_execution_payload_header_capella"` + LatestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb `json:"latest_execution_payload_header_deneb" yaml:"latest_execution_payload_header_deneb"` + LatestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header_electra" yaml:"latest_execution_payload_header_electra"` NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` + DepositReceiptsStartIndex uint64 `json:"deposit_receipts_start_index" yaml:"deposit_receipts_start_index"` + DepositBalanceToConsume math.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` + ExitBalanceToConsume math.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` + EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` + ConsolidationBalanceToConsume math.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` + EarliestConsolidationEpoch primitives.Epoch `json:"earliest_consolidation_epoch" yaml:"earliest_consolidation_epoch"` + PendingBalanceDeposits []*ethpb.PendingBalanceDeposit `json:"pending_balance_deposits" yaml:"pending_balance_deposits"` + PendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal `json:"pending_partial_withdrawals" yaml:"pending_partial_withdrawals"` + PendingConsolidations []*ethpb.PendingConsolidation `json:"pending_consolidations" yaml:"pending_consolidations"` } func (b *BeaconState) MarshalJSON() ([]byte, error) { @@ -162,8 +186,19 @@ func (b *BeaconState) MarshalJSON() ([]byte, error) { NextSyncCommittee: b.nextSyncCommittee, LatestExecutionPayloadHeader: b.latestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella, + LatestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb, + LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra, NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, + DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositBalanceToConsume: b.depositBalanceToConsume, + ExitBalanceToConsume: b.exitBalanceToConsume, + EarliestExitEpoch: b.earliestExitEpoch, + ConsolidationBalanceToConsume: b.consolidationBalanceToConsume, + EarliestConsolidationEpoch: b.earliestConsolidationEpoch, + PendingBalanceDeposits: b.pendingBalanceDeposits, + PendingPartialWithdrawals: b.pendingPartialWithdrawals, + PendingConsolidations: b.pendingConsolidations, } return json.Marshal(marshalable) } diff --git a/beacon-chain/state/state-native/beacon_state_minimal.go b/beacon-chain/state/state-native/beacon_state_minimal.go index f7d7c6fe8f06..1a5631f9cc1f 100644 --- a/beacon-chain/state/state-native/beacon_state_minimal.go +++ b/beacon-chain/state/state-native/beacon_state_minimal.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -57,9 +58,21 @@ type BeaconState struct { latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb + latestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra nextWithdrawalIndex uint64 nextWithdrawalValidatorIndex primitives.ValidatorIndex + // Electra fields + depositReceiptsStartIndex uint64 + depositBalanceToConsume math.Gwei + exitBalanceToConsume math.Gwei + earliestExitEpoch primitives.Epoch + consolidationBalanceToConsume math.Gwei + earliestConsolidationEpoch primitives.Epoch + pendingBalanceDeposits []*ethpb.PendingBalanceDeposit // pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] + pendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal // pending_partial_withdrawals: List[PartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] + pendingConsolidations []*ethpb.PendingConsolidation // pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] + id uint64 lock sync.RWMutex dirtyFields map[types.FieldIndex]bool @@ -103,8 +116,19 @@ type beaconStateMarshalable struct { NextSyncCommittee *ethpb.SyncCommittee `json:"next_sync_committee" yaml:"next_sync_committee"` LatestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader `json:"latest_execution_payload_header" yaml:"latest_execution_payload_header"` LatestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella `json:"latest_execution_payload_header_capella" yaml:"latest_execution_payload_header_capella"` + LatestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb `json:"latest_execution_payload_header_deneb" yaml:"latest_execution_payload_header_deneb"` + LatestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header_electra" yaml:"latest_execution_payload_header_electra"` NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` + DepositReceiptsStartIndex uint64 `json:"deposit_receipts_start_index" yaml:"deposit_receipts_start_index"` + DepositBalanceToConsume math.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` + ExitBalanceToConsume math.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` + EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` + ConsolidationBalanceToConsume math.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` + EarliestConsolidationEpoch primitives.Epoch `json:"earliest_consolidation_epoch" yaml:"earliest_consolidation_epoch"` + PendingBalanceDeposits []*ethpb.PendingBalanceDeposit `json:"pending_balance_deposits" yaml:"pending_balance_deposits"` + PendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal `json:"pending_partial_withdrawals" yaml:"pending_partial_withdrawals"` + PendingConsolidations []*ethpb.PendingConsolidation `json:"pending_consolidations" yaml:"pending_consolidations"` } func (b *BeaconState) MarshalJSON() ([]byte, error) { @@ -162,8 +186,19 @@ func (b *BeaconState) MarshalJSON() ([]byte, error) { NextSyncCommittee: b.nextSyncCommittee, LatestExecutionPayloadHeader: b.latestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella, + LatestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb, + LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra, NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, + DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositBalanceToConsume: b.depositBalanceToConsume, + ExitBalanceToConsume: b.exitBalanceToConsume, + EarliestExitEpoch: b.earliestExitEpoch, + ConsolidationBalanceToConsume: b.consolidationBalanceToConsume, + EarliestConsolidationEpoch: b.earliestConsolidationEpoch, + PendingBalanceDeposits: b.pendingBalanceDeposits, + PendingPartialWithdrawals: b.pendingPartialWithdrawals, + PendingConsolidations: b.pendingConsolidations, } return json.Marshal(marshalable) } diff --git a/beacon-chain/state/state-native/getters_balance_deposits.go b/beacon-chain/state/state-native/getters_balance_deposits.go new file mode 100644 index 000000000000..900a5ece2101 --- /dev/null +++ b/beacon-chain/state/state-native/getters_balance_deposits.go @@ -0,0 +1,39 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// DepositBalanceToConsume is a non-mutating call to the beacon state which returns the value of the +// deposit balance to consume field. This method requires access to the RLock on the state and only +// applies in electra or later. +func (b *BeaconState) DepositBalanceToConsume() (math.Gwei, error) { + if b.version < version.Electra { + return 0, errNotSupported("DepositBalanceToConsume", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return b.depositBalanceToConsume, nil +} + +// PendingBalanceDeposits is a non-mutating call to the beacon state which returns a deep copy of +// the pending balance deposit slice. This method requires access to the RLock on the state and +// only applies in electra or later. +func (b *BeaconState) PendingBalanceDeposits() ([]*ethpb.PendingBalanceDeposit, error) { + if b.version < version.Electra { + return nil, errNotSupported("PendingBalanceDeposits", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return b.pendingBalanceDepositsVal(), nil +} + +func (b *BeaconState) pendingBalanceDepositsVal() []*ethpb.PendingBalanceDeposit { + if b.pendingBalanceDeposits == nil { + return nil + } + + return ethpb.CopyPendingBalanceDeposits(b.pendingBalanceDeposits) +} diff --git a/beacon-chain/state/state-native/getters_balance_deposits_test.go b/beacon-chain/state/state-native/getters_balance_deposits_test.go new file mode 100644 index 000000000000..358681e52bad --- /dev/null +++ b/beacon-chain/state/state-native/getters_balance_deposits_test.go @@ -0,0 +1,50 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestDepositBalanceToConsume(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + DepositBalanceToConsume: 44, + }) + require.NoError(t, err) + dbtc, err := s.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(44), dbtc) + + // Fails for older than electra state + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = s.DepositBalanceToConsume() + require.ErrorContains(t, "not supported", err) +} + +func TestPendingBalanceDeposits(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + PendingBalanceDeposits: []*eth.PendingBalanceDeposit{ + {Index: 1, Amount: 2}, + {Index: 3, Amount: 4}, + }, + }) + require.NoError(t, err) + pbd, err := s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 2, len(pbd)) + require.Equal(t, primitives.ValidatorIndex(1), pbd[0].Index) + require.Equal(t, uint64(2), pbd[0].Amount) + require.Equal(t, primitives.ValidatorIndex(3), pbd[1].Index) + require.Equal(t, uint64(4), pbd[1].Amount) + + // Fails for older than electra state + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = s.DepositBalanceToConsume() + require.ErrorContains(t, "not supported", err) +} diff --git a/beacon-chain/state/state-native/getters_consolidation.go b/beacon-chain/state/state-native/getters_consolidation.go new file mode 100644 index 000000000000..017dde5112a4 --- /dev/null +++ b/beacon-chain/state/state-native/getters_consolidation.go @@ -0,0 +1,64 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// EarliestConsolidationEpoch is a non-mutating call to the beacon state which returns the value of +// the earliest consolidation epoch field. This method requires access to the RLock on the state and +// only applies in electra or later. +func (b *BeaconState) EarliestConsolidationEpoch() (primitives.Epoch, error) { + if b.version < version.Electra { + return 0, errNotSupported("EarliestConsolidationEpoch", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return b.earliestConsolidationEpoch, nil +} + +// ConsolidationBalanceToConsume is a non-mutating call to the beacon state which returns the value +// of the consolidation balance to consume field. This method requires access to the RLock on the +// state and only applies in electra or later. +func (b *BeaconState) ConsolidationBalanceToConsume() (math.Gwei, error) { + if b.version < version.Electra { + return 0, errNotSupported("ConsolidationBalanceToConsume", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return b.consolidationBalanceToConsume, nil +} + +// PendingConsolidations is a non-mutating call to the beacon state which returns a deep copy of the +// pending consolidations slice. This method requires access to the RLock on the state and only +// applies in electra or later. +func (b *BeaconState) PendingConsolidations() ([]*ethpb.PendingConsolidation, error) { + if b.version < version.Electra { + return nil, errNotSupported("PendingConsolidations", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return b.pendingConsolidationsVal(), nil +} + +// NumPendingConsolidations is a non-mutating call to the beacon state which returns the number of +// pending consolidations in the beacon state. This method requires access to the RLock on the state +// and only applies in electra or later. +func (b *BeaconState) NumPendingConsolidations() (uint64, error) { + if b.version < version.Electra { + return 0, errNotSupported("NumPendingConsolidations", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return uint64(len(b.pendingConsolidations)), nil +} + +func (b *BeaconState) pendingConsolidationsVal() []*ethpb.PendingConsolidation { + if b.pendingConsolidations == nil { + return nil + } + + return ethpb.CopyPendingConsolidations(b.pendingConsolidations) +} diff --git a/beacon-chain/state/state-native/getters_consolidation_test.go b/beacon-chain/state/state-native/getters_consolidation_test.go new file mode 100644 index 000000000000..6a4ec384a24b --- /dev/null +++ b/beacon-chain/state/state-native/getters_consolidation_test.go @@ -0,0 +1,118 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestEarliestConsolidationEpoch(t *testing.T) { + t.Run("electra returns expected value", func(t *testing.T) { + want := primitives.Epoch(10) + st, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + EarliestConsolidationEpoch: want, + }) + require.NoError(t, err) + got, err := st.EarliestConsolidationEpoch() + require.NoError(t, err) + require.Equal(t, want, got) + }) + + t.Run("earlier than electra returns error", func(t *testing.T) { + st, err := state_native.InitializeFromProtoDeneb(ðpb.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = st.EarliestConsolidationEpoch() + require.ErrorContains(t, "is not supported", err) + }) +} + +func TestConsolidationBalanceToConsume(t *testing.T) { + t.Run("electra returns expected value", func(t *testing.T) { + want := math.Gwei(10) + st, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + ConsolidationBalanceToConsume: want, + }) + require.NoError(t, err) + got, err := st.ConsolidationBalanceToConsume() + require.NoError(t, err) + require.Equal(t, want, got) + }) + + t.Run("earlier than electra returns error", func(t *testing.T) { + st, err := state_native.InitializeFromProtoDeneb(ðpb.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = st.ConsolidationBalanceToConsume() + require.ErrorContains(t, "is not supported", err) + }) +} + +func TestPendingConsolidations(t *testing.T) { + t.Run("electra returns expected value", func(t *testing.T) { + want := []*ethpb.PendingConsolidation{ + { + SourceIndex: 1, + TargetIndex: 2, + }, + { + SourceIndex: 3, + TargetIndex: 4, + }, + { + SourceIndex: 5, + TargetIndex: 6, + }, + { + SourceIndex: 7, + TargetIndex: 8, + }, + } + st, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + PendingConsolidations: want, + }) + require.NoError(t, err) + got, err := st.PendingConsolidations() + require.NoError(t, err) + require.DeepEqual(t, want, got) + }) + + t.Run("earlier than electra returns error", func(t *testing.T) { + st, err := state_native.InitializeFromProtoDeneb(ðpb.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = st.PendingConsolidations() + require.ErrorContains(t, "is not supported", err) + }) +} + +func TestNumPendingConsolidations(t *testing.T) { + t.Run("electra returns expected value", func(t *testing.T) { + want := uint64(4) + st, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + PendingConsolidations: []*ethpb.PendingConsolidation{ + { + SourceIndex: 1, + TargetIndex: 2, + }, + { + SourceIndex: 3, + TargetIndex: 4, + }, + { + SourceIndex: 5, + TargetIndex: 6, + }, + { + SourceIndex: 7, + TargetIndex: 8, + }, + }, + }) + require.NoError(t, err) + got, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, want, got) + }) +} diff --git a/beacon-chain/state/state-native/getters_deposit_receipts.go b/beacon-chain/state/state-native/getters_deposit_receipts.go new file mode 100644 index 000000000000..aa15a9a8a0be --- /dev/null +++ b/beacon-chain/state/state-native/getters_deposit_receipts.go @@ -0,0 +1,16 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// DepositReceiptsStartIndex is used for returning the deposit receipts start index which is used for eip6110 +func (b *BeaconState) DepositReceiptsStartIndex() (uint64, error) { + if b.version < version.Electra { + return 0, errNotSupported("DepositReceiptsStartIndex", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + + return b.depositReceiptsStartIndex, nil +} diff --git a/beacon-chain/state/state-native/getters_deposit_receipts_test.go b/beacon-chain/state/state-native/getters_deposit_receipts_test.go new file mode 100644 index 000000000000..de6ea94bb2ad --- /dev/null +++ b/beacon-chain/state/state-native/getters_deposit_receipts_test.go @@ -0,0 +1,26 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestDepositReceiptsStartIndex(t *testing.T) { + t.Run("previous fork returns expected error", func(t *testing.T) { + dState, _ := util.DeterministicGenesisState(t, 1) + _, err := dState.DepositReceiptsStartIndex() + require.ErrorContains(t, "is not supported", err) + }) + t.Run("electra returns expected value", func(t *testing.T) { + want := uint64(2) + dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositReceiptsStartIndex: want}) + require.NoError(t, err) + got, err := dState.DepositReceiptsStartIndex() + require.NoError(t, err) + require.Equal(t, want, got) + }) +} diff --git a/beacon-chain/state/state-native/getters_payload_header.go b/beacon-chain/state/state-native/getters_payload_header.go index 74feadca17df..ba2a204d84a6 100644 --- a/beacon-chain/state/state-native/getters_payload_header.go +++ b/beacon-chain/state/state-native/getters_payload_header.go @@ -1,6 +1,7 @@ package state_native import ( + "fmt" "math/big" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -19,15 +20,18 @@ func (b *BeaconState) LatestExecutionPayloadHeader() (interfaces.ExecutionData, b.lock.RLock() defer b.lock.RUnlock() - if b.version == version.Bellatrix { + switch b.version { + case version.Bellatrix: return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeaderVal()) - } - - if b.version == version.Capella { + case version.Capella: return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapellaVal(), big.NewInt(0)) + case version.Deneb: + return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDenebVal(), big.NewInt(0)) + case version.Electra: + return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectraVal(), big.NewInt(0)) + default: + return nil, fmt.Errorf("unsupported version (%s) for latest execution payload header", version.String(b.version)) } - - return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDenebVal(), big.NewInt(0)) } // latestExecutionPayloadHeaderVal of the beacon state. @@ -45,3 +49,7 @@ func (b *BeaconState) latestExecutionPayloadHeaderCapellaVal() *enginev1.Executi func (b *BeaconState) latestExecutionPayloadHeaderDenebVal() *enginev1.ExecutionPayloadHeaderDeneb { return ethpb.CopyExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDeneb) } + +func (b *BeaconState) latestExecutionPayloadHeaderElectraVal() *enginev1.ExecutionPayloadHeaderElectra { + return ethpb.CopyExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectra) +} diff --git a/beacon-chain/state/state-native/getters_state.go b/beacon-chain/state/state-native/getters_state.go index c8f9c4aa7b16..402586e63360 100644 --- a/beacon-chain/state/state-native/getters_state.go +++ b/beacon-chain/state/state-native/getters_state.go @@ -172,6 +172,46 @@ func (b *BeaconState) ToProtoUnsafe() interface{} { NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummaries, } + case version.Electra: + return ðpb.BeaconStateElectra{ + GenesisTime: b.genesisTime, + GenesisValidatorsRoot: gvrCopy[:], + Slot: b.slot, + Fork: b.fork, + LatestBlockHeader: b.latestBlockHeader, + BlockRoots: br, + StateRoots: sr, + HistoricalRoots: b.historicalRoots.Slice(), + Eth1Data: b.eth1Data, + Eth1DataVotes: b.eth1DataVotes, + Eth1DepositIndex: b.eth1DepositIndex, + Validators: vals, + Balances: bals, + RandaoMixes: rm, + Slashings: b.slashings, + PreviousEpochParticipation: b.previousEpochParticipation, + CurrentEpochParticipation: b.currentEpochParticipation, + JustificationBits: b.justificationBits, + PreviousJustifiedCheckpoint: b.previousJustifiedCheckpoint, + CurrentJustifiedCheckpoint: b.currentJustifiedCheckpoint, + FinalizedCheckpoint: b.finalizedCheckpoint, + InactivityScores: b.inactivityScoresVal(), + CurrentSyncCommittee: b.currentSyncCommittee, + NextSyncCommittee: b.nextSyncCommittee, + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectra, + NextWithdrawalIndex: b.nextWithdrawalIndex, + NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, + HistoricalSummaries: b.historicalSummaries, + DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositBalanceToConsume: b.depositBalanceToConsume, + ExitBalanceToConsume: b.exitBalanceToConsume, + EarliestExitEpoch: b.earliestExitEpoch, + ConsolidationBalanceToConsume: b.consolidationBalanceToConsume, + EarliestConsolidationEpoch: b.earliestConsolidationEpoch, + PendingBalanceDeposits: b.pendingBalanceDeposits, + PendingPartialWithdrawals: b.pendingPartialWithdrawals, + PendingConsolidations: b.pendingConsolidations, + } default: return nil } @@ -338,6 +378,46 @@ func (b *BeaconState) ToProto() interface{} { NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummariesVal(), } + case version.Electra: + return ðpb.BeaconStateElectra{ + GenesisTime: b.genesisTime, + GenesisValidatorsRoot: gvrCopy[:], + Slot: b.slot, + Fork: b.forkVal(), + LatestBlockHeader: b.latestBlockHeaderVal(), + BlockRoots: br, + StateRoots: sr, + HistoricalRoots: b.historicalRoots.Slice(), + Eth1Data: b.eth1DataVal(), + Eth1DataVotes: b.eth1DataVotesVal(), + Eth1DepositIndex: b.eth1DepositIndex, + Validators: b.validatorsVal(), + Balances: b.balancesVal(), + RandaoMixes: rm, + Slashings: b.slashingsVal(), + PreviousEpochParticipation: b.previousEpochParticipationVal(), + CurrentEpochParticipation: b.currentEpochParticipationVal(), + JustificationBits: b.justificationBitsVal(), + PreviousJustifiedCheckpoint: b.previousJustifiedCheckpointVal(), + CurrentJustifiedCheckpoint: b.currentJustifiedCheckpointVal(), + FinalizedCheckpoint: b.finalizedCheckpointVal(), + InactivityScores: b.inactivityScoresVal(), + CurrentSyncCommittee: b.currentSyncCommitteeVal(), + NextSyncCommittee: b.nextSyncCommitteeVal(), + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectraVal(), + NextWithdrawalIndex: b.nextWithdrawalIndex, + NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, + HistoricalSummaries: b.historicalSummariesVal(), + DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositBalanceToConsume: b.depositBalanceToConsume, + ExitBalanceToConsume: b.exitBalanceToConsume, + EarliestExitEpoch: b.earliestExitEpoch, + ConsolidationBalanceToConsume: b.consolidationBalanceToConsume, + EarliestConsolidationEpoch: b.earliestConsolidationEpoch, + PendingBalanceDeposits: b.pendingBalanceDepositsVal(), + PendingPartialWithdrawals: b.pendingPartialWithdrawalsVal(), + PendingConsolidations: b.pendingConsolidationsVal(), + } default: return nil } @@ -449,7 +529,17 @@ func ProtobufBeaconStateCapella(s interface{}) (*ethpb.BeaconStateCapella, error func ProtobufBeaconStateDeneb(s interface{}) (*ethpb.BeaconStateDeneb, error) { pbState, ok := s.(*ethpb.BeaconStateDeneb) if !ok { - return nil, errors.New("input is not type pb.ProtobufBeaconStateDeneb") + return nil, errors.New("input is not type pb.BeaconStateDeneb") + } + return pbState, nil +} + +// ProtobufBeaconStateElectra transforms an input into beacon state Electra in the form of protobuf. +// Error is returned if the input is not type protobuf beacon state. +func ProtobufBeaconStateElectra(s interface{}) (*ethpb.BeaconStateElectra, error) { + pbState, ok := s.(*ethpb.BeaconStateElectra) + if !ok { + return nil, errors.New("input is not type pb.BeaconStateElectra") } return pbState, nil } diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index 940e85975ab1..0f1df58b9cef 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -2,6 +2,7 @@ package state_native import ( "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -413,3 +414,59 @@ func (b *BeaconState) inactivityScoresVal() []uint64 { copy(res, b.inactivityScores) return res } + +// ActiveBalanceAtIndex returns the active balance for the given validator. +// +// Spec definition: +// +// def get_active_balance(state: BeaconState, validator_index: ValidatorIndex) -> Gwei: +// max_effective_balance = get_validator_max_effective_balance(state.validators[validator_index]) +// return min(state.balances[validator_index], max_effective_balance) +func (b *BeaconState) ActiveBalanceAtIndex(i primitives.ValidatorIndex) (uint64, error) { + if b.version < version.Electra { + return 0, errNotSupported("ActiveBalanceAtIndex", b.version) + } + + b.lock.RLock() + defer b.lock.RUnlock() + + v, err := b.validatorAtIndex(i) + if err != nil { + return 0, err + } + + bal, err := b.balanceAtIndex(i) + if err != nil { + return 0, err + } + + return min(bal, helpers.ValidatorMaxEffectiveBalance(v)), nil +} + +// PendingBalanceToWithdraw returns the sum of all pending withdrawals for the given validator. +// +// Spec definition: +// +// def get_pending_balance_to_withdraw(state: BeaconState, validator_index: ValidatorIndex) -> Gwei: +// return sum( +// withdrawal.amount for withdrawal in state.pending_partial_withdrawals if withdrawal.index == validator_index) +func (b *BeaconState) PendingBalanceToWithdraw(idx primitives.ValidatorIndex) (uint64, error) { + if b.version < version.Electra { + return 0, errNotSupported("PendingBalanceToWithdraw", b.version) + } + + b.lock.RLock() + defer b.lock.RUnlock() + + // TODO: Consider maintaining this value in the state, if it's a potential bottleneck. + // This is n*m complexity, but this method can only be called + // MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD per slot. A more optimized storage indexing such as a + // lookup map could be used to reduce the complexity marginally. + var sum uint64 + for _, w := range b.pendingPartialWithdrawals { + if w.Index == idx { + sum += w.Amount + } + } + return sum, nil +} diff --git a/beacon-chain/state/state-native/getters_validator_test.go b/beacon-chain/state/state-native/getters_validator_test.go index 43df4d9d507c..81e823c19487 100644 --- a/beacon-chain/state/state-native/getters_validator_test.go +++ b/beacon-chain/state/state-native/getters_validator_test.go @@ -1,12 +1,15 @@ package state_native_test import ( + "math" "testing" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" testtmpl "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/testing" + "github.com/prysmaticlabs/prysm/v5/config/params" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -66,3 +69,79 @@ func TestValidatorIndexes(t *testing.T) { require.Equal(t, hexutil.Encode(readOnlyBytes[:]), hexutil.Encode(byteValue[:])) }) } + +func TestActiveBalanceAtIndex(t *testing.T) { + // Test setup with a state with 4 validators. + // Validators 0 & 1 have compounding withdrawal credentials while validators 2 & 3 have BLS withdrawal credentials. + pb := ðpb.BeaconStateElectra{ + Validators: []*ethpb.Validator{ + { + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}, + }, + { + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}, + }, + { + WithdrawalCredentials: []byte{params.BeaconConfig().BLSWithdrawalPrefixByte}, + }, + { + WithdrawalCredentials: []byte{params.BeaconConfig().BLSWithdrawalPrefixByte}, + }, + }, + Balances: []uint64{ + 55, + math.MaxUint64, + 55, + math.MaxUint64, + }, + } + state, err := statenative.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + + ab, err := state.ActiveBalanceAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(55), ab) + + ab, err = state.ActiveBalanceAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxEffectiveBalanceElectra, ab) + + ab, err = state.ActiveBalanceAtIndex(2) + require.NoError(t, err) + require.Equal(t, uint64(55), ab) + + ab, err = state.ActiveBalanceAtIndex(3) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, ab) + + // Accessing a validator index out of bounds should error. + _, err = state.ActiveBalanceAtIndex(4) + require.ErrorIs(t, err, consensus_types.ErrOutOfBounds) + + // Accessing a validator wwhere balance slice is out of bounds for some reason. + require.NoError(t, state.SetBalances([]uint64{})) + _, err = state.ActiveBalanceAtIndex(0) + require.ErrorIs(t, err, consensus_types.ErrOutOfBounds) +} + +func TestPendingBalanceToWithdraw(t *testing.T) { + pb := ðpb.BeaconStateElectra{ + PendingPartialWithdrawals: []*ethpb.PendingPartialWithdrawal{ + { + Amount: 100, + }, + { + Amount: 200, + }, + { + Amount: 300, + }, + }, + } + state, err := statenative.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + + ab, err := state.PendingBalanceToWithdraw(0) + require.NoError(t, err) + require.Equal(t, uint64(600), ab) +} diff --git a/beacon-chain/state/state-native/getters_withdrawal.go b/beacon-chain/state/state-native/getters_withdrawal.go index b31eccefefa3..f5eb8bed9708 100644 --- a/beacon-chain/state/state-native/getters_withdrawal.go +++ b/beacon-chain/state/state-native/getters_withdrawal.go @@ -1,7 +1,10 @@ package state_native import ( + "fmt" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -41,10 +44,64 @@ func (b *BeaconState) NextWithdrawalValidatorIndex() (primitives.ValidatorIndex, // ExpectedWithdrawals returns the withdrawals that a proposer will need to pack in the next block // applied to the current state. It is also used by validators to check that the execution payload carried -// the right number of withdrawals -func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) { +// the right number of withdrawals. Note: The number of partial withdrawals will be zero before EIP-7251. +// +// Spec definition: +// +// def get_expected_withdrawals(state: BeaconState) -> Tuple[Sequence[Withdrawal], uint64]: +// epoch = get_current_epoch(state) +// withdrawal_index = state.next_withdrawal_index +// validator_index = state.next_withdrawal_validator_index +// withdrawals: List[Withdrawal] = [] +// +// # [New in Electra:EIP7251] Consume pending partial withdrawals +// for withdrawal in state.pending_partial_withdrawals: +// if withdrawal.withdrawable_epoch > epoch or len(withdrawals) == MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: +// break +// +// validator = state.validators[withdrawal.index] +// has_sufficient_effective_balance = validator.effective_balance >= MIN_ACTIVATION_BALANCE +// has_excess_balance = state.balances[withdrawal.index] > MIN_ACTIVATION_BALANCE +// if validator.exit_epoch == FAR_FUTURE_EPOCH and has_sufficient_effective_balance and has_excess_balance: +// withdrawable_balance = min(state.balances[withdrawal.index] - MIN_ACTIVATION_BALANCE, withdrawal.amount) +// withdrawals.append(Withdrawal( +// index=withdrawal_index, +// validator_index=withdrawal.index, +// address=ExecutionAddress(validator.withdrawal_credentials[12:]), +// amount=withdrawable_balance, +// )) +// withdrawal_index += WithdrawalIndex(1) +// +// partial_withdrawals_count = len(withdrawals) +// +// # Sweep for remaining. +// bound = min(len(state.validators), MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP) +// for _ in range(bound): +// validator = state.validators[validator_index] +// balance = state.balances[validator_index] +// if is_fully_withdrawable_validator(validator, balance, epoch): +// withdrawals.append(Withdrawal( +// index=withdrawal_index, +// validator_index=validator_index, +// address=ExecutionAddress(validator.withdrawal_credentials[12:]), +// amount=balance, +// )) +// withdrawal_index += WithdrawalIndex(1) +// elif is_partially_withdrawable_validator(validator, balance): +// withdrawals.append(Withdrawal( +// index=withdrawal_index, +// validator_index=validator_index, +// address=ExecutionAddress(validator.withdrawal_credentials[12:]), +// amount=balance - get_validator_max_effective_balance(validator), # [Modified in Electra:EIP7251] +// )) +// withdrawal_index += WithdrawalIndex(1) +// if len(withdrawals) == MAX_WITHDRAWALS_PER_PAYLOAD: +// break +// validator_index = ValidatorIndex((validator_index + 1) % len(state.validators)) +// return withdrawals, partial_withdrawals_count +func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, error) { if b.version < version.Capella { - return nil, errNotSupported("ExpectedWithdrawals", b.version) + return nil, 0, errNotSupported("ExpectedWithdrawals", b.version) } b.lock.RLock() @@ -55,18 +112,49 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) { withdrawalIndex := b.nextWithdrawalIndex epoch := slots.ToEpoch(b.slot) + // Electra partial withdrawals functionality. + if b.version >= version.Electra { + for _, w := range b.pendingPartialWithdrawals { + if w.WithdrawableEpoch > epoch || len(withdrawals) >= int(params.BeaconConfig().MaxPendingPartialsPerWithdrawalsSweep) { + break + } + + v, err := b.validatorAtIndex(w.Index) + if err != nil { + return nil, 0, fmt.Errorf("failed to determine withdrawals at index %d: %w", w.Index, err) + } + vBal, err := b.balanceAtIndex(w.Index) + if err != nil { + return nil, 0, fmt.Errorf("could not retrieve balance at index %d: %w", w.Index, err) + } + hasSufficientEffectiveBalance := v.EffectiveBalance >= params.BeaconConfig().MinActivationBalance + hasExcessBalance := vBal > params.BeaconConfig().MinActivationBalance + if v.ExitEpoch == params.BeaconConfig().FarFutureEpoch && hasSufficientEffectiveBalance && hasExcessBalance { + amount := min(vBal-params.BeaconConfig().MinActivationBalance, w.Amount) + withdrawals = append(withdrawals, &enginev1.Withdrawal{ + Index: withdrawalIndex, + ValidatorIndex: w.Index, + Address: v.WithdrawalCredentials[12:], + Amount: amount, + }) + withdrawalIndex++ + } + } + } + partialWithdrawalsCount := uint64(len(withdrawals)) + validatorsLen := b.validatorsLen() bound := mathutil.Min(uint64(validatorsLen), params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep) for i := uint64(0); i < bound; i++ { val, err := b.validatorAtIndex(validatorIndex) if err != nil { - return nil, errors.Wrapf(err, "could not retrieve validator at index %d", validatorIndex) + return nil, 0, errors.Wrapf(err, "could not retrieve validator at index %d", validatorIndex) } balance, err := b.balanceAtIndex(validatorIndex) if err != nil { - return nil, errors.Wrapf(err, "could not retrieve balance at index %d", validatorIndex) + return nil, 0, errors.Wrapf(err, "could not retrieve balance at index %d", validatorIndex) } - if balance > 0 && isFullyWithdrawableValidator(val, epoch) { + if helpers.IsFullyWithdrawableValidator(val, balance, epoch) { withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, ValidatorIndex: validatorIndex, @@ -74,12 +162,12 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) { Amount: balance, }) withdrawalIndex++ - } else if isPartiallyWithdrawableValidator(val, balance) { + } else if helpers.IsPartiallyWithdrawableValidator(val, balance, epoch) { withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, ValidatorIndex: validatorIndex, Address: bytesutil.SafeCopyBytes(val.WithdrawalCredentials[ETH1AddressOffset:]), - Amount: balance - params.BeaconConfig().MaxEffectiveBalance, + Amount: balance - helpers.ValidatorMaxEffectiveBalance(val), }) withdrawalIndex++ } @@ -91,36 +179,17 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, error) { validatorIndex = 0 } } - return withdrawals, nil -} -// hasETH1WithdrawalCredential returns whether the validator has an ETH1 -// Withdrawal prefix. It assumes that the caller has a lock on the state -func hasETH1WithdrawalCredential(val *ethpb.Validator) bool { - if val == nil { - return false - } - cred := val.WithdrawalCredentials - return len(cred) > 0 && cred[0] == params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + return withdrawals, partialWithdrawalsCount, nil } -// isFullyWithdrawableValidator returns whether the validator is able to perform a full -// withdrawal. This differ from the spec helper in that the balance > 0 is not -// checked. This function assumes that the caller holds a lock on the state -func isFullyWithdrawableValidator(val *ethpb.Validator, epoch primitives.Epoch) bool { - if val == nil { - return false - } - return hasETH1WithdrawalCredential(val) && val.WithdrawableEpoch <= epoch +func (b *BeaconState) pendingPartialWithdrawalsVal() []*ethpb.PendingPartialWithdrawal { + return ethpb.CopyPendingPartialWithdrawals(b.pendingPartialWithdrawals) } -// isPartiallyWithdrawable returns whether the validator is able to perform a -// partial withdrawal. This function assumes that the caller has a lock on the state -func isPartiallyWithdrawableValidator(val *ethpb.Validator, balance uint64) bool { - if val == nil { - return false +func (b *BeaconState) NumPendingPartialWithdrawals() (uint64, error) { + if b.version < version.Electra { + return 0, errNotSupported("NumPendingPartialWithdrawals", b.version) } - hasMaxBalance := val.EffectiveBalance == params.BeaconConfig().MaxEffectiveBalance - hasExcessBalance := balance > params.BeaconConfig().MaxEffectiveBalance - return hasETH1WithdrawalCredential(val) && hasExcessBalance && hasMaxBalance + return uint64(len(b.pendingPartialWithdrawals)), nil } diff --git a/beacon-chain/state/state-native/getters_withdrawal_test.go b/beacon-chain/state/state-native/getters_withdrawal_test.go index 4fa4e05a85c7..fc738949425e 100644 --- a/beacon-chain/state/state-native/getters_withdrawal_test.go +++ b/beacon-chain/state/state-native/getters_withdrawal_test.go @@ -1,8 +1,10 @@ -package state_native +package state_native_test import ( "testing" + "github.com/golang/snappy" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" @@ -10,588 +12,341 @@ import ( "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestNextWithdrawalIndex(t *testing.T) { t.Run("ok for deneb", func(t *testing.T) { - s := BeaconState{version: version.Deneb, nextWithdrawalIndex: 123} + s, err := state_native.InitializeFromProtoDeneb(ðpb.BeaconStateDeneb{NextWithdrawalIndex: 123}) + require.NoError(t, err) i, err := s.NextWithdrawalIndex() require.NoError(t, err) assert.Equal(t, uint64(123), i) }) t.Run("ok", func(t *testing.T) { - s := BeaconState{version: version.Capella, nextWithdrawalIndex: 123} + s, err := state_native.InitializeFromProtoCapella(ðpb.BeaconStateCapella{NextWithdrawalIndex: 123}) + require.NoError(t, err) i, err := s.NextWithdrawalIndex() require.NoError(t, err) assert.Equal(t, uint64(123), i) }) t.Run("version before Capella not supported", func(t *testing.T) { - s := BeaconState{version: version.Bellatrix} - _, err := s.NextWithdrawalIndex() + s, err := state_native.InitializeFromProtoBellatrix(ðpb.BeaconStateBellatrix{}) + require.NoError(t, err) + _, err = s.NextWithdrawalIndex() assert.ErrorContains(t, "NextWithdrawalIndex is not supported", err) }) } func TestNextWithdrawalValidatorIndex(t *testing.T) { t.Run("ok for deneb", func(t *testing.T) { - s := BeaconState{version: version.Deneb, nextWithdrawalValidatorIndex: 123} + pb := ðpb.BeaconStateDeneb{NextWithdrawalValidatorIndex: 123} + s, err := state_native.InitializeFromProtoDeneb(pb) + require.NoError(t, err) i, err := s.NextWithdrawalValidatorIndex() require.NoError(t, err) assert.Equal(t, primitives.ValidatorIndex(123), i) }) t.Run("ok", func(t *testing.T) { - s := BeaconState{version: version.Capella, nextWithdrawalValidatorIndex: 123} + pb := ðpb.BeaconStateCapella{NextWithdrawalValidatorIndex: 123} + s, err := state_native.InitializeFromProtoCapella(pb) + require.NoError(t, err) i, err := s.NextWithdrawalValidatorIndex() require.NoError(t, err) assert.Equal(t, primitives.ValidatorIndex(123), i) }) t.Run("version before Capella not supported", func(t *testing.T) { - s := BeaconState{version: version.Bellatrix} - _, err := s.NextWithdrawalValidatorIndex() + s, err := state_native.InitializeFromProtoBellatrix(ðpb.BeaconStateBellatrix{}) + require.NoError(t, err) + _, err = s.NextWithdrawalValidatorIndex() assert.ErrorContains(t, "NextWithdrawalValidatorIndex is not supported", err) }) } -func TestHasETH1WithdrawalCredentials(t *testing.T) { - creds := []byte{0xFA, 0xCC} - v := ðpb.Validator{WithdrawalCredentials: creds} - require.Equal(t, false, hasETH1WithdrawalCredential(v)) - creds = []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC} - v = ðpb.Validator{WithdrawalCredentials: creds} - require.Equal(t, true, hasETH1WithdrawalCredential(v)) - // No Withdrawal cred - v = ðpb.Validator{} - require.Equal(t, false, hasETH1WithdrawalCredential(v)) -} +func TestExpectedWithdrawals(t *testing.T) { + for _, stateVersion := range []int{version.Capella, version.Deneb, version.Electra} { + t.Run(version.String(stateVersion), func(t *testing.T) { + t.Run("no withdrawals", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + vals[i] = val + } + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, 0, len(expected)) + }) + t.Run("one fully withdrawable", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + require.NoError(t, s.SetNextWithdrawalValidatorIndex(20)) -func TestIsFullyWithdrawableValidator(t *testing.T) { - // No ETH1 prefix - creds := []byte{0xFA, 0xCC} - v := ðpb.Validator{ - WithdrawalCredentials: creds, - WithdrawableEpoch: 2, - } - require.Equal(t, false, isFullyWithdrawableValidator(v, 3)) - // Wrong withdrawable epoch - creds = []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC} - v = ðpb.Validator{ - WithdrawalCredentials: creds, - WithdrawableEpoch: 2, - } - require.Equal(t, false, isFullyWithdrawableValidator(v, 1)) - // Fully withdrawable - creds = []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte, 0xCC} - v = ðpb.Validator{ - WithdrawalCredentials: creds, - WithdrawableEpoch: 2, - } - require.Equal(t, true, isFullyWithdrawableValidator(v, 3)) -} + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := 0; i < 100; i++ { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte -func TestExpectedWithdrawals(t *testing.T) { - t.Run("no withdrawals", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 0, len(expected)) - }) - t.Run("one fully withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - nextWithdrawalValidatorIndex: 20, - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.validators[3].WithdrawableEpoch = primitives.Epoch(0) - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 1, len(expected)) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: s.balances[3], - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("one partially withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.balances[3] += params.BeaconConfig().MinDepositAmount - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 1, len(expected)) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MinDepositAmount, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("one partially and one fully withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - val.WithdrawalCredentials[31] = byte(i) - s.validators[i] = val - } - s.balances[3] += params.BeaconConfig().MinDepositAmount - s.validators[7].WithdrawableEpoch = primitives.Epoch(0) - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 2, len(expected)) + vals[i] = val + } + vals[3].WithdrawableEpoch = primitives.Epoch(0) + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) - withdrawalFull := &enginev1.Withdrawal{ - Index: 1, - ValidatorIndex: 7, - Address: s.validators[7].WithdrawalCredentials[12:], - Amount: s.balances[7], - } - withdrawalPartial := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MinDepositAmount, - } - require.DeepEqual(t, withdrawalPartial, expected[0]) - require.DeepEqual(t, withdrawalFull, expected[1]) - }) - t.Run("all partially withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance + 1 - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 0, - Address: s.validators[0].WithdrawalCredentials[12:], - Amount: 1, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("all fully withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(0), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 0, - Address: s.validators[0].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MaxEffectiveBalance, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("all fully and partially withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance + 1 - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(0), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 0, - Address: s.validators[0].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MaxEffectiveBalance + 1, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("one fully withdrawable but zero balance", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - nextWithdrawalValidatorIndex: 20, - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.validators[3].WithdrawableEpoch = primitives.Epoch(0) - s.balances[3] = 0 - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 0, len(expected)) - }) - t.Run("one partially withdrawable, one above sweep bound", func(t *testing.T) { - s := BeaconState{ - version: version.Capella, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.balances[3] += params.BeaconConfig().MinDepositAmount - s.balances[10] += params.BeaconConfig().MinDepositAmount - saved := params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep - params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = 10 - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 1, len(expected)) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MinDepositAmount, - } - require.DeepEqual(t, withdrawal, expected[0]) - params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = saved - }) -} + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(expected)) + withdrawal := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 3, + Address: vals[3].WithdrawalCredentials[12:], + Amount: params.BeaconConfig().MaxEffectiveBalance, + } + require.DeepEqual(t, withdrawal, expected[0]) + }) + t.Run("one partially withdrawable", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + require.NoError(t, s.SetNextWithdrawalValidatorIndex(20)) -func TestExpectedWithdrawals_Deneb(t *testing.T) { - t.Run("no withdrawals", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 0, len(expected)) - }) - t.Run("one fully withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - nextWithdrawalValidatorIndex: 20, - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.validators[3].WithdrawableEpoch = primitives.Epoch(0) - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 1, len(expected)) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: s.balances[3], - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("one partially withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.balances[3] += params.BeaconConfig().MinDepositAmount - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 1, len(expected)) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MinDepositAmount, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("one partially and one fully withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - val.WithdrawalCredentials[31] = byte(i) - s.validators[i] = val - } - s.balances[3] += params.BeaconConfig().MinDepositAmount - s.validators[7].WithdrawableEpoch = primitives.Epoch(0) - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, 2, len(expected)) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := 0; i < 100; i++ { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - withdrawalFull := &enginev1.Withdrawal{ - Index: 1, - ValidatorIndex: 7, - Address: s.validators[7].WithdrawalCredentials[12:], - Amount: s.balances[7], - } - withdrawalPartial := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MinDepositAmount, - } - require.DeepEqual(t, withdrawalPartial, expected[0]) - require.DeepEqual(t, withdrawalFull, expected[1]) - }) - t.Run("all partially withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance + 1 - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() - require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 0, - Address: s.validators[0].WithdrawalCredentials[12:], - Amount: 1, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("all fully withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(0), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() + vals[i] = val + } + balances[3] += params.BeaconConfig().MinDepositAmount + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(expected)) + withdrawal := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 3, + Address: vals[3].WithdrawalCredentials[12:], + Amount: params.BeaconConfig().MinDepositAmount, + } + require.DeepEqual(t, withdrawal, expected[0]) + }) + t.Run("one partially and one fully withdrawable", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + val.WithdrawalCredentials[31] = byte(i) + vals[i] = val + } + balances[3] += params.BeaconConfig().MinDepositAmount + vals[7].WithdrawableEpoch = primitives.Epoch(0) + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, 2, len(expected)) + + withdrawalFull := &enginev1.Withdrawal{ + Index: 1, + ValidatorIndex: 7, + Address: vals[7].WithdrawalCredentials[12:], + Amount: balances[7], + } + withdrawalPartial := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 3, + Address: vals[3].WithdrawalCredentials[12:], + Amount: params.BeaconConfig().MinDepositAmount, + } + require.DeepEqual(t, withdrawalPartial, expected[0]) + require.DeepEqual(t, withdrawalFull, expected[1]) + }) + t.Run("all partially withdrawable", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + 1 + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + val.WithdrawalCredentials[31] = byte(i) + vals[i] = val + } + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) + withdrawal := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 0, + Address: vals[0].WithdrawalCredentials[12:], + Amount: 1, + } + require.DeepEqual(t, withdrawal, expected[0]) + }) + t.Run("all fully withdrawable", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(0), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + val.WithdrawalCredentials[31] = byte(i) + vals[i] = val + } + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) + withdrawal := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 0, + Address: vals[0].WithdrawalCredentials[12:], + Amount: params.BeaconConfig().MaxEffectiveBalance, + } + require.DeepEqual(t, withdrawal, expected[0]) + }) + t.Run("all fully and partially withdrawable", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + 1 + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(0), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + val.WithdrawalCredentials[31] = byte(i) + vals[i] = val + } + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) + withdrawal := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 0, + Address: vals[0].WithdrawalCredentials[12:], + Amount: params.BeaconConfig().MaxEffectiveBalance + 1, + } + require.DeepEqual(t, withdrawal, expected[0]) + }) + t.Run("one fully withdrawable but zero balance", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + require.NoError(t, s.SetNextWithdrawalValidatorIndex(20)) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + val.WithdrawalCredentials[31] = byte(i) + vals[i] = val + } + vals[3].WithdrawableEpoch = primitives.Epoch(0) + balances[3] = 0 + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, 0, len(expected)) + }) + t.Run("one partially withdrawable, one above sweep bound", func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, stateVersion) + vals := make([]*ethpb.Validator, 100) + balances := make([]uint64, 100) + for i := range vals { + balances[i] = params.BeaconConfig().MaxEffectiveBalance + val := ðpb.Validator{ + WithdrawalCredentials: make([]byte, 32), + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + WithdrawableEpoch: primitives.Epoch(1), + } + val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + val.WithdrawalCredentials[31] = byte(i) + vals[i] = val + } + balances[3] += params.BeaconConfig().MinDepositAmount + balances[10] += params.BeaconConfig().MinDepositAmount + require.NoError(t, s.SetValidators(vals)) + require.NoError(t, s.SetBalances(balances)) + saved := params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep + params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = 10 + expected, _, err := s.ExpectedWithdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(expected)) + withdrawal := &enginev1.Withdrawal{ + Index: 0, + ValidatorIndex: 3, + Address: vals[3].WithdrawalCredentials[12:], + Amount: params.BeaconConfig().MinDepositAmount, + } + require.DeepEqual(t, withdrawal, expected[0]) + params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = saved + }) + }) + } + + t.Run("electra all pending partial withdrawals", func(t *testing.T) { + // Load a serialized Electra state from disk. + // This spectest has a fully hydrated beacon state with partial pending withdrawals. + serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/execution_layer_withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy") require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 0, - Address: s.validators[0].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MaxEffectiveBalance, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("all fully and partially withdrawable", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance + 1 - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(0), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - expected, err := s.ExpectedWithdrawals() + serializedSSZ, err := snappy.Decode(nil /* dst */, serializedBytes) require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxWithdrawalsPerPayload, uint64(len(expected))) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 0, - Address: s.validators[0].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MaxEffectiveBalance + 1, - } - require.DeepEqual(t, withdrawal, expected[0]) - }) - t.Run("one fully withdrawable but zero balance", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - nextWithdrawalValidatorIndex: 20, - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.validators[3].WithdrawableEpoch = primitives.Epoch(0) - s.balances[3] = 0 - expected, err := s.ExpectedWithdrawals() + pb := ðpb.BeaconStateElectra{} + require.NoError(t, pb.UnmarshalSSZ(serializedSSZ)) + s, err := state_native.InitializeFromProtoElectra(pb) require.NoError(t, err) - require.Equal(t, 0, len(expected)) - }) - t.Run("one partially withdrawable, one above sweep bound", func(t *testing.T) { - s := BeaconState{ - version: version.Deneb, - validators: make([]*ethpb.Validator, 100), - balances: make([]uint64, 100), - } - for i := range s.validators { - s.balances[i] = params.BeaconConfig().MaxEffectiveBalance - val := ðpb.Validator{ - WithdrawalCredentials: make([]byte, 32), - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - WithdrawableEpoch: primitives.Epoch(1), - } - val.WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - s.validators[i] = val - } - s.balances[3] += params.BeaconConfig().MinDepositAmount - s.balances[10] += params.BeaconConfig().MinDepositAmount - saved := params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep - params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = 10 - expected, err := s.ExpectedWithdrawals() + t.Log(s.NumPendingPartialWithdrawals()) + expected, partialWithdrawalsCount, err := s.ExpectedWithdrawals() require.NoError(t, err) - require.Equal(t, 1, len(expected)) - withdrawal := &enginev1.Withdrawal{ - Index: 0, - ValidatorIndex: 3, - Address: s.validators[3].WithdrawalCredentials[12:], - Amount: params.BeaconConfig().MinDepositAmount, - } - require.DeepEqual(t, withdrawal, expected[0]) - params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = saved + require.Equal(t, 8, len(expected)) + require.Equal(t, uint64(8), partialWithdrawalsCount) }) } diff --git a/beacon-chain/state/state-native/hasher.go b/beacon-chain/state/state-native/hasher.go index eaf3235949f0..92014a0767c2 100644 --- a/beacon-chain/state/state-native/hasher.go +++ b/beacon-chain/state/state-native/hasher.go @@ -3,6 +3,7 @@ package state_native import ( "context" "encoding/binary" + "fmt" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" @@ -38,6 +39,10 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b fieldRoots = make([][]byte, params.BeaconConfig().BeaconStateCapellaFieldCount) case version.Deneb: fieldRoots = make([][]byte, params.BeaconConfig().BeaconStateDenebFieldCount) + case version.Electra: + fieldRoots = make([][]byte, params.BeaconConfig().BeaconStateElectraFieldCount) + default: + return nil, fmt.Errorf("unknown state version %s", version.String(state.version)) } // Genesis time root. @@ -247,6 +252,15 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b fieldRoots[types.LatestExecutionPayloadHeaderDeneb.RealPosition()] = executionPayloadRoot[:] } + if state.version == version.Electra { + // Execution payload root. + executionPayloadRoot, err := state.latestExecutionPayloadHeaderElectra.HashTreeRoot() + if err != nil { + return nil, err + } + fieldRoots[types.LatestExecutionPayloadHeaderElectra.RealPosition()] = executionPayloadRoot[:] + } + if state.version >= version.Capella { // Next withdrawal index root. nextWithdrawalIndexRoot := make([]byte, 32) @@ -266,5 +280,52 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b fieldRoots[types.HistoricalSummaries.RealPosition()] = historicalSummaryRoot[:] } + if state.version >= version.Electra { + // DepositReceiptsStartIndex root. + drsiRoot := ssz.Uint64Root(state.depositReceiptsStartIndex) + fieldRoots[types.DepositReceiptsStartIndex.RealPosition()] = drsiRoot[:] + + // DepositBalanceToConsume root. + dbtcRoot := ssz.Uint64Root(uint64(state.depositBalanceToConsume)) + fieldRoots[types.DepositBalanceToConsume.RealPosition()] = dbtcRoot[:] + + // ExitBalanceToConsume root. + ebtcRoot := ssz.Uint64Root(uint64(state.exitBalanceToConsume)) + fieldRoots[types.ExitBalanceToConsume.RealPosition()] = ebtcRoot[:] + + // EarliestExitEpoch root. + eeeRoot := ssz.Uint64Root(uint64(state.earliestExitEpoch)) + fieldRoots[types.EarliestExitEpoch.RealPosition()] = eeeRoot[:] + + // ConsolidationBalanceToConsume root. + cbtcRoot := ssz.Uint64Root(uint64(state.consolidationBalanceToConsume)) + fieldRoots[types.ConsolidationBalanceToConsume.RealPosition()] = cbtcRoot[:] + + // EarliestConsolidationEpoch root. + eceRoot := ssz.Uint64Root(uint64(state.earliestConsolidationEpoch)) + fieldRoots[types.EarliestConsolidationEpoch.RealPosition()] = eceRoot[:] + + // PendingBalanceDeposits root. + pbdRoot, err := stateutil.PendingBalanceDepositsRoot(state.pendingBalanceDeposits) + if err != nil { + return nil, errors.Wrap(err, "could not compute pending balance deposits merkleization") + } + fieldRoots[types.PendingBalanceDeposits.RealPosition()] = pbdRoot[:] + + // PendingPartialWithdrawals root. + ppwRoot, err := stateutil.PendingPartialWithdrawalsRoot(state.pendingPartialWithdrawals) + if err != nil { + return nil, errors.Wrap(err, "could not compute pending partial withdrawals merkleization") + } + fieldRoots[types.PendingPartialWithdrawals.RealPosition()] = ppwRoot[:] + + // PendingConsolidations root. + pcRoot, err := stateutil.PendingConsolidationsRoot(state.pendingConsolidations) + if err != nil { + return nil, errors.Wrap(err, "could not compute pending consolidations merkleization") + } + fieldRoots[types.PendingConsolidations.RealPosition()] = pcRoot[:] + } + return fieldRoots, nil } diff --git a/beacon-chain/state/state-native/setters_balance_deposits.go b/beacon-chain/state/state-native/setters_balance_deposits.go new file mode 100644 index 000000000000..9bb398b13e15 --- /dev/null +++ b/beacon-chain/state/state-native/setters_balance_deposits.go @@ -0,0 +1,67 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// AppendPendingBalanceDeposit is a mutating call to the beacon state to create and append a pending +// balance deposit object on to the state. This method requires access to the Lock on the state and +// only applies in electra or later. +func (b *BeaconState) AppendPendingBalanceDeposit(index primitives.ValidatorIndex, amount uint64) error { + if b.version < version.Electra { + return errNotSupported("AppendPendingBalanceDeposit", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.sharedFieldReferences[types.PendingBalanceDeposits].MinusRef() + b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) + + b.pendingBalanceDeposits = append(b.pendingBalanceDeposits, ðpb.PendingBalanceDeposit{Index: index, Amount: amount}) + + b.markFieldAsDirty(types.PendingBalanceDeposits) + b.rebuildTrie[types.PendingBalanceDeposits] = true + return nil +} + +// SetPendingBalanceDeposits is a mutating call to the beacon state which replaces the pending +// balance deposit slice with the provided value. This method requires access to the Lock on the +// state and only applies in electra or later. +func (b *BeaconState) SetPendingBalanceDeposits(val []*ethpb.PendingBalanceDeposit) error { + if b.version < version.Electra { + return errNotSupported("SetPendingBalanceDeposits", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.sharedFieldReferences[types.PendingBalanceDeposits].MinusRef() + b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) + + b.pendingBalanceDeposits = val + + b.markFieldAsDirty(types.PendingBalanceDeposits) + b.rebuildTrie[types.PendingBalanceDeposits] = true + return nil +} + +// SetDepositBalanceToConsume is a mutating call to the beacon state which sets the deposit balance +// to consume value to the given value. This method requires access to the Lock on the state and +// only applies in electra or later. +func (b *BeaconState) SetDepositBalanceToConsume(dbtc math.Gwei) error { + if b.version < version.Electra { + return errNotSupported("SetDepositBalanceToConsume", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.depositBalanceToConsume = dbtc + + b.markFieldAsDirty(types.DepositBalanceToConsume) + b.rebuildTrie[types.DepositBalanceToConsume] = true + return nil +} diff --git a/beacon-chain/state/state-native/setters_balance_deposits_test.go b/beacon-chain/state/state-native/setters_balance_deposits_test.go new file mode 100644 index 000000000000..7c2b201230a3 --- /dev/null +++ b/beacon-chain/state/state-native/setters_balance_deposits_test.go @@ -0,0 +1,61 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestAppendPendingBalanceDeposit(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + pbd, err := s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(pbd)) + require.NoError(t, s.AppendPendingBalanceDeposit(1, 10)) + pbd, err = s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbd)) + require.Equal(t, primitives.ValidatorIndex(1), pbd[0].Index) + require.Equal(t, uint64(10), pbd[0].Amount) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.AppendPendingBalanceDeposit(1, 1)) +} + +func TestSetPendingBalanceDeposits(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + pbd, err := s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(pbd)) + require.NoError(t, s.SetPendingBalanceDeposits([]*eth.PendingBalanceDeposit{{}, {}, {}})) + pbd, err = s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 3, len(pbd)) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.SetPendingBalanceDeposits([]*eth.PendingBalanceDeposit{{}, {}, {}})) +} + +func TestSetDepositBalanceToConsume(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + require.NoError(t, s.SetDepositBalanceToConsume(10)) + dbtc, err := s.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(10), dbtc) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.SetDepositBalanceToConsume(10)) +} diff --git a/beacon-chain/state/state-native/setters_churn.go b/beacon-chain/state/state-native/setters_churn.go new file mode 100644 index 000000000000..bf7e67602a01 --- /dev/null +++ b/beacon-chain/state/state-native/setters_churn.go @@ -0,0 +1,80 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +// ExitEpochAndUpdateChurn computes the exit epoch and updates the churn. This method mutates the state. +// +// Spec definition: +// +// def compute_exit_epoch_and_update_churn(state: BeaconState, exit_balance: Gwei) -> Epoch: +// earliest_exit_epoch = max(state.earliest_exit_epoch, compute_activation_exit_epoch(get_current_epoch(state))) +// per_epoch_churn = get_activation_exit_churn_limit(state) +// # New epoch for exits. +// if state.earliest_exit_epoch < earliest_exit_epoch: +// exit_balance_to_consume = per_epoch_churn +// else: +// exit_balance_to_consume = state.exit_balance_to_consume +// +// # Exit doesn't fit in the current earliest epoch. +// if exit_balance > exit_balance_to_consume: +// balance_to_process = exit_balance - exit_balance_to_consume +// additional_epochs = (balance_to_process - 1) // per_epoch_churn + 1 +// earliest_exit_epoch += additional_epochs +// exit_balance_to_consume += additional_epochs * per_epoch_churn +// +// # Consume the balance and update state variables. +// state.exit_balance_to_consume = exit_balance_to_consume - exit_balance +// state.earliest_exit_epoch = earliest_exit_epoch +// +// return state.earliest_exit_epoch +func (b *BeaconState) ExitEpochAndUpdateChurn(exitBalance math.Gwei) (primitives.Epoch, error) { + if b.version < version.Electra { + return 0, errNotSupported("ExitEpochAndUpdateChurn", b.version) + } + + // This helper requires access to the RLock and cannot be called from within the write Lock. + activeBal, err := helpers.TotalActiveBalance(b) + if err != nil { + return 0, err + } + + b.lock.Lock() + defer b.lock.Unlock() + + earliestExitEpoch := max(b.earliestExitEpoch, helpers.ActivationExitEpoch(slots.ToEpoch(b.slot))) + perEpochChurn := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) // Guaranteed to be non-zero. + + // New epoch for exits + var exitBalanceToConsume math.Gwei + if b.earliestExitEpoch < earliestExitEpoch { + exitBalanceToConsume = perEpochChurn + } else { + exitBalanceToConsume = b.exitBalanceToConsume + } + + // Exit doesn't fit in the current earliest epoch. + if exitBalance > exitBalanceToConsume { + balanceToProcess := exitBalance - exitBalanceToConsume + additionalEpochs := primitives.Epoch((balanceToProcess-1)/perEpochChurn + 1) + earliestExitEpoch += additionalEpochs + exitBalanceToConsume += math.Gwei(additionalEpochs) * perEpochChurn + } + + // Consume the balance and update state variables. + b.exitBalanceToConsume = exitBalanceToConsume - exitBalance + b.earliestExitEpoch = earliestExitEpoch + + b.markFieldAsDirty(types.ExitBalanceToConsume) + b.rebuildTrie[types.ExitBalanceToConsume] = true + b.markFieldAsDirty(types.EarliestExitEpoch) + b.rebuildTrie[types.EarliestExitEpoch] = true + + return b.earliestExitEpoch, nil +} diff --git a/beacon-chain/state/state-native/setters_churn_test.go b/beacon-chain/state/state-native/setters_churn_test.go new file mode 100644 index 000000000000..2aa98382c473 --- /dev/null +++ b/beacon-chain/state/state-native/setters_churn_test.go @@ -0,0 +1,200 @@ +package state_native_test + +import ( + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +func TestExitEpochAndUpdateChurn_SpectestCase(t *testing.T) { + // Load a serialized Electra state from disk. + // The spec tests shows that the exit epoch is 262 for validator 0 performing a voluntary exit. + serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/voluntary_exit/pyspec_tests/exit_existing_churn_and_churn_limit_balance/pre.ssz_snappy") + require.NoError(t, err) + serializedSSZ, err := snappy.Decode(nil /* dst */, serializedBytes) + require.NoError(t, err) + pb := ð.BeaconStateElectra{} + require.NoError(t, pb.UnmarshalSSZ(serializedSSZ)) + s, err := state_native.InitializeFromProtoElectra(pb) + require.NoError(t, err) + + val, err := s.ValidatorAtIndex(0) + require.NoError(t, err) + + ee, err := s.ExitEpochAndUpdateChurn(math.Gwei(val.EffectiveBalance)) + require.NoError(t, err) + require.Equal(t, primitives.Epoch(262), ee) + + p := s.ToProto() + pb, ok := p.(*eth.BeaconStateElectra) + if !ok { + t.Fatal("wrong proto") + } + require.Equal(t, math.Gwei(127000000000), pb.ExitBalanceToConsume) + require.Equal(t, primitives.Epoch(262), pb.EarliestExitEpoch) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = s.ExitEpochAndUpdateChurn(10) + require.ErrorContains(t, "not supported", err) +} + +func TestExitEpochAndUpdateChurn(t *testing.T) { + slot := primitives.Slot(10_000_000) + epoch := slots.ToEpoch(slot) + t.Run("state earliest exit epoch is old", func(t *testing.T) { + st, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Slot: slot, + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra, + }, + }, + Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, + EarliestExitEpoch: epoch - params.BeaconConfig().MaxSeedLookahead*2, // Old, relative to slot. + ExitBalanceToConsume: math.Gwei(20_000_000), + }) + require.NoError(t, err) + activeBal, err := helpers.TotalActiveBalance(st) + require.NoError(t, err) + + exitBal := math.Gwei(10_000_000) + + wantExitBalToConsume := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) - exitBal + + ee, err := st.ExitEpochAndUpdateChurn(exitBal) + require.NoError(t, err) + + wantExitEpoch := helpers.ActivationExitEpoch(epoch) + require.Equal(t, wantExitEpoch, ee) + + p := st.ToProto() + pb, ok := p.(*eth.BeaconStateElectra) + if !ok { + t.Fatal("wrong proto") + } + require.Equal(t, wantExitBalToConsume, pb.ExitBalanceToConsume) + require.Equal(t, wantExitEpoch, pb.EarliestExitEpoch) + }) + + t.Run("state exit bal to consume is less than activation exit churn limit", func(t *testing.T) { + st, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Slot: slot, + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra, + }, + }, + Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, + EarliestExitEpoch: epoch, + ExitBalanceToConsume: math.Gwei(20_000_000), + }) + require.NoError(t, err) + activeBal, err := helpers.TotalActiveBalance(st) + require.NoError(t, err) + + activationExitChurnLimit := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) + exitBal := activationExitChurnLimit * 2 + + wantExitBalToConsume := math.Gwei(0) + + ee, err := st.ExitEpochAndUpdateChurn(exitBal) + require.NoError(t, err) + + wantExitEpoch := helpers.ActivationExitEpoch(epoch) + 1 + require.Equal(t, wantExitEpoch, ee) + + p := st.ToProto() + pb, ok := p.(*eth.BeaconStateElectra) + if !ok { + t.Fatal("wrong proto") + } + require.Equal(t, wantExitBalToConsume, pb.ExitBalanceToConsume) + require.Equal(t, wantExitEpoch, pb.EarliestExitEpoch) + }) + + t.Run("state earliest exit epoch is in the future and exit balance is less than state", func(t *testing.T) { + st, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Slot: slot, + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra, + }, + }, + Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, + EarliestExitEpoch: epoch + 10_000, + ExitBalanceToConsume: math.Gwei(20_000_000), + }) + require.NoError(t, err) + + exitBal := math.Gwei(10_000_000) + + wantExitBalToConsume := math.Gwei(20_000_000) - exitBal + + ee, err := st.ExitEpochAndUpdateChurn(exitBal) + require.NoError(t, err) + + wantExitEpoch := epoch + 10_000 + require.Equal(t, wantExitEpoch, ee) + + p := st.ToProto() + pb, ok := p.(*eth.BeaconStateElectra) + if !ok { + t.Fatal("wrong proto") + } + require.Equal(t, wantExitBalToConsume, pb.ExitBalanceToConsume) + require.Equal(t, wantExitEpoch, pb.EarliestExitEpoch) + }) + + t.Run("state earliest exit epoch is in the future and exit balance exceeds state", func(t *testing.T) { + st, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Slot: slot, + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra, + }, + }, + Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, + EarliestExitEpoch: epoch + 10_000, + ExitBalanceToConsume: math.Gwei(20_000_000), + }) + require.NoError(t, err) + + exitBal := math.Gwei(40_000_000) + activeBal, err := helpers.TotalActiveBalance(st) + require.NoError(t, err) + activationExitChurnLimit := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) + wantExitBalToConsume := activationExitChurnLimit - 20_000_000 + + ee, err := st.ExitEpochAndUpdateChurn(exitBal) + require.NoError(t, err) + + wantExitEpoch := epoch + 10_000 + 1 + require.Equal(t, wantExitEpoch, ee) + + p := st.ToProto() + pb, ok := p.(*eth.BeaconStateElectra) + if !ok { + t.Fatal("wrong proto") + } + require.Equal(t, wantExitBalToConsume, pb.ExitBalanceToConsume) + require.Equal(t, wantExitEpoch, pb.EarliestExitEpoch) + }) + + t.Run("earlier than electra returns error", func(t *testing.T) { + st, err := state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + _, err = st.ExitEpochAndUpdateChurn(0) + require.ErrorContains(t, "is not supported", err) + }) +} diff --git a/beacon-chain/state/state-native/setters_consolidation.go b/beacon-chain/state/state-native/setters_consolidation.go new file mode 100644 index 000000000000..c76e1ae5c091 --- /dev/null +++ b/beacon-chain/state/state-native/setters_consolidation.go @@ -0,0 +1,84 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// AppendPendingConsolidation is a mutating call to the beacon state which appends the provided +// pending consolidation to the end of the slice on the state. This method requires access to the +// Lock on the state and only applies in electra or later. +func (b *BeaconState) AppendPendingConsolidation(val *ethpb.PendingConsolidation) error { + if b.version < version.Electra { + return errNotSupported("AppendPendingConsolidation", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.sharedFieldReferences[types.PendingConsolidations].MinusRef() + b.sharedFieldReferences[types.PendingConsolidations] = stateutil.NewRef(1) + + b.pendingConsolidations = append(b.pendingConsolidations, val) + + b.markFieldAsDirty(types.PendingConsolidations) + b.rebuildTrie[types.PendingConsolidations] = true + return nil +} + +// SetPendingConsolidations is a mutating call to the beacon state which replaces the slice on the +// state with the given value. This method requires access to the Lock on the state and only applies +// in electra or later. +func (b *BeaconState) SetPendingConsolidations(val []*ethpb.PendingConsolidation) error { + if b.version < version.Electra { + return errNotSupported("SetPendingConsolidations", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.sharedFieldReferences[types.PendingConsolidations].MinusRef() + b.sharedFieldReferences[types.PendingConsolidations] = stateutil.NewRef(1) + + b.pendingConsolidations = val + + b.markFieldAsDirty(types.PendingConsolidations) + b.rebuildTrie[types.PendingConsolidations] = true + return nil +} + +// SetEarliestConsolidationEpoch is a mutating call to the beacon state which sets the earlest +// consolidation epoch value. This method requires access to the Lock on the state and only applies +// in electra or later. +func (b *BeaconState) SetEarliestConsolidationEpoch(epoch primitives.Epoch) error { + if b.version < version.Electra { + return errNotSupported("SetEarliestConsolidationEpoch", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.earliestConsolidationEpoch = epoch + + b.markFieldAsDirty(types.EarliestConsolidationEpoch) + b.rebuildTrie[types.EarliestConsolidationEpoch] = true + return nil +} + +// SetConsolidationBalanceToConsume is a mutating call to the beacon state which sets the value of +// the consolidation balance to consume to the provided value. This method requires access to the +// Lock on the state and only applies in electra or later. +func (b *BeaconState) SetConsolidationBalanceToConsume(balance math.Gwei) error { + if b.version < version.Electra { + return errNotSupported("SetConsolidationBalanceToConsume", b.version) + } + b.lock.Lock() + defer b.lock.Unlock() + + b.consolidationBalanceToConsume = balance + + b.markFieldAsDirty(types.ConsolidationBalanceToConsume) + b.rebuildTrie[types.ConsolidationBalanceToConsume] = true + return nil +} diff --git a/beacon-chain/state/state-native/setters_consolidation_test.go b/beacon-chain/state/state-native/setters_consolidation_test.go new file mode 100644 index 000000000000..1a2ee153cef4 --- /dev/null +++ b/beacon-chain/state/state-native/setters_consolidation_test.go @@ -0,0 +1,76 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestAppendPendingConsolidation(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + num, err := s.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(0), num) + require.NoError(t, s.AppendPendingConsolidation(ð.PendingConsolidation{})) + num, err = s.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(1), num) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.AppendPendingConsolidation(ð.PendingConsolidation{})) +} + +func TestSetPendingConsolidations(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + num, err := s.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(0), num) + require.NoError(t, s.SetPendingConsolidations([]*eth.PendingConsolidation{{}, {}, {}})) + num, err = s.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(3), num) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.SetPendingConsolidations([]*eth.PendingConsolidation{{}, {}, {}})) +} + +func TestSetEarliestConsolidationEpoch(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + ece, err := s.EarliestConsolidationEpoch() + require.NoError(t, err) + require.Equal(t, primitives.Epoch(0), ece) + require.NoError(t, s.SetEarliestConsolidationEpoch(10)) + ece, err = s.EarliestConsolidationEpoch() + require.NoError(t, err) + require.Equal(t, primitives.Epoch(10), ece) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.SetEarliestConsolidationEpoch(10)) +} + +func TestSetConsolidationBalanceToConsume(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + require.NoError(t, s.SetConsolidationBalanceToConsume(10)) + cbtc, err := s.ConsolidationBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(10), cbtc) + + // Fails for versions older than electra + s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + require.ErrorContains(t, "not supported", s.SetConsolidationBalanceToConsume(10)) +} diff --git a/beacon-chain/state/state-native/setters_deposit_receipts.go b/beacon-chain/state/state-native/setters_deposit_receipts.go new file mode 100644 index 000000000000..bd24820a99c2 --- /dev/null +++ b/beacon-chain/state/state-native/setters_deposit_receipts.go @@ -0,0 +1,21 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// SetDepositReceiptsStartIndex for the beacon state. Updates the DepositReceiptsStartIndex +func (b *BeaconState) SetDepositReceiptsStartIndex(index uint64) error { + if b.version < version.Electra { + return errNotSupported("SetDepositReceiptsStartIndex", b.version) + } + + b.lock.Lock() + defer b.lock.Unlock() + + b.depositReceiptsStartIndex = index + b.markFieldAsDirty(types.DepositReceiptsStartIndex) + b.rebuildTrie[types.DepositReceiptsStartIndex] = true + return nil +} diff --git a/beacon-chain/state/state-native/setters_deposit_receipts_test.go b/beacon-chain/state/state-native/setters_deposit_receipts_test.go new file mode 100644 index 000000000000..8c02bfd5b615 --- /dev/null +++ b/beacon-chain/state/state-native/setters_deposit_receipts_test.go @@ -0,0 +1,27 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestSetDepositReceiptsStartIndex(t *testing.T) { + t.Run("previous fork returns expected error", func(t *testing.T) { + dState, _ := util.DeterministicGenesisState(t, 1) + require.ErrorContains(t, "is not supported", dState.SetDepositReceiptsStartIndex(1)) + }) + t.Run("electra sets expected value", func(t *testing.T) { + old := uint64(2) + dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositReceiptsStartIndex: old}) + require.NoError(t, err) + want := uint64(3) + require.NoError(t, dState.SetDepositReceiptsStartIndex(want)) + got, err := dState.DepositReceiptsStartIndex() + require.NoError(t, err) + require.Equal(t, want, got) + }) +} diff --git a/beacon-chain/state/state-native/setters_payload_header.go b/beacon-chain/state/state-native/setters_payload_header.go index 3b36f7f5b658..9187aec5ba0c 100644 --- a/beacon-chain/state/state-native/setters_payload_header.go +++ b/beacon-chain/state/state-native/setters_payload_header.go @@ -1,6 +1,8 @@ package state_native import ( + "fmt" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -21,6 +23,9 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa switch header := val.Proto().(type) { case *enginev1.ExecutionPayload: + if b.version != version.Bellatrix { + return fmt.Errorf("wrong state version (%s) for bellatrix execution payload", version.String(b.version)) + } latest, err := consensusblocks.PayloadToHeader(val) if err != nil { return errors.Wrap(err, "could not convert payload to header") @@ -29,6 +34,9 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa b.markFieldAsDirty(types.LatestExecutionPayloadHeader) return nil case *enginev1.ExecutionPayloadCapella: + if b.version != version.Capella { + return fmt.Errorf("wrong state version (%s) for capella execution payload", version.String(b.version)) + } latest, err := consensusblocks.PayloadToHeaderCapella(val) if err != nil { return errors.Wrap(err, "could not convert payload to header") @@ -37,6 +45,9 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella) return nil case *enginev1.ExecutionPayloadDeneb: + if b.version != version.Deneb { + return fmt.Errorf("wrong state version (%s) for deneb execution payload", version.String(b.version)) + } latest, err := consensusblocks.PayloadToHeaderDeneb(val) if err != nil { return errors.Wrap(err, "could not convert payload to header") @@ -44,18 +55,49 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa b.latestExecutionPayloadHeaderDeneb = latest b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb) return nil + case *enginev1.ExecutionPayloadElectra: + if b.version != version.Electra { + return fmt.Errorf("wrong state version (%s) for electra execution payload", version.String(b.version)) + } + eVal, ok := val.(interfaces.ExecutionDataElectra) + if !ok { + return fmt.Errorf("could not cast %T to ExecutionDataElectra: %w", val, interfaces.ErrInvalidCast) + } + latest, err := consensusblocks.PayloadToHeaderElectra(eVal) + if err != nil { + return errors.Wrap(err, "could not convert payload to header") + } + b.latestExecutionPayloadHeaderElectra = latest + b.markFieldAsDirty(types.LatestExecutionPayloadHeaderElectra) + return nil case *enginev1.ExecutionPayloadHeader: + if b.version != version.Bellatrix { + return fmt.Errorf("wrong state version (%s) for bellatrix execution payload header", version.String(b.version)) + } b.latestExecutionPayloadHeader = header b.markFieldAsDirty(types.LatestExecutionPayloadHeader) return nil case *enginev1.ExecutionPayloadHeaderCapella: + if b.version != version.Capella { + return fmt.Errorf("wrong state version (%s) for capella execution payload header", version.String(b.version)) + } b.latestExecutionPayloadHeaderCapella = header b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella) return nil case *enginev1.ExecutionPayloadHeaderDeneb: + if b.version != version.Deneb { + return fmt.Errorf("wrong state version (%s) for deneb execution payload header", version.String(b.version)) + } b.latestExecutionPayloadHeaderDeneb = header b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb) return nil + case *enginev1.ExecutionPayloadHeaderElectra: + if b.version != version.Electra { + return fmt.Errorf("wrong state version (%s) for electra execution payload header", version.String(b.version)) + } + b.latestExecutionPayloadHeaderElectra = header + b.markFieldAsDirty(types.LatestExecutionPayloadHeaderElectra) + return nil default: return errors.New("value must be an execution payload header") } diff --git a/beacon-chain/state/state-native/setters_payload_header_test.go b/beacon-chain/state/state-native/setters_payload_header_test.go new file mode 100644 index 000000000000..d8d9fb17cbba --- /dev/null +++ b/beacon-chain/state/state-native/setters_payload_header_test.go @@ -0,0 +1,107 @@ +package state_native_test + +import ( + "fmt" + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestSetLatestExecutionPayloadHeader(t *testing.T) { + versionOffset := version.Bellatrix // PayloadHeader only applies in Bellatrix and beyond. + payloads := []interfaces.ExecutionData{ + func() interfaces.ExecutionData { + e := util.NewBeaconBlockBellatrix().Block.Body.ExecutionPayload + ee, err := blocks.WrappedExecutionPayload(e) + require.NoError(t, err) + return ee + }(), + func() interfaces.ExecutionData { + e := util.NewBeaconBlockCapella().Block.Body.ExecutionPayload + ee, err := blocks.WrappedExecutionPayloadCapella(e, nil) + require.NoError(t, err) + return ee + }(), + func() interfaces.ExecutionData { + e := util.NewBeaconBlockDeneb().Block.Body.ExecutionPayload + ee, err := blocks.WrappedExecutionPayloadDeneb(e, nil) + require.NoError(t, err) + return ee + }(), + func() interfaces.ExecutionData { + e := util.NewBeaconBlockElectra().Block.Body.ExecutionPayload + ee, err := blocks.WrappedExecutionPayloadElectra(e, nil) + require.NoError(t, err) + return ee + }(), + } + + payloadHeaders := []interfaces.ExecutionData{ + func() interfaces.ExecutionData { + e := util.NewBlindedBeaconBlockBellatrix().Block.Body.ExecutionPayloadHeader + ee, err := blocks.WrappedExecutionPayloadHeader(e) + require.NoError(t, err) + return ee + }(), + func() interfaces.ExecutionData { + e := util.NewBlindedBeaconBlockCapella().Block.Body.ExecutionPayloadHeader + ee, err := blocks.WrappedExecutionPayloadHeaderCapella(e, nil) + require.NoError(t, err) + return ee + }(), + func() interfaces.ExecutionData { + e := util.NewBlindedBeaconBlockDeneb().Message.Body.ExecutionPayloadHeader + ee, err := blocks.WrappedExecutionPayloadHeaderDeneb(e, nil) + require.NoError(t, err) + return ee + }(), + func() interfaces.ExecutionData { + e := util.NewBlindedBeaconBlockElectra().Message.Body.ExecutionPayloadHeader + ee, err := blocks.WrappedExecutionPayloadHeaderElectra(e, nil) + require.NoError(t, err) + return ee + }(), + } + + t.Run("can set payload", func(t *testing.T) { + for i, p := range payloads { + t.Run(version.String(i+versionOffset), func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, i+versionOffset) + require.NoError(t, s.SetLatestExecutionPayloadHeader(p)) + }) + } + }) + + t.Run("can set payload header", func(t *testing.T) { + for i, ph := range payloadHeaders { + t.Run(version.String(i+versionOffset), func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, i+versionOffset) + require.NoError(t, s.SetLatestExecutionPayloadHeader(ph)) + }) + } + }) + + t.Run("mismatched type version returns error", func(t *testing.T) { + require.Equal(t, len(payloads), len(payloadHeaders), "This test will fail if the payloads and payload headers are not same length") + for i := 0; i < len(payloads); i++ { + for j := 0; j < len(payloads); j++ { + if i == j { + continue + } + t.Run(fmt.Sprintf("%s state with %s payload", version.String(i+versionOffset), version.String(j+versionOffset)), func(t *testing.T) { + s := state_native.EmptyStateFromVersion(t, i+versionOffset) + p := payloads[j] + require.ErrorContains(t, "wrong state version", s.SetLatestExecutionPayloadHeader(p)) + ph := payloadHeaders[j] + require.ErrorContains(t, "wrong state version", s.SetLatestExecutionPayloadHeader(ph)) + }) + } + } + }) + +} diff --git a/beacon-chain/state/state-native/setters_withdrawal.go b/beacon-chain/state/state-native/setters_withdrawal.go index 5548fe0140e4..36b97a826768 100644 --- a/beacon-chain/state/state-native/setters_withdrawal.go +++ b/beacon-chain/state/state-native/setters_withdrawal.go @@ -1,8 +1,12 @@ package state_native import ( + "errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -34,3 +38,56 @@ func (b *BeaconState) SetNextWithdrawalValidatorIndex(i primitives.ValidatorInde b.markFieldAsDirty(types.NextWithdrawalValidatorIndex) return nil } + +// AppendPendingPartialWithdrawal is a mutating call to the beacon state which appends the given +// value to the end of the pending partial withdrawals slice in the state. This method requires +// access to the Lock on the state and only applies in electra or later. +func (b *BeaconState) AppendPendingPartialWithdrawal(ppw *eth.PendingPartialWithdrawal) error { + if b.version < version.Electra { + return errNotSupported("AppendPendingPartialWithdrawal", b.version) + } + + if ppw == nil { + return errors.New("cannot append nil pending partial withdrawal") + } + + b.lock.Lock() + defer b.lock.Unlock() + + b.sharedFieldReferences[types.PendingPartialWithdrawals].MinusRef() + b.sharedFieldReferences[types.PendingPartialWithdrawals] = stateutil.NewRef(1) + + b.pendingPartialWithdrawals = append(b.pendingPartialWithdrawals, ppw) + + b.markFieldAsDirty(types.PendingPartialWithdrawals) + b.rebuildTrie[types.PendingPartialWithdrawals] = true + return nil +} + +// DequeuePartialWithdrawals removes the partial withdrawals from the beginning of the partial withdrawals list. +func (b *BeaconState) DequeuePartialWithdrawals(n uint64) error { + if b.version < version.Electra { + return errNotSupported("DequeuePartialWithdrawals", b.version) + } + + if n > uint64(len(b.pendingPartialWithdrawals)) { + return errors.New("cannot dequeue more withdrawals than are in the queue") + } + + if n == 0 { + return nil // Don't wait on a lock for no reason. + } + + b.lock.Lock() + defer b.lock.Unlock() + + b.sharedFieldReferences[types.PendingPartialWithdrawals].MinusRef() + b.sharedFieldReferences[types.PendingPartialWithdrawals] = stateutil.NewRef(1) + + b.pendingPartialWithdrawals = b.pendingPartialWithdrawals[n:] + + b.markFieldAsDirty(types.PendingPartialWithdrawals) + b.rebuildTrie[types.PendingPartialWithdrawals] = true + + return nil +} diff --git a/beacon-chain/state/state-native/setters_withdrawal_test.go b/beacon-chain/state/state-native/setters_withdrawal_test.go index 8cb3ec2639aa..d7627d397547 100644 --- a/beacon-chain/state/state-native/setters_withdrawal_test.go +++ b/beacon-chain/state/state-native/setters_withdrawal_test.go @@ -5,6 +5,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -52,3 +53,68 @@ func TestSetNextWithdrawalValidatorIndex_Deneb(t *testing.T) { require.Equal(t, primitives.ValidatorIndex(5), s.nextWithdrawalValidatorIndex) require.Equal(t, true, s.dirtyFields[types.NextWithdrawalValidatorIndex]) } + +func TestDequeuePendingWithdrawals(t *testing.T) { + s, err := InitializeFromProtoElectra(ð.BeaconStateElectra{ + PendingPartialWithdrawals: []*eth.PendingPartialWithdrawal{ + {}, + {}, + {}, + }, + }) + require.NoError(t, err) + + // 2 of 3 should be OK + num, err := s.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(3), num) + require.NoError(t, s.DequeuePartialWithdrawals(2)) + num, err = s.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(1), num) + + // 2 of 1 exceeds the limit and an error should be returned + num, err = s.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(1), num) + require.ErrorContains(t, "cannot dequeue more withdrawals than are in the queue", s.DequeuePartialWithdrawals(2)) + + // Removing all pending partial withdrawals should be OK. + num, err = s.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(1), num) + require.NoError(t, s.DequeuePartialWithdrawals(1)) + num, err = s.Copy().NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(0), num) + + s, err = InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + + require.ErrorContains(t, "is not supported", s.DequeuePartialWithdrawals(0)) +} + +func TestAppendPendingWithdrawals(t *testing.T) { + s, err := InitializeFromProtoElectra(ð.BeaconStateElectra{ + PendingPartialWithdrawals: []*eth.PendingPartialWithdrawal{ + {}, + {}, + {}, + }, + }) + require.NoError(t, err) + num, err := s.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(3), num) + require.NoError(t, s.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{})) + num, err = s.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(4), num) + + require.ErrorContains(t, "cannot append nil pending partial withdrawal", s.AppendPendingPartialWithdrawal(nil)) + + s, err = InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) + require.NoError(t, err) + + require.ErrorContains(t, "is not supported", s.AppendPendingPartialWithdrawal(nil)) +} diff --git a/beacon-chain/state/state-native/spec_parameters.go b/beacon-chain/state/state-native/spec_parameters.go index 697afd6e73e2..1612a71efbdf 100644 --- a/beacon-chain/state/state-native/spec_parameters.go +++ b/beacon-chain/state/state-native/spec_parameters.go @@ -7,7 +7,7 @@ import ( func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) { switch b.version { - case version.Bellatrix, version.Capella, version.Deneb: + case version.Bellatrix, version.Capella, version.Deneb, version.Electra: return params.BeaconConfig().ProportionalSlashingMultiplierBellatrix, nil case version.Altair: return params.BeaconConfig().ProportionalSlashingMultiplierAltair, nil @@ -19,7 +19,7 @@ func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) { func (b *BeaconState) InactivityPenaltyQuotient() (uint64, error) { switch b.version { - case version.Bellatrix, version.Capella, version.Deneb: + case version.Bellatrix, version.Capella, version.Deneb, version.Electra: return params.BeaconConfig().InactivityPenaltyQuotientBellatrix, nil case version.Altair: return params.BeaconConfig().InactivityPenaltyQuotientAltair, nil diff --git a/beacon-chain/state/state-native/state_test.go b/beacon-chain/state/state-native/state_test.go index faed7b7f6a30..f5ddef9d32d9 100644 --- a/beacon-chain/state/state-native/state_test.go +++ b/beacon-chain/state/state-native/state_test.go @@ -502,3 +502,13 @@ func generateState(t *testing.T) state.BeaconState { assert.NoError(t, err) return newState } + +func EmptyStateFromVersion(t *testing.T, v int) state.BeaconState { + gen := generateState(t) + s, ok := gen.(*BeaconState) + if !ok { + t.Fatal("not a beacon state") + } + s.version = v + return s +} diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 93fa41f311d7..60dc8acd6033 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -2,6 +2,7 @@ package state_native import ( "context" + "fmt" "runtime" "sort" @@ -93,17 +94,36 @@ var denebFields = append( types.HistoricalSummaries, ) +var electraFields = append( + altairFields, + types.NextWithdrawalIndex, + types.NextWithdrawalValidatorIndex, + types.HistoricalSummaries, + types.LatestExecutionPayloadHeaderElectra, + types.DepositReceiptsStartIndex, + types.DepositBalanceToConsume, + types.ExitBalanceToConsume, + types.EarliestExitEpoch, + types.ConsolidationBalanceToConsume, + types.EarliestConsolidationEpoch, + types.PendingBalanceDeposits, + types.PendingPartialWithdrawals, + types.PendingConsolidations, +) + const ( phase0SharedFieldRefCount = 10 altairSharedFieldRefCount = 11 bellatrixSharedFieldRefCount = 12 capellaSharedFieldRefCount = 14 denebSharedFieldRefCount = 14 + electraSharedFieldRefCount = 17 experimentalStatePhase0SharedFieldRefCount = 5 experimentalStateAltairSharedFieldRefCount = 5 experimentalStateBellatrixSharedFieldRefCount = 6 experimentalStateCapellaSharedFieldRefCount = 8 experimentalStateDenebSharedFieldRefCount = 8 + experimentalStateElectraSharedFieldRefCount = 11 ) // InitializeFromProtoPhase0 the beacon state from a protobuf representation. @@ -131,6 +151,10 @@ func InitializeFromProtoDeneb(st *ethpb.BeaconStateDeneb) (state.BeaconState, er return InitializeFromProtoUnsafeDeneb(proto.Clone(st).(*ethpb.BeaconStateDeneb)) } +func InitializeFromProtoElectra(st *ethpb.BeaconStateElectra) (state.BeaconState, error) { + return InitializeFromProtoUnsafeElectra(proto.Clone(st).(*ethpb.BeaconStateElectra)) +} + // InitializeFromProtoUnsafePhase0 directly uses the beacon state protobuf fields // and sets them as fields of the BeaconState type. func InitializeFromProtoUnsafePhase0(st *ethpb.BeaconState) (state.BeaconState, error) { @@ -683,6 +707,131 @@ func InitializeFromProtoUnsafeDeneb(st *ethpb.BeaconStateDeneb) (state.BeaconSta return b, nil } +// InitializeFromProtoUnsafeElectra directly uses the beacon state protobuf fields +// and sets them as fields of the BeaconState type. +func InitializeFromProtoUnsafeElectra(st *ethpb.BeaconStateElectra) (state.BeaconState, error) { + if st == nil { + return nil, errors.New("received nil state") + } + + hRoots := customtypes.HistoricalRoots(make([][32]byte, len(st.HistoricalRoots))) + for i, r := range st.HistoricalRoots { + hRoots[i] = bytesutil.ToBytes32(r) + } + + fieldCount := params.BeaconConfig().BeaconStateElectraFieldCount + b := &BeaconState{ + version: version.Electra, + genesisTime: st.GenesisTime, + genesisValidatorsRoot: bytesutil.ToBytes32(st.GenesisValidatorsRoot), + slot: st.Slot, + fork: st.Fork, + latestBlockHeader: st.LatestBlockHeader, + historicalRoots: hRoots, + eth1Data: st.Eth1Data, + eth1DataVotes: st.Eth1DataVotes, + eth1DepositIndex: st.Eth1DepositIndex, + slashings: st.Slashings, + previousEpochParticipation: st.PreviousEpochParticipation, + currentEpochParticipation: st.CurrentEpochParticipation, + justificationBits: st.JustificationBits, + previousJustifiedCheckpoint: st.PreviousJustifiedCheckpoint, + currentJustifiedCheckpoint: st.CurrentJustifiedCheckpoint, + finalizedCheckpoint: st.FinalizedCheckpoint, + currentSyncCommittee: st.CurrentSyncCommittee, + nextSyncCommittee: st.NextSyncCommittee, + latestExecutionPayloadHeaderElectra: st.LatestExecutionPayloadHeader, + nextWithdrawalIndex: st.NextWithdrawalIndex, + nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex, + historicalSummaries: st.HistoricalSummaries, + depositReceiptsStartIndex: st.DepositReceiptsStartIndex, + depositBalanceToConsume: st.DepositBalanceToConsume, + exitBalanceToConsume: st.ExitBalanceToConsume, + earliestExitEpoch: st.EarliestExitEpoch, + consolidationBalanceToConsume: st.ConsolidationBalanceToConsume, + earliestConsolidationEpoch: st.EarliestConsolidationEpoch, + pendingBalanceDeposits: st.PendingBalanceDeposits, + pendingPartialWithdrawals: st.PendingPartialWithdrawals, + pendingConsolidations: st.PendingConsolidations, + + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + } + + if features.Get().EnableExperimentalState { + b.blockRootsMultiValue = NewMultiValueBlockRoots(st.BlockRoots) + b.stateRootsMultiValue = NewMultiValueStateRoots(st.StateRoots) + b.randaoMixesMultiValue = NewMultiValueRandaoMixes(st.RandaoMixes) + b.balancesMultiValue = NewMultiValueBalances(st.Balances) + b.validatorsMultiValue = NewMultiValueValidators(st.Validators) + b.inactivityScoresMultiValue = NewMultiValueInactivityScores(st.InactivityScores) + b.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, experimentalStateElectraSharedFieldRefCount) + } else { + bRoots := make([][32]byte, fieldparams.BlockRootsLength) + for i, r := range st.BlockRoots { + bRoots[i] = bytesutil.ToBytes32(r) + } + b.blockRoots = bRoots + + sRoots := make([][32]byte, fieldparams.StateRootsLength) + for i, r := range st.StateRoots { + sRoots[i] = bytesutil.ToBytes32(r) + } + b.stateRoots = sRoots + + mixes := make([][32]byte, fieldparams.RandaoMixesLength) + for i, m := range st.RandaoMixes { + mixes[i] = bytesutil.ToBytes32(m) + } + b.randaoMixes = mixes + + b.balances = st.Balances + b.validators = st.Validators + b.inactivityScores = st.InactivityScores + + b.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, electraSharedFieldRefCount) + } + + for _, f := range electraFields { + b.dirtyFields[f] = true + b.rebuildTrie[f] = true + b.dirtyIndices[f] = []uint64{} + trie, err := fieldtrie.NewFieldTrie(f, types.BasicArray, nil, 0) + if err != nil { + return nil, err + } + b.stateFieldLeaves[f] = trie + } + + // Initialize field reference tracking for shared data. + b.sharedFieldReferences[types.HistoricalRoots] = stateutil.NewRef(1) + b.sharedFieldReferences[types.Eth1DataVotes] = stateutil.NewRef(1) + b.sharedFieldReferences[types.Slashings] = stateutil.NewRef(1) + b.sharedFieldReferences[types.PreviousEpochParticipationBits] = stateutil.NewRef(1) + b.sharedFieldReferences[types.CurrentEpochParticipationBits] = stateutil.NewRef(1) + b.sharedFieldReferences[types.LatestExecutionPayloadHeaderElectra] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.HistoricalSummaries] = stateutil.NewRef(1) // New in Capella. + b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.PendingPartialWithdrawals] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.PendingConsolidations] = stateutil.NewRef(1) // New in Electra. + if !features.Get().EnableExperimentalState { + b.sharedFieldReferences[types.BlockRoots] = stateutil.NewRef(1) + b.sharedFieldReferences[types.StateRoots] = stateutil.NewRef(1) + b.sharedFieldReferences[types.RandaoMixes] = stateutil.NewRef(1) + b.sharedFieldReferences[types.Balances] = stateutil.NewRef(1) + b.sharedFieldReferences[types.Validators] = stateutil.NewRef(1) + b.sharedFieldReferences[types.InactivityScores] = stateutil.NewRef(1) + } + + state.Count.Inc() + // Finalizer runs when dst is being destroyed in garbage collection. + runtime.SetFinalizer(b, finalizerCleanup) + return b, nil +} + // Copy returns a deep copy of the beacon state. func (b *BeaconState) Copy() state.BeaconState { b.lock.RLock() @@ -700,17 +849,25 @@ func (b *BeaconState) Copy() state.BeaconState { fieldCount = params.BeaconConfig().BeaconStateCapellaFieldCount case version.Deneb: fieldCount = params.BeaconConfig().BeaconStateDenebFieldCount + case version.Electra: + fieldCount = params.BeaconConfig().BeaconStateElectraFieldCount } dst := &BeaconState{ version: b.version, // Primitive types, safe to copy. - genesisTime: b.genesisTime, - slot: b.slot, - eth1DepositIndex: b.eth1DepositIndex, - nextWithdrawalIndex: b.nextWithdrawalIndex, - nextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, + genesisTime: b.genesisTime, + slot: b.slot, + eth1DepositIndex: b.eth1DepositIndex, + nextWithdrawalIndex: b.nextWithdrawalIndex, + nextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, + depositReceiptsStartIndex: b.depositReceiptsStartIndex, + depositBalanceToConsume: b.depositBalanceToConsume, + exitBalanceToConsume: b.exitBalanceToConsume, + earliestExitEpoch: b.earliestExitEpoch, + consolidationBalanceToConsume: b.consolidationBalanceToConsume, + earliestConsolidationEpoch: b.earliestConsolidationEpoch, // Large arrays, infrequently changed, constant size. blockRoots: b.blockRoots, @@ -735,6 +892,9 @@ func (b *BeaconState) Copy() state.BeaconState { currentEpochParticipation: b.currentEpochParticipation, inactivityScores: b.inactivityScores, inactivityScoresMultiValue: b.inactivityScoresMultiValue, + pendingBalanceDeposits: b.pendingBalanceDeposits, + pendingPartialWithdrawals: b.pendingPartialWithdrawals, + pendingConsolidations: b.pendingConsolidations, // Everything else, too small to be concerned about, constant size. genesisValidatorsRoot: b.genesisValidatorsRoot, @@ -750,6 +910,7 @@ func (b *BeaconState) Copy() state.BeaconState { latestExecutionPayloadHeader: b.latestExecutionPayloadHeaderVal(), latestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapellaVal(), latestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDenebVal(), + latestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectraVal(), id: types.Enumerator.Inc(), @@ -786,6 +947,8 @@ func (b *BeaconState) Copy() state.BeaconState { dst.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, experimentalStateCapellaSharedFieldRefCount) case version.Deneb: dst.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, experimentalStateDenebSharedFieldRefCount) + case version.Electra: + dst.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, experimentalStateElectraSharedFieldRefCount) } } else { switch b.version { @@ -799,6 +962,8 @@ func (b *BeaconState) Copy() state.BeaconState { dst.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, capellaSharedFieldRefCount) case version.Deneb: dst.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, denebSharedFieldRefCount) + case version.Electra: + dst.sharedFieldReferences = make(map[types.FieldIndex]*stateutil.Reference, electraSharedFieldRefCount) } } @@ -891,6 +1056,10 @@ func (b *BeaconState) initializeMerkleLayers(ctx context.Context) error { b.dirtyFields = make(map[types.FieldIndex]bool, params.BeaconConfig().BeaconStateCapellaFieldCount) case version.Deneb: b.dirtyFields = make(map[types.FieldIndex]bool, params.BeaconConfig().BeaconStateDenebFieldCount) + case version.Electra: + b.dirtyFields = make(map[types.FieldIndex]bool, params.BeaconConfig().BeaconStateElectraFieldCount) + default: + return fmt.Errorf("unknown state version (%s) when computing dirty fields in merklization", version.String(b.version)) } return nil @@ -1109,12 +1278,32 @@ func (b *BeaconState) rootSelector(ctx context.Context, field types.FieldIndex) return b.latestExecutionPayloadHeaderCapella.HashTreeRoot() case types.LatestExecutionPayloadHeaderDeneb: return b.latestExecutionPayloadHeaderDeneb.HashTreeRoot() + case types.LatestExecutionPayloadHeaderElectra: + return b.latestExecutionPayloadHeaderElectra.HashTreeRoot() case types.NextWithdrawalIndex: return ssz.Uint64Root(b.nextWithdrawalIndex), nil case types.NextWithdrawalValidatorIndex: return ssz.Uint64Root(uint64(b.nextWithdrawalValidatorIndex)), nil case types.HistoricalSummaries: return stateutil.HistoricalSummariesRoot(b.historicalSummaries) + case types.DepositReceiptsStartIndex: + return ssz.Uint64Root(b.depositReceiptsStartIndex), nil + case types.DepositBalanceToConsume: + return ssz.Uint64Root(uint64(b.depositBalanceToConsume)), nil + case types.ExitBalanceToConsume: + return ssz.Uint64Root(uint64(b.exitBalanceToConsume)), nil + case types.EarliestExitEpoch: + return ssz.Uint64Root(uint64(b.earliestExitEpoch)), nil + case types.ConsolidationBalanceToConsume: + return ssz.Uint64Root(uint64(b.consolidationBalanceToConsume)), nil + case types.EarliestConsolidationEpoch: + return ssz.Uint64Root(uint64(b.earliestConsolidationEpoch)), nil + case types.PendingBalanceDeposits: + return stateutil.PendingBalanceDepositsRoot(b.pendingBalanceDeposits) + case types.PendingPartialWithdrawals: + return stateutil.PendingPartialWithdrawalsRoot(b.pendingPartialWithdrawals) + case types.PendingConsolidations: + return stateutil.PendingConsolidationsRoot(b.pendingConsolidations) } return [32]byte{}, errors.New("invalid field index provided") } diff --git a/beacon-chain/state/state-native/state_trie_test.go b/beacon-chain/state/state-native/state_trie_test.go index ed51dfbd23dc..2fa4858a9f73 100644 --- a/beacon-chain/state/state-native/state_trie_test.go +++ b/beacon-chain/state/state-native/state_trie_test.go @@ -5,6 +5,8 @@ import ( "context" "testing" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/features" @@ -14,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/testing/protocmp" ) func TestInitializeFromProto_Phase0(t *testing.T) { @@ -203,6 +206,42 @@ func TestInitializeFromProto_Deneb(t *testing.T) { } } +func TestInitializeFromProto_Electra(t *testing.T) { + type test struct { + name string + state *ethpb.BeaconStateElectra + error string + } + initTests := []test{ + { + name: "nil state", + state: nil, + error: "received nil state", + }, + { + name: "nil validators", + state: ðpb.BeaconStateElectra{ + Slot: 4, + Validators: nil, + }, + }, + { + name: "empty state", + state: ðpb.BeaconStateElectra{}, + }, + } + for _, tt := range initTests { + t.Run(tt.name, func(t *testing.T) { + _, err := statenative.InitializeFromProtoElectra(tt.state) + if tt.error != "" { + require.ErrorContains(t, tt.error, err) + } else { + require.NoError(t, err) + } + }) + } +} + func TestInitializeFromProtoUnsafe_Phase0(t *testing.T) { testState, _ := util.DeterministicGenesisState(t, 64) pbState, err := statenative.ProtobufBeaconStatePhase0(testState.ToProtoUnsafe()) @@ -365,6 +404,37 @@ func TestInitializeFromProtoUnsafe_Deneb(t *testing.T) { } } +func TestInitializeFromProtoUnsafe_Electra(t *testing.T) { + type test struct { + name string + state *ethpb.BeaconStateElectra + error string + } + initTests := []test{ + { + name: "nil validators", + state: ðpb.BeaconStateElectra{ + Slot: 4, + Validators: nil, + }, + }, + { + name: "empty state", + state: ðpb.BeaconStateElectra{}, + }, + } + for _, tt := range initTests { + t.Run(tt.name, func(t *testing.T) { + _, err := statenative.InitializeFromProtoUnsafeElectra(tt.state) + if tt.error != "" { + assert.ErrorContains(t, tt.error, err) + } else { + assert.NoError(t, err) + } + }) + } +} + func TestBeaconState_HashTreeRoot(t *testing.T) { testState, _ := util.DeterministicGenesisState(t, 64) @@ -772,3 +842,29 @@ func TestBeaconState_InitializeInactivityScoresCorrectly_Deneb(t *testing.T) { require.DeepSSZEqual(t, rt, newRt) } + +func TestBeaconChainCopy_Electra(t *testing.T) { + // Load a serialized Electra state from disk. + // This is a fully hydrated random test case from spectests. + serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/ssz_static/BeaconState/ssz_random/case_0/serialized.ssz_snappy") + require.NoError(t, err) + serializedSSZ, err := snappy.Decode(nil /* dst */, serializedBytes) + require.NoError(t, err) + pb := ðpb.BeaconStateElectra{} + require.NoError(t, pb.UnmarshalSSZ(serializedSSZ)) + st, err := statenative.InitializeFromProtoElectra(pb) + require.NoError(t, err) + + // Sanity check that InitializeFromProtoElectra and ToProto works + if !cmp.Equal(st.ToProto(), pb, protocmp.Transform()) { + t.Log(cmp.Diff(st.ToProto(), pb, protocmp.Transform())) + t.Fatal("InitializeFromProtoElectra does not match input proto") + } + + // Perform the copy and check that the copied state matches the original state. + st2 := st.Copy() + if !cmp.Equal(st.ToProto(), st2.ToProto(), protocmp.Transform()) { + t.Log(cmp.Diff(st.ToProto(), st2.ToProto(), protocmp.Transform())) + t.Fatal("Copied state does not match original state") + } +} diff --git a/beacon-chain/state/state-native/types/types.go b/beacon-chain/state/state-native/types/types.go index d2dd9cdbf190..0bcd77f9b0e6 100644 --- a/beacon-chain/state/state-native/types/types.go +++ b/beacon-chain/state/state-native/types/types.go @@ -1,6 +1,8 @@ package types import ( + "fmt" + "github.com/pkg/errors" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" ) @@ -83,15 +85,37 @@ func (f FieldIndex) String() string { case LatestExecutionPayloadHeader: return "latestExecutionPayloadHeader" case LatestExecutionPayloadHeaderCapella: - return "LatestExecutionPayloadHeaderCapella" + return "latestExecutionPayloadHeaderCapella" + case LatestExecutionPayloadHeaderDeneb: + return "latestExecutionPayloadHeaderDeneb" + case LatestExecutionPayloadHeaderElectra: + return "latestExecutionPayloadHeaderElectra" case NextWithdrawalIndex: - return "NextWithdrawalIndex" + return "nextWithdrawalIndex" case NextWithdrawalValidatorIndex: - return "NextWithdrawalValidatorIndex" + return "nextWithdrawalValidatorIndex" case HistoricalSummaries: - return "HistoricalSummaries" + return "historicalSummaries" + case DepositReceiptsStartIndex: + return "depositReceiptsStartIndex" + case DepositBalanceToConsume: + return "depositBalanceToConsume" + case ExitBalanceToConsume: + return "exitBalanceToConsume" + case EarliestExitEpoch: + return "earliestExitEpoch" + case ConsolidationBalanceToConsume: + return "consolidationBalanceToConsume" + case EarliestConsolidationEpoch: + return "earliestConsolidationEpoch" + case PendingBalanceDeposits: + return "pendingBalanceDeposits" + case PendingPartialWithdrawals: + return "pendingPartialWithdrawals" + case PendingConsolidations: + return "pendingConsolidations" default: - return "" + return fmt.Sprintf("unknown field index number: %d", f) } } @@ -147,7 +171,7 @@ func (f FieldIndex) RealPosition() int { return 22 case NextSyncCommittee: return 23 - case LatestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb: + case LatestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb, LatestExecutionPayloadHeaderElectra: return 24 case NextWithdrawalIndex: return 25 @@ -155,6 +179,24 @@ func (f FieldIndex) RealPosition() int { return 26 case HistoricalSummaries: return 27 + case DepositReceiptsStartIndex: + return 28 + case DepositBalanceToConsume: + return 29 + case ExitBalanceToConsume: + return 30 + case EarliestExitEpoch: + return 31 + case ConsolidationBalanceToConsume: + return 32 + case EarliestConsolidationEpoch: + return 33 + case PendingBalanceDeposits: + return 34 + case PendingPartialWithdrawals: + return 35 + case PendingConsolidations: + return 36 default: return -1 } @@ -207,9 +249,19 @@ const ( LatestExecutionPayloadHeader LatestExecutionPayloadHeaderCapella LatestExecutionPayloadHeaderDeneb + LatestExecutionPayloadHeaderElectra NextWithdrawalIndex NextWithdrawalValidatorIndex HistoricalSummaries + DepositReceiptsStartIndex // Electra: EIP-6110 + DepositBalanceToConsume // Electra: EIP-7251 + ExitBalanceToConsume // Electra: EIP-7251 + EarliestExitEpoch // Electra: EIP-7251 + ConsolidationBalanceToConsume // Electra: EIP-7251 + EarliestConsolidationEpoch // Electra: EIP-7251 + PendingBalanceDeposits // Electra: EIP-7251 + PendingPartialWithdrawals // Electra: EIP-7251 + PendingConsolidations // Electra: EIP-7251 ) // Enumerator keeps track of the number of states created since the node's start. diff --git a/beacon-chain/state/stateutil/BUILD.bazel b/beacon-chain/state/stateutil/BUILD.bazel index cc83efb14a4c..4480a560722a 100644 --- a/beacon-chain/state/stateutil/BUILD.bazel +++ b/beacon-chain/state/stateutil/BUILD.bazel @@ -12,7 +12,11 @@ go_library( "historical_summaries_root.go", "participation_bit_root.go", "pending_attestation_root.go", + "pending_balance_deposits_root.go", + "pending_consolidations_root.go", + "pending_partial_withdrawals_root.go", "reference.go", + "slice_root.go", "sync_committee.root.go", "trie_helpers.go", "unrealized_justification.go", diff --git a/beacon-chain/state/stateutil/historical_summaries_root.go b/beacon-chain/state/stateutil/historical_summaries_root.go index 921d0c9f3dcc..54497a4dcb28 100644 --- a/beacon-chain/state/stateutil/historical_summaries_root.go +++ b/beacon-chain/state/stateutil/historical_summaries_root.go @@ -1,42 +1,10 @@ package stateutil import ( - "bytes" - "encoding/binary" - "fmt" - - "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/encoding/ssz" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) func HistoricalSummariesRoot(summaries []*ethpb.HistoricalSummary) ([32]byte, error) { - max := uint64(fieldparams.HistoricalRootsLength) - if uint64(len(summaries)) > max { - return [32]byte{}, fmt.Errorf("historical summary exceeds max length %d", max) - } - - roots := make([][32]byte, len(summaries)) - for i := 0; i < len(summaries); i++ { - r, err := summaries[i].HashTreeRoot() - if err != nil { - return [32]byte{}, errors.Wrap(err, "could not merkleize historical summary") - } - roots[i] = r - } - - summariesRoot, err := ssz.BitwiseMerkleize(roots, uint64(len(roots)), fieldparams.HistoricalRootsLength) - if err != nil { - return [32]byte{}, errors.Wrap(err, "could not compute historical summaries merkleization") - } - summariesLenBuf := new(bytes.Buffer) - if err := binary.Write(summariesLenBuf, binary.LittleEndian, uint64(len(summaries))); err != nil { - return [32]byte{}, errors.Wrap(err, "could not marshal historical summary length") - } - // We need to mix in the length of the slice. - summariesLenRoot := make([]byte, 32) - copy(summariesLenRoot, summariesLenBuf.Bytes()) - res := ssz.MixInLength(summariesRoot, summariesLenRoot) - return res, nil + return SliceRoot(summaries, fieldparams.HistoricalRootsLength) } diff --git a/beacon-chain/state/stateutil/pending_balance_deposits_root.go b/beacon-chain/state/stateutil/pending_balance_deposits_root.go new file mode 100644 index 000000000000..e228c993dfd2 --- /dev/null +++ b/beacon-chain/state/stateutil/pending_balance_deposits_root.go @@ -0,0 +1,10 @@ +package stateutil + +import ( + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +func PendingBalanceDepositsRoot(slice []*ethpb.PendingBalanceDeposit) ([32]byte, error) { + return SliceRoot(slice, fieldparams.PendingBalanceDepositsLimit) +} diff --git a/beacon-chain/state/stateutil/pending_consolidations_root.go b/beacon-chain/state/stateutil/pending_consolidations_root.go new file mode 100644 index 000000000000..1c4026d079af --- /dev/null +++ b/beacon-chain/state/stateutil/pending_consolidations_root.go @@ -0,0 +1,10 @@ +package stateutil + +import ( + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +func PendingConsolidationsRoot(slice []*ethpb.PendingConsolidation) ([32]byte, error) { + return SliceRoot(slice, fieldparams.PendingConsolidationsLimit) +} diff --git a/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go b/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go new file mode 100644 index 000000000000..e939b5c15655 --- /dev/null +++ b/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go @@ -0,0 +1,10 @@ +package stateutil + +import ( + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +func PendingPartialWithdrawalsRoot(slice []*ethpb.PendingPartialWithdrawal) ([32]byte, error) { + return SliceRoot(slice, fieldparams.PendingPartialWithdrawalsLimit) +} diff --git a/beacon-chain/state/stateutil/slice_root.go b/beacon-chain/state/stateutil/slice_root.go new file mode 100644 index 000000000000..236582296dcb --- /dev/null +++ b/beacon-chain/state/stateutil/slice_root.go @@ -0,0 +1,41 @@ +package stateutil + +import ( + "bytes" + "encoding/binary" + "fmt" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" +) + +// SliceRoot computes the root of a slice of hashable objects. +func SliceRoot[T ssz.Hashable](slice []T, limit uint64) ([32]byte, error) { + max := limit + if uint64(len(slice)) > max { + return [32]byte{}, fmt.Errorf("slice exceeds max length %d", max) + } + + roots := make([][32]byte, len(slice)) + for i := 0; i < len(slice); i++ { + r, err := slice[i].HashTreeRoot() + if err != nil { + return [32]byte{}, errors.Wrap(err, "could not merkleize object") + } + roots[i] = r + } + + sliceRoot, err := ssz.BitwiseMerkleize(roots, uint64(len(roots)), limit) + if err != nil { + return [32]byte{}, errors.Wrap(err, "could not slice merkleization") + } + sliceLenBuf := new(bytes.Buffer) + if err := binary.Write(sliceLenBuf, binary.LittleEndian, uint64(len(slice))); err != nil { + return [32]byte{}, errors.Wrap(err, "could not marshal slice length") + } + // We need to mix in the length of the slice. + sliceLenRoot := make([]byte, 32) + copy(sliceLenRoot, sliceLenBuf.Bytes()) + res := ssz.MixInLength(sliceRoot, sliceLenRoot) + return res, nil +} diff --git a/beacon-chain/state/stateutil/trie_helpers.go b/beacon-chain/state/stateutil/trie_helpers.go index be4aabd0be2b..a0f630b26a8c 100644 --- a/beacon-chain/state/stateutil/trie_helpers.go +++ b/beacon-chain/state/stateutil/trie_helpers.go @@ -250,11 +250,11 @@ func AddInMixin(root [32]byte, length uint64) ([32]byte, error) { // Merkleize 32-byte leaves into a Merkle trie for its adequate depth, returning // the resulting layers of the trie based on the appropriate depth. This function -// pads the leaves to a length of 32. +// pads the leaves to a length of a multiple of 32. func Merkleize(leaves [][]byte) [][][]byte { hashFunc := hash.CustomSHA256Hasher() layers := make([][][]byte, ssz.Depth(uint64(len(leaves)))+1) - for len(leaves) != 32 { + for len(leaves)%32 != 0 { leaves = append(leaves, make([]byte, 32)) } currentLayer := leaves diff --git a/config/params/config.go b/config/params/config.go index 552ac2b9c603..f0624519c9f8 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -236,20 +236,20 @@ type BeaconChainConfig struct { MaxRequestBlocksDeneb uint64 `yaml:"MAX_REQUEST_BLOCKS_DENEB" spec:"true"` // MaxRequestBlocksDeneb is the maximum number of blocks in a single request after the deneb epoch. // Values introduce in Electra upgrade - DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol - MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn. - MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra. - MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request - MaxEffectiveBalanceElectra uint64 `yaml:"MAX_EFFECTIVE_BALANCE_ELECTRA" spec:"true"` // MaxEffectiveBalanceElectra is the maximal amount of Gwei that is effective for staking, increased in electra. - MinSlashingPenaltyQuotientElectra uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA" spec:"true"` // MinSlashingPenaltyQuotientElectra is used to calculate the minimum penalty to prevent DoS attacks, modified for electra. - WhistleBlowerRewardQuotientElectra uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA" spec:"true"` // WhistleBlowerRewardQuotientElectra is used to calculate whistle blower reward, modified in electra. - PendingBalanceDepositLimit uint64 `yaml:"PENDING_BALANCE_DEPOSITS_LIMIT" spec:"true"` // PendingBalanceDepositLimit is the maximum number of pending balance deposits allowed in the beacon state. - PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT" spec:"true"` // PendingPartialWithdrawalsLimit is the maximum number of pending partial withdrawals allowed in the beacon state. - PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT" spec:"true"` // PendingConsolidationsLimit is the maximum number of pending validator consolidations allowed in the beacon state. - MaxConsolidations uint64 `yaml:"MAX_CONSOLIDATIONS" spec:"true"` // MaxConsolidations is the maximum number of consolidations in a block. - MaxPendingPartialsPerWithdrawalSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalSweep is the maximum number of pending partial withdrawals to process per payload. - FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit. - MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload. + DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol + MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn. + MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra. + MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request + MaxEffectiveBalanceElectra uint64 `yaml:"MAX_EFFECTIVE_BALANCE_ELECTRA" spec:"true"` // MaxEffectiveBalanceElectra is the maximal amount of Gwei that is effective for staking, increased in electra. + MinSlashingPenaltyQuotientElectra uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA" spec:"true"` // MinSlashingPenaltyQuotientElectra is used to calculate the minimum penalty to prevent DoS attacks, modified for electra. + WhistleBlowerRewardQuotientElectra uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA" spec:"true"` // WhistleBlowerRewardQuotientElectra is used to calculate whistle blower reward, modified in electra. + PendingBalanceDepositLimit uint64 `yaml:"PENDING_BALANCE_DEPOSITS_LIMIT" spec:"true"` // PendingBalanceDepositLimit is the maximum number of pending balance deposits allowed in the beacon state. + PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT" spec:"true"` // PendingPartialWithdrawalsLimit is the maximum number of pending partial withdrawals allowed in the beacon state. + PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT" spec:"true"` // PendingConsolidationsLimit is the maximum number of pending validator consolidations allowed in the beacon state. + MaxConsolidations uint64 `yaml:"MAX_CONSOLIDATIONS" spec:"true"` // MaxConsolidations is the maximum number of consolidations in a block. + MaxPendingPartialsPerWithdrawalsSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalsSweep is the maximum number of pending partial withdrawals to process per payload. + FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit. + MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload. // Networking Specific Parameters GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE" spec:"true"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages. @@ -288,6 +288,7 @@ func configForkSchedule(b *BeaconChainConfig) map[[fieldparams.VersionLength]byt fvs[bytesutil.ToBytes4(b.BellatrixForkVersion)] = b.BellatrixForkEpoch fvs[bytesutil.ToBytes4(b.CapellaForkVersion)] = b.CapellaForkEpoch fvs[bytesutil.ToBytes4(b.DenebForkVersion)] = b.DenebForkEpoch + fvs[bytesutil.ToBytes4(b.ElectraForkVersion)] = b.ElectraForkEpoch return fvs } @@ -309,6 +310,7 @@ func ConfigForkVersions(b *BeaconChainConfig) map[[fieldparams.VersionLength]byt bytesutil.ToBytes4(b.BellatrixForkVersion): version.Bellatrix, bytesutil.ToBytes4(b.CapellaForkVersion): version.Capella, bytesutil.ToBytes4(b.DenebForkVersion): version.Deneb, + bytesutil.ToBytes4(b.ElectraForkVersion): version.Electra, } } diff --git a/config/params/interop.go b/config/params/interop.go index f1a9e42452f8..44c2c048aa50 100644 --- a/config/params/interop.go +++ b/config/params/interop.go @@ -11,6 +11,7 @@ func InteropConfig() *BeaconChainConfig { c.BellatrixForkVersion = []byte{2, 0, 0, 235} c.CapellaForkVersion = []byte{3, 0, 0, 235} c.DenebForkVersion = []byte{4, 0, 0, 235} + c.ElectraForkVersion = []byte{5, 0, 0, 235} c.InitializeForkSchedule() return c diff --git a/config/params/loader.go b/config/params/loader.go index c9a7a2562e7b..404ece6ef4d0 100644 --- a/config/params/loader.go +++ b/config/params/loader.go @@ -214,6 +214,8 @@ func ConfigToYaml(cfg *BeaconChainConfig) []byte { fmt.Sprintf("BLOB_SIDECAR_SUBNET_COUNT: %d", cfg.BlobsidecarSubnetCount), fmt.Sprintf("DENEB_FORK_EPOCH: %d", cfg.DenebForkEpoch), fmt.Sprintf("DENEB_FORK_VERSION: %#x", cfg.DenebForkVersion), + fmt.Sprintf("ELECTRA_FORK_EPOCH: %d", cfg.ElectraForkEpoch), + fmt.Sprintf("ELECTRA_FORK_VERSION: %#x", cfg.ElectraForkVersion), fmt.Sprintf("EPOCHS_PER_SUBNET_SUBSCRIPTION: %d", cfg.EpochsPerSubnetSubscription), fmt.Sprintf("ATTESTATION_SUBNET_EXTRA_BITS: %d", cfg.AttestationSubnetExtraBits), fmt.Sprintf("ATTESTATION_SUBNET_PREFIX_BITS: %d", cfg.AttestationSubnetPrefixBits), diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 098ceb5c7dea..ab18df129de7 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -275,21 +275,21 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxRequestBlocksDeneb: 128, // Values related to electra - MaxRequestDataColumnSidecars: 16384, - DataColumnSidecarSubnetCount: 32, - MinPerEpochChurnLimitElectra: 128_000_000_000, - MaxPerEpochActivationExitChurnLimit: 256_000_000_000, - MaxEffectiveBalanceElectra: 2048_000_000_000, - MinSlashingPenaltyQuotientElectra: 4096, - WhistleBlowerRewardQuotientElectra: 4096, - PendingBalanceDepositLimit: 134_217_728, - PendingPartialWithdrawalsLimit: 134_217_728, - PendingConsolidationsLimit: 262_144, - MinActivationBalance: 32_000_000_000, - MaxConsolidations: 1, - MaxPendingPartialsPerWithdrawalSweep: 8, - FullExitRequestAmount: 0, - MaxWithdrawalRequestsPerPayload: 16, + MaxRequestDataColumnSidecars: 16384, + DataColumnSidecarSubnetCount: 32, + MinPerEpochChurnLimitElectra: 128_000_000_000, + MaxPerEpochActivationExitChurnLimit: 256_000_000_000, + MaxEffectiveBalanceElectra: 2048_000_000_000, + MinSlashingPenaltyQuotientElectra: 4096, + WhistleBlowerRewardQuotientElectra: 4096, + PendingBalanceDepositLimit: 134_217_728, + PendingPartialWithdrawalsLimit: 134_217_728, + PendingConsolidationsLimit: 262_144, + MinActivationBalance: 32_000_000_000, + MaxConsolidations: 1, + MaxPendingPartialsPerWithdrawalsSweep: 8, + FullExitRequestAmount: 0, + MaxWithdrawalRequestsPerPayload: 16, // Values related to networking parameters. GossipMaxSize: 10 * 1 << 20, // 10 MiB @@ -332,16 +332,19 @@ func FillTestVersions(c *BeaconChainConfig, b byte) { c.BellatrixForkVersion = make([]byte, fieldparams.VersionLength) c.CapellaForkVersion = make([]byte, fieldparams.VersionLength) c.DenebForkVersion = make([]byte, fieldparams.VersionLength) + c.ElectraForkVersion = make([]byte, fieldparams.VersionLength) c.GenesisForkVersion[fieldparams.VersionLength-1] = b c.AltairForkVersion[fieldparams.VersionLength-1] = b c.BellatrixForkVersion[fieldparams.VersionLength-1] = b c.CapellaForkVersion[fieldparams.VersionLength-1] = b c.DenebForkVersion[fieldparams.VersionLength-1] = b + c.ElectraForkVersion[fieldparams.VersionLength-1] = b c.GenesisForkVersion[0] = 0 c.AltairForkVersion[0] = 1 c.BellatrixForkVersion[0] = 2 c.CapellaForkVersion[0] = 3 c.DenebForkVersion[0] = 4 + c.ElectraForkVersion[0] = 5 } diff --git a/config/params/minimal_config.go b/config/params/minimal_config.go index e008f6fd0e29..adbdf250ec2d 100644 --- a/config/params/minimal_config.go +++ b/config/params/minimal_config.go @@ -108,7 +108,7 @@ func MinimalSpecConfig() *BeaconChainConfig { minimalConfig.MaxPartialWithdrawalsPerPayload = 1 minimalConfig.MaxWithdrawalRequestsPerPayload = 2 minimalConfig.PendingPartialWithdrawalsLimit = 64 - minimalConfig.MaxPendingPartialsPerWithdrawalSweep = 1 + minimalConfig.MaxPendingPartialsPerWithdrawalsSweep = 1 // Ethereum PoW parameters. minimalConfig.DepositChainID = 5 // Chain ID of eth1 goerli. diff --git a/config/params/testdata/e2e_config.yaml b/config/params/testdata/e2e_config.yaml index f81f94959122..d264fbb6188c 100644 --- a/config/params/testdata/e2e_config.yaml +++ b/config/params/testdata/e2e_config.yaml @@ -44,6 +44,9 @@ CAPELLA_FORK_EPOCH: 10 # Deneb DENEB_FORK_VERSION: 0x040000fd DENEB_FORK_EPOCH: 12 +# Electra +ELECTRA_FORK_VERSION: 0x050000fd +ELECTRA_FORK_EPOCH: 18446744073709551615 # Time parameters diff --git a/config/params/testnet_e2e_config.go b/config/params/testnet_e2e_config.go index 65d670784060..a82c02ec16b7 100644 --- a/config/params/testnet_e2e_config.go +++ b/config/params/testnet_e2e_config.go @@ -1,10 +1,13 @@ package params +import "math" + const ( AltairE2EForkEpoch = 6 BellatrixE2EForkEpoch = 8 CapellaE2EForkEpoch = 10 DenebE2EForkEpoch = 12 + ElectraE2EForkEpoch = math.MaxUint64 ) // E2ETestConfig retrieves the configurations made specifically for E2E testing. @@ -40,6 +43,7 @@ func E2ETestConfig() *BeaconChainConfig { e2eConfig.BellatrixForkEpoch = BellatrixE2EForkEpoch e2eConfig.CapellaForkEpoch = CapellaE2EForkEpoch e2eConfig.DenebForkEpoch = DenebE2EForkEpoch + e2eConfig.ElectraForkEpoch = ElectraE2EForkEpoch // Terminal Total Difficulty. e2eConfig.TerminalTotalDifficulty = "480" @@ -51,6 +55,7 @@ func E2ETestConfig() *BeaconChainConfig { e2eConfig.BellatrixForkVersion = []byte{2, 0, 0, 253} e2eConfig.CapellaForkVersion = []byte{3, 0, 0, 253} e2eConfig.DenebForkVersion = []byte{4, 0, 0, 253} + e2eConfig.ElectraForkVersion = []byte{5, 0, 0, 253} e2eConfig.InitializeForkSchedule() return e2eConfig @@ -82,6 +87,7 @@ func E2EMainnetTestConfig() *BeaconChainConfig { e2eConfig.BellatrixForkEpoch = BellatrixE2EForkEpoch e2eConfig.CapellaForkEpoch = CapellaE2EForkEpoch e2eConfig.DenebForkEpoch = DenebE2EForkEpoch + e2eConfig.ElectraForkEpoch = ElectraE2EForkEpoch // Terminal Total Difficulty. e2eConfig.TerminalTotalDifficulty = "480" @@ -93,6 +99,7 @@ func E2EMainnetTestConfig() *BeaconChainConfig { e2eConfig.BellatrixForkVersion = []byte{2, 0, 0, 254} e2eConfig.CapellaForkVersion = []byte{3, 0, 0, 254} e2eConfig.DenebForkVersion = []byte{4, 0, 0, 254} + e2eConfig.ElectraForkVersion = []byte{5, 0, 0, 254} // Deneb changes. e2eConfig.MinPerEpochChurnLimit = 2 diff --git a/config/params/testnet_holesky_config.go b/config/params/testnet_holesky_config.go index a256d327a0e5..66bf9bd23fcb 100644 --- a/config/params/testnet_holesky_config.go +++ b/config/params/testnet_holesky_config.go @@ -1,5 +1,7 @@ package params +import "math" + // UseHoleskyNetworkConfig uses the Holesky beacon chain specific network config. func UseHoleskyNetworkConfig() { cfg := BeaconNetworkConfig().Copy() @@ -36,6 +38,8 @@ func HoleskyConfig() *BeaconChainConfig { cfg.CapellaForkVersion = []byte{0x4, 0x1, 0x70, 0x0} cfg.DenebForkEpoch = 29696 cfg.DenebForkVersion = []byte{0x05, 0x1, 0x70, 0x0} + cfg.ElectraForkEpoch = math.MaxUint64 + cfg.ElectraForkVersion = []byte{0x06, 0x1, 0x70, 0x0} // TODO: Define holesky fork version for electra. This is a placeholder value. cfg.TerminalTotalDifficulty = "0" cfg.DepositContractAddress = "0x4242424242424242424242424242424242424242" cfg.EjectionBalance = 28000000000 diff --git a/config/params/testnet_sepolia_config.go b/config/params/testnet_sepolia_config.go index 30c8228211f1..0df3e1e51d00 100644 --- a/config/params/testnet_sepolia_config.go +++ b/config/params/testnet_sepolia_config.go @@ -1,6 +1,8 @@ package params import ( + "math" + eth1Params "github.com/ethereum/go-ethereum/params" ) @@ -37,6 +39,8 @@ func SepoliaConfig() *BeaconChainConfig { cfg.CapellaForkVersion = []byte{0x90, 0x00, 0x00, 0x72} cfg.DenebForkEpoch = 132608 cfg.DenebForkVersion = []byte{0x90, 0x00, 0x00, 0x73} + cfg.ElectraForkEpoch = math.MaxUint64 + cfg.ElectraForkVersion = []byte{0x90, 0x00, 0x00, 0x74} // TODO: Define sepolia fork version for electra. This is a placeholder value. cfg.TerminalTotalDifficulty = "17000000000000000" cfg.DepositContractAddress = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D" cfg.InitializeForkSchedule() diff --git a/encoding/ssz/detect/configfork.go b/encoding/ssz/detect/configfork.go index db2285844296..79099512cc9b 100644 --- a/encoding/ssz/detect/configfork.go +++ b/encoding/ssz/detect/configfork.go @@ -87,6 +87,8 @@ func FromForkVersion(cv [fieldparams.VersionLength]byte) (*VersionedUnmarshaler, fork = version.Capella case bytesutil.ToBytes4(cfg.DenebForkVersion): fork = version.Deneb + case bytesutil.ToBytes4(cfg.ElectraForkVersion): + fork = version.Electra default: return nil, errors.Wrapf(ErrForkNotFound, "version=%#x", cv) } @@ -152,6 +154,16 @@ func (cf *VersionedUnmarshaler) UnmarshalBeaconState(marshaled []byte) (s state. if err != nil { return nil, errors.Wrapf(err, "failed to init state trie from state, detected fork=%s", forkName) } + case version.Electra: + st := ðpb.BeaconStateElectra{} + err = st.UnmarshalSSZ(marshaled) + if err != nil { + return nil, errors.Wrapf(err, "failed to unmarshal state, detected fork=%s", forkName) + } + s, err = state_native.InitializeFromProtoUnsafeElectra(st) + if err != nil { + return nil, errors.Wrapf(err, "failed to init state trie from state, detected fork=%s", forkName) + } default: return nil, fmt.Errorf("unable to initialize BeaconState for fork version=%s", forkName) } @@ -200,6 +212,8 @@ func (cf *VersionedUnmarshaler) UnmarshalBeaconBlock(marshaled []byte) (interfac blk = ðpb.SignedBeaconBlockCapella{} case version.Deneb: blk = ðpb.SignedBeaconBlockDeneb{} + case version.Electra: + blk = ðpb.SignedBeaconBlockElectra{} default: forkName := version.String(cf.Fork) return nil, fmt.Errorf("unable to initialize ReadOnlyBeaconBlock for fork version=%s at slot=%d", forkName, slot) @@ -235,6 +249,8 @@ func (cf *VersionedUnmarshaler) UnmarshalBlindedBeaconBlock(marshaled []byte) (i blk = ðpb.SignedBlindedBeaconBlockCapella{} case version.Deneb: blk = ðpb.SignedBlindedBeaconBlockDeneb{} + case version.Electra: + blk = ðpb.SignedBlindedBeaconBlockElectra{} default: forkName := version.String(cf.Fork) return nil, fmt.Errorf("unable to initialize ReadOnlyBeaconBlock for fork version=%s at slot=%d", forkName, slot) diff --git a/encoding/ssz/detect/configfork_test.go b/encoding/ssz/detect/configfork_test.go index 36d7b929b3d3..5a5e41a912f2 100644 --- a/encoding/ssz/detect/configfork_test.go +++ b/encoding/ssz/detect/configfork_test.go @@ -47,7 +47,7 @@ func TestSlotFromBlock(t *testing.T) { } func TestByState(t *testing.T) { - undo := util.HackDenebMaxuint(t) + undo := util.HackElectraMaxuint(t) defer undo() bc := params.BeaconConfig() altairSlot, err := slots.EpochStart(bc.AltairForkEpoch) @@ -58,6 +58,8 @@ func TestByState(t *testing.T) { require.NoError(t, err) denebSlot, err := slots.EpochStart(bc.DenebForkEpoch) require.NoError(t, err) + electraSlot, err := slots.EpochStart(bc.ElectraForkEpoch) + require.NoError(t, err) cases := []struct { name string version int @@ -94,6 +96,12 @@ func TestByState(t *testing.T) { slot: denebSlot, forkversion: bytesutil.ToBytes4(bc.DenebForkVersion), }, + { + name: "electra", + version: version.Electra, + slot: electraSlot, + forkversion: bytesutil.ToBytes4(bc.ElectraForkVersion), + }, } for _, c := range cases { st, err := stateForVersion(c.version) @@ -126,6 +134,8 @@ func stateForVersion(v int) (state.BeaconState, error) { return util.NewBeaconStateCapella() case version.Deneb: return util.NewBeaconStateDeneb() + case version.Electra: + return util.NewBeaconStateElectra() default: return nil, fmt.Errorf("unrecognized version %d", v) } @@ -133,7 +143,7 @@ func stateForVersion(v int) (state.BeaconState, error) { func TestUnmarshalState(t *testing.T) { ctx := context.Background() - undo := util.HackDenebMaxuint(t) + undo := util.HackElectraMaxuint(t) defer undo() bc := params.BeaconConfig() altairSlot, err := slots.EpochStart(bc.AltairForkEpoch) @@ -144,6 +154,8 @@ func TestUnmarshalState(t *testing.T) { require.NoError(t, err) denebSlot, err := slots.EpochStart(bc.DenebForkEpoch) require.NoError(t, err) + electraSlot, err := slots.EpochStart(bc.ElectraForkEpoch) + require.NoError(t, err) cases := []struct { name string version int @@ -180,6 +192,12 @@ func TestUnmarshalState(t *testing.T) { slot: denebSlot, forkversion: bytesutil.ToBytes4(bc.DenebForkVersion), }, + { + name: "electra", + version: version.Electra, + slot: electraSlot, + forkversion: bytesutil.ToBytes4(bc.ElectraForkVersion), + }, } for _, c := range cases { st, err := stateForVersion(c.version) @@ -205,7 +223,7 @@ func TestUnmarshalState(t *testing.T) { } func TestDetectAndUnmarshalBlock(t *testing.T) { - undo := util.HackDenebMaxuint(t) + undo := util.HackElectraMaxuint(t) defer undo() altairS, err := slots.EpochStart(params.BeaconConfig().AltairForkEpoch) require.NoError(t, err) @@ -215,6 +233,8 @@ func TestDetectAndUnmarshalBlock(t *testing.T) { require.NoError(t, err) denebS, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) require.NoError(t, err) + electraS, err := slots.EpochStart(params.BeaconConfig().ElectraForkEpoch) + require.NoError(t, err) cases := []struct { b func(*testing.T, primitives.Slot) interfaces.ReadOnlySignedBeaconBlock name string @@ -260,6 +280,11 @@ func TestDetectAndUnmarshalBlock(t *testing.T) { b: signedTestBlockDeneb, slot: denebS, }, + { + name: "first slot of electra", + b: signedTestBlockElectra, + slot: electraS, + }, { name: "bellatrix block in altair slot", b: signedTestBlockBellatrix, @@ -296,13 +321,14 @@ func TestDetectAndUnmarshalBlock(t *testing.T) { } func TestUnmarshalBlock(t *testing.T) { - undo := util.HackDenebMaxuint(t) + undo := util.HackElectraMaxuint(t) defer undo() genv := bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion) altairv := bytesutil.ToBytes4(params.BeaconConfig().AltairForkVersion) bellav := bytesutil.ToBytes4(params.BeaconConfig().BellatrixForkVersion) capellaV := bytesutil.ToBytes4(params.BeaconConfig().CapellaForkVersion) denebV := bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion) + electraV := bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion) altairS, err := slots.EpochStart(params.BeaconConfig().AltairForkEpoch) require.NoError(t, err) bellaS, err := slots.EpochStart(params.BeaconConfig().BellatrixForkEpoch) @@ -311,6 +337,8 @@ func TestUnmarshalBlock(t *testing.T) { require.NoError(t, err) denebS, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) require.NoError(t, err) + electraS, err := slots.EpochStart(params.BeaconConfig().ElectraForkEpoch) + require.NoError(t, err) cases := []struct { b func(*testing.T, primitives.Slot) interfaces.ReadOnlySignedBeaconBlock name string @@ -365,6 +393,12 @@ func TestUnmarshalBlock(t *testing.T) { version: denebV, slot: denebS, }, + { + name: "first slot of electra", + b: signedTestBlockElectra, + version: electraV, + slot: electraS, + }, { name: "bellatrix block in altair slot", b: signedTestBlockBellatrix, @@ -409,13 +443,14 @@ func TestUnmarshalBlock(t *testing.T) { } func TestUnmarshalBlindedBlock(t *testing.T) { - undo := util.HackDenebMaxuint(t) + undo := util.HackElectraMaxuint(t) defer undo() genv := bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion) altairv := bytesutil.ToBytes4(params.BeaconConfig().AltairForkVersion) bellav := bytesutil.ToBytes4(params.BeaconConfig().BellatrixForkVersion) capellaV := bytesutil.ToBytes4(params.BeaconConfig().CapellaForkVersion) denebV := bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion) + electraV := bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion) altairS, err := slots.EpochStart(params.BeaconConfig().AltairForkEpoch) require.NoError(t, err) bellaS, err := slots.EpochStart(params.BeaconConfig().BellatrixForkEpoch) @@ -424,6 +459,8 @@ func TestUnmarshalBlindedBlock(t *testing.T) { require.NoError(t, err) denebS, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) require.NoError(t, err) + electraS, err := slots.EpochStart(params.BeaconConfig().ElectraForkEpoch) + require.NoError(t, err) cases := []struct { b func(*testing.T, primitives.Slot) interfaces.ReadOnlySignedBeaconBlock name string @@ -485,6 +522,12 @@ func TestUnmarshalBlindedBlock(t *testing.T) { version: denebV, slot: denebS, }, + { + name: "first slot of electra", + b: signedTestBlindedBlockElectra, + version: electraV, + slot: electraS, + }, { name: "genesis block in altair slot", b: signedTestBlockGenesis, @@ -577,6 +620,14 @@ func signedTestBlockDeneb(t *testing.T, slot primitives.Slot) interfaces.ReadOnl return s } +func signedTestBlockElectra(t *testing.T, slot primitives.Slot) interfaces.ReadOnlySignedBeaconBlock { + b := util.NewBeaconBlockElectra() + b.Block.Slot = slot + s, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + return s +} + func signedTestBlindedBlockDeneb(t *testing.T, slot primitives.Slot) interfaces.ReadOnlySignedBeaconBlock { b := util.NewBlindedBeaconBlockDeneb() b.Message.Slot = slot @@ -584,3 +635,11 @@ func signedTestBlindedBlockDeneb(t *testing.T, slot primitives.Slot) interfaces. require.NoError(t, err) return s } + +func signedTestBlindedBlockElectra(t *testing.T, slot primitives.Slot) interfaces.ReadOnlySignedBeaconBlock { + b := util.NewBlindedBeaconBlockElectra() + b.Message.Slot = slot + s, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + return s +} diff --git a/math/BUILD.bazel b/math/BUILD.bazel index ffd1f0ba7693..39964b0712c7 100644 --- a/math/BUILD.bazel +++ b/math/BUILD.bazel @@ -5,7 +5,10 @@ go_library( srcs = ["math_helper.go"], importpath = "github.com/prysmaticlabs/prysm/v5/math", visibility = ["//visibility:public"], - deps = ["@com_github_thomaso_mirodin_intmath//u64:go_default_library"], + deps = [ + "@com_github_prysmaticlabs_fastssz//:go_default_library", + "@com_github_thomaso_mirodin_intmath//u64:go_default_library", + ], ) go_test( diff --git a/math/math_helper.go b/math/math_helper.go index bfca6d155dab..d926a3db750e 100644 --- a/math/math_helper.go +++ b/math/math_helper.go @@ -3,11 +3,13 @@ package math import ( "errors" + "fmt" stdmath "math" "math/big" "math/bits" "sync" + fssz "github.com/prysmaticlabs/fastssz" "github.com/thomaso-mirodin/intmath/u64" ) @@ -216,9 +218,53 @@ func AddInt(i ...int) (int, error) { // Wei is the smallest unit of Ether, represented as a pointer to a bigInt. type Wei *big.Int +var _ fssz.HashRoot = (Gwei)(0) +var _ fssz.Marshaler = (*Gwei)(nil) +var _ fssz.Unmarshaler = (*Gwei)(nil) + // Gwei is a denomination of 1e9 Wei represented as an uint64. type Gwei uint64 +// HashTreeRoot -- +func (g Gwei) HashTreeRoot() ([32]byte, error) { + return fssz.HashWithDefaultHasher(g) +} + +// HashTreeRootWith -- +func (g Gwei) HashTreeRootWith(hh *fssz.Hasher) error { + hh.PutUint64(uint64(g)) + return nil +} + +// UnmarshalSSZ -- +func (g *Gwei) UnmarshalSSZ(buf []byte) error { + if len(buf) != g.SizeSSZ() { + return fmt.Errorf("expected buffer of length %d received %d", g.SizeSSZ(), len(buf)) + } + *g = Gwei(fssz.UnmarshallUint64(buf)) + return nil +} + +// MarshalSSZTo -- +func (g *Gwei) MarshalSSZTo(dst []byte) ([]byte, error) { + marshalled, err := g.MarshalSSZ() + if err != nil { + return nil, err + } + return append(dst, marshalled...), nil +} + +// MarshalSSZ -- +func (g *Gwei) MarshalSSZ() ([]byte, error) { + marshalled := fssz.MarshalUint64([]byte{}, uint64(*g)) + return marshalled, nil +} + +// SizeSSZ -- +func (g *Gwei) SizeSSZ() int { + return 8 +} + // WeiToGwei converts big int wei to uint64 gwei. // The input `v` is copied before being modified. func WeiToGwei(v Wei) Gwei { diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 3e8f57833cf5..02c496eabb5e 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -51,6 +51,7 @@ ssz_gen_marshal( includes = [ "//consensus-types/primitives:go_default_library", "//proto/engine/v1:go_default_library", + "//math:go_default_library", ], objs = [ "BeaconBlockAltair", @@ -162,6 +163,7 @@ go_proto_library( visibility = ["//visibility:public"], deps = [ "//consensus-types/primitives:go_default_library", + "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", @@ -219,6 +221,7 @@ go_library( visibility = ["//visibility:public"], deps = SSZ_DEPS + [ "//encoding/bytesutil:go_default_library", + "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "//runtime/version:go_default_library", diff --git a/proto/prysm/v1alpha1/beacon_state.pb.go b/proto/prysm/v1alpha1/beacon_state.pb.go index 71a2b06e9abc..aac6093e1d11 100755 --- a/proto/prysm/v1alpha1/beacon_state.pb.go +++ b/proto/prysm/v1alpha1/beacon_state.pb.go @@ -12,6 +12,7 @@ import ( github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + github_com_prysmaticlabs_prysm_v5_math "github.com/prysmaticlabs/prysm/v5/math" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -1868,10 +1869,10 @@ type BeaconStateElectra struct { NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` DepositReceiptsStartIndex uint64 `protobuf:"varint,12001,opt,name=deposit_receipts_start_index,json=depositReceiptsStartIndex,proto3" json:"deposit_receipts_start_index,omitempty"` - DepositBalanceToConsume uint64 `protobuf:"varint,12002,opt,name=deposit_balance_to_consume,json=depositBalanceToConsume,proto3" json:"deposit_balance_to_consume,omitempty"` - ExitBalanceToConsume uint64 `protobuf:"varint,12003,opt,name=exit_balance_to_consume,json=exitBalanceToConsume,proto3" json:"exit_balance_to_consume,omitempty"` + DepositBalanceToConsume github_com_prysmaticlabs_prysm_v5_math.Gwei `protobuf:"varint,12002,opt,name=deposit_balance_to_consume,json=depositBalanceToConsume,proto3" json:"deposit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/math.Gwei"` + ExitBalanceToConsume github_com_prysmaticlabs_prysm_v5_math.Gwei `protobuf:"varint,12003,opt,name=exit_balance_to_consume,json=exitBalanceToConsume,proto3" json:"exit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/math.Gwei"` EarliestExitEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12004,opt,name=earliest_exit_epoch,json=earliestExitEpoch,proto3" json:"earliest_exit_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` - ConsolidationBalanceToConsume uint64 `protobuf:"varint,12005,opt,name=consolidation_balance_to_consume,json=consolidationBalanceToConsume,proto3" json:"consolidation_balance_to_consume,omitempty"` + ConsolidationBalanceToConsume github_com_prysmaticlabs_prysm_v5_math.Gwei `protobuf:"varint,12005,opt,name=consolidation_balance_to_consume,json=consolidationBalanceToConsume,proto3" json:"consolidation_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/math.Gwei"` EarliestConsolidationEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12006,opt,name=earliest_consolidation_epoch,json=earliestConsolidationEpoch,proto3" json:"earliest_consolidation_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` PendingBalanceDeposits []*PendingBalanceDeposit `protobuf:"bytes,12007,rep,name=pending_balance_deposits,json=pendingBalanceDeposits,proto3" json:"pending_balance_deposits,omitempty" ssz-max:"134217728"` PendingPartialWithdrawals []*PendingPartialWithdrawal `protobuf:"bytes,12008,rep,name=pending_partial_withdrawals,json=pendingPartialWithdrawals,proto3" json:"pending_partial_withdrawals,omitempty" ssz-max:"134217728"` @@ -2113,18 +2114,18 @@ func (x *BeaconStateElectra) GetDepositReceiptsStartIndex() uint64 { return 0 } -func (x *BeaconStateElectra) GetDepositBalanceToConsume() uint64 { +func (x *BeaconStateElectra) GetDepositBalanceToConsume() github_com_prysmaticlabs_prysm_v5_math.Gwei { if x != nil { return x.DepositBalanceToConsume } - return 0 + return github_com_prysmaticlabs_prysm_v5_math.Gwei(0) } -func (x *BeaconStateElectra) GetExitBalanceToConsume() uint64 { +func (x *BeaconStateElectra) GetExitBalanceToConsume() github_com_prysmaticlabs_prysm_v5_math.Gwei { if x != nil { return x.ExitBalanceToConsume } - return 0 + return github_com_prysmaticlabs_prysm_v5_math.Gwei(0) } func (x *BeaconStateElectra) GetEarliestExitEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -2134,11 +2135,11 @@ func (x *BeaconStateElectra) GetEarliestExitEpoch() github_com_prysmaticlabs_pry return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) } -func (x *BeaconStateElectra) GetConsolidationBalanceToConsume() uint64 { +func (x *BeaconStateElectra) GetConsolidationBalanceToConsume() github_com_prysmaticlabs_prysm_v5_math.Gwei { if x != nil { return x.ConsolidationBalanceToConsume } - return 0 + return github_com_prysmaticlabs_prysm_v5_math.Gwei(0) } func (x *BeaconStateElectra) GetEarliestConsolidationEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -3010,7 +3011,7 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x69, 0x65, 0x73, 0x22, 0xfa, 0x17, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x72, 0x69, 0x65, 0x73, 0x22, 0x8d, 0x19, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, @@ -3151,85 +3152,94 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x69, 0x70, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, + 0x65, 0x78, 0x12, 0x6d, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, - 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, - 0x12, 0x36, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, - 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, - 0x69, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0xe4, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x2f, 0x82, 0xb5, 0x18, 0x2b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x12, 0x67, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x2f, 0x82, 0xb5, 0x18, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x47, 0x77, 0x65, 0x69, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, + 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0xe4, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x11, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x79, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x2f, + 0x82, 0xb5, 0x18, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, + 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x89, + 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, + 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0xe6, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, - 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x12, 0x48, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, - 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1d, 0x63, 0x6f, - 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x1c, - 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe6, 0x5d, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, 0x65, 0x61, 0x72, - 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, - 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, - 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0xe8, - 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, - 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, - 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x5d, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, - 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, - 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x31, - 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, - 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, - 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, + 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, 0x0a, 0x18, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x0d, 0x92, 0xb5, 0x18, + 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x73, 0x18, 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, - 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, - 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, + 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x5d, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, + 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, + 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, + 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index 3fb67903b15c..f4bc57e2ce1d 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -397,10 +397,10 @@ message BeaconStateElectra { // Fields introduced in EIP-7251 fork [12001-13000] uint64 deposit_receipts_start_index = 12001; - uint64 deposit_balance_to_consume = 12002; - uint64 exit_balance_to_consume = 12003; + uint64 deposit_balance_to_consume = 12002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/math.Gwei"]; + uint64 exit_balance_to_consume = 12003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/math.Gwei"]; uint64 earliest_exit_epoch = 12004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; - uint64 consolidation_balance_to_consume = 12005; + uint64 consolidation_balance_to_consume = 12005 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/math.Gwei"]; uint64 earliest_consolidation_epoch = 12006 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; repeated PendingBalanceDeposit pending_balance_deposits = 12007 [(ethereum.eth.ext.ssz_max) = "pending_balance_deposits_limit"]; repeated PendingPartialWithdrawal pending_partial_withdrawals = 12008 [(ethereum.eth.ext.ssz_max) = "pending_partial_withdrawals_limit"]; diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index 707521ef8345..d95f6eb989f2 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,10 +1,11 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: ae92821338b1fc2296cda7b35445bbd7005303c62eab0bcef3ef9c4c7cf0b9ef +// Hash: 4e7c07afe12b97ee034415333c33967cab8cf624f3fd43f37562cd6307760ec3 package eth import ( ssz "github.com/prysmaticlabs/fastssz" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + github_com_prysmaticlabs_prysm_v5_math "github.com/prysmaticlabs/prysm/v5/math" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ) @@ -17646,16 +17647,16 @@ func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, b.DepositReceiptsStartIndex) // Field (29) 'DepositBalanceToConsume' - dst = ssz.MarshalUint64(dst, b.DepositBalanceToConsume) + dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) // Field (30) 'ExitBalanceToConsume' - dst = ssz.MarshalUint64(dst, b.ExitBalanceToConsume) + dst = ssz.MarshalUint64(dst, uint64(b.ExitBalanceToConsume)) // Field (31) 'EarliestExitEpoch' dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) // Field (32) 'ConsolidationBalanceToConsume' - dst = ssz.MarshalUint64(dst, b.ConsolidationBalanceToConsume) + dst = ssz.MarshalUint64(dst, uint64(b.ConsolidationBalanceToConsume)) // Field (33) 'EarliestConsolidationEpoch' dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) @@ -17979,16 +17980,16 @@ func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { b.DepositReceiptsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) // Field (29) 'DepositBalanceToConsume' - b.DepositBalanceToConsume = ssz.UnmarshallUint64(buf[2736661:2736669]) + b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_math.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) // Field (30) 'ExitBalanceToConsume' - b.ExitBalanceToConsume = ssz.UnmarshallUint64(buf[2736669:2736677]) + b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_math.Gwei(ssz.UnmarshallUint64(buf[2736669:2736677])) // Field (31) 'EarliestExitEpoch' b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736677:2736685])) // Field (32) 'ConsolidationBalanceToConsume' - b.ConsolidationBalanceToConsume = ssz.UnmarshallUint64(buf[2736685:2736693]) + b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_math.Gwei(ssz.UnmarshallUint64(buf[2736685:2736693])) // Field (33) 'EarliestConsolidationEpoch' b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736693:2736701])) @@ -18567,16 +18568,16 @@ func (b *BeaconStateElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(b.DepositReceiptsStartIndex) // Field (29) 'DepositBalanceToConsume' - hh.PutUint64(b.DepositBalanceToConsume) + hh.PutUint64(uint64(b.DepositBalanceToConsume)) // Field (30) 'ExitBalanceToConsume' - hh.PutUint64(b.ExitBalanceToConsume) + hh.PutUint64(uint64(b.ExitBalanceToConsume)) // Field (31) 'EarliestExitEpoch' hh.PutUint64(uint64(b.EarliestExitEpoch)) // Field (32) 'ConsolidationBalanceToConsume' - hh.PutUint64(b.ConsolidationBalanceToConsume) + hh.PutUint64(uint64(b.ConsolidationBalanceToConsume)) // Field (33) 'EarliestConsolidationEpoch' hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) diff --git a/testing/spectest/shared/electra/ssz_static/BUILD.bazel b/testing/spectest/shared/electra/ssz_static/BUILD.bazel index 0c972544a411..b9b04313420a 100644 --- a/testing/spectest/shared/electra/ssz_static/BUILD.bazel +++ b/testing/spectest/shared/electra/ssz_static/BUILD.bazel @@ -7,8 +7,10 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static", visibility = ["//testing/spectest:__subpackages__"], deps = [ + "//beacon-chain/state/state-native:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", "//testing/spectest/shared/common/ssz_static:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", ], diff --git a/testing/spectest/shared/electra/ssz_static/ssz_static.go b/testing/spectest/shared/electra/ssz_static/ssz_static.go index 9f9c6593bce9..ae1ac0ddf274 100644 --- a/testing/spectest/shared/electra/ssz_static/ssz_static.go +++ b/testing/spectest/shared/electra/ssz_static/ssz_static.go @@ -1,12 +1,15 @@ package ssz_static import ( + "context" "errors" "testing" fssz "github.com/prysmaticlabs/fastssz" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/ssz_static" ) @@ -16,26 +19,21 @@ func RunSSZStaticTests(t *testing.T, config string) { } func customHtr(t *testing.T, htrs []common.HTR, object interface{}) []common.HTR { - // TODO: Replace BeaconStateDeneb with BeaconStateElectra below and uncomment the code - //_, ok := object.(*ethpb.BeaconStateDeneb) - //if !ok { - // return htrs - //} - // - //htrs = append(htrs, func(s interface{}) ([32]byte, error) { - // beaconState, err := state_native.InitializeFromProtoDeneb(s.(*ethpb.BeaconStateDeneb)) - // require.NoError(t, err) - // return beaconState.HashTreeRoot(context.Background()) - //}) + _, ok := object.(*ethpb.BeaconStateElectra) + if !ok { + return htrs + } + + htrs = append(htrs, func(s interface{}) ([32]byte, error) { + beaconState, err := state_native.InitializeFromProtoElectra(s.(*ethpb.BeaconStateElectra)) + require.NoError(t, err) + return beaconState.HashTreeRoot(context.Background()) + }) return htrs } // UnmarshalledSSZ unmarshalls serialized input. func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (interface{}, error) { - // TODO: Remove this check once BeaconState custom HTR function is ready - if folderName == "BeaconState" { - t.Skip("BeaconState is not ready") - } var obj interface{} switch folderName { case "ExecutionPayload": diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index 3f6c1e6121be..7871191c5ad3 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -16,6 +16,7 @@ go_library( "deneb.go", "deneb_state.go", "deposits.go", + "electra.go", "helpers.go", "merge.go", "state.go", diff --git a/testing/util/block.go b/testing/util/block.go index bc7485a4b633..41c7812b1fe6 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -1140,6 +1140,19 @@ func HydrateSignedBeaconBlockDeneb(b *ethpb.SignedBeaconBlockDeneb) *ethpb.Signe return b } +// HydrateSignedBeaconBlockElectra hydrates a signed beacon block with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateSignedBeaconBlockElectra(b *ethpb.SignedBeaconBlockElectra) *ethpb.SignedBeaconBlockElectra { + if b == nil { + b = ðpb.SignedBeaconBlockElectra{} + } + if b.Signature == nil { + b.Signature = make([]byte, fieldparams.BLSSignatureLength) + } + b.Block = HydrateBeaconBlockElectra(b.Block) + return b +} + // HydrateSignedBeaconBlockContentsDeneb hydrates a signed beacon block with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateSignedBeaconBlockContentsDeneb(b *ethpb.SignedBeaconBlockContentsDeneb) *ethpb.SignedBeaconBlockContentsDeneb { @@ -1173,6 +1186,22 @@ func HydrateBeaconBlockDeneb(b *ethpb.BeaconBlockDeneb) *ethpb.BeaconBlockDeneb return b } +// HydrateBeaconBlockElectra hydrates a beacon block with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateBeaconBlockElectra(b *ethpb.BeaconBlockElectra) *ethpb.BeaconBlockElectra { + if b == nil { + b = ðpb.BeaconBlockElectra{} + } + if b.ParentRoot == nil { + b.ParentRoot = make([]byte, fieldparams.RootLength) + } + if b.StateRoot == nil { + b.StateRoot = make([]byte, fieldparams.RootLength) + } + b.Body = HydrateBeaconBlockBodyElectra(b.Body) + return b +} + // HydrateV2BeaconBlockDeneb hydrates a v2 beacon block with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2BeaconBlockDeneb(b *v2.BeaconBlockDeneb) *v2.BeaconBlockDeneb { @@ -1231,6 +1260,50 @@ func HydrateBeaconBlockBodyDeneb(b *ethpb.BeaconBlockBodyDeneb) *ethpb.BeaconBlo return b } +// HydrateBeaconBlockBodyElectra hydrates a beacon block body with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.BeaconBlockBodyElectra { + if b == nil { + b = ðpb.BeaconBlockBodyElectra{} + } + if b.RandaoReveal == nil { + b.RandaoReveal = make([]byte, fieldparams.BLSSignatureLength) + } + if b.Graffiti == nil { + b.Graffiti = make([]byte, fieldparams.RootLength) + } + if b.Eth1Data == nil { + b.Eth1Data = ðpb.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + } + } + if b.SyncAggregate == nil { + b.SyncAggregate = ðpb.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncAggregateSyncCommitteeBytesLength), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + } + } + if b.ExecutionPayload == nil { + b.ExecutionPayload = &enginev1.ExecutionPayloadElectra{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), + DepositReceipts: make([]*enginev1.DepositReceipt, 0), + WithdrawalRequests: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0), + } + } + return b +} + // HydrateV2BeaconBlockBodyDeneb hydrates a v2 beacon block body with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2BeaconBlockBodyDeneb(b *v2.BeaconBlockBodyDeneb) *v2.BeaconBlockBodyDeneb { @@ -1283,6 +1356,16 @@ func HydrateSignedBlindedBeaconBlockDeneb(b *ethpb.SignedBlindedBeaconBlockDeneb return b } +// HydrateSignedBlindedBeaconBlockElectra hydrates a signed blinded beacon block with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateSignedBlindedBeaconBlockElectra(b *ethpb.SignedBlindedBeaconBlockElectra) *ethpb.SignedBlindedBeaconBlockElectra { + if b.Signature == nil { + b.Signature = make([]byte, fieldparams.BLSSignatureLength) + } + b.Message = HydrateBlindedBeaconBlockElectra(b.Message) + return b +} + // HydrateV2SignedBlindedBeaconBlockDeneb hydrates a signed v2 blinded beacon block with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2SignedBlindedBeaconBlockDeneb(b *v2.SignedBlindedBeaconBlockDeneb) *v2.SignedBlindedBeaconBlockDeneb { @@ -1309,6 +1392,22 @@ func HydrateBlindedBeaconBlockDeneb(b *ethpb.BlindedBeaconBlockDeneb) *ethpb.Bli return b } +// HydrateBlindedBeaconBlockElectra hydrates a blinded beacon block with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateBlindedBeaconBlockElectra(b *ethpb.BlindedBeaconBlockElectra) *ethpb.BlindedBeaconBlockElectra { + if b == nil { + b = ðpb.BlindedBeaconBlockElectra{} + } + if b.ParentRoot == nil { + b.ParentRoot = make([]byte, fieldparams.RootLength) + } + if b.StateRoot == nil { + b.StateRoot = make([]byte, fieldparams.RootLength) + } + b.Body = HydrateBlindedBeaconBlockBodyElectra(b.Body) + return b +} + // HydrateV2BlindedBeaconBlockDeneb hydrates a v2 blinded beacon block with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2BlindedBeaconBlockDeneb(b *v2.BlindedBeaconBlockDeneb) *v2.BlindedBeaconBlockDeneb { @@ -1367,6 +1466,50 @@ func HydrateBlindedBeaconBlockBodyDeneb(b *ethpb.BlindedBeaconBlockBodyDeneb) *e return b } +// HydrateBlindedBeaconBlockBodyElectra hydrates a blinded beacon block body with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra) *ethpb.BlindedBeaconBlockBodyElectra { + if b == nil { + b = ðpb.BlindedBeaconBlockBodyElectra{} + } + if b.RandaoReveal == nil { + b.RandaoReveal = make([]byte, fieldparams.BLSSignatureLength) + } + if b.Graffiti == nil { + b.Graffiti = make([]byte, 32) + } + if b.Eth1Data == nil { + b.Eth1Data = ðpb.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, 32), + } + } + if b.SyncAggregate == nil { + b.SyncAggregate = ðpb.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncAggregateSyncCommitteeBytesLength), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + } + } + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, fieldparams.RootLength), + WithdrawalsRoot: make([]byte, fieldparams.RootLength), + WithdrawalRequestsRoot: make([]byte, fieldparams.RootLength), + DepositReceiptsRoot: make([]byte, fieldparams.RootLength), + } + } + return b +} + // HydrateV2BlindedBeaconBlockBodyDeneb hydrates a blinded v2 beacon block body with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2BlindedBeaconBlockBodyDeneb(b *v2.BlindedBeaconBlockBodyDeneb) *v2.BlindedBeaconBlockBodyDeneb { diff --git a/testing/util/deneb.go b/testing/util/deneb.go index 83db5a2a5e35..a847fa502322 100644 --- a/testing/util/deneb.go +++ b/testing/util/deneb.go @@ -2,7 +2,6 @@ package util import ( "encoding/binary" - "math" "math/big" "testing" @@ -187,19 +186,3 @@ func ExtendBlocksPlusBlobs(t *testing.T, blks []blocks.ROBlock, size int) ([]blo return blks, blobs } - -// HackDenebMaxuint is helpful for tests that need to set up cases where the deneb fork has passed. -// We have unit tests that assert our config matches the upstream config, where the next fork is always -// set to MaxUint64 until the fork epoch is formally set. This creates an issue for tests that want to -// work with slots that are defined to be after deneb because converting the max epoch to a slot leads -// to multiplication overflow. -// Monkey patching tests with this function is the simplest workaround in these cases. -func HackDenebMaxuint(t *testing.T) func() { - bc := params.MainnetConfig().Copy() - bc.DenebForkEpoch = math.MaxUint32 - undo, err := params.SetActiveWithUndo(bc) - require.NoError(t, err) - return func() { - require.NoError(t, undo()) - } -} diff --git a/testing/util/electra.go b/testing/util/electra.go new file mode 100644 index 000000000000..81a127923760 --- /dev/null +++ b/testing/util/electra.go @@ -0,0 +1,25 @@ +package util + +import ( + "math" + "testing" + + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +// HackElectraMaxuint is helpful for tests that need to set up cases where the electra fork has passed. +// We have unit tests that assert our config matches the upstream config, where the next fork is always +// set to MaxUint64 until the fork epoch is formally set. This creates an issue for tests that want to +// work with slots that are defined to be after electra because converting the max epoch to a slot leads +// to multiplication overflow. +// Monkey patching tests with this function is the simplest workaround in these cases. +func HackElectraMaxuint(t *testing.T) func() { + bc := params.MainnetConfig().Copy() + bc.ElectraForkEpoch = math.MaxUint32 + undo, err := params.SetActiveWithUndo(bc) + require.NoError(t, err) + return func() { + require.NoError(t, undo()) + } +} diff --git a/testing/util/merge.go b/testing/util/merge.go index 83217e85c494..c82c42106aa6 100644 --- a/testing/util/merge.go +++ b/testing/util/merge.go @@ -35,6 +35,10 @@ func NewBeaconBlockDeneb() *ethpb.SignedBeaconBlockDeneb { return HydrateSignedBeaconBlockDeneb(ðpb.SignedBeaconBlockDeneb{}) } +func NewBeaconBlockElectra() *ethpb.SignedBeaconBlockElectra { + return HydrateSignedBeaconBlockElectra(ðpb.SignedBeaconBlockElectra{}) +} + // NewBeaconBlockContentsDeneb creates a beacon block with minimum marshalable fields. func NewBeaconBlockContentsDeneb() *ethpb.SignedBeaconBlockContentsDeneb { return HydrateSignedBeaconBlockContentsDeneb(ðpb.SignedBeaconBlockContentsDeneb{}) @@ -45,6 +49,11 @@ func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb { return HydrateSignedBlindedBeaconBlockDeneb(ðpb.SignedBlindedBeaconBlockDeneb{}) } +// NewBlindedBeaconBlockElectra creates a blinded beacon block with minimum marshalable fields. +func NewBlindedBeaconBlockElectra() *ethpb.SignedBlindedBeaconBlockElectra { + return HydrateSignedBlindedBeaconBlockElectra(ðpb.SignedBlindedBeaconBlockElectra{}) +} + // NewBlindedBeaconBlockCapellaV2 creates a blinded beacon block with minimum marshalable fields. func NewBlindedBeaconBlockCapellaV2() *v2.SignedBlindedBeaconBlockCapella { return HydrateV2SignedBlindedBeaconBlockCapella(&v2.SignedBlindedBeaconBlockCapella{}) diff --git a/testing/util/state.go b/testing/util/state.go index 5d96ba9a32b7..332918e12589 100644 --- a/testing/util/state.go +++ b/testing/util/state.go @@ -386,6 +386,76 @@ func NewBeaconStateDeneb(options ...func(state *ethpb.BeaconStateDeneb) error) ( return st.Copy(), nil } +// NewBeaconStateElectra creates a beacon state with minimum marshalable fields. +func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) error) (state.BeaconState, error) { + pubkeys := make([][]byte, 512) + for i := range pubkeys { + pubkeys[i] = make([]byte, 48) + } + + seed := ðpb.BeaconStateElectra{ + BlockRoots: filledByteSlice2D(uint64(params.BeaconConfig().SlotsPerHistoricalRoot), 32), + StateRoots: filledByteSlice2D(uint64(params.BeaconConfig().SlotsPerHistoricalRoot), 32), + Slashings: make([]uint64, params.BeaconConfig().EpochsPerSlashingsVector), + RandaoMixes: filledByteSlice2D(uint64(params.BeaconConfig().EpochsPerHistoricalVector), 32), + Validators: make([]*ethpb.Validator, 0), + CurrentJustifiedCheckpoint: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + Eth1Data: ðpb.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, 32), + }, + Fork: ðpb.Fork{ + PreviousVersion: make([]byte, 4), + CurrentVersion: make([]byte, 4), + }, + Eth1DataVotes: make([]*ethpb.Eth1Data, 0), + HistoricalRoots: make([][]byte, 0), + JustificationBits: bitfield.Bitvector4{0x0}, + FinalizedCheckpoint: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + LatestBlockHeader: HydrateBeaconHeader(ðpb.BeaconBlockHeader{}), + PreviousJustifiedCheckpoint: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + PreviousEpochParticipation: make([]byte, 0), + CurrentEpochParticipation: make([]byte, 0), + CurrentSyncCommittee: ðpb.SyncCommittee{ + Pubkeys: pubkeys, + AggregatePubkey: make([]byte, 48), + }, + NextSyncCommittee: ðpb.SyncCommittee{ + Pubkeys: pubkeys, + AggregatePubkey: make([]byte, 48), + }, + LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + DepositReceiptsRoot: make([]byte, 32), + WithdrawalRequestsRoot: make([]byte, 32), + }, + } + + for _, opt := range options { + err := opt(seed) + if err != nil { + return nil, err + } + } + + var st, err = state_native.InitializeFromProtoUnsafeElectra(seed) + if err != nil { + return nil, err + } + + return st.Copy(), nil +} + // SSZ will fill 2D byte slices with their respective values, so we must fill these in too for round // trip testing. func filledByteSlice2D(length, innerLen uint64) [][]byte { diff --git a/testing/util/state_test.go b/testing/util/state_test.go index d99e2c342b45..57362f7072c6 100644 --- a/testing/util/state_test.go +++ b/testing/util/state_test.go @@ -59,6 +59,16 @@ func TestNewBeaconStateDeneb(t *testing.T) { assert.DeepEqual(t, st.ToProtoUnsafe(), got) } +func TestNewBeaconStateElectra(t *testing.T) { + st, err := NewBeaconStateElectra() + require.NoError(t, err) + b, err := st.MarshalSSZ() + require.NoError(t, err) + got := ðpb.BeaconStateElectra{} + require.NoError(t, got.UnmarshalSSZ(b)) + assert.DeepEqual(t, st.ToProtoUnsafe(), got) +} + func TestNewBeaconState_HashTreeRoot(t *testing.T) { st, err := NewBeaconState() require.NoError(t, err) @@ -76,4 +86,12 @@ func TestNewBeaconState_HashTreeRoot(t *testing.T) { require.NoError(t, err) _, err = st.HashTreeRoot(context.Background()) require.NoError(t, err) + st, err = NewBeaconStateDeneb() + require.NoError(t, err) + _, err = st.HashTreeRoot(context.Background()) + require.NoError(t, err) + st, err = NewBeaconStateElectra() + require.NoError(t, err) + _, err = st.HashTreeRoot(context.Background()) + require.NoError(t, err) } From 49f3531aedeac88723069fffe2dcf471dd0abfbc Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 6 May 2024 17:47:05 -0700 Subject: [PATCH 069/325] Remove unused validator map copy method (#13954) --- beacon-chain/state/state-native/state_test.go | 28 ------------------- .../state/stateutil/validator_map_handler.go | 18 ------------ 2 files changed, 46 deletions(-) diff --git a/beacon-chain/state/state-native/state_test.go b/beacon-chain/state/state-native/state_test.go index f5ddef9d32d9..2f60c53855e1 100644 --- a/beacon-chain/state/state-native/state_test.go +++ b/beacon-chain/state/state-native/state_test.go @@ -20,34 +20,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" ) -func TestValidatorMap_DistinctCopy(t *testing.T) { - count := uint64(100) - vals := make([]*ethpb.Validator, 0, count) - for i := uint64(1); i < count; i++ { - var someRoot [32]byte - var someKey [fieldparams.BLSPubkeyLength]byte - copy(someRoot[:], strconv.Itoa(int(i))) - copy(someKey[:], strconv.Itoa(int(i))) - vals = append(vals, ðpb.Validator{ - PublicKey: someKey[:], - WithdrawalCredentials: someRoot[:], - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - Slashed: false, - ActivationEligibilityEpoch: 1, - ActivationEpoch: 1, - ExitEpoch: 1, - WithdrawableEpoch: 1, - }) - } - handler := stateutil.NewValMapHandler(vals) - newHandler := handler.Copy() - wantedPubkey := strconv.Itoa(22) - handler.Set(bytesutil.ToBytes48([]byte(wantedPubkey)), 27) - val1, _ := handler.Get(bytesutil.ToBytes48([]byte(wantedPubkey))) - val2, _ := newHandler.Get(bytesutil.ToBytes48([]byte(wantedPubkey))) - assert.NotEqual(t, val1, val2, "Values are supposed to be unequal due to copy") -} - func TestBeaconState_NoDeadlock_Phase0(t *testing.T) { count := uint64(100) vals := make([]*ethpb.Validator, 0, count) diff --git a/beacon-chain/state/stateutil/validator_map_handler.go b/beacon-chain/state/stateutil/validator_map_handler.go index df03ee434f1f..a9f7902d4fba 100644 --- a/beacon-chain/state/stateutil/validator_map_handler.go +++ b/beacon-chain/state/stateutil/validator_map_handler.go @@ -36,24 +36,6 @@ func (v *ValidatorMapHandler) IsNil() bool { return v.mapRef == nil || v.valIdxMap == nil } -// Copy the whole map and returns a map handler with the copied map. -func (v *ValidatorMapHandler) Copy() *ValidatorMapHandler { - if v == nil || v.valIdxMap == nil { - return &ValidatorMapHandler{valIdxMap: map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex{}, mapRef: new(Reference), RWMutex: new(sync.RWMutex)} - } - v.RLock() - defer v.RUnlock() - m := make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex, len(v.valIdxMap)) - for k, v := range v.valIdxMap { - m[k] = v - } - return &ValidatorMapHandler{ - valIdxMap: m, - mapRef: &Reference{refs: 1}, - RWMutex: new(sync.RWMutex), - } -} - // Get the validator index using the corresponding public key. func (v *ValidatorMapHandler) Get(key [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool) { v.RLock() From 5f1b903bdf4db1a7b6e5e037667522c213620af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 7 May 2024 22:48:23 +0900 Subject: [PATCH 070/325] EIP-7549 beacon spec (#13946) * EIP-7549 beacon spec * reviews * change signature of AttestingIndices --- beacon-chain/blockchain/process_block.go | 2 +- beacon-chain/core/altair/attestation.go | 2 +- beacon-chain/core/altair/attestation_test.go | 4 +- beacon-chain/core/altair/upgrade.go | 2 +- beacon-chain/core/altair/upgrade_test.go | 2 +- beacon-chain/core/blocks/attestation.go | 59 ++++++--- beacon-chain/core/blocks/attestation_test.go | 81 +++++++++++- beacon-chain/core/epoch/epoch_processing.go | 2 +- .../core/epoch/precompute/attestation.go | 2 +- .../core/epoch/precompute/attestation_test.go | 4 +- beacon-chain/core/helpers/beacon_committee.go | 15 +++ .../core/helpers/beacon_committee_test.go | 9 ++ .../core/transition/transition_test.go | 2 +- beacon-chain/monitor/process_attestation.go | 2 +- .../rpc/prysm/v1alpha1/debug/block.go | 2 +- .../v1alpha1/validator/aggregator_test.go | 4 +- .../prysm/v1alpha1/validator/proposer_test.go | 2 +- .../sync/pending_attestations_queue_test.go | 6 +- .../sync/validate_aggregate_proof_test.go | 10 +- proto/prysm/v1alpha1/attestation/BUILD.bazel | 2 + .../v1alpha1/attestation/attestation_utils.go | 118 ++++++++++++++---- .../attestation/attestation_utils_test.go | 66 ++++++++-- 22 files changed, 321 insertions(+), 77 deletions(-) diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 3f8c94ccedfd..5ced8b1623de 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -370,7 +370,7 @@ func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.Re if err != nil { return err } - indices, err := attestation.AttestingIndices(a.GetAggregationBits(), committee) + indices, err := attestation.AttestingIndices(a, committee) if err != nil { return err } diff --git a/beacon-chain/core/altair/attestation.go b/beacon-chain/core/altair/attestation.go index 8b123c91ca8b..336edf57a7ab 100644 --- a/beacon-chain/core/altair/attestation.go +++ b/beacon-chain/core/altair/attestation.go @@ -70,7 +70,7 @@ func ProcessAttestationNoVerifySignature( if err != nil { return nil, err } - indices, err := attestation.AttestingIndices(att.GetAggregationBits(), committee) + indices, err := attestation.AttestingIndices(att, committee) if err != nil { return nil, err } diff --git a/beacon-chain/core/altair/attestation_test.go b/beacon-chain/core/altair/attestation_test.go index d548c5c4e78a..2665edac852e 100644 --- a/beacon-chain/core/altair/attestation_test.go +++ b/beacon-chain/core/altair/attestation_test.go @@ -215,7 +215,7 @@ func TestProcessAttestations_OK(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) require.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) sigs := make([]bls.Signature, len(attestingIndices)) for i, indice := range attestingIndices { @@ -273,7 +273,7 @@ func TestProcessAttestationNoVerify_SourceTargetHead(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) require.NoError(t, err) - indices, err := attestation.AttestingIndices(att.AggregationBits, committee) + indices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) for _, index := range indices { has, err := altair.HasValidatorFlag(p[index], params.BeaconConfig().TimelyHeadFlagIndex) diff --git a/beacon-chain/core/altair/upgrade.go b/beacon-chain/core/altair/upgrade.go index 5557c5ce4007..3b3e33ce89c3 100644 --- a/beacon-chain/core/altair/upgrade.go +++ b/beacon-chain/core/altair/upgrade.go @@ -158,7 +158,7 @@ func TranslateParticipation(ctx context.Context, state state.BeaconState, atts [ if err != nil { return nil, err } - indices, err := attestation.AttestingIndices(att.AggregationBits, committee) + indices, err := attestation.AttestingIndices(att, committee) if err != nil { return nil, err } diff --git a/beacon-chain/core/altair/upgrade_test.go b/beacon-chain/core/altair/upgrade_test.go index 3860edfc5b65..12060a6f7482 100644 --- a/beacon-chain/core/altair/upgrade_test.go +++ b/beacon-chain/core/altair/upgrade_test.go @@ -55,7 +55,7 @@ func TestTranslateParticipation(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(ctx, s, pendingAtts[0].Data.Slot, pendingAtts[0].Data.CommitteeIndex) require.NoError(t, err) - indices, err := attestation.AttestingIndices(pendingAtts[0].AggregationBits, committee) + indices, err := attestation.AttestingIndices(pendingAtts[0], committee) require.NoError(t, err) for _, index := range indices { has, err := altair.HasValidatorFlag(participation[index], params.BeaconConfig().TimelySourceFlagIndex) diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index a704bf26050a..2afafcb6a11e 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -107,22 +107,53 @@ func VerifyAttestationNoVerifySignature( return err } c := helpers.SlotCommitteeCount(activeValidatorCount) - if uint64(att.GetData().CommitteeIndex) >= c { - return fmt.Errorf("committee index %d >= committee count %d", att.GetData().CommitteeIndex, c) - } - if err := helpers.VerifyAttestationBitfieldLengths(ctx, beaconState, att); err != nil { - return errors.Wrap(err, "could not verify attestation bitfields") - } + var indexedAtt ethpb.IndexedAtt - // Verify attesting indices are correct. - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) - if err != nil { - return err - } - indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) - if err != nil { - return err + if att.Version() < version.Electra { + if uint64(att.GetData().CommitteeIndex) >= c { + return fmt.Errorf("committee index %d >= committee count %d", att.GetData().CommitteeIndex, c) + } + + if err = helpers.VerifyAttestationBitfieldLengths(ctx, beaconState, att); err != nil { + return errors.Wrap(err, "could not verify attestation bitfields") + } + + // Verify attesting indices are correct. + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) + if err != nil { + return err + } + indexedAtt, err = attestation.ConvertToIndexed(ctx, att, committee) + if err != nil { + return err + } + } else { + if att.GetData().CommitteeIndex != 0 { + return errors.New("committee index must be 0 post-Electra") + } + + committeeIndices := att.GetCommitteeBitsVal().BitIndices() + committees := make([][]primitives.ValidatorIndex, len(committeeIndices)) + participantsCount := 0 + var err error + for i, ci := range committeeIndices { + if uint64(ci) >= c { + return fmt.Errorf("committee index %d >= committee count %d", ci, c) + } + committees[i], err = helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, primitives.CommitteeIndex(ci)) + if err != nil { + return err + } + participantsCount += len(committees[i]) + } + if att.GetAggregationBits().Len() != uint64(participantsCount) { + return fmt.Errorf("aggregation bits count %d is different than participant count %d", att.GetAggregationBits().Len(), participantsCount) + } + indexedAtt, err = attestation.ConvertToIndexed(ctx, att, committees...) + if err != nil { + return err + } } return attestation.IsValidAttestationIndices(ctx, indexedAtt) diff --git a/beacon-chain/core/blocks/attestation_test.go b/beacon-chain/core/blocks/attestation_test.go index 3565e3ceb288..10ca47b178ea 100644 --- a/beacon-chain/core/blocks/attestation_test.go +++ b/beacon-chain/core/blocks/attestation_test.go @@ -45,7 +45,7 @@ func TestProcessAggregatedAttestation_OverlappingBits(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att1.Data.Slot, att1.Data.CommitteeIndex) require.NoError(t, err) - attestingIndices1, err := attestation.AttestingIndices(att1.AggregationBits, committee) + attestingIndices1, err := attestation.AttestingIndices(att1, committee) require.NoError(t, err) sigs := make([]bls.Signature, len(attestingIndices1)) for i, indice := range attestingIndices1 { @@ -67,7 +67,7 @@ func TestProcessAggregatedAttestation_OverlappingBits(t *testing.T) { committee, err = helpers.BeaconCommitteeFromState(context.Background(), beaconState, att2.Data.Slot, att2.Data.CommitteeIndex) require.NoError(t, err) - attestingIndices2, err := attestation.AttestingIndices(att2.AggregationBits, committee) + attestingIndices2, err := attestation.AttestingIndices(att2, committee) require.NoError(t, err) sigs = make([]bls.Signature, len(attestingIndices2)) for i, indice := range attestingIndices2 { @@ -222,6 +222,83 @@ func TestVerifyAttestationNoVerifySignature_BadAttIdx(t *testing.T) { require.ErrorContains(t, "committee index 100 >= committee count 1", err) } +func TestVerifyAttestationNoVerifySignature_Electra(t *testing.T) { + var mockRoot [32]byte + copy(mockRoot[:], "hello-world") + var zeroSig [fieldparams.BLSSignatureLength]byte + + beaconState, _ := util.DeterministicGenesisState(t, 100) + err := beaconState.SetSlot(beaconState.Slot() + params.BeaconConfig().MinAttestationInclusionDelay) + require.NoError(t, err) + ckp := beaconState.CurrentJustifiedCheckpoint() + copy(ckp.Root, "hello-world") + require.NoError(t, beaconState.SetCurrentJustifiedCheckpoint(ckp)) + require.NoError(t, beaconState.AppendCurrentEpochAttestations(ðpb.PendingAttestation{})) + + t.Run("ok", func(t *testing.T) { + aggBits := bitfield.NewBitlist(3) + aggBits.SetBitAt(1, true) + committeeBits := bitfield.NewBitvector64() + committeeBits.SetBitAt(0, true) + att := ðpb.AttestationElectra{ + Data: ðpb.AttestationData{ + Source: ðpb.Checkpoint{Epoch: 0, Root: mockRoot[:]}, + Target: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, 32)}, + }, + AggregationBits: aggBits, + CommitteeBits: committeeBits, + } + att.Signature = zeroSig[:] + err = blocks.VerifyAttestationNoVerifySignature(context.TODO(), beaconState, att) + assert.NoError(t, err) + }) + t.Run("non-zero committee index", func(t *testing.T) { + att := ðpb.AttestationElectra{ + Data: ðpb.AttestationData{ + Source: ðpb.Checkpoint{Epoch: 0, Root: mockRoot[:]}, + Target: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, 32)}, + CommitteeIndex: 1, + }, + AggregationBits: bitfield.NewBitlist(1), + CommitteeBits: bitfield.NewBitvector64(), + } + err = blocks.VerifyAttestationNoVerifySignature(context.TODO(), beaconState, att) + assert.ErrorContains(t, "committee index must be 0 post-Electra", err) + }) + t.Run("index of committee too big", func(t *testing.T) { + aggBits := bitfield.NewBitlist(3) + committeeBits := bitfield.NewBitvector64() + committeeBits.SetBitAt(63, true) + att := ðpb.AttestationElectra{ + Data: ðpb.AttestationData{ + Source: ðpb.Checkpoint{Epoch: 0, Root: mockRoot[:]}, + Target: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, 32)}, + }, + AggregationBits: aggBits, + CommitteeBits: committeeBits, + } + att.Signature = zeroSig[:] + err = blocks.VerifyAttestationNoVerifySignature(context.TODO(), beaconState, att) + assert.ErrorContains(t, "committee index 63 >= committee count 1", err) + }) + t.Run("wrong aggregation bits count", func(t *testing.T) { + aggBits := bitfield.NewBitlist(123) + committeeBits := bitfield.NewBitvector64() + committeeBits.SetBitAt(0, true) + att := ðpb.AttestationElectra{ + Data: ðpb.AttestationData{ + Source: ðpb.Checkpoint{Epoch: 0, Root: mockRoot[:]}, + Target: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, 32)}, + }, + AggregationBits: aggBits, + CommitteeBits: committeeBits, + } + att.Signature = zeroSig[:] + err = blocks.VerifyAttestationNoVerifySignature(context.TODO(), beaconState, att) + assert.ErrorContains(t, "aggregation bits count 123 is different than participant count 3", err) + }) +} + func TestConvertToIndexed_OK(t *testing.T) { helpers.ClearCache() validators := make([]*ethpb.Validator, 2*params.BeaconConfig().SlotsPerEpoch) diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 48980c6d5eae..5119e5059fe0 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -474,7 +474,7 @@ func UnslashedAttestingIndices(ctx context.Context, state state.ReadOnlyBeaconSt if err != nil { return nil, err } - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) if err != nil { return nil, err } diff --git a/beacon-chain/core/epoch/precompute/attestation.go b/beacon-chain/core/epoch/precompute/attestation.go index 48087d89db85..a510fbb83e6f 100644 --- a/beacon-chain/core/epoch/precompute/attestation.go +++ b/beacon-chain/core/epoch/precompute/attestation.go @@ -58,7 +58,7 @@ func ProcessAttestations( if err != nil { return nil, nil, err } - indices, err := attestation.AttestingIndices(a.AggregationBits, committee) + indices, err := attestation.AttestingIndices(a, committee) if err != nil { return nil, nil, err } diff --git a/beacon-chain/core/epoch/precompute/attestation_test.go b/beacon-chain/core/epoch/precompute/attestation_test.go index 1801afa9f4df..90404586af3c 100644 --- a/beacon-chain/core/epoch/precompute/attestation_test.go +++ b/beacon-chain/core/epoch/precompute/attestation_test.go @@ -211,7 +211,7 @@ func TestProcessAttestations(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att1.Data.Slot, att1.Data.CommitteeIndex) require.NoError(t, err) - indices, err := attestation.AttestingIndices(att1.AggregationBits, committee) + indices, err := attestation.AttestingIndices(att1, committee) require.NoError(t, err) for _, i := range indices { if !pVals[i].IsPrevEpochAttester { @@ -220,7 +220,7 @@ func TestProcessAttestations(t *testing.T) { } committee, err = helpers.BeaconCommitteeFromState(context.Background(), beaconState, att2.Data.Slot, att2.Data.CommitteeIndex) require.NoError(t, err) - indices, err = attestation.AttestingIndices(att2.AggregationBits, committee) + indices, err = attestation.AttestingIndices(att2, committee) require.NoError(t, err) for _, i := range indices { assert.Equal(t, true, pVals[i].IsPrevEpochAttester, "Not a prev epoch attester") diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 9cb3f11c6793..86134ca4d0e2 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -295,6 +295,21 @@ func ShuffledIndices(s state.ReadOnlyBeaconState, epoch primitives.Epoch) ([]pri return UnshuffleList(indices, seed) } +// CommitteeIndices return beacon committee indices corresponding to bits that are set on the argument bitfield. +// +// Spec pseudocode definition: +// +// def get_committee_indices(committee_bits: Bitvector) -> Sequence[CommitteeIndex]: +// return [CommitteeIndex(index) for index, bit in enumerate(committee_bits) if bit] +func CommitteeIndices(committeeBits bitfield.Bitfield) []primitives.CommitteeIndex { + indices := committeeBits.BitIndices() + committeeIndices := make([]primitives.CommitteeIndex, len(indices)) + for i, ix := range indices { + committeeIndices[i] = primitives.CommitteeIndex(uint64(ix)) + } + return committeeIndices +} + // UpdateCommitteeCache gets called at the beginning of every epoch to cache the committee shuffled indices // list with committee index and epoch number. It caches the shuffled indices for the input epoch. func UpdateCommitteeCache(ctx context.Context, state state.ReadOnlyBeaconState, e primitives.Epoch) error { diff --git a/beacon-chain/core/helpers/beacon_committee_test.go b/beacon-chain/core/helpers/beacon_committee_test.go index 5de5d1bf4e38..1402c207394d 100644 --- a/beacon-chain/core/helpers/beacon_committee_test.go +++ b/beacon-chain/core/helpers/beacon_committee_test.go @@ -699,3 +699,12 @@ func TestPrecomputeProposerIndices_Ok(t *testing.T) { } assert.DeepEqual(t, wantedProposerIndices, proposerIndices, "Did not precompute proposer indices correctly") } + +func TestCommitteeIndices(t *testing.T) { + bitfield := bitfield.NewBitvector4() + bitfield.SetBitAt(0, true) + bitfield.SetBitAt(1, true) + bitfield.SetBitAt(3, true) + indices := helpers.CommitteeIndices(bitfield) + assert.DeepEqual(t, []primitives.CommitteeIndex{0, 1, 3}, indices) +} diff --git a/beacon-chain/core/transition/transition_test.go b/beacon-chain/core/transition/transition_test.go index 1d31c4127d0c..2a5bc346dcc1 100644 --- a/beacon-chain/core/transition/transition_test.go +++ b/beacon-chain/core/transition/transition_test.go @@ -311,7 +311,7 @@ func createFullBlockWithOperations(t *testing.T) (state.BeaconState, committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, blockAtt.Data.Slot, blockAtt.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(blockAtt.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(blockAtt, committee) require.NoError(t, err) assert.NoError(t, err) hashTreeRoot, err = signing.ComputeSigningRoot(blockAtt.Data, domain) diff --git a/beacon-chain/monitor/process_attestation.go b/beacon-chain/monitor/process_attestation.go index 25b90b741b13..9f596eea61ea 100644 --- a/beacon-chain/monitor/process_attestation.go +++ b/beacon-chain/monitor/process_attestation.go @@ -38,7 +38,7 @@ func attestingIndices(ctx context.Context, state state.BeaconState, att interfac if err != nil { return nil, err } - return attestation.AttestingIndices(att.GetAggregationBits(), committee) + return attestation.AttestingIndices(att, committee) } // logMessageTimelyFlagsForIndex returns the log message with performance info for the attestation (head, source, target) diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go index fe2c7facd850..808d66b05e6d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go @@ -79,7 +79,7 @@ func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlot if err != nil { return nil, status.Errorf(codes.Internal, "Could not get committee: %v", err) } - indices, err := attestation.AttestingIndices(a.GetAggregationBits(), c) + indices, err := attestation.AttestingIndices(a, c) if err != nil { return nil, err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go index ef72ed17ea84..b1cc8100eda2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go @@ -227,7 +227,7 @@ func generateAtt(state state.ReadOnlyBeaconState, index uint64, privKeys []bls.S if err != nil { return nil, err } - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) if err != nil { return nil, err } @@ -266,7 +266,7 @@ func generateUnaggregatedAtt(state state.ReadOnlyBeaconState, index uint64, priv if err != nil { return nil, err } - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) if err != nil { return nil, err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 796cdf1d1af3..9e1144fcf1a1 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -2440,7 +2440,7 @@ func TestProposer_FilterAttestation(t *testing.T) { }) committee, err := helpers.BeaconCommitteeFromState(context.Background(), st, atts[i].GetData().Slot, atts[i].GetData().CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(atts[i].GetAggregationBits(), committee) + attestingIndices, err := attestation.AttestingIndices(atts[i], committee) require.NoError(t, err) assert.NoError(t, err) domain, err := signing.Domain(st.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, params.BeaconConfig().ZeroHash[:]) diff --git a/beacon-chain/sync/pending_attestations_queue_test.go b/beacon-chain/sync/pending_attestations_queue_test.go index 3f32b8fa8d51..b99e15d5ffec 100644 --- a/beacon-chain/sync/pending_attestations_queue_test.go +++ b/beacon-chain/sync/pending_attestations_queue_test.go @@ -82,7 +82,7 @@ func TestProcessPendingAtts_HasBlockSaveUnAggregatedAtt(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) attesterDomain, err := signing.Domain(beaconState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot()) require.NoError(t, err) @@ -205,7 +205,7 @@ func TestProcessPendingAtts_NoBroadcastWithBadSignature(t *testing.T) { } committee, err := helpers.BeaconCommitteeFromState(context.Background(), s, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) attesterDomain, err := signing.Domain(s.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, s.GenesisValidatorsRoot()) require.NoError(t, err) @@ -285,7 +285,7 @@ func TestProcessPendingAtts_HasBlockSaveAggregatedAtt(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) attesterDomain, err := signing.Domain(beaconState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot()) require.NoError(t, err) diff --git a/beacon-chain/sync/validate_aggregate_proof_test.go b/beacon-chain/sync/validate_aggregate_proof_test.go index fe141e47cff6..1c4da525bf06 100644 --- a/beacon-chain/sync/validate_aggregate_proof_test.go +++ b/beacon-chain/sync/validate_aggregate_proof_test.go @@ -50,7 +50,7 @@ func TestVerifyIndexInCommittee_CanVerify(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), s, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - indices, err := attestation.AttestingIndices(att.AggregationBits, committee) + indices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) result, err := service.validateIndexInCommittee(ctx, s, att, primitives.ValidatorIndex(indices[0])) require.NoError(t, err) @@ -354,7 +354,7 @@ func TestValidateAggregateAndProof_CanValidate(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) assert.NoError(t, err) attesterDomain, err := signing.Domain(beaconState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot()) @@ -458,7 +458,7 @@ func TestVerifyIndexInCommittee_SeenAggregatorEpoch(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) require.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) attesterDomain, err := signing.Domain(beaconState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot()) require.NoError(t, err) @@ -577,7 +577,7 @@ func TestValidateAggregateAndProof_BadBlock(t *testing.T) { committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) assert.NoError(t, err) attesterDomain, err := signing.Domain(beaconState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot()) @@ -668,7 +668,7 @@ func TestValidateAggregateAndProof_RejectWhenAttEpochDoesntEqualTargetEpoch(t *t committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att.AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) assert.NoError(t, err) attesterDomain, err := signing.Domain(beaconState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot()) diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index 9c45df7466c1..7277285cc710 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -12,6 +12,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@io_opencensus_go//trace:go_default_library", @@ -25,6 +26,7 @@ go_test( ":go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils.go b/proto/prysm/v1alpha1/attestation/attestation_utils.go index bfa2bf64aa92..432d496efba9 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "fmt" + "slices" "sort" "github.com/pkg/errors" @@ -16,6 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "go.opencensus.io/trace" ) @@ -38,8 +40,8 @@ import ( // data=attestation.data, // signature=attestation.signature, // ) -func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, committee []primitives.ValidatorIndex) (ethpb.IndexedAtt, error) { - attIndices, err := AttestingIndices(attestation.GetAggregationBits(), committee) +func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, committees ...[]primitives.ValidatorIndex) (ethpb.IndexedAtt, error) { + attIndices, err := AttestingIndices(attestation, committees...) if err != nil { return nil, err } @@ -55,32 +57,62 @@ func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, c return inAtt, err } -// AttestingIndices returns the attesting participants indices from the attestation data. The -// committee is provided as an argument rather than a imported implementation from the spec definition. -// Having the committee as an argument allows for re-use of beacon committees when possible. +// AttestingIndices returns the attesting participants indices from the attestation data. +// Committees are provided as an argument rather than an imported implementation from the spec definition. +// Having committees as an argument allows for re-use of beacon committees when possible. // -// Spec pseudocode definition: +// Spec pseudocode definition (Electra version): // -// def get_attesting_indices(state: BeaconState, -// data: AttestationData, -// bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE]) -> Set[ValidatorIndex]: -// """ -// Return the set of attesting indices corresponding to ``data`` and ``bits``. -// """ -// committee = get_beacon_committee(state, data.slot, data.index) -// return set(index for i, index in enumerate(committee) if bits[i]) -func AttestingIndices(bf bitfield.Bitfield, committee []primitives.ValidatorIndex) ([]uint64, error) { - if bf.Len() != uint64(len(committee)) { - return nil, fmt.Errorf("bitfield length %d is not equal to committee length %d", bf.Len(), len(committee)) - } - indices := make([]uint64, 0, bf.Count()) - p := bf.BitIndices() - for _, idx := range p { - if idx < len(committee) { - indices = append(indices, uint64(committee[idx])) +// def get_attesting_indices(state: BeaconState, attestation: Attestation) -> Set[ValidatorIndex]: +// """ +// Return the set of attesting indices corresponding to ``aggregation_bits`` and ``committee_bits``. +// """ +// output: Set[ValidatorIndex] = set() +// committee_indices = get_committee_indices(attestation.committee_bits) +// committee_offset = 0 +// for index in committee_indices: +// committee = get_beacon_committee(state, attestation.data.slot, index) +// committee_attesters = set( +// index for i, index in enumerate(committee) if attestation.aggregation_bits[committee_offset + i]) +// output = output.union(committee_attesters) +// +// committee_offset += len(committee) +// +// return output +func AttestingIndices(att interfaces.Attestation, committees ...[]primitives.ValidatorIndex) ([]uint64, error) { + if len(committees) == 0 { + return []uint64{}, nil + } + + aggBits := att.GetAggregationBits() + + if att.Version() < version.Electra { + return attestingIndicesPhase0(aggBits, committees[0]) + } + + committeesLen := 0 + for _, c := range committees { + committeesLen += len(c) + } + if aggBits.Len() != uint64(committeesLen) { + return nil, fmt.Errorf("bitfield length %d is not equal to committee length %d", aggBits.Len(), committeesLen) + } + + attesters := make([]uint64, 0, aggBits.Count()) + committeeOffset := 0 + for _, c := range committees { + committeeAttesters := make([]uint64, 0, len(c)) + for i, vi := range c { + if aggBits.BitAt(uint64(committeeOffset + i)) { + committeeAttesters = append(committeeAttesters, uint64(vi)) + } } + attesters = append(attesters, committeeAttesters...) + committeeOffset += len(c) } - return indices, nil + + slices.Sort(attesters) + return slices.Compact(attesters), nil } // VerifyIndexedAttestationSig this helper function performs the last part of the @@ -157,8 +189,16 @@ func IsValidAttestationIndices(ctx context.Context, indexedAttestation ethpb.Ind if len(indices) == 0 { return errors.New("expected non-empty attesting indices") } - if uint64(len(indices)) > params.BeaconConfig().MaxValidatorsPerCommittee { - return fmt.Errorf("validator indices count exceeds MAX_VALIDATORS_PER_COMMITTEE, %d > %d", len(indices), params.BeaconConfig().MaxValidatorsPerCommittee) + if indexedAttestation.Version() < version.Electra { + maxLength := params.BeaconConfig().MaxValidatorsPerCommittee + if uint64(len(indices)) > maxLength { + return fmt.Errorf("validator indices count exceeds MAX_VALIDATORS_PER_COMMITTEE, %d > %d", len(indices), maxLength) + } + } else { + maxLength := params.BeaconConfig().MaxValidatorsPerCommittee * params.BeaconConfig().MaxCommitteesPerSlot + if uint64(len(indices)) > maxLength { + return fmt.Errorf("validator indices count exceeds MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT, %d > %d", len(indices), maxLength) + } } for i := 1; i < len(indices); i++ { if indices[i-1] >= indices[i] { @@ -204,3 +244,29 @@ func CheckPointIsEqual(checkPt1, checkPt2 *ethpb.Checkpoint) bool { } return true } + +// attestingIndicesPhase0 returns the attesting participants indices from the attestation data. +// Committees are provided as an argument rather than an imported implementation from the spec definition. +// Having committees as an argument allows for re-use of beacon committees when possible. +// +// Spec pseudocode definition (Phase0 version): +// +// def get_attesting_indices(state: BeaconState, attestation: Attestation) -> Set[ValidatorIndex]: +// """ +// Return the set of attesting indices corresponding to ``data`` and ``bits``. +// """ +// committee = get_beacon_committee(state, attestation.data.slot, attestation.data.index) +// return set(index for i, index in enumerate(committee) if attestation.aggregation_bits[i]) +func attestingIndicesPhase0(aggBits bitfield.Bitlist, committee []primitives.ValidatorIndex) ([]uint64, error) { + if aggBits.Len() != uint64(len(committee)) { + return nil, fmt.Errorf("bitfield length %d is not equal to committee length %d", aggBits.Len(), len(committee)) + } + indices := make([]uint64, 0, aggBits.Count()) + p := aggBits.BitIndices() + for _, idx := range p { + if idx < len(committee) { + indices = append(indices, uint64(committee[idx])) + } + } + return indices, nil +} diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils_test.go b/proto/prysm/v1alpha1/attestation/attestation_utils_test.go index ecb36c398527..d24a33190967 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils_test.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils_test.go @@ -7,6 +7,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" @@ -16,8 +17,8 @@ import ( func TestAttestingIndices(t *testing.T) { type args struct { - bf bitfield.Bitfield - committee []primitives.ValidatorIndex + att interfaces.Attestation + committees [][]primitives.ValidatorIndex } tests := []struct { name string @@ -28,31 +29,63 @@ func TestAttestingIndices(t *testing.T) { { name: "Full committee attested", args: args{ - bf: bitfield.Bitlist{0b1111}, - committee: []primitives.ValidatorIndex{0, 1, 2}, + att: ð.Attestation{AggregationBits: bitfield.Bitlist{0b1111}}, + committees: [][]primitives.ValidatorIndex{{0, 1, 2}}, }, want: []uint64{0, 1, 2}, }, { name: "Partial committee attested", args: args{ - bf: bitfield.Bitlist{0b1101}, - committee: []primitives.ValidatorIndex{0, 1, 2}, + att: ð.Attestation{AggregationBits: bitfield.Bitlist{0b1101}}, + committees: [][]primitives.ValidatorIndex{{0, 1, 2}}, }, want: []uint64{0, 2}, }, { name: "Invalid bit length", args: args{ - bf: bitfield.Bitlist{0b11111}, - committee: []primitives.ValidatorIndex{0, 1, 2}, + att: ð.Attestation{AggregationBits: bitfield.Bitlist{0b11111}}, + committees: [][]primitives.ValidatorIndex{{0, 1, 2}}, }, err: "bitfield length 4 is not equal to committee length 3", }, + { + name: "Electra - Full committee attested", + args: args{ + att: ð.AttestationElectra{AggregationBits: bitfield.Bitlist{0b11111}}, + committees: [][]primitives.ValidatorIndex{{0, 1}, {2, 3}}, + }, + want: []uint64{0, 1, 2, 3}, + }, + { + name: "Electra - Partial committee attested", + args: args{ + att: ð.AttestationElectra{AggregationBits: bitfield.Bitlist{0b10110}}, + committees: [][]primitives.ValidatorIndex{{0, 1}, {2, 3}}, + }, + want: []uint64{1, 2}, + }, + { + name: "Electra - Invalid bit length", + args: args{ + att: ð.AttestationElectra{AggregationBits: bitfield.Bitlist{0b111111}}, + committees: [][]primitives.ValidatorIndex{{0, 1}, {2, 3}}, + }, + err: "bitfield length 5 is not equal to committee length 4", + }, + { + name: "Electra - No duplicates", + args: args{ + att: ð.AttestationElectra{AggregationBits: bitfield.Bitlist{0b11111}}, + committees: [][]primitives.ValidatorIndex{{0, 1}, {0, 1}}, + }, + want: []uint64{0, 1}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := attestation.AttestingIndices(tt.args.bf, tt.args.committee) + got, err := attestation.AttestingIndices(tt.args.att, tt.args.committees...) if tt.err == "" { require.NoError(t, err) assert.DeepEqual(t, tt.want, got) @@ -66,7 +99,7 @@ func TestAttestingIndices(t *testing.T) { func TestIsValidAttestationIndices(t *testing.T) { tests := []struct { name string - att *eth.IndexedAttestation + att eth.IndexedAtt wantedErr string }{ { @@ -142,6 +175,17 @@ func TestIsValidAttestationIndices(t *testing.T) { Signature: make([]byte, fieldparams.BLSSignatureLength), }, }, + { + name: "Electra - Greater than max validators per slot", + att: ð.IndexedAttestationElectra{ + AttestingIndices: make([]uint64, params.BeaconConfig().MaxValidatorsPerCommittee*params.BeaconConfig().MaxCommitteesPerSlot+1), + Data: ð.AttestationData{ + Target: ð.Checkpoint{}, + }, + Signature: make([]byte, fieldparams.BLSSignatureLength), + }, + wantedErr: "indices count exceeds", + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -161,7 +205,7 @@ func BenchmarkAttestingIndices_PartialCommittee(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - _, err := attestation.AttestingIndices(bf, committee) + _, err := attestation.AttestingIndices(ð.Attestation{AggregationBits: bf}, committee) require.NoError(b, err) } } From aa847991e0290126540643a00911c4a9df135e64 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Tue, 7 May 2024 23:10:18 +0800 Subject: [PATCH 071/325] Update Libp2p Dependencies (#13960) * Update Libp2p * Update Go Sum --- deps.bzl | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps.bzl b/deps.bzl index d119c640e6d7..c1c81c0c288b 100644 --- a/deps.bzl +++ b/deps.bzl @@ -2124,8 +2124,8 @@ def prysm_deps(): name = "com_github_libp2p_go_libp2p_pubsub", build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p-pubsub", - sum = "h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA=", - version = "v0.10.0", + sum = "h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg=", + version = "v0.10.1", ) go_repository( name = "com_github_libp2p_go_libp2p_testing", diff --git a/go.mod b/go.mod index 6bcb6ea70560..3dbc26bf3a62 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( github.com/kr/pretty v0.3.1 github.com/libp2p/go-libp2p v0.33.1 github.com/libp2p/go-libp2p-mplex v0.9.0 - github.com/libp2p/go-libp2p-pubsub v0.10.0 + github.com/libp2p/go-libp2p-pubsub v0.10.1 github.com/libp2p/go-mplex v0.7.0 github.com/logrusorgru/aurora v2.0.3+incompatible github.com/manifoldco/promptui v0.7.0 diff --git a/go.sum b/go.sum index d849c60d021e..a66cdb9dd2af 100644 --- a/go.sum +++ b/go.sum @@ -641,8 +641,8 @@ github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl9 github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= github.com/libp2p/go-libp2p-mplex v0.9.0/go.mod h1:ro1i4kuwiFT+uMPbIDIFkcLs1KRbNp0QwnUXM+P64Og= -github.com/libp2p/go-libp2p-pubsub v0.10.0 h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA= -github.com/libp2p/go-libp2p-pubsub v0.10.0/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= +github.com/libp2p/go-libp2p-pubsub v0.10.1 h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg= +github.com/libp2p/go-libp2p-pubsub v0.10.1/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= From c93fea4ec4862c2d5a22ac70649bebd1f25fb6b7 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 7 May 2024 15:56:08 -0500 Subject: [PATCH 072/325] Update spectests to v1.5.0-alpha.2 (#13961) --- WORKSPACE | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index da7bd4d6f0a8..46e8e7c3c017 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-alpha.1" +consensus_spec_version = "v1.5.0-alpha.2" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-bvbgNjfVVsqt3oGjfdsxXyfn33wq1Xwv1OlrVBXEea4=", + integrity = "sha256-NNXBa7SZ2sFb68HPNahgu1p0yDBpjuKJuLfRCl7vvoQ=", 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-6yhbVIiyE0GiLci9jYRFbq1dHhLxYiS4xnw+ZLE3XQ0=", + integrity = "sha256-7BnlBvGWU92iAB100cMaAXVQhRrqpMQbavgrI+/paCw=", 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-Z3OBOudJhD1C1/1lpCu5ShiaLxq1QgXKs5ncLz537SY=", + integrity = "sha256-VCHhcNt+fynf/sHK11qbRBAy608u9T1qAafvAGfxQhA=", 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-+uaqIfJ7c2Uu+vQU5eYSzacEEWe1AixWWISycDU5ak4=", + integrity = "sha256-a2aCNFyFkYLtf6QSwGOHdx7xXHjA2NNT8x8ZuxB0aes=", strip_prefix = "consensus-specs-" + consensus_spec_version[1:], url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version, ) From ed7c4bb6a7ad3141b95cb8490ee7ce72fa901d5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 21:57:45 +0000 Subject: [PATCH 073/325] Bump golang.org/x/net from 0.21.0 to 0.23.0 (#13895) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.21.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.21.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 3dbc26bf3a62..4db79dc5448f 100644 --- a/go.mod +++ b/go.mod @@ -88,7 +88,7 @@ require ( go.opencensus.io v0.24.0 go.uber.org/automaxprocs v1.5.2 go.uber.org/mock v0.4.0 - golang.org/x/crypto v0.19.0 + golang.org/x/crypto v0.21.0 golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/mod v0.15.0 golang.org/x/sync v0.6.0 @@ -234,9 +234,9 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect - golang.org/x/net v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -257,7 +257,7 @@ require ( github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect github.com/prysmaticlabs/gohashtree v0.0.4-beta - golang.org/x/sys v0.17.0 // indirect + golang.org/x/sys v0.18.0 // indirect google.golang.org/api v0.44.0 // indirect google.golang.org/appengine v1.6.7 // indirect k8s.io/klog/v2 v2.80.0 // indirect diff --git a/go.sum b/go.sum index a66cdb9dd2af..2c529832367a 100644 --- a/go.sum +++ b/go.sum @@ -1185,8 +1185,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1282,8 +1282,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1410,13 +1410,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From e9606b3635218943360ea2e0a7e382e612d0a233 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Wed, 8 May 2024 06:21:27 +0800 Subject: [PATCH 074/325] Handle Each Blob In Its Own Goroutine (#13959) --- .../rpc/prysm/v1alpha1/validator/proposer.go | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index a86d771186e7..03509789c150 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -30,6 +30,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" "go.opencensus.io/trace" + "golang.org/x/sync/errgroup" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -368,25 +369,32 @@ func (vs *Server) broadcastReceiveBlock(ctx context.Context, block interfaces.Si // broadcastAndReceiveBlobs handles the broadcasting and reception of blob sidecars. func (vs *Server) broadcastAndReceiveBlobs(ctx context.Context, sidecars []*ethpb.BlobSidecar, root [32]byte) error { + eg, eCtx := errgroup.WithContext(ctx) for i, sc := range sidecars { - if err := vs.P2P.BroadcastBlob(ctx, uint64(i), sc); err != nil { - return errors.Wrap(err, "broadcast blob failed") - } - - readOnlySc, err := blocks.NewROBlobWithRoot(sc, root) - if err != nil { - return errors.Wrap(err, "ROBlob creation failed") - } - verifiedBlob := blocks.NewVerifiedROBlob(readOnlySc) - if err := vs.BlobReceiver.ReceiveBlob(ctx, verifiedBlob); err != nil { - return errors.Wrap(err, "receive blob failed") - } - vs.OperationNotifier.OperationFeed().Send(&feed.Event{ - Type: operation.BlobSidecarReceived, - Data: &operation.BlobSidecarReceivedData{Blob: &verifiedBlob}, + // Copy the iteration instance to a local variable to give each go-routine its own copy to play with. + // See https://golang.org/doc/faq#closures_and_goroutines for more details. + subIdx := i + sCar := sc + eg.Go(func() error { + if err := vs.P2P.BroadcastBlob(eCtx, uint64(subIdx), sCar); err != nil { + return errors.Wrap(err, "broadcast blob failed") + } + readOnlySc, err := blocks.NewROBlobWithRoot(sCar, root) + if err != nil { + return errors.Wrap(err, "ROBlob creation failed") + } + verifiedBlob := blocks.NewVerifiedROBlob(readOnlySc) + if err := vs.BlobReceiver.ReceiveBlob(ctx, verifiedBlob); err != nil { + return errors.Wrap(err, "receive blob failed") + } + vs.OperationNotifier.OperationFeed().Send(&feed.Event{ + Type: operation.BlobSidecarReceived, + Data: &operation.BlobSidecarReceivedData{Blob: &verifiedBlob}, + }) + return nil }) } - return nil + return eg.Wait() } // PrepareBeaconProposer caches and updates the fee recipient for the given proposer. From 2fa3694746b16caead36ba415764d5ca48814518 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 8 May 2024 10:16:31 -0500 Subject: [PATCH 075/325] Electra: upgrade (#13933) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip fork logic upgrade * fixing replay and fork.go * improving process function and adding tests for transition * updating unit tests and temporarily removing some fields on state_trie.go * updating state * wip adding upgrade to electra code * adding some comments * adding spec tests * fixing values used in state transition logic * updating upgrade test * gofmt * avoid dup word linting * fixing spec tests for fork * gaz * fixing tests * improving unit test with new getters * fixing bazel for minimal fork test * adding bazel file * Update beacon-chain/core/electra/upgrade.go Co-authored-by: Preston Van Loon * addressing some comments and adding more tests * addressing more feedback * one more feedback * changing value to interface after talking to preston * adding missed review feedback * fixing linting * noticed I was using the wrong function in the state upgrade * fixing and ignoring some deepsource issues * moving core electra validator functions to helper to remove circular dependencies in other PRs * missed deepsource complaint * Update upgrade.go Co-authored-by: Radosław Kapka * Update testing/util/electra_state.go Co-authored-by: Radosław Kapka * Update testing/util/electra_state.go Co-authored-by: Radosław Kapka * addressing feedback * removing deepsoure ignore comments --------- Co-authored-by: Preston Van Loon Co-authored-by: Radosław Kapka --- beacon-chain/core/electra/BUILD.bazel | 41 +++ beacon-chain/core/electra/upgrade.go | 312 ++++++++++++++++++ beacon-chain/core/electra/upgrade_test.go | 189 +++++++++++ beacon-chain/core/helpers/validators.go | 70 +++- beacon-chain/core/helpers/validators_test.go | 38 +++ beacon-chain/core/time/slot_epoch.go | 9 + beacon-chain/core/time/slot_epoch_test.go | 35 ++ beacon-chain/core/transition/BUILD.bazel | 1 + beacon-chain/core/transition/transition.go | 9 + .../core/transition/transition_test.go | 14 + .../rpc/eth/beacon/handlers_validator.go | 2 +- beacon-chain/rpc/eth/config/handlers_test.go | 5 +- beacon-chain/state/interfaces.go | 9 +- beacon-chain/state/state-native/BUILD.bazel | 2 + .../state/state-native/getters_exit.go | 29 ++ .../state/state-native/getters_exit_test.go | 44 +++ .../state/state-native/readonly_validator.go | 2 +- .../state-native/readonly_validator_test.go | 2 +- beacon-chain/state/stategen/BUILD.bazel | 1 + beacon-chain/state/stategen/replay.go | 18 +- beacon-chain/state/stategen/replay_test.go | 20 +- config/params/config.go | 1 + config/params/loader.go | 2 + config/params/loader_test.go | 2 + config/params/mainnet_config.go | 1 + consensus-types/interfaces/BUILD.bazel | 1 + consensus-types/interfaces/validator.go | 5 + testing/endtoend/evaluators/operations.go | 2 +- .../mainnet/electra/fork_helper/BUILD.bazel | 13 + .../fork_helper/upgrade_to_electra_test.go | 11 + .../spectest/minimal/electra/fork/BUILD.bazel | 17 + .../electra/fork/upgrade_to_electra_test.go | 11 + .../spectest/shared/electra/fork/BUILD.bazel | 22 ++ .../shared/electra/fork/upgrade_to_electra.go | 61 ++++ testing/util/BUILD.bazel | 2 + testing/util/electra_state.go | 273 +++++++++++++++ 36 files changed, 1261 insertions(+), 15 deletions(-) create mode 100644 beacon-chain/core/electra/BUILD.bazel create mode 100644 beacon-chain/core/electra/upgrade.go create mode 100644 beacon-chain/core/electra/upgrade_test.go create mode 100644 beacon-chain/state/state-native/getters_exit.go create mode 100644 beacon-chain/state/state-native/getters_exit_test.go create mode 100644 consensus-types/interfaces/validator.go create mode 100644 testing/spectest/mainnet/electra/fork_helper/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/fork_helper/upgrade_to_electra_test.go create mode 100644 testing/spectest/minimal/electra/fork/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/fork/upgrade_to_electra_test.go create mode 100644 testing/spectest/shared/electra/fork/BUILD.bazel create mode 100644 testing/spectest/shared/electra/fork/upgrade_to_electra.go create mode 100644 testing/util/electra_state.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel new file mode 100644 index 000000000000..5c7c3beb484d --- /dev/null +++ b/beacon-chain/core/electra/BUILD.bazel @@ -0,0 +1,41 @@ +load("@prysm//tools/go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["upgrade.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/time:go_default_library", + "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//config/params:go_default_library", + "//consensus-types/primitives:go_default_library", + "//encoding/bytesutil:go_default_library", + "//math:go_default_library", + "//proto/engine/v1:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//time/slots:go_default_library", + "@com_github_pkg_errors//:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["upgrade_test.go"], + deps = [ + ":go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/time:go_default_library", + "//config/params:go_default_library", + "//consensus-types/primitives:go_default_library", + "//encoding/bytesutil:go_default_library", + "//math:go_default_library", + "//proto/engine/v1:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/util:go_default_library", + "//time/slots:go_default_library", + ], +) diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go new file mode 100644 index 000000000000..3ef96449c40f --- /dev/null +++ b/beacon-chain/core/electra/upgrade.go @@ -0,0 +1,312 @@ +package electra + +import ( + "sort" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/math" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +// UpgradeToElectra updates inputs a generic state to return the version Electra state. +// def upgrade_to_electra(pre: deneb.BeaconState) -> BeaconState: +// +// epoch = deneb.get_current_epoch(pre) +// latest_execution_payload_header = ExecutionPayloadHeader( +// parent_hash=pre.latest_execution_payload_header.parent_hash, +// fee_recipient=pre.latest_execution_payload_header.fee_recipient, +// state_root=pre.latest_execution_payload_header.state_root, +// receipts_root=pre.latest_execution_payload_header.receipts_root, +// logs_bloom=pre.latest_execution_payload_header.logs_bloom, +// prev_randao=pre.latest_execution_payload_header.prev_randao, +// block_number=pre.latest_execution_payload_header.block_number, +// gas_limit=pre.latest_execution_payload_header.gas_limit, +// gas_used=pre.latest_execution_payload_header.gas_used, +// timestamp=pre.latest_execution_payload_header.timestamp, +// extra_data=pre.latest_execution_payload_header.extra_data, +// base_fee_per_gas=pre.latest_execution_payload_header.base_fee_per_gas, +// block_hash=pre.latest_execution_payload_header.block_hash, +// transactions_root=pre.latest_execution_payload_header.transactions_root, +// withdrawals_root=pre.latest_execution_payload_header.withdrawals_root, +// blob_gas_used=pre.latest_execution_payload_header.blob_gas_used, +// excess_blob_gas=pre.latest_execution_payload_header.excess_blob_gas, +// deposit_receipts_root=Root(), # [New in Electra:EIP6110] +// withdrawal_requests_root=Root(), # [New in Electra:EIP7002], +// ) +// +// exit_epochs = [v.exit_epoch for v in pre.validators if v.exit_epoch != FAR_FUTURE_EPOCH] +// if not exit_epochs: +// exit_epochs = [get_current_epoch(pre)] +// earliest_exit_epoch = max(exit_epochs) + 1 +// +// post = BeaconState( +// # Versioning +// genesis_time=pre.genesis_time, +// genesis_validators_root=pre.genesis_validators_root, +// slot=pre.slot, +// fork=Fork( +// previous_version=pre.fork.current_version, +// current_version=ELECTRA_FORK_VERSION, # [Modified in Electra:EIP6110] +// epoch=epoch, +// ), +// # History +// latest_block_header=pre.latest_block_header, +// block_roots=pre.block_roots, +// state_roots=pre.state_roots, +// historical_roots=pre.historical_roots, +// # Eth1 +// eth1_data=pre.eth1_data, +// eth1_data_votes=pre.eth1_data_votes, +// eth1_deposit_index=pre.eth1_deposit_index, +// # Registry +// validators=pre.validators, +// balances=pre.balances, +// # Randomness +// randao_mixes=pre.randao_mixes, +// # Slashings +// slashings=pre.slashings, +// # Participation +// previous_epoch_participation=pre.previous_epoch_participation, +// current_epoch_participation=pre.current_epoch_participation, +// # Finality +// justification_bits=pre.justification_bits, +// previous_justified_checkpoint=pre.previous_justified_checkpoint, +// current_justified_checkpoint=pre.current_justified_checkpoint, +// finalized_checkpoint=pre.finalized_checkpoint, +// # Inactivity +// inactivity_scores=pre.inactivity_scores, +// # Sync +// current_sync_committee=pre.current_sync_committee, +// next_sync_committee=pre.next_sync_committee, +// # Execution-layer +// latest_execution_payload_header=latest_execution_payload_header, # [Modified in Electra:EIP6110:EIP7002] +// # Withdrawals +// next_withdrawal_index=pre.next_withdrawal_index, +// next_withdrawal_validator_index=pre.next_withdrawal_validator_index, +// # Deep history valid from Capella onwards +// historical_summaries=pre.historical_summaries, +// # [New in Electra:EIP6110] +// deposit_receipts_start_index=UNSET_DEPOSIT_RECEIPTS_START_INDEX, +// # [New in Electra:EIP7251] +// deposit_balance_to_consume=0, +// exit_balance_to_consume=0, +// earliest_exit_epoch=earliest_exit_epoch, +// consolidation_balance_to_consume=0, +// earliest_consolidation_epoch=compute_activation_exit_epoch(get_current_epoch(pre)), +// pending_balance_deposits=[], +// pending_partial_withdrawals=[], +// pending_consolidations=[], +// ) +// +// post.exit_balance_to_consume = get_activation_exit_churn_limit(post) +// post.consolidation_balance_to_consume = get_consolidation_churn_limit(post) +// +// # [New in Electra:EIP7251] +// # add validators that are not yet active to pending balance deposits +// pre_activation = sorted([ +// index for index, validator in enumerate(post.validators) +// if validator.activation_epoch == FAR_FUTURE_EPOCH +// ], key=lambda index: ( +// post.validators[index].activation_eligibility_epoch, +// index +// )) +// +// for index in pre_activation: +// queue_entire_balance_and_reset_validator(post, ValidatorIndex(index)) +// +// # Ensure early adopters of compounding credentials go through the activation churn +// for index, validator in enumerate(post.validators): +// if has_compounding_withdrawal_credential(validator): +// queue_excess_active_balance(post, ValidatorIndex(index)) +// +// return post +func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) { + currentSyncCommittee, err := beaconState.CurrentSyncCommittee() + if err != nil { + return nil, err + } + nextSyncCommittee, err := beaconState.NextSyncCommittee() + if err != nil { + return nil, err + } + prevEpochParticipation, err := beaconState.PreviousEpochParticipation() + if err != nil { + return nil, err + } + currentEpochParticipation, err := beaconState.CurrentEpochParticipation() + if err != nil { + return nil, err + } + inactivityScores, err := beaconState.InactivityScores() + if err != nil { + return nil, err + } + payloadHeader, err := beaconState.LatestExecutionPayloadHeader() + if err != nil { + return nil, err + } + txRoot, err := payloadHeader.TransactionsRoot() + if err != nil { + return nil, err + } + wdRoot, err := payloadHeader.WithdrawalsRoot() + if err != nil { + return nil, err + } + wi, err := beaconState.NextWithdrawalIndex() + if err != nil { + return nil, err + } + vi, err := beaconState.NextWithdrawalValidatorIndex() + if err != nil { + return nil, err + } + summaries, err := beaconState.HistoricalSummaries() + if err != nil { + return nil, err + } + historicalRoots, err := beaconState.HistoricalRoots() + if err != nil { + return nil, err + } + excessBlobGas, err := payloadHeader.ExcessBlobGas() + if err != nil { + return nil, err + } + blobGasUsed, err := payloadHeader.BlobGasUsed() + if err != nil { + return nil, err + } + + // [New in Electra:EIP7251] + earliestExitEpoch := time.CurrentEpoch(beaconState) + preActivationIndices := make([]primitives.ValidatorIndex, 0) + compoundWithdrawalIndices := make([]primitives.ValidatorIndex, 0) + if err = beaconState.ReadFromEveryValidator(func(index int, val state.ReadOnlyValidator) error { + if val.ExitEpoch() != params.BeaconConfig().FarFutureEpoch && val.ExitEpoch() > earliestExitEpoch { + earliestExitEpoch = val.ExitEpoch() + } + if val.ActivationEpoch() == params.BeaconConfig().FarFutureEpoch { + preActivationIndices = append(preActivationIndices, primitives.ValidatorIndex(index)) + } + if helpers.HasCompoundingWithdrawalCredential(val) { + compoundWithdrawalIndices = append(compoundWithdrawalIndices, primitives.ValidatorIndex(index)) + } + return nil + }); err != nil { + return nil, err + } + + earliestExitEpoch++ // Increment to find the earliest possible exit epoch + + // note: should be the same in prestate and post beaconState. + // we are deviating from the specs a bit as it calls for using the post beaconState + tab, err := helpers.TotalActiveBalance(beaconState) + if err != nil { + return nil, errors.Wrap(err, "failed to get total active balance") + } + + s := ðpb.BeaconStateElectra{ + GenesisTime: beaconState.GenesisTime(), + GenesisValidatorsRoot: beaconState.GenesisValidatorsRoot(), + Slot: beaconState.Slot(), + Fork: ðpb.Fork{ + PreviousVersion: beaconState.Fork().CurrentVersion, + CurrentVersion: params.BeaconConfig().ElectraForkVersion, + Epoch: time.CurrentEpoch(beaconState), + }, + LatestBlockHeader: beaconState.LatestBlockHeader(), + BlockRoots: beaconState.BlockRoots(), + StateRoots: beaconState.StateRoots(), + HistoricalRoots: historicalRoots, + Eth1Data: beaconState.Eth1Data(), + Eth1DataVotes: beaconState.Eth1DataVotes(), + Eth1DepositIndex: beaconState.Eth1DepositIndex(), + Validators: beaconState.Validators(), + Balances: beaconState.Balances(), + RandaoMixes: beaconState.RandaoMixes(), + Slashings: beaconState.Slashings(), + PreviousEpochParticipation: prevEpochParticipation, + CurrentEpochParticipation: currentEpochParticipation, + JustificationBits: beaconState.JustificationBits(), + PreviousJustifiedCheckpoint: beaconState.PreviousJustifiedCheckpoint(), + CurrentJustifiedCheckpoint: beaconState.CurrentJustifiedCheckpoint(), + FinalizedCheckpoint: beaconState.FinalizedCheckpoint(), + InactivityScores: inactivityScores, + CurrentSyncCommittee: currentSyncCommittee, + NextSyncCommittee: nextSyncCommittee, + LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: payloadHeader.ParentHash(), + FeeRecipient: payloadHeader.FeeRecipient(), + StateRoot: payloadHeader.StateRoot(), + ReceiptsRoot: payloadHeader.ReceiptsRoot(), + LogsBloom: payloadHeader.LogsBloom(), + PrevRandao: payloadHeader.PrevRandao(), + BlockNumber: payloadHeader.BlockNumber(), + GasLimit: payloadHeader.GasLimit(), + GasUsed: payloadHeader.GasUsed(), + Timestamp: payloadHeader.Timestamp(), + ExtraData: payloadHeader.ExtraData(), + BaseFeePerGas: payloadHeader.BaseFeePerGas(), + BlockHash: payloadHeader.BlockHash(), + TransactionsRoot: txRoot, + WithdrawalsRoot: wdRoot, + ExcessBlobGas: excessBlobGas, + BlobGasUsed: blobGasUsed, + DepositReceiptsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP6110] + WithdrawalRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7002] + }, + NextWithdrawalIndex: wi, + NextWithdrawalValidatorIndex: vi, + HistoricalSummaries: summaries, + + DepositReceiptsStartIndex: params.BeaconConfig().UnsetDepositReceiptsStartIndex, + DepositBalanceToConsume: 0, + ExitBalanceToConsume: helpers.ActivationExitChurnLimit(math.Gwei(tab)), + EarliestExitEpoch: earliestExitEpoch, + ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(math.Gwei(tab)), + EarliestConsolidationEpoch: helpers.ActivationExitEpoch(slots.ToEpoch(beaconState.Slot())), + PendingBalanceDeposits: make([]*ethpb.PendingBalanceDeposit, 0), + PendingPartialWithdrawals: make([]*ethpb.PendingPartialWithdrawal, 0), + PendingConsolidations: make([]*ethpb.PendingConsolidation, 0), + } + + // Sorting preActivationIndices based on a custom criteria + sort.Slice(preActivationIndices, func(i, j int) bool { + // Comparing based on ActivationEligibilityEpoch and then by index if the epochs are the same + if s.Validators[preActivationIndices[i]].ActivationEligibilityEpoch == s.Validators[preActivationIndices[j]].ActivationEligibilityEpoch { + return preActivationIndices[i] < preActivationIndices[j] + } + return s.Validators[preActivationIndices[i]].ActivationEligibilityEpoch < s.Validators[preActivationIndices[j]].ActivationEligibilityEpoch + }) + + // need to cast the beaconState to use in helper functions + post, err := state_native.InitializeFromProtoUnsafeElectra(s) + if err != nil { + return nil, errors.Wrap(err, "failed to initialize post electra beaconState") + } + + for _, index := range preActivationIndices { + if err := helpers.QueueEntireBalanceAndResetValidator(post, index); err != nil { + return nil, errors.Wrap(err, "failed to queue entire balance and reset validator") + } + } + + // Ensure early adopters of compounding credentials go through the activation churn + for _, index := range compoundWithdrawalIndices { + if err := helpers.QueueExcessActiveBalance(post, index); err != nil { + return nil, errors.Wrap(err, "failed to queue excess active balance") + } + } + + return post, nil +} diff --git a/beacon-chain/core/electra/upgrade_test.go b/beacon-chain/core/electra/upgrade_test.go new file mode 100644 index 000000000000..ee180189e10a --- /dev/null +++ b/beacon-chain/core/electra/upgrade_test.go @@ -0,0 +1,189 @@ +package electra_test + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/math" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +func TestUpgradeToElectra(t *testing.T) { + st, _ := util.DeterministicGenesisStateDeneb(t, params.BeaconConfig().MaxValidatorsPerCommittee) + require.NoError(t, st.SetHistoricalRoots([][]byte{{1}})) + vals := st.Validators() + vals[0].ActivationEpoch = params.BeaconConfig().FarFutureEpoch + vals[1].WithdrawalCredentials = []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte} + require.NoError(t, st.SetValidators(vals)) + bals := st.Balances() + bals[1] = params.BeaconConfig().MinActivationBalance + 1000 + require.NoError(t, st.SetBalances(bals)) + + preForkState := st.Copy() + mSt, err := electra.UpgradeToElectra(st) + require.NoError(t, err) + + require.Equal(t, preForkState.GenesisTime(), mSt.GenesisTime()) + require.DeepSSZEqual(t, preForkState.GenesisValidatorsRoot(), mSt.GenesisValidatorsRoot()) + require.Equal(t, preForkState.Slot(), mSt.Slot()) + require.DeepSSZEqual(t, preForkState.LatestBlockHeader(), mSt.LatestBlockHeader()) + require.DeepSSZEqual(t, preForkState.BlockRoots(), mSt.BlockRoots()) + require.DeepSSZEqual(t, preForkState.StateRoots(), mSt.StateRoots()) + require.DeepSSZEqual(t, preForkState.Validators()[2:], mSt.Validators()[2:]) + require.DeepSSZEqual(t, preForkState.Balances()[2:], mSt.Balances()[2:]) + require.DeepSSZEqual(t, preForkState.Eth1Data(), mSt.Eth1Data()) + require.DeepSSZEqual(t, preForkState.Eth1DataVotes(), mSt.Eth1DataVotes()) + require.DeepSSZEqual(t, preForkState.Eth1DepositIndex(), mSt.Eth1DepositIndex()) + require.DeepSSZEqual(t, preForkState.RandaoMixes(), mSt.RandaoMixes()) + require.DeepSSZEqual(t, preForkState.Slashings(), mSt.Slashings()) + require.DeepSSZEqual(t, preForkState.JustificationBits(), mSt.JustificationBits()) + require.DeepSSZEqual(t, preForkState.PreviousJustifiedCheckpoint(), mSt.PreviousJustifiedCheckpoint()) + require.DeepSSZEqual(t, preForkState.CurrentJustifiedCheckpoint(), mSt.CurrentJustifiedCheckpoint()) + require.DeepSSZEqual(t, preForkState.FinalizedCheckpoint(), mSt.FinalizedCheckpoint()) + + require.Equal(t, len(preForkState.Validators()), len(mSt.Validators())) + + preVal, err := preForkState.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, preVal.EffectiveBalance) + + preVal2, err := preForkState.ValidatorAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, preVal2.EffectiveBalance) + + mVal, err := mSt.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(0), mVal.EffectiveBalance) + + mVal2, err := mSt.ValidatorAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, mVal2.EffectiveBalance) + + numValidators := mSt.NumValidators() + p, err := mSt.PreviousEpochParticipation() + require.NoError(t, err) + require.DeepSSZEqual(t, make([]byte, numValidators), p) + p, err = mSt.CurrentEpochParticipation() + require.NoError(t, err) + require.DeepSSZEqual(t, make([]byte, numValidators), p) + s, err := mSt.InactivityScores() + require.NoError(t, err) + require.DeepSSZEqual(t, make([]uint64, numValidators), s) + + hr1, err := preForkState.HistoricalRoots() + require.NoError(t, err) + hr2, err := mSt.HistoricalRoots() + require.NoError(t, err) + require.DeepEqual(t, hr1, hr2) + + f := mSt.Fork() + require.DeepSSZEqual(t, ðpb.Fork{ + PreviousVersion: st.Fork().CurrentVersion, + CurrentVersion: params.BeaconConfig().ElectraForkVersion, + Epoch: time.CurrentEpoch(st), + }, f) + csc, err := mSt.CurrentSyncCommittee() + require.NoError(t, err) + psc, err := preForkState.CurrentSyncCommittee() + require.NoError(t, err) + require.DeepSSZEqual(t, psc, csc) + nsc, err := mSt.NextSyncCommittee() + require.NoError(t, err) + psc, err = preForkState.NextSyncCommittee() + require.NoError(t, err) + require.DeepSSZEqual(t, psc, nsc) + + header, err := mSt.LatestExecutionPayloadHeader() + require.NoError(t, err) + protoHeader, ok := header.Proto().(*enginev1.ExecutionPayloadHeaderElectra) + require.Equal(t, true, ok) + prevHeader, err := preForkState.LatestExecutionPayloadHeader() + require.NoError(t, err) + txRoot, err := prevHeader.TransactionsRoot() + require.NoError(t, err) + + wdRoot, err := prevHeader.WithdrawalsRoot() + require.NoError(t, err) + wanted := &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: prevHeader.ParentHash(), + FeeRecipient: prevHeader.FeeRecipient(), + StateRoot: prevHeader.StateRoot(), + ReceiptsRoot: prevHeader.ReceiptsRoot(), + LogsBloom: prevHeader.LogsBloom(), + PrevRandao: prevHeader.PrevRandao(), + BlockNumber: prevHeader.BlockNumber(), + GasLimit: prevHeader.GasLimit(), + GasUsed: prevHeader.GasUsed(), + Timestamp: prevHeader.Timestamp(), + ExtraData: prevHeader.ExtraData(), + BaseFeePerGas: prevHeader.BaseFeePerGas(), + BlockHash: prevHeader.BlockHash(), + TransactionsRoot: txRoot, + WithdrawalsRoot: wdRoot, + DepositReceiptsRoot: bytesutil.Bytes32(0), + WithdrawalRequestsRoot: bytesutil.Bytes32(0), + } + require.DeepEqual(t, wanted, protoHeader) + + nwi, err := mSt.NextWithdrawalIndex() + require.NoError(t, err) + require.Equal(t, uint64(0), nwi) + + lwvi, err := mSt.NextWithdrawalValidatorIndex() + require.NoError(t, err) + require.Equal(t, primitives.ValidatorIndex(0), lwvi) + + summaries, err := mSt.HistoricalSummaries() + require.NoError(t, err) + require.Equal(t, 0, len(summaries)) + + startIndex, err := mSt.DepositReceiptsStartIndex() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().UnsetDepositReceiptsStartIndex, startIndex) + + balance, err := mSt.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(0), balance) + + tab, err := helpers.TotalActiveBalance(mSt) + require.NoError(t, err) + + ebtc, err := mSt.ExitBalanceToConsume() + require.NoError(t, err) + require.Equal(t, helpers.ActivationExitChurnLimit(math.Gwei(tab)), ebtc) + + eee, err := mSt.EarliestExitEpoch() + require.NoError(t, err) + require.Equal(t, primitives.Epoch(1), eee) + + cbtc, err := mSt.ConsolidationBalanceToConsume() + require.NoError(t, err) + require.Equal(t, helpers.ConsolidationChurnLimit(math.Gwei(tab)), cbtc) + + earliestConsolidationEpoch, err := mSt.EarliestConsolidationEpoch() + require.NoError(t, err) + require.Equal(t, helpers.ActivationExitEpoch(slots.ToEpoch(preForkState.Slot())), earliestConsolidationEpoch) + + pendingBalanceDeposits, err := mSt.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 2, len(pendingBalanceDeposits)) + require.Equal(t, uint64(1000), pendingBalanceDeposits[1].Amount) + + numPendingPartialWithdrawals, err := mSt.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, uint64(0), numPendingPartialWithdrawals) + + consolidations, err := mSt.PendingConsolidations() + require.NoError(t, err) + require.Equal(t, 0, len(consolidations)) + +} diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index 2614c7d17ac0..62a21cce642c 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -12,6 +12,7 @@ import ( forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -520,11 +521,11 @@ func isETH1WithdrawalCredential(creds []byte) bool { // Check if ``validator`` has an 0x02 prefixed "compounding" withdrawal credential. // """ // return is_compounding_withdrawal_credential(validator.withdrawal_credentials) -func HasCompoundingWithdrawalCredential(v *ethpb.Validator) bool { +func HasCompoundingWithdrawalCredential(v interfaces.WithWithdrawalCredentials) bool { if v == nil { return false } - return isCompoundingWithdrawalCredential(v.WithdrawalCredentials) + return isCompoundingWithdrawalCredential(v.GetWithdrawalCredentials()) } // isCompoundingWithdrawalCredential checks if the credentials are a compounding withdrawal credential. @@ -673,3 +674,68 @@ func ValidatorMaxEffectiveBalance(val *ethpb.Validator) uint64 { } return params.BeaconConfig().MinActivationBalance } + +// QueueExcessActiveBalance queues validators with balances above the min activation balance and adds to pending balance deposit. +// +// Spec definition: +// +// def queue_excess_active_balance(state: BeaconState, index: ValidatorIndex) -> None: +// balance = state.balances[index] +// if balance > MIN_ACTIVATION_BALANCE: +// excess_balance = balance - MIN_ACTIVATION_BALANCE +// state.balances[index] = MIN_ACTIVATION_BALANCE +// state.pending_balance_deposits.append( +// PendingBalanceDeposit(index=index, amount=excess_balance) +// ) +func QueueExcessActiveBalance(s state.BeaconState, idx primitives.ValidatorIndex) error { + bal, err := s.BalanceAtIndex(idx) + if err != nil { + return err + } + + if bal > params.BeaconConfig().MinActivationBalance { + excessBalance := bal - params.BeaconConfig().MinActivationBalance + if err := s.UpdateBalancesAtIndex(idx, params.BeaconConfig().MinActivationBalance); err != nil { + return err + } + return s.AppendPendingBalanceDeposit(idx, excessBalance) + } + return nil +} + +// QueueEntireBalanceAndResetValidator queues the entire balance and resets the validator. This is used in electra fork logic. +// +// Spec definition: +// +// def queue_entire_balance_and_reset_validator(state: BeaconState, index: ValidatorIndex) -> None: +// balance = state.balances[index] +// validator = state.validators[index] +// state.balances[index] = 0 +// validator.effective_balance = 0 +// validator.activation_eligibility_epoch = FAR_FUTURE_EPOCH +// state.pending_balance_deposits.append( +// PendingBalanceDeposit(index=index, amount=balance) +// ) +func QueueEntireBalanceAndResetValidator(s state.BeaconState, idx primitives.ValidatorIndex) error { + bal, err := s.BalanceAtIndex(idx) + if err != nil { + return err + } + + if err := s.UpdateBalancesAtIndex(idx, 0); err != nil { + return err + } + + v, err := s.ValidatorAtIndex(idx) + if err != nil { + return err + } + + v.EffectiveBalance = 0 + v.ActivationEligibilityEpoch = params.BeaconConfig().FarFutureEpoch + if err := s.UpdateValidatorAtIndex(idx, v); err != nil { + return err + } + + return s.AppendPendingBalanceDeposit(idx, bal) +} diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index efa21c75cb63..43e0416eca58 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -18,6 +18,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestIsActiveValidator_OK(t *testing.T) { @@ -1119,3 +1120,40 @@ func TestValidatorMaxEffectiveBalance(t *testing.T) { // Sanity check that MinActivationBalance equals (pre-electra) MaxEffectiveBalance assert.Equal(t, params.BeaconConfig().MinActivationBalance, params.BeaconConfig().MaxEffectiveBalance) } + +func TestQueueExcessActiveBalance_Ok(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) + bals := st.Balances() + bals[0] = params.BeaconConfig().MinActivationBalance + 1000 + require.NoError(t, st.SetBalances(bals)) + + err := helpers.QueueExcessActiveBalance(st, 0) + require.NoError(t, err) + + pbd, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, uint64(1000), pbd[0].Amount) + + bals = st.Balances() + require.Equal(t, params.BeaconConfig().MinActivationBalance, bals[0]) +} + +func TestQueueEntireBalanceAndResetValidator_Ok(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) + val, err := st.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, val.EffectiveBalance) + pbd, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(pbd)) + err = helpers.QueueEntireBalanceAndResetValidator(st, 0) + require.NoError(t, err) + + pbd, err = st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbd)) + + val, err = st.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(0), val.EffectiveBalance) +} diff --git a/beacon-chain/core/time/slot_epoch.go b/beacon-chain/core/time/slot_epoch.go index e833284fd493..9ffa1561a3bf 100644 --- a/beacon-chain/core/time/slot_epoch.go +++ b/beacon-chain/core/time/slot_epoch.go @@ -90,6 +90,15 @@ func CanUpgradeToDeneb(slot primitives.Slot) bool { return epochStart && DenebEpoch } +// CanUpgradeToElectra returns true if the input `slot` can upgrade to Electra. +// Spec code: +// If state.slot % SLOTS_PER_EPOCH == 0 and compute_epoch_at_slot(state.slot) == ELECTRA_FORK_EPOCH +func CanUpgradeToElectra(slot primitives.Slot) bool { + epochStart := slots.IsEpochStart(slot) + electraEpoch := slots.ToEpoch(slot) == params.BeaconConfig().ElectraForkEpoch + return epochStart && electraEpoch +} + // CanProcessEpoch checks the eligibility to process epoch. // The epoch can be processed at the end of the last slot of every epoch. // diff --git a/beacon-chain/core/time/slot_epoch_test.go b/beacon-chain/core/time/slot_epoch_test.go index 7e6ce9a46248..69fd32603267 100644 --- a/beacon-chain/core/time/slot_epoch_test.go +++ b/beacon-chain/core/time/slot_epoch_test.go @@ -333,3 +333,38 @@ func TestCanUpgradeToDeneb(t *testing.T) { }) } } + +func TestCanUpgradeToElectra(t *testing.T) { + params.SetupTestConfigCleanup(t) + bc := params.BeaconConfig() + bc.ElectraForkEpoch = 5 + params.OverrideBeaconConfig(bc) + tests := []struct { + name string + slot primitives.Slot + want bool + }{ + { + name: "not epoch start", + slot: 1, + want: false, + }, + { + name: "not electra epoch", + slot: params.BeaconConfig().SlotsPerEpoch, + want: false, + }, + { + name: "electra epoch", + slot: primitives.Slot(params.BeaconConfig().ElectraForkEpoch) * params.BeaconConfig().SlotsPerEpoch, + want: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := time.CanUpgradeToElectra(tt.slot); got != tt.want { + t.Errorf("CanUpgradeToElectra() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/beacon-chain/core/transition/BUILD.bazel b/beacon-chain/core/transition/BUILD.bazel index 5aa1cbcc1ef0..9f2ea105cb2e 100644 --- a/beacon-chain/core/transition/BUILD.bazel +++ b/beacon-chain/core/transition/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/capella:go_default_library", "//beacon-chain/core/deneb:go_default_library", + "//beacon-chain/core/electra:go_default_library", "//beacon-chain/core/epoch:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/execution:go_default_library", diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index 963883183749..253cf2ad941d 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/capella" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/deneb" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" e "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/execution" @@ -320,6 +321,14 @@ func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconSta return nil, err } } + + if time.CanUpgradeToElectra(state.Slot()) { + state, err = electra.UpgradeToElectra(state) + if err != nil { + tracing.AnnotateError(span, err) + return nil, err + } + } return state, nil } diff --git a/beacon-chain/core/transition/transition_test.go b/beacon-chain/core/transition/transition_test.go index 2a5bc346dcc1..9000afeee603 100644 --- a/beacon-chain/core/transition/transition_test.go +++ b/beacon-chain/core/transition/transition_test.go @@ -651,6 +651,20 @@ func TestProcessSlots_ThroughDenebEpoch(t *testing.T) { require.Equal(t, params.BeaconConfig().SlotsPerEpoch*10, st.Slot()) } +func TestProcessSlots_ThroughElectraEpoch(t *testing.T) { + transition.SkipSlotCache.Disable() + params.SetupTestConfigCleanup(t) + conf := params.BeaconConfig() + conf.ElectraForkEpoch = 5 + params.OverrideBeaconConfig(conf) + + st, _ := util.DeterministicGenesisStateDeneb(t, params.BeaconConfig().MaxValidatorsPerCommittee) + st, err := transition.ProcessSlots(context.Background(), st, params.BeaconConfig().SlotsPerEpoch*10) + require.NoError(t, err) + require.Equal(t, version.Electra, st.Version()) + require.Equal(t, params.BeaconConfig().SlotsPerEpoch*10, st.Slot()) +} + func TestProcessSlotsUsingNextSlotCache(t *testing.T) { s, _ := util.DeterministicGenesisState(t, 1) r := []byte{'a'} diff --git a/beacon-chain/rpc/eth/beacon/handlers_validator.go b/beacon-chain/rpc/eth/beacon/handlers_validator.go index bc79f890cc2a..706e55a59b2e 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_validator.go +++ b/beacon-chain/rpc/eth/beacon/handlers_validator.go @@ -404,7 +404,7 @@ func valContainerFromReadOnlyVal( Status: valStatus.String(), Validator: &structs.Validator{ Pubkey: hexutil.Encode(pubkey[:]), - WithdrawalCredentials: hexutil.Encode(val.WithdrawalCredentials()), + WithdrawalCredentials: hexutil.Encode(val.GetWithdrawalCredentials()), EffectiveBalance: strconv.FormatUint(val.EffectiveBalance(), 10), Slashed: val.Slashed(), ActivationEligibilityEpoch: strconv.FormatUint(uint64(val.ActivationEligibilityEpoch()), 10), diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index c2f123d4b9f8..384e1d53c950 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -149,6 +149,7 @@ func TestGetSpec(t *testing.T) { config.MaxAttestationsElectra = 89 config.MaxWithdrawalRequestsPerPayload = 90 config.MaxCellsInExtendedMatrix = 91 + config.UnsetDepositReceiptsStartIndex = 92 var dbp [4]byte copy(dbp[:], []byte{'0', '0', '0', '1'}) @@ -191,7 +192,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 153, len(data)) + assert.Equal(t, 154, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -524,6 +525,8 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "90", v) case "MAX_CELLS_IN_EXTENDED_MATRIX": assert.Equal(t, "91", v) + case "UNSET_DEPOSIT_RECEIPTS_START_INDEX": + assert.Equal(t, "92", v) default: t.Errorf("Incorrect key: %s", k) } diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 8dc8876f2b96..2b32602cad14 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -49,6 +49,7 @@ type ReadOnlyBeaconState interface { ReadOnlyStateRoots ReadOnlyRandaoMixes ReadOnlyEth1Data + ReadOnlyExits ReadOnlyValidators ReadOnlyBalances ReadOnlyCheckpoint @@ -115,7 +116,7 @@ type ReadOnlyValidator interface { WithdrawableEpoch() primitives.Epoch ExitEpoch() primitives.Epoch PublicKey() [fieldparams.BLSPubkeyLength]byte - WithdrawalCredentials() []byte + GetWithdrawalCredentials() []byte Slashed() bool IsNil() bool } @@ -179,6 +180,12 @@ type ReadOnlyEth1Data interface { Eth1DepositIndex() uint64 } +// ReadOnlyExits defines a struct which only has read access to Exit related methods. +type ReadOnlyExits interface { + ExitBalanceToConsume() (math.Gwei, error) + EarliestExitEpoch() (primitives.Epoch, error) +} + // ReadOnlyAttestations defines a struct which only has read access to attestations methods. type ReadOnlyAttestations interface { PreviousEpochAttestations() ([]*ethpb.PendingAttestation, error) diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 1d16f099eee1..3f8760c2a411 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "getters_consolidation.go", "getters_deposit_receipts.go", "getters_eth1.go", + "getters_exit.go", "getters_misc.go", "getters_participation.go", "getters_payload_header.go", @@ -94,6 +95,7 @@ go_test( "getters_checkpoint_test.go", "getters_consolidation_test.go", "getters_deposit_receipts_test.go", + "getters_exit_test.go", "getters_participation_test.go", "getters_test.go", "getters_validator_test.go", diff --git a/beacon-chain/state/state-native/getters_exit.go b/beacon-chain/state/state-native/getters_exit.go new file mode 100644 index 000000000000..12be6844e05c --- /dev/null +++ b/beacon-chain/state/state-native/getters_exit.go @@ -0,0 +1,29 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// ExitBalanceToConsume is used for returning the ExitBalanceToConsume as part of eip 7251 +func (b *BeaconState) ExitBalanceToConsume() (math.Gwei, error) { + if b.version < version.Electra { + return 0, errNotSupported("ExitBalanceToConsume", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + + return b.exitBalanceToConsume, nil +} + +// EarliestExitEpoch is used for returning the EarliestExitEpoch as part of eip 7251 +func (b *BeaconState) EarliestExitEpoch() (primitives.Epoch, error) { + if b.version < version.Electra { + return 0, errNotSupported("EarliestExitEpoch", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + + return b.earliestExitEpoch, nil +} diff --git a/beacon-chain/state/state-native/getters_exit_test.go b/beacon-chain/state/state-native/getters_exit_test.go new file mode 100644 index 000000000000..1e3287cd191d --- /dev/null +++ b/beacon-chain/state/state-native/getters_exit_test.go @@ -0,0 +1,44 @@ +package state_native_test + +import ( + "testing" + + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestExitBalanceToConsume(t *testing.T) { + t.Run("previous fork returns expected error", func(t *testing.T) { + dState, _ := util.DeterministicGenesisState(t, 1) + _, err := dState.ExitBalanceToConsume() + require.ErrorContains(t, "is not supported", err) + }) + t.Run("electra returns expected value", func(t *testing.T) { + want := math.Gwei(2) + dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ExitBalanceToConsume: want}) + require.NoError(t, err) + got, err := dState.ExitBalanceToConsume() + require.NoError(t, err) + require.Equal(t, want, got) + }) +} + +func TestEarliestExitEpoch(t *testing.T) { + t.Run("previous fork returns expected error", func(t *testing.T) { + dState, _ := util.DeterministicGenesisState(t, 1) + _, err := dState.EarliestExitEpoch() + require.ErrorContains(t, "is not supported", err) + }) + t.Run("electra returns expected value", func(t *testing.T) { + want := primitives.Epoch(2) + dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{EarliestExitEpoch: want}) + require.NoError(t, err) + got, err := dState.EarliestExitEpoch() + require.NoError(t, err) + require.Equal(t, want, got) + }) +} diff --git a/beacon-chain/state/state-native/readonly_validator.go b/beacon-chain/state/state-native/readonly_validator.go index 6eb2d923d76a..f5029049eda9 100644 --- a/beacon-chain/state/state-native/readonly_validator.go +++ b/beacon-chain/state/state-native/readonly_validator.go @@ -77,7 +77,7 @@ func (v readOnlyValidator) publicKeySlice() []byte { // WithdrawalCredentials returns the withdrawal credentials of the // read only validator. -func (v readOnlyValidator) WithdrawalCredentials() []byte { +func (v readOnlyValidator) GetWithdrawalCredentials() []byte { creds := make([]byte, len(v.validator.WithdrawalCredentials)) copy(creds, v.validator.WithdrawalCredentials) return creds diff --git a/beacon-chain/state/state-native/readonly_validator_test.go b/beacon-chain/state/state-native/readonly_validator_test.go index 91f0c284f206..6a5f27bcba84 100644 --- a/beacon-chain/state/state-native/readonly_validator_test.go +++ b/beacon-chain/state/state-native/readonly_validator_test.go @@ -63,7 +63,7 @@ func TestReadOnlyValidator_WithdrawalCredentials(t *testing.T) { creds := []byte{0xFA, 0xCC} v, err := statenative.NewValidator(ðpb.Validator{WithdrawalCredentials: creds}) require.NoError(t, err) - assert.DeepEqual(t, creds, v.WithdrawalCredentials()) + assert.DeepEqual(t, creds, v.GetWithdrawalCredentials()) } func TestReadOnlyValidator_Slashed(t *testing.T) { diff --git a/beacon-chain/state/stategen/BUILD.bazel b/beacon-chain/state/stategen/BUILD.bazel index 1260c4236a9c..8f0b0b3ed514 100644 --- a/beacon-chain/state/stategen/BUILD.bazel +++ b/beacon-chain/state/stategen/BUILD.bazel @@ -23,6 +23,7 @@ go_library( "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/capella:go_default_library", "//beacon-chain/core/deneb:go_default_library", + "//beacon-chain/core/electra:go_default_library", "//beacon-chain/core/execution:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", diff --git a/beacon-chain/state/stategen/replay.go b/beacon-chain/state/stategen/replay.go index 42755a31daad..873da6ec4d4b 100644 --- a/beacon-chain/state/stategen/replay.go +++ b/beacon-chain/state/stategen/replay.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/capella" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/deneb" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/execution" prysmtime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" @@ -26,7 +27,7 @@ import ( // ReplayBlocks replays the input blocks on the input state until the target slot is reached. // // WARNING Blocks passed to the function must be in decreasing slots order. -func (_ *State) replayBlocks( +func (*State) replayBlocks( ctx context.Context, state state.BeaconState, signed []interfaces.ReadOnlySignedBeaconBlock, @@ -201,21 +202,18 @@ func ReplayProcessSlots(ctx context.Context, state state.BeaconState, slot primi return nil, errors.Wrap(err, "could not process slot") } if prysmtime.CanProcessEpoch(state) { - switch state.Version() { - case version.Phase0: + if state.Version() == version.Phase0 { state, err = transition.ProcessEpochPrecompute(ctx, state) if err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, "could not process epoch with optimizations") } - case version.Altair, version.Bellatrix, version.Capella, version.Deneb: + } else { state, err = altair.ProcessEpoch(ctx, state) if err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, "could not process epoch") } - default: - return nil, fmt.Errorf("unsupported beacon state version: %s", version.String(state.Version())) } } if err := state.SetSlot(state.Slot() + 1); err != nil { @@ -254,6 +252,14 @@ func ReplayProcessSlots(ctx context.Context, state state.BeaconState, slot primi return nil, err } } + + if prysmtime.CanUpgradeToElectra(state.Slot()) { + state, err = electra.UpgradeToElectra(state) + if err != nil { + tracing.AnnotateError(span, err) + return nil, err + } + } } return state, nil diff --git a/beacon-chain/state/stategen/replay_test.go b/beacon-chain/state/stategen/replay_test.go index 9d8f3c489647..4cbc53012330 100644 --- a/beacon-chain/state/stategen/replay_test.go +++ b/beacon-chain/state/stategen/replay_test.go @@ -140,7 +140,7 @@ func TestReplayBlocks_ThroughForkBoundary(t *testing.T) { assert.Equal(t, version.Altair, newState.Version()) } -func TestReplayBlocks_ThroughCapellaForkBoundary(t *testing.T) { +func TestReplayBlocks_ThroughFutureForkBoundaries(t *testing.T) { params.SetupTestConfigCleanup(t) bCfg := params.BeaconConfig().Copy() bCfg.AltairForkEpoch = 1 @@ -149,6 +149,10 @@ func TestReplayBlocks_ThroughCapellaForkBoundary(t *testing.T) { bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.BellatrixForkVersion)] = 2 bCfg.CapellaForkEpoch = 3 bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.CapellaForkVersion)] = 3 + bCfg.DenebForkEpoch = 4 + bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.DenebForkVersion)] = 4 + bCfg.ElectraForkEpoch = 5 + bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.ElectraForkVersion)] = 5 params.OverrideBeaconConfig(bCfg) beaconState, _ := util.DeterministicGenesisState(t, 32) @@ -177,6 +181,20 @@ func TestReplayBlocks_ThroughCapellaForkBoundary(t *testing.T) { // Verify state is version Capella. assert.Equal(t, version.Capella, newState.Version()) + + targetSlot = params.BeaconConfig().SlotsPerEpoch * 4 + newState, err = service.replayBlocks(context.Background(), newState, []interfaces.ReadOnlySignedBeaconBlock{}, targetSlot) + require.NoError(t, err) + + // Verify state is version Deneb. + assert.Equal(t, version.Deneb, newState.Version()) + + targetSlot = params.BeaconConfig().SlotsPerEpoch * 5 + newState, err = service.replayBlocks(context.Background(), newState, []interfaces.ReadOnlySignedBeaconBlock{}, targetSlot) + require.NoError(t, err) + + // Verify state is version Electra. + assert.Equal(t, version.Electra, newState.Version()) } func TestLoadBlocks_FirstBranch(t *testing.T) { diff --git a/config/params/config.go b/config/params/config.go index f0624519c9f8..6bfcaf784f8a 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -250,6 +250,7 @@ type BeaconChainConfig struct { MaxPendingPartialsPerWithdrawalsSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalsSweep is the maximum number of pending partial withdrawals to process per payload. FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit. MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload. + UnsetDepositReceiptsStartIndex uint64 `yaml:"UNSET_DEPOSIT_RECEIPTS_START_INDEX" spec:"true"` // UnsetDepositReceiptsStartIndex is used to check the start index for eip6110 // Networking Specific Parameters GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE" spec:"true"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages. diff --git a/config/params/loader.go b/config/params/loader.go index 404ece6ef4d0..6a4359064129 100644 --- a/config/params/loader.go +++ b/config/params/loader.go @@ -232,6 +232,8 @@ func ConfigToYaml(cfg *BeaconChainConfig) []byte { fmt.Sprintf("MESSAGE_DOMAIN_INVALID_SNAPPY: %#x", cfg.MessageDomainInvalidSnappy), fmt.Sprintf("MESSAGE_DOMAIN_VALID_SNAPPY: %#x", cfg.MessageDomainValidSnappy), fmt.Sprintf("MIN_EPOCHS_FOR_BLOCK_REQUESTS: %d", int(cfg.MinEpochsForBlockRequests)), + fmt.Sprintf("ELECTRA_FORK_EPOCH: %d", cfg.ElectraForkEpoch), + fmt.Sprintf("ELECTRA_FORK_VERSION: %#x", cfg.ElectraForkVersion), } yamlFile := []byte(strings.Join(lines, "\n")) diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 555682e30ded..ec11d43e80a2 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -147,12 +147,14 @@ func assertEqualConfigs(t *testing.T, name string, fields []string, expected, ac assert.Equal(t, expected.BellatrixForkEpoch, actual.BellatrixForkEpoch, "%s: BellatrixForkEpoch", name) assert.Equal(t, expected.CapellaForkEpoch, actual.CapellaForkEpoch, "%s: CapellaForkEpoch", name) assert.Equal(t, expected.DenebForkEpoch, actual.DenebForkEpoch, "%s: DenebForkEpoch", name) + assert.Equal(t, expected.ElectraForkEpoch, actual.ElectraForkEpoch, "%s: ElectraForkEpoch", name) assert.Equal(t, expected.SqrRootSlotsPerEpoch, actual.SqrRootSlotsPerEpoch, "%s: SqrRootSlotsPerEpoch", name) assert.DeepEqual(t, expected.GenesisForkVersion, actual.GenesisForkVersion, "%s: GenesisForkVersion", name) assert.DeepEqual(t, expected.AltairForkVersion, actual.AltairForkVersion, "%s: AltairForkVersion", name) assert.DeepEqual(t, expected.BellatrixForkVersion, actual.BellatrixForkVersion, "%s: BellatrixForkVersion", name) assert.DeepEqual(t, expected.CapellaForkVersion, actual.CapellaForkVersion, "%s: CapellaForkVersion", name) assert.DeepEqual(t, expected.DenebForkVersion, actual.DenebForkVersion, "%s: DenebForkVersion", name) + assert.DeepEqual(t, expected.ElectraForkVersion, actual.ElectraForkVersion, "%s: ElectraForkVersion", name) assertYamlFieldsMatch(t, name, fields, expected, actual) } diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index ab18df129de7..a9b5de56fd69 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -290,6 +290,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxPendingPartialsPerWithdrawalsSweep: 8, FullExitRequestAmount: 0, MaxWithdrawalRequestsPerPayload: 16, + UnsetDepositReceiptsStartIndex: math.MaxUint64, // Values related to networking parameters. GossipMaxSize: 10 * 1 << 20, // 10 MiB diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index 6dbc9a37a043..84e8be9f0d4b 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -7,6 +7,7 @@ go_library( "cast.go", "error.go", "utils.go", + "validator.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces", visibility = ["//visibility:public"], diff --git a/consensus-types/interfaces/validator.go b/consensus-types/interfaces/validator.go new file mode 100644 index 000000000000..2d7e1fa99f80 --- /dev/null +++ b/consensus-types/interfaces/validator.go @@ -0,0 +1,5 @@ +package interfaces + +type WithWithdrawalCredentials interface { + GetWithdrawalCredentials() []byte +} diff --git a/testing/endtoend/evaluators/operations.go b/testing/endtoend/evaluators/operations.go index 2dd93a3c285b..b683f8c863b3 100644 --- a/testing/endtoend/evaluators/operations.go +++ b/testing/endtoend/evaluators/operations.go @@ -365,7 +365,7 @@ func proposeVoluntaryExit(ec *e2etypes.EvaluationContext, conns ...*grpc.ClientC } var execIndices []int err = st.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error { - if val.WithdrawalCredentials()[0] == params.BeaconConfig().ETH1AddressWithdrawalPrefixByte { + if val.GetWithdrawalCredentials()[0] == params.BeaconConfig().ETH1AddressWithdrawalPrefixByte { execIndices = append(execIndices, idx) } return nil diff --git a/testing/spectest/mainnet/electra/fork_helper/BUILD.bazel b/testing/spectest/mainnet/electra/fork_helper/BUILD.bazel new file mode 100644 index 000000000000..087e6d9792a5 --- /dev/null +++ b/testing/spectest/mainnet/electra/fork_helper/BUILD.bazel @@ -0,0 +1,13 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["upgrade_to_electra_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + shard_count = 4, + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/fork:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/fork_helper/upgrade_to_electra_test.go b/testing/spectest/mainnet/electra/fork_helper/upgrade_to_electra_test.go new file mode 100644 index 000000000000..d46ddc3acd8e --- /dev/null +++ b/testing/spectest/mainnet/electra/fork_helper/upgrade_to_electra_test.go @@ -0,0 +1,11 @@ +package fork_helper + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/fork" +) + +func TestMainnet_UpgradeToElectra(t *testing.T) { + fork.RunUpgradeToElectra(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/fork/BUILD.bazel b/testing/spectest/minimal/electra/fork/BUILD.bazel new file mode 100644 index 000000000000..5094ddda3586 --- /dev/null +++ b/testing/spectest/minimal/electra/fork/BUILD.bazel @@ -0,0 +1,17 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["upgrade_to_electra_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + shard_count = 4, + tags = [ + "minimal", + "spectest", + ], + deps = ["//testing/spectest/shared/electra/fork:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/fork/upgrade_to_electra_test.go b/testing/spectest/minimal/electra/fork/upgrade_to_electra_test.go new file mode 100644 index 000000000000..de6570fa2ff5 --- /dev/null +++ b/testing/spectest/minimal/electra/fork/upgrade_to_electra_test.go @@ -0,0 +1,11 @@ +package fork + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/fork" +) + +func TestMinimal_UpgradeToElectra(t *testing.T) { + fork.RunUpgradeToElectra(t, "minimal") +} diff --git a/testing/spectest/shared/electra/fork/BUILD.bazel b/testing/spectest/shared/electra/fork/BUILD.bazel new file mode 100644 index 000000000000..25a3a1959e83 --- /dev/null +++ b/testing/spectest/shared/electra/fork/BUILD.bazel @@ -0,0 +1,22 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["upgrade_to_electra.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/fork", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/core/electra:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/fork/upgrade_to_electra.go b/testing/spectest/shared/electra/fork/upgrade_to_electra.go new file mode 100644 index 000000000000..b35e1c59dc90 --- /dev/null +++ b/testing/spectest/shared/electra/fork/upgrade_to_electra.go @@ -0,0 +1,61 @@ +package fork + +import ( + "path" + "testing" + + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +// RunUpgradeToElectra is a helper function that runs Electra's fork spec tests. +// It unmarshals a pre- and post-state to check `UpgradeToDeneb` comply with spec implementation. +func RunUpgradeToElectra(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "fork/fork/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + folderPath := path.Join(testsFolderPath, folder.Name()) + + preStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) + require.NoError(t, err) + preStateSSZ, err := snappy.Decode(nil /* dst */, preStateFile) + require.NoError(t, err, "Failed to decompress") + preStateBase := ðpb.BeaconStateDeneb{} + if err := preStateBase.UnmarshalSSZ(preStateSSZ); err != nil { + t.Fatalf("Failed to unmarshal: %v", err) + } + preState, err := state_native.InitializeFromProtoDeneb(preStateBase) + require.NoError(t, err) + postState, err := electra.UpgradeToElectra(preState) + require.NoError(t, err) + postStateFromFunction, err := state_native.ProtobufBeaconStateElectra(postState.ToProtoUnsafe()) + require.NoError(t, err) + + postStateFile, err := util.BazelFileBytes(path.Join(folderPath, "post.ssz_snappy")) + require.NoError(t, err) + postStateSSZ, err := snappy.Decode(nil /* dst */, postStateFile) + require.NoError(t, err, "Failed to decompress") + postStateFromFile := ðpb.BeaconStateElectra{} + if err := postStateFromFile.UnmarshalSSZ(postStateSSZ); err != nil { + t.Fatalf("Failed to unmarshal: %v", err) + } + + if !proto.Equal(postStateFromFile, postStateFromFunction) { + t.Log(cmp.Diff(postStateFromFile, postStateFromFunction, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } + }) + } +} diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index 7871191c5ad3..921d39161c9d 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "deneb_state.go", "deposits.go", "electra.go", + "electra_state.go", "helpers.go", "merge.go", "state.go", @@ -48,6 +49,7 @@ go_library( "//crypto/hash:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", + "//math:go_default_library", "//network/forks:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go new file mode 100644 index 000000000000..c0b8ed1796fd --- /dev/null +++ b/testing/util/electra_state.go @@ -0,0 +1,273 @@ +package util + +import ( + "context" + "testing" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/math" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +// DeterministicGenesisStateElectra returns a genesis state in Electra format made using the deterministic deposits. +func DeterministicGenesisStateElectra(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey) { + deposits, privKeys, err := DeterministicDepositsAndKeys(numValidators) + if err != nil { + t.Fatal(errors.Wrapf(err, "failed to get %d deposits", numValidators)) + } + eth1Data, err := DeterministicEth1Data(len(deposits)) + if err != nil { + t.Fatal(errors.Wrapf(err, "failed to get eth1data for %d deposits", numValidators)) + } + beaconState, err := genesisBeaconStateElectra(context.Background(), deposits, uint64(0), eth1Data) + if err != nil { + t.Fatal(errors.Wrapf(err, "failed to get genesis beacon state of %d validators", numValidators)) + } + resetCache() + return beaconState, privKeys +} + +// genesisBeaconStateElectra returns the genesis beacon state. +func genesisBeaconStateElectra(ctx context.Context, deposits []*ethpb.Deposit, genesisTime uint64, eth1Data *ethpb.Eth1Data) (state.BeaconState, error) { + st, err := emptyGenesisStateElectra() + if err != nil { + return nil, err + } + + // Process initial deposits. + st, err = helpers.UpdateGenesisEth1Data(st, deposits, eth1Data) + if err != nil { + return nil, err + } + + st, err = processPreGenesisDeposits(ctx, st, deposits) + if err != nil { + return nil, errors.Wrap(err, "could not process validator deposits") + } + + return buildGenesisBeaconStateElectra(genesisTime, st, st.Eth1Data()) +} + +// emptyGenesisStateDeneb returns an empty genesis state in Electra format. +func emptyGenesisStateElectra() (state.BeaconState, error) { + st := ðpb.BeaconStateElectra{ + // Misc fields. + Slot: 0, + Fork: ðpb.Fork{ + PreviousVersion: params.BeaconConfig().BellatrixForkVersion, + CurrentVersion: params.BeaconConfig().DenebForkVersion, + Epoch: 0, + }, + // Validator registry fields. + Validators: []*ethpb.Validator{}, + Balances: []uint64{}, + InactivityScores: []uint64{}, + + JustificationBits: []byte{0}, + HistoricalRoots: [][]byte{}, + CurrentEpochParticipation: []byte{}, + PreviousEpochParticipation: []byte{}, + + // Eth1 data. + Eth1Data: ðpb.Eth1Data{}, + Eth1DataVotes: []*ethpb.Eth1Data{}, + Eth1DepositIndex: 0, + + LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{}, + } + return state_native.InitializeFromProtoElectra(st) +} + +func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconState, eth1Data *ethpb.Eth1Data) (state.BeaconState, error) { + if eth1Data == nil { + return nil, errors.New("no eth1data provided for genesis state") + } + + randaoMixes := make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector) + for i := 0; i < len(randaoMixes); i++ { + h := make([]byte, 32) + copy(h, eth1Data.BlockHash) + randaoMixes[i] = h + } + + zeroHash := params.BeaconConfig().ZeroHash[:] + + activeIndexRoots := make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector) + for i := 0; i < len(activeIndexRoots); i++ { + activeIndexRoots[i] = zeroHash + } + + blockRoots := make([][]byte, params.BeaconConfig().SlotsPerHistoricalRoot) + for i := 0; i < len(blockRoots); i++ { + blockRoots[i] = zeroHash + } + + stateRoots := make([][]byte, params.BeaconConfig().SlotsPerHistoricalRoot) + for i := 0; i < len(stateRoots); i++ { + stateRoots[i] = zeroHash + } + + slashings := make([]uint64, params.BeaconConfig().EpochsPerSlashingsVector) + + genesisValidatorsRoot, err := stateutil.ValidatorRegistryRoot(preState.Validators()) + if err != nil { + return nil, errors.Wrapf(err, "could not hash tree root genesis validators %v", err) + } + + prevEpochParticipation, err := preState.PreviousEpochParticipation() + if err != nil { + return nil, err + } + currEpochParticipation, err := preState.CurrentEpochParticipation() + if err != nil { + return nil, err + } + scores, err := preState.InactivityScores() + if err != nil { + return nil, err + } + tab, err := helpers.TotalActiveBalance(preState) + if err != nil { + return nil, err + } + st := ðpb.BeaconStateElectra{ + // Misc fields. + Slot: 0, + GenesisTime: genesisTime, + GenesisValidatorsRoot: genesisValidatorsRoot[:], + + Fork: ðpb.Fork{ + PreviousVersion: params.BeaconConfig().GenesisForkVersion, + CurrentVersion: params.BeaconConfig().GenesisForkVersion, + Epoch: 0, + }, + + // Validator registry fields. + Validators: preState.Validators(), + Balances: preState.Balances(), + PreviousEpochParticipation: prevEpochParticipation, + CurrentEpochParticipation: currEpochParticipation, + InactivityScores: scores, + + // Randomness and committees. + RandaoMixes: randaoMixes, + + // Finality. + PreviousJustifiedCheckpoint: ðpb.Checkpoint{ + Epoch: 0, + Root: params.BeaconConfig().ZeroHash[:], + }, + CurrentJustifiedCheckpoint: ðpb.Checkpoint{ + Epoch: 0, + Root: params.BeaconConfig().ZeroHash[:], + }, + JustificationBits: []byte{0}, + FinalizedCheckpoint: ðpb.Checkpoint{ + Epoch: 0, + Root: params.BeaconConfig().ZeroHash[:], + }, + + HistoricalRoots: [][]byte{}, + BlockRoots: blockRoots, + StateRoots: stateRoots, + Slashings: slashings, + + // Eth1 data. + Eth1Data: eth1Data, + Eth1DataVotes: []*ethpb.Eth1Data{}, + Eth1DepositIndex: preState.Eth1DepositIndex(), + + // Electra Data + DepositReceiptsStartIndex: params.BeaconConfig().UnsetDepositReceiptsStartIndex, + ExitBalanceToConsume: helpers.ActivationExitChurnLimit(math.Gwei(tab)), + EarliestConsolidationEpoch: helpers.ActivationExitEpoch(slots.ToEpoch(preState.Slot())), + ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(math.Gwei(tab)), + PendingBalanceDeposits: make([]*ethpb.PendingBalanceDeposit, 0), + PendingPartialWithdrawals: make([]*ethpb.PendingPartialWithdrawal, 0), + PendingConsolidations: make([]*ethpb.PendingConsolidation, 0), + } + + var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte + bodyRoot, err := (ðpb.BeaconBlockBodyElectra{ + RandaoReveal: make([]byte, 96), + Eth1Data: ðpb.Eth1Data{ + DepositRoot: make([]byte, 32), + BlockHash: make([]byte, 32), + }, + Graffiti: make([]byte, 32), + SyncAggregate: ðpb.SyncAggregate{ + SyncCommitteeBits: scBits[:], + SyncCommitteeSignature: make([]byte, 96), + }, + ExecutionPayload: &enginev1.ExecutionPayloadElectra{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), + DepositReceipts: make([]*enginev1.DepositReceipt, 0), + WithdrawalRequests: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0), + }, + }).HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not hash tree root empty block body") + } + + st.LatestBlockHeader = ðpb.BeaconBlockHeader{ + ParentRoot: zeroHash, + StateRoot: zeroHash, + BodyRoot: bodyRoot[:], + } + + var pubKeys [][]byte + vals := preState.Validators() + for i := uint64(0); i < params.BeaconConfig().SyncCommitteeSize; i++ { + j := i % uint64(len(vals)) + pubKeys = append(pubKeys, vals[j].PublicKey) + } + aggregated, err := bls.AggregatePublicKeys(pubKeys) + if err != nil { + return nil, err + } + st.CurrentSyncCommittee = ðpb.SyncCommittee{ + Pubkeys: pubKeys, + AggregatePubkey: aggregated.Marshal(), + } + st.NextSyncCommittee = ðpb.SyncCommittee{ + Pubkeys: pubKeys, + AggregatePubkey: aggregated.Marshal(), + } + + st.LatestExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + DepositReceiptsRoot: make([]byte, 32), + WithdrawalRequestsRoot: make([]byte, 32), + } + + return state_native.InitializeFromProtoElectra(st) +} From 41edee9fe9f5f59677ac178dae0c1a07dc7db08c Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 9 May 2024 01:41:47 +0800 Subject: [PATCH 076/325] use time.NewTimer() to avoid possible memory leaks (#13800) Co-authored-by: Preston Van Loon --- beacon-chain/rpc/prysm/v1alpha1/validator/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go index 2f2d4aee1acd..197d76910671 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go @@ -99,10 +99,15 @@ func (vs *Server) WaitForActivation(req *ethpb.ValidatorActivationRequest, strea return status.Errorf(codes.Internal, "Could not send response over stream: %v", err) } + waitTime := time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second + timer := time.NewTimer(waitTime) + defer timer.Stop() + for { + timer.Reset(waitTime) select { // Pinging every slot for activation. - case <-time.After(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second): + case <-timer.C: activeValidatorExists, validatorStatuses, err := vs.activationStatus(stream.Context(), req.PublicKeys) if err != nil { return status.Errorf(codes.Internal, "Could not fetch validator status: %v", err) From 0869814a0eb2305bf4a440e807d0e4b45a17782e Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 9 May 2024 10:21:22 -0500 Subject: [PATCH 077/325] eip-7251: updated initiate_validator_exit with tests (#13974) eip-7251: tests for initiate_validator_exit --- beacon-chain/core/validators/BUILD.bazel | 4 + beacon-chain/core/validators/validator.go | 74 ++++++++++++------- .../core/validators/validator_test.go | 50 +++++++++++++ 3 files changed, 100 insertions(+), 28 deletions(-) diff --git a/beacon-chain/core/validators/BUILD.bazel b/beacon-chain/core/validators/BUILD.bazel index 11668f0cf999..cc009285ffb7 100644 --- a/beacon-chain/core/validators/BUILD.bazel +++ b/beacon-chain/core/validators/BUILD.bazel @@ -15,7 +15,9 @@ go_library( "//beacon-chain/state:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", ], @@ -32,9 +34,11 @@ go_test( "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", + "//time/slots:go_default_library", ], ) diff --git a/beacon-chain/core/validators/validator.go b/beacon-chain/core/validators/validator.go index e35a684236a0..ed015a77b052 100644 --- a/beacon-chain/core/validators/validator.go +++ b/beacon-chain/core/validators/validator.go @@ -13,7 +13,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -43,34 +45,26 @@ func MaxExitEpochAndChurn(s state.BeaconState) (maxExitEpoch primitives.Epoch, c // InitiateValidatorExit takes in validator index and updates // validator with correct voluntary exit parameters. +// Note: As of Electra, the exitQueueEpoch and churn parameters are unused. // // Spec pseudocode definition: // // def initiate_validator_exit(state: BeaconState, index: ValidatorIndex) -> None: -// """ -// Initiate the exit of the validator with index ``index``. -// """ -// # Return if validator already initiated exit -// validator = state.validators[index] -// if validator.exit_epoch != FAR_FUTURE_EPOCH: -// return +// """ +// Initiate the exit of the validator with index ``index``. +// """ +// # Return if validator already initiated exit +// validator = state.validators[index] +// if validator.exit_epoch != FAR_FUTURE_EPOCH: +// return // -// # Compute exit queue epoch -// exit_epochs = [v.exit_epoch for v in state.validators if v.exit_epoch != FAR_FUTURE_EPOCH] -// exit_queue_epoch = max(exit_epochs + [compute_activation_exit_epoch(get_current_epoch(state))]) -// exit_queue_churn = len([v for v in state.validators if v.exit_epoch == exit_queue_epoch]) -// if exit_queue_churn >= get_validator_churn_limit(state): -// exit_queue_epoch += Epoch(1) +// # Compute exit queue epoch [Modified in Electra:EIP7251] +// exit_queue_epoch = compute_exit_epoch_and_update_churn(state, validator.effective_balance) // -// # Set validator exit epoch and withdrawable epoch -// validator.exit_epoch = exit_queue_epoch -// validator.withdrawable_epoch = Epoch(validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY) +// # Set validator exit epoch and withdrawable epoch +// validator.exit_epoch = exit_queue_epoch +// validator.withdrawable_epoch = Epoch(validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY) func InitiateValidatorExit(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex, exitQueueEpoch primitives.Epoch, churn uint64) (state.BeaconState, primitives.Epoch, error) { - exitableEpoch := helpers.ActivationExitEpoch(time.CurrentEpoch(s)) - if exitableEpoch > exitQueueEpoch { - exitQueueEpoch = exitableEpoch - churn = 0 - } validator, err := s.ValidatorAtIndex(idx) if err != nil { return nil, 0, err @@ -78,14 +72,38 @@ func InitiateValidatorExit(ctx context.Context, s state.BeaconState, idx primiti if validator.ExitEpoch != params.BeaconConfig().FarFutureEpoch { return s, validator.ExitEpoch, ErrValidatorAlreadyExited } - activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, s, time.CurrentEpoch(s)) - if err != nil { - return nil, 0, errors.Wrap(err, "could not get active validator count") - } - currentChurn := helpers.ValidatorExitChurnLimit(activeValidatorCount) - if churn >= currentChurn { - exitQueueEpoch, err = exitQueueEpoch.SafeAdd(1) + // Compute exit queue epoch. + if s.Version() < version.Electra { + // Relevant spec code from deneb: + // + // exit_epochs = [v.exit_epoch for v in state.validators if v.exit_epoch != FAR_FUTURE_EPOCH] + // exit_queue_epoch = max(exit_epochs + [compute_activation_exit_epoch(get_current_epoch(state))]) + // exit_queue_churn = len([v for v in state.validators if v.exit_epoch == exit_queue_epoch]) + // if exit_queue_churn >= get_validator_churn_limit(state): + // exit_queue_epoch += Epoch(1) + exitableEpoch := helpers.ActivationExitEpoch(time.CurrentEpoch(s)) + if exitableEpoch > exitQueueEpoch { + exitQueueEpoch = exitableEpoch + churn = 0 + } + activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, s, time.CurrentEpoch(s)) + if err != nil { + return nil, 0, errors.Wrap(err, "could not get active validator count") + } + currentChurn := helpers.ValidatorExitChurnLimit(activeValidatorCount) + + if churn >= currentChurn { + exitQueueEpoch, err = exitQueueEpoch.SafeAdd(1) + if err != nil { + return nil, 0, err + } + } + } else { + // [Modified in Electra:EIP7251] + // exit_queue_epoch = compute_exit_epoch_and_update_churn(state, validator.effective_balance) + var err error + exitQueueEpoch, err = s.ExitEpochAndUpdateChurn(math.Gwei(validator.EffectiveBalance)) if err != nil { return nil, 0, err } diff --git a/beacon-chain/core/validators/validator_test.go b/beacon-chain/core/validators/validator_test.go index 9eb62f5bdec0..09ad957dfd26 100644 --- a/beacon-chain/core/validators/validator_test.go +++ b/beacon-chain/core/validators/validator_test.go @@ -9,10 +9,12 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/time/slots" ) func TestHasVoted_OK(t *testing.T) { @@ -113,6 +115,54 @@ func TestInitiateValidatorExit_WithdrawalOverflows(t *testing.T) { require.ErrorContains(t, "addition overflows", err) } +func TestInitiateValidatorExit_ProperExit_Electra(t *testing.T) { + exitedEpoch := primitives.Epoch(100) + idx := primitives.ValidatorIndex(3) + base := ðpb.BeaconStateElectra{ + Slot: slots.UnsafeEpochStart(exitedEpoch + 1), + Validators: []*ethpb.Validator{ + { + ExitEpoch: exitedEpoch, + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + }, + { + ExitEpoch: exitedEpoch + 1, + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + }, + { + ExitEpoch: exitedEpoch + 2, + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + }, + { + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + }, + }, + } + state, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + + // Pre-check: Exit balance to consume should be zero. + ebtc, err := state.ExitBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(0), ebtc) + + newState, epoch, err := InitiateValidatorExit(context.Background(), state, idx, 0, 0) // exitQueueEpoch and churn are not used in electra + require.NoError(t, err) + + // Expect that the exit epoch is the next available epoch with max seed lookahead. + want := helpers.ActivationExitEpoch(exitedEpoch + 1) + require.Equal(t, want, epoch) + v, err := newState.ValidatorAtIndex(idx) + require.NoError(t, err) + assert.Equal(t, want, v.ExitEpoch, "Exit epoch was not the highest") + + // Check that the exit balance to consume has been updated on the state. + ebtc, err = state.ExitBalanceToConsume() + require.NoError(t, err) + require.NotEqual(t, math.Gwei(0), ebtc, "Exit balance to consume was not updated") +} + func TestSlashValidator_OK(t *testing.T) { validatorCount := 100 registry := make([]*ethpb.Validator, 0, validatorCount) From f3dd75a2c4f4471af873c85ccfdf384e523c54f8 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 9 May 2024 15:40:54 -0500 Subject: [PATCH 078/325] eip-7251: updated slash_validator with tests (#13976) Tests for updated slash_validator --- beacon-chain/core/blocks/attester_slashing.go | 16 +--- beacon-chain/core/blocks/proposer_slashing.go | 20 ++--- beacon-chain/core/validators/BUILD.bazel | 12 ++- beacon-chain/core/validators/slashing.go | 33 ++++++++ beacon-chain/core/validators/slashing_test.go | 18 +++++ beacon-chain/core/validators/validator.go | 41 +++++++--- .../core/validators/validator_test.go | 79 ++++++++++++++++--- 7 files changed, 160 insertions(+), 59 deletions(-) create mode 100644 beacon-chain/core/validators/slashing.go create mode 100644 beacon-chain/core/validators/slashing_test.go diff --git a/beacon-chain/core/blocks/attester_slashing.go b/beacon-chain/core/blocks/attester_slashing.go index 20d2291aae22..b6392b6fcb1b 100644 --- a/beacon-chain/core/blocks/attester_slashing.go +++ b/beacon-chain/core/blocks/attester_slashing.go @@ -7,14 +7,12 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/slashings" - "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -78,19 +76,7 @@ func ProcessAttesterSlashing( return nil, err } if helpers.IsSlashableValidator(val.ActivationEpoch(), val.WithdrawableEpoch(), val.Slashed(), currentEpoch) { - cfg := params.BeaconConfig() - var slashingQuotient uint64 - switch { - case beaconState.Version() == version.Phase0: - slashingQuotient = cfg.MinSlashingPenaltyQuotient - case beaconState.Version() == version.Altair: - slashingQuotient = cfg.MinSlashingPenaltyQuotientAltair - case beaconState.Version() >= version.Bellatrix: - slashingQuotient = cfg.MinSlashingPenaltyQuotientBellatrix - default: - return nil, errors.New("unknown state version") - } - beaconState, err = slashFunc(ctx, beaconState, primitives.ValidatorIndex(validatorIndex), slashingQuotient, cfg.ProposerRewardQuotient) + beaconState, err = slashFunc(ctx, beaconState, primitives.ValidatorIndex(validatorIndex)) if err != nil { return nil, errors.Wrapf(err, "could not slash validator index %d", validatorIndex) diff --git a/beacon-chain/core/blocks/proposer_slashing.go b/beacon-chain/core/blocks/proposer_slashing.go index 72e2c15ae35e..85b3b99010bc 100644 --- a/beacon-chain/core/blocks/proposer_slashing.go +++ b/beacon-chain/core/blocks/proposer_slashing.go @@ -12,12 +12,14 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "google.golang.org/protobuf/proto" ) -type slashValidatorFunc func(ctx context.Context, st state.BeaconState, vid primitives.ValidatorIndex, penaltyQuotient, proposerRewardQuotient uint64) (state.BeaconState, error) +type slashValidatorFunc func( + ctx context.Context, + st state.BeaconState, + vid primitives.ValidatorIndex) (state.BeaconState, error) // ProcessProposerSlashings is one of the operations performed // on each processed beacon block to slash proposers based on @@ -75,19 +77,7 @@ func ProcessProposerSlashing( if err = VerifyProposerSlashing(beaconState, slashing); err != nil { return nil, errors.Wrap(err, "could not verify proposer slashing") } - cfg := params.BeaconConfig() - var slashingQuotient uint64 - switch { - case beaconState.Version() == version.Phase0: - slashingQuotient = cfg.MinSlashingPenaltyQuotient - case beaconState.Version() == version.Altair: - slashingQuotient = cfg.MinSlashingPenaltyQuotientAltair - case beaconState.Version() >= version.Bellatrix: - slashingQuotient = cfg.MinSlashingPenaltyQuotientBellatrix - default: - return nil, errors.New("unknown state version") - } - beaconState, err = slashFunc(ctx, beaconState, slashing.Header_1.Header.ProposerIndex, slashingQuotient, cfg.ProposerRewardQuotient) + beaconState, err = slashFunc(ctx, beaconState, slashing.Header_1.Header.ProposerIndex) if err != nil { return nil, errors.Wrapf(err, "could not slash proposer index %d", slashing.Header_1.Header.ProposerIndex) } diff --git a/beacon-chain/core/validators/BUILD.bazel b/beacon-chain/core/validators/BUILD.bazel index cc009285ffb7..6096f2aea509 100644 --- a/beacon-chain/core/validators/BUILD.bazel +++ b/beacon-chain/core/validators/BUILD.bazel @@ -2,7 +2,10 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["validator.go"], + srcs = [ + "slashing.go", + "validator.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators", visibility = [ "//beacon-chain:__subpackages__", @@ -26,9 +29,12 @@ go_library( go_test( name = "go_default_test", size = "small", - srcs = ["validator_test.go"], - embed = [":go_default_library"], + srcs = [ + "slashing_test.go", + "validator_test.go", + ], deps = [ + ":go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state/state-native:go_default_library", diff --git a/beacon-chain/core/validators/slashing.go b/beacon-chain/core/validators/slashing.go new file mode 100644 index 000000000000..1149ac78773a --- /dev/null +++ b/beacon-chain/core/validators/slashing.go @@ -0,0 +1,33 @@ +package validators + +import ( + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// SlashingParamsPerVersion returns the slashing parameters for the given state version. +func SlashingParamsPerVersion(v int) (slashingQuotient, proposerRewardQuotient, whistleblowerRewardQuotient uint64, err error) { + cfg := params.BeaconConfig() + switch v { + case version.Phase0: + slashingQuotient = cfg.MinSlashingPenaltyQuotient + proposerRewardQuotient = cfg.ProposerRewardQuotient + whistleblowerRewardQuotient = cfg.WhistleBlowerRewardQuotient + case version.Altair: + slashingQuotient = cfg.MinSlashingPenaltyQuotientAltair + proposerRewardQuotient = cfg.ProposerRewardQuotient + whistleblowerRewardQuotient = cfg.WhistleBlowerRewardQuotient + case version.Bellatrix, version.Capella, version.Deneb: + slashingQuotient = cfg.MinSlashingPenaltyQuotientBellatrix + proposerRewardQuotient = cfg.ProposerRewardQuotient + whistleblowerRewardQuotient = cfg.WhistleBlowerRewardQuotient + case version.Electra: + slashingQuotient = cfg.MinSlashingPenaltyQuotientElectra + proposerRewardQuotient = cfg.ProposerRewardQuotient + whistleblowerRewardQuotient = cfg.WhistleBlowerRewardQuotientElectra + default: + err = errors.New("unknown state version") + } + return +} diff --git a/beacon-chain/core/validators/slashing_test.go b/beacon-chain/core/validators/slashing_test.go new file mode 100644 index 000000000000..ee11d36d18e3 --- /dev/null +++ b/beacon-chain/core/validators/slashing_test.go @@ -0,0 +1,18 @@ +package validators_test + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +func TestSlashingParamsPerVersion_NoErrors(t *testing.T) { + for _, v := range version.All() { + _, _, _, err := validators.SlashingParamsPerVersion(v) + if err != nil { + // If this test is failing, you need to add a case for the version in slashingParamsPerVersion. + t.Errorf("Error occurred for version %d: %v", v, err) + } + } +} diff --git a/beacon-chain/core/validators/validator.go b/beacon-chain/core/validators/validator.go index ed015a77b052..c7a2f61015c1 100644 --- a/beacon-chain/core/validators/validator.go +++ b/beacon-chain/core/validators/validator.go @@ -120,7 +120,8 @@ func InitiateValidatorExit(ctx context.Context, s state.BeaconState, idx primiti } // SlashValidator slashes the malicious validator's balance and awards -// the whistleblower's balance. +// the whistleblower's balance. Note: This implementation does not handle an +// optional whistleblower index. The whistleblower index is always the proposer index. // // Spec pseudocode definition: // @@ -136,22 +137,22 @@ func InitiateValidatorExit(ctx context.Context, s state.BeaconState, idx primiti // validator.slashed = True // validator.withdrawable_epoch = max(validator.withdrawable_epoch, Epoch(epoch + EPOCHS_PER_SLASHINGS_VECTOR)) // state.slashings[epoch % EPOCHS_PER_SLASHINGS_VECTOR] += validator.effective_balance -// decrease_balance(state, slashed_index, validator.effective_balance // MIN_SLASHING_PENALTY_QUOTIENT) +// slashing_penalty = validator.effective_balance // MIN_SLASHING_PENALTY_QUOTIENT_EIP7251 # [Modified in EIP7251] +// decrease_balance(state, slashed_index, slashing_penalty) // // # Apply proposer and whistleblower rewards // proposer_index = get_beacon_proposer_index(state) // if whistleblower_index is None: // whistleblower_index = proposer_index -// whistleblower_reward = Gwei(validator.effective_balance // WHISTLEBLOWER_REWARD_QUOTIENT) -// proposer_reward = Gwei(whistleblower_reward // PROPOSER_REWARD_QUOTIENT) +// whistleblower_reward = Gwei( +// validator.effective_balance // WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA) # [Modified in EIP7251] +// proposer_reward = Gwei(whistleblower_reward * PROPOSER_WEIGHT // WEIGHT_DENOMINATOR) // increase_balance(state, proposer_index, proposer_reward) // increase_balance(state, whistleblower_index, Gwei(whistleblower_reward - proposer_reward)) func SlashValidator( ctx context.Context, s state.BeaconState, - slashedIdx primitives.ValidatorIndex, - penaltyQuotient uint64, - proposerRewardQuotient uint64) (state.BeaconState, error) { + slashedIdx primitives.ValidatorIndex) (state.BeaconState, error) { maxExitEpoch, churn := MaxExitEpochAndChurn(s) s, _, err := InitiateValidatorExit(ctx, s, slashedIdx, maxExitEpoch, churn) if err != nil && !errors.Is(err, ErrValidatorAlreadyExited) { @@ -179,7 +180,17 @@ func SlashValidator( ); err != nil { return nil, err } - if err := helpers.DecreaseBalance(s, slashedIdx, validator.EffectiveBalance/penaltyQuotient); err != nil { + + slashingQuotient, proposerRewardQuotient, whistleblowerRewardQuotient, err := SlashingParamsPerVersion(s.Version()) + if err != nil { + return nil, errors.Wrap(err, "could not get slashing parameters per version") + } + + slashingPenalty, err := math.Div64(validator.EffectiveBalance, slashingQuotient) + if err != nil { + return nil, errors.Wrap(err, "failed to compute slashing slashingPenalty") + } + if err := helpers.DecreaseBalance(s, slashedIdx, slashingPenalty); err != nil { return nil, err } @@ -188,14 +199,18 @@ func SlashValidator( return nil, errors.Wrap(err, "could not get proposer idx") } whistleBlowerIdx := proposerIdx - whistleblowerReward := validator.EffectiveBalance / params.BeaconConfig().WhistleBlowerRewardQuotient - proposerReward := whistleblowerReward / proposerRewardQuotient - err = helpers.IncreaseBalance(s, proposerIdx, proposerReward) + whistleblowerReward, err := math.Div64(validator.EffectiveBalance, whistleblowerRewardQuotient) if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed to compute whistleblowerReward") } - err = helpers.IncreaseBalance(s, whistleBlowerIdx, whistleblowerReward-proposerReward) + proposerReward, err := math.Div64(whistleblowerReward, proposerRewardQuotient) if err != nil { + return nil, errors.Wrap(err, "failed to compute proposer reward") + } + if err := helpers.IncreaseBalance(s, proposerIdx, proposerReward); err != nil { + return nil, err + } + if err := helpers.IncreaseBalance(s, whistleBlowerIdx, whistleblowerReward-proposerReward); err != nil { return nil, err } return s, nil diff --git a/beacon-chain/core/validators/validator_test.go b/beacon-chain/core/validators/validator_test.go index 09ad957dfd26..e4220f7128a9 100644 --- a/beacon-chain/core/validators/validator_test.go +++ b/beacon-chain/core/validators/validator_test.go @@ -1,4 +1,4 @@ -package validators +package validators_test import ( "context" @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -50,8 +51,8 @@ func TestInitiateValidatorExit_AlreadyExited(t *testing.T) { }} state, err := state_native.InitializeFromProtoPhase0(base) require.NoError(t, err) - newState, epoch, err := InitiateValidatorExit(context.Background(), state, 0, 199, 1) - require.ErrorIs(t, err, ErrValidatorAlreadyExited) + newState, epoch, err := validators.InitiateValidatorExit(context.Background(), state, 0, 199, 1) + require.ErrorIs(t, err, validators.ErrValidatorAlreadyExited) require.Equal(t, exitEpoch, epoch) v, err := newState.ValidatorAtIndex(0) require.NoError(t, err) @@ -69,7 +70,7 @@ func TestInitiateValidatorExit_ProperExit(t *testing.T) { }} state, err := state_native.InitializeFromProtoPhase0(base) require.NoError(t, err) - newState, epoch, err := InitiateValidatorExit(context.Background(), state, idx, exitedEpoch+2, 1) + newState, epoch, err := validators.InitiateValidatorExit(context.Background(), state, idx, exitedEpoch+2, 1) require.NoError(t, err) require.Equal(t, exitedEpoch+2, epoch) v, err := newState.ValidatorAtIndex(idx) @@ -89,7 +90,7 @@ func TestInitiateValidatorExit_ChurnOverflow(t *testing.T) { }} state, err := state_native.InitializeFromProtoPhase0(base) require.NoError(t, err) - newState, epoch, err := InitiateValidatorExit(context.Background(), state, idx, exitedEpoch+2, 4) + newState, epoch, err := validators.InitiateValidatorExit(context.Background(), state, idx, exitedEpoch+2, 4) require.NoError(t, err) require.Equal(t, exitedEpoch+3, epoch) @@ -111,7 +112,7 @@ func TestInitiateValidatorExit_WithdrawalOverflows(t *testing.T) { }} state, err := state_native.InitializeFromProtoPhase0(base) require.NoError(t, err) - _, _, err = InitiateValidatorExit(context.Background(), state, 1, params.BeaconConfig().FarFutureEpoch-1, 1) + _, _, err = validators.InitiateValidatorExit(context.Background(), state, 1, params.BeaconConfig().FarFutureEpoch-1, 1) require.ErrorContains(t, "addition overflows", err) } @@ -147,7 +148,7 @@ func TestInitiateValidatorExit_ProperExit_Electra(t *testing.T) { require.NoError(t, err) require.Equal(t, math.Gwei(0), ebtc) - newState, epoch, err := InitiateValidatorExit(context.Background(), state, idx, 0, 0) // exitQueueEpoch and churn are not used in electra + newState, epoch, err := validators.InitiateValidatorExit(context.Background(), state, idx, 0, 0) // exitQueueEpoch and churn are not used in electra require.NoError(t, err) // Expect that the exit epoch is the next available epoch with max seed lookahead. @@ -191,8 +192,7 @@ func TestSlashValidator_OK(t *testing.T) { require.NoError(t, err, "Could not get proposer") proposerBal, err := state.BalanceAtIndex(proposer) require.NoError(t, err) - cfg := params.BeaconConfig() - slashedState, err := SlashValidator(context.Background(), state, slashedIdx, cfg.MinSlashingPenaltyQuotient, cfg.ProposerRewardQuotient) + slashedState, err := validators.SlashValidator(context.Background(), state, slashedIdx) require.NoError(t, err, "Could not slash validator") require.Equal(t, true, slashedState.Version() == version.Phase0) @@ -217,6 +217,59 @@ func TestSlashValidator_OK(t *testing.T) { assert.Equal(t, maxBalance-(v.EffectiveBalance/params.BeaconConfig().MinSlashingPenaltyQuotient), bal, "Did not get expected balance for slashed validator") } +func TestSlashValidator_Electra(t *testing.T) { + validatorCount := 100 + registry := make([]*ethpb.Validator, 0, validatorCount) + balances := make([]uint64, 0, validatorCount) + for i := 0; i < validatorCount; i++ { + registry = append(registry, ðpb.Validator{ + ActivationEpoch: 0, + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + }) + balances = append(balances, params.BeaconConfig().MaxEffectiveBalance) + } + + base := ðpb.BeaconStateElectra{ + Validators: registry, + Slashings: make([]uint64, params.BeaconConfig().EpochsPerSlashingsVector), + RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), + Balances: balances, + } + state, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + + slashedIdx := primitives.ValidatorIndex(3) + + proposer, err := helpers.BeaconProposerIndex(context.Background(), state) + require.NoError(t, err, "Could not get proposer") + proposerBal, err := state.BalanceAtIndex(proposer) + require.NoError(t, err) + slashedState, err := validators.SlashValidator(context.Background(), state, slashedIdx) + require.NoError(t, err, "Could not slash validator") + require.Equal(t, true, slashedState.Version() == version.Electra) + + v, err := state.ValidatorAtIndex(slashedIdx) + require.NoError(t, err) + assert.Equal(t, true, v.Slashed, "Validator not slashed despite supposed to being slashed") + assert.Equal(t, time.CurrentEpoch(state)+params.BeaconConfig().EpochsPerSlashingsVector, v.WithdrawableEpoch, "Withdrawable epoch not the expected value") + + maxBalance := params.BeaconConfig().MaxEffectiveBalance + slashedBalance := state.Slashings()[state.Slot().Mod(uint64(params.BeaconConfig().EpochsPerSlashingsVector))] + assert.Equal(t, maxBalance, slashedBalance, "Slashed balance isn't the expected amount") + + whistleblowerReward := slashedBalance / params.BeaconConfig().WhistleBlowerRewardQuotientElectra + bal, err := state.BalanceAtIndex(proposer) + require.NoError(t, err) + // The proposer is the whistleblower. + assert.Equal(t, proposerBal+whistleblowerReward, bal, "Did not get expected balance for proposer") + bal, err = state.BalanceAtIndex(slashedIdx) + require.NoError(t, err) + v, err = state.ValidatorAtIndex(slashedIdx) + require.NoError(t, err) + assert.Equal(t, maxBalance-(v.EffectiveBalance/params.BeaconConfig().MinSlashingPenaltyQuotientElectra), bal, "Did not get expected balance for slashed validator") +} + func TestActivatedValidatorIndices(t *testing.T) { tests := []struct { state *ethpb.BeaconState @@ -269,7 +322,7 @@ func TestActivatedValidatorIndices(t *testing.T) { for _, tt := range tests { s, err := state_native.InitializeFromProtoPhase0(tt.state) require.NoError(t, err) - activatedIndices := ActivatedValidatorIndices(time.CurrentEpoch(s), tt.state.Validators) + activatedIndices := validators.ActivatedValidatorIndices(time.CurrentEpoch(s), tt.state.Validators) assert.DeepEqual(t, tt.wanted, activatedIndices) } } @@ -323,7 +376,7 @@ func TestSlashedValidatorIndices(t *testing.T) { for _, tt := range tests { s, err := state_native.InitializeFromProtoPhase0(tt.state) require.NoError(t, err) - slashedIndices := SlashedValidatorIndices(time.CurrentEpoch(s), tt.state.Validators) + slashedIndices := validators.SlashedValidatorIndices(time.CurrentEpoch(s), tt.state.Validators) assert.DeepEqual(t, tt.wanted, slashedIndices) } } @@ -385,7 +438,7 @@ func TestExitedValidatorIndices(t *testing.T) { require.NoError(t, err) activeCount, err := helpers.ActiveValidatorCount(context.Background(), s, time.PrevEpoch(s)) require.NoError(t, err) - exitedIndices, err := ExitedValidatorIndices(0, tt.state.Validators, activeCount) + exitedIndices, err := validators.ExitedValidatorIndices(0, tt.state.Validators, activeCount) require.NoError(t, err) assert.DeepEqual(t, tt.wanted, exitedIndices) } @@ -460,7 +513,7 @@ func TestValidatorMaxExitEpochAndChurn(t *testing.T) { for _, tt := range tests { s, err := state_native.InitializeFromProtoPhase0(tt.state) require.NoError(t, err) - epoch, churn := MaxExitEpochAndChurn(s) + epoch, churn := validators.MaxExitEpochAndChurn(s) require.Equal(t, tt.wantedEpoch, epoch) require.Equal(t, tt.wantedChurn, churn) } From 102128ca2e527181a38907725d87e9b89ec8f2f1 Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 9 May 2024 14:49:17 -0700 Subject: [PATCH 079/325] Add electra DB (#13975) * Add electra DB * Fix typo * Revert deep ssz change --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- beacon-chain/db/kv/blocks.go | 15 ++ beacon-chain/db/kv/blocks_test.go | 41 +++++ beacon-chain/db/kv/key.go | 14 ++ beacon-chain/db/kv/schema.go | 2 + beacon-chain/db/kv/state.go | 224 ++++++++++++++-------------- beacon-chain/db/kv/state_test.go | 121 +++++++++++++++ encoding/ssz/equality/BUILD.bazel | 1 + encoding/ssz/equality/deep_equal.go | 3 + testing/util/electra_state.go | 4 + 9 files changed, 317 insertions(+), 108 deletions(-) diff --git a/beacon-chain/db/kv/blocks.go b/beacon-chain/db/kv/blocks.go index 7cf787769e0e..466afb3f6789 100644 --- a/beacon-chain/db/kv/blocks.go +++ b/beacon-chain/db/kv/blocks.go @@ -813,6 +813,16 @@ func unmarshalBlock(_ context.Context, enc []byte) (interfaces.ReadOnlySignedBea if err := rawBlock.UnmarshalSSZ(enc[len(denebBlindKey):]); err != nil { return nil, errors.Wrap(err, "could not unmarshal blinded Deneb block") } + case hasElectraKey(enc): + rawBlock = ðpb.SignedBeaconBlockElectra{} + if err := rawBlock.UnmarshalSSZ(enc[len(electraKey):]); err != nil { + return nil, errors.Wrap(err, "could not unmarshal Electra block") + } + case hasElectraBlindKey(enc): + rawBlock = ðpb.SignedBlindedBeaconBlockElectra{} + if err := rawBlock.UnmarshalSSZ(enc[len(electraBlindKey):]); err != nil { + return nil, errors.Wrap(err, "could not unmarshal blinded Electra block") + } default: // Marshal block bytes to phase 0 beacon block. rawBlock = ðpb.SignedBeaconBlock{} @@ -842,6 +852,11 @@ func encodeBlock(blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { func keyForBlock(blk interfaces.ReadOnlySignedBeaconBlock) ([]byte, error) { switch blk.Version() { + case version.Electra: + if blk.IsBlinded() { + return electraBlindKey, nil + } + return electraKey, nil case version.Deneb: if blk.IsBlinded() { return denebBlindKey, nil diff --git a/beacon-chain/db/kv/blocks_test.go b/beacon-chain/db/kv/blocks_test.go index 03bd37dfad5a..801c175b4f30 100644 --- a/beacon-chain/db/kv/blocks_test.go +++ b/beacon-chain/db/kv/blocks_test.go @@ -125,6 +125,47 @@ var blockTests = []struct { return blocks.NewSignedBeaconBlock(b) }, }, + { + name: "electra", + newBlock: func(slot primitives.Slot, root []byte) (interfaces.ReadOnlySignedBeaconBlock, error) { + b := util.NewBeaconBlockElectra() + b.Block.Slot = slot + if root != nil { + b.Block.ParentRoot = root + b.Block.Body.Consolidations = []*ethpb.SignedConsolidation{ + { + Message: ðpb.Consolidation{ + SourceIndex: 1, + TargetIndex: 2, + Epoch: 3, + }, + Signature: make([]byte, 96), + }, + } + } + return blocks.NewSignedBeaconBlock(b) + }, + }, + { + name: "electra blind", + newBlock: func(slot primitives.Slot, root []byte) (interfaces.ReadOnlySignedBeaconBlock, error) { + b := util.NewBlindedBeaconBlockElectra() + b.Message.Slot = slot + if root != nil { + b.Message.ParentRoot = root + b.Message.Body.Consolidations = []*ethpb.SignedConsolidation{ + { + Message: ðpb.Consolidation{ + SourceIndex: 1, + TargetIndex: 2, + Epoch: 3, + }, + Signature: make([]byte, 96), + }, + } + } + return blocks.NewSignedBeaconBlock(b) + }}, } func TestStore_SaveBlock_NoDuplicates(t *testing.T) { diff --git a/beacon-chain/db/kv/key.go b/beacon-chain/db/kv/key.go index a04b86ce454c..60fa9052d3d6 100644 --- a/beacon-chain/db/kv/key.go +++ b/beacon-chain/db/kv/key.go @@ -51,3 +51,17 @@ func hasDenebBlindKey(enc []byte) bool { } return bytes.Equal(enc[:len(denebBlindKey)], denebBlindKey) } + +func hasElectraKey(enc []byte) bool { + if len(electraKey) >= len(enc) { + return false + } + return bytes.Equal(enc[:len(electraKey)], electraKey) +} + +func hasElectraBlindKey(enc []byte) bool { + if len(electraBlindKey) >= len(enc) { + return false + } + return bytes.Equal(enc[:len(electraBlindKey)], electraBlindKey) +} diff --git a/beacon-chain/db/kv/schema.go b/beacon-chain/db/kv/schema.go index 7862bcea7d7b..108849e9f652 100644 --- a/beacon-chain/db/kv/schema.go +++ b/beacon-chain/db/kv/schema.go @@ -48,6 +48,8 @@ var ( saveBlindedBeaconBlocksKey = []byte("save-blinded-beacon-blocks") denebKey = []byte("deneb") denebBlindKey = []byte("blind-deneb") + electraKey = []byte("electra") + electraBlindKey = []byte("blind-electra") // block root included in the beacon state used by weak subjectivity initial sync originCheckpointBlockRootKey = []byte("origin-checkpoint-block-root") diff --git a/beacon-chain/db/kv/state.go b/beacon-chain/db/kv/state.go index 56a4a2d31de8..05ae8b978ecf 100644 --- a/beacon-chain/db/kv/state.go +++ b/beacon-chain/db/kv/state.go @@ -229,160 +229,142 @@ func (s *Store) saveStatesEfficientInternal(ctx context.Context, tx *bolt.Tx, bl // look at issue https://github.com/prysmaticlabs/prysm/issues/9262. switch rawType := states[i].ToProtoUnsafe().(type) { case *ethpb.BeaconState: - pbState, err := getPhase0PbState(rawType) - if err != nil { - return err - } - valEntries := pbState.Validators - pbState.Validators = make([]*ethpb.Validator, 0) - encodedState, err := encode(ctx, pbState) - if err != nil { - return err - } - pbState.Validators = valEntries - if err := bucket.Put(rt[:], encodedState); err != nil { - return err - } - if err := valIdxBkt.Put(rt[:], validatorKeys[i]); err != nil { + if err := s.processPhase0(ctx, rawType, rt[:], bucket, valIdxBkt, validatorKeys[i]); err != nil { return err } case *ethpb.BeaconStateAltair: - pbState, err := getAltairPbState(rawType) - if err != nil { - return err - } - valEntries := pbState.Validators - pbState.Validators = make([]*ethpb.Validator, 0) - rawObj, err := pbState.MarshalSSZ() - if err != nil { - return err - } - encodedState := snappy.Encode(nil, append(altairKey, rawObj...)) - if err := bucket.Put(rt[:], encodedState); err != nil { - return err - } - pbState.Validators = valEntries - if err := valIdxBkt.Put(rt[:], validatorKeys[i]); err != nil { + if err := s.processAltair(ctx, rawType, rt[:], bucket, valIdxBkt, validatorKeys[i]); err != nil { return err } case *ethpb.BeaconStateBellatrix: - pbState, err := getBellatrixPbState(rawType) - if err != nil { - return err - } - valEntries := pbState.Validators - pbState.Validators = make([]*ethpb.Validator, 0) - rawObj, err := pbState.MarshalSSZ() - if err != nil { - return err - } - encodedState := snappy.Encode(nil, append(bellatrixKey, rawObj...)) - if err := bucket.Put(rt[:], encodedState); err != nil { - return err - } - pbState.Validators = valEntries - if err := valIdxBkt.Put(rt[:], validatorKeys[i]); err != nil { + if err := s.processBellatrix(ctx, rawType, rt[:], bucket, valIdxBkt, validatorKeys[i]); err != nil { return err } case *ethpb.BeaconStateCapella: - pbState, err := getCapellaPbState(rawType) - if err != nil { - return err - } - valEntries := pbState.Validators - pbState.Validators = make([]*ethpb.Validator, 0) - rawObj, err := pbState.MarshalSSZ() - if err != nil { - return err - } - encodedState := snappy.Encode(nil, append(capellaKey, rawObj...)) - if err := bucket.Put(rt[:], encodedState); err != nil { - return err - } - pbState.Validators = valEntries - if err := valIdxBkt.Put(rt[:], validatorKeys[i]); err != nil { + if err := s.processCapella(ctx, rawType, rt[:], bucket, valIdxBkt, validatorKeys[i]); err != nil { return err } case *ethpb.BeaconStateDeneb: - pbState, err := getDenebPbState(rawType) - if err != nil { - return err - } - valEntries := pbState.Validators - pbState.Validators = make([]*ethpb.Validator, 0) - rawObj, err := pbState.MarshalSSZ() - if err != nil { - return err - } - encodedState := snappy.Encode(nil, append(denebKey, rawObj...)) - if err := bucket.Put(rt[:], encodedState); err != nil { + if err := s.processDeneb(ctx, rawType, rt[:], bucket, valIdxBkt, validatorKeys[i]); err != nil { return err } - pbState.Validators = valEntries - if err := valIdxBkt.Put(rt[:], validatorKeys[i]); err != nil { + case *ethpb.BeaconStateElectra: + if err := s.processElectra(ctx, rawType, rt[:], bucket, valIdxBkt, validatorKeys[i]); err != nil { return err } default: return errors.New("invalid state type") } } - // store the validator entries separately to save space. + return s.storeValidatorEntriesSeparately(ctx, tx, validatorsEntries) } -func getPhase0PbState(rawState interface{}) (*ethpb.BeaconState, error) { - pbState, err := statenative.ProtobufBeaconStatePhase0(rawState) +func (s *Store) processPhase0(ctx context.Context, pbState *ethpb.BeaconState, rootHash []byte, bucket, valIdxBkt *bolt.Bucket, validatorKey []byte) error { + valEntries := pbState.Validators + pbState.Validators = make([]*ethpb.Validator, 0) + encodedState, err := encode(ctx, pbState) if err != nil { - return nil, err + return err + } + pbState.Validators = valEntries + if err := bucket.Put(rootHash, encodedState); err != nil { + return err } - if pbState == nil { - return nil, errors.New("nil state") + if err := valIdxBkt.Put(rootHash, validatorKey); err != nil { + return err } - return pbState, nil + return nil } -func getAltairPbState(rawState interface{}) (*ethpb.BeaconStateAltair, error) { - pbState, err := statenative.ProtobufBeaconStateAltair(rawState) +func (s *Store) processAltair(ctx context.Context, pbState *ethpb.BeaconStateAltair, rootHash []byte, bucket, valIdxBkt *bolt.Bucket, validatorKey []byte) error { + valEntries := pbState.Validators + pbState.Validators = make([]*ethpb.Validator, 0) + rawObj, err := pbState.MarshalSSZ() if err != nil { - return nil, err + return err } - if pbState == nil { - return nil, errors.New("nil state") + encodedState := snappy.Encode(nil, append(altairKey, rawObj...)) + if err := bucket.Put(rootHash, encodedState); err != nil { + return err } - return pbState, nil + pbState.Validators = valEntries + if err := valIdxBkt.Put(rootHash, validatorKey); err != nil { + return err + } + return nil } -func getBellatrixPbState(rawState interface{}) (*ethpb.BeaconStateBellatrix, error) { - pbState, err := statenative.ProtobufBeaconStateBellatrix(rawState) +func (s *Store) processBellatrix(ctx context.Context, pbState *ethpb.BeaconStateBellatrix, rootHash []byte, bucket, valIdxBkt *bolt.Bucket, validatorKey []byte) error { + valEntries := pbState.Validators + pbState.Validators = make([]*ethpb.Validator, 0) + rawObj, err := pbState.MarshalSSZ() if err != nil { - return nil, err + return err + } + encodedState := snappy.Encode(nil, append(bellatrixKey, rawObj...)) + if err := bucket.Put(rootHash, encodedState); err != nil { + return err } - if pbState == nil { - return nil, errors.New("nil state") + pbState.Validators = valEntries + if err := valIdxBkt.Put(rootHash, validatorKey); err != nil { + return err } - return pbState, nil + return nil } -func getCapellaPbState(rawState interface{}) (*ethpb.BeaconStateCapella, error) { - pbState, err := statenative.ProtobufBeaconStateCapella(rawState) +func (s *Store) processCapella(ctx context.Context, pbState *ethpb.BeaconStateCapella, rootHash []byte, bucket, valIdxBkt *bolt.Bucket, validatorKey []byte) error { + valEntries := pbState.Validators + pbState.Validators = make([]*ethpb.Validator, 0) + rawObj, err := pbState.MarshalSSZ() if err != nil { - return nil, err + return err + } + encodedState := snappy.Encode(nil, append(capellaKey, rawObj...)) + if err := bucket.Put(rootHash, encodedState); err != nil { + return err } - if pbState == nil { - return nil, errors.New("nil state") + pbState.Validators = valEntries + if err := valIdxBkt.Put(rootHash, validatorKey); err != nil { + return err } - return pbState, nil + return nil } -func getDenebPbState(rawState interface{}) (*ethpb.BeaconStateDeneb, error) { - pbState, err := statenative.ProtobufBeaconStateDeneb(rawState) +func (s *Store) processDeneb(ctx context.Context, pbState *ethpb.BeaconStateDeneb, rootHash []byte, bucket, valIdxBkt *bolt.Bucket, validatorKey []byte) error { + valEntries := pbState.Validators + pbState.Validators = make([]*ethpb.Validator, 0) + rawObj, err := pbState.MarshalSSZ() if err != nil { - return nil, err + return err + } + encodedState := snappy.Encode(nil, append(denebKey, rawObj...)) + if err := bucket.Put(rootHash, encodedState); err != nil { + return err + } + pbState.Validators = valEntries + if err := valIdxBkt.Put(rootHash, validatorKey); err != nil { + return err + } + return nil +} + +func (s *Store) processElectra(ctx context.Context, pbState *ethpb.BeaconStateElectra, rootHash []byte, bucket, valIdxBkt *bolt.Bucket, validatorKey []byte) error { + valEntries := pbState.Validators + pbState.Validators = make([]*ethpb.Validator, 0) + rawObj, err := pbState.MarshalSSZ() + if err != nil { + return err + } + encodedState := snappy.Encode(nil, append(electraKey, rawObj...)) + if err := bucket.Put(rootHash, encodedState); err != nil { + return err } - if pbState == nil { - return nil, errors.New("nil state") + pbState.Validators = valEntries + if err := valIdxBkt.Put(rootHash, validatorKey); err != nil { + return err } - return pbState, nil + return nil } func (s *Store) storeValidatorEntriesSeparately(ctx context.Context, tx *bolt.Tx, validatorsEntries map[string]*ethpb.Validator) error { @@ -534,6 +516,19 @@ func (s *Store) unmarshalState(_ context.Context, enc []byte, validatorEntries [ } switch { + case hasElectraKey(enc): + protoState := ðpb.BeaconStateElectra{} + if err := protoState.UnmarshalSSZ(enc[len(electraKey):]); 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.InitializeFromProtoUnsafeElectra(protoState) case hasDenebKey(enc): protoState := ðpb.BeaconStateDeneb{} if err := protoState.UnmarshalSSZ(enc[len(denebKey):]); err != nil { @@ -667,6 +662,19 @@ func marshalState(ctx context.Context, st state.ReadOnlyBeaconState) ([]byte, er return nil, err } return snappy.Encode(nil, append(denebKey, rawObj...)), nil + case *ethpb.BeaconStateElectra: + rState, ok := st.ToProtoUnsafe().(*ethpb.BeaconStateElectra) + if !ok { + return nil, errors.New("non valid inner state") + } + if rState == nil { + return nil, errors.New("nil state") + } + rawObj, err := rState.MarshalSSZ() + if err != nil { + return nil, err + } + return snappy.Encode(nil, append(electraKey, rawObj...)), nil default: return nil, errors.New("invalid inner state") } diff --git a/beacon-chain/db/kv/state_test.go b/beacon-chain/db/kv/state_test.go index 5f7a9d76cead..6ca53a5e23e3 100644 --- a/beacon-chain/db/kv/state_test.go +++ b/beacon-chain/db/kv/state_test.go @@ -132,6 +132,33 @@ func TestState_CanSaveRetrieve(t *testing.T) { }, rootSeed: 'D', }, + { + name: "electra", + s: func() state.BeaconState { + st, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, st.SetSlot(100)) + p, err := blocks.WrappedExecutionPayloadHeaderElectra(&enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: []byte("foo"), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + DepositReceiptsRoot: make([]byte, 32), + WithdrawalRequestsRoot: make([]byte, 32), + }, big.NewInt(0)) + require.NoError(t, err) + require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) + return st + }, + rootSeed: 'E', + }, } db := setupDB(t) @@ -1138,6 +1165,100 @@ func TestStateDeneb_CanSaveRetrieveValidatorEntries(t *testing.T) { require.NoError(t, err) } +func TestElectraState_CanSaveRetrieve(t *testing.T) { + db := setupDB(t) + + r := [32]byte{'A'} + + require.Equal(t, false, db.HasState(context.Background(), r)) + + st, _ := util.DeterministicGenesisStateElectra(t, 1) + require.NoError(t, st.SetSlot(100)) + + require.NoError(t, db.SaveState(context.Background(), st, r)) + require.Equal(t, true, db.HasState(context.Background(), r)) + + savedS, err := db.State(context.Background(), r) + require.NoError(t, err) + + assert.DeepSSZEqual(t, st.ToProtoUnsafe(), savedS.ToProtoUnsafe()) + + savedS, err = db.State(context.Background(), [32]byte{'B'}) + require.NoError(t, err) + require.Equal(t, state.ReadOnlyBeaconState(nil), savedS, "Unsaved state should've been nil") +} + +func TestElectraState_CanDelete(t *testing.T) { + db := setupDB(t) + + r := [32]byte{'A'} + + require.Equal(t, false, db.HasState(context.Background(), r)) + + st, _ := util.DeterministicGenesisStateElectra(t, 1) + require.NoError(t, st.SetSlot(100)) + + require.NoError(t, db.SaveState(context.Background(), st, r)) + require.Equal(t, true, db.HasState(context.Background(), r)) + + require.NoError(t, db.DeleteState(context.Background(), r)) + savedS, err := db.State(context.Background(), r) + require.NoError(t, err) + require.Equal(t, state.ReadOnlyBeaconState(nil), savedS, "Unsaved state should've been nil") +} + +func TestStateElectra_CanSaveRetrieveValidatorEntries(t *testing.T) { + db := setupDB(t) + + // enable historical state representation flag to test this + resetCfg := features.InitWithReset(&features.Flags{ + EnableHistoricalSpaceRepresentation: true, + }) + defer resetCfg() + + r := [32]byte{'A'} + + require.Equal(t, false, db.HasState(context.Background(), r)) + + stateValidators := validators(10) + st, _ := util.DeterministicGenesisStateElectra(t, 20) + require.NoError(t, st.SetSlot(100)) + require.NoError(t, st.SetValidators(stateValidators)) + + ctx := context.Background() + require.NoError(t, db.SaveState(ctx, st, r)) + assert.Equal(t, true, db.HasState(context.Background(), r)) + + savedS, err := db.State(context.Background(), r) + require.NoError(t, err) + + require.DeepSSZEqual(t, st.Validators(), savedS.Validators(), "saved state with validators and retrieved state are not matching") + + // check if the index of the second state is still present. + err = db.db.Update(func(tx *bolt.Tx) error { + idxBkt := tx.Bucket(blockRootValidatorHashesBucket) + data := idxBkt.Get(r[:]) + require.NotEqual(t, 0, len(data)) + return nil + }) + require.NoError(t, err) + + // check if all the validator entries are still intact in the validator entry bucket. + err = db.db.Update(func(tx *bolt.Tx) error { + valBkt := tx.Bucket(stateValidatorsBucket) + // if any of the original validator entry is not present, then fail the test. + for _, val := range stateValidators { + hash, hashErr := val.HashTreeRoot() + assert.NoError(t, hashErr) + data := valBkt.Get(hash[:]) + require.NotNil(t, data) + require.NotEqual(t, 0, len(data)) + } + return nil + }) + require.NoError(t, err) +} + func BenchmarkState_CheckStateSaveTime_1(b *testing.B) { checkStateSaveTime(b, 1) } func BenchmarkState_CheckStateSaveTime_10(b *testing.B) { checkStateSaveTime(b, 10) } diff --git a/encoding/ssz/equality/BUILD.bazel b/encoding/ssz/equality/BUILD.bazel index 4c67be0035a1..0e023a0463ed 100644 --- a/encoding/ssz/equality/BUILD.bazel +++ b/encoding/ssz/equality/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//consensus-types/primitives:go_default_library", + "//math:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/encoding/ssz/equality/deep_equal.go b/encoding/ssz/equality/deep_equal.go index 3a5db35151b0..9c52d8475a8f 100644 --- a/encoding/ssz/equality/deep_equal.go +++ b/encoding/ssz/equality/deep_equal.go @@ -5,6 +5,7 @@ import ( "unsafe" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" "google.golang.org/protobuf/proto" ) @@ -230,6 +231,8 @@ func deepValueBaseTypeEqual(v1, v2 reflect.Value) bool { return v1.Interface().(primitives.ValidatorIndex) == v2.Interface().(primitives.ValidatorIndex) case "CommitteeIndex": return v1.Interface().(primitives.CommitteeIndex) == v2.Interface().(primitives.CommitteeIndex) + case "Gwei": + return v1.Interface().(math.Gwei) == v2.Interface().(math.Gwei) } return v1.Interface().(uint64) == v2.Interface().(uint64) case reflect.Uint32: diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go index c0b8ed1796fd..9af5a78e10d9 100644 --- a/testing/util/electra_state.go +++ b/testing/util/electra_state.go @@ -83,6 +83,10 @@ func emptyGenesisStateElectra() (state.BeaconState, error) { Eth1DepositIndex: 0, LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{}, + + DepositBalanceToConsume: math.Gwei(0), + ExitBalanceToConsume: math.Gwei(0), + ConsolidationBalanceToConsume: math.Gwei(0), } return state_native.InitializeFromProtoElectra(st) } From 323dd7b22d6d57ff589299f65dfaa4a079b86e77 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 10 May 2024 09:09:09 -0500 Subject: [PATCH 080/325] Electra: (partial) spectests (#13977) * Electra epoch transition, re-exports only * Buildable electra spectests Fix minimal tests that are passing on mainnet * Skip failing tests --- beacon-chain/core/electra/BUILD.bazel | 7 +- beacon-chain/core/electra/transition.go | 23 +++ .../electra/epoch_processing/BUILD.bazel | 20 +++ .../epoch_processing/eth1_data_reset_test.go | 11 ++ .../historical_summaries_update_test.go | 11 ++ .../inactivity_updates_test.go | 11 ++ .../justification_and_finalization_test.go | 11 ++ .../participation_flag_updates_test.go | 11 ++ .../randao_mixes_reset_test.go | 11 ++ .../rewards_and_penalties_test.go | 11 ++ .../epoch_processing/slashings_reset_test.go | 11 ++ .../epoch_processing/slashings_test.go | 11 ++ .../mainnet/electra/finality/BUILD.bazel | 14 ++ .../mainnet/electra/finality/finality_test.go | 12 ++ .../electra/fork_transition/BUILD.bazel | 12 ++ .../fork_transition/transition_test.go | 12 ++ .../mainnet/electra/forkchoice/BUILD.bazel | 16 +++ .../electra/forkchoice/forkchoice_test.go | 13 ++ .../mainnet/electra/merkle_proof/BUILD.bazel | 11 ++ .../electra/merkle_proof/merkle_proof_test.go | 12 ++ .../mainnet/electra/operations/BUILD.bazel | 19 +++ .../operations/attester_slashing_test.go | 11 ++ .../electra/operations/block_header_test.go | 11 ++ .../bls_to_execution_change_test.go | 11 ++ .../operations/execution_payload_test.go | 11 ++ .../operations/proposer_slashing_test.go | 11 ++ .../electra/operations/sync_committee_test.go | 11 ++ .../electra/operations/voluntary_exit_test.go | 12 ++ .../electra/operations/withdrawals_test.go | 11 ++ .../mainnet/electra/random/BUILD.bazel | 13 ++ .../mainnet/electra/random/random_test.go | 12 ++ .../mainnet/electra/rewards/BUILD.bazel | 12 ++ .../mainnet/electra/rewards/rewards_test.go | 11 ++ .../mainnet/electra/sanity/BUILD.bazel | 16 +++ .../mainnet/electra/sanity/blocks_test.go | 12 ++ .../mainnet/electra/sanity/slots_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 21 +++ .../epoch_processing/eth1_data_reset_test.go | 11 ++ .../historical_summaries_update_test.go | 11 ++ .../inactivity_updates_test.go | 11 ++ .../justification_and_finalization_test.go | 11 ++ .../participation_flag_updates_test.go | 11 ++ .../randao_mixes_reset_test.go | 11 ++ .../rewards_and_penalties_test.go | 11 ++ .../epoch_processing/slashings_reset_test.go | 11 ++ .../epoch_processing/slashings_test.go | 11 ++ .../minimal/electra/finality/BUILD.bazel | 15 ++ .../minimal/electra/finality/finality_test.go | 12 ++ .../minimal/electra/forkchoice/BUILD.bazel | 17 +++ .../electra/forkchoice/forkchoice_test.go | 13 ++ .../minimal/electra/merkle_proof/BUILD.bazel | 12 ++ .../electra/merkle_proof/merkle_proof_test.go | 12 ++ .../minimal/electra/operations/BUILD.bazel | 20 +++ .../operations/attester_slashing_test.go | 11 ++ .../electra/operations/block_header_test.go | 11 ++ .../bls_to_execution_change_test.go | 11 ++ .../operations/execution_payload_test.go | 11 ++ .../operations/proposer_slashing_test.go | 11 ++ .../electra/operations/sync_committee_test.go | 11 ++ .../electra/operations/voluntary_exit_test.go | 12 ++ .../electra/operations/withdrawals_test.go | 11 ++ .../minimal/electra/random/BUILD.bazel | 14 ++ .../minimal/electra/random/random_test.go | 12 ++ .../minimal/electra/rewards/BUILD.bazel | 13 ++ .../minimal/electra/rewards/rewards_test.go | 11 ++ .../minimal/electra/sanity/BUILD.bazel | 17 +++ .../minimal/electra/sanity/blocks_test.go | 12 ++ .../minimal/electra/sanity/slots_test.go | 11 ++ .../shared/common/forkchoice/runner.go | 29 ++++ .../electra/epoch_processing/BUILD.bazel | 37 +++++ .../epoch_processing/eth1_data_reset.go | 30 ++++ .../electra/epoch_processing/helpers.go | 78 ++++++++++ .../historical_summaries_update.go | 30 ++++ .../epoch_processing/inactivity_updates.go | 41 ++++++ .../justification_and_finalization.go | 44 ++++++ .../participation_flag_updates.go | 30 ++++ .../epoch_processing/randao_mixes_reset.go | 30 ++++ .../epoch_processing/rewards_and_penalties.go | 41 ++++++ .../electra/epoch_processing/slashings.go | 33 +++++ .../epoch_processing/slashings_reset.go | 30 ++++ .../shared/electra/finality/BUILD.bazel | 24 ++++ .../shared/electra/finality/finality.go | 86 +++++++++++ .../spectest/shared/electra/fork/BUILD.bazel | 9 +- .../shared/electra/fork/transition.go | 125 ++++++++++++++++ .../shared/electra/fork/upgrade_to_electra.go | 2 +- .../shared/electra/merkle_proof/BUILD.bazel | 13 ++ .../electra/merkle_proof/merkle_proof.go | 12 ++ .../shared/electra/operations/BUILD.bazel | 43 ++++++ .../electra/operations/attester_slashing.go | 38 +++++ .../shared/electra/operations/block_header.go | 86 +++++++++++ .../operations/bls_to_execution_changes.go | 62 ++++++++ .../electra/operations/deposit_receipt.go | 3 + .../execution_layer_withdrawal_request.go | 3 + .../electra/operations/execution_payload.go | 106 ++++++++++++++ .../shared/electra/operations/helpers.go | 88 ++++++++++++ .../electra/operations/proposer_slashing.go | 38 +++++ .../electra/operations/sync_committee.go | 41 ++++++ .../electra/operations/voluntary_exit.go | 37 +++++ .../shared/electra/operations/withdrawals.go | 50 +++++++ .../shared/electra/rewards/BUILD.bazel | 19 +++ .../electra/rewards/rewards_penalties.go | 134 ++++++++++++++++++ .../shared/electra/sanity/BUILD.bazel | 29 ++++ .../shared/electra/sanity/block_processing.go | 113 +++++++++++++++ .../electra/sanity/block_processing.yaml.go | 6 + .../shared/electra/sanity/slot_processing.go | 61 ++++++++ testing/util/merge.go | 1 + 106 files changed, 2525 insertions(+), 3 deletions(-) create mode 100644 beacon-chain/core/electra/transition.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/epoch_processing/eth1_data_reset_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/historical_summaries_update_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/inactivity_updates_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/justification_and_finalization_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/participation_flag_updates_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/randao_mixes_reset_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/rewards_and_penalties_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/slashings_reset_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/slashings_test.go create mode 100644 testing/spectest/mainnet/electra/finality/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/finality/finality_test.go create mode 100644 testing/spectest/mainnet/electra/fork_transition/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/fork_transition/transition_test.go create mode 100644 testing/spectest/mainnet/electra/forkchoice/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go create mode 100644 testing/spectest/mainnet/electra/merkle_proof/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/merkle_proof/merkle_proof_test.go create mode 100644 testing/spectest/mainnet/electra/operations/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/operations/attester_slashing_test.go create mode 100644 testing/spectest/mainnet/electra/operations/block_header_test.go create mode 100644 testing/spectest/mainnet/electra/operations/bls_to_execution_change_test.go create mode 100644 testing/spectest/mainnet/electra/operations/execution_payload_test.go create mode 100644 testing/spectest/mainnet/electra/operations/proposer_slashing_test.go create mode 100644 testing/spectest/mainnet/electra/operations/sync_committee_test.go create mode 100644 testing/spectest/mainnet/electra/operations/voluntary_exit_test.go create mode 100644 testing/spectest/mainnet/electra/operations/withdrawals_test.go create mode 100644 testing/spectest/mainnet/electra/random/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/random/random_test.go create mode 100644 testing/spectest/mainnet/electra/rewards/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/rewards/rewards_test.go create mode 100644 testing/spectest/mainnet/electra/sanity/BUILD.bazel create mode 100644 testing/spectest/mainnet/electra/sanity/blocks_test.go create mode 100644 testing/spectest/mainnet/electra/sanity/slots_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/epoch_processing/eth1_data_reset_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/historical_summaries_update_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/inactivity_updates_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/justification_and_finalization_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/participation_flag_updates_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/randao_mixes_reset_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/rewards_and_penalties_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/slashings_reset_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/slashings_test.go create mode 100644 testing/spectest/minimal/electra/finality/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/finality/finality_test.go create mode 100644 testing/spectest/minimal/electra/forkchoice/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/forkchoice/forkchoice_test.go create mode 100644 testing/spectest/minimal/electra/merkle_proof/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/merkle_proof/merkle_proof_test.go create mode 100644 testing/spectest/minimal/electra/operations/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/operations/attester_slashing_test.go create mode 100644 testing/spectest/minimal/electra/operations/block_header_test.go create mode 100644 testing/spectest/minimal/electra/operations/bls_to_execution_change_test.go create mode 100644 testing/spectest/minimal/electra/operations/execution_payload_test.go create mode 100644 testing/spectest/minimal/electra/operations/proposer_slashing_test.go create mode 100644 testing/spectest/minimal/electra/operations/sync_committee_test.go create mode 100644 testing/spectest/minimal/electra/operations/voluntary_exit_test.go create mode 100644 testing/spectest/minimal/electra/operations/withdrawals_test.go create mode 100644 testing/spectest/minimal/electra/random/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/random/random_test.go create mode 100644 testing/spectest/minimal/electra/rewards/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/rewards/rewards_test.go create mode 100644 testing/spectest/minimal/electra/sanity/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/sanity/blocks_test.go create mode 100644 testing/spectest/minimal/electra/sanity/slots_test.go create mode 100644 testing/spectest/shared/electra/epoch_processing/BUILD.bazel create mode 100644 testing/spectest/shared/electra/epoch_processing/eth1_data_reset.go create mode 100644 testing/spectest/shared/electra/epoch_processing/helpers.go create mode 100644 testing/spectest/shared/electra/epoch_processing/historical_summaries_update.go create mode 100644 testing/spectest/shared/electra/epoch_processing/inactivity_updates.go create mode 100644 testing/spectest/shared/electra/epoch_processing/justification_and_finalization.go create mode 100644 testing/spectest/shared/electra/epoch_processing/participation_flag_updates.go create mode 100644 testing/spectest/shared/electra/epoch_processing/randao_mixes_reset.go create mode 100644 testing/spectest/shared/electra/epoch_processing/rewards_and_penalties.go create mode 100644 testing/spectest/shared/electra/epoch_processing/slashings.go create mode 100644 testing/spectest/shared/electra/epoch_processing/slashings_reset.go create mode 100644 testing/spectest/shared/electra/finality/BUILD.bazel create mode 100644 testing/spectest/shared/electra/finality/finality.go create mode 100644 testing/spectest/shared/electra/fork/transition.go create mode 100644 testing/spectest/shared/electra/merkle_proof/BUILD.bazel create mode 100644 testing/spectest/shared/electra/merkle_proof/merkle_proof.go create mode 100644 testing/spectest/shared/electra/operations/BUILD.bazel create mode 100644 testing/spectest/shared/electra/operations/attester_slashing.go create mode 100644 testing/spectest/shared/electra/operations/block_header.go create mode 100644 testing/spectest/shared/electra/operations/bls_to_execution_changes.go create mode 100644 testing/spectest/shared/electra/operations/deposit_receipt.go create mode 100644 testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go create mode 100644 testing/spectest/shared/electra/operations/execution_payload.go create mode 100644 testing/spectest/shared/electra/operations/helpers.go create mode 100644 testing/spectest/shared/electra/operations/proposer_slashing.go create mode 100644 testing/spectest/shared/electra/operations/sync_committee.go create mode 100644 testing/spectest/shared/electra/operations/voluntary_exit.go create mode 100644 testing/spectest/shared/electra/operations/withdrawals.go create mode 100644 testing/spectest/shared/electra/rewards/BUILD.bazel create mode 100644 testing/spectest/shared/electra/rewards/rewards_penalties.go create mode 100644 testing/spectest/shared/electra/sanity/BUILD.bazel create mode 100644 testing/spectest/shared/electra/sanity/block_processing.go create mode 100644 testing/spectest/shared/electra/sanity/block_processing.yaml.go create mode 100644 testing/spectest/shared/electra/sanity/slot_processing.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 5c7c3beb484d..723f02850a2d 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -2,10 +2,15 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["upgrade.go"], + srcs = [ + "transition.go", + "upgrade.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra", visibility = ["//visibility:public"], deps = [ + "//beacon-chain/core/altair:go_default_library", + "//beacon-chain/core/epoch:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go new file mode 100644 index 000000000000..878b2e67c96c --- /dev/null +++ b/beacon-chain/core/electra/transition.go @@ -0,0 +1,23 @@ +package electra + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" + e "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" +) + +// Re-exports for methods that haven't changed in Electra. +var ( + InitializePrecomputeValidators = altair.InitializePrecomputeValidators + ProcessEpochParticipation = altair.ProcessEpochParticipation + ProcessInactivityScores = altair.ProcessInactivityScores + ProcessRewardsAndPenaltiesPrecompute = altair.ProcessRewardsAndPenaltiesPrecompute + ProcessSlashings = e.ProcessSlashings + ProcessEth1DataReset = e.ProcessEth1DataReset + ProcessSlashingsReset = e.ProcessSlashingsReset + ProcessRandaoMixesReset = e.ProcessRandaoMixesReset + ProcessHistoricalDataUpdate = e.ProcessHistoricalDataUpdate + ProcessParticipationFlagUpdates = altair.ProcessParticipationFlagUpdates + ProcessSyncCommitteeUpdates = altair.ProcessSyncCommitteeUpdates + AttestationsDelta = altair.AttestationsDelta + ProcessSyncAggregate = altair.ProcessSyncAggregate +) diff --git a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel new file mode 100644 index 000000000000..9bf424ef6062 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel @@ -0,0 +1,20 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + srcs = [ + "eth1_data_reset_test.go", + "historical_summaries_update_test.go", + "inactivity_updates_test.go", + "justification_and_finalization_test.go", + "participation_flag_updates_test.go", + "randao_mixes_reset_test.go", + "rewards_and_penalties_test.go", + "slashings_reset_test.go", + "slashings_test.go", + ], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + deps = ["//testing/spectest/shared/electra/epoch_processing:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/epoch_processing/eth1_data_reset_test.go b/testing/spectest/mainnet/electra/epoch_processing/eth1_data_reset_test.go new file mode 100644 index 000000000000..d6623f3643c1 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/eth1_data_reset_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_Eth1DataReset(t *testing.T) { + epoch_processing.RunEth1DataResetTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/historical_summaries_update_test.go b/testing/spectest/mainnet/electra/epoch_processing/historical_summaries_update_test.go new file mode 100644 index 000000000000..cadad1f3a929 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/historical_summaries_update_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_HistoricalSummariesUpdate(t *testing.T) { + epoch_processing.RunHistoricalSummariesUpdateTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/inactivity_updates_test.go b/testing/spectest/mainnet/electra/epoch_processing/inactivity_updates_test.go new file mode 100644 index 000000000000..9a4190f07721 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/inactivity_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_InactivityUpdates(t *testing.T) { + epoch_processing.RunInactivityUpdatesTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/justification_and_finalization_test.go b/testing/spectest/mainnet/electra/epoch_processing/justification_and_finalization_test.go new file mode 100644 index 000000000000..eaa86fb57d54 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/justification_and_finalization_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_JustificationAndFinalization(t *testing.T) { + epoch_processing.RunJustificationAndFinalizationTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/participation_flag_updates_test.go b/testing/spectest/mainnet/electra/epoch_processing/participation_flag_updates_test.go new file mode 100644 index 000000000000..bd498a605125 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/participation_flag_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_ParticipationFlag(t *testing.T) { + epoch_processing.RunParticipationFlagUpdatesTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/randao_mixes_reset_test.go b/testing/spectest/mainnet/electra/epoch_processing/randao_mixes_reset_test.go new file mode 100644 index 000000000000..f61d52703f1c --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/randao_mixes_reset_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_RandaoMixesReset(t *testing.T) { + epoch_processing.RunRandaoMixesResetTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/rewards_and_penalties_test.go b/testing/spectest/mainnet/electra/epoch_processing/rewards_and_penalties_test.go new file mode 100644 index 000000000000..ee1bdffeb945 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/rewards_and_penalties_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_RewardsAndPenalties(t *testing.T) { + epoch_processing.RunRewardsAndPenaltiesTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/slashings_reset_test.go b/testing/spectest/mainnet/electra/epoch_processing/slashings_reset_test.go new file mode 100644 index 000000000000..da36d4cc73f3 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/slashings_reset_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_SlashingsReset(t *testing.T) { + epoch_processing.RunSlashingsResetTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go b/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go new file mode 100644 index 000000000000..f5d3d2f7b95a --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_Slashings(t *testing.T) { + epoch_processing.RunSlashingsTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/finality/BUILD.bazel b/testing/spectest/mainnet/electra/finality/BUILD.bazel new file mode 100644 index 000000000000..946f4af2e43d --- /dev/null +++ b/testing/spectest/mainnet/electra/finality/BUILD.bazel @@ -0,0 +1,14 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "medium", + timeout = "short", + srcs = ["finality_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + shard_count = 4, + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/finality:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/finality/finality_test.go b/testing/spectest/mainnet/electra/finality/finality_test.go new file mode 100644 index 000000000000..6b290ca7cc3c --- /dev/null +++ b/testing/spectest/mainnet/electra/finality/finality_test.go @@ -0,0 +1,12 @@ +package finality + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/finality" +) + +func TestMainnet_Electra_Finality(t *testing.T) { + t.Skip("TODO: Electra") + finality.RunFinalityTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/fork_transition/BUILD.bazel b/testing/spectest/mainnet/electra/fork_transition/BUILD.bazel new file mode 100644 index 000000000000..5cf400237e54 --- /dev/null +++ b/testing/spectest/mainnet/electra/fork_transition/BUILD.bazel @@ -0,0 +1,12 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["transition_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/fork:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/fork_transition/transition_test.go b/testing/spectest/mainnet/electra/fork_transition/transition_test.go new file mode 100644 index 000000000000..bfde60ba213e --- /dev/null +++ b/testing/spectest/mainnet/electra/fork_transition/transition_test.go @@ -0,0 +1,12 @@ +package fork_transition + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/fork" +) + +func TestMainnet_Electra_Transition(t *testing.T) { + t.Skip("TODO: Electra") + fork.RunForkTransitionTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/forkchoice/BUILD.bazel b/testing/spectest/mainnet/electra/forkchoice/BUILD.bazel new file mode 100644 index 000000000000..1c2f4d9d33f4 --- /dev/null +++ b/testing/spectest/mainnet/electra/forkchoice/BUILD.bazel @@ -0,0 +1,16 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "enormous", + timeout = "short", + srcs = ["forkchoice_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = [ + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/forkchoice:go_default_library", + ], +) diff --git a/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go b/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go new file mode 100644 index 000000000000..e46b5557a8a3 --- /dev/null +++ b/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go @@ -0,0 +1,13 @@ +package forkchoice + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/forkchoice" +) + +func TestMainnet_Electra_Forkchoice(t *testing.T) { + t.Skip("TODO: Electra") + forkchoice.Run(t, "mainnet", version.Electra) +} diff --git a/testing/spectest/mainnet/electra/merkle_proof/BUILD.bazel b/testing/spectest/mainnet/electra/merkle_proof/BUILD.bazel new file mode 100644 index 000000000000..a83785b2a685 --- /dev/null +++ b/testing/spectest/mainnet/electra/merkle_proof/BUILD.bazel @@ -0,0 +1,11 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + srcs = ["merkle_proof_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/merkle_proof:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/merkle_proof/merkle_proof_test.go b/testing/spectest/mainnet/electra/merkle_proof/merkle_proof_test.go new file mode 100644 index 000000000000..63e54f24a20c --- /dev/null +++ b/testing/spectest/mainnet/electra/merkle_proof/merkle_proof_test.go @@ -0,0 +1,12 @@ +package merkle_proof + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/merkle_proof" +) + +func TestMainnet_Electra_MerkleProof(t *testing.T) { + t.Skip("TODO: Electra") // These spectests are missing? + merkle_proof.RunMerkleProofTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/BUILD.bazel b/testing/spectest/mainnet/electra/operations/BUILD.bazel new file mode 100644 index 000000000000..48fd331379dd --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/BUILD.bazel @@ -0,0 +1,19 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + srcs = [ + "attester_slashing_test.go", + "block_header_test.go", + "bls_to_execution_change_test.go", + "execution_payload_test.go", + "proposer_slashing_test.go", + "sync_committee_test.go", + "voluntary_exit_test.go", + "withdrawals_test.go", + ], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + deps = ["//testing/spectest/shared/electra/operations:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/operations/attester_slashing_test.go b/testing/spectest/mainnet/electra/operations/attester_slashing_test.go new file mode 100644 index 000000000000..e5bd18bdfb77 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/attester_slashing_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_AttesterSlashing(t *testing.T) { + operations.RunAttesterSlashingTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/block_header_test.go b/testing/spectest/mainnet/electra/operations/block_header_test.go new file mode 100644 index 000000000000..91980e775a09 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/block_header_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_BlockHeader(t *testing.T) { + operations.RunBlockHeaderTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/bls_to_execution_change_test.go b/testing/spectest/mainnet/electra/operations/bls_to_execution_change_test.go new file mode 100644 index 000000000000..ef825bd18477 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/bls_to_execution_change_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_BLSToExecutionChange(t *testing.T) { + operations.RunBLSToExecutionChangeTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/execution_payload_test.go b/testing/spectest/mainnet/electra/operations/execution_payload_test.go new file mode 100644 index 000000000000..82848d884900 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/execution_payload_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_PayloadExecution(t *testing.T) { + operations.RunExecutionPayloadTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/proposer_slashing_test.go b/testing/spectest/mainnet/electra/operations/proposer_slashing_test.go new file mode 100644 index 000000000000..5a38d999cd44 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/proposer_slashing_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_ProposerSlashing(t *testing.T) { + operations.RunProposerSlashingTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/sync_committee_test.go b/testing/spectest/mainnet/electra/operations/sync_committee_test.go new file mode 100644 index 000000000000..ea1168f39113 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/sync_committee_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_SyncCommittee(t *testing.T) { + operations.RunSyncCommitteeTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go b/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go new file mode 100644 index 000000000000..ed87d6df8b87 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go @@ -0,0 +1,12 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_VoluntaryExit(t *testing.T) { + t.Skip("TODO: Electra") + operations.RunVoluntaryExitTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/withdrawals_test.go b/testing/spectest/mainnet/electra/operations/withdrawals_test.go new file mode 100644 index 000000000000..d57e1f115bc8 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/withdrawals_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_Withdrawals(t *testing.T) { + operations.RunWithdrawalsTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/random/BUILD.bazel b/testing/spectest/mainnet/electra/random/BUILD.bazel new file mode 100644 index 000000000000..d66d702c47f9 --- /dev/null +++ b/testing/spectest/mainnet/electra/random/BUILD.bazel @@ -0,0 +1,13 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "medium", + timeout = "short", + srcs = ["random_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/sanity:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/random/random_test.go b/testing/spectest/mainnet/electra/random/random_test.go new file mode 100644 index 000000000000..02c8c474f083 --- /dev/null +++ b/testing/spectest/mainnet/electra/random/random_test.go @@ -0,0 +1,12 @@ +package random + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity" +) + +func TestMainnet_Electra_Random(t *testing.T) { + t.Skip("TODO: Electra") + sanity.RunBlockProcessingTest(t, "mainnet", "random/random/pyspec_tests") +} diff --git a/testing/spectest/mainnet/electra/rewards/BUILD.bazel b/testing/spectest/mainnet/electra/rewards/BUILD.bazel new file mode 100644 index 000000000000..9327b9d4962f --- /dev/null +++ b/testing/spectest/mainnet/electra/rewards/BUILD.bazel @@ -0,0 +1,12 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["rewards_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/rewards:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/rewards/rewards_test.go b/testing/spectest/mainnet/electra/rewards/rewards_test.go new file mode 100644 index 000000000000..32ed89f93818 --- /dev/null +++ b/testing/spectest/mainnet/electra/rewards/rewards_test.go @@ -0,0 +1,11 @@ +package rewards + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/rewards" +) + +func TestMainnet_Electra_Rewards(t *testing.T) { + rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/sanity/BUILD.bazel b/testing/spectest/mainnet/electra/sanity/BUILD.bazel new file mode 100644 index 000000000000..0aaa255ab2ae --- /dev/null +++ b/testing/spectest/mainnet/electra/sanity/BUILD.bazel @@ -0,0 +1,16 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "medium", + timeout = "short", + srcs = [ + "blocks_test.go", + "slots_test.go", + ], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/sanity:go_default_library"], +) diff --git a/testing/spectest/mainnet/electra/sanity/blocks_test.go b/testing/spectest/mainnet/electra/sanity/blocks_test.go new file mode 100644 index 000000000000..27cef36e34ba --- /dev/null +++ b/testing/spectest/mainnet/electra/sanity/blocks_test.go @@ -0,0 +1,12 @@ +package sanity + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity" +) + +func TestMainnet_Electra_Sanity_Blocks(t *testing.T) { + t.Skip("TODO: Electra") + sanity.RunBlockProcessingTest(t, "mainnet", "sanity/blocks/pyspec_tests") +} diff --git a/testing/spectest/mainnet/electra/sanity/slots_test.go b/testing/spectest/mainnet/electra/sanity/slots_test.go new file mode 100644 index 000000000000..39047f32fc7b --- /dev/null +++ b/testing/spectest/mainnet/electra/sanity/slots_test.go @@ -0,0 +1,11 @@ +package sanity + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity" +) + +func TestMainnet_Electra_Sanity_Slots(t *testing.T) { + sanity.RunSlotProcessingTests(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel new file mode 100644 index 000000000000..0f4b31514b71 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel @@ -0,0 +1,21 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + srcs = [ + "eth1_data_reset_test.go", + "historical_summaries_update_test.go", + "inactivity_updates_test.go", + "justification_and_finalization_test.go", + "participation_flag_updates_test.go", + "randao_mixes_reset_test.go", + "rewards_and_penalties_test.go", + "slashings_reset_test.go", + "slashings_test.go", + ], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + deps = ["//testing/spectest/shared/electra/epoch_processing:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/epoch_processing/eth1_data_reset_test.go b/testing/spectest/minimal/electra/epoch_processing/eth1_data_reset_test.go new file mode 100644 index 000000000000..9e58a25ad881 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/eth1_data_reset_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_Eth1DataReset(t *testing.T) { + epoch_processing.RunEth1DataResetTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/historical_summaries_update_test.go b/testing/spectest/minimal/electra/epoch_processing/historical_summaries_update_test.go new file mode 100644 index 000000000000..dc35020ef0e8 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/historical_summaries_update_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_HistoricalSummariesUpdate(t *testing.T) { + epoch_processing.RunHistoricalSummariesUpdateTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/inactivity_updates_test.go b/testing/spectest/minimal/electra/epoch_processing/inactivity_updates_test.go new file mode 100644 index 000000000000..ffe2e46c93e6 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/inactivity_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_InactivityUpdates(t *testing.T) { + epoch_processing.RunInactivityUpdatesTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/justification_and_finalization_test.go b/testing/spectest/minimal/electra/epoch_processing/justification_and_finalization_test.go new file mode 100644 index 000000000000..75fa1dcff01d --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/justification_and_finalization_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_JustificationAndFinalization(t *testing.T) { + epoch_processing.RunJustificationAndFinalizationTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/participation_flag_updates_test.go b/testing/spectest/minimal/electra/epoch_processing/participation_flag_updates_test.go new file mode 100644 index 000000000000..0dfadb3f56bb --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/participation_flag_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_ParticipationFlag(t *testing.T) { + epoch_processing.RunParticipationFlagUpdatesTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/randao_mixes_reset_test.go b/testing/spectest/minimal/electra/epoch_processing/randao_mixes_reset_test.go new file mode 100644 index 000000000000..ad31f893c556 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/randao_mixes_reset_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_RandaoMixesReset(t *testing.T) { + epoch_processing.RunRandaoMixesResetTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/rewards_and_penalties_test.go b/testing/spectest/minimal/electra/epoch_processing/rewards_and_penalties_test.go new file mode 100644 index 000000000000..9d0cd33fb3bd --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/rewards_and_penalties_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_RewardsAndPenalties(t *testing.T) { + epoch_processing.RunRewardsAndPenaltiesTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/slashings_reset_test.go b/testing/spectest/minimal/electra/epoch_processing/slashings_reset_test.go new file mode 100644 index 000000000000..00e4cfbeda7f --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/slashings_reset_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_SlashingsReset(t *testing.T) { + epoch_processing.RunSlashingsResetTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/slashings_test.go b/testing/spectest/minimal/electra/epoch_processing/slashings_test.go new file mode 100644 index 000000000000..2271afdf262a --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/slashings_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_Slashings(t *testing.T) { + epoch_processing.RunSlashingsTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/finality/BUILD.bazel b/testing/spectest/minimal/electra/finality/BUILD.bazel new file mode 100644 index 000000000000..83077cdc67e3 --- /dev/null +++ b/testing/spectest/minimal/electra/finality/BUILD.bazel @@ -0,0 +1,15 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "medium", + timeout = "short", + srcs = ["finality_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + shard_count = 4, + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/finality:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/finality/finality_test.go b/testing/spectest/minimal/electra/finality/finality_test.go new file mode 100644 index 000000000000..05b498488e09 --- /dev/null +++ b/testing/spectest/minimal/electra/finality/finality_test.go @@ -0,0 +1,12 @@ +package finality + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/finality" +) + +func TestMinimal_Electra_Finality(t *testing.T) { + t.Skip("TODO: Electra") + finality.RunFinalityTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/forkchoice/BUILD.bazel b/testing/spectest/minimal/electra/forkchoice/BUILD.bazel new file mode 100644 index 000000000000..9acdacb4d8e3 --- /dev/null +++ b/testing/spectest/minimal/electra/forkchoice/BUILD.bazel @@ -0,0 +1,17 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "enormous", + timeout = "short", + srcs = ["forkchoice_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = ["spectest"], + deps = [ + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/forkchoice:go_default_library", + ], +) diff --git a/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go b/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go new file mode 100644 index 000000000000..aa04917b5ae6 --- /dev/null +++ b/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go @@ -0,0 +1,13 @@ +package forkchoice + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/forkchoice" +) + +func TestMinimal_Electra_Forkchoice(t *testing.T) { + t.Skip("TODO: Electra") + forkchoice.Run(t, "minimal", version.Electra) +} diff --git a/testing/spectest/minimal/electra/merkle_proof/BUILD.bazel b/testing/spectest/minimal/electra/merkle_proof/BUILD.bazel new file mode 100644 index 000000000000..4d1b2b775e5a --- /dev/null +++ b/testing/spectest/minimal/electra/merkle_proof/BUILD.bazel @@ -0,0 +1,12 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + srcs = ["merkle_proof_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/merkle_proof:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/merkle_proof/merkle_proof_test.go b/testing/spectest/minimal/electra/merkle_proof/merkle_proof_test.go new file mode 100644 index 000000000000..9d494ff90881 --- /dev/null +++ b/testing/spectest/minimal/electra/merkle_proof/merkle_proof_test.go @@ -0,0 +1,12 @@ +package merkle_proof + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/merkle_proof" +) + +func TestMinimal_Electra_MerkleProof(t *testing.T) { + t.Skip("TODO: Electra") // These spectests are missing? + merkle_proof.RunMerkleProofTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/BUILD.bazel b/testing/spectest/minimal/electra/operations/BUILD.bazel new file mode 100644 index 000000000000..b54d95de73d0 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/BUILD.bazel @@ -0,0 +1,20 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + srcs = [ + "attester_slashing_test.go", + "block_header_test.go", + "bls_to_execution_change_test.go", + "execution_payload_test.go", + "proposer_slashing_test.go", + "sync_committee_test.go", + "voluntary_exit_test.go", + "withdrawals_test.go", + ], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + deps = ["//testing/spectest/shared/electra/operations:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/operations/attester_slashing_test.go b/testing/spectest/minimal/electra/operations/attester_slashing_test.go new file mode 100644 index 000000000000..28df10263ad5 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/attester_slashing_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_AttesterSlashing(t *testing.T) { + operations.RunAttesterSlashingTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/block_header_test.go b/testing/spectest/minimal/electra/operations/block_header_test.go new file mode 100644 index 000000000000..59dccc8697dc --- /dev/null +++ b/testing/spectest/minimal/electra/operations/block_header_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_BlockHeader(t *testing.T) { + operations.RunBlockHeaderTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/bls_to_execution_change_test.go b/testing/spectest/minimal/electra/operations/bls_to_execution_change_test.go new file mode 100644 index 000000000000..a0af05fba322 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/bls_to_execution_change_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_BLSToExecutionChange(t *testing.T) { + operations.RunBLSToExecutionChangeTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/execution_payload_test.go b/testing/spectest/minimal/electra/operations/execution_payload_test.go new file mode 100644 index 000000000000..6227aaca5122 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/execution_payload_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_PayloadExecution(t *testing.T) { + operations.RunExecutionPayloadTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/proposer_slashing_test.go b/testing/spectest/minimal/electra/operations/proposer_slashing_test.go new file mode 100644 index 000000000000..22209c3b0efc --- /dev/null +++ b/testing/spectest/minimal/electra/operations/proposer_slashing_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_ProposerSlashing(t *testing.T) { + operations.RunProposerSlashingTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/sync_committee_test.go b/testing/spectest/minimal/electra/operations/sync_committee_test.go new file mode 100644 index 000000000000..b4a37a1b6430 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/sync_committee_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_SyncCommittee(t *testing.T) { + operations.RunSyncCommitteeTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/voluntary_exit_test.go b/testing/spectest/minimal/electra/operations/voluntary_exit_test.go new file mode 100644 index 000000000000..ab3098ed6b0c --- /dev/null +++ b/testing/spectest/minimal/electra/operations/voluntary_exit_test.go @@ -0,0 +1,12 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_VoluntaryExit(t *testing.T) { + t.Skip("TODO: Electra") + operations.RunVoluntaryExitTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/withdrawals_test.go b/testing/spectest/minimal/electra/operations/withdrawals_test.go new file mode 100644 index 000000000000..4b93287a4188 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/withdrawals_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_Withdrawals(t *testing.T) { + operations.RunWithdrawalsTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/random/BUILD.bazel b/testing/spectest/minimal/electra/random/BUILD.bazel new file mode 100644 index 000000000000..b45a63314dd6 --- /dev/null +++ b/testing/spectest/minimal/electra/random/BUILD.bazel @@ -0,0 +1,14 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "medium", + timeout = "short", + srcs = ["random_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/sanity:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/random/random_test.go b/testing/spectest/minimal/electra/random/random_test.go new file mode 100644 index 000000000000..d454d894bcd0 --- /dev/null +++ b/testing/spectest/minimal/electra/random/random_test.go @@ -0,0 +1,12 @@ +package random + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity" +) + +func TestMinimal_Electra_Random(t *testing.T) { + t.Skip("TODO: Electra") + sanity.RunBlockProcessingTest(t, "minimal", "random/random/pyspec_tests") +} diff --git a/testing/spectest/minimal/electra/rewards/BUILD.bazel b/testing/spectest/minimal/electra/rewards/BUILD.bazel new file mode 100644 index 000000000000..32683ab2789f --- /dev/null +++ b/testing/spectest/minimal/electra/rewards/BUILD.bazel @@ -0,0 +1,13 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["rewards_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/rewards:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/rewards/rewards_test.go b/testing/spectest/minimal/electra/rewards/rewards_test.go new file mode 100644 index 000000000000..9aae7d08c76b --- /dev/null +++ b/testing/spectest/minimal/electra/rewards/rewards_test.go @@ -0,0 +1,11 @@ +package rewards + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/rewards" +) + +func TestMinimal_Electra_Rewards(t *testing.T) { + rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/sanity/BUILD.bazel b/testing/spectest/minimal/electra/sanity/BUILD.bazel new file mode 100644 index 000000000000..78d6de3353d1 --- /dev/null +++ b/testing/spectest/minimal/electra/sanity/BUILD.bazel @@ -0,0 +1,17 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "medium", + timeout = "short", + srcs = [ + "blocks_test.go", + "slots_test.go", + ], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/sanity:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/sanity/blocks_test.go b/testing/spectest/minimal/electra/sanity/blocks_test.go new file mode 100644 index 000000000000..a6a7b8188764 --- /dev/null +++ b/testing/spectest/minimal/electra/sanity/blocks_test.go @@ -0,0 +1,12 @@ +package sanity + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity" +) + +func TestMinimal_Electra_Sanity_Blocks(t *testing.T) { + t.Skip("TODO: Electra") + sanity.RunBlockProcessingTest(t, "minimal", "sanity/blocks/pyspec_tests") +} diff --git a/testing/spectest/minimal/electra/sanity/slots_test.go b/testing/spectest/minimal/electra/sanity/slots_test.go new file mode 100644 index 000000000000..083b33d7cef6 --- /dev/null +++ b/testing/spectest/minimal/electra/sanity/slots_test.go @@ -0,0 +1,11 @@ +package sanity + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity" +) + +func TestMinimal_Electra_Sanity_Slots(t *testing.T) { + sanity.RunSlotProcessingTests(t, "minimal") +} diff --git a/testing/spectest/shared/common/forkchoice/runner.go b/testing/spectest/shared/common/forkchoice/runner.go index c3e0f4c2630b..3ca092873692 100644 --- a/testing/spectest/shared/common/forkchoice/runner.go +++ b/testing/spectest/shared/common/forkchoice/runner.go @@ -85,6 +85,9 @@ func runTest(t *testing.T, config string, fork int, basePath string) { case version.Deneb: beaconState = unmarshalDenebState(t, preBeaconStateSSZ) beaconBlock = unmarshalDenebBlock(t, blockSSZ) + case version.Electra: + beaconState = unmarshalElectraState(t, preBeaconStateSSZ) + beaconBlock = unmarshalElectraBlock(t, blockSSZ) default: t.Fatalf("unknown fork version: %v", fork) } @@ -112,6 +115,8 @@ func runTest(t *testing.T, config string, fork int, basePath string) { beaconBlock = unmarshalSignedCapellaBlock(t, blockSSZ) case version.Deneb: beaconBlock = unmarshalSignedDenebBlock(t, blockSSZ) + case version.Electra: + beaconBlock = unmarshalSignedElectraBlock(t, blockSSZ) default: t.Fatalf("unknown fork version: %v", fork) } @@ -281,6 +286,30 @@ func unmarshalSignedDenebBlock(t *testing.T, raw []byte) interfaces.SignedBeacon return blk } +func unmarshalElectraState(t *testing.T, raw []byte) state.BeaconState { + base := ðpb.BeaconStateElectra{} + require.NoError(t, base.UnmarshalSSZ(raw)) + st, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + return st +} + +func unmarshalElectraBlock(t *testing.T, raw []byte) interfaces.SignedBeaconBlock { + base := ðpb.BeaconBlockElectra{} + require.NoError(t, base.UnmarshalSSZ(raw)) + blk, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: base, Signature: make([]byte, fieldparams.BLSSignatureLength)}) + require.NoError(t, err) + return blk +} + +func unmarshalSignedElectraBlock(t *testing.T, raw []byte) interfaces.SignedBeaconBlock { + base := ðpb.SignedBeaconBlockElectra{} + require.NoError(t, base.UnmarshalSSZ(raw)) + blk, err := blocks.NewSignedBeaconBlock(base) + require.NoError(t, err) + return blk +} + func runBlobStep(t *testing.T, step Step, beaconBlock interfaces.ReadOnlySignedBeaconBlock, diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel new file mode 100644 index 000000000000..90d8ef842817 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -0,0 +1,37 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = [ + "eth1_data_reset.go", + "helpers.go", + "historical_summaries_update.go", + "inactivity_updates.go", + "justification_and_finalization.go", + "participation_flag_updates.go", + "randao_mixes_reset.go", + "rewards_and_penalties.go", + "slashings.go", + "slashings_reset.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/core/electra:go_default_library", + "//beacon-chain/core/epoch/precompute:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//config/params:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@io_bazel_rules_go//go/tools/bazel:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/epoch_processing/eth1_data_reset.go b/testing/spectest/shared/electra/epoch_processing/eth1_data_reset.go new file mode 100644 index 000000000000..ef73cc8093d8 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/eth1_data_reset.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunEth1DataResetTests executes "epoch_processing/eth1_data_reset" tests. +func RunEth1DataResetTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/eth1_data_reset/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processEth1DataResetWrapper) + }) + } +} + +func processEth1DataResetWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + st, err := electra.ProcessEth1DataReset(st) + require.NoError(t, err, "Could not process final updates") + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/helpers.go b/testing/spectest/shared/electra/epoch_processing/helpers.go new file mode 100644 index 000000000000..6fe2e87c9534 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/helpers.go @@ -0,0 +1,78 @@ +package epoch_processing + +import ( + "os" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) + +// RunEpochOperationTest takes in the prestate and processes it through the +// passed in epoch operation function and checks the post state with the expected post state. +func RunEpochOperationTest( + t *testing.T, + testFolderPath string, + operationFn epochOperation, +) { + preBeaconStateFile, err := util.BazelFileBytes(path.Join(testFolderPath, "pre.ssz_snappy")) + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preBeaconStateBase := ðpb.BeaconStateElectra{} + if err := preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { + t.Fatalf("Failed to unmarshal: %v", err) + } + preBeaconState, err := state_native.InitializeFromProtoElectra(preBeaconStateBase) + require.NoError(t, err) + + // If the post.ssz is not present, it means the test should fail on our end. + postSSZFilepath, err := bazel.Runfile(path.Join(testFolderPath, "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else if err != nil { + t.Fatal(err) + } + + beaconState, err := operationFn(t, preBeaconState) + if postSSZExists { + require.NoError(t, err) + + postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + postBeaconState := ðpb.BeaconStateElectra{} + if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { + t.Fatalf("Failed to unmarshal: %v", err) + } + + pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProtoUnsafe()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } + } else { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } +} diff --git a/testing/spectest/shared/electra/epoch_processing/historical_summaries_update.go b/testing/spectest/shared/electra/epoch_processing/historical_summaries_update.go new file mode 100644 index 000000000000..dc9342993364 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/historical_summaries_update.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunHistoricalSummariesUpdateTests executes "epoch_processing/historical_Summaries_update" tests. +func RunHistoricalSummariesUpdateTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/historical_summaries_update/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processHistoricalSummariesUpdateWrapper) + }) + } +} + +func processHistoricalSummariesUpdateWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + st, err := electra.ProcessHistoricalDataUpdate(st) + require.NoError(t, err, "Could not process final updates") + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/inactivity_updates.go b/testing/spectest/shared/electra/epoch_processing/inactivity_updates.go new file mode 100644 index 000000000000..4b358537e54f --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/inactivity_updates.go @@ -0,0 +1,41 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunInactivityUpdatesTest executes "epoch_processing/inactivity_updates" tests. +func RunInactivityUpdatesTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testPath := "epoch_processing/inactivity_updates/pyspec_tests" + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", testPath) + for _, folder := range testFolders { + helpers.ClearCache() + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processInactivityUpdates) + }) + } +} + +func processInactivityUpdates(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + ctx := context.Background() + vp, bp, err := electra.InitializePrecomputeValidators(ctx, st) + require.NoError(t, err) + vp, _, err = electra.ProcessEpochParticipation(ctx, st, bp, vp) + require.NoError(t, err) + + st, _, err = electra.ProcessInactivityScores(ctx, st, vp) + require.NoError(t, err, "Could not process reward") + + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/justification_and_finalization.go b/testing/spectest/shared/electra/epoch_processing/justification_and_finalization.go new file mode 100644 index 000000000000..bd98efeb7ffe --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/justification_and_finalization.go @@ -0,0 +1,44 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunJustificationAndFinalizationTests executes "epoch_processing/justification_and_finalization" tests. +func RunJustificationAndFinalizationTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testPath := "epoch_processing/justification_and_finalization/pyspec_tests" + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", testPath) + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processJustificationAndFinalizationPrecomputeWrapper) + }) + } +} + +func processJustificationAndFinalizationPrecomputeWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + ctx := context.Background() + vp, bp, err := electra.InitializePrecomputeValidators(ctx, st) + require.NoError(t, err) + _, bp, err = electra.ProcessEpochParticipation(ctx, st, bp, vp) + require.NoError(t, err) + activeBal, targetPrevious, targetCurrent, err := st.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) + st, err = precompute.ProcessJustificationAndFinalizationPreCompute(st, bp) + require.NoError(t, err, "Could not process justification") + + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/participation_flag_updates.go b/testing/spectest/shared/electra/epoch_processing/participation_flag_updates.go new file mode 100644 index 000000000000..3a03588df7f1 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/participation_flag_updates.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunParticipationFlagUpdatesTests executes "epoch_processing/participation_flag_updates" tests. +func RunParticipationFlagUpdatesTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/participation_flag_updates/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processParticipationFlagUpdatesWrapper) + }) + } +} + +func processParticipationFlagUpdatesWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + st, err := electra.ProcessParticipationFlagUpdates(st) + require.NoError(t, err, "Could not process participation flag update") + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/randao_mixes_reset.go b/testing/spectest/shared/electra/epoch_processing/randao_mixes_reset.go new file mode 100644 index 000000000000..97f16a711e34 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/randao_mixes_reset.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunRandaoMixesResetTests executes "epoch_processing/randao_mixes_reset" tests. +func RunRandaoMixesResetTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/randao_mixes_reset/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processRandaoMixesResetWrapper) + }) + } +} + +func processRandaoMixesResetWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + st, err := electra.ProcessRandaoMixesReset(st) + require.NoError(t, err, "Could not process final updates") + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/rewards_and_penalties.go b/testing/spectest/shared/electra/epoch_processing/rewards_and_penalties.go new file mode 100644 index 000000000000..092c2cc9108e --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/rewards_and_penalties.go @@ -0,0 +1,41 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunRewardsAndPenaltiesTests executes "epoch_processing/rewards_and_penalties" tests. +func RunRewardsAndPenaltiesTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testPath := "epoch_processing/rewards_and_penalties/pyspec_tests" + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", testPath) + for _, folder := range testFolders { + helpers.ClearCache() + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processRewardsAndPenaltiesPrecomputeWrapper) + }) + } +} + +func processRewardsAndPenaltiesPrecomputeWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + ctx := context.Background() + vp, bp, err := electra.InitializePrecomputeValidators(ctx, st) + require.NoError(t, err) + vp, bp, err = electra.ProcessEpochParticipation(ctx, st, bp, vp) + require.NoError(t, err) + + st, err = electra.ProcessRewardsAndPenaltiesPrecompute(st, bp, vp) + require.NoError(t, err, "Could not process reward") + + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/slashings.go b/testing/spectest/shared/electra/epoch_processing/slashings.go new file mode 100644 index 000000000000..f6c9d61e65ec --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/slashings.go @@ -0,0 +1,33 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunSlashingsTests executes "epoch_processing/slashings" tests. +func RunSlashingsTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/slashings/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + helpers.ClearCache() + RunEpochOperationTest(t, folderPath, processSlashingsWrapper) + }) + } +} + +func processSlashingsWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + st, err := electra.ProcessSlashings(st, params.BeaconConfig().ProportionalSlashingMultiplierBellatrix) + require.NoError(t, err, "Could not process slashings") + return st, nil +} diff --git a/testing/spectest/shared/electra/epoch_processing/slashings_reset.go b/testing/spectest/shared/electra/epoch_processing/slashings_reset.go new file mode 100644 index 000000000000..35e81affc152 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/slashings_reset.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunSlashingsResetTests executes "epoch_processing/slashings_reset" tests. +func RunSlashingsResetTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/slashings_reset/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processSlashingsResetWrapper) + }) + } +} + +func processSlashingsResetWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + st, err := electra.ProcessSlashingsReset(st) + require.NoError(t, err, "Could not process final updates") + return st, nil +} diff --git a/testing/spectest/shared/electra/finality/BUILD.bazel b/testing/spectest/shared/electra/finality/BUILD.bazel new file mode 100644 index 000000000000..93369784d691 --- /dev/null +++ b/testing/spectest/shared/electra/finality/BUILD.bazel @@ -0,0 +1,24 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["finality.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/finality", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//consensus-types/blocks:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/finality/finality.go b/testing/spectest/shared/electra/finality/finality.go new file mode 100644 index 000000000000..39c545640dcc --- /dev/null +++ b/testing/spectest/shared/electra/finality/finality.go @@ -0,0 +1,86 @@ +package finality + +import ( + "context" + "fmt" + "testing" + + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +func init() { + transition.SkipSlotCache.Disable() +} + +type Config struct { + BlocksCount int `json:"blocks_count"` +} + +// RunFinalityTest executes finality spec tests. +func RunFinalityTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "finality/finality/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + beaconStateBase := ðpb.BeaconStateElectra{} + require.NoError(t, beaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + beaconState, err := state_native.InitializeFromProtoElectra(beaconStateBase) + require.NoError(t, err) + + file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "meta.yaml") + require.NoError(t, err) + + metaYaml := &Config{} + require.NoError(t, utils.UnmarshalYaml(file, metaYaml), "Failed to Unmarshal") + + var processedState state.BeaconState + var ok bool + for i := 0; i < metaYaml.BlocksCount; i++ { + filename := fmt.Sprintf("blocks_%d.ssz_snappy", i) + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), filename) + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block := ðpb.SignedBeaconBlockElectra{} + require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + wsb, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + processedState, err = transition.ExecuteStateTransition(context.Background(), beaconState, wsb) + require.NoError(t, err) + beaconState, ok = processedState.(*state_native.BeaconState) + require.Equal(t, true, ok) + } + + postBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "post.ssz_snappy") + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + postBeaconState := ðpb.BeaconStateElectra{} + require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") + pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProtoUnsafe()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } + }) + } +} diff --git a/testing/spectest/shared/electra/fork/BUILD.bazel b/testing/spectest/shared/electra/fork/BUILD.bazel index 25a3a1959e83..f2101d0eacef 100644 --- a/testing/spectest/shared/electra/fork/BUILD.bazel +++ b/testing/spectest/shared/electra/fork/BUILD.bazel @@ -3,13 +3,20 @@ load("@prysm//tools/go:def.bzl", "go_library") go_library( name = "go_default_library", testonly = True, - srcs = ["upgrade_to_electra.go"], + srcs = [ + "transition.go", + "upgrade_to_electra.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/fork", visibility = ["//visibility:public"], deps = [ "//beacon-chain/core/electra:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/transition:go_default_library", "//beacon-chain/state/state-native:go_default_library", + "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", + "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/electra/fork/transition.go b/testing/spectest/shared/electra/fork/transition.go new file mode 100644 index 000000000000..6df33c7c78de --- /dev/null +++ b/testing/spectest/shared/electra/fork/transition.go @@ -0,0 +1,125 @@ +package fork + +import ( + "context" + "fmt" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + types "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +type Config struct { + PostFork string `json:"post_fork"` + ForkEpoch int `json:"fork_epoch"` + ForkBlock *int `json:"fork_block"` + BlocksCount int `json:"blocks_count"` +} + +// RunForkTransitionTest is a helper function that runs electra's transition core tests. +func RunForkTransitionTest(t *testing.T, config string) { + params.SetupTestConfigCleanup(t) + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "transition/core/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "meta.yaml") + require.NoError(t, err) + config := &Config{} + require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") + + preforkBlocks := make([]*ethpb.SignedBeaconBlockDeneb, 0) + postforkBlocks := make([]*ethpb.SignedBeaconBlockElectra, 0) + // Fork happens without any pre-fork blocks. + if config.ForkBlock == nil { + for i := 0; i < config.BlocksCount; i++ { + fileName := fmt.Sprint("blocks_", i, ".ssz_snappy") + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), fileName) + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block := ðpb.SignedBeaconBlockElectra{} + require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + postforkBlocks = append(postforkBlocks, block) + } + // Fork happens with pre-fork blocks. + } else { + for i := 0; i <= *config.ForkBlock; i++ { + fileName := fmt.Sprint("blocks_", i, ".ssz_snappy") + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), fileName) + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block := ðpb.SignedBeaconBlockDeneb{} + require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + preforkBlocks = append(preforkBlocks, block) + } + for i := *config.ForkBlock + 1; i < config.BlocksCount; i++ { + fileName := fmt.Sprint("blocks_", i, ".ssz_snappy") + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), fileName) + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block := ðpb.SignedBeaconBlockElectra{} + require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + postforkBlocks = append(postforkBlocks, block) + } + } + + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + beaconStateBase := ðpb.BeaconStateDeneb{} + require.NoError(t, beaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + beaconState, err := state_native.InitializeFromProtoDeneb(beaconStateBase) + require.NoError(t, err) + + bc := params.BeaconConfig().Copy() + bc.ElectraForkEpoch = types.Epoch(config.ForkEpoch) + params.OverrideBeaconConfig(bc) + + ctx := context.Background() + var ok bool + for _, b := range preforkBlocks { + wsb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + st, err := transition.ExecuteStateTransition(ctx, beaconState, wsb) + require.NoError(t, err) + beaconState, ok = st.(*state_native.BeaconState) + require.Equal(t, true, ok) + } + + for _, b := range postforkBlocks { + wsb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + st, err := transition.ExecuteStateTransition(ctx, beaconState, wsb) + require.NoError(t, err) + beaconState, ok = st.(*state_native.BeaconState) + require.Equal(t, true, ok) + } + + postBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "post.ssz_snappy") + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + postBeaconState := ðpb.BeaconStateElectra{} + require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") + + pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProto()) + require.NoError(t, err) + require.DeepEqual(t, postBeaconState, pbState, "Did not get expected post state") + }) + } +} diff --git a/testing/spectest/shared/electra/fork/upgrade_to_electra.go b/testing/spectest/shared/electra/fork/upgrade_to_electra.go index b35e1c59dc90..a17b42765c69 100644 --- a/testing/spectest/shared/electra/fork/upgrade_to_electra.go +++ b/testing/spectest/shared/electra/fork/upgrade_to_electra.go @@ -18,7 +18,7 @@ import ( ) // RunUpgradeToElectra is a helper function that runs Electra's fork spec tests. -// It unmarshals a pre- and post-state to check `UpgradeToDeneb` comply with spec implementation. +// It unmarshals a pre- and post-state to check `UpgradeToElectra` comply with spec implementation. func RunUpgradeToElectra(t *testing.T, config string) { require.NoError(t, utils.SetConfig(t, config)) diff --git a/testing/spectest/shared/electra/merkle_proof/BUILD.bazel b/testing/spectest/shared/electra/merkle_proof/BUILD.bazel new file mode 100644 index 000000000000..fc4a288410d9 --- /dev/null +++ b/testing/spectest/shared/electra/merkle_proof/BUILD.bazel @@ -0,0 +1,13 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["merkle_proof.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/merkle_proof", + visibility = ["//visibility:public"], + deps = [ + "//testing/spectest/shared/common/merkle_proof:go_default_library", + "//testing/spectest/shared/electra/ssz_static:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/merkle_proof/merkle_proof.go b/testing/spectest/shared/electra/merkle_proof/merkle_proof.go new file mode 100644 index 000000000000..085e870efe42 --- /dev/null +++ b/testing/spectest/shared/electra/merkle_proof/merkle_proof.go @@ -0,0 +1,12 @@ +package merkle_proof + +import ( + "testing" + + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/merkle_proof" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static" +) + +func RunMerkleProofTests(t *testing.T, config string) { + common.RunMerkleProofTests(t, config, "electra", ssz_static.UnmarshalledSSZ) +} diff --git a/testing/spectest/shared/electra/operations/BUILD.bazel b/testing/spectest/shared/electra/operations/BUILD.bazel new file mode 100644 index 000000000000..7da4295b226b --- /dev/null +++ b/testing/spectest/shared/electra/operations/BUILD.bazel @@ -0,0 +1,43 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = [ + "attester_slashing.go", + "block_header.go", + "bls_to_execution_changes.go", + "deposit_receipt.go", + "execution_layer_withdrawal_request.go", + "execution_payload.go", + "helpers.go", + "proposer_slashing.go", + "sync_committee.go", + "voluntary_exit.go", + "withdrawals.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/core/blocks:go_default_library", + "//beacon-chain/core/electra:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/core/validators:go_default_library", + "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", + "//proto/engine/v1:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@com_github_pkg_errors//:go_default_library", + "@io_bazel_rules_go//go/tools/bazel:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/operations/attester_slashing.go b/testing/spectest/shared/electra/operations/attester_slashing.go new file mode 100644 index 000000000000..2818cd7f6644 --- /dev/null +++ b/testing/spectest/shared/electra/operations/attester_slashing.go @@ -0,0 +1,38 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunAttesterSlashingTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/attester_slashing/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") + require.NoError(t, err) + attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) + require.NoError(t, err, "Failed to decompress") + attSlashing := ðpb.AttesterSlashingElectra{} + require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{AttesterSlashings: []*ethpb.AttesterSlashingElectra{attSlashing}} + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) + }) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/block_header.go b/testing/spectest/shared/electra/operations/block_header.go new file mode 100644 index 000000000000..f0d141e3dc21 --- /dev/null +++ b/testing/spectest/shared/electra/operations/block_header.go @@ -0,0 +1,86 @@ +package operations + +import ( + "context" + "os" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +func RunBlockHeaderTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/block_header/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block := ðpb.BeaconBlockElectra{} + require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preBeaconStateBase := ðpb.BeaconStateElectra{} + require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + preBeaconState, err := state_native.InitializeFromProtoElectra(preBeaconStateBase) + require.NoError(t, err) + + // If the post.ssz is not present, it means the test should fail on our end. + postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else { + require.NoError(t, err) + } + + // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. + bodyRoot, err := block.Body.HashTreeRoot() + require.NoError(t, err) + beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) + if postSSZExists { + require.NoError(t, err) + + postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + + postBeaconState := ðpb.BeaconStateElectra{} + require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") + pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProto()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } + } else { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } + }) + } +} diff --git a/testing/spectest/shared/electra/operations/bls_to_execution_changes.go b/testing/spectest/shared/electra/operations/bls_to_execution_changes.go new file mode 100644 index 000000000000..58dd6699e5a7 --- /dev/null +++ b/testing/spectest/shared/electra/operations/bls_to_execution_changes.go @@ -0,0 +1,62 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunBLSToExecutionChangeTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/bls_to_execution_change/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/bls_to_execution_change/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + changeFile, err := util.BazelFileBytes(folderPath, "address_change.ssz_snappy") + require.NoError(t, err) + changeSSZ, err := snappy.Decode(nil /* dst */, changeFile) + require.NoError(t, err, "Failed to decompress") + change := ðpb.SignedBLSToExecutionChange{} + require.NoError(t, change.UnmarshalSSZ(changeSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{ + BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{change}, + } + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + st, err := blocks.ProcessBLSToExecutionChanges(s, b.Block()) + if err != nil { + return nil, err + } + changes, err := b.Block().Body().BLSToExecutionChanges() + if err != nil { + return nil, err + } + cSet, err := blocks.BLSChangesSignatureBatch(st, changes) + if err != nil { + return nil, err + } + ok, err := cSet.Verify() + if err != nil { + return nil, err + } + if !ok { + return nil, errors.New("signature did not verify") + } + return st, nil + }) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/deposit_receipt.go b/testing/spectest/shared/electra/operations/deposit_receipt.go new file mode 100644 index 000000000000..4cb008a835ca --- /dev/null +++ b/testing/spectest/shared/electra/operations/deposit_receipt.go @@ -0,0 +1,3 @@ +package operations + +// TODO: Add tests. diff --git a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go b/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go new file mode 100644 index 000000000000..4cb008a835ca --- /dev/null +++ b/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go @@ -0,0 +1,3 @@ +package operations + +// TODO: Add tests. diff --git a/testing/spectest/shared/electra/operations/execution_payload.go b/testing/spectest/shared/electra/operations/execution_payload.go new file mode 100644 index 000000000000..69111af82cd5 --- /dev/null +++ b/testing/spectest/shared/electra/operations/execution_payload.go @@ -0,0 +1,106 @@ +package operations + +import ( + "math/big" + "os" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + blocks2 "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +func RunExecutionPayloadTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_payload/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/execution_payload/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + + blockBodyFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "body.ssz_snappy") + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockBodyFile) + require.NoError(t, err, "Failed to decompress") + body := ðpb.BeaconBlockBodyElectra{} + require.NoError(t, body.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + b, err := blocks2.NewBeaconBlock(ðpb.BeaconBlockElectra{Body: body}) + require.NoError(t, err) + + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preBeaconStateBase := ðpb.BeaconStateElectra{} + require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + preBeaconState, err := state_native.InitializeFromProtoElectra(preBeaconStateBase) + require.NoError(t, err) + + postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else { + require.NoError(t, err) + } + + payload, err := blocks2.WrappedExecutionPayloadElectra(body.ExecutionPayload, big.NewInt(0)) + require.NoError(t, err) + + file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") + require.NoError(t, err) + config := &ExecutionConfig{} + require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") + + if postSSZExists { + require.NoError(t, blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload)) + require.NoError(t, blocks.ValidatePayload(preBeaconState, payload)) + require.NoError(t, transition.VerifyBlobCommitmentCount(b)) + require.NoError(t, preBeaconState.SetLatestExecutionPayloadHeader(payload)) + postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + + postBeaconState := ðpb.BeaconStateElectra{} + require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") + pbState, err := state_native.ProtobufBeaconStateElectra(preBeaconState.ToProto()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } + } else if config.Valid { + err1 := blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload) + err2 := blocks.ValidatePayload(preBeaconState, payload) + err3 := transition.VerifyBlobCommitmentCount(b) + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err1 == nil && err2 == nil && err3 == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } + }) + } +} + +type ExecutionConfig struct { + Valid bool `json:"execution_valid"` +} diff --git a/testing/spectest/shared/electra/operations/helpers.go b/testing/spectest/shared/electra/operations/helpers.go new file mode 100644 index 000000000000..67131feeef2c --- /dev/null +++ b/testing/spectest/shared/electra/operations/helpers.go @@ -0,0 +1,88 @@ +package operations + +import ( + "context" + "os" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +type blockOperation func(context.Context, state.BeaconState, interfaces.SignedBeaconBlock) (state.BeaconState, error) + +// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the +// passed in block operation function and checks the post state with the expected post state. +func RunBlockOperationTest( + t *testing.T, + folderPath string, + body *ethpb.BeaconBlockBodyElectra, + operationFn blockOperation, +) { + preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preStateBase := ðpb.BeaconStateElectra{} + if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { + t.Fatalf("Failed to unmarshal: %v", err) + } + preState, err := state_native.InitializeFromProtoElectra(preStateBase) + require.NoError(t, err) + + // If the post.ssz is not present, it means the test should fail on our end. + postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else if err != nil { + t.Fatal(err) + } + + helpers.ClearCache() + b := util.NewBeaconBlockElectra() + b.Block.Body = body + wsb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + beaconState, err := operationFn(context.Background(), preState, wsb) + if postSSZExists { + require.NoError(t, err) + + postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + + postBeaconState := ðpb.BeaconStateElectra{} + if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { + t.Fatalf("Failed to unmarshal: %v", err) + } + pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProtoUnsafe()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Error("Post state does not match expected") + } + } else { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } +} diff --git a/testing/spectest/shared/electra/operations/proposer_slashing.go b/testing/spectest/shared/electra/operations/proposer_slashing.go new file mode 100644 index 000000000000..d5f3dc3f72e8 --- /dev/null +++ b/testing/spectest/shared/electra/operations/proposer_slashing.go @@ -0,0 +1,38 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunProposerSlashingTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/proposer_slashing/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") + require.NoError(t, err) + proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) + require.NoError(t, err, "Failed to decompress") + proposerSlashing := ðpb.ProposerSlashing{} + require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) + }) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/sync_committee.go b/testing/spectest/shared/electra/operations/sync_committee.go new file mode 100644 index 000000000000..308bfd53fbf8 --- /dev/null +++ b/testing/spectest/shared/electra/operations/sync_committee.go @@ -0,0 +1,41 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunSyncCommitteeTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/sync_aggregate/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + syncCommitteeFile, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") + require.NoError(t, err) + syncCommitteeSSZ, err := snappy.Decode(nil /* dst */, syncCommitteeFile) + require.NoError(t, err, "Failed to decompress") + sc := ðpb.SyncAggregate{} + require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{SyncAggregate: sc} + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + st, _, err := electra.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) + if err != nil { + return nil, err + } + return st, nil + }) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/voluntary_exit.go b/testing/spectest/shared/electra/operations/voluntary_exit.go new file mode 100644 index 000000000000..5c479282cf43 --- /dev/null +++ b/testing/spectest/shared/electra/operations/voluntary_exit.go @@ -0,0 +1,37 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunVoluntaryExitTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/voluntary_exit/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") + require.NoError(t, err) + exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) + require.NoError(t, err, "Failed to decompress") + voluntaryExit := ðpb.SignedVoluntaryExit{} + require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) + }) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/withdrawals.go b/testing/spectest/shared/electra/operations/withdrawals.go new file mode 100644 index 000000000000..4c08dfa3d270 --- /dev/null +++ b/testing/spectest/shared/electra/operations/withdrawals.go @@ -0,0 +1,50 @@ +package operations + +import ( + "context" + "math/big" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunWithdrawalsTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawals/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + payloadFile, err := util.BazelFileBytes(folderPath, "execution_payload.ssz_snappy") + require.NoError(t, err) + payloadSSZ, err := snappy.Decode(nil /* dst */, payloadFile) + require.NoError(t, err, "Failed to decompress") + payload := &enginev1.ExecutionPayloadElectra{} + require.NoError(t, payload.UnmarshalSSZ(payloadSSZ), "failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: payload} + RunBlockOperationTest(t, folderPath, body, func(_ context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + payload, err := b.Block().Body().Execution() + if err != nil { + return nil, err + } + withdrawals, err := payload.Withdrawals() + if err != nil { + return nil, err + } + p, err := consensusblocks.WrappedExecutionPayloadElectra(&enginev1.ExecutionPayloadElectra{Withdrawals: withdrawals}, big.NewInt(0)) + require.NoError(t, err) + return blocks.ProcessWithdrawals(s, p) + }) + }) + } +} diff --git a/testing/spectest/shared/electra/rewards/BUILD.bazel b/testing/spectest/shared/electra/rewards/BUILD.bazel new file mode 100644 index 000000000000..4d6efdab2871 --- /dev/null +++ b/testing/spectest/shared/electra/rewards/BUILD.bazel @@ -0,0 +1,19 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["rewards_penalties.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/rewards", + visibility = ["//testing/spectest:__subpackages__"], + deps = [ + "//beacon-chain/core/electra:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/rewards/rewards_penalties.go b/testing/spectest/shared/electra/rewards/rewards_penalties.go new file mode 100644 index 000000000000..b89d07b6e5dd --- /dev/null +++ b/testing/spectest/shared/electra/rewards/rewards_penalties.go @@ -0,0 +1,134 @@ +package rewards + +import ( + "context" + "encoding/binary" + "fmt" + "path" + "reflect" + "strings" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +// Delta contains list of rewards and penalties. +type Delta struct { + Rewards []uint64 `json:"rewards"` + Penalties []uint64 `json:"penalties"` +} + +// unmarshalSSZ deserializes specs data into a simple aggregating container. +func (d *Delta) unmarshalSSZ(buf []byte) error { + offset1 := binary.LittleEndian.Uint32(buf[:4]) + offset2 := binary.LittleEndian.Uint32(buf[4:8]) + + for i := uint32(0); i < offset2-offset1; i += 8 { + d.Rewards = append(d.Rewards, binary.LittleEndian.Uint64(buf[offset1+i:offset1+i+8])) + d.Penalties = append(d.Penalties, binary.LittleEndian.Uint64(buf[offset2+i:offset2+i+8])) + } + return nil +} + +// RunPrecomputeRewardsAndPenaltiesTests executes "rewards/{basic, leak, random}" tests. +func RunPrecomputeRewardsAndPenaltiesTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + _, testsFolderPath := utils.TestFolders(t, config, "electra", "rewards") + testTypes, err := util.BazelListDirectories(testsFolderPath) + require.NoError(t, err) + + for _, testType := range testTypes { + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", fmt.Sprintf("rewards/%s/pyspec_tests", testType)) + for _, folder := range testFolders { + helpers.ClearCache() + t.Run(fmt.Sprintf("%v/%v", testType, folder.Name()), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + runPrecomputeRewardsAndPenaltiesTest(t, folderPath) + }) + } + } +} + +func runPrecomputeRewardsAndPenaltiesTest(t *testing.T, testFolderPath string) { + ctx := context.Background() + preBeaconStateFile, err := util.BazelFileBytes(path.Join(testFolderPath, "pre.ssz_snappy")) + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preBeaconStateBase := ðpb.BeaconStateElectra{} + require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + preBeaconState, err := state_native.InitializeFromProtoElectra(preBeaconStateBase) + require.NoError(t, err) + + vp, bp, err := electra.InitializePrecomputeValidators(ctx, preBeaconState) + require.NoError(t, err) + + vp, bp, err = electra.ProcessEpochParticipation(ctx, preBeaconState, bp, vp) + require.NoError(t, err) + + activeBal, targetPrevious, targetCurrent, err := preBeaconState.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) + + deltas, err := electra.AttestationsDelta(preBeaconState, bp, vp) + require.NoError(t, err) + + rewards := make([]uint64, len(deltas)) + penalties := make([]uint64, len(deltas)) + for i, d := range deltas { + rewards[i] = d.HeadReward + d.SourceReward + d.TargetReward + penalties[i] = d.SourcePenalty + d.TargetPenalty + d.InactivityPenalty + } + + totalSpecTestRewards := make([]uint64, len(rewards)) + totalSpecTestPenalties := make([]uint64, len(penalties)) + + // Fetch delta files. i.e. source_deltas.ssz_snappy, etc. + testfiles, err := util.BazelListFiles(path.Join(testFolderPath)) + require.NoError(t, err) + deltaFiles := make([]string, 0, len(testfiles)) + for _, tf := range testfiles { + if strings.Contains(tf, "deltas") { + deltaFiles = append(deltaFiles, tf) + } + } + if len(deltaFiles) == 0 { + t.Fatal("No delta files") + } + + for _, dFile := range deltaFiles { + sourceFile, err := util.BazelFileBytes(path.Join(testFolderPath, dFile)) + require.NoError(t, err) + sourceSSZ, err := snappy.Decode(nil /* dst */, sourceFile) + require.NoError(t, err, "Failed to decompress") + d := &Delta{} + require.NoError(t, d.unmarshalSSZ(sourceSSZ), "Failed to unmarshal") + for i, reward := range d.Rewards { + totalSpecTestRewards[i] += reward + } + for i, penalty := range d.Penalties { + totalSpecTestPenalties[i] += penalty + } + } + + if !reflect.DeepEqual(rewards, totalSpecTestRewards) { + t.Error("Rewards don't match") + t.Log(rewards) + t.Log(totalSpecTestRewards) + } + if !reflect.DeepEqual(penalties, totalSpecTestPenalties) { + t.Error("Penalties don't match") + t.Log(penalties) + t.Log(totalSpecTestPenalties) + } +} diff --git a/testing/spectest/shared/electra/sanity/BUILD.bazel b/testing/spectest/shared/electra/sanity/BUILD.bazel new file mode 100644 index 000000000000..f284008577af --- /dev/null +++ b/testing/spectest/shared/electra/sanity/BUILD.bazel @@ -0,0 +1,29 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = [ + "block_processing.go", + "block_processing.yaml.go", + "slot_processing.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/sanity", + visibility = ["//testing/spectest:__subpackages__"], + deps = [ + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", + "//consensus-types/blocks:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@io_bazel_rules_go//go/tools/bazel:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", + ], +) diff --git a/testing/spectest/shared/electra/sanity/block_processing.go b/testing/spectest/shared/electra/sanity/block_processing.go new file mode 100644 index 000000000000..d7fb00c6213a --- /dev/null +++ b/testing/spectest/shared/electra/sanity/block_processing.go @@ -0,0 +1,113 @@ +package sanity + +import ( + "context" + "fmt" + "os" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +func init() { + transition.SkipSlotCache.Disable() +} + +// RunBlockProcessingTest executes "sanity/blocks" tests. +func RunBlockProcessingTest(t *testing.T, config, folderPath string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", folderPath) + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + beaconStateBase := ðpb.BeaconStateElectra{} + require.NoError(t, beaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + beaconState, err := state_native.InitializeFromProtoElectra(beaconStateBase) + require.NoError(t, err) + + file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "meta.yaml") + require.NoError(t, err) + + metaYaml := &Config{} + require.NoError(t, utils.UnmarshalYaml(file, metaYaml), "Failed to Unmarshal") + + var transitionError error + var processedState state.BeaconState + var ok bool + for i := 0; i < metaYaml.BlocksCount; i++ { + filename := fmt.Sprintf("blocks_%d.ssz_snappy", i) + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), filename) + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block := ðpb.SignedBeaconBlockElectra{} + require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") + wsb, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + processedState, transitionError = transition.ExecuteStateTransition(context.Background(), beaconState, wsb) + if transitionError != nil { + break + } + beaconState, ok = processedState.(*state_native.BeaconState) + require.Equal(t, true, ok) + } + + // If the post.ssz is not present, it means the test should fail on our end. + postSSZFilepath, readError := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) + postSSZExists := true + if readError != nil && strings.Contains(readError.Error(), "could not locate file") { + postSSZExists = false + } else if readError != nil { + t.Fatal(readError) + } + + if postSSZExists { + if transitionError != nil { + t.Errorf("Unexpected error: %v", transitionError) + } + + postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + + postBeaconState := ðpb.BeaconStateElectra{} + require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") + pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProtoUnsafe()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } + } else { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if transitionError == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", transitionError) + return + } + }) + } +} diff --git a/testing/spectest/shared/electra/sanity/block_processing.yaml.go b/testing/spectest/shared/electra/sanity/block_processing.yaml.go new file mode 100644 index 000000000000..6ae5f478f452 --- /dev/null +++ b/testing/spectest/shared/electra/sanity/block_processing.yaml.go @@ -0,0 +1,6 @@ +package sanity + +// Config -- +type Config struct { + BlocksCount int `json:"blocks_count"` +} diff --git a/testing/spectest/shared/electra/sanity/slot_processing.go b/testing/spectest/shared/electra/sanity/slot_processing.go new file mode 100644 index 000000000000..a107afdbdcab --- /dev/null +++ b/testing/spectest/shared/electra/sanity/slot_processing.go @@ -0,0 +1,61 @@ +package sanity + +import ( + "context" + "strconv" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" +) + +func init() { + transition.SkipSlotCache.Disable() +} + +// RunSlotProcessingTests executes "sanity/slots" tests. +func RunSlotProcessingTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "sanity/slots/pyspec_tests") + + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + base := ðpb.BeaconStateElectra{} + require.NoError(t, base.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") + beaconState, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + + file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "slots.yaml") + require.NoError(t, err) + fileStr := string(file) + slotsCount, err := strconv.ParseUint(fileStr[:len(fileStr)-5], 10, 64) + require.NoError(t, err) + + postBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "post.ssz_snappy") + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + postBeaconState := ðpb.BeaconStateElectra{} + require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") + postState, err := transition.ProcessSlots(context.Background(), beaconState, beaconState.Slot().Add(slotsCount)) + require.NoError(t, err) + + pbState, err := state_native.ProtobufBeaconStateElectra(postState.ToProto()) + require.NoError(t, err) + if !proto.Equal(pbState, postBeaconState) { + t.Fatal("Did not receive expected post state") + } + }) + } +} diff --git a/testing/util/merge.go b/testing/util/merge.go index c82c42106aa6..c87b9d202705 100644 --- a/testing/util/merge.go +++ b/testing/util/merge.go @@ -35,6 +35,7 @@ func NewBeaconBlockDeneb() *ethpb.SignedBeaconBlockDeneb { return HydrateSignedBeaconBlockDeneb(ðpb.SignedBeaconBlockDeneb{}) } +// NewBeaconBlockElectra creates a beacon block with minimum marshalable fields. func NewBeaconBlockElectra() *ethpb.SignedBeaconBlockElectra { return HydrateSignedBeaconBlockElectra(ðpb.SignedBeaconBlockElectra{}) } From a35535043e5d3d272c61db43765e587e784b388d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Sat, 11 May 2024 01:49:02 +0900 Subject: [PATCH 081/325] Update state readme (#13890) * README.md for the state package * Update beacon-chain/state/state-native/README.md Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Revert "Update beacon-chain/state/state-native/README.md" This reverts commit 6a4be3bae5b4ec99d3470d3459acb032b9ad78f4. --------- Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --- beacon-chain/state/state-native/README.md | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 beacon-chain/state/state-native/README.md diff --git a/beacon-chain/state/state-native/README.md b/beacon-chain/state/state-native/README.md new file mode 100644 index 000000000000..22c0701beedd --- /dev/null +++ b/beacon-chain/state/state-native/README.md @@ -0,0 +1,24 @@ +## Adding a new field to the state + +Note: Whenever only the name of a file is provided, it's assumed to be in the `/beacon-chain/state/state-native` package. + +- Add a `BeaconState[Version]FieldCount` configuration item to `/config/params/config.go` and set it in `/config/params/mainnet_config.go`. +- Add the field to the `BeaconState` struct in `beacon_state_mainnet.go` and `beacon_state_minimal.go`. Update the marshaling code too. +- Add the field's metadata to `/beacon-chain/state/state-native/types/types.go`. +- Add a getter and a setter for the field, either to existing `getter_XXX.go`/`setter_XXX.go` files or create new ones if the field doesn't fit anywhere. +Add the new getter and setter to `/beacon-chain/state/interfaces.go`. +- Update state hashing in `hasher.go`. +- Update `ToProtoUnsafe()` and `ToProto()` functions and add a new `ProtobufBeaconState[Version]` function, all in `getters_state.go`. +- If the field is a multi-value slice, update `multi_value_slices.go`. +- Update `spec_parameters.go`. +- Update `state_trie.go`: + - Add a `[version]Fields` variable that contains all fields of the new state version. + - Add a `[version]SharedFieldRefCount` constant that represents the number of fields whose references are shared between states. + - Add an `experimentalState[Version]SharedFieldCountRef` constant that represents the number of **non multi-value slice** fields whose references are shared +between states. + - Add the following functions: `InitializeFromProto[Version]()`, `InitializeFromProtoUnsafe[Version]()`. + - Update the following functions: `Copy()`, `initializeMerkleLayers()`, `RecordStateMetrics()` (applies only to multi-value slice fields), `rootSelector()`, +`finalizerCleanup()` (applies only to multi-value slice fields). +- If the field is a slice, add it to the field map in `types.go`. +- If the field is a slice, update the `fieldConverters()` function in `/beacon-chain/state/fieldtrie/field_trie_helpers.go`. The exact implementation will vary +depending on a few factors (is the field similar to an existing one, is it a multi-value slice etc.) \ No newline at end of file From 839a80e339a57468fa8a865866242bebd7919103 Mon Sep 17 00:00:00 2001 From: terence Date: Sat, 11 May 2024 05:59:24 -0700 Subject: [PATCH 082/325] Add proposer gRPC suppot for Electra (#13984) * Add proposer RPC suppot for Electra * Kasey's feedback --- .../transition/transition_no_verify_sig.go | 2 +- .../execution/testing/mock_engine_client.go | 8 + .../rpc/prysm/v1alpha1/validator/blocks.go | 13 + .../validator/construct_generic_block.go | 14 + .../validator/construct_generic_block_test.go | 25 + .../validator/proposer_empty_block.go | 22 +- .../validator/proposer_empty_block_test.go | 10 + .../validator/proposer_execution_payload.go | 2 +- .../prysm/v1alpha1/validator/proposer_test.go | 153 ++ proto/prysm/v1alpha1/validator.pb.go | 1781 +++++++++-------- proto/prysm/v1alpha1/validator.proto | 3 + 11 files changed, 1144 insertions(+), 889 deletions(-) diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index 3fd4a7bb058d..c4c357dfea2c 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -257,7 +257,7 @@ func ProcessOperationsNoVerifyAttsSigs( if err != nil { return nil, err } - case version.Altair, version.Bellatrix, version.Capella, version.Deneb: + case version.Altair, version.Bellatrix, version.Capella, version.Deneb, version.Electra: state, err = altairOperations(ctx, state, beaconBlock) if err != nil { return nil, err diff --git a/beacon-chain/execution/testing/mock_engine_client.go b/beacon-chain/execution/testing/mock_engine_client.go index 4edc0f8b7411..d6ca8b23f74d 100644 --- a/beacon-chain/execution/testing/mock_engine_client.go +++ b/beacon-chain/execution/testing/mock_engine_client.go @@ -26,6 +26,7 @@ type EngineClient struct { ExecutionPayload *pb.ExecutionPayload ExecutionPayloadCapella *pb.ExecutionPayloadCapella ExecutionPayloadDeneb *pb.ExecutionPayloadDeneb + ExecutionPayloadElectra *pb.ExecutionPayloadElectra ExecutionBlock *pb.ExecutionBlock Err error ErrLatestExecBlock error @@ -61,6 +62,13 @@ func (e *EngineClient) ForkchoiceUpdated( // GetPayload -- func (e *EngineClient) GetPayload(_ context.Context, _ [8]byte, s primitives.Slot) (interfaces.ExecutionData, *pb.BlobsBundle, bool, error) { + if slots.ToEpoch(s) >= params.BeaconConfig().ElectraForkEpoch { + ed, err := blocks.WrappedExecutionPayloadElectra(e.ExecutionPayloadElectra, big.NewInt(int64(e.BlockValue))) + if err != nil { + return nil, nil, false, err + } + return ed, e.BlobsBundle, e.BuilderOverride, nil + } if slots.ToEpoch(s) >= params.BeaconConfig().DenebForkEpoch { ed, err := blocks.WrappedExecutionPayloadDeneb(e.ExecutionPayloadDeneb, big.NewInt(int64(e.BlockValue))) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go index 5ba4afcd2063..49f13afcb8db 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go @@ -159,6 +159,17 @@ func sendVerifiedBlocks(stream ethpb.BeaconNodeValidator_StreamBlocksAltairServe return nil } b.Block = ðpb.StreamBlocksResponse_DenebBlock{DenebBlock: phBlk} + case version.Electra: + pb, err := data.SignedBlock.Proto() + if err != nil { + return errors.Wrap(err, "could not get protobuf block") + } + phBlk, ok := pb.(*ethpb.SignedBeaconBlockElectra) + if !ok { + log.Warn("Mismatch between version and block type, was expecting SignedBeaconBlockElectra") + return nil + } + b.Block = ðpb.StreamBlocksResponse_ElectraBlock{ElectraBlock: phBlk} } if err := stream.Send(b); err != nil { @@ -210,6 +221,8 @@ func (vs *Server) sendBlocks(stream ethpb.BeaconNodeValidator_StreamBlocksAltair b.Block = ðpb.StreamBlocksResponse_CapellaBlock{CapellaBlock: p} case *ethpb.SignedBeaconBlockDeneb: b.Block = ðpb.StreamBlocksResponse_DenebBlock{DenebBlock: p} + case *ethpb.SignedBeaconBlockElectra: + b.Block = ðpb.StreamBlocksResponse_ElectraBlock{ElectraBlock: p} default: log.Errorf("Unknown block type %T", p) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go index 2a65b4365707..88e935e118f4 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go @@ -26,6 +26,8 @@ func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, payloadValue := sBlk.ValueInWei() switch sBlk.Version() { + case version.Electra: + return vs.constructElectraBlock(blockProto, isBlinded, payloadValue, blobsBundle), nil case version.Deneb: return vs.constructDenebBlock(blockProto, isBlinded, payloadValue, blobsBundle), nil case version.Capella: @@ -42,6 +44,18 @@ func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, } // Helper functions for constructing blocks for each version +func (vs *Server) constructElectraBlock(blockProto proto.Message, isBlinded bool, payloadValue math.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { + if isBlinded { + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedElectra{BlindedElectra: blockProto.(*ethpb.BlindedBeaconBlockElectra)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} + } + electraContents := ðpb.BeaconBlockContentsElectra{Block: blockProto.(*ethpb.BeaconBlockElectra)} + if bundle != nil { + electraContents.KzgProofs = bundle.Proofs + electraContents.Blobs = bundle.Blobs + } + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Electra{Electra: electraContents}, IsBlinded: false, PayloadValue: (*payloadValue).String()} +} + func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue math.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { if isBlinded { return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blockProto.(*ethpb.BlindedBeaconBlockDeneb)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go index a4b4fe28d8e5..53787b276df9 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go @@ -21,6 +21,31 @@ func TestConstructGenericBeaconBlock(t *testing.T) { require.ErrorContains(t, "block cannot be nil", err) }) + // Test for Electra version + t.Run("electra block", func(t *testing.T) { + eb := util.NewBeaconBlockElectra() + eb.Block.Body.Consolidations = []*eth.SignedConsolidation{ + { + Signature: make([]byte, 96), + Message: ð.Consolidation{ + SourceIndex: 1, + TargetIndex: 2, + Epoch: 3, + }, + }, + } + b, err := blocks.NewSignedBeaconBlock(eb) + require.NoError(t, err) + r1, err := eb.Block.HashTreeRoot() + require.NoError(t, err) + result, err := vs.constructGenericBeaconBlock(b, nil) + require.NoError(t, err) + r2, err := result.GetElectra().Block.HashTreeRoot() + require.NoError(t, err) + require.Equal(t, r1, r2) + require.Equal(t, result.IsBlinded, false) + }) + // Test for Deneb version t.Run("deneb block", func(t *testing.T) { eb := util.NewBeaconBlockDeneb() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block.go index 3697546533b1..01ea1d46df18 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block.go @@ -14,29 +14,35 @@ import ( func getEmptyBlock(slot primitives.Slot) (interfaces.SignedBeaconBlock, error) { var sBlk interfaces.SignedBeaconBlock var err error + epoch := slots.ToEpoch(slot) switch { - case slots.ToEpoch(slot) < params.BeaconConfig().AltairForkEpoch: - sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: ðpb.BeaconBlock{Body: ðpb.BeaconBlockBody{}}}) + case epoch >= params.BeaconConfig().ElectraForkEpoch: + sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: ðpb.BeaconBlockElectra{Body: ðpb.BeaconBlockBodyElectra{}}}) if err != nil { return nil, status.Errorf(codes.Internal, "Could not initialize block for proposal: %v", err) } - case slots.ToEpoch(slot) < params.BeaconConfig().BellatrixForkEpoch: - sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockAltair{Block: ðpb.BeaconBlockAltair{Body: ðpb.BeaconBlockBodyAltair{}}}) + case epoch >= params.BeaconConfig().DenebForkEpoch: + sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{Block: ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{}}}) if err != nil { return nil, status.Errorf(codes.Internal, "Could not initialize block for proposal: %v", err) } - case slots.ToEpoch(slot) < params.BeaconConfig().CapellaForkEpoch: + case epoch >= params.BeaconConfig().CapellaForkEpoch: + sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockCapella{Block: ðpb.BeaconBlockCapella{Body: ðpb.BeaconBlockBodyCapella{}}}) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not initialize block for proposal: %v", err) + } + case epoch >= params.BeaconConfig().BellatrixForkEpoch: sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockBellatrix{Block: ðpb.BeaconBlockBellatrix{Body: ðpb.BeaconBlockBodyBellatrix{}}}) if err != nil { return nil, status.Errorf(codes.Internal, "Could not initialize block for proposal: %v", err) } - case slots.ToEpoch(slot) < params.BeaconConfig().DenebForkEpoch: - sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockCapella{Block: ðpb.BeaconBlockCapella{Body: ðpb.BeaconBlockBodyCapella{}}}) + case epoch >= params.BeaconConfig().AltairForkEpoch: + sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockAltair{Block: ðpb.BeaconBlockAltair{Body: ðpb.BeaconBlockBodyAltair{}}}) if err != nil { return nil, status.Errorf(codes.Internal, "Could not initialize block for proposal: %v", err) } default: - sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{Block: ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{}}}) + sBlk, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: ðpb.BeaconBlock{Body: ðpb.BeaconBlockBody{}}}) if err != nil { return nil, status.Errorf(codes.Internal, "Could not initialize block for proposal: %v", err) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block_test.go index aeeb28426e11..122dc1fcccf2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_empty_block_test.go @@ -18,6 +18,7 @@ func Test_getEmptyBlock(t *testing.T) { config.BellatrixForkEpoch = 2 config.CapellaForkEpoch = 3 config.DenebForkEpoch = 4 + config.ElectraForkEpoch = 5 params.OverrideBeaconConfig(config) tests := []struct { @@ -61,6 +62,15 @@ func Test_getEmptyBlock(t *testing.T) { return b }, }, + { + name: "electra", + slot: primitives.Slot(params.BeaconConfig().ElectraForkEpoch) * params.BeaconConfig().SlotsPerEpoch, + want: func() interfaces.ReadOnlySignedBeaconBlock { + b, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: ðpb.BeaconBlockElectra{Body: ðpb.BeaconBlockBodyElectra{}}}) + require.NoError(t, err) + return b + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 4605901cff13..8f75edef34b3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -127,7 +127,7 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe } var attr payloadattribute.Attributer switch st.Version() { - case version.Deneb: + case version.Deneb, version.Electra: withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { return nil, false, err diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 9e1144fcf1a1..e6c665c999b6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -549,6 +549,132 @@ func TestServer_GetBeaconBlock_Deneb(t *testing.T) { require.DeepEqual(t, got.GetDeneb().Block.Body.BlobKzgCommitments, kc) } +func TestServer_GetBeaconBlock_Electra(t *testing.T) { + db := dbutil.SetupDB(t) + ctx := context.Background() + transition.SkipSlotCache.Disable() + + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = 5 + cfg.DenebForkEpoch = 4 + cfg.CapellaForkEpoch = 3 + cfg.BellatrixForkEpoch = 2 + cfg.AltairForkEpoch = 1 + params.OverrideBeaconConfig(cfg) + beaconState, privKeys := util.DeterministicGenesisState(t, 64) + + stateRoot, err := beaconState.HashTreeRoot(ctx) + require.NoError(t, err, "Could not hash genesis state") + + genesis := b.NewGenesisBlock(stateRoot[:]) + util.SaveBlock(t, ctx, db, genesis) + + parentRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + require.NoError(t, db.SaveState(ctx, beaconState, parentRoot), "Could not save genesis state") + require.NoError(t, db.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") + + electraSlot, err := slots.EpochStart(params.BeaconConfig().ElectraForkEpoch) + require.NoError(t, err) + + var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte + blk := ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{ + Slot: electraSlot + 1, + ParentRoot: parentRoot[:], + StateRoot: genesis.Block.StateRoot, + Body: ðpb.BeaconBlockBodyElectra{ + Consolidations: []*ethpb.SignedConsolidation{ + { + Message: ðpb.Consolidation{ + SourceIndex: 1, + TargetIndex: 2, + Epoch: 3, + }, + Signature: bytesutil.PadTo([]byte("sig"), 96), + }, + }, + RandaoReveal: genesis.Block.Body.RandaoReveal, + Graffiti: genesis.Block.Body.Graffiti, + Eth1Data: genesis.Block.Body.Eth1Data, + SyncAggregate: ðpb.SyncAggregate{SyncCommitteeBits: scBits[:], SyncCommitteeSignature: make([]byte, 96)}, + ExecutionPayload: &enginev1.ExecutionPayloadElectra{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: make([]byte, fieldparams.RootLength), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + }, + }, + } + + blkRoot, err := blk.Block.HashTreeRoot() + require.NoError(t, err) + require.NoError(t, err, "Could not get signing root") + require.NoError(t, db.SaveState(ctx, beaconState, blkRoot), "Could not save genesis state") + require.NoError(t, db.SaveHeadBlockRoot(ctx, blkRoot), "Could not save genesis state") + + random, err := helpers.RandaoMix(beaconState, slots.ToEpoch(beaconState.Slot())) + require.NoError(t, err) + timeStamp, err := slots.ToTime(beaconState.GenesisTime(), electraSlot+1) + require.NoError(t, err) + dr := []*enginev1.DepositReceipt{{ + Pubkey: bytesutil.PadTo(privKeys[0].PublicKey().Marshal(), 48), + WithdrawalCredentials: bytesutil.PadTo([]byte("wc"), 32), + Amount: 123, + Signature: bytesutil.PadTo([]byte("sig"), 96), + Index: 456, + }} + wr := []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: bytesutil.PadTo([]byte("sa"), 20), + ValidatorPubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), + Amount: 789, + }, + } + payload := &enginev1.ExecutionPayloadElectra{ + Timestamp: uint64(timeStamp.Unix()), + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: random, + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + DepositReceipts: dr, + WithdrawalRequests: wr, + } + + proposerServer := getProposerServer(db, beaconState, parentRoot[:]) + proposerServer.ExecutionEngineCaller = &mockExecution.EngineClient{ + PayloadIDBytes: &enginev1.PayloadIDBytes{1}, + ExecutionPayloadElectra: payload, + } + + randaoReveal, err := util.RandaoReveal(beaconState, 0, privKeys) + require.NoError(t, err) + + graffiti := bytesutil.ToBytes32([]byte("eth2")) + require.NoError(t, err) + req := ðpb.BlockRequest{ + Slot: electraSlot + 1, + RandaoReveal: randaoReveal, + Graffiti: graffiti[:], + } + + got, err := proposerServer.GetBeaconBlock(ctx, req) + require.NoError(t, err) + p := got.GetElectra().Block.Body.ExecutionPayload + require.DeepEqual(t, dr, p.DepositReceipts) + require.DeepEqual(t, wr, p.WithdrawalRequests) +} + func TestServer_GetBeaconBlock_Optimistic(t *testing.T) { params.SetupTestConfigCleanup(t) cfg := params.BeaconConfig().Copy() @@ -744,6 +870,33 @@ func TestProposer_ProposeBlock_OK(t *testing.T) { }, err: "blob KZG commitments don't match number of blobs or KZG proofs", }, + { + name: "electra block no blob", + block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { + sb := ðpb.SignedBeaconBlockContentsElectra{ + Block: ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{Slot: 5, ParentRoot: parent[:], Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{})}, + }, + } + blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} + return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} + }, + }, + { + name: "electra block some blob", + block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { + + sb := ðpb.SignedBeaconBlockContentsElectra{ + Block: ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{Slot: 5, ParentRoot: parent[:], Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{})}, + }, + KzgProofs: [][]byte{{0x01}, {0x02}, {0x03}}, + Blobs: [][]byte{{0x01}, {0x02}, {0x03}}, + } + blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} + return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} + }, + }, { name: "blind deneb block some blobs", block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { diff --git a/proto/prysm/v1alpha1/validator.pb.go b/proto/prysm/v1alpha1/validator.pb.go index 55edb0726f56..c88f93a09fd0 100755 --- a/proto/prysm/v1alpha1/validator.pb.go +++ b/proto/prysm/v1alpha1/validator.pb.go @@ -370,6 +370,7 @@ type StreamBlocksResponse struct { // *StreamBlocksResponse_BellatrixBlock // *StreamBlocksResponse_CapellaBlock // *StreamBlocksResponse_DenebBlock + // *StreamBlocksResponse_ElectraBlock Block isStreamBlocksResponse_Block `protobuf_oneof:"block"` } @@ -447,6 +448,13 @@ func (x *StreamBlocksResponse) GetDenebBlock() *SignedBeaconBlockDeneb { return nil } +func (x *StreamBlocksResponse) GetElectraBlock() *SignedBeaconBlockElectra { + if x, ok := x.GetBlock().(*StreamBlocksResponse_ElectraBlock); ok { + return x.ElectraBlock + } + return nil +} + type isStreamBlocksResponse_Block interface { isStreamBlocksResponse_Block() } @@ -471,6 +479,10 @@ type StreamBlocksResponse_DenebBlock struct { DenebBlock *SignedBeaconBlockDeneb `protobuf:"bytes,5,opt,name=deneb_block,json=denebBlock,proto3,oneof"` } +type StreamBlocksResponse_ElectraBlock struct { + ElectraBlock *SignedBeaconBlockElectra `protobuf:"bytes,6,opt,name=electra_block,json=electraBlock,proto3,oneof"` +} + func (*StreamBlocksResponse_Phase0Block) isStreamBlocksResponse_Block() {} func (*StreamBlocksResponse_AltairBlock) isStreamBlocksResponse_Block() {} @@ -481,6 +493,8 @@ func (*StreamBlocksResponse_CapellaBlock) isStreamBlocksResponse_Block() {} func (*StreamBlocksResponse_DenebBlock) isStreamBlocksResponse_Block() {} +func (*StreamBlocksResponse_ElectraBlock) isStreamBlocksResponse_Block() {} + type DomainRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3040,7 +3054,7 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{ 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0xcf, 0x03, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, + 0x01, 0x22, 0xa7, 0x04, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, @@ -3068,834 +3082,840 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{ 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x65, - 0x62, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x22, 0x85, 0x01, 0x0a, 0x0d, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x3b, 0x0a, 0x0e, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, - 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x47, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, - 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x73, 0x22, 0xcd, 0x02, 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x55, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0xd6, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x46, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x22, 0x91, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x4b, 0x0a, 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x12, - 0x21, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, - 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x15, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x22, 0x3f, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x22, 0xc5, 0x03, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x39, 0x0a, 0x19, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x16, 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, 0x16, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, - 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, - 0x6f, 0x74, 0x52, 0x14, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x71, 0x0a, 0x10, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0f, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3f, 0x0a, 0x1c, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x19, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x1e, - 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, + 0x62, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, + 0x52, 0x0c, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x02, + 0x18, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x85, 0x01, 0x0a, 0x0d, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, + 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x22, 0x3b, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x22, 0x47, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x64, - 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, - 0x63, 0x65, 0x73, 0x22, 0x83, 0x02, 0x0a, 0x1f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, - 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x73, 0x12, 0x4a, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x69, - 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, - 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0d, 0x44, 0x75, - 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, - 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x73, 0x22, 0xd3, 0x07, 0x0a, 0x0e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, - 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x75, 0x74, - 0x79, 0x52, 0x12, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x44, - 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x5f, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x75, 0x74, 0x79, 0x52, 0x0f, 0x6e, 0x65, - 0x78, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x84, 0x06, - 0x0a, 0x04, 0x44, 0x75, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x6a, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0c, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xcd, 0x02, 0x0a, 0x1b, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x08, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, + 0x1a, 0xd6, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x46, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x91, 0x01, 0x0a, 0x12, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, + 0x17, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x4b, 0x0a, + 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x15, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x16, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, - 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x73, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x41, 0x74, - 0x53, 0x6c, 0x6f, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xb0, 0x02, 0x0a, 0x0c, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, - 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, - 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, - 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x6b, 0x69, 0x70, 0x5f, - 0x6d, 0x65, 0x76, 0x5f, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x73, 0x6b, 0x69, 0x70, 0x4d, 0x65, 0x76, 0x42, 0x6f, 0x6f, 0x73, 0x74, 0x12, 0x4e, 0x0a, - 0x14, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x5f, 0x66, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x42, 0x6f, 0x6f, 0x73, 0x74, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x38, 0x0a, - 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x3a, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, - 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x52, - 0x6f, 0x6f, 0x74, 0x22, 0xed, 0x01, 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x59, - 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x22, 0x4c, 0x0a, 0x0e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x15, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6f, - 0x74, 0x22, 0xd0, 0x02, 0x0a, 0x19, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, - 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x3f, 0x0a, 0x16, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, + 0x38, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0xc5, 0x03, 0x0a, + 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x65, 0x74, 0x68, 0x31, + 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x65, 0x74, 0x68, + 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, 0x16, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, - 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0d, 0x73, 0x6c, 0x6f, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x1a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x13, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x11, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x96, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x76, 0x0a, 0x1a, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, - 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x17, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x22, 0x5b, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x15, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, - 0x02, 0x0a, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, - 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x05, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x05, 0x73, 0x6c, 0x6f, 0x74, 0x73, - 0x12, 0x74, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x49, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0c, 0x69, - 0x73, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x9e, 0x05, 0x0a, 0x09, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, - 0x12, 0x88, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x14, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, + 0x12, 0x71, 0x0a, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x3f, 0x0a, 0x1c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x6e, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x71, 0x75, + 0x65, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, + 0x75, 0x65, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x1e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, + 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x03, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x83, 0x02, 0x0a, 0x1f, + 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x4a, 0x0a, 0x08, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, - 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x69, 0x67, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x71, 0x0a, 0x10, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0f, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x65, - 0x0a, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0d, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x09, 0x65, 0x78, 0x69, 0x74, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x75, 0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, + 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xd3, 0x07, 0x0a, + 0x0e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5c, 0x0a, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x5f, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x75, 0x74, 0x79, 0x52, 0x12, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x56, 0x0a, + 0x11, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x64, 0x75, 0x74, 0x69, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x44, 0x75, 0x74, 0x79, 0x52, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x44, + 0x75, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x84, 0x06, 0x0a, 0x04, 0x44, 0x75, 0x74, 0x79, 0x12, 0x6d, + 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x8e, 0x05, 0x0a, - 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x19, 0x67, 0x6c, 0x6f, 0x62, 0x61, - 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x42, 0x02, 0x18, 0x01, 0x52, 0x17, - 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x64, - 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, - 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x45, 0x74, 0x68, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x0e, - 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0d, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, - 0x6c, 0x65, 0x45, 0x74, 0x68, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, - 0x67, 0x77, 0x65, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x77, - 0x65, 0x69, 0x12, 0x3f, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, - 0x65, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, - 0x77, 0x65, 0x69, 0x12, 0x4c, 0x0a, 0x23, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x1f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, - 0x69, 0x12, 0x3b, 0x0a, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x41, - 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, - 0x69, 0x12, 0x4e, 0x0a, 0x24, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, - 0x69, 0x12, 0x4a, 0x0a, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1e, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x22, 0xad, 0x03, - 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, - 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xce, 0x02, - 0x0a, 0x13, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, - 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x1a, 0xca, 0x01, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, - 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x78, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xe4, - 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x6f, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x75, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x45, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x3d, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, - 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, - 0x3a, 0x02, 0x18, 0x01, 0x22, 0xca, 0x02, 0x0a, 0x1c, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x69, 0x0a, 0x0a, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, - 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, - 0x1a, 0xbe, 0x01, 0x0a, 0x15, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, - 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x22, 0x4e, 0x0a, 0x1b, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x22, 0x4b, 0x0a, 0x1c, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, - 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x91, - 0x01, 0x0a, 0x1e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, + 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x6c, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, + 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, + 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, + 0x73, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x2c, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x5f, + 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x41, 0x74, 0x53, 0x6c, 0x6f, 0x74, 0x4a, 0x04, 0x08, 0x01, + 0x10, 0x02, 0x22, 0xb0, 0x02, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2b, + 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0c, 0x72, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x08, 0x67, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, + 0x24, 0x0a, 0x0e, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x6d, 0x65, 0x76, 0x5f, 0x62, 0x6f, 0x6f, 0x73, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x6b, 0x69, 0x70, 0x4d, 0x65, 0x76, + 0x42, 0x6f, 0x6f, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x14, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x5f, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x12, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x6f, 0x6f, 0x73, 0x74, 0x46, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x38, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0x3a, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xed, 0x01, 0x0a, 0x16, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x4c, 0x0a, 0x0e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, + 0x15, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xd0, 0x02, 0x0a, 0x19, 0x41, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2f, 0x0a, 0x0a, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, + 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, + 0x0e, 0x73, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0d, 0x73, + 0x6c, 0x6f, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, + 0x1a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x13, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x11, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x22, 0x96, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x76, 0x0a, 0x1a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x52, 0x17, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x5b, 0x0a, 0x1d, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x15, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x02, 0x0a, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x05, 0x73, + 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, + 0x74, 0x52, 0x05, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x74, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, + 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x64, 0x73, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x22, 0x9e, 0x05, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x88, 0x02, 0x0a, 0x26, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, - 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x59, - 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x88, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x71, 0x0a, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, + 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x65, 0x0a, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x09, 0x65, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x75, 0x0a, + 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x22, 0x8e, 0x05, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x3e, 0x0a, 0x19, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x02, 0x42, 0x02, 0x18, 0x01, 0x52, 0x17, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, + 0x23, 0x0a, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x0e, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, + 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, + 0x52, 0x0d, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x45, 0x74, 0x68, 0x65, 0x72, 0x12, + 0x39, 0x0a, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x3f, 0x0a, 0x1c, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x4c, 0x0a, 0x23, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, + 0x65, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x3b, 0x0a, 0x1a, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x41, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x4e, 0x0a, 0x24, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, + 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, + 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x4a, 0x0a, 0x22, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x47, 0x77, 0x65, 0x69, 0x22, 0xad, 0x03, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5c, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, + 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, - 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x75, - 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x64, 0x0a, - 0x27, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, - 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x12, - 0x12, 0x0a, 0x04, 0x62, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, - 0x69, 0x74, 0x73, 0x2a, 0x9a, 0x01, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, - 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, - 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, - 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, - 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x0a, - 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, - 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x08, - 0x32, 0xa8, 0x24, 0x0a, 0x13, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, - 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x0a, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, + 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xce, 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, + 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, + 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0xca, 0x01, 0x0a, 0x10, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, + 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, + 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, + 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x27, 0x0a, + 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x70, 0x70, 0x65, + 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, + 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x6f, 0x0a, 0x11, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x75, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x3d, 0x0a, + 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3e, 0x0a, 0x13, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xca, 0x02, 0x0a, + 0x1c, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x69, 0x0a, + 0x0a, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x49, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0xbe, 0x01, 0x0a, 0x15, 0x46, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, + 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x4e, 0x0a, 0x1b, 0x46, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, + 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x4b, 0x0a, 0x1c, 0x46, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, + 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x1e, 0x41, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, + 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, - 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, - 0x8e, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x29, 0x2e, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x88, 0x02, 0x0a, 0x26, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x25, + 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x64, 0x0a, 0x27, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x69, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x69, 0x74, 0x73, 0x2a, 0x9a, 0x01, 0x0a, 0x0f, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, + 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x45, + 0x58, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4c, 0x41, 0x53, + 0x48, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, + 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x07, 0x12, + 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x44, 0x45, 0x50, + 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x08, 0x32, 0xa8, 0x24, 0x0a, 0x13, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x12, 0x80, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x75, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, + 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xaf, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, + 0x74, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x30, 0x01, 0x12, 0x94, 0x01, 0x0a, 0x0e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, - 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, 0x01, - 0x12, 0xaf, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x30, 0x01, 0x12, 0x94, 0x01, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, - 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, - 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xb2, 0x01, 0x0a, + 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, + 0x20, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, + 0x73, 0x12, 0x87, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x97, 0x01, 0x0a, 0x12, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0xa0, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, + 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, 0x22, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x0e, 0x47, 0x65, - 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x65, + 0x2f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0xbf, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, + 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, + 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x01, 0x2a, 0x22, 0x30, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, + 0x62, 0x79, 0x5f, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, + 0x12, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8f, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, - 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x25, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x12, 0x97, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x26, 0x2e, 0x65, 0x74, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, + 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0xa0, 0x01, - 0x0a, 0x15, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, 0x22, - 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, - 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x12, 0xbf, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x01, 0x2a, - 0x22, 0x30, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x75, 0x62, 0x5f, 0x6b, - 0x65, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0xbe, 0x01, 0x0a, + 0x23, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8f, 0x01, - 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x65, 0x74, 0x68, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, - 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x12, 0xbe, 0x01, 0x0a, 0x23, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x33, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, - 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, - 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, - 0x6e, 0x65, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, - 0x22, 0x28, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x11, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, - 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, - 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, + 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x8e, 0x01, + 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x2a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, + 0x22, 0x1c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0xa1, + 0x01, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x70, 0x70, 0x65, - 0x6c, 0x67, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x9f, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, - 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x33, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, + 0x62, 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x33, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, - 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xb4, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, - 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x6f, 0x70, 0x70, + 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, + 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x67, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, + 0x9f, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, + 0x12, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0xc4, 0x01, 0x0a, - 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xb4, 0x01, + 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0xc4, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0xaf, 0x01, 0x0a, 0x20, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x40, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x3a, 0x3a, 0x01, 0x2a, 0x22, 0x35, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x9e, 0x01, + 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, - 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0xaf, 0x01, 0x0a, 0x20, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x01, 0x2a, 0x22, 0x35, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xa1, + 0x01, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x41, + 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x6f, 0x74, - 0x73, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0x9e, 0x01, 0x0a, 0x1c, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xae, 0x01, 0x0a, 0x17, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, - 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, - 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, - 0x2a, 0x22, 0x39, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0xec, 0x01, 0x0a, - 0x1f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, - 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, - 0x12, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, + 0x30, 0x01, 0x12, 0x9e, 0x01, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0xae, 0x01, 0x0a, 0x17, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, + 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x44, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x75, + 0x62, 0x6e, 0x65, 0x74, 0x12, 0xec, 0x01, 0x0a, 0x1f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x3e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x42, 0x93, 0x01, 0x0a, 0x19, - 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, + 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, + 0x42, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x5f, 0x61, + 0x6e, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, + 0x69, 0x74, 0x73, 0x42, 0x93, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, + 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, + 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -3967,19 +3987,20 @@ var file_proto_prysm_v1alpha1_validator_proto_goTypes = []interface{}{ (*SignedBeaconBlockBellatrix)(nil), // 51: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix (*SignedBeaconBlockCapella)(nil), // 52: ethereum.eth.v1alpha1.SignedBeaconBlockCapella (*SignedBeaconBlockDeneb)(nil), // 53: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - (*wrapperspb.UInt64Value)(nil), // 54: google.protobuf.UInt64Value - (*AggregateAttestationAndProof)(nil), // 55: ethereum.eth.v1alpha1.AggregateAttestationAndProof - (*SignedAggregateAttestationAndProof)(nil), // 56: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof - (*SyncCommitteeMessage)(nil), // 57: ethereum.eth.v1alpha1.SyncCommitteeMessage - (*emptypb.Empty)(nil), // 58: google.protobuf.Empty - (*GenericSignedBeaconBlock)(nil), // 59: ethereum.eth.v1alpha1.GenericSignedBeaconBlock - (*Attestation)(nil), // 60: ethereum.eth.v1alpha1.Attestation - (*SignedVoluntaryExit)(nil), // 61: ethereum.eth.v1alpha1.SignedVoluntaryExit - (*SignedContributionAndProof)(nil), // 62: ethereum.eth.v1alpha1.SignedContributionAndProof - (*SignedValidatorRegistrationsV1)(nil), // 63: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - (*GenericBeaconBlock)(nil), // 64: ethereum.eth.v1alpha1.GenericBeaconBlock - (*AttestationData)(nil), // 65: ethereum.eth.v1alpha1.AttestationData - (*SyncCommitteeContribution)(nil), // 66: ethereum.eth.v1alpha1.SyncCommitteeContribution + (*SignedBeaconBlockElectra)(nil), // 54: ethereum.eth.v1alpha1.SignedBeaconBlockElectra + (*wrapperspb.UInt64Value)(nil), // 55: google.protobuf.UInt64Value + (*AggregateAttestationAndProof)(nil), // 56: ethereum.eth.v1alpha1.AggregateAttestationAndProof + (*SignedAggregateAttestationAndProof)(nil), // 57: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof + (*SyncCommitteeMessage)(nil), // 58: ethereum.eth.v1alpha1.SyncCommitteeMessage + (*emptypb.Empty)(nil), // 59: google.protobuf.Empty + (*GenericSignedBeaconBlock)(nil), // 60: ethereum.eth.v1alpha1.GenericSignedBeaconBlock + (*Attestation)(nil), // 61: ethereum.eth.v1alpha1.Attestation + (*SignedVoluntaryExit)(nil), // 62: ethereum.eth.v1alpha1.SignedVoluntaryExit + (*SignedContributionAndProof)(nil), // 63: ethereum.eth.v1alpha1.SignedContributionAndProof + (*SignedValidatorRegistrationsV1)(nil), // 64: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + (*GenericBeaconBlock)(nil), // 65: ethereum.eth.v1alpha1.GenericBeaconBlock + (*AttestationData)(nil), // 66: ethereum.eth.v1alpha1.AttestationData + (*SyncCommitteeContribution)(nil), // 67: ethereum.eth.v1alpha1.SyncCommitteeContribution } var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ 49, // 0: ethereum.eth.v1alpha1.StreamBlocksResponse.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock @@ -3987,83 +4008,84 @@ var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ 51, // 2: ethereum.eth.v1alpha1.StreamBlocksResponse.bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix 52, // 3: ethereum.eth.v1alpha1.StreamBlocksResponse.capella_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella 53, // 4: ethereum.eth.v1alpha1.StreamBlocksResponse.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - 44, // 5: ethereum.eth.v1alpha1.ValidatorActivationResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorActivationResponse.Status - 0, // 6: ethereum.eth.v1alpha1.ValidatorStatusResponse.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 16, // 7: ethereum.eth.v1alpha1.MultipleValidatorStatusResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 45, // 8: ethereum.eth.v1alpha1.DutiesResponse.current_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty - 45, // 9: ethereum.eth.v1alpha1.DutiesResponse.next_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty - 54, // 10: ethereum.eth.v1alpha1.BlockRequest.builder_boost_factor:type_name -> google.protobuf.UInt64Value - 55, // 11: ethereum.eth.v1alpha1.AggregateSelectionResponse.aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof - 56, // 12: ethereum.eth.v1alpha1.SignedAggregateSubmitRequest.signed_aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof - 0, // 13: ethereum.eth.v1alpha1.ValidatorInfo.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 46, // 14: ethereum.eth.v1alpha1.DoppelGangerRequest.validator_requests:type_name -> ethereum.eth.v1alpha1.DoppelGangerRequest.ValidatorRequest - 47, // 15: ethereum.eth.v1alpha1.DoppelGangerResponse.responses:type_name -> ethereum.eth.v1alpha1.DoppelGangerResponse.ValidatorResponse - 48, // 16: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.recipients:type_name -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.FeeRecipientContainer - 0, // 17: ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 57, // 18: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest.msgs:type_name -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 16, // 19: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 0, // 20: ethereum.eth.v1alpha1.DutiesResponse.Duty.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 19, // 21: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:input_type -> ethereum.eth.v1alpha1.DutiesRequest - 7, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:input_type -> ethereum.eth.v1alpha1.DomainRequest - 58, // 23: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:input_type -> google.protobuf.Empty - 9, // 24: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:input_type -> ethereum.eth.v1alpha1.ValidatorActivationRequest - 13, // 25: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:input_type -> ethereum.eth.v1alpha1.ValidatorIndexRequest - 15, // 26: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:input_type -> ethereum.eth.v1alpha1.ValidatorStatusRequest - 17, // 27: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:input_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusRequest - 21, // 28: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest - 59, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:input_type -> ethereum.eth.v1alpha1.GenericSignedBeaconBlock - 38, // 30: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:input_type -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest - 39, // 31: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest - 24, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest - 60, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation - 26, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest - 28, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest - 61, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 30, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest - 34, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest - 58, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty - 57, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 2, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest - 3, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest - 62, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof - 36, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest - 37, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest - 63, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - 41, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest - 42, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest - 20, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse - 8, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse - 11, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse - 10, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse - 14, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse - 16, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 18, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse - 64, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock - 22, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse - 58, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty - 40, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse - 65, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData - 25, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse - 27, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse - 29, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse - 23, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse - 58, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty - 35, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse - 1, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse - 58, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty - 4, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse - 66, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution - 58, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty - 5, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse - 6, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse - 58, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty - 58, // 75: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:output_type -> google.protobuf.Empty - 43, // 76: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:output_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse - 49, // [49:77] is the sub-list for method output_type - 21, // [21:49] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 54, // 5: ethereum.eth.v1alpha1.StreamBlocksResponse.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra + 44, // 6: ethereum.eth.v1alpha1.ValidatorActivationResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorActivationResponse.Status + 0, // 7: ethereum.eth.v1alpha1.ValidatorStatusResponse.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 16, // 8: ethereum.eth.v1alpha1.MultipleValidatorStatusResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse + 45, // 9: ethereum.eth.v1alpha1.DutiesResponse.current_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty + 45, // 10: ethereum.eth.v1alpha1.DutiesResponse.next_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty + 55, // 11: ethereum.eth.v1alpha1.BlockRequest.builder_boost_factor:type_name -> google.protobuf.UInt64Value + 56, // 12: ethereum.eth.v1alpha1.AggregateSelectionResponse.aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof + 57, // 13: ethereum.eth.v1alpha1.SignedAggregateSubmitRequest.signed_aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof + 0, // 14: ethereum.eth.v1alpha1.ValidatorInfo.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 46, // 15: ethereum.eth.v1alpha1.DoppelGangerRequest.validator_requests:type_name -> ethereum.eth.v1alpha1.DoppelGangerRequest.ValidatorRequest + 47, // 16: ethereum.eth.v1alpha1.DoppelGangerResponse.responses:type_name -> ethereum.eth.v1alpha1.DoppelGangerResponse.ValidatorResponse + 48, // 17: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.recipients:type_name -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.FeeRecipientContainer + 0, // 18: ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 58, // 19: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest.msgs:type_name -> ethereum.eth.v1alpha1.SyncCommitteeMessage + 16, // 20: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse + 0, // 21: ethereum.eth.v1alpha1.DutiesResponse.Duty.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 19, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:input_type -> ethereum.eth.v1alpha1.DutiesRequest + 7, // 23: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:input_type -> ethereum.eth.v1alpha1.DomainRequest + 59, // 24: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:input_type -> google.protobuf.Empty + 9, // 25: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:input_type -> ethereum.eth.v1alpha1.ValidatorActivationRequest + 13, // 26: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:input_type -> ethereum.eth.v1alpha1.ValidatorIndexRequest + 15, // 27: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:input_type -> ethereum.eth.v1alpha1.ValidatorStatusRequest + 17, // 28: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:input_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusRequest + 21, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest + 60, // 30: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:input_type -> ethereum.eth.v1alpha1.GenericSignedBeaconBlock + 38, // 31: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:input_type -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest + 39, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest + 24, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest + 61, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation + 26, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest + 28, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest + 62, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 30, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest + 34, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest + 59, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty + 58, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage + 2, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest + 3, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest + 63, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof + 36, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest + 37, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest + 64, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + 41, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest + 42, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest + 20, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse + 8, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse + 11, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse + 10, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse + 14, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse + 16, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse + 18, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse + 65, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock + 22, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse + 59, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty + 40, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse + 66, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData + 25, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse + 27, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse + 29, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse + 23, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse + 59, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty + 35, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse + 1, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse + 59, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty + 4, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse + 67, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution + 59, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty + 5, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse + 6, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse + 59, // 75: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty + 59, // 76: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:output_type -> google.protobuf.Empty + 43, // 77: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:output_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse + 50, // [50:78] is the sub-list for method output_type + 22, // [22:50] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_validator_proto_init() } @@ -4658,6 +4680,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { (*StreamBlocksResponse_BellatrixBlock)(nil), (*StreamBlocksResponse_CapellaBlock)(nil), (*StreamBlocksResponse_DenebBlock)(nil), + (*StreamBlocksResponse_ElectraBlock)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/proto/prysm/v1alpha1/validator.proto b/proto/prysm/v1alpha1/validator.proto index ac942559c1b0..c4bc94dc9a24 100644 --- a/proto/prysm/v1alpha1/validator.proto +++ b/proto/prysm/v1alpha1/validator.proto @@ -377,6 +377,9 @@ message StreamBlocksResponse { // Representing a deneb block. SignedBeaconBlockDeneb deneb_block = 5; + + // Representing a electra block. + SignedBeaconBlockElectra electra_block = 6; } } From c08d2f36b0da7e38c8c4edcfdbff60f2fbf90df4 Mon Sep 17 00:00:00 2001 From: terence Date: Sat, 11 May 2024 11:27:16 -0700 Subject: [PATCH 083/325] Add p2p support for Electra (#13985) * Add p2p support for Electra * Fix TestGossipTopicMappings_CorrectBlockType --- beacon-chain/p2p/fork_watcher.go | 3 ++- beacon-chain/p2p/gossip_topic_mappings.go | 5 +++++ beacon-chain/p2p/gossip_topic_mappings_test.go | 16 ++++++++++++++++ beacon-chain/p2p/pubsub_filter.go | 6 ++++++ beacon-chain/p2p/types/object_mapping.go | 8 ++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/beacon-chain/p2p/fork_watcher.go b/beacon-chain/p2p/fork_watcher.go index a8de512d3320..3d02d57bb6f1 100644 --- a/beacon-chain/p2p/fork_watcher.go +++ b/beacon-chain/p2p/fork_watcher.go @@ -17,7 +17,8 @@ func (s *Service) forkWatcher() { if currEpoch == params.BeaconConfig().AltairForkEpoch || currEpoch == params.BeaconConfig().BellatrixForkEpoch || currEpoch == params.BeaconConfig().CapellaForkEpoch || - currEpoch == params.BeaconConfig().DenebForkEpoch { + currEpoch == params.BeaconConfig().DenebForkEpoch || + currEpoch == params.BeaconConfig().ElectraForkEpoch { // If we are in the fork epoch, we update our enr with // the updated fork digest. These repeatedly does // this over the epoch, which might be slightly wasteful diff --git a/beacon-chain/p2p/gossip_topic_mappings.go b/beacon-chain/p2p/gossip_topic_mappings.go index c81b6d11c5c7..76dfe722ed65 100644 --- a/beacon-chain/p2p/gossip_topic_mappings.go +++ b/beacon-chain/p2p/gossip_topic_mappings.go @@ -28,6 +28,9 @@ var gossipTopicMappings = map[string]proto.Message{ // versioned by epoch. func GossipTopicMappings(topic string, epoch primitives.Epoch) proto.Message { if topic == BlockSubnetTopicFormat { + if epoch >= params.BeaconConfig().ElectraForkEpoch { + return ðpb.SignedBeaconBlockElectra{} + } if epoch >= params.BeaconConfig().DenebForkEpoch { return ðpb.SignedBeaconBlockDeneb{} } @@ -70,4 +73,6 @@ func init() { GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockCapella{})] = BlockSubnetTopicFormat // Specially handle Deneb objects. GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockDeneb{})] = BlockSubnetTopicFormat + // Specially handle Electra objects. + GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockElectra{})] = BlockSubnetTopicFormat } diff --git a/beacon-chain/p2p/gossip_topic_mappings_test.go b/beacon-chain/p2p/gossip_topic_mappings_test.go index 0a0f8cadba79..88b03ba642fa 100644 --- a/beacon-chain/p2p/gossip_topic_mappings_test.go +++ b/beacon-chain/p2p/gossip_topic_mappings_test.go @@ -28,13 +28,19 @@ func TestGossipTopicMappings_CorrectBlockType(t *testing.T) { altairForkEpoch := primitives.Epoch(100) BellatrixForkEpoch := primitives.Epoch(200) CapellaForkEpoch := primitives.Epoch(300) + DenebForkEpoch := primitives.Epoch(400) + ElectraForkEpoch := primitives.Epoch(500) bCfg.AltairForkEpoch = altairForkEpoch bCfg.BellatrixForkEpoch = BellatrixForkEpoch bCfg.CapellaForkEpoch = CapellaForkEpoch + bCfg.DenebForkEpoch = DenebForkEpoch + bCfg.ElectraForkEpoch = ElectraForkEpoch bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.AltairForkVersion)] = primitives.Epoch(100) bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.BellatrixForkVersion)] = primitives.Epoch(200) bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.CapellaForkVersion)] = primitives.Epoch(300) + bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.DenebForkVersion)] = primitives.Epoch(400) + bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.ElectraForkVersion)] = primitives.Epoch(500) params.OverrideBeaconConfig(bCfg) // Phase 0 @@ -56,4 +62,14 @@ func TestGossipTopicMappings_CorrectBlockType(t *testing.T) { pMessage = GossipTopicMappings(BlockSubnetTopicFormat, CapellaForkEpoch) _, ok = pMessage.(*ethpb.SignedBeaconBlockCapella) assert.Equal(t, true, ok) + + // Deneb Fork + pMessage = GossipTopicMappings(BlockSubnetTopicFormat, DenebForkEpoch) + _, ok = pMessage.(*ethpb.SignedBeaconBlockDeneb) + assert.Equal(t, true, ok) + + // Electra Fork + pMessage = GossipTopicMappings(BlockSubnetTopicFormat, ElectraForkEpoch) + _, ok = pMessage.(*ethpb.SignedBeaconBlockElectra) + assert.Equal(t, true, ok) } diff --git a/beacon-chain/p2p/pubsub_filter.go b/beacon-chain/p2p/pubsub_filter.go index 3c2c8e99b0de..e02371c587f9 100644 --- a/beacon-chain/p2p/pubsub_filter.go +++ b/beacon-chain/p2p/pubsub_filter.go @@ -62,12 +62,18 @@ func (s *Service) CanSubscribe(topic string) bool { log.WithError(err).Error("Could not determine Deneb fork digest") return false } + electraForkDigest, err := forks.ForkDigestFromEpoch(params.BeaconConfig().ElectraForkEpoch, s.genesisValidatorsRoot) + if err != nil { + log.WithError(err).Error("Could not determine Electra fork digest") + return false + } switch parts[2] { case fmt.Sprintf("%x", phase0ForkDigest): case fmt.Sprintf("%x", altairForkDigest): case fmt.Sprintf("%x", bellatrixForkDigest): case fmt.Sprintf("%x", capellaForkDigest): case fmt.Sprintf("%x", denebForkDigest): + case fmt.Sprintf("%x", electraForkDigest): default: return false } diff --git a/beacon-chain/p2p/types/object_mapping.go b/beacon-chain/p2p/types/object_mapping.go index 34e0dd1f4e5f..2698bf93f54a 100644 --- a/beacon-chain/p2p/types/object_mapping.go +++ b/beacon-chain/p2p/types/object_mapping.go @@ -59,6 +59,11 @@ func InitializeDataMaps() { ðpb.SignedBeaconBlockDeneb{Block: ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{ExecutionPayload: &enginev1.ExecutionPayloadDeneb{}}}}, ) }, + bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion): func() (interfaces.ReadOnlySignedBeaconBlock, error) { + return blocks.NewSignedBeaconBlock( + ðpb.SignedBeaconBlockElectra{Block: ðpb.BeaconBlockElectra{Body: ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{}}}}, + ) + }, } // Reset our metadata map. @@ -78,5 +83,8 @@ func InitializeDataMaps() { bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion): func() metadata.Metadata { return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) }, + bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion): func() metadata.Metadata { + return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) + }, } } From d71079e1d87412e1af91687bc1c46bd1760fe1ac Mon Sep 17 00:00:00 2001 From: terence Date: Sun, 12 May 2024 06:55:01 -0700 Subject: [PATCH 084/325] Add proposer suppot for Electra (#13987) --- consensus-types/blocks/testing/factory.go | 2 + testing/util/block.go | 7 +++ testing/util/merge.go | 5 ++ validator/client/propose.go | 60 ++++++++++++++++++----- validator/client/propose_test.go | 13 +++++ 5 files changed, 74 insertions(+), 13 deletions(-) diff --git a/consensus-types/blocks/testing/factory.go b/consensus-types/blocks/testing/factory.go index 6255b10d86d8..79599b84134e 100644 --- a/consensus-types/blocks/testing/factory.go +++ b/consensus-types/blocks/testing/factory.go @@ -30,6 +30,8 @@ func NewSignedBeaconBlockFromGeneric(gb *eth.GenericSignedBeaconBlock) (interfac return blocks.NewSignedBeaconBlock(bb.Deneb.Block) case *eth.GenericSignedBeaconBlock_BlindedDeneb: return blocks.NewSignedBeaconBlock(bb.BlindedDeneb) + case *eth.GenericSignedBeaconBlock_Electra: + return blocks.NewSignedBeaconBlock(bb.Electra.Block) // Generic Signed Beacon Block Deneb can't be used here as it is not a block, but block content with blobs default: return nil, errors.Wrapf(blocks.ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", gb) diff --git a/testing/util/block.go b/testing/util/block.go index 41c7812b1fe6..d9d8fb97ce47 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -1160,6 +1160,13 @@ func HydrateSignedBeaconBlockContentsDeneb(b *ethpb.SignedBeaconBlockContentsDen return b } +// HydrateSignedBeaconBlockContentsElectra hydrates a signed beacon block with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateSignedBeaconBlockContentsElectra(b *ethpb.SignedBeaconBlockContentsElectra) *ethpb.SignedBeaconBlockContentsElectra { + b.Block = HydrateSignedBeaconBlockElectra(b.Block) + return b +} + // HydrateV2SignedBeaconBlockDeneb hydrates a v2 signed beacon block with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2SignedBeaconBlockDeneb(b *v2.SignedBeaconBlockDeneb) *v2.SignedBeaconBlockDeneb { diff --git a/testing/util/merge.go b/testing/util/merge.go index c87b9d202705..85bf2c82a807 100644 --- a/testing/util/merge.go +++ b/testing/util/merge.go @@ -50,6 +50,11 @@ func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb { return HydrateSignedBlindedBeaconBlockDeneb(ðpb.SignedBlindedBeaconBlockDeneb{}) } +// NewBeaconBlockContentsElectra creates a beacon block with minimum marshalable fields. +func NewBeaconBlockContentsElectra() *ethpb.SignedBeaconBlockContentsElectra { + return HydrateSignedBeaconBlockContentsElectra(ðpb.SignedBeaconBlockContentsElectra{}) +} + // NewBlindedBeaconBlockElectra creates a blinded beacon block with minimum marshalable fields. func NewBlindedBeaconBlockElectra() *ethpb.SignedBlindedBeaconBlockElectra { return HydrateSignedBlindedBeaconBlockElectra(ðpb.SignedBlindedBeaconBlockElectra{}) diff --git a/validator/client/propose.go b/validator/client/propose.go index 986f1e66f1fe..0864d389461e 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -28,6 +28,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/sirupsen/logrus" "go.opencensus.io/trace" + "google.golang.org/protobuf/proto" ) const ( @@ -127,25 +128,26 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK } var genericSignedBlock *ethpb.GenericSignedBeaconBlock + // Special handling for Deneb blocks and later version because of blob side cars. if blk.Version() >= version.Deneb && !blk.IsBlinded() { pb, err := blk.Proto() if err != nil { log.WithError(err).Error("Failed to get deneb block") return } - denebBlock, ok := pb.(*ethpb.SignedBeaconBlockDeneb) - if !ok { - log.WithError(err).Error("Failed to get deneb block - assertion failure") - return - } - genericSignedBlock = ðpb.GenericSignedBeaconBlock{ - Block: ðpb.GenericSignedBeaconBlock_Deneb{ - Deneb: ðpb.SignedBeaconBlockContentsDeneb{ - Block: denebBlock, - KzgProofs: b.GetDeneb().KzgProofs, - Blobs: b.GetDeneb().Blobs, - }, - }, + switch blk.Version() { + case version.Deneb: + genericSignedBlock, err = buildGenericSignedBlockDenebWithBlobs(pb, b) + if err != nil { + log.WithError(err).Error("Failed to build generic signed block") + return + } + case version.Electra: + genericSignedBlock, err = buildGenericSignedBlockElectraWithBlobs(pb, b) + if err != nil { + log.WithError(err).Error("Failed to build generic signed block") + return + } } } else { genericSignedBlock, err = blk.PbGenericBlock() @@ -230,6 +232,38 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK } } +func buildGenericSignedBlockDenebWithBlobs(pb proto.Message, b *ethpb.GenericBeaconBlock) (*ethpb.GenericSignedBeaconBlock, error) { + denebBlock, ok := pb.(*ethpb.SignedBeaconBlockDeneb) + if !ok { + return nil, errors.New("could cast to deneb block") + } + return ðpb.GenericSignedBeaconBlock{ + Block: ðpb.GenericSignedBeaconBlock_Deneb{ + Deneb: ðpb.SignedBeaconBlockContentsDeneb{ + Block: denebBlock, + KzgProofs: b.GetDeneb().KzgProofs, + Blobs: b.GetDeneb().Blobs, + }, + }, + }, nil +} + +func buildGenericSignedBlockElectraWithBlobs(pb proto.Message, b *ethpb.GenericBeaconBlock) (*ethpb.GenericSignedBeaconBlock, error) { + electraBlock, ok := pb.(*ethpb.SignedBeaconBlockElectra) + if !ok { + return nil, errors.New("could cast to electra block") + } + return ðpb.GenericSignedBeaconBlock{ + Block: ðpb.GenericSignedBeaconBlock_Electra{ + Electra: ðpb.SignedBeaconBlockContentsElectra{ + Block: electraBlock, + KzgProofs: b.GetElectra().KzgProofs, + Blobs: b.GetElectra().Blobs, + }, + }, + }, nil +} + // ProposeExit performs a voluntary exit on a validator. // The exit is signed by the validator before being sent to the beacon node for broadcasting. func ProposeExit( diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index 463c1b1ccd18..b7ab7018f27a 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -652,6 +652,19 @@ func testProposeBlock(t *testing.T, graffiti []byte) { }, }, }, + { + name: "electra block", + version: version.Electra, + block: ðpb.GenericBeaconBlock{ + Block: ðpb.GenericBeaconBlock_Electra{ + Electra: func() *ethpb.BeaconBlockContentsElectra { + blk := util.NewBeaconBlockContentsElectra() + blk.Block.Block.Body.Graffiti = graffiti + return ðpb.BeaconBlockContentsElectra{Block: blk.Block.Block, KzgProofs: blk.KzgProofs, Blobs: blk.Blobs} + }(), + }, + }, + }, } for _, tt := range tests { From e4310aef7322bd349b69f6c607eb816bf35a6687 Mon Sep 17 00:00:00 2001 From: terence Date: Sun, 12 May 2024 09:34:02 -0700 Subject: [PATCH 085/325] Update interop genesis for Electra (#13991) --- cmd/prysmctl/testnet/generate_genesis.go | 4 ++++ runtime/interop/genesis.go | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cmd/prysmctl/testnet/generate_genesis.go b/cmd/prysmctl/testnet/generate_genesis.go index 8ee5905447f7..9fcee9a064fe 100644 --- a/cmd/prysmctl/testnet/generate_genesis.go +++ b/cmd/prysmctl/testnet/generate_genesis.go @@ -273,6 +273,7 @@ func generateGenesis(ctx context.Context) (state.BeaconState, error) { gen.Timestamp = f.GenesisTime gen.Config.ShanghaiTime = interop.GethShanghaiTime(f.GenesisTime, params.BeaconConfig()) gen.Config.CancunTime = interop.GethCancunTime(f.GenesisTime, params.BeaconConfig()) + gen.Config.PragueTime = interop.GethPragueTime(f.GenesisTime, params.BeaconConfig()) fields := logrus.Fields{} if gen.Config.ShanghaiTime != nil { @@ -281,6 +282,9 @@ func generateGenesis(ctx context.Context) (state.BeaconState, error) { if gen.Config.CancunTime != nil { fields["cancun"] = fmt.Sprintf("%d", *gen.Config.CancunTime) } + if gen.Config.PragueTime != nil { + fields["prague"] = fmt.Sprintf("%d", *gen.Config.PragueTime) + } log.WithFields(fields).Info("Setting fork geth times") if v > version.Altair { // set ttd to zero so EL goes post-merge immediately diff --git a/runtime/interop/genesis.go b/runtime/interop/genesis.go index c20a4cce013c..df2dc0ad5a33 100644 --- a/runtime/interop/genesis.go +++ b/runtime/interop/genesis.go @@ -92,7 +92,7 @@ func GethShanghaiTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint return shanghaiTime } -// GethCancunTime calculates the absolute time of the shanghai (aka capella) fork block +// GethCancunTime calculates the absolute time of the cancun (aka deneb) fork block // by adding the relative time of the capella the fork epoch to the given genesis timestamp. func GethCancunTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 { var cancunTime *uint64 @@ -107,6 +107,21 @@ func GethCancunTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 return cancunTime } +// GethPragueTime calculates the absolute time of the prague (aka electra) fork block +// by adding the relative time of the capella the fork epoch to the given genesis timestamp. +func GethPragueTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 { + var pragueTime *uint64 + if cfg.ElectraForkEpoch != math.MaxUint64 { + startSlot, err := slots.EpochStart(cfg.ElectraForkEpoch) + if err == nil { + startTime := slots.StartTime(genesisTime, startSlot) + newTime := uint64(startTime.Unix()) + pragueTime = &newTime + } + } + return pragueTime +} + // GethTestnetGenesis creates a genesis.json for eth1 clients with a set of defaults suitable for ephemeral testnets, // like in an e2e test. The parameters are minimal but the full value is returned unmarshaled so that it can be // customized as desired. @@ -118,6 +133,7 @@ func GethTestnetGenesis(genesisTime uint64, cfg *clparams.BeaconChainConfig) *co shanghaiTime := GethShanghaiTime(genesisTime, cfg) cancunTime := GethCancunTime(genesisTime, cfg) + pragueTime := GethPragueTime(genesisTime, cfg) cc := ¶ms.ChainConfig{ ChainID: big.NewInt(defaultTestChainId), HomesteadBlock: bigz, @@ -143,6 +159,7 @@ func GethTestnetGenesis(genesisTime uint64, cfg *clparams.BeaconChainConfig) *co }, ShanghaiTime: shanghaiTime, CancunTime: cancunTime, + PragueTime: pragueTime, } da := defaultDepositContractAllocation(cfg.DepositContractAddress) ma := minerAllocation() From de177f74fb11701d662328512b557fe823e22769 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Sun, 12 May 2024 15:19:08 -0500 Subject: [PATCH 086/325] electra engine api support (#13978) * electra engine api support * add marshaling support for ExecutionPayloadElectra * add receipts to json tests * deep source * simplify slice handling * deep source lint about type/method order --------- Co-authored-by: Kasey Kirkham --- beacon-chain/execution/engine_client.go | 126 +-- beacon-chain/execution/engine_client_test.go | 415 ++++---- proto/engine/v1/execution_engine.pb.go | 909 ++++++++++-------- proto/engine/v1/execution_engine.proto | 7 + proto/engine/v1/json_marshal_unmarshal.go | 364 +++++++ .../engine/v1/json_marshal_unmarshal_test.go | 179 +++- 6 files changed, 1330 insertions(+), 670 deletions(-) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index e22f56b3b36b..5a6eb39e6fa8 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -49,6 +49,8 @@ const ( // NewPayloadMethodV2 v2 request string for JSON-RPC. NewPayloadMethodV2 = "engine_newPayloadV2" NewPayloadMethodV3 = "engine_newPayloadV3" + // NewPayloadMethodV4 is the engine_newPayloadVX method added at Electra. + NewPayloadMethodV4 = "engine_newPayloadV4" // ForkchoiceUpdatedMethod v1 request string for JSON-RPC. ForkchoiceUpdatedMethod = "engine_forkchoiceUpdatedV1" // ForkchoiceUpdatedMethodV2 v2 request string for JSON-RPC. @@ -59,7 +61,10 @@ const ( GetPayloadMethod = "engine_getPayloadV1" // GetPayloadMethodV2 v2 request string for JSON-RPC. GetPayloadMethodV2 = "engine_getPayloadV2" + // GetPayloadMethodV3 is the get payload method added for deneb GetPayloadMethodV3 = "engine_getPayloadV3" + // GetPayloadMethodV4 is the get payload method added for electra + GetPayloadMethodV4 = "engine_getPayloadV3" // BlockByHashMethod request string for JSON-RPC. BlockByHashMethod = "eth_getBlockByHash" // BlockByNumberMethod request string for JSON-RPC. @@ -82,7 +87,7 @@ type ForkchoiceUpdatedResponse struct { ValidationError string `json:"validationError"` } -// ExecutionPayloadReconstructor defines a service that can reconstruct a full beacon +// PayloadReconstructor defines a service that can reconstruct a full beacon // block with an execution payload from a signed beacon block and a connection // to an execution client's engine API. type PayloadReconstructor interface { @@ -150,6 +155,15 @@ func (s *Service) NewPayload(ctx context.Context, payload interfaces.ExecutionDa if err != nil { return nil, handleRPCError(err) } + case *pb.ExecutionPayloadElectra: + payloadPb, ok := payload.Proto().(*pb.ExecutionPayloadElectra) + if !ok { + return nil, errors.New("execution data must be a Deneb execution payload") + } + err := s.rpcClient.CallContext(ctx, result, NewPayloadMethodV4, payloadPb, versionedHashes, parentBlockRoot) + if err != nil { + return nil, handleRPCError(err) + } default: return nil, errors.New("unknown execution data type") } @@ -254,6 +268,19 @@ func (s *Service) GetPayload(ctx context.Context, payloadId [8]byte, slot primit ctx, cancel := context.WithDeadline(ctx, d) defer cancel() + if slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch { + result := &pb.ExecutionPayloadElectraWithValueAndBlobsBundle{} + err := s.rpcClient.CallContext(ctx, result, GetPayloadMethodV4, pb.PayloadIDBytes(payloadId)) + if err != nil { + return nil, nil, false, handleRPCError(err) + } + ed, err := blocks.WrappedExecutionPayloadElectra(result.Payload, blocks.PayloadValueToWei(result.Value)) + if err != nil { + return nil, nil, false, err + } + return ed, result.BlobsBundle, result.ShouldOverrideBuilder, nil + } + if slots.ToEpoch(slot) >= params.BeaconConfig().DenebForkEpoch { result := &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{} err := s.rpcClient.CallContext(ctx, result, GetPayloadMethodV3, pb.PayloadIDBytes(payloadId)) @@ -682,31 +709,14 @@ func (s *Service) retrievePayloadsFromExecutionHashes( return fullBlocks, nil } -func fullPayloadFromExecutionBlock( - blockVersion int, header interfaces.ExecutionData, block *pb.ExecutionBlock, +func fullPayloadFromPayloadBody( + header interfaces.ExecutionData, body *pb.ExecutionPayloadBodyV1, bVersion int, ) (interfaces.ExecutionData, error) { - if header.IsNil() || block == nil { + if header.IsNil() || body == nil { return nil, errors.New("execution block and header cannot be nil") } - blockHash := block.Hash - if !bytes.Equal(header.BlockHash(), blockHash[:]) { - return nil, fmt.Errorf( - "block hash field in execution header %#x does not match execution block hash %#x", - header.BlockHash(), - blockHash, - ) - } - blockTransactions := block.Transactions - txs := make([][]byte, len(blockTransactions)) - for i, tx := range blockTransactions { - txBin, err := tx.MarshalBinary() - if err != nil { - return nil, err - } - txs[i] = txBin - } - switch blockVersion { + switch bVersion { case version.Bellatrix: return blocks.WrappedExecutionPayload(&pb.ExecutionPayload{ ParentHash: header.ParentHash(), @@ -721,8 +731,8 @@ func fullPayloadFromExecutionBlock( Timestamp: header.Timestamp(), ExtraData: header.ExtraData(), BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: blockHash[:], - Transactions: txs, + BlockHash: header.BlockHash(), + Transactions: body.Transactions, }) case version.Capella: return blocks.WrappedExecutionPayloadCapella(&pb.ExecutionPayloadCapella{ @@ -738,9 +748,9 @@ func fullPayloadFromExecutionBlock( Timestamp: header.Timestamp(), ExtraData: header.ExtraData(), BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: blockHash[:], - Transactions: txs, - Withdrawals: block.Withdrawals, + BlockHash: header.BlockHash(), + Transactions: body.Transactions, + Withdrawals: body.Withdrawals, }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance case version.Deneb: ebg, err := header.ExcessBlobGas() @@ -765,61 +775,13 @@ func fullPayloadFromExecutionBlock( Timestamp: header.Timestamp(), ExtraData: header.ExtraData(), BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: blockHash[:], - Transactions: txs, - Withdrawals: block.Withdrawals, - BlobGasUsed: bgu, + BlockHash: header.BlockHash(), + Transactions: body.Transactions, + Withdrawals: body.Withdrawals, ExcessBlobGas: ebg, + BlobGasUsed: bgu, }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance - default: - return nil, fmt.Errorf("unknown execution block version %d", block.Version) - } -} - -func fullPayloadFromPayloadBody( - header interfaces.ExecutionData, body *pb.ExecutionPayloadBodyV1, bVersion int, -) (interfaces.ExecutionData, error) { - if header.IsNil() || body == nil { - return nil, errors.New("execution block and header cannot be nil") - } - - switch bVersion { - case version.Bellatrix: - return blocks.WrappedExecutionPayload(&pb.ExecutionPayload{ - ParentHash: header.ParentHash(), - FeeRecipient: header.FeeRecipient(), - StateRoot: header.StateRoot(), - ReceiptsRoot: header.ReceiptsRoot(), - LogsBloom: header.LogsBloom(), - PrevRandao: header.PrevRandao(), - BlockNumber: header.BlockNumber(), - GasLimit: header.GasLimit(), - GasUsed: header.GasUsed(), - Timestamp: header.Timestamp(), - ExtraData: header.ExtraData(), - BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: header.BlockHash(), - Transactions: body.Transactions, - }) - case version.Capella: - return blocks.WrappedExecutionPayloadCapella(&pb.ExecutionPayloadCapella{ - ParentHash: header.ParentHash(), - FeeRecipient: header.FeeRecipient(), - StateRoot: header.StateRoot(), - ReceiptsRoot: header.ReceiptsRoot(), - LogsBloom: header.LogsBloom(), - PrevRandao: header.PrevRandao(), - BlockNumber: header.BlockNumber(), - GasLimit: header.GasLimit(), - GasUsed: header.GasUsed(), - Timestamp: header.Timestamp(), - ExtraData: header.ExtraData(), - BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: header.BlockHash(), - Transactions: body.Transactions, - Withdrawals: body.Withdrawals, - }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance - case version.Deneb: + case version.Electra: ebg, err := header.ExcessBlobGas() if err != nil { return nil, errors.Wrap(err, "unable to extract ExcessBlobGas attribute from execution payload header") @@ -828,8 +790,8 @@ func fullPayloadFromPayloadBody( if err != nil { return nil, errors.Wrap(err, "unable to extract BlobGasUsed attribute from execution payload header") } - return blocks.WrappedExecutionPayloadDeneb( - &pb.ExecutionPayloadDeneb{ + return blocks.WrappedExecutionPayloadElectra( + &pb.ExecutionPayloadElectra{ ParentHash: header.ParentHash(), FeeRecipient: header.FeeRecipient(), StateRoot: header.StateRoot(), diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index 82296b5e5c32..e42165d16651 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "math" "math/big" "net/http" "net/http/httptest" @@ -160,6 +161,7 @@ func TestClient_HTTP(t *testing.T) { cfg := params.BeaconConfig().Copy() cfg.CapellaForkEpoch = 1 cfg.DenebForkEpoch = 2 + cfg.ElectraForkEpoch = 2 params.OverrideBeaconConfig(cfg) t.Run(GetPayloadMethod, func(t *testing.T) { @@ -318,6 +320,61 @@ func TestClient_HTTP(t *testing.T) { blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} require.DeepEqual(t, blobs, blobsBundle.Blobs) }) + t.Run(GetPayloadMethodV4, func(t *testing.T) { + payloadId := [8]byte{1} + want, ok := fix["ExecutionPayloadElectraWithValue"].(*pb.GetPayloadV4ResponseJson) + require.Equal(t, true, ok) + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + defer func() { + require.NoError(t, r.Body.Close()) + }() + enc, err := io.ReadAll(r.Body) + require.NoError(t, err) + jsonRequestString := string(enc) + + reqArg, err := json.Marshal(pb.PayloadIDBytes(payloadId)) + require.NoError(t, err) + + // We expect the JSON string RPC request contains the right arguments. + require.Equal(t, true, strings.Contains( + jsonRequestString, string(reqArg), + )) + resp := map[string]interface{}{ + "jsonrpc": "2.0", + "id": 1, + "result": want, + } + err = json.NewEncoder(w).Encode(resp) + require.NoError(t, err) + })) + defer srv.Close() + + rpcClient, err := rpc.DialHTTP(srv.URL) + require.NoError(t, err) + defer rpcClient.Close() + + client := &Service{} + client.rpcClient = rpcClient + + // We call the RPC method via HTTP and expect a proper result. + resp, blobsBundle, override, err := client.GetPayload(ctx, payloadId, 2*params.BeaconConfig().SlotsPerEpoch) + require.NoError(t, err) + require.Equal(t, true, override) + g, err := resp.ExcessBlobGas() + require.NoError(t, err) + require.DeepEqual(t, uint64(3), g) + g, err = resp.BlobGasUsed() + require.NoError(t, err) + require.DeepEqual(t, uint64(2), g) + + commitments := [][]byte{bytesutil.PadTo([]byte("commitment1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("commitment2"), fieldparams.BLSPubkeyLength)} + require.DeepEqual(t, commitments, blobsBundle.KzgCommitments) + proofs := [][]byte{bytesutil.PadTo([]byte("proof1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("proof2"), fieldparams.BLSPubkeyLength)} + require.DeepEqual(t, proofs, blobsBundle.Proofs) + blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} + require.DeepEqual(t, blobs, blobsBundle.Blobs) + }) t.Run(ForkchoiceUpdatedMethod+" VALID status", func(t *testing.T) { forkChoiceState := &pb.ForkchoiceState{ HeadBlockHash: []byte("head"), @@ -500,6 +557,20 @@ func TestClient_HTTP(t *testing.T) { require.NoError(t, err) require.DeepEqual(t, want.LatestValidHash, resp) }) + t.Run(NewPayloadMethodV4+" VALID status", func(t *testing.T) { + execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) + require.Equal(t, true, ok) + want, ok := fix["ValidPayloadStatus"].(*pb.PayloadStatus) + require.Equal(t, true, ok) + client := newPayloadV4Setup(t, want, execPayload) + + // We call the RPC method via HTTP and expect a proper result. + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + require.NoError(t, err) + resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) + require.NoError(t, err) + require.DeepEqual(t, want.LatestValidHash, resp) + }) t.Run(NewPayloadMethod+" SYNCING status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -542,6 +613,20 @@ func TestClient_HTTP(t *testing.T) { require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) require.DeepEqual(t, []uint8(nil), resp) }) + t.Run(NewPayloadMethodV4+" SYNCING status", func(t *testing.T) { + execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) + require.Equal(t, true, ok) + want, ok := fix["SyncingStatus"].(*pb.PayloadStatus) + require.Equal(t, true, ok) + client := newPayloadV4Setup(t, want, execPayload) + + // We call the RPC method via HTTP and expect a proper result. + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + require.NoError(t, err) + resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) + require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) + require.DeepEqual(t, []uint8(nil), resp) + }) t.Run(NewPayloadMethod+" INVALID_BLOCK_HASH status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -584,6 +669,20 @@ func TestClient_HTTP(t *testing.T) { require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) require.DeepEqual(t, []uint8(nil), resp) }) + t.Run(NewPayloadMethodV4+" INVALID_BLOCK_HASH status", func(t *testing.T) { + execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) + require.Equal(t, true, ok) + want, ok := fix["InvalidBlockHashStatus"].(*pb.PayloadStatus) + require.Equal(t, true, ok) + client := newPayloadV4Setup(t, want, execPayload) + + // We call the RPC method via HTTP and expect a proper result. + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + require.NoError(t, err) + resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) + require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) + require.DeepEqual(t, []uint8(nil), resp) + }) t.Run(NewPayloadMethod+" INVALID status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -626,6 +725,20 @@ func TestClient_HTTP(t *testing.T) { require.ErrorIs(t, ErrInvalidPayloadStatus, err) require.DeepEqual(t, want.LatestValidHash, resp) }) + t.Run(NewPayloadMethodV4+" INVALID status", func(t *testing.T) { + execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) + require.Equal(t, true, ok) + want, ok := fix["InvalidStatus"].(*pb.PayloadStatus) + require.Equal(t, true, ok) + client := newPayloadV4Setup(t, want, execPayload) + + // We call the RPC method via HTTP and expect a proper result. + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + require.NoError(t, err) + resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) + require.ErrorIs(t, ErrInvalidPayloadStatus, err) + require.DeepEqual(t, want.LatestValidHash, resp) + }) t.Run(NewPayloadMethod+" UNKNOWN status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -1352,6 +1465,62 @@ func fixtures() map[string]interface{} { BlobGasUsed: 2, ExcessBlobGas: 3, } + withdrawalRequests := make([]pb.WithdrawalRequestV1, 3) + for i := range withdrawalRequests { + amount := hexutil.Uint64(i) + address := &common.Address{} + address.SetBytes([]byte{0, 0, byte(i)}) + pubkey := pb.BlsPubkey{} + copy(pubkey[:], []byte{0, byte(i)}) + withdrawalRequests[i] = pb.WithdrawalRequestV1{ + SourceAddress: address, + ValidatorPubkey: &pubkey, + Amount: &amount, + } + } + depositRequests := make([]pb.DepositRequestV1, 3) + for i := range depositRequests { + amount := hexutil.Uint64(math.MaxUint16 - i) + creds := &common.Hash{} + creds.SetBytes([]byte{0, 0, byte(i)}) + pubkey := pb.BlsPubkey{} + copy(pubkey[:], []byte{0, byte(i)}) + sig := pb.BlsSig{} + copy(sig[:], []byte{0, 0, 0, byte(i)}) + idx := hexutil.Uint64(i) + depositRequests[i] = pb.DepositRequestV1{ + PubKey: &pubkey, + WithdrawalCredentials: creds, + Amount: &amount, + Signature: &sig, + Index: &idx, + } + } + outer := &pb.ExecutionPayloadElectraJSON{ + WithdrawalRequests: withdrawalRequests, + DepositRequests: depositRequests, + } + executionPayloadFixtureElectra := &pb.ExecutionPayloadElectra{ + ParentHash: foo[:], + FeeRecipient: bar, + StateRoot: foo[:], + ReceiptsRoot: foo[:], + LogsBloom: baz, + PrevRandao: foo[:], + BlockNumber: 1, + GasLimit: 1, + GasUsed: 1, + Timestamp: 1, + ExtraData: foo[:], + BaseFeePerGas: bytesutil.PadTo(baseFeePerGas.Bytes(), fieldparams.RootLength), + BlockHash: foo[:], + Transactions: [][]byte{foo[:]}, + Withdrawals: []*pb.Withdrawal{}, + BlobGasUsed: 2, + ExcessBlobGas: 3, + DepositReceipts: outer.ElectraDepositReceipts(), + WithdrawalRequests: outer.ElectraExecutionLayerWithdrawalRequests(), + } hexUint := hexutil.Uint64(1) executionPayloadWithValueFixtureCapella := &pb.GetPayloadV2ResponseJson{ ExecutionPayload: &pb.ExecutionPayloadCapellaJSON{ @@ -1401,6 +1570,33 @@ func fixtures() map[string]interface{} { Blobs: []hexutil.Bytes{{'a'}, {'b'}}, }, } + executionPayloadWithValueFixtureElectra := &pb.GetPayloadV4ResponseJson{ + ShouldOverrideBuilder: true, + ExecutionPayload: &pb.ExecutionPayloadElectraJSON{ + ParentHash: &common.Hash{'a'}, + FeeRecipient: &common.Address{'b'}, + StateRoot: &common.Hash{'c'}, + ReceiptsRoot: &common.Hash{'d'}, + LogsBloom: &hexutil.Bytes{'e'}, + PrevRandao: &common.Hash{'f'}, + BaseFeePerGas: "0x123", + BlockHash: &common.Hash{'g'}, + Transactions: []hexutil.Bytes{{'h'}}, + Withdrawals: []*pb.Withdrawal{}, + BlockNumber: &hexUint, + GasLimit: &hexUint, + GasUsed: &hexUint, + Timestamp: &hexUint, + BlobGasUsed: &bgu, + ExcessBlobGas: &ebg, + }, + BlockValue: "0x11fffffffff", + BlobsBundle: &pb.BlobBundleJSON{ + Commitments: []hexutil.Bytes{[]byte("commitment1"), []byte("commitment2")}, + Proofs: []hexutil.Bytes{[]byte("proof1"), []byte("proof2")}, + Blobs: []hexutil.Bytes{{'a'}, {'b'}}, + }, + } parent := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) sha3Uncles := bytesutil.PadTo([]byte("sha3Uncles"), fieldparams.RootLength) miner := bytesutil.PadTo([]byte("miner"), fieldparams.FeeRecipientLength) @@ -1491,8 +1687,10 @@ func fixtures() map[string]interface{} { "ExecutionPayload": executionPayloadFixture, "ExecutionPayloadCapella": executionPayloadFixtureCapella, "ExecutionPayloadDeneb": executionPayloadFixtureDeneb, + "ExecutionPayloadElectra": executionPayloadFixtureElectra, "ExecutionPayloadCapellaWithValue": executionPayloadWithValueFixtureCapella, "ExecutionPayloadDenebWithValue": executionPayloadWithValueFixtureDeneb, + "ExecutionPayloadElectraWithValue": executionPayloadWithValueFixtureElectra, "ValidPayloadStatus": validStatus, "InvalidBlockHashStatus": inValidBlockHashStatus, "AcceptedStatus": acceptedStatus, @@ -1506,189 +1704,6 @@ func fixtures() map[string]interface{} { } } -func Test_fullPayloadFromExecutionBlock(t *testing.T) { - type args struct { - header *pb.ExecutionPayloadHeader - block *pb.ExecutionBlock - version int - } - wantedHash := common.BytesToHash([]byte("foo")) - tests := []struct { - name string - args args - want func() interfaces.ExecutionData - err string - }{ - { - name: "block hash field in header and block hash mismatch", - args: args{ - header: &pb.ExecutionPayloadHeader{ - BlockHash: []byte("foo"), - }, - block: &pb.ExecutionBlock{ - Hash: common.BytesToHash([]byte("bar")), - }, - version: version.Bellatrix, - }, - err: "does not match execution block hash", - }, - { - name: "ok", - args: args{ - header: &pb.ExecutionPayloadHeader{ - BlockHash: wantedHash[:], - }, - block: &pb.ExecutionBlock{ - Hash: wantedHash, - }, - version: version.Bellatrix, - }, - want: func() interfaces.ExecutionData { - p, err := blocks.WrappedExecutionPayload(&pb.ExecutionPayload{ - BlockHash: wantedHash[:], - Transactions: [][]byte{}, - }) - require.NoError(t, err) - return p - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - wrapped, err := blocks.WrappedExecutionPayloadHeader(tt.args.header) - require.NoError(t, err) - got, err := fullPayloadFromExecutionBlock(tt.args.version, wrapped, tt.args.block) - if err != nil { - assert.ErrorContains(t, tt.err, err) - } else { - assert.DeepEqual(t, tt.want(), got) - } - }) - } -} - -func Test_fullPayloadFromExecutionBlockCapella(t *testing.T) { - type args struct { - header *pb.ExecutionPayloadHeaderCapella - block *pb.ExecutionBlock - version int - } - wantedHash := common.BytesToHash([]byte("foo")) - tests := []struct { - name string - args args - want func() interfaces.ExecutionData - err string - }{ - { - name: "block hash field in header and block hash mismatch", - args: args{ - header: &pb.ExecutionPayloadHeaderCapella{ - BlockHash: []byte("foo"), - }, - block: &pb.ExecutionBlock{ - Hash: common.BytesToHash([]byte("bar")), - }, - version: version.Capella, - }, - err: "does not match execution block hash", - }, - { - name: "ok", - args: args{ - header: &pb.ExecutionPayloadHeaderCapella{ - BlockHash: wantedHash[:], - }, - block: &pb.ExecutionBlock{ - Hash: wantedHash, - }, - version: version.Capella, - }, - want: func() interfaces.ExecutionData { - p, err := blocks.WrappedExecutionPayloadCapella(&pb.ExecutionPayloadCapella{ - BlockHash: wantedHash[:], - Transactions: [][]byte{}, - }, big.NewInt(0)) - require.NoError(t, err) - return p - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - wrapped, err := blocks.WrappedExecutionPayloadHeaderCapella(tt.args.header, big.NewInt(0)) - require.NoError(t, err) - got, err := fullPayloadFromExecutionBlock(tt.args.version, wrapped, tt.args.block) - if err != nil { - assert.ErrorContains(t, tt.err, err) - } else { - assert.DeepEqual(t, tt.want(), got) - } - }) - } -} - -func Test_fullPayloadFromExecutionBlockDeneb(t *testing.T) { - type args struct { - header *pb.ExecutionPayloadHeaderDeneb - block *pb.ExecutionBlock - version int - } - wantedHash := common.BytesToHash([]byte("foo")) - tests := []struct { - name string - args args - want func() interfaces.ExecutionData - err string - }{ - { - name: "block hash field in header and block hash mismatch", - args: args{ - header: &pb.ExecutionPayloadHeaderDeneb{ - BlockHash: []byte("foo"), - }, - block: &pb.ExecutionBlock{ - Hash: common.BytesToHash([]byte("bar")), - }, - version: version.Deneb, - }, - err: "does not match execution block hash", - }, - { - name: "ok", - args: args{ - header: &pb.ExecutionPayloadHeaderDeneb{ - BlockHash: wantedHash[:], - }, - block: &pb.ExecutionBlock{ - Hash: wantedHash, - }, - version: version.Deneb, - }, - want: func() interfaces.ExecutionData { - p, err := blocks.WrappedExecutionPayloadDeneb(&pb.ExecutionPayloadDeneb{ - BlockHash: wantedHash[:], - Transactions: [][]byte{}, - }, big.NewInt(0)) - require.NoError(t, err) - return p - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - wrapped, err := blocks.WrappedExecutionPayloadHeaderDeneb(tt.args.header, big.NewInt(0)) - require.NoError(t, err) - got, err := fullPayloadFromExecutionBlock(tt.args.version, wrapped, tt.args.block) - if err != nil { - assert.ErrorContains(t, tt.err, err) - } else { - assert.DeepEqual(t, tt.want(), got) - } - }) - } -} - func TestHeaderByHash_NotFound(t *testing.T) { srv := &Service{} srv.rpcClient = RPCClientBad{} @@ -2035,6 +2050,40 @@ func newPayloadV3Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.Execu return service } +func newPayloadV4Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.ExecutionPayloadElectra) *Service { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + defer func() { + require.NoError(t, r.Body.Close()) + }() + enc, err := io.ReadAll(r.Body) + require.NoError(t, err) + jsonRequestString := string(enc) + + reqArg, err := json.Marshal(payload) + require.NoError(t, err) + + // We expect the JSON string RPC request contains the right arguments. + require.Equal(t, true, strings.Contains( + jsonRequestString, string(reqArg), + )) + resp := map[string]interface{}{ + "jsonrpc": "2.0", + "id": 1, + "result": status, + } + err = json.NewEncoder(w).Encode(resp) + require.NoError(t, err) + })) + + rpcClient, err := rpc.DialHTTP(srv.URL) + require.NoError(t, err) + + service := &Service{} + service.rpcClient = rpcClient + return service +} + func TestCapella_PayloadBodiesByHash(t *testing.T) { t.Run("empty response works", func(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index 35ca25671afe..2464d30de932 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -78,7 +78,7 @@ func (x PayloadStatus_Status) Number() protoreflect.EnumNumber { // Deprecated: Use PayloadStatus_Status.Descriptor instead. func (PayloadStatus_Status) EnumDescriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14, 0} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15, 0} } type ExecutionPayload struct { @@ -812,6 +812,77 @@ func (x *ExecutionPayloadElectra) GetWithdrawalRequests() []*ExecutionLayerWithd return nil } +type ExecutionPayloadElectraWithValueAndBlobsBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload *ExecutionPayloadElectra `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + BlobsBundle *BlobsBundle `protobuf:"bytes,3,opt,name=blobs_bundle,json=blobsBundle,proto3" json:"blobs_bundle,omitempty"` + ShouldOverrideBuilder bool `protobuf:"varint,4,opt,name=should_override_builder,json=shouldOverrideBuilder,proto3" json:"should_override_builder,omitempty"` +} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) Reset() { + *x = ExecutionPayloadElectraWithValueAndBlobsBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoMessage() {} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionPayloadElectraWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. +func (*ExecutionPayloadElectraWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} +} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadElectra { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetBlobsBundle() *BlobsBundle { + if x != nil { + return x.BlobsBundle + } + return nil +} + +func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetShouldOverrideBuilder() bool { + if x != nil { + return x.ShouldOverrideBuilder + } + return false +} + type ExecutionPayloadCapellaWithValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -824,7 +895,7 @@ type ExecutionPayloadCapellaWithValue struct { func (x *ExecutionPayloadCapellaWithValue) Reset() { *x = ExecutionPayloadCapellaWithValue{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -837,7 +908,7 @@ func (x *ExecutionPayloadCapellaWithValue) String() string { func (*ExecutionPayloadCapellaWithValue) ProtoMessage() {} func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -850,7 +921,7 @@ func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadCapellaWithValue.ProtoReflect.Descriptor instead. func (*ExecutionPayloadCapellaWithValue) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} } func (x *ExecutionPayloadCapellaWithValue) GetPayload() *ExecutionPayloadCapella { @@ -881,7 +952,7 @@ type ExecutionPayloadDenebWithValueAndBlobsBundle struct { func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) Reset() { *x = ExecutionPayloadDenebWithValueAndBlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -894,7 +965,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) String() string { func (*ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoMessage() {} func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -907,7 +978,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protorefle // Deprecated: Use ExecutionPayloadDenebWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. func (*ExecutionPayloadDenebWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} } func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadDeneb { @@ -962,7 +1033,7 @@ type ExecutionPayloadHeader struct { func (x *ExecutionPayloadHeader) Reset() { *x = ExecutionPayloadHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -975,7 +1046,7 @@ func (x *ExecutionPayloadHeader) String() string { func (*ExecutionPayloadHeader) ProtoMessage() {} func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -988,7 +1059,7 @@ func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeader.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeader) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} } func (x *ExecutionPayloadHeader) GetParentHash() []byte { @@ -1114,7 +1185,7 @@ type ExecutionPayloadHeaderCapella struct { func (x *ExecutionPayloadHeaderCapella) Reset() { *x = ExecutionPayloadHeaderCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1127,7 +1198,7 @@ func (x *ExecutionPayloadHeaderCapella) String() string { func (*ExecutionPayloadHeaderCapella) ProtoMessage() {} func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1140,7 +1211,7 @@ func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderCapella.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderCapella) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} } func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte { @@ -1275,7 +1346,7 @@ type ExecutionPayloadHeaderDeneb struct { func (x *ExecutionPayloadHeaderDeneb) Reset() { *x = ExecutionPayloadHeaderDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1288,7 +1359,7 @@ func (x *ExecutionPayloadHeaderDeneb) String() string { func (*ExecutionPayloadHeaderDeneb) ProtoMessage() {} func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1301,7 +1372,7 @@ func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderDeneb.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderDeneb) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} } func (x *ExecutionPayloadHeaderDeneb) GetParentHash() []byte { @@ -1452,7 +1523,7 @@ type ExecutionPayloadHeaderElectra struct { func (x *ExecutionPayloadHeaderElectra) Reset() { *x = ExecutionPayloadHeaderElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1465,7 +1536,7 @@ func (x *ExecutionPayloadHeaderElectra) String() string { func (*ExecutionPayloadHeaderElectra) ProtoMessage() {} func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1478,7 +1549,7 @@ func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderElectra.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderElectra) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} } func (x *ExecutionPayloadHeaderElectra) GetParentHash() []byte { @@ -1627,7 +1698,7 @@ type PayloadAttributes struct { func (x *PayloadAttributes) Reset() { *x = PayloadAttributes{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1640,7 +1711,7 @@ func (x *PayloadAttributes) String() string { func (*PayloadAttributes) ProtoMessage() {} func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1653,7 +1724,7 @@ func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead. func (*PayloadAttributes) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} } func (x *PayloadAttributes) GetTimestamp() uint64 { @@ -1691,7 +1762,7 @@ type PayloadAttributesV2 struct { func (x *PayloadAttributesV2) Reset() { *x = PayloadAttributesV2{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1704,7 +1775,7 @@ func (x *PayloadAttributesV2) String() string { func (*PayloadAttributesV2) ProtoMessage() {} func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1717,7 +1788,7 @@ func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV2.ProtoReflect.Descriptor instead. func (*PayloadAttributesV2) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} } func (x *PayloadAttributesV2) GetTimestamp() uint64 { @@ -1763,7 +1834,7 @@ type PayloadAttributesV3 struct { func (x *PayloadAttributesV3) Reset() { *x = PayloadAttributesV3{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1776,7 +1847,7 @@ func (x *PayloadAttributesV3) String() string { func (*PayloadAttributesV3) ProtoMessage() {} func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1789,7 +1860,7 @@ func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV3.ProtoReflect.Descriptor instead. func (*PayloadAttributesV3) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} } func (x *PayloadAttributesV3) GetTimestamp() uint64 { @@ -1840,7 +1911,7 @@ type PayloadStatus struct { func (x *PayloadStatus) Reset() { *x = PayloadStatus{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1853,7 +1924,7 @@ func (x *PayloadStatus) String() string { func (*PayloadStatus) ProtoMessage() {} func (x *PayloadStatus) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1866,7 +1937,7 @@ func (x *PayloadStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadStatus.ProtoReflect.Descriptor instead. func (*PayloadStatus) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} } func (x *PayloadStatus) GetStatus() PayloadStatus_Status { @@ -1903,7 +1974,7 @@ type ForkchoiceState struct { func (x *ForkchoiceState) Reset() { *x = ForkchoiceState{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1916,7 +1987,7 @@ func (x *ForkchoiceState) String() string { func (*ForkchoiceState) ProtoMessage() {} func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1929,7 +2000,7 @@ func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkchoiceState.ProtoReflect.Descriptor instead. func (*ForkchoiceState) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} } func (x *ForkchoiceState) GetHeadBlockHash() []byte { @@ -1967,7 +2038,7 @@ type Withdrawal struct { func (x *Withdrawal) Reset() { *x = Withdrawal{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1980,7 +2051,7 @@ func (x *Withdrawal) String() string { func (*Withdrawal) ProtoMessage() {} func (x *Withdrawal) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1993,7 +2064,7 @@ func (x *Withdrawal) ProtoReflect() protoreflect.Message { // Deprecated: Use Withdrawal.ProtoReflect.Descriptor instead. func (*Withdrawal) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} } func (x *Withdrawal) GetIndex() uint64 { @@ -2037,7 +2108,7 @@ type BlobsBundle struct { func (x *BlobsBundle) Reset() { *x = BlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2050,7 +2121,7 @@ func (x *BlobsBundle) String() string { func (*BlobsBundle) ProtoMessage() {} func (x *BlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2063,7 +2134,7 @@ func (x *BlobsBundle) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobsBundle.ProtoReflect.Descriptor instead. func (*BlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{18} } func (x *BlobsBundle) GetKzgCommitments() [][]byte { @@ -2098,7 +2169,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2111,7 +2182,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2124,7 +2195,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message { // Deprecated: Use Blob.ProtoReflect.Descriptor instead. func (*Blob) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{18} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{19} } func (x *Blob) GetData() []byte { @@ -2145,7 +2216,7 @@ type ExchangeCapabilities struct { func (x *ExchangeCapabilities) Reset() { *x = ExchangeCapabilities{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2158,7 +2229,7 @@ func (x *ExchangeCapabilities) String() string { func (*ExchangeCapabilities) ProtoMessage() {} func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2171,7 +2242,7 @@ func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeCapabilities.ProtoReflect.Descriptor instead. func (*ExchangeCapabilities) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{19} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} } func (x *ExchangeCapabilities) GetSupportedMethods() []string { @@ -2194,7 +2265,7 @@ type ExecutionLayerWithdrawalRequest struct { func (x *ExecutionLayerWithdrawalRequest) Reset() { *x = ExecutionLayerWithdrawalRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2207,7 +2278,7 @@ func (x *ExecutionLayerWithdrawalRequest) String() string { func (*ExecutionLayerWithdrawalRequest) ProtoMessage() {} func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2220,7 +2291,7 @@ func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionLayerWithdrawalRequest.ProtoReflect.Descriptor instead. func (*ExecutionLayerWithdrawalRequest) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} } func (x *ExecutionLayerWithdrawalRequest) GetSourceAddress() []byte { @@ -2259,7 +2330,7 @@ type DepositReceipt struct { func (x *DepositReceipt) Reset() { *x = DepositReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2272,7 +2343,7 @@ func (x *DepositReceipt) String() string { func (*DepositReceipt) ProtoMessage() {} func (x *DepositReceipt) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2285,7 +2356,7 @@ func (x *DepositReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use DepositReceipt.ProtoReflect.Descriptor instead. func (*DepositReceipt) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{22} } func (x *DepositReceipt) GetPubkey() []byte { @@ -2523,70 +2594,171 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, - 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x89, 0x02, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, + 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, + 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, + 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, + 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, + 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, + 0x72, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x57, 0x69, 0x74, 0x68, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, - 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, - 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, - 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, - 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, - 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, - 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, - 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, - 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, - 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, - 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, + 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x57, 0x69, 0x74, 0x68, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, + 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, + 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, + 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, + 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, + 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, + 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, + 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, + 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xfa, 0x04, + 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, + 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, + 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, + 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, + 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, + 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, + 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, + 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, + 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, 0x05, 0x0a, 0x1b, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, + 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, + 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, + 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, + 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, + 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, + 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, + 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, + 0x73, 0x22, 0xc4, 0x06, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, @@ -2623,238 +2795,154 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, - 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, - 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, - 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, - 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, - 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, - 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, - 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, - 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, - 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, - 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, - 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, - 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, - 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, - 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, - 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, - 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0xc4, 0x06, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, - 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, - 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, - 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, - 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, - 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, - 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, - 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, - 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, - 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, - 0x0a, 0x15, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, - 0x11, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, - 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, - 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, - 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, - 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, - 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, - 0x6c, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, - 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, - 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, - 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x32, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x60, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, - 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, - 0x0a, 0x07, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, - 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, - 0x05, 0x22, 0xab, 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, - 0xd6, 0x01, 0x0a, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, - 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, - 0x30, 0x39, 0x36, 0x52, 0x0e, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, - 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, - 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, - 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, - 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, - 0x62, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x43, 0x0a, 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x1f, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, - 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, - 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, + 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, + 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, + 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, + 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, 0x0a, 0x15, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, + 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xa7, + 0x02, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, + 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, + 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, + 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x11, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, 0x06, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, + 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, + 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, 0xab, 0x01, + 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0a, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, - 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, + 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, + 0x0e, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x28, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, + 0x36, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, + 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, + 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, + 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, + 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, + 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x1f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2870,50 +2958,53 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte { } var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ - (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status - (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload - (*ExecutionPayloadBodyV1)(nil), // 2: ethereum.engine.v1.ExecutionPayloadBodyV1 - (*ExecutionPayloadCapella)(nil), // 3: ethereum.engine.v1.ExecutionPayloadCapella - (*ExecutionPayloadDeneb)(nil), // 4: ethereum.engine.v1.ExecutionPayloadDeneb - (*ExecutionPayloadElectra)(nil), // 5: ethereum.engine.v1.ExecutionPayloadElectra - (*ExecutionPayloadCapellaWithValue)(nil), // 6: ethereum.engine.v1.ExecutionPayloadCapellaWithValue - (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 7: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle - (*ExecutionPayloadHeader)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeader - (*ExecutionPayloadHeaderCapella)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*ExecutionPayloadHeaderDeneb)(nil), // 10: ethereum.engine.v1.ExecutionPayloadHeaderDeneb - (*ExecutionPayloadHeaderElectra)(nil), // 11: ethereum.engine.v1.ExecutionPayloadHeaderElectra - (*PayloadAttributes)(nil), // 12: ethereum.engine.v1.PayloadAttributes - (*PayloadAttributesV2)(nil), // 13: ethereum.engine.v1.PayloadAttributesV2 - (*PayloadAttributesV3)(nil), // 14: ethereum.engine.v1.PayloadAttributesV3 - (*PayloadStatus)(nil), // 15: ethereum.engine.v1.PayloadStatus - (*ForkchoiceState)(nil), // 16: ethereum.engine.v1.ForkchoiceState - (*Withdrawal)(nil), // 17: ethereum.engine.v1.Withdrawal - (*BlobsBundle)(nil), // 18: ethereum.engine.v1.BlobsBundle - (*Blob)(nil), // 19: ethereum.engine.v1.Blob - (*ExchangeCapabilities)(nil), // 20: ethereum.engine.v1.ExchangeCapabilities - (*ExecutionLayerWithdrawalRequest)(nil), // 21: ethereum.engine.v1.ExecutionLayerWithdrawalRequest - (*DepositReceipt)(nil), // 22: ethereum.engine.v1.DepositReceipt + (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status + (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload + (*ExecutionPayloadBodyV1)(nil), // 2: ethereum.engine.v1.ExecutionPayloadBodyV1 + (*ExecutionPayloadCapella)(nil), // 3: ethereum.engine.v1.ExecutionPayloadCapella + (*ExecutionPayloadDeneb)(nil), // 4: ethereum.engine.v1.ExecutionPayloadDeneb + (*ExecutionPayloadElectra)(nil), // 5: ethereum.engine.v1.ExecutionPayloadElectra + (*ExecutionPayloadElectraWithValueAndBlobsBundle)(nil), // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle + (*ExecutionPayloadCapellaWithValue)(nil), // 7: ethereum.engine.v1.ExecutionPayloadCapellaWithValue + (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 8: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle + (*ExecutionPayloadHeader)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeader + (*ExecutionPayloadHeaderCapella)(nil), // 10: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*ExecutionPayloadHeaderDeneb)(nil), // 11: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*ExecutionPayloadHeaderElectra)(nil), // 12: ethereum.engine.v1.ExecutionPayloadHeaderElectra + (*PayloadAttributes)(nil), // 13: ethereum.engine.v1.PayloadAttributes + (*PayloadAttributesV2)(nil), // 14: ethereum.engine.v1.PayloadAttributesV2 + (*PayloadAttributesV3)(nil), // 15: ethereum.engine.v1.PayloadAttributesV3 + (*PayloadStatus)(nil), // 16: ethereum.engine.v1.PayloadStatus + (*ForkchoiceState)(nil), // 17: ethereum.engine.v1.ForkchoiceState + (*Withdrawal)(nil), // 18: ethereum.engine.v1.Withdrawal + (*BlobsBundle)(nil), // 19: ethereum.engine.v1.BlobsBundle + (*Blob)(nil), // 20: ethereum.engine.v1.Blob + (*ExchangeCapabilities)(nil), // 21: ethereum.engine.v1.ExchangeCapabilities + (*ExecutionLayerWithdrawalRequest)(nil), // 22: ethereum.engine.v1.ExecutionLayerWithdrawalRequest + (*DepositReceipt)(nil), // 23: ethereum.engine.v1.DepositReceipt } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ - 17, // 0: ethereum.engine.v1.ExecutionPayloadBodyV1.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 1: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 2: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 3: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 22, // 4: ethereum.engine.v1.ExecutionPayloadElectra.deposit_receipts:type_name -> ethereum.engine.v1.DepositReceipt - 21, // 5: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.ExecutionLayerWithdrawalRequest - 3, // 6: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 4, // 7: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 18, // 8: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 17, // 9: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 10: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 0, // 11: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 18, // 0: ethereum.engine.v1.ExecutionPayloadBodyV1.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 18, // 1: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 18, // 2: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 18, // 3: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 23, // 4: ethereum.engine.v1.ExecutionPayloadElectra.deposit_receipts:type_name -> ethereum.engine.v1.DepositReceipt + 22, // 5: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.ExecutionLayerWithdrawalRequest + 5, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra + 19, // 7: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 3, // 8: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella + 4, // 9: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 19, // 10: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 18, // 11: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 18, // 12: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 0, // 13: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_proto_engine_v1_execution_engine_proto_init() } @@ -2983,7 +3074,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadCapellaWithValue); i { + switch v := v.(*ExecutionPayloadElectraWithValueAndBlobsBundle); i { case 0: return &v.state case 1: @@ -2995,7 +3086,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { + switch v := v.(*ExecutionPayloadCapellaWithValue); i { case 0: return &v.state case 1: @@ -3007,7 +3098,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeader); i { + switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { case 0: return &v.state case 1: @@ -3019,7 +3110,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeaderCapella); i { + switch v := v.(*ExecutionPayloadHeader); i { case 0: return &v.state case 1: @@ -3031,7 +3122,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeaderDeneb); i { + switch v := v.(*ExecutionPayloadHeaderCapella); i { case 0: return &v.state case 1: @@ -3043,7 +3134,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeaderElectra); i { + switch v := v.(*ExecutionPayloadHeaderDeneb); i { case 0: return &v.state case 1: @@ -3055,7 +3146,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttributes); i { + switch v := v.(*ExecutionPayloadHeaderElectra); i { case 0: return &v.state case 1: @@ -3067,7 +3158,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttributesV2); i { + switch v := v.(*PayloadAttributes); i { case 0: return &v.state case 1: @@ -3079,7 +3170,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttributesV3); i { + switch v := v.(*PayloadAttributesV2); i { case 0: return &v.state case 1: @@ -3091,7 +3182,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadStatus); i { + switch v := v.(*PayloadAttributesV3); i { case 0: return &v.state case 1: @@ -3103,7 +3194,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForkchoiceState); i { + switch v := v.(*PayloadStatus); i { case 0: return &v.state case 1: @@ -3115,7 +3206,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Withdrawal); i { + switch v := v.(*ForkchoiceState); i { case 0: return &v.state case 1: @@ -3127,7 +3218,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobsBundle); i { + switch v := v.(*Withdrawal); i { case 0: return &v.state case 1: @@ -3139,7 +3230,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Blob); i { + switch v := v.(*BlobsBundle); i { case 0: return &v.state case 1: @@ -3151,7 +3242,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExchangeCapabilities); i { + switch v := v.(*Blob); i { case 0: return &v.state case 1: @@ -3163,7 +3254,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionLayerWithdrawalRequest); i { + switch v := v.(*ExchangeCapabilities); i { case 0: return &v.state case 1: @@ -3175,6 +3266,18 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExecutionLayerWithdrawalRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_execution_engine_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DepositReceipt); i { case 0: return &v.state @@ -3193,7 +3296,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc, NumEnums: 1, - NumMessages: 22, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index 8cfd0b60b2b2..6085c05c9b44 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -109,6 +109,13 @@ message ExecutionPayloadElectra { repeated ExecutionLayerWithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251 } +message ExecutionPayloadElectraWithValueAndBlobsBundle { + ExecutionPayloadElectra payload = 1; + bytes value = 2; + BlobsBundle blobs_bundle = 3; + bool should_override_builder = 4; +} + message ExecutionPayloadCapellaWithValue { ExecutionPayloadCapella payload = 1; bytes value = 2; diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index 31f5c5949221..f6c7d78d013b 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -16,6 +16,47 @@ import ( "github.com/prysmaticlabs/prysm/v5/runtime/version" ) +const ( + BlsPubKeyLen = 48 + BlsSignLen = 96 +) + +// BlsPubkey represents a 48 byte BLS public key. +type BlsPubkey [BlsPubKeyLen]byte + +// MarshalText returns the hex representation of a. +func (v BlsPubkey) MarshalText() ([]byte, error) { + return hexutil.Bytes(v[:]).MarshalText() +} + +// UnmarshalText parses a hash in hex syntax. +func (v *BlsPubkey) UnmarshalText(input []byte) error { + return hexutil.UnmarshalFixedText("BlsPubkey", input, v[:]) +} + +// Bytes is a convenient way to get the byte slice for a BlsPubkey. +func (v BlsPubkey) Bytes() []byte { + return v[:] +} + +// BlsSig represents a 96 byte BLS signature. +type BlsSig [BlsSignLen]byte + +// MarshalText returns the hex representation of a BlsSig. +func (v BlsSig) MarshalText() ([]byte, error) { + return hexutil.Bytes(v[:]).MarshalText() +} + +// UnmarshalText parses a BlsSig in hex encoding. +func (v *BlsSig) UnmarshalText(input []byte) error { + return hexutil.UnmarshalFixedText("BlsSig", input, v[:]) +} + +// Bytes is a convenient way to get the byte slice for a BlsSig. +func (v BlsSig) Bytes() []byte { + return v[:] +} + // PayloadIDBytes defines a custom type for Payload IDs used by the engine API // client with proper JSON Marshal and Unmarshal methods to hex. type PayloadIDBytes [8]byte @@ -254,6 +295,94 @@ type GetPayloadV3ResponseJson struct { ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"` } +type GetPayloadV4ResponseJson struct { + ExecutionPayload *ExecutionPayloadElectraJSON `json:"executionPayload"` + BlockValue string `json:"blockValue"` + BlobsBundle *BlobBundleJSON `json:"blobsBundle"` + ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"` +} + +// ExecutionPayloadElectraJSON represents the engine API ExecutionPayloadV4 type. +type ExecutionPayloadElectraJSON struct { + ParentHash *common.Hash `json:"parentHash"` + FeeRecipient *common.Address `json:"feeRecipient"` + StateRoot *common.Hash `json:"stateRoot"` + ReceiptsRoot *common.Hash `json:"receiptsRoot"` + LogsBloom *hexutil.Bytes `json:"logsBloom"` + PrevRandao *common.Hash `json:"prevRandao"` + BlockNumber *hexutil.Uint64 `json:"blockNumber"` + GasLimit *hexutil.Uint64 `json:"gasLimit"` + GasUsed *hexutil.Uint64 `json:"gasUsed"` + Timestamp *hexutil.Uint64 `json:"timestamp"` + ExtraData hexutil.Bytes `json:"extraData"` + BaseFeePerGas string `json:"baseFeePerGas"` + BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` + ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` + BlockHash *common.Hash `json:"blockHash"` + Transactions []hexutil.Bytes `json:"transactions"` + Withdrawals []*Withdrawal `json:"withdrawals"` + WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` + DepositRequests []DepositRequestV1 `json:"depositRequests"` +} + +// Validate returns an error if key fields in GetPayloadV4ResponseJson are nil or invalid. +func (j *GetPayloadV4ResponseJson) Validate() error { + if j.ExecutionPayload == nil { + return errors.New("nil ExecutionPayload") + } + return j.ExecutionPayload.Validate() +} + +// Validate returns an error if key fields in ExecutionPayloadElectraJSON are nil or invalid. +func (j *ExecutionPayloadElectraJSON) Validate() error { + if j.ParentHash == nil { + return errors.New("missing required field 'parentHash' for ExecutionPayload") + } + if j.FeeRecipient == nil { + return errors.New("missing required field 'feeRecipient' for ExecutionPayload") + } + if j.StateRoot == nil { + return errors.New("missing required field 'stateRoot' for ExecutionPayload") + } + if j.ReceiptsRoot == nil { + return errors.New("missing required field 'receiptsRoot' for ExecutableDataV1") + } + if j.LogsBloom == nil { + return errors.New("missing required field 'logsBloom' for ExecutionPayload") + } + if j.PrevRandao == nil { + return errors.New("missing required field 'prevRandao' for ExecutionPayload") + } + if j.ExtraData == nil { + return errors.New("missing required field 'extraData' for ExecutionPayload") + } + if j.BlockHash == nil { + return errors.New("missing required field 'blockHash' for ExecutionPayload") + } + if j.Transactions == nil { + return errors.New("missing required field 'transactions' for ExecutionPayload") + } + if j.BlockNumber == nil { + return errors.New("missing required field 'blockNumber' for ExecutionPayload") + } + if j.Timestamp == nil { + return errors.New("missing required field 'timestamp' for ExecutionPayload") + } + if j.GasUsed == nil { + return errors.New("missing required field 'gasUsed' for ExecutionPayload") + } + if j.GasLimit == nil { + return errors.New("missing required field 'gasLimit' for ExecutionPayload") + } + if j.BlobGasUsed == nil { + return errors.New("missing required field 'blobGasUsed' for ExecutionPayload") + } + if j.ExcessBlobGas == nil { + return errors.New("missing required field 'excessBlobGas' for ExecutionPayload") + } + return nil +} + type ExecutionPayloadDenebJSON struct { ParentHash *common.Hash `json:"parentHash"` FeeRecipient *common.Address `json:"feeRecipient"` @@ -274,6 +403,29 @@ type ExecutionPayloadDenebJSON struct { Withdrawals []*Withdrawal `json:"withdrawals"` } +// WithdrawalRequestV1 represents an execution engine WithdrawalRequestV1 value +// https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#withdrawalrequestv1 +type WithdrawalRequestV1 struct { + SourceAddress *common.Address `json:"sourceAddress"` + ValidatorPubkey *BlsPubkey `json:"validatorPublicKey"` + Amount *hexutil.Uint64 `json:"amount"` +} + +// DepositRequestV1 represents an execution engine DepositRequestV1 value +// https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#depositrequestv1 +type DepositRequestV1 struct { + // pubkey: DATA, 48 Bytes + PubKey *BlsPubkey `json:"pubkey"` + // withdrawalCredentials: DATA, 32 Bytes + WithdrawalCredentials *common.Hash `json:"withdrawalCredentials"` + // amount: QUANTITY, 64 Bits + Amount *hexutil.Uint64 `json:"amount"` + // signature: DATA, 96 Bytes + Signature *BlsSig `json:"signature"` + // index: QUANTITY, 64 Bits + Index *hexutil.Uint64 `json:"index"` +} + // MarshalJSON -- func (e *ExecutionPayload) MarshalJSON() ([]byte, error) { transactions := make([]hexutil.Bytes, len(e.Transactions)) @@ -746,6 +898,218 @@ func (e *ExecutionPayloadDeneb) MarshalJSON() ([]byte, error) { }) } +func (e *ExecutionPayloadElectra) MarshalJSON() ([]byte, error) { + transactions := make([]hexutil.Bytes, len(e.Transactions)) + for i, tx := range e.Transactions { + transactions[i] = tx + } + baseFee := new(big.Int).SetBytes(bytesutil.ReverseByteOrder(e.BaseFeePerGas)) + baseFeeHex := hexutil.EncodeBig(baseFee) + pHash := common.BytesToHash(e.ParentHash) + sRoot := common.BytesToHash(e.StateRoot) + recRoot := common.BytesToHash(e.ReceiptsRoot) + prevRan := common.BytesToHash(e.PrevRandao) + bHash := common.BytesToHash(e.BlockHash) + blockNum := hexutil.Uint64(e.BlockNumber) + gasLimit := hexutil.Uint64(e.GasLimit) + gasUsed := hexutil.Uint64(e.GasUsed) + timeStamp := hexutil.Uint64(e.Timestamp) + recipient := common.BytesToAddress(e.FeeRecipient) + logsBloom := hexutil.Bytes(e.LogsBloom) + withdrawals := e.Withdrawals + if withdrawals == nil { + withdrawals = make([]*Withdrawal, 0) + } + blobGasUsed := hexutil.Uint64(e.BlobGasUsed) + excessBlobGas := hexutil.Uint64(e.ExcessBlobGas) + + return json.Marshal(ExecutionPayloadElectraJSON{ + ParentHash: &pHash, + FeeRecipient: &recipient, + StateRoot: &sRoot, + ReceiptsRoot: &recRoot, + LogsBloom: &logsBloom, + PrevRandao: &prevRan, + BlockNumber: &blockNum, + GasLimit: &gasLimit, + GasUsed: &gasUsed, + Timestamp: &timeStamp, + ExtraData: e.ExtraData, + BaseFeePerGas: baseFeeHex, + BlockHash: &bHash, + Transactions: transactions, + Withdrawals: withdrawals, + BlobGasUsed: &blobGasUsed, + ExcessBlobGas: &excessBlobGas, + WithdrawalRequests: WithdrawalRequestProtoToJson(e.WithdrawalRequests), + DepositRequests: DepositRequestProtoToJson(e.DepositReceipts), + }) +} + +func (j *ExecutionPayloadElectraJSON) ElectraDepositReceipts() []*DepositReceipt { + rcpt := make([]*DepositReceipt, len(j.DepositRequests)) + + for i := range j.DepositRequests { + req := j.DepositRequests[i] + rcpt[i] = &DepositReceipt{ + Pubkey: req.PubKey.Bytes(), + WithdrawalCredentials: req.WithdrawalCredentials.Bytes(), + Amount: uint64(*req.Amount), + Signature: req.Signature.Bytes(), + Index: uint64(*req.Index), + } + } + + return rcpt +} + +func DepositRequestProtoToJson(reqs []*DepositReceipt) []DepositRequestV1 { + j := make([]DepositRequestV1, len(reqs)) + for i := range reqs { + r := reqs[i] + pk := BlsPubkey{} + copy(pk[:], r.Pubkey) + creds := common.BytesToHash(r.WithdrawalCredentials) + amt := hexutil.Uint64(r.Amount) + sig := BlsSig{} + copy(sig[:], r.Signature) + idx := hexutil.Uint64(r.Index) + j[i] = DepositRequestV1{ + PubKey: &pk, + WithdrawalCredentials: &creds, + Amount: &amt, + Signature: &sig, + Index: &idx, + } + } + return j +} + +func (j *ExecutionPayloadElectraJSON) ElectraExecutionLayerWithdrawalRequests() []*ExecutionLayerWithdrawalRequest { + reqs := make([]*ExecutionLayerWithdrawalRequest, len(j.WithdrawalRequests)) + + for i := range j.WithdrawalRequests { + req := j.WithdrawalRequests[i] + reqs[i] = &ExecutionLayerWithdrawalRequest{ + SourceAddress: req.SourceAddress.Bytes(), + ValidatorPubkey: req.ValidatorPubkey.Bytes(), + Amount: uint64(*req.Amount), + } + } + + return reqs +} + +func WithdrawalRequestProtoToJson(reqs []*ExecutionLayerWithdrawalRequest) []WithdrawalRequestV1 { + j := make([]WithdrawalRequestV1, len(reqs)) + for i := range reqs { + r := reqs[i] + pk := BlsPubkey{} + amt := hexutil.Uint64(r.Amount) + copy(pk[:], r.ValidatorPubkey) + address := common.BytesToAddress(r.SourceAddress) + j[i] = WithdrawalRequestV1{ + SourceAddress: &address, + ValidatorPubkey: &pk, + Amount: &amt, + } + } + return j +} + +func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra, error) { + baseFeeBigEnd, err := hexutil.DecodeBig(j.BaseFeePerGas) + if err != nil { + return nil, err + } + baseFee := bytesutil.PadTo(bytesutil.ReverseByteOrder(baseFeeBigEnd.Bytes()), fieldparams.RootLength) + + transactions := make([][]byte, len(j.Transactions)) + for i, tx := range j.Transactions { + transactions[i] = tx + } + if j.Withdrawals == nil { + j.Withdrawals = make([]*Withdrawal, 0) + } + return &ExecutionPayloadElectra{ + ParentHash: j.ParentHash.Bytes(), + FeeRecipient: j.FeeRecipient.Bytes(), + StateRoot: j.StateRoot.Bytes(), + ReceiptsRoot: j.ReceiptsRoot.Bytes(), + LogsBloom: *j.LogsBloom, + PrevRandao: j.PrevRandao.Bytes(), + BlockNumber: uint64(*j.BlockNumber), + GasLimit: uint64(*j.GasLimit), + GasUsed: uint64(*j.GasUsed), + Timestamp: uint64(*j.Timestamp), + ExtraData: j.ExtraData, + BaseFeePerGas: baseFee, + BlockHash: j.BlockHash.Bytes(), + Transactions: transactions, + Withdrawals: j.Withdrawals, + BlobGasUsed: uint64(*j.BlobGasUsed), + ExcessBlobGas: uint64(*j.ExcessBlobGas), + DepositReceipts: j.ElectraDepositReceipts(), + WithdrawalRequests: j.ElectraExecutionLayerWithdrawalRequests(), + }, nil +} + +func (j *BlobBundleJSON) ElectraBlobsBundle() *BlobsBundle { + if j == nil { + return nil + } + + commitments := make([][]byte, len(j.Commitments)) + for i, kzg := range j.Commitments { + k := kzg + commitments[i] = bytesutil.PadTo(k[:], fieldparams.BLSPubkeyLength) + } + + proofs := make([][]byte, len(j.Proofs)) + for i, proof := range j.Proofs { + p := proof + proofs[i] = bytesutil.PadTo(p[:], fieldparams.BLSPubkeyLength) + } + + blobs := make([][]byte, len(j.Blobs)) + for i, blob := range j.Blobs { + b := make([]byte, fieldparams.BlobLength) + copy(b, blob) + blobs[i] = b + } + + return &BlobsBundle{ + KzgCommitments: commitments, + Proofs: proofs, + Blobs: blobs, + } +} + +func (e *ExecutionPayloadElectraWithValueAndBlobsBundle) UnmarshalJSON(enc []byte) error { + dec := &GetPayloadV4ResponseJson{} + if err := json.Unmarshal(enc, dec); err != nil { + return err + } + if err := dec.Validate(); err != nil { + return err + } + + *e = ExecutionPayloadElectraWithValueAndBlobsBundle{Payload: &ExecutionPayloadElectra{}} + e.ShouldOverrideBuilder = dec.ShouldOverrideBuilder + blockValueBigEnd, err := hexutil.DecodeBig(dec.BlockValue) + if err != nil { + return errors.Wrapf(err, "failed to parse blockValue=%s", dec.BlockValue) + } + e.Value = bytesutil.PadTo(bytesutil.ReverseByteOrder(blockValueBigEnd.Bytes()), fieldparams.RootLength) + e.Payload, err = dec.ExecutionPayload.ElectraPayload() + if err != nil { + return err + } + e.BlobsBundle = dec.BlobsBundle.ElectraBlobsBundle() + + return nil +} + func (e *ExecutionPayloadDenebWithValueAndBlobsBundle) UnmarshalJSON(enc []byte) error { dec := GetPayloadV3ResponseJson{} if err := json.Unmarshal(enc, &dec); err != nil { diff --git a/proto/engine/v1/json_marshal_unmarshal_test.go b/proto/engine/v1/json_marshal_unmarshal_test.go index c80263e07659..b2dfbddc6a66 100644 --- a/proto/engine/v1/json_marshal_unmarshal_test.go +++ b/proto/engine/v1/json_marshal_unmarshal_test.go @@ -132,7 +132,7 @@ func TestJsonMarshalUnmarshal(t *testing.T) { ts := hexutil.Uint64(4) resp := &enginev1.GetPayloadV2ResponseJson{ - BlockValue: fmt.Sprint("0x123"), + BlockValue: "0x123", ExecutionPayload: &enginev1.ExecutionPayloadCapellaJSON{ ParentHash: &parentHash, FeeRecipient: &feeRecipient, @@ -204,7 +204,7 @@ func TestJsonMarshalUnmarshal(t *testing.T) { Proofs: []hexutil.Bytes{{'e'}, {'f'}, {'g'}, {'h'}}, Blobs: []hexutil.Bytes{{'i'}, {'j'}, {'k'}, {'l'}}, }, - BlockValue: fmt.Sprint("0x123"), + BlockValue: "0x123", ExecutionPayload: &enginev1.ExecutionPayloadDenebJSON{ ParentHash: &parentHash, FeeRecipient: &feeRecipient, @@ -273,7 +273,148 @@ func TestJsonMarshalUnmarshal(t *testing.T) { bytesutil.PadTo([]byte{'k'}, 131072), bytesutil.PadTo([]byte{'l'}, 131072)}, pb.BlobsBundle.Blobs) }) + t.Run("execution payload electra", func(t *testing.T) { + parentHash := common.BytesToHash([]byte("parent")) + feeRecipient := common.BytesToAddress([]byte("feeRecipient")) + stateRoot := common.BytesToHash([]byte("stateRoot")) + receiptsRoot := common.BytesToHash([]byte("receiptsRoot")) + logsBloom := hexutil.Bytes(bytesutil.PadTo([]byte("logs"), fieldparams.LogsBloomLength)) + random := common.BytesToHash([]byte("random")) + extra := common.BytesToHash([]byte("extra")) + hash := common.BytesToHash([]byte("hash")) + bn := hexutil.Uint64(1) + gl := hexutil.Uint64(2) + gu := hexutil.Uint64(3) + ts := hexutil.Uint64(4) + bgu := hexutil.Uint64(5) + ebg := hexutil.Uint64(6) + + withdrawalReq := []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: bytesutil.PadTo([]byte("sourceAddress-1"), 20), + ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-1"), 48), + Amount: 1, + }, + { + SourceAddress: bytesutil.PadTo([]byte("sourceAddress-2"), 20), + ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-2"), 48), + Amount: 2, + }, + { + SourceAddress: bytesutil.PadTo([]byte("sourceAddress-3"), 20), + ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-3"), 48), + Amount: 3, + }, + } + depositReq := []*enginev1.DepositReceipt{ + { + Pubkey: bytesutil.PadTo([]byte("pubKey-1"), 48), + WithdrawalCredentials: bytesutil.PadTo([]byte("creds-1"), 32), + Amount: 1, + Signature: bytesutil.PadTo([]byte("sig-1"), 96), + Index: 11, + }, + { + Pubkey: bytesutil.PadTo([]byte("pubKey-2"), 48), + WithdrawalCredentials: bytesutil.PadTo([]byte("creds-2"), 32), + Amount: 2, + Signature: bytesutil.PadTo([]byte("sig-2"), 96), + Index: 12, + }, + { + Pubkey: bytesutil.PadTo([]byte("pubKey-3"), 48), + WithdrawalCredentials: bytesutil.PadTo([]byte("creds-3"), 32), + Amount: 3, + Signature: bytesutil.PadTo([]byte("sig-3"), 96), + Index: 13, + }, + } + resp := &enginev1.GetPayloadV4ResponseJson{ + BlobsBundle: &enginev1.BlobBundleJSON{ + Commitments: []hexutil.Bytes{{'a'}, {'b'}, {'c'}, {'d'}}, + Proofs: []hexutil.Bytes{{'e'}, {'f'}, {'g'}, {'h'}}, + Blobs: []hexutil.Bytes{{'i'}, {'j'}, {'k'}, {'l'}}, + }, + BlockValue: "0x123", + ExecutionPayload: &enginev1.ExecutionPayloadElectraJSON{ + ParentHash: &parentHash, + FeeRecipient: &feeRecipient, + StateRoot: &stateRoot, + ReceiptsRoot: &receiptsRoot, + LogsBloom: &logsBloom, + PrevRandao: &random, + BlockNumber: &bn, + GasLimit: &gl, + GasUsed: &gu, + Timestamp: &ts, + ExtraData: hexutil.Bytes(extra[:]), + BaseFeePerGas: "0x123", + BlockHash: &hash, + Transactions: []hexutil.Bytes{{}}, + Withdrawals: []*enginev1.Withdrawal{{ + Index: 1, + ValidatorIndex: 1, + Address: bytesutil.PadTo([]byte("address"), 20), + Amount: 1, + }}, + BlobGasUsed: &bgu, + ExcessBlobGas: &ebg, + WithdrawalRequests: enginev1.WithdrawalRequestProtoToJson(withdrawalReq), + DepositRequests: enginev1.DepositRequestProtoToJson(depositReq), + }, + } + enc, err := json.Marshal(resp) + require.NoError(t, err) + pb := &enginev1.ExecutionPayloadElectraWithValueAndBlobsBundle{} + require.NoError(t, json.Unmarshal(enc, pb)) + require.DeepEqual(t, parentHash.Bytes(), pb.Payload.ParentHash) + require.DeepEqual(t, feeRecipient.Bytes(), pb.Payload.FeeRecipient) + require.DeepEqual(t, stateRoot.Bytes(), pb.Payload.StateRoot) + require.DeepEqual(t, receiptsRoot.Bytes(), pb.Payload.ReceiptsRoot) + require.DeepEqual(t, logsBloom, hexutil.Bytes(pb.Payload.LogsBloom)) + require.DeepEqual(t, random.Bytes(), pb.Payload.PrevRandao) + require.DeepEqual(t, uint64(1), pb.Payload.BlockNumber) + require.DeepEqual(t, uint64(2), pb.Payload.GasLimit) + require.DeepEqual(t, uint64(3), pb.Payload.GasUsed) + require.DeepEqual(t, uint64(4), pb.Payload.Timestamp) + require.DeepEqual(t, uint64(5), pb.Payload.BlobGasUsed) + require.DeepEqual(t, uint64(6), pb.Payload.ExcessBlobGas) + require.DeepEqual(t, extra.Bytes(), pb.Payload.ExtraData) + feePerGas := new(big.Int).SetBytes(pb.Payload.BaseFeePerGas) + require.Equal(t, "15832716547479101977395928904157292820330083199902421483727713169783165812736", feePerGas.String()) + require.DeepEqual(t, hash.Bytes(), pb.Payload.BlockHash) + require.DeepEqual(t, [][]byte{{}}, pb.Payload.Transactions) + require.Equal(t, 1, len(pb.Payload.Withdrawals)) + withdrawal := pb.Payload.Withdrawals[0] + require.Equal(t, uint64(1), withdrawal.Index) + require.Equal(t, primitives.ValidatorIndex(1), withdrawal.ValidatorIndex) + require.DeepEqual(t, bytesutil.PadTo([]byte("address"), 20), withdrawal.Address) + require.Equal(t, uint64(1), withdrawal.Amount) + require.DeepEqual(t, [][]byte{ + bytesutil.PadTo([]byte{'e'}, 48), + bytesutil.PadTo([]byte{'f'}, 48), + bytesutil.PadTo([]byte{'g'}, 48), + bytesutil.PadTo([]byte{'h'}, 48)}, pb.BlobsBundle.Proofs) + require.DeepEqual(t, [][]byte{ + bytesutil.PadTo([]byte{'a'}, 48), + bytesutil.PadTo([]byte{'b'}, 48), + bytesutil.PadTo([]byte{'c'}, 48), + bytesutil.PadTo([]byte{'d'}, 48)}, pb.BlobsBundle.KzgCommitments) + require.DeepEqual(t, [][]byte{ + bytesutil.PadTo([]byte{'i'}, 131072), + bytesutil.PadTo([]byte{'j'}, 131072), + bytesutil.PadTo([]byte{'k'}, 131072), + bytesutil.PadTo([]byte{'l'}, 131072)}, pb.BlobsBundle.Blobs) + require.Equal(t, len(pb.Payload.WithdrawalRequests), len(withdrawalReq)) + for i := range pb.Payload.WithdrawalRequests { + require.DeepEqual(t, pb.Payload.WithdrawalRequests[i], withdrawalReq[i]) + } + require.Equal(t, len(pb.Payload.DepositReceipts), len(depositReq)) + for i := range pb.Payload.DepositReceipts { + require.DeepEqual(t, pb.Payload.DepositReceipts[i], depositReq[i]) + } + }) t.Run("execution block", func(t *testing.T) { baseFeePerGas := big.NewInt(1770307273) want := &gethtypes.Header{ @@ -661,3 +802,37 @@ func TestExecutionBlock_MarshalUnmarshalJSON_MainnetBlock(t *testing.T) { var blockJson = `{"baseFeePerGas":"0x42110b4f7","difficulty":"0x280ae66012087c","extraData":"0xe4b883e5bda9e7a59ee4bb99e9b1bc4b3021","gasLimit":"0x1c9c380","gasUsed":"0xf829e","hash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","logsBloom":"0x002000000010100110000000800008200000000000000000000020001000200000040104000000000000101000000100820080800800080000a008000a01200000000000000001202042000c000000200841000000002001200004008000102002000000000200000000010440000042000000000000080000000010001000002000020000020000000000000000000002000001000010080020004008100000880001080000400000004080060200000800010000040002204000000000020000000002000000000000000001000008000000400000001002010804000000000020a40800000000070000000401080000000000000880400000000000001000","miner":"0x829bd824b016326a401d083b33d092293333a830","mixHash":"0xc1bcfb6dc83cdc106faad9870ab697dd6c7a5a05ca00b3a5f3c2e021b22e0747","nonce":"0xf09ffce459ff4a07","number":"0xe6f8db","parentHash":"0x5749469a59b1207d4b6d42dd9e31c059aa1586fe070573bf6e5442a626726959","receiptsRoot":"0x3b131e70a5d2e013c5946d6bf0290732ad1d195b05abd72bc0bfb7ed4be202b0","sha3Uncles":"0x4df8516d92fd18ca040f0af06d31afaa3a62dbc6ec7ec758336c81b719782a07","size":"0x18ad","stateRoot":"0xdff0d06049e5a7d5b4249eb2aa4b7c626f7a957733913786912441b89d20a3e1","timestamp":"0x62cf48c6","totalDifficulty":"0xb6c08f1eb97fd70fc5f","transactions":[{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x10121cb2b3f64f0a6231178336aca3e3b87d5ca5","gas":"0x222e0","gasPrice":"0x6be56a00f","hash":"0x7d503dbb3661532e9bf51a23eeb284bb0d3a1cb99212108ceae70730a2617d7c","input":"0xb31c01fb66054fe7e80881e2dfed6bdd67d09c6a50461013b2ff4b3e9684f57fb58a9f07543c63a826a769aad2d6e3bfacdda2a930f25782caeeb3b6a66c7e6cc5a4811c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000419bb97c858f8c9d2ca3cf28f0236e15fa68a74c4263c28baecd00f603690dbf1c17bf2f4ad0767dbb92118e479b7a716ed465ed27a5b7decbcf9ba5cc1e911ae41b00000000000000000000000000000000000000000000000000000000000000","nonce":"0xc5f","to":"0x049b51e531fd8f90da6d92ea83dc4125002f20ef","transactionIndex":"0x0","value":"0x0","type":"0x0","v":"0x25","r":"0x8cb6e54a332bce463b2184ff252c35d400b5548fb5d5e1a711bf64d6bec5cd55","s":"0x42d5c57f90f5394814b10f1046e4188eebb72aff7f9c8e838b28159b9c47985f"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0xc8231eb0f6be12cca4e8de38fbd36382f827b615","gas":"0x33f9d","gasPrice":"0x4b613adf7","maxFeePerGas":"0x8dffb706a","maxPriorityFeePerGas":"0x9502f900","hash":"0x3a3d2c7624c0029d4865ca8e92ff737d971bcee393a22f4e231a801774ae5cda","input":"0xfb0f3ee100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000393bf5ab54e000000000000000000000000000e476199b37e70258d144a53d9522747c9d9cc82b000000000000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c00000000000000000000000000dcaf23e44639daf29f6532da213999d737f15aa40000000000000000000000000000000000000000000000000000000000000937000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000062cf47430000000000000000000000000000000000000000000000000000000062f81edd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120bbba61bdc2df0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000196ffb68978000000000000000000000000008de9c5a032463c561423387a9648c5c7bcc5bc900000000000000000000000000000000000000000000000000004c4ff239c68000000000000000000000000002fef5a3fc423ab959a0d6e0f2316585a307aa9de000000000000000000000000000000000000000000000000000000000000004109c1e7267910fca7cfce18df320025d41a37b5341da36ad7c353f0bab91615e84022be07f890a9f05e739552b734a13b76b700cda759f922023f2d644a0238b71b00000000000000000000000000000000000000000000000000000000000000","nonce":"0x11f","to":"0x00000000006c3852cbef3e08e8df289169ede581","transactionIndex":"0x1","value":"0x3f97f4857ac000","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0x63a55120fd87fa8f84c8f888f37da83213e25abbe01f2690573d34e0e541ca6a","s":"0x47eb2a411538bb8b03e6a4fe8ddbe039888d73a0f45f26ecebd07d2069b62ab3"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x84fa4d36d7bca1b7e69997ed812fb4d26c3a98ad","gas":"0xb416","gasPrice":"0x4b613adf7","maxFeePerGas":"0x95b3ec9ca","maxPriorityFeePerGas":"0x9502f900","hash":"0xe0bd91c32bc87146514a64f2cea7528a9d4e73d847a7ca03667a503cf52ba2cb","input":"0xa22cb4650000000000000000000000001e0049783f008a0085193e00003d00cd54003c710000000000000000000000000000000000000000000000000000000000000001","nonce":"0xed","to":"0xdcaf23e44639daf29f6532da213999d737f15aa4","transactionIndex":"0x2","value":"0x0","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0x7bc697c3731db3d308c79dd0c8e2cbfdae7d347a189faaa79274677786c2898","s":"0x611b6c480f08bd964c2f6c923f2d73b95d23360d203d40160e829b377b3801d0"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0xe1997c479a35ca8f6e3a5343ff866490b63debcf","gas":"0x68e6f","gasPrice":"0x4b1922547","maxFeePerGas":"0x6840297ff","maxPriorityFeePerGas":"0x90817050","hash":"0x843f21fe25a934099f6f311665d1e211ff09d4dc8de02b589ddf6eac74d3dfcb","input":"0x00e05147921005000000000000000000000064c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000023b872dd000000000000000000000000dfee68a9adb981cd08699891a11cabe10f25ec4400000000000000000000000012d4444f96c644385d8ab355f6ddf801315b625400000000000000000000000000000000000000000000000006b5a75ea8072000008412d4444f96c644385d8ab355f6ddf801315b625400000000000000000000022c0d9f00000000000000000000000000000000000000000000005093f4dbb5636ab8fa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f150bd6f54c40a34d7c3d5e9f56000000000000000000000000000000000000000000000000000000000000002000a426607ac599266b21d13c7acf7942c7701a8b699c000000000000000000008201aa3f00000000000000000000000038e4adb44ef08f22f5b5b76a8f0c2d0dcbe7dca100000000000000000000000000000000000000000000005093f4dbb5614400000000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f9840000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000441f9840a85d5af5bf1d1762f925bdaddc4201f98400000000000000000000a9059cbb000000000000000000000000d3d2e2692501a5c9ca623199d38826e513033a17000000000000000000000000000000000000000000000004e0f33ca8f698c0000084d3d2e2692501a5c9ca623199d38826e513033a1700000000000000000000022c0d9f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ce00ae782d5d8b000000000000000000000000dfee68a9adb981cd08699891a11cabe10f25ec440000000000000000000000000000000000000000000000000000000000000000","nonce":"0x3358","to":"0x70526cc7a6d6320b44122ea9d2d07670accc85a1","transactionIndex":"0x3","value":"0xe6f8e2","type":"0x2","accessList":[],"chainId":"0x1","v":"0x1","r":"0xffe11c5dbdf42635610d9fa85774c2d95a37494962d1e3302c0fd5eac27f4147","s":"0x10282aa75d129b7b9afc04cf2c43061c259d7e498b9da36db927b67b85282938"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0xa4aa741c4db3eb5da2b616ee8f5c37cc562f47b9","gas":"0xaae60","gasPrice":"0x4a817c800","hash":"0xbf084d9e3a885bce9a27902aa394f572a1d3382eea003a19393aed9eb5a20be2","input":"0x5c11d79500000000000000000000000000000000000000000000000000000000c3996afa000000000000000000000000000000000000000000000fd10c33512e420d8ae800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a4aa741c4db3eb5da2b616ee8f5c37cc562f47b90000000000000000000000000000000000000000000000000000000062cf49790000000000000000000000000000000000000000000000000000000000000003000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000eca82185adce47f39c684352b0439f030f860318","nonce":"0x206","to":"0x7a250d5630b4cf539739df2c5dacb4c659f2488d","transactionIndex":"0x4","value":"0x0","type":"0x0","v":"0x26","r":"0x54f90db092a44f470697044232932f82e7e06b5f219df61adc99a93f8e263fbf","s":"0x26bc668d456289b0bd1d5b4f13b47536aae2637cb86e93bf0f819dae92fd31f9"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x6f730c548c6d75e16971a619a2bc7a1f2539aa54","gas":"0x75300","gasPrice":"0x4a817c800","hash":"0x388fc716a00c94beae24f7e0b52aad43ac34060733890e9ea286273c7787a676","input":"0x0100000000000000000000000000000000000000000000000000000566c592169c9425d89b8d2834ba1b3c31688e084ce9792baa0ca2e2f700020e8c7769f9f1e5042c0809b8702e4b9947b1bcb3f3eca82185adce47f39c684352b0439f030f860318009b8d2834ba1b3c31688e084ce9792baa0ca2e2f7c02aaa39b223fe8d0a0e5c4f27ead9083c756cc226f200000000000000000000081e574f5e3f900000000000","nonce":"0x2080","to":"0x00000000000a47b1298f18cf67de547bbe0d723f","transactionIndex":"0x5","value":"0x0","type":"0x0","v":"0x25","r":"0x6364f53f1fe7ac58eaa6fff7ad06e920ef44c719f6068a9e8ed82b7b74ecd925","s":"0x669580d83fad57644779f91c7b8d1c8c7fa115a4b4a26c55b52d9ce690e1e125"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x3cd751e6b0078be393132286c442345e5dc49699","gas":"0x3d090","gasPrice":"0x4984648f7","maxFeePerGas":"0x9502f9000","maxPriorityFeePerGas":"0x77359400","hash":"0xcf0e55b95af41c681d92a249a92f0aef8f023da25799efd7442b5c3ef6a52de6","input":"0xa9059cbb000000000000000000000000c4b0a24215df960dba4eee4a9519e9b69a55f747000000000000000000000000000000000000000000000000000000003a6c736d","nonce":"0x7fd10b","to":"0xdac17f958d2ee523a2206206994597c13d831ec7","transactionIndex":"0x6","value":"0x0","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0xb901f8b46ebe10c26b07f3bdbf34680c3336dcfd7b8c7e85244a7f11b0fed33a","s":"0x67d41039a1c510aaec712147287ff203c842f21b033bc898640bf5ad488d3897"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0xef9c8b0cf43e24b421111ca7ea82aca211ae04a7","gas":"0x493e0","gasPrice":"0x4984648f7","maxFeePerGas":"0xbaeb6d514","maxPriorityFeePerGas":"0x77359400","hash":"0xa94eaf385588e9596a61851a1d25b0a0007c0e565ad4112bc7d0e91f83888cda","input":"0xc18a84bc0000000000000000000000004f7ec9be30514129e6f672a7f6517445194755d2000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000445db3b4df000000000000000000000000eca82185adce47f39c684352b0439f030f8603180000000000000000000000000000000000000000000034f086f3b33b6840000000000000000000000000000000000000000000000000000000000000","nonce":"0x33a2","to":"0x000000000dfde7deaf24138722987c9a6991e2d4","transactionIndex":"0x7","value":"0x0","type":"0x2","accessList":[],"chainId":"0x1","v":"0x1","r":"0x469ff733bdab6c6cb2cbd60160e7a61b1afb7d573caa2c118f712d55e785d4c","s":"0x1f30e48ab9af25160616a201084c136eedd1ec5b59d8e4fd901776cf1ea8f020"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x5c82929442529e67f9ebd9ed75854db7a5cd1755","gas":"0x5208","gasPrice":"0x4984648f7","maxFeePerGas":"0x8d8f9fc00","maxPriorityFeePerGas":"0x77359400","hash":"0xb360475e21e44e4d6b982387347c099ea8f2305773724db273128bbfdf82a1db","input":"0x","nonce":"0x1","to":"0xa090e606e30bd747d4e6245a1517ebe430f0057e","transactionIndex":"0x8","value":"0x21f4d6c5481103","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0x124e2c0f3773f6edded4530a2ccc68904fe0c7eb5932bbe22c5521ceb0e8b483","s":"0x32de5f21b3f52ac2141702c34fda2a05db1985e0ebb6b10f8606810dec6bfeaf"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0xad16a383bc802448659759ef40c4d1a6dbae87f7","gas":"0x40070","gasPrice":"0x49537f593","maxFeePerGas":"0x990282d92","maxPriorityFeePerGas":"0x7427409c","hash":"0xa95eba47cc617f16fa00735bd75cc245511e77c08efa8155ece7e59004265c2f","input":"0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000c307846656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021bfbda47a0b4b5b1248c767ee49f7caa9b2369700000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000003a4bfea6ceb020814000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000018de76816d800000000000000000000000000f326e4de8f66a0bdc0970b79e0924e33c79f191500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128d9627aa4000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000003a4bfea6ceb02081400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000021bfbda47a0b4b5b1248c767ee49f7caa9b23697869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000000000d47be81e1a62cf484a00000000000000000000000000000000000000000000000066","nonce":"0xa","to":"0x881d40237659c251811cec9c364ef91dc08d300c","transactionIndex":"0x9","value":"0xb1a2bc2ec50000","type":"0x2","accessList":[],"chainId":"0x1","v":"0x1","r":"0xca99f35d497e33b60931750042c0c4697111eabb614242dc377b797cb376b46e","s":"0x69add212848c84f77b65ef5f1da1587f5b28c518d33b9b19b6b9264270bdf338"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0xc0868faeb27919a11425706a43ff428957d32d0c","gas":"0x5208","gasPrice":"0x47a78e3f7","maxFeePerGas":"0x5f2697f9b","maxPriorityFeePerGas":"0x59682f00","hash":"0xb7ca5adc1ba774c31d551d04aad1fb3c63729fdffe39d8cadf7305413df22f4c","input":"0x","nonce":"0x4","to":"0xe36338c1b2c10969a3e4ee93c11a45d7c1db3352","transactionIndex":"0xa","value":"0x4299a9ffe9fdd8","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0xccb0f44ecd8ccacf71d44cc453ff17b9f95f1c0708964ada03fc97641593d7c9","s":"0x5dcb93d823ccca457cf2d7cdfc665d78274b247e613b7d76f4bb4a571802f1fa"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x48ddf6d748aed851a19aa33916b3d05f179a18d5","gas":"0x15526","gasPrice":"0x47a78e3f7","maxFeePerGas":"0x71a4db10c","maxPriorityFeePerGas":"0x59682f00","hash":"0xa27ccc3bf5dca531769c79795dc74ffeb1161963eeeebaa7ef365303b47b697d","input":"0xa9059cbb00000000000000000000000014060719865a0b03c04f53e7adb71538ca35082a00000000000000000000000000000000000000000000009770d9e7181a3bfec4","nonce":"0x111","to":"0x362bc847a3a9637d3af6624eec853618a43ed7d2","transactionIndex":"0xb","value":"0x0","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0x1b9175ce5746c7ec73c8fe1cdccde8871a3be014820ac0d2b961571384fe3d15","s":"0x403ea6a5fd39d28466fad064395d8be7aba9791b5ebbfaf2168367b8787e673"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x14e323aa3c00e0cb64c8ba8a392290a480a81357","gas":"0x5208","gasPrice":"0x47a78e3f7","maxFeePerGas":"0x5f2697f9b","maxPriorityFeePerGas":"0x59682f00","hash":"0x42bfe585b3c4974206570b01e01e904ad8e3be8f6ae021acf645116549ef56b3","input":"0x","nonce":"0x1","to":"0x1128b435be2968c9d14b737ed4c4fc89fd89c6d1","transactionIndex":"0xc","value":"0x1fac9f0fb4d6dbc","type":"0x2","accessList":[],"chainId":"0x1","v":"0x1","r":"0xec4c1e4213a06a165b75368fb4c1b80f158f60b0b745ee78785cf613b3931eb1","s":"0x694e4ebbc4cc7df2c03549e19cafa389aced49fc115564c02990c0c8d698e120"},{"blockHash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","blockNumber":"0xe6f8db","from":"0x50270a9a29899eea6f485767fbc819b0b35f8702","gas":"0x5208","gasPrice":"0x47a78e3f7","maxFeePerGas":"0x6459d5bef","maxPriorityFeePerGas":"0x59682f00","hash":"0x03d033a7910eb2b5023ef9102805c06e30449b9926af32b47c6de3f5ccf45634","input":"0x","nonce":"0x0","to":"0x9218d124ad69378c0ebc2a4c7a219fda921d262b","transactionIndex":"0xd","value":"0x2901819154accd8","type":"0x2","accessList":[],"chainId":"0x1","v":"0x0","r":"0xe76cbf6256edb2c5b46c66d61820d99f6350a8cfa329a9b791c2c5fb18546ff9","s":"0x23827bd4c5c872ed6416f98bf7661fd5db168ec91095bd60e62a6a104294357b"}],"transactionsRoot":"0x46e27176677a4b37c1fa9bae97ffb48b86a316f9e6568b3320e10dd6954b5d1a","uncles":["0x0b15f885d283bb8044350ccb9b88fa42192926abb41302fefe0179051e4deadb"]}` var blockNoTxJson = `{"baseFeePerGas":"0x42110b4f7","difficulty":"0x280ae66012087c","extraData":"0xe4b883e5bda9e7a59ee4bb99e9b1bc4b3021","gasLimit":"0x1c9c380","gasUsed":"0xf829e","hash":"0xf5bda634715a9d8af2693b600a725a0db285f0267f25b7f60f5b9c502691aef8","logsBloom":"0x002000000010100110000000800008200000000000000000000020001000200000040104000000000000101000000100820080800800080000a008000a01200000000000000001202042000c000000200841000000002001200004008000102002000000000200000000010440000042000000000000080000000010001000002000020000020000000000000000000002000001000010080020004008100000880001080000400000004080060200000800010000040002204000000000020000000002000000000000000001000008000000400000001002010804000000000020a40800000000070000000401080000000000000880400000000000001000","miner":"0x829bd824b016326a401d083b33d092293333a830","mixHash":"0xc1bcfb6dc83cdc106faad9870ab697dd6c7a5a05ca00b3a5f3c2e021b22e0747","nonce":"0xf09ffce459ff4a07","number":"0xe6f8db","parentHash":"0x5749469a59b1207d4b6d42dd9e31c059aa1586fe070573bf6e5442a626726959","receiptsRoot":"0x3b131e70a5d2e013c5946d6bf0290732ad1d195b05abd72bc0bfb7ed4be202b0","sha3Uncles":"0x4df8516d92fd18ca040f0af06d31afaa3a62dbc6ec7ec758336c81b719782a07","size":"0x18ad","stateRoot":"0xdff0d06049e5a7d5b4249eb2aa4b7c626f7a957733913786912441b89d20a3e1","timestamp":"0x62cf48c6","totalDifficulty":"0xb6c08f1eb97fd70fc5f","transactions":["0x7d503dbb3661532e9bf51a23eeb284bb0d3a1cb99212108ceae70730a2617d7c","0x3a3d2c7624c0029d4865ca8e92ff737d971bcee393a22f4e231a801774ae5cda","0xe0bd91c32bc87146514a64f2cea7528a9d4e73d847a7ca03667a503cf52ba2cb","0x843f21fe25a934099f6f311665d1e211ff09d4dc8de02b589ddf6eac74d3dfcb","0xbf084d9e3a885bce9a27902aa394f572a1d3382eea003a19393aed9eb5a20be2","0x388fc716a00c94beae24f7e0b52aad43ac34060733890e9ea286273c7787a676","0xcf0e55b95af41c681d92a249a92f0aef8f023da25799efd7442b5c3ef6a52de6","0xa94eaf385588e9596a61851a1d25b0a0007c0e565ad4112bc7d0e91f83888cda","0xb360475e21e44e4d6b982387347c099ea8f2305773724db273128bbfdf82a1db","0xa95eba47cc617f16fa00735bd75cc245511e77c08efa8155ece7e59004265c2f","0xb7ca5adc1ba774c31d551d04aad1fb3c63729fdffe39d8cadf7305413df22f4c","0xa27ccc3bf5dca531769c79795dc74ffeb1161963eeeebaa7ef365303b47b697d","0x42bfe585b3c4974206570b01e01e904ad8e3be8f6ae021acf645116549ef56b3","0x03d033a7910eb2b5023ef9102805c06e30449b9926af32b47c6de3f5ccf45634"],"transactionsRoot":"0x46e27176677a4b37c1fa9bae97ffb48b86a316f9e6568b3320e10dd6954b5d1a","uncles":["0x0b15f885d283bb8044350ccb9b88fa42192926abb41302fefe0179051e4deadb"]}` + +func TestBlsPubKey(t *testing.T) { + pkb := bytesutil.ToBytes48([]byte{0xFF}) + pks := "0xff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + want := fmt.Sprintf(`{"V":"%s"}`, pks) + vpk := enginev1.BlsPubkey(pkb) + type testContainer struct { + V *enginev1.BlsPubkey + } + tm := testContainer{V: &vpk} + b, err := json.Marshal(&tm) + require.NoError(t, err) + require.Equal(t, want, string(b)) + um := &testContainer{} + require.NoError(t, json.Unmarshal(b, um)) + require.Equal(t, *tm.V, *um.V) +} + +func TestBlsSig(t *testing.T) { + sb := bytesutil.ToBytes96([]byte{0x23}) + sbs := "0x230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + want := fmt.Sprintf(`{"V":"%s"}`, sbs) + vs := enginev1.BlsSig(sb) + type testContainer struct { + V *enginev1.BlsSig + } + tm := testContainer{V: &vs} + b, err := json.Marshal(&tm) + require.NoError(t, err) + require.Equal(t, want, string(b)) + um := &testContainer{} + require.NoError(t, json.Unmarshal(b, um)) + require.Equal(t, *tm.V, *um.V) +} From e28b6695ba07f4362f6a8f60cdef2e9425eb84f9 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 13 May 2024 09:25:07 -0500 Subject: [PATCH 087/325] eip-7251: compute_consolidation_epoch_and_update_churn with tests (#13981) tests for compute_consolidation_epoch_and_update_churn Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- beacon-chain/core/electra/BUILD.bazel | 8 +- beacon-chain/core/electra/churn.go | 85 ++++++++++++++ beacon-chain/core/electra/churn_test.go | 142 ++++++++++++++++++++++++ 3 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 beacon-chain/core/electra/churn.go create mode 100644 beacon-chain/core/electra/churn_test.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 723f02850a2d..e8816b95e738 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "churn.go", "transition.go", "upgrade.go", ], @@ -28,11 +29,16 @@ go_library( go_test( name = "go_default_test", - srcs = ["upgrade_test.go"], + srcs = [ + "churn_test.go", + "upgrade_test.go", + ], deps = [ ":go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", + "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", diff --git a/beacon-chain/core/electra/churn.go b/beacon-chain/core/electra/churn.go new file mode 100644 index 000000000000..bde3fe912516 --- /dev/null +++ b/beacon-chain/core/electra/churn.go @@ -0,0 +1,85 @@ +package electra + +import ( + "context" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +// ComputeConsolidationEpochAndUpdateChurn fulfills the consensus spec definition below. This method +// calls mutating methods to the beacon state. +// +// Spec definition: +// +// def compute_consolidation_epoch_and_update_churn(state: BeaconState, consolidation_balance: Gwei) -> Epoch: +// earliest_consolidation_epoch = max( +// state.earliest_consolidation_epoch, compute_activation_exit_epoch(get_current_epoch(state))) +// per_epoch_consolidation_churn = get_consolidation_churn_limit(state) +// # New epoch for consolidations. +// if state.earliest_consolidation_epoch < earliest_consolidation_epoch: +// consolidation_balance_to_consume = per_epoch_consolidation_churn +// else: +// consolidation_balance_to_consume = state.consolidation_balance_to_consume +// +// # Consolidation doesn't fit in the current earliest epoch. +// if consolidation_balance > consolidation_balance_to_consume: +// balance_to_process = consolidation_balance - consolidation_balance_to_consume +// additional_epochs = (balance_to_process - 1) // per_epoch_consolidation_churn + 1 +// earliest_consolidation_epoch += additional_epochs +// consolidation_balance_to_consume += additional_epochs * per_epoch_consolidation_churn +// +// # Consume the balance and update state variables. +// state.consolidation_balance_to_consume = consolidation_balance_to_consume - consolidation_balance +// state.earliest_consolidation_epoch = earliest_consolidation_epoch +// +// return state.earliest_consolidation_epoch +func ComputeConsolidationEpochAndUpdateChurn(ctx context.Context, s state.BeaconState, consolidationBalance math.Gwei) (primitives.Epoch, error) { + earliestEpoch, err := s.EarliestConsolidationEpoch() + if err != nil { + return 0, err + } + earliestConsolidationEpoch := max(earliestEpoch, helpers.ActivationExitEpoch(slots.ToEpoch(s.Slot()))) + activeBal, err := helpers.TotalActiveBalance(s) + if err != nil { + return 0, err + } + perEpochConsolidationChurn := helpers.ConsolidationChurnLimit(math.Gwei(activeBal)) + + // New epoch for consolidations. + var consolidationBalanceToConsume math.Gwei + if earliestEpoch < earliestConsolidationEpoch { + consolidationBalanceToConsume = perEpochConsolidationChurn + } else { + consolidationBalanceToConsume, err = s.ConsolidationBalanceToConsume() + if err != nil { + return 0, err + } + } + + // Consolidation doesn't fit in the current earliest epoch. + if consolidationBalance > consolidationBalanceToConsume { + balanceToProcess := consolidationBalance - consolidationBalanceToConsume + // additional_epochs = (balance_to_process - 1) // per_epoch_consolidation_churn + 1 + additionalEpochs, err := math.Div64(uint64(balanceToProcess-1), uint64(perEpochConsolidationChurn)) + if err != nil { + return 0, err + } + additionalEpochs++ + earliestConsolidationEpoch += primitives.Epoch(additionalEpochs) + consolidationBalanceToConsume += math.Gwei(additionalEpochs) * perEpochConsolidationChurn + } + + // Consume the balance and update state variables. + if err := s.SetConsolidationBalanceToConsume(consolidationBalanceToConsume - consolidationBalance); err != nil { + return 0, err + } + if err := s.SetEarliestConsolidationEpoch(earliestConsolidationEpoch); err != nil { + return 0, err + } + + return earliestConsolidationEpoch, nil +} diff --git a/beacon-chain/core/electra/churn_test.go b/beacon-chain/core/electra/churn_test.go new file mode 100644 index 000000000000..3ce9d839c629 --- /dev/null +++ b/beacon-chain/core/electra/churn_test.go @@ -0,0 +1,142 @@ +package electra_test + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +func createValidatorsWithTotalActiveBalance(totalBal math.Gwei) []*eth.Validator { + num := totalBal / math.Gwei(params.BeaconConfig().MinActivationBalance) + vals := make([]*eth.Validator, num) + for i := range vals { + vals[i] = ð.Validator{ + ActivationEpoch: primitives.Epoch(0), + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + } + } + if totalBal%math.Gwei(params.BeaconConfig().MinActivationBalance) != 0 { + vals = append(vals, ð.Validator{ + ActivationEpoch: primitives.Epoch(0), + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: uint64(totalBal) % params.BeaconConfig().MinActivationBalance, + }) + } + return vals +} + +func TestComputeConsolidationEpochAndUpdateChurn(t *testing.T) { + // Test setup: create a state with 32M ETH total active balance. + // In this state, the churn is expected to be 232 ETH per epoch. + tests := []struct { + name string + state state.BeaconState + consolidationBalance math.Gwei + expectedEpoch primitives.Epoch + expectedConsolidationBalanceToConsume math.Gwei + }{ + { + name: "compute consolidation with no consolidation balance", + state: func(t *testing.T) state.BeaconState { + s, err := state_native.InitializeFromProtoUnsafeElectra(ð.BeaconStateElectra{ + Slot: slots.UnsafeEpochStart(10), + EarliestConsolidationEpoch: 9, + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + }) + require.NoError(t, err) + return s + }(t), + consolidationBalance: 0, // 0 ETH + expectedEpoch: 15, // current epoch + 1 + MaxSeedLookahead + expectedConsolidationBalanceToConsume: 232000000000, // 232 ETH + }, + { + name: "new epoch for consolidations", + state: func(t *testing.T) state.BeaconState { + s, err := state_native.InitializeFromProtoUnsafeElectra(ð.BeaconStateElectra{ + Slot: slots.UnsafeEpochStart(10), + EarliestConsolidationEpoch: 9, + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + }) + require.NoError(t, err) + return s + }(t), + consolidationBalance: 32000000000, // 32 ETH + expectedEpoch: 15, // current epoch + 1 + MaxSeedLookahead + expectedConsolidationBalanceToConsume: 200000000000, // 200 ETH + }, + { + name: "flows into another epoch", + state: func(t *testing.T) state.BeaconState { + s, err := state_native.InitializeFromProtoUnsafeElectra(ð.BeaconStateElectra{ + Slot: slots.UnsafeEpochStart(10), + EarliestConsolidationEpoch: 9, + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + }) + require.NoError(t, err) + return s + }(t), + consolidationBalance: 235000000000, // 235 ETH + expectedEpoch: 16, // Flows into another epoch. + expectedConsolidationBalanceToConsume: 229000000000, // 229 ETH + }, + { + name: "not a new epoch, fits in remaining balance of current epoch", + state: func(t *testing.T) state.BeaconState { + s, err := state_native.InitializeFromProtoUnsafeElectra(ð.BeaconStateElectra{ + Slot: slots.UnsafeEpochStart(10), + EarliestConsolidationEpoch: 15, + ConsolidationBalanceToConsume: 200000000000, // 200 ETH + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + }) + require.NoError(t, err) + return s + }(t), + consolidationBalance: 32000000000, // 32 ETH + expectedEpoch: 15, // Fits into current earliest consolidation epoch. + expectedConsolidationBalanceToConsume: 168000000000, // 126 ETH + }, + { + name: "not a new epoch, fits in remaining balance of current epoch", + state: func(t *testing.T) state.BeaconState { + s, err := state_native.InitializeFromProtoUnsafeElectra(ð.BeaconStateElectra{ + Slot: slots.UnsafeEpochStart(10), + EarliestConsolidationEpoch: 15, + ConsolidationBalanceToConsume: 200000000000, // 200 ETH + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + }) + require.NoError(t, err) + return s + }(t), + consolidationBalance: 232000000000, // 232 ETH + expectedEpoch: 16, // Flows into another epoch. + expectedConsolidationBalanceToConsume: 200000000000, // 200 ETH + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotEpoch, err := electra.ComputeConsolidationEpochAndUpdateChurn(context.TODO(), tt.state, tt.consolidationBalance) + require.NoError(t, err) + require.Equal(t, tt.expectedEpoch, gotEpoch) + // Check consolidation balance to consume is set on the state. + cbtc, err := tt.state.ConsolidationBalanceToConsume() + require.NoError(t, err) + require.Equal(t, tt.expectedConsolidationBalanceToConsume, cbtc) + // Check earliest consolidation epoch was set on the state. + gotEpoch, err = tt.state.EarliestConsolidationEpoch() + require.NoError(t, err) + require.Equal(t, tt.expectedEpoch, gotEpoch) + }) + } +} From c5a36d4c7080854803026d71e18dad8b8ba48e58 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 13 May 2024 13:12:38 -0500 Subject: [PATCH 088/325] eip-7251: queue_entire_balance_and_reset_validator, queue_excess_active_balance, and switch_to_compounding_validator with tests (#13982) --- beacon-chain/core/electra/BUILD.bazel | 2 + beacon-chain/core/electra/validator.go | 105 ++++++++++++++++++++ beacon-chain/core/electra/validator_test.go | 90 +++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 beacon-chain/core/electra/validator.go create mode 100644 beacon-chain/core/electra/validator_test.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index e8816b95e738..697b9df7291b 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "churn.go", "transition.go", "upgrade.go", + "validator.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra", visibility = ["//visibility:public"], @@ -32,6 +33,7 @@ go_test( srcs = [ "churn_test.go", "upgrade_test.go", + "validator_test.go", ], deps = [ ":go_default_library", diff --git a/beacon-chain/core/electra/validator.go b/beacon-chain/core/electra/validator.go new file mode 100644 index 000000000000..dd9cf503daf3 --- /dev/null +++ b/beacon-chain/core/electra/validator.go @@ -0,0 +1,105 @@ +package electra + +import ( + "context" + "errors" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) + +// SwitchToCompoundingValidator +// +// Spec definition: +// +// def switch_to_compounding_validator(state: BeaconState, index: ValidatorIndex) -> None: +// validator = state.validators[index] +// if has_eth1_withdrawal_credential(validator): +// validator.withdrawal_credentials = COMPOUNDING_WITHDRAWAL_PREFIX + validator.withdrawal_credentials[1:] +// queue_excess_active_balance(state, index) +func SwitchToCompoundingValidator(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex) error { + v, err := s.ValidatorAtIndex(idx) + if err != nil { + return err + } + if len(v.WithdrawalCredentials) == 0 { + return errors.New("validator has no withdrawal credentials") + } + if helpers.HasETH1WithdrawalCredential(v) { + v.WithdrawalCredentials[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte + if err := s.UpdateValidatorAtIndex(idx, v); err != nil { + return err + } + return queueExcessActiveBalance(ctx, s, idx) + } + return nil +} + +// queueExcessActiveBalance +// +// Spec definition: +// +// def queue_excess_active_balance(state: BeaconState, index: ValidatorIndex) -> None: +// balance = state.balances[index] +// if balance > MIN_ACTIVATION_BALANCE: +// excess_balance = balance - MIN_ACTIVATION_BALANCE +// state.balances[index] = MIN_ACTIVATION_BALANCE +// state.pending_balance_deposits.append( +// PendingBalanceDeposit(index=index, amount=excess_balance) +// ) +func queueExcessActiveBalance(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex) error { + bal, err := s.BalanceAtIndex(idx) + if err != nil { + return err + } + + if bal > params.BeaconConfig().MinActivationBalance { + excessBalance := bal - params.BeaconConfig().MinActivationBalance + if err := s.UpdateBalancesAtIndex(idx, params.BeaconConfig().MinActivationBalance); err != nil { + return err + } + return s.AppendPendingBalanceDeposit(idx, excessBalance) + } + return nil +} + +// QueueEntireBalanceAndResetValidator queues the entire balance and resets the validator. This is used in electra fork logic. +// +// Spec definition: +// +// def queue_entire_balance_and_reset_validator(state: BeaconState, index: ValidatorIndex) -> None: +// balance = state.balances[index] +// state.balances[index] = 0 +// validator = state.validators[index] +// validator.effective_balance = 0 +// validator.activation_eligibility_epoch = FAR_FUTURE_EPOCH +// state.pending_balance_deposits.append( +// PendingBalanceDeposit(index=index, amount=balance) +// ) +// +//nolint:dupword +func QueueEntireBalanceAndResetValidator(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex) error { + bal, err := s.BalanceAtIndex(idx) + if err != nil { + return err + } + + if err := s.UpdateBalancesAtIndex(idx, 0); err != nil { + return err + } + + v, err := s.ValidatorAtIndex(idx) + if err != nil { + return err + } + + v.EffectiveBalance = 0 + v.ActivationEligibilityEpoch = params.BeaconConfig().FarFutureEpoch + if err := s.UpdateValidatorAtIndex(idx, v); err != nil { + return err + } + + return s.AppendPendingBalanceDeposit(idx, bal) +} diff --git a/beacon-chain/core/electra/validator_test.go b/beacon-chain/core/electra/validator_test.go new file mode 100644 index 000000000000..b873d17b5f07 --- /dev/null +++ b/beacon-chain/core/electra/validator_test.go @@ -0,0 +1,90 @@ +package electra_test + +import ( + "bytes" + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestSwitchToCompoundingValidator(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + WithdrawalCredentials: []byte{}, // No withdrawal credentials + }, + { + WithdrawalCredentials: []byte{0x01, 0xFF}, // Has withdrawal credentials + }, + { + WithdrawalCredentials: []byte{0x01, 0xFF}, // Has withdrawal credentials + }, + }, + Balances: []uint64{ + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance + 100_000, // Has excess balance + }, + }) + // Test that a validator with no withdrawal credentials cannot be switched to compounding. + require.NoError(t, err) + require.ErrorContains(t, "validator has no withdrawal credentials", electra.SwitchToCompoundingValidator(context.TODO(), s, 0)) + + // Test that a validator with withdrawal credentials can be switched to compounding. + require.NoError(t, electra.SwitchToCompoundingValidator(context.TODO(), s, 1)) + v, err := s.ValidatorAtIndex(1) + require.NoError(t, err) + require.Equal(t, true, bytes.HasPrefix(v.WithdrawalCredentials, []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}), "withdrawal credentials were not updated") + // val_1 Balance is not changed + b, err := s.BalanceAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, b, "balance was changed") + pbd, err := s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(pbd), "pending balance deposits should be empty") + + // Test that a validator with excess balance can be switched to compounding, excess balance is queued. + require.NoError(t, electra.SwitchToCompoundingValidator(context.TODO(), s, 2)) + b, err = s.BalanceAtIndex(2) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, b, "balance was not changed") + pbd, err = s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbd), "pending balance deposits should have one element") + require.Equal(t, uint64(100_000), pbd[0].Amount, "pending balance deposit amount is incorrect") + require.Equal(t, primitives.ValidatorIndex(2), pbd[0].Index, "pending balance deposit index is incorrect") +} + +func TestQueueEntireBalanceAndResetValidator(t *testing.T) { + s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance + 100_000, + ActivationEligibilityEpoch: primitives.Epoch(100), + }, + }, + Balances: []uint64{ + params.BeaconConfig().MinActivationBalance + 100_000, + }, + }) + require.NoError(t, err) + require.NoError(t, electra.QueueEntireBalanceAndResetValidator(context.TODO(), s, 0)) + b, err := s.BalanceAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(0), b, "balance was not changed") + v, err := s.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(0), v.EffectiveBalance, "effective balance was not reset") + require.Equal(t, params.BeaconConfig().FarFutureEpoch, v.ActivationEligibilityEpoch, "activation eligibility epoch was not reset") + pbd, err := s.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbd), "pending balance deposits should have one element") + require.Equal(t, params.BeaconConfig().MinActivationBalance+100_000, pbd[0].Amount, "pending balance deposit amount is incorrect") + require.Equal(t, primitives.ValidatorIndex(0), pbd[0].Index, "pending balance deposit index is incorrect") +} From e3db52ca1f14b8bb3af3d478b3b75e6440194260 Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 13 May 2024 15:21:07 -0700 Subject: [PATCH 089/325] Fix GetPayloadMethodV4 endpoint string (#13992) --- beacon-chain/execution/engine_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 5a6eb39e6fa8..08d5c6e5a22a 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -64,7 +64,7 @@ const ( // GetPayloadMethodV3 is the get payload method added for deneb GetPayloadMethodV3 = "engine_getPayloadV3" // GetPayloadMethodV4 is the get payload method added for electra - GetPayloadMethodV4 = "engine_getPayloadV3" + GetPayloadMethodV4 = "engine_getPayloadV4" // BlockByHashMethod request string for JSON-RPC. BlockByHashMethod = "eth_getBlockByHash" // BlockByNumberMethod request string for JSON-RPC. From 0de1282e1cdaf718f9521c01a2143c09e12e12bd Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 13 May 2024 15:21:18 -0700 Subject: [PATCH 090/325] Support version Electra for ForkchoiceUpdated (#13994) * Support version Electra for ForkchoiceUpdated * Update PbV3 version check --- beacon-chain/execution/engine_client.go | 2 +- consensus-types/payload-attribute/getters.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 08d5c6e5a22a..c72b3ea33b30 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -222,7 +222,7 @@ func (s *Service) ForkchoiceUpdated( if err != nil { return nil, nil, handleRPCError(err) } - case version.Deneb: + case version.Deneb, version.Electra: a, err := attrs.PbV3() if err != nil { return nil, nil, err diff --git a/consensus-types/payload-attribute/getters.go b/consensus-types/payload-attribute/getters.go index 6da5874cac18..e32c72336e16 100644 --- a/consensus-types/payload-attribute/getters.go +++ b/consensus-types/payload-attribute/getters.go @@ -80,7 +80,7 @@ func (a *data) PbV3() (*enginev1.PayloadAttributesV3, error) { if a == nil { return nil, errNilPayloadAttribute } - if a.version != version.Deneb { + if a.version < version.Deneb { return nil, consensus_types.ErrNotSupported("PbV3", a.version) } if a.timeStamp == 0 && len(a.prevRandao) == 0 && len(a.parentBeaconBlockRoot) == 0 { From 6e81b4e84bbf26577a74505dc57d054a97b1cb53 Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 13 May 2024 20:33:01 -0700 Subject: [PATCH 091/325] Correctly return electra attestations for block getter (#13993) --- consensus-types/blocks/getters.go | 2 +- consensus-types/blocks/getters_test.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index e45e2f7dbe90..369f972d42ab 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -1116,7 +1116,7 @@ func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { return nil } atts = make([]interfaces.Attestation, len(b.attestationsElectra)) - for i, a := range b.attestations { + for i, a := range b.attestationsElectra { atts[i] = a } } diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index 95d9bc177d72..6dac55709998 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -369,6 +369,19 @@ func Test_BeaconBlockBody_Attestations(t *testing.T) { assert.DeepSSZEqual(t, a, bb.Block().Body().Attestations()) } +func Test_BeaconBlockBody_ElectraAttestations(t *testing.T) { + bb := &SignedBeaconBlock{ + block: &BeaconBlock{body: &BeaconBlockBody{ + version: version.Electra, + attestationsElectra: []*eth.AttestationElectra{{ + Signature: []byte("electra"), + }}, + }}} + a := bb.Block().Body().Attestations() + require.Equal(t, 1, len(a)) + require.DeepEqual(t, a[0].GetSignature(), []byte("electra")) +} + func Test_BeaconBlockBody_Deposits(t *testing.T) { d := make([]*eth.Deposit, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} From 2b06dfd4a3a2b49829b0dd0ee02376c6a0784158 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 14 May 2024 08:56:00 -0500 Subject: [PATCH 092/325] Debugging attestation bitlist issues in minimal spec (#13997) --- beacon-chain/operations/attestations/kv/seen_bits.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beacon-chain/operations/attestations/kv/seen_bits.go b/beacon-chain/operations/attestations/kv/seen_bits.go index aceb7f875362..bca1678d7aee 100644 --- a/beacon-chain/operations/attestations/kv/seen_bits.go +++ b/beacon-chain/operations/attestations/kv/seen_bits.go @@ -1,6 +1,8 @@ package kv import ( + "fmt" + "github.com/patrickmn/go-cache" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" @@ -22,7 +24,7 @@ func (c *AttCaches) insertSeenBit(att interfaces.Attestation) error { alreadyExists := false for _, bit := range seenBits { if c, err := bit.Contains(att.GetAggregationBits()); err != nil { - return err + return fmt.Errorf("failed to check seen bits on attestation when inserting bit: %w", err) } else if c { alreadyExists = true break @@ -53,7 +55,7 @@ func (c *AttCaches) hasSeenBit(att interfaces.Attestation) (bool, error) { } for _, bit := range seenBits { if c, err := bit.Contains(att.GetAggregationBits()); err != nil { - return false, err + return false, fmt.Errorf("failed to check seen bits on attestation when reading bit: %w", err) } else if c { return true, nil } From 49a6d02e129430e1b9dba0bada757293ebd3e4b8 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 14 May 2024 13:04:39 -0500 Subject: [PATCH 093/325] Enable experimental_remote_downloader in CI. (#13996) --- .buildkite-bazelrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.buildkite-bazelrc b/.buildkite-bazelrc index 6c26c3de74e6..8288dde34172 100644 --- a/.buildkite-bazelrc +++ b/.buildkite-bazelrc @@ -12,8 +12,7 @@ build:remote-cache --remote_download_minimal build:remote-cache --remote_build_event_upload=minimal build:remote-cache --remote_cache=grpc://bazel-remote-cache:9092 -# Does not work with rules_oci. See https://github.com/bazel-contrib/rules_oci/issues/292 -#build:remote-cache --experimental_remote_downloader=grpc://bazel-remote-cache:9092 +build:remote-cache --experimental_remote_downloader=grpc://bazel-remote-cache:9092 build:remote-cache --remote_local_fallback build:remote-cache --experimental_remote_cache_async build:remote-cache --experimental_remote_merkle_tree_cache From 2b4dffa87dfe467a7fdf71212ae41dbbeae72100 Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 14 May 2024 19:52:42 -0700 Subject: [PATCH 094/325] Support Electra for WriteBlockChunk (#13999) --- beacon-chain/sync/rpc_chunked_response.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beacon-chain/sync/rpc_chunked_response.go b/beacon-chain/sync/rpc_chunked_response.go index a8b8e74aec06..c983709c52da 100644 --- a/beacon-chain/sync/rpc_chunked_response.go +++ b/beacon-chain/sync/rpc_chunked_response.go @@ -65,6 +65,12 @@ func WriteBlockChunk(stream libp2pcore.Stream, tor blockchain.TemporalOracle, en return err } obtainedCtx = digest[:] + case version.Electra: + digest, err := forks.ForkDigestFromEpoch(params.BeaconConfig().ElectraForkEpoch, valRoot[:]) + if err != nil { + return err + } + obtainedCtx = digest[:] default: return errors.Wrapf(ErrUnrecognizedVersion, "block version %d is not recognized", blk.Version()) } From fcbe19445a8e2260763dcea513306cbb550c3541 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Wed, 15 May 2024 08:50:33 -0500 Subject: [PATCH 095/325] eip-7251: process consolidations (#13983) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * eip-7251: process_pending_consolidations and process_consolidations * Consolidate unit tests + spectests Fix failing spectest //testing/spectest/minimal/electra/operations:go_default_test * Unskip consolidation processing for minimal spectests * PR feedback * Update beacon-chain/core/electra/consolidations_test.go Co-authored-by: Radosław Kapka * Update beacon-chain/core/electra/consolidations_test.go Co-authored-by: Radosław Kapka * Move consolidation limit check outside of the loop --------- Co-authored-by: Radosław Kapka --- beacon-chain/core/electra/BUILD.bazel | 10 + beacon-chain/core/electra/consolidations.go | 258 ++++++++++ .../core/electra/consolidations_test.go | 441 ++++++++++++++++++ .../electra/epoch_processing/BUILD.bazel | 1 + .../pending_consolidations_test.go | 11 + .../mainnet/electra/operations/BUILD.bazel | 1 + .../electra/operations/consolidation_test.go | 12 + .../electra/epoch_processing/BUILD.bazel | 1 + .../pending_consolidations_test.go | 11 + .../minimal/electra/operations/BUILD.bazel | 1 + .../electra/operations/consolidation_test.go | 11 + .../electra/epoch_processing/BUILD.bazel | 1 + .../pending_consolidations.go | 28 ++ .../shared/electra/operations/BUILD.bazel | 1 + .../electra/operations/consolidations.go | 47 ++ 15 files changed, 835 insertions(+) create mode 100644 beacon-chain/core/electra/consolidations.go create mode 100644 beacon-chain/core/electra/consolidations_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/pending_consolidations_test.go create mode 100644 testing/spectest/mainnet/electra/operations/consolidation_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/pending_consolidations_test.go create mode 100644 testing/spectest/minimal/electra/operations/consolidation_test.go create mode 100644 testing/spectest/shared/electra/epoch_processing/pending_consolidations.go create mode 100644 testing/spectest/shared/electra/operations/consolidations.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 697b9df7291b..acb1f7dceded 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "churn.go", + "consolidations.go", "transition.go", "upgrade.go", "validator.go", @@ -14,17 +15,20 @@ go_library( "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/epoch:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@io_opencensus_go//trace:go_default_library", ], ) @@ -32,21 +36,27 @@ go_test( name = "go_default_test", srcs = [ "churn_test.go", + "consolidations_test.go", "upgrade_test.go", "validator_test.go", ], deps = [ ":go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//crypto/bls/blst:go_default_library", + "//crypto/bls/common:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/interop:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", "//time/slots:go_default_library", diff --git a/beacon-chain/core/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go new file mode 100644 index 000000000000..603e40d893e0 --- /dev/null +++ b/beacon-chain/core/electra/consolidations.go @@ -0,0 +1,258 @@ +package electra + +import ( + "context" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" + "go.opencensus.io/trace" +) + +// ProcessPendingConsolidations implements the spec definition below. This method makes mutating +// calls to the beacon state. +// +// Spec definition: +// +// def process_pending_consolidations(state: BeaconState) -> None: +// next_pending_consolidation = 0 +// for pending_consolidation in state.pending_consolidations: +// source_validator = state.validators[pending_consolidation.source_index] +// if source_validator.slashed: +// next_pending_consolidation += 1 +// continue +// if source_validator.withdrawable_epoch > get_current_epoch(state): +// break +// +// # Churn any target excess active balance of target and raise its max +// switch_to_compounding_validator(state, pending_consolidation.target_index) +// # Move active balance to target. Excess balance is withdrawable. +// active_balance = get_active_balance(state, pending_consolidation.source_index) +// decrease_balance(state, pending_consolidation.source_index, active_balance) +// increase_balance(state, pending_consolidation.target_index, active_balance) +// next_pending_consolidation += 1 +// +// state.pending_consolidations = state.pending_consolidations[next_pending_consolidation:] +func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) error { + ctx, span := trace.StartSpan(ctx, "electra.ProcessPendingConsolidations") + defer span.End() + + if st == nil || st.IsNil() { + return errors.New("nil state") + } + + currentEpoch := slots.ToEpoch(st.Slot()) + + var nextPendingConsolidation uint64 + pendingConsolidations, err := st.PendingConsolidations() + if err != nil { + return err + } + + for _, pc := range pendingConsolidations { + sourceValidator, err := st.ValidatorAtIndex(pc.SourceIndex) + if err != nil { + return err + } + if sourceValidator.Slashed { + nextPendingConsolidation++ + continue + } + if sourceValidator.WithdrawableEpoch > currentEpoch { + break + } + + if err := SwitchToCompoundingValidator(ctx, st, pc.TargetIndex); err != nil { + return err + } + + activeBalance, err := st.ActiveBalanceAtIndex(pc.SourceIndex) + if err != nil { + return err + } + if err := helpers.DecreaseBalance(st, pc.SourceIndex, activeBalance); err != nil { + return err + } + if err := helpers.IncreaseBalance(st, pc.TargetIndex, activeBalance); err != nil { + return err + } + nextPendingConsolidation++ + } + + if nextPendingConsolidation > 0 { + return st.SetPendingConsolidations(pendingConsolidations[nextPendingConsolidation:]) + } + + return nil +} + +// ProcessConsolidations implements the spec definition below. This method makes mutating calls to +// the beacon state. +// +// Spec definition: +// +// def process_consolidation(state: BeaconState, signed_consolidation: SignedConsolidation) -> None: +// # If the pending consolidations queue is full, no consolidations are allowed in the block +// assert len(state.pending_consolidations) < PENDING_CONSOLIDATIONS_LIMIT +// # If there is too little available consolidation churn limit, no consolidations are allowed in the block +// assert get_consolidation_churn_limit(state) > MIN_ACTIVATION_BALANCE +// consolidation = signed_consolidation.message +// # Verify that source != target, so a consolidation cannot be used as an exit. +// assert consolidation.source_index != consolidation.target_index +// +// source_validator = state.validators[consolidation.source_index] +// target_validator = state.validators[consolidation.target_index] +// # Verify the source and the target are active +// current_epoch = get_current_epoch(state) +// assert is_active_validator(source_validator, current_epoch) +// assert is_active_validator(target_validator, current_epoch) +// # Verify exits for source and target have not been initiated +// assert source_validator.exit_epoch == FAR_FUTURE_EPOCH +// assert target_validator.exit_epoch == FAR_FUTURE_EPOCH +// # Consolidations must specify an epoch when they become valid; they are not valid before then +// assert current_epoch >= consolidation.epoch +// +// # Verify the source and the target have Execution layer withdrawal credentials +// assert has_execution_withdrawal_credential(source_validator) +// assert has_execution_withdrawal_credential(target_validator) +// # Verify the same withdrawal address +// assert source_validator.withdrawal_credentials[12:] == target_validator.withdrawal_credentials[12:] +// +// # Verify consolidation is signed by the source and the target +// domain = compute_domain(DOMAIN_CONSOLIDATION, genesis_validators_root=state.genesis_validators_root) +// signing_root = compute_signing_root(consolidation, domain) +// pubkeys = [source_validator.pubkey, target_validator.pubkey] +// assert bls.FastAggregateVerify(pubkeys, signing_root, signed_consolidation.signature) +// +// # Initiate source validator exit and append pending consolidation +// source_validator.exit_epoch = compute_consolidation_epoch_and_update_churn( +// state, source_validator.effective_balance) +// source_validator.withdrawable_epoch = Epoch( +// source_validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY +// ) +// state.pending_consolidations.append(PendingConsolidation( +// source_index=consolidation.source_index, +// target_index=consolidation.target_index +// )) +func ProcessConsolidations(ctx context.Context, st state.BeaconState, cs []*ethpb.SignedConsolidation) error { + _, span := trace.StartSpan(ctx, "electra.ProcessConsolidations") + defer span.End() + + if st == nil || st.IsNil() { + return errors.New("nil state") + } + + if len(cs) == 0 { + return nil // Nothing to process. + } + + domain, err := signing.ComputeDomain( + params.BeaconConfig().DomainConsolidation, + nil, // Use genesis fork version + st.GenesisValidatorsRoot(), + ) + if err != nil { + return err + } + + totalBalance, err := helpers.TotalActiveBalance(st) + if err != nil { + return err + } + + if helpers.ConsolidationChurnLimit(math.Gwei(totalBalance)) <= math.Gwei(params.BeaconConfig().MinActivationBalance) { + return errors.New("too little available consolidation churn limit") + } + + currentEpoch := slots.ToEpoch(st.Slot()) + + for _, c := range cs { + if c == nil || c.Message == nil { + return errors.New("nil consolidation") + } + + if n, err := st.NumPendingConsolidations(); err != nil { + return err + } else if n >= params.BeaconConfig().PendingConsolidationsLimit { + return errors.New("pending consolidations queue is full") + } + + if c.Message.SourceIndex == c.Message.TargetIndex { + return errors.New("source and target index are the same") + } + source, err := st.ValidatorAtIndex(c.Message.SourceIndex) + if err != nil { + return err + } + target, err := st.ValidatorAtIndex(c.Message.TargetIndex) + if err != nil { + return err + } + if !helpers.IsActiveValidator(source, currentEpoch) { + return errors.New("source is not active") + } + if !helpers.IsActiveValidator(target, currentEpoch) { + return errors.New("target is not active") + } + if source.ExitEpoch != params.BeaconConfig().FarFutureEpoch { + return errors.New("source exit epoch has been initiated") + } + if target.ExitEpoch != params.BeaconConfig().FarFutureEpoch { + return errors.New("target exit epoch has been initiated") + } + if currentEpoch < c.Message.Epoch { + return errors.New("consolidation is not valid yet") + } + + if !helpers.HasExecutionWithdrawalCredentials(source) { + return errors.New("source does not have execution withdrawal credentials") + } + if !helpers.HasExecutionWithdrawalCredentials(target) { + return errors.New("target does not have execution withdrawal credentials") + } + if !helpers.IsSameWithdrawalCredentials(source, target) { + return errors.New("source and target have different withdrawal credentials") + } + + sr, err := signing.ComputeSigningRoot(c.Message, domain) + if err != nil { + return err + } + sourcePk, err := bls.PublicKeyFromBytes(source.PublicKey) + if err != nil { + return errors.Wrap(err, "could not convert source public key bytes to bls public key") + } + targetPk, err := bls.PublicKeyFromBytes(target.PublicKey) + if err != nil { + return errors.Wrap(err, "could not convert target public key bytes to bls public key") + } + sig, err := bls.SignatureFromBytes(c.Signature) + if err != nil { + return errors.Wrap(err, "could not convert bytes to signature") + } + if !sig.FastAggregateVerify([]bls.PublicKey{sourcePk, targetPk}, sr) { + return errors.New("consolidation signature verification failed") + } + + sEE, err := ComputeConsolidationEpochAndUpdateChurn(ctx, st, math.Gwei(source.EffectiveBalance)) + if err != nil { + return err + } + source.ExitEpoch = sEE + source.WithdrawableEpoch = sEE + params.BeaconConfig().MinValidatorWithdrawabilityDelay + if err := st.UpdateValidatorAtIndex(c.Message.SourceIndex, source); err != nil { + return err + } + if err := st.AppendPendingConsolidation(c.Message.ToPendingConsolidation()); err != nil { + return err + } + } + + return nil +} diff --git a/beacon-chain/core/electra/consolidations_test.go b/beacon-chain/core/electra/consolidations_test.go new file mode 100644 index 000000000000..1e3b22c0bd79 --- /dev/null +++ b/beacon-chain/core/electra/consolidations_test.go @@ -0,0 +1,441 @@ +package electra_test + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls/blst" + "github.com/prysmaticlabs/prysm/v5/crypto/bls/common" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/interop" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestProcessPendingConsolidations(t *testing.T) { + tests := []struct { + name string + state state.BeaconState + check func(*testing.T, state.BeaconState) + wantErr bool + }{ + { + name: "nil state", + state: nil, + wantErr: true, + }, + { + name: "no pending consolidations", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{} + + st, err := state_native.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + return st + }(), + wantErr: false, + }, + { + name: "processes pending consolidation successfully", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + WithdrawalCredentials: []byte{0x01, 0xFF}, + }, + { + WithdrawalCredentials: []byte{0x01, 0xAB}, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance, + }, + PendingConsolidations: []*eth.PendingConsolidation{ + { + SourceIndex: 0, + TargetIndex: 1, + }, + }, + } + + st, err := state_native.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + // Balances are transferred from v0 to v1. + bal0, err := st.BalanceAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(0), bal0) + bal1, err := st.BalanceAtIndex(1) + require.NoError(t, err) + require.Equal(t, 2*params.BeaconConfig().MinActivationBalance, bal1) + + // The pending consolidation is removed from the list. + num, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(0), num) + + // v1 is switched to compounding validator. + v1, err := st.ValidatorAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().CompoundingWithdrawalPrefixByte, v1.WithdrawalCredentials[0]) + }, + wantErr: false, + }, + { + name: "stop processing when a source val withdrawable epoch is in the future", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + WithdrawalCredentials: []byte{0x01, 0xFF}, + WithdrawableEpoch: 100, + }, + { + WithdrawalCredentials: []byte{0x01, 0xAB}, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance, + }, + PendingConsolidations: []*eth.PendingConsolidation{ + { + SourceIndex: 0, + TargetIndex: 1, + }, + }, + } + + st, err := state_native.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + // No balances are transferred from v0 to v1. + bal0, err := st.BalanceAtIndex(0) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, bal0) + bal1, err := st.BalanceAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, bal1) + + // The pending consolidation is still in the list. + num, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(1), num) + }, + wantErr: false, + }, + { + name: "slashed validator is not consolidated", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + WithdrawalCredentials: []byte{0x01, 0xFF}, + }, + { + WithdrawalCredentials: []byte{0x01, 0xAB}, + }, + { + Slashed: true, + }, + { + WithdrawalCredentials: []byte{0x01, 0xCC}, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance, + params.BeaconConfig().MinActivationBalance, + }, + PendingConsolidations: []*eth.PendingConsolidation{ + { + SourceIndex: 2, + TargetIndex: 3, + }, + { + SourceIndex: 0, + TargetIndex: 1, + }, + }, + } + + st, err := state_native.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + // No balances are transferred from v2 to v3. + bal0, err := st.BalanceAtIndex(2) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, bal0) + bal1, err := st.BalanceAtIndex(3) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, bal1) + + // No pending consolidation remaining. + num, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(0), num) + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := electra.ProcessPendingConsolidations(context.TODO(), tt.state) + require.Equal(t, tt.wantErr, err != nil) + if tt.check != nil { + tt.check(t, tt.state) + } + }) + } +} + +func stateWithActiveBalanceETH(t *testing.T, balETH uint64) state.BeaconState { + gwei := balETH * 1_000_000_000 + balPerVal := params.BeaconConfig().MinActivationBalance + numVals := gwei / balPerVal + + vals := make([]*eth.Validator, numVals) + bals := make([]uint64, numVals) + for i := uint64(0); i < numVals; i++ { + wc := make([]byte, 32) + wc[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + wc[31] = byte(i) + vals[i] = ð.Validator{ + ActivationEpoch: 0, + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: balPerVal, + WithdrawalCredentials: wc, + } + bals[i] = balPerVal + } + st, err := state_native.InitializeFromProtoUnsafeElectra(ð.BeaconStateElectra{ + Slot: 10 * params.BeaconConfig().SlotsPerEpoch, + Validators: vals, + Balances: bals, + Fork: ð.Fork{ + CurrentVersion: params.BeaconConfig().ElectraForkVersion, + }, + }) + require.NoError(t, err) + + return st +} + +func TestProcessConsolidations(t *testing.T) { + secretKeys, publicKeys, err := interop.DeterministicallyGenerateKeys(0, 2) + require.NoError(t, err) + + genesisValidatorRoot := bytesutil.PadTo([]byte("genesisValidatorRoot"), fieldparams.RootLength) + + _ = secretKeys + + tests := []struct { + name string + state state.BeaconState + scs []*eth.SignedConsolidation + check func(*testing.T, state.BeaconState) + wantErr string + }{ + { + name: "nil state", + scs: make([]*eth.SignedConsolidation, 10), + wantErr: "nil state", + }, + { + name: "nil consolidation in slice", + state: stateWithActiveBalanceETH(t, 19_000_000), + scs: []*eth.SignedConsolidation{nil, nil}, + wantErr: "nil consolidation", + }, + { + name: "state is 100% full of pending consolidations", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + pc := make([]*eth.PendingConsolidation, params.BeaconConfig().PendingConsolidationsLimit) + require.NoError(t, st.SetPendingConsolidations(pc)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{}}}, + wantErr: "pending consolidations queue is full", + }, + { + name: "state has too little consolidation churn limit available to process a consolidation", + state: func() state.BeaconState { + st, _ := util.DeterministicGenesisStateElectra(t, 1) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{}}}, + wantErr: "too little available consolidation churn limit", + }, + { + name: "consolidation with source and target as the same index is rejected", + state: stateWithActiveBalanceETH(t, 19_000_000), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 100}}}, + wantErr: "source and target index are the same", + }, + { + name: "consolidation with inactive source is rejected", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + val, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + val.ActivationEpoch = params.BeaconConfig().FarFutureEpoch + require.NoError(t, st.UpdateValidatorAtIndex(25, val)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 25, TargetIndex: 100}}}, + wantErr: "source is not active", + }, + { + name: "consolidation with inactive target is rejected", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + val, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + val.ActivationEpoch = params.BeaconConfig().FarFutureEpoch + require.NoError(t, st.UpdateValidatorAtIndex(25, val)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, + wantErr: "target is not active", + }, + { + name: "consolidation with exiting source is rejected", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + val, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + val.ExitEpoch = 256 + require.NoError(t, st.UpdateValidatorAtIndex(25, val)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 25, TargetIndex: 100}}}, + wantErr: "source exit epoch has been initiated", + }, + { + name: "consolidation with exiting target is rejected", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + val, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + val.ExitEpoch = 256 + require.NoError(t, st.UpdateValidatorAtIndex(25, val)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, + wantErr: "target exit epoch has been initiated", + }, + { + name: "consolidation with future epoch is rejected", + state: stateWithActiveBalanceETH(t, 19_000_000), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25, Epoch: 55}}}, + wantErr: "consolidation is not valid yet", + }, + { + name: "source validator without withdrawal credentials is rejected", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + val, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + val.WithdrawalCredentials = []byte{} + require.NoError(t, st.UpdateValidatorAtIndex(25, val)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 25, TargetIndex: 100}}}, + wantErr: "source does not have execution withdrawal credentials", + }, + { + name: "target validator without withdrawal credentials is rejected", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + val, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + val.WithdrawalCredentials = []byte{} + require.NoError(t, st.UpdateValidatorAtIndex(25, val)) + return st + }(), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, + wantErr: "target does not have execution withdrawal credentials", + }, + { + name: "source and target with different withdrawal credentials is rejected", + state: stateWithActiveBalanceETH(t, 19_000_000), + scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, + wantErr: "source and target have different withdrawal credentials", + }, + { + name: "consolidation with valid signatures is OK", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 19_000_000) + require.NoError(t, st.SetGenesisValidatorsRoot(genesisValidatorRoot)) + source, err := st.ValidatorAtIndex(100) + require.NoError(t, err) + target, err := st.ValidatorAtIndex(25) + require.NoError(t, err) + source.PublicKey = publicKeys[0].Marshal() + source.WithdrawalCredentials = target.WithdrawalCredentials + require.NoError(t, st.UpdateValidatorAtIndex(100, source)) + target.PublicKey = publicKeys[1].Marshal() + require.NoError(t, st.UpdateValidatorAtIndex(25, target)) + return st + }(), + scs: func() []*eth.SignedConsolidation { + sc := ð.SignedConsolidation{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25, Epoch: 8}} + + domain, err := signing.ComputeDomain( + params.BeaconConfig().DomainConsolidation, + nil, + genesisValidatorRoot, + ) + require.NoError(t, err) + sr, err := signing.ComputeSigningRoot(sc.Message, domain) + require.NoError(t, err) + + sig0 := secretKeys[0].Sign(sr[:]) + sig1 := secretKeys[1].Sign(sr[:]) + + sc.Signature = blst.AggregateSignatures([]common.Signature{sig0, sig1}).Marshal() + + return []*eth.SignedConsolidation{sc} + }(), + check: func(t *testing.T, st state.BeaconState) { + source, err := st.ValidatorAtIndex(100) + require.NoError(t, err) + // The consolidated validator is exiting. + require.Equal(t, primitives.Epoch(15), source.ExitEpoch) // 15 = state.Epoch(10) + MIN_SEED_LOOKAHEAD(4) + 1 + require.Equal(t, primitives.Epoch(15+params.BeaconConfig().MinValidatorWithdrawabilityDelay), source.WithdrawableEpoch) + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := electra.ProcessConsolidations(context.TODO(), tt.state, tt.scs) + if len(tt.wantErr) > 0 { + require.ErrorContains(t, tt.wantErr, err) + } else { + require.NoError(t, err) + } + if tt.check != nil { + tt.check(t, tt.state) + } + }) + } +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel index 9bf424ef6062..c256d5da8516 100644 --- a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel @@ -8,6 +8,7 @@ go_test( "inactivity_updates_test.go", "justification_and_finalization_test.go", "participation_flag_updates_test.go", + "pending_consolidations_test.go", "randao_mixes_reset_test.go", "rewards_and_penalties_test.go", "slashings_reset_test.go", diff --git a/testing/spectest/mainnet/electra/epoch_processing/pending_consolidations_test.go b/testing/spectest/mainnet/electra/epoch_processing/pending_consolidations_test.go new file mode 100644 index 000000000000..9dbc628d062f --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/pending_consolidations_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_PendingConsolidations(t *testing.T) { + epoch_processing.RunPendingConsolidationsTests(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/BUILD.bazel b/testing/spectest/mainnet/electra/operations/BUILD.bazel index 48fd331379dd..a8a3ba231ec0 100644 --- a/testing/spectest/mainnet/electra/operations/BUILD.bazel +++ b/testing/spectest/mainnet/electra/operations/BUILD.bazel @@ -6,6 +6,7 @@ go_test( "attester_slashing_test.go", "block_header_test.go", "bls_to_execution_change_test.go", + "consolidation_test.go", "execution_payload_test.go", "proposer_slashing_test.go", "sync_committee_test.go", diff --git a/testing/spectest/mainnet/electra/operations/consolidation_test.go b/testing/spectest/mainnet/electra/operations/consolidation_test.go new file mode 100644 index 000000000000..9f6b0208d8cf --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/consolidation_test.go @@ -0,0 +1,12 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_Consolidation(t *testing.T) { + t.Skip("These tests were temporarily deleted in v1.5.0-alpha.2. See https://github.com/ethereum/consensus-specs/pull/3736") + operations.RunConsolidationTest(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel index 0f4b31514b71..02bf1f72aba4 100644 --- a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel @@ -8,6 +8,7 @@ go_test( "inactivity_updates_test.go", "justification_and_finalization_test.go", "participation_flag_updates_test.go", + "pending_consolidations_test.go", "randao_mixes_reset_test.go", "rewards_and_penalties_test.go", "slashings_reset_test.go", diff --git a/testing/spectest/minimal/electra/epoch_processing/pending_consolidations_test.go b/testing/spectest/minimal/electra/epoch_processing/pending_consolidations_test.go new file mode 100644 index 000000000000..0fcbb76608d0 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/pending_consolidations_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_PendingConsolidations(t *testing.T) { + epoch_processing.RunPendingConsolidationsTests(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/BUILD.bazel b/testing/spectest/minimal/electra/operations/BUILD.bazel index b54d95de73d0..d95b1cb0eb0a 100644 --- a/testing/spectest/minimal/electra/operations/BUILD.bazel +++ b/testing/spectest/minimal/electra/operations/BUILD.bazel @@ -6,6 +6,7 @@ go_test( "attester_slashing_test.go", "block_header_test.go", "bls_to_execution_change_test.go", + "consolidation_test.go", "execution_payload_test.go", "proposer_slashing_test.go", "sync_committee_test.go", diff --git a/testing/spectest/minimal/electra/operations/consolidation_test.go b/testing/spectest/minimal/electra/operations/consolidation_test.go new file mode 100644 index 000000000000..cc46d13998d2 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/consolidation_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_Consolidation(t *testing.T) { + operations.RunConsolidationTest(t, "minimal") +} diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index 90d8ef842817..7140a280dab4 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -10,6 +10,7 @@ go_library( "inactivity_updates.go", "justification_and_finalization.go", "participation_flag_updates.go", + "pending_consolidations.go", "randao_mixes_reset.go", "rewards_and_penalties.go", "slashings.go", diff --git a/testing/spectest/shared/electra/epoch_processing/pending_consolidations.go b/testing/spectest/shared/electra/epoch_processing/pending_consolidations.go new file mode 100644 index 000000000000..06e7f8161b9d --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/pending_consolidations.go @@ -0,0 +1,28 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +func RunPendingConsolidationsTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/pending_consolidations/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processPendingConsolidations) + }) + } +} + +func processPendingConsolidations(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + return st, electra.ProcessPendingConsolidations(context.TODO(), st) +} diff --git a/testing/spectest/shared/electra/operations/BUILD.bazel b/testing/spectest/shared/electra/operations/BUILD.bazel index 7da4295b226b..9596456ef58d 100644 --- a/testing/spectest/shared/electra/operations/BUILD.bazel +++ b/testing/spectest/shared/electra/operations/BUILD.bazel @@ -7,6 +7,7 @@ go_library( "attester_slashing.go", "block_header.go", "bls_to_execution_changes.go", + "consolidations.go", "deposit_receipt.go", "execution_layer_withdrawal_request.go", "execution_payload.go", diff --git a/testing/spectest/shared/electra/operations/consolidations.go b/testing/spectest/shared/electra/operations/consolidations.go new file mode 100644 index 000000000000..967ddafa2400 --- /dev/null +++ b/testing/spectest/shared/electra/operations/consolidations.go @@ -0,0 +1,47 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunConsolidationTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/consolidation/pyspec_tests") + require.NotEqual(t, 0, len(testFolders), "missing tests for consolidation operation in folder") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + consolidationFile, err := util.BazelFileBytes(folderPath, "consolidation.ssz_snappy") + require.NoError(t, err) + consolidationSSZ, err := snappy.Decode(nil /* dst */, consolidationFile) + require.NoError(t, err, "Failed to decompress") + consolidation := ðpb.SignedConsolidation{} + require.NoError(t, consolidation.UnmarshalSSZ(consolidationSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{Consolidations: []*ethpb.SignedConsolidation{consolidation}} + processConsolidationFunc := func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + body, ok := b.Block().Body().(interfaces.ROBlockBodyElectra) + if !ok { + t.Error("block body is not electra") + } + cs := body.Consolidations() + if len(cs) == 0 { + t.Error("no consolidations to test") + } + return s, electra.ProcessConsolidations(ctx, s, cs) + } + RunBlockOperationTest(t, folderPath, body, processConsolidationFunc) + }) + } +} From 1272b9e18606ee241a1215839dc77867bc193b22 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Wed, 15 May 2024 12:29:38 -0500 Subject: [PATCH 096/325] eip-7251: process_pending_balance_deposits (#14002) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * eip-7251: process_pending_balance_deposits * Update beacon-chain/core/electra/balance_deposits_test.go Co-authored-by: Radosław Kapka * Remove defensive check. A unit test shows nothing bad happens * Safe sub to protect from underflow * Use @kasey's idea for safer subtraction --------- Co-authored-by: Radosław Kapka --- beacon-chain/core/electra/BUILD.bazel | 2 + beacon-chain/core/electra/balance_deposits.go | 77 +++++++++++ .../core/electra/balance_deposits_test.go | 129 ++++++++++++++++++ .../core/electra/consolidations_test.go | 4 +- .../electra/epoch_processing/BUILD.bazel | 1 + .../pending_balance_updates_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 1 + .../pending_balance_updates_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 2 + .../pending_balance_updates.go | 35 +++++ 10 files changed, 271 insertions(+), 2 deletions(-) create mode 100644 beacon-chain/core/electra/balance_deposits.go create mode 100644 beacon-chain/core/electra/balance_deposits_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/pending_balance_updates_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/pending_balance_updates_test.go create mode 100644 testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index acb1f7dceded..ac9e5de4a526 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "balance_deposits.go", "churn.go", "consolidations.go", "transition.go", @@ -35,6 +36,7 @@ go_library( go_test( name = "go_default_test", srcs = [ + "balance_deposits_test.go", "churn_test.go", "consolidations_test.go", "upgrade_test.go", diff --git a/beacon-chain/core/electra/balance_deposits.go b/beacon-chain/core/electra/balance_deposits.go new file mode 100644 index 000000000000..75ef2a8ea949 --- /dev/null +++ b/beacon-chain/core/electra/balance_deposits.go @@ -0,0 +1,77 @@ +package electra + +import ( + "context" + "errors" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/math" + "go.opencensus.io/trace" +) + +// ProcessPendingBalanceDeposits implements the spec definition below. This method mutates the state. +// +// Spec definition: +// +// def process_pending_balance_deposits(state: BeaconState) -> None: +// available_for_processing = state.deposit_balance_to_consume + get_activation_exit_churn_limit(state) +// processed_amount = 0 +// next_deposit_index = 0 +// +// for deposit in state.pending_balance_deposits: +// if processed_amount + deposit.amount > available_for_processing: +// break +// increase_balance(state, deposit.index, deposit.amount) +// processed_amount += deposit.amount +// next_deposit_index += 1 +// +// state.pending_balance_deposits = state.pending_balance_deposits[next_deposit_index:] +// +// if len(state.pending_balance_deposits) == 0: +// state.deposit_balance_to_consume = Gwei(0) +// else: +// state.deposit_balance_to_consume = available_for_processing - processed_amount +func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, activeBalance math.Gwei) error { + _, span := trace.StartSpan(ctx, "electra.ProcessPendingBalanceDeposits") + defer span.End() + + if st == nil || st.IsNil() { + return errors.New("nil state") + } + + depBalToConsume, err := st.DepositBalanceToConsume() + if err != nil { + return err + } + + availableForProcessing := depBalToConsume + helpers.ActivationExitChurnLimit(activeBalance) + nextDepositIndex := 0 + + deposits, err := st.PendingBalanceDeposits() + if err != nil { + return err + } + + for _, deposit := range deposits { + if math.Gwei(deposit.Amount) > availableForProcessing { + break + } + if err := helpers.IncreaseBalance(st, deposit.Index, deposit.Amount); err != nil { + return err + } + availableForProcessing -= math.Gwei(deposit.Amount) + nextDepositIndex++ + } + + deposits = deposits[nextDepositIndex:] + if err := st.SetPendingBalanceDeposits(deposits); err != nil { + return err + } + + if len(deposits) == 0 { + return st.SetDepositBalanceToConsume(0) + } else { + return st.SetDepositBalanceToConsume(availableForProcessing) + } +} diff --git a/beacon-chain/core/electra/balance_deposits_test.go b/beacon-chain/core/electra/balance_deposits_test.go new file mode 100644 index 000000000000..980785d86b46 --- /dev/null +++ b/beacon-chain/core/electra/balance_deposits_test.go @@ -0,0 +1,129 @@ +package electra_test + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/math" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestProcessPendingBalanceDeposits(t *testing.T) { + tests := []struct { + name string + state state.BeaconState + wantErr bool + check func(*testing.T, state.BeaconState) + }{ + { + name: "nil state fails", + state: nil, + wantErr: true, + }, + { + name: "no deposits resets balance to consume", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 1_000) + require.NoError(t, st.SetDepositBalanceToConsume(100)) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + res, err := st.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(0), res) + }, + }, + { + name: "more deposits than balance to consume processes partial deposits", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 1_000) + require.NoError(t, st.SetDepositBalanceToConsume(100)) + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + deps := make([]*eth.PendingBalanceDeposit, 20) + for i := 0; i < len(deps); i += 1 { + deps[i] = ð.PendingBalanceDeposit{ + Amount: uint64(amountAvailForProcessing) / 10, + Index: primitives.ValidatorIndex(i), + } + } + require.NoError(t, st.SetPendingBalanceDeposits(deps)) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + res, err := st.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(100), res) + // Validators 0..9 should have their balance increased + for i := primitives.ValidatorIndex(0); i < 10; i++ { + b, err := st.BalanceAtIndex(i) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance+uint64(amountAvailForProcessing)/10, b) + } + + // Half of the balance deposits should have been processed. + remaining, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 10, len(remaining)) + }, + }, + { + name: "less deposits than balance to consume processes all deposits", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 1_000) + require.NoError(t, st.SetDepositBalanceToConsume(0)) + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + deps := make([]*eth.PendingBalanceDeposit, 5) + for i := 0; i < len(deps); i += 1 { + deps[i] = ð.PendingBalanceDeposit{ + Amount: uint64(amountAvailForProcessing) / 5, + Index: primitives.ValidatorIndex(i), + } + } + require.NoError(t, st.SetPendingBalanceDeposits(deps)) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + res, err := st.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, math.Gwei(0), res) + // Validators 0..4 should have their balance increased + for i := primitives.ValidatorIndex(0); i < 4; i++ { + b, err := st.BalanceAtIndex(i) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance+uint64(amountAvailForProcessing)/5, b) + } + + // All of the balance deposits should have been processed. + remaining, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(remaining)) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var tab uint64 + var err error + if tt.state != nil { + // The caller of this method would normally have the precompute balance values for total + // active balance for this epoch. For ease of test setup, we will compute total active + // balance from the given state. + tab, err = helpers.TotalActiveBalance(tt.state) + } + require.NoError(t, err) + err = electra.ProcessPendingBalanceDeposits(context.TODO(), tt.state, math.Gwei(tab)) + require.Equal(t, tt.wantErr, err != nil, "wantErr=%v, got err=%s", tt.wantErr, err) + if tt.check != nil { + tt.check(t, tt.state) + } + }) + } +} diff --git a/beacon-chain/core/electra/consolidations_test.go b/beacon-chain/core/electra/consolidations_test.go index 1e3b22c0bd79..fbb2fdcdd77b 100644 --- a/beacon-chain/core/electra/consolidations_test.go +++ b/beacon-chain/core/electra/consolidations_test.go @@ -259,8 +259,8 @@ func TestProcessConsolidations(t *testing.T) { wantErr: "nil state", }, { - name: "nil consolidation in slice", - state: stateWithActiveBalanceETH(t, 19_000_000), + name: "nil consolidation in slice", + state: stateWithActiveBalanceETH(t, 19_000_000), scs: []*eth.SignedConsolidation{nil, nil}, wantErr: "nil consolidation", }, diff --git a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel index c256d5da8516..7a22e82c49fb 100644 --- a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel @@ -8,6 +8,7 @@ go_test( "inactivity_updates_test.go", "justification_and_finalization_test.go", "participation_flag_updates_test.go", + "pending_balance_updates_test.go", "pending_consolidations_test.go", "randao_mixes_reset_test.go", "rewards_and_penalties_test.go", diff --git a/testing/spectest/mainnet/electra/epoch_processing/pending_balance_updates_test.go b/testing/spectest/mainnet/electra/epoch_processing/pending_balance_updates_test.go new file mode 100644 index 000000000000..7c47df8e8282 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/pending_balance_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_PendingBalanceDeposits(t *testing.T) { + epoch_processing.RunPendingBalanceDepositsTests(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel index 02bf1f72aba4..f9d84a32e914 100644 --- a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel @@ -8,6 +8,7 @@ go_test( "inactivity_updates_test.go", "justification_and_finalization_test.go", "participation_flag_updates_test.go", + "pending_balance_updates_test.go", "pending_consolidations_test.go", "randao_mixes_reset_test.go", "rewards_and_penalties_test.go", diff --git a/testing/spectest/minimal/electra/epoch_processing/pending_balance_updates_test.go b/testing/spectest/minimal/electra/epoch_processing/pending_balance_updates_test.go new file mode 100644 index 000000000000..a2cc73b1a3ca --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/pending_balance_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_PendingBalanceDeposits(t *testing.T) { + epoch_processing.RunPendingBalanceDepositsTests(t, "minimal") +} diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index 7140a280dab4..342cfae44b29 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -10,6 +10,7 @@ go_library( "inactivity_updates.go", "justification_and_finalization.go", "participation_flag_updates.go", + "pending_balance_updates.go", "pending_consolidations.go", "randao_mixes_reset.go", "rewards_and_penalties.go", @@ -25,6 +26,7 @@ go_library( "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", + "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go b/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go new file mode 100644 index 000000000000..fbd3714cde54 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go @@ -0,0 +1,35 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +func RunPendingBalanceDepositsTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/pending_balance_deposits/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processPendingBalanceDeposits) + }) + } +} + +func processPendingBalanceDeposits(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + // The caller of this method would normally have the precompute balance values for total + // active balance for this epoch. For ease of test setup, we will compute total active + // balance from the given state. + tab, err := helpers.TotalActiveBalance(st) + require.NoError(t, err) + return st, electra.ProcessPendingBalanceDeposits(context.TODO(), st, math.Gwei(tab)) +} From 46168607e81645d9f3ec6642043f9d787643b560 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Fri, 17 May 2024 15:31:07 -0500 Subject: [PATCH 097/325] Electra payload body engine methods (#14000) * Combined v1/v2 payload body handling * prevent overflows when dealing with electra fixture --------- Co-authored-by: Kasey Kirkham --- beacon-chain/execution/BUILD.bazel | 3 + beacon-chain/execution/engine_client.go | 272 ++----- beacon-chain/execution/engine_client_test.go | 687 ++++-------------- beacon-chain/execution/mock_test.go | 221 ++++++ beacon-chain/execution/payload_body.go | 250 +++++++ beacon-chain/execution/payload_body_test.go | 408 +++++++++++ proto/engine/v1/execution_engine.pb.go | 329 ++++----- proto/engine/v1/execution_engine.proto | 5 - proto/engine/v1/generated.ssz.go | 2 +- proto/engine/v1/json_marshal_unmarshal.go | 133 ++-- .../engine/v1/json_marshal_unmarshal_test.go | 12 +- proto/eth/v1/generated.ssz.go | 2 +- proto/eth/v2/generated.ssz.go | 2 +- proto/prysm/v1alpha1/generated.ssz.go | 2 +- testing/util/deneb.go | 89 ++- testing/util/electra.go | 175 +++++ 16 files changed, 1533 insertions(+), 1059 deletions(-) create mode 100644 beacon-chain/execution/mock_test.go create mode 100644 beacon-chain/execution/payload_body.go create mode 100644 beacon-chain/execution/payload_body_test.go diff --git a/beacon-chain/execution/BUILD.bazel b/beacon-chain/execution/BUILD.bazel index 2ff3ec037916..2d0edffd8744 100644 --- a/beacon-chain/execution/BUILD.bazel +++ b/beacon-chain/execution/BUILD.bazel @@ -12,6 +12,7 @@ go_library( "log_processing.go", "metrics.go", "options.go", + "payload_body.go", "prometheus.go", "rpc_connection.go", "service.go", @@ -86,6 +87,8 @@ go_test( "execution_chain_test.go", "init_test.go", "log_processing_test.go", + "mock_test.go", + "payload_body_test.go", "prometheus_test.go", "service_test.go", ], diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index c72b3ea33b30..8ed049bce9fc 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -1,7 +1,6 @@ package execution import ( - "bytes" "context" "fmt" "math/big" @@ -34,12 +33,19 @@ var ( supportedEngineEndpoints = []string{ NewPayloadMethod, NewPayloadMethodV2, + NewPayloadMethodV3, + NewPayloadMethodV4, ForkchoiceUpdatedMethod, ForkchoiceUpdatedMethodV2, + ForkchoiceUpdatedMethodV3, GetPayloadMethod, GetPayloadMethodV2, + GetPayloadMethodV3, + GetPayloadMethodV4, GetPayloadBodiesByHashV1, GetPayloadBodiesByRangeV1, + GetPayloadBodiesByHashV2, + GetPayloadBodiesByRangeV2, } ) @@ -69,16 +75,22 @@ const ( BlockByHashMethod = "eth_getBlockByHash" // BlockByNumberMethod request string for JSON-RPC. BlockByNumberMethod = "eth_getBlockByNumber" - // GetPayloadBodiesByHashV1 v1 request string for JSON-RPC. + // GetPayloadBodiesByHashV1 is the engine_getPayloadBodiesByHashX JSON-RPC method for pre-Electra payloads. GetPayloadBodiesByHashV1 = "engine_getPayloadBodiesByHashV1" - // GetPayloadBodiesByRangeV1 v1 request string for JSON-RPC. + // GetPayloadBodiesByHashV2 is the engine_getPayloadBodiesByHashX JSON-RPC method introduced by Electra. + GetPayloadBodiesByHashV2 = "engine_getPayloadBodiesByHashV2" + // GetPayloadBodiesByRangeV1 is the engine_getPayloadBodiesByRangeX JSON-RPC method for pre-Electra payloads. GetPayloadBodiesByRangeV1 = "engine_getPayloadBodiesByRangeV1" + // GetPayloadBodiesByRangeV2 is the engine_getPayloadBodiesByRangeX JSON-RPC method introduced by Electra. + GetPayloadBodiesByRangeV2 = "engine_getPayloadBodiesByRangeV2" // ExchangeCapabilities request string for JSON-RPC. ExchangeCapabilities = "engine_exchangeCapabilities" // Defines the seconds before timing out engine endpoints with non-block execution semantics. defaultEngineTimeout = time.Second ) +var errInvalidPayloadBodyResponse = errors.New("engine api payload body response is invalid") + // ForkchoiceUpdatedResponse is the response kind received by the // engine_forkchoiceUpdatedV1 endpoint. type ForkchoiceUpdatedResponse struct { @@ -509,93 +521,19 @@ func (s *Service) HeaderByNumber(ctx context.Context, number *big.Int) (*types.H return hdr, err } -// GetPayloadBodiesByHash returns the relevant payload bodies for the provided block hash. -func (s *Service) GetPayloadBodiesByHash(ctx context.Context, executionBlockHashes []common.Hash) ([]*pb.ExecutionPayloadBodyV1, error) { - ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.GetPayloadBodiesByHashV1") - defer span.End() - - result := make([]*pb.ExecutionPayloadBodyV1, 0) - // Exit early if there are no execution hashes. - if len(executionBlockHashes) == 0 { - return result, nil - } - err := s.rpcClient.CallContext(ctx, &result, GetPayloadBodiesByHashV1, executionBlockHashes) - if err != nil { - return nil, handleRPCError(err) - } - if len(result) != len(executionBlockHashes) { - return nil, fmt.Errorf("mismatch of payloads retrieved from the execution client: %d vs %d", len(result), len(executionBlockHashes)) - } - for i, item := range result { - if item == nil { - result[i] = &pb.ExecutionPayloadBodyV1{ - Transactions: make([][]byte, 0), - Withdrawals: make([]*pb.Withdrawal, 0), - } - } - } - return result, nil -} - -// GetPayloadBodiesByRange returns the relevant payload bodies for the provided range. -func (s *Service) GetPayloadBodiesByRange(ctx context.Context, start, count uint64) ([]*pb.ExecutionPayloadBodyV1, error) { - ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.GetPayloadBodiesByRangeV1") - defer span.End() - - result := make([]*pb.ExecutionPayloadBodyV1, 0) - err := s.rpcClient.CallContext(ctx, &result, GetPayloadBodiesByRangeV1, start, count) - - for i, item := range result { - if item == nil { - result[i] = &pb.ExecutionPayloadBodyV1{ - Transactions: make([][]byte, 0), - Withdrawals: make([]*pb.Withdrawal, 0), - } - } - } - return result, handleRPCError(err) -} - // ReconstructFullBlock takes in a blinded beacon block and reconstructs // a beacon block with a full execution payload via the engine API. func (s *Service) ReconstructFullBlock( ctx context.Context, blindedBlock interfaces.ReadOnlySignedBeaconBlock, ) (interfaces.SignedBeaconBlock, error) { - if err := blocks.BeaconBlockIsNil(blindedBlock); err != nil { - return nil, errors.Wrap(err, "cannot reconstruct bellatrix block from nil data") - } - if !blindedBlock.Block().IsBlinded() { - return nil, errors.New("can only reconstruct block from blinded block format") - } - header, err := blindedBlock.Block().Body().Execution() + reconstructed, err := s.ReconstructFullBellatrixBlockBatch(ctx, []interfaces.ReadOnlySignedBeaconBlock{blindedBlock}) if err != nil { return nil, err } - if header.IsNil() { - return nil, errors.New("execution payload header in blinded block was nil") + if len(reconstructed) != 1 { + return nil, errors.Errorf("could not retrieve the correct number of payload bodies: wanted 1 but got %d", len(reconstructed)) } - - // If the payload header has a block hash of 0x0, it means we are pre-merge and should - // simply return the block with an empty execution payload. - if bytes.Equal(header.BlockHash(), params.BeaconConfig().ZeroHash[:]) { - payload, err := buildEmptyExecutionPayload(blindedBlock.Version()) - if err != nil { - return nil, err - } - return blocks.BuildSignedBeaconBlockFromExecutionPayload(blindedBlock, payload) - } - - executionBlockHash := common.BytesToHash(header.BlockHash()) - payload, err := s.retrievePayloadFromExecutionHash(ctx, executionBlockHash, header, blindedBlock.Version()) - if err != nil { - return nil, err - } - fullBlock, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(blindedBlock, payload.Proto()) - if err != nil { - return nil, err - } - reconstructedExecutionPayloadCount.Add(1) - return fullBlock, nil + return reconstructed[0], nil } // ReconstructFullBellatrixBlockBatch takes in a batch of blinded beacon blocks and reconstructs @@ -603,114 +541,16 @@ func (s *Service) ReconstructFullBlock( func (s *Service) ReconstructFullBellatrixBlockBatch( ctx context.Context, blindedBlocks []interfaces.ReadOnlySignedBeaconBlock, ) ([]interfaces.SignedBeaconBlock, error) { - if len(blindedBlocks) == 0 { - return []interfaces.SignedBeaconBlock{}, nil - } - var executionHashes []common.Hash - var validExecPayloads []int - var zeroExecPayloads []int - for i, b := range blindedBlocks { - if err := blocks.BeaconBlockIsNil(b); err != nil { - return nil, errors.Wrap(err, "cannot reconstruct bellatrix block from nil data") - } - if !b.Block().IsBlinded() { - return nil, errors.New("can only reconstruct block from blinded block format") - } - header, err := b.Block().Body().Execution() - if err != nil { - return nil, err - } - if header.IsNil() { - return nil, errors.New("execution payload header in blinded block was nil") - } - // Determine if the block is pre-merge or post-merge. Depending on the result, - // we will ask the execution engine for the full payload. - if bytes.Equal(header.BlockHash(), params.BeaconConfig().ZeroHash[:]) { - zeroExecPayloads = append(zeroExecPayloads, i) - } else { - executionBlockHash := common.BytesToHash(header.BlockHash()) - validExecPayloads = append(validExecPayloads, i) - executionHashes = append(executionHashes, executionBlockHash) - } - } - fullBlocks, err := s.retrievePayloadsFromExecutionHashes(ctx, executionHashes, validExecPayloads, blindedBlocks) + unb, err := reconstructBlindedBlockBatch(ctx, s.rpcClient, blindedBlocks) if err != nil { return nil, err } - // For blocks that are pre-merge we simply reconstruct them via an empty - // execution payload. - for _, realIdx := range zeroExecPayloads { - bblock := blindedBlocks[realIdx] - payload, err := buildEmptyExecutionPayload(bblock.Version()) - if err != nil { - return nil, err - } - fullBlock, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(blindedBlocks[realIdx], payload) - if err != nil { - return nil, err - } - fullBlocks[realIdx] = fullBlock - } - reconstructedExecutionPayloadCount.Add(float64(len(blindedBlocks))) - return fullBlocks, nil -} - -func (s *Service) retrievePayloadFromExecutionHash(ctx context.Context, executionBlockHash common.Hash, header interfaces.ExecutionData, version int) (interfaces.ExecutionData, error) { - pBodies, err := s.GetPayloadBodiesByHash(ctx, []common.Hash{executionBlockHash}) - if err != nil { - return nil, fmt.Errorf("could not get payload body by hash %#x: %v", executionBlockHash, err) - } - if len(pBodies) != 1 { - return nil, errors.Errorf("could not retrieve the correct number of payload bodies: wanted 1 but got %d", len(pBodies)) - } - bdy := pBodies[0] - return fullPayloadFromPayloadBody(header, bdy, version) -} - -// This method assumes that the provided execution hashes are all valid and part of the -// canonical chain. -func (s *Service) retrievePayloadsFromExecutionHashes( - ctx context.Context, - executionHashes []common.Hash, - validExecPayloads []int, - blindedBlocks []interfaces.ReadOnlySignedBeaconBlock) ([]interfaces.SignedBeaconBlock, error) { - fullBlocks := make([]interfaces.SignedBeaconBlock, len(blindedBlocks)) - var payloadBodies []*pb.ExecutionPayloadBodyV1 - var err error - - payloadBodies, err = s.GetPayloadBodiesByHash(ctx, executionHashes) - if err != nil { - return nil, fmt.Errorf("could not fetch payload bodies by hash %#x: %v", executionHashes, err) - } - - // For each valid payload, we reconstruct the full block from it with the - // blinded block. - for sliceIdx, realIdx := range validExecPayloads { - var payload interfaces.ExecutionData - bblock := blindedBlocks[realIdx] - b := payloadBodies[sliceIdx] - if b == nil { - return nil, fmt.Errorf("received nil payload body for request by hash %#x", executionHashes[sliceIdx]) - } - header, err := bblock.Block().Body().Execution() - if err != nil { - return nil, err - } - payload, err = fullPayloadFromPayloadBody(header, b, bblock.Version()) - if err != nil { - return nil, err - } - fullBlock, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(bblock, payload.Proto()) - if err != nil { - return nil, err - } - fullBlocks[realIdx] = fullBlock - } - return fullBlocks, nil + reconstructedExecutionPayloadCount.Add(float64(len(unb))) + return unb, nil } func fullPayloadFromPayloadBody( - header interfaces.ExecutionData, body *pb.ExecutionPayloadBodyV1, bVersion int, + header interfaces.ExecutionData, body *pb.ExecutionPayloadBody, bVersion int, ) (interfaces.ExecutionData, error) { if header.IsNil() || body == nil { return nil, errors.New("execution block and header cannot be nil") @@ -732,7 +572,7 @@ func fullPayloadFromPayloadBody( ExtraData: header.ExtraData(), BaseFeePerGas: header.BaseFeePerGas(), BlockHash: header.BlockHash(), - Transactions: body.Transactions, + Transactions: pb.RecastHexutilByteSlice(body.Transactions), }) case version.Capella: return blocks.WrappedExecutionPayloadCapella(&pb.ExecutionPayloadCapella{ @@ -749,7 +589,7 @@ func fullPayloadFromPayloadBody( ExtraData: header.ExtraData(), BaseFeePerGas: header.BaseFeePerGas(), BlockHash: header.BlockHash(), - Transactions: body.Transactions, + Transactions: pb.RecastHexutilByteSlice(body.Transactions), Withdrawals: body.Withdrawals, }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance case version.Deneb: @@ -776,7 +616,7 @@ func fullPayloadFromPayloadBody( ExtraData: header.ExtraData(), BaseFeePerGas: header.BaseFeePerGas(), BlockHash: header.BlockHash(), - Transactions: body.Transactions, + Transactions: pb.RecastHexutilByteSlice(body.Transactions), Withdrawals: body.Withdrawals, ExcessBlobGas: ebg, BlobGasUsed: bgu, @@ -790,25 +630,35 @@ func fullPayloadFromPayloadBody( if err != nil { return nil, errors.Wrap(err, "unable to extract BlobGasUsed attribute from execution payload header") } + wr, err := pb.JsonWithdrawalRequestsToProto(body.WithdrawalRequests) + if err != nil { + return nil, err + } + dr, err := pb.JsonDepositRequestsToProto(body.DepositRequests) + if err != nil { + return nil, err + } return blocks.WrappedExecutionPayloadElectra( &pb.ExecutionPayloadElectra{ - ParentHash: header.ParentHash(), - FeeRecipient: header.FeeRecipient(), - StateRoot: header.StateRoot(), - ReceiptsRoot: header.ReceiptsRoot(), - LogsBloom: header.LogsBloom(), - PrevRandao: header.PrevRandao(), - BlockNumber: header.BlockNumber(), - GasLimit: header.GasLimit(), - GasUsed: header.GasUsed(), - Timestamp: header.Timestamp(), - ExtraData: header.ExtraData(), - BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: header.BlockHash(), - Transactions: body.Transactions, - Withdrawals: body.Withdrawals, - ExcessBlobGas: ebg, - BlobGasUsed: bgu, + ParentHash: header.ParentHash(), + FeeRecipient: header.FeeRecipient(), + StateRoot: header.StateRoot(), + ReceiptsRoot: header.ReceiptsRoot(), + LogsBloom: header.LogsBloom(), + PrevRandao: header.PrevRandao(), + BlockNumber: header.BlockNumber(), + GasLimit: header.GasLimit(), + GasUsed: header.GasUsed(), + Timestamp: header.Timestamp(), + ExtraData: header.ExtraData(), + BaseFeePerGas: header.BaseFeePerGas(), + BlockHash: header.BlockHash(), + Transactions: pb.RecastHexutilByteSlice(body.Transactions), + Withdrawals: body.Withdrawals, + ExcessBlobGas: ebg, + BlobGasUsed: bgu, + DepositReceipts: dr, + WithdrawalRequests: wr, }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance default: return nil, fmt.Errorf("unknown execution block version for payload %d", bVersion) @@ -943,6 +793,22 @@ func buildEmptyExecutionPayload(v int) (proto.Message, error) { Transactions: make([][]byte, 0), Withdrawals: make([]*pb.Withdrawal, 0), }, nil + case version.Electra: + return &pb.ExecutionPayloadElectra{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*pb.Withdrawal, 0), + WithdrawalRequests: make([]*pb.ExecutionLayerWithdrawalRequest, 0), + DepositReceipts: make([]*pb.DepositReceipt, 0), + }, nil default: return nil, errors.Wrapf(ErrUnsupportedVersion, "version=%s", version.String(v)) } diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index e42165d16651..2ac1f8d3c896 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -31,6 +31,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" logTest "github.com/sirupsen/logrus/hooks/test" ) @@ -993,7 +994,7 @@ func TestReconstructFullBellatrixBlockBatch(t *testing.T) { respJSON := map[string]interface{}{ "jsonrpc": "2.0", "id": 1, - "result": []map[string]interface{}{jsonPayload, jsonPayload}, + "result": []map[string]interface{}{jsonPayload}, } require.NoError(t, json.NewEncoder(w).Encode(respJSON)) @@ -1011,10 +1012,8 @@ func TestReconstructFullBellatrixBlockBatch(t *testing.T) { blindedBlock.Block.Body.ExecutionPayloadHeader = header wrapped, err := blocks.NewSignedBeaconBlock(blindedBlock) require.NoError(t, err) - copiedWrapped, err := wrapped.Copy() - require.NoError(t, err) - reconstructed, err := service.ReconstructFullBellatrixBlockBatch(ctx, []interfaces.ReadOnlySignedBeaconBlock{wrappedEmpty, wrapped, copiedWrapped}) + reconstructed, err := service.ReconstructFullBellatrixBlockBatch(ctx, []interfaces.ReadOnlySignedBeaconBlock{wrappedEmpty, wrapped}) require.NoError(t, err) // Make sure empty blocks are handled correctly @@ -1024,10 +1023,6 @@ func TestReconstructFullBellatrixBlockBatch(t *testing.T) { got, err := reconstructed[1].Block().Body().Execution() require.NoError(t, err) require.DeepEqual(t, payload, got.Proto()) - - got, err = reconstructed[2].Block().Body().Execution() - require.NoError(t, err) - require.DeepEqual(t, payload, got.Proto()) }) t.Run("handles invalid response from EL", func(t *testing.T) { fix := fixtures() @@ -1094,7 +1089,7 @@ func TestReconstructFullBellatrixBlockBatch(t *testing.T) { require.NoError(t, err) _, err = service.ReconstructFullBellatrixBlockBatch(ctx, []interfaces.ReadOnlySignedBeaconBlock{wrappedEmpty, wrapped, copiedWrapped}) - require.ErrorContains(t, "mismatch of payloads retrieved from the execution client", err) + require.ErrorIs(t, err, errInvalidPayloadBodyResponse) }) } @@ -1405,6 +1400,31 @@ func newTestIPCServer(t *testing.T) *rpc.Server { } func fixtures() map[string]interface{} { + s := fixturesStruct() + return map[string]interface{}{ + "ExecutionBlock": s.ExecutionBlock, + "ExecutionPayloadBody": s.ExecutionPayloadBody, + "ExecutionPayload": s.ExecutionPayload, + "ExecutionPayloadCapella": s.ExecutionPayloadCapella, + "ExecutionPayloadDeneb": s.ExecutionPayloadDeneb, + "ExecutionPayloadElectra": s.ExecutionPayloadElectra, + "ExecutionPayloadCapellaWithValue": s.ExecutionPayloadWithValueCapella, + "ExecutionPayloadDenebWithValue": s.ExecutionPayloadWithValueDeneb, + "ExecutionPayloadElectraWithValue": s.ExecutionPayloadWithValueElectra, + "ValidPayloadStatus": s.ValidPayloadStatus, + "InvalidBlockHashStatus": s.InvalidBlockHashStatus, + "AcceptedStatus": s.AcceptedStatus, + "SyncingStatus": s.SyncingStatus, + "InvalidStatus": s.InvalidStatus, + "UnknownStatus": s.UnknownStatus, + "ForkchoiceUpdatedResponse": s.ForkchoiceUpdatedResponse, + "ForkchoiceUpdatedSyncingResponse": s.ForkchoiceUpdatedSyncingResponse, + "ForkchoiceUpdatedAcceptedResponse": s.ForkchoiceUpdatedAcceptedResponse, + "ForkchoiceUpdatedInvalidResponse": s.ForkchoiceUpdatedInvalidResponse, + } +} + +func fixturesStruct() *payloadFixtures { foo := bytesutil.ToBytes32([]byte("foo")) bar := bytesutil.PadTo([]byte("bar"), 20) baz := bytesutil.PadTo([]byte("baz"), 256) @@ -1425,8 +1445,8 @@ func fixtures() map[string]interface{} { BlockHash: foo[:], Transactions: [][]byte{foo[:]}, } - executionPayloadBodyFixture := &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{foo[:]}, + executionPayloadBodyFixture := &pb.ExecutionPayloadBody{ + Transactions: []hexutil.Bytes{foo[:]}, Withdrawals: []*pb.Withdrawal{}, } executionPayloadFixtureCapella := &pb.ExecutionPayloadCapella{ @@ -1446,7 +1466,7 @@ func fixtures() map[string]interface{} { Transactions: [][]byte{foo[:]}, Withdrawals: []*pb.Withdrawal{}, } - executionPayloadFixtureDeneb := &pb.ExecutionPayloadDeneb{ + emptyExecutionPayloadDeneb := &pb.ExecutionPayloadDeneb{ ParentHash: foo[:], FeeRecipient: bar, StateRoot: foo[:], @@ -1460,11 +1480,29 @@ func fixtures() map[string]interface{} { ExtraData: foo[:], BaseFeePerGas: bytesutil.PadTo(baseFeePerGas.Bytes(), fieldparams.RootLength), BlockHash: foo[:], - Transactions: [][]byte{foo[:]}, - Withdrawals: []*pb.Withdrawal{}, BlobGasUsed: 2, ExcessBlobGas: 3, } + executionPayloadFixtureDeneb := &pb.ExecutionPayloadDeneb{ + ParentHash: emptyExecutionPayloadDeneb.ParentHash, + FeeRecipient: emptyExecutionPayloadDeneb.FeeRecipient, + StateRoot: emptyExecutionPayloadDeneb.StateRoot, + ReceiptsRoot: emptyExecutionPayloadDeneb.ReceiptsRoot, + LogsBloom: emptyExecutionPayloadDeneb.LogsBloom, + PrevRandao: emptyExecutionPayloadDeneb.PrevRandao, + BlockNumber: emptyExecutionPayloadDeneb.BlockNumber, + GasLimit: emptyExecutionPayloadDeneb.GasLimit, + GasUsed: emptyExecutionPayloadDeneb.GasUsed, + Timestamp: emptyExecutionPayloadDeneb.Timestamp, + ExtraData: emptyExecutionPayloadDeneb.ExtraData, + BaseFeePerGas: emptyExecutionPayloadDeneb.BaseFeePerGas, + BlockHash: emptyExecutionPayloadDeneb.BlockHash, + BlobGasUsed: emptyExecutionPayloadDeneb.BlobGasUsed, + ExcessBlobGas: emptyExecutionPayloadDeneb.ExcessBlobGas, + // added on top of the empty payload + Transactions: [][]byte{foo[:]}, + Withdrawals: []*pb.Withdrawal{}, + } withdrawalRequests := make([]pb.WithdrawalRequestV1, 3) for i := range withdrawalRequests { amount := hexutil.Uint64(i) @@ -1496,9 +1534,13 @@ func fixtures() map[string]interface{} { Index: &idx, } } - outer := &pb.ExecutionPayloadElectraJSON{ - WithdrawalRequests: withdrawalRequests, - DepositRequests: depositRequests, + dr, err := pb.JsonDepositRequestsToProto(depositRequests) + if err != nil { + panic(err) + } + wr, err := pb.JsonWithdrawalRequestsToProto(withdrawalRequests) + if err != nil { + panic(err) } executionPayloadFixtureElectra := &pb.ExecutionPayloadElectra{ ParentHash: foo[:], @@ -1518,8 +1560,8 @@ func fixtures() map[string]interface{} { Withdrawals: []*pb.Withdrawal{}, BlobGasUsed: 2, ExcessBlobGas: 3, - DepositReceipts: outer.ElectraDepositReceipts(), - WithdrawalRequests: outer.ElectraExecutionLayerWithdrawalRequests(), + DepositReceipts: dr, + WithdrawalRequests: wr, } hexUint := hexutil.Uint64(1) executionPayloadWithValueFixtureCapella := &pb.GetPayloadV2ResponseJson{ @@ -1573,22 +1615,24 @@ func fixtures() map[string]interface{} { executionPayloadWithValueFixtureElectra := &pb.GetPayloadV4ResponseJson{ ShouldOverrideBuilder: true, ExecutionPayload: &pb.ExecutionPayloadElectraJSON{ - ParentHash: &common.Hash{'a'}, - FeeRecipient: &common.Address{'b'}, - StateRoot: &common.Hash{'c'}, - ReceiptsRoot: &common.Hash{'d'}, - LogsBloom: &hexutil.Bytes{'e'}, - PrevRandao: &common.Hash{'f'}, - BaseFeePerGas: "0x123", - BlockHash: &common.Hash{'g'}, - Transactions: []hexutil.Bytes{{'h'}}, - Withdrawals: []*pb.Withdrawal{}, - BlockNumber: &hexUint, - GasLimit: &hexUint, - GasUsed: &hexUint, - Timestamp: &hexUint, - BlobGasUsed: &bgu, - ExcessBlobGas: &ebg, + ParentHash: &common.Hash{'a'}, + FeeRecipient: &common.Address{'b'}, + StateRoot: &common.Hash{'c'}, + ReceiptsRoot: &common.Hash{'d'}, + LogsBloom: &hexutil.Bytes{'e'}, + PrevRandao: &common.Hash{'f'}, + BaseFeePerGas: "0x123", + BlockHash: &common.Hash{'g'}, + Transactions: []hexutil.Bytes{{'h'}}, + Withdrawals: []*pb.Withdrawal{}, + BlockNumber: &hexUint, + GasLimit: &hexUint, + GasUsed: &hexUint, + Timestamp: &hexUint, + BlobGasUsed: &bgu, + ExcessBlobGas: &ebg, + DepositRequests: depositRequests, + WithdrawalRequests: withdrawalRequests, }, BlockValue: "0x11fffffffff", BlobsBundle: &pb.BlobBundleJSON{ @@ -1681,27 +1725,52 @@ func fixtures() map[string]interface{} { Status: pb.PayloadStatus_UNKNOWN, LatestValidHash: foo[:], } - return map[string]interface{}{ - "ExecutionBlock": executionBlock, - "ExecutionPayloadBody": executionPayloadBodyFixture, - "ExecutionPayload": executionPayloadFixture, - "ExecutionPayloadCapella": executionPayloadFixtureCapella, - "ExecutionPayloadDeneb": executionPayloadFixtureDeneb, - "ExecutionPayloadElectra": executionPayloadFixtureElectra, - "ExecutionPayloadCapellaWithValue": executionPayloadWithValueFixtureCapella, - "ExecutionPayloadDenebWithValue": executionPayloadWithValueFixtureDeneb, - "ExecutionPayloadElectraWithValue": executionPayloadWithValueFixtureElectra, - "ValidPayloadStatus": validStatus, - "InvalidBlockHashStatus": inValidBlockHashStatus, - "AcceptedStatus": acceptedStatus, - "SyncingStatus": syncingStatus, - "InvalidStatus": invalidStatus, - "UnknownStatus": unknownStatus, - "ForkchoiceUpdatedResponse": forkChoiceResp, - "ForkchoiceUpdatedSyncingResponse": forkChoiceSyncingResp, - "ForkchoiceUpdatedAcceptedResponse": forkChoiceAcceptedResp, - "ForkchoiceUpdatedInvalidResponse": forkChoiceInvalidResp, + return &payloadFixtures{ + ExecutionBlock: executionBlock, + ExecutionPayloadBody: executionPayloadBodyFixture, + ExecutionPayload: executionPayloadFixture, + ExecutionPayloadCapella: executionPayloadFixtureCapella, + ExecutionPayloadDeneb: executionPayloadFixtureDeneb, + EmptyExecutionPayloadDeneb: emptyExecutionPayloadDeneb, + ExecutionPayloadElectra: executionPayloadFixtureElectra, + ExecutionPayloadWithValueCapella: executionPayloadWithValueFixtureCapella, + ExecutionPayloadWithValueDeneb: executionPayloadWithValueFixtureDeneb, + ExecutionPayloadWithValueElectra: executionPayloadWithValueFixtureElectra, + ValidPayloadStatus: validStatus, + InvalidBlockHashStatus: inValidBlockHashStatus, + AcceptedStatus: acceptedStatus, + SyncingStatus: syncingStatus, + InvalidStatus: invalidStatus, + UnknownStatus: unknownStatus, + ForkchoiceUpdatedResponse: forkChoiceResp, + ForkchoiceUpdatedSyncingResponse: forkChoiceSyncingResp, + ForkchoiceUpdatedAcceptedResponse: forkChoiceAcceptedResp, + ForkchoiceUpdatedInvalidResponse: forkChoiceInvalidResp, } + +} + +type payloadFixtures struct { + ExecutionBlock *pb.ExecutionBlock + ExecutionPayloadBody *pb.ExecutionPayloadBody + ExecutionPayload *pb.ExecutionPayload + ExecutionPayloadCapella *pb.ExecutionPayloadCapella + EmptyExecutionPayloadDeneb *pb.ExecutionPayloadDeneb + ExecutionPayloadDeneb *pb.ExecutionPayloadDeneb + ExecutionPayloadElectra *pb.ExecutionPayloadElectra + ExecutionPayloadWithValueCapella *pb.GetPayloadV2ResponseJson + ExecutionPayloadWithValueDeneb *pb.GetPayloadV3ResponseJson + ExecutionPayloadWithValueElectra *pb.GetPayloadV4ResponseJson + ValidPayloadStatus *pb.PayloadStatus + InvalidBlockHashStatus *pb.PayloadStatus + AcceptedStatus *pb.PayloadStatus + SyncingStatus *pb.PayloadStatus + InvalidStatus *pb.PayloadStatus + UnknownStatus *pb.PayloadStatus + ForkchoiceUpdatedResponse *ForkchoiceUpdatedResponse + ForkchoiceUpdatedSyncingResponse *ForkchoiceUpdatedResponse + ForkchoiceUpdatedAcceptedResponse *ForkchoiceUpdatedResponse + ForkchoiceUpdatedInvalidResponse *ForkchoiceUpdatedResponse } func TestHeaderByHash_NotFound(t *testing.T) { @@ -2084,507 +2153,35 @@ func newPayloadV4Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.Execu return service } -func TestCapella_PayloadBodiesByHash(t *testing.T) { +func TestReconstructBlindedBlockBatch(t *testing.T) { t.Run("empty response works", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 0) - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByHash(ctx, []common.Hash{}) - require.NoError(t, err) - require.Equal(t, 0, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("single element response null works", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 1) - executionPayloadBodies[0] = nil - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - bRoot := [32]byte{} - copy(bRoot[:], "hash") - results, err := service.GetPayloadBodiesByHash(ctx, []common.Hash{bRoot}) - require.NoError(t, err) - require.Equal(t, 1, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("empty, null, full works", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 3) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{}, - Withdrawals: []*pb.Withdrawal{}, - } - executionPayloadBodies[1] = nil - executionPayloadBodies[2] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - bRoot := [32]byte{} - copy(bRoot[:], "hash") - results, err := service.GetPayloadBodiesByHash(ctx, []common.Hash{bRoot, bRoot, bRoot}) - require.NoError(t, err) - require.Equal(t, 3, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("full works, single item", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 1) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - bRoot := [32]byte{} - copy(bRoot[:], "hash") - results, err := service.GetPayloadBodiesByHash(ctx, []common.Hash{bRoot}) - require.NoError(t, err) - require.Equal(t, 1, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("full works, multiple items", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 2) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - executionPayloadBodies[1] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 2, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) ctx := context.Background() + cli, srv := newMockEngine(t) + srv.registerDefault(func(*jsonrpcMessage, http.ResponseWriter, *http.Request) { - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - bRoot := [32]byte{} - copy(bRoot[:], "hash") - results, err := service.GetPayloadBodiesByHash(ctx, []common.Hash{bRoot, bRoot}) - require.NoError(t, err) - require.Equal(t, 2, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("returning empty, null, empty should work properly", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - // [A, B, C] but no B in the server means - // we get [Abody, null, Cbody]. - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 3) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{}, - Withdrawals: []*pb.Withdrawal{}, - } - executionPayloadBodies[1] = nil - executionPayloadBodies[2] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{}, - Withdrawals: []*pb.Withdrawal{}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - bRoot := [32]byte{} - copy(bRoot[:], "hash") - results, err := service.GetPayloadBodiesByHash(ctx, []common.Hash{bRoot, bRoot, bRoot}) - require.NoError(t, err) - require.Equal(t, 3, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) -} - -func TestCapella_PayloadBodiesByRange(t *testing.T) { - t.Run("empty response works", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 0) - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByRange(ctx, uint64(1), uint64(2)) + t.Fatal("http request should not be made") + }) + results, err := reconstructBlindedBlockBatch(ctx, cli, []interfaces.ReadOnlySignedBeaconBlock{}) require.NoError(t, err) require.Equal(t, 0, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } }) - t.Run("single element response null works", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 1) - executionPayloadBodies[0] = nil - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) + t.Run("expected error for nil response", func(t *testing.T) { ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByRange(ctx, uint64(1), uint64(2)) + slot, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) require.NoError(t, err) - require.Equal(t, 1, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("empty, null, full works", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 3) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{}, - Withdrawals: []*pb.Withdrawal{}, - } - executionPayloadBodies[1] = nil - executionPayloadBodies[2] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByRange(ctx, uint64(1), uint64(2)) - require.NoError(t, err) - require.Equal(t, 3, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("full works, single item", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 1) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByRange(ctx, uint64(1), uint64(2)) - require.NoError(t, err) - require.Equal(t, 1, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("full works, multiple items", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 2) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - executionPayloadBodies[1] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{hexutil.MustDecode("0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86")}, - Withdrawals: []*pb.Withdrawal{{ - Index: 2, - ValidatorIndex: 1, - Address: hexutil.MustDecode("0xcf8e0d4e9587369b2301d0790347320302cc0943"), - Amount: 1, - }}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByRange(ctx, uint64(1), uint64(2)) - require.NoError(t, err) - require.Equal(t, 2, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } - }) - t.Run("returning empty, null, empty should work properly", func(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - // [A, B, C] but no B in the server means - // we get [Abody, null, Cbody]. - executionPayloadBodies := make([]*pb.ExecutionPayloadBodyV1, 3) - executionPayloadBodies[0] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{}, - Withdrawals: []*pb.Withdrawal{}, - } - executionPayloadBodies[1] = nil - executionPayloadBodies[2] = &pb.ExecutionPayloadBodyV1{ - Transactions: [][]byte{}, - Withdrawals: []*pb.Withdrawal{}, - } - - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": executionPayloadBodies, - } - err := json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - ctx := context.Background() + blk, _ := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 0) + cli, srv := newMockEngine(t) + srv.registerDefault(func(msg *jsonrpcMessage, w http.ResponseWriter, req *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{nil} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) - rpcClient, err := rpc.DialHTTP(srv.URL) + blinded, err := blk.ToBlinded() require.NoError(t, err) - service := &Service{} - service.rpcClient = rpcClient - - results, err := service.GetPayloadBodiesByRange(ctx, uint64(1), uint64(2)) - require.NoError(t, err) - require.Equal(t, 3, len(results)) - - for _, item := range results { - require.NotNil(t, item) - } + service.rpcClient = cli + _, err = service.ReconstructFullBlock(ctx, blinded) + require.ErrorIs(t, err, errNilPayloadBody) }) } diff --git a/beacon-chain/execution/mock_test.go b/beacon-chain/execution/mock_test.go new file mode 100644 index 000000000000..a77c83ecc446 --- /dev/null +++ b/beacon-chain/execution/mock_test.go @@ -0,0 +1,221 @@ +package execution + +import ( + "context" + "encoding/json" + "math" + "net/http" + "net/http/httptest" + "testing" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +var mockHandlerDefaultName = "__default__" + +type jsonError struct { + Code int `json:"code"` + Message string `json:"message"` + Data interface{} `json:"data,omitempty"` +} + +type jsonrpcMessage struct { + Version string `json:"jsonrpc,omitempty"` + ID json.RawMessage `json:"id,omitempty"` + Method string `json:"method,omitempty"` + Params json.RawMessage `json:"params,omitempty"` + Error *jsonError `json:"error,omitempty"` + Result json.RawMessage `json:"result,omitempty"` +} + +type mockHandler func(*jsonrpcMessage, http.ResponseWriter, *http.Request) + +type mockEngine struct { + t *testing.T + handlers map[string]mockHandler + calls map[string][]*jsonrpcMessage +} + +func newMockEngine(t *testing.T) (*rpc.Client, *mockEngine) { + s := &mockEngine{t: t, handlers: make(map[string]mockHandler), calls: make(map[string][]*jsonrpcMessage)} + srv := httptest.NewServer(s) + c, err := rpc.DialHTTP(srv.URL) + require.NoError(t, err) + return c, s +} + +func (s *mockEngine) ServeHTTP(w http.ResponseWriter, r *http.Request) { + msg := &jsonrpcMessage{} + defer func() { + s.calls[msg.Method] = append(s.calls[msg.Method], msg) + }() + if err := json.NewDecoder(r.Body).Decode(msg); err != nil { + http.Error(w, "failed to decode request: "+err.Error(), http.StatusBadRequest) + return + } + w.Header().Set("Content-Type", "application/json") + defer func() { + require.NoError(s.t, r.Body.Close()) + }() + handler, ok := s.handlers[msg.Method] + if !ok { + // Fallback to default handler if it is registered. + handler, ok = s.handlers[mockHandlerDefaultName] + if !ok { + s.t.Fatalf("mockEngine called with unexpected method %s", msg.Method) + } + } + handler(msg, w, r) +} + +func (s *mockEngine) register(method string, handler mockHandler) { + s.handlers[method] = handler +} + +func (s *mockEngine) registerDefault(handler mockHandler) { + s.handlers[mockHandlerDefaultName] = handler +} + +func (s *mockEngine) callCount(method string) int { + return len(s.calls[method]) +} + +func mockParseUintList(t *testing.T, data json.RawMessage) []uint64 { + var list []uint64 + if err := json.Unmarshal(data, &list); err != nil { + t.Fatalf("failed to parse uint list: %v", err) + } + return list +} + +func mockParseHexByteList(t *testing.T, data json.RawMessage) []hexutil.Bytes { + var list [][]hexutil.Bytes + if err := json.Unmarshal(data, &list); err != nil { + t.Fatalf("failed to parse hex byte list: %v", err) + } + require.Equal(t, 1, len(list)) + return list[0] +} + +func strToHexBytes(t *testing.T, s string) hexutil.Bytes { + b := hexutil.Bytes{} + require.NoError(t, b.UnmarshalText([]byte(s))) + return b +} + +func mockWriteResult(t *testing.T, w http.ResponseWriter, req *jsonrpcMessage, result any) { + marshaled, err := json.Marshal(result) + require.NoError(t, err) + req.Result = marshaled + require.NoError(t, json.NewEncoder(w).Encode(req)) +} + +func TestParseRequest(t *testing.T) { + ctx := context.Background() + cases := []struct { + method string + uintArgs []uint64 + byteArgs []hexutil.Bytes + }{ + { + method: GetPayloadBodiesByHashV1, + byteArgs: []hexutil.Bytes{ + strToHexBytes(t, "0x656d707479000000000000000000000000000000000000000000000000000000"), + strToHexBytes(t, "0x66756c6c00000000000000000000000000000000000000000000000000000000"), + }, + }, + { + method: GetPayloadBodiesByHashV2, + byteArgs: []hexutil.Bytes{ + strToHexBytes(t, "0x656d707479000000000000000000000000000000000000000000000000000000"), + strToHexBytes(t, "0x66756c6c00000000000000000000000000000000000000000000000000000000"), + }, + }, + { + method: GetPayloadBodiesByRangeV1, + uintArgs: []uint64{0, 1}, + }, + { + method: GetPayloadBodiesByRangeV2, + uintArgs: []uint64{math.MaxUint64, 1}, + }, + } + for _, c := range cases { + t.Run(c.method, func(t *testing.T) { + cli, srv := newMockEngine(t) + srv.register(c.method, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + require.Equal(t, c.method, msg.Method) + nr := uint64(len(c.byteArgs)) + if len(c.byteArgs) > 0 { + require.DeepEqual(t, c.byteArgs, mockParseHexByteList(t, msg.Params)) + } + if len(c.uintArgs) > 0 { + rang := mockParseUintList(t, msg.Params) + require.DeepEqual(t, c.uintArgs, rang) + nr = rang[1] + } + mockWriteResult(t, w, msg, make([]*pb.ExecutionPayloadBody, nr)) + }) + + result := make([]*pb.ExecutionPayloadBody, 0) + var args []interface{} + if len(c.byteArgs) > 0 { + args = []interface{}{c.byteArgs} + } + if len(c.uintArgs) > 0 { + args = make([]interface{}, len(c.uintArgs)) + for i := range c.uintArgs { + args[i] = c.uintArgs[i] + } + } + require.NoError(t, cli.CallContext(ctx, &result, c.method, args...)) + if len(c.byteArgs) > 0 { + require.Equal(t, len(c.byteArgs), len(result)) + } + if len(c.uintArgs) > 0 { + require.Equal(t, int(c.uintArgs[1]), len(result)) + } + }) + } +} + +func TestCallCount(t *testing.T) { + methods := []string{ + GetPayloadBodiesByHashV1, + GetPayloadBodiesByHashV2, + GetPayloadBodiesByRangeV1, + GetPayloadBodiesByRangeV2, + } + cases := []struct { + method string + count int + }{ + {method: GetPayloadBodiesByHashV1, count: 1}, + {method: GetPayloadBodiesByHashV1, count: 2}, + {method: GetPayloadBodiesByHashV2, count: 1}, + {method: GetPayloadBodiesByRangeV1, count: 1}, + {method: GetPayloadBodiesByRangeV1, count: 2}, + {method: GetPayloadBodiesByRangeV2, count: 1}, + } + for _, c := range cases { + t.Run(c.method, func(t *testing.T) { + cli, srv := newMockEngine(t) + srv.register(c.method, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + mockWriteResult(t, w, msg, nil) + }) + for i := 0; i < c.count; i++ { + require.NoError(t, cli.CallContext(context.Background(), nil, c.method)) + } + for _, m := range methods { + if m == c.method { + require.Equal(t, c.count, srv.callCount(m)) + } else { + require.Equal(t, 0, srv.callCount(m)) + } + } + }) + } +} diff --git a/beacon-chain/execution/payload_body.go b/beacon-chain/execution/payload_body.go new file mode 100644 index 000000000000..71e8f7473978 --- /dev/null +++ b/beacon-chain/execution/payload_body.go @@ -0,0 +1,250 @@ +package execution + +import ( + "context" + "sort" + + "github.com/ethereum/go-ethereum/common" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +var errNilPayloadBody = errors.New("nil payload body for block") + +type blockWithHeader struct { + block interfaces.ReadOnlySignedBeaconBlock + header interfaces.ExecutionData +} + +// reconstructionBatch is a map of block hashes to block numbers. +type reconstructionBatch map[[32]byte]uint64 + +type blindedBlockReconstructor struct { + orderedBlocks []*blockWithHeader + bodies map[[32]byte]*pb.ExecutionPayloadBody + batches map[string]reconstructionBatch +} + +func reconstructBlindedBlockBatch(ctx context.Context, client RPCClient, sbb []interfaces.ReadOnlySignedBeaconBlock) ([]interfaces.SignedBeaconBlock, error) { + r, err := newBlindedBlockReconstructor(sbb) + if err != nil { + return nil, err + } + if err := r.requestBodies(ctx, client); err != nil { + return nil, err + } + return r.unblinded() +} + +func newBlindedBlockReconstructor(sbb []interfaces.ReadOnlySignedBeaconBlock) (*blindedBlockReconstructor, error) { + r := &blindedBlockReconstructor{ + orderedBlocks: make([]*blockWithHeader, 0, len(sbb)), + bodies: make(map[[32]byte]*pb.ExecutionPayloadBody), + } + for i := range sbb { + if err := r.addToBatch(sbb[i]); err != nil { + return nil, err + } + } + return r, nil +} + +func (r *blindedBlockReconstructor) addToBatch(b interfaces.ReadOnlySignedBeaconBlock) error { + if err := blocks.BeaconBlockIsNil(b); err != nil { + return errors.Wrap(err, "cannot reconstruct bellatrix block from nil data") + } + if !b.Block().IsBlinded() { + return errors.New("can only reconstruct block from blinded block format") + } + header, err := b.Block().Body().Execution() + if err != nil { + return err + } + if header.IsNil() { + return errors.New("execution payload header in blinded block was nil") + } + r.orderedBlocks = append(r.orderedBlocks, &blockWithHeader{block: b, header: header}) + blockHash := bytesutil.ToBytes32(header.BlockHash()) + if blockHash == params.BeaconConfig().ZeroHash { + return nil + } + + method := payloadBodyMethodForBlock(b) + if r.batches == nil { + r.batches = make(map[string]reconstructionBatch) + } + if _, ok := r.batches[method]; !ok { + r.batches[method] = make(reconstructionBatch) + } + r.batches[method][bytesutil.ToBytes32(header.BlockHash())] = header.BlockNumber() + return nil +} + +func payloadBodyMethodForBlock(b interface{ Version() int }) string { + if b.Version() > version.Deneb { + return GetPayloadBodiesByHashV2 + } + return GetPayloadBodiesByHashV1 +} + +func (r *blindedBlockReconstructor) requestBodies(ctx context.Context, client RPCClient) error { + for method := range r.batches { + nilResults, err := r.requestBodiesByHash(ctx, client, method) + if err != nil { + return err + } + if err := r.handleNilResults(ctx, client, method, nilResults); err != nil { + return err + } + } + return nil +} + +type hashBlockNumber struct { + h [32]byte + n uint64 +} + +func (r *blindedBlockReconstructor) handleNilResults(ctx context.Context, client RPCClient, method string, nilResults [][32]byte) error { + if len(nilResults) == 0 { + return nil + } + hbns := make([]hashBlockNumber, len(nilResults)) + for i := range nilResults { + h := nilResults[i] + hbns[i] = hashBlockNumber{h: h, n: r.batches[method][h]} + } + reqs := computeRanges(hbns) + for i := range reqs { + if err := r.requestBodiesByRange(ctx, client, rangeMethodForHashMethod(method), reqs[i]); err != nil { + return err + } + } + return nil +} + +type byRangeReq struct { + start uint64 + count uint64 + hbns []hashBlockNumber +} + +func computeRanges(hbns []hashBlockNumber) []byRangeReq { + if len(hbns) == 0 { + return nil + } + sort.Slice(hbns, func(i, j int) bool { + return hbns[i].n < hbns[j].n + }) + ranges := make([]byRangeReq, 0) + start := hbns[0].n + count := uint64(0) + for i := 0; i < len(hbns); i++ { + if hbns[i].n == start+count { + count++ + continue + } + ranges = append(ranges, byRangeReq{start: start, count: count, hbns: hbns[uint64(i)-count : i]}) + start = hbns[i].n + count = 1 + } + ranges = append(ranges, byRangeReq{start: start, count: count, hbns: hbns[uint64(len(hbns))-count:]}) + return ranges +} + +func (r *blindedBlockReconstructor) requestBodiesByRange(ctx context.Context, client RPCClient, method string, req byRangeReq) error { + result := make([]*pb.ExecutionPayloadBody, 0) + if err := client.CallContext(ctx, &result, method, req.start, req.count); err != nil { + return err + } + if uint64(len(result)) != req.count { + return errors.Wrapf(errInvalidPayloadBodyResponse, "received %d payload bodies from %s with count=%d (start=%d)", len(result), method, req.count, req.start) + } + for i := range result { + if result[i] == nil { + return errors.Wrapf(errNilPayloadBody, "from %s, hash=%#x", method, req.hbns[i].h) + } + r.bodies[req.hbns[i].h] = result[i] + } + return nil +} + +func (r *blindedBlockReconstructor) requestBodiesByHash(ctx context.Context, client RPCClient, method string) ([][32]byte, error) { + batch := r.batches[method] + if len(batch) == 0 { + return nil, nil + } + hashes := make([]common.Hash, 0, len(batch)) + for h := range batch { + if h == params.BeaconConfig().ZeroHash { + continue + } + hashes = append(hashes, h) + } + result := make([]*pb.ExecutionPayloadBody, 0) + if err := client.CallContext(ctx, &result, method, hashes); err != nil { + return nil, err + } + if len(hashes) != len(result) { + return nil, errors.Wrapf(errInvalidPayloadBodyResponse, "received %d payload bodies for %d requested hashes", len(result), len(hashes)) + } + nilBodies := make([][32]byte, 0) + for i := range result { + if result[i] == nil { + nilBodies = append(nilBodies, hashes[i]) + continue + } + r.bodies[hashes[i]] = result[i] + } + return nilBodies, nil +} + +func (r *blindedBlockReconstructor) payloadForHeader(header interfaces.ExecutionData, v int) (proto.Message, error) { + bodyKey := bytesutil.ToBytes32(header.BlockHash()) + if bodyKey == params.BeaconConfig().ZeroHash { + payload, err := buildEmptyExecutionPayload(v) + if err != nil { + return nil, errors.Wrapf(err, "failed to reconstruct payload for body hash %#x", bodyKey) + } + return payload, nil + } + body, ok := r.bodies[bodyKey] + if !ok { + return nil, errors.Wrapf(errNilPayloadBody, "hash %#x", bodyKey) + } + ed, err := fullPayloadFromPayloadBody(header, body, v) + if err != nil { + return nil, errors.Wrapf(err, "failed to reconstruct payload for body hash %#x", bodyKey) + } + return ed.Proto(), nil +} + +func (r *blindedBlockReconstructor) unblinded() ([]interfaces.SignedBeaconBlock, error) { + unblinded := make([]interfaces.SignedBeaconBlock, len(r.orderedBlocks)) + for i := range r.orderedBlocks { + blk, header := r.orderedBlocks[i].block, r.orderedBlocks[i].header + payload, err := r.payloadForHeader(header, blk.Version()) + if err != nil { + return nil, err + } + full, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(blk, payload) + if err != nil { + return nil, errors.Wrapf(err, "failed to build full block from execution payload for block hash %#x", header.BlockHash()) + } + unblinded[i] = full + } + return unblinded, nil +} + +func rangeMethodForHashMethod(method string) string { + if method == GetPayloadBodiesByHashV2 { + return GetPayloadBodiesByRangeV2 + } + return GetPayloadBodiesByRangeV1 +} diff --git a/beacon-chain/execution/payload_body_test.go b/beacon-chain/execution/payload_body_test.go new file mode 100644 index 000000000000..b95edead67d8 --- /dev/null +++ b/beacon-chain/execution/payload_body_test.go @@ -0,0 +1,408 @@ +package execution + +import ( + "context" + "net/http" + "testing" + + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +type versioner struct { + version int +} + +func (v versioner) Version() int { + return v.version +} + +func TestPayloadBodyMethodForBlock(t *testing.T) { + cases := []struct { + versions []int + want string + }{ + { + versions: []int{version.Phase0, version.Altair, version.Bellatrix, version.Capella, version.Deneb}, + want: GetPayloadBodiesByHashV1, + }, + { + versions: []int{version.Electra}, + want: GetPayloadBodiesByHashV2, + }, + } + for _, c := range cases { + for _, v := range c.versions { + t.Run(version.String(v), func(t *testing.T) { + v := versioner{version: v} + require.Equal(t, c.want, payloadBodyMethodForBlock(v)) + }) + } + } + t.Run("post-electra", func(t *testing.T) { + require.Equal(t, GetPayloadBodiesByHashV2, payloadBodyMethodForBlock(versioner{version: version.Electra + 1})) + }) +} + +func payloadToBody(t *testing.T, ed interfaces.ExecutionData) *pb.ExecutionPayloadBody { + body := &pb.ExecutionPayloadBody{} + txs, err := ed.Transactions() + require.NoError(t, err) + wd, err := ed.Withdrawals() + // Bellatrix does not have withdrawals and will return an error. + if err == nil { + body.Withdrawals = wd + } + for i := range txs { + body.Transactions = append(body.Transactions, txs[i]) + } + eed, isElectra := ed.(interfaces.ExecutionDataElectra) + if isElectra { + body.DepositRequests = pb.ProtoDepositRequestsToJson(eed.DepositReceipts()) + body.WithdrawalRequests = pb.ProtoWithdrawalRequestsToJson(eed.WithdrawalRequests()) + } + return body +} + +type blindedBlockFixtures struct { + denebBlock *fullAndBlinded + emptyDenebBlock *fullAndBlinded + afterSkipDeneb *fullAndBlinded + electra *fullAndBlinded +} + +type fullAndBlinded struct { + full interfaces.ReadOnlySignedBeaconBlock + blinded *blockWithHeader +} + +func blindedBlockWithHeader(t *testing.T, b interfaces.ReadOnlySignedBeaconBlock) *fullAndBlinded { + header, err := b.Block().Body().Execution() + require.NoError(t, err) + blinded, err := b.ToBlinded() + require.NoError(t, err) + return &fullAndBlinded{ + full: b, + blinded: &blockWithHeader{ + block: blinded, + header: header, + }} +} + +func denebSlot(t *testing.T) primitives.Slot { + s, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) + require.NoError(t, err) + return s +} + +func electraSlot(t *testing.T) primitives.Slot { + s, err := slots.EpochStart(params.BeaconConfig().ElectraForkEpoch) + require.NoError(t, err) + return s +} + +func testBlindedBlockFixtures(t *testing.T) *blindedBlockFixtures { + pfx := fixturesStruct() + fx := &blindedBlockFixtures{} + full := pfx.ExecutionPayloadDeneb + // this func overrides fixture blockhashes to ensure they are unique + full.BlockHash = bytesutil.PadTo([]byte("full"), 32) + denebBlock, _ := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, denebSlot(t), 0, util.WithPayloadSetter(full)) + fx.denebBlock = blindedBlockWithHeader(t, denebBlock) + + empty := pfx.EmptyExecutionPayloadDeneb + empty.BlockHash = bytesutil.PadTo([]byte("empty"), 32) + empty.BlockNumber = 2 + emptyDenebBlock, _ := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, denebSlot(t)+1, 0, util.WithPayloadSetter(empty)) + fx.emptyDenebBlock = blindedBlockWithHeader(t, emptyDenebBlock) + + afterSkip := fixturesStruct().ExecutionPayloadDeneb + // this func overrides fixture blockhashes to ensure they are unique + afterSkip.BlockHash = bytesutil.PadTo([]byte("afterSkip"), 32) + afterSkip.BlockNumber = 4 + afterSkipBlock, _ := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, denebSlot(t)+3, 0, util.WithPayloadSetter(afterSkip)) + fx.afterSkipDeneb = blindedBlockWithHeader(t, afterSkipBlock) + + electra := fixturesStruct().ExecutionPayloadElectra + electra.BlockHash = bytesutil.PadTo([]byte("electra"), 32) + electra.BlockNumber = 5 + electraBlock, _ := util.GenerateTestElectraBlockWithSidecar(t, [32]byte{}, electraSlot(t), 0, util.WithElectraPayload(electra)) + fx.electra = blindedBlockWithHeader(t, electraBlock) + return fx +} + +func TestPayloadBodiesViaUnblinder(t *testing.T) { + defer util.HackElectraMaxuint(t)() + fx := testBlindedBlockFixtures(t) + t.Run("mix of non-empty and empty", func(t *testing.T) { + cli, srv := newMockEngine(t) + srv.register(GetPayloadBodiesByHashV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{ + payloadToBody(t, fx.denebBlock.blinded.header), + payloadToBody(t, fx.emptyDenebBlock.blinded.header), + } + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + ctx := context.Background() + + toUnblind := []interfaces.ReadOnlySignedBeaconBlock{ + fx.denebBlock.blinded.block, + fx.emptyDenebBlock.blinded.block, + } + bbr, err := newBlindedBlockReconstructor(toUnblind) + require.NoError(t, err) + require.NoError(t, bbr.requestBodies(ctx, cli)) + + payload, err := bbr.payloadForHeader(fx.denebBlock.blinded.header, fx.denebBlock.blinded.block.Version()) + require.NoError(t, err) + unblindFull, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(fx.denebBlock.blinded.block, payload) + require.NoError(t, err) + testAssertReconstructedEquivalent(t, fx.denebBlock.full, unblindFull) + + emptyPayload, err := bbr.payloadForHeader(fx.emptyDenebBlock.blinded.header, fx.emptyDenebBlock.blinded.block.Version()) + require.NoError(t, err) + unblindEmpty, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(fx.emptyDenebBlock.blinded.block, emptyPayload) + require.NoError(t, err) + testAssertReconstructedEquivalent(t, fx.emptyDenebBlock.full, unblindEmpty) + }) +} + +func TestFixtureEquivalence(t *testing.T) { + defer util.HackElectraMaxuint(t)() + fx := testBlindedBlockFixtures(t) + t.Run("full and blinded block equivalence", func(t *testing.T) { + testAssertReconstructedEquivalent(t, fx.denebBlock.blinded.block, fx.denebBlock.full) + testAssertReconstructedEquivalent(t, fx.emptyDenebBlock.blinded.block, fx.emptyDenebBlock.full) + }) +} + +func testAssertReconstructedEquivalent(t *testing.T, b, ogb interfaces.ReadOnlySignedBeaconBlock) { + bHtr, err := b.Block().HashTreeRoot() + require.NoError(t, err) + ogbHtr, err := ogb.Block().HashTreeRoot() + require.NoError(t, err) + require.Equal(t, bHtr, ogbHtr) +} + +func TestComputeRanges(t *testing.T) { + cases := []struct { + name string + hbns []hashBlockNumber + want []byRangeReq + }{ + { + name: "3 contiguous, 1 not", + hbns: []hashBlockNumber{ + {h: [32]byte{5}, n: 5}, + {h: [32]byte{3}, n: 3}, + {h: [32]byte{2}, n: 2}, + {h: [32]byte{1}, n: 1}, + }, + want: []byRangeReq{ + {start: 1, count: 3, hbns: []hashBlockNumber{{h: [32]byte{1}, n: 1}, {h: [32]byte{2}, n: 2}, {h: [32]byte{3}, n: 3}}}, + {start: 5, count: 1, hbns: []hashBlockNumber{{h: [32]byte{5}, n: 5}}}, + }, + }, + { + name: "1 element", + hbns: []hashBlockNumber{ + {h: [32]byte{1}, n: 1}, + }, + want: []byRangeReq{ + {start: 1, count: 1, hbns: []hashBlockNumber{{h: [32]byte{1}, n: 1}}}, + }, + }, + { + name: "2 contiguous", + hbns: []hashBlockNumber{ + {h: [32]byte{2}, n: 2}, + {h: [32]byte{1}, n: 1}, + }, + want: []byRangeReq{ + {start: 1, count: 2, hbns: []hashBlockNumber{{h: [32]byte{1}, n: 1}, {h: [32]byte{2}, n: 2}}}, + }, + }, + { + name: "2 non-contiguous", + hbns: []hashBlockNumber{ + {h: [32]byte{3}, n: 3}, + {h: [32]byte{1}, n: 1}, + }, + want: []byRangeReq{ + {start: 1, count: 1, hbns: []hashBlockNumber{{h: [32]byte{1}, n: 1}}}, + {start: 3, count: 1, hbns: []hashBlockNumber{{h: [32]byte{3}, n: 3}}}, + }, + }, + { + name: "3 contiguous", + hbns: []hashBlockNumber{ + {h: [32]byte{2}, n: 2}, + {h: [32]byte{1}, n: 1}, + {h: [32]byte{3}, n: 3}, + }, + want: []byRangeReq{ + {start: 1, count: 3, hbns: []hashBlockNumber{{h: [32]byte{1}, n: 1}, {h: [32]byte{2}, n: 2}, {h: [32]byte{3}, n: 3}}}, + }, + }, + { + name: "3 non-contiguous", + hbns: []hashBlockNumber{ + {h: [32]byte{5}, n: 5}, + {h: [32]byte{3}, n: 3}, + {h: [32]byte{1}, n: 1}, + }, + want: []byRangeReq{ + {start: 1, count: 1, hbns: []hashBlockNumber{{h: [32]byte{1}, n: 1}}}, + {start: 3, count: 1, hbns: []hashBlockNumber{{h: [32]byte{3}, n: 3}}}, + {start: 5, count: 1, hbns: []hashBlockNumber{{h: [32]byte{5}, n: 5}}}, + }, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + got := computeRanges(c.hbns) + for i := range got { + require.Equal(t, c.want[i].start, got[i].start) + require.Equal(t, c.want[i].count, got[i].count) + require.DeepEqual(t, c.want[i].hbns, got[i].hbns) + } + }) + } +} + +func TestReconstructBlindedBlockBatchFallbackToRange(t *testing.T) { + defer util.HackElectraMaxuint(t)() + ctx := context.Background() + t.Run("fallback fails", func(t *testing.T) { + cli, srv := newMockEngine(t) + fx := testBlindedBlockFixtures(t) + srv.register(GetPayloadBodiesByHashV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{nil, nil} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + srv.register(GetPayloadBodiesByRangeV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{nil, nil} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + toUnblind := []interfaces.ReadOnlySignedBeaconBlock{ + fx.denebBlock.blinded.block, + fx.emptyDenebBlock.blinded.block, + } + _, err := reconstructBlindedBlockBatch(ctx, cli, toUnblind) + require.ErrorIs(t, err, errNilPayloadBody) + require.Equal(t, 1, srv.callCount(GetPayloadBodiesByHashV1)) + require.Equal(t, 1, srv.callCount(GetPayloadBodiesByRangeV1)) + }) + t.Run("fallback succeeds", func(t *testing.T) { + cli, srv := newMockEngine(t) + fx := testBlindedBlockFixtures(t) + srv.register(GetPayloadBodiesByHashV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{nil, nil} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + srv.register(GetPayloadBodiesByRangeV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{ + payloadToBody(t, fx.denebBlock.blinded.header), + payloadToBody(t, fx.emptyDenebBlock.blinded.header), + } + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + unblind := []interfaces.ReadOnlySignedBeaconBlock{ + fx.denebBlock.blinded.block, + fx.emptyDenebBlock.blinded.block, + } + _, err := reconstructBlindedBlockBatch(ctx, cli, unblind) + require.NoError(t, err) + }) + t.Run("separated by block number gap", func(t *testing.T) { + cli, srv := newMockEngine(t) + fx := testBlindedBlockFixtures(t) + srv.register(GetPayloadBodiesByHashV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{nil, nil, nil} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + srv.register(GetPayloadBodiesByRangeV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + p := mockParseUintList(t, msg.Params) + require.Equal(t, 2, len(p)) + start, count := p[0], p[1] + // Return first 2 blocks by number, which are contiguous. + if start == fx.denebBlock.blinded.header.BlockNumber() { + require.Equal(t, uint64(2), count) + executionPayloadBodies := []*pb.ExecutionPayloadBody{ + payloadToBody(t, fx.denebBlock.blinded.header), + payloadToBody(t, fx.emptyDenebBlock.blinded.header), + } + mockWriteResult(t, w, msg, executionPayloadBodies) + return + } + // Assume it's the second request + require.Equal(t, fx.afterSkipDeneb.blinded.header.BlockNumber(), start) + require.Equal(t, uint64(1), count) + executionPayloadBodies := []*pb.ExecutionPayloadBody{ + payloadToBody(t, fx.afterSkipDeneb.blinded.header), + } + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + // separate methods for the electra block + srv.register(GetPayloadBodiesByHashV2, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{nil} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + srv.register(GetPayloadBodiesByRangeV2, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + p := mockParseUintList(t, msg.Params) + require.Equal(t, 2, len(p)) + start, count := p[0], p[1] + require.Equal(t, fx.electra.blinded.header.BlockNumber(), start) + require.Equal(t, uint64(1), count) + executionPayloadBodies := []*pb.ExecutionPayloadBody{ + payloadToBody(t, fx.electra.blinded.header), + } + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + blind := []interfaces.ReadOnlySignedBeaconBlock{ + fx.denebBlock.blinded.block, + fx.emptyDenebBlock.blinded.block, + fx.afterSkipDeneb.blinded.block, + } + unblind, err := reconstructBlindedBlockBatch(ctx, cli, blind) + require.NoError(t, err) + for i := range unblind { + testAssertReconstructedEquivalent(t, blind[i], unblind[i]) + } + }) +} + +func TestReconstructBlindedBlockBatchDenebAndElectra(t *testing.T) { + defer util.HackElectraMaxuint(t)() + t.Run("deneb and electra", func(t *testing.T) { + cli, srv := newMockEngine(t) + fx := testBlindedBlockFixtures(t) + // The reconstructed should make separate calls for the deneb (v1) and electra (v2) blocks. + srv.register(GetPayloadBodiesByHashV1, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{payloadToBody(t, fx.denebBlock.blinded.header)} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + srv.register(GetPayloadBodiesByHashV2, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + executionPayloadBodies := []*pb.ExecutionPayloadBody{payloadToBody(t, fx.electra.blinded.header)} + mockWriteResult(t, w, msg, executionPayloadBodies) + }) + blinded := []interfaces.ReadOnlySignedBeaconBlock{ + fx.denebBlock.blinded.block, + fx.electra.blinded.block, + } + unblinded, err := reconstructBlindedBlockBatch(context.Background(), cli, blinded) + require.NoError(t, err) + require.Equal(t, len(blinded), len(unblinded)) + for i := range unblinded { + testAssertReconstructedEquivalent(t, blinded[i], unblinded[i]) + } + }) +} diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index 2464d30de932..3bf7788d62e5 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -78,7 +78,7 @@ func (x PayloadStatus_Status) Number() protoreflect.EnumNumber { // Deprecated: Use PayloadStatus_Status.Descriptor instead. func (PayloadStatus_Status) EnumDescriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15, 0} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14, 0} } type ExecutionPayload struct { @@ -232,61 +232,6 @@ func (x *ExecutionPayload) GetTransactions() [][]byte { return nil } -type ExecutionPayloadBodyV1 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` - Withdrawals []*Withdrawal `protobuf:"bytes,2,rep,name=withdrawals,proto3" json:"withdrawals,omitempty"` -} - -func (x *ExecutionPayloadBodyV1) Reset() { - *x = ExecutionPayloadBodyV1{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecutionPayloadBodyV1) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecutionPayloadBodyV1) ProtoMessage() {} - -func (x *ExecutionPayloadBodyV1) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecutionPayloadBodyV1.ProtoReflect.Descriptor instead. -func (*ExecutionPayloadBodyV1) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{1} -} - -func (x *ExecutionPayloadBodyV1) GetTransactions() [][]byte { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *ExecutionPayloadBodyV1) GetWithdrawals() []*Withdrawal { - if x != nil { - return x.Withdrawals - } - return nil -} - type ExecutionPayloadCapella struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -312,7 +257,7 @@ type ExecutionPayloadCapella struct { func (x *ExecutionPayloadCapella) Reset() { *x = ExecutionPayloadCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -325,7 +270,7 @@ func (x *ExecutionPayloadCapella) String() string { func (*ExecutionPayloadCapella) ProtoMessage() {} func (x *ExecutionPayloadCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -338,7 +283,7 @@ func (x *ExecutionPayloadCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadCapella.ProtoReflect.Descriptor instead. func (*ExecutionPayloadCapella) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{2} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{1} } func (x *ExecutionPayloadCapella) GetParentHash() []byte { @@ -473,7 +418,7 @@ type ExecutionPayloadDeneb struct { func (x *ExecutionPayloadDeneb) Reset() { *x = ExecutionPayloadDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -486,7 +431,7 @@ func (x *ExecutionPayloadDeneb) String() string { func (*ExecutionPayloadDeneb) ProtoMessage() {} func (x *ExecutionPayloadDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -499,7 +444,7 @@ func (x *ExecutionPayloadDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadDeneb.ProtoReflect.Descriptor instead. func (*ExecutionPayloadDeneb) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{2} } func (x *ExecutionPayloadDeneb) GetParentHash() []byte { @@ -650,7 +595,7 @@ type ExecutionPayloadElectra struct { func (x *ExecutionPayloadElectra) Reset() { *x = ExecutionPayloadElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -663,7 +608,7 @@ func (x *ExecutionPayloadElectra) String() string { func (*ExecutionPayloadElectra) ProtoMessage() {} func (x *ExecutionPayloadElectra) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -676,7 +621,7 @@ func (x *ExecutionPayloadElectra) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadElectra.ProtoReflect.Descriptor instead. func (*ExecutionPayloadElectra) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3} } func (x *ExecutionPayloadElectra) GetParentHash() []byte { @@ -826,7 +771,7 @@ type ExecutionPayloadElectraWithValueAndBlobsBundle struct { func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) Reset() { *x = ExecutionPayloadElectraWithValueAndBlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -839,7 +784,7 @@ func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) String() string { func (*ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoMessage() {} func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -852,7 +797,7 @@ func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoReflect() protoref // Deprecated: Use ExecutionPayloadElectraWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. func (*ExecutionPayloadElectraWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} } func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadElectra { @@ -895,7 +840,7 @@ type ExecutionPayloadCapellaWithValue struct { func (x *ExecutionPayloadCapellaWithValue) Reset() { *x = ExecutionPayloadCapellaWithValue{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -908,7 +853,7 @@ func (x *ExecutionPayloadCapellaWithValue) String() string { func (*ExecutionPayloadCapellaWithValue) ProtoMessage() {} func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -921,7 +866,7 @@ func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadCapellaWithValue.ProtoReflect.Descriptor instead. func (*ExecutionPayloadCapellaWithValue) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} } func (x *ExecutionPayloadCapellaWithValue) GetPayload() *ExecutionPayloadCapella { @@ -952,7 +897,7 @@ type ExecutionPayloadDenebWithValueAndBlobsBundle struct { func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) Reset() { *x = ExecutionPayloadDenebWithValueAndBlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -965,7 +910,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) String() string { func (*ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoMessage() {} func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -978,7 +923,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protorefle // Deprecated: Use ExecutionPayloadDenebWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. func (*ExecutionPayloadDenebWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} } func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadDeneb { @@ -1033,7 +978,7 @@ type ExecutionPayloadHeader struct { func (x *ExecutionPayloadHeader) Reset() { *x = ExecutionPayloadHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1046,7 +991,7 @@ func (x *ExecutionPayloadHeader) String() string { func (*ExecutionPayloadHeader) ProtoMessage() {} func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1059,7 +1004,7 @@ func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeader.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeader) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} } func (x *ExecutionPayloadHeader) GetParentHash() []byte { @@ -1185,7 +1130,7 @@ type ExecutionPayloadHeaderCapella struct { func (x *ExecutionPayloadHeaderCapella) Reset() { *x = ExecutionPayloadHeaderCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1198,7 +1143,7 @@ func (x *ExecutionPayloadHeaderCapella) String() string { func (*ExecutionPayloadHeaderCapella) ProtoMessage() {} func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1211,7 +1156,7 @@ func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderCapella.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderCapella) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} } func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte { @@ -1346,7 +1291,7 @@ type ExecutionPayloadHeaderDeneb struct { func (x *ExecutionPayloadHeaderDeneb) Reset() { *x = ExecutionPayloadHeaderDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1359,7 +1304,7 @@ func (x *ExecutionPayloadHeaderDeneb) String() string { func (*ExecutionPayloadHeaderDeneb) ProtoMessage() {} func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1372,7 +1317,7 @@ func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderDeneb.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderDeneb) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} } func (x *ExecutionPayloadHeaderDeneb) GetParentHash() []byte { @@ -1523,7 +1468,7 @@ type ExecutionPayloadHeaderElectra struct { func (x *ExecutionPayloadHeaderElectra) Reset() { *x = ExecutionPayloadHeaderElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1536,7 +1481,7 @@ func (x *ExecutionPayloadHeaderElectra) String() string { func (*ExecutionPayloadHeaderElectra) ProtoMessage() {} func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1549,7 +1494,7 @@ func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderElectra.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderElectra) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} } func (x *ExecutionPayloadHeaderElectra) GetParentHash() []byte { @@ -1698,7 +1643,7 @@ type PayloadAttributes struct { func (x *PayloadAttributes) Reset() { *x = PayloadAttributes{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1711,7 +1656,7 @@ func (x *PayloadAttributes) String() string { func (*PayloadAttributes) ProtoMessage() {} func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1724,7 +1669,7 @@ func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead. func (*PayloadAttributes) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} } func (x *PayloadAttributes) GetTimestamp() uint64 { @@ -1762,7 +1707,7 @@ type PayloadAttributesV2 struct { func (x *PayloadAttributesV2) Reset() { *x = PayloadAttributesV2{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1775,7 +1720,7 @@ func (x *PayloadAttributesV2) String() string { func (*PayloadAttributesV2) ProtoMessage() {} func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1788,7 +1733,7 @@ func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV2.ProtoReflect.Descriptor instead. func (*PayloadAttributesV2) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} } func (x *PayloadAttributesV2) GetTimestamp() uint64 { @@ -1834,7 +1779,7 @@ type PayloadAttributesV3 struct { func (x *PayloadAttributesV3) Reset() { *x = PayloadAttributesV3{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1847,7 +1792,7 @@ func (x *PayloadAttributesV3) String() string { func (*PayloadAttributesV3) ProtoMessage() {} func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1860,7 +1805,7 @@ func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV3.ProtoReflect.Descriptor instead. func (*PayloadAttributesV3) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} } func (x *PayloadAttributesV3) GetTimestamp() uint64 { @@ -1911,7 +1856,7 @@ type PayloadStatus struct { func (x *PayloadStatus) Reset() { *x = PayloadStatus{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1924,7 +1869,7 @@ func (x *PayloadStatus) String() string { func (*PayloadStatus) ProtoMessage() {} func (x *PayloadStatus) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1937,7 +1882,7 @@ func (x *PayloadStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadStatus.ProtoReflect.Descriptor instead. func (*PayloadStatus) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} } func (x *PayloadStatus) GetStatus() PayloadStatus_Status { @@ -1974,7 +1919,7 @@ type ForkchoiceState struct { func (x *ForkchoiceState) Reset() { *x = ForkchoiceState{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1987,7 +1932,7 @@ func (x *ForkchoiceState) String() string { func (*ForkchoiceState) ProtoMessage() {} func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2000,7 +1945,7 @@ func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkchoiceState.ProtoReflect.Descriptor instead. func (*ForkchoiceState) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} } func (x *ForkchoiceState) GetHeadBlockHash() []byte { @@ -2038,7 +1983,7 @@ type Withdrawal struct { func (x *Withdrawal) Reset() { *x = Withdrawal{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2051,7 +1996,7 @@ func (x *Withdrawal) String() string { func (*Withdrawal) ProtoMessage() {} func (x *Withdrawal) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2064,7 +2009,7 @@ func (x *Withdrawal) ProtoReflect() protoreflect.Message { // Deprecated: Use Withdrawal.ProtoReflect.Descriptor instead. func (*Withdrawal) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} } func (x *Withdrawal) GetIndex() uint64 { @@ -2108,7 +2053,7 @@ type BlobsBundle struct { func (x *BlobsBundle) Reset() { *x = BlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2121,7 +2066,7 @@ func (x *BlobsBundle) String() string { func (*BlobsBundle) ProtoMessage() {} func (x *BlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2134,7 +2079,7 @@ func (x *BlobsBundle) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobsBundle.ProtoReflect.Descriptor instead. func (*BlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{18} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} } func (x *BlobsBundle) GetKzgCommitments() [][]byte { @@ -2169,7 +2114,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2182,7 +2127,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2195,7 +2140,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message { // Deprecated: Use Blob.ProtoReflect.Descriptor instead. func (*Blob) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{19} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{18} } func (x *Blob) GetData() []byte { @@ -2216,7 +2161,7 @@ type ExchangeCapabilities struct { func (x *ExchangeCapabilities) Reset() { *x = ExchangeCapabilities{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2229,7 +2174,7 @@ func (x *ExchangeCapabilities) String() string { func (*ExchangeCapabilities) ProtoMessage() {} func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2242,7 +2187,7 @@ func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeCapabilities.ProtoReflect.Descriptor instead. func (*ExchangeCapabilities) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{19} } func (x *ExchangeCapabilities) GetSupportedMethods() []string { @@ -2265,7 +2210,7 @@ type ExecutionLayerWithdrawalRequest struct { func (x *ExecutionLayerWithdrawalRequest) Reset() { *x = ExecutionLayerWithdrawalRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2278,7 +2223,7 @@ func (x *ExecutionLayerWithdrawalRequest) String() string { func (*ExecutionLayerWithdrawalRequest) ProtoMessage() {} func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2291,7 +2236,7 @@ func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionLayerWithdrawalRequest.ProtoReflect.Descriptor instead. func (*ExecutionLayerWithdrawalRequest) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} } func (x *ExecutionLayerWithdrawalRequest) GetSourceAddress() []byte { @@ -2330,7 +2275,7 @@ type DepositReceipt struct { func (x *DepositReceipt) Reset() { *x = DepositReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2343,7 +2288,7 @@ func (x *DepositReceipt) String() string { func (*DepositReceipt) ProtoMessage() {} func (x *DepositReceipt) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2356,7 +2301,7 @@ func (x *DepositReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use DepositReceipt.ProtoReflect.Descriptor instead. func (*DepositReceipt) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{22} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} } func (x *DepositReceipt) GetPubkey() []byte { @@ -2439,15 +2384,7 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, 0x03, 0x3f, 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, 0x31, 0x30, 0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7e, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x56, 0x31, 0x12, 0x22, - 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x73, 0x22, 0x99, 0x05, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x99, 0x05, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, @@ -2958,53 +2895,51 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte { } var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload - (*ExecutionPayloadBodyV1)(nil), // 2: ethereum.engine.v1.ExecutionPayloadBodyV1 - (*ExecutionPayloadCapella)(nil), // 3: ethereum.engine.v1.ExecutionPayloadCapella - (*ExecutionPayloadDeneb)(nil), // 4: ethereum.engine.v1.ExecutionPayloadDeneb - (*ExecutionPayloadElectra)(nil), // 5: ethereum.engine.v1.ExecutionPayloadElectra - (*ExecutionPayloadElectraWithValueAndBlobsBundle)(nil), // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle - (*ExecutionPayloadCapellaWithValue)(nil), // 7: ethereum.engine.v1.ExecutionPayloadCapellaWithValue - (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 8: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle - (*ExecutionPayloadHeader)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeader - (*ExecutionPayloadHeaderCapella)(nil), // 10: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*ExecutionPayloadHeaderDeneb)(nil), // 11: ethereum.engine.v1.ExecutionPayloadHeaderDeneb - (*ExecutionPayloadHeaderElectra)(nil), // 12: ethereum.engine.v1.ExecutionPayloadHeaderElectra - (*PayloadAttributes)(nil), // 13: ethereum.engine.v1.PayloadAttributes - (*PayloadAttributesV2)(nil), // 14: ethereum.engine.v1.PayloadAttributesV2 - (*PayloadAttributesV3)(nil), // 15: ethereum.engine.v1.PayloadAttributesV3 - (*PayloadStatus)(nil), // 16: ethereum.engine.v1.PayloadStatus - (*ForkchoiceState)(nil), // 17: ethereum.engine.v1.ForkchoiceState - (*Withdrawal)(nil), // 18: ethereum.engine.v1.Withdrawal - (*BlobsBundle)(nil), // 19: ethereum.engine.v1.BlobsBundle - (*Blob)(nil), // 20: ethereum.engine.v1.Blob - (*ExchangeCapabilities)(nil), // 21: ethereum.engine.v1.ExchangeCapabilities - (*ExecutionLayerWithdrawalRequest)(nil), // 22: ethereum.engine.v1.ExecutionLayerWithdrawalRequest - (*DepositReceipt)(nil), // 23: ethereum.engine.v1.DepositReceipt + (*ExecutionPayloadCapella)(nil), // 2: ethereum.engine.v1.ExecutionPayloadCapella + (*ExecutionPayloadDeneb)(nil), // 3: ethereum.engine.v1.ExecutionPayloadDeneb + (*ExecutionPayloadElectra)(nil), // 4: ethereum.engine.v1.ExecutionPayloadElectra + (*ExecutionPayloadElectraWithValueAndBlobsBundle)(nil), // 5: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle + (*ExecutionPayloadCapellaWithValue)(nil), // 6: ethereum.engine.v1.ExecutionPayloadCapellaWithValue + (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 7: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle + (*ExecutionPayloadHeader)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeader + (*ExecutionPayloadHeaderCapella)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*ExecutionPayloadHeaderDeneb)(nil), // 10: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*ExecutionPayloadHeaderElectra)(nil), // 11: ethereum.engine.v1.ExecutionPayloadHeaderElectra + (*PayloadAttributes)(nil), // 12: ethereum.engine.v1.PayloadAttributes + (*PayloadAttributesV2)(nil), // 13: ethereum.engine.v1.PayloadAttributesV2 + (*PayloadAttributesV3)(nil), // 14: ethereum.engine.v1.PayloadAttributesV3 + (*PayloadStatus)(nil), // 15: ethereum.engine.v1.PayloadStatus + (*ForkchoiceState)(nil), // 16: ethereum.engine.v1.ForkchoiceState + (*Withdrawal)(nil), // 17: ethereum.engine.v1.Withdrawal + (*BlobsBundle)(nil), // 18: ethereum.engine.v1.BlobsBundle + (*Blob)(nil), // 19: ethereum.engine.v1.Blob + (*ExchangeCapabilities)(nil), // 20: ethereum.engine.v1.ExchangeCapabilities + (*ExecutionLayerWithdrawalRequest)(nil), // 21: ethereum.engine.v1.ExecutionLayerWithdrawalRequest + (*DepositReceipt)(nil), // 22: ethereum.engine.v1.DepositReceipt } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ - 18, // 0: ethereum.engine.v1.ExecutionPayloadBodyV1.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 18, // 1: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 18, // 2: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 18, // 3: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 23, // 4: ethereum.engine.v1.ExecutionPayloadElectra.deposit_receipts:type_name -> ethereum.engine.v1.DepositReceipt - 22, // 5: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.ExecutionLayerWithdrawalRequest - 5, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra - 19, // 7: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 3, // 8: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 4, // 9: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 19, // 10: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 18, // 11: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 18, // 12: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 0, // 13: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 17, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 1: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 2: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 22, // 3: ethereum.engine.v1.ExecutionPayloadElectra.deposit_receipts:type_name -> ethereum.engine.v1.DepositReceipt + 21, // 4: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.ExecutionLayerWithdrawalRequest + 4, // 5: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra + 18, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 2, // 7: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella + 3, // 8: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 18, // 9: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 17, // 10: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 11: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 0, // 12: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_proto_engine_v1_execution_engine_proto_init() } @@ -3026,18 +2961,6 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadBodyV1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_execution_engine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadCapella); i { case 0: return &v.state @@ -3049,7 +2972,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadDeneb); i { case 0: return &v.state @@ -3061,7 +2984,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadElectra); i { case 0: return &v.state @@ -3073,7 +2996,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadElectraWithValueAndBlobsBundle); i { case 0: return &v.state @@ -3085,7 +3008,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadCapellaWithValue); i { case 0: return &v.state @@ -3097,7 +3020,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { case 0: return &v.state @@ -3109,7 +3032,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeader); i { case 0: return &v.state @@ -3121,7 +3044,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderCapella); i { case 0: return &v.state @@ -3133,7 +3056,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderDeneb); i { case 0: return &v.state @@ -3145,7 +3068,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderElectra); i { case 0: return &v.state @@ -3157,7 +3080,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadAttributes); i { case 0: return &v.state @@ -3169,7 +3092,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadAttributesV2); i { case 0: return &v.state @@ -3181,7 +3104,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadAttributesV3); i { case 0: return &v.state @@ -3193,7 +3116,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadStatus); i { case 0: return &v.state @@ -3205,7 +3128,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ForkchoiceState); i { case 0: return &v.state @@ -3217,7 +3140,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Withdrawal); i { case 0: return &v.state @@ -3229,7 +3152,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlobsBundle); i { case 0: return &v.state @@ -3241,7 +3164,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Blob); i { case 0: return &v.state @@ -3253,7 +3176,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExchangeCapabilities); i { case 0: return &v.state @@ -3265,7 +3188,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionLayerWithdrawalRequest); i { case 0: return &v.state @@ -3277,7 +3200,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DepositReceipt); i { case 0: return &v.state @@ -3296,7 +3219,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index 6085c05c9b44..a6686a326495 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -41,11 +41,6 @@ message ExecutionPayload { repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"]; } -message ExecutionPayloadBodyV1 { - repeated bytes transactions = 1; - repeated Withdrawal withdrawals = 2; -} - message ExecutionPayloadCapella { bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"]; diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index 9022df00bdf5..05d41cc36251 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 88fdbdfda4571603e11174a57e65c25e06780ff2cbd795c8ae2a4709da24d9a9 +// Hash: 5e73dfd1d7df4fb984d773b9aa92658a1bc4db66b0e050f9b869a470e61416d3 package enginev1 import ( diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index f6c7d78d013b..cbaac71f2be6 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -21,6 +21,8 @@ const ( BlsSignLen = 96 ) +var errJsonNilField = errors.New("nil field in JSON value") + // BlsPubkey represents a 48 byte BLS public key. type BlsPubkey [BlsPubKeyLen]byte @@ -325,6 +327,14 @@ type ExecutionPayloadElectraJSON struct { DepositRequests []DepositRequestV1 `json:"depositRequests"` } +// ExecutionPayloadBody represents the engine API ExecutionPayloadV1 or ExecutionPayloadV2 type. +type ExecutionPayloadBody struct { + Transactions []hexutil.Bytes `json:"transactions"` + Withdrawals []*Withdrawal `json:"withdrawals"` + WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` + DepositRequests []DepositRequestV1 `json:"depositRequests"` +} + // Validate returns an error if key fields in GetPayloadV4ResponseJson are nil or invalid. func (j *GetPayloadV4ResponseJson) Validate() error { if j.ExecutionPayload == nil { @@ -411,6 +421,19 @@ type WithdrawalRequestV1 struct { Amount *hexutil.Uint64 `json:"amount"` } +func (r WithdrawalRequestV1) Validate() error { + if r.SourceAddress == nil { + return errors.Wrap(errJsonNilField, "missing required field 'sourceAddress' for WithdrawalRequestV1") + } + if r.ValidatorPubkey == nil { + return errors.Wrap(errJsonNilField, "missing required field 'validatorPublicKey' for WithdrawalRequestV1") + } + if r.Amount == nil { + return errors.Wrap(errJsonNilField, "missing required field 'amount' for WithdrawalRequestV1") + } + return nil +} + // DepositRequestV1 represents an execution engine DepositRequestV1 value // https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#depositrequestv1 type DepositRequestV1 struct { @@ -426,6 +449,25 @@ type DepositRequestV1 struct { Index *hexutil.Uint64 `json:"index"` } +func (r DepositRequestV1) Validate() error { + if r.PubKey == nil { + return errors.Wrap(errJsonNilField, "missing required field 'pubkey' for DepositRequestV1") + } + if r.WithdrawalCredentials == nil { + return errors.Wrap(errJsonNilField, "missing required field 'withdrawalCredentials' for DepositRequestV1") + } + if r.Amount == nil { + return errors.Wrap(errJsonNilField, "missing required field 'amount' for DepositRequestV1") + } + if r.Signature == nil { + return errors.Wrap(errJsonNilField, "missing required field 'signature' for DepositRequestV1") + } + if r.Index == nil { + return errors.Wrap(errJsonNilField, "missing required field 'index' for DepositRequestV1") + } + return nil +} + // MarshalJSON -- func (e *ExecutionPayload) MarshalJSON() ([]byte, error) { transactions := make([]hexutil.Bytes, len(e.Transactions)) @@ -941,17 +983,20 @@ func (e *ExecutionPayloadElectra) MarshalJSON() ([]byte, error) { Withdrawals: withdrawals, BlobGasUsed: &blobGasUsed, ExcessBlobGas: &excessBlobGas, - WithdrawalRequests: WithdrawalRequestProtoToJson(e.WithdrawalRequests), - DepositRequests: DepositRequestProtoToJson(e.DepositReceipts), + WithdrawalRequests: ProtoWithdrawalRequestsToJson(e.WithdrawalRequests), + DepositRequests: ProtoDepositRequestsToJson(e.DepositReceipts), }) } -func (j *ExecutionPayloadElectraJSON) ElectraDepositReceipts() []*DepositReceipt { - rcpt := make([]*DepositReceipt, len(j.DepositRequests)) +func JsonDepositRequestsToProto(j []DepositRequestV1) ([]*DepositReceipt, error) { + reqs := make([]*DepositReceipt, len(j)) - for i := range j.DepositRequests { - req := j.DepositRequests[i] - rcpt[i] = &DepositReceipt{ + for i := range j { + req := j[i] + if err := req.Validate(); err != nil { + return nil, err + } + reqs[i] = &DepositReceipt{ Pubkey: req.PubKey.Bytes(), WithdrawalCredentials: req.WithdrawalCredentials.Bytes(), Amount: uint64(*req.Amount), @@ -960,10 +1005,10 @@ func (j *ExecutionPayloadElectraJSON) ElectraDepositReceipts() []*DepositReceipt } } - return rcpt + return reqs, nil } -func DepositRequestProtoToJson(reqs []*DepositReceipt) []DepositRequestV1 { +func ProtoDepositRequestsToJson(reqs []*DepositReceipt) []DepositRequestV1 { j := make([]DepositRequestV1, len(reqs)) for i := range reqs { r := reqs[i] @@ -985,11 +1030,14 @@ func DepositRequestProtoToJson(reqs []*DepositReceipt) []DepositRequestV1 { return j } -func (j *ExecutionPayloadElectraJSON) ElectraExecutionLayerWithdrawalRequests() []*ExecutionLayerWithdrawalRequest { - reqs := make([]*ExecutionLayerWithdrawalRequest, len(j.WithdrawalRequests)) +func JsonWithdrawalRequestsToProto(j []WithdrawalRequestV1) ([]*ExecutionLayerWithdrawalRequest, error) { + reqs := make([]*ExecutionLayerWithdrawalRequest, len(j)) - for i := range j.WithdrawalRequests { - req := j.WithdrawalRequests[i] + for i := range j { + req := j[i] + if err := req.Validate(); err != nil { + return nil, err + } reqs[i] = &ExecutionLayerWithdrawalRequest{ SourceAddress: req.SourceAddress.Bytes(), ValidatorPubkey: req.ValidatorPubkey.Bytes(), @@ -997,10 +1045,10 @@ func (j *ExecutionPayloadElectraJSON) ElectraExecutionLayerWithdrawalRequests() } } - return reqs + return reqs, nil } -func WithdrawalRequestProtoToJson(reqs []*ExecutionLayerWithdrawalRequest) []WithdrawalRequestV1 { +func ProtoWithdrawalRequestsToJson(reqs []*ExecutionLayerWithdrawalRequest) []WithdrawalRequestV1 { j := make([]WithdrawalRequestV1, len(reqs)) for i := range reqs { r := reqs[i] @@ -1031,6 +1079,14 @@ func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra if j.Withdrawals == nil { j.Withdrawals = make([]*Withdrawal, 0) } + dr, err := JsonDepositRequestsToProto(j.DepositRequests) + if err != nil { + return nil, err + } + wr, err := JsonWithdrawalRequestsToProto(j.WithdrawalRequests) + if err != nil { + return nil, err + } return &ExecutionPayloadElectra{ ParentHash: j.ParentHash.Bytes(), FeeRecipient: j.FeeRecipient.Bytes(), @@ -1049,8 +1105,8 @@ func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra Withdrawals: j.Withdrawals, BlobGasUsed: uint64(*j.BlobGasUsed), ExcessBlobGas: uint64(*j.ExcessBlobGas), - DepositReceipts: j.ElectraDepositReceipts(), - WithdrawalRequests: j.ElectraExecutionLayerWithdrawalRequests(), + DepositReceipts: dr, + WithdrawalRequests: wr, }, nil } @@ -1232,42 +1288,11 @@ func (e *ExecutionPayloadDenebWithValueAndBlobsBundle) UnmarshalJSON(enc []byte) return nil } -type executionPayloadBodyV1JSON struct { - Transactions []hexutil.Bytes `json:"transactions"` - Withdrawals []*Withdrawal `json:"withdrawals"` -} - -func (b *ExecutionPayloadBodyV1) MarshalJSON() ([]byte, error) { - transactions := make([]hexutil.Bytes, len(b.Transactions)) - for i, tx := range b.Transactions { - transactions[i] = tx - } - if len(b.Withdrawals) == 0 { - b.Withdrawals = make([]*Withdrawal, 0) - } - return json.Marshal(executionPayloadBodyV1JSON{ - Transactions: transactions, - Withdrawals: b.Withdrawals, - }) -} - -func (b *ExecutionPayloadBodyV1) UnmarshalJSON(enc []byte) error { - var decoded *executionPayloadBodyV1JSON - err := json.Unmarshal(enc, &decoded) - if err != nil { - return err +// RecastHexutilByteSlice converts a []hexutil.Bytes to a [][]byte +func RecastHexutilByteSlice(h []hexutil.Bytes) [][]byte { + r := make([][]byte, len(h)) + for i := range h { + r[i] = h[i] } - if len(decoded.Transactions) == 0 { - b.Transactions = make([][]byte, 0) - } - if len(decoded.Withdrawals) == 0 { - b.Withdrawals = make([]*Withdrawal, 0) - } - transactions := make([][]byte, len(decoded.Transactions)) - for i, tx := range decoded.Transactions { - transactions[i] = tx - } - b.Transactions = transactions - b.Withdrawals = decoded.Withdrawals - return nil + return r } diff --git a/proto/engine/v1/json_marshal_unmarshal_test.go b/proto/engine/v1/json_marshal_unmarshal_test.go index b2dfbddc6a66..7aed00f1b7a9 100644 --- a/proto/engine/v1/json_marshal_unmarshal_test.go +++ b/proto/engine/v1/json_marshal_unmarshal_test.go @@ -360,8 +360,8 @@ func TestJsonMarshalUnmarshal(t *testing.T) { }}, BlobGasUsed: &bgu, ExcessBlobGas: &ebg, - WithdrawalRequests: enginev1.WithdrawalRequestProtoToJson(withdrawalReq), - DepositRequests: enginev1.DepositRequestProtoToJson(depositReq), + WithdrawalRequests: enginev1.ProtoWithdrawalRequestsToJson(withdrawalReq), + DepositRequests: enginev1.ProtoDepositRequestsToJson(depositReq), }, } enc, err := json.Marshal(resp) @@ -763,8 +763,8 @@ func TestPayloadIDBytes_MarshalUnmarshalJSON(t *testing.T) { } func TestExecutionPayloadBody_MarshalUnmarshalJSON(t *testing.T) { - pBody := &enginev1.ExecutionPayloadBodyV1{ - Transactions: [][]byte{[]byte("random1"), []byte("random2"), []byte("random3")}, + pBody := &enginev1.ExecutionPayloadBody{ + Transactions: []hexutil.Bytes{[]byte("random1"), []byte("random2"), []byte("random3")}, Withdrawals: []*enginev1.Withdrawal{ { Index: 200, @@ -782,8 +782,8 @@ func TestExecutionPayloadBody_MarshalUnmarshalJSON(t *testing.T) { } enc, err := json.Marshal(pBody) require.NoError(t, err) - res := &enginev1.ExecutionPayloadBodyV1{} - err = res.UnmarshalJSON(enc) + res := &enginev1.ExecutionPayloadBody{} + err = json.Unmarshal(enc, res) require.NoError(t, err) require.DeepEqual(t, pBody, res) } diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index d6f69e0a83a6..9e8cfc3999b7 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6fed60156f1e57926b40b972ee25b48a82b18726a9c64fb0e974e4f638784049 +// Hash: a13be0354388a9ab681c78ee577580c9aebbd6d3d17024084c06c839c5db58ee package v1 import ( diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index 2674eea802fb..b91d3b7aa5d5 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 36d05ceafa355d5aa87123eb218143987a79f5095e2cafbad7760712ad0934a3 +// Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 package eth import ( diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index d95f6eb989f2..9d201ba3218e 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 4e7c07afe12b97ee034415333c33967cab8cf624f3fd43f37562cd6307760ec3 +// Hash: 5d2c5eb257aa9cd0f12fd74f707963c8e7f779fbef26d0031f6ae18e9b1ee124 package eth import ( diff --git a/testing/util/deneb.go b/testing/util/deneb.go index a847fa502322..12a888bf9d11 100644 --- a/testing/util/deneb.go +++ b/testing/util/deneb.go @@ -31,6 +31,7 @@ type denebBlockGenerator struct { sk bls.SecretKey proposer primitives.ValidatorIndex valRoot []byte + payload *enginev1.ExecutionPayloadDeneb } func WithProposerSigning(idx primitives.ValidatorIndex, sk bls.SecretKey, valRoot []byte) DenebBlockGeneratorOption { @@ -42,6 +43,12 @@ func WithProposerSigning(idx primitives.ValidatorIndex, sk bls.SecretKey, valRoo } } +func WithPayloadSetter(p *enginev1.ExecutionPayloadDeneb) DenebBlockGeneratorOption { + return func(g *denebBlockGenerator) { + g.payload = p + } +} + func GenerateTestDenebBlockWithSidecar(t *testing.T, parent [32]byte, slot primitives.Slot, nblobs int, opts ...DenebBlockGeneratorOption) (blocks.ROBlock, []blocks.ROBlob) { g := &denebBlockGenerator{ parent: parent, @@ -51,47 +58,51 @@ func GenerateTestDenebBlockWithSidecar(t *testing.T, parent [32]byte, slot primi for _, o := range opts { o(g) } - stateRoot := bytesutil.PadTo([]byte("stateRoot"), fieldparams.RootLength) - receiptsRoot := bytesutil.PadTo([]byte("receiptsRoot"), fieldparams.RootLength) - logsBloom := bytesutil.PadTo([]byte("logs"), fieldparams.LogsBloomLength) - parentHash := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) - ads := common.HexToAddress("095e7baea6a6c7c4c2dfeb977efac326af552d87") - tx := gethTypes.NewTx(&gethTypes.LegacyTx{ - Nonce: 0, - To: &ads, - Value: big.NewInt(0), - Gas: 0, - GasPrice: big.NewInt(0), - Data: nil, - }) - - txs := []*gethTypes.Transaction{tx} - encodedBinaryTxs := make([][]byte, 1) - var err error - encodedBinaryTxs[0], err = txs[0].MarshalBinary() - require.NoError(t, err) - blockHash := bytesutil.ToBytes32([]byte("foo")) - payload := &enginev1.ExecutionPayloadDeneb{ - ParentHash: parentHash, - FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), - StateRoot: stateRoot, - ReceiptsRoot: receiptsRoot, - LogsBloom: logsBloom, - PrevRandao: blockHash[:], - BlockNumber: 0, - GasLimit: 0, - GasUsed: 0, - Timestamp: 0, - ExtraData: make([]byte, 0), - BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength), - BlockHash: blockHash[:], - Transactions: encodedBinaryTxs, - Withdrawals: make([]*enginev1.Withdrawal, 0), - BlobGasUsed: 0, - ExcessBlobGas: 0, + + if g.payload == nil { + stateRoot := bytesutil.PadTo([]byte("stateRoot"), fieldparams.RootLength) + ads := common.HexToAddress("095e7baea6a6c7c4c2dfeb977efac326af552d87") + tx := gethTypes.NewTx(&gethTypes.LegacyTx{ + Nonce: 0, + To: &ads, + Value: big.NewInt(0), + Gas: 0, + GasPrice: big.NewInt(0), + Data: nil, + }) + + txs := []*gethTypes.Transaction{tx} + encodedBinaryTxs := make([][]byte, 1) + var err error + encodedBinaryTxs[0], err = txs[0].MarshalBinary() + require.NoError(t, err) + blockHash := bytesutil.ToBytes32([]byte("foo")) + logsBloom := bytesutil.PadTo([]byte("logs"), fieldparams.LogsBloomLength) + receiptsRoot := bytesutil.PadTo([]byte("receiptsRoot"), fieldparams.RootLength) + parentHash := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) + g.payload = &enginev1.ExecutionPayloadDeneb{ + ParentHash: parentHash, + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: stateRoot, + ReceiptsRoot: receiptsRoot, + LogsBloom: logsBloom, + PrevRandao: blockHash[:], + BlockNumber: 0, + GasLimit: 0, + GasUsed: 0, + Timestamp: 0, + ExtraData: make([]byte, 0), + BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength), + BlockHash: blockHash[:], + Transactions: encodedBinaryTxs, + Withdrawals: make([]*enginev1.Withdrawal, 0), + BlobGasUsed: 0, + ExcessBlobGas: 0, + } } + block := NewBeaconBlockDeneb() - block.Block.Body.ExecutionPayload = payload + block.Block.Body.ExecutionPayload = g.payload block.Block.Slot = g.slot block.Block.ParentRoot = g.parent[:] block.Block.ProposerIndex = g.proposer diff --git a/testing/util/electra.go b/testing/util/electra.go index 81a127923760..09bcc8b7c70f 100644 --- a/testing/util/electra.go +++ b/testing/util/electra.go @@ -1,11 +1,24 @@ package util import ( + "encoding/binary" "math" + "math/big" "testing" + "github.com/ethereum/go-ethereum/common" + gethTypes "github.com/ethereum/go-ethereum/core/types" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/network/forks" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/time/slots" ) // HackElectraMaxuint is helpful for tests that need to set up cases where the electra fork has passed. @@ -23,3 +36,165 @@ func HackElectraMaxuint(t *testing.T) func() { require.NoError(t, undo()) } } + +type ElectraBlockGeneratorOption func(*electraBlockGenerator) + +type electraBlockGenerator struct { + parent [32]byte + slot primitives.Slot + nblobs int + sign bool + sk bls.SecretKey + proposer primitives.ValidatorIndex + valRoot []byte + payload *enginev1.ExecutionPayloadElectra +} + +func WithElectraProposerSigning(idx primitives.ValidatorIndex, sk bls.SecretKey, valRoot []byte) ElectraBlockGeneratorOption { + return func(g *electraBlockGenerator) { + g.sign = true + g.proposer = idx + g.sk = sk + g.valRoot = valRoot + } +} + +func WithElectraPayload(p *enginev1.ExecutionPayloadElectra) ElectraBlockGeneratorOption { + return func(g *electraBlockGenerator) { + g.payload = p + } +} + +func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot primitives.Slot, nblobs int, opts ...ElectraBlockGeneratorOption) (blocks.ROBlock, []blocks.ROBlob) { + g := &electraBlockGenerator{ + parent: parent, + slot: slot, + nblobs: nblobs, + } + for _, o := range opts { + o(g) + } + + if g.payload == nil { + stateRoot := bytesutil.PadTo([]byte("stateRoot"), fieldparams.RootLength) + ads := common.HexToAddress("095e7baea6a6c7c4c2dfeb977efac326af552d87") + tx := gethTypes.NewTx(&gethTypes.LegacyTx{ + Nonce: 0, + To: &ads, + Value: big.NewInt(0), + Gas: 0, + GasPrice: big.NewInt(0), + Data: nil, + }) + + txs := []*gethTypes.Transaction{tx} + encodedBinaryTxs := make([][]byte, 1) + var err error + encodedBinaryTxs[0], err = txs[0].MarshalBinary() + require.NoError(t, err) + blockHash := bytesutil.ToBytes32([]byte("foo")) + logsBloom := bytesutil.PadTo([]byte("logs"), fieldparams.LogsBloomLength) + receiptsRoot := bytesutil.PadTo([]byte("receiptsRoot"), fieldparams.RootLength) + parentHash := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) + g.payload = &enginev1.ExecutionPayloadElectra{ + ParentHash: parentHash, + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: stateRoot, + ReceiptsRoot: receiptsRoot, + LogsBloom: logsBloom, + PrevRandao: blockHash[:], + BlockNumber: 0, + GasLimit: 0, + GasUsed: 0, + Timestamp: 0, + ExtraData: make([]byte, 0), + BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength), + BlockHash: blockHash[:], + Transactions: encodedBinaryTxs, + Withdrawals: make([]*enginev1.Withdrawal, 0), + BlobGasUsed: 0, + ExcessBlobGas: 0, + DepositReceipts: generateTestDepositRequests(uint64(g.slot), 4), + WithdrawalRequests: generateTestWithdrawalRequests(uint64(g.slot), 4), + } + } + + block := NewBeaconBlockElectra() + block.Block.Body.ExecutionPayload = g.payload + block.Block.Slot = g.slot + block.Block.ParentRoot = g.parent[:] + block.Block.ProposerIndex = g.proposer + commitments := make([][48]byte, g.nblobs) + block.Block.Body.BlobKzgCommitments = make([][]byte, g.nblobs) + for i := range commitments { + binary.LittleEndian.PutUint16(commitments[i][0:16], uint16(i)) + binary.LittleEndian.PutUint16(commitments[i][16:32], uint16(g.slot)) + block.Block.Body.BlobKzgCommitments[i] = commitments[i][:] + } + + body, err := blocks.NewBeaconBlockBody(block.Block.Body) + require.NoError(t, err) + inclusion := make([][][]byte, len(commitments)) + for i := range commitments { + proof, err := blocks.MerkleProofKZGCommitment(body, i) + require.NoError(t, err) + inclusion[i] = proof + } + if g.sign { + epoch := slots.ToEpoch(block.Block.Slot) + schedule := forks.NewOrderedSchedule(params.BeaconConfig()) + version, err := schedule.VersionForEpoch(epoch) + require.NoError(t, err) + fork, err := schedule.ForkFromVersion(version) + require.NoError(t, err) + domain := params.BeaconConfig().DomainBeaconProposer + sig, err := signing.ComputeDomainAndSignWithoutState(fork, epoch, domain, g.valRoot, block.Block, g.sk) + require.NoError(t, err) + block.Signature = sig + } + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + sidecars := make([]blocks.ROBlob, len(commitments)) + sbb, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + sh, err := sbb.Header() + require.NoError(t, err) + for i, c := range block.Block.Body.BlobKzgCommitments { + sidecars[i] = GenerateTestDenebBlobSidecar(t, root, sh, i, c, inclusion[i]) + } + + rob, err := blocks.NewROBlock(sbb) + require.NoError(t, err) + return rob, sidecars +} + +func generateTestDepositRequests(offset, n uint64) []*enginev1.DepositReceipt { + r := make([]*enginev1.DepositReceipt, n) + var i uint64 + for i = 0; i < n; i++ { + r[i] = &enginev1.DepositReceipt{ + Pubkey: make([]byte, 48), + WithdrawalCredentials: make([]byte, 32), + Amount: offset + i, + Signature: make([]byte, 96), + Index: offset + i + 100, + } + } + return r +} + +func generateTestWithdrawalRequests(offset, n uint64) []*enginev1.ExecutionLayerWithdrawalRequest { + r := make([]*enginev1.ExecutionLayerWithdrawalRequest, n) + var i uint64 + for i = 0; i < n; i++ { + r[i] = &enginev1.ExecutionLayerWithdrawalRequest{ + SourceAddress: make([]byte, 20), + ValidatorPubkey: make([]byte, 48), + Amount: offset + i, + } + } + return r +} From 8a12b78684459989f1c7ccb0f7c666a43e15b394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Sat, 18 May 2024 05:40:13 +0900 Subject: [PATCH 098/325] Remove Beacon API Postman collection (#14014) --- hack/beacon-node-api/README.md | 17 - .../beacon-node-api.postman-collection.json | 1795 ----------------- 2 files changed, 1812 deletions(-) delete mode 100644 hack/beacon-node-api/README.md delete mode 100644 hack/beacon-node-api/beacon-node-api.postman-collection.json diff --git a/hack/beacon-node-api/README.md b/hack/beacon-node-api/README.md deleted file mode 100644 index 4cff2464e0e9..000000000000 --- a/hack/beacon-node-api/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Beacon Node API - -https://ethereum.github.io/beacon-APIs/ - -## Postman - -You can use Postman to test the API. https://www.postman.com/ - -### Postman collection - -In this package you will find the Postman collection for the Beacon Node API. -You can import this collection in your own Postman instance to test the API. - -#### Updating the collection - -The collection will need to be exported and overwritten to update the collection. A PR should be created once the file -is updated. diff --git a/hack/beacon-node-api/beacon-node-api.postman-collection.json b/hack/beacon-node-api/beacon-node-api.postman-collection.json deleted file mode 100644 index 824adf4efc79..000000000000 --- a/hack/beacon-node-api/beacon-node-api.postman-collection.json +++ /dev/null @@ -1,1795 +0,0 @@ -{ - "info": { - "_postman_id": "398a2b9f-13cb-480b-af67-6c6f9d6ba0aa", - "name": "API", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "/beacon/genesis", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"data:\": [\n {\n \"message\": {\n \"aggregator_index\": \"1\",\n \"selection_proof\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"contribution\": {\n \"slot\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"subcommittee_index\": \"1\",\n \"aggregation_bits\": \"0x01000000000000000000000000000000\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/genesis", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "genesis" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/root", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/root", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "root" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/fork", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/fork", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "fork" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/finality_checkpoints", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/finality_checkpoints", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "finality_checkpoints" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/validators", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/validators", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "validators" - ], - "query": [ - { - "key": "id", - "value": null, - "disabled": true - }, - { - "key": "status", - "value": null, - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/validators/{validator_id}", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/validators/{validator_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "validators", - "{validator_id}" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/validator_balances", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/validator_balances", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "validator_balances" - ], - "query": [ - { - "key": "id", - "value": null, - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/committees", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/committees", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "committees" - ], - "query": [ - { - "key": "epoch", - "value": null, - "disabled": true - }, - { - "key": "index", - "value": null, - "disabled": true - }, - { - "key": "slot", - "value": null, - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/beacon/states/{state_id}/sync_committees", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/states/{state_id}/sync_committees", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "states", - "{state_id}", - "sync_committees" - ], - "query": [ - { - "key": "epoch", - "value": null, - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/beacon/headers", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/headers", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "headers" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/headers/{block_id}", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/headers/{block_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "headers", - "{block_id}" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blocks (Phase 0)", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"message\": {\n \"slot\": \"1\",\n \"proposer_index\": \"1\",\n \"parent_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"state_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"body\": {\n \"randao_reveal\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"eth1_data\": {\n \"deposit_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"deposit_count\": \"1\",\n \"block_hash\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"graffiti\": \"string\",\n \"proposer_slashings\": [\n {\n \"signed_header_1\": {\n \"message\": {\n \"slot\": \"1\",\n \"proposer_index\": \"1\",\n \"parent_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"state_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"body_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n },\n \"signed_header_2\": {\n \"message\": {\n \"slot\": \"1\",\n \"proposer_index\": \"1\",\n \"parent_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"state_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"body_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n }\n ],\n \"attester_slashings\": [\n {\n \"attestation_1\": {\n \"attesting_indices\": [\n \"1\"\n ],\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n },\n \"attestation_2\": {\n \"attesting_indices\": [\n \"1\"\n ],\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n }\n }\n ],\n \"attestations\": [\n {\n \"aggregation_bits\": \"0x01\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n }\n ],\n \"deposits\": [\n {\n \"proof\": [\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n ],\n \"data\": {\n \"pubkey\": \"0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a\",\n \"withdrawal_credentials\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"amount\": \"1\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n }\n ],\n \"voluntary_exits\": [\n {\n \"message\": {\n \"epoch\": \"1\",\n \"validator_index\": \"1\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n ]\n }\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/blocks", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "blocks" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blocks (Altair)", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"message\": {\n \"slot\": \"2234176\",\n \"proposer_index\": \"44367\",\n \"parent_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"state_root\": \"0x3aebd5aa1e6a309c61b93bf75c6ec3a2dda2d9ffaa60f5e68db804c66aa2e533\",\n \"body\": {\n \"randao_reveal\": \"0x93487efef796a5d0ec276a7fb3ff3a389ca6a292ba2fb07fd06c54f051864b5fe423eca4eb9be8983a71a09184f75d91106082026ea87c9c67a22a1e2eefdd2a280ac25a4f7c6f2f7c5261f6614ba1d4f28b5ae8378149c1f730e7e1fcdcd94e\",\n \"eth1_data\": {\n \"deposit_root\": \"0x79f12e9aa03710400fc0c2a43392dc7904c6dc868767ca2f2947be51b7328915\",\n \"deposit_count\": \"129299\",\n \"block_hash\": \"0xa9d5bbb8b129562e92d323ed8aee915aa1d590e8e42be0bfda6fc5c88c87696a\"\n },\n \"graffiti\": \"0x677261666669746977616c6c3a34343a32343a23303066666666000000000000\",\n \"proposer_slashings\": [],\n \"attester_slashings\": [],\n \"attestations\": [\n {\n \"aggregation_bits\": \"0x7bfeff7ffbffffdfffdffffefb7fffde03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"3\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa44042aa4af92d9836dfd5829787bb7999e5771e8f00c1e65fc5e53aa8ce13be3c64eae0c857fd2849749d0b2a68d4a3042e727d68653e9ee70e302feff6d52877916e9de5ac2965acbb5d4b9ad65cd1040b8c69c063f7e2e4f833bec31106c3\"\n },\n {\n \"aggregation_bits\": \"0xff9fbdffdfeff7ff7dbbff77fccfb1fb03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"23\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xaf931b01212c174e364d7e2ebbcf27dc1fee77e946c7d77dc1574c51bde5775dba478000daf62e2d435600f0c9e666b50e603d3aaaa61b0ce8a50e7ec3f15e6f386fe8ceae82328cc3616126f8b13cc3657f6d00ef7620534ceeec847d3da016\"\n },\n {\n \"aggregation_bits\": \"0xffefeffffefdf7ffffffffbfef7d2ffd03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"27\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb9b1a191b41e3db7feded9e9e8e448d07e7b7a4d2c2594ec480e654a5b0b57dc898491446489e8d51e87f362a606e0fc0d92e5cc1ec9bb9efb642c17baf2857b1e0dd6bd4eac42536f168289a4aece2f00364021ce8241e7cca729b662cfa8e2\"\n },\n {\n \"aggregation_bits\": \"0xfffbfffdffefdf7ffffafffffbf5efaf03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"8\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa03b0f34a325ae54edcdd33ec4389a4e468d534e2561369954fa00d6945c47b602c12f2ea3d2438b8e78df0bdbb3dfbe1586449edd3ac833e3c0939d2ffb97cbf772683cab6fa8ba09f13bd0d0f5204eaddcc4648e8c122edbd47e336d29df0c\"\n },\n {\n \"aggregation_bits\": \"0xff7fcffffedffffe7dfffffd6fffffd903\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"10\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x978c98d46f9eb89558db1d94d00a4ac86156cbfd53d9597f1062ea306b34a4efb08c9cd657efc35514f305434cc298bb187e24a2574cfce6196c0c3c16cee78f7a0ded8166a604208a99ffc9a66645c6d2928ce27b540465b6d9beb4ee5b5cfe\"\n },\n {\n \"aggregation_bits\": \"0xfffe77ffeeff7fe7ffb7fdfffb5fffff03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"4\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x99086ab2d7b08e0744a00f013b56f73c78c930e5759a399d2db6f1b746c6a92e648d06c406aeccbbb4aa40f1d3ae193a161d1be20c5664b352f3dd0d702cf3f3eae3352b70e78dc5f5eab10daa820be5baa1fac833d8a94881e2b367e1ca29bf\"\n },\n {\n \"aggregation_bits\": \"0xffefbfbffffefbfffff6ff7ebfbfffad03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"13\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa9c204d653d3532ef1cf5f70ccc48bababb6ec87a59afdb882707d5a48e64eea77abbc14ca397b5729e3891661b085a90d1e59a592cbf9df169f56d3519b17b5177c39dc95177d95311a79db5c72066094d64e0e2f563ece3d0b77c5530a86af\"\n },\n {\n \"aggregation_bits\": \"0x7ffbfebffffbffbeffffffbffef56bff03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"20\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb3e0f49f8c7eb6ec9ebc30179ac4e0f8407db126797a356fd64868070c9425ce5e2c582fa39b92dfebdeac21dae9ebab0c53822303d2f2caff8c1b4bab53203e1796bb9bca4135bf4b14ab7337251244270e2de4d33df63fb3d865375cef3862\"\n },\n {\n \"aggregation_bits\": \"0xffdfdfefeffff7fffffdddbb77ffbe5f03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"12\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb793d9bf48899fc0c976da9b1013317341c3fd33da1c61fdfcae8878920e6bfb26711942c5cff562b3dbe8e4d96f8657091bac679de3da0e6868887aeaeade13cd05829848fec7eedcc12de0d0813aa8862c392de08e5d7daab1e4570f9695e3\"\n },\n {\n \"aggregation_bits\": \"0xf3db7efff7fffefffffffef5befeffb702\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"26\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xaea6edb4cd5bce3ba9a428ffe13a21bee8dfffde9cf7686b41dad39848c86c785fc23aca4bc27b0f29d07b783b6b4efe012a2440d8ca2c7e3949ca0181e34d5775f9d84ab405130dd77ad5f8bf5f0e2f44179fb4d146b1573983319adf8af61d\"\n },\n {\n \"aggregation_bits\": \"0xbf6f3f7ffbffffff3dffffecdeffeeef03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"9\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa766696b3904f0ebe6593f461ced7456739ab73e89c0ddbab75a545b8d81eb09e7823f42a9231902a31618239413cbe111acd1e4e30391dc8066ce669610b4754b8a9f2af169a9ba1e53d6bea637d873ae4df8c50ea7d66f589ba41d906b9549\"\n },\n {\n \"aggregation_bits\": \"0xf7ffff1fcf3fff7dffdfffe7bfcd7fff03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"16\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb6dafab655cef28f04f9f673453ecb1a8c480b5988fd37641a82753a337fdae893b14ba2a710c56e16e7ded689cbd23f0c3f336cc56c70c07dcd32d003f0eea9637aea419e23b6ea8b24a7fa2bb892e51df80c0da14b05feb20e81ca7a166383\"\n },\n {\n \"aggregation_bits\": \"0xb7fdbf77dfff67fdbff7df77ff7fefff03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"0\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8e9b25b690f10a6bb6a21c85137f83304a12ac55c18bf7a0484022e9918023cbc6869960686eafe6668053965dd54305167dbf13fb5c5da78cfc873a102d5fd9d340dd00b5084bfd59aa3a9f6dca7c0f32aeff9179933ec5cb6e1673b348a1f0\"\n },\n {\n \"aggregation_bits\": \"0xdf7fefef7ffdbf7fffeebfbff7ffbbcf02\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"25\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8b9279c11adf8530d0d4ce9c07099c2574e5841c915c34a402803832c61af44bcdbb613e43631b62bccde0dc55f9f9d61134fed1579b2dc3e4d1fb9183b2020f0022a5219de8b446e2cc1844655f4bf6bc415d488a767856131818ad1b123f8b\"\n },\n {\n \"aggregation_bits\": \"0xf1ff3ff7deffeff7efbdfffdff7fef7d03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"19\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x809ea2dc9ef6a5f57285f1b7c35dee8bcb6796e1f8720b6ca589b5fa8b387d7ee3ac6ffbe558d191b4b367c74dddf6dd0a8f0ffdf2abb67067ecbb3c73ce7bd01ad1a421ea0473908206cebb314b4fc23d25db96a9a87e3fae5468d6cc183cd2\"\n },\n {\n \"aggregation_bits\": \"0x7bffefffffbfefefb99bfdf5efffbefd03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"21\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x99b0bc6d72b0e0e9c82dc6c43c542b2de2b0b3907dc3c7e17bc6f007db4728701c6778026c58c708a82a9445e9a49d6716262a56534d36342b272c1fc5b59ff2485f9fa46ef127733564e486ca2614ba55c0ba3fa76674b9a6add76b48a4c876\"\n },\n {\n \"aggregation_bits\": \"0xf7ff7ff37dfffff1ffcdefbfffdf77af03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"18\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xac92cf2f15bd9374e3356f0eb930a725b27b63898af7ea177516527feab6f6dc1077117bc7f0c60c148eea4d1ab5684a1317319b29ebf126a3db5f2daa84de2f8f3b1f3908254cc32d8938e322033d9e00cf489cb1b3d042f7459e362ea54755\"\n },\n {\n \"aggregation_bits\": \"0xff58bbefffcbffbffdf7fffdfff6effd03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"2\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8f6fbd4882a9f2f662e95080817852f04a5c017974409a50dc27c7e75958378139c57cc92129354681f4ba1ecbff20a40220fd3d66a11b0e385636a1c55cba16897673705719b3f1ed224a3218789ddb80cf0051fca9482e6f81242d25459eef\"\n },\n {\n \"aggregation_bits\": \"0xfff77fff799e767f7ff9ffbfffef6fff03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"28\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x94c5f322be8b860b73a11124e0be46a913bfae9ab266a8270d9549102df67b0c56161145f73aa4e0c6a65458f8a736aa050d8455ba4b3fa0bd55d4518042ccc1750955b82d2066a7ef7bd13707f1dc708755db490a53031b00c330dc15d03445\"\n },\n {\n \"aggregation_bits\": \"0xff7ffec75fbfbfffffd9efdffbfb3ebf03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"14\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa4cc56b14fd554512996895f185980e73cdf9ac9c1146996e29b2b1a0966e369c1232887e0324db84dcdeb34f679d7640545543bd2d50732b80be0d99d785bcbced28b2a97602cd738105bb90b0d88946972053a5c7f1f51213c75c783d459c3\"\n },\n {\n \"aggregation_bits\": \"0xfffebbfb7fa6bdf3ffffcb3ffffffddf03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"15\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x88b595627ce163a3b8d1dfc52dd3f805e502be6f4fa0ff5fd5707ebf2e6aaf3e05e539eb391219ec803b825221a7e7550d4a47f32dada5937c1f7544d51c79c075f7b9575fbd201497523045b82017f3bd615cb78343ded17a655f0dfe736e9e\"\n },\n {\n \"aggregation_bits\": \"0x7ee7f17fdeffffbf2ff6bffffe7fdfff03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"17\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x965088b03ad44a871be5cd881a88b9e580547f4db00e411c16bf3009ee8a4a50080afc2867d2eb921d0e10b50c3e6a910779d1e1d6d0ebd7ff914f0cb3a85d28fad68ddae1db6efb1811587d680453e015e626902bdc7eda4227d44635b7635b\"\n },\n {\n \"aggregation_bits\": \"0xfdffeffdfdf77e7fc75ffff5ffdfbddd03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x87b6ccc862bfe1d0c398f3dce7f50abc81bc9f68bae7dba4115c3082729dd58d60c872453337255fac4ffc752e8226b1076169e105ec094113414de8b49b5337e3ee6e5c27cbdbb6af5303049fafa1f2fed361435a1571c1b5efc1161b48ecee\"\n },\n {\n \"aggregation_bits\": \"0x5effefffef7f7ffef5fd6dfff7e6ffb603\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"7\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa1d7a8930c5eda36bd9084c523ab5d1133dd5d8684ad6a33704368b18d1b7463dddd082603535ec3f5773fe82d30a28101f75a0bcdf771a8c9408d22736f83e4fc0b8d5058cd9789eca4c844c7b9f24fd949231817187c10b92a332df1875b32\"\n },\n {\n \"aggregation_bits\": \"0x7fffff59fffb4f7fff3e79b3fffffeef02\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"5\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa5138829c94acc66e65f308d1379a1357785a2cabfabb36937f8c333c76af31bd4211c22e90ee3c3cddc50d6d998ac290c8758c1cfa558e0b21b32339df7405a77f42b730e394696501eab3563da5833d3e0d6a3885edc01f9888a540c56fae7\"\n },\n {\n \"aggregation_bits\": \"0xfff4d1fe5ffeff7ceffff7ff74dfffdd03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"24\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8940827222f77edc46a334f19d9f771b2b5666e48454f32de5b9f2671f19225aa087bb04511f6df2d8bfa6043cbfbab602e2657e0446db136a2705efd7752c5cc89529546e7918b6cad2f546bb6e53651afe9b50c4f487c9a6d7ba785f51e829\"\n },\n {\n \"aggregation_bits\": \"0x3ff5dffb7ffb6dff7fbff7fffb9d2f3f03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"11\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x819d0442765245f7a7823baa7c2e8eb59ce23cb72f3912df9ba3b1a71d0c851d057cfbb7ccdf8af4acdd1bb234ef394d0aa91b54ba83f31f9f1f90238a0b87fa439b70b58e93e22830df90ea82347bf3388ef3cffbbd1a61402aaacbbae80de9\"\n },\n {\n \"aggregation_bits\": \"0xf537ff7ff97ffffb7d7fff7fffaf3aea03\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"22\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xac2660de0f2b0c63d2f7f3f9ce92134341e618d79303c6c67792ab8f05a1f0ce662575080567356a13c5830e0198c2d205d8fb3eeab14d3e337f0da11b818e7c31387da1d3b79b241ce7fb05b616eeb68120ef7ab430c86ae7c59fc35fcb0b78\"\n },\n {\n \"aggregation_bits\": \"0xdfdf7bfbffdeed5ff7dfffdf5d7ff3fa02\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"6\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8be7a6be0d27e65461ddf335c397481075159b840c2a078edfeca186128d65792d80767597219a476c300fd2ce9b09a110eba93ddf2dceb8bd366a2542025e215a954dac49ca0db91735b66fc0c877e64be64a7a15a7f524b7b790c22b92998f\"\n },\n {\n \"aggregation_bits\": \"0xa3938fecedf7fbeef4bddc8a26ad2e4f02\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"12\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa6e97f50a436fe596c0e4fc41340188996b42808b65504f9c7e24c620b11c20551f70b7ecf2080f4d21b99ea74e0a41a17ea380f99c93435371ad70812646a181bd35f957d85a6fd030580af398a47b9dfe5935b9a34672291e2aab77a696b10\"\n },\n {\n \"aggregation_bits\": \"0x41020041c0002803800280510300101402\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"22\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xab39dbf89e169ab4b9b89be76a8f0829407a7af3f2080a104e1ca6fca8d841988a5d5111ba9fb4d2e6a9c6814c466b081967856c26d700845d9ac69851f96c93c812de1524b6ef36d2382d266cefcf32c472ee57ff78f1ba8bbc484e9a37e44e\"\n },\n {\n \"aggregation_bits\": \"0x4100000040400802800080010200100402\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"22\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x96cca9f882d04a3cfcba9a01a966036fcfab679a05f6a4a6342e73220a62f9537c4d1a965cca891ef9500d6793cd6ff205940d6d3b7e9211f5bb6b42f30d6ec21918a6f0395f10cc2caf82ede37ea6102e19f485a1e343d437c6fd3e1fccf323\"\n },\n {\n \"aggregation_bits\": \"0x2010000810000000000008800040000402\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"4\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa56463c667a08e3c6ff0190555fdee82158941d5e2b0c02821183b2ff2d4896494f8792e0dad8d20308a4821ad66df42003fba0be42b3b8f4047b61b8608e0d8c9aaf93ee92a88ae20b512d6af9286893fe97ae204bb327c0677dbab53fe6944\"\n },\n {\n \"aggregation_bits\": \"0x0800000001001008000000000020000102\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"11\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x982e41ae3573667b21332ebeeabf0ddd5111c8268daf20678d7971950dc56fb3dce054eae40dc23e6989bc25ce2a911e17114d12428bcac5e9b6f0ce8d0010d4b0da7ad99dbc7b238bc298d5bac47bccd6abf2fb06d1cef68b870af7ddb52f92\"\n },\n {\n \"aggregation_bits\": \"0x0000000022000004000000100000080002\",\n \"data\": {\n \"slot\": \"2234175\",\n \"index\": \"23\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x904e267663ddb6a660e5d8cc5d9620fee2353ee8a99a39b48a3fcf61405b2c3ea5c3f3ad3818b15cb56e23552881e31606d817ae5ffcef53ecd5a8af7176d8d57ef031a73a693e258d1ffce97eba6bafb093d9a5ea5913077a4c221d269125f5\"\n },\n {\n \"aggregation_bits\": \"0xffefefbfdffff67bffffffeff3fffffd03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"10\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa9a3596270858af12ae13089a2e93999baf18d4392b8acc926a8813e936b1e0fa0c6a6c37c1fc3ed98291c8a5b15d3ea02c1de3e1a14993b2fe7547f7ba18bb247bf099d92b41192389c70ab3fd65a95004687a2ac897af25b6fd3d566383711\"\n },\n {\n \"aggregation_bits\": \"0x7ff3bfdfeffbbdf7967cb5fb3ffbff9f03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"11\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa3d18879c4415affe2c45f8fb4e96412a8dcc085c107ca10f87a2a8e8a58777b688d54d1be265f450e1b0dc35936447c17b41305d9de5625e48777728713427447133dec05a07482ce0d27cd40a3250d3c0396c20e5966be43f628cc704c2d02\"\n },\n {\n \"aggregation_bits\": \"0xff76ffffeffdfffbbff5ffffddfeefdf03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb99d28c29bd2be96fc931c21895123549c90a916cb11fde2db46654cc039bedabd3bfac46ad3137938059ef5098b8094190a461affd5ff77d0106d8243747dcc0d527585178320ea02cd62ff0340105d337846393ee7980f0445af04cf4d5615\"\n },\n {\n \"aggregation_bits\": \"0x7fedff7fffffbfaffefdffffedfffef603\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"15\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa34ffcde8175ca966d1aab3ff3917bedc99c13d1d245daf3ccc50921afd6d5d90e407d51eb6ee5db8004605c7571f15219dd67812a82dbeac78da9159021c6a1945ccc53cd0a6261fa29dec7b16bd72b321d59b3cdf97c5276aa3f193540b51e\"\n },\n {\n \"aggregation_bits\": \"0x7efffffffffeffffebeffffa7d7fff9b03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"18\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa3b6834d6483815aa79dabe3407f1e89bcf234b80785f2bbcdac7057cf391f2d38bed46cdf3b15f2c821eeeafef05260038b547c6e08de40e97f18fe7141ec9d9517d6d6af16c949e8990592b2fef4e1df0d65097e56c1a83412d2cd8116d56e\"\n },\n {\n \"aggregation_bits\": \"0xdeffeff5efff77ff7ffefeffffffb6fe03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"5\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x947af8d4392fc1dbcb4b3deab829b9cb072001d7eaa97f5c7ea244b7eb7d74a9fbcacb7e536e0888618620e076af3cc10d09f5b10fb4a88a549276b02634a9746136ab303f99982bd2595150b78b7e8de2c534ed01ef5f088072b6ae837b35b1\"\n },\n {\n \"aggregation_bits\": \"0xfdaffffa7fff7fbdfffffefefef7deff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"14\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x92c9592a54ad50686fc65638deba628dd7c9612fca1276181562248a6c61dfce5f239e088252b585a2b5ef379738e3550cceb61bbbb9a7c569a16fd04d31c5285ee13a4982c6e417f515a1b670c4ee4e07d53dc09d769f439be3c5dab8cf3149\"\n },\n {\n \"aggregation_bits\": \"0xfdb74f77fffffeffff7ff7ff66ffbfff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"16\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x88ff8c02f1725ba6b56e5891824f84dc7b2979597e745986241b3d936949994c9ed559d537e4a95d8389ffe2842cbb780ae58850f32ee161a36d0960e5e6bb0e790d50388e7768aa0ec3267fc38fb5e3b7c874fad672b2e7e484dfde465749a1\"\n },\n {\n \"aggregation_bits\": \"0xfbff7de7efffee7fffdfbd5dfbfffdff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"26\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x82a17f682327b0e32466d9313922138ab16de2c9dc0be24803251adc6d9ccf54830d79c58eab34312f9c9a27c7d25754051bcc44a186e626768521a47a29deddab715fd377f4274b4b650fa16e01a78fe8221bfc8f16c57c0a2045abd807a1ed\"\n },\n {\n \"aggregation_bits\": \"0xbdfbffffbfffbe7fff76fadff3fedfff02\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"20\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x89de00fd95b37d1a0f091d9a974ca27a9542359eb93b8195e270e0dcf949a7db6acf1b6d115c86790aaef8be0ed5119e19500d37ad35f2b52e144764f02d36b30b84142c69c1379795ebff7ca51276cb53c608e02ec0c5e879bbcab28b36002c\"\n },\n {\n \"aggregation_bits\": \"0xdff7ff77fdffffe7fa67ed7ffffbbdff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"4\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x84c060290fd05a8f33f03e9f62226fafc8c22883f6366b939f5918f83232d1bdf8d15451c4a2dede20556c5f06fcd88f081b6ff2eefd8da37ca6052246c69c2af7c2e70df318b9e3160edfc6603f650e178e200d015082590134e704573675f6\"\n },\n {\n \"aggregation_bits\": \"0xefefffbfffd7bdfffddfe7dcbeffafff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"6\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xae6167ae809109be13693722b38d5a4478e128afa0f7468c0bc6b11936a46067950d08fb0d077eefbac21b9c3b3912c9108ab0dfb8a9069b8270fbb135639046902bd37d153d9f8d524be904d48acd5fb9702ea554354b870925dee77c0eaed8\"\n },\n {\n \"aggregation_bits\": \"0xbdf2ffff5d7ffffdcffbfbfefefffddf03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"3\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xaedfbd53294f007aea3987cb409334245e1d70b984ec8bf0160d80feedb9c97709031102b75e0c8a01f084ea0a62cdfa03b9a9b6c514c419b146a3458bedb3c8d9380a5b386baacda1949f23fb8029b4ee6e1df4100b104f57b90a6cb8542ad5\"\n },\n {\n \"aggregation_bits\": \"0xffb7bd2ff7ff7fef77e7ffffeeffffbf02\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"0\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x9725755ad371de5e0034a7c268cd0c4bfe8906a08aab1492df1c5e99447707c68bfbe1442b55aac5879ba08e449a84120a926b2b0e79d74541e98b0ee92082ad28663bf479717f4b8f5a9339823524470720517b0594576829b1a4d55a42030c\"\n },\n {\n \"aggregation_bits\": \"0xffd3bf3cfffbf77efff77ffffbd5ff7f03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"21\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa55586fe08d65916f3da6e443ab375bdfe35edc521f05995f40200c95105c494e77dac5e0ec96f6e3484595bcacf19f71302222100e913c6d70231fb86ec706d4feaf23bccdf7c17282ea3beeec9dd98bc96e5b76c1a489fe576e8784dfbaf3b\"\n },\n {\n \"aggregation_bits\": \"0xffefff7ffef89fffffcddbfffff7f55e03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"12\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8b57dce1e842b001300a3d5a9688b8efb0b2775f9358f8e9169ede20e2b7bfe76a58a51a136a022ad1e113094a8322dd17f04a5bb34dd6e56bb97294e83ecf24325b208c9327d2fc25be121a12c6c4b333bfddc509b50e456d05b21d147c25c3\"\n },\n {\n \"aggregation_bits\": \"0xcfffff3ffff7dff7f797fddffff2edbf02\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"19\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa90639d61d328a2170cc2c7e3ac072da6bbefd95095256465227fc9690fc4f90a879f3c4ab3afca98ac00d7cc7bac84a0eec414a32f0df7b34c875cf54b2fe8e103c9846b364be20e55883cf72b59cde066ecf58d3ab0456297bf31acb1379c2\"\n },\n {\n \"aggregation_bits\": \"0xfcfeedfeb7fffff5df7efcfefeffbdef03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"17\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb0724c415d91153a6a28834620822a6efc043ce75420ebae4e0d1f3987e771a351a3298d73af726056a75e18091f2a0001a1c5cc124ca680324e0841a77656a8545fad253e34d567e3d383be744e02f3e3c8628991f02e0b21ac412b204dbc2c\"\n },\n {\n \"aggregation_bits\": \"0xdffbfbedfbbefbefffbb3ffa7eedf6ff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"7\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xad51bc8cdac71feef28340bd50240e72f7c1bb62b77ab242af3a0de34b67222356b52a4740d3ec4900ae403f409190f5025ff6931eb20f9d0f7bfc504a556c8f599e939c98e83b2522bf0f1ebbcc388d2a53b06fb6b40be8c8a1bd997907edf7\"\n },\n {\n \"aggregation_bits\": \"0xffcdeddb75fefffffbfffcfc7f3bfeff01\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"9\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x86cc3dfb6eec4e59c09bc43fb02e7d71fc70afd0e0872b419ec56fdf4833e1638a2c2236643a9a1ee3b4d32030364c9218a20c177618374dede15df58a9349903cf06ebbe6b270e4361432372418c12558a24b64a96818ed216a48ba21ffc36d\"\n },\n {\n \"aggregation_bits\": \"0xcbb3fffff797efd7ff4fff7fffcfebfe03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"2\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa11795d50d72b50dd88774b80e35c7b2114082ebb940e155f1b2719d85a54039b088cd361de0ec3ccaec327d01b4ec6b0dfd059834f018ad3eb6b696ffcba22a1d5b48ff0095844ef7125cf36d39243bb465b27fa0815a3aa25ab5fb5b045bfb\"\n },\n {\n \"aggregation_bits\": \"0xeeddbeff7fffffed3fa5e33fffffbfbf03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"8\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xad7066ec463c0991cf2f3b11e91de40d02cc878899532f07f0766a101ccb4abc54e75b939adbaf9fe6dfb6405990f3320b25f03af1fb3e0fb4cdb22180fe121113d1424484aad71a9230fe29293ac1ac1001016bb21289d0c5e9b782af8fd2b1\"\n },\n {\n \"aggregation_bits\": \"0x2fecfff7beefeffffbfbddbcfffef9fb02\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"24\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x83d04129691354ca553caac6c5ca6bcb1ad15aed523f878dd1bfc2d1c25257542b60619eb642aac4523691c59e82f6050b83ba51dba150cb5deb030fdc545fbf63cb0f9eba65f934f4bc5c7cd8df14bf0dde21c45521ed83b213c81a48ec2cf8\"\n },\n {\n \"aggregation_bits\": \"0xf9ffdffd7bebe7ff6ffd97fdbfeff9e703\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"13\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8954a5fc4290abf328fcb113a7dbbb355a7cd6d85d5948d70ea11a6e8f2d3e26b7fe5d06078c4385b03a72fb6921fed4028538bde16fb75307405c6bdb99ab9e472e5b19965f108aae23fe1267094c67ffa4175685c1231d367ea935c570e599\"\n },\n {\n \"aggregation_bits\": \"0x7bf71d7fffddffff07af3ffbf7fdfbfe03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"23\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x90e10c0dcc12157299cabb25e4b552dd318ad48118576e4d1ac29b2298c93e5cad3c29fc390081510296c5a1c58052bc1232146a2fdd2ed85c5c90825d78ec6038aa73c6454c164f9f0aa5a9f93f711297a97cff91c21bcea990872da941b48c\"\n },\n {\n \"aggregation_bits\": \"0x4fbfd6bfbffeffff7bedbfdffd3dbdbd02\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"22\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8815a0a80aec3cb7c9bb8feef66c9ae557ea2f1940e6ba2f6612a4055fc179ce8099b273c44d60ec8f9c3320a4c420a20f5f5b299d5ce6bfd3116e74e009e88ca12b1f63ccba8438fc1e18f57c44be3be118664209a5d5eb1b971e8d12423257\"\n },\n {\n \"aggregation_bits\": \"0xddea7bfdd5bb5fffee6ff7fffebff3f703\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"28\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x8b0fbc4645f83e75050c9cc1381c7f324e11c9c5118c2f549fef096a0aab5c9e0f807d751d9a768cc1b7c40e5f6e840e15e553a3edd4e4e93baf0901024c2cc0eb5affdcf164ad4944ff5e17d2adaef73a3f8d1fdaa1ca602b99adff6bc38004\"\n },\n {\n \"aggregation_bits\": \"0xfabdfff2fe8bf733ff76bffafffdf7ff03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"27\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x9375d76b2e1afc085af57030d3137e2b6f8a798961f98e19e58044eb0fe6496f74796513bcc49aa58f5c855e7876e01e14ed945ad2fe045e0e59b4b2ea9d1e388ccd03af3ef7a03ea980b0913b280d0e85be80de618392d8dbff781fdb64c45a\"\n },\n {\n \"aggregation_bits\": \"0xfc6f3af7ffff46fedbfdff5ffff779ad03\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"25\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x96db65f511117149f206719b3f68ea1e55b2a2730e09f99049eae1bffa789796a4f730e1507c3775998ab1c20126065c059311e43f5cbdf793038e4cf58b43f23c92d1a4032510758b621a37a6acd469fe4f8bc1a5ec84bf93c17c517d40ab16\"\n },\n {\n \"aggregation_bits\": \"0x100410b45d834b3241000045b889a4a402\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"28\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb36a8952df24d70fef75d0174c54503f1d74624b97791cc8902d7ccf284e8b2ecdf144decdf6648f9ac7e9868a47bf8a116e4277c48764f83694f460493f9f826b7af04659526a4f45e7e0ce2a75ad03bcc4b0af27eea260fef0d10bd64945da\"\n },\n {\n \"aggregation_bits\": \"0x0080588408a0024087000da01004014002\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"24\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x9146464de6d0a0b9c725f39751bffdb7a83641d7c3c4a02e53ce77ab0bfeed8014ddc40dabbb373ff6caa838319013bd13317c16222a2ff72d7fbe7357d3d3752538214572014bfff78987f4b40705485737df4b501b3a089def2fd5ac64c615\"\n },\n {\n \"aggregation_bits\": \"0x0012000000000000000080000002090002\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"7\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb0aae76ccc8db1db0a789dd9d527ee3728b47cfca02e5055e21cb46c58a1079cf0e7a01693c14b0eb7839419d1377118092f8768de7c27b46952346e55b5412c6c46c7eb8e0d607f072518925a1d1e6a1f3af8270d3ea4a7d6cd1446c9d1eb3c\"\n },\n {\n \"aggregation_bits\": \"0x0000100000000000000008110800000001\",\n \"data\": {\n \"slot\": \"2234174\",\n \"index\": \"9\",\n \"beacon_block_root\": \"0xc2a6b88ed0cb54dc0cc06da8d31e17a79cc6e5ca9a4b1feba5dbec043d35b45b\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xae71b8500d7a15e9ec8ae17b09ffc5fd2ea75e48eb56ea56a1011293f3f81117cff664b7b57b381e376a720396ab78240ede87febb7a9f6a9c0a13d12b0ad0aa1698ecddd6f4217c64a3a0375dcaa176d33b2d09d31291c01b550670ec455fea\"\n },\n {\n \"aggregation_bits\": \"0xff7ffbfbefbf7ede6df7b7f9ffbfffff01\",\n \"data\": {\n \"slot\": \"2234170\",\n \"index\": \"27\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xb2a867f1e83642aa591f73a330c5d1a6c2518b1cb2f0e44df8bec63ad7bb24ea1342bd0accad582f6209e99866ceeb5303879bc8b882ba96a2ee34f99091cea17dada505163c86ad0d7248541325041b813a19e284ee8a0ee3ba4b5bf5386b3c\"\n },\n {\n \"aggregation_bits\": \"0xd7fffffff4fffdffffeff7fdfdfdffbd02\",\n \"data\": {\n \"slot\": \"2234170\",\n \"index\": \"20\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa786c3f9227afa2fbaa4357a38174f8b373ecb013f448d913521e3a53a31e1bbea7f61f0077647b60713891328bcb91d04fbd51161043b347af16b009140db6ef4f39f4b89d81058b1cf7b72b19061d696db8580da88c80827028aab78f74f40\"\n },\n {\n \"aggregation_bits\": \"0xfff7f5f6ffffffd679fffeedfddffbff02\",\n \"data\": {\n \"slot\": \"2234170\",\n \"index\": \"25\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x9251ef33249563f1f99dd7a3a1d0c7da1ea2e070e99ff3a3352cd39b7289df5727d12d707ca6937404e91a00cd7844300fa958edc526197fde12ecb5bad7984f056a51d306e5fb6a3e649d8e33f1a86abe74337034b92b9fdd6f1c17a060572d\"\n },\n {\n \"aggregation_bits\": \"0xfff7fbff7ffb37fdff5ffffdbefbfdff03\",\n \"data\": {\n \"slot\": \"2234169\",\n \"index\": \"23\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x906b41676cfbceb32f97b2f0c86dbf948b8295f7bd29e22cff1c00958ec5864b5c863629da6ec00cc42d8d37eaa2cdeb03d290414222ccbc25fa2c4ef52e389a0a844757aea28e842de83a43ee1652f42f4d65b4bdd5080458d6ffc7f727545f\"\n },\n {\n \"aggregation_bits\": \"0xfff9ef7f3afdff3fffff7efffbddff3f02\",\n \"data\": {\n \"slot\": \"2234169\",\n \"index\": \"4\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x86583e4d2a9c51f36e1976b7552095dc42ec9c318ef3ed0605264917b87830f1d2e53d8e5186868b89a94e069e93ed790424b782507245df39216ceba4c239d80101a31d68153425fa148d7c345dd278124ae84ef2c532442a792b16fc77ed18\"\n },\n {\n \"aggregation_bits\": \"0xfffffbfaf1f7fffe77fedfdbffda5bfd03\",\n \"data\": {\n \"slot\": \"2234169\",\n \"index\": \"19\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x813e7cf5e7514929cf8cadcc83f2fc38853af70b221a0a88f286ed7e8c42dd2ad285b9f8e176ace15ca6a6d0746f2c0e15c44c92223888c5e5701e66a83c0ad9da486083f7f4f145f2ee049d53f6c97ab24b518d949c498bbd7e52b25d4b9ff8\"\n },\n {\n \"aggregation_bits\": \"0xffbfcfffff6be76fdfffffffffeef77f03\",\n \"data\": {\n \"slot\": \"2234169\",\n \"index\": \"25\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x99e8025dc1f835cac1069dd292776ea733ea6e346e34e435b547c7a8c42ea16f1004ed86f1eb102f59ed11ce007a74d3008cb79f800e9fa364dd0d9d27190eca362ba09f314433c3b052130857258b7e0a51537d0b2628b983d72ed1735035ad\"\n },\n {\n \"aggregation_bits\": \"0xdffffdffdfafff73bfffdffffcbafffc03\",\n \"data\": {\n \"slot\": \"2234169\",\n \"index\": \"16\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0x9449cdc69b48bc4bfde82c9d3b0a3b00d34cc6eef34aa9ddfec998b184f7e5511af6a4bfd3d1e1f4e3267a88616c55f111b36cb40a787f161e1fcbcf30ba3029bc3d49790bfadb8e92738ff04382f6ee4fc03f81ef9e4dc6b95e20a205d147ed\"\n },\n {\n \"aggregation_bits\": \"0xfdbffff5fdf7fefc2fffdfefdafefbfd02\",\n \"data\": {\n \"slot\": \"2234169\",\n \"index\": \"28\",\n \"beacon_block_root\": \"0x1dfd9b3e648dc5768dc004ced7e9b54f4b085a0e64882caec42c360a36a01312\",\n \"source\": {\n \"epoch\": \"69816\",\n \"root\": \"0xb9085fd60831fad7ea425dee4a04ebe1e89f547ebda92237801db041891530e1\"\n },\n \"target\": {\n \"epoch\": \"69817\",\n \"root\": \"0xeeaf0728bd92dd6b711aead39818c0b38dd70a45f22ecc189cedbcd156fd7ed7\"\n }\n },\n \"signature\": \"0xa968bc6bf1d6dc7b715f83ef2c4e157247b277aea4efc0705fab136f65ac40f30e60dcc53cbd32b33aacd5fd469bda1e01b4fd4d1caf0c31c9378b7ba778a858fa6e127903d6e672204205965d2b1c13b25433d10bc99da65fd80767a4a90602\"\n }\n ],\n \"deposits\": [],\n \"voluntary_exits\": [],\n \"sync_aggregate\": {\n \"sync_committee_bits\": \"0xbff7dbffedfffffdc5fffb56bbeeff9efd9feafb4ffbefff7fffffffefffff5efef9ffffe6fbff7ffdfaffff79f5effbfffbffffcff3ffcdfbfffefdffdfbdfb\",\n \"sync_committee_signature\": \"0xa1cdf7a4ba9d30ac0199a80ebeaade2b5312e324c5bbaa330709dd5f259a85598cd0ae534dcc3c96ac2c740b01c0dbc00f9b8fd0aeb8f3126671008b7dc4ab5eaaae1cf02c7b15ad73657b6f1273aae8a40953fe2031387ff1f285bce914604b\"\n }\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/blocks", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "blocks" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blinded_blocks", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "url": { - "raw": "/beacon/blinded_blocks", - "path": [ - "beacon", - "blinded_blocks" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blocks/{block_id}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/blocks/{block_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "blocks", - "{block_id}" - ] - } - }, - "response": [] - }, - { - "name": "/v2/beacon/blocks/{block_id}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v2/beacon/blocks/{block_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v2", - "beacon", - "blocks", - "{block_id}" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blocks/{block_id} (SSZ)", - "protocolProfileBehavior": { - "disabledSystemHeaders": { - "accept": true - } - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "text" - } - ], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/blocks/{block_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "blocks", - "{block_id}" - ] - } - }, - "response": [] - }, - { - "name": "/v2/beacon/blocks/{block_id} (SSZ)", - "protocolProfileBehavior": { - "disabledSystemHeaders": { - "accept": true - } - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "text" - } - ], - "url": { - "raw": "http://localhost:3500/eth/v2/beacon/blocks/{block_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v2", - "beacon", - "blocks", - "{block_id}" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blocks/{block_id}/root", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/blocks/{block_id}/root", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "blocks", - "{block_id}", - "root" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/blocks/{block_id}/attestations", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/blocks/{block_id}/attestations", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "blocks", - "{block_id}", - "attestations" - ], - "query": [ - { - "key": "slot", - "value": null, - "disabled": true - }, - { - "key": "committee_index", - "value": null, - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/attestations", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/attestations", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "attestations" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/attestations", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n {\n \"aggregation_bits\": \"0x01\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/attestations", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "attestations" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/attester_slashings", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/attester_slashings", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "attester_slashings" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/attester_slashings", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"attestation_1\": {\n \"attesting_indices\": [\n \"1\"\n ],\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n },\n \"attestation_2\": {\n \"attesting_indices\": [\n \"1\"\n ],\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/attester_slashings", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "attester_slashings" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/proposer_slashings", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/proposer_slashings", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "proposer_slashings" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/proposer_slashings", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"signed_header_1\": {\n \"message\": {\n \"slot\": \"1\",\n \"proposer_index\": \"1\",\n \"parent_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"state_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"body_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n },\n \"signed_header_2\": {\n \"message\": {\n \"slot\": \"1\",\n \"proposer_index\": \"1\",\n \"parent_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"state_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"body_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/proposer_slashings", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "proposer_slashings" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/sync_committees", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n {\n \"slot\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"validator_index\": \"1\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/sync_committees", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "sync_committees" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/voluntary_exits", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/voluntary_exits", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "voluntary_exits" - ] - } - }, - "response": [] - }, - { - "name": "/beacon/pool/voluntary_exits", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"message\": {\n \"epoch\": \"1\",\n \"validator_index\": \"1\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/beacon/pool/voluntary_exits", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "beacon", - "pool", - "voluntary_exits" - ] - } - }, - "response": [] - }, - { - "name": "/config/fork_schedule", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/config/fork_schedule", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "config", - "fork_schedule" - ] - } - }, - "response": [] - }, - { - "name": "/config/spec", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/config/spec", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "config", - "spec" - ] - } - }, - "response": [] - }, - { - "name": "/config/deposit_contract", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/config/deposit_contract", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "config", - "deposit_contract" - ] - } - }, - "response": [] - }, - { - "name": "/debug/beacon/states/{state_id}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/debug/beacon/states/{state_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "debug", - "beacon", - "states", - "{state_id}" - ] - } - }, - "response": [] - }, - { - "name": "/debug/beacon/states/{state_id} (SSZ)", - "protocolProfileBehavior": { - "disabledSystemHeaders": { - "accept": true - } - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "text" - } - ], - "url": { - "raw": "http://localhost:3500/eth/v1/debug/beacon/states/{state_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "debug", - "beacon", - "states", - "{state_id}" - ] - } - }, - "response": [] - }, - { - "name": "/v2/debug/beacon/states/{state_id}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v2/debug/beacon/states/{state_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v2", - "debug", - "beacon", - "states", - "{state_id}" - ] - } - }, - "response": [] - }, - { - "name": "/v2/debug/beacon/states/{state_id} (SSZ)", - "protocolProfileBehavior": { - "disabledSystemHeaders": { - "accept": true - } - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "text" - } - ], - "url": { - "raw": "http://localhost:3500/eth/v2/debug/beacon/states/{state_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v2", - "debug", - "beacon", - "states", - "{state_id}" - ] - } - }, - "response": [] - }, - { - "name": "/debug/beacon/heads", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/debug/beacon/heads", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "debug", - "beacon", - "heads" - ] - } - }, - "response": [] - }, - { - "name": "/v2/debug/beacon/heads", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v2/debug/beacon/heads", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v2", - "debug", - "beacon", - "heads" - ] - } - }, - "response": [] - }, - { - "name": "/node/identity", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/identity", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "identity" - ] - } - }, - "response": [] - }, - { - "name": "/node/peers", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/peers", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "peers" - ], - "query": [ - { - "key": "state", - "value": null, - "disabled": true - }, - { - "key": "direction", - "value": null, - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/node/peers/{peer_id}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/peers/{peer_id}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "peers", - "{peer_id}" - ] - } - }, - "response": [] - }, - { - "name": "/node/peer_count", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/peer_count", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "peer_count" - ] - } - }, - "response": [] - }, - { - "name": "/node/version", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/version", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "version" - ] - } - }, - "response": [] - }, - { - "name": "/node/syncing", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/syncing", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "syncing" - ] - } - }, - "response": [] - }, - { - "name": "/node/health", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/node/health", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "node", - "health" - ] - } - }, - "response": [] - }, - { - "name": "/validator/duties/attester/{epoch}", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/duties/attester/{epoch}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "duties", - "attester", - "{epoch}" - ] - } - }, - "response": [] - }, - { - "name": "/validator/duties/proposer/{epoch}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/duties/proposer/{epoch}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "duties", - "proposer", - "{epoch}" - ] - } - }, - "response": [] - }, - { - "name": "/validator/duties/sync/{epoch}", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n \"97880\",\n \"122740\"\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/validator/duties/sync/{epoch}", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "duties", - "sync", - "{epoch}" - ] - } - }, - "response": [] - }, - { - "name": "/validator/blocks/{slot}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/blocks/{slot}?randao_reveal=0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "blocks", - "{slot}" - ], - "query": [ - { - "key": "randao_reveal", - "value": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" - }, - { - "key": "graffiti", - "value": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/v2/validator/blocks/{slot}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v2/validator/blocks/{slot}?graffiti=0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2=&randao_reveal=0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v2", - "validator", - "blocks", - "{slot}" - ], - "query": [ - { - "key": "graffiti", - "value": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2=" - }, - { - "key": "randao_reveal", - "value": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" - } - ] - } - }, - "response": [] - }, - { - "name": "validator/blinded_blocks/{slot}", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/blinded_blocks/{slot}?graffiti=0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2=&randao_reveal=0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "blinded_blocks", - "{slot}" - ], - "query": [ - { - "key": "graffiti", - "value": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2=" - }, - { - "key": "randao_reveal", - "value": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" - } - ] - } - }, - "response": [] - }, - { - "name": "/validator/attestation_data", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/attestation_data?slot=1820830&committee_index=1", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "attestation_data" - ], - "query": [ - { - "key": "slot", - "value": "1820830" - }, - { - "key": "committee_index", - "value": "1" - } - ] - } - }, - "response": [] - }, - { - "name": "/validator/aggregate_attestation", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/aggregate_attestation?attestation_data_root=MHhjZjhlMGQ0ZTk1ODczNjliMjMwMWQwNzkwMzQ3MzIwMzAyY2MwOTQzZDVhMTg4NDU2MDM2N2U4MjA4ZDkyMGYy", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "aggregate_attestation" - ], - "query": [ - { - "key": "attestation_data_root", - "value": "MHhjZjhlMGQ0ZTk1ODczNjliMjMwMWQwNzkwMzQ3MzIwMzAyY2MwOTQzZDVhMTg4NDU2MDM2N2U4MjA4ZDkyMGYy" - }, - { - "key": "slot", - "value": "10000", - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/validator/aggregate_and_proofs", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n {\n \"message\": {\n \"aggregator_index\": \"1\",\n \"aggregate\": {\n \"aggregation_bits\": \"0x01\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"data\": {\n \"slot\": \"1\",\n \"index\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"source\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n },\n \"target\": {\n \"epoch\": \"1\",\n \"root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\"\n }\n }\n },\n \"selection_proof\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/validator/aggregate_and_proofs", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "aggregate_and_proofs" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - }, - { - "key": "", - "value": "", - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "/validator/beacon_committee_subscriptions", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n {\n \"validator_index\": \"10000\",\n \"committee_index\": \"1\",\n \"committees_at_slot\": \"1\",\n \"slot\": \"100000\",\n \"is_aggregator\": true\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/validator/beacon_committee_subscriptions", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "beacon_committee_subscriptions" - ] - } - }, - "response": [] - }, - { - "name": "/validator/sync_committee_subscriptions", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n {\n \"validator_index\": \"10000\",\n \"sync_committee_indices\": [\n \"1\"\n ],\n \"until_epoch\": \"64\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/validator/sync_committee_subscriptions", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "sync_committee_subscriptions" - ] - } - }, - "response": [] - }, - { - "name": "/validator/sync_committee_contribution", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3500/eth/v1/validator/sync_committee_contribution?slot=100000&subcommittee_index=1&beacon_block_root=0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "sync_committee_contribution" - ], - "query": [ - { - "key": "slot", - "value": "100000" - }, - { - "key": "subcommittee_index", - "value": "1" - }, - { - "key": "beacon_block_root", - "value": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" - } - ] - } - }, - "response": [] - }, - { - "name": "/validator/contribution_and_proofs", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "[\n {\n \"message\": {\n \"aggregator_index\": \"1\",\n \"selection_proof\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\",\n \"contribution\": {\n \"slot\": \"1\",\n \"beacon_block_root\": \"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2\",\n \"subcommittee_index\": \"1\",\n \"aggregation_bits\": \"0x01000000000000000000000000000000\",\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n },\n \"signature\": \"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505\"\n }\n]", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3500/eth/v1/validator/contribution_and_proofs", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3500", - "path": [ - "eth", - "v1", - "validator", - "contribution_and_proofs" - ] - } - }, - "response": [] - }, - { - "name": "/validator/prepare_beacon_proposer", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "[\n {\n \"validator_index\": \"1\",\n \"fee_recipient\": \"0xabcf8e0d4e9587369b2301d0790347320302cc09\"\n }\n]" - }, - "url": { - "raw": "/eth/v1/validator/prepare_beacon_proposer", - "path": [ - "eth", - "v1", - "validator", - "prepare_beacon_proposer" - ] - } - }, - "response": [] - } - ] -} \ No newline at end of file From 9befb6bd06189d550c67af47cee63509641aade8 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Mon, 20 May 2024 10:40:46 -0500 Subject: [PATCH 099/325] g/wei math->primitives, some new helpers (#14026) Co-authored-by: Kasey Kirkham --- api/client/builder/bid.go | 3 +- beacon-chain/core/electra/BUILD.bazel | 1 - beacon-chain/core/electra/balance_deposits.go | 8 +- .../core/electra/balance_deposits_test.go | 9 +- beacon-chain/core/electra/churn.go | 8 +- beacon-chain/core/electra/churn_test.go | 11 +- beacon-chain/core/electra/consolidations.go | 6 +- beacon-chain/core/electra/upgrade.go | 5 +- beacon-chain/core/electra/upgrade_test.go | 7 +- beacon-chain/core/helpers/BUILD.bazel | 1 - beacon-chain/core/helpers/validator_churn.go | 12 +- .../core/helpers/validator_churn_test.go | 28 +-- beacon-chain/core/validators/BUILD.bazel | 1 - beacon-chain/core/validators/validator.go | 2 +- .../core/validators/validator_test.go | 5 +- .../validator/construct_generic_block.go | 10 +- .../v1alpha1/validator/proposer_bellatrix.go | 3 +- beacon-chain/state/BUILD.bazel | 1 - beacon-chain/state/interfaces.go | 13 +- beacon-chain/state/state-native/BUILD.bazel | 1 - .../state-native/beacon_state_mainnet.go | 13 +- .../state-native/beacon_state_minimal.go | 13 +- .../state-native/getters_balance_deposits.go | 4 +- .../getters_balance_deposits_test.go | 3 +- .../state-native/getters_consolidation.go | 3 +- .../getters_consolidation_test.go | 3 +- .../state/state-native/getters_exit.go | 3 +- .../state/state-native/getters_exit_test.go | 3 +- .../state-native/setters_balance_deposits.go | 3 +- .../setters_balance_deposits_test.go | 3 +- .../state/state-native/setters_churn.go | 9 +- .../state/state-native/setters_churn_test.go | 29 ++- .../state-native/setters_consolidation.go | 3 +- .../setters_consolidation_test.go | 3 +- consensus-types/blocks/BUILD.bazel | 1 - consensus-types/blocks/execution.go | 62 +++--- consensus-types/blocks/getters.go | 3 +- consensus-types/interfaces/BUILD.bazel | 1 - consensus-types/interfaces/beacon_block.go | 5 +- consensus-types/mock/BUILD.bazel | 1 - consensus-types/mock/block.go | 3 +- consensus-types/primitives/BUILD.bazel | 2 + consensus-types/primitives/wei.go | 93 +++++++++ consensus-types/primitives/wei_test.go | 41 ++++ encoding/ssz/equality/BUILD.bazel | 1 - encoding/ssz/equality/deep_equal.go | 3 +- math/BUILD.bazel | 6 +- math/math_helper.go | 64 ------ math/math_helper_test.go | 9 +- proto/eth/v1/generated.ssz.go | 2 +- proto/eth/v2/generated.ssz.go | 2 +- proto/prysm/v1alpha1/beacon_state.pb.go | 193 +++++++++--------- proto/prysm/v1alpha1/beacon_state.proto | 6 +- proto/prysm/v1alpha1/generated.ssz.go | 9 +- .../electra/epoch_processing/BUILD.bazel | 2 +- .../pending_balance_updates.go | 4 +- testing/util/BUILD.bazel | 1 - testing/util/electra_state.go | 12 +- 58 files changed, 398 insertions(+), 358 deletions(-) create mode 100644 consensus-types/primitives/wei.go create mode 100644 consensus-types/primitives/wei_test.go diff --git a/api/client/builder/bid.go b/api/client/builder/bid.go index df4b92fb31b7..50e3e21952f2 100644 --- a/api/client/builder/bid.go +++ b/api/client/builder/bid.go @@ -6,6 +6,7 @@ import ( consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -165,7 +166,7 @@ func WrappedBuilderBidCapella(p *ethpb.BuilderBidCapella) (Bid, error) { // Header returns the execution data interface. func (b builderBidCapella) Header() (interfaces.ExecutionData, error) { // We have to convert big endian to little endian because the value is coming from the execution layer. - return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header, blocks.PayloadValueToWei(b.p.Value)) + return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header, primitives.BigEndianBytesToWei(b.p.Value)) } // BlobKzgCommitments -- diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index ac9e5de4a526..1d8ad06b35d8 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -55,7 +55,6 @@ go_test( "//crypto/bls/blst:go_default_library", "//crypto/bls/common:go_default_library", "//encoding/bytesutil:go_default_library", - "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/interop:go_default_library", diff --git a/beacon-chain/core/electra/balance_deposits.go b/beacon-chain/core/electra/balance_deposits.go index 75ef2a8ea949..6f1874e9a318 100644 --- a/beacon-chain/core/electra/balance_deposits.go +++ b/beacon-chain/core/electra/balance_deposits.go @@ -6,7 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "go.opencensus.io/trace" ) @@ -32,7 +32,7 @@ import ( // state.deposit_balance_to_consume = Gwei(0) // else: // state.deposit_balance_to_consume = available_for_processing - processed_amount -func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, activeBalance math.Gwei) error { +func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, activeBalance primitives.Gwei) error { _, span := trace.StartSpan(ctx, "electra.ProcessPendingBalanceDeposits") defer span.End() @@ -54,13 +54,13 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac } for _, deposit := range deposits { - if math.Gwei(deposit.Amount) > availableForProcessing { + if primitives.Gwei(deposit.Amount) > availableForProcessing { break } if err := helpers.IncreaseBalance(st, deposit.Index, deposit.Amount); err != nil { return err } - availableForProcessing -= math.Gwei(deposit.Amount) + availableForProcessing -= primitives.Gwei(deposit.Amount) nextDepositIndex++ } diff --git a/beacon-chain/core/electra/balance_deposits_test.go b/beacon-chain/core/electra/balance_deposits_test.go index 980785d86b46..552ef548c54b 100644 --- a/beacon-chain/core/electra/balance_deposits_test.go +++ b/beacon-chain/core/electra/balance_deposits_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -36,7 +35,7 @@ func TestProcessPendingBalanceDeposits(t *testing.T) { check: func(t *testing.T, st state.BeaconState) { res, err := st.DepositBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(0), res) + require.Equal(t, primitives.Gwei(0), res) }, }, { @@ -59,7 +58,7 @@ func TestProcessPendingBalanceDeposits(t *testing.T) { amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) res, err := st.DepositBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(100), res) + require.Equal(t, primitives.Gwei(100), res) // Validators 0..9 should have their balance increased for i := primitives.ValidatorIndex(0); i < 10; i++ { b, err := st.BalanceAtIndex(i) @@ -93,7 +92,7 @@ func TestProcessPendingBalanceDeposits(t *testing.T) { amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) res, err := st.DepositBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(0), res) + require.Equal(t, primitives.Gwei(0), res) // Validators 0..4 should have their balance increased for i := primitives.ValidatorIndex(0); i < 4; i++ { b, err := st.BalanceAtIndex(i) @@ -119,7 +118,7 @@ func TestProcessPendingBalanceDeposits(t *testing.T) { tab, err = helpers.TotalActiveBalance(tt.state) } require.NoError(t, err) - err = electra.ProcessPendingBalanceDeposits(context.TODO(), tt.state, math.Gwei(tab)) + err = electra.ProcessPendingBalanceDeposits(context.TODO(), tt.state, primitives.Gwei(tab)) require.Equal(t, tt.wantErr, err != nil, "wantErr=%v, got err=%s", tt.wantErr, err) if tt.check != nil { tt.check(t, tt.state) diff --git a/beacon-chain/core/electra/churn.go b/beacon-chain/core/electra/churn.go index bde3fe912516..8903ec54b531 100644 --- a/beacon-chain/core/electra/churn.go +++ b/beacon-chain/core/electra/churn.go @@ -37,7 +37,7 @@ import ( // state.earliest_consolidation_epoch = earliest_consolidation_epoch // // return state.earliest_consolidation_epoch -func ComputeConsolidationEpochAndUpdateChurn(ctx context.Context, s state.BeaconState, consolidationBalance math.Gwei) (primitives.Epoch, error) { +func ComputeConsolidationEpochAndUpdateChurn(ctx context.Context, s state.BeaconState, consolidationBalance primitives.Gwei) (primitives.Epoch, error) { earliestEpoch, err := s.EarliestConsolidationEpoch() if err != nil { return 0, err @@ -47,10 +47,10 @@ func ComputeConsolidationEpochAndUpdateChurn(ctx context.Context, s state.Beacon if err != nil { return 0, err } - perEpochConsolidationChurn := helpers.ConsolidationChurnLimit(math.Gwei(activeBal)) + perEpochConsolidationChurn := helpers.ConsolidationChurnLimit(primitives.Gwei(activeBal)) // New epoch for consolidations. - var consolidationBalanceToConsume math.Gwei + var consolidationBalanceToConsume primitives.Gwei if earliestEpoch < earliestConsolidationEpoch { consolidationBalanceToConsume = perEpochConsolidationChurn } else { @@ -70,7 +70,7 @@ func ComputeConsolidationEpochAndUpdateChurn(ctx context.Context, s state.Beacon } additionalEpochs++ earliestConsolidationEpoch += primitives.Epoch(additionalEpochs) - consolidationBalanceToConsume += math.Gwei(additionalEpochs) * perEpochConsolidationChurn + consolidationBalanceToConsume += primitives.Gwei(additionalEpochs) * perEpochConsolidationChurn } // Consume the balance and update state variables. diff --git a/beacon-chain/core/electra/churn_test.go b/beacon-chain/core/electra/churn_test.go index 3ce9d839c629..d1920229ca3b 100644 --- a/beacon-chain/core/electra/churn_test.go +++ b/beacon-chain/core/electra/churn_test.go @@ -9,14 +9,13 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/time/slots" ) -func createValidatorsWithTotalActiveBalance(totalBal math.Gwei) []*eth.Validator { - num := totalBal / math.Gwei(params.BeaconConfig().MinActivationBalance) +func createValidatorsWithTotalActiveBalance(totalBal primitives.Gwei) []*eth.Validator { + num := totalBal / primitives.Gwei(params.BeaconConfig().MinActivationBalance) vals := make([]*eth.Validator, num) for i := range vals { vals[i] = ð.Validator{ @@ -25,7 +24,7 @@ func createValidatorsWithTotalActiveBalance(totalBal math.Gwei) []*eth.Validator EffectiveBalance: params.BeaconConfig().MinActivationBalance, } } - if totalBal%math.Gwei(params.BeaconConfig().MinActivationBalance) != 0 { + if totalBal%primitives.Gwei(params.BeaconConfig().MinActivationBalance) != 0 { vals = append(vals, ð.Validator{ ActivationEpoch: primitives.Epoch(0), ExitEpoch: params.BeaconConfig().FarFutureEpoch, @@ -41,9 +40,9 @@ func TestComputeConsolidationEpochAndUpdateChurn(t *testing.T) { tests := []struct { name string state state.BeaconState - consolidationBalance math.Gwei + consolidationBalance primitives.Gwei expectedEpoch primitives.Epoch - expectedConsolidationBalanceToConsume math.Gwei + expectedConsolidationBalanceToConsume primitives.Gwei }{ { name: "compute consolidation with no consolidation balance", diff --git a/beacon-chain/core/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go index 603e40d893e0..37145c29a519 100644 --- a/beacon-chain/core/electra/consolidations.go +++ b/beacon-chain/core/electra/consolidations.go @@ -8,8 +8,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -166,7 +166,7 @@ func ProcessConsolidations(ctx context.Context, st state.BeaconState, cs []*ethp return err } - if helpers.ConsolidationChurnLimit(math.Gwei(totalBalance)) <= math.Gwei(params.BeaconConfig().MinActivationBalance) { + if helpers.ConsolidationChurnLimit(primitives.Gwei(totalBalance)) <= primitives.Gwei(params.BeaconConfig().MinActivationBalance) { return errors.New("too little available consolidation churn limit") } @@ -240,7 +240,7 @@ func ProcessConsolidations(ctx context.Context, st state.BeaconState, cs []*ethp return errors.New("consolidation signature verification failed") } - sEE, err := ComputeConsolidationEpochAndUpdateChurn(ctx, st, math.Gwei(source.EffectiveBalance)) + sEE, err := ComputeConsolidationEpochAndUpdateChurn(ctx, st, primitives.Gwei(source.EffectiveBalance)) if err != nil { return err } diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index 3ef96449c40f..cfb625cfeec9 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -11,7 +11,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -271,9 +270,9 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) DepositReceiptsStartIndex: params.BeaconConfig().UnsetDepositReceiptsStartIndex, DepositBalanceToConsume: 0, - ExitBalanceToConsume: helpers.ActivationExitChurnLimit(math.Gwei(tab)), + ExitBalanceToConsume: helpers.ActivationExitChurnLimit(primitives.Gwei(tab)), EarliestExitEpoch: earliestExitEpoch, - ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(math.Gwei(tab)), + ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(primitives.Gwei(tab)), EarliestConsolidationEpoch: helpers.ActivationExitEpoch(slots.ToEpoch(beaconState.Slot())), PendingBalanceDeposits: make([]*ethpb.PendingBalanceDeposit, 0), PendingPartialWithdrawals: make([]*ethpb.PendingPartialWithdrawal, 0), diff --git a/beacon-chain/core/electra/upgrade_test.go b/beacon-chain/core/electra/upgrade_test.go index ee180189e10a..4193b6b9ce7a 100644 --- a/beacon-chain/core/electra/upgrade_test.go +++ b/beacon-chain/core/electra/upgrade_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -152,14 +151,14 @@ func TestUpgradeToElectra(t *testing.T) { balance, err := mSt.DepositBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(0), balance) + require.Equal(t, primitives.Gwei(0), balance) tab, err := helpers.TotalActiveBalance(mSt) require.NoError(t, err) ebtc, err := mSt.ExitBalanceToConsume() require.NoError(t, err) - require.Equal(t, helpers.ActivationExitChurnLimit(math.Gwei(tab)), ebtc) + require.Equal(t, helpers.ActivationExitChurnLimit(primitives.Gwei(tab)), ebtc) eee, err := mSt.EarliestExitEpoch() require.NoError(t, err) @@ -167,7 +166,7 @@ func TestUpgradeToElectra(t *testing.T) { cbtc, err := mSt.ConsolidationBalanceToConsume() require.NoError(t, err) - require.Equal(t, helpers.ConsolidationChurnLimit(math.Gwei(tab)), cbtc) + require.Equal(t, helpers.ConsolidationChurnLimit(primitives.Gwei(tab)), cbtc) earliestConsolidationEpoch, err := mSt.EarliestConsolidationEpoch() require.NoError(t, err) diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index 1b5709add134..1912d6c2998c 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -78,7 +78,6 @@ go_test( "//container/slice:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", - "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", diff --git a/beacon-chain/core/helpers/validator_churn.go b/beacon-chain/core/helpers/validator_churn.go index 04409f08112a..a038e32b7db8 100644 --- a/beacon-chain/core/helpers/validator_churn.go +++ b/beacon-chain/core/helpers/validator_churn.go @@ -2,7 +2,7 @@ package helpers import ( "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) // BalanceChurnLimit for the current active balance, in gwei. @@ -19,12 +19,12 @@ import ( // get_total_active_balance(state) // CHURN_LIMIT_QUOTIENT // ) // return churn - churn % EFFECTIVE_BALANCE_INCREMENT -func BalanceChurnLimit(activeBalance math.Gwei) math.Gwei { +func BalanceChurnLimit(activeBalance primitives.Gwei) primitives.Gwei { churn := max( params.BeaconConfig().MinPerEpochChurnLimitElectra, (uint64(activeBalance) / params.BeaconConfig().ChurnLimitQuotient), ) - return math.Gwei(churn - churn%params.BeaconConfig().EffectiveBalanceIncrement) + return primitives.Gwei(churn - churn%params.BeaconConfig().EffectiveBalanceIncrement) } // ActivationExitChurnLimit for the current active balance, in gwei. @@ -37,8 +37,8 @@ func BalanceChurnLimit(activeBalance math.Gwei) math.Gwei { // Return the churn limit for the current epoch dedicated to activations and exits. // """ // return min(MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT, get_balance_churn_limit(state)) -func ActivationExitChurnLimit(activeBalance math.Gwei) math.Gwei { - return min(math.Gwei(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit), BalanceChurnLimit(activeBalance)) +func ActivationExitChurnLimit(activeBalance primitives.Gwei) primitives.Gwei { + return min(primitives.Gwei(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit), BalanceChurnLimit(activeBalance)) } // ConsolidationChurnLimit for the current active balance, in gwei. @@ -48,6 +48,6 @@ func ActivationExitChurnLimit(activeBalance math.Gwei) math.Gwei { // // def get_consolidation_churn_limit(state: BeaconState) -> Gwei: // return get_balance_churn_limit(state) - get_activation_exit_churn_limit(state) -func ConsolidationChurnLimit(activeBalance math.Gwei) math.Gwei { +func ConsolidationChurnLimit(activeBalance primitives.Gwei) primitives.Gwei { return BalanceChurnLimit(activeBalance) - ActivationExitChurnLimit(activeBalance) } diff --git a/beacon-chain/core/helpers/validator_churn_test.go b/beacon-chain/core/helpers/validator_churn_test.go index 6a83b4f0168c..9b5fac3d6cee 100644 --- a/beacon-chain/core/helpers/validator_churn_test.go +++ b/beacon-chain/core/helpers/validator_churn_test.go @@ -5,30 +5,30 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/testing/assert" ) func TestBalanceChurnLimit(t *testing.T) { tests := []struct { name string - activeBalance math.Gwei - expected math.Gwei + activeBalance primitives.Gwei + expected primitives.Gwei }{ { name: "less than MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA", activeBalance: 111, - expected: math.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), + expected: primitives.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), }, { name: "modulo EFFECTIVE_BALANCE_INCREMENT", - activeBalance: math.Gwei(111 + params.BeaconConfig().MinPerEpochChurnLimitElectra*params.BeaconConfig().ChurnLimitQuotient), - expected: math.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), + activeBalance: primitives.Gwei(111 + params.BeaconConfig().MinPerEpochChurnLimitElectra*params.BeaconConfig().ChurnLimitQuotient), + expected: primitives.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), }, { name: "more than MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA", - activeBalance: math.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient), - expected: math.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement), + activeBalance: primitives.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient), + expected: primitives.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement), }, } @@ -42,18 +42,18 @@ func TestBalanceChurnLimit(t *testing.T) { func TestActivationExitChurnLimit(t *testing.T) { tests := []struct { name string - activeBalance math.Gwei - expected math.Gwei + activeBalance primitives.Gwei + expected primitives.Gwei }{ { name: "less than MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT", activeBalance: 1, - expected: math.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), + expected: primitives.Gwei(params.BeaconConfig().MinPerEpochChurnLimitElectra), }, { name: "more than MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT", - activeBalance: math.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient), - expected: math.Gwei(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit), + activeBalance: primitives.Gwei(2000 * params.BeaconConfig().EffectiveBalanceIncrement * params.BeaconConfig().ChurnLimitQuotient), + expected: primitives.Gwei(params.BeaconConfig().MaxPerEpochActivationExitChurnLimit), }, } @@ -67,6 +67,6 @@ func TestActivationExitChurnLimit(t *testing.T) { // FuzzConsolidationChurnLimit exercises BalanceChurnLimit and ActivationExitChurnLimit func FuzzConsolidationChurnLimit(f *testing.F) { f.Fuzz(func(t *testing.T, activeBalance uint64) { - helpers.ConsolidationChurnLimit(math.Gwei(activeBalance)) + helpers.ConsolidationChurnLimit(primitives.Gwei(activeBalance)) }) } diff --git a/beacon-chain/core/validators/BUILD.bazel b/beacon-chain/core/validators/BUILD.bazel index 6096f2aea509..8c341f4c791d 100644 --- a/beacon-chain/core/validators/BUILD.bazel +++ b/beacon-chain/core/validators/BUILD.bazel @@ -40,7 +40,6 @@ go_test( "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", - "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//testing/assert:go_default_library", diff --git a/beacon-chain/core/validators/validator.go b/beacon-chain/core/validators/validator.go index c7a2f61015c1..33f4c57b1ed3 100644 --- a/beacon-chain/core/validators/validator.go +++ b/beacon-chain/core/validators/validator.go @@ -103,7 +103,7 @@ func InitiateValidatorExit(ctx context.Context, s state.BeaconState, idx primiti // [Modified in Electra:EIP7251] // exit_queue_epoch = compute_exit_epoch_and_update_churn(state, validator.effective_balance) var err error - exitQueueEpoch, err = s.ExitEpochAndUpdateChurn(math.Gwei(validator.EffectiveBalance)) + exitQueueEpoch, err = s.ExitEpochAndUpdateChurn(primitives.Gwei(validator.EffectiveBalance)) if err != nil { return nil, 0, err } diff --git a/beacon-chain/core/validators/validator_test.go b/beacon-chain/core/validators/validator_test.go index e4220f7128a9..f68634541255 100644 --- a/beacon-chain/core/validators/validator_test.go +++ b/beacon-chain/core/validators/validator_test.go @@ -10,7 +10,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -146,7 +145,7 @@ func TestInitiateValidatorExit_ProperExit_Electra(t *testing.T) { // Pre-check: Exit balance to consume should be zero. ebtc, err := state.ExitBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(0), ebtc) + require.Equal(t, primitives.Gwei(0), ebtc) newState, epoch, err := validators.InitiateValidatorExit(context.Background(), state, idx, 0, 0) // exitQueueEpoch and churn are not used in electra require.NoError(t, err) @@ -161,7 +160,7 @@ func TestInitiateValidatorExit_ProperExit_Electra(t *testing.T) { // Check that the exit balance to consume has been updated on the state. ebtc, err = state.ExitBalanceToConsume() require.NoError(t, err) - require.NotEqual(t, math.Gwei(0), ebtc, "Exit balance to consume was not updated") + require.NotEqual(t, primitives.Gwei(0), ebtc, "Exit balance to consume was not updated") } func TestSlashValidator_OK(t *testing.T) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go index 88e935e118f4..e90f3859dde6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -44,7 +44,7 @@ func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, } // Helper functions for constructing blocks for each version -func (vs *Server) constructElectraBlock(blockProto proto.Message, isBlinded bool, payloadValue math.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { +func (vs *Server) constructElectraBlock(blockProto proto.Message, isBlinded bool, payloadValue primitives.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { if isBlinded { return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedElectra{BlindedElectra: blockProto.(*ethpb.BlindedBeaconBlockElectra)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} } @@ -56,7 +56,7 @@ func (vs *Server) constructElectraBlock(blockProto proto.Message, isBlinded bool return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Electra{Electra: electraContents}, IsBlinded: false, PayloadValue: (*payloadValue).String()} } -func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue math.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { +func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue primitives.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { if isBlinded { return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blockProto.(*ethpb.BlindedBeaconBlockDeneb)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} } @@ -68,14 +68,14 @@ func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Deneb{Deneb: denebContents}, IsBlinded: false, PayloadValue: (*payloadValue).String()} } -func (vs *Server) constructCapellaBlock(pb proto.Message, isBlinded bool, payloadValue math.Wei) *ethpb.GenericBeaconBlock { +func (vs *Server) constructCapellaBlock(pb proto.Message, isBlinded bool, payloadValue primitives.Wei) *ethpb.GenericBeaconBlock { if isBlinded { return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedCapella{BlindedCapella: pb.(*ethpb.BlindedBeaconBlockCapella)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} } return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Capella{Capella: pb.(*ethpb.BeaconBlockCapella)}, IsBlinded: false, PayloadValue: (*payloadValue).String()} } -func (vs *Server) constructBellatrixBlock(pb proto.Message, isBlinded bool, payloadValue math.Wei) *ethpb.GenericBeaconBlock { +func (vs *Server) constructBellatrixBlock(pb proto.Message, isBlinded bool, payloadValue primitives.Wei) *ethpb.GenericBeaconBlock { if isBlinded { return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedBellatrix{BlindedBellatrix: pb.(*ethpb.BlindedBeaconBlockBellatrix)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index c7baa85b3fb8..907dbadf9132 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -18,7 +18,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" - "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/prysmaticlabs/prysm/v5/network/forks" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -243,7 +242,7 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv } l := log.WithFields(logrus.Fields{ - "gweiValue": math.WeiToGwei(v), + "gweiValue": primitives.WeiToGwei(v), "builderPubKey": fmt.Sprintf("%#x", bid.Pubkey()), "blockHash": fmt.Sprintf("%#x", header.BlockHash()), "slot": slot, diff --git a/beacon-chain/state/BUILD.bazel b/beacon-chain/state/BUILD.bazel index 95af0712b819..fa1ee84cff41 100644 --- a/beacon-chain/state/BUILD.bazel +++ b/beacon-chain/state/BUILD.bazel @@ -13,7 +13,6 @@ go_library( "//config/fieldparams:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", - "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 2b32602cad14..7a6a5e83d9af 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -11,7 +11,6 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -182,7 +181,7 @@ type ReadOnlyEth1Data interface { // ReadOnlyExits defines a struct which only has read access to Exit related methods. type ReadOnlyExits interface { - ExitBalanceToConsume() (math.Gwei, error) + ExitBalanceToConsume() (primitives.Gwei, error) EarliestExitEpoch() (primitives.Epoch, error) } @@ -219,13 +218,13 @@ type ReadOnlySyncCommittee interface { } type ReadOnlyDeposits interface { - DepositBalanceToConsume() (math.Gwei, error) + DepositBalanceToConsume() (primitives.Gwei, error) DepositReceiptsStartIndex() (uint64, error) PendingBalanceDeposits() ([]*ethpb.PendingBalanceDeposit, error) } type ReadOnlyConsolidations interface { - ConsolidationBalanceToConsume() (math.Gwei, error) + ConsolidationBalanceToConsume() (primitives.Gwei, error) EarliestConsolidationEpoch() (primitives.Epoch, error) PendingConsolidations() ([]*ethpb.PendingConsolidation, error) NumPendingConsolidations() (uint64, error) @@ -249,7 +248,7 @@ type WriteOnlyEth1Data interface { SetEth1DataVotes(val []*ethpb.Eth1Data) error AppendEth1DataVotes(val *ethpb.Eth1Data) error SetEth1DepositIndex(val uint64) error - ExitEpochAndUpdateChurn(exitBalance math.Gwei) (primitives.Epoch, error) + ExitEpochAndUpdateChurn(exitBalance primitives.Gwei) (primitives.Epoch, error) } // WriteOnlyValidators defines a struct which only has write access to validators methods. @@ -321,7 +320,7 @@ type WriteOnlyWithdrawals interface { type WriteOnlyConsolidations interface { AppendPendingConsolidation(val *ethpb.PendingConsolidation) error - SetConsolidationBalanceToConsume(math.Gwei) error + SetConsolidationBalanceToConsume(primitives.Gwei) error SetEarliestConsolidationEpoch(epoch primitives.Epoch) error SetPendingConsolidations(val []*ethpb.PendingConsolidation) error } @@ -330,5 +329,5 @@ type WriteOnlyDeposits interface { AppendPendingBalanceDeposit(index primitives.ValidatorIndex, amount uint64) error SetDepositReceiptsStartIndex(index uint64) error SetPendingBalanceDeposits(val []*ethpb.PendingBalanceDeposit) error - SetDepositBalanceToConsume(math.Gwei) error + SetDepositBalanceToConsume(primitives.Gwei) error } diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 3f8760c2a411..91dd62d471a0 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -143,7 +143,6 @@ go_test( "//container/trie:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", - "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/interop:go_default_library", diff --git a/beacon-chain/state/state-native/beacon_state_mainnet.go b/beacon-chain/state/state-native/beacon_state_mainnet.go index 4ceb16a65518..8cdcda554e6a 100644 --- a/beacon-chain/state/state-native/beacon_state_mainnet.go +++ b/beacon-chain/state/state-native/beacon_state_mainnet.go @@ -13,7 +13,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -64,10 +63,10 @@ type BeaconState struct { // Electra fields depositReceiptsStartIndex uint64 - depositBalanceToConsume math.Gwei - exitBalanceToConsume math.Gwei + depositBalanceToConsume primitives.Gwei + exitBalanceToConsume primitives.Gwei earliestExitEpoch primitives.Epoch - consolidationBalanceToConsume math.Gwei + consolidationBalanceToConsume primitives.Gwei earliestConsolidationEpoch primitives.Epoch pendingBalanceDeposits []*ethpb.PendingBalanceDeposit // pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] pendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal // pending_partial_withdrawals: List[PartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] @@ -121,10 +120,10 @@ type beaconStateMarshalable struct { NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` DepositReceiptsStartIndex uint64 `json:"deposit_receipts_start_index" yaml:"deposit_receipts_start_index"` - DepositBalanceToConsume math.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` - ExitBalanceToConsume math.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` + DepositBalanceToConsume primitives.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` + ExitBalanceToConsume primitives.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` - ConsolidationBalanceToConsume math.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` + ConsolidationBalanceToConsume primitives.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` EarliestConsolidationEpoch primitives.Epoch `json:"earliest_consolidation_epoch" yaml:"earliest_consolidation_epoch"` PendingBalanceDeposits []*ethpb.PendingBalanceDeposit `json:"pending_balance_deposits" yaml:"pending_balance_deposits"` PendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal `json:"pending_partial_withdrawals" yaml:"pending_partial_withdrawals"` diff --git a/beacon-chain/state/state-native/beacon_state_minimal.go b/beacon-chain/state/state-native/beacon_state_minimal.go index 1a5631f9cc1f..886634a90832 100644 --- a/beacon-chain/state/state-native/beacon_state_minimal.go +++ b/beacon-chain/state/state-native/beacon_state_minimal.go @@ -13,7 +13,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -64,10 +63,10 @@ type BeaconState struct { // Electra fields depositReceiptsStartIndex uint64 - depositBalanceToConsume math.Gwei - exitBalanceToConsume math.Gwei + depositBalanceToConsume primitives.Gwei + exitBalanceToConsume primitives.Gwei earliestExitEpoch primitives.Epoch - consolidationBalanceToConsume math.Gwei + consolidationBalanceToConsume primitives.Gwei earliestConsolidationEpoch primitives.Epoch pendingBalanceDeposits []*ethpb.PendingBalanceDeposit // pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] pendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal // pending_partial_withdrawals: List[PartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] @@ -121,10 +120,10 @@ type beaconStateMarshalable struct { NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` DepositReceiptsStartIndex uint64 `json:"deposit_receipts_start_index" yaml:"deposit_receipts_start_index"` - DepositBalanceToConsume math.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` - ExitBalanceToConsume math.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` + DepositBalanceToConsume primitives.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` + ExitBalanceToConsume primitives.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` - ConsolidationBalanceToConsume math.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` + ConsolidationBalanceToConsume primitives.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` EarliestConsolidationEpoch primitives.Epoch `json:"earliest_consolidation_epoch" yaml:"earliest_consolidation_epoch"` PendingBalanceDeposits []*ethpb.PendingBalanceDeposit `json:"pending_balance_deposits" yaml:"pending_balance_deposits"` PendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal `json:"pending_partial_withdrawals" yaml:"pending_partial_withdrawals"` diff --git a/beacon-chain/state/state-native/getters_balance_deposits.go b/beacon-chain/state/state-native/getters_balance_deposits.go index 900a5ece2101..e7257dd0c270 100644 --- a/beacon-chain/state/state-native/getters_balance_deposits.go +++ b/beacon-chain/state/state-native/getters_balance_deposits.go @@ -1,7 +1,7 @@ package state_native import ( - "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -9,7 +9,7 @@ import ( // DepositBalanceToConsume is a non-mutating call to the beacon state which returns the value of the // deposit balance to consume field. This method requires access to the RLock on the state and only // applies in electra or later. -func (b *BeaconState) DepositBalanceToConsume() (math.Gwei, error) { +func (b *BeaconState) DepositBalanceToConsume() (primitives.Gwei, error) { if b.version < version.Electra { return 0, errNotSupported("DepositBalanceToConsume", b.version) } diff --git a/beacon-chain/state/state-native/getters_balance_deposits_test.go b/beacon-chain/state/state-native/getters_balance_deposits_test.go index 358681e52bad..ab1738e0b754 100644 --- a/beacon-chain/state/state-native/getters_balance_deposits_test.go +++ b/beacon-chain/state/state-native/getters_balance_deposits_test.go @@ -5,7 +5,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -17,7 +16,7 @@ func TestDepositBalanceToConsume(t *testing.T) { require.NoError(t, err) dbtc, err := s.DepositBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(44), dbtc) + require.Equal(t, primitives.Gwei(44), dbtc) // Fails for older than electra state s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) diff --git a/beacon-chain/state/state-native/getters_consolidation.go b/beacon-chain/state/state-native/getters_consolidation.go index 017dde5112a4..0ec07328f5a0 100644 --- a/beacon-chain/state/state-native/getters_consolidation.go +++ b/beacon-chain/state/state-native/getters_consolidation.go @@ -2,7 +2,6 @@ package state_native import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -22,7 +21,7 @@ func (b *BeaconState) EarliestConsolidationEpoch() (primitives.Epoch, error) { // ConsolidationBalanceToConsume is a non-mutating call to the beacon state which returns the value // of the consolidation balance to consume field. This method requires access to the RLock on the // state and only applies in electra or later. -func (b *BeaconState) ConsolidationBalanceToConsume() (math.Gwei, error) { +func (b *BeaconState) ConsolidationBalanceToConsume() (primitives.Gwei, error) { if b.version < version.Electra { return 0, errNotSupported("ConsolidationBalanceToConsume", b.version) } diff --git a/beacon-chain/state/state-native/getters_consolidation_test.go b/beacon-chain/state/state-native/getters_consolidation_test.go index 6a4ec384a24b..a2e768642278 100644 --- a/beacon-chain/state/state-native/getters_consolidation_test.go +++ b/beacon-chain/state/state-native/getters_consolidation_test.go @@ -5,7 +5,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -32,7 +31,7 @@ func TestEarliestConsolidationEpoch(t *testing.T) { func TestConsolidationBalanceToConsume(t *testing.T) { t.Run("electra returns expected value", func(t *testing.T) { - want := math.Gwei(10) + want := primitives.Gwei(10) st, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ ConsolidationBalanceToConsume: want, }) diff --git a/beacon-chain/state/state-native/getters_exit.go b/beacon-chain/state/state-native/getters_exit.go index 12be6844e05c..c43ba8756b33 100644 --- a/beacon-chain/state/state-native/getters_exit.go +++ b/beacon-chain/state/state-native/getters_exit.go @@ -2,12 +2,11 @@ package state_native import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) // ExitBalanceToConsume is used for returning the ExitBalanceToConsume as part of eip 7251 -func (b *BeaconState) ExitBalanceToConsume() (math.Gwei, error) { +func (b *BeaconState) ExitBalanceToConsume() (primitives.Gwei, error) { if b.version < version.Electra { return 0, errNotSupported("ExitBalanceToConsume", b.version) } diff --git a/beacon-chain/state/state-native/getters_exit_test.go b/beacon-chain/state/state-native/getters_exit_test.go index 1e3287cd191d..cc3a0e479dcb 100644 --- a/beacon-chain/state/state-native/getters_exit_test.go +++ b/beacon-chain/state/state-native/getters_exit_test.go @@ -5,7 +5,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -18,7 +17,7 @@ func TestExitBalanceToConsume(t *testing.T) { require.ErrorContains(t, "is not supported", err) }) t.Run("electra returns expected value", func(t *testing.T) { - want := math.Gwei(2) + want := primitives.Gwei(2) dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ExitBalanceToConsume: want}) require.NoError(t, err) got, err := dState.ExitBalanceToConsume() diff --git a/beacon-chain/state/state-native/setters_balance_deposits.go b/beacon-chain/state/state-native/setters_balance_deposits.go index 9bb398b13e15..1be44219bc5a 100644 --- a/beacon-chain/state/state-native/setters_balance_deposits.go +++ b/beacon-chain/state/state-native/setters_balance_deposits.go @@ -4,7 +4,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -52,7 +51,7 @@ func (b *BeaconState) SetPendingBalanceDeposits(val []*ethpb.PendingBalanceDepos // SetDepositBalanceToConsume is a mutating call to the beacon state which sets the deposit balance // to consume value to the given value. This method requires access to the Lock on the state and // only applies in electra or later. -func (b *BeaconState) SetDepositBalanceToConsume(dbtc math.Gwei) error { +func (b *BeaconState) SetDepositBalanceToConsume(dbtc primitives.Gwei) error { if b.version < version.Electra { return errNotSupported("SetDepositBalanceToConsume", b.version) } diff --git a/beacon-chain/state/state-native/setters_balance_deposits_test.go b/beacon-chain/state/state-native/setters_balance_deposits_test.go index 7c2b201230a3..594943b712a9 100644 --- a/beacon-chain/state/state-native/setters_balance_deposits_test.go +++ b/beacon-chain/state/state-native/setters_balance_deposits_test.go @@ -5,7 +5,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -52,7 +51,7 @@ func TestSetDepositBalanceToConsume(t *testing.T) { require.NoError(t, s.SetDepositBalanceToConsume(10)) dbtc, err := s.DepositBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(10), dbtc) + require.Equal(t, primitives.Gwei(10), dbtc) // Fails for versions older than electra s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) diff --git a/beacon-chain/state/state-native/setters_churn.go b/beacon-chain/state/state-native/setters_churn.go index bf7e67602a01..fdcf547fdcd1 100644 --- a/beacon-chain/state/state-native/setters_churn.go +++ b/beacon-chain/state/state-native/setters_churn.go @@ -4,7 +4,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -34,7 +33,7 @@ import ( // state.earliest_exit_epoch = earliest_exit_epoch // // return state.earliest_exit_epoch -func (b *BeaconState) ExitEpochAndUpdateChurn(exitBalance math.Gwei) (primitives.Epoch, error) { +func (b *BeaconState) ExitEpochAndUpdateChurn(exitBalance primitives.Gwei) (primitives.Epoch, error) { if b.version < version.Electra { return 0, errNotSupported("ExitEpochAndUpdateChurn", b.version) } @@ -49,10 +48,10 @@ func (b *BeaconState) ExitEpochAndUpdateChurn(exitBalance math.Gwei) (primitives defer b.lock.Unlock() earliestExitEpoch := max(b.earliestExitEpoch, helpers.ActivationExitEpoch(slots.ToEpoch(b.slot))) - perEpochChurn := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) // Guaranteed to be non-zero. + perEpochChurn := helpers.ActivationExitChurnLimit(primitives.Gwei(activeBal)) // Guaranteed to be non-zero. // New epoch for exits - var exitBalanceToConsume math.Gwei + var exitBalanceToConsume primitives.Gwei if b.earliestExitEpoch < earliestExitEpoch { exitBalanceToConsume = perEpochChurn } else { @@ -64,7 +63,7 @@ func (b *BeaconState) ExitEpochAndUpdateChurn(exitBalance math.Gwei) (primitives balanceToProcess := exitBalance - exitBalanceToConsume additionalEpochs := primitives.Epoch((balanceToProcess-1)/perEpochChurn + 1) earliestExitEpoch += additionalEpochs - exitBalanceToConsume += math.Gwei(additionalEpochs) * perEpochChurn + exitBalanceToConsume += primitives.Gwei(additionalEpochs) * perEpochChurn } // Consume the balance and update state variables. diff --git a/beacon-chain/state/state-native/setters_churn_test.go b/beacon-chain/state/state-native/setters_churn_test.go index 2aa98382c473..397932023d3b 100644 --- a/beacon-chain/state/state-native/setters_churn_test.go +++ b/beacon-chain/state/state-native/setters_churn_test.go @@ -8,7 +8,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -30,7 +29,7 @@ func TestExitEpochAndUpdateChurn_SpectestCase(t *testing.T) { val, err := s.ValidatorAtIndex(0) require.NoError(t, err) - ee, err := s.ExitEpochAndUpdateChurn(math.Gwei(val.EffectiveBalance)) + ee, err := s.ExitEpochAndUpdateChurn(primitives.Gwei(val.EffectiveBalance)) require.NoError(t, err) require.Equal(t, primitives.Epoch(262), ee) @@ -39,7 +38,7 @@ func TestExitEpochAndUpdateChurn_SpectestCase(t *testing.T) { if !ok { t.Fatal("wrong proto") } - require.Equal(t, math.Gwei(127000000000), pb.ExitBalanceToConsume) + require.Equal(t, primitives.Gwei(127000000000), pb.ExitBalanceToConsume) require.Equal(t, primitives.Epoch(262), pb.EarliestExitEpoch) // Fails for versions older than electra @@ -62,15 +61,15 @@ func TestExitEpochAndUpdateChurn(t *testing.T) { }, Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, EarliestExitEpoch: epoch - params.BeaconConfig().MaxSeedLookahead*2, // Old, relative to slot. - ExitBalanceToConsume: math.Gwei(20_000_000), + ExitBalanceToConsume: primitives.Gwei(20_000_000), }) require.NoError(t, err) activeBal, err := helpers.TotalActiveBalance(st) require.NoError(t, err) - exitBal := math.Gwei(10_000_000) + exitBal := primitives.Gwei(10_000_000) - wantExitBalToConsume := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) - exitBal + wantExitBalToConsume := helpers.ActivationExitChurnLimit(primitives.Gwei(activeBal)) - exitBal ee, err := st.ExitEpochAndUpdateChurn(exitBal) require.NoError(t, err) @@ -97,16 +96,16 @@ func TestExitEpochAndUpdateChurn(t *testing.T) { }, Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, EarliestExitEpoch: epoch, - ExitBalanceToConsume: math.Gwei(20_000_000), + ExitBalanceToConsume: primitives.Gwei(20_000_000), }) require.NoError(t, err) activeBal, err := helpers.TotalActiveBalance(st) require.NoError(t, err) - activationExitChurnLimit := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) + activationExitChurnLimit := helpers.ActivationExitChurnLimit(primitives.Gwei(activeBal)) exitBal := activationExitChurnLimit * 2 - wantExitBalToConsume := math.Gwei(0) + wantExitBalToConsume := primitives.Gwei(0) ee, err := st.ExitEpochAndUpdateChurn(exitBal) require.NoError(t, err) @@ -133,13 +132,13 @@ func TestExitEpochAndUpdateChurn(t *testing.T) { }, Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, EarliestExitEpoch: epoch + 10_000, - ExitBalanceToConsume: math.Gwei(20_000_000), + ExitBalanceToConsume: primitives.Gwei(20_000_000), }) require.NoError(t, err) - exitBal := math.Gwei(10_000_000) + exitBal := primitives.Gwei(10_000_000) - wantExitBalToConsume := math.Gwei(20_000_000) - exitBal + wantExitBalToConsume := primitives.Gwei(20_000_000) - exitBal ee, err := st.ExitEpochAndUpdateChurn(exitBal) require.NoError(t, err) @@ -166,14 +165,14 @@ func TestExitEpochAndUpdateChurn(t *testing.T) { }, Balances: []uint64{params.BeaconConfig().MaxEffectiveBalanceElectra}, EarliestExitEpoch: epoch + 10_000, - ExitBalanceToConsume: math.Gwei(20_000_000), + ExitBalanceToConsume: primitives.Gwei(20_000_000), }) require.NoError(t, err) - exitBal := math.Gwei(40_000_000) + exitBal := primitives.Gwei(40_000_000) activeBal, err := helpers.TotalActiveBalance(st) require.NoError(t, err) - activationExitChurnLimit := helpers.ActivationExitChurnLimit(math.Gwei(activeBal)) + activationExitChurnLimit := helpers.ActivationExitChurnLimit(primitives.Gwei(activeBal)) wantExitBalToConsume := activationExitChurnLimit - 20_000_000 ee, err := st.ExitEpochAndUpdateChurn(exitBal) diff --git a/beacon-chain/state/state-native/setters_consolidation.go b/beacon-chain/state/state-native/setters_consolidation.go index c76e1ae5c091..525230578f0a 100644 --- a/beacon-chain/state/state-native/setters_consolidation.go +++ b/beacon-chain/state/state-native/setters_consolidation.go @@ -4,7 +4,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -69,7 +68,7 @@ func (b *BeaconState) SetEarliestConsolidationEpoch(epoch primitives.Epoch) erro // SetConsolidationBalanceToConsume is a mutating call to the beacon state which sets the value of // the consolidation balance to consume to the provided value. This method requires access to the // Lock on the state and only applies in electra or later. -func (b *BeaconState) SetConsolidationBalanceToConsume(balance math.Gwei) error { +func (b *BeaconState) SetConsolidationBalanceToConsume(balance primitives.Gwei) error { if b.version < version.Electra { return errNotSupported("SetConsolidationBalanceToConsume", b.version) } diff --git a/beacon-chain/state/state-native/setters_consolidation_test.go b/beacon-chain/state/state-native/setters_consolidation_test.go index 1a2ee153cef4..af8ced0ea22b 100644 --- a/beacon-chain/state/state-native/setters_consolidation_test.go +++ b/beacon-chain/state/state-native/setters_consolidation_test.go @@ -5,7 +5,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -67,7 +66,7 @@ func TestSetConsolidationBalanceToConsume(t *testing.T) { require.NoError(t, s.SetConsolidationBalanceToConsume(10)) cbtc, err := s.ConsolidationBalanceToConsume() require.NoError(t, err) - require.Equal(t, math.Gwei(10), cbtc) + require.Equal(t, primitives.Gwei(10), cbtc) // Fails for versions older than electra s, err = state_native.InitializeFromProtoDeneb(ð.BeaconStateDeneb{}) diff --git a/consensus-types/blocks/BUILD.bazel b/consensus-types/blocks/BUILD.bazel index feda65d199ba..d56c464ac30e 100644 --- a/consensus-types/blocks/BUILD.bazel +++ b/consensus-types/blocks/BUILD.bazel @@ -24,7 +24,6 @@ go_library( "//container/trie:go_default_library", "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", - "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index 08cc5aeabf6d..13e3905e698b 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -9,9 +9,9 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "google.golang.org/protobuf/proto" ) @@ -24,7 +24,7 @@ type executionPayload struct { } // NewWrappedExecutionData creates an appropriate execution payload wrapper based on the incoming type. -func NewWrappedExecutionData(v proto.Message, weiValue math.Wei) (interfaces.ExecutionData, error) { +func NewWrappedExecutionData(v proto.Message, weiValue primitives.Wei) (interfaces.ExecutionData, error) { if weiValue == nil { weiValue = new(big.Int).SetInt64(0) } @@ -194,7 +194,7 @@ func (e executionPayload) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (executionPayload) ValueInWei() (math.Wei, error) { +func (executionPayload) ValueInWei() (primitives.Wei, error) { return nil, consensus_types.ErrUnsupportedField } @@ -362,7 +362,7 @@ func (e executionPayloadHeader) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (executionPayloadHeader) ValueInWei() (math.Wei, error) { +func (executionPayloadHeader) ValueInWei() (primitives.Wei, error) { return nil, consensus_types.ErrUnsupportedField } @@ -404,15 +404,15 @@ func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPaylo // blocks for future forks can also be applied across Prysm without issues. type executionPayloadCapella struct { p *enginev1.ExecutionPayloadCapella - weiValue math.Wei + weiValue primitives.Wei gweiValue uint64 } var _ interfaces.ExecutionData = &executionPayloadCapella{} // WrappedExecutionPayloadCapella is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadCapella(p *enginev1.ExecutionPayloadCapella, value math.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadCapella{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} +func WrappedExecutionPayloadCapella(p *enginev1.ExecutionPayloadCapella, value primitives.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadCapella{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -560,7 +560,7 @@ func (e executionPayloadCapella) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (e executionPayloadCapella) ValueInWei() (math.Wei, error) { +func (e executionPayloadCapella) ValueInWei() (primitives.Wei, error) { return e.weiValue, nil } @@ -574,15 +574,15 @@ func (e executionPayloadCapella) ValueInGwei() (uint64, error) { // blocks for future forks can also be applied across Prysm without issues. type executionPayloadHeaderCapella struct { p *enginev1.ExecutionPayloadHeaderCapella - weiValue math.Wei + weiValue primitives.Wei gweiValue uint64 } var _ interfaces.ExecutionData = &executionPayloadHeaderCapella{} // WrappedExecutionPayloadHeaderCapella is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderCapella(p *enginev1.ExecutionPayloadHeaderCapella, value math.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderCapella{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} +func WrappedExecutionPayloadHeaderCapella(p *enginev1.ExecutionPayloadHeaderCapella, value primitives.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderCapella{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -730,7 +730,7 @@ func (e executionPayloadHeaderCapella) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (e executionPayloadHeaderCapella) ValueInWei() (math.Wei, error) { +func (e executionPayloadHeaderCapella) ValueInWei() (primitives.Wei, error) { return e.weiValue, nil } @@ -966,15 +966,15 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { // blocks for future forks can also be applied across Prysm without issues. type executionPayloadHeaderDeneb struct { p *enginev1.ExecutionPayloadHeaderDeneb - weiValue math.Wei + weiValue primitives.Wei gweiValue uint64 } var _ interfaces.ExecutionData = &executionPayloadHeaderDeneb{} // WrappedExecutionPayloadHeaderDeneb is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb, value math.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderDeneb{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} +func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb, value primitives.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderDeneb{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1117,7 +1117,7 @@ func (e executionPayloadHeaderDeneb) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (e executionPayloadHeaderDeneb) ValueInWei() (math.Wei, error) { +func (e executionPayloadHeaderDeneb) ValueInWei() (primitives.Wei, error) { return e.weiValue, nil } @@ -1136,15 +1136,15 @@ func (e executionPayloadHeaderDeneb) IsBlinded() bool { // blocks for future forks can also be applied across Prysm without issues. type executionPayloadDeneb struct { p *enginev1.ExecutionPayloadDeneb - weiValue math.Wei + weiValue primitives.Wei gweiValue uint64 } var _ interfaces.ExecutionData = &executionPayloadDeneb{} // WrappedExecutionPayloadDeneb is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb, value math.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadDeneb{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} +func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb, value primitives.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadDeneb{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1285,7 +1285,7 @@ func (e executionPayloadDeneb) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (e executionPayloadDeneb) ValueInWei() (math.Wei, error) { +func (e executionPayloadDeneb) ValueInWei() (primitives.Wei, error) { return e.weiValue, nil } @@ -1304,7 +1304,7 @@ func (e executionPayloadDeneb) IsBlinded() bool { // blocks for future forks can also be applied across Prysm without issues. type executionPayloadHeaderElectra struct { p *enginev1.ExecutionPayloadHeaderElectra - weiValue math.Wei + weiValue primitives.Wei gweiValue uint64 } @@ -1312,8 +1312,8 @@ var _ interfaces.ExecutionData = &executionPayloadElectra{} var _ interfaces.ExecutionDataElectra = &executionPayloadElectra{} // WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra, value math.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} +func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra, value primitives.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderElectra{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1456,7 +1456,7 @@ func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (e executionPayloadHeaderElectra) ValueInWei() (math.Wei, error) { +func (e executionPayloadHeaderElectra) ValueInWei() (primitives.Wei, error) { return e.weiValue, nil } @@ -1485,13 +1485,13 @@ func (e executionPayloadHeaderElectra) IsBlinded() bool { // blocks for future forks can also be applied across Prysm without issues. type executionPayloadElectra struct { p *enginev1.ExecutionPayloadElectra - weiValue math.Wei + weiValue primitives.Wei gweiValue uint64 } // WrappedExecutionPayloadElectra is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra, value math.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} +func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra, value primitives.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadElectra{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1635,7 +1635,7 @@ func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { } // ValueInWei -- -func (e executionPayloadElectra) ValueInWei() (math.Wei, error) { +func (e executionPayloadElectra) ValueInWei() (primitives.Wei, error) { return e.weiValue, nil } @@ -1660,14 +1660,14 @@ func (e executionPayloadElectra) IsBlinded() bool { } // PayloadValueToWei returns a Wei value given the payload's value -func PayloadValueToWei(value []byte) math.Wei { +func PayloadValueToWei(value []byte) primitives.Wei { // We have to convert big endian to little endian because the value is coming from the execution layer. return big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(value)) } // PayloadValueToGwei returns a Gwei value given the payload's value -func PayloadValueToGwei(value []byte) math.Gwei { +func PayloadValueToGwei(value []byte) primitives.Gwei { // We have to convert big endian to little endian because the value is coming from the execution layer. v := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(value)) - return math.WeiToGwei(v) + return primitives.WeiToGwei(v) } diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 369f972d42ab..1c42187bd727 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -10,7 +10,6 @@ import ( consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" @@ -329,7 +328,7 @@ func (b *SignedBeaconBlock) IsBlinded() bool { } // ValueInWei metadata on the payload value returned by the builder. -func (b *SignedBeaconBlock) ValueInWei() math.Wei { +func (b *SignedBeaconBlock) ValueInWei() primitives.Wei { exec, err := b.block.body.Execution() if err != nil { if !errors.Is(err, consensus_types.ErrUnsupportedField) { diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index 84e8be9f0d4b..3a20551c7d68 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -14,7 +14,6 @@ go_library( deps = [ "//config/fieldparams:go_default_library", "//consensus-types/primitives:go_default_library", - "//math:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 3eae02c6956f..a852c683e0b6 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -6,7 +6,6 @@ import ( "github.com/prysmaticlabs/go-bitfield" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" @@ -29,7 +28,7 @@ type ReadOnlySignedBeaconBlock interface { ssz.Unmarshaler Version() int IsBlinded() bool - ValueInWei() math.Wei + ValueInWei() primitives.Wei ValueInGwei() uint64 Header() (*ethpb.SignedBeaconBlockHeader, error) } @@ -130,7 +129,7 @@ type ExecutionData interface { TransactionsRoot() ([]byte, error) Withdrawals() ([]*enginev1.Withdrawal, error) WithdrawalsRoot() ([]byte, error) - ValueInWei() (math.Wei, error) + ValueInWei() (primitives.Wei, error) ValueInGwei() (uint64, error) } diff --git a/consensus-types/mock/BUILD.bazel b/consensus-types/mock/BUILD.bazel index a76b14edad33..b37f4f30d51d 100644 --- a/consensus-types/mock/BUILD.bazel +++ b/consensus-types/mock/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "//config/fieldparams:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", - "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index 846eb42618bf..e13e09be20b2 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -5,7 +5,6 @@ import ( field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "google.golang.org/protobuf/proto" @@ -75,7 +74,7 @@ func (SignedBeaconBlock) Header() (*eth.SignedBeaconBlockHeader, error) { panic("implement me") } -func (SignedBeaconBlock) ValueInWei() math.Wei { +func (SignedBeaconBlock) ValueInWei() primitives.Wei { panic("implement me") } diff --git a/consensus-types/primitives/BUILD.bazel b/consensus-types/primitives/BUILD.bazel index ff6752a194e9..10ddde9c7346 100644 --- a/consensus-types/primitives/BUILD.bazel +++ b/consensus-types/primitives/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "sszbytes.go", "sszuint64.go", "validator.go", + "wei.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives", visibility = ["//visibility:public"], @@ -32,6 +33,7 @@ go_test( "sszbytes_test.go", "sszuint64_test.go", "validator_test.go", + "wei_test.go", ], embed = [":go_default_library"], deps = [ diff --git a/consensus-types/primitives/wei.go b/consensus-types/primitives/wei.go new file mode 100644 index 000000000000..8bcee0130899 --- /dev/null +++ b/consensus-types/primitives/wei.go @@ -0,0 +1,93 @@ +package primitives + +import ( + "fmt" + "math/big" + "slices" + + fssz "github.com/prysmaticlabs/fastssz" +) + +// ZeroWei is a non-nil zero value for primitives.Wei +var ZeroWei Wei = big.NewInt(0) + +// Wei is the smallest unit of Ether, represented as a pointer to a bigInt. +type Wei *big.Int + +// Gwei is a denomination of 1e9 Wei represented as an uint64. +type Gwei uint64 + +var _ fssz.HashRoot = (Gwei)(0) +var _ fssz.Marshaler = (*Gwei)(nil) +var _ fssz.Unmarshaler = (*Gwei)(nil) + +// HashTreeRoot -- +func (g Gwei) HashTreeRoot() ([32]byte, error) { + return fssz.HashWithDefaultHasher(g) +} + +// HashTreeRootWith -- +func (g Gwei) HashTreeRootWith(hh *fssz.Hasher) error { + hh.PutUint64(uint64(g)) + return nil +} + +// UnmarshalSSZ -- +func (g *Gwei) UnmarshalSSZ(buf []byte) error { + if len(buf) != g.SizeSSZ() { + return fmt.Errorf("expected buffer of length %d received %d", g.SizeSSZ(), len(buf)) + } + *g = Gwei(fssz.UnmarshallUint64(buf)) + return nil +} + +// MarshalSSZTo -- +func (g *Gwei) MarshalSSZTo(dst []byte) ([]byte, error) { + marshalled, err := g.MarshalSSZ() + if err != nil { + return nil, err + } + return append(dst, marshalled...), nil +} + +// MarshalSSZ -- +func (g *Gwei) MarshalSSZ() ([]byte, error) { + marshalled := fssz.MarshalUint64([]byte{}, uint64(*g)) + return marshalled, nil +} + +// SizeSSZ -- +func (g *Gwei) SizeSSZ() int { + return 8 +} + +// WeiToBigInt is a convenience method to cast a wei back to a big int +func WeiToBigInt(w Wei) *big.Int { + return w +} + +// Uint64ToWei creates a new Wei (aka big.Int) representing the given uint64 value. +func Uint64ToWei(v uint64) Wei { + return big.NewInt(0).SetUint64(v) +} + +// BigEndianBytesToWei returns a Wei value given a big-endian binary representation (eg engine api payload bids). +func BigEndianBytesToWei(value []byte) Wei { + v := make([]byte, len(value)) + copy(v, value) + slices.Reverse(v) + // We have to convert big endian to little endian because the value is coming from the execution layer. + return big.NewInt(0).SetBytes(v) +} + +// WeiToGwei converts big int wei to uint64 gwei. +// The input `v` is copied before being modified. +func WeiToGwei(v Wei) Gwei { + if v == nil { + return 0 + } + gweiPerEth := big.NewInt(1e9) + copied := big.NewInt(0).Set(v) + copied.Div(copied, gweiPerEth) + return Gwei(copied.Uint64()) +} diff --git a/consensus-types/primitives/wei_test.go b/consensus-types/primitives/wei_test.go new file mode 100644 index 000000000000..dd9ff308aeaf --- /dev/null +++ b/consensus-types/primitives/wei_test.go @@ -0,0 +1,41 @@ +package primitives_test + +import ( + "math" + "math/big" + "testing" + + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestWeiStringer(t *testing.T) { + require.Equal(t, "0", primitives.WeiToBigInt(primitives.ZeroWei).String()) + require.Equal(t, "1234", primitives.WeiToBigInt(primitives.Uint64ToWei(1234)).String()) + require.Equal(t, "18446744073709551615", primitives.WeiToBigInt(primitives.Uint64ToWei(math.MaxUint64)).String()) +} + +func TestWeiToGwei(t *testing.T) { + tests := []struct { + v *big.Int + want primitives.Gwei + }{ + {big.NewInt(1e9 - 1), 0}, + {big.NewInt(1e9), 1}, + {big.NewInt(1e10), 10}, + {big.NewInt(239489233849348394), 239489233}, + } + for _, tt := range tests { + if got := primitives.WeiToGwei(tt.v); got != tt.want { + t.Errorf("WeiToGwei() = %v, want %v", got, tt.want) + } + } +} + +func TestWeiToGwei_CopyOk(t *testing.T) { + v := big.NewInt(1e9) + got := primitives.WeiToGwei(v) + + require.Equal(t, primitives.Gwei(1), got) + require.Equal(t, big.NewInt(1e9).Uint64(), v.Uint64()) +} diff --git a/encoding/ssz/equality/BUILD.bazel b/encoding/ssz/equality/BUILD.bazel index 0e023a0463ed..4c67be0035a1 100644 --- a/encoding/ssz/equality/BUILD.bazel +++ b/encoding/ssz/equality/BUILD.bazel @@ -7,7 +7,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//consensus-types/primitives:go_default_library", - "//math:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/encoding/ssz/equality/deep_equal.go b/encoding/ssz/equality/deep_equal.go index 9c52d8475a8f..e0216a11c54e 100644 --- a/encoding/ssz/equality/deep_equal.go +++ b/encoding/ssz/equality/deep_equal.go @@ -5,7 +5,6 @@ import ( "unsafe" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" "google.golang.org/protobuf/proto" ) @@ -232,7 +231,7 @@ func deepValueBaseTypeEqual(v1, v2 reflect.Value) bool { case "CommitteeIndex": return v1.Interface().(primitives.CommitteeIndex) == v2.Interface().(primitives.CommitteeIndex) case "Gwei": - return v1.Interface().(math.Gwei) == v2.Interface().(math.Gwei) + return v1.Interface().(primitives.Gwei) == v2.Interface().(primitives.Gwei) } return v1.Interface().(uint64) == v2.Interface().(uint64) case reflect.Uint32: diff --git a/math/BUILD.bazel b/math/BUILD.bazel index 39964b0712c7..fac6ee3ab7a0 100644 --- a/math/BUILD.bazel +++ b/math/BUILD.bazel @@ -5,10 +5,7 @@ go_library( srcs = ["math_helper.go"], importpath = "github.com/prysmaticlabs/prysm/v5/math", visibility = ["//visibility:public"], - deps = [ - "@com_github_prysmaticlabs_fastssz//:go_default_library", - "@com_github_thomaso_mirodin_intmath//u64:go_default_library", - ], + deps = ["@com_github_thomaso_mirodin_intmath//u64:go_default_library"], ) go_test( @@ -17,6 +14,7 @@ go_test( srcs = ["math_helper_test.go"], deps = [ ":go_default_library", + "//consensus-types/primitives:go_default_library", "//testing/require:go_default_library", ], ) diff --git a/math/math_helper.go b/math/math_helper.go index d926a3db750e..e4a59e21d6f0 100644 --- a/math/math_helper.go +++ b/math/math_helper.go @@ -3,13 +3,11 @@ package math import ( "errors" - "fmt" stdmath "math" "math/big" "math/bits" "sync" - fssz "github.com/prysmaticlabs/fastssz" "github.com/thomaso-mirodin/intmath/u64" ) @@ -215,68 +213,6 @@ func AddInt(i ...int) (int, error) { return sum, nil } -// Wei is the smallest unit of Ether, represented as a pointer to a bigInt. -type Wei *big.Int - -var _ fssz.HashRoot = (Gwei)(0) -var _ fssz.Marshaler = (*Gwei)(nil) -var _ fssz.Unmarshaler = (*Gwei)(nil) - -// Gwei is a denomination of 1e9 Wei represented as an uint64. -type Gwei uint64 - -// HashTreeRoot -- -func (g Gwei) HashTreeRoot() ([32]byte, error) { - return fssz.HashWithDefaultHasher(g) -} - -// HashTreeRootWith -- -func (g Gwei) HashTreeRootWith(hh *fssz.Hasher) error { - hh.PutUint64(uint64(g)) - return nil -} - -// UnmarshalSSZ -- -func (g *Gwei) UnmarshalSSZ(buf []byte) error { - if len(buf) != g.SizeSSZ() { - return fmt.Errorf("expected buffer of length %d received %d", g.SizeSSZ(), len(buf)) - } - *g = Gwei(fssz.UnmarshallUint64(buf)) - return nil -} - -// MarshalSSZTo -- -func (g *Gwei) MarshalSSZTo(dst []byte) ([]byte, error) { - marshalled, err := g.MarshalSSZ() - if err != nil { - return nil, err - } - return append(dst, marshalled...), nil -} - -// MarshalSSZ -- -func (g *Gwei) MarshalSSZ() ([]byte, error) { - marshalled := fssz.MarshalUint64([]byte{}, uint64(*g)) - return marshalled, nil -} - -// SizeSSZ -- -func (g *Gwei) SizeSSZ() int { - return 8 -} - -// WeiToGwei converts big int wei to uint64 gwei. -// The input `v` is copied before being modified. -func WeiToGwei(v Wei) Gwei { - if v == nil { - return 0 - } - gweiPerEth := big.NewInt(1e9) - copied := big.NewInt(0).Set(v) - copied.Div(copied, gweiPerEth) - return Gwei(copied.Uint64()) -} - // IsValidUint256 given a bigint checks if the value is a valid Uint256 func IsValidUint256(bi *big.Int) bool { return bi.Cmp(big.NewInt(0)) >= 0 && bi.BitLen() <= 256 diff --git a/math/math_helper_test.go b/math/math_helper_test.go index 6419ff503e35..64243a694724 100644 --- a/math/math_helper_test.go +++ b/math/math_helper_test.go @@ -6,6 +6,7 @@ import ( "math/big" "testing" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -554,7 +555,7 @@ func TestAddInt(t *testing.T) { func TestWeiToGwei(t *testing.T) { tests := []struct { v *big.Int - want math.Gwei + want primitives.Gwei }{ {big.NewInt(1e9 - 1), 0}, {big.NewInt(1e9), 1}, @@ -562,7 +563,7 @@ func TestWeiToGwei(t *testing.T) { {big.NewInt(239489233849348394), 239489233}, } for _, tt := range tests { - if got := math.WeiToGwei(tt.v); got != tt.want { + if got := primitives.WeiToGwei(tt.v); got != tt.want { t.Errorf("WeiToGwei() = %v, want %v", got, tt.want) } } @@ -570,8 +571,8 @@ func TestWeiToGwei(t *testing.T) { func TestWeiToGwei_CopyOk(t *testing.T) { v := big.NewInt(1e9) - got := math.WeiToGwei(v) + got := primitives.WeiToGwei(v) - require.Equal(t, math.Gwei(1), got) + require.Equal(t, primitives.Gwei(1), got) require.Equal(t, big.NewInt(1e9).Uint64(), v.Uint64()) } diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index 9e8cfc3999b7..01daabe6c0ab 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: a13be0354388a9ab681c78ee577580c9aebbd6d3d17024084c06c839c5db58ee +// Hash: 2874e1dadeb47411763f48fe31e5daaa91ac663e796933d9a508c2e7be94fa5e package v1 import ( diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index b91d3b7aa5d5..29dcf6d09da2 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 +// Hash: 2755944d1f9b0e6e8b7e58d3cbba1d6028bbbb740ec05f5de43137d5b5459411 package eth import ( diff --git a/proto/prysm/v1alpha1/beacon_state.pb.go b/proto/prysm/v1alpha1/beacon_state.pb.go index aac6093e1d11..8a01977e8ee7 100755 --- a/proto/prysm/v1alpha1/beacon_state.pb.go +++ b/proto/prysm/v1alpha1/beacon_state.pb.go @@ -12,7 +12,6 @@ import ( github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - github_com_prysmaticlabs_prysm_v5_math "github.com/prysmaticlabs/prysm/v5/math" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -1869,10 +1868,10 @@ type BeaconStateElectra struct { NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` DepositReceiptsStartIndex uint64 `protobuf:"varint,12001,opt,name=deposit_receipts_start_index,json=depositReceiptsStartIndex,proto3" json:"deposit_receipts_start_index,omitempty"` - DepositBalanceToConsume github_com_prysmaticlabs_prysm_v5_math.Gwei `protobuf:"varint,12002,opt,name=deposit_balance_to_consume,json=depositBalanceToConsume,proto3" json:"deposit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/math.Gwei"` - ExitBalanceToConsume github_com_prysmaticlabs_prysm_v5_math.Gwei `protobuf:"varint,12003,opt,name=exit_balance_to_consume,json=exitBalanceToConsume,proto3" json:"exit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/math.Gwei"` + DepositBalanceToConsume github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei `protobuf:"varint,12002,opt,name=deposit_balance_to_consume,json=depositBalanceToConsume,proto3" json:"deposit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"` + ExitBalanceToConsume github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei `protobuf:"varint,12003,opt,name=exit_balance_to_consume,json=exitBalanceToConsume,proto3" json:"exit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"` EarliestExitEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12004,opt,name=earliest_exit_epoch,json=earliestExitEpoch,proto3" json:"earliest_exit_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` - ConsolidationBalanceToConsume github_com_prysmaticlabs_prysm_v5_math.Gwei `protobuf:"varint,12005,opt,name=consolidation_balance_to_consume,json=consolidationBalanceToConsume,proto3" json:"consolidation_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/math.Gwei"` + ConsolidationBalanceToConsume github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei `protobuf:"varint,12005,opt,name=consolidation_balance_to_consume,json=consolidationBalanceToConsume,proto3" json:"consolidation_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"` EarliestConsolidationEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12006,opt,name=earliest_consolidation_epoch,json=earliestConsolidationEpoch,proto3" json:"earliest_consolidation_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` PendingBalanceDeposits []*PendingBalanceDeposit `protobuf:"bytes,12007,rep,name=pending_balance_deposits,json=pendingBalanceDeposits,proto3" json:"pending_balance_deposits,omitempty" ssz-max:"134217728"` PendingPartialWithdrawals []*PendingPartialWithdrawal `protobuf:"bytes,12008,rep,name=pending_partial_withdrawals,json=pendingPartialWithdrawals,proto3" json:"pending_partial_withdrawals,omitempty" ssz-max:"134217728"` @@ -2114,18 +2113,18 @@ func (x *BeaconStateElectra) GetDepositReceiptsStartIndex() uint64 { return 0 } -func (x *BeaconStateElectra) GetDepositBalanceToConsume() github_com_prysmaticlabs_prysm_v5_math.Gwei { +func (x *BeaconStateElectra) GetDepositBalanceToConsume() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei { if x != nil { return x.DepositBalanceToConsume } - return github_com_prysmaticlabs_prysm_v5_math.Gwei(0) + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(0) } -func (x *BeaconStateElectra) GetExitBalanceToConsume() github_com_prysmaticlabs_prysm_v5_math.Gwei { +func (x *BeaconStateElectra) GetExitBalanceToConsume() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei { if x != nil { return x.ExitBalanceToConsume } - return github_com_prysmaticlabs_prysm_v5_math.Gwei(0) + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(0) } func (x *BeaconStateElectra) GetEarliestExitEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -2135,11 +2134,11 @@ func (x *BeaconStateElectra) GetEarliestExitEpoch() github_com_prysmaticlabs_pry return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) } -func (x *BeaconStateElectra) GetConsolidationBalanceToConsume() github_com_prysmaticlabs_prysm_v5_math.Gwei { +func (x *BeaconStateElectra) GetConsolidationBalanceToConsume() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei { if x != nil { return x.ConsolidationBalanceToConsume } - return github_com_prysmaticlabs_prysm_v5_math.Gwei(0) + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(0) } func (x *BeaconStateElectra) GetEarliestConsolidationEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -3011,7 +3010,7 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x69, 0x65, 0x73, 0x22, 0x8d, 0x19, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x72, 0x69, 0x65, 0x73, 0x22, 0xd1, 0x19, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, @@ -3152,94 +3151,98 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x69, 0x70, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x6d, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, - 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x2f, 0x82, 0xb5, 0x18, 0x2b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, - 0x65, 0x12, 0x67, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x2f, 0x82, 0xb5, 0x18, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x47, 0x77, 0x65, 0x69, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, - 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0xe4, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x65, 0x78, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x52, 0x11, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x79, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, - 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x2f, - 0x82, 0xb5, 0x18, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, - 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x89, - 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0xe6, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, - 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, 0x0a, 0x18, 0x70, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x0d, 0x92, 0xb5, 0x18, - 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, 0x70, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x73, 0x18, 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, + 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, + 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x7d, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, + 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, + 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, + 0x69, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, + 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, + 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe4, + 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x65, + 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x8f, 0x01, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, + 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, + 0x77, 0x65, 0x69, 0x52, 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, + 0x6d, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, + 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0xe6, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x1a, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, + 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, + 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, + 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, + 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xe9, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, - 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, - 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x5d, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, - 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, - 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, - 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, - 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, + 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, + 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, + 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, + 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, + 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index f4bc57e2ce1d..dd38eebd201a 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -397,10 +397,10 @@ message BeaconStateElectra { // Fields introduced in EIP-7251 fork [12001-13000] uint64 deposit_receipts_start_index = 12001; - uint64 deposit_balance_to_consume = 12002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/math.Gwei"]; - uint64 exit_balance_to_consume = 12003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/math.Gwei"]; + uint64 deposit_balance_to_consume = 12002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"]; + uint64 exit_balance_to_consume = 12003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"]; uint64 earliest_exit_epoch = 12004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; - uint64 consolidation_balance_to_consume = 12005 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/math.Gwei"]; + uint64 consolidation_balance_to_consume = 12005 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"]; uint64 earliest_consolidation_epoch = 12006 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; repeated PendingBalanceDeposit pending_balance_deposits = 12007 [(ethereum.eth.ext.ssz_max) = "pending_balance_deposits_limit"]; repeated PendingPartialWithdrawal pending_partial_withdrawals = 12008 [(ethereum.eth.ext.ssz_max) = "pending_partial_withdrawals_limit"]; diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index 9d201ba3218e..50b0fb52dc8a 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,11 +1,10 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 5d2c5eb257aa9cd0f12fd74f707963c8e7f779fbef26d0031f6ae18e9b1ee124 +// Hash: 75d48d13b4efa7867468bae2df70b80e9606b9a44e621915d2093a4f20ae111f package eth import ( ssz "github.com/prysmaticlabs/fastssz" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - github_com_prysmaticlabs_prysm_v5_math "github.com/prysmaticlabs/prysm/v5/math" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ) @@ -17980,16 +17979,16 @@ func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { b.DepositReceiptsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) // Field (29) 'DepositBalanceToConsume' - b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_math.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) + b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) // Field (30) 'ExitBalanceToConsume' - b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_math.Gwei(ssz.UnmarshallUint64(buf[2736669:2736677])) + b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736669:2736677])) // Field (31) 'EarliestExitEpoch' b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736677:2736685])) // Field (32) 'ConsolidationBalanceToConsume' - b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_math.Gwei(ssz.UnmarshallUint64(buf[2736685:2736693])) + b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736685:2736693])) // Field (33) 'EarliestConsolidationEpoch' b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736693:2736701])) diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index 342cfae44b29..0f37ce9b7437 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -26,7 +26,7 @@ go_library( "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", - "//math:go_default_library", + "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go b/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go index fbd3714cde54..89a734373199 100644 --- a/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go +++ b/testing/spectest/shared/electra/epoch_processing/pending_balance_updates.go @@ -8,7 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -31,5 +31,5 @@ func processPendingBalanceDeposits(t *testing.T, st state.BeaconState) (state.Be // balance from the given state. tab, err := helpers.TotalActiveBalance(st) require.NoError(t, err) - return st, electra.ProcessPendingBalanceDeposits(context.TODO(), st, math.Gwei(tab)) + return st, electra.ProcessPendingBalanceDeposits(context.TODO(), st, primitives.Gwei(tab)) } diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index 921d39161c9d..675ea1fb6c33 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -49,7 +49,6 @@ go_library( "//crypto/hash:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", - "//math:go_default_library", "//network/forks:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go index 9af5a78e10d9..947b096f2f7f 100644 --- a/testing/util/electra_state.go +++ b/testing/util/electra_state.go @@ -11,8 +11,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" - "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -84,9 +84,9 @@ func emptyGenesisStateElectra() (state.BeaconState, error) { LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{}, - DepositBalanceToConsume: math.Gwei(0), - ExitBalanceToConsume: math.Gwei(0), - ConsolidationBalanceToConsume: math.Gwei(0), + DepositBalanceToConsume: primitives.Gwei(0), + ExitBalanceToConsume: primitives.Gwei(0), + ConsolidationBalanceToConsume: primitives.Gwei(0), } return state_native.InitializeFromProtoElectra(st) } @@ -192,9 +192,9 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta // Electra Data DepositReceiptsStartIndex: params.BeaconConfig().UnsetDepositReceiptsStartIndex, - ExitBalanceToConsume: helpers.ActivationExitChurnLimit(math.Gwei(tab)), + ExitBalanceToConsume: helpers.ActivationExitChurnLimit(primitives.Gwei(tab)), EarliestConsolidationEpoch: helpers.ActivationExitEpoch(slots.ToEpoch(preState.Slot())), - ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(math.Gwei(tab)), + ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(primitives.Gwei(tab)), PendingBalanceDeposits: make([]*ethpb.PendingBalanceDeposit, 0), PendingPartialWithdrawals: make([]*ethpb.PendingPartialWithdrawal, 0), PendingConsolidations: make([]*ethpb.PendingConsolidation, 0), From 30cc23c5de7edad62d6ab49f13208fc56e9a95a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Wed, 22 May 2024 01:39:00 +0900 Subject: [PATCH 100/325] Substantial VC cleanup (#13593) * Cleanup part 1 * Cleanup part 2 * Cleanup part 3 * remove lock field init * doc for SignerConfig * remove vars * use full Keymanager word in function * revert interface rename * linter * fix build issues * review --- testing/validator-mock/BUILD.bazel | 4 +- ...in_client_mock.go => chain_client_mock.go} | 58 ++--- .../prysm_beacon_chain_client_mock.go | 57 ----- .../validator-mock/prysm_chain_client_mock.go | 52 ++++ validator/client/aggregate.go | 6 +- validator/client/attest.go | 2 +- validator/client/attest_test.go | 4 +- .../beacon_api_beacon_chain_client.go | 28 +-- .../beacon_api_beacon_chain_client_test.go | 26 +- .../beacon-api/beacon_api_validator_client.go | 4 +- .../beacon-api/prysm_beacon_chain_client.go | 10 +- validator/client/beacon-api/status.go | 2 +- validator/client/beacon-api/status_test.go | 10 +- .../client/beacon-api/validator_count_test.go | 2 +- .../beacon_chain_client_factory.go | 12 +- .../grpc-api/grpc_beacon_chain_client.go | 18 +- .../grpc_prysm_beacon_chain_client.go | 14 +- .../grpc_prysm_beacon_chain_client_test.go | 10 +- validator/client/iface/beacon_chain_client.go | 2 +- .../client/iface/prysm_beacon_chain_client.go | 4 +- validator/client/key_reload.go | 2 +- validator/client/key_reload_test.go | 34 +-- validator/client/metrics.go | 22 +- validator/client/metrics_test.go | 24 +- validator/client/propose.go | 4 +- validator/client/propose_test.go | 8 +- validator/client/service.go | 222 +++++++----------- validator/client/service_test.go | 5 +- validator/client/sync_committee.go | 6 +- validator/client/validator.go | 173 +++++++------- validator/client/validator_test.go | 68 +++--- validator/client/wait_for_activation.go | 4 +- validator/client/wait_for_activation_test.go | 122 +++++----- validator/node/node.go | 160 +++++-------- validator/rpc/BUILD.bazel | 1 - validator/rpc/auth_token.go | 2 +- validator/rpc/beacon.go | 22 +- validator/rpc/beacon_test.go | 4 +- validator/rpc/handlers_accounts.go | 2 +- validator/rpc/handlers_accounts_test.go | 2 +- validator/rpc/handlers_beacon.go | 18 +- validator/rpc/handlers_beacon_test.go | 14 +- validator/rpc/handlers_health.go | 10 +- validator/rpc/handlers_health_test.go | 14 +- validator/rpc/handlers_keymanager.go | 12 +- validator/rpc/handlers_keymanager_test.go | 26 +- validator/rpc/handlers_slashing.go | 8 +- validator/rpc/handlers_slashing_test.go | 6 +- validator/rpc/server.go | 149 ++++-------- 49 files changed, 670 insertions(+), 799 deletions(-) rename testing/validator-mock/{beacon_chain_client_mock.go => chain_client_mock.go} (54%) delete mode 100644 testing/validator-mock/prysm_beacon_chain_client_mock.go create mode 100644 testing/validator-mock/prysm_chain_client_mock.go diff --git a/testing/validator-mock/BUILD.bazel b/testing/validator-mock/BUILD.bazel index e7df6fed845f..08bb8fa69b31 100644 --- a/testing/validator-mock/BUILD.bazel +++ b/testing/validator-mock/BUILD.bazel @@ -5,9 +5,9 @@ package(default_testonly = True) go_library( name = "go_default_library", srcs = [ - "beacon_chain_client_mock.go", + "chain_client_mock.go", "node_client_mock.go", - "prysm_beacon_chain_client_mock.go", + "prysm_chain_client_mock.go", "validator_client_mock.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/testing/validator-mock", diff --git a/testing/validator-mock/beacon_chain_client_mock.go b/testing/validator-mock/chain_client_mock.go similarity index 54% rename from testing/validator-mock/beacon_chain_client_mock.go rename to testing/validator-mock/chain_client_mock.go index 971547686796..0b10bcf7d810 100644 --- a/testing/validator-mock/beacon_chain_client_mock.go +++ b/testing/validator-mock/chain_client_mock.go @@ -18,31 +18,31 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" ) -// MockBeaconChainClient is a mock of BeaconChainClient interface. -type MockBeaconChainClient struct { +// MockChainClient is a mock of ChainClient interface. +type MockChainClient struct { ctrl *gomock.Controller - recorder *MockBeaconChainClientMockRecorder + recorder *MockChainClientMockRecorder } -// MockBeaconChainClientMockRecorder is the mock recorder for MockBeaconChainClient. -type MockBeaconChainClientMockRecorder struct { - mock *MockBeaconChainClient +// MockChainClientMockRecorder is the mock recorder for MockChainClient. +type MockChainClientMockRecorder struct { + mock *MockChainClient } -// NewMockBeaconChainClient creates a new mock instance. -func NewMockBeaconChainClient(ctrl *gomock.Controller) *MockBeaconChainClient { - mock := &MockBeaconChainClient{ctrl: ctrl} - mock.recorder = &MockBeaconChainClientMockRecorder{mock} +// NewMockChainClient creates a new mock instance. +func NewMockChainClient(ctrl *gomock.Controller) *MockChainClient { + mock := &MockChainClient{ctrl: ctrl} + mock.recorder = &MockChainClientMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockBeaconChainClient) EXPECT() *MockBeaconChainClientMockRecorder { +func (m *MockChainClient) EXPECT() *MockChainClientMockRecorder { return m.recorder } // GetChainHead mocks base method. -func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { +func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetChainHead", arg0, arg1) ret0, _ := ret[0].(*eth.ChainHead) @@ -51,13 +51,13 @@ func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb } // GetChainHead indicates an expected call of GetChainHead. -func (mr *MockBeaconChainClientMockRecorder) GetChainHead(arg0, arg1 any) *gomock.Call { +func (mr *MockChainClientMockRecorder) GetChainHead(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockBeaconChainClient)(nil).GetChainHead), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockChainClient)(nil).GetChainHead), arg0, arg1) } // GetValidatorParticipation mocks base method. -func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { +func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorParticipation", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorParticipationResponse) @@ -66,13 +66,13 @@ func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, } // GetValidatorParticipation indicates an expected call of GetValidatorParticipation. -func (mr *MockBeaconChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any) *gomock.Call { +func (mr *MockChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorParticipation), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).GetValidatorParticipation), arg0, arg1) } // GetValidatorPerformance mocks base method. -func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { +func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorPerformance", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse) @@ -81,13 +81,13 @@ func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, ar } // GetValidatorPerformance indicates an expected call of GetValidatorPerformance. -func (mr *MockBeaconChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any) *gomock.Call { +func (mr *MockChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorPerformance), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).GetValidatorPerformance), arg0, arg1) } // GetValidatorQueue mocks base method. -func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { +func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorQueue", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorQueue) @@ -96,13 +96,13 @@ func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *em } // GetValidatorQueue indicates an expected call of GetValidatorQueue. -func (mr *MockBeaconChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any) *gomock.Call { +func (mr *MockChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorQueue), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).GetValidatorQueue), arg0, arg1) } // ListValidatorBalances mocks base method. -func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { +func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListValidatorBalances", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorBalances) @@ -111,13 +111,13 @@ func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 } // ListValidatorBalances indicates an expected call of ListValidatorBalances. -func (mr *MockBeaconChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any) *gomock.Call { +func (mr *MockChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidatorBalances), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ListValidatorBalances), arg0, arg1) } // ListValidators mocks base method. -func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { +func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListValidators", arg0, arg1) ret0, _ := ret[0].(*eth.Validators) @@ -126,7 +126,7 @@ func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.L } // ListValidators indicates an expected call of ListValidators. -func (mr *MockBeaconChainClientMockRecorder) ListValidators(arg0, arg1 any) *gomock.Call { +func (mr *MockChainClientMockRecorder) ListValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockChainClient)(nil).ListValidators), arg0, arg1) } diff --git a/testing/validator-mock/prysm_beacon_chain_client_mock.go b/testing/validator-mock/prysm_beacon_chain_client_mock.go deleted file mode 100644 index 15d88735d78d..000000000000 --- a/testing/validator-mock/prysm_beacon_chain_client_mock.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: PrysmBeaconChainClient) -// -// Generated by this command: -// -// mockgen -package=validator_mock -destination=testing/validator-mock/prysm_beacon_chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface PrysmBeaconChainClient -// - -// Package validator_mock is a generated GoMock package. -package validator_mock - -import ( - context "context" - reflect "reflect" - - validator "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" - iface "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - gomock "go.uber.org/mock/gomock" -) - -// MockPrysmBeaconChainClient is a mock of PrysmBeaconChainClient interface. -type MockPrysmBeaconChainClient struct { - ctrl *gomock.Controller - recorder *MockPrysmBeaconChainClientMockRecorder -} - -// MockPrysmBeaconChainClientMockRecorder is the mock recorder for MockPrysmBeaconChainClient. -type MockPrysmBeaconChainClientMockRecorder struct { - mock *MockPrysmBeaconChainClient -} - -// NewMockPrysmBeaconChainClient creates a new mock instance. -func NewMockPrysmBeaconChainClient(ctrl *gomock.Controller) *MockPrysmBeaconChainClient { - mock := &MockPrysmBeaconChainClient{ctrl: ctrl} - mock.recorder = &MockPrysmBeaconChainClientMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockPrysmBeaconChainClient) EXPECT() *MockPrysmBeaconChainClientMockRecorder { - return m.recorder -} - -// GetValidatorCount mocks base method. -func (m *MockPrysmBeaconChainClient) GetValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorCount", arg0, arg1, arg2) - ret0, _ := ret[0].([]iface.ValidatorCount) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetValidatorCount indicates an expected call of GetValidatorCount. -func (mr *MockPrysmBeaconChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorCount", reflect.TypeOf((*MockPrysmBeaconChainClient)(nil).GetValidatorCount), arg0, arg1, arg2) -} diff --git a/testing/validator-mock/prysm_chain_client_mock.go b/testing/validator-mock/prysm_chain_client_mock.go new file mode 100644 index 000000000000..330af4c503ee --- /dev/null +++ b/testing/validator-mock/prysm_chain_client_mock.go @@ -0,0 +1,52 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/prysmaticlabs/prysm/v4/validator/client/iface (interfaces: PrysmChainClient) + +// Package validator_mock is a generated GoMock package. +package validator_mock + +import ( + context "context" + reflect "reflect" + + validator "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" + iface "github.com/prysmaticlabs/prysm/v5/validator/client/iface" + gomock "go.uber.org/mock/gomock" +) + +// MockPrysmChainClient is a mock of PrysmChainClient interface. +type MockPrysmChainClient struct { + ctrl *gomock.Controller + recorder *MockPrysmChainClientMockRecorder +} + +// MockPrysmChainClientMockRecorder is the mock recorder for MockPrysmChainClient. +type MockPrysmChainClientMockRecorder struct { + mock *MockPrysmChainClient +} + +// NewMockPrysmChainClient creates a new mock instance. +func NewMockPrysmChainClient(ctrl *gomock.Controller) *MockPrysmChainClient { + mock := &MockPrysmChainClient{ctrl: ctrl} + mock.recorder = &MockPrysmChainClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPrysmChainClient) EXPECT() *MockPrysmChainClientMockRecorder { + return m.recorder +} + +// GetValidatorCount mocks base method. +func (m *MockPrysmChainClient) GetValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorCount", arg0, arg1, arg2) + ret0, _ := ret[0].([]iface.ValidatorCount) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetValidatorCount indicates an expected call of GetValidatorCount. +func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).GetValidatorCount), arg0, arg1, arg2) +} diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index ab4b532f7282..5cfd40fdf1b3 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -44,7 +44,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives } // Avoid sending beacon node duplicated aggregation requests. - k := validatorSubscribeKey(slot, duty.CommitteeIndex) + k := validatorSubnetSubscriptionKey(slot, duty.CommitteeIndex) v.aggregatedSlotCommitteeIDCacheLock.Lock() if v.aggregatedSlotCommitteeIDCache.Contains(k) { v.aggregatedSlotCommitteeIDCacheLock.Unlock() @@ -149,7 +149,7 @@ func (v *validator) signSlotWithSelectionProof(ctx context.Context, pubKey [fiel if err != nil { return nil, err } - sig, err = v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err = v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: domain.SignatureDomain, @@ -203,7 +203,7 @@ func (v *validator) aggregateAndProofSig(ctx context.Context, pubKey [fieldparam if err != nil { return nil, err } - sig, err = v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err = v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: d.SignatureDomain, diff --git a/validator/client/attest.go b/validator/client/attest.go index 8a501f8f3f66..42973c4b13b1 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -203,7 +203,7 @@ func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLe if err != nil { return nil, [32]byte{}, err } - sig, err := v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err := v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: domain.SignatureDomain, diff --git a/validator/client/attest_test.go b/validator/client/attest_test.go index c9309a99601c..23308302f355 100644 --- a/validator/client/attest_test.go +++ b/validator/client/attest_test.go @@ -167,7 +167,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { root, err := signing.ComputeSigningRoot(expectedAttestation.Data, make([]byte, 32)) require.NoError(t, err) - sig, err := validator.keyManager.Sign(context.Background(), &validatorpb.SignRequest{ + sig, err := validator.km.Sign(context.Background(), &validatorpb.SignRequest{ PublicKey: validatorKey.PublicKey().Marshal(), SigningRoot: root[:], }) @@ -504,7 +504,7 @@ func TestSignAttestation(t *testing.T) { att.Data.BeaconBlockRoot = bytesutil.PadTo([]byte("blockRoot"), 32) pk := testKeyFromBytes(t, []byte{1}) - validator.keyManager = newMockKeymanager(t, pk) + validator.km = newMockKeymanager(t, pk) sig, sr, err := validator.signAtt(ctx, pk.pub, att.Data, att.Data.Slot) require.NoError(t, err, "%x,%x,%v", sig, sr, err) require.Equal(t, "b6a60f8497bd328908be83634d045"+ diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client.go b/validator/client/beacon-api/beacon_api_beacon_chain_client.go index d45204a29973..0ed7607b33da 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client.go @@ -17,15 +17,15 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client/iface" ) -type beaconApiBeaconChainClient struct { - fallbackClient iface.BeaconChainClient +type beaconApiChainClient struct { + fallbackClient iface.ChainClient jsonRestHandler JsonRestHandler stateValidatorsProvider StateValidatorsProvider } const getValidatorPerformanceEndpoint = "/prysm/validators/performance" -func (c beaconApiBeaconChainClient) getHeadBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) { +func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) { blockHeader := structs.GetBlockHeaderResponse{} err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/headers/head", &blockHeader) if err != nil { @@ -43,7 +43,7 @@ func (c beaconApiBeaconChainClient) getHeadBlockHeaders(ctx context.Context) (*s return &blockHeader, nil } -func (c beaconApiBeaconChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) { +func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) { const endpoint = "/eth/v1/beacon/states/head/finality_checkpoints" finalityCheckpoints := structs.GetFinalityCheckpointsResponse{} @@ -146,16 +146,16 @@ func (c beaconApiBeaconChainClient) GetChainHead(ctx context.Context, _ *empty.E }, nil } -func (c beaconApiBeaconChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { +func (c beaconApiChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { if c.fallbackClient != nil { return c.fallbackClient.ListValidatorBalances(ctx, in) } // TODO: Implement me - panic("beaconApiBeaconChainClient.ListValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiBeaconChainClientWithFallback.") + panic("beaconApiChainClient.ListValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func (c beaconApiBeaconChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { +func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { pageSize := in.PageSize // We follow the gRPC behavior here, which returns a maximum of 250 results when pageSize == 0 @@ -310,16 +310,16 @@ func (c beaconApiBeaconChainClient) ListValidators(ctx context.Context, in *ethp }, nil } -func (c beaconApiBeaconChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { +func (c beaconApiChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { if c.fallbackClient != nil { return c.fallbackClient.GetValidatorQueue(ctx, in) } // TODO: Implement me - panic("beaconApiBeaconChainClient.GetValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiBeaconChainClientWithFallback.") + panic("beaconApiChainClient.GetValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func (c beaconApiBeaconChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { +func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { request, err := json.Marshal(structs.GetValidatorPerformanceRequest{ PublicKeys: in.PublicKeys, Indices: in.Indices, @@ -345,17 +345,17 @@ func (c beaconApiBeaconChainClient) GetValidatorPerformance(ctx context.Context, }, nil } -func (c beaconApiBeaconChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { +func (c beaconApiChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { if c.fallbackClient != nil { return c.fallbackClient.GetValidatorParticipation(ctx, in) } // TODO: Implement me - panic("beaconApiBeaconChainClient.GetValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiBeaconChainClientWithFallback.") + panic("beaconApiChainClient.GetValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func NewBeaconApiBeaconChainClientWithFallback(jsonRestHandler JsonRestHandler, fallbackClient iface.BeaconChainClient) iface.BeaconChainClient { - return &beaconApiBeaconChainClient{ +func NewBeaconApiChainClientWithFallback(jsonRestHandler JsonRestHandler, fallbackClient iface.ChainClient) iface.ChainClient { + return &beaconApiChainClient{ jsonRestHandler: jsonRestHandler, fallbackClient: fallbackClient, stateValidatorsProvider: beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler}, diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go index 3ed8dbe476be..a7a32ecc2381 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go @@ -31,7 +31,7 @@ func TestListValidators(t *testing.T) { defer ctrl.Finish() ctx := context.Background() - beaconChainClient := beaconApiBeaconChainClient{} + beaconChainClient := beaconApiChainClient{} _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ PageToken: "foo", }) @@ -43,7 +43,7 @@ func TestListValidators(t *testing.T) { defer ctrl.Finish() ctx := context.Background() - beaconChainClient := beaconApiBeaconChainClient{} + beaconChainClient := beaconApiChainClient{} _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ Epoch: math.MaxUint64, @@ -63,7 +63,7 @@ func TestListValidators(t *testing.T) { errors.New("foo error"), ) - beaconChainClient := beaconApiBeaconChainClient{stateValidatorsProvider: stateValidatorsProvider} + beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ Epoch: 0, @@ -83,7 +83,7 @@ func TestListValidators(t *testing.T) { errors.New("bar error"), ) - beaconChainClient := beaconApiBeaconChainClient{stateValidatorsProvider: stateValidatorsProvider} + beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, }) @@ -101,7 +101,7 @@ func TestListValidators(t *testing.T) { errors.New("foo error"), ) - beaconChainClient := beaconApiBeaconChainClient{stateValidatorsProvider: stateValidatorsProvider} + beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) @@ -122,7 +122,7 @@ func TestListValidators(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get(ctx, blockHeaderEndpoint, gomock.Any()).Return(errors.New("bar error")) - beaconChainClient := beaconApiBeaconChainClient{ + beaconChainClient := beaconApiChainClient{ stateValidatorsProvider: stateValidatorsProvider, jsonRestHandler: jsonRestHandler, } @@ -200,7 +200,7 @@ func TestListValidators(t *testing.T) { testCase.blockHeaderResponse, ) - beaconChainClient := beaconApiBeaconChainClient{ + beaconChainClient := beaconApiChainClient{ stateValidatorsProvider: stateValidatorsProvider, jsonRestHandler: jsonRestHandler, } @@ -333,7 +333,7 @@ func TestListValidators(t *testing.T) { nil, ) - beaconChainClient := beaconApiBeaconChainClient{stateValidatorsProvider: stateValidatorsProvider} + beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, }) @@ -561,7 +561,7 @@ func TestListValidators(t *testing.T) { nil, ) - beaconChainClient := beaconApiBeaconChainClient{stateValidatorsProvider: stateValidatorsProvider} + beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} validators, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, PublicKeys: [][]byte{}, @@ -752,7 +752,7 @@ func TestGetChainHead(t *testing.T) { testCase.generateFinalityCheckpointsResponse(), ) - beaconChainClient := beaconApiBeaconChainClient{jsonRestHandler: jsonRestHandler} + beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} _, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.expectedError, err) }) @@ -859,7 +859,7 @@ func TestGetChainHead(t *testing.T) { testCase.generateHeadBlockHeadersResponse(), ) - beaconChainClient := beaconApiBeaconChainClient{jsonRestHandler: jsonRestHandler} + beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} _, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.expectedError, err) }) @@ -913,7 +913,7 @@ func TestGetChainHead(t *testing.T) { HeadEpoch: slots.ToEpoch(8), } - beaconChainClient := beaconApiBeaconChainClient{jsonRestHandler: jsonRestHandler} + beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} chainHead, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) require.NoError(t, err) assert.DeepEqual(t, expectedChainHead, chainHead) @@ -949,7 +949,7 @@ func Test_beaconApiBeaconChainClient_GetValidatorPerformance(t *testing.T) { nil, ) - c := beaconApiBeaconChainClient{ + c := beaconApiChainClient{ jsonRestHandler: jsonRestHandler, } diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 7e59bd0ab77d..43eb64d3726d 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -23,7 +23,7 @@ type beaconApiValidatorClient struct { stateValidatorsProvider StateValidatorsProvider jsonRestHandler JsonRestHandler beaconBlockConverter BeaconBlockConverter - prysmBeaconChainCLient iface.PrysmBeaconChainClient + prysmChainClient iface.PrysmChainClient isEventStreamRunning bool } @@ -34,7 +34,7 @@ func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...Valida stateValidatorsProvider: beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler}, jsonRestHandler: jsonRestHandler, beaconBlockConverter: beaconApiBeaconBlockConverter{}, - prysmBeaconChainCLient: prysmBeaconChainClient{ + prysmChainClient: prysmChainClient{ nodeClient: &beaconApiNodeClient{jsonRestHandler: jsonRestHandler}, jsonRestHandler: jsonRestHandler, }, diff --git a/validator/client/beacon-api/prysm_beacon_chain_client.go b/validator/client/beacon-api/prysm_beacon_chain_client.go index 5dc5f1a2764b..d4bce8f37832 100644 --- a/validator/client/beacon-api/prysm_beacon_chain_client.go +++ b/validator/client/beacon-api/prysm_beacon_chain_client.go @@ -13,20 +13,20 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client/iface" ) -// NewPrysmBeaconChainClient returns implementation of iface.PrysmBeaconChainClient. -func NewPrysmBeaconChainClient(jsonRestHandler JsonRestHandler, nodeClient iface.NodeClient) iface.PrysmBeaconChainClient { - return prysmBeaconChainClient{ +// NewPrysmChainClient returns implementation of iface.PrysmChainClient. +func NewPrysmChainClient(jsonRestHandler JsonRestHandler, nodeClient iface.NodeClient) iface.PrysmChainClient { + return prysmChainClient{ jsonRestHandler: jsonRestHandler, nodeClient: nodeClient, } } -type prysmBeaconChainClient struct { +type prysmChainClient struct { jsonRestHandler JsonRestHandler nodeClient iface.NodeClient } -func (c prysmBeaconChainClient) GetValidatorCount(ctx context.Context, stateID string, statuses []validator2.Status) ([]iface.ValidatorCount, error) { +func (c prysmChainClient) GetValidatorCount(ctx context.Context, stateID string, statuses []validator2.Status) ([]iface.ValidatorCount, error) { // Check node version for prysm beacon node as it is a custom endpoint for prysm beacon node. nodeVersion, err := c.nodeClient.GetVersion(ctx, nil) if err != nil { diff --git a/validator/client/beacon-api/status.go b/validator/client/beacon-api/status.go index c2e14c5640f5..a9dc536cc248 100644 --- a/validator/client/beacon-api/status.go +++ b/validator/client/beacon-api/status.go @@ -79,7 +79,7 @@ func (c *beaconApiValidatorClient) getValidatorsStatusResponse(ctx context.Conte return nil, nil, nil, errors.Wrap(err, "failed to get state validators") } - validatorsCountResponse, err := c.prysmBeaconChainCLient.GetValidatorCount(ctx, "head", nil) + validatorsCountResponse, err := c.prysmChainClient.GetValidatorCount(ctx, "head", nil) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return nil, nil, nil, errors.Wrap(err, "failed to get total validator count") } diff --git a/validator/client/beacon-api/status_test.go b/validator/client/beacon-api/status_test.go index 23310a0d616f..15b318f88026 100644 --- a/validator/client/beacon-api/status_test.go +++ b/validator/client/beacon-api/status_test.go @@ -55,7 +55,7 @@ func TestValidatorStatus_Nominal(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) validatorClient := beaconApiValidatorClient{ stateValidatorsProvider: stateValidatorsProvider, - prysmBeaconChainCLient: prysmBeaconChainClient{ + prysmChainClient: prysmChainClient{ nodeClient: &beaconApiNodeClient{ jsonRestHandler: jsonRestHandler, }, @@ -181,7 +181,7 @@ func TestMultipleValidatorStatus_Nominal(t *testing.T) { validatorClient := beaconApiValidatorClient{ stateValidatorsProvider: stateValidatorsProvider, - prysmBeaconChainCLient: prysmBeaconChainClient{ + prysmChainClient: prysmChainClient{ nodeClient: &beaconApiNodeClient{ jsonRestHandler: jsonRestHandler, }, @@ -429,7 +429,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) validatorClient := beaconApiValidatorClient{ stateValidatorsProvider: stateValidatorsProvider, - prysmBeaconChainCLient: prysmBeaconChainClient{ + prysmChainClient: prysmChainClient{ nodeClient: &beaconApiNodeClient{ jsonRestHandler: jsonRestHandler, }, @@ -499,7 +499,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { validatorClient := beaconApiValidatorClient{ stateValidatorsProvider: stateValidatorsProvider, - prysmBeaconChainCLient: prysmBeaconChainClient{ + prysmChainClient: prysmChainClient{ nodeClient: &beaconApiNodeClient{ jsonRestHandler: jsonRestHandler, }, @@ -729,7 +729,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { validatorClient := beaconApiValidatorClient{ stateValidatorsProvider: stateValidatorsProvider, - prysmBeaconChainCLient: prysmBeaconChainClient{ + prysmChainClient: prysmChainClient{ nodeClient: &beaconApiNodeClient{ jsonRestHandler: jsonRestHandler, }, diff --git a/validator/client/beacon-api/validator_count_test.go b/validator/client/beacon-api/validator_count_test.go index 6ab9fafe62fa..eb2206801a3f 100644 --- a/validator/client/beacon-api/validator_count_test.go +++ b/validator/client/beacon-api/validator_count_test.go @@ -141,7 +141,7 @@ func TestGetValidatorCount(t *testing.T) { ).Times(test.validatorCountCalled) // Type assertion. - var client iface.PrysmBeaconChainClient = &prysmBeaconChainClient{ + var client iface.PrysmChainClient = &prysmChainClient{ nodeClient: &beaconApiNodeClient{jsonRestHandler: jsonRestHandler}, jsonRestHandler: jsonRestHandler, } diff --git a/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go b/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go index 2af08b208f51..43e86ad6a7e9 100644 --- a/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go +++ b/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go @@ -9,19 +9,19 @@ import ( validatorHelpers "github.com/prysmaticlabs/prysm/v5/validator/helpers" ) -func NewBeaconChainClient(validatorConn validatorHelpers.NodeConnection, jsonRestHandler beaconApi.JsonRestHandler) iface.BeaconChainClient { - grpcClient := grpcApi.NewGrpcBeaconChainClient(validatorConn.GetGrpcClientConn()) +func NewChainClient(validatorConn validatorHelpers.NodeConnection, jsonRestHandler beaconApi.JsonRestHandler) iface.ChainClient { + grpcClient := grpcApi.NewGrpcChainClient(validatorConn.GetGrpcClientConn()) if features.Get().EnableBeaconRESTApi { - return beaconApi.NewBeaconApiBeaconChainClientWithFallback(jsonRestHandler, grpcClient) + return beaconApi.NewBeaconApiChainClientWithFallback(jsonRestHandler, grpcClient) } else { return grpcClient } } -func NewPrysmBeaconClient(validatorConn validatorHelpers.NodeConnection, jsonRestHandler beaconApi.JsonRestHandler) iface.PrysmBeaconChainClient { +func NewPrysmChainClient(validatorConn validatorHelpers.NodeConnection, jsonRestHandler beaconApi.JsonRestHandler) iface.PrysmChainClient { if features.Get().EnableBeaconRESTApi { - return beaconApi.NewPrysmBeaconChainClient(jsonRestHandler, nodeClientFactory.NewNodeClient(validatorConn, jsonRestHandler)) + return beaconApi.NewPrysmChainClient(jsonRestHandler, nodeClientFactory.NewNodeClient(validatorConn, jsonRestHandler)) } else { - return grpcApi.NewGrpcPrysmBeaconChainClient(validatorConn.GetGrpcClientConn()) + return grpcApi.NewGrpcPrysmChainClient(validatorConn.GetGrpcClientConn()) } } diff --git a/validator/client/grpc-api/grpc_beacon_chain_client.go b/validator/client/grpc-api/grpc_beacon_chain_client.go index d413e4bae404..9f31a3b57bee 100644 --- a/validator/client/grpc-api/grpc_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_beacon_chain_client.go @@ -9,34 +9,34 @@ import ( "google.golang.org/grpc" ) -type grpcBeaconChainClient struct { +type grpcChainClient struct { beaconChainClient ethpb.BeaconChainClient } -func (c *grpcBeaconChainClient) GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { +func (c *grpcChainClient) GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { return c.beaconChainClient.GetChainHead(ctx, in) } -func (c *grpcBeaconChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { +func (c *grpcChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { return c.beaconChainClient.ListValidatorBalances(ctx, in) } -func (c *grpcBeaconChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { +func (c *grpcChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { return c.beaconChainClient.ListValidators(ctx, in) } -func (c *grpcBeaconChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { +func (c *grpcChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { return c.beaconChainClient.GetValidatorQueue(ctx, in) } -func (c *grpcBeaconChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { +func (c *grpcChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { return c.beaconChainClient.GetValidatorPerformance(ctx, in) } -func (c *grpcBeaconChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { +func (c *grpcChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { return c.beaconChainClient.GetValidatorParticipation(ctx, in) } -func NewGrpcBeaconChainClient(cc grpc.ClientConnInterface) iface.BeaconChainClient { - return &grpcBeaconChainClient{ethpb.NewBeaconChainClient(cc)} +func NewGrpcChainClient(cc grpc.ClientConnInterface) iface.ChainClient { + return &grpcChainClient{ethpb.NewBeaconChainClient(cc)} } diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go index 87fad7339cf6..be9f40b3a234 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go @@ -18,12 +18,12 @@ import ( "google.golang.org/grpc" ) -type grpcPrysmBeaconChainClient struct { - beaconChainClient iface.BeaconChainClient +type grpcPrysmChainClient struct { + chainClient iface.ChainClient } -func (g grpcPrysmBeaconChainClient) GetValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { - resp, err := g.beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) +func (g grpcPrysmChainClient) GetValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { + resp, err := g.chainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) if err != nil { return nil, errors.Wrap(err, "list validators failed") } @@ -33,7 +33,7 @@ func (g grpcPrysmBeaconChainClient) GetValidatorCount(ctx context.Context, _ str vals = append(vals, val.Validator) } - head, err := g.beaconChainClient.GetChainHead(ctx, &empty.Empty{}) + head, err := g.chainClient.GetChainHead(ctx, &empty.Empty{}) if err != nil { return nil, errors.Wrap(err, "get chain head") } @@ -92,6 +92,6 @@ func validatorCountByStatus(validators []*ethpb.Validator, statuses []validator. return resp, nil } -func NewGrpcPrysmBeaconChainClient(cc grpc.ClientConnInterface) iface.PrysmBeaconChainClient { - return &grpcPrysmBeaconChainClient{beaconChainClient: &grpcBeaconChainClient{ethpb.NewBeaconChainClient(cc)}} +func NewGrpcPrysmChainClient(cc grpc.ClientConnInterface) iface.PrysmChainClient { + return &grpcPrysmChainClient{chainClient: &grpcChainClient{ethpb.NewBeaconChainClient(cc)}} } diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go index dc32f284597c..d383f6f678d4 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go @@ -291,8 +291,8 @@ func TestGetValidatorCount(t *testing.T) { }) } - beaconChainClient := mock.NewMockBeaconChainClient(ctrl) - beaconChainClient.EXPECT().ListValidators( + chainClient := mock.NewMockChainClient(ctrl) + chainClient.EXPECT().ListValidators( gomock.Any(), gomock.Any(), ).Return( @@ -300,7 +300,7 @@ func TestGetValidatorCount(t *testing.T) { nil, ) - beaconChainClient.EXPECT().GetChainHead( + chainClient.EXPECT().GetChainHead( gomock.Any(), gomock.Any(), ).Return( @@ -308,8 +308,8 @@ func TestGetValidatorCount(t *testing.T) { nil, ) - prysmBeaconChainClient := &grpcPrysmBeaconChainClient{ - beaconChainClient: beaconChainClient, + prysmBeaconChainClient := &grpcPrysmChainClient{ + chainClient: chainClient, } var statuses []validator.Status diff --git a/validator/client/iface/beacon_chain_client.go b/validator/client/iface/beacon_chain_client.go index 88821e0c7e50..01ec65c3306b 100644 --- a/validator/client/iface/beacon_chain_client.go +++ b/validator/client/iface/beacon_chain_client.go @@ -7,7 +7,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -type BeaconChainClient interface { +type ChainClient interface { GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) diff --git a/validator/client/iface/prysm_beacon_chain_client.go b/validator/client/iface/prysm_beacon_chain_client.go index 477f74ca8d88..1cb0e2095562 100644 --- a/validator/client/iface/prysm_beacon_chain_client.go +++ b/validator/client/iface/prysm_beacon_chain_client.go @@ -14,7 +14,7 @@ type ValidatorCount struct { Count uint64 } -// PrysmBeaconChainClient defines an interface required to implement all the prysm specific custom endpoints. -type PrysmBeaconChainClient interface { +// PrysmChainClient defines an interface required to implement all the prysm specific custom endpoints. +type PrysmChainClient interface { GetValidatorCount(context.Context, string, []validator.Status) ([]ValidatorCount, error) } diff --git a/validator/client/key_reload.go b/validator/client/key_reload.go index 98731fcf8fa3..777177cff860 100644 --- a/validator/client/key_reload.go +++ b/validator/client/key_reload.go @@ -39,7 +39,7 @@ func (v *validator) HandleKeyReload(ctx context.Context, currentKeys [][fieldpar // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 - valCounts, err := v.prysmBeaconClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) + valCounts, err := v.prysmChainClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return false, errors.Wrap(err, "could not get active validator count") } diff --git a/validator/client/key_reload_test.go b/validator/client/key_reload_test.go index 82e7b5b723f2..ae48c159eba4 100644 --- a/validator/client/key_reload_test.go +++ b/validator/client/key_reload_test.go @@ -29,14 +29,14 @@ func TestValidator_HandleKeyReload(t *testing.T) { active := randKeypair(t) client := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) v := validator{ - validatorClient: client, - keyManager: newMockKeymanager(t, inactive), - genesisTime: 1, - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: client, + km: newMockKeymanager(t, inactive), + genesisTime: 1, + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactive.pub[:], active.pub[:]}) @@ -48,7 +48,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { PublicKeys: [][]byte{inactive.pub[:], active.pub[:]}, }, ).Return(resp, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validator2.Status{validator2.Active}, @@ -65,15 +65,15 @@ func TestValidator_HandleKeyReload(t *testing.T) { hook := logTest.NewGlobal() client := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: client, - keyManager: newMockKeymanager(t, kp), - genesisTime: 1, - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: client, + km: newMockKeymanager(t, kp), + genesisTime: 1, + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{kp.pub[:]}) @@ -84,7 +84,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(resp, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validator2.Status{validator2.Active}, @@ -102,7 +102,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { client := validatormock.NewMockValidatorClient(ctrl) v := validator{ validatorClient: client, - keyManager: newMockKeymanager(t, kp), + km: newMockKeymanager(t, kp), genesisTime: 1, } diff --git a/validator/client/metrics.go b/validator/client/metrics.go index 69462d50a77c..b5668c154380 100644 --- a/validator/client/metrics.go +++ b/validator/client/metrics.go @@ -234,13 +234,13 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot primiti // Do nothing unless we are at the end of the epoch, and not in the first epoch. return nil } - if !v.logValidatorBalances { + if !v.logValidatorPerformance { return nil } var pks [][fieldparams.BLSPubkeyLength]byte var err error - pks, err = v.keyManager.FetchValidatingPublicKeys(ctx) + pks, err = v.km.FetchValidatingPublicKeys(ctx) if err != nil { return err } @@ -249,7 +249,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot primiti req := ðpb.ValidatorPerformanceRequest{ PublicKeys: pubKeys, } - resp, err := v.beaconClient.GetValidatorPerformance(ctx, req) + resp, err := v.chainClient.GetValidatorPerformance(ctx, req) if err != nil { return err } @@ -270,11 +270,11 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot primiti v.voteStats.startEpoch = prevEpoch } } - v.prevBalanceLock.Lock() + v.prevEpochBalancesLock.Lock() for i, pubKey := range resp.PublicKeys { v.logForEachValidator(i, pubKey, resp, slot, prevEpoch) } - v.prevBalanceLock.Unlock() + v.prevEpochBalancesLock.Unlock() v.UpdateLogAggregateStats(resp, slot) return nil @@ -284,7 +284,7 @@ func (v *validator) logForEachValidator(index int, pubKey []byte, resp *ethpb.Va truncatedKey := fmt.Sprintf("%#x", bytesutil.Trunc(pubKey)) pubKeyBytes := bytesutil.ToBytes48(pubKey) if slot < params.BeaconConfig().SlotsPerEpoch { - v.prevBalance[pubKeyBytes] = params.BeaconConfig().MaxEffectiveBalance + v.prevEpochBalances[pubKeyBytes] = params.BeaconConfig().MaxEffectiveBalance } // Safely load data from response with slice out of bounds checks. The server should return @@ -325,7 +325,7 @@ func (v *validator) logForEachValidator(index int, pubKey []byte, resp *ethpb.Va fmtKey := fmt.Sprintf("%#x", pubKey) gweiPerEth := float64(params.BeaconConfig().GweiPerEth) - if v.prevBalance[pubKeyBytes] > 0 { + if v.prevEpochBalances[pubKeyBytes] > 0 { newBalance := float64(balAfterEpoch) / gweiPerEth prevBalance := float64(balBeforeEpoch) / gweiPerEth startBalance := float64(v.startBalances[pubKeyBytes]) / gweiPerEth @@ -380,7 +380,7 @@ func (v *validator) logForEachValidator(index int, pubKey []byte, resp *ethpb.Va } } } - v.prevBalance[pubKeyBytes] = balBeforeEpoch + v.prevEpochBalances[pubKeyBytes] = balBeforeEpoch } // UpdateLogAggregateStats updates and logs the voteStats struct of a validator using the RPC response obtained from LogValidatorGainsAndLosses. @@ -438,12 +438,12 @@ func (v *validator) UpdateLogAggregateStats(resp *ethpb.ValidatorPerformanceResp log.WithFields(epochSummaryFields).Info("Previous epoch aggregated voting summary") var totalStartBal, totalPrevBal uint64 - v.prevBalanceLock.RLock() + v.prevEpochBalancesLock.RLock() for i, val := range v.startBalances { totalStartBal += val - totalPrevBal += v.prevBalance[i] + totalPrevBal += v.prevEpochBalances[i] } - v.prevBalanceLock.RUnlock() + v.prevEpochBalancesLock.RUnlock() if totalStartBal == 0 || summary.totalAttestedCount == 0 { log.Error("Failed to print launch summary: one or more divisors is 0") diff --git a/validator/client/metrics_test.go b/validator/client/metrics_test.go index 494a990dfadd..86aae3bc1341 100644 --- a/validator/client/metrics_test.go +++ b/validator/client/metrics_test.go @@ -15,9 +15,9 @@ import ( func TestUpdateLogAggregateStats(t *testing.T) { v := &validator{ - logValidatorBalances: true, - startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), - prevBalance: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), + logValidatorPerformance: true, + startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), + prevEpochBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), voteStats: voteStats{ startEpoch: 0, // this would otherwise have been previously set in LogValidatorGainsAndLosses() }, @@ -66,9 +66,9 @@ func TestUpdateLogAggregateStats(t *testing.T) { }, } - v.prevBalance[pubKeyBytes[0]] = uint64(33200000000) - v.prevBalance[pubKeyBytes[1]] = uint64(33300000000) - v.prevBalance[pubKeyBytes[2]] = uint64(31000000000) + v.prevEpochBalances[pubKeyBytes[0]] = uint64(33200000000) + v.prevEpochBalances[pubKeyBytes[1]] = uint64(33300000000) + v.prevEpochBalances[pubKeyBytes[2]] = uint64(31000000000) var hook *logTest.Hook @@ -89,9 +89,9 @@ func TestUpdateLogAggregateStats(t *testing.T) { func TestUpdateLogAltairAggregateStats(t *testing.T) { v := &validator{ - logValidatorBalances: true, - startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), - prevBalance: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), + logValidatorPerformance: true, + startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), + prevEpochBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), voteStats: voteStats{ startEpoch: params.BeaconConfig().AltairForkEpoch, // this would otherwise have been previously set in LogValidatorGainsAndLosses() }, @@ -141,9 +141,9 @@ func TestUpdateLogAltairAggregateStats(t *testing.T) { }, } - v.prevBalance[pubKeyBytes[0]] = uint64(33200000000) - v.prevBalance[pubKeyBytes[1]] = uint64(33300000000) - v.prevBalance[pubKeyBytes[2]] = uint64(31000000000) + v.prevEpochBalances[pubKeyBytes[0]] = uint64(33200000000) + v.prevEpochBalances[pubKeyBytes[1]] = uint64(33300000000) + v.prevEpochBalances[pubKeyBytes[2]] = uint64(31000000000) var hook *logTest.Hook diff --git a/validator/client/propose.go b/validator/client/propose.go index 0864d389461e..3d70c42fb1a6 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -341,7 +341,7 @@ func (v *validator) signRandaoReveal(ctx context.Context, pubKey [fieldparams.BL if err != nil { return nil, err } - randaoReveal, err = v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + randaoReveal, err = v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: domain.SignatureDomain, @@ -373,7 +373,7 @@ func (v *validator) signBlock(ctx context.Context, pubKey [fieldparams.BLSPubkey if err != nil { return nil, [32]byte{}, err } - sig, err := v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err := v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: blockRoot[:], SignatureDomain: domain.SignatureDomain, diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index b7ab7018f27a..ac27dac94bea 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -94,7 +94,7 @@ func setupWithKey(t *testing.T, validatorKey bls.SecretKey, isSlashingProtection validator := &validator{ db: valDB, - keyManager: newMockKeymanager(t, keypair{pub: pubKey, pri: validatorKey}), + km: newMockKeymanager(t, keypair{pub: pubKey, pri: validatorKey}), validatorClient: m.validatorClient, graffiti: []byte{}, submittedAtts: make(map[submittedAttKey]*submittedAtt), @@ -879,7 +879,7 @@ func TestSignBlock(t *testing.T) { kp := testKeyFromBytes(t, []byte{1}) - validator.keyManager = newMockKeymanager(t, kp) + validator.km = newMockKeymanager(t, kp) b, err := blocks.NewBeaconBlock(blk.Block) require.NoError(t, err) sig, blockRoot, err := validator.signBlock(ctx, kp.pub, 0, 0, b) @@ -915,7 +915,7 @@ func TestSignAltairBlock(t *testing.T) { blk := util.NewBeaconBlockAltair() blk.Block.Slot = 1 blk.Block.ProposerIndex = 100 - validator.keyManager = newMockKeymanager(t, kp) + validator.km = newMockKeymanager(t, kp) wb, err := blocks.NewBeaconBlock(blk.Block) require.NoError(t, err) sig, blockRoot, err := validator.signBlock(ctx, kp.pub, 0, 0, wb) @@ -948,7 +948,7 @@ func TestSignBellatrixBlock(t *testing.T) { blk.Block.ProposerIndex = 100 kp := randKeypair(t) - validator.keyManager = newMockKeymanager(t, kp) + validator.km = newMockKeymanager(t, kp) wb, err := blocks.NewBeaconBlock(blk.Block) require.NoError(t, err) sig, blockRoot, err := validator.signBlock(ctx, kp.pub, 0, 0, wb) diff --git a/validator/client/service.go b/validator/client/service.go index a12ac3068f0a..6e5a4cd6900a 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -3,7 +3,6 @@ package client import ( "context" "net/http" - "strings" "time" "github.com/dgraph-io/ristretto" @@ -35,75 +34,54 @@ import ( "go.opencensus.io/plugin/ocgrpc" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - "google.golang.org/protobuf/types/known/emptypb" ) -// SyncChecker is able to determine if a beacon node is currently -// going through chain synchronization. -type SyncChecker interface { - Syncing(ctx context.Context) (bool, error) -} - -// GenesisFetcher can retrieve genesis information such as -// the genesis time and the validator deposit contract address. -type GenesisFetcher interface { - GenesisInfo(ctx context.Context) (*ethpb.Genesis, error) -} - // ValidatorService represents a service to manage the validator client // routine. type ValidatorService struct { - useWeb bool - emitAccountMetrics bool - logValidatorBalances bool - distributed bool - interopKeysConfig *local.InteropKeymanagerConfig - conn validatorHelpers.NodeConnection - grpcRetryDelay time.Duration - grpcRetries uint - maxCallRecvMsgSize int - cancel context.CancelFunc - walletInitializedFeed *event.Feed - wallet *wallet.Wallet - graffitiStruct *graffiti.Graffiti - dataDir string - withCert string - endpoint string - ctx context.Context - validator iface.Validator - db db.Database - grpcHeaders []string - graffiti []byte - Web3SignerConfig *remoteweb3signer.SetupConfig - proposerSettings *proposer.Settings - validatorsRegBatchSize int + ctx context.Context + cancel context.CancelFunc + validator iface.Validator + db db.Database + conn validatorHelpers.NodeConnection + wallet *wallet.Wallet + walletInitializedFeed *event.Feed + graffiti []byte + graffitiStruct *graffiti.Graffiti + interopKeysConfig *local.InteropKeymanagerConfig + web3SignerConfig *remoteweb3signer.SetupConfig + proposerSettings *proposer.Settings + validatorsRegBatchSize int + useWeb bool + emitAccountMetrics bool + logValidatorPerformance bool + distributed bool } // Config for the validator service. type Config struct { - UseWeb bool - LogValidatorBalances bool - EmitAccountMetrics bool - Distributed bool - InteropKeysConfig *local.InteropKeymanagerConfig - Wallet *wallet.Wallet - WalletInitializedFeed *event.Feed - GrpcRetriesFlag uint - GrpcMaxCallRecvMsgSizeFlag int - GrpcRetryDelay time.Duration - GraffitiStruct *graffiti.Graffiti - Validator iface.Validator - ValDB db.Database - CertFlag string - DataDir string - GrpcHeadersFlag string - GraffitiFlag string - Endpoint string - Web3SignerConfig *remoteweb3signer.SetupConfig - ProposerSettings *proposer.Settings - BeaconApiEndpoint string - BeaconApiTimeout time.Duration - ValidatorsRegBatchSize int + Validator iface.Validator + DB db.Database + Wallet *wallet.Wallet + WalletInitializedFeed *event.Feed + GRPCMaxCallRecvMsgSize int + GRPCRetries uint + GRPCRetryDelay time.Duration + GRPCHeaders []string + BeaconNodeGRPCEndpoint string + BeaconNodeCert string + BeaconApiEndpoint string + BeaconApiTimeout time.Duration + Graffiti string + GraffitiStruct *graffiti.Graffiti + InteropKmConfig *local.InteropKeymanagerConfig + Web3SignerConfig *remoteweb3signer.SetupConfig + ProposerSettings *proposer.Settings + ValidatorsRegBatchSize int + UseWeb bool + LogValidatorPerformance bool + EmitAccountMetrics bool + Distributed bool } // NewValidatorService creates a new validator service for the service @@ -111,48 +89,41 @@ type Config struct { func NewValidatorService(ctx context.Context, cfg *Config) (*ValidatorService, error) { ctx, cancel := context.WithCancel(ctx) s := &ValidatorService{ - ctx: ctx, - cancel: cancel, - endpoint: cfg.Endpoint, - withCert: cfg.CertFlag, - dataDir: cfg.DataDir, - graffiti: []byte(cfg.GraffitiFlag), - logValidatorBalances: cfg.LogValidatorBalances, - emitAccountMetrics: cfg.EmitAccountMetrics, - maxCallRecvMsgSize: cfg.GrpcMaxCallRecvMsgSizeFlag, - grpcRetries: cfg.GrpcRetriesFlag, - grpcRetryDelay: cfg.GrpcRetryDelay, - grpcHeaders: strings.Split(cfg.GrpcHeadersFlag, ","), - validator: cfg.Validator, - db: cfg.ValDB, - wallet: cfg.Wallet, - walletInitializedFeed: cfg.WalletInitializedFeed, - useWeb: cfg.UseWeb, - interopKeysConfig: cfg.InteropKeysConfig, - graffitiStruct: cfg.GraffitiStruct, - Web3SignerConfig: cfg.Web3SignerConfig, - proposerSettings: cfg.ProposerSettings, - validatorsRegBatchSize: cfg.ValidatorsRegBatchSize, - distributed: cfg.Distributed, + ctx: ctx, + cancel: cancel, + validator: cfg.Validator, + db: cfg.DB, + wallet: cfg.Wallet, + walletInitializedFeed: cfg.WalletInitializedFeed, + graffiti: []byte(cfg.Graffiti), + graffitiStruct: cfg.GraffitiStruct, + interopKeysConfig: cfg.InteropKmConfig, + web3SignerConfig: cfg.Web3SignerConfig, + proposerSettings: cfg.ProposerSettings, + validatorsRegBatchSize: cfg.ValidatorsRegBatchSize, + useWeb: cfg.UseWeb, + emitAccountMetrics: cfg.EmitAccountMetrics, + logValidatorPerformance: cfg.LogValidatorPerformance, + distributed: cfg.Distributed, } dialOpts := ConstructDialOptions( - s.maxCallRecvMsgSize, - s.withCert, - s.grpcRetries, - s.grpcRetryDelay, + cfg.GRPCMaxCallRecvMsgSize, + cfg.BeaconNodeCert, + cfg.GRPCRetries, + cfg.GRPCRetryDelay, ) if dialOpts == nil { return s, nil } - s.ctx = grpcutil.AppendHeaders(ctx, s.grpcHeaders) + s.ctx = grpcutil.AppendHeaders(ctx, cfg.GRPCHeaders) - grpcConn, err := grpc.DialContext(ctx, s.endpoint, dialOpts...) + grpcConn, err := grpc.DialContext(ctx, cfg.BeaconNodeGRPCEndpoint, dialOpts...) if err != nil { return s, err } - if s.withCert != "" { + if cfg.BeaconNodeCert != "" { log.Info("Established secure gRPC connection") } s.conn = validatorHelpers.NewNodeConnection( @@ -202,38 +173,39 @@ func (v *ValidatorService) Start() { validatorClient := validatorClientFactory.NewValidatorClient(v.conn, restHandler) valStruct := &validator{ - validatorClient: validatorClient, - beaconClient: beaconChainClientFactory.NewBeaconChainClient(v.conn, restHandler), - nodeClient: nodeClientFactory.NewNodeClient(v.conn, restHandler), - prysmBeaconClient: beaconChainClientFactory.NewPrysmBeaconClient(v.conn, restHandler), - db: v.db, - graffiti: v.graffiti, - logValidatorBalances: v.logValidatorBalances, - emitAccountMetrics: v.emitAccountMetrics, + slotFeed: new(event.Feed), startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), - prevBalance: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), + prevEpochBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), + blacklistedPubkeys: slashablePublicKeys, pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), - signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), - submittedAtts: make(map[submittedAttKey]*submittedAtt), - submittedAggregates: make(map[submittedAttKey]*submittedAtt), - domainDataCache: cache, - aggregatedSlotCommitteeIDCache: aggregatedSlotCommitteeIDCache, - voteStats: voteStats{startEpoch: primitives.Epoch(^uint64(0))}, - syncCommitteeStats: syncCommitteeStats{}, - useWeb: v.useWeb, - interopKeysConfig: v.interopKeysConfig, wallet: v.wallet, + walletInitializedChan: make(chan *wallet.Wallet, 1), walletInitializedFeed: v.walletInitializedFeed, - slotFeed: new(event.Feed), + graffiti: v.graffiti, graffitiStruct: v.graffitiStruct, graffitiOrderedIndex: graffitiOrderedIndex, - eipImportBlacklistedPublicKeys: slashablePublicKeys, - Web3SignerConfig: v.Web3SignerConfig, + validatorClient: validatorClient, + chainClient: beaconChainClientFactory.NewChainClient(v.conn, restHandler), + nodeClient: nodeClientFactory.NewNodeClient(v.conn, restHandler), + prysmChainClient: beaconChainClientFactory.NewPrysmChainClient(v.conn, restHandler), + db: v.db, + km: nil, + web3SignerConfig: v.web3SignerConfig, proposerSettings: v.proposerSettings, - walletInitializedChannel: make(chan *wallet.Wallet, 1), + signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), validatorsRegBatchSize: v.validatorsRegBatchSize, - distributed: v.distributed, + interopKeysConfig: v.interopKeysConfig, attSelections: make(map[attSelectionKey]iface.BeaconCommitteeSelection), + aggregatedSlotCommitteeIDCache: aggregatedSlotCommitteeIDCache, + domainDataCache: cache, + voteStats: voteStats{startEpoch: primitives.Epoch(^uint64(0))}, + syncCommitteeStats: syncCommitteeStats{}, + submittedAtts: make(map[submittedAttKey]*submittedAtt), + submittedAggregates: make(map[submittedAttKey]*submittedAtt), + logValidatorPerformance: v.logValidatorPerformance, + emitAccountMetrics: v.emitAccountMetrics, + useWeb: v.useWeb, + distributed: v.distributed, } v.validator = valStruct @@ -268,6 +240,11 @@ func (v *ValidatorService) Keymanager() (keymanager.IKeymanager, error) { return v.validator.Keymanager() } +// RemoteSignerConfig returns the web3signer configuration +func (v *ValidatorService) RemoteSignerConfig() *remoteweb3signer.SetupConfig { + return v.web3SignerConfig +} + // ProposerSettings returns a deep copy of the underlying proposer settings in the validator func (v *ValidatorService) ProposerSettings() *proposer.Settings { settings := v.validator.ProposerSettings() @@ -342,23 +319,6 @@ func ConstructDialOptions( return dialOpts } -// Syncing returns whether or not the beacon node is currently synchronizing the chain. -func (v *ValidatorService) Syncing(ctx context.Context) (bool, error) { - nc := ethpb.NewNodeClient(v.conn.GetGrpcClientConn()) - resp, err := nc.GetSyncStatus(ctx, &emptypb.Empty{}) - if err != nil { - return false, err - } - return resp.Syncing, nil -} - -// GenesisInfo queries the beacon node for the chain genesis info containing -// the genesis time along with the validator deposit contract address. -func (v *ValidatorService) GenesisInfo(ctx context.Context) (*ethpb.Genesis, error) { - nc := ethpb.NewNodeClient(v.conn.GetGrpcClientConn()) - return nc.GetGenesis(ctx, &emptypb.Empty{}) -} - func (v *ValidatorService) GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { if v.validator == nil { return nil, errors.New("validator is unavailable") diff --git a/validator/client/service_test.go b/validator/client/service_test.go index 1b670aae7099..6e6c5e2bbca1 100644 --- a/validator/client/service_test.go +++ b/validator/client/service_test.go @@ -2,6 +2,7 @@ package client import ( "context" + "strings" "testing" "time" @@ -13,8 +14,6 @@ import ( ) var _ runtime.Service = (*ValidatorService)(nil) -var _ GenesisFetcher = (*ValidatorService)(nil) -var _ SyncChecker = (*ValidatorService)(nil) func TestStop_CancelsContext(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) @@ -59,7 +58,7 @@ func TestStart_GrpcHeaders(t *testing.T) { "Authorization", "this is a valid value", }, } { - cfg := &Config{GrpcHeadersFlag: input} + cfg := &Config{GRPCHeaders: strings.Split(input, ",")} validatorService, err := NewValidatorService(ctx, cfg) require.NoError(t, err) md, _ := metadata.FromOutgoingContext(validatorService.ctx) diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index 7658e49ad4a2..bea78e5e110a 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -58,7 +58,7 @@ func (v *validator) SubmitSyncCommitteeMessage(ctx context.Context, slot primiti return } - sig, err := v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err := v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: r[:], SignatureDomain: d.SignatureDomain, @@ -243,7 +243,7 @@ func (v *validator) signSyncSelectionData(ctx context.Context, pubKey [fieldpara if err != nil { return nil, err } - sig, err := v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err := v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: domain.SignatureDomain, @@ -266,7 +266,7 @@ func (v *validator) signContributionAndProof(ctx context.Context, pubKey [fieldp if err != nil { return nil, err } - sig, err := v.keyManager.Sign(ctx, &validatorpb.SignRequest{ + sig, err := v.km.Sign(ctx, &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: d.SignatureDomain, diff --git a/validator/client/validator.go b/validator/client/validator.go index 83a0c431c155..c78ef5fd1246 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -41,7 +41,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" beacon_api "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - vdb "github.com/prysmaticlabs/prysm/v5/validator/db" + "github.com/prysmaticlabs/prysm/v5/validator/db" dbCommon "github.com/prysmaticlabs/prysm/v5/validator/db/common" "github.com/prysmaticlabs/prysm/v5/validator/graffiti" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" @@ -69,51 +69,51 @@ var ( ) type validator struct { - logValidatorBalances bool - useWeb bool - emitAccountMetrics bool - distributed bool - domainDataLock sync.RWMutex - attLogsLock sync.Mutex - aggregatedSlotCommitteeIDCacheLock sync.Mutex - highestValidSlotLock sync.Mutex - prevBalanceLock sync.RWMutex - slashableKeysLock sync.RWMutex - attSelectionLock sync.Mutex - eipImportBlacklistedPublicKeys map[[fieldparams.BLSPubkeyLength]byte]bool - walletInitializedFeed *event.Feed - submittedAtts map[submittedAttKey]*submittedAtt - submittedAggregates map[submittedAttKey]*submittedAtt - startBalances map[[fieldparams.BLSPubkeyLength]byte]uint64 - dutiesLock sync.RWMutex duties *ethpb.DutiesResponse - prevBalance map[[fieldparams.BLSPubkeyLength]byte]uint64 - pubkeyToValidatorIndex map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex - signedValidatorRegistrations map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1 - attSelections map[attSelectionKey]iface.BeaconCommitteeSelection - graffitiOrderedIndex uint64 - aggregatedSlotCommitteeIDCache *lru.Cache - domainDataCache *ristretto.Cache - highestValidSlot primitives.Slot + ticker slots.Ticker genesisTime uint64 + highestValidSlot primitives.Slot slotFeed *event.Feed - interopKeysConfig *local.InteropKeymanagerConfig + startBalances map[[fieldparams.BLSPubkeyLength]byte]uint64 + prevEpochBalances map[[fieldparams.BLSPubkeyLength]byte]uint64 + blacklistedPubkeys map[[fieldparams.BLSPubkeyLength]byte]bool + pubkeyToValidatorIndex map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex wallet *wallet.Wallet + walletInitializedChan chan *wallet.Wallet + walletInitializedFeed *event.Feed + graffiti []byte graffitiStruct *graffiti.Graffiti - beaconClient iface.BeaconChainClient - nodeClient iface.NodeClient + graffitiOrderedIndex uint64 validatorClient iface.ValidatorClient - prysmBeaconClient iface.PrysmBeaconChainClient - db vdb.Database - keyManager keymanager.IKeymanager - ticker slots.Ticker - graffiti []byte - voteStats voteStats - syncCommitteeStats syncCommitteeStats - Web3SignerConfig *remoteweb3signer.SetupConfig + chainClient iface.ChainClient + nodeClient iface.NodeClient + prysmChainClient iface.PrysmChainClient + db db.Database + km keymanager.IKeymanager + web3SignerConfig *remoteweb3signer.SetupConfig proposerSettings *proposer.Settings - walletInitializedChannel chan *wallet.Wallet + signedValidatorRegistrations map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1 validatorsRegBatchSize int + interopKeysConfig *local.InteropKeymanagerConfig + attSelections map[attSelectionKey]iface.BeaconCommitteeSelection + aggregatedSlotCommitteeIDCache *lru.Cache + domainDataCache *ristretto.Cache + voteStats voteStats + syncCommitteeStats syncCommitteeStats + submittedAtts map[submittedAttKey]*submittedAtt + submittedAggregates map[submittedAttKey]*submittedAtt + logValidatorPerformance bool + emitAccountMetrics bool + useWeb bool + distributed bool + domainDataLock sync.RWMutex + attLogsLock sync.Mutex + aggregatedSlotCommitteeIDCacheLock sync.Mutex + highestValidSlotLock sync.Mutex + prevEpochBalancesLock sync.RWMutex + blacklistedPubkeysLock sync.RWMutex + attSelectionLock sync.Mutex + dutiesLock sync.RWMutex } type validatorStatus struct { @@ -132,7 +132,7 @@ func (v *validator) Done() { v.ticker.Done() } -// WaitForKeymanagerInitialization checks if the validator needs to wait for +// WaitForKmInitialization checks if the validator needs to wait for keymanager initialization. func (v *validator) WaitForKeymanagerInitialization(ctx context.Context) error { genesisRoot, err := v.db.GenesisValidatorsRoot(ctx) if err != nil { @@ -142,32 +142,32 @@ func (v *validator) WaitForKeymanagerInitialization(ctx context.Context) error { if v.useWeb && v.wallet == nil { log.Info("Waiting for keymanager to initialize validator client with web UI") // if wallet is not set, wait for it to be set through the UI - km, err := waitForWebWalletInitialization(ctx, v.walletInitializedFeed, v.walletInitializedChannel) + km, err := waitForWebWalletInitialization(ctx, v.walletInitializedFeed, v.walletInitializedChan) if err != nil { return err } - v.keyManager = km + v.km = km } else { if v.interopKeysConfig != nil { keyManager, err := local.NewInteropKeymanager(ctx, v.interopKeysConfig.Offset, v.interopKeysConfig.NumValidatorKeys) if err != nil { return errors.Wrap(err, "could not generate interop keys for key manager") } - v.keyManager = keyManager + v.km = keyManager } else if v.wallet == nil { return errors.New("wallet not set") } else { - if v.Web3SignerConfig != nil { - v.Web3SignerConfig.GenesisValidatorsRoot = genesisRoot + if v.web3SignerConfig != nil { + v.web3SignerConfig.GenesisValidatorsRoot = genesisRoot } - keyManager, err := v.wallet.InitializeKeymanager(ctx, accountsiface.InitKeymanagerConfig{ListenForChanges: true, Web3SignerConfig: v.Web3SignerConfig}) + keyManager, err := v.wallet.InitializeKeymanager(ctx, accountsiface.InitKeymanagerConfig{ListenForChanges: true, Web3SignerConfig: v.web3SignerConfig}) if err != nil { return errors.Wrap(err, "could not initialize key manager") } - v.keyManager = keyManager + v.km = keyManager } } - recheckKeys(ctx, v.db, v.keyManager) + recheckKeys(ctx, v.db, v.km) return nil } @@ -197,23 +197,22 @@ func waitForWebWalletInitialization( } // recheckKeys checks if the validator has any keys that need to be rechecked. -// the keymanager implements a subscription to push these updates to the validator. -func recheckKeys(ctx context.Context, valDB vdb.Database, keyManager keymanager.IKeymanager) { +// The keymanager implements a subscription to push these updates to the validator. +func recheckKeys(ctx context.Context, valDB db.Database, km keymanager.IKeymanager) { var validatingKeys [][fieldparams.BLSPubkeyLength]byte var err error - validatingKeys, err = keyManager.FetchValidatingPublicKeys(ctx) + validatingKeys, err = km.FetchValidatingPublicKeys(ctx) if err != nil { log.WithError(err).Debug("Could not fetch validating keys") } if err := valDB.UpdatePublicKeysBuckets(validatingKeys); err != nil { - log.WithError(err).Debug("Could not update public keys buckets") + go recheckValidatingKeysBucket(ctx, valDB, km) } - go recheckValidatingKeysBucket(ctx, valDB, keyManager) } // to accounts changes in the keymanager, then updates those keys' // buckets in bolt DB if a bucket for a key does not exist. -func recheckValidatingKeysBucket(ctx context.Context, valDB vdb.Database, km keymanager.IKeymanager) { +func recheckValidatingKeysBucket(ctx context.Context, valDB db.Database, km keymanager.IKeymanager) { importedKeymanager, ok := km.(*local.Keymanager) if !ok { return @@ -403,7 +402,7 @@ func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, acti func (v *validator) CanonicalHeadSlot(ctx context.Context) (primitives.Slot, error) { ctx, span := trace.StartSpan(ctx, "validator.CanonicalHeadSlot") defer span.End() - head, err := v.beaconClient.GetChainHead(ctx, &emptypb.Empty{}) + head, err := v.chainClient.GetChainHead(ctx, &emptypb.Empty{}) if err != nil { return 0, errors.Wrap(client.ErrConnectionIssue, err.Error()) } @@ -427,7 +426,7 @@ func (v *validator) CheckDoppelGanger(ctx context.Context) error { if !features.Get().EnableDoppelGanger { return nil } - pubkeys, err := v.keyManager.FetchValidatingPublicKeys(ctx) + pubkeys, err := v.km.FetchValidatingPublicKeys(ctx) if err != nil { return err } @@ -533,16 +532,16 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro ctx, span := trace.StartSpan(ctx, "validator.UpdateAssignments") defer span.End() - validatingKeys, err := v.keyManager.FetchValidatingPublicKeys(ctx) + validatingKeys, err := v.km.FetchValidatingPublicKeys(ctx) if err != nil { return err } // Filter out the slashable public keys from the duties request. filteredKeys := make([][fieldparams.BLSPubkeyLength]byte, 0, len(validatingKeys)) - v.slashableKeysLock.RLock() + v.blacklistedPubkeysLock.RLock() for _, pubKey := range validatingKeys { - if ok := v.eipImportBlacklistedPublicKeys[pubKey]; !ok { + if ok := v.blacklistedPubkeys[pubKey]; !ok { filteredKeys = append(filteredKeys, pubKey) } else { log.WithField( @@ -551,7 +550,7 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro "in request to update validator duties") } } - v.slashableKeysLock.RUnlock() + v.blacklistedPubkeysLock.RUnlock() req := ðpb.DutiesRequest{ Epoch: primitives.Epoch(slot / params.BeaconConfig().SlotsPerEpoch), @@ -601,28 +600,28 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro // subscribeToSubnets iterates through each validator duty, signs each slot, and asks beacon node // to eagerly subscribe to subnets so that the aggregator has attestations to aggregate. -func (v *validator) subscribeToSubnets(ctx context.Context, res *ethpb.DutiesResponse) error { - subscribeSlots := make([]primitives.Slot, 0, len(res.CurrentEpochDuties)+len(res.NextEpochDuties)) - subscribeCommitteeIndices := make([]primitives.CommitteeIndex, 0, len(res.CurrentEpochDuties)+len(res.NextEpochDuties)) - subscribeIsAggregator := make([]bool, 0, len(res.CurrentEpochDuties)+len(res.NextEpochDuties)) - activeDuties := make([]*ethpb.DutiesResponse_Duty, 0, len(res.CurrentEpochDuties)+len(res.NextEpochDuties)) +func (v *validator) subscribeToSubnets(ctx context.Context, duties *ethpb.DutiesResponse) error { + subscribeSlots := make([]primitives.Slot, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) + subscribeCommitteeIndices := make([]primitives.CommitteeIndex, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) + subscribeIsAggregator := make([]bool, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) + activeDuties := make([]*ethpb.DutiesResponse_Duty, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) alreadySubscribed := make(map[[64]byte]bool) if v.distributed { // Get aggregated selection proofs to calculate isAggregator. - if err := v.getAggregatedSelectionProofs(ctx, res); err != nil { + if err := v.getAggregatedSelectionProofs(ctx, duties); err != nil { return errors.Wrap(err, "could not get aggregated selection proofs") } } - for _, duty := range res.CurrentEpochDuties { + for _, duty := range duties.CurrentEpochDuties { pk := bytesutil.ToBytes48(duty.PublicKey) if duty.Status == ethpb.ValidatorStatus_ACTIVE || duty.Status == ethpb.ValidatorStatus_EXITING { attesterSlot := duty.AttesterSlot committeeIndex := duty.CommitteeIndex validatorIndex := duty.ValidatorIndex - alreadySubscribedKey := validatorSubscribeKey(attesterSlot, committeeIndex) + alreadySubscribedKey := validatorSubnetSubscriptionKey(attesterSlot, committeeIndex) if _, ok := alreadySubscribed[alreadySubscribedKey]; ok { continue } @@ -642,13 +641,13 @@ func (v *validator) subscribeToSubnets(ctx context.Context, res *ethpb.DutiesRes } } - for _, duty := range res.NextEpochDuties { + for _, duty := range duties.NextEpochDuties { if duty.Status == ethpb.ValidatorStatus_ACTIVE || duty.Status == ethpb.ValidatorStatus_EXITING { attesterSlot := duty.AttesterSlot committeeIndex := duty.CommitteeIndex validatorIndex := duty.ValidatorIndex - alreadySubscribedKey := validatorSubscribeKey(attesterSlot, committeeIndex) + alreadySubscribedKey := validatorSubnetSubscriptionKey(attesterSlot, committeeIndex) if _, ok := alreadySubscribed[alreadySubscribedKey]; ok { continue } @@ -751,18 +750,24 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie // Keymanager returns the underlying validator's keymanager. func (v *validator) Keymanager() (keymanager.IKeymanager, error) { - if v.keyManager == nil { + if v.km == nil { return nil, errors.New("keymanager is not initialized") } - return v.keyManager, nil + return v.km, nil } // isAggregator checks if a validator is an aggregator of a given slot and committee, // it uses a modulo calculated by validator count in committee and samples randomness around it. -func (v *validator) isAggregator(ctx context.Context, committee []primitives.ValidatorIndex, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte, validatorIndex primitives.ValidatorIndex) (bool, error) { +func (v *validator) isAggregator( + ctx context.Context, + committeeIndex []primitives.ValidatorIndex, + slot primitives.Slot, + pubKey [fieldparams.BLSPubkeyLength]byte, + validatorIndex primitives.ValidatorIndex, +) (bool, error) { modulo := uint64(1) - if len(committee)/int(params.BeaconConfig().TargetAggregatorsPerCommittee) > 1 { - modulo = uint64(len(committee)) / params.BeaconConfig().TargetAggregatorsPerCommittee + if len(committeeIndex)/int(params.BeaconConfig().TargetAggregatorsPerCommittee) > 1 { + modulo = uint64(len(committeeIndex)) / params.BeaconConfig().TargetAggregatorsPerCommittee } var ( @@ -1041,7 +1046,7 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey if err != nil { return err } - proposerReqs, err := v.buildPrepProposerReqs(ctx, filteredKeys) + proposerReqs, err := v.buildPrepProposerReqs(filteredKeys) if err != nil { return err } @@ -1152,9 +1157,9 @@ func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fie return filteredKeys, nil } -func (v *validator) buildPrepProposerReqs(ctx context.Context, pubkeys [][fieldparams.BLSPubkeyLength]byte /* only active pubkeys */) ([]*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer, error) { +func (v *validator) buildPrepProposerReqs(activePubkeys [][fieldparams.BLSPubkeyLength]byte) ([]*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer, error) { var prepareProposerReqs []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer - for _, k := range pubkeys { + for _, k := range activePubkeys { // Default case: Define fee recipient to burn address var feeRecipient common.Address @@ -1185,7 +1190,11 @@ func (v *validator) buildPrepProposerReqs(ctx context.Context, pubkeys [][fieldp return prepareProposerReqs, nil } -func (v *validator) buildSignedRegReqs(ctx context.Context, pubkeys [][fieldparams.BLSPubkeyLength]byte /* only active pubkeys */, signer iface.SigningFunc) []*ethpb.SignedValidatorRegistrationV1 { +func (v *validator) buildSignedRegReqs( + ctx context.Context, + activePubkeys [][fieldparams.BLSPubkeyLength]byte, + signer iface.SigningFunc, +) []*ethpb.SignedValidatorRegistrationV1 { var signedValRegRegs []*ethpb.SignedValidatorRegistrationV1 if v.ProposerSettings() == nil { return signedValRegRegs @@ -1194,7 +1203,7 @@ func (v *validator) buildSignedRegReqs(ctx context.Context, pubkeys [][fieldpara if v.genesisTime > uint64(time.Now().UTC().Unix()) { return signedValRegRegs } - for i, k := range pubkeys { + for i, k := range activePubkeys { feeRecipient := common.HexToAddress(params.BeaconConfig().EthBurnAddressHex) gasLimit := params.BeaconConfig().DefaultBuilderGasLimit enabled := false @@ -1244,7 +1253,7 @@ func (v *validator) buildSignedRegReqs(ctx context.Context, pubkeys [][fieldpara FeeRecipient: feeRecipient[:], GasLimit: gasLimit, Timestamp: uint64(time.Now().UTC().Unix()), - Pubkey: pubkeys[i][:], + Pubkey: activePubkeys[i][:], } signedReq, err := v.SignValidatorRegistrationRequest(ctx, signer, req) @@ -1372,8 +1381,8 @@ func (v *validator) getAttSelection(key attSelectionKey) ([]byte, error) { // This constructs a validator subscribed key, it's used to track // which subnet has already been pending requested. -func validatorSubscribeKey(slot primitives.Slot, committeeID primitives.CommitteeIndex) [64]byte { - return bytesutil.ToBytes64(append(bytesutil.Bytes32(uint64(slot)), bytesutil.Bytes32(uint64(committeeID))...)) +func validatorSubnetSubscriptionKey(slot primitives.Slot, committeeIndex primitives.CommitteeIndex) [64]byte { + return bytesutil.ToBytes64(append(bytesutil.Bytes32(uint64(slot)), bytesutil.Bytes32(uint64(committeeIndex))...)) } // This tracks all validators' voting status. diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 3bdb48003d7d..23d26e18aff6 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -305,10 +305,10 @@ func TestWaitForChainStart_ReceiveErrorFromStream(t *testing.T) { func TestCanonicalHeadSlot_FailedRPC(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - client := validatormock.NewMockBeaconChainClient(ctrl) + client := validatormock.NewMockChainClient(ctrl) v := validator{ - beaconClient: client, - genesisTime: 1, + chainClient: client, + genesisTime: 1, } client.EXPECT().GetChainHead( gomock.Any(), @@ -321,9 +321,9 @@ func TestCanonicalHeadSlot_FailedRPC(t *testing.T) { func TestCanonicalHeadSlot_OK(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - client := validatormock.NewMockBeaconChainClient(ctrl) + client := validatormock.NewMockChainClient(ctrl) v := validator{ - beaconClient: client, + chainClient: client, } client.EXPECT().GetChainHead( gomock.Any(), @@ -339,22 +339,22 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) { hook := logTest.NewGlobal() ctrl := gomock.NewController(t) defer ctrl.Finish() - validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + client := validatormock.NewMockValidatorClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: client, + km: newMockKeymanager(t, kp), + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE clientStream := mock2.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) - validatorClient.EXPECT().WaitForActivation( + client.EXPECT().WaitForActivation( gomock.Any(), ðpb.ValidatorActivationRequest{ PublicKeys: [][]byte{kp.pub[:]}, @@ -364,7 +364,7 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) { resp, nil, ) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -465,7 +465,7 @@ func TestUpdateDuties_ReturnsError(t *testing.T) { v := validator{ validatorClient: client, - keyManager: newMockKeymanager(t, randKeypair(t)), + km: newMockKeymanager(t, randKeypair(t)), duties: ðpb.DutiesResponse{ CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{ { @@ -505,7 +505,7 @@ func TestUpdateDuties_OK(t *testing.T) { }, } v := validator{ - keyManager: newMockKeymanager(t, randKeypair(t)), + km: newMockKeymanager(t, randKeypair(t)), validatorClient: client, } client.EXPECT().GetDuties( @@ -549,9 +549,9 @@ func TestUpdateDuties_OK_FilterBlacklistedPublicKeys(t *testing.T) { blacklistedPublicKeys[k] = true } v := validator{ - keyManager: km, - validatorClient: client, - eipImportBlacklistedPublicKeys: blacklistedPublicKeys, + km: km, + validatorClient: client, + blacklistedPubkeys: blacklistedPublicKeys, } resp := ðpb.DutiesResponse{ @@ -611,7 +611,7 @@ func TestUpdateDuties_AllValidatorsExited(t *testing.T) { }, } v := validator{ - keyManager: newMockKeymanager(t, randKeypair(t)), + km: newMockKeymanager(t, randKeypair(t)), validatorClient: client, } client.EXPECT().GetDuties( @@ -654,7 +654,7 @@ func TestUpdateDuties_Distributed(t *testing.T) { } v := validator{ - keyManager: newMockKeymanager(t, keys), + km: newMockKeymanager(t, keys), validatorClient: client, distributed: true, } @@ -997,7 +997,7 @@ func TestValidator_CheckDoppelGanger(t *testing.T) { } v := &validator{ validatorClient: client, - keyManager: km, + km: km, db: db, } client.EXPECT().CheckDoppelGanger( @@ -1038,7 +1038,7 @@ func TestValidator_CheckDoppelGanger(t *testing.T) { } v := &validator{ validatorClient: client, - keyManager: km, + km: km, db: db, } client.EXPECT().CheckDoppelGanger( @@ -1077,7 +1077,7 @@ func TestValidator_CheckDoppelGanger(t *testing.T) { } v := &validator{ validatorClient: client, - keyManager: km, + km: km, db: db, } client.EXPECT().CheckDoppelGanger( @@ -1122,7 +1122,7 @@ func TestValidator_CheckDoppelGanger(t *testing.T) { } v := &validator{ validatorClient: client, - keyManager: km, + km: km, db: db, } client.EXPECT().CheckDoppelGanger( @@ -1150,7 +1150,7 @@ func TestValidator_CheckDoppelGanger(t *testing.T) { } v := &validator{ validatorClient: client, - keyManager: km, + km: km, db: db, } client.EXPECT().CheckDoppelGanger( @@ -1366,7 +1366,7 @@ func TestValidator_WaitForKeymanagerInitialization_web3Signer(t *testing.T) { db: db, useWeb: false, wallet: w, - Web3SignerConfig: &remoteweb3signer.SetupConfig{ + web3SignerConfig: &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://localhost:8545", ProvidedPublicKeys: keys, }, @@ -1391,10 +1391,10 @@ func TestValidator_WaitForKeymanagerInitialization_Web(t *testing.T) { require.NoError(t, err) walletChan := make(chan *wallet.Wallet, 1) v := validator{ - db: db, - useWeb: true, - walletInitializedFeed: &event.Feed{}, - walletInitializedChannel: walletChan, + db: db, + useWeb: true, + walletInitializedFeed: &event.Feed{}, + walletInitializedChan: walletChan, } wait := make(chan struct{}) go func() { @@ -1992,7 +1992,7 @@ func TestValidator_PushSettings(t *testing.T) { pubkeys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) if tt.feeRecipientMap != nil { - feeRecipients, err := v.buildPrepProposerReqs(ctx, pubkeys) + feeRecipients, err := v.buildPrepProposerReqs(pubkeys) require.NoError(t, err) signedRegisterValidatorRequests := v.buildSignedRegReqs(ctx, pubkeys, km.Sign) for _, recipient := range feeRecipients { @@ -2148,7 +2148,7 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { } filteredKeys, err := v.filterAndCacheActiveKeys(ctx, pubkeys, 0) require.NoError(t, err) - actual, err := v.buildPrepProposerReqs(ctx, filteredKeys) + actual, err := v.buildPrepProposerReqs(filteredKeys) require.NoError(t, err) assert.DeepEqual(t, expected, actual) } @@ -2316,7 +2316,7 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { } filteredKeys, err := v.filterAndCacheActiveKeys(ctx, pubkeys, 641) require.NoError(t, err) - actual, err := v.buildPrepProposerReqs(ctx, filteredKeys) + actual, err := v.buildPrepProposerReqs(filteredKeys) require.NoError(t, err) assert.DeepEqual(t, expected, actual) } diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index b0b4396c2784..d4a61153d5f8 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -50,7 +50,7 @@ func (v *validator) WaitForActivation(ctx context.Context, accountsChangedChan c func (v *validator) internalWaitForActivation(ctx context.Context, accountsChangedChan <-chan [][fieldparams.BLSPubkeyLength]byte) error { ctx, span := trace.StartSpan(ctx, "validator.WaitForActivation") defer span.End() - validatingKeys, err := v.keyManager.FetchValidatingPublicKeys(ctx) + validatingKeys, err := v.km.FetchValidatingPublicKeys(ctx) if err != nil { return errors.Wrap(err, msgCouldNotFetchKeys) } @@ -120,7 +120,7 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 - valCounts, err := v.prysmBeaconClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) + valCounts, err := v.prysmChainClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return errors.Wrap(err, "could not get active validator count") } diff --git a/validator/client/wait_for_activation_test.go b/validator/client/wait_for_activation_test.go index 6d6a8d22eefa..5b6200466fa7 100644 --- a/validator/client/wait_for_activation_test.go +++ b/validator/client/wait_for_activation_test.go @@ -32,12 +32,12 @@ func TestWaitActivation_ContextCanceled(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) kp := randKeypair(t) v := validator{ validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - beaconClient: beaconClient, + km: newMockKeymanager(t, kp), + chainClient: chainClient, } clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) ctx, cancel := context.WithCancel(context.Background()) @@ -58,14 +58,14 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: newMockKeymanager(t, kp), + chainClient: chainClient, + prysmChainClient: prysmChainClient, } clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) validatorClient.EXPECT().WaitForActivation( @@ -74,7 +74,7 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, errors.New("failed stream")).Return(clientStream, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -89,14 +89,14 @@ func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testin ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: newMockKeymanager(t, kp), + chainClient: chainClient, + prysmChainClient: prysmChainClient, } clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) validatorClient.EXPECT().WaitForActivation( @@ -105,7 +105,7 @@ func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testin PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -125,15 +125,15 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - genesisTime: 1, - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: newMockKeymanager(t, kp), + genesisTime: 1, + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE @@ -144,7 +144,7 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -161,14 +161,14 @@ func TestWaitForActivation_Exiting(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: newMockKeymanager(t, kp), + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_EXITING @@ -179,7 +179,7 @@ func TestWaitForActivation_Exiting(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -201,17 +201,17 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) km := newMockKeymanager(t) v := validator{ - validatorClient: validatorClient, - keyManager: km, - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: km, + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE @@ -222,7 +222,7 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -258,13 +258,13 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { active := randKeypair(t) km := newMockKeymanager(t, inactive) validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) v := validator{ - validatorClient: validatorClient, - keyManager: km, - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: km, + chainClient: chainClient, + prysmChainClient: prysmChainClient, } inactiveResp := generateMockStatusResponse([][]byte{inactive.pub[:]}) inactiveResp.Statuses[0].Status.Status = ethpb.ValidatorStatus_UNKNOWN_STATUS @@ -279,7 +279,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { time.Sleep(time.Second * 2) return inactiveClientStream, nil }) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -348,14 +348,14 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { err = km.RecoverAccountsFromMnemonic(ctx, constant.TestMnemonic, derived.DefaultMnemonicLanguage, "", 1) require.NoError(t, err) validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) v := validator{ - validatorClient: validatorClient, - keyManager: km, - genesisTime: 1, - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: km, + genesisTime: 1, + chainClient: chainClient, + prysmChainClient: prysmChainClient, } inactiveResp := generateMockStatusResponse([][]byte{inactivePubKey[:]}) @@ -371,7 +371,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { time.Sleep(time.Second * 2) return inactiveClientStream, nil }) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -415,15 +415,15 @@ func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() validatorClient := validatormock.NewMockValidatorClient(ctrl) - beaconClient := validatormock.NewMockBeaconChainClient(ctrl) - prysmBeaconClient := validatormock.NewMockPrysmBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) + prysmChainClient := validatormock.NewMockPrysmChainClient(ctrl) kp := randKeypair(t) v := validator{ - validatorClient: validatorClient, - keyManager: newMockKeymanager(t, kp), - beaconClient: beaconClient, - prysmBeaconClient: prysmBeaconClient, + validatorClient: validatorClient, + km: newMockKeymanager(t, kp), + chainClient: chainClient, + prysmChainClient: prysmChainClient, } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE @@ -432,7 +432,7 @@ func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) { gomock.Any(), gomock.Any(), ).Return(clientStream, nil) - prysmBeaconClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().GetValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, diff --git a/validator/node/node.go b/validator/node/node.go index ea2509dc0f07..7789666c24b3 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -63,15 +63,15 @@ import ( // ValidatorClient defines an instance of an Ethereum validator that manages // the entire lifecycle of services attached to it participating in proof of stake. type ValidatorClient struct { - cliCtx *cli.Context - ctx context.Context - cancel context.CancelFunc - db iface.ValidatorDB - services *runtime.ServiceRegistry // Lifecycle and service store. - lock sync.RWMutex - wallet *wallet.Wallet - walletInitialized *event.Feed - stop chan struct{} // Channel to wait for termination notifications. + cliCtx *cli.Context + ctx context.Context + cancel context.CancelFunc + db iface.ValidatorDB + services *runtime.ServiceRegistry // Lifecycle and service store. + lock sync.RWMutex + wallet *wallet.Wallet + walletInitializedFeed *event.Feed + stop chan struct{} // Channel to wait for termination notifications. } // NewValidatorClient creates a new instance of the Prysm validator client. @@ -100,12 +100,12 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { registry := runtime.NewServiceRegistry() ctx, cancel := context.WithCancel(cliCtx.Context) validatorClient := &ValidatorClient{ - cliCtx: cliCtx, - ctx: ctx, - cancel: cancel, - services: registry, - walletInitialized: new(event.Feed), - stop: make(chan struct{}), + cliCtx: cliCtx, + ctx: ctx, + cancel: cancel, + services: registry, + walletInitializedFeed: new(event.Feed), + stop: make(chan struct{}), } if err := features.ConfigureValidator(cliCtx); err != nil { @@ -485,23 +485,13 @@ func (c *ValidatorClient) registerPrometheusService(cliCtx *cli.Context) error { func (c *ValidatorClient) registerValidatorService(cliCtx *cli.Context) error { var ( - endpoint string = c.cliCtx.String(flags.BeaconRPCProviderFlag.Name) - dataDir string = c.cliCtx.String(cmd.DataDirFlag.Name) - logValidatorBalances bool = !c.cliCtx.Bool(flags.DisablePenaltyRewardLogFlag.Name) - emitAccountMetrics bool = !c.cliCtx.Bool(flags.DisableAccountMetricsFlag.Name) - cert string = c.cliCtx.String(flags.CertFlag.Name) - graffiti string = c.cliCtx.String(flags.GraffitiFlag.Name) - maxCallRecvMsgSize int = c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - grpcRetries uint = c.cliCtx.Uint(flags.GrpcRetriesFlag.Name) - grpcRetryDelay time.Duration = c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name) - - interopKeysConfig *local.InteropKeymanagerConfig - err error + interopKmConfig *local.InteropKeymanagerConfig + err error ) // Configure interop. if c.cliCtx.IsSet(flags.InteropNumValidators.Name) { - interopKeysConfig = &local.InteropKeymanagerConfig{ + interopKmConfig = &local.InteropKeymanagerConfig{ Offset: cliCtx.Uint64(flags.InteropStartIndex.Name), NumValidatorKeys: cliCtx.Uint64(flags.InteropNumValidators.Name), } @@ -529,28 +519,27 @@ func (c *ValidatorClient) registerValidatorService(cliCtx *cli.Context) error { } validatorService, err := client.NewValidatorService(c.cliCtx.Context, &client.Config{ - Endpoint: endpoint, - DataDir: dataDir, - LogValidatorBalances: logValidatorBalances, - EmitAccountMetrics: emitAccountMetrics, - CertFlag: cert, - GraffitiFlag: g.ParseHexGraffiti(graffiti), - GrpcMaxCallRecvMsgSizeFlag: maxCallRecvMsgSize, - GrpcRetriesFlag: grpcRetries, - GrpcRetryDelay: grpcRetryDelay, - GrpcHeadersFlag: c.cliCtx.String(flags.GrpcHeadersFlag.Name), - ValDB: c.db, - UseWeb: c.cliCtx.Bool(flags.EnableWebFlag.Name), - InteropKeysConfig: interopKeysConfig, - Wallet: c.wallet, - WalletInitializedFeed: c.walletInitialized, - GraffitiStruct: graffitiStruct, - Web3SignerConfig: web3signerConfig, - ProposerSettings: ps, - BeaconApiTimeout: time.Second * 30, - BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRESTApiProviderFlag.Name), - ValidatorsRegBatchSize: c.cliCtx.Int(flags.ValidatorsRegistrationBatchSizeFlag.Name), - Distributed: c.cliCtx.Bool(flags.EnableDistributed.Name), + DB: c.db, + Wallet: c.wallet, + WalletInitializedFeed: c.walletInitializedFeed, + GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), + GRPCRetries: c.cliCtx.Uint(flags.GrpcRetriesFlag.Name), + GRPCRetryDelay: c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name), + GRPCHeaders: strings.Split(c.cliCtx.String(flags.GrpcHeadersFlag.Name), ","), + BeaconNodeGRPCEndpoint: c.cliCtx.String(flags.BeaconRPCProviderFlag.Name), + BeaconNodeCert: c.cliCtx.String(flags.CertFlag.Name), + BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRESTApiProviderFlag.Name), + BeaconApiTimeout: time.Second * 30, + Graffiti: g.ParseHexGraffiti(c.cliCtx.String(flags.GraffitiFlag.Name)), + GraffitiStruct: graffitiStruct, + InteropKmConfig: interopKmConfig, + Web3SignerConfig: web3signerConfig, + ProposerSettings: ps, + ValidatorsRegBatchSize: c.cliCtx.Int(flags.ValidatorsRegistrationBatchSizeFlag.Name), + UseWeb: c.cliCtx.Bool(flags.EnableWebFlag.Name), + LogValidatorPerformance: !c.cliCtx.Bool(flags.DisablePenaltyRewardLogFlag.Name), + EmitAccountMetrics: !c.cliCtx.Bool(flags.DisableAccountMetricsFlag.Name), + Distributed: c.cliCtx.Bool(flags.EnableDistributed.Name), }) if err != nil { return errors.Wrap(err, "could not initialize validator service") @@ -625,58 +614,27 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { if err := c.services.FetchService(&vs); err != nil { return err } - validatorGatewayHost := c.cliCtx.String(flags.GRPCGatewayHost.Name) - validatorGatewayPort := c.cliCtx.Int(flags.GRPCGatewayPort.Name) - validatorMonitoringHost := c.cliCtx.String(cmd.MonitoringHostFlag.Name) - validatorMonitoringPort := c.cliCtx.Int(flags.MonitoringPortFlag.Name) - rpcHost := c.cliCtx.String(flags.RPCHost.Name) - rpcPort := c.cliCtx.Int(flags.RPCPort.Name) - nodeGatewayEndpoint := c.cliCtx.String(flags.BeaconRPCGatewayProviderFlag.Name) - beaconClientEndpoint := c.cliCtx.String(flags.BeaconRPCProviderFlag.Name) - maxCallRecvMsgSize := c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - grpcRetries := c.cliCtx.Uint(flags.GrpcRetriesFlag.Name) - grpcRetryDelay := c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name) - walletDir := c.cliCtx.String(flags.WalletDirFlag.Name) - grpcHeaders := c.cliCtx.String(flags.GrpcHeadersFlag.Name) - clientCert := c.cliCtx.String(flags.CertFlag.Name) - - authTokenPath := c.cliCtx.String(flags.AuthTokenPathFlag.Name) - // if no auth token path flag was passed try to set a default value - if authTokenPath == "" { - authTokenPath = flags.AuthTokenPathFlag.Value - // if a wallet dir is passed without an auth token then override the default with the wallet dir - if walletDir != "" { - authTokenPath = filepath.Join(walletDir, api.AuthTokenFileName) - } - } - - server := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ - ValDB: c.db, - Host: rpcHost, - Port: fmt.Sprintf("%d", rpcPort), - WalletInitializedFeed: c.walletInitialized, - ValidatorService: vs, - SyncChecker: vs, - GenesisFetcher: vs, - NodeGatewayEndpoint: nodeGatewayEndpoint, - AuthTokenPath: authTokenPath, - WalletDir: walletDir, - Wallet: c.wallet, - ValidatorGatewayHost: validatorGatewayHost, - ValidatorGatewayPort: validatorGatewayPort, - ValidatorMonitoringHost: validatorMonitoringHost, - ValidatorMonitoringPort: validatorMonitoringPort, - BeaconClientEndpoint: beaconClientEndpoint, - ClientMaxCallRecvMsgSize: maxCallRecvMsgSize, - ClientGrpcRetries: grpcRetries, - ClientGrpcRetryDelay: grpcRetryDelay, - ClientGrpcHeaders: strings.Split(grpcHeaders, ","), - ClientWithCert: clientCert, - BeaconApiTimeout: time.Second * 30, - BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRESTApiProviderFlag.Name), - Router: router, + s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ + Host: c.cliCtx.String(flags.RPCHost.Name), + Port: fmt.Sprintf("%d", c.cliCtx.Int(flags.RPCPort.Name)), + GRPCGatewayHost: c.cliCtx.String(flags.GRPCGatewayHost.Name), + GRPCGatewayPort: c.cliCtx.Int(flags.GRPCGatewayPort.Name), + GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), + GRPCRetries: c.cliCtx.Uint(flags.GrpcRetriesFlag.Name), + GRPCRetryDelay: c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name), + GRPCHeaders: strings.Split(c.cliCtx.String(flags.GrpcHeadersFlag.Name), ","), + BeaconNodeGRPCEndpoint: c.cliCtx.String(flags.BeaconRPCProviderFlag.Name), + BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRPCGatewayProviderFlag.Name), + BeaconApiTimeout: time.Second * 30, + BeaconNodeCert: c.cliCtx.String(flags.CertFlag.Name), + DB: c.db, + Wallet: c.wallet, + WalletDir: c.cliCtx.String(flags.WalletDirFlag.Name), + WalletInitializedFeed: c.walletInitializedFeed, + ValidatorService: vs, + Router: router, }) - return c.services.RegisterService(server) + return c.services.RegisterService(s) } func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 2e270bdeec96..5c07cd7a9c09 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -81,7 +81,6 @@ go_library( "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//reflection:go_default_library", "@org_golang_google_grpc//status:go_default_library", diff --git a/validator/rpc/auth_token.go b/validator/rpc/auth_token.go index a87dbfb596df..ecff1019b570 100644 --- a/validator/rpc/auth_token.go +++ b/validator/rpc/auth_token.go @@ -104,7 +104,7 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) continue } - validatorWebAddr := fmt.Sprintf("%s:%d", s.validatorGatewayHost, s.validatorGatewayPort) + validatorWebAddr := fmt.Sprintf("%s:%d", s.grpcGatewayHost, s.grpcGatewayPort) logValidatorWebAuth(validatorWebAddr, s.authToken, authTokenPath) case err := <-watcher.Errors: log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) diff --git a/validator/rpc/beacon.go b/validator/rpc/beacon.go index 7355c93bd153..e86dd2a7ce6e 100644 --- a/validator/rpc/beacon.go +++ b/validator/rpc/beacon.go @@ -27,26 +27,26 @@ func (s *Server) registerBeaconClient() error { grpcretry.StreamClientInterceptor(), )) dialOpts := client.ConstructDialOptions( - s.clientMaxCallRecvMsgSize, - s.clientWithCert, - s.clientGrpcRetries, - s.clientGrpcRetryDelay, + s.grpcMaxCallRecvMsgSize, + s.beaconNodeCert, + s.grpcRetries, + s.grpcRetryDelay, streamInterceptor, ) if dialOpts == nil { return errors.New("no dial options for beacon chain gRPC client") } - s.ctx = grpcutil.AppendHeaders(s.ctx, s.clientGrpcHeaders) + s.ctx = grpcutil.AppendHeaders(s.ctx, s.grpcHeaders) - grpcConn, err := grpc.DialContext(s.ctx, s.beaconClientEndpoint, dialOpts...) + grpcConn, err := grpc.DialContext(s.ctx, s.beaconNodeEndpoint, dialOpts...) if err != nil { - return errors.Wrapf(err, "could not dial endpoint: %s", s.beaconClientEndpoint) + return errors.Wrapf(err, "could not dial endpoint: %s", s.beaconNodeEndpoint) } - if s.clientWithCert != "" { + if s.beaconNodeCert != "" { log.Info("Established secure gRPC connection") } - s.beaconNodeHealthClient = ethpb.NewHealthClient(grpcConn) + s.healthClient = ethpb.NewHealthClient(grpcConn) conn := validatorHelpers.NewNodeConnection( grpcConn, @@ -56,8 +56,8 @@ func (s *Server) registerBeaconClient() error { restHandler := beaconApi.NewBeaconApiJsonRestHandler(http.Client{Timeout: s.beaconApiTimeout}, s.beaconApiEndpoint) - s.beaconChainClient = beaconChainClientFactory.NewBeaconChainClient(conn, restHandler) - s.beaconNodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) + s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) + s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler) return nil diff --git a/validator/rpc/beacon_test.go b/validator/rpc/beacon_test.go index 2fb873e4d9d7..ec7b957351d0 100644 --- a/validator/rpc/beacon_test.go +++ b/validator/rpc/beacon_test.go @@ -11,8 +11,8 @@ import ( func TestGrpcHeaders(t *testing.T) { s := &Server{ - ctx: context.Background(), - clientGrpcHeaders: []string{"first=value1", "second=value2"}, + ctx: context.Background(), + grpcHeaders: []string{"first=value1", "second=value2"}, } err := s.registerBeaconClient() require.NoError(t, err) diff --git a/validator/rpc/handlers_accounts.go b/validator/rpc/handlers_accounts.go index 06e2b31ba9f0..8ad2bbb85a32 100644 --- a/validator/rpc/handlers_accounts.go +++ b/validator/rpc/handlers_accounts.go @@ -258,7 +258,7 @@ func (s *Server) VoluntaryExit(w http.ResponseWriter, r *http.Request) { } cfg := accounts.PerformExitCfg{ ValidatorClient: s.beaconNodeValidatorClient, - NodeClient: s.beaconNodeClient, + NodeClient: s.nodeClient, Keymanager: km, RawPubKeys: pubKeys, FormattedPubKeys: req.PublicKeys, diff --git a/validator/rpc/handlers_accounts_test.go b/validator/rpc/handlers_accounts_test.go index 99779bf70038..a011ab9ee80f 100644 --- a/validator/rpc/handlers_accounts_test.go +++ b/validator/rpc/handlers_accounts_test.go @@ -292,7 +292,7 @@ func TestServer_VoluntaryExit(t *testing.T) { s := &Server{ walletInitialized: true, wallet: w, - beaconNodeClient: mockNodeClient, + nodeClient: mockNodeClient, beaconNodeValidatorClient: mockValidatorClient, validatorService: vs, } diff --git a/validator/rpc/handlers_beacon.go b/validator/rpc/handlers_beacon.go index 107cd5373407..9a6afc920a41 100644 --- a/validator/rpc/handlers_beacon.go +++ b/validator/rpc/handlers_beacon.go @@ -25,30 +25,30 @@ import ( func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetBeaconStatus") defer span.End() - syncStatus, err := s.beaconNodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := s.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Error("beacon node call to get sync status failed") httputil.WriteJson(w, &BeaconStatusResponse{ - BeaconNodeEndpoint: s.nodeGatewayEndpoint, + BeaconNodeEndpoint: s.beaconNodeEndpoint, Connected: false, Syncing: false, }) return } - genesis, err := s.beaconNodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesis, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "GetGenesis call failed").Error(), http.StatusInternalServerError) return } genesisTime := uint64(time.Unix(genesis.GenesisTime.Seconds, 0).Unix()) address := genesis.DepositContractAddress - chainHead, err := s.beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + chainHead, err := s.chainClient.GetChainHead(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "GetChainHead").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, &BeaconStatusResponse{ - BeaconNodeEndpoint: s.beaconClientEndpoint, + BeaconNodeEndpoint: s.beaconNodeEndpoint, Connected: true, Syncing: syncStatus.Syncing, GenesisTime: fmt.Sprintf("%d", genesisTime), @@ -85,7 +85,7 @@ func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) req := ðpb.ValidatorPerformanceRequest{ PublicKeys: pubkeys, } - validatorPerformance, err := s.beaconChainClient.GetValidatorPerformance(ctx, req) + validatorPerformance, err := s.chainClient.GetValidatorPerformance(ctx, req) if err != nil { httputil.HandleError(w, errors.Wrap(err, "GetValidatorPerformance call failed").Error(), http.StatusInternalServerError) return @@ -133,7 +133,7 @@ func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request) { PageSize: int32(ps), PageToken: pageToken, } - listValidatorBalances, err := s.beaconChainClient.ListValidatorBalances(ctx, req) + listValidatorBalances, err := s.chainClient.ListValidatorBalances(ctx, req) if err != nil { httputil.HandleError(w, errors.Wrap(err, "ListValidatorBalances call failed").Error(), http.StatusInternalServerError) return @@ -187,7 +187,7 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { PageSize: int32(ps), PageToken: pageToken, } - validators, err := s.beaconChainClient.ListValidators(ctx, req) + validators, err := s.chainClient.ListValidators(ctx, req) if err != nil { httputil.HandleError(w, errors.Wrap(err, "ListValidators call failed").Error(), http.StatusInternalServerError) return @@ -204,7 +204,7 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { func (s *Server) GetPeers(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetPeers") defer span.End() - peers, err := s.beaconNodeClient.ListPeers(ctx, &emptypb.Empty{}) + peers, err := s.nodeClient.ListPeers(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "ListPeers call failed").Error(), http.StatusInternalServerError) return diff --git a/validator/rpc/handlers_beacon_test.go b/validator/rpc/handlers_beacon_test.go index 5dd9bab4540a..83042cb1e3d7 100644 --- a/validator/rpc/handlers_beacon_test.go +++ b/validator/rpc/handlers_beacon_test.go @@ -27,7 +27,7 @@ func TestGetBeaconStatus_NotConnected(t *testing.T) { gomock.Any(), ).Return(nil /*response*/, errors.New("uh oh")) srv := &Server{ - beaconNodeClient: nodeClient, + nodeClient: nodeClient, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/v2/validator/beacon/status"), nil) wr := httptest.NewRecorder() @@ -47,7 +47,7 @@ func TestGetBeaconStatus_NotConnected(t *testing.T) { func TestGetBeaconStatus_OK(t *testing.T) { ctrl := gomock.NewController(t) nodeClient := validatormock.NewMockNodeClient(ctrl) - beaconChainClient := validatormock.NewMockBeaconChainClient(ctrl) + chainClient := validatormock.NewMockChainClient(ctrl) nodeClient.EXPECT().GetSyncStatus( gomock.Any(), // ctx gomock.Any(), @@ -60,15 +60,15 @@ func TestGetBeaconStatus_OK(t *testing.T) { GenesisTime: timeStamp, DepositContractAddress: []byte("hello"), }, nil) - beaconChainClient.EXPECT().GetChainHead( + chainClient.EXPECT().GetChainHead( gomock.Any(), // ctx gomock.Any(), ).Return(ðpb.ChainHead{ HeadEpoch: 1, }, nil) srv := &Server{ - beaconNodeClient: nodeClient, - beaconChainClient: beaconChainClient, + nodeClient: nodeClient, + chainClient: chainClient, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/v2/validator/beacon/status"), nil) @@ -228,7 +228,7 @@ func TestServer_GetValidators(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ctrl := gomock.NewController(t) - beaconChainClient := validatormock.NewMockBeaconChainClient(ctrl) + beaconChainClient := validatormock.NewMockChainClient(ctrl) if tt.wantErr == "" { beaconChainClient.EXPECT().ListValidators( gomock.Any(), // ctx @@ -236,7 +236,7 @@ func TestServer_GetValidators(t *testing.T) { ).Return(tt.chainResp, nil) } s := &Server{ - beaconChainClient: beaconChainClient, + chainClient: beaconChainClient, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/v2/validator/beacon/validators?%s", tt.query), http.NoBody) wr := httptest.NewRecorder() diff --git a/validator/rpc/handlers_health.go b/validator/rpc/handlers_health.go index 8e7f6f437922..dc6e05b068c0 100644 --- a/validator/rpc/handlers_health.go +++ b/validator/rpc/handlers_health.go @@ -18,7 +18,7 @@ func (s *Server) GetVersion(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.health.GetVersion") defer span.End() - beacon, err := s.beaconNodeClient.GetVersion(ctx, &emptypb.Empty{}) + beacon, err := s.nodeClient.GetVersion(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) return @@ -51,7 +51,7 @@ func (s *Server) StreamBeaconLogs(w http.ResponseWriter, r *http.Request) { return } // TODO: StreamBeaconLogs grpc will need to be replaced in the future - client, err := s.beaconNodeHealthClient.StreamBeaconLogs(ctx, &emptypb.Empty{}) + client, err := s.healthClient.StreamBeaconLogs(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) return @@ -102,8 +102,8 @@ func (s *Server) StreamValidatorLogs(w http.ResponseWriter, r *http.Request) { return } - ch := make(chan []byte, s.streamLogsBufferSize) - sub := s.logsStreamer.LogsFeed().Subscribe(ch) + ch := make(chan []byte, s.logStreamerBufferSize) + sub := s.logStreamer.LogsFeed().Subscribe(ch) defer func() { sub.Unsubscribe() close(ch) @@ -113,7 +113,7 @@ func (s *Server) StreamValidatorLogs(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", api.KeepAlive) - recentLogs := s.logsStreamer.GetLastFewLogs() + recentLogs := s.logStreamer.GetLastFewLogs() logStrings := make([]string, len(recentLogs)) for i, l := range recentLogs { logStrings[i] = string(l) diff --git a/validator/rpc/handlers_health_test.go b/validator/rpc/handlers_health_test.go index 4a6e22ec2cfe..bb983d9e5c66 100644 --- a/validator/rpc/handlers_health_test.go +++ b/validator/rpc/handlers_health_test.go @@ -73,8 +73,8 @@ func TestStreamBeaconLogs(t *testing.T) { // Setting up the mock in the server struct s := Server{ - ctx: context.Background(), - beaconNodeHealthClient: mockClient, + ctx: context.Background(), + healthClient: mockClient, } // Create a mock ResponseWriter and Request @@ -119,9 +119,9 @@ func TestStreamValidatorLogs(t *testing.T) { logStreamer := mock.NewMockStreamer(mockLogs) // Setting up the mock in the server struct s := Server{ - ctx: ctx, - logsStreamer: logStreamer, - streamLogsBufferSize: 100, + ctx: ctx, + logStreamer: logStreamer, + logStreamerBufferSize: 100, } w := &flushableResponseRecorder{ @@ -170,8 +170,8 @@ func TestServer_GetVersion(t *testing.T) { ctx := context.Background() mockNodeClient := validatormock.NewMockNodeClient(ctrl) s := Server{ - ctx: ctx, - beaconNodeClient: mockNodeClient, + ctx: ctx, + nodeClient: mockNodeClient, } mockNodeClient.EXPECT().GetVersion(gomock.Any(), gomock.Any()).Return(ð.Version{ Version: "4.10.1", diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index d5c1d1fa2b9d..9725bde7651e 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -133,7 +133,7 @@ func (s *Server) ImportKeystores(w http.ResponseWriter, r *http.Request) { keystores[i] = k } if req.SlashingProtection != "" { - if s.valDB == nil || s.valDB.ImportStandardProtectionJSON(ctx, bytes.NewBufferString(req.SlashingProtection)) != nil { + if s.db == nil || s.db.ImportStandardProtectionJSON(ctx, bytes.NewBufferString(req.SlashingProtection)) != nil { statuses := make([]*keymanager.KeyStatus, len(req.Keystores)) for i := 0; i < len(req.Keystores); i++ { statuses[i] = &keymanager.KeyStatus{ @@ -285,11 +285,11 @@ func (s *Server) transformDeletedKeysStatuses( // Gets a map of all public keys in the database, useful for O(1) lookups. func (s *Server) publicKeysInDB(ctx context.Context) (map[[fieldparams.BLSPubkeyLength]byte]bool, error) { pubKeysInDB := make(map[[fieldparams.BLSPubkeyLength]byte]bool) - attestedPublicKeys, err := s.valDB.AttestedPublicKeys(ctx) + attestedPublicKeys, err := s.db.AttestedPublicKeys(ctx) if err != nil { return nil, fmt.Errorf("could not get attested public keys from DB: %v", err) } - proposedPublicKeys, err := s.valDB.ProposedPublicKeys(ctx) + proposedPublicKeys, err := s.db.ProposedPublicKeys(ctx) if err != nil { return nil, fmt.Errorf("could not get proposed public keys from DB: %v", err) } @@ -313,7 +313,7 @@ func (s *Server) slashingProtectionHistoryForDeletedKeys( filteredKeys = append(filteredKeys, pk) } } - return slashingprotection.ExportStandardProtectionJSON(ctx, s.valDB, filteredKeys...) + return slashingprotection.ExportStandardProtectionJSON(ctx, s.db, filteredKeys...) } // SetVoluntaryExit creates a signed voluntary exit message and returns a VoluntaryExit object. @@ -347,7 +347,7 @@ func (s *Server) SetVoluntaryExit(w http.ResponseWriter, r *http.Request) { epoch := primitives.Epoch(e) if rawEpoch == "" { - genesisResponse, err := s.beaconNodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "Failed to get genesis time").Error(), http.StatusInternalServerError) return @@ -414,7 +414,7 @@ func (s *Server) ListRemoteKeys(w http.ResponseWriter, r *http.Request) { for i := 0; i < len(pubKeys); i++ { keystoreResponse[i] = &RemoteKey{ Pubkey: hexutil.Encode(pubKeys[i][:]), - Url: s.validatorService.Web3SignerConfig.BaseEndpoint, + Url: s.validatorService.RemoteSignerConfig().BaseEndpoint, Readonly: true, } } diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 48e08ef92b73..2ec1d6b42de9 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -289,7 +289,7 @@ func TestServer_ImportKeystores(t *testing.T) { }) } require.NoError(t, err) - s.valDB = validatorDB + s.db = validatorDB // Have to close it after import is done otherwise it complains db is not open. defer func() { @@ -413,7 +413,7 @@ func TestServer_DeleteKeystores(t *testing.T) { }) } require.NoError(t, err) - srv.valDB = validatorDB + srv.db = validatorDB // Have to close it after import is done otherwise it complains db is not open. defer func() { @@ -589,7 +589,7 @@ func TestServer_DeleteKeystores_FailedSlashingProtectionExport(t *testing.T) { require.NoError(t, err) err = validatorDB.SaveGenesisValidatorsRoot(ctx, make([]byte, fieldparams.RootLength)) require.NoError(t, err) - srv.valDB = validatorDB + srv.db = validatorDB // Have to close it after import is done otherwise it complains db is not open. defer func() { @@ -746,7 +746,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { validatorService: vs, beaconNodeValidatorClient: beaconClient, wallet: w, - beaconNodeClient: mockNodeClient, + nodeClient: mockNodeClient, walletInitialized: w != nil, } @@ -841,7 +841,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { resp := &SetVoluntaryExitResponse{} require.NoError(t, json.Unmarshal(w.Body.Bytes(), resp)) if tt.w.epoch == 0 { - genesisResponse, err := s.beaconNodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) require.NoError(t, err) tt.w.epoch, err = client.CurrentEpoch(genesisResponse.GenesisTime) require.NoError(t, err) @@ -1091,14 +1091,14 @@ func TestServer_SetGasLimit(t *testing.T) { validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal) vs, err := client.NewValidatorService(ctx, &client.Config{ Validator: m, - ValDB: validatorDB, + DB: validatorDB, }) require.NoError(t, err) s := &Server{ validatorService: vs, beaconNodeValidatorClient: beaconClient, - valDB: validatorDB, + db: validatorDB, } if tt.beaconReturn != nil { @@ -1280,12 +1280,12 @@ func TestServer_DeleteGasLimit(t *testing.T) { validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal) vs, err := client.NewValidatorService(ctx, &client.Config{ Validator: m, - ValDB: validatorDB, + DB: validatorDB, }) require.NoError(t, err) s := &Server{ validatorService: vs, - valDB: validatorDB, + db: validatorDB, } // Set up global default value for builder gas limit. params.BeaconConfig().DefaultBuilderGasLimit = uint64(globalDefaultGasLimit) @@ -1744,13 +1744,13 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) { // save a default here vs, err := client.NewValidatorService(ctx, &client.Config{ Validator: m, - ValDB: validatorDB, + DB: validatorDB, }) require.NoError(t, err) s := &Server{ validatorService: vs, beaconNodeValidatorClient: beaconClient, - valDB: validatorDB, + db: validatorDB, } request := &SetFeeRecipientByPubkeyRequest{ Ethaddress: tt.args, @@ -1854,12 +1854,12 @@ func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal) vs, err := client.NewValidatorService(ctx, &client.Config{ Validator: m, - ValDB: validatorDB, + DB: validatorDB, }) require.NoError(t, err) s := &Server{ validatorService: vs, - valDB: validatorDB, + db: validatorDB, } req := httptest.NewRequest(http.MethodDelete, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) diff --git a/validator/rpc/handlers_slashing.go b/validator/rpc/handlers_slashing.go index a1b8ae4d9d8f..49a1596bd66e 100644 --- a/validator/rpc/handlers_slashing.go +++ b/validator/rpc/handlers_slashing.go @@ -24,12 +24,12 @@ func (s *Server) ExportSlashingProtection(w http.ResponseWriter, r *http.Request ctx, span := trace.StartSpan(r.Context(), "validator.ExportSlashingProtection") defer span.End() - if s.valDB == nil { + if s.db == nil { httputil.HandleError(w, "could not find validator database", http.StatusInternalServerError) return } - eipJSON, err := slashing.ExportStandardProtectionJSON(ctx, s.valDB) + eipJSON, err := slashing.ExportStandardProtectionJSON(ctx, s.db) if err != nil { httputil.HandleError(w, errors.Wrap(err, "could not export slashing protection history").Error(), http.StatusInternalServerError) return @@ -54,7 +54,7 @@ func (s *Server) ImportSlashingProtection(w http.ResponseWriter, r *http.Request ctx, span := trace.StartSpan(r.Context(), "validator.ImportSlashingProtection") defer span.End() - if s.valDB == nil { + if s.db == nil { httputil.HandleError(w, "could not find validator database", http.StatusInternalServerError) return } @@ -76,7 +76,7 @@ func (s *Server) ImportSlashingProtection(w http.ResponseWriter, r *http.Request } enc := []byte(req.SlashingProtectionJson) buf := bytes.NewBuffer(enc) - if err := s.valDB.ImportStandardProtectionJSON(ctx, buf); err != nil { + if err := s.db.ImportStandardProtectionJSON(ctx, buf); err != nil { httputil.HandleError(w, errors.Wrap(err, "could not import slashing protection history").Error(), http.StatusInternalServerError) return } diff --git a/validator/rpc/handlers_slashing_test.go b/validator/rpc/handlers_slashing_test.go index 4ed09d1360d2..5bcc3140b0b8 100644 --- a/validator/rpc/handlers_slashing_test.go +++ b/validator/rpc/handlers_slashing_test.go @@ -77,7 +77,7 @@ func TestImportSlashingProtection_Preconditions(t *testing.T) { }) } require.NoError(t, err) - s.valDB = validatorDB + s.db = validatorDB // Have to close it after import is done otherwise it complains db is not open. defer func() { @@ -151,7 +151,7 @@ func TestExportSlashingProtection_Preconditions(t *testing.T) { }) } require.NoError(t, err) - s.valDB = validatorDB + s.db = validatorDB // Have to close it after export is done otherwise it complains db is not open. defer func() { @@ -189,7 +189,7 @@ func TestImportExportSlashingProtection_RoundTrip(t *testing.T) { PubKeys: pubKeys, }) require.NoError(t, err) - s.valDB = validatorDB + s.db = validatorDB // Have to close it after import is done otherwise it complains db is not open. defer func() { diff --git a/validator/rpc/server.go b/validator/rpc/server.go index a0737d485c64..eacc8eb7a259 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -23,122 +23,83 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client" iface "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/db" - "github.com/sirupsen/logrus" "go.opencensus.io/plugin/ocgrpc" "google.golang.org/grpc" - "google.golang.org/grpc/credentials" "google.golang.org/grpc/reflection" ) // Config options for the gRPC server. type Config struct { - ValidatorGatewayHost string - ValidatorGatewayPort int - ValidatorMonitoringHost string - ValidatorMonitoringPort int - BeaconClientEndpoint string - ClientMaxCallRecvMsgSize int - ClientGrpcRetries uint - ClientGrpcRetryDelay time.Duration - ClientGrpcHeaders []string - ClientWithCert string - Host string - Port string - CertFlag string - KeyFlag string - ValDB db.Database - AuthTokenPath string - WalletDir string - ValidatorService *client.ValidatorService - SyncChecker client.SyncChecker - GenesisFetcher client.GenesisFetcher - WalletInitializedFeed *event.Feed - NodeGatewayEndpoint string - BeaconApiEndpoint string - BeaconApiTimeout time.Duration - Router *mux.Router - Wallet *wallet.Wallet + Host string + Port string + GRPCGatewayHost string + GRPCGatewayPort int + GRPCMaxCallRecvMsgSize int + GRPCRetries uint + GRPCRetryDelay time.Duration + GRPCHeaders []string + BeaconNodeGRPCEndpoint string + BeaconApiEndpoint string + BeaconApiTimeout time.Duration + BeaconNodeCert string + DB db.Database + Wallet *wallet.Wallet + WalletDir string + WalletInitializedFeed *event.Feed + ValidatorService *client.ValidatorService + Router *mux.Router } // Server defining a gRPC server for the remote signer API. type Server struct { - logsStreamer logs.Streamer - streamLogsBufferSize int - beaconChainClient iface.BeaconChainClient - beaconNodeClient iface.NodeClient - beaconNodeValidatorClient iface.ValidatorClient - beaconNodeHealthClient ethpb.HealthClient - valDB db.Database ctx context.Context cancel context.CancelFunc - beaconClientEndpoint string - clientMaxCallRecvMsgSize int - clientGrpcRetries uint - clientGrpcRetryDelay time.Duration - clientGrpcHeaders []string - clientWithCert string host string port string + grpcGatewayHost string + grpcGatewayPort int listener net.Listener - withCert string - withKey string - credentialError error + grpcMaxCallRecvMsgSize int + grpcRetries uint + grpcRetryDelay time.Duration + grpcHeaders []string grpcServer *grpc.Server + beaconNodeValidatorClient iface.ValidatorClient + chainClient iface.ChainClient + nodeClient iface.NodeClient + healthClient ethpb.HealthClient + beaconNodeEndpoint string + beaconApiEndpoint string + beaconApiTimeout time.Duration + beaconNodeCert string jwtSecret []byte - validatorService *client.ValidatorService - syncChecker client.SyncChecker - genesisFetcher client.GenesisFetcher authTokenPath string authToken string + db db.Database walletDir string wallet *wallet.Wallet walletInitializedFeed *event.Feed walletInitialized bool - nodeGatewayEndpoint string - validatorMonitoringHost string - validatorMonitoringPort int - validatorGatewayHost string - validatorGatewayPort int - beaconApiEndpoint string - beaconApiTimeout time.Duration + validatorService *client.ValidatorService router *mux.Router + logStreamer logs.Streamer + logStreamerBufferSize int } // NewServer instantiates a new gRPC server. func NewServer(ctx context.Context, cfg *Config) *Server { ctx, cancel := context.WithCancel(ctx) server := &Server{ - ctx: ctx, - cancel: cancel, - logsStreamer: logs.NewStreamServer(), - streamLogsBufferSize: 1000, // Enough to handle most bursts of logs in the validator client. - host: cfg.Host, - port: cfg.Port, - withCert: cfg.CertFlag, - withKey: cfg.KeyFlag, - beaconClientEndpoint: cfg.BeaconClientEndpoint, - clientMaxCallRecvMsgSize: cfg.ClientMaxCallRecvMsgSize, - clientGrpcRetries: cfg.ClientGrpcRetries, - clientGrpcRetryDelay: cfg.ClientGrpcRetryDelay, - clientGrpcHeaders: cfg.ClientGrpcHeaders, - clientWithCert: cfg.ClientWithCert, - valDB: cfg.ValDB, - validatorService: cfg.ValidatorService, - syncChecker: cfg.SyncChecker, - genesisFetcher: cfg.GenesisFetcher, - authTokenPath: cfg.AuthTokenPath, - walletDir: cfg.WalletDir, - walletInitializedFeed: cfg.WalletInitializedFeed, - walletInitialized: cfg.Wallet != nil, - wallet: cfg.Wallet, - nodeGatewayEndpoint: cfg.NodeGatewayEndpoint, - validatorMonitoringHost: cfg.ValidatorMonitoringHost, - validatorMonitoringPort: cfg.ValidatorMonitoringPort, - validatorGatewayHost: cfg.ValidatorGatewayHost, - validatorGatewayPort: cfg.ValidatorGatewayPort, - beaconApiTimeout: cfg.BeaconApiTimeout, - beaconApiEndpoint: cfg.BeaconApiEndpoint, - router: cfg.Router, + ctx: ctx, + cancel: cancel, + host: cfg.Host, + port: cfg.Port, + grpcGatewayHost: cfg.GRPCGatewayHost, + grpcGatewayPort: cfg.GRPCGatewayPort, + grpcMaxCallRecvMsgSize: cfg.GRPCMaxCallRecvMsgSize, + grpcRetries: cfg.GRPCRetries, + grpcRetryDelay: cfg.GRPCRetryDelay, + grpcHeaders: cfg.GRPCHeaders, } if server.authTokenPath == "" && server.walletDir != "" { @@ -149,7 +110,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { if err := server.initializeAuthToken(); err != nil { log.WithError(err).Error("Could not initialize web auth token") } - validatorWebAddr := fmt.Sprintf("%s:%d", server.validatorGatewayHost, server.validatorGatewayPort) + validatorWebAddr := fmt.Sprintf("%s:%d", server.grpcGatewayHost, server.grpcGatewayPort) logValidatorWebAuth(validatorWebAddr, server.authToken, server.authTokenPath) go server.refreshAuthTokenFromFileChanges(server.ctx, server.authTokenPath) } @@ -184,17 +145,7 @@ func (s *Server) Start() { )), } grpcprometheus.EnableHandlingTimeHistogram() - if s.withCert != "" && s.withKey != "" { - creds, err := credentials.NewServerTLSFromFile(s.withCert, s.withKey) - if err != nil { - log.WithError(err).Fatal("Could not load TLS keys") - } - opts = append(opts, grpc.Creds(creds)) - log.WithFields(logrus.Fields{ - "certPath": s.withCert, - "keyPath": s.withKey, - }).Info("Loaded TLS certificates") - } + s.grpcServer = grpc.NewServer(opts...) // Register a gRPC client to the beacon node. @@ -282,7 +233,7 @@ func (s *Server) Stop() error { return nil } -// Status returns nil or credentialError. +// Status returns an error if the service is unhealthy. func (s *Server) Status() error { - return s.credentialError + return nil } From 3df3e842708a5aeb7848badc2c11272685fe91b3 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Tue, 21 May 2024 22:09:49 +0200 Subject: [PATCH 101/325] Fuzz ssz round trip (#14006) * Initial commit * Fuzz all generated ssz en/decoders. * Make proto message comparison aware of nested proto messages and differing unknown fields therein. * Don't name receiver variable if not necessary. * Run gazelle --- beacon-chain/p2p/encoder/BUILD.bazel | 5 + beacon-chain/p2p/encoder/ssz_test.go | 555 +++++++++++++++++++++++++++ 2 files changed, 560 insertions(+) diff --git a/beacon-chain/p2p/encoder/BUILD.bazel b/beacon-chain/p2p/encoder/BUILD.bazel index 374e6d4f7e65..27c5f71bddc3 100644 --- a/beacon-chain/p2p/encoder/BUILD.bazel +++ b/beacon-chain/p2p/encoder/BUILD.bazel @@ -30,6 +30,7 @@ go_test( "ssz_test.go", "varint_test.go", ], + data = glob(["testdata/**"]), embed = [":go_default_library"], deps = [ "//config/params:go_default_library", @@ -39,6 +40,10 @@ go_test( "//testing/util:go_default_library", "@com_github_gogo_protobuf//proto:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@com_github_prysmaticlabs_fastssz//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/beacon-chain/p2p/encoder/ssz_test.go b/beacon-chain/p2p/encoder/ssz_test.go index e51463f28f2a..9fa8a1cc4a10 100644 --- a/beacon-chain/p2p/encoder/ssz_test.go +++ b/beacon-chain/p2p/encoder/ssz_test.go @@ -9,6 +9,8 @@ import ( "testing" gogo "github.com/gogo/protobuf/proto" + "github.com/google/go-cmp/cmp" + fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/config/params" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -16,8 +18,561 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/testing/protocmp" ) +// Define an interface that combines fastssz.Marshaler and proto.Message +type MarshalerProtoMessage interface { + fastssz.Marshaler + proto.Message + fastssz.Unmarshaler +} + +type MarshalerProtoCreator interface { + Create() MarshalerProtoMessage +} + +type AttestationCreator struct{} +type AttestationElectraCreator struct{} +type AggregateAttestationAndProofCreator struct{} +type AggregateAttestationAndProofElectraCreator struct{} +type SignedAggregateAttestationAndProofCreator struct{} +type SignedAggregateAttestationAndProofElectraCreator struct{} +type AttestationDataCreator struct{} +type CheckpointCreator struct{} +type BeaconBlockCreator struct{} +type SignedBeaconBlockCreator struct{} +type BeaconBlockAltairCreator struct{} +type SignedBeaconBlockAltairCreator struct{} +type BeaconBlockBodyCreator struct{} +type BeaconBlockBodyAltairCreator struct{} +type ProposerSlashingCreator struct{} +type AttesterSlashingCreator struct{} +type AttesterSlashingElectraCreator struct{} +type DepositCreator struct{} +type VoluntaryExitCreator struct{} +type SignedVoluntaryExitCreator struct{} +type Eth1DataCreator struct{} +type BeaconBlockHeaderCreator struct{} +type SignedBeaconBlockHeaderCreator struct{} +type IndexedAttestationCreator struct{} +type IndexedAttestationElectraCreator struct{} +type SyncAggregateCreator struct{} +type SignedBeaconBlockBellatrixCreator struct{} +type BeaconBlockBellatrixCreator struct{} +type BeaconBlockBodyBellatrixCreator struct{} +type SignedBlindedBeaconBlockBellatrixCreator struct{} +type BlindedBeaconBlockBellatrixCreator struct{} +type BlindedBeaconBlockBodyBellatrixCreator struct{} +type SignedBeaconBlockContentsDenebCreator struct{} +type BeaconBlockContentsDenebCreator struct{} +type SignedBeaconBlockDenebCreator struct{} +type BeaconBlockDenebCreator struct{} +type BeaconBlockBodyDenebCreator struct{} +type SignedBeaconBlockCapellaCreator struct{} +type BeaconBlockCapellaCreator struct{} +type BeaconBlockBodyCapellaCreator struct{} +type SignedBlindedBeaconBlockCapellaCreator struct{} +type BlindedBeaconBlockCapellaCreator struct{} +type BlindedBeaconBlockBodyCapellaCreator struct{} +type SignedBlindedBeaconBlockDenebCreator struct{} +type BlindedBeaconBlockDenebCreator struct{} +type BlindedBeaconBlockBodyDenebCreator struct{} +type SignedBeaconBlockElectraCreator struct{} +type BeaconBlockElectraCreator struct{} +type BeaconBlockBodyElectraCreator struct{} +type SignedBlindedBeaconBlockElectraCreator struct{} +type BlindedBeaconBlockElectraCreator struct{} +type BlindedBeaconBlockBodyElectraCreator struct{} +type ValidatorRegistrationV1Creator struct{} +type SignedValidatorRegistrationV1Creator struct{} +type BuilderBidCreator struct{} +type BuilderBidCapellaCreator struct{} +type BuilderBidDenebCreator struct{} +type BlobSidecarCreator struct{} +type BlobSidecarsCreator struct{} +type Deposit_DataCreator struct{} +type BeaconStateCreator struct{} +type BeaconStateAltairCreator struct{} +type ForkCreator struct{} +type PendingAttestationCreator struct{} +type HistoricalBatchCreator struct{} +type SigningDataCreator struct{} +type ForkDataCreator struct{} +type DepositMessageCreator struct{} +type SyncCommitteeCreator struct{} +type SyncAggregatorSelectionDataCreator struct{} +type BeaconStateBellatrixCreator struct{} +type BeaconStateCapellaCreator struct{} +type BeaconStateDenebCreator struct{} +type BeaconStateElectraCreator struct{} +type PowBlockCreator struct{} +type HistoricalSummaryCreator struct{} +type BlobIdentifierCreator struct{} +type PendingBalanceDepositCreator struct{} +type PendingPartialWithdrawalCreator struct{} +type ConsolidationCreator struct{} +type SignedConsolidationCreator struct{} +type PendingConsolidationCreator struct{} +type StatusCreator struct{} +type BeaconBlocksByRangeRequestCreator struct{} +type ENRForkIDCreator struct{} +type MetaDataV0Creator struct{} +type MetaDataV1Creator struct{} +type BlobSidecarsByRangeRequestCreator struct{} +type DepositSnapshotCreator struct{} +type SyncCommitteeMessageCreator struct{} +type SyncCommitteeContributionCreator struct{} +type ContributionAndProofCreator struct{} +type SignedContributionAndProofCreator struct{} +type ValidatorCreator struct{} +type BLSToExecutionChangeCreator struct{} +type SignedBLSToExecutionChangeCreator struct{} + +func (AttestationCreator) Create() MarshalerProtoMessage { return ðpb.Attestation{} } +func (AttestationElectraCreator) Create() MarshalerProtoMessage { return ðpb.AttestationElectra{} } +func (AggregateAttestationAndProofCreator) Create() MarshalerProtoMessage { + return ðpb.AggregateAttestationAndProof{} +} +func (AggregateAttestationAndProofElectraCreator) Create() MarshalerProtoMessage { + return ðpb.AggregateAttestationAndProofElectra{} +} +func (SignedAggregateAttestationAndProofCreator) Create() MarshalerProtoMessage { + return ðpb.SignedAggregateAttestationAndProof{} +} +func (SignedAggregateAttestationAndProofElectraCreator) Create() MarshalerProtoMessage { + return ðpb.SignedAggregateAttestationAndProofElectra{} +} +func (AttestationDataCreator) Create() MarshalerProtoMessage { return ðpb.AttestationData{} } +func (CheckpointCreator) Create() MarshalerProtoMessage { return ðpb.Checkpoint{} } +func (BeaconBlockCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlock{} } +func (SignedBeaconBlockCreator) Create() MarshalerProtoMessage { return ðpb.SignedBeaconBlock{} } +func (BeaconBlockAltairCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlockAltair{} } +func (SignedBeaconBlockAltairCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockAltair{} +} +func (BeaconBlockBodyCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlockBody{} } +func (BeaconBlockBodyAltairCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockBodyAltair{} +} +func (ProposerSlashingCreator) Create() MarshalerProtoMessage { return ðpb.ProposerSlashing{} } +func (AttesterSlashingCreator) Create() MarshalerProtoMessage { return ðpb.AttesterSlashing{} } +func (AttesterSlashingElectraCreator) Create() MarshalerProtoMessage { + return ðpb.AttesterSlashingElectra{} +} +func (DepositCreator) Create() MarshalerProtoMessage { return ðpb.Deposit{} } +func (VoluntaryExitCreator) Create() MarshalerProtoMessage { return ðpb.VoluntaryExit{} } +func (SignedVoluntaryExitCreator) Create() MarshalerProtoMessage { + return ðpb.SignedVoluntaryExit{} +} +func (Eth1DataCreator) Create() MarshalerProtoMessage { return ðpb.Eth1Data{} } +func (BeaconBlockHeaderCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlockHeader{} } +func (SignedBeaconBlockHeaderCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockHeader{} +} +func (IndexedAttestationCreator) Create() MarshalerProtoMessage { return ðpb.IndexedAttestation{} } +func (IndexedAttestationElectraCreator) Create() MarshalerProtoMessage { + return ðpb.IndexedAttestationElectra{} +} +func (SyncAggregateCreator) Create() MarshalerProtoMessage { return ðpb.SyncAggregate{} } +func (SignedBeaconBlockBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockBellatrix{} +} +func (BeaconBlockBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockBellatrix{} +} +func (BeaconBlockBodyBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockBodyBellatrix{} +} +func (SignedBlindedBeaconBlockBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBlindedBeaconBlockBellatrix{} +} +func (BlindedBeaconBlockBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockBellatrix{} +} +func (BlindedBeaconBlockBodyBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockBodyBellatrix{} +} +func (SignedBeaconBlockContentsDenebCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockContentsDeneb{} +} +func (BeaconBlockContentsDenebCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockContentsDeneb{} +} +func (SignedBeaconBlockDenebCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockDeneb{} +} +func (BeaconBlockDenebCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlockDeneb{} } +func (BeaconBlockBodyDenebCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockBodyDeneb{} +} +func (SignedBeaconBlockCapellaCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockCapella{} +} +func (BeaconBlockCapellaCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlockCapella{} } +func (BeaconBlockBodyCapellaCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockBodyCapella{} +} +func (SignedBlindedBeaconBlockCapellaCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBlindedBeaconBlockCapella{} +} +func (BlindedBeaconBlockCapellaCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockCapella{} +} +func (BlindedBeaconBlockBodyCapellaCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockBodyCapella{} +} +func (SignedBlindedBeaconBlockDenebCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBlindedBeaconBlockDeneb{} +} +func (BlindedBeaconBlockDenebCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockDeneb{} +} +func (BlindedBeaconBlockBodyDenebCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockBodyDeneb{} +} +func (SignedBeaconBlockElectraCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBeaconBlockElectra{} +} +func (BeaconBlockElectraCreator) Create() MarshalerProtoMessage { return ðpb.BeaconBlockElectra{} } +func (BeaconBlockBodyElectraCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlockBodyElectra{} +} +func (SignedBlindedBeaconBlockElectraCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBlindedBeaconBlockElectra{} +} +func (BlindedBeaconBlockElectraCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockElectra{} +} +func (BlindedBeaconBlockBodyElectraCreator) Create() MarshalerProtoMessage { + return ðpb.BlindedBeaconBlockBodyElectra{} +} +func (ValidatorRegistrationV1Creator) Create() MarshalerProtoMessage { + return ðpb.ValidatorRegistrationV1{} +} +func (SignedValidatorRegistrationV1Creator) Create() MarshalerProtoMessage { + return ðpb.SignedValidatorRegistrationV1{} +} +func (BuilderBidCreator) Create() MarshalerProtoMessage { return ðpb.BuilderBid{} } +func (BuilderBidCapellaCreator) Create() MarshalerProtoMessage { return ðpb.BuilderBidCapella{} } +func (BuilderBidDenebCreator) Create() MarshalerProtoMessage { return ðpb.BuilderBidDeneb{} } +func (BlobSidecarCreator) Create() MarshalerProtoMessage { return ðpb.BlobSidecar{} } +func (BlobSidecarsCreator) Create() MarshalerProtoMessage { return ðpb.BlobSidecars{} } +func (Deposit_DataCreator) Create() MarshalerProtoMessage { return ðpb.Deposit_Data{} } +func (BeaconStateCreator) Create() MarshalerProtoMessage { return ðpb.BeaconState{} } +func (BeaconStateAltairCreator) Create() MarshalerProtoMessage { return ðpb.BeaconStateAltair{} } +func (ForkCreator) Create() MarshalerProtoMessage { return ðpb.Fork{} } +func (PendingAttestationCreator) Create() MarshalerProtoMessage { return ðpb.PendingAttestation{} } +func (HistoricalBatchCreator) Create() MarshalerProtoMessage { return ðpb.HistoricalBatch{} } +func (SigningDataCreator) Create() MarshalerProtoMessage { return ðpb.SigningData{} } +func (ForkDataCreator) Create() MarshalerProtoMessage { return ðpb.ForkData{} } +func (DepositMessageCreator) Create() MarshalerProtoMessage { return ðpb.DepositMessage{} } +func (SyncCommitteeCreator) Create() MarshalerProtoMessage { return ðpb.SyncCommittee{} } +func (SyncAggregatorSelectionDataCreator) Create() MarshalerProtoMessage { + return ðpb.SyncAggregatorSelectionData{} +} +func (BeaconStateBellatrixCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconStateBellatrix{} +} +func (BeaconStateCapellaCreator) Create() MarshalerProtoMessage { return ðpb.BeaconStateCapella{} } +func (BeaconStateDenebCreator) Create() MarshalerProtoMessage { return ðpb.BeaconStateDeneb{} } +func (BeaconStateElectraCreator) Create() MarshalerProtoMessage { return ðpb.BeaconStateElectra{} } +func (PowBlockCreator) Create() MarshalerProtoMessage { return ðpb.PowBlock{} } +func (HistoricalSummaryCreator) Create() MarshalerProtoMessage { return ðpb.HistoricalSummary{} } +func (BlobIdentifierCreator) Create() MarshalerProtoMessage { return ðpb.BlobIdentifier{} } +func (PendingBalanceDepositCreator) Create() MarshalerProtoMessage { + return ðpb.PendingBalanceDeposit{} +} +func (PendingPartialWithdrawalCreator) Create() MarshalerProtoMessage { + return ðpb.PendingPartialWithdrawal{} +} +func (ConsolidationCreator) Create() MarshalerProtoMessage { return ðpb.Consolidation{} } +func (SignedConsolidationCreator) Create() MarshalerProtoMessage { + return ðpb.SignedConsolidation{} +} +func (PendingConsolidationCreator) Create() MarshalerProtoMessage { + return ðpb.PendingConsolidation{} +} +func (StatusCreator) Create() MarshalerProtoMessage { return ðpb.Status{} } +func (BeaconBlocksByRangeRequestCreator) Create() MarshalerProtoMessage { + return ðpb.BeaconBlocksByRangeRequest{} +} +func (ENRForkIDCreator) Create() MarshalerProtoMessage { return ðpb.ENRForkID{} } +func (MetaDataV0Creator) Create() MarshalerProtoMessage { return ðpb.MetaDataV0{} } +func (MetaDataV1Creator) Create() MarshalerProtoMessage { return ðpb.MetaDataV1{} } +func (BlobSidecarsByRangeRequestCreator) Create() MarshalerProtoMessage { + return ðpb.BlobSidecarsByRangeRequest{} +} +func (DepositSnapshotCreator) Create() MarshalerProtoMessage { return ðpb.DepositSnapshot{} } +func (SyncCommitteeMessageCreator) Create() MarshalerProtoMessage { + return ðpb.SyncCommitteeMessage{} +} +func (SyncCommitteeContributionCreator) Create() MarshalerProtoMessage { + return ðpb.SyncCommitteeContribution{} +} +func (ContributionAndProofCreator) Create() MarshalerProtoMessage { + return ðpb.ContributionAndProof{} +} +func (SignedContributionAndProofCreator) Create() MarshalerProtoMessage { + return ðpb.SignedContributionAndProof{} +} +func (ValidatorCreator) Create() MarshalerProtoMessage { return ðpb.Validator{} } +func (BLSToExecutionChangeCreator) Create() MarshalerProtoMessage { + return ðpb.BLSToExecutionChange{} +} +func (SignedBLSToExecutionChangeCreator) Create() MarshalerProtoMessage { + return ðpb.SignedBLSToExecutionChange{} +} + +var creators = []MarshalerProtoCreator{ + AttestationCreator{}, + AttestationElectraCreator{}, + AggregateAttestationAndProofCreator{}, + AggregateAttestationAndProofElectraCreator{}, + SignedAggregateAttestationAndProofCreator{}, + SignedAggregateAttestationAndProofElectraCreator{}, + AttestationDataCreator{}, + CheckpointCreator{}, + BeaconBlockCreator{}, + SignedBeaconBlockCreator{}, + BeaconBlockAltairCreator{}, + SignedBeaconBlockAltairCreator{}, + BeaconBlockBodyCreator{}, + BeaconBlockBodyAltairCreator{}, + ProposerSlashingCreator{}, + AttesterSlashingCreator{}, + AttesterSlashingElectraCreator{}, + DepositCreator{}, + VoluntaryExitCreator{}, + SignedVoluntaryExitCreator{}, + Eth1DataCreator{}, + BeaconBlockHeaderCreator{}, + SignedBeaconBlockHeaderCreator{}, + IndexedAttestationCreator{}, + IndexedAttestationElectraCreator{}, + SyncAggregateCreator{}, + SignedBeaconBlockBellatrixCreator{}, + BeaconBlockBellatrixCreator{}, + BeaconBlockBodyBellatrixCreator{}, + SignedBlindedBeaconBlockBellatrixCreator{}, + BlindedBeaconBlockBellatrixCreator{}, + BlindedBeaconBlockBodyBellatrixCreator{}, + SignedBeaconBlockContentsDenebCreator{}, + BeaconBlockContentsDenebCreator{}, + SignedBeaconBlockDenebCreator{}, + BeaconBlockDenebCreator{}, + BeaconBlockBodyDenebCreator{}, + SignedBeaconBlockCapellaCreator{}, + BeaconBlockCapellaCreator{}, + BeaconBlockBodyCapellaCreator{}, + SignedBlindedBeaconBlockCapellaCreator{}, + BlindedBeaconBlockCapellaCreator{}, + BlindedBeaconBlockBodyCapellaCreator{}, + SignedBlindedBeaconBlockDenebCreator{}, + BlindedBeaconBlockDenebCreator{}, + BlindedBeaconBlockBodyDenebCreator{}, + SignedBeaconBlockElectraCreator{}, + BeaconBlockElectraCreator{}, + BeaconBlockBodyElectraCreator{}, + SignedBlindedBeaconBlockElectraCreator{}, + BlindedBeaconBlockElectraCreator{}, + BlindedBeaconBlockBodyElectraCreator{}, + ValidatorRegistrationV1Creator{}, + SignedValidatorRegistrationV1Creator{}, + BuilderBidCreator{}, + BuilderBidCapellaCreator{}, + BuilderBidDenebCreator{}, + BlobSidecarCreator{}, + BlobSidecarsCreator{}, + Deposit_DataCreator{}, + BeaconStateCreator{}, + BeaconStateAltairCreator{}, + ForkCreator{}, + PendingAttestationCreator{}, + HistoricalBatchCreator{}, + SigningDataCreator{}, + ForkDataCreator{}, + DepositMessageCreator{}, + SyncCommitteeCreator{}, + SyncAggregatorSelectionDataCreator{}, + BeaconStateBellatrixCreator{}, + BeaconStateCapellaCreator{}, + BeaconStateDenebCreator{}, + BeaconStateElectraCreator{}, + PowBlockCreator{}, + HistoricalSummaryCreator{}, + BlobIdentifierCreator{}, + PendingBalanceDepositCreator{}, + PendingPartialWithdrawalCreator{}, + ConsolidationCreator{}, + SignedConsolidationCreator{}, + PendingConsolidationCreator{}, + StatusCreator{}, + BeaconBlocksByRangeRequestCreator{}, + ENRForkIDCreator{}, + MetaDataV0Creator{}, + MetaDataV1Creator{}, + BlobSidecarsByRangeRequestCreator{}, + DepositSnapshotCreator{}, + SyncCommitteeMessageCreator{}, + SyncCommitteeContributionCreator{}, + ContributionAndProofCreator{}, + SignedContributionAndProofCreator{}, + ValidatorCreator{}, + BLSToExecutionChangeCreator{}, + SignedBLSToExecutionChangeCreator{}, +} + +func assertProtoMessagesEqual(t *testing.T, decoded, msg proto.Message) { + // Check if two proto messages are equal + if proto.Equal(decoded, msg) { + return + } + + // If they are not equal, check if their unknown values are equal + // Ignore unknown fields when comparing proto messages + a := decoded.ProtoReflect().GetUnknown() + b := msg.ProtoReflect().GetUnknown() + if !bytes.Equal(a, b) { + return + } + + // If unknown values are equal, check if any of the fields of the proto message are proto messages themselves + containsNestedProtoMessage := false + decoded.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + // Check if the field is a message + if fd.Kind() == protoreflect.MessageKind { + containsNestedProtoMessage = true + + // Get the corresponding field from the other message + otherValue := msg.ProtoReflect().Get(fd) + + // If the field is not set in the other message, skip it + if !otherValue.IsValid() { + return true + } + + // Recursively compare the fields + assertProtoMessagesEqual(t, v.Message().Interface(), otherValue.Message().Interface()) + } + + return true + }) + + // If there are no proto messages contained inside, then throw an error + // The error is thrown iff the decoded message is not equal to the original message + // after ignoring unknown fields in (nested) proto message(s). + if !containsNestedProtoMessage { + t.Log(cmp.Diff(decoded, msg, protocmp.Transform())) + t.Fatal("Decoded message is not the same as original") + } +} + +// Refactor the unmarshal logic into a private function. +func unmarshalProtoMessage(data []byte, creator MarshalerProtoCreator) (MarshalerProtoMessage, error) { + msg := creator.Create() + if err := proto.Unmarshal(data, msg); err != nil { + return nil, err + } + return msg, nil +} + +func gossipRoundTripHelper(t *testing.T, msg MarshalerProtoMessage, creator MarshalerProtoCreator) { + e := &encoder.SszNetworkEncoder{} + buf := new(bytes.Buffer) + + // Example of calling a function that requires MarshalerProtoMessage + _, err := e.EncodeGossip(buf, msg) + if err != nil { + t.Logf("Failed to encode: %v", err) + return + } + + decoded := creator.Create() + + if err := e.DecodeGossip(buf.Bytes(), decoded); err != nil { + t.Fatalf("Failed to decode: %v", err) + } + assertProtoMessagesEqual(t, decoded, msg) +} + +func lengthRoundTripHelper(t *testing.T, msg MarshalerProtoMessage, creator MarshalerProtoCreator) { + e := &encoder.SszNetworkEncoder{} + buf := new(bytes.Buffer) + + // Example of calling a function that requires MarshalerProtoMessage + _, err := e.EncodeWithMaxLength(buf, msg) + if err != nil { + t.Logf("Failed to encode: %v", err) + return + } + + decoded := creator.Create() + + if err := e.DecodeWithMaxLength(buf, decoded); err != nil { + t.Fatalf("Failed to decode: %v", err) + } + + assertProtoMessagesEqual(t, decoded, msg) +} + +func FuzzRoundTripWithGossip(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte, index int) { + if index < 0 || index >= len(creators) { + t.Skip() + } + // Select a random creator from the list. + creator := creators[index] + msg, err := unmarshalProtoMessage(data, creator) + if err != nil { + t.Logf("Failed to unmarshal: %v", err) + return + } + gossipRoundTripHelper(t, msg, creator) + lengthRoundTripHelper(t, msg, creator) + }) +} + +func TestSszNetworkEncoder_RoundTrip_SignedVoluntaryExit(t *testing.T) { + e := &encoder.SszNetworkEncoder{} + buf := new(bytes.Buffer) + + data := []byte("\x12`000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n\n0000000000") + msg := ðpb.SignedVoluntaryExit{} + + if err := proto.Unmarshal(data, msg); err != nil { + t.Logf("Failed to unmarshal: %v", err) + return + } + + _, err := e.EncodeGossip(buf, msg) + require.NoError(t, err) + decoded := ðpb.SignedVoluntaryExit{} + require.NoError(t, e.DecodeGossip(buf.Bytes(), decoded)) + assertProtoMessagesEqual(t, decoded, msg) +} + +func TestSszNetworkEncoder_RoundTrip_Consolidation(t *testing.T) { + e := &encoder.SszNetworkEncoder{} + buf := new(bytes.Buffer) + + data := []byte("\xc800") + msg := ðpb.Consolidation{} + + if err := proto.Unmarshal(data, msg); err != nil { + t.Logf("Failed to unmarshal: %v", err) + return + } + + _, err := e.EncodeGossip(buf, msg) + require.NoError(t, err) + decoded := ðpb.Consolidation{} + require.NoError(t, e.DecodeGossip(buf.Bytes(), decoded)) + + assertProtoMessagesEqual(t, decoded, msg) +} + func TestSszNetworkEncoder_RoundTrip(t *testing.T) { e := &encoder.SszNetworkEncoder{} testRoundTripWithLength(t, e) From 0fbb27d8e3f6cd91c3f5229b8aa4da2894773b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 23 May 2024 01:14:08 +0900 Subject: [PATCH 102/325] EIP-7549: Add aggregate attestation interfaces (#14029) * interfaces move * build fix * remove annoying warning * more build fixes * review --- beacon-chain/blockchain/head_test.go | 7 +- .../blockchain/process_attestation.go | 3 +- .../blockchain/process_attestation_test.go | 3 +- beacon-chain/blockchain/process_block.go | 2 +- beacon-chain/blockchain/process_block_test.go | 2 +- .../blockchain/receive_attestation.go | 7 +- .../blockchain/receive_attestation_test.go | 5 +- beacon-chain/blockchain/receive_block.go | 6 +- beacon-chain/blockchain/setup_test.go | 3 +- beacon-chain/blockchain/testing/mock.go | 4 +- beacon-chain/core/altair/attestation.go | 2 +- beacon-chain/core/blocks/attestation.go | 8 +- beacon-chain/core/blocks/attestation_test.go | 9 +- beacon-chain/core/blocks/attester_slashing.go | 23 ++- .../core/blocks/attester_slashing_test.go | 13 +- .../core/blocks/block_operations_fuzz_test.go | 3 +- .../core/blocks/block_regression_test.go | 3 +- beacon-chain/core/blocks/signature.go | 8 +- beacon-chain/core/feed/operation/BUILD.bazel | 1 - beacon-chain/core/feed/operation/events.go | 5 +- beacon-chain/core/helpers/BUILD.bazel | 1 - beacon-chain/core/helpers/attestation.go | 7 +- beacon-chain/core/helpers/attestation_test.go | 3 +- beacon-chain/core/helpers/beacon_committee.go | 4 +- beacon-chain/monitor/process_attestation.go | 6 +- beacon-chain/monitor/process_block.go | 19 +-- .../operations/attestations/BUILD.bazel | 3 +- .../operations/attestations/kv/BUILD.bazel | 3 +- .../operations/attestations/kv/aggregated.go | 34 ++--- .../attestations/kv/aggregated_test.go | 39 +++-- .../operations/attestations/kv/block.go | 14 +- .../operations/attestations/kv/block_test.go | 7 +- .../operations/attestations/kv/forkchoice.go | 17 ++- .../attestations/kv/forkchoice_test.go | 7 +- beacon-chain/operations/attestations/kv/kv.go | 18 +-- .../operations/attestations/kv/seen_bits.go | 6 +- .../attestations/kv/unaggregated.go | 21 ++- .../attestations/kv/unaggregated_test.go | 29 ++-- beacon-chain/operations/attestations/pool.go | 38 ++--- .../attestations/prepare_forkchoice.go | 12 +- .../attestations/prepare_forkchoice_test.go | 25 ++-- .../attestations/prune_expired_test.go | 7 +- beacon-chain/operations/slashings/BUILD.bazel | 2 - .../operations/slashings/mock/BUILD.bazel | 1 - .../operations/slashings/mock/mock.go | 9 +- beacon-chain/operations/slashings/service.go | 17 ++- .../slashings/service_attester_test.go | 13 +- beacon-chain/operations/slashings/types.go | 9 +- beacon-chain/p2p/BUILD.bazel | 1 - beacon-chain/p2p/broadcaster.go | 5 +- beacon-chain/p2p/interfaces.go | 3 +- beacon-chain/p2p/testing/BUILD.bazel | 1 - beacon-chain/p2p/testing/fuzz_p2p.go | 3 +- beacon-chain/p2p/testing/mock_broadcaster.go | 5 +- beacon-chain/p2p/testing/p2p.go | 3 +- .../rpc/eth/beacon/handlers_pool_test.go | 7 +- beacon-chain/rpc/eth/rewards/handlers_test.go | 4 +- beacon-chain/rpc/eth/validator/BUILD.bazel | 2 - beacon-chain/rpc/eth/validator/handlers.go | 5 +- .../rpc/eth/validator/handlers_test.go | 7 +- .../rpc/prysm/v1alpha1/beacon/attestations.go | 10 +- .../v1alpha1/beacon/attestations_test.go | 12 +- .../v1alpha1/validator/aggregator_test.go | 5 +- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../validator/proposer_attestations.go | 22 +-- .../validator/proposer_attestations_test.go | 5 +- .../v1alpha1/validator/proposer_deposits.go | 5 +- .../v1alpha1/validator/proposer_slashings.go | 5 +- .../validator/proposer_slashings_test.go | 3 +- .../prysm/v1alpha1/validator/proposer_test.go | 31 ++-- .../validator/proposer_utils_bench_test.go | 3 +- beacon-chain/slasher/BUILD.bazel | 2 - beacon-chain/slasher/chunks.go | 7 +- beacon-chain/slasher/detect_attestations.go | 19 ++- beacon-chain/slasher/helpers.go | 13 +- beacon-chain/slasher/process_slashings.go | 15 +- .../slasher/process_slashings_test.go | 7 +- beacon-chain/slasher/receive.go | 3 +- .../subscriber_beacon_aggregate_proof_test.go | 5 +- beacon-chain/sync/subscriber_handlers.go | 9 +- beacon-chain/sync/validate_aggregate_proof.go | 5 +- .../sync/validate_attester_slashing.go | 4 +- .../sync/validate_beacon_attestation.go | 11 +- consensus-types/blocks/getters.go | 16 +-- consensus-types/blocks/getters_test.go | 4 +- consensus-types/blocks/setters.go | 4 +- consensus-types/interfaces/BUILD.bazel | 1 - consensus-types/interfaces/beacon_block.go | 45 +----- consensus-types/mock/BUILD.bazel | 1 + consensus-types/mock/block.go | 7 +- proto/prysm/v1alpha1/attestation.go | 136 ++++++++++++++++-- proto/prysm/v1alpha1/attestation/BUILD.bazel | 2 - .../aggregation/attestations/BUILD.bazel | 2 - .../aggregation/attestations/attestations.go | 7 +- .../aggregation/attestations/maxcover.go | 9 +- .../aggregation/attestations/maxcover_test.go | 61 ++++---- .../aggregation/testing/BUILD.bazel | 1 - .../aggregation/testing/bitlistutils.go | 5 +- .../v1alpha1/attestation/attestation_utils.go | 5 +- .../attestation/attestation_utils_test.go | 3 +- .../validator-client/keymanager.proto | 1 - testing/slasher/simulator/BUILD.bazel | 1 - testing/slasher/simulator/simulator.go | 3 +- .../shared/common/forkchoice/builder.go | 2 +- 104 files changed, 530 insertions(+), 523 deletions(-) diff --git a/beacon-chain/blockchain/head_test.go b/beacon-chain/blockchain/head_test.go index d1e5b1c1de51..4bdda69e9d43 100644 --- a/beacon-chain/blockchain/head_test.go +++ b/beacon-chain/blockchain/head_test.go @@ -13,7 +13,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/blstoexec" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" @@ -313,7 +312,7 @@ func TestSaveOrphanedAtts(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []interfaces.Attestation{ + wantAtts := []ethpb.Att{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], @@ -390,7 +389,7 @@ func TestSaveOrphanedOps(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []interfaces.Attestation{ + wantAtts := []ethpb.Att{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], @@ -518,7 +517,7 @@ func TestSaveOrphanedAtts_DoublyLinkedTrie(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []interfaces.Attestation{ + wantAtts := []ethpb.Att{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], diff --git a/beacon-chain/blockchain/process_attestation.go b/beacon-chain/blockchain/process_attestation.go index c645f9ccee26..a0949e869916 100644 --- a/beacon-chain/blockchain/process_attestation.go +++ b/beacon-chain/blockchain/process_attestation.go @@ -6,7 +6,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" @@ -37,7 +36,7 @@ import ( // // # Update latest messages for attesting indices // update_latest_messages(store, indexed_attestation.attesting_indices, attestation) -func (s *Service) OnAttestation(ctx context.Context, a interfaces.Attestation, disparity time.Duration) error { +func (s *Service) OnAttestation(ctx context.Context, a ethpb.Att, disparity time.Duration) error { ctx, span := trace.StartSpan(ctx, "blockChain.onAttestation") defer span.End() diff --git a/beacon-chain/blockchain/process_attestation_test.go b/beacon-chain/blockchain/process_attestation_test.go index 9b0f722051b1..47e411eacc79 100644 --- a/beacon-chain/blockchain/process_attestation_test.go +++ b/beacon-chain/blockchain/process_attestation_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -74,7 +73,7 @@ func TestStore_OnAttestation_ErrorConditions(t *testing.T) { tests := []struct { name string - a interfaces.Attestation + a ethpb.Att wantedErr string }{ { diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 5ced8b1623de..575b1f252929 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -387,7 +387,7 @@ func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.Re // InsertSlashingsToForkChoiceStore inserts attester slashing indices to fork choice store. // To call this function, it's caller's responsibility to ensure the slashing object is valid. // This function requires a write lock on forkchoice. -func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashings []interfaces.AttesterSlashing) { +func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashings []ethpb.AttSlashing) { for _, slashing := range slashings { indices := blocks.SlashableAttesterIndices(slashing) for _, index := range indices { diff --git a/beacon-chain/blockchain/process_block_test.go b/beacon-chain/blockchain/process_block_test.go index fbc15a824ae8..d4ca7a9ba698 100644 --- a/beacon-chain/blockchain/process_block_test.go +++ b/beacon-chain/blockchain/process_block_test.go @@ -824,7 +824,7 @@ func TestRemoveBlockAttestationsInPool(t *testing.T) { require.NoError(t, service.cfg.BeaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Root: r[:]})) require.NoError(t, service.cfg.BeaconDB.SaveGenesisBlockRoot(ctx, r)) - atts := make([]interfaces.Attestation, len(b.Block.Body.Attestations)) + atts := make([]ethpb.Att, len(b.Block.Body.Attestations)) for i, a := range b.Block.Body.Attestations { atts[i] = a } diff --git a/beacon-chain/blockchain/receive_attestation.go b/beacon-chain/blockchain/receive_attestation.go index 1d5a5763f3d5..89f344383cf6 100644 --- a/beacon-chain/blockchain/receive_attestation.go +++ b/beacon-chain/blockchain/receive_attestation.go @@ -10,7 +10,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -32,7 +31,7 @@ type AttestationStateFetcher interface { // AttestationReceiver interface defines the methods of chain service receive and processing new attestations. type AttestationReceiver interface { AttestationStateFetcher - VerifyLmdFfgConsistency(ctx context.Context, att interfaces.Attestation) error + VerifyLmdFfgConsistency(ctx context.Context, att ethpb.Att) error InForkchoice([32]byte) bool } @@ -52,7 +51,7 @@ func (s *Service) AttestationTargetState(ctx context.Context, target *ethpb.Chec } // VerifyLmdFfgConsistency verifies that attestation's LMD and FFG votes are consistency to each other. -func (s *Service) VerifyLmdFfgConsistency(ctx context.Context, a interfaces.Attestation) error { +func (s *Service) VerifyLmdFfgConsistency(ctx context.Context, a ethpb.Att) error { r, err := s.TargetRootForEpoch([32]byte(a.GetData().BeaconBlockRoot), a.GetData().Target.Epoch) if err != nil { return err @@ -207,7 +206,7 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati // 1. Validate attestation, update validator's latest vote // 2. Apply fork choice to the processed attestation // 3. Save latest head info -func (s *Service) receiveAttestationNoPubsub(ctx context.Context, att interfaces.Attestation, disparity time.Duration) error { +func (s *Service) receiveAttestationNoPubsub(ctx context.Context, att ethpb.Att, disparity time.Duration) error { ctx, span := trace.StartSpan(ctx, "beacon-chain.blockchain.receiveAttestationNoPubsub") defer span.End() diff --git a/beacon-chain/blockchain/receive_attestation_test.go b/beacon-chain/blockchain/receive_attestation_test.go index dd1ce2cabc8f..94c27f1fb831 100644 --- a/beacon-chain/blockchain/receive_attestation_test.go +++ b/beacon-chain/blockchain/receive_attestation_test.go @@ -10,7 +10,6 @@ import ( forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -84,7 +83,7 @@ func TestProcessAttestations_Ok(t *testing.T) { state, blkRoot, err := prepareForkchoiceState(ctx, 0, tRoot, tRoot, params.BeaconConfig().ZeroHash, ojc, ofc) require.NoError(t, err) require.NoError(t, service.cfg.ForkChoiceStore.InsertNode(ctx, state, blkRoot)) - attsToSave := make([]interfaces.Attestation, len(atts)) + attsToSave := make([]ethpb.Att, len(atts)) for i, a := range atts { attsToSave[i] = a } @@ -126,7 +125,7 @@ func TestService_ProcessAttestationsAndUpdateHead(t *testing.T) { // Generate attestations for this block in Slot 1 atts, err := util.GenerateAttestations(copied, pks, 1, 1, false) require.NoError(t, err) - attsToSave := make([]interfaces.Attestation, len(atts)) + attsToSave := make([]ethpb.Att, len(atts)) for i, a := range atts { attsToSave[i] = a } diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index f4b05f6c35d4..884e257f320f 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -52,7 +52,7 @@ type BlobReceiver interface { // SlashingReceiver interface defines the methods of chain service for receiving validated slashing over the wire. type SlashingReceiver interface { - ReceiveAttesterSlashing(ctx context.Context, slashing interfaces.AttesterSlashing) + ReceiveAttesterSlashing(ctx context.Context, slashing ethpb.AttSlashing) } // ReceiveBlock is a function that defines the operations (minus pubsub) @@ -295,10 +295,10 @@ func (s *Service) HasBlock(ctx context.Context, root [32]byte) bool { } // ReceiveAttesterSlashing receives an attester slashing and inserts it to forkchoice -func (s *Service) ReceiveAttesterSlashing(ctx context.Context, slashing interfaces.AttesterSlashing) { +func (s *Service) ReceiveAttesterSlashing(ctx context.Context, slashing ethpb.AttSlashing) { s.cfg.ForkChoiceStore.Lock() defer s.cfg.ForkChoiceStore.Unlock() - s.InsertSlashingsToForkChoiceStore(ctx, []interfaces.AttesterSlashing{slashing}) + s.InsertSlashingsToForkChoiceStore(ctx, []ethpb.AttSlashing{slashing}) } // prunePostBlockOperationPools only runs on new head otherwise should return a nil. diff --git a/beacon-chain/blockchain/setup_test.go b/beacon-chain/blockchain/setup_test.go index 97c6d00f7d06..f305ea6e95fb 100644 --- a/beacon-chain/blockchain/setup_test.go +++ b/beacon-chain/blockchain/setup_test.go @@ -20,7 +20,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "google.golang.org/protobuf/proto" @@ -50,7 +49,7 @@ func (mb *mockBroadcaster) Broadcast(_ context.Context, _ proto.Message) error { return nil } -func (mb *mockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { +func (mb *mockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, _ ethpb.Att) error { mb.broadcastCalled = true return nil } diff --git a/beacon-chain/blockchain/testing/mock.go b/beacon-chain/blockchain/testing/mock.go index e85868c448cb..d0da4f0cd07b 100644 --- a/beacon-chain/blockchain/testing/mock.go +++ b/beacon-chain/blockchain/testing/mock.go @@ -414,7 +414,7 @@ func (*ChainService) HeadGenesisValidatorsRoot() [32]byte { } // VerifyLmdFfgConsistency mocks VerifyLmdFfgConsistency and always returns nil. -func (*ChainService) VerifyLmdFfgConsistency(_ context.Context, a interfaces.Attestation) error { +func (*ChainService) VerifyLmdFfgConsistency(_ context.Context, a ethpb.Att) error { if !bytes.Equal(a.GetData().BeaconBlockRoot, a.GetData().Target.Root) { return errors.New("LMD and FFG miss matched") } @@ -495,7 +495,7 @@ func (s *ChainService) UpdateHead(ctx context.Context, slot primitives.Slot) { } // ReceiveAttesterSlashing mocks the same method in the chain service. -func (*ChainService) ReceiveAttesterSlashing(context.Context, interfaces.AttesterSlashing) {} +func (*ChainService) ReceiveAttesterSlashing(context.Context, ethpb.AttSlashing) {} // IsFinalized mocks the same method in the chain service. func (s *ChainService) IsFinalized(_ context.Context, blockRoot [32]byte) bool { diff --git a/beacon-chain/core/altair/attestation.go b/beacon-chain/core/altair/attestation.go index 336edf57a7ab..e2d6305a4b02 100644 --- a/beacon-chain/core/altair/attestation.go +++ b/beacon-chain/core/altair/attestation.go @@ -48,7 +48,7 @@ func ProcessAttestationsNoVerifySignature( func ProcessAttestationNoVerifySignature( ctx context.Context, beaconState state.BeaconState, - att interfaces.Attestation, + att ethpb.Att, totalBalance uint64, ) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "altair.ProcessAttestationNoVerifySignature") diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index 2afafcb6a11e..5b9c0c83ef18 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -46,7 +46,7 @@ func ProcessAttestationsNoVerifySignature( func VerifyAttestationNoVerifySignature( ctx context.Context, beaconState state.ReadOnlyBeaconState, - att interfaces.Attestation, + att ethpb.Att, ) error { ctx, span := trace.StartSpan(ctx, "core.VerifyAttestationNoVerifySignature") defer span.End() @@ -133,7 +133,7 @@ func VerifyAttestationNoVerifySignature( return errors.New("committee index must be 0 post-Electra") } - committeeIndices := att.GetCommitteeBitsVal().BitIndices() + committeeIndices := att.CommitteeBitsVal().BitIndices() committees := make([][]primitives.ValidatorIndex, len(committeeIndices)) participantsCount := 0 var err error @@ -164,7 +164,7 @@ func VerifyAttestationNoVerifySignature( func ProcessAttestationNoVerifySignature( ctx context.Context, beaconState state.BeaconState, - att interfaces.Attestation, + att ethpb.Att, ) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "core.ProcessAttestationNoVerifySignature") defer span.End() @@ -202,7 +202,7 @@ func ProcessAttestationNoVerifySignature( // VerifyAttestationSignature converts and attestation into an indexed attestation and verifies // the signature in that attestation. -func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att interfaces.Attestation) error { +func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att ethpb.Att) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } diff --git a/beacon-chain/core/blocks/attestation_test.go b/beacon-chain/core/blocks/attestation_test.go index 10ca47b178ea..2ebc36a23181 100644 --- a/beacon-chain/core/blocks/attestation_test.go +++ b/beacon-chain/core/blocks/attestation_test.go @@ -11,7 +11,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -464,7 +463,7 @@ func TestValidateIndexedAttestation_BadAttestationsSignatureSet(t *testing.T) { sig := keys[0].Sign([]byte{'t', 'e', 's', 't'}) list := bitfield.Bitlist{0b11111} - var atts []interfaces.Attestation + var atts []ethpb.Att for i := uint64(0); i < 1000; i++ { atts = append(atts, ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -480,7 +479,7 @@ func TestValidateIndexedAttestation_BadAttestationsSignatureSet(t *testing.T) { _, err := blocks.AttestationSignatureBatch(context.Background(), beaconState, atts) assert.ErrorContains(t, want, err) - atts = []interfaces.Attestation{} + atts = []ethpb.Att{} list = bitfield.Bitlist{0b10000} for i := uint64(0); i < 1000; i++ { atts = append(atts, ðpb.Attestation{ @@ -621,7 +620,7 @@ func TestRetrieveAttestationSignatureSet_VerifiesMultipleAttestations(t *testing } att2.Signature = bls.AggregateSignatures(sigs).Marshal() - set, err := blocks.AttestationSignatureBatch(ctx, st, []interfaces.Attestation{att1, att2}) + set, err := blocks.AttestationSignatureBatch(ctx, st, []ethpb.Att{att1, att2}) require.NoError(t, err) verified, err := set.Verify() require.NoError(t, err) @@ -685,6 +684,6 @@ func TestRetrieveAttestationSignatureSet_AcrossFork(t *testing.T) { } att2.Signature = bls.AggregateSignatures(sigs).Marshal() - _, err = blocks.AttestationSignatureBatch(ctx, st, []interfaces.Attestation{att1, att2}) + _, err = blocks.AttestationSignatureBatch(ctx, st, []ethpb.Att{att1, att2}) require.NoError(t, err) } diff --git a/beacon-chain/core/blocks/attester_slashing.go b/beacon-chain/core/blocks/attester_slashing.go index b6392b6fcb1b..f1b96e8a157f 100644 --- a/beacon-chain/core/blocks/attester_slashing.go +++ b/beacon-chain/core/blocks/attester_slashing.go @@ -7,7 +7,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -39,7 +38,7 @@ import ( func ProcessAttesterSlashings( ctx context.Context, beaconState state.BeaconState, - slashings []interfaces.AttesterSlashing, + slashings []ethpb.AttSlashing, slashFunc slashValidatorFunc, ) (state.BeaconState, error) { var err error @@ -56,7 +55,7 @@ func ProcessAttesterSlashings( func ProcessAttesterSlashing( ctx context.Context, beaconState state.BeaconState, - slashing interfaces.AttesterSlashing, + slashing ethpb.AttSlashing, slashFunc slashValidatorFunc, ) (state.BeaconState, error) { if err := VerifyAttesterSlashing(ctx, beaconState, slashing); err != nil { @@ -91,18 +90,18 @@ func ProcessAttesterSlashing( } // VerifyAttesterSlashing validates the attestation data in both attestations in the slashing object. -func VerifyAttesterSlashing(ctx context.Context, beaconState state.ReadOnlyBeaconState, slashing interfaces.AttesterSlashing) error { +func VerifyAttesterSlashing(ctx context.Context, beaconState state.ReadOnlyBeaconState, slashing ethpb.AttSlashing) error { if slashing == nil { return errors.New("nil slashing") } - if slashing.GetFirstAttestation() == nil || slashing.GetSecondAttestation() == nil { + if slashing.FirstAttestation() == nil || slashing.SecondAttestation() == nil { return errors.New("nil attestation") } - if slashing.GetFirstAttestation().GetData() == nil || slashing.GetSecondAttestation().GetData() == nil { + if slashing.FirstAttestation().GetData() == nil || slashing.SecondAttestation().GetData() == nil { return errors.New("nil attestation data") } - att1 := slashing.GetFirstAttestation() - att2 := slashing.GetSecondAttestation() + att1 := slashing.FirstAttestation() + att2 := slashing.SecondAttestation() data1 := att1.GetData() data2 := att2.GetData() if !IsSlashableAttestationData(data1, data2) { @@ -144,11 +143,11 @@ func IsSlashableAttestationData(data1, data2 *ethpb.AttestationData) bool { } // SlashableAttesterIndices returns the intersection of attester indices from both attestations in this slashing. -func SlashableAttesterIndices(slashing interfaces.AttesterSlashing) []uint64 { - if slashing == nil || slashing.GetFirstAttestation() == nil || slashing.GetSecondAttestation() == nil { +func SlashableAttesterIndices(slashing ethpb.AttSlashing) []uint64 { + if slashing == nil || slashing.FirstAttestation() == nil || slashing.SecondAttestation() == nil { return nil } - indices1 := slashing.GetFirstAttestation().GetAttestingIndices() - indices2 := slashing.GetSecondAttestation().GetAttestingIndices() + indices1 := slashing.FirstAttestation().GetAttestingIndices() + indices2 := slashing.SecondAttestation().GetAttestingIndices() return slice.IntersectionUint64(indices1, indices2) } diff --git a/beacon-chain/core/blocks/attester_slashing_test.go b/beacon-chain/core/blocks/attester_slashing_test.go index 295146c77c77..75c5b7efa0cd 100644 --- a/beacon-chain/core/blocks/attester_slashing_test.go +++ b/beacon-chain/core/blocks/attester_slashing_test.go @@ -9,7 +9,6 @@ import ( v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -58,7 +57,7 @@ func TestProcessAttesterSlashings_DataNotSlashable(t *testing.T) { AttesterSlashings: slashings, }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } @@ -97,7 +96,7 @@ func TestProcessAttesterSlashings_IndexedAttestationFailedToVerify(t *testing.T) }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } @@ -153,7 +152,7 @@ func TestProcessAttesterSlashings_AppliesCorrectStatus(t *testing.T) { }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } @@ -226,7 +225,7 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusAltair(t *testing.T) { }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } @@ -299,7 +298,7 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusBellatrix(t *testing.T) { }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } @@ -372,7 +371,7 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusCapella(t *testing.T) { }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } diff --git a/beacon-chain/core/blocks/block_operations_fuzz_test.go b/beacon-chain/core/blocks/block_operations_fuzz_test.go index 8d2ac1fbbb74..28db7d8c4f64 100644 --- a/beacon-chain/core/blocks/block_operations_fuzz_test.go +++ b/beacon-chain/core/blocks/block_operations_fuzz_test.go @@ -10,7 +10,6 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -217,7 +216,7 @@ func TestFuzzProcessAttesterSlashings_10000(t *testing.T) { fuzzer.Fuzz(a) s, err := state_native.InitializeFromProtoUnsafePhase0(state) require.NoError(t, err) - r, err := ProcessAttesterSlashings(ctx, s, []interfaces.AttesterSlashing{a}, v.SlashValidator) + r, err := ProcessAttesterSlashings(ctx, s, []ethpb.AttSlashing{a}, v.SlashValidator) if err != nil && r != nil { t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and slashing: %v", r, err, state, a) } diff --git a/beacon-chain/core/blocks/block_regression_test.go b/beacon-chain/core/blocks/block_regression_test.go index 807cea81b48c..96339adba904 100644 --- a/beacon-chain/core/blocks/block_regression_test.go +++ b/beacon-chain/core/blocks/block_regression_test.go @@ -8,7 +8,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -92,7 +91,7 @@ func TestProcessAttesterSlashings_RegressionSlashableIndices(t *testing.T) { }, } - ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + ss := make([]ethpb.AttSlashing, len(b.Block.Body.AttesterSlashings)) for i, s := range b.Block.Body.AttesterSlashings { ss[i] = s } diff --git a/beacon-chain/core/blocks/signature.go b/beacon-chain/core/blocks/signature.go index 720e025d41bc..b14244160585 100644 --- a/beacon-chain/core/blocks/signature.go +++ b/beacon-chain/core/blocks/signature.go @@ -179,7 +179,7 @@ func randaoSigningData(ctx context.Context, beaconState state.ReadOnlyBeaconStat func createAttestationSignatureBatch( ctx context.Context, beaconState state.ReadOnlyBeaconState, - atts []interfaces.Attestation, + atts []ethpb.Att, domain []byte, ) (*bls.SignatureBatch, error) { if len(atts) == 0 { @@ -233,7 +233,7 @@ func createAttestationSignatureBatch( // AttestationSignatureBatch retrieves all the related attestation signature data such as the relevant public keys, // signatures and attestation signing data and collate it into a signature batch object. -func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBeaconState, atts []interfaces.Attestation) (*bls.SignatureBatch, error) { +func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBeaconState, atts []ethpb.Att) (*bls.SignatureBatch, error) { if len(atts) == 0 { return bls.NewSet(), nil } @@ -243,8 +243,8 @@ func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBe dt := params.BeaconConfig().DomainBeaconAttester // Split attestations by fork. Note: the signature domain will differ based on the fork. - var preForkAtts []interfaces.Attestation - var postForkAtts []interfaces.Attestation + var preForkAtts []ethpb.Att + var postForkAtts []ethpb.Att for _, a := range atts { if slots.ToEpoch(a.GetData().Slot) < fork.Epoch { preForkAtts = append(preForkAtts, a) diff --git a/beacon-chain/core/feed/operation/BUILD.bazel b/beacon-chain/core/feed/operation/BUILD.bazel index b159265e1926..0d475e92d8ce 100644 --- a/beacon-chain/core/feed/operation/BUILD.bazel +++ b/beacon-chain/core/feed/operation/BUILD.bazel @@ -11,7 +11,6 @@ go_library( deps = [ "//async/event:go_default_library", "//consensus-types/blocks:go_default_library", - "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", ], ) diff --git a/beacon-chain/core/feed/operation/events.go b/beacon-chain/core/feed/operation/events.go index 2a4bf6942ff1..86287da922e5 100644 --- a/beacon-chain/core/feed/operation/events.go +++ b/beacon-chain/core/feed/operation/events.go @@ -3,7 +3,6 @@ package operation import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -38,7 +37,7 @@ const ( // UnAggregatedAttReceivedData is the data sent with UnaggregatedAttReceived events. type UnAggregatedAttReceivedData struct { // Attestation is the unaggregated attestation object. - Attestation interfaces.Attestation + Attestation ethpb.Att } // AggregatedAttReceivedData is the data sent with AggregatedAttReceived events. @@ -76,5 +75,5 @@ type ProposerSlashingReceivedData struct { // AttesterSlashingReceivedData is the data sent with AttesterSlashingReceived events. type AttesterSlashingReceivedData struct { - AttesterSlashing interfaces.AttesterSlashing + AttesterSlashing ethpb.AttSlashing } diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index 1912d6c2998c..c8b45a534c18 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -73,7 +73,6 @@ go_test( "//beacon-chain/state/state-native:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//crypto/hash:go_default_library", diff --git a/beacon-chain/core/helpers/attestation.go b/beacon-chain/core/helpers/attestation.go index bb620ba17969..0e9baf993235 100644 --- a/beacon-chain/core/helpers/attestation.go +++ b/beacon-chain/core/helpers/attestation.go @@ -7,7 +7,6 @@ import ( "time" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -22,7 +21,7 @@ var ( // ValidateNilAttestation checks if any composite field of input attestation is nil. // Access to these nil fields will result in run time panic, // it is recommended to run these checks as first line of defense. -func ValidateNilAttestation(attestation interfaces.Attestation) error { +func ValidateNilAttestation(attestation ethpb.Att) error { if attestation == nil { return errors.New("attestation can't be nil") } @@ -72,7 +71,7 @@ func IsAggregator(committeeCount uint64, slotSig []byte) (bool, error) { // IsAggregated returns true if the attestation is an aggregated attestation, // false otherwise. -func IsAggregated(attestation interfaces.Attestation) bool { +func IsAggregated(attestation ethpb.Att) bool { return attestation.GetAggregationBits().Count() > 1 } @@ -91,7 +90,7 @@ func IsAggregated(attestation interfaces.Attestation) bool { // committees_since_epoch_start = committees_per_slot * slots_since_epoch_start // // return uint64((committees_since_epoch_start + committee_index) % ATTESTATION_SUBNET_COUNT) -func ComputeSubnetForAttestation(activeValCount uint64, att interfaces.Attestation) uint64 { +func ComputeSubnetForAttestation(activeValCount uint64, att ethpb.Att) uint64 { return ComputeSubnetFromCommitteeAndSlot(activeValCount, att.GetData().CommitteeIndex, att.GetData().Slot) } diff --git a/beacon-chain/core/helpers/attestation_test.go b/beacon-chain/core/helpers/attestation_test.go index 6ffb5f447695..e4a84ae42233 100644 --- a/beacon-chain/core/helpers/attestation_test.go +++ b/beacon-chain/core/helpers/attestation_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -239,7 +238,7 @@ func TestVerifyCheckpointEpoch_Ok(t *testing.T) { func TestValidateNilAttestation(t *testing.T) { tests := []struct { name string - attestation interfaces.Attestation + attestation ethpb.Att errString string }{ { diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 86134ca4d0e2..d1371a953779 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -15,12 +15,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -257,7 +257,7 @@ func VerifyBitfieldLength(bf bitfield.Bitfield, committeeSize uint64) error { // VerifyAttestationBitfieldLengths verifies that an attestations aggregation bitfields is // a valid length matching the size of the committee. -func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att interfaces.Attestation) error { +func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att ethpb.Att) error { committee, err := BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return errors.Wrap(err, "could not retrieve beacon committees") diff --git a/beacon-chain/monitor/process_attestation.go b/beacon-chain/monitor/process_attestation.go index 9f596eea61ea..7191aebdd19d 100644 --- a/beacon-chain/monitor/process_attestation.go +++ b/beacon-chain/monitor/process_attestation.go @@ -33,7 +33,7 @@ func (s *Service) canUpdateAttestedValidator(idx primitives.ValidatorIndex, slot } // attestingIndices returns the indices of validators that participated in the given aggregated attestation. -func attestingIndices(ctx context.Context, state state.BeaconState, att interfaces.Attestation) ([]uint64, error) { +func attestingIndices(ctx context.Context, state state.BeaconState, att ethpb.Att) ([]uint64, error) { committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err @@ -63,7 +63,7 @@ func (s *Service) processAttestations(ctx context.Context, state state.BeaconSta } // processIncludedAttestation logs in the event for the tracked validators' and their latest attestation gets processed. -func (s *Service) processIncludedAttestation(ctx context.Context, state state.BeaconState, att interfaces.Attestation) { +func (s *Service) processIncludedAttestation(ctx context.Context, state state.BeaconState, att ethpb.Att) { attestingIndices, err := attestingIndices(ctx, state, att) if err != nil { log.WithError(err).Error("Could not get attesting indices") @@ -161,7 +161,7 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be } // processUnaggregatedAttestation logs when the beacon node observes an unaggregated attestation from tracked validator. -func (s *Service) processUnaggregatedAttestation(ctx context.Context, att interfaces.Attestation) { +func (s *Service) processUnaggregatedAttestation(ctx context.Context, att ethpb.Att) { s.RLock() defer s.RUnlock() root := bytesutil.ToBytes32(att.GetData().BeaconBlockRoot) diff --git a/beacon-chain/monitor/process_block.go b/beacon-chain/monitor/process_block.go index d1661a3dfb6d..2edd14e2e970 100644 --- a/beacon-chain/monitor/process_block.go +++ b/beacon-chain/monitor/process_block.go @@ -121,17 +121,20 @@ func (s *Service) processSlashings(blk interfaces.ReadOnlyBeaconBlock) { for _, slashing := range blk.Body().AttesterSlashings() { for _, idx := range blocks.SlashableAttesterIndices(slashing) { if s.trackedIndex(primitives.ValidatorIndex(idx)) { + data1 := slashing.FirstAttestation().GetData() + data2 := slashing.SecondAttestation().GetData() + log.WithFields(logrus.Fields{ "attesterIndex": idx, "blockInclusionSlot": blk.Slot(), - "attestationSlot1": slashing.GetFirstAttestation().GetData().Slot, - "beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.GetFirstAttestation().GetData().BeaconBlockRoot)), - "sourceEpoch1": slashing.GetFirstAttestation().GetData().Source.Epoch, - "targetEpoch1": slashing.GetFirstAttestation().GetData().Target.Epoch, - "attestationSlot2": slashing.GetSecondAttestation().GetData().Slot, - "beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.GetSecondAttestation().GetData().BeaconBlockRoot)), - "sourceEpoch2": slashing.GetSecondAttestation().GetData().Source.Epoch, - "targetEpoch2": slashing.GetSecondAttestation().GetData().Target.Epoch, + "attestationSlot1": data1.Slot, + "beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(data1.BeaconBlockRoot)), + "sourceEpoch1": data1.Source.Epoch, + "targetEpoch1": data1.Target.Epoch, + "attestationSlot2": data2.Slot, + "beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(data2.BeaconBlockRoot)), + "sourceEpoch2": data2.Source.Epoch, + "targetEpoch2": data2.Target.Epoch, }).Info("Attester slashing was included") } } diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index 96f11a78f746..5b4cc57b38d4 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -20,9 +20,9 @@ go_library( "//cache/lru:go_default_library", "//config/features:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", @@ -49,7 +49,6 @@ go_test( "//beacon-chain/operations/attestations/kv:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/BUILD.bazel b/beacon-chain/operations/attestations/kv/BUILD.bazel index a2daf64e8378..807bc292003f 100644 --- a/beacon-chain/operations/attestations/kv/BUILD.bazel +++ b/beacon-chain/operations/attestations/kv/BUILD.bazel @@ -15,9 +15,9 @@ go_library( deps = [ "//beacon-chain/core/helpers:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "@com_github_patrickmn_go_cache//:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -39,7 +39,6 @@ go_test( embed = [":go_default_library"], deps = [ "//config/fieldparams:go_default_library", - "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index 8c11767db2ef..b0571cb6ab68 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" log "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -28,11 +28,11 @@ func (c *AttCaches) AggregateUnaggregatedAttestations(ctx context.Context) error return c.aggregateUnaggregatedAtts(ctx, unaggregatedAtts) } -func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedAtts []interfaces.Attestation) error { +func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedAtts []ethpb.Att) error { _, span := trace.StartSpan(ctx, "operations.attestations.kv.aggregateUnaggregatedAtts") defer span.End() - attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(unaggregatedAtts)) + attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(unaggregatedAtts)) for _, att := range unaggregatedAtts { attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { @@ -66,12 +66,12 @@ func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedA // aggregateParallel aggregates attestations in parallel for `atts` and saves them in the pool, // returns the unaggregated attestations that weren't able to aggregate. // Given `n` CPU cores, it creates a channel of size `n` and spawns `n` goroutines to aggregate attestations -func (c *AttCaches) aggregateParallel(atts map[[32]byte][]interfaces.Attestation, leftOver map[[32]byte]bool) map[[32]byte]bool { +func (c *AttCaches) aggregateParallel(atts map[[32]byte][]ethpb.Att, leftOver map[[32]byte]bool) map[[32]byte]bool { var leftoverLock sync.Mutex wg := sync.WaitGroup{} n := runtime.GOMAXPROCS(0) // defaults to the value of runtime.NumCPU - ch := make(chan []interfaces.Attestation, n) + ch := make(chan []ethpb.Att, n) wg.Add(n) for i := 0; i < n; i++ { go func() { @@ -87,7 +87,7 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]interfaces.Attestation continue } if helpers.IsAggregated(aggregated) { - if err := c.SaveAggregatedAttestations([]interfaces.Attestation{aggregated}); err != nil { + if err := c.SaveAggregatedAttestations([]ethpb.Att{aggregated}); err != nil { log.WithError(err).Error("could not save aggregated attestation") continue } @@ -116,7 +116,7 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]interfaces.Attestation } // SaveAggregatedAttestation saves an aggregated attestation in cache. -func (c *AttCaches) SaveAggregatedAttestation(att interfaces.Attestation) error { +func (c *AttCaches) SaveAggregatedAttestation(att ethpb.Att) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } @@ -143,12 +143,12 @@ func (c *AttCaches) SaveAggregatedAttestation(att interfaces.Attestation) error if err != nil { return errors.Wrap(err, "could not tree hash attestation") } - copiedAtt := interfaces.CopyAttestation(att) + copiedAtt := att.Copy() c.aggregatedAttLock.Lock() defer c.aggregatedAttLock.Unlock() atts, ok := c.aggregatedAtt[r] if !ok { - atts := []interfaces.Attestation{copiedAtt} + atts := []ethpb.Att{copiedAtt} c.aggregatedAtt[r] = atts return nil } @@ -163,7 +163,7 @@ func (c *AttCaches) SaveAggregatedAttestation(att interfaces.Attestation) error } // SaveAggregatedAttestations saves a list of aggregated attestations in cache. -func (c *AttCaches) SaveAggregatedAttestations(atts []interfaces.Attestation) error { +func (c *AttCaches) SaveAggregatedAttestations(atts []ethpb.Att) error { for _, att := range atts { if err := c.SaveAggregatedAttestation(att); err != nil { log.WithError(err).Debug("Could not save aggregated attestation") @@ -176,11 +176,11 @@ func (c *AttCaches) SaveAggregatedAttestations(atts []interfaces.Attestation) er } // AggregatedAttestations returns the aggregated attestations in cache. -func (c *AttCaches) AggregatedAttestations() []interfaces.Attestation { +func (c *AttCaches) AggregatedAttestations() []ethpb.Att { c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() - atts := make([]interfaces.Attestation, 0) + atts := make([]ethpb.Att, 0) for _, a := range c.aggregatedAtt { atts = append(atts, a...) @@ -191,11 +191,11 @@ func (c *AttCaches) AggregatedAttestations() []interfaces.Attestation { // AggregatedAttestationsBySlotIndex returns the aggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation { +func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att { _, span := trace.StartSpan(ctx, "operations.attestations.kv.AggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]interfaces.Attestation, 0) + atts := make([]ethpb.Att, 0) c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() @@ -209,7 +209,7 @@ func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot } // DeleteAggregatedAttestation deletes the aggregated attestations in cache. -func (c *AttCaches) DeleteAggregatedAttestation(att interfaces.Attestation) error { +func (c *AttCaches) DeleteAggregatedAttestation(att ethpb.Att) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } @@ -232,7 +232,7 @@ func (c *AttCaches) DeleteAggregatedAttestation(att interfaces.Attestation) erro return nil } - filtered := make([]interfaces.Attestation, 0) + filtered := make([]ethpb.Att, 0) for _, a := range attList { if c, err := att.GetAggregationBits().Contains(a.GetAggregationBits()); err != nil { return err @@ -250,7 +250,7 @@ func (c *AttCaches) DeleteAggregatedAttestation(att interfaces.Attestation) erro } // HasAggregatedAttestation checks if the input attestations has already existed in cache. -func (c *AttCaches) HasAggregatedAttestation(att interfaces.Attestation) (bool, error) { +func (c *AttCaches) HasAggregatedAttestation(att ethpb.Att) (bool, error) { if err := helpers.ValidateNilAttestation(att); err != nil { return false, err } diff --git a/beacon-chain/operations/attestations/kv/aggregated_test.go b/beacon-chain/operations/attestations/kv/aggregated_test.go index 37a8e5013ddd..5f2ddd40a1da 100644 --- a/beacon-chain/operations/attestations/kv/aggregated_test.go +++ b/beacon-chain/operations/attestations/kv/aggregated_test.go @@ -9,7 +9,6 @@ import ( "github.com/pkg/errors" fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -31,7 +30,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) { att6 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1010}, Signature: sig1.Marshal()}) att7 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig1.Marshal()}) att8 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1001}, Signature: sig2.Marshal()}) - atts := []interfaces.Attestation{att1, att2, att3, att4, att5, att6, att7, att8} + atts := []ethpb.Att{att1, att2, att3, att4, att5, att6, att7, att8} require.NoError(t, cache.SaveUnaggregatedAttestations(atts)) require.NoError(t, cache.AggregateUnaggregatedAttestations(context.Background())) @@ -42,7 +41,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { tests := []struct { name string - att interfaces.Attestation + att ethpb.Att count int wantErrString string }{ @@ -119,13 +118,13 @@ func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestations(t *testing.T) { tests := []struct { name string - atts []interfaces.Attestation + atts []ethpb.Att count int wantErrString string }{ { name: "no duplicates", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, @@ -154,13 +153,13 @@ func TestKV_Aggregated_SaveAggregatedAttestations(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestations_SomeGoodSomeBad(t *testing.T) { tests := []struct { name string - atts []interfaces.Attestation + atts []ethpb.Att count int wantErrString string }{ { name: "the first attestation is bad", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1100}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, @@ -192,7 +191,7 @@ func TestKV_Aggregated_AggregatedAttestations(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []interfaces.Attestation{att1, att2, att3} + atts := []ethpb.Att{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveAggregatedAttestation(att)) @@ -247,13 +246,13 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11010}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11010}}) att4 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b10101}}) - atts := []interfaces.Attestation{att1, att2, att3, att4} + atts := []ethpb.Att{att1, att2, att3, att4} require.NoError(t, cache.SaveAggregatedAttestations(atts)) require.NoError(t, cache.DeleteAggregatedAttestation(att1)) require.NoError(t, cache.DeleteAggregatedAttestation(att3)) returned := cache.AggregatedAttestations() - wanted := []interfaces.Attestation{att2} + wanted := []ethpb.Att{att2} assert.DeepEqual(t, wanted, returned) }) @@ -263,14 +262,14 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110111}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110100}}) att4 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110101}}) - atts := []interfaces.Attestation{att1, att2, att3, att4} + atts := []ethpb.Att{att1, att2, att3, att4} require.NoError(t, cache.SaveAggregatedAttestations(atts)) assert.Equal(t, 2, cache.AggregatedAttestationCount(), "Unexpected number of atts") require.NoError(t, cache.DeleteAggregatedAttestation(att4)) returned := cache.AggregatedAttestations() - wanted := []interfaces.Attestation{att1, att2} + wanted := []ethpb.Att{att1, att2} sort.Slice(returned, func(i, j int) bool { return string(returned[i].GetAggregationBits()) < string(returned[j].GetAggregationBits()) }) @@ -281,7 +280,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { tests := []struct { name string - existing []interfaces.Attestation + existing []ethpb.Att input *ethpb.Attestation want bool err error @@ -320,7 +319,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with exact match", - existing: []interfaces.Attestation{ðpb.Attestation{ + existing: []ethpb.Att{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -335,7 +334,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with subset aggregation", - existing: []interfaces.Attestation{ðpb.Attestation{ + existing: []ethpb.Att{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -350,7 +349,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with superset aggregation", - existing: []interfaces.Attestation{ðpb.Attestation{ + existing: []ethpb.Att{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -365,7 +364,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with same data in cache with overlapping aggregation, input is subset", - existing: []interfaces.Attestation{ + existing: []ethpb.Att{ ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, @@ -388,7 +387,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with same data in cache with overlapping aggregation and input is superset", - existing: []interfaces.Attestation{ + existing: []ethpb.Att{ ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, @@ -411,7 +410,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with different data in cache", - existing: []interfaces.Attestation{ + existing: []ethpb.Att{ ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 2, @@ -434,7 +433,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "attestations with different bitlist lengths", - existing: []interfaces.Attestation{ + existing: []ethpb.Att{ ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 2, diff --git a/beacon-chain/operations/attestations/kv/block.go b/beacon-chain/operations/attestations/kv/block.go index 797deb6913c1..49cc90b27990 100644 --- a/beacon-chain/operations/attestations/kv/block.go +++ b/beacon-chain/operations/attestations/kv/block.go @@ -2,11 +2,11 @@ package kv import ( "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // SaveBlockAttestation saves an block attestation in cache. -func (c *AttCaches) SaveBlockAttestation(att interfaces.Attestation) error { +func (c *AttCaches) SaveBlockAttestation(att ethpb.Att) error { if att == nil { return nil } @@ -19,7 +19,7 @@ func (c *AttCaches) SaveBlockAttestation(att interfaces.Attestation) error { defer c.blockAttLock.Unlock() atts, ok := c.blockAtt[r] if !ok { - atts = make([]interfaces.Attestation, 0, 1) + atts = make([]ethpb.Att, 0, 1) } // Ensure that this attestation is not already fully contained in an existing attestation. @@ -31,14 +31,14 @@ func (c *AttCaches) SaveBlockAttestation(att interfaces.Attestation) error { } } - c.blockAtt[r] = append(atts, interfaces.CopyAttestation(att)) + c.blockAtt[r] = append(atts, att.Copy()) return nil } // BlockAttestations returns the block attestations in cache. -func (c *AttCaches) BlockAttestations() []interfaces.Attestation { - atts := make([]interfaces.Attestation, 0) +func (c *AttCaches) BlockAttestations() []ethpb.Att { + atts := make([]ethpb.Att, 0) c.blockAttLock.RLock() defer c.blockAttLock.RUnlock() @@ -50,7 +50,7 @@ func (c *AttCaches) BlockAttestations() []interfaces.Attestation { } // DeleteBlockAttestation deletes a block attestation in cache. -func (c *AttCaches) DeleteBlockAttestation(att interfaces.Attestation) error { +func (c *AttCaches) DeleteBlockAttestation(att ethpb.Att) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/block_test.go b/beacon-chain/operations/attestations/kv/block_test.go index c1a26181e925..fcf17d350da3 100644 --- a/beacon-chain/operations/attestations/kv/block_test.go +++ b/beacon-chain/operations/attestations/kv/block_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -18,7 +17,7 @@ func TestKV_BlockAttestation_CanSaveRetrieve(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []interfaces.Attestation{att1, att2, att3} + atts := []ethpb.Att{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveBlockAttestation(att)) @@ -44,7 +43,7 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []interfaces.Attestation{att1, att2, att3} + atts := []ethpb.Att{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveBlockAttestation(att)) @@ -54,6 +53,6 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) { require.NoError(t, cache.DeleteBlockAttestation(att3)) returned := cache.BlockAttestations() - wanted := []interfaces.Attestation{att2} + wanted := []ethpb.Att{att2} assert.DeepEqual(t, wanted, returned) } diff --git a/beacon-chain/operations/attestations/kv/forkchoice.go b/beacon-chain/operations/attestations/kv/forkchoice.go index 202b6ef8998f..3e79e8d23ed4 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice.go +++ b/beacon-chain/operations/attestations/kv/forkchoice.go @@ -2,11 +2,11 @@ package kv import ( "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // SaveForkchoiceAttestation saves an forkchoice attestation in cache. -func (c *AttCaches) SaveForkchoiceAttestation(att interfaces.Attestation) error { +func (c *AttCaches) SaveForkchoiceAttestation(att ethpb.Att) error { if att == nil { return nil } @@ -15,16 +15,15 @@ func (c *AttCaches) SaveForkchoiceAttestation(att interfaces.Attestation) error return errors.Wrap(err, "could not tree hash attestation") } - att = interfaces.CopyAttestation(att) c.forkchoiceAttLock.Lock() defer c.forkchoiceAttLock.Unlock() - c.forkchoiceAtt[r] = att + c.forkchoiceAtt[r] = att.Copy() return nil } // SaveForkchoiceAttestations saves a list of forkchoice attestations in cache. -func (c *AttCaches) SaveForkchoiceAttestations(atts []interfaces.Attestation) error { +func (c *AttCaches) SaveForkchoiceAttestations(atts []ethpb.Att) error { for _, att := range atts { if err := c.SaveForkchoiceAttestation(att); err != nil { return err @@ -35,20 +34,20 @@ func (c *AttCaches) SaveForkchoiceAttestations(atts []interfaces.Attestation) er } // ForkchoiceAttestations returns the forkchoice attestations in cache. -func (c *AttCaches) ForkchoiceAttestations() []interfaces.Attestation { +func (c *AttCaches) ForkchoiceAttestations() []ethpb.Att { c.forkchoiceAttLock.RLock() defer c.forkchoiceAttLock.RUnlock() - atts := make([]interfaces.Attestation, 0, len(c.forkchoiceAtt)) + atts := make([]ethpb.Att, 0, len(c.forkchoiceAtt)) for _, att := range c.forkchoiceAtt { - atts = append(atts, interfaces.CopyAttestation(att) /* Copied */) + atts = append(atts, att.Copy()) } return atts } // DeleteForkchoiceAttestation deletes a forkchoice attestation in cache. -func (c *AttCaches) DeleteForkchoiceAttestation(att interfaces.Attestation) error { +func (c *AttCaches) DeleteForkchoiceAttestation(att ethpb.Att) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/forkchoice_test.go b/beacon-chain/operations/attestations/kv/forkchoice_test.go index 005c53f79b70..7f6b4d4b2ce9 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice_test.go +++ b/beacon-chain/operations/attestations/kv/forkchoice_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -18,7 +17,7 @@ func TestKV_Forkchoice_CanSaveRetrieve(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []interfaces.Attestation{att1, att2, att3} + atts := []ethpb.Att{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveForkchoiceAttestation(att)) @@ -39,7 +38,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []interfaces.Attestation{att1, att2, att3} + atts := []ethpb.Att{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveForkchoiceAttestation(att)) @@ -49,7 +48,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) { require.NoError(t, cache.DeleteForkchoiceAttestation(att3)) returned := cache.ForkchoiceAttestations() - wanted := []interfaces.Attestation{att2} + wanted := []ethpb.Att{att2} assert.DeepEqual(t, wanted, returned) } diff --git a/beacon-chain/operations/attestations/kv/kv.go b/beacon-chain/operations/attestations/kv/kv.go index f6bd3bcd70dd..d0d1dc9ef85d 100644 --- a/beacon-chain/operations/attestations/kv/kv.go +++ b/beacon-chain/operations/attestations/kv/kv.go @@ -9,8 +9,8 @@ import ( "github.com/patrickmn/go-cache" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) var hashFn = hash.Proto @@ -20,13 +20,13 @@ var hashFn = hash.Proto // such are unaggregated, aggregated or attestations within a block. type AttCaches struct { aggregatedAttLock sync.RWMutex - aggregatedAtt map[[32]byte][]interfaces.Attestation + aggregatedAtt map[[32]byte][]ethpb.Att unAggregateAttLock sync.RWMutex - unAggregatedAtt map[[32]byte]interfaces.Attestation + unAggregatedAtt map[[32]byte]ethpb.Att forkchoiceAttLock sync.RWMutex - forkchoiceAtt map[[32]byte]interfaces.Attestation + forkchoiceAtt map[[32]byte]ethpb.Att blockAttLock sync.RWMutex - blockAtt map[[32]byte][]interfaces.Attestation + blockAtt map[[32]byte][]ethpb.Att seenAtt *cache.Cache } @@ -36,10 +36,10 @@ func NewAttCaches() *AttCaches { secsInEpoch := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) c := cache.New(secsInEpoch*time.Second, 2*secsInEpoch*time.Second) pool := &AttCaches{ - unAggregatedAtt: make(map[[32]byte]interfaces.Attestation), - aggregatedAtt: make(map[[32]byte][]interfaces.Attestation), - forkchoiceAtt: make(map[[32]byte]interfaces.Attestation), - blockAtt: make(map[[32]byte][]interfaces.Attestation), + unAggregatedAtt: make(map[[32]byte]ethpb.Att), + aggregatedAtt: make(map[[32]byte][]ethpb.Att), + forkchoiceAtt: make(map[[32]byte]ethpb.Att), + blockAtt: make(map[[32]byte][]ethpb.Att), seenAtt: c, } diff --git a/beacon-chain/operations/attestations/kv/seen_bits.go b/beacon-chain/operations/attestations/kv/seen_bits.go index bca1678d7aee..03c565910470 100644 --- a/beacon-chain/operations/attestations/kv/seen_bits.go +++ b/beacon-chain/operations/attestations/kv/seen_bits.go @@ -6,10 +6,10 @@ import ( "github.com/patrickmn/go-cache" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c *AttCaches) insertSeenBit(att interfaces.Attestation) error { +func (c *AttCaches) insertSeenBit(att ethpb.Att) error { r, err := hashFn(att.GetData()) if err != nil { return err @@ -41,7 +41,7 @@ func (c *AttCaches) insertSeenBit(att interfaces.Attestation) error { return nil } -func (c *AttCaches) hasSeenBit(att interfaces.Attestation) (bool, error) { +func (c *AttCaches) hasSeenBit(att ethpb.Att) (bool, error) { r, err := hashFn(att.GetData()) if err != nil { return false, err diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index e16e36cbc745..63064773f180 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -5,13 +5,13 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" ) // SaveUnaggregatedAttestation saves an unaggregated attestation in cache. -func (c *AttCaches) SaveUnaggregatedAttestation(att interfaces.Attestation) error { +func (c *AttCaches) SaveUnaggregatedAttestation(att ethpb.Att) error { if att == nil { return nil } @@ -31,16 +31,15 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att interfaces.Attestation) erro if err != nil { return errors.Wrap(err, "could not tree hash attestation") } - att = interfaces.CopyAttestation(att) // Copied. c.unAggregateAttLock.Lock() defer c.unAggregateAttLock.Unlock() - c.unAggregatedAtt[r] = att + c.unAggregatedAtt[r] = att.Copy() return nil } // SaveUnaggregatedAttestations saves a list of unaggregated attestations in cache. -func (c *AttCaches) SaveUnaggregatedAttestations(atts []interfaces.Attestation) error { +func (c *AttCaches) SaveUnaggregatedAttestations(atts []ethpb.Att) error { for _, att := range atts { if err := c.SaveUnaggregatedAttestation(att); err != nil { return err @@ -51,18 +50,18 @@ func (c *AttCaches) SaveUnaggregatedAttestations(atts []interfaces.Attestation) } // UnaggregatedAttestations returns all the unaggregated attestations in cache. -func (c *AttCaches) UnaggregatedAttestations() ([]interfaces.Attestation, error) { +func (c *AttCaches) UnaggregatedAttestations() ([]ethpb.Att, error) { c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() unAggregatedAtts := c.unAggregatedAtt - atts := make([]interfaces.Attestation, 0, len(unAggregatedAtts)) + atts := make([]ethpb.Att, 0, len(unAggregatedAtts)) for _, att := range unAggregatedAtts { seen, err := c.hasSeenBit(att) if err != nil { return nil, err } if !seen { - atts = append(atts, interfaces.CopyAttestation(att) /* Copied */) + atts = append(atts, att.Copy()) } } return atts, nil @@ -70,11 +69,11 @@ func (c *AttCaches) UnaggregatedAttestations() ([]interfaces.Attestation, error) // UnaggregatedAttestationsBySlotIndex returns the unaggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation { +func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att { _, span := trace.StartSpan(ctx, "operations.attestations.kv.UnaggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]interfaces.Attestation, 0) + atts := make([]ethpb.Att, 0) c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() @@ -90,7 +89,7 @@ func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slo } // DeleteUnaggregatedAttestation deletes the unaggregated attestations in cache. -func (c *AttCaches) DeleteUnaggregatedAttestation(att interfaces.Attestation) error { +func (c *AttCaches) DeleteUnaggregatedAttestation(att ethpb.Att) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/unaggregated_test.go b/beacon-chain/operations/attestations/kv/unaggregated_test.go index 115199d1b1e5..9131f5850706 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated_test.go +++ b/beacon-chain/operations/attestations/kv/unaggregated_test.go @@ -10,7 +10,6 @@ import ( fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -20,7 +19,7 @@ import ( func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { tests := []struct { name string - att interfaces.Attestation + att ethpb.Att count int wantErrString string }{ @@ -86,13 +85,13 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { func TestKV_Unaggregated_SaveUnaggregatedAttestations(t *testing.T) { tests := []struct { name string - atts []interfaces.Attestation + atts []ethpb.Att count int wantErrString string }{ { name: "unaggregated only", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}}), @@ -101,7 +100,7 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestations(t *testing.T) { }, { name: "has aggregated", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}}), ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b1111}, Data: ðpb.AttestationData{Slot: 2}}, util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}}), @@ -146,14 +145,14 @@ func TestKV_Unaggregated_DeleteUnaggregatedAttestation(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b110}}) - atts := []interfaces.Attestation{att1, att2, att3} + atts := []ethpb.Att{att1, att2, att3} require.NoError(t, cache.SaveUnaggregatedAttestations(atts)) for _, att := range atts { assert.NoError(t, cache.DeleteUnaggregatedAttestation(att)) } returned, err := cache.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []interfaces.Attestation{}, returned) + assert.DeepEqual(t, []ethpb.Att{}, returned) }) } @@ -169,7 +168,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { t.Run("none seen", func(t *testing.T) { cache := NewAttCaches() - atts := []interfaces.Attestation{ + atts := []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -186,7 +185,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { t.Run("some seen", func(t *testing.T) { cache := NewAttCaches() - atts := []interfaces.Attestation{ + atts := []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -206,12 +205,12 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { return bytes.Compare(returned[i].GetAggregationBits(), returned[j].GetAggregationBits()) < 0 }) require.NoError(t, err) - assert.DeepEqual(t, []interfaces.Attestation{atts[0], atts[2]}, returned) + assert.DeepEqual(t, []ethpb.Att{atts[0], atts[2]}, returned) }) t.Run("all seen", func(t *testing.T) { cache := NewAttCaches() - atts := []interfaces.Attestation{ + atts := []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -230,7 +229,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { assert.Equal(t, 0, cache.UnaggregatedAttestationCount()) returned, err := cache.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []interfaces.Attestation{}, returned) + assert.DeepEqual(t, []ethpb.Att{}, returned) }) } @@ -247,9 +246,9 @@ func TestKV_Unaggregated_UnaggregatedAttestationsBySlotIndex(t *testing.T) { } ctx := context.Background() returned := cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 1) - assert.DeepEqual(t, []interfaces.Attestation{att1}, returned) + assert.DeepEqual(t, []ethpb.Att{att1}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 2) - assert.DeepEqual(t, []interfaces.Attestation{att2}, returned) + assert.DeepEqual(t, []ethpb.Att{att2}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 2, 1) - assert.DeepEqual(t, []interfaces.Attestation{att3}, returned) + assert.DeepEqual(t, []ethpb.Att{att3}, returned) } diff --git a/beacon-chain/operations/attestations/pool.go b/beacon-chain/operations/attestations/pool.go index d6d457079099..e3bcf8a585ef 100644 --- a/beacon-chain/operations/attestations/pool.go +++ b/beacon-chain/operations/attestations/pool.go @@ -4,8 +4,8 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations/kv" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // Pool defines the necessary methods for Prysm attestations pool to serve @@ -15,30 +15,30 @@ import ( type Pool interface { // For Aggregated attestations AggregateUnaggregatedAttestations(ctx context.Context) error - SaveAggregatedAttestation(att interfaces.Attestation) error - SaveAggregatedAttestations(atts []interfaces.Attestation) error - AggregatedAttestations() []interfaces.Attestation - AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation - DeleteAggregatedAttestation(att interfaces.Attestation) error - HasAggregatedAttestation(att interfaces.Attestation) (bool, error) + SaveAggregatedAttestation(att ethpb.Att) error + SaveAggregatedAttestations(atts []ethpb.Att) error + AggregatedAttestations() []ethpb.Att + AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att + DeleteAggregatedAttestation(att ethpb.Att) error + HasAggregatedAttestation(att ethpb.Att) (bool, error) AggregatedAttestationCount() int // For unaggregated attestations. - SaveUnaggregatedAttestation(att interfaces.Attestation) error - SaveUnaggregatedAttestations(atts []interfaces.Attestation) error - UnaggregatedAttestations() ([]interfaces.Attestation, error) - UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation - DeleteUnaggregatedAttestation(att interfaces.Attestation) error + SaveUnaggregatedAttestation(att ethpb.Att) error + SaveUnaggregatedAttestations(atts []ethpb.Att) error + UnaggregatedAttestations() ([]ethpb.Att, error) + UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att + DeleteUnaggregatedAttestation(att ethpb.Att) error DeleteSeenUnaggregatedAttestations() (int, error) UnaggregatedAttestationCount() int // For attestations that were included in the block. - SaveBlockAttestation(att interfaces.Attestation) error - BlockAttestations() []interfaces.Attestation - DeleteBlockAttestation(att interfaces.Attestation) error + SaveBlockAttestation(att ethpb.Att) error + BlockAttestations() []ethpb.Att + DeleteBlockAttestation(att ethpb.Att) error // For attestations to be passed to fork choice. - SaveForkchoiceAttestation(att interfaces.Attestation) error - SaveForkchoiceAttestations(atts []interfaces.Attestation) error - ForkchoiceAttestations() []interfaces.Attestation - DeleteForkchoiceAttestation(att interfaces.Attestation) error + SaveForkchoiceAttestation(att ethpb.Att) error + SaveForkchoiceAttestations(atts []ethpb.Att) error + ForkchoiceAttestations() []ethpb.Att + DeleteForkchoiceAttestation(att ethpb.Att) error ForkchoiceAttestationCount() int } diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index bb0840d629c2..057c8ca9ae69 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -9,8 +9,8 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -67,7 +67,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { atts := append(s.cfg.Pool.AggregatedAttestations(), s.cfg.Pool.BlockAttestations()...) atts = append(atts, s.cfg.Pool.ForkchoiceAttestations()...) - attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(atts)) + attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(atts)) // Consolidate attestations by aggregating them by similar data root. for _, att := range atts { @@ -103,10 +103,10 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { // This aggregates a list of attestations using the aggregation algorithm defined in AggregateAttestations // and saves the attestations for fork choice. -func (s *Service) aggregateAndSaveForkChoiceAtts(atts []interfaces.Attestation) error { - clonedAtts := make([]interfaces.Attestation, len(atts)) +func (s *Service) aggregateAndSaveForkChoiceAtts(atts []ethpb.Att) error { + clonedAtts := make([]ethpb.Att, len(atts)) for i, a := range atts { - clonedAtts[i] = interfaces.CopyAttestation(a) + clonedAtts[i] = a.Copy() } aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) if err != nil { @@ -118,7 +118,7 @@ func (s *Service) aggregateAndSaveForkChoiceAtts(atts []interfaces.Attestation) // This checks if the attestation has previously been aggregated for fork choice // return true if yes, false if no. -func (s *Service) seen(att interfaces.Attestation) (bool, error) { +func (s *Service) seen(att ethpb.Att) (bool, error) { attRoot, err := hash.Proto(att.GetData()) if err != nil { return false, err diff --git a/beacon-chain/operations/attestations/prepare_forkchoice_test.go b/beacon-chain/operations/attestations/prepare_forkchoice_test.go index 11578b7729a7..f5958aa8bcf0 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice_test.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" @@ -26,7 +25,7 @@ func TestBatchAttestations_Multiple(t *testing.T) { sig := priv.Sign([]byte("dummy_test_data")) var mockRoot [32]byte - unaggregatedAtts := []interfaces.Attestation{ + unaggregatedAtts := []ethpb.Att{ ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: mockRoot[:], @@ -43,7 +42,7 @@ func TestBatchAttestations_Multiple(t *testing.T) { Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, } - aggregatedAtts := []interfaces.Attestation{ + aggregatedAtts := []ethpb.Att{ ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: mockRoot[:], @@ -94,12 +93,12 @@ func TestBatchAttestations_Multiple(t *testing.T) { } require.NoError(t, s.batchForkChoiceAtts(context.Background())) - wanted, err := attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[0], blockAtts[0]}) + wanted, err := attaggregation.Aggregate([]ethpb.Att{aggregatedAtts[0], blockAtts[0]}) require.NoError(t, err) - aggregated, err := attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[1], blockAtts[1]}) + aggregated, err := attaggregation.Aggregate([]ethpb.Att{aggregatedAtts[1], blockAtts[1]}) require.NoError(t, err) wanted = append(wanted, aggregated...) - aggregated, err = attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[2], blockAtts[2]}) + aggregated, err = attaggregation.Aggregate([]ethpb.Att{aggregatedAtts[2], blockAtts[2]}) require.NoError(t, err) wanted = append(wanted, aggregated...) @@ -130,15 +129,15 @@ func TestBatchAttestations_Single(t *testing.T) { Target: ðpb.Checkpoint{Root: mockRoot[:]}, } - unaggregatedAtts := []interfaces.Attestation{ + unaggregatedAtts := []ethpb.Att{ ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, } - aggregatedAtts := []interfaces.Attestation{ + aggregatedAtts := []ethpb.Att{ ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101100}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, } - blockAtts := []interfaces.Attestation{ + blockAtts := []ethpb.Att{ ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, // Duplicated @@ -175,7 +174,7 @@ func TestAggregateAndSaveForkChoiceAtts_Single(t *testing.T) { Target: ðpb.Checkpoint{Root: mockRoot[:]}, } - atts := []interfaces.Attestation{ + atts := []ethpb.Att{ ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}} require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts)) @@ -205,18 +204,18 @@ func TestAggregateAndSaveForkChoiceAtts_Multiple(t *testing.T) { require.Equal(t, true, ok, "Entity is not of type *ethpb.AttestationData") d2.Slot = 2 - atts1 := []interfaces.Attestation{ + atts1 := []ethpb.Att{ ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts1)) - atts2 := []interfaces.Attestation{ + atts2 := []ethpb.Att{ ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b10110}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b11100}, Signature: sig.Marshal()}, ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b11000}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts2)) - att3 := []interfaces.Attestation{ + att3 := []ethpb.Att{ ðpb.Attestation{Data: d2, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(att3)) diff --git a/beacon-chain/operations/attestations/prune_expired_test.go b/beacon-chain/operations/attestations/prune_expired_test.go index 99397b3c13d9..0755eadf3a4e 100644 --- a/beacon-chain/operations/attestations/prune_expired_test.go +++ b/beacon-chain/operations/attestations/prune_expired_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/async" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -32,13 +31,13 @@ func TestPruneExpired_Ticker(t *testing.T) { ad2 := util.HydrateAttestationData(ðpb.AttestationData{Slot: 1}) - atts := []interfaces.Attestation{ + atts := []ethpb.Att{ ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, } require.NoError(t, s.cfg.Pool.SaveUnaggregatedAttestations(atts)) require.Equal(t, 2, s.cfg.Pool.UnaggregatedAttestationCount(), "Unexpected number of attestations") - atts = []interfaces.Attestation{ + atts = []ethpb.Att{ ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, } @@ -97,7 +96,7 @@ func TestPruneExpired_PruneExpiredAtts(t *testing.T) { att2 := ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1111}} att3 := ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1101}} att4 := ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1110}} - atts := []interfaces.Attestation{att1, att2, att3, att4} + atts := []ethpb.Att{att1, att2, att3, att4} require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(atts)) for _, att := range atts { require.NoError(t, s.cfg.Pool.SaveBlockAttestation(att)) diff --git a/beacon-chain/operations/slashings/BUILD.bazel b/beacon-chain/operations/slashings/BUILD.bazel index 3d158ccce832..e8d40e847377 100644 --- a/beacon-chain/operations/slashings/BUILD.bazel +++ b/beacon-chain/operations/slashings/BUILD.bazel @@ -21,7 +21,6 @@ go_library( "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -48,7 +47,6 @@ go_test( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/operations/slashings/mock/BUILD.bazel b/beacon-chain/operations/slashings/mock/BUILD.bazel index d501e4c7ac9d..27ad01733569 100644 --- a/beacon-chain/operations/slashings/mock/BUILD.bazel +++ b/beacon-chain/operations/slashings/mock/BUILD.bazel @@ -8,7 +8,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/state:go_default_library", - "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", ], ) diff --git a/beacon-chain/operations/slashings/mock/mock.go b/beacon-chain/operations/slashings/mock/mock.go index 1498b979b8d9..b30747a0a4f8 100644 --- a/beacon-chain/operations/slashings/mock/mock.go +++ b/beacon-chain/operations/slashings/mock/mock.go @@ -4,18 +4,17 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // PoolMock is a fake implementation of PoolManager. type PoolMock struct { - PendingAttSlashings []interfaces.AttesterSlashing + PendingAttSlashings []ethpb.AttSlashing PendingPropSlashings []*ethpb.ProposerSlashing } // PendingAttesterSlashings -- -func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []interfaces.AttesterSlashing { +func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []ethpb.AttSlashing { return m.PendingAttSlashings } @@ -25,7 +24,7 @@ func (m *PoolMock) PendingProposerSlashings(_ context.Context, _ state.ReadOnlyB } // InsertAttesterSlashing -- -func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing interfaces.AttesterSlashing) error { +func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing ethpb.AttSlashing) error { m.PendingAttSlashings = append(m.PendingAttSlashings, slashing) return nil } @@ -37,7 +36,7 @@ func (m *PoolMock) InsertProposerSlashing(_ context.Context, _ state.ReadOnlyBea } // MarkIncludedAttesterSlashing -- -func (*PoolMock) MarkIncludedAttesterSlashing(_ interfaces.AttesterSlashing) { +func (*PoolMock) MarkIncludedAttesterSlashing(_ ethpb.AttSlashing) { panic("implement me") } diff --git a/beacon-chain/operations/slashings/service.go b/beacon-chain/operations/slashings/service.go index 2439d9004fac..ef7370975efa 100644 --- a/beacon-chain/operations/slashings/service.go +++ b/beacon-chain/operations/slashings/service.go @@ -11,7 +11,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -31,7 +30,7 @@ func NewPool() *Pool { // PendingAttesterSlashings returns attester slashings that are able to be included into a block. // This method will return the amount of pending attester slashings for a block transition unless parameter `noLimit` is true // to indicate the request is for noLimit pending items. -func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []interfaces.AttesterSlashing { +func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []ethpb.AttSlashing { p.lock.Lock() defer p.lock.Unlock() _, span := trace.StartSpan(ctx, "operations.PendingAttesterSlashing") @@ -47,7 +46,7 @@ func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnl if noLimit { maxSlashings = uint64(len(p.pendingAttesterSlashing)) } - pending := make([]interfaces.AttesterSlashing, 0, maxSlashings) + pending := make([]ethpb.AttSlashing, 0, maxSlashings) for i := 0; i < len(p.pendingAttesterSlashing); i++ { if uint64(len(pending)) >= maxSlashings { break @@ -65,8 +64,8 @@ func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnl } attSlashing := slashing.attesterSlashing slashedVal := slice.IntersectionUint64( - attSlashing.GetFirstAttestation().GetAttestingIndices(), - attSlashing.GetSecondAttestation().GetAttestingIndices(), + attSlashing.FirstAttestation().GetAttestingIndices(), + attSlashing.SecondAttestation().GetAttestingIndices(), ) for _, idx := range slashedVal { included[primitives.ValidatorIndex(idx)] = true @@ -122,7 +121,7 @@ func (p *Pool) PendingProposerSlashings(ctx context.Context, state state.ReadOnl func (p *Pool) InsertAttesterSlashing( ctx context.Context, state state.ReadOnlyBeaconState, - slashing interfaces.AttesterSlashing, + slashing ethpb.AttSlashing, ) error { p.lock.Lock() defer p.lock.Unlock() @@ -133,7 +132,7 @@ func (p *Pool) InsertAttesterSlashing( return errors.Wrap(err, "could not verify attester slashing") } - slashedVal := slice.IntersectionUint64(slashing.GetFirstAttestation().GetAttestingIndices(), slashing.GetSecondAttestation().GetAttestingIndices()) + slashedVal := slice.IntersectionUint64(slashing.FirstAttestation().GetAttestingIndices(), slashing.SecondAttestation().GetAttestingIndices()) cantSlash := make([]uint64, 0, len(slashedVal)) slashingReason := "" for _, val := range slashedVal { @@ -233,10 +232,10 @@ func (p *Pool) InsertProposerSlashing( // MarkIncludedAttesterSlashing is used when an attester slashing has been included in a beacon block. // Every block seen by this node that contains proposer slashings should call this method to include // the proposer slashings. -func (p *Pool) MarkIncludedAttesterSlashing(as interfaces.AttesterSlashing) { +func (p *Pool) MarkIncludedAttesterSlashing(as ethpb.AttSlashing) { p.lock.Lock() defer p.lock.Unlock() - slashedVal := slice.IntersectionUint64(as.GetFirstAttestation().GetAttestingIndices(), as.GetSecondAttestation().GetAttestingIndices()) + slashedVal := slice.IntersectionUint64(as.FirstAttestation().GetAttestingIndices(), as.SecondAttestation().GetAttestingIndices()) for _, val := range slashedVal { i := sort.Search(len(p.pendingAttesterSlashing), func(i int) bool { return uint64(p.pendingAttesterSlashing[i].validatorToSlash) >= val diff --git a/beacon-chain/operations/slashings/service_attester_test.go b/beacon-chain/operations/slashings/service_attester_test.go index a032d52d2732..50f4ab63d69a 100644 --- a/beacon-chain/operations/slashings/service_attester_test.go +++ b/beacon-chain/operations/slashings/service_attester_test.go @@ -6,7 +6,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -456,7 +455,7 @@ func TestPool_PendingAttesterSlashings(t *testing.T) { params.SetupTestConfigCleanup(t) beaconState, privKeys := util.DeterministicGenesisState(t, 64) pendingSlashings := make([]*PendingAttesterSlashing, 20) - slashings := make([]interfaces.AttesterSlashing, 20) + slashings := make([]ethpb.AttSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) @@ -469,14 +468,14 @@ func TestPool_PendingAttesterSlashings(t *testing.T) { tests := []struct { name string fields fields - want []interfaces.AttesterSlashing + want []ethpb.AttSlashing }{ { name: "Empty list", fields: fields{ pending: []*PendingAttesterSlashing{}, }, - want: []interfaces.AttesterSlashing{}, + want: []ethpb.AttSlashing{}, }, { name: "All pending", @@ -531,7 +530,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) { require.NoError(t, beaconState.UpdateValidatorAtIndex(5, val)) pendingSlashings := make([]*PendingAttesterSlashing, 20) pendingSlashings2 := make([]*PendingAttesterSlashing, 20) - slashings := make([]interfaces.AttesterSlashing, 20) + slashings := make([]ethpb.AttSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) @@ -549,7 +548,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) { tests := []struct { name string fields fields - want []interfaces.AttesterSlashing + want []ethpb.AttSlashing }{ { name: "One item", @@ -589,7 +588,7 @@ func TestPool_PendingAttesterSlashings_NoDuplicates(t *testing.T) { params.OverrideBeaconConfig(conf) beaconState, privKeys := util.DeterministicGenesisState(t, 64) pendingSlashings := make([]*PendingAttesterSlashing, 3) - slashings := make([]interfaces.AttesterSlashing, 3) + slashings := make([]ethpb.AttSlashing, 3) for i := 0; i < 2; i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) diff --git a/beacon-chain/operations/slashings/types.go b/beacon-chain/operations/slashings/types.go index 6bc6785f97b7..36e4bc17c637 100644 --- a/beacon-chain/operations/slashings/types.go +++ b/beacon-chain/operations/slashings/types.go @@ -5,7 +5,6 @@ import ( "sync" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -15,7 +14,7 @@ type PoolInserter interface { InsertAttesterSlashing( ctx context.Context, state state.ReadOnlyBeaconState, - slashing interfaces.AttesterSlashing, + slashing ethpb.AttSlashing, ) error InsertProposerSlashing( ctx context.Context, @@ -28,9 +27,9 @@ type PoolInserter interface { // This pool is used by proposers to insert data into new blocks. type PoolManager interface { PoolInserter - PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []interfaces.AttesterSlashing + PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []ethpb.AttSlashing PendingProposerSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.ProposerSlashing - MarkIncludedAttesterSlashing(as interfaces.AttesterSlashing) + MarkIncludedAttesterSlashing(as ethpb.AttSlashing) MarkIncludedProposerSlashing(ps *ethpb.ProposerSlashing) } @@ -45,6 +44,6 @@ type Pool struct { // PendingAttesterSlashing represents an attester slashing in the operation pool. // Allows for easy binary searching of included validator indexes. type PendingAttesterSlashing struct { - attesterSlashing interfaces.AttesterSlashing + attesterSlashing ethpb.AttSlashing validatorToSlash primitives.ValidatorIndex } diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index 0ef51faed3e6..ddbbf7b5b105 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -57,7 +57,6 @@ go_library( "//cmd/beacon-chain/flags:go_default_library", "//config/features:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/wrapper:go_default_library", "//container/leaky-bucket:go_default_library", diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index 43a0270ee2d0..6d8d63257510 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -12,7 +12,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -57,7 +56,7 @@ func (s *Service) Broadcast(ctx context.Context, msg proto.Message) error { // BroadcastAttestation broadcasts an attestation to the p2p network, the message is assumed to be // broadcasted to the current fork. -func (s *Service) BroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation) error { +func (s *Service) BroadcastAttestation(ctx context.Context, subnet uint64, att ethpb.Att) error { if att == nil { return errors.New("attempted to broadcast nil attestation") } @@ -97,7 +96,7 @@ func (s *Service) BroadcastSyncCommitteeMessage(ctx context.Context, subnet uint return nil } -func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation, forkDigest [4]byte) { +func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint64, att ethpb.Att, forkDigest [4]byte) { _, span := trace.StartSpan(ctx, "p2p.internalBroadcastAttestation") defer span.End() ctx = trace.NewContext(context.Background(), span) // clear parent context / deadline. diff --git a/beacon-chain/p2p/interfaces.go b/beacon-chain/p2p/interfaces.go index 112eadcb2bfd..a41d1768ab55 100644 --- a/beacon-chain/p2p/interfaces.go +++ b/beacon-chain/p2p/interfaces.go @@ -12,7 +12,6 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "google.golang.org/protobuf/proto" @@ -34,7 +33,7 @@ type P2P interface { // Broadcaster broadcasts messages to peers over the p2p pubsub protocol. type Broadcaster interface { Broadcast(context.Context, proto.Message) error - BroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation) error + BroadcastAttestation(ctx context.Context, subnet uint64, att ethpb.Att) error BroadcastSyncCommitteeMessage(ctx context.Context, subnet uint64, sMsg *ethpb.SyncCommitteeMessage) error BroadcastBlob(ctx context.Context, subnet uint64, blob *ethpb.BlobSidecar) error } diff --git a/beacon-chain/p2p/testing/BUILD.bazel b/beacon-chain/p2p/testing/BUILD.bazel index c4dea6b2b45f..e6c2e8fe9030 100644 --- a/beacon-chain/p2p/testing/BUILD.bazel +++ b/beacon-chain/p2p/testing/BUILD.bazel @@ -20,7 +20,6 @@ go_library( "//beacon-chain/p2p/encoder:go_default_library", "//beacon-chain/p2p/peers:go_default_library", "//beacon-chain/p2p/peers/scorers:go_default_library", - "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/metadata:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", diff --git a/beacon-chain/p2p/testing/fuzz_p2p.go b/beacon-chain/p2p/testing/fuzz_p2p.go index ce70a1c62e0d..13ba2c1a23f8 100644 --- a/beacon-chain/p2p/testing/fuzz_p2p.go +++ b/beacon-chain/p2p/testing/fuzz_p2p.go @@ -12,7 +12,6 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "google.golang.org/protobuf/proto" @@ -135,7 +134,7 @@ func (_ *FakeP2P) Broadcast(_ context.Context, _ proto.Message) error { } // BroadcastAttestation -- fake. -func (_ *FakeP2P) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { +func (_ *FakeP2P) BroadcastAttestation(_ context.Context, _ uint64, _ ethpb.Att) error { return nil } diff --git a/beacon-chain/p2p/testing/mock_broadcaster.go b/beacon-chain/p2p/testing/mock_broadcaster.go index 336fda939b62..6a740b3b8545 100644 --- a/beacon-chain/p2p/testing/mock_broadcaster.go +++ b/beacon-chain/p2p/testing/mock_broadcaster.go @@ -5,7 +5,6 @@ import ( "sync" "sync/atomic" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -14,7 +13,7 @@ import ( type MockBroadcaster struct { BroadcastCalled atomic.Bool BroadcastMessages []proto.Message - BroadcastAttestations []interfaces.Attestation + BroadcastAttestations []ethpb.Att msgLock sync.Mutex attLock sync.Mutex } @@ -29,7 +28,7 @@ func (m *MockBroadcaster) Broadcast(_ context.Context, msg proto.Message) error } // BroadcastAttestation records a broadcast occurred. -func (m *MockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, a interfaces.Attestation) error { +func (m *MockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, a ethpb.Att) error { m.BroadcastCalled.Store(true) m.attLock.Lock() defer m.attLock.Unlock() diff --git a/beacon-chain/p2p/testing/p2p.go b/beacon-chain/p2p/testing/p2p.go index 5c471ac3dd01..19a6c2c9aac3 100644 --- a/beacon-chain/p2p/testing/p2p.go +++ b/beacon-chain/p2p/testing/p2p.go @@ -25,7 +25,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/scorers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/sirupsen/logrus" @@ -167,7 +166,7 @@ func (p *TestP2P) Broadcast(_ context.Context, _ proto.Message) error { } // BroadcastAttestation broadcasts an attestation. -func (p *TestP2P) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { +func (p *TestP2P) BroadcastAttestation(_ context.Context, _ uint64, _ ethpb.Att) error { p.BroadcastCalled.Store(true) return nil } diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool_test.go b/beacon-chain/rpc/eth/beacon/handlers_pool_test.go index 5386320c2554..d2ccfbfde25c 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool_test.go @@ -29,7 +29,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/crypto/bls/common" @@ -116,8 +115,8 @@ func TestListAttestations(t *testing.T) { s := &Server{ AttestationsPool: attestations.NewPool(), } - require.NoError(t, s.AttestationsPool.SaveAggregatedAttestations([]interfaces.Attestation{att1, att2})) - require.NoError(t, s.AttestationsPool.SaveUnaggregatedAttestations([]interfaces.Attestation{att3, att4})) + require.NoError(t, s.AttestationsPool.SaveAggregatedAttestations([]ethpbv1alpha1.Att{att1, att2})) + require.NoError(t, s.AttestationsPool.SaveUnaggregatedAttestations([]ethpbv1alpha1.Att{att3, att4})) t.Run("empty request", func(t *testing.T) { url := "http://example.com" @@ -1061,7 +1060,7 @@ func TestGetAttesterSlashings(t *testing.T) { s := &Server{ ChainInfoFetcher: &blockchainmock.ChainService{State: bs}, - SlashingsPool: &slashingsmock.PoolMock{PendingAttSlashings: []interfaces.AttesterSlashing{slashing1, slashing2}}, + SlashingsPool: &slashingsmock.PoolMock{PendingAttSlashings: []ethpbv1alpha1.AttSlashing{slashing1, slashing2}}, } request := httptest.NewRequest(http.MethodGet, "http://example.com/beacon/pool/attester_slashings", nil) diff --git a/beacon-chain/rpc/eth/rewards/handlers_test.go b/beacon-chain/rpc/eth/rewards/handlers_test.go index 1acfa44b503b..d95020348502 100644 --- a/beacon-chain/rpc/eth/rewards/handlers_test.go +++ b/beacon-chain/rpc/eth/rewards/handlers_test.go @@ -104,7 +104,7 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int sbb.SetSlot(2) // we have to set the proposer index to the value that will be randomly chosen (fortunately it's deterministic) sbb.SetProposerIndex(12) - require.NoError(t, sbb.SetAttestations([]interfaces.Attestation{ + require.NoError(t, sbb.SetAttestations([]eth.Att{ ð.Attestation{ AggregationBits: bitfield.Bitlist{0b00000111}, Data: util.HydrateAttestationData(ð.AttestationData{}), @@ -125,7 +125,7 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int require.NoError(t, err) sigRoot2, err := signing.ComputeSigningRoot(attData2, domain) require.NoError(t, err) - require.NoError(t, sbb.SetAttesterSlashings([]interfaces.AttesterSlashing{ + require.NoError(t, sbb.SetAttesterSlashings([]eth.AttSlashing{ ð.AttesterSlashing{ Attestation_1: ð.IndexedAttestation{ AttestingIndices: []uint64{0}, diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 4533938fe277..5ab2597a0c09 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -33,7 +33,6 @@ go_library( "//config/params:go_default_library", "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", @@ -80,7 +79,6 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 6bd914c365fc..8359ac5656cf 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -25,7 +25,6 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -53,7 +52,7 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) return } - var match interfaces.Attestation + var match ethpbalpha.Att var err error match, err = matchingAtt(s.AttestationsPool.AggregatedAttestations(), primitives.Slot(slot), attDataRoot) @@ -99,7 +98,7 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) httputil.WriteJson(w, response) } -func matchingAtt(atts []interfaces.Attestation, slot primitives.Slot, attDataRoot []byte) (interfaces.Attestation, error) { +func matchingAtt(atts []ethpbalpha.Att, slot primitives.Slot, attDataRoot []byte) (ethpbalpha.Att, error) { for _, att := range atts { if att.GetData().Slot == slot { root, err := att.GetData().HashTreeRoot() diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 6ef0a4ce3db1..166d2f404212 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -33,7 +33,6 @@ import ( mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -144,9 +143,9 @@ func TestGetAggregateAttestation(t *testing.T) { } pool := attestations.NewPool() - err := pool.SaveAggregatedAttestations([]interfaces.Attestation{attSlot1, attslot21, attslot22}) + err := pool.SaveAggregatedAttestations([]ethpbalpha.Att{attSlot1, attslot21, attslot22}) assert.NoError(t, err) - err = pool.SaveUnaggregatedAttestations([]interfaces.Attestation{attslot31, attslot32}) + err = pool.SaveUnaggregatedAttestations([]ethpbalpha.Att{attslot31, attslot32}) assert.NoError(t, err) s := &Server{ @@ -315,7 +314,7 @@ func TestGetAggregateAttestation_SameSlotAndRoot_ReturnMostAggregationBits(t *te Signature: sig, } pool := attestations.NewPool() - err := pool.SaveAggregatedAttestations([]interfaces.Attestation{att1, att2}) + err := pool.SaveAggregatedAttestations([]ethpbalpha.Att{att1, att2}) assert.NoError(t, err) s := &Server{ AttestationsPool: pool, diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go index fc8dc7b2c494..556cb57cd201 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go @@ -21,7 +21,7 @@ import ( // sortableAttestations implements the Sort interface to sort attestations // by slot as the canonical sorting attribute. -type sortableAttestations []interfaces.Attestation +type sortableAttestations []ethpb.Att // Len is the number of elements in the collection. func (s sortableAttestations) Len() int { return len(s) } @@ -34,8 +34,8 @@ func (s sortableAttestations) Less(i, j int) bool { return s[i].GetData().Slot < s[j].GetData().Slot } -func mapAttestationsByTargetRoot(atts []interfaces.Attestation) map[[32]byte][]interfaces.Attestation { - attsMap := make(map[[32]byte][]interfaces.Attestation, len(atts)) +func mapAttestationsByTargetRoot(atts []ethpb.Att) map[[32]byte][]ethpb.Att { + attsMap := make(map[[32]byte][]ethpb.Att, len(atts)) if len(atts) == 0 { return attsMap } @@ -74,7 +74,7 @@ func (bs *Server) ListAttestations( default: return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - atts := make([]interfaces.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + atts := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) for _, blk := range blocks { atts = append(atts, blk.Block().Body().Attestations()...) } @@ -136,7 +136,7 @@ func (bs *Server) ListIndexedAttestations( return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - attsArray := make([]interfaces.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + attsArray := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) for _, b := range blocks { attsArray = append(attsArray, b.Block().Body().Attestations()...) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go index bcc63c7c4705..ae0a8685a167 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go @@ -263,7 +263,7 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { ctx := context.Background() count := params.BeaconConfig().SlotsPerEpoch * 4 - atts := make([]interfaces.Attestation, 0, count) + atts := make([]ethpb.Att, 0, count) for i := primitives.Slot(0); i < params.BeaconConfig().SlotsPerEpoch; i++ { for s := primitives.CommitteeIndex(0); s < 4; s++ { blockExample := util.NewBeaconBlock() @@ -278,7 +278,7 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }), } util.SaveBlock(t, ctx, db, blockExample) - as := make([]interfaces.Attestation, len(blockExample.Block.Body.Attestations)) + as := make([]ethpb.Att, len(blockExample.Block.Body.Attestations)) for i, a := range blockExample.Block.Body.Attestations { as[i] = a } @@ -464,7 +464,7 @@ func TestServer_ListAttestations_Pagination_DefaultPageSize(t *testing.T) { func TestServer_mapAttestationToTargetRoot(t *testing.T) { count := primitives.Slot(100) - atts := make([]interfaces.Attestation, count) + atts := make([]ethpb.Att, count) targetRoot1 := bytesutil.ToBytes32([]byte("root1")) targetRoot2 := bytesutil.ToBytes32([]byte("root2")) @@ -707,7 +707,7 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AttestationsPool: attestations.NewPool(), } - atts := []interfaces.Attestation{ + atts := []ethpb.Att{ ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 1, @@ -756,7 +756,7 @@ func TestServer_AttestationPool_Pagination_DefaultPageSize(t *testing.T) { AttestationsPool: attestations.NewPool(), } - atts := make([]interfaces.Attestation, params.BeaconConfig().DefaultPageSize+1) + atts := make([]ethpb.Att, params.BeaconConfig().DefaultPageSize+1) for i := 0; i < len(atts); i++ { att := util.NewAttestation() att.Data.Slot = primitives.Slot(i) @@ -778,7 +778,7 @@ func TestServer_AttestationPool_Pagination_CustomPageSize(t *testing.T) { } numAtts := 100 - atts := make([]interfaces.Attestation, numAtts) + atts := make([]ethpb.Att, numAtts) for i := 0; i < len(atts); i++ { att := util.NewAttestation() att.Data.Slot = primitives.Slot(i) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go index b1cc8100eda2..59f2ad7bd799 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go @@ -18,7 +18,6 @@ import ( mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -337,7 +336,7 @@ func TestSubmitAggregateAndProof_PreferOwnAttestation(t *testing.T) { pubKey := v.PublicKey req := ðpb.AggregateSelectionRequest{CommitteeIndex: 1, SlotSignature: sig.Marshal(), PublicKey: pubKey} - err = aggregatorServer.AttPool.SaveAggregatedAttestations([]interfaces.Attestation{ + err = aggregatorServer.AttPool.SaveAggregatedAttestations([]ethpb.Att{ att0, att1, att2, @@ -388,7 +387,7 @@ func TestSubmitAggregateAndProof_SelectsMostBitsWhenOwnAttestationNotPresent(t * pubKey := v.PublicKey req := ðpb.AggregateSelectionRequest{CommitteeIndex: 1, SlotSignature: sig.Marshal(), PublicKey: pubKey} - err = aggregatorServer.AttPool.SaveAggregatedAttestations([]interfaces.Attestation{ + err = aggregatorServer.AttPool.SaveAggregatedAttestations([]ethpb.Att{ att0, att1, }) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 03509789c150..1a523edb9ade 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -203,7 +203,7 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed deposits, atts, err := vs.packDepositsAndAttestations(ctx, head, eth1Data) // TODO: split attestations and deposits if err != nil { sBlk.SetDeposits([]*ethpb.Deposit{}) - if err := sBlk.SetAttestations([]interfaces.Attestation{}); err != nil { + if err := sBlk.SetAttestations([]ethpb.Att{}); err != nil { log.WithError(err).Error("Could not set attestations on block") } log.WithError(err).Error("Could not pack deposits and attestations") diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index 392113bc39c2..6e3cebb4b792 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -10,16 +10,16 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "go.opencensus.io/trace" ) -type proposerAtts []interfaces.Attestation +type proposerAtts []ethpb.Att -func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]interfaces.Attestation, error) { +func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]ethpb.Att, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.packAttestations") defer span.End() @@ -46,7 +46,7 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon return nil, err } - attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(atts)) + attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(atts)) for _, att := range atts { attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { @@ -55,7 +55,7 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) } - attsForInclusion := proposerAtts(make([]interfaces.Attestation, 0)) + attsForInclusion := proposerAtts(make([]ethpb.Att, 0)) for _, as := range attsByDataRoot { as, err := attaggregation.Aggregate(as) if err != nil { @@ -79,8 +79,8 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon // The first group passes the all the required checks for attestation to be considered for proposing. // And attestations from the second group should be deleted. func (a proposerAtts) filter(ctx context.Context, st state.BeaconState) (proposerAtts, proposerAtts) { - validAtts := make([]interfaces.Attestation, 0, len(a)) - invalidAtts := make([]interfaces.Attestation, 0, len(a)) + validAtts := make([]ethpb.Att, 0, len(a)) + invalidAtts := make([]ethpb.Att, 0, len(a)) for _, att := range a { if err := blocks.VerifyAttestationNoVerifySignature(ctx, st, att); err == nil { @@ -182,7 +182,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { if len(a) < 2 { return a, nil } - attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(a)) + attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(a)) for _, att := range a { attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { @@ -191,7 +191,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) } - uniqAtts := make([]interfaces.Attestation, 0, len(a)) + uniqAtts := make([]ethpb.Att, 0, len(a)) for _, atts := range attsByDataRoot { for i := 0; i < len(atts); i++ { a := atts[i] @@ -224,7 +224,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { } // This filters the input attestations to return a list of valid attestations to be packaged inside a beacon block. -func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.BeaconState, atts []interfaces.Attestation) ([]interfaces.Attestation, error) { +func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.BeaconState, atts []ethpb.Att) ([]ethpb.Att, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.validateAndDeleteAttsInPool") defer span.End() @@ -237,7 +237,7 @@ func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.Beac // The input attestations are processed and seen by the node, this deletes them from pool // so proposers don't include them in a block for the future. -func (vs *Server) deleteAttsInPool(ctx context.Context, atts []interfaces.Attestation) error { +func (vs *Server) deleteAttsInPool(ctx context.Context, atts []ethpb.Att) error { ctx, span := trace.StartSpan(ctx, "ProposerServer.deleteAttsInPool") defer span.End() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index e1c9480a6d9f..f3705c671b10 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -15,7 +14,7 @@ import ( ) func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { - atts := proposerAtts([]interfaces.Attestation{ + atts := proposerAtts([]ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11000000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11100000}}), @@ -23,7 +22,7 @@ func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), }) - want := proposerAtts([]interfaces.Attestation{ + want := proposerAtts([]ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11110000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go index be110d9e30fc..d2a6ecfb4bda 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/container/trie" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" @@ -19,10 +18,10 @@ import ( "google.golang.org/grpc/status" ) -func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []interfaces.Attestation, error) { +func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []ethpb.Att, error) { eg, egctx := errgroup.WithContext(ctx) var deposits []*ethpb.Deposit - var atts []interfaces.Attestation + var atts []ethpb.Att eg.Go(func() error { // Pack ETH1 deposits which have not been included in the beacon chain. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go index 2658140ac787..f8f8494a6a75 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go @@ -6,11 +6,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]*ethpb.ProposerSlashing, []interfaces.AttesterSlashing) { +func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]*ethpb.ProposerSlashing, []ethpb.AttSlashing) { proposerSlashings := vs.SlashingsPool.PendingProposerSlashings(ctx, head, false /*noLimit*/) validProposerSlashings := make([]*ethpb.ProposerSlashing, 0, len(proposerSlashings)) for _, slashing := range proposerSlashings { @@ -22,7 +21,7 @@ func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]* validProposerSlashings = append(validProposerSlashings, slashing) } attSlashings := vs.SlashingsPool.PendingAttesterSlashings(ctx, head, false /*noLimit*/) - validAttSlashings := make([]interfaces.AttesterSlashing, 0, len(attSlashings)) + validAttSlashings := make([]ethpb.AttSlashing, 0, len(attSlashings)) for _, slashing := range attSlashings { _, err := blocks.ProcessAttesterSlashing(ctx, head, slashing, v.SlashValidator) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go index 3411a8b730cd..5bc23f1e9fc2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go @@ -6,7 +6,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -29,7 +28,7 @@ func TestServer_getSlashings(t *testing.T) { require.NoError(t, err) } - attSlashings := make([]interfaces.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings) + attSlashings := make([]ethpb.AttSlashing, params.BeaconConfig().MaxAttesterSlashings) for i := uint64(0); i < params.BeaconConfig().MaxAttesterSlashings; i++ { attesterSlashing, err := util.GenerateAttesterSlashingForValidator( beaconState, diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index e6c665c999b6..6ed6bd95ccf6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -38,7 +38,6 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/bls" @@ -2550,22 +2549,22 @@ func TestProposer_FilterAttestation(t *testing.T) { tests := []struct { name string wantedErr string - inputAtts func() []interfaces.Attestation - expectedAtts func(inputAtts []interfaces.Attestation) []interfaces.Attestation + inputAtts func() []ethpb.Att + expectedAtts func(inputAtts []ethpb.Att) []ethpb.Att }{ { name: "nil attestations", - inputAtts: func() []interfaces.Attestation { + inputAtts: func() []ethpb.Att { return nil }, - expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { - return []interfaces.Attestation{} + expectedAtts: func(inputAtts []ethpb.Att) []ethpb.Att { + return []ethpb.Att{} }, }, { name: "invalid attestations", - inputAtts: func() []interfaces.Attestation { - atts := make([]interfaces.Attestation, 10) + inputAtts: func() []ethpb.Att { + atts := make([]ethpb.Att, 10) for i := 0; i < len(atts); i++ { atts[i] = util.HydrateAttestation(ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -2575,14 +2574,14 @@ func TestProposer_FilterAttestation(t *testing.T) { } return atts }, - expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { - return []interfaces.Attestation{} + expectedAtts: func(inputAtts []ethpb.Att) []ethpb.Att { + return []ethpb.Att{} }, }, { name: "filter aggregates ok", - inputAtts: func() []interfaces.Attestation { - atts := make([]interfaces.Attestation, 10) + inputAtts: func() []ethpb.Att { + atts := make([]ethpb.Att, 10) for i := 0; i < len(atts); i++ { atts[i] = util.HydrateAttestation(ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -2612,8 +2611,8 @@ func TestProposer_FilterAttestation(t *testing.T) { } return atts }, - expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { - return []interfaces.Attestation{inputAtts[0], inputAtts[1]} + expectedAtts: func(inputAtts []ethpb.Att) []ethpb.Att { + return []ethpb.Att{inputAtts[0], inputAtts[1]} }, }, } @@ -2743,10 +2742,10 @@ func TestProposer_DeleteAttsInPool_Aggregated(t *testing.T) { priv, err := bls.RandKey() require.NoError(t, err) sig := priv.Sign([]byte("foo")).Marshal() - aggregatedAtts := []interfaces.Attestation{ + aggregatedAtts := []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10101}, Signature: sig}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11010}, Signature: sig})} - unaggregatedAtts := []interfaces.Attestation{ + unaggregatedAtts := []ethpb.Att{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10010}, Signature: sig}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10100}, Signature: sig})} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go index 5fa5071de233..c88b97a645e5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go @@ -6,7 +6,6 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" aggtesting "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/testing" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -45,7 +44,7 @@ func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { }, } - runner := func(atts []interfaces.Attestation) { + runner := func(atts []ethpb.Att) { attsCopy := make(proposerAtts, len(atts)) for i, att := range atts { attsCopy[i] = ethpb.CopyAttestation(att.(*ethpb.Attestation)) diff --git a/beacon-chain/slasher/BUILD.bazel b/beacon-chain/slasher/BUILD.bazel index 60965a8cee7c..00bf4aaaeacc 100644 --- a/beacon-chain/slasher/BUILD.bazel +++ b/beacon-chain/slasher/BUILD.bazel @@ -36,7 +36,6 @@ go_library( "//beacon-chain/sync:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//encoding/bytesutil:go_default_library", @@ -79,7 +78,6 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/bls/common:go_default_library", diff --git a/beacon-chain/slasher/chunks.go b/beacon-chain/slasher/chunks.go index dbb08035231f..01b5943c66b5 100644 --- a/beacon-chain/slasher/chunks.go +++ b/beacon-chain/slasher/chunks.go @@ -9,7 +9,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" @@ -27,7 +26,7 @@ type Chunker interface { slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, attestation *slashertypes.IndexedAttestationWrapper, - ) (interfaces.AttesterSlashing, error) + ) (ethpb.AttSlashing, error) Update( chunkIndex uint64, currentEpoch primitives.Epoch, @@ -186,7 +185,7 @@ func (m *MinSpanChunksSlice) CheckSlashable( slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, incomingAttWrapper *slashertypes.IndexedAttestationWrapper, -) (interfaces.AttesterSlashing, error) { +) (ethpb.AttSlashing, error) { sourceEpoch := incomingAttWrapper.IndexedAttestation.GetData().Source.Epoch targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch @@ -282,7 +281,7 @@ func (m *MaxSpanChunksSlice) CheckSlashable( slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, incomingAttWrapper *slashertypes.IndexedAttestationWrapper, -) (interfaces.AttesterSlashing, error) { +) (ethpb.AttSlashing, error) { sourceEpoch := incomingAttWrapper.IndexedAttestation.GetData().Source.Epoch targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch diff --git a/beacon-chain/slasher/detect_attestations.go b/beacon-chain/slasher/detect_attestations.go index e3ed6abf3915..0817e12ce6ae 100644 --- a/beacon-chain/slasher/detect_attestations.go +++ b/beacon-chain/slasher/detect_attestations.go @@ -8,7 +8,6 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" @@ -19,8 +18,8 @@ import ( // found attester slashings to the caller. func (s *Service) checkSlashableAttestations( ctx context.Context, currentEpoch primitives.Epoch, atts []*slashertypes.IndexedAttestationWrapper, -) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} +) (map[[fieldparams.RootLength]byte]ethpb.AttSlashing, error) { + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{} // Double votes doubleVoteSlashings, err := s.checkDoubleVotes(ctx, atts) @@ -57,13 +56,13 @@ func (s *Service) checkSurroundVotes( ctx context.Context, attWrappers []*slashertypes.IndexedAttestationWrapper, currentEpoch primitives.Epoch, -) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]ethpb.AttSlashing, error) { // With 256 validators and 16 epochs per chunk, there is 4096 `uint16` elements per chunk. // 4096 `uint16` elements = 8192 bytes = 8KB // 25_600 chunks * 8KB = 200MB const maxChunkBeforeFlush = 25_600 - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{} // Group attestation wrappers by validator chunk index. attWrappersByValidatorChunkIndex := s.groupByValidatorChunkIndex(attWrappers) @@ -154,7 +153,7 @@ func (s *Service) checkSurroundVotes( // Check for double votes in our database given a list of incoming attestations. func (s *Service) checkDoubleVotes( ctx context.Context, incomingAttWrappers []*slashertypes.IndexedAttestationWrapper, -) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]ethpb.AttSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.checkDoubleVotesOnDisk") defer span.End() @@ -163,7 +162,7 @@ func (s *Service) checkDoubleVotes( epoch primitives.Epoch } - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{} // Check each incoming attestation for double votes against other incoming attestations. existingAttWrappers := make(map[attestationInfo]*slashertypes.IndexedAttestationWrapper) @@ -462,13 +461,13 @@ func (s *Service) updateSpans( kind slashertypes.ChunkKind, validatorChunkIndex uint64, currentEpoch primitives.Epoch, -) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]ethpb.AttSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.updateSpans") defer span.End() // Apply the attestations to the related chunks and find any // slashings along the way. - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{} for _, attWrappers := range attWrapperByChunkIdx { for _, attWrapper := range attWrappers { @@ -527,7 +526,7 @@ func (s *Service) applyAttestationForValidator( validatorChunkIndex uint64, validatorIndex primitives.ValidatorIndex, currentEpoch primitives.Epoch, -) (interfaces.AttesterSlashing, error) { +) (ethpb.AttSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.applyAttestationForValidator") defer span.End() diff --git a/beacon-chain/slasher/helpers.go b/beacon-chain/slasher/helpers.go index 411282a6e42c..6c6be1990c09 100644 --- a/beacon-chain/slasher/helpers.go +++ b/beacon-chain/slasher/helpers.go @@ -10,7 +10,6 @@ import ( slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -130,14 +129,14 @@ func validateBlockHeaderIntegrity(header *ethpb.SignedBeaconBlockHeader) bool { return true } -func logAttesterSlashing(slashing interfaces.AttesterSlashing) { - indices := slice.IntersectionUint64(slashing.GetFirstAttestation().GetAttestingIndices(), slashing.GetSecondAttestation().GetAttestingIndices()) +func logAttesterSlashing(slashing ethpb.AttSlashing) { + indices := slice.IntersectionUint64(slashing.FirstAttestation().GetAttestingIndices(), slashing.SecondAttestation().GetAttestingIndices()) log.WithFields(logrus.Fields{ "validatorIndex": indices, - "prevSourceEpoch": slashing.GetFirstAttestation().GetData().Source.Epoch, - "prevTargetEpoch": slashing.GetFirstAttestation().GetData().Target.Epoch, - "sourceEpoch": slashing.GetSecondAttestation().GetData().Source.Epoch, - "targetEpoch": slashing.GetSecondAttestation().GetData().Target.Epoch, + "prevSourceEpoch": slashing.FirstAttestation().GetData().Source.Epoch, + "prevTargetEpoch": slashing.FirstAttestation().GetData().Target.Epoch, + "sourceEpoch": slashing.SecondAttestation().GetData().Source.Epoch, + "targetEpoch": slashing.SecondAttestation().GetData().Target.Epoch, }).Info("Attester slashing detected") } diff --git a/beacon-chain/slasher/process_slashings.go b/beacon-chain/slasher/process_slashings.go index c98f5c0d1b11..770324847d53 100644 --- a/beacon-chain/slasher/process_slashings.go +++ b/beacon-chain/slasher/process_slashings.go @@ -6,7 +6,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -14,9 +13,9 @@ import ( // Verifies attester slashings, logs them, and submits them to the slashing operations pool // in the beacon node if they pass validation. func (s *Service) processAttesterSlashings( - ctx context.Context, slashings map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, -) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { - processedSlashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} + ctx context.Context, slashings map[[fieldparams.RootLength]byte]ethpb.AttSlashing, +) (map[[fieldparams.RootLength]byte]ethpb.AttSlashing, error) { + processedSlashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{} // If no slashings, return early. if len(slashings) == 0 { @@ -31,8 +30,8 @@ func (s *Service) processAttesterSlashings( for root, slashing := range slashings { // Verify the signature of the first attestation. - if err := s.verifyAttSignature(ctx, slashing.GetFirstAttestation()); err != nil { - log.WithError(err).WithField("a", slashing.GetFirstAttestation()).Warn( + if err := s.verifyAttSignature(ctx, slashing.FirstAttestation()); err != nil { + log.WithError(err).WithField("a", slashing.FirstAttestation()).Warn( "Invalid signature for attestation in detected slashing offense", ) @@ -40,8 +39,8 @@ func (s *Service) processAttesterSlashings( } // Verify the signature of the second attestation. - if err := s.verifyAttSignature(ctx, slashing.GetSecondAttestation()); err != nil { - log.WithError(err).WithField("b", slashing.GetSecondAttestation()).Warn( + if err := s.verifyAttSignature(ctx, slashing.SecondAttestation()); err != nil { + log.WithError(err).WithField("b", slashing.SecondAttestation()).Warn( "Invalid signature for attestation in detected slashing offense", ) diff --git a/beacon-chain/slasher/process_slashings_test.go b/beacon-chain/slasher/process_slashings_test.go index 90764497295c..293b1dd4a0ab 100644 --- a/beacon-chain/slasher/process_slashings_test.go +++ b/beacon-chain/slasher/process_slashings_test.go @@ -12,7 +12,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -85,7 +84,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{ root: slashing, } @@ -109,7 +108,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{ root: slashing, } @@ -133,7 +132,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]ethpb.AttSlashing{ root: slashing, } diff --git a/beacon-chain/slasher/receive.go b/beacon-chain/slasher/receive.go index 66b82de0fbcc..81c9cdf818cb 100644 --- a/beacon-chain/slasher/receive.go +++ b/beacon-chain/slasher/receive.go @@ -7,7 +7,6 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -109,7 +108,7 @@ func (s *Service) processAttestations( ctx context.Context, attestations []*slashertypes.IndexedAttestationWrapper, currentSlot primitives.Slot, -) map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing { +) map[[fieldparams.RootLength]byte]ethpb.AttSlashing { // Get the current epoch from the current slot. currentEpoch := slots.ToEpoch(currentSlot) diff --git a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go index eecc49fb9951..cad7c41b1c73 100644 --- a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go +++ b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -35,7 +34,7 @@ func TestBeaconAggregateProofSubscriber_CanSaveAggregatedAttestation(t *testing. Signature: make([]byte, fieldparams.BLSSignatureLength), } require.NoError(t, r.beaconAggregateProofSubscriber(context.Background(), a)) - assert.DeepSSZEqual(t, []interfaces.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation") + assert.DeepSSZEqual(t, []ethpb.Att{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation") } func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testing.T) { @@ -60,5 +59,5 @@ func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testin atts, err := r.cfg.attPool.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []interfaces.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation") + assert.DeepEqual(t, []ethpb.Att{a.Message.Aggregate}, atts, "Did not save unaggregated attestation") } diff --git a/beacon-chain/sync/subscriber_handlers.go b/beacon-chain/sync/subscriber_handlers.go index dd49d259abbc..0d756248756c 100644 --- a/beacon-chain/sync/subscriber_handlers.go +++ b/beacon-chain/sync/subscriber_handlers.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -26,13 +25,13 @@ func (s *Service) voluntaryExitSubscriber(_ context.Context, msg proto.Message) } func (s *Service) attesterSlashingSubscriber(ctx context.Context, msg proto.Message) error { - aSlashing, ok := msg.(interfaces.AttesterSlashing) + aSlashing, ok := msg.(ethpb.AttSlashing) if !ok { return fmt.Errorf("wrong type, expected: *ethpb.AttesterSlashing got: %T", msg) } // Do some nil checks to prevent easy DoS'ing of this handler. - aSlashing1IsNil := aSlashing == nil || aSlashing.GetFirstAttestation() == nil || aSlashing.GetFirstAttestation().GetAttestingIndices() == nil - aSlashing2IsNil := aSlashing == nil || aSlashing.GetSecondAttestation() == nil || aSlashing.GetSecondAttestation().GetAttestingIndices() == nil + aSlashing1IsNil := aSlashing == nil || aSlashing.FirstAttestation() == nil || aSlashing.FirstAttestation().GetAttestingIndices() == nil + aSlashing2IsNil := aSlashing == nil || aSlashing.SecondAttestation() == nil || aSlashing.SecondAttestation().GetAttestingIndices() == nil if !aSlashing1IsNil && !aSlashing2IsNil { headState, err := s.cfg.chain.HeadState(ctx) if err != nil { @@ -41,7 +40,7 @@ func (s *Service) attesterSlashingSubscriber(ctx context.Context, msg proto.Mess if err := s.cfg.slashingPool.InsertAttesterSlashing(ctx, headState, aSlashing); err != nil { return errors.Wrap(err, "could not insert attester slashing into pool") } - s.setAttesterSlashingIndicesSeen(aSlashing.GetFirstAttestation().GetAttestingIndices(), aSlashing.GetSecondAttestation().GetAttestingIndices()) + s.setAttesterSlashingIndicesSeen(aSlashing.FirstAttestation().GetAttestingIndices(), aSlashing.SecondAttestation().GetAttestingIndices()) } return nil } diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index 38f591952f15..893c3670b5cf 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -15,7 +15,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -177,7 +176,7 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.Signe tracing.AnnotateError(span, wrappedErr) return pubsub.ValidationIgnore, wrappedErr } - attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []interfaces.Attestation{signed.Message.Aggregate}) + attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []ethpb.Att{signed.Message.Aggregate}) if err != nil { wrappedErr := errors.Wrapf(err, "Could not verify aggregator signature %d", signed.Message.AggregatorIndex) tracing.AnnotateError(span, wrappedErr) @@ -226,7 +225,7 @@ func (s *Service) setAggregatorIndexEpochSeen(epoch primitives.Epoch, aggregator // - [REJECT] The aggregate attestation has participants -- that is, len(get_attesting_indices(state, aggregate.data, aggregate.aggregation_bits)) >= 1. // - [REJECT] The aggregator's validator index is within the committee -- // i.e. `aggregate_and_proof.aggregator_index in get_beacon_committee(state, aggregate.data.slot, aggregate.data.index)`. -func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a interfaces.Attestation, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { +func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a ethpb.Att, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateIndexInCommittee") defer span.End() diff --git a/beacon-chain/sync/validate_attester_slashing.go b/beacon-chain/sync/validate_attester_slashing.go index a30499d19c3b..d854a94c0e96 100644 --- a/beacon-chain/sync/validate_attester_slashing.go +++ b/beacon-chain/sync/validate_attester_slashing.go @@ -10,10 +10,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -40,7 +40,7 @@ func (s *Service) validateAttesterSlashing(ctx context.Context, pid peer.ID, msg tracing.AnnotateError(span, err) return pubsub.ValidationReject, err } - slashing, ok := m.(interfaces.AttesterSlashing) + slashing, ok := m.(ethpb.AttSlashing) if !ok { return pubsub.ValidationReject, errWrongMessage } diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index 83a5d37170ad..c37abab2191a 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -17,7 +17,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" @@ -172,7 +171,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p } // This validates beacon unaggregated attestation has correct topic string. -func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState, t string) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState, t string) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttTopic") defer span.End() @@ -194,7 +193,7 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a interfaces return pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndex(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { +func (s *Service) validateCommitteeIndex(ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.GetData().Slot)) if err != nil { return 0, pubsub.ValidationIgnore, err @@ -208,7 +207,7 @@ func (s *Service) validateCommitteeIndex(ctx context.Context, a interfaces.Attes // This validates beacon unaggregated attestation using the given state, the validation consists of bitfield length and count consistency // and signature verification. -func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttWithState") defer span.End() @@ -224,7 +223,7 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a interf return pubsub.ValidationReject, errors.New("attestation bitfield is invalid") } - set, err := blocks.AttestationSignatureBatch(ctx, bs, []interfaces.Attestation{a}) + set, err := blocks.AttestationSignatureBatch(ctx, bs, []eth.Att{a}) if err != nil { tracing.AnnotateError(span, err) attBadSignatureBatchCount.Inc() @@ -233,7 +232,7 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a interf return s.validateWithBatchVerifier(ctx, "attestation", set) } -func (s *Service) validateBitLength(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { +func (s *Service) validateBitLength(ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { committee, err := helpers.BeaconCommitteeFromState(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, pubsub.ValidationIgnore, err diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 1c42187bd727..aae831b685f4 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -1077,13 +1077,13 @@ func (b *BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing { } // AttesterSlashings returns the attester slashings in the block. -func (b *BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { - var slashings []interfaces.AttesterSlashing +func (b *BeaconBlockBody) AttesterSlashings() []eth.AttSlashing { + var slashings []eth.AttSlashing if b.version < version.Electra { if b.attesterSlashings == nil { return nil } - slashings = make([]interfaces.AttesterSlashing, len(b.attesterSlashings)) + slashings = make([]eth.AttSlashing, len(b.attesterSlashings)) for i, s := range b.attesterSlashings { slashings[i] = s } @@ -1091,7 +1091,7 @@ func (b *BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { if b.attesterSlashingsElectra == nil { return nil } - slashings = make([]interfaces.AttesterSlashing, len(b.attesterSlashingsElectra)) + slashings = make([]eth.AttSlashing, len(b.attesterSlashingsElectra)) for i, s := range b.attesterSlashingsElectra { slashings[i] = s } @@ -1100,13 +1100,13 @@ func (b *BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { } // Attestations returns the stored attestations in the block. -func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { - var atts []interfaces.Attestation +func (b *BeaconBlockBody) Attestations() []eth.Att { + var atts []eth.Att if b.version < version.Electra { if b.attestations == nil { return nil } - atts = make([]interfaces.Attestation, len(b.attestations)) + atts = make([]eth.Att, len(b.attestations)) for i, a := range b.attestations { atts[i] = a } @@ -1114,7 +1114,7 @@ func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { if b.attestationsElectra == nil { return nil } - atts = make([]interfaces.Attestation, len(b.attestationsElectra)) + atts = make([]eth.Att, len(b.attestationsElectra)) for i, a := range b.attestationsElectra { atts[i] = a } diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index 6dac55709998..318bd65203d0 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -356,14 +356,14 @@ func Test_BeaconBlockBody_ProposerSlashings(t *testing.T) { } func Test_BeaconBlockBody_AttesterSlashings(t *testing.T) { - as := make([]interfaces.AttesterSlashing, 0) + as := make([]eth.AttSlashing, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} require.NoError(t, bb.SetAttesterSlashings(as)) assert.DeepSSZEqual(t, as, bb.Block().Body().AttesterSlashings()) } func Test_BeaconBlockBody_Attestations(t *testing.T) { - a := make([]interfaces.Attestation, 0) + a := make([]eth.Att, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} require.NoError(t, bb.SetAttestations(a)) assert.DeepSSZEqual(t, a, bb.Block().Body().Attestations()) diff --git a/consensus-types/blocks/setters.go b/consensus-types/blocks/setters.go index caa1638211f0..3650903404d0 100644 --- a/consensus-types/blocks/setters.go +++ b/consensus-types/blocks/setters.go @@ -66,7 +66,7 @@ func (b *SignedBeaconBlock) SetProposerSlashings(p []*eth.ProposerSlashing) { // SetAttesterSlashings sets the attester slashings in the block. // This function is not thread safe, it is only used during block creation. -func (b *SignedBeaconBlock) SetAttesterSlashings(slashings []interfaces.AttesterSlashing) error { +func (b *SignedBeaconBlock) SetAttesterSlashings(slashings []eth.AttSlashing) error { if b.version < version.Electra { blockSlashings := make([]*eth.AttesterSlashing, 0, len(slashings)) for _, slashing := range slashings { @@ -93,7 +93,7 @@ func (b *SignedBeaconBlock) SetAttesterSlashings(slashings []interfaces.Attester // SetAttestations sets the attestations in the block. // This function is not thread safe, it is only used during block creation. -func (b *SignedBeaconBlock) SetAttestations(atts []interfaces.Attestation) error { +func (b *SignedBeaconBlock) SetAttestations(atts []eth.Att) error { if b.version < version.Electra { blockAtts := make([]*eth.Attestation, 0, len(atts)) for _, att := range atts { diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index 3a20551c7d68..0ae8ae86cb42 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -20,7 +20,6 @@ go_library( "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", - "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index a852c683e0b6..68ce6f661cc6 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -3,7 +3,6 @@ package interfaces import ( "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" - "github.com/prysmaticlabs/go-bitfield" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" @@ -61,8 +60,8 @@ type ReadOnlyBeaconBlockBody interface { Eth1Data() *ethpb.Eth1Data Graffiti() [field_params.RootLength]byte ProposerSlashings() []*ethpb.ProposerSlashing - AttesterSlashings() []AttesterSlashing - Attestations() []Attestation + AttesterSlashings() []ethpb.AttSlashing + Attestations() []ethpb.Att Deposits() []*ethpb.Deposit VoluntaryExits() []*ethpb.SignedVoluntaryExit SyncAggregate() (*ethpb.SyncAggregate, error) @@ -87,8 +86,8 @@ type SignedBeaconBlock interface { SetSyncAggregate(*ethpb.SyncAggregate) error SetVoluntaryExits([]*ethpb.SignedVoluntaryExit) SetDeposits([]*ethpb.Deposit) - SetAttestations([]Attestation) error - SetAttesterSlashings([]AttesterSlashing) error + SetAttestations([]ethpb.Att) error + SetAttesterSlashings([]ethpb.AttSlashing) error SetProposerSlashings([]*ethpb.ProposerSlashing) SetGraffiti([]byte) SetEth1Data(*ethpb.Eth1Data) @@ -138,39 +137,3 @@ type ExecutionDataElectra interface { DepositReceipts() []*enginev1.DepositReceipt WithdrawalRequests() []*enginev1.ExecutionLayerWithdrawalRequest } - -type Attestation interface { - proto.Message - ssz.Marshaler - ssz.Unmarshaler - ssz.HashRoot - Version() int - GetAggregationBits() bitfield.Bitlist - GetData() *ethpb.AttestationData - GetCommitteeBitsVal() bitfield.Bitfield - GetSignature() []byte -} - -type AttesterSlashing interface { - proto.Message - ssz.Marshaler - ssz.Unmarshaler - ssz.HashRoot - Version() int - GetFirstAttestation() ethpb.IndexedAtt - GetSecondAttestation() ethpb.IndexedAtt -} - -// TODO: this is ugly. The proper way to do this is to create a Copy() function on the interface and implement it. But this results in a circular dependency. -// CopyAttestation copies the provided attestation object. -func CopyAttestation(att Attestation) Attestation { - a, ok := att.(*ethpb.Attestation) - if ok { - return ethpb.CopyAttestation(a) - } - ae, ok := att.(*ethpb.AttestationElectra) - if ok { - return ethpb.CopyAttestationElectra(ae) - } - return nil -} diff --git a/consensus-types/mock/BUILD.bazel b/consensus-types/mock/BUILD.bazel index b37f4f30d51d..08384eb05fcf 100644 --- a/consensus-types/mock/BUILD.bazel +++ b/consensus-types/mock/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "//config/fieldparams:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//proto/eth/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index e13e09be20b2..e172fd6df832 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -5,6 +5,7 @@ import ( field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "google.golang.org/protobuf/proto" @@ -191,7 +192,7 @@ func (BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing { panic("implement me") } -func (BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { +func (BeaconBlockBody) AttesterSlashings() []eth.AttSlashing { panic("implement me") } @@ -247,7 +248,7 @@ func (b *BeaconBlockBody) SetProposerSlashings([]*eth.ProposerSlashing) { panic("implement me") } -func (b *BeaconBlockBody) SetAttesterSlashings([]interfaces.AttesterSlashing) { +func (b *BeaconBlockBody) SetAttesterSlashings([]ethpb.AttesterSlashing) { panic("implement me") } @@ -280,7 +281,7 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { panic("implement me") } -func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { +func (b *BeaconBlockBody) Attestations() []eth.Att { panic("implement me") } func (b *BeaconBlockBody) Consolidations() []*eth.SignedConsolidation { diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index 2af00e0872d8..ee5cfb98ef7f 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -3,12 +3,26 @@ package eth import ( ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/runtime/version" "google.golang.org/protobuf/proto" ) -// TODO: it would be nicer to declare this inside consensus-types, but this will result in a circular dependency -// (because the interface method returns another interface, the implementation also returns an interface) +// Att defines common functionality for all attestation types. +type Att interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + Copy() Att + GetAggregationBits() bitfield.Bitlist + GetData() *AttestationData + CommitteeBitsVal() bitfield.Bitfield + GetSignature() []byte +} + +// IndexedAtt defines common functionality for all indexed attestation types. type IndexedAtt interface { proto.Message ssz.Marshaler @@ -20,62 +34,166 @@ type IndexedAtt interface { GetSignature() []byte } +// SignedAggregateAttAndProof defines common functionality for all signed aggregate attestation types. +type SignedAggregateAttAndProof interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + AggregateAttestationAndProof() AggregateAttAndProof + GetSignature() []byte +} + +// AggregateAttAndProof defines common functionality for all aggregate attestation types. +type AggregateAttAndProof interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetAggregatorIndex() primitives.ValidatorIndex + AggregateVal() Att + GetSelectionProof() []byte +} + +// AttSlashing defines common functionality for all attestation slashing types. +type AttSlashing interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + FirstAttestation() IndexedAtt + SecondAttestation() IndexedAtt +} + +// Version -- func (a *Attestation) Version() int { return version.Phase0 } -func (a *Attestation) GetCommitteeBitsVal() bitfield.Bitfield { +// Copy -- +func (a *Attestation) Copy() Att { + return CopyAttestation(a) +} + +// CommitteeBitsVal -- +func (a *Attestation) CommitteeBitsVal() bitfield.Bitfield { return nil } +// Version -- func (a *PendingAttestation) Version() int { return version.Phase0 } -func (a *PendingAttestation) GetCommitteeBitsVal() bitfield.Bitfield { +// Copy -- +func (a *PendingAttestation) Copy() Att { + return CopyPendingAttestation(a) +} + +// CommitteeBitsVal -- +func (a *PendingAttestation) CommitteeBitsVal() bitfield.Bitfield { return nil } +// GetSignature -- func (a *PendingAttestation) GetSignature() []byte { return nil } +// Version -- func (a *AttestationElectra) Version() int { return version.Electra } -func (a *AttestationElectra) GetCommitteeBitsVal() bitfield.Bitfield { +// Copy -- +func (a *AttestationElectra) Copy() Att { + return CopyAttestationElectra(a) +} + +// CommitteeBitsVal -- +func (a *AttestationElectra) CommitteeBitsVal() bitfield.Bitfield { return a.CommitteeBits } +// Version -- func (a *IndexedAttestation) Version() int { return version.Phase0 } +// Version -- func (a *IndexedAttestationElectra) Version() int { return version.Electra } +// Version -- func (a *AttesterSlashing) Version() int { return version.Phase0 } -func (a *AttesterSlashing) GetFirstAttestation() IndexedAtt { +// FirstAttestation -- +func (a *AttesterSlashing) FirstAttestation() IndexedAtt { return a.Attestation_1 } -func (a *AttesterSlashing) GetSecondAttestation() IndexedAtt { +// SecondAttestation -- +func (a *AttesterSlashing) SecondAttestation() IndexedAtt { return a.Attestation_2 } +// Version -- func (a *AttesterSlashingElectra) Version() int { return version.Electra } -func (a *AttesterSlashingElectra) GetFirstAttestation() IndexedAtt { +// FirstAttestation -- +func (a *AttesterSlashingElectra) FirstAttestation() IndexedAtt { return a.Attestation_1 } -func (a *AttesterSlashingElectra) GetSecondAttestation() IndexedAtt { +// SecondAttestation -- +func (a *AttesterSlashingElectra) SecondAttestation() IndexedAtt { return a.Attestation_2 } + +// Version -- +func (a *AggregateAttestationAndProof) Version() int { + return version.Phase0 +} + +// AggregateVal -- +func (a *AggregateAttestationAndProof) AggregateVal() Att { + return a.Aggregate +} + +// Version -- +func (a *AggregateAttestationAndProofElectra) Version() int { + return version.Electra +} + +// AggregateVal -- +func (a *AggregateAttestationAndProofElectra) AggregateVal() Att { + return a.Aggregate +} + +// Version -- +func (a *SignedAggregateAttestationAndProof) Version() int { + return version.Phase0 +} + +// AggregateAttestationAndProof -- +func (a *SignedAggregateAttestationAndProof) AggregateAttestationAndProof() AggregateAttAndProof { + return a.Message +} + +// Version -- +func (a *SignedAggregateAttestationAndProofElectra) Version() int { + return version.Electra +} + +// AggregateAttestationAndProof -- +func (a *SignedAggregateAttestationAndProofElectra) AggregateAttestationAndProof() AggregateAttAndProof { + return a.Message +} diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index 7277285cc710..ebe984e2c688 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -8,7 +8,6 @@ go_library( deps = [ "//beacon-chain/core/signing:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -26,7 +25,6 @@ go_test( ":go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel index 53fe85d02514..1a537f2da053 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel @@ -9,7 +9,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations", visibility = ["//visibility:public"], deps = [ - "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation:go_default_library", @@ -28,7 +27,6 @@ go_test( embed = [":go_default_library"], deps = [ "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//encoding/ssz/equality:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go index c7dc7542b0b7..8828687d8149 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go @@ -2,7 +2,6 @@ package attestations import ( "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -10,7 +9,7 @@ import ( ) // attList represents list of attestations, defined for easier en masse operations (filtering, sorting). -type attList []interfaces.Attestation +type attList []ethpb.Att // BLS aggregate signature aliases for testing / benchmark substitution. These methods are // significantly more expensive than the inner logic of AggregateAttestations so they must be @@ -33,13 +32,13 @@ var ErrInvalidAttestationCount = errors.New("invalid number of attestations") // clonedAtts[i] = stateTrie.CopyAttestation(a) // } // aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) -func Aggregate(atts []interfaces.Attestation) ([]interfaces.Attestation, error) { +func Aggregate(atts []ethpb.Att) ([]ethpb.Att, error) { return MaxCoverAttestationAggregation(atts) } // AggregateDisjointOneBitAtts aggregates unaggregated attestations with the // exact same attestation data. -func AggregateDisjointOneBitAtts(atts []interfaces.Attestation) (interfaces.Attestation, error) { +func AggregateDisjointOneBitAtts(atts []ethpb.Att) (ethpb.Att, error) { if len(atts) == 0 { return nil, nil } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go index a59b835ff285..d399c7af671e 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go @@ -5,7 +5,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -15,7 +14,7 @@ import ( // Aggregation occurs in many rounds, up until no more aggregation is possible (all attestations // are overlapping). // See https://hackmd.io/@farazdagi/in-place-attagg for design and rationale. -func MaxCoverAttestationAggregation(atts []interfaces.Attestation) ([]interfaces.Attestation, error) { +func MaxCoverAttestationAggregation(atts []ethpb.Att) ([]ethpb.Att, error) { if len(atts) < 2 { return atts, nil } @@ -150,7 +149,7 @@ func padSelectedKeys(keys []int, pad int) []int { // aggregateAttestations combines signatures of selected attestations into a single aggregate attestation, and // pushes that aggregated attestation into the position of the first of selected attestations. -func aggregateAttestations(atts []interfaces.Attestation, keys []int, coverage *bitfield.Bitlist64) (targetIdx int, err error) { +func aggregateAttestations(atts []ethpb.Att, keys []int, coverage *bitfield.Bitlist64) (targetIdx int, err error) { if len(keys) < 2 || atts == nil || len(atts) < 2 { return targetIdx, errors.Wrap(ErrInvalidAttestationCount, "cannot aggregate") } @@ -184,7 +183,7 @@ func aggregateAttestations(atts []interfaces.Attestation, keys []int, coverage * // rearrangeProcessedAttestations pushes processed attestations to the end of the slice, returning // the number of items re-arranged (so that caller can cut the slice, and allow processed items to be // garbage collected). -func rearrangeProcessedAttestations(atts []interfaces.Attestation, candidates []*bitfield.Bitlist64, processedKeys []int) { +func rearrangeProcessedAttestations(atts []ethpb.Att, candidates []*bitfield.Bitlist64, processedKeys []int) { if atts == nil || candidates == nil || processedKeys == nil { return } @@ -216,7 +215,7 @@ func (al attList) merge(al1 attList) attList { // selectUsingKeys returns only items with specified keys. func (al attList) selectUsingKeys(keys []int) attList { - filtered := make([]interfaces.Attestation, len(keys)) + filtered := make([]ethpb.Att, len(keys)) for i, key := range keys { filtered[i] = al[key] } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go index 638c85ded6b1..e99af315ad3c 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -145,35 +144,35 @@ func TestAggregateAttestations_MaxCover_AttList_validate(t *testing.T) { func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { tests := []struct { name string - atts []interfaces.Attestation + atts []ethpb.Att keys []int - wantAtts []interfaces.Attestation + wantAtts []ethpb.Att }{ { name: "nil attestations", }, { name: "single attestation no processed keys", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{}, }, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{}, }, }, { name: "single attestation processed", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{}, }, keys: []int{0}, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ nil, }, }, { name: "multiple processed, last attestation marked", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -181,7 +180,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, }, keys: []int{1, 4}, // Only attestation at index 1, should be moved, att at 4 is already at the end. - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -190,7 +189,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { }, { name: "all processed", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -198,13 +197,13 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, }, keys: []int{0, 1, 2, 3, 4}, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ nil, nil, nil, nil, nil, }, }, { name: "operate on slice, single attestation marked", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -214,7 +213,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { nil, nil, nil, }, keys: []int{2}, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, @@ -224,7 +223,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { }, { name: "operate on slice, non-last attestation marked", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -235,7 +234,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { nil, nil, nil, }, keys: []int{2, 3}, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, @@ -245,7 +244,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { }, { name: "operate on slice, last attestation marked", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -255,7 +254,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { nil, nil, nil, }, keys: []int{2, 4}, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, @@ -264,7 +263,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { }, { name: "many items, many selected, keys unsorted", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, @@ -274,7 +273,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x06}}, }, keys: []int{4, 1, 2, 5, 6}, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, nil, @@ -303,8 +302,8 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { sign := bls.NewAggregateSignature().Marshal() tests := []struct { name string - atts []interfaces.Attestation - wantAtts []interfaces.Attestation + atts []ethpb.Att + wantAtts []ethpb.Att keys []int coverage *bitfield.Bitlist64 wantTargetIdx int @@ -318,7 +317,7 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "single attestation", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{}, }, wantTargetIdx: 0, @@ -332,7 +331,7 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, none selected", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, }, @@ -342,7 +341,7 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, one selected", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, }, @@ -352,11 +351,11 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, both selected, empty coverage", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000001, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, }, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000111, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, }, @@ -366,11 +365,11 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, both selected", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, }, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, }, @@ -386,7 +385,7 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "many attestations, several selected", - atts: []interfaces.Attestation{ + atts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, @@ -394,7 +393,7 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, }, - wantAtts: []interfaces.Attestation{ + wantAtts: []ethpb.Att{ ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010110, 0b1}, Signature: sign}, ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, @@ -423,7 +422,7 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { assert.NoError(t, err) } assert.Equal(t, tt.wantTargetIdx, gotTargetIdx) - extractBitlists := func(atts []interfaces.Attestation) []bitfield.Bitlist { + extractBitlists := func(atts []ethpb.Att) []bitfield.Bitlist { bl := make([]bitfield.Bitlist, len(atts)) for i, att := range atts { bl[i] = att.GetAggregationBits() diff --git a/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel index c1e4ddcb0bb6..220bbe96bfba 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel @@ -7,7 +7,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/testing", visibility = ["//visibility:public"], deps = [ - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go b/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go index c8510b5186c8..370f6f71662d 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -78,8 +77,8 @@ func Bitlists64WithMultipleBitSet(t testing.TB, n, length, count uint64) []*bitf } // MakeAttestationsFromBitlists creates list of attestations from list of bitlist. -func MakeAttestationsFromBitlists(bl []bitfield.Bitlist) []interfaces.Attestation { - atts := make([]interfaces.Attestation, len(bl)) +func MakeAttestationsFromBitlists(bl []bitfield.Bitlist) []ethpb.Att { + atts := make([]ethpb.Att, len(bl)) for i, b := range bl { atts[i] = ðpb.Attestation{ AggregationBits: b, diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils.go b/proto/prysm/v1alpha1/attestation/attestation_utils.go index 432d496efba9..1af3060e5ecc 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils.go @@ -13,7 +13,6 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -40,7 +39,7 @@ import ( // data=attestation.data, // signature=attestation.signature, // ) -func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, committees ...[]primitives.ValidatorIndex) (ethpb.IndexedAtt, error) { +func ConvertToIndexed(ctx context.Context, attestation ethpb.Att, committees ...[]primitives.ValidatorIndex) (ethpb.IndexedAtt, error) { attIndices, err := AttestingIndices(attestation, committees...) if err != nil { return nil, err @@ -79,7 +78,7 @@ func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, c // committee_offset += len(committee) // // return output -func AttestingIndices(att interfaces.Attestation, committees ...[]primitives.ValidatorIndex) ([]uint64, error) { +func AttestingIndices(att ethpb.Att, committees ...[]primitives.ValidatorIndex) ([]uint64, error) { if len(committees) == 0 { return []uint64{}, nil } diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils_test.go b/proto/prysm/v1alpha1/attestation/attestation_utils_test.go index d24a33190967..62d797f3adc2 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils_test.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils_test.go @@ -7,7 +7,6 @@ import ( "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" @@ -17,7 +16,7 @@ import ( func TestAttestingIndices(t *testing.T) { type args struct { - att interfaces.Attestation + att eth.Att committees [][]primitives.ValidatorIndex } tests := []struct { diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.proto b/proto/prysm/v1alpha1/validator-client/keymanager.proto index 455cff32a2a6..9c6888ea87a0 100644 --- a/proto/prysm/v1alpha1/validator-client/keymanager.proto +++ b/proto/prysm/v1alpha1/validator-client/keymanager.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package ethereum.validator.accounts.v2; -import "google/protobuf/wrappers.proto"; import "proto/eth/ext/options.proto"; import "proto/prysm/v1alpha1/attestation.proto"; import "proto/prysm/v1alpha1/beacon_block.proto"; diff --git a/testing/slasher/simulator/BUILD.bazel b/testing/slasher/simulator/BUILD.bazel index 6f904214877c..d8dccd2d376a 100644 --- a/testing/slasher/simulator/BUILD.bazel +++ b/testing/slasher/simulator/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/sync:go_default_library", "//config/params:go_default_library", - "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/rand:go_default_library", diff --git a/testing/slasher/simulator/simulator.go b/testing/slasher/simulator/simulator.go index d8825701e2e4..b4d51c584691 100644 --- a/testing/slasher/simulator/simulator.go +++ b/testing/slasher/simulator/simulator.go @@ -15,7 +15,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -238,7 +237,7 @@ func (s *Simulator) verifySlashingsWereDetected(ctx context.Context) { ctx, nil, true, /* no limit */ ) detectedProposerSlashings := make(map[[32]byte]*ethpb.ProposerSlashing) - detectedAttesterSlashings := make(map[[32]byte]interfaces.AttesterSlashing) + detectedAttesterSlashings := make(map[[32]byte]ethpb.AttSlashing) for _, slashing := range poolProposerSlashings { slashingRoot, err := slashing.HashTreeRoot() if err != nil { diff --git a/testing/spectest/shared/common/forkchoice/builder.go b/testing/spectest/shared/common/forkchoice/builder.go index d354df5af075..81421dc8875d 100644 --- a/testing/spectest/shared/common/forkchoice/builder.go +++ b/testing/spectest/shared/common/forkchoice/builder.go @@ -126,7 +126,7 @@ func (bb *Builder) Attestation(t testing.TB, a *ethpb.Attestation) { // AttesterSlashing receives an attester slashing and feeds it to forkchoice. func (bb *Builder) AttesterSlashing(s *ethpb.AttesterSlashing) { - slashings := []interfaces.AttesterSlashing{s} + slashings := []ethpb.AttSlashing{s} bb.service.InsertSlashingsToForkChoiceStore(context.TODO(), slashings) } From 4d190c41cc4f5ab269ec06cd047d5615d7d57b78 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Wed, 22 May 2024 11:25:42 -0700 Subject: [PATCH 103/325] Fix TestNodeHealth_Concurrently race condition (#14033) --- api/client/beacon/health.go | 12 ++++++------ api/client/beacon/health_test.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/client/beacon/health.go b/api/client/beacon/health.go index ae3c60ef5e6b..c13a04407ee8 100644 --- a/api/client/beacon/health.go +++ b/api/client/beacon/health.go @@ -36,19 +36,19 @@ func (n *NodeHealthTracker) IsHealthy() bool { } func (n *NodeHealthTracker) CheckHealth(ctx context.Context) bool { - n.RLock() + n.Lock() + defer n.Unlock() + newStatus := n.node.IsHealthy(ctx) if n.isHealthy == nil { n.isHealthy = &newStatus } - isStatusChanged := newStatus != *n.isHealthy - n.RUnlock() + isStatusChanged := newStatus != *n.isHealthy if isStatusChanged { - n.Lock() - // Double-check the condition to ensure it hasn't changed since the first check. + // Update the health status n.isHealthy = &newStatus - n.Unlock() // It's better to unlock as soon as the protected section is over. + // Send the new status to the health channel n.healthChan <- newStatus } return newStatus diff --git a/api/client/beacon/health_test.go b/api/client/beacon/health_test.go index 3118a442776b..8dedfc54c95c 100644 --- a/api/client/beacon/health_test.go +++ b/api/client/beacon/health_test.go @@ -99,9 +99,9 @@ func TestNodeHealth_Concurrency(t *testing.T) { for i := 0; i < numGoroutines; i++ { go func() { defer wg.Done() - client.EXPECT().IsHealthy(gomock.Any()).Return(false) + client.EXPECT().IsHealthy(gomock.Any()).Return(false).Times(1) n.CheckHealth(context.Background()) - client.EXPECT().IsHealthy(gomock.Any()).Return(true) + client.EXPECT().IsHealthy(gomock.Any()).Return(true).Times(1) n.CheckHealth(context.Background()) }() } From 2265af58aef64520881e40b32a7b97085cfab33d Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Wed, 22 May 2024 17:16:32 -0500 Subject: [PATCH 104/325] Unwrap payload bid (#14035) * engine GetPayload returns entire response * deprecate PayloadValueTo(Gwei|Wei) * return entire bid from builder getter * get bid value from api bid (not ExecutionData) * plumb bid and bundle through BuildBlockParallel * rm ValueInGwei * removing wei/gwei fields from the payload wrappers * commentary around the little-endian situation * finish the job in BuildBlockParallel * light self-review cleanup * fix spectest mock * restore engine timeout * lint fixes * de-duplicate imports * remove errant comment * James feedback --------- Co-authored-by: Kasey Kirkham --- api/client/builder/bid.go | 18 +- api/client/builder/client.go | 2 +- api/client/builder/client_test.go | 32 +-- api/client/builder/types.go | 10 +- beacon-chain/builder/testing/mock.go | 5 +- beacon-chain/core/blocks/payload_test.go | 5 +- beacon-chain/core/blocks/withdrawals_test.go | 8 +- beacon-chain/db/kv/state_test.go | 7 +- beacon-chain/execution/engine_client.go | 76 +++---- beacon-chain/execution/engine_client_test.go | 83 ++++---- beacon-chain/execution/testing/BUILD.bazel | 1 - .../execution/testing/mock_engine_client.go | 40 +--- .../validator/construct_generic_block.go | 36 ++-- .../validator/construct_generic_block_test.go | 19 +- .../rpc/prysm/v1alpha1/validator/proposer.go | 69 +++--- .../v1alpha1/validator/proposer_bellatrix.go | 119 ++++++----- .../validator/proposer_bellatrix_test.go | 200 +++++++++++++----- .../validator/proposer_execution_payload.go | 88 ++++---- .../proposer_execution_payload_test.go | 34 +-- .../prysm/v1alpha1/validator/proposer_test.go | 28 ++- .../state-native/getters_payload_header.go | 7 +- .../state/state-native/hasher_test.go | 3 +- .../setters_payload_header_test.go | 12 +- consensus-types/blocks/BUILD.bazel | 2 +- consensus-types/blocks/execution.go | 161 +++----------- consensus-types/blocks/execution_test.go | 51 ++--- consensus-types/blocks/factory.go | 7 +- consensus-types/blocks/factory_test.go | 3 +- consensus-types/blocks/get_payload.go | 60 ++++++ consensus-types/blocks/getters.go | 40 ---- consensus-types/blocks/getters_test.go | 13 +- consensus-types/blocks/proto.go | 14 +- consensus-types/blocks/proto_test.go | 9 +- consensus-types/interfaces/beacon_block.go | 4 - consensus-types/mock/block.go | 8 - consensus-types/primitives/wei.go | 12 +- consensus-types/primitives/wei_test.go | 5 + math/BUILD.bazel | 1 - math/math_helper_test.go | 27 --- runtime/interop/premine-state.go | 9 +- testing/middleware/builder/builder.go | 12 +- .../capella/operations/execution_payload.go | 3 +- .../shared/capella/operations/withdrawals.go | 3 +- .../shared/common/forkchoice/service.go | 5 +- .../deneb/operations/execution_payload.go | 3 +- .../shared/deneb/operations/withdrawals.go | 3 +- .../electra/operations/execution_payload.go | 3 +- .../shared/electra/operations/withdrawals.go | 3 +- 48 files changed, 624 insertions(+), 739 deletions(-) create mode 100644 consensus-types/blocks/get_payload.go diff --git a/api/client/builder/bid.go b/api/client/builder/bid.go index 50e3e21952f2..f88fd6194eac 100644 --- a/api/client/builder/bid.go +++ b/api/client/builder/bid.go @@ -23,7 +23,7 @@ type SignedBid interface { type Bid interface { Header() (interfaces.ExecutionData, error) BlobKzgCommitments() ([][]byte, error) - Value() []byte + Value() primitives.Wei Pubkey() []byte Version() int IsNil() bool @@ -126,8 +126,8 @@ func (b builderBid) Version() int { } // Value -- -func (b builderBid) Value() []byte { - return b.p.Value +func (b builderBid) Value() primitives.Wei { + return primitives.LittleEndianBytesToWei(b.p.Value) } // Pubkey -- @@ -166,7 +166,7 @@ func WrappedBuilderBidCapella(p *ethpb.BuilderBidCapella) (Bid, error) { // Header returns the execution data interface. func (b builderBidCapella) Header() (interfaces.ExecutionData, error) { // We have to convert big endian to little endian because the value is coming from the execution layer. - return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header, primitives.BigEndianBytesToWei(b.p.Value)) + return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header) } // BlobKzgCommitments -- @@ -180,8 +180,8 @@ func (b builderBidCapella) Version() int { } // Value -- -func (b builderBidCapella) Value() []byte { - return b.p.Value +func (b builderBidCapella) Value() primitives.Wei { + return primitives.LittleEndianBytesToWei(b.p.Value) } // Pubkey -- @@ -223,8 +223,8 @@ func (b builderBidDeneb) Version() int { } // Value -- -func (b builderBidDeneb) Value() []byte { - return b.p.Value +func (b builderBidDeneb) Value() primitives.Wei { + return primitives.LittleEndianBytesToWei(b.p.Value) } // Pubkey -- @@ -250,7 +250,7 @@ func (b builderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) error { // Header -- func (b builderBidDeneb) Header() (interfaces.ExecutionData, error) { // We have to convert big endian to little endian because the value is coming from the execution layer. - return blocks.WrappedExecutionPayloadHeaderDeneb(b.p.Header, blocks.PayloadValueToWei(b.p.Value)) + return blocks.WrappedExecutionPayloadHeaderDeneb(b.p.Header) } // BlobKzgCommitments -- diff --git a/api/client/builder/client.go b/api/client/builder/client.go index ba7c33328f36..97acd7237c58 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -330,7 +330,7 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS if err != nil { return nil, nil, err } - ed, err := blocks.NewWrappedExecutionData(pb, nil) + ed, err := blocks.NewWrappedExecutionData(pb) if err != nil { return nil, nil, err } diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index eaa8f1f53068..02070acdb3d6 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "math/big" "net/http" "net/url" "strconv" @@ -16,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" types "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" @@ -198,12 +198,12 @@ func TestClient_GetHeader(t *testing.T) { require.NoError(t, err) require.Equal(t, true, bytes.Equal(expectedTxRoot, withdrawalsRoot)) require.Equal(t, uint64(1), bidHeader.GasUsed()) - value, err := stringToUint256("652312848583266388373324160190187140051835877600158453279131187530910662656") + // this matches the value in the testExampleHeaderResponse + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) require.NoError(t, err) - require.Equal(t, fmt.Sprintf("%#x", value.SSZBytes()), fmt.Sprintf("%#x", bid.Value())) - bidValue := bytesutil.ReverseByteOrder(bid.Value()) - require.DeepEqual(t, bidValue, value.Bytes()) - require.DeepEqual(t, big.NewInt(0).SetBytes(bidValue), value.Int) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) }) t.Run("capella", func(t *testing.T) { hc := &http.Client{ @@ -230,12 +230,11 @@ func TestClient_GetHeader(t *testing.T) { withdrawalsRoot, err := bidHeader.WithdrawalsRoot() require.NoError(t, err) require.Equal(t, true, bytes.Equal(expectedWithdrawalsRoot, withdrawalsRoot)) - value, err := stringToUint256("652312848583266388373324160190187140051835877600158453279131187530910662656") + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) require.NoError(t, err) - require.Equal(t, fmt.Sprintf("%#x", value.SSZBytes()), fmt.Sprintf("%#x", bid.Value())) - bidValue := bytesutil.ReverseByteOrder(bid.Value()) - require.DeepEqual(t, bidValue, value.Bytes()) - require.DeepEqual(t, big.NewInt(0).SetBytes(bidValue), value.Int) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) }) t.Run("deneb", func(t *testing.T) { hc := &http.Client{ @@ -262,12 +261,13 @@ func TestClient_GetHeader(t *testing.T) { withdrawalsRoot, err := bidHeader.WithdrawalsRoot() require.NoError(t, err) require.Equal(t, true, bytes.Equal(expectedWithdrawalsRoot, withdrawalsRoot)) - value, err := stringToUint256("652312848583266388373324160190187140051835877600158453279131187530910662656") + + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) require.NoError(t, err) - require.Equal(t, fmt.Sprintf("%#x", value.SSZBytes()), fmt.Sprintf("%#x", bid.Value())) - bidValue := bytesutil.ReverseByteOrder(bid.Value()) - require.DeepEqual(t, bidValue, value.Bytes()) - require.DeepEqual(t, big.NewInt(0).SetBytes(bidValue), value.Int) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) + kcgCommitments, err := bid.BlobKzgCommitments() require.NoError(t, err) require.Equal(t, len(kcgCommitments) > 0, true) diff --git a/api/client/builder/types.go b/api/client/builder/types.go index 29905096739d..169df6822ebd 100644 --- a/api/client/builder/types.go +++ b/api/client/builder/types.go @@ -156,6 +156,8 @@ func (bb *BuilderBid) ToProto() (*eth.BuilderBid, error) { } return ð.BuilderBid{ Header: header, + // Note that SSZBytes() reverses byte order for the little-endian representation. + // Uint256.Bytes() is big-endian, SSZBytes takes this value and reverses it. Value: bb.Value.SSZBytes(), Pubkey: bb.Pubkey, }, nil @@ -484,6 +486,8 @@ func (bb *BuilderBidCapella) ToProto() (*eth.BuilderBidCapella, error) { } return ð.BuilderBidCapella{ Header: header, + // Note that SSZBytes() reverses byte order for the little-endian representation. + // Uint256.Bytes() is big-endian, SSZBytes takes this value and reverses it. Value: bytesutil.SafeCopyBytes(bb.Value.SSZBytes()), Pubkey: bytesutil.SafeCopyBytes(bb.Pubkey), }, nil @@ -1022,8 +1026,10 @@ func (bb *BuilderBidDeneb) ToProto() (*eth.BuilderBidDeneb, error) { return ð.BuilderBidDeneb{ Header: header, BlobKzgCommitments: kzgCommitments, - Value: bytesutil.SafeCopyBytes(bb.Value.SSZBytes()), - Pubkey: bytesutil.SafeCopyBytes(bb.Pubkey), + // Note that SSZBytes() reverses byte order for the little-endian representation. + // Uint256.Bytes() is big-endian, SSZBytes takes this value and reverses it. + Value: bytesutil.SafeCopyBytes(bb.Value.SSZBytes()), + Pubkey: bytesutil.SafeCopyBytes(bb.Pubkey), }, nil } diff --git a/beacon-chain/builder/testing/mock.go b/beacon-chain/builder/testing/mock.go index 55b1aa05efb3..e1c1d913aff8 100644 --- a/beacon-chain/builder/testing/mock.go +++ b/beacon-chain/builder/testing/mock.go @@ -2,7 +2,6 @@ package testing import ( "context" - "math/big" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/client/builder" @@ -55,13 +54,13 @@ func (s *MockBuilderService) SubmitBlindedBlock(_ context.Context, b interfaces. } return w, nil, s.ErrSubmitBlindedBlock case version.Capella: - w, err := blocks.WrappedExecutionPayloadCapella(s.PayloadCapella, big.NewInt(0)) + w, err := blocks.WrappedExecutionPayloadCapella(s.PayloadCapella) if err != nil { return nil, nil, errors.Wrap(err, "could not wrap capella payload") } return w, nil, s.ErrSubmitBlindedBlock case version.Deneb: - w, err := blocks.WrappedExecutionPayloadDeneb(s.PayloadDeneb, big.NewInt(0)) + w, err := blocks.WrappedExecutionPayloadDeneb(s.PayloadDeneb) if err != nil { return nil, nil, errors.Wrap(err, "could not wrap deneb payload") } diff --git a/beacon-chain/core/blocks/payload_test.go b/beacon-chain/core/blocks/payload_test.go index a447e7cbc878..0da3e9b523ff 100644 --- a/beacon-chain/core/blocks/payload_test.go +++ b/beacon-chain/core/blocks/payload_test.go @@ -1,7 +1,6 @@ package blocks_test import ( - "math/big" "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" @@ -610,7 +609,7 @@ func Test_ProcessPayloadCapella(t *testing.T) { random, err := helpers.RandaoMix(st, time.CurrentEpoch(st)) require.NoError(t, err) payload.PrevRandao = random - wrapped, err := consensusblocks.WrappedExecutionPayloadCapella(payload, big.NewInt(0)) + wrapped, err := consensusblocks.WrappedExecutionPayloadCapella(payload) require.NoError(t, err) _, err = blocks.ProcessPayload(st, wrapped) require.NoError(t, err) @@ -874,7 +873,7 @@ func emptyPayloadHeaderCapella() (interfaces.ExecutionData, error) { BlockHash: make([]byte, fieldparams.RootLength), TransactionsRoot: make([]byte, fieldparams.RootLength), WithdrawalsRoot: make([]byte, fieldparams.RootLength), - }, big.NewInt(0)) + }) } func emptyPayload() *enginev1.ExecutionPayload { diff --git a/beacon-chain/core/blocks/withdrawals_test.go b/beacon-chain/core/blocks/withdrawals_test.go index 35d917614b2d..6b0f6caf660b 100644 --- a/beacon-chain/core/blocks/withdrawals_test.go +++ b/beacon-chain/core/blocks/withdrawals_test.go @@ -1,7 +1,6 @@ package blocks_test import ( - "math/big" "math/rand" "testing" @@ -643,10 +642,7 @@ func TestProcessBlindWithdrawals(t *testing.T) { require.NoError(t, err) wdRoot, err := ssz.WithdrawalSliceRoot(test.Args.Withdrawals, fieldparams.MaxWithdrawalsPerPayload) require.NoError(t, err) - p, err := consensusblocks.WrappedExecutionPayloadHeaderCapella( - &enginev1.ExecutionPayloadHeaderCapella{WithdrawalsRoot: wdRoot[:]}, - big.NewInt(0), - ) + p, err := consensusblocks.WrappedExecutionPayloadHeaderCapella(&enginev1.ExecutionPayloadHeaderCapella{WithdrawalsRoot: wdRoot[:]}) require.NoError(t, err) post, err := blocks.ProcessWithdrawals(st, p) if test.Control.ExpectedError { @@ -1064,7 +1060,7 @@ func TestProcessWithdrawals(t *testing.T) { } st, err := prepareValidators(spb, test.Args) require.NoError(t, err) - p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: test.Args.Withdrawals}, big.NewInt(0)) + p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: test.Args.Withdrawals}) require.NoError(t, err) post, err := blocks.ProcessWithdrawals(st, p) if test.Control.ExpectedError { diff --git a/beacon-chain/db/kv/state_test.go b/beacon-chain/db/kv/state_test.go index 6ca53a5e23e3..938b95514599 100644 --- a/beacon-chain/db/kv/state_test.go +++ b/beacon-chain/db/kv/state_test.go @@ -3,7 +3,6 @@ package kv import ( "context" "encoding/binary" - "math/big" "math/rand" "strconv" "testing" @@ -100,7 +99,7 @@ func TestState_CanSaveRetrieve(t *testing.T) { BlockHash: make([]byte, 32), TransactionsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32), - }, big.NewInt(0)) + }) require.NoError(t, err) require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) return st @@ -125,7 +124,7 @@ func TestState_CanSaveRetrieve(t *testing.T) { BlockHash: make([]byte, 32), TransactionsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32), - }, big.NewInt(0)) + }) require.NoError(t, err) require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) return st @@ -152,7 +151,7 @@ func TestState_CanSaveRetrieve(t *testing.T) { WithdrawalsRoot: make([]byte, 32), DepositReceiptsRoot: make([]byte, 32), WithdrawalRequestsRoot: make([]byte, 32), - }, big.NewInt(0)) + }) require.NoError(t, err) require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) return st diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 8ed049bce9fc..cf8a791fc999 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -118,7 +118,7 @@ type EngineCaller interface { ForkchoiceUpdated( ctx context.Context, state *pb.ForkchoiceState, attrs payloadattribute.Attributer, ) (*pb.PayloadIDBytes, []byte, error) - GetPayload(ctx context.Context, payloadId [8]byte, slot primitives.Slot) (interfaces.ExecutionData, *pb.BlobsBundle, bool, error) + GetPayload(ctx context.Context, payloadId [8]byte, slot primitives.Slot) (*blocks.GetPayloadResponse, error) ExecutionBlockByHash(ctx context.Context, hash common.Hash, withTxs bool) (*pb.ExecutionBlock, error) GetTerminalBlockHash(ctx context.Context, transitionTime uint64) ([]byte, bool, error) } @@ -266,69 +266,43 @@ func (s *Service) ForkchoiceUpdated( } } +func getPayloadMethodAndMessage(slot primitives.Slot) (string, proto.Message) { + pe := slots.ToEpoch(slot) + if pe >= params.BeaconConfig().ElectraForkEpoch { + return GetPayloadMethodV4, &pb.ExecutionPayloadElectraWithValueAndBlobsBundle{} + } + if pe >= params.BeaconConfig().DenebForkEpoch { + return GetPayloadMethodV3, &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{} + } + if pe >= params.BeaconConfig().CapellaForkEpoch { + return GetPayloadMethodV2, &pb.ExecutionPayloadCapellaWithValue{} + } + return GetPayloadMethod, &pb.ExecutionPayload{} +} + // GetPayload calls the engine_getPayloadVX method via JSON-RPC. // It returns the execution data as well as the blobs bundle. -func (s *Service) GetPayload(ctx context.Context, payloadId [8]byte, slot primitives.Slot) (interfaces.ExecutionData, *pb.BlobsBundle, bool, error) { +func (s *Service) GetPayload(ctx context.Context, payloadId [8]byte, slot primitives.Slot) (*blocks.GetPayloadResponse, error) { ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.GetPayload") defer span.End() start := time.Now() defer func() { getPayloadLatency.Observe(float64(time.Since(start).Milliseconds())) }() - d := time.Now().Add(defaultEngineTimeout) ctx, cancel := context.WithDeadline(ctx, d) defer cancel() - if slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch { - result := &pb.ExecutionPayloadElectraWithValueAndBlobsBundle{} - err := s.rpcClient.CallContext(ctx, result, GetPayloadMethodV4, pb.PayloadIDBytes(payloadId)) - if err != nil { - return nil, nil, false, handleRPCError(err) - } - ed, err := blocks.WrappedExecutionPayloadElectra(result.Payload, blocks.PayloadValueToWei(result.Value)) - if err != nil { - return nil, nil, false, err - } - return ed, result.BlobsBundle, result.ShouldOverrideBuilder, nil - } - - if slots.ToEpoch(slot) >= params.BeaconConfig().DenebForkEpoch { - result := &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{} - err := s.rpcClient.CallContext(ctx, result, GetPayloadMethodV3, pb.PayloadIDBytes(payloadId)) - if err != nil { - return nil, nil, false, handleRPCError(err) - } - ed, err := blocks.WrappedExecutionPayloadDeneb(result.Payload, blocks.PayloadValueToWei(result.Value)) - if err != nil { - return nil, nil, false, err - } - return ed, result.BlobsBundle, result.ShouldOverrideBuilder, nil - } - - if slots.ToEpoch(slot) >= params.BeaconConfig().CapellaForkEpoch { - result := &pb.ExecutionPayloadCapellaWithValue{} - err := s.rpcClient.CallContext(ctx, result, GetPayloadMethodV2, pb.PayloadIDBytes(payloadId)) - if err != nil { - return nil, nil, false, handleRPCError(err) - } - ed, err := blocks.WrappedExecutionPayloadCapella(result.Payload, blocks.PayloadValueToWei(result.Value)) - if err != nil { - return nil, nil, false, err - } - return ed, nil, false, nil - } - - result := &pb.ExecutionPayload{} - err := s.rpcClient.CallContext(ctx, result, GetPayloadMethod, pb.PayloadIDBytes(payloadId)) + method, result := getPayloadMethodAndMessage(slot) + err := s.rpcClient.CallContext(ctx, result, method, pb.PayloadIDBytes(payloadId)) if err != nil { - return nil, nil, false, handleRPCError(err) + return nil, handleRPCError(err) } - ed, err := blocks.WrappedExecutionPayload(result) + res, err := blocks.NewGetPayloadResponse(result) if err != nil { - return nil, nil, false, err + return nil, err } - return ed, nil, false, nil + return res, nil } func (s *Service) ExchangeCapabilities(ctx context.Context) ([]string, error) { @@ -591,7 +565,7 @@ func fullPayloadFromPayloadBody( BlockHash: header.BlockHash(), Transactions: pb.RecastHexutilByteSlice(body.Transactions), Withdrawals: body.Withdrawals, - }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance + }) // We can't get the block value and don't care about the block value for this instance case version.Deneb: ebg, err := header.ExcessBlobGas() if err != nil { @@ -620,7 +594,7 @@ func fullPayloadFromPayloadBody( Withdrawals: body.Withdrawals, ExcessBlobGas: ebg, BlobGasUsed: bgu, - }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance + }) // We can't get the block value and don't care about the block value for this instance case version.Electra: ebg, err := header.ExcessBlobGas() if err != nil { @@ -659,7 +633,7 @@ func fullPayloadFromPayloadBody( BlobGasUsed: bgu, DepositReceipts: dr, WithdrawalRequests: wr, - }, big.NewInt(0)) // We can't get the block value and don't care about the block value for this instance + }) // We can't get the block value and don't care about the block value for this instance default: return nil, fmt.Errorf("unknown execution block version for payload %d", bVersion) } diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index 2ac1f8d3c896..c4255c9f62a8 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -25,6 +25,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" payloadattribute "github.com/prysmaticlabs/prysm/v5/consensus-types/payload-attribute" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -74,10 +75,10 @@ func TestClient_IPC(t *testing.T) { want, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) payloadId := [8]byte{1} - resp, _, override, err := srv.GetPayload(ctx, payloadId, 1) + resp, err := srv.GetPayload(ctx, payloadId, 1) require.NoError(t, err) - require.Equal(t, false, override) - pbs := resp.Proto() + require.Equal(t, false, resp.OverrideBuilder) + pbs := resp.ExecutionData.Proto() resPb, ok := pbs.(*pb.ExecutionPayload) require.Equal(t, true, ok) require.NoError(t, err) @@ -87,10 +88,10 @@ func TestClient_IPC(t *testing.T) { want, ok := fix["ExecutionPayloadCapellaWithValue"].(*pb.ExecutionPayloadCapellaWithValue) require.Equal(t, true, ok) payloadId := [8]byte{1} - resp, _, override, err := srv.GetPayload(ctx, payloadId, params.BeaconConfig().SlotsPerEpoch) + resp, err := srv.GetPayload(ctx, payloadId, params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) - require.Equal(t, false, override) - pbs := resp.Proto() + require.Equal(t, false, resp.OverrideBuilder) + pbs := resp.ExecutionData.Proto() resPb, ok := pbs.(*pb.ExecutionPayloadCapella) require.Equal(t, true, ok) require.DeepEqual(t, want, resPb) @@ -131,7 +132,7 @@ func TestClient_IPC(t *testing.T) { require.Equal(t, true, ok) req, ok := fix["ExecutionPayloadCapella"].(*pb.ExecutionPayloadCapella) require.Equal(t, true, ok) - wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(req, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(req) require.NoError(t, err) latestValidHash, err := srv.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{}) require.NoError(t, err) @@ -203,10 +204,10 @@ func TestClient_HTTP(t *testing.T) { client.rpcClient = rpcClient // We call the RPC method via HTTP and expect a proper result. - resp, _, override, err := client.GetPayload(ctx, payloadId, 1) + resp, err := client.GetPayload(ctx, payloadId, 1) require.NoError(t, err) - require.Equal(t, false, override) - pbs := resp.Proto() + require.Equal(t, false, resp.OverrideBuilder) + pbs := resp.ExecutionData.Proto() pbStruct, ok := pbs.(*pb.ExecutionPayload) require.Equal(t, true, ok) require.DeepEqual(t, want, pbStruct) @@ -249,10 +250,10 @@ func TestClient_HTTP(t *testing.T) { client.rpcClient = rpcClient // We call the RPC method via HTTP and expect a proper result. - resp, _, override, err := client.GetPayload(ctx, payloadId, params.BeaconConfig().SlotsPerEpoch) + resp, err := client.GetPayload(ctx, payloadId, params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) - require.Equal(t, false, override) - pbs := resp.Proto() + require.Equal(t, false, resp.OverrideBuilder) + pbs := resp.ExecutionData.Proto() ep, ok := pbs.(*pb.ExecutionPayloadCapella) require.Equal(t, true, ok) require.DeepEqual(t, want.ExecutionPayload.BlockHash.Bytes(), ep.BlockHash) @@ -262,9 +263,7 @@ func TestClient_HTTP(t *testing.T) { require.DeepEqual(t, want.ExecutionPayload.PrevRandao.Bytes(), ep.PrevRandao) require.DeepEqual(t, want.ExecutionPayload.ParentHash.Bytes(), ep.ParentHash) - v, err := resp.ValueInGwei() - require.NoError(t, err) - require.Equal(t, uint64(1236), v) + require.Equal(t, primitives.Gwei(1236), primitives.WeiToGwei(resp.Bid)) }) t.Run(GetPayloadMethodV3, func(t *testing.T) { payloadId := [8]byte{1} @@ -304,22 +303,22 @@ func TestClient_HTTP(t *testing.T) { client.rpcClient = rpcClient // We call the RPC method via HTTP and expect a proper result. - resp, blobsBundle, override, err := client.GetPayload(ctx, payloadId, 2*params.BeaconConfig().SlotsPerEpoch) + resp, err := client.GetPayload(ctx, payloadId, 2*params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) - require.Equal(t, true, override) - g, err := resp.ExcessBlobGas() + require.Equal(t, true, resp.OverrideBuilder) + g, err := resp.ExecutionData.ExcessBlobGas() require.NoError(t, err) require.DeepEqual(t, uint64(3), g) - g, err = resp.BlobGasUsed() + g, err = resp.ExecutionData.BlobGasUsed() require.NoError(t, err) require.DeepEqual(t, uint64(2), g) commitments := [][]byte{bytesutil.PadTo([]byte("commitment1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("commitment2"), fieldparams.BLSPubkeyLength)} - require.DeepEqual(t, commitments, blobsBundle.KzgCommitments) + require.DeepEqual(t, commitments, resp.BlobsBundle.KzgCommitments) proofs := [][]byte{bytesutil.PadTo([]byte("proof1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("proof2"), fieldparams.BLSPubkeyLength)} - require.DeepEqual(t, proofs, blobsBundle.Proofs) + require.DeepEqual(t, proofs, resp.BlobsBundle.Proofs) blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} - require.DeepEqual(t, blobs, blobsBundle.Blobs) + require.DeepEqual(t, blobs, resp.BlobsBundle.Blobs) }) t.Run(GetPayloadMethodV4, func(t *testing.T) { payloadId := [8]byte{1} @@ -359,22 +358,22 @@ func TestClient_HTTP(t *testing.T) { client.rpcClient = rpcClient // We call the RPC method via HTTP and expect a proper result. - resp, blobsBundle, override, err := client.GetPayload(ctx, payloadId, 2*params.BeaconConfig().SlotsPerEpoch) + resp, err := client.GetPayload(ctx, payloadId, 2*params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) - require.Equal(t, true, override) - g, err := resp.ExcessBlobGas() + require.Equal(t, true, resp.OverrideBuilder) + g, err := resp.ExecutionData.ExcessBlobGas() require.NoError(t, err) require.DeepEqual(t, uint64(3), g) - g, err = resp.BlobGasUsed() + g, err = resp.ExecutionData.BlobGasUsed() require.NoError(t, err) require.DeepEqual(t, uint64(2), g) commitments := [][]byte{bytesutil.PadTo([]byte("commitment1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("commitment2"), fieldparams.BLSPubkeyLength)} - require.DeepEqual(t, commitments, blobsBundle.KzgCommitments) + require.DeepEqual(t, commitments, resp.BlobsBundle.KzgCommitments) proofs := [][]byte{bytesutil.PadTo([]byte("proof1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("proof2"), fieldparams.BLSPubkeyLength)} - require.DeepEqual(t, proofs, blobsBundle.Proofs) + require.DeepEqual(t, proofs, resp.BlobsBundle.Proofs) blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} - require.DeepEqual(t, blobs, blobsBundle.Blobs) + require.DeepEqual(t, blobs, resp.BlobsBundle.Blobs) }) t.Run(ForkchoiceUpdatedMethod+" VALID status", func(t *testing.T) { forkChoiceState := &pb.ForkchoiceState{ @@ -538,7 +537,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV2Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{}) require.NoError(t, err) @@ -552,7 +551,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV3Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.NoError(t, err) @@ -566,7 +565,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV4Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.NoError(t, err) @@ -594,7 +593,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV2Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{}) require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) @@ -608,7 +607,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV3Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) @@ -622,7 +621,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV4Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) @@ -650,7 +649,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV2Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{}) require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) @@ -664,7 +663,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV3Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) @@ -678,7 +677,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV4Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) @@ -706,7 +705,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV2Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadCapella(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{}) require.ErrorIs(t, ErrInvalidPayloadStatus, err) @@ -720,7 +719,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV3Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadDeneb(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.ErrorIs(t, ErrInvalidPayloadStatus, err) @@ -734,7 +733,7 @@ func TestClient_HTTP(t *testing.T) { client := newPayloadV4Setup(t, want, execPayload) // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload, big.NewInt(0)) + wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) require.NoError(t, err) resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) require.ErrorIs(t, ErrInvalidPayloadStatus, err) diff --git a/beacon-chain/execution/testing/BUILD.bazel b/beacon-chain/execution/testing/BUILD.bazel index 5f16365d157d..ba5b27f98f6a 100644 --- a/beacon-chain/execution/testing/BUILD.bazel +++ b/beacon-chain/execution/testing/BUILD.bazel @@ -25,7 +25,6 @@ go_library( "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//accounts/abi/bind/backends:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/beacon-chain/execution/testing/mock_engine_client.go b/beacon-chain/execution/testing/mock_engine_client.go index d6ca8b23f74d..5fd5c41bd25c 100644 --- a/beacon-chain/execution/testing/mock_engine_client.go +++ b/beacon-chain/execution/testing/mock_engine_client.go @@ -15,7 +15,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" - "github.com/prysmaticlabs/prysm/v5/time/slots" ) // EngineClient -- @@ -23,26 +22,20 @@ type EngineClient struct { NewPayloadResp []byte PayloadIDBytes *pb.PayloadIDBytes ForkChoiceUpdatedResp []byte - ExecutionPayload *pb.ExecutionPayload - ExecutionPayloadCapella *pb.ExecutionPayloadCapella - ExecutionPayloadDeneb *pb.ExecutionPayloadDeneb - ExecutionPayloadElectra *pb.ExecutionPayloadElectra ExecutionBlock *pb.ExecutionBlock Err error ErrLatestExecBlock error ErrExecBlockByHash error ErrForkchoiceUpdated error ErrNewPayload error - ErrGetPayload error ExecutionPayloadByBlockHash map[[32]byte]*pb.ExecutionPayload BlockByHashMap map[[32]byte]*pb.ExecutionBlock NumReconstructedPayloads uint64 TerminalBlockHash []byte TerminalBlockHashExists bool - BuilderOverride bool OverrideValidHash [32]byte - BlockValue uint64 - BlobsBundle *pb.BlobsBundle + GetPayloadResponse *blocks.GetPayloadResponse + ErrGetPayload error } // NewPayload -- @@ -61,33 +54,8 @@ func (e *EngineClient) ForkchoiceUpdated( } // GetPayload -- -func (e *EngineClient) GetPayload(_ context.Context, _ [8]byte, s primitives.Slot) (interfaces.ExecutionData, *pb.BlobsBundle, bool, error) { - if slots.ToEpoch(s) >= params.BeaconConfig().ElectraForkEpoch { - ed, err := blocks.WrappedExecutionPayloadElectra(e.ExecutionPayloadElectra, big.NewInt(int64(e.BlockValue))) - if err != nil { - return nil, nil, false, err - } - return ed, e.BlobsBundle, e.BuilderOverride, nil - } - if slots.ToEpoch(s) >= params.BeaconConfig().DenebForkEpoch { - ed, err := blocks.WrappedExecutionPayloadDeneb(e.ExecutionPayloadDeneb, big.NewInt(int64(e.BlockValue))) - if err != nil { - return nil, nil, false, err - } - return ed, e.BlobsBundle, e.BuilderOverride, nil - } - if slots.ToEpoch(s) >= params.BeaconConfig().CapellaForkEpoch { - ed, err := blocks.WrappedExecutionPayloadCapella(e.ExecutionPayloadCapella, big.NewInt(int64(e.BlockValue))) - if err != nil { - return nil, nil, false, err - } - return ed, nil, e.BuilderOverride, nil - } - p, err := blocks.WrappedExecutionPayload(e.ExecutionPayload) - if err != nil { - return nil, nil, false, err - } - return p, nil, e.BuilderOverride, e.ErrGetPayload +func (e *EngineClient) GetPayload(_ context.Context, _ [8]byte, s primitives.Slot) (*blocks.GetPayloadResponse, error) { + return e.GetPayloadResponse, e.ErrGetPayload } // LatestExecutionBlock -- diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go index e90f3859dde6..a4510e69eead 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block.go @@ -12,7 +12,7 @@ import ( ) // constructGenericBeaconBlock constructs a `GenericBeaconBlock` based on the block version and other parameters. -func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, blobsBundle *enginev1.BlobsBundle) (*ethpb.GenericBeaconBlock, error) { +func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, blobsBundle *enginev1.BlobsBundle, winningBid primitives.Wei) (*ethpb.GenericBeaconBlock, error) { if sBlk == nil || sBlk.Block() == nil { return nil, fmt.Errorf("block cannot be nil") } @@ -23,17 +23,17 @@ func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, } isBlinded := sBlk.IsBlinded() - payloadValue := sBlk.ValueInWei() + bidStr := primitives.WeiToBigInt(winningBid).String() switch sBlk.Version() { case version.Electra: - return vs.constructElectraBlock(blockProto, isBlinded, payloadValue, blobsBundle), nil + return vs.constructElectraBlock(blockProto, isBlinded, bidStr, blobsBundle), nil case version.Deneb: - return vs.constructDenebBlock(blockProto, isBlinded, payloadValue, blobsBundle), nil + return vs.constructDenebBlock(blockProto, isBlinded, bidStr, blobsBundle), nil case version.Capella: - return vs.constructCapellaBlock(blockProto, isBlinded, payloadValue), nil + return vs.constructCapellaBlock(blockProto, isBlinded, bidStr), nil case version.Bellatrix: - return vs.constructBellatrixBlock(blockProto, isBlinded, payloadValue), nil + return vs.constructBellatrixBlock(blockProto, isBlinded, bidStr), nil case version.Altair: return vs.constructAltairBlock(blockProto), nil case version.Phase0: @@ -44,42 +44,42 @@ func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock, } // Helper functions for constructing blocks for each version -func (vs *Server) constructElectraBlock(blockProto proto.Message, isBlinded bool, payloadValue primitives.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { +func (vs *Server) constructElectraBlock(blockProto proto.Message, isBlinded bool, payloadValue string, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { if isBlinded { - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedElectra{BlindedElectra: blockProto.(*ethpb.BlindedBeaconBlockElectra)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedElectra{BlindedElectra: blockProto.(*ethpb.BlindedBeaconBlockElectra)}, IsBlinded: true, PayloadValue: payloadValue} } electraContents := ðpb.BeaconBlockContentsElectra{Block: blockProto.(*ethpb.BeaconBlockElectra)} if bundle != nil { electraContents.KzgProofs = bundle.Proofs electraContents.Blobs = bundle.Blobs } - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Electra{Electra: electraContents}, IsBlinded: false, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Electra{Electra: electraContents}, IsBlinded: false, PayloadValue: payloadValue} } -func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue primitives.Wei, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { +func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue string, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock { if isBlinded { - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blockProto.(*ethpb.BlindedBeaconBlockDeneb)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blockProto.(*ethpb.BlindedBeaconBlockDeneb)}, IsBlinded: true, PayloadValue: payloadValue} } denebContents := ðpb.BeaconBlockContentsDeneb{Block: blockProto.(*ethpb.BeaconBlockDeneb)} if bundle != nil { denebContents.KzgProofs = bundle.Proofs denebContents.Blobs = bundle.Blobs } - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Deneb{Deneb: denebContents}, IsBlinded: false, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Deneb{Deneb: denebContents}, IsBlinded: false, PayloadValue: payloadValue} } -func (vs *Server) constructCapellaBlock(pb proto.Message, isBlinded bool, payloadValue primitives.Wei) *ethpb.GenericBeaconBlock { +func (vs *Server) constructCapellaBlock(pb proto.Message, isBlinded bool, payloadValue string) *ethpb.GenericBeaconBlock { if isBlinded { - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedCapella{BlindedCapella: pb.(*ethpb.BlindedBeaconBlockCapella)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedCapella{BlindedCapella: pb.(*ethpb.BlindedBeaconBlockCapella)}, IsBlinded: true, PayloadValue: payloadValue} } - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Capella{Capella: pb.(*ethpb.BeaconBlockCapella)}, IsBlinded: false, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Capella{Capella: pb.(*ethpb.BeaconBlockCapella)}, IsBlinded: false, PayloadValue: payloadValue} } -func (vs *Server) constructBellatrixBlock(pb proto.Message, isBlinded bool, payloadValue primitives.Wei) *ethpb.GenericBeaconBlock { +func (vs *Server) constructBellatrixBlock(pb proto.Message, isBlinded bool, payloadValue string) *ethpb.GenericBeaconBlock { if isBlinded { - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedBellatrix{BlindedBellatrix: pb.(*ethpb.BlindedBeaconBlockBellatrix)}, IsBlinded: true, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedBellatrix{BlindedBellatrix: pb.(*ethpb.BlindedBeaconBlockBellatrix)}, IsBlinded: true, PayloadValue: payloadValue} } - return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Bellatrix{Bellatrix: pb.(*ethpb.BeaconBlockBellatrix)}, IsBlinded: false, PayloadValue: (*payloadValue).String()} + return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Bellatrix{Bellatrix: pb.(*ethpb.BeaconBlockBellatrix)}, IsBlinded: false, PayloadValue: payloadValue} } func (vs *Server) constructAltairBlock(pb proto.Message) *ethpb.GenericBeaconBlock { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go index 53787b276df9..d3ecf2323e77 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go @@ -6,6 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -17,7 +18,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { // Test when sBlk or sBlk.Block() is nil t.Run("NilBlock", func(t *testing.T) { - _, err := vs.constructGenericBeaconBlock(nil, nil) + _, err := vs.constructGenericBeaconBlock(nil, nil, primitives.ZeroWei) require.ErrorContains(t, "block cannot be nil", err) }) @@ -38,7 +39,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { require.NoError(t, err) r1, err := eb.Block.HashTreeRoot() require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) require.NoError(t, err) r2, err := result.GetElectra().Block.HashTreeRoot() require.NoError(t, err) @@ -70,7 +71,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { contents := ð.BeaconBlockContentsDeneb{Block: eb.Block, KzgProofs: bundle.Proofs, Blobs: bundle.Blobs} r1, err := contents.HashTreeRoot() require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, bundle) + result, err := vs.constructGenericBeaconBlock(b, bundle, primitives.ZeroWei) require.NoError(t, err) r2, err := result.GetDeneb().HashTreeRoot() require.NoError(t, err) @@ -85,7 +86,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { r1, err := b.Block().HashTreeRoot() require.NoError(t, err) scs := &enginev1.BlobsBundle{} - result, err := vs.constructGenericBeaconBlock(b, scs) + result, err := vs.constructGenericBeaconBlock(b, scs, primitives.ZeroWei) require.NoError(t, err) r2, err := result.GetBlindedDeneb().HashTreeRoot() require.NoError(t, err) @@ -98,7 +99,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("capella block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) require.NoError(t, err) r1, err := result.GetCapella().HashTreeRoot() require.NoError(t, err) @@ -112,7 +113,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("blind capella block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBlindedBeaconBlockCapella()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) require.NoError(t, err) r1, err := result.GetBlindedCapella().HashTreeRoot() require.NoError(t, err) @@ -126,7 +127,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("bellatrix block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockBellatrix()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) require.NoError(t, err) r1, err := result.GetBellatrix().HashTreeRoot() require.NoError(t, err) @@ -140,7 +141,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("altair block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockAltair()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) require.NoError(t, err) r1, err := result.GetAltair().HashTreeRoot() require.NoError(t, err) @@ -154,7 +155,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("phase0 block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlock()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) require.NoError(t, err) r1, err := result.GetPhase0().HashTreeRoot() require.NoError(t, err) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 1a523edb9ade..5a07de13d243 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -11,6 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" emptypb "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" + builderapi "github.com/prysmaticlabs/prysm/v5/api/client/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" @@ -25,6 +26,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -40,7 +42,7 @@ var eth1DataNotification bool const ( eth1dataTimeout = 2 * time.Second - defaultBuilderBoostFactor = uint64(100) + defaultBuilderBoostFactor = primitives.Gwei(100) ) // GetBeaconBlock is called by a proposer during its assigned slot to request a block to sign @@ -93,27 +95,19 @@ func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) ( builderBoostFactor := defaultBuilderBoostFactor if req.BuilderBoostFactor != nil { - builderBoostFactor = req.BuilderBoostFactor.Value + builderBoostFactor = primitives.Gwei(req.BuilderBoostFactor.Value) } - if err = vs.BuildBlockParallel(ctx, sBlk, head, req.SkipMevBoost, builderBoostFactor); err != nil { - return nil, errors.Wrap(err, "could not build block in parallel") - } - - sr, err := vs.computeStateRoot(ctx, sBlk) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not compute state root: %v", err) - } - sBlk.SetStateRoot(sr) - + resp, err := vs.BuildBlockParallel(ctx, sBlk, head, req.SkipMevBoost, builderBoostFactor) log.WithFields(logrus.Fields{ "slot": req.Slot, "sinceSlotStartTime": time.Since(t), "validator": sBlk.Block().ProposerIndex(), }).Info("Finished building block") - - // Blob cache is updated after BuildBlockParallel - return vs.constructGenericBeaconBlock(sBlk, bundleCache.get(req.Slot)) + if err != nil { + return nil, errors.Wrap(err, "could not build block in parallel") + } + return resp, nil } func (vs *Server) handleSuccesfulReorgAttempt(ctx context.Context, slot primitives.Slot, parentRoot, headRoot [32]byte) (state.BeaconState, error) { @@ -184,7 +178,7 @@ func (vs *Server) getParentState(ctx context.Context, slot primitives.Slot) (sta return head, parentRoot, err } -func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.SignedBeaconBlock, head state.BeaconState, skipMevBoost bool, builderBoostFactor uint64) error { +func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.SignedBeaconBlock, head state.BeaconState, skipMevBoost bool, builderBoostFactor primitives.Gwei) (*ethpb.GenericBeaconBlock, error) { // Build consensus fields in background var wg sync.WaitGroup wg.Add(1) @@ -231,30 +225,39 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed vs.setBlsToExecData(sBlk, head) }() - localPayload, overrideBuilder, err := vs.getLocalPayload(ctx, sBlk.Block(), head) - if err != nil { - return status.Errorf(codes.Internal, "Could not get local payload: %v", err) - } + winningBid := primitives.ZeroWei + var bundle *enginev1.BlobsBundle + if sBlk.Version() >= version.Bellatrix { + local, err := vs.getLocalPayload(ctx, sBlk.Block(), head) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not get local payload: %v", err) + } + + // There's no reason to try to get a builder bid if local override is true. + var builderBid builderapi.Bid + if !(local.OverrideBuilder || skipMevBoost) { + builderBid, err = vs.getBuilderPayloadAndBlobs(ctx, sBlk.Block().Slot(), sBlk.Block().ProposerIndex()) + if err != nil { + builderGetPayloadMissCount.Inc() + log.WithError(err).Error("Could not get builder payload") + } + } - // There's no reason to try to get a builder bid if local override is true. - var builderPayload interfaces.ExecutionData - var builderKzgCommitments [][]byte - overrideBuilder = overrideBuilder || skipMevBoost // Skip using mev-boost if requested by the caller. - if !overrideBuilder { - builderPayload, builderKzgCommitments, err = vs.getBuilderPayloadAndBlobs(ctx, sBlk.Block().Slot(), sBlk.Block().ProposerIndex()) + winningBid, bundle, err = setExecutionData(ctx, sBlk, local, builderBid, builderBoostFactor) if err != nil { - builderGetPayloadMissCount.Inc() - log.WithError(err).Error("Could not get builder payload") + return nil, status.Errorf(codes.Internal, "Could not set execution data: %v", err) } } - if err := setExecutionData(ctx, sBlk, localPayload, builderPayload, builderKzgCommitments, builderBoostFactor); err != nil { - return status.Errorf(codes.Internal, "Could not set execution data: %v", err) - } + wg.Wait() - wg.Wait() // Wait until block is built via consensus and execution fields. + sr, err := vs.computeStateRoot(ctx, sBlk) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not compute state root: %v", err) + } + sBlk.SetStateRoot(sr) - return nil + return vs.constructGenericBeaconBlock(sBlk, bundle, winningBid) } // ProposeBeaconBlock handles the proposal of beacon blocks. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 907dbadf9132..925322ee7e8f 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "math/big" "strings" "time" @@ -14,12 +15,14 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/prysmaticlabs/prysm/v5/network/forks" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" @@ -50,47 +53,52 @@ var emptyTransactionsRoot = [32]byte{127, 254, 36, 30, 166, 1, 135, 253, 176, 24 const blockBuilderTimeout = 1 * time.Second // Sets the execution data for the block. Execution data can come from local EL client or remote builder depends on validator registration and circuit breaker conditions. -func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, localPayload, builderPayload interfaces.ExecutionData, builderKzgCommitments [][]byte, builderBoostFactor uint64) error { +func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, local *blocks.GetPayloadResponse, bid builder.Bid, builderBoostFactor primitives.Gwei) (primitives.Wei, *enginev1.BlobsBundle, error) { _, span := trace.StartSpan(ctx, "ProposerServer.setExecutionData") defer span.End() slot := blk.Block().Slot() if slots.ToEpoch(slot) < params.BeaconConfig().BellatrixForkEpoch { - return nil + return primitives.ZeroWei, nil, nil } - if localPayload == nil { - return errors.New("local payload is nil") + if local == nil { + return primitives.ZeroWei, nil, errors.New("local payload is nil") } // Use local payload if builder payload is nil. - if builderPayload == nil { - return setLocalExecution(blk, localPayload) + if bid == nil { + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) } - switch { - case blk.Version() >= version.Capella: - // Compare payload values between local and builder. Default to the local value if it is higher. - localValueGwei, err := localPayload.ValueInGwei() - if err != nil { - return errors.Wrap(err, "failed to get local payload value") - } - builderValueGwei, err := builderPayload.ValueInGwei() + var builderKzgCommitments [][]byte + builderPayload, err := bid.Header() + if err != nil { + log.WithError(err).Warn("Proposer: failed to retrieve header from BuilderBid") + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) + } + if bid.Version() >= version.Deneb { + builderKzgCommitments, err = bid.BlobKzgCommitments() if err != nil { - log.WithError(err).Warn("Proposer: failed to get builder payload value") // Default to local if can't get builder value. - return setLocalExecution(blk, localPayload) + log.WithError(err).Warn("Proposer: failed to retrieve kzg commitments from BuilderBid") } + } - withdrawalsMatched, err := matchingWithdrawalsRoot(localPayload, builderPayload) + switch { + case blk.Version() >= version.Capella: + withdrawalsMatched, err := matchingWithdrawalsRoot(local.ExecutionData, builderPayload) if err != nil { tracing.AnnotateError(span, err) log.WithError(err).Warn("Proposer: failed to match withdrawals root") - return setLocalExecution(blk, localPayload) + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) } + // Compare payload values between local and builder. Default to the local value if it is higher. + localValueGwei := primitives.WeiToGwei(local.Bid) + builderValueGwei := primitives.WeiToGwei(bid.Value()) // Use builder payload if the following in true: // builder_bid_value * builderBoostFactor(default 100) > local_block_value * (local-block-value-boost + 100) - boost := params.BeaconConfig().LocalBlockValueBoost + boost := primitives.Gwei(params.BeaconConfig().LocalBlockValueBoost) higherValueBuilder := builderValueGwei*builderBoostFactor > localValueGwei*(100+boost) if boost > 0 && builderBoostFactor != defaultBuilderBoostFactor { log.WithFields(logrus.Fields{ @@ -107,9 +115,9 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc if higherValueBuilder && withdrawalsMatched { // Builder value is higher and withdrawals match. if err := setBuilderExecution(blk, builderPayload, builderKzgCommitments); err != nil { log.WithError(err).Warn("Proposer: failed to set builder payload") - return setLocalExecution(blk, localPayload) + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) } else { - return nil + return bid.Value(), nil, nil } } if !higherValueBuilder { @@ -127,39 +135,39 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc trace.Int64Attribute("builderGweiValue", int64(builderValueGwei)), // lint:ignore uintcast -- This is OK for tracing. trace.Int64Attribute("builderBoostFactor", int64(builderBoostFactor)), // lint:ignore uintcast -- This is OK for tracing. ) - return setLocalExecution(blk, localPayload) + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) default: // Bellatrix case. if err := setBuilderExecution(blk, builderPayload, builderKzgCommitments); err != nil { log.WithError(err).Warn("Proposer: failed to set builder payload") - return setLocalExecution(blk, localPayload) + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) } else { - return nil + return bid.Value(), nil, nil } } } // This function retrieves the payload header and kzg commitments given the slot number and the validator index. // It's a no-op if the latest head block is not versioned bellatrix. -func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitives.Slot, idx primitives.ValidatorIndex) (interfaces.ExecutionData, [][]byte, error) { +func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitives.Slot, idx primitives.ValidatorIndex) (builder.Bid, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.getPayloadHeaderFromBuilder") defer span.End() if slots.ToEpoch(slot) < params.BeaconConfig().BellatrixForkEpoch { - return nil, nil, errors.New("can't get payload header from builder before bellatrix epoch") + return nil, errors.New("can't get payload header from builder before bellatrix epoch") } b, err := vs.HeadFetcher.HeadBlock(ctx) if err != nil { - return nil, nil, err + return nil, err } h, err := b.Block().Body().Execution() if err != nil { - return nil, nil, errors.Wrap(err, "failed to get execution header") + return nil, errors.Wrap(err, "failed to get execution header") } pk, err := vs.HeadFetcher.HeadValidatorIndexToPublicKey(ctx, idx) if err != nil { - return nil, nil, err + return nil, err } ctx, cancel := context.WithTimeout(ctx, blockBuilderTimeout) @@ -167,76 +175,76 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv signedBid, err := vs.BlockBuilder.GetHeader(ctx, slot, bytesutil.ToBytes32(h.BlockHash()), pk) if err != nil { - return nil, nil, err + return nil, err } if signedBid.IsNil() { - return nil, nil, errors.New("builder returned nil bid") + return nil, errors.New("builder returned nil bid") } fork, err := forks.Fork(slots.ToEpoch(slot)) if err != nil { - return nil, nil, errors.Wrap(err, "unable to get fork information") + return nil, errors.Wrap(err, "unable to get fork information") } forkName, ok := params.BeaconConfig().ForkVersionNames[bytesutil.ToBytes4(fork.CurrentVersion)] if !ok { - return nil, nil, errors.New("unable to find current fork in schedule") + return nil, errors.New("unable to find current fork in schedule") } if !strings.EqualFold(version.String(signedBid.Version()), forkName) { - return nil, nil, fmt.Errorf("builder bid response version: %d is different from head block version: %d for epoch %d", signedBid.Version(), b.Version(), slots.ToEpoch(slot)) + return nil, fmt.Errorf("builder bid response version: %d is different from head block version: %d for epoch %d", signedBid.Version(), b.Version(), slots.ToEpoch(slot)) } bid, err := signedBid.Message() if err != nil { - return nil, nil, errors.Wrap(err, "could not get bid") + return nil, errors.Wrap(err, "could not get bid") } if bid.IsNil() { - return nil, nil, errors.New("builder returned nil bid") + return nil, errors.New("builder returned nil bid") } - v := bytesutil.LittleEndianBytesToBigInt(bid.Value()) - if v.String() == "0" { - return nil, nil, errors.New("builder returned header with 0 bid amount") + v := bid.Value() + if big.NewInt(0).Cmp(v) == 0 { + return nil, errors.New("builder returned header with 0 bid amount") } header, err := bid.Header() if err != nil { - return nil, nil, errors.Wrap(err, "could not get bid header") + return nil, errors.Wrap(err, "could not get bid header") } txRoot, err := header.TransactionsRoot() if err != nil { - return nil, nil, errors.Wrap(err, "could not get transaction root") + return nil, errors.Wrap(err, "could not get transaction root") } if bytesutil.ToBytes32(txRoot) == emptyTransactionsRoot { - return nil, nil, errors.New("builder returned header with an empty tx root") + return nil, errors.New("builder returned header with an empty tx root") } if !bytes.Equal(header.ParentHash(), h.BlockHash()) { - return nil, nil, fmt.Errorf("incorrect parent hash %#x != %#x", header.ParentHash(), h.BlockHash()) + return nil, fmt.Errorf("incorrect parent hash %#x != %#x", header.ParentHash(), h.BlockHash()) } t, err := slots.ToTime(uint64(vs.TimeFetcher.GenesisTime().Unix()), slot) if err != nil { - return nil, nil, err + return nil, err } if header.Timestamp() != uint64(t.Unix()) { - return nil, nil, fmt.Errorf("incorrect timestamp %d != %d", header.Timestamp(), uint64(t.Unix())) + return nil, fmt.Errorf("incorrect timestamp %d != %d", header.Timestamp(), uint64(t.Unix())) } if err := validateBuilderSignature(signedBid); err != nil { - return nil, nil, errors.Wrap(err, "could not validate builder signature") + return nil, errors.Wrap(err, "could not validate builder signature") } var kzgCommitments [][]byte if bid.Version() >= version.Deneb { kzgCommitments, err = bid.BlobKzgCommitments() if err != nil { - return nil, nil, errors.Wrap(err, "could not get blob kzg commitments") + return nil, errors.Wrap(err, "could not get blob kzg commitments") } if len(kzgCommitments) > fieldparams.MaxBlobsPerBlock { - return nil, nil, fmt.Errorf("builder returned too many kzg commitments: %d", len(kzgCommitments)) + return nil, fmt.Errorf("builder returned too many kzg commitments: %d", len(kzgCommitments)) } for _, c := range kzgCommitments { if len(c) != fieldparams.BLSPubkeyLength { - return nil, nil, fmt.Errorf("builder returned invalid kzg commitment length: %d", len(c)) + return nil, fmt.Errorf("builder returned invalid kzg commitment length: %d", len(c)) } } } @@ -255,12 +263,12 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv l.Info("Received header with bid") span.AddAttributes( - trace.StringAttribute("value", v.String()), + trace.StringAttribute("value", primitives.WeiToBigInt(v).String()), trace.StringAttribute("builderPubKey", fmt.Sprintf("%#x", bid.Pubkey())), trace.StringAttribute("blockHash", fmt.Sprintf("%#x", header.BlockHash())), ) - return header, kzgCommitments, nil + return bid, nil } // Validates builder signature and returns an error if the signature is invalid. @@ -310,13 +318,12 @@ func matchingWithdrawalsRoot(local, builder interfaces.ExecutionData) (bool, err // setLocalExecution sets the execution context for a local beacon block. // It delegates to setExecution for the actual work. -func setLocalExecution(blk interfaces.SignedBeaconBlock, execution interfaces.ExecutionData) error { +func setLocalExecution(blk interfaces.SignedBeaconBlock, local *blocks.GetPayloadResponse) error { var kzgCommitments [][]byte - fullBlobsBundle := bundleCache.get(blk.Block().Slot()) - if fullBlobsBundle != nil { - kzgCommitments = fullBlobsBundle.KzgCommitments + if local.BlobsBundle != nil { + kzgCommitments = local.BlobsBundle.KzgCommitments } - return setExecution(blk, execution, false, kzgCommitments) + return setExecution(blk, local.ExecutionData, false, kzgCommitments) } // setBuilderExecution sets the execution context for a builder's beacon block. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go index 7dae54bfaa89..3647973d37d2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go @@ -28,6 +28,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/ssz" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -46,7 +47,7 @@ func TestServer_setExecutionData(t *testing.T) { beaconDB := dbTest.SetupDB(t) capellaTransitionState, _ := util.DeterministicGenesisStateCapella(t, 1) - wrappedHeaderCapella, err := blocks.WrappedExecutionPayloadHeaderCapella(&v1.ExecutionPayloadHeaderCapella{BlockNumber: 1}, big.NewInt(0)) + wrappedHeaderCapella, err := blocks.WrappedExecutionPayloadHeaderCapella(&v1.ExecutionPayloadHeaderCapella{BlockNumber: 1}) require.NoError(t, err) require.NoError(t, capellaTransitionState.SetLatestExecutionPayloadHeader(wrappedHeaderCapella)) b2pbCapella := util.NewBeaconBlockCapella() @@ -59,7 +60,7 @@ func TestServer_setExecutionData(t *testing.T) { require.NoError(t, beaconDB.SaveFeeRecipientsByValidatorIDs(context.Background(), []primitives.ValidatorIndex{0}, []common.Address{{}})) denebTransitionState, _ := util.DeterministicGenesisStateDeneb(t, 1) - wrappedHeaderDeneb, err := blocks.WrappedExecutionPayloadHeaderDeneb(&v1.ExecutionPayloadHeaderDeneb{BlockNumber: 2}, big.NewInt(0)) + wrappedHeaderDeneb, err := blocks.WrappedExecutionPayloadHeaderDeneb(&v1.ExecutionPayloadHeaderDeneb{BlockNumber: 2}) require.NoError(t, err) require.NoError(t, denebTransitionState.SetLatestExecutionPayloadHeader(wrappedHeaderDeneb)) b2pbDeneb := util.NewBeaconBlockDeneb() @@ -77,8 +78,14 @@ func TestServer_setExecutionData(t *testing.T) { Amount: 3, }} id := &v1.PayloadIDBytes{0x1} + + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadCapella{BlockNumber: 1, Withdrawals: withdrawals}) + require.NoError(t, err) vs := &Server{ - ExecutionEngineCaller: &powtesting.EngineClient{PayloadIDBytes: id, ExecutionPayloadCapella: &v1.ExecutionPayloadCapella{BlockNumber: 1, Withdrawals: withdrawals}, BlockValue: 0}, + ExecutionEngineCaller: &powtesting.EngineClient{ + GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}, + PayloadIDBytes: id, + }, HeadFetcher: &blockchainTest.ChainService{State: capellaTransitionState}, FinalizationFetcher: &blockchainTest.ChainService{}, BeaconDB: beaconDB, @@ -92,12 +99,14 @@ func TestServer_setExecutionData(t *testing.T) { blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) require.NoError(t, err) b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + require.IsNil(t, builderBid) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(1), e.BlockNumber()) // Local block @@ -153,12 +162,20 @@ func TestServer_setExecutionData(t *testing.T) { vs.HeadFetcher = chain b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + require.NoError(t, err) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + _, err = builderBid.Header() require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(1), e.BlockNumber()) // Local block because incorrect withdrawals @@ -217,12 +234,20 @@ func TestServer_setExecutionData(t *testing.T) { vs.HeadFetcher = chain b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + require.NoError(t, err) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + _, err = builderBid.Header() + require.NoError(t, err) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(2), e.BlockNumber()) // Builder block @@ -280,12 +305,20 @@ func TestServer_setExecutionData(t *testing.T) { vs.HeadFetcher = chain b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + require.NoError(t, err) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + require.NoError(t, err) + _, err = builderBid.Header() require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, math.MaxUint64) require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, math.MaxUint64)) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(2), e.BlockNumber()) // builder block @@ -343,12 +376,20 @@ func TestServer_setExecutionData(t *testing.T) { vs.HeadFetcher = chain b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + require.NoError(t, err) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + _, err = builderBid.Header() require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, 0)) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, 0) + require.NoError(t, err) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(1), e.BlockNumber()) // local block @@ -356,14 +397,25 @@ func TestServer_setExecutionData(t *testing.T) { t.Run("Builder configured. Local block has higher value", func(t *testing.T) { blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) require.NoError(t, err) - vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, ExecutionPayloadCapella: &v1.ExecutionPayloadCapella{BlockNumber: 3}, BlockValue: 2 * 1e9} + elBid := primitives.Uint64ToWei(2 * 1e9) + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadCapella{BlockNumber: 3}) + require.NoError(t, err) + vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed, Bid: elBid}} b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + require.NoError(t, err) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + _, err = builderBid.Header() require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(3), e.BlockNumber()) // Local block @@ -377,14 +429,26 @@ func TestServer_setExecutionData(t *testing.T) { blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) require.NoError(t, err) - vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, ExecutionPayloadCapella: &v1.ExecutionPayloadCapella{BlockNumber: 3}, BlockValue: 1 * 1e9} + elBid := primitives.Uint64ToWei(1 * 1e9) + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadCapella{BlockNumber: 3}) + require.NoError(t, err) + + vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed, Bid: elBid}} b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.NoError(t, err) - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + _, err = builderBid.Header() + require.NoError(t, err) + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(3), e.BlockNumber()) // Local block @@ -399,14 +463,18 @@ func TestServer_setExecutionData(t *testing.T) { HasConfigured: true, Cfg: &builderTest.Config{BeaconDB: beaconDB}, } - vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, ExecutionPayloadCapella: &v1.ExecutionPayloadCapella{BlockNumber: 4}, BlockValue: 0} + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadCapella{BlockNumber: 4}) + require.NoError(t, err) + vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}} b := blk.Block() - localPayload, _, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) require.ErrorIs(t, consensus_types.ErrNilObjectWrapped, err) // Builder returns fault. Use local block - require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + require.IsNil(t, builderBid) + _, bundle, err := setExecutionData(context.Background(), blk, res, nil, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) e, err := blk.Block().Body().Execution() require.NoError(t, err) require.Equal(t, uint64(4), e.BlockNumber()) // Local block @@ -428,17 +496,21 @@ func TestServer_setExecutionData(t *testing.T) { Proofs: [][]byte{{4, 5, 6}}, Blobs: [][]byte{{7, 8, 9}}, } + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadDeneb{BlockNumber: 4}) + require.NoError(t, err) vs.ExecutionEngineCaller = &powtesting.EngineClient{ - PayloadIDBytes: id, - BlobsBundle: blobsBundle, - ExecutionPayloadDeneb: &v1.ExecutionPayloadDeneb{BlockNumber: 4}, - BlockValue: 0} + PayloadIDBytes: id, + GetPayloadResponse: &blocks.GetPayloadResponse{ + ExecutionData: ed, + BlobsBundle: blobsBundle, + Bid: primitives.ZeroWei, + }, + } blk.SetSlot(primitives.Slot(params.BeaconConfig().DenebForkEpoch) * params.BeaconConfig().SlotsPerEpoch) - localPayload, _, err := vs.getLocalPayload(ctx, blk.Block(), capellaTransitionState) + res, err := vs.getLocalPayload(ctx, blk.Block(), capellaTransitionState) require.NoError(t, err) - require.Equal(t, uint64(4), localPayload.BlockNumber()) - cachedBundle := bundleCache.get(blk.Block().Slot()) - require.DeepEqual(t, cachedBundle, blobsBundle) + require.Equal(t, uint64(4), res.ExecutionData.BlockNumber()) + require.DeepEqual(t, res.BlobsBundle, blobsBundle) }) t.Run("Can get builder payload and blobs in Deneb", func(t *testing.T) { cfg := params.BeaconConfig().Copy() @@ -502,19 +574,31 @@ func TestServer_setExecutionData(t *testing.T) { vs.ForkchoiceFetcher.SetForkChoiceGenesisTime(uint64(time.Now().Unix())) vs.TimeFetcher = chain vs.HeadFetcher = chain - vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, ExecutionPayloadDeneb: &v1.ExecutionPayloadDeneb{BlockNumber: 4, Withdrawals: withdrawals}, BlockValue: 0} + + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadDeneb{BlockNumber: 4, Withdrawals: withdrawals}) + require.NoError(t, err) + vs.ExecutionEngineCaller = &powtesting.EngineClient{ + PayloadIDBytes: id, + GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}, + } require.NoError(t, err) blk.SetSlot(primitives.Slot(params.BeaconConfig().DenebForkEpoch) * params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) - builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, blk.Block().Slot(), blk.Block().ProposerIndex()) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, blk.Block().Slot(), blk.Block().ProposerIndex()) + require.NoError(t, err) + builderPayload, err := builderBid.Header() + require.NoError(t, err) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() require.NoError(t, err) require.DeepEqual(t, bid.BlobKzgCommitments, builderKzgCommitments) require.Equal(t, bid.Header.BlockNumber, builderPayload.BlockNumber()) // header should be the same from block - localPayload, _, err := vs.getLocalPayload(ctx, blk.Block(), denebTransitionState) + res, err := vs.getLocalPayload(ctx, blk.Block(), denebTransitionState) require.NoError(t, err) - require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, defaultBuilderBoostFactor)) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) got, err := blk.Block().Body().BlobKzgCommitments() require.NoError(t, err) @@ -737,10 +821,12 @@ func TestServer_getPayloadHeader(t *testing.T) { }} hb, err := vs.HeadFetcher.HeadBlock(context.Background()) require.NoError(t, err) - h, _, err := vs.getPayloadHeaderFromBuilder(context.Background(), hb.Block().Slot(), 0) + bid, err := vs.getPayloadHeaderFromBuilder(context.Background(), hb.Block().Slot(), 0) if tc.err != "" { require.ErrorContains(t, tc.err, err) } else { + require.NoError(t, err) + h, err := bid.Header() require.NoError(t, err) if tc.returnedHeader != nil { want, err := blocks.WrappedExecutionPayloadHeader(tc.returnedHeader) @@ -748,7 +834,7 @@ func TestServer_getPayloadHeader(t *testing.T) { require.DeepEqual(t, want, h) } if tc.returnedHeaderCapella != nil { - want, err := blocks.WrappedExecutionPayloadHeaderCapella(tc.returnedHeaderCapella, big.NewInt(197121)) // value is a mock + want, err := blocks.WrappedExecutionPayloadHeaderCapella(tc.returnedHeaderCapella) // value is a mock require.NoError(t, err) require.DeepEqual(t, want, h) } @@ -805,7 +891,7 @@ func Test_matchingWithdrawalsRoot(t *testing.T) { }) t.Run("could not get builder withdrawals root", func(t *testing.T) { local := &v1.ExecutionPayloadCapella{} - p, err := blocks.WrappedExecutionPayloadCapella(local, big.NewInt(0)) + p, err := blocks.WrappedExecutionPayloadCapella(local) require.NoError(t, err) header := &v1.ExecutionPayloadHeader{} h, err := blocks.WrappedExecutionPayloadHeader(header) @@ -815,10 +901,10 @@ func Test_matchingWithdrawalsRoot(t *testing.T) { }) t.Run("withdrawals mismatch", func(t *testing.T) { local := &v1.ExecutionPayloadCapella{} - p, err := blocks.WrappedExecutionPayloadCapella(local, big.NewInt(0)) + p, err := blocks.WrappedExecutionPayloadCapella(local) require.NoError(t, err) header := &v1.ExecutionPayloadHeaderCapella{} - h, err := blocks.WrappedExecutionPayloadHeaderCapella(header, big.NewInt(0)) + h, err := blocks.WrappedExecutionPayloadHeaderCapella(header) require.NoError(t, err) matched, err := matchingWithdrawalsRoot(p, h) require.NoError(t, err) @@ -832,13 +918,13 @@ func Test_matchingWithdrawalsRoot(t *testing.T) { Amount: 3, }} local := &v1.ExecutionPayloadCapella{Withdrawals: wds} - p, err := blocks.WrappedExecutionPayloadCapella(local, big.NewInt(0)) + p, err := blocks.WrappedExecutionPayloadCapella(local) require.NoError(t, err) header := &v1.ExecutionPayloadHeaderCapella{} wr, err := ssz.WithdrawalSliceRoot(wds, fieldparams.MaxWithdrawalsPerPayload) require.NoError(t, err) header.WithdrawalsRoot = wr[:] - h, err := blocks.WrappedExecutionPayloadHeaderCapella(header, big.NewInt(0)) + h, err := blocks.WrappedExecutionPayloadHeaderCapella(header) require.NoError(t, err) matched, err := matchingWithdrawalsRoot(p, h) require.NoError(t, err) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 8f75edef34b3..78db18d85c14 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/prysmaticlabs/prysm/v5/api/client/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" @@ -47,12 +48,12 @@ func setFeeRecipientIfBurnAddress(val *cache.TrackedValidator) { } // This returns the local execution payload of a given slot. The function has full awareness of pre and post merge. -func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState) (interfaces.ExecutionData, bool, error) { +func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState) (*consensusblocks.GetPayloadResponse, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.getLocalPayload") defer span.End() if blk.Version() < version.Bellatrix { - return nil, false, nil + return nil, nil } slot := blk.Slot() @@ -77,34 +78,31 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe var pid primitives.PayloadID copy(pid[:], payloadId[:]) payloadIDCacheHit.Inc() - payload, bundle, overrideBuilder, err := vs.ExecutionEngineCaller.GetPayload(ctx, pid, slot) - switch { - case err == nil: - bundleCache.add(slot, bundle) - warnIfFeeRecipientDiffers(payload, val.FeeRecipient) - return payload, overrideBuilder, nil - case errors.Is(err, context.DeadlineExceeded): - default: - return nil, false, errors.Wrap(err, "could not get cached payload from execution client") + res, err := vs.ExecutionEngineCaller.GetPayload(ctx, pid, slot) + if err == nil { + warnIfFeeRecipientDiffers(val.FeeRecipient[:], res.ExecutionData.FeeRecipient()) + return res, nil + } + // TODO: TestServer_getExecutionPayloadContextTimeout expects this behavior. + // We need to figure out if it is actually important to "retry" by falling through to the code below when + // we get a timeout when trying to retrieve the cached payload id. + if !errors.Is(err, context.DeadlineExceeded) { + return nil, errors.Wrap(err, "could not get cached payload from execution client") } } log.WithFields(logFields).Debug("payload ID cache miss") parentHash, err := vs.getParentBlockHash(ctx, st, slot) switch { case errors.Is(err, errActivationNotReached) || errors.Is(err, errNoTerminalBlockHash): - p, err := consensusblocks.WrappedExecutionPayload(emptyPayload()) - if err != nil { - return nil, false, err - } - return p, false, nil + return consensusblocks.NewGetPayloadResponse(emptyPayload()) case err != nil: - return nil, false, err + return nil, err } payloadIDCacheMiss.Inc() random, err := helpers.RandaoMix(st, time.CurrentEpoch(st)) if err != nil { - return nil, false, err + return nil, err } finalizedBlockHash := [32]byte{} @@ -123,14 +121,14 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe t, err := slots.ToTime(st.GenesisTime(), slot) if err != nil { - return nil, false, err + return nil, err } var attr payloadattribute.Attributer switch st.Version() { case version.Deneb, version.Electra: withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { - return nil, false, err + return nil, err } attr, err = payloadattribute.New(&enginev1.PayloadAttributesV3{ Timestamp: uint64(t.Unix()), @@ -140,12 +138,12 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe ParentBeaconBlockRoot: headRoot[:], }) if err != nil { - return nil, false, err + return nil, err } case version.Capella: withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { - return nil, false, err + return nil, err } attr, err = payloadattribute.New(&enginev1.PayloadAttributesV2{ Timestamp: uint64(t.Unix()), @@ -154,7 +152,7 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe Withdrawals: withdrawals, }) if err != nil { - return nil, false, err + return nil, err } case version.Bellatrix: attr, err = payloadattribute.New(&enginev1.PayloadAttributes{ @@ -163,39 +161,35 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe SuggestedFeeRecipient: val.FeeRecipient[:], }) if err != nil { - return nil, false, err + return nil, err } default: - return nil, false, errors.New("unknown beacon state version") + return nil, errors.New("unknown beacon state version") } payloadID, _, err := vs.ExecutionEngineCaller.ForkchoiceUpdated(ctx, f, attr) if err != nil { - return nil, false, errors.Wrap(err, "could not prepare payload") + return nil, errors.Wrap(err, "could not prepare payload") } if payloadID == nil { - return nil, false, fmt.Errorf("nil payload with block hash: %#x", parentHash) + return nil, fmt.Errorf("nil payload with block hash: %#x", parentHash) } - payload, bundle, overrideBuilder, err := vs.ExecutionEngineCaller.GetPayload(ctx, *payloadID, slot) + res, err := vs.ExecutionEngineCaller.GetPayload(ctx, *payloadID, slot) if err != nil { - return nil, false, err - } - bundleCache.add(slot, bundle) - warnIfFeeRecipientDiffers(payload, val.FeeRecipient) - localValueGwei, err := payload.ValueInGwei() - if err == nil { - log.WithField("value", localValueGwei).Debug("received execution payload from local engine") + return nil, err } - return payload, overrideBuilder, nil + + warnIfFeeRecipientDiffers(val.FeeRecipient[:], res.ExecutionData.FeeRecipient()) + log.WithField("value", res.Bid).Debug("received execution payload from local engine") + return res, nil } -// warnIfFeeRecipientDiffers logs a warning if the fee recipient in the included payload does not -// match the requested one. -func warnIfFeeRecipientDiffers(payload interfaces.ExecutionData, feeRecipient primitives.ExecutionAddress) { - // Warn if the fee recipient is not the value we expect. - if payload != nil && !bytes.Equal(payload.FeeRecipient(), feeRecipient[:]) { +// warnIfFeeRecipientDiffers logs a warning if the fee recipient in the payload (eg the EL engine get payload response) does not +// match what was expected (eg the fee recipient previously used to request preparation of the payload). +func warnIfFeeRecipientDiffers(want, got []byte) { + if !bytes.Equal(want, got) { logrus.WithFields(logrus.Fields{ - "wantedFeeRecipient": fmt.Sprintf("%#x", feeRecipient), - "received": fmt.Sprintf("%#x", payload.FeeRecipient()), + "wantedFeeRecipient": fmt.Sprintf("%#x", want), + "received": fmt.Sprintf("%#x", got), }).Warn("Fee recipient address from execution client is not what was expected. " + "It is possible someone has compromised your client to try and take your transaction fees") } @@ -234,20 +228,20 @@ func (vs *Server) getTerminalBlockHashIfExists(ctx context.Context, transitionTi func (vs *Server) getBuilderPayloadAndBlobs(ctx context.Context, slot primitives.Slot, - vIdx primitives.ValidatorIndex) (interfaces.ExecutionData, [][]byte, error) { + vIdx primitives.ValidatorIndex) (builder.Bid, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.getBuilderPayloadAndBlobs") defer span.End() if slots.ToEpoch(slot) < params.BeaconConfig().BellatrixForkEpoch { - return nil, nil, nil + return nil, nil } canUseBuilder, err := vs.canUseBuilder(ctx, slot, vIdx) if err != nil { - return nil, nil, errors.Wrap(err, "failed to check if we can use the builder") + return nil, errors.Wrap(err, "failed to check if we can use the builder") } span.AddAttributes(trace.BoolAttribute("canUseBuilder", canUseBuilder)) if !canUseBuilder { - return nil, nil, nil + return nil, nil } return vs.getPayloadHeaderFromBuilder(ctx, slot, vIdx) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload_test.go index 33369d681fe4..ac52476d166e 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload_test.go @@ -3,7 +3,6 @@ package validator import ( "context" "errors" - "math/big" "testing" "github.com/ethereum/go-ethereum/common" @@ -61,7 +60,7 @@ func TestServer_getExecutionPayload(t *testing.T) { })) capellaTransitionState, _ := util.DeterministicGenesisStateCapella(t, 1) - wrappedHeaderCapella, err := blocks.WrappedExecutionPayloadHeaderCapella(&pb.ExecutionPayloadHeaderCapella{BlockNumber: 1}, big.NewInt(0)) + wrappedHeaderCapella, err := blocks.WrappedExecutionPayloadHeaderCapella(&pb.ExecutionPayloadHeaderCapella{BlockNumber: 1}) require.NoError(t, err) require.NoError(t, capellaTransitionState.SetLatestExecutionPayloadHeader(wrappedHeaderCapella)) b2pbCapella := util.NewBeaconBlockCapella() @@ -146,8 +145,10 @@ func TestServer_getExecutionPayload(t *testing.T) { cfg.TerminalBlockHashActivationEpoch = tt.activationEpoch params.OverrideBeaconConfig(cfg) + ed, err := blocks.NewWrappedExecutionData(&pb.ExecutionPayload{}) + require.NoError(t, err) vs := &Server{ - ExecutionEngineCaller: &powtesting.EngineClient{PayloadIDBytes: tt.payloadID, ErrForkchoiceUpdated: tt.forkchoiceErr, ExecutionPayload: &pb.ExecutionPayload{}, BuilderOverride: tt.override}, + ExecutionEngineCaller: &powtesting.EngineClient{PayloadIDBytes: tt.payloadID, ErrForkchoiceUpdated: tt.forkchoiceErr, GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed, OverrideBuilder: tt.override}}, HeadFetcher: &chainMock.ChainService{State: tt.st}, FinalizationFetcher: &chainMock.ChainService{}, BeaconDB: beaconDB, @@ -164,12 +165,11 @@ func TestServer_getExecutionPayload(t *testing.T) { blk.Block.ParentRoot = bytesutil.PadTo([]byte{'a'}, 32) b, err := blocks.NewSignedBeaconBlock(blk) require.NoError(t, err) - var gotOverride bool - _, gotOverride, err = vs.getLocalPayload(context.Background(), b.Block(), tt.st) + res, err := vs.getLocalPayload(context.Background(), b.Block(), tt.st) if tt.errString != "" { require.ErrorContains(t, tt.errString, err) } else { - require.Equal(t, tt.wantedOverride, gotOverride) + require.Equal(t, tt.wantedOverride, res.OverrideBuilder) require.NoError(t, err) } }) @@ -194,8 +194,10 @@ func TestServer_getExecutionPayloadContextTimeout(t *testing.T) { cfg.TerminalBlockHashActivationEpoch = 1 params.OverrideBeaconConfig(cfg) + ed, err := blocks.NewWrappedExecutionData(&pb.ExecutionPayload{}) + require.NoError(t, err) vs := &Server{ - ExecutionEngineCaller: &powtesting.EngineClient{PayloadIDBytes: &pb.PayloadIDBytes{}, ErrGetPayload: context.DeadlineExceeded, ExecutionPayload: &pb.ExecutionPayload{}}, + ExecutionEngineCaller: &powtesting.EngineClient{PayloadIDBytes: &pb.PayloadIDBytes{}, ErrGetPayload: context.DeadlineExceeded, GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}}, HeadFetcher: &chainMock.ChainService{State: nonTransitionSt}, BeaconDB: beaconDB, PayloadIDCache: cache.NewPayloadIDCache(), @@ -209,7 +211,7 @@ func TestServer_getExecutionPayloadContextTimeout(t *testing.T) { blk.Block.ParentRoot = bytesutil.PadTo([]byte{'a'}, 32) b, err := blocks.NewSignedBeaconBlock(blk) require.NoError(t, err) - _, _, err = vs.getLocalPayload(context.Background(), b.Block(), nonTransitionSt) + _, err = vs.getLocalPayload(context.Background(), b.Block(), nonTransitionSt) require.NoError(t, err) } @@ -241,10 +243,12 @@ func TestServer_getExecutionPayload_UnexpectedFeeRecipient(t *testing.T) { payloadID := &pb.PayloadIDBytes{0x1} payload := emptyPayload() payload.FeeRecipient = feeRecipient[:] + ed, err := blocks.NewWrappedExecutionData(payload) + require.NoError(t, err) vs := &Server{ ExecutionEngineCaller: &powtesting.EngineClient{ - PayloadIDBytes: payloadID, - ExecutionPayload: payload, + PayloadIDBytes: payloadID, + GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}, }, HeadFetcher: &chainMock.ChainService{State: transitionSt}, FinalizationFetcher: &chainMock.ChainService{}, @@ -264,10 +268,10 @@ func TestServer_getExecutionPayload_UnexpectedFeeRecipient(t *testing.T) { blk.Block.ParentRoot = bytesutil.PadTo([]byte{}, 32) b, err := blocks.NewSignedBeaconBlock(blk) require.NoError(t, err) - gotPayload, _, err := vs.getLocalPayload(context.Background(), b.Block(), transitionSt) + res, err := vs.getLocalPayload(context.Background(), b.Block(), transitionSt) require.NoError(t, err) - require.NotNil(t, gotPayload) - require.Equal(t, common.Address(gotPayload.FeeRecipient()), feeRecipient) + require.NotNil(t, res) + require.Equal(t, common.Address(res.ExecutionData.FeeRecipient()), feeRecipient) // We should NOT be getting the warning. require.LogsDoNotContain(t, hook, "Fee recipient address from execution client is not what was expected") @@ -277,9 +281,9 @@ func TestServer_getExecutionPayload_UnexpectedFeeRecipient(t *testing.T) { payload.FeeRecipient = evilRecipientAddress[:] vs.PayloadIDCache = cache.NewPayloadIDCache() - gotPayload, _, err = vs.getLocalPayload(context.Background(), b.Block(), transitionSt) + res, err = vs.getLocalPayload(context.Background(), b.Block(), transitionSt) require.NoError(t, err) - require.NotNil(t, gotPayload) + require.NotNil(t, res) // Users should be warned. require.LogsContain(t, hook, "Fee recipient address from execution client is not what was expected") diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 6ed6bd95ccf6..108f54eb812f 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -277,9 +277,11 @@ func TestServer_GetBeaconBlock_Bellatrix(t *testing.T) { proposerServer := getProposerServer(db, beaconState, parentRoot[:]) proposerServer.Eth1BlockFetcher = c + ed, err := blocks.NewWrappedExecutionData(payload) + require.NoError(t, err) proposerServer.ExecutionEngineCaller = &mockExecution.EngineClient{ - PayloadIDBytes: &enginev1.PayloadIDBytes{1}, - ExecutionPayload: payload, + PayloadIDBytes: &enginev1.PayloadIDBytes{1}, + GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}, } randaoReveal, err := util.RandaoReveal(beaconState, 0, privKeys) @@ -400,9 +402,11 @@ func TestServer_GetBeaconBlock_Capella(t *testing.T) { } proposerServer := getProposerServer(db, beaconState, parentRoot[:]) + ed, err := blocks.NewWrappedExecutionData(payload) + require.NoError(t, err) proposerServer.ExecutionEngineCaller = &mockExecution.EngineClient{ - PayloadIDBytes: &enginev1.PayloadIDBytes{1}, - ExecutionPayloadCapella: payload, + PayloadIDBytes: &enginev1.PayloadIDBytes{1}, + GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}, } randaoReveal, err := util.RandaoReveal(beaconState, 0, privKeys) @@ -510,6 +514,8 @@ func TestServer_GetBeaconBlock_Deneb(t *testing.T) { BlobGasUsed: 4, ExcessBlobGas: 5, } + ed, err := blocks.NewWrappedExecutionData(payload) + require.NoError(t, err) kc := make([][]byte, 0) kc = append(kc, bytesutil.PadTo([]byte("kc"), 48)) @@ -520,9 +526,11 @@ func TestServer_GetBeaconBlock_Deneb(t *testing.T) { bundle := &enginev1.BlobsBundle{KzgCommitments: kc, Proofs: proofs, Blobs: blobs} proposerServer := getProposerServer(db, beaconState, parentRoot[:]) proposerServer.ExecutionEngineCaller = &mockExecution.EngineClient{ - PayloadIDBytes: &enginev1.PayloadIDBytes{1}, - ExecutionPayloadDeneb: payload, - BlobsBundle: bundle, + PayloadIDBytes: &enginev1.PayloadIDBytes{1}, + GetPayloadResponse: &blocks.GetPayloadResponse{ + ExecutionData: ed, + BlobsBundle: bundle, + }, } randaoReveal, err := util.RandaoReveal(beaconState, 0, privKeys) @@ -651,9 +659,11 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { } proposerServer := getProposerServer(db, beaconState, parentRoot[:]) + ed, err := blocks.NewWrappedExecutionData(payload) + require.NoError(t, err) proposerServer.ExecutionEngineCaller = &mockExecution.EngineClient{ - PayloadIDBytes: &enginev1.PayloadIDBytes{1}, - ExecutionPayloadElectra: payload, + PayloadIDBytes: &enginev1.PayloadIDBytes{1}, + GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed}, } randaoReveal, err := util.RandaoReveal(beaconState, 0, privKeys) diff --git a/beacon-chain/state/state-native/getters_payload_header.go b/beacon-chain/state/state-native/getters_payload_header.go index ba2a204d84a6..ff27b8a7ab32 100644 --- a/beacon-chain/state/state-native/getters_payload_header.go +++ b/beacon-chain/state/state-native/getters_payload_header.go @@ -2,7 +2,6 @@ package state_native import ( "fmt" - "math/big" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -24,11 +23,11 @@ func (b *BeaconState) LatestExecutionPayloadHeader() (interfaces.ExecutionData, case version.Bellatrix: return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeaderVal()) case version.Capella: - return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapellaVal(), big.NewInt(0)) + return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapellaVal()) case version.Deneb: - return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDenebVal(), big.NewInt(0)) + return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDenebVal()) case version.Electra: - return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectraVal(), big.NewInt(0)) + return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectraVal()) default: return nil, fmt.Errorf("unsupported version (%s) for latest execution payload header", version.String(b.version)) } diff --git a/beacon-chain/state/state-native/hasher_test.go b/beacon-chain/state/state-native/hasher_test.go index 00e28bf76e8b..3f99222a880c 100644 --- a/beacon-chain/state/state-native/hasher_test.go +++ b/beacon-chain/state/state-native/hasher_test.go @@ -2,7 +2,6 @@ package state_native_test import ( "context" - "math/big" "testing" "github.com/prysmaticlabs/go-bitfield" @@ -254,7 +253,7 @@ func TestComputeFieldRootsWithHasher_Capella(t *testing.T) { require.NoError(t, beaconState.SetInactivityScores([]uint64{1, 2, 3})) require.NoError(t, beaconState.SetCurrentSyncCommittee(syncCommittee("current"))) require.NoError(t, beaconState.SetNextSyncCommittee(syncCommittee("next"))) - wrappedHeader, err := blocks.WrappedExecutionPayloadHeaderCapella(executionPayloadHeaderCapella(), big.NewInt(0)) + wrappedHeader, err := blocks.WrappedExecutionPayloadHeaderCapella(executionPayloadHeaderCapella()) require.NoError(t, err) require.NoError(t, beaconState.SetLatestExecutionPayloadHeader(wrappedHeader)) require.NoError(t, beaconState.SetNextWithdrawalIndex(123)) diff --git a/beacon-chain/state/state-native/setters_payload_header_test.go b/beacon-chain/state/state-native/setters_payload_header_test.go index d8d9fb17cbba..8e49ccdfb3ec 100644 --- a/beacon-chain/state/state-native/setters_payload_header_test.go +++ b/beacon-chain/state/state-native/setters_payload_header_test.go @@ -23,19 +23,19 @@ func TestSetLatestExecutionPayloadHeader(t *testing.T) { }(), func() interfaces.ExecutionData { e := util.NewBeaconBlockCapella().Block.Body.ExecutionPayload - ee, err := blocks.WrappedExecutionPayloadCapella(e, nil) + ee, err := blocks.WrappedExecutionPayloadCapella(e) require.NoError(t, err) return ee }(), func() interfaces.ExecutionData { e := util.NewBeaconBlockDeneb().Block.Body.ExecutionPayload - ee, err := blocks.WrappedExecutionPayloadDeneb(e, nil) + ee, err := blocks.WrappedExecutionPayloadDeneb(e) require.NoError(t, err) return ee }(), func() interfaces.ExecutionData { e := util.NewBeaconBlockElectra().Block.Body.ExecutionPayload - ee, err := blocks.WrappedExecutionPayloadElectra(e, nil) + ee, err := blocks.WrappedExecutionPayloadElectra(e) require.NoError(t, err) return ee }(), @@ -50,19 +50,19 @@ func TestSetLatestExecutionPayloadHeader(t *testing.T) { }(), func() interfaces.ExecutionData { e := util.NewBlindedBeaconBlockCapella().Block.Body.ExecutionPayloadHeader - ee, err := blocks.WrappedExecutionPayloadHeaderCapella(e, nil) + ee, err := blocks.WrappedExecutionPayloadHeaderCapella(e) require.NoError(t, err) return ee }(), func() interfaces.ExecutionData { e := util.NewBlindedBeaconBlockDeneb().Message.Body.ExecutionPayloadHeader - ee, err := blocks.WrappedExecutionPayloadHeaderDeneb(e, nil) + ee, err := blocks.WrappedExecutionPayloadHeaderDeneb(e) require.NoError(t, err) return ee }(), func() interfaces.ExecutionData { e := util.NewBlindedBeaconBlockElectra().Message.Body.ExecutionPayloadHeader - ee, err := blocks.WrappedExecutionPayloadHeaderElectra(e, nil) + ee, err := blocks.WrappedExecutionPayloadHeaderElectra(e) require.NoError(t, err) return ee }(), diff --git a/consensus-types/blocks/BUILD.bazel b/consensus-types/blocks/BUILD.bazel index d56c464ac30e..c39b47ed342a 100644 --- a/consensus-types/blocks/BUILD.bazel +++ b/consensus-types/blocks/BUILD.bazel @@ -5,6 +5,7 @@ go_library( srcs = [ "execution.go", "factory.go", + "get_payload.go", "getters.go", "kzg.go", "proto.go", @@ -31,7 +32,6 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_gohashtree//:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index 13e3905e698b..bb878a0bec50 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -3,13 +3,11 @@ package blocks import ( "bytes" "errors" - "math/big" fastssz "github.com/prysmaticlabs/fastssz" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" @@ -24,19 +22,25 @@ type executionPayload struct { } // NewWrappedExecutionData creates an appropriate execution payload wrapper based on the incoming type. -func NewWrappedExecutionData(v proto.Message, weiValue primitives.Wei) (interfaces.ExecutionData, error) { - if weiValue == nil { - weiValue = new(big.Int).SetInt64(0) +func NewWrappedExecutionData(v proto.Message) (interfaces.ExecutionData, error) { + if v == nil { + return nil, consensus_types.ErrNilObjectWrapped } switch pbStruct := v.(type) { case *enginev1.ExecutionPayload: return WrappedExecutionPayload(pbStruct) case *enginev1.ExecutionPayloadCapella: - return WrappedExecutionPayloadCapella(pbStruct, weiValue) + return WrappedExecutionPayloadCapella(pbStruct) + case *enginev1.ExecutionPayloadCapellaWithValue: + return WrappedExecutionPayloadCapella(pbStruct.Payload) case *enginev1.ExecutionPayloadDeneb: - return WrappedExecutionPayloadDeneb(pbStruct, weiValue) + return WrappedExecutionPayloadDeneb(pbStruct) + case *enginev1.ExecutionPayloadDenebWithValueAndBlobsBundle: + return WrappedExecutionPayloadDeneb(pbStruct.Payload) case *enginev1.ExecutionPayloadElectra: - return WrappedExecutionPayloadElectra(pbStruct, weiValue) + return WrappedExecutionPayloadElectra(pbStruct) + case *enginev1.ExecutionPayloadElectraWithValueAndBlobsBundle: + return WrappedExecutionPayloadElectra(pbStruct.Payload) default: return nil, ErrUnsupportedVersion } @@ -193,16 +197,6 @@ func (e executionPayload) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// ValueInWei -- -func (executionPayload) ValueInWei() (primitives.Wei, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// ValueInGwei -- -func (executionPayload) ValueInGwei() (uint64, error) { - return 0, consensus_types.ErrUnsupportedField -} - // executionPayloadHeader is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -361,16 +355,6 @@ func (e executionPayloadHeader) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// ValueInWei -- -func (executionPayloadHeader) ValueInWei() (primitives.Wei, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// ValueInGwei -- -func (executionPayloadHeader) ValueInGwei() (uint64, error) { - return 0, consensus_types.ErrUnsupportedField -} - // PayloadToHeader converts `payload` into execution payload header format. func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeader, error) { txs, err := payload.Transactions() @@ -403,16 +387,14 @@ func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPaylo // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. type executionPayloadCapella struct { - p *enginev1.ExecutionPayloadCapella - weiValue primitives.Wei - gweiValue uint64 + p *enginev1.ExecutionPayloadCapella } var _ interfaces.ExecutionData = &executionPayloadCapella{} // WrappedExecutionPayloadCapella is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadCapella(p *enginev1.ExecutionPayloadCapella, value primitives.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadCapella{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} +func WrappedExecutionPayloadCapella(p *enginev1.ExecutionPayloadCapella) (interfaces.ExecutionData, error) { + w := executionPayloadCapella{p: p} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -559,30 +541,18 @@ func (e executionPayloadCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// ValueInWei -- -func (e executionPayloadCapella) ValueInWei() (primitives.Wei, error) { - return e.weiValue, nil -} - -// ValueInGwei -- -func (e executionPayloadCapella) ValueInGwei() (uint64, error) { - return e.gweiValue, nil -} - // executionPayloadHeaderCapella is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. type executionPayloadHeaderCapella struct { - p *enginev1.ExecutionPayloadHeaderCapella - weiValue primitives.Wei - gweiValue uint64 + p *enginev1.ExecutionPayloadHeaderCapella } var _ interfaces.ExecutionData = &executionPayloadHeaderCapella{} // WrappedExecutionPayloadHeaderCapella is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderCapella(p *enginev1.ExecutionPayloadHeaderCapella, value primitives.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderCapella{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} +func WrappedExecutionPayloadHeaderCapella(p *enginev1.ExecutionPayloadHeaderCapella) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderCapella{p: p} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -729,16 +699,6 @@ func (e executionPayloadHeaderCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } -// ValueInWei -- -func (e executionPayloadHeaderCapella) ValueInWei() (primitives.Wei, error) { - return e.weiValue, nil -} - -// ValueInGwei -- -func (e executionPayloadHeaderCapella) ValueInGwei() (uint64, error) { - return e.gweiValue, nil -} - // PayloadToHeaderCapella converts `payload` into execution payload header format. func PayloadToHeaderCapella(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderCapella, error) { txs, err := payload.Transactions() @@ -965,16 +925,14 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. type executionPayloadHeaderDeneb struct { - p *enginev1.ExecutionPayloadHeaderDeneb - weiValue primitives.Wei - gweiValue uint64 + p *enginev1.ExecutionPayloadHeaderDeneb } var _ interfaces.ExecutionData = &executionPayloadHeaderDeneb{} // WrappedExecutionPayloadHeaderDeneb is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb, value primitives.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderDeneb{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} +func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderDeneb{p: p} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1116,16 +1074,6 @@ func (e executionPayloadHeaderDeneb) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// ValueInWei -- -func (e executionPayloadHeaderDeneb) ValueInWei() (primitives.Wei, error) { - return e.weiValue, nil -} - -// ValueInGwei -- -func (e executionPayloadHeaderDeneb) ValueInGwei() (uint64, error) { - return e.gweiValue, nil -} - // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadHeaderDeneb) IsBlinded() bool { return true @@ -1135,16 +1083,14 @@ func (e executionPayloadHeaderDeneb) IsBlinded() bool { // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. type executionPayloadDeneb struct { - p *enginev1.ExecutionPayloadDeneb - weiValue primitives.Wei - gweiValue uint64 + p *enginev1.ExecutionPayloadDeneb } var _ interfaces.ExecutionData = &executionPayloadDeneb{} // WrappedExecutionPayloadDeneb is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb, value primitives.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadDeneb{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} +func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb) (interfaces.ExecutionData, error) { + w := executionPayloadDeneb{p: p} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1284,16 +1230,6 @@ func (e executionPayloadDeneb) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// ValueInWei -- -func (e executionPayloadDeneb) ValueInWei() (primitives.Wei, error) { - return e.weiValue, nil -} - -// ValueInGwei -- -func (e executionPayloadDeneb) ValueInGwei() (uint64, error) { - return e.gweiValue, nil -} - // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadDeneb) IsBlinded() bool { return false @@ -1303,17 +1239,15 @@ func (e executionPayloadDeneb) IsBlinded() bool { // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. type executionPayloadHeaderElectra struct { - p *enginev1.ExecutionPayloadHeaderElectra - weiValue primitives.Wei - gweiValue uint64 + p *enginev1.ExecutionPayloadHeaderElectra } var _ interfaces.ExecutionData = &executionPayloadElectra{} var _ interfaces.ExecutionDataElectra = &executionPayloadElectra{} // WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra, value primitives.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderElectra{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} +func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderElectra{p: p} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1455,16 +1389,6 @@ func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// ValueInWei -- -func (e executionPayloadHeaderElectra) ValueInWei() (primitives.Wei, error) { - return e.weiValue, nil -} - -// ValueInGwei -- -func (e executionPayloadHeaderElectra) ValueInGwei() (uint64, error) { - return e.gweiValue, nil -} - // DepositReceipts -- func (e executionPayloadHeaderElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { return nil, consensus_types.ErrUnsupportedField @@ -1484,14 +1408,12 @@ func (e executionPayloadHeaderElectra) IsBlinded() bool { // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. type executionPayloadElectra struct { - p *enginev1.ExecutionPayloadElectra - weiValue primitives.Wei - gweiValue uint64 + p *enginev1.ExecutionPayloadElectra } // WrappedExecutionPayloadElectra is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra, value primitives.Wei) (interfaces.ExecutionData, error) { - w := executionPayloadElectra{p: p, weiValue: value, gweiValue: uint64(primitives.WeiToGwei(value))} +func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra) (interfaces.ExecutionData, error) { + w := executionPayloadElectra{p: p} if w.IsNil() { return nil, consensus_types.ErrNilObjectWrapped } @@ -1634,16 +1556,6 @@ func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// ValueInWei -- -func (e executionPayloadElectra) ValueInWei() (primitives.Wei, error) { - return e.weiValue, nil -} - -// ValueInGwei -- -func (e executionPayloadElectra) ValueInGwei() (uint64, error) { - return e.gweiValue, nil -} - // DepositReceipts -- func (e executionPayloadElectra) DepositReceipts() []*enginev1.DepositReceipt { return e.p.DepositReceipts @@ -1658,16 +1570,3 @@ func (e executionPayloadElectra) WithdrawalRequests() []*enginev1.ExecutionLayer func (e executionPayloadElectra) IsBlinded() bool { return false } - -// PayloadValueToWei returns a Wei value given the payload's value -func PayloadValueToWei(value []byte) primitives.Wei { - // We have to convert big endian to little endian because the value is coming from the execution layer. - return big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(value)) -} - -// PayloadValueToGwei returns a Gwei value given the payload's value -func PayloadValueToGwei(value []byte) primitives.Gwei { - // We have to convert big endian to little endian because the value is coming from the execution layer. - v := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(value)) - return primitives.WeiToGwei(v) -} diff --git a/consensus-types/blocks/execution_test.go b/consensus-types/blocks/execution_test.go index f9dc7cc5e75e..d258ce2eae37 100644 --- a/consensus-types/blocks/execution_test.go +++ b/consensus-types/blocks/execution_test.go @@ -1,7 +1,6 @@ package blocks_test import ( - "math/big" "testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -106,14 +105,8 @@ func TestWrapExecutionPayloadCapella(t *testing.T) { Amount: 77, }}, } - payload, err := blocks.WrappedExecutionPayloadCapella(data, big.NewInt(10*1e9)) + payload, err := blocks.WrappedExecutionPayloadCapella(data) require.NoError(t, err) - wei, err := payload.ValueInWei() - require.NoError(t, err) - assert.Equal(t, 0, big.NewInt(10*1e9).Cmp(wei)) - gwei, err := payload.ValueInGwei() - require.NoError(t, err) - assert.Equal(t, uint64(10), gwei) assert.DeepEqual(t, data, payload.Proto()) } @@ -136,16 +129,9 @@ func TestWrapExecutionPayloadHeaderCapella(t *testing.T) { TransactionsRoot: []byte("transactionsroot"), WithdrawalsRoot: []byte("withdrawalsroot"), } - payload, err := blocks.WrappedExecutionPayloadHeaderCapella(data, big.NewInt(10*1e9)) + payload, err := blocks.WrappedExecutionPayloadHeaderCapella(data) require.NoError(t, err) - wei, err := payload.ValueInWei() - require.NoError(t, err) - assert.Equal(t, 0, big.NewInt(10*1e9).Cmp(wei)) - gwei, err := payload.ValueInGwei() - require.NoError(t, err) - assert.Equal(t, uint64(10), gwei) - assert.DeepEqual(t, data, payload.Proto()) txRoot, err := payload.TransactionsRoot() @@ -158,22 +144,22 @@ func TestWrapExecutionPayloadHeaderCapella(t *testing.T) { } func TestWrapExecutionPayloadCapella_IsNil(t *testing.T) { - _, err := blocks.WrappedExecutionPayloadCapella(nil, big.NewInt(0)) + _, err := blocks.WrappedExecutionPayloadCapella(nil) require.Equal(t, consensus_types.ErrNilObjectWrapped, err) data := &enginev1.ExecutionPayloadCapella{GasUsed: 54} - payload, err := blocks.WrappedExecutionPayloadCapella(data, big.NewInt(0)) + payload, err := blocks.WrappedExecutionPayloadCapella(data) require.NoError(t, err) assert.Equal(t, false, payload.IsNil()) } func TestWrapExecutionPayloadHeaderCapella_IsNil(t *testing.T) { - _, err := blocks.WrappedExecutionPayloadHeaderCapella(nil, big.NewInt(0)) + _, err := blocks.WrappedExecutionPayloadHeaderCapella(nil) require.Equal(t, consensus_types.ErrNilObjectWrapped, err) data := &enginev1.ExecutionPayloadHeaderCapella{GasUsed: 54} - payload, err := blocks.WrappedExecutionPayloadHeaderCapella(data, big.NewInt(0)) + payload, err := blocks.WrappedExecutionPayloadHeaderCapella(data) require.NoError(t, err) assert.Equal(t, false, payload.IsNil()) @@ -236,14 +222,8 @@ func TestWrapExecutionPayloadDeneb(t *testing.T) { BlobGasUsed: 88, ExcessBlobGas: 99, } - payload, err := blocks.WrappedExecutionPayloadDeneb(data, big.NewInt(420*1e9)) - require.NoError(t, err) - wei, err := payload.ValueInWei() - require.NoError(t, err) - assert.Equal(t, 0, big.NewInt(420*1e9).Cmp(wei)) - gwei, err := payload.ValueInGwei() + payload, err := blocks.WrappedExecutionPayloadDeneb(data) require.NoError(t, err) - assert.Equal(t, uint64(420), gwei) g, err := payload.BlobGasUsed() require.NoError(t, err) @@ -274,16 +254,9 @@ func TestWrapExecutionPayloadHeaderDeneb(t *testing.T) { BlobGasUsed: 88, ExcessBlobGas: 99, } - payload, err := blocks.WrappedExecutionPayloadHeaderDeneb(data, big.NewInt(10*1e9)) + payload, err := blocks.WrappedExecutionPayloadHeaderDeneb(data) require.NoError(t, err) - wei, err := payload.ValueInWei() - require.NoError(t, err) - assert.Equal(t, 0, big.NewInt(10*1e9).Cmp(wei)) - gwei, err := payload.ValueInGwei() - require.NoError(t, err) - assert.Equal(t, uint64(10), gwei) - g, err := payload.BlobGasUsed() require.NoError(t, err) require.DeepEqual(t, uint64(88), g) @@ -384,7 +357,7 @@ func createWrappedPayloadCapella(t testing.TB) interfaces.ExecutionData { BlockHash: make([]byte, fieldparams.RootLength), Transactions: make([][]byte, 0), Withdrawals: make([]*enginev1.Withdrawal, 0), - }, big.NewInt(0)) + }) require.NoError(t, err) return payload } @@ -406,7 +379,7 @@ func createWrappedPayloadHeaderCapella(t testing.TB) interfaces.ExecutionData { BlockHash: make([]byte, fieldparams.RootLength), TransactionsRoot: make([]byte, fieldparams.RootLength), WithdrawalsRoot: make([]byte, fieldparams.RootLength), - }, big.NewInt(0)) + }) require.NoError(t, err) return payload } @@ -430,7 +403,7 @@ func createWrappedPayloadDeneb(t testing.TB) interfaces.ExecutionData { Withdrawals: make([]*enginev1.Withdrawal, 0), BlobGasUsed: 0, ExcessBlobGas: 0, - }, big.NewInt(0)) + }) require.NoError(t, err) return payload } @@ -454,7 +427,7 @@ func createWrappedPayloadHeaderDeneb(t testing.TB) interfaces.ExecutionData { WithdrawalsRoot: make([]byte, fieldparams.RootLength), BlobGasUsed: 0, ExcessBlobGas: 0, - }, big.NewInt(0)) + }) require.NoError(t, err) return payload } diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index b7a1c826b118..9e4db86fe6c5 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -2,7 +2,6 @@ package blocks import ( "fmt" - "math/big" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -260,11 +259,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea case *enginev1.ExecutionPayload: wrappedPayload, wrapErr = WrappedExecutionPayload(p) case *enginev1.ExecutionPayloadCapella: - wrappedPayload, wrapErr = WrappedExecutionPayloadCapella(p, big.NewInt(0)) + wrappedPayload, wrapErr = WrappedExecutionPayloadCapella(p) case *enginev1.ExecutionPayloadDeneb: - wrappedPayload, wrapErr = WrappedExecutionPayloadDeneb(p, big.NewInt(0)) + wrappedPayload, wrapErr = WrappedExecutionPayloadDeneb(p) case *enginev1.ExecutionPayloadElectra: - wrappedPayload, wrapErr = WrappedExecutionPayloadElectra(p, big.NewInt(0)) + wrappedPayload, wrapErr = WrappedExecutionPayloadElectra(p) default: return nil, fmt.Errorf("%T is not a type of execution payload", p) } diff --git a/consensus-types/blocks/factory_test.go b/consensus-types/blocks/factory_test.go index 80a4a4f4f187..cca68452581e 100644 --- a/consensus-types/blocks/factory_test.go +++ b/consensus-types/blocks/factory_test.go @@ -3,7 +3,6 @@ package blocks import ( "bytes" "errors" - "math/big" "testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -517,7 +516,7 @@ func TestBuildSignedBeaconBlockFromExecutionPayload(t *testing.T) { ExcessBlobGas: 123, BlobGasUsed: 321, } - wrapped, err := WrappedExecutionPayloadDeneb(payload, big.NewInt(123)) + wrapped, err := WrappedExecutionPayloadDeneb(payload) require.NoError(t, err) header, err := PayloadToHeaderDeneb(wrapped) require.NoError(t, err) diff --git a/consensus-types/blocks/get_payload.go b/consensus-types/blocks/get_payload.go new file mode 100644 index 000000000000..030665e3fa3b --- /dev/null +++ b/consensus-types/blocks/get_payload.go @@ -0,0 +1,60 @@ +package blocks + +import ( + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + "google.golang.org/protobuf/proto" +) + +// GetPayloadResponse represents the result of unmarshaling an execution engine +// GetPayloadResponseV(1|2|3|4) value. +type GetPayloadResponse struct { + ExecutionData interfaces.ExecutionData + BlobsBundle *pb.BlobsBundle + OverrideBuilder bool + // todo: should we convert this to Gwei up front? + Bid primitives.Wei +} + +// bundleGetter is an interface satisfied by get payload responses that have a blobs bundle. +type bundleGetter interface { + GetBlobsBundle() *pb.BlobsBundle +} + +// bidValueGetter is an interface satisfied by get payload responses that have a bid value. +type bidValueGetter interface { + GetValue() []byte +} + +type shouldOverrideBuilderGetter interface { + GetShouldOverrideBuilder() bool +} + +func NewGetPayloadResponse(msg proto.Message) (*GetPayloadResponse, error) { + r := &GetPayloadResponse{} + bundleGetter, hasBundle := msg.(bundleGetter) + if hasBundle { + r.BlobsBundle = bundleGetter.GetBlobsBundle() + } + bidValueGetter, hasBid := msg.(bidValueGetter) + wei := primitives.ZeroWei + if hasBid { + // The protobuf types that engine api responses unmarshal into store their values in little endian form. + // This is done for consistency with other uint256 values stored in protobufs for SSZ values. + // Long term we should move away from protobuf types for these values and just keep the bid as a big.Int as soon + // as we unmarshal it from the engine api response. + wei = primitives.LittleEndianBytesToWei(bidValueGetter.GetValue()) + } + r.Bid = wei + shouldOverride, hasShouldOverride := msg.(shouldOverrideBuilderGetter) + if hasShouldOverride { + r.OverrideBuilder = shouldOverride.GetShouldOverrideBuilder() + } + ed, err := NewWrappedExecutionData(msg) + if err != nil { + return nil, err + } + r.ExecutionData = ed + return r, nil +} diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index aae831b685f4..4ba4b5176710 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -2,7 +2,6 @@ package blocks import ( "fmt" - "math/big" "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" @@ -14,7 +13,6 @@ import ( eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/runtime/version" - log "github.com/sirupsen/logrus" ) // BeaconBlockIsNil checks if any composite field of input signed beacon block is nil. @@ -327,44 +325,6 @@ func (b *SignedBeaconBlock) IsBlinded() bool { return b.version >= version.Bellatrix && b.block.body.executionPayload == nil } -// ValueInWei metadata on the payload value returned by the builder. -func (b *SignedBeaconBlock) ValueInWei() primitives.Wei { - exec, err := b.block.body.Execution() - if err != nil { - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - log.WithError(err).Warn("failed to retrieve execution payload") - } - return big.NewInt(0) - } - val, err := exec.ValueInWei() - if err != nil { - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - log.WithError(err).Warn("failed to retrieve execution payload") - } - return big.NewInt(0) - } - return val -} - -// ValueInGwei metadata on the payload value returned by the builder. -func (b *SignedBeaconBlock) ValueInGwei() uint64 { - exec, err := b.block.body.Execution() - if err != nil { - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - log.WithError(err).Warn("failed to retrieve execution payload") - } - return 0 - } - val, err := exec.ValueInGwei() - if err != nil { - if !errors.Is(err, consensus_types.ErrUnsupportedField) { - log.WithError(err).Warn("failed to retrieve execution payload") - } - return 0 - } - return val -} - // Header converts the underlying protobuf object from blinded block to header format. func (b *SignedBeaconBlock) Header() (*eth.SignedBeaconBlockHeader, error) { if b.IsNil() { diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index 318bd65203d0..826db3bc13e6 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -1,7 +1,6 @@ package blocks import ( - "math/big" "testing" ssz "github.com/prysmaticlabs/fastssz" @@ -215,9 +214,9 @@ func Test_BeaconBlock_Copy(t *testing.T) { payload := &pb.ExecutionPayloadDeneb{ExcessBlobGas: 123} header := &pb.ExecutionPayloadHeaderDeneb{ExcessBlobGas: 223} - payloadInterface, err := WrappedExecutionPayloadDeneb(payload, big.NewInt(123)) + payloadInterface, err := WrappedExecutionPayloadDeneb(payload) require.NoError(t, err) - headerInterface, err := WrappedExecutionPayloadHeaderDeneb(header, big.NewInt(123)) + headerInterface, err := WrappedExecutionPayloadHeaderDeneb(header) require.NoError(t, err) bb = &BeaconBlockBody{executionPayload: payloadInterface, executionPayloadHeader: headerInterface, randaoReveal: bytesutil.ToBytes96([]byte{246}), graffiti: bytesutil.ToBytes32([]byte("graffiti"))} b = &BeaconBlock{body: bb, slot: 123, proposerIndex: 456, parentRoot: bytesutil.ToBytes32([]byte("parentroot")), stateRoot: bytesutil.ToBytes32([]byte("stateroot"))} @@ -425,7 +424,7 @@ func Test_BeaconBlockBody_Execution(t *testing.T) { assert.DeepEqual(t, result, e) executionCapella := &pb.ExecutionPayloadCapella{BlockNumber: 1} - eCapella, err := WrappedExecutionPayloadCapella(executionCapella, big.NewInt(0)) + eCapella, err := WrappedExecutionPayloadCapella(executionCapella) require.NoError(t, err) bb = &SignedBeaconBlock{version: version.Capella, block: &BeaconBlock{body: &BeaconBlockBody{version: version.Capella}}} require.NoError(t, bb.SetExecution(eCapella)) @@ -434,7 +433,7 @@ func Test_BeaconBlockBody_Execution(t *testing.T) { assert.DeepEqual(t, result, eCapella) executionCapellaHeader := &pb.ExecutionPayloadHeaderCapella{BlockNumber: 1} - eCapellaHeader, err := WrappedExecutionPayloadHeaderCapella(executionCapellaHeader, big.NewInt(0)) + eCapellaHeader, err := WrappedExecutionPayloadHeaderCapella(executionCapellaHeader) require.NoError(t, err) bb = &SignedBeaconBlock{version: version.Capella, block: &BeaconBlock{version: version.Capella, body: &BeaconBlockBody{version: version.Capella}}} require.NoError(t, bb.SetExecution(eCapellaHeader)) @@ -443,7 +442,7 @@ func Test_BeaconBlockBody_Execution(t *testing.T) { assert.DeepEqual(t, result, eCapellaHeader) executionDeneb := &pb.ExecutionPayloadDeneb{BlockNumber: 1, ExcessBlobGas: 123} - eDeneb, err := WrappedExecutionPayloadDeneb(executionDeneb, big.NewInt(0)) + eDeneb, err := WrappedExecutionPayloadDeneb(executionDeneb) require.NoError(t, err) bb = &SignedBeaconBlock{version: version.Deneb, block: &BeaconBlock{body: &BeaconBlockBody{version: version.Deneb}}} require.NoError(t, bb.SetExecution(eDeneb)) @@ -455,7 +454,7 @@ func Test_BeaconBlockBody_Execution(t *testing.T) { require.DeepEqual(t, gas, uint64(123)) executionDenebHeader := &pb.ExecutionPayloadHeaderDeneb{BlockNumber: 1, ExcessBlobGas: 223} - eDenebHeader, err := WrappedExecutionPayloadHeaderDeneb(executionDenebHeader, big.NewInt(0)) + eDenebHeader, err := WrappedExecutionPayloadHeaderDeneb(executionDenebHeader) require.NoError(t, err) bb = &SignedBeaconBlock{version: version.Deneb, block: &BeaconBlock{version: version.Deneb, body: &BeaconBlockBody{version: version.Deneb}}} require.NoError(t, bb.SetExecution(eDenebHeader)) diff --git a/consensus-types/blocks/proto.go b/consensus-types/blocks/proto.go index 314fb0a5e67a..d00e42cdde6a 100644 --- a/consensus-types/blocks/proto.go +++ b/consensus-types/blocks/proto.go @@ -1,8 +1,6 @@ package blocks import ( - "math/big" - "github.com/pkg/errors" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -1031,7 +1029,7 @@ func initBlockBodyFromProtoCapella(pb *eth.BeaconBlockBodyCapella) (*BeaconBlock return nil, errNilBlockBody } - p, err := WrappedExecutionPayloadCapella(pb.ExecutionPayload, big.NewInt(0)) + p, err := WrappedExecutionPayloadCapella(pb.ExecutionPayload) // We allow the payload to be nil if err != nil && err != consensus_types.ErrNilObjectWrapped { return nil, err @@ -1058,7 +1056,7 @@ func initBlindedBlockBodyFromProtoCapella(pb *eth.BlindedBeaconBlockBodyCapella) return nil, errNilBlockBody } - ph, err := WrappedExecutionPayloadHeaderCapella(pb.ExecutionPayloadHeader, big.NewInt(0)) + ph, err := WrappedExecutionPayloadHeaderCapella(pb.ExecutionPayloadHeader) // We allow the payload to be nil if err != nil && err != consensus_types.ErrNilObjectWrapped { return nil, err @@ -1085,7 +1083,7 @@ func initBlockBodyFromProtoDeneb(pb *eth.BeaconBlockBodyDeneb) (*BeaconBlockBody return nil, errNilBlockBody } - p, err := WrappedExecutionPayloadDeneb(pb.ExecutionPayload, big.NewInt(0)) + p, err := WrappedExecutionPayloadDeneb(pb.ExecutionPayload) // We allow the payload to be nil if err != nil && err != consensus_types.ErrNilObjectWrapped { return nil, err @@ -1113,7 +1111,7 @@ func initBlindedBlockBodyFromProtoDeneb(pb *eth.BlindedBeaconBlockBodyDeneb) (*B return nil, errNilBlockBody } - ph, err := WrappedExecutionPayloadHeaderDeneb(pb.ExecutionPayloadHeader, big.NewInt(0)) + ph, err := WrappedExecutionPayloadHeaderDeneb(pb.ExecutionPayloadHeader) // We allow the payload to be nil if err != nil && err != consensus_types.ErrNilObjectWrapped { return nil, err @@ -1141,7 +1139,7 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock return nil, errNilBlockBody } - p, err := WrappedExecutionPayloadElectra(pb.ExecutionPayload, big.NewInt(0)) + p, err := WrappedExecutionPayloadElectra(pb.ExecutionPayload) // We allow the payload to be nil if err != nil && err != consensus_types.ErrNilObjectWrapped { return nil, err @@ -1170,7 +1168,7 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) return nil, errNilBlockBody } - ph, err := WrappedExecutionPayloadHeaderElectra(pb.ExecutionPayloadHeader, big.NewInt(0)) + ph, err := WrappedExecutionPayloadHeaderElectra(pb.ExecutionPayloadHeader) // We allow the payload to be nil if err != nil && err != consensus_types.ErrNilObjectWrapped { return nil, err diff --git a/consensus-types/blocks/proto_test.go b/consensus-types/blocks/proto_test.go index a906687e904b..880edb63db99 100644 --- a/consensus-types/blocks/proto_test.go +++ b/consensus-types/blocks/proto_test.go @@ -1,7 +1,6 @@ package blocks import ( - "math/big" "testing" "github.com/prysmaticlabs/go-bitfield" @@ -1332,7 +1331,7 @@ func bodyBlindedBellatrix(t *testing.T) *BeaconBlockBody { func bodyCapella(t *testing.T) *BeaconBlockBody { f := getFields() - p, err := WrappedExecutionPayloadCapella(f.execPayloadCapella, big.NewInt(0)) + p, err := WrappedExecutionPayloadCapella(f.execPayloadCapella) require.NoError(t, err) return &BeaconBlockBody{ version: version.Capella, @@ -1356,7 +1355,7 @@ func bodyCapella(t *testing.T) *BeaconBlockBody { func bodyBlindedCapella(t *testing.T) *BeaconBlockBody { f := getFields() - ph, err := WrappedExecutionPayloadHeaderCapella(f.execPayloadHeaderCapella, big.NewInt(0)) + ph, err := WrappedExecutionPayloadHeaderCapella(f.execPayloadHeaderCapella) require.NoError(t, err) return &BeaconBlockBody{ version: version.Capella, @@ -1380,7 +1379,7 @@ func bodyBlindedCapella(t *testing.T) *BeaconBlockBody { func bodyDeneb(t *testing.T) *BeaconBlockBody { f := getFields() - p, err := WrappedExecutionPayloadDeneb(f.execPayloadDeneb, big.NewInt(0)) + p, err := WrappedExecutionPayloadDeneb(f.execPayloadDeneb) require.NoError(t, err) return &BeaconBlockBody{ version: version.Deneb, @@ -1405,7 +1404,7 @@ func bodyDeneb(t *testing.T) *BeaconBlockBody { func bodyBlindedDeneb(t *testing.T) *BeaconBlockBody { f := getFields() - ph, err := WrappedExecutionPayloadHeaderDeneb(f.execPayloadHeaderDeneb, big.NewInt(0)) + ph, err := WrappedExecutionPayloadHeaderDeneb(f.execPayloadHeaderDeneb) require.NoError(t, err) return &BeaconBlockBody{ version: version.Deneb, diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 68ce6f661cc6..c08ed34e4edf 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -27,8 +27,6 @@ type ReadOnlySignedBeaconBlock interface { ssz.Unmarshaler Version() int IsBlinded() bool - ValueInWei() primitives.Wei - ValueInGwei() uint64 Header() (*ethpb.SignedBeaconBlockHeader, error) } @@ -128,8 +126,6 @@ type ExecutionData interface { TransactionsRoot() ([]byte, error) Withdrawals() ([]*enginev1.Withdrawal, error) WithdrawalsRoot() ([]byte, error) - ValueInWei() (primitives.Wei, error) - ValueInGwei() (uint64, error) } type ExecutionDataElectra interface { diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index e172fd6df832..36fd58671077 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -75,14 +75,6 @@ func (SignedBeaconBlock) Header() (*eth.SignedBeaconBlockHeader, error) { panic("implement me") } -func (SignedBeaconBlock) ValueInWei() primitives.Wei { - panic("implement me") -} - -func (SignedBeaconBlock) ValueInGwei() uint64 { - panic("implement me") -} - type BeaconBlock struct { Htr [field_params.RootLength]byte HtrErr error diff --git a/consensus-types/primitives/wei.go b/consensus-types/primitives/wei.go index 8bcee0130899..01aa288894c5 100644 --- a/consensus-types/primitives/wei.go +++ b/consensus-types/primitives/wei.go @@ -71,12 +71,18 @@ func Uint64ToWei(v uint64) Wei { return big.NewInt(0).SetUint64(v) } -// BigEndianBytesToWei returns a Wei value given a big-endian binary representation (eg engine api payload bids). -func BigEndianBytesToWei(value []byte) Wei { +// LittleEndianBytesToWei returns a Wei value given a little-endian binary representation. +// The only places we use this representation are in protobuf types that hold either the +// local execution payload bid or the builder bid. Going forward we should avoid that representation +// so this function being used in new places should be considered a code smell. +func LittleEndianBytesToWei(value []byte) Wei { + if len(value) == 0 { + return big.NewInt(0) + } v := make([]byte, len(value)) copy(v, value) + // SetBytes expects a big-endian representation of the value, so we reverse the byte slice. slices.Reverse(v) - // We have to convert big endian to little endian because the value is coming from the execution layer. return big.NewInt(0).SetBytes(v) } diff --git a/consensus-types/primitives/wei_test.go b/consensus-types/primitives/wei_test.go index dd9ff308aeaf..c8276968fc62 100644 --- a/consensus-types/primitives/wei_test.go +++ b/consensus-types/primitives/wei_test.go @@ -39,3 +39,8 @@ func TestWeiToGwei_CopyOk(t *testing.T) { require.Equal(t, primitives.Gwei(1), got) require.Equal(t, big.NewInt(1e9).Uint64(), v.Uint64()) } + +func TestZero(t *testing.T) { + z := primitives.ZeroWei + require.Equal(t, 0, big.NewInt(0).Cmp(z)) +} diff --git a/math/BUILD.bazel b/math/BUILD.bazel index fac6ee3ab7a0..ffd1f0ba7693 100644 --- a/math/BUILD.bazel +++ b/math/BUILD.bazel @@ -14,7 +14,6 @@ go_test( srcs = ["math_helper_test.go"], deps = [ ":go_default_library", - "//consensus-types/primitives:go_default_library", "//testing/require:go_default_library", ], ) diff --git a/math/math_helper_test.go b/math/math_helper_test.go index 64243a694724..8ee06bbd2ed2 100644 --- a/math/math_helper_test.go +++ b/math/math_helper_test.go @@ -3,10 +3,8 @@ package math_test import ( "fmt" stdmath "math" - "math/big" "testing" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -551,28 +549,3 @@ func TestAddInt(t *testing.T) { }) } } - -func TestWeiToGwei(t *testing.T) { - tests := []struct { - v *big.Int - want primitives.Gwei - }{ - {big.NewInt(1e9 - 1), 0}, - {big.NewInt(1e9), 1}, - {big.NewInt(1e10), 10}, - {big.NewInt(239489233849348394), 239489233}, - } - for _, tt := range tests { - if got := primitives.WeiToGwei(tt.v); got != tt.want { - t.Errorf("WeiToGwei() = %v, want %v", got, tt.want) - } - } -} - -func TestWeiToGwei_CopyOk(t *testing.T) { - v := big.NewInt(1e9) - got := primitives.WeiToGwei(v) - - require.Equal(t, primitives.Gwei(1), got) - require.Equal(t, big.NewInt(1e9).Uint64(), v.Uint64()) -} diff --git a/runtime/interop/premine-state.go b/runtime/interop/premine-state.go index 7a9640739101..3eccfaab789f 100644 --- a/runtime/interop/premine-state.go +++ b/runtime/interop/premine-state.go @@ -2,7 +2,6 @@ package interop import ( "context" - "math/big" "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" @@ -596,7 +595,7 @@ func (s *PremineGenesisConfig) setExecutionPayload(g state.BeaconState) error { Transactions: make([][]byte, 0), Withdrawals: make([]*enginev1.Withdrawal, 0), } - wep, err := blocks.WrappedExecutionPayloadCapella(payload, big.NewInt(0)) + wep, err := blocks.WrappedExecutionPayloadCapella(payload) if err != nil { return err } @@ -604,7 +603,7 @@ func (s *PremineGenesisConfig) setExecutionPayload(g state.BeaconState) error { if err != nil { return err } - ed, err = blocks.WrappedExecutionPayloadHeaderCapella(eph, big.NewInt(0)) + ed, err = blocks.WrappedExecutionPayloadHeaderCapella(eph) if err != nil { return err } @@ -628,7 +627,7 @@ func (s *PremineGenesisConfig) setExecutionPayload(g state.BeaconState) error { ExcessBlobGas: *gb.ExcessBlobGas(), BlobGasUsed: *gb.BlobGasUsed(), } - wep, err := blocks.WrappedExecutionPayloadDeneb(payload, big.NewInt(0)) + wep, err := blocks.WrappedExecutionPayloadDeneb(payload) if err != nil { return err } @@ -636,7 +635,7 @@ func (s *PremineGenesisConfig) setExecutionPayload(g state.BeaconState) error { if err != nil { return err } - ed, err = blocks.WrappedExecutionPayloadHeaderDeneb(eph, big.NewInt(0)) + ed, err = blocks.WrappedExecutionPayloadHeaderDeneb(eph) if err != nil { return err } diff --git a/testing/middleware/builder/builder.go b/testing/middleware/builder/builder.go index 1543dd47e905..592b96eefff7 100644 --- a/testing/middleware/builder/builder.go +++ b/testing/middleware/builder/builder.go @@ -423,11 +423,7 @@ func (p *Builder) handleHeaderRequestCapella(w http.ResponseWriter) { v := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(b.Value)) // we set the payload value as twice its actual one so that it always chooses builder payloads vs local payloads v = v.Mul(v, big.NewInt(2)) - // Is used as the helper modifies the big.Int - weiVal := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(b.Value)) - // we set the payload value as twice its actual one so that it always chooses builder payloads vs local payloads - weiVal = weiVal.Mul(weiVal, big.NewInt(2)) - wObj, err := blocks.WrappedExecutionPayloadCapella(b.Payload, weiVal) + wObj, err := blocks.WrappedExecutionPayloadCapella(b.Payload) if err != nil { p.cfg.logger.WithError(err).Error("Could not wrap execution payload") http.Error(w, err.Error(), http.StatusInternalServerError) @@ -504,11 +500,7 @@ func (p *Builder) handleHeaderRequestDeneb(w http.ResponseWriter) { v := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(b.Value)) // we set the payload value as twice its actual one so that it always chooses builder payloads vs local payloads v = v.Mul(v, big.NewInt(2)) - // Is used as the helper modifies the big.Int - weiVal := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(b.Value)) - // we set the payload value as twice its actual one so that it always chooses builder payloads vs local payloads - weiVal = weiVal.Mul(weiVal, big.NewInt(2)) - wObj, err := blocks.WrappedExecutionPayloadDeneb(b.Payload, weiVal) + wObj, err := blocks.WrappedExecutionPayloadDeneb(b.Payload) if err != nil { p.cfg.logger.WithError(err).Error("Could not wrap execution payload") http.Error(w, err.Error(), http.StatusInternalServerError) diff --git a/testing/spectest/shared/capella/operations/execution_payload.go b/testing/spectest/shared/capella/operations/execution_payload.go index 346b72c3ff63..453c265110fc 100644 --- a/testing/spectest/shared/capella/operations/execution_payload.go +++ b/testing/spectest/shared/capella/operations/execution_payload.go @@ -1,7 +1,6 @@ package operations import ( - "math/big" "os" "path" "strings" @@ -54,7 +53,7 @@ func RunExecutionPayloadTest(t *testing.T, config string) { require.NoError(t, err) } - payload, err := blocks2.WrappedExecutionPayloadCapella(block.ExecutionPayload, big.NewInt(0)) + payload, err := blocks2.WrappedExecutionPayloadCapella(block.ExecutionPayload) require.NoError(t, err) file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") diff --git a/testing/spectest/shared/capella/operations/withdrawals.go b/testing/spectest/shared/capella/operations/withdrawals.go index 85159b94ae1b..edfb56a8ea61 100644 --- a/testing/spectest/shared/capella/operations/withdrawals.go +++ b/testing/spectest/shared/capella/operations/withdrawals.go @@ -2,7 +2,6 @@ package operations import ( "context" - "math/big" "path" "testing" @@ -44,7 +43,7 @@ func RunWithdrawalsTest(t *testing.T, config string) { if err != nil { return nil, err } - p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: withdrawals}, big.NewInt(0)) + p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: withdrawals}) require.NoError(t, err) return blocks.ProcessWithdrawals(s, p) }) diff --git a/testing/spectest/shared/common/forkchoice/service.go b/testing/spectest/shared/common/forkchoice/service.go index c02814f94e7e..6395907b9da2 100644 --- a/testing/spectest/shared/common/forkchoice/service.go +++ b/testing/spectest/shared/common/forkchoice/service.go @@ -22,6 +22,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" payloadattribute "github.com/prysmaticlabs/prysm/v5/consensus-types/payload-attribute" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -92,8 +93,8 @@ type engineMock struct { payloadStatus error } -func (m *engineMock) GetPayload(context.Context, [8]byte, primitives.Slot) (interfaces.ExecutionData, *pb.BlobsBundle, bool, error) { - return nil, nil, false, nil +func (m *engineMock) GetPayload(context.Context, [8]byte, primitives.Slot) (*blocks.GetPayloadResponse, error) { + return nil, nil } func (m *engineMock) GetPayloadV2(context.Context, [8]byte) (*pb.ExecutionPayloadCapella, error) { return nil, nil diff --git a/testing/spectest/shared/deneb/operations/execution_payload.go b/testing/spectest/shared/deneb/operations/execution_payload.go index e708ef271fd4..d1069e4a600f 100644 --- a/testing/spectest/shared/deneb/operations/execution_payload.go +++ b/testing/spectest/shared/deneb/operations/execution_payload.go @@ -1,7 +1,6 @@ package operations import ( - "math/big" "os" "path" "strings" @@ -57,7 +56,7 @@ func RunExecutionPayloadTest(t *testing.T, config string) { require.NoError(t, err) } - payload, err := blocks2.WrappedExecutionPayloadDeneb(body.ExecutionPayload, big.NewInt(0)) + payload, err := blocks2.WrappedExecutionPayloadDeneb(body.ExecutionPayload) require.NoError(t, err) file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") diff --git a/testing/spectest/shared/deneb/operations/withdrawals.go b/testing/spectest/shared/deneb/operations/withdrawals.go index d31f3da0aea8..ac8905bc768c 100644 --- a/testing/spectest/shared/deneb/operations/withdrawals.go +++ b/testing/spectest/shared/deneb/operations/withdrawals.go @@ -2,7 +2,6 @@ package operations import ( "context" - "math/big" "path" "testing" @@ -41,7 +40,7 @@ func RunWithdrawalsTest(t *testing.T, config string) { if err != nil { return nil, err } - p, err := consensusblocks.WrappedExecutionPayloadDeneb(&enginev1.ExecutionPayloadDeneb{Withdrawals: withdrawals}, big.NewInt(0)) + p, err := consensusblocks.WrappedExecutionPayloadDeneb(&enginev1.ExecutionPayloadDeneb{Withdrawals: withdrawals}) require.NoError(t, err) return blocks.ProcessWithdrawals(s, p) }) diff --git a/testing/spectest/shared/electra/operations/execution_payload.go b/testing/spectest/shared/electra/operations/execution_payload.go index 69111af82cd5..dc00fc5173eb 100644 --- a/testing/spectest/shared/electra/operations/execution_payload.go +++ b/testing/spectest/shared/electra/operations/execution_payload.go @@ -1,7 +1,6 @@ package operations import ( - "math/big" "os" "path" "strings" @@ -59,7 +58,7 @@ func RunExecutionPayloadTest(t *testing.T, config string) { require.NoError(t, err) } - payload, err := blocks2.WrappedExecutionPayloadElectra(body.ExecutionPayload, big.NewInt(0)) + payload, err := blocks2.WrappedExecutionPayloadElectra(body.ExecutionPayload) require.NoError(t, err) file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") diff --git a/testing/spectest/shared/electra/operations/withdrawals.go b/testing/spectest/shared/electra/operations/withdrawals.go index 4c08dfa3d270..866a2de53882 100644 --- a/testing/spectest/shared/electra/operations/withdrawals.go +++ b/testing/spectest/shared/electra/operations/withdrawals.go @@ -2,7 +2,6 @@ package operations import ( "context" - "math/big" "path" "testing" @@ -41,7 +40,7 @@ func RunWithdrawalsTest(t *testing.T, config string) { if err != nil { return nil, err } - p, err := consensusblocks.WrappedExecutionPayloadElectra(&enginev1.ExecutionPayloadElectra{Withdrawals: withdrawals}, big.NewInt(0)) + p, err := consensusblocks.WrappedExecutionPayloadElectra(&enginev1.ExecutionPayloadElectra{Withdrawals: withdrawals}) require.NoError(t, err) return blocks.ProcessWithdrawals(s, p) }) From 2e842081697f64a66d3672f7b0a5584bc4a0b6dc Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 23 May 2024 09:07:30 -0500 Subject: [PATCH 105/325] WebFix develop (#14040) * fixing issues introduced by PR 13593 * missed setting db * linting --- api/constants.go | 4 ++-- validator/node/node.go | 15 +++++++++++++-- validator/rpc/intercepter.go | 2 +- validator/rpc/server.go | 14 ++++++++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/api/constants.go b/api/constants.go index 4f8fdcd32f9c..5be6e3f2216f 100644 --- a/api/constants.go +++ b/api/constants.go @@ -4,6 +4,6 @@ const ( WebUrlPrefix = "/v2/validator/" WebApiUrlPrefix = "/api/v2/validator/" KeymanagerApiPrefix = "/eth/v1" - - AuthTokenFileName = "auth-token" + SystemLogsPrefix = "health/logs" + AuthTokenFileName = "auth-token" ) diff --git a/validator/node/node.go b/validator/node/node.go index 7789666c24b3..4529287cfaab 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -614,6 +614,16 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { if err := c.services.FetchService(&vs); err != nil { return err } + authTokenPath := c.cliCtx.String(flags.AuthTokenPathFlag.Name) + walletDir := c.cliCtx.String(flags.WalletDirFlag.Name) + // if no auth token path flag was passed try to set a default value + if authTokenPath == "" { + authTokenPath = flags.AuthTokenPathFlag.Value + // if a wallet dir is passed without an auth token then override the default with the wallet dir + if walletDir != "" { + authTokenPath = filepath.Join(walletDir, api.AuthTokenFileName) + } + } s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ Host: c.cliCtx.String(flags.RPCHost.Name), Port: fmt.Sprintf("%d", c.cliCtx.Int(flags.RPCPort.Name)), @@ -624,14 +634,15 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { GRPCRetryDelay: c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name), GRPCHeaders: strings.Split(c.cliCtx.String(flags.GrpcHeadersFlag.Name), ","), BeaconNodeGRPCEndpoint: c.cliCtx.String(flags.BeaconRPCProviderFlag.Name), - BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRPCGatewayProviderFlag.Name), + BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRESTApiProviderFlag.Name), BeaconApiTimeout: time.Second * 30, BeaconNodeCert: c.cliCtx.String(flags.CertFlag.Name), DB: c.db, Wallet: c.wallet, - WalletDir: c.cliCtx.String(flags.WalletDirFlag.Name), + WalletDir: walletDir, WalletInitializedFeed: c.walletInitializedFeed, ValidatorService: vs, + AuthTokenPath: authTokenPath, Router: router, }) return c.services.RegisterService(s) diff --git a/validator/rpc/intercepter.go b/validator/rpc/intercepter.go index 6dedcdaef469..1f574a433ead 100644 --- a/validator/rpc/intercepter.go +++ b/validator/rpc/intercepter.go @@ -37,7 +37,7 @@ func (s *Server) AuthTokenInterceptor() grpc.UnaryServerInterceptor { func (s *Server) AuthTokenHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // if it's not initialize or has a web prefix - if strings.Contains(r.URL.Path, api.WebApiUrlPrefix) || strings.Contains(r.URL.Path, api.KeymanagerApiPrefix) { + if (strings.Contains(r.URL.Path, api.WebApiUrlPrefix) || strings.Contains(r.URL.Path, api.KeymanagerApiPrefix)) && !strings.Contains(r.URL.Path, api.SystemLogsPrefix) { // ignore some routes reqToken := r.Header.Get("Authorization") if reqToken == "" { diff --git a/validator/rpc/server.go b/validator/rpc/server.go index eacc8eb7a259..6120e5ccfd08 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -47,6 +47,7 @@ type Config struct { WalletDir string WalletInitializedFeed *event.Feed ValidatorService *client.ValidatorService + AuthTokenPath string Router *mux.Router } @@ -92,6 +93,8 @@ func NewServer(ctx context.Context, cfg *Config) *Server { server := &Server{ ctx: ctx, cancel: cancel, + logStreamer: logs.NewStreamServer(), + logStreamerBufferSize: 1000, // Enough to handle most bursts of logs in the validator client. host: cfg.Host, port: cfg.Port, grpcGatewayHost: cfg.GRPCGatewayHost, @@ -100,6 +103,17 @@ func NewServer(ctx context.Context, cfg *Config) *Server { grpcRetries: cfg.GRPCRetries, grpcRetryDelay: cfg.GRPCRetryDelay, grpcHeaders: cfg.GRPCHeaders, + validatorService: cfg.ValidatorService, + authTokenPath: cfg.AuthTokenPath, + db: cfg.DB, + walletDir: cfg.WalletDir, + walletInitializedFeed: cfg.WalletInitializedFeed, + walletInitialized: cfg.Wallet != nil, + wallet: cfg.Wallet, + beaconApiTimeout: cfg.BeaconApiTimeout, + beaconApiEndpoint: cfg.BeaconApiEndpoint, + beaconNodeEndpoint: cfg.BeaconNodeGRPCEndpoint, + router: cfg.Router, } if server.authTokenPath == "" && server.walletDir != "" { From b04baa93cd4f10e4c7c14edff12ad5af4a08dfff Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Thu, 23 May 2024 10:15:50 -0500 Subject: [PATCH 106/325] convert ZeroWei to a func to avoid shared pointer (#14043) Co-authored-by: Kasey Kirkham --- .../validator/construct_generic_block_test.go | 18 +++++++++--------- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../v1alpha1/validator/proposer_bellatrix.go | 4 ++-- .../validator/proposer_bellatrix_test.go | 2 +- consensus-types/blocks/get_payload.go | 2 +- consensus-types/primitives/wei.go | 6 ++++-- consensus-types/primitives/wei_test.go | 4 ++-- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go index d3ecf2323e77..8e1a9f9bcc1e 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go @@ -18,7 +18,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { // Test when sBlk or sBlk.Block() is nil t.Run("NilBlock", func(t *testing.T) { - _, err := vs.constructGenericBeaconBlock(nil, nil, primitives.ZeroWei) + _, err := vs.constructGenericBeaconBlock(nil, nil, primitives.ZeroWei()) require.ErrorContains(t, "block cannot be nil", err) }) @@ -39,7 +39,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { require.NoError(t, err) r1, err := eb.Block.HashTreeRoot() require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei()) require.NoError(t, err) r2, err := result.GetElectra().Block.HashTreeRoot() require.NoError(t, err) @@ -71,7 +71,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { contents := ð.BeaconBlockContentsDeneb{Block: eb.Block, KzgProofs: bundle.Proofs, Blobs: bundle.Blobs} r1, err := contents.HashTreeRoot() require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, bundle, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, bundle, primitives.ZeroWei()) require.NoError(t, err) r2, err := result.GetDeneb().HashTreeRoot() require.NoError(t, err) @@ -86,7 +86,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { r1, err := b.Block().HashTreeRoot() require.NoError(t, err) scs := &enginev1.BlobsBundle{} - result, err := vs.constructGenericBeaconBlock(b, scs, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, scs, primitives.ZeroWei()) require.NoError(t, err) r2, err := result.GetBlindedDeneb().HashTreeRoot() require.NoError(t, err) @@ -99,7 +99,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("capella block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei()) require.NoError(t, err) r1, err := result.GetCapella().HashTreeRoot() require.NoError(t, err) @@ -113,7 +113,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("blind capella block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBlindedBeaconBlockCapella()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei()) require.NoError(t, err) r1, err := result.GetBlindedCapella().HashTreeRoot() require.NoError(t, err) @@ -127,7 +127,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("bellatrix block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockBellatrix()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei()) require.NoError(t, err) r1, err := result.GetBellatrix().HashTreeRoot() require.NoError(t, err) @@ -141,7 +141,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("altair block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockAltair()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei()) require.NoError(t, err) r1, err := result.GetAltair().HashTreeRoot() require.NoError(t, err) @@ -155,7 +155,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) { t.Run("phase0 block", func(t *testing.T) { b, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlock()) require.NoError(t, err) - result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei) + result, err := vs.constructGenericBeaconBlock(b, nil, primitives.ZeroWei()) require.NoError(t, err) r1, err := result.GetPhase0().HashTreeRoot() require.NoError(t, err) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 5a07de13d243..07bece2470f8 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -225,7 +225,7 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed vs.setBlsToExecData(sBlk, head) }() - winningBid := primitives.ZeroWei + winningBid := primitives.ZeroWei() var bundle *enginev1.BlobsBundle if sBlk.Version() >= version.Bellatrix { local, err := vs.getLocalPayload(ctx, sBlk.Block(), head) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 925322ee7e8f..e33bc4f2fa70 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -59,11 +59,11 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc slot := blk.Block().Slot() if slots.ToEpoch(slot) < params.BeaconConfig().BellatrixForkEpoch { - return primitives.ZeroWei, nil, nil + return primitives.ZeroWei(), nil, nil } if local == nil { - return primitives.ZeroWei, nil, errors.New("local payload is nil") + return primitives.ZeroWei(), nil, errors.New("local payload is nil") } // Use local payload if builder payload is nil. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go index 3647973d37d2..6e79ada339c5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go @@ -503,7 +503,7 @@ func TestServer_setExecutionData(t *testing.T) { GetPayloadResponse: &blocks.GetPayloadResponse{ ExecutionData: ed, BlobsBundle: blobsBundle, - Bid: primitives.ZeroWei, + Bid: primitives.ZeroWei(), }, } blk.SetSlot(primitives.Slot(params.BeaconConfig().DenebForkEpoch) * params.BeaconConfig().SlotsPerEpoch) diff --git a/consensus-types/blocks/get_payload.go b/consensus-types/blocks/get_payload.go index 030665e3fa3b..c12e84a3acd0 100644 --- a/consensus-types/blocks/get_payload.go +++ b/consensus-types/blocks/get_payload.go @@ -38,7 +38,7 @@ func NewGetPayloadResponse(msg proto.Message) (*GetPayloadResponse, error) { r.BlobsBundle = bundleGetter.GetBlobsBundle() } bidValueGetter, hasBid := msg.(bidValueGetter) - wei := primitives.ZeroWei + wei := primitives.ZeroWei() if hasBid { // The protobuf types that engine api responses unmarshal into store their values in little endian form. // This is done for consistency with other uint256 values stored in protobufs for SSZ values. diff --git a/consensus-types/primitives/wei.go b/consensus-types/primitives/wei.go index 01aa288894c5..7e7d12bd2b51 100644 --- a/consensus-types/primitives/wei.go +++ b/consensus-types/primitives/wei.go @@ -8,8 +8,10 @@ import ( fssz "github.com/prysmaticlabs/fastssz" ) -// ZeroWei is a non-nil zero value for primitives.Wei -var ZeroWei Wei = big.NewInt(0) +// ZW returns a non-nil zero value for primitives.Wei +func ZeroWei() Wei { + return big.NewInt(0) +} // Wei is the smallest unit of Ether, represented as a pointer to a bigInt. type Wei *big.Int diff --git a/consensus-types/primitives/wei_test.go b/consensus-types/primitives/wei_test.go index c8276968fc62..2cdcd2a15dab 100644 --- a/consensus-types/primitives/wei_test.go +++ b/consensus-types/primitives/wei_test.go @@ -10,7 +10,7 @@ import ( ) func TestWeiStringer(t *testing.T) { - require.Equal(t, "0", primitives.WeiToBigInt(primitives.ZeroWei).String()) + require.Equal(t, "0", primitives.WeiToBigInt(primitives.ZeroWei()).String()) require.Equal(t, "1234", primitives.WeiToBigInt(primitives.Uint64ToWei(1234)).String()) require.Equal(t, "18446744073709551615", primitives.WeiToBigInt(primitives.Uint64ToWei(math.MaxUint64)).String()) } @@ -41,6 +41,6 @@ func TestWeiToGwei_CopyOk(t *testing.T) { } func TestZero(t *testing.T) { - z := primitives.ZeroWei + z := primitives.ZeroWei() require.Equal(t, 0, big.NewInt(0).Cmp(z)) } From 62b5c43d876d31a35040d0a29d6d6bbfd6467b22 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Thu, 23 May 2024 12:57:53 -0500 Subject: [PATCH 107/325] paranoid underflow protection without error handling (#14044) Co-authored-by: Kasey Kirkham --- beacon-chain/sync/initial-sync/blocks_fetcher.go | 2 +- consensus-types/primitives/slot.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher.go b/beacon-chain/sync/initial-sync/blocks_fetcher.go index 396a95abb4e2..915826801ed7 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher.go @@ -461,7 +461,7 @@ func (r *blobRange) Request() *p2ppb.BlobSidecarsByRangeRequest { } return &p2ppb.BlobSidecarsByRangeRequest{ StartSlot: r.low, - Count: uint64(r.high.SubSlot(r.low)) + 1, + Count: uint64(r.high.FlooredSubSlot(r.low)) + 1, } } diff --git a/consensus-types/primitives/slot.go b/consensus-types/primitives/slot.go index 3579f4dd97f1..1f9490f88338 100644 --- a/consensus-types/primitives/slot.go +++ b/consensus-types/primitives/slot.go @@ -124,6 +124,14 @@ func (s Slot) SubSlot(x Slot) Slot { return s.Sub(uint64(x)) } +// FlooredSubSlot safely subtracts x from the slot, returning 0 if the result would underflow. +func (s Slot) FlooredSubSlot(x Slot) Slot { + if s < x { + return 0 + } + return s - x +} + // SafeSubSlot finds difference between two slot values. // In case of arithmetic issues (overflow/underflow/div by zero) error is returned. func (s Slot) SafeSubSlot(x Slot) (Slot, error) { From d2966a4c5b0251379bec636b8e4383ec0d5ecc8e Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 23 May 2024 13:01:38 -0500 Subject: [PATCH 108/325] Electra core transition operations (#14001) * adding electra operations * enabling spec tests * adding electra process epoch * skipping spec tests for now * Update testing/spectest/minimal/electra/fork_transition/BUILD.bazel Co-authored-by: Preston Van Loon * fixing naming * gaz * fixing more bazel build stuff --------- Co-authored-by: Preston Van Loon --- beacon-chain/core/electra/BUILD.bazel | 8 +- .../{balance_deposits.go => deposits.go} | 10 ++ ...ance_deposits_test.go => deposits_test.go} | 0 .../core/electra/effective_balance_updates.go | 29 +++++ beacon-chain/core/electra/registry_updates.go | 34 ++++++ beacon-chain/core/electra/transition.go | 102 +++++++++++++++++ beacon-chain/core/electra/withdrawals.go | 80 +++++++++++++ beacon-chain/core/transition/transition.go | 10 +- .../transition/transition_no_verify_sig.go | 106 ++++++++++++++++-- .../electra/fork_transition/BUILD.bazel | 13 +++ .../fork_transition/transition_test.go | 12 ++ 11 files changed, 387 insertions(+), 17 deletions(-) rename beacon-chain/core/electra/{balance_deposits.go => deposits.go} (82%) rename beacon-chain/core/electra/{balance_deposits_test.go => deposits_test.go} (100%) create mode 100644 beacon-chain/core/electra/effective_balance_updates.go create mode 100644 beacon-chain/core/electra/registry_updates.go create mode 100644 beacon-chain/core/electra/withdrawals.go create mode 100644 testing/spectest/minimal/electra/fork_transition/BUILD.bazel create mode 100644 testing/spectest/minimal/electra/fork_transition/transition_test.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 1d8ad06b35d8..ded97b035efd 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -3,18 +3,22 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ - "balance_deposits.go", "churn.go", "consolidations.go", + "deposits.go", + "effective_balance_updates.go", + "registry_updates.go", "transition.go", "upgrade.go", "validator.go", + "withdrawals.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra", visibility = ["//visibility:public"], deps = [ "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/epoch:go_default_library", + "//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", @@ -36,9 +40,9 @@ go_library( go_test( name = "go_default_test", srcs = [ - "balance_deposits_test.go", "churn_test.go", "consolidations_test.go", + "deposits_test.go", "upgrade_test.go", "validator_test.go", ], diff --git a/beacon-chain/core/electra/balance_deposits.go b/beacon-chain/core/electra/deposits.go similarity index 82% rename from beacon-chain/core/electra/balance_deposits.go rename to beacon-chain/core/electra/deposits.go index 6f1874e9a318..507da30c904b 100644 --- a/beacon-chain/core/electra/balance_deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -7,6 +7,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "go.opencensus.io/trace" ) @@ -75,3 +76,12 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac return st.SetDepositBalanceToConsume(availableForProcessing) } } + +// ProcessDepositReceipts is a function as part of electra to process execution layer deposits +func ProcessDepositReceipts(ctx context.Context, beaconState state.BeaconState, receipts []*enginev1.DepositReceipt) (state.BeaconState, error) { + _, span := trace.StartSpan(ctx, "electra.ProcessDepositReceipts") + defer span.End() + // TODO: replace with 6110 logic + // return b.ProcessDepositReceipts(beaconState, receipts) + return beaconState, nil +} diff --git a/beacon-chain/core/electra/balance_deposits_test.go b/beacon-chain/core/electra/deposits_test.go similarity index 100% rename from beacon-chain/core/electra/balance_deposits_test.go rename to beacon-chain/core/electra/deposits_test.go diff --git a/beacon-chain/core/electra/effective_balance_updates.go b/beacon-chain/core/electra/effective_balance_updates.go new file mode 100644 index 000000000000..256fad220554 --- /dev/null +++ b/beacon-chain/core/electra/effective_balance_updates.go @@ -0,0 +1,29 @@ +package electra + +import "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + +// ProcessEffectiveBalanceUpdates processes effective balance updates during epoch processing. +// +// Spec pseudocode definition: +// +// def process_effective_balance_updates(state: BeaconState) -> None: +// # Update effective balances with hysteresis +// for index, validator in enumerate(state.validators): +// balance = state.balances[index] +// HYSTERESIS_INCREMENT = uint64(EFFECTIVE_BALANCE_INCREMENT // HYSTERESIS_QUOTIENT) +// DOWNWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_DOWNWARD_MULTIPLIER +// UPWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_UPWARD_MULTIPLIER +// EFFECTIVE_BALANCE_LIMIT = ( +// MAX_EFFECTIVE_BALANCE_EIP7251 if has_compounding_withdrawal_credential(validator) +// else MIN_ACTIVATION_BALANCE +// ) +// +// if ( +// balance + DOWNWARD_THRESHOLD < validator.effective_balance +// or validator.effective_balance + UPWARD_THRESHOLD < balance +// ): +// validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, EFFECTIVE_BALANCE_LIMIT) +func ProcessEffectiveBalanceUpdates(state state.BeaconState) error { + // TODO: replace with real implementation + return nil +} diff --git a/beacon-chain/core/electra/registry_updates.go b/beacon-chain/core/electra/registry_updates.go new file mode 100644 index 000000000000..546413058d31 --- /dev/null +++ b/beacon-chain/core/electra/registry_updates.go @@ -0,0 +1,34 @@ +package electra + +import ( + "context" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" +) + +// ProcessRegistryUpdates rotates validators in and out of active pool. +// the amount to rotate is determined churn limit. +// +// Spec pseudocode definition: +// +// def process_registry_updates(state: BeaconState) -> None: +// # Process activation eligibility and ejections +// for index, validator in enumerate(state.validators): +// if is_eligible_for_activation_queue(validator): +// validator.activation_eligibility_epoch = get_current_epoch(state) + 1 +// +// if ( +// is_active_validator(validator, get_current_epoch(state)) +// and validator.effective_balance <= EJECTION_BALANCE +// ): +// initiate_validator_exit(state, ValidatorIndex(index)) +// +// # Activate all eligible validators +// activation_epoch = compute_activation_exit_epoch(get_current_epoch(state)) +// for validator in state.validators: +// if is_eligible_for_activation(state, validator): +// validator.activation_epoch = activation_epoch +func ProcessRegistryUpdates(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { + // TODO: replace with real implementation + return state, nil +} diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 878b2e67c96c..6f807c6f8d27 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -1,8 +1,15 @@ package electra import ( + "context" + + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" e "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "go.opencensus.io/trace" ) // Re-exports for methods that haven't changed in Electra. @@ -21,3 +28,98 @@ var ( AttestationsDelta = altair.AttestationsDelta ProcessSyncAggregate = altair.ProcessSyncAggregate ) + +// ProcessEpoch describes the per epoch operations that are performed on the beacon state. +// It's optimized by pre computing validator attested info and epoch total/attested balances upfront. +// +// Spec definition: +// +// def process_epoch(state: BeaconState) -> None: +// process_justification_and_finalization(state) +// process_inactivity_updates(state) +// process_rewards_and_penalties(state) +// process_registry_updates(state) +// process_slashings(state) +// process_eth1_data_reset(state) +// process_pending_balance_deposits(state) # New in EIP7251 +// process_pending_consolidations(state) # New in EIP7251 +// process_effective_balance_updates(state) +// process_slashings_reset(state) +// process_randao_mixes_reset(state) +func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { + _, span := trace.StartSpan(ctx, "electra.ProcessEpoch") + defer span.End() + + if state == nil || state.IsNil() { + return nil, errors.New("nil state") + } + vp, bp, err := InitializePrecomputeValidators(ctx, state) + if err != nil { + return nil, err + } + vp, bp, err = ProcessEpochParticipation(ctx, state, bp, vp) + if err != nil { + return nil, err + } + state, err = precompute.ProcessJustificationAndFinalizationPreCompute(state, bp) + if err != nil { + return nil, errors.Wrap(err, "could not process justification") + } + state, vp, err = ProcessInactivityScores(ctx, state, vp) + if err != nil { + return nil, errors.Wrap(err, "could not process inactivity updates") + } + state, err = ProcessRewardsAndPenaltiesPrecompute(state, bp, vp) + if err != nil { + return nil, errors.Wrap(err, "could not process rewards and penalties") + } + state, err = ProcessRegistryUpdates(ctx, state) + if err != nil { + return nil, errors.Wrap(err, "could not process registry updates") + } + proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier() + if err != nil { + return nil, err + } + state, err = ProcessSlashings(state, proportionalSlashingMultiplier) + if err != nil { + return nil, err + } + state, err = ProcessEth1DataReset(state) + if err != nil { + return nil, err + } + if err = ProcessPendingBalanceDeposits(ctx, state, primitives.Gwei(bp.ActiveCurrentEpoch)); err != nil { + return nil, err + } + if err := ProcessPendingConsolidations(ctx, state); err != nil { + return nil, err + } + if err := ProcessEffectiveBalanceUpdates(state); err != nil { + return nil, err + } + state, err = ProcessSlashingsReset(state) + if err != nil { + return nil, err + } + state, err = ProcessRandaoMixesReset(state) + if err != nil { + return nil, err + } + state, err = ProcessHistoricalDataUpdate(state) + if err != nil { + return nil, err + } + + state, err = ProcessParticipationFlagUpdates(state) + if err != nil { + return nil, err + } + + state, err = ProcessSyncCommitteeUpdates(ctx, state) + if err != nil { + return nil, err + } + + return state, nil +} diff --git a/beacon-chain/core/electra/withdrawals.go b/beacon-chain/core/electra/withdrawals.go new file mode 100644 index 000000000000..df2df1cedd3d --- /dev/null +++ b/beacon-chain/core/electra/withdrawals.go @@ -0,0 +1,80 @@ +package electra + +import ( + "context" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// ProcessExecutionLayerWithdrawRequests processes the validator withdrawals from the provided execution payload +// into the beacon state triggered by the execution layer. +// +// Spec pseudocode definition: +// +// def process_execution_layer_withdrawal_request( +// +// state: BeaconState, +// execution_layer_withdrawal_request: ExecutionLayerWithdrawalRequest +// +// ) -> None: +// amount = execution_layer_withdrawal_request.amount +// is_full_exit_request = amount == FULL_EXIT_REQUEST_AMOUNT +// +// # If partial withdrawal queue is full, only full exits are processed +// if len(state.pending_partial_withdrawals) == PENDING_PARTIAL_WITHDRAWALS_LIMIT and not is_full_exit_request: +// return +// +// validator_pubkeys = [v.pubkey for v in state.validators] +// # Verify pubkey exists +// request_pubkey = execution_layer_withdrawal_request.validator_pubkey +// if request_pubkey not in validator_pubkeys: +// return +// index = ValidatorIndex(validator_pubkeys.index(request_pubkey)) +// validator = state.validators[index] +// +// # Verify withdrawal credentials +// has_correct_credential = has_execution_withdrawal_credential(validator) +// is_correct_source_address = ( +// validator.withdrawal_credentials[12:] == execution_layer_withdrawal_request.source_address +// ) +// if not (has_correct_credential and is_correct_source_address): +// return +// # Verify the validator is active +// if not is_active_validator(validator, get_current_epoch(state)): +// return +// # Verify exit has not been initiated +// if validator.exit_epoch != FAR_FUTURE_EPOCH: +// return +// # Verify the validator has been active long enough +// if get_current_epoch(state) < validator.activation_epoch + SHARD_COMMITTEE_PERIOD: +// return +// +// pending_balance_to_withdraw = get_pending_balance_to_withdraw(state, index) +// +// if is_full_exit_request: +// # Only exit validator if it has no pending withdrawals in the queue +// if pending_balance_to_withdraw == 0: +// initiate_validator_exit(state, index) +// return +// +// has_sufficient_effective_balance = validator.effective_balance >= MIN_ACTIVATION_BALANCE +// has_excess_balance = state.balances[index] > MIN_ACTIVATION_BALANCE + pending_balance_to_withdraw +// +// # Only allow partial withdrawals with compounding withdrawal credentials +// if has_compounding_withdrawal_credential(validator) and has_sufficient_effective_balance and has_excess_balance: +// to_withdraw = min( +// state.balances[index] - MIN_ACTIVATION_BALANCE - pending_balance_to_withdraw, +// amount +// ) +// exit_queue_epoch = compute_exit_epoch_and_update_churn(state, to_withdraw) +// withdrawable_epoch = Epoch(exit_queue_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY) +// state.pending_partial_withdrawals.append(PendingPartialWithdrawal( +// index=index, +// amount=to_withdraw, +// withdrawable_epoch=withdrawable_epoch, +// )) +func ProcessExecutionLayerWithdrawRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.ExecutionLayerWithdrawalRequest) (state.BeaconState, error) { + //TODO: replace with real implementation + return st, nil +} diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index 253cf2ad941d..fadb5f26785b 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -256,14 +256,18 @@ func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives. tracing.AnnotateError(span, err) return nil, errors.Wrap(err, "could not process epoch with optimizations") } - } else if state.Version() >= version.Altair { + } else if state.Version() <= version.Deneb { state, err = altair.ProcessEpoch(ctx, state) if err != nil { tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, "could not process epoch") + return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) } } else { - return nil, errors.New("beacon state should have a version") + state, err = electra.ProcessEpoch(ctx, state) + if err != nil { + tracing.AnnotateError(span, err) + return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) + } } } if err := state.SetSlot(state.Slot() + 1); err != nil { diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index c4c357dfea2c..fee97de0d292 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition/interop" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -223,19 +224,29 @@ func ProcessBlockNoVerifyAnySig( // // Spec pseudocode definition: // -// def process_operations(state: BeaconState, body: ReadOnlyBeaconBlockBody) -> None: -// # Verify that outstanding deposits are processed up to the maximum number of deposits -// assert len(body.deposits) == min(MAX_DEPOSITS, state.eth1_data.deposit_count - state.eth1_deposit_index) +// def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: +// # [Modified in Electra:EIP6110] +// # Disable former deposit mechanism once all prior deposits are processed +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index) +// if state.eth1_deposit_index < eth1_deposit_index_limit: +// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) +// else: +// assert len(body.deposits) == 0 // -// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: -// for operation in operations: -// fn(state, operation) +// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: +// for operation in operations: +// fn(state, operation) // -// for_ops(body.proposer_slashings, process_proposer_slashing) -// for_ops(body.attester_slashings, process_attester_slashing) -// for_ops(body.attestations, process_attestation) -// for_ops(body.deposits, process_deposit) -// for_ops(body.voluntary_exits, process_voluntary_exit) +// for_ops(body.proposer_slashings, process_proposer_slashing) +// for_ops(body.attester_slashings, process_attester_slashing) +// for_ops(body.attestations, process_attestation) # [Modified in Electra:EIP7549] +// for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251] +// for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251] +// for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) +// # [New in Electra:EIP7002:EIP7251] +// for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) +// for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt) # [New in Electra:EIP6110] +// for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] func ProcessOperationsNoVerifyAttsSigs( ctx context.Context, state state.BeaconState, @@ -257,11 +268,16 @@ func ProcessOperationsNoVerifyAttsSigs( if err != nil { return nil, err } - case version.Altair, version.Bellatrix, version.Capella, version.Deneb, version.Electra: + case version.Altair, version.Bellatrix, version.Capella, version.Deneb: state, err = altairOperations(ctx, state, beaconBlock) if err != nil { return nil, err } + case version.Electra: + state, err = electraOperations(ctx, state, beaconBlock) + if err != nil { + return nil, err + } default: return nil, errors.New("block does not have correct version") } @@ -378,6 +394,72 @@ func VerifyBlobCommitmentCount(blk interfaces.ReadOnlyBeaconBlock) error { return nil } +// electraOperations +// +// Spec definition: +// +// def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: +// # [Modified in Electra:EIP6110] +// # Disable former deposit mechanism once all prior deposits are processed +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index) +// if state.eth1_deposit_index < eth1_deposit_index_limit: +// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) +// else: +// assert len(body.deposits) == 0 +// +// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: +// for operation in operations: +// fn(state, operation) +// +// for_ops(body.proposer_slashings, process_proposer_slashing) +// for_ops(body.attester_slashings, process_attester_slashing) +// for_ops(body.attestations, process_attestation) # [Modified in Electra:EIP7549] +// for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251] +// for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251] +// for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) +// # [New in Electra:EIP7002:EIP7251] +// for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) +// for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt) # [New in Electra:EIP6110] +// for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] +func electraOperations( + ctx context.Context, + st state.BeaconState, + block interfaces.ReadOnlyBeaconBlock) (state.BeaconState, error) { + // 6110 validations are in VerifyOperationLengths + + // Electra extends the altair operations. + st, err := altairOperations(ctx, st, block) + if err != nil { + return nil, err + } + b := block.Body() + bod, ok := b.(interfaces.ROBlockBodyElectra) + if !ok { + return nil, errors.New("could not cast block body to electra block body") + } + e, err := bod.Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution data from block") + } + exe, ok := e.(interfaces.ExecutionDataElectra) + if !ok { + return nil, errors.New("could not cast execution data to electra execution data") + } + st, err = electra.ProcessExecutionLayerWithdrawRequests(ctx, st, exe.WithdrawalRequests()) + if err != nil { + return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") + } + st, err = electra.ProcessDepositReceipts(ctx, st, exe.DepositReceipts()) + if err != nil { + return nil, errors.Wrap(err, "could not process deposit receipts") + } + + if err := electra.ProcessConsolidations(ctx, st, bod.Consolidations()); err != nil { + return nil, errors.Wrap(err, "could not process consolidations") + } + return st, nil +} + // This calls altair block operations. func altairOperations( ctx context.Context, diff --git a/testing/spectest/minimal/electra/fork_transition/BUILD.bazel b/testing/spectest/minimal/electra/fork_transition/BUILD.bazel new file mode 100644 index 000000000000..8e7c80f61753 --- /dev/null +++ b/testing/spectest/minimal/electra/fork_transition/BUILD.bazel @@ -0,0 +1,13 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + timeout = "short", + srcs = ["transition_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = ["spectest"], + deps = ["//testing/spectest/shared/electra/fork:go_default_library"], +) diff --git a/testing/spectest/minimal/electra/fork_transition/transition_test.go b/testing/spectest/minimal/electra/fork_transition/transition_test.go new file mode 100644 index 000000000000..547dc4e66e8a --- /dev/null +++ b/testing/spectest/minimal/electra/fork_transition/transition_test.go @@ -0,0 +1,12 @@ +package fork_transition + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/fork" +) + +func TestMinimal_Electra_Transition(t *testing.T) { + t.Skip("TODO: Electra") + fork.RunForkTransitionTest(t, "minimal") +} From 10dedd5ced9cd3ed09bafbc8899ead53d1061da5 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Thu, 23 May 2024 15:07:16 -0700 Subject: [PATCH 109/325] Fix race conditions + cleanup (#14041) --- validator/client/runner_test.go | 21 ++++++++------- validator/client/testutil/mock_validator.go | 29 ++++++++++++++------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/validator/client/runner_test.go b/validator/client/runner_test.go index b617cb033f5c..3b4aedbb8d5e 100644 --- a/validator/client/runner_test.go +++ b/validator/client/runner_test.go @@ -181,7 +181,8 @@ func TestAttests_NextSlot(t *testing.T) { node.EXPECT().IsHealthy(gomock.Any()).Return(true).AnyTimes() // avoid race condition between the cancellation of the context in the go stream from slot and the setting of IsHealthy _ = tracker.CheckHealth(context.Background()) - v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker} + attSubmitted := make(chan interface{}) + v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker, AttSubmitted: attSubmitted} ctx, cancel := context.WithCancel(context.Background()) slot := primitives.Slot(55) @@ -193,9 +194,8 @@ func TestAttests_NextSlot(t *testing.T) { cancel() }() - timer := time.NewTimer(200 * time.Millisecond) run(ctx, v) - <-timer.C + <-attSubmitted require.Equal(t, true, v.AttestToBlockHeadCalled, "SubmitAttestation(%d) was not called", slot) assert.Equal(t, uint64(slot), v.AttestToBlockHeadArg1, "SubmitAttestation was called with wrong arg") } @@ -208,7 +208,8 @@ func TestProposes_NextSlot(t *testing.T) { node.EXPECT().IsHealthy(gomock.Any()).Return(true).AnyTimes() // avoid race condition between the cancellation of the context in the go stream from slot and the setting of IsHealthy _ = tracker.CheckHealth(context.Background()) - v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker} + blockProposed := make(chan interface{}) + v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker, BlockProposed: blockProposed} ctx, cancel := context.WithCancel(context.Background()) slot := primitives.Slot(55) @@ -220,9 +221,9 @@ func TestProposes_NextSlot(t *testing.T) { cancel() }() - timer := time.NewTimer(200 * time.Millisecond) run(ctx, v) - <-timer.C + <-blockProposed + require.Equal(t, true, v.ProposeBlockCalled, "ProposeBlock(%d) was not called", slot) assert.Equal(t, uint64(slot), v.ProposeBlockArg1, "ProposeBlock was called with wrong arg") } @@ -235,7 +236,9 @@ func TestBothProposesAndAttests_NextSlot(t *testing.T) { node.EXPECT().IsHealthy(gomock.Any()).Return(true).AnyTimes() // avoid race condition between the cancellation of the context in the go stream from slot and the setting of IsHealthy _ = tracker.CheckHealth(context.Background()) - v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker} + blockProposed := make(chan interface{}) + attSubmitted := make(chan interface{}) + v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker, BlockProposed: blockProposed, AttSubmitted: attSubmitted} ctx, cancel := context.WithCancel(context.Background()) slot := primitives.Slot(55) @@ -247,9 +250,9 @@ func TestBothProposesAndAttests_NextSlot(t *testing.T) { cancel() }() - timer := time.NewTimer(200 * time.Millisecond) run(ctx, v) - <-timer.C + <-blockProposed + <-attSubmitted require.Equal(t, true, v.AttestToBlockHeadCalled, "SubmitAttestation(%d) was not called", slot) assert.Equal(t, uint64(slot), v.AttestToBlockHeadArg1, "SubmitAttestation was called with wrong arg") require.Equal(t, true, v.ProposeBlockCalled, "ProposeBlock(%d) was not called", slot) diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index 47c22dde8921..15c4d17a537f 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -3,6 +3,7 @@ package testutil import ( "bytes" "context" + "errors" "time" api "github.com/prysmaticlabs/prysm/v5/api/client" @@ -60,6 +61,8 @@ type FakeValidator struct { Km keymanager.IKeymanager graffiti string Tracker *beacon.NodeHealthTracker + AttSubmitted chan interface{} + BlockProposed chan interface{} } // Done for mocking. @@ -73,7 +76,7 @@ func (fv *FakeValidator) WaitForKeymanagerInitialization(_ context.Context) erro return nil } -// LogSyncCommitteeMessagesSubmitted -- +// LogSubmittedSyncCommitteeMessages -- func (fv *FakeValidator) LogSubmittedSyncCommitteeMessages() {} // WaitForChainStart for mocking. @@ -170,12 +173,20 @@ func (fv *FakeValidator) RolesAt(_ context.Context, slot primitives.Slot) (map[[ func (fv *FakeValidator) SubmitAttestation(_ context.Context, slot primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte) { fv.AttestToBlockHeadCalled = true fv.AttestToBlockHeadArg1 = uint64(slot) + if fv.AttSubmitted != nil { + close(fv.AttSubmitted) + fv.AttSubmitted = nil + } } // ProposeBlock for mocking. func (fv *FakeValidator) ProposeBlock(_ context.Context, slot primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte) { fv.ProposeBlockCalled = true fv.ProposeBlockArg1 = uint64(slot) + if fv.BlockProposed != nil { + close(fv.BlockProposed) + fv.BlockProposed = nil + } } // SubmitAggregateAndProof for mocking. @@ -248,9 +259,9 @@ func (fv *FakeValidator) PushProposerSettings(ctx context.Context, km keymanager ctx = nctx defer cancel() time.Sleep(fv.ProposerSettingWait) - if ctx.Err() == context.DeadlineExceeded { + if errors.Is(ctx.Err(), context.DeadlineExceeded) { log.Error("deadline exceeded") - // can't return error or it will trigger a log.fatal + // can't return error as it will trigger a log.fatal return nil } @@ -284,19 +295,19 @@ func (fv *FakeValidator) SetProposerSettings(_ context.Context, settings *propos } // GetGraffiti for mocking -func (f *FakeValidator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { - return []byte(f.graffiti), nil +func (fv *FakeValidator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { + return []byte(fv.graffiti), nil } // SetGraffiti for mocking -func (f *FakeValidator) SetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error { - f.graffiti = string(graffiti) +func (fv *FakeValidator) SetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error { + fv.graffiti = string(graffiti) return nil } // DeleteGraffiti for mocking -func (f *FakeValidator) DeleteGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) error { - f.graffiti = "" +func (fv *FakeValidator) DeleteGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) error { + fv.graffiti = "" return nil } From c35889d4c66f89c56e3d761e37697c8c34361b35 Mon Sep 17 00:00:00 2001 From: terence Date: Fri, 24 May 2024 09:56:42 -0700 Subject: [PATCH 110/325] Fix `CommitteeAssignments` to not return every validator (#14039) * Rewrite CommitteeAssignments to not return every validator * Potuz's feedback --- beacon-chain/core/helpers/beacon_committee.go | 144 +++++++++++------- .../core/helpers/beacon_committee_test.go | 45 +++--- beacon-chain/rpc/eth/validator/handlers.go | 12 +- .../rpc/eth/validator/handlers_test.go | 1 + .../rpc/prysm/v1alpha1/beacon/assignments.go | 17 ++- .../prysm/v1alpha1/beacon/assignments_test.go | 48 +++--- .../rpc/prysm/v1alpha1/validator/duties.go | 30 +++- 7 files changed, 183 insertions(+), 114 deletions(-) diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index d1371a953779..2980c51091ab 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -143,105 +143,137 @@ func BeaconCommittee( return ComputeCommittee(validatorIndices, seed, indexOffset, count) } -// CommitteeAssignmentContainer represents a committee list, committee index, and to be attested slot for a given epoch. -type CommitteeAssignmentContainer struct { +// CommitteeAssignment represents committee list, committee index, and to be attested slot for a given epoch. +type CommitteeAssignment struct { Committee []primitives.ValidatorIndex AttesterSlot primitives.Slot CommitteeIndex primitives.CommitteeIndex } -// CommitteeAssignments is a map of validator indices pointing to the appropriate committee -// assignment for the given epoch. -// -// 1. Determine the proposer validator index for each slot. -// 2. Compute all committees. -// 3. Determine the attesting slot for each committee. -// 4. Construct a map of validator indices pointing to the respective committees. -func CommitteeAssignments( - ctx context.Context, - state state.BeaconState, - epoch primitives.Epoch, -) (map[primitives.ValidatorIndex]*CommitteeAssignmentContainer, map[primitives.ValidatorIndex][]primitives.Slot, error) { +// verifyAssignmentEpoch verifies if the given epoch is valid for assignment based on the provided state. +// It checks if the epoch is not greater than the next epoch, and if the start slot of the epoch is greater +// than or equal to the minimum valid start slot calculated based on the state's current slot and historical roots. +func verifyAssignmentEpoch(epoch primitives.Epoch, state state.BeaconState) error { nextEpoch := time.NextEpoch(state) if epoch > nextEpoch { - return nil, nil, fmt.Errorf( - "epoch %d can't be greater than next epoch %d", - epoch, - nextEpoch, - ) + return fmt.Errorf("epoch %d can't be greater than next epoch %d", epoch, nextEpoch) } - // We determine the slots in which proposers are supposed to act. - // Some validators may need to propose multiple times per epoch, so - // we use a map of proposer idx -> []slot to keep track of this possibility. startSlot, err := slots.EpochStart(epoch) if err != nil { - return nil, nil, err + return err } minValidStartSlot := primitives.Slot(0) - if state.Slot() >= params.BeaconConfig().SlotsPerHistoricalRoot { - minValidStartSlot = state.Slot() - params.BeaconConfig().SlotsPerHistoricalRoot + if stateSlot := state.Slot(); stateSlot >= params.BeaconConfig().SlotsPerHistoricalRoot { + minValidStartSlot = stateSlot - params.BeaconConfig().SlotsPerHistoricalRoot } if startSlot < minValidStartSlot { - return nil, nil, fmt.Errorf("start slot %d is smaller than the minimum valid start slot %d", startSlot, minValidStartSlot) + return fmt.Errorf("start slot %d is smaller than the minimum valid start slot %d", startSlot, minValidStartSlot) + } + return nil +} + +// ProposerAssignments calculates proposer assignments for each validator during the specified epoch. +// It verifies the validity of the epoch, then iterates through each slot in the epoch to determine the +// proposer for that slot and assigns them accordingly. +func ProposerAssignments(ctx context.Context, state state.BeaconState, epoch primitives.Epoch) (map[primitives.ValidatorIndex][]primitives.Slot, error) { + // Verify if the epoch is valid for assignment based on the provided state. + if err := verifyAssignmentEpoch(epoch, state); err != nil { + return nil, err + } + startSlot, err := slots.EpochStart(epoch) + if err != nil { + return nil, err } - proposerIndexToSlots := make(map[primitives.ValidatorIndex][]primitives.Slot, params.BeaconConfig().SlotsPerEpoch) + proposerAssignments := make(map[primitives.ValidatorIndex][]primitives.Slot) + + originalStateSlot := state.Slot() + for slot := startSlot; slot < startSlot+params.BeaconConfig().SlotsPerEpoch; slot++ { // Skip proposer assignment for genesis slot. if slot == 0 { continue } + // Set the state's current slot. if err := state.SetSlot(slot); err != nil { - return nil, nil, err + return nil, err } + + // Determine the proposer index for the current slot. i, err := BeaconProposerIndex(ctx, state) if err != nil { - return nil, nil, errors.Wrapf(err, "could not check proposer at slot %d", state.Slot()) + return nil, errors.Wrapf(err, "could not check proposer at slot %d", state.Slot()) } - proposerIndexToSlots[i] = append(proposerIndexToSlots[i], slot) - } - // If previous proposer indices computation is outside if current proposal epoch range, - // we need to reset state slot back to start slot so that we can compute the correct committees. - currentProposalEpoch := epoch < nextEpoch - if !currentProposalEpoch { - if err := state.SetSlot(state.Slot() - params.BeaconConfig().SlotsPerEpoch); err != nil { - return nil, nil, err + // Append the slot to the proposer's assignments. + if _, ok := proposerAssignments[i]; !ok { + proposerAssignments[i] = make([]primitives.Slot, 0) } + proposerAssignments[i] = append(proposerAssignments[i], slot) + } + + // Reset state back to its original slot. + if err := state.SetSlot(originalStateSlot); err != nil { + return nil, err + } + + return proposerAssignments, nil +} + +// CommitteeAssignments calculates committee assignments for each validator during the specified epoch. +// It retrieves active validator indices, determines the number of committees per slot, and computes +// assignments for each validator based on their presence in the provided validators slice. +func CommitteeAssignments(ctx context.Context, state state.BeaconState, epoch primitives.Epoch, validators []primitives.ValidatorIndex) (map[primitives.ValidatorIndex]*CommitteeAssignment, error) { + // Verify if the epoch is valid for assignment based on the provided state. + if err := verifyAssignmentEpoch(epoch, state); err != nil { + return nil, err + } + + // Retrieve active validator count for the specified epoch. + activeValidatorCount, err := ActiveValidatorCount(ctx, state, epoch) + if err != nil { + return nil, err } - activeValidatorIndices, err := ActiveValidatorIndices(ctx, state, epoch) + // Determine the number of committees per slot based on the number of active validator indices. + numCommitteesPerSlot := SlotCommitteeCount(activeValidatorCount) + + startSlot, err := slots.EpochStart(epoch) if err != nil { - return nil, nil, err + return nil, err } - // Each slot in an epoch has a different set of committees. This value is derived from the - // active validator set, which does not change. - numCommitteesPerSlot := SlotCommitteeCount(uint64(len(activeValidatorIndices))) - validatorIndexToCommittee := make(map[primitives.ValidatorIndex]*CommitteeAssignmentContainer, len(activeValidatorIndices)) - // Compute all committees for all slots. - for i := primitives.Slot(0); i < params.BeaconConfig().SlotsPerEpoch; i++ { - // Compute committees. + assignments := make(map[primitives.ValidatorIndex]*CommitteeAssignment) + vals := make(map[primitives.ValidatorIndex]struct{}) + for _, v := range validators { + vals[v] = struct{}{} + } + + // Compute committee assignments for each slot in the epoch. + for slot := startSlot; slot < startSlot+params.BeaconConfig().SlotsPerEpoch; slot++ { + // Compute committees for the current slot. for j := uint64(0); j < numCommitteesPerSlot; j++ { - slot := startSlot + i - committee, err := BeaconCommitteeFromState(ctx, state, slot, primitives.CommitteeIndex(j) /*committee index*/) + committee, err := BeaconCommitteeFromState(ctx, state, slot, primitives.CommitteeIndex(j)) if err != nil { - return nil, nil, err + return nil, err } - cac := &CommitteeAssignmentContainer{ - Committee: committee, - CommitteeIndex: primitives.CommitteeIndex(j), - AttesterSlot: slot, - } for _, vIndex := range committee { - validatorIndexToCommittee[vIndex] = cac + if _, ok := vals[vIndex]; !ok { // Skip if the validator is not in the provided validators slice. + continue + } + if _, ok := assignments[vIndex]; !ok { + assignments[vIndex] = &CommitteeAssignment{} + } + assignments[vIndex].Committee = committee + assignments[vIndex].AttesterSlot = slot + assignments[vIndex].CommitteeIndex = primitives.CommitteeIndex(j) } } } - return validatorIndexToCommittee, proposerIndexToSlots, nil + return assignments, nil } // VerifyBitfieldLength verifies that a bitfield length matches the given committee size. diff --git a/beacon-chain/core/helpers/beacon_committee_test.go b/beacon-chain/core/helpers/beacon_committee_test.go index 1402c207394d..fd3cc255230e 100644 --- a/beacon-chain/core/helpers/beacon_committee_test.go +++ b/beacon-chain/core/helpers/beacon_committee_test.go @@ -104,7 +104,10 @@ func TestCommitteeAssignments_CannotRetrieveFutureEpoch(t *testing.T) { Slot: 0, // Epoch 0. }) require.NoError(t, err) - _, _, err = helpers.CommitteeAssignments(context.Background(), state, epoch+1) + _, err = helpers.CommitteeAssignments(context.Background(), state, epoch+1, nil) + assert.ErrorContains(t, "can't be greater than next epoch", err) + + _, err = helpers.ProposerAssignments(context.Background(), state, epoch+1) assert.ErrorContains(t, "can't be greater than next epoch", err) } @@ -128,10 +131,10 @@ func TestCommitteeAssignments_NoProposerForSlot0(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), state, 0) - require.NoError(t, err, "Failed to determine CommitteeAssignments") - for _, ss := range proposerIndexToSlots { - for _, s := range ss { + assignments, err := helpers.ProposerAssignments(context.Background(), state, 0) + require.NoError(t, err, "Failed to determine Assignments") + for _, slots := range assignments { + for _, s := range slots { assert.NotEqual(t, uint64(0), s, "No proposer should be assigned to slot 0") } } @@ -140,6 +143,7 @@ func TestCommitteeAssignments_NoProposerForSlot0(t *testing.T) { func TestCommitteeAssignments_CanRetrieve(t *testing.T) { // Initialize test with 256 validators, each slot and each index gets 4 validators. validators := make([]*ethpb.Validator, 4*params.BeaconConfig().SlotsPerEpoch) + validatorIndices := make([]primitives.ValidatorIndex, len(validators)) for i := 0; i < len(validators); i++ { // First 2 epochs only half validators are activated. var activationEpoch primitives.Epoch @@ -150,6 +154,7 @@ func TestCommitteeAssignments_CanRetrieve(t *testing.T) { ActivationEpoch: activationEpoch, ExitEpoch: params.BeaconConfig().FarFutureEpoch, } + validatorIndices[i] = primitives.ValidatorIndex(i) } state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ @@ -201,14 +206,16 @@ func TestCommitteeAssignments_CanRetrieve(t *testing.T) { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { helpers.ClearCache() - validatorIndexToCommittee, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), state, slots.ToEpoch(tt.slot)) - require.NoError(t, err, "Failed to determine CommitteeAssignments") - cac := validatorIndexToCommittee[tt.index] + assignments, err := helpers.CommitteeAssignments(context.Background(), state, slots.ToEpoch(tt.slot), validatorIndices) + require.NoError(t, err, "Failed to determine Assignments") + cac := assignments[tt.index] assert.Equal(t, tt.committeeIndex, cac.CommitteeIndex, "Unexpected committeeIndex for validator index %d", tt.index) assert.Equal(t, tt.slot, cac.AttesterSlot, "Unexpected slot for validator index %d", tt.index) - if len(proposerIndexToSlots[tt.index]) > 0 && proposerIndexToSlots[tt.index][0] != tt.proposerSlot { + proposerAssignments, err := helpers.ProposerAssignments(context.Background(), state, slots.ToEpoch(tt.slot)) + require.NoError(t, err) + if len(proposerAssignments[tt.index]) > 0 && proposerAssignments[tt.index][0] != tt.proposerSlot { t.Errorf("wanted proposer slot %d, got proposer slot %d for validator index %d", - tt.proposerSlot, proposerIndexToSlots[tt.index][0], tt.index) + tt.proposerSlot, proposerAssignments[tt.index][0], tt.index) } assert.DeepEqual(t, tt.committee, cac.Committee, "Unexpected committee for validator index %d", tt.index) }) @@ -238,13 +245,13 @@ func TestCommitteeAssignments_CannotRetrieveFuture(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, proposerIndxs, err := helpers.CommitteeAssignments(context.Background(), state, time.CurrentEpoch(state)) + assignments, err := helpers.ProposerAssignments(context.Background(), state, time.CurrentEpoch(state)) require.NoError(t, err) - require.NotEqual(t, 0, len(proposerIndxs), "wanted non-zero proposer index set") + require.NotEqual(t, 0, len(assignments), "wanted non-zero proposer index set") - _, proposerIndxs, err = helpers.CommitteeAssignments(context.Background(), state, time.CurrentEpoch(state)+1) + assignments, err = helpers.ProposerAssignments(context.Background(), state, time.CurrentEpoch(state)+1) require.NoError(t, err) - require.NotEqual(t, 0, len(proposerIndxs), "wanted non-zero proposer index set") + require.NotEqual(t, 0, len(assignments), "wanted non-zero proposer index set") } func TestCommitteeAssignments_CannotRetrieveOlderThanSlotsPerHistoricalRoot(t *testing.T) { @@ -264,7 +271,7 @@ func TestCommitteeAssignments_CannotRetrieveOlderThanSlotsPerHistoricalRoot(t *t RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - _, _, err = helpers.CommitteeAssignments(context.Background(), state, 0) + _, err = helpers.CommitteeAssignments(context.Background(), state, 0, nil) require.ErrorContains(t, "start slot 0 is smaller than the minimum valid start slot 1", err) } @@ -286,12 +293,12 @@ func TestCommitteeAssignments_EverySlotHasMin1Proposer(t *testing.T) { }) require.NoError(t, err) epoch := primitives.Epoch(1) - _, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), state, epoch) - require.NoError(t, err, "Failed to determine CommitteeAssignments") + assignments, err := helpers.ProposerAssignments(context.Background(), state, epoch) + require.NoError(t, err, "Failed to determine Assignments") slotsWithProposers := make(map[primitives.Slot]bool) - for _, proposerSlots := range proposerIndexToSlots { - for _, slot := range proposerSlots { + for _, slots := range assignments { + for _, slot := range slots { slotsWithProposers[slot] = true } } diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 8359ac5656cf..f10dbb9d2b78 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -664,7 +664,7 @@ func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request) { return } - committeeAssignments, _, err := helpers.CommitteeAssignments(ctx, st, requestedEpoch) + assignments, err := helpers.CommitteeAssignments(ctx, st, requestedEpoch, requestedValIndices) if err != nil { httputil.HandleError(w, "Could not compute committee assignments: "+err.Error(), http.StatusInternalServerError) return @@ -684,7 +684,7 @@ func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request) { httputil.HandleError(w, fmt.Sprintf("Invalid validator index %d", index), http.StatusBadRequest) return } - committee := committeeAssignments[index] + committee := assignments[index] if committee == nil { continue } @@ -793,11 +793,11 @@ func (s *Server) GetProposerDuties(w http.ResponseWriter, r *http.Request) { } } - var proposals map[primitives.ValidatorIndex][]primitives.Slot + var assignments map[primitives.ValidatorIndex][]primitives.Slot if nextEpochLookahead { - _, proposals, err = helpers.CommitteeAssignments(ctx, st, nextEpoch) + assignments, err = helpers.ProposerAssignments(ctx, st, nextEpoch) } else { - _, proposals, err = helpers.CommitteeAssignments(ctx, st, requestedEpoch) + assignments, err = helpers.ProposerAssignments(ctx, st, requestedEpoch) } if err != nil { httputil.HandleError(w, "Could not compute committee assignments: "+err.Error(), http.StatusInternalServerError) @@ -805,7 +805,7 @@ func (s *Server) GetProposerDuties(w http.ResponseWriter, r *http.Request) { } duties := make([]*structs.ProposerDuty, 0) - for index, proposalSlots := range proposals { + for index, proposalSlots := range assignments { val, err := st.ValidatorAtIndexReadOnly(index) if err != nil { httputil.HandleError(w, fmt.Sprintf("Could not get validator at index %d: %v", index, err), http.StatusInternalServerError) diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 166d2f404212..57209ee7b58e 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -1737,6 +1737,7 @@ func TestGetProposerDuties(t *testing.T) { t.Run("next epoch", func(t *testing.T) { bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data) require.NoError(t, err, "Could not set up genesis state") + require.NoError(t, bs.SetSlot(params.BeaconConfig().SlotsPerEpoch)) require.NoError(t, bs.SetBlockRoots(roots)) chainSlot := primitives.Slot(0) chain := &mockChain.ChainService{ diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go index 9d01a5696555..26ff052b4458 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go @@ -105,23 +105,28 @@ func (bs *Server) ListValidatorAssignments( } // Initialize all committee related data. - committeeAssignments, proposerIndexToSlots, err := helpers.CommitteeAssignments(ctx, requestedState, requestedEpoch) + assignments, err := helpers.CommitteeAssignments(ctx, requestedState, requestedEpoch, filteredIndices[start:end]) if err != nil { return nil, status.Errorf(codes.Internal, "Could not compute committee assignments: %v", err) } + proposalSlots, err := helpers.ProposerAssignments(ctx, requestedState, requestedEpoch) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not compute proposer slots: %v", err) + } + for _, index := range filteredIndices[start:end] { if uint64(index) >= uint64(requestedState.NumValidators()) { return nil, status.Errorf(codes.OutOfRange, "Validator index %d >= validator count %d", index, requestedState.NumValidators()) } - comAssignment := committeeAssignments[index] + a := assignments[index] pubkey := requestedState.PubkeyAtIndex(index) assign := ðpb.ValidatorAssignments_CommitteeAssignment{ - BeaconCommittees: comAssignment.Committee, - CommitteeIndex: comAssignment.CommitteeIndex, - AttesterSlot: comAssignment.AttesterSlot, - ProposerSlots: proposerIndexToSlots[index], + BeaconCommittees: a.Committee, + CommitteeIndex: a.CommitteeIndex, + AttesterSlot: a.AttesterSlot, + ProposerSlots: proposalSlots[index], PublicKey: pubkey[:], ValidatorIndex: index, } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments_test.go index 665a5394a42b..3536c44732ee 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments_test.go @@ -174,16 +174,18 @@ func TestServer_ListAssignments_Pagination_DefaultPageSize_NoArchive(t *testing. activeIndices, err := helpers.ActiveValidatorIndices(ctx, s, 0) require.NoError(t, err) - committeeAssignments, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), s, 0) + assignments, err := helpers.CommitteeAssignments(context.Background(), s, 0, activeIndices[0:params.BeaconConfig().DefaultPageSize]) + require.NoError(t, err) + proposerSlots, err := helpers.ProposerAssignments(ctx, s, 0) require.NoError(t, err) for _, index := range activeIndices[0:params.BeaconConfig().DefaultPageSize] { val, err := s.ValidatorAtIndex(index) require.NoError(t, err) wanted = append(wanted, ðpb.ValidatorAssignments_CommitteeAssignment{ - BeaconCommittees: committeeAssignments[index].Committee, - CommitteeIndex: committeeAssignments[index].CommitteeIndex, - AttesterSlot: committeeAssignments[index].AttesterSlot, - ProposerSlots: proposerIndexToSlots[index], + BeaconCommittees: assignments[index].Committee, + CommitteeIndex: assignments[index].CommitteeIndex, + AttesterSlot: assignments[index].AttesterSlot, + ProposerSlots: proposerSlots[index], PublicKey: val.PublicKey, ValidatorIndex: index, }) @@ -244,16 +246,18 @@ func TestServer_ListAssignments_FilterPubkeysIndices_NoPagination(t *testing.T) activeIndices, err := helpers.ActiveValidatorIndices(ctx, s, 0) require.NoError(t, err) - committeeAssignments, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), s, 0) + assignments, err := helpers.CommitteeAssignments(context.Background(), s, 0, activeIndices[1:4]) + require.NoError(t, err) + proposerSlots, err := helpers.ProposerAssignments(ctx, s, 0) require.NoError(t, err) for _, index := range activeIndices[1:4] { val, err := s.ValidatorAtIndex(index) require.NoError(t, err) wanted = append(wanted, ðpb.ValidatorAssignments_CommitteeAssignment{ - BeaconCommittees: committeeAssignments[index].Committee, - CommitteeIndex: committeeAssignments[index].CommitteeIndex, - AttesterSlot: committeeAssignments[index].AttesterSlot, - ProposerSlots: proposerIndexToSlots[index], + BeaconCommittees: assignments[index].Committee, + CommitteeIndex: assignments[index].CommitteeIndex, + AttesterSlot: assignments[index].AttesterSlot, + ProposerSlots: proposerSlots[index], PublicKey: val.PublicKey, ValidatorIndex: index, }) @@ -312,16 +316,18 @@ func TestServer_ListAssignments_CanFilterPubkeysIndices_WithPagination(t *testin activeIndices, err := helpers.ActiveValidatorIndices(ctx, s, 0) require.NoError(t, err) - committeeAssignments, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), s, 0) + as, err := helpers.CommitteeAssignments(context.Background(), s, 0, activeIndices[3:5]) + require.NoError(t, err) + proposalSlots, err := helpers.ProposerAssignments(ctx, s, 0) require.NoError(t, err) for _, index := range activeIndices[3:5] { val, err := s.ValidatorAtIndex(index) require.NoError(t, err) assignments = append(assignments, ðpb.ValidatorAssignments_CommitteeAssignment{ - BeaconCommittees: committeeAssignments[index].Committee, - CommitteeIndex: committeeAssignments[index].CommitteeIndex, - AttesterSlot: committeeAssignments[index].AttesterSlot, - ProposerSlots: proposerIndexToSlots[index], + BeaconCommittees: as[index].Committee, + CommitteeIndex: as[index].CommitteeIndex, + AttesterSlot: as[index].AttesterSlot, + ProposerSlots: proposalSlots[index], PublicKey: val.PublicKey, ValidatorIndex: index, }) @@ -340,16 +346,18 @@ func TestServer_ListAssignments_CanFilterPubkeysIndices_WithPagination(t *testin req = ðpb.ListValidatorAssignmentsRequest{Indices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6}, PageSize: 5, PageToken: "1"} res, err = bs.ListValidatorAssignments(context.Background(), req) require.NoError(t, err) - cAssignments, proposerIndexToSlots, err := helpers.CommitteeAssignments(context.Background(), s, 0) + as, err = helpers.CommitteeAssignments(context.Background(), s, 0, activeIndices[6:7]) + require.NoError(t, err) + proposalSlots, err = helpers.ProposerAssignments(ctx, s, 0) require.NoError(t, err) for _, index := range activeIndices[6:7] { val, err := s.ValidatorAtIndex(index) require.NoError(t, err) assignments = append(assignments, ðpb.ValidatorAssignments_CommitteeAssignment{ - BeaconCommittees: cAssignments[index].Committee, - CommitteeIndex: cAssignments[index].CommitteeIndex, - AttesterSlot: cAssignments[index].AttesterSlot, - ProposerSlots: proposerIndexToSlots[index], + BeaconCommittees: as[index].Committee, + CommitteeIndex: as[index].CommitteeIndex, + AttesterSlot: as[index].AttesterSlot, + ProposerSlots: proposalSlots[index], PublicKey: val.PublicKey, ValidatorIndex: index, }) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go b/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go index a34ce85d3eb0..4d4a6ad53b12 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go @@ -7,6 +7,7 @@ import ( coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -52,16 +53,31 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb. return nil, status.Errorf(codes.Internal, "Could not process slots up to %d: %v", epochStartSlot, err) } } - committeeAssignments, proposerIndexToSlots, err := helpers.CommitteeAssignments(ctx, s, req.Epoch) + + requestIndices := make([]primitives.ValidatorIndex, 0, len(req.PublicKeys)) + for _, pubKey := range req.PublicKeys { + idx, ok := s.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) + if !ok { + continue + } + requestIndices = append(requestIndices, idx) + } + + assignments, err := helpers.CommitteeAssignments(ctx, s, req.Epoch, requestIndices) if err != nil { return nil, status.Errorf(codes.Internal, "Could not compute committee assignments: %v", err) } // Query the next epoch assignments for committee subnet subscriptions. - nextCommitteeAssignments, _, err := helpers.CommitteeAssignments(ctx, s, req.Epoch+1) + nextEpochAssignments, err := helpers.CommitteeAssignments(ctx, s, req.Epoch+1, requestIndices) if err != nil { return nil, status.Errorf(codes.Internal, "Could not compute next committee assignments: %v", err) } + proposalSlots, err := helpers.ProposerAssignments(ctx, s, req.Epoch) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not compute proposer slots: %v", err) + } + validatorAssignments := make([]*ethpb.DutiesResponse_Duty, 0, len(req.PublicKeys)) nextValidatorAssignments := make([]*ethpb.DutiesResponse_Duty, 0, len(req.PublicKeys)) @@ -81,20 +97,20 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb. assignment.ValidatorIndex = idx assignment.Status = s - assignment.ProposerSlots = proposerIndexToSlots[idx] + assignment.ProposerSlots = proposalSlots[idx] // The next epoch has no lookup for proposer indexes. nextAssignment.ValidatorIndex = idx nextAssignment.Status = s - ca, ok := committeeAssignments[idx] + ca, ok := assignments[idx] if ok { assignment.Committee = ca.Committee assignment.AttesterSlot = ca.AttesterSlot assignment.CommitteeIndex = ca.CommitteeIndex } // Save the next epoch assignments. - ca, ok = nextCommitteeAssignments[idx] + ca, ok = nextEpochAssignments[idx] if ok { nextAssignment.Committee = ca.Committee nextAssignment.AttesterSlot = ca.AttesterSlot @@ -123,9 +139,9 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb. // Next epoch sync committee duty is assigned with next period sync committee only during // sync period epoch boundary (ie. EPOCHS_PER_SYNC_COMMITTEE_PERIOD - 1). Else wise // next epoch sync committee duty is the same as current epoch. - nextSlotToEpoch := slots.ToEpoch(s.Slot() + 1) + nextEpoch := req.Epoch + 1 currentEpoch := coreTime.CurrentEpoch(s) - if slots.SyncCommitteePeriod(nextSlotToEpoch) == slots.SyncCommitteePeriod(currentEpoch)+1 { + if slots.SyncCommitteePeriod(nextEpoch) > slots.SyncCommitteePeriod(currentEpoch) { nextAssignment.IsSyncCommittee, err = helpers.IsNextPeriodSyncCommittee(s, idx) if err != nil { return nil, status.Errorf(codes.Internal, "Could not determine next epoch sync committee: %v", err) From 8e6d39a44b0de9f499c42d0b14ab1f41c86c0564 Mon Sep 17 00:00:00 2001 From: terence Date: Fri, 24 May 2024 11:56:40 -0700 Subject: [PATCH 111/325] Support electra blob type for by range request (#14047) Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- beacon-chain/sync/rpc_send_request.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beacon-chain/sync/rpc_send_request.go b/beacon-chain/sync/rpc_send_request.go index b44383574dde..30edbb09cf51 100644 --- a/beacon-chain/sync/rpc_send_request.go +++ b/beacon-chain/sync/rpc_send_request.go @@ -356,9 +356,10 @@ func readChunkedBlobSidecar(stream network.Stream, encoding encoder.NetworkEncod if !found { return b, errors.Wrapf(errBlobUnmarshal, fmt.Sprintf("unrecognized fork digest %#x", ctxb)) } - // Only deneb is supported at this time, because we lack a fork-spanning interface/union type for blobs. - if v != version.Deneb { - return b, fmt.Errorf("unexpected context bytes for deneb BlobSidecar, ctx=%#x, v=%s", ctxb, version.String(v)) + // Only deneb and electra are supported at this time, because we lack a fork-spanning interface/union type for blobs. + // In electra, there's no changes to blob type. + if v < version.Deneb { + return b, fmt.Errorf("unexpected context bytes for BlobSidecar, ctx=%#x, v=%s", ctxb, version.String(v)) } if err := decode(stream, pb); err != nil { return b, errors.Wrap(err, "failed to decode the protobuf-encoded BlobSidecar message from RPC chunk stream") From 2542189efc81048f81191136e669fcbfb5c36d16 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 24 May 2024 19:12:38 -0500 Subject: [PATCH 112/325] eip-7251: process_effective_balance_updates (#14003) * eip-7251: process_effective_balance_updates Spectests for process_effective_balance_updates process_effective_balance_updates unit tests * PR feedback from the amazing @rkapka --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- beacon-chain/core/electra/BUILD.bazel | 1 + .../core/electra/effective_balance_updates.go | 42 ++++- .../electra/effective_balance_updates_test.go | 144 ++++++++++++++++++ .../electra/epoch_processing/BUILD.bazel | 1 + .../effective_balance_updates_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 1 + .../effective_balance_updates_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 1 + .../effective_balance_updates.go | 30 ++++ 9 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 beacon-chain/core/electra/effective_balance_updates_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/effective_balance_updates_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/effective_balance_updates_test.go create mode 100644 testing/spectest/shared/electra/epoch_processing/effective_balance_updates.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index ded97b035efd..42dfffdb0e74 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -43,6 +43,7 @@ go_test( "churn_test.go", "consolidations_test.go", "deposits_test.go", + "effective_balance_updates_test.go", "upgrade_test.go", "validator_test.go", ], diff --git a/beacon-chain/core/electra/effective_balance_updates.go b/beacon-chain/core/electra/effective_balance_updates.go index 256fad220554..0458d3550e88 100644 --- a/beacon-chain/core/electra/effective_balance_updates.go +++ b/beacon-chain/core/electra/effective_balance_updates.go @@ -1,6 +1,13 @@ package electra -import "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" +import ( + "fmt" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) // ProcessEffectiveBalanceUpdates processes effective balance updates during epoch processing. // @@ -24,6 +31,35 @@ import "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" // ): // validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, EFFECTIVE_BALANCE_LIMIT) func ProcessEffectiveBalanceUpdates(state state.BeaconState) error { - // TODO: replace with real implementation - return nil + effBalanceInc := params.BeaconConfig().EffectiveBalanceIncrement + hysteresisInc := effBalanceInc / params.BeaconConfig().HysteresisQuotient + downwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisDownwardMultiplier + upwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisUpwardMultiplier + + bals := state.Balances() + + // Update effective balances with hysteresis. + validatorFunc := func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { + if val == nil { + return false, nil, fmt.Errorf("validator %d is nil in state", idx) + } + if idx >= len(bals) { + return false, nil, fmt.Errorf("validator index exceeds validator length in state %d >= %d", idx, len(state.Balances())) + } + balance := bals[idx] + + effectiveBalanceLimit := params.BeaconConfig().MinActivationBalance + if helpers.HasCompoundingWithdrawalCredential(val) { + effectiveBalanceLimit = params.BeaconConfig().MaxEffectiveBalanceElectra + } + + if balance+downwardThreshold < val.EffectiveBalance || val.EffectiveBalance+upwardThreshold < balance { + effectiveBal := min(balance-balance%effBalanceInc, effectiveBalanceLimit) + val.EffectiveBalance = effectiveBal + return false, val, nil + } + return false, val, nil + } + + return state.ApplyToEveryValidator(validatorFunc) } diff --git a/beacon-chain/core/electra/effective_balance_updates_test.go b/beacon-chain/core/electra/effective_balance_updates_test.go new file mode 100644 index 000000000000..8d3350fb4d7d --- /dev/null +++ b/beacon-chain/core/electra/effective_balance_updates_test.go @@ -0,0 +1,144 @@ +package electra_test + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestProcessEffectiveBalnceUpdates(t *testing.T) { + effBalanceInc := params.BeaconConfig().EffectiveBalanceIncrement + hysteresisInc := effBalanceInc / params.BeaconConfig().HysteresisQuotient + downwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisDownwardMultiplier + upwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisUpwardMultiplier + + tests := []struct { + name string + state state.BeaconState + wantErr bool + check func(*testing.T, state.BeaconState) + }{ + { + name: "validator with compounding withdrawal credentials updates effective balance", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0x11}, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MaxEffectiveBalanceElectra * 2, + }, + } + st, err := state_native.InitializeFromProtoElectra(pb) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, bs state.BeaconState) { + val, err := bs.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxEffectiveBalanceElectra, val.EffectiveBalance) + }, + }, + { + name: "validator without compounding withdrawal credentials updates effective balance", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance / 2, + WithdrawalCredentials: nil, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MaxEffectiveBalanceElectra, + }, + } + st, err := state_native.InitializeFromProtoElectra(pb) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, bs state.BeaconState) { + val, err := bs.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, val.EffectiveBalance) + }, + }, + { + name: "validator effective balance moves only when outside of threshold", + state: func() state.BeaconState { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0x11}, + }, + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0x11}, + }, + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0x11}, + }, + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0x11}, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MinActivationBalance - downwardThreshold - 1, // beyond downward threshold + params.BeaconConfig().MinActivationBalance - downwardThreshold + 1, // within downward threshold + params.BeaconConfig().MinActivationBalance + upwardThreshold + 1, // beyond upward threshold + params.BeaconConfig().MinActivationBalance + upwardThreshold - 1, // within upward threshold + }, + } + st, err := state_native.InitializeFromProtoElectra(pb) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, bs state.BeaconState) { + // validator 0 has a balance diff exceeding the threshold so a diff should be applied to + // effective balance and it moves by effective balance increment. + val, err := bs.ValidatorAtIndex(0) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance-params.BeaconConfig().EffectiveBalanceIncrement, val.EffectiveBalance) + + // validator 1 has a balance diff within the threshold so the effective balance should not + // have changed. + val, err = bs.ValidatorAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, val.EffectiveBalance) + + // Validator 2 has a balance diff exceeding the threshold so a diff should be applied to the + // effective balance and it moves by effective balance increment. + val, err = bs.ValidatorAtIndex(2) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance+params.BeaconConfig().EffectiveBalanceIncrement, val.EffectiveBalance) + + // Validator 3 has a balance diff within the threshold so the effective balance should not + // have changed. + val, err = bs.ValidatorAtIndex(3) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, val.EffectiveBalance) + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := electra.ProcessEffectiveBalanceUpdates(tt.state) + require.Equal(t, tt.wantErr, err != nil, "unexpected error returned wanted error=nil (%s), got error=%s", tt.wantErr, err) + if tt.check != nil { + tt.check(t, tt.state) + } + }) + } +} diff --git a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel index 7a22e82c49fb..cd8b0de62edf 100644 --- a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_test") go_test( name = "go_default_test", srcs = [ + "effective_balance_updates_test.go", "eth1_data_reset_test.go", "historical_summaries_update_test.go", "inactivity_updates_test.go", diff --git a/testing/spectest/mainnet/electra/epoch_processing/effective_balance_updates_test.go b/testing/spectest/mainnet/electra/epoch_processing/effective_balance_updates_test.go new file mode 100644 index 000000000000..22532aed6f0d --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/effective_balance_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_electra_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { + epoch_processing.RunEffectiveBalanceUpdatesTests(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel index f9d84a32e914..162e4f072fe7 100644 --- a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_test") go_test( name = "go_default_test", srcs = [ + "effective_balance_updates_test.go", "eth1_data_reset_test.go", "historical_summaries_update_test.go", "inactivity_updates_test.go", diff --git a/testing/spectest/minimal/electra/epoch_processing/effective_balance_updates_test.go b/testing/spectest/minimal/electra/epoch_processing/effective_balance_updates_test.go new file mode 100644 index 000000000000..0f14281f917e --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/effective_balance_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_electra_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { + epoch_processing.RunEffectiveBalanceUpdatesTests(t, "minimal") +} diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index 0f37ce9b7437..f651ce5c648e 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", testonly = True, srcs = [ + "effective_balance_updates.go", "eth1_data_reset.go", "helpers.go", "historical_summaries_update.go", diff --git a/testing/spectest/shared/electra/epoch_processing/effective_balance_updates.go b/testing/spectest/shared/electra/epoch_processing/effective_balance_updates.go new file mode 100644 index 000000000000..7396ef0cd629 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/effective_balance_updates.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunEffectiveBalanceUpdatesTests executes "epoch_processing/effective_balance_updates" tests. +func RunEffectiveBalanceUpdatesTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/effective_balance_updates/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processEffectiveBalanceUpdatesWrapper) + }) + } +} + +func processEffectiveBalanceUpdatesWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + err := electra.ProcessEffectiveBalanceUpdates(st) + require.NoError(t, err, "Could not process final updates") + return st, nil +} From 2f2152e039c6e9273873cfec73bf5edefcd41d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 28 May 2024 03:05:46 +0900 Subject: [PATCH 113/325] Only log error when aggregator check fails (#14046) * Only log error when aggregator check fails * review --- validator/client/validator.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index c78ef5fd1246..142ec9f32f1b 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -705,7 +705,8 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie aggregator, err := v.isAggregator(ctx, duty.Committee, slot, bytesutil.ToBytes48(duty.PublicKey), duty.ValidatorIndex) if err != nil { - return nil, errors.Wrap(err, "could not check if a validator is an aggregator") + aggregator = false + log.WithError(err).Errorf("Could not check if validator %#x is an aggregator", bytesutil.Trunc(duty.PublicKey)) } if aggregator { roles = append(roles, iface.RoleAggregator) @@ -730,7 +731,8 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie if inSyncCommittee { aggregator, err := v.isSyncCommitteeAggregator(ctx, slot, bytesutil.ToBytes48(duty.PublicKey), duty.ValidatorIndex) if err != nil { - return nil, errors.Wrap(err, "could not check if a validator is a sync committee aggregator") + aggregator = false + log.WithError(err).Errorf("Could not check if validator %#x is an aggregator", bytesutil.Trunc(duty.PublicKey)) } if aggregator { roles = append(roles, iface.RoleSyncCommitteeAggregator) From 2d15e53dabbea44ade23ae3ef4b16477811c7fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 28 May 2024 22:56:36 +0900 Subject: [PATCH 114/325] Eip 7549 core (#14037) * interfaces move * build fix * remove annoying warning * more build fixes * review * core code * tests part 1 * tests part 2 * TranslateParticipation doesn't need Electra * remove unused function * pending atts don't need Electra * tests part 3 * build fixes * review * remove newline * review * fix test --- .../blockchain/process_attestation.go | 4 +- .../blockchain/process_attestation_test.go | 49 ++-- beacon-chain/blockchain/process_block.go | 4 +- beacon-chain/blockchain/process_block_test.go | 168 ++++++++----- .../blockchain/receive_attestation_test.go | 6 +- beacon-chain/blockchain/receive_block.go | 6 +- beacon-chain/blockchain/setup_test.go | 2 + beacon-chain/core/altair/attestation.go | 4 +- beacon-chain/core/altair/attestation_test.go | 114 ++++++--- beacon-chain/core/altair/upgrade.go | 2 +- beacon-chain/core/blocks/attestation.go | 17 -- beacon-chain/core/blocks/attestation_test.go | 142 +++++++---- .../core/blocks/block_operations_fuzz_test.go | 15 -- beacon-chain/core/blocks/genesis.go | 37 ++- beacon-chain/core/blocks/signature.go | 4 +- beacon-chain/core/epoch/epoch_processing.go | 2 +- beacon-chain/core/helpers/BUILD.bazel | 1 + beacon-chain/core/helpers/beacon_committee.go | 24 ++ .../core/helpers/beacon_committee_test.go | 34 +++ .../slashings/service_attester_test.go | 18 +- .../prysm/v1alpha1/beacon/slashings_test.go | 12 +- .../prysm/v1alpha1/validator/proposer_test.go | 6 +- beacon-chain/sync/subscriber_test.go | 2 +- consensus-types/primitives/BUILD.bazel | 3 + .../primitives/committee_bits_mainnet.go | 9 + .../primitives/committee_bits_minimal.go | 9 + testing/util/BUILD.bazel | 1 + testing/util/altair.go | 20 +- testing/util/attestation.go | 75 +++++- testing/util/bellatrix.go | 20 +- testing/util/block.go | 77 +++++- testing/util/capella_block.go | 21 +- testing/util/electra_block.go | 223 ++++++++++++++++++ testing/util/helpers.go | 19 +- tools/benchmark-files-gen/main.go | 10 +- 35 files changed, 924 insertions(+), 236 deletions(-) create mode 100644 consensus-types/primitives/committee_bits_mainnet.go create mode 100644 consensus-types/primitives/committee_bits_minimal.go create mode 100644 testing/util/electra_block.go diff --git a/beacon-chain/blockchain/process_attestation.go b/beacon-chain/blockchain/process_attestation.go index a0949e869916..19d2abd46c75 100644 --- a/beacon-chain/blockchain/process_attestation.go +++ b/beacon-chain/blockchain/process_attestation.go @@ -80,11 +80,11 @@ func (s *Service) OnAttestation(ctx context.Context, a ethpb.Att, disparity time } // Use the target state to verify attesting indices are valid. - committee, err := helpers.BeaconCommitteeFromState(ctx, baseState, a.GetData().Slot, a.GetData().CommitteeIndex) + committees, err := helpers.AttestationCommittees(ctx, baseState, a) if err != nil { return err } - indexedAtt, err := attestation.ConvertToIndexed(ctx, a, committee) + indexedAtt, err := attestation.ConvertToIndexed(ctx, a, committees...) if err != nil { return err } diff --git a/beacon-chain/blockchain/process_attestation_test.go b/beacon-chain/blockchain/process_attestation_test.go index 47e411eacc79..f24db1f61a39 100644 --- a/beacon-chain/blockchain/process_attestation_test.go +++ b/beacon-chain/blockchain/process_attestation_test.go @@ -7,9 +7,11 @@ import ( "time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -125,25 +127,36 @@ func TestStore_OnAttestation_ErrorConditions(t *testing.T) { } func TestStore_OnAttestation_Ok_DoublyLinkedTree(t *testing.T) { - service, tr := minimalTestService(t) - ctx := tr.ctx + eval := func(ctx context.Context, service *Service, genesisState state.BeaconState, pks []bls.SecretKey) { + service.SetGenesisTime(time.Unix(time.Now().Unix()-int64(params.BeaconConfig().SecondsPerSlot), 0)) + require.NoError(t, service.saveGenesisData(ctx, genesisState)) + att, err := util.GenerateAttestations(genesisState, pks, 1, 0, false) + require.NoError(t, err) + tRoot := bytesutil.ToBytes32(att[0].GetData().Target.Root) + copied := genesisState.Copy() + copied, err = transition.ProcessSlots(ctx, copied, 1) + require.NoError(t, err) + require.NoError(t, service.cfg.BeaconDB.SaveState(ctx, copied, tRoot)) + ojc := ðpb.Checkpoint{Epoch: 0, Root: tRoot[:]} + ofc := ðpb.Checkpoint{Epoch: 0, Root: tRoot[:]} + state, blkRoot, err := prepareForkchoiceState(ctx, 0, tRoot, tRoot, params.BeaconConfig().ZeroHash, ojc, ofc) + require.NoError(t, err) + require.NoError(t, service.cfg.ForkChoiceStore.InsertNode(ctx, state, blkRoot)) + require.NoError(t, service.OnAttestation(ctx, att[0], 0)) + } - genesisState, pks := util.DeterministicGenesisState(t, 64) - service.SetGenesisTime(time.Unix(time.Now().Unix()-int64(params.BeaconConfig().SecondsPerSlot), 0)) - require.NoError(t, service.saveGenesisData(ctx, genesisState)) - att, err := util.GenerateAttestations(genesisState, pks, 1, 0, false) - require.NoError(t, err) - tRoot := bytesutil.ToBytes32(att[0].Data.Target.Root) - copied := genesisState.Copy() - copied, err = transition.ProcessSlots(ctx, copied, 1) - require.NoError(t, err) - require.NoError(t, service.cfg.BeaconDB.SaveState(ctx, copied, tRoot)) - ojc := ðpb.Checkpoint{Epoch: 0, Root: tRoot[:]} - ofc := ðpb.Checkpoint{Epoch: 0, Root: tRoot[:]} - state, blkRoot, err := prepareForkchoiceState(ctx, 0, tRoot, tRoot, params.BeaconConfig().ZeroHash, ojc, ofc) - require.NoError(t, err) - require.NoError(t, service.cfg.ForkChoiceStore.InsertNode(ctx, state, blkRoot)) - require.NoError(t, service.OnAttestation(ctx, att[0], 0)) + t.Run("pre-Electra", func(t *testing.T) { + service, tr := minimalTestService(t) + ctx := tr.ctx + genesisState, pks := util.DeterministicGenesisState(t, 64) + eval(ctx, service, genesisState, pks) + }) + t.Run("post-Electra", func(t *testing.T) { + service, tr := minimalTestService(t) + ctx := tr.ctx + genesisState, pks := util.DeterministicGenesisStateElectra(t, 64) + eval(ctx, service, genesisState, pks) + }) } func TestService_GetRecentPreState(t *testing.T) { diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 575b1f252929..1ea9e28a5dc5 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -366,11 +366,11 @@ func (s *Service) handleEpochBoundary(ctx context.Context, slot primitives.Slot, func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState) error { // Feed in block's attestations to fork choice store. for _, a := range blk.Body().Attestations() { - committee, err := helpers.BeaconCommitteeFromState(ctx, st, a.GetData().Slot, a.GetData().CommitteeIndex) + committees, err := helpers.AttestationCommittees(ctx, st, a) if err != nil { return err } - indices, err := attestation.AttestingIndices(a, committee) + indices, err := attestation.AttestingIndices(a, committees...) if err != nil { return err } diff --git a/beacon-chain/blockchain/process_block_test.go b/beacon-chain/blockchain/process_block_test.go index d4ca7a9ba698..d1d1f606ea92 100644 --- a/beacon-chain/blockchain/process_block_test.go +++ b/beacon-chain/blockchain/process_block_test.go @@ -1963,68 +1963,130 @@ func TestNoViableHead_Reboot(t *testing.T) { } func TestOnBlock_HandleBlockAttestations(t *testing.T) { - service, tr := minimalTestService(t) - ctx := tr.ctx + t.Run("pre-Electra", func(t *testing.T) { + service, tr := minimalTestService(t) + ctx := tr.ctx - st, keys := util.DeterministicGenesisState(t, 64) - stateRoot, err := st.HashTreeRoot(ctx) - require.NoError(t, err, "Could not hash genesis state") + st, keys := util.DeterministicGenesisState(t, 64) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err, "Could not hash genesis state") - require.NoError(t, service.saveGenesisData(ctx, st)) + require.NoError(t, service.saveGenesisData(ctx, st)) - genesis := blocks.NewGenesisBlock(stateRoot[:]) - wsb, err := consensusblocks.NewSignedBeaconBlock(genesis) - require.NoError(t, err) - require.NoError(t, service.cfg.BeaconDB.SaveBlock(ctx, wsb), "Could not save genesis block") - parentRoot, err := genesis.Block.HashTreeRoot() - require.NoError(t, err, "Could not get signing root") - require.NoError(t, service.cfg.BeaconDB.SaveState(ctx, st, parentRoot), "Could not save genesis state") - require.NoError(t, service.cfg.BeaconDB.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") + genesis := blocks.NewGenesisBlock(stateRoot[:]) + wsb, err := consensusblocks.NewSignedBeaconBlock(genesis) + require.NoError(t, err) + require.NoError(t, service.cfg.BeaconDB.SaveBlock(ctx, wsb), "Could not save genesis block") + parentRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + require.NoError(t, service.cfg.BeaconDB.SaveState(ctx, st, parentRoot), "Could not save genesis state") + require.NoError(t, service.cfg.BeaconDB.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") - st, err = service.HeadState(ctx) - require.NoError(t, err) - b, err := util.GenerateFullBlock(st, keys, util.DefaultBlockGenConfig(), 1) - require.NoError(t, err) - wsb, err = consensusblocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - root, err := b.Block.HashTreeRoot() - require.NoError(t, err) - preState, err := service.getBlockPreState(ctx, wsb.Block()) - require.NoError(t, err) - postState, err := service.validateStateTransition(ctx, preState, wsb) - require.NoError(t, err) - require.NoError(t, service.savePostStateInfo(ctx, root, wsb, postState)) - require.NoError(t, service.postBlockProcess(&postBlockProcessConfig{ctx, wsb, root, [32]byte{}, postState, false})) + st, err = service.HeadState(ctx) + require.NoError(t, err) + b, err := util.GenerateFullBlock(st, keys, util.DefaultBlockGenConfig(), 1) + require.NoError(t, err) + wsb, err = consensusblocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + root, err := b.Block.HashTreeRoot() + require.NoError(t, err) + preState, err := service.getBlockPreState(ctx, wsb.Block()) + require.NoError(t, err) + postState, err := service.validateStateTransition(ctx, preState, wsb) + require.NoError(t, err) + require.NoError(t, service.savePostStateInfo(ctx, root, wsb, postState)) + require.NoError(t, service.postBlockProcess(&postBlockProcessConfig{ctx, wsb, root, [32]byte{}, postState, false})) - st, err = service.HeadState(ctx) - require.NoError(t, err) - b, err = util.GenerateFullBlock(st, keys, util.DefaultBlockGenConfig(), 2) - require.NoError(t, err) - wsb, err = consensusblocks.NewSignedBeaconBlock(b) - require.NoError(t, err) + st, err = service.HeadState(ctx) + require.NoError(t, err) + b, err = util.GenerateFullBlock(st, keys, util.DefaultBlockGenConfig(), 2) + require.NoError(t, err) + wsb, err = consensusblocks.NewSignedBeaconBlock(b) + require.NoError(t, err) - // prepare another block that is not inserted - st3, err := transition.ExecuteStateTransition(ctx, st, wsb) - require.NoError(t, err) - b3, err := util.GenerateFullBlock(st3, keys, util.DefaultBlockGenConfig(), 3) - require.NoError(t, err) - wsb3, err := consensusblocks.NewSignedBeaconBlock(b3) - require.NoError(t, err) + // prepare another block that is not inserted + st3, err := transition.ExecuteStateTransition(ctx, st, wsb) + require.NoError(t, err) + b3, err := util.GenerateFullBlock(st3, keys, util.DefaultBlockGenConfig(), 3) + require.NoError(t, err) + wsb3, err := consensusblocks.NewSignedBeaconBlock(b3) + require.NoError(t, err) + + require.Equal(t, 1, len(wsb.Block().Body().Attestations())) + a := wsb.Block().Body().Attestations()[0] + r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) + require.Equal(t, true, service.cfg.ForkChoiceStore.HasNode(r)) + + require.Equal(t, 1, len(wsb.Block().Body().Attestations())) + a3 := wsb3.Block().Body().Attestations()[0] + r3 := bytesutil.ToBytes32(a3.GetData().BeaconBlockRoot) + require.Equal(t, false, service.cfg.ForkChoiceStore.HasNode(r3)) + + require.NoError(t, service.handleBlockAttestations(ctx, wsb.Block(), st)) // fine to use the same committee as st + require.Equal(t, 0, service.cfg.AttPool.ForkchoiceAttestationCount()) + require.NoError(t, service.handleBlockAttestations(ctx, wsb3.Block(), st3)) // fine to use the same committee as st + require.Equal(t, 1, len(service.cfg.AttPool.BlockAttestations())) + }) + t.Run("post-Electra", func(t *testing.T) { + service, tr := minimalTestService(t) + ctx := tr.ctx + + st, keys := util.DeterministicGenesisStateElectra(t, 64) + require.NoError(t, service.saveGenesisData(ctx, st)) + + genesis, err := blocks.NewGenesisBlockForState(ctx, st) + require.NoError(t, err) + require.NoError(t, service.cfg.BeaconDB.SaveBlock(ctx, genesis), "Could not save genesis block") + parentRoot, err := genesis.Block().HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + require.NoError(t, service.cfg.BeaconDB.SaveState(ctx, st, parentRoot), "Could not save genesis state") + require.NoError(t, service.cfg.BeaconDB.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") + + st, err = service.HeadState(ctx) + require.NoError(t, err) + b, err := util.GenerateFullBlockElectra(st, keys, util.DefaultBlockGenConfig(), 1) + require.NoError(t, err) + wsb, err := consensusblocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + root, err := b.Block.HashTreeRoot() + require.NoError(t, err) + preState, err := service.getBlockPreState(ctx, wsb.Block()) + require.NoError(t, err) + postState, err := service.validateStateTransition(ctx, preState, wsb) + require.NoError(t, err) + require.NoError(t, service.savePostStateInfo(ctx, root, wsb, postState)) + require.NoError(t, service.postBlockProcess(&postBlockProcessConfig{ctx, wsb, root, [32]byte{}, postState, false})) - require.Equal(t, 1, len(wsb.Block().Body().Attestations())) - a := wsb.Block().Body().Attestations()[0] - r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) - require.Equal(t, true, service.cfg.ForkChoiceStore.HasNode(r)) + st, err = service.HeadState(ctx) + require.NoError(t, err) + b, err = util.GenerateFullBlockElectra(st, keys, util.DefaultBlockGenConfig(), 2) + require.NoError(t, err) + wsb, err = consensusblocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + + // prepare another block that is not inserted + st3, err := transition.ExecuteStateTransition(ctx, st, wsb) + require.NoError(t, err) + b3, err := util.GenerateFullBlockElectra(st3, keys, util.DefaultBlockGenConfig(), 3) + require.NoError(t, err) + wsb3, err := consensusblocks.NewSignedBeaconBlock(b3) + require.NoError(t, err) - require.Equal(t, 1, len(wsb.Block().Body().Attestations())) - a3 := wsb3.Block().Body().Attestations()[0] - r3 := bytesutil.ToBytes32(a3.GetData().BeaconBlockRoot) - require.Equal(t, false, service.cfg.ForkChoiceStore.HasNode(r3)) + require.Equal(t, 1, len(wsb.Block().Body().Attestations())) + a := wsb.Block().Body().Attestations()[0] + r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) + require.Equal(t, true, service.cfg.ForkChoiceStore.HasNode(r)) - require.NoError(t, service.handleBlockAttestations(ctx, wsb.Block(), st)) // fine to use the same committee as st - require.Equal(t, 0, service.cfg.AttPool.ForkchoiceAttestationCount()) - require.NoError(t, service.handleBlockAttestations(ctx, wsb3.Block(), st3)) // fine to use the same committee as st - require.Equal(t, 1, len(service.cfg.AttPool.BlockAttestations())) + require.Equal(t, 1, len(wsb.Block().Body().Attestations())) + a3 := wsb3.Block().Body().Attestations()[0] + r3 := bytesutil.ToBytes32(a3.GetData().BeaconBlockRoot) + require.Equal(t, false, service.cfg.ForkChoiceStore.HasNode(r3)) + + require.NoError(t, service.handleBlockAttestations(ctx, wsb.Block(), st)) // fine to use the same committee as st + require.Equal(t, 0, service.cfg.AttPool.ForkchoiceAttestationCount()) + require.NoError(t, service.handleBlockAttestations(ctx, wsb3.Block(), st3)) // fine to use the same committee as st + require.Equal(t, 1, len(service.cfg.AttPool.BlockAttestations())) + }) } func TestFillMissingBlockPayloadId_DiffSlotExitEarly(t *testing.T) { diff --git a/beacon-chain/blockchain/receive_attestation_test.go b/beacon-chain/blockchain/receive_attestation_test.go index 94c27f1fb831..d0df3e1b23a0 100644 --- a/beacon-chain/blockchain/receive_attestation_test.go +++ b/beacon-chain/blockchain/receive_attestation_test.go @@ -73,7 +73,7 @@ func TestProcessAttestations_Ok(t *testing.T) { require.NoError(t, service.saveGenesisData(ctx, genesisState)) atts, err := util.GenerateAttestations(genesisState, pks, 1, 0, false) require.NoError(t, err) - tRoot := bytesutil.ToBytes32(atts[0].Data.Target.Root) + tRoot := bytesutil.ToBytes32(atts[0].GetData().Target.Root) copied := genesisState.Copy() copied, err = transition.ProcessSlots(ctx, copied, 1) require.NoError(t, err) @@ -131,8 +131,8 @@ func TestService_ProcessAttestationsAndUpdateHead(t *testing.T) { } require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(attsToSave)) // Verify the target is in forkchoice - require.Equal(t, true, fcs.HasNode(bytesutil.ToBytes32(atts[0].Data.BeaconBlockRoot))) - require.Equal(t, tRoot, bytesutil.ToBytes32(atts[0].Data.BeaconBlockRoot)) + require.Equal(t, true, fcs.HasNode(bytesutil.ToBytes32(atts[0].GetData().BeaconBlockRoot))) + require.Equal(t, tRoot, bytesutil.ToBytes32(atts[0].GetData().BeaconBlockRoot)) require.Equal(t, true, fcs.HasNode(service.originBlockRoot)) // Insert a new block to forkchoice diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index 884e257f320f..db2de5f1ff4e 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -479,12 +479,12 @@ func (s *Service) sendBlockAttestationsToSlasher(signed interfaces.ReadOnlySigne // is done in the background to avoid adding more load to this critical code path. ctx := context.TODO() for _, att := range signed.Block().Body().Attestations() { - committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.GetData().Slot, att.GetData().CommitteeIndex) + committees, err := helpers.AttestationCommittees(ctx, preState, att) if err != nil { - log.WithError(err).Error("Could not get attestation committee") + log.WithError(err).Error("Could not get attestation committees") return } - indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) + indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committees...) if err != nil { log.WithError(err).Error("Could not convert to indexed attestation") return diff --git a/beacon-chain/blockchain/setup_test.go b/beacon-chain/blockchain/setup_test.go index f305ea6e95fb..22acd22147c8 100644 --- a/beacon-chain/blockchain/setup_test.go +++ b/beacon-chain/blockchain/setup_test.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" testDB "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" + mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" @@ -120,6 +121,7 @@ func minimalTestService(t *testing.T, opts ...Option) (*Service, *testServiceReq WithTrackedValidatorsCache(cache.NewTrackedValidatorsCache()), WithBlobStorage(filesystem.NewEphemeralBlobStorage(t)), WithSyncChecker(mock.MockChecker{}), + WithExecutionEngineCaller(&mockExecution.EngineClient{}), } // append the variadic opts so they override the defaults by being processed afterwards opts = append(defOpts, opts...) diff --git a/beacon-chain/core/altair/attestation.go b/beacon-chain/core/altair/attestation.go index e2d6305a4b02..6c9c251e5f7b 100644 --- a/beacon-chain/core/altair/attestation.go +++ b/beacon-chain/core/altair/attestation.go @@ -66,11 +66,11 @@ func ProcessAttestationNoVerifySignature( if err != nil { return nil, err } - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) + committees, err := helpers.AttestationCommittees(ctx, beaconState, att) if err != nil { return nil, err } - indices, err := attestation.AttestingIndices(att, committee) + indices, err := attestation.AttestingIndices(att, committees...) if err != nil { return nil, err } diff --git a/beacon-chain/core/altair/attestation_test.go b/beacon-chain/core/altair/attestation_test.go index 2665edac852e..6b8367c07f65 100644 --- a/beacon-chain/core/altair/attestation_test.go +++ b/beacon-chain/core/altair/attestation_test.go @@ -195,47 +195,95 @@ func TestProcessAttestations_InvalidAggregationBitsLength(t *testing.T) { } func TestProcessAttestations_OK(t *testing.T) { - beaconState, privKeys := util.DeterministicGenesisStateAltair(t, 100) + t.Run("pre-Electra", func(t *testing.T) { + beaconState, privKeys := util.DeterministicGenesisStateAltair(t, 100) + + aggBits := bitfield.NewBitlist(3) + aggBits.SetBitAt(0, true) + var mockRoot [32]byte + copy(mockRoot[:], "hello-world") + att := util.HydrateAttestation(ðpb.Attestation{ + Data: ðpb.AttestationData{ + Source: ðpb.Checkpoint{Root: mockRoot[:]}, + Target: ðpb.Checkpoint{Root: mockRoot[:]}, + }, + AggregationBits: aggBits, + }) - aggBits := bitfield.NewBitlist(3) - aggBits.SetBitAt(0, true) - var mockRoot [32]byte - copy(mockRoot[:], "hello-world") - att := util.HydrateAttestation(ðpb.Attestation{ - Data: ðpb.AttestationData{ - Source: ðpb.Checkpoint{Root: mockRoot[:]}, - Target: ðpb.Checkpoint{Root: mockRoot[:]}, - }, - AggregationBits: aggBits, + cfc := beaconState.CurrentJustifiedCheckpoint() + cfc.Root = mockRoot[:] + require.NoError(t, beaconState.SetCurrentJustifiedCheckpoint(cfc)) + + committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, 0) + require.NoError(t, err) + attestingIndices, err := attestation.AttestingIndices(att, committee) + require.NoError(t, err) + sigs := make([]bls.Signature, len(attestingIndices)) + for i, indice := range attestingIndices { + sb, err := signing.ComputeDomainAndSign(beaconState, 0, att.Data, params.BeaconConfig().DomainBeaconAttester, privKeys[indice]) + require.NoError(t, err) + sig, err := bls.SignatureFromBytes(sb) + require.NoError(t, err) + sigs[i] = sig + } + att.Signature = bls.AggregateSignatures(sigs).Marshal() + + block := util.NewBeaconBlockAltair() + block.Block.Body.Attestations = []*ethpb.Attestation{att} + + err = beaconState.SetSlot(beaconState.Slot() + params.BeaconConfig().MinAttestationInclusionDelay) + require.NoError(t, err) + wsb, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + _, err = altair.ProcessAttestationsNoVerifySignature(context.Background(), beaconState, wsb.Block()) + require.NoError(t, err) }) + t.Run("post-Electra", func(t *testing.T) { + beaconState, privKeys := util.DeterministicGenesisStateElectra(t, 100) + + aggBits := bitfield.NewBitlist(3) + aggBits.SetBitAt(0, true) + committeeBits := primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(0, true) + var mockRoot [32]byte + copy(mockRoot[:], "hello-world") + att := util.HydrateAttestationElectra(ðpb.AttestationElectra{ + Data: ðpb.AttestationData{ + Source: ðpb.Checkpoint{Root: mockRoot[:]}, + Target: ðpb.Checkpoint{Root: mockRoot[:]}, + }, + AggregationBits: aggBits, + CommitteeBits: committeeBits, + }) - cfc := beaconState.CurrentJustifiedCheckpoint() - cfc.Root = mockRoot[:] - require.NoError(t, beaconState.SetCurrentJustifiedCheckpoint(cfc)) + cfc := beaconState.CurrentJustifiedCheckpoint() + cfc.Root = mockRoot[:] + require.NoError(t, beaconState.SetCurrentJustifiedCheckpoint(cfc)) - committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, att.Data.CommitteeIndex) - require.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(att, committee) - require.NoError(t, err) - sigs := make([]bls.Signature, len(attestingIndices)) - for i, indice := range attestingIndices { - sb, err := signing.ComputeDomainAndSign(beaconState, 0, att.Data, params.BeaconConfig().DomainBeaconAttester, privKeys[indice]) + committee, err := helpers.BeaconCommitteeFromState(context.Background(), beaconState, att.Data.Slot, 0) require.NoError(t, err) - sig, err := bls.SignatureFromBytes(sb) + attestingIndices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) - sigs[i] = sig - } - att.Signature = bls.AggregateSignatures(sigs).Marshal() + sigs := make([]bls.Signature, len(attestingIndices)) + for i, indice := range attestingIndices { + sb, err := signing.ComputeDomainAndSign(beaconState, 0, att.Data, params.BeaconConfig().DomainBeaconAttester, privKeys[indice]) + require.NoError(t, err) + sig, err := bls.SignatureFromBytes(sb) + require.NoError(t, err) + sigs[i] = sig + } + att.Signature = bls.AggregateSignatures(sigs).Marshal() - block := util.NewBeaconBlockAltair() - block.Block.Body.Attestations = []*ethpb.Attestation{att} + block := util.NewBeaconBlockElectra() + block.Block.Body.Attestations = []*ethpb.AttestationElectra{att} - err = beaconState.SetSlot(beaconState.Slot() + params.BeaconConfig().MinAttestationInclusionDelay) - require.NoError(t, err) - wsb, err := blocks.NewSignedBeaconBlock(block) - require.NoError(t, err) - _, err = altair.ProcessAttestationsNoVerifySignature(context.Background(), beaconState, wsb.Block()) - require.NoError(t, err) + err = beaconState.SetSlot(beaconState.Slot() + params.BeaconConfig().MinAttestationInclusionDelay) + require.NoError(t, err) + wsb, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + _, err = altair.ProcessAttestationsNoVerifySignature(context.Background(), beaconState, wsb.Block()) + require.NoError(t, err) + }) } func TestProcessAttestationNoVerify_SourceTargetHead(t *testing.T) { diff --git a/beacon-chain/core/altair/upgrade.go b/beacon-chain/core/altair/upgrade.go index 3b3e33ce89c3..6a4c0354b109 100644 --- a/beacon-chain/core/altair/upgrade.go +++ b/beacon-chain/core/altair/upgrade.go @@ -154,7 +154,7 @@ func TranslateParticipation(ctx context.Context, state state.BeaconState, atts [ if err != nil { return nil, err } - committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err } diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index 5b9c0c83ef18..fe71802126e1 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -200,23 +200,6 @@ func ProcessAttestationNoVerifySignature( return beaconState, nil } -// VerifyAttestationSignature converts and attestation into an indexed attestation and verifies -// the signature in that attestation. -func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att ethpb.Att) error { - if err := helpers.ValidateNilAttestation(att); err != nil { - return err - } - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) - if err != nil { - return err - } - indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) - if err != nil { - return err - } - return VerifyIndexedAttestation(ctx, beaconState, indexedAtt) -} - // VerifyIndexedAttestation determines the validity of an indexed attestation. // // Spec pseudocode definition: diff --git a/beacon-chain/core/blocks/attestation_test.go b/beacon-chain/core/blocks/attestation_test.go index 2ebc36a23181..361be04b5c0d 100644 --- a/beacon-chain/core/blocks/attestation_test.go +++ b/beacon-chain/core/blocks/attestation_test.go @@ -578,53 +578,109 @@ func TestRetrieveAttestationSignatureSet_VerifiesMultipleAttestations(t *testing } } - st, err := util.NewBeaconState() - require.NoError(t, err) - require.NoError(t, st.SetSlot(5)) - require.NoError(t, st.SetValidators(validators)) + t.Run("pre-Electra", func(t *testing.T) { + st, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, st.SetSlot(5)) + require.NoError(t, st.SetValidators(validators)) - comm1, err := helpers.BeaconCommitteeFromState(context.Background(), st, 1 /*slot*/, 0 /*committeeIndex*/) - require.NoError(t, err) - att1 := util.HydrateAttestation(ðpb.Attestation{ - AggregationBits: bitfield.NewBitlist(uint64(len(comm1))), - Data: ðpb.AttestationData{ - Slot: 1, - }, - }) - domain, err := signing.Domain(st.Fork(), st.Fork().Epoch, params.BeaconConfig().DomainBeaconAttester, st.GenesisValidatorsRoot()) - require.NoError(t, err) - root, err := signing.ComputeSigningRoot(att1.Data, domain) - require.NoError(t, err) - var sigs []bls.Signature - for i, u := range comm1 { - att1.AggregationBits.SetBitAt(uint64(i), true) - sigs = append(sigs, keys[u].Sign(root[:])) - } - att1.Signature = bls.AggregateSignatures(sigs).Marshal() + comm1, err := helpers.BeaconCommitteeFromState(context.Background(), st, 1 /*slot*/, 0 /*committeeIndex*/) + require.NoError(t, err) + att1 := util.HydrateAttestation(ðpb.Attestation{ + AggregationBits: bitfield.NewBitlist(uint64(len(comm1))), + Data: ðpb.AttestationData{ + Slot: 1, + }, + }) + domain, err := signing.Domain(st.Fork(), st.Fork().Epoch, params.BeaconConfig().DomainBeaconAttester, st.GenesisValidatorsRoot()) + require.NoError(t, err) + root, err := signing.ComputeSigningRoot(att1.Data, domain) + require.NoError(t, err) + var sigs []bls.Signature + for i, u := range comm1 { + att1.AggregationBits.SetBitAt(uint64(i), true) + sigs = append(sigs, keys[u].Sign(root[:])) + } + att1.Signature = bls.AggregateSignatures(sigs).Marshal() - comm2, err := helpers.BeaconCommitteeFromState(context.Background(), st, 1 /*slot*/, 1 /*committeeIndex*/) - require.NoError(t, err) - att2 := util.HydrateAttestation(ðpb.Attestation{ - AggregationBits: bitfield.NewBitlist(uint64(len(comm2))), - Data: ðpb.AttestationData{ - Slot: 1, - CommitteeIndex: 1, - }, + comm2, err := helpers.BeaconCommitteeFromState(context.Background(), st, 1 /*slot*/, 1 /*committeeIndex*/) + require.NoError(t, err) + att2 := util.HydrateAttestation(ðpb.Attestation{ + AggregationBits: bitfield.NewBitlist(uint64(len(comm2))), + Data: ðpb.AttestationData{ + Slot: 1, + CommitteeIndex: 1, + }, + }) + root, err = signing.ComputeSigningRoot(att2.Data, domain) + require.NoError(t, err) + sigs = nil + for i, u := range comm2 { + att2.AggregationBits.SetBitAt(uint64(i), true) + sigs = append(sigs, keys[u].Sign(root[:])) + } + att2.Signature = bls.AggregateSignatures(sigs).Marshal() + + set, err := blocks.AttestationSignatureBatch(ctx, st, []ethpb.Att{att1, att2}) + require.NoError(t, err) + verified, err := set.Verify() + require.NoError(t, err) + assert.Equal(t, true, verified, "Multiple signatures were unable to be verified.") }) - root, err = signing.ComputeSigningRoot(att2.Data, domain) - require.NoError(t, err) - sigs = nil - for i, u := range comm2 { - att2.AggregationBits.SetBitAt(uint64(i), true) - sigs = append(sigs, keys[u].Sign(root[:])) - } - att2.Signature = bls.AggregateSignatures(sigs).Marshal() + t.Run("post-Electra", func(t *testing.T) { + st, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, st.SetSlot(5)) + require.NoError(t, st.SetValidators(validators)) - set, err := blocks.AttestationSignatureBatch(ctx, st, []ethpb.Att{att1, att2}) - require.NoError(t, err) - verified, err := set.Verify() - require.NoError(t, err) - assert.Equal(t, true, verified, "Multiple signatures were unable to be verified.") + comm1, err := helpers.BeaconCommitteeFromState(context.Background(), st, 1 /*slot*/, 0 /*committeeIndex*/) + require.NoError(t, err) + commBits1 := primitives.NewAttestationCommitteeBits() + commBits1.SetBitAt(0, true) + att1 := util.HydrateAttestationElectra(ðpb.AttestationElectra{ + AggregationBits: bitfield.NewBitlist(uint64(len(comm1))), + CommitteeBits: commBits1, + Data: ðpb.AttestationData{ + Slot: 1, + }, + }) + domain, err := signing.Domain(st.Fork(), st.Fork().Epoch, params.BeaconConfig().DomainBeaconAttester, st.GenesisValidatorsRoot()) + require.NoError(t, err) + root, err := signing.ComputeSigningRoot(att1.Data, domain) + require.NoError(t, err) + var sigs []bls.Signature + for i, u := range comm1 { + att1.AggregationBits.SetBitAt(uint64(i), true) + sigs = append(sigs, keys[u].Sign(root[:])) + } + att1.Signature = bls.AggregateSignatures(sigs).Marshal() + + comm2, err := helpers.BeaconCommitteeFromState(context.Background(), st, 1 /*slot*/, 1 /*committeeIndex*/) + require.NoError(t, err) + commBits2 := primitives.NewAttestationCommitteeBits() + commBits2.SetBitAt(1, true) + att2 := util.HydrateAttestationElectra(ðpb.AttestationElectra{ + AggregationBits: bitfield.NewBitlist(uint64(len(comm2))), + CommitteeBits: commBits2, + Data: ðpb.AttestationData{ + Slot: 1, + }, + }) + root, err = signing.ComputeSigningRoot(att2.Data, domain) + require.NoError(t, err) + sigs = nil + for i, u := range comm2 { + att2.AggregationBits.SetBitAt(uint64(i), true) + sigs = append(sigs, keys[u].Sign(root[:])) + } + att2.Signature = bls.AggregateSignatures(sigs).Marshal() + + set, err := blocks.AttestationSignatureBatch(ctx, st, []ethpb.Att{att1, att2}) + require.NoError(t, err) + verified, err := set.Verify() + require.NoError(t, err) + assert.Equal(t, true, verified, "Multiple signatures were unable to be verified.") + }) } func TestRetrieveAttestationSignatureSet_AcrossFork(t *testing.T) { diff --git a/beacon-chain/core/blocks/block_operations_fuzz_test.go b/beacon-chain/core/blocks/block_operations_fuzz_test.go index 28db7d8c4f64..23adc4144a94 100644 --- a/beacon-chain/core/blocks/block_operations_fuzz_test.go +++ b/beacon-chain/core/blocks/block_operations_fuzz_test.go @@ -297,21 +297,6 @@ func TestFuzzVerifyIndexedAttestationn_10000(t *testing.T) { } } -func TestFuzzVerifyAttestation_10000(t *testing.T) { - fuzzer := fuzz.NewWithSeed(0) - state := ðpb.BeaconState{} - attestation := ðpb.Attestation{} - ctx := context.Background() - for i := 0; i < 10000; i++ { - fuzzer.Fuzz(state) - fuzzer.Fuzz(attestation) - s, err := state_native.InitializeFromProtoUnsafePhase0(state) - require.NoError(t, err) - err = VerifyAttestationSignature(ctx, s, attestation) - _ = err - } -} - func TestFuzzProcessDeposits_10000(t *testing.T) { fuzzer := fuzz.NewWithSeed(0) state := ðpb.BeaconState{} diff --git a/beacon-chain/core/blocks/genesis.go b/beacon-chain/core/blocks/genesis.go index 466bc8bd9c83..1099085cc2e9 100644 --- a/beacon-chain/core/blocks/genesis.go +++ b/beacon-chain/core/blocks/genesis.go @@ -163,7 +163,42 @@ func NewGenesisBlockForState(ctx context.Context, st state.BeaconState) (interfa SyncCommitteeBits: make([]byte, fieldparams.SyncCommitteeLength/8), SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), }, - ExecutionPayload: &enginev1.ExecutionPayloadDeneb{ // Deneb difference. + ExecutionPayload: &enginev1.ExecutionPayloadDeneb{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), + }, + BlsToExecutionChanges: make([]*ethpb.SignedBLSToExecutionChange, 0), + BlobKzgCommitments: make([][]byte, 0), + }, + }, + Signature: params.BeaconConfig().EmptySignature[:], + }) + case *ethpb.BeaconStateElectra: + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{ + ParentRoot: params.BeaconConfig().ZeroHash[:], + StateRoot: root[:], + Body: ðpb.BeaconBlockBodyElectra{ + RandaoReveal: make([]byte, 96), + Eth1Data: ðpb.Eth1Data{ + DepositRoot: make([]byte, 32), + BlockHash: make([]byte, 32), + }, + Graffiti: make([]byte, 32), + SyncAggregate: ðpb.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncCommitteeLength/8), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + ExecutionPayload: &enginev1.ExecutionPayloadElectra{ ParentHash: make([]byte, 32), FeeRecipient: make([]byte, 20), StateRoot: make([]byte, 32), diff --git a/beacon-chain/core/blocks/signature.go b/beacon-chain/core/blocks/signature.go index b14244160585..c0f9741589cf 100644 --- a/beacon-chain/core/blocks/signature.go +++ b/beacon-chain/core/blocks/signature.go @@ -192,11 +192,11 @@ func createAttestationSignatureBatch( descs := make([]string, len(atts)) for i, a := range atts { sigs[i] = a.GetSignature() - c, err := helpers.BeaconCommitteeFromState(ctx, beaconState, a.GetData().Slot, a.GetData().CommitteeIndex) + committees, err := helpers.AttestationCommittees(ctx, beaconState, a) if err != nil { return nil, err } - ia, err := attestation.ConvertToIndexed(ctx, a, c) + ia, err := attestation.ConvertToIndexed(ctx, a, committees...) if err != nil { return nil, err } diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 5119e5059fe0..e941997179e4 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -470,7 +470,7 @@ func UnslashedAttestingIndices(ctx context.Context, state state.ReadOnlyBeaconSt seen := make(map[uint64]bool) for _, att := range atts { - committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err } diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index c8b45a534c18..4e2a79941552 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -34,6 +34,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 2980c51091ab..91d6c5a863ac 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -21,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -58,6 +59,29 @@ func SlotCommitteeCount(activeValidatorCount uint64) uint64 { return committeesPerSlot } +// AttestationCommittees returns beacon state committees that reflect attestation's committee indices. +func AttestationCommittees(ctx context.Context, st state.ReadOnlyBeaconState, att ethpb.Att) ([][]primitives.ValidatorIndex, error) { + var committees [][]primitives.ValidatorIndex + if att.Version() >= version.Electra { + committeeIndices := att.CommitteeBitsVal().BitIndices() + committees = make([][]primitives.ValidatorIndex, len(committeeIndices)) + for i, ci := range committeeIndices { + committee, err := BeaconCommitteeFromState(ctx, st, att.GetData().Slot, primitives.CommitteeIndex(ci)) + if err != nil { + return nil, err + } + committees[i] = committee + } + } else { + committee, err := BeaconCommitteeFromState(ctx, st, att.GetData().Slot, att.GetData().CommitteeIndex) + if err != nil { + return nil, err + } + committees = [][]primitives.ValidatorIndex{committee} + } + return committees, nil +} + // BeaconCommitteeFromState returns the crosslink committee of a given slot and committee index. This // is a spec implementation where state is used as an argument. In case of state retrieval // becomes expensive, consider using BeaconCommittee below. diff --git a/beacon-chain/core/helpers/beacon_committee_test.go b/beacon-chain/core/helpers/beacon_committee_test.go index fd3cc255230e..2bbafdd0fa9e 100644 --- a/beacon-chain/core/helpers/beacon_committee_test.go +++ b/beacon-chain/core/helpers/beacon_committee_test.go @@ -715,3 +715,37 @@ func TestCommitteeIndices(t *testing.T) { indices := helpers.CommitteeIndices(bitfield) assert.DeepEqual(t, []primitives.CommitteeIndex{0, 1, 3}, indices) } + +func TestAttestationCommittees(t *testing.T) { + validators := make([]*ethpb.Validator, params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().TargetCommitteeSize)) + for i := 0; i < len(validators); i++ { + validators[i] = ðpb.Validator{ + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + } + } + + state, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ + Validators: validators, + RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), + }) + require.NoError(t, err) + + t.Run("pre-Electra", func(t *testing.T) { + att := ðpb.Attestation{Data: ðpb.AttestationData{CommitteeIndex: 0}} + committees, err := helpers.AttestationCommittees(context.Background(), state, att) + require.NoError(t, err) + require.Equal(t, 1, len(committees)) + assert.Equal(t, params.BeaconConfig().TargetCommitteeSize, uint64(len(committees[0]))) + }) + t.Run("post-Electra", func(t *testing.T) { + bits := primitives.NewAttestationCommitteeBits() + bits.SetBitAt(0, true) + bits.SetBitAt(1, true) + att := ðpb.AttestationElectra{CommitteeBits: bits, Data: ðpb.AttestationData{}} + committees, err := helpers.AttestationCommittees(context.Background(), state, att) + require.NoError(t, err) + require.Equal(t, 2, len(committees)) + assert.Equal(t, params.BeaconConfig().TargetCommitteeSize, uint64(len(committees[0]))) + assert.Equal(t, params.BeaconConfig().TargetCommitteeSize, uint64(len(committees[1]))) + }) +} diff --git a/beacon-chain/operations/slashings/service_attester_test.go b/beacon-chain/operations/slashings/service_attester_test.go index 50f4ab63d69a..2dab3f107613 100644 --- a/beacon-chain/operations/slashings/service_attester_test.go +++ b/beacon-chain/operations/slashings/service_attester_test.go @@ -17,9 +17,9 @@ import ( func validAttesterSlashingForValIdx(t *testing.T, beaconState state.BeaconState, privs []bls.SecretKey, valIdx ...uint64) *ethpb.AttesterSlashing { var slashings []*ethpb.AttesterSlashing for _, idx := range valIdx { - slashing, err := util.GenerateAttesterSlashingForValidator(beaconState, privs[idx], primitives.ValidatorIndex(idx)) + generatedSlashing, err := util.GenerateAttesterSlashingForValidator(beaconState, privs[idx], primitives.ValidatorIndex(idx)) require.NoError(t, err) - slashings = append(slashings, slashing) + slashings = append(slashings, generatedSlashing.(*ethpb.AttesterSlashing)) } var allSig1 []bls.Signature var allSig2 []bls.Signature @@ -78,12 +78,14 @@ func TestPool_InsertAttesterSlashing(t *testing.T) { pendingSlashings := make([]*PendingAttesterSlashing, 20) slashings := make([]*ethpb.AttesterSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { - sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) + generatedSl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) pendingSlashings[i] = &PendingAttesterSlashing{ - attesterSlashing: sl, + attesterSlashing: generatedSl, validatorToSlash: primitives.ValidatorIndex(i), } + sl, ok := generatedSl.(*ethpb.AttesterSlashing) + require.Equal(t, true, ok, "Attester slashing has the wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, generatedSl) slashings[i] = sl } require.NoError(t, beaconState.SetSlot(params.BeaconConfig().SlotsPerEpoch)) @@ -303,12 +305,16 @@ func TestPool_InsertAttesterSlashing_SigFailsVerify_ClearPool(t *testing.T) { pendingSlashings := make([]*PendingAttesterSlashing, 2) slashings := make([]*ethpb.AttesterSlashing, 2) for i := 0; i < 2; i++ { - sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) + generatedSl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) pendingSlashings[i] = &PendingAttesterSlashing{ - attesterSlashing: sl, + attesterSlashing: generatedSl, validatorToSlash: primitives.ValidatorIndex(i), } + sl, ok := generatedSl.(*ethpb.AttesterSlashing) + if !ok { + require.Equal(t, true, ok, "Attester slashing has the wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, generatedSl) + } slashings[i] = sl } // We mess up the signature of the second slashing. diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go index 78d6455b731d..a69459168b13 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go @@ -66,13 +66,13 @@ func TestServer_SubmitAttesterSlashing(t *testing.T) { Broadcaster: mb, } - slashing, err := util.GenerateAttesterSlashingForValidator(st, privs[2], primitives.ValidatorIndex(2)) + generatedSlashing, err := util.GenerateAttesterSlashingForValidator(st, privs[2], primitives.ValidatorIndex(2)) require.NoError(t, err) // We want the intersection of the slashing attesting indices // to be slashed, so we expect validators 2 and 3 to be in the response // slashed indices. - _, err = bs.SubmitAttesterSlashing(ctx, slashing) + _, err = bs.SubmitAttesterSlashing(ctx, generatedSlashing.(*ethpb.AttesterSlashing)) require.NoError(t, err) assert.Equal(t, true, mb.BroadcastCalled.Load(), "Expected broadcast to be called when flag is set") } @@ -144,7 +144,7 @@ func TestServer_SubmitAttesterSlashing_DontBroadcast(t *testing.T) { Broadcaster: mb, } - slashing, err := util.GenerateAttesterSlashingForValidator(st, privs[2], primitives.ValidatorIndex(2)) + generatedSlashing, err := util.GenerateAttesterSlashingForValidator(st, privs[2], primitives.ValidatorIndex(2)) require.NoError(t, err) // We want the intersection of the slashing attesting indices @@ -153,17 +153,17 @@ func TestServer_SubmitAttesterSlashing_DontBroadcast(t *testing.T) { wanted := ðpb.SubmitSlashingResponse{ SlashedIndices: []primitives.ValidatorIndex{2}, } - res, err := bs.SubmitAttesterSlashing(ctx, slashing) + res, err := bs.SubmitAttesterSlashing(ctx, generatedSlashing.(*ethpb.AttesterSlashing)) require.NoError(t, err) if !proto.Equal(wanted, res) { t.Errorf("Wanted %v, received %v", wanted, res) } assert.Equal(t, false, mb.BroadcastCalled.Load(), "Expected broadcast not to be called by default") - slashing, err = util.GenerateAttesterSlashingForValidator(st, privs[5], primitives.ValidatorIndex(5)) + generatedSlashing, err = util.GenerateAttesterSlashingForValidator(st, privs[5], primitives.ValidatorIndex(5)) require.NoError(t, err) // If any of the attesting indices in the slashing object have already // been slashed, we should fail to insert properly into the attester slashing pool. - _, err = bs.SubmitAttesterSlashing(ctx, slashing) + _, err = bs.SubmitAttesterSlashing(ctx, generatedSlashing.(*ethpb.AttesterSlashing)) assert.NotNil(t, err, "Expected including a attester slashing for an already slashed validator to fail") } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 108f54eb812f..fcecd22b0f49 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -753,10 +753,12 @@ func injectSlashings(t *testing.T, st state.BeaconState, keys []bls.SecretKey, s attSlashings := make([]*ethpb.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings) for i := uint64(0); i < params.BeaconConfig().MaxAttesterSlashings; i++ { - attesterSlashing, err := util.GenerateAttesterSlashingForValidator(st, keys[i+params.BeaconConfig().MaxProposerSlashings], primitives.ValidatorIndex(i+params.BeaconConfig().MaxProposerSlashings) /* validator index */) + generatedAttesterSlashing, err := util.GenerateAttesterSlashingForValidator(st, keys[i+params.BeaconConfig().MaxProposerSlashings], primitives.ValidatorIndex(i+params.BeaconConfig().MaxProposerSlashings) /* validator index */) require.NoError(t, err) + attesterSlashing, ok := generatedAttesterSlashing.(*ethpb.AttesterSlashing) + require.Equal(t, true, ok, "Attester slashing has the wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, generatedAttesterSlashing) attSlashings[i] = attesterSlashing - err = server.SlashingsPool.InsertAttesterSlashing(context.Background(), st, attesterSlashing) + err = server.SlashingsPool.InsertAttesterSlashing(context.Background(), st, generatedAttesterSlashing.(*ethpb.AttesterSlashing)) require.NoError(t, err) } return proposerSlashings, attSlashings diff --git a/beacon-chain/sync/subscriber_test.go b/beacon-chain/sync/subscriber_test.go index c0f7472eeb33..d0bae7fe4aa9 100644 --- a/beacon-chain/sync/subscriber_test.go +++ b/beacon-chain/sync/subscriber_test.go @@ -170,7 +170,7 @@ func TestSubscribe_ReceivesAttesterSlashing(t *testing.T) { 1, /* validator index */ ) require.NoError(t, err, "Error generating attester slashing") - err = r.cfg.beaconDB.SaveState(ctx, beaconState, bytesutil.ToBytes32(attesterSlashing.Attestation_1.Data.BeaconBlockRoot)) + err = r.cfg.beaconDB.SaveState(ctx, beaconState, bytesutil.ToBytes32(attesterSlashing.FirstAttestation().GetData().BeaconBlockRoot)) require.NoError(t, err) p2pService.ReceivePubSub(topic, attesterSlashing) diff --git a/consensus-types/primitives/BUILD.bazel b/consensus-types/primitives/BUILD.bazel index 10ddde9c7346..96506f9315f3 100644 --- a/consensus-types/primitives/BUILD.bazel +++ b/consensus-types/primitives/BUILD.bazel @@ -3,6 +3,8 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "committee_bits_mainnet.go", + "committee_bits_minimal.go", # keep "committee_index.go", "domain.go", "epoch.go", @@ -20,6 +22,7 @@ go_library( deps = [ "//math:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", + "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/consensus-types/primitives/committee_bits_mainnet.go b/consensus-types/primitives/committee_bits_mainnet.go new file mode 100644 index 000000000000..b815dd12c384 --- /dev/null +++ b/consensus-types/primitives/committee_bits_mainnet.go @@ -0,0 +1,9 @@ +//go:build !minimal + +package primitives + +import "github.com/prysmaticlabs/go-bitfield" + +func NewAttestationCommitteeBits() bitfield.Bitvector64 { + return bitfield.NewBitvector64() +} diff --git a/consensus-types/primitives/committee_bits_minimal.go b/consensus-types/primitives/committee_bits_minimal.go new file mode 100644 index 000000000000..caec3090a8fe --- /dev/null +++ b/consensus-types/primitives/committee_bits_minimal.go @@ -0,0 +1,9 @@ +//go:build minimal + +package primitives + +import "github.com/prysmaticlabs/go-bitfield" + +func NewAttestationCommitteeBits() bitfield.Bitvector4 { + return bitfield.NewBitvector4() +} diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index 675ea1fb6c33..8456b8d17824 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "deneb_state.go", "deposits.go", "electra.go", + "electra_block.go", "electra_state.go", "helpers.go", "merge.go", diff --git a/testing/util/altair.go b/testing/util/altair.go index bef3d08b9076..902c039337d6 100644 --- a/testing/util/altair.go +++ b/testing/util/altair.go @@ -345,19 +345,35 @@ func GenerateFullBlockAltair( numToGen = conf.NumAttesterSlashings var aSlashings []*ethpb.AttesterSlashing if numToGen > 0 { - aSlashings, err = generateAttesterSlashings(bState, privs, numToGen) + generated, err := generateAttesterSlashings(bState, privs, numToGen) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attester slashings:", numToGen) } + aSlashings = make([]*ethpb.AttesterSlashing, len(generated)) + var ok bool + for i, s := range generated { + aSlashings[i], ok = s.(*ethpb.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, s) + } + } } numToGen = conf.NumAttestations var atts []*ethpb.Attestation if numToGen > 0 { - atts, err = GenerateAttestations(bState, privs, numToGen, slot, false) + generatedAtts, err := GenerateAttestations(bState, privs, numToGen, slot, false) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attestations:", numToGen) } + atts = make([]*ethpb.Attestation, len(generatedAtts)) + var ok bool + for i, a := range generatedAtts { + atts[i], ok = a.(*ethpb.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has the wrong type (expected %T, got %T)", ðpb.Attestation{}, a) + } + } } numToGen = conf.NumDeposits diff --git a/testing/util/attestation.go b/testing/util/attestation.go index 0c62520b3df3..2daabe9715a5 100644 --- a/testing/util/attestation.go +++ b/testing/util/attestation.go @@ -2,7 +2,6 @@ package util import ( "context" - "errors" "fmt" "math" @@ -48,10 +47,8 @@ func NewAttestation() *ethpb.Attestation { // for the same data with their aggregation bits split uniformly. // // If you request 4 attestations, but there are 8 committees, you will get 4 fully aggregated attestations. -func GenerateAttestations( - bState state.BeaconState, privs []bls.SecretKey, numToGen uint64, slot primitives.Slot, randomRoot bool, -) ([]*ethpb.Attestation, error) { - var attestations []*ethpb.Attestation +func GenerateAttestations(bState state.BeaconState, privs []bls.SecretKey, numToGen uint64, slot primitives.Slot, randomRoot bool) ([]ethpb.Att, error) { // nolint:gocognit + var attestations []ethpb.Att generateHeadState := false bState = bState.Copy() if slot > bState.Slot() { @@ -108,8 +105,28 @@ func GenerateAttestations( return nil, err } headState = genState + case version.Deneb: + pbState, err := state_native.ProtobufBeaconStateDeneb(bState.ToProto()) + if err != nil { + return nil, err + } + genState, err := state_native.InitializeFromProtoUnsafeDeneb(pbState) + if err != nil { + return nil, err + } + headState = genState + case version.Electra: + pbState, err := state_native.ProtobufBeaconStateElectra(bState.ToProto()) + if err != nil { + return nil, err + } + genState, err := state_native.InitializeFromProtoUnsafeElectra(pbState) + if err != nil { + return nil, err + } + headState = genState default: - return nil, errors.New("state type isn't supported") + return nil, fmt.Errorf("state version %s isn't supported", version.String(bState.Version())) } headState, err = transition.ProcessSlots(context.Background(), headState, slot+1) @@ -180,9 +197,14 @@ func GenerateAttestations( return nil, err } + ci := c + if bState.Version() >= version.Electra { + // committee index must be 0 post-Electra + ci = 0 + } attData := ðpb.AttestationData{ Slot: slot, - CommitteeIndex: c, + CommitteeIndex: ci, BeaconBlockRoot: headRoot, Source: bState.CurrentJustifiedCheckpoint(), Target: ðpb.Checkpoint{ @@ -211,10 +233,22 @@ func GenerateAttestations( continue } - att := ðpb.Attestation{ - Data: attData, - AggregationBits: aggregationBits, - Signature: bls.AggregateSignatures(sigs).Marshal(), + var att ethpb.Att + if bState.Version() >= version.Electra { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(uint64(c), true) + att = ðpb.AttestationElectra{ + Data: attData, + CommitteeBits: cb, + AggregationBits: aggregationBits, + Signature: bls.AggregateSignatures(sigs).Marshal(), + } + } else { + att = ðpb.Attestation{ + Data: attData, + AggregationBits: aggregationBits, + Signature: bls.AggregateSignatures(sigs).Marshal(), + } } attestations = append(attestations, att) } @@ -238,6 +272,25 @@ func HydrateAttestation(a *ethpb.Attestation) *ethpb.Attestation { return a } +// HydrateAttestationElectra hydrates an attestation object with correct field length sizes +// to comply with fssz marshalling and unmarshalling rules. +func HydrateAttestationElectra(a *ethpb.AttestationElectra) *ethpb.AttestationElectra { + if a.Signature == nil { + a.Signature = make([]byte, 96) + } + if a.AggregationBits == nil { + a.AggregationBits = make([]byte, 1) + } + if a.CommitteeBits == nil { + a.CommitteeBits = primitives.NewAttestationCommitteeBits() + } + if a.Data == nil { + a.Data = ðpb.AttestationData{} + } + a.Data = HydrateAttestationData(a.Data) + return a +} + // HydrateV1Attestation hydrates a v1 attestation object with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV1Attestation(a *attv1.Attestation) *attv1.Attestation { diff --git a/testing/util/bellatrix.go b/testing/util/bellatrix.go index 09137d519329..c860bbace853 100644 --- a/testing/util/bellatrix.go +++ b/testing/util/bellatrix.go @@ -56,19 +56,35 @@ func GenerateFullBlockBellatrix( numToGen = conf.NumAttesterSlashings var aSlashings []*ethpb.AttesterSlashing if numToGen > 0 { - aSlashings, err = generateAttesterSlashings(bState, privs, numToGen) + generated, err := generateAttesterSlashings(bState, privs, numToGen) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attester slashings:", numToGen) } + aSlashings = make([]*ethpb.AttesterSlashing, len(generated)) + var ok bool + for i, s := range generated { + aSlashings[i], ok = s.(*ethpb.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, s) + } + } } numToGen = conf.NumAttestations var atts []*ethpb.Attestation if numToGen > 0 { - atts, err = GenerateAttestations(bState, privs, numToGen, slot, false) + generatedAtts, err := GenerateAttestations(bState, privs, numToGen, slot, false) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attestations:", numToGen) } + atts = make([]*ethpb.Attestation, len(generatedAtts)) + var ok bool + for i, a := range generatedAtts { + atts[i], ok = a.(*ethpb.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has the wrong type (expected %T, got %T)", ðpb.Attestation{}, a) + } + } } numToGen = conf.NumDeposits diff --git a/testing/util/block.go b/testing/util/block.go index d9d8fb97ce47..e6f9d8e6b4f3 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -22,6 +22,7 @@ import ( v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assertions" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -109,19 +110,35 @@ func GenerateFullBlock( numToGen = conf.NumAttesterSlashings var aSlashings []*ethpb.AttesterSlashing if numToGen > 0 { - aSlashings, err = generateAttesterSlashings(bState, privs, numToGen) + generated, err := generateAttesterSlashings(bState, privs, numToGen) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attester slashings:", numToGen) } + aSlashings = make([]*ethpb.AttesterSlashing, len(generated)) + var ok bool + for i, s := range generated { + aSlashings[i], ok = s.(*ethpb.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has the wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, s) + } + } } numToGen = conf.NumAttestations var atts []*ethpb.Attestation if numToGen > 0 { - atts, err = GenerateAttestations(bState, privs, numToGen, slot, false) + generatedAtts, err := GenerateAttestations(bState, privs, numToGen, slot, false) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attestations:", numToGen) } + atts = make([]*ethpb.Attestation, len(generatedAtts)) + var ok bool + for i, a := range generatedAtts { + atts[i], ok = a.(*ethpb.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has the wrong type (expected %T, got %T)", ðpb.Attestation{}, a) + } + } } numToGen = conf.NumDeposits @@ -265,9 +282,59 @@ func GenerateAttesterSlashingForValidator( bState state.BeaconState, priv bls.SecretKey, idx primitives.ValidatorIndex, -) (*ethpb.AttesterSlashing, error) { +) (ethpb.AttSlashing, error) { currentEpoch := time.CurrentEpoch(bState) + if bState.Version() >= version.Electra { + att1 := ðpb.IndexedAttestationElectra{ + Data: ðpb.AttestationData{ + Slot: bState.Slot(), + CommitteeIndex: 0, + BeaconBlockRoot: make([]byte, fieldparams.RootLength), + Target: ðpb.Checkpoint{ + Epoch: currentEpoch, + Root: params.BeaconConfig().ZeroHash[:], + }, + Source: ðpb.Checkpoint{ + Epoch: currentEpoch + 1, + Root: params.BeaconConfig().ZeroHash[:], + }, + }, + AttestingIndices: []uint64{uint64(idx)}, + } + var err error + att1.Signature, err = signing.ComputeDomainAndSign(bState, currentEpoch, att1.Data, params.BeaconConfig().DomainBeaconAttester, priv) + if err != nil { + return nil, err + } + + att2 := ðpb.IndexedAttestationElectra{ + Data: ðpb.AttestationData{ + Slot: bState.Slot(), + CommitteeIndex: 0, + BeaconBlockRoot: make([]byte, fieldparams.RootLength), + Target: ðpb.Checkpoint{ + Epoch: currentEpoch, + Root: params.BeaconConfig().ZeroHash[:], + }, + Source: ðpb.Checkpoint{ + Epoch: currentEpoch, + Root: params.BeaconConfig().ZeroHash[:], + }, + }, + AttestingIndices: []uint64{uint64(idx)}, + } + att2.Signature, err = signing.ComputeDomainAndSign(bState, currentEpoch, att2.Data, params.BeaconConfig().DomainBeaconAttester, priv) + if err != nil { + return nil, err + } + + return ðpb.AttesterSlashingElectra{ + Attestation_1: att1, + Attestation_2: att2, + }, nil + } + att1 := ðpb.IndexedAttestation{ Data: ðpb.AttestationData{ Slot: bState.Slot(), @@ -321,8 +388,8 @@ func generateAttesterSlashings( bState state.BeaconState, privs []bls.SecretKey, numSlashings uint64, -) ([]*ethpb.AttesterSlashing, error) { - attesterSlashings := make([]*ethpb.AttesterSlashing, numSlashings) +) ([]ethpb.AttSlashing, error) { + attesterSlashings := make([]ethpb.AttSlashing, numSlashings) randGen := rand.NewDeterministicGenerator() for i := uint64(0); i < numSlashings; i++ { committeeIndex := randGen.Uint64() % helpers.SlotCommitteeCount(uint64(bState.NumValidators())) diff --git a/testing/util/capella_block.go b/testing/util/capella_block.go index 0002fce546f3..1ceeb706930c 100644 --- a/testing/util/capella_block.go +++ b/testing/util/capella_block.go @@ -24,7 +24,6 @@ import ( // GenerateFullBlockCapella generates a fully valid Capella block with the requested parameters. // Use BlockGenConfig to declare the conditions you would like the block generated under. // This function modifies the passed state as follows: - func GenerateFullBlockCapella( bState state.BeaconState, privs []bls.SecretKey, @@ -55,19 +54,35 @@ func GenerateFullBlockCapella( numToGen = conf.NumAttesterSlashings var aSlashings []*ethpb.AttesterSlashing if numToGen > 0 { - aSlashings, err = generateAttesterSlashings(bState, privs, numToGen) + generated, err := generateAttesterSlashings(bState, privs, numToGen) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attester slashings:", numToGen) } + aSlashings = make([]*ethpb.AttesterSlashing, len(generated)) + var ok bool + for i, s := range generated { + aSlashings[i], ok = s.(*ethpb.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has the wrong type (expected %T, got %T)", ðpb.AttesterSlashing{}, s) + } + } } numToGen = conf.NumAttestations var atts []*ethpb.Attestation if numToGen > 0 { - atts, err = GenerateAttestations(bState, privs, numToGen, slot, false) + generatedAtts, err := GenerateAttestations(bState, privs, numToGen, slot, false) if err != nil { return nil, errors.Wrapf(err, "failed generating %d attestations:", numToGen) } + atts = make([]*ethpb.Attestation, len(generatedAtts)) + var ok bool + for i, a := range generatedAtts { + atts[i], ok = a.(*ethpb.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has the wrong type (expected %T, got %T)", ðpb.Attestation{}, a) + } + } } numToGen = conf.NumDeposits diff --git a/testing/util/electra_block.go b/testing/util/electra_block.go new file mode 100644 index 000000000000..e285fdfc2a2c --- /dev/null +++ b/testing/util/electra_block.go @@ -0,0 +1,223 @@ +package util + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +// GenerateFullBlockElectra generates a fully valid Electra block with the requested parameters. +// Use BlockGenConfig to declare the conditions you would like the block generated under. +// This function modifies the passed state as follows: +func GenerateFullBlockElectra( + bState state.BeaconState, + privs []bls.SecretKey, + conf *BlockGenConfig, + slot primitives.Slot, +) (*ethpb.SignedBeaconBlockElectra, error) { + ctx := context.Background() + currentSlot := bState.Slot() + if currentSlot > slot { + return nil, fmt.Errorf("current slot in state is larger than given slot. %d > %d", currentSlot, slot) + } + bState = bState.Copy() + + if conf == nil { + conf = &BlockGenConfig{} + } + + var err error + var pSlashings []*ethpb.ProposerSlashing + numToGen := conf.NumProposerSlashings + if numToGen > 0 { + pSlashings, err = generateProposerSlashings(bState, privs, numToGen) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d proposer slashings:", numToGen) + } + } + + numToGen = conf.NumAttesterSlashings + var aSlashings []*ethpb.AttesterSlashingElectra + if numToGen > 0 { + generated, err := generateAttesterSlashings(bState, privs, numToGen) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d attester slashings:", numToGen) + } + aSlashings = make([]*ethpb.AttesterSlashingElectra, len(generated)) + var ok bool + for i, s := range generated { + aSlashings[i], ok = s.(*ethpb.AttesterSlashingElectra) + if !ok { + return nil, fmt.Errorf("attester slashing has the wrong type (expected %T, got %T)", ðpb.AttesterSlashingElectra{}, s) + } + } + } + + numToGen = conf.NumAttestations + var atts []*ethpb.AttestationElectra + if numToGen > 0 { + generatedAtts, err := GenerateAttestations(bState, privs, numToGen, slot, false) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d attestations:", numToGen) + } + atts = make([]*ethpb.AttestationElectra, len(generatedAtts)) + var ok bool + for i, a := range generatedAtts { + atts[i], ok = a.(*ethpb.AttestationElectra) + if !ok { + return nil, fmt.Errorf("attestation has the wrong type (expected %T, got %T)", ðpb.AttestationElectra{}, a) + } + } + } + + numToGen = conf.NumDeposits + var newDeposits []*ethpb.Deposit + eth1Data := bState.Eth1Data() + if numToGen > 0 { + newDeposits, eth1Data, err = generateDepositsAndEth1Data(bState, numToGen) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d deposits:", numToGen) + } + } + + numToGen = conf.NumVoluntaryExits + var exits []*ethpb.SignedVoluntaryExit + if numToGen > 0 { + exits, err = generateVoluntaryExits(bState, privs, numToGen) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d attester slashings:", numToGen) + } + } + + numToGen = conf.NumTransactions + newTransactions := make([][]byte, numToGen) + for i := uint64(0); i < numToGen; i++ { + newTransactions[i] = bytesutil.Uint64ToBytesLittleEndian(i) + } + newWithdrawals := make([]*v1.Withdrawal, 0) + + random, err := helpers.RandaoMix(bState, time.CurrentEpoch(bState)) + if err != nil { + return nil, errors.Wrap(err, "could not process randao mix") + } + + timestamp, err := slots.ToTime(bState.GenesisTime(), slot) + if err != nil { + return nil, errors.Wrap(err, "could not get current timestamp") + } + + stCopy := bState.Copy() + stCopy, err = transition.ProcessSlots(context.Background(), stCopy, slot) + if err != nil { + return nil, err + } + + parentExecution, err := stCopy.LatestExecutionPayloadHeader() + if err != nil { + return nil, err + } + blockHash := indexToHash(uint64(slot)) + newExecutionPayloadCapella := &v1.ExecutionPayloadElectra{ + ParentHash: parentExecution.BlockHash(), + FeeRecipient: make([]byte, 20), + StateRoot: params.BeaconConfig().ZeroHash[:], + ReceiptsRoot: params.BeaconConfig().ZeroHash[:], + LogsBloom: make([]byte, 256), + PrevRandao: random, + BlockNumber: uint64(slot), + ExtraData: params.BeaconConfig().ZeroHash[:], + BaseFeePerGas: params.BeaconConfig().ZeroHash[:], + BlockHash: blockHash[:], + Timestamp: uint64(timestamp.Unix()), + Transactions: newTransactions, + Withdrawals: newWithdrawals, + } + var syncCommitteeBits []byte + currSize := new(ethpb.SyncAggregate).SyncCommitteeBits.Len() + switch currSize { + case 512: + syncCommitteeBits = bitfield.NewBitvector512() + case 32: + syncCommitteeBits = bitfield.NewBitvector32() + default: + return nil, errors.New("invalid bit vector size") + } + newSyncAggregate := ðpb.SyncAggregate{ + SyncCommitteeBits: syncCommitteeBits, + SyncCommitteeSignature: append([]byte{0xC0}, make([]byte, 95)...), + } + + newHeader := bState.LatestBlockHeader() + prevStateRoot, err := bState.HashTreeRoot(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not hash state") + } + newHeader.StateRoot = prevStateRoot[:] + parentRoot, err := newHeader.HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not hash the new header") + } + + if slot == currentSlot { + slot = currentSlot + 1 + } + + reveal, err := RandaoReveal(stCopy, time.CurrentEpoch(stCopy), privs) + if err != nil { + return nil, errors.Wrap(err, "could not compute randao reveal") + } + + idx, err := helpers.BeaconProposerIndex(ctx, stCopy) + if err != nil { + return nil, errors.Wrap(err, "could not compute beacon proposer index") + } + + changes := make([]*ethpb.SignedBLSToExecutionChange, conf.NumBLSChanges) + for i := uint64(0); i < conf.NumBLSChanges; i++ { + changes[i], err = GenerateBLSToExecutionChange(bState, privs[i+1], primitives.ValidatorIndex(i)) + if err != nil { + return nil, err + } + } + + block := ðpb.BeaconBlockElectra{ + Slot: slot, + ParentRoot: parentRoot[:], + ProposerIndex: idx, + Body: ðpb.BeaconBlockBodyElectra{ + Eth1Data: eth1Data, + RandaoReveal: reveal, + ProposerSlashings: pSlashings, + AttesterSlashings: aSlashings, + Attestations: atts, + VoluntaryExits: exits, + Deposits: newDeposits, + Graffiti: make([]byte, fieldparams.RootLength), + SyncAggregate: newSyncAggregate, + ExecutionPayload: newExecutionPayloadCapella, + BlsToExecutionChanges: changes, + }, + } + + // The fork can change after processing the state + signature, err := BlockSignature(bState, block, privs) + if err != nil { + return nil, errors.Wrap(err, "could not compute block signature") + } + + return ðpb.SignedBeaconBlockElectra{Block: block, Signature: signature.Marshal()}, nil +} diff --git a/testing/util/helpers.go b/testing/util/helpers.go index e72b5a93179e..b207813a0861 100644 --- a/testing/util/helpers.go +++ b/testing/util/helpers.go @@ -3,6 +3,7 @@ package util import ( "context" "encoding/binary" + "fmt" "testing" "github.com/pkg/errors" @@ -54,8 +55,12 @@ func BlockSignature( wsb, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockBellatrix{Block: b}) case *ethpb.BeaconBlockCapella: wsb, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockCapella{Block: b}) + case *ethpb.BeaconBlockDeneb: + wsb, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{Block: b}) + case *ethpb.BeaconBlockElectra: + wsb, err = blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: b}) default: - return nil, errors.New("unsupported block type") + return nil, fmt.Errorf("unsupported block type %T", b) } if err != nil { return nil, errors.Wrap(err, "could not wrap block") @@ -74,6 +79,10 @@ func BlockSignature( b.StateRoot = s[:] case *ethpb.BeaconBlockCapella: b.StateRoot = s[:] + case *ethpb.BeaconBlockDeneb: + b.StateRoot = s[:] + case *ethpb.BeaconBlockElectra: + b.StateRoot = s[:] } // Temporarily increasing the beacon state slot here since BeaconProposerIndex is a @@ -88,6 +97,10 @@ func BlockSignature( blockSlot = b.Slot case *ethpb.BeaconBlockCapella: blockSlot = b.Slot + case *ethpb.BeaconBlockDeneb: + blockSlot = b.Slot + case *ethpb.BeaconBlockElectra: + blockSlot = b.Slot } // process slots to get the right fork @@ -111,6 +124,10 @@ func BlockSignature( blockRoot, err = signing.ComputeSigningRoot(b, domain) case *ethpb.BeaconBlockCapella: blockRoot, err = signing.ComputeSigningRoot(b, domain) + case *ethpb.BeaconBlockDeneb: + blockRoot, err = signing.ComputeSigningRoot(b, domain) + case *ethpb.BeaconBlockElectra: + blockRoot, err = signing.ComputeSigningRoot(b, domain) } if err != nil { return nil, err diff --git a/tools/benchmark-files-gen/main.go b/tools/benchmark-files-gen/main.go index 14556bf9fc4e..a8452884141b 100644 --- a/tools/benchmark-files-gen/main.go +++ b/tools/benchmark-files-gen/main.go @@ -122,10 +122,18 @@ func generateMarshalledFullStateAndBlock() error { var atts []*ethpb.Attestation for i := slotOffset + 1; i < slotsPerEpoch+slotOffset; i++ { - attsForSlot, err := util.GenerateAttestations(beaconState, privs, attConfig.NumAttestations, i, false) + generatedAttsForSlot, err := util.GenerateAttestations(beaconState, privs, attConfig.NumAttestations, i, false) if err != nil { return err } + attsForSlot := make([]*ethpb.Attestation, len(generatedAttsForSlot)) + for j, att := range generatedAttsForSlot { + a, ok := att.(*ethpb.Attestation) + if !ok { + return errors.New("attestation is not of type *ethpb.Attestation") + } + attsForSlot[j] = a + } atts = append(atts, attsForSlot...) } From 43c7659d18baef8bf3942090b042b479c58d123f Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 28 May 2024 09:50:41 -0700 Subject: [PATCH 115/325] Fix dependent root retrival genesis case (#14053) * Fix dependent root retrival genesis case * Remove print --- beacon-chain/rpc/eth/validator/handlers.go | 36 ++++++++++++++----- .../rpc/eth/validator/handlers_test.go | 19 ++++++---- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index f10dbb9d2b78..0ef419347224 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -708,10 +708,20 @@ func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request) { }) } - dependentRoot, err := attestationDependentRoot(st, requestedEpoch) - if err != nil { - httputil.HandleError(w, "Could not get dependent root: "+err.Error(), http.StatusInternalServerError) - return + var dependentRoot []byte + if requestedEpoch == 0 { + r, err := s.BeaconDB.GenesisBlockRoot(ctx) + if err != nil { + httputil.HandleError(w, "Could not get genesis block root: "+err.Error(), http.StatusInternalServerError) + return + } + dependentRoot = r[:] + } else { + dependentRoot, err = attestationDependentRoot(st, requestedEpoch) + if err != nil { + httputil.HandleError(w, "Could not get dependent root: "+err.Error(), http.StatusInternalServerError) + return + } } isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx) if err != nil { @@ -822,10 +832,20 @@ func (s *Server) GetProposerDuties(w http.ResponseWriter, r *http.Request) { } } - dependentRoot, err := proposalDependentRoot(st, requestedEpoch) - if err != nil { - httputil.HandleError(w, "Could not get dependent root: "+err.Error(), http.StatusInternalServerError) - return + var dependentRoot []byte + if requestedEpoch == 0 { + r, err := s.BeaconDB.GenesisBlockRoot(ctx) + if err != nil { + httputil.HandleError(w, "Could not get genesis block root: "+err.Error(), http.StatusInternalServerError) + return + } + dependentRoot = r[:] + } else { + dependentRoot, err = proposalDependentRoot(st, requestedEpoch) + if err != nil { + httputil.HandleError(w, "Could not get dependent root: "+err.Error(), http.StatusInternalServerError) + return + } } isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx) if err != nil { diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 57209ee7b58e..47cfa9ba6cc0 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -1443,6 +1443,9 @@ func TestGetAttesterDuties(t *testing.T) { chain := &mockChain.ChainService{ State: bs, Root: genesisRoot[:], Slot: &chainSlot, } + db := dbutil.SetupDB(t) + require.NoError(t, db.SaveGenesisBlockRoot(context.Background(), genesisRoot)) + s := &Server{ Stater: &testutil.MockStater{ StatesBySlot: map[primitives.Slot]state.BeaconState{ @@ -1453,6 +1456,7 @@ func TestGetAttesterDuties(t *testing.T) { TimeFetcher: chain, SyncChecker: &mockSync.Sync{IsSyncing: false}, OptimisticModeFetcher: chain, + BeaconDB: db, } t.Run("single validator", func(t *testing.T) { @@ -1619,7 +1623,6 @@ func TestGetAttesterDuties(t *testing.T) { blk.Block.Slot = 31 root, err := blk.Block.HashTreeRoot() require.NoError(t, err) - db := dbutil.SetupDB(t) util.SaveBlock(t, ctx, db, blk) require.NoError(t, db.SaveGenesisBlockRoot(ctx, root)) @@ -1632,6 +1635,7 @@ func TestGetAttesterDuties(t *testing.T) { TimeFetcher: chain, OptimisticModeFetcher: chain, SyncChecker: &mockSync.Sync{IsSyncing: false}, + BeaconDB: db, } var body bytes.Buffer @@ -1693,6 +1697,9 @@ func TestGetProposerDuties(t *testing.T) { pubKeys[i] = deposits[i].Data.PublicKey } + db := dbutil.SetupDB(t) + require.NoError(t, db.SaveGenesisBlockRoot(context.Background(), genesisRoot)) + t.Run("ok", func(t *testing.T) { bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data) require.NoError(t, err, "Could not set up genesis state") @@ -1710,6 +1717,7 @@ func TestGetProposerDuties(t *testing.T) { SyncChecker: &mockSync.Sync{IsSyncing: false}, PayloadIDCache: cache.NewPayloadIDCache(), TrackedValidatorsCache: cache.NewTrackedValidatorsCache(), + BeaconDB: db, } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) @@ -1751,6 +1759,7 @@ func TestGetProposerDuties(t *testing.T) { SyncChecker: &mockSync.Sync{IsSyncing: false}, PayloadIDCache: cache.NewPayloadIDCache(), TrackedValidatorsCache: cache.NewTrackedValidatorsCache(), + BeaconDB: db, } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) @@ -1793,6 +1802,7 @@ func TestGetProposerDuties(t *testing.T) { SyncChecker: &mockSync.Sync{IsSyncing: false}, PayloadIDCache: cache.NewPayloadIDCache(), TrackedValidatorsCache: cache.NewTrackedValidatorsCache(), + BeaconDB: db, } currentEpoch := slots.ToEpoch(bs.Slot()) @@ -1809,7 +1819,6 @@ func TestGetProposerDuties(t *testing.T) { assert.StringContains(t, fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", currentEpoch+2, currentEpoch+1), e.Message) }) t.Run("execution optimistic", func(t *testing.T) { - ctx := context.Background() bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data) require.NoError(t, err, "Could not set up genesis state") // Set state to non-epoch start slot. @@ -1819,11 +1828,6 @@ func TestGetProposerDuties(t *testing.T) { blk := util.NewBeaconBlock() blk.Block.ParentRoot = parentRoot[:] blk.Block.Slot = 31 - root, err := blk.Block.HashTreeRoot() - require.NoError(t, err) - db := dbutil.SetupDB(t) - util.SaveBlock(t, ctx, db, blk) - require.NoError(t, db.SaveGenesisBlockRoot(ctx, root)) chainSlot := primitives.Slot(0) chain := &mockChain.ChainService{ @@ -1837,6 +1841,7 @@ func TestGetProposerDuties(t *testing.T) { SyncChecker: &mockSync.Sync{IsSyncing: false}, PayloadIDCache: cache.NewPayloadIDCache(), TrackedValidatorsCache: cache.NewTrackedValidatorsCache(), + BeaconDB: db, } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) From 6fddd13cb2af17c9c4dc36a155fd32fa3c3a223b Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Tue, 28 May 2024 18:43:06 -0700 Subject: [PATCH 116/325] Multiple BN HTTP resolver (#13433) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * http resolver * Redo * Revert "Redo" This reverts commit 5437c44ac26e48c041f5c16f399446c5f72c31a2. * Revert "http resolver" This reverts commit 206207b530c30aca13d705db259c6cf738cae533. * Add host change to ValidatorClient + Validator * Update mockgen * Tidy * Add mock validator * Update gomock * Gaz * Solve interface issues * Fix host * Fix test * Add tests * Add endpoint change log * Fix log * Gen mock * Fix test * Fix deepsource * Lint + deepsource * Move to healthCheckRoutine * Fix build errors * Switch host to string * Forgot a couple * Radek' review * Add PushProposerSettings to goroutine * Radek' review * James' review + test fix * Radek' suggestion Co-authored-by: Radosław Kapka * Check if new node is healthy * Fix linter errors * Add host switch logic to ChangeHost * Lint + comment * Fix messy merge * rename ChangeHost to SetHost * improve log * remove log * switch one node * rename param --------- Co-authored-by: Radosław Kapka Co-authored-by: rkapka --- testing/mock/node_service_mock.go | 20 ++++++++ testing/validator-mock/node_client_mock.go | 26 ++++------ .../validator-mock/validator_client_mock.go | 26 ++++++++++ validator/accounts/cli_manager.go | 5 +- validator/accounts/testing/mock.go | 8 +++ .../beacon-api/beacon_api_validator_client.go | 8 +++ .../beacon_api_validator_client_test.go | 29 +++++++++++ .../client/beacon-api/json_rest_handler.go | 17 ++++--- .../beacon-api/mock/json_rest_handler_mock.go | 50 +++++++++++++++---- .../client/grpc-api/grpc_validator_client.go | 13 ++++- validator/client/iface/validator.go | 4 +- validator/client/iface/validator_client.go | 2 + validator/client/runner.go | 23 +++++++++ validator/client/service.go | 11 +++- validator/client/testutil/mock_validator.go | 8 +++ validator/client/validator.go | 17 +++++++ validator/client/validator_test.go | 32 ++++++++++++ validator/rpc/beacon.go | 5 +- 18 files changed, 267 insertions(+), 37 deletions(-) diff --git a/testing/mock/node_service_mock.go b/testing/mock/node_service_mock.go index 57a0cde054f6..72f268f582b4 100644 --- a/testing/mock/node_service_mock.go +++ b/testing/mock/node_service_mock.go @@ -82,6 +82,26 @@ func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any, arg2 ...any) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), varargs...) } +// GetHealth mocks base method. +func (m *MockNodeClient) GetHealth(arg0 context.Context, arg1 *eth.HealthRequest, arg2 ...grpc.CallOption) (*emptypb.Empty, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetHealth", varargs...) + ret0, _ := ret[0].(*emptypb.Empty) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHealth indicates an expected call of GetHealth. +func (mr *MockNodeClientMockRecorder) GetHealth(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHealth", reflect.TypeOf((*MockNodeClient)(nil).GetHealth), varargs...) +} + // GetHost mocks base method. func (m *MockNodeClient) GetHost(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*eth.HostData, error) { m.ctrl.T.Helper() diff --git a/testing/validator-mock/node_client_mock.go b/testing/validator-mock/node_client_mock.go index 337b8e22465e..fa8eb1b3d9fb 100644 --- a/testing/validator-mock/node_client_mock.go +++ b/testing/validator-mock/node_client_mock.go @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - "github.com/prysmaticlabs/prysm/v5/api/client/beacon" + beacon "github.com/prysmaticlabs/prysm/v5/api/client/beacon" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" gomock "go.uber.org/mock/gomock" emptypb "google.golang.org/protobuf/types/known/emptypb" @@ -21,9 +21,8 @@ import ( // MockNodeClient is a mock of NodeClient interface. type MockNodeClient struct { - ctrl *gomock.Controller - recorder *MockNodeClientMockRecorder - healthTracker *beacon.NodeHealthTracker + ctrl *gomock.Controller + recorder *MockNodeClientMockRecorder } // MockNodeClientMockRecorder is the mock recorder for MockNodeClient. @@ -35,7 +34,6 @@ type MockNodeClientMockRecorder struct { func NewMockNodeClient(ctrl *gomock.Controller) *MockNodeClient { mock := &MockNodeClient{ctrl: ctrl} mock.recorder = &MockNodeClientMockRecorder{mock} - mock.healthTracker = beacon.NewNodeHealthTracker(mock) return mock } @@ -89,18 +87,18 @@ func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), arg0, arg1) } -// IsHealthy mocks base method. -func (m *MockNodeClient) IsHealthy(arg0 context.Context) bool { +// HealthTracker mocks base method. +func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsHealthy", arg0) - ret0, _ := ret[0].(bool) + ret := m.ctrl.Call(m, "HealthTracker") + ret0, _ := ret[0].(*beacon.NodeHealthTracker) return ret0 } -// IsHealthy indicates an expected call of IsHealthy. -func (mr *MockNodeClientMockRecorder) IsHealthy(arg0 any) *gomock.Call { +// HealthTracker indicates an expected call of HealthTracker. +func (mr *MockNodeClientMockRecorder) HealthTracker() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsHealthy", reflect.TypeOf((*MockNodeClient)(nil).IsHealthy), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthTracker", reflect.TypeOf((*MockNodeClient)(nil).HealthTracker)) } // ListPeers mocks base method. @@ -117,7 +115,3 @@ func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), arg0, arg1) } - -func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { - return m.healthTracker -} diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index 7af1aee9a0de..bcb815d331d6 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -223,6 +223,20 @@ func (mr *MockValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncSubcommitteeIndex), arg0, arg1) } +// Host mocks base method. +func (m *MockValidatorClient) Host() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Host") + ret0, _ := ret[0].(string) + return ret0 +} + +// Host indicates an expected call of Host. +func (mr *MockValidatorClientMockRecorder) Host() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockValidatorClient)(nil).Host)) +} + // MultipleValidatorStatus mocks base method. func (m *MockValidatorClient) MultipleValidatorStatus(arg0 context.Context, arg1 *eth.MultipleValidatorStatusRequest) (*eth.MultipleValidatorStatusResponse, error) { m.ctrl.T.Helper() @@ -298,6 +312,18 @@ func (mr *MockValidatorClientMockRecorder) ProposeExit(arg0, arg1 any) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeExit", reflect.TypeOf((*MockValidatorClient)(nil).ProposeExit), arg0, arg1) } +// SetHost mocks base method. +func (m *MockValidatorClient) SetHost(arg0 string) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetHost", arg0) +} + +// SetHost indicates an expected call of SetHost. +func (mr *MockValidatorClientMockRecorder) SetHost(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHost", reflect.TypeOf((*MockValidatorClient)(nil).SetHost), arg0) +} + // StartEventStream mocks base method. func (m *MockValidatorClient) StartEventStream(arg0 context.Context, arg1 []string, arg2 chan<- *event.Event) { m.ctrl.T.Helper() diff --git a/validator/accounts/cli_manager.go b/validator/accounts/cli_manager.go index e897292c6b04..3f0116e3c65a 100644 --- a/validator/accounts/cli_manager.go +++ b/validator/accounts/cli_manager.go @@ -87,7 +87,10 @@ func (acm *CLIManager) prepareBeaconClients(ctx context.Context) (*iface.Validat acm.beaconApiTimeout, ) - restHandler := beaconApi.NewBeaconApiJsonRestHandler(http.Client{Timeout: acm.beaconApiTimeout}, acm.beaconApiEndpoint) + restHandler := beaconApi.NewBeaconApiJsonRestHandler( + http.Client{Timeout: acm.beaconApiTimeout}, + acm.beaconApiEndpoint, + ) validatorClient := validatorClientFactory.NewValidatorClient(conn, restHandler) nodeClient := nodeClientFactory.NewNodeClient(conn, restHandler) diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index 3d5fccd86f74..f8f53f78f240 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -249,3 +249,11 @@ func (*Validator) EventStreamIsRunning() bool { func (*Validator) HealthTracker() *beacon.NodeHealthTracker { panic("implement me") } + +func (*Validator) Host() string { + panic("implement me") +} + +func (*Validator) ChangeHost() { + panic("implement me") +} diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 43eb64d3726d..667ac9a4710f 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -230,3 +230,11 @@ func wrapInMetrics[Resp any](action string, f func() (Resp, error)) (Resp, error } return resp, err } + +func (c *beaconApiValidatorClient) Host() string { + return c.jsonRestHandler.Host() +} + +func (c *beaconApiValidatorClient) SetHost(host string) { + c.jsonRestHandler.SetHost(host) +} diff --git a/validator/client/beacon-api/beacon_api_validator_client_test.go b/validator/client/beacon-api/beacon_api_validator_client_test.go index f416ae498fce..7e5872124a91 100644 --- a/validator/client/beacon-api/beacon_api_validator_client_test.go +++ b/validator/client/beacon-api/beacon_api_validator_client_test.go @@ -202,3 +202,32 @@ func TestBeaconApiValidatorClient_ProposeBeaconBlockError(t *testing.T) { assert.ErrorContains(t, expectedErr.Error(), err) assert.DeepEqual(t, expectedResp, resp) } + +func TestBeaconApiValidatorClient_Host(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + hosts := []string{"http://localhost:8080", "http://localhost:8081"} + jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) + jsonRestHandler.EXPECT().SetHost( + hosts[0], + ).Times(1) + jsonRestHandler.EXPECT().Host().Return( + hosts[0], + ).Times(1) + + validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} + validatorClient.SetHost(hosts[0]) + host := validatorClient.Host() + require.Equal(t, hosts[0], host) + + jsonRestHandler.EXPECT().SetHost( + hosts[1], + ).Times(1) + jsonRestHandler.EXPECT().Host().Return( + hosts[1], + ).Times(1) + validatorClient.SetHost(hosts[1]) + host = validatorClient.Host() + require.Equal(t, hosts[1], host) +} diff --git a/validator/client/beacon-api/json_rest_handler.go b/validator/client/beacon-api/json_rest_handler.go index 57f74aaf4d14..890a10e26be6 100644 --- a/validator/client/beacon-api/json_rest_handler.go +++ b/validator/client/beacon-api/json_rest_handler.go @@ -18,6 +18,7 @@ type JsonRestHandler interface { Post(ctx context.Context, endpoint string, headers map[string]string, data *bytes.Buffer, resp interface{}) error HttpClient() *http.Client Host() string + SetHost(host string) } type BeaconApiJsonRestHandler struct { @@ -33,19 +34,19 @@ func NewBeaconApiJsonRestHandler(client http.Client, host string) JsonRestHandle } } -// GetHttpClient returns the underlying HTTP client of the handler -func (c BeaconApiJsonRestHandler) HttpClient() *http.Client { +// HttpClient returns the underlying HTTP client of the handler +func (c *BeaconApiJsonRestHandler) HttpClient() *http.Client { return &c.client } -// GetHost returns the underlying HTTP host -func (c BeaconApiJsonRestHandler) Host() string { +// Host returns the underlying HTTP host +func (c *BeaconApiJsonRestHandler) Host() string { return c.host } // Get sends a GET request and decodes the response body as a JSON object into the passed in object. // If an HTTP error is returned, the body is decoded as a DefaultJsonError JSON object and returned as the first return value. -func (c BeaconApiJsonRestHandler) Get(ctx context.Context, endpoint string, resp interface{}) error { +func (c *BeaconApiJsonRestHandler) Get(ctx context.Context, endpoint string, resp interface{}) error { url := c.host + endpoint req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) if err != nil { @@ -67,7 +68,7 @@ func (c BeaconApiJsonRestHandler) Get(ctx context.Context, endpoint string, resp // Post sends a POST request and decodes the response body as a JSON object into the passed in object. // If an HTTP error is returned, the body is decoded as a DefaultJsonError JSON object and returned as the first return value. -func (c BeaconApiJsonRestHandler) Post( +func (c *BeaconApiJsonRestHandler) Post( ctx context.Context, apiEndpoint string, headers map[string]string, @@ -134,3 +135,7 @@ func decodeResp(httpResp *http.Response, resp interface{}) error { return nil } + +func (c *BeaconApiJsonRestHandler) SetHost(host string) { + c.host = host +} diff --git a/validator/client/beacon-api/mock/json_rest_handler_mock.go b/validator/client/beacon-api/mock/json_rest_handler_mock.go index b79df47828b9..1e2e98499cd3 100644 --- a/validator/client/beacon-api/mock/json_rest_handler_mock.go +++ b/validator/client/beacon-api/mock/json_rest_handler_mock.go @@ -12,7 +12,7 @@ package mock import ( bytes "bytes" context "context" - "net/http" + http "net/http" reflect "reflect" gomock "go.uber.org/mock/gomock" @@ -36,14 +36,6 @@ func NewMockJsonRestHandler(ctrl *gomock.Controller) *MockJsonRestHandler { return mock } -func (mr *MockJsonRestHandler) HttpClient() *http.Client { - return nil -} - -func (mr *MockJsonRestHandler) Host() string { - return "" -} - // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockJsonRestHandler) EXPECT() *MockJsonRestHandlerMockRecorder { return m.recorder @@ -63,6 +55,34 @@ func (mr *MockJsonRestHandlerMockRecorder) Get(ctx, endpoint, resp any) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockJsonRestHandler)(nil).Get), ctx, endpoint, resp) } +// Host mocks base method. +func (m *MockJsonRestHandler) Host() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Host") + ret0, _ := ret[0].(string) + return ret0 +} + +// Host indicates an expected call of Host. +func (mr *MockJsonRestHandlerMockRecorder) Host() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockJsonRestHandler)(nil).Host)) +} + +// HttpClient mocks base method. +func (m *MockJsonRestHandler) HttpClient() *http.Client { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HttpClient") + ret0, _ := ret[0].(*http.Client) + return ret0 +} + +// HttpClient indicates an expected call of HttpClient. +func (mr *MockJsonRestHandlerMockRecorder) HttpClient() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HttpClient", reflect.TypeOf((*MockJsonRestHandler)(nil).HttpClient)) +} + // Post mocks base method. func (m *MockJsonRestHandler) Post(ctx context.Context, endpoint string, headers map[string]string, data *bytes.Buffer, resp any) error { m.ctrl.T.Helper() @@ -76,3 +96,15 @@ func (mr *MockJsonRestHandlerMockRecorder) Post(ctx, endpoint, headers, data, re mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Post", reflect.TypeOf((*MockJsonRestHandler)(nil).Post), ctx, endpoint, headers, data, resp) } + +// SetHost mocks base method. +func (m *MockJsonRestHandler) SetHost(host string) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetHost", host) +} + +// SetHost indicates an expected call of SetHost. +func (mr *MockJsonRestHandlerMockRecorder) SetHost(host any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHost", reflect.TypeOf((*MockJsonRestHandler)(nil).SetHost), host) +} diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index cb87cc174756..11ca01b0c2ef 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -142,11 +142,11 @@ func (c *grpcValidatorClient) AggregatedSigAndAggregationBits( return c.beaconNodeValidatorClient.AggregatedSigAndAggregationBits(ctx, in) } -func (grpcValidatorClient) GetAggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (*grpcValidatorClient) GetAggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { return nil, iface.ErrNotSupported } -func (grpcValidatorClient) GetAggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (*grpcValidatorClient) GetAggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { return nil, iface.ErrNotSupported } @@ -245,3 +245,12 @@ func (c *grpcValidatorClient) StartEventStream(ctx context.Context, topics []str func (c *grpcValidatorClient) EventStreamIsRunning() bool { return c.isEventStreamRunning } + +func (*grpcValidatorClient) Host() string { + log.Warn(iface.ErrNotSupported) + return "" +} + +func (*grpcValidatorClient) SetHost(_ string) { + log.Warn(iface.ErrNotSupported) +} diff --git a/validator/client/iface/validator.go b/validator/client/iface/validator.go index 3163b8dd8a6a..5d3cb0110453 100644 --- a/validator/client/iface/validator.go +++ b/validator/client/iface/validator.go @@ -68,7 +68,9 @@ type Validator interface { SetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error DeleteGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) error HealthTracker() *beacon.NodeHealthTracker + Host() string + ChangeHost() } -// SigningFunc interface defines a type for the a function that signs a message +// SigningFunc interface defines a type for the function that signs a message type SigningFunc func(context.Context, *validatorpb.SignRequest) (bls.Signature, error) diff --git a/validator/client/iface/validator_client.go b/validator/client/iface/validator_client.go index 3f9cbe8fd22f..2e59a686f489 100644 --- a/validator/client/iface/validator_client.go +++ b/validator/client/iface/validator_client.go @@ -150,4 +150,6 @@ type ValidatorClient interface { EventStreamIsRunning() bool GetAggregatedSelections(ctx context.Context, selections []BeaconCommitteeSelection) ([]BeaconCommitteeSelection, error) GetAggregatedSyncSelections(ctx context.Context, selections []SyncCommitteeSelection) ([]SyncCommitteeSelection, error) + Host() string + SetHost(host string) } diff --git a/validator/client/runner.go b/validator/client/runner.go index 71a7a4729f35..83c9fec2489b 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/client" "github.com/prysmaticlabs/prysm/v5/api/client/event" + "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -305,6 +306,28 @@ func runHealthCheckRoutine(ctx context.Context, v iface.Validator, eventsChan ch return } isHealthy := tracker.CheckHealth(ctx) + if !isHealthy && features.Get().EnableBeaconRESTApi { + v.ChangeHost() + if !tracker.CheckHealth(ctx) { + continue // Skip to the next ticker + } + + km, err := v.Keymanager() + if err != nil { + log.WithError(err).Error("Could not get keymanager") + return + } + slot, err := v.CanonicalHeadSlot(ctx) + if err != nil { + log.WithError(err).Error("Could not get canonical head slot") + return + } + deadline := time.Now().Add(5 * time.Minute) // Should consider changing to a constant + if err := v.PushProposerSettings(ctx, km, slot, deadline); err != nil { + log.WithError(err).Warn("Failed to update proposer settings") + } + } + // in case of node returning healthy but event stream died if isHealthy && !v.EventStreamIsRunning() { log.Info("Event stream reconnecting...") diff --git a/validator/client/service.go b/validator/client/service.go index 6e5a4cd6900a..a7bd4408c202 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -3,6 +3,7 @@ package client import ( "context" "net/http" + "strings" "time" "github.com/dgraph-io/ristretto" @@ -165,9 +166,15 @@ func (v *ValidatorService) Start() { return } + u := strings.ReplaceAll(v.conn.GetBeaconApiUrl(), " ", "") + hosts := strings.Split(u, ",") + if len(hosts) == 0 { + log.WithError(err).Error("No API hosts provided") + return + } restHandler := beaconApi.NewBeaconApiJsonRestHandler( http.Client{Timeout: v.conn.GetBeaconApiTimeout()}, - v.conn.GetBeaconApiUrl(), + hosts[0], ) validatorClient := validatorClientFactory.NewValidatorClient(v.conn, restHandler) @@ -184,6 +191,8 @@ func (v *ValidatorService) Start() { graffiti: v.graffiti, graffitiStruct: v.graffitiStruct, graffitiOrderedIndex: graffitiOrderedIndex, + beaconNodeHosts: hosts, + currentHostIndex: 0, validatorClient: validatorClient, chainClient: beaconChainClientFactory.NewChainClient(v.conn, restHandler), nodeClient: nodeClientFactory.NewNodeClient(v.conn, restHandler), diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index 15c4d17a537f..93f015bfd473 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -324,3 +324,11 @@ func (*FakeValidator) EventStreamIsRunning() bool { func (fv *FakeValidator) HealthTracker() *beacon.NodeHealthTracker { return fv.Tracker } + +func (*FakeValidator) Host() string { + return "127.0.0.1:0" +} + +func (fv *FakeValidator) ChangeHost() { + fv.Host() +} diff --git a/validator/client/validator.go b/validator/client/validator.go index 142ec9f32f1b..4bb0d1b4ab0a 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -84,6 +84,8 @@ type validator struct { graffiti []byte graffitiStruct *graffiti.Graffiti graffitiOrderedIndex uint64 + beaconNodeHosts []string + currentHostIndex uint64 validatorClient iface.ValidatorClient chainClient iface.ChainClient nodeClient iface.NodeClient @@ -1114,6 +1116,21 @@ func (v *validator) HealthTracker() *beacon.NodeHealthTracker { return v.nodeClient.HealthTracker() } +func (v *validator) Host() string { + return v.validatorClient.Host() +} + +func (v *validator) ChangeHost() { + if len(v.beaconNodeHosts) == 1 { + log.Infof("Beacon node at %s is not responding, no backup node configured", v.Host()) + return + } + next := (v.currentHostIndex + 1) % uint64(len(v.beaconNodeHosts)) + log.Infof("Beacon node at %s is not responding, switching to %s...", v.beaconNodeHosts[v.currentHostIndex], v.beaconNodeHosts[next]) + v.validatorClient.SetHost(v.beaconNodeHosts[next]) + v.currentHostIndex = next +} + func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fieldparams.BLSPubkeyLength]byte, slot primitives.Slot) ([][fieldparams.BLSPubkeyLength]byte, error) { filteredKeys := make([][fieldparams.BLSPubkeyLength]byte, 0) statusRequestKeys := make([][]byte, 0) diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 23d26e18aff6..884606bd1d52 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -2590,3 +2590,35 @@ func TestValidator_buildSignedRegReqs_TimestampBeforeGenesis(t *testing.T) { actual := v.buildSignedRegReqs(ctx, pubkeys, signer) assert.Equal(t, 0, len(actual)) } + +func TestValidator_Host(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + client := validatormock.NewMockValidatorClient(ctrl) + v := validator{ + validatorClient: client, + } + + client.EXPECT().Host().Return("host").Times(1) + require.Equal(t, "host", v.Host()) +} + +func TestValidator_ChangeHost(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + client := validatormock.NewMockValidatorClient(ctrl) + v := validator{ + validatorClient: client, + beaconNodeHosts: []string{"http://localhost:8080", "http://localhost:8081"}, + currentHostIndex: 0, + } + + client.EXPECT().SetHost(v.beaconNodeHosts[1]) + client.EXPECT().SetHost(v.beaconNodeHosts[0]) + v.ChangeHost() + assert.Equal(t, uint64(1), v.currentHostIndex) + v.ChangeHost() + assert.Equal(t, uint64(0), v.currentHostIndex) +} diff --git a/validator/rpc/beacon.go b/validator/rpc/beacon.go index e86dd2a7ce6e..5ae024d3011a 100644 --- a/validator/rpc/beacon.go +++ b/validator/rpc/beacon.go @@ -54,7 +54,10 @@ func (s *Server) registerBeaconClient() error { s.beaconApiTimeout, ) - restHandler := beaconApi.NewBeaconApiJsonRestHandler(http.Client{Timeout: s.beaconApiTimeout}, s.beaconApiEndpoint) + restHandler := beaconApi.NewBeaconApiJsonRestHandler( + http.Client{Timeout: s.beaconApiTimeout}, + s.beaconApiEndpoint, + ) s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) From 82f0ea5b110d69e92a953618aa5ff9e714a5c2a1 Mon Sep 17 00:00:00 2001 From: terence Date: Wed, 29 May 2024 21:15:00 -0700 Subject: [PATCH 117/325] Fix dependent root retrival for first epoch (#14059) --- beacon-chain/rpc/eth/validator/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 0ef419347224..171790b1bc21 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -709,7 +709,7 @@ func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request) { } var dependentRoot []byte - if requestedEpoch == 0 { + if requestedEpoch <= 1 { r, err := s.BeaconDB.GenesisBlockRoot(ctx) if err != nil { httputil.HandleError(w, "Could not get genesis block root: "+err.Error(), http.StatusInternalServerError) From 7a4ecb60605a40fa26e47483f86a7270368485d0 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Thu, 30 May 2024 14:57:26 +0800 Subject: [PATCH 118/325] Restrict Dials From Discovery (#14052) * Fix Excessive Subnet Dials * Handle backoff in Iterator * Slow Down Lookups * Add Flag To Configure Dials * Preston's Review * Update cmd/beacon-chain/flags/base.go Co-authored-by: Preston Van Loon * Reduce polling period * Manu's Review --------- Co-authored-by: Preston Van Loon --- beacon-chain/p2p/discovery.go | 63 ++++++++++++++++++++++---------- beacon-chain/p2p/iterator.go | 12 ++++++ beacon-chain/p2p/subnets.go | 7 +++- cmd/beacon-chain/flags/base.go | 6 +++ cmd/beacon-chain/flags/config.go | 7 ++++ cmd/beacon-chain/main.go | 1 + cmd/beacon-chain/usage.go | 1 + 7 files changed, 77 insertions(+), 20 deletions(-) diff --git a/beacon-chain/p2p/discovery.go b/beacon-chain/p2p/discovery.go index 7fc63927ca88..f032038d4304 100644 --- a/beacon-chain/p2p/discovery.go +++ b/beacon-chain/p2p/discovery.go @@ -4,6 +4,7 @@ import ( "bytes" "crypto/ecdsa" "net" + "sync" "time" "github.com/ethereum/go-ethereum/p2p/discover" @@ -15,6 +16,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" + "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" ecdsaprysm "github.com/prysmaticlabs/prysm/v5/crypto/ecdsa" @@ -106,7 +108,7 @@ func (s *Service) RefreshENR() { // listen for new nodes watches for new nodes in the network and adds them to the peerstore. func (s *Service) listenForNewNodes() { - iterator := enode.Filter(s.dv5Listener.RandomNodes(), s.filterPeer) + iterator := filterNodes(s.ctx, s.dv5Listener.RandomNodes(), s.filterPeer) defer iterator.Close() for { @@ -122,29 +124,41 @@ func (s *Service) listenForNewNodes() { time.Sleep(pollingPeriod) continue } - - if exists := iterator.Next(); !exists { - break - } - - node := iterator.Node() - peerInfo, _, err := convertToAddrInfo(node) - if err != nil { - log.WithError(err).Error("Could not convert to peer info") + wantedCount := s.wantedPeerDials() + if wantedCount == 0 { + log.Trace("Not looking for peers, at peer limit") + time.Sleep(pollingPeriod) continue } - - if peerInfo == nil { - continue + // Restrict dials if limit is applied. + if flags.MaxDialIsActive() { + wantedCount = min(wantedCount, flags.Get().MaxConcurrentDials) } + wantedNodes := enode.ReadNodes(iterator, wantedCount) + wg := new(sync.WaitGroup) + for i := 0; i < len(wantedNodes); i++ { + node := wantedNodes[i] + peerInfo, _, err := convertToAddrInfo(node) + if err != nil { + log.WithError(err).Error("Could not convert to peer info") + continue + } - // Make sure that peer is not dialed too often, for each connection attempt there's a backoff period. - s.Peers().RandomizeBackOff(peerInfo.ID) - go func(info *peer.AddrInfo) { - if err := s.connectWithPeer(s.ctx, *info); err != nil { - log.WithError(err).Tracef("Could not connect with peer %s", info.String()) + if peerInfo == nil { + continue } - }(peerInfo) + + // Make sure that peer is not dialed too often, for each connection attempt there's a backoff period. + s.Peers().RandomizeBackOff(peerInfo.ID) + wg.Add(1) + go func(info *peer.AddrInfo) { + if err := s.connectWithPeer(s.ctx, *info); err != nil { + log.WithError(err).Tracef("Could not connect with peer %s", info.String()) + } + wg.Done() + }(peerInfo) + } + wg.Wait() } } @@ -384,6 +398,17 @@ func (s *Service) isPeerAtLimit(inbound bool) bool { return activePeers >= maxPeers || numOfConns >= maxPeers } +func (s *Service) wantedPeerDials() int { + maxPeers := int(s.cfg.MaxPeers) + + activePeers := len(s.Peers().Active()) + wantedCount := 0 + if maxPeers > activePeers { + wantedCount = maxPeers - activePeers + } + return wantedCount +} + // PeersFromStringAddrs converts peer raw ENRs into multiaddrs for p2p. func PeersFromStringAddrs(addrs []string) ([]ma.Multiaddr, error) { var allAddrs []ma.Multiaddr diff --git a/beacon-chain/p2p/iterator.go b/beacon-chain/p2p/iterator.go index cd5451ba3048..2530e46a5b8d 100644 --- a/beacon-chain/p2p/iterator.go +++ b/beacon-chain/p2p/iterator.go @@ -2,10 +2,14 @@ package p2p import ( "context" + "runtime" + "time" "github.com/ethereum/go-ethereum/p2p/enode" ) +const backOffCounter = 50 + // filterNodes wraps an iterator such that Next only returns nodes for which // the 'check' function returns true. This custom implementation also // checks for context deadlines so that in the event the parent context has @@ -24,13 +28,21 @@ type filterIter struct { // Next looks up for the next valid node according to our // filter criteria. func (f *filterIter) Next() bool { + lookupCounter := 0 for f.Iterator.Next() { + // Do not excessively perform lookups if we constantly receive non-viable peers. + if lookupCounter > backOffCounter { + lookupCounter = 0 + runtime.Gosched() + time.Sleep(pollingPeriod) + } if f.Context.Err() != nil { return false } if f.check(f.Node()) { return true } + lookupCounter++ } return false } diff --git a/beacon-chain/p2p/subnets.go b/beacon-chain/p2p/subnets.go index 2c6262232a00..1809c7db5f19 100644 --- a/beacon-chain/p2p/subnets.go +++ b/beacon-chain/p2p/subnets.go @@ -87,7 +87,12 @@ func (s *Service) FindPeersWithSubnet(ctx context.Context, topic string, return false, errors.Errorf("unable to find requisite number of peers for topic %s - "+ "only %d out of %d peers were able to be found", topic, currNum, threshold) } - nodes := enode.ReadNodes(iterator, int(params.BeaconNetworkConfig().MinimumPeersInSubnetSearch)) + nodeCount := int(params.BeaconNetworkConfig().MinimumPeersInSubnetSearch) + // Restrict dials if limit is applied. + if flags.MaxDialIsActive() { + nodeCount = min(nodeCount, flags.Get().MaxConcurrentDials) + } + nodes := enode.ReadNodes(iterator, nodeCount) for _, node := range nodes { info, _, err := convertToAddrInfo(node) if err != nil { diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 5b26a7480315..d119c427f2fd 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -227,6 +227,12 @@ var ( Usage: "Sets the minimum number of peers that a node will attempt to peer with that are subscribed to a subnet.", Value: 6, } + // MaxConcurrentDials defines a flag to set the maximum number of peers that a node will attempt to dial with from discovery. + MaxConcurrentDials = &cli.Uint64Flag{ + Name: "max-concurrent-dials", + Usage: "Sets the maximum number of peers that a node will attempt to dial with from discovery. By default we will dials as " + + "many peers as possible.", + } // SuggestedFeeRecipient specifies the fee recipient for the transaction fees. SuggestedFeeRecipient = &cli.StringFlag{ Name: "suggested-fee-recipient", diff --git a/cmd/beacon-chain/flags/config.go b/cmd/beacon-chain/flags/config.go index bdb1b8bcb22d..48226dda8924 100644 --- a/cmd/beacon-chain/flags/config.go +++ b/cmd/beacon-chain/flags/config.go @@ -11,6 +11,7 @@ type GlobalFlags struct { SubscribeToAllSubnets bool MinimumSyncPeers int MinimumPeersPerSubnet int + MaxConcurrentDials int BlockBatchLimit int BlockBatchLimitBurstFactor int BlobBatchLimit int @@ -45,11 +46,17 @@ func ConfigureGlobalFlags(ctx *cli.Context) { cfg.BlobBatchLimit = ctx.Int(BlobBatchLimit.Name) cfg.BlobBatchLimitBurstFactor = ctx.Int(BlobBatchLimitBurstFactor.Name) cfg.MinimumPeersPerSubnet = ctx.Int(MinPeersPerSubnet.Name) + cfg.MaxConcurrentDials = ctx.Int(MaxConcurrentDials.Name) configureMinimumPeers(ctx, cfg) Init(cfg) } +// MaxDialIsActive checks if the user has enabled the max dial flag. +func MaxDialIsActive() bool { + return Get().MaxConcurrentDials > 0 +} + func configureMinimumPeers(ctx *cli.Context, cfg *GlobalFlags) { cfg.MinimumSyncPeers = ctx.Int(MinSyncPeers.Name) maxPeers := ctx.Int(cmd.P2PMaxPeers.Name) diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index c7dec5e72431..97092232d3de 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -72,6 +72,7 @@ var appFlags = []cli.Flag{ flags.WeakSubjectivityCheckpoint, flags.Eth1HeaderReqLimit, flags.MinPeersPerSubnet, + flags.MaxConcurrentDials, flags.SuggestedFeeRecipient, flags.TerminalTotalDifficultyOverride, flags.TerminalBlockHashOverride, diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index adc4c87a3085..747533c0f0d9 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -124,6 +124,7 @@ var appHelpFlagGroups = []flagGroup{ flags.WeakSubjectivityCheckpoint, flags.Eth1HeaderReqLimit, flags.MinPeersPerSubnet, + flags.MaxConcurrentDials, flags.MevRelayEndpoint, flags.MaxBuilderEpochMissedSlots, flags.MaxBuilderConsecutiveMissedSlots, From 568273453bb99763ba750b3bc99daecb2a1c0727 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Thu, 30 May 2024 16:56:55 +0800 Subject: [PATCH 119/325] Update Libp2p Dependencies (#14060) * Update to v0.35.0 and v0.11.0 * Update Protobuf * Update bazel deps --- deps.bzl | 185 ++++++++++++++++++++++++++++--------------------------- go.mod | 68 ++++++++++++-------- go.sum | 179 +++++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 268 insertions(+), 164 deletions(-) diff --git a/deps.bzl b/deps.bzl index c1c81c0c288b..b46caadbedbe 100644 --- a/deps.bzl +++ b/deps.bzl @@ -705,8 +705,8 @@ def prysm_deps(): go_repository( name = "com_github_decred_dcrd_dcrec_secp256k1_v4", importpath = "github.com/decred/dcrd/dcrec/secp256k1/v4", - sum = "h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=", - version = "v4.2.0", + sum = "h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=", + version = "v4.3.0", ) go_repository( name = "com_github_deepmap_oapi_codegen", @@ -1295,8 +1295,8 @@ def prysm_deps(): importpath = "github.com/golang/protobuf", patch_args = ["-p1"], patches = ["@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch"], - sum = "h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=", - version = "v1.5.3", + sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=", + version = "v1.5.4", ) go_repository( name = "com_github_golang_snappy", @@ -1607,14 +1607,14 @@ def prysm_deps(): go_repository( name = "com_github_hashicorp_golang_lru_arc_v2", importpath = "github.com/hashicorp/golang-lru/arc/v2", - sum = "h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGNJAg1dcN2Fpfw=", - version = "v2.0.5", + sum = "h1:QxkVTxwColcduO+LP7eJO56r2hFiG8zEbfAAzRv52KQ=", + version = "v2.0.7", ) go_repository( name = "com_github_hashicorp_golang_lru_v2", importpath = "github.com/hashicorp/golang-lru/v2", - sum = "h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4=", - version = "v2.0.5", + sum = "h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=", + version = "v2.0.7", ) go_repository( name = "com_github_hashicorp_hcl", @@ -1975,8 +1975,8 @@ def prysm_deps(): go_repository( name = "com_github_klauspost_compress", importpath = "github.com/klauspost/compress", - sum = "h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=", - version = "v1.17.6", + sum = "h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=", + version = "v1.17.8", ) go_repository( name = "com_github_klauspost_cpuid", @@ -2105,8 +2105,8 @@ def prysm_deps(): ], build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p", - sum = "h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA=", - version = "v0.33.1", + sum = "h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc=", + version = "v0.35.0", ) go_repository( name = "com_github_libp2p_go_libp2p_asn_util", @@ -2124,8 +2124,8 @@ def prysm_deps(): name = "com_github_libp2p_go_libp2p_pubsub", build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p-pubsub", - sum = "h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg=", - version = "v0.10.1", + sum = "h1:+JvS8Kty0OiyUiN0i8H5JbaCgjnJTRnTHe4rU88dLFc=", + version = "v0.11.0", ) go_repository( name = "com_github_libp2p_go_libp2p_testing", @@ -2448,8 +2448,8 @@ def prysm_deps(): go_repository( name = "com_github_multiformats_go_multiaddr", importpath = "github.com/multiformats/go-multiaddr", - sum = "h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24=", - version = "v0.12.2", + sum = "h1:rrKqpY9h+n80EwhhC/kkcunCZZ7URIF8yN1WEUt2Hvc=", + version = "v0.12.4", ) go_repository( name = "com_github_multiformats_go_multiaddr_dns", @@ -2577,8 +2577,8 @@ def prysm_deps(): go_repository( name = "com_github_nxadm_tail", importpath = "github.com/nxadm/tail", - sum = "h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=", - version = "v1.4.8", + sum = "h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=", + version = "v1.4.11", ) go_repository( name = "com_github_nytimes_gziphandler", @@ -2787,26 +2787,26 @@ def prysm_deps(): go_repository( name = "com_github_pion_datachannel", importpath = "github.com/pion/datachannel", - sum = "h1:10ef4kwdjije+M9d7Xm9im2Y3O6A6ccQb0zcqZcJew8=", - version = "v1.5.5", + sum = "h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg=", + version = "v1.5.6", ) go_repository( name = "com_github_pion_dtls_v2", importpath = "github.com/pion/dtls/v2", - sum = "h1:BUroldfiIbV9jSnC6cKOMnyiORRWrWWpV11JUyEu5OA=", - version = "v2.2.8", + sum = "h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks=", + version = "v2.2.11", ) go_repository( name = "com_github_pion_ice_v2", importpath = "github.com/pion/ice/v2", - sum = "h1:rZjVmUwyT55cmN8ySMpL7rsS8KYsJERsrxJLLxpKhdw=", - version = "v2.3.11", + sum = "h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI=", + version = "v2.3.24", ) go_repository( name = "com_github_pion_interceptor", importpath = "github.com/pion/interceptor", - sum = "h1:pwY9r7P6ToQ3+IF0bajN0xmk/fNw/suTgaTdlwTDmhc=", - version = "v0.1.25", + sum = "h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M=", + version = "v0.1.29", ) go_repository( name = "com_github_pion_logging", @@ -2817,8 +2817,8 @@ def prysm_deps(): go_repository( name = "com_github_pion_mdns", importpath = "github.com/pion/mdns", - sum = "h1:7Ue5KZsqq8EuqStnpPWV33vYYEH0+skdDN5L7EiEsI4=", - version = "v0.0.9", + sum = "h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8=", + version = "v0.0.12", ) go_repository( name = "com_github_pion_randutil", @@ -2829,26 +2829,26 @@ def prysm_deps(): go_repository( name = "com_github_pion_rtcp", importpath = "github.com/pion/rtcp", - sum = "h1:+EQijuisKwm/8VBs8nWllr0bIndR7Lf7cZG200mpbNo=", - version = "v1.2.13", + sum = "h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE=", + version = "v1.2.14", ) go_repository( name = "com_github_pion_rtp", importpath = "github.com/pion/rtp", - sum = "h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8=", - version = "v1.8.3", + sum = "h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw=", + version = "v1.8.6", ) go_repository( name = "com_github_pion_sctp", importpath = "github.com/pion/sctp", - sum = "h1:TP5ZVxV5J7rz7uZmbyvnUvsn7EJ2x/5q9uhsTtXbI3g=", - version = "v1.8.9", + sum = "h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY=", + version = "v1.8.16", ) go_repository( name = "com_github_pion_sdp_v3", importpath = "github.com/pion/sdp/v3", - sum = "h1:WuDLhtuFUUVpTfus9ILC4HRyHsW6TdugjEX/QY9OiUw=", - version = "v3.0.6", + sum = "h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY=", + version = "v3.0.9", ) go_repository( name = "com_github_pion_srtp_v2", @@ -2865,20 +2865,26 @@ def prysm_deps(): go_repository( name = "com_github_pion_transport_v2", importpath = "github.com/pion/transport/v2", - sum = "h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo=", - version = "v2.2.4", + sum = "h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc=", + version = "v2.2.5", + ) + go_repository( + name = "com_github_pion_transport_v3", + importpath = "github.com/pion/transport/v3", + sum = "h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4=", + version = "v3.0.2", ) go_repository( name = "com_github_pion_turn_v2", importpath = "github.com/pion/turn/v2", - sum = "h1:2xn8rduI5W6sCZQkEnIUDAkrBQNl2eYIBCHMZ3QMmP8=", - version = "v2.1.4", + sum = "h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc=", + version = "v2.1.6", ) go_repository( name = "com_github_pion_webrtc_v3", importpath = "github.com/pion/webrtc/v3", - sum = "h1:GbqEuxBbVLFhXk0GwxKAoaIJYiEa9TyoZPEZC+2HZxM=", - version = "v3.2.23", + sum = "h1:Wtfi6AZMQg+624cvCXUuSmrKWepSB7zfgYDOYqsSOVU=", + version = "v3.2.40", ) go_repository( name = "com_github_pkg_diff", @@ -2925,20 +2931,20 @@ def prysm_deps(): go_repository( name = "com_github_prometheus_client_golang", importpath = "github.com/prometheus/client_golang", - sum = "h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=", - version = "v1.18.0", + sum = "h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=", + version = "v1.19.1", ) go_repository( name = "com_github_prometheus_client_model", importpath = "github.com/prometheus/client_model", - sum = "h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=", - version = "v0.6.0", + sum = "h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=", + version = "v0.6.1", ) go_repository( name = "com_github_prometheus_common", importpath = "github.com/prometheus/common", - sum = "h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k=", - version = "v0.47.0", + sum = "h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=", + version = "v0.48.0", ) go_repository( name = "com_github_prometheus_procfs", @@ -3015,15 +3021,6 @@ def prysm_deps(): sum = "h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=", version = "v0.4.0", ) - go_repository( - name = "com_github_quic_go_qtls_go1_20", - build_directives = [ - "gazelle:exclude generate_cert.go", - ], - importpath = "github.com/quic-go/qtls-go1-20", - sum = "h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=", - version = "v0.3.4", - ) go_repository( name = "com_github_quic_go_quic_go", build_directives = [ @@ -3031,14 +3028,14 @@ def prysm_deps(): "gazelle:exclude tools.go", ], importpath = "github.com/quic-go/quic-go", - sum = "h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM=", - version = "v0.42.0", + sum = "h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0=", + version = "v0.44.0", ) go_repository( name = "com_github_quic_go_webtransport_go", importpath = "github.com/quic-go/webtransport-go", - sum = "h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY=", - version = "v0.6.0", + sum = "h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg=", + version = "v0.8.0", ) go_repository( name = "com_github_raulk_go_watchdog", @@ -3128,6 +3125,12 @@ def prysm_deps(): sum = "h1:nMinx+JaEm/zJz4cEyClQeAw5rsYSB5th3xv+5lV6Vg=", version = "v3.3.4", ) + go_repository( + name = "com_github_sclevine_agouti", + importpath = "github.com/sclevine/agouti", + sum = "h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=", + version = "v3.0.0+incompatible", + ) go_repository( name = "com_github_sean_seed", importpath = "github.com/sean-/seed", @@ -3407,14 +3410,14 @@ def prysm_deps(): go_repository( name = "com_github_stretchr_objx", importpath = "github.com/stretchr/objx", - sum = "h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=", - version = "v0.5.0", + sum = "h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=", + version = "v0.5.2", ) go_repository( name = "com_github_stretchr_testify", importpath = "github.com/stretchr/testify", - sum = "h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=", - version = "v1.8.4", + sum = "h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=", + version = "v1.9.0", ) go_repository( name = "com_github_subosito_gotenv", @@ -4783,8 +4786,8 @@ def prysm_deps(): go_repository( name = "org_golang_google_protobuf", importpath = "google.golang.org/protobuf", - sum = "h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=", - version = "v1.32.0", + sum = "h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=", + version = "v1.34.1", ) go_repository( name = "org_golang_x_build", @@ -4795,14 +4798,14 @@ def prysm_deps(): go_repository( name = "org_golang_x_crypto", importpath = "golang.org/x/crypto", - sum = "h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=", - version = "v0.19.0", + sum = "h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=", + version = "v0.23.0", ) go_repository( name = "org_golang_x_exp", importpath = "golang.org/x/exp", - sum = "h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE=", - version = "v0.0.0-20240213143201-ec583247a57a", + sum = "h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=", + version = "v0.0.0-20240506185415-9bf2ced13842", ) go_repository( name = "org_golang_x_exp_typeparams", @@ -4831,14 +4834,14 @@ def prysm_deps(): go_repository( name = "org_golang_x_mod", importpath = "golang.org/x/mod", - sum = "h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=", - version = "v0.15.0", + sum = "h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=", + version = "v0.17.0", ) go_repository( name = "org_golang_x_net", importpath = "golang.org/x/net", - sum = "h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=", - version = "v0.21.0", + sum = "h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=", + version = "v0.25.0", ) go_repository( name = "org_golang_x_oauth2", @@ -4855,32 +4858,32 @@ def prysm_deps(): go_repository( name = "org_golang_x_sync", importpath = "golang.org/x/sync", - sum = "h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=", - version = "v0.6.0", + sum = "h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=", + version = "v0.7.0", ) go_repository( name = "org_golang_x_sys", importpath = "golang.org/x/sys", - sum = "h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=", - version = "v0.17.0", + sum = "h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=", + version = "v0.20.0", ) go_repository( name = "org_golang_x_telemetry", importpath = "golang.org/x/telemetry", - sum = "h1:+Kc94D8UVEVxJnLXp/+FMfqQARZtWHfVrcRtcG8aT3g=", - version = "v0.0.0-20240208230135-b75ee8823808", + sum = "h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY=", + version = "v0.0.0-20240228155512-f48c80bd79b2", ) go_repository( name = "org_golang_x_term", importpath = "golang.org/x/term", - sum = "h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=", - version = "v0.17.0", + sum = "h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=", + version = "v0.20.0", ) go_repository( name = "org_golang_x_text", importpath = "golang.org/x/text", - sum = "h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=", - version = "v0.14.0", + sum = "h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=", + version = "v0.15.0", ) go_repository( name = "org_golang_x_time", @@ -4891,8 +4894,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", - sum = "h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=", - version = "v0.18.0", + sum = "h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=", + version = "v0.21.0", ) go_repository( name = "org_golang_x_xerrors", @@ -4903,8 +4906,8 @@ def prysm_deps(): go_repository( name = "org_uber_go_atomic", importpath = "go.uber.org/atomic", - sum = "h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=", - version = "v1.11.0", + sum = "h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=", + version = "v1.7.0", ) go_repository( name = "org_uber_go_automaxprocs", @@ -4926,8 +4929,8 @@ def prysm_deps(): go_repository( name = "org_uber_go_fx", importpath = "go.uber.org/fx", - sum = "h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk=", - version = "v1.20.1", + sum = "h1:RqBh3cYdzZS0uqwVeEjOX2p73dddLpym315myy/Bpb0=", + version = "v1.21.1", ) go_repository( name = "org_uber_go_goleak", diff --git a/go.mod b/go.mod index 4db79dc5448f..8adbe8af741e 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 @@ -45,9 +45,9 @@ require ( github.com/json-iterator/go v1.1.12 github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 github.com/kr/pretty v0.3.1 - github.com/libp2p/go-libp2p v0.33.1 + github.com/libp2p/go-libp2p v0.35.0 github.com/libp2p/go-libp2p-mplex v0.9.0 - github.com/libp2p/go-libp2p-pubsub v0.10.1 + github.com/libp2p/go-libp2p-pubsub v0.11.0 github.com/libp2p/go-mplex v0.7.0 github.com/logrusorgru/aurora v2.0.3+incompatible github.com/manifoldco/promptui v0.7.0 @@ -55,15 +55,15 @@ require ( github.com/minio/highwayhash v1.0.2 github.com/minio/sha256-simd v1.0.1 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/multiformats/go-multiaddr v0.12.2 + github.com/multiformats/go-multiaddr v0.12.4 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.30.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/paulbellamy/ratecounter v0.2.0 github.com/pborman/uuid v1.2.1 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.18.0 - github.com/prometheus/client_model v0.6.0 + github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/client_model v0.6.1 github.com/prometheus/prom2json v1.3.0 github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 @@ -74,7 +74,7 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/afero v1.10.0 github.com/status-im/keycard-go v0.2.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/supranational/blst v0.3.11 github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279 @@ -88,14 +88,14 @@ require ( go.opencensus.io v0.24.0 go.uber.org/automaxprocs v1.5.2 go.uber.org/mock v0.4.0 - golang.org/x/crypto v0.21.0 - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a - golang.org/x/mod v0.15.0 - golang.org/x/sync v0.6.0 - golang.org/x/tools v0.18.0 + golang.org/x/crypto v0.23.0 + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 + golang.org/x/mod v0.17.0 + golang.org/x/sync v0.7.0 + golang.org/x/tools v0.21.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 google.golang.org/grpc v1.56.3 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.34.1 gopkg.in/d4l3k/messagediff.v1 v1.2.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -128,7 +128,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/deckarep/golang-set/v2 v2.5.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/deepmap/oapi-codegen v1.8.2 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/docker/go-units v0.5.0 // indirect @@ -152,7 +152,7 @@ require ( github.com/gorilla/websocket v1.5.1 // indirect github.com/graph-gophers/graphql-go v1.3.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/goevmlab v0.0.0-20231201084119-c73b3c97929c // indirect @@ -165,7 +165,7 @@ require ( github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/koron/go-ssdp v0.0.4 // indirect github.com/kr/text v0.2.0 // indirect @@ -203,25 +203,41 @@ require ( github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-varint v0.0.7 // indirect - github.com/nxadm/tail v1.4.8 // indirect + github.com/nxadm/tail v1.4.11 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onsi/ginkgo/v2 v2.15.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect + github.com/pion/datachannel v1.5.6 // indirect + github.com/pion/dtls/v2 v2.2.11 // indirect + github.com/pion/ice/v2 v2.3.24 // indirect + github.com/pion/interceptor v0.1.29 // indirect + github.com/pion/logging v0.2.2 // indirect + github.com/pion/mdns v0.0.12 // indirect + github.com/pion/randutil v0.1.0 // indirect + github.com/pion/rtcp v1.2.14 // indirect + github.com/pion/rtp v1.8.6 // indirect + github.com/pion/sctp v1.8.16 // indirect + github.com/pion/sdp/v3 v3.0.9 // indirect + github.com/pion/srtp/v2 v2.0.18 // indirect + github.com/pion/stun v0.6.1 // indirect + github.com/pion/transport/v2 v2.2.5 // indirect + github.com/pion/turn/v2 v2.1.6 // indirect + github.com/pion/webrtc/v3 v3.2.40 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/common v0.47.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.42.0 // indirect - github.com/quic-go/webtransport-go v0.6.0 // indirect + github.com/quic-go/quic-go v0.44.0 // indirect + github.com/quic-go/webtransport-go v0.8.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect @@ -230,14 +246,14 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect go.uber.org/dig v1.17.1 // indirect - go.uber.org/fx v1.20.1 // indirect + go.uber.org/fx v1.21.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect @@ -257,7 +273,7 @@ require ( github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect github.com/prysmaticlabs/gohashtree v0.0.4-beta - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.20.0 // indirect google.golang.org/api v0.44.0 // indirect google.golang.org/appengine v1.6.7 // indirect k8s.io/klog/v2 v2.80.0 // indirect diff --git a/go.sum b/go.sum index 2c529832367a..5f206e79d1ce 100644 --- a/go.sum +++ b/go.sum @@ -215,8 +215,8 @@ github.com/deckarep/golang-set/v2 v2.5.0 h1:hn6cEZtQ0h3J8kFrHR/NrzyOoTnjgW1+FmNJ github.com/deckarep/golang-set/v2 v2.5.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= @@ -405,8 +405,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -462,6 +462,7 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= @@ -521,8 +522,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4= -github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -597,8 +598,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -635,14 +636,14 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= -github.com/libp2p/go-libp2p v0.33.1 h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA= -github.com/libp2p/go-libp2p v0.33.1/go.mod h1:zOUTMjG4I7TXwMndNyOBn/CNtVBLlvBlnxfi+8xzx+E= +github.com/libp2p/go-libp2p v0.35.0 h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc= +github.com/libp2p/go-libp2p v0.35.0/go.mod h1:snyJQix4ET6Tj+LeI0VPjjxTtdWpeOhYt5lEY0KirkQ= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= github.com/libp2p/go-libp2p-mplex v0.9.0/go.mod h1:ro1i4kuwiFT+uMPbIDIFkcLs1KRbNp0QwnUXM+P64Og= -github.com/libp2p/go-libp2p-pubsub v0.10.1 h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg= -github.com/libp2p/go-libp2p-pubsub v0.10.1/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= +github.com/libp2p/go-libp2p-pubsub v0.11.0 h1:+JvS8Kty0OiyUiN0i8H5JbaCgjnJTRnTHe4rU88dLFc= +github.com/libp2p/go-libp2p-pubsub v0.11.0/go.mod h1:QEb+hEV9WL9wCiUAnpY29FZR6W3zK8qYlaml8R4q6gQ= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= @@ -758,8 +759,8 @@ github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9 github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24= -github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M= +github.com/multiformats/go-multiaddr v0.12.4 h1:rrKqpY9h+n80EwhhC/kkcunCZZ7URIF8yN1WEUt2Hvc= +github.com/multiformats/go-multiaddr v0.12.4/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= @@ -791,8 +792,9 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -861,6 +863,50 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pion/datachannel v1.5.6 h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg= +github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNIVb/NfGW4= +github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= +github.com/pion/dtls/v2 v2.2.11 h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks= +github.com/pion/dtls/v2 v2.2.11/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= +github.com/pion/ice/v2 v2.3.24 h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI= +github.com/pion/ice/v2 v2.3.24/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= +github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M= +github.com/pion/interceptor v0.1.29/go.mod h1:ri+LGNjRUc5xUNtDEPzfdkmSqISixVTBF/z/Zms/6T4= +github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= +github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= +github.com/pion/mdns v0.0.12 h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8= +github.com/pion/mdns v0.0.12/go.mod h1:VExJjv8to/6Wqm1FXK+Ii/Z9tsVk/F5sD/N70cnYFbk= +github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= +github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= +github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= +github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE= +github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= +github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= +github.com/pion/rtp v1.8.6 h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw= +github.com/pion/rtp v1.8.6/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= +github.com/pion/sctp v1.8.13/go.mod h1:YKSgO/bO/6aOMP9LCie1DuD7m+GamiK2yIiPM6vH+GA= +github.com/pion/sctp v1.8.16 h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY= +github.com/pion/sctp v1.8.16/go.mod h1:P6PbDVA++OJMrVNg2AL3XtYHV4uD6dvfyOovCgMs0PE= +github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY= +github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M= +github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo= +github.com/pion/srtp/v2 v2.0.18/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA= +github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= +github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= +github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= +github.com/pion/transport/v2 v2.2.2/go.mod h1:OJg3ojoBJopjEeECq2yJdXH9YVrUJ1uQ++NjXLOUorc= +github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= +github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= +github.com/pion/transport/v2 v2.2.5 h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc= +github.com/pion/transport/v2 v2.2.5/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= +github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= +github.com/pion/transport/v3 v3.0.2 h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4= +github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37m0IlWa/D0= +github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= +github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= +github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= +github.com/pion/webrtc/v3 v3.2.40 h1:Wtfi6AZMQg+624cvCXUuSmrKWepSB7zfgYDOYqsSOVU= +github.com/pion/webrtc/v3 v3.2.40/go.mod h1:M1RAe3TNTD1tzyvqHrbVODfwdPGSXOUo/OgpoGGJqFY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -885,16 +931,16 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -904,8 +950,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -935,10 +981,10 @@ github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= -github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= -github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY= -github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc= +github.com/quic-go/quic-go v0.44.0 h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0= +github.com/quic-go/quic-go v0.44.0/go.mod h1:z4cx/9Ny9UtGITIPzmPTXh1ULfOyWh4qGQlpnPcWmek= +github.com/quic-go/webtransport-go v0.8.0 h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg= +github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YVSlwHohQsuac9WaM= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1034,8 +1080,9 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1046,8 +1093,10 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= @@ -1135,14 +1184,12 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= -go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk= -go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg= +go.uber.org/fx v1.21.1 h1:RqBh3cYdzZS0uqwVeEjOX2p73dddLpym315myy/Bpb0= +go.uber.org/fx v1.21.1/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= @@ -1185,8 +1232,14 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1198,8 +1251,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -1228,8 +1281,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1282,8 +1336,16 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1316,8 +1378,9 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1409,14 +1472,30 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1427,8 +1506,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1506,8 +1590,9 @@ golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0t golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1649,8 +1734,8 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7 google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8/go.mod h1:hFxJC2f0epmp1elRCiEGJTKAWbwxZ2nvqZdHl3FQXCY= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 836d369c6c91a9be1b1cfedf3ec17abdc850e01b Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 31 May 2024 09:46:38 -0500 Subject: [PATCH 120/325] api fix for panic on unsynced unfound block (#14063) * api fix for panic * adding test * fixing how we handle the error --- beacon-chain/rpc/eth/beacon/handlers.go | 10 +++++++--- beacon-chain/rpc/eth/beacon/handlers_test.go | 18 ++++++++++++++++++ beacon-chain/rpc/eth/rewards/handlers.go | 7 +++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 4fc48d4eac68..914541ae0789 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -60,8 +60,7 @@ func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) { return } blk, err := s.Blocker.Block(ctx, []byte(blockId)) - if err != nil { - shared.WriteBlockFetchError(w, blk, err) + if !shared.WriteBlockFetchError(w, blk, err) { return } @@ -69,7 +68,7 @@ func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) { if blk.Version() >= version.Bellatrix && blk.IsBlinded() { blk, err = s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk) if err != nil { - shared.WriteBlockFetchError(w, blk, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block")) + httputil.HandleError(w, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block").Error(), http.StatusBadRequest) return } } @@ -892,6 +891,11 @@ func (s *Server) validateConsensus(ctx context.Context, blk interfaces.ReadOnlyS if err != nil { return errors.Wrap(err, "could not get parent block") } + + if err := blocks.BeaconBlockIsNil(blk); err != nil { + return errors.Wrap(err, "could not validate block") + } + parentStateRoot := parentBlock.Block().StateRoot() parentState, err := s.Stater.State(ctx, parentStateRoot[:]) if err != nil { diff --git a/beacon-chain/rpc/eth/beacon/handlers_test.go b/beacon-chain/rpc/eth/beacon/handlers_test.go index f984fce36bcd..592122c9ec1c 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_test.go @@ -86,6 +86,24 @@ func fillDBTestBlocks(ctx context.Context, t *testing.T, beaconDB db.Database) ( } func TestGetBlockV2(t *testing.T) { + t.Run("Unsycned Block", func(t *testing.T) { + mockBlockFetcher := &testutil.MockBlocker{BlockToReturn: nil} + mockChainService := &chainMock.ChainService{ + FinalizedRoots: map[[32]byte]bool{}, + } + s := &Server{ + FinalizationFetcher: mockChainService, + Blocker: mockBlockFetcher, + } + + request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) + request = mux.SetURLVars(request, map[string]string{"block_id": "123552314"}) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetBlockV2(writer, request) + require.Equal(t, http.StatusNotFound, writer.Code) + }) t.Run("phase0", func(t *testing.T) { b := util.NewBeaconBlock() b.Block.Slot = 123 diff --git a/beacon-chain/rpc/eth/rewards/handlers.go b/beacon-chain/rpc/eth/rewards/handlers.go index 29f32b3484fb..762a119bdac4 100644 --- a/beacon-chain/rpc/eth/rewards/handlers.go +++ b/beacon-chain/rpc/eth/rewards/handlers.go @@ -14,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -33,6 +34,12 @@ func (s *Server) BlockRewards(w http.ResponseWriter, r *http.Request) { if !shared.WriteBlockFetchError(w, blk, err) { return } + + if err := blocks.BeaconBlockIsNil(blk); err != nil { + httputil.HandleError(w, fmt.Sprintf("block id %s was not found", blockId), http.StatusNotFound) + return + } + if blk.Version() == version.Phase0 { httputil.HandleError(w, "Block rewards are not supported for Phase 0 blocks", http.StatusBadRequest) return From 3ab759e163a6a7f531da7d074b98d5ac24557fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Sat, 1 Jun 2024 00:53:58 +0900 Subject: [PATCH 121/325] One more validator client cleanup (#14048) * interface names * interface method names * inspection * regenerate pb and mock * Revert beacon node changes * build fix * review * more functions * combine parameters --- cmd/validator/accounts/exit_test.go | 8 +- testing/validator-mock/chain_client_mock.go | 36 +-- testing/validator-mock/node_client_mock.go | 74 +++--- .../validator-mock/prysm_chain_client_mock.go | 6 +- .../validator-mock/validator_client_mock.go | 210 +++++++++--------- validator/accounts/accounts_exit.go | 4 +- validator/accounts/testing/mock.go | 4 +- validator/client/aggregate.go | 2 +- validator/client/attest.go | 8 +- validator/client/attest_test.go | 26 +-- validator/client/beacon-api/activation.go | 8 +- .../client/beacon-api/attestation_data.go | 2 +- .../beacon-api/attestation_data_test.go | 8 +- .../beacon_api_beacon_chain_client.go | 36 +-- .../beacon_api_beacon_chain_client_test.go | 40 ++-- .../client/beacon-api/beacon_api_helpers.go | 12 +- .../beacon-api/beacon_api_helpers_test.go | 18 +- .../beacon-api/beacon_api_node_client.go | 14 +- .../beacon-api/beacon_api_node_client_test.go | 8 +- .../beacon-api/beacon_api_validator_client.go | 48 ++-- .../beacon_api_validator_client_test.go | 16 +- .../beacon-api/beacon_block_converter_test.go | 104 ++++----- .../beacon-api/beacon_committee_selections.go | 2 +- .../beacon_committee_selections_test.go | 18 +- validator/client/beacon-api/domain_data.go | 4 +- .../client/beacon-api/domain_data_test.go | 18 +- validator/client/beacon-api/doppelganger.go | 14 +- .../client/beacon-api/doppelganger_test.go | 10 +- validator/client/beacon-api/duties.go | 38 ++-- validator/client/beacon-api/duties_test.go | 94 ++++---- validator/client/beacon-api/genesis.go | 10 +- validator/client/beacon-api/genesis_test.go | 12 +- .../client/beacon-api/get_beacon_block.go | 6 +- .../beacon-api/get_beacon_block_test.go | 66 +++--- validator/client/beacon-api/index.go | 4 +- .../client/beacon-api/mock/duties_mock.go | 48 ++-- .../client/beacon-api/mock/genesis_mock.go | 12 +- .../beacon-api/mock/state_validators_mock.go | 36 +-- .../client/beacon-api/propose_attestation.go | 2 +- .../beacon-api/propose_attestation_test.go | 28 +-- .../client/beacon-api/propose_beacon_block.go | 2 +- .../propose_beacon_block_altair_test.go | 6 +- .../propose_beacon_block_bellatrix_test.go | 6 +- ...ose_beacon_block_blinded_bellatrix_test.go | 144 ++++++------ ...opose_beacon_block_blinded_capella_test.go | 158 ++++++------- .../propose_beacon_block_capella_test.go | 6 +- .../propose_beacon_block_phase0_test.go | 6 +- validator/client/beacon-api/propose_exit.go | 2 +- .../beacon-api/prysm_beacon_chain_client.go | 4 +- .../client/beacon-api/state_validators.go | 15 +- .../beacon-api/state_validators_test.go | 10 +- validator/client/beacon-api/status.go | 10 +- validator/client/beacon-api/status_test.go | 20 +- validator/client/beacon-api/stream_blocks.go | 10 +- .../client/beacon-api/stream_blocks_test.go | 34 +-- .../submit_aggregate_selection_proof.go | 6 +- .../submit_aggregate_selection_proof_test.go | 6 +- .../submit_signed_aggregate_proof_test.go | 16 +- .../submit_signed_contribution_and_proof.go | 2 +- .../beacon-api/subscribe_committee_subnets.go | 2 +- validator/client/beacon-api/sync_committee.go | 14 +- .../beacon-api/sync_committee_selections.go | 2 +- .../sync_committee_selections_test.go | 18 +- .../client/beacon-api/sync_committee_test.go | 10 +- .../client/beacon-api/validator_count_test.go | 2 +- .../beacon_chain_client_factory.go | 2 +- .../grpc-api/grpc_beacon_chain_client.go | 12 +- validator/client/grpc-api/grpc_node_client.go | 8 +- .../grpc_prysm_beacon_chain_client.go | 6 +- .../grpc_prysm_beacon_chain_client_test.go | 6 +- .../client/grpc-api/grpc_validator_client.go | 18 +- validator/client/iface/BUILD.bazel | 4 +- validator/client/iface/beacon_chain_client.go | 17 -- validator/client/iface/chain_client.go | 17 ++ validator/client/iface/node_client.go | 8 +- ..._chain_client.go => prysm_chain_client.go} | 2 +- validator/client/iface/validator.go | 2 +- validator/client/iface/validator_client.go | 22 +- validator/client/key_reload.go | 2 +- validator/client/metrics.go | 28 +-- .../node_client_factory.go | 2 +- validator/client/propose.go | 10 +- validator/client/propose_test.go | 40 ++-- validator/client/runner_test.go | 4 +- validator/client/service.go | 14 +- validator/client/sync_committee.go | 8 +- validator/client/sync_committee_test.go | 28 +-- validator/client/testutil/mock_validator.go | 6 +- validator/client/validator.go | 74 +++--- validator/client/validator_test.go | 116 +++++----- validator/client/wait_for_activation.go | 4 +- validator/rpc/handlers_accounts_test.go | 2 +- validator/rpc/handlers_beacon.go | 28 +-- validator/rpc/handlers_beacon_test.go | 6 +- validator/rpc/handlers_health.go | 4 +- validator/rpc/handlers_health_test.go | 2 +- validator/rpc/handlers_keymanager.go | 6 +- validator/rpc/handlers_keymanager_test.go | 6 +- 98 files changed, 1059 insertions(+), 1080 deletions(-) delete mode 100644 validator/client/iface/beacon_chain_client.go create mode 100644 validator/client/iface/chain_client.go rename validator/client/iface/{prysm_beacon_chain_client.go => prysm_chain_client.go} (81%) diff --git a/cmd/validator/accounts/exit_test.go b/cmd/validator/accounts/exit_test.go index 0b17b7acacd4..d2d94f69e43d 100644 --- a/cmd/validator/accounts/exit_test.go +++ b/cmd/validator/accounts/exit_test.go @@ -37,7 +37,7 @@ func TestExitAccountsCli_OK(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). @@ -133,7 +133,7 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). @@ -235,7 +235,7 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). @@ -324,7 +324,7 @@ func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). diff --git a/testing/validator-mock/chain_client_mock.go b/testing/validator-mock/chain_client_mock.go index 0b10bcf7d810..d12ab76e98cf 100644 --- a/testing/validator-mock/chain_client_mock.go +++ b/testing/validator-mock/chain_client_mock.go @@ -42,9 +42,9 @@ func (m *MockChainClient) EXPECT() *MockChainClientMockRecorder { } // GetChainHead mocks base method. -func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { +func (m *MockChainClient) ChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetChainHead", arg0, arg1) + ret := m.ctrl.Call(m, "ChainHead", arg0, arg1) ret0, _ := ret[0].(*eth.ChainHead) ret1, _ := ret[1].(error) return ret0, ret1 @@ -53,13 +53,13 @@ func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty // GetChainHead indicates an expected call of GetChainHead. func (mr *MockChainClientMockRecorder) GetChainHead(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockChainClient)(nil).GetChainHead), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockChainClient)(nil).ChainHead), arg0, arg1) } // GetValidatorParticipation mocks base method. -func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { +func (m *MockChainClient) ValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorParticipation", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorParticipation", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorParticipationResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -68,13 +68,13 @@ func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 * // GetValidatorParticipation indicates an expected call of GetValidatorParticipation. func (mr *MockChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).GetValidatorParticipation), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).ValidatorParticipation), arg0, arg1) } // GetValidatorPerformance mocks base method. -func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { +func (m *MockChainClient) ValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorPerformance", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorPerformance", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -83,13 +83,13 @@ func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *et // GetValidatorPerformance indicates an expected call of GetValidatorPerformance. func (mr *MockChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).GetValidatorPerformance), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).ValidatorPerformance), arg0, arg1) } // GetValidatorQueue mocks base method. -func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { +func (m *MockChainClient) ValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorQueue", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorQueue", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorQueue) ret1, _ := ret[1].(error) return ret0, ret1 @@ -98,13 +98,13 @@ func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb. // GetValidatorQueue indicates an expected call of GetValidatorQueue. func (mr *MockChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).GetValidatorQueue), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).ValidatorQueue), arg0, arg1) } // ListValidatorBalances mocks base method. -func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { +func (m *MockChainClient) ValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListValidatorBalances", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorBalances", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorBalances) ret1, _ := ret[1].(error) return ret0, ret1 @@ -113,13 +113,13 @@ func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth. // ListValidatorBalances indicates an expected call of ListValidatorBalances. func (mr *MockChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ListValidatorBalances), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ValidatorBalances), arg0, arg1) } // ListValidators mocks base method. -func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { +func (m *MockChainClient) Validators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListValidators", arg0, arg1) + ret := m.ctrl.Call(m, "Validators", arg0, arg1) ret0, _ := ret[0].(*eth.Validators) ret1, _ := ret[1].(error) return ret0, ret1 @@ -128,5 +128,5 @@ func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListVal // ListValidators indicates an expected call of ListValidators. func (mr *MockChainClientMockRecorder) ListValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockChainClient)(nil).ListValidators), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockChainClient)(nil).Validators), arg0, arg1) } diff --git a/testing/validator-mock/node_client_mock.go b/testing/validator-mock/node_client_mock.go index fa8eb1b3d9fb..a7826860e9e0 100644 --- a/testing/validator-mock/node_client_mock.go +++ b/testing/validator-mock/node_client_mock.go @@ -42,76 +42,76 @@ func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder { return m.recorder } -// GetGenesis mocks base method. -func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) { +// Genesis mocks base method. +func (m *MockNodeClient) Genesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGenesis", arg0, arg1) + ret := m.ctrl.Call(m, "Genesis", arg0, arg1) ret0, _ := ret[0].(*eth.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetGenesis indicates an expected call of GetGenesis. -func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any) *gomock.Call { +// Genesis indicates an expected call of Genesis. +func (mr *MockNodeClientMockRecorder) Genesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockNodeClient)(nil).Genesis), arg0, arg1) } -// GetSyncStatus mocks base method. -func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) { +// HealthTracker mocks base method. +func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncStatus", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncStatus) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "HealthTracker") + ret0, _ := ret[0].(*beacon.NodeHealthTracker) + return ret0 } -// GetSyncStatus indicates an expected call of GetSyncStatus. -func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 any) *gomock.Call { +// HealthTracker indicates an expected call of HealthTracker. +func (mr *MockNodeClientMockRecorder) HealthTracker() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthTracker", reflect.TypeOf((*MockNodeClient)(nil).HealthTracker)) } -// GetVersion mocks base method. -func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) { +// Peers mocks base method. +func (m *MockNodeClient) Peers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetVersion", arg0, arg1) - ret0, _ := ret[0].(*eth.Version) + ret := m.ctrl.Call(m, "Peers", arg0, arg1) + ret0, _ := ret[0].(*eth.Peers) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetVersion indicates an expected call of GetVersion. -func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any) *gomock.Call { +// Peers indicates an expected call of Peers. +func (mr *MockNodeClientMockRecorder) Peers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).Peers), arg0, arg1) } -// HealthTracker mocks base method. -func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { +// SyncStatus mocks base method. +func (m *MockNodeClient) SyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HealthTracker") - ret0, _ := ret[0].(*beacon.NodeHealthTracker) - return ret0 + ret := m.ctrl.Call(m, "SyncStatus", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// HealthTracker indicates an expected call of HealthTracker. -func (mr *MockNodeClientMockRecorder) HealthTracker() *gomock.Call { +// SyncStatus indicates an expected call of SyncStatus. +func (mr *MockNodeClientMockRecorder) SyncStatus(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthTracker", reflect.TypeOf((*MockNodeClient)(nil).HealthTracker)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).SyncStatus), arg0, arg1) } -// ListPeers mocks base method. -func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) { +// Version mocks base method. +func (m *MockNodeClient) Version(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListPeers", arg0, arg1) - ret0, _ := ret[0].(*eth.Peers) + ret := m.ctrl.Call(m, "Version", arg0, arg1) + ret0, _ := ret[0].(*eth.Version) ret1, _ := ret[1].(error) return ret0, ret1 } -// ListPeers indicates an expected call of ListPeers. -func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any) *gomock.Call { +// Version indicates an expected call of Version. +func (mr *MockNodeClientMockRecorder) Version(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).Version), arg0, arg1) } diff --git a/testing/validator-mock/prysm_chain_client_mock.go b/testing/validator-mock/prysm_chain_client_mock.go index 330af4c503ee..135c9540100f 100644 --- a/testing/validator-mock/prysm_chain_client_mock.go +++ b/testing/validator-mock/prysm_chain_client_mock.go @@ -37,9 +37,9 @@ func (m *MockPrysmChainClient) EXPECT() *MockPrysmChainClientMockRecorder { } // GetValidatorCount mocks base method. -func (m *MockPrysmChainClient) GetValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { +func (m *MockPrysmChainClient) ValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorCount", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ValidatorCount", arg0, arg1, arg2) ret0, _ := ret[0].([]iface.ValidatorCount) ret1, _ := ret[1].(error) return ret0, ret1 @@ -48,5 +48,5 @@ func (m *MockPrysmChainClient) GetValidatorCount(arg0 context.Context, arg1 stri // GetValidatorCount indicates an expected call of GetValidatorCount. func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).GetValidatorCount), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).ValidatorCount), arg0, arg1, arg2) } diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index bcb815d331d6..bd6768bfa2e7 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -44,183 +44,138 @@ func (m *MockValidatorClient) EXPECT() *MockValidatorClientMockRecorder { return m.recorder } -// CheckDoppelGanger mocks base method. -func (m *MockValidatorClient) CheckDoppelGanger(arg0 context.Context, arg1 *eth.DoppelGangerRequest) (*eth.DoppelGangerResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CheckDoppelGanger", arg0, arg1) - ret0, _ := ret[0].(*eth.DoppelGangerResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CheckDoppelGanger indicates an expected call of CheckDoppelGanger. -func (mr *MockValidatorClientMockRecorder) CheckDoppelGanger(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckDoppelGanger", reflect.TypeOf((*MockValidatorClient)(nil).CheckDoppelGanger), arg0, arg1) -} - -// DomainData mocks base method. -func (m *MockValidatorClient) DomainData(arg0 context.Context, arg1 *eth.DomainRequest) (*eth.DomainResponse, error) { +// AggregatedSelections mocks base method. +func (m *MockValidatorClient) AggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DomainData", arg0, arg1) - ret0, _ := ret[0].(*eth.DomainResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DomainData indicates an expected call of DomainData. -func (mr *MockValidatorClientMockRecorder) DomainData(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DomainData", reflect.TypeOf((*MockValidatorClient)(nil).DomainData), arg0, arg1) -} - -// EventStreamIsRunning mocks base method. -func (m *MockValidatorClient) EventStreamIsRunning() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EventStreamIsRunning") - ret0, _ := ret[0].(bool) - return ret0 -} - -// EventStreamIsRunning indicates an expected call of EventStreamIsRunning. -func (mr *MockValidatorClientMockRecorder) EventStreamIsRunning() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventStreamIsRunning", reflect.TypeOf((*MockValidatorClient)(nil).EventStreamIsRunning)) -} - -// GetAggregatedSelections mocks base method. -func (m *MockValidatorClient) GetAggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAggregatedSelections", arg0, arg1) + ret := m.ctrl.Call(m, "AggregatedSelections", arg0, arg1) ret0, _ := ret[0].([]iface.BeaconCommitteeSelection) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetAggregatedSelections indicates an expected call of GetAggregatedSelections. -func (mr *MockValidatorClientMockRecorder) GetAggregatedSelections(arg0, arg1 any) *gomock.Call { +// AggregatedSelections indicates an expected call of AggregatedSelections. +func (mr *MockValidatorClientMockRecorder) AggregatedSelections(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).GetAggregatedSelections), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSelections), arg0, arg1) } -// GetAggregatedSyncSelections mocks base method. -func (m *MockValidatorClient) GetAggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +// AggregatedSyncSelections mocks base method. +func (m *MockValidatorClient) AggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAggregatedSyncSelections", arg0, arg1) + ret := m.ctrl.Call(m, "AggregatedSyncSelections", arg0, arg1) ret0, _ := ret[0].([]iface.SyncCommitteeSelection) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetAggregatedSyncSelections indicates an expected call of GetAggregatedSyncSelections. -func (mr *MockValidatorClientMockRecorder) GetAggregatedSyncSelections(arg0, arg1 any) *gomock.Call { +// AggregatedSyncSelections indicates an expected call of AggregatedSyncSelections. +func (mr *MockValidatorClientMockRecorder) AggregatedSyncSelections(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).GetAggregatedSyncSelections), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSyncSelections), arg0, arg1) } -// GetAttestationData mocks base method. -func (m *MockValidatorClient) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { +// AttestationData mocks base method. +func (m *MockValidatorClient) AttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAttestationData", arg0, arg1) + ret := m.ctrl.Call(m, "AttestationData", arg0, arg1) ret0, _ := ret[0].(*eth.AttestationData) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetAttestationData indicates an expected call of GetAttestationData. -func (mr *MockValidatorClientMockRecorder) GetAttestationData(arg0, arg1 any) *gomock.Call { +// AttestationData indicates an expected call of AttestationData. +func (mr *MockValidatorClientMockRecorder) AttestationData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockValidatorClient)(nil).GetAttestationData), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockValidatorClient)(nil).AttestationData), arg0, arg1) } -// GetBeaconBlock mocks base method. -func (m *MockValidatorClient) GetBeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { +// BeaconBlock mocks base method. +func (m *MockValidatorClient) BeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBeaconBlock", arg0, arg1) + ret := m.ctrl.Call(m, "BeaconBlock", arg0, arg1) ret0, _ := ret[0].(*eth.GenericBeaconBlock) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetBeaconBlock indicates an expected call of GetBeaconBlock. -func (mr *MockValidatorClientMockRecorder) GetBeaconBlock(arg0, arg1 any) *gomock.Call { +// BeaconBlock indicates an expected call of BeaconBlock. +func (mr *MockValidatorClientMockRecorder) BeaconBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).GetBeaconBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).BeaconBlock), arg0, arg1) } -// GetDuties mocks base method. -func (m *MockValidatorClient) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { +// CheckDoppelGanger mocks base method. +func (m *MockValidatorClient) CheckDoppelGanger(arg0 context.Context, arg1 *eth.DoppelGangerRequest) (*eth.DoppelGangerResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDuties", arg0, arg1) - ret0, _ := ret[0].(*eth.DutiesResponse) + ret := m.ctrl.Call(m, "CheckDoppelGanger", arg0, arg1) + ret0, _ := ret[0].(*eth.DoppelGangerResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetDuties indicates an expected call of GetDuties. -func (mr *MockValidatorClientMockRecorder) GetDuties(arg0, arg1 any) *gomock.Call { +// CheckDoppelGanger indicates an expected call of CheckDoppelGanger. +func (mr *MockValidatorClientMockRecorder) CheckDoppelGanger(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockValidatorClient)(nil).GetDuties), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckDoppelGanger", reflect.TypeOf((*MockValidatorClient)(nil).CheckDoppelGanger), arg0, arg1) } -// GetFeeRecipientByPubKey mocks base method. -func (m *MockValidatorClient) GetFeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { +// DomainData mocks base method. +func (m *MockValidatorClient) DomainData(arg0 context.Context, arg1 *eth.DomainRequest) (*eth.DomainResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", arg0, arg1) - ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) + ret := m.ctrl.Call(m, "DomainData", arg0, arg1) + ret0, _ := ret[0].(*eth.DomainResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetFeeRecipientByPubKey indicates an expected call of GetFeeRecipientByPubKey. -func (mr *MockValidatorClientMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { +// DomainData indicates an expected call of DomainData. +func (mr *MockValidatorClientMockRecorder) DomainData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).GetFeeRecipientByPubKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DomainData", reflect.TypeOf((*MockValidatorClient)(nil).DomainData), arg0, arg1) } -// GetSyncCommitteeContribution mocks base method. -func (m *MockValidatorClient) GetSyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { +// Duties mocks base method. +func (m *MockValidatorClient) Duties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncCommitteeContribution) + ret := m.ctrl.Call(m, "Duties", arg0, arg1) + ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution. -func (mr *MockValidatorClientMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any) *gomock.Call { +// Duties indicates an expected call of Duties. +func (mr *MockValidatorClientMockRecorder) Duties(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncCommitteeContribution), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockValidatorClient)(nil).Duties), arg0, arg1) } -// GetSyncMessageBlockRoot mocks base method. -func (m *MockValidatorClient) GetSyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { +// EventStreamIsRunning mocks base method. +func (m *MockValidatorClient) EventStreamIsRunning() bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "EventStreamIsRunning") + ret0, _ := ret[0].(bool) + return ret0 } -// GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot. -func (mr *MockValidatorClientMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { +// EventStreamIsRunning indicates an expected call of EventStreamIsRunning. +func (mr *MockValidatorClientMockRecorder) EventStreamIsRunning() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncMessageBlockRoot), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventStreamIsRunning", reflect.TypeOf((*MockValidatorClient)(nil).EventStreamIsRunning)) } -// GetSyncSubcommitteeIndex mocks base method. -func (m *MockValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { +// FeeRecipientByPubKey mocks base method. +func (m *MockValidatorClient) FeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) + ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1) + ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSyncSubcommitteeIndex indicates an expected call of GetSyncSubcommitteeIndex. -func (mr *MockValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { +// FeeRecipientByPubKey indicates an expected call of FeeRecipientByPubKey. +func (mr *MockValidatorClientMockRecorder) FeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncSubcommitteeIndex), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).FeeRecipientByPubKey), arg0, arg1) } // Host mocks base method. @@ -426,6 +381,51 @@ func (mr *MockValidatorClientMockRecorder) SubscribeCommitteeSubnets(arg0, arg1, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeCommitteeSubnets", reflect.TypeOf((*MockValidatorClient)(nil).SubscribeCommitteeSubnets), arg0, arg1, arg2) } +// SyncCommitteeContribution mocks base method. +func (m *MockValidatorClient) SyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncCommitteeContribution) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncCommitteeContribution indicates an expected call of SyncCommitteeContribution. +func (mr *MockValidatorClientMockRecorder) SyncCommitteeContribution(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).SyncCommitteeContribution), arg0, arg1) +} + +// SyncMessageBlockRoot mocks base method. +func (m *MockValidatorClient) SyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncMessageBlockRoot indicates an expected call of SyncMessageBlockRoot. +func (mr *MockValidatorClientMockRecorder) SyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).SyncMessageBlockRoot), arg0, arg1) +} + +// SyncSubcommitteeIndex mocks base method. +func (m *MockValidatorClient) SyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncSubcommitteeIndex indicates an expected call of SyncSubcommitteeIndex. +func (mr *MockValidatorClientMockRecorder) SyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).SyncSubcommitteeIndex), arg0, arg1) +} + // ValidatorIndex mocks base method. func (m *MockValidatorClient) ValidatorIndex(arg0 context.Context, arg1 *eth.ValidatorIndexRequest) (*eth.ValidatorIndexResponse, error) { m.ctrl.T.Helper() diff --git a/validator/accounts/accounts_exit.go b/validator/accounts/accounts_exit.go index 67f0b801ea0c..1750bae15b8b 100644 --- a/validator/accounts/accounts_exit.go +++ b/validator/accounts/accounts_exit.go @@ -47,7 +47,7 @@ func (acm *CLIManager) Exit(ctx context.Context) error { if nodeClient == nil { return errors.New("could not prepare beacon node client") } - syncStatus, err := (*nodeClient).GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := (*nodeClient).SyncStatus(ctx, &emptypb.Empty{}) if err != nil { return err } @@ -81,7 +81,7 @@ func PerformVoluntaryExit( ctx context.Context, cfg PerformExitCfg, ) (rawExitedKeys [][]byte, formattedExitedKeys []string, err error) { var rawNotExitedKeys [][]byte - genesisResponse, err := cfg.NodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := cfg.NodeClient.Genesis(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Errorf("voluntary exit failed: %v", err) } diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index f8f53f78f240..2f1e3d0a9836 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -217,8 +217,8 @@ func (m *Validator) SetProposerSettings(_ context.Context, settings *proposer.Se return nil } -// GetGraffiti for mocking -func (m *Validator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +// Graffiti for mocking +func (m *Validator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { return []byte(m.graffiti), nil } diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index 5cfd40fdf1b3..237acc3c7a11 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -55,7 +55,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives var slotSig []byte if v.distributed { - slotSig, err = v.getAttSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex}) + slotSig, err = v.attSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex}) if err != nil { log.WithError(err).Error("Could not find aggregated selection proof") if v.emitAccountMetrics { diff --git a/validator/client/attest.go b/validator/client/attest.go index 42973c4b13b1..80ee813a42e3 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -75,7 +75,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, Slot: slot, CommitteeIndex: duty.CommitteeIndex, } - data, err := v.validatorClient.GetAttestationData(ctx, req) + data, err := v.validatorClient.AttestationData(ctx, req) if err != nil { log.WithError(err).Error("Could not request attestation to sign at slot") if v.emitAccountMetrics { @@ -90,7 +90,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, Data: data, } - _, signingRoot, err := v.getDomainAndSigningRoot(ctx, indexedAtt.Data) + _, signingRoot, err := v.domainAndSigningRoot(ctx, indexedAtt.Data) if err != nil { log.WithError(err).Error("Could not get domain and signing root from attestation") if v.emitAccountMetrics { @@ -199,7 +199,7 @@ func (v *validator) duty(pubKey [fieldparams.BLSPubkeyLength]byte) (*ethpb.Dutie // Given validator's public key, this function returns the signature of an attestation data and its signing root. func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, data *ethpb.AttestationData, slot primitives.Slot) ([]byte, [32]byte, error) { - domain, root, err := v.getDomainAndSigningRoot(ctx, data) + domain, root, err := v.domainAndSigningRoot(ctx, data) if err != nil { return nil, [32]byte{}, err } @@ -217,7 +217,7 @@ func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLe return sig.Marshal(), root, nil } -func (v *validator) getDomainAndSigningRoot(ctx context.Context, data *ethpb.AttestationData) (*ethpb.DomainResponse, [32]byte, error) { +func (v *validator) domainAndSigningRoot(ctx context.Context, data *ethpb.AttestationData) (*ethpb.DomainResponse, [32]byte, error) { domain, err := v.domainData(ctx, data.Target.Epoch, params.BeaconConfig().DomainBeaconAttester[:]) if err != nil { return nil, [32]byte{}, err diff --git a/validator/client/attest_test.go b/validator/client/attest_test.go index 23308302f355..2ecab88bc167 100644 --- a/validator/client/attest_test.go +++ b/validator/client/attest_test.go @@ -81,7 +81,7 @@ func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) { Committee: make([]primitives.ValidatorIndex, 111), ValidatorIndex: 0, }}} - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -128,7 +128,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { beaconBlockRoot := bytesutil.ToBytes32([]byte("A")) targetRoot := bytesutil.ToBytes32([]byte("B")) sourceRoot := bytesutil.ToBytes32([]byte("C")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -206,7 +206,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) { sourceRoot := bytesutil.ToBytes32([]byte("C")) beaconBlockRoot2 := bytesutil.ToBytes32([]byte("D")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -214,7 +214,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) { Target: ðpb.Checkpoint{Root: targetRoot[:], Epoch: 4}, Source: ðpb.Checkpoint{Root: sourceRoot[:], Epoch: 3}, }, nil) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -261,7 +261,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) { targetRoot := bytesutil.ToBytes32([]byte("B")) sourceRoot := bytesutil.ToBytes32([]byte("C")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -269,7 +269,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) { Target: ðpb.Checkpoint{Root: targetRoot[:], Epoch: 2}, Source: ðpb.Checkpoint{Root: sourceRoot[:], Epoch: 1}, }, nil) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -317,7 +317,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) { targetRoot := bytesutil.ToBytes32([]byte("B")) sourceRoot := bytesutil.ToBytes32([]byte("C")) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -339,7 +339,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) { validator.SubmitAttestation(context.Background(), 30, pubKey) require.LogsDoNotContain(t, hook, failedAttLocalProtectionErr) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -363,12 +363,12 @@ func TestAttestToBlockHead_DoesNotAttestBeforeDelay(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) validator.genesisTime = uint64(prysmTime.Now().Unix()) - m.validatorClient.EXPECT().GetDuties( + m.validatorClient.EXPECT().Duties( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.DutiesRequest{}), ).Times(0) - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Times(0) @@ -408,7 +408,7 @@ func TestAttestToBlockHead_DoesAttestAfterDelay(t *testing.T) { ValidatorIndex: validatorIndex, }}} - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -450,7 +450,7 @@ func TestAttestToBlockHead_CorrectBitfieldLength(t *testing.T) { Committee: committee, ValidatorIndex: validatorIndex, }}} - m.validatorClient.EXPECT().GetAttestationData( + m.validatorClient.EXPECT().AttestationData( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), ).Return(ðpb.AttestationData{ @@ -643,7 +643,7 @@ func Test_slashableAttestationCheck_UpdatesLowestSignedEpochs(t *testing.T) { gomock.Any(), // ctx ðpb.DomainRequest{Epoch: 10, Domain: []byte{1, 0, 0, 0}}, ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - _, sr, err := validator.getDomainAndSigningRoot(ctx, att.Data) + _, sr, err := validator.domainAndSigningRoot(ctx, att.Data) require.NoError(t, err) err = validator.db.SlashableAttestationCheck(context.Background(), att, pubKey, sr, false, nil) diff --git a/validator/client/beacon-api/activation.go b/validator/client/beacon-api/activation.go index 0928327b0fc3..9e1671ec11fa 100644 --- a/validator/client/beacon-api/activation.go +++ b/validator/client/beacon-api/activation.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc" ) -func (c beaconApiValidatorClient) waitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) { +func (c *beaconApiValidatorClient) waitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) { return &waitForActivationClient{ ctx: ctx, beaconApiValidatorClient: c, @@ -24,12 +24,12 @@ func (c beaconApiValidatorClient) waitForActivation(ctx context.Context, in *eth type waitForActivationClient struct { grpc.ClientStream ctx context.Context - beaconApiValidatorClient + *beaconApiValidatorClient *ethpb.ValidatorActivationRequest lastRecvTime time.Time } -func computeWaitElements(now time.Time, lastRecvTime time.Time) (time.Duration, time.Time) { +func computeWaitElements(now, lastRecvTime time.Time) (time.Duration, time.Time) { nextRecvTime := lastRecvTime.Add(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) if lastRecvTime.IsZero() { @@ -68,7 +68,7 @@ func (c *waitForActivationClient) Recv() (*ethpb.ValidatorActivationResponse, er stringTargetPubKeys[index] = stringPubKey } - stateValidators, err := c.stateValidatorsProvider.GetStateValidators(c.ctx, stringTargetPubKeys, nil, nil) + stateValidators, err := c.stateValidatorsProvider.StateValidators(c.ctx, stringTargetPubKeys, nil, nil) if err != nil { return nil, errors.Wrap(err, "failed to get state validators") } diff --git a/validator/client/beacon-api/attestation_data.go b/validator/client/beacon-api/attestation_data.go index f4d2c1d8f890..084b785a392e 100644 --- a/validator/client/beacon-api/attestation_data.go +++ b/validator/client/beacon-api/attestation_data.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) getAttestationData( +func (c *beaconApiValidatorClient) attestationData( ctx context.Context, reqSlot primitives.Slot, reqCommitteeIndex primitives.CommitteeIndex, diff --git a/validator/client/beacon-api/attestation_data_test.go b/validator/client/beacon-api/attestation_data_test.go index ef3e212da501..2da68cec81e2 100644 --- a/validator/client/beacon-api/attestation_data_test.go +++ b/validator/client/beacon-api/attestation_data_test.go @@ -58,7 +58,7 @@ func TestGetAttestationData_ValidAttestation(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - resp, err := validatorClient.getAttestationData(ctx, primitives.Slot(expectedSlot), primitives.CommitteeIndex(expectedCommitteeIndex)) + resp, err := validatorClient.attestationData(ctx, primitives.Slot(expectedSlot), primitives.CommitteeIndex(expectedCommitteeIndex)) assert.NoError(t, err) require.NotNil(t, resp) @@ -194,7 +194,7 @@ func TestGetAttestationData_InvalidData(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getAttestationData(ctx, 1, 2) + _, err := validatorClient.attestationData(ctx, 1, 2) assert.ErrorContains(t, testCase.expectedErrorMessage, err) }) } @@ -220,11 +220,11 @@ func TestGetAttestationData_JsonResponseError(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getAttestationData(ctx, slot, committeeIndex) + _, err := validatorClient.attestationData(ctx, slot, committeeIndex) assert.ErrorContains(t, "some specific json response error", err) } -func generateValidAttestation(slot uint64, committeeIndex uint64) structs.GetAttestationDataResponse { +func generateValidAttestation(slot, committeeIndex uint64) structs.GetAttestationDataResponse { return structs.GetAttestationDataResponse{ Data: &structs.AttestationData{ Slot: strconv.FormatUint(slot, 10), diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client.go b/validator/client/beacon-api/beacon_api_beacon_chain_client.go index 0ed7607b33da..0b8c7f2073ac 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client.go @@ -25,7 +25,7 @@ type beaconApiChainClient struct { const getValidatorPerformanceEndpoint = "/prysm/validators/performance" -func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) { +func (c beaconApiChainClient) headBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) { blockHeader := structs.GetBlockHeaderResponse{} err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/headers/head", &blockHeader) if err != nil { @@ -43,7 +43,7 @@ func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs return &blockHeader, nil } -func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) { +func (c beaconApiChainClient) ChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) { const endpoint = "/eth/v1/beacon/states/head/finality_checkpoints" finalityCheckpoints := structs.GetFinalityCheckpointsResponse{} @@ -112,7 +112,7 @@ func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) return nil, errors.Wrapf(err, "failed to decode previous justified checkpoint root `%s`", finalityCheckpoints.Data.PreviousJustified.Root) } - blockHeader, err := c.getHeadBlockHeaders(ctx) + blockHeader, err := c.headBlockHeaders(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get head block headers") } @@ -146,16 +146,16 @@ func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) }, nil } -func (c beaconApiChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { +func (c beaconApiChainClient) ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { if c.fallbackClient != nil { - return c.fallbackClient.ListValidatorBalances(ctx, in) + return c.fallbackClient.ValidatorBalances(ctx, in) } // TODO: Implement me - panic("beaconApiChainClient.ListValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") + panic("beaconApiChainClient.ValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { +func (c beaconApiChainClient) Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { pageSize := in.PageSize // We follow the gRPC behavior here, which returns a maximum of 250 results when pageSize == 0 @@ -191,21 +191,21 @@ func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.List if err != nil { return nil, errors.Wrapf(err, "failed to get first slot for epoch `%d`", queryFilter.Epoch) } - if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForSlot(ctx, slot, pubkeys, in.Indices, statuses); err != nil { + if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForSlot(ctx, slot, pubkeys, in.Indices, statuses); err != nil { return nil, errors.Wrapf(err, "failed to get state validators for slot `%d`", slot) } epoch = slots.ToEpoch(slot) case *ethpb.ListValidatorsRequest_Genesis: - if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForSlot(ctx, 0, pubkeys, in.Indices, statuses); err != nil { + if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForSlot(ctx, 0, pubkeys, in.Indices, statuses); err != nil { return nil, errors.Wrapf(err, "failed to get genesis state validators") } epoch = 0 case nil: - if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForHead(ctx, pubkeys, in.Indices, statuses); err != nil { + if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForHead(ctx, pubkeys, in.Indices, statuses); err != nil { return nil, errors.Wrap(err, "failed to get head state validators") } - blockHeader, err := c.getHeadBlockHeaders(ctx) + blockHeader, err := c.headBlockHeaders(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get head block headers") } @@ -310,16 +310,16 @@ func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.List }, nil } -func (c beaconApiChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { +func (c beaconApiChainClient) ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { if c.fallbackClient != nil { - return c.fallbackClient.GetValidatorQueue(ctx, in) + return c.fallbackClient.ValidatorQueue(ctx, in) } // TODO: Implement me - panic("beaconApiChainClient.GetValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") + panic("beaconApiChainClient.ValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { +func (c beaconApiChainClient) ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { request, err := json.Marshal(structs.GetValidatorPerformanceRequest{ PublicKeys: in.PublicKeys, Indices: in.Indices, @@ -345,13 +345,13 @@ func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *e }, nil } -func (c beaconApiChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { +func (c beaconApiChainClient) ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { if c.fallbackClient != nil { - return c.fallbackClient.GetValidatorParticipation(ctx, in) + return c.fallbackClient.ValidatorParticipation(ctx, in) } // TODO: Implement me - panic("beaconApiChainClient.GetValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") + panic("beaconApiChainClient.ValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } func NewBeaconApiChainClientWithFallback(jsonRestHandler JsonRestHandler, fallbackClient iface.ChainClient) iface.ChainClient { diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go index a7a32ecc2381..b31b309eed0a 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go @@ -32,7 +32,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() beaconChainClient := beaconApiChainClient{} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ PageToken: "foo", }) assert.ErrorContains(t, "failed to parse page token `foo`", err) @@ -44,7 +44,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() beaconChainClient := beaconApiChainClient{} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ Epoch: math.MaxUint64, }, @@ -58,13 +58,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("foo error"), ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ Epoch: 0, }, @@ -78,13 +78,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("bar error"), ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, }) assert.ErrorContains(t, "failed to get genesis state validators: bar error", err) @@ -96,13 +96,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("foo error"), ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) assert.ErrorContains(t, "failed to get head state validators: foo error", err) @@ -114,7 +114,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, nil, ) @@ -126,7 +126,7 @@ func TestListValidators(t *testing.T) { stateValidatorsProvider: stateValidatorsProvider, jsonRestHandler: jsonRestHandler, } - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) assert.ErrorContains(t, "bar error", err) @@ -187,7 +187,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, nil, ) @@ -204,7 +204,7 @@ func TestListValidators(t *testing.T) { stateValidatorsProvider: stateValidatorsProvider, jsonRestHandler: jsonRestHandler, } - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) assert.ErrorContains(t, testCase.expectedError, err) @@ -328,13 +328,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( testCase.generateStateValidatorsResponse(), nil, ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, }) assert.ErrorContains(t, testCase.expectedError, err) @@ -556,13 +556,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return( testCase.generateJsonStateValidatorsResponse(), nil, ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - validators, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + validators, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, PublicKeys: [][]byte{}, Indices: []primitives.ValidatorIndex{}, @@ -753,7 +753,7 @@ func TestGetChainHead(t *testing.T) { ) beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} - _, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + _, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.expectedError, err) }) } @@ -860,7 +860,7 @@ func TestGetChainHead(t *testing.T) { ) beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} - _, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + _, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.expectedError, err) }) } @@ -914,7 +914,7 @@ func TestGetChainHead(t *testing.T) { } beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} - chainHead, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + chainHead, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{}) require.NoError(t, err) assert.DeepEqual(t, expectedChainHead, chainHead) }) @@ -953,7 +953,7 @@ func Test_beaconApiBeaconChainClient_GetValidatorPerformance(t *testing.T) { jsonRestHandler: jsonRestHandler, } - got, err := c.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + got, err := c.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKeys[0][:], publicKeys[2][:], publicKeys[1][:]}, }) require.NoError(t, err) diff --git a/validator/client/beacon-api/beacon_api_helpers.go b/validator/client/beacon-api/beacon_api_helpers.go index 34908e1aa97c..a931e4d96905 100644 --- a/validator/client/beacon-api/beacon_api_helpers.go +++ b/validator/client/beacon-api/beacon_api_helpers.go @@ -48,7 +48,7 @@ func buildURL(path string, queryParams ...neturl.Values) string { return fmt.Sprintf("%s?%s", path, queryParams[0].Encode()) } -func (c *beaconApiValidatorClient) getFork(ctx context.Context) (*structs.GetStateForkResponse, error) { +func (c *beaconApiValidatorClient) fork(ctx context.Context) (*structs.GetStateForkResponse, error) { const endpoint = "/eth/v1/beacon/states/head/fork" stateForkResponseJson := &structs.GetStateForkResponse{} @@ -60,7 +60,7 @@ func (c *beaconApiValidatorClient) getFork(ctx context.Context) (*structs.GetSta return stateForkResponseJson, nil } -func (c *beaconApiValidatorClient) getHeaders(ctx context.Context) (*structs.GetBlockHeadersResponse, error) { +func (c *beaconApiValidatorClient) headers(ctx context.Context) (*structs.GetBlockHeadersResponse, error) { const endpoint = "/eth/v1/beacon/headers" blockHeadersResponseJson := &structs.GetBlockHeadersResponse{} @@ -72,7 +72,7 @@ func (c *beaconApiValidatorClient) getHeaders(ctx context.Context) (*structs.Get return blockHeadersResponseJson, nil } -func (c *beaconApiValidatorClient) getLiveness(ctx context.Context, epoch primitives.Epoch, validatorIndexes []string) (*structs.GetLivenessResponse, error) { +func (c *beaconApiValidatorClient) liveness(ctx context.Context, epoch primitives.Epoch, validatorIndexes []string) (*structs.GetLivenessResponse, error) { const endpoint = "/eth/v1/validator/liveness/" url := endpoint + strconv.FormatUint(uint64(epoch), 10) @@ -90,7 +90,7 @@ func (c *beaconApiValidatorClient) getLiveness(ctx context.Context, epoch primit return livenessResponseJson, nil } -func (c *beaconApiValidatorClient) getSyncing(ctx context.Context) (*structs.SyncStatusResponse, error) { +func (c *beaconApiValidatorClient) syncing(ctx context.Context) (*structs.SyncStatusResponse, error) { const endpoint = "/eth/v1/node/syncing" syncingResponseJson := &structs.SyncStatusResponse{} @@ -103,7 +103,7 @@ func (c *beaconApiValidatorClient) getSyncing(ctx context.Context) (*structs.Syn } func (c *beaconApiValidatorClient) isSyncing(ctx context.Context) (bool, error) { - response, err := c.getSyncing(ctx) + response, err := c.syncing(ctx) if err != nil || response == nil || response.Data == nil { return true, errors.Wrapf(err, "failed to get syncing status") } @@ -112,7 +112,7 @@ func (c *beaconApiValidatorClient) isSyncing(ctx context.Context) (bool, error) } func (c *beaconApiValidatorClient) isOptimistic(ctx context.Context) (bool, error) { - response, err := c.getSyncing(ctx) + response, err := c.syncing(ctx) if err != nil || response == nil || response.Data == nil { return true, errors.Wrapf(err, "failed to get syncing status") } diff --git a/validator/client/beacon-api/beacon_api_helpers_test.go b/validator/client/beacon-api/beacon_api_helpers_test.go index 622d7e498c72..e42d9da2ee60 100644 --- a/validator/client/beacon-api/beacon_api_helpers_test.go +++ b/validator/client/beacon-api/beacon_api_helpers_test.go @@ -123,7 +123,7 @@ func TestGetFork_Nominal(t *testing.T) { jsonRestHandler: jsonRestHandler, } - fork, err := validatorClient.getFork(ctx) + fork, err := validatorClient.fork(ctx) require.NoError(t, err) assert.DeepEqual(t, &expected, fork) } @@ -148,7 +148,7 @@ func TestGetFork_Invalid(t *testing.T) { jsonRestHandler: jsonRestHandler, } - _, err := validatorClient.getFork(ctx) + _, err := validatorClient.fork(ctx) require.ErrorContains(t, "custom error", err) } @@ -190,7 +190,7 @@ func TestGetHeaders_Nominal(t *testing.T) { jsonRestHandler: jsonRestHandler, } - headers, err := validatorClient.getHeaders(ctx) + headers, err := validatorClient.headers(ctx) require.NoError(t, err) assert.DeepEqual(t, &expected, headers) } @@ -215,7 +215,7 @@ func TestGetHeaders_Invalid(t *testing.T) { jsonRestHandler: jsonRestHandler, } - _, err := validatorClient.getHeaders(ctx) + _, err := validatorClient.headers(ctx) require.ErrorContains(t, "custom error", err) } @@ -261,7 +261,7 @@ func TestGetLiveness_Nominal(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - liveness, err := validatorClient.getLiveness(ctx, 42, indexes) + liveness, err := validatorClient.liveness(ctx, 42, indexes) require.NoError(t, err) assert.DeepEqual(t, &expected, liveness) @@ -285,12 +285,12 @@ func TestGetLiveness_Invalid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getLiveness(ctx, 42, nil) + _, err := validatorClient.liveness(ctx, 42, nil) require.ErrorContains(t, "custom error", err) } -const syncingEnpoint = "/eth/v1/node/syncing" +const syncingEndpoint = "/eth/v1/node/syncing" func TestGetIsSyncing_Nominal(t *testing.T) { testCases := []struct { @@ -325,7 +325,7 @@ func TestGetIsSyncing_Nominal(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( nil, @@ -356,7 +356,7 @@ func TestGetIsSyncing_Invalid(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( errors.New("custom error"), diff --git a/validator/client/beacon-api/beacon_api_node_client.go b/validator/client/beacon-api/beacon_api_node_client.go index 6dd726b1ad4f..5b094a2e7bd2 100644 --- a/validator/client/beacon-api/beacon_api_node_client.go +++ b/validator/client/beacon-api/beacon_api_node_client.go @@ -25,7 +25,7 @@ type beaconApiNodeClient struct { healthTracker *beacon.NodeHealthTracker } -func (c *beaconApiNodeClient) GetSyncStatus(ctx context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) { +func (c *beaconApiNodeClient) SyncStatus(ctx context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) { syncingResponse := structs.SyncStatusResponse{} if err := c.jsonRestHandler.Get(ctx, "/eth/v1/node/syncing", &syncingResponse); err != nil { return nil, err @@ -40,8 +40,8 @@ func (c *beaconApiNodeClient) GetSyncStatus(ctx context.Context, _ *empty.Empty) }, nil } -func (c *beaconApiNodeClient) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) { - genesisJson, err := c.genesisProvider.GetGenesis(ctx) +func (c *beaconApiNodeClient) Genesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) { + genesisJson, err := c.genesisProvider.Genesis(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get genesis") } @@ -79,7 +79,7 @@ func (c *beaconApiNodeClient) GetGenesis(ctx context.Context, _ *empty.Empty) (* }, nil } -func (c *beaconApiNodeClient) GetVersion(ctx context.Context, _ *empty.Empty) (*ethpb.Version, error) { +func (c *beaconApiNodeClient) Version(ctx context.Context, _ *empty.Empty) (*ethpb.Version, error) { var versionResponse structs.GetVersionResponse if err := c.jsonRestHandler.Get(ctx, "/eth/v1/node/version", &versionResponse); err != nil { return nil, err @@ -94,13 +94,13 @@ func (c *beaconApiNodeClient) GetVersion(ctx context.Context, _ *empty.Empty) (* }, nil } -func (c *beaconApiNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { +func (c *beaconApiNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { if c.fallbackClient != nil { - return c.fallbackClient.ListPeers(ctx, in) + return c.fallbackClient.Peers(ctx, in) } // TODO: Implement me - panic("beaconApiNodeClient.ListPeers is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiNodeClientWithFallback.") + panic("beaconApiNodeClient.Peers is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiNodeClientWithFallback.") } func (c *beaconApiNodeClient) IsHealthy(ctx context.Context) bool { diff --git a/validator/client/beacon-api/beacon_api_node_client_test.go b/validator/client/beacon-api/beacon_api_node_client_test.go index 16c9f39715f3..09ef15d31440 100644 --- a/validator/client/beacon-api/beacon_api_node_client_test.go +++ b/validator/client/beacon-api/beacon_api_node_client_test.go @@ -112,7 +112,7 @@ func TestGetGenesis(t *testing.T) { ctx := context.Background() genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis( + genesisProvider.EXPECT().Genesis( ctx, ).Return( testCase.genesisResponse, @@ -139,7 +139,7 @@ func TestGetGenesis(t *testing.T) { genesisProvider: genesisProvider, jsonRestHandler: jsonRestHandler, } - response, err := nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + response, err := nodeClient.Genesis(ctx, &emptypb.Empty{}) if testCase.expectedResponse == nil { assert.ErrorContains(t, testCase.expectedError, err) @@ -214,7 +214,7 @@ func TestGetSyncStatus(t *testing.T) { ) nodeClient := &beaconApiNodeClient{jsonRestHandler: jsonRestHandler} - syncStatus, err := nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if testCase.expectedResponse == nil { assert.ErrorContains(t, testCase.expectedError, err) @@ -278,7 +278,7 @@ func TestGetVersion(t *testing.T) { ) nodeClient := &beaconApiNodeClient{jsonRestHandler: jsonRestHandler} - version, err := nodeClient.GetVersion(ctx, &emptypb.Empty{}) + version, err := nodeClient.Version(ctx, &emptypb.Empty{}) if testCase.expectedResponse == nil { assert.ErrorContains(t, testCase.expectedError, err) diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 667ac9a4710f..617832d30c55 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -46,9 +46,9 @@ func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...Valida return c } -func (c *beaconApiValidatorClient) GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { - return wrapInMetrics[*ethpb.DutiesResponse]("GetDuties", func() (*ethpb.DutiesResponse, error) { - return c.getDuties(ctx, in) +func (c *beaconApiValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { + return wrapInMetrics[*ethpb.DutiesResponse]("Duties", func() (*ethpb.DutiesResponse, error) { + return c.duties(ctx, in) }) } @@ -65,41 +65,41 @@ func (c *beaconApiValidatorClient) DomainData(ctx context.Context, in *ethpb.Dom domainType := bytesutil.ToBytes4(in.Domain) return wrapInMetrics[*ethpb.DomainResponse]("DomainData", func() (*ethpb.DomainResponse, error) { - return c.getDomainData(ctx, in.Epoch, domainType) + return c.domainData(ctx, in.Epoch, domainType) }) } -func (c *beaconApiValidatorClient) GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { - return wrapInMetrics[*ethpb.AttestationData]("GetAttestationData", func() (*ethpb.AttestationData, error) { - return c.getAttestationData(ctx, in.Slot, in.CommitteeIndex) +func (c *beaconApiValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { + return wrapInMetrics[*ethpb.AttestationData]("AttestationData", func() (*ethpb.AttestationData, error) { + return c.attestationData(ctx, in.Slot, in.CommitteeIndex) }) } -func (c *beaconApiValidatorClient) GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { - return wrapInMetrics[*ethpb.GenericBeaconBlock]("GetBeaconBlock", func() (*ethpb.GenericBeaconBlock, error) { - return c.getBeaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti) +func (c *beaconApiValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { + return wrapInMetrics[*ethpb.GenericBeaconBlock]("BeaconBlock", func() (*ethpb.GenericBeaconBlock, error) { + return c.beaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti) }) } -func (c *beaconApiValidatorClient) GetFeeRecipientByPubKey(_ context.Context, _ *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { +func (c *beaconApiValidatorClient) FeeRecipientByPubKey(_ context.Context, _ *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { return nil, nil } -func (c *beaconApiValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { - return wrapInMetrics[*ethpb.SyncCommitteeContribution]("GetSyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) { - return c.getSyncCommitteeContribution(ctx, in) +func (c *beaconApiValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { + return wrapInMetrics[*ethpb.SyncCommitteeContribution]("SyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) { + return c.syncCommitteeContribution(ctx, in) }) } -func (c *beaconApiValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { - return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("GetSyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) { - return c.getSyncMessageBlockRoot(ctx) +func (c *beaconApiValidatorClient) SyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { + return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("SyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) { + return c.syncMessageBlockRoot(ctx) }) } -func (c *beaconApiValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { - return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("GetSyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) { - return c.getSyncSubcommitteeIndex(ctx, in) +func (c *beaconApiValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { + return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("SyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) { + return c.syncSubcommitteeIndex(ctx, in) }) } @@ -211,12 +211,12 @@ func (c *beaconApiValidatorClient) EventStreamIsRunning() bool { return c.isEventStreamRunning } -func (c *beaconApiValidatorClient) GetAggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { - return c.getAggregatedSelection(ctx, selections) +func (c *beaconApiValidatorClient) AggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { + return c.aggregatedSelection(ctx, selections) } -func (c *beaconApiValidatorClient) GetAggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { - return c.getAggregatedSyncSelections(ctx, selections) +func (c *beaconApiValidatorClient) AggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { + return c.aggregatedSyncSelections(ctx, selections) } func wrapInMetrics[Resp any](action string, f func() (Resp, error)) (Resp, error) { diff --git a/validator/client/beacon-api/beacon_api_validator_client_test.go b/validator/client/beacon-api/beacon_api_validator_client_test.go index 7e5872124a91..19f00977adb8 100644 --- a/validator/client/beacon-api/beacon_api_validator_client_test.go +++ b/validator/client/beacon-api/beacon_api_validator_client_test.go @@ -19,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" ) -// Make sure that GetAttestationData() returns the same thing as the internal getAttestationData() +// Make sure that AttestationData() returns the same thing as the internal attestationData() func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { const slot = primitives.Slot(1) const committeeIndex = primitives.CommitteeIndex(2) @@ -43,9 +43,9 @@ func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { ).Times(2) validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex) + expectedResp, expectedErr := validatorClient.attestationData(ctx, slot, committeeIndex) - resp, err := validatorClient.GetAttestationData( + resp, err := validatorClient.AttestationData( context.Background(), ðpb.AttestationDataRequest{Slot: slot, CommitteeIndex: committeeIndex}, ) @@ -77,9 +77,9 @@ func TestBeaconApiValidatorClient_GetAttestationDataError(t *testing.T) { ).Times(2) validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex) + expectedResp, expectedErr := validatorClient.attestationData(ctx, slot, committeeIndex) - resp, err := validatorClient.GetAttestationData( + resp, err := validatorClient.AttestationData( context.Background(), ðpb.AttestationDataRequest{Slot: slot, CommitteeIndex: committeeIndex}, ) @@ -93,7 +93,7 @@ func TestBeaconApiValidatorClient_GetFeeRecipientByPubKey(t *testing.T) { validatorClient := beaconApiValidatorClient{} var expected *ethpb.FeeRecipientByPubKeyResponse = nil - resp, err := validatorClient.GetFeeRecipientByPubKey(ctx, nil) + resp, err := validatorClient.FeeRecipientByPubKey(ctx, nil) require.NoError(t, err) require.Equal(t, expected, resp) } @@ -109,7 +109,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) { ctx := context.Background() genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return( + genesisProvider.EXPECT().Genesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, nil, ).Times(2) @@ -118,7 +118,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) { resp, err := validatorClient.DomainData(context.Background(), ðpb.DomainRequest{Epoch: epoch, Domain: domainType}) domainTypeArray := bytesutil.ToBytes4(domainType) - expectedResp, expectedErr := validatorClient.getDomainData(ctx, epoch, domainTypeArray) + expectedResp, expectedErr := validatorClient.domainData(ctx, epoch, domainTypeArray) assert.DeepEqual(t, expectedErr, err) assert.DeepEqual(t, expectedResp, resp) } diff --git a/validator/client/beacon-api/beacon_block_converter_test.go b/validator/client/beacon-api/beacon_block_converter_test.go index bcb6a3ec37b3..cc30e14a2fbb 100644 --- a/validator/client/beacon-api/beacon_block_converter_test.go +++ b/validator/client/beacon-api/beacon_block_converter_test.go @@ -6,13 +6,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" ) func TestGetBeaconBlockConverter_Phase0Valid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoPhase0BeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoPhase0BeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTPhase0BlockToProto(test_helpers.GenerateJsonPhase0BeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTPhase0BlockToProto(testhelpers.GenerateJsonPhase0BeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -27,7 +27,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -36,7 +36,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "nil eth1 data", expectedErrorMessage: "eth1 data is nil", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -45,7 +45,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad slot", expectedErrorMessage: "failed to parse slot `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Slot = "foo" return beaconBlock }, @@ -54,7 +54,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad proposer index", expectedErrorMessage: "failed to parse proposer index `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.ProposerIndex = "bar" return beaconBlock }, @@ -63,7 +63,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad parent root", expectedErrorMessage: "failed to decode parent root `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.ParentRoot = "foo" return beaconBlock }, @@ -72,7 +72,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad state root", expectedErrorMessage: "failed to decode state root `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.StateRoot = "bar" return beaconBlock }, @@ -81,7 +81,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad randao reveal", expectedErrorMessage: "failed to decode randao reveal `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.RandaoReveal = "foo" return beaconBlock }, @@ -90,7 +90,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad deposit root", expectedErrorMessage: "failed to decode deposit root `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data.DepositRoot = "bar" return beaconBlock }, @@ -99,7 +99,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad deposit count", expectedErrorMessage: "failed to parse deposit count `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data.DepositCount = "foo" return beaconBlock }, @@ -108,7 +108,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad block hash", expectedErrorMessage: "failed to decode block hash `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data.BlockHash = "bar" return beaconBlock }, @@ -117,7 +117,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad graffiti", expectedErrorMessage: "failed to decode graffiti `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Graffiti = "foo" return beaconBlock }, @@ -126,7 +126,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad proposer slashings", expectedErrorMessage: "failed to get proposer slashings", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.ProposerSlashings[0] = nil return beaconBlock }, @@ -135,7 +135,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad attester slashings", expectedErrorMessage: "failed to get attester slashings", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.AttesterSlashings[0] = nil return beaconBlock }, @@ -144,7 +144,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad attestations", expectedErrorMessage: "failed to get attestations", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Attestations[0] = nil return beaconBlock }, @@ -153,7 +153,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad deposits", expectedErrorMessage: "failed to get deposits", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Deposits[0] = nil return beaconBlock }, @@ -162,7 +162,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad voluntary exits", expectedErrorMessage: "failed to get voluntary exits", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.VoluntaryExits[0] = nil return beaconBlock }, @@ -181,9 +181,9 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { } func TestGetBeaconBlockConverter_AltairValid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoAltairBeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoAltairBeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTAltairBlockToProto(test_helpers.GenerateJsonAltairBeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTAltairBlockToProto(testhelpers.GenerateJsonAltairBeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -198,7 +198,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -207,7 +207,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "nil sync aggregate", expectedErrorMessage: "sync aggregate is nil", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.SyncAggregate = nil return beaconBlock }, @@ -216,7 +216,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "bad phase0 fields", expectedErrorMessage: "failed to get the phase0 fields of the altair block", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -225,7 +225,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "bad sync committee bits", expectedErrorMessage: "failed to decode sync committee bits `foo`", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.SyncAggregate.SyncCommitteeBits = "foo" return beaconBlock }, @@ -234,7 +234,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "bad sync committee signature", expectedErrorMessage: "failed to decode sync committee signature `bar`", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.SyncAggregate.SyncCommitteeSignature = "bar" return beaconBlock }, @@ -253,9 +253,9 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { } func TestGetBeaconBlockConverter_BellatrixValid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoBellatrixBeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoBellatrixBeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTBellatrixBlockToProto(test_helpers.GenerateJsonBellatrixBeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTBellatrixBlockToProto(testhelpers.GenerateJsonBellatrixBeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -270,7 +270,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -279,7 +279,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "nil execution payload", expectedErrorMessage: "execution payload is nil", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload = nil return beaconBlock }, @@ -288,7 +288,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad altair fields", expectedErrorMessage: "failed to get the altair fields of the bellatrix block", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -297,7 +297,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad parent hash", expectedErrorMessage: "failed to decode execution payload parent hash `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.ParentHash = "foo" return beaconBlock }, @@ -306,7 +306,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad fee recipient", expectedErrorMessage: "failed to decode execution payload fee recipient `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.FeeRecipient = "bar" return beaconBlock }, @@ -315,7 +315,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad state root", expectedErrorMessage: "failed to decode execution payload state root `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.StateRoot = "foo" return beaconBlock }, @@ -324,7 +324,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad receipts root", expectedErrorMessage: "failed to decode execution payload receipts root `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.ReceiptsRoot = "bar" return beaconBlock }, @@ -333,7 +333,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad logs bloom", expectedErrorMessage: "failed to decode execution payload logs bloom `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.LogsBloom = "foo" return beaconBlock }, @@ -342,7 +342,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad prev randao", expectedErrorMessage: "failed to decode execution payload prev randao `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.PrevRandao = "bar" return beaconBlock }, @@ -351,7 +351,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad block number", expectedErrorMessage: "failed to parse execution payload block number `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.BlockNumber = "foo" return beaconBlock }, @@ -360,7 +360,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad gas limit", expectedErrorMessage: "failed to parse execution payload gas limit `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.GasLimit = "bar" return beaconBlock }, @@ -369,7 +369,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad gas used", expectedErrorMessage: "failed to parse execution payload gas used `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.GasUsed = "foo" return beaconBlock }, @@ -378,7 +378,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad timestamp", expectedErrorMessage: "failed to parse execution payload timestamp `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.Timestamp = "bar" return beaconBlock }, @@ -387,7 +387,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad extra data", expectedErrorMessage: "failed to decode execution payload extra data `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.ExtraData = "foo" return beaconBlock }, @@ -396,7 +396,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad base fee per gas", expectedErrorMessage: "failed to parse execution payload base fee per gas `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.BaseFeePerGas = "bar" return beaconBlock }, @@ -405,7 +405,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad block hash", expectedErrorMessage: "failed to decode execution payload block hash `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.BlockHash = "foo" return beaconBlock }, @@ -414,7 +414,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad transactions", expectedErrorMessage: "failed to get execution payload transactions", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.Transactions[0] = "bar" return beaconBlock }, @@ -433,9 +433,9 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { } func TestGetBeaconBlockConverter_CapellaValid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoCapellaBeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoCapellaBeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTCapellaBlockToProto(test_helpers.GenerateJsonCapellaBeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTCapellaBlockToProto(testhelpers.GenerateJsonCapellaBeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -450,7 +450,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -459,7 +459,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "nil execution payload", expectedErrorMessage: "execution payload is nil", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.ExecutionPayload = nil return beaconBlock }, @@ -468,7 +468,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "bad bellatrix fields", expectedErrorMessage: "failed to get the bellatrix fields of the capella block", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -477,7 +477,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "bad withdrawals", expectedErrorMessage: "failed to get withdrawals", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.ExecutionPayload.Withdrawals[0] = nil return beaconBlock }, @@ -486,7 +486,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "bad bls execution changes", expectedErrorMessage: "failed to get bls to execution changes", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.BLSToExecutionChanges[0] = nil return beaconBlock }, diff --git a/validator/client/beacon-api/beacon_committee_selections.go b/validator/client/beacon-api/beacon_committee_selections.go index e57e7b98828f..304b2a7abfe4 100644 --- a/validator/client/beacon-api/beacon_committee_selections.go +++ b/validator/client/beacon-api/beacon_committee_selections.go @@ -14,7 +14,7 @@ type aggregatedSelectionResponse struct { Data []iface.BeaconCommitteeSelection `json:"data"` } -func (c *beaconApiValidatorClient) getAggregatedSelection(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (c *beaconApiValidatorClient) aggregatedSelection(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { body, err := json.Marshal(selections) if err != nil { return nil, errors.Wrap(err, "failed to marshal selections") diff --git a/validator/client/beacon-api/beacon_committee_selections_test.go b/validator/client/beacon-api/beacon_committee_selections_test.go index d1f942a8487e..4fc8b465a2ea 100644 --- a/validator/client/beacon-api/beacon_committee_selections_test.go +++ b/validator/client/beacon-api/beacon_committee_selections_test.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -27,14 +27,14 @@ func TestGetAggregatedSelections(t *testing.T) { name: "valid", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, }, res: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, }, @@ -44,7 +44,7 @@ func TestGetAggregatedSelections(t *testing.T) { name: "endpoint error", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, @@ -56,7 +56,7 @@ func TestGetAggregatedSelections(t *testing.T) { name: "no response error", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, @@ -67,19 +67,19 @@ func TestGetAggregatedSelections(t *testing.T) { name: "mismatch response", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, { - SelectionProof: test_helpers.FillByteSlice(96, 102), + SelectionProof: testhelpers.FillByteSlice(96, 102), Slot: 75, ValidatorIndex: 79, }, }, res: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, }, @@ -111,7 +111,7 @@ func TestGetAggregatedSelections(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - res, err := validatorClient.GetAggregatedSelections(ctx, test.req) + res, err := validatorClient.AggregatedSelections(ctx, test.req) if test.expectedErrorMessage != "" { require.ErrorContains(t, test.expectedErrorMessage, err) return diff --git a/validator/client/beacon-api/domain_data.go b/validator/client/beacon-api/domain_data.go index a1854ec54e16..1956a2daf457 100644 --- a/validator/client/beacon-api/domain_data.go +++ b/validator/client/beacon-api/domain_data.go @@ -11,7 +11,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) { +func (c *beaconApiValidatorClient) domainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) { // Get the fork version from the given epoch fork, err := forks.Fork(epoch) if err != nil { @@ -19,7 +19,7 @@ func (c beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primi } // Get the genesis validator root - genesis, err := c.genesisProvider.GetGenesis(ctx) + genesis, err := c.genesisProvider.Genesis(ctx) if err != nil { return nil, errors.Wrapf(err, "failed to get genesis info") } diff --git a/validator/client/beacon-api/domain_data_test.go b/validator/client/beacon-api/domain_data_test.go index 827955a39dd9..9ac14ea2447f 100644 --- a/validator/client/beacon-api/domain_data_test.go +++ b/validator/client/beacon-api/domain_data_test.go @@ -35,15 +35,15 @@ func TestGetDomainData_ValidDomainData(t *testing.T) { ctx := context.Background() - // Make sure that GetGenesis() is called exactly once + // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return( + genesisProvider.EXPECT().Genesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, nil, ).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} - resp, err := validatorClient.getDomainData(ctx, epoch, domainType) + resp, err := validatorClient.domainData(ctx, epoch, domainType) assert.NoError(t, err) require.NotNil(t, resp) @@ -64,12 +64,12 @@ func TestGetDomainData_GenesisError(t *testing.T) { ctx := context.Background() - // Make sure that GetGenesis() is called exactly once + // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return(nil, errors.New("foo error")).Times(1) + genesisProvider.EXPECT().Genesis(ctx).Return(nil, errors.New("foo error")).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} - _, err := validatorClient.getDomainData(ctx, epoch, domainType) + _, err := validatorClient.domainData(ctx, epoch, domainType) assert.ErrorContains(t, "failed to get genesis info", err) assert.ErrorContains(t, "foo error", err) } @@ -83,14 +83,14 @@ func TestGetDomainData_InvalidGenesisRoot(t *testing.T) { ctx := context.Background() - // Make sure that GetGenesis() is called exactly once + // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return( + genesisProvider.EXPECT().Genesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: "foo"}, nil, ).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} - _, err := validatorClient.getDomainData(ctx, epoch, domainType) + _, err := validatorClient.domainData(ctx, epoch, domainType) assert.ErrorContains(t, "invalid genesis validators root: foo", err) } diff --git a/validator/client/beacon-api/doppelganger.go b/validator/client/beacon-api/doppelganger.go index 1025319b9c4b..3b9c52c4ca80 100644 --- a/validator/client/beacon-api/doppelganger.go +++ b/validator/client/beacon-api/doppelganger.go @@ -73,7 +73,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et } // Retrieve fork version -- Return early if we are in phase0. - forkResponse, err := c.getFork(ctx) + forkResponse, err := c.fork(ctx) if err != nil || forkResponse == nil || forkResponse.Data == nil { return nil, errors.Wrapf(err, "failed to get fork") } @@ -91,7 +91,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et } // Retrieve current epoch. - headers, err := c.getHeaders(ctx) + headers, err := c.headers(ctx) if err != nil || headers == nil || headers.Data == nil || len(headers.Data) == 0 || headers.Data[0].Header == nil || headers.Data[0].Header.Message == nil { return nil, errors.Wrapf(err, "failed to get headers") @@ -127,7 +127,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et } // Retrieve correspondence between validator pubkey and index. - stateValidators, err := c.stateValidatorsProvider.GetStateValidators(ctx, notRecentStringPubKeys, nil, nil) + stateValidators, err := c.stateValidatorsProvider.StateValidators(ctx, notRecentStringPubKeys, nil, nil) if err != nil || stateValidators == nil || stateValidators.Data == nil { return nil, errors.Wrapf(err, "failed to get state validators") } @@ -156,13 +156,13 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et // since we assume that we are not in phase0. previousEpoch := currentEpoch - 1 - indexToPreviousLiveness, err := c.getIndexToLiveness(ctx, previousEpoch, indexes) + indexToPreviousLiveness, err := c.indexToLiveness(ctx, previousEpoch, indexes) if err != nil { return nil, errors.Wrapf(err, "failed to get map from validator index to liveness for previous epoch %d", previousEpoch) } // Get validators liveness for the current epoch. - indexToCurrentLiveness, err := c.getIndexToLiveness(ctx, currentEpoch, indexes) + indexToCurrentLiveness, err := c.indexToLiveness(ctx, currentEpoch, indexes) if err != nil { return nil, errors.Wrapf(err, "failed to get map from validator index to liveness for current epoch %d", currentEpoch) } @@ -218,8 +218,8 @@ func buildResponse( } } -func (c *beaconApiValidatorClient) getIndexToLiveness(ctx context.Context, epoch primitives.Epoch, indexes []string) (map[string]bool, error) { - livenessResponse, err := c.getLiveness(ctx, epoch, indexes) +func (c *beaconApiValidatorClient) indexToLiveness(ctx context.Context, epoch primitives.Epoch, indexes []string) (map[string]bool, error) { + livenessResponse, err := c.liveness(ctx, epoch, indexes) if err != nil || livenessResponse.Data == nil { return nil, errors.Wrapf(err, fmt.Sprintf("failed to get liveness for epoch %d", epoch)) } diff --git a/validator/client/beacon-api/doppelganger_test.go b/validator/client/beacon-api/doppelganger_test.go index 5db65329dcfe..bce18ae1ade6 100644 --- a/validator/client/beacon-api/doppelganger_test.go +++ b/validator/client/beacon-api/doppelganger_test.go @@ -298,7 +298,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( nil, @@ -363,7 +363,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) if testCase.getStateValidatorsInterface != nil { - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, testCase.getStateValidatorsInterface.input, nil, @@ -489,7 +489,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { }, }, { - name: "getFork on error", + name: "fork on error", expectedErrorMessage: "failed to get fork", inputValidatorRequests: standardInputValidatorRequests, getSyncingOutput: standardGetSyncingOutput, @@ -734,7 +734,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( testCase.getSyncingError, @@ -777,7 +777,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) if testCase.getStateValidatorsInterface != nil { - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, testCase.getStateValidatorsInterface.input, nil, diff --git a/validator/client/beacon-api/duties.go b/validator/client/beacon-api/duties.go index 881040445668..2cc26fdc20c5 100644 --- a/validator/client/beacon-api/duties.go +++ b/validator/client/beacon-api/duties.go @@ -19,10 +19,10 @@ import ( ) type dutiesProvider interface { - GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) - GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) - GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) - GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) + AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) + ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) + SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) + Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) } type beaconApiDutiesProvider struct { @@ -40,8 +40,8 @@ type validatorForDuty struct { status ethpb.ValidatorStatus } -func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { - vals, err := c.getValidatorsForDuties(ctx, in.PublicKeys) +func (c *beaconApiValidatorClient) duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { + vals, err := c.validatorsForDuties(ctx, in.PublicKeys) if err != nil { return nil, errors.Wrap(err, "failed to get validators for duties") } @@ -53,7 +53,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie var currentEpochDuties []*ethpb.DutiesResponse_Duty go func() { - currentEpochDuties, err = c.getDutiesForEpoch(ctx, in.Epoch, vals, fetchSyncDuties) + currentEpochDuties, err = c.dutiesForEpoch(ctx, in.Epoch, vals, fetchSyncDuties) if err != nil { errCh <- errors.Wrapf(err, "failed to get duties for current epoch `%d`", in.Epoch) return @@ -61,7 +61,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie errCh <- nil }() - nextEpochDuties, err := c.getDutiesForEpoch(ctx, in.Epoch+1, vals, fetchSyncDuties) + nextEpochDuties, err := c.dutiesForEpoch(ctx, in.Epoch+1, vals, fetchSyncDuties) if err != nil { return nil, errors.Wrapf(err, "failed to get duties for next epoch `%d`", in.Epoch+1) } @@ -76,7 +76,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie }, nil } -func (c beaconApiValidatorClient) getDutiesForEpoch( +func (c *beaconApiValidatorClient) dutiesForEpoch( ctx context.Context, epoch primitives.Epoch, vals []validatorForDuty, @@ -103,7 +103,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch( var wg errgroup.Group wg.Go(func() error { - attesterDuties, err := c.dutiesProvider.GetAttesterDuties(ctx, epoch, indices) + attesterDuties, err := c.dutiesProvider.AttesterDuties(ctx, epoch, indices) if err != nil { return errors.Wrapf(err, "failed to get attester duties for epoch `%d`", epoch) } @@ -131,7 +131,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch( if fetchSyncDuties { wg.Go(func() error { - syncDuties, err := c.dutiesProvider.GetSyncDuties(ctx, epoch, indices) + syncDuties, err := c.dutiesProvider.SyncDuties(ctx, epoch, indices) if err != nil { return errors.Wrapf(err, "failed to get sync duties for epoch `%d`", epoch) } @@ -148,7 +148,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch( } wg.Go(func() error { - proposerDuties, err := c.dutiesProvider.GetProposerDuties(ctx, epoch) + proposerDuties, err := c.dutiesProvider.ProposerDuties(ctx, epoch) if err != nil { return errors.Wrapf(err, "failed to get proposer duties for epoch `%d`", epoch) } @@ -168,7 +168,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch( return nil }) - committees, err := c.dutiesProvider.GetCommittees(ctx, epoch) + committees, err := c.dutiesProvider.Committees(ctx, epoch) if err != nil { return nil, errors.Wrapf(err, "failed to get committees for epoch `%d`", epoch) } @@ -242,7 +242,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch( return duties, nil } -func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, pubkeys [][]byte) ([]validatorForDuty, error) { +func (c *beaconApiValidatorClient) validatorsForDuties(ctx context.Context, pubkeys [][]byte) ([]validatorForDuty, error) { vals := make([]validatorForDuty, 0, len(pubkeys)) stringPubkeysToPubkeys := make(map[string][]byte, len(pubkeys)) stringPubkeys := make([]string, len(pubkeys)) @@ -254,7 +254,7 @@ func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, p } statusesWithDuties := []string{validator.ActiveOngoing.String(), validator.ActiveExiting.String()} - stateValidatorsResponse, err := c.stateValidatorsProvider.GetStateValidators(ctx, stringPubkeys, nil, statusesWithDuties) + stateValidatorsResponse, err := c.stateValidatorsProvider.StateValidators(ctx, stringPubkeys, nil, statusesWithDuties) if err != nil { return nil, errors.Wrap(err, "failed to get state validators") } @@ -288,7 +288,7 @@ func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, p } // GetCommittees retrieves the committees for the given epoch -func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { +func (c beaconApiDutiesProvider) Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { committeeParams := url.Values{} committeeParams.Add("epoch", strconv.FormatUint(uint64(epoch), 10)) committeesRequest := buildURL("/eth/v1/beacon/states/head/committees", committeeParams) @@ -312,7 +312,7 @@ func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primit } // GetAttesterDuties retrieves the attester duties for the given epoch and validatorIndices -func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { +func (c beaconApiDutiesProvider) AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { jsonValidatorIndices := make([]string, len(validatorIndices)) for index, validatorIndex := range validatorIndices { jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10) @@ -344,7 +344,7 @@ func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch pr } // GetProposerDuties retrieves the proposer duties for the given epoch -func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { +func (c beaconApiDutiesProvider) ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { proposerDuties := structs.GetProposerDutiesResponse{} if err := c.jsonRestHandler.Get(ctx, fmt.Sprintf("/eth/v1/validator/duties/proposer/%d", epoch), &proposerDuties); err != nil { return nil, err @@ -364,7 +364,7 @@ func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch pr } // GetSyncDuties retrieves the sync committee duties for the given epoch and validatorIndices -func (c beaconApiDutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { +func (c beaconApiDutiesProvider) SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { jsonValidatorIndices := make([]string, len(validatorIndices)) for index, validatorIndex := range validatorIndices { jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10) diff --git a/validator/client/beacon-api/duties_test.go b/validator/client/beacon-api/duties_test.go index e29aab292ab2..1c12539eca0c 100644 --- a/validator/client/beacon-api/duties_test.go +++ b/validator/client/beacon-api/duties_test.go @@ -76,7 +76,7 @@ func TestGetAttesterDuties_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - attesterDuties, err := dutiesProvider.GetAttesterDuties(ctx, epoch, validatorIndices) + attesterDuties, err := dutiesProvider.AttesterDuties(ctx, epoch, validatorIndices) require.NoError(t, err) assert.DeepEqual(t, expectedAttesterDuties.Data, attesterDuties) } @@ -101,7 +101,7 @@ func TestGetAttesterDuties_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetAttesterDuties(ctx, epoch, nil) + _, err := dutiesProvider.AttesterDuties(ctx, epoch, nil) assert.ErrorContains(t, "foo error", err) } @@ -130,7 +130,7 @@ func TestGetAttesterDuties_NilAttesterDuty(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetAttesterDuties(ctx, epoch, nil) + _, err := dutiesProvider.AttesterDuties(ctx, epoch, nil) assert.ErrorContains(t, "attester duty at index `0` is nil", err) } @@ -170,7 +170,7 @@ func TestGetProposerDuties_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - proposerDuties, err := dutiesProvider.GetProposerDuties(ctx, epoch) + proposerDuties, err := dutiesProvider.ProposerDuties(ctx, epoch) require.NoError(t, err) assert.DeepEqual(t, expectedProposerDuties.Data, proposerDuties) } @@ -193,7 +193,7 @@ func TestGetProposerDuties_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetProposerDuties(ctx, epoch) + _, err := dutiesProvider.ProposerDuties(ctx, epoch) assert.ErrorContains(t, "foo error", err) } @@ -220,7 +220,7 @@ func TestGetProposerDuties_NilData(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetProposerDuties(ctx, epoch) + _, err := dutiesProvider.ProposerDuties(ctx, epoch) assert.ErrorContains(t, "proposer duties data is nil", err) } @@ -247,7 +247,7 @@ func TestGetProposerDuties_NilProposerDuty(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetProposerDuties(ctx, epoch) + _, err := dutiesProvider.ProposerDuties(ctx, epoch) assert.ErrorContains(t, "proposer duty at index `0` is nil", err) } @@ -300,7 +300,7 @@ func TestGetSyncDuties_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - syncDuties, err := dutiesProvider.GetSyncDuties(ctx, epoch, validatorIndices) + syncDuties, err := dutiesProvider.SyncDuties(ctx, epoch, validatorIndices) require.NoError(t, err) assert.DeepEqual(t, expectedSyncDuties.Data, syncDuties) } @@ -325,7 +325,7 @@ func TestGetSyncDuties_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil) + _, err := dutiesProvider.SyncDuties(ctx, epoch, nil) assert.ErrorContains(t, "foo error", err) } @@ -354,7 +354,7 @@ func TestGetSyncDuties_NilData(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil) + _, err := dutiesProvider.SyncDuties(ctx, epoch, nil) assert.ErrorContains(t, "sync duties data is nil", err) } @@ -383,7 +383,7 @@ func TestGetSyncDuties_NilSyncDuty(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil) + _, err := dutiesProvider.SyncDuties(ctx, epoch, nil) assert.ErrorContains(t, "sync duty at index `0` is nil", err) } @@ -429,7 +429,7 @@ func TestGetCommittees_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - committees, err := dutiesProvider.GetCommittees(ctx, epoch) + committees, err := dutiesProvider.Committees(ctx, epoch) require.NoError(t, err) assert.DeepEqual(t, expectedCommittees.Data, committees) } @@ -452,7 +452,7 @@ func TestGetCommittees_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetCommittees(ctx, epoch) + _, err := dutiesProvider.Committees(ctx, epoch) assert.ErrorContains(t, "foo error", err) } @@ -479,7 +479,7 @@ func TestGetCommittees_NilData(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetCommittees(ctx, epoch) + _, err := dutiesProvider.Committees(ctx, epoch) assert.ErrorContains(t, "state committees data is nil", err) } @@ -506,7 +506,7 @@ func TestGetCommittees_NilCommittee(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetCommittees(ctx, epoch) + _, err := dutiesProvider.Committees(ctx, epoch) assert.ErrorContains(t, "committee at index `0` is nil", err) } @@ -682,7 +682,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { } dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, epoch, gomock.Any(), @@ -691,7 +691,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { testCase.fetchAttesterDutiesError, ).AnyTimes() - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, epoch, ).Return( @@ -699,7 +699,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { testCase.fetchProposerDutiesError, ).AnyTimes() - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, epoch, gomock.Any(), @@ -708,7 +708,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { testCase.fetchSyncDutiesError, ).AnyTimes() - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, epoch, ).Return( @@ -726,7 +726,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { } validatorClient := &beaconApiValidatorClient{dutiesProvider: dutiesProvider} - _, err := validatorClient.getDutiesForEpoch( + _, err := validatorClient.dutiesForEpoch( ctx, epoch, vals, @@ -767,7 +767,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { ctx := context.Background() dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, epoch, ).Return( @@ -775,7 +775,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { nil, ).Times(1) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, epoch, validatorIndices, @@ -784,7 +784,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { nil, ).Times(1) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, epoch, ).Return( @@ -793,7 +793,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { ).Times(1) if testCase.fetchSyncDuties { - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, epoch, validatorIndices, @@ -951,7 +951,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { status: ethpb.ValidatorStatus_ACTIVE, } } - duties, err := validatorClient.getDutiesForEpoch( + duties, err := validatorClient.dutiesForEpoch( ctx, epoch, vals, @@ -1004,7 +1004,7 @@ func TestGetDuties_Valid(t *testing.T) { ctx := context.Background() dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, testCase.epoch, ).Return( @@ -1012,7 +1012,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, testCase.epoch, validatorIndices, @@ -1021,7 +1021,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, testCase.epoch, ).Return( @@ -1031,7 +1031,7 @@ func TestGetDuties_Valid(t *testing.T) { fetchSyncDuties := testCase.epoch >= params.BeaconConfig().AltairForkEpoch if fetchSyncDuties { - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, testCase.epoch, validatorIndices, @@ -1041,7 +1041,7 @@ func TestGetDuties_Valid(t *testing.T) { ).Times(2) } - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, testCase.epoch+1, ).Return( @@ -1049,7 +1049,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, testCase.epoch+1, validatorIndices, @@ -1058,7 +1058,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, testCase.epoch+1, ).Return( @@ -1067,7 +1067,7 @@ func TestGetDuties_Valid(t *testing.T) { ).Times(2) if fetchSyncDuties { - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, testCase.epoch+1, validatorIndices, @@ -1078,7 +1078,7 @@ func TestGetDuties_Valid(t *testing.T) { } stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), gomock.Any(), @@ -1187,13 +1187,13 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).MinTimes(1) - // Make sure that our values are equal to what would be returned by calling getDutiesForEpoch individually + // Make sure that our values are equal to what would be returned by calling dutiesForEpoch individually validatorClient := &beaconApiValidatorClient{ dutiesProvider: dutiesProvider, stateValidatorsProvider: stateValidatorsProvider, } - expectedCurrentEpochDuties, err := validatorClient.getDutiesForEpoch( + expectedCurrentEpochDuties, err := validatorClient.dutiesForEpoch( ctx, testCase.epoch, vals, @@ -1201,7 +1201,7 @@ func TestGetDuties_Valid(t *testing.T) { ) require.NoError(t, err) - expectedNextEpochDuties, err := validatorClient.getDutiesForEpoch( + expectedNextEpochDuties, err := validatorClient.dutiesForEpoch( ctx, testCase.epoch+1, vals, @@ -1214,7 +1214,7 @@ func TestGetDuties_Valid(t *testing.T) { NextEpochDuties: expectedNextEpochDuties, } - duties, err := validatorClient.getDuties(ctx, ðpb.DutiesRequest{ + duties, err := validatorClient.duties(ctx, ðpb.DutiesRequest{ Epoch: testCase.epoch, PublicKeys: append(pubkeys, []byte("0xunknown")), }) @@ -1232,7 +1232,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), gomock.Any(), @@ -1246,7 +1246,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) { stateValidatorsProvider: stateValidatorsProvider, } - _, err := validatorClient.getDuties(ctx, ðpb.DutiesRequest{ + _, err := validatorClient.duties(ctx, ðpb.DutiesRequest{ Epoch: 1, PublicKeys: [][]byte{}, }) @@ -1262,7 +1262,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { pubkey := []byte{1, 2, 3} stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), gomock.Any(), @@ -1281,7 +1281,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { ).Times(1) dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, primitives.Epoch(1), gomock.Any(), @@ -1289,16 +1289,16 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { nil, errors.New("foo error"), ).Times(1) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, primitives.Epoch(2), gomock.Any(), ).Times(1) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, gomock.Any(), ).Times(2) - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, gomock.Any(), ).Times(2) @@ -1308,7 +1308,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { dutiesProvider: dutiesProvider, } - _, err := validatorClient.getDuties(ctx, ðpb.DutiesRequest{ + _, err := validatorClient.duties(ctx, ðpb.DutiesRequest{ Epoch: 1, PublicKeys: [][]byte{pubkey}, }) @@ -1456,7 +1456,7 @@ func generateValidSyncDuties(pubkeys [][]byte, validatorIndices []primitives.Val } } -// We will use a reverse function to easily make sure that the current epoch and next epoch data returned by getDutiesForEpoch +// We will use a reverse function to easily make sure that the current epoch and next epoch data returned by dutiesForEpoch // are not the same func reverseSlice[T interface{}](slice []T) []T { reversedSlice := make([]T, len(slice)) diff --git a/validator/client/beacon-api/genesis.go b/validator/client/beacon-api/genesis.go index 411953660e7f..3b020f88d456 100644 --- a/validator/client/beacon-api/genesis.go +++ b/validator/client/beacon-api/genesis.go @@ -15,7 +15,7 @@ import ( ) type GenesisProvider interface { - GetGenesis(ctx context.Context) (*structs.Genesis, error) + Genesis(ctx context.Context) (*structs.Genesis, error) } type beaconApiGenesisProvider struct { @@ -24,8 +24,8 @@ type beaconApiGenesisProvider struct { once sync.Once } -func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) { - genesis, err := c.genesisProvider.GetGenesis(ctx) +func (c *beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) { + genesis, err := c.genesisProvider.Genesis(ctx) for err != nil { jsonErr := &httputil.DefaultJsonError{} @@ -37,7 +37,7 @@ func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb // Error 404 means that the chain genesis info is not yet known, so we query it every second until it's ready select { case <-time.After(time.Second): - genesis, err = c.genesisProvider.GetGenesis(ctx) + genesis, err = c.genesisProvider.Genesis(ctx) case <-ctx.Done(): return nil, errors.New("context canceled") } @@ -67,7 +67,7 @@ func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb } // GetGenesis gets the genesis information from the beacon node via the /eth/v1/beacon/genesis endpoint -func (c *beaconApiGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { +func (c *beaconApiGenesisProvider) Genesis(ctx context.Context) (*structs.Genesis, error) { genesisJson := &structs.GetGenesisResponse{} var doErr error c.once.Do(func() { diff --git a/validator/client/beacon-api/genesis_test.go b/validator/client/beacon-api/genesis_test.go index 1835068dde5d..b225078e1e62 100644 --- a/validator/client/beacon-api/genesis_test.go +++ b/validator/client/beacon-api/genesis_test.go @@ -37,7 +37,7 @@ func TestGetGenesis_ValidGenesis(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - resp, err := genesisProvider.GetGenesis(ctx) + resp, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, "1234", resp.GenesisTime) @@ -64,7 +64,7 @@ func TestGetGenesis_NilData(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - _, err := genesisProvider.GetGenesis(ctx) + _, err := genesisProvider.Genesis(ctx) assert.ErrorContains(t, "genesis data is nil", err) } @@ -93,9 +93,9 @@ func TestGetGenesis_EndpointCalledOnlyOnce(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - _, err := genesisProvider.GetGenesis(ctx) + _, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) - resp, err := genesisProvider.GetGenesis(ctx) + resp, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, "1234", resp.GenesisTime) @@ -134,9 +134,9 @@ func TestGetGenesis_EndpointCanBeCalledAgainAfterError(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - _, err := genesisProvider.GetGenesis(ctx) + _, err := genesisProvider.Genesis(ctx) require.ErrorContains(t, "foo", err) - resp, err := genesisProvider.GetGenesis(ctx) + resp, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, "1234", resp.GenesisTime) diff --git a/validator/client/beacon-api/get_beacon_block.go b/validator/client/beacon-api/get_beacon_block.go index 4e0b7fd20324..16de0e5b9598 100644 --- a/validator/client/beacon-api/get_beacon_block.go +++ b/validator/client/beacon-api/get_beacon_block.go @@ -22,7 +22,7 @@ type abstractProduceBlockResponseJson struct { Data json.RawMessage `json:"data"` } -func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { +func (c *beaconApiValidatorClient) beaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { queryParams := neturl.Values{} queryParams.Add("randao_reveal", hexutil.Encode(randaoReveal)) if len(graffiti) > 0 { @@ -164,7 +164,7 @@ func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primi return response, nil } -func (c beaconApiValidatorClient) fallBackToBlinded( +func (c *beaconApiValidatorClient) fallBackToBlinded( ctx context.Context, slot primitives.Slot, queryParams neturl.Values, @@ -177,7 +177,7 @@ func (c beaconApiValidatorClient) fallBackToBlinded( return resp, nil } -func (c beaconApiValidatorClient) fallBackToFull( +func (c *beaconApiValidatorClient) fallBackToFull( ctx context.Context, slot primitives.Slot, queryParams neturl.Values, diff --git a/validator/client/beacon-api/get_beacon_block_test.go b/validator/client/beacon-api/get_beacon_block_test.go index cce3e2ae3c1e..0df3f410c05e 100644 --- a/validator/client/beacon-api/get_beacon_block_test.go +++ b/validator/client/beacon-api/get_beacon_block_test.go @@ -16,7 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -36,7 +36,7 @@ func TestGetBeaconBlock_RequestFailed(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getBeaconBlock(ctx, 1, []byte{1}, []byte{2}) + _, err := validatorClient.beaconBlock(ctx, 1, []byte{1}, []byte{2}) assert.ErrorContains(t, "foo error", err) } @@ -139,7 +139,7 @@ func TestGetBeaconBlock_Error(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getBeaconBlock(ctx, 1, []byte{1}, []byte{2}) + _, err := validatorClient.beaconBlock(ctx, 1, []byte{1}, []byte{2}) assert.ErrorContains(t, testCase.expectedErrorMessage, err) }) } @@ -149,8 +149,8 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoPhase0BeaconBlock() - block := test_helpers.GenerateJsonPhase0BeaconBlock() + proto := testhelpers.GenerateProtoPhase0BeaconBlock() + block := testhelpers.GenerateJsonPhase0BeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -175,7 +175,7 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -191,8 +191,8 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoAltairBeaconBlock() - block := test_helpers.GenerateJsonAltairBeaconBlock() + proto := testhelpers.GenerateProtoAltairBeaconBlock() + block := testhelpers.GenerateJsonAltairBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -218,7 +218,7 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -234,8 +234,8 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBellatrixBeaconBlock() - block := test_helpers.GenerateJsonBellatrixBeaconBlock() + proto := testhelpers.GenerateProtoBellatrixBeaconBlock() + block := testhelpers.GenerateJsonBellatrixBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -262,7 +262,7 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -279,8 +279,8 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedBellatrixBeaconBlock() - block := test_helpers.GenerateJsonBlindedBellatrixBeaconBlock() + proto := testhelpers.GenerateProtoBlindedBellatrixBeaconBlock() + block := testhelpers.GenerateJsonBlindedBellatrixBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -307,7 +307,7 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -324,8 +324,8 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoCapellaBeaconBlock() - block := test_helpers.GenerateJsonCapellaBeaconBlock() + proto := testhelpers.GenerateProtoCapellaBeaconBlock() + block := testhelpers.GenerateJsonCapellaBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -352,7 +352,7 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -369,8 +369,8 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedCapellaBeaconBlock() - block := test_helpers.GenerateJsonBlindedCapellaBeaconBlock() + proto := testhelpers.GenerateProtoBlindedCapellaBeaconBlock() + block := testhelpers.GenerateJsonBlindedCapellaBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -397,7 +397,7 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -414,8 +414,8 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoDenebBeaconBlockContents() - block := test_helpers.GenerateJsonDenebBeaconBlockContents() + proto := testhelpers.GenerateProtoDenebBeaconBlockContents() + block := testhelpers.GenerateJsonDenebBeaconBlockContents() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -442,7 +442,7 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -459,8 +459,8 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedDenebBeaconBlock() - block := test_helpers.GenerateJsonBlindedDenebBeaconBlock() + proto := testhelpers.GenerateProtoBlindedDenebBeaconBlock() + block := testhelpers.GenerateJsonBlindedDenebBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -487,7 +487,7 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -504,8 +504,8 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedDenebBeaconBlock() - block := test_helpers.GenerateJsonBlindedDenebBeaconBlock() + proto := testhelpers.GenerateProtoBlindedDenebBeaconBlock() + block := testhelpers.GenerateJsonBlindedDenebBeaconBlock() blockBytes, err := json.Marshal(block) require.NoError(t, err) @@ -538,7 +538,7 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -555,8 +555,8 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoDenebBeaconBlockContents() - block := test_helpers.GenerateJsonDenebBeaconBlockContents() + proto := testhelpers.GenerateProtoDenebBeaconBlockContents() + block := testhelpers.GenerateJsonDenebBeaconBlockContents() blockBytes, err := json.Marshal(block) require.NoError(t, err) @@ -596,7 +596,7 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ diff --git a/validator/client/beacon-api/index.go b/validator/client/beacon-api/index.go index 098ab721c94f..3449c54fdcd3 100644 --- a/validator/client/beacon-api/index.go +++ b/validator/client/beacon-api/index.go @@ -28,10 +28,10 @@ func (e *IndexNotFoundError) Error() string { return e.message } -func (c beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { +func (c *beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { stringPubKey := hexutil.Encode(in.PublicKey) - stateValidator, err := c.stateValidatorsProvider.GetStateValidators(ctx, []string{stringPubKey}, nil, nil) + stateValidator, err := c.stateValidatorsProvider.StateValidators(ctx, []string{stringPubKey}, nil, nil) if err != nil { return nil, errors.Wrap(err, "failed to get state validator") } diff --git a/validator/client/beacon-api/mock/duties_mock.go b/validator/client/beacon-api/mock/duties_mock.go index b9527e0a04c0..4d7eda11e841 100644 --- a/validator/client/beacon-api/mock/duties_mock.go +++ b/validator/client/beacon-api/mock/duties_mock.go @@ -41,62 +41,62 @@ func (m *MockdutiesProvider) EXPECT() *MockdutiesProviderMockRecorder { return m.recorder } -// GetAttesterDuties mocks base method. -func (m *MockdutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { +// AttesterDuties mocks base method. +func (m *MockdutiesProvider) AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAttesterDuties", ctx, epoch, validatorIndices) + ret := m.ctrl.Call(m, "AttesterDuties", ctx, epoch, validatorIndices) ret0, _ := ret[0].([]*structs.AttesterDuty) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetAttesterDuties indicates an expected call of GetAttesterDuties. -func (mr *MockdutiesProviderMockRecorder) GetAttesterDuties(ctx, epoch, validatorIndices any) *gomock.Call { +// AttesterDuties indicates an expected call of AttesterDuties. +func (mr *MockdutiesProviderMockRecorder) AttesterDuties(ctx, epoch, validatorIndices any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttesterDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetAttesterDuties), ctx, epoch, validatorIndices) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttesterDuties", reflect.TypeOf((*MockdutiesProvider)(nil).AttesterDuties), ctx, epoch, validatorIndices) } -// GetCommittees mocks base method. -func (m *MockdutiesProvider) GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { +// Committees mocks base method. +func (m *MockdutiesProvider) Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCommittees", ctx, epoch) + ret := m.ctrl.Call(m, "Committees", ctx, epoch) ret0, _ := ret[0].([]*structs.Committee) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetCommittees indicates an expected call of GetCommittees. -func (mr *MockdutiesProviderMockRecorder) GetCommittees(ctx, epoch any) *gomock.Call { +// Committees indicates an expected call of Committees. +func (mr *MockdutiesProviderMockRecorder) Committees(ctx, epoch any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommittees", reflect.TypeOf((*MockdutiesProvider)(nil).GetCommittees), ctx, epoch) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Committees", reflect.TypeOf((*MockdutiesProvider)(nil).Committees), ctx, epoch) } -// GetProposerDuties mocks base method. -func (m *MockdutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { +// ProposerDuties mocks base method. +func (m *MockdutiesProvider) ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProposerDuties", ctx, epoch) + ret := m.ctrl.Call(m, "ProposerDuties", ctx, epoch) ret0, _ := ret[0].([]*structs.ProposerDuty) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetProposerDuties indicates an expected call of GetProposerDuties. -func (mr *MockdutiesProviderMockRecorder) GetProposerDuties(ctx, epoch any) *gomock.Call { +// ProposerDuties indicates an expected call of ProposerDuties. +func (mr *MockdutiesProviderMockRecorder) ProposerDuties(ctx, epoch any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposerDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetProposerDuties), ctx, epoch) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposerDuties", reflect.TypeOf((*MockdutiesProvider)(nil).ProposerDuties), ctx, epoch) } -// GetSyncDuties mocks base method. -func (m *MockdutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { +// SyncDuties mocks base method. +func (m *MockdutiesProvider) SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncDuties", ctx, epoch, validatorIndices) + ret := m.ctrl.Call(m, "SyncDuties", ctx, epoch, validatorIndices) ret0, _ := ret[0].([]*structs.SyncCommitteeDuty) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSyncDuties indicates an expected call of GetSyncDuties. -func (mr *MockdutiesProviderMockRecorder) GetSyncDuties(ctx, epoch, validatorIndices any) *gomock.Call { +// SyncDuties indicates an expected call of SyncDuties. +func (mr *MockdutiesProviderMockRecorder) SyncDuties(ctx, epoch, validatorIndices any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetSyncDuties), ctx, epoch, validatorIndices) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncDuties", reflect.TypeOf((*MockdutiesProvider)(nil).SyncDuties), ctx, epoch, validatorIndices) } diff --git a/validator/client/beacon-api/mock/genesis_mock.go b/validator/client/beacon-api/mock/genesis_mock.go index dd8e35e36eed..afb90b09b85d 100644 --- a/validator/client/beacon-api/mock/genesis_mock.go +++ b/validator/client/beacon-api/mock/genesis_mock.go @@ -40,17 +40,17 @@ func (m *MockGenesisProvider) EXPECT() *MockGenesisProviderMockRecorder { return m.recorder } -// GetGenesis mocks base method. -func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { +// Genesis mocks base method. +func (m *MockGenesisProvider) Genesis(ctx context.Context) (*structs.Genesis, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGenesis", ctx) + ret := m.ctrl.Call(m, "Genesis", ctx) ret0, _ := ret[0].(*structs.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetGenesis indicates an expected call of GetGenesis. -func (mr *MockGenesisProviderMockRecorder) GetGenesis(ctx any) *gomock.Call { +// Genesis indicates an expected call of Genesis. +func (mr *MockGenesisProviderMockRecorder) Genesis(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockGenesisProvider)(nil).Genesis), ctx) } diff --git a/validator/client/beacon-api/mock/state_validators_mock.go b/validator/client/beacon-api/mock/state_validators_mock.go index 5b9850bbe018..9807b5686241 100644 --- a/validator/client/beacon-api/mock/state_validators_mock.go +++ b/validator/client/beacon-api/mock/state_validators_mock.go @@ -41,47 +41,47 @@ func (m *MockStateValidatorsProvider) EXPECT() *MockStateValidatorsProviderMockR return m.recorder } -// GetStateValidators mocks base method. -func (m *MockStateValidatorsProvider) GetStateValidators(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { +// StateValidators mocks base method. +func (m *MockStateValidatorsProvider) StateValidators(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStateValidators", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "StateValidators", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(*structs.GetValidatorsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetStateValidators indicates an expected call of GetStateValidators. -func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidators(arg0, arg1, arg2, arg3 any) *gomock.Call { +// StateValidators indicates an expected call of StateValidators. +func (mr *MockStateValidatorsProviderMockRecorder) StateValidators(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidators", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidators), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidators", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidators), arg0, arg1, arg2, arg3) } -// GetStateValidatorsForHead mocks base method. -func (m *MockStateValidatorsProvider) GetStateValidatorsForHead(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { +// StateValidatorsForHead mocks base method. +func (m *MockStateValidatorsProvider) StateValidatorsForHead(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStateValidatorsForHead", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "StateValidatorsForHead", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(*structs.GetValidatorsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetStateValidatorsForHead indicates an expected call of GetStateValidatorsForHead. -func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidatorsForHead(arg0, arg1, arg2, arg3 any) *gomock.Call { +// StateValidatorsForHead indicates an expected call of StateValidatorsForHead. +func (mr *MockStateValidatorsProviderMockRecorder) StateValidatorsForHead(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidatorsForHead", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidatorsForHead), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidatorsForHead", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidatorsForHead), arg0, arg1, arg2, arg3) } -// GetStateValidatorsForSlot mocks base method. -func (m *MockStateValidatorsProvider) GetStateValidatorsForSlot(arg0 context.Context, arg1 primitives.Slot, arg2 []string, arg3 []primitives.ValidatorIndex, arg4 []string) (*structs.GetValidatorsResponse, error) { +// StateValidatorsForSlot mocks base method. +func (m *MockStateValidatorsProvider) StateValidatorsForSlot(arg0 context.Context, arg1 primitives.Slot, arg2 []string, arg3 []primitives.ValidatorIndex, arg4 []string) (*structs.GetValidatorsResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStateValidatorsForSlot", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "StateValidatorsForSlot", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(*structs.GetValidatorsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetStateValidatorsForSlot indicates an expected call of GetStateValidatorsForSlot. -func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidatorsForSlot(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { +// StateValidatorsForSlot indicates an expected call of StateValidatorsForSlot. +func (mr *MockStateValidatorsProviderMockRecorder) StateValidatorsForSlot(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidatorsForSlot", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidatorsForSlot), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidatorsForSlot", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidatorsForSlot), arg0, arg1, arg2, arg3, arg4) } diff --git a/validator/client/beacon-api/propose_attestation.go b/validator/client/beacon-api/propose_attestation.go index 803f2fe6a0a4..be543d14ed6f 100644 --- a/validator/client/beacon-api/propose_attestation.go +++ b/validator/client/beacon-api/propose_attestation.go @@ -9,7 +9,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) proposeAttestation(ctx context.Context, attestation *ethpb.Attestation) (*ethpb.AttestResponse, error) { +func (c *beaconApiValidatorClient) proposeAttestation(ctx context.Context, attestation *ethpb.Attestation) (*ethpb.AttestResponse, error) { if err := checkNilAttestation(attestation); err != nil { return nil, err } diff --git a/validator/client/beacon-api/propose_attestation_test.go b/validator/client/beacon-api/propose_attestation_test.go index 90c844327877..4caf3a8f07d9 100644 --- a/validator/client/beacon-api/propose_attestation_test.go +++ b/validator/client/beacon-api/propose_attestation_test.go @@ -11,27 +11,27 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) func TestProposeAttestation(t *testing.T) { attestation := ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), } tests := []struct { @@ -53,30 +53,30 @@ func TestProposeAttestation(t *testing.T) { { name: "nil attestation data", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), - Signature: test_helpers.FillByteSlice(96, 82), + AggregationBits: testhelpers.FillByteSlice(4, 74), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "attestation data is nil", }, { name: "nil source checkpoint", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Target: ðpb.Checkpoint{}, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "source/target in attestation data is nil", }, { name: "nil target checkpoint", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Source: ðpb.Checkpoint{}, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "source/target in attestation data is nil", }, @@ -87,14 +87,14 @@ func TestProposeAttestation(t *testing.T) { Source: ðpb.Checkpoint{}, Target: ðpb.Checkpoint{}, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "attestation aggregation bits is empty", }, { name: "nil signature", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Source: ðpb.Checkpoint{}, Target: ðpb.Checkpoint{}, diff --git a/validator/client/beacon-api/propose_beacon_block.go b/validator/client/beacon-api/propose_beacon_block.go index f8ae50b2c229..b6d91a447e49 100644 --- a/validator/client/beacon-api/propose_beacon_block.go +++ b/validator/client/beacon-api/propose_beacon_block.go @@ -14,7 +14,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { +func (c *beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { var consensusVersion string var beaconBlockRoot [32]byte diff --git a/validator/client/beacon-api/propose_beacon_block_altair_test.go b/validator/client/beacon-api/propose_beacon_block_altair_test.go index 82a68d24c030..45f6bab5132d 100644 --- a/validator/client/beacon-api/propose_beacon_block_altair_test.go +++ b/validator/client/beacon-api/propose_beacon_block_altair_test.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -80,8 +80,8 @@ func TestProposeBeaconBlock_Altair(t *testing.T) { func generateSignedAltairBlock() *ethpb.GenericSignedBeaconBlock_Altair { return ðpb.GenericSignedBeaconBlock_Altair{ Altair: ðpb.SignedBeaconBlockAltair{ - Block: test_helpers.GenerateProtoAltairBeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 112), + Block: testhelpers.GenerateProtoAltairBeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 112), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go b/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go index c5fa61ba3428..9fd2dca4e842 100644 --- a/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go +++ b/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go @@ -13,7 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -97,8 +97,8 @@ func TestProposeBeaconBlock_Bellatrix(t *testing.T) { func generateSignedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Bellatrix { return ðpb.GenericSignedBeaconBlock_Bellatrix{ Bellatrix: ðpb.SignedBeaconBlockBellatrix{ - Block: test_helpers.GenerateProtoBellatrixBeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 127), + Block: testhelpers.GenerateProtoBellatrixBeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 127), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go index 8465ae065ba4..302bbea9e520 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go @@ -14,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -101,37 +101,37 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Block: ðpb.BlindedBeaconBlockBellatrix{ Slot: 1, ProposerIndex: 2, - ParentRoot: test_helpers.FillByteSlice(32, 3), - StateRoot: test_helpers.FillByteSlice(32, 4), + ParentRoot: testhelpers.FillByteSlice(32, 3), + StateRoot: testhelpers.FillByteSlice(32, 4), Body: ðpb.BlindedBeaconBlockBodyBellatrix{ - RandaoReveal: test_helpers.FillByteSlice(96, 5), + RandaoReveal: testhelpers.FillByteSlice(96, 5), Eth1Data: ðpb.Eth1Data{ - DepositRoot: test_helpers.FillByteSlice(32, 6), + DepositRoot: testhelpers.FillByteSlice(32, 6), DepositCount: 7, - BlockHash: test_helpers.FillByteSlice(32, 8), + BlockHash: testhelpers.FillByteSlice(32, 8), }, - Graffiti: test_helpers.FillByteSlice(32, 9), + Graffiti: testhelpers.FillByteSlice(32, 9), ProposerSlashings: []*ethpb.ProposerSlashing{ { Header_1: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 10, ProposerIndex: 11, - ParentRoot: test_helpers.FillByteSlice(32, 12), - StateRoot: test_helpers.FillByteSlice(32, 13), - BodyRoot: test_helpers.FillByteSlice(32, 14), + ParentRoot: testhelpers.FillByteSlice(32, 12), + StateRoot: testhelpers.FillByteSlice(32, 13), + BodyRoot: testhelpers.FillByteSlice(32, 14), }, - Signature: test_helpers.FillByteSlice(96, 15), + Signature: testhelpers.FillByteSlice(96, 15), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 16, ProposerIndex: 17, - ParentRoot: test_helpers.FillByteSlice(32, 18), - StateRoot: test_helpers.FillByteSlice(32, 19), - BodyRoot: test_helpers.FillByteSlice(32, 20), + ParentRoot: testhelpers.FillByteSlice(32, 18), + StateRoot: testhelpers.FillByteSlice(32, 19), + BodyRoot: testhelpers.FillByteSlice(32, 20), }, - Signature: test_helpers.FillByteSlice(96, 21), + Signature: testhelpers.FillByteSlice(96, 21), }, }, { @@ -139,21 +139,21 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Header: ðpb.BeaconBlockHeader{ Slot: 22, ProposerIndex: 23, - ParentRoot: test_helpers.FillByteSlice(32, 24), - StateRoot: test_helpers.FillByteSlice(32, 25), - BodyRoot: test_helpers.FillByteSlice(32, 26), + ParentRoot: testhelpers.FillByteSlice(32, 24), + StateRoot: testhelpers.FillByteSlice(32, 25), + BodyRoot: testhelpers.FillByteSlice(32, 26), }, - Signature: test_helpers.FillByteSlice(96, 27), + Signature: testhelpers.FillByteSlice(96, 27), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 28, ProposerIndex: 29, - ParentRoot: test_helpers.FillByteSlice(32, 30), - StateRoot: test_helpers.FillByteSlice(32, 31), - BodyRoot: test_helpers.FillByteSlice(32, 32), + ParentRoot: testhelpers.FillByteSlice(32, 30), + StateRoot: testhelpers.FillByteSlice(32, 31), + BodyRoot: testhelpers.FillByteSlice(32, 32), }, - Signature: test_helpers.FillByteSlice(96, 33), + Signature: testhelpers.FillByteSlice(96, 33), }, }, }, @@ -164,34 +164,34 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Data: ðpb.AttestationData{ Slot: 36, CommitteeIndex: 37, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 39, - Root: test_helpers.FillByteSlice(32, 40), + Root: testhelpers.FillByteSlice(32, 40), }, Target: ðpb.Checkpoint{ Epoch: 41, - Root: test_helpers.FillByteSlice(32, 42), + Root: testhelpers.FillByteSlice(32, 42), }, }, - Signature: test_helpers.FillByteSlice(96, 43), + Signature: testhelpers.FillByteSlice(96, 43), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{44, 45}, Data: ðpb.AttestationData{ Slot: 46, CommitteeIndex: 47, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 49, - Root: test_helpers.FillByteSlice(32, 50), + Root: testhelpers.FillByteSlice(32, 50), }, Target: ðpb.Checkpoint{ Epoch: 51, - Root: test_helpers.FillByteSlice(32, 52), + Root: testhelpers.FillByteSlice(32, 52), }, }, - Signature: test_helpers.FillByteSlice(96, 53), + Signature: testhelpers.FillByteSlice(96, 53), }, }, { @@ -200,90 +200,90 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Data: ðpb.AttestationData{ Slot: 56, CommitteeIndex: 57, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 59, - Root: test_helpers.FillByteSlice(32, 60), + Root: testhelpers.FillByteSlice(32, 60), }, Target: ðpb.Checkpoint{ Epoch: 61, - Root: test_helpers.FillByteSlice(32, 62), + Root: testhelpers.FillByteSlice(32, 62), }, }, - Signature: test_helpers.FillByteSlice(96, 63), + Signature: testhelpers.FillByteSlice(96, 63), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{64, 65}, Data: ðpb.AttestationData{ Slot: 66, CommitteeIndex: 67, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 69, - Root: test_helpers.FillByteSlice(32, 70), + Root: testhelpers.FillByteSlice(32, 70), }, Target: ðpb.Checkpoint{ Epoch: 71, - Root: test_helpers.FillByteSlice(32, 72), + Root: testhelpers.FillByteSlice(32, 72), }, }, - Signature: test_helpers.FillByteSlice(96, 73), + Signature: testhelpers.FillByteSlice(96, 73), }, }, }, Attestations: []*ethpb.Attestation{ { - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, { - AggregationBits: test_helpers.FillByteSlice(4, 83), + AggregationBits: testhelpers.FillByteSlice(4, 83), Data: ðpb.AttestationData{ Slot: 84, CommitteeIndex: 85, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 87, - Root: test_helpers.FillByteSlice(32, 88), + Root: testhelpers.FillByteSlice(32, 88), }, Target: ðpb.Checkpoint{ Epoch: 89, - Root: test_helpers.FillByteSlice(32, 90), + Root: testhelpers.FillByteSlice(32, 90), }, }, - Signature: test_helpers.FillByteSlice(96, 91), + Signature: testhelpers.FillByteSlice(96, 91), }, }, Deposits: []*ethpb.Deposit{ { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 92)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 92)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 94), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 95), + PublicKey: testhelpers.FillByteSlice(48, 94), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 95), Amount: 96, - Signature: test_helpers.FillByteSlice(96, 97), + Signature: testhelpers.FillByteSlice(96, 97), }, }, { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 98)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 98)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 100), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 101), + PublicKey: testhelpers.FillByteSlice(48, 100), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 101), Amount: 102, - Signature: test_helpers.FillByteSlice(96, 103), + Signature: testhelpers.FillByteSlice(96, 103), }, }, }, @@ -293,39 +293,39 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Epoch: 104, ValidatorIndex: 105, }, - Signature: test_helpers.FillByteSlice(96, 106), + Signature: testhelpers.FillByteSlice(96, 106), }, { Exit: ðpb.VoluntaryExit{ Epoch: 107, ValidatorIndex: 108, }, - Signature: test_helpers.FillByteSlice(96, 109), + Signature: testhelpers.FillByteSlice(96, 109), }, }, SyncAggregate: ðpb.SyncAggregate{ - SyncCommitteeBits: test_helpers.FillByteSlice(64, 110), - SyncCommitteeSignature: test_helpers.FillByteSlice(96, 111), + SyncCommitteeBits: testhelpers.FillByteSlice(64, 110), + SyncCommitteeSignature: testhelpers.FillByteSlice(96, 111), }, ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeader{ - ParentHash: test_helpers.FillByteSlice(32, 112), - FeeRecipient: test_helpers.FillByteSlice(20, 113), - StateRoot: test_helpers.FillByteSlice(32, 114), - ReceiptsRoot: test_helpers.FillByteSlice(32, 115), - LogsBloom: test_helpers.FillByteSlice(256, 116), - PrevRandao: test_helpers.FillByteSlice(32, 117), + ParentHash: testhelpers.FillByteSlice(32, 112), + FeeRecipient: testhelpers.FillByteSlice(20, 113), + StateRoot: testhelpers.FillByteSlice(32, 114), + ReceiptsRoot: testhelpers.FillByteSlice(32, 115), + LogsBloom: testhelpers.FillByteSlice(256, 116), + PrevRandao: testhelpers.FillByteSlice(32, 117), BlockNumber: 118, GasLimit: 119, GasUsed: 120, Timestamp: 121, - ExtraData: test_helpers.FillByteSlice(32, 122), - BaseFeePerGas: test_helpers.FillByteSlice(32, 123), - BlockHash: test_helpers.FillByteSlice(32, 124), - TransactionsRoot: test_helpers.FillByteSlice(32, 125), + ExtraData: testhelpers.FillByteSlice(32, 122), + BaseFeePerGas: testhelpers.FillByteSlice(32, 123), + BlockHash: testhelpers.FillByteSlice(32, 124), + TransactionsRoot: testhelpers.FillByteSlice(32, 125), }, }, }, - Signature: test_helpers.FillByteSlice(96, 126), + Signature: testhelpers.FillByteSlice(96, 126), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go index 092fb75d3804..ccdb37df0977 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go @@ -14,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -103,37 +103,37 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Block: ðpb.BlindedBeaconBlockCapella{ Slot: 1, ProposerIndex: 2, - ParentRoot: test_helpers.FillByteSlice(32, 3), - StateRoot: test_helpers.FillByteSlice(32, 4), + ParentRoot: testhelpers.FillByteSlice(32, 3), + StateRoot: testhelpers.FillByteSlice(32, 4), Body: ðpb.BlindedBeaconBlockBodyCapella{ - RandaoReveal: test_helpers.FillByteSlice(96, 5), + RandaoReveal: testhelpers.FillByteSlice(96, 5), Eth1Data: ðpb.Eth1Data{ - DepositRoot: test_helpers.FillByteSlice(32, 6), + DepositRoot: testhelpers.FillByteSlice(32, 6), DepositCount: 7, - BlockHash: test_helpers.FillByteSlice(32, 8), + BlockHash: testhelpers.FillByteSlice(32, 8), }, - Graffiti: test_helpers.FillByteSlice(32, 9), + Graffiti: testhelpers.FillByteSlice(32, 9), ProposerSlashings: []*ethpb.ProposerSlashing{ { Header_1: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 10, ProposerIndex: 11, - ParentRoot: test_helpers.FillByteSlice(32, 12), - StateRoot: test_helpers.FillByteSlice(32, 13), - BodyRoot: test_helpers.FillByteSlice(32, 14), + ParentRoot: testhelpers.FillByteSlice(32, 12), + StateRoot: testhelpers.FillByteSlice(32, 13), + BodyRoot: testhelpers.FillByteSlice(32, 14), }, - Signature: test_helpers.FillByteSlice(96, 15), + Signature: testhelpers.FillByteSlice(96, 15), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 16, ProposerIndex: 17, - ParentRoot: test_helpers.FillByteSlice(32, 18), - StateRoot: test_helpers.FillByteSlice(32, 19), - BodyRoot: test_helpers.FillByteSlice(32, 20), + ParentRoot: testhelpers.FillByteSlice(32, 18), + StateRoot: testhelpers.FillByteSlice(32, 19), + BodyRoot: testhelpers.FillByteSlice(32, 20), }, - Signature: test_helpers.FillByteSlice(96, 21), + Signature: testhelpers.FillByteSlice(96, 21), }, }, { @@ -141,21 +141,21 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Header: ðpb.BeaconBlockHeader{ Slot: 22, ProposerIndex: 23, - ParentRoot: test_helpers.FillByteSlice(32, 24), - StateRoot: test_helpers.FillByteSlice(32, 25), - BodyRoot: test_helpers.FillByteSlice(32, 26), + ParentRoot: testhelpers.FillByteSlice(32, 24), + StateRoot: testhelpers.FillByteSlice(32, 25), + BodyRoot: testhelpers.FillByteSlice(32, 26), }, - Signature: test_helpers.FillByteSlice(96, 27), + Signature: testhelpers.FillByteSlice(96, 27), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 28, ProposerIndex: 29, - ParentRoot: test_helpers.FillByteSlice(32, 30), - StateRoot: test_helpers.FillByteSlice(32, 31), - BodyRoot: test_helpers.FillByteSlice(32, 32), + ParentRoot: testhelpers.FillByteSlice(32, 30), + StateRoot: testhelpers.FillByteSlice(32, 31), + BodyRoot: testhelpers.FillByteSlice(32, 32), }, - Signature: test_helpers.FillByteSlice(96, 33), + Signature: testhelpers.FillByteSlice(96, 33), }, }, }, @@ -166,34 +166,34 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Data: ðpb.AttestationData{ Slot: 36, CommitteeIndex: 37, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 39, - Root: test_helpers.FillByteSlice(32, 40), + Root: testhelpers.FillByteSlice(32, 40), }, Target: ðpb.Checkpoint{ Epoch: 41, - Root: test_helpers.FillByteSlice(32, 42), + Root: testhelpers.FillByteSlice(32, 42), }, }, - Signature: test_helpers.FillByteSlice(96, 43), + Signature: testhelpers.FillByteSlice(96, 43), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{44, 45}, Data: ðpb.AttestationData{ Slot: 46, CommitteeIndex: 47, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 49, - Root: test_helpers.FillByteSlice(32, 50), + Root: testhelpers.FillByteSlice(32, 50), }, Target: ðpb.Checkpoint{ Epoch: 51, - Root: test_helpers.FillByteSlice(32, 52), + Root: testhelpers.FillByteSlice(32, 52), }, }, - Signature: test_helpers.FillByteSlice(96, 53), + Signature: testhelpers.FillByteSlice(96, 53), }, }, { @@ -202,90 +202,90 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Data: ðpb.AttestationData{ Slot: 56, CommitteeIndex: 57, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 59, - Root: test_helpers.FillByteSlice(32, 60), + Root: testhelpers.FillByteSlice(32, 60), }, Target: ðpb.Checkpoint{ Epoch: 61, - Root: test_helpers.FillByteSlice(32, 62), + Root: testhelpers.FillByteSlice(32, 62), }, }, - Signature: test_helpers.FillByteSlice(96, 63), + Signature: testhelpers.FillByteSlice(96, 63), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{64, 65}, Data: ðpb.AttestationData{ Slot: 66, CommitteeIndex: 67, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 69, - Root: test_helpers.FillByteSlice(32, 70), + Root: testhelpers.FillByteSlice(32, 70), }, Target: ðpb.Checkpoint{ Epoch: 71, - Root: test_helpers.FillByteSlice(32, 72), + Root: testhelpers.FillByteSlice(32, 72), }, }, - Signature: test_helpers.FillByteSlice(96, 73), + Signature: testhelpers.FillByteSlice(96, 73), }, }, }, Attestations: []*ethpb.Attestation{ { - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, { - AggregationBits: test_helpers.FillByteSlice(4, 83), + AggregationBits: testhelpers.FillByteSlice(4, 83), Data: ðpb.AttestationData{ Slot: 84, CommitteeIndex: 85, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 87, - Root: test_helpers.FillByteSlice(32, 88), + Root: testhelpers.FillByteSlice(32, 88), }, Target: ðpb.Checkpoint{ Epoch: 89, - Root: test_helpers.FillByteSlice(32, 90), + Root: testhelpers.FillByteSlice(32, 90), }, }, - Signature: test_helpers.FillByteSlice(96, 91), + Signature: testhelpers.FillByteSlice(96, 91), }, }, Deposits: []*ethpb.Deposit{ { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 92)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 92)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 94), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 95), + PublicKey: testhelpers.FillByteSlice(48, 94), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 95), Amount: 96, - Signature: test_helpers.FillByteSlice(96, 97), + Signature: testhelpers.FillByteSlice(96, 97), }, }, { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 98)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 98)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 100), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 101), + PublicKey: testhelpers.FillByteSlice(48, 100), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 101), Amount: 102, - Signature: test_helpers.FillByteSlice(96, 103), + Signature: testhelpers.FillByteSlice(96, 103), }, }, }, @@ -295,58 +295,58 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Epoch: 104, ValidatorIndex: 105, }, - Signature: test_helpers.FillByteSlice(96, 106), + Signature: testhelpers.FillByteSlice(96, 106), }, { Exit: ðpb.VoluntaryExit{ Epoch: 107, ValidatorIndex: 108, }, - Signature: test_helpers.FillByteSlice(96, 109), + Signature: testhelpers.FillByteSlice(96, 109), }, }, SyncAggregate: ðpb.SyncAggregate{ - SyncCommitteeBits: test_helpers.FillByteSlice(64, 110), - SyncCommitteeSignature: test_helpers.FillByteSlice(96, 111), + SyncCommitteeBits: testhelpers.FillByteSlice(64, 110), + SyncCommitteeSignature: testhelpers.FillByteSlice(96, 111), }, ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderCapella{ - ParentHash: test_helpers.FillByteSlice(32, 112), - FeeRecipient: test_helpers.FillByteSlice(20, 113), - StateRoot: test_helpers.FillByteSlice(32, 114), - ReceiptsRoot: test_helpers.FillByteSlice(32, 115), - LogsBloom: test_helpers.FillByteSlice(256, 116), - PrevRandao: test_helpers.FillByteSlice(32, 117), + ParentHash: testhelpers.FillByteSlice(32, 112), + FeeRecipient: testhelpers.FillByteSlice(20, 113), + StateRoot: testhelpers.FillByteSlice(32, 114), + ReceiptsRoot: testhelpers.FillByteSlice(32, 115), + LogsBloom: testhelpers.FillByteSlice(256, 116), + PrevRandao: testhelpers.FillByteSlice(32, 117), BlockNumber: 118, GasLimit: 119, GasUsed: 120, Timestamp: 121, - ExtraData: test_helpers.FillByteSlice(32, 122), - BaseFeePerGas: test_helpers.FillByteSlice(32, 123), - BlockHash: test_helpers.FillByteSlice(32, 124), - TransactionsRoot: test_helpers.FillByteSlice(32, 125), - WithdrawalsRoot: test_helpers.FillByteSlice(32, 126), + ExtraData: testhelpers.FillByteSlice(32, 122), + BaseFeePerGas: testhelpers.FillByteSlice(32, 123), + BlockHash: testhelpers.FillByteSlice(32, 124), + TransactionsRoot: testhelpers.FillByteSlice(32, 125), + WithdrawalsRoot: testhelpers.FillByteSlice(32, 126), }, BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{ { Message: ðpb.BLSToExecutionChange{ ValidatorIndex: 127, - FromBlsPubkey: test_helpers.FillByteSlice(48, 128), - ToExecutionAddress: test_helpers.FillByteSlice(20, 129), + FromBlsPubkey: testhelpers.FillByteSlice(48, 128), + ToExecutionAddress: testhelpers.FillByteSlice(20, 129), }, - Signature: test_helpers.FillByteSlice(96, 130), + Signature: testhelpers.FillByteSlice(96, 130), }, { Message: ðpb.BLSToExecutionChange{ ValidatorIndex: 131, - FromBlsPubkey: test_helpers.FillByteSlice(48, 132), - ToExecutionAddress: test_helpers.FillByteSlice(20, 133), + FromBlsPubkey: testhelpers.FillByteSlice(48, 132), + ToExecutionAddress: testhelpers.FillByteSlice(20, 133), }, - Signature: test_helpers.FillByteSlice(96, 134), + Signature: testhelpers.FillByteSlice(96, 134), }, }, }, }, - Signature: test_helpers.FillByteSlice(96, 135), + Signature: testhelpers.FillByteSlice(96, 135), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_capella_test.go b/validator/client/beacon-api/propose_beacon_block_capella_test.go index 3f6dadb54459..0ee2183d3b38 100644 --- a/validator/client/beacon-api/propose_beacon_block_capella_test.go +++ b/validator/client/beacon-api/propose_beacon_block_capella_test.go @@ -13,7 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -97,8 +97,8 @@ func TestProposeBeaconBlock_Capella(t *testing.T) { func generateSignedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Capella { return ðpb.GenericSignedBeaconBlock_Capella{ Capella: ðpb.SignedBeaconBlockCapella{ - Block: test_helpers.GenerateProtoCapellaBeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 127), + Block: testhelpers.GenerateProtoCapellaBeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 127), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_phase0_test.go b/validator/client/beacon-api/propose_beacon_block_phase0_test.go index dd8ef8bf89c9..c15ffe5556f5 100644 --- a/validator/client/beacon-api/propose_beacon_block_phase0_test.go +++ b/validator/client/beacon-api/propose_beacon_block_phase0_test.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -76,8 +76,8 @@ func TestProposeBeaconBlock_Phase0(t *testing.T) { func generateSignedPhase0Block() *ethpb.GenericSignedBeaconBlock_Phase0 { return ðpb.GenericSignedBeaconBlock_Phase0{ Phase0: ðpb.SignedBeaconBlock{ - Block: test_helpers.GenerateProtoPhase0BeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 110), + Block: testhelpers.GenerateProtoPhase0BeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 110), }, } } diff --git a/validator/client/beacon-api/propose_exit.go b/validator/client/beacon-api/propose_exit.go index 19cff924e865..2ea3858d9a6e 100644 --- a/validator/client/beacon-api/propose_exit.go +++ b/validator/client/beacon-api/propose_exit.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) proposeExit(ctx context.Context, signedVoluntaryExit *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { +func (c *beaconApiValidatorClient) proposeExit(ctx context.Context, signedVoluntaryExit *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { if signedVoluntaryExit == nil { return nil, errors.New("signed voluntary exit is nil") } diff --git a/validator/client/beacon-api/prysm_beacon_chain_client.go b/validator/client/beacon-api/prysm_beacon_chain_client.go index d4bce8f37832..9a17d8a5f548 100644 --- a/validator/client/beacon-api/prysm_beacon_chain_client.go +++ b/validator/client/beacon-api/prysm_beacon_chain_client.go @@ -26,9 +26,9 @@ type prysmChainClient struct { nodeClient iface.NodeClient } -func (c prysmChainClient) GetValidatorCount(ctx context.Context, stateID string, statuses []validator2.Status) ([]iface.ValidatorCount, error) { +func (c prysmChainClient) ValidatorCount(ctx context.Context, stateID string, statuses []validator2.Status) ([]iface.ValidatorCount, error) { // Check node version for prysm beacon node as it is a custom endpoint for prysm beacon node. - nodeVersion, err := c.nodeClient.GetVersion(ctx, nil) + nodeVersion, err := c.nodeClient.Version(ctx, nil) if err != nil { return nil, errors.Wrap(err, "failed to get node version") } diff --git a/validator/client/beacon-api/state_validators.go b/validator/client/beacon-api/state_validators.go index c738906e0523..8ae11b28dff4 100644 --- a/validator/client/beacon-api/state_validators.go +++ b/validator/client/beacon-api/state_validators.go @@ -14,16 +14,16 @@ import ( ) type StateValidatorsProvider interface { - GetStateValidators(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) - GetStateValidatorsForSlot(context.Context, primitives.Slot, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) - GetStateValidatorsForHead(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) + StateValidators(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) + StateValidatorsForSlot(context.Context, primitives.Slot, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) + StateValidatorsForHead(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) } type beaconApiStateValidatorsProvider struct { jsonRestHandler JsonRestHandler } -func (c beaconApiStateValidatorsProvider) GetStateValidators( +func (c beaconApiStateValidatorsProvider) StateValidators( ctx context.Context, stringPubkeys []string, indexes []primitives.ValidatorIndex, @@ -33,7 +33,7 @@ func (c beaconApiStateValidatorsProvider) GetStateValidators( return c.getStateValidatorsHelper(ctx, "/eth/v1/beacon/states/head/validators", append(stringIndices, stringPubkeys...), statuses) } -func (c beaconApiStateValidatorsProvider) GetStateValidatorsForSlot( +func (c beaconApiStateValidatorsProvider) StateValidatorsForSlot( ctx context.Context, slot primitives.Slot, stringPubkeys []string, @@ -41,11 +41,10 @@ func (c beaconApiStateValidatorsProvider) GetStateValidatorsForSlot( statuses []string, ) (*structs.GetValidatorsResponse, error) { stringIndices := convertValidatorIndicesToStrings(indices) - url := fmt.Sprintf("/eth/v1/beacon/states/%d/validators", slot) - return c.getStateValidatorsHelper(ctx, url, append(stringIndices, stringPubkeys...), statuses) + return c.getStateValidatorsHelper(ctx, fmt.Sprintf("/eth/v1/beacon/states/%d/validators", slot), append(stringIndices, stringPubkeys...), statuses) } -func (c beaconApiStateValidatorsProvider) GetStateValidatorsForHead( +func (c beaconApiStateValidatorsProvider) StateValidatorsForHead( ctx context.Context, stringPubkeys []string, indices []primitives.ValidatorIndex, diff --git a/validator/client/beacon-api/state_validators_test.go b/validator/client/beacon-api/state_validators_test.go index c5d223716c44..78c648a49d33 100644 --- a/validator/client/beacon-api/state_validators_test.go +++ b/validator/client/beacon-api/state_validators_test.go @@ -85,7 +85,7 @@ func TestGetStateValidators_Nominal_POST(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - actual, err := stateValidatorsProvider.GetStateValidators(ctx, []string{ + actual, err := stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing "0x80000e851c0f53c3246ff726d7ff7766661ca5e12a07c45c114d208d54f0f8233d4380b2e9aff759d69795d1df905526", // active_exiting "0x424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", // does not exist @@ -191,7 +191,7 @@ func TestGetStateValidators_Nominal_GET(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - actual, err := stateValidatorsProvider.GetStateValidators(ctx, []string{ + actual, err := stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing "0x80000e851c0f53c3246ff726d7ff7766661ca5e12a07c45c114d208d54f0f8233d4380b2e9aff759d69795d1df905526", // active_exiting "0x424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", // does not exist @@ -255,7 +255,7 @@ func TestGetStateValidators_GetRestJsonResponseOnError(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - _, err = stateValidatorsProvider.GetStateValidators(ctx, []string{ + _, err = stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing }, nil, @@ -294,7 +294,7 @@ func TestGetStateValidators_DataIsNil_POST(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - _, err = stateValidatorsProvider.GetStateValidators(ctx, []string{ + _, err = stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing }, nil, @@ -354,7 +354,7 @@ func TestGetStateValidators_DataIsNil_GET(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - _, err = stateValidatorsProvider.GetStateValidators(ctx, []string{ + _, err = stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing }, nil, diff --git a/validator/client/beacon-api/status.go b/validator/client/beacon-api/status.go index a9dc536cc248..bdec7502fec5 100644 --- a/validator/client/beacon-api/status.go +++ b/validator/client/beacon-api/status.go @@ -14,7 +14,7 @@ import ( ) func (c *beaconApiValidatorClient) validatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) { - _, _, validatorsStatusResponse, err := c.getValidatorsStatusResponse(ctx, [][]byte{in.PublicKey}, nil) + _, _, validatorsStatusResponse, err := c.validatorsStatusResponse(ctx, [][]byte{in.PublicKey}, nil) if err != nil { return nil, errors.Wrap(err, "failed to get validator status response") } @@ -33,7 +33,7 @@ func (c *beaconApiValidatorClient) multipleValidatorStatus(ctx context.Context, for i, ix := range in.Indices { indices[i] = primitives.ValidatorIndex(ix) } - publicKeys, indices, statuses, err := c.getValidatorsStatusResponse(ctx, in.PublicKeys, indices) + publicKeys, indices, statuses, err := c.validatorsStatusResponse(ctx, in.PublicKeys, indices) if err != nil { return nil, errors.Wrap(err, "failed to get validators status response") } @@ -45,7 +45,7 @@ func (c *beaconApiValidatorClient) multipleValidatorStatus(ctx context.Context, }, nil } -func (c *beaconApiValidatorClient) getValidatorsStatusResponse(ctx context.Context, inPubKeys [][]byte, inIndexes []primitives.ValidatorIndex) ( +func (c *beaconApiValidatorClient) validatorsStatusResponse(ctx context.Context, inPubKeys [][]byte, inIndexes []primitives.ValidatorIndex) ( [][]byte, []primitives.ValidatorIndex, []*ethpb.ValidatorStatusResponse, @@ -74,12 +74,12 @@ func (c *beaconApiValidatorClient) getValidatorsStatusResponse(ctx context.Conte } // Get state for the current validator - stateValidatorsResponse, err := c.stateValidatorsProvider.GetStateValidators(ctx, stringTargetPubKeys, inIndexes, nil) + stateValidatorsResponse, err := c.stateValidatorsProvider.StateValidators(ctx, stringTargetPubKeys, inIndexes, nil) if err != nil { return nil, nil, nil, errors.Wrap(err, "failed to get state validators") } - validatorsCountResponse, err := c.prysmChainClient.GetValidatorCount(ctx, "head", nil) + validatorsCountResponse, err := c.prysmChainClient.ValidatorCount(ctx, "head", nil) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return nil, nil, nil, errors.Wrap(err, "failed to get total validator count") } diff --git a/validator/client/beacon-api/status_test.go b/validator/client/beacon-api/status_test.go index 15b318f88026..c802bd59ff15 100644 --- a/validator/client/beacon-api/status_test.go +++ b/validator/client/beacon-api/status_test.go @@ -31,7 +31,7 @@ func TestValidatorStatus_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, []string{stringValidatorPubKey}, nil, @@ -96,7 +96,7 @@ func TestValidatorStatus_Error(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), nil, @@ -138,7 +138,7 @@ func TestMultipleValidatorStatus_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, stringValidatorsPubKey, []primitives.ValidatorIndex{}, @@ -223,7 +223,7 @@ func TestMultipleValidatorStatus_Error(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), []primitives.ValidatorIndex{}, @@ -275,7 +275,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, stringValidatorsPubKey, validatorsIndex, @@ -436,7 +436,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) jsonRestHandler: jsonRestHandler, }, } - actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.getValidatorsStatusResponse(ctx, validatorsPubKey, validatorsIndex) + actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.validatorsStatusResponse(ctx, validatorsPubKey, validatorsIndex) require.NoError(t, err) assert.DeepEqual(t, wantedValidatorsPubKey, actualValidatorsPubKey) @@ -455,7 +455,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, []string{stringValidatorPubKey}, nil, @@ -506,7 +506,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { jsonRestHandler: jsonRestHandler, }, } - actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.getValidatorsStatusResponse(ctx, wantedValidatorsPubKey, nil) + actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.validatorsStatusResponse(ctx, wantedValidatorsPubKey, nil) require.NoError(t, err) require.NoError(t, err) @@ -705,7 +705,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, testCase.inputGetStateValidatorsInterface.inputStringPubKeys, testCase.inputGetStateValidatorsInterface.inputIndexes, @@ -737,7 +737,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { }, } - _, _, _, err := validatorClient.getValidatorsStatusResponse( + _, _, _, err := validatorClient.validatorsStatusResponse( ctx, testCase.inputPubKeys, testCase.inputIndexes, diff --git a/validator/client/beacon-api/stream_blocks.go b/validator/client/beacon-api/stream_blocks.go index 19e3f1c3a824..06113065dce8 100644 --- a/validator/client/beacon-api/stream_blocks.go +++ b/validator/client/beacon-api/stream_blocks.go @@ -24,7 +24,7 @@ type abstractSignedBlockResponseJson struct { type streamBlocksAltairClient struct { grpc.ClientStream ctx context.Context - beaconApiClient beaconApiValidatorClient + beaconApiClient *beaconApiValidatorClient streamBlocksRequest *ethpb.StreamBlocksRequest prevBlockSlot primitives.Slot pingDelay time.Duration @@ -36,7 +36,7 @@ type headSignedBeaconBlockResult struct { slot primitives.Slot } -func (c beaconApiValidatorClient) streamBlocks(ctx context.Context, in *ethpb.StreamBlocksRequest, pingDelay time.Duration) ethpb.BeaconNodeValidator_StreamBlocksAltairClient { +func (c *beaconApiValidatorClient) streamBlocks(ctx context.Context, in *ethpb.StreamBlocksRequest, pingDelay time.Duration) ethpb.BeaconNodeValidator_StreamBlocksAltairClient { return &streamBlocksAltairClient{ ctx: ctx, beaconApiClient: c, @@ -46,7 +46,7 @@ func (c beaconApiValidatorClient) streamBlocks(ctx context.Context, in *ethpb.St } func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { - result, err := c.beaconApiClient.getHeadSignedBeaconBlock(c.ctx) + result, err := c.beaconApiClient.headSignedBeaconBlock(c.ctx) if err != nil { return nil, errors.Wrap(err, "failed to get latest signed block") } @@ -55,7 +55,7 @@ func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { for (c.streamBlocksRequest.VerifiedOnly && result.executionOptimistic) || c.prevBlockSlot == result.slot { select { case <-time.After(c.pingDelay): - result, err = c.beaconApiClient.getHeadSignedBeaconBlock(c.ctx) + result, err = c.beaconApiClient.headSignedBeaconBlock(c.ctx) if err != nil { return nil, errors.Wrap(err, "failed to get latest signed block") } @@ -68,7 +68,7 @@ func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { return result.streamBlocksResponse, nil } -func (c beaconApiValidatorClient) getHeadSignedBeaconBlock(ctx context.Context) (*headSignedBeaconBlockResult, error) { +func (c *beaconApiValidatorClient) headSignedBeaconBlock(ctx context.Context) (*headSignedBeaconBlockResult, error) { // Since we don't know yet what the json looks like, we unmarshal into an abstract structure that has only a version // and a blob of data signedBlockResponseJson := abstractSignedBlockResponseJson{} diff --git a/validator/client/beacon-api/stream_blocks_test.go b/validator/client/beacon-api/stream_blocks_test.go index 3111c28a3d8c..ffb58d5032bc 100644 --- a/validator/client/beacon-api/stream_blocks_test.go +++ b/validator/client/beacon-api/stream_blocks_test.go @@ -15,7 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -203,7 +203,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - phase0BeaconBlock1 := test_helpers.GenerateJsonPhase0BeaconBlock() + phase0BeaconBlock1 := testhelpers.GenerateJsonPhase0BeaconBlock() phase0BeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlock{ Message: phase0BeaconBlock1, @@ -228,7 +228,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { }, ).Times(2) - phase0ProtoBeaconBlock1 := test_helpers.GenerateProtoPhase0BeaconBlock() + phase0ProtoBeaconBlock1 := testhelpers.GenerateProtoPhase0BeaconBlock() phase0ProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTPhase0BlockToProto( @@ -240,7 +240,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - phase0BeaconBlock2 := test_helpers.GenerateJsonPhase0BeaconBlock() + phase0BeaconBlock2 := testhelpers.GenerateJsonPhase0BeaconBlock() phase0BeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlock{ Message: phase0BeaconBlock2, @@ -265,7 +265,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { }, ).Times(1) - phase0ProtoBeaconBlock2 := test_helpers.GenerateProtoPhase0BeaconBlock() + phase0ProtoBeaconBlock2 := testhelpers.GenerateProtoPhase0BeaconBlock() phase0ProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTPhase0BlockToProto( @@ -364,7 +364,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - altairBeaconBlock1 := test_helpers.GenerateJsonAltairBeaconBlock() + altairBeaconBlock1 := testhelpers.GenerateJsonAltairBeaconBlock() altairBeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlockAltair{ Message: altairBeaconBlock1, @@ -389,7 +389,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { }, ).Times(2) - altairProtoBeaconBlock1 := test_helpers.GenerateProtoAltairBeaconBlock() + altairProtoBeaconBlock1 := testhelpers.GenerateProtoAltairBeaconBlock() altairProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTAltairBlockToProto( @@ -401,7 +401,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - altairBeaconBlock2 := test_helpers.GenerateJsonAltairBeaconBlock() + altairBeaconBlock2 := testhelpers.GenerateJsonAltairBeaconBlock() altairBeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlockAltair{ Message: altairBeaconBlock2, @@ -426,7 +426,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { }, ).Times(1) - altairProtoBeaconBlock2 := test_helpers.GenerateProtoAltairBeaconBlock() + altairProtoBeaconBlock2 := testhelpers.GenerateProtoAltairBeaconBlock() altairProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTAltairBlockToProto( @@ -525,7 +525,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - bellatrixBeaconBlock1 := test_helpers.GenerateJsonBellatrixBeaconBlock() + bellatrixBeaconBlock1 := testhelpers.GenerateJsonBellatrixBeaconBlock() bellatrixBeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlockBellatrix{ Message: bellatrixBeaconBlock1, @@ -550,7 +550,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { }, ).Times(2) - bellatrixProtoBeaconBlock1 := test_helpers.GenerateProtoBellatrixBeaconBlock() + bellatrixProtoBeaconBlock1 := testhelpers.GenerateProtoBellatrixBeaconBlock() bellatrixProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTBellatrixBlockToProto( @@ -562,7 +562,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - bellatrixBeaconBlock2 := test_helpers.GenerateJsonBellatrixBeaconBlock() + bellatrixBeaconBlock2 := testhelpers.GenerateJsonBellatrixBeaconBlock() bellatrixBeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlockBellatrix{ Message: bellatrixBeaconBlock2, @@ -587,7 +587,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { }, ).Times(1) - bellatrixProtoBeaconBlock2 := test_helpers.GenerateProtoBellatrixBeaconBlock() + bellatrixProtoBeaconBlock2 := testhelpers.GenerateProtoBellatrixBeaconBlock() bellatrixProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTBellatrixBlockToProto( @@ -686,7 +686,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - capellaBeaconBlock1 := test_helpers.GenerateJsonCapellaBeaconBlock() + capellaBeaconBlock1 := testhelpers.GenerateJsonCapellaBeaconBlock() capellaBeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlockCapella{ Message: capellaBeaconBlock1, @@ -711,7 +711,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { }, ).Times(2) - capellaProtoBeaconBlock1 := test_helpers.GenerateProtoCapellaBeaconBlock() + capellaProtoBeaconBlock1 := testhelpers.GenerateProtoCapellaBeaconBlock() capellaProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTCapellaBlockToProto( @@ -723,7 +723,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - capellaBeaconBlock2 := test_helpers.GenerateJsonCapellaBeaconBlock() + capellaBeaconBlock2 := testhelpers.GenerateJsonCapellaBeaconBlock() capellaBeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlockCapella{ Message: capellaBeaconBlock2, @@ -748,7 +748,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { }, ).Times(1) - capellaProtoBeaconBlock2 := test_helpers.GenerateProtoCapellaBeaconBlock() + capellaProtoBeaconBlock2 := testhelpers.GenerateProtoCapellaBeaconBlock() capellaProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTCapellaBlockToProto( diff --git a/validator/client/beacon-api/submit_aggregate_selection_proof.go b/validator/client/beacon-api/submit_aggregate_selection_proof.go index 2bc7e4230d5a..3aeda87136d6 100644 --- a/validator/client/beacon-api/submit_aggregate_selection_proof.go +++ b/validator/client/beacon-api/submit_aggregate_selection_proof.go @@ -37,7 +37,7 @@ func (c *beaconApiValidatorClient) submitAggregateSelectionProof( return nil, errors.New("validator is not an aggregator") } - attestationData, err := c.getAttestationData(ctx, in.Slot, in.CommitteeIndex) + attestationData, err := c.attestationData(ctx, in.Slot, in.CommitteeIndex) if err != nil { return nil, errors.Wrapf(err, "failed to get attestation data for slot=%d and committee_index=%d", in.Slot, in.CommitteeIndex) } @@ -47,7 +47,7 @@ func (c *beaconApiValidatorClient) submitAggregateSelectionProof( return nil, errors.Wrap(err, "failed to calculate attestation data root") } - aggregateAttestationResponse, err := c.getAggregateAttestation(ctx, in.Slot, attestationDataRoot[:]) + aggregateAttestationResponse, err := c.aggregateAttestation(ctx, in.Slot, attestationDataRoot[:]) if err != nil { return nil, err } @@ -66,7 +66,7 @@ func (c *beaconApiValidatorClient) submitAggregateSelectionProof( }, nil } -func (c *beaconApiValidatorClient) getAggregateAttestation( +func (c *beaconApiValidatorClient) aggregateAttestation( ctx context.Context, slot primitives.Slot, attestationDataRoot []byte, diff --git a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go index 8e20bb0fb25d..5bb60d5aa85a 100644 --- a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go +++ b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go @@ -13,7 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -37,9 +37,9 @@ func TestSubmitAggregateSelectionProof(t *testing.T) { require.NoError(t, err) aggregateAttestation := ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: attestationDataProto, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), } ctrl := gomock.NewController(t) diff --git a/validator/client/beacon-api/submit_signed_aggregate_proof_test.go b/validator/client/beacon-api/submit_signed_aggregate_proof_test.go index f717febf4346..6a8e41668c64 100644 --- a/validator/client/beacon-api/submit_signed_aggregate_proof_test.go +++ b/validator/client/beacon-api/submit_signed_aggregate_proof_test.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -80,24 +80,24 @@ func generateSignedAggregateAndProofJson() *ethpb.SignedAggregateAttestationAndP Message: ðpb.AggregateAttestationAndProof{ AggregatorIndex: 72, Aggregate: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), } } diff --git a/validator/client/beacon-api/submit_signed_contribution_and_proof.go b/validator/client/beacon-api/submit_signed_contribution_and_proof.go index a3ff81fe0c0e..3482702a88a4 100644 --- a/validator/client/beacon-api/submit_signed_contribution_and_proof.go +++ b/validator/client/beacon-api/submit_signed_contribution_and_proof.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) submitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) error { +func (c *beaconApiValidatorClient) submitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) error { if in == nil { return errors.New("signed contribution and proof is nil") } diff --git a/validator/client/beacon-api/subscribe_committee_subnets.go b/validator/client/beacon-api/subscribe_committee_subnets.go index e46cafa4e3b1..aae716826293 100644 --- a/validator/client/beacon-api/subscribe_committee_subnets.go +++ b/validator/client/beacon-api/subscribe_committee_subnets.go @@ -11,7 +11,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) subscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) error { +func (c *beaconApiValidatorClient) subscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) error { if in == nil { return errors.New("committee subnets subscribe request is nil") } diff --git a/validator/client/beacon-api/sync_committee.go b/validator/client/beacon-api/sync_committee.go index fcebba707c71..0e6719604e33 100644 --- a/validator/client/beacon-api/sync_committee.go +++ b/validator/client/beacon-api/sync_committee.go @@ -33,7 +33,7 @@ func (c *beaconApiValidatorClient) submitSyncMessage(ctx context.Context, syncMe return c.jsonRestHandler.Post(ctx, endpoint, nil, bytes.NewBuffer(marshalledJsonSyncCommitteeMessage), nil) } -func (c *beaconApiValidatorClient) getSyncMessageBlockRoot(ctx context.Context) (*ethpb.SyncMessageBlockRootResponse, error) { +func (c *beaconApiValidatorClient) syncMessageBlockRoot(ctx context.Context) (*ethpb.SyncMessageBlockRootResponse, error) { // Get head beacon block root. var resp structs.BlockRootResponse if err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/blocks/head/root", &resp); err != nil { @@ -64,11 +64,11 @@ func (c *beaconApiValidatorClient) getSyncMessageBlockRoot(ctx context.Context) }, nil } -func (c *beaconApiValidatorClient) getSyncCommitteeContribution( +func (c *beaconApiValidatorClient) syncCommitteeContribution( ctx context.Context, req *ethpb.SyncCommitteeContributionRequest, ) (*ethpb.SyncCommitteeContribution, error) { - blockRootResponse, err := c.getSyncMessageBlockRoot(ctx) + blockRootResponse, err := c.syncMessageBlockRoot(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get sync message block root") } @@ -80,23 +80,21 @@ func (c *beaconApiValidatorClient) getSyncCommitteeContribution( params.Add("subcommittee_index", strconv.FormatUint(req.SubnetId, 10)) params.Add("beacon_block_root", blockRoot) - url := buildURL("/eth/v1/validator/sync_committee_contribution", params) - var resp structs.ProduceSyncCommitteeContributionResponse - if err = c.jsonRestHandler.Get(ctx, url, &resp); err != nil { + if err = c.jsonRestHandler.Get(ctx, buildURL("/eth/v1/validator/sync_committee_contribution", params), &resp); err != nil { return nil, err } return convertSyncContributionJsonToProto(resp.Data) } -func (c *beaconApiValidatorClient) getSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { +func (c *beaconApiValidatorClient) syncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { validatorIndexResponse, err := c.validatorIndex(ctx, ðpb.ValidatorIndexRequest{PublicKey: in.PublicKey}) if err != nil { return nil, errors.Wrap(err, "failed to get validator index") } - syncDuties, err := c.dutiesProvider.GetSyncDuties(ctx, slots.ToEpoch(in.Slot), []primitives.ValidatorIndex{validatorIndexResponse.Index}) + syncDuties, err := c.dutiesProvider.SyncDuties(ctx, slots.ToEpoch(in.Slot), []primitives.ValidatorIndex{validatorIndexResponse.Index}) if err != nil { return nil, errors.Wrap(err, "failed to get sync committee duties") } diff --git a/validator/client/beacon-api/sync_committee_selections.go b/validator/client/beacon-api/sync_committee_selections.go index 97163308e950..10e0bc5a0a4c 100644 --- a/validator/client/beacon-api/sync_committee_selections.go +++ b/validator/client/beacon-api/sync_committee_selections.go @@ -13,7 +13,7 @@ type aggregatedSyncSelectionResponse struct { Data []iface.SyncCommitteeSelection `json:"data"` } -func (c *beaconApiValidatorClient) getAggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (c *beaconApiValidatorClient) aggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { body, err := json.Marshal(selections) if err != nil { return nil, errors.Wrap(err, "failed to marshal selections") diff --git a/validator/client/beacon-api/sync_committee_selections_test.go b/validator/client/beacon-api/sync_committee_selections_test.go index 6afc78e5a14c..00a61e8be414 100644 --- a/validator/client/beacon-api/sync_committee_selections_test.go +++ b/validator/client/beacon-api/sync_committee_selections_test.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "go.uber.org/mock/gomock" ) @@ -26,7 +26,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "valid", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -34,7 +34,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { }, res: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -45,7 +45,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "endpoint error", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -58,7 +58,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "no response error", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -70,13 +70,13 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "mismatch response", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, }, { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 78, @@ -84,7 +84,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { }, res: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -117,7 +117,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - res, err := validatorClient.GetAggregatedSyncSelections(ctx, test.req) + res, err := validatorClient.AggregatedSyncSelections(ctx, test.req) if test.expectedErrorMessage != "" { require.ErrorContains(t, test.expectedErrorMessage, err) return diff --git a/validator/client/beacon-api/sync_committee_test.go b/validator/client/beacon-api/sync_committee_test.go index 8888a3c63922..bdb99ab10220 100644 --- a/validator/client/beacon-api/sync_committee_test.go +++ b/validator/client/beacon-api/sync_committee_test.go @@ -55,7 +55,7 @@ func TestSubmitSyncMessage_Valid(t *testing.T) { nil, ).Times(1) - protoSyncCommiteeMessage := ethpb.SyncCommitteeMessage{ + protoSyncCommitteeMessage := ethpb.SyncCommitteeMessage{ Slot: primitives.Slot(42), BlockRoot: decodedBeaconBlockRoot, ValidatorIndex: primitives.ValidatorIndex(12345), @@ -63,7 +63,7 @@ func TestSubmitSyncMessage_Valid(t *testing.T) { } validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - res, err := validatorClient.SubmitSyncMessage(context.Background(), &protoSyncCommiteeMessage) + res, err := validatorClient.SubmitSyncMessage(context.Background(), &protoSyncCommitteeMessage) assert.DeepEqual(t, new(empty.Empty), res) require.NoError(t, err) @@ -150,7 +150,7 @@ func TestGetSyncMessageBlockRoot(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - actualResponse, err := validatorClient.getSyncMessageBlockRoot(ctx) + actualResponse, err := validatorClient.syncMessageBlockRoot(ctx) if test.expectedErrorMessage != "" { require.ErrorContains(t, test.expectedErrorMessage, err) return @@ -236,7 +236,7 @@ func TestGetSyncCommitteeContribution(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - actualResponse, err := validatorClient.getSyncCommitteeContribution(ctx, request) + actualResponse, err := validatorClient.syncCommitteeContribution(ctx, request) if test.expectedErrMsg != "" { require.ErrorContains(t, test.expectedErrMsg, err) return @@ -394,7 +394,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) { jsonRestHandler: jsonRestHandler, }, } - actualResponse, err := validatorClient.getSyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + actualResponse, err := validatorClient.syncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubkey, Slot: slot, }) diff --git a/validator/client/beacon-api/validator_count_test.go b/validator/client/beacon-api/validator_count_test.go index eb2206801a3f..9a243018e2f3 100644 --- a/validator/client/beacon-api/validator_count_test.go +++ b/validator/client/beacon-api/validator_count_test.go @@ -146,7 +146,7 @@ func TestGetValidatorCount(t *testing.T) { jsonRestHandler: jsonRestHandler, } - countResponse, err := client.GetValidatorCount(ctx, "head", []validator.Status{validator.Active}) + countResponse, err := client.ValidatorCount(ctx, "head", []validator.Status{validator.Active}) if len(test.expectedResponse) == 0 { require.ErrorContains(t, test.expectedError, err) diff --git a/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go b/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go index 43e86ad6a7e9..2e74104ce9f1 100644 --- a/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go +++ b/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go @@ -1,4 +1,4 @@ -package validator_client_factory +package beacon_chain_client_factory import ( "github.com/prysmaticlabs/prysm/v5/config/features" diff --git a/validator/client/grpc-api/grpc_beacon_chain_client.go b/validator/client/grpc-api/grpc_beacon_chain_client.go index 9f31a3b57bee..1d575d9e1a50 100644 --- a/validator/client/grpc-api/grpc_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_beacon_chain_client.go @@ -13,27 +13,27 @@ type grpcChainClient struct { beaconChainClient ethpb.BeaconChainClient } -func (c *grpcChainClient) GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { +func (c *grpcChainClient) ChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { return c.beaconChainClient.GetChainHead(ctx, in) } -func (c *grpcChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { +func (c *grpcChainClient) ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { return c.beaconChainClient.ListValidatorBalances(ctx, in) } -func (c *grpcChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { +func (c *grpcChainClient) Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { return c.beaconChainClient.ListValidators(ctx, in) } -func (c *grpcChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { +func (c *grpcChainClient) ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { return c.beaconChainClient.GetValidatorQueue(ctx, in) } -func (c *grpcChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { +func (c *grpcChainClient) ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { return c.beaconChainClient.GetValidatorPerformance(ctx, in) } -func (c *grpcChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { +func (c *grpcChainClient) ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { return c.beaconChainClient.GetValidatorParticipation(ctx, in) } diff --git a/validator/client/grpc-api/grpc_node_client.go b/validator/client/grpc-api/grpc_node_client.go index c19dd4663fd1..54bf320a5087 100644 --- a/validator/client/grpc-api/grpc_node_client.go +++ b/validator/client/grpc-api/grpc_node_client.go @@ -20,19 +20,19 @@ type grpcNodeClient struct { healthTracker *beacon.NodeHealthTracker } -func (c *grpcNodeClient) GetSyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) { +func (c *grpcNodeClient) SyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) { return c.nodeClient.GetSyncStatus(ctx, in) } -func (c *grpcNodeClient) GetGenesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) { +func (c *grpcNodeClient) Genesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) { return c.nodeClient.GetGenesis(ctx, in) } -func (c *grpcNodeClient) GetVersion(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) { +func (c *grpcNodeClient) Version(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) { return c.nodeClient.GetVersion(ctx, in) } -func (c *grpcNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { +func (c *grpcNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { return c.nodeClient.ListPeers(ctx, in) } diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go index be9f40b3a234..5082107af548 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go @@ -22,8 +22,8 @@ type grpcPrysmChainClient struct { chainClient iface.ChainClient } -func (g grpcPrysmChainClient) GetValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { - resp, err := g.chainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) +func (g grpcPrysmChainClient) ValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { + resp, err := g.chainClient.Validators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) if err != nil { return nil, errors.Wrap(err, "list validators failed") } @@ -33,7 +33,7 @@ func (g grpcPrysmChainClient) GetValidatorCount(ctx context.Context, _ string, s vals = append(vals, val.Validator) } - head, err := g.chainClient.GetChainHead(ctx, &empty.Empty{}) + head, err := g.chainClient.ChainHead(ctx, &empty.Empty{}) if err != nil { return nil, errors.Wrap(err, "get chain head") } diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go index d383f6f678d4..bc1f6c1ca26d 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go @@ -83,8 +83,8 @@ func TestGetValidatorCount(t *testing.T) { Slashed: false, }, } - for _, validator := range validators { - require.NoError(t, st.AppendValidator(validator)) + for _, v := range validators { + require.NoError(t, st.AppendValidator(v)) require.NoError(t, st.AppendBalance(params.BeaconConfig().MaxEffectiveBalance)) } @@ -318,7 +318,7 @@ func TestGetValidatorCount(t *testing.T) { require.Equal(t, true, ok) statuses = append(statuses, valStatus) } - vcCountResp, err := prysmBeaconChainClient.GetValidatorCount(context.Background(), "", statuses) + vcCountResp, err := prysmBeaconChainClient.ValidatorCount(context.Background(), "", statuses) require.NoError(t, err) require.DeepEqual(t, test.expectedResponse, vcCountResp) }) diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index 11ca01b0c2ef..da2001965e4a 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -23,7 +23,7 @@ type grpcValidatorClient struct { isEventStreamRunning bool } -func (c *grpcValidatorClient) GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { +func (c *grpcValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { return c.beaconNodeValidatorClient.GetDuties(ctx, in) } @@ -35,27 +35,27 @@ func (c *grpcValidatorClient) DomainData(ctx context.Context, in *ethpb.DomainRe return c.beaconNodeValidatorClient.DomainData(ctx, in) } -func (c *grpcValidatorClient) GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { +func (c *grpcValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { return c.beaconNodeValidatorClient.GetAttestationData(ctx, in) } -func (c *grpcValidatorClient) GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { +func (c *grpcValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { return c.beaconNodeValidatorClient.GetBeaconBlock(ctx, in) } -func (c *grpcValidatorClient) GetFeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { +func (c *grpcValidatorClient) FeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { return c.beaconNodeValidatorClient.GetFeeRecipientByPubKey(ctx, in) } -func (c *grpcValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { +func (c *grpcValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { return c.beaconNodeValidatorClient.GetSyncCommitteeContribution(ctx, in) } -func (c *grpcValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { +func (c *grpcValidatorClient) SyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { return c.beaconNodeValidatorClient.GetSyncMessageBlockRoot(ctx, in) } -func (c *grpcValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { +func (c *grpcValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { return c.beaconNodeValidatorClient.GetSyncSubcommitteeIndex(ctx, in) } @@ -142,11 +142,11 @@ func (c *grpcValidatorClient) AggregatedSigAndAggregationBits( return c.beaconNodeValidatorClient.AggregatedSigAndAggregationBits(ctx, in) } -func (*grpcValidatorClient) GetAggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (*grpcValidatorClient) AggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { return nil, iface.ErrNotSupported } -func (*grpcValidatorClient) GetAggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (*grpcValidatorClient) AggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { return nil, iface.ErrNotSupported } diff --git a/validator/client/iface/BUILD.bazel b/validator/client/iface/BUILD.bazel index 8c58f7d9da44..f94923543641 100644 --- a/validator/client/iface/BUILD.bazel +++ b/validator/client/iface/BUILD.bazel @@ -3,9 +3,9 @@ load("@prysm//tools/go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ - "beacon_chain_client.go", + "chain_client.go", "node_client.go", - "prysm_beacon_chain_client.go", + "prysm_chain_client.go", "validator.go", "validator_client.go", ], diff --git a/validator/client/iface/beacon_chain_client.go b/validator/client/iface/beacon_chain_client.go deleted file mode 100644 index 01ec65c3306b..000000000000 --- a/validator/client/iface/beacon_chain_client.go +++ /dev/null @@ -1,17 +0,0 @@ -package iface - -import ( - "context" - - "github.com/golang/protobuf/ptypes/empty" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" -) - -type ChainClient interface { - GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) - ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) - ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) - GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) - GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) - GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) -} diff --git a/validator/client/iface/chain_client.go b/validator/client/iface/chain_client.go new file mode 100644 index 000000000000..792750bd3640 --- /dev/null +++ b/validator/client/iface/chain_client.go @@ -0,0 +1,17 @@ +package iface + +import ( + "context" + + "github.com/golang/protobuf/ptypes/empty" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +type ChainClient interface { + ChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) + ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) + Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) + ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) + ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) + ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) +} diff --git a/validator/client/iface/node_client.go b/validator/client/iface/node_client.go index 710c74bf26b1..7f6b80d7d737 100644 --- a/validator/client/iface/node_client.go +++ b/validator/client/iface/node_client.go @@ -9,9 +9,9 @@ import ( ) type NodeClient interface { - GetSyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) - GetGenesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) - GetVersion(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) - ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) + SyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) + Genesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) + Version(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) + Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) HealthTracker() *beacon.NodeHealthTracker } diff --git a/validator/client/iface/prysm_beacon_chain_client.go b/validator/client/iface/prysm_chain_client.go similarity index 81% rename from validator/client/iface/prysm_beacon_chain_client.go rename to validator/client/iface/prysm_chain_client.go index 1cb0e2095562..84413f256b77 100644 --- a/validator/client/iface/prysm_beacon_chain_client.go +++ b/validator/client/iface/prysm_chain_client.go @@ -16,5 +16,5 @@ type ValidatorCount struct { // PrysmChainClient defines an interface required to implement all the prysm specific custom endpoints. type PrysmChainClient interface { - GetValidatorCount(context.Context, string, []validator.Status) ([]ValidatorCount, error) + ValidatorCount(context.Context, string, []validator.Status) ([]ValidatorCount, error) } diff --git a/validator/client/iface/validator.go b/validator/client/iface/validator.go index 5d3cb0110453..60757e748718 100644 --- a/validator/client/iface/validator.go +++ b/validator/client/iface/validator.go @@ -64,7 +64,7 @@ type Validator interface { ProcessEvent(event *event.Event) ProposerSettings() *proposer.Settings SetProposerSettings(context.Context, *proposer.Settings) error - GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) + Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) SetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error DeleteGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) error HealthTracker() *beacon.NodeHealthTracker diff --git a/validator/client/iface/validator_client.go b/validator/client/iface/validator_client.go index 2e59a686f489..f22d64e8cfa9 100644 --- a/validator/client/iface/validator_client.go +++ b/validator/client/iface/validator_client.go @@ -26,7 +26,7 @@ type beaconCommitteeSelectionJson struct { ValidatorIndex string `json:"validator_index"` } -func (b BeaconCommitteeSelection) MarshalJSON() ([]byte, error) { +func (b *BeaconCommitteeSelection) MarshalJSON() ([]byte, error) { return json.Marshal(beaconCommitteeSelectionJson{ SelectionProof: hexutil.Encode(b.SelectionProof), Slot: strconv.FormatUint(uint64(b.Slot), 10), @@ -77,7 +77,7 @@ type syncCommitteeSelectionJson struct { ValidatorIndex string `json:"validator_index"` } -func (s SyncCommitteeSelection) MarshalJSON() ([]byte, error) { +func (s *SyncCommitteeSelection) MarshalJSON() ([]byte, error) { return json.Marshal(syncCommitteeSelectionJson{ SelectionProof: hexutil.Encode(s.SelectionProof), Slot: strconv.FormatUint(uint64(s.Slot), 10), @@ -122,34 +122,34 @@ func (s *SyncCommitteeSelection) UnmarshalJSON(input []byte) error { } type ValidatorClient interface { - GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) + Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) DomainData(ctx context.Context, in *ethpb.DomainRequest) (*ethpb.DomainResponse, error) WaitForChainStart(ctx context.Context, in *empty.Empty) (*ethpb.ChainStartResponse, error) WaitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) ValidatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) ValidatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) MultipleValidatorStatus(ctx context.Context, in *ethpb.MultipleValidatorStatusRequest) (*ethpb.MultipleValidatorStatusResponse, error) - GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) + BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) ProposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) PrepareBeaconProposer(ctx context.Context, in *ethpb.PrepareBeaconProposerRequest) (*empty.Empty, error) - GetFeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) - GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) + FeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) + AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) ProposeAttestation(ctx context.Context, in *ethpb.Attestation) (*ethpb.AttestResponse, error) SubmitAggregateSelectionProof(ctx context.Context, in *ethpb.AggregateSelectionRequest, index primitives.ValidatorIndex, committeeLength uint64) (*ethpb.AggregateSelectionResponse, error) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) ProposeExit(ctx context.Context, in *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) SubscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) (*empty.Empty, error) CheckDoppelGanger(ctx context.Context, in *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error) - GetSyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) + SyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) SubmitSyncMessage(ctx context.Context, in *ethpb.SyncCommitteeMessage) (*empty.Empty, error) - GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) - GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) + SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) + SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) SubmitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) (*empty.Empty, error) SubmitValidatorRegistrations(ctx context.Context, in *ethpb.SignedValidatorRegistrationsV1) (*empty.Empty, error) StartEventStream(ctx context.Context, topics []string, eventsChannel chan<- *event.Event) EventStreamIsRunning() bool - GetAggregatedSelections(ctx context.Context, selections []BeaconCommitteeSelection) ([]BeaconCommitteeSelection, error) - GetAggregatedSyncSelections(ctx context.Context, selections []SyncCommitteeSelection) ([]SyncCommitteeSelection, error) + AggregatedSelections(ctx context.Context, selections []BeaconCommitteeSelection) ([]BeaconCommitteeSelection, error) + AggregatedSyncSelections(ctx context.Context, selections []SyncCommitteeSelection) ([]SyncCommitteeSelection, error) Host() string SetHost(host string) } diff --git a/validator/client/key_reload.go b/validator/client/key_reload.go index 777177cff860..abb452071423 100644 --- a/validator/client/key_reload.go +++ b/validator/client/key_reload.go @@ -39,7 +39,7 @@ func (v *validator) HandleKeyReload(ctx context.Context, currentKeys [][fieldpar // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 - valCounts, err := v.prysmChainClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) + valCounts, err := v.prysmChainClient.ValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return false, errors.Wrap(err, "could not get active validator count") } diff --git a/validator/client/metrics.go b/validator/client/metrics.go index b5668c154380..d8ea5f91e852 100644 --- a/validator/client/metrics.go +++ b/validator/client/metrics.go @@ -67,16 +67,6 @@ var ( "pubkey", }, ) - // ValidatorProposeFailVecSlasher used to count failed proposals by slashing protection. - ValidatorProposeFailVecSlasher = promauto.NewCounterVec( - prometheus.CounterOpts{ - Name: "validator_proposals_rejected_total", - Help: "Count the block proposals rejected by slashing protection.", - }, - []string{ - "pubkey", - }, - ) // ValidatorBalancesGaugeVec used to keep track of validator balances by public key. ValidatorBalancesGaugeVec = promauto.NewGaugeVec( prometheus.GaugeOpts{ @@ -158,16 +148,6 @@ var ( "pubkey", }, ) - // ValidatorAttestFailVecSlasher used to count failed attestations by slashing protection. - ValidatorAttestFailVecSlasher = promauto.NewCounterVec( - prometheus.CounterOpts{ - Name: "validator_attestations_rejected_total", - Help: "Count the attestations rejected by slashing protection.", - }, - []string{ - "pubkey", - }, - ) // ValidatorNextAttestationSlotGaugeVec used to track validator statuses by public key. ValidatorNextAttestationSlotGaugeVec = promauto.NewGaugeVec( prometheus.GaugeOpts{ @@ -195,7 +175,7 @@ var ( prometheus.GaugeOpts{ Namespace: "validator", Name: "in_sync_committee", - Help: "validator sync committee.New in Altair hardfork", + Help: "validator sync committee.New in Altair hard fork", }, []string{ "pubkey", @@ -206,7 +186,7 @@ var ( prometheus.GaugeOpts{ Namespace: "validator", Name: "in_next_sync_committee", - Help: "validator next sync committee. New in Altair hardfork", + Help: "validator next sync committee. New in Altair hard fork", }, []string{ "pubkey", @@ -217,7 +197,7 @@ var ( prometheus.GaugeOpts{ Namespace: "validator", Name: "inactivity_score", - Help: "Validator inactivity score. 0 is optimum number. New in Altair hardfork", + Help: "Validator inactivity score. 0 is optimum number. New in Altair hard fork", }, []string{ "pubkey", @@ -249,7 +229,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot primiti req := ðpb.ValidatorPerformanceRequest{ PublicKeys: pubKeys, } - resp, err := v.chainClient.GetValidatorPerformance(ctx, req) + resp, err := v.chainClient.ValidatorPerformance(ctx, req) if err != nil { return err } diff --git a/validator/client/node-client-factory/node_client_factory.go b/validator/client/node-client-factory/node_client_factory.go index f2c871a8e1b0..c431fb0f6ee8 100644 --- a/validator/client/node-client-factory/node_client_factory.go +++ b/validator/client/node-client-factory/node_client_factory.go @@ -1,4 +1,4 @@ -package validator_client_factory +package node_client_factory import ( "github.com/prysmaticlabs/prysm/v5/config/features" diff --git a/validator/client/propose.go b/validator/client/propose.go index 3d70c42fb1a6..4e546a419ce6 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -70,7 +70,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK return } - g, err := v.GetGraffiti(ctx, pubKey) + g, err := v.Graffiti(ctx, pubKey) if err != nil { // Graffiti is not a critical enough to fail block production and cause // validator to miss block reward. When failed, validator should continue @@ -79,7 +79,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK } // Request block from beacon node - b, err := v.validatorClient.GetBeaconBlock(ctx, ðpb.BlockRequest{ + b, err := v.validatorClient.BeaconBlock(ctx, ðpb.BlockRequest{ Slot: slot, RandaoReveal: randaoReveal, Graffiti: g, @@ -148,6 +148,8 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK log.WithError(err).Error("Failed to build generic signed block") return } + default: + log.Errorf("Unsupported block version %s", version.String(blk.Version())) } } else { genericSignedBlock, err = blk.PbGenericBlock() @@ -426,8 +428,8 @@ func signVoluntaryExit( return sig.Marshal(), nil } -// GetGraffiti gets the graffiti from cli or file for the validator public key. -func (v *validator) GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +// Graffiti gets the graffiti from cli or file for the validator public key. +func (v *validator) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { if v.proposerSettings != nil { // Check proposer settings for specific key first if v.proposerSettings.ProposeConfig != nil { diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index ac27dac94bea..ab75d9ec2013 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -199,7 +199,7 @@ func TestProposeBlock_RequestBlockFailed(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(nil /*response*/, errors.New("uh oh")) @@ -255,7 +255,7 @@ func TestProposeBlock_ProposeBlockFailed(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(tt.block, nil /*err*/) @@ -294,16 +294,16 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { block0, block1 := util.NewBeaconBlock(), util.NewBeaconBlock() block1.Block.Body.Graffiti = blockGraffiti[:] - var blocks []*ethpb.GenericBeaconBlock + var bs []*ethpb.GenericBeaconBlock for _, block := range []*ethpb.SignedBeaconBlock{block0, block1} { block.Block.Slot = slot - blocks = append(blocks, ðpb.GenericBeaconBlock{ + bs = append(bs, ðpb.GenericBeaconBlock{ Block: ðpb.GenericBeaconBlock_Phase0{ Phase0: block.Block, }, }) } - return blocks + return bs }(), }, { @@ -312,16 +312,16 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { block0, block1 := util.NewBeaconBlockAltair(), util.NewBeaconBlockAltair() block1.Block.Body.Graffiti = blockGraffiti[:] - var blocks []*ethpb.GenericBeaconBlock + var bs []*ethpb.GenericBeaconBlock for _, block := range []*ethpb.SignedBeaconBlockAltair{block0, block1} { block.Block.Slot = slot - blocks = append(blocks, ðpb.GenericBeaconBlock{ + bs = append(bs, ðpb.GenericBeaconBlock{ Block: ðpb.GenericBeaconBlock_Altair{ Altair: block.Block, }, }) } - return blocks + return bs }(), }, { @@ -330,16 +330,16 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { block0, block1 := util.NewBeaconBlockBellatrix(), util.NewBeaconBlockBellatrix() block1.Block.Body.Graffiti = blockGraffiti[:] - var blocks []*ethpb.GenericBeaconBlock + var bs []*ethpb.GenericBeaconBlock for _, block := range []*ethpb.SignedBeaconBlockBellatrix{block0, block1} { block.Block.Slot = slot - blocks = append(blocks, ðpb.GenericBeaconBlock{ + bs = append(bs, ðpb.GenericBeaconBlock{ Block: ðpb.GenericBeaconBlock_Bellatrix{ Bellatrix: block.Block, }, }) } - return blocks + return bs }(), }, } @@ -362,12 +362,12 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { gomock.Any(), // epoch ).Times(1).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(tt.blocks[0], nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(tt.blocks[1], nil /*err*/) @@ -414,7 +414,7 @@ func TestProposeBlock_BlocksDoubleProposal_After54KEpochs(t *testing.T) { testBlock := util.NewBeaconBlock() farFuture := params.BeaconConfig().SlotsPerEpoch.Mul(uint64(params.BeaconConfig().WeakSubjectivityPeriod + 9)) testBlock.Block.Slot = farFuture - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -428,7 +428,7 @@ func TestProposeBlock_BlocksDoubleProposal_After54KEpochs(t *testing.T) { var blockGraffiti [32]byte copy(blockGraffiti[:], "someothergraffiti") secondTestBlock.Block.Body.Graffiti = blockGraffiti[:] - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -491,7 +491,7 @@ func TestProposeBlock_AllowsOrNotPastProposals(t *testing.T) { blk := util.NewBeaconBlock() blk.Block.Slot = slot - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -520,7 +520,7 @@ func TestProposeBlock_AllowsOrNotPastProposals(t *testing.T) { blk2 := util.NewBeaconBlock() blk2.Block.Slot = tt.pastSlot - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).Return(ðpb.GenericBeaconBlock{ @@ -683,7 +683,7 @@ func testProposeBlock(t *testing.T, graffiti []byte) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetBeaconBlock( + m.validatorClient.EXPECT().BeaconBlock( gomock.Any(), // ctx gomock.AssignableToTypeOf(ðpb.BlockRequest{}), ).DoAndReturn(func(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { @@ -1081,7 +1081,7 @@ func TestGetGraffiti_Ok(t *testing.T) { ValidatorIndex(gomock.Any(), ðpb.ValidatorIndexRequest{PublicKey: pubKey[:]}). Return(ðpb.ValidatorIndexResponse{Index: 2}, nil) } - got, err := tt.v.GetGraffiti(context.Background(), pubKey) + got, err := tt.v.Graffiti(context.Background(), pubKey) require.NoError(t, err) require.DeepEqual(t, tt.want, got) }) @@ -1111,7 +1111,7 @@ func TestGetGraffitiOrdered_Ok(t *testing.T) { }, } for _, want := range [][]byte{bytesutil.PadTo([]byte{'a'}, 32), bytesutil.PadTo([]byte{'b'}, 32), bytesutil.PadTo([]byte{'c'}, 32), bytesutil.PadTo([]byte{'d'}, 32), bytesutil.PadTo([]byte{'d'}, 32)} { - got, err := v.GetGraffiti(context.Background(), pubKey) + got, err := v.Graffiti(context.Background(), pubKey) require.NoError(t, err) require.DeepEqual(t, want, got) } diff --git a/validator/client/runner_test.go b/validator/client/runner_test.go index 3b4aedbb8d5e..dffadbabcc82 100644 --- a/validator/client/runner_test.go +++ b/validator/client/runner_test.go @@ -372,14 +372,14 @@ func TestUpdateProposerSettingsAt_EpochEndOk(t *testing.T) { } func TestUpdateProposerSettings_ContinuesAfterValidatorRegistrationFails(t *testing.T) { - errSomeotherError := errors.New("some internal error") + errSomeOtherError := errors.New("some internal error") ctrl := gomock.NewController(t) defer ctrl.Finish() node := healthTesting.NewMockHealthClient(ctrl) tracker := beacon.NewNodeHealthTracker(node) node.EXPECT().IsHealthy(gomock.Any()).Return(true).AnyTimes() v := &testutil.FakeValidator{ - ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeotherError.Error()), + ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeOtherError.Error()), Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker, } diff --git a/validator/client/service.go b/validator/client/service.go index a7bd4408c202..31c039cf5219 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -24,8 +24,8 @@ import ( beaconApi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" beaconChainClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-chain-client-factory" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - nodeClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" - validatorClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" + nodeclientfactory "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" + validatorclientfactory "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" "github.com/prysmaticlabs/prysm/v5/validator/db" "github.com/prysmaticlabs/prysm/v5/validator/graffiti" validatorHelpers "github.com/prysmaticlabs/prysm/v5/validator/helpers" @@ -177,7 +177,7 @@ func (v *ValidatorService) Start() { hosts[0], ) - validatorClient := validatorClientFactory.NewValidatorClient(v.conn, restHandler) + validatorClient := validatorclientfactory.NewValidatorClient(v.conn, restHandler) valStruct := &validator{ slotFeed: new(event.Feed), @@ -195,7 +195,7 @@ func (v *ValidatorService) Start() { currentHostIndex: 0, validatorClient: validatorClient, chainClient: beaconChainClientFactory.NewChainClient(v.conn, restHandler), - nodeClient: nodeClientFactory.NewNodeClient(v.conn, restHandler), + nodeClient: nodeclientfactory.NewNodeClient(v.conn, restHandler), prysmChainClient: beaconChainClientFactory.NewPrysmChainClient(v.conn, restHandler), db: v.db, km: nil, @@ -270,7 +270,7 @@ func (v *ValidatorService) SetProposerSettings(ctx context.Context, settings *pr v.proposerSettings = settings // passes settings down to be updated in database and saved in memory. - // updates to validator porposer settings will be in the validator object and not validator service. + // updates to validator proposer settings will be in the validator object and not validator service. return v.validator.SetProposerSettings(ctx, settings) } @@ -328,11 +328,11 @@ func ConstructDialOptions( return dialOpts } -func (v *ValidatorService) GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +func (v *ValidatorService) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { if v.validator == nil { return nil, errors.New("validator is unavailable") } - return v.validator.GetGraffiti(ctx, pubKey) + return v.validator.Graffiti(ctx, pubKey) } func (v *ValidatorService) SetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error { diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index bea78e5e110a..bbb4c93a85e6 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -33,7 +33,7 @@ func (v *validator) SubmitSyncCommitteeMessage(ctx context.Context, slot primiti v.waitOneThirdOrValidBlock(ctx, slot) - res, err := v.validatorClient.GetSyncMessageBlockRoot(ctx, &emptypb.Empty{}) + res, err := v.validatorClient.SyncMessageBlockRoot(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Error("Could not request sync message block root to sign") tracing.AnnotateError(span, err) @@ -107,7 +107,7 @@ func (v *validator) SubmitSignedContributionAndProof(ctx context.Context, slot p return } - indexRes, err := v.validatorClient.GetSyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + indexRes, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubKey[:], Slot: slot, }) @@ -139,7 +139,7 @@ func (v *validator) SubmitSignedContributionAndProof(ctx context.Context, slot p } subCommitteeSize := params.BeaconConfig().SyncCommitteeSize / params.BeaconConfig().SyncCommitteeSubnetCount subnet := uint64(comIdx) / subCommitteeSize - contribution, err := v.validatorClient.GetSyncCommitteeContribution(ctx, ðpb.SyncCommitteeContributionRequest{ + contribution, err := v.validatorClient.SyncCommitteeContribution(ctx, ðpb.SyncCommitteeContributionRequest{ Slot: slot, PublicKey: pubKey[:], SubnetId: subnet, @@ -216,7 +216,7 @@ func (v *validator) selectionProofs(ctx context.Context, slot primitives.Slot, p // Override selection proofs with aggregated ones if the node is part of a Distributed Validator. if v.distributed && len(selections) > 0 { var err error - selections, err := v.validatorClient.GetAggregatedSyncSelections(ctx, selections) + selections, err := v.validatorClient.AggregatedSyncSelections(ctx, selections) if err != nil { return nil, errors.Wrap(err, "failed to get aggregated sync selections") } diff --git a/validator/client/sync_committee_test.go b/validator/client/sync_committee_test.go index 83bf6038eb87..175c4ee06da6 100644 --- a/validator/client/sync_committee_test.go +++ b/validator/client/sync_committee_test.go @@ -28,7 +28,7 @@ func TestSubmitSyncCommitteeMessage_ValidatorDutiesRequestFailure(t *testing.T) validator.duties = ðpb.DutiesResponse{CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{}} defer finish() - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -60,7 +60,7 @@ func TestSubmitSyncCommitteeMessage_BadDomainData(t *testing.T) { }} r := []byte{'a'} - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -96,7 +96,7 @@ func TestSubmitSyncCommitteeMessage_CouldNotSubmit(t *testing.T) { }} r := []byte{'a'} - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -141,7 +141,7 @@ func TestSubmitSyncCommitteeMessage_OK(t *testing.T) { }} r := []byte{'a'} - m.validatorClient.EXPECT().GetSyncMessageBlockRoot( + m.validatorClient.EXPECT().SyncMessageBlockRoot( gomock.Any(), // ctx &emptypb.Empty{}, ).Return(ðpb.SyncMessageBlockRootResponse{ @@ -191,7 +191,7 @@ func TestSubmitSignedContributionAndProof_ValidatorDutiesRequestFailure(t *testi } } -func TestSubmitSignedContributionAndProof_GetSyncSubcommitteeIndexFailure(t *testing.T) { +func TestSubmitSignedContributionAndProof_SyncSubcommitteeIndexFailure(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { hook := logTest.NewGlobal() @@ -209,7 +209,7 @@ func TestSubmitSignedContributionAndProof_GetSyncSubcommitteeIndexFailure(t *tes var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -241,7 +241,7 @@ func TestSubmitSignedContributionAndProof_NothingToDo(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -273,7 +273,7 @@ func TestSubmitSignedContributionAndProof_BadDomain(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -319,7 +319,7 @@ func TestSubmitSignedContributionAndProof_CouldNotGetContribution(t *testing.T) var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -334,7 +334,7 @@ func TestSubmitSignedContributionAndProof_CouldNotGetContribution(t *testing.T) SignatureDomain: make([]byte, 32), }, nil) - m.validatorClient.EXPECT().GetSyncCommitteeContribution( + m.validatorClient.EXPECT().SyncCommitteeContribution( gomock.Any(), // ctx ðpb.SyncCommitteeContributionRequest{ Slot: 1, @@ -373,7 +373,7 @@ func TestSubmitSignedContributionAndProof_CouldNotSubmitContribution(t *testing. var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -390,7 +390,7 @@ func TestSubmitSignedContributionAndProof_CouldNotSubmitContribution(t *testing. aggBits := bitfield.NewBitvector128() aggBits.SetBitAt(0, true) - m.validatorClient.EXPECT().GetSyncCommitteeContribution( + m.validatorClient.EXPECT().SyncCommitteeContribution( gomock.Any(), // ctx ðpb.SyncCommitteeContributionRequest{ Slot: 1, @@ -455,7 +455,7 @@ func TestSubmitSignedContributionAndProof_Ok(t *testing.T) { var pubKey [fieldparams.BLSPubkeyLength]byte copy(pubKey[:], validatorKey.PublicKey().Marshal()) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ Slot: 1, @@ -472,7 +472,7 @@ func TestSubmitSignedContributionAndProof_Ok(t *testing.T) { aggBits := bitfield.NewBitvector128() aggBits.SetBitAt(0, true) - m.validatorClient.EXPECT().GetSyncCommitteeContribution( + m.validatorClient.EXPECT().SyncCommitteeContribution( gomock.Any(), // ctx ðpb.SyncCommitteeContributionRequest{ Slot: 1, diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index 93f015bfd473..883206d8ea0a 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -254,7 +254,7 @@ func (*FakeValidator) HasProposerSettings() bool { } // PushProposerSettings for mocking -func (fv *FakeValidator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, deadline time.Time) error { +func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, _ primitives.Slot, deadline time.Time) error { nctx, cancel := context.WithDeadline(ctx, deadline) ctx = nctx defer cancel() @@ -294,8 +294,8 @@ func (fv *FakeValidator) SetProposerSettings(_ context.Context, settings *propos return nil } -// GetGraffiti for mocking -func (fv *FakeValidator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +// Graffiti for mocking +func (fv *FakeValidator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { return []byte(fv.graffiti), nil } diff --git a/validator/client/validator.go b/validator/client/validator.go index 4bb0d1b4ab0a..679bde17ba15 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -39,7 +39,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" accountsiface "github.com/prysmaticlabs/prysm/v5/validator/accounts/iface" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" - beacon_api "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" + beaconapi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/db" dbCommon "github.com/prysmaticlabs/prysm/v5/validator/db/common" @@ -134,7 +134,7 @@ func (v *validator) Done() { v.ticker.Done() } -// WaitForKmInitialization checks if the validator needs to wait for keymanager initialization. +// WaitForKeymanagerInitialization checks if the validator needs to wait for keymanager initialization. func (v *validator) WaitForKeymanagerInitialization(ctx context.Context) error { genesisRoot, err := v.db.GenesisValidatorsRoot(ctx) if err != nil { @@ -257,7 +257,7 @@ func (v *validator) WaitForChainStart(ctx context.Context) error { return client.ErrConnectionIssue } - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.Wrap(ctx.Err(), "context has been canceled so shutting down the loop") } @@ -314,7 +314,7 @@ func (v *validator) WaitForSync(ctx context.Context) error { ctx, span := trace.StartSpan(ctx, "validator.WaitForSync") defer span.End() - s, err := v.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + s, err := v.nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if err != nil { return errors.Wrap(client.ErrConnectionIssue, errors.Wrap(err, "could not get sync status").Error()) } @@ -326,7 +326,7 @@ func (v *validator) WaitForSync(ctx context.Context) error { select { // Poll every half slot. case <-time.After(slots.DivideSlotBy(2 /* twice per slot */)): - s, err := v.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + s, err := v.nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if err != nil { return errors.Wrap(client.ErrConnectionIssue, errors.Wrap(err, "could not get sync status").Error()) } @@ -343,48 +343,48 @@ func (v *validator) WaitForSync(ctx context.Context) error { func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, activeValCount int64) bool { nonexistentIndex := primitives.ValidatorIndex(^uint64(0)) var validatorActivated bool - for _, status := range statuses { + for _, s := range statuses { fields := logrus.Fields{ - "pubkey": fmt.Sprintf("%#x", bytesutil.Trunc(status.publicKey)), - "status": status.status.Status.String(), + "pubkey": fmt.Sprintf("%#x", bytesutil.Trunc(s.publicKey)), + "status": s.status.Status.String(), } - if status.index != nonexistentIndex { - fields["validatorIndex"] = status.index + if s.index != nonexistentIndex { + fields["validatorIndex"] = s.index } log := log.WithFields(fields) if v.emitAccountMetrics { - fmtKey := fmt.Sprintf("%#x", status.publicKey) - ValidatorStatusesGaugeVec.WithLabelValues(fmtKey).Set(float64(status.status.Status)) + fmtKey := fmt.Sprintf("%#x", s.publicKey) + ValidatorStatusesGaugeVec.WithLabelValues(fmtKey).Set(float64(s.status.Status)) } - switch status.status.Status { + switch s.status.Status { case ethpb.ValidatorStatus_UNKNOWN_STATUS: log.Info("Waiting for deposit to be observed by beacon node") case ethpb.ValidatorStatus_DEPOSITED: - if status.status.PositionInActivationQueue != 0 { + if s.status.PositionInActivationQueue != 0 { log.WithField( - "positionInActivationQueue", status.status.PositionInActivationQueue, + "positionInActivationQueue", s.status.PositionInActivationQueue, ).Info("Deposit processed, entering activation queue after finalization") } case ethpb.ValidatorStatus_PENDING: - if activeValCount >= 0 && status.status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch { + if activeValCount >= 0 && s.status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch { activationsPerEpoch := uint64(math.Max(float64(params.BeaconConfig().MinPerEpochChurnLimit), float64(uint64(activeValCount)/params.BeaconConfig().ChurnLimitQuotient))) secondsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) expectedWaitingTime := - time.Duration((status.status.PositionInActivationQueue+activationsPerEpoch)/activationsPerEpoch*secondsPerEpoch) * time.Second + time.Duration((s.status.PositionInActivationQueue+activationsPerEpoch)/activationsPerEpoch*secondsPerEpoch) * time.Second log.WithFields(logrus.Fields{ - "positionInActivationQueue": status.status.PositionInActivationQueue, + "positionInActivationQueue": s.status.PositionInActivationQueue, "expectedWaitingTime": expectedWaitingTime.String(), }).Info("Waiting to be assigned activation epoch") - } else if status.status.ActivationEpoch != params.BeaconConfig().FarFutureEpoch { + } else if s.status.ActivationEpoch != params.BeaconConfig().FarFutureEpoch { log.WithFields(logrus.Fields{ - "activationEpoch": status.status.ActivationEpoch, + "activationEpoch": s.status.ActivationEpoch, }).Info("Waiting for activation") } case ethpb.ValidatorStatus_ACTIVE, ethpb.ValidatorStatus_EXITING: validatorActivated = true log.WithFields(logrus.Fields{ - "index": status.index, + "index": s.index, }).Info("Validator activated") case ethpb.ValidatorStatus_EXITED: log.Info("Validator exited") @@ -392,7 +392,7 @@ func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, acti log.Warn("Invalid Eth1 deposit") default: log.WithFields(logrus.Fields{ - "activationEpoch": status.status.ActivationEpoch, + "activationEpoch": s.status.ActivationEpoch, }).Info("Validator status") } } @@ -404,7 +404,7 @@ func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, acti func (v *validator) CanonicalHeadSlot(ctx context.Context) (primitives.Slot, error) { ctx, span := trace.StartSpan(ctx, "validator.CanonicalHeadSlot") defer span.End() - head, err := v.chainClient.GetChainHead(ctx, &emptypb.Empty{}) + head, err := v.chainClient.ChainHead(ctx, &emptypb.Empty{}) if err != nil { return 0, errors.Wrap(client.ErrConnectionIssue, err.Error()) } @@ -560,7 +560,7 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro } // If duties is nil it means we have had no prior duties and just started up. - resp, err := v.validatorClient.GetDuties(ctx, req) + resp, err := v.validatorClient.Duties(ctx, req) if err != nil { v.dutiesLock.Lock() v.duties = nil // Clear assignments so we know to retry the request. @@ -611,7 +611,7 @@ func (v *validator) subscribeToSubnets(ctx context.Context, duties *ethpb.Duties if v.distributed { // Get aggregated selection proofs to calculate isAggregator. - if err := v.getAggregatedSelectionProofs(ctx, duties); err != nil { + if err := v.aggregatedSelectionProofs(ctx, duties); err != nil { return errors.Wrap(err, "could not get aggregated selection proofs") } } @@ -779,7 +779,7 @@ func (v *validator) isAggregator( err error ) if v.distributed { - slotSig, err = v.getAttSelection(attSelectionKey{slot: slot, index: validatorIndex}) + slotSig, err = v.attSelection(attSelectionKey{slot: slot, index: validatorIndex}) if err != nil { return false, err } @@ -804,7 +804,7 @@ func (v *validator) isAggregator( // modulo = max(1, SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT // TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE) // return bytes_to_uint64(hash(signature)[0:8]) % modulo == 0 func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte, validatorIndex primitives.ValidatorIndex) (bool, error) { - res, err := v.validatorClient.GetSyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + res, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubKey[:], Slot: slot, }) @@ -831,7 +831,7 @@ func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitiv // Override selections with aggregated ones if the node is part of a Distributed Validator. if v.distributed && len(selections) > 0 { - selections, err = v.validatorClient.GetAggregatedSyncSelections(ctx, selections) + selections, err = v.validatorClient.AggregatedSyncSelections(ctx, selections) if err != nil { return false, errors.Wrap(err, "failed to get aggregated sync selections") } @@ -1156,19 +1156,19 @@ func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fie if err != nil { return nil, err } - for i, status := range resp.Statuses { + for i, s := range resp.Statuses { currEpoch := primitives.Epoch(slot / params.BeaconConfig().SlotsPerEpoch) - currActivating := status.Status == ethpb.ValidatorStatus_PENDING && currEpoch >= status.ActivationEpoch + currActivating := s.Status == ethpb.ValidatorStatus_PENDING && currEpoch >= s.ActivationEpoch - active := status.Status == ethpb.ValidatorStatus_ACTIVE - exiting := status.Status == ethpb.ValidatorStatus_EXITING + active := s.Status == ethpb.ValidatorStatus_ACTIVE + exiting := s.Status == ethpb.ValidatorStatus_EXITING if currActivating || active || exiting { filteredKeys = append(filteredKeys, bytesutil.ToBytes48(resp.PublicKeys[i])) } else { log.WithFields(logrus.Fields{ "pubkey": hexutil.Encode(resp.PublicKeys[i]), - "status": status.Status.String(), + "status": s.Status.String(), }).Debugf("Skipping non-active status key.") } } @@ -1304,7 +1304,7 @@ func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSP "Perhaps the validator is not yet active.", pubkey) return 0, false, nil case err != nil: - notFoundErr := &beacon_api.IndexNotFoundError{} + notFoundErr := &beaconapi.IndexNotFoundError{} if errors.As(err, ¬FoundErr) { log.Debugf("Could not find validator index for public key %#x. "+ "Perhaps the validator is not yet active.", pubkey) @@ -1315,7 +1315,7 @@ func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSP return resp.Index, true, nil } -func (v *validator) getAggregatedSelectionProofs(ctx context.Context, duties *ethpb.DutiesResponse) error { +func (v *validator) aggregatedSelectionProofs(ctx context.Context, duties *ethpb.DutiesResponse) error { // Create new instance of attestation selections map. v.newAttSelections() @@ -1356,7 +1356,7 @@ func (v *validator) getAggregatedSelectionProofs(ctx context.Context, duties *et }) } - resp, err := v.validatorClient.GetAggregatedSelections(ctx, req) + resp, err := v.validatorClient.AggregatedSelections(ctx, req) if err != nil { return err } @@ -1386,7 +1386,7 @@ func (v *validator) newAttSelections() { v.attSelections = make(map[attSelectionKey]iface.BeaconCommitteeSelection) } -func (v *validator) getAttSelection(key attSelectionKey) ([]byte, error) { +func (v *validator) attSelection(key attSelectionKey) ([]byte, error) { v.attSelectionLock.Lock() defer v.attSelectionLock.Unlock() diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 884606bd1d52..f71b9580a9c9 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -103,7 +103,7 @@ func (m *mockKeymanager) add(pairs ...keypair) error { return nil } -func (m *mockKeymanager) FetchValidatingPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) { +func (m *mockKeymanager) FetchValidatingPublicKeys(_ context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) { m.lock.RLock() defer m.lock.RUnlock() if m.fetchNoKeys { @@ -385,7 +385,7 @@ func TestWaitSync_ContextCanceled(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: true}, nil) @@ -402,7 +402,7 @@ func TestWaitSync_NotSyncing(t *testing.T) { nodeClient: n, } - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: false}, nil) @@ -419,12 +419,12 @@ func TestWaitSync_Syncing(t *testing.T) { nodeClient: n, } - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: true}, nil) - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: false}, nil) @@ -450,7 +450,7 @@ func TestUpdateDuties_DoesNothingWhenNotEpochStart_AlreadyExistingAssignments(t }, }, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Times(0) @@ -477,7 +477,7 @@ func TestUpdateDuties_ReturnsError(t *testing.T) { expected := errors.New("bad") - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(nil, expected) @@ -508,7 +508,7 @@ func TestUpdateDuties_OK(t *testing.T) { km: newMockKeymanager(t, randKeypair(t)), validatorClient: client, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -557,7 +557,7 @@ func TestUpdateDuties_OK_FilterBlacklistedPublicKeys(t *testing.T) { resp := ðpb.DutiesResponse{ CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{}, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -614,7 +614,7 @@ func TestUpdateDuties_AllValidatorsExited(t *testing.T) { km: newMockKeymanager(t, randKeypair(t)), validatorClient: client, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -661,7 +661,7 @@ func TestUpdateDuties_Distributed(t *testing.T) { sigDomain := make([]byte, 32) - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -674,7 +674,7 @@ func TestUpdateDuties_Distributed(t *testing.T) { nil, /*err*/ ).Times(2) - client.EXPECT().GetAggregatedSelections( + client.EXPECT().AggregatedSelections( gomock.Any(), gomock.Any(), // fill this properly ).Return( @@ -740,7 +740,7 @@ func TestRolesAt_OK(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -775,7 +775,7 @@ func TestRolesAt_OK(t *testing.T) { }, } - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1250,7 +1250,7 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) { slot := primitives.Slot(1) pubKey := validatorKey.PublicKey().Marshal() - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1271,7 +1271,7 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1297,7 +1297,7 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { slot := primitives.Slot(1) pubKey := validatorKey.PublicKey().Marshal() - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1318,7 +1318,7 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/).Times(2) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1335,7 +1335,7 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { ValidatorIndex: 123, SubcommitteeIndex: 0, } - m.validatorClient.EXPECT().GetAggregatedSyncSelections( + m.validatorClient.EXPECT().AggregatedSyncSelections( gomock.Any(), // ctx []iface.SyncCommitteeSelection{selection}, ).Return([]iface.SyncCommitteeSelection{selection}, nil) @@ -2031,7 +2031,7 @@ func TestValidator_PushSettings(t *testing.T) { } } -func getPubkeyFromString(t *testing.T, stringPubkey string) [fieldparams.BLSPubkeyLength]byte { +func pubkeyFromString(t *testing.T, stringPubkey string) [fieldparams.BLSPubkeyLength]byte { pubkeyTemp, err := hexutil.Decode(stringPubkey) require.NoError(t, err) @@ -2041,7 +2041,7 @@ func getPubkeyFromString(t *testing.T, stringPubkey string) [fieldparams.BLSPubk return pubkey } -func getFeeRecipientFromString(t *testing.T, stringFeeRecipient string) common.Address { +func feeRecipientFromString(t *testing.T, stringFeeRecipient string) common.Address { feeRecipientTemp, err := hexutil.Decode(stringFeeRecipient) require.NoError(t, err) @@ -2058,15 +2058,15 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { // pubkey4 => Nothing (already in `v.validatorIndex`) // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") - pubkey4 := getPubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey4 := pubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x1111111111111111111111111111111111111111") - feeRecipient2 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient3 := getFeeRecipientFromString(t, "0x3333333333333333333333333333333333333333") + feeRecipient1 := feeRecipientFromString(t, "0x1111111111111111111111111111111111111111") + feeRecipient2 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient3 := feeRecipientFromString(t, "0x3333333333333333333333333333333333333333") feeRecipient4 := common.Address{} ctrl := gomock.NewController(t) @@ -2164,22 +2164,22 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { // pubkey8 => feeRecipient8 - Status: exiting (already in `v.validatorIndex`) // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") - pubkey4 := getPubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") - pubkey5 := getPubkeyFromString(t, "0x555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555") - pubkey6 := getPubkeyFromString(t, "0x666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") - pubkey7 := getPubkeyFromString(t, "0x777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777") - pubkey8 := getPubkeyFromString(t, "0x888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey4 := pubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") + pubkey5 := pubkeyFromString(t, "0x555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555") + pubkey6 := pubkeyFromString(t, "0x666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") + pubkey7 := pubkeyFromString(t, "0x777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777") + pubkey8 := pubkeyFromString(t, "0x888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x1111111111111111111111111111111111111111") - feeRecipient2 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient3 := getFeeRecipientFromString(t, "0x3333333333333333333333333333333333333333") - feeRecipient8 := getFeeRecipientFromString(t, "0x8888888888888888888888888888888888888888") + feeRecipient1 := feeRecipientFromString(t, "0x1111111111111111111111111111111111111111") + feeRecipient2 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient3 := feeRecipientFromString(t, "0x3333333333333333333333333333333333333333") + feeRecipient8 := feeRecipientFromString(t, "0x8888888888888888888888888888888888888888") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") pubkeyToStatus := map[[fieldparams.BLSPubkeyLength]byte]ethpb.ValidatorStatus{ pubkey1: ethpb.ValidatorStatus_ACTIVE, @@ -2327,15 +2327,15 @@ func TestValidator_buildSignedRegReqs_DefaultConfigDisabled(t *testing.T) { // pubkey3 => Nothing, builder enabled // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient2 := getFeeRecipientFromString(t, "0x2222222222222222222222222222222222222222") + feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient2 := feeRecipientFromString(t, "0x2222222222222222222222222222222222222222") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -2412,15 +2412,15 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { // pubkey3 => Nothing, builder enabled // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient2 := getFeeRecipientFromString(t, "0x2222222222222222222222222222222222222222") + feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient2 := feeRecipientFromString(t, "0x2222222222222222222222222222222222222222") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -2498,10 +2498,10 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) { // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") // Fee recipients - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -2537,12 +2537,12 @@ func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) { func TestValidator_buildSignedRegReqs_TimestampBeforeGenesis(t *testing.T) { // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index d4a61153d5f8..0c2f6b5f417c 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -96,7 +96,7 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang break } // If context is canceled we return from the function. - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.Wrap(ctx.Err(), "context has been canceled so shutting down the loop") } if err != nil { @@ -120,7 +120,7 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 - valCounts, err := v.prysmChainClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) + valCounts, err := v.prysmChainClient.ValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return errors.Wrap(err, "could not get active validator count") } diff --git a/validator/rpc/handlers_accounts_test.go b/validator/rpc/handlers_accounts_test.go index a011ab9ee80f..42f93b402dcd 100644 --- a/validator/rpc/handlers_accounts_test.go +++ b/validator/rpc/handlers_accounts_test.go @@ -253,7 +253,7 @@ func TestServer_VoluntaryExit(t *testing.T) { } mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Return(ðpb.Genesis{GenesisTime: genesisTime}, nil) mockValidatorClient.EXPECT(). diff --git a/validator/rpc/handlers_beacon.go b/validator/rpc/handlers_beacon.go index 9a6afc920a41..345d36a1bf80 100644 --- a/validator/rpc/handlers_beacon.go +++ b/validator/rpc/handlers_beacon.go @@ -25,7 +25,7 @@ import ( func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetBeaconStatus") defer span.End() - syncStatus, err := s.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := s.nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Error("beacon node call to get sync status failed") httputil.WriteJson(w, &BeaconStatusResponse{ @@ -35,16 +35,16 @@ func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { }) return } - genesis, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesis, err := s.nodeClient.Genesis(ctx, &emptypb.Empty{}) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "GetGenesis call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "Genesis call failed").Error(), http.StatusInternalServerError) return } genesisTime := uint64(time.Unix(genesis.GenesisTime.Seconds, 0).Unix()) address := genesis.DepositContractAddress - chainHead, err := s.chainClient.GetChainHead(ctx, &emptypb.Empty{}) + chainHead, err := s.chainClient.ChainHead(ctx, &emptypb.Empty{}) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "GetChainHead").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "ChainHead").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, &BeaconStatusResponse{ @@ -59,7 +59,7 @@ func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { // GetValidatorPerformance is a wrapper around the /eth/v1alpha1 endpoint of the same name. func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetValidatorPerformance") + ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.ValidatorPerformance") defer span.End() publicKeys := r.URL.Query()["public_keys"] pubkeys := make([][]byte, len(publicKeys)) @@ -85,9 +85,9 @@ func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) req := ðpb.ValidatorPerformanceRequest{ PublicKeys: pubkeys, } - validatorPerformance, err := s.chainClient.GetValidatorPerformance(ctx, req) + validatorPerformance, err := s.chainClient.ValidatorPerformance(ctx, req) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "GetValidatorPerformance call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "ValidatorPerformance call failed").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, ValidatorPerformanceResponseFromConsensus(validatorPerformance)) @@ -133,9 +133,9 @@ func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request) { PageSize: int32(ps), PageToken: pageToken, } - listValidatorBalances, err := s.chainClient.ListValidatorBalances(ctx, req) + listValidatorBalances, err := s.chainClient.ValidatorBalances(ctx, req) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "ListValidatorBalances call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "ValidatorBalances call failed").Error(), http.StatusInternalServerError) return } response, err := ValidatorBalancesResponseFromConsensus(listValidatorBalances) @@ -187,9 +187,9 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { PageSize: int32(ps), PageToken: pageToken, } - validators, err := s.chainClient.ListValidators(ctx, req) + validators, err := s.chainClient.Validators(ctx, req) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "ListValidators call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "Validators call failed").Error(), http.StatusInternalServerError) return } response, err := ValidatorsResponseFromConsensus(validators) @@ -204,9 +204,9 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { func (s *Server) GetPeers(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetPeers") defer span.End() - peers, err := s.nodeClient.ListPeers(ctx, &emptypb.Empty{}) + peers, err := s.nodeClient.Peers(ctx, &emptypb.Empty{}) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "ListPeers call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "Peers call failed").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, peers) diff --git a/validator/rpc/handlers_beacon_test.go b/validator/rpc/handlers_beacon_test.go index 83042cb1e3d7..aac83632a582 100644 --- a/validator/rpc/handlers_beacon_test.go +++ b/validator/rpc/handlers_beacon_test.go @@ -22,7 +22,7 @@ import ( func TestGetBeaconStatus_NotConnected(t *testing.T) { ctrl := gomock.NewController(t) nodeClient := validatormock.NewMockNodeClient(ctrl) - nodeClient.EXPECT().GetSyncStatus( + nodeClient.EXPECT().SyncStatus( gomock.Any(), // ctx gomock.Any(), ).Return(nil /*response*/, errors.New("uh oh")) @@ -48,12 +48,12 @@ func TestGetBeaconStatus_OK(t *testing.T) { ctrl := gomock.NewController(t) nodeClient := validatormock.NewMockNodeClient(ctrl) chainClient := validatormock.NewMockChainClient(ctrl) - nodeClient.EXPECT().GetSyncStatus( + nodeClient.EXPECT().SyncStatus( gomock.Any(), // ctx gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: true}, nil) timeStamp := timestamppb.New(time.Unix(0, 0)) - nodeClient.EXPECT().GetGenesis( + nodeClient.EXPECT().Genesis( gomock.Any(), // ctx gomock.Any(), ).Return(ðpb.Genesis{ diff --git a/validator/rpc/handlers_health.go b/validator/rpc/handlers_health.go index dc6e05b068c0..7c65ea81d268 100644 --- a/validator/rpc/handlers_health.go +++ b/validator/rpc/handlers_health.go @@ -15,10 +15,10 @@ import ( // GetVersion returns the beacon node and validator client versions func (s *Server) GetVersion(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.web.health.GetVersion") + ctx, span := trace.StartSpan(r.Context(), "validator.web.health.Version") defer span.End() - beacon, err := s.nodeClient.GetVersion(ctx, &emptypb.Empty{}) + beacon, err := s.nodeClient.Version(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) return diff --git a/validator/rpc/handlers_health_test.go b/validator/rpc/handlers_health_test.go index bb983d9e5c66..ac46c31221a1 100644 --- a/validator/rpc/handlers_health_test.go +++ b/validator/rpc/handlers_health_test.go @@ -173,7 +173,7 @@ func TestServer_GetVersion(t *testing.T) { ctx: ctx, nodeClient: mockNodeClient, } - mockNodeClient.EXPECT().GetVersion(gomock.Any(), gomock.Any()).Return(ð.Version{ + mockNodeClient.EXPECT().Version(gomock.Any(), gomock.Any()).Return(ð.Version{ Version: "4.10.1", Metadata: "beacon node", }, nil) diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index 9725bde7651e..f5d1c9aebab8 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -347,7 +347,7 @@ func (s *Server) SetVoluntaryExit(w http.ResponseWriter, r *http.Request) { epoch := primitives.Epoch(e) if rawEpoch == "" { - genesisResponse, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := s.nodeClient.Genesis(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "Failed to get genesis time").Error(), http.StatusInternalServerError) return @@ -842,7 +842,7 @@ func (s *Server) DeleteGasLimit(w http.ResponseWriter, r *http.Request) { } func (s *Server) GetGraffiti(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.keymanagerAPI.GetGraffiti") + ctx, span := trace.StartSpan(r.Context(), "validator.keymanagerAPI.Graffiti") defer span.End() if s.validatorService == nil { @@ -854,7 +854,7 @@ func (s *Server) GetGraffiti(w http.ResponseWriter, r *http.Request) { return } - graffiti, err := s.validatorService.GetGraffiti(ctx, bytesutil.ToBytes48(pubkey)) + graffiti, err := s.validatorService.Graffiti(ctx, bytesutil.ToBytes48(pubkey)) if err != nil { if strings.Contains(err.Error(), "unavailable") { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 2ec1d6b42de9..330340c37413 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -738,7 +738,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { Return(ð.DomainResponse{SignatureDomain: make([]byte, common.HashLength)}, nil /*err*/) mockNodeClient.EXPECT(). - GetGenesis(gomock.Any(), gomock.Any()). + Genesis(gomock.Any(), gomock.Any()). Times(3). Return(ð.Genesis{GenesisTime: genesisTime}, nil) @@ -841,7 +841,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { resp := &SetVoluntaryExitResponse{} require.NoError(t, json.Unmarshal(w.Body.Bytes(), resp)) if tt.w.epoch == 0 { - genesisResponse, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := s.nodeClient.Genesis(ctx, &emptypb.Empty{}) require.NoError(t, err) tt.w.epoch, err = client.CurrentEpoch(genesisResponse.GenesisTime) require.NoError(t, err) @@ -1102,7 +1102,7 @@ func TestServer_SetGasLimit(t *testing.T) { } if tt.beaconReturn != nil { - beaconClient.EXPECT().GetFeeRecipientByPubKey( + beaconClient.EXPECT().FeeRecipientByPubKey( gomock.Any(), gomock.Any(), ).Return(tt.beaconReturn.resp, tt.beaconReturn.error) From 5efecff63150b3abe1421e6fb30c2b74f1b2d74b Mon Sep 17 00:00:00 2001 From: terence Date: Fri, 31 May 2024 09:24:17 -0700 Subject: [PATCH 122/325] Fix mockgen sh (#14068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix mockgen sh * Radek's suggestion Co-authored-by: Radosław Kapka * Generate prysm chain client --------- Co-authored-by: Radosław Kapka --- hack/update-mockgen.sh | 4 ++-- testing/validator-mock/chain_client_mock.go | 4 ++-- testing/validator-mock/prysm_chain_client_mock.go | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hack/update-mockgen.sh b/hack/update-mockgen.sh index c5fdd493c268..6d636ff48118 100755 --- a/hack/update-mockgen.sh +++ b/hack/update-mockgen.sh @@ -27,8 +27,8 @@ done # github.com/prysmaticlabs/prysm/v5/validator/client/iface # -------------------------------------------------------- iface_mocks=( - "$iface_mock_path/beacon_chain_client_mock.go BeaconChainClient" - "$iface_mock_path/prysm_beacon_chain_client_mock.go PrysmBeaconChainClient" + "$iface_mock_path/chain_client_mock.go ChainClient" + "$iface_mock_path/prysm_chain_client_mock.go PrysmChainClient" "$iface_mock_path/node_client_mock.go NodeClient" "$iface_mock_path/validator_client_mock.go ValidatorClient" ) diff --git a/testing/validator-mock/chain_client_mock.go b/testing/validator-mock/chain_client_mock.go index d12ab76e98cf..b31172f9a451 100644 --- a/testing/validator-mock/chain_client_mock.go +++ b/testing/validator-mock/chain_client_mock.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: BeaconChainClient) +// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: ChainClient) // // Generated by this command: // -// mockgen -package=validator_mock -destination=testing/validator-mock/beacon_chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface BeaconChainClient +// mockgen -package=validator_mock -destination=testing/validator-mock/chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface ChainClient // // Package validator_mock is a generated GoMock package. diff --git a/testing/validator-mock/prysm_chain_client_mock.go b/testing/validator-mock/prysm_chain_client_mock.go index 135c9540100f..303f5d91df99 100644 --- a/testing/validator-mock/prysm_chain_client_mock.go +++ b/testing/validator-mock/prysm_chain_client_mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/prysmaticlabs/prysm/v4/validator/client/iface (interfaces: PrysmChainClient) +// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: PrysmChainClient) +// +// Generated by this command: +// +// mockgen -package=validator_mock -destination=testing/validator-mock/prysm_chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface PrysmChainClient +// // Package validator_mock is a generated GoMock package. package validator_mock @@ -46,7 +51,7 @@ func (m *MockPrysmChainClient) ValidatorCount(arg0 context.Context, arg1 string, } // GetValidatorCount indicates an expected call of GetValidatorCount. -func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).ValidatorCount), arg0, arg1, arg2) } From de04ce8329034b141710e6a37d9c5a38e002d3da Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 31 May 2024 11:55:49 -0500 Subject: [PATCH 123/325] EIP-7002:Execution layer triggerable withdrawals (#14031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip fixing 7002 branch * fixing tests and functions * fixing linting * temp fix for transition * adding unit tests for method * fixing linting * partial review from terence * Update withdrawals.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Update withdrawals.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Update withdrawals.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Update beacon-chain/core/electra/withdrawals.go Co-authored-by: Radosław Kapka * addressing feedback --------- Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Co-authored-by: Radosław Kapka --- beacon-chain/core/electra/BUILD.bazel | 8 + beacon-chain/core/electra/transition.go | 4 + beacon-chain/core/electra/withdrawals.go | 120 ++++++- beacon-chain/core/electra/withdrawals_test.go | 295 ++++++++++++++++++ beacon-chain/core/helpers/validators.go | 4 +- .../transition/transition_no_verify_sig.go | 5 +- .../state/state-native/getters_withdrawal.go | 4 +- .../mainnet/electra/operations/BUILD.bazel | 1 + .../execution_layer_withdrawals_test.go | 11 + .../minimal/electra/operations/BUILD.bazel | 1 + .../execution_layer_withdrawals_test.go | 11 + .../execution_layer_withdrawal_request.go | 49 ++- 12 files changed, 503 insertions(+), 10 deletions(-) create mode 100644 beacon-chain/core/electra/withdrawals_test.go create mode 100644 testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go create mode 100644 testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 42dfffdb0e74..ee8e0bcd865c 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -22,6 +22,7 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", + "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", @@ -32,7 +33,9 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], ) @@ -46,6 +49,7 @@ go_test( "effective_balance_updates_test.go", "upgrade_test.go", "validator_test.go", + "withdrawals_test.go", ], deps = [ ":go_default_library", @@ -63,8 +67,12 @@ go_test( "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/interop:go_default_library", + "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", + "@com_github_sirupsen_logrus//hooks/test:go_default_library", ], ) diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 6f807c6f8d27..5f501a4f71bd 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -73,10 +73,12 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta if err != nil { return nil, errors.Wrap(err, "could not process rewards and penalties") } + state, err = ProcessRegistryUpdates(ctx, state) if err != nil { return nil, errors.Wrap(err, "could not process registry updates") } + proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier() if err != nil { return nil, err @@ -89,6 +91,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta if err != nil { return nil, err } + if err = ProcessPendingBalanceDeposits(ctx, state, primitives.Gwei(bp.ActiveCurrentEpoch)); err != nil { return nil, err } @@ -98,6 +101,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta if err := ProcessEffectiveBalanceUpdates(state); err != nil { return nil, err } + state, err = ProcessSlashingsReset(state) if err != nil { return nil, err diff --git a/beacon-chain/core/electra/withdrawals.go b/beacon-chain/core/electra/withdrawals.go index df2df1cedd3d..8fb1b57c9a3c 100644 --- a/beacon-chain/core/electra/withdrawals.go +++ b/beacon-chain/core/electra/withdrawals.go @@ -1,13 +1,25 @@ package electra import ( + "bytes" "context" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" + log "github.com/sirupsen/logrus" + "go.opencensus.io/trace" ) -// ProcessExecutionLayerWithdrawRequests processes the validator withdrawals from the provided execution payload +// ProcessExecutionLayerWithdrawalRequests processes the validator withdrawals from the provided execution payload // into the beacon state triggered by the execution layer. // // Spec pseudocode definition: @@ -74,7 +86,109 @@ import ( // amount=to_withdraw, // withdrawable_epoch=withdrawable_epoch, // )) -func ProcessExecutionLayerWithdrawRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.ExecutionLayerWithdrawalRequest) (state.BeaconState, error) { - //TODO: replace with real implementation +func ProcessExecutionLayerWithdrawalRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.ExecutionLayerWithdrawalRequest) (state.BeaconState, error) { + ctx, span := trace.StartSpan(ctx, "electra.ProcessExecutionLayerWithdrawalRequests") + defer span.End() + currentEpoch := slots.ToEpoch(st.Slot()) + for _, wr := range wrs { + if wr == nil { + return nil, errors.New("nil execution layer withdrawal request") + } + amount := wr.Amount + isFullExitRequest := amount == params.BeaconConfig().FullExitRequestAmount + // If partial withdrawal queue is full, only full exits are processed + if n, err := st.NumPendingPartialWithdrawals(); err != nil { + return nil, err + } else if n == params.BeaconConfig().PendingPartialWithdrawalsLimit && !isFullExitRequest { + // if the PendingPartialWithdrawalsLimit is met, the user would have paid for a partial withdrawal that's not included + log.Debugln("Skipping execution layer withdrawal request, PendingPartialWithdrawalsLimit reached") + continue + } + + vIdx, exists := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(wr.ValidatorPubkey)) + if !exists { + log.Debugf("Skipping execution layer withdrawal request, validator index for %s not found\n", hexutil.Encode(wr.ValidatorPubkey)) + continue + } + validator, err := st.ValidatorAtIndex(vIdx) + if err != nil { + return nil, err + } + // Verify withdrawal credentials + hasCorrectCredential := helpers.HasExecutionWithdrawalCredentials(validator) + isCorrectSourceAddress := bytes.Equal(validator.WithdrawalCredentials[12:], wr.SourceAddress) + if !hasCorrectCredential || !isCorrectSourceAddress { + log.Debugln("Skipping execution layer withdrawal request, wrong withdrawal credentials") + continue + } + + // Verify the validator is active. + if !helpers.IsActiveValidator(validator, currentEpoch) { + log.Debugln("Skipping execution layer withdrawal request, validator not active") + continue + } + // Verify the validator has not yet submitted an exit. + if validator.ExitEpoch != params.BeaconConfig().FarFutureEpoch { + log.Debugln("Skipping execution layer withdrawal request, validator has submitted an exit already") + continue + } + // Verify the validator has been active long enough. + if currentEpoch < validator.ActivationEpoch.AddEpoch(params.BeaconConfig().ShardCommitteePeriod) { + log.Debugln("Skipping execution layer withdrawal request, validator has not been active long enough") + continue + } + + pendingBalanceToWithdraw, err := st.PendingBalanceToWithdraw(vIdx) + if err != nil { + return nil, err + } + if isFullExitRequest { + // Only exit validator if it has no pending withdrawals in the queue + if pendingBalanceToWithdraw == 0 { + maxExitEpoch, churn := validators.MaxExitEpochAndChurn(st) + var err error + st, _, err = validators.InitiateValidatorExit(ctx, st, vIdx, maxExitEpoch, churn) + if err != nil { + return nil, err + } + } + continue + } + + hasSufficientEffectiveBalance := validator.EffectiveBalance >= params.BeaconConfig().MinActivationBalance + vBal, err := st.BalanceAtIndex(vIdx) + if err != nil { + return nil, err + } + hasExcessBalance := vBal > params.BeaconConfig().MinActivationBalance+pendingBalanceToWithdraw + + // Only allow partial withdrawals with compounding withdrawal credentials + if helpers.HasCompoundingWithdrawalCredential(validator) && hasSufficientEffectiveBalance && hasExcessBalance { + // Spec definition: + // to_withdraw = min( + // state.balances[index] - MIN_ACTIVATION_BALANCE - pending_balance_to_withdraw, + // amount + // ) + + // note: you can safely subtract these values because haxExcessBalance is checked + toWithdraw := min(vBal-params.BeaconConfig().MinActivationBalance-pendingBalanceToWithdraw, amount) + exitQueueEpoch, err := st.ExitEpochAndUpdateChurn(primitives.Gwei(toWithdraw)) + if err != nil { + return nil, err + } + // safe add the uint64 to avoid overflow + withdrawableEpoch, err := exitQueueEpoch.SafeAddEpoch(params.BeaconConfig().MinValidatorWithdrawabilityDelay) + if err != nil { + return nil, errors.Wrap(err, "failed to add withdrawability delay to exit queue epoch") + } + if err := st.AppendPendingPartialWithdrawal(ðpb.PendingPartialWithdrawal{ + Index: vIdx, + Amount: toWithdraw, + WithdrawableEpoch: withdrawableEpoch, + }); err != nil { + return nil, err + } + } + } return st, nil } diff --git a/beacon-chain/core/electra/withdrawals_test.go b/beacon-chain/core/electra/withdrawals_test.go new file mode 100644 index 000000000000..0831fa17672d --- /dev/null +++ b/beacon-chain/core/electra/withdrawals_test.go @@ -0,0 +1,295 @@ +package electra_test + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus/hooks/test" +) + +func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { + logHook := test.NewGlobal() + source, err := hexutil.Decode("0xb20a608c624Ca5003905aA834De7156C68b2E1d0") + require.NoError(t, err) + st, _ := util.DeterministicGenesisStateElectra(t, 1) + currentSlot := primitives.Slot(uint64(params.BeaconConfig().SlotsPerEpoch)*uint64(params.BeaconConfig().ShardCommitteePeriod) + 1) + require.NoError(t, st.SetSlot(currentSlot)) + val, err := st.ValidatorAtIndex(0) + require.NoError(t, err) + type args struct { + st state.BeaconState + wrs []*enginev1.ExecutionLayerWithdrawalRequest + } + tests := []struct { + name string + args args + wantFn func(t *testing.T, got state.BeaconState) + wantErr bool + }{ + { + name: "happy path exit and withdrawal only", + args: args{ + st: func() state.BeaconState { + preSt := st.Copy() + require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: params.BeaconConfig().FullExitRequestAmount, + WithdrawableEpoch: 0, + })) + v, err := preSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) + return preSt + }(), + wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: source, + ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), + Amount: params.BeaconConfig().FullExitRequestAmount, + }, + }, + }, + wantFn: func(t *testing.T, got state.BeaconState) { + wantPostSt := st.Copy() + v, err := wantPostSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + v.ExitEpoch = 261 + v.WithdrawableEpoch = 517 + require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v})) + require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: params.BeaconConfig().FullExitRequestAmount, + WithdrawableEpoch: 0, + })) + _, err = wantPostSt.ExitEpochAndUpdateChurn(primitives.Gwei(v.EffectiveBalance)) + require.NoError(t, err) + require.DeepEqual(t, wantPostSt.Validators(), got.Validators()) + webc, err := wantPostSt.ExitBalanceToConsume() + require.NoError(t, err) + gebc, err := got.ExitBalanceToConsume() + require.NoError(t, err) + require.DeepEqual(t, webc, gebc) + weee, err := wantPostSt.EarliestExitEpoch() + require.NoError(t, err) + geee, err := got.EarliestExitEpoch() + require.NoError(t, err) + require.DeepEqual(t, weee, geee) + }, + }, + { + name: "happy path has compounding", + args: args{ + st: func() state.BeaconState { + preSt := st.Copy() + require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: params.BeaconConfig().FullExitRequestAmount, + WithdrawableEpoch: 0, + })) + v, err := preSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) + bal, err := preSt.BalanceAtIndex(0) + require.NoError(t, err) + bal += 200 + require.NoError(t, preSt.SetBalances([]uint64{bal})) + require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: 100, + WithdrawableEpoch: 0, + })) + return preSt + }(), + wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: source, + ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), + Amount: 100, + }, + }, + }, + wantFn: func(t *testing.T, got state.BeaconState) { + wantPostSt := st.Copy() + v, err := wantPostSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v})) + bal, err := wantPostSt.BalanceAtIndex(0) + require.NoError(t, err) + bal += 200 + require.NoError(t, wantPostSt.SetBalances([]uint64{bal})) + require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: 0, + WithdrawableEpoch: 0, + })) + require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: 100, + WithdrawableEpoch: 0, + })) + require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: 100, + WithdrawableEpoch: 517, + })) + wnppw, err := wantPostSt.NumPendingPartialWithdrawals() + require.NoError(t, err) + gnppw, err := got.NumPendingPartialWithdrawals() + require.NoError(t, err) + require.Equal(t, wnppw, gnppw) + wece, err := wantPostSt.EarliestConsolidationEpoch() + require.NoError(t, err) + gece, err := got.EarliestConsolidationEpoch() + require.NoError(t, err) + require.Equal(t, wece, gece) + _, err = wantPostSt.ExitEpochAndUpdateChurn(primitives.Gwei(100)) + require.NoError(t, err) + require.DeepEqual(t, wantPostSt.Validators(), got.Validators()) + webc, err := wantPostSt.ExitBalanceToConsume() + require.NoError(t, err) + gebc, err := got.ExitBalanceToConsume() + require.NoError(t, err) + require.DeepEqual(t, webc, gebc) + }, + }, + { + name: "validator already submitted exit", + args: args{ + st: func() state.BeaconState { + preSt := st.Copy() + v, err := preSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + v.ExitEpoch = 1000 + require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) + return preSt + }(), + wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: source, + ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), + Amount: params.BeaconConfig().FullExitRequestAmount, + }, + }, + }, + wantFn: func(t *testing.T, got state.BeaconState) { + wantPostSt := st.Copy() + v, err := wantPostSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + v.ExitEpoch = 1000 + require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v})) + eee, err := got.EarliestExitEpoch() + require.NoError(t, err) + require.Equal(t, eee, primitives.Epoch(0)) + require.DeepEqual(t, wantPostSt.Validators(), got.Validators()) + }, + }, + { + name: "validator too new", + args: args{ + st: func() state.BeaconState { + preSt := st.Copy() + require.NoError(t, preSt.SetSlot(0)) + v, err := preSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) + return preSt + }(), + wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: source, + ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), + Amount: params.BeaconConfig().FullExitRequestAmount, + }, + }, + }, + wantFn: func(t *testing.T, got state.BeaconState) { + wantPostSt := st.Copy() + require.NoError(t, wantPostSt.SetSlot(0)) + v, err := wantPostSt.ValidatorAtIndex(0) + require.NoError(t, err) + prefix := make([]byte, 12) + prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + v.WithdrawalCredentials = append(prefix, source...) + require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v})) + eee, err := got.EarliestExitEpoch() + require.NoError(t, err) + require.Equal(t, eee, primitives.Epoch(0)) + require.DeepEqual(t, wantPostSt.Validators(), got.Validators()) + }, + }, + { + name: "PendingPartialWithdrawalsLimit reached with partial withdrawal results in a skip", + args: args{ + st: func() state.BeaconState { + cfg := params.BeaconConfig().Copy() + cfg.PendingPartialWithdrawalsLimit = 1 + params.OverrideBeaconConfig(cfg) + logrus.SetLevel(logrus.DebugLevel) + preSt := st.Copy() + require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ + Index: 0, + Amount: params.BeaconConfig().FullExitRequestAmount, + WithdrawableEpoch: 0, + })) + return preSt + }(), + wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + { + SourceAddress: source, + ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), + Amount: 100, + }, + }, + }, + wantFn: func(t *testing.T, got state.BeaconState) { + assert.LogsContain(t, logHook, "Skipping execution layer withdrawal request, PendingPartialWithdrawalsLimit reached") + params.SetupTestConfigCleanup(t) + logrus.SetLevel(logrus.InfoLevel) // reset + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + + got, err := electra.ProcessExecutionLayerWithdrawalRequests(context.Background(), tt.args.st, tt.args.wrs) + if (err != nil) != tt.wantErr { + t.Errorf("ProcessExecutionLayerWithdrawalRequests() error = %v, wantErr %v", err, tt.wantErr) + return + } + tt.wantFn(t, got) + }) + } +} diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index 62a21cce642c..cf7c3de37da0 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -500,11 +500,11 @@ func LastActivatedValidatorIndex(ctx context.Context, st state.ReadOnlyBeaconSta // hasETH1WithdrawalCredential returns whether the validator has an ETH1 // Withdrawal prefix. It assumes that the caller has a lock on the state -func HasETH1WithdrawalCredential(val *ethpb.Validator) bool { +func HasETH1WithdrawalCredential(val interfaces.WithWithdrawalCredentials) bool { if val == nil { return false } - return isETH1WithdrawalCredential(val.WithdrawalCredentials) + return isETH1WithdrawalCredential(val.GetWithdrawalCredentials()) } func isETH1WithdrawalCredential(creds []byte) bool { diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index fee97de0d292..ee000bd6a4bc 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -445,11 +445,12 @@ func electraOperations( if !ok { return nil, errors.New("could not cast execution data to electra execution data") } - st, err = electra.ProcessExecutionLayerWithdrawRequests(ctx, st, exe.WithdrawalRequests()) + st, err = electra.ProcessExecutionLayerWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) if err != nil { return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") } - st, err = electra.ProcessDepositReceipts(ctx, st, exe.DepositReceipts()) + + st, err = electra.ProcessDepositReceipts(ctx, st, exe.DepositReceipts()) // TODO: EIP-6110 deposit changes. if err != nil { return nil, errors.Wrap(err, "could not process deposit receipts") } diff --git a/beacon-chain/state/state-native/getters_withdrawal.go b/beacon-chain/state/state-native/getters_withdrawal.go index f5eb8bed9708..2950900140ce 100644 --- a/beacon-chain/state/state-native/getters_withdrawal.go +++ b/beacon-chain/state/state-native/getters_withdrawal.go @@ -158,7 +158,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, ValidatorIndex: validatorIndex, - Address: bytesutil.SafeCopyBytes(val.WithdrawalCredentials[ETH1AddressOffset:]), + Address: bytesutil.SafeCopyBytes(val.GetWithdrawalCredentials()[ETH1AddressOffset:]), Amount: balance, }) withdrawalIndex++ @@ -166,7 +166,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, ValidatorIndex: validatorIndex, - Address: bytesutil.SafeCopyBytes(val.WithdrawalCredentials[ETH1AddressOffset:]), + Address: bytesutil.SafeCopyBytes(val.GetWithdrawalCredentials()[ETH1AddressOffset:]), Amount: balance - helpers.ValidatorMaxEffectiveBalance(val), }) withdrawalIndex++ diff --git a/testing/spectest/mainnet/electra/operations/BUILD.bazel b/testing/spectest/mainnet/electra/operations/BUILD.bazel index a8a3ba231ec0..e78106ecb1ba 100644 --- a/testing/spectest/mainnet/electra/operations/BUILD.bazel +++ b/testing/spectest/mainnet/electra/operations/BUILD.bazel @@ -7,6 +7,7 @@ go_test( "block_header_test.go", "bls_to_execution_change_test.go", "consolidation_test.go", + "execution_layer_withdrawals_test.go", "execution_payload_test.go", "proposer_slashing_test.go", "sync_committee_test.go", diff --git a/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go b/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go new file mode 100644 index 000000000000..b383228d4314 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_ExecutionLayerWithdrawalRequest(t *testing.T) { + operations.RunExecutionLayerWithdrawalRequestTest(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/operations/BUILD.bazel b/testing/spectest/minimal/electra/operations/BUILD.bazel index d95b1cb0eb0a..f77431fbc609 100644 --- a/testing/spectest/minimal/electra/operations/BUILD.bazel +++ b/testing/spectest/minimal/electra/operations/BUILD.bazel @@ -7,6 +7,7 @@ go_test( "block_header_test.go", "bls_to_execution_change_test.go", "consolidation_test.go", + "execution_layer_withdrawals_test.go", "execution_payload_test.go", "proposer_slashing_test.go", "sync_committee_test.go", diff --git a/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go b/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go new file mode 100644 index 000000000000..2476a5fb5906 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_ExecutionLayerWithdrawalRequest(t *testing.T) { + operations.RunExecutionLayerWithdrawalRequestTest(t, "minimal") +} diff --git a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go b/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go index 4cb008a835ca..b7e05a8012a8 100644 --- a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go @@ -1,3 +1,50 @@ package operations -// TODO: Add tests. +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunExecutionLayerWithdrawalRequestTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + executionLayerWithdrawalRequestFile, err := util.BazelFileBytes(folderPath, "execution_layer_withdrawal_request.ssz_snappy") + require.NoError(t, err) + executionLayerWithdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, executionLayerWithdrawalRequestFile) + require.NoError(t, err, "Failed to decompress") + withdrawalRequest := &enginev1.ExecutionLayerWithdrawalRequest{} + require.NoError(t, withdrawalRequest.UnmarshalSSZ(executionLayerWithdrawalRequestSSZ), "Failed to unmarshal") + body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ + WithdrawalRequests: []*enginev1.ExecutionLayerWithdrawalRequest{ + withdrawalRequest, + }, + }} + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + bod, ok := b.Block().Body().(interfaces.ROBlockBodyElectra) + require.Equal(t, true, ok) + e, err := bod.Execution() + require.NoError(t, err) + exe, ok := e.(interfaces.ExecutionDataElectra) + require.Equal(t, true, ok) + return electra.ProcessExecutionLayerWithdrawalRequests(ctx, s, exe.WithdrawalRequests()) + }) + }) + } +} From 968e82b02d63d6780e97ac7ebd4b2c62f87b6af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Sat, 1 Jun 2024 02:24:06 +0900 Subject: [PATCH 124/325] EIP-7549 gRPC (part 1) (#14055) * interfaces move * build fix * remove annoying warning * more build fixes * review * core code * tests part 1 * tests part 2 * TranslateParticipation doesn't need Electra * remove unused function * pending atts don't need Electra * tests part 3 * build fixes * review * EIP-7549 gRPC part 1 --- .../rpc/prysm/v1alpha1/beacon/attestations.go | 364 ++- .../v1alpha1/beacon/attestations_test.go | 195 +- .../rpc/prysm/v1alpha1/beacon/slashings.go | 21 +- .../prysm/v1alpha1/beacon/slashings_test.go | 25 + .../v1alpha1/attestation/attestation_utils.go | 13 +- proto/prysm/v1alpha1/beacon_chain.pb.go | 2729 ++++++++++------- proto/prysm/v1alpha1/beacon_chain.pb.gw.go | 332 ++ proto/prysm/v1alpha1/beacon_chain.proto | 83 + testing/util/attestation.go | 22 +- 9 files changed, 2565 insertions(+), 1219 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go index 556cb57cd201..b3d22b2c7158 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go @@ -9,6 +9,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/pagination" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -67,6 +69,13 @@ func (bs *Server) ListAttestations( return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err) } case *ethpb.ListAttestationsRequest_Epoch: + if q.Epoch >= params.BeaconConfig().ElectraForkEpoch { + return ðpb.ListAttestationsResponse{ + Attestations: make([]*ethpb.Attestation, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch)) if err != nil { return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err) @@ -74,17 +83,15 @@ func (bs *Server) ListAttestations( default: return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - atts := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) - for _, blk := range blocks { - atts = append(atts, blk.Block().Body().Attestations()...) + + atts, err := blockAttestations[*ethpb.Attestation](blocks) + if err != nil { + return nil, err } - // We sort attestations according to the Sortable interface. - sort.Sort(sortableAttestations(atts)) - numAttestations := len(atts) // If there are no attestations, we simply return a response specifying this. // Otherwise, attempting to paginate 0 attestations below would result in an error. - if numAttestations == 0 { + if len(atts) == 0 { return ðpb.ListAttestationsResponse{ Attestations: make([]*ethpb.Attestation, 0), TotalSize: int32(0), @@ -92,20 +99,77 @@ func (bs *Server) ListAttestations( }, nil } - start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), numAttestations) + start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts)) if err != nil { return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) } - attestations := make([]*ethpb.Attestation, 0, len(atts)) - for _, att := range atts { - a, ok := att.(*ethpb.Attestation) - if ok { - attestations = append(attestations, a) + + return ðpb.ListAttestationsResponse{ + Attestations: atts[start:end], + TotalSize: int32(len(atts)), + NextPageToken: nextPageToken, + }, nil +} + +// ListAttestationsElectra retrieves attestations by block root, slot, or epoch. +// Attestations are sorted by data slot by default. +// +// The server may return an empty list when no attestations match the given +// filter criteria. This RPC should not return NOT_FOUND. Only one filter +// criteria should be used. +func (bs *Server) ListAttestationsElectra(ctx context.Context, req *ethpb.ListAttestationsRequest) (*ethpb.ListAttestationsElectraResponse, error) { + if int(req.PageSize) > cmd.Get().MaxRPCPageSize { + return nil, status.Errorf(codes.InvalidArgument, "Requested page size %d can not be greater than max size %d", + req.PageSize, cmd.Get().MaxRPCPageSize) + } + var blocks []interfaces.ReadOnlySignedBeaconBlock + var err error + switch q := req.QueryFilter.(type) { + case *ethpb.ListAttestationsRequest_GenesisEpoch: + return ðpb.ListAttestationsElectraResponse{ + Attestations: make([]*ethpb.AttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + case *ethpb.ListAttestationsRequest_Epoch: + if q.Epoch < params.BeaconConfig().ElectraForkEpoch { + return ðpb.ListAttestationsElectraResponse{ + Attestations: make([]*ethpb.AttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } + blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err) } + default: + return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - return ðpb.ListAttestationsResponse{ - Attestations: attestations[start:end], - TotalSize: int32(numAttestations), + + atts, err := blockAttestations[*ethpb.AttestationElectra](blocks) + if err != nil { + return nil, err + } + + // If there are no attestations, we simply return a response specifying this. + // Otherwise, attempting to paginate 0 attestations below would result in an error. + if len(atts) == 0 { + return ðpb.ListAttestationsElectraResponse{ + Attestations: make([]*ethpb.AttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } + + start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) + } + + return ðpb.ListAttestationsElectraResponse{ + Attestations: atts[start:end], + TotalSize: int32(len(atts)), NextPageToken: nextPageToken, }, nil } @@ -128,6 +192,13 @@ func (bs *Server) ListIndexedAttestations( return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err) } case *ethpb.ListIndexedAttestationsRequest_Epoch: + if q.Epoch >= params.BeaconConfig().ElectraForkEpoch { + return ðpb.ListIndexedAttestationsResponse{ + IndexedAttestations: make([]*ethpb.IndexedAttestation, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch)) if err != nil { return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err) @@ -136,29 +207,205 @@ func (bs *Server) ListIndexedAttestations( return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - attsArray := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) - for _, b := range blocks { - attsArray = append(attsArray, b.Block().Body().Attestations()...) + indexedAtts, err := blockIndexedAttestations[*ethpb.IndexedAttestation](ctx, blocks, bs.StateGen) + if err != nil { + return nil, err } - // We sort attestations according to the Sortable interface. - sort.Sort(sortableAttestations(attsArray)) - numAttestations := len(attsArray) // If there are no attestations, we simply return a response specifying this. // Otherwise, attempting to paginate 0 attestations below would result in an error. - if numAttestations == 0 { + if len(indexedAtts) == 0 { return ðpb.ListIndexedAttestationsResponse{ IndexedAttestations: make([]*ethpb.IndexedAttestation, 0), TotalSize: int32(0), NextPageToken: strconv.Itoa(0), }, nil } + + start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(indexedAtts)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) + } + + return ðpb.ListIndexedAttestationsResponse{ + IndexedAttestations: indexedAtts[start:end], + TotalSize: int32(len(indexedAtts)), + NextPageToken: nextPageToken, + }, nil +} + +// ListIndexedAttestationsElectra retrieves indexed attestations by block root. +// IndexedAttestationsForEpoch are sorted by data slot by default. Start-end epoch +// filter is used to retrieve blocks with. +// +// The server may return an empty list when no attestations match the given +// filter criteria. This RPC should not return NOT_FOUND. +func (bs *Server) ListIndexedAttestationsElectra( + ctx context.Context, + req *ethpb.ListIndexedAttestationsRequest, +) (*ethpb.ListIndexedAttestationsElectraResponse, error) { + var blocks []interfaces.ReadOnlySignedBeaconBlock + var err error + switch q := req.QueryFilter.(type) { + case *ethpb.ListIndexedAttestationsRequest_GenesisEpoch: + return ðpb.ListIndexedAttestationsElectraResponse{ + IndexedAttestations: make([]*ethpb.IndexedAttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + case *ethpb.ListIndexedAttestationsRequest_Epoch: + if q.Epoch < params.BeaconConfig().ElectraForkEpoch { + return ðpb.ListIndexedAttestationsElectraResponse{ + IndexedAttestations: make([]*ethpb.IndexedAttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } + blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err) + } + default: + return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") + } + + indexedAtts, err := blockIndexedAttestations[*ethpb.IndexedAttestationElectra](ctx, blocks, bs.StateGen) + if err != nil { + return nil, err + } + // If there are no attestations, we simply return a response specifying this. + // Otherwise, attempting to paginate 0 attestations below would result in an error. + if len(indexedAtts) == 0 { + return ðpb.ListIndexedAttestationsElectraResponse{ + IndexedAttestations: make([]*ethpb.IndexedAttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } + + start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(indexedAtts)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) + } + + return ðpb.ListIndexedAttestationsElectraResponse{ + IndexedAttestations: indexedAtts[start:end], + TotalSize: int32(len(indexedAtts)), + NextPageToken: nextPageToken, + }, nil +} + +// AttestationPool retrieves pending attestations. +// +// The server returns a list of attestations that have been seen but not +// yet processed. Pool attestations eventually expire as the slot +// advances, so an attestation missing from this request does not imply +// that it was included in a block. The attestation may have expired. +// Refer to the ethereum consensus specification for more details on how +// attestations are processed and when they are no longer valid. +// https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#attestations +func (bs *Server) AttestationPool(_ context.Context, req *ethpb.AttestationPoolRequest) (*ethpb.AttestationPoolResponse, error) { + atts, err := attestationsFromPool[*ethpb.Attestation](req.PageSize, bs.AttestationsPool) + if err != nil { + return nil, err + } + // If there are no attestations, we simply return a response specifying this. + // Otherwise, attempting to paginate 0 attestations below would result in an error. + if len(atts) == 0 { + return ðpb.AttestationPoolResponse{ + Attestations: make([]*ethpb.Attestation, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } + + start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) + } + + return ðpb.AttestationPoolResponse{ + Attestations: atts[start:end], + TotalSize: int32(len(atts)), + NextPageToken: nextPageToken, + }, nil +} + +func (bs *Server) AttestationPoolElectra(_ context.Context, req *ethpb.AttestationPoolRequest) (*ethpb.AttestationPoolElectraResponse, error) { + atts, err := attestationsFromPool[*ethpb.AttestationElectra](req.PageSize, bs.AttestationsPool) + if err != nil { + return nil, err + } + // If there are no attestations, we simply return a response specifying this. + // Otherwise, attempting to paginate 0 attestations below would result in an error. + if len(atts) == 0 { + return ðpb.AttestationPoolElectraResponse{ + Attestations: make([]*ethpb.AttestationElectra, 0), + TotalSize: int32(0), + NextPageToken: strconv.Itoa(0), + }, nil + } + + start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts)) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) + } + + return ðpb.AttestationPoolElectraResponse{ + Attestations: atts[start:end], + TotalSize: int32(len(atts)), + NextPageToken: nextPageToken, + }, nil +} + +func blockAttestations[T ethpb.Att](blocks []interfaces.ReadOnlySignedBeaconBlock) ([]T, error) { + blockAtts := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + for _, blk := range blocks { + blockAtts = append(blockAtts, blk.Block().Body().Attestations()...) + } + // We sort attestations according to the Sortable interface. + sort.Sort(sortableAttestations(blockAtts)) + numAttestations := len(blockAtts) + if numAttestations == 0 { + return []T{}, nil + } + + atts := make([]T, 0, len(blockAtts)) + for _, att := range blockAtts { + a, ok := att.(T) + if !ok { + var expected T + return nil, status.Errorf(codes.Internal, "Attestation is of the wrong type (expected %T, got %T)", expected, att) + } + atts = append(atts, a) + } + + return atts, nil +} + +func blockIndexedAttestations[T ethpb.IndexedAtt]( + ctx context.Context, + blocks []interfaces.ReadOnlySignedBeaconBlock, + stateGen stategen.StateManager, +) ([]T, error) { + attsArray := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + for _, b := range blocks { + attsArray = append(attsArray, b.Block().Body().Attestations()...) + } + + // We sort attestations according to the Sortable interface. + sort.Sort(sortableAttestations(attsArray)) + numAttestations := len(attsArray) + if numAttestations == 0 { + return []T{}, nil + } + // We use the retrieved committees for the b root to convert all attestations // into indexed form effectively. mappedAttestations := mapAttestationsByTargetRoot(attsArray) - indexedAtts := make([]*ethpb.IndexedAttestation, 0, numAttestations) + indexed := make([]T, 0, numAttestations) for targetRoot, atts := range mappedAttestations { - attState, err := bs.StateGen.StateByRoot(ctx, targetRoot) + attState, err := stateGen.StateByRoot(ctx, targetRoot) if err != nil && strings.Contains(err.Error(), "unknown state summary") { // We shouldn't stop the request if we encounter an attestation we don't have the state for. log.Debugf("Could not get state for attestation target root %#x", targetRoot) @@ -185,67 +432,36 @@ func (bs *Server) ListIndexedAttestations( if err != nil { return nil, err } - a, ok := idxAtt.(*ethpb.IndexedAttestation) - if ok { - indexedAtts = append(indexedAtts, a) + a, ok := idxAtt.(T) + if !ok { + var expected T + return nil, status.Errorf(codes.Internal, "Indexed attestation is of the wrong type (expected %T, got %T)", expected, idxAtt) } + indexed = append(indexed, a) } } - start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(indexedAtts)) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) - } - return ðpb.ListIndexedAttestationsResponse{ - IndexedAttestations: indexedAtts[start:end], - TotalSize: int32(len(indexedAtts)), - NextPageToken: nextPageToken, - }, nil + return indexed, nil } -// AttestationPool retrieves pending attestations. -// -// The server returns a list of attestations that have been seen but not -// yet processed. Pool attestations eventually expire as the slot -// advances, so an attestation missing from this request does not imply -// that it was included in a block. The attestation may have expired. -// Refer to the ethereum consensus specification for more details on how -// attestations are processed and when they are no longer valid. -// https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#attestations -func (bs *Server) AttestationPool( - _ context.Context, req *ethpb.AttestationPoolRequest, -) (*ethpb.AttestationPoolResponse, error) { - if int(req.PageSize) > cmd.Get().MaxRPCPageSize { +func attestationsFromPool[T ethpb.Att](pageSize int32, pool attestations.Pool) ([]T, error) { + if int(pageSize) > cmd.Get().MaxRPCPageSize { return nil, status.Errorf( codes.InvalidArgument, "Requested page size %d can not be greater than max size %d", - req.PageSize, + pageSize, cmd.Get().MaxRPCPageSize, ) } - atts := bs.AttestationsPool.AggregatedAttestations() - numAtts := len(atts) - if numAtts == 0 { - return ðpb.AttestationPoolResponse{ - Attestations: make([]*ethpb.Attestation, 0), - TotalSize: int32(0), - NextPageToken: strconv.Itoa(0), - }, nil - } - start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), numAtts) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) - } - attestations := make([]*ethpb.Attestation, 0, len(atts)) - for _, att := range atts { - a, ok := att.(*ethpb.Attestation) - if ok { - attestations = append(attestations, a) + poolAtts := pool.AggregatedAttestations() + atts := make([]T, 0, len(poolAtts)) + for _, att := range poolAtts { + a, ok := att.(T) + if !ok { + var expected T + return nil, status.Errorf(codes.Internal, "Attestation is of the wrong type (expected %T, got %T)", expected, att) } + atts = append(atts, a) } - return ðpb.AttestationPoolResponse{ - Attestations: attestations[start:end], - TotalSize: int32(numAtts), - NextPageToken: nextPageToken, - }, nil + return atts, nil } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go index ae0a8685a167..8657ca5a3418 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go @@ -462,6 +462,59 @@ func TestServer_ListAttestations_Pagination_DefaultPageSize(t *testing.T) { assert.DeepEqual(t, atts[i:j], res.Attestations, "Incorrect attestations response") } +func TestServer_ListAttestationsElectra(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.ElectraForkEpoch = 0 + params.OverrideBeaconConfig(cfg) + + db := dbTest.SetupDB(t) + ctx := context.Background() + + st, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + Slot: 0, + }) + require.NoError(t, err) + bs := &Server{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{ + State: st, + }, + } + + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(2, true) + att := util.HydrateAttestationElectra(ðpb.AttestationElectra{ + AggregationBits: bitfield.NewBitlist(0), + Data: ðpb.AttestationData{ + Slot: 2, + }, + CommitteeBits: cb, + }) + + parentRoot := [32]byte{1, 2, 3} + signedBlock := util.NewBeaconBlockElectra() + signedBlock.Block.ParentRoot = bytesutil.PadTo(parentRoot[:], 32) + signedBlock.Block.Body.Attestations = []*ethpb.AttestationElectra{att} + root, err := signedBlock.Block.HashTreeRoot() + require.NoError(t, err) + util.SaveBlock(t, ctx, db, signedBlock) + require.NoError(t, db.SaveGenesisBlockRoot(ctx, root)) + wanted := ðpb.ListAttestationsElectraResponse{ + Attestations: []*ethpb.AttestationElectra{att}, + NextPageToken: "", + TotalSize: 1, + } + + res, err := bs.ListAttestationsElectra(ctx, ðpb.ListAttestationsRequest{ + QueryFilter: ðpb.ListAttestationsRequest_Epoch{ + Epoch: params.BeaconConfig().ElectraForkEpoch, + }, + }) + require.NoError(t, err) + require.DeepSSZEqual(t, wanted, res) +} + func TestServer_mapAttestationToTargetRoot(t *testing.T) { count := primitives.Slot(100) atts := make([]ethpb.Att, count) @@ -494,8 +547,6 @@ func TestServer_mapAttestationToTargetRoot(t *testing.T) { } func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { - params.SetupTestConfigCleanup(t) - params.OverrideBeaconConfig(params.BeaconConfig()) db := dbTest.SetupDB(t) helpers.ClearCache() ctx := context.Background() @@ -606,8 +657,6 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { } func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) { - params.SetupTestConfigCleanup(t) - params.OverrideBeaconConfig(params.BeaconConfig()) db := dbTest.SetupDB(t) helpers.ClearCache() ctx := context.Background() @@ -690,6 +739,123 @@ func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) { require.DeepEqual(t, indexedAtts, res.IndexedAttestations, "Incorrect list indexed attestations response") } +func TestServer_ListIndexedAttestationsElectra(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.ElectraForkEpoch = 0 + params.OverrideBeaconConfig(cfg) + + db := dbTest.SetupDB(t) + helpers.ClearCache() + ctx := context.Background() + targetRoot1 := bytesutil.ToBytes32([]byte("root")) + targetRoot2 := bytesutil.ToBytes32([]byte("root2")) + + count := params.BeaconConfig().SlotsPerEpoch + atts := make([]*ethpb.AttestationElectra, 0, count) + atts2 := make([]*ethpb.AttestationElectra, 0, count) + + for i := primitives.Slot(0); i < count; i++ { + var targetRoot [32]byte + if i%2 == 0 { + targetRoot = targetRoot1 + } else { + targetRoot = targetRoot2 + } + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + blockExample := util.NewBeaconBlockElectra() + blockExample.Block.Body.Attestations = []*ethpb.AttestationElectra{ + { + Signature: make([]byte, fieldparams.BLSSignatureLength), + Data: ðpb.AttestationData{ + BeaconBlockRoot: make([]byte, fieldparams.RootLength), + Target: ðpb.Checkpoint{ + Root: targetRoot[:], + }, + Source: ðpb.Checkpoint{ + Root: make([]byte, fieldparams.RootLength), + }, + Slot: i, + }, + AggregationBits: bitfield.NewBitlist(128 / uint64(params.BeaconConfig().SlotsPerEpoch)), + CommitteeBits: cb, + }, + } + util.SaveBlock(t, ctx, db, blockExample) + if i%2 == 0 { + atts = append(atts, blockExample.Block.Body.Attestations...) + } else { + atts2 = append(atts2, blockExample.Block.Body.Attestations...) + } + + } + + // We setup 512 validators so that committee size matches the length of attestations' aggregation bits. + numValidators := uint64(512) + state, _ := util.DeterministicGenesisStateElectra(t, numValidators) + + // Next up we convert the test attestations to indexed form: + indexedAtts := make([]*ethpb.IndexedAttestationElectra, len(atts)+len(atts2)) + for i := 0; i < len(atts); i++ { + att := atts[i] + committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, 0) + require.NoError(t, err) + idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee) + require.NoError(t, err, "Could not convert attestation to indexed") + a, ok := idxAtt.(*ethpb.IndexedAttestationElectra) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i] = a + } + for i := 0; i < len(atts2); i++ { + att := atts2[i] + committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, 0) + require.NoError(t, err) + idxAtt, err := attestation.ConvertToIndexed(ctx, atts2[i], committee) + require.NoError(t, err, "Could not convert attestation to indexed") + a, ok := idxAtt.(*ethpb.IndexedAttestationElectra) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i+len(atts)] = a + } + + bs := &Server{ + BeaconDB: db, + GenesisTimeFetcher: &chainMock.ChainService{State: state}, + HeadFetcher: &chainMock.ChainService{State: state}, + StateGen: stategen.New(db, doublylinkedtree.New()), + } + err := db.SaveStateSummary(ctx, ðpb.StateSummary{ + Root: targetRoot1[:], + Slot: 1, + }) + require.NoError(t, err) + + err = db.SaveStateSummary(ctx, ðpb.StateSummary{ + Root: targetRoot2[:], + Slot: 2, + }) + require.NoError(t, err) + + require.NoError(t, db.SaveState(ctx, state, bytesutil.ToBytes32(targetRoot1[:]))) + require.NoError(t, state.SetSlot(state.Slot()+1)) + require.NoError(t, db.SaveState(ctx, state, bytesutil.ToBytes32(targetRoot2[:]))) + res, err := bs.ListIndexedAttestationsElectra(ctx, ðpb.ListIndexedAttestationsRequest{ + QueryFilter: ðpb.ListIndexedAttestationsRequest_Epoch{ + Epoch: 0, + }, + }) + require.NoError(t, err) + assert.Equal(t, len(indexedAtts), len(res.IndexedAttestations), "Incorrect indexted attestations length") + sort.Slice(indexedAtts, func(i, j int) bool { + return indexedAtts[i].GetData().Slot < indexedAtts[j].GetData().Slot + }) + sort.Slice(res.IndexedAttestations, func(i, j int) bool { + return res.IndexedAttestations[i].Data.Slot < res.IndexedAttestations[j].Data.Slot + }) + + assert.DeepEqual(t, indexedAtts, res.IndexedAttestations, "Incorrect list indexed attestations response") +} + func TestServer_AttestationPool_Pagination_ExceedsMaxPageSize(t *testing.T) { ctx := context.Background() bs := &Server{} @@ -827,3 +993,24 @@ func TestServer_AttestationPool_Pagination_CustomPageSize(t *testing.T) { assert.Equal(t, tt.res.NextPageToken, res.NextPageToken, "Unexpected next page token") } } + +func TestServer_AttestationPoolElectra(t *testing.T) { + ctx := context.Background() + bs := &Server{ + AttestationsPool: attestations.NewPool(), + } + + atts := make([]ethpb.Att, params.BeaconConfig().DefaultPageSize+1) + for i := 0; i < len(atts); i++ { + att := util.NewAttestationElectra() + att.Data.Slot = primitives.Slot(i) + atts[i] = att + } + require.NoError(t, bs.AttestationsPool.SaveAggregatedAttestations(atts)) + + req := ðpb.AttestationPoolRequest{} + res, err := bs.AttestationPoolElectra(ctx, req) + require.NoError(t, err) + assert.Equal(t, params.BeaconConfig().DefaultPageSize, len(res.Attestations), "Unexpected number of attestations") + assert.Equal(t, params.BeaconConfig().DefaultPageSize+1, int(res.TotalSize), "Unexpected total size") +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go index 9504c98c1d6b..db019f9160ad 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go @@ -36,26 +36,31 @@ func (bs *Server) SubmitProposerSlashing( }, nil } -// SubmitAttesterSlashing receives an attester slashing object via +func (bs *Server) SubmitAttesterSlashing(ctx context.Context, req *ethpb.AttesterSlashing) (*ethpb.SubmitSlashingResponse, error) { + return bs.submitAttesterSlashing(ctx, req) +} + +// SubmitAttesterSlashingElectra receives an attester slashing object via // RPC and injects it into the beacon node's operations pool. // Submission into this pool does not guarantee inclusion into a beacon block. -func (bs *Server) SubmitAttesterSlashing( - ctx context.Context, - req *ethpb.AttesterSlashing, -) (*ethpb.SubmitSlashingResponse, error) { +func (bs *Server) SubmitAttesterSlashingElectra(ctx context.Context, req *ethpb.AttesterSlashingElectra) (*ethpb.SubmitSlashingResponse, error) { + return bs.submitAttesterSlashing(ctx, req) +} + +func (bs *Server) submitAttesterSlashing(ctx context.Context, slashing ethpb.AttSlashing) (*ethpb.SubmitSlashingResponse, error) { beaconState, err := bs.HeadFetcher.HeadStateReadOnly(ctx) if err != nil { return nil, status.Errorf(codes.Internal, "Could not retrieve head state: %v", err) } - if err := bs.SlashingsPool.InsertAttesterSlashing(ctx, beaconState, req); err != nil { + if err := bs.SlashingsPool.InsertAttesterSlashing(ctx, beaconState, slashing); err != nil { return nil, status.Errorf(codes.Internal, "Could not insert attester slashing into pool: %v", err) } if !features.Get().DisableBroadcastSlashings { - if err := bs.Broadcaster.Broadcast(ctx, req); err != nil { + if err := bs.Broadcaster.Broadcast(ctx, slashing); err != nil { return nil, status.Errorf(codes.Internal, "Could not broadcast slashing object: %v", err) } } - indices := slice.IntersectionUint64(req.Attestation_1.AttestingIndices, req.Attestation_2.AttestingIndices) + indices := slice.IntersectionUint64(slashing.FirstAttestation().GetAttestingIndices(), slashing.SecondAttestation().GetAttestingIndices()) slashedIndices := make([]primitives.ValidatorIndex, len(indices)) for i, index := range indices { slashedIndices[i] = primitives.ValidatorIndex(index) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go index a69459168b13..7c72515f75a8 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go @@ -167,3 +167,28 @@ func TestServer_SubmitAttesterSlashing_DontBroadcast(t *testing.T) { _, err = bs.SubmitAttesterSlashing(ctx, generatedSlashing.(*ethpb.AttesterSlashing)) assert.NotNil(t, err, "Expected including a attester slashing for an already slashed validator to fail") } + +func TestServer_SubmitAttesterSlashingElectra(t *testing.T) { + ctx := context.Background() + st, privs := util.DeterministicGenesisStateElectra(t, 64) + slashedVal, err := st.ValidatorAtIndex(5) + require.NoError(t, err) + slashedVal.Slashed = true + require.NoError(t, st.UpdateValidatorAtIndex(5, slashedVal)) + + mb := &mockp2p.MockBroadcaster{} + bs := &Server{ + HeadFetcher: &mock.ChainService{ + State: st, + }, + SlashingsPool: slashings.NewPool(), + Broadcaster: mb, + } + + generatedSlashing, err := util.GenerateAttesterSlashingForValidator(st, privs[2], primitives.ValidatorIndex(2)) + require.NoError(t, err) + + _, err = bs.SubmitAttesterSlashingElectra(ctx, generatedSlashing.(*ethpb.AttesterSlashingElectra)) + require.NoError(t, err) + assert.Equal(t, true, mb.BroadcastCalled.Load(), "Expected broadcast to be called when flag is set") +} diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils.go b/proto/prysm/v1alpha1/attestation/attestation_utils.go index 1af3060e5ecc..ba9db2872480 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils.go @@ -48,12 +48,19 @@ func ConvertToIndexed(ctx context.Context, attestation ethpb.Att, committees ... sort.Slice(attIndices, func(i, j int) bool { return attIndices[i] < attIndices[j] }) - inAtt := ðpb.IndexedAttestation{ + + if attestation.Version() >= version.Electra { + return ðpb.IndexedAttestationElectra{ + Data: attestation.GetData(), + Signature: attestation.GetSignature(), + AttestingIndices: attIndices, + }, nil + } + return ðpb.IndexedAttestation{ Data: attestation.GetData(), Signature: attestation.GetSignature(), AttestingIndices: attIndices, - } - return inAtt, err + }, nil } // AttestingIndices returns the attesting participants indices from the attestation data. diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.go b/proto/prysm/v1alpha1/beacon_chain.pb.go index b753957c7c6a..9b07cd75de0a 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.go @@ -286,6 +286,69 @@ func (x *ListAttestationsResponse) GetTotalSize() int32 { return 0 } +type ListAttestationsElectraResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attestations []*AttestationElectra `protobuf:"bytes,1,rep,name=attestations,proto3" json:"attestations,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` +} + +func (x *ListAttestationsElectraResponse) Reset() { + *x = ListAttestationsElectraResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAttestationsElectraResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAttestationsElectraResponse) ProtoMessage() {} + +func (x *ListAttestationsElectraResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAttestationsElectraResponse.ProtoReflect.Descriptor instead. +func (*ListAttestationsElectraResponse) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{3} +} + +func (x *ListAttestationsElectraResponse) GetAttestations() []*AttestationElectra { + if x != nil { + return x.Attestations + } + return nil +} + +func (x *ListAttestationsElectraResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListAttestationsElectraResponse) GetTotalSize() int32 { + if x != nil { + return x.TotalSize + } + return 0 +} + type ListIndexedAttestationsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -299,7 +362,7 @@ type ListIndexedAttestationsResponse struct { func (x *ListIndexedAttestationsResponse) Reset() { *x = ListIndexedAttestationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[3] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -312,7 +375,7 @@ func (x *ListIndexedAttestationsResponse) String() string { func (*ListIndexedAttestationsResponse) ProtoMessage() {} func (x *ListIndexedAttestationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[3] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -325,7 +388,7 @@ func (x *ListIndexedAttestationsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListIndexedAttestationsResponse.ProtoReflect.Descriptor instead. func (*ListIndexedAttestationsResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{3} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{4} } func (x *ListIndexedAttestationsResponse) GetIndexedAttestations() []*IndexedAttestation { @@ -349,6 +412,69 @@ func (x *ListIndexedAttestationsResponse) GetTotalSize() int32 { return 0 } +type ListIndexedAttestationsElectraResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IndexedAttestations []*IndexedAttestationElectra `protobuf:"bytes,1,rep,name=indexed_attestations,json=indexedAttestations,proto3" json:"indexed_attestations,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` +} + +func (x *ListIndexedAttestationsElectraResponse) Reset() { + *x = ListIndexedAttestationsElectraResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIndexedAttestationsElectraResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIndexedAttestationsElectraResponse) ProtoMessage() {} + +func (x *ListIndexedAttestationsElectraResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListIndexedAttestationsElectraResponse.ProtoReflect.Descriptor instead. +func (*ListIndexedAttestationsElectraResponse) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{5} +} + +func (x *ListIndexedAttestationsElectraResponse) GetIndexedAttestations() []*IndexedAttestationElectra { + if x != nil { + return x.IndexedAttestations + } + return nil +} + +func (x *ListIndexedAttestationsElectraResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListIndexedAttestationsElectraResponse) GetTotalSize() int32 { + if x != nil { + return x.TotalSize + } + return 0 +} + type ListBlocksRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -368,7 +494,7 @@ type ListBlocksRequest struct { func (x *ListBlocksRequest) Reset() { *x = ListBlocksRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[4] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -381,7 +507,7 @@ func (x *ListBlocksRequest) String() string { func (*ListBlocksRequest) ProtoMessage() {} func (x *ListBlocksRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[4] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -394,7 +520,7 @@ func (x *ListBlocksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListBlocksRequest.ProtoReflect.Descriptor instead. func (*ListBlocksRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{4} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{6} } func (m *ListBlocksRequest) GetQueryFilter() isListBlocksRequest_QueryFilter { @@ -487,7 +613,7 @@ type ListBeaconBlocksResponse struct { func (x *ListBeaconBlocksResponse) Reset() { *x = ListBeaconBlocksResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[5] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -500,7 +626,7 @@ func (x *ListBeaconBlocksResponse) String() string { func (*ListBeaconBlocksResponse) ProtoMessage() {} func (x *ListBeaconBlocksResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[5] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -513,7 +639,7 @@ func (x *ListBeaconBlocksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListBeaconBlocksResponse.ProtoReflect.Descriptor instead. func (*ListBeaconBlocksResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{5} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{7} } func (x *ListBeaconBlocksResponse) GetBlockContainers() []*BeaconBlockContainer { @@ -562,7 +688,7 @@ type BeaconBlockContainer struct { func (x *BeaconBlockContainer) Reset() { *x = BeaconBlockContainer{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -575,7 +701,7 @@ func (x *BeaconBlockContainer) String() string { func (*BeaconBlockContainer) ProtoMessage() {} func (x *BeaconBlockContainer) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -588,7 +714,7 @@ func (x *BeaconBlockContainer) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconBlockContainer.ProtoReflect.Descriptor instead. func (*BeaconBlockContainer) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{6} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{8} } func (x *BeaconBlockContainer) GetBlockRoot() []byte { @@ -769,7 +895,7 @@ type ChainHead struct { func (x *ChainHead) Reset() { *x = ChainHead{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[7] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -782,7 +908,7 @@ func (x *ChainHead) String() string { func (*ChainHead) ProtoMessage() {} func (x *ChainHead) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[7] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -795,7 +921,7 @@ func (x *ChainHead) ProtoReflect() protoreflect.Message { // Deprecated: Use ChainHead.ProtoReflect.Descriptor instead. func (*ChainHead) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{7} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{9} } func (x *ChainHead) GetHeadSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -904,7 +1030,7 @@ type ListCommitteesRequest struct { func (x *ListCommitteesRequest) Reset() { *x = ListCommitteesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -917,7 +1043,7 @@ func (x *ListCommitteesRequest) String() string { func (*ListCommitteesRequest) ProtoMessage() {} func (x *ListCommitteesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -930,7 +1056,7 @@ func (x *ListCommitteesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommitteesRequest.ProtoReflect.Descriptor instead. func (*ListCommitteesRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{8} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{10} } func (m *ListCommitteesRequest) GetQueryFilter() isListCommitteesRequest_QueryFilter { @@ -983,7 +1109,7 @@ type BeaconCommittees struct { func (x *BeaconCommittees) Reset() { *x = BeaconCommittees{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[9] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -996,7 +1122,7 @@ func (x *BeaconCommittees) String() string { func (*BeaconCommittees) ProtoMessage() {} func (x *BeaconCommittees) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[9] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1009,7 +1135,7 @@ func (x *BeaconCommittees) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconCommittees.ProtoReflect.Descriptor instead. func (*BeaconCommittees) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{9} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{11} } func (x *BeaconCommittees) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -1052,7 +1178,7 @@ type ListValidatorBalancesRequest struct { func (x *ListValidatorBalancesRequest) Reset() { *x = ListValidatorBalancesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1065,7 +1191,7 @@ func (x *ListValidatorBalancesRequest) String() string { func (*ListValidatorBalancesRequest) ProtoMessage() {} func (x *ListValidatorBalancesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1078,7 +1204,7 @@ func (x *ListValidatorBalancesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListValidatorBalancesRequest.ProtoReflect.Descriptor instead. func (*ListValidatorBalancesRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{10} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{12} } func (m *ListValidatorBalancesRequest) GetQueryFilter() isListValidatorBalancesRequest_QueryFilter { @@ -1160,7 +1286,7 @@ type ValidatorBalances struct { func (x *ValidatorBalances) Reset() { *x = ValidatorBalances{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[11] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1173,7 +1299,7 @@ func (x *ValidatorBalances) String() string { func (*ValidatorBalances) ProtoMessage() {} func (x *ValidatorBalances) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[11] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1186,7 +1312,7 @@ func (x *ValidatorBalances) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorBalances.ProtoReflect.Descriptor instead. func (*ValidatorBalances) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{11} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{13} } func (x *ValidatorBalances) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -1237,7 +1363,7 @@ type ListValidatorsRequest struct { func (x *ListValidatorsRequest) Reset() { *x = ListValidatorsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1250,7 +1376,7 @@ func (x *ListValidatorsRequest) String() string { func (*ListValidatorsRequest) ProtoMessage() {} func (x *ListValidatorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1263,7 +1389,7 @@ func (x *ListValidatorsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListValidatorsRequest.ProtoReflect.Descriptor instead. func (*ListValidatorsRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{12} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{14} } func (m *ListValidatorsRequest) GetQueryFilter() isListValidatorsRequest_QueryFilter { @@ -1353,7 +1479,7 @@ type GetValidatorRequest struct { func (x *GetValidatorRequest) Reset() { *x = GetValidatorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[13] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1366,7 +1492,7 @@ func (x *GetValidatorRequest) String() string { func (*GetValidatorRequest) ProtoMessage() {} func (x *GetValidatorRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[13] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1379,7 +1505,7 @@ func (x *GetValidatorRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetValidatorRequest.ProtoReflect.Descriptor instead. func (*GetValidatorRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{13} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{15} } func (m *GetValidatorRequest) GetQueryFilter() isGetValidatorRequest_QueryFilter { @@ -1433,7 +1559,7 @@ type Validators struct { func (x *Validators) Reset() { *x = Validators{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[14] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1446,7 +1572,7 @@ func (x *Validators) String() string { func (*Validators) ProtoMessage() {} func (x *Validators) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[14] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1459,7 +1585,7 @@ func (x *Validators) ProtoReflect() protoreflect.Message { // Deprecated: Use Validators.ProtoReflect.Descriptor instead. func (*Validators) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{14} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{16} } func (x *Validators) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -1505,7 +1631,7 @@ type GetValidatorActiveSetChangesRequest struct { func (x *GetValidatorActiveSetChangesRequest) Reset() { *x = GetValidatorActiveSetChangesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1518,7 +1644,7 @@ func (x *GetValidatorActiveSetChangesRequest) String() string { func (*GetValidatorActiveSetChangesRequest) ProtoMessage() {} func (x *GetValidatorActiveSetChangesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1531,7 +1657,7 @@ func (x *GetValidatorActiveSetChangesRequest) ProtoReflect() protoreflect.Messag // Deprecated: Use GetValidatorActiveSetChangesRequest.ProtoReflect.Descriptor instead. func (*GetValidatorActiveSetChangesRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{15} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{17} } func (m *GetValidatorActiveSetChangesRequest) GetQueryFilter() isGetValidatorActiveSetChangesRequest_QueryFilter { @@ -1592,7 +1718,7 @@ type ActiveSetChanges struct { func (x *ActiveSetChanges) Reset() { *x = ActiveSetChanges{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[16] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1605,7 +1731,7 @@ func (x *ActiveSetChanges) String() string { func (*ActiveSetChanges) ProtoMessage() {} func (x *ActiveSetChanges) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[16] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1618,7 +1744,7 @@ func (x *ActiveSetChanges) ProtoReflect() protoreflect.Message { // Deprecated: Use ActiveSetChanges.ProtoReflect.Descriptor instead. func (*ActiveSetChanges) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{16} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{18} } func (x *ActiveSetChanges) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -1697,7 +1823,7 @@ type ValidatorPerformanceRequest struct { func (x *ValidatorPerformanceRequest) Reset() { *x = ValidatorPerformanceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[17] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1710,7 +1836,7 @@ func (x *ValidatorPerformanceRequest) String() string { func (*ValidatorPerformanceRequest) ProtoMessage() {} func (x *ValidatorPerformanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[17] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1723,7 +1849,7 @@ func (x *ValidatorPerformanceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorPerformanceRequest.ProtoReflect.Descriptor instead. func (*ValidatorPerformanceRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{17} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{19} } // Deprecated: Marked as deprecated in proto/prysm/v1alpha1/beacon_chain.proto. @@ -1765,7 +1891,7 @@ type ValidatorPerformanceResponse struct { func (x *ValidatorPerformanceResponse) Reset() { *x = ValidatorPerformanceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[18] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1778,7 +1904,7 @@ func (x *ValidatorPerformanceResponse) String() string { func (*ValidatorPerformanceResponse) ProtoMessage() {} func (x *ValidatorPerformanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[18] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1791,7 +1917,7 @@ func (x *ValidatorPerformanceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorPerformanceResponse.ProtoReflect.Descriptor instead. func (*ValidatorPerformanceResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{18} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{20} } func (x *ValidatorPerformanceResponse) GetCurrentEffectiveBalances() []uint64 { @@ -1898,7 +2024,7 @@ type ValidatorQueue struct { func (x *ValidatorQueue) Reset() { *x = ValidatorQueue{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[19] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1911,7 +2037,7 @@ func (x *ValidatorQueue) String() string { func (*ValidatorQueue) ProtoMessage() {} func (x *ValidatorQueue) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[19] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1924,7 +2050,7 @@ func (x *ValidatorQueue) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorQueue.ProtoReflect.Descriptor instead. func (*ValidatorQueue) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{19} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{21} } func (x *ValidatorQueue) GetChurnLimit() uint64 { @@ -1983,7 +2109,7 @@ type ListValidatorAssignmentsRequest struct { func (x *ListValidatorAssignmentsRequest) Reset() { *x = ListValidatorAssignmentsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[20] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1996,7 +2122,7 @@ func (x *ListValidatorAssignmentsRequest) String() string { func (*ListValidatorAssignmentsRequest) ProtoMessage() {} func (x *ListValidatorAssignmentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[20] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2009,7 +2135,7 @@ func (x *ListValidatorAssignmentsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListValidatorAssignmentsRequest.ProtoReflect.Descriptor instead. func (*ListValidatorAssignmentsRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{20} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{22} } func (m *ListValidatorAssignmentsRequest) GetQueryFilter() isListValidatorAssignmentsRequest_QueryFilter { @@ -2091,7 +2217,7 @@ type ValidatorAssignments struct { func (x *ValidatorAssignments) Reset() { *x = ValidatorAssignments{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[21] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2104,7 +2230,7 @@ func (x *ValidatorAssignments) String() string { func (*ValidatorAssignments) ProtoMessage() {} func (x *ValidatorAssignments) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[21] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2117,7 +2243,7 @@ func (x *ValidatorAssignments) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorAssignments.ProtoReflect.Descriptor instead. func (*ValidatorAssignments) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{21} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{23} } func (x *ValidatorAssignments) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -2164,7 +2290,7 @@ type GetValidatorParticipationRequest struct { func (x *GetValidatorParticipationRequest) Reset() { *x = GetValidatorParticipationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2177,7 +2303,7 @@ func (x *GetValidatorParticipationRequest) String() string { func (*GetValidatorParticipationRequest) ProtoMessage() {} func (x *GetValidatorParticipationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2190,7 +2316,7 @@ func (x *GetValidatorParticipationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetValidatorParticipationRequest.ProtoReflect.Descriptor instead. func (*GetValidatorParticipationRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{22} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{24} } func (m *GetValidatorParticipationRequest) GetQueryFilter() isGetValidatorParticipationRequest_QueryFilter { @@ -2244,7 +2370,7 @@ type ValidatorParticipationResponse struct { func (x *ValidatorParticipationResponse) Reset() { *x = ValidatorParticipationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[23] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2257,7 +2383,7 @@ func (x *ValidatorParticipationResponse) String() string { func (*ValidatorParticipationResponse) ProtoMessage() {} func (x *ValidatorParticipationResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[23] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2270,7 +2396,7 @@ func (x *ValidatorParticipationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorParticipationResponse.ProtoReflect.Descriptor instead. func (*ValidatorParticipationResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{23} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{25} } func (x *ValidatorParticipationResponse) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -2306,7 +2432,7 @@ type AttestationPoolRequest struct { func (x *AttestationPoolRequest) Reset() { *x = AttestationPoolRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[24] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2319,7 +2445,7 @@ func (x *AttestationPoolRequest) String() string { func (*AttestationPoolRequest) ProtoMessage() {} func (x *AttestationPoolRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[24] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2332,7 +2458,7 @@ func (x *AttestationPoolRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationPoolRequest.ProtoReflect.Descriptor instead. func (*AttestationPoolRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{24} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{26} } func (x *AttestationPoolRequest) GetPageSize() int32 { @@ -2362,7 +2488,7 @@ type AttestationPoolResponse struct { func (x *AttestationPoolResponse) Reset() { *x = AttestationPoolResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[25] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2375,7 +2501,7 @@ func (x *AttestationPoolResponse) String() string { func (*AttestationPoolResponse) ProtoMessage() {} func (x *AttestationPoolResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[25] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2388,7 +2514,7 @@ func (x *AttestationPoolResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationPoolResponse.ProtoReflect.Descriptor instead. func (*AttestationPoolResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{25} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{27} } func (x *AttestationPoolResponse) GetAttestations() []*Attestation { @@ -2412,31 +2538,33 @@ func (x *AttestationPoolResponse) GetTotalSize() int32 { return 0 } -type BeaconConfig struct { +type AttestationPoolElectraResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Attestations []*AttestationElectra `protobuf:"bytes,1,rep,name=attestations,proto3" json:"attestations,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` } -func (x *BeaconConfig) Reset() { - *x = BeaconConfig{} +func (x *AttestationPoolElectraResponse) Reset() { + *x = AttestationPoolElectraResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[26] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *BeaconConfig) String() string { +func (x *AttestationPoolElectraResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BeaconConfig) ProtoMessage() {} +func (*AttestationPoolElectraResponse) ProtoMessage() {} -func (x *BeaconConfig) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[26] +func (x *AttestationPoolElectraResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2447,20 +2575,81 @@ func (x *BeaconConfig) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BeaconConfig.ProtoReflect.Descriptor instead. -func (*BeaconConfig) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{26} +// Deprecated: Use AttestationPoolElectraResponse.ProtoReflect.Descriptor instead. +func (*AttestationPoolElectraResponse) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{28} } -func (x *BeaconConfig) GetConfig() map[string]string { +func (x *AttestationPoolElectraResponse) GetAttestations() []*AttestationElectra { if x != nil { - return x.Config + return x.Attestations } return nil } -type SubmitSlashingResponse struct { - state protoimpl.MessageState +func (x *AttestationPoolElectraResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *AttestationPoolElectraResponse) GetTotalSize() int32 { + if x != nil { + return x.TotalSize + } + return 0 +} + +type BeaconConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *BeaconConfig) Reset() { + *x = BeaconConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BeaconConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BeaconConfig) ProtoMessage() {} + +func (x *BeaconConfig) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BeaconConfig.ProtoReflect.Descriptor instead. +func (*BeaconConfig) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{29} +} + +func (x *BeaconConfig) GetConfig() map[string]string { + if x != nil { + return x.Config + } + return nil +} + +type SubmitSlashingResponse struct { + state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2470,7 +2659,7 @@ type SubmitSlashingResponse struct { func (x *SubmitSlashingResponse) Reset() { *x = SubmitSlashingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[27] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2483,7 +2672,7 @@ func (x *SubmitSlashingResponse) String() string { func (*SubmitSlashingResponse) ProtoMessage() {} func (x *SubmitSlashingResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[27] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2496,7 +2685,7 @@ func (x *SubmitSlashingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitSlashingResponse.ProtoReflect.Descriptor instead. func (*SubmitSlashingResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{27} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{30} } func (x *SubmitSlashingResponse) GetSlashedIndices() []github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -2519,7 +2708,7 @@ type IndividualVotesRequest struct { func (x *IndividualVotesRequest) Reset() { *x = IndividualVotesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[28] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2532,7 +2721,7 @@ func (x *IndividualVotesRequest) String() string { func (*IndividualVotesRequest) ProtoMessage() {} func (x *IndividualVotesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[28] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2545,7 +2734,7 @@ func (x *IndividualVotesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use IndividualVotesRequest.ProtoReflect.Descriptor instead. func (*IndividualVotesRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{28} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{31} } func (x *IndividualVotesRequest) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -2580,7 +2769,7 @@ type IndividualVotesRespond struct { func (x *IndividualVotesRespond) Reset() { *x = IndividualVotesRespond{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[29] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2593,7 +2782,7 @@ func (x *IndividualVotesRespond) String() string { func (*IndividualVotesRespond) ProtoMessage() {} func (x *IndividualVotesRespond) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[29] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2606,7 +2795,7 @@ func (x *IndividualVotesRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use IndividualVotesRespond.ProtoReflect.Descriptor instead. func (*IndividualVotesRespond) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{29} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{32} } func (x *IndividualVotesRespond) GetIndividualVotes() []*IndividualVotesRespond_IndividualVote { @@ -2627,7 +2816,7 @@ type BeaconCommittees_CommitteeItem struct { func (x *BeaconCommittees_CommitteeItem) Reset() { *x = BeaconCommittees_CommitteeItem{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[30] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2640,7 +2829,7 @@ func (x *BeaconCommittees_CommitteeItem) String() string { func (*BeaconCommittees_CommitteeItem) ProtoMessage() {} func (x *BeaconCommittees_CommitteeItem) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[30] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2653,7 +2842,7 @@ func (x *BeaconCommittees_CommitteeItem) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconCommittees_CommitteeItem.ProtoReflect.Descriptor instead. func (*BeaconCommittees_CommitteeItem) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{9, 0} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{11, 0} } func (x *BeaconCommittees_CommitteeItem) GetValidatorIndices() []github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -2674,7 +2863,7 @@ type BeaconCommittees_CommitteesList struct { func (x *BeaconCommittees_CommitteesList) Reset() { *x = BeaconCommittees_CommitteesList{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[31] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2687,7 +2876,7 @@ func (x *BeaconCommittees_CommitteesList) String() string { func (*BeaconCommittees_CommitteesList) ProtoMessage() {} func (x *BeaconCommittees_CommitteesList) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[31] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2700,7 +2889,7 @@ func (x *BeaconCommittees_CommitteesList) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconCommittees_CommitteesList.ProtoReflect.Descriptor instead. func (*BeaconCommittees_CommitteesList) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{9, 1} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{11, 1} } func (x *BeaconCommittees_CommitteesList) GetCommittees() []*BeaconCommittees_CommitteeItem { @@ -2724,7 +2913,7 @@ type ValidatorBalances_Balance struct { func (x *ValidatorBalances_Balance) Reset() { *x = ValidatorBalances_Balance{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[33] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2737,7 +2926,7 @@ func (x *ValidatorBalances_Balance) String() string { func (*ValidatorBalances_Balance) ProtoMessage() {} func (x *ValidatorBalances_Balance) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[33] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2750,7 +2939,7 @@ func (x *ValidatorBalances_Balance) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorBalances_Balance.ProtoReflect.Descriptor instead. func (*ValidatorBalances_Balance) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{11, 0} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{13, 0} } func (x *ValidatorBalances_Balance) GetPublicKey() []byte { @@ -2793,7 +2982,7 @@ type Validators_ValidatorContainer struct { func (x *Validators_ValidatorContainer) Reset() { *x = Validators_ValidatorContainer{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[34] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2806,7 +2995,7 @@ func (x *Validators_ValidatorContainer) String() string { func (*Validators_ValidatorContainer) ProtoMessage() {} func (x *Validators_ValidatorContainer) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[34] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2819,7 +3008,7 @@ func (x *Validators_ValidatorContainer) ProtoReflect() protoreflect.Message { // Deprecated: Use Validators_ValidatorContainer.ProtoReflect.Descriptor instead. func (*Validators_ValidatorContainer) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{14, 0} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{16, 0} } func (x *Validators_ValidatorContainer) GetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -2853,7 +3042,7 @@ type ValidatorAssignments_CommitteeAssignment struct { func (x *ValidatorAssignments_CommitteeAssignment) Reset() { *x = ValidatorAssignments_CommitteeAssignment{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[35] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2866,7 +3055,7 @@ func (x *ValidatorAssignments_CommitteeAssignment) String() string { func (*ValidatorAssignments_CommitteeAssignment) ProtoMessage() {} func (x *ValidatorAssignments_CommitteeAssignment) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[35] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2879,7 +3068,7 @@ func (x *ValidatorAssignments_CommitteeAssignment) ProtoReflect() protoreflect.M // Deprecated: Use ValidatorAssignments_CommitteeAssignment.ProtoReflect.Descriptor instead. func (*ValidatorAssignments_CommitteeAssignment) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{21, 0} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{23, 0} } func (x *ValidatorAssignments_CommitteeAssignment) GetBeaconCommittees() []github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -2953,7 +3142,7 @@ type IndividualVotesRespond_IndividualVote struct { func (x *IndividualVotesRespond_IndividualVote) Reset() { *x = IndividualVotesRespond_IndividualVote{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[37] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2966,7 +3155,7 @@ func (x *IndividualVotesRespond_IndividualVote) String() string { func (*IndividualVotesRespond_IndividualVote) ProtoMessage() {} func (x *IndividualVotesRespond_IndividualVote) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[37] + mi := &file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2979,7 +3168,7 @@ func (x *IndividualVotesRespond_IndividualVote) ProtoReflect() protoreflect.Mess // Deprecated: Use IndividualVotesRespond_IndividualVote.ProtoReflect.Descriptor instead. func (*IndividualVotesRespond_IndividualVote) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{29, 0} + return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP(), []int{32, 0} } func (x *IndividualVotesRespond_IndividualVote) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -3157,601 +3346,543 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, - 0x22, 0xc6, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x14, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xce, 0x02, 0x0a, 0x11, 0x4c, 0x69, - 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, - 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x5b, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, 0x20, + 0x22, 0xb7, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x1f, 0x4c, + 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, + 0x0a, 0x14, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, + 0x69, 0x7a, 0x65, 0x22, 0xd4, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, + 0x0a, 0x14, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x13, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xce, 0x02, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, + 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x5b, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xb9, 0x01, 0x0a, 0x18, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, + 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, + 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x98, 0x08, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x4d, 0x0a, + 0x0c, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, + 0x0b, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, + 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x5c, 0x0a, 0x0f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, + 0x0e, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x72, 0x0a, 0x17, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, + 0x74, 0x72, 0x69, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x15, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x63, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6c, 0x0a, 0x15, 0x62, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, + 0x65, 0x6c, 0x6c, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, 0x6e, + 0x65, 0x62, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, + 0x0a, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x66, 0x0a, 0x13, 0x62, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, + 0x52, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6c, 0x0a, 0x15, 0x62, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x22, 0xb2, 0x09, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, + 0x12, 0x62, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x04, 0x73, 0x6c, - 0x6f, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xb9, 0x01, 0x0a, 0x18, 0x4c, - 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x98, 0x08, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x0c, - 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x0b, - 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, 0x61, - 0x6c, 0x74, 0x61, 0x69, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, - 0x72, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x5c, 0x0a, 0x0f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x0e, - 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x72, - 0x0a, 0x17, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x15, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6c, 0x0a, 0x15, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x65, - 0x62, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0a, - 0x64, 0x65, 0x6e, 0x65, 0x62, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x66, 0x0a, 0x13, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, - 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6c, 0x0a, 0x15, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, - 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x22, 0xb2, 0x09, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, - 0x62, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x53, - 0x6c, 0x6f, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, - 0x09, 0x68, 0x65, 0x61, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, - 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, - 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x66, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, + 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x09, 0x68, 0x65, 0x61, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x68, + 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, + 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x66, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, - 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, + 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, + 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, + 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, + 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, - 0x6f, 0x74, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, - 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x7d, 0x0a, 0x17, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, - 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x18, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, - 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x7d, 0x0a, + 0x17, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, + 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x49, - 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x1a, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, + 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x80, 0x01, 0x0a, + 0x18, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xef, 0x04, 0x0a, - 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, + 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x49, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x1a, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x70, + 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x8d, - 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, - 0x12, 0x7c, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x67, - 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x55, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, + 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xef, 0x04, + 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x1a, 0x75, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfc, - 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, - 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, - 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, - 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, 0x03, - 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x12, 0x4c, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, + 0x8d, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x7c, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, + 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, + 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, + 0x67, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x55, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x1a, 0x75, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xfc, 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x29, 0x0a, 0x0b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x83, 0x03, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, - 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, - 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, - 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xb7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x67, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, + 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, + 0x03, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x4c, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0x83, 0x03, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, + 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, + 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, + 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, + 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x34, 0x38, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x22, 0xcc, 0x03, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xb7, 0x01, 0x0a, 0x13, 0x47, 0x65, + 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x67, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x5b, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x73, - 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, - 0x69, 0x7a, 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xc4, 0x06, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, + 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0xcc, 0x03, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x5b, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0d, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, + 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, - 0x38, 0x52, 0x13, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x7c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x12, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x10, 0x65, 0x78, 0x69, 0x74, - 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x76, 0x0a, 0x0e, - 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, - 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, - 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x65, 0x6a, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, - 0x11, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x65, 0x6a, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, - 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0b, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xc4, 0x06, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x15, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, + 0x34, 0x38, 0x52, 0x13, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x7c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xc6, 0x06, 0x0a, - 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, - 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x70, 0x0a, 0x0f, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0e, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x78, 0x0a, - 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, - 0x74, 0x18, 0x01, 0x52, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, - 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, - 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, - 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, - 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, - 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, - 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x08, 0x52, 0x12, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x52, - 0x1d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, - 0x0a, 0x1f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x04, 0x52, 0x1c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x11, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x1d, - 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, - 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, 0x03, - 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, - 0x03, 0x28, 0x04, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, - 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0xc9, 0x03, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x72, - 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, - 0x68, 0x75, 0x72, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x16, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, - 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x34, 0x0a, 0x10, 0x65, - 0x78, 0x69, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, - 0x01, 0x52, 0x0e, 0x65, 0x78, 0x69, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x73, 0x12, 0x91, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x64, 0x65, 0x78, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x12, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x10, 0x65, 0x78, 0x69, + 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x76, 0x0a, + 0x0e, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, + 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x16, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0xff, 0x02, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, - 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, - 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, - 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0xab, 0x07, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, - 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x61, 0x0a, 0x0b, 0x61, 0x73, - 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, - 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x8a, 0x05, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x7c, 0x0a, 0x11, - 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x65, 0x6a, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, + 0x52, 0x11, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x69, + 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, + 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x65, + 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, + 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xc6, 0x06, + 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, + 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x04, 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x70, 0x0a, 0x0f, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0e, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x78, + 0x0a, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, - 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, - 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, - 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, - 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x27, - 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x18, 0x01, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x74, 0x18, 0x01, 0x52, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, + 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, + 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, + 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, + 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, + 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, + 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x08, 0x52, 0x12, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, + 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, + 0x52, 0x1d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x45, 0x0a, 0x1f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x04, 0x52, 0x1c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x11, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x1d, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, + 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, + 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0c, + 0x20, 0x03, 0x28, 0x04, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0xc9, 0x03, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, + 0x72, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, + 0x63, 0x68, 0x75, 0x72, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x16, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, + 0x3f, 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x34, 0x0a, 0x10, + 0x65, 0x78, 0x69, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, + 0x18, 0x01, 0x52, 0x0e, 0x65, 0x78, 0x69, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, + 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x16, 0x65, 0x78, 0x69, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x02, + 0x18, 0x01, 0x22, 0xff, 0x02, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, @@ -3760,345 +3891,488 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xf5, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x53, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x54, - 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x69, 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, + 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, - 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x22, 0xab, 0x07, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, + 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x61, 0x0a, 0x0b, 0x61, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, + 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x8a, 0x05, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x7c, 0x0a, + 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x49, 0x6e, - 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9f, - 0x0a, 0x0a, 0x16, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x10, 0x69, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, - 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, - 0x65, 0x52, 0x0f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, - 0x65, 0x73, 0x1a, 0x9b, 0x09, 0x0a, 0x0e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, - 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x62, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x73, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x69, 0x73, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x20, 0x69, - 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, - 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x3c, 0x0a, 0x1b, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, - 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x39, 0x0a, - 0x19, 0x69, 0x73, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x69, 0x73, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x48, 0x0a, - 0x21, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, - 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x69, 0x73, 0x5f, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, - 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1b, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4e, 0x0a, - 0x24, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x6e, 0x0a, - 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, + 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, + 0x6c, 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, + 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x6f, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, + 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, + 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x18, 0x01, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, + 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xf5, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x53, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x02, 0x18, 0x01, 0x22, + 0x54, 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, + 0x22, 0xb6, 0x01, 0x0a, 0x1e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, + 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, + 0x63, 0x65, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, + 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, + 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, + 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9f, 0x0a, 0x0a, 0x16, 0x49, 0x6e, 0x64, + 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x10, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, + 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, + 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x64, + 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x0f, 0x69, 0x6e, 0x64, + 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x9b, 0x09, 0x0a, + 0x0e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x12, + 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, + 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, + 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0d, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, - 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, - 0x18, 0x01, 0x52, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0f, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, - 0x32, 0xa3, 0x16, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x12, 0x9e, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, - 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, - 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, - 0xa0, 0x01, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x6f, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, - 0x6f, 0x6c, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x1c, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x49, + 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3a, 0x0a, + 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x16, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x1b, 0x69, 0x73, 0x5f, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, + 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, + 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x39, 0x0a, 0x19, 0x69, 0x73, 0x5f, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x43, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, + 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, + 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, + 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x21, 0x69, 0x73, 0x5f, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1d, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x69, 0x73, 0x50, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x24, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x6e, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x11, 0x69, 0x6e, + 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, + 0x6f, 0x72, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x69, 0x6e, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x32, 0xa8, 0x1c, 0x0a, 0x0b, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x10, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb4, 0x01, 0x0a, 0x17, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, - 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, - 0x64, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x68, 0x65, 0x61, 0x64, 0x88, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, - 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0xbb, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x22, 0x27, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, - 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x29, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, + 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, + 0x12, 0xd1, 0x01, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x20, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, - 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1f, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xb6, - 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, - 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x65, 0x74, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x7a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x71, 0x75, - 0x65, 0x75, 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, - 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0xad, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x33, 0x12, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x12, 0xa0, 0x01, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, + 0x26, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0xb6, 0x01, 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, + 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0x92, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x22, + 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x68, 0x65, 0x61, 0x64, 0x88, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, 0x14, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, - 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, - 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x02, 0x01, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x29, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x20, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x7d, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1f, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xb6, 0x01, 0x0a, + 0x1c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x65, 0x74, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x7a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, - 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0xa8, 0x01, 0x0a, - 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x71, 0x75, 0x65, 0x75, + 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x32, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, + 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0xad, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x88, 0x02, 0x01, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x73, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0xbe, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, - 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, + 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, - 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, - 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, + 0x76, 0x6f, 0x74, 0x65, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, + 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4113,130 +4387,147 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_beacon_chain_proto_rawDescData } -var file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes = make([]protoimpl.MessageInfo, 41) var file_proto_prysm_v1alpha1_beacon_chain_proto_goTypes = []interface{}{ (*ListIndexedAttestationsRequest)(nil), // 0: ethereum.eth.v1alpha1.ListIndexedAttestationsRequest (*ListAttestationsRequest)(nil), // 1: ethereum.eth.v1alpha1.ListAttestationsRequest (*ListAttestationsResponse)(nil), // 2: ethereum.eth.v1alpha1.ListAttestationsResponse - (*ListIndexedAttestationsResponse)(nil), // 3: ethereum.eth.v1alpha1.ListIndexedAttestationsResponse - (*ListBlocksRequest)(nil), // 4: ethereum.eth.v1alpha1.ListBlocksRequest - (*ListBeaconBlocksResponse)(nil), // 5: ethereum.eth.v1alpha1.ListBeaconBlocksResponse - (*BeaconBlockContainer)(nil), // 6: ethereum.eth.v1alpha1.BeaconBlockContainer - (*ChainHead)(nil), // 7: ethereum.eth.v1alpha1.ChainHead - (*ListCommitteesRequest)(nil), // 8: ethereum.eth.v1alpha1.ListCommitteesRequest - (*BeaconCommittees)(nil), // 9: ethereum.eth.v1alpha1.BeaconCommittees - (*ListValidatorBalancesRequest)(nil), // 10: ethereum.eth.v1alpha1.ListValidatorBalancesRequest - (*ValidatorBalances)(nil), // 11: ethereum.eth.v1alpha1.ValidatorBalances - (*ListValidatorsRequest)(nil), // 12: ethereum.eth.v1alpha1.ListValidatorsRequest - (*GetValidatorRequest)(nil), // 13: ethereum.eth.v1alpha1.GetValidatorRequest - (*Validators)(nil), // 14: ethereum.eth.v1alpha1.Validators - (*GetValidatorActiveSetChangesRequest)(nil), // 15: ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest - (*ActiveSetChanges)(nil), // 16: ethereum.eth.v1alpha1.ActiveSetChanges - (*ValidatorPerformanceRequest)(nil), // 17: ethereum.eth.v1alpha1.ValidatorPerformanceRequest - (*ValidatorPerformanceResponse)(nil), // 18: ethereum.eth.v1alpha1.ValidatorPerformanceResponse - (*ValidatorQueue)(nil), // 19: ethereum.eth.v1alpha1.ValidatorQueue - (*ListValidatorAssignmentsRequest)(nil), // 20: ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest - (*ValidatorAssignments)(nil), // 21: ethereum.eth.v1alpha1.ValidatorAssignments - (*GetValidatorParticipationRequest)(nil), // 22: ethereum.eth.v1alpha1.GetValidatorParticipationRequest - (*ValidatorParticipationResponse)(nil), // 23: ethereum.eth.v1alpha1.ValidatorParticipationResponse - (*AttestationPoolRequest)(nil), // 24: ethereum.eth.v1alpha1.AttestationPoolRequest - (*AttestationPoolResponse)(nil), // 25: ethereum.eth.v1alpha1.AttestationPoolResponse - (*BeaconConfig)(nil), // 26: ethereum.eth.v1alpha1.BeaconConfig - (*SubmitSlashingResponse)(nil), // 27: ethereum.eth.v1alpha1.SubmitSlashingResponse - (*IndividualVotesRequest)(nil), // 28: ethereum.eth.v1alpha1.IndividualVotesRequest - (*IndividualVotesRespond)(nil), // 29: ethereum.eth.v1alpha1.IndividualVotesRespond - (*BeaconCommittees_CommitteeItem)(nil), // 30: ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem - (*BeaconCommittees_CommitteesList)(nil), // 31: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList - nil, // 32: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry - (*ValidatorBalances_Balance)(nil), // 33: ethereum.eth.v1alpha1.ValidatorBalances.Balance - (*Validators_ValidatorContainer)(nil), // 34: ethereum.eth.v1alpha1.Validators.ValidatorContainer - (*ValidatorAssignments_CommitteeAssignment)(nil), // 35: ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment - nil, // 36: ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry - (*IndividualVotesRespond_IndividualVote)(nil), // 37: ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote - (*Attestation)(nil), // 38: ethereum.eth.v1alpha1.Attestation - (*IndexedAttestation)(nil), // 39: ethereum.eth.v1alpha1.IndexedAttestation - (*SignedBeaconBlock)(nil), // 40: ethereum.eth.v1alpha1.SignedBeaconBlock - (*SignedBeaconBlockAltair)(nil), // 41: ethereum.eth.v1alpha1.SignedBeaconBlockAltair - (*SignedBeaconBlockBellatrix)(nil), // 42: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix - (*SignedBlindedBeaconBlockBellatrix)(nil), // 43: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix - (*SignedBeaconBlockCapella)(nil), // 44: ethereum.eth.v1alpha1.SignedBeaconBlockCapella - (*SignedBlindedBeaconBlockCapella)(nil), // 45: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella - (*SignedBeaconBlockDeneb)(nil), // 46: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - (*SignedBlindedBeaconBlockDeneb)(nil), // 47: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - (*SignedBeaconBlockElectra)(nil), // 48: ethereum.eth.v1alpha1.SignedBeaconBlockElectra - (*SignedBlindedBeaconBlockElectra)(nil), // 49: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra - (*ValidatorParticipation)(nil), // 50: ethereum.eth.v1alpha1.ValidatorParticipation - (*Validator)(nil), // 51: ethereum.eth.v1alpha1.Validator - (*emptypb.Empty)(nil), // 52: google.protobuf.Empty - (*AttesterSlashing)(nil), // 53: ethereum.eth.v1alpha1.AttesterSlashing - (*ProposerSlashing)(nil), // 54: ethereum.eth.v1alpha1.ProposerSlashing + (*ListAttestationsElectraResponse)(nil), // 3: ethereum.eth.v1alpha1.ListAttestationsElectraResponse + (*ListIndexedAttestationsResponse)(nil), // 4: ethereum.eth.v1alpha1.ListIndexedAttestationsResponse + (*ListIndexedAttestationsElectraResponse)(nil), // 5: ethereum.eth.v1alpha1.ListIndexedAttestationsElectraResponse + (*ListBlocksRequest)(nil), // 6: ethereum.eth.v1alpha1.ListBlocksRequest + (*ListBeaconBlocksResponse)(nil), // 7: ethereum.eth.v1alpha1.ListBeaconBlocksResponse + (*BeaconBlockContainer)(nil), // 8: ethereum.eth.v1alpha1.BeaconBlockContainer + (*ChainHead)(nil), // 9: ethereum.eth.v1alpha1.ChainHead + (*ListCommitteesRequest)(nil), // 10: ethereum.eth.v1alpha1.ListCommitteesRequest + (*BeaconCommittees)(nil), // 11: ethereum.eth.v1alpha1.BeaconCommittees + (*ListValidatorBalancesRequest)(nil), // 12: ethereum.eth.v1alpha1.ListValidatorBalancesRequest + (*ValidatorBalances)(nil), // 13: ethereum.eth.v1alpha1.ValidatorBalances + (*ListValidatorsRequest)(nil), // 14: ethereum.eth.v1alpha1.ListValidatorsRequest + (*GetValidatorRequest)(nil), // 15: ethereum.eth.v1alpha1.GetValidatorRequest + (*Validators)(nil), // 16: ethereum.eth.v1alpha1.Validators + (*GetValidatorActiveSetChangesRequest)(nil), // 17: ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest + (*ActiveSetChanges)(nil), // 18: ethereum.eth.v1alpha1.ActiveSetChanges + (*ValidatorPerformanceRequest)(nil), // 19: ethereum.eth.v1alpha1.ValidatorPerformanceRequest + (*ValidatorPerformanceResponse)(nil), // 20: ethereum.eth.v1alpha1.ValidatorPerformanceResponse + (*ValidatorQueue)(nil), // 21: ethereum.eth.v1alpha1.ValidatorQueue + (*ListValidatorAssignmentsRequest)(nil), // 22: ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest + (*ValidatorAssignments)(nil), // 23: ethereum.eth.v1alpha1.ValidatorAssignments + (*GetValidatorParticipationRequest)(nil), // 24: ethereum.eth.v1alpha1.GetValidatorParticipationRequest + (*ValidatorParticipationResponse)(nil), // 25: ethereum.eth.v1alpha1.ValidatorParticipationResponse + (*AttestationPoolRequest)(nil), // 26: ethereum.eth.v1alpha1.AttestationPoolRequest + (*AttestationPoolResponse)(nil), // 27: ethereum.eth.v1alpha1.AttestationPoolResponse + (*AttestationPoolElectraResponse)(nil), // 28: ethereum.eth.v1alpha1.AttestationPoolElectraResponse + (*BeaconConfig)(nil), // 29: ethereum.eth.v1alpha1.BeaconConfig + (*SubmitSlashingResponse)(nil), // 30: ethereum.eth.v1alpha1.SubmitSlashingResponse + (*IndividualVotesRequest)(nil), // 31: ethereum.eth.v1alpha1.IndividualVotesRequest + (*IndividualVotesRespond)(nil), // 32: ethereum.eth.v1alpha1.IndividualVotesRespond + (*BeaconCommittees_CommitteeItem)(nil), // 33: ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem + (*BeaconCommittees_CommitteesList)(nil), // 34: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList + nil, // 35: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry + (*ValidatorBalances_Balance)(nil), // 36: ethereum.eth.v1alpha1.ValidatorBalances.Balance + (*Validators_ValidatorContainer)(nil), // 37: ethereum.eth.v1alpha1.Validators.ValidatorContainer + (*ValidatorAssignments_CommitteeAssignment)(nil), // 38: ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment + nil, // 39: ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry + (*IndividualVotesRespond_IndividualVote)(nil), // 40: ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote + (*Attestation)(nil), // 41: ethereum.eth.v1alpha1.Attestation + (*AttestationElectra)(nil), // 42: ethereum.eth.v1alpha1.AttestationElectra + (*IndexedAttestation)(nil), // 43: ethereum.eth.v1alpha1.IndexedAttestation + (*IndexedAttestationElectra)(nil), // 44: ethereum.eth.v1alpha1.IndexedAttestationElectra + (*SignedBeaconBlock)(nil), // 45: ethereum.eth.v1alpha1.SignedBeaconBlock + (*SignedBeaconBlockAltair)(nil), // 46: ethereum.eth.v1alpha1.SignedBeaconBlockAltair + (*SignedBeaconBlockBellatrix)(nil), // 47: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix + (*SignedBlindedBeaconBlockBellatrix)(nil), // 48: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix + (*SignedBeaconBlockCapella)(nil), // 49: ethereum.eth.v1alpha1.SignedBeaconBlockCapella + (*SignedBlindedBeaconBlockCapella)(nil), // 50: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella + (*SignedBeaconBlockDeneb)(nil), // 51: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb + (*SignedBlindedBeaconBlockDeneb)(nil), // 52: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb + (*SignedBeaconBlockElectra)(nil), // 53: ethereum.eth.v1alpha1.SignedBeaconBlockElectra + (*SignedBlindedBeaconBlockElectra)(nil), // 54: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + (*ValidatorParticipation)(nil), // 55: ethereum.eth.v1alpha1.ValidatorParticipation + (*Validator)(nil), // 56: ethereum.eth.v1alpha1.Validator + (*emptypb.Empty)(nil), // 57: google.protobuf.Empty + (*AttesterSlashing)(nil), // 58: ethereum.eth.v1alpha1.AttesterSlashing + (*AttesterSlashingElectra)(nil), // 59: ethereum.eth.v1alpha1.AttesterSlashingElectra + (*ProposerSlashing)(nil), // 60: ethereum.eth.v1alpha1.ProposerSlashing } var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ - 38, // 0: ethereum.eth.v1alpha1.ListAttestationsResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 39, // 1: ethereum.eth.v1alpha1.ListIndexedAttestationsResponse.indexed_attestations:type_name -> ethereum.eth.v1alpha1.IndexedAttestation - 6, // 2: ethereum.eth.v1alpha1.ListBeaconBlocksResponse.block_containers:type_name -> ethereum.eth.v1alpha1.BeaconBlockContainer - 40, // 3: ethereum.eth.v1alpha1.BeaconBlockContainer.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock - 41, // 4: ethereum.eth.v1alpha1.BeaconBlockContainer.altair_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockAltair - 42, // 5: ethereum.eth.v1alpha1.BeaconBlockContainer.bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix - 43, // 6: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix - 44, // 7: ethereum.eth.v1alpha1.BeaconBlockContainer.capella_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella - 45, // 8: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_capella_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella - 46, // 9: ethereum.eth.v1alpha1.BeaconBlockContainer.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - 47, // 10: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - 48, // 11: ethereum.eth.v1alpha1.BeaconBlockContainer.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra - 49, // 12: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_electra_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra - 32, // 13: ethereum.eth.v1alpha1.BeaconCommittees.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry - 33, // 14: ethereum.eth.v1alpha1.ValidatorBalances.balances:type_name -> ethereum.eth.v1alpha1.ValidatorBalances.Balance - 34, // 15: ethereum.eth.v1alpha1.Validators.validator_list:type_name -> ethereum.eth.v1alpha1.Validators.ValidatorContainer - 35, // 16: ethereum.eth.v1alpha1.ValidatorAssignments.assignments:type_name -> ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment - 50, // 17: ethereum.eth.v1alpha1.ValidatorParticipationResponse.participation:type_name -> ethereum.eth.v1alpha1.ValidatorParticipation - 38, // 18: ethereum.eth.v1alpha1.AttestationPoolResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 36, // 19: ethereum.eth.v1alpha1.BeaconConfig.config:type_name -> ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry - 37, // 20: ethereum.eth.v1alpha1.IndividualVotesRespond.individual_votes:type_name -> ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote - 30, // 21: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem - 31, // 22: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry.value:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList - 51, // 23: ethereum.eth.v1alpha1.Validators.ValidatorContainer.validator:type_name -> ethereum.eth.v1alpha1.Validator - 1, // 24: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest - 0, // 25: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest - 24, // 26: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest - 4, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest - 52, // 28: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty - 8, // 29: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest - 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest - 12, // 31: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest - 13, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest - 15, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest - 52, // 34: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty - 17, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest - 20, // 36: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest - 22, // 37: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest - 52, // 38: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty - 53, // 39: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing - 54, // 40: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing - 28, // 41: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:input_type -> ethereum.eth.v1alpha1.IndividualVotesRequest - 2, // 42: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:output_type -> ethereum.eth.v1alpha1.ListAttestationsResponse - 3, // 43: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse - 25, // 44: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse - 5, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse - 7, // 46: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead - 9, // 47: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees - 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances - 14, // 49: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators - 51, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator - 16, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges - 19, // 52: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue - 18, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse - 21, // 54: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments - 23, // 55: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse - 26, // 56: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig - 27, // 57: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse - 27, // 58: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse - 29, // 59: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:output_type -> ethereum.eth.v1alpha1.IndividualVotesRespond - 42, // [42:60] is the sub-list for method output_type - 24, // [24:42] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 41, // 0: ethereum.eth.v1alpha1.ListAttestationsResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 42, // 1: ethereum.eth.v1alpha1.ListAttestationsElectraResponse.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 43, // 2: ethereum.eth.v1alpha1.ListIndexedAttestationsResponse.indexed_attestations:type_name -> ethereum.eth.v1alpha1.IndexedAttestation + 44, // 3: ethereum.eth.v1alpha1.ListIndexedAttestationsElectraResponse.indexed_attestations:type_name -> ethereum.eth.v1alpha1.IndexedAttestationElectra + 8, // 4: ethereum.eth.v1alpha1.ListBeaconBlocksResponse.block_containers:type_name -> ethereum.eth.v1alpha1.BeaconBlockContainer + 45, // 5: ethereum.eth.v1alpha1.BeaconBlockContainer.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock + 46, // 6: ethereum.eth.v1alpha1.BeaconBlockContainer.altair_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockAltair + 47, // 7: ethereum.eth.v1alpha1.BeaconBlockContainer.bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix + 48, // 8: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockBellatrix + 49, // 9: ethereum.eth.v1alpha1.BeaconBlockContainer.capella_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella + 50, // 10: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_capella_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella + 51, // 11: ethereum.eth.v1alpha1.BeaconBlockContainer.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb + 52, // 12: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb + 53, // 13: ethereum.eth.v1alpha1.BeaconBlockContainer.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra + 54, // 14: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_electra_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + 35, // 15: ethereum.eth.v1alpha1.BeaconCommittees.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry + 36, // 16: ethereum.eth.v1alpha1.ValidatorBalances.balances:type_name -> ethereum.eth.v1alpha1.ValidatorBalances.Balance + 37, // 17: ethereum.eth.v1alpha1.Validators.validator_list:type_name -> ethereum.eth.v1alpha1.Validators.ValidatorContainer + 38, // 18: ethereum.eth.v1alpha1.ValidatorAssignments.assignments:type_name -> ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment + 55, // 19: ethereum.eth.v1alpha1.ValidatorParticipationResponse.participation:type_name -> ethereum.eth.v1alpha1.ValidatorParticipation + 41, // 20: ethereum.eth.v1alpha1.AttestationPoolResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 42, // 21: ethereum.eth.v1alpha1.AttestationPoolElectraResponse.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 39, // 22: ethereum.eth.v1alpha1.BeaconConfig.config:type_name -> ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry + 40, // 23: ethereum.eth.v1alpha1.IndividualVotesRespond.individual_votes:type_name -> ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote + 33, // 24: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem + 34, // 25: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry.value:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList + 56, // 26: ethereum.eth.v1alpha1.Validators.ValidatorContainer.validator:type_name -> ethereum.eth.v1alpha1.Validator + 1, // 27: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest + 1, // 28: ethereum.eth.v1alpha1.BeaconChain.ListAttestationsElectra:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest + 0, // 29: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest + 0, // 30: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestationsElectra:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest + 26, // 31: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest + 26, // 32: ethereum.eth.v1alpha1.BeaconChain.AttestationPoolElectra:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest + 6, // 33: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest + 57, // 34: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty + 10, // 35: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest + 12, // 36: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest + 14, // 37: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest + 15, // 38: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest + 17, // 39: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest + 57, // 40: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty + 19, // 41: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest + 22, // 42: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest + 24, // 43: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest + 57, // 44: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty + 58, // 45: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing + 59, // 46: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashingElectra:input_type -> ethereum.eth.v1alpha1.AttesterSlashingElectra + 60, // 47: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing + 31, // 48: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:input_type -> ethereum.eth.v1alpha1.IndividualVotesRequest + 2, // 49: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:output_type -> ethereum.eth.v1alpha1.ListAttestationsResponse + 3, // 50: ethereum.eth.v1alpha1.BeaconChain.ListAttestationsElectra:output_type -> ethereum.eth.v1alpha1.ListAttestationsElectraResponse + 4, // 51: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse + 5, // 52: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestationsElectra:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsElectraResponse + 27, // 53: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse + 28, // 54: ethereum.eth.v1alpha1.BeaconChain.AttestationPoolElectra:output_type -> ethereum.eth.v1alpha1.AttestationPoolElectraResponse + 7, // 55: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse + 9, // 56: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead + 11, // 57: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees + 13, // 58: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances + 16, // 59: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators + 56, // 60: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator + 18, // 61: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges + 21, // 62: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue + 20, // 63: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse + 23, // 64: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments + 25, // 65: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse + 29, // 66: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig + 30, // 67: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 30, // 68: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashingElectra:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 30, // 69: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 32, // 70: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:output_type -> ethereum.eth.v1alpha1.IndividualVotesRespond + 49, // [49:71] is the sub-list for method output_type + 27, // [27:49] is the sub-list for method input_type + 27, // [27:27] is the sub-list for extension type_name + 27, // [27:27] is the sub-list for extension extendee + 0, // [0:27] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_chain_proto_init() } @@ -4285,7 +4576,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListIndexedAttestationsResponse); i { + switch v := v.(*ListAttestationsElectraResponse); i { case 0: return &v.state case 1: @@ -4297,7 +4588,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBlocksRequest); i { + switch v := v.(*ListIndexedAttestationsResponse); i { case 0: return &v.state case 1: @@ -4309,7 +4600,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBeaconBlocksResponse); i { + switch v := v.(*ListIndexedAttestationsElectraResponse); i { case 0: return &v.state case 1: @@ -4321,7 +4612,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconBlockContainer); i { + switch v := v.(*ListBlocksRequest); i { case 0: return &v.state case 1: @@ -4333,7 +4624,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChainHead); i { + switch v := v.(*ListBeaconBlocksResponse); i { case 0: return &v.state case 1: @@ -4345,7 +4636,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitteesRequest); i { + switch v := v.(*BeaconBlockContainer); i { case 0: return &v.state case 1: @@ -4357,7 +4648,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconCommittees); i { + switch v := v.(*ChainHead); i { case 0: return &v.state case 1: @@ -4369,7 +4660,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValidatorBalancesRequest); i { + switch v := v.(*ListCommitteesRequest); i { case 0: return &v.state case 1: @@ -4381,7 +4672,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorBalances); i { + switch v := v.(*BeaconCommittees); i { case 0: return &v.state case 1: @@ -4393,7 +4684,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValidatorsRequest); i { + switch v := v.(*ListValidatorBalancesRequest); i { case 0: return &v.state case 1: @@ -4405,7 +4696,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetValidatorRequest); i { + switch v := v.(*ValidatorBalances); i { case 0: return &v.state case 1: @@ -4417,7 +4708,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Validators); i { + switch v := v.(*ListValidatorsRequest); i { case 0: return &v.state case 1: @@ -4429,7 +4720,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetValidatorActiveSetChangesRequest); i { + switch v := v.(*GetValidatorRequest); i { case 0: return &v.state case 1: @@ -4441,7 +4732,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActiveSetChanges); i { + switch v := v.(*Validators); i { case 0: return &v.state case 1: @@ -4453,7 +4744,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorPerformanceRequest); i { + switch v := v.(*GetValidatorActiveSetChangesRequest); i { case 0: return &v.state case 1: @@ -4465,7 +4756,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorPerformanceResponse); i { + switch v := v.(*ActiveSetChanges); i { case 0: return &v.state case 1: @@ -4477,7 +4768,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorQueue); i { + switch v := v.(*ValidatorPerformanceRequest); i { case 0: return &v.state case 1: @@ -4489,7 +4780,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValidatorAssignmentsRequest); i { + switch v := v.(*ValidatorPerformanceResponse); i { case 0: return &v.state case 1: @@ -4501,7 +4792,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorAssignments); i { + switch v := v.(*ValidatorQueue); i { case 0: return &v.state case 1: @@ -4513,7 +4804,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetValidatorParticipationRequest); i { + switch v := v.(*ListValidatorAssignmentsRequest); i { case 0: return &v.state case 1: @@ -4525,7 +4816,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorParticipationResponse); i { + switch v := v.(*ValidatorAssignments); i { case 0: return &v.state case 1: @@ -4537,7 +4828,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AttestationPoolRequest); i { + switch v := v.(*GetValidatorParticipationRequest); i { case 0: return &v.state case 1: @@ -4549,7 +4840,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AttestationPoolResponse); i { + switch v := v.(*ValidatorParticipationResponse); i { case 0: return &v.state case 1: @@ -4561,7 +4852,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconConfig); i { + switch v := v.(*AttestationPoolRequest); i { case 0: return &v.state case 1: @@ -4573,7 +4864,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubmitSlashingResponse); i { + switch v := v.(*AttestationPoolResponse); i { case 0: return &v.state case 1: @@ -4585,7 +4876,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IndividualVotesRequest); i { + switch v := v.(*AttestationPoolElectraResponse); i { case 0: return &v.state case 1: @@ -4597,7 +4888,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IndividualVotesRespond); i { + switch v := v.(*BeaconConfig); i { case 0: return &v.state case 1: @@ -4609,7 +4900,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconCommittees_CommitteeItem); i { + switch v := v.(*SubmitSlashingResponse); i { case 0: return &v.state case 1: @@ -4621,7 +4912,19 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconCommittees_CommitteesList); i { + switch v := v.(*IndividualVotesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndividualVotesRespond); i { case 0: return &v.state case 1: @@ -4633,7 +4936,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorBalances_Balance); i { + switch v := v.(*BeaconCommittees_CommitteeItem); i { case 0: return &v.state case 1: @@ -4645,6 +4948,30 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { } } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BeaconCommittees_CommitteesList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorBalances_Balance); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Validators_ValidatorContainer); i { case 0: return &v.state @@ -4656,7 +4983,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { return nil } } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatorAssignments_CommitteeAssignment); i { case 0: return &v.state @@ -4668,7 +4995,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { return nil } } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IndividualVotesRespond_IndividualVote); i { case 0: return &v.state @@ -4689,13 +5016,13 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { (*ListAttestationsRequest_Epoch)(nil), (*ListAttestationsRequest_GenesisEpoch)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[4].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6].OneofWrappers = []interface{}{ (*ListBlocksRequest_Root)(nil), (*ListBlocksRequest_Slot)(nil), (*ListBlocksRequest_Epoch)(nil), (*ListBlocksRequest_Genesis)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8].OneofWrappers = []interface{}{ (*BeaconBlockContainer_Phase0Block)(nil), (*BeaconBlockContainer_AltairBlock)(nil), (*BeaconBlockContainer_BellatrixBlock)(nil), @@ -4707,31 +5034,31 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { (*BeaconBlockContainer_ElectraBlock)(nil), (*BeaconBlockContainer_BlindedElectraBlock)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10].OneofWrappers = []interface{}{ (*ListCommitteesRequest_Epoch)(nil), (*ListCommitteesRequest_Genesis)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[10].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12].OneofWrappers = []interface{}{ (*ListValidatorBalancesRequest_Epoch)(nil), (*ListValidatorBalancesRequest_Genesis)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[12].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[14].OneofWrappers = []interface{}{ (*ListValidatorsRequest_Epoch)(nil), (*ListValidatorsRequest_Genesis)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[13].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15].OneofWrappers = []interface{}{ (*GetValidatorRequest_Index)(nil), (*GetValidatorRequest_PublicKey)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[15].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[17].OneofWrappers = []interface{}{ (*GetValidatorActiveSetChangesRequest_Epoch)(nil), (*GetValidatorActiveSetChangesRequest_Genesis)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[20].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22].OneofWrappers = []interface{}{ (*ListValidatorAssignmentsRequest_Epoch)(nil), (*ListValidatorAssignmentsRequest_Genesis)(nil), } - file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[22].OneofWrappers = []interface{}{ + file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[24].OneofWrappers = []interface{}{ (*GetValidatorParticipationRequest_Epoch)(nil), (*GetValidatorParticipationRequest_Genesis)(nil), } @@ -4741,7 +5068,7 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc, NumEnums: 0, - NumMessages: 38, + NumMessages: 41, NumExtensions: 0, NumServices: 1, }, @@ -4768,8 +5095,11 @@ const _ = grpc.SupportPackageIsVersion6 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type BeaconChainClient interface { ListAttestations(ctx context.Context, in *ListAttestationsRequest, opts ...grpc.CallOption) (*ListAttestationsResponse, error) + ListAttestationsElectra(ctx context.Context, in *ListAttestationsRequest, opts ...grpc.CallOption) (*ListAttestationsElectraResponse, error) ListIndexedAttestations(ctx context.Context, in *ListIndexedAttestationsRequest, opts ...grpc.CallOption) (*ListIndexedAttestationsResponse, error) + ListIndexedAttestationsElectra(ctx context.Context, in *ListIndexedAttestationsRequest, opts ...grpc.CallOption) (*ListIndexedAttestationsElectraResponse, error) AttestationPool(ctx context.Context, in *AttestationPoolRequest, opts ...grpc.CallOption) (*AttestationPoolResponse, error) + AttestationPoolElectra(ctx context.Context, in *AttestationPoolRequest, opts ...grpc.CallOption) (*AttestationPoolElectraResponse, error) ListBeaconBlocks(ctx context.Context, in *ListBlocksRequest, opts ...grpc.CallOption) (*ListBeaconBlocksResponse, error) // Deprecated: Do not use. GetChainHead(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChainHead, error) @@ -4785,6 +5115,7 @@ type BeaconChainClient interface { GetValidatorParticipation(ctx context.Context, in *GetValidatorParticipationRequest, opts ...grpc.CallOption) (*ValidatorParticipationResponse, error) GetBeaconConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BeaconConfig, error) SubmitAttesterSlashing(ctx context.Context, in *AttesterSlashing, opts ...grpc.CallOption) (*SubmitSlashingResponse, error) + SubmitAttesterSlashingElectra(ctx context.Context, in *AttesterSlashingElectra, opts ...grpc.CallOption) (*SubmitSlashingResponse, error) SubmitProposerSlashing(ctx context.Context, in *ProposerSlashing, opts ...grpc.CallOption) (*SubmitSlashingResponse, error) GetIndividualVotes(ctx context.Context, in *IndividualVotesRequest, opts ...grpc.CallOption) (*IndividualVotesRespond, error) } @@ -4806,6 +5137,15 @@ func (c *beaconChainClient) ListAttestations(ctx context.Context, in *ListAttest return out, nil } +func (c *beaconChainClient) ListAttestationsElectra(ctx context.Context, in *ListAttestationsRequest, opts ...grpc.CallOption) (*ListAttestationsElectraResponse, error) { + out := new(ListAttestationsElectraResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconChainClient) ListIndexedAttestations(ctx context.Context, in *ListIndexedAttestationsRequest, opts ...grpc.CallOption) (*ListIndexedAttestationsResponse, error) { out := new(ListIndexedAttestationsResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations", in, out, opts...) @@ -4815,6 +5155,15 @@ func (c *beaconChainClient) ListIndexedAttestations(ctx context.Context, in *Lis return out, nil } +func (c *beaconChainClient) ListIndexedAttestationsElectra(ctx context.Context, in *ListIndexedAttestationsRequest, opts ...grpc.CallOption) (*ListIndexedAttestationsElectraResponse, error) { + out := new(ListIndexedAttestationsElectraResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconChainClient) AttestationPool(ctx context.Context, in *AttestationPoolRequest, opts ...grpc.CallOption) (*AttestationPoolResponse, error) { out := new(AttestationPoolResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPool", in, out, opts...) @@ -4824,6 +5173,15 @@ func (c *beaconChainClient) AttestationPool(ctx context.Context, in *Attestation return out, nil } +func (c *beaconChainClient) AttestationPoolElectra(ctx context.Context, in *AttestationPoolRequest, opts ...grpc.CallOption) (*AttestationPoolElectraResponse, error) { + out := new(AttestationPoolElectraResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconChainClient) ListBeaconBlocks(ctx context.Context, in *ListBlocksRequest, opts ...grpc.CallOption) (*ListBeaconBlocksResponse, error) { out := new(ListBeaconBlocksResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconBlocks", in, out, opts...) @@ -4943,6 +5301,15 @@ func (c *beaconChainClient) SubmitAttesterSlashing(ctx context.Context, in *Atte return out, nil } +func (c *beaconChainClient) SubmitAttesterSlashingElectra(ctx context.Context, in *AttesterSlashingElectra, opts ...grpc.CallOption) (*SubmitSlashingResponse, error) { + out := new(SubmitSlashingResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconChainClient) SubmitProposerSlashing(ctx context.Context, in *ProposerSlashing, opts ...grpc.CallOption) (*SubmitSlashingResponse, error) { out := new(SubmitSlashingResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing", in, out, opts...) @@ -4964,8 +5331,11 @@ func (c *beaconChainClient) GetIndividualVotes(ctx context.Context, in *Individu // BeaconChainServer is the server API for BeaconChain service. type BeaconChainServer interface { ListAttestations(context.Context, *ListAttestationsRequest) (*ListAttestationsResponse, error) + ListAttestationsElectra(context.Context, *ListAttestationsRequest) (*ListAttestationsElectraResponse, error) ListIndexedAttestations(context.Context, *ListIndexedAttestationsRequest) (*ListIndexedAttestationsResponse, error) + ListIndexedAttestationsElectra(context.Context, *ListIndexedAttestationsRequest) (*ListIndexedAttestationsElectraResponse, error) AttestationPool(context.Context, *AttestationPoolRequest) (*AttestationPoolResponse, error) + AttestationPoolElectra(context.Context, *AttestationPoolRequest) (*AttestationPoolElectraResponse, error) ListBeaconBlocks(context.Context, *ListBlocksRequest) (*ListBeaconBlocksResponse, error) // Deprecated: Do not use. GetChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) @@ -4981,6 +5351,7 @@ type BeaconChainServer interface { GetValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) GetBeaconConfig(context.Context, *emptypb.Empty) (*BeaconConfig, error) SubmitAttesterSlashing(context.Context, *AttesterSlashing) (*SubmitSlashingResponse, error) + SubmitAttesterSlashingElectra(context.Context, *AttesterSlashingElectra) (*SubmitSlashingResponse, error) SubmitProposerSlashing(context.Context, *ProposerSlashing) (*SubmitSlashingResponse, error) GetIndividualVotes(context.Context, *IndividualVotesRequest) (*IndividualVotesRespond, error) } @@ -4992,12 +5363,21 @@ type UnimplementedBeaconChainServer struct { func (*UnimplementedBeaconChainServer) ListAttestations(context.Context, *ListAttestationsRequest) (*ListAttestationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAttestations not implemented") } +func (*UnimplementedBeaconChainServer) ListAttestationsElectra(context.Context, *ListAttestationsRequest) (*ListAttestationsElectraResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAttestationsElectra not implemented") +} func (*UnimplementedBeaconChainServer) ListIndexedAttestations(context.Context, *ListIndexedAttestationsRequest) (*ListIndexedAttestationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListIndexedAttestations not implemented") } +func (*UnimplementedBeaconChainServer) ListIndexedAttestationsElectra(context.Context, *ListIndexedAttestationsRequest) (*ListIndexedAttestationsElectraResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListIndexedAttestationsElectra not implemented") +} func (*UnimplementedBeaconChainServer) AttestationPool(context.Context, *AttestationPoolRequest) (*AttestationPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AttestationPool not implemented") } +func (*UnimplementedBeaconChainServer) AttestationPoolElectra(context.Context, *AttestationPoolRequest) (*AttestationPoolElectraResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AttestationPoolElectra not implemented") +} func (*UnimplementedBeaconChainServer) ListBeaconBlocks(context.Context, *ListBlocksRequest) (*ListBeaconBlocksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListBeaconBlocks not implemented") } @@ -5037,6 +5417,9 @@ func (*UnimplementedBeaconChainServer) GetBeaconConfig(context.Context, *emptypb func (*UnimplementedBeaconChainServer) SubmitAttesterSlashing(context.Context, *AttesterSlashing) (*SubmitSlashingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitAttesterSlashing not implemented") } +func (*UnimplementedBeaconChainServer) SubmitAttesterSlashingElectra(context.Context, *AttesterSlashingElectra) (*SubmitSlashingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitAttesterSlashingElectra not implemented") +} func (*UnimplementedBeaconChainServer) SubmitProposerSlashing(context.Context, *ProposerSlashing) (*SubmitSlashingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProposerSlashing not implemented") } @@ -5066,6 +5449,24 @@ func _BeaconChain_ListAttestations_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _BeaconChain_ListAttestationsElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAttestationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconChainServer).ListAttestationsElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconChainServer).ListAttestationsElectra(ctx, req.(*ListAttestationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconChain_ListIndexedAttestations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListIndexedAttestationsRequest) if err := dec(in); err != nil { @@ -5084,6 +5485,24 @@ func _BeaconChain_ListIndexedAttestations_Handler(srv interface{}, ctx context.C return interceptor(ctx, in, info, handler) } +func _BeaconChain_ListIndexedAttestationsElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListIndexedAttestationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconChainServer).ListIndexedAttestationsElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconChainServer).ListIndexedAttestationsElectra(ctx, req.(*ListIndexedAttestationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconChain_AttestationPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttestationPoolRequest) if err := dec(in); err != nil { @@ -5102,6 +5521,24 @@ func _BeaconChain_AttestationPool_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _BeaconChain_AttestationPoolElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AttestationPoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconChainServer).AttestationPoolElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconChainServer).AttestationPoolElectra(ctx, req.(*AttestationPoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconChain_ListBeaconBlocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListBlocksRequest) if err := dec(in); err != nil { @@ -5336,6 +5773,24 @@ func _BeaconChain_SubmitAttesterSlashing_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _BeaconChain_SubmitAttesterSlashingElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AttesterSlashingElectra) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconChainServer).SubmitAttesterSlashingElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconChainServer).SubmitAttesterSlashingElectra(ctx, req.(*AttesterSlashingElectra)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconChain_SubmitProposerSlashing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ProposerSlashing) if err := dec(in); err != nil { @@ -5380,14 +5835,26 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ MethodName: "ListAttestations", Handler: _BeaconChain_ListAttestations_Handler, }, + { + MethodName: "ListAttestationsElectra", + Handler: _BeaconChain_ListAttestationsElectra_Handler, + }, { MethodName: "ListIndexedAttestations", Handler: _BeaconChain_ListIndexedAttestations_Handler, }, + { + MethodName: "ListIndexedAttestationsElectra", + Handler: _BeaconChain_ListIndexedAttestationsElectra_Handler, + }, { MethodName: "AttestationPool", Handler: _BeaconChain_AttestationPool_Handler, }, + { + MethodName: "AttestationPoolElectra", + Handler: _BeaconChain_AttestationPoolElectra_Handler, + }, { MethodName: "ListBeaconBlocks", Handler: _BeaconChain_ListBeaconBlocks_Handler, @@ -5440,6 +5907,10 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitAttesterSlashing", Handler: _BeaconChain_SubmitAttesterSlashing_Handler, }, + { + MethodName: "SubmitAttesterSlashingElectra", + Handler: _BeaconChain_SubmitAttesterSlashingElectra_Handler, + }, { MethodName: "SubmitProposerSlashing", Handler: _BeaconChain_SubmitProposerSlashing_Handler, diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go index 6622c0bcfcde..a7f81408911e 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go @@ -71,6 +71,42 @@ func local_request_BeaconChain_ListAttestations_0(ctx context.Context, marshaler } +var ( + filter_BeaconChain_ListAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAttestationsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAttestationsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListAttestationsElectra(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_BeaconChain_ListIndexedAttestations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -107,6 +143,42 @@ func local_request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, ma } +var ( + filter_BeaconChain_ListIndexedAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListIndexedAttestationsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListIndexedAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListIndexedAttestationsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListIndexedAttestationsElectra(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_BeaconChain_AttestationPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -143,6 +215,42 @@ func local_request_BeaconChain_AttestationPool_0(ctx context.Context, marshaler } +var ( + filter_BeaconChain_AttestationPoolElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AttestationPoolRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AttestationPoolElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AttestationPoolRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AttestationPoolElectra(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_BeaconChain_ListBeaconBlocks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -557,6 +665,42 @@ func local_request_BeaconChain_SubmitAttesterSlashing_0(ctx context.Context, mar } +var ( + filter_BeaconChain_SubmitAttesterSlashingElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AttesterSlashingElectra + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SubmitAttesterSlashingElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AttesterSlashingElectra + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SubmitAttesterSlashingElectra(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_BeaconChain_SubmitProposerSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -658,6 +802,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -681,6 +848,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -704,6 +894,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1003,6 +1216,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1110,6 +1346,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1130,6 +1386,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1150,6 +1426,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1410,6 +1706,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1456,10 +1772,16 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux var ( pattern_BeaconChain_ListAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations"}, "")) + pattern_BeaconChain_ListAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations_electra"}, "")) + pattern_BeaconChain_ListIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed"}, "")) + pattern_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed_electra"}, "")) + pattern_BeaconChain_AttestationPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool"}, "")) + pattern_BeaconChain_AttestationPoolElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool_electra"}, "")) + pattern_BeaconChain_ListBeaconBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "beacon", "blocks"}, "")) pattern_BeaconChain_GetChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "chainhead"}, "")) @@ -1486,6 +1808,8 @@ var ( pattern_BeaconChain_SubmitAttesterSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit"}, "")) + pattern_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit_electra"}, "")) + pattern_BeaconChain_SubmitProposerSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "proposer", "submit"}, "")) pattern_BeaconChain_GetIndividualVotes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "individual_votes"}, "")) @@ -1494,10 +1818,16 @@ var ( var ( forward_BeaconChain_ListAttestations_0 = runtime.ForwardResponseMessage + forward_BeaconChain_ListAttestationsElectra_0 = runtime.ForwardResponseMessage + forward_BeaconChain_ListIndexedAttestations_0 = runtime.ForwardResponseMessage + forward_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.ForwardResponseMessage + forward_BeaconChain_AttestationPool_0 = runtime.ForwardResponseMessage + forward_BeaconChain_AttestationPoolElectra_0 = runtime.ForwardResponseMessage + forward_BeaconChain_ListBeaconBlocks_0 = runtime.ForwardResponseMessage forward_BeaconChain_GetChainHead_0 = runtime.ForwardResponseMessage @@ -1524,6 +1854,8 @@ var ( forward_BeaconChain_SubmitAttesterSlashing_0 = runtime.ForwardResponseMessage + forward_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.ForwardResponseMessage + forward_BeaconChain_SubmitProposerSlashing_0 = runtime.ForwardResponseMessage forward_BeaconChain_GetIndividualVotes_0 = runtime.ForwardResponseMessage diff --git a/proto/prysm/v1alpha1/beacon_chain.proto b/proto/prysm/v1alpha1/beacon_chain.proto index 0201e4c4cfa3..b6d24cb4d5ec 100644 --- a/proto/prysm/v1alpha1/beacon_chain.proto +++ b/proto/prysm/v1alpha1/beacon_chain.proto @@ -47,6 +47,18 @@ service BeaconChain { }; } + // Retrieve attestations by block root, slot, or epoch. + // + // The server may return an empty list when no attestations match the given + // filter criteria. This RPC should not return NOT_FOUND. Only one filter + // criteria should be used. This endpoint allows for retrieval of genesis + // information via a boolean query filter. + rpc ListAttestationsElectra(ListAttestationsRequest) returns (ListAttestationsElectraResponse) { + option (google.api.http) = { + get: "/eth/v1alpha1/beacon/attestations_electra" + }; + } + // Retrieve indexed attestations by block root, slot, or epoch. // // The server may return an empty list when no indexed attestations match the given @@ -59,6 +71,18 @@ service BeaconChain { }; } + // Retrieve indexed attestations by block root, slot, or epoch. + // + // The server may return an empty list when no indexed attestations match the given + // filter criteria. This RPC should not return NOT_FOUND. Only one filter + // criteria should be used. This endpoint allows for retrieval of genesis + // information via a boolean query filter. + rpc ListIndexedAttestationsElectra(ListIndexedAttestationsRequest) returns (ListIndexedAttestationsElectraResponse) { + option (google.api.http) = { + get: "/eth/v1alpha1/beacon/attestations/indexed_electra" + }; + } + // Retrieve attestations from pool. // // The server returns a list of attestations that have been seen but not @@ -74,6 +98,21 @@ service BeaconChain { }; } + // Retrieve attestations from pool. + // + // The server returns a list of attestations that have been seen but not + // yet processed. Pool attestations eventually expire as the slot + // advances, so an attestation missing from this request does not imply + // that it was included in a block. The attestation may have expired. + // Refer to the Ethereum Beacon Chain specification for more details on how + // attestations are processed and when they are no longer valid. + // https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#attestations + rpc AttestationPoolElectra(AttestationPoolRequest) returns (AttestationPoolElectraResponse) { + option (google.api.http) = { + get: "/eth/v1alpha1/beacon/attestations/pool_electra" + }; + } + // Retrieve blocks by root, slot, or epoch. // // The server may return multiple blocks in the case that a slot or epoch is @@ -205,6 +244,13 @@ service BeaconChain { }; } + // Submit an attester slashing object to the beacon node. + rpc SubmitAttesterSlashingElectra(AttesterSlashingElectra) returns (SubmitSlashingResponse) { + option (google.api.http) = { + get: "/eth/v1alpha1/beacon/slashings/attester/submit_electra" + }; + } + // Submit a proposer slashing object to the beacon node. rpc SubmitProposerSlashing(ProposerSlashing) returns (SubmitSlashingResponse) { option (google.api.http) = { @@ -274,6 +320,18 @@ message ListAttestationsResponse { int32 total_size = 3; } +message ListAttestationsElectraResponse { + repeated AttestationElectra attestations = 1; + + // A pagination token returned from a previous call to `ListAttestations` + // that indicates from where listing should continue. + // This field is optional. + string next_page_token = 2; + + // Total count of Attestations matching the request filter. + int32 total_size = 3; +} + message ListIndexedAttestationsResponse { repeated IndexedAttestation indexed_attestations = 1; @@ -286,6 +344,18 @@ message ListIndexedAttestationsResponse { int32 total_size = 3; } +message ListIndexedAttestationsElectraResponse { + repeated IndexedAttestationElectra indexed_attestations = 1; + + // A pagination token returned from a previous call to `ListIndexedAttestations` + // that indicates from where listing should continue. + // This field is optional. + string next_page_token = 2; + + // Total count of Attestations matching the request filter. + int32 total_size = 3; +} + message ListBlocksRequest { oneof query_filter { // Block root filter to return a single block. @@ -780,6 +850,19 @@ message AttestationPoolResponse { int32 total_size = 3; } +message AttestationPoolElectraResponse { + // List of attestations currently in the pool of the beacon chain. + repeated AttestationElectra attestations = 1; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + // This field is optional. + string next_page_token = 2; + + // Total count of objects matching the request filter. + int32 total_size = 3; +} + // Information about the configuration parameters of the beacon node, such // as the slots per epoch, slots per eth1 voting period, and more. message BeaconConfig { diff --git a/testing/util/attestation.go b/testing/util/attestation.go index 2daabe9715a5..b0a79d727569 100644 --- a/testing/util/attestation.go +++ b/testing/util/attestation.go @@ -23,7 +23,7 @@ import ( log "github.com/sirupsen/logrus" ) -// NewAttestation creates an attestation block with minimum marshalable fields. +// NewAttestation creates a block attestation with minimum marshalable fields. func NewAttestation() *ethpb.Attestation { return ðpb.Attestation{ AggregationBits: bitfield.Bitlist{0b1101}, @@ -40,6 +40,26 @@ func NewAttestation() *ethpb.Attestation { } } +// NewAttestationElectra creates a block attestation with minimum marshalable fields. +func NewAttestationElectra() *ethpb.AttestationElectra { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + return ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b1101}, + CommitteeBits: cb, + Data: ðpb.AttestationData{ + BeaconBlockRoot: make([]byte, fieldparams.RootLength), + Source: ðpb.Checkpoint{ + Root: make([]byte, fieldparams.RootLength), + }, + Target: ðpb.Checkpoint{ + Root: make([]byte, fieldparams.RootLength), + }, + }, + Signature: make([]byte, 96), + } +} + // GenerateAttestations creates attestations that are entirely valid, for all // the committees of the current state slot. This function expects attestations // requested to be cleanly divisible by committees per slot. If there is 1 committee From b08e69112716a4e0d0bfcf345e95696f0f42ba6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Sat, 1 Jun 2024 03:36:18 +0900 Subject: [PATCH 125/325] Organize validator flags (#14028) * Organize validator flags * whitespace * fix comment in test * remove unneeded flags --- cmd/prysmctl/validator/cmd.go | 8 ++-- cmd/validator/accounts/accounts.go | 16 +++---- cmd/validator/accounts/backup.go | 8 ++-- cmd/validator/accounts/delete.go | 6 +-- cmd/validator/accounts/delete_test.go | 8 ++-- cmd/validator/accounts/exit.go | 8 ++-- cmd/validator/accounts/import.go | 6 +-- cmd/validator/accounts/list.go | 6 +-- cmd/validator/flags/flags.go | 33 +++++--------- cmd/validator/main.go | 8 ++-- cmd/validator/usage.go | 56 ++++++++++++++++-------- cmd/validator/usage_test.go | 2 +- cmd/validator/wallet/create_test.go | 8 ++-- testing/endtoend/components/validator.go | 2 +- validator/accounts/accounts_list_test.go | 8 ++-- validator/node/node.go | 24 +++++----- 16 files changed, 109 insertions(+), 98 deletions(-) diff --git a/cmd/prysmctl/validator/cmd.go b/cmd/prysmctl/validator/cmd.go index 5c75c3835514..54cb99a5e70d 100644 --- a/cmd/prysmctl/validator/cmd.go +++ b/cmd/prysmctl/validator/cmd.go @@ -160,12 +160,12 @@ var Commands = []*cli.Command{ flags.InteropStartIndex, cmd.GrpcMaxCallRecvMsgSizeFlag, flags.CertFlag, - flags.GrpcHeadersFlag, - flags.GrpcRetriesFlag, - flags.GrpcRetryDelayFlag, + flags.GRPCHeadersFlag, + flags.GRPCRetriesFlag, + flags.GRPCRetryDelayFlag, flags.ExitAllFlag, flags.ForceExitFlag, - flags.VoluntaryExitJSONOutputPath, + flags.VoluntaryExitJSONOutputPathFlag, features.Mainnet, features.SepoliaTestnet, features.HoleskyTestnet, diff --git a/cmd/validator/accounts/accounts.go b/cmd/validator/accounts/accounts.go index 1e904f0b148b..16adf06d6cf1 100644 --- a/cmd/validator/accounts/accounts.go +++ b/cmd/validator/accounts/accounts.go @@ -58,9 +58,9 @@ var Commands = &cli.Command{ flags.BeaconRPCProviderFlag, cmd.GrpcMaxCallRecvMsgSizeFlag, flags.CertFlag, - flags.GrpcHeadersFlag, - flags.GrpcRetriesFlag, - flags.GrpcRetryDelayFlag, + flags.GRPCHeadersFlag, + flags.GRPCRetriesFlag, + flags.GRPCRetryDelayFlag, features.Mainnet, features.SepoliaTestnet, features.HoleskyTestnet, @@ -93,7 +93,7 @@ var Commands = &cli.Command{ flags.WalletPasswordFileFlag, flags.BackupDirFlag, flags.BackupPublicKeysFlag, - flags.BackupPasswordFile, + flags.BackupPasswordFileFlag, features.Mainnet, features.SepoliaTestnet, features.HoleskyTestnet, @@ -160,12 +160,12 @@ var Commands = &cli.Command{ flags.InteropStartIndex, cmd.GrpcMaxCallRecvMsgSizeFlag, flags.CertFlag, - flags.GrpcHeadersFlag, - flags.GrpcRetriesFlag, - flags.GrpcRetryDelayFlag, + flags.GRPCHeadersFlag, + flags.GRPCRetriesFlag, + flags.GRPCRetryDelayFlag, flags.ExitAllFlag, flags.ForceExitFlag, - flags.VoluntaryExitJSONOutputPath, + flags.VoluntaryExitJSONOutputPathFlag, features.Mainnet, features.SepoliaTestnet, features.HoleskyTestnet, diff --git a/cmd/validator/accounts/backup.go b/cmd/validator/accounts/backup.go index 1aaa229b730f..b4ac83f69cea 100644 --- a/cmd/validator/accounts/backup.go +++ b/cmd/validator/accounts/backup.go @@ -23,10 +23,10 @@ func accountsBackup(c *cli.Context) error { dialOpts := client.ConstructDialOptions( c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), c.String(flags.CertFlag.Name), - c.Uint(flags.GrpcRetriesFlag.Name), - c.Duration(flags.GrpcRetryDelayFlag.Name), + c.Uint(flags.GRPCRetriesFlag.Name), + c.Duration(flags.GRPCRetryDelayFlag.Name), ) - grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",") + grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",") opts := []accounts.Option{ accounts.WithWallet(w), @@ -62,7 +62,7 @@ func accountsBackup(c *cli.Context) error { // Ask the user for their desired password for their backed up accounts. backupsPassword, err := prompt.InputPassword( c, - flags.BackupPasswordFile, + flags.BackupPasswordFileFlag, "Enter a new password for your backed up accounts", "Confirm new password", true, diff --git a/cmd/validator/accounts/delete.go b/cmd/validator/accounts/delete.go index 2b501c803794..611cd1643f23 100644 --- a/cmd/validator/accounts/delete.go +++ b/cmd/validator/accounts/delete.go @@ -20,10 +20,10 @@ func accountsDelete(c *cli.Context) error { dialOpts := client.ConstructDialOptions( c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), c.String(flags.CertFlag.Name), - c.Uint(flags.GrpcRetriesFlag.Name), - c.Duration(flags.GrpcRetryDelayFlag.Name), + c.Uint(flags.GRPCRetriesFlag.Name), + c.Duration(flags.GRPCRetryDelayFlag.Name), ) - grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",") + grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",") opts := []accounts.Option{ accounts.WithWallet(w), diff --git a/cmd/validator/accounts/delete_test.go b/cmd/validator/accounts/delete_test.go index 43610f62b06b..c87660888303 100644 --- a/cmd/validator/accounts/delete_test.go +++ b/cmd/validator/accounts/delete_test.go @@ -98,7 +98,7 @@ func setupWalletCtx( set.String(flags.DeletePublicKeysFlag.Name, cfg.deletePublicKeys, "") set.String(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys, "") set.String(flags.BackupDirFlag.Name, cfg.backupDir, "") - set.String(flags.BackupPasswordFile.Name, cfg.backupPasswordFile, "") + set.String(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile, "") set.String(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys, "") set.String(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile, "") set.String(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile, "") @@ -106,7 +106,7 @@ func setupWalletCtx( set.Bool(flags.SkipDepositConfirmationFlag.Name, cfg.skipDepositConfirm, "") set.Bool(flags.SkipMnemonic25thWordCheckFlag.Name, true, "") set.Bool(flags.ExitAllFlag.Name, cfg.exitAll, "") - set.String(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders, "") + set.String(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders, "") if cfg.privateKeyFile != "" { set.String(flags.ImportPrivateKeyFileFlag.Name, cfg.privateKeyFile, "") @@ -120,13 +120,13 @@ func setupWalletCtx( assert.NoError(tb, set.Set(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys)) assert.NoError(tb, set.Set(flags.BackupDirFlag.Name, cfg.backupDir)) assert.NoError(tb, set.Set(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys)) - assert.NoError(tb, set.Set(flags.BackupPasswordFile.Name, cfg.backupPasswordFile)) + assert.NoError(tb, set.Set(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile)) assert.NoError(tb, set.Set(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile)) assert.NoError(tb, set.Set(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile)) assert.NoError(tb, set.Set(flags.NumAccountsFlag.Name, strconv.Itoa(int(cfg.numAccounts)))) assert.NoError(tb, set.Set(flags.SkipDepositConfirmationFlag.Name, strconv.FormatBool(cfg.skipDepositConfirm))) assert.NoError(tb, set.Set(flags.ExitAllFlag.Name, strconv.FormatBool(cfg.exitAll))) - assert.NoError(tb, set.Set(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders)) + assert.NoError(tb, set.Set(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders)) return cli.NewContext(&app, set, nil) } diff --git a/cmd/validator/accounts/exit.go b/cmd/validator/accounts/exit.go index c7f75f3451ac..168657c195a3 100644 --- a/cmd/validator/accounts/exit.go +++ b/cmd/validator/accounts/exit.go @@ -27,10 +27,10 @@ func Exit(c *cli.Context, r io.Reader) error { dialOpts := client.ConstructDialOptions( c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), c.String(flags.CertFlag.Name), - c.Uint(flags.GrpcRetriesFlag.Name), - c.Duration(flags.GrpcRetryDelayFlag.Name), + c.Uint(flags.GRPCRetriesFlag.Name), + c.Duration(flags.GRPCRetryDelayFlag.Name), ) - grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",") + grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",") beaconRPCProvider := c.String(flags.BeaconRPCProviderFlag.Name) if !c.IsSet(flags.Web3SignerURLFlag.Name) && !c.IsSet(flags.WalletDirFlag.Name) && !c.IsSet(flags.InteropNumValidators.Name) { return errors.Errorf("No validators found, please provide a prysm wallet directory via flag --%s "+ @@ -83,7 +83,7 @@ func Exit(c *cli.Context, r io.Reader) error { accounts.WithBeaconRPCProvider(beaconRPCProvider), accounts.WithBeaconRESTApiProvider(c.String(flags.BeaconRESTApiProviderFlag.Name)), accounts.WithGRPCHeaders(grpcHeaders), - accounts.WithExitJSONOutputPath(c.String(flags.VoluntaryExitJSONOutputPath.Name)), + accounts.WithExitJSONOutputPath(c.String(flags.VoluntaryExitJSONOutputPathFlag.Name)), } // Get full set of public keys from the keymanager. validatingPublicKeys, err := km.FetchValidatingPublicKeys(c.Context) diff --git a/cmd/validator/accounts/import.go b/cmd/validator/accounts/import.go index c1ee44c7ea08..11feea9cd695 100644 --- a/cmd/validator/accounts/import.go +++ b/cmd/validator/accounts/import.go @@ -27,10 +27,10 @@ func accountsImport(c *cli.Context) error { dialOpts := client.ConstructDialOptions( c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), c.String(flags.CertFlag.Name), - c.Uint(flags.GrpcRetriesFlag.Name), - c.Duration(flags.GrpcRetryDelayFlag.Name), + c.Uint(flags.GRPCRetriesFlag.Name), + c.Duration(flags.GRPCRetryDelayFlag.Name), ) - grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",") + grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",") opts := []accounts.Option{ accounts.WithWallet(w), diff --git a/cmd/validator/accounts/list.go b/cmd/validator/accounts/list.go index 147b8a8a490e..d502c53fb45c 100644 --- a/cmd/validator/accounts/list.go +++ b/cmd/validator/accounts/list.go @@ -18,10 +18,10 @@ func accountsList(c *cli.Context) error { dialOpts := client.ConstructDialOptions( c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), c.String(flags.CertFlag.Name), - c.Uint(flags.GrpcRetriesFlag.Name), - c.Duration(flags.GrpcRetryDelayFlag.Name), + c.Uint(flags.GRPCRetriesFlag.Name), + c.Duration(flags.GRPCRetryDelayFlag.Name), ) - grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",") + grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",") opts := []accounts.Option{ accounts.WithWallet(w), diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index 037ffaaf95d2..d9822cc7223f 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -91,20 +91,20 @@ var ( Name: "graffiti", Usage: "String to include in proposed blocks.", } - // GrpcRetriesFlag defines the number of times to retry a failed gRPC request. - GrpcRetriesFlag = &cli.UintFlag{ + // GRPCRetriesFlag defines the number of times to retry a failed gRPC request. + GRPCRetriesFlag = &cli.UintFlag{ Name: "grpc-retries", Usage: "Number of attempts to retry gRPC requests.", Value: 5, } - // GrpcRetryDelayFlag defines the interval to retry a failed gRPC request. - GrpcRetryDelayFlag = &cli.DurationFlag{ + // GRPCRetryDelayFlag defines the interval to retry a failed gRPC request. + GRPCRetryDelayFlag = &cli.DurationFlag{ Name: "grpc-retry-delay", Usage: "Amount of time between gRPC retry requests.", Value: 1 * time.Second, } - // GrpcHeadersFlag defines a list of headers to send with all gRPC requests. - GrpcHeadersFlag = &cli.StringFlag{ + // GRPCHeadersFlag defines a list of headers to send with all gRPC requests. + GRPCHeadersFlag = &cli.StringFlag{ Name: "grpc-headers", Usage: `Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls. Example: --grpc-headers=key=value`, @@ -121,8 +121,8 @@ var ( Usage: "Enables gRPC gateway for JSON requests.", Value: 7500, } - // GPRCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway. - GPRCGatewayCorsDomain = &cli.StringFlag{ + // GRPCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway. + GRPCGatewayCorsDomain = &cli.StringFlag{ Name: "grpc-gateway-corsdomain", Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced). This flag has no effect if not used with --grpc-gateway-port. @@ -142,7 +142,6 @@ var ( Value: filepath.Join(filepath.Join(DefaultValidatorDir(), WalletDefaultDirName), api.AuthTokenFileName), Aliases: []string{"validator-api-bearer-file"}, } - // WalletDirFlag defines the path to a wallet directory for Prysm accounts. WalletDirFlag = &cli.StringFlag{ Name: "wallet-dir", @@ -184,7 +183,6 @@ var ( Name: "mnemonic-language", Usage: "Allows specifying mnemonic language. Supported languages are: english|chinese_traditional|chinese_simplified|czech|french|japanese|korean|italian|spanish.", } - // ShowPrivateKeysFlag for accounts. ShowPrivateKeysFlag = &cli.BoolFlag{ Name: "show-private-keys", @@ -236,14 +234,15 @@ var ( Name: "force-exit", Usage: "Exits without displaying the confirmation prompt.", } - VoluntaryExitJSONOutputPath = &cli.StringFlag{ + // VoluntaryExitJSONOutputPathFlag to write voluntary exits as JSON files instead of broadcasting them. + VoluntaryExitJSONOutputPathFlag = &cli.StringFlag{ Name: "exit-json-output-dir", Usage: "Output directory to write voluntary exits as individual unencrypted JSON " + "files. If this flag is provided, voluntary exits will be written to the provided " + "directory and will not be broadcasted.", } - // BackupPasswordFile for encrypting accounts a user wishes to back up. - BackupPasswordFile = &cli.StringFlag{ + // BackupPasswordFileFlag for encrypting accounts a user wishes to back up. + BackupPasswordFileFlag = &cli.StringFlag{ Name: "backup-password-file", Usage: "Path to a plain-text, .txt file containing the desired password for your backed up accounts.", Value: "", @@ -264,7 +263,6 @@ var ( Name: "keys-dir", Usage: "Path to a directory where keystores to be imported are stored.", } - // RemoteSignerCertPathFlag defines the path to a client.crt file for a wallet to connect to // a secure signer via TLS and gRPC. RemoteSignerCertPathFlag = &cli.StringFlag{ @@ -294,7 +292,6 @@ var ( Usage: "URL for consensys' web3signer software to use with the Prysm validator client.", Value: "", } - // Web3SignerPublicValidatorKeysFlag defines a comma-separated list of hex string public keys or external url for web3signer to use for validator signing. // example with external url: --validators-external-signer-public-keys= https://web3signer.com/api/v1/eth2/publicKeys // example with public key: --validators-external-signer-public-keys=0xa99a...e44c,0xb89b...4a0b @@ -303,7 +300,6 @@ var ( Name: "validators-external-signer-public-keys", Usage: "Comma separated list of public keys OR an external url endpoint for the validator to retrieve public keys from for usage with web3signer.", } - // KeymanagerKindFlag defines the kind of keymanager desired by a user during wallet creation. KeymanagerKindFlag = &cli.StringFlag{ Name: "keymanager-kind", @@ -348,7 +344,6 @@ var ( fee recipient and gas limit. File format found in docs`, Value: "", } - // SuggestedFeeRecipientFlag defines the address of the fee recipient. SuggestedFeeRecipientFlag = &cli.StringFlag{ Name: "suggested-fee-recipient", @@ -358,7 +353,6 @@ var ( --` + ProposerSettingsFlag.Name + " or --" + ProposerSettingsURLFlag.Name + " flags.", Value: params.BeaconConfig().EthBurnAddressHex, } - // EnableBuilderFlag enables the periodic validator registration API calls that will update the custom builder with validator settings. EnableBuilderFlag = &cli.BoolFlag{ Name: "enable-builder", @@ -368,21 +362,18 @@ var ( Value: false, Aliases: []string{"enable-validator-registration"}, } - // BuilderGasLimitFlag defines the gas limit for the builder to use for constructing a payload. BuilderGasLimitFlag = &cli.StringFlag{ Name: "suggested-gas-limit", Usage: "Sets gas limit for the builder to use for constructing a payload for all the validators.", Value: fmt.Sprint(params.BeaconConfig().DefaultBuilderGasLimit), } - // ValidatorsRegistrationBatchSizeFlag sets the maximum size for one batch of validator registrations. Use a non-positive value to disable batching. ValidatorsRegistrationBatchSizeFlag = &cli.IntFlag{ Name: "validators-registration-batch-size", Usage: "Sets the maximum size for one batch of validator registrations. Use a non-positive value to disable batching.", Value: 0, } - // EnableDistributed enables the usage of prysm validator client in a Distributed Validator Cluster. EnableDistributed = &cli.BoolFlag{ Name: "distributed", diff --git a/cmd/validator/main.go b/cmd/validator/main.go index 4251a720f30c..f5ca240ee05a 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -62,10 +62,10 @@ var appFlags = []cli.Flag{ flags.RPCPort, flags.GRPCGatewayPort, flags.GRPCGatewayHost, - flags.GrpcRetriesFlag, - flags.GrpcRetryDelayFlag, - flags.GrpcHeadersFlag, - flags.GPRCGatewayCorsDomain, + flags.GRPCRetriesFlag, + flags.GRPCRetryDelayFlag, + flags.GRPCHeadersFlag, + flags.GRPCGatewayCorsDomain, flags.DisableAccountMetricsFlag, flags.MonitoringPortFlag, flags.SlasherRPCProviderFlag, diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index 900af603f12c..cef63780bba8 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -56,6 +56,8 @@ var appHelpFlagGroups = []flagGroup{ cmd.E2EConfigFlag, cmd.VerbosityFlag, cmd.DataDirFlag, + flags.WalletDirFlag, + flags.WalletPasswordFileFlag, cmd.ClearDB, cmd.ForceClearDB, cmd.EnableBackupWebhookFlag, @@ -90,38 +92,56 @@ var appHelpFlagGroups = []flagGroup{ }, }, { - Name: "validator", + Name: "rpc", Flags: []cli.Flag{ + flags.CertFlag, flags.BeaconRPCProviderFlag, flags.BeaconRPCGatewayProviderFlag, - flags.BeaconRESTApiProviderFlag, - flags.CertFlag, - flags.EnableWebFlag, - flags.DisablePenaltyRewardLogFlag, - flags.GraffitiFlag, flags.EnableRPCFlag, flags.RPCHost, flags.RPCPort, flags.GRPCGatewayPort, flags.GRPCGatewayHost, - flags.GrpcRetriesFlag, - flags.GrpcRetryDelayFlag, - flags.GPRCGatewayCorsDomain, - flags.GrpcHeadersFlag, - flags.SlasherRPCProviderFlag, - flags.SlasherCertFlag, - flags.DisableAccountMetricsFlag, - flags.WalletDirFlag, - flags.WalletPasswordFileFlag, - flags.GraffitiFileFlag, - flags.Web3SignerURLFlag, - flags.Web3SignerPublicValidatorKeysFlag, + flags.GRPCRetriesFlag, + flags.GRPCRetryDelayFlag, + flags.GRPCGatewayCorsDomain, + flags.GRPCHeadersFlag, + flags.BeaconRESTApiProviderFlag, + }, + }, + { + Name: "proposer", + Flags: []cli.Flag{ flags.ProposerSettingsFlag, flags.ProposerSettingsURLFlag, flags.SuggestedFeeRecipientFlag, flags.EnableBuilderFlag, flags.BuilderGasLimitFlag, flags.ValidatorsRegistrationBatchSizeFlag, + flags.GraffitiFlag, + flags.GraffitiFileFlag, + }, + }, + { + Name: "remote signer", + Flags: []cli.Flag{ + flags.Web3SignerURLFlag, + flags.Web3SignerPublicValidatorKeysFlag, + }, + }, + { + Name: "slasher", + Flags: []cli.Flag{ + flags.SlasherRPCProviderFlag, + flags.SlasherCertFlag, + }, + }, + { + Name: "misc", + Flags: []cli.Flag{ + flags.EnableWebFlag, + flags.DisablePenaltyRewardLogFlag, + flags.DisableAccountMetricsFlag, flags.EnableDistributed, flags.AuthTokenPathFlag, }, diff --git a/cmd/validator/usage_test.go b/cmd/validator/usage_test.go index c5bc52c2942f..633d90d464ac 100644 --- a/cmd/validator/usage_test.go +++ b/cmd/validator/usage_test.go @@ -10,7 +10,7 @@ import ( func TestAllFlagsExistInHelp(t *testing.T) { // If this test is failing, it is because you've recently added/removed a - // flag in beacon chain main.go, but did not add/remove it to the usage.go + // flag in main.go, but did not add/remove it to the usage.go // flag grouping (appHelpFlagGroups). var helpFlags []cli.Flag diff --git a/cmd/validator/wallet/create_test.go b/cmd/validator/wallet/create_test.go index 929394a693e2..d81cb6bd42f3 100644 --- a/cmd/validator/wallet/create_test.go +++ b/cmd/validator/wallet/create_test.go @@ -68,7 +68,7 @@ func SetupWalletCtx( set.String(flags.DeletePublicKeysFlag.Name, cfg.deletePublicKeys, "") set.String(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys, "") set.String(flags.BackupDirFlag.Name, cfg.backupDir, "") - set.String(flags.BackupPasswordFile.Name, cfg.backupPasswordFile, "") + set.String(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile, "") set.String(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys, "") set.String(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile, "") set.String(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile, "") @@ -76,7 +76,7 @@ func SetupWalletCtx( set.Bool(flags.SkipDepositConfirmationFlag.Name, cfg.skipDepositConfirm, "") set.Bool(flags.SkipMnemonic25thWordCheckFlag.Name, true, "") set.Bool(flags.ExitAllFlag.Name, cfg.exitAll, "") - set.String(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders, "") + set.String(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders, "") if cfg.privateKeyFile != "" { set.String(flags.ImportPrivateKeyFileFlag.Name, cfg.privateKeyFile, "") @@ -90,13 +90,13 @@ func SetupWalletCtx( assert.NoError(tb, set.Set(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys)) assert.NoError(tb, set.Set(flags.BackupDirFlag.Name, cfg.backupDir)) assert.NoError(tb, set.Set(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys)) - assert.NoError(tb, set.Set(flags.BackupPasswordFile.Name, cfg.backupPasswordFile)) + assert.NoError(tb, set.Set(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile)) assert.NoError(tb, set.Set(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile)) assert.NoError(tb, set.Set(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile)) assert.NoError(tb, set.Set(flags.NumAccountsFlag.Name, strconv.Itoa(int(cfg.numAccounts)))) assert.NoError(tb, set.Set(flags.SkipDepositConfirmationFlag.Name, strconv.FormatBool(cfg.skipDepositConfirm))) assert.NoError(tb, set.Set(flags.ExitAllFlag.Name, strconv.FormatBool(cfg.exitAll))) - assert.NoError(tb, set.Set(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders)) + assert.NoError(tb, set.Set(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders)) return cli.NewContext(&app, set, nil) } diff --git a/testing/endtoend/components/validator.go b/testing/endtoend/components/validator.go index c57b18eb2687..042a49bc7e55 100644 --- a/testing/endtoend/components/validator.go +++ b/testing/endtoend/components/validator.go @@ -229,7 +229,7 @@ func (v *ValidatorNode) Start(ctx context.Context) error { fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.ValidatorGatewayPort+index), fmt.Sprintf("--%s=localhost:%d", flags.BeaconRPCProviderFlag.Name, beaconRPCPort), - fmt.Sprintf("--%s=%s", flags.GrpcHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything. + fmt.Sprintf("--%s=%s", flags.GRPCHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything. fmt.Sprintf("--%s=%s", cmdshared.VerbosityFlag.Name, "debug"), fmt.Sprintf("--%s=%s", flags.ProposerSettingsFlag.Name, proposerSettingsPathPath), fmt.Sprintf("--%s=%s", cmdshared.ChainConfigFileFlag.Name, cfgPath), diff --git a/validator/accounts/accounts_list_test.go b/validator/accounts/accounts_list_test.go index 69703c8f6c11..7724df8626f5 100644 --- a/validator/accounts/accounts_list_test.go +++ b/validator/accounts/accounts_list_test.go @@ -65,7 +65,7 @@ func setupWalletCtx( set.String(flags.DeletePublicKeysFlag.Name, cfg.deletePublicKeys, "") set.String(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys, "") set.String(flags.BackupDirFlag.Name, cfg.backupDir, "") - set.String(flags.BackupPasswordFile.Name, cfg.backupPasswordFile, "") + set.String(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile, "") set.String(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys, "") set.String(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile, "") set.String(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile, "") @@ -73,7 +73,7 @@ func setupWalletCtx( set.Bool(flags.SkipDepositConfirmationFlag.Name, cfg.skipDepositConfirm, "") set.Bool(flags.SkipMnemonic25thWordCheckFlag.Name, true, "") set.Bool(flags.ExitAllFlag.Name, cfg.exitAll, "") - set.String(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders, "") + set.String(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders, "") if cfg.privateKeyFile != "" { set.String(flags.ImportPrivateKeyFileFlag.Name, cfg.privateKeyFile, "") @@ -87,13 +87,13 @@ func setupWalletCtx( assert.NoError(tb, set.Set(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys)) assert.NoError(tb, set.Set(flags.BackupDirFlag.Name, cfg.backupDir)) assert.NoError(tb, set.Set(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys)) - assert.NoError(tb, set.Set(flags.BackupPasswordFile.Name, cfg.backupPasswordFile)) + assert.NoError(tb, set.Set(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile)) assert.NoError(tb, set.Set(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile)) assert.NoError(tb, set.Set(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile)) assert.NoError(tb, set.Set(flags.NumAccountsFlag.Name, strconv.Itoa(int(cfg.numAccounts)))) assert.NoError(tb, set.Set(flags.SkipDepositConfirmationFlag.Name, strconv.FormatBool(cfg.skipDepositConfirm))) assert.NoError(tb, set.Set(flags.ExitAllFlag.Name, strconv.FormatBool(cfg.exitAll))) - assert.NoError(tb, set.Set(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders)) + assert.NoError(tb, set.Set(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders)) return cli.NewContext(&app, set, nil) } diff --git a/validator/node/node.go b/validator/node/node.go index 4529287cfaab..aee6e841f718 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -149,10 +149,10 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { func newRouter(cliCtx *cli.Context) *mux.Router { var allowedOrigins []string - if cliCtx.IsSet(flags.GPRCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") + if cliCtx.IsSet(flags.GRPCGatewayCorsDomain.Name) { + allowedOrigins = strings.Split(cliCtx.String(flags.GRPCGatewayCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GPRCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") } r := mux.NewRouter() r.Use(server.NormalizeQueryValuesHandler) @@ -523,9 +523,9 @@ func (c *ValidatorClient) registerValidatorService(cliCtx *cli.Context) error { Wallet: c.wallet, WalletInitializedFeed: c.walletInitializedFeed, GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), - GRPCRetries: c.cliCtx.Uint(flags.GrpcRetriesFlag.Name), - GRPCRetryDelay: c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name), - GRPCHeaders: strings.Split(c.cliCtx.String(flags.GrpcHeadersFlag.Name), ","), + GRPCRetries: c.cliCtx.Uint(flags.GRPCRetriesFlag.Name), + GRPCRetryDelay: c.cliCtx.Duration(flags.GRPCRetryDelayFlag.Name), + GRPCHeaders: strings.Split(c.cliCtx.String(flags.GRPCHeadersFlag.Name), ","), BeaconNodeGRPCEndpoint: c.cliCtx.String(flags.BeaconRPCProviderFlag.Name), BeaconNodeCert: c.cliCtx.String(flags.CertFlag.Name), BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRESTApiProviderFlag.Name), @@ -630,9 +630,9 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { GRPCGatewayHost: c.cliCtx.String(flags.GRPCGatewayHost.Name), GRPCGatewayPort: c.cliCtx.Int(flags.GRPCGatewayPort.Name), GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), - GRPCRetries: c.cliCtx.Uint(flags.GrpcRetriesFlag.Name), - GRPCRetryDelay: c.cliCtx.Duration(flags.GrpcRetryDelayFlag.Name), - GRPCHeaders: strings.Split(c.cliCtx.String(flags.GrpcHeadersFlag.Name), ","), + GRPCRetries: c.cliCtx.Uint(flags.GRPCRetriesFlag.Name), + GRPCRetryDelay: c.cliCtx.Duration(flags.GRPCRetryDelayFlag.Name), + GRPCHeaders: strings.Split(c.cliCtx.String(flags.GRPCHeadersFlag.Name), ","), BeaconNodeGRPCEndpoint: c.cliCtx.String(flags.BeaconRPCProviderFlag.Name), BeaconApiEndpoint: c.cliCtx.String(flags.BeaconRESTApiProviderFlag.Name), BeaconApiTimeout: time.Second * 30, @@ -663,10 +663,10 @@ func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { gatewayAddress := net.JoinHostPort(gatewayHost, fmt.Sprintf("%d", gatewayPort)) timeout := c.cliCtx.Int(cmd.ApiTimeoutFlag.Name) var allowedOrigins []string - if c.cliCtx.IsSet(flags.GPRCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(c.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") + if c.cliCtx.IsSet(flags.GRPCGatewayCorsDomain.Name) { + allowedOrigins = strings.Split(c.cliCtx.String(flags.GRPCGatewayCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GPRCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") } maxCallSize := c.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) From 44d850de51ddb665471d8a8089753a03e1b4c856 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Mon, 3 Jun 2024 18:50:00 +0800 Subject: [PATCH 126/325] Change It To Debug (#14072) --- beacon-chain/p2p/broadcaster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index 6d8d63257510..d770bff91acc 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -142,7 +142,7 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 log.WithFields(logrus.Fields{ "attestationSlot": att.GetData().Slot, "currentSlot": currSlot, - }).WithError(err).Warning("Attestation is too old to broadcast, discarding it") + }).WithError(err).Debug("Attestation is too old to broadcast, discarding it") return } From 57830435d7b9b2a3c9e7727bf91f90fb54ca84ec Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 3 Jun 2024 12:54:28 -0700 Subject: [PATCH 127/325] Process epoch error to use correct state version (#14069) * Process epoch error to use correct state version * Fix return instead --- beacon-chain/core/altair/transition.go | 38 +++++++-------- beacon-chain/core/altair/transition_test.go | 8 ++-- beacon-chain/core/electra/transition.go | 46 +++++++++---------- .../altair_transition_no_verify_sig_test.go | 2 +- ...bellatrix_transition_no_verify_sig_test.go | 2 +- beacon-chain/core/transition/transition.go | 6 +-- beacon-chain/state/stategen/replay.go | 2 +- 7 files changed, 51 insertions(+), 53 deletions(-) diff --git a/beacon-chain/core/altair/transition.go b/beacon-chain/core/altair/transition.go index 5af0f13fd383..cc060d6203ee 100644 --- a/beacon-chain/core/altair/transition.go +++ b/beacon-chain/core/altair/transition.go @@ -28,87 +28,87 @@ import ( // process_historical_roots_update(state) // process_participation_flag_updates(state) # [New in Altair] // process_sync_committee_updates(state) # [New in Altair] -func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { +func ProcessEpoch(ctx context.Context, state state.BeaconState) error { ctx, span := trace.StartSpan(ctx, "altair.ProcessEpoch") defer span.End() if state == nil || state.IsNil() { - return nil, errors.New("nil state") + return errors.New("nil state") } vp, bp, err := InitializePrecomputeValidators(ctx, state) if err != nil { - return nil, err + return err } // New in Altair. vp, bp, err = ProcessEpochParticipation(ctx, state, bp, vp) if err != nil { - return nil, err + return err } state, err = precompute.ProcessJustificationAndFinalizationPreCompute(state, bp) if err != nil { - return nil, errors.Wrap(err, "could not process justification") + return errors.Wrap(err, "could not process justification") } // New in Altair. state, vp, err = ProcessInactivityScores(ctx, state, vp) if err != nil { - return nil, errors.Wrap(err, "could not process inactivity updates") + return errors.Wrap(err, "could not process inactivity updates") } // New in Altair. state, err = ProcessRewardsAndPenaltiesPrecompute(state, bp, vp) if err != nil { - return nil, errors.Wrap(err, "could not process rewards and penalties") + return errors.Wrap(err, "could not process rewards and penalties") } state, err = e.ProcessRegistryUpdates(ctx, state) if err != nil { - return nil, errors.Wrap(err, "could not process registry updates") + return errors.Wrap(err, "could not process registry updates") } // Modified in Altair and Bellatrix. proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier() if err != nil { - return nil, err + return err } state, err = e.ProcessSlashings(state, proportionalSlashingMultiplier) if err != nil { - return nil, err + return err } state, err = e.ProcessEth1DataReset(state) if err != nil { - return nil, err + return err } state, err = e.ProcessEffectiveBalanceUpdates(state) if err != nil { - return nil, err + return err } state, err = e.ProcessSlashingsReset(state) if err != nil { - return nil, err + return err } state, err = e.ProcessRandaoMixesReset(state) if err != nil { - return nil, err + return err } state, err = e.ProcessHistoricalDataUpdate(state) if err != nil { - return nil, err + return err } // New in Altair. state, err = ProcessParticipationFlagUpdates(state) if err != nil { - return nil, err + return err } // New in Altair. - state, err = ProcessSyncCommitteeUpdates(ctx, state) + _, err = ProcessSyncCommitteeUpdates(ctx, state) if err != nil { - return nil, err + return err } - return state, nil + return nil } diff --git a/beacon-chain/core/altair/transition_test.go b/beacon-chain/core/altair/transition_test.go index 434f7a423e90..e462c9a5cdfa 100644 --- a/beacon-chain/core/altair/transition_test.go +++ b/beacon-chain/core/altair/transition_test.go @@ -13,9 +13,9 @@ import ( func TestProcessEpoch_CanProcess(t *testing.T) { st, _ := util.DeterministicGenesisStateAltair(t, params.BeaconConfig().MaxValidatorsPerCommittee) require.NoError(t, st.SetSlot(10*params.BeaconConfig().SlotsPerEpoch)) - newState, err := altair.ProcessEpoch(context.Background(), st) + err := altair.ProcessEpoch(context.Background(), st) require.NoError(t, err) - require.Equal(t, uint64(0), newState.Slashings()[2], "Unexpected slashed balance") + require.Equal(t, uint64(0), st.Slashings()[2], "Unexpected slashed balance") b := st.Balances() require.Equal(t, params.BeaconConfig().MaxValidatorsPerCommittee, uint64(len(b))) @@ -45,9 +45,9 @@ func TestProcessEpoch_CanProcess(t *testing.T) { func TestProcessEpoch_CanProcessBellatrix(t *testing.T) { st, _ := util.DeterministicGenesisStateBellatrix(t, params.BeaconConfig().MaxValidatorsPerCommittee) require.NoError(t, st.SetSlot(10*params.BeaconConfig().SlotsPerEpoch)) - newState, err := altair.ProcessEpoch(context.Background(), st) + err := altair.ProcessEpoch(context.Background(), st) require.NoError(t, err) - require.Equal(t, uint64(0), newState.Slashings()[2], "Unexpected slashed balance") + require.Equal(t, uint64(0), st.Slashings()[2], "Unexpected slashed balance") b := st.Balances() require.Equal(t, params.BeaconConfig().MaxValidatorsPerCommittee, uint64(len(b))) diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 5f501a4f71bd..12accfccad78 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -46,84 +46,84 @@ var ( // process_effective_balance_updates(state) // process_slashings_reset(state) // process_randao_mixes_reset(state) -func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { +func ProcessEpoch(ctx context.Context, state state.BeaconState) error { _, span := trace.StartSpan(ctx, "electra.ProcessEpoch") defer span.End() if state == nil || state.IsNil() { - return nil, errors.New("nil state") + return errors.New("nil state") } vp, bp, err := InitializePrecomputeValidators(ctx, state) if err != nil { - return nil, err + return err } vp, bp, err = ProcessEpochParticipation(ctx, state, bp, vp) if err != nil { - return nil, err + return err } state, err = precompute.ProcessJustificationAndFinalizationPreCompute(state, bp) if err != nil { - return nil, errors.Wrap(err, "could not process justification") + return errors.Wrap(err, "could not process justification") } state, vp, err = ProcessInactivityScores(ctx, state, vp) if err != nil { - return nil, errors.Wrap(err, "could not process inactivity updates") + return errors.Wrap(err, "could not process inactivity updates") } state, err = ProcessRewardsAndPenaltiesPrecompute(state, bp, vp) if err != nil { - return nil, errors.Wrap(err, "could not process rewards and penalties") + return errors.Wrap(err, "could not process rewards and penalties") } state, err = ProcessRegistryUpdates(ctx, state) if err != nil { - return nil, errors.Wrap(err, "could not process registry updates") + return errors.Wrap(err, "could not process registry updates") } proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier() if err != nil { - return nil, err + return err } state, err = ProcessSlashings(state, proportionalSlashingMultiplier) if err != nil { - return nil, err + return err } state, err = ProcessEth1DataReset(state) if err != nil { - return nil, err + return err } if err = ProcessPendingBalanceDeposits(ctx, state, primitives.Gwei(bp.ActiveCurrentEpoch)); err != nil { - return nil, err + return err } - if err := ProcessPendingConsolidations(ctx, state); err != nil { - return nil, err + if err = ProcessPendingConsolidations(ctx, state); err != nil { + return err } - if err := ProcessEffectiveBalanceUpdates(state); err != nil { - return nil, err + if err = ProcessEffectiveBalanceUpdates(state); err != nil { + return err } state, err = ProcessSlashingsReset(state) if err != nil { - return nil, err + return err } state, err = ProcessRandaoMixesReset(state) if err != nil { - return nil, err + return err } state, err = ProcessHistoricalDataUpdate(state) if err != nil { - return nil, err + return err } state, err = ProcessParticipationFlagUpdates(state) if err != nil { - return nil, err + return err } - state, err = ProcessSyncCommitteeUpdates(ctx, state) + _, err = ProcessSyncCommitteeUpdates(ctx, state) if err != nil { - return nil, err + return err } - return state, nil + return nil } diff --git a/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go b/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go index b49a6c62f37d..783b37f9a9d3 100644 --- a/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go +++ b/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go @@ -226,7 +226,7 @@ func TestProcessEpoch_BadBalanceAltair(t *testing.T) { epochParticipation[0] = participation assert.NoError(t, s.SetCurrentParticipationBits(epochParticipation)) assert.NoError(t, s.SetPreviousParticipationBits(epochParticipation)) - _, err = altair.ProcessEpoch(context.Background(), s) + err = altair.ProcessEpoch(context.Background(), s) assert.ErrorContains(t, "addition overflows", err) } diff --git a/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go b/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go index 68cde2f906f5..cb36c1b8b223 100644 --- a/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go +++ b/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go @@ -216,7 +216,7 @@ func TestProcessEpoch_BadBalanceBellatrix(t *testing.T) { epochParticipation[0] = participation assert.NoError(t, s.SetCurrentParticipationBits(epochParticipation)) assert.NoError(t, s.SetPreviousParticipationBits(epochParticipation)) - _, err = altair.ProcessEpoch(context.Background(), s) + err = altair.ProcessEpoch(context.Background(), s) assert.ErrorContains(t, "addition overflows", err) } diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index fadb5f26785b..d8f4a3b24289 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -257,14 +257,12 @@ func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives. return nil, errors.Wrap(err, "could not process epoch with optimizations") } } else if state.Version() <= version.Deneb { - state, err = altair.ProcessEpoch(ctx, state) - if err != nil { + if err = altair.ProcessEpoch(ctx, state); err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) } } else { - state, err = electra.ProcessEpoch(ctx, state) - if err != nil { + if err = electra.ProcessEpoch(ctx, state); err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) } diff --git a/beacon-chain/state/stategen/replay.go b/beacon-chain/state/stategen/replay.go index 873da6ec4d4b..0ff967762ce6 100644 --- a/beacon-chain/state/stategen/replay.go +++ b/beacon-chain/state/stategen/replay.go @@ -209,7 +209,7 @@ func ReplayProcessSlots(ctx context.Context, state state.BeaconState, slot primi return nil, errors.Wrap(err, "could not process epoch with optimizations") } } else { - state, err = altair.ProcessEpoch(ctx, state) + err = altair.ProcessEpoch(ctx, state) if err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, "could not process epoch") From 1b40f941cf08550a29646670b370c3c1d322c2d9 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:38:21 -0500 Subject: [PATCH 128/325] middleware for content type and accept headers (#14075) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * middleware for content type * adding accept middleware too and tests * Update beacon-chain/rpc/endpoints.go Co-authored-by: Radosław Kapka * Update beacon-chain/rpc/endpoints.go Co-authored-by: Radosław Kapka * Update beacon-chain/rpc/endpoints.go Co-authored-by: Radosław Kapka * Update beacon-chain/rpc/endpoints.go Co-authored-by: Radosław Kapka * including radek's review --------- Co-authored-by: Radosław Kapka --- api/gateway/BUILD.bazel | 2 +- api/gateway/gateway.go | 4 +- api/server/BUILD.bazel | 21 +- api/server/middleware.go | 32 -- api/server/middleware/BUILD.bazel | 29 ++ api/server/middleware/middleware.go | 112 ++++ api/server/middleware/middleware_test.go | 199 +++++++ api/server/{ => middleware}/util.go | 2 +- api/server/{ => middleware}/util_test.go | 2 +- api/server/middleware_test.go | 54 -- beacon-chain/node/BUILD.bazel | 2 +- beacon-chain/node/node.go | 6 +- beacon-chain/rpc/BUILD.bazel | 2 + beacon-chain/rpc/endpoints.go | 636 +++++++++++++++++------ beacon-chain/rpc/service.go | 9 +- validator/node/BUILD.bazel | 2 +- validator/node/node.go | 6 +- 17 files changed, 825 insertions(+), 295 deletions(-) delete mode 100644 api/server/middleware.go create mode 100644 api/server/middleware/BUILD.bazel create mode 100644 api/server/middleware/middleware.go create mode 100644 api/server/middleware/middleware_test.go rename api/server/{ => middleware}/util.go (95%) rename api/server/{ => middleware}/util_test.go (96%) delete mode 100644 api/server/middleware_test.go diff --git a/api/gateway/BUILD.bazel b/api/gateway/BUILD.bazel index 282e7724da97..0aafeb732956 100644 --- a/api/gateway/BUILD.bazel +++ b/api/gateway/BUILD.bazel @@ -14,7 +14,7 @@ go_library( "//validator:__subpackages__", ], deps = [ - "//api/server:go_default_library", + "//api/server/middleware:go_default_library", "//runtime:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", diff --git a/api/gateway/gateway.go b/api/gateway/gateway.go index a78500c5a030..29d6365902ad 100644 --- a/api/gateway/gateway.go +++ b/api/gateway/gateway.go @@ -11,7 +11,7 @@ import ( "github.com/gorilla/mux" gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/server" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/runtime" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" @@ -104,7 +104,7 @@ func (g *Gateway) Start() { } } - corsMux := server.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) + corsMux := middleware.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) if g.cfg.muxHandler != nil { g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/api/server/BUILD.bazel b/api/server/BUILD.bazel index d6d0ef1182ad..ad642cf9e9b5 100644 --- a/api/server/BUILD.bazel +++ b/api/server/BUILD.bazel @@ -2,29 +2,14 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = [ - "error.go", - "middleware.go", - "util.go", - ], + srcs = ["error.go"], importpath = "github.com/prysmaticlabs/prysm/v5/api/server", visibility = ["//visibility:public"], - deps = [ - "@com_github_gorilla_mux//:go_default_library", - "@com_github_rs_cors//:go_default_library", - ], ) go_test( name = "go_default_test", - srcs = [ - "error_test.go", - "middleware_test.go", - "util_test.go", - ], + srcs = ["error_test.go"], embed = [":go_default_library"], - deps = [ - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - ], + deps = ["//testing/assert:go_default_library"], ) diff --git a/api/server/middleware.go b/api/server/middleware.go deleted file mode 100644 index 13afd71fbc70..000000000000 --- a/api/server/middleware.go +++ /dev/null @@ -1,32 +0,0 @@ -package server - -import ( - "net/http" - - "github.com/gorilla/mux" - "github.com/rs/cors" -) - -// NormalizeQueryValuesHandler normalizes an input query of "key=value1,value2,value3" to "key=value1&key=value2&key=value3" -func NormalizeQueryValuesHandler(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - NormalizeQueryValues(query) - r.URL.RawQuery = query.Encode() - - next.ServeHTTP(w, r) - }) -} - -// CorsHandler sets the cors settings on api endpoints -func CorsHandler(allowOrigins []string) mux.MiddlewareFunc { - c := cors.New(cors.Options{ - AllowedOrigins: allowOrigins, - AllowedMethods: []string{http.MethodPost, http.MethodGet, http.MethodDelete, http.MethodOptions}, - AllowCredentials: true, - MaxAge: 600, - AllowedHeaders: []string{"*"}, - }) - - return c.Handler -} diff --git a/api/server/middleware/BUILD.bazel b/api/server/middleware/BUILD.bazel new file mode 100644 index 000000000000..c210e5049dad --- /dev/null +++ b/api/server/middleware/BUILD.bazel @@ -0,0 +1,29 @@ +load("@prysm//tools/go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = [ + "middleware.go", + "util.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/api/server/middleware", + visibility = ["//visibility:public"], + deps = [ + "@com_github_gorilla_mux//:go_default_library", + "@com_github_rs_cors//:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = [ + "middleware_test.go", + "util_test.go", + ], + embed = [":go_default_library"], + deps = [ + "//api:go_default_library", + "//testing/assert:go_default_library", + "//testing/require:go_default_library", + ], +) diff --git a/api/server/middleware/middleware.go b/api/server/middleware/middleware.go new file mode 100644 index 000000000000..d935fa265ffe --- /dev/null +++ b/api/server/middleware/middleware.go @@ -0,0 +1,112 @@ +package middleware + +import ( + "fmt" + "net/http" + "strings" + + "github.com/gorilla/mux" + "github.com/rs/cors" +) + +// NormalizeQueryValuesHandler normalizes an input query of "key=value1,value2,value3" to "key=value1&key=value2&key=value3" +func NormalizeQueryValuesHandler(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + NormalizeQueryValues(query) + r.URL.RawQuery = query.Encode() + + next.ServeHTTP(w, r) + }) +} + +// CorsHandler sets the cors settings on api endpoints +func CorsHandler(allowOrigins []string) mux.MiddlewareFunc { + c := cors.New(cors.Options{ + AllowedOrigins: allowOrigins, + AllowedMethods: []string{http.MethodPost, http.MethodGet, http.MethodDelete, http.MethodOptions}, + AllowCredentials: true, + MaxAge: 600, + AllowedHeaders: []string{"*"}, + }) + + return c.Handler +} + +// ContentTypeHandler checks request for the appropriate media types otherwise returning a http.StatusUnsupportedMediaType error +func ContentTypeHandler(acceptedMediaTypes []string) mux.MiddlewareFunc { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // skip the GET request + if r.Method == http.MethodGet { + next.ServeHTTP(w, r) + return + } + contentType := r.Header.Get("Content-Type") + if contentType == "" { + http.Error(w, "Content-Type header is missing", http.StatusUnsupportedMediaType) + return + } + + accepted := false + for _, acceptedType := range acceptedMediaTypes { + if strings.TrimSpace(contentType) == strings.TrimSpace(acceptedType) { + accepted = true + break + } + } + + if !accepted { + http.Error(w, fmt.Sprintf("Unsupported media type: %s", contentType), http.StatusUnsupportedMediaType) + return + } + + next.ServeHTTP(w, r) + }) + } +} + +// AcceptHeaderHandler checks if the client's response preference is handled +func AcceptHeaderHandler(serverAcceptedTypes []string) mux.MiddlewareFunc { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + acceptHeader := r.Header.Get("Accept") + // header is optional and should skip if not provided + if acceptHeader == "" { + next.ServeHTTP(w, r) + return + } + + accepted := false + acceptTypes := strings.Split(acceptHeader, ",") + // follows rules defined in https://datatracker.ietf.org/doc/html/rfc2616#section-14.1 + for _, acceptType := range acceptTypes { + acceptType = strings.TrimSpace(acceptType) + if acceptType == "*/*" { + accepted = true + break + } + for _, serverAcceptedType := range serverAcceptedTypes { + if strings.HasPrefix(acceptType, serverAcceptedType) { + accepted = true + break + } + if acceptType != "/*" && strings.HasSuffix(acceptType, "/*") && strings.HasPrefix(serverAcceptedType, acceptType[:len(acceptType)-2]) { + accepted = true + break + } + } + if accepted { + break + } + } + + if !accepted { + http.Error(w, fmt.Sprintf("Not Acceptable: %s", acceptHeader), http.StatusNotAcceptable) + return + } + + next.ServeHTTP(w, r) + }) + } +} diff --git a/api/server/middleware/middleware_test.go b/api/server/middleware/middleware_test.go new file mode 100644 index 000000000000..5869de26b003 --- /dev/null +++ b/api/server/middleware/middleware_test.go @@ -0,0 +1,199 @@ +package middleware + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestNormalizeQueryValuesHandler(t *testing.T) { + nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write([]byte("next handler")) + require.NoError(t, err) + }) + + handler := NormalizeQueryValuesHandler(nextHandler) + + tests := []struct { + name string + inputQuery string + expectedQuery string + }{ + { + name: "3 values", + inputQuery: "key=value1,value2,value3", + expectedQuery: "key=value1&key=value2&key=value3", // replace with expected normalized value + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + req, err := http.NewRequest("GET", "/test?"+test.inputQuery, nil) + if err != nil { + t.Fatal(err) + } + + rr := httptest.NewRecorder() + handler.ServeHTTP(rr, req) + + if rr.Code != http.StatusOK { + t.Errorf("handler returned wrong status code: got %v want %v", rr.Code, http.StatusOK) + } + + if req.URL.RawQuery != test.expectedQuery { + t.Errorf("query not normalized: got %v want %v", req.URL.RawQuery, test.expectedQuery) + } + + if rr.Body.String() != "next handler" { + t.Errorf("next handler was not executed") + } + }) + } +} + +func TestContentTypeHandler(t *testing.T) { + acceptedMediaTypes := []string{api.JsonMediaType, api.OctetStreamMediaType} + + nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write([]byte("next handler")) + require.NoError(t, err) + }) + + handler := ContentTypeHandler(acceptedMediaTypes)(nextHandler) + + tests := []struct { + name string + contentType string + expectedStatusCode int + isGet bool + }{ + { + name: "Accepted Content-Type - application/json", + contentType: api.JsonMediaType, + expectedStatusCode: http.StatusOK, + }, + { + name: "Accepted Content-Type - ssz format", + contentType: api.OctetStreamMediaType, + expectedStatusCode: http.StatusOK, + }, + { + name: "Unsupported Content-Type - text/plain", + contentType: "text/plain", + expectedStatusCode: http.StatusUnsupportedMediaType, + }, + { + name: "Missing Content-Type", + contentType: "", + expectedStatusCode: http.StatusUnsupportedMediaType, + }, + { + name: "GET request skips content type check", + contentType: "", + expectedStatusCode: http.StatusOK, + isGet: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + httpMethod := http.MethodPost + if tt.isGet { + httpMethod = http.MethodGet + } + req := httptest.NewRequest(httpMethod, "/", nil) + if tt.contentType != "" { + req.Header.Set("Content-Type", tt.contentType) + } + rr := httptest.NewRecorder() + + handler.ServeHTTP(rr, req) + + if status := rr.Code; status != tt.expectedStatusCode { + t.Errorf("handler returned wrong status code: got %v want %v", status, tt.expectedStatusCode) + } + }) + } +} + +func TestAcceptHeaderHandler(t *testing.T) { + acceptedTypes := []string{"application/json", "application/octet-stream"} + + nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write([]byte("next handler")) + require.NoError(t, err) + }) + + handler := AcceptHeaderHandler(acceptedTypes)(nextHandler) + + tests := []struct { + name string + acceptHeader string + expectedStatusCode int + }{ + { + name: "Accepted Accept-Type - application/json", + acceptHeader: "application/json", + expectedStatusCode: http.StatusOK, + }, + { + name: "Accepted Accept-Type - application/octet-stream", + acceptHeader: "application/octet-stream", + expectedStatusCode: http.StatusOK, + }, + { + name: "Accepted Accept-Type with parameters", + acceptHeader: "application/json;q=0.9, application/octet-stream;q=0.8", + expectedStatusCode: http.StatusOK, + }, + { + name: "Unsupported Accept-Type - text/plain", + acceptHeader: "text/plain", + expectedStatusCode: http.StatusNotAcceptable, + }, + { + name: "Missing Accept header", + acceptHeader: "", + expectedStatusCode: http.StatusOK, + }, + { + name: "*/* is accepted", + acceptHeader: "*/*", + expectedStatusCode: http.StatusOK, + }, + { + name: "application/* is accepted", + acceptHeader: "application/*", + expectedStatusCode: http.StatusOK, + }, + { + name: "/* is unsupported", + acceptHeader: "/*", + expectedStatusCode: http.StatusNotAcceptable, + }, + { + name: "application/ is unsupported", + acceptHeader: "application/", + expectedStatusCode: http.StatusNotAcceptable, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + req := httptest.NewRequest("GET", "/", nil) + if tt.acceptHeader != "" { + req.Header.Set("Accept", tt.acceptHeader) + } + rr := httptest.NewRecorder() + + handler.ServeHTTP(rr, req) + + if status := rr.Code; status != tt.expectedStatusCode { + t.Errorf("handler returned wrong status code: got %v want %v", status, tt.expectedStatusCode) + } + }) + } +} diff --git a/api/server/util.go b/api/server/middleware/util.go similarity index 95% rename from api/server/util.go rename to api/server/middleware/util.go index 5fbcd9eaef06..1eeb431b1035 100644 --- a/api/server/util.go +++ b/api/server/middleware/util.go @@ -1,4 +1,4 @@ -package server +package middleware import ( "net/url" diff --git a/api/server/util_test.go b/api/server/middleware/util_test.go similarity index 96% rename from api/server/util_test.go rename to api/server/middleware/util_test.go index c717de19ab91..5f400ce049c7 100644 --- a/api/server/util_test.go +++ b/api/server/middleware/util_test.go @@ -1,4 +1,4 @@ -package server +package middleware import ( "testing" diff --git a/api/server/middleware_test.go b/api/server/middleware_test.go deleted file mode 100644 index e0f823861b63..000000000000 --- a/api/server/middleware_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package server - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/prysmaticlabs/prysm/v5/testing/require" -) - -func TestNormalizeQueryValuesHandler(t *testing.T) { - nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - _, err := w.Write([]byte("next handler")) - require.NoError(t, err) - }) - - handler := NormalizeQueryValuesHandler(nextHandler) - - tests := []struct { - name string - inputQuery string - expectedQuery string - }{ - { - name: "3 values", - inputQuery: "key=value1,value2,value3", - expectedQuery: "key=value1&key=value2&key=value3", // replace with expected normalized value - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - req, err := http.NewRequest("GET", "/test?"+test.inputQuery, nil) - if err != nil { - t.Fatal(err) - } - - rr := httptest.NewRecorder() - handler.ServeHTTP(rr, req) - - if rr.Code != http.StatusOK { - t.Errorf("handler returned wrong status code: got %v want %v", rr.Code, http.StatusOK) - } - - if req.URL.RawQuery != test.expectedQuery { - t.Errorf("query not normalized: got %v want %v", req.URL.RawQuery, test.expectedQuery) - } - - if rr.Body.String() != "next handler" { - t.Errorf("next handler was not executed") - } - }) - } -} diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 114f8e759eb3..8fe6c4b29d85 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -16,7 +16,7 @@ go_library( ], deps = [ "//api/gateway:go_default_library", - "//api/server:go_default_library", + "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 5c498a717585..6e126a8509f2 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -20,7 +20,7 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" apigateway "github.com/prysmaticlabs/prysm/v5/api/gateway" - "github.com/prysmaticlabs/prysm/v5/api/server" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" @@ -409,8 +409,8 @@ func newRouter(cliCtx *cli.Context) *mux.Router { allowedOrigins = strings.Split(flags.GPRCGatewayCorsDomain.Value, ",") } r := mux.NewRouter() - r.Use(server.NormalizeQueryValuesHandler) - r.Use(server.CorsHandler(allowedOrigins)) + r.Use(middleware.NormalizeQueryValuesHandler) + r.Use(middleware.CorsHandler(allowedOrigins)) return r } diff --git a/beacon-chain/rpc/BUILD.bazel b/beacon-chain/rpc/BUILD.bazel index 97e28d2051c5..b71d0ba51db5 100644 --- a/beacon-chain/rpc/BUILD.bazel +++ b/beacon-chain/rpc/BUILD.bazel @@ -10,6 +10,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc", visibility = ["//beacon-chain:__subpackages__"], deps = [ + "//api:go_default_library", + "//api/server/middleware:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", "//beacon-chain/cache:go_default_library", diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 9809833c2338..c086fb6eaeda 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -3,6 +3,11 @@ package rpc import ( "net/http" + "github.com/gorilla/mux" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/beacon" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/blob" @@ -23,10 +28,25 @@ import ( ) type endpoint struct { - template string - name string - handler http.HandlerFunc - methods []string + template string + name string + middleware []mux.MiddlewareFunc + handler http.HandlerFunc + methods []string +} + +func (e *endpoint) handlerWithMiddleware() http.HandlerFunc { + handler := http.Handler(e.handler) + for _, m := range e.middleware { + handler = m(handler) + } + return promhttp.InstrumentHandlerDuration( + httpRequestLatency.MustCurryWith(prometheus.Labels{"endpoint": e.name}), + promhttp.InstrumentHandlerCounter( + httpRequestCount.MustCurryWith(prometheus.Labels{"endpoint": e.name}), + handler, + ), + ) } func (s *Service) endpoints( @@ -73,20 +93,31 @@ func (s *Service) rewardsEndpoints(blocker lookup.Blocker, stater lookup.Stater, { template: "/eth/v1/beacon/rewards/blocks/{block_id}", name: namespace + ".BlockRewards", - handler: server.BlockRewards, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.BlockRewards, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/rewards/attestations/{epoch}", name: namespace + ".AttestationRewards", - handler: server.AttestationRewards, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.AttestationRewards, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/rewards/sync_committee/{block_id}", name: namespace + ".SyncCommitteeRewards", - handler: server.SyncCommitteeRewards, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SyncCommitteeRewards, + methods: []string{http.MethodPost}, }, } } @@ -103,8 +134,11 @@ func (s *Service) builderEndpoints(stater lookup.Stater) []endpoint { { template: "/eth/v1/builder/states/{state_id}/expected_withdrawals", name: namespace + ".ExpectedWithdrawals", - handler: server.ExpectedWithdrawals, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.ExpectedWithdrawals, + methods: []string{http.MethodGet}, }, } } @@ -119,8 +153,11 @@ func (s *Service) blobEndpoints(blocker lookup.Blocker) []endpoint { { template: "/eth/v1/beacon/blob_sidecars/{block_id}", name: namespace + ".Blobs", - handler: server.Blobs, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.Blobs, + methods: []string{http.MethodGet}, }, } } @@ -157,110 +194,173 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/aggregate_attestation", name: namespace + ".GetAggregateAttestation", - handler: server.GetAggregateAttestation, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetAggregateAttestation, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/validator/contribution_and_proofs", name: namespace + ".SubmitContributionAndProofs", - handler: server.SubmitContributionAndProofs, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitContributionAndProofs, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/aggregate_and_proofs", name: namespace + ".SubmitAggregateAndProofs", - handler: server.SubmitAggregateAndProofs, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitAggregateAndProofs, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/sync_committee_contribution", name: namespace + ".ProduceSyncCommitteeContribution", - handler: server.ProduceSyncCommitteeContribution, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.ProduceSyncCommitteeContribution, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/validator/sync_committee_subscriptions", name: namespace + ".SubmitSyncCommitteeSubscription", - handler: server.SubmitSyncCommitteeSubscription, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitSyncCommitteeSubscription, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/beacon_committee_subscriptions", name: namespace + ".SubmitBeaconCommitteeSubscription", - handler: server.SubmitBeaconCommitteeSubscription, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitBeaconCommitteeSubscription, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/attestation_data", name: namespace + ".GetAttestationData", - handler: server.GetAttestationData, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetAttestationData, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/validator/register_validator", name: namespace + ".RegisterValidator", - handler: server.RegisterValidator, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.RegisterValidator, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/duties/attester/{epoch}", name: namespace + ".GetAttesterDuties", - handler: server.GetAttesterDuties, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetAttesterDuties, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/duties/proposer/{epoch}", name: namespace + ".GetProposerDuties", - handler: server.GetProposerDuties, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetProposerDuties, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/validator/duties/sync/{epoch}", name: namespace + ".GetSyncCommitteeDuties", - handler: server.GetSyncCommitteeDuties, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetSyncCommitteeDuties, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/prepare_beacon_proposer", name: namespace + ".PrepareBeaconProposer", - handler: server.PrepareBeaconProposer, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.PrepareBeaconProposer, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/liveness/{epoch}", name: namespace + ".GetLiveness", - handler: server.GetLiveness, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetLiveness, + methods: []string{http.MethodPost}, }, { template: "/eth/v2/validator/blocks/{slot}", name: namespace + ".ProduceBlockV2", - handler: server.ProduceBlockV2, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.ProduceBlockV2, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/validator/blinded_blocks/{slot}", name: namespace + ".ProduceBlindedBlock", - handler: server.ProduceBlindedBlock, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.ProduceBlindedBlock, + methods: []string{http.MethodGet}, }, { template: "/eth/v3/validator/blocks/{slot}", name: namespace + ".ProduceBlockV3", - handler: server.ProduceBlockV3, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.ProduceBlockV3, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/validator/beacon_committee_selections", name: namespace + ".BeaconCommitteeSelections", - handler: server.BeaconCommitteeSelections, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + }, + handler: server.BeaconCommitteeSelections, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/validator/sync_committee_selections", name: namespace + ".SyncCommittee Selections", - handler: server.SyncCommitteeSelections, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + }, + handler: server.SyncCommitteeSelections, + methods: []string{http.MethodPost}, }, } } @@ -284,44 +384,65 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/syncing", name: namespace + ".GetSyncStatus", - handler: server.GetSyncStatus, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetSyncStatus, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/node/identity", name: namespace + ".GetIdentity", - handler: server.GetIdentity, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetIdentity, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/node/peers/{peer_id}", name: namespace + ".GetPeer", - handler: server.GetPeer, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetPeer, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/node/peers", name: namespace + ".GetPeers", - handler: server.GetPeers, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetPeers, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/node/peer_count", name: namespace + ".GetPeerCount", - handler: server.GetPeerCount, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetPeerCount, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/node/version", name: namespace + ".GetVersion", - handler: server.GetVersion, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetVersion, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/node/health", name: namespace + ".GetHealth", - handler: server.GetHealth, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetHealth, + methods: []string{http.MethodGet}, }, } } @@ -365,188 +486,293 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/committees", name: namespace + ".GetCommittees", - handler: server.GetCommittees, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetCommittees, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/fork", name: namespace + ".GetStateFork", - handler: server.GetStateFork, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetStateFork, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/root", name: namespace + ".GetStateRoot", - handler: server.GetStateRoot, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetStateRoot, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/sync_committees", name: namespace + ".GetSyncCommittees", - handler: server.GetSyncCommittees, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetSyncCommittees, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/randao", name: namespace + ".GetRandao", - handler: server.GetRandao, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetRandao, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/blocks", name: namespace + ".PublishBlock", - handler: server.PublishBlock, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.PublishBlock, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/blinded_blocks", name: namespace + ".PublishBlindedBlock", - handler: server.PublishBlindedBlock, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.PublishBlindedBlock, + methods: []string{http.MethodPost}, }, { template: "/eth/v2/beacon/blocks", name: namespace + ".PublishBlockV2", - handler: server.PublishBlockV2, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.PublishBlockV2, + methods: []string{http.MethodPost}, }, { template: "/eth/v2/beacon/blinded_blocks", name: namespace + ".PublishBlindedBlockV2", - handler: server.PublishBlindedBlockV2, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.PublishBlindedBlockV2, + methods: []string{http.MethodPost}, }, { template: "/eth/v2/beacon/blocks/{block_id}", name: namespace + ".GetBlockV2", - handler: server.GetBlockV2, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetBlockV2, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/blocks/{block_id}/attestations", name: namespace + ".GetBlockAttestations", - handler: server.GetBlockAttestations, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetBlockAttestations, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/blinded_blocks/{block_id}", name: namespace + ".GetBlindedBlock", - handler: server.GetBlindedBlock, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetBlindedBlock, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/blocks/{block_id}/root", name: namespace + ".GetBlockRoot", - handler: server.GetBlockRoot, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetBlockRoot, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/pool/attestations", name: namespace + ".ListAttestations", - handler: server.ListAttestations, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.ListAttestations, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/pool/attestations", name: namespace + ".SubmitAttestations", - handler: server.SubmitAttestations, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitAttestations, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/pool/voluntary_exits", name: namespace + ".ListVoluntaryExits", - handler: server.ListVoluntaryExits, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.ListVoluntaryExits, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/pool/voluntary_exits", name: namespace + ".SubmitVoluntaryExit", - handler: server.SubmitVoluntaryExit, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitVoluntaryExit, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/pool/sync_committees", name: namespace + ".SubmitSyncCommitteeSignatures", - handler: server.SubmitSyncCommitteeSignatures, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitSyncCommitteeSignatures, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/pool/bls_to_execution_changes", name: namespace + ".ListBLSToExecutionChanges", - handler: server.ListBLSToExecutionChanges, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.ListBLSToExecutionChanges, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/pool/bls_to_execution_changes", name: namespace + ".SubmitBLSToExecutionChanges", - handler: server.SubmitBLSToExecutionChanges, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitBLSToExecutionChanges, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/pool/attester_slashings", name: namespace + ".GetAttesterSlashings", - handler: server.GetAttesterSlashings, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetAttesterSlashings, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/pool/attester_slashings", name: namespace + ".SubmitAttesterSlashing", - handler: server.SubmitAttesterSlashing, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitAttesterSlashing, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/pool/proposer_slashings", name: namespace + ".GetProposerSlashings", - handler: server.GetProposerSlashings, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetProposerSlashings, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/pool/proposer_slashings", name: namespace + ".SubmitProposerSlashing", - handler: server.SubmitProposerSlashing, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.SubmitProposerSlashing, + methods: []string{http.MethodPost}, }, { template: "/eth/v1/beacon/headers", name: namespace + ".GetBlockHeaders", - handler: server.GetBlockHeaders, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetBlockHeaders, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/headers/{block_id}", name: namespace + ".GetBlockHeader", - handler: server.GetBlockHeader, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetBlockHeader, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/genesis", name: namespace + ".GetGenesis", - handler: server.GetGenesis, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetGenesis, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/finality_checkpoints", name: namespace + ".GetFinalityCheckpoints", - handler: server.GetFinalityCheckpoints, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetFinalityCheckpoints, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/validators", name: namespace + ".GetValidators", - handler: server.GetValidators, - methods: []string{http.MethodGet, http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidators, + methods: []string{http.MethodGet, http.MethodPost}, }, { template: "/eth/v1/beacon/states/{state_id}/validators/{validator_id}", name: namespace + ".GetValidator", - handler: server.GetValidator, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidator, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/validator_balances", name: namespace + ".GetValidatorBalances", - handler: server.GetValidatorBalances, - methods: []string{http.MethodGet, http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidatorBalances, + methods: []string{http.MethodGet, http.MethodPost}, }, } } @@ -557,20 +783,29 @@ func (s *Service) configEndpoints() []endpoint { { template: "/eth/v1/config/deposit_contract", name: namespace + ".GetDepositContract", - handler: config.GetDepositContract, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: config.GetDepositContract, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/config/fork_schedule", name: namespace + ".GetForkSchedule", - handler: config.GetForkSchedule, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: config.GetForkSchedule, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/config/spec", name: namespace + ".GetSpec", - handler: config.GetSpec, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: config.GetSpec, + methods: []string{http.MethodGet}, }, } } @@ -587,26 +822,38 @@ func (s *Service) lightClientEndpoints(blocker lookup.Blocker, stater lookup.Sta { template: "/eth/v1/beacon/light_client/bootstrap/{block_root}", name: namespace + ".GetLightClientBootstrap", - handler: server.GetLightClientBootstrap, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetLightClientBootstrap, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/light_client/updates", name: namespace + ".GetLightClientUpdatesByRange", - handler: server.GetLightClientUpdatesByRange, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetLightClientUpdatesByRange, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/light_client/finality_update", name: namespace + ".GetLightClientFinalityUpdate", - handler: server.GetLightClientFinalityUpdate, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetLightClientFinalityUpdate, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/light_client/optimistic_update", name: namespace + ".GetLightClientOptimisticUpdate", - handler: server.GetLightClientOptimisticUpdate, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetLightClientOptimisticUpdate, + methods: []string{http.MethodGet}, }, } } @@ -628,20 +875,29 @@ func (s *Service) debugEndpoints(stater lookup.Stater) []endpoint { { template: "/eth/v2/debug/beacon/states/{state_id}", name: namespace + ".GetBeaconStateV2", - handler: server.GetBeaconStateV2, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), + }, + handler: server.GetBeaconStateV2, + methods: []string{http.MethodGet}, }, { template: "/eth/v2/debug/beacon/heads", name: namespace + ".GetForkChoiceHeadsV2", - handler: server.GetForkChoiceHeadsV2, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetForkChoiceHeadsV2, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/debug/fork_choice", name: namespace + ".GetForkChoice", - handler: server.GetForkChoice, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetForkChoice, + methods: []string{http.MethodGet}, }, } } @@ -659,8 +915,11 @@ func (s *Service) eventsEndpoints() []endpoint { { template: "/eth/v1/events", name: namespace + ".StreamEvents", - handler: server.StreamEvents, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.EventStreamMediaType}), + }, + handler: server.StreamEvents, + methods: []string{http.MethodGet}, }, } } @@ -685,20 +944,29 @@ func (s *Service) prysmBeaconEndpoints(ch *stategen.CanonicalHistory, stater loo { template: "/prysm/v1/beacon/weak_subjectivity", name: namespace + ".GetWeakSubjectivity", - handler: server.GetWeakSubjectivity, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetWeakSubjectivity, + methods: []string{http.MethodGet}, }, { template: "/eth/v1/beacon/states/{state_id}/validator_count", name: namespace + ".GetValidatorCount", - handler: server.GetValidatorCount, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidatorCount, + methods: []string{http.MethodGet}, }, { template: "/prysm/v1/beacon/states/{state_id}/validator_count", name: namespace + ".GetValidatorCount", - handler: server.GetValidatorCount, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidatorCount, + methods: []string{http.MethodGet}, }, } } @@ -721,38 +989,58 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/node/trusted_peers", name: namespace + ".ListTrustedPeer", - handler: server.ListTrustedPeer, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.ListTrustedPeer, + methods: []string{http.MethodGet}, }, { template: "/prysm/v1/node/trusted_peers", name: namespace + ".ListTrustedPeer", - handler: server.ListTrustedPeer, - methods: []string{http.MethodGet}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.ListTrustedPeer, + methods: []string{http.MethodGet}, }, { template: "/prysm/node/trusted_peers", name: namespace + ".AddTrustedPeer", - handler: server.AddTrustedPeer, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.AddTrustedPeer, + methods: []string{http.MethodPost}, }, { template: "/prysm/v1/node/trusted_peers", name: namespace + ".AddTrustedPeer", - handler: server.AddTrustedPeer, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.AddTrustedPeer, + methods: []string{http.MethodPost}, }, { template: "/prysm/node/trusted_peers/{peer_id}", name: namespace + ".RemoveTrustedPeer", - handler: server.RemoveTrustedPeer, - methods: []string{http.MethodDelete}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.RemoveTrustedPeer, + methods: []string{http.MethodDelete}, }, { template: "/prysm/v1/node/trusted_peers/{peer_id}", name: namespace + ".RemoveTrustedPeer", - handler: server.RemoveTrustedPeer, - methods: []string{http.MethodDelete}, + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.RemoveTrustedPeer, + methods: []string{http.MethodDelete}, }, } } @@ -767,14 +1055,22 @@ func (s *Service) prysmValidatorEndpoints(coreService *core.Service, stater look { template: "/prysm/validators/performance", name: namespace + ".GetValidatorPerformance", - handler: server.GetValidatorPerformance, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidatorPerformance, + methods: []string{http.MethodPost}, }, { template: "/prysm/v1/validators/performance", name: namespace + ".GetValidatorPerformance", - handler: server.GetValidatorPerformance, - methods: []string{http.MethodPost}, + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidatorPerformance, + methods: []string{http.MethodPost}, }, } } diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 39ce4ca2c302..e30fb09aefc6 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -16,7 +16,6 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" @@ -311,13 +310,7 @@ func NewService(ctx context.Context, cfg *Config) *Service { for _, e := range endpoints { s.cfg.Router.HandleFunc( e.template, - promhttp.InstrumentHandlerDuration( - httpRequestLatency.MustCurryWith(prometheus.Labels{"endpoint": e.name}), - promhttp.InstrumentHandlerCounter( - httpRequestCount.MustCurryWith(prometheus.Labels{"endpoint": e.name}), - e.handler, - ), - ), + e.handlerWithMiddleware(), ).Methods(e.methods...) } diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 759ad23a593b..c8b5611c24fe 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -37,7 +37,7 @@ go_library( deps = [ "//api:go_default_library", "//api/gateway:go_default_library", - "//api/server:go_default_library", + "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", "//cmd/validator/flags:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index aee6e841f718..7091c9d7786c 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -25,7 +25,7 @@ import ( fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/gateway" - "github.com/prysmaticlabs/prysm/v5/api/server" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" @@ -155,8 +155,8 @@ func newRouter(cliCtx *cli.Context) *mux.Router { allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") } r := mux.NewRouter() - r.Use(server.NormalizeQueryValuesHandler) - r.Use(server.CorsHandler(allowedOrigins)) + r.Use(middleware.NormalizeQueryValuesHandler) + r.Use(middleware.CorsHandler(allowedOrigins)) return r } From ea2624b5abc49ef8d05c9ea0ba027eaccdf07850 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:08:06 -0500 Subject: [PATCH 129/325] always close cache warm chan to prevent blocking (#14080) * always close cache warm chan to prevent blocking * test that waitForCache does not block * combine defers to reduce cognitive overhead * lint --------- Co-authored-by: Kasey Kirkham --- beacon-chain/db/filesystem/pruner.go | 12 +++++---- beacon-chain/db/filesystem/pruner_test.go | 31 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/beacon-chain/db/filesystem/pruner.go b/beacon-chain/db/filesystem/pruner.go index 9c5be29842eb..5ac4ac50d6fa 100644 --- a/beacon-chain/db/filesystem/pruner.go +++ b/beacon-chain/db/filesystem/pruner.go @@ -92,14 +92,16 @@ func windowMin(latest, offset primitives.Slot) primitives.Slot { func (p *blobPruner) warmCache() error { p.Lock() - defer p.Unlock() + defer func() { + if !p.warmed { + p.warmed = true + close(p.cacheReady) + } + p.Unlock() + }() if err := p.prune(0); err != nil { return err } - if !p.warmed { - p.warmed = true - close(p.cacheReady) - } return nil } diff --git a/beacon-chain/db/filesystem/pruner_test.go b/beacon-chain/db/filesystem/pruner_test.go index ad7dace8f873..3241350dccdc 100644 --- a/beacon-chain/db/filesystem/pruner_test.go +++ b/beacon-chain/db/filesystem/pruner_test.go @@ -2,16 +2,19 @@ package filesystem import ( "bytes" + "context" "fmt" "math" "os" "path" "sort" "testing" + "time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/spf13/afero" @@ -34,6 +37,34 @@ func TestTryPruneDir_CachedNotExpired(t *testing.T) { require.Equal(t, 0, pruned) } +func TestCacheWarmFail(t *testing.T) { + fs := afero.NewMemMapFs() + n := blobNamer{root: bytesutil.ToBytes32([]byte("derp")), index: 0} + bp := n.path() + mkdir := path.Dir(bp) + require.NoError(t, fs.MkdirAll(mkdir, directoryPermissions)) + + // Create an empty blob index in the fs by touching the file at a seemingly valid path. + fi, err := fs.Create(bp) + require.NoError(t, err) + require.NoError(t, fi.Close()) + + // Cache warm should fail due to the unexpected EOF. + pr, err := newBlobPruner(fs, 0) + require.NoError(t, err) + require.ErrorIs(t, pr.warmCache(), errPruningFailures) + + // The cache warm has finished, so calling waitForCache with a super short deadline + // should not block or hit the context deadline. + ctx := context.Background() + ctx, cancel := context.WithDeadline(ctx, time.Now().Add(1*time.Millisecond)) + defer cancel() + c, err := pr.waitForCache(ctx) + // We will get an error and a nil value for the cache if we hit the deadline. + require.NoError(t, err) + require.NotNil(t, c) +} + func TestTryPruneDir_CachedExpired(t *testing.T) { t.Run("empty directory", func(t *testing.T) { fs := afero.NewMemMapFs() From e0374917565c91ed26db68c6f4160cb535424bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Wed, 5 Jun 2024 14:04:21 +0200 Subject: [PATCH 130/325] Deprectate `EnableDebugRPCEndpoints` flag (#14015) * Deprectate `EnableDebugRPCEndpoints` flag * test fix * add flag to deprecated list * disable by default * test fixes --- beacon-chain/node/node.go | 6 ++---- beacon-chain/rpc/service.go | 3 +-- cmd/beacon-chain/flags/base.go | 8 ++++---- cmd/beacon-chain/main.go | 2 +- cmd/beacon-chain/usage.go | 2 +- config/features/deprecated_flags.go | 6 ++++++ testing/endtoend/components/beacon_node.go | 1 - 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 6e126a8509f2..8c2edff3d05f 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -965,9 +965,8 @@ func (b *BeaconNode) registerRPCService(router *mux.Router) error { cert := b.cliCtx.String(flags.CertFlag.Name) key := b.cliCtx.String(flags.KeyFlag.Name) mockEth1DataVotes := b.cliCtx.Bool(flags.InteropMockEth1DataVotesFlag.Name) - maxMsgSize := b.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name) + enableDebugRPCEndpoints := !b.cliCtx.Bool(flags.DisableDebugRPCEndpoints.Name) p2pService := b.fetchP2P() rpcService := rpc.NewService(b.ctx, &rpc.Config{ @@ -1056,11 +1055,10 @@ func (b *BeaconNode) registerGRPCGateway(router *mux.Router) error { gatewayPort := b.cliCtx.Int(flags.GRPCGatewayPort.Name) rpcHost := b.cliCtx.String(flags.RPCHost.Name) rpcPort := b.cliCtx.Int(flags.RPCPort.Name) - + enableDebugRPCEndpoints := !b.cliCtx.Bool(flags.DisableDebugRPCEndpoints.Name) selfAddress := net.JoinHostPort(rpcHost, strconv.Itoa(rpcPort)) gatewayAddress := net.JoinHostPort(gatewayHost, strconv.Itoa(gatewayPort)) allowedOrigins := strings.Split(b.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") - enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name) selfCert := b.cliCtx.String(flags.CertFlag.Name) maxCallSize := b.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) httpModules := b.cliCtx.String(flags.HTTPModules.Name) diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index e30fb09aefc6..bb7104bd8f03 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -113,8 +113,8 @@ type Config struct { ExecutionChainInfoFetcher execution.ChainInfoFetcher GenesisTimeFetcher blockchain.TimeFetcher GenesisFetcher blockchain.GenesisFetcher - EnableDebugRPCEndpoints bool MockEth1Votes bool + EnableDebugRPCEndpoints bool AttestationsPool attestations.Pool ExitPool voluntaryexits.PoolManager SlashingsPool slashings.PoolManager @@ -318,7 +318,6 @@ func NewService(ctx context.Context, cfg *Config) *Service { ethpbv1alpha1.RegisterHealthServer(s.grpcServer, nodeServer) ethpbv1alpha1.RegisterBeaconChainServer(s.grpcServer, beaconChainServer) if s.cfg.EnableDebugRPCEndpoints { - log.Info("Enabled debug gRPC endpoints") debugServer := &debugv1alpha1.Server{ GenesisTimeFetcher: s.cfg.GenesisTimeFetcher, BeaconDB: s.cfg.BeaconDB, diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index d119c427f2fd..4e8c94882043 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -174,10 +174,10 @@ var ( Usage: "The factor by which blob batch limit may increase on burst.", Value: 2, } - // EnableDebugRPCEndpoints as /v1/beacon/state. - EnableDebugRPCEndpoints = &cli.BoolFlag{ - Name: "enable-debug-rpc-endpoints", - Usage: "Enables the debug rpc service, containing utility endpoints such as /eth/v1alpha1/beacon/state.", + // DisableDebugRPCEndpoints disables the debug Beacon API namespace. + DisableDebugRPCEndpoints = &cli.BoolFlag{ + Name: "disable-debug-rpc-endpoints", + Usage: "Disables the debug Beacon API namespace.", } // SubscribeToAllSubnets defines a flag to specify whether to subscribe to all possible attestation/sync subnets or not. SubscribeToAllSubnets = &cli.BoolFlag{ diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 97092232d3de..b74f9d523671 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -64,7 +64,7 @@ var appFlags = []cli.Flag{ flags.InteropNumValidatorsFlag, flags.InteropGenesisTimeFlag, flags.SlotsPerArchivedPoint, - flags.EnableDebugRPCEndpoints, + flags.DisableDebugRPCEndpoints, flags.SubscribeToAllSubnets, flags.HistoricalSlasherNode, flags.ChainID, diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 747533c0f0d9..6d0f39cc2535 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -116,7 +116,7 @@ var appHelpFlagGroups = []flagGroup{ flags.BlockBatchLimitBurstFactor, flags.BlobBatchLimit, flags.BlobBatchLimitBurstFactor, - flags.EnableDebugRPCEndpoints, + flags.DisableDebugRPCEndpoints, flags.SubscribeToAllSubnets, flags.HistoricalSlasherNode, flags.ChainID, diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index 1f31876dcf61..ce04f877cff3 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -52,6 +52,11 @@ var ( Usage: deprecatedUsage, Hidden: true, } + deprecatedEnableDebugRPCEndpoints = &cli.BoolFlag{ + Name: "enable-debug-rpc-endpoints", + Usage: deprecatedUsage, + Hidden: true, + } ) // Deprecated flags for both the beacon node and validator client. @@ -65,6 +70,7 @@ var deprecatedFlags = []cli.Flag{ deprecatedEnableEIP4881, deprecatedDisableEIP4881, deprecatedVerboseSigVerification, + deprecatedEnableDebugRPCEndpoints, } // deprecatedBeaconFlags contains flags that are still used by other components diff --git a/testing/endtoend/components/beacon_node.go b/testing/endtoend/components/beacon_node.go index 580fdccec1cf..a42da708bf35 100644 --- a/testing/endtoend/components/beacon_node.go +++ b/testing/endtoend/components/beacon_node.go @@ -275,7 +275,6 @@ func (node *BeaconNode) Start(ctx context.Context) error { "--" + cmdshared.ValidatorMonitorIndicesFlag.Name + "=2", "--" + cmdshared.ForceClearDB.Name, "--" + cmdshared.AcceptTosFlag.Name, - "--" + flags.EnableDebugRPCEndpoints.Name, "--" + features.EnableQUIC.Name, } if config.UsePprof { From 8413660d5f4498beb4a91b3b609ae4d6daa7def6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 6 Jun 2024 20:45:35 +0200 Subject: [PATCH 131/325] Keep only the latest value in the health channel (#14087) * Increase health tracker channel buffer size * keep only the latest value * Make health test blocking as a regression test for PR #14807 * Fix new race conditions in the MockHealthClient --------- Co-authored-by: Preston Van Loon --- api/client/beacon/health.go | 9 +++++++-- api/client/beacon/health_test.go | 6 ------ api/client/beacon/testing/mock.go | 6 ++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/api/client/beacon/health.go b/api/client/beacon/health.go index c13a04407ee8..9b4f088af1b7 100644 --- a/api/client/beacon/health.go +++ b/api/client/beacon/health.go @@ -48,8 +48,13 @@ func (n *NodeHealthTracker) CheckHealth(ctx context.Context) bool { if isStatusChanged { // Update the health status n.isHealthy = &newStatus - // Send the new status to the health channel - n.healthChan <- newStatus + // Send the new status to the health channel, potentially overwriting the existing value + select { + case <-n.healthChan: + n.healthChan <- newStatus + default: + n.healthChan <- newStatus + } } return newStatus } diff --git a/api/client/beacon/health_test.go b/api/client/beacon/health_test.go index 8dedfc54c95c..a6d3a0627844 100644 --- a/api/client/beacon/health_test.go +++ b/api/client/beacon/health_test.go @@ -87,12 +87,6 @@ func TestNodeHealth_Concurrency(t *testing.T) { // Number of goroutines to spawn for both reading and writing numGoroutines := 6 - go func() { - for range n.HealthUpdates() { - // Consume values to avoid blocking on channel send. - } - }() - wg.Add(numGoroutines * 2) // for readers and writers // Concurrently update health status diff --git a/api/client/beacon/testing/mock.go b/api/client/beacon/testing/mock.go index 25fe4bcf3aa7..7768d4a7ed41 100644 --- a/api/client/beacon/testing/mock.go +++ b/api/client/beacon/testing/mock.go @@ -3,6 +3,7 @@ package testing import ( "context" "reflect" + "sync" "github.com/prysmaticlabs/prysm/v5/api/client/beacon/iface" "go.uber.org/mock/gomock" @@ -16,6 +17,7 @@ var ( type MockHealthClient struct { ctrl *gomock.Controller recorder *MockHealthClientMockRecorder + sync.Mutex } // MockHealthClientMockRecorder is the mock recorder for MockHealthClient. @@ -25,6 +27,8 @@ type MockHealthClientMockRecorder struct { // IsHealthy mocks base method. func (m *MockHealthClient) IsHealthy(arg0 context.Context) bool { + m.Lock() + defer m.Unlock() m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsHealthy", arg0) ret0, ok := ret[0].(bool) @@ -41,6 +45,8 @@ func (m *MockHealthClient) EXPECT() *MockHealthClientMockRecorder { // IsHealthy indicates an expected call of IsHealthy. func (mr *MockHealthClientMockRecorder) IsHealthy(arg0 any) *gomock.Call { + mr.mock.Lock() + defer mr.mock.Unlock() mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsHealthy", reflect.TypeOf((*MockHealthClient)(nil).IsHealthy), arg0) } From b7866be3a99f9f3f89665f2c85efda7f3cc52b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 10 Jun 2024 18:33:43 +0200 Subject: [PATCH 132/325] EIP 7549 spectests (#14027) * EIP 7549 spectests * merge fix --- beacon-chain/core/electra/BUILD.bazel | 1 + beacon-chain/core/electra/attestation.go | 7 +++ .../mainnet/electra/operations/BUILD.bazel | 1 + .../electra/operations/attestation_test.go | 11 ++++ .../minimal/electra/operations/BUILD.bazel | 1 + .../electra/operations/attestation_test.go | 11 ++++ .../shared/electra/operations/BUILD.bazel | 1 + .../shared/electra/operations/attestation.go | 59 +++++++++++++++++++ .../electra/operations/attester_slashing.go | 2 +- .../operations/bls_to_execution_changes.go | 2 +- .../electra/operations/consolidations.go | 2 +- .../execution_layer_withdrawal_request.go | 2 +- .../shared/electra/operations/helpers.go | 2 +- .../electra/operations/proposer_slashing.go | 2 +- .../electra/operations/sync_committee.go | 2 +- .../electra/operations/voluntary_exit.go | 2 +- .../shared/electra/operations/withdrawals.go | 2 +- 17 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 beacon-chain/core/electra/attestation.go create mode 100644 testing/spectest/mainnet/electra/operations/attestation_test.go create mode 100644 testing/spectest/minimal/electra/operations/attestation_test.go create mode 100644 testing/spectest/shared/electra/operations/attestation.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index ee8e0bcd865c..ee8bfb1c86f6 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "attestation.go", "churn.go", "consolidations.go", "deposits.go", diff --git a/beacon-chain/core/electra/attestation.go b/beacon-chain/core/electra/attestation.go new file mode 100644 index 000000000000..ddb7ca3d1d94 --- /dev/null +++ b/beacon-chain/core/electra/attestation.go @@ -0,0 +1,7 @@ +package electra + +import "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" + +var ( + ProcessAttestationsNoVerifySignature = altair.ProcessAttestationsNoVerifySignature +) diff --git a/testing/spectest/mainnet/electra/operations/BUILD.bazel b/testing/spectest/mainnet/electra/operations/BUILD.bazel index e78106ecb1ba..21391d470691 100644 --- a/testing/spectest/mainnet/electra/operations/BUILD.bazel +++ b/testing/spectest/mainnet/electra/operations/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_test") go_test( name = "go_default_test", srcs = [ + "attestation_test.go", "attester_slashing_test.go", "block_header_test.go", "bls_to_execution_change_test.go", diff --git a/testing/spectest/mainnet/electra/operations/attestation_test.go b/testing/spectest/mainnet/electra/operations/attestation_test.go new file mode 100644 index 000000000000..ac693540b138 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/attestation_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_Attestation(t *testing.T) { + operations.RunAttestationTest(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/operations/BUILD.bazel b/testing/spectest/minimal/electra/operations/BUILD.bazel index f77431fbc609..51d59c038bfb 100644 --- a/testing/spectest/minimal/electra/operations/BUILD.bazel +++ b/testing/spectest/minimal/electra/operations/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_test") go_test( name = "go_default_test", srcs = [ + "attestation_test.go", "attester_slashing_test.go", "block_header_test.go", "bls_to_execution_change_test.go", diff --git a/testing/spectest/minimal/electra/operations/attestation_test.go b/testing/spectest/minimal/electra/operations/attestation_test.go new file mode 100644 index 000000000000..aafc399b68c8 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/attestation_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_Attestation(t *testing.T) { + operations.RunAttestationTest(t, "minimal") +} diff --git a/testing/spectest/shared/electra/operations/BUILD.bazel b/testing/spectest/shared/electra/operations/BUILD.bazel index 9596456ef58d..7126c7201fc3 100644 --- a/testing/spectest/shared/electra/operations/BUILD.bazel +++ b/testing/spectest/shared/electra/operations/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", testonly = True, srcs = [ + "attestation.go", "attester_slashing.go", "block_header.go", "bls_to_execution_changes.go", diff --git a/testing/spectest/shared/electra/operations/attestation.go b/testing/spectest/shared/electra/operations/attestation.go new file mode 100644 index 000000000000..ab219b508b46 --- /dev/null +++ b/testing/spectest/shared/electra/operations/attestation.go @@ -0,0 +1,59 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/pkg/errors" + b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunAttestationTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/attestation/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/attestation/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") + require.NoError(t, err) + attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) + require.NoError(t, err, "Failed to decompress") + att := ðpb.AttestationElectra{} + require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{Attestations: []*ethpb.AttestationElectra{att}} + processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + st, err = electra.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) + if err != nil { + return nil, err + } + aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) + if err != nil { + return nil, err + } + verified, err := aSet.Verify() + if err != nil { + return nil, err + } + if !verified { + return nil, errors.New("could not batch verify attestation signature") + } + return st, nil + } + + RunBlockOperationTest(t, folderPath, body, processAtt) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/attester_slashing.go b/testing/spectest/shared/electra/operations/attester_slashing.go index 2818cd7f6644..8fd621330c7e 100644 --- a/testing/spectest/shared/electra/operations/attester_slashing.go +++ b/testing/spectest/shared/electra/operations/attester_slashing.go @@ -30,7 +30,7 @@ func RunAttesterSlashingTest(t *testing.T, config string) { require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{AttesterSlashings: []*ethpb.AttesterSlashingElectra{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) }) }) diff --git a/testing/spectest/shared/electra/operations/bls_to_execution_changes.go b/testing/spectest/shared/electra/operations/bls_to_execution_changes.go index 58dd6699e5a7..ee033f72d0c7 100644 --- a/testing/spectest/shared/electra/operations/bls_to_execution_changes.go +++ b/testing/spectest/shared/electra/operations/bls_to_execution_changes.go @@ -35,7 +35,7 @@ func RunBLSToExecutionChangeTest(t *testing.T, config string) { body := ðpb.BeaconBlockBodyElectra{ BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{change}, } - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { st, err := blocks.ProcessBLSToExecutionChanges(s, b.Block()) if err != nil { return nil, err diff --git a/testing/spectest/shared/electra/operations/consolidations.go b/testing/spectest/shared/electra/operations/consolidations.go index 967ddafa2400..56d3c4a2a290 100644 --- a/testing/spectest/shared/electra/operations/consolidations.go +++ b/testing/spectest/shared/electra/operations/consolidations.go @@ -30,7 +30,7 @@ func RunConsolidationTest(t *testing.T, config string) { require.NoError(t, consolidation.UnmarshalSSZ(consolidationSSZ), "Failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{Consolidations: []*ethpb.SignedConsolidation{consolidation}} - processConsolidationFunc := func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + processConsolidationFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { body, ok := b.Block().Body().(interfaces.ROBlockBodyElectra) if !ok { t.Error("block body is not electra") diff --git a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go b/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go index b7e05a8012a8..9c21b186c636 100644 --- a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go @@ -36,7 +36,7 @@ func RunExecutionLayerWithdrawalRequestTest(t *testing.T, config string) { withdrawalRequest, }, }} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { bod, ok := b.Block().Body().(interfaces.ROBlockBodyElectra) require.Equal(t, true, ok) e, err := bod.Execution() diff --git a/testing/spectest/shared/electra/operations/helpers.go b/testing/spectest/shared/electra/operations/helpers.go index 67131feeef2c..fe42a2c83e6f 100644 --- a/testing/spectest/shared/electra/operations/helpers.go +++ b/testing/spectest/shared/electra/operations/helpers.go @@ -22,7 +22,7 @@ import ( "google.golang.org/protobuf/testing/protocmp" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.SignedBeaconBlock) (state.BeaconState, error) +type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) // RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the // passed in block operation function and checks the post state with the expected post state. diff --git a/testing/spectest/shared/electra/operations/proposer_slashing.go b/testing/spectest/shared/electra/operations/proposer_slashing.go index d5f3dc3f72e8..d31e771cd188 100644 --- a/testing/spectest/shared/electra/operations/proposer_slashing.go +++ b/testing/spectest/shared/electra/operations/proposer_slashing.go @@ -30,7 +30,7 @@ func RunProposerSlashingTest(t *testing.T, config string) { require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) }) }) diff --git a/testing/spectest/shared/electra/operations/sync_committee.go b/testing/spectest/shared/electra/operations/sync_committee.go index 308bfd53fbf8..373cc0046412 100644 --- a/testing/spectest/shared/electra/operations/sync_committee.go +++ b/testing/spectest/shared/electra/operations/sync_committee.go @@ -29,7 +29,7 @@ func RunSyncCommitteeTest(t *testing.T, config string) { require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{SyncAggregate: sc} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { st, _, err := electra.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) if err != nil { return nil, err diff --git a/testing/spectest/shared/electra/operations/voluntary_exit.go b/testing/spectest/shared/electra/operations/voluntary_exit.go index 5c479282cf43..b423c63f3e1b 100644 --- a/testing/spectest/shared/electra/operations/voluntary_exit.go +++ b/testing/spectest/shared/electra/operations/voluntary_exit.go @@ -29,7 +29,7 @@ func RunVoluntaryExitTest(t *testing.T, config string) { require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) }) }) diff --git a/testing/spectest/shared/electra/operations/withdrawals.go b/testing/spectest/shared/electra/operations/withdrawals.go index 866a2de53882..5ef4fcd2ee09 100644 --- a/testing/spectest/shared/electra/operations/withdrawals.go +++ b/testing/spectest/shared/electra/operations/withdrawals.go @@ -31,7 +31,7 @@ func RunWithdrawalsTest(t *testing.T, config string) { require.NoError(t, payload.UnmarshalSSZ(payloadSSZ), "failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: payload} - RunBlockOperationTest(t, folderPath, body, func(_ context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { + RunBlockOperationTest(t, folderPath, body, func(_ context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { payload, err := b.Block().Body().Execution() if err != nil { return nil, err From dfe31c9242623974d627c422947f6a999bb74398 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:15:23 -0500 Subject: [PATCH 133/325] adding in softer check for content type (#14097) --- api/server/middleware/middleware.go | 2 +- api/server/middleware/middleware_test.go | 5 +++++ validator/client/beacon-api/json_rest_handler.go | 2 +- validator/client/beacon-api/json_rest_handler_test.go | 11 ++++++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/api/server/middleware/middleware.go b/api/server/middleware/middleware.go index d935fa265ffe..b85e59e895b6 100644 --- a/api/server/middleware/middleware.go +++ b/api/server/middleware/middleware.go @@ -50,7 +50,7 @@ func ContentTypeHandler(acceptedMediaTypes []string) mux.MiddlewareFunc { accepted := false for _, acceptedType := range acceptedMediaTypes { - if strings.TrimSpace(contentType) == strings.TrimSpace(acceptedType) { + if strings.Contains(strings.TrimSpace(contentType), strings.TrimSpace(acceptedType)) { accepted = true break } diff --git a/api/server/middleware/middleware_test.go b/api/server/middleware/middleware_test.go index 5869de26b003..3b899d74a59e 100644 --- a/api/server/middleware/middleware_test.go +++ b/api/server/middleware/middleware_test.go @@ -96,6 +96,11 @@ func TestContentTypeHandler(t *testing.T) { expectedStatusCode: http.StatusOK, isGet: true, }, + { + name: "Content type contains charset is ok", + contentType: "application/json; charset=utf-8", + expectedStatusCode: http.StatusOK, + }, } for _, tt := range tests { diff --git a/validator/client/beacon-api/json_rest_handler.go b/validator/client/beacon-api/json_rest_handler.go index 890a10e26be6..0877bff1019b 100644 --- a/validator/client/beacon-api/json_rest_handler.go +++ b/validator/client/beacon-api/json_rest_handler.go @@ -109,7 +109,7 @@ func decodeResp(httpResp *http.Response, resp interface{}) error { return errors.Wrapf(err, "failed to read response body for %s", httpResp.Request.URL) } - if httpResp.Header.Get("Content-Type") != api.JsonMediaType { + if !strings.Contains(httpResp.Header.Get("Content-Type"), api.JsonMediaType) { // 2XX codes are a success if strings.HasPrefix(httpResp.Status, "2") { return nil diff --git a/validator/client/beacon-api/json_rest_handler_test.go b/validator/client/beacon-api/json_rest_handler_test.go index d28729eee652..264bff59a60a 100644 --- a/validator/client/beacon-api/json_rest_handler_test.go +++ b/validator/client/beacon-api/json_rest_handler_test.go @@ -99,7 +99,16 @@ func Test_decodeResp(t *testing.T) { type j struct { Foo string `json:"foo"` } - + t.Run("200 JSON with charset", func(t *testing.T) { + body := bytes.Buffer{} + r := &http.Response{ + Status: "200", + StatusCode: http.StatusOK, + Body: io.NopCloser(&body), + Header: map[string][]string{"Content-Type": {"application/json; charset=utf-8"}}, + } + require.NoError(t, decodeResp(r, nil)) + }) t.Run("200 non-JSON", func(t *testing.T) { body := bytes.Buffer{} r := &http.Response{ From 8ac1647436d85abe4fa83e2e9729a1b92f2424f3 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 11 Jun 2024 10:51:17 -0500 Subject: [PATCH 134/325] Delete unused config (#14016) --- beacon-chain/node/node.go | 1 - beacon-chain/node/options.go | 9 --------- 2 files changed, 10 deletions(-) diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 8c2edff3d05f..473868b82bd2 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -120,7 +120,6 @@ type BeaconNode struct { initialSyncComplete chan struct{} BlobStorage *filesystem.BlobStorage BlobStorageOptions []filesystem.BlobStorageOption - blobRetentionEpochs primitives.Epoch verifyInitWaiter *verification.InitializerWaiter syncChecker *initialsync.SyncChecker } diff --git a/beacon-chain/node/options.go b/beacon-chain/node/options.go index db482bd14e4f..0f51980672cb 100644 --- a/beacon-chain/node/options.go +++ b/beacon-chain/node/options.go @@ -5,7 +5,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filesystem" "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) // Option for beacon node configuration. @@ -51,11 +50,3 @@ func WithBlobStorageOptions(opt ...filesystem.BlobStorageOption) Option { return nil } } - -// WithBlobRetentionEpochs sets the blobRetentionEpochs value, used in kv store initialization. -func WithBlobRetentionEpochs(e primitives.Epoch) Option { - return func(bn *BeaconNode) error { - bn.blobRetentionEpochs = e - return nil - } -} From 070a765d241d0f953e137841fbf73c7cf880694d Mon Sep 17 00:00:00 2001 From: Patrice Vignola Date: Wed, 12 Jun 2024 05:46:23 -0700 Subject: [PATCH 135/325] Add stub for VerifySignature when build tag blst_disabled is set (#12246) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- crypto/bls/blst/stub.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/bls/blst/stub.go b/crypto/bls/blst/stub.go index 7d9fadae5f64..4929da62edd8 100644 --- a/crypto/bls/blst/stub.go +++ b/crypto/bls/blst/stub.go @@ -133,6 +133,11 @@ func AggregateCompressedSignatures(multiSigs [][]byte) (common.Signature, error) panic(err) } +// VerifySignature -- stub +func VerifySignature(_ []byte, _ [32]byte, _ common.PublicKey) (bool, error) { + panic(err) +} + // VerifyMultipleSignatures -- stub func VerifyMultipleSignatures(_ [][]byte, _ [][32]byte, _ []common.PublicKey) (bool, error) { panic(err) From 3413d05b3421c27579cf7a186cb9b142ffbb8346 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:16:31 -0500 Subject: [PATCH 136/325] Electra: field renames (#14091) * renaming functions and fields based on consensus changes * execution api rename * fixing test * reverting spectests changes, it should be changed with new version * reverting temporarily * revert exclusions --- beacon-chain/core/electra/deposits.go | 8 +- beacon-chain/core/electra/upgrade.go | 8 +- beacon-chain/core/electra/upgrade_test.go | 6 +- beacon-chain/core/electra/withdrawals.go | 10 +- beacon-chain/core/electra/withdrawals_test.go | 18 +- .../transition/transition_no_verify_sig.go | 12 +- beacon-chain/db/kv/state_test.go | 2 +- beacon-chain/execution/engine_client.go | 6 +- beacon-chain/execution/engine_client_test.go | 2 +- beacon-chain/execution/payload_body_test.go | 2 +- beacon-chain/rpc/eth/config/handlers_test.go | 9 +- .../prysm/v1alpha1/validator/proposer_test.go | 8 +- beacon-chain/state/interfaces.go | 4 +- beacon-chain/state/state-native/BUILD.bazel | 8 +- .../state-native/beacon_state_mainnet.go | 6 +- .../state-native/beacon_state_minimal.go | 6 +- .../state-native/getters_deposit_receipts.go | 16 - .../state-native/getters_deposit_requests.go | 16 + ...st.go => getters_deposit_requests_test.go} | 8 +- .../state/state-native/getters_state.go | 4 +- beacon-chain/state/state-native/hasher.go | 6 +- .../state-native/setters_deposit_receipts.go | 21 - .../state-native/setters_deposit_requests.go | 21 + ...st.go => setters_deposit_requests_test.go} | 10 +- beacon-chain/state/state-native/state_trie.go | 10 +- .../state/state-native/types/types.go | 8 +- cmd/prysmctl/tosaccepted | 0 config/fieldparams/mainnet.go | 2 +- config/fieldparams/minimal.go | 2 +- config/params/config.go | 3 +- config/params/loader_test.go | 2 +- config/params/mainnet_config.go | 3 +- config/params/minimal_config.go | 1 + consensus-types/blocks/execution.go | 24 +- consensus-types/interfaces/beacon_block.go | 4 +- encoding/ssz/htrutils.go | 16 +- encoding/ssz/htrutils_test.go | 18 +- proto/engine/v1/BUILD.bazel | 4 +- proto/engine/v1/execution_engine.pb.go | 750 +++++++++--------- proto/engine/v1/execution_engine.proto | 14 +- proto/engine/v1/generated.ssz.go | 152 ++-- proto/engine/v1/json_marshal_unmarshal.go | 24 +- .../engine/v1/json_marshal_unmarshal_test.go | 10 +- proto/eth/v1/generated.ssz.go | 2 +- proto/eth/v2/generated.ssz.go | 2 +- proto/prysm/v1alpha1/beacon_state.pb.go | 12 +- proto/prysm/v1alpha1/beacon_state.proto | 2 +- proto/prysm/v1alpha1/cloners.go | 16 +- proto/prysm/v1alpha1/cloners_test.go | 30 +- proto/prysm/v1alpha1/generated.ssz.go | 14 +- .../validator-client/keymanager.pb.go | 5 +- proto/ssz_proto_library.bzl | 4 +- .../execution_layer_withdrawals_test.go | 4 +- .../execution_layer_withdrawals_test.go | 4 +- .../shared/electra/operations/BUILD.bazel | 4 +- ...{deposit_receipt.go => deposit_request.go} | 0 ...rawal_request.go => withdrawal_request.go} | 14 +- .../shared/electra/ssz_static/ssz_static.go | 8 +- testing/util/block.go | 6 +- testing/util/electra.go | 14 +- testing/util/electra_state.go | 8 +- testing/util/state.go | 2 +- 62 files changed, 708 insertions(+), 707 deletions(-) delete mode 100644 beacon-chain/state/state-native/getters_deposit_receipts.go create mode 100644 beacon-chain/state/state-native/getters_deposit_requests.go rename beacon-chain/state/state-native/{getters_deposit_receipts_test.go => getters_deposit_requests_test.go} (78%) delete mode 100644 beacon-chain/state/state-native/setters_deposit_receipts.go create mode 100644 beacon-chain/state/state-native/setters_deposit_requests.go rename beacon-chain/state/state-native/{setters_deposit_receipts_test.go => setters_deposit_requests_test.go} (75%) create mode 100644 cmd/prysmctl/tosaccepted rename testing/spectest/shared/electra/operations/{deposit_receipt.go => deposit_request.go} (100%) rename testing/spectest/shared/electra/operations/{execution_layer_withdrawal_request.go => withdrawal_request.go} (71%) diff --git a/beacon-chain/core/electra/deposits.go b/beacon-chain/core/electra/deposits.go index 507da30c904b..56916f26dea9 100644 --- a/beacon-chain/core/electra/deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -77,11 +77,11 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac } } -// ProcessDepositReceipts is a function as part of electra to process execution layer deposits -func ProcessDepositReceipts(ctx context.Context, beaconState state.BeaconState, receipts []*enginev1.DepositReceipt) (state.BeaconState, error) { - _, span := trace.StartSpan(ctx, "electra.ProcessDepositReceipts") +// ProcessDepositRequests is a function as part of electra to process execution layer deposits +func ProcessDepositRequests(ctx context.Context, beaconState state.BeaconState, requests []*enginev1.DepositRequest) (state.BeaconState, error) { + _, span := trace.StartSpan(ctx, "electra.ProcessDepositRequests") defer span.End() // TODO: replace with 6110 logic - // return b.ProcessDepositReceipts(beaconState, receipts) + // return b.ProcessDepositRequests(beaconState, requests) return beaconState, nil } diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index cfb625cfeec9..ef49f55552aa 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -38,7 +38,7 @@ import ( // withdrawals_root=pre.latest_execution_payload_header.withdrawals_root, // blob_gas_used=pre.latest_execution_payload_header.blob_gas_used, // excess_blob_gas=pre.latest_execution_payload_header.excess_blob_gas, -// deposit_receipts_root=Root(), # [New in Electra:EIP6110] +// deposit_requests_root=Root(), # [New in Electra:EIP6110] // withdrawal_requests_root=Root(), # [New in Electra:EIP7002], // ) // @@ -94,7 +94,7 @@ import ( // # Deep history valid from Capella onwards // historical_summaries=pre.historical_summaries, // # [New in Electra:EIP6110] -// deposit_receipts_start_index=UNSET_DEPOSIT_RECEIPTS_START_INDEX, +// deposit_requests_start_index=UNSET_DEPOSIT_REQUESTS_START_INDEX, // # [New in Electra:EIP7251] // deposit_balance_to_consume=0, // exit_balance_to_consume=0, @@ -261,14 +261,14 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) WithdrawalsRoot: wdRoot, ExcessBlobGas: excessBlobGas, BlobGasUsed: blobGasUsed, - DepositReceiptsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP6110] + DepositRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP6110] WithdrawalRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7002] }, NextWithdrawalIndex: wi, NextWithdrawalValidatorIndex: vi, HistoricalSummaries: summaries, - DepositReceiptsStartIndex: params.BeaconConfig().UnsetDepositReceiptsStartIndex, + DepositRequestsStartIndex: params.BeaconConfig().UnsetDepositRequestsStartIndex, DepositBalanceToConsume: 0, ExitBalanceToConsume: helpers.ActivationExitChurnLimit(primitives.Gwei(tab)), EarliestExitEpoch: earliestExitEpoch, diff --git a/beacon-chain/core/electra/upgrade_test.go b/beacon-chain/core/electra/upgrade_test.go index 4193b6b9ce7a..a5475acfd87c 100644 --- a/beacon-chain/core/electra/upgrade_test.go +++ b/beacon-chain/core/electra/upgrade_test.go @@ -128,7 +128,7 @@ func TestUpgradeToElectra(t *testing.T) { BlockHash: prevHeader.BlockHash(), TransactionsRoot: txRoot, WithdrawalsRoot: wdRoot, - DepositReceiptsRoot: bytesutil.Bytes32(0), + DepositRequestsRoot: bytesutil.Bytes32(0), WithdrawalRequestsRoot: bytesutil.Bytes32(0), } require.DeepEqual(t, wanted, protoHeader) @@ -145,9 +145,9 @@ func TestUpgradeToElectra(t *testing.T) { require.NoError(t, err) require.Equal(t, 0, len(summaries)) - startIndex, err := mSt.DepositReceiptsStartIndex() + startIndex, err := mSt.DepositRequestsStartIndex() require.NoError(t, err) - require.Equal(t, params.BeaconConfig().UnsetDepositReceiptsStartIndex, startIndex) + require.Equal(t, params.BeaconConfig().UnsetDepositRequestsStartIndex, startIndex) balance, err := mSt.DepositBalanceToConsume() require.NoError(t, err) diff --git a/beacon-chain/core/electra/withdrawals.go b/beacon-chain/core/electra/withdrawals.go index 8fb1b57c9a3c..c1f2bd5fdce0 100644 --- a/beacon-chain/core/electra/withdrawals.go +++ b/beacon-chain/core/electra/withdrawals.go @@ -19,15 +19,15 @@ import ( "go.opencensus.io/trace" ) -// ProcessExecutionLayerWithdrawalRequests processes the validator withdrawals from the provided execution payload +// ProcessWithdrawalRequests processes the validator withdrawals from the provided execution payload // into the beacon state triggered by the execution layer. // // Spec pseudocode definition: // -// def process_execution_layer_withdrawal_request( +// def process_withdrawal_request( // // state: BeaconState, -// execution_layer_withdrawal_request: ExecutionLayerWithdrawalRequest +// withdrawal_request: WithdrawalRequest // // ) -> None: // amount = execution_layer_withdrawal_request.amount @@ -86,8 +86,8 @@ import ( // amount=to_withdraw, // withdrawable_epoch=withdrawable_epoch, // )) -func ProcessExecutionLayerWithdrawalRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.ExecutionLayerWithdrawalRequest) (state.BeaconState, error) { - ctx, span := trace.StartSpan(ctx, "electra.ProcessExecutionLayerWithdrawalRequests") +func ProcessWithdrawalRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.WithdrawalRequest) (state.BeaconState, error) { + ctx, span := trace.StartSpan(ctx, "electra.ProcessWithdrawalRequests") defer span.End() currentEpoch := slots.ToEpoch(st.Slot()) for _, wr := range wrs { diff --git a/beacon-chain/core/electra/withdrawals_test.go b/beacon-chain/core/electra/withdrawals_test.go index 0831fa17672d..4f2634ebd6a2 100644 --- a/beacon-chain/core/electra/withdrawals_test.go +++ b/beacon-chain/core/electra/withdrawals_test.go @@ -19,7 +19,7 @@ import ( "github.com/sirupsen/logrus/hooks/test" ) -func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { +func TestProcessWithdrawRequests(t *testing.T) { logHook := test.NewGlobal() source, err := hexutil.Decode("0xb20a608c624Ca5003905aA834De7156C68b2E1d0") require.NoError(t, err) @@ -30,7 +30,7 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { require.NoError(t, err) type args struct { st state.BeaconState - wrs []*enginev1.ExecutionLayerWithdrawalRequest + wrs []*enginev1.WithdrawalRequest } tests := []struct { name string @@ -56,7 +56,7 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) return preSt }(), - wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + wrs: []*enginev1.WithdrawalRequest{ { SourceAddress: source, ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), @@ -121,7 +121,7 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { })) return preSt }(), - wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + wrs: []*enginev1.WithdrawalRequest{ { SourceAddress: source, ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), @@ -190,7 +190,7 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) return preSt }(), - wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + wrs: []*enginev1.WithdrawalRequest{ { SourceAddress: source, ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), @@ -227,7 +227,7 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) return preSt }(), - wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + wrs: []*enginev1.WithdrawalRequest{ { SourceAddress: source, ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), @@ -266,7 +266,7 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { })) return preSt }(), - wrs: []*enginev1.ExecutionLayerWithdrawalRequest{ + wrs: []*enginev1.WithdrawalRequest{ { SourceAddress: source, ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey), @@ -284,9 +284,9 @@ func TestProcessExecutionLayerWithdrawRequests(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := electra.ProcessExecutionLayerWithdrawalRequests(context.Background(), tt.args.st, tt.args.wrs) + got, err := electra.ProcessWithdrawalRequests(context.Background(), tt.args.st, tt.args.wrs) if (err != nil) != tt.wantErr { - t.Errorf("ProcessExecutionLayerWithdrawalRequests() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("ProcessWithdrawalRequests() error = %v, wantErr %v", err, tt.wantErr) return } tt.wantFn(t, got) diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index ee000bd6a4bc..58a546c97819 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -227,7 +227,7 @@ func ProcessBlockNoVerifyAnySig( // def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: // # [Modified in Electra:EIP6110] // # Disable former deposit mechanism once all prior deposits are processed -// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index) +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) // if state.eth1_deposit_index < eth1_deposit_index_limit: // assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) // else: @@ -245,7 +245,7 @@ func ProcessBlockNoVerifyAnySig( // for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) // # [New in Electra:EIP7002:EIP7251] // for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) -// for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt) # [New in Electra:EIP6110] +// for_ops(body.execution_payload.deposit_requests, process_deposit_requests) # [New in Electra:EIP6110] // for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] func ProcessOperationsNoVerifyAttsSigs( ctx context.Context, @@ -401,7 +401,7 @@ func VerifyBlobCommitmentCount(blk interfaces.ReadOnlyBeaconBlock) error { // def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: // # [Modified in Electra:EIP6110] // # Disable former deposit mechanism once all prior deposits are processed -// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index) +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) // if state.eth1_deposit_index < eth1_deposit_index_limit: // assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) // else: @@ -419,7 +419,7 @@ func VerifyBlobCommitmentCount(blk interfaces.ReadOnlyBeaconBlock) error { // for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) // # [New in Electra:EIP7002:EIP7251] // for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) -// for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt) # [New in Electra:EIP6110] +// for_ops(body.execution_payload.deposit_requests, process_deposit_requests) # [New in Electra:EIP6110] // for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] func electraOperations( ctx context.Context, @@ -445,12 +445,12 @@ func electraOperations( if !ok { return nil, errors.New("could not cast execution data to electra execution data") } - st, err = electra.ProcessExecutionLayerWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) + st, err = electra.ProcessWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) if err != nil { return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") } - st, err = electra.ProcessDepositReceipts(ctx, st, exe.DepositReceipts()) // TODO: EIP-6110 deposit changes. + st, err = electra.ProcessDepositRequests(ctx, st, exe.DepositRequests()) // TODO: EIP-6110 deposit changes. if err != nil { return nil, errors.Wrap(err, "could not process deposit receipts") } diff --git a/beacon-chain/db/kv/state_test.go b/beacon-chain/db/kv/state_test.go index 938b95514599..f7af8bd4213a 100644 --- a/beacon-chain/db/kv/state_test.go +++ b/beacon-chain/db/kv/state_test.go @@ -149,7 +149,7 @@ func TestState_CanSaveRetrieve(t *testing.T) { BlockHash: make([]byte, 32), TransactionsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32), - DepositReceiptsRoot: make([]byte, 32), + DepositRequestsRoot: make([]byte, 32), WithdrawalRequestsRoot: make([]byte, 32), }) require.NoError(t, err) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index cf8a791fc999..7ce50bae0cd9 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -631,7 +631,7 @@ func fullPayloadFromPayloadBody( Withdrawals: body.Withdrawals, ExcessBlobGas: ebg, BlobGasUsed: bgu, - DepositReceipts: dr, + DepositRequests: dr, WithdrawalRequests: wr, }) // We can't get the block value and don't care about the block value for this instance default: @@ -780,8 +780,8 @@ func buildEmptyExecutionPayload(v int) (proto.Message, error) { BlockHash: make([]byte, fieldparams.RootLength), Transactions: make([][]byte, 0), Withdrawals: make([]*pb.Withdrawal, 0), - WithdrawalRequests: make([]*pb.ExecutionLayerWithdrawalRequest, 0), - DepositReceipts: make([]*pb.DepositReceipt, 0), + WithdrawalRequests: make([]*pb.WithdrawalRequest, 0), + DepositRequests: make([]*pb.DepositRequest, 0), }, nil default: return nil, errors.Wrapf(ErrUnsupportedVersion, "version=%s", version.String(v)) diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index c4255c9f62a8..246085a932e3 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -1559,7 +1559,7 @@ func fixturesStruct() *payloadFixtures { Withdrawals: []*pb.Withdrawal{}, BlobGasUsed: 2, ExcessBlobGas: 3, - DepositReceipts: dr, + DepositRequests: dr, WithdrawalRequests: wr, } hexUint := hexutil.Uint64(1) diff --git a/beacon-chain/execution/payload_body_test.go b/beacon-chain/execution/payload_body_test.go index b95edead67d8..f94192dec00f 100644 --- a/beacon-chain/execution/payload_body_test.go +++ b/beacon-chain/execution/payload_body_test.go @@ -66,7 +66,7 @@ func payloadToBody(t *testing.T, ed interfaces.ExecutionData) *pb.ExecutionPaylo } eed, isElectra := ed.(interfaces.ExecutionDataElectra) if isElectra { - body.DepositRequests = pb.ProtoDepositRequestsToJson(eed.DepositReceipts()) + body.DepositRequests = pb.ProtoDepositRequestsToJson(eed.DepositRequests()) body.WithdrawalRequests = pb.ProtoWithdrawalRequestsToJson(eed.WithdrawalRequests()) } return body diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index 384e1d53c950..18a5159da585 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -149,7 +149,8 @@ func TestGetSpec(t *testing.T) { config.MaxAttestationsElectra = 89 config.MaxWithdrawalRequestsPerPayload = 90 config.MaxCellsInExtendedMatrix = 91 - config.UnsetDepositReceiptsStartIndex = 92 + config.UnsetDepositRequestsStartIndex = 92 + config.MaxDepositRequestsPerPayload = 93 var dbp [4]byte copy(dbp[:], []byte{'0', '0', '0', '1'}) @@ -192,7 +193,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 154, len(data)) + assert.Equal(t, 155, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -525,8 +526,10 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "90", v) case "MAX_CELLS_IN_EXTENDED_MATRIX": assert.Equal(t, "91", v) - case "UNSET_DEPOSIT_RECEIPTS_START_INDEX": + case "UNSET_DEPOSIT_REQUESTS_START_INDEX": assert.Equal(t, "92", v) + case "MAX_DEPOSIT_REQUESTS_PER_PAYLOAD": + assert.Equal(t, "93", v) default: t.Errorf("Incorrect key: %s", k) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index fcecd22b0f49..f10023a80c21 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -630,14 +630,14 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { require.NoError(t, err) timeStamp, err := slots.ToTime(beaconState.GenesisTime(), electraSlot+1) require.NoError(t, err) - dr := []*enginev1.DepositReceipt{{ + dr := []*enginev1.DepositRequest{{ Pubkey: bytesutil.PadTo(privKeys[0].PublicKey().Marshal(), 48), WithdrawalCredentials: bytesutil.PadTo([]byte("wc"), 32), Amount: 123, Signature: bytesutil.PadTo([]byte("sig"), 96), Index: 456, }} - wr := []*enginev1.ExecutionLayerWithdrawalRequest{ + wr := []*enginev1.WithdrawalRequest{ { SourceAddress: bytesutil.PadTo([]byte("sa"), 20), ValidatorPubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), @@ -654,7 +654,7 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { PrevRandao: random, BaseFeePerGas: make([]byte, fieldparams.RootLength), BlockHash: make([]byte, fieldparams.RootLength), - DepositReceipts: dr, + DepositRequests: dr, WithdrawalRequests: wr, } @@ -680,7 +680,7 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { got, err := proposerServer.GetBeaconBlock(ctx, req) require.NoError(t, err) p := got.GetElectra().Block.Body.ExecutionPayload - require.DeepEqual(t, dr, p.DepositReceipts) + require.DeepEqual(t, dr, p.DepositRequests) require.DeepEqual(t, wr, p.WithdrawalRequests) } diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 7a6a5e83d9af..85c9bb9e25e2 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -219,7 +219,7 @@ type ReadOnlySyncCommittee interface { type ReadOnlyDeposits interface { DepositBalanceToConsume() (primitives.Gwei, error) - DepositReceiptsStartIndex() (uint64, error) + DepositRequestsStartIndex() (uint64, error) PendingBalanceDeposits() ([]*ethpb.PendingBalanceDeposit, error) } @@ -327,7 +327,7 @@ type WriteOnlyConsolidations interface { type WriteOnlyDeposits interface { AppendPendingBalanceDeposit(index primitives.ValidatorIndex, amount uint64) error - SetDepositReceiptsStartIndex(index uint64) error + SetDepositRequestsStartIndex(index uint64) error SetPendingBalanceDeposits(val []*ethpb.PendingBalanceDeposit) error SetDepositBalanceToConsume(primitives.Gwei) error } diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 91dd62d471a0..46c8bb8e4497 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -12,7 +12,7 @@ go_library( "getters_block.go", "getters_checkpoint.go", "getters_consolidation.go", - "getters_deposit_receipts.go", + "getters_deposit_requests.go", "getters_eth1.go", "getters_exit.go", "getters_misc.go", @@ -33,7 +33,7 @@ go_library( "setters_checkpoint.go", "setters_churn.go", "setters_consolidation.go", - "setters_deposit_receipts.go", + "setters_deposit_requests.go", "setters_eth1.go", "setters_misc.go", "setters_participation.go", @@ -94,7 +94,7 @@ go_test( "getters_block_test.go", "getters_checkpoint_test.go", "getters_consolidation_test.go", - "getters_deposit_receipts_test.go", + "getters_deposit_requests_test.go", "getters_exit_test.go", "getters_participation_test.go", "getters_test.go", @@ -109,7 +109,7 @@ go_test( "setters_balance_deposits_test.go", "setters_churn_test.go", "setters_consolidation_test.go", - "setters_deposit_receipts_test.go", + "setters_deposit_requests_test.go", "setters_eth1_test.go", "setters_misc_test.go", "setters_participation_test.go", diff --git a/beacon-chain/state/state-native/beacon_state_mainnet.go b/beacon-chain/state/state-native/beacon_state_mainnet.go index 8cdcda554e6a..922f870989d0 100644 --- a/beacon-chain/state/state-native/beacon_state_mainnet.go +++ b/beacon-chain/state/state-native/beacon_state_mainnet.go @@ -62,7 +62,7 @@ type BeaconState struct { nextWithdrawalValidatorIndex primitives.ValidatorIndex // Electra fields - depositReceiptsStartIndex uint64 + depositRequestsStartIndex uint64 depositBalanceToConsume primitives.Gwei exitBalanceToConsume primitives.Gwei earliestExitEpoch primitives.Epoch @@ -119,7 +119,7 @@ type beaconStateMarshalable struct { LatestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header_electra" yaml:"latest_execution_payload_header_electra"` NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` - DepositReceiptsStartIndex uint64 `json:"deposit_receipts_start_index" yaml:"deposit_receipts_start_index"` + DepositRequestsStartIndex uint64 `json:"deposit_requests_start_index" yaml:"deposit_requests_start_index"` DepositBalanceToConsume primitives.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` ExitBalanceToConsume primitives.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` @@ -189,7 +189,7 @@ func (b *BeaconState) MarshalJSON() ([]byte, error) { LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra, NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, - DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositRequestsStartIndex: b.depositRequestsStartIndex, DepositBalanceToConsume: b.depositBalanceToConsume, ExitBalanceToConsume: b.exitBalanceToConsume, EarliestExitEpoch: b.earliestExitEpoch, diff --git a/beacon-chain/state/state-native/beacon_state_minimal.go b/beacon-chain/state/state-native/beacon_state_minimal.go index 886634a90832..ad5a51d9349f 100644 --- a/beacon-chain/state/state-native/beacon_state_minimal.go +++ b/beacon-chain/state/state-native/beacon_state_minimal.go @@ -62,7 +62,7 @@ type BeaconState struct { nextWithdrawalValidatorIndex primitives.ValidatorIndex // Electra fields - depositReceiptsStartIndex uint64 + depositRequestsStartIndex uint64 depositBalanceToConsume primitives.Gwei exitBalanceToConsume primitives.Gwei earliestExitEpoch primitives.Epoch @@ -119,7 +119,7 @@ type beaconStateMarshalable struct { LatestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header_electra" yaml:"latest_execution_payload_header_electra"` NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` - DepositReceiptsStartIndex uint64 `json:"deposit_receipts_start_index" yaml:"deposit_receipts_start_index"` + DepositRequestsStartIndex uint64 `json:"deposit_requests_start_index" yaml:"deposit_requests_start_index"` DepositBalanceToConsume primitives.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` ExitBalanceToConsume primitives.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` @@ -189,7 +189,7 @@ func (b *BeaconState) MarshalJSON() ([]byte, error) { LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra, NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, - DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositRequestsStartIndex: b.depositRequestsStartIndex, DepositBalanceToConsume: b.depositBalanceToConsume, ExitBalanceToConsume: b.exitBalanceToConsume, EarliestExitEpoch: b.earliestExitEpoch, diff --git a/beacon-chain/state/state-native/getters_deposit_receipts.go b/beacon-chain/state/state-native/getters_deposit_receipts.go deleted file mode 100644 index aa15a9a8a0be..000000000000 --- a/beacon-chain/state/state-native/getters_deposit_receipts.go +++ /dev/null @@ -1,16 +0,0 @@ -package state_native - -import ( - "github.com/prysmaticlabs/prysm/v5/runtime/version" -) - -// DepositReceiptsStartIndex is used for returning the deposit receipts start index which is used for eip6110 -func (b *BeaconState) DepositReceiptsStartIndex() (uint64, error) { - if b.version < version.Electra { - return 0, errNotSupported("DepositReceiptsStartIndex", b.version) - } - b.lock.RLock() - defer b.lock.RUnlock() - - return b.depositReceiptsStartIndex, nil -} diff --git a/beacon-chain/state/state-native/getters_deposit_requests.go b/beacon-chain/state/state-native/getters_deposit_requests.go new file mode 100644 index 000000000000..2e91709d8ef8 --- /dev/null +++ b/beacon-chain/state/state-native/getters_deposit_requests.go @@ -0,0 +1,16 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// DepositRequestsStartIndex is used for returning the deposit receipts start index which is used for eip6110 +func (b *BeaconState) DepositRequestsStartIndex() (uint64, error) { + if b.version < version.Electra { + return 0, errNotSupported("DepositRequestsStartIndex", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + + return b.depositRequestsStartIndex, nil +} diff --git a/beacon-chain/state/state-native/getters_deposit_receipts_test.go b/beacon-chain/state/state-native/getters_deposit_requests_test.go similarity index 78% rename from beacon-chain/state/state-native/getters_deposit_receipts_test.go rename to beacon-chain/state/state-native/getters_deposit_requests_test.go index de6ea94bb2ad..71f592fcaacd 100644 --- a/beacon-chain/state/state-native/getters_deposit_receipts_test.go +++ b/beacon-chain/state/state-native/getters_deposit_requests_test.go @@ -9,17 +9,17 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestDepositReceiptsStartIndex(t *testing.T) { +func TestDepositRequestsStartIndex(t *testing.T) { t.Run("previous fork returns expected error", func(t *testing.T) { dState, _ := util.DeterministicGenesisState(t, 1) - _, err := dState.DepositReceiptsStartIndex() + _, err := dState.DepositRequestsStartIndex() require.ErrorContains(t, "is not supported", err) }) t.Run("electra returns expected value", func(t *testing.T) { want := uint64(2) - dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositReceiptsStartIndex: want}) + dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositRequestsStartIndex: want}) require.NoError(t, err) - got, err := dState.DepositReceiptsStartIndex() + got, err := dState.DepositRequestsStartIndex() require.NoError(t, err) require.Equal(t, want, got) }) diff --git a/beacon-chain/state/state-native/getters_state.go b/beacon-chain/state/state-native/getters_state.go index 402586e63360..65cae0787134 100644 --- a/beacon-chain/state/state-native/getters_state.go +++ b/beacon-chain/state/state-native/getters_state.go @@ -202,7 +202,7 @@ func (b *BeaconState) ToProtoUnsafe() interface{} { NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummaries, - DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositRequestsStartIndex: b.depositRequestsStartIndex, DepositBalanceToConsume: b.depositBalanceToConsume, ExitBalanceToConsume: b.exitBalanceToConsume, EarliestExitEpoch: b.earliestExitEpoch, @@ -408,7 +408,7 @@ func (b *BeaconState) ToProto() interface{} { NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummariesVal(), - DepositReceiptsStartIndex: b.depositReceiptsStartIndex, + DepositRequestsStartIndex: b.depositRequestsStartIndex, DepositBalanceToConsume: b.depositBalanceToConsume, ExitBalanceToConsume: b.exitBalanceToConsume, EarliestExitEpoch: b.earliestExitEpoch, diff --git a/beacon-chain/state/state-native/hasher.go b/beacon-chain/state/state-native/hasher.go index 92014a0767c2..c4e3254c49df 100644 --- a/beacon-chain/state/state-native/hasher.go +++ b/beacon-chain/state/state-native/hasher.go @@ -281,9 +281,9 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b } if state.version >= version.Electra { - // DepositReceiptsStartIndex root. - drsiRoot := ssz.Uint64Root(state.depositReceiptsStartIndex) - fieldRoots[types.DepositReceiptsStartIndex.RealPosition()] = drsiRoot[:] + // DepositRequestsStartIndex root. + drsiRoot := ssz.Uint64Root(state.depositRequestsStartIndex) + fieldRoots[types.DepositRequestsStartIndex.RealPosition()] = drsiRoot[:] // DepositBalanceToConsume root. dbtcRoot := ssz.Uint64Root(uint64(state.depositBalanceToConsume)) diff --git a/beacon-chain/state/state-native/setters_deposit_receipts.go b/beacon-chain/state/state-native/setters_deposit_receipts.go deleted file mode 100644 index bd24820a99c2..000000000000 --- a/beacon-chain/state/state-native/setters_deposit_receipts.go +++ /dev/null @@ -1,21 +0,0 @@ -package state_native - -import ( - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" - "github.com/prysmaticlabs/prysm/v5/runtime/version" -) - -// SetDepositReceiptsStartIndex for the beacon state. Updates the DepositReceiptsStartIndex -func (b *BeaconState) SetDepositReceiptsStartIndex(index uint64) error { - if b.version < version.Electra { - return errNotSupported("SetDepositReceiptsStartIndex", b.version) - } - - b.lock.Lock() - defer b.lock.Unlock() - - b.depositReceiptsStartIndex = index - b.markFieldAsDirty(types.DepositReceiptsStartIndex) - b.rebuildTrie[types.DepositReceiptsStartIndex] = true - return nil -} diff --git a/beacon-chain/state/state-native/setters_deposit_requests.go b/beacon-chain/state/state-native/setters_deposit_requests.go new file mode 100644 index 000000000000..bd441c248e1d --- /dev/null +++ b/beacon-chain/state/state-native/setters_deposit_requests.go @@ -0,0 +1,21 @@ +package state_native + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// SetDepositRequestsStartIndex for the beacon state. Updates the DepositRequestsStartIndex +func (b *BeaconState) SetDepositRequestsStartIndex(index uint64) error { + if b.version < version.Electra { + return errNotSupported("SetDepositRequestsStartIndex", b.version) + } + + b.lock.Lock() + defer b.lock.Unlock() + + b.depositRequestsStartIndex = index + b.markFieldAsDirty(types.DepositRequestsStartIndex) + b.rebuildTrie[types.DepositRequestsStartIndex] = true + return nil +} diff --git a/beacon-chain/state/state-native/setters_deposit_receipts_test.go b/beacon-chain/state/state-native/setters_deposit_requests_test.go similarity index 75% rename from beacon-chain/state/state-native/setters_deposit_receipts_test.go rename to beacon-chain/state/state-native/setters_deposit_requests_test.go index 8c02bfd5b615..bfe98d1a1dd1 100644 --- a/beacon-chain/state/state-native/setters_deposit_receipts_test.go +++ b/beacon-chain/state/state-native/setters_deposit_requests_test.go @@ -9,18 +9,18 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestSetDepositReceiptsStartIndex(t *testing.T) { +func TestSetDepositRequestsStartIndex(t *testing.T) { t.Run("previous fork returns expected error", func(t *testing.T) { dState, _ := util.DeterministicGenesisState(t, 1) - require.ErrorContains(t, "is not supported", dState.SetDepositReceiptsStartIndex(1)) + require.ErrorContains(t, "is not supported", dState.SetDepositRequestsStartIndex(1)) }) t.Run("electra sets expected value", func(t *testing.T) { old := uint64(2) - dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositReceiptsStartIndex: old}) + dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositRequestsStartIndex: old}) require.NoError(t, err) want := uint64(3) - require.NoError(t, dState.SetDepositReceiptsStartIndex(want)) - got, err := dState.DepositReceiptsStartIndex() + require.NoError(t, dState.SetDepositRequestsStartIndex(want)) + got, err := dState.DepositRequestsStartIndex() require.NoError(t, err) require.Equal(t, want, got) }) diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 60dc8acd6033..095fd9e52817 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -100,7 +100,7 @@ var electraFields = append( types.NextWithdrawalValidatorIndex, types.HistoricalSummaries, types.LatestExecutionPayloadHeaderElectra, - types.DepositReceiptsStartIndex, + types.DepositRequestsStartIndex, types.DepositBalanceToConsume, types.ExitBalanceToConsume, types.EarliestExitEpoch, @@ -744,7 +744,7 @@ func InitializeFromProtoUnsafeElectra(st *ethpb.BeaconStateElectra) (state.Beaco nextWithdrawalIndex: st.NextWithdrawalIndex, nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex, historicalSummaries: st.HistoricalSummaries, - depositReceiptsStartIndex: st.DepositReceiptsStartIndex, + depositRequestsStartIndex: st.DepositRequestsStartIndex, depositBalanceToConsume: st.DepositBalanceToConsume, exitBalanceToConsume: st.ExitBalanceToConsume, earliestExitEpoch: st.EarliestExitEpoch, @@ -862,7 +862,7 @@ func (b *BeaconState) Copy() state.BeaconState { eth1DepositIndex: b.eth1DepositIndex, nextWithdrawalIndex: b.nextWithdrawalIndex, nextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, - depositReceiptsStartIndex: b.depositReceiptsStartIndex, + depositRequestsStartIndex: b.depositRequestsStartIndex, depositBalanceToConsume: b.depositBalanceToConsume, exitBalanceToConsume: b.exitBalanceToConsume, earliestExitEpoch: b.earliestExitEpoch, @@ -1286,8 +1286,8 @@ func (b *BeaconState) rootSelector(ctx context.Context, field types.FieldIndex) return ssz.Uint64Root(uint64(b.nextWithdrawalValidatorIndex)), nil case types.HistoricalSummaries: return stateutil.HistoricalSummariesRoot(b.historicalSummaries) - case types.DepositReceiptsStartIndex: - return ssz.Uint64Root(b.depositReceiptsStartIndex), nil + case types.DepositRequestsStartIndex: + return ssz.Uint64Root(b.depositRequestsStartIndex), nil case types.DepositBalanceToConsume: return ssz.Uint64Root(uint64(b.depositBalanceToConsume)), nil case types.ExitBalanceToConsume: diff --git a/beacon-chain/state/state-native/types/types.go b/beacon-chain/state/state-native/types/types.go index 0bcd77f9b0e6..43cb57c6a76a 100644 --- a/beacon-chain/state/state-native/types/types.go +++ b/beacon-chain/state/state-native/types/types.go @@ -96,8 +96,8 @@ func (f FieldIndex) String() string { return "nextWithdrawalValidatorIndex" case HistoricalSummaries: return "historicalSummaries" - case DepositReceiptsStartIndex: - return "depositReceiptsStartIndex" + case DepositRequestsStartIndex: + return "depositRequestsStartIndex" case DepositBalanceToConsume: return "depositBalanceToConsume" case ExitBalanceToConsume: @@ -179,7 +179,7 @@ func (f FieldIndex) RealPosition() int { return 26 case HistoricalSummaries: return 27 - case DepositReceiptsStartIndex: + case DepositRequestsStartIndex: return 28 case DepositBalanceToConsume: return 29 @@ -253,7 +253,7 @@ const ( NextWithdrawalIndex NextWithdrawalValidatorIndex HistoricalSummaries - DepositReceiptsStartIndex // Electra: EIP-6110 + DepositRequestsStartIndex // Electra: EIP-6110 DepositBalanceToConsume // Electra: EIP-7251 ExitBalanceToConsume // Electra: EIP-7251 EarliestExitEpoch // Electra: EIP-7251 diff --git a/cmd/prysmctl/tosaccepted b/cmd/prysmctl/tosaccepted new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index 983b35db2177..d6c838d269c7 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -36,6 +36,6 @@ const ( PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. PendingPartialWithdrawalsLimit = 134217728 // Maximum number of pending partial withdrawals in the beacon state. PendingConsolidationsLimit = 262144 // Maximum number of pending consolidations in the beacon state. - MaxDepositReceiptsPerPayload = 8192 // Maximum number of deposit receipts in an execution payload. + MaxDepositRequestsPerPayload = 8192 // Maximum number of deposit requests in an execution payload. MaxWithdrawalRequestsPerPayload = 16 // Maximum number of execution layer withdrawal requests in an execution payload. ) diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index 297d7cac255c..cf5dfdc925ae 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -36,6 +36,6 @@ const ( PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. PendingPartialWithdrawalsLimit = 64 // Maximum number of pending partial withdrawals in the beacon state. PendingConsolidationsLimit = 64 // Maximum number of pending consolidations in the beacon state. - MaxDepositReceiptsPerPayload = 4 // Maximum number of deposit receipts in an execution payload. + MaxDepositRequestsPerPayload = 4 // Maximum number of deposit requests in an execution payload. MaxWithdrawalRequestsPerPayload = 2 // Maximum number of execution layer withdrawal requests in an execution payload. ) diff --git a/config/params/config.go b/config/params/config.go index 6bfcaf784f8a..816089cbcbcf 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -250,7 +250,8 @@ type BeaconChainConfig struct { MaxPendingPartialsPerWithdrawalsSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalsSweep is the maximum number of pending partial withdrawals to process per payload. FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit. MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload. - UnsetDepositReceiptsStartIndex uint64 `yaml:"UNSET_DEPOSIT_RECEIPTS_START_INDEX" spec:"true"` // UnsetDepositReceiptsStartIndex is used to check the start index for eip6110 + MaxDepositRequestsPerPayload uint64 `yaml:"MAX_DEPOSIT_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxDepositRequestsPerPayload is the maximum number of execution layer deposits in each payload + UnsetDepositRequestsStartIndex uint64 `yaml:"UNSET_DEPOSIT_REQUESTS_START_INDEX" spec:"true"` // UnsetDepositRequestsStartIndex is used to check the start index for eip6110 // Networking Specific Parameters GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE" spec:"true"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages. diff --git a/config/params/loader_test.go b/config/params/loader_test.go index ec11d43e80a2..09b9491f2b17 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -36,7 +36,7 @@ var placeholderFields = []string{ "MAX_BLOBS_PER_BLOCK", "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_DEPOSIT_RECEIPTS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.deposit_receipts. + "MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.deposit_receipts. TODO: rename when updating spec configs "MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. "REORG_HEAD_WEIGHT_THRESHOLD", diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index a9b5de56fd69..bfb8af28ef36 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -290,7 +290,8 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxPendingPartialsPerWithdrawalsSweep: 8, FullExitRequestAmount: 0, MaxWithdrawalRequestsPerPayload: 16, - UnsetDepositReceiptsStartIndex: math.MaxUint64, + MaxDepositRequestsPerPayload: 8192, // 2**13 (= 8192) + UnsetDepositRequestsStartIndex: math.MaxUint64, // Values related to networking parameters. GossipMaxSize: 10 * 1 << 20, // 10 MiB diff --git a/config/params/minimal_config.go b/config/params/minimal_config.go index adbdf250ec2d..0fd7d0fb378e 100644 --- a/config/params/minimal_config.go +++ b/config/params/minimal_config.go @@ -107,6 +107,7 @@ func MinimalSpecConfig() *BeaconChainConfig { minimalConfig.PendingConsolidationsLimit = 64 minimalConfig.MaxPartialWithdrawalsPerPayload = 1 minimalConfig.MaxWithdrawalRequestsPerPayload = 2 + minimalConfig.MaxDepositRequestsPerPayload = 4 minimalConfig.PendingPartialWithdrawalsLimit = 64 minimalConfig.MaxPendingPartialsPerWithdrawalsSweep = 1 diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index bb878a0bec50..26b415d78370 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -812,14 +812,14 @@ func PayloadToHeaderElectra(payload interfaces.ExecutionDataElectra) (*enginev1. return nil, err } - depositReceipts := payload.DepositReceipts() - depositReceiptsRoot, err := ssz.DepositReceiptSliceRoot(depositReceipts, fieldparams.MaxDepositReceiptsPerPayload) + depositRequests := payload.DepositRequests() + depositRequestsRoot, err := ssz.DepositRequestsSliceRoot(depositRequests, fieldparams.MaxDepositRequestsPerPayload) if err != nil { return nil, err } withdrawalRequests := payload.WithdrawalRequests() - withdrawalRequestsRoot, err := ssz.WithdrawalRequestSliceRoot(withdrawalRequests, fieldparams.MaxWithdrawalRequestsPerPayload) + withdrawalRequestsRoot, err := ssz.WithdrawalRequestsSliceRoot(withdrawalRequests, fieldparams.MaxWithdrawalRequestsPerPayload) if err != nil { return nil, err } @@ -842,7 +842,7 @@ func PayloadToHeaderElectra(payload interfaces.ExecutionDataElectra) (*enginev1. WithdrawalsRoot: withdrawalsRoot[:], BlobGasUsed: blobGasUsed, ExcessBlobGas: excessBlobGas, - DepositReceiptsRoot: depositReceiptsRoot[:], + DepositRequestsRoot: depositRequestsRoot[:], WithdrawalRequestsRoot: withdrawalRequestsRoot[:], }, nil } @@ -907,7 +907,7 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { epe, postElectra := data.(interfaces.ExecutionDataElectra) if postElectra { - drs := epe.DepositReceipts() + drs := epe.DepositRequests() if len(drs) != 0 { return false, nil } @@ -1389,13 +1389,13 @@ func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// DepositReceipts -- -func (e executionPayloadHeaderElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { +// DepositRequests -- +func (e executionPayloadHeaderElectra) DepositRequests() ([]*enginev1.DepositRequest, error) { return nil, consensus_types.ErrUnsupportedField } // WithdrawalRequests -- -func (e executionPayloadHeaderElectra) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { +func (e executionPayloadHeaderElectra) WithdrawalRequests() ([]*enginev1.WithdrawalRequest, error) { return nil, consensus_types.ErrUnsupportedField } @@ -1556,13 +1556,13 @@ func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } -// DepositReceipts -- -func (e executionPayloadElectra) DepositReceipts() []*enginev1.DepositReceipt { - return e.p.DepositReceipts +// DepositRequests -- +func (e executionPayloadElectra) DepositRequests() []*enginev1.DepositRequest { + return e.p.DepositRequests } // WithdrawalRequests -- -func (e executionPayloadElectra) WithdrawalRequests() []*enginev1.ExecutionLayerWithdrawalRequest { +func (e executionPayloadElectra) WithdrawalRequests() []*enginev1.WithdrawalRequest { return e.p.WithdrawalRequests } diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index c08ed34e4edf..fd708746fd2a 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -130,6 +130,6 @@ type ExecutionData interface { type ExecutionDataElectra interface { ExecutionData - DepositReceipts() []*enginev1.DepositReceipt - WithdrawalRequests() []*enginev1.ExecutionLayerWithdrawalRequest + DepositRequests() []*enginev1.DepositRequest + WithdrawalRequests() []*enginev1.WithdrawalRequest } diff --git a/encoding/ssz/htrutils.go b/encoding/ssz/htrutils.go index f610d2c3a1ae..6d45520ef5d5 100644 --- a/encoding/ssz/htrutils.go +++ b/encoding/ssz/htrutils.go @@ -141,12 +141,12 @@ func WithdrawalSliceRoot(withdrawals []*enginev1.Withdrawal, limit uint64) ([32] return MixInLength(bytesRoot, bytesRootBufRoot), nil } -// DepositReceiptSliceRoot computes the HTR of a slice of deposit receipts. +// DepositRequestsSliceRoot computes the HTR of a slice of deposit receipts. // The limit parameter is used as input to the bitwise merkleization algorithm. -func DepositReceiptSliceRoot(depositReceipts []*enginev1.DepositReceipt, limit uint64) ([32]byte, error) { - roots := make([][32]byte, len(depositReceipts)) - for i := 0; i < len(depositReceipts); i++ { - r, err := depositReceipts[i].HashTreeRoot() +func DepositRequestsSliceRoot(depositRequests []*enginev1.DepositRequest, limit uint64) ([32]byte, error) { + roots := make([][32]byte, len(depositRequests)) + for i := 0; i < len(depositRequests); i++ { + r, err := depositRequests[i].HashTreeRoot() if err != nil { return [32]byte{}, err } @@ -158,7 +158,7 @@ func DepositReceiptSliceRoot(depositReceipts []*enginev1.DepositReceipt, limit u return [32]byte{}, errors.Wrap(err, "could not compute merkleization") } bytesRootBuf := new(bytes.Buffer) - if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(depositReceipts))); err != nil { + if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(depositRequests))); err != nil { return [32]byte{}, errors.Wrap(err, "could not marshal length") } bytesRootBufRoot := make([]byte, 32) @@ -166,9 +166,9 @@ func DepositReceiptSliceRoot(depositReceipts []*enginev1.DepositReceipt, limit u return MixInLength(bytesRoot, bytesRootBufRoot), nil } -// WithdrawalRequestSliceRoot computes the HTR of a slice of withdrawal requests from the EL. +// WithdrawalRequestsSliceRoot computes the HTR of a slice of withdrawal requests from the EL. // The limit parameter is used as input to the bitwise merkleization algorithm. -func WithdrawalRequestSliceRoot(withdrawalRequests []*enginev1.ExecutionLayerWithdrawalRequest, limit uint64) ([32]byte, error) { +func WithdrawalRequestsSliceRoot(withdrawalRequests []*enginev1.WithdrawalRequest, limit uint64) ([32]byte, error) { roots := make([][32]byte, len(withdrawalRequests)) for i := 0; i < len(withdrawalRequests); i++ { r, err := withdrawalRequests[i].HashTreeRoot() diff --git a/encoding/ssz/htrutils_test.go b/encoding/ssz/htrutils_test.go index 50717fa8afcf..213c7847dac9 100644 --- a/encoding/ssz/htrutils_test.go +++ b/encoding/ssz/htrutils_test.go @@ -281,21 +281,21 @@ func TestWithrawalSliceRoot(t *testing.T) { } } -func TestDepositReceiptSliceRoot(t *testing.T) { +func TestDepositRequestsSliceRoot(t *testing.T) { tests := []struct { name string - input []*enginev1.DepositReceipt + input []*enginev1.DepositRequest limit uint64 want [32]byte }{ { name: "empty", - input: make([]*enginev1.DepositReceipt, 0), + input: make([]*enginev1.DepositRequest, 0), want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b}, }, { name: "non-empty", - input: []*enginev1.DepositReceipt{ + input: []*enginev1.DepositRequest{ { Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48), WithdrawalCredentials: bytesutil.PadTo([]byte{0x03, 0x04}, 32), @@ -311,7 +311,7 @@ func TestDepositReceiptSliceRoot(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := ssz.DepositReceiptSliceRoot(tt.input, tt.limit) + got, err := ssz.DepositRequestsSliceRoot(tt.input, tt.limit) require.NoError(t, err) require.DeepSSZEqual(t, tt.want, got) }) @@ -321,18 +321,18 @@ func TestDepositReceiptSliceRoot(t *testing.T) { func TestWithdrawalRequestSliceRoot(t *testing.T) { tests := []struct { name string - input []*enginev1.ExecutionLayerWithdrawalRequest + input []*enginev1.WithdrawalRequest limit uint64 want [32]byte }{ { name: "empty", - input: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0), + input: make([]*enginev1.WithdrawalRequest, 0), want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b}, }, { name: "non-empty", - input: []*enginev1.ExecutionLayerWithdrawalRequest{ + input: []*enginev1.WithdrawalRequest{ { SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20), ValidatorPubkey: bytesutil.PadTo([]byte{0x03, 0x04}, 48), @@ -346,7 +346,7 @@ func TestWithdrawalRequestSliceRoot(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := ssz.WithdrawalRequestSliceRoot(tt.input, tt.limit) + got, err := ssz.WithdrawalRequestsSliceRoot(tt.input, tt.limit) require.NoError(t, err) require.DeepSSZEqual(t, tt.want, got) }) diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index b9ed255a5243..7a3b428d0747 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -46,8 +46,8 @@ ssz_gen_marshal( "BlindedBlobsBundle", "BlobsBundle", "Withdrawal", - "ExecutionLayerWithdrawalRequest", - "DepositReceipt", + "WithdrawalRequest", + "DepositRequest", ], ) diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index 3bf7788d62e5..a24562c03984 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -571,25 +571,25 @@ type ExecutionPayloadElectra struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` - FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` - ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` - LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` - PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` - BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` - BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` - Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` - BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` - ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - DepositReceipts []*DepositReceipt `protobuf:"bytes,18,rep,name=deposit_receipts,json=depositReceipts,proto3" json:"deposit_receipts,omitempty" ssz-max:"8192"` - WithdrawalRequests []*ExecutionLayerWithdrawalRequest `protobuf:"bytes,19,rep,name=withdrawal_requests,json=withdrawalRequests,proto3" json:"withdrawal_requests,omitempty" ssz-max:"16"` + ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` + FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` + StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` + LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` + PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` + BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` + BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` + Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` + Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` + BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` + ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` + DepositRequests []*DepositRequest `protobuf:"bytes,18,rep,name=deposit_requests,json=depositRequests,proto3" json:"deposit_requests,omitempty" ssz-max:"8192"` + WithdrawalRequests []*WithdrawalRequest `protobuf:"bytes,19,rep,name=withdrawal_requests,json=withdrawalRequests,proto3" json:"withdrawal_requests,omitempty" ssz-max:"16"` } func (x *ExecutionPayloadElectra) Reset() { @@ -743,14 +743,14 @@ func (x *ExecutionPayloadElectra) GetExcessBlobGas() uint64 { return 0 } -func (x *ExecutionPayloadElectra) GetDepositReceipts() []*DepositReceipt { +func (x *ExecutionPayloadElectra) GetDepositRequests() []*DepositRequest { if x != nil { - return x.DepositReceipts + return x.DepositRequests } return nil } -func (x *ExecutionPayloadElectra) GetWithdrawalRequests() []*ExecutionLayerWithdrawalRequest { +func (x *ExecutionPayloadElectra) GetWithdrawalRequests() []*WithdrawalRequest { if x != nil { return x.WithdrawalRequests } @@ -1461,7 +1461,7 @@ type ExecutionPayloadHeaderElectra struct { WithdrawalsRoot []byte `protobuf:"bytes,15,opt,name=withdrawals_root,json=withdrawalsRoot,proto3" json:"withdrawals_root,omitempty" ssz-size:"32"` BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - DepositReceiptsRoot []byte `protobuf:"bytes,18,opt,name=deposit_receipts_root,json=depositReceiptsRoot,proto3" json:"deposit_receipts_root,omitempty" ssz-size:"32"` + DepositRequestsRoot []byte `protobuf:"bytes,18,opt,name=deposit_requests_root,json=depositRequestsRoot,proto3" json:"deposit_requests_root,omitempty" ssz-size:"32"` WithdrawalRequestsRoot []byte `protobuf:"bytes,19,opt,name=withdrawal_requests_root,json=withdrawalRequestsRoot,proto3" json:"withdrawal_requests_root,omitempty" ssz-size:"32"` } @@ -1616,9 +1616,9 @@ func (x *ExecutionPayloadHeaderElectra) GetExcessBlobGas() uint64 { return 0 } -func (x *ExecutionPayloadHeaderElectra) GetDepositReceiptsRoot() []byte { +func (x *ExecutionPayloadHeaderElectra) GetDepositRequestsRoot() []byte { if x != nil { - return x.DepositReceiptsRoot + return x.DepositRequestsRoot } return nil } @@ -2197,7 +2197,7 @@ func (x *ExchangeCapabilities) GetSupportedMethods() []string { return nil } -type ExecutionLayerWithdrawalRequest struct { +type WithdrawalRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2207,8 +2207,8 @@ type ExecutionLayerWithdrawalRequest struct { Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` } -func (x *ExecutionLayerWithdrawalRequest) Reset() { - *x = ExecutionLayerWithdrawalRequest{} +func (x *WithdrawalRequest) Reset() { + *x = WithdrawalRequest{} if protoimpl.UnsafeEnabled { mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2216,13 +2216,13 @@ func (x *ExecutionLayerWithdrawalRequest) Reset() { } } -func (x *ExecutionLayerWithdrawalRequest) String() string { +func (x *WithdrawalRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExecutionLayerWithdrawalRequest) ProtoMessage() {} +func (*WithdrawalRequest) ProtoMessage() {} -func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { +func (x *WithdrawalRequest) ProtoReflect() protoreflect.Message { mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2234,33 +2234,33 @@ func (x *ExecutionLayerWithdrawalRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExecutionLayerWithdrawalRequest.ProtoReflect.Descriptor instead. -func (*ExecutionLayerWithdrawalRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use WithdrawalRequest.ProtoReflect.Descriptor instead. +func (*WithdrawalRequest) Descriptor() ([]byte, []int) { return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} } -func (x *ExecutionLayerWithdrawalRequest) GetSourceAddress() []byte { +func (x *WithdrawalRequest) GetSourceAddress() []byte { if x != nil { return x.SourceAddress } return nil } -func (x *ExecutionLayerWithdrawalRequest) GetValidatorPubkey() []byte { +func (x *WithdrawalRequest) GetValidatorPubkey() []byte { if x != nil { return x.ValidatorPubkey } return nil } -func (x *ExecutionLayerWithdrawalRequest) GetAmount() uint64 { +func (x *WithdrawalRequest) GetAmount() uint64 { if x != nil { return x.Amount } return 0 } -type DepositReceipt struct { +type DepositRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2272,8 +2272,8 @@ type DepositReceipt struct { Index uint64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` } -func (x *DepositReceipt) Reset() { - *x = DepositReceipt{} +func (x *DepositRequest) Reset() { + *x = DepositRequest{} if protoimpl.UnsafeEnabled { mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2281,13 +2281,13 @@ func (x *DepositReceipt) Reset() { } } -func (x *DepositReceipt) String() string { +func (x *DepositRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DepositReceipt) ProtoMessage() {} +func (*DepositRequest) ProtoMessage() {} -func (x *DepositReceipt) ProtoReflect() protoreflect.Message { +func (x *DepositRequest) ProtoReflect() protoreflect.Message { mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2299,40 +2299,40 @@ func (x *DepositReceipt) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DepositReceipt.ProtoReflect.Descriptor instead. -func (*DepositReceipt) Descriptor() ([]byte, []int) { +// Deprecated: Use DepositRequest.ProtoReflect.Descriptor instead. +func (*DepositRequest) Descriptor() ([]byte, []int) { return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} } -func (x *DepositReceipt) GetPubkey() []byte { +func (x *DepositRequest) GetPubkey() []byte { if x != nil { return x.Pubkey } return nil } -func (x *DepositReceipt) GetWithdrawalCredentials() []byte { +func (x *DepositRequest) GetWithdrawalCredentials() []byte { if x != nil { return x.WithdrawalCredentials } return nil } -func (x *DepositReceipt) GetAmount() uint64 { +func (x *DepositRequest) GetAmount() uint64 { if x != nil { return x.Amount } return 0 } -func (x *DepositReceipt) GetSignature() []byte { +func (x *DepositRequest) GetSignature() []byte { if x != nil { return x.Signature } return nil } -func (x *DepositReceipt) GetIndex() uint64 { +func (x *DepositRequest) GetIndex() uint64 { if x != nil { return x.Index } @@ -2472,7 +2472,7 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0xac, 0x07, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x9e, 0x07, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, @@ -2519,62 +2519,182 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x57, - 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x42, 0x08, 0x92, 0xb5, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x13, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x13, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x13, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, - 0x36, 0x52, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x89, 0x02, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, - 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, - 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x89, 0x02, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, + 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, - 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, - 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, - 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x57, 0x69, 0x74, 0x68, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, + 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, + 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, + 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x57, 0x69, + 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, + 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x57, 0x69, + 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x57, 0x69, 0x74, 0x68, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, - 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, - 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, + 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, + 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, 0x04, 0x0a, + 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, + 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, + 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, + 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, + 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, + 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, + 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, + 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, + 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, + 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, + 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, + 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, 0x05, 0x0a, + 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, 0x0a, 0x0b, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, + 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, + 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, + 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, + 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, + 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, + 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, + 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, + 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, + 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, + 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, + 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, + 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, + 0x47, 0x61, 0x73, 0x22, 0xc4, 0x06, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, @@ -2608,278 +2728,156 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xfa, 0x04, - 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, - 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, - 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, - 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, - 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, - 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, 0x05, 0x0a, 0x1b, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, - 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, - 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, - 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, - 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, - 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, - 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, - 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, - 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, - 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, - 0x73, 0x22, 0xc4, 0x06, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, - 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, - 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, - 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, - 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, - 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, - 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, - 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, - 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, - 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, 0x0a, 0x15, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, - 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, - 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, - 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, - 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xa7, - 0x02, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, - 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, - 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, - 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x11, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, 0x06, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, - 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, - 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, - 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, - 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, 0xab, 0x01, - 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0a, - 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, + 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, + 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, + 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, 0x0a, 0x15, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, + 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, + 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, + 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, + 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, + 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, + 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, + 0x22, 0xa7, 0x02, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, + 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, + 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, + 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, + 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, + 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, + 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, + 0xab, 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, + 0x0a, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, + 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, + 0x36, 0x52, 0x0e, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, + 0x30, 0x39, 0x36, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, + 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, + 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, + 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x43, 0x0a, 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, + 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, - 0x0e, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x28, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, - 0x36, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, - 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, - 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, - 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, - 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, - 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x1f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x4c, 0x61, 0x79, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, - 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, - 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, - 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2918,15 +2916,15 @@ var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ (*BlobsBundle)(nil), // 18: ethereum.engine.v1.BlobsBundle (*Blob)(nil), // 19: ethereum.engine.v1.Blob (*ExchangeCapabilities)(nil), // 20: ethereum.engine.v1.ExchangeCapabilities - (*ExecutionLayerWithdrawalRequest)(nil), // 21: ethereum.engine.v1.ExecutionLayerWithdrawalRequest - (*DepositReceipt)(nil), // 22: ethereum.engine.v1.DepositReceipt + (*WithdrawalRequest)(nil), // 21: ethereum.engine.v1.WithdrawalRequest + (*DepositRequest)(nil), // 22: ethereum.engine.v1.DepositRequest } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ 17, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal 17, // 1: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal 17, // 2: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 22, // 3: ethereum.engine.v1.ExecutionPayloadElectra.deposit_receipts:type_name -> ethereum.engine.v1.DepositReceipt - 21, // 4: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.ExecutionLayerWithdrawalRequest + 22, // 3: ethereum.engine.v1.ExecutionPayloadElectra.deposit_requests:type_name -> ethereum.engine.v1.DepositRequest + 21, // 4: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.WithdrawalRequest 4, // 5: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra 18, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle 2, // 7: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella @@ -3189,7 +3187,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionLayerWithdrawalRequest); i { + switch v := v.(*WithdrawalRequest); i { case 0: return &v.state case 1: @@ -3201,7 +3199,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DepositReceipt); i { + switch v := v.(*DepositRequest); i { case 0: return &v.state case 1: diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index a6686a326495..7f56b8ea0aaf 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -100,8 +100,8 @@ message ExecutionPayloadElectra { repeated Withdrawal withdrawals = 15 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"]; uint64 blob_gas_used = 16; uint64 excess_blob_gas = 17; - repeated DepositReceipt deposit_receipts = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_receipts"]; // new in electra, eip6110 - repeated ExecutionLayerWithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251 + repeated DepositRequest deposit_requests = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_requests_per_payload.size"]; // new in electra, eip6110 + repeated WithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251 } message ExecutionPayloadElectraWithValueAndBlobsBundle { @@ -197,7 +197,7 @@ message ExecutionPayloadHeaderElectra { bytes withdrawals_root = 15 [(ethereum.eth.ext.ssz_size) = "32"]; uint64 blob_gas_used = 16; uint64 excess_blob_gas = 17; - bytes deposit_receipts_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110 + bytes deposit_requests_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110 bytes withdrawal_requests_root = 19 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7002, eip7251 } @@ -280,9 +280,9 @@ message ExchangeCapabilities { repeated string supported_methods = 1; } -// ExecutionLayerWithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address +// WithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address // new in Electra -message ExecutionLayerWithdrawalRequest { +message WithdrawalRequest { // The execution address receiving the funds bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; @@ -293,9 +293,9 @@ message ExecutionLayerWithdrawalRequest { uint64 amount = 3; } -// DepositReceipt is the message from the execution layer to trigger the deposit of a validator's balance to its balance +// DepositRequest is the message from the execution layer to trigger the deposit of a validator's balance to its balance // new in Electra -message DepositReceipt { +message DepositRequest { bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"]; bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"]; uint64 amount = 3; diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index 05d41cc36251..5cc66b88da2b 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 5e73dfd1d7df4fb984d773b9aa92658a1bc4db66b0e050f9b869a470e61416d3 +// Hash: fead48d52c26c5db4af980b0552c414ffc58387819201e533a44a3e8f4dde5df package enginev1 import ( @@ -1413,9 +1413,9 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro // Field (16) 'ExcessBlobGas' dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) - // Offset (17) 'DepositReceipts' + // Offset (17) 'DepositRequests' dst = ssz.WriteOffset(dst, offset) - offset += len(e.DepositReceipts) * 192 + offset += len(e.DepositRequests) * 192 // Offset (18) 'WithdrawalRequests' dst = ssz.WriteOffset(dst, offset) @@ -1459,13 +1459,13 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro } } - // Field (17) 'DepositReceipts' - if size := len(e.DepositReceipts); size > 8192 { - err = ssz.ErrListTooBigFn("--.DepositReceipts", size, 8192) + // Field (17) 'DepositRequests' + if size := len(e.DepositRequests); size > 8192 { + err = ssz.ErrListTooBigFn("--.DepositRequests", size, 8192) return } - for ii := 0; ii < len(e.DepositReceipts); ii++ { - if dst, err = e.DepositReceipts[ii].MarshalSSZTo(dst); err != nil { + for ii := 0; ii < len(e.DepositRequests); ii++ { + if dst, err = e.DepositRequests[ii].MarshalSSZTo(dst); err != nil { return } } @@ -1580,7 +1580,7 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { // Field (16) 'ExcessBlobGas' e.ExcessBlobGas = ssz.UnmarshallUint64(buf[520:528]) - // Offset (17) 'DepositReceipts' + // Offset (17) 'DepositRequests' if o17 = ssz.ReadOffset(buf[528:532]); o17 > size || o14 > o17 { return ssz.ErrOffset } @@ -1643,19 +1643,19 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { } } - // Field (17) 'DepositReceipts' + // Field (17) 'DepositRequests' { buf = tail[o17:o18] num, err := ssz.DivideInt2(len(buf), 192, 8192) if err != nil { return err } - e.DepositReceipts = make([]*DepositReceipt, num) + e.DepositRequests = make([]*DepositRequest, num) for ii := 0; ii < num; ii++ { - if e.DepositReceipts[ii] == nil { - e.DepositReceipts[ii] = new(DepositReceipt) + if e.DepositRequests[ii] == nil { + e.DepositRequests[ii] = new(DepositRequest) } - if err = e.DepositReceipts[ii].UnmarshalSSZ(buf[ii*192 : (ii+1)*192]); err != nil { + if err = e.DepositRequests[ii].UnmarshalSSZ(buf[ii*192 : (ii+1)*192]); err != nil { return err } } @@ -1668,10 +1668,10 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { if err != nil { return err } - e.WithdrawalRequests = make([]*ExecutionLayerWithdrawalRequest, num) + e.WithdrawalRequests = make([]*WithdrawalRequest, num) for ii := 0; ii < num; ii++ { if e.WithdrawalRequests[ii] == nil { - e.WithdrawalRequests[ii] = new(ExecutionLayerWithdrawalRequest) + e.WithdrawalRequests[ii] = new(WithdrawalRequest) } if err = e.WithdrawalRequests[ii].UnmarshalSSZ(buf[ii*76 : (ii+1)*76]); err != nil { return err @@ -1697,8 +1697,8 @@ func (e *ExecutionPayloadElectra) SizeSSZ() (size int) { // Field (14) 'Withdrawals' size += len(e.Withdrawals) * 44 - // Field (17) 'DepositReceipts' - size += len(e.DepositReceipts) * 192 + // Field (17) 'DepositRequests' + size += len(e.DepositRequests) * 192 // Field (18) 'WithdrawalRequests' size += len(e.WithdrawalRequests) * 76 @@ -1856,15 +1856,15 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (16) 'ExcessBlobGas' hh.PutUint64(e.ExcessBlobGas) - // Field (17) 'DepositReceipts' + // Field (17) 'DepositRequests' { subIndx := hh.Index() - num := uint64(len(e.DepositReceipts)) + num := uint64(len(e.DepositRequests)) if num > 8192 { err = ssz.ErrIncorrectListSize return } - for _, elem := range e.DepositReceipts { + for _, elem := range e.DepositRequests { if err = elem.HashTreeRootWith(hh); err != nil { return } @@ -3015,12 +3015,12 @@ func (e *ExecutionPayloadHeaderElectra) MarshalSSZTo(buf []byte) (dst []byte, er // Field (16) 'ExcessBlobGas' dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) - // Field (17) 'DepositReceiptsRoot' - if size := len(e.DepositReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositReceiptsRoot", size, 32) + // Field (17) 'DepositRequestsRoot' + if size := len(e.DepositRequestsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRequestsRoot", size, 32) return } - dst = append(dst, e.DepositReceiptsRoot...) + dst = append(dst, e.DepositRequestsRoot...) // Field (18) 'WithdrawalRequestsRoot' if size := len(e.WithdrawalRequestsRoot); size != 32 { @@ -3137,11 +3137,11 @@ func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { // Field (16) 'ExcessBlobGas' e.ExcessBlobGas = ssz.UnmarshallUint64(buf[576:584]) - // Field (17) 'DepositReceiptsRoot' - if cap(e.DepositReceiptsRoot) == 0 { - e.DepositReceiptsRoot = make([]byte, 0, len(buf[584:616])) + // Field (17) 'DepositRequestsRoot' + if cap(e.DepositRequestsRoot) == 0 { + e.DepositRequestsRoot = make([]byte, 0, len(buf[584:616])) } - e.DepositReceiptsRoot = append(e.DepositReceiptsRoot, buf[584:616]...) + e.DepositRequestsRoot = append(e.DepositRequestsRoot, buf[584:616]...) // Field (18) 'WithdrawalRequestsRoot' if cap(e.WithdrawalRequestsRoot) == 0 { @@ -3286,12 +3286,12 @@ func (e *ExecutionPayloadHeaderElectra) HashTreeRootWith(hh *ssz.Hasher) (err er // Field (16) 'ExcessBlobGas' hh.PutUint64(e.ExcessBlobGas) - // Field (17) 'DepositReceiptsRoot' - if size := len(e.DepositReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositReceiptsRoot", size, 32) + // Field (17) 'DepositRequestsRoot' + if size := len(e.DepositRequestsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRequestsRoot", size, 32) return } - hh.PutBytes(e.DepositReceiptsRoot) + hh.PutBytes(e.DepositRequestsRoot) // Field (18) 'WithdrawalRequestsRoot' if size := len(e.WithdrawalRequestsRoot); size != 32 { @@ -3647,37 +3647,37 @@ func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the ExecutionLayerWithdrawalRequest object -func (e *ExecutionLayerWithdrawalRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) +// MarshalSSZ ssz marshals the WithdrawalRequest object +func (w *WithdrawalRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(w) } -// MarshalSSZTo ssz marshals the ExecutionLayerWithdrawalRequest object to a target array -func (e *ExecutionLayerWithdrawalRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the WithdrawalRequest object to a target array +func (w *WithdrawalRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'SourceAddress' - if size := len(e.SourceAddress); size != 20 { + if size := len(w.SourceAddress); size != 20 { err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) return } - dst = append(dst, e.SourceAddress...) + dst = append(dst, w.SourceAddress...) // Field (1) 'ValidatorPubkey' - if size := len(e.ValidatorPubkey); size != 48 { + if size := len(w.ValidatorPubkey); size != 48 { err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) return } - dst = append(dst, e.ValidatorPubkey...) + dst = append(dst, w.ValidatorPubkey...) // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, e.Amount) + dst = ssz.MarshalUint64(dst, w.Amount) return } -// UnmarshalSSZ ssz unmarshals the ExecutionLayerWithdrawalRequest object -func (e *ExecutionLayerWithdrawalRequest) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the WithdrawalRequest object +func (w *WithdrawalRequest) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size != 76 { @@ -3685,54 +3685,54 @@ func (e *ExecutionLayerWithdrawalRequest) UnmarshalSSZ(buf []byte) error { } // Field (0) 'SourceAddress' - if cap(e.SourceAddress) == 0 { - e.SourceAddress = make([]byte, 0, len(buf[0:20])) + if cap(w.SourceAddress) == 0 { + w.SourceAddress = make([]byte, 0, len(buf[0:20])) } - e.SourceAddress = append(e.SourceAddress, buf[0:20]...) + w.SourceAddress = append(w.SourceAddress, buf[0:20]...) // Field (1) 'ValidatorPubkey' - if cap(e.ValidatorPubkey) == 0 { - e.ValidatorPubkey = make([]byte, 0, len(buf[20:68])) + if cap(w.ValidatorPubkey) == 0 { + w.ValidatorPubkey = make([]byte, 0, len(buf[20:68])) } - e.ValidatorPubkey = append(e.ValidatorPubkey, buf[20:68]...) + w.ValidatorPubkey = append(w.ValidatorPubkey, buf[20:68]...) // Field (2) 'Amount' - e.Amount = ssz.UnmarshallUint64(buf[68:76]) + w.Amount = ssz.UnmarshallUint64(buf[68:76]) return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionLayerWithdrawalRequest object -func (e *ExecutionLayerWithdrawalRequest) SizeSSZ() (size int) { +// SizeSSZ returns the ssz encoded size in bytes for the WithdrawalRequest object +func (w *WithdrawalRequest) SizeSSZ() (size int) { size = 76 return } -// HashTreeRoot ssz hashes the ExecutionLayerWithdrawalRequest object -func (e *ExecutionLayerWithdrawalRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) +// HashTreeRoot ssz hashes the WithdrawalRequest object +func (w *WithdrawalRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(w) } -// HashTreeRootWith ssz hashes the ExecutionLayerWithdrawalRequest object with a hasher -func (e *ExecutionLayerWithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the WithdrawalRequest object with a hasher +func (w *WithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'SourceAddress' - if size := len(e.SourceAddress); size != 20 { + if size := len(w.SourceAddress); size != 20 { err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) return } - hh.PutBytes(e.SourceAddress) + hh.PutBytes(w.SourceAddress) // Field (1) 'ValidatorPubkey' - if size := len(e.ValidatorPubkey); size != 48 { + if size := len(w.ValidatorPubkey); size != 48 { err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) return } - hh.PutBytes(e.ValidatorPubkey) + hh.PutBytes(w.ValidatorPubkey) // Field (2) 'Amount' - hh.PutUint64(e.Amount) + hh.PutUint64(w.Amount) if ssz.EnableVectorizedHTR { hh.MerkleizeVectorizedHTR(indx) @@ -3742,13 +3742,13 @@ func (e *ExecutionLayerWithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err return } -// MarshalSSZ ssz marshals the DepositReceipt object -func (d *DepositReceipt) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the DepositRequest object +func (d *DepositRequest) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(d) } -// MarshalSSZTo ssz marshals the DepositReceipt object to a target array -func (d *DepositReceipt) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the DepositRequest object to a target array +func (d *DepositRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Pubkey' @@ -3781,8 +3781,8 @@ func (d *DepositReceipt) MarshalSSZTo(buf []byte) (dst []byte, err error) { return } -// UnmarshalSSZ ssz unmarshals the DepositReceipt object -func (d *DepositReceipt) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the DepositRequest object +func (d *DepositRequest) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size != 192 { @@ -3816,19 +3816,19 @@ func (d *DepositReceipt) UnmarshalSSZ(buf []byte) error { return err } -// SizeSSZ returns the ssz encoded size in bytes for the DepositReceipt object -func (d *DepositReceipt) SizeSSZ() (size int) { +// SizeSSZ returns the ssz encoded size in bytes for the DepositRequest object +func (d *DepositRequest) SizeSSZ() (size int) { size = 192 return } -// HashTreeRoot ssz hashes the DepositReceipt object -func (d *DepositReceipt) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the DepositRequest object +func (d *DepositRequest) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(d) } -// HashTreeRootWith ssz hashes the DepositReceipt object with a hasher -func (d *DepositReceipt) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the DepositRequest object with a hasher +func (d *DepositRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Pubkey' diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index cbaac71f2be6..61466a7d7ca5 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -417,7 +417,7 @@ type ExecutionPayloadDenebJSON struct { // https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#withdrawalrequestv1 type WithdrawalRequestV1 struct { SourceAddress *common.Address `json:"sourceAddress"` - ValidatorPubkey *BlsPubkey `json:"validatorPublicKey"` + ValidatorPubkey *BlsPubkey `json:"validatorPubkey"` Amount *hexutil.Uint64 `json:"amount"` } @@ -426,7 +426,7 @@ func (r WithdrawalRequestV1) Validate() error { return errors.Wrap(errJsonNilField, "missing required field 'sourceAddress' for WithdrawalRequestV1") } if r.ValidatorPubkey == nil { - return errors.Wrap(errJsonNilField, "missing required field 'validatorPublicKey' for WithdrawalRequestV1") + return errors.Wrap(errJsonNilField, "missing required field 'validatorPubkey' for WithdrawalRequestV1") } if r.Amount == nil { return errors.Wrap(errJsonNilField, "missing required field 'amount' for WithdrawalRequestV1") @@ -984,19 +984,19 @@ func (e *ExecutionPayloadElectra) MarshalJSON() ([]byte, error) { BlobGasUsed: &blobGasUsed, ExcessBlobGas: &excessBlobGas, WithdrawalRequests: ProtoWithdrawalRequestsToJson(e.WithdrawalRequests), - DepositRequests: ProtoDepositRequestsToJson(e.DepositReceipts), + DepositRequests: ProtoDepositRequestsToJson(e.DepositRequests), }) } -func JsonDepositRequestsToProto(j []DepositRequestV1) ([]*DepositReceipt, error) { - reqs := make([]*DepositReceipt, len(j)) +func JsonDepositRequestsToProto(j []DepositRequestV1) ([]*DepositRequest, error) { + reqs := make([]*DepositRequest, len(j)) for i := range j { req := j[i] if err := req.Validate(); err != nil { return nil, err } - reqs[i] = &DepositReceipt{ + reqs[i] = &DepositRequest{ Pubkey: req.PubKey.Bytes(), WithdrawalCredentials: req.WithdrawalCredentials.Bytes(), Amount: uint64(*req.Amount), @@ -1008,7 +1008,7 @@ func JsonDepositRequestsToProto(j []DepositRequestV1) ([]*DepositReceipt, error) return reqs, nil } -func ProtoDepositRequestsToJson(reqs []*DepositReceipt) []DepositRequestV1 { +func ProtoDepositRequestsToJson(reqs []*DepositRequest) []DepositRequestV1 { j := make([]DepositRequestV1, len(reqs)) for i := range reqs { r := reqs[i] @@ -1030,15 +1030,15 @@ func ProtoDepositRequestsToJson(reqs []*DepositReceipt) []DepositRequestV1 { return j } -func JsonWithdrawalRequestsToProto(j []WithdrawalRequestV1) ([]*ExecutionLayerWithdrawalRequest, error) { - reqs := make([]*ExecutionLayerWithdrawalRequest, len(j)) +func JsonWithdrawalRequestsToProto(j []WithdrawalRequestV1) ([]*WithdrawalRequest, error) { + reqs := make([]*WithdrawalRequest, len(j)) for i := range j { req := j[i] if err := req.Validate(); err != nil { return nil, err } - reqs[i] = &ExecutionLayerWithdrawalRequest{ + reqs[i] = &WithdrawalRequest{ SourceAddress: req.SourceAddress.Bytes(), ValidatorPubkey: req.ValidatorPubkey.Bytes(), Amount: uint64(*req.Amount), @@ -1048,7 +1048,7 @@ func JsonWithdrawalRequestsToProto(j []WithdrawalRequestV1) ([]*ExecutionLayerWi return reqs, nil } -func ProtoWithdrawalRequestsToJson(reqs []*ExecutionLayerWithdrawalRequest) []WithdrawalRequestV1 { +func ProtoWithdrawalRequestsToJson(reqs []*WithdrawalRequest) []WithdrawalRequestV1 { j := make([]WithdrawalRequestV1, len(reqs)) for i := range reqs { r := reqs[i] @@ -1105,7 +1105,7 @@ func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra Withdrawals: j.Withdrawals, BlobGasUsed: uint64(*j.BlobGasUsed), ExcessBlobGas: uint64(*j.ExcessBlobGas), - DepositReceipts: dr, + DepositRequests: dr, WithdrawalRequests: wr, }, nil } diff --git a/proto/engine/v1/json_marshal_unmarshal_test.go b/proto/engine/v1/json_marshal_unmarshal_test.go index 7aed00f1b7a9..f7aaf66d2161 100644 --- a/proto/engine/v1/json_marshal_unmarshal_test.go +++ b/proto/engine/v1/json_marshal_unmarshal_test.go @@ -289,7 +289,7 @@ func TestJsonMarshalUnmarshal(t *testing.T) { bgu := hexutil.Uint64(5) ebg := hexutil.Uint64(6) - withdrawalReq := []*enginev1.ExecutionLayerWithdrawalRequest{ + withdrawalReq := []*enginev1.WithdrawalRequest{ { SourceAddress: bytesutil.PadTo([]byte("sourceAddress-1"), 20), ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-1"), 48), @@ -306,7 +306,7 @@ func TestJsonMarshalUnmarshal(t *testing.T) { Amount: 3, }, } - depositReq := []*enginev1.DepositReceipt{ + depositReq := []*enginev1.DepositRequest{ { Pubkey: bytesutil.PadTo([]byte("pubKey-1"), 48), WithdrawalCredentials: bytesutil.PadTo([]byte("creds-1"), 32), @@ -410,9 +410,9 @@ func TestJsonMarshalUnmarshal(t *testing.T) { for i := range pb.Payload.WithdrawalRequests { require.DeepEqual(t, pb.Payload.WithdrawalRequests[i], withdrawalReq[i]) } - require.Equal(t, len(pb.Payload.DepositReceipts), len(depositReq)) - for i := range pb.Payload.DepositReceipts { - require.DeepEqual(t, pb.Payload.DepositReceipts[i], depositReq[i]) + require.Equal(t, len(pb.Payload.DepositRequests), len(depositReq)) + for i := range pb.Payload.DepositRequests { + require.DeepEqual(t, pb.Payload.DepositRequests[i], depositReq[i]) } }) t.Run("execution block", func(t *testing.T) { diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index 01daabe6c0ab..382eee9836b5 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 2874e1dadeb47411763f48fe31e5daaa91ac663e796933d9a508c2e7be94fa5e +// Hash: d06a72227c2f5e350916cce3e89f4e855135a2a22f6ea263dedc68fa506c1ba7 package v1 import ( diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index 29dcf6d09da2..b39ba7517120 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 2755944d1f9b0e6e8b7e58d3cbba1d6028bbbb740ec05f5de43137d5b5459411 +// Hash: 0394f3a965a034ef0de1398e168f3971f32a9ccce9db6549dd6e6d258c11c89b package eth import ( diff --git a/proto/prysm/v1alpha1/beacon_state.pb.go b/proto/prysm/v1alpha1/beacon_state.pb.go index 8a01977e8ee7..ef5a38848e47 100755 --- a/proto/prysm/v1alpha1/beacon_state.pb.go +++ b/proto/prysm/v1alpha1/beacon_state.pb.go @@ -1867,7 +1867,7 @@ type BeaconStateElectra struct { NextWithdrawalIndex uint64 `protobuf:"varint,11001,opt,name=next_withdrawal_index,json=nextWithdrawalIndex,proto3" json:"next_withdrawal_index,omitempty"` NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` - DepositReceiptsStartIndex uint64 `protobuf:"varint,12001,opt,name=deposit_receipts_start_index,json=depositReceiptsStartIndex,proto3" json:"deposit_receipts_start_index,omitempty"` + DepositRequestsStartIndex uint64 `protobuf:"varint,12001,opt,name=deposit_requests_start_index,json=depositRequestsStartIndex,proto3" json:"deposit_requests_start_index,omitempty"` DepositBalanceToConsume github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei `protobuf:"varint,12002,opt,name=deposit_balance_to_consume,json=depositBalanceToConsume,proto3" json:"deposit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"` ExitBalanceToConsume github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei `protobuf:"varint,12003,opt,name=exit_balance_to_consume,json=exitBalanceToConsume,proto3" json:"exit_balance_to_consume,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"` EarliestExitEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,12004,opt,name=earliest_exit_epoch,json=earliestExitEpoch,proto3" json:"earliest_exit_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` @@ -2106,9 +2106,9 @@ func (x *BeaconStateElectra) GetHistoricalSummaries() []*HistoricalSummary { return nil } -func (x *BeaconStateElectra) GetDepositReceiptsStartIndex() uint64 { +func (x *BeaconStateElectra) GetDepositRequestsStartIndex() uint64 { if x != nil { - return x.DepositReceiptsStartIndex + return x.DepositRequestsStartIndex } return 0 } @@ -3147,10 +3147,10 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index dd38eebd201a..8206df1d4ba7 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -396,7 +396,7 @@ message BeaconStateElectra { repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"]; // Fields introduced in EIP-7251 fork [12001-13000] - uint64 deposit_receipts_start_index = 12001; + uint64 deposit_requests_start_index = 12001; uint64 deposit_balance_to_consume = 12002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"]; uint64 exit_balance_to_consume = 12003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Gwei"]; uint64 earliest_exit_epoch = 12004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index e67abbd566c2..7b736bab40c9 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -1046,19 +1046,19 @@ func CopyExecutionPayloadElectra(payload *enginev1.ExecutionPayloadElectra) *eng Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), BlobGasUsed: payload.BlobGasUsed, ExcessBlobGas: payload.ExcessBlobGas, - DepositReceipts: CopyDepositReceipts(payload.DepositReceipts), + DepositRequests: CopyDepositRequests(payload.DepositRequests), WithdrawalRequests: CopyWithdrawalRequests(payload.WithdrawalRequests), } } -func CopyDepositReceipts(dr []*enginev1.DepositReceipt) []*enginev1.DepositReceipt { +func CopyDepositRequests(dr []*enginev1.DepositRequest) []*enginev1.DepositRequest { if dr == nil { return nil } - newDr := make([]*enginev1.DepositReceipt, len(dr)) + newDr := make([]*enginev1.DepositRequest, len(dr)) for i, d := range dr { - newDr[i] = &enginev1.DepositReceipt{ + newDr[i] = &enginev1.DepositRequest{ Pubkey: bytesutil.SafeCopyBytes(d.Pubkey), WithdrawalCredentials: bytesutil.SafeCopyBytes(d.WithdrawalCredentials), Amount: d.Amount, @@ -1069,13 +1069,13 @@ func CopyDepositReceipts(dr []*enginev1.DepositReceipt) []*enginev1.DepositRecei return newDr } -func CopyWithdrawalRequests(wr []*enginev1.ExecutionLayerWithdrawalRequest) []*enginev1.ExecutionLayerWithdrawalRequest { +func CopyWithdrawalRequests(wr []*enginev1.WithdrawalRequest) []*enginev1.WithdrawalRequest { if wr == nil { return nil } - newWr := make([]*enginev1.ExecutionLayerWithdrawalRequest, len(wr)) + newWr := make([]*enginev1.WithdrawalRequest, len(wr)) for i, w := range wr { - newWr[i] = &enginev1.ExecutionLayerWithdrawalRequest{ + newWr[i] = &enginev1.WithdrawalRequest{ SourceAddress: bytesutil.SafeCopyBytes(w.SourceAddress), ValidatorPubkey: bytesutil.SafeCopyBytes(w.ValidatorPubkey), Amount: w.Amount, @@ -1107,7 +1107,7 @@ func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderE WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), BlobGasUsed: payload.BlobGasUsed, ExcessBlobGas: payload.ExcessBlobGas, - DepositReceiptsRoot: bytesutil.SafeCopyBytes(payload.DepositReceiptsRoot), + DepositRequestsRoot: bytesutil.SafeCopyBytes(payload.DepositRequestsRoot), WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), } } diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index d0d5f885451c..87ecdad73f37 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -685,12 +685,12 @@ func TestCopyExecutionPayloadElectra(t *testing.T) { } } -func TestCopyDepositReceipts(t *testing.T) { - drs := genDepositReceipts(10) +func TestCopyDepositRequests(t *testing.T) { + drs := genDepositRequests(10) - got := v1alpha1.CopyDepositReceipts(drs) + got := v1alpha1.CopyDepositRequests(drs) if !reflect.DeepEqual(got, drs) { - t.Errorf("TestCopyDepositReceipts() = %v, want %v", got, drs) + t.Errorf("TestCopyDepositRequests() = %v, want %v", got, drs) } } @@ -1442,7 +1442,7 @@ func genExecutionPayloadHeaderElectra() *enginev1.ExecutionPayloadHeaderElectra WithdrawalsRoot: bytes(32), BlobGasUsed: 5, ExcessBlobGas: 6, - DepositReceiptsRoot: bytes(32), + DepositRequestsRoot: bytes(32), WithdrawalRequestsRoot: bytes(32), } } @@ -1524,21 +1524,21 @@ func genExecutionPayloadElectra() *enginev1.ExecutionPayloadElectra { Withdrawals: genWithdrawals(10), BlobGasUsed: 5, ExcessBlobGas: 6, - DepositReceipts: genDepositReceipts(10), + DepositRequests: genDepositRequests(10), WithdrawalRequests: genWithdrawalRequests(10), } } -func genDepositReceipts(num int) []*enginev1.DepositReceipt { - drs := make([]*enginev1.DepositReceipt, num) +func genDepositRequests(num int) []*enginev1.DepositRequest { + drs := make([]*enginev1.DepositRequest, num) for i := 0; i < num; i++ { - drs[i] = genDepositReceipt() + drs[i] = genDepositRequest() } return drs } -func genDepositReceipt() *enginev1.DepositReceipt { - return &enginev1.DepositReceipt{ +func genDepositRequest() *enginev1.DepositRequest { + return &enginev1.DepositRequest{ Pubkey: bytes(48), WithdrawalCredentials: bytes(32), Amount: 55555, @@ -1547,16 +1547,16 @@ func genDepositReceipt() *enginev1.DepositReceipt { } } -func genWithdrawalRequests(num int) []*enginev1.ExecutionLayerWithdrawalRequest { - wrs := make([]*enginev1.ExecutionLayerWithdrawalRequest, num) +func genWithdrawalRequests(num int) []*enginev1.WithdrawalRequest { + wrs := make([]*enginev1.WithdrawalRequest, num) for i := 0; i < num; i++ { wrs[i] = genWithdrawalRequest() } return wrs } -func genWithdrawalRequest() *enginev1.ExecutionLayerWithdrawalRequest { - return &enginev1.ExecutionLayerWithdrawalRequest{ +func genWithdrawalRequest() *enginev1.WithdrawalRequest { + return &enginev1.WithdrawalRequest{ SourceAddress: bytes(20), ValidatorPubkey: bytes(48), Amount: 55555, diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index 50b0fb52dc8a..f7836b3609b2 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 75d48d13b4efa7867468bae2df70b80e9606b9a44e621915d2093a4f20ae111f +// Hash: f1b72be7fea0fb1c1fbf8396b0e460f440ff5f7551fe46f0f9a5c7a4be634e1e package eth import ( @@ -17642,8 +17642,8 @@ func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.WriteOffset(dst, offset) offset += len(b.HistoricalSummaries) * 64 - // Field (28) 'DepositReceiptsStartIndex' - dst = ssz.MarshalUint64(dst, b.DepositReceiptsStartIndex) + // Field (28) 'DepositRequestsStartIndex' + dst = ssz.MarshalUint64(dst, b.DepositRequestsStartIndex) // Field (29) 'DepositBalanceToConsume' dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) @@ -17975,8 +17975,8 @@ func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - // Field (28) 'DepositReceiptsStartIndex' - b.DepositReceiptsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) + // Field (28) 'DepositRequestsStartIndex' + b.DepositRequestsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) // Field (29) 'DepositBalanceToConsume' b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) @@ -18563,8 +18563,8 @@ func (b *BeaconStateElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { } } - // Field (28) 'DepositReceiptsStartIndex' - hh.PutUint64(b.DepositReceiptsStartIndex) + // Field (28) 'DepositRequestsStartIndex' + hh.PutUint64(b.DepositRequestsStartIndex) // Field (29) 'DepositBalanceToConsume' hh.PutUint64(uint64(b.DepositBalanceToConsume)) diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go index caf68d3882f1..e0906f5541f3 100755 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go +++ b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go @@ -16,7 +16,6 @@ import ( v1alpha1 "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/wrapperspb" ) const ( @@ -673,9 +672,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, diff --git a/proto/ssz_proto_library.bzl b/proto/ssz_proto_library.bzl index b43fd49f616d..5024dccb6e12 100644 --- a/proto/ssz_proto_library.bzl +++ b/proto/ssz_proto_library.bzl @@ -27,7 +27,7 @@ mainnet = { "max_blob_commitments.size": "4096", "kzg_commitment_inclusion_proof_depth.size": "17", "max_withdrawal_requests_per_payload.size":"16", - "max_deposit_receipts": "8192", + "max_deposit_requests_per_payload.size": "8192", "max_attesting_indices.size": "131072", "max_committees_per_slot.size": "64", "committee_bits.size": "8", @@ -58,7 +58,7 @@ minimal = { "max_blob_commitments.size": "16", "kzg_commitment_inclusion_proof_depth.size": "9", "max_withdrawal_requests_per_payload.size":"2", - "max_deposit_receipts": "4", + "max_deposit_requests_per_payload.size": "4", "max_attesting_indices.size": "8192", "max_committees_per_slot.size": "4", "committee_bits.size": "1", diff --git a/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go b/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go index b383228d4314..3d730c033b6c 100644 --- a/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go +++ b/testing/spectest/mainnet/electra/operations/execution_layer_withdrawals_test.go @@ -6,6 +6,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" ) -func TestMainnet_Electra_Operations_ExecutionLayerWithdrawalRequest(t *testing.T) { - operations.RunExecutionLayerWithdrawalRequestTest(t, "mainnet") +func TestMainnet_Electra_Operations_WithdrawalRequest(t *testing.T) { + operations.RunWithdrawalRequestTest(t, "mainnet") } diff --git a/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go b/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go index 2476a5fb5906..035e98a1b3c1 100644 --- a/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go +++ b/testing/spectest/minimal/electra/operations/execution_layer_withdrawals_test.go @@ -6,6 +6,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" ) -func TestMinimal_Electra_Operations_ExecutionLayerWithdrawalRequest(t *testing.T) { - operations.RunExecutionLayerWithdrawalRequestTest(t, "minimal") +func TestMinimal_Electra_Operations_WithdrawalRequest(t *testing.T) { + operations.RunWithdrawalRequestTest(t, "minimal") } diff --git a/testing/spectest/shared/electra/operations/BUILD.bazel b/testing/spectest/shared/electra/operations/BUILD.bazel index 7126c7201fc3..01d0b339e9c6 100644 --- a/testing/spectest/shared/electra/operations/BUILD.bazel +++ b/testing/spectest/shared/electra/operations/BUILD.bazel @@ -9,13 +9,13 @@ go_library( "block_header.go", "bls_to_execution_changes.go", "consolidations.go", - "deposit_receipt.go", - "execution_layer_withdrawal_request.go", + "deposit_request.go", "execution_payload.go", "helpers.go", "proposer_slashing.go", "sync_committee.go", "voluntary_exit.go", + "withdrawal_request.go", "withdrawals.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations", diff --git a/testing/spectest/shared/electra/operations/deposit_receipt.go b/testing/spectest/shared/electra/operations/deposit_request.go similarity index 100% rename from testing/spectest/shared/electra/operations/deposit_receipt.go rename to testing/spectest/shared/electra/operations/deposit_request.go diff --git a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go b/testing/spectest/shared/electra/operations/withdrawal_request.go similarity index 71% rename from testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go rename to testing/spectest/shared/electra/operations/withdrawal_request.go index 9c21b186c636..2d2b3a4d3aff 100644 --- a/testing/spectest/shared/electra/operations/execution_layer_withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/withdrawal_request.go @@ -16,7 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunExecutionLayerWithdrawalRequestTest(t *testing.T, config string) { +func RunWithdrawalRequestTest(t *testing.T, config string) { require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests") if len(testFolders) == 0 { @@ -25,14 +25,14 @@ func RunExecutionLayerWithdrawalRequestTest(t *testing.T, config string) { for _, folder := range testFolders { t.Run(folder.Name(), func(t *testing.T) { folderPath := path.Join(testsFolderPath, folder.Name()) - executionLayerWithdrawalRequestFile, err := util.BazelFileBytes(folderPath, "execution_layer_withdrawal_request.ssz_snappy") + withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "execution_layer_withdrawal_request.ssz_snappy") require.NoError(t, err) - executionLayerWithdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, executionLayerWithdrawalRequestFile) + withdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, withdrawalRequestFile) require.NoError(t, err, "Failed to decompress") - withdrawalRequest := &enginev1.ExecutionLayerWithdrawalRequest{} - require.NoError(t, withdrawalRequest.UnmarshalSSZ(executionLayerWithdrawalRequestSSZ), "Failed to unmarshal") + withdrawalRequest := &enginev1.WithdrawalRequest{} + require.NoError(t, withdrawalRequest.UnmarshalSSZ(withdrawalRequestSSZ), "Failed to unmarshal") body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ - WithdrawalRequests: []*enginev1.ExecutionLayerWithdrawalRequest{ + WithdrawalRequests: []*enginev1.WithdrawalRequest{ withdrawalRequest, }, }} @@ -43,7 +43,7 @@ func RunExecutionLayerWithdrawalRequestTest(t *testing.T, config string) { require.NoError(t, err) exe, ok := e.(interfaces.ExecutionDataElectra) require.Equal(t, true, ok) - return electra.ProcessExecutionLayerWithdrawalRequests(ctx, s, exe.WithdrawalRequests()) + return electra.ProcessWithdrawalRequests(ctx, s, exe.WithdrawalRequests()) }) }) } diff --git a/testing/spectest/shared/electra/ssz_static/ssz_static.go b/testing/spectest/shared/electra/ssz_static/ssz_static.go index ae1ac0ddf274..ae149e6f36b7 100644 --- a/testing/spectest/shared/electra/ssz_static/ssz_static.go +++ b/testing/spectest/shared/electra/ssz_static/ssz_static.go @@ -151,10 +151,10 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i obj = ðpb.SignedConsolidation{} case "PendingConsolidation": obj = ðpb.PendingConsolidation{} - case "ExecutionLayerWithdrawalRequest": - obj = &enginev1.ExecutionLayerWithdrawalRequest{} - case "DepositReceipt": - obj = &enginev1.DepositReceipt{} + case "ExecutionLayerWithdrawalRequest": // TODO: update in spectest update + obj = &enginev1.WithdrawalRequest{} + case "DepositReceipt": // TODO: update in spectest update + obj = &enginev1.DepositRequest{} default: return nil, errors.New("type not found") } diff --git a/testing/util/block.go b/testing/util/block.go index e6f9d8e6b4f3..96f3c82c5214 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -1371,8 +1371,8 @@ func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.Beaco BlockHash: make([]byte, fieldparams.RootLength), Transactions: make([][]byte, 0), Withdrawals: make([]*enginev1.Withdrawal, 0), - DepositReceipts: make([]*enginev1.DepositReceipt, 0), - WithdrawalRequests: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0), + DepositRequests: make([]*enginev1.DepositRequest, 0), + WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), } } return b @@ -1578,7 +1578,7 @@ func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra TransactionsRoot: make([]byte, fieldparams.RootLength), WithdrawalsRoot: make([]byte, fieldparams.RootLength), WithdrawalRequestsRoot: make([]byte, fieldparams.RootLength), - DepositReceiptsRoot: make([]byte, fieldparams.RootLength), + DepositRequestsRoot: make([]byte, fieldparams.RootLength), } } return b diff --git a/testing/util/electra.go b/testing/util/electra.go index 09bcc8b7c70f..59889a0e1215 100644 --- a/testing/util/electra.go +++ b/testing/util/electra.go @@ -114,7 +114,7 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri Withdrawals: make([]*enginev1.Withdrawal, 0), BlobGasUsed: 0, ExcessBlobGas: 0, - DepositReceipts: generateTestDepositRequests(uint64(g.slot), 4), + DepositRequests: generateTestDepositRequests(uint64(g.slot), 4), WithdrawalRequests: generateTestWithdrawalRequests(uint64(g.slot), 4), } } @@ -171,11 +171,11 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri return rob, sidecars } -func generateTestDepositRequests(offset, n uint64) []*enginev1.DepositReceipt { - r := make([]*enginev1.DepositReceipt, n) +func generateTestDepositRequests(offset, n uint64) []*enginev1.DepositRequest { + r := make([]*enginev1.DepositRequest, n) var i uint64 for i = 0; i < n; i++ { - r[i] = &enginev1.DepositReceipt{ + r[i] = &enginev1.DepositRequest{ Pubkey: make([]byte, 48), WithdrawalCredentials: make([]byte, 32), Amount: offset + i, @@ -186,11 +186,11 @@ func generateTestDepositRequests(offset, n uint64) []*enginev1.DepositReceipt { return r } -func generateTestWithdrawalRequests(offset, n uint64) []*enginev1.ExecutionLayerWithdrawalRequest { - r := make([]*enginev1.ExecutionLayerWithdrawalRequest, n) +func generateTestWithdrawalRequests(offset, n uint64) []*enginev1.WithdrawalRequest { + r := make([]*enginev1.WithdrawalRequest, n) var i uint64 for i = 0; i < n; i++ { - r[i] = &enginev1.ExecutionLayerWithdrawalRequest{ + r[i] = &enginev1.WithdrawalRequest{ SourceAddress: make([]byte, 20), ValidatorPubkey: make([]byte, 48), Amount: offset + i, diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go index 947b096f2f7f..f8571510d3bc 100644 --- a/testing/util/electra_state.go +++ b/testing/util/electra_state.go @@ -191,7 +191,7 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta Eth1DepositIndex: preState.Eth1DepositIndex(), // Electra Data - DepositReceiptsStartIndex: params.BeaconConfig().UnsetDepositReceiptsStartIndex, + DepositRequestsStartIndex: params.BeaconConfig().UnsetDepositRequestsStartIndex, ExitBalanceToConsume: helpers.ActivationExitChurnLimit(primitives.Gwei(tab)), EarliestConsolidationEpoch: helpers.ActivationExitEpoch(slots.ToEpoch(preState.Slot())), ConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(primitives.Gwei(tab)), @@ -224,8 +224,8 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta BlockHash: make([]byte, 32), Transactions: make([][]byte, 0), Withdrawals: make([]*enginev1.Withdrawal, 0), - DepositReceipts: make([]*enginev1.DepositReceipt, 0), - WithdrawalRequests: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0), + DepositRequests: make([]*enginev1.DepositRequest, 0), + WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), }, }).HashTreeRoot() if err != nil { @@ -269,7 +269,7 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta BlockHash: make([]byte, 32), TransactionsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32), - DepositReceiptsRoot: make([]byte, 32), + DepositRequestsRoot: make([]byte, 32), WithdrawalRequestsRoot: make([]byte, 32), } diff --git a/testing/util/state.go b/testing/util/state.go index 332918e12589..6977733a0f51 100644 --- a/testing/util/state.go +++ b/testing/util/state.go @@ -436,7 +436,7 @@ func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) erro BlockHash: make([]byte, 32), TransactionsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32), - DepositReceiptsRoot: make([]byte, 32), + DepositRequestsRoot: make([]byte, 32), WithdrawalRequestsRoot: make([]byte, 32), }, } From 0674cf64cc5f230a2f1a2d7d3ea8669b483d850a Mon Sep 17 00:00:00 2001 From: Delweng Date: Fri, 14 Jun 2024 00:12:04 +0800 Subject: [PATCH 137/325] chore: make deepsource happy (#14081) * chore(pruner): return error directly Signed-off-by: jsvisa * chore(rpc): unused method receiver Signed-off-by: jsvisa * fix(rpc): use net.JoinHostPort instead of fmt.Sprintf Signed-off-by: jsvisa * chore(amiddleware):use http.NoBody instead of nil Signed-off-by: jsvisa * chore(rpc): rm notused params Signed-off-by: jsvisa * chore(p2p): comment Signed-off-by: jsvisa * feat(db/prune): reduce complexity Signed-off-by: jsvisa * chore(db/pruner): name Signed-off-by: jsvisa * Revert "chore(pruner): return error directly" This reverts commit d76e745f6045a3ca6e40845e40b2a4bf0bb6ee27. Signed-off-by: jsvisa * revert back pruner.go Signed-off-by: jsvisa --------- Signed-off-by: jsvisa --- api/server/middleware/middleware_test.go | 2 +- beacon-chain/p2p/connection_gater_test.go | 14 +++++++------- beacon-chain/rpc/endpoints.go | 8 ++++---- beacon-chain/rpc/service.go | 3 +-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/api/server/middleware/middleware_test.go b/api/server/middleware/middleware_test.go index 3b899d74a59e..c483cac573ea 100644 --- a/api/server/middleware/middleware_test.go +++ b/api/server/middleware/middleware_test.go @@ -31,7 +31,7 @@ func TestNormalizeQueryValuesHandler(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - req, err := http.NewRequest("GET", "/test?"+test.inputQuery, nil) + req, err := http.NewRequest("GET", "/test?"+test.inputQuery, http.NoBody) if err != nil { t.Fatal(err) } diff --git a/beacon-chain/p2p/connection_gater_test.go b/beacon-chain/p2p/connection_gater_test.go index e9072706af8f..a5df92513810 100644 --- a/beacon-chain/p2p/connection_gater_test.go +++ b/beacon-chain/p2p/connection_gater_test.go @@ -336,7 +336,7 @@ func TestService_InterceptAddrDial_Public(t *testing.T) { }), } var err error - //test with public filter + // test with public filter cidr := "public" ip := "212.67.10.122" s.addrFilter, err = configureFilter(&Config{AllowListCIDR: cidr}) @@ -348,7 +348,7 @@ func TestService_InterceptAddrDial_Public(t *testing.T) { t.Errorf("Expected multiaddress with ip %s to not be rejected since we allow public addresses", ip) } - ip = "192.168.1.0" //this is private and should fail + ip = "192.168.1.0" // this is private and should fail multiAddress, err = ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", ip, 3000)) require.NoError(t, err) valid = s.InterceptAddrDial("", multiAddress) @@ -356,7 +356,7 @@ func TestService_InterceptAddrDial_Public(t *testing.T) { t.Errorf("Expected multiaddress with ip %s to be rejected since we are only allowing public addresses", ip) } - //test with public allow filter, with a public address added to the deny list + // test with public allow filter, with a public address added to the deny list invalidPublicIp := "212.67.10.122" validPublicIp := "91.65.69.69" s.addrFilter, err = configureFilter(&Config{AllowListCIDR: "public", DenyListCIDR: []string{"212.67.89.112/16"}}) @@ -384,7 +384,7 @@ func TestService_InterceptAddrDial_Private(t *testing.T) { }), } var err error - //test with private filter + // test with private filter cidr := "private" s.addrFilter, err = configureFilter(&Config{DenyListCIDR: []string{cidr}}) require.NoError(t, err) @@ -413,7 +413,7 @@ func TestService_InterceptAddrDial_AllowPrivate(t *testing.T) { }), } var err error - //test with private filter + // test with private filter cidr := "private" s.addrFilter, err = configureFilter(&Config{AllowListCIDR: cidr}) require.NoError(t, err) @@ -442,7 +442,7 @@ func TestService_InterceptAddrDial_DenyPublic(t *testing.T) { }), } var err error - //test with private filter + // test with private filter cidr := "public" s.addrFilter, err = configureFilter(&Config{DenyListCIDR: []string{cidr}}) require.NoError(t, err) @@ -471,7 +471,7 @@ func TestService_InterceptAddrDial_AllowConflict(t *testing.T) { }), } var err error - //test with private filter + // test with private filter cidr := "public" s.addrFilter, err = configureFilter(&Config{DenyListCIDR: []string{cidr, "192.168.0.0/16"}}) require.NoError(t, err) diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index c086fb6eaeda..8c5f6a9fae0b 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -70,7 +70,7 @@ func (s *Service) endpoints( endpoints = append(endpoints, s.eventsEndpoints()...) endpoints = append(endpoints, s.prysmBeaconEndpoints(ch, stater)...) endpoints = append(endpoints, s.prysmNodeEndpoints()...) - endpoints = append(endpoints, s.prysmValidatorEndpoints(coreService, stater)...) + endpoints = append(endpoints, s.prysmValidatorEndpoints(coreService)...) if enableDebug { endpoints = append(endpoints, s.debugEndpoints(stater)...) } @@ -143,7 +143,7 @@ func (s *Service) builderEndpoints(stater lookup.Stater) []endpoint { } } -func (s *Service) blobEndpoints(blocker lookup.Blocker) []endpoint { +func (*Service) blobEndpoints(blocker lookup.Blocker) []endpoint { server := &blob.Server{ Blocker: blocker, } @@ -777,7 +777,7 @@ func (s *Service) beaconEndpoints( } } -func (s *Service) configEndpoints() []endpoint { +func (*Service) configEndpoints() []endpoint { const namespace = "config" return []endpoint{ { @@ -1045,7 +1045,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { } } -func (s *Service) prysmValidatorEndpoints(coreService *core.Service, stater lookup.Stater) []endpoint { +func (*Service) prysmValidatorEndpoints(coreService *core.Service) []endpoint { server := &validatorprysm.Server{ CoreService: coreService, } diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index bb7104bd8f03..c80331d65130 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -4,7 +4,6 @@ package rpc import ( "context" - "fmt" "net" "sync" @@ -154,7 +153,7 @@ func NewService(ctx context.Context, cfg *Config) *Service { connectedRPCClients: make(map[net.Addr]bool), } - address := fmt.Sprintf("%s:%s", s.cfg.Host, s.cfg.Port) + address := net.JoinHostPort(s.cfg.Host, s.cfg.Port) lis, err := net.Listen("tcp", address) if err != nil { log.WithError(err).Errorf("Could not listen to port in Start() %s", address) From 9bbe12e28cad11508b3c1650622d1a57d04d6aed Mon Sep 17 00:00:00 2001 From: "sam (jgscripts)" <2887857+jgscr@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:41:33 +0100 Subject: [PATCH 138/325] Correcting spelling errors (#14107) * fix small spelling error * fix small grammar error * fix small spelling errors --------- Co-authored-by: Manu NALEPA --- beacon-chain/p2p/discovery.go | 2 +- beacon-chain/p2p/subnets_test.go | 2 +- beacon-chain/slasher/receive.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/p2p/discovery.go b/beacon-chain/p2p/discovery.go index f032038d4304..67341e73c674 100644 --- a/beacon-chain/p2p/discovery.go +++ b/beacon-chain/p2p/discovery.go @@ -51,7 +51,7 @@ func (quicProtocol) ENRKey() string { return "quic" } // with the tracked committee ids for the epoch, allowing our node // to be dynamically discoverable by others given our tracked committee ids. func (s *Service) RefreshENR() { - // return early if discv5 isnt running + // return early if discv5 isn't running if s.dv5Listener == nil || !s.isInitialized() { return } diff --git a/beacon-chain/p2p/subnets_test.go b/beacon-chain/p2p/subnets_test.go index 2b270f731557..668324025d52 100644 --- a/beacon-chain/p2p/subnets_test.go +++ b/beacon-chain/p2p/subnets_test.go @@ -81,7 +81,7 @@ func TestStartDiscV5_FindPeersWithSubnet(t *testing.T) { bootNodeENR := bootListener.Self().String() // Create 3 nodes, each subscribed to a different subnet. - // Each node is connected to the boostrap node. + // Each node is connected to the bootstrap node. services := make([]*Service, 0, 3) for i := 1; i <= 3; i++ { diff --git a/beacon-chain/slasher/receive.go b/beacon-chain/slasher/receive.go index 81c9cdf818cb..b92efb90411a 100644 --- a/beacon-chain/slasher/receive.go +++ b/beacon-chain/slasher/receive.go @@ -141,7 +141,7 @@ func (s *Service) processAttestations( start := time.Now() - // Check for attestatinos slashings (double, sourrounding, surrounded votes). + // Check for attestations slashings (double, surrounding, surrounded votes). slashings, err := s.checkSlashableAttestations(ctx, currentEpoch, validAttestations) if err != nil { log.WithError(err).Error(couldNotCheckSlashableAtt) From b842b7ea012f65f277141ccf06f5417e23c7f56d Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:16:43 -0500 Subject: [PATCH 139/325] proposer settings log ux (#14106) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adding some logs to improve debugging * fixing log functions * Update config/proposer/loader/loader.go Co-authored-by: Radosław Kapka * addressing feedback --------- Co-authored-by: Radosław Kapka --- config/proposer/loader/loader.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/proposer/loader/loader.go b/config/proposer/loader/loader.go index 9831a9e06b3b..2a5fce40955e 100644 --- a/config/proposer/loader/loader.go +++ b/config/proposer/loader/loader.go @@ -1,6 +1,7 @@ package loader import ( + "encoding/json" "fmt" "strconv" @@ -128,12 +129,23 @@ func (psl *settingsLoader) Load(cliCtx *cli.Context) (*proposer.Settings, error) return nil, err } loadConfig = dbps.ToConsensus() + log.Debugf("DB loaded proposer settings: %s", func() string { + b, err := json.Marshal(loadConfig) + if err != nil { + return err.Error() + } + return string(b) + }()) } // start to process based on load method for _, method := range psl.loadMethods { switch method { case defaultFlag: + if psl.existsInDB && len(psl.loadMethods) == 1 { + // only log the below if default flag is the only load method + log.Warn("Previously saved proposer settings were loaded from the DB, only default settings will be updated. Please provide new proposer settings or clear DB to reset proposer settings.") + } suggestedFeeRecipient := cliCtx.String(flags.SuggestedFeeRecipientFlag.Name) if !common.IsHexAddress(suggestedFeeRecipient) { return nil, errors.Errorf("--%s is not a valid Ethereum address", flags.SuggestedFeeRecipientFlag.Name) @@ -157,6 +169,7 @@ func (psl *settingsLoader) Load(cliCtx *cli.Context) (*proposer.Settings, error) return nil, errors.Errorf("proposer settings is empty after unmarshalling from file specified by %s flag", flags.ProposerSettingsFlag.Name) } loadConfig = psl.processProposerSettings(settingFromFile, loadConfig) + log.WithField(flags.ProposerSettingsFlag.Name, cliCtx.String(flags.ProposerSettingsFlag.Name)).Info("Proposer settings loaded from file") case urlFlag: var settingFromURL *validatorpb.ProposerSettingsPayload if err := config.UnmarshalFromURL(cliCtx.Context, cliCtx.String(flags.ProposerSettingsURLFlag.Name), &settingFromURL); err != nil { @@ -166,9 +179,14 @@ func (psl *settingsLoader) Load(cliCtx *cli.Context) (*proposer.Settings, error) return nil, errors.New("proposer settings is empty after unmarshalling from url") } loadConfig = psl.processProposerSettings(settingFromURL, loadConfig) + log.WithField(flags.ProposerSettingsURLFlag.Name, cliCtx.String(flags.ProposerSettingsURLFlag.Name)).Infof("Proposer settings loaded from URL") case onlyDB: loadConfig = psl.processProposerSettings(nil, loadConfig) + log.Info("Proposer settings loaded from the DB") case none: + if psl.existsInDB { + log.Info("Proposer settings loaded from the DB") + } if psl.options.builderConfig != nil { // if there are no proposer settings provided, create a default where fee recipient is not populated, this will be skipped for validator registration on validators that don't have a fee recipient set. // skip saving to DB if only builder settings are provided until a trigger like keymanager API updates with fee recipient values From 17561a6576ec9a5ffb5d6cbacc7172558523d7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 14 Jun 2024 20:30:40 +0200 Subject: [PATCH 140/325] Do not fail production when consensus block value is unavailable (#14111) * Do not fail production when consensus block value is unavailable * add log * use empty string instead of 0 * build fix --- beacon-chain/rpc/eth/validator/BUILD.bazel | 1 + beacon-chain/rpc/eth/validator/handlers.go | 4 ++-- beacon-chain/rpc/eth/validator/handlers_block.go | 7 ++++--- beacon-chain/rpc/eth/validator/log.go | 5 +++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 beacon-chain/rpc/eth/validator/log.go diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 5ab2597a0c09..b4964a0570e0 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -5,6 +5,7 @@ go_library( srcs = [ "handlers.go", "handlers_block.go", + "log.go", "server.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/validator", diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 171790b1bc21..639c1aa79129 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -31,7 +31,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpbalpha "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - log "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus" "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -592,7 +592,7 @@ func (s *Server) PrepareBeaconProposer(w http.ResponseWriter, r *http.Request) { if len(validatorIndices) == 0 { return } - log.WithFields(log.Fields{ + log.WithFields(logrus.Fields{ "validatorIndices": validatorIndices, }).Info("Updated fee recipient addresses") } diff --git a/beacon-chain/rpc/eth/validator/handlers_block.go b/beacon-chain/rpc/eth/validator/handlers_block.go index e265b0c610e9..bf444aafa59c 100644 --- a/beacon-chain/rpc/eth/validator/handlers_block.go +++ b/beacon-chain/rpc/eth/validator/handlers_block.go @@ -220,8 +220,9 @@ func (s *Server) produceBlockV3(ctx context.Context, w http.ResponseWriter, r *h consensusBlockValue, httpError := getConsensusBlockValue(ctx, s.BlockRewardFetcher, v1alpha1resp.Block) if httpError != nil { - httputil.WriteError(w, httpError) - return + log.WithError(httpError).Debug("Failed to get consensus block value") + // Having the consensus block value is not critical to block production + consensusBlockValue = "" } w.Header().Set(api.ExecutionPayloadBlindedHeader, fmt.Sprintf("%v", v1alpha1resp.IsBlinded)) @@ -297,7 +298,7 @@ func getConsensusBlockValue(ctx context.Context, blockRewardsFetcher rewards.Blo } } if bb.Version() == version.Phase0 { - // ignore for phase 0 + // Getting the block value for Phase 0 is very hard, so we ignore it return "", nil } // Get consensus payload value which is the same as the total from the block rewards api. diff --git a/beacon-chain/rpc/eth/validator/log.go b/beacon-chain/rpc/eth/validator/log.go new file mode 100644 index 000000000000..de331ebcf670 --- /dev/null +++ b/beacon-chain/rpc/eth/validator/log.go @@ -0,0 +1,5 @@ +package validator + +import "github.com/sirupsen/logrus" + +var log = logrus.WithField("prefix", "beacon-api") From ae451a3a029d50fb6e46a76de5c9b9ea657465b1 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 18 Jun 2024 09:33:06 -0500 Subject: [PATCH 141/325] Update github.com/prysmaticlabs/go-bitfield (#14120) --- deps.bzl | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps.bzl b/deps.bzl index b46caadbedbe..94d1f3696127 100644 --- a/deps.bzl +++ b/deps.bzl @@ -2979,8 +2979,8 @@ def prysm_deps(): go_repository( name = "com_github_prysmaticlabs_go_bitfield", importpath = "github.com/prysmaticlabs/go-bitfield", - sum = "h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw=", - version = "v0.0.0-20210809151128-385d8c5e3fb7", + sum = "h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4=", + version = "v0.0.0-20240328144219-a1caa50c3a1e", ) go_repository( name = "com_github_prysmaticlabs_gohashtree", diff --git a/go.mod b/go.mod index 8adbe8af741e..424111bbfe1d 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/prometheus/client_model v0.6.1 github.com/prometheus/prom2json v1.3.0 github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 - github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 + github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 github.com/rs/cors v1.7.0 diff --git a/go.sum b/go.sum index 5f206e79d1ce..681f95855c84 100644 --- a/go.sum +++ b/go.sum @@ -969,8 +969,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 h1:c3p3UzV4vFA7xaCDphnDWOjpxcadrQ26l5b+ypsvyxo= github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44/go.mod h1:MA5zShstUwCQaE9faGHgCGvEWUbG87p4SAXINhmCkvg= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= -github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= -github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= +github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= +github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28= From df3a9f218db1758832b6829d17b81a80976067c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 20 Jun 2024 18:13:53 +0200 Subject: [PATCH 142/325] More tracing in the validator client (#14125) * More tracing in the validator client * change context expectation in tests --- validator/client/aggregate.go | 6 ++ validator/client/attest.go | 3 + validator/client/beacon-api/BUILD.bazel | 1 + .../client/beacon-api/activation_test.go | 8 +- .../beacon-api/attestation_data_test.go | 6 +- .../beacon_api_beacon_chain_client_test.go | 30 +++---- .../beacon-api/beacon_api_helpers_test.go | 16 ++-- .../beacon-api/beacon_api_node_client_test.go | 8 +- .../beacon-api/beacon_api_validator_client.go | 80 ++++++++++++++++++- .../beacon_api_validator_client_test.go | 10 +-- .../beacon_committee_selections_test.go | 2 +- .../client/beacon-api/domain_data_test.go | 6 +- .../client/beacon-api/doppelganger_test.go | 24 +++--- validator/client/beacon-api/duties_test.go | 36 ++++----- validator/client/beacon-api/genesis_test.go | 10 +-- .../beacon-api/get_beacon_block_test.go | 28 +++---- validator/client/beacon-api/index_test.go | 10 +-- .../prepare_beacon_proposer_test.go | 4 +- .../beacon-api/propose_attestation_test.go | 2 +- .../propose_beacon_block_altair_test.go | 2 +- .../propose_beacon_block_bellatrix_test.go | 2 +- ...ose_beacon_block_blinded_bellatrix_test.go | 2 +- ...opose_beacon_block_blinded_capella_test.go | 2 +- ...propose_beacon_block_blinded_deneb_test.go | 2 +- .../propose_beacon_block_capella_test.go | 2 +- .../propose_beacon_block_deneb_test.go | 2 +- .../propose_beacon_block_phase0_test.go | 2 +- .../beacon-api/propose_beacon_block_test.go | 2 +- .../client/beacon-api/propose_exit_test.go | 4 +- .../client/beacon-api/registration_test.go | 4 +- .../beacon-api/state_validators_test.go | 16 ++-- validator/client/beacon-api/status_test.go | 26 +++--- .../client/beacon-api/stream_blocks_test.go | 34 ++++---- .../submit_aggregate_selection_proof_test.go | 6 +- .../submit_signed_aggregate_proof_test.go | 4 +- ...bmit_signed_contribution_and_proof_test.go | 4 +- .../subscribe_committee_subnets_test.go | 4 +- .../sync_committee_selections_test.go | 2 +- .../client/beacon-api/sync_committee_test.go | 16 ++-- .../client/beacon-api/validator_count_test.go | 4 +- .../beacon-api/wait_for_chain_start_test.go | 10 +-- validator/client/propose.go | 18 +++++ validator/client/registration.go | 6 ++ validator/client/runner.go | 3 + validator/client/sync_committee.go | 9 +++ validator/client/validator.go | 53 +++++++++++- validator/client/validator_test.go | 8 +- 47 files changed, 354 insertions(+), 185 deletions(-) diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index 237acc3c7a11..1a56b4860281 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -138,6 +138,9 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives // Signs input slot with domain selection proof. This is used to create the signature for aggregator selection. func (v *validator) signSlotWithSelectionProof(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, slot primitives.Slot) (signature []byte, err error) { + ctx, span := trace.StartSpan(ctx, "validator.signSlotWithSelectionProof") + defer span.End() + domain, err := v.domainData(ctx, slots.ToEpoch(slot), params.BeaconConfig().DomainSelectionProof[:]) if err != nil { return nil, err @@ -194,6 +197,9 @@ func (v *validator) waitToSlotTwoThirds(ctx context.Context, slot primitives.Slo // This returns the signature of validator signing over aggregate and // proof object. func (v *validator) aggregateAndProofSig(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, agg *ethpb.AggregateAttestationAndProof, slot primitives.Slot) ([]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.aggregateAndProofSig") + defer span.End() + d, err := v.domainData(ctx, slots.ToEpoch(agg.Aggregate.Data.Slot), params.BeaconConfig().DomainAggregateAndProof[:]) if err != nil { return nil, err diff --git a/validator/client/attest.go b/validator/client/attest.go index 80ee813a42e3..eaa02dac634e 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -199,6 +199,9 @@ func (v *validator) duty(pubKey [fieldparams.BLSPubkeyLength]byte) (*ethpb.Dutie // Given validator's public key, this function returns the signature of an attestation data and its signing root. func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, data *ethpb.AttestationData, slot primitives.Slot) ([]byte, [32]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.signAtt") + defer span.End() + domain, root, err := v.domainAndSigningRoot(ctx, data) if err != nil { return nil, [32]byte{}, err diff --git a/validator/client/beacon-api/BUILD.bazel b/validator/client/beacon-api/BUILD.bazel index dfce02f40667..7ee6a6ac4f2e 100644 --- a/validator/client/beacon-api/BUILD.bazel +++ b/validator/client/beacon-api/BUILD.bazel @@ -64,6 +64,7 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", + "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", "@org_golang_x_sync//errgroup:go_default_library", diff --git a/validator/client/beacon-api/activation_test.go b/validator/client/beacon-api/activation_test.go index 604eb8e3d977..1088734fc30b 100644 --- a/validator/client/beacon-api/activation_test.go +++ b/validator/client/beacon-api/activation_test.go @@ -116,7 +116,7 @@ func TestActivation_Nominal(t *testing.T) { // Get does not return any result for non existing key jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, bytes.NewBuffer(reqBytes), @@ -240,7 +240,7 @@ func TestActivation_InvalidData(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), @@ -281,7 +281,7 @@ func TestActivation_JsonResponseError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), @@ -291,7 +291,7 @@ func TestActivation_JsonResponseError(t *testing.T) { ).Times(1) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), ).Return( diff --git a/validator/client/beacon-api/attestation_data_test.go b/validator/client/beacon-api/attestation_data_test.go index 2da68cec81e2..bc573327e344 100644 --- a/validator/client/beacon-api/attestation_data_test.go +++ b/validator/client/beacon-api/attestation_data_test.go @@ -33,7 +33,7 @@ func TestGetAttestationData_ValidAttestation(t *testing.T) { produceAttestationDataResponseJson := structs.GetAttestationDataResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/attestation_data?committee_index=%d&slot=%d", expectedCommitteeIndex, expectedSlot), &produceAttestationDataResponseJson, ).Return( @@ -183,7 +183,7 @@ func TestGetAttestationData_InvalidData(t *testing.T) { produceAttestationDataResponseJson := structs.GetAttestationDataResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/validator/attestation_data?committee_index=2&slot=1", &produceAttestationDataResponseJson, ).Return( @@ -212,7 +212,7 @@ func TestGetAttestationData_JsonResponseError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) produceAttestationDataResponseJson := structs.GetAttestationDataResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/attestation_data?committee_index=%d&slot=%d", committeeIndex, slot), &produceAttestationDataResponseJson, ).Return( diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go index b31b309eed0a..a4519a185446 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go @@ -58,7 +58,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("foo error"), ) @@ -78,7 +78,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("bar error"), ) @@ -96,7 +96,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("foo error"), ) @@ -114,13 +114,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, nil, ) jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) - jsonRestHandler.EXPECT().Get(ctx, blockHeaderEndpoint, gomock.Any()).Return(errors.New("bar error")) + jsonRestHandler.EXPECT().Get(gomock.Any(), blockHeaderEndpoint, gomock.Any()).Return(errors.New("bar error")) beaconChainClient := beaconApiChainClient{ stateValidatorsProvider: stateValidatorsProvider, @@ -187,13 +187,13 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, nil, ) jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) - jsonRestHandler.EXPECT().Get(ctx, blockHeaderEndpoint, gomock.Any()).Return( + jsonRestHandler.EXPECT().Get(gomock.Any(), blockHeaderEndpoint, gomock.Any()).Return( nil, ).SetArg( 2, @@ -328,7 +328,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( testCase.generateStateValidatorsResponse(), nil, ) @@ -556,7 +556,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(gomock.Any(), primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return( testCase.generateJsonStateValidatorsResponse(), nil, ) @@ -745,7 +745,7 @@ func TestGetChainHead(t *testing.T) { finalityCheckpointsResponse := structs.GetFinalityCheckpointsResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) - jsonRestHandler.EXPECT().Get(ctx, finalityCheckpointsEndpoint, &finalityCheckpointsResponse).Return( + jsonRestHandler.EXPECT().Get(gomock.Any(), finalityCheckpointsEndpoint, &finalityCheckpointsResponse).Return( testCase.finalityCheckpointsError, ).SetArg( 2, @@ -844,7 +844,7 @@ func TestGetChainHead(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) finalityCheckpointsResponse := structs.GetFinalityCheckpointsResponse{} - jsonRestHandler.EXPECT().Get(ctx, finalityCheckpointsEndpoint, &finalityCheckpointsResponse).Return( + jsonRestHandler.EXPECT().Get(gomock.Any(), finalityCheckpointsEndpoint, &finalityCheckpointsResponse).Return( nil, ).SetArg( 2, @@ -852,7 +852,7 @@ func TestGetChainHead(t *testing.T) { ) headBlockHeadersResponse := structs.GetBlockHeaderResponse{} - jsonRestHandler.EXPECT().Get(ctx, headBlockHeadersEndpoint, &headBlockHeadersResponse).Return( + jsonRestHandler.EXPECT().Get(gomock.Any(), headBlockHeadersEndpoint, &headBlockHeadersResponse).Return( testCase.headBlockHeadersError, ).SetArg( 2, @@ -874,7 +874,7 @@ func TestGetChainHead(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) finalityCheckpointsResponse := structs.GetFinalityCheckpointsResponse{} - jsonRestHandler.EXPECT().Get(ctx, finalityCheckpointsEndpoint, &finalityCheckpointsResponse).Return( + jsonRestHandler.EXPECT().Get(gomock.Any(), finalityCheckpointsEndpoint, &finalityCheckpointsResponse).Return( nil, ).SetArg( 2, @@ -882,7 +882,7 @@ func TestGetChainHead(t *testing.T) { ) headBlockHeadersResponse := structs.GetBlockHeaderResponse{} - jsonRestHandler.EXPECT().Get(ctx, headBlockHeadersEndpoint, &headBlockHeadersResponse).Return( + jsonRestHandler.EXPECT().Get(gomock.Any(), headBlockHeadersEndpoint, &headBlockHeadersResponse).Return( nil, ).SetArg( 2, @@ -940,7 +940,7 @@ func Test_beaconApiBeaconChainClient_GetValidatorPerformance(t *testing.T) { want := ðpb.ValidatorPerformanceResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), getValidatorPerformanceEndpoint, nil, bytes.NewBuffer(request), diff --git a/validator/client/beacon-api/beacon_api_helpers_test.go b/validator/client/beacon-api/beacon_api_helpers_test.go index e42d9da2ee60..5dca8cd0698e 100644 --- a/validator/client/beacon-api/beacon_api_helpers_test.go +++ b/validator/client/beacon-api/beacon_api_helpers_test.go @@ -109,7 +109,7 @@ func TestGetFork_Nominal(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), forkEndpoint, &stateForkResponseJson, ).Return( @@ -137,7 +137,7 @@ func TestGetFork_Invalid(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), forkEndpoint, gomock.Any(), ).Return( @@ -176,7 +176,7 @@ func TestGetHeaders_Nominal(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), headersEndpoint, &blockHeadersResponseJson, ).Return( @@ -204,7 +204,7 @@ func TestGetHeaders_Invalid(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), headersEndpoint, gomock.Any(), ).Return( @@ -248,7 +248,7 @@ func TestGetLiveness_Nominal(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), livenessEndpoint, nil, bytes.NewBuffer(marshalledIndexes), @@ -275,7 +275,7 @@ func TestGetLiveness_Invalid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), livenessEndpoint, nil, gomock.Any(), @@ -324,7 +324,7 @@ func TestGetIsSyncing_Nominal(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), syncingEndpoint, &syncingResponseJson, ).Return( @@ -355,7 +355,7 @@ func TestGetIsSyncing_Invalid(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), syncingEndpoint, &syncingResponseJson, ).Return( diff --git a/validator/client/beacon-api/beacon_api_node_client_test.go b/validator/client/beacon-api/beacon_api_node_client_test.go index 09ef15d31440..42feb0b9b3b3 100644 --- a/validator/client/beacon-api/beacon_api_node_client_test.go +++ b/validator/client/beacon-api/beacon_api_node_client_test.go @@ -113,7 +113,7 @@ func TestGetGenesis(t *testing.T) { genesisProvider := mock.NewMockGenesisProvider(ctrl) genesisProvider.EXPECT().Genesis( - ctx, + gomock.Any(), ).Return( testCase.genesisResponse, testCase.genesisError, @@ -124,7 +124,7 @@ func TestGetGenesis(t *testing.T) { if testCase.queriesDepositContract { jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/config/deposit_contract", &depositContractJson, ).Return( @@ -203,7 +203,7 @@ func TestGetSyncStatus(t *testing.T) { syncingResponse := structs.SyncStatusResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), syncingEndpoint, &syncingResponse, ).Return( @@ -267,7 +267,7 @@ func TestGetVersion(t *testing.T) { var versionResponse structs.GetVersionResponse jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), versionEndpoint, &versionResponse, ).Return( diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 617832d30c55..973687d76151 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" + "go.opencensus.io/trace" ) type ValidatorClientOpt func(*beaconApiValidatorClient) @@ -47,12 +48,16 @@ func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...Valida } func (c *beaconApiValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.Duties") + defer span.End() return wrapInMetrics[*ethpb.DutiesResponse]("Duties", func() (*ethpb.DutiesResponse, error) { return c.duties(ctx, in) }) } func (c *beaconApiValidatorClient) CheckDoppelGanger(ctx context.Context, in *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.CheckDoppelGanger") + defer span.End() return wrapInMetrics[*ethpb.DoppelGangerResponse]("CheckDoppelGanger", func() (*ethpb.DoppelGangerResponse, error) { return c.checkDoppelGanger(ctx, in) }) @@ -62,6 +67,10 @@ func (c *beaconApiValidatorClient) DomainData(ctx context.Context, in *ethpb.Dom if len(in.Domain) != 4 { return nil, errors.Errorf("invalid domain type: %s", hexutil.Encode(in.Domain)) } + + ctx, span := trace.StartSpan(ctx, "beacon-api.DomainData") + defer span.End() + domainType := bytesutil.ToBytes4(in.Domain) return wrapInMetrics[*ethpb.DomainResponse]("DomainData", func() (*ethpb.DomainResponse, error) { @@ -70,12 +79,18 @@ func (c *beaconApiValidatorClient) DomainData(ctx context.Context, in *ethpb.Dom } func (c *beaconApiValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.AttestationData") + defer span.End() + return wrapInMetrics[*ethpb.AttestationData]("AttestationData", func() (*ethpb.AttestationData, error) { return c.attestationData(ctx, in.Slot, in.CommitteeIndex) }) } func (c *beaconApiValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.BeaconBlock") + defer span.End() + return wrapInMetrics[*ethpb.GenericBeaconBlock]("BeaconBlock", func() (*ethpb.GenericBeaconBlock, error) { return c.beaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti) }) @@ -86,48 +101,72 @@ func (c *beaconApiValidatorClient) FeeRecipientByPubKey(_ context.Context, _ *et } func (c *beaconApiValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SyncCommitteeContribution") + defer span.End() + return wrapInMetrics[*ethpb.SyncCommitteeContribution]("SyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) { return c.syncCommitteeContribution(ctx, in) }) } func (c *beaconApiValidatorClient) SyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SyncMessageBlockRoot") + defer span.End() + return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("SyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) { return c.syncMessageBlockRoot(ctx) }) } func (c *beaconApiValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SyncSubcommitteeIndex") + defer span.End() + return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("SyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) { return c.syncSubcommitteeIndex(ctx, in) }) } func (c *beaconApiValidatorClient) MultipleValidatorStatus(ctx context.Context, in *ethpb.MultipleValidatorStatusRequest) (*ethpb.MultipleValidatorStatusResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.MultipleValidatorStatus") + defer span.End() + return wrapInMetrics[*ethpb.MultipleValidatorStatusResponse]("MultipleValidatorStatus", func() (*ethpb.MultipleValidatorStatusResponse, error) { return c.multipleValidatorStatus(ctx, in) }) } func (c *beaconApiValidatorClient) PrepareBeaconProposer(ctx context.Context, in *ethpb.PrepareBeaconProposerRequest) (*empty.Empty, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.PrepareBeaconProposer") + defer span.End() + return wrapInMetrics[*empty.Empty]("PrepareBeaconProposer", func() (*empty.Empty, error) { return new(empty.Empty), c.prepareBeaconProposer(ctx, in.Recipients) }) } func (c *beaconApiValidatorClient) ProposeAttestation(ctx context.Context, in *ethpb.Attestation) (*ethpb.AttestResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.ProposeAttestation") + defer span.End() + return wrapInMetrics[*ethpb.AttestResponse]("ProposeAttestation", func() (*ethpb.AttestResponse, error) { return c.proposeAttestation(ctx, in) }) } func (c *beaconApiValidatorClient) ProposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.ProposeBeaconBlock") + defer span.End() + return wrapInMetrics[*ethpb.ProposeResponse]("ProposeBeaconBlock", func() (*ethpb.ProposeResponse, error) { return c.proposeBeaconBlock(ctx, in) }) } func (c *beaconApiValidatorClient) ProposeExit(ctx context.Context, in *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.ProposeExit") + defer span.End() + return wrapInMetrics[*ethpb.ProposeExitResponse]("ProposeExit", func() (*ethpb.ProposeExitResponse, error) { return c.proposeExit(ctx, in) }) @@ -138,52 +177,79 @@ func (c *beaconApiValidatorClient) StreamBlocksAltair(ctx context.Context, in *e } func (c *beaconApiValidatorClient) SubmitAggregateSelectionProof(ctx context.Context, in *ethpb.AggregateSelectionRequest, index primitives.ValidatorIndex, committeeLength uint64) (*ethpb.AggregateSelectionResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitAggregateSelectionProof") + defer span.End() + return wrapInMetrics[*ethpb.AggregateSelectionResponse]("SubmitAggregateSelectionProof", func() (*ethpb.AggregateSelectionResponse, error) { return c.submitAggregateSelectionProof(ctx, in, index, committeeLength) }) } func (c *beaconApiValidatorClient) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitSignedAggregateSelectionProof") + defer span.End() + return wrapInMetrics[*ethpb.SignedAggregateSubmitResponse]("SubmitSignedAggregateSelectionProof", func() (*ethpb.SignedAggregateSubmitResponse, error) { return c.submitSignedAggregateSelectionProof(ctx, in) }) } func (c *beaconApiValidatorClient) SubmitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) (*empty.Empty, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitSignedContributionAndProof") + defer span.End() + return wrapInMetrics[*empty.Empty]("SubmitSignedContributionAndProof", func() (*empty.Empty, error) { return new(empty.Empty), c.submitSignedContributionAndProof(ctx, in) }) } func (c *beaconApiValidatorClient) SubmitSyncMessage(ctx context.Context, in *ethpb.SyncCommitteeMessage) (*empty.Empty, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitSyncMessage") + defer span.End() + return wrapInMetrics[*empty.Empty]("SubmitSyncMessage", func() (*empty.Empty, error) { return new(empty.Empty), c.submitSyncMessage(ctx, in) }) } func (c *beaconApiValidatorClient) SubmitValidatorRegistrations(ctx context.Context, in *ethpb.SignedValidatorRegistrationsV1) (*empty.Empty, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitValidatorRegistrations") + defer span.End() + return wrapInMetrics[*empty.Empty]("SubmitValidatorRegistrations", func() (*empty.Empty, error) { return new(empty.Empty), c.submitValidatorRegistrations(ctx, in.Messages) }) } func (c *beaconApiValidatorClient) SubscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) (*empty.Empty, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.SubscribeCommitteeSubnets") + defer span.End() + return wrapInMetrics[*empty.Empty]("SubscribeCommitteeSubnets", func() (*empty.Empty, error) { return new(empty.Empty), c.subscribeCommitteeSubnets(ctx, in, duties) }) } func (c *beaconApiValidatorClient) ValidatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.ValidatorIndex") + defer span.End() + return wrapInMetrics[*ethpb.ValidatorIndexResponse]("ValidatorIndex", func() (*ethpb.ValidatorIndexResponse, error) { return c.validatorIndex(ctx, in) }) } func (c *beaconApiValidatorClient) ValidatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.ValidatorStatus") + defer span.End() + return c.validatorStatus(ctx, in) } func (c *beaconApiValidatorClient) WaitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) { + ctx, span := trace.StartSpan(ctx, "beacon-api.WaitForActivation") + defer span.End() + return c.waitForActivation(ctx, in) } @@ -212,11 +278,21 @@ func (c *beaconApiValidatorClient) EventStreamIsRunning() bool { } func (c *beaconApiValidatorClient) AggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { - return c.aggregatedSelection(ctx, selections) + ctx, span := trace.StartSpan(ctx, "beacon-api.AggregatedSelections") + defer span.End() + + return wrapInMetrics[[]iface.BeaconCommitteeSelection]("AggregatedSelections", func() ([]iface.BeaconCommitteeSelection, error) { + return c.aggregatedSelection(ctx, selections) + }) } func (c *beaconApiValidatorClient) AggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { - return c.aggregatedSyncSelections(ctx, selections) + ctx, span := trace.StartSpan(ctx, "beacon-api.AggregatedSyncSelections") + defer span.End() + + return wrapInMetrics[[]iface.SyncCommitteeSelection]("AggregatedSyncSelections", func() ([]iface.SyncCommitteeSelection, error) { + return c.aggregatedSyncSelections(ctx, selections) + }) } func wrapInMetrics[Resp any](action string, f func() (Resp, error)) (Resp, error) { diff --git a/validator/client/beacon-api/beacon_api_validator_client_test.go b/validator/client/beacon-api/beacon_api_validator_client_test.go index 19f00977adb8..5b7587862ff2 100644 --- a/validator/client/beacon-api/beacon_api_validator_client_test.go +++ b/validator/client/beacon-api/beacon_api_validator_client_test.go @@ -32,7 +32,7 @@ func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) produceAttestationDataResponseJson := structs.GetAttestationDataResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/attestation_data?committee_index=%d&slot=%d", committeeIndex, slot), &produceAttestationDataResponseJson, ).Return( @@ -66,7 +66,7 @@ func TestBeaconApiValidatorClient_GetAttestationDataError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) produceAttestationDataResponseJson := structs.GetAttestationDataResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/attestation_data?committee_index=%d&slot=%d", committeeIndex, slot), &produceAttestationDataResponseJson, ).Return( @@ -109,7 +109,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) { ctx := context.Background() genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().Genesis(ctx).Return( + genesisProvider.EXPECT().Genesis(gomock.Any()).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, nil, ).Times(2) @@ -139,7 +139,7 @@ func TestBeaconApiValidatorClient_ProposeBeaconBlockValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks", map[string]string{"Eth-Consensus-Version": "phase0"}, gomock.Any(), @@ -175,7 +175,7 @@ func TestBeaconApiValidatorClient_ProposeBeaconBlockError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks", map[string]string{"Eth-Consensus-Version": "phase0"}, gomock.Any(), diff --git a/validator/client/beacon-api/beacon_committee_selections_test.go b/validator/client/beacon-api/beacon_committee_selections_test.go index 4fc8b465a2ea..c0f1ff3d1523 100644 --- a/validator/client/beacon-api/beacon_committee_selections_test.go +++ b/validator/client/beacon-api/beacon_committee_selections_test.go @@ -98,7 +98,7 @@ func TestGetAggregatedSelections(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/validator/beacon_committee_selections", nil, bytes.NewBuffer(reqBody), diff --git a/validator/client/beacon-api/domain_data_test.go b/validator/client/beacon-api/domain_data_test.go index 9ac14ea2447f..89e06e806cbd 100644 --- a/validator/client/beacon-api/domain_data_test.go +++ b/validator/client/beacon-api/domain_data_test.go @@ -37,7 +37,7 @@ func TestGetDomainData_ValidDomainData(t *testing.T) { // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().Genesis(ctx).Return( + genesisProvider.EXPECT().Genesis(gomock.Any()).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, nil, ).Times(1) @@ -66,7 +66,7 @@ func TestGetDomainData_GenesisError(t *testing.T) { // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().Genesis(ctx).Return(nil, errors.New("foo error")).Times(1) + genesisProvider.EXPECT().Genesis(gomock.Any()).Return(nil, errors.New("foo error")).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} _, err := validatorClient.domainData(ctx, epoch, domainType) @@ -85,7 +85,7 @@ func TestGetDomainData_InvalidGenesisRoot(t *testing.T) { // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().Genesis(ctx).Return( + genesisProvider.EXPECT().Genesis(gomock.Any()).Return( &structs.Genesis{GenesisValidatorsRoot: "foo"}, nil, ).Times(1) diff --git a/validator/client/beacon-api/doppelganger_test.go b/validator/client/beacon-api/doppelganger_test.go index bce18ae1ade6..d58201535f60 100644 --- a/validator/client/beacon-api/doppelganger_test.go +++ b/validator/client/beacon-api/doppelganger_test.go @@ -291,13 +291,11 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) - ctx := context.Background() - if testCase.getSyncingOutput != nil { syncingResponseJson := structs.SyncStatusResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), syncingEndpoint, &syncingResponseJson, ).Return( @@ -312,7 +310,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { stateForkResponseJson := structs.GetStateForkResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), forkEndpoint, &stateForkResponseJson, ).Return( @@ -327,7 +325,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { blockHeadersResponseJson := structs.GetBlockHeadersResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), headersEndpoint, &blockHeadersResponseJson, ).Return( @@ -346,7 +344,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), iface.inputUrl, nil, bytes.NewBuffer(marshalledIndexes), @@ -364,7 +362,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { if testCase.getStateValidatorsInterface != nil { stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), testCase.getStateValidatorsInterface.input, nil, nil, @@ -727,13 +725,11 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) - ctx := context.Background() - if testCase.getSyncingOutput != nil { syncingResponseJson := structs.SyncStatusResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), syncingEndpoint, &syncingResponseJson, ).Return( @@ -748,7 +744,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { stateForkResponseJson := structs.GetStateForkResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), forkEndpoint, &stateForkResponseJson, ).Return( @@ -763,7 +759,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { blockHeadersResponseJson := structs.GetBlockHeadersResponse{} jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), headersEndpoint, &blockHeadersResponseJson, ).Return( @@ -778,7 +774,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { if testCase.getStateValidatorsInterface != nil { stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), testCase.getStateValidatorsInterface.input, nil, nil, @@ -796,7 +792,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), iface.inputUrl, nil, bytes.NewBuffer(marshalledIndexes), diff --git a/validator/client/beacon-api/duties_test.go b/validator/client/beacon-api/duties_test.go index 1c12539eca0c..4e696d1bd179 100644 --- a/validator/client/beacon-api/duties_test.go +++ b/validator/client/beacon-api/duties_test.go @@ -63,7 +63,7 @@ func TestGetAttesterDuties_Valid(t *testing.T) { validatorIndices := []primitives.ValidatorIndex{2, 9} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getAttesterDutiesTestEndpoint, epoch), nil, bytes.NewBuffer(validatorIndicesBytes), @@ -91,7 +91,7 @@ func TestGetAttesterDuties_HttpError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getAttesterDutiesTestEndpoint, epoch), gomock.Any(), gomock.Any(), @@ -115,7 +115,7 @@ func TestGetAttesterDuties_NilAttesterDuty(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getAttesterDutiesTestEndpoint, epoch), gomock.Any(), gomock.Any(), @@ -159,7 +159,7 @@ func TestGetProposerDuties_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getProposerDutiesTestEndpoint, epoch), &structs.GetProposerDutiesResponse{}, ).Return( @@ -185,7 +185,7 @@ func TestGetProposerDuties_HttpError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getProposerDutiesTestEndpoint, epoch), gomock.Any(), ).Return( @@ -207,7 +207,7 @@ func TestGetProposerDuties_NilData(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getProposerDutiesTestEndpoint, epoch), gomock.Any(), ).Return( @@ -234,7 +234,7 @@ func TestGetProposerDuties_NilProposerDuty(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getProposerDutiesTestEndpoint, epoch), gomock.Any(), ).Return( @@ -287,7 +287,7 @@ func TestGetSyncDuties_Valid(t *testing.T) { validatorIndices := []primitives.ValidatorIndex{2, 6} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getSyncDutiesTestEndpoint, epoch), nil, bytes.NewBuffer(validatorIndicesBytes), @@ -315,7 +315,7 @@ func TestGetSyncDuties_HttpError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getSyncDutiesTestEndpoint, epoch), gomock.Any(), gomock.Any(), @@ -339,7 +339,7 @@ func TestGetSyncDuties_NilData(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getSyncDutiesTestEndpoint, epoch), gomock.Any(), gomock.Any(), @@ -368,7 +368,7 @@ func TestGetSyncDuties_NilSyncDuty(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", getSyncDutiesTestEndpoint, epoch), gomock.Any(), gomock.Any(), @@ -418,7 +418,7 @@ func TestGetCommittees_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s?epoch=%d", getCommitteesTestEndpoint, epoch), &structs.GetCommitteesResponse{}, ).Return( @@ -444,7 +444,7 @@ func TestGetCommittees_HttpError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s?epoch=%d", getCommitteesTestEndpoint, epoch), gomock.Any(), ).Return( @@ -466,7 +466,7 @@ func TestGetCommittees_NilData(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s?epoch=%d", getCommitteesTestEndpoint, epoch), gomock.Any(), ).Return( @@ -493,7 +493,7 @@ func TestGetCommittees_NilCommittee(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s?epoch=%d", getCommitteesTestEndpoint, epoch), gomock.Any(), ).Return( @@ -1079,7 +1079,7 @@ func TestGetDuties_Valid(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), @@ -1233,7 +1233,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), @@ -1263,7 +1263,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), diff --git a/validator/client/beacon-api/genesis_test.go b/validator/client/beacon-api/genesis_test.go index b225078e1e62..7dc44d2289ff 100644 --- a/validator/client/beacon-api/genesis_test.go +++ b/validator/client/beacon-api/genesis_test.go @@ -21,7 +21,7 @@ func TestGetGenesis_ValidGenesis(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -53,7 +53,7 @@ func TestGetGenesis_NilData(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -77,7 +77,7 @@ func TestGetGenesis_EndpointCalledOnlyOnce(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -111,14 +111,14 @@ func TestGetGenesis_EndpointCanBeCalledAgainAfterError(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( errors.New("foo"), ).Times(1) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( diff --git a/validator/client/beacon-api/get_beacon_block_test.go b/validator/client/beacon-api/get_beacon_block_test.go index 0df3f410c05e..68efd0196d89 100644 --- a/validator/client/beacon-api/get_beacon_block_test.go +++ b/validator/client/beacon-api/get_beacon_block_test.go @@ -28,7 +28,7 @@ func TestGetBeaconBlock_RequestFailed(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), gomock.Any(), gomock.Any(), ).Return( @@ -125,7 +125,7 @@ func TestGetBeaconBlock_Error(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), gomock.Any(), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -161,7 +161,7 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -204,7 +204,7 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -247,7 +247,7 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -292,7 +292,7 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -337,7 +337,7 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -382,7 +382,7 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -427,7 +427,7 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -472,7 +472,7 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).SetArg( @@ -517,14 +517,14 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).Return( &httputil.DefaultJsonError{Code: http.StatusNotFound}, ).Times(1) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/blinded_blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &abstractProduceBlockResponseJson{}, ).SetArg( @@ -568,14 +568,14 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v3/validator/blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &structs.ProduceBlockV3Response{}, ).Return( &httputil.DefaultJsonError{Code: http.StatusNotFound}, ).Times(1) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/blinded_blocks/%d?graffiti=%s&randao_reveal=%s", slot, hexutil.Encode(graffiti), hexutil.Encode(randaoReveal)), &abstractProduceBlockResponseJson{}, ).Return( diff --git a/validator/client/beacon-api/index_test.go b/validator/client/beacon-api/index_test.go index 326abb811f9a..261a640e7a89 100644 --- a/validator/client/beacon-api/index_test.go +++ b/validator/client/beacon-api/index_test.go @@ -44,7 +44,7 @@ func TestIndex_Nominal(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, reqBuffer, @@ -94,7 +94,7 @@ func TestIndex_UnexistingValidator(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, reqBuffer, @@ -136,7 +136,7 @@ func TestIndex_BadIndexError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, reqBuffer, @@ -185,7 +185,7 @@ func TestIndex_JsonResponseError(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, reqBuffer, @@ -208,7 +208,7 @@ func TestIndex_JsonResponseError(t *testing.T) { } jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), buildURL("/eth/v1/beacon/states/head/validators", queryParams), &stateValidatorsResponseJson, ).Return( diff --git a/validator/client/beacon-api/prepare_beacon_proposer_test.go b/validator/client/beacon-api/prepare_beacon_proposer_test.go index 82c006b2f7e0..be01e72669bb 100644 --- a/validator/client/beacon-api/prepare_beacon_proposer_test.go +++ b/validator/client/beacon-api/prepare_beacon_proposer_test.go @@ -48,7 +48,7 @@ func TestPrepareBeaconProposer_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), prepareBeaconProposerTestEndpoint, nil, bytes.NewBuffer(marshalledJsonRecipients), @@ -92,7 +92,7 @@ func TestPrepareBeaconProposer_BadRequest(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), prepareBeaconProposerTestEndpoint, nil, gomock.Any(), diff --git a/validator/client/beacon-api/propose_attestation_test.go b/validator/client/beacon-api/propose_attestation_test.go index 4caf3a8f07d9..be6064a0323e 100644 --- a/validator/client/beacon-api/propose_attestation_test.go +++ b/validator/client/beacon-api/propose_attestation_test.go @@ -126,7 +126,7 @@ func TestProposeAttestation(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/pool/attestations", nil, bytes.NewBuffer(marshalledAttestations), diff --git a/validator/client/beacon-api/propose_beacon_block_altair_test.go b/validator/client/beacon-api/propose_beacon_block_altair_test.go index 45f6bab5132d..540fc2435bc3 100644 --- a/validator/client/beacon-api/propose_beacon_block_altair_test.go +++ b/validator/client/beacon-api/propose_beacon_block_altair_test.go @@ -58,7 +58,7 @@ func TestProposeBeaconBlock_Altair(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "altair"} jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks", headers, bytes.NewBuffer(marshalledBlock), diff --git a/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go b/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go index 9fd2dca4e842..a154b25e74e6 100644 --- a/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go +++ b/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go @@ -75,7 +75,7 @@ func TestProposeBeaconBlock_Bellatrix(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "bellatrix"} jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks", headers, bytes.NewBuffer(marshalledBlock), diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go index 302bbea9e520..7f32a5b39ba3 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go @@ -76,7 +76,7 @@ func TestProposeBeaconBlock_BlindedBellatrix(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "bellatrix"} jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blinded_blocks", headers, bytes.NewBuffer(marshalledBlock), diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go index ccdb37df0977..f858bdacaaf1 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go @@ -78,7 +78,7 @@ func TestProposeBeaconBlock_BlindedCapella(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "capella"} jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blinded_blocks", headers, bytes.NewBuffer(marshalledBlock), diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_deneb_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_deneb_test.go index 1e583901a156..06601363a7f9 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_deneb_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_deneb_test.go @@ -31,7 +31,7 @@ func TestProposeBeaconBlock_BlindedDeneb(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "deneb"} jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/beacon/blinded_blocks", headers, bytes.NewBuffer(denebBytes), diff --git a/validator/client/beacon-api/propose_beacon_block_capella_test.go b/validator/client/beacon-api/propose_beacon_block_capella_test.go index 0ee2183d3b38..733edfd5cceb 100644 --- a/validator/client/beacon-api/propose_beacon_block_capella_test.go +++ b/validator/client/beacon-api/propose_beacon_block_capella_test.go @@ -75,7 +75,7 @@ func TestProposeBeaconBlock_Capella(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "capella"} jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/beacon/blocks", headers, bytes.NewBuffer(marshalledBlock), diff --git a/validator/client/beacon-api/propose_beacon_block_deneb_test.go b/validator/client/beacon-api/propose_beacon_block_deneb_test.go index f2f2bf14bf6e..1caf7504fa21 100644 --- a/validator/client/beacon-api/propose_beacon_block_deneb_test.go +++ b/validator/client/beacon-api/propose_beacon_block_deneb_test.go @@ -32,7 +32,7 @@ func TestProposeBeaconBlock_Deneb(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "deneb"} jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/beacon/blocks", headers, bytes.NewBuffer(denebBytes), diff --git a/validator/client/beacon-api/propose_beacon_block_phase0_test.go b/validator/client/beacon-api/propose_beacon_block_phase0_test.go index c15ffe5556f5..aa63c28d1159 100644 --- a/validator/client/beacon-api/propose_beacon_block_phase0_test.go +++ b/validator/client/beacon-api/propose_beacon_block_phase0_test.go @@ -54,7 +54,7 @@ func TestProposeBeaconBlock_Phase0(t *testing.T) { // Make sure that what we send in the POST body is the marshalled version of the protobuf block headers := map[string]string{"Eth-Consensus-Version": "phase0"} jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks", headers, bytes.NewBuffer(marshalledBlock), diff --git a/validator/client/beacon-api/propose_beacon_block_test.go b/validator/client/beacon-api/propose_beacon_block_test.go index a1ed400d9f38..33e165748ff1 100644 --- a/validator/client/beacon-api/propose_beacon_block_test.go +++ b/validator/client/beacon-api/propose_beacon_block_test.go @@ -101,7 +101,7 @@ func TestProposeBeaconBlock_Error(t *testing.T) { headers := map[string]string{"Eth-Consensus-Version": testCase.consensusVersion} jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), testCase.endpoint, headers, gomock.Any(), diff --git a/validator/client/beacon-api/propose_exit_test.go b/validator/client/beacon-api/propose_exit_test.go index be3dc50709c6..1ca0f46d5295 100644 --- a/validator/client/beacon-api/propose_exit_test.go +++ b/validator/client/beacon-api/propose_exit_test.go @@ -39,7 +39,7 @@ func TestProposeExit_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), proposeExitTestEndpoint, nil, bytes.NewBuffer(marshalledVoluntaryExit), @@ -88,7 +88,7 @@ func TestProposeExit_BadRequest(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), proposeExitTestEndpoint, nil, gomock.Any(), diff --git a/validator/client/beacon-api/registration_test.go b/validator/client/beacon-api/registration_test.go index ed04a9ab7905..789de6746968 100644 --- a/validator/client/beacon-api/registration_test.go +++ b/validator/client/beacon-api/registration_test.go @@ -68,7 +68,7 @@ func TestRegistration_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/validator/register_validator", nil, bytes.NewBuffer(marshalledJsonRegistrations), @@ -143,7 +143,7 @@ func TestRegistration_BadRequest(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/validator/register_validator", nil, gomock.Any(), diff --git a/validator/client/beacon-api/state_validators_test.go b/validator/client/beacon-api/state_validators_test.go index 78c648a49d33..a34db76d33ae 100644 --- a/validator/client/beacon-api/state_validators_test.go +++ b/validator/client/beacon-api/state_validators_test.go @@ -70,7 +70,7 @@ func TestGetStateValidators_Nominal_POST(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, bytes.NewBuffer(reqBytes), @@ -157,7 +157,7 @@ func TestGetStateValidators_Nominal_GET(t *testing.T) { // First return an error from POST call. jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, bytes.NewBuffer(reqBytes), @@ -178,7 +178,7 @@ func TestGetStateValidators_Nominal_GET(t *testing.T) { query := buildURL("/eth/v1/beacon/states/head/validators", queryParams) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), query, &stateValidatorsResponseJson, ).Return( @@ -226,7 +226,7 @@ func TestGetStateValidators_GetRestJsonResponseOnError(t *testing.T) { // First call POST. jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, bytes.NewBuffer(reqBytes), @@ -247,7 +247,7 @@ func TestGetStateValidators_GetRestJsonResponseOnError(t *testing.T) { query := buildURL("/eth/v1/beacon/states/head/validators", queryParams) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), query, &stateValidatorsResponseJson, ).Return( @@ -280,7 +280,7 @@ func TestGetStateValidators_DataIsNil_POST(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, bytes.NewBuffer(reqBytes), &stateValidatorsResponseJson, @@ -320,7 +320,7 @@ func TestGetStateValidators_DataIsNil_GET(t *testing.T) { // First call POST which will return an error. jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validators", nil, bytes.NewBuffer(reqBytes), @@ -341,7 +341,7 @@ func TestGetStateValidators_DataIsNil_GET(t *testing.T) { query := buildURL("/eth/v1/beacon/states/head/validators", queryParams) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), query, &stateValidatorsResponseJson, ).Return( diff --git a/validator/client/beacon-api/status_test.go b/validator/client/beacon-api/status_test.go index c802bd59ff15..1803929d4f72 100644 --- a/validator/client/beacon-api/status_test.go +++ b/validator/client/beacon-api/status_test.go @@ -32,7 +32,7 @@ func TestValidatorStatus_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), []string{stringValidatorPubKey}, nil, nil, @@ -65,7 +65,7 @@ func TestValidatorStatus_Nominal(t *testing.T) { // Expect node version endpoint call. var nodeVersionResponse structs.GetVersionResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/node/version", &nodeVersionResponse, ).Return( @@ -97,7 +97,7 @@ func TestValidatorStatus_Error(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), gomock.Any(), nil, nil, @@ -139,7 +139,7 @@ func TestMultipleValidatorStatus_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), stringValidatorsPubKey, []primitives.ValidatorIndex{}, nil, @@ -172,7 +172,7 @@ func TestMultipleValidatorStatus_Nominal(t *testing.T) { // Expect node version endpoint call. var nodeVersionResponse structs.GetVersionResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/node/version", &nodeVersionResponse, ).Return( @@ -224,7 +224,7 @@ func TestMultipleValidatorStatus_Error(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), gomock.Any(), []primitives.ValidatorIndex{}, nil, @@ -276,7 +276,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), stringValidatorsPubKey, validatorsIndex, nil, @@ -333,7 +333,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) // Expect node version endpoint call. var nodeVersionResponse structs.GetVersionResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/node/version", &nodeVersionResponse, ).Return( @@ -345,7 +345,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) var validatorCountResponse structs.GetValidatorCountResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validator_count?", &validatorCountResponse, ).Return( @@ -456,7 +456,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), []string{stringValidatorPubKey}, nil, nil, @@ -481,7 +481,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { // Expect node version endpoint call. var nodeVersionResponse structs.GetVersionResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/node/version", &nodeVersionResponse, ).Return( @@ -706,7 +706,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) stateValidatorsProvider.EXPECT().StateValidators( - ctx, + gomock.Any(), testCase.inputGetStateValidatorsInterface.inputStringPubKeys, testCase.inputGetStateValidatorsInterface.inputIndexes, testCase.inputGetStateValidatorsInterface.inputStatuses, @@ -720,7 +720,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { // Expect node version endpoint call. var nodeVersionResponse structs.GetVersionResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/node/version", &nodeVersionResponse, ).Return( diff --git a/validator/client/beacon-api/stream_blocks_test.go b/validator/client/beacon-api/stream_blocks_test.go index ffb58d5032bc..aaadb2047f3d 100644 --- a/validator/client/beacon-api/stream_blocks_test.go +++ b/validator/client/beacon-api/stream_blocks_test.go @@ -27,7 +27,7 @@ func TestStreamBlocks_UnsupportedConsensusVersion(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), gomock.Any(), &abstractSignedBlockResponseJson{}, ).SetArg( @@ -149,7 +149,7 @@ func TestStreamBlocks_Error(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), gomock.Any(), &abstractSignedBlockResponseJson{}, ).SetArg( @@ -214,7 +214,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -251,7 +251,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -278,7 +278,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { // The fourth call is only necessary when verifiedOnly == true since the previous block was optimistic if testCase.verifiedOnly { jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -375,7 +375,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -412,7 +412,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -439,7 +439,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { // The fourth call is only necessary when verifiedOnly == true since the previous block was optimistic if testCase.verifiedOnly { jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -536,7 +536,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -573,7 +573,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -600,7 +600,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { // The fourth call is only necessary when verifiedOnly == true since the previous block was optimistic if testCase.verifiedOnly { jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -697,7 +697,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -734,7 +734,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -761,7 +761,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { // The fourth call is only necessary when verifiedOnly == true since the previous block was optimistic if testCase.verifiedOnly { jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -858,7 +858,7 @@ func TestStreamBlocks_DenebValid(t *testing.T) { marshalledSignedBeaconBlockContainer1, err := json.Marshal(denebBlock) require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -887,7 +887,7 @@ func TestStreamBlocks_DenebValid(t *testing.T) { require.NoError(t, err) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( @@ -904,7 +904,7 @@ func TestStreamBlocks_DenebValid(t *testing.T) { // The fourth call is only necessary when verifiedOnly == true since the previous block was optimistic if testCase.verifiedOnly { jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v2/beacon/blocks/head", &signedBlockResponseJson, ).Return( diff --git a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go index 5bb60d5aa85a..f8cdcb1111d9 100644 --- a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go +++ b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go @@ -98,7 +98,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) { // Call node syncing endpoint to check if head is optimistic. jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), syncingEndpoint, &structs.SyncStatusResponse{}, ).SetArg( @@ -114,7 +114,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) { // Call attestation data to get attestation data root to query aggregate attestation. jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s?committee_index=%d&slot=%d", attestationDataEndpoint, committeeIndex, slot), &structs.GetAttestationDataResponse{}, ).SetArg( @@ -126,7 +126,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) { // Call attestation data to get attestation data root to query aggregate attestation. jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("%s?attestation_data_root=%s&slot=%d", aggregateAttestationEndpoint, hexutil.Encode(attestationDataRootBytes[:]), slot), &structs.AggregateAttestationResponse{}, ).SetArg( diff --git a/validator/client/beacon-api/submit_signed_aggregate_proof_test.go b/validator/client/beacon-api/submit_signed_aggregate_proof_test.go index 6a8e41668c64..1251d3d4d604 100644 --- a/validator/client/beacon-api/submit_signed_aggregate_proof_test.go +++ b/validator/client/beacon-api/submit_signed_aggregate_proof_test.go @@ -28,7 +28,7 @@ func TestSubmitSignedAggregateSelectionProof_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/validator/aggregate_and_proofs", nil, bytes.NewBuffer(marshalledSignedAggregateSignedAndProof), @@ -59,7 +59,7 @@ func TestSubmitSignedAggregateSelectionProof_BadRequest(t *testing.T) { ctx := context.Background() jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/validator/aggregate_and_proofs", nil, bytes.NewBuffer(marshalledSignedAggregateSignedAndProof), diff --git a/validator/client/beacon-api/submit_signed_contribution_and_proof_test.go b/validator/client/beacon-api/submit_signed_contribution_and_proof_test.go index 00920f63c78b..a8daea0c6ab6 100644 --- a/validator/client/beacon-api/submit_signed_contribution_and_proof_test.go +++ b/validator/client/beacon-api/submit_signed_contribution_and_proof_test.go @@ -46,7 +46,7 @@ func TestSubmitSignedContributionAndProof_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), submitSignedContributionAndProofTestEndpoint, nil, bytes.NewBuffer(marshalledContributionAndProofs), @@ -121,7 +121,7 @@ func TestSubmitSignedContributionAndProof_Error(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) if testCase.httpRequestExpected { jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), submitSignedContributionAndProofTestEndpoint, gomock.Any(), gomock.Any(), diff --git a/validator/client/beacon-api/subscribe_committee_subnets_test.go b/validator/client/beacon-api/subscribe_committee_subnets_test.go index 56458a97d2fb..8657b76fb8c5 100644 --- a/validator/client/beacon-api/subscribe_committee_subnets_test.go +++ b/validator/client/beacon-api/subscribe_committee_subnets_test.go @@ -47,7 +47,7 @@ func TestSubscribeCommitteeSubnets_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), subscribeCommitteeSubnetsTestEndpoint, nil, bytes.NewBuffer(committeeSubscriptionsBytes), @@ -209,7 +209,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) if testCase.expectSubscribeRestCall { jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), subscribeCommitteeSubnetsTestEndpoint, gomock.Any(), gomock.Any(), diff --git a/validator/client/beacon-api/sync_committee_selections_test.go b/validator/client/beacon-api/sync_committee_selections_test.go index 00a61e8be414..26dac8f0bd0c 100644 --- a/validator/client/beacon-api/sync_committee_selections_test.go +++ b/validator/client/beacon-api/sync_committee_selections_test.go @@ -104,7 +104,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { ctx := context.Background() jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), "/eth/v1/validator/sync_committee_selections", nil, bytes.NewBuffer(reqBody), diff --git a/validator/client/beacon-api/sync_committee_test.go b/validator/client/beacon-api/sync_committee_test.go index bdb99ab10220..e3366d550018 100644 --- a/validator/client/beacon-api/sync_committee_test.go +++ b/validator/client/beacon-api/sync_committee_test.go @@ -46,7 +46,7 @@ func TestSubmitSyncMessage_Valid(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/beacon/pool/sync_committees", nil, bytes.NewBuffer(marshalledJsonRegistrations), @@ -75,7 +75,7 @@ func TestSubmitSyncMessage_BadRequest(t *testing.T) { jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - context.Background(), + gomock.Any(), "/eth/v1/beacon/pool/sync_committees", nil, gomock.Any(), @@ -139,7 +139,7 @@ func TestGetSyncMessageBlockRoot(t *testing.T) { ctx := context.Background() jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks/head/root", &structs.BlockRootResponse{}, ).SetArg( @@ -209,7 +209,7 @@ func TestGetSyncCommitteeContribution(t *testing.T) { ctx := context.Background() jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/blocks/head/root", &structs.BlockRootResponse{}, ).SetArg( @@ -224,7 +224,7 @@ func TestGetSyncCommitteeContribution(t *testing.T) { ).Times(1) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), fmt.Sprintf("/eth/v1/validator/sync_committee_contribution?beacon_block_root=%s&slot=%d&subcommittee_index=%d", blockRoot, uint64(request.Slot), request.SubnetId), &structs.ProduceSyncCommitteeContributionResponse{}, @@ -316,7 +316,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) { require.NoError(t, err) jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), validatorsEndpoint, nil, bytes.NewBuffer(valsReqBytes), @@ -351,7 +351,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) { query := buildURL("/eth/v1/beacon/states/head/validators", queryParams) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), query, &structs.GetValidatorsResponse{}, ).Return( @@ -368,7 +368,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) { } jsonRestHandler.EXPECT().Post( - ctx, + gomock.Any(), fmt.Sprintf("%s/%d", syncDutiesEndpoint, slots.ToEpoch(slot)), nil, bytes.NewBuffer(validatorIndicesBytes), diff --git a/validator/client/beacon-api/validator_count_test.go b/validator/client/beacon-api/validator_count_test.go index 9a243018e2f3..5eaf6183b60c 100644 --- a/validator/client/beacon-api/validator_count_test.go +++ b/validator/client/beacon-api/validator_count_test.go @@ -118,7 +118,7 @@ func TestGetValidatorCount(t *testing.T) { // Expect node version endpoint call. var nodeVersionResponse structs.GetVersionResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/node/version", &nodeVersionResponse, ).Return( @@ -130,7 +130,7 @@ func TestGetValidatorCount(t *testing.T) { var validatorCountResponse structs.GetValidatorCountResponse jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/states/head/validator_count?status=active", &validatorCountResponse, ).Return( diff --git a/validator/client/beacon-api/wait_for_chain_start_test.go b/validator/client/beacon-api/wait_for_chain_start_test.go index 6b29babd9b7a..ed302f4d2354 100644 --- a/validator/client/beacon-api/wait_for_chain_start_test.go +++ b/validator/client/beacon-api/wait_for_chain_start_test.go @@ -24,7 +24,7 @@ func TestWaitForChainStart_ValidGenesis(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -91,7 +91,7 @@ func TestWaitForChainStart_BadGenesis(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -119,7 +119,7 @@ func TestWaitForChainStart_JsonResponseError(t *testing.T) { genesisResponseJson := structs.GetGenesisResponse{} jsonRestHandler := mock.NewMockJsonRestHandler(ctrl) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -144,7 +144,7 @@ func TestWaitForChainStart_JsonResponseError404(t *testing.T) { // First, mock a request that receives a 404 error (which means that the genesis data is not available yet) jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( @@ -156,7 +156,7 @@ func TestWaitForChainStart_JsonResponseError404(t *testing.T) { // After receiving a 404 error, mock a request that actually has genesis data available jsonRestHandler.EXPECT().Get( - ctx, + gomock.Any(), "/eth/v1/beacon/genesis", &genesisResponseJson, ).Return( diff --git a/validator/client/propose.go b/validator/client/propose.go index 4e546a419ce6..656f7d38da4a 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -329,6 +329,9 @@ func CreateSignedVoluntaryExit( // Sign randao reveal with randao domain and private key. func (v *validator) signRandaoReveal(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, epoch primitives.Epoch, slot primitives.Slot) ([]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.signRandaoReveal") + defer span.End() + domain, err := v.domainData(ctx, epoch, params.BeaconConfig().DomainRandao[:]) if err != nil { return nil, errors.Wrap(err, domainDataErr) @@ -359,6 +362,9 @@ func (v *validator) signRandaoReveal(ctx context.Context, pubKey [fieldparams.BL // Sign block with proposer domain and private key. // Returns the signature, block signing root, and any error. func (v *validator) signBlock(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, epoch primitives.Epoch, slot primitives.Slot, b interfaces.ReadOnlyBeaconBlock) ([]byte, [32]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.signBlock") + defer span.End() + domain, err := v.domainData(ctx, epoch, params.BeaconConfig().DomainBeaconProposer[:]) if err != nil { return nil, [32]byte{}, errors.Wrap(err, domainDataErr) @@ -397,6 +403,9 @@ func signVoluntaryExit( exit *ethpb.VoluntaryExit, slot primitives.Slot, ) ([]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.signVoluntaryExit") + defer span.End() + req := ðpb.DomainRequest{ Epoch: exit.Epoch, Domain: params.BeaconConfig().DomainVoluntaryExit[:], @@ -430,6 +439,9 @@ func signVoluntaryExit( // Graffiti gets the graffiti from cli or file for the validator public key. func (v *validator) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.Graffiti") + defer span.End() + if v.proposerSettings != nil { // Check proposer settings for specific key first if v.proposerSettings.ProposeConfig != nil { @@ -493,6 +505,9 @@ func (v *validator) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyL } func (v *validator) SetGraffiti(ctx context.Context, pubkey [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error { + ctx, span := trace.StartSpan(ctx, "validator.SetGraffiti") + defer span.End() + if graffiti == nil { return nil } @@ -518,6 +533,9 @@ func (v *validator) SetGraffiti(ctx context.Context, pubkey [fieldparams.BLSPubk } func (v *validator) DeleteGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) error { + ctx, span := trace.StartSpan(ctx, "validator.DeleteGraffiti") + defer span.End() + if v.proposerSettings == nil || v.proposerSettings.ProposeConfig == nil { return errors.New("attempted to delete graffiti without proposer settings, graffiti will default to flag options") } diff --git a/validator/client/registration.go b/validator/client/registration.go index 1f57f26e3aaf..fa5ca997f841 100644 --- a/validator/client/registration.go +++ b/validator/client/registration.go @@ -62,6 +62,9 @@ func SubmitValidatorRegistrations( // Sings validator registration obj with the proposer domain and private key. func signValidatorRegistration(ctx context.Context, signer iface.SigningFunc, reg *ethpb.ValidatorRegistrationV1) ([]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.signValidatorRegistration") + defer span.End() + // Per spec, we want the fork version and genesis validator to be nil. // Which is genesis value and zero by default. d, err := signing.ComputeDomain( @@ -91,6 +94,9 @@ func signValidatorRegistration(ctx context.Context, signer iface.SigningFunc, re // SignValidatorRegistrationRequest compares and returns either the cached validator registration request or signs a new one. func (v *validator) SignValidatorRegistrationRequest(ctx context.Context, signer iface.SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error) { + ctx, span := trace.StartSpan(ctx, "validator.SignValidatorRegistrationRequest") + defer span.End() + signedReg, ok := v.signedValidatorRegistrations[bytesutil.ToBytes48(newValidatorRegistration.Pubkey)] if ok && isValidatorRegistrationSame(signedReg.Message, newValidatorRegistration) { return signedReg, nil diff --git a/validator/client/runner.go b/validator/client/runner.go index 83c9fec2489b..c60de6423759 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -160,6 +160,9 @@ func onAccountsChanged(ctx context.Context, v iface.Validator, current [][48]byt } func initializeValidatorAndGetHeadSlot(ctx context.Context, v iface.Validator) (primitives.Slot, error) { + ctx, span := trace.StartSpan(ctx, "validator.initializeValidatorAndGetHeadSlot") + defer span.End() + ticker := time.NewTicker(backOffPeriod) defer ticker.Stop() diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index bbb4c93a85e6..cefa2bd53f2b 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -192,6 +192,9 @@ func (v *validator) SubmitSignedContributionAndProof(ctx context.Context, slot p // Signs and returns selection proofs per validator for slot and pub key. func (v *validator) selectionProofs(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte, indexRes *ethpb.SyncSubcommitteeIndexResponse, validatorIndex primitives.ValidatorIndex) ([][]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.selectionProofs") + defer span.End() + selectionProofs := make([][]byte, len(indexRes.Indices)) cfg := params.BeaconConfig() size := cfg.SyncCommitteeSize @@ -231,6 +234,9 @@ func (v *validator) selectionProofs(ctx context.Context, slot primitives.Slot, p // Signs input slot with domain sync committee selection proof. This is used to create the signature for sync committee selection. func (v *validator) signSyncSelectionData(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, index uint64, slot primitives.Slot) (signature []byte, err error) { + ctx, span := trace.StartSpan(ctx, "validator.signSyncSelectionData") + defer span.End() + domain, err := v.domainData(ctx, slots.ToEpoch(slot), params.BeaconConfig().DomainSyncCommitteeSelectionProof[:]) if err != nil { return nil, err @@ -258,6 +264,9 @@ func (v *validator) signSyncSelectionData(ctx context.Context, pubKey [fieldpara // This returns the signature of validator signing over sync committee contribution and proof object. func (v *validator) signContributionAndProof(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, c *ethpb.ContributionAndProof, slot primitives.Slot) ([]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.signContributionAndProof") + defer span.End() + d, err := v.domainData(ctx, slots.ToEpoch(c.Contribution.Slot), params.BeaconConfig().DomainContributionAndProof[:]) if err != nil { return nil, err diff --git a/validator/client/validator.go b/validator/client/validator.go index 679bde17ba15..00a94f30f378 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -136,6 +136,9 @@ func (v *validator) Done() { // WaitForKeymanagerInitialization checks if the validator needs to wait for keymanager initialization. func (v *validator) WaitForKeymanagerInitialization(ctx context.Context) error { + ctx, span := trace.StartSpan(ctx, "validator.WaitForKeymanagerInitialization") + defer span.End() + genesisRoot, err := v.db.GenesisValidatorsRoot(ctx) if err != nil { return errors.Wrap(err, "unable to retrieve valid genesis validators root while initializing key manager") @@ -179,6 +182,9 @@ func waitForWebWalletInitialization( walletInitializedEvent *event.Feed, walletChan chan *wallet.Wallet, ) (keymanager.IKeymanager, error) { + ctx, span := trace.StartSpan(ctx, "validator.waitForWebWalletInitialization") + defer span.End() + sub := walletInitializedEvent.Subscribe(walletChan) defer sub.Unsubscribe() for { @@ -201,6 +207,9 @@ func waitForWebWalletInitialization( // recheckKeys checks if the validator has any keys that need to be rechecked. // The keymanager implements a subscription to push these updates to the validator. func recheckKeys(ctx context.Context, valDB db.Database, km keymanager.IKeymanager) { + ctx, span := trace.StartSpan(ctx, "validator.recheckKeys") + defer span.End() + var validatingKeys [][fieldparams.BLSPubkeyLength]byte var err error validatingKeys, err = km.FetchValidatingPublicKeys(ctx) @@ -215,6 +224,9 @@ func recheckKeys(ctx context.Context, valDB db.Database, km keymanager.IKeymanag // to accounts changes in the keymanager, then updates those keys' // buckets in bolt DB if a bucket for a key does not exist. func recheckValidatingKeysBucket(ctx context.Context, valDB db.Database, km keymanager.IKeymanager) { + ctx, span := trace.StartSpan(ctx, "validator.recheckValidatingKeysBucket") + defer span.End() + importedKeymanager, ok := km.(*local.Keymanager) if !ok { return @@ -425,6 +437,9 @@ func (v *validator) SlotDeadline(slot primitives.Slot) time.Time { // CheckDoppelGanger checks if the current actively provided keys have // any duplicates active in the network. func (v *validator) CheckDoppelGanger(ctx context.Context) error { + ctx, span := trace.StartSpan(ctx, "validator.CheckDoppelganger") + defer span.End() + if !features.Get().EnableDoppelGanger { return nil } @@ -531,7 +546,7 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro } ctx, cancel := context.WithDeadline(ctx, v.SlotDeadline(ss)) defer cancel() - ctx, span := trace.StartSpan(ctx, "validator.UpdateAssignments") + ctx, span := trace.StartSpan(ctx, "validator.UpdateDuties") defer span.End() validatingKeys, err := v.km.FetchValidatingPublicKeys(ctx) @@ -603,6 +618,9 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro // subscribeToSubnets iterates through each validator duty, signs each slot, and asks beacon node // to eagerly subscribe to subnets so that the aggregator has attestations to aggregate. func (v *validator) subscribeToSubnets(ctx context.Context, duties *ethpb.DutiesResponse) error { + ctx, span := trace.StartSpan(ctx, "validator.subscribeToSubnets") + defer span.End() + subscribeSlots := make([]primitives.Slot, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) subscribeCommitteeIndices := make([]primitives.CommitteeIndex, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) subscribeIsAggregator := make([]bool, 0, len(duties.CurrentEpochDuties)+len(duties.NextEpochDuties)) @@ -685,6 +703,9 @@ func (v *validator) subscribeToSubnets(ctx context.Context, duties *ethpb.Duties // validator is known to not have a roles at the slot. Returns UNKNOWN if the // validator assignments are unknown. Otherwise returns a valid ValidatorRole map. func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fieldparams.BLSPubkeyLength]byte][]iface.ValidatorRole, error) { + ctx, span := trace.StartSpan(ctx, "validator.RolesAt") + defer span.End() + v.dutiesLock.RLock() defer v.dutiesLock.RUnlock() rolesAt := make(map[[fieldparams.BLSPubkeyLength]byte][]iface.ValidatorRole) @@ -769,6 +790,9 @@ func (v *validator) isAggregator( pubKey [fieldparams.BLSPubkeyLength]byte, validatorIndex primitives.ValidatorIndex, ) (bool, error) { + ctx, span := trace.StartSpan(ctx, "validator.isAggregator") + defer span.End() + modulo := uint64(1) if len(committeeIndex)/int(params.BeaconConfig().TargetAggregatorsPerCommittee) > 1 { modulo = uint64(len(committeeIndex)) / params.BeaconConfig().TargetAggregatorsPerCommittee @@ -804,6 +828,9 @@ func (v *validator) isAggregator( // modulo = max(1, SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT // TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE) // return bytes_to_uint64(hash(signature)[0:8]) % modulo == 0 func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte, validatorIndex primitives.ValidatorIndex) (bool, error) { + ctx, span := trace.StartSpan(ctx, "validator.isSyncCommitteeAggregator") + defer span.End() + res, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubKey[:], Slot: slot, @@ -855,6 +882,9 @@ func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitiv // is very rare, a validator should check these data every epoch to be sure the validator is // participating on the correct fork version. func (v *validator) UpdateDomainDataCaches(ctx context.Context, slot primitives.Slot) { + ctx, span := trace.StartSpan(ctx, "validator.UpdateDomainDataCaches") + defer span.End() + for _, d := range [][]byte{ params.BeaconConfig().DomainRandao[:], params.BeaconConfig().DomainBeaconAttester[:], @@ -873,6 +903,9 @@ func (v *validator) UpdateDomainDataCaches(ctx context.Context, slot primitives. } func (v *validator) domainData(ctx context.Context, epoch primitives.Epoch, domain []byte) (*ethpb.DomainResponse, error) { + ctx, span := trace.StartSpan(ctx, "validator.domainData") + defer span.End() + v.domainDataLock.RLock() req := ðpb.DomainRequest{ @@ -1019,6 +1052,9 @@ func (v *validator) ProposerSettings() *proposer.Settings { // SetProposerSettings sets and saves the passed in proposer settings overriding the in memory one func (v *validator) SetProposerSettings(ctx context.Context, settings *proposer.Settings) error { + ctx, span := trace.StartSpan(ctx, "validator.SetProposerSettings") + defer span.End() + if v.db == nil { return errors.New("db is not set") } @@ -1031,6 +1067,9 @@ func (v *validator) SetProposerSettings(ctx context.Context, settings *proposer. // PushProposerSettings calls the prepareBeaconProposer RPC to set the fee recipient and also the register validator API if using a custom builder. func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, deadline time.Time) error { + ctx, span := trace.StartSpan(ctx, "validator.PushProposerSettings") + defer span.End() + if km == nil { return errors.New("keymanager is nil when calling PrepareBeaconProposer") } @@ -1132,6 +1171,9 @@ func (v *validator) ChangeHost() { } func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fieldparams.BLSPubkeyLength]byte, slot primitives.Slot) ([][fieldparams.BLSPubkeyLength]byte, error) { + ctx, span := trace.StartSpan(ctx, "validator.filterAndCacheActiveKeys") + defer span.End() + filteredKeys := make([][fieldparams.BLSPubkeyLength]byte, 0) statusRequestKeys := make([][]byte, 0) for _, k := range pubkeys { @@ -1214,6 +1256,9 @@ func (v *validator) buildSignedRegReqs( activePubkeys [][fieldparams.BLSPubkeyLength]byte, signer iface.SigningFunc, ) []*ethpb.SignedValidatorRegistrationV1 { + ctx, span := trace.StartSpan(ctx, "validator.buildSignedRegReqs") + defer span.End() + var signedValRegRegs []*ethpb.SignedValidatorRegistrationV1 if v.ProposerSettings() == nil { return signedValRegRegs @@ -1297,6 +1342,9 @@ func (v *validator) buildSignedRegReqs( } func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool, error) { + ctx, span := trace.StartSpan(ctx, "validator.validatorIndex") + defer span.End() + resp, err := v.validatorClient.ValidatorIndex(ctx, ðpb.ValidatorIndexRequest{PublicKey: pubkey[:]}) switch { case status.Code(err) == codes.NotFound: @@ -1316,6 +1364,9 @@ func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSP } func (v *validator) aggregatedSelectionProofs(ctx context.Context, duties *ethpb.DutiesResponse) error { + ctx, span := trace.StartSpan(ctx, "validator.aggregatedSelectionProofs") + defer span.End() + // Create new instance of attestation selections map. v.newAttSelections() diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index f71b9580a9c9..d0ebbbfbdda2 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -2075,7 +2075,7 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { ctx := context.Background() client := validatormock.NewMockValidatorClient(ctrl) client.EXPECT().ValidatorIndex( - ctx, + gomock.Any(), ðpb.ValidatorIndexRequest{ PublicKey: pubkey2[:], }, @@ -2084,7 +2084,7 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { }, nil) client.EXPECT().ValidatorIndex( - ctx, + gomock.Any(), ðpb.ValidatorIndexRequest{ PublicKey: pubkey3[:], }, @@ -2210,7 +2210,7 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { client := validatormock.NewMockValidatorClient(ctrl) client.EXPECT().ValidatorIndex( - ctx, + gomock.Any(), ðpb.ValidatorIndexRequest{ PublicKey: pubkey2[:], }, @@ -2219,7 +2219,7 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { }, nil) client.EXPECT().ValidatorIndex( - ctx, + gomock.Any(), ðpb.ValidatorIndexRequest{ PublicKey: pubkey3[:], }, From 305d5850e764969c1a64bc1eedaee94459d375ff Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 20 Jun 2024 15:55:15 -0500 Subject: [PATCH 143/325] ssz: Move stateutil.SliceRoot to ssz package (#14123) --- beacon-chain/state/stateutil/BUILD.bazel | 1 - .../stateutil/historical_summaries_root.go | 3 +- .../pending_balance_deposits_root.go | 3 +- .../stateutil/pending_consolidations_root.go | 3 +- .../pending_partial_withdrawals_root.go | 3 +- encoding/ssz/BUILD.bazel | 1 + encoding/ssz/htrutils.go | 42 +------------------ .../stateutil => encoding/ssz}/slice_root.go | 10 ++--- 8 files changed, 15 insertions(+), 51 deletions(-) rename {beacon-chain/state/stateutil => encoding/ssz}/slice_root.go (75%) diff --git a/beacon-chain/state/stateutil/BUILD.bazel b/beacon-chain/state/stateutil/BUILD.bazel index 4480a560722a..05d2c998151a 100644 --- a/beacon-chain/state/stateutil/BUILD.bazel +++ b/beacon-chain/state/stateutil/BUILD.bazel @@ -16,7 +16,6 @@ go_library( "pending_consolidations_root.go", "pending_partial_withdrawals_root.go", "reference.go", - "slice_root.go", "sync_committee.root.go", "trie_helpers.go", "unrealized_justification.go", diff --git a/beacon-chain/state/stateutil/historical_summaries_root.go b/beacon-chain/state/stateutil/historical_summaries_root.go index 54497a4dcb28..d426352ba676 100644 --- a/beacon-chain/state/stateutil/historical_summaries_root.go +++ b/beacon-chain/state/stateutil/historical_summaries_root.go @@ -2,9 +2,10 @@ package stateutil import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) func HistoricalSummariesRoot(summaries []*ethpb.HistoricalSummary) ([32]byte, error) { - return SliceRoot(summaries, fieldparams.HistoricalRootsLength) + return ssz.SliceRoot(summaries, fieldparams.HistoricalRootsLength) } diff --git a/beacon-chain/state/stateutil/pending_balance_deposits_root.go b/beacon-chain/state/stateutil/pending_balance_deposits_root.go index e228c993dfd2..04d9b23f10b4 100644 --- a/beacon-chain/state/stateutil/pending_balance_deposits_root.go +++ b/beacon-chain/state/stateutil/pending_balance_deposits_root.go @@ -2,9 +2,10 @@ package stateutil import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) func PendingBalanceDepositsRoot(slice []*ethpb.PendingBalanceDeposit) ([32]byte, error) { - return SliceRoot(slice, fieldparams.PendingBalanceDepositsLimit) + return ssz.SliceRoot(slice, fieldparams.PendingBalanceDepositsLimit) } diff --git a/beacon-chain/state/stateutil/pending_consolidations_root.go b/beacon-chain/state/stateutil/pending_consolidations_root.go index 1c4026d079af..e5518a0162f2 100644 --- a/beacon-chain/state/stateutil/pending_consolidations_root.go +++ b/beacon-chain/state/stateutil/pending_consolidations_root.go @@ -2,9 +2,10 @@ package stateutil import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) func PendingConsolidationsRoot(slice []*ethpb.PendingConsolidation) ([32]byte, error) { - return SliceRoot(slice, fieldparams.PendingConsolidationsLimit) + return ssz.SliceRoot(slice, fieldparams.PendingConsolidationsLimit) } diff --git a/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go b/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go index e939b5c15655..5d61c21ee578 100644 --- a/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go +++ b/beacon-chain/state/stateutil/pending_partial_withdrawals_root.go @@ -2,9 +2,10 @@ package stateutil import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) func PendingPartialWithdrawalsRoot(slice []*ethpb.PendingPartialWithdrawal) ([32]byte, error) { - return SliceRoot(slice, fieldparams.PendingPartialWithdrawalsLimit) + return ssz.SliceRoot(slice, fieldparams.PendingPartialWithdrawalsLimit) } diff --git a/encoding/ssz/BUILD.bazel b/encoding/ssz/BUILD.bazel index 330a2658e760..90f31e0f4b2c 100644 --- a/encoding/ssz/BUILD.bazel +++ b/encoding/ssz/BUILD.bazel @@ -7,6 +7,7 @@ go_library( "helpers.go", "htrutils.go", "merkleize.go", + "slice_root.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/encoding/ssz", visibility = ["//visibility:public"], diff --git a/encoding/ssz/htrutils.go b/encoding/ssz/htrutils.go index 6d45520ef5d5..5441d1612aed 100644 --- a/encoding/ssz/htrutils.go +++ b/encoding/ssz/htrutils.go @@ -144,51 +144,13 @@ func WithdrawalSliceRoot(withdrawals []*enginev1.Withdrawal, limit uint64) ([32] // DepositRequestsSliceRoot computes the HTR of a slice of deposit receipts. // The limit parameter is used as input to the bitwise merkleization algorithm. func DepositRequestsSliceRoot(depositRequests []*enginev1.DepositRequest, limit uint64) ([32]byte, error) { - roots := make([][32]byte, len(depositRequests)) - for i := 0; i < len(depositRequests); i++ { - r, err := depositRequests[i].HashTreeRoot() - if err != nil { - return [32]byte{}, err - } - roots[i] = r - } - - bytesRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit) - if err != nil { - return [32]byte{}, errors.Wrap(err, "could not compute merkleization") - } - bytesRootBuf := new(bytes.Buffer) - if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(depositRequests))); err != nil { - return [32]byte{}, errors.Wrap(err, "could not marshal length") - } - bytesRootBufRoot := make([]byte, 32) - copy(bytesRootBufRoot, bytesRootBuf.Bytes()) - return MixInLength(bytesRoot, bytesRootBufRoot), nil + return SliceRoot(depositRequests, limit) } // WithdrawalRequestsSliceRoot computes the HTR of a slice of withdrawal requests from the EL. // The limit parameter is used as input to the bitwise merkleization algorithm. func WithdrawalRequestsSliceRoot(withdrawalRequests []*enginev1.WithdrawalRequest, limit uint64) ([32]byte, error) { - roots := make([][32]byte, len(withdrawalRequests)) - for i := 0; i < len(withdrawalRequests); i++ { - r, err := withdrawalRequests[i].HashTreeRoot() - if err != nil { - return [32]byte{}, err - } - roots[i] = r - } - - bytesRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit) - if err != nil { - return [32]byte{}, errors.Wrap(err, "could not compute merkleization") - } - bytesRootBuf := new(bytes.Buffer) - if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(withdrawalRequests))); err != nil { - return [32]byte{}, errors.Wrap(err, "could not marshal length") - } - bytesRootBufRoot := make([]byte, 32) - copy(bytesRootBufRoot, bytesRootBuf.Bytes()) - return MixInLength(bytesRoot, bytesRootBufRoot), nil + return SliceRoot(withdrawalRequests, limit) } // ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N] diff --git a/beacon-chain/state/stateutil/slice_root.go b/encoding/ssz/slice_root.go similarity index 75% rename from beacon-chain/state/stateutil/slice_root.go rename to encoding/ssz/slice_root.go index 236582296dcb..85575f03d33e 100644 --- a/beacon-chain/state/stateutil/slice_root.go +++ b/encoding/ssz/slice_root.go @@ -1,4 +1,4 @@ -package stateutil +package ssz import ( "bytes" @@ -6,11 +6,10 @@ import ( "fmt" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/encoding/ssz" ) // SliceRoot computes the root of a slice of hashable objects. -func SliceRoot[T ssz.Hashable](slice []T, limit uint64) ([32]byte, error) { +func SliceRoot[T Hashable](slice []T, limit uint64) ([32]byte, error) { max := limit if uint64(len(slice)) > max { return [32]byte{}, fmt.Errorf("slice exceeds max length %d", max) @@ -25,7 +24,7 @@ func SliceRoot[T ssz.Hashable](slice []T, limit uint64) ([32]byte, error) { roots[i] = r } - sliceRoot, err := ssz.BitwiseMerkleize(roots, uint64(len(roots)), limit) + sliceRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit) if err != nil { return [32]byte{}, errors.Wrap(err, "could not slice merkleization") } @@ -36,6 +35,5 @@ func SliceRoot[T ssz.Hashable](slice []T, limit uint64) ([32]byte, error) { // We need to mix in the length of the slice. sliceLenRoot := make([]byte, 32) copy(sliceLenRoot, sliceLenBuf.Bytes()) - res := ssz.MixInLength(sliceRoot, sliceLenRoot) - return res, nil + return MixInLength(sliceRoot, sliceLenRoot), nil } From 8cd249c1c8c6fc59e47b6121ad822d4c22b20203 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:33:54 -0500 Subject: [PATCH 144/325] update codegen dep and cleanup organization (#14127) Co-authored-by: Kasey Kirkham --- beacon-chain/node/BUILD.bazel | 1 - beacon-chain/node/config.go | 5 - beacon-chain/node/node.go | 2 - deps.bzl | 4 +- go.mod | 2 +- go.sum | 4 +- nogo_config.json | 4 +- proto/engine/v1/BUILD.bazel | 1 + .../v1/{generated.ssz.go => engine.ssz.go} | 234 +- proto/eth/v1/BUILD.bazel | 1 + .../v1/{generated.ssz.go => gateway.ssz.go} | 181 +- proto/eth/v2/BUILD.bazel | 1 + .../eth/v2/{generated.ssz.go => grpc.ssz.go} | 487 +- proto/prysm/v1alpha1/BUILD.bazel | 286 +- proto/prysm/v1alpha1/altair.ssz.go | 2143 ++ proto/prysm/v1alpha1/bellatrix.ssz.go | 2330 ++ proto/prysm/v1alpha1/capella.ssz.go | 2904 +++ proto/prysm/v1alpha1/deneb.ssz.go | 3595 +++ proto/prysm/v1alpha1/electra.ssz.go | 3964 +++ proto/prysm/v1alpha1/generated.ssz.go | 20713 ---------------- proto/prysm/v1alpha1/non-core.ssz.go | 780 + proto/prysm/v1alpha1/phase0.ssz.go | 4048 +++ tools/ssz.bzl | 6 +- validator/node/BUILD.bazel | 1 - validator/node/node.go | 7 - 25 files changed, 20153 insertions(+), 21551 deletions(-) rename proto/engine/v1/{generated.ssz.go => engine.ssz.go} (94%) rename proto/eth/v1/{generated.ssz.go => gateway.ssz.go} (94%) rename proto/eth/v2/{generated.ssz.go => grpc.ssz.go} (93%) create mode 100644 proto/prysm/v1alpha1/altair.ssz.go create mode 100644 proto/prysm/v1alpha1/bellatrix.ssz.go create mode 100644 proto/prysm/v1alpha1/capella.ssz.go create mode 100644 proto/prysm/v1alpha1/deneb.ssz.go create mode 100644 proto/prysm/v1alpha1/electra.ssz.go delete mode 100644 proto/prysm/v1alpha1/generated.ssz.go create mode 100644 proto/prysm/v1alpha1/non-core.ssz.go create mode 100644 proto/prysm/v1alpha1/phase0.ssz.go diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 8fe6c4b29d85..883a6078fd38 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -69,7 +69,6 @@ go_library( "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", - "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", ], diff --git a/beacon-chain/node/config.go b/beacon-chain/node/config.go index e026c940bb6a..bb2aa2de1049 100644 --- a/beacon-chain/node/config.go +++ b/beacon-chain/node/config.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" - fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -197,7 +196,3 @@ func configureExecutionSetting(cliCtx *cli.Context) error { " Default fee recipient will be used as a fall back", checksumAddress.Hex()) return params.SetActive(c) } - -func configureFastSSZHashingAlgorithm() { - fastssz.EnableVectorizedHTR = true -} diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 473868b82bd2..e965d9956b99 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -277,8 +277,6 @@ func configureBeacon(cliCtx *cli.Context) error { return errors.Wrap(err, "could not configure execution setting") } - configureFastSSZHashingAlgorithm() - return nil } diff --git a/deps.bzl b/deps.bzl index 94d1f3696127..4166f23681c4 100644 --- a/deps.bzl +++ b/deps.bzl @@ -2973,8 +2973,8 @@ def prysm_deps(): go_repository( name = "com_github_prysmaticlabs_fastssz", importpath = "github.com/prysmaticlabs/fastssz", - sum = "h1:c3p3UzV4vFA7xaCDphnDWOjpxcadrQ26l5b+ypsvyxo=", - version = "v0.0.0-20221107182844-78142813af44", + sum = "h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk=", + version = "v0.0.0-20240620202422-a981b8ef89d3", ) go_repository( name = "com_github_prysmaticlabs_go_bitfield", diff --git a/go.mod b/go.mod index 424111bbfe1d..14285f7f03a7 100644 --- a/go.mod +++ b/go.mod @@ -65,7 +65,7 @@ require ( github.com/prometheus/client_golang v1.19.1 github.com/prometheus/client_model v0.6.1 github.com/prometheus/prom2json v1.3.0 - github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 + github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 diff --git a/go.sum b/go.sum index 681f95855c84..a91032596541 100644 --- a/go.sum +++ b/go.sum @@ -966,8 +966,8 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 h1:c3p3UzV4vFA7xaCDphnDWOjpxcadrQ26l5b+ypsvyxo= -github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44/go.mod h1:MA5zShstUwCQaE9faGHgCGvEWUbG87p4SAXINhmCkvg= +github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk= +github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2OlIZD/M6wFvV3YMZbW16lFgh3Rsye00G44J2cwLyU= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= diff --git a/nogo_config.json b/nogo_config.json index c6bc6fe85d55..5902a89ae109 100644 --- a/nogo_config.json +++ b/nogo_config.json @@ -152,7 +152,7 @@ "external/.*": "Third party code", "rules_go_work-.*": "Third party code", ".*\\.pb.*.go": "Generated code is ok", - ".*generated\\.ssz\\.go": "Generated code is ok" + ".*\\.ssz\\.go": "Generated code is ok" } }, "properpermissions": { @@ -180,7 +180,7 @@ "external/.*": "Third party code", "rules_go_work-.*": "Third party code", ".*\\.pb.*.go": "Generated code is ok", - ".*generated\\.ssz\\.go": "Generated code is ok", + ".*\\.ssz\\.go": "Generated code is ok", ".*_test\\.go": "Tests are ok (for now)", "tools/analyzers/ineffassign/ineffassign\\.go": "3rd party code with a massive switch statement" } diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index 7a3b428d0747..af0a37c8e97f 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -31,6 +31,7 @@ proto_library( ssz_gen_marshal( name = "ssz_generated_files", go_proto = ":go_proto", + out = "engine.ssz.go", includes = [ "//consensus-types/primitives:go_default_library", ], diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/engine.ssz.go similarity index 94% rename from proto/engine/v1/generated.ssz.go rename to proto/engine/v1/engine.ssz.go index 5cc66b88da2b..8733bbdd88ec 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/engine.ssz.go @@ -190,7 +190,7 @@ func (e *ExecutionPayload) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 508 { + if o10 != 508 { return ssz.ErrInvalidVariableOffset } @@ -336,11 +336,7 @@ func (e *ExecutionPayload) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -374,25 +370,13 @@ func (e *ExecutionPayload) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.AppendBytes32(elem) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1048576) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1048576) - } + hh.MerkleizeWithMixin(subIndx, num, 1048576) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -594,7 +578,7 @@ func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 512 { + if o10 != 512 { return ssz.ErrInvalidVariableOffset } @@ -766,11 +750,7 @@ func (e *ExecutionPayloadCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -804,18 +784,10 @@ func (e *ExecutionPayloadCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.AppendBytes32(elem) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1048576) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1048576) - } + hh.MerkleizeWithMixin(subIndx, num, 1048576) } // Field (14) 'Withdrawals' @@ -831,18 +803,10 @@ func (e *ExecutionPayloadCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1050,7 +1014,7 @@ func (e *ExecutionPayloadDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 528 { + if o10 != 528 { return ssz.ErrInvalidVariableOffset } @@ -1228,11 +1192,7 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -1266,18 +1226,10 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.AppendBytes32(elem) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1048576) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1048576) - } + hh.MerkleizeWithMixin(subIndx, num, 1048576) } // Field (14) 'Withdrawals' @@ -1293,11 +1245,7 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (15) 'BlobGasUsed' @@ -1306,11 +1254,7 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (16) 'ExcessBlobGas' hh.PutUint64(e.ExcessBlobGas) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1548,7 +1492,7 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 536 { + if o10 != 536 { return ssz.ErrInvalidVariableOffset } @@ -1778,11 +1722,7 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -1816,18 +1756,10 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.AppendBytes32(elem) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1048576) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1048576) - } + hh.MerkleizeWithMixin(subIndx, num, 1048576) } // Field (14) 'Withdrawals' @@ -1843,11 +1775,7 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (15) 'BlobGasUsed' @@ -1869,11 +1797,7 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8192) - } else { - hh.MerkleizeWithMixin(subIndx, num, 8192) - } + hh.MerkleizeWithMixin(subIndx, num, 8192) } // Field (18) 'WithdrawalRequests' @@ -1889,18 +1813,10 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2067,7 +1983,7 @@ func (e *ExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 536 { + if o10 != 536 { return ssz.ErrInvalidVariableOffset } @@ -2185,11 +2101,7 @@ func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -2213,11 +2125,7 @@ func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(e.TransactionsRoot) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2391,7 +2299,7 @@ func (e *ExecutionPayloadHeaderCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 568 { + if o10 != 568 { return ssz.ErrInvalidVariableOffset } @@ -2515,11 +2423,7 @@ func (e *ExecutionPayloadHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -2550,11 +2454,7 @@ func (e *ExecutionPayloadHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err er } hh.PutBytes(e.WithdrawalsRoot) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2734,7 +2634,7 @@ func (e *ExecutionPayloadHeaderDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 584 { + if o10 != 584 { return ssz.ErrInvalidVariableOffset } @@ -2864,11 +2764,7 @@ func (e *ExecutionPayloadHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -2905,11 +2801,7 @@ func (e *ExecutionPayloadHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro // Field (16) 'ExcessBlobGas' hh.PutUint64(e.ExcessBlobGas) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3103,7 +2995,7 @@ func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 < 648 { + if o10 != 648 { return ssz.ErrInvalidVariableOffset } @@ -3245,11 +3137,7 @@ func (e *ExecutionPayloadHeaderElectra) HashTreeRootWith(hh *ssz.Hasher) (err er return } hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) } // Field (11) 'BaseFeePerGas' @@ -3300,11 +3188,7 @@ func (e *ExecutionPayloadHeaderElectra) HashTreeRootWith(hh *ssz.Hasher) (err er } hh.PutBytes(e.WithdrawalRequestsRoot) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3393,11 +3277,7 @@ func (w *Withdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (3) 'Amount' hh.PutUint64(w.Amount) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3481,7 +3361,7 @@ func (b *BlobsBundle) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 12 { + if o0 != 12 { return ssz.ErrInvalidVariableOffset } @@ -3586,11 +3466,7 @@ func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { } numItems := uint64(len(b.KzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } // Field (1) 'Proofs' @@ -3609,11 +3485,7 @@ func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { } numItems := uint64(len(b.Proofs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } // Field (2) 'Blobs' @@ -3632,18 +3504,10 @@ func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { } numItems := uint64(len(b.Blobs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3734,11 +3598,7 @@ func (w *WithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (2) 'Amount' hh.PutUint64(w.Amount) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3858,10 +3718,6 @@ func (d *DepositRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (4) 'Index' hh.PutUint64(d.Index) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } diff --git a/proto/eth/v1/BUILD.bazel b/proto/eth/v1/BUILD.bazel index 8db674d4cfb0..670f614a9ba9 100644 --- a/proto/eth/v1/BUILD.bazel +++ b/proto/eth/v1/BUILD.bazel @@ -35,6 +35,7 @@ load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal") ssz_gen_marshal( name = "ssz_generated_files", go_proto = ":go_proto", + out = "gateway.ssz.go", includes = [ "//consensus-types/primitives:go_default_library", "//proto/engine/v1:go_default_library", diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/gateway.ssz.go similarity index 94% rename from proto/eth/v1/generated.ssz.go rename to proto/eth/v1/gateway.ssz.go index 382eee9836b5..a98bc8044622 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/gateway.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: d06a72227c2f5e350916cce3e89f4e855135a2a22f6ea263dedc68fa506c1ba7 +// Hash: 2874e1dadeb47411763f48fe31e5daaa91ac663e796933d9a508c2e7be94fa5e package v1 import ( @@ -62,7 +62,7 @@ func (a *Attestation) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 228 { + if o0 != 228 { return ssz.ErrInvalidVariableOffset } @@ -132,11 +132,7 @@ func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(a.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -194,7 +190,7 @@ func (a *AggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o1 < 108 { + if o1 != 108 { return ssz.ErrInvalidVariableOffset } @@ -254,11 +250,7 @@ func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err err } hh.PutBytes(a.SelectionProof) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -310,7 +302,7 @@ func (s *SignedAggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -367,11 +359,7 @@ func (s *SignedAggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (e } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -493,11 +481,7 @@ func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -568,11 +552,7 @@ func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(c.Root) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -655,7 +635,7 @@ func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -719,11 +699,7 @@ func (b *BeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -775,7 +751,7 @@ func (s *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -832,11 +808,7 @@ func (s *SignedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1006,7 +978,7 @@ func (b *BeaconBlockBody) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 220 { + if o3 != 220 { return ssz.ErrInvalidVariableOffset } @@ -1199,11 +1171,7 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -1219,11 +1187,7 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -1239,11 +1203,7 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -1259,11 +1219,7 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -1279,18 +1235,10 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1374,11 +1322,7 @@ func (p *ProposerSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1435,7 +1379,7 @@ func (a *AttesterSlashing) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 8 { + if o0 != 8 { return ssz.ErrInvalidVariableOffset } @@ -1506,11 +1450,7 @@ func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1604,12 +1544,7 @@ func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.Append(i) } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } + hh.Merkleize(subIndx) } // Field (1) 'Data' @@ -1617,11 +1552,7 @@ func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1681,11 +1612,7 @@ func (v *VoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (1) 'ValidatorIndex' hh.PutUint64(uint64(v.ValidatorIndex)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1768,11 +1695,7 @@ func (s *SignedVoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1863,11 +1786,7 @@ func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(e.BlockHash) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1987,11 +1906,7 @@ func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(b.BodyRoot) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2074,11 +1989,7 @@ func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2139,7 +2050,7 @@ func (i *IndexedAttestation) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 228 { + if o0 != 228 { return ssz.ErrInvalidVariableOffset } @@ -2204,11 +2115,7 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.FillUpTo32() numItems := uint64(len(i.AttestingIndices)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) - } + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) } // Field (1) 'Data' @@ -2223,11 +2130,7 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(i.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2309,11 +2212,7 @@ func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.SyncCommitteeSignature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2424,11 +2323,7 @@ func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(d.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2564,10 +2459,6 @@ func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (7) 'WithdrawableEpoch' hh.PutUint64(uint64(v.WithdrawableEpoch)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } diff --git a/proto/eth/v2/BUILD.bazel b/proto/eth/v2/BUILD.bazel index 70099df14b76..f5a6728a6e9f 100644 --- a/proto/eth/v2/BUILD.bazel +++ b/proto/eth/v2/BUILD.bazel @@ -31,6 +31,7 @@ load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal") ssz_gen_marshal( name = "ssz_generated_files", go_proto = ":go_proto", + out = "grpc.ssz.go", includes = [ "//consensus-types/primitives:go_default_library", "//proto/engine/v1:go_default_library", diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/grpc.ssz.go similarity index 93% rename from proto/eth/v2/generated.ssz.go rename to proto/eth/v2/grpc.ssz.go index b39ba7517120..3ccde83580b6 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/grpc.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 0394f3a965a034ef0de1398e168f3971f32a9ccce9db6549dd6e6d258c11c89b +// Hash: 6f33097dd41d3dd49d35b7cfceef5a1afca20f05d65b18215748b459db16f99b package eth import ( @@ -57,7 +57,7 @@ func (s *SignedBeaconBlockAltair) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -114,11 +114,7 @@ func (s *SignedBeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -170,7 +166,7 @@ func (s *SignedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -227,11 +223,7 @@ func (s *SignedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -283,7 +275,7 @@ func (s *SignedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -340,11 +332,7 @@ func (s *SignedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -396,7 +384,7 @@ func (s *SignedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -453,11 +441,7 @@ func (s *SignedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -509,7 +493,7 @@ func (s *SignedBlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -566,11 +550,7 @@ func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (er } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -622,7 +602,7 @@ func (s *SignedBlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -679,11 +659,7 @@ func (s *SignedBlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -735,7 +711,7 @@ func (s *SignedBlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -792,11 +768,7 @@ func (s *SignedBlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err er } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -879,7 +851,7 @@ func (b *BeaconBlockAltair) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -943,11 +915,7 @@ func (b *BeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1030,7 +998,7 @@ func (b *BeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -1094,11 +1062,7 @@ func (b *BeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1181,7 +1145,7 @@ func (b *BlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -1245,11 +1209,7 @@ func (b *BlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err erro return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1332,7 +1292,7 @@ func (b *BeaconBlockCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -1396,11 +1356,7 @@ func (b *BeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1483,7 +1439,7 @@ func (b *BlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -1547,11 +1503,7 @@ func (b *BlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1634,7 +1586,7 @@ func (b *BeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -1698,11 +1650,7 @@ func (b *BeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1785,7 +1733,7 @@ func (b *BlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o4 < 84 { + if o4 != 84 { return ssz.ErrInvalidVariableOffset } @@ -1849,11 +1797,7 @@ func (b *BlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2031,7 +1975,7 @@ func (b *BeaconBlockBodyAltair) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 380 { + if o3 != 380 { return ssz.ErrInvalidVariableOffset } @@ -2232,11 +2176,7 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -2252,11 +2192,7 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -2272,11 +2208,7 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -2292,11 +2224,7 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -2312,11 +2240,7 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -2324,11 +2248,7 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -2518,7 +2438,7 @@ func (b *BeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 384 { + if o3 != 384 { return ssz.ErrInvalidVariableOffset } @@ -2741,11 +2661,7 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -2761,11 +2677,7 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -2781,11 +2693,7 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -2801,11 +2709,7 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -2821,11 +2725,7 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -2838,11 +2738,7 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3032,7 +2928,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 384 { + if o3 != 384 { return ssz.ErrInvalidVariableOffset } @@ -3255,11 +3151,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -3275,11 +3167,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -3295,11 +3183,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -3315,11 +3199,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -3335,11 +3215,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -3352,11 +3228,7 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err return } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -3561,7 +3433,7 @@ func (b *BeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 388 { + if o3 != 388 { return ssz.ErrInvalidVariableOffset } @@ -3810,11 +3682,7 @@ func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -3830,11 +3698,7 @@ func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -3850,11 +3714,7 @@ func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -3870,11 +3730,7 @@ func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -3890,11 +3746,7 @@ func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -3920,18 +3772,10 @@ func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -4136,7 +3980,7 @@ func (b *BlindedBeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 388 { + if o3 != 388 { return ssz.ErrInvalidVariableOffset } @@ -4385,11 +4229,7 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -4405,11 +4245,7 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -4425,11 +4261,7 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -4445,11 +4277,7 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -4465,11 +4293,7 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -4495,18 +4319,10 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -4728,7 +4544,7 @@ func (b *BlindedBeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 392 { + if o3 != 392 { return ssz.ErrInvalidVariableOffset } @@ -5001,11 +4817,7 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -5021,11 +4833,7 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -5041,11 +4849,7 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -5061,11 +4865,7 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -5081,11 +4881,7 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -5111,11 +4907,7 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (11) 'BlobKzgCommitments' @@ -5134,18 +4926,10 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro } numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -5367,7 +5151,7 @@ func (b *BeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 < 392 { + if o3 != 392 { return ssz.ErrInvalidVariableOffset } @@ -5640,11 +5424,7 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' @@ -5660,11 +5440,7 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } + hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' @@ -5680,11 +5456,7 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } + hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' @@ -5700,11 +5472,7 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' @@ -5720,11 +5488,7 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' @@ -5750,11 +5514,7 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } + hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (11) 'BlobKzgCommitments' @@ -5773,18 +5533,10 @@ func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { } numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -5863,7 +5615,7 @@ func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 12 { + if o0 != 12 { return ssz.ErrInvalidVariableOffset } @@ -5971,11 +5723,7 @@ func (s *SignedBeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err e } numItems := uint64(len(s.KzgProofs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } // Field (2) 'Blobs' @@ -5994,18 +5742,10 @@ func (s *SignedBeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err e } numItems := uint64(len(s.Blobs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -6084,7 +5824,7 @@ func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 12 { + if o0 != 12 { return ssz.ErrInvalidVariableOffset } @@ -6192,11 +5932,7 @@ func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) } numItems := uint64(len(b.KzgProofs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } // Field (2) 'Blobs' @@ -6215,18 +5951,10 @@ func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) } numItems := uint64(len(b.Blobs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -6297,11 +6025,7 @@ func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (1) 'Index' hh.PutUint64(b.Index) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -6392,12 +6116,7 @@ func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(i) } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } + hh.Merkleize(subIndx) } // Field (1) 'AggregatePubkey' @@ -6407,11 +6126,7 @@ func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(s.AggregatePubkey) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -6502,11 +6217,7 @@ func (b *BLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) { } hh.PutBytes(b.ToExecutionAddress) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -6589,10 +6300,6 @@ func (s *SignedBLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 02c496eabb5e..2b6e52ff9250 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -45,111 +45,211 @@ proto_library( ############################################################################## # Go ############################################################################## + +ssz_phase0_objs = [ + "AggregateAttestationAndProof", + "Attestation", + "AttestationData", + "AttesterSlashing", + "BeaconBlock", + "BeaconBlockHeader", + "BeaconState", + "Checkpoint", + "Deposit", + "Deposit_Data", + "DepositMessage", + "ENRForkID", + "Eth1Data", + "Fork", + "ForkData", + "HistoricalBatch", + "IndexedAttestation", + "PowBlock", + "ProposerSlashing", + "SignedAggregateAttestationAndProof", + "SignedBeaconBlock", + "SignedBeaconBlockHeader", + "SignedVoluntaryExit", + "SigningData", + "Status", + "Status", + "Validator", + "VoluntaryExit", +] + +ssz_altair_objs = [ + "BeaconBlockAltair", + "BeaconBlockBodyAltair", + "BeaconStateAltair", + "ContributionAndProof", + "SignedBeaconBlockAltair", + "SignedContributionAndProof", + "SyncAggregate", + "SyncAggregate", + "SyncAggregatorSelectionData", + "SyncCommittee", + "SyncCommitteeContribution", + "SyncCommitteeMessage", +] + +ssz_bellatrix_objs = [ + "BeaconBlockBellatrix", + "BeaconBlockBodyBellatrix", + "BeaconStateBellatrix", + "BlindedBeaconBlockBellatrix", + "BlindedBeaconBlockBodyBellatrix", + "SignedBeaconBlockBellatrix", + "SignedBlindedBeaconBlockBellatrix", +] + +ssz_capella_objs = [ + "BLSToExecutionChange", + "BeaconBlockBodyCapella", + "BeaconBlockCapella", + "BeaconStateCapella", + "BlindedBeaconBlockBodyCapella", + "BlindedBeaconBlockCapella", + "BuilderBidCapella", + "HistoricalSummary", + "SignedBLSToExecutionChange", + "SignedBeaconBlockCapella", + "SignedBlindedBeaconBlockCapella", + "Withdrawal", +] + +ssz_deneb_objs = [ + "BeaconBlockBodyDeneb", + "BeaconBlockContentsDeneb", + "BeaconBlockDeneb", + "BeaconStateDeneb", + "BlindedBeaconBlockBodyDeneb", + "BlindedBeaconBlockDeneb", + "BlobIdentifier", + "BlobSidecar", + "BlobSidecars", + "BuilderBidDeneb", + "SignedBeaconBlockContentsDeneb", + "SignedBeaconBlockDeneb", + "SignedBlindedBeaconBlockDeneb", +] + +ssz_electra_objs = [ + "AggregateAttestationAndProofElectra", + "AttestationElectra", + "AttesterSlashingElectra", + "BeaconBlockElectra", + "BeaconBlockElectra", + "BeaconStateElectra", + "BlindedBeaconBlockBodyElectra", + "BlindedBeaconBlockElectra", + "Consolidation", + "IndexedAttestationElectra", + "PendingBalanceDeposit", + "PendingBalanceDeposits", + "PendingConsolidation", + "PendingPartialWithdrawal", + "SignedAggregateAttestationAndProofElectra", + "SignedBeaconBlockElectra", + "SignedBlindedBeaconBlockElectra", + "SignedConsolidation", +] + +ssz_gen_marshal( + name = "ssz_generated_phase0", + go_proto = ":go_proto", + out = "phase0.ssz.go", + includes = [ + "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", + "//math:go_default_library", + ], + objs = ssz_phase0_objs, +) + +ssz_gen_marshal( + name = "ssz_generated_altair", + go_proto = ":go_proto", + out = "altair.ssz.go", + includes = [ + "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", + "//math:go_default_library", + ], + objs = ssz_altair_objs, + exclude_objs = ssz_phase0_objs, +) + +ssz_gen_marshal( + name = "ssz_generated_bellatrix", + go_proto = ":go_proto", + out = "bellatrix.ssz.go", + includes = [ + "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", + "//math:go_default_library", + ], + objs = ssz_bellatrix_objs, + exclude_objs = ssz_phase0_objs + ssz_altair_objs, +) + +ssz_gen_marshal( + name = "ssz_generated_capella", + go_proto = ":go_proto", + out = "capella.ssz.go", + includes = [ + "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", + "//math:go_default_library", + ], + objs = ssz_capella_objs, + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs, +) + +ssz_gen_marshal( + name = "ssz_generated_deneb", + go_proto = ":go_proto", + out = "deneb.ssz.go", + includes = [ + "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", + "//math:go_default_library", + ], + objs = ssz_deneb_objs, + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs, +) + +ssz_gen_marshal( + name = "ssz_generated_electra", + go_proto = ":go_proto", + out = "electra.ssz.go", + includes = [ + "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", + "//math:go_default_library", + ], + objs = ssz_electra_objs, + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs + ssz_deneb_objs, +) + + ssz_gen_marshal( - name = "ssz_generated_files", + name = "ssz_generated_non_core", go_proto = ":go_proto", + out = "non-core.ssz.go", includes = [ "//consensus-types/primitives:go_default_library", "//proto/engine/v1:go_default_library", "//math:go_default_library", ], objs = [ - "BeaconBlockAltair", - "BeaconBlockBodyAltair", - "SignedBeaconBlockAltair", - "BeaconBlockBellatrix", - "BeaconBlockBodyBellatrix", - "SignedBeaconBlockBellatrix", - "SignedBlindedBeaconBlockBellatrix", - "BlindedBeaconBlockBellatrix", - "BlindedBeaconBlockBodyBellatrix", - "BeaconBlockCapella", - "BeaconBlockBodyCapella", - "SignedBeaconBlockCapella", - "BeaconBlockDeneb", - "BeaconBlockBodyDeneb", - "SignedBeaconBlockDeneb", - "BeaconBlockElectra", - "BeaconBlockElectra", - "SignedBeaconBlockElectra", - "SignedBlindedBeaconBlockCapella", - "BlindedBeaconBlockCapella", - "BlindedBeaconBlockBodyCapella", - "SignedBlindedBeaconBlockDeneb", - "BeaconBlockContentsDeneb", - "SignedBeaconBlockContentsDeneb", - "BlindedBeaconBlockDeneb", - "BlindedBeaconBlockBodyDeneb", - "SignedBlindedBeaconBlockElectra", - "BlindedBeaconBlockElectra", - "BlindedBeaconBlockBodyElectra", - "SyncAggregate", - "SyncCommitteeMessage", - "SyncCommitteeContribution", - "ContributionAndProof", - "SignedContributionAndProof", "BeaconBlocksByRangeRequest", "BlobSidecarsByRangeRequest", - "ENRForkID", "MetaDataV0", "MetaDataV1", - "Status", - "AggregateAttestationAndProof", - "AggregateAttestationAndProofElectra", - "Attestation", - "AttestationElectra", - "AttestationData", - "AttesterSlashing", - "AttesterSlashingElectra", - "BeaconBlock", - "BeaconBlockHeader", - "Checkpoint", - "Deposit", - "Eth1Data", - "IndexedAttestation", - "IndexedAttestationElectra", - "ProposerSlashing", - "SignedAggregateAttestationAndProof", - "SignedAggregateAttestationAndProofElectra", - "SignedBeaconBlock", - "SignedBeaconBlockHeader", - "SignedVoluntaryExit", - "Validator", - "VoluntaryExit", - "ContributionAndProof", - "SignedContributionAndProof", - "DepositMessage", - "Fork", - "ForkData", - "HistoricalBatch", - "Status", - "BeaconState", - "BeaconStateAltair", - "BeaconStateBellatrix", - "BeaconStateCapella", - "BeaconStateDeneb", - "BeaconStateElectra", - "SigningData", - "SyncCommittee", - "SyncAggregatorSelectionData", - "PowBlock", "SignedValidatorRegistrationV1", "ValidatorRegistrationV1", - "Withdrawal", - "BLSToExecutionChange", - "SignedBLSToExecutionChange", "BuilderBid", - "BuilderBidCapella", - "BuilderBidDeneb", - "BlobSidecar", - "BlobSidecars", - "BlobIdentifier", "DepositSnapshot", - "PendingBalanceDeposit", - "PendingPartialWithdrawal", - "Consolidation", - "SignedConsolidation", - "PendingConsolidation", ], ) @@ -212,7 +312,13 @@ go_library( "eip_7251.go", "sync_committee_mainnet.go", "sync_committee_minimal.go", # keep - ":ssz_generated_files", # keep + ":ssz_generated_non_core", # keep + ":ssz_generated_phase0", # keep + ":ssz_generated_altair", # keep + ":ssz_generated_bellatrix", # keep + ":ssz_generated_capella", # keep + ":ssz_generated_deneb", # keep + ":ssz_generated_electra", # keep ], embed = [ ":go_grpc_gateway_library", diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go new file mode 100644 index 000000000000..80e4658f00fe --- /dev/null +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -0,0 +1,2143 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: b49bce5f5d950b8c4ff7cad0c5c96bef67f82b91e1f36b2293b1b00e9755c051 +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) + +// MarshalSSZ ssz marshals the BeaconBlockAltair object +func (b *BeaconBlockAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockAltair object to a target array +func (b *BeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BeaconBlockBodyAltair) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockAltair object +func (b *BeaconBlockAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBodyAltair) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockAltair object +func (b *BeaconBlockAltair) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyAltair) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockAltair object +func (b *BeaconBlockAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockAltair object with a hasher +func (b *BeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBeaconBlockAltair object +func (s *SignedBeaconBlockAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockAltair object to a target array +func (s *SignedBeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockAltair) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockAltair object +func (s *SignedBeaconBlockAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockAltair) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockAltair object +func (s *SignedBeaconBlockAltair) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockAltair) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockAltair object +func (s *SignedBeaconBlockAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockAltair object with a hasher +func (s *SignedBeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBodyAltair object +func (b *BeaconBlockBodyAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBodyAltair object to a target array +func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(380) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyAltair object +func (b *BeaconBlockBodyAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 380 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 380 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyAltair object +func (b *BeaconBlockBodyAltair) SizeSSZ() (size int) { + size = 380 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBodyAltair object +func (b *BeaconBlockBodyAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBodyAltair object with a hasher +func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SyncAggregate object +func (s *SyncAggregate) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncAggregate object to a target array +func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SyncCommitteeBits' + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) + return + } + dst = append(dst, s.SyncCommitteeBits...) + + // Field (1) 'SyncCommitteeSignature' + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) + return + } + dst = append(dst, s.SyncCommitteeSignature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncAggregate object +func (s *SyncAggregate) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 160 { + return ssz.ErrSize + } + + // Field (0) 'SyncCommitteeBits' + if cap(s.SyncCommitteeBits) == 0 { + s.SyncCommitteeBits = make([]byte, 0, len(buf[0:64])) + } + s.SyncCommitteeBits = append(s.SyncCommitteeBits, buf[0:64]...) + + // Field (1) 'SyncCommitteeSignature' + if cap(s.SyncCommitteeSignature) == 0 { + s.SyncCommitteeSignature = make([]byte, 0, len(buf[64:160])) + } + s.SyncCommitteeSignature = append(s.SyncCommitteeSignature, buf[64:160]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregate object +func (s *SyncAggregate) SizeSSZ() (size int) { + size = 160 + return +} + +// HashTreeRoot ssz hashes the SyncAggregate object +func (s *SyncAggregate) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncAggregate object with a hasher +func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SyncCommitteeBits' + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) + return + } + hh.PutBytes(s.SyncCommitteeBits) + + // Field (1) 'SyncCommitteeSignature' + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) + return + } + hh.PutBytes(s.SyncCommitteeSignature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconStateAltair object +func (b *BeaconStateAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateAltair object to a target array +func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736629) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateAltair object +func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736629 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2736629 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateAltair object +func (b *BeaconStateAltair) SizeSSZ() (size int) { + size = 2736629 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + return +} + +// HashTreeRoot ssz hashes the BeaconStateAltair object +func (b *BeaconStateAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateAltair object with a hasher +func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SyncCommittee object +func (s *SyncCommittee) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncCommittee object to a target array +func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Pubkeys' + if size := len(s.Pubkeys); size != 512 { + err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) + return + } + for ii := 0; ii < 512; ii++ { + if size := len(s.Pubkeys[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48) + return + } + dst = append(dst, s.Pubkeys[ii]...) + } + + // Field (1) 'AggregatePubkey' + if size := len(s.AggregatePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) + return + } + dst = append(dst, s.AggregatePubkey...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncCommittee object +func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24624 { + return ssz.ErrSize + } + + // Field (0) 'Pubkeys' + s.Pubkeys = make([][]byte, 512) + for ii := 0; ii < 512; ii++ { + if cap(s.Pubkeys[ii]) == 0 { + s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48])) + } + s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...) + } + + // Field (1) 'AggregatePubkey' + if cap(s.AggregatePubkey) == 0 { + s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624])) + } + s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object +func (s *SyncCommittee) SizeSSZ() (size int) { + size = 24624 + return +} + +// HashTreeRoot ssz hashes the SyncCommittee object +func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncCommittee object with a hasher +func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Pubkeys' + { + if size := len(s.Pubkeys); size != 512 { + err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) + return + } + subIndx := hh.Index() + for _, i := range s.Pubkeys { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + hh.Merkleize(subIndx) + } + + // Field (1) 'AggregatePubkey' + if size := len(s.AggregatePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) + return + } + hh.PutBytes(s.AggregatePubkey) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncAggregatorSelectionData object to a target array +func (s *SyncAggregatorSelectionData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(s.Slot)) + + // Field (1) 'SubcommitteeIndex' + dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'Slot' + s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'SubcommitteeIndex' + s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[8:16]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the SyncAggregatorSelectionData object +func (s *SyncAggregatorSelectionData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncAggregatorSelectionData object with a hasher +func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(s.Slot)) + + // Field (1) 'SubcommitteeIndex' + hh.PutUint64(s.SubcommitteeIndex) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SyncCommitteeMessage object +func (s *SyncCommitteeMessage) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncCommitteeMessage object to a target array +func (s *SyncCommitteeMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(s.Slot)) + + // Field (1) 'BlockRoot' + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + dst = append(dst, s.BlockRoot...) + + // Field (2) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(s.ValidatorIndex)) + + // Field (3) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncCommitteeMessage object +func (s *SyncCommitteeMessage) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 144 { + return ssz.ErrSize + } + + // Field (0) 'Slot' + s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'BlockRoot' + if cap(s.BlockRoot) == 0 { + s.BlockRoot = make([]byte, 0, len(buf[8:40])) + } + s.BlockRoot = append(s.BlockRoot, buf[8:40]...) + + // Field (2) 'ValidatorIndex' + s.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[48:144])) + } + s.Signature = append(s.Signature, buf[48:144]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncCommitteeMessage object +func (s *SyncCommitteeMessage) SizeSSZ() (size int) { + size = 144 + return +} + +// HashTreeRoot ssz hashes the SyncCommitteeMessage object +func (s *SyncCommitteeMessage) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncCommitteeMessage object with a hasher +func (s *SyncCommitteeMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(s.Slot)) + + // Field (1) 'BlockRoot' + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + hh.PutBytes(s.BlockRoot) + + // Field (2) 'ValidatorIndex' + hh.PutUint64(uint64(s.ValidatorIndex)) + + // Field (3) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SyncCommitteeContribution object +func (s *SyncCommitteeContribution) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SyncCommitteeContribution object to a target array +func (s *SyncCommitteeContribution) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(s.Slot)) + + // Field (1) 'BlockRoot' + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + dst = append(dst, s.BlockRoot...) + + // Field (2) 'SubcommitteeIndex' + dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) + + // Field (3) 'AggregationBits' + if size := len(s.AggregationBits); size != 16 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) + return + } + dst = append(dst, s.AggregationBits...) + + // Field (4) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SyncCommitteeContribution object +func (s *SyncCommitteeContribution) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 160 { + return ssz.ErrSize + } + + // Field (0) 'Slot' + s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'BlockRoot' + if cap(s.BlockRoot) == 0 { + s.BlockRoot = make([]byte, 0, len(buf[8:40])) + } + s.BlockRoot = append(s.BlockRoot, buf[8:40]...) + + // Field (2) 'SubcommitteeIndex' + s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[40:48]) + + // Field (3) 'AggregationBits' + if cap(s.AggregationBits) == 0 { + s.AggregationBits = make([]byte, 0, len(buf[48:64])) + } + s.AggregationBits = append(s.AggregationBits, buf[48:64]...) + + // Field (4) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[64:160])) + } + s.Signature = append(s.Signature, buf[64:160]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SyncCommitteeContribution object +func (s *SyncCommitteeContribution) SizeSSZ() (size int) { + size = 160 + return +} + +// HashTreeRoot ssz hashes the SyncCommitteeContribution object +func (s *SyncCommitteeContribution) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SyncCommitteeContribution object with a hasher +func (s *SyncCommitteeContribution) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(s.Slot)) + + // Field (1) 'BlockRoot' + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + hh.PutBytes(s.BlockRoot) + + // Field (2) 'SubcommitteeIndex' + hh.PutUint64(s.SubcommitteeIndex) + + // Field (3) 'AggregationBits' + if size := len(s.AggregationBits); size != 16 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) + return + } + hh.PutBytes(s.AggregationBits) + + // Field (4) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the ContributionAndProof object +func (c *ContributionAndProof) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(c) +} + +// MarshalSSZTo ssz marshals the ContributionAndProof object to a target array +func (c *ContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AggregatorIndex' + dst = ssz.MarshalUint64(dst, uint64(c.AggregatorIndex)) + + // Field (1) 'Contribution' + if c.Contribution == nil { + c.Contribution = new(SyncCommitteeContribution) + } + if dst, err = c.Contribution.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(c.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + dst = append(dst, c.SelectionProof...) + + return +} + +// UnmarshalSSZ ssz unmarshals the ContributionAndProof object +func (c *ContributionAndProof) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 264 { + return ssz.ErrSize + } + + // Field (0) 'AggregatorIndex' + c.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Contribution' + if c.Contribution == nil { + c.Contribution = new(SyncCommitteeContribution) + } + if err = c.Contribution.UnmarshalSSZ(buf[8:168]); err != nil { + return err + } + + // Field (2) 'SelectionProof' + if cap(c.SelectionProof) == 0 { + c.SelectionProof = make([]byte, 0, len(buf[168:264])) + } + c.SelectionProof = append(c.SelectionProof, buf[168:264]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ContributionAndProof object +func (c *ContributionAndProof) SizeSSZ() (size int) { + size = 264 + return +} + +// HashTreeRoot ssz hashes the ContributionAndProof object +func (c *ContributionAndProof) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(c) +} + +// HashTreeRootWith ssz hashes the ContributionAndProof object with a hasher +func (c *ContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregatorIndex' + hh.PutUint64(uint64(c.AggregatorIndex)) + + // Field (1) 'Contribution' + if err = c.Contribution.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(c.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + hh.PutBytes(c.SelectionProof) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedContributionAndProof object +func (s *SignedContributionAndProof) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedContributionAndProof object to a target array +func (s *SignedContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(ContributionAndProof) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedContributionAndProof object +func (s *SignedContributionAndProof) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 360 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(ContributionAndProof) + } + if err = s.Message.UnmarshalSSZ(buf[0:264]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[264:360])) + } + s.Signature = append(s.Signature, buf[264:360]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedContributionAndProof object +func (s *SignedContributionAndProof) SizeSSZ() (size int) { + size = 360 + return +} + +// HashTreeRoot ssz hashes the SignedContributionAndProof object +func (s *SignedContributionAndProof) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedContributionAndProof object with a hasher +func (s *SignedContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go new file mode 100644 index 000000000000..dc1647191de5 --- /dev/null +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -0,0 +1,2330 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: ebbdaf40c27b22a94c77b725c65e63314fdb93dca0a54c76f098fb893240044f +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// MarshalSSZ ssz marshals the SignedBeaconBlockBellatrix object +func (s *SignedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockBellatrix object to a target array +func (s *SignedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockBellatrix) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockBellatrix object +func (s *SignedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockBellatrix) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockBellatrix object +func (s *SignedBeaconBlockBellatrix) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockBellatrix) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockBellatrix object +func (s *SignedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockBellatrix object with a hasher +func (s *SignedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBellatrix object +func (b *BeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBellatrix object to a target array +func (b *BeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BeaconBlockBodyBellatrix) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBellatrix object +func (b *BeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBodyBellatrix) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBellatrix object +func (b *BeaconBlockBellatrix) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyBellatrix) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBellatrix object +func (b *BeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBellatrix object with a hasher +func (b *BeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBodyBellatrix object +func (b *BeaconBlockBodyBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBodyBellatrix object to a target array +func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(384) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayload' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayload) + } + offset += b.ExecutionPayload.SizeSSZ() + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayload' + if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyBellatrix object +func (b *BeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 384 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 384 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayload' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayload' + { + buf = tail[o9:] + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayload) + } + if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyBellatrix object +func (b *BeaconBlockBodyBellatrix) SizeSSZ() (size int) { + size = 384 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayload' + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayload) + } + size += b.ExecutionPayload.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBodyBellatrix object +func (b *BeaconBlockBodyBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBodyBellatrix object with a hasher +func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayload' + if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockBellatrix object +func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockBellatrix object to a target array +func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BlindedBeaconBlockBellatrix) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockBellatrix object +func (s *SignedBlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BlindedBeaconBlockBellatrix) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockBellatrix object +func (s *SignedBlindedBeaconBlockBellatrix) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BlindedBeaconBlockBellatrix) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockBellatrix object +func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockBellatrix object with a hasher +func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockBellatrix object +func (b *BlindedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockBellatrix object to a target array +func (b *BlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyBellatrix) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBellatrix object +func (b *BlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyBellatrix) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBellatrix object +func (b *BlindedBeaconBlockBellatrix) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyBellatrix) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockBellatrix object +func (b *BlindedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockBellatrix object with a hasher +func (b *BlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyBellatrix object +func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyBellatrix object to a target array +func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(384) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + offset += b.ExecutionPayloadHeader.SizeSSZ() + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayloadHeader' + if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyBellatrix object +func (b *BlindedBeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 384 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 384 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayloadHeader' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayloadHeader' + { + buf = tail[o9:] + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyBellatrix object +func (b *BlindedBeaconBlockBodyBellatrix) SizeSSZ() (size int) { + size = 384 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayloadHeader' + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + size += b.ExecutionPayloadHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyBellatrix object +func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyBellatrix object with a hasher +func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayloadHeader' + if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateBellatrix object to a target array +func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736633) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (24) 'LatestExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + offset += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + // Field (24) 'LatestExecutionPayloadHeader' + if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736633 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21, o24 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2736633 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Offset (24) 'LatestExecutionPayloadHeader' + if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + return ssz.ErrOffset + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:o24] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (24) 'LatestExecutionPayloadHeader' + { + buf = tail[o24:] + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) SizeSSZ() (size int) { + size = 2736633 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) + } + size += b.LatestExecutionPayloadHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconStateBellatrix object +func (b *BeaconStateBellatrix) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateBellatrix object with a hasher +func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (24) 'LatestExecutionPayloadHeader' + if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go new file mode 100644 index 000000000000..9a3c3448c7d5 --- /dev/null +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -0,0 +1,2904 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 665ba6ebbfbcd818d1f4f54220aaf343e8bd814ead5f4d901b3f9bb44608fee2 +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// MarshalSSZ ssz marshals the SignedBeaconBlockCapella object +func (s *SignedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockCapella object to a target array +func (s *SignedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockCapella) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockCapella object +func (s *SignedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockCapella) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockCapella object +func (s *SignedBeaconBlockCapella) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockCapella) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockCapella object +func (s *SignedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockCapella object with a hasher +func (s *SignedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockCapella object +func (b *BeaconBlockCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockCapella object to a target array +func (b *BeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BeaconBlockBodyCapella) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockCapella object +func (b *BeaconBlockCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBodyCapella) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockCapella object +func (b *BeaconBlockCapella) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyCapella) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockCapella object +func (b *BeaconBlockCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockCapella object with a hasher +func (b *BeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBodyCapella object +func (b *BeaconBlockBodyCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBodyCapella object to a target array +func (b *BeaconBlockBodyCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(388) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayload' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadCapella) + } + offset += b.ExecutionPayload.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayload' + if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyCapella object +func (b *BeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 388 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 388 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayload' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayload' + { + buf = tail[o9:o10] + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadCapella) + } + if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyCapella object +func (b *BeaconBlockBodyCapella) SizeSSZ() (size int) { + size = 388 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayload' + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadCapella) + } + size += b.ExecutionPayload.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBodyCapella object +func (b *BeaconBlockBodyCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBodyCapella object with a hasher +func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayload' + if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockCapella object +func (s *SignedBlindedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockCapella object to a target array +func (s *SignedBlindedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BlindedBeaconBlockCapella) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockCapella object +func (s *SignedBlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BlindedBeaconBlockCapella) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockCapella object +func (s *SignedBlindedBeaconBlockCapella) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BlindedBeaconBlockCapella) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockCapella object +func (s *SignedBlindedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockCapella object with a hasher +func (s *SignedBlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockCapella object +func (b *BlindedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockCapella object to a target array +func (b *BlindedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyCapella) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockCapella object +func (b *BlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyCapella) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockCapella object +func (b *BlindedBeaconBlockCapella) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyCapella) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockCapella object +func (b *BlindedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockCapella object with a hasher +func (b *BlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyCapella object +func (b *BlindedBeaconBlockBodyCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyCapella object to a target array +func (b *BlindedBeaconBlockBodyCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(388) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + } + offset += b.ExecutionPayloadHeader.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayloadHeader' + if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyCapella object +func (b *BlindedBeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 388 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 388 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayloadHeader' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayloadHeader' + { + buf = tail[o9:o10] + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + } + if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyCapella object +func (b *BlindedBeaconBlockBodyCapella) SizeSSZ() (size int) { + size = 388 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayloadHeader' + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + } + size += b.ExecutionPayloadHeader.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyCapella object +func (b *BlindedBeaconBlockBodyCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyCapella object with a hasher +func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayloadHeader' + if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BuilderBidCapella object +func (b *BuilderBidCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBidCapella object to a target array +func (b *BuilderBidCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderCapella) + } + offset += b.Header.SizeSSZ() + + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + dst = append(dst, b.Value...) + + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + dst = append(dst, b.Pubkey...) + + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBidCapella object +func (b *BuilderBidCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[4:36])) + } + b.Value = append(b.Value, buf[4:36]...) + + // Field (2) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[36:84])) + } + b.Pubkey = append(b.Pubkey, buf[36:84]...) + + // Field (0) 'Header' + { + buf = tail[o0:] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderCapella) + } + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidCapella object +func (b *BuilderBidCapella) SizeSSZ() (size int) { + size = 84 + + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderCapella) + } + size += b.Header.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BuilderBidCapella object +func (b *BuilderBidCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BuilderBidCapella object with a hasher +func (b *BuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + hh.PutBytes(b.Value) + + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + hh.PutBytes(b.Pubkey) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconStateCapella object +func (b *BeaconStateCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateCapella object to a target array +func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736653) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (24) 'LatestExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + } + offset += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (25) 'NextWithdrawalIndex' + dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) + + // Offset (27) 'HistoricalSummaries' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalSummaries) * 64 + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + // Field (24) 'LatestExecutionPayloadHeader' + if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (27) 'HistoricalSummaries' + if size := len(b.HistoricalSummaries); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalSummaries); ii++ { + if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateCapella object +func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736653 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2736653 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Offset (24) 'LatestExecutionPayloadHeader' + if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + return ssz.ErrOffset + } + + // Field (25) 'NextWithdrawalIndex' + b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) + + // Field (26) 'NextWithdrawalValidatorIndex' + b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) + + // Offset (27) 'HistoricalSummaries' + if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { + return ssz.ErrOffset + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:o24] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (24) 'LatestExecutionPayloadHeader' + { + buf = tail[o24:o27] + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + } + if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (27) 'HistoricalSummaries' + { + buf = tail[o27:] + num, err := ssz.DivideInt2(len(buf), 64, 16777216) + if err != nil { + return err + } + b.HistoricalSummaries = make([]*HistoricalSummary, num) + for ii := 0; ii < num; ii++ { + if b.HistoricalSummaries[ii] == nil { + b.HistoricalSummaries[ii] = new(HistoricalSummary) + } + if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateCapella object +func (b *BeaconStateCapella) SizeSSZ() (size int) { + size = 2736653 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) + } + size += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (27) 'HistoricalSummaries' + size += len(b.HistoricalSummaries) * 64 + + return +} + +// HashTreeRoot ssz hashes the BeaconStateCapella object +func (b *BeaconStateCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateCapella object with a hasher +func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (24) 'LatestExecutionPayloadHeader' + if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (25) 'NextWithdrawalIndex' + hh.PutUint64(b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) + + // Field (27) 'HistoricalSummaries' + { + subIndx := hh.Index() + num := uint64(len(b.HistoricalSummaries)) + if num > 16777216 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.HistoricalSummaries { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16777216) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the HistoricalSummary object +func (h *HistoricalSummary) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(h) +} + +// MarshalSSZTo ssz marshals the HistoricalSummary object to a target array +func (h *HistoricalSummary) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockSummaryRoot' + if size := len(h.BlockSummaryRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32) + return + } + dst = append(dst, h.BlockSummaryRoot...) + + // Field (1) 'StateSummaryRoot' + if size := len(h.StateSummaryRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32) + return + } + dst = append(dst, h.StateSummaryRoot...) + + return +} + +// UnmarshalSSZ ssz unmarshals the HistoricalSummary object +func (h *HistoricalSummary) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 64 { + return ssz.ErrSize + } + + // Field (0) 'BlockSummaryRoot' + if cap(h.BlockSummaryRoot) == 0 { + h.BlockSummaryRoot = make([]byte, 0, len(buf[0:32])) + } + h.BlockSummaryRoot = append(h.BlockSummaryRoot, buf[0:32]...) + + // Field (1) 'StateSummaryRoot' + if cap(h.StateSummaryRoot) == 0 { + h.StateSummaryRoot = make([]byte, 0, len(buf[32:64])) + } + h.StateSummaryRoot = append(h.StateSummaryRoot, buf[32:64]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the HistoricalSummary object +func (h *HistoricalSummary) SizeSSZ() (size int) { + size = 64 + return +} + +// HashTreeRoot ssz hashes the HistoricalSummary object +func (h *HistoricalSummary) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(h) +} + +// HashTreeRootWith ssz hashes the HistoricalSummary object with a hasher +func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BlockSummaryRoot' + if size := len(h.BlockSummaryRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32) + return + } + hh.PutBytes(h.BlockSummaryRoot) + + // Field (1) 'StateSummaryRoot' + if size := len(h.StateSummaryRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32) + return + } + hh.PutBytes(h.StateSummaryRoot) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BLSToExecutionChange object +func (b *BLSToExecutionChange) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BLSToExecutionChange object to a target array +func (b *BLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ValidatorIndex)) + + // Field (1) 'FromBlsPubkey' + if size := len(b.FromBlsPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48) + return + } + dst = append(dst, b.FromBlsPubkey...) + + // Field (2) 'ToExecutionAddress' + if size := len(b.ToExecutionAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20) + return + } + dst = append(dst, b.ToExecutionAddress...) + + return +} + +// UnmarshalSSZ ssz unmarshals the BLSToExecutionChange object +func (b *BLSToExecutionChange) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 76 { + return ssz.ErrSize + } + + // Field (0) 'ValidatorIndex' + b.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'FromBlsPubkey' + if cap(b.FromBlsPubkey) == 0 { + b.FromBlsPubkey = make([]byte, 0, len(buf[8:56])) + } + b.FromBlsPubkey = append(b.FromBlsPubkey, buf[8:56]...) + + // Field (2) 'ToExecutionAddress' + if cap(b.ToExecutionAddress) == 0 { + b.ToExecutionAddress = make([]byte, 0, len(buf[56:76])) + } + b.ToExecutionAddress = append(b.ToExecutionAddress, buf[56:76]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BLSToExecutionChange object +func (b *BLSToExecutionChange) SizeSSZ() (size int) { + size = 76 + return +} + +// HashTreeRoot ssz hashes the BLSToExecutionChange object +func (b *BLSToExecutionChange) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BLSToExecutionChange object with a hasher +func (b *BLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ValidatorIndex' + hh.PutUint64(uint64(b.ValidatorIndex)) + + // Field (1) 'FromBlsPubkey' + if size := len(b.FromBlsPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48) + return + } + hh.PutBytes(b.FromBlsPubkey) + + // Field (2) 'ToExecutionAddress' + if size := len(b.ToExecutionAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20) + return + } + hh.PutBytes(b.ToExecutionAddress) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBLSToExecutionChange object +func (s *SignedBLSToExecutionChange) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBLSToExecutionChange object to a target array +func (s *SignedBLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BLSToExecutionChange) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBLSToExecutionChange object +func (s *SignedBLSToExecutionChange) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 172 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BLSToExecutionChange) + } + if err = s.Message.UnmarshalSSZ(buf[0:76]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[76:172])) + } + s.Signature = append(s.Signature, buf[76:172]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBLSToExecutionChange object +func (s *SignedBLSToExecutionChange) SizeSSZ() (size int) { + size = 172 + return +} + +// HashTreeRoot ssz hashes the SignedBLSToExecutionChange object +func (s *SignedBLSToExecutionChange) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBLSToExecutionChange object with a hasher +func (s *SignedBLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go new file mode 100644 index 000000000000..272653017ab6 --- /dev/null +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -0,0 +1,3595 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 9f8cc72419818e9c460c4079d52f90e5c23bf6565a6a234b4dee0d8f41d9b1ed +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// MarshalSSZ ssz marshals the SignedBeaconBlockContentsDeneb object +func (s *SignedBeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockContentsDeneb object to a target array +func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(12) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(SignedBeaconBlockDeneb) + } + offset += s.Block.SizeSSZ() + + // Offset (1) 'KzgProofs' + dst = ssz.WriteOffset(dst, offset) + offset += len(s.KzgProofs) * 48 + + // Offset (2) 'Blobs' + dst = ssz.WriteOffset(dst, offset) + offset += len(s.Blobs) * 131072 + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'KzgProofs' + if size := len(s.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + for ii := 0; ii < len(s.KzgProofs); ii++ { + if size := len(s.KzgProofs[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) + return + } + dst = append(dst, s.KzgProofs[ii]...) + } + + // Field (2) 'Blobs' + if size := len(s.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + for ii := 0; ii < len(s.Blobs); ii++ { + if size := len(s.Blobs[ii]); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) + return + } + dst = append(dst, s.Blobs[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockContentsDeneb object +func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 12 { + return ssz.ErrSize + } + + tail := buf + var o0, o1, o2 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 12 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'KzgProofs' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Offset (2) 'Blobs' + if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Field (0) 'Block' + { + buf = tail[o0:o1] + if s.Block == nil { + s.Block = new(SignedBeaconBlockDeneb) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'KzgProofs' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + s.KzgProofs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(s.KzgProofs[ii]) == 0 { + s.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + s.KzgProofs[ii] = append(s.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (2) 'Blobs' + { + buf = tail[o2:] + num, err := ssz.DivideInt2(len(buf), 131072, 4096) + if err != nil { + return err + } + s.Blobs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(s.Blobs[ii]) == 0 { + s.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) + } + s.Blobs[ii] = append(s.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockContentsDeneb object +func (s *SignedBeaconBlockContentsDeneb) SizeSSZ() (size int) { + size = 12 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(SignedBeaconBlockDeneb) + } + size += s.Block.SizeSSZ() + + // Field (1) 'KzgProofs' + size += len(s.KzgProofs) * 48 + + // Field (2) 'Blobs' + size += len(s.Blobs) * 131072 + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockContentsDeneb object +func (s *SignedBeaconBlockContentsDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockContentsDeneb object with a hasher +func (s *SignedBeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'KzgProofs' + { + if size := len(s.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range s.KzgProofs { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(s.KzgProofs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (2) 'Blobs' + { + if size := len(s.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range s.Blobs { + if len(i) != 131072 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(s.Blobs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockContentsDeneb object +func (b *BeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockContentsDeneb object to a target array +func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(12) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if b.Block == nil { + b.Block = new(BeaconBlockDeneb) + } + offset += b.Block.SizeSSZ() + + // Offset (1) 'KzgProofs' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.KzgProofs) * 48 + + // Offset (2) 'Blobs' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Blobs) * 131072 + + // Field (0) 'Block' + if dst, err = b.Block.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'KzgProofs' + if size := len(b.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + for ii := 0; ii < len(b.KzgProofs); ii++ { + if size := len(b.KzgProofs[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) + return + } + dst = append(dst, b.KzgProofs[ii]...) + } + + // Field (2) 'Blobs' + if size := len(b.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + for ii := 0; ii < len(b.Blobs); ii++ { + if size := len(b.Blobs[ii]); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) + return + } + dst = append(dst, b.Blobs[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockContentsDeneb object +func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 12 { + return ssz.ErrSize + } + + tail := buf + var o0, o1, o2 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 12 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'KzgProofs' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Offset (2) 'Blobs' + if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Field (0) 'Block' + { + buf = tail[o0:o1] + if b.Block == nil { + b.Block = new(BeaconBlockDeneb) + } + if err = b.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'KzgProofs' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.KzgProofs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.KzgProofs[ii]) == 0 { + b.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.KzgProofs[ii] = append(b.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (2) 'Blobs' + { + buf = tail[o2:] + num, err := ssz.DivideInt2(len(buf), 131072, 4096) + if err != nil { + return err + } + b.Blobs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.Blobs[ii]) == 0 { + b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) + } + b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockContentsDeneb object +func (b *BeaconBlockContentsDeneb) SizeSSZ() (size int) { + size = 12 + + // Field (0) 'Block' + if b.Block == nil { + b.Block = new(BeaconBlockDeneb) + } + size += b.Block.SizeSSZ() + + // Field (1) 'KzgProofs' + size += len(b.KzgProofs) * 48 + + // Field (2) 'Blobs' + size += len(b.Blobs) * 131072 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockContentsDeneb object +func (b *BeaconBlockContentsDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockContentsDeneb object with a hasher +func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = b.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'KzgProofs' + { + if size := len(b.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.KzgProofs { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.KzgProofs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (2) 'Blobs' + { + if size := len(b.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.Blobs { + if len(i) != 131072 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.Blobs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBeaconBlockDeneb object +func (s *SignedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockDeneb object to a target array +func (s *SignedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockDeneb) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockDeneb object +func (s *SignedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockDeneb) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockDeneb object +func (s *SignedBeaconBlockDeneb) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockDeneb) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockDeneb object +func (s *SignedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockDeneb object with a hasher +func (s *SignedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockDeneb object +func (b *BeaconBlockDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockDeneb object to a target array +func (b *BeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BeaconBlockBodyDeneb) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockDeneb object +func (b *BeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBodyDeneb) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockDeneb object +func (b *BeaconBlockDeneb) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyDeneb) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockDeneb object +func (b *BeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockDeneb object with a hasher +func (b *BeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBodyDeneb object +func (b *BeaconBlockBodyDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBodyDeneb object to a target array +func (b *BeaconBlockBodyDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(392) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayload' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) + } + offset += b.ExecutionPayload.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Offset (11) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayload' + if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.BlobKzgCommitments[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyDeneb object +func (b *BeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 392 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10, o11 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 392 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayload' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Offset (11) 'BlobKzgCommitments' + if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayload' + { + buf = tail[o9:o10] + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) + } + if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:o11] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + + // Field (11) 'BlobKzgCommitments' + { + buf = tail[o11:] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyDeneb object +func (b *BeaconBlockBodyDeneb) SizeSSZ() (size int) { + size = 392 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayload' + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) + } + size += b.ExecutionPayload.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBodyDeneb object +func (b *BeaconBlockBodyDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBodyDeneb object with a hasher +func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayload' + if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (11) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockDeneb object +func (s *SignedBlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockDeneb object to a target array +func (s *SignedBlindedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BlindedBeaconBlockDeneb) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockDeneb object +func (s *SignedBlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BlindedBeaconBlockDeneb) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockDeneb object +func (s *SignedBlindedBeaconBlockDeneb) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindedBeaconBlockDeneb) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockDeneb object +func (s *SignedBlindedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockDeneb object with a hasher +func (s *SignedBlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockDeneb object +func (b *BlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockDeneb object to a target array +func (b *BlindedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyDeneb) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockDeneb object +func (b *BlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyDeneb) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockDeneb object +func (b *BlindedBeaconBlockDeneb) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyDeneb) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockDeneb object +func (b *BlindedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockDeneb object with a hasher +func (b *BlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyDeneb object +func (b *BlindedBeaconBlockBodyDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyDeneb object to a target array +func (b *BlindedBeaconBlockBodyDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(392) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + } + offset += b.ExecutionPayloadHeader.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Offset (11) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayloadHeader' + if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.BlobKzgCommitments[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyDeneb object +func (b *BlindedBeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 392 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10, o11 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 392 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayloadHeader' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Offset (11) 'BlobKzgCommitments' + if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayloadHeader' + { + buf = tail[o9:o10] + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + } + if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:o11] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + + // Field (11) 'BlobKzgCommitments' + { + buf = tail[o11:] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyDeneb object +func (b *BlindedBeaconBlockBodyDeneb) SizeSSZ() (size int) { + size = 392 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayloadHeader' + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + } + size += b.ExecutionPayloadHeader.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyDeneb object +func (b *BlindedBeaconBlockBodyDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyDeneb object with a hasher +func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayloadHeader' + if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (11) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BuilderBidDeneb object +func (b *BuilderBidDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBidDeneb object to a target array +func (b *BuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(88) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderDeneb) + } + offset += b.Header.SizeSSZ() + + // Offset (1) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Field (2) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + dst = append(dst, b.Value...) + + // Field (3) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + dst = append(dst, b.Pubkey...) + + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.BlobKzgCommitments[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBidDeneb object +func (b *BuilderBidDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 88 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 88 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'BlobKzgCommitments' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (2) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[8:40])) + } + b.Value = append(b.Value, buf[8:40]...) + + // Field (3) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[40:88])) + } + b.Pubkey = append(b.Pubkey, buf[40:88]...) + + // Field (0) 'Header' + { + buf = tail[o0:o1] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderDeneb) + } + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'BlobKzgCommitments' + { + buf = tail[o1:] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidDeneb object +func (b *BuilderBidDeneb) SizeSSZ() (size int) { + size = 88 + + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeaderDeneb) + } + size += b.Header.SizeSSZ() + + // Field (1) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + return +} + +// HashTreeRoot ssz hashes the BuilderBidDeneb object +func (b *BuilderBidDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BuilderBidDeneb object with a hasher +func (b *BuilderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (2) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + hh.PutBytes(b.Value) + + // Field (3) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + hh.PutBytes(b.Pubkey) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlobSidecar object +func (b *BlobSidecar) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlobSidecar object to a target array +func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, b.Index) + + // Field (1) 'Blob' + if size := len(b.Blob); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) + return + } + dst = append(dst, b.Blob...) + + // Field (2) 'KzgCommitment' + if size := len(b.KzgCommitment); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) + return + } + dst = append(dst, b.KzgCommitment...) + + // Field (3) 'KzgProof' + if size := len(b.KzgProof); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) + return + } + dst = append(dst, b.KzgProof...) + + // Field (4) 'SignedBlockHeader' + if b.SignedBlockHeader == nil { + b.SignedBlockHeader = new(SignedBeaconBlockHeader) + } + if dst, err = b.SignedBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'CommitmentInclusionProof' + if size := len(b.CommitmentInclusionProof); size != 17 { + err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) + return + } + for ii := 0; ii < 17; ii++ { + if size := len(b.CommitmentInclusionProof[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.CommitmentInclusionProof[ii]", size, 32) + return + } + dst = append(dst, b.CommitmentInclusionProof[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlobSidecar object +func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 131928 { + return ssz.ErrSize + } + + // Field (0) 'Index' + b.Index = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'Blob' + if cap(b.Blob) == 0 { + b.Blob = make([]byte, 0, len(buf[8:131080])) + } + b.Blob = append(b.Blob, buf[8:131080]...) + + // Field (2) 'KzgCommitment' + if cap(b.KzgCommitment) == 0 { + b.KzgCommitment = make([]byte, 0, len(buf[131080:131128])) + } + b.KzgCommitment = append(b.KzgCommitment, buf[131080:131128]...) + + // Field (3) 'KzgProof' + if cap(b.KzgProof) == 0 { + b.KzgProof = make([]byte, 0, len(buf[131128:131176])) + } + b.KzgProof = append(b.KzgProof, buf[131128:131176]...) + + // Field (4) 'SignedBlockHeader' + if b.SignedBlockHeader == nil { + b.SignedBlockHeader = new(SignedBeaconBlockHeader) + } + if err = b.SignedBlockHeader.UnmarshalSSZ(buf[131176:131384]); err != nil { + return err + } + + // Field (5) 'CommitmentInclusionProof' + b.CommitmentInclusionProof = make([][]byte, 17) + for ii := 0; ii < 17; ii++ { + if cap(b.CommitmentInclusionProof[ii]) == 0 { + b.CommitmentInclusionProof[ii] = make([]byte, 0, len(buf[131384:131928][ii*32:(ii+1)*32])) + } + b.CommitmentInclusionProof[ii] = append(b.CommitmentInclusionProof[ii], buf[131384:131928][ii*32:(ii+1)*32]...) + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecar object +func (b *BlobSidecar) SizeSSZ() (size int) { + size = 131928 + return +} + +// HashTreeRoot ssz hashes the BlobSidecar object +func (b *BlobSidecar) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlobSidecar object with a hasher +func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Index' + hh.PutUint64(b.Index) + + // Field (1) 'Blob' + if size := len(b.Blob); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) + return + } + hh.PutBytes(b.Blob) + + // Field (2) 'KzgCommitment' + if size := len(b.KzgCommitment); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) + return + } + hh.PutBytes(b.KzgCommitment) + + // Field (3) 'KzgProof' + if size := len(b.KzgProof); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) + return + } + hh.PutBytes(b.KzgProof) + + // Field (4) 'SignedBlockHeader' + if err = b.SignedBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'CommitmentInclusionProof' + { + if size := len(b.CommitmentInclusionProof); size != 17 { + err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) + return + } + subIndx := hh.Index() + for _, i := range b.CommitmentInclusionProof { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlobSidecars object +func (b *BlobSidecars) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlobSidecars object to a target array +func (b *BlobSidecars) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(4) + + // Offset (0) 'Sidecars' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Sidecars) * 131928 + + // Field (0) 'Sidecars' + if size := len(b.Sidecars); size > 6 { + err = ssz.ErrListTooBigFn("--.Sidecars", size, 6) + return + } + for ii := 0; ii < len(b.Sidecars); ii++ { + if dst, err = b.Sidecars[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlobSidecars object +func (b *BlobSidecars) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 4 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Sidecars' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 4 { + return ssz.ErrInvalidVariableOffset + } + + // Field (0) 'Sidecars' + { + buf = tail[o0:] + num, err := ssz.DivideInt2(len(buf), 131928, 6) + if err != nil { + return err + } + b.Sidecars = make([]*BlobSidecar, num) + for ii := 0; ii < num; ii++ { + if b.Sidecars[ii] == nil { + b.Sidecars[ii] = new(BlobSidecar) + } + if err = b.Sidecars[ii].UnmarshalSSZ(buf[ii*131928 : (ii+1)*131928]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecars object +func (b *BlobSidecars) SizeSSZ() (size int) { + size = 4 + + // Field (0) 'Sidecars' + size += len(b.Sidecars) * 131928 + + return +} + +// HashTreeRoot ssz hashes the BlobSidecars object +func (b *BlobSidecars) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlobSidecars object with a hasher +func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Sidecars' + { + subIndx := hh.Index() + num := uint64(len(b.Sidecars)) + if num > 6 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Sidecars { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 6) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconStateDeneb object +func (b *BeaconStateDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateDeneb object to a target array +func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736653) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (24) 'LatestExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + } + offset += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (25) 'NextWithdrawalIndex' + dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) + + // Offset (27) 'HistoricalSummaries' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalSummaries) * 64 + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + // Field (24) 'LatestExecutionPayloadHeader' + if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (27) 'HistoricalSummaries' + if size := len(b.HistoricalSummaries); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalSummaries); ii++ { + if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateDeneb object +func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736653 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2736653 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Offset (24) 'LatestExecutionPayloadHeader' + if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + return ssz.ErrOffset + } + + // Field (25) 'NextWithdrawalIndex' + b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) + + // Field (26) 'NextWithdrawalValidatorIndex' + b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) + + // Offset (27) 'HistoricalSummaries' + if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { + return ssz.ErrOffset + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:o24] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (24) 'LatestExecutionPayloadHeader' + { + buf = tail[o24:o27] + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + } + if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (27) 'HistoricalSummaries' + { + buf = tail[o27:] + num, err := ssz.DivideInt2(len(buf), 64, 16777216) + if err != nil { + return err + } + b.HistoricalSummaries = make([]*HistoricalSummary, num) + for ii := 0; ii < num; ii++ { + if b.HistoricalSummaries[ii] == nil { + b.HistoricalSummaries[ii] = new(HistoricalSummary) + } + if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateDeneb object +func (b *BeaconStateDeneb) SizeSSZ() (size int) { + size = 2736653 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) + } + size += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (27) 'HistoricalSummaries' + size += len(b.HistoricalSummaries) * 64 + + return +} + +// HashTreeRoot ssz hashes the BeaconStateDeneb object +func (b *BeaconStateDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateDeneb object with a hasher +func (b *BeaconStateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (24) 'LatestExecutionPayloadHeader' + if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (25) 'NextWithdrawalIndex' + hh.PutUint64(b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) + + // Field (27) 'HistoricalSummaries' + { + subIndx := hh.Index() + num := uint64(len(b.HistoricalSummaries)) + if num > 16777216 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.HistoricalSummaries { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16777216) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlobIdentifier object +func (b *BlobIdentifier) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlobIdentifier object to a target array +func (b *BlobIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockRoot' + if size := len(b.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + dst = append(dst, b.BlockRoot...) + + // Field (1) 'Index' + dst = ssz.MarshalUint64(dst, b.Index) + + return +} + +// UnmarshalSSZ ssz unmarshals the BlobIdentifier object +func (b *BlobIdentifier) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 40 { + return ssz.ErrSize + } + + // Field (0) 'BlockRoot' + if cap(b.BlockRoot) == 0 { + b.BlockRoot = make([]byte, 0, len(buf[0:32])) + } + b.BlockRoot = append(b.BlockRoot, buf[0:32]...) + + // Field (1) 'Index' + b.Index = ssz.UnmarshallUint64(buf[32:40]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlobIdentifier object +func (b *BlobIdentifier) SizeSSZ() (size int) { + size = 40 + return +} + +// HashTreeRoot ssz hashes the BlobIdentifier object +func (b *BlobIdentifier) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlobIdentifier object with a hasher +func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BlockRoot' + if size := len(b.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + hh.PutBytes(b.BlockRoot) + + // Field (1) 'Index' + hh.PutUint64(b.Index) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go new file mode 100644 index 000000000000..6f32288014b8 --- /dev/null +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -0,0 +1,3964 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: b388c6b0776ab0d4c45d83697580b9f0f823644b7a442cd4fe40d4cf64565134 +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// MarshalSSZ ssz marshals the AttestationElectra object +func (a *AttestationElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttestationElectra object to a target array +func (a *AttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(236) + + // Offset (0) 'AggregationBits' + dst = ssz.WriteOffset(dst, offset) + offset += len(a.AggregationBits) + + // Field (1) 'Data' + if a.Data == nil { + a.Data = new(AttestationData) + } + if dst, err = a.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + dst = append(dst, a.CommitteeBits...) + + // Field (3) 'Signature' + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, a.Signature...) + + // Field (0) 'AggregationBits' + if size := len(a.AggregationBits); size > 131072 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 131072) + return + } + dst = append(dst, a.AggregationBits...) + + return +} + +// UnmarshalSSZ ssz unmarshals the AttestationElectra object +func (a *AttestationElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 236 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AggregationBits' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 236 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if a.Data == nil { + a.Data = new(AttestationData) + } + if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'CommitteeBits' + if cap(a.CommitteeBits) == 0 { + a.CommitteeBits = make([]byte, 0, len(buf[132:140])) + } + a.CommitteeBits = append(a.CommitteeBits, buf[132:140]...) + + // Field (3) 'Signature' + if cap(a.Signature) == 0 { + a.Signature = make([]byte, 0, len(buf[140:236])) + } + a.Signature = append(a.Signature, buf[140:236]...) + + // Field (0) 'AggregationBits' + { + buf = tail[o0:] + if err = ssz.ValidateBitlist(buf, 131072); err != nil { + return err + } + if cap(a.AggregationBits) == 0 { + a.AggregationBits = make([]byte, 0, len(buf)) + } + a.AggregationBits = append(a.AggregationBits, buf...) + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AttestationElectra object +func (a *AttestationElectra) SizeSSZ() (size int) { + size = 236 + + // Field (0) 'AggregationBits' + size += len(a.AggregationBits) + + return +} + +// HashTreeRoot ssz hashes the AttestationElectra object +func (a *AttestationElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AttestationElectra object with a hasher +func (a *AttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if len(a.AggregationBits) == 0 { + err = ssz.ErrEmptyBitlist + return + } + hh.PutBitlist(a.AggregationBits, 131072) + + // Field (1) 'Data' + if err = a.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + hh.PutBytes(a.CommitteeBits) + + // Field (3) 'Signature' + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(a.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AggregateAttestationAndProofElectra object to a target array +func (a *AggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(108) + + // Field (0) 'AggregatorIndex' + dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) + + // Offset (1) 'Aggregate' + dst = ssz.WriteOffset(dst, offset) + if a.Aggregate == nil { + a.Aggregate = new(AttestationElectra) + } + offset += a.Aggregate.SizeSSZ() + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + dst = append(dst, a.SelectionProof...) + + // Field (1) 'Aggregate' + if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 108 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'AggregatorIndex' + a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Offset (1) 'Aggregate' + if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { + return ssz.ErrOffset + } + + if o1 != 108 { + return ssz.ErrInvalidVariableOffset + } + + // Field (2) 'SelectionProof' + if cap(a.SelectionProof) == 0 { + a.SelectionProof = make([]byte, 0, len(buf[12:108])) + } + a.SelectionProof = append(a.SelectionProof, buf[12:108]...) + + // Field (1) 'Aggregate' + { + buf = tail[o1:] + if a.Aggregate == nil { + a.Aggregate = new(AttestationElectra) + } + if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) SizeSSZ() (size int) { + size = 108 + + // Field (1) 'Aggregate' + if a.Aggregate == nil { + a.Aggregate = new(AttestationElectra) + } + size += a.Aggregate.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the AggregateAttestationAndProofElectra object +func (a *AggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AggregateAttestationAndProofElectra object with a hasher +func (a *AggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregatorIndex' + hh.PutUint64(uint64(a.AggregatorIndex)) + + // Field (1) 'Aggregate' + if err = a.Aggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + hh.PutBytes(a.SelectionProof) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProofElectra object to a target array +func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofElectra) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofElectra) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofElectra) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProofElectra object +func (s *SignedAggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProofElectra object with a hasher +func (s *SignedAggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttesterSlashingElectra object to a target array +func (a *AttesterSlashingElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(8) + + // Offset (0) 'Attestation_1' + dst = ssz.WriteOffset(dst, offset) + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestationElectra) + } + offset += a.Attestation_1.SizeSSZ() + + // Offset (1) 'Attestation_2' + dst = ssz.WriteOffset(dst, offset) + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestationElectra) + } + offset += a.Attestation_2.SizeSSZ() + + // Field (0) 'Attestation_1' + if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Attestation_2' + if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 8 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'Attestation_1' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 8 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'Attestation_2' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (0) 'Attestation_1' + { + buf = tail[o0:o1] + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestationElectra) + } + if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'Attestation_2' + { + buf = tail[o1:] + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestationElectra) + } + if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) SizeSSZ() (size int) { + size = 8 + + // Field (0) 'Attestation_1' + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestationElectra) + } + size += a.Attestation_1.SizeSSZ() + + // Field (1) 'Attestation_2' + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestationElectra) + } + size += a.Attestation_2.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the AttesterSlashingElectra object +func (a *AttesterSlashingElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AttesterSlashingElectra object with a hasher +func (a *AttesterSlashingElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Attestation_1' + if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Attestation_2' + if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(i) +} + +// MarshalSSZTo ssz marshals the IndexedAttestationElectra object to a target array +func (i *IndexedAttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(228) + + // Offset (0) 'AttestingIndices' + dst = ssz.WriteOffset(dst, offset) + offset += len(i.AttestingIndices) * 8 + + // Field (1) 'Data' + if i.Data == nil { + i.Data = new(AttestationData) + } + if dst, err = i.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, i.Signature...) + + // Field (0) 'AttestingIndices' + if size := len(i.AttestingIndices); size > 131072 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) + return + } + for ii := 0; ii < len(i.AttestingIndices); ii++ { + dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 228 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AttestingIndices' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 228 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if i.Data == nil { + i.Data = new(AttestationData) + } + if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(i.Signature) == 0 { + i.Signature = make([]byte, 0, len(buf[132:228])) + } + i.Signature = append(i.Signature, buf[132:228]...) + + // Field (0) 'AttestingIndices' + { + buf = tail[o0:] + num, err := ssz.DivideInt2(len(buf), 8, 131072) + if err != nil { + return err + } + i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) + for ii := 0; ii < num; ii++ { + i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) SizeSSZ() (size int) { + size = 228 + + // Field (0) 'AttestingIndices' + size += len(i.AttestingIndices) * 8 + + return +} + +// HashTreeRoot ssz hashes the IndexedAttestationElectra object +func (i *IndexedAttestationElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(i) +} + +// HashTreeRootWith ssz hashes the IndexedAttestationElectra object with a hasher +func (i *IndexedAttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestingIndices' + { + if size := len(i.AttestingIndices); size > 131072 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) + return + } + subIndx := hh.Index() + for _, i := range i.AttestingIndices { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(i.AttestingIndices)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) + } + + // Field (1) 'Data' + if err = i.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(i.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockElectra object to a target array +func (s *SignedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockElectra) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockElectra) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockElectra) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockElectra object +func (s *SignedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockElectra object with a hasher +func (s *SignedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockElectra object +func (b *BeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockElectra object to a target array +func (b *BeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BeaconBlockBodyElectra) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockElectra object +func (b *BeaconBlockElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBodyElectra) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockElectra object +func (b *BeaconBlockElectra) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyElectra) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockElectra object +func (b *BeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockElectra object with a hasher +func (b *BeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array +func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(396) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayload' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + } + offset += b.ExecutionPayload.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Offset (11) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Offset (12) 'Consolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Consolidations) * 120 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 1 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 8 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 8) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayload' + if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.BlobKzgCommitments[ii]...) + } + + // Field (12) 'Consolidations' + if size := len(b.Consolidations); size > 1 { + err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) + return + } + for ii := 0; ii < len(b.Consolidations); ii++ { + if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 396 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 396 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayload' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Offset (11) 'BlobKzgCommitments' + if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Consolidations' + if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 1) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashingElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashingElectra) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 8) + if err != nil { + return err + } + b.Attestations = make([]*AttestationElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(AttestationElectra) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayload' + { + buf = tail[o9:o10] + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + } + if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:o11] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + + // Field (11) 'BlobKzgCommitments' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (12) 'Consolidations' + { + buf = tail[o12:] + num, err := ssz.DivideInt2(len(buf), 120, 1) + if err != nil { + return err + } + b.Consolidations = make([]*SignedConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.Consolidations[ii] == nil { + b.Consolidations[ii] = new(SignedConsolidation) + } + if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { + size = 396 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayload' + if b.ExecutionPayload == nil { + b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + } + size += b.ExecutionPayload.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + // Field (12) 'Consolidations' + size += len(b.Consolidations) * 120 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBodyElectra object +func (b *BeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBodyElectra object with a hasher +func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 8 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 8) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayload' + if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (11) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (12) 'Consolidations' + { + subIndx := hh.Index() + num := uint64(len(b.Consolidations)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Consolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockElectra object to a target array +func (s *SignedBlindedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BlindedBeaconBlockElectra) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BlindedBeaconBlockElectra) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindedBeaconBlockElectra) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockElectra object +func (s *SignedBlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockElectra object with a hasher +func (s *SignedBlindedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockElectra object to a target array +func (b *BlindedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyElectra) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyElectra) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BlindedBeaconBlockBodyElectra) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockElectra object +func (b *BlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockElectra object with a hasher +func (b *BlindedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array +func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(396) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'ExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + offset += b.ExecutionPayloadHeader.SizeSSZ() + + // Offset (10) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Offset (11) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Offset (12) 'Consolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Consolidations) * 120 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 1 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 8 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 8) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (9) 'ExecutionPayloadHeader' + if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + if size := len(b.BlsToExecutionChanges); size > 16 { + err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) + return + } + for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { + if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'BlobKzgCommitments' + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { + if size := len(b.BlobKzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.BlobKzgCommitments[ii]...) + } + + // Field (12) 'Consolidations' + if size := len(b.Consolidations); size > 1 { + err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) + return + } + for ii := 0; ii < len(b.Consolidations); ii++ { + if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 396 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 396 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (8) 'SyncAggregate' + if b.SyncAggregate == nil { + b.SyncAggregate = new(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'ExecutionPayloadHeader' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Offset (10) 'BlsToExecutionChanges' + if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { + return ssz.ErrOffset + } + + // Offset (11) 'BlobKzgCommitments' + if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Consolidations' + if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 1) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashingElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashingElectra) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 8) + if err != nil { + return err + } + b.Attestations = make([]*AttestationElectra, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(AttestationElectra) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'ExecutionPayloadHeader' + { + buf = tail[o9:o10] + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (10) 'BlsToExecutionChanges' + { + buf = tail[o10:o11] + num, err := ssz.DivideInt2(len(buf), 172, 16) + if err != nil { + return err + } + b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) + for ii := 0; ii < num; ii++ { + if b.BlsToExecutionChanges[ii] == nil { + b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) + } + if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { + return err + } + } + } + + // Field (11) 'BlobKzgCommitments' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.BlobKzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.BlobKzgCommitments[ii]) == 0 { + b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (12) 'Consolidations' + { + buf = tail[o12:] + num, err := ssz.DivideInt2(len(buf), 120, 1) + if err != nil { + return err + } + b.Consolidations = make([]*SignedConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.Consolidations[ii] == nil { + b.Consolidations[ii] = new(SignedConsolidation) + } + if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { + size = 396 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + // Field (9) 'ExecutionPayloadHeader' + if b.ExecutionPayloadHeader == nil { + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + size += b.ExecutionPayloadHeader.SizeSSZ() + + // Field (10) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + // Field (12) 'Consolidations' + size += len(b.Consolidations) * 120 + + return +} + +// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyElectra object +func (b *BlindedBeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyElectra object with a hasher +func (b *BlindedBeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 8 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 8) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (8) 'SyncAggregate' + if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'ExecutionPayloadHeader' + if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (10) 'BlsToExecutionChanges' + { + subIndx := hh.Index() + num := uint64(len(b.BlsToExecutionChanges)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlsToExecutionChanges { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (11) 'BlobKzgCommitments' + { + if size := len(b.BlobKzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.BlobKzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.BlobKzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (12) 'Consolidations' + { + subIndx := hh.Index() + num := uint64(len(b.Consolidations)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Consolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconStateElectra object +func (b *BeaconStateElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateElectra object to a target array +func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736713) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (24) 'LatestExecutionPayloadHeader' + dst = ssz.WriteOffset(dst, offset) + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + offset += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (25) 'NextWithdrawalIndex' + dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) + + // Offset (27) 'HistoricalSummaries' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalSummaries) * 64 + + // Field (28) 'DepositRequestsStartIndex' + dst = ssz.MarshalUint64(dst, b.DepositRequestsStartIndex) + + // Field (29) 'DepositBalanceToConsume' + dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) + + // Field (30) 'ExitBalanceToConsume' + dst = ssz.MarshalUint64(dst, uint64(b.ExitBalanceToConsume)) + + // Field (31) 'EarliestExitEpoch' + dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) + + // Field (32) 'ConsolidationBalanceToConsume' + dst = ssz.MarshalUint64(dst, uint64(b.ConsolidationBalanceToConsume)) + + // Field (33) 'EarliestConsolidationEpoch' + dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) + + // Offset (34) 'PendingBalanceDeposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingBalanceDeposits) * 16 + + // Offset (35) 'PendingPartialWithdrawals' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingPartialWithdrawals) * 24 + + // Offset (36) 'PendingConsolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingConsolidations) * 16 + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + // Field (24) 'LatestExecutionPayloadHeader' + if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (27) 'HistoricalSummaries' + if size := len(b.HistoricalSummaries); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalSummaries); ii++ { + if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (34) 'PendingBalanceDeposits' + if size := len(b.PendingBalanceDeposits); size > 134217728 { + err = ssz.ErrListTooBigFn("--.PendingBalanceDeposits", size, 134217728) + return + } + for ii := 0; ii < len(b.PendingBalanceDeposits); ii++ { + if dst, err = b.PendingBalanceDeposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (35) 'PendingPartialWithdrawals' + if size := len(b.PendingPartialWithdrawals); size > 134217728 { + err = ssz.ErrListTooBigFn("--.PendingPartialWithdrawals", size, 134217728) + return + } + for ii := 0; ii < len(b.PendingPartialWithdrawals); ii++ { + if dst, err = b.PendingPartialWithdrawals[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (36) 'PendingConsolidations' + if size := len(b.PendingConsolidations); size > 262144 { + err = ssz.ErrListTooBigFn("--.PendingConsolidations", size, 262144) + return + } + for ii := 0; ii < len(b.PendingConsolidations); ii++ { + if dst, err = b.PendingConsolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateElectra object +func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736713 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21, o24, o27, o34, o35, o36 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2736713 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Offset (24) 'LatestExecutionPayloadHeader' + if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { + return ssz.ErrOffset + } + + // Field (25) 'NextWithdrawalIndex' + b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) + + // Field (26) 'NextWithdrawalValidatorIndex' + b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) + + // Offset (27) 'HistoricalSummaries' + if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { + return ssz.ErrOffset + } + + // Field (28) 'DepositRequestsStartIndex' + b.DepositRequestsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) + + // Field (29) 'DepositBalanceToConsume' + b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) + + // Field (30) 'ExitBalanceToConsume' + b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736669:2736677])) + + // Field (31) 'EarliestExitEpoch' + b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736677:2736685])) + + // Field (32) 'ConsolidationBalanceToConsume' + b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736685:2736693])) + + // Field (33) 'EarliestConsolidationEpoch' + b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736693:2736701])) + + // Offset (34) 'PendingBalanceDeposits' + if o34 = ssz.ReadOffset(buf[2736701:2736705]); o34 > size || o27 > o34 { + return ssz.ErrOffset + } + + // Offset (35) 'PendingPartialWithdrawals' + if o35 = ssz.ReadOffset(buf[2736705:2736709]); o35 > size || o34 > o35 { + return ssz.ErrOffset + } + + // Offset (36) 'PendingConsolidations' + if o36 = ssz.ReadOffset(buf[2736709:2736713]); o36 > size || o35 > o36 { + return ssz.ErrOffset + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:o24] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (24) 'LatestExecutionPayloadHeader' + { + buf = tail[o24:o27] + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (27) 'HistoricalSummaries' + { + buf = tail[o27:o34] + num, err := ssz.DivideInt2(len(buf), 64, 16777216) + if err != nil { + return err + } + b.HistoricalSummaries = make([]*HistoricalSummary, num) + for ii := 0; ii < num; ii++ { + if b.HistoricalSummaries[ii] == nil { + b.HistoricalSummaries[ii] = new(HistoricalSummary) + } + if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { + return err + } + } + } + + // Field (34) 'PendingBalanceDeposits' + { + buf = tail[o34:o35] + num, err := ssz.DivideInt2(len(buf), 16, 134217728) + if err != nil { + return err + } + b.PendingBalanceDeposits = make([]*PendingBalanceDeposit, num) + for ii := 0; ii < num; ii++ { + if b.PendingBalanceDeposits[ii] == nil { + b.PendingBalanceDeposits[ii] = new(PendingBalanceDeposit) + } + if err = b.PendingBalanceDeposits[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { + return err + } + } + } + + // Field (35) 'PendingPartialWithdrawals' + { + buf = tail[o35:o36] + num, err := ssz.DivideInt2(len(buf), 24, 134217728) + if err != nil { + return err + } + b.PendingPartialWithdrawals = make([]*PendingPartialWithdrawal, num) + for ii := 0; ii < num; ii++ { + if b.PendingPartialWithdrawals[ii] == nil { + b.PendingPartialWithdrawals[ii] = new(PendingPartialWithdrawal) + } + if err = b.PendingPartialWithdrawals[ii].UnmarshalSSZ(buf[ii*24 : (ii+1)*24]); err != nil { + return err + } + } + } + + // Field (36) 'PendingConsolidations' + { + buf = tail[o36:] + num, err := ssz.DivideInt2(len(buf), 16, 262144) + if err != nil { + return err + } + b.PendingConsolidations = make([]*PendingConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.PendingConsolidations[ii] == nil { + b.PendingConsolidations[ii] = new(PendingConsolidation) + } + if err = b.PendingConsolidations[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateElectra object +func (b *BeaconStateElectra) SizeSSZ() (size int) { + size = 2736713 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + } + size += b.LatestExecutionPayloadHeader.SizeSSZ() + + // Field (27) 'HistoricalSummaries' + size += len(b.HistoricalSummaries) * 64 + + // Field (34) 'PendingBalanceDeposits' + size += len(b.PendingBalanceDeposits) * 16 + + // Field (35) 'PendingPartialWithdrawals' + size += len(b.PendingPartialWithdrawals) * 24 + + // Field (36) 'PendingConsolidations' + size += len(b.PendingConsolidations) * 16 + + return +} + +// HashTreeRoot ssz hashes the BeaconStateElectra object +func (b *BeaconStateElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateElectra object with a hasher +func (b *BeaconStateElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (24) 'LatestExecutionPayloadHeader' + if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (25) 'NextWithdrawalIndex' + hh.PutUint64(b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) + + // Field (27) 'HistoricalSummaries' + { + subIndx := hh.Index() + num := uint64(len(b.HistoricalSummaries)) + if num > 16777216 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.HistoricalSummaries { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16777216) + } + + // Field (28) 'DepositRequestsStartIndex' + hh.PutUint64(b.DepositRequestsStartIndex) + + // Field (29) 'DepositBalanceToConsume' + hh.PutUint64(uint64(b.DepositBalanceToConsume)) + + // Field (30) 'ExitBalanceToConsume' + hh.PutUint64(uint64(b.ExitBalanceToConsume)) + + // Field (31) 'EarliestExitEpoch' + hh.PutUint64(uint64(b.EarliestExitEpoch)) + + // Field (32) 'ConsolidationBalanceToConsume' + hh.PutUint64(uint64(b.ConsolidationBalanceToConsume)) + + // Field (33) 'EarliestConsolidationEpoch' + hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) + + // Field (34) 'PendingBalanceDeposits' + { + subIndx := hh.Index() + num := uint64(len(b.PendingBalanceDeposits)) + if num > 134217728 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingBalanceDeposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 134217728) + } + + // Field (35) 'PendingPartialWithdrawals' + { + subIndx := hh.Index() + num := uint64(len(b.PendingPartialWithdrawals)) + if num > 134217728 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingPartialWithdrawals { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 134217728) + } + + // Field (36) 'PendingConsolidations' + { + subIndx := hh.Index() + num := uint64(len(b.PendingConsolidations)) + if num > 262144 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingConsolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 262144) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingBalanceDeposit object to a target array +func (p *PendingBalanceDeposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, uint64(p.Index)) + + // Field (1) 'Amount' + dst = ssz.MarshalUint64(dst, p.Amount) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'Index' + p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Amount' + p.Amount = ssz.UnmarshallUint64(buf[8:16]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the PendingBalanceDeposit object +func (p *PendingBalanceDeposit) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingBalanceDeposit object with a hasher +func (p *PendingBalanceDeposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Index' + hh.PutUint64(uint64(p.Index)) + + // Field (1) 'Amount' + hh.PutUint64(p.Amount) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingPartialWithdrawal object to a target array +func (p *PendingPartialWithdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, uint64(p.Index)) + + // Field (1) 'Amount' + dst = ssz.MarshalUint64(dst, p.Amount) + + // Field (2) 'WithdrawableEpoch' + dst = ssz.MarshalUint64(dst, uint64(p.WithdrawableEpoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24 { + return ssz.ErrSize + } + + // Field (0) 'Index' + p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Amount' + p.Amount = ssz.UnmarshallUint64(buf[8:16]) + + // Field (2) 'WithdrawableEpoch' + p.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) SizeSSZ() (size int) { + size = 24 + return +} + +// HashTreeRoot ssz hashes the PendingPartialWithdrawal object +func (p *PendingPartialWithdrawal) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingPartialWithdrawal object with a hasher +func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Index' + hh.PutUint64(uint64(p.Index)) + + // Field (1) 'Amount' + hh.PutUint64(p.Amount) + + // Field (2) 'WithdrawableEpoch' + hh.PutUint64(uint64(p.WithdrawableEpoch)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Consolidation object +func (c *Consolidation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(c) +} + +// MarshalSSZTo ssz marshals the Consolidation object to a target array +func (c *Consolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SourceIndex' + dst = ssz.MarshalUint64(dst, uint64(c.SourceIndex)) + + // Field (1) 'TargetIndex' + dst = ssz.MarshalUint64(dst, uint64(c.TargetIndex)) + + // Field (2) 'Epoch' + dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the Consolidation object +func (c *Consolidation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24 { + return ssz.ErrSize + } + + // Field (0) 'SourceIndex' + c.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'TargetIndex' + c.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'Epoch' + c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Consolidation object +func (c *Consolidation) SizeSSZ() (size int) { + size = 24 + return +} + +// HashTreeRoot ssz hashes the Consolidation object +func (c *Consolidation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(c) +} + +// HashTreeRootWith ssz hashes the Consolidation object with a hasher +func (c *Consolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SourceIndex' + hh.PutUint64(uint64(c.SourceIndex)) + + // Field (1) 'TargetIndex' + hh.PutUint64(uint64(c.TargetIndex)) + + // Field (2) 'Epoch' + hh.PutUint64(uint64(c.Epoch)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedConsolidation object +func (s *SignedConsolidation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedConsolidation object to a target array +func (s *SignedConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(Consolidation) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedConsolidation object +func (s *SignedConsolidation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 120 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(Consolidation) + } + if err = s.Message.UnmarshalSSZ(buf[0:24]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[24:120])) + } + s.Signature = append(s.Signature, buf[24:120]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedConsolidation object +func (s *SignedConsolidation) SizeSSZ() (size int) { + size = 120 + return +} + +// HashTreeRoot ssz hashes the SignedConsolidation object +func (s *SignedConsolidation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedConsolidation object with a hasher +func (s *SignedConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PendingConsolidation object +func (p *PendingConsolidation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingConsolidation object to a target array +func (p *PendingConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SourceIndex' + dst = ssz.MarshalUint64(dst, uint64(p.SourceIndex)) + + // Field (1) 'TargetIndex' + dst = ssz.MarshalUint64(dst, uint64(p.TargetIndex)) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingConsolidation object +func (p *PendingConsolidation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'SourceIndex' + p.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'TargetIndex' + p.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingConsolidation object +func (p *PendingConsolidation) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the PendingConsolidation object +func (p *PendingConsolidation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingConsolidation object with a hasher +func (p *PendingConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SourceIndex' + hh.PutUint64(uint64(p.SourceIndex)) + + // Field (1) 'TargetIndex' + hh.PutUint64(uint64(p.TargetIndex)) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go deleted file mode 100644 index f7836b3609b2..000000000000 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ /dev/null @@ -1,20713 +0,0 @@ -// Code generated by fastssz. DO NOT EDIT. -// Hash: f1b72be7fea0fb1c1fbf8396b0e460f440ff5f7551fe46f0f9a5c7a4be634e1e -package eth - -import ( - ssz "github.com/prysmaticlabs/fastssz" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" -) - -// MarshalSSZ ssz marshals the Attestation object -func (a *Attestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the Attestation object to a target array -func (a *Attestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(228) - - // Offset (0) 'AggregationBits' - dst = ssz.WriteOffset(dst, offset) - offset += len(a.AggregationBits) - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if dst, err = a.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, a.Signature...) - - // Field (0) 'AggregationBits' - if size := len(a.AggregationBits); size > 2048 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) - return - } - dst = append(dst, a.AggregationBits...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Attestation object -func (a *Attestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 228 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 228 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(a.Signature) == 0 { - a.Signature = make([]byte, 0, len(buf[132:228])) - } - a.Signature = append(a.Signature, buf[132:228]...) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 2048); err != nil { - return err - } - if cap(a.AggregationBits) == 0 { - a.AggregationBits = make([]byte, 0, len(buf)) - } - a.AggregationBits = append(a.AggregationBits, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Attestation object -func (a *Attestation) SizeSSZ() (size int) { - size = 228 - - // Field (0) 'AggregationBits' - size += len(a.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the Attestation object -func (a *Attestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the Attestation object with a hasher -func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(a.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist - return - } - hh.PutBitlist(a.AggregationBits, 2048) - - // Field (1) 'Data' - if err = a.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(a.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttestationElectra object -func (a *AttestationElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttestationElectra object to a target array -func (a *AttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(236) - - // Offset (0) 'AggregationBits' - dst = ssz.WriteOffset(dst, offset) - offset += len(a.AggregationBits) - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if dst, err = a.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - dst = append(dst, a.CommitteeBits...) - - // Field (3) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, a.Signature...) - - // Field (0) 'AggregationBits' - if size := len(a.AggregationBits); size > 131072 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 131072) - return - } - dst = append(dst, a.AggregationBits...) - - return -} - -// UnmarshalSSZ ssz unmarshals the AttestationElectra object -func (a *AttestationElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 236 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 236 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'CommitteeBits' - if cap(a.CommitteeBits) == 0 { - a.CommitteeBits = make([]byte, 0, len(buf[132:140])) - } - a.CommitteeBits = append(a.CommitteeBits, buf[132:140]...) - - // Field (3) 'Signature' - if cap(a.Signature) == 0 { - a.Signature = make([]byte, 0, len(buf[140:236])) - } - a.Signature = append(a.Signature, buf[140:236]...) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 131072); err != nil { - return err - } - if cap(a.AggregationBits) == 0 { - a.AggregationBits = make([]byte, 0, len(buf)) - } - a.AggregationBits = append(a.AggregationBits, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttestationElectra object -func (a *AttestationElectra) SizeSSZ() (size int) { - size = 236 - - // Field (0) 'AggregationBits' - size += len(a.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the AttestationElectra object -func (a *AttestationElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttestationElectra object with a hasher -func (a *AttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(a.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist - return - } - hh.PutBitlist(a.AggregationBits, 131072) - - // Field (1) 'Data' - if err = a.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - hh.PutBytes(a.CommitteeBits) - - // Field (3) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(a.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AggregateAttestationAndProof object to a target array -func (a *AggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(108) - - // Field (0) 'AggregatorIndex' - dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) - - // Offset (1) 'Aggregate' - dst = ssz.WriteOffset(dst, offset) - if a.Aggregate == nil { - a.Aggregate = new(Attestation) - } - offset += a.Aggregate.SizeSSZ() - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - dst = append(dst, a.SelectionProof...) - - // Field (1) 'Aggregate' - if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 108 { - return ssz.ErrSize - } - - tail := buf - var o1 uint64 - - // Field (0) 'AggregatorIndex' - a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Offset (1) 'Aggregate' - if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { - return ssz.ErrOffset - } - - if o1 < 108 { - return ssz.ErrInvalidVariableOffset - } - - // Field (2) 'SelectionProof' - if cap(a.SelectionProof) == 0 { - a.SelectionProof = make([]byte, 0, len(buf[12:108])) - } - a.SelectionProof = append(a.SelectionProof, buf[12:108]...) - - // Field (1) 'Aggregate' - { - buf = tail[o1:] - if a.Aggregate == nil { - a.Aggregate = new(Attestation) - } - if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) SizeSSZ() (size int) { - size = 108 - - // Field (1) 'Aggregate' - if a.Aggregate == nil { - a.Aggregate = new(Attestation) - } - size += a.Aggregate.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AggregateAttestationAndProof object with a hasher -func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregatorIndex' - hh.PutUint64(uint64(a.AggregatorIndex)) - - // Field (1) 'Aggregate' - if err = a.Aggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - hh.PutBytes(a.SelectionProof) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AggregateAttestationAndProofElectra object to a target array -func (a *AggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(108) - - // Field (0) 'AggregatorIndex' - dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) - - // Offset (1) 'Aggregate' - dst = ssz.WriteOffset(dst, offset) - if a.Aggregate == nil { - a.Aggregate = new(AttestationElectra) - } - offset += a.Aggregate.SizeSSZ() - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - dst = append(dst, a.SelectionProof...) - - // Field (1) 'Aggregate' - if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 108 { - return ssz.ErrSize - } - - tail := buf - var o1 uint64 - - // Field (0) 'AggregatorIndex' - a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Offset (1) 'Aggregate' - if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { - return ssz.ErrOffset - } - - if o1 < 108 { - return ssz.ErrInvalidVariableOffset - } - - // Field (2) 'SelectionProof' - if cap(a.SelectionProof) == 0 { - a.SelectionProof = make([]byte, 0, len(buf[12:108])) - } - a.SelectionProof = append(a.SelectionProof, buf[12:108]...) - - // Field (1) 'Aggregate' - { - buf = tail[o1:] - if a.Aggregate == nil { - a.Aggregate = new(AttestationElectra) - } - if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) SizeSSZ() (size int) { - size = 108 - - // Field (1) 'Aggregate' - if a.Aggregate == nil { - a.Aggregate = new(AttestationElectra) - } - size += a.Aggregate.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AggregateAttestationAndProofElectra object with a hasher -func (a *AggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregatorIndex' - hh.PutUint64(uint64(a.AggregatorIndex)) - - // Field (1) 'Aggregate' - if err = a.Aggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - hh.PutBytes(a.SelectionProof) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProof object to a target array -func (s *SignedAggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Message' - dst = ssz.WriteOffset(dst, offset) - if s.Message == nil { - s.Message = new(AggregateAttestationAndProof) - } - offset += s.Message.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Message' - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Message' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Message' - { - buf = tail[o0:] - if s.Message == nil { - s.Message = new(AggregateAttestationAndProof) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(AggregateAttestationAndProof) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProof object with a hasher -func (s *SignedAggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProofElectra object to a target array -func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Message' - dst = ssz.WriteOffset(dst, offset) - if s.Message == nil { - s.Message = new(AggregateAttestationAndProofElectra) - } - offset += s.Message.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Message' - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Message' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Message' - { - buf = tail[o0:] - if s.Message == nil { - s.Message = new(AggregateAttestationAndProofElectra) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(AggregateAttestationAndProofElectra) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProofElectra object with a hasher -func (s *SignedAggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttestationData object -func (a *AttestationData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttestationData object to a target array -func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(a.Slot)) - - // Field (1) 'CommitteeIndex' - dst = ssz.MarshalUint64(dst, uint64(a.CommitteeIndex)) - - // Field (2) 'BeaconBlockRoot' - if size := len(a.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - dst = append(dst, a.BeaconBlockRoot...) - - // Field (3) 'Source' - if a.Source == nil { - a.Source = new(Checkpoint) - } - if dst, err = a.Source.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'Target' - if a.Target == nil { - a.Target = new(Checkpoint) - } - if dst, err = a.Target.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AttestationData object -func (a *AttestationData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 128 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - a.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'CommitteeIndex' - a.CommitteeIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.CommitteeIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'BeaconBlockRoot' - if cap(a.BeaconBlockRoot) == 0 { - a.BeaconBlockRoot = make([]byte, 0, len(buf[16:48])) - } - a.BeaconBlockRoot = append(a.BeaconBlockRoot, buf[16:48]...) - - // Field (3) 'Source' - if a.Source == nil { - a.Source = new(Checkpoint) - } - if err = a.Source.UnmarshalSSZ(buf[48:88]); err != nil { - return err - } - - // Field (4) 'Target' - if a.Target == nil { - a.Target = new(Checkpoint) - } - if err = a.Target.UnmarshalSSZ(buf[88:128]); err != nil { - return err - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttestationData object -func (a *AttestationData) SizeSSZ() (size int) { - size = 128 - return -} - -// HashTreeRoot ssz hashes the AttestationData object -func (a *AttestationData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttestationData object with a hasher -func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(a.Slot)) - - // Field (1) 'CommitteeIndex' - hh.PutUint64(uint64(a.CommitteeIndex)) - - // Field (2) 'BeaconBlockRoot' - if size := len(a.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - hh.PutBytes(a.BeaconBlockRoot) - - // Field (3) 'Source' - if err = a.Source.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'Target' - if err = a.Target.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Checkpoint object -func (c *Checkpoint) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the Checkpoint object to a target array -func (c *Checkpoint) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) - - // Field (1) 'Root' - if size := len(c.Root); size != 32 { - err = ssz.ErrBytesLengthFn("--.Root", size, 32) - return - } - dst = append(dst, c.Root...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Checkpoint object -func (c *Checkpoint) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 40 { - return ssz.ErrSize - } - - // Field (0) 'Epoch' - c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Root' - if cap(c.Root) == 0 { - c.Root = make([]byte, 0, len(buf[8:40])) - } - c.Root = append(c.Root, buf[8:40]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Checkpoint object -func (c *Checkpoint) SizeSSZ() (size int) { - size = 40 - return -} - -// HashTreeRoot ssz hashes the Checkpoint object -func (c *Checkpoint) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the Checkpoint object with a hasher -func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Epoch' - hh.PutUint64(uint64(c.Epoch)) - - // Field (1) 'Root' - if size := len(c.Root); size != 32 { - err = ssz.ErrBytesLengthFn("--.Root", size, 32) - return - } - hh.PutBytes(c.Root) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlock object -func (b *BeaconBlock) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlock object to a target array -func (b *BeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BeaconBlockBody) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlock object -func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BeaconBlockBody) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlock object -func (b *BeaconBlock) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBody) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlock object -func (b *BeaconBlock) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlock object with a hasher -func (b *BeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlock object -func (s *SignedBeaconBlock) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlock object to a target array -func (s *SignedBeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlock) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlock object -func (s *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlock) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlock object -func (s *SignedBeaconBlock) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlock) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlock object -func (s *SignedBeaconBlock) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlock object with a hasher -func (s *SignedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockAltair object -func (b *BeaconBlockAltair) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockAltair object to a target array -func (b *BeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BeaconBlockBodyAltair) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockAltair object -func (b *BeaconBlockAltair) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BeaconBlockBodyAltair) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockAltair object -func (b *BeaconBlockAltair) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyAltair) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockAltair object -func (b *BeaconBlockAltair) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockAltair object with a hasher -func (b *BeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockAltair object -func (s *SignedBeaconBlockAltair) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockAltair object to a target array -func (s *SignedBeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockAltair) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockAltair object -func (s *SignedBeaconBlockAltair) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockAltair) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockAltair object -func (s *SignedBeaconBlockAltair) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockAltair) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockAltair object -func (s *SignedBeaconBlockAltair) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockAltair object with a hasher -func (s *SignedBeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBody object -func (b *BeaconBlockBody) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBody object to a target array -func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(220) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBody object -func (b *BeaconBlockBody) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 220 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 220 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBody object -func (b *BeaconBlockBody) SizeSSZ() (size int) { - size = 220 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBody object -func (b *BeaconBlockBody) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBody object with a hasher -func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyAltair object -func (b *BeaconBlockBodyAltair) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyAltair object to a target array -func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(380) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyAltair object -func (b *BeaconBlockBodyAltair) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 380 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 380 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyAltair object -func (b *BeaconBlockBodyAltair) SizeSSZ() (size int) { - size = 380 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyAltair object -func (b *BeaconBlockBodyAltair) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyAltair object with a hasher -func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ProposerSlashing object -func (p *ProposerSlashing) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the ProposerSlashing object to a target array -func (p *ProposerSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Header_1' - if p.Header_1 == nil { - p.Header_1 = new(SignedBeaconBlockHeader) - } - if dst, err = p.Header_1.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Header_2' - if p.Header_2 == nil { - p.Header_2 = new(SignedBeaconBlockHeader) - } - if dst, err = p.Header_2.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the ProposerSlashing object -func (p *ProposerSlashing) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 416 { - return ssz.ErrSize - } - - // Field (0) 'Header_1' - if p.Header_1 == nil { - p.Header_1 = new(SignedBeaconBlockHeader) - } - if err = p.Header_1.UnmarshalSSZ(buf[0:208]); err != nil { - return err - } - - // Field (1) 'Header_2' - if p.Header_2 == nil { - p.Header_2 = new(SignedBeaconBlockHeader) - } - if err = p.Header_2.UnmarshalSSZ(buf[208:416]); err != nil { - return err - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ProposerSlashing object -func (p *ProposerSlashing) SizeSSZ() (size int) { - size = 416 - return -} - -// HashTreeRoot ssz hashes the ProposerSlashing object -func (p *ProposerSlashing) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the ProposerSlashing object with a hasher -func (p *ProposerSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header_1' - if err = p.Header_1.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Header_2' - if err = p.Header_2.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttesterSlashing object -func (a *AttesterSlashing) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttesterSlashing object to a target array -func (a *AttesterSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(8) - - // Offset (0) 'Attestation_1' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestation) - } - offset += a.Attestation_1.SizeSSZ() - - // Offset (1) 'Attestation_2' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestation) - } - offset += a.Attestation_2.SizeSSZ() - - // Field (0) 'Attestation_1' - if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Attestation_2' - if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AttesterSlashing object -func (a *AttesterSlashing) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 8 { - return ssz.ErrSize - } - - tail := buf - var o0, o1 uint64 - - // Offset (0) 'Attestation_1' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 8 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'Attestation_2' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Field (0) 'Attestation_1' - { - buf = tail[o0:o1] - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestation) - } - if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'Attestation_2' - { - buf = tail[o1:] - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestation) - } - if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashing object -func (a *AttesterSlashing) SizeSSZ() (size int) { - size = 8 - - // Field (0) 'Attestation_1' - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestation) - } - size += a.Attestation_1.SizeSSZ() - - // Field (1) 'Attestation_2' - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestation) - } - size += a.Attestation_2.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AttesterSlashing object -func (a *AttesterSlashing) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttesterSlashing object with a hasher -func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Attestation_1' - if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Attestation_2' - if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttesterSlashingElectra object to a target array -func (a *AttesterSlashingElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(8) - - // Offset (0) 'Attestation_1' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestationElectra) - } - offset += a.Attestation_1.SizeSSZ() - - // Offset (1) 'Attestation_2' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestationElectra) - } - offset += a.Attestation_2.SizeSSZ() - - // Field (0) 'Attestation_1' - if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Attestation_2' - if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 8 { - return ssz.ErrSize - } - - tail := buf - var o0, o1 uint64 - - // Offset (0) 'Attestation_1' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 8 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'Attestation_2' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Field (0) 'Attestation_1' - { - buf = tail[o0:o1] - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestationElectra) - } - if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'Attestation_2' - { - buf = tail[o1:] - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestationElectra) - } - if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) SizeSSZ() (size int) { - size = 8 - - // Field (0) 'Attestation_1' - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestationElectra) - } - size += a.Attestation_1.SizeSSZ() - - // Field (1) 'Attestation_2' - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestationElectra) - } - size += a.Attestation_2.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttesterSlashingElectra object with a hasher -func (a *AttesterSlashingElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Attestation_1' - if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Attestation_2' - if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Deposit object -func (d *Deposit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the Deposit object to a target array -func (d *Deposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Proof' - if size := len(d.Proof); size != 33 { - err = ssz.ErrVectorLengthFn("--.Proof", size, 33) - return - } - for ii := 0; ii < 33; ii++ { - if size := len(d.Proof[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.Proof[ii]", size, 32) - return - } - dst = append(dst, d.Proof[ii]...) - } - - // Field (1) 'Data' - if d.Data == nil { - d.Data = new(Deposit_Data) - } - if dst, err = d.Data.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the Deposit object -func (d *Deposit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 1240 { - return ssz.ErrSize - } - - // Field (0) 'Proof' - d.Proof = make([][]byte, 33) - for ii := 0; ii < 33; ii++ { - if cap(d.Proof[ii]) == 0 { - d.Proof[ii] = make([]byte, 0, len(buf[0:1056][ii*32:(ii+1)*32])) - } - d.Proof[ii] = append(d.Proof[ii], buf[0:1056][ii*32:(ii+1)*32]...) - } - - // Field (1) 'Data' - if d.Data == nil { - d.Data = new(Deposit_Data) - } - if err = d.Data.UnmarshalSSZ(buf[1056:1240]); err != nil { - return err - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Deposit object -func (d *Deposit) SizeSSZ() (size int) { - size = 1240 - return -} - -// HashTreeRoot ssz hashes the Deposit object -func (d *Deposit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the Deposit object with a hasher -func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Proof' - { - if size := len(d.Proof); size != 33 { - err = ssz.ErrVectorLengthFn("--.Proof", size, 33) - return - } - subIndx := hh.Index() - for _, i := range d.Proof { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (1) 'Data' - if err = d.Data.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the VoluntaryExit object -func (v *VoluntaryExit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) -} - -// MarshalSSZTo ssz marshals the VoluntaryExit object to a target array -func (v *VoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(v.Epoch)) - - // Field (1) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(v.ValidatorIndex)) - - return -} - -// UnmarshalSSZ ssz unmarshals the VoluntaryExit object -func (v *VoluntaryExit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'Epoch' - v.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ValidatorIndex' - v.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the VoluntaryExit object -func (v *VoluntaryExit) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the VoluntaryExit object -func (v *VoluntaryExit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) -} - -// HashTreeRootWith ssz hashes the VoluntaryExit object with a hasher -func (v *VoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Epoch' - hh.PutUint64(uint64(v.Epoch)) - - // Field (1) 'ValidatorIndex' - hh.PutUint64(uint64(v.ValidatorIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedVoluntaryExit object to a target array -func (s *SignedVoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Exit' - if s.Exit == nil { - s.Exit = new(VoluntaryExit) - } - if dst, err = s.Exit.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 112 { - return ssz.ErrSize - } - - // Field (0) 'Exit' - if s.Exit == nil { - s.Exit = new(VoluntaryExit) - } - if err = s.Exit.UnmarshalSSZ(buf[0:16]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[16:112])) - } - s.Signature = append(s.Signature, buf[16:112]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) SizeSSZ() (size int) { - size = 112 - return -} - -// HashTreeRoot ssz hashes the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedVoluntaryExit object with a hasher -func (s *SignedVoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Exit' - if err = s.Exit.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Eth1Data object -func (e *Eth1Data) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) -} - -// MarshalSSZTo ssz marshals the Eth1Data object to a target array -func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'DepositRoot' - if size := len(e.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - dst = append(dst, e.DepositRoot...) - - // Field (1) 'DepositCount' - dst = ssz.MarshalUint64(dst, e.DepositCount) - - // Field (2) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, e.BlockHash...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Eth1Data object -func (e *Eth1Data) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 72 { - return ssz.ErrSize - } - - // Field (0) 'DepositRoot' - if cap(e.DepositRoot) == 0 { - e.DepositRoot = make([]byte, 0, len(buf[0:32])) - } - e.DepositRoot = append(e.DepositRoot, buf[0:32]...) - - // Field (1) 'DepositCount' - e.DepositCount = ssz.UnmarshallUint64(buf[32:40]) - - // Field (2) 'BlockHash' - if cap(e.BlockHash) == 0 { - e.BlockHash = make([]byte, 0, len(buf[40:72])) - } - e.BlockHash = append(e.BlockHash, buf[40:72]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Eth1Data object -func (e *Eth1Data) SizeSSZ() (size int) { - size = 72 - return -} - -// HashTreeRoot ssz hashes the Eth1Data object -func (e *Eth1Data) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the Eth1Data object with a hasher -func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'DepositRoot' - if size := len(e.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - hh.PutBytes(e.DepositRoot) - - // Field (1) 'DepositCount' - hh.PutUint64(e.DepositCount) - - // Field (2) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - hh.PutBytes(e.BlockHash) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockHeader object -func (b *BeaconBlockHeader) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockHeader object to a target array -func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Field (4) 'BodyRoot' - if size := len(b.BodyRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) - return - } - dst = append(dst, b.BodyRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockHeader object -func (b *BeaconBlockHeader) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 112 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Field (4) 'BodyRoot' - if cap(b.BodyRoot) == 0 { - b.BodyRoot = make([]byte, 0, len(buf[80:112])) - } - b.BodyRoot = append(b.BodyRoot, buf[80:112]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockHeader object -func (b *BeaconBlockHeader) SizeSSZ() (size int) { - size = 112 - return -} - -// HashTreeRoot ssz hashes the BeaconBlockHeader object -func (b *BeaconBlockHeader) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockHeader object with a hasher -func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'BodyRoot' - if size := len(b.BodyRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) - return - } - hh.PutBytes(b.BodyRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockHeader object to a target array -func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Header' - if s.Header == nil { - s.Header = new(BeaconBlockHeader) - } - if dst, err = s.Header.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 208 { - return ssz.ErrSize - } - - // Field (0) 'Header' - if s.Header == nil { - s.Header = new(BeaconBlockHeader) - } - if err = s.Header.UnmarshalSSZ(buf[0:112]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[112:208])) - } - s.Signature = append(s.Signature, buf[112:208]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) SizeSSZ() (size int) { - size = 208 - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockHeader object with a hasher -func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = s.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the IndexedAttestation object -func (i *IndexedAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(i) -} - -// MarshalSSZTo ssz marshals the IndexedAttestation object to a target array -func (i *IndexedAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(228) - - // Offset (0) 'AttestingIndices' - dst = ssz.WriteOffset(dst, offset) - offset += len(i.AttestingIndices) * 8 - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if dst, err = i.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, i.Signature...) - - // Field (0) 'AttestingIndices' - if size := len(i.AttestingIndices); size > 2048 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) - return - } - for ii := 0; ii < len(i.AttestingIndices); ii++ { - dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the IndexedAttestation object -func (i *IndexedAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 228 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AttestingIndices' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 228 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(i.Signature) == 0 { - i.Signature = make([]byte, 0, len(buf[132:228])) - } - i.Signature = append(i.Signature, buf[132:228]...) - - // Field (0) 'AttestingIndices' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 8, 2048) - if err != nil { - return err - } - i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) - for ii := 0; ii < num; ii++ { - i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestation object -func (i *IndexedAttestation) SizeSSZ() (size int) { - size = 228 - - // Field (0) 'AttestingIndices' - size += len(i.AttestingIndices) * 8 - - return -} - -// HashTreeRoot ssz hashes the IndexedAttestation object -func (i *IndexedAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(i) -} - -// HashTreeRootWith ssz hashes the IndexedAttestation object with a hasher -func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AttestingIndices' - { - if size := len(i.AttestingIndices); size > 2048 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) - return - } - subIndx := hh.Index() - for _, i := range i.AttestingIndices { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(i.AttestingIndices)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) - } - } - - // Field (1) 'Data' - if err = i.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(i.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(i) -} - -// MarshalSSZTo ssz marshals the IndexedAttestationElectra object to a target array -func (i *IndexedAttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(228) - - // Offset (0) 'AttestingIndices' - dst = ssz.WriteOffset(dst, offset) - offset += len(i.AttestingIndices) * 8 - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if dst, err = i.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, i.Signature...) - - // Field (0) 'AttestingIndices' - if size := len(i.AttestingIndices); size > 131072 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) - return - } - for ii := 0; ii < len(i.AttestingIndices); ii++ { - dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 228 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AttestingIndices' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 228 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(i.Signature) == 0 { - i.Signature = make([]byte, 0, len(buf[132:228])) - } - i.Signature = append(i.Signature, buf[132:228]...) - - // Field (0) 'AttestingIndices' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 8, 131072) - if err != nil { - return err - } - i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) - for ii := 0; ii < num; ii++ { - i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) SizeSSZ() (size int) { - size = 228 - - // Field (0) 'AttestingIndices' - size += len(i.AttestingIndices) * 8 - - return -} - -// HashTreeRoot ssz hashes the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(i) -} - -// HashTreeRootWith ssz hashes the IndexedAttestationElectra object with a hasher -func (i *IndexedAttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AttestingIndices' - { - if size := len(i.AttestingIndices); size > 131072 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) - return - } - subIndx := hh.Index() - for _, i := range i.AttestingIndices { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(i.AttestingIndices)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) - } - } - - // Field (1) 'Data' - if err = i.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(i.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncAggregate object -func (s *SyncAggregate) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncAggregate object to a target array -func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SyncCommitteeBits' - if size := len(s.SyncCommitteeBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) - return - } - dst = append(dst, s.SyncCommitteeBits...) - - // Field (1) 'SyncCommitteeSignature' - if size := len(s.SyncCommitteeSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) - return - } - dst = append(dst, s.SyncCommitteeSignature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncAggregate object -func (s *SyncAggregate) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 160 { - return ssz.ErrSize - } - - // Field (0) 'SyncCommitteeBits' - if cap(s.SyncCommitteeBits) == 0 { - s.SyncCommitteeBits = make([]byte, 0, len(buf[0:64])) - } - s.SyncCommitteeBits = append(s.SyncCommitteeBits, buf[0:64]...) - - // Field (1) 'SyncCommitteeSignature' - if cap(s.SyncCommitteeSignature) == 0 { - s.SyncCommitteeSignature = make([]byte, 0, len(buf[64:160])) - } - s.SyncCommitteeSignature = append(s.SyncCommitteeSignature, buf[64:160]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregate object -func (s *SyncAggregate) SizeSSZ() (size int) { - size = 160 - return -} - -// HashTreeRoot ssz hashes the SyncAggregate object -func (s *SyncAggregate) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncAggregate object with a hasher -func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SyncCommitteeBits' - if size := len(s.SyncCommitteeBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) - return - } - hh.PutBytes(s.SyncCommitteeBits) - - // Field (1) 'SyncCommitteeSignature' - if size := len(s.SyncCommitteeSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) - return - } - hh.PutBytes(s.SyncCommitteeSignature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockBellatrix object -func (s *SignedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockBellatrix object to a target array -func (s *SignedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockBellatrix) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockBellatrix object -func (s *SignedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockBellatrix) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockBellatrix object -func (s *SignedBeaconBlockBellatrix) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockBellatrix) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockBellatrix object -func (s *SignedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockBellatrix object with a hasher -func (s *SignedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBellatrix object -func (b *BeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBellatrix object to a target array -func (b *BeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BeaconBlockBodyBellatrix) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBellatrix object -func (b *BeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BeaconBlockBodyBellatrix) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBellatrix object -func (b *BeaconBlockBellatrix) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyBellatrix) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBellatrix object -func (b *BeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBellatrix object with a hasher -func (b *BeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyBellatrix object -func (b *BeaconBlockBodyBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyBellatrix object to a target array -func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(384) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayload' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayload) - } - offset += b.ExecutionPayload.SizeSSZ() - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayload' - if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyBellatrix object -func (b *BeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 384 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 384 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayload' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayload' - { - buf = tail[o9:] - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayload) - } - if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyBellatrix object -func (b *BeaconBlockBodyBellatrix) SizeSSZ() (size int) { - size = 384 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayload' - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayload) - } - size += b.ExecutionPayload.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyBellatrix object -func (b *BeaconBlockBodyBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyBellatrix object with a hasher -func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayload' - if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockBellatrix object -func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockBellatrix object to a target array -func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BlindedBeaconBlockBellatrix) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockBellatrix object -func (s *SignedBlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BlindedBeaconBlockBellatrix) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockBellatrix object -func (s *SignedBlindedBeaconBlockBellatrix) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BlindedBeaconBlockBellatrix) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockBellatrix object -func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockBellatrix object with a hasher -func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockBellatrix object -func (b *BlindedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockBellatrix object to a target array -func (b *BlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyBellatrix) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBellatrix object -func (b *BlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyBellatrix) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBellatrix object -func (b *BlindedBeaconBlockBellatrix) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyBellatrix) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockBellatrix object -func (b *BlindedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockBellatrix object with a hasher -func (b *BlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyBellatrix object -func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyBellatrix object to a target array -func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(384) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - offset += b.ExecutionPayloadHeader.SizeSSZ() - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayloadHeader' - if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyBellatrix object -func (b *BlindedBeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 384 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 384 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayloadHeader' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayloadHeader' - { - buf = tail[o9:] - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyBellatrix object -func (b *BlindedBeaconBlockBodyBellatrix) SizeSSZ() (size int) { - size = 384 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayloadHeader' - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - size += b.ExecutionPayloadHeader.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyBellatrix object -func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyBellatrix object with a hasher -func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayloadHeader' - if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockContentsDeneb object -func (s *SignedBeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockContentsDeneb object to a target array -func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(12) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(SignedBeaconBlockDeneb) - } - offset += s.Block.SizeSSZ() - - // Offset (1) 'KzgProofs' - dst = ssz.WriteOffset(dst, offset) - offset += len(s.KzgProofs) * 48 - - // Offset (2) 'Blobs' - dst = ssz.WriteOffset(dst, offset) - offset += len(s.Blobs) * 131072 - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'KzgProofs' - if size := len(s.KzgProofs); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) - return - } - for ii := 0; ii < len(s.KzgProofs); ii++ { - if size := len(s.KzgProofs[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) - return - } - dst = append(dst, s.KzgProofs[ii]...) - } - - // Field (2) 'Blobs' - if size := len(s.Blobs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) - return - } - for ii := 0; ii < len(s.Blobs); ii++ { - if size := len(s.Blobs[ii]); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) - return - } - dst = append(dst, s.Blobs[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockContentsDeneb object -func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 12 { - return ssz.ErrSize - } - - tail := buf - var o0, o1, o2 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 12 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'KzgProofs' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Offset (2) 'Blobs' - if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { - return ssz.ErrOffset - } - - // Field (0) 'Block' - { - buf = tail[o0:o1] - if s.Block == nil { - s.Block = new(SignedBeaconBlockDeneb) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'KzgProofs' - { - buf = tail[o1:o2] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - s.KzgProofs = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(s.KzgProofs[ii]) == 0 { - s.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - s.KzgProofs[ii] = append(s.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (2) 'Blobs' - { - buf = tail[o2:] - num, err := ssz.DivideInt2(len(buf), 131072, 4096) - if err != nil { - return err - } - s.Blobs = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(s.Blobs[ii]) == 0 { - s.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) - } - s.Blobs[ii] = append(s.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockContentsDeneb object -func (s *SignedBeaconBlockContentsDeneb) SizeSSZ() (size int) { - size = 12 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(SignedBeaconBlockDeneb) - } - size += s.Block.SizeSSZ() - - // Field (1) 'KzgProofs' - size += len(s.KzgProofs) * 48 - - // Field (2) 'Blobs' - size += len(s.Blobs) * 131072 - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockContentsDeneb object -func (s *SignedBeaconBlockContentsDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockContentsDeneb object with a hasher -func (s *SignedBeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'KzgProofs' - { - if size := len(s.KzgProofs); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range s.KzgProofs { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(s.KzgProofs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (2) 'Blobs' - { - if size := len(s.Blobs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range s.Blobs { - if len(i) != 131072 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(s.Blobs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockContentsDeneb object -func (b *BeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockContentsDeneb object to a target array -func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(12) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if b.Block == nil { - b.Block = new(BeaconBlockDeneb) - } - offset += b.Block.SizeSSZ() - - // Offset (1) 'KzgProofs' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.KzgProofs) * 48 - - // Offset (2) 'Blobs' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Blobs) * 131072 - - // Field (0) 'Block' - if dst, err = b.Block.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'KzgProofs' - if size := len(b.KzgProofs); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) - return - } - for ii := 0; ii < len(b.KzgProofs); ii++ { - if size := len(b.KzgProofs[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) - return - } - dst = append(dst, b.KzgProofs[ii]...) - } - - // Field (2) 'Blobs' - if size := len(b.Blobs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) - return - } - for ii := 0; ii < len(b.Blobs); ii++ { - if size := len(b.Blobs[ii]); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) - return - } - dst = append(dst, b.Blobs[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockContentsDeneb object -func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 12 { - return ssz.ErrSize - } - - tail := buf - var o0, o1, o2 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 12 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'KzgProofs' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Offset (2) 'Blobs' - if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { - return ssz.ErrOffset - } - - // Field (0) 'Block' - { - buf = tail[o0:o1] - if b.Block == nil { - b.Block = new(BeaconBlockDeneb) - } - if err = b.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'KzgProofs' - { - buf = tail[o1:o2] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.KzgProofs = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.KzgProofs[ii]) == 0 { - b.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.KzgProofs[ii] = append(b.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (2) 'Blobs' - { - buf = tail[o2:] - num, err := ssz.DivideInt2(len(buf), 131072, 4096) - if err != nil { - return err - } - b.Blobs = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.Blobs[ii]) == 0 { - b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) - } - b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockContentsDeneb object -func (b *BeaconBlockContentsDeneb) SizeSSZ() (size int) { - size = 12 - - // Field (0) 'Block' - if b.Block == nil { - b.Block = new(BeaconBlockDeneb) - } - size += b.Block.SizeSSZ() - - // Field (1) 'KzgProofs' - size += len(b.KzgProofs) * 48 - - // Field (2) 'Blobs' - size += len(b.Blobs) * 131072 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockContentsDeneb object -func (b *BeaconBlockContentsDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockContentsDeneb object with a hasher -func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = b.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'KzgProofs' - { - if size := len(b.KzgProofs); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.KzgProofs { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.KzgProofs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (2) 'Blobs' - { - if size := len(b.Blobs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.Blobs { - if len(i) != 131072 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.Blobs)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockDeneb object -func (s *SignedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockDeneb object to a target array -func (s *SignedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockDeneb) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockDeneb object -func (s *SignedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockDeneb) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockDeneb object -func (s *SignedBeaconBlockDeneb) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockDeneb) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockDeneb object -func (s *SignedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockDeneb object with a hasher -func (s *SignedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockDeneb object -func (b *BeaconBlockDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockDeneb object to a target array -func (b *BeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BeaconBlockBodyDeneb) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockDeneb object -func (b *BeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BeaconBlockBodyDeneb) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockDeneb object -func (b *BeaconBlockDeneb) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyDeneb) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockDeneb object -func (b *BeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockDeneb object with a hasher -func (b *BeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyDeneb object -func (b *BeaconBlockBodyDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyDeneb object to a target array -func (b *BeaconBlockBodyDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(392) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayload' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) - } - offset += b.ExecutionPayload.SizeSSZ() - - // Offset (10) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Offset (11) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayload' - if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - if size := len(b.BlsToExecutionChanges); size > 16 { - err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) - return - } - for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { - if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'BlobKzgCommitments' - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { - if size := len(b.BlobKzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) - return - } - dst = append(dst, b.BlobKzgCommitments[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyDeneb object -func (b *BeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 392 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 392 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayload' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Offset (10) 'BlsToExecutionChanges' - if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { - return ssz.ErrOffset - } - - // Offset (11) 'BlobKzgCommitments' - if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayload' - { - buf = tail[o9:o10] - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) - } - if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (10) 'BlsToExecutionChanges' - { - buf = tail[o10:o11] - num, err := ssz.DivideInt2(len(buf), 172, 16) - if err != nil { - return err - } - b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) - for ii := 0; ii < num; ii++ { - if b.BlsToExecutionChanges[ii] == nil { - b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) - } - if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { - return err - } - } - } - - // Field (11) 'BlobKzgCommitments' - { - buf = tail[o11:] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.BlobKzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.BlobKzgCommitments[ii]) == 0 { - b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyDeneb object -func (b *BeaconBlockBodyDeneb) SizeSSZ() (size int) { - size = 392 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayload' - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) - } - size += b.ExecutionPayload.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyDeneb object -func (b *BeaconBlockBodyDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyDeneb object with a hasher -func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayload' - if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - { - subIndx := hh.Index() - num := uint64(len(b.BlsToExecutionChanges)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlsToExecutionChanges { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (11) 'BlobKzgCommitments' - { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.BlobKzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockCapella object -func (s *SignedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockCapella object to a target array -func (s *SignedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockCapella) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockCapella object -func (s *SignedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockCapella) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockCapella object -func (s *SignedBeaconBlockCapella) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockCapella) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockCapella object -func (s *SignedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockCapella object with a hasher -func (s *SignedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockCapella object -func (b *BeaconBlockCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockCapella object to a target array -func (b *BeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BeaconBlockBodyCapella) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockCapella object -func (b *BeaconBlockCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BeaconBlockBodyCapella) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockCapella object -func (b *BeaconBlockCapella) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyCapella) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockCapella object -func (b *BeaconBlockCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockCapella object with a hasher -func (b *BeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyCapella object -func (b *BeaconBlockBodyCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyCapella object to a target array -func (b *BeaconBlockBodyCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(388) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayload' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadCapella) - } - offset += b.ExecutionPayload.SizeSSZ() - - // Offset (10) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayload' - if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - if size := len(b.BlsToExecutionChanges); size > 16 { - err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) - return - } - for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { - if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyCapella object -func (b *BeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 388 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 388 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayload' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Offset (10) 'BlsToExecutionChanges' - if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayload' - { - buf = tail[o9:o10] - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadCapella) - } - if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (10) 'BlsToExecutionChanges' - { - buf = tail[o10:] - num, err := ssz.DivideInt2(len(buf), 172, 16) - if err != nil { - return err - } - b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) - for ii := 0; ii < num; ii++ { - if b.BlsToExecutionChanges[ii] == nil { - b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) - } - if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyCapella object -func (b *BeaconBlockBodyCapella) SizeSSZ() (size int) { - size = 388 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayload' - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadCapella) - } - size += b.ExecutionPayload.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyCapella object -func (b *BeaconBlockBodyCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyCapella object with a hasher -func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayload' - if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - { - subIndx := hh.Index() - num := uint64(len(b.BlsToExecutionChanges)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlsToExecutionChanges { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockCapella object -func (s *SignedBlindedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockCapella object to a target array -func (s *SignedBlindedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BlindedBeaconBlockCapella) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockCapella object -func (s *SignedBlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BlindedBeaconBlockCapella) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockCapella object -func (s *SignedBlindedBeaconBlockCapella) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BlindedBeaconBlockCapella) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockCapella object -func (s *SignedBlindedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockCapella object with a hasher -func (s *SignedBlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockCapella object -func (b *BlindedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockCapella object to a target array -func (b *BlindedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyCapella) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockCapella object -func (b *BlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyCapella) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockCapella object -func (b *BlindedBeaconBlockCapella) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyCapella) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockCapella object -func (b *BlindedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockCapella object with a hasher -func (b *BlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyCapella object -func (b *BlindedBeaconBlockBodyCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyCapella object to a target array -func (b *BlindedBeaconBlockBodyCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(388) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - offset += b.ExecutionPayloadHeader.SizeSSZ() - - // Offset (10) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayloadHeader' - if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - if size := len(b.BlsToExecutionChanges); size > 16 { - err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) - return - } - for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { - if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyCapella object -func (b *BlindedBeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 388 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 388 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayloadHeader' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Offset (10) 'BlsToExecutionChanges' - if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayloadHeader' - { - buf = tail[o9:o10] - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (10) 'BlsToExecutionChanges' - { - buf = tail[o10:] - num, err := ssz.DivideInt2(len(buf), 172, 16) - if err != nil { - return err - } - b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) - for ii := 0; ii < num; ii++ { - if b.BlsToExecutionChanges[ii] == nil { - b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) - } - if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyCapella object -func (b *BlindedBeaconBlockBodyCapella) SizeSSZ() (size int) { - size = 388 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayloadHeader' - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - size += b.ExecutionPayloadHeader.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyCapella object -func (b *BlindedBeaconBlockBodyCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyCapella object with a hasher -func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayloadHeader' - if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - { - subIndx := hh.Index() - num := uint64(len(b.BlsToExecutionChanges)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlsToExecutionChanges { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockDeneb object -func (s *SignedBlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockDeneb object to a target array -func (s *SignedBlindedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Message' - dst = ssz.WriteOffset(dst, offset) - if s.Message == nil { - s.Message = new(BlindedBeaconBlockDeneb) - } - offset += s.Message.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Message' - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockDeneb object -func (s *SignedBlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Message' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Message' - { - buf = tail[o0:] - if s.Message == nil { - s.Message = new(BlindedBeaconBlockDeneb) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockDeneb object -func (s *SignedBlindedBeaconBlockDeneb) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BlindedBeaconBlockDeneb) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockDeneb object -func (s *SignedBlindedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockDeneb object with a hasher -func (s *SignedBlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockDeneb object -func (b *BlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockDeneb object to a target array -func (b *BlindedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyDeneb) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockDeneb object -func (b *BlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyDeneb) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockDeneb object -func (b *BlindedBeaconBlockDeneb) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyDeneb) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockDeneb object -func (b *BlindedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockDeneb object with a hasher -func (b *BlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyDeneb object -func (b *BlindedBeaconBlockBodyDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyDeneb object to a target array -func (b *BlindedBeaconBlockBodyDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(392) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - offset += b.ExecutionPayloadHeader.SizeSSZ() - - // Offset (10) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Offset (11) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 2 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 128 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 128) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayloadHeader' - if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - if size := len(b.BlsToExecutionChanges); size > 16 { - err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) - return - } - for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { - if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'BlobKzgCommitments' - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { - if size := len(b.BlobKzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) - return - } - dst = append(dst, b.BlobKzgCommitments[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyDeneb object -func (b *BlindedBeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 392 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 392 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayloadHeader' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Offset (10) 'BlsToExecutionChanges' - if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { - return ssz.ErrOffset - } - - // Offset (11) 'BlobKzgCommitments' - if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 2) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashing) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 128) - if err != nil { - return err - } - b.Attestations = make([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(Attestation) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayloadHeader' - { - buf = tail[o9:o10] - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (10) 'BlsToExecutionChanges' - { - buf = tail[o10:o11] - num, err := ssz.DivideInt2(len(buf), 172, 16) - if err != nil { - return err - } - b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) - for ii := 0; ii < num; ii++ { - if b.BlsToExecutionChanges[ii] == nil { - b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) - } - if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { - return err - } - } - } - - // Field (11) 'BlobKzgCommitments' - { - buf = tail[o11:] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.BlobKzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.BlobKzgCommitments[ii]) == 0 { - b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyDeneb object -func (b *BlindedBeaconBlockBodyDeneb) SizeSSZ() (size int) { - size = 392 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayloadHeader' - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - size += b.ExecutionPayloadHeader.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyDeneb object -func (b *BlindedBeaconBlockBodyDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyDeneb object with a hasher -func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 2 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 128 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - hh.MerkleizeWithMixin(subIndx, num, 128) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayloadHeader' - if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - { - subIndx := hh.Index() - num := uint64(len(b.BlsToExecutionChanges)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlsToExecutionChanges { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (11) 'BlobKzgCommitments' - { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.BlobKzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockElectra object to a target array -func (s *SignedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockElectra) - } - offset += s.Block.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockElectra) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockElectra) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockElectra object with a hasher -func (s *SignedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockElectra object -func (b *BeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockElectra object to a target array -func (b *BeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BeaconBlockBodyElectra) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockElectra object -func (b *BeaconBlockElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BeaconBlockBodyElectra) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockElectra object -func (b *BeaconBlockElectra) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyElectra) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockElectra object -func (b *BeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockElectra object with a hasher -func (b *BeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array -func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(396) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayload' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadElectra) - } - offset += b.ExecutionPayload.SizeSSZ() - - // Offset (10) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Offset (11) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Offset (12) 'Consolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Consolidations) * 120 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 1 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 8 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 8) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayload' - if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - if size := len(b.BlsToExecutionChanges); size > 16 { - err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) - return - } - for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { - if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'BlobKzgCommitments' - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { - if size := len(b.BlobKzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) - return - } - dst = append(dst, b.BlobKzgCommitments[ii]...) - } - - // Field (12) 'Consolidations' - if size := len(b.Consolidations); size > 1 { - err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) - return - } - for ii := 0; ii < len(b.Consolidations); ii++ { - if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 396 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 396 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayload' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Offset (10) 'BlsToExecutionChanges' - if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { - return ssz.ErrOffset - } - - // Offset (11) 'BlobKzgCommitments' - if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Consolidations' - if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 1) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashingElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashingElectra) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 8) - if err != nil { - return err - } - b.Attestations = make([]*AttestationElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(AttestationElectra) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayload' - { - buf = tail[o9:o10] - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadElectra) - } - if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (10) 'BlsToExecutionChanges' - { - buf = tail[o10:o11] - num, err := ssz.DivideInt2(len(buf), 172, 16) - if err != nil { - return err - } - b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) - for ii := 0; ii < num; ii++ { - if b.BlsToExecutionChanges[ii] == nil { - b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) - } - if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { - return err - } - } - } - - // Field (11) 'BlobKzgCommitments' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.BlobKzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.BlobKzgCommitments[ii]) == 0 { - b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (12) 'Consolidations' - { - buf = tail[o12:] - num, err := ssz.DivideInt2(len(buf), 120, 1) - if err != nil { - return err - } - b.Consolidations = make([]*SignedConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.Consolidations[ii] == nil { - b.Consolidations[ii] = new(SignedConsolidation) - } - if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 396 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayload' - if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadElectra) - } - size += b.ExecutionPayload.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - // Field (12) 'Consolidations' - size += len(b.Consolidations) * 120 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyElectra object with a hasher -func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 8 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8) - } else { - hh.MerkleizeWithMixin(subIndx, num, 8) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayload' - if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - { - subIndx := hh.Index() - num := uint64(len(b.BlsToExecutionChanges)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlsToExecutionChanges { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (11) 'BlobKzgCommitments' - { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.BlobKzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (12) 'Consolidations' - { - subIndx := hh.Index() - num := uint64(len(b.Consolidations)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Consolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockElectra object to a target array -func (s *SignedBlindedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Message' - dst = ssz.WriteOffset(dst, offset) - if s.Message == nil { - s.Message = new(BlindedBeaconBlockElectra) - } - offset += s.Message.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Message' - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Message' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Message' - { - buf = tail[o0:] - if s.Message == nil { - s.Message = new(BlindedBeaconBlockElectra) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BlindedBeaconBlockElectra) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockElectra object with a hasher -func (s *SignedBlindedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockElectra object to a target array -func (b *BlindedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - dst = append(dst, b.ParentRoot...) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Offset (4) 'Body' - dst = ssz.WriteOffset(dst, offset) - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyElectra) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o4 uint64 - - // Field (0) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ProposerIndex' - b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'ParentRoot' - if cap(b.ParentRoot) == 0 { - b.ParentRoot = make([]byte, 0, len(buf[16:48])) - } - b.ParentRoot = append(b.ParentRoot, buf[16:48]...) - - // Field (3) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[48:80])) - } - b.StateRoot = append(b.StateRoot, buf[48:80]...) - - // Offset (4) 'Body' - if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { - return ssz.ErrOffset - } - - if o4 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'Body' - { - buf = tail[o4:] - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyElectra) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyElectra) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockElectra object with a hasher -func (b *BlindedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (1) 'ProposerIndex' - hh.PutUint64(uint64(b.ProposerIndex)) - - // Field (2) 'ParentRoot' - if size := len(b.ParentRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) - return - } - hh.PutBytes(b.ParentRoot) - - // Field (3) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - // Field (4) 'Body' - if err = b.Body.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array -func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(396) - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - dst = append(dst, b.RandaoReveal...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - dst = append(dst, b.Graffiti...) - - // Offset (3) 'ProposerSlashings' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.ProposerSlashings) * 416 - - // Offset (4) 'AttesterSlashings' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - offset += 4 - offset += b.AttesterSlashings[ii].SizeSSZ() - } - - // Offset (5) 'Attestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.Attestations); ii++ { - offset += 4 - offset += b.Attestations[ii].SizeSSZ() - } - - // Offset (6) 'Deposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Deposits) * 1240 - - // Offset (7) 'VoluntaryExits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.VoluntaryExits) * 112 - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'ExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - offset += b.ExecutionPayloadHeader.SizeSSZ() - - // Offset (10) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Offset (11) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Offset (12) 'Consolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Consolidations) * 120 - - // Field (3) 'ProposerSlashings' - if size := len(b.ProposerSlashings); size > 16 { - err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) - return - } - for ii := 0; ii < len(b.ProposerSlashings); ii++ { - if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (4) 'AttesterSlashings' - if size := len(b.AttesterSlashings); size > 1 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) - return - } - { - offset = 4 * len(b.AttesterSlashings) - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.AttesterSlashings[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (5) 'Attestations' - if size := len(b.Attestations); size > 8 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 8) - return - } - { - offset = 4 * len(b.Attestations) - for ii := 0; ii < len(b.Attestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.Attestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.Attestations); ii++ { - if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (6) 'Deposits' - if size := len(b.Deposits); size > 16 { - err = ssz.ErrListTooBigFn("--.Deposits", size, 16) - return - } - for ii := 0; ii < len(b.Deposits); ii++ { - if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (7) 'VoluntaryExits' - if size := len(b.VoluntaryExits); size > 16 { - err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) - return - } - for ii := 0; ii < len(b.VoluntaryExits); ii++ { - if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (9) 'ExecutionPayloadHeader' - if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - if size := len(b.BlsToExecutionChanges); size > 16 { - err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) - return - } - for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { - if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'BlobKzgCommitments' - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { - if size := len(b.BlobKzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) - return - } - dst = append(dst, b.BlobKzgCommitments[ii]...) - } - - // Field (12) 'Consolidations' - if size := len(b.Consolidations); size > 1 { - err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) - return - } - for ii := 0; ii < len(b.Consolidations); ii++ { - if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 396 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 - - // Field (0) 'RandaoReveal' - if cap(b.RandaoReveal) == 0 { - b.RandaoReveal = make([]byte, 0, len(buf[0:96])) - } - b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) - - // Field (1) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { - return err - } - - // Field (2) 'Graffiti' - if cap(b.Graffiti) == 0 { - b.Graffiti = make([]byte, 0, len(buf[168:200])) - } - b.Graffiti = append(b.Graffiti, buf[168:200]...) - - // Offset (3) 'ProposerSlashings' - if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 396 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (4) 'AttesterSlashings' - if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { - return ssz.ErrOffset - } - - // Offset (5) 'Attestations' - if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { - return ssz.ErrOffset - } - - // Offset (6) 'Deposits' - if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { - return ssz.ErrOffset - } - - // Offset (7) 'VoluntaryExits' - if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { - return ssz.ErrOffset - } - - // Field (8) 'SyncAggregate' - if b.SyncAggregate == nil { - b.SyncAggregate = new(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'ExecutionPayloadHeader' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Offset (10) 'BlsToExecutionChanges' - if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { - return ssz.ErrOffset - } - - // Offset (11) 'BlobKzgCommitments' - if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Consolidations' - if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(ProposerSlashing) - } - if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { - return err - } - } - } - - // Field (4) 'AttesterSlashings' - { - buf = tail[o4:o5] - num, err := ssz.DecodeDynamicLength(buf, 1) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashingElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashingElectra) - } - if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (5) 'Attestations' - { - buf = tail[o5:o6] - num, err := ssz.DecodeDynamicLength(buf, 8) - if err != nil { - return err - } - b.Attestations = make([]*AttestationElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(AttestationElectra) - } - if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (6) 'Deposits' - { - buf = tail[o6:o7] - num, err := ssz.DivideInt2(len(buf), 1240, 16) - if err != nil { - return err - } - b.Deposits = make([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(Deposit) - } - if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { - return err - } - } - } - - // Field (7) 'VoluntaryExits' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 112, 16) - if err != nil { - return err - } - b.VoluntaryExits = make([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'ExecutionPayloadHeader' - { - buf = tail[o9:o10] - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (10) 'BlsToExecutionChanges' - { - buf = tail[o10:o11] - num, err := ssz.DivideInt2(len(buf), 172, 16) - if err != nil { - return err - } - b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) - for ii := 0; ii < num; ii++ { - if b.BlsToExecutionChanges[ii] == nil { - b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) - } - if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { - return err - } - } - } - - // Field (11) 'BlobKzgCommitments' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.BlobKzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.BlobKzgCommitments[ii]) == 0 { - b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (12) 'Consolidations' - { - buf = tail[o12:] - num, err := ssz.DivideInt2(len(buf), 120, 1) - if err != nil { - return err - } - b.Consolidations = make([]*SignedConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.Consolidations[ii] == nil { - b.Consolidations[ii] = new(SignedConsolidation) - } - if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 396 - - // Field (3) 'ProposerSlashings' - size += len(b.ProposerSlashings) * 416 - - // Field (4) 'AttesterSlashings' - for ii := 0; ii < len(b.AttesterSlashings); ii++ { - size += 4 - size += b.AttesterSlashings[ii].SizeSSZ() - } - - // Field (5) 'Attestations' - for ii := 0; ii < len(b.Attestations); ii++ { - size += 4 - size += b.Attestations[ii].SizeSSZ() - } - - // Field (6) 'Deposits' - size += len(b.Deposits) * 1240 - - // Field (7) 'VoluntaryExits' - size += len(b.VoluntaryExits) * 112 - - // Field (9) 'ExecutionPayloadHeader' - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - size += b.ExecutionPayloadHeader.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - // Field (12) 'Consolidations' - size += len(b.Consolidations) * 120 - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyElectra object with a hasher -func (b *BlindedBeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'RandaoReveal' - if size := len(b.RandaoReveal); size != 96 { - err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) - return - } - hh.PutBytes(b.RandaoReveal) - - // Field (1) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Graffiti' - if size := len(b.Graffiti); size != 32 { - err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) - return - } - hh.PutBytes(b.Graffiti) - - // Field (3) 'ProposerSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.ProposerSlashings)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.ProposerSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 8 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8) - } else { - hh.MerkleizeWithMixin(subIndx, num, 8) - } - } - - // Field (6) 'Deposits' - { - subIndx := hh.Index() - num := uint64(len(b.Deposits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Deposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (7) 'VoluntaryExits' - { - subIndx := hh.Index() - num := uint64(len(b.VoluntaryExits)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.VoluntaryExits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'ExecutionPayloadHeader' - if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (10) 'BlsToExecutionChanges' - { - subIndx := hh.Index() - num := uint64(len(b.BlsToExecutionChanges)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlsToExecutionChanges { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (11) 'BlobKzgCommitments' - { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.BlobKzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (12) 'Consolidations' - { - subIndx := hh.Index() - num := uint64(len(b.Consolidations)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Consolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) -} - -// MarshalSSZTo ssz marshals the ValidatorRegistrationV1 object to a target array -func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'FeeRecipient' - if size := len(v.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - dst = append(dst, v.FeeRecipient...) - - // Field (1) 'GasLimit' - dst = ssz.MarshalUint64(dst, v.GasLimit) - - // Field (2) 'Timestamp' - dst = ssz.MarshalUint64(dst, v.Timestamp) - - // Field (3) 'Pubkey' - if size := len(v.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, v.Pubkey...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 84 { - return ssz.ErrSize - } - - // Field (0) 'FeeRecipient' - if cap(v.FeeRecipient) == 0 { - v.FeeRecipient = make([]byte, 0, len(buf[0:20])) - } - v.FeeRecipient = append(v.FeeRecipient, buf[0:20]...) - - // Field (1) 'GasLimit' - v.GasLimit = ssz.UnmarshallUint64(buf[20:28]) - - // Field (2) 'Timestamp' - v.Timestamp = ssz.UnmarshallUint64(buf[28:36]) - - // Field (3) 'Pubkey' - if cap(v.Pubkey) == 0 { - v.Pubkey = make([]byte, 0, len(buf[36:84])) - } - v.Pubkey = append(v.Pubkey, buf[36:84]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) SizeSSZ() (size int) { - size = 84 - return -} - -// HashTreeRoot ssz hashes the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) -} - -// HashTreeRootWith ssz hashes the ValidatorRegistrationV1 object with a hasher -func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'FeeRecipient' - if size := len(v.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - hh.PutBytes(v.FeeRecipient) - - // Field (1) 'GasLimit' - hh.PutUint64(v.GasLimit) - - // Field (2) 'Timestamp' - hh.PutUint64(v.Timestamp) - - // Field (3) 'Pubkey' - if size := len(v.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(v.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedValidatorRegistrationV1 object to a target array -func (s *SignedValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ValidatorRegistrationV1) - } - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 180 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ValidatorRegistrationV1) - } - if err = s.Message.UnmarshalSSZ(buf[0:84]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[84:180])) - } - s.Signature = append(s.Signature, buf[84:180]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) SizeSSZ() (size int) { - size = 180 - return -} - -// HashTreeRoot ssz hashes the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedValidatorRegistrationV1 object with a hasher -func (s *SignedValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BuilderBid object -func (b *BuilderBid) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBid object to a target array -func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - offset += b.Header.SizeSSZ() - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BuilderBid object -func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) - } - b.Value = append(b.Value, buf[4:36]...) - - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) - } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - - // Field (0) 'Header' - { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object -func (b *BuilderBid) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - size += b.Header.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BuilderBid object -func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBid object with a hasher -func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BuilderBidCapella object -func (b *BuilderBidCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBidCapella object to a target array -func (b *BuilderBidCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - offset += b.Header.SizeSSZ() - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BuilderBidCapella object -func (b *BuilderBidCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) - } - b.Value = append(b.Value, buf[4:36]...) - - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) - } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - - // Field (0) 'Header' - { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidCapella object -func (b *BuilderBidCapella) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - size += b.Header.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BuilderBidCapella object -func (b *BuilderBidCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBidCapella object with a hasher -func (b *BuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BuilderBidDeneb object -func (b *BuilderBidDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBidDeneb object to a target array -func (b *BuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(88) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - offset += b.Header.SizeSSZ() - - // Offset (1) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Field (2) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (3) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'BlobKzgCommitments' - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { - if size := len(b.BlobKzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) - return - } - dst = append(dst, b.BlobKzgCommitments[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BuilderBidDeneb object -func (b *BuilderBidDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 88 { - return ssz.ErrSize - } - - tail := buf - var o0, o1 uint64 - - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 88 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'BlobKzgCommitments' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Field (2) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[8:40])) - } - b.Value = append(b.Value, buf[8:40]...) - - // Field (3) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[40:88])) - } - b.Pubkey = append(b.Pubkey, buf[40:88]...) - - // Field (0) 'Header' - { - buf = tail[o0:o1] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'BlobKzgCommitments' - { - buf = tail[o1:] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.BlobKzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.BlobKzgCommitments[ii]) == 0 { - b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidDeneb object -func (b *BuilderBidDeneb) SizeSSZ() (size int) { - size = 88 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - size += b.Header.SizeSSZ() - - // Field (1) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - return -} - -// HashTreeRoot ssz hashes the BuilderBidDeneb object -func (b *BuilderBidDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBidDeneb object with a hasher -func (b *BuilderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'BlobKzgCommitments' - { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.BlobKzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (2) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (3) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecar object -func (b *BlobSidecar) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecar object to a target array -func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, b.Index) - - // Field (1) 'Blob' - if size := len(b.Blob); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) - return - } - dst = append(dst, b.Blob...) - - // Field (2) 'KzgCommitment' - if size := len(b.KzgCommitment); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) - return - } - dst = append(dst, b.KzgCommitment...) - - // Field (3) 'KzgProof' - if size := len(b.KzgProof); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) - return - } - dst = append(dst, b.KzgProof...) - - // Field (4) 'SignedBlockHeader' - if b.SignedBlockHeader == nil { - b.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if dst, err = b.SignedBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'CommitmentInclusionProof' - if size := len(b.CommitmentInclusionProof); size != 17 { - err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) - return - } - for ii := 0; ii < 17; ii++ { - if size := len(b.CommitmentInclusionProof[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.CommitmentInclusionProof[ii]", size, 32) - return - } - dst = append(dst, b.CommitmentInclusionProof[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecar object -func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 131928 { - return ssz.ErrSize - } - - // Field (0) 'Index' - b.Index = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'Blob' - if cap(b.Blob) == 0 { - b.Blob = make([]byte, 0, len(buf[8:131080])) - } - b.Blob = append(b.Blob, buf[8:131080]...) - - // Field (2) 'KzgCommitment' - if cap(b.KzgCommitment) == 0 { - b.KzgCommitment = make([]byte, 0, len(buf[131080:131128])) - } - b.KzgCommitment = append(b.KzgCommitment, buf[131080:131128]...) - - // Field (3) 'KzgProof' - if cap(b.KzgProof) == 0 { - b.KzgProof = make([]byte, 0, len(buf[131128:131176])) - } - b.KzgProof = append(b.KzgProof, buf[131128:131176]...) - - // Field (4) 'SignedBlockHeader' - if b.SignedBlockHeader == nil { - b.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if err = b.SignedBlockHeader.UnmarshalSSZ(buf[131176:131384]); err != nil { - return err - } - - // Field (5) 'CommitmentInclusionProof' - b.CommitmentInclusionProof = make([][]byte, 17) - for ii := 0; ii < 17; ii++ { - if cap(b.CommitmentInclusionProof[ii]) == 0 { - b.CommitmentInclusionProof[ii] = make([]byte, 0, len(buf[131384:131928][ii*32:(ii+1)*32])) - } - b.CommitmentInclusionProof[ii] = append(b.CommitmentInclusionProof[ii], buf[131384:131928][ii*32:(ii+1)*32]...) - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecar object -func (b *BlobSidecar) SizeSSZ() (size int) { - size = 131928 - return -} - -// HashTreeRoot ssz hashes the BlobSidecar object -func (b *BlobSidecar) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobSidecar object with a hasher -func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(b.Index) - - // Field (1) 'Blob' - if size := len(b.Blob); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) - return - } - hh.PutBytes(b.Blob) - - // Field (2) 'KzgCommitment' - if size := len(b.KzgCommitment); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) - return - } - hh.PutBytes(b.KzgCommitment) - - // Field (3) 'KzgProof' - if size := len(b.KzgProof); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) - return - } - hh.PutBytes(b.KzgProof) - - // Field (4) 'SignedBlockHeader' - if err = b.SignedBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'CommitmentInclusionProof' - { - if size := len(b.CommitmentInclusionProof); size != 17 { - err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) - return - } - subIndx := hh.Index() - for _, i := range b.CommitmentInclusionProof { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecars object -func (b *BlobSidecars) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecars object to a target array -func (b *BlobSidecars) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(4) - - // Offset (0) 'Sidecars' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Sidecars) * 131928 - - // Field (0) 'Sidecars' - if size := len(b.Sidecars); size > 6 { - err = ssz.ErrListTooBigFn("--.Sidecars", size, 6) - return - } - for ii := 0; ii < len(b.Sidecars); ii++ { - if dst, err = b.Sidecars[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecars object -func (b *BlobSidecars) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 4 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Sidecars' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 4 { - return ssz.ErrInvalidVariableOffset - } - - // Field (0) 'Sidecars' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 131928, 6) - if err != nil { - return err - } - b.Sidecars = make([]*BlobSidecar, num) - for ii := 0; ii < num; ii++ { - if b.Sidecars[ii] == nil { - b.Sidecars[ii] = new(BlobSidecar) - } - if err = b.Sidecars[ii].UnmarshalSSZ(buf[ii*131928 : (ii+1)*131928]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecars object -func (b *BlobSidecars) SizeSSZ() (size int) { - size = 4 - - // Field (0) 'Sidecars' - size += len(b.Sidecars) * 131928 - - return -} - -// HashTreeRoot ssz hashes the BlobSidecars object -func (b *BlobSidecars) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobSidecars object with a hasher -func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Sidecars' - { - subIndx := hh.Index() - num := uint64(len(b.Sidecars)) - if num > 6 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Sidecars { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6) - } else { - hh.MerkleizeWithMixin(subIndx, num, 6) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Deposit_Data object -func (d *Deposit_Data) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the Deposit_Data object to a target array -func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, d.PublicKey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) - - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) - - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, d.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Deposit_Data object -func (d *Deposit_Data) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 184 { - return ssz.ErrSize - } - - // Field (0) 'PublicKey' - if cap(d.PublicKey) == 0 { - d.PublicKey = make([]byte, 0, len(buf[0:48])) - } - d.PublicKey = append(d.PublicKey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) - - // Field (3) 'Signature' - if cap(d.Signature) == 0 { - d.Signature = make([]byte, 0, len(buf[88:184])) - } - d.Signature = append(d.Signature, buf[88:184]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Deposit_Data object -func (d *Deposit_Data) SizeSSZ() (size int) { - size = 184 - return -} - -// HashTreeRoot ssz hashes the Deposit_Data object -func (d *Deposit_Data) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the Deposit_Data object with a hasher -func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - hh.PutBytes(d.PublicKey) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(d.WithdrawalCredentials) - - // Field (2) 'Amount' - hh.PutUint64(d.Amount) - - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(d.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconState object -func (b *BeaconState) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconState object to a target array -func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2687377) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochAttestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - offset += 4 - offset += b.PreviousEpochAttestations[ii].SizeSSZ() - } - - // Offset (16) 'CurrentEpochAttestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - offset += 4 - offset += b.CurrentEpochAttestations[ii].SizeSSZ() - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochAttestations' - if size := len(b.PreviousEpochAttestations); size > 4096 { - err = ssz.ErrListTooBigFn("--.PreviousEpochAttestations", size, 4096) - return - } - { - offset = 4 * len(b.PreviousEpochAttestations) - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.PreviousEpochAttestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - if dst, err = b.PreviousEpochAttestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (16) 'CurrentEpochAttestations' - if size := len(b.CurrentEpochAttestations); size > 4096 { - err = ssz.ErrListTooBigFn("--.CurrentEpochAttestations", size, 4096) - return - } - { - offset = 4 * len(b.CurrentEpochAttestations) - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.CurrentEpochAttestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - if dst, err = b.CurrentEpochAttestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconState object -func (b *BeaconState) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2687377 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2687377 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochAttestations' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochAttestations' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochAttestations' - { - buf = tail[o15:o16] - num, err := ssz.DecodeDynamicLength(buf, 4096) - if err != nil { - return err - } - b.PreviousEpochAttestations = make([]*PendingAttestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.PreviousEpochAttestations[indx] == nil { - b.PreviousEpochAttestations[indx] = new(PendingAttestation) - } - if err = b.PreviousEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (16) 'CurrentEpochAttestations' - { - buf = tail[o16:] - num, err := ssz.DecodeDynamicLength(buf, 4096) - if err != nil { - return err - } - b.CurrentEpochAttestations = make([]*PendingAttestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.CurrentEpochAttestations[indx] == nil { - b.CurrentEpochAttestations[indx] = new(PendingAttestation) - } - if err = b.CurrentEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconState object -func (b *BeaconState) SizeSSZ() (size int) { - size = 2687377 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochAttestations' - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - size += 4 - size += b.PreviousEpochAttestations[ii].SizeSSZ() - } - - // Field (16) 'CurrentEpochAttestations' - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - size += 4 - size += b.CurrentEpochAttestations[ii].SizeSSZ() - } - - return -} - -// HashTreeRoot ssz hashes the BeaconState object -func (b *BeaconState) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconState object with a hasher -func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.PreviousEpochAttestations)) - if num > 4096 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PreviousEpochAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4096) - } - } - - // Field (16) 'CurrentEpochAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.CurrentEpochAttestations)) - if num > 4096 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.CurrentEpochAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4096) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateAltair object -func (b *BeaconStateAltair) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateAltair object to a target array -func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736629) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateAltair object -func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736629 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736629 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateAltair object -func (b *BeaconStateAltair) SizeSSZ() (size int) { - size = 2736629 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateAltair object -func (b *BeaconStateAltair) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateAltair object with a hasher -func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Fork object -func (f *Fork) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(f) -} - -// MarshalSSZTo ssz marshals the Fork object to a target array -func (f *Fork) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PreviousVersion' - if size := len(f.PreviousVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) - return - } - dst = append(dst, f.PreviousVersion...) - - // Field (1) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - dst = append(dst, f.CurrentVersion...) - - // Field (2) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(f.Epoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Fork object -func (f *Fork) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'PreviousVersion' - if cap(f.PreviousVersion) == 0 { - f.PreviousVersion = make([]byte, 0, len(buf[0:4])) - } - f.PreviousVersion = append(f.PreviousVersion, buf[0:4]...) - - // Field (1) 'CurrentVersion' - if cap(f.CurrentVersion) == 0 { - f.CurrentVersion = make([]byte, 0, len(buf[4:8])) - } - f.CurrentVersion = append(f.CurrentVersion, buf[4:8]...) - - // Field (2) 'Epoch' - f.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Fork object -func (f *Fork) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the Fork object -func (f *Fork) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(f) -} - -// HashTreeRootWith ssz hashes the Fork object with a hasher -func (f *Fork) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PreviousVersion' - if size := len(f.PreviousVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) - return - } - hh.PutBytes(f.PreviousVersion) - - // Field (1) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - hh.PutBytes(f.CurrentVersion) - - // Field (2) 'Epoch' - hh.PutUint64(uint64(f.Epoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingAttestation object -func (p *PendingAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingAttestation object to a target array -func (p *PendingAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(148) - - // Offset (0) 'AggregationBits' - dst = ssz.WriteOffset(dst, offset) - offset += len(p.AggregationBits) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(AttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'InclusionDelay' - dst = ssz.MarshalUint64(dst, uint64(p.InclusionDelay)) - - // Field (3) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(p.ProposerIndex)) - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size > 2048 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) - return - } - dst = append(dst, p.AggregationBits...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingAttestation object -func (p *PendingAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 148 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 148 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(AttestationData) - } - if err = p.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'InclusionDelay' - p.InclusionDelay = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[132:140])) - - // Field (3) 'ProposerIndex' - p.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[140:148])) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 2048); err != nil { - return err - } - if cap(p.AggregationBits) == 0 { - p.AggregationBits = make([]byte, 0, len(buf)) - } - p.AggregationBits = append(p.AggregationBits, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingAttestation object -func (p *PendingAttestation) SizeSSZ() (size int) { - size = 148 - - // Field (0) 'AggregationBits' - size += len(p.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the PendingAttestation object -func (p *PendingAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingAttestation object with a hasher -func (p *PendingAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(p.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist - return - } - hh.PutBitlist(p.AggregationBits, 2048) - - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'InclusionDelay' - hh.PutUint64(uint64(p.InclusionDelay)) - - // Field (3) 'ProposerIndex' - hh.PutUint64(uint64(p.ProposerIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the HistoricalBatch object -func (h *HistoricalBatch) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(h) -} - -// MarshalSSZTo ssz marshals the HistoricalBatch object to a target array -func (h *HistoricalBatch) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockRoots' - if size := len(h.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(h.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, h.BlockRoots[ii]...) - } - - // Field (1) 'StateRoots' - if size := len(h.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(h.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, h.StateRoots[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the HistoricalBatch object -func (h *HistoricalBatch) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 524288 { - return ssz.ErrSize - } - - // Field (0) 'BlockRoots' - h.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(h.BlockRoots[ii]) == 0 { - h.BlockRoots[ii] = make([]byte, 0, len(buf[0:262144][ii*32:(ii+1)*32])) - } - h.BlockRoots[ii] = append(h.BlockRoots[ii], buf[0:262144][ii*32:(ii+1)*32]...) - } - - // Field (1) 'StateRoots' - h.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(h.StateRoots[ii]) == 0 { - h.StateRoots[ii] = make([]byte, 0, len(buf[262144:524288][ii*32:(ii+1)*32])) - } - h.StateRoots[ii] = append(h.StateRoots[ii], buf[262144:524288][ii*32:(ii+1)*32]...) - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the HistoricalBatch object -func (h *HistoricalBatch) SizeSSZ() (size int) { - size = 524288 - return -} - -// HashTreeRoot ssz hashes the HistoricalBatch object -func (h *HistoricalBatch) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(h) -} - -// HashTreeRootWith ssz hashes the HistoricalBatch object with a hasher -func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockRoots' - { - if size := len(h.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range h.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (1) 'StateRoots' - { - if size := len(h.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range h.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SigningData object -func (s *SigningData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SigningData object to a target array -func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ObjectRoot' - if size := len(s.ObjectRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) - return - } - dst = append(dst, s.ObjectRoot...) - - // Field (1) 'Domain' - if size := len(s.Domain); size != 32 { - err = ssz.ErrBytesLengthFn("--.Domain", size, 32) - return - } - dst = append(dst, s.Domain...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SigningData object -func (s *SigningData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 64 { - return ssz.ErrSize - } - - // Field (0) 'ObjectRoot' - if cap(s.ObjectRoot) == 0 { - s.ObjectRoot = make([]byte, 0, len(buf[0:32])) - } - s.ObjectRoot = append(s.ObjectRoot, buf[0:32]...) - - // Field (1) 'Domain' - if cap(s.Domain) == 0 { - s.Domain = make([]byte, 0, len(buf[32:64])) - } - s.Domain = append(s.Domain, buf[32:64]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SigningData object -func (s *SigningData) SizeSSZ() (size int) { - size = 64 - return -} - -// HashTreeRoot ssz hashes the SigningData object -func (s *SigningData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SigningData object with a hasher -func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ObjectRoot' - if size := len(s.ObjectRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) - return - } - hh.PutBytes(s.ObjectRoot) - - // Field (1) 'Domain' - if size := len(s.Domain); size != 32 { - err = ssz.ErrBytesLengthFn("--.Domain", size, 32) - return - } - hh.PutBytes(s.Domain) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ForkData object -func (f *ForkData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(f) -} - -// MarshalSSZTo ssz marshals the ForkData object to a target array -func (f *ForkData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - dst = append(dst, f.CurrentVersion...) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(f.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, f.GenesisValidatorsRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ForkData object -func (f *ForkData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 36 { - return ssz.ErrSize - } - - // Field (0) 'CurrentVersion' - if cap(f.CurrentVersion) == 0 { - f.CurrentVersion = make([]byte, 0, len(buf[0:4])) - } - f.CurrentVersion = append(f.CurrentVersion, buf[0:4]...) - - // Field (1) 'GenesisValidatorsRoot' - if cap(f.GenesisValidatorsRoot) == 0 { - f.GenesisValidatorsRoot = make([]byte, 0, len(buf[4:36])) - } - f.GenesisValidatorsRoot = append(f.GenesisValidatorsRoot, buf[4:36]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ForkData object -func (f *ForkData) SizeSSZ() (size int) { - size = 36 - return -} - -// HashTreeRoot ssz hashes the ForkData object -func (f *ForkData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(f) -} - -// HashTreeRootWith ssz hashes the ForkData object with a hasher -func (f *ForkData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - hh.PutBytes(f.CurrentVersion) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(f.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(f.GenesisValidatorsRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the DepositMessage object -func (d *DepositMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DepositMessage object to a target array -func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, d.PublicKey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) - - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) - - return -} - -// UnmarshalSSZ ssz unmarshals the DepositMessage object -func (d *DepositMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 88 { - return ssz.ErrSize - } - - // Field (0) 'PublicKey' - if cap(d.PublicKey) == 0 { - d.PublicKey = make([]byte, 0, len(buf[0:48])) - } - d.PublicKey = append(d.PublicKey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DepositMessage object -func (d *DepositMessage) SizeSSZ() (size int) { - size = 88 - return -} - -// HashTreeRoot ssz hashes the DepositMessage object -func (d *DepositMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DepositMessage object with a hasher -func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - hh.PutBytes(d.PublicKey) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(d.WithdrawalCredentials) - - // Field (2) 'Amount' - hh.PutUint64(d.Amount) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncCommittee object -func (s *SyncCommittee) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncCommittee object to a target array -func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Pubkeys' - if size := len(s.Pubkeys); size != 512 { - err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) - return - } - for ii := 0; ii < 512; ii++ { - if size := len(s.Pubkeys[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48) - return - } - dst = append(dst, s.Pubkeys[ii]...) - } - - // Field (1) 'AggregatePubkey' - if size := len(s.AggregatePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) - return - } - dst = append(dst, s.AggregatePubkey...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncCommittee object -func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24624 { - return ssz.ErrSize - } - - // Field (0) 'Pubkeys' - s.Pubkeys = make([][]byte, 512) - for ii := 0; ii < 512; ii++ { - if cap(s.Pubkeys[ii]) == 0 { - s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48])) - } - s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...) - } - - // Field (1) 'AggregatePubkey' - if cap(s.AggregatePubkey) == 0 { - s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624])) - } - s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object -func (s *SyncCommittee) SizeSSZ() (size int) { - size = 24624 - return -} - -// HashTreeRoot ssz hashes the SyncCommittee object -func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncCommittee object with a hasher -func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Pubkeys' - { - if size := len(s.Pubkeys); size != 512 { - err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) - return - } - subIndx := hh.Index() - for _, i := range s.Pubkeys { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (1) 'AggregatePubkey' - if size := len(s.AggregatePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) - return - } - hh.PutBytes(s.AggregatePubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncAggregatorSelectionData object to a target array -func (s *SyncAggregatorSelectionData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - - // Field (1) 'SubcommitteeIndex' - dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'SubcommitteeIndex' - s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[8:16]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncAggregatorSelectionData object with a hasher -func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) - - // Field (1) 'SubcommitteeIndex' - hh.PutUint64(s.SubcommitteeIndex) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateBellatrix object to a target array -func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736633) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736633 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736633 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) SizeSSZ() (size int) { - size = 2736633 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateBellatrix object with a hasher -func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateCapella object -func (b *BeaconStateCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateCapella object to a target array -func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736653) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (25) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (27) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (27) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateCapella object -func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736653 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736653 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (25) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) - - // Field (26) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) - - // Offset (27) 'HistoricalSummaries' - if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:o27] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (27) 'HistoricalSummaries' - { - buf = tail[o27:] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateCapella object -func (b *BeaconStateCapella) SizeSSZ() (size int) { - size = 2736653 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (27) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateCapella object -func (b *BeaconStateCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateCapella object with a hasher -func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (25) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (27) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateDeneb object -func (b *BeaconStateDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateDeneb object to a target array -func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736653) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (25) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (27) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (27) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateDeneb object -func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736653 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736653 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (25) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) - - // Field (26) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) - - // Offset (27) 'HistoricalSummaries' - if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:o27] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (27) 'HistoricalSummaries' - { - buf = tail[o27:] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateDeneb object -func (b *BeaconStateDeneb) SizeSSZ() (size int) { - size = 2736653 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (27) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateDeneb object -func (b *BeaconStateDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateDeneb object with a hasher -func (b *BeaconStateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (25) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (27) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateElectra object -func (b *BeaconStateElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateElectra object to a target array -func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736713) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (25) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (27) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (28) 'DepositRequestsStartIndex' - dst = ssz.MarshalUint64(dst, b.DepositRequestsStartIndex) - - // Field (29) 'DepositBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) - - // Field (30) 'ExitBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.ExitBalanceToConsume)) - - // Field (31) 'EarliestExitEpoch' - dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) - - // Field (32) 'ConsolidationBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.ConsolidationBalanceToConsume)) - - // Field (33) 'EarliestConsolidationEpoch' - dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) - - // Offset (34) 'PendingBalanceDeposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingBalanceDeposits) * 16 - - // Offset (35) 'PendingPartialWithdrawals' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingPartialWithdrawals) * 24 - - // Offset (36) 'PendingConsolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingConsolidations) * 16 - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (27) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (34) 'PendingBalanceDeposits' - if size := len(b.PendingBalanceDeposits); size > 134217728 { - err = ssz.ErrListTooBigFn("--.PendingBalanceDeposits", size, 134217728) - return - } - for ii := 0; ii < len(b.PendingBalanceDeposits); ii++ { - if dst, err = b.PendingBalanceDeposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (35) 'PendingPartialWithdrawals' - if size := len(b.PendingPartialWithdrawals); size > 134217728 { - err = ssz.ErrListTooBigFn("--.PendingPartialWithdrawals", size, 134217728) - return - } - for ii := 0; ii < len(b.PendingPartialWithdrawals); ii++ { - if dst, err = b.PendingPartialWithdrawals[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (36) 'PendingConsolidations' - if size := len(b.PendingConsolidations); size > 262144 { - err = ssz.ErrListTooBigFn("--.PendingConsolidations", size, 262144) - return - } - for ii := 0; ii < len(b.PendingConsolidations); ii++ { - if dst, err = b.PendingConsolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateElectra object -func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736713 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27, o34, o35, o36 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736713 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (25) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) - - // Field (26) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) - - // Offset (27) 'HistoricalSummaries' - if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { - return ssz.ErrOffset - } - - // Field (28) 'DepositRequestsStartIndex' - b.DepositRequestsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) - - // Field (29) 'DepositBalanceToConsume' - b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) - - // Field (30) 'ExitBalanceToConsume' - b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736669:2736677])) - - // Field (31) 'EarliestExitEpoch' - b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736677:2736685])) - - // Field (32) 'ConsolidationBalanceToConsume' - b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736685:2736693])) - - // Field (33) 'EarliestConsolidationEpoch' - b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736693:2736701])) - - // Offset (34) 'PendingBalanceDeposits' - if o34 = ssz.ReadOffset(buf[2736701:2736705]); o34 > size || o27 > o34 { - return ssz.ErrOffset - } - - // Offset (35) 'PendingPartialWithdrawals' - if o35 = ssz.ReadOffset(buf[2736705:2736709]); o35 > size || o34 > o35 { - return ssz.ErrOffset - } - - // Offset (36) 'PendingConsolidations' - if o36 = ssz.ReadOffset(buf[2736709:2736713]); o36 > size || o35 > o36 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:o27] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (27) 'HistoricalSummaries' - { - buf = tail[o27:o34] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - - // Field (34) 'PendingBalanceDeposits' - { - buf = tail[o34:o35] - num, err := ssz.DivideInt2(len(buf), 16, 134217728) - if err != nil { - return err - } - b.PendingBalanceDeposits = make([]*PendingBalanceDeposit, num) - for ii := 0; ii < num; ii++ { - if b.PendingBalanceDeposits[ii] == nil { - b.PendingBalanceDeposits[ii] = new(PendingBalanceDeposit) - } - if err = b.PendingBalanceDeposits[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { - return err - } - } - } - - // Field (35) 'PendingPartialWithdrawals' - { - buf = tail[o35:o36] - num, err := ssz.DivideInt2(len(buf), 24, 134217728) - if err != nil { - return err - } - b.PendingPartialWithdrawals = make([]*PendingPartialWithdrawal, num) - for ii := 0; ii < num; ii++ { - if b.PendingPartialWithdrawals[ii] == nil { - b.PendingPartialWithdrawals[ii] = new(PendingPartialWithdrawal) - } - if err = b.PendingPartialWithdrawals[ii].UnmarshalSSZ(buf[ii*24 : (ii+1)*24]); err != nil { - return err - } - } - } - - // Field (36) 'PendingConsolidations' - { - buf = tail[o36:] - num, err := ssz.DivideInt2(len(buf), 16, 262144) - if err != nil { - return err - } - b.PendingConsolidations = make([]*PendingConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.PendingConsolidations[ii] == nil { - b.PendingConsolidations[ii] = new(PendingConsolidation) - } - if err = b.PendingConsolidations[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateElectra object -func (b *BeaconStateElectra) SizeSSZ() (size int) { - size = 2736713 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (27) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - // Field (34) 'PendingBalanceDeposits' - size += len(b.PendingBalanceDeposits) * 16 - - // Field (35) 'PendingPartialWithdrawals' - size += len(b.PendingPartialWithdrawals) * 24 - - // Field (36) 'PendingConsolidations' - size += len(b.PendingConsolidations) * 16 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateElectra object -func (b *BeaconStateElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateElectra object with a hasher -func (b *BeaconStateElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (25) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (27) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - // Field (28) 'DepositRequestsStartIndex' - hh.PutUint64(b.DepositRequestsStartIndex) - - // Field (29) 'DepositBalanceToConsume' - hh.PutUint64(uint64(b.DepositBalanceToConsume)) - - // Field (30) 'ExitBalanceToConsume' - hh.PutUint64(uint64(b.ExitBalanceToConsume)) - - // Field (31) 'EarliestExitEpoch' - hh.PutUint64(uint64(b.EarliestExitEpoch)) - - // Field (32) 'ConsolidationBalanceToConsume' - hh.PutUint64(uint64(b.ConsolidationBalanceToConsume)) - - // Field (33) 'EarliestConsolidationEpoch' - hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) - - // Field (34) 'PendingBalanceDeposits' - { - subIndx := hh.Index() - num := uint64(len(b.PendingBalanceDeposits)) - if num > 134217728 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingBalanceDeposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) - } else { - hh.MerkleizeWithMixin(subIndx, num, 134217728) - } - } - - // Field (35) 'PendingPartialWithdrawals' - { - subIndx := hh.Index() - num := uint64(len(b.PendingPartialWithdrawals)) - if num > 134217728 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingPartialWithdrawals { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) - } else { - hh.MerkleizeWithMixin(subIndx, num, 134217728) - } - } - - // Field (36) 'PendingConsolidations' - { - subIndx := hh.Index() - num := uint64(len(b.PendingConsolidations)) - if num > 262144 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingConsolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 262144) - } else { - hh.MerkleizeWithMixin(subIndx, num, 262144) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PowBlock object -func (p *PowBlock) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PowBlock object to a target array -func (p *PowBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockHash' - if size := len(p.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, p.BlockHash...) - - // Field (1) 'ParentHash' - if size := len(p.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - dst = append(dst, p.ParentHash...) - - // Field (2) 'TotalDifficulty' - if size := len(p.TotalDifficulty); size != 32 { - err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) - return - } - dst = append(dst, p.TotalDifficulty...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PowBlock object -func (p *PowBlock) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 96 { - return ssz.ErrSize - } - - // Field (0) 'BlockHash' - if cap(p.BlockHash) == 0 { - p.BlockHash = make([]byte, 0, len(buf[0:32])) - } - p.BlockHash = append(p.BlockHash, buf[0:32]...) - - // Field (1) 'ParentHash' - if cap(p.ParentHash) == 0 { - p.ParentHash = make([]byte, 0, len(buf[32:64])) - } - p.ParentHash = append(p.ParentHash, buf[32:64]...) - - // Field (2) 'TotalDifficulty' - if cap(p.TotalDifficulty) == 0 { - p.TotalDifficulty = make([]byte, 0, len(buf[64:96])) - } - p.TotalDifficulty = append(p.TotalDifficulty, buf[64:96]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PowBlock object -func (p *PowBlock) SizeSSZ() (size int) { - size = 96 - return -} - -// HashTreeRoot ssz hashes the PowBlock object -func (p *PowBlock) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PowBlock object with a hasher -func (p *PowBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockHash' - if size := len(p.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - hh.PutBytes(p.BlockHash) - - // Field (1) 'ParentHash' - if size := len(p.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - hh.PutBytes(p.ParentHash) - - // Field (2) 'TotalDifficulty' - if size := len(p.TotalDifficulty); size != 32 { - err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) - return - } - hh.PutBytes(p.TotalDifficulty) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the HistoricalSummary object -func (h *HistoricalSummary) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(h) -} - -// MarshalSSZTo ssz marshals the HistoricalSummary object to a target array -func (h *HistoricalSummary) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockSummaryRoot' - if size := len(h.BlockSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32) - return - } - dst = append(dst, h.BlockSummaryRoot...) - - // Field (1) 'StateSummaryRoot' - if size := len(h.StateSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32) - return - } - dst = append(dst, h.StateSummaryRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the HistoricalSummary object -func (h *HistoricalSummary) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 64 { - return ssz.ErrSize - } - - // Field (0) 'BlockSummaryRoot' - if cap(h.BlockSummaryRoot) == 0 { - h.BlockSummaryRoot = make([]byte, 0, len(buf[0:32])) - } - h.BlockSummaryRoot = append(h.BlockSummaryRoot, buf[0:32]...) - - // Field (1) 'StateSummaryRoot' - if cap(h.StateSummaryRoot) == 0 { - h.StateSummaryRoot = make([]byte, 0, len(buf[32:64])) - } - h.StateSummaryRoot = append(h.StateSummaryRoot, buf[32:64]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the HistoricalSummary object -func (h *HistoricalSummary) SizeSSZ() (size int) { - size = 64 - return -} - -// HashTreeRoot ssz hashes the HistoricalSummary object -func (h *HistoricalSummary) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(h) -} - -// HashTreeRootWith ssz hashes the HistoricalSummary object with a hasher -func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockSummaryRoot' - if size := len(h.BlockSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32) - return - } - hh.PutBytes(h.BlockSummaryRoot) - - // Field (1) 'StateSummaryRoot' - if size := len(h.StateSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32) - return - } - hh.PutBytes(h.StateSummaryRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobIdentifier object -func (b *BlobIdentifier) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobIdentifier object to a target array -func (b *BlobIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockRoot' - if size := len(b.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - dst = append(dst, b.BlockRoot...) - - // Field (1) 'Index' - dst = ssz.MarshalUint64(dst, b.Index) - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobIdentifier object -func (b *BlobIdentifier) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 40 { - return ssz.ErrSize - } - - // Field (0) 'BlockRoot' - if cap(b.BlockRoot) == 0 { - b.BlockRoot = make([]byte, 0, len(buf[0:32])) - } - b.BlockRoot = append(b.BlockRoot, buf[0:32]...) - - // Field (1) 'Index' - b.Index = ssz.UnmarshallUint64(buf[32:40]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobIdentifier object -func (b *BlobIdentifier) SizeSSZ() (size int) { - size = 40 - return -} - -// HashTreeRoot ssz hashes the BlobIdentifier object -func (b *BlobIdentifier) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobIdentifier object with a hasher -func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockRoot' - if size := len(b.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - hh.PutBytes(b.BlockRoot) - - // Field (1) 'Index' - hh.PutUint64(b.Index) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingBalanceDeposit object to a target array -func (p *PendingBalanceDeposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, uint64(p.Index)) - - // Field (1) 'Amount' - dst = ssz.MarshalUint64(dst, p.Amount) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'Index' - p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Amount' - p.Amount = ssz.UnmarshallUint64(buf[8:16]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingBalanceDeposit object with a hasher -func (p *PendingBalanceDeposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(uint64(p.Index)) - - // Field (1) 'Amount' - hh.PutUint64(p.Amount) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingPartialWithdrawal object to a target array -func (p *PendingPartialWithdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, uint64(p.Index)) - - // Field (1) 'Amount' - dst = ssz.MarshalUint64(dst, p.Amount) - - // Field (2) 'WithdrawableEpoch' - dst = ssz.MarshalUint64(dst, uint64(p.WithdrawableEpoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'Index' - p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Amount' - p.Amount = ssz.UnmarshallUint64(buf[8:16]) - - // Field (2) 'WithdrawableEpoch' - p.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingPartialWithdrawal object with a hasher -func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(uint64(p.Index)) - - // Field (1) 'Amount' - hh.PutUint64(p.Amount) - - // Field (2) 'WithdrawableEpoch' - hh.PutUint64(uint64(p.WithdrawableEpoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Consolidation object -func (c *Consolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the Consolidation object to a target array -func (c *Consolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SourceIndex' - dst = ssz.MarshalUint64(dst, uint64(c.SourceIndex)) - - // Field (1) 'TargetIndex' - dst = ssz.MarshalUint64(dst, uint64(c.TargetIndex)) - - // Field (2) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Consolidation object -func (c *Consolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'SourceIndex' - c.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'TargetIndex' - c.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'Epoch' - c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Consolidation object -func (c *Consolidation) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the Consolidation object -func (c *Consolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the Consolidation object with a hasher -func (c *Consolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SourceIndex' - hh.PutUint64(uint64(c.SourceIndex)) - - // Field (1) 'TargetIndex' - hh.PutUint64(uint64(c.TargetIndex)) - - // Field (2) 'Epoch' - hh.PutUint64(uint64(c.Epoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedConsolidation object -func (s *SignedConsolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedConsolidation object to a target array -func (s *SignedConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(Consolidation) - } - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedConsolidation object -func (s *SignedConsolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 120 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(Consolidation) - } - if err = s.Message.UnmarshalSSZ(buf[0:24]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[24:120])) - } - s.Signature = append(s.Signature, buf[24:120]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedConsolidation object -func (s *SignedConsolidation) SizeSSZ() (size int) { - size = 120 - return -} - -// HashTreeRoot ssz hashes the SignedConsolidation object -func (s *SignedConsolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedConsolidation object with a hasher -func (s *SignedConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingConsolidation object -func (p *PendingConsolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingConsolidation object to a target array -func (p *PendingConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SourceIndex' - dst = ssz.MarshalUint64(dst, uint64(p.SourceIndex)) - - // Field (1) 'TargetIndex' - dst = ssz.MarshalUint64(dst, uint64(p.TargetIndex)) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingConsolidation object -func (p *PendingConsolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'SourceIndex' - p.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'TargetIndex' - p.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingConsolidation object -func (p *PendingConsolidation) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the PendingConsolidation object -func (p *PendingConsolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingConsolidation object with a hasher -func (p *PendingConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SourceIndex' - hh.PutUint64(uint64(p.SourceIndex)) - - // Field (1) 'TargetIndex' - hh.PutUint64(uint64(p.TargetIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Status object -func (s *Status) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the Status object to a target array -func (s *Status) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ForkDigest' - if size := len(s.ForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) - return - } - dst = append(dst, s.ForkDigest...) - - // Field (1) 'FinalizedRoot' - if size := len(s.FinalizedRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) - return - } - dst = append(dst, s.FinalizedRoot...) - - // Field (2) 'FinalizedEpoch' - dst = ssz.MarshalUint64(dst, uint64(s.FinalizedEpoch)) - - // Field (3) 'HeadRoot' - if size := len(s.HeadRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) - return - } - dst = append(dst, s.HeadRoot...) - - // Field (4) 'HeadSlot' - dst = ssz.MarshalUint64(dst, uint64(s.HeadSlot)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Status object -func (s *Status) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 84 { - return ssz.ErrSize - } - - // Field (0) 'ForkDigest' - if cap(s.ForkDigest) == 0 { - s.ForkDigest = make([]byte, 0, len(buf[0:4])) - } - s.ForkDigest = append(s.ForkDigest, buf[0:4]...) - - // Field (1) 'FinalizedRoot' - if cap(s.FinalizedRoot) == 0 { - s.FinalizedRoot = make([]byte, 0, len(buf[4:36])) - } - s.FinalizedRoot = append(s.FinalizedRoot, buf[4:36]...) - - // Field (2) 'FinalizedEpoch' - s.FinalizedEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[36:44])) - - // Field (3) 'HeadRoot' - if cap(s.HeadRoot) == 0 { - s.HeadRoot = make([]byte, 0, len(buf[44:76])) - } - s.HeadRoot = append(s.HeadRoot, buf[44:76]...) - - // Field (4) 'HeadSlot' - s.HeadSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[76:84])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Status object -func (s *Status) SizeSSZ() (size int) { - size = 84 - return -} - -// HashTreeRoot ssz hashes the Status object -func (s *Status) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the Status object with a hasher -func (s *Status) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ForkDigest' - if size := len(s.ForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) - return - } - hh.PutBytes(s.ForkDigest) - - // Field (1) 'FinalizedRoot' - if size := len(s.FinalizedRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) - return - } - hh.PutBytes(s.FinalizedRoot) - - // Field (2) 'FinalizedEpoch' - hh.PutUint64(uint64(s.FinalizedEpoch)) - - // Field (3) 'HeadRoot' - if size := len(s.HeadRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) - return - } - hh.PutBytes(s.HeadRoot) - - // Field (4) 'HeadSlot' - hh.PutUint64(uint64(s.HeadSlot)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlocksByRangeRequest object to a target array -func (b *BeaconBlocksByRangeRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'StartSlot' - dst = ssz.MarshalUint64(dst, uint64(b.StartSlot)) - - // Field (1) 'Count' - dst = ssz.MarshalUint64(dst, b.Count) - - // Field (2) 'Step' - dst = ssz.MarshalUint64(dst, b.Step) - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'StartSlot' - b.StartSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Count' - b.Count = ssz.UnmarshallUint64(buf[8:16]) - - // Field (2) 'Step' - b.Step = ssz.UnmarshallUint64(buf[16:24]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlocksByRangeRequest object with a hasher -func (b *BeaconBlocksByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'StartSlot' - hh.PutUint64(uint64(b.StartSlot)) - - // Field (1) 'Count' - hh.PutUint64(b.Count) - - // Field (2) 'Step' - hh.PutUint64(b.Step) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ENRForkID object -func (e *ENRForkID) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) -} - -// MarshalSSZTo ssz marshals the ENRForkID object to a target array -func (e *ENRForkID) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'CurrentForkDigest' - if size := len(e.CurrentForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) - return - } - dst = append(dst, e.CurrentForkDigest...) - - // Field (1) 'NextForkVersion' - if size := len(e.NextForkVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) - return - } - dst = append(dst, e.NextForkVersion...) - - // Field (2) 'NextForkEpoch' - dst = ssz.MarshalUint64(dst, uint64(e.NextForkEpoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the ENRForkID object -func (e *ENRForkID) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'CurrentForkDigest' - if cap(e.CurrentForkDigest) == 0 { - e.CurrentForkDigest = make([]byte, 0, len(buf[0:4])) - } - e.CurrentForkDigest = append(e.CurrentForkDigest, buf[0:4]...) - - // Field (1) 'NextForkVersion' - if cap(e.NextForkVersion) == 0 { - e.NextForkVersion = make([]byte, 0, len(buf[4:8])) - } - e.NextForkVersion = append(e.NextForkVersion, buf[4:8]...) - - // Field (2) 'NextForkEpoch' - e.NextForkEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ENRForkID object -func (e *ENRForkID) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the ENRForkID object -func (e *ENRForkID) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the ENRForkID object with a hasher -func (e *ENRForkID) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'CurrentForkDigest' - if size := len(e.CurrentForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) - return - } - hh.PutBytes(e.CurrentForkDigest) - - // Field (1) 'NextForkVersion' - if size := len(e.NextForkVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) - return - } - hh.PutBytes(e.NextForkVersion) - - // Field (2) 'NextForkEpoch' - hh.PutUint64(uint64(e.NextForkEpoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the MetaDataV0 object -func (m *MetaDataV0) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(m) -} - -// MarshalSSZTo ssz marshals the MetaDataV0 object to a target array -func (m *MetaDataV0) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SeqNumber' - dst = ssz.MarshalUint64(dst, m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - dst = append(dst, m.Attnets...) - - return -} - -// UnmarshalSSZ ssz unmarshals the MetaDataV0 object -func (m *MetaDataV0) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'SeqNumber' - m.SeqNumber = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'Attnets' - if cap(m.Attnets) == 0 { - m.Attnets = make([]byte, 0, len(buf[8:16])) - } - m.Attnets = append(m.Attnets, buf[8:16]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the MetaDataV0 object -func (m *MetaDataV0) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the MetaDataV0 object -func (m *MetaDataV0) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(m) -} - -// HashTreeRootWith ssz hashes the MetaDataV0 object with a hasher -func (m *MetaDataV0) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SeqNumber' - hh.PutUint64(m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - hh.PutBytes(m.Attnets) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the MetaDataV1 object -func (m *MetaDataV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(m) -} - -// MarshalSSZTo ssz marshals the MetaDataV1 object to a target array -func (m *MetaDataV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SeqNumber' - dst = ssz.MarshalUint64(dst, m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - dst = append(dst, m.Attnets...) - - // Field (2) 'Syncnets' - if size := len(m.Syncnets); size != 1 { - err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) - return - } - dst = append(dst, m.Syncnets...) - - return -} - -// UnmarshalSSZ ssz unmarshals the MetaDataV1 object -func (m *MetaDataV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 17 { - return ssz.ErrSize - } - - // Field (0) 'SeqNumber' - m.SeqNumber = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'Attnets' - if cap(m.Attnets) == 0 { - m.Attnets = make([]byte, 0, len(buf[8:16])) - } - m.Attnets = append(m.Attnets, buf[8:16]...) - - // Field (2) 'Syncnets' - if cap(m.Syncnets) == 0 { - m.Syncnets = make([]byte, 0, len(buf[16:17])) - } - m.Syncnets = append(m.Syncnets, buf[16:17]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the MetaDataV1 object -func (m *MetaDataV1) SizeSSZ() (size int) { - size = 17 - return -} - -// HashTreeRoot ssz hashes the MetaDataV1 object -func (m *MetaDataV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(m) -} - -// HashTreeRootWith ssz hashes the MetaDataV1 object with a hasher -func (m *MetaDataV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SeqNumber' - hh.PutUint64(m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - hh.PutBytes(m.Attnets) - - // Field (2) 'Syncnets' - if size := len(m.Syncnets); size != 1 { - err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) - return - } - hh.PutBytes(m.Syncnets) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecarsByRangeRequest object to a target array -func (b *BlobSidecarsByRangeRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'StartSlot' - dst = ssz.MarshalUint64(dst, uint64(b.StartSlot)) - - // Field (1) 'Count' - dst = ssz.MarshalUint64(dst, b.Count) - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'StartSlot' - b.StartSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Count' - b.Count = ssz.UnmarshallUint64(buf[8:16]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobSidecarsByRangeRequest object with a hasher -func (b *BlobSidecarsByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'StartSlot' - hh.PutUint64(uint64(b.StartSlot)) - - // Field (1) 'Count' - hh.PutUint64(b.Count) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the DepositSnapshot object -func (d *DepositSnapshot) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DepositSnapshot object to a target array -func (d *DepositSnapshot) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Finalized' - dst = ssz.WriteOffset(dst, offset) - offset += len(d.Finalized) * 32 - - // Field (1) 'DepositRoot' - if size := len(d.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - dst = append(dst, d.DepositRoot...) - - // Field (2) 'DepositCount' - dst = ssz.MarshalUint64(dst, d.DepositCount) - - // Field (3) 'ExecutionHash' - if size := len(d.ExecutionHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ExecutionHash", size, 32) - return - } - dst = append(dst, d.ExecutionHash...) - - // Field (4) 'ExecutionDepth' - dst = ssz.MarshalUint64(dst, d.ExecutionDepth) - - // Field (0) 'Finalized' - if size := len(d.Finalized); size > 32 { - err = ssz.ErrListTooBigFn("--.Finalized", size, 32) - return - } - for ii := 0; ii < len(d.Finalized); ii++ { - if size := len(d.Finalized[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.Finalized[ii]", size, 32) - return - } - dst = append(dst, d.Finalized[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the DepositSnapshot object -func (d *DepositSnapshot) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Finalized' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'DepositRoot' - if cap(d.DepositRoot) == 0 { - d.DepositRoot = make([]byte, 0, len(buf[4:36])) - } - d.DepositRoot = append(d.DepositRoot, buf[4:36]...) - - // Field (2) 'DepositCount' - d.DepositCount = ssz.UnmarshallUint64(buf[36:44]) - - // Field (3) 'ExecutionHash' - if cap(d.ExecutionHash) == 0 { - d.ExecutionHash = make([]byte, 0, len(buf[44:76])) - } - d.ExecutionHash = append(d.ExecutionHash, buf[44:76]...) - - // Field (4) 'ExecutionDepth' - d.ExecutionDepth = ssz.UnmarshallUint64(buf[76:84]) - - // Field (0) 'Finalized' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 32, 32) - if err != nil { - return err - } - d.Finalized = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(d.Finalized[ii]) == 0 { - d.Finalized[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - d.Finalized[ii] = append(d.Finalized[ii], buf[ii*32:(ii+1)*32]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DepositSnapshot object -func (d *DepositSnapshot) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Finalized' - size += len(d.Finalized) * 32 - - return -} - -// HashTreeRoot ssz hashes the DepositSnapshot object -func (d *DepositSnapshot) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DepositSnapshot object with a hasher -func (d *DepositSnapshot) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Finalized' - { - if size := len(d.Finalized); size > 32 { - err = ssz.ErrListTooBigFn("--.Finalized", size, 32) - return - } - subIndx := hh.Index() - for _, i := range d.Finalized { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(d.Finalized)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 32) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 32) - } - } - - // Field (1) 'DepositRoot' - if size := len(d.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - hh.PutBytes(d.DepositRoot) - - // Field (2) 'DepositCount' - hh.PutUint64(d.DepositCount) - - // Field (3) 'ExecutionHash' - if size := len(d.ExecutionHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ExecutionHash", size, 32) - return - } - hh.PutBytes(d.ExecutionHash) - - // Field (4) 'ExecutionDepth' - hh.PutUint64(d.ExecutionDepth) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncCommitteeMessage object to a target array -func (s *SyncCommitteeMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - dst = append(dst, s.BlockRoot...) - - // Field (2) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(s.ValidatorIndex)) - - // Field (3) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 144 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'BlockRoot' - if cap(s.BlockRoot) == 0 { - s.BlockRoot = make([]byte, 0, len(buf[8:40])) - } - s.BlockRoot = append(s.BlockRoot, buf[8:40]...) - - // Field (2) 'ValidatorIndex' - s.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[48:144])) - } - s.Signature = append(s.Signature, buf[48:144]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) SizeSSZ() (size int) { - size = 144 - return -} - -// HashTreeRoot ssz hashes the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncCommitteeMessage object with a hasher -func (s *SyncCommitteeMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - hh.PutBytes(s.BlockRoot) - - // Field (2) 'ValidatorIndex' - hh.PutUint64(uint64(s.ValidatorIndex)) - - // Field (3) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncCommitteeContribution object -func (s *SyncCommitteeContribution) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncCommitteeContribution object to a target array -func (s *SyncCommitteeContribution) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - dst = append(dst, s.BlockRoot...) - - // Field (2) 'SubcommitteeIndex' - dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) - - // Field (3) 'AggregationBits' - if size := len(s.AggregationBits); size != 16 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) - return - } - dst = append(dst, s.AggregationBits...) - - // Field (4) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncCommitteeContribution object -func (s *SyncCommitteeContribution) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 160 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'BlockRoot' - if cap(s.BlockRoot) == 0 { - s.BlockRoot = make([]byte, 0, len(buf[8:40])) - } - s.BlockRoot = append(s.BlockRoot, buf[8:40]...) - - // Field (2) 'SubcommitteeIndex' - s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[40:48]) - - // Field (3) 'AggregationBits' - if cap(s.AggregationBits) == 0 { - s.AggregationBits = make([]byte, 0, len(buf[48:64])) - } - s.AggregationBits = append(s.AggregationBits, buf[48:64]...) - - // Field (4) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[64:160])) - } - s.Signature = append(s.Signature, buf[64:160]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncCommitteeContribution object -func (s *SyncCommitteeContribution) SizeSSZ() (size int) { - size = 160 - return -} - -// HashTreeRoot ssz hashes the SyncCommitteeContribution object -func (s *SyncCommitteeContribution) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncCommitteeContribution object with a hasher -func (s *SyncCommitteeContribution) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - hh.PutBytes(s.BlockRoot) - - // Field (2) 'SubcommitteeIndex' - hh.PutUint64(s.SubcommitteeIndex) - - // Field (3) 'AggregationBits' - if size := len(s.AggregationBits); size != 16 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) - return - } - hh.PutBytes(s.AggregationBits) - - // Field (4) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ContributionAndProof object -func (c *ContributionAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the ContributionAndProof object to a target array -func (c *ContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'AggregatorIndex' - dst = ssz.MarshalUint64(dst, uint64(c.AggregatorIndex)) - - // Field (1) 'Contribution' - if c.Contribution == nil { - c.Contribution = new(SyncCommitteeContribution) - } - if dst, err = c.Contribution.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(c.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - dst = append(dst, c.SelectionProof...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ContributionAndProof object -func (c *ContributionAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 264 { - return ssz.ErrSize - } - - // Field (0) 'AggregatorIndex' - c.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Contribution' - if c.Contribution == nil { - c.Contribution = new(SyncCommitteeContribution) - } - if err = c.Contribution.UnmarshalSSZ(buf[8:168]); err != nil { - return err - } - - // Field (2) 'SelectionProof' - if cap(c.SelectionProof) == 0 { - c.SelectionProof = make([]byte, 0, len(buf[168:264])) - } - c.SelectionProof = append(c.SelectionProof, buf[168:264]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ContributionAndProof object -func (c *ContributionAndProof) SizeSSZ() (size int) { - size = 264 - return -} - -// HashTreeRoot ssz hashes the ContributionAndProof object -func (c *ContributionAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the ContributionAndProof object with a hasher -func (c *ContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregatorIndex' - hh.PutUint64(uint64(c.AggregatorIndex)) - - // Field (1) 'Contribution' - if err = c.Contribution.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(c.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - hh.PutBytes(c.SelectionProof) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedContributionAndProof object -func (s *SignedContributionAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedContributionAndProof object to a target array -func (s *SignedContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ContributionAndProof) - } - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedContributionAndProof object -func (s *SignedContributionAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 360 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ContributionAndProof) - } - if err = s.Message.UnmarshalSSZ(buf[0:264]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[264:360])) - } - s.Signature = append(s.Signature, buf[264:360]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedContributionAndProof object -func (s *SignedContributionAndProof) SizeSSZ() (size int) { - size = 360 - return -} - -// HashTreeRoot ssz hashes the SignedContributionAndProof object -func (s *SignedContributionAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedContributionAndProof object with a hasher -func (s *SignedContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Validator object -func (v *Validator) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) -} - -// MarshalSSZTo ssz marshals the Validator object to a target array -func (v *Validator) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PublicKey' - if size := len(v.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, v.PublicKey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(v.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, v.WithdrawalCredentials...) - - // Field (2) 'EffectiveBalance' - dst = ssz.MarshalUint64(dst, v.EffectiveBalance) - - // Field (3) 'Slashed' - dst = ssz.MarshalBool(dst, v.Slashed) - - // Field (4) 'ActivationEligibilityEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.ActivationEligibilityEpoch)) - - // Field (5) 'ActivationEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.ActivationEpoch)) - - // Field (6) 'ExitEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.ExitEpoch)) - - // Field (7) 'WithdrawableEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.WithdrawableEpoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Validator object -func (v *Validator) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 121 { - return ssz.ErrSize - } - - // Field (0) 'PublicKey' - if cap(v.PublicKey) == 0 { - v.PublicKey = make([]byte, 0, len(buf[0:48])) - } - v.PublicKey = append(v.PublicKey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(v.WithdrawalCredentials) == 0 { - v.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - v.WithdrawalCredentials = append(v.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'EffectiveBalance' - v.EffectiveBalance = ssz.UnmarshallUint64(buf[80:88]) - - // Field (3) 'Slashed' - v.Slashed = ssz.UnmarshalBool(buf[88:89]) - - // Field (4) 'ActivationEligibilityEpoch' - v.ActivationEligibilityEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[89:97])) - - // Field (5) 'ActivationEpoch' - v.ActivationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[97:105])) - - // Field (6) 'ExitEpoch' - v.ExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[105:113])) - - // Field (7) 'WithdrawableEpoch' - v.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[113:121])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Validator object -func (v *Validator) SizeSSZ() (size int) { - size = 121 - return -} - -// HashTreeRoot ssz hashes the Validator object -func (v *Validator) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) -} - -// HashTreeRootWith ssz hashes the Validator object with a hasher -func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PublicKey' - if size := len(v.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - hh.PutBytes(v.PublicKey) - - // Field (1) 'WithdrawalCredentials' - if size := len(v.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(v.WithdrawalCredentials) - - // Field (2) 'EffectiveBalance' - hh.PutUint64(v.EffectiveBalance) - - // Field (3) 'Slashed' - hh.PutBool(v.Slashed) - - // Field (4) 'ActivationEligibilityEpoch' - hh.PutUint64(uint64(v.ActivationEligibilityEpoch)) - - // Field (5) 'ActivationEpoch' - hh.PutUint64(uint64(v.ActivationEpoch)) - - // Field (6) 'ExitEpoch' - hh.PutUint64(uint64(v.ExitEpoch)) - - // Field (7) 'WithdrawableEpoch' - hh.PutUint64(uint64(v.WithdrawableEpoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BLSToExecutionChange object -func (b *BLSToExecutionChange) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BLSToExecutionChange object to a target array -func (b *BLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.ValidatorIndex)) - - // Field (1) 'FromBlsPubkey' - if size := len(b.FromBlsPubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48) - return - } - dst = append(dst, b.FromBlsPubkey...) - - // Field (2) 'ToExecutionAddress' - if size := len(b.ToExecutionAddress); size != 20 { - err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20) - return - } - dst = append(dst, b.ToExecutionAddress...) - - return -} - -// UnmarshalSSZ ssz unmarshals the BLSToExecutionChange object -func (b *BLSToExecutionChange) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 76 { - return ssz.ErrSize - } - - // Field (0) 'ValidatorIndex' - b.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'FromBlsPubkey' - if cap(b.FromBlsPubkey) == 0 { - b.FromBlsPubkey = make([]byte, 0, len(buf[8:56])) - } - b.FromBlsPubkey = append(b.FromBlsPubkey, buf[8:56]...) - - // Field (2) 'ToExecutionAddress' - if cap(b.ToExecutionAddress) == 0 { - b.ToExecutionAddress = make([]byte, 0, len(buf[56:76])) - } - b.ToExecutionAddress = append(b.ToExecutionAddress, buf[56:76]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BLSToExecutionChange object -func (b *BLSToExecutionChange) SizeSSZ() (size int) { - size = 76 - return -} - -// HashTreeRoot ssz hashes the BLSToExecutionChange object -func (b *BLSToExecutionChange) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BLSToExecutionChange object with a hasher -func (b *BLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ValidatorIndex' - hh.PutUint64(uint64(b.ValidatorIndex)) - - // Field (1) 'FromBlsPubkey' - if size := len(b.FromBlsPubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48) - return - } - hh.PutBytes(b.FromBlsPubkey) - - // Field (2) 'ToExecutionAddress' - if size := len(b.ToExecutionAddress); size != 20 { - err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20) - return - } - hh.PutBytes(b.ToExecutionAddress) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBLSToExecutionChange object -func (s *SignedBLSToExecutionChange) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBLSToExecutionChange object to a target array -func (s *SignedBLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BLSToExecutionChange) - } - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBLSToExecutionChange object -func (s *SignedBLSToExecutionChange) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 172 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BLSToExecutionChange) - } - if err = s.Message.UnmarshalSSZ(buf[0:76]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[76:172])) - } - s.Signature = append(s.Signature, buf[76:172]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBLSToExecutionChange object -func (s *SignedBLSToExecutionChange) SizeSSZ() (size int) { - size = 172 - return -} - -// HashTreeRoot ssz hashes the SignedBLSToExecutionChange object -func (s *SignedBLSToExecutionChange) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBLSToExecutionChange object with a hasher -func (s *SignedBLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go new file mode 100644 index 000000000000..52616b8d46f5 --- /dev/null +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -0,0 +1,780 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 9da8a498bd074553137a73197dadcae4d3b4239484f64bab4f0a734dce528d24 +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// MarshalSSZ ssz marshals the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(v) +} + +// MarshalSSZTo ssz marshals the ValidatorRegistrationV1 object to a target array +func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'FeeRecipient' + if size := len(v.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + dst = append(dst, v.FeeRecipient...) + + // Field (1) 'GasLimit' + dst = ssz.MarshalUint64(dst, v.GasLimit) + + // Field (2) 'Timestamp' + dst = ssz.MarshalUint64(dst, v.Timestamp) + + // Field (3) 'Pubkey' + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + dst = append(dst, v.Pubkey...) + + return +} + +// UnmarshalSSZ ssz unmarshals the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 84 { + return ssz.ErrSize + } + + // Field (0) 'FeeRecipient' + if cap(v.FeeRecipient) == 0 { + v.FeeRecipient = make([]byte, 0, len(buf[0:20])) + } + v.FeeRecipient = append(v.FeeRecipient, buf[0:20]...) + + // Field (1) 'GasLimit' + v.GasLimit = ssz.UnmarshallUint64(buf[20:28]) + + // Field (2) 'Timestamp' + v.Timestamp = ssz.UnmarshallUint64(buf[28:36]) + + // Field (3) 'Pubkey' + if cap(v.Pubkey) == 0 { + v.Pubkey = make([]byte, 0, len(buf[36:84])) + } + v.Pubkey = append(v.Pubkey, buf[36:84]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) SizeSSZ() (size int) { + size = 84 + return +} + +// HashTreeRoot ssz hashes the ValidatorRegistrationV1 object +func (v *ValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(v) +} + +// HashTreeRootWith ssz hashes the ValidatorRegistrationV1 object with a hasher +func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'FeeRecipient' + if size := len(v.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + hh.PutBytes(v.FeeRecipient) + + // Field (1) 'GasLimit' + hh.PutUint64(v.GasLimit) + + // Field (2) 'Timestamp' + hh.PutUint64(v.Timestamp) + + // Field (3) 'Pubkey' + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + hh.PutBytes(v.Pubkey) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedValidatorRegistrationV1 object to a target array +func (s *SignedValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(ValidatorRegistrationV1) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 180 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(ValidatorRegistrationV1) + } + if err = s.Message.UnmarshalSSZ(buf[0:84]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[84:180])) + } + s.Signature = append(s.Signature, buf[84:180]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) SizeSSZ() (size int) { + size = 180 + return +} + +// HashTreeRoot ssz hashes the SignedValidatorRegistrationV1 object +func (s *SignedValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedValidatorRegistrationV1 object with a hasher +func (s *SignedValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BuilderBid object +func (b *BuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBid object to a target array +func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) + } + offset += b.Header.SizeSSZ() + + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + dst = append(dst, b.Value...) + + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + dst = append(dst, b.Pubkey...) + + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBid object +func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[4:36])) + } + b.Value = append(b.Value, buf[4:36]...) + + // Field (2) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[36:84])) + } + b.Pubkey = append(b.Pubkey, buf[36:84]...) + + // Field (0) 'Header' + { + buf = tail[o0:] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) + } + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object +func (b *BuilderBid) SizeSSZ() (size int) { + size = 84 + + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) + } + size += b.Header.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BuilderBid object +func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BuilderBid object with a hasher +func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + hh.PutBytes(b.Value) + + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + hh.PutBytes(b.Pubkey) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlocksByRangeRequest object +func (b *BeaconBlocksByRangeRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlocksByRangeRequest object to a target array +func (b *BeaconBlocksByRangeRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'StartSlot' + dst = ssz.MarshalUint64(dst, uint64(b.StartSlot)) + + // Field (1) 'Count' + dst = ssz.MarshalUint64(dst, b.Count) + + // Field (2) 'Step' + dst = ssz.MarshalUint64(dst, b.Step) + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlocksByRangeRequest object +func (b *BeaconBlocksByRangeRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24 { + return ssz.ErrSize + } + + // Field (0) 'StartSlot' + b.StartSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Count' + b.Count = ssz.UnmarshallUint64(buf[8:16]) + + // Field (2) 'Step' + b.Step = ssz.UnmarshallUint64(buf[16:24]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlocksByRangeRequest object +func (b *BeaconBlocksByRangeRequest) SizeSSZ() (size int) { + size = 24 + return +} + +// HashTreeRoot ssz hashes the BeaconBlocksByRangeRequest object +func (b *BeaconBlocksByRangeRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlocksByRangeRequest object with a hasher +func (b *BeaconBlocksByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'StartSlot' + hh.PutUint64(uint64(b.StartSlot)) + + // Field (1) 'Count' + hh.PutUint64(b.Count) + + // Field (2) 'Step' + hh.PutUint64(b.Step) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the MetaDataV0 object +func (m *MetaDataV0) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(m) +} + +// MarshalSSZTo ssz marshals the MetaDataV0 object to a target array +func (m *MetaDataV0) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SeqNumber' + dst = ssz.MarshalUint64(dst, m.SeqNumber) + + // Field (1) 'Attnets' + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) + return + } + dst = append(dst, m.Attnets...) + + return +} + +// UnmarshalSSZ ssz unmarshals the MetaDataV0 object +func (m *MetaDataV0) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'SeqNumber' + m.SeqNumber = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'Attnets' + if cap(m.Attnets) == 0 { + m.Attnets = make([]byte, 0, len(buf[8:16])) + } + m.Attnets = append(m.Attnets, buf[8:16]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the MetaDataV0 object +func (m *MetaDataV0) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the MetaDataV0 object +func (m *MetaDataV0) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(m) +} + +// HashTreeRootWith ssz hashes the MetaDataV0 object with a hasher +func (m *MetaDataV0) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SeqNumber' + hh.PutUint64(m.SeqNumber) + + // Field (1) 'Attnets' + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) + return + } + hh.PutBytes(m.Attnets) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the MetaDataV1 object +func (m *MetaDataV1) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(m) +} + +// MarshalSSZTo ssz marshals the MetaDataV1 object to a target array +func (m *MetaDataV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SeqNumber' + dst = ssz.MarshalUint64(dst, m.SeqNumber) + + // Field (1) 'Attnets' + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) + return + } + dst = append(dst, m.Attnets...) + + // Field (2) 'Syncnets' + if size := len(m.Syncnets); size != 1 { + err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) + return + } + dst = append(dst, m.Syncnets...) + + return +} + +// UnmarshalSSZ ssz unmarshals the MetaDataV1 object +func (m *MetaDataV1) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 17 { + return ssz.ErrSize + } + + // Field (0) 'SeqNumber' + m.SeqNumber = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'Attnets' + if cap(m.Attnets) == 0 { + m.Attnets = make([]byte, 0, len(buf[8:16])) + } + m.Attnets = append(m.Attnets, buf[8:16]...) + + // Field (2) 'Syncnets' + if cap(m.Syncnets) == 0 { + m.Syncnets = make([]byte, 0, len(buf[16:17])) + } + m.Syncnets = append(m.Syncnets, buf[16:17]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the MetaDataV1 object +func (m *MetaDataV1) SizeSSZ() (size int) { + size = 17 + return +} + +// HashTreeRoot ssz hashes the MetaDataV1 object +func (m *MetaDataV1) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(m) +} + +// HashTreeRootWith ssz hashes the MetaDataV1 object with a hasher +func (m *MetaDataV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SeqNumber' + hh.PutUint64(m.SeqNumber) + + // Field (1) 'Attnets' + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) + return + } + hh.PutBytes(m.Attnets) + + // Field (2) 'Syncnets' + if size := len(m.Syncnets); size != 1 { + err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) + return + } + hh.PutBytes(m.Syncnets) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BlobSidecarsByRangeRequest object +func (b *BlobSidecarsByRangeRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlobSidecarsByRangeRequest object to a target array +func (b *BlobSidecarsByRangeRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'StartSlot' + dst = ssz.MarshalUint64(dst, uint64(b.StartSlot)) + + // Field (1) 'Count' + dst = ssz.MarshalUint64(dst, b.Count) + + return +} + +// UnmarshalSSZ ssz unmarshals the BlobSidecarsByRangeRequest object +func (b *BlobSidecarsByRangeRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'StartSlot' + b.StartSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Count' + b.Count = ssz.UnmarshallUint64(buf[8:16]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecarsByRangeRequest object +func (b *BlobSidecarsByRangeRequest) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the BlobSidecarsByRangeRequest object +func (b *BlobSidecarsByRangeRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlobSidecarsByRangeRequest object with a hasher +func (b *BlobSidecarsByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'StartSlot' + hh.PutUint64(uint64(b.StartSlot)) + + // Field (1) 'Count' + hh.PutUint64(b.Count) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the DepositSnapshot object +func (d *DepositSnapshot) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DepositSnapshot object to a target array +func (d *DepositSnapshot) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Offset (0) 'Finalized' + dst = ssz.WriteOffset(dst, offset) + offset += len(d.Finalized) * 32 + + // Field (1) 'DepositRoot' + if size := len(d.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) + return + } + dst = append(dst, d.DepositRoot...) + + // Field (2) 'DepositCount' + dst = ssz.MarshalUint64(dst, d.DepositCount) + + // Field (3) 'ExecutionHash' + if size := len(d.ExecutionHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ExecutionHash", size, 32) + return + } + dst = append(dst, d.ExecutionHash...) + + // Field (4) 'ExecutionDepth' + dst = ssz.MarshalUint64(dst, d.ExecutionDepth) + + // Field (0) 'Finalized' + if size := len(d.Finalized); size > 32 { + err = ssz.ErrListTooBigFn("--.Finalized", size, 32) + return + } + for ii := 0; ii < len(d.Finalized); ii++ { + if size := len(d.Finalized[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.Finalized[ii]", size, 32) + return + } + dst = append(dst, d.Finalized[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the DepositSnapshot object +func (d *DepositSnapshot) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Finalized' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'DepositRoot' + if cap(d.DepositRoot) == 0 { + d.DepositRoot = make([]byte, 0, len(buf[4:36])) + } + d.DepositRoot = append(d.DepositRoot, buf[4:36]...) + + // Field (2) 'DepositCount' + d.DepositCount = ssz.UnmarshallUint64(buf[36:44]) + + // Field (3) 'ExecutionHash' + if cap(d.ExecutionHash) == 0 { + d.ExecutionHash = make([]byte, 0, len(buf[44:76])) + } + d.ExecutionHash = append(d.ExecutionHash, buf[44:76]...) + + // Field (4) 'ExecutionDepth' + d.ExecutionDepth = ssz.UnmarshallUint64(buf[76:84]) + + // Field (0) 'Finalized' + { + buf = tail[o0:] + num, err := ssz.DivideInt2(len(buf), 32, 32) + if err != nil { + return err + } + d.Finalized = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(d.Finalized[ii]) == 0 { + d.Finalized[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + d.Finalized[ii] = append(d.Finalized[ii], buf[ii*32:(ii+1)*32]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DepositSnapshot object +func (d *DepositSnapshot) SizeSSZ() (size int) { + size = 84 + + // Field (0) 'Finalized' + size += len(d.Finalized) * 32 + + return +} + +// HashTreeRoot ssz hashes the DepositSnapshot object +func (d *DepositSnapshot) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DepositSnapshot object with a hasher +func (d *DepositSnapshot) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Finalized' + { + if size := len(d.Finalized); size > 32 { + err = ssz.ErrListTooBigFn("--.Finalized", size, 32) + return + } + subIndx := hh.Index() + for _, i := range d.Finalized { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(d.Finalized)) + hh.MerkleizeWithMixin(subIndx, numItems, 32) + } + + // Field (1) 'DepositRoot' + if size := len(d.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) + return + } + hh.PutBytes(d.DepositRoot) + + // Field (2) 'DepositCount' + hh.PutUint64(d.DepositCount) + + // Field (3) 'ExecutionHash' + if size := len(d.ExecutionHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ExecutionHash", size, 32) + return + } + hh.PutBytes(d.ExecutionHash) + + // Field (4) 'ExecutionDepth' + hh.PutUint64(d.ExecutionDepth) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/phase0.ssz.go b/proto/prysm/v1alpha1/phase0.ssz.go new file mode 100644 index 000000000000..8be3c0272475 --- /dev/null +++ b/proto/prysm/v1alpha1/phase0.ssz.go @@ -0,0 +1,4048 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: eba8aa2c3520e9086420bb8b3b54fa3824148a30659a4a9413a1eebbec22712a +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) + +// MarshalSSZ ssz marshals the Attestation object +func (a *Attestation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the Attestation object to a target array +func (a *Attestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(228) + + // Offset (0) 'AggregationBits' + dst = ssz.WriteOffset(dst, offset) + offset += len(a.AggregationBits) + + // Field (1) 'Data' + if a.Data == nil { + a.Data = new(AttestationData) + } + if dst, err = a.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, a.Signature...) + + // Field (0) 'AggregationBits' + if size := len(a.AggregationBits); size > 2048 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) + return + } + dst = append(dst, a.AggregationBits...) + + return +} + +// UnmarshalSSZ ssz unmarshals the Attestation object +func (a *Attestation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 228 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AggregationBits' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 228 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if a.Data == nil { + a.Data = new(AttestationData) + } + if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(a.Signature) == 0 { + a.Signature = make([]byte, 0, len(buf[132:228])) + } + a.Signature = append(a.Signature, buf[132:228]...) + + // Field (0) 'AggregationBits' + { + buf = tail[o0:] + if err = ssz.ValidateBitlist(buf, 2048); err != nil { + return err + } + if cap(a.AggregationBits) == 0 { + a.AggregationBits = make([]byte, 0, len(buf)) + } + a.AggregationBits = append(a.AggregationBits, buf...) + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Attestation object +func (a *Attestation) SizeSSZ() (size int) { + size = 228 + + // Field (0) 'AggregationBits' + size += len(a.AggregationBits) + + return +} + +// HashTreeRoot ssz hashes the Attestation object +func (a *Attestation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the Attestation object with a hasher +func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if len(a.AggregationBits) == 0 { + err = ssz.ErrEmptyBitlist + return + } + hh.PutBitlist(a.AggregationBits, 2048) + + // Field (1) 'Data' + if err = a.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(a.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the AggregateAttestationAndProof object +func (a *AggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AggregateAttestationAndProof object to a target array +func (a *AggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(108) + + // Field (0) 'AggregatorIndex' + dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) + + // Offset (1) 'Aggregate' + dst = ssz.WriteOffset(dst, offset) + if a.Aggregate == nil { + a.Aggregate = new(Attestation) + } + offset += a.Aggregate.SizeSSZ() + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + dst = append(dst, a.SelectionProof...) + + // Field (1) 'Aggregate' + if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProof object +func (a *AggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 108 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'AggregatorIndex' + a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Offset (1) 'Aggregate' + if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { + return ssz.ErrOffset + } + + if o1 != 108 { + return ssz.ErrInvalidVariableOffset + } + + // Field (2) 'SelectionProof' + if cap(a.SelectionProof) == 0 { + a.SelectionProof = make([]byte, 0, len(buf[12:108])) + } + a.SelectionProof = append(a.SelectionProof, buf[12:108]...) + + // Field (1) 'Aggregate' + { + buf = tail[o1:] + if a.Aggregate == nil { + a.Aggregate = new(Attestation) + } + if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProof object +func (a *AggregateAttestationAndProof) SizeSSZ() (size int) { + size = 108 + + // Field (1) 'Aggregate' + if a.Aggregate == nil { + a.Aggregate = new(Attestation) + } + size += a.Aggregate.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the AggregateAttestationAndProof object +func (a *AggregateAttestationAndProof) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AggregateAttestationAndProof object with a hasher +func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregatorIndex' + hh.PutUint64(uint64(a.AggregatorIndex)) + + // Field (1) 'Aggregate' + if err = a.Aggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + hh.PutBytes(a.SelectionProof) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProof object +func (s *SignedAggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProof object to a target array +func (s *SignedAggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(AggregateAttestationAndProof) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedAggregateAttestationAndProof object +func (s *SignedAggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(AggregateAttestationAndProof) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProof object +func (s *SignedAggregateAttestationAndProof) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(AggregateAttestationAndProof) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProof object +func (s *SignedAggregateAttestationAndProof) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProof object with a hasher +func (s *SignedAggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the AttestationData object +func (a *AttestationData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttestationData object to a target array +func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(a.Slot)) + + // Field (1) 'CommitteeIndex' + dst = ssz.MarshalUint64(dst, uint64(a.CommitteeIndex)) + + // Field (2) 'BeaconBlockRoot' + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + dst = append(dst, a.BeaconBlockRoot...) + + // Field (3) 'Source' + if a.Source == nil { + a.Source = new(Checkpoint) + } + if dst, err = a.Source.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'Target' + if a.Target == nil { + a.Target = new(Checkpoint) + } + if dst, err = a.Target.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AttestationData object +func (a *AttestationData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 128 { + return ssz.ErrSize + } + + // Field (0) 'Slot' + a.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'CommitteeIndex' + a.CommitteeIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.CommitteeIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'BeaconBlockRoot' + if cap(a.BeaconBlockRoot) == 0 { + a.BeaconBlockRoot = make([]byte, 0, len(buf[16:48])) + } + a.BeaconBlockRoot = append(a.BeaconBlockRoot, buf[16:48]...) + + // Field (3) 'Source' + if a.Source == nil { + a.Source = new(Checkpoint) + } + if err = a.Source.UnmarshalSSZ(buf[48:88]); err != nil { + return err + } + + // Field (4) 'Target' + if a.Target == nil { + a.Target = new(Checkpoint) + } + if err = a.Target.UnmarshalSSZ(buf[88:128]); err != nil { + return err + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AttestationData object +func (a *AttestationData) SizeSSZ() (size int) { + size = 128 + return +} + +// HashTreeRoot ssz hashes the AttestationData object +func (a *AttestationData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AttestationData object with a hasher +func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(a.Slot)) + + // Field (1) 'CommitteeIndex' + hh.PutUint64(uint64(a.CommitteeIndex)) + + // Field (2) 'BeaconBlockRoot' + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + hh.PutBytes(a.BeaconBlockRoot) + + // Field (3) 'Source' + if err = a.Source.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'Target' + if err = a.Target.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Checkpoint object +func (c *Checkpoint) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(c) +} + +// MarshalSSZTo ssz marshals the Checkpoint object to a target array +func (c *Checkpoint) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Epoch' + dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) + + // Field (1) 'Root' + if size := len(c.Root); size != 32 { + err = ssz.ErrBytesLengthFn("--.Root", size, 32) + return + } + dst = append(dst, c.Root...) + + return +} + +// UnmarshalSSZ ssz unmarshals the Checkpoint object +func (c *Checkpoint) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 40 { + return ssz.ErrSize + } + + // Field (0) 'Epoch' + c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Root' + if cap(c.Root) == 0 { + c.Root = make([]byte, 0, len(buf[8:40])) + } + c.Root = append(c.Root, buf[8:40]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Checkpoint object +func (c *Checkpoint) SizeSSZ() (size int) { + size = 40 + return +} + +// HashTreeRoot ssz hashes the Checkpoint object +func (c *Checkpoint) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(c) +} + +// HashTreeRootWith ssz hashes the Checkpoint object with a hasher +func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Epoch' + hh.PutUint64(uint64(c.Epoch)) + + // Field (1) 'Root' + if size := len(c.Root); size != 32 { + err = ssz.ErrBytesLengthFn("--.Root", size, 32) + return + } + hh.PutBytes(c.Root) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlock object +func (b *BeaconBlock) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlock object to a target array +func (b *BeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Offset (4) 'Body' + dst = ssz.WriteOffset(dst, offset) + if b.Body == nil { + b.Body = new(BeaconBlockBody) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlock object +func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o4 uint64 + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Offset (4) 'Body' + if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { + return ssz.ErrOffset + } + + if o4 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'Body' + { + buf = tail[o4:] + if b.Body == nil { + b.Body = new(BeaconBlockBody) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlock object +func (b *BeaconBlock) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBody) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlock object +func (b *BeaconBlock) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlock object with a hasher +func (b *BeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'Body' + if err = b.Body.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBeaconBlock object +func (s *SignedBeaconBlock) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlock object to a target array +func (s *SignedBeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlock) + } + offset += s.Block.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlock object +func (s *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlock) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlock object +func (s *SignedBeaconBlock) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlock) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlock object +func (s *SignedBeaconBlock) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlock object with a hasher +func (s *SignedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockBody object +func (b *BeaconBlockBody) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBody object to a target array +func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(220) + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + dst = append(dst, b.RandaoReveal...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + dst = append(dst, b.Graffiti...) + + // Offset (3) 'ProposerSlashings' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.ProposerSlashings) * 416 + + // Offset (4) 'AttesterSlashings' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + offset += 4 + offset += b.AttesterSlashings[ii].SizeSSZ() + } + + // Offset (5) 'Attestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.Attestations); ii++ { + offset += 4 + offset += b.Attestations[ii].SizeSSZ() + } + + // Offset (6) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Deposits) * 1240 + + // Offset (7) 'VoluntaryExits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.VoluntaryExits) * 112 + + // Field (3) 'ProposerSlashings' + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) + return + } + for ii := 0; ii < len(b.ProposerSlashings); ii++ { + if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (4) 'AttesterSlashings' + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) + return + } + { + offset = 4 * len(b.AttesterSlashings) + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.AttesterSlashings[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (5) 'Attestations' + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) + return + } + { + offset = 4 * len(b.Attestations) + for ii := 0; ii < len(b.Attestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.Attestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.Attestations); ii++ { + if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (6) 'Deposits' + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) + return + } + for ii := 0; ii < len(b.Deposits); ii++ { + if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (7) 'VoluntaryExits' + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) + return + } + for ii := 0; ii < len(b.VoluntaryExits); ii++ { + if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBody object +func (b *BeaconBlockBody) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 220 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7 uint64 + + // Field (0) 'RandaoReveal' + if cap(b.RandaoReveal) == 0 { + b.RandaoReveal = make([]byte, 0, len(buf[0:96])) + } + b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) + + // Field (1) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { + return err + } + + // Field (2) 'Graffiti' + if cap(b.Graffiti) == 0 { + b.Graffiti = make([]byte, 0, len(buf[168:200])) + } + b.Graffiti = append(b.Graffiti, buf[168:200]...) + + // Offset (3) 'ProposerSlashings' + if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 220 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (4) 'AttesterSlashings' + if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { + return ssz.ErrOffset + } + + // Offset (5) 'Attestations' + if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { + return ssz.ErrOffset + } + + // Offset (6) 'Deposits' + if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { + return ssz.ErrOffset + } + + // Offset (7) 'VoluntaryExits' + if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { + return ssz.ErrOffset + } + + // Field (3) 'ProposerSlashings' + { + buf = tail[o3:o4] + num, err := ssz.DivideInt2(len(buf), 416, 16) + if err != nil { + return err + } + b.ProposerSlashings = make([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(ProposerSlashing) + } + if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { + return err + } + } + } + + // Field (4) 'AttesterSlashings' + { + buf = tail[o4:o5] + num, err := ssz.DecodeDynamicLength(buf, 2) + if err != nil { + return err + } + b.AttesterSlashings = make([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(AttesterSlashing) + } + if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (5) 'Attestations' + { + buf = tail[o5:o6] + num, err := ssz.DecodeDynamicLength(buf, 128) + if err != nil { + return err + } + b.Attestations = make([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(Attestation) + } + if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (6) 'Deposits' + { + buf = tail[o6:o7] + num, err := ssz.DivideInt2(len(buf), 1240, 16) + if err != nil { + return err + } + b.Deposits = make([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(Deposit) + } + if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { + return err + } + } + } + + // Field (7) 'VoluntaryExits' + { + buf = tail[o7:] + num, err := ssz.DivideInt2(len(buf), 112, 16) + if err != nil { + return err + } + b.VoluntaryExits = make([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBody object +func (b *BeaconBlockBody) SizeSSZ() (size int) { + size = 220 + + // Field (3) 'ProposerSlashings' + size += len(b.ProposerSlashings) * 416 + + // Field (4) 'AttesterSlashings' + for ii := 0; ii < len(b.AttesterSlashings); ii++ { + size += 4 + size += b.AttesterSlashings[ii].SizeSSZ() + } + + // Field (5) 'Attestations' + for ii := 0; ii < len(b.Attestations); ii++ { + size += 4 + size += b.Attestations[ii].SizeSSZ() + } + + // Field (6) 'Deposits' + size += len(b.Deposits) * 1240 + + // Field (7) 'VoluntaryExits' + size += len(b.VoluntaryExits) * 112 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBody object +func (b *BeaconBlockBody) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBody object with a hasher +func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'RandaoReveal' + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) + return + } + hh.PutBytes(b.RandaoReveal) + + // Field (1) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Graffiti' + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) + return + } + hh.PutBytes(b.Graffiti) + + // Field (3) 'ProposerSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.ProposerSlashings)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.ProposerSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (4) 'AttesterSlashings' + { + subIndx := hh.Index() + num := uint64(len(b.AttesterSlashings)) + if num > 2 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.AttesterSlashings { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2) + } + + // Field (5) 'Attestations' + { + subIndx := hh.Index() + num := uint64(len(b.Attestations)) + if num > 128 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Attestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 128) + } + + // Field (6) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(b.Deposits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (7) 'VoluntaryExits' + { + subIndx := hh.Index() + num := uint64(len(b.VoluntaryExits)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.VoluntaryExits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the ProposerSlashing object +func (p *ProposerSlashing) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the ProposerSlashing object to a target array +func (p *ProposerSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Header_1' + if p.Header_1 == nil { + p.Header_1 = new(SignedBeaconBlockHeader) + } + if dst, err = p.Header_1.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Header_2' + if p.Header_2 == nil { + p.Header_2 = new(SignedBeaconBlockHeader) + } + if dst, err = p.Header_2.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the ProposerSlashing object +func (p *ProposerSlashing) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 416 { + return ssz.ErrSize + } + + // Field (0) 'Header_1' + if p.Header_1 == nil { + p.Header_1 = new(SignedBeaconBlockHeader) + } + if err = p.Header_1.UnmarshalSSZ(buf[0:208]); err != nil { + return err + } + + // Field (1) 'Header_2' + if p.Header_2 == nil { + p.Header_2 = new(SignedBeaconBlockHeader) + } + if err = p.Header_2.UnmarshalSSZ(buf[208:416]); err != nil { + return err + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ProposerSlashing object +func (p *ProposerSlashing) SizeSSZ() (size int) { + size = 416 + return +} + +// HashTreeRoot ssz hashes the ProposerSlashing object +func (p *ProposerSlashing) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the ProposerSlashing object with a hasher +func (p *ProposerSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header_1' + if err = p.Header_1.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Header_2' + if err = p.Header_2.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the AttesterSlashing object +func (a *AttesterSlashing) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AttesterSlashing object to a target array +func (a *AttesterSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(8) + + // Offset (0) 'Attestation_1' + dst = ssz.WriteOffset(dst, offset) + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestation) + } + offset += a.Attestation_1.SizeSSZ() + + // Offset (1) 'Attestation_2' + dst = ssz.WriteOffset(dst, offset) + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestation) + } + offset += a.Attestation_2.SizeSSZ() + + // Field (0) 'Attestation_1' + if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Attestation_2' + if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the AttesterSlashing object +func (a *AttesterSlashing) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 8 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'Attestation_1' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 8 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'Attestation_2' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (0) 'Attestation_1' + { + buf = tail[o0:o1] + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestation) + } + if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'Attestation_2' + { + buf = tail[o1:] + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestation) + } + if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashing object +func (a *AttesterSlashing) SizeSSZ() (size int) { + size = 8 + + // Field (0) 'Attestation_1' + if a.Attestation_1 == nil { + a.Attestation_1 = new(IndexedAttestation) + } + size += a.Attestation_1.SizeSSZ() + + // Field (1) 'Attestation_2' + if a.Attestation_2 == nil { + a.Attestation_2 = new(IndexedAttestation) + } + size += a.Attestation_2.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the AttesterSlashing object +func (a *AttesterSlashing) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AttesterSlashing object with a hasher +func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Attestation_1' + if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Attestation_2' + if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Deposit object +func (d *Deposit) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the Deposit object to a target array +func (d *Deposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Proof' + if size := len(d.Proof); size != 33 { + err = ssz.ErrVectorLengthFn("--.Proof", size, 33) + return + } + for ii := 0; ii < 33; ii++ { + if size := len(d.Proof[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.Proof[ii]", size, 32) + return + } + dst = append(dst, d.Proof[ii]...) + } + + // Field (1) 'Data' + if d.Data == nil { + d.Data = new(Deposit_Data) + } + if dst, err = d.Data.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the Deposit object +func (d *Deposit) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 1240 { + return ssz.ErrSize + } + + // Field (0) 'Proof' + d.Proof = make([][]byte, 33) + for ii := 0; ii < 33; ii++ { + if cap(d.Proof[ii]) == 0 { + d.Proof[ii] = make([]byte, 0, len(buf[0:1056][ii*32:(ii+1)*32])) + } + d.Proof[ii] = append(d.Proof[ii], buf[0:1056][ii*32:(ii+1)*32]...) + } + + // Field (1) 'Data' + if d.Data == nil { + d.Data = new(Deposit_Data) + } + if err = d.Data.UnmarshalSSZ(buf[1056:1240]); err != nil { + return err + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Deposit object +func (d *Deposit) SizeSSZ() (size int) { + size = 1240 + return +} + +// HashTreeRoot ssz hashes the Deposit object +func (d *Deposit) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the Deposit object with a hasher +func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Proof' + { + if size := len(d.Proof); size != 33 { + err = ssz.ErrVectorLengthFn("--.Proof", size, 33) + return + } + subIndx := hh.Index() + for _, i := range d.Proof { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (1) 'Data' + if err = d.Data.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the VoluntaryExit object +func (v *VoluntaryExit) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(v) +} + +// MarshalSSZTo ssz marshals the VoluntaryExit object to a target array +func (v *VoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Epoch' + dst = ssz.MarshalUint64(dst, uint64(v.Epoch)) + + // Field (1) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(v.ValidatorIndex)) + + return +} + +// UnmarshalSSZ ssz unmarshals the VoluntaryExit object +func (v *VoluntaryExit) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'Epoch' + v.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ValidatorIndex' + v.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the VoluntaryExit object +func (v *VoluntaryExit) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the VoluntaryExit object +func (v *VoluntaryExit) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(v) +} + +// HashTreeRootWith ssz hashes the VoluntaryExit object with a hasher +func (v *VoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Epoch' + hh.PutUint64(uint64(v.Epoch)) + + // Field (1) 'ValidatorIndex' + hh.PutUint64(uint64(v.ValidatorIndex)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedVoluntaryExit object +func (s *SignedVoluntaryExit) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedVoluntaryExit object to a target array +func (s *SignedVoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Exit' + if s.Exit == nil { + s.Exit = new(VoluntaryExit) + } + if dst, err = s.Exit.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedVoluntaryExit object +func (s *SignedVoluntaryExit) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 112 { + return ssz.ErrSize + } + + // Field (0) 'Exit' + if s.Exit == nil { + s.Exit = new(VoluntaryExit) + } + if err = s.Exit.UnmarshalSSZ(buf[0:16]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[16:112])) + } + s.Signature = append(s.Signature, buf[16:112]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedVoluntaryExit object +func (s *SignedVoluntaryExit) SizeSSZ() (size int) { + size = 112 + return +} + +// HashTreeRoot ssz hashes the SignedVoluntaryExit object +func (s *SignedVoluntaryExit) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedVoluntaryExit object with a hasher +func (s *SignedVoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Exit' + if err = s.Exit.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Eth1Data object +func (e *Eth1Data) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the Eth1Data object to a target array +func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'DepositRoot' + if size := len(e.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) + return + } + dst = append(dst, e.DepositRoot...) + + // Field (1) 'DepositCount' + dst = ssz.MarshalUint64(dst, e.DepositCount) + + // Field (2) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + dst = append(dst, e.BlockHash...) + + return +} + +// UnmarshalSSZ ssz unmarshals the Eth1Data object +func (e *Eth1Data) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 72 { + return ssz.ErrSize + } + + // Field (0) 'DepositRoot' + if cap(e.DepositRoot) == 0 { + e.DepositRoot = make([]byte, 0, len(buf[0:32])) + } + e.DepositRoot = append(e.DepositRoot, buf[0:32]...) + + // Field (1) 'DepositCount' + e.DepositCount = ssz.UnmarshallUint64(buf[32:40]) + + // Field (2) 'BlockHash' + if cap(e.BlockHash) == 0 { + e.BlockHash = make([]byte, 0, len(buf[40:72])) + } + e.BlockHash = append(e.BlockHash, buf[40:72]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Eth1Data object +func (e *Eth1Data) SizeSSZ() (size int) { + size = 72 + return +} + +// HashTreeRoot ssz hashes the Eth1Data object +func (e *Eth1Data) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the Eth1Data object with a hasher +func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'DepositRoot' + if size := len(e.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) + return + } + hh.PutBytes(e.DepositRoot) + + // Field (1) 'DepositCount' + hh.PutUint64(e.DepositCount) + + // Field (2) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + hh.PutBytes(e.BlockHash) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconBlockHeader object +func (b *BeaconBlockHeader) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockHeader object to a target array +func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + dst = append(dst, b.ParentRoot...) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Field (4) 'BodyRoot' + if size := len(b.BodyRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) + return + } + dst = append(dst, b.BodyRoot...) + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockHeader object +func (b *BeaconBlockHeader) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 112 { + return ssz.ErrSize + } + + // Field (0) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'ProposerIndex' + b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) + + // Field (2) 'ParentRoot' + if cap(b.ParentRoot) == 0 { + b.ParentRoot = make([]byte, 0, len(buf[16:48])) + } + b.ParentRoot = append(b.ParentRoot, buf[16:48]...) + + // Field (3) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[48:80])) + } + b.StateRoot = append(b.StateRoot, buf[48:80]...) + + // Field (4) 'BodyRoot' + if cap(b.BodyRoot) == 0 { + b.BodyRoot = make([]byte, 0, len(buf[80:112])) + } + b.BodyRoot = append(b.BodyRoot, buf[80:112]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockHeader object +func (b *BeaconBlockHeader) SizeSSZ() (size int) { + size = 112 + return +} + +// HashTreeRoot ssz hashes the BeaconBlockHeader object +func (b *BeaconBlockHeader) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockHeader object with a hasher +func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (1) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (2) 'ParentRoot' + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) + return + } + hh.PutBytes(b.ParentRoot) + + // Field (3) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + // Field (4) 'BodyRoot' + if size := len(b.BodyRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) + return + } + hh.PutBytes(b.BodyRoot) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBeaconBlockHeader object +func (s *SignedBeaconBlockHeader) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockHeader object to a target array +func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Header' + if s.Header == nil { + s.Header = new(BeaconBlockHeader) + } + if dst, err = s.Header.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockHeader object +func (s *SignedBeaconBlockHeader) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 208 { + return ssz.ErrSize + } + + // Field (0) 'Header' + if s.Header == nil { + s.Header = new(BeaconBlockHeader) + } + if err = s.Header.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[112:208])) + } + s.Signature = append(s.Signature, buf[112:208]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockHeader object +func (s *SignedBeaconBlockHeader) SizeSSZ() (size int) { + size = 208 + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockHeader object +func (s *SignedBeaconBlockHeader) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockHeader object with a hasher +func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = s.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the IndexedAttestation object +func (i *IndexedAttestation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(i) +} + +// MarshalSSZTo ssz marshals the IndexedAttestation object to a target array +func (i *IndexedAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(228) + + // Offset (0) 'AttestingIndices' + dst = ssz.WriteOffset(dst, offset) + offset += len(i.AttestingIndices) * 8 + + // Field (1) 'Data' + if i.Data == nil { + i.Data = new(AttestationData) + } + if dst, err = i.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, i.Signature...) + + // Field (0) 'AttestingIndices' + if size := len(i.AttestingIndices); size > 2048 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) + return + } + for ii := 0; ii < len(i.AttestingIndices); ii++ { + dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the IndexedAttestation object +func (i *IndexedAttestation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 228 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AttestingIndices' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 228 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if i.Data == nil { + i.Data = new(AttestationData) + } + if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(i.Signature) == 0 { + i.Signature = make([]byte, 0, len(buf[132:228])) + } + i.Signature = append(i.Signature, buf[132:228]...) + + // Field (0) 'AttestingIndices' + { + buf = tail[o0:] + num, err := ssz.DivideInt2(len(buf), 8, 2048) + if err != nil { + return err + } + i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) + for ii := 0; ii < num; ii++ { + i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestation object +func (i *IndexedAttestation) SizeSSZ() (size int) { + size = 228 + + // Field (0) 'AttestingIndices' + size += len(i.AttestingIndices) * 8 + + return +} + +// HashTreeRoot ssz hashes the IndexedAttestation object +func (i *IndexedAttestation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(i) +} + +// HashTreeRootWith ssz hashes the IndexedAttestation object with a hasher +func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestingIndices' + { + if size := len(i.AttestingIndices); size > 2048 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) + return + } + subIndx := hh.Index() + for _, i := range i.AttestingIndices { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(i.AttestingIndices)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) + } + + // Field (1) 'Data' + if err = i.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(i.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Deposit_Data object +func (d *Deposit_Data) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the Deposit_Data object to a target array +func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + dst = append(dst, d.PublicKey...) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + dst = append(dst, d.WithdrawalCredentials...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, d.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the Deposit_Data object +func (d *Deposit_Data) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 184 { + return ssz.ErrSize + } + + // Field (0) 'PublicKey' + if cap(d.PublicKey) == 0 { + d.PublicKey = make([]byte, 0, len(buf[0:48])) + } + d.PublicKey = append(d.PublicKey, buf[0:48]...) + + // Field (1) 'WithdrawalCredentials' + if cap(d.WithdrawalCredentials) == 0 { + d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + } + d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) + + // Field (2) 'Amount' + d.Amount = ssz.UnmarshallUint64(buf[80:88]) + + // Field (3) 'Signature' + if cap(d.Signature) == 0 { + d.Signature = make([]byte, 0, len(buf[88:184])) + } + d.Signature = append(d.Signature, buf[88:184]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Deposit_Data object +func (d *Deposit_Data) SizeSSZ() (size int) { + size = 184 + return +} + +// HashTreeRoot ssz hashes the Deposit_Data object +func (d *Deposit_Data) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the Deposit_Data object with a hasher +func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + hh.PutBytes(d.PublicKey) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + hh.PutBytes(d.WithdrawalCredentials) + + // Field (2) 'Amount' + hh.PutUint64(d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(d.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BeaconState object +func (b *BeaconState) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconState object to a target array +func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2687377) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochAttestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + offset += 4 + offset += b.PreviousEpochAttestations[ii].SizeSSZ() + } + + // Offset (16) 'CurrentEpochAttestations' + dst = ssz.WriteOffset(dst, offset) + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + offset += 4 + offset += b.CurrentEpochAttestations[ii].SizeSSZ() + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochAttestations' + if size := len(b.PreviousEpochAttestations); size > 4096 { + err = ssz.ErrListTooBigFn("--.PreviousEpochAttestations", size, 4096) + return + } + { + offset = 4 * len(b.PreviousEpochAttestations) + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.PreviousEpochAttestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + if dst, err = b.PreviousEpochAttestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (16) 'CurrentEpochAttestations' + if size := len(b.CurrentEpochAttestations); size > 4096 { + err = ssz.ErrListTooBigFn("--.CurrentEpochAttestations", size, 4096) + return + } + { + offset = 4 * len(b.CurrentEpochAttestations) + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + dst = ssz.WriteOffset(dst, offset) + offset += b.CurrentEpochAttestations[ii].SizeSSZ() + } + } + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + if dst, err = b.CurrentEpochAttestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconState object +func (b *BeaconState) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2687377 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2687377 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochAttestations' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochAttestations' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochAttestations' + { + buf = tail[o15:o16] + num, err := ssz.DecodeDynamicLength(buf, 4096) + if err != nil { + return err + } + b.PreviousEpochAttestations = make([]*PendingAttestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.PreviousEpochAttestations[indx] == nil { + b.PreviousEpochAttestations[indx] = new(PendingAttestation) + } + if err = b.PreviousEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + + // Field (16) 'CurrentEpochAttestations' + { + buf = tail[o16:] + num, err := ssz.DecodeDynamicLength(buf, 4096) + if err != nil { + return err + } + b.CurrentEpochAttestations = make([]*PendingAttestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.CurrentEpochAttestations[indx] == nil { + b.CurrentEpochAttestations[indx] = new(PendingAttestation) + } + if err = b.CurrentEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconState object +func (b *BeaconState) SizeSSZ() (size int) { + size = 2687377 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochAttestations' + for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { + size += 4 + size += b.PreviousEpochAttestations[ii].SizeSSZ() + } + + // Field (16) 'CurrentEpochAttestations' + for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { + size += 4 + size += b.CurrentEpochAttestations[ii].SizeSSZ() + } + + return +} + +// HashTreeRoot ssz hashes the BeaconState object +func (b *BeaconState) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconState object with a hasher +func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochAttestations' + { + subIndx := hh.Index() + num := uint64(len(b.PreviousEpochAttestations)) + if num > 4096 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PreviousEpochAttestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 4096) + } + + // Field (16) 'CurrentEpochAttestations' + { + subIndx := hh.Index() + num := uint64(len(b.CurrentEpochAttestations)) + if num > 4096 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.CurrentEpochAttestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 4096) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Fork object +func (f *Fork) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(f) +} + +// MarshalSSZTo ssz marshals the Fork object to a target array +func (f *Fork) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PreviousVersion' + if size := len(f.PreviousVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) + return + } + dst = append(dst, f.PreviousVersion...) + + // Field (1) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + dst = append(dst, f.CurrentVersion...) + + // Field (2) 'Epoch' + dst = ssz.MarshalUint64(dst, uint64(f.Epoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the Fork object +func (f *Fork) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'PreviousVersion' + if cap(f.PreviousVersion) == 0 { + f.PreviousVersion = make([]byte, 0, len(buf[0:4])) + } + f.PreviousVersion = append(f.PreviousVersion, buf[0:4]...) + + // Field (1) 'CurrentVersion' + if cap(f.CurrentVersion) == 0 { + f.CurrentVersion = make([]byte, 0, len(buf[4:8])) + } + f.CurrentVersion = append(f.CurrentVersion, buf[4:8]...) + + // Field (2) 'Epoch' + f.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Fork object +func (f *Fork) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the Fork object +func (f *Fork) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(f) +} + +// HashTreeRootWith ssz hashes the Fork object with a hasher +func (f *Fork) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PreviousVersion' + if size := len(f.PreviousVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) + return + } + hh.PutBytes(f.PreviousVersion) + + // Field (1) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + hh.PutBytes(f.CurrentVersion) + + // Field (2) 'Epoch' + hh.PutUint64(uint64(f.Epoch)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PendingAttestation object +func (p *PendingAttestation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PendingAttestation object to a target array +func (p *PendingAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(148) + + // Offset (0) 'AggregationBits' + dst = ssz.WriteOffset(dst, offset) + offset += len(p.AggregationBits) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(AttestationData) + } + if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'InclusionDelay' + dst = ssz.MarshalUint64(dst, uint64(p.InclusionDelay)) + + // Field (3) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(p.ProposerIndex)) + + // Field (0) 'AggregationBits' + if size := len(p.AggregationBits); size > 2048 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) + return + } + dst = append(dst, p.AggregationBits...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PendingAttestation object +func (p *PendingAttestation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 148 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AggregationBits' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 148 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(AttestationData) + } + if err = p.Data.UnmarshalSSZ(buf[4:132]); err != nil { + return err + } + + // Field (2) 'InclusionDelay' + p.InclusionDelay = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[132:140])) + + // Field (3) 'ProposerIndex' + p.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[140:148])) + + // Field (0) 'AggregationBits' + { + buf = tail[o0:] + if err = ssz.ValidateBitlist(buf, 2048); err != nil { + return err + } + if cap(p.AggregationBits) == 0 { + p.AggregationBits = make([]byte, 0, len(buf)) + } + p.AggregationBits = append(p.AggregationBits, buf...) + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PendingAttestation object +func (p *PendingAttestation) SizeSSZ() (size int) { + size = 148 + + // Field (0) 'AggregationBits' + size += len(p.AggregationBits) + + return +} + +// HashTreeRoot ssz hashes the PendingAttestation object +func (p *PendingAttestation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PendingAttestation object with a hasher +func (p *PendingAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if len(p.AggregationBits) == 0 { + err = ssz.ErrEmptyBitlist + return + } + hh.PutBitlist(p.AggregationBits, 2048) + + // Field (1) 'Data' + if err = p.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'InclusionDelay' + hh.PutUint64(uint64(p.InclusionDelay)) + + // Field (3) 'ProposerIndex' + hh.PutUint64(uint64(p.ProposerIndex)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the HistoricalBatch object +func (h *HistoricalBatch) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(h) +} + +// MarshalSSZTo ssz marshals the HistoricalBatch object to a target array +func (h *HistoricalBatch) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockRoots' + if size := len(h.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(h.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, h.BlockRoots[ii]...) + } + + // Field (1) 'StateRoots' + if size := len(h.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(h.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, h.StateRoots[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the HistoricalBatch object +func (h *HistoricalBatch) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 524288 { + return ssz.ErrSize + } + + // Field (0) 'BlockRoots' + h.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(h.BlockRoots[ii]) == 0 { + h.BlockRoots[ii] = make([]byte, 0, len(buf[0:262144][ii*32:(ii+1)*32])) + } + h.BlockRoots[ii] = append(h.BlockRoots[ii], buf[0:262144][ii*32:(ii+1)*32]...) + } + + // Field (1) 'StateRoots' + h.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(h.StateRoots[ii]) == 0 { + h.StateRoots[ii] = make([]byte, 0, len(buf[262144:524288][ii*32:(ii+1)*32])) + } + h.StateRoots[ii] = append(h.StateRoots[ii], buf[262144:524288][ii*32:(ii+1)*32]...) + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the HistoricalBatch object +func (h *HistoricalBatch) SizeSSZ() (size int) { + size = 524288 + return +} + +// HashTreeRoot ssz hashes the HistoricalBatch object +func (h *HistoricalBatch) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(h) +} + +// HashTreeRootWith ssz hashes the HistoricalBatch object with a hasher +func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BlockRoots' + { + if size := len(h.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range h.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (1) 'StateRoots' + { + if size := len(h.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range h.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SigningData object +func (s *SigningData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SigningData object to a target array +func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ObjectRoot' + if size := len(s.ObjectRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) + return + } + dst = append(dst, s.ObjectRoot...) + + // Field (1) 'Domain' + if size := len(s.Domain); size != 32 { + err = ssz.ErrBytesLengthFn("--.Domain", size, 32) + return + } + dst = append(dst, s.Domain...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SigningData object +func (s *SigningData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 64 { + return ssz.ErrSize + } + + // Field (0) 'ObjectRoot' + if cap(s.ObjectRoot) == 0 { + s.ObjectRoot = make([]byte, 0, len(buf[0:32])) + } + s.ObjectRoot = append(s.ObjectRoot, buf[0:32]...) + + // Field (1) 'Domain' + if cap(s.Domain) == 0 { + s.Domain = make([]byte, 0, len(buf[32:64])) + } + s.Domain = append(s.Domain, buf[32:64]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SigningData object +func (s *SigningData) SizeSSZ() (size int) { + size = 64 + return +} + +// HashTreeRoot ssz hashes the SigningData object +func (s *SigningData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SigningData object with a hasher +func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ObjectRoot' + if size := len(s.ObjectRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) + return + } + hh.PutBytes(s.ObjectRoot) + + // Field (1) 'Domain' + if size := len(s.Domain); size != 32 { + err = ssz.ErrBytesLengthFn("--.Domain", size, 32) + return + } + hh.PutBytes(s.Domain) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the ForkData object +func (f *ForkData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(f) +} + +// MarshalSSZTo ssz marshals the ForkData object to a target array +func (f *ForkData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + dst = append(dst, f.CurrentVersion...) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(f.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, f.GenesisValidatorsRoot...) + + return +} + +// UnmarshalSSZ ssz unmarshals the ForkData object +func (f *ForkData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 36 { + return ssz.ErrSize + } + + // Field (0) 'CurrentVersion' + if cap(f.CurrentVersion) == 0 { + f.CurrentVersion = make([]byte, 0, len(buf[0:4])) + } + f.CurrentVersion = append(f.CurrentVersion, buf[0:4]...) + + // Field (1) 'GenesisValidatorsRoot' + if cap(f.GenesisValidatorsRoot) == 0 { + f.GenesisValidatorsRoot = make([]byte, 0, len(buf[4:36])) + } + f.GenesisValidatorsRoot = append(f.GenesisValidatorsRoot, buf[4:36]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ForkData object +func (f *ForkData) SizeSSZ() (size int) { + size = 36 + return +} + +// HashTreeRoot ssz hashes the ForkData object +func (f *ForkData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(f) +} + +// HashTreeRootWith ssz hashes the ForkData object with a hasher +func (f *ForkData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'CurrentVersion' + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) + return + } + hh.PutBytes(f.CurrentVersion) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(f.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(f.GenesisValidatorsRoot) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the DepositMessage object +func (d *DepositMessage) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DepositMessage object to a target array +func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + dst = append(dst, d.PublicKey...) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + dst = append(dst, d.WithdrawalCredentials...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, d.Amount) + + return +} + +// UnmarshalSSZ ssz unmarshals the DepositMessage object +func (d *DepositMessage) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 88 { + return ssz.ErrSize + } + + // Field (0) 'PublicKey' + if cap(d.PublicKey) == 0 { + d.PublicKey = make([]byte, 0, len(buf[0:48])) + } + d.PublicKey = append(d.PublicKey, buf[0:48]...) + + // Field (1) 'WithdrawalCredentials' + if cap(d.WithdrawalCredentials) == 0 { + d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + } + d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) + + // Field (2) 'Amount' + d.Amount = ssz.UnmarshallUint64(buf[80:88]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DepositMessage object +func (d *DepositMessage) SizeSSZ() (size int) { + size = 88 + return +} + +// HashTreeRoot ssz hashes the DepositMessage object +func (d *DepositMessage) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DepositMessage object with a hasher +func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PublicKey' + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + hh.PutBytes(d.PublicKey) + + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + hh.PutBytes(d.WithdrawalCredentials) + + // Field (2) 'Amount' + hh.PutUint64(d.Amount) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PowBlock object +func (p *PowBlock) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PowBlock object to a target array +func (p *PowBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockHash' + if size := len(p.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + dst = append(dst, p.BlockHash...) + + // Field (1) 'ParentHash' + if size := len(p.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + dst = append(dst, p.ParentHash...) + + // Field (2) 'TotalDifficulty' + if size := len(p.TotalDifficulty); size != 32 { + err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) + return + } + dst = append(dst, p.TotalDifficulty...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PowBlock object +func (p *PowBlock) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 96 { + return ssz.ErrSize + } + + // Field (0) 'BlockHash' + if cap(p.BlockHash) == 0 { + p.BlockHash = make([]byte, 0, len(buf[0:32])) + } + p.BlockHash = append(p.BlockHash, buf[0:32]...) + + // Field (1) 'ParentHash' + if cap(p.ParentHash) == 0 { + p.ParentHash = make([]byte, 0, len(buf[32:64])) + } + p.ParentHash = append(p.ParentHash, buf[32:64]...) + + // Field (2) 'TotalDifficulty' + if cap(p.TotalDifficulty) == 0 { + p.TotalDifficulty = make([]byte, 0, len(buf[64:96])) + } + p.TotalDifficulty = append(p.TotalDifficulty, buf[64:96]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PowBlock object +func (p *PowBlock) SizeSSZ() (size int) { + size = 96 + return +} + +// HashTreeRoot ssz hashes the PowBlock object +func (p *PowBlock) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PowBlock object with a hasher +func (p *PowBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BlockHash' + if size := len(p.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return + } + hh.PutBytes(p.BlockHash) + + // Field (1) 'ParentHash' + if size := len(p.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + hh.PutBytes(p.ParentHash) + + // Field (2) 'TotalDifficulty' + if size := len(p.TotalDifficulty); size != 32 { + err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) + return + } + hh.PutBytes(p.TotalDifficulty) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Status object +func (s *Status) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the Status object to a target array +func (s *Status) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ForkDigest' + if size := len(s.ForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) + return + } + dst = append(dst, s.ForkDigest...) + + // Field (1) 'FinalizedRoot' + if size := len(s.FinalizedRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) + return + } + dst = append(dst, s.FinalizedRoot...) + + // Field (2) 'FinalizedEpoch' + dst = ssz.MarshalUint64(dst, uint64(s.FinalizedEpoch)) + + // Field (3) 'HeadRoot' + if size := len(s.HeadRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) + return + } + dst = append(dst, s.HeadRoot...) + + // Field (4) 'HeadSlot' + dst = ssz.MarshalUint64(dst, uint64(s.HeadSlot)) + + return +} + +// UnmarshalSSZ ssz unmarshals the Status object +func (s *Status) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 84 { + return ssz.ErrSize + } + + // Field (0) 'ForkDigest' + if cap(s.ForkDigest) == 0 { + s.ForkDigest = make([]byte, 0, len(buf[0:4])) + } + s.ForkDigest = append(s.ForkDigest, buf[0:4]...) + + // Field (1) 'FinalizedRoot' + if cap(s.FinalizedRoot) == 0 { + s.FinalizedRoot = make([]byte, 0, len(buf[4:36])) + } + s.FinalizedRoot = append(s.FinalizedRoot, buf[4:36]...) + + // Field (2) 'FinalizedEpoch' + s.FinalizedEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[36:44])) + + // Field (3) 'HeadRoot' + if cap(s.HeadRoot) == 0 { + s.HeadRoot = make([]byte, 0, len(buf[44:76])) + } + s.HeadRoot = append(s.HeadRoot, buf[44:76]...) + + // Field (4) 'HeadSlot' + s.HeadSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[76:84])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Status object +func (s *Status) SizeSSZ() (size int) { + size = 84 + return +} + +// HashTreeRoot ssz hashes the Status object +func (s *Status) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the Status object with a hasher +func (s *Status) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ForkDigest' + if size := len(s.ForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) + return + } + hh.PutBytes(s.ForkDigest) + + // Field (1) 'FinalizedRoot' + if size := len(s.FinalizedRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) + return + } + hh.PutBytes(s.FinalizedRoot) + + // Field (2) 'FinalizedEpoch' + hh.PutUint64(uint64(s.FinalizedEpoch)) + + // Field (3) 'HeadRoot' + if size := len(s.HeadRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) + return + } + hh.PutBytes(s.HeadRoot) + + // Field (4) 'HeadSlot' + hh.PutUint64(uint64(s.HeadSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the ENRForkID object +func (e *ENRForkID) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ENRForkID object to a target array +func (e *ENRForkID) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'CurrentForkDigest' + if size := len(e.CurrentForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) + return + } + dst = append(dst, e.CurrentForkDigest...) + + // Field (1) 'NextForkVersion' + if size := len(e.NextForkVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) + return + } + dst = append(dst, e.NextForkVersion...) + + // Field (2) 'NextForkEpoch' + dst = ssz.MarshalUint64(dst, uint64(e.NextForkEpoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the ENRForkID object +func (e *ENRForkID) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 16 { + return ssz.ErrSize + } + + // Field (0) 'CurrentForkDigest' + if cap(e.CurrentForkDigest) == 0 { + e.CurrentForkDigest = make([]byte, 0, len(buf[0:4])) + } + e.CurrentForkDigest = append(e.CurrentForkDigest, buf[0:4]...) + + // Field (1) 'NextForkVersion' + if cap(e.NextForkVersion) == 0 { + e.NextForkVersion = make([]byte, 0, len(buf[4:8])) + } + e.NextForkVersion = append(e.NextForkVersion, buf[4:8]...) + + // Field (2) 'NextForkEpoch' + e.NextForkEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ENRForkID object +func (e *ENRForkID) SizeSSZ() (size int) { + size = 16 + return +} + +// HashTreeRoot ssz hashes the ENRForkID object +func (e *ENRForkID) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the ENRForkID object with a hasher +func (e *ENRForkID) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'CurrentForkDigest' + if size := len(e.CurrentForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) + return + } + hh.PutBytes(e.CurrentForkDigest) + + // Field (1) 'NextForkVersion' + if size := len(e.NextForkVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) + return + } + hh.PutBytes(e.NextForkVersion) + + // Field (2) 'NextForkEpoch' + hh.PutUint64(uint64(e.NextForkEpoch)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the Validator object +func (v *Validator) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(v) +} + +// MarshalSSZTo ssz marshals the Validator object to a target array +func (v *Validator) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'PublicKey' + if size := len(v.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + dst = append(dst, v.PublicKey...) + + // Field (1) 'WithdrawalCredentials' + if size := len(v.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + dst = append(dst, v.WithdrawalCredentials...) + + // Field (2) 'EffectiveBalance' + dst = ssz.MarshalUint64(dst, v.EffectiveBalance) + + // Field (3) 'Slashed' + dst = ssz.MarshalBool(dst, v.Slashed) + + // Field (4) 'ActivationEligibilityEpoch' + dst = ssz.MarshalUint64(dst, uint64(v.ActivationEligibilityEpoch)) + + // Field (5) 'ActivationEpoch' + dst = ssz.MarshalUint64(dst, uint64(v.ActivationEpoch)) + + // Field (6) 'ExitEpoch' + dst = ssz.MarshalUint64(dst, uint64(v.ExitEpoch)) + + // Field (7) 'WithdrawableEpoch' + dst = ssz.MarshalUint64(dst, uint64(v.WithdrawableEpoch)) + + return +} + +// UnmarshalSSZ ssz unmarshals the Validator object +func (v *Validator) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 121 { + return ssz.ErrSize + } + + // Field (0) 'PublicKey' + if cap(v.PublicKey) == 0 { + v.PublicKey = make([]byte, 0, len(buf[0:48])) + } + v.PublicKey = append(v.PublicKey, buf[0:48]...) + + // Field (1) 'WithdrawalCredentials' + if cap(v.WithdrawalCredentials) == 0 { + v.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) + } + v.WithdrawalCredentials = append(v.WithdrawalCredentials, buf[48:80]...) + + // Field (2) 'EffectiveBalance' + v.EffectiveBalance = ssz.UnmarshallUint64(buf[80:88]) + + // Field (3) 'Slashed' + v.Slashed = ssz.UnmarshalBool(buf[88:89]) + + // Field (4) 'ActivationEligibilityEpoch' + v.ActivationEligibilityEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[89:97])) + + // Field (5) 'ActivationEpoch' + v.ActivationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[97:105])) + + // Field (6) 'ExitEpoch' + v.ExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[105:113])) + + // Field (7) 'WithdrawableEpoch' + v.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[113:121])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the Validator object +func (v *Validator) SizeSSZ() (size int) { + size = 121 + return +} + +// HashTreeRoot ssz hashes the Validator object +func (v *Validator) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(v) +} + +// HashTreeRootWith ssz hashes the Validator object with a hasher +func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PublicKey' + if size := len(v.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) + return + } + hh.PutBytes(v.PublicKey) + + // Field (1) 'WithdrawalCredentials' + if size := len(v.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return + } + hh.PutBytes(v.WithdrawalCredentials) + + // Field (2) 'EffectiveBalance' + hh.PutUint64(v.EffectiveBalance) + + // Field (3) 'Slashed' + hh.PutBool(v.Slashed) + + // Field (4) 'ActivationEligibilityEpoch' + hh.PutUint64(uint64(v.ActivationEligibilityEpoch)) + + // Field (5) 'ActivationEpoch' + hh.PutUint64(uint64(v.ActivationEpoch)) + + // Field (6) 'ExitEpoch' + hh.PutUint64(uint64(v.ExitEpoch)) + + // Field (7) 'WithdrawableEpoch' + hh.PutUint64(uint64(v.WithdrawableEpoch)) + + hh.Merkleize(indx) + return +} diff --git a/tools/ssz.bzl b/tools/ssz.bzl index e5630e832c12..763972a42289 100644 --- a/tools/ssz.bzl +++ b/tools/ssz.bzl @@ -60,6 +60,9 @@ def _ssz_go_proto_library_impl(ctx): if len(ctx.attr.objs) > 0: args.append("--objs=%s" % ",".join(ctx.attr.objs)) + if len(ctx.attr.exclude_objs) > 0: + args.append("--exclude-objs=%s" % ",".join(ctx.attr.exclude_objs)) + ctx.actions.run( executable = ctx.executable.sszgen, progress_message = "Generating ssz marshal and unmarshal functions", @@ -79,9 +82,10 @@ ssz_gen_marshal = rule( cfg = "exec", ), "objs": attr.string_list(), + "exclude_objs": attr.string_list(), "includes": attr.label_list(providers = [GoLibrary]), + "out": attr.output(), }, - outputs = {"out": "generated.ssz.go"}, ) SSZ_DEPS = ["@com_github_prysmaticlabs_fastssz//:go_default_library"] diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index c8b5611c24fe..2a76b823f091 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -71,7 +71,6 @@ go_library( "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", "@org_golang_google_protobuf//encoding/protojson:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index 7091c9d7786c..e2a023361672 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -22,7 +22,6 @@ import ( "github.com/gorilla/mux" gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" - fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/gateway" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" @@ -122,8 +121,6 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { } } - configureFastSSZHashingAlgorithm() - // initialize router used for endpoints router := newRouter(cliCtx) // If the --web flag is enabled to administer the validator @@ -794,7 +791,3 @@ func clearDB(ctx context.Context, dataDir string, force bool, isDatabaseMinimal return nil } - -func configureFastSSZHashingAlgorithm() { - fastssz.EnableVectorizedHTR = true -} From adc875b20d9f0ca8dcd0199051cd990c544707a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 24 Jun 2024 15:57:11 +0200 Subject: [PATCH 145/325] EIP-7549: p2p and sync (#14085) * EIP-7549: p2p and sync * small cleanup * fuzz fix * deepsource * review * fix ineffectual assignment * fix pubsub * update ComputeSubnetForAttestation * review * review --- beacon-chain/core/helpers/attestation.go | 9 + beacon-chain/core/helpers/attestation_test.go | 44 ++-- beacon-chain/p2p/gossip_topic_mappings.go | 25 ++- .../p2p/gossip_topic_mappings_test.go | 80 +++++-- beacon-chain/p2p/types/BUILD.bazel | 1 + beacon-chain/p2p/types/object_mapping.go | 78 +++++-- beacon-chain/p2p/types/object_mapping_test.go | 32 ++- beacon-chain/sync/BUILD.bazel | 3 +- beacon-chain/sync/decode_pubsub.go | 65 +++++- beacon-chain/sync/decode_pubsub_test.go | 199 ++++++++++++++++++ beacon-chain/sync/fuzz_exports.go | 2 +- .../sync/pending_attestations_queue.go | 62 +++--- .../sync/pending_attestations_queue_test.go | 92 ++++++-- beacon-chain/sync/rpc_chunked_response.go | 30 +-- .../sync/rpc_chunked_response_test.go | 121 ----------- beacon-chain/sync/rpc_metadata.go | 30 +-- beacon-chain/sync/rpc_metadata_test.go | 81 ------- beacon-chain/sync/service.go | 4 +- .../sync/subscriber_beacon_aggregate_proof.go | 14 +- .../sync/subscriber_beacon_attestation.go | 18 +- beacon-chain/sync/validate_aggregate_proof.go | 132 ++++++++---- .../sync/validate_aggregate_proof_test.go | 6 +- .../sync/validate_beacon_attestation.go | 85 ++++++-- .../validate_beacon_attestation_electra.go | 27 +++ ...alidate_beacon_attestation_electra_test.go | 46 ++++ .../sync/validate_beacon_attestation_test.go | 4 +- 26 files changed, 857 insertions(+), 433 deletions(-) delete mode 100644 beacon-chain/sync/rpc_chunked_response_test.go create mode 100644 beacon-chain/sync/validate_beacon_attestation_electra.go create mode 100644 beacon-chain/sync/validate_beacon_attestation_electra_test.go diff --git a/beacon-chain/core/helpers/attestation.go b/beacon-chain/core/helpers/attestation.go index 0e9baf993235..807743e4f893 100644 --- a/beacon-chain/core/helpers/attestation.go +++ b/beacon-chain/core/helpers/attestation.go @@ -10,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -91,6 +92,14 @@ func IsAggregated(attestation ethpb.Att) bool { // // return uint64((committees_since_epoch_start + committee_index) % ATTESTATION_SUBNET_COUNT) func ComputeSubnetForAttestation(activeValCount uint64, att ethpb.Att) uint64 { + if att.Version() >= version.Electra { + committeeIndex := 0 + committeeIndices := att.CommitteeBitsVal().BitIndices() + if len(committeeIndices) > 0 { + committeeIndex = committeeIndices[0] + } + return ComputeSubnetFromCommitteeAndSlot(activeValCount, primitives.CommitteeIndex(committeeIndex), att.GetData().Slot) + } return ComputeSubnetFromCommitteeAndSlot(activeValCount, att.GetData().CommitteeIndex, att.GetData().Slot) } diff --git a/beacon-chain/core/helpers/attestation_test.go b/beacon-chain/core/helpers/attestation_test.go index e4a84ae42233..7004c9510aa2 100644 --- a/beacon-chain/core/helpers/attestation_test.go +++ b/beacon-chain/core/helpers/attestation_test.go @@ -73,21 +73,37 @@ func TestAttestation_ComputeSubnetForAttestation(t *testing.T) { RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), }) require.NoError(t, err) - att := ðpb.Attestation{ - AggregationBits: []byte{'A'}, - Data: ðpb.AttestationData{ - Slot: 34, - CommitteeIndex: 4, - BeaconBlockRoot: []byte{'C'}, - Source: nil, - Target: nil, - }, - Signature: []byte{'B'}, - } - valCount, err := helpers.ActiveValidatorCount(context.Background(), state, slots.ToEpoch(att.Data.Slot)) + valCount, err := helpers.ActiveValidatorCount(context.Background(), state, slots.ToEpoch(34)) require.NoError(t, err) - sub := helpers.ComputeSubnetForAttestation(valCount, att) - assert.Equal(t, uint64(6), sub, "Did not get correct subnet for attestation") + + t.Run("Phase 0", func(t *testing.T) { + att := ðpb.Attestation{ + AggregationBits: []byte{'A'}, + Data: ðpb.AttestationData{ + Slot: 34, + CommitteeIndex: 4, + BeaconBlockRoot: []byte{'C'}, + }, + Signature: []byte{'B'}, + } + sub := helpers.ComputeSubnetForAttestation(valCount, att) + assert.Equal(t, uint64(6), sub, "Did not get correct subnet for attestation") + }) + t.Run("Electra", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(4, true) + att := ðpb.AttestationElectra{ + AggregationBits: []byte{'A'}, + CommitteeBits: cb, + Data: ðpb.AttestationData{ + Slot: 34, + BeaconBlockRoot: []byte{'C'}, + }, + Signature: []byte{'B'}, + } + sub := helpers.ComputeSubnetForAttestation(valCount, att) + assert.Equal(t, uint64(6), sub, "Did not get correct subnet for attestation") + }) } func Test_ValidateAttestationTime(t *testing.T) { diff --git a/beacon-chain/p2p/gossip_topic_mappings.go b/beacon-chain/p2p/gossip_topic_mappings.go index 76dfe722ed65..31733df0aa83 100644 --- a/beacon-chain/p2p/gossip_topic_mappings.go +++ b/beacon-chain/p2p/gossip_topic_mappings.go @@ -27,7 +27,8 @@ var gossipTopicMappings = map[string]proto.Message{ // GossipTopicMappings is a function to return the assigned data type // versioned by epoch. func GossipTopicMappings(topic string, epoch primitives.Epoch) proto.Message { - if topic == BlockSubnetTopicFormat { + switch topic { + case BlockSubnetTopicFormat: if epoch >= params.BeaconConfig().ElectraForkEpoch { return ðpb.SignedBeaconBlockElectra{} } @@ -43,8 +44,25 @@ func GossipTopicMappings(topic string, epoch primitives.Epoch) proto.Message { if epoch >= params.BeaconConfig().AltairForkEpoch { return ðpb.SignedBeaconBlockAltair{} } + return gossipTopicMappings[topic] + case AttestationSubnetTopicFormat: + if epoch >= params.BeaconConfig().ElectraForkEpoch { + return ðpb.AttestationElectra{} + } + return gossipTopicMappings[topic] + case AttesterSlashingSubnetTopicFormat: + if epoch >= params.BeaconConfig().ElectraForkEpoch { + return ðpb.AttesterSlashingElectra{} + } + return gossipTopicMappings[topic] + case AggregateAndProofSubnetTopicFormat: + if epoch >= params.BeaconConfig().ElectraForkEpoch { + return ðpb.SignedAggregateAttestationAndProofElectra{} + } + return gossipTopicMappings[topic] + default: + return gossipTopicMappings[topic] } - return gossipTopicMappings[topic] } // AllTopics returns all topics stored in our @@ -75,4 +93,7 @@ func init() { GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockDeneb{})] = BlockSubnetTopicFormat // Specially handle Electra objects. GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockElectra{})] = BlockSubnetTopicFormat + GossipTypeMapping[reflect.TypeOf(ðpb.AttestationElectra{})] = AttestationSubnetTopicFormat + GossipTypeMapping[reflect.TypeOf(ðpb.AttesterSlashingElectra{})] = AttesterSlashingSubnetTopicFormat + GossipTypeMapping[reflect.TypeOf(ðpb.SignedAggregateAttestationAndProofElectra{})] = AggregateAndProofSubnetTopicFormat } diff --git a/beacon-chain/p2p/gossip_topic_mappings_test.go b/beacon-chain/p2p/gossip_topic_mappings_test.go index 88b03ba642fa..efe7f00e6e4f 100644 --- a/beacon-chain/p2p/gossip_topic_mappings_test.go +++ b/beacon-chain/p2p/gossip_topic_mappings_test.go @@ -22,20 +22,20 @@ func TestMappingHasNoDuplicates(t *testing.T) { } } -func TestGossipTopicMappings_CorrectBlockType(t *testing.T) { +func TestGossipTopicMappings_CorrectType(t *testing.T) { params.SetupTestConfigCleanup(t) bCfg := params.BeaconConfig().Copy() altairForkEpoch := primitives.Epoch(100) - BellatrixForkEpoch := primitives.Epoch(200) - CapellaForkEpoch := primitives.Epoch(300) - DenebForkEpoch := primitives.Epoch(400) - ElectraForkEpoch := primitives.Epoch(500) + bellatrixForkEpoch := primitives.Epoch(200) + capellaForkEpoch := primitives.Epoch(300) + denebForkEpoch := primitives.Epoch(400) + electraForkEpoch := primitives.Epoch(500) bCfg.AltairForkEpoch = altairForkEpoch - bCfg.BellatrixForkEpoch = BellatrixForkEpoch - bCfg.CapellaForkEpoch = CapellaForkEpoch - bCfg.DenebForkEpoch = DenebForkEpoch - bCfg.ElectraForkEpoch = ElectraForkEpoch + bCfg.BellatrixForkEpoch = bellatrixForkEpoch + bCfg.CapellaForkEpoch = capellaForkEpoch + bCfg.DenebForkEpoch = denebForkEpoch + bCfg.ElectraForkEpoch = electraForkEpoch bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.AltairForkVersion)] = primitives.Epoch(100) bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.BellatrixForkVersion)] = primitives.Epoch(200) bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.CapellaForkVersion)] = primitives.Epoch(300) @@ -47,29 +47,83 @@ func TestGossipTopicMappings_CorrectBlockType(t *testing.T) { pMessage := GossipTopicMappings(BlockSubnetTopicFormat, 0) _, ok := pMessage.(*ethpb.SignedBeaconBlock) assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttestationSubnetTopicFormat, 0) + _, ok = pMessage.(*ethpb.Attestation) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttesterSlashingSubnetTopicFormat, 0) + _, ok = pMessage.(*ethpb.AttesterSlashing) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AggregateAndProofSubnetTopicFormat, 0) + _, ok = pMessage.(*ethpb.SignedAggregateAttestationAndProof) + assert.Equal(t, true, ok) // Altair Fork pMessage = GossipTopicMappings(BlockSubnetTopicFormat, altairForkEpoch) _, ok = pMessage.(*ethpb.SignedBeaconBlockAltair) assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttestationSubnetTopicFormat, altairForkEpoch) + _, ok = pMessage.(*ethpb.Attestation) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttesterSlashingSubnetTopicFormat, altairForkEpoch) + _, ok = pMessage.(*ethpb.AttesterSlashing) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AggregateAndProofSubnetTopicFormat, altairForkEpoch) + _, ok = pMessage.(*ethpb.SignedAggregateAttestationAndProof) + assert.Equal(t, true, ok) // Bellatrix Fork - pMessage = GossipTopicMappings(BlockSubnetTopicFormat, BellatrixForkEpoch) + pMessage = GossipTopicMappings(BlockSubnetTopicFormat, bellatrixForkEpoch) _, ok = pMessage.(*ethpb.SignedBeaconBlockBellatrix) assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttestationSubnetTopicFormat, bellatrixForkEpoch) + _, ok = pMessage.(*ethpb.Attestation) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttesterSlashingSubnetTopicFormat, bellatrixForkEpoch) + _, ok = pMessage.(*ethpb.AttesterSlashing) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AggregateAndProofSubnetTopicFormat, bellatrixForkEpoch) + _, ok = pMessage.(*ethpb.SignedAggregateAttestationAndProof) + assert.Equal(t, true, ok) // Capella Fork - pMessage = GossipTopicMappings(BlockSubnetTopicFormat, CapellaForkEpoch) + pMessage = GossipTopicMappings(BlockSubnetTopicFormat, capellaForkEpoch) _, ok = pMessage.(*ethpb.SignedBeaconBlockCapella) assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttestationSubnetTopicFormat, capellaForkEpoch) + _, ok = pMessage.(*ethpb.Attestation) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttesterSlashingSubnetTopicFormat, capellaForkEpoch) + _, ok = pMessage.(*ethpb.AttesterSlashing) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AggregateAndProofSubnetTopicFormat, capellaForkEpoch) + _, ok = pMessage.(*ethpb.SignedAggregateAttestationAndProof) + assert.Equal(t, true, ok) // Deneb Fork - pMessage = GossipTopicMappings(BlockSubnetTopicFormat, DenebForkEpoch) + pMessage = GossipTopicMappings(BlockSubnetTopicFormat, denebForkEpoch) _, ok = pMessage.(*ethpb.SignedBeaconBlockDeneb) assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttestationSubnetTopicFormat, denebForkEpoch) + _, ok = pMessage.(*ethpb.Attestation) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttesterSlashingSubnetTopicFormat, denebForkEpoch) + _, ok = pMessage.(*ethpb.AttesterSlashing) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AggregateAndProofSubnetTopicFormat, denebForkEpoch) + _, ok = pMessage.(*ethpb.SignedAggregateAttestationAndProof) + assert.Equal(t, true, ok) // Electra Fork - pMessage = GossipTopicMappings(BlockSubnetTopicFormat, ElectraForkEpoch) + pMessage = GossipTopicMappings(BlockSubnetTopicFormat, electraForkEpoch) _, ok = pMessage.(*ethpb.SignedBeaconBlockElectra) assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttestationSubnetTopicFormat, electraForkEpoch) + _, ok = pMessage.(*ethpb.AttestationElectra) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AttesterSlashingSubnetTopicFormat, electraForkEpoch) + _, ok = pMessage.(*ethpb.AttesterSlashingElectra) + assert.Equal(t, true, ok) + pMessage = GossipTopicMappings(AggregateAndProofSubnetTopicFormat, electraForkEpoch) + _, ok = pMessage.(*ethpb.SignedAggregateAttestationAndProofElectra) + assert.Equal(t, true, ok) } diff --git a/beacon-chain/p2p/types/BUILD.bazel b/beacon-chain/p2p/types/BUILD.bazel index 2934b1413ba6..a66fcefd9e09 100644 --- a/beacon-chain/p2p/types/BUILD.bazel +++ b/beacon-chain/p2p/types/BUILD.bazel @@ -43,6 +43,7 @@ go_test( "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", diff --git a/beacon-chain/p2p/types/object_mapping.go b/beacon-chain/p2p/types/object_mapping.go index 2698bf93f54a..e8646b34ee7a 100644 --- a/beacon-chain/p2p/types/object_mapping.go +++ b/beacon-chain/p2p/types/object_mapping.go @@ -26,7 +26,13 @@ var ( BlockMap map[[4]byte]func() (interfaces.ReadOnlySignedBeaconBlock, error) // MetaDataMap maps the fork-version to the underlying data type for that // particular fork period. - MetaDataMap map[[4]byte]func() metadata.Metadata + MetaDataMap map[[4]byte]func() (metadata.Metadata, error) + // AttestationMap maps the fork-version to the underlying data type for that + // particular fork period. + AttestationMap map[[4]byte]func() (ethpb.Att, error) + // AggregateAttestationMap maps the fork-version to the underlying data type for that + // particular fork period. + AggregateAttestationMap map[[4]byte]func() (ethpb.SignedAggregateAttAndProof, error) ) // InitializeDataMaps initializes all the relevant object maps. This function is called to @@ -67,24 +73,68 @@ func InitializeDataMaps() { } // Reset our metadata map. - MetaDataMap = map[[4]byte]func() metadata.Metadata{ - bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion): func() metadata.Metadata { - return wrapper.WrappedMetadataV0(ðpb.MetaDataV0{}) + MetaDataMap = map[[4]byte]func() (metadata.Metadata, error){ + bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion): func() (metadata.Metadata, error) { + return wrapper.WrappedMetadataV0(ðpb.MetaDataV0{}), nil + }, + bytesutil.ToBytes4(params.BeaconConfig().AltairForkVersion): func() (metadata.Metadata, error) { + return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), nil + }, + bytesutil.ToBytes4(params.BeaconConfig().BellatrixForkVersion): func() (metadata.Metadata, error) { + return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), nil + }, + bytesutil.ToBytes4(params.BeaconConfig().CapellaForkVersion): func() (metadata.Metadata, error) { + return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), nil + }, + bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion): func() (metadata.Metadata, error) { + return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), nil + }, + bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion): func() (metadata.Metadata, error) { + return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), nil + }, + } + + // Reset our attestation map. + AttestationMap = map[[4]byte]func() (ethpb.Att, error){ + bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion): func() (ethpb.Att, error) { + return ðpb.Attestation{}, nil + }, + bytesutil.ToBytes4(params.BeaconConfig().AltairForkVersion): func() (ethpb.Att, error) { + return ðpb.Attestation{}, nil + }, + bytesutil.ToBytes4(params.BeaconConfig().BellatrixForkVersion): func() (ethpb.Att, error) { + return ðpb.Attestation{}, nil + }, + bytesutil.ToBytes4(params.BeaconConfig().CapellaForkVersion): func() (ethpb.Att, error) { + return ðpb.Attestation{}, nil + }, + bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion): func() (ethpb.Att, error) { + return ðpb.Attestation{}, nil + }, + bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion): func() (ethpb.Att, error) { + return ðpb.AttestationElectra{}, nil + }, + } + + // Reset our aggregate attestation map. + AggregateAttestationMap = map[[4]byte]func() (ethpb.SignedAggregateAttAndProof, error){ + bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion): func() (ethpb.SignedAggregateAttAndProof, error) { + return ðpb.SignedAggregateAttestationAndProof{}, nil }, - bytesutil.ToBytes4(params.BeaconConfig().AltairForkVersion): func() metadata.Metadata { - return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) + bytesutil.ToBytes4(params.BeaconConfig().AltairForkVersion): func() (ethpb.SignedAggregateAttAndProof, error) { + return ðpb.SignedAggregateAttestationAndProof{}, nil }, - bytesutil.ToBytes4(params.BeaconConfig().BellatrixForkVersion): func() metadata.Metadata { - return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) + bytesutil.ToBytes4(params.BeaconConfig().BellatrixForkVersion): func() (ethpb.SignedAggregateAttAndProof, error) { + return ðpb.SignedAggregateAttestationAndProof{}, nil }, - bytesutil.ToBytes4(params.BeaconConfig().CapellaForkVersion): func() metadata.Metadata { - return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) + bytesutil.ToBytes4(params.BeaconConfig().CapellaForkVersion): func() (ethpb.SignedAggregateAttAndProof, error) { + return ðpb.SignedAggregateAttestationAndProof{}, nil }, - bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion): func() metadata.Metadata { - return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) + bytesutil.ToBytes4(params.BeaconConfig().DenebForkVersion): func() (ethpb.SignedAggregateAttAndProof, error) { + return ðpb.SignedAggregateAttestationAndProof{}, nil }, - bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion): func() metadata.Metadata { - return wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}) + bytesutil.ToBytes4(params.BeaconConfig().ElectraForkVersion): func() (ethpb.SignedAggregateAttAndProof, error) { + return ðpb.SignedAggregateAttestationAndProofElectra{}, nil }, } } diff --git a/beacon-chain/p2p/types/object_mapping_test.go b/beacon-chain/p2p/types/object_mapping_test.go index 67c1fccaeec2..42a186e61b1c 100644 --- a/beacon-chain/p2p/types/object_mapping_test.go +++ b/beacon-chain/p2p/types/object_mapping_test.go @@ -5,7 +5,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" ) func TestInitializeDataMaps(t *testing.T) { @@ -44,8 +46,36 @@ func TestInitializeDataMaps(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tt.action() - _, ok := BlockMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] + bFunc, ok := BlockMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] assert.Equal(t, tt.exists, ok) + if tt.exists { + b, err := bFunc() + require.NoError(t, err) + generic, err := b.PbGenericBlock() + require.NoError(t, err) + assert.NotNil(t, generic.GetPhase0()) + } + mdFunc, ok := MetaDataMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] + if tt.exists { + md, err := mdFunc() + require.NoError(t, err) + assert.NotNil(t, md.MetadataObjV0()) + } + assert.Equal(t, tt.exists, ok) + attFunc, ok := AttestationMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] + if tt.exists { + att, err := attFunc() + require.NoError(t, err) + assert.Equal(t, version.Phase0, att.Version()) + } + assert.Equal(t, tt.exists, ok) + aggFunc, ok := AggregateAttestationMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] + assert.Equal(t, tt.exists, ok) + if tt.exists { + agg, err := aggFunc() + require.NoError(t, err) + assert.Equal(t, version.Phase0, agg.Version()) + } }) } } diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index 3a1a4673fbb9..c33ebdeb2e41 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -44,6 +44,7 @@ go_library( "validate_aggregate_proof.go", "validate_attester_slashing.go", "validate_beacon_attestation.go", + "validate_beacon_attestation_electra.go", "validate_beacon_blocks.go", "validate_blob.go", "validate_bls_to_execution_change.go", @@ -160,7 +161,6 @@ go_test( "rpc_beacon_blocks_by_root_test.go", "rpc_blob_sidecars_by_range_test.go", "rpc_blob_sidecars_by_root_test.go", - "rpc_chunked_response_test.go", "rpc_goodbye_test.go", "rpc_handler_test.go", "rpc_metadata_test.go", @@ -177,6 +177,7 @@ go_test( "sync_test.go", "validate_aggregate_proof_test.go", "validate_attester_slashing_test.go", + "validate_beacon_attestation_electra_test.go", "validate_beacon_attestation_test.go", "validate_beacon_blocks_test.go", "validate_blob_test.go", diff --git a/beacon-chain/sync/decode_pubsub.go b/beacon-chain/sync/decode_pubsub.go index d5524f70a198..a0e6070149c2 100644 --- a/beacon-chain/sync/decode_pubsub.go +++ b/beacon-chain/sync/decode_pubsub.go @@ -1,13 +1,20 @@ package sync import ( + "fmt" "reflect" "strings" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -50,11 +57,12 @@ func (s *Service) decodePubsubMessage(msg *pubsub.Message) (ssz.Unmarshaler, err return nil, errors.Errorf("message of %T does not support marshaller interface", base) } // Handle different message types across forks. - if topic == p2p.BlockSubnetTopicFormat { - m, err = extractBlockDataType(fDigest[:], s.cfg.clock) - if err != nil { - return nil, err - } + dt, err := extractValidDataTypeFromTopic(topic, fDigest[:], s.cfg.clock) + if err != nil { + return nil, err + } + if dt != nil { + m = dt } if err := s.cfg.p2p.Encoding().DecodeGossip(msg.Data, m); err != nil { return nil, err @@ -63,7 +71,7 @@ func (s *Service) decodePubsubMessage(msg *pubsub.Message) (ssz.Unmarshaler, err } // Replaces our fork digest with the formatter. -func (_ *Service) replaceForkDigest(topic string) (string, error) { +func (*Service) replaceForkDigest(topic string) (string, error) { subStrings := strings.Split(topic, "/") if len(subStrings) != 4 { return "", errInvalidTopic @@ -71,3 +79,48 @@ func (_ *Service) replaceForkDigest(topic string) (string, error) { subStrings[2] = "%x" return strings.Join(subStrings, "/"), nil } + +func extractValidDataTypeFromTopic(topic string, digest []byte, clock *startup.Clock) (ssz.Unmarshaler, error) { + switch topic { + case p2p.BlockSubnetTopicFormat: + return extractDataTypeFromTypeMap(types.BlockMap, digest, clock) + case p2p.AttestationSubnetTopicFormat: + return extractDataTypeFromTypeMap(types.AttestationMap, digest, clock) + case p2p.AggregateAndProofSubnetTopicFormat: + return extractDataTypeFromTypeMap(types.AggregateAttestationMap, digest, clock) + } + return nil, nil +} + +func extractDataTypeFromTypeMap[T any](typeMap map[[4]byte]func() (T, error), digest []byte, tor blockchain.TemporalOracle) (T, error) { + var zero T + + if len(digest) == 0 { + f, ok := typeMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] + if !ok { + return zero, fmt.Errorf("no %T type exists for the genesis fork version", zero) + } + return f() + } + if len(digest) != forkDigestLength { + return zero, errors.Errorf("invalid digest returned, wanted a length of %d but received %d", forkDigestLength, len(digest)) + } + vRoot := tor.GenesisValidatorsRoot() + for k, f := range typeMap { + rDigest, err := signing.ComputeForkDigest(k[:], vRoot[:]) + if err != nil { + return zero, err + } + if rDigest == bytesutil.ToBytes4(digest) { + return f() + } + } + return zero, errors.Wrapf( + ErrNoValidDigest, + "could not extract %T data type, saw digest=%#x, genesis=%v, vr=%#x", + zero, + digest, + tor.GenesisTime(), + tor.GenesisValidatorsRoot(), + ) +} diff --git a/beacon-chain/sync/decode_pubsub_test.go b/beacon-chain/sync/decode_pubsub_test.go index 1bc0f1c06f17..1638a2305890 100644 --- a/beacon-chain/sync/decode_pubsub_test.go +++ b/beacon-chain/sync/decode_pubsub_test.go @@ -11,15 +11,20 @@ import ( "github.com/d4l3k/messagediff" pubsub "github.com/libp2p/go-libp2p-pubsub" pb "github.com/libp2p/go-libp2p-pubsub/pb" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" p2ptesting "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/wrapper" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) @@ -109,3 +114,197 @@ func TestService_decodePubsubMessage(t *testing.T) { }) } } + +func TestExtractDataType(t *testing.T) { + // Precompute digests + genDigest, err := signing.ComputeForkDigest(params.BeaconConfig().GenesisForkVersion, params.BeaconConfig().ZeroHash[:]) + require.NoError(t, err) + altairDigest, err := signing.ComputeForkDigest(params.BeaconConfig().AltairForkVersion, params.BeaconConfig().ZeroHash[:]) + require.NoError(t, err) + bellatrixDigest, err := signing.ComputeForkDigest(params.BeaconConfig().BellatrixForkVersion, params.BeaconConfig().ZeroHash[:]) + require.NoError(t, err) + capellaDigest, err := signing.ComputeForkDigest(params.BeaconConfig().CapellaForkVersion, params.BeaconConfig().ZeroHash[:]) + require.NoError(t, err) + denebDigest, err := signing.ComputeForkDigest(params.BeaconConfig().DenebForkVersion, params.BeaconConfig().ZeroHash[:]) + require.NoError(t, err) + electraDigest, err := signing.ComputeForkDigest(params.BeaconConfig().ElectraForkVersion, params.BeaconConfig().ZeroHash[:]) + require.NoError(t, err) + + type args struct { + digest []byte + chain blockchain.ChainInfoFetcher + } + tests := []struct { + name string + args args + wantBlock interfaces.ReadOnlySignedBeaconBlock + wantMd metadata.Metadata + wantAtt ethpb.Att + wantAggregate ethpb.SignedAggregateAttAndProof + wantErr bool + }{ + { + name: "no digest", + args: args{ + digest: []byte{}, + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: ðpb.BeaconBlock{Body: ðpb.BeaconBlockBody{}}}) + require.NoError(t, err) + return wsb + }(), + wantMd: wrapper.WrappedMetadataV0(ðpb.MetaDataV0{}), + wantAtt: ðpb.Attestation{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProof{}, + wantErr: false, + }, + { + name: "invalid digest", + args: args{ + digest: []byte{0x00, 0x01}, + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: nil, + wantMd: nil, + wantAtt: nil, + wantAggregate: nil, + wantErr: true, + }, + { + name: "non existent digest", + args: args{ + digest: []byte{0x00, 0x01, 0x02, 0x03}, + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: nil, + wantMd: nil, + wantAtt: nil, + wantAggregate: nil, + wantErr: true, + }, + { + name: "genesis fork version", + args: args{ + digest: genDigest[:], + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: ðpb.BeaconBlock{Body: ðpb.BeaconBlockBody{}}}) + require.NoError(t, err) + return wsb + }(), + wantAtt: ðpb.Attestation{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProof{}, + wantErr: false, + }, + { + name: "altair fork version", + args: args{ + digest: altairDigest[:], + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockAltair{Block: ðpb.BeaconBlockAltair{Body: ðpb.BeaconBlockBodyAltair{}}}) + require.NoError(t, err) + return wsb + }(), + wantMd: wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), + wantAtt: ðpb.Attestation{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProof{}, + wantErr: false, + }, + { + name: "bellatrix fork version", + args: args{ + digest: bellatrixDigest[:], + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockBellatrix{Block: ðpb.BeaconBlockBellatrix{Body: ðpb.BeaconBlockBodyBellatrix{ExecutionPayload: &enginev1.ExecutionPayload{}}}}) + require.NoError(t, err) + return wsb + }(), + wantMd: wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), + wantAtt: ðpb.Attestation{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProof{}, + wantErr: false, + }, + { + name: "capella fork version", + args: args{ + digest: capellaDigest[:], + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockCapella{Block: ðpb.BeaconBlockCapella{Body: ðpb.BeaconBlockBodyCapella{ExecutionPayload: &enginev1.ExecutionPayloadCapella{}}}}) + require.NoError(t, err) + return wsb + }(), + wantMd: wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), + wantAtt: ðpb.Attestation{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProof{}, + wantErr: false, + }, + { + name: "deneb fork version", + args: args{ + digest: denebDigest[:], + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{Block: ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{ExecutionPayload: &enginev1.ExecutionPayloadDeneb{}}}}) + require.NoError(t, err) + return wsb + }(), + wantMd: wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), + wantAtt: ðpb.Attestation{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProof{}, + wantErr: false, + }, + { + name: "electra fork version", + args: args{ + digest: electraDigest[:], + chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, + }, + wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: ðpb.BeaconBlockElectra{Body: ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{}}}}) + require.NoError(t, err) + return wsb + }(), + wantMd: wrapper.WrappedMetadataV1(ðpb.MetaDataV1{}), + wantAtt: ðpb.AttestationElectra{}, + wantAggregate: ðpb.SignedAggregateAttestationAndProofElectra{}, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotBlock, err := extractDataTypeFromTypeMap(types.BlockMap, tt.args.digest, tt.args.chain) + if (err != nil) != tt.wantErr { + t.Errorf("block: error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotBlock, tt.wantBlock) { + t.Errorf("block: got = %v, want %v", gotBlock, tt.wantBlock) + } + gotAtt, err := extractDataTypeFromTypeMap(types.AttestationMap, tt.args.digest, tt.args.chain) + if (err != nil) != tt.wantErr { + t.Errorf("attestation: error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotAtt, tt.wantAtt) { + t.Errorf("attestation: got = %v, want %v", gotAtt, tt.wantAtt) + } + gotAggregate, err := extractDataTypeFromTypeMap(types.AggregateAttestationMap, tt.args.digest, tt.args.chain) + if (err != nil) != tt.wantErr { + t.Errorf("aggregate: error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotAggregate, tt.wantAggregate) { + t.Errorf("aggregate: got = %v, want %v", gotAggregate, tt.wantAggregate) + } + }) + } +} diff --git a/beacon-chain/sync/fuzz_exports.go b/beacon-chain/sync/fuzz_exports.go index ca091afe0129..b98ded988a0f 100644 --- a/beacon-chain/sync/fuzz_exports.go +++ b/beacon-chain/sync/fuzz_exports.go @@ -22,7 +22,7 @@ func NewRegularSyncFuzz(opts ...Option) *Service { cancel: cancel, slotToPendingBlocks: gcache.New(time.Second, 2*time.Second), seenPendingBlocks: make(map[[32]byte]bool), - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), } r.rateLimiter = newRateLimiter(r.cfg.p2p) diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index cb936a9330e6..f827d4fd6b11 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/rand" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -87,12 +88,13 @@ func (s *Service) processPendingAtts(ctx context.Context) error { return s.sendBatchRootRequest(ctx, pendingRoots, randGen) } -func (s *Service) processAttestations(ctx context.Context, attestations []*ethpb.SignedAggregateAttestationAndProof) { +func (s *Service) processAttestations(ctx context.Context, attestations []ethpb.SignedAggregateAttAndProof) { for _, signedAtt := range attestations { - att := signedAtt.Message + aggregate := signedAtt.AggregateAttestationAndProof().AggregateVal() + data := aggregate.GetData() // The pending attestations can arrive in both aggregated and unaggregated forms, // each from has distinct validation steps. - if helpers.IsAggregated(att.Aggregate) { + if helpers.IsAggregated(aggregate) { // Save the pending aggregated attestation to the pool if it passes the aggregated // validation steps. valRes, err := s.validateAggregatedAtt(ctx, signedAtt) @@ -101,11 +103,11 @@ func (s *Service) processAttestations(ctx context.Context, attestations []*ethpb } aggValid := pubsub.ValidationAccept == valRes if s.validateBlockInAttestation(ctx, signedAtt) && aggValid { - if err := s.cfg.attPool.SaveAggregatedAttestation(att.Aggregate); err != nil { + if err := s.cfg.attPool.SaveAggregatedAttestation(aggregate); err != nil { log.WithError(err).Debug("Could not save aggregate attestation") continue } - s.setAggregatorIndexEpochSeen(att.Aggregate.Data.Target.Epoch, att.AggregatorIndex) + s.setAggregatorIndexEpochSeen(data.Target.Epoch, signedAtt.AggregateAttestationAndProof().GetAggregatorIndex()) // Broadcasting the signed attestation again once a node is able to process it. if err := s.cfg.p2p.Broadcast(ctx, signedAtt); err != nil { @@ -116,39 +118,39 @@ func (s *Service) processAttestations(ctx context.Context, attestations []*ethpb // This is an important validation before retrieving attestation pre state to defend against // attestation's target intentionally reference checkpoint that's long ago. // Verify current finalized checkpoint is an ancestor of the block defined by the attestation's beacon block root. - if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(att.Aggregate.Data.BeaconBlockRoot)) { + if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) { log.WithError(blockchain.ErrNotDescendantOfFinalized).Debug("Could not verify finalized consistency") continue } - if err := s.cfg.chain.VerifyLmdFfgConsistency(ctx, att.Aggregate); err != nil { + if err := s.cfg.chain.VerifyLmdFfgConsistency(ctx, aggregate); err != nil { log.WithError(err).Debug("Could not verify FFG consistency") continue } - preState, err := s.cfg.chain.AttestationTargetState(ctx, att.Aggregate.Data.Target) + preState, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) if err != nil { log.WithError(err).Debug("Could not retrieve attestation prestate") continue } - valid, err := s.validateUnaggregatedAttWithState(ctx, att.Aggregate, preState) + valid, err := s.validateUnaggregatedAttWithState(ctx, aggregate, preState) if err != nil { log.WithError(err).Debug("Pending unaggregated attestation failed validation") continue } if valid == pubsub.ValidationAccept { - if err := s.cfg.attPool.SaveUnaggregatedAttestation(att.Aggregate); err != nil { + if err := s.cfg.attPool.SaveUnaggregatedAttestation(aggregate); err != nil { log.WithError(err).Debug("Could not save unaggregated attestation") continue } - s.setSeenCommitteeIndicesSlot(att.Aggregate.Data.Slot, att.Aggregate.Data.CommitteeIndex, att.Aggregate.AggregationBits) + s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, aggregate.GetAggregationBits()) - valCount, err := helpers.ActiveValidatorCount(ctx, preState, slots.ToEpoch(att.Aggregate.Data.Slot)) + valCount, err := helpers.ActiveValidatorCount(ctx, preState, slots.ToEpoch(data.Slot)) if err != nil { log.WithError(err).Debug("Could not retrieve active validator count") continue } // Broadcasting the signed attestation again once a node is able to process it. - if err := s.cfg.p2p.BroadcastAttestation(ctx, helpers.ComputeSubnetForAttestation(valCount, signedAtt.Message.Aggregate), signedAtt.Message.Aggregate); err != nil { + if err := s.cfg.p2p.BroadcastAttestation(ctx, helpers.ComputeSubnetForAttestation(valCount, aggregate), aggregate); err != nil { log.WithError(err).Debug("Could not broadcast") } } @@ -160,8 +162,8 @@ func (s *Service) processAttestations(ctx context.Context, attestations []*ethpb // root of the missing block. The value is the list of pending attestations // that voted for that block root. The caller of this function is responsible // for not sending repeated attestations to the pending queue. -func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) { - root := bytesutil.ToBytes32(att.Message.Aggregate.Data.BeaconBlockRoot) +func (s *Service) savePendingAtt(att ethpb.SignedAggregateAttAndProof) { + root := bytesutil.ToBytes32(att.AggregateAttestationAndProof().AggregateVal().GetData().BeaconBlockRoot) s.pendingAttsLock.Lock() defer s.pendingAttsLock.Unlock() @@ -178,7 +180,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) _, ok := s.blkRootToPendingAtts[root] if !ok { pendingAttCount.Inc() - s.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{att} + s.blkRootToPendingAtts[root] = []ethpb.SignedAggregateAttAndProof{att} return } // Skip if the attestation from the same aggregator already exists in @@ -192,20 +194,32 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) s.blkRootToPendingAtts[root] = append(s.blkRootToPendingAtts[root], att) } -func attsAreEqual(a, b *ethpb.SignedAggregateAttestationAndProof) bool { - if a.Signature != nil { - return b.Signature != nil && a.Message.AggregatorIndex == b.Message.AggregatorIndex +func attsAreEqual(a, b ethpb.SignedAggregateAttAndProof) bool { + if a.GetSignature() != nil { + return b.GetSignature() != nil && a.AggregateAttestationAndProof().GetAggregatorIndex() == b.AggregateAttestationAndProof().GetAggregatorIndex() } - if b.Signature != nil { + if b.GetSignature() != nil { return false } - if a.Message.Aggregate.Data.Slot != b.Message.Aggregate.Data.Slot { + + aAggregate := a.AggregateAttestationAndProof().AggregateVal() + bAggregate := b.AggregateAttestationAndProof().AggregateVal() + aData := aAggregate.GetData() + bData := bAggregate.GetData() + + if aData.Slot != bData.Slot { return false } - if a.Message.Aggregate.Data.CommitteeIndex != b.Message.Aggregate.Data.CommitteeIndex { + + if a.Version() >= version.Electra { + if !bytes.Equal(aAggregate.CommitteeBitsVal().Bytes(), bAggregate.CommitteeBitsVal().Bytes()) { + return false + } + } else if aData.CommitteeIndex != bData.CommitteeIndex { return false } - return bytes.Equal(a.Message.Aggregate.AggregationBits, b.Message.Aggregate.AggregationBits) + + return bytes.Equal(aAggregate.GetAggregationBits(), bAggregate.GetAggregationBits()) } // This validates the pending attestations in the queue are still valid. @@ -221,7 +235,7 @@ func (s *Service) validatePendingAtts(ctx context.Context, slot primitives.Slot) for bRoot, atts := range s.blkRootToPendingAtts { for i := len(atts) - 1; i >= 0; i-- { - if slot >= atts[i].Message.Aggregate.Data.Slot+params.BeaconConfig().SlotsPerEpoch { + if slot >= atts[i].AggregateAttestationAndProof().AggregateVal().GetData().Slot+params.BeaconConfig().SlotsPerEpoch { // Remove the pending attestation from the list in place. atts = append(atts[:i], atts[i+1:]...) } diff --git a/beacon-chain/sync/pending_attestations_queue_test.go b/beacon-chain/sync/pending_attestations_queue_test.go index b99e15d5ffec..6a7e7077a116 100644 --- a/beacon-chain/sync/pending_attestations_queue_test.go +++ b/beacon-chain/sync/pending_attestations_queue_test.go @@ -46,12 +46,12 @@ func TestProcessPendingAtts_NoBlockRequestBlock(t *testing.T) { chain := &mock.ChainService{Genesis: prysmTime.Now(), FinalizedCheckPoint: ðpb.Checkpoint{}} r := &Service{ cfg: &config{p2p: p1, beaconDB: db, chain: chain, clock: startup.NewClock(chain.Genesis, chain.ValidatorsRoot)}, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), chainStarted: abool.New(), } a := ðpb.AggregateAttestationAndProof{Aggregate: ðpb.Attestation{Data: ðpb.AttestationData{Target: ðpb.Checkpoint{Root: make([]byte, 32)}}}} - r.blkRootToPendingAtts[[32]byte{'A'}] = []*ethpb.SignedAggregateAttestationAndProof{{Message: a}} + r.blkRootToPendingAtts[[32]byte{'A'}] = []ethpb.SignedAggregateAttAndProof{ðpb.SignedAggregateAttestationAndProof{Message: a}} require.NoError(t, r.processPendingAtts(context.Background())) require.LogsContain(t, hook, "Requesting block by root") } @@ -124,7 +124,7 @@ func TestProcessPendingAtts_HasBlockSaveUnAggregatedAtt(t *testing.T) { clock: startup.NewClock(chain.Genesis, chain.ValidatorsRoot), attPool: attestations.NewPool(), }, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), seenUnAggregatedAttestationCache: lruwrpr.New(10), signatureChan: make(chan *signatureVerifier, verifierLimit), } @@ -134,7 +134,7 @@ func TestProcessPendingAtts_HasBlockSaveUnAggregatedAtt(t *testing.T) { require.NoError(t, err) require.NoError(t, r.cfg.beaconDB.SaveState(context.Background(), s, root)) - r.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{{Message: aggregateAndProof, Signature: aggreSig}} + r.blkRootToPendingAtts[root] = []ethpb.SignedAggregateAttAndProof{ðpb.SignedAggregateAttestationAndProof{Message: aggregateAndProof, Signature: aggreSig}} require.NoError(t, r.processPendingAtts(context.Background())) atts, err := r.cfg.attPool.UnaggregatedAttestations() @@ -162,7 +162,7 @@ func TestProcessPendingAtts_NoBroadcastWithBadSignature(t *testing.T) { clock: startup.NewClock(chain.Genesis, chain.ValidatorsRoot), attPool: attestations.NewPool(), }, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), } priv, err := bls.RandKey() @@ -182,7 +182,7 @@ func TestProcessPendingAtts_NoBroadcastWithBadSignature(t *testing.T) { util.SaveBlock(t, context.Background(), r.cfg.beaconDB, b) require.NoError(t, r.cfg.beaconDB.SaveState(context.Background(), s, r32)) - r.blkRootToPendingAtts[r32] = []*ethpb.SignedAggregateAttestationAndProof{{Message: a, Signature: make([]byte, fieldparams.BLSSignatureLength)}} + r.blkRootToPendingAtts[r32] = []ethpb.SignedAggregateAttAndProof{ðpb.SignedAggregateAttestationAndProof{Message: a, Signature: make([]byte, fieldparams.BLSSignatureLength)}} require.NoError(t, r.processPendingAtts(context.Background())) assert.Equal(t, false, p1.BroadcastCalled.Load(), "Broadcasted bad aggregate") @@ -245,13 +245,13 @@ func TestProcessPendingAtts_NoBroadcastWithBadSignature(t *testing.T) { clock: startup.NewClock(chain2.Genesis, chain2.ValidatorsRoot), attPool: attestations.NewPool(), }, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), seenUnAggregatedAttestationCache: lruwrpr.New(10), signatureChan: make(chan *signatureVerifier, verifierLimit), } go r.verifierRoutine() - r.blkRootToPendingAtts[r32] = []*ethpb.SignedAggregateAttestationAndProof{{Message: aggregateAndProof, Signature: aggreSig}} + r.blkRootToPendingAtts[r32] = []ethpb.SignedAggregateAttAndProof{ðpb.SignedAggregateAttestationAndProof{Message: aggregateAndProof, Signature: aggreSig}} require.NoError(t, r.processPendingAtts(context.Background())) assert.Equal(t, true, p1.BroadcastCalled.Load(), "Could not broadcast the good aggregate") @@ -330,7 +330,7 @@ func TestProcessPendingAtts_HasBlockSaveAggregatedAtt(t *testing.T) { clock: startup.NewClock(chain.Genesis, chain.ValidatorsRoot), attPool: attestations.NewPool(), }, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), seenAggregatedAttestationCache: lruwrpr.New(10), signatureChan: make(chan *signatureVerifier, verifierLimit), } @@ -339,7 +339,7 @@ func TestProcessPendingAtts_HasBlockSaveAggregatedAtt(t *testing.T) { require.NoError(t, err) require.NoError(t, r.cfg.beaconDB.SaveState(context.Background(), s, root)) - r.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{{Message: aggregateAndProof, Signature: aggreSig}} + r.blkRootToPendingAtts[root] = []ethpb.SignedAggregateAttAndProof{ðpb.SignedAggregateAttestationAndProof{Message: aggregateAndProof, Signature: aggreSig}} require.NoError(t, r.processPendingAtts(context.Background())) assert.Equal(t, 1, len(r.cfg.attPool.AggregatedAttestations()), "Did not save aggregated att") @@ -353,7 +353,7 @@ func TestProcessPendingAtts_HasBlockSaveAggregatedAtt(t *testing.T) { func TestValidatePendingAtts_CanPruneOldAtts(t *testing.T) { s := &Service{ - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), } // 100 Attestations per block root. @@ -401,7 +401,7 @@ func TestValidatePendingAtts_CanPruneOldAtts(t *testing.T) { func TestValidatePendingAtts_NoDuplicatingAtts(t *testing.T) { s := &Service{ - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), } r1 := [32]byte{'A'} @@ -428,7 +428,7 @@ func TestValidatePendingAtts_NoDuplicatingAtts(t *testing.T) { func TestSavePendingAtts_BeyondLimit(t *testing.T) { s := &Service{ - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), } for i := 0; i < pendingAttsLimit; i++ { @@ -457,5 +457,71 @@ func TestSavePendingAtts_BeyondLimit(t *testing.T) { assert.Equal(t, 0, len(s.blkRootToPendingAtts[r1]), "Saved pending atts") assert.Equal(t, 0, len(s.blkRootToPendingAtts[r2]), "Saved pending atts") +} +func Test_attsAreEqual_Committee(t *testing.T) { + t.Run("Phase 0 equal", func(t *testing.T) { + att1 := ðpb.SignedAggregateAttestationAndProof{ + Message: ðpb.AggregateAttestationAndProof{ + Aggregate: ðpb.Attestation{ + Data: ðpb.AttestationData{ + CommitteeIndex: 123}}}} + att2 := ðpb.SignedAggregateAttestationAndProof{ + Message: ðpb.AggregateAttestationAndProof{ + Aggregate: ðpb.Attestation{ + Data: ðpb.AttestationData{ + CommitteeIndex: 123}}}} + assert.Equal(t, true, attsAreEqual(att1, att2)) + }) + t.Run("Phase 0 not equal", func(t *testing.T) { + att1 := ðpb.SignedAggregateAttestationAndProof{ + Message: ðpb.AggregateAttestationAndProof{ + Aggregate: ðpb.Attestation{ + Data: ðpb.AttestationData{ + CommitteeIndex: 123}}}} + att2 := ðpb.SignedAggregateAttestationAndProof{ + Message: ðpb.AggregateAttestationAndProof{ + Aggregate: ðpb.Attestation{ + Data: ðpb.AttestationData{ + CommitteeIndex: 456}}}} + assert.Equal(t, false, attsAreEqual(att1, att2)) + }) + t.Run("Electra equal", func(t *testing.T) { + cb1 := primitives.NewAttestationCommitteeBits() + cb1.SetBitAt(0, true) + att1 := ðpb.SignedAggregateAttestationAndProofElectra{ + Message: ðpb.AggregateAttestationAndProofElectra{ + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{}, + CommitteeBits: cb1, + }}} + cb2 := primitives.NewAttestationCommitteeBits() + cb2.SetBitAt(0, true) + att2 := ðpb.SignedAggregateAttestationAndProofElectra{ + Message: ðpb.AggregateAttestationAndProofElectra{ + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{}, + CommitteeBits: cb2, + }}} + assert.Equal(t, true, attsAreEqual(att1, att2)) + }) + t.Run("Electra not equal", func(t *testing.T) { + cb1 := primitives.NewAttestationCommitteeBits() + cb1.SetBitAt(0, true) + att1 := ðpb.SignedAggregateAttestationAndProofElectra{ + Message: ðpb.AggregateAttestationAndProofElectra{ + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{}, + CommitteeBits: cb1, + }}} + cb2 := primitives.NewAttestationCommitteeBits() + cb2.SetBitAt(1, true) + att2 := ðpb.SignedAggregateAttestationAndProofElectra{ + Message: ðpb.AggregateAttestationAndProofElectra{ + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{}, + CommitteeBits: cb2, + }}} + assert.Equal(t, false, attsAreEqual(att1, att2)) + }) } diff --git a/beacon-chain/sync/rpc_chunked_response.go b/beacon-chain/sync/rpc_chunked_response.go index c983709c52da..6eac6fc8ff3d 100644 --- a/beacon-chain/sync/rpc_chunked_response.go +++ b/beacon-chain/sync/rpc_chunked_response.go @@ -4,14 +4,12 @@ import ( libp2pcore "github.com/libp2p/go-libp2p/core" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/network/forks" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -107,7 +105,7 @@ func readFirstChunkedBlock(stream libp2pcore.Stream, tor blockchain.TemporalOrac if err != nil { return nil, err } - blk, err := extractBlockDataType(rpcCtx, tor) + blk, err := extractDataTypeFromTypeMap(types.BlockMap, rpcCtx, tor) if err != nil { return nil, err } @@ -131,7 +129,7 @@ func readResponseChunk(stream libp2pcore.Stream, tor blockchain.TemporalOracle, if err != nil { return nil, err } - blk, err := extractBlockDataType(rpcCtx, tor) + blk, err := extractDataTypeFromTypeMap(types.BlockMap, rpcCtx, tor) if err != nil { return nil, err } @@ -139,30 +137,6 @@ func readResponseChunk(stream libp2pcore.Stream, tor blockchain.TemporalOracle, return blk, err } -func extractBlockDataType(digest []byte, tor blockchain.TemporalOracle) (interfaces.ReadOnlySignedBeaconBlock, error) { - if len(digest) == 0 { - bFunc, ok := types.BlockMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] - if !ok { - return nil, errors.New("no block type exists for the genesis fork version.") - } - return bFunc() - } - if len(digest) != forkDigestLength { - return nil, errors.Errorf("invalid digest returned, wanted a length of %d but received %d", forkDigestLength, len(digest)) - } - vRoot := tor.GenesisValidatorsRoot() - for k, blkFunc := range types.BlockMap { - rDigest, err := signing.ComputeForkDigest(k[:], vRoot[:]) - if err != nil { - return nil, err - } - if rDigest == bytesutil.ToBytes4(digest) { - return blkFunc() - } - } - return nil, errors.Wrapf(ErrNoValidDigest, "could not extract block data type, saw digest=%#x, genesis=%v, vr=%#x", digest, tor.GenesisTime(), tor.GenesisValidatorsRoot()) -} - // WriteBlobSidecarChunk writes blob chunk object to stream. // response_chunk ::= | | | func WriteBlobSidecarChunk(stream libp2pcore.Stream, tor blockchain.TemporalOracle, encoding encoder.NetworkEncoding, sidecar blocks.VerifiedROBlob) error { diff --git a/beacon-chain/sync/rpc_chunked_response_test.go b/beacon-chain/sync/rpc_chunked_response_test.go deleted file mode 100644 index 3f5bb62fc92a..000000000000 --- a/beacon-chain/sync/rpc_chunked_response_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package sync - -import ( - "reflect" - "testing" - - "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" - mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" -) - -func TestExtractBlockDataType(t *testing.T) { - // Precompute digests - genDigest, err := signing.ComputeForkDigest(params.BeaconConfig().GenesisForkVersion, params.BeaconConfig().ZeroHash[:]) - require.NoError(t, err) - altairDigest, err := signing.ComputeForkDigest(params.BeaconConfig().AltairForkVersion, params.BeaconConfig().ZeroHash[:]) - require.NoError(t, err) - bellatrixDigest, err := signing.ComputeForkDigest(params.BeaconConfig().BellatrixForkVersion, params.BeaconConfig().ZeroHash[:]) - require.NoError(t, err) - - type args struct { - digest []byte - chain blockchain.ChainInfoFetcher - } - tests := []struct { - name string - args args - want interfaces.ReadOnlySignedBeaconBlock - wantErr bool - }{ - { - name: "no digest", - args: args{ - digest: []byte{}, - chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, - }, - - want: func() interfaces.ReadOnlySignedBeaconBlock { - wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: ðpb.BeaconBlock{Body: ðpb.BeaconBlockBody{}}}) - require.NoError(t, err) - return wsb - }(), - wantErr: false, - }, - { - name: "invalid digest", - args: args{ - digest: []byte{0x00, 0x01}, - chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, - }, - want: nil, - wantErr: true, - }, - { - name: "non existent digest", - args: args{ - digest: []byte{0x00, 0x01, 0x02, 0x03}, - chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, - }, - want: nil, - wantErr: true, - }, - { - name: "genesis fork version", - args: args{ - digest: genDigest[:], - chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, - }, - want: func() interfaces.ReadOnlySignedBeaconBlock { - wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: ðpb.BeaconBlock{Body: ðpb.BeaconBlockBody{}}}) - require.NoError(t, err) - return wsb - }(), - wantErr: false, - }, - { - name: "altair fork version", - args: args{ - digest: altairDigest[:], - chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, - }, - want: func() interfaces.ReadOnlySignedBeaconBlock { - wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockAltair{Block: ðpb.BeaconBlockAltair{Body: ðpb.BeaconBlockBodyAltair{}}}) - require.NoError(t, err) - return wsb - }(), - wantErr: false, - }, - { - name: "bellatrix fork version", - args: args{ - digest: bellatrixDigest[:], - chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, - }, - want: func() interfaces.ReadOnlySignedBeaconBlock { - wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockBellatrix{Block: ðpb.BeaconBlockBellatrix{Body: ðpb.BeaconBlockBodyBellatrix{ExecutionPayload: &enginev1.ExecutionPayload{}}}}) - require.NoError(t, err) - return wsb - }(), - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got, err := extractBlockDataType(tt.args.digest, tt.args.chain) - if (err != nil) != tt.wantErr { - t.Errorf("extractBlockDataType() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("extractBlockDataType() got = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/beacon-chain/sync/rpc_metadata.go b/beacon-chain/sync/rpc_metadata.go index 9134e74f3096..65fb0003d896 100644 --- a/beacon-chain/sync/rpc_metadata.go +++ b/beacon-chain/sync/rpc_metadata.go @@ -7,13 +7,9 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/wrapper" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/network/forks" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" @@ -112,7 +108,7 @@ func (s *Service) sendMetaDataRequest(ctx context.Context, id peer.ID) (metadata if err != nil { return nil, err } - msg, err := extractMetaDataType(rpcCtx[:], s.cfg.clock) + msg, err := extractDataTypeFromTypeMap(types.MetaDataMap, rpcCtx[:], s.cfg.clock) if err != nil { return nil, err } @@ -133,27 +129,3 @@ func (s *Service) sendMetaDataRequest(ctx context.Context, id peer.ID) (metadata } return msg, nil } - -func extractMetaDataType(digest []byte, tor blockchain.TemporalOracle) (metadata.Metadata, error) { - if len(digest) == 0 { - mdFunc, ok := types.MetaDataMap[bytesutil.ToBytes4(params.BeaconConfig().GenesisForkVersion)] - if !ok { - return nil, errors.New("no metadata type exists for the genesis fork version.") - } - return mdFunc(), nil - } - if len(digest) != forkDigestLength { - return nil, errors.Errorf("invalid digest returned, wanted a length of %d but received %d", forkDigestLength, len(digest)) - } - vRoot := tor.GenesisValidatorsRoot() - for k, mdFunc := range types.MetaDataMap { - rDigest, err := signing.ComputeForkDigest(k[:], vRoot[:]) - if err != nil { - return nil, err - } - if rDigest == bytesutil.ToBytes4(digest) { - return mdFunc(), nil - } - } - return nil, errors.Wrapf(ErrNoValidDigest, "could not extract metadata type, saw digest=%#x, genesis=%v, vr=%#x", digest, tor.GenesisTime(), tor.GenesisValidatorsRoot()) -} diff --git a/beacon-chain/sync/rpc_metadata_test.go b/beacon-chain/sync/rpc_metadata_test.go index 4f38ff329438..23eb74041f0b 100644 --- a/beacon-chain/sync/rpc_metadata_test.go +++ b/beacon-chain/sync/rpc_metadata_test.go @@ -2,16 +2,13 @@ package sync import ( "context" - "reflect" "sync" "testing" "time" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/protocol" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" db "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" p2ptest "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" @@ -21,7 +18,6 @@ import ( leakybucket "github.com/prysmaticlabs/prysm/v5/container/leaky-bucket" "github.com/prysmaticlabs/prysm/v5/encoding/ssz/equality" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -233,80 +229,3 @@ func TestMetadataRPCHandler_SendsMetadataAltair(t *testing.T) { t.Error("Peer is disconnected despite receiving a valid ping") } } - -func TestExtractMetaDataType(t *testing.T) { - // Precompute digests - genDigest, err := signing.ComputeForkDigest(params.BeaconConfig().GenesisForkVersion, params.BeaconConfig().ZeroHash[:]) - require.NoError(t, err) - altairDigest, err := signing.ComputeForkDigest(params.BeaconConfig().AltairForkVersion, params.BeaconConfig().ZeroHash[:]) - require.NoError(t, err) - - type args struct { - digest []byte - clock blockchain.TemporalOracle - } - tests := []struct { - name string - args args - want metadata.Metadata - wantErr bool - }{ - { - name: "no digest", - args: args{ - digest: []byte{}, - clock: startup.NewClock(time.Now(), [32]byte{}), - }, - want: wrapper.WrappedMetadataV0(&pb.MetaDataV0{}), - wantErr: false, - }, - { - name: "invalid digest", - args: args{ - digest: []byte{0x00, 0x01}, - clock: startup.NewClock(time.Now(), [32]byte{}), - }, - want: nil, - wantErr: true, - }, - { - name: "non existent digest", - args: args{ - digest: []byte{0x00, 0x01, 0x02, 0x03}, - clock: startup.NewClock(time.Now(), [32]byte{}), - }, - want: nil, - wantErr: true, - }, - { - name: "genesis fork version", - args: args{ - digest: genDigest[:], - clock: startup.NewClock(time.Now(), [32]byte{}), - }, - want: wrapper.WrappedMetadataV0(&pb.MetaDataV0{}), - wantErr: false, - }, - { - name: "altair fork version", - args: args{ - digest: altairDigest[:], - clock: startup.NewClock(time.Now(), [32]byte{}), - }, - want: wrapper.WrappedMetadataV1(&pb.MetaDataV1{}), - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got, err := extractMetaDataType(tt.args.digest, tt.args.clock) - if (err != nil) != tt.wantErr { - t.Errorf("extractMetaDataType() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("extractMetaDataType() got = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/beacon-chain/sync/service.go b/beacon-chain/sync/service.go index 9736fc9b994e..15196bf6ca74 100644 --- a/beacon-chain/sync/service.go +++ b/beacon-chain/sync/service.go @@ -122,7 +122,7 @@ type Service struct { cancel context.CancelFunc slotToPendingBlocks *gcache.Cache seenPendingBlocks map[[32]byte]bool - blkRootToPendingAtts map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof + blkRootToPendingAtts map[[32]byte][]ethpb.SignedAggregateAttAndProof subHandler *subTopicHandler pendingAttsLock sync.RWMutex pendingQueueLock sync.RWMutex @@ -171,7 +171,7 @@ func NewService(ctx context.Context, opts ...Option) *Service { cfg: &config{clock: startup.NewClock(time.Unix(0, 0), [32]byte{})}, slotToPendingBlocks: c, seenPendingBlocks: make(map[[32]byte]bool), - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), signatureChan: make(chan *signatureVerifier, verifierLimit), } for _, opt := range opts { diff --git a/beacon-chain/sync/subscriber_beacon_aggregate_proof.go b/beacon-chain/sync/subscriber_beacon_aggregate_proof.go index 2df43706166d..06380ec948f2 100644 --- a/beacon-chain/sync/subscriber_beacon_aggregate_proof.go +++ b/beacon-chain/sync/subscriber_beacon_aggregate_proof.go @@ -13,19 +13,21 @@ import ( // beaconAggregateProofSubscriber forwards the incoming validated aggregated attestation and proof to the // attestation pool for processing. func (s *Service) beaconAggregateProofSubscriber(_ context.Context, msg proto.Message) error { - a, ok := msg.(*ethpb.SignedAggregateAttestationAndProof) + a, ok := msg.(ethpb.SignedAggregateAttAndProof) if !ok { - return fmt.Errorf("message was not type *ethpb.SignedAggregateAttestationAndProof, type=%T", msg) + return fmt.Errorf("message was not type ethpb.SignedAggregateAttAndProof, type=%T", msg) } - if a.Message.Aggregate == nil || a.Message.Aggregate.Data == nil { + aggregate := a.AggregateAttestationAndProof().AggregateVal() + + if aggregate == nil || aggregate.GetData() == nil { return errors.New("nil aggregate") } // An unaggregated attestation can make it here. It’s valid, the aggregator it just itself, although it means poor performance for the subnet. - if !helpers.IsAggregated(a.Message.Aggregate) { - return s.cfg.attPool.SaveUnaggregatedAttestation(a.Message.Aggregate) + if !helpers.IsAggregated(aggregate) { + return s.cfg.attPool.SaveUnaggregatedAttestation(aggregate) } - return s.cfg.attPool.SaveAggregatedAttestation(a.Message.Aggregate) + return s.cfg.attPool.SaveAggregatedAttestation(aggregate) } diff --git a/beacon-chain/sync/subscriber_beacon_attestation.go b/beacon-chain/sync/subscriber_beacon_attestation.go index 512467392796..d6d280c38811 100644 --- a/beacon-chain/sync/subscriber_beacon_attestation.go +++ b/beacon-chain/sync/subscriber_beacon_attestation.go @@ -15,19 +15,21 @@ import ( ) func (s *Service) committeeIndexBeaconAttestationSubscriber(_ context.Context, msg proto.Message) error { - a, ok := msg.(*eth.Attestation) + a, ok := msg.(eth.Att) if !ok { - return fmt.Errorf("message was not type *eth.Attestation, type=%T", msg) + return fmt.Errorf("message was not type eth.Att, type=%T", msg) } - if a.Data == nil { + data := a.GetData() + + if data == nil { return errors.New("nil attestation") } - s.setSeenCommitteeIndicesSlot(a.Data.Slot, a.Data.CommitteeIndex, a.AggregationBits) + s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, a.GetAggregationBits()) exists, err := s.cfg.attPool.HasAggregatedAttestation(a) if err != nil { - return errors.Wrap(err, "Could not determine if attestation pool has this atttestation") + return errors.Wrap(err, "could not determine if attestation pool has this attestation") } if exists { return nil @@ -36,11 +38,11 @@ func (s *Service) committeeIndexBeaconAttestationSubscriber(_ context.Context, m return s.cfg.attPool.SaveUnaggregatedAttestation(a) } -func (_ *Service) persistentSubnetIndices() []uint64 { +func (*Service) persistentSubnetIndices() []uint64 { return cache.SubnetIDs.GetAllSubnets() } -func (_ *Service) aggregatorSubnetIndices(currentSlot primitives.Slot) []uint64 { +func (*Service) aggregatorSubnetIndices(currentSlot primitives.Slot) []uint64 { endEpoch := slots.ToEpoch(currentSlot) + 1 endSlot := params.BeaconConfig().SlotsPerEpoch.Mul(uint64(endEpoch)) var commIds []uint64 @@ -50,7 +52,7 @@ func (_ *Service) aggregatorSubnetIndices(currentSlot primitives.Slot) []uint64 return slice.SetUint64(commIds) } -func (_ *Service) attesterSubnetIndices(currentSlot primitives.Slot) []uint64 { +func (*Service) attesterSubnetIndices(currentSlot primitives.Slot) []uint64 { endEpoch := slots.ToEpoch(currentSlot) + 1 endSlot := params.BeaconConfig().SlotsPerEpoch.Mul(uint64(endEpoch)) var commIds []uint64 diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index 893c3670b5cf..8c753b6eb7d8 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -47,38 +48,48 @@ func (s *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms tracing.AnnotateError(span, err) return pubsub.ValidationReject, err } - m, ok := raw.(*ethpb.SignedAggregateAttestationAndProof) + m, ok := raw.(ethpb.SignedAggregateAttAndProof) if !ok { return pubsub.ValidationReject, errors.Errorf("invalid message type: %T", raw) } - if m.Message == nil { + if m.AggregateAttestationAndProof() == nil { return pubsub.ValidationReject, errNilMessage } - if err := helpers.ValidateNilAttestation(m.Message.Aggregate); err != nil { + + aggregate := m.AggregateAttestationAndProof().AggregateVal() + data := aggregate.GetData() + + if err := helpers.ValidateNilAttestation(aggregate); err != nil { return pubsub.ValidationReject, err } // Do not process slot 0 aggregates. - if m.Message.Aggregate.Data.Slot == 0 { + if data.Slot == 0 { return pubsub.ValidationIgnore, nil } // Broadcast the aggregated attestation on a feed to notify other services in the beacon node // of a received aggregated attestation. - s.cfg.attestationNotifier.OperationFeed().Send(&feed.Event{ - Type: operation.AggregatedAttReceived, - Data: &operation.AggregatedAttReceivedData{ - Attestation: m.Message, - }, - }) - - if err := helpers.ValidateSlotTargetEpoch(m.Message.Aggregate.Data); err != nil { + // TODO: this will be extended to Electra in a later PR + if m.Version() == version.Phase0 { + phase0Att, ok := m.(*ethpb.SignedAggregateAttestationAndProof) + if ok { + s.cfg.attestationNotifier.OperationFeed().Send(&feed.Event{ + Type: operation.AggregatedAttReceived, + Data: &operation.AggregatedAttReceivedData{ + Attestation: phase0Att.Message, + }, + }) + } + } + + if err := helpers.ValidateSlotTargetEpoch(data); err != nil { return pubsub.ValidationReject, err } // Attestation's slot is within ATTESTATION_PROPAGATION_SLOT_RANGE and early attestation // processing tolerance. if err := helpers.ValidateAttestationTime( - m.Message.Aggregate.Data.Slot, + data.Slot, s.cfg.clock.GenesisTime(), earlyAttestationProcessingTolerance, ); err != nil { @@ -87,19 +98,19 @@ func (s *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms } // Verify this is the first aggregate received from the aggregator with index and slot. - if s.hasSeenAggregatorIndexEpoch(m.Message.Aggregate.Data.Target.Epoch, m.Message.AggregatorIndex) { + if s.hasSeenAggregatorIndexEpoch(data.Target.Epoch, m.AggregateAttestationAndProof().GetAggregatorIndex()) { return pubsub.ValidationIgnore, nil } // Check that the block being voted on isn't invalid. - if s.hasBadBlock(bytesutil.ToBytes32(m.Message.Aggregate.Data.BeaconBlockRoot)) || - s.hasBadBlock(bytesutil.ToBytes32(m.Message.Aggregate.Data.Target.Root)) || - s.hasBadBlock(bytesutil.ToBytes32(m.Message.Aggregate.Data.Source.Root)) { + if s.hasBadBlock(bytesutil.ToBytes32(data.BeaconBlockRoot)) || + s.hasBadBlock(bytesutil.ToBytes32(data.Target.Root)) || + s.hasBadBlock(bytesutil.ToBytes32(data.Source.Root)) { attBadBlockCount.Inc() return pubsub.ValidationReject, errors.New("bad block referenced in attestation data") } // Verify aggregate attestation has not already been seen via aggregate gossip, within a block, or through the creation locally. - seen, err := s.cfg.attPool.HasAggregatedAttestation(m.Message.Aggregate) + seen, err := s.cfg.attPool.HasAggregatedAttestation(aggregate) if err != nil { tracing.AnnotateError(span, err) return pubsub.ValidationIgnore, err @@ -116,7 +127,7 @@ func (s *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms return validationRes, err } - s.setAggregatorIndexEpochSeen(m.Message.Aggregate.Data.Target.Epoch, m.Message.AggregatorIndex) + s.setAggregatorIndexEpochSeen(data.Target.Epoch, m.AggregateAttestationAndProof().GetAggregatorIndex()) msg.ValidatorData = m @@ -125,44 +136,75 @@ func (s *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms return pubsub.ValidationAccept, nil } -func (s *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.SignedAggregateAttestationAndProof) (pubsub.ValidationResult, error) { +func (s *Service) validateAggregatedAtt(ctx context.Context, signed ethpb.SignedAggregateAttAndProof) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateAggregatedAtt") defer span.End() + aggregateAndProof := signed.AggregateAttestationAndProof() + aggregatorIndex := aggregateAndProof.GetAggregatorIndex() + aggregate := aggregateAndProof.AggregateVal() + data := aggregate.GetData() + // Verify attestation target root is consistent with the head root. // This verification is not in the spec, however we guard against it as it opens us up // to weird edge cases during verification. The attestation technically could be used to add value to a block, // but it's invalid in the spirit of the protocol. Here we choose safety over profit. - if err := s.cfg.chain.VerifyLmdFfgConsistency(ctx, signed.Message.Aggregate); err != nil { + if err := s.cfg.chain.VerifyLmdFfgConsistency(ctx, aggregate); err != nil { tracing.AnnotateError(span, err) attBadLmdConsistencyCount.Inc() return pubsub.ValidationReject, err } // Verify current finalized checkpoint is an ancestor of the block defined by the attestation's beacon block root. - if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(signed.Message.Aggregate.Data.BeaconBlockRoot)) { + if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) { tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized) return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized } - bs, err := s.cfg.chain.AttestationTargetState(ctx, signed.Message.Aggregate.Data.Target) + bs, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) if err != nil { tracing.AnnotateError(span, err) return pubsub.ValidationIgnore, err } // Verify validator index is within the beacon committee. - result, err := s.validateIndexInCommittee(ctx, bs, signed.Message.Aggregate, signed.Message.AggregatorIndex) + result, err := s.validateIndexInCommittee(ctx, bs, aggregate, aggregatorIndex) if result != pubsub.ValidationAccept { - wrappedErr := errors.Wrapf(err, "Could not validate index in committee") + wrappedErr := errors.Wrapf(err, "could not validate index in committee") tracing.AnnotateError(span, wrappedErr) return result, wrappedErr } + var committeeIndex primitives.CommitteeIndex + if signed.Version() >= version.Electra { + a, ok := aggregate.(*ethpb.AttestationElectra) + // This will never fail in practice because we asserted the version + if !ok { + err := fmt.Errorf("aggregate attestation has wrong type (expected %T, got %T)", ðpb.AttestationElectra{}, aggregate) + tracing.AnnotateError(span, err) + return pubsub.ValidationIgnore, err + } + committeeIndex, result, err = validateCommitteeIndexElectra(ctx, a) + if result != pubsub.ValidationAccept { + wrappedErr := errors.Wrapf(err, "could not validate committee index for Electra version") + tracing.AnnotateError(span, wrappedErr) + return result, wrappedErr + } + } else { + committeeIndex = data.CommitteeIndex + } + // Verify selection proof reflects to the right validator. - selectionSigSet, err := validateSelectionIndex(ctx, bs, signed.Message.Aggregate.Data, signed.Message.AggregatorIndex, signed.Message.SelectionProof) + selectionSigSet, err := validateSelectionIndex( + ctx, + bs, + data.Slot, + committeeIndex, + aggregatorIndex, + aggregateAndProof.GetSelectionProof(), + ) if err != nil { - wrappedErr := errors.Wrapf(err, "Could not validate selection for validator %d", signed.Message.AggregatorIndex) + wrappedErr := errors.Wrapf(err, "could not validate selection for validator %d", aggregateAndProof.GetAggregatorIndex()) tracing.AnnotateError(span, wrappedErr) attBadSelectionProofCount.Inc() return pubsub.ValidationReject, wrappedErr @@ -172,13 +214,13 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.Signe // We use batch verify here to save compute. aggregatorSigSet, err := aggSigSet(bs, signed) if err != nil { - wrappedErr := errors.Wrapf(err, "Could not get aggregator sig set %d", signed.Message.AggregatorIndex) + wrappedErr := errors.Wrapf(err, "could not get aggregator sig set %d", aggregatorIndex) tracing.AnnotateError(span, wrappedErr) return pubsub.ValidationIgnore, wrappedErr } - attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []ethpb.Att{signed.Message.Aggregate}) + attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []ethpb.Att{aggregate}) if err != nil { - wrappedErr := errors.Wrapf(err, "Could not verify aggregator signature %d", signed.Message.AggregatorIndex) + wrappedErr := errors.Wrapf(err, "could not verify aggregator signature %d", aggregatorIndex) tracing.AnnotateError(span, wrappedErr) return pubsub.ValidationIgnore, wrappedErr } @@ -188,10 +230,9 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.Signe return s.validateWithBatchVerifier(ctx, "aggregate", set) } -func (s *Service) validateBlockInAttestation(ctx context.Context, satt *ethpb.SignedAggregateAttestationAndProof) bool { - a := satt.Message +func (s *Service) validateBlockInAttestation(ctx context.Context, satt ethpb.SignedAggregateAttAndProof) bool { // Verify the block being voted and the processed state is in beaconDB. The block should have passed validation if it's in the beaconDB. - blockRoot := bytesutil.ToBytes32(a.Aggregate.Data.BeaconBlockRoot) + blockRoot := bytesutil.ToBytes32(satt.AggregateAttestationAndProof().AggregateVal().GetData().BeaconBlockRoot) if !s.hasBlockAndState(ctx, blockRoot) { // A node doesn't have the block, it'll request from peer while saving the pending attestation to a queue. s.savePendingAtt(satt) @@ -234,7 +275,7 @@ func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnl return result, err } - committee, result, err := s.validateBitLength(ctx, a, bs) + committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex, a.GetAggregationBits()) if result != pubsub.ValidationAccept { return result, err } @@ -262,14 +303,15 @@ func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnl func validateSelectionIndex( ctx context.Context, bs state.ReadOnlyBeaconState, - data *ethpb.AttestationData, + slot primitives.Slot, + committeeIndex primitives.CommitteeIndex, validatorIndex primitives.ValidatorIndex, proof []byte, ) (*bls.SignatureBatch, error) { ctx, span := trace.StartSpan(ctx, "sync.validateSelectionIndex") defer span.End() - committee, err := helpers.BeaconCommitteeFromState(ctx, bs, data.Slot, data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, bs, slot, committeeIndex) if err != nil { return nil, err } @@ -278,11 +320,11 @@ func validateSelectionIndex( return nil, err } if !aggregator { - return nil, fmt.Errorf("validator is not an aggregator for slot %d", data.Slot) + return nil, fmt.Errorf("validator is not an aggregator for slot %d", slot) } domain := params.BeaconConfig().DomainSelectionProof - epoch := slots.ToEpoch(data.Slot) + epoch := slots.ToEpoch(slot) v, err := bs.ValidatorAtIndex(validatorIndex) if err != nil { @@ -297,7 +339,7 @@ func validateSelectionIndex( if err != nil { return nil, err } - sszUint := primitives.SSZUint64(data.Slot) + sszUint := primitives.SSZUint64(slot) root, err := signing.ComputeSigningRoot(&sszUint, d) if err != nil { return nil, err @@ -311,8 +353,10 @@ func validateSelectionIndex( } // This returns aggregator signature set which can be used to batch verify. -func aggSigSet(s state.ReadOnlyBeaconState, a *ethpb.SignedAggregateAttestationAndProof) (*bls.SignatureBatch, error) { - v, err := s.ValidatorAtIndex(a.Message.AggregatorIndex) +func aggSigSet(s state.ReadOnlyBeaconState, a ethpb.SignedAggregateAttAndProof) (*bls.SignatureBatch, error) { + aggregateAndProof := a.AggregateAttestationAndProof() + + v, err := s.ValidatorAtIndex(aggregateAndProof.GetAggregatorIndex()) if err != nil { return nil, err } @@ -321,17 +365,17 @@ func aggSigSet(s state.ReadOnlyBeaconState, a *ethpb.SignedAggregateAttestationA return nil, err } - epoch := slots.ToEpoch(a.Message.Aggregate.Data.Slot) + epoch := slots.ToEpoch(aggregateAndProof.AggregateVal().GetData().Slot) d, err := signing.Domain(s.Fork(), epoch, params.BeaconConfig().DomainAggregateAndProof, s.GenesisValidatorsRoot()) if err != nil { return nil, err } - root, err := signing.ComputeSigningRoot(a.Message, d) + root, err := signing.ComputeSigningRoot(aggregateAndProof, d) if err != nil { return nil, err } return &bls.SignatureBatch{ - Signatures: [][]byte{a.Signature}, + Signatures: [][]byte{a.GetSignature()}, PublicKeys: []bls.PublicKey{publicKey}, Messages: [][32]byte{root}, Descriptions: []string{signing.AggregatorSignature}, diff --git a/beacon-chain/sync/validate_aggregate_proof_test.go b/beacon-chain/sync/validate_aggregate_proof_test.go index 1c4da525bf06..a8e5539aed13 100644 --- a/beacon-chain/sync/validate_aggregate_proof_test.go +++ b/beacon-chain/sync/validate_aggregate_proof_test.go @@ -117,7 +117,7 @@ func TestVerifySelection_NotAnAggregator(t *testing.T) { sig := privKeys[0].Sign([]byte{'A'}) data := util.HydrateAttestationData(ðpb.AttestationData{}) - _, err := validateSelectionIndex(ctx, beaconState, data, 0, sig.Marshal()) + _, err := validateSelectionIndex(ctx, beaconState, data.Slot, data.CommitteeIndex, 0, sig.Marshal()) wanted := "validator is not an aggregator for slot" assert.ErrorContains(t, wanted, err) } @@ -149,7 +149,7 @@ func TestValidateAggregateAndProof_NoBlock(t *testing.T) { attPool: attestations.NewPool(), chain: &mock.ChainService{}, }, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), seenAggregatedAttestationCache: c, } r.initCaches() @@ -302,7 +302,7 @@ func TestValidateAggregateAndProof_ExistedInPool(t *testing.T) { attestationNotifier: (&mock.ChainService{}).OperationNotifier(), }, seenAggregatedAttestationCache: lruwrpr.New(10), - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), } r.initCaches() diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index c37abab2191a..f72477031667 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -9,6 +9,7 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" + "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" @@ -22,6 +23,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -55,16 +57,18 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p return pubsub.ValidationReject, err } - att, ok := m.(*eth.Attestation) + att, ok := m.(eth.Att) if !ok { return pubsub.ValidationReject, errWrongMessage } + data := att.GetData() + if err := helpers.ValidateNilAttestation(att); err != nil { return pubsub.ValidationReject, err } // Do not process slot 0 attestations. - if att.Data.Slot == 0 { + if data.Slot == 0 { return pubsub.ValidationIgnore, nil } // Broadcast the unaggregated attestation on a feed to notify other services in the beacon node @@ -78,15 +82,36 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p // Attestation's slot is within ATTESTATION_PROPAGATION_SLOT_RANGE and early attestation // processing tolerance. - if err := helpers.ValidateAttestationTime(att.Data.Slot, s.cfg.clock.GenesisTime(), + if err := helpers.ValidateAttestationTime(data.Slot, s.cfg.clock.GenesisTime(), earlyAttestationProcessingTolerance); err != nil { tracing.AnnotateError(span, err) return pubsub.ValidationIgnore, err } - if err := helpers.ValidateSlotTargetEpoch(att.Data); err != nil { + if err := helpers.ValidateSlotTargetEpoch(data); err != nil { return pubsub.ValidationReject, err } + var validationRes pubsub.ValidationResult + + var committeeIndex primitives.CommitteeIndex + if att.Version() >= version.Electra { + a, ok := att.(*eth.AttestationElectra) + // This will never fail in practice because we asserted the version + if !ok { + err := fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.AttestationElectra{}, att) + tracing.AnnotateError(span, err) + return pubsub.ValidationIgnore, err + } + committeeIndex, validationRes, err = validateCommitteeIndexElectra(ctx, a) + if validationRes != pubsub.ValidationAccept { + wrappedErr := errors.Wrapf(err, "could not validate committee index for Electra version") + tracing.AnnotateError(span, wrappedErr) + return validationRes, wrappedErr + } + } else { + committeeIndex = data.CommitteeIndex + } + if features.Get().EnableSlasher { // Feed the indexed attestation to slasher if enabled. This action // is done in the background to avoid adding more load to this critical code path. @@ -94,13 +119,13 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p // Using a different context to prevent timeouts as this operation can be expensive // and we want to avoid affecting the critical code path. ctx := context.TODO() - preState, err := s.cfg.chain.AttestationTargetState(ctx, att.Data.Target) + preState, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) if err != nil { log.WithError(err).Error("Could not retrieve pre state") tracing.AnnotateError(span, err) return } - committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, preState, data.Slot, committeeIndex) if err != nil { log.WithError(err).Error("Could not get attestation committee") tracing.AnnotateError(span, err) @@ -117,27 +142,41 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p } // Verify this the first attestation received for the participating validator for the slot. - if s.hasSeenCommitteeIndicesSlot(att.Data.Slot, att.Data.CommitteeIndex, att.AggregationBits) { + if s.hasSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) { return pubsub.ValidationIgnore, nil } // Reject an attestation if it references an invalid block. - if s.hasBadBlock(bytesutil.ToBytes32(att.Data.BeaconBlockRoot)) || - s.hasBadBlock(bytesutil.ToBytes32(att.Data.Target.Root)) || - s.hasBadBlock(bytesutil.ToBytes32(att.Data.Source.Root)) { + if s.hasBadBlock(bytesutil.ToBytes32(data.BeaconBlockRoot)) || + s.hasBadBlock(bytesutil.ToBytes32(data.Target.Root)) || + s.hasBadBlock(bytesutil.ToBytes32(data.Source.Root)) { attBadBlockCount.Inc() return pubsub.ValidationReject, errors.New("attestation data references bad block root") } // Verify the block being voted and the processed state is in beaconDB and the block has passed validation if it's in the beaconDB. - blockRoot := bytesutil.ToBytes32(att.Data.BeaconBlockRoot) + blockRoot := bytesutil.ToBytes32(data.BeaconBlockRoot) if !s.hasBlockAndState(ctx, blockRoot) { // A node doesn't have the block, it'll request from peer while saving the pending attestation to a queue. - s.savePendingAtt(ð.SignedAggregateAttestationAndProof{Message: ð.AggregateAttestationAndProof{Aggregate: att}}) + if att.Version() >= version.Electra { + a, ok := att.(*eth.AttestationElectra) + // This will never fail in practice because we asserted the version + if !ok { + return pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.AttestationElectra{}, att) + } + s.savePendingAtt(ð.SignedAggregateAttestationAndProofElectra{Message: ð.AggregateAttestationAndProofElectra{Aggregate: a}}) + } else { + a, ok := att.(*eth.Attestation) + // This will never fail in practice because we asserted the version + if !ok { + return pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + s.savePendingAtt(ð.SignedAggregateAttestationAndProof{Message: ð.AggregateAttestationAndProof{Aggregate: a}}) + } return pubsub.ValidationIgnore, nil } - if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(att.Data.BeaconBlockRoot)) { + if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) { tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized) return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized } @@ -147,13 +186,13 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p return pubsub.ValidationReject, err } - preState, err := s.cfg.chain.AttestationTargetState(ctx, att.Data.Target) + preState, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) if err != nil { tracing.AnnotateError(span, err) return pubsub.ValidationIgnore, err } - validationRes, err := s.validateUnaggregatedAttTopic(ctx, att, preState, *msg.Topic) + validationRes, err = s.validateUnaggregatedAttTopic(ctx, att, preState, *msg.Topic) if validationRes != pubsub.ValidationAccept { return validationRes, err } @@ -163,7 +202,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p return validationRes, err } - s.setSeenCommitteeIndicesSlot(att.Data.Slot, att.Data.CommitteeIndex, att.AggregationBits) + s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) msg.ValidatorData = att @@ -211,7 +250,7 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a eth.At ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttWithState") defer span.End() - committee, result, err := s.validateBitLength(ctx, a, bs) + committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex, a.GetAggregationBits()) if result != pubsub.ValidationAccept { return result, err } @@ -232,14 +271,20 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a eth.At return s.validateWithBatchVerifier(ctx, "attestation", set) } -func (s *Service) validateBitLength(ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { - committee, err := helpers.BeaconCommitteeFromState(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex) +func (s *Service) validateBitLength( + ctx context.Context, + bs state.ReadOnlyBeaconState, + slot primitives.Slot, + committeeIndex primitives.CommitteeIndex, + aggregationBits bitfield.Bitlist, +) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { + committee, err := helpers.BeaconCommitteeFromState(ctx, bs, slot, committeeIndex) if err != nil { return nil, pubsub.ValidationIgnore, err } // Verify number of aggregation bits matches the committee size. - if err := helpers.VerifyBitfieldLength(a.GetAggregationBits(), uint64(len(committee))); err != nil { + if err := helpers.VerifyBitfieldLength(aggregationBits, uint64(len(committee))); err != nil { return nil, pubsub.ValidationReject, err } diff --git a/beacon-chain/sync/validate_beacon_attestation_electra.go b/beacon-chain/sync/validate_beacon_attestation_electra.go new file mode 100644 index 000000000000..3ed3fe9c1899 --- /dev/null +++ b/beacon-chain/sync/validate_beacon_attestation_electra.go @@ -0,0 +1,27 @@ +package sync + +import ( + "context" + "fmt" + + pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "go.opencensus.io/trace" +) + +func validateCommitteeIndexElectra(ctx context.Context, a *ethpb.AttestationElectra) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { + _, span := trace.StartSpan(ctx, "sync.validateCommitteeIndexElectra") + defer span.End() + + ci := a.Data.CommitteeIndex + if ci != 0 { + return 0, pubsub.ValidationReject, fmt.Errorf("committee index must be 0 but was %d", ci) + } + committeeIndices := helpers.CommitteeIndices(a.CommitteeBits) + if len(committeeIndices) != 1 { + return 0, pubsub.ValidationReject, fmt.Errorf("exactly 1 committee index must be set but %d were set", len(committeeIndices)) + } + return committeeIndices[0], pubsub.ValidationAccept, nil +} diff --git a/beacon-chain/sync/validate_beacon_attestation_electra_test.go b/beacon-chain/sync/validate_beacon_attestation_electra_test.go new file mode 100644 index 000000000000..81c8e2e9dff9 --- /dev/null +++ b/beacon-chain/sync/validate_beacon_attestation_electra_test.go @@ -0,0 +1,46 @@ +package sync + +import ( + "context" + "testing" + + pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func Test_validateCommitteeIndexElectra(t *testing.T) { + ctx := context.Background() + + t.Run("valid", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(1, true) + ci, res, err := validateCommitteeIndexElectra(ctx, ðpb.AttestationElectra{Data: ðpb.AttestationData{}, CommitteeBits: cb}) + require.NoError(t, err) + assert.Equal(t, pubsub.ValidationAccept, res) + assert.Equal(t, primitives.CommitteeIndex(1), ci) + }) + t.Run("non-zero data committee index", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(1, true) + _, res, err := validateCommitteeIndexElectra(ctx, ðpb.AttestationElectra{Data: ðpb.AttestationData{CommitteeIndex: 1}, CommitteeBits: cb}) + assert.NotNil(t, err) + assert.Equal(t, pubsub.ValidationReject, res) + }) + t.Run("no committee bits set", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + _, res, err := validateCommitteeIndexElectra(ctx, ðpb.AttestationElectra{Data: ðpb.AttestationData{}, CommitteeBits: cb}) + assert.NotNil(t, err) + assert.Equal(t, pubsub.ValidationReject, res) + }) + t.Run("more than 1 committee bit set", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(1, true) + _, res, err := validateCommitteeIndexElectra(ctx, ðpb.AttestationElectra{Data: ðpb.AttestationData{}, CommitteeBits: cb}) + assert.NotNil(t, err) + assert.Equal(t, pubsub.ValidationReject, res) + }) +} diff --git a/beacon-chain/sync/validate_beacon_attestation_test.go b/beacon-chain/sync/validate_beacon_attestation_test.go index 2db075aa2d28..2451352fb421 100644 --- a/beacon-chain/sync/validate_beacon_attestation_test.go +++ b/beacon-chain/sync/validate_beacon_attestation_test.go @@ -49,7 +49,7 @@ func TestService_validateCommitteeIndexBeaconAttestation(t *testing.T) { clock: startup.NewClock(chain.Genesis, chain.ValidatorsRoot), attestationNotifier: (&mockChain.ChainService{}).OperationNotifier(), }, - blkRootToPendingAtts: make(map[[32]byte][]*ethpb.SignedAggregateAttestationAndProof), + blkRootToPendingAtts: make(map[[32]byte][]ethpb.SignedAggregateAttAndProof), seenUnAggregatedAttestationCache: lruwrpr.New(10), signatureChan: make(chan *signatureVerifier, verifierLimit), } @@ -290,7 +290,7 @@ func TestService_validateCommitteeIndexBeaconAttestation(t *testing.T) { m.Message.Topic = nil } - res, err := s.validateCommitteeIndexBeaconAttestation(ctx, "" /*peerID*/, m) + res, err := s.validateCommitteeIndexBeaconAttestation(ctx, "", m) received := res == pubsub.ValidationAccept if received != tt.want { t.Fatalf("Did not received wanted validation. Got %v, wanted %v", !tt.want, tt.want) From 490ddbf782d2ded8964b67b58153e08e70920765 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 24 Jun 2024 12:20:45 -0500 Subject: [PATCH 146/325] Enable golang.org/x/tools/go/analysis/errorsas static analysis check (#14135) --- BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.bazel b/BUILD.bazel index f3a5ed411f72..cfe2ee4863af 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -224,6 +224,7 @@ nogo( "@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library", "@org_golang_x_tools//go/analysis/passes/defers:go_default_library", "@org_golang_x_tools//go/analysis/passes/directive:go_default_library", + "@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library", # fieldalignment disabled #"@org_golang_x_tools//go/analysis/passes/fieldalignment:go_default_library", "@org_golang_x_tools//go/analysis/passes/findcall:go_default_library", From 9d6a2f5390cb275c3444d254cab7af06078a01ae Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:22:46 -0500 Subject: [PATCH 147/325] Remove electra duplicate helpers (#14138) * removing duplicate helper functions to reduce 6110 size * linting --- beacon-chain/core/electra/consolidations.go | 4 +- beacon-chain/core/electra/upgrade.go | 4 +- beacon-chain/core/electra/validator.go | 11 ++-- beacon-chain/core/electra/validator_test.go | 64 +++++++++++++++++-- beacon-chain/core/helpers/validators.go | 65 -------------------- beacon-chain/core/helpers/validators_test.go | 38 ------------ 6 files changed, 68 insertions(+), 118 deletions(-) diff --git a/beacon-chain/core/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go index 37145c29a519..52030c29e359 100644 --- a/beacon-chain/core/electra/consolidations.go +++ b/beacon-chain/core/electra/consolidations.go @@ -40,7 +40,7 @@ import ( // // state.pending_consolidations = state.pending_consolidations[next_pending_consolidation:] func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) error { - ctx, span := trace.StartSpan(ctx, "electra.ProcessPendingConsolidations") + _, span := trace.StartSpan(ctx, "electra.ProcessPendingConsolidations") defer span.End() if st == nil || st.IsNil() { @@ -68,7 +68,7 @@ func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) err break } - if err := SwitchToCompoundingValidator(ctx, st, pc.TargetIndex); err != nil { + if err := SwitchToCompoundingValidator(st, pc.TargetIndex); err != nil { return err } diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index ef49f55552aa..7560175e7b33 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -295,14 +295,14 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) } for _, index := range preActivationIndices { - if err := helpers.QueueEntireBalanceAndResetValidator(post, index); err != nil { + if err := QueueEntireBalanceAndResetValidator(post, index); err != nil { return nil, errors.Wrap(err, "failed to queue entire balance and reset validator") } } // Ensure early adopters of compounding credentials go through the activation churn for _, index := range compoundWithdrawalIndices { - if err := helpers.QueueExcessActiveBalance(post, index); err != nil { + if err := QueueExcessActiveBalance(post, index); err != nil { return nil, errors.Wrap(err, "failed to queue excess active balance") } } diff --git a/beacon-chain/core/electra/validator.go b/beacon-chain/core/electra/validator.go index dd9cf503daf3..91fb0a87021a 100644 --- a/beacon-chain/core/electra/validator.go +++ b/beacon-chain/core/electra/validator.go @@ -1,7 +1,6 @@ package electra import ( - "context" "errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" @@ -19,7 +18,7 @@ import ( // if has_eth1_withdrawal_credential(validator): // validator.withdrawal_credentials = COMPOUNDING_WITHDRAWAL_PREFIX + validator.withdrawal_credentials[1:] // queue_excess_active_balance(state, index) -func SwitchToCompoundingValidator(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex) error { +func SwitchToCompoundingValidator(s state.BeaconState, idx primitives.ValidatorIndex) error { v, err := s.ValidatorAtIndex(idx) if err != nil { return err @@ -32,12 +31,12 @@ func SwitchToCompoundingValidator(ctx context.Context, s state.BeaconState, idx if err := s.UpdateValidatorAtIndex(idx, v); err != nil { return err } - return queueExcessActiveBalance(ctx, s, idx) + return QueueExcessActiveBalance(s, idx) } return nil } -// queueExcessActiveBalance +// QueueExcessActiveBalance // // Spec definition: // @@ -49,7 +48,7 @@ func SwitchToCompoundingValidator(ctx context.Context, s state.BeaconState, idx // state.pending_balance_deposits.append( // PendingBalanceDeposit(index=index, amount=excess_balance) // ) -func queueExcessActiveBalance(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex) error { +func QueueExcessActiveBalance(s state.BeaconState, idx primitives.ValidatorIndex) error { bal, err := s.BalanceAtIndex(idx) if err != nil { return err @@ -80,7 +79,7 @@ func queueExcessActiveBalance(ctx context.Context, s state.BeaconState, idx prim // ) // //nolint:dupword -func QueueEntireBalanceAndResetValidator(ctx context.Context, s state.BeaconState, idx primitives.ValidatorIndex) error { +func QueueEntireBalanceAndResetValidator(s state.BeaconState, idx primitives.ValidatorIndex) error { bal, err := s.BalanceAtIndex(idx) if err != nil { return err diff --git a/beacon-chain/core/electra/validator_test.go b/beacon-chain/core/electra/validator_test.go index b873d17b5f07..b7d898f66420 100644 --- a/beacon-chain/core/electra/validator_test.go +++ b/beacon-chain/core/electra/validator_test.go @@ -2,7 +2,6 @@ package electra_test import ( "bytes" - "context" "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" @@ -11,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestSwitchToCompoundingValidator(t *testing.T) { @@ -34,10 +34,10 @@ func TestSwitchToCompoundingValidator(t *testing.T) { }) // Test that a validator with no withdrawal credentials cannot be switched to compounding. require.NoError(t, err) - require.ErrorContains(t, "validator has no withdrawal credentials", electra.SwitchToCompoundingValidator(context.TODO(), s, 0)) + require.ErrorContains(t, "validator has no withdrawal credentials", electra.SwitchToCompoundingValidator(s, 0)) // Test that a validator with withdrawal credentials can be switched to compounding. - require.NoError(t, electra.SwitchToCompoundingValidator(context.TODO(), s, 1)) + require.NoError(t, electra.SwitchToCompoundingValidator(s, 1)) v, err := s.ValidatorAtIndex(1) require.NoError(t, err) require.Equal(t, true, bytes.HasPrefix(v.WithdrawalCredentials, []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}), "withdrawal credentials were not updated") @@ -50,7 +50,7 @@ func TestSwitchToCompoundingValidator(t *testing.T) { require.Equal(t, 0, len(pbd), "pending balance deposits should be empty") // Test that a validator with excess balance can be switched to compounding, excess balance is queued. - require.NoError(t, electra.SwitchToCompoundingValidator(context.TODO(), s, 2)) + require.NoError(t, electra.SwitchToCompoundingValidator(s, 2)) b, err = s.BalanceAtIndex(2) require.NoError(t, err) require.Equal(t, params.BeaconConfig().MinActivationBalance, b, "balance was not changed") @@ -74,7 +74,7 @@ func TestQueueEntireBalanceAndResetValidator(t *testing.T) { }, }) require.NoError(t, err) - require.NoError(t, electra.QueueEntireBalanceAndResetValidator(context.TODO(), s, 0)) + require.NoError(t, electra.QueueEntireBalanceAndResetValidator(s, 0)) b, err := s.BalanceAtIndex(0) require.NoError(t, err) require.Equal(t, uint64(0), b, "balance was not changed") @@ -88,3 +88,57 @@ func TestQueueEntireBalanceAndResetValidator(t *testing.T) { require.Equal(t, params.BeaconConfig().MinActivationBalance+100_000, pbd[0].Amount, "pending balance deposit amount is incorrect") require.Equal(t, primitives.ValidatorIndex(0), pbd[0].Index, "pending balance deposit index is incorrect") } + +func TestSwitchToCompoundingValidator_Ok(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) + vals := st.Validators() + vals[0].WithdrawalCredentials = []byte{params.BeaconConfig().ETH1AddressWithdrawalPrefixByte} + require.NoError(t, st.SetValidators(vals)) + bals := st.Balances() + bals[0] = params.BeaconConfig().MinActivationBalance + 1010 + require.NoError(t, st.SetBalances(bals)) + require.NoError(t, electra.SwitchToCompoundingValidator(st, 0)) + + pbd, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, uint64(1010), pbd[0].Amount) // appends it at the end + val, err := st.ValidatorAtIndex(0) + require.NoError(t, err) + + bytes.HasPrefix(val.WithdrawalCredentials, []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}) +} + +func TestQueueExcessActiveBalance_Ok(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) + bals := st.Balances() + bals[0] = params.BeaconConfig().MinActivationBalance + 1000 + require.NoError(t, st.SetBalances(bals)) + + err := electra.QueueExcessActiveBalance(st, 0) + require.NoError(t, err) + + pbd, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, uint64(1000), pbd[0].Amount) // appends it at the end + + bals = st.Balances() + require.Equal(t, params.BeaconConfig().MinActivationBalance, bals[0]) +} + +func TestQueueEntireBalanceAndResetValidator_Ok(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) + // need to manually set this to 0 as after 6110 these balances are now 0 and instead populates pending balance deposits + bals := st.Balances() + bals[0] = params.BeaconConfig().MinActivationBalance - 1000 + require.NoError(t, st.SetBalances(bals)) + err := electra.QueueEntireBalanceAndResetValidator(st, 0) + require.NoError(t, err) + + pbd, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbd)) + require.Equal(t, params.BeaconConfig().MinActivationBalance-1000, pbd[0].Amount) + bal, err := st.BalanceAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(0), bal) +} diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index cf7c3de37da0..a45c69562fe6 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -674,68 +674,3 @@ func ValidatorMaxEffectiveBalance(val *ethpb.Validator) uint64 { } return params.BeaconConfig().MinActivationBalance } - -// QueueExcessActiveBalance queues validators with balances above the min activation balance and adds to pending balance deposit. -// -// Spec definition: -// -// def queue_excess_active_balance(state: BeaconState, index: ValidatorIndex) -> None: -// balance = state.balances[index] -// if balance > MIN_ACTIVATION_BALANCE: -// excess_balance = balance - MIN_ACTIVATION_BALANCE -// state.balances[index] = MIN_ACTIVATION_BALANCE -// state.pending_balance_deposits.append( -// PendingBalanceDeposit(index=index, amount=excess_balance) -// ) -func QueueExcessActiveBalance(s state.BeaconState, idx primitives.ValidatorIndex) error { - bal, err := s.BalanceAtIndex(idx) - if err != nil { - return err - } - - if bal > params.BeaconConfig().MinActivationBalance { - excessBalance := bal - params.BeaconConfig().MinActivationBalance - if err := s.UpdateBalancesAtIndex(idx, params.BeaconConfig().MinActivationBalance); err != nil { - return err - } - return s.AppendPendingBalanceDeposit(idx, excessBalance) - } - return nil -} - -// QueueEntireBalanceAndResetValidator queues the entire balance and resets the validator. This is used in electra fork logic. -// -// Spec definition: -// -// def queue_entire_balance_and_reset_validator(state: BeaconState, index: ValidatorIndex) -> None: -// balance = state.balances[index] -// validator = state.validators[index] -// state.balances[index] = 0 -// validator.effective_balance = 0 -// validator.activation_eligibility_epoch = FAR_FUTURE_EPOCH -// state.pending_balance_deposits.append( -// PendingBalanceDeposit(index=index, amount=balance) -// ) -func QueueEntireBalanceAndResetValidator(s state.BeaconState, idx primitives.ValidatorIndex) error { - bal, err := s.BalanceAtIndex(idx) - if err != nil { - return err - } - - if err := s.UpdateBalancesAtIndex(idx, 0); err != nil { - return err - } - - v, err := s.ValidatorAtIndex(idx) - if err != nil { - return err - } - - v.EffectiveBalance = 0 - v.ActivationEligibilityEpoch = params.BeaconConfig().FarFutureEpoch - if err := s.UpdateValidatorAtIndex(idx, v); err != nil { - return err - } - - return s.AppendPendingBalanceDeposit(idx, bal) -} diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index 43e0416eca58..efa21c75cb63 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -18,7 +18,6 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestIsActiveValidator_OK(t *testing.T) { @@ -1120,40 +1119,3 @@ func TestValidatorMaxEffectiveBalance(t *testing.T) { // Sanity check that MinActivationBalance equals (pre-electra) MaxEffectiveBalance assert.Equal(t, params.BeaconConfig().MinActivationBalance, params.BeaconConfig().MaxEffectiveBalance) } - -func TestQueueExcessActiveBalance_Ok(t *testing.T) { - st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) - bals := st.Balances() - bals[0] = params.BeaconConfig().MinActivationBalance + 1000 - require.NoError(t, st.SetBalances(bals)) - - err := helpers.QueueExcessActiveBalance(st, 0) - require.NoError(t, err) - - pbd, err := st.PendingBalanceDeposits() - require.NoError(t, err) - require.Equal(t, uint64(1000), pbd[0].Amount) - - bals = st.Balances() - require.Equal(t, params.BeaconConfig().MinActivationBalance, bals[0]) -} - -func TestQueueEntireBalanceAndResetValidator_Ok(t *testing.T) { - st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) - val, err := st.ValidatorAtIndex(0) - require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, val.EffectiveBalance) - pbd, err := st.PendingBalanceDeposits() - require.NoError(t, err) - require.Equal(t, 0, len(pbd)) - err = helpers.QueueEntireBalanceAndResetValidator(st, 0) - require.NoError(t, err) - - pbd, err = st.PendingBalanceDeposits() - require.NoError(t, err) - require.Equal(t, 1, len(pbd)) - - val, err = st.ValidatorAtIndex(0) - require.NoError(t, err) - require.Equal(t, uint64(0), val.EffectiveBalance) -} From 5f0d6074d68986d1301127ff6a563a1bbd45b6c8 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Tue, 25 Jun 2024 06:13:42 -0700 Subject: [PATCH 148/325] Prysmctl ui bug (#14140) * Fix ui bug * Better logging --- validator/accounts/accounts_helper.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/validator/accounts/accounts_helper.go b/validator/accounts/accounts_helper.go index 1ba725badca4..b2624c9eae3a 100644 --- a/validator/accounts/accounts_helper.go +++ b/validator/accounts/accounts_helper.go @@ -43,13 +43,14 @@ func selectAccounts(selectionPrompt string, pubKeys [][fieldparams.BLSPubkeyLeng results := make([]int, 0) au := aurora.NewAurora(true) if len(pubKeyStrings) > 5 { - log.Warnf("there are more than %d potential public keys to exit, please consider using the --%s or --%s flags", 5, flags.VoluntaryExitPublicKeysFlag.Name, flags.ExitAllFlag.Name) + log.Warnf("There are more than %d potential public keys to exit, please consider using the --%s or --%s flags", 5, flags.VoluntaryExitPublicKeysFlag.Name, flags.ExitAllFlag.Name) } + log.Infof("Found a total of %d keys", len(pubKeyStrings)) for result != exit { p := promptui.Select{ Label: selectionPrompt, HideSelected: true, - Size: len(pubKeyStrings), + Size: 10, // Display 10 items at a time. Items: append([]string{exit, allAccountsText}, pubKeyStrings...), Templates: templates, } From b8aad842857c21628459d8d910726a0353c72060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 25 Jun 2024 15:18:07 +0200 Subject: [PATCH 149/325] EIP-7549: attestation pool (#14121) * implementation * test fixes * Electra tests * remove aggregator tests * id comments and tests * make Id equal to [33]byte --- .../operations/attestations/BUILD.bazel | 3 +- .../operations/attestations/kv/BUILD.bazel | 6 +- .../operations/attestations/kv/aggregated.go | 112 ++++++++++++------ .../attestations/kv/aggregated_test.go | 59 +++++++-- .../operations/attestations/kv/block.go | 17 +-- .../operations/attestations/kv/forkchoice.go | 15 ++- beacon-chain/operations/attestations/kv/kv.go | 20 ++-- .../operations/attestations/kv/seen_bits.go | 23 ++-- .../attestations/kv/seen_bits_test.go | 7 +- .../attestations/kv/unaggregated.go | 60 ++++++++-- .../attestations/kv/unaggregated_test.go | 41 +++++-- beacon-chain/operations/attestations/pool.go | 6 +- .../attestations/prepare_forkchoice.go | 22 ++-- .../operations/attestations/service.go | 24 ++-- .../prysm/v1alpha1/validator/aggregator.go | 7 +- proto/prysm/v1alpha1/attestation/BUILD.bazel | 12 +- .../aggregation/attestations/BUILD.bazel | 1 + .../aggregation/attestations/maxcover.go | 21 +++- proto/prysm/v1alpha1/attestation/id.go | 71 +++++++++++ proto/prysm/v1alpha1/attestation/id_test.go | 63 ++++++++++ 20 files changed, 452 insertions(+), 138 deletions(-) create mode 100644 proto/prysm/v1alpha1/attestation/id.go create mode 100644 proto/prysm/v1alpha1/attestation/id_test.go diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index 5b4cc57b38d4..c1c42dd9d347 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -21,12 +21,13 @@ go_library( "//config/features:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", - "//crypto/hash:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", "@com_github_hashicorp_golang_lru//:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/BUILD.bazel b/beacon-chain/operations/attestations/kv/BUILD.bazel index 807bc292003f..b79625e8427e 100644 --- a/beacon-chain/operations/attestations/kv/BUILD.bazel +++ b/beacon-chain/operations/attestations/kv/BUILD.bazel @@ -16,9 +16,10 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", - "//crypto/hash:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", + "//runtime/version:go_default_library", "@com_github_patrickmn_go_cache//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", @@ -39,14 +40,15 @@ go_test( embed = [":go_default_library"], deps = [ "//config/fieldparams:go_default_library", + "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//proto/prysm/v1alpha1/attestation:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_patrickmn_go_cache//:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index b0571cb6ab68..24a19e41d888 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -9,7 +9,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" + "github.com/prysmaticlabs/prysm/v5/runtime/version" log "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -32,28 +34,28 @@ func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedA _, span := trace.StartSpan(ctx, "operations.attestations.kv.aggregateUnaggregatedAtts") defer span.End() - attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(unaggregatedAtts)) + attsByVerAndDataRoot := make(map[attestation.Id][]ethpb.Att, len(unaggregatedAtts)) for _, att := range unaggregatedAtts { - attDataRoot, err := att.GetData().HashTreeRoot() + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return err + return errors.Wrap(err, "could not create attestation ID") } - attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) + attsByVerAndDataRoot[id] = append(attsByVerAndDataRoot[id], att) } // Aggregate unaggregated attestations from the pool and save them in the pool. // Track the unaggregated attestations that aren't able to aggregate. - leftOverUnaggregatedAtt := make(map[[32]byte]bool) + leftOverUnaggregatedAtt := make(map[attestation.Id]bool) - leftOverUnaggregatedAtt = c.aggregateParallel(attsByDataRoot, leftOverUnaggregatedAtt) + leftOverUnaggregatedAtt = c.aggregateParallel(attsByVerAndDataRoot, leftOverUnaggregatedAtt) // Remove the unaggregated attestations from the pool that were successfully aggregated. for _, att := range unaggregatedAtts { - h, err := hashFn(att) + id, err := attestation.NewId(att, attestation.Full) if err != nil { - return err + return errors.Wrap(err, "could not create attestation ID") } - if leftOverUnaggregatedAtt[h] { + if leftOverUnaggregatedAtt[id] { continue } if err := c.DeleteUnaggregatedAttestation(att); err != nil { @@ -66,7 +68,7 @@ func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedA // aggregateParallel aggregates attestations in parallel for `atts` and saves them in the pool, // returns the unaggregated attestations that weren't able to aggregate. // Given `n` CPU cores, it creates a channel of size `n` and spawns `n` goroutines to aggregate attestations -func (c *AttCaches) aggregateParallel(atts map[[32]byte][]ethpb.Att, leftOver map[[32]byte]bool) map[[32]byte]bool { +func (c *AttCaches) aggregateParallel(atts map[attestation.Id][]ethpb.Att, leftOver map[attestation.Id]bool) map[attestation.Id]bool { var leftoverLock sync.Mutex wg := sync.WaitGroup{} @@ -92,13 +94,13 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]ethpb.Att, leftOver ma continue } } else { - h, err := hashFn(aggregated) + id, err := attestation.NewId(aggregated, attestation.Full) if err != nil { - log.WithError(err).Error("could not hash attestation") + log.WithError(err).Error("Could not create attestation ID") continue } leftoverLock.Lock() - leftOver[h] = true + leftOver[id] = true leftoverLock.Unlock() } } @@ -139,17 +141,18 @@ func (c *AttCaches) SaveAggregatedAttestation(att ethpb.Att) error { return nil } - r, err := hashFn(att.GetData()) + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } copiedAtt := att.Copy() + c.aggregatedAttLock.Lock() defer c.aggregatedAttLock.Unlock() - atts, ok := c.aggregatedAtt[r] + atts, ok := c.aggregatedAtt[id] if !ok { atts := []ethpb.Att{copiedAtt} - c.aggregatedAtt[r] = atts + c.aggregatedAtt[id] = atts return nil } @@ -157,7 +160,7 @@ func (c *AttCaches) SaveAggregatedAttestation(att ethpb.Att) error { if err != nil { return err } - c.aggregatedAtt[r] = atts + c.aggregatedAtt[id] = atts return nil } @@ -191,17 +194,56 @@ func (c *AttCaches) AggregatedAttestations() []ethpb.Att { // AggregatedAttestationsBySlotIndex returns the aggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att { +func (c *AttCaches) AggregatedAttestationsBySlotIndex( + ctx context.Context, + slot primitives.Slot, + committeeIndex primitives.CommitteeIndex, +) []*ethpb.Attestation { _, span := trace.StartSpan(ctx, "operations.attestations.kv.AggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]ethpb.Att, 0) + atts := make([]*ethpb.Attestation, 0) c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() - for _, a := range c.aggregatedAtt { - if slot == a[0].GetData().Slot && committeeIndex == a[0].GetData().CommitteeIndex { - atts = append(atts, a...) + for _, as := range c.aggregatedAtt { + if as[0].Version() == version.Phase0 && slot == as[0].GetData().Slot && committeeIndex == as[0].GetData().CommitteeIndex { + for _, a := range as { + att, ok := a.(*ethpb.Attestation) + // This will never fail in practice because we asserted the version + if ok { + atts = append(atts, att) + } + } + } + } + + return atts +} + +// AggregatedAttestationsBySlotIndexElectra returns the aggregated attestations in cache, +// filtered by committee index and slot. +func (c *AttCaches) AggregatedAttestationsBySlotIndexElectra( + ctx context.Context, + slot primitives.Slot, + committeeIndex primitives.CommitteeIndex, +) []*ethpb.AttestationElectra { + _, span := trace.StartSpan(ctx, "operations.attestations.kv.AggregatedAttestationsBySlotIndexElectra") + defer span.End() + + atts := make([]*ethpb.AttestationElectra, 0) + + c.aggregatedAttLock.RLock() + defer c.aggregatedAttLock.RUnlock() + for _, as := range c.aggregatedAtt { + if as[0].Version() == version.Electra && slot == as[0].GetData().Slot && as[0].CommitteeBitsVal().BitAt(uint64(committeeIndex)) { + for _, a := range as { + att, ok := a.(*ethpb.AttestationElectra) + // This will never fail in practice because we asserted the version + if ok { + atts = append(atts, att) + } + } } } @@ -216,18 +258,19 @@ func (c *AttCaches) DeleteAggregatedAttestation(att ethpb.Att) error { if !helpers.IsAggregated(att) { return errors.New("attestation is not aggregated") } - r, err := hashFn(att.GetData()) - if err != nil { - return errors.Wrap(err, "could not tree hash attestation data") - } if err := c.insertSeenBit(att); err != nil { return err } + id, err := attestation.NewId(att, attestation.Data) + if err != nil { + return errors.Wrap(err, "could not create attestation ID") + } + c.aggregatedAttLock.Lock() defer c.aggregatedAttLock.Unlock() - attList, ok := c.aggregatedAtt[r] + attList, ok := c.aggregatedAtt[id] if !ok { return nil } @@ -241,9 +284,9 @@ func (c *AttCaches) DeleteAggregatedAttestation(att ethpb.Att) error { } } if len(filtered) == 0 { - delete(c.aggregatedAtt, r) + delete(c.aggregatedAtt, id) } else { - c.aggregatedAtt[r] = filtered + c.aggregatedAtt[id] = filtered } return nil @@ -254,14 +297,15 @@ func (c *AttCaches) HasAggregatedAttestation(att ethpb.Att) (bool, error) { if err := helpers.ValidateNilAttestation(att); err != nil { return false, err } - r, err := hashFn(att.GetData()) + + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return false, errors.Wrap(err, "could not tree hash attestation") + return false, errors.Wrap(err, "could not create attestation ID") } c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() - if atts, ok := c.aggregatedAtt[r]; ok { + if atts, ok := c.aggregatedAtt[id]; ok { for _, a := range atts { if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return false, err @@ -273,7 +317,7 @@ func (c *AttCaches) HasAggregatedAttestation(att ethpb.Att) (bool, error) { c.blockAttLock.RLock() defer c.blockAttLock.RUnlock() - if atts, ok := c.blockAtt[r]; ok { + if atts, ok := c.blockAtt[id]; ok { for _, a := range atts { if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return false, err diff --git a/beacon-chain/operations/attestations/kv/aggregated_test.go b/beacon-chain/operations/attestations/kv/aggregated_test.go index 5f2ddd40a1da..adddfb07a434 100644 --- a/beacon-chain/operations/attestations/kv/aggregated_test.go +++ b/beacon-chain/operations/attestations/kv/aggregated_test.go @@ -7,10 +7,11 @@ import ( c "github.com/patrickmn/go-cache" "github.com/pkg/errors" - fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -69,7 +70,7 @@ func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { }), AggregationBits: bitfield.Bitlist{0b10111}, }, - wantErrString: "could not tree hash attestation: --.BeaconBlockRoot (" + fssz.ErrBytesLength.Error() + ")", + wantErrString: "could not create attestation ID", }, { name: "already seen", @@ -92,15 +93,13 @@ func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { count: 1, }, } - r, err := hashFn(util.HydrateAttestationData(ðpb.AttestationData{ - Slot: 100, - })) + id, err := attestation.NewId(util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 100}}), attestation.Data) require.NoError(t, err) for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cache := NewAttCaches() - cache.seenAtt.Set(string(r[:]), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration) + cache.seenAtt.Set(id.String(), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration) assert.Equal(t, 0, len(cache.unAggregatedAtt), "Invalid start pool, atts: %d", len(cache.unAggregatedAtt)) err := cache.SaveAggregatedAttestation(tt.att) @@ -230,7 +229,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { }, } err := cache.DeleteAggregatedAttestation(att) - wantErr := "could not tree hash attestation data: --.BeaconBlockRoot (" + fssz.ErrBytesLength.Error() + ")" + wantErr := "could not create attestation ID" assert.ErrorContains(t, wantErr, err) }) @@ -500,3 +499,49 @@ func TestKV_Aggregated_DuplicateAggregatedAttestations(t *testing.T) { assert.DeepSSZEqual(t, att2, returned[0], "Did not receive correct aggregated atts") assert.Equal(t, 1, len(returned), "Did not receive correct aggregated atts") } + +func TestKV_Aggregated_AggregatedAttestationsBySlotIndex(t *testing.T) { + cache := NewAttCaches() + + att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1, CommitteeIndex: 1}, AggregationBits: bitfield.Bitlist{0b1011}}) + att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1, CommitteeIndex: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) + att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) + atts := []*ethpb.Attestation{att1, att2, att3} + + for _, att := range atts { + require.NoError(t, cache.SaveAggregatedAttestation(att)) + } + ctx := context.Background() + returned := cache.AggregatedAttestationsBySlotIndex(ctx, 1, 1) + assert.DeepEqual(t, []*ethpb.Attestation{att1}, returned) + returned = cache.AggregatedAttestationsBySlotIndex(ctx, 1, 2) + assert.DeepEqual(t, []*ethpb.Attestation{att2}, returned) + returned = cache.AggregatedAttestationsBySlotIndex(ctx, 2, 1) + assert.DeepEqual(t, []*ethpb.Attestation{att3}, returned) +} + +func TestKV_Aggregated_AggregatedAttestationsBySlotIndexElectra(t *testing.T) { + cache := NewAttCaches() + + committeeBits := primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(1, true) + att1 := util.HydrateAttestationElectra(ðpb.AttestationElectra{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1011}, CommitteeBits: committeeBits}) + committeeBits = primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(2, true) + att2 := util.HydrateAttestationElectra(ðpb.AttestationElectra{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}, CommitteeBits: committeeBits}) + committeeBits = primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(1, true) + att3 := util.HydrateAttestationElectra(ðpb.AttestationElectra{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}, CommitteeBits: committeeBits}) + atts := []*ethpb.AttestationElectra{att1, att2, att3} + + for _, att := range atts { + require.NoError(t, cache.SaveAggregatedAttestation(att)) + } + ctx := context.Background() + returned := cache.AggregatedAttestationsBySlotIndexElectra(ctx, 1, 1) + assert.DeepEqual(t, []*ethpb.AttestationElectra{att1}, returned) + returned = cache.AggregatedAttestationsBySlotIndexElectra(ctx, 1, 2) + assert.DeepEqual(t, []*ethpb.AttestationElectra{att2}, returned) + returned = cache.AggregatedAttestationsBySlotIndexElectra(ctx, 2, 1) + assert.DeepEqual(t, []*ethpb.AttestationElectra{att3}, returned) +} diff --git a/beacon-chain/operations/attestations/kv/block.go b/beacon-chain/operations/attestations/kv/block.go index 49cc90b27990..08d6f7ed90df 100644 --- a/beacon-chain/operations/attestations/kv/block.go +++ b/beacon-chain/operations/attestations/kv/block.go @@ -3,6 +3,7 @@ package kv import ( "github.com/pkg/errors" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" ) // SaveBlockAttestation saves an block attestation in cache. @@ -10,14 +11,15 @@ func (c *AttCaches) SaveBlockAttestation(att ethpb.Att) error { if att == nil { return nil } - r, err := hashFn(att.GetData()) + + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } c.blockAttLock.Lock() defer c.blockAttLock.Unlock() - atts, ok := c.blockAtt[r] + atts, ok := c.blockAtt[id] if !ok { atts = make([]ethpb.Att, 0, 1) } @@ -31,7 +33,7 @@ func (c *AttCaches) SaveBlockAttestation(att ethpb.Att) error { } } - c.blockAtt[r] = append(atts, att.Copy()) + c.blockAtt[id] = append(atts, att.Copy()) return nil } @@ -54,14 +56,15 @@ func (c *AttCaches) DeleteBlockAttestation(att ethpb.Att) error { if att == nil { return nil } - r, err := hashFn(att.GetData()) + + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } c.blockAttLock.Lock() defer c.blockAttLock.Unlock() - delete(c.blockAtt, r) + delete(c.blockAtt, id) return nil } diff --git a/beacon-chain/operations/attestations/kv/forkchoice.go b/beacon-chain/operations/attestations/kv/forkchoice.go index 3e79e8d23ed4..609d55f64c50 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice.go +++ b/beacon-chain/operations/attestations/kv/forkchoice.go @@ -3,6 +3,7 @@ package kv import ( "github.com/pkg/errors" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" ) // SaveForkchoiceAttestation saves an forkchoice attestation in cache. @@ -10,14 +11,15 @@ func (c *AttCaches) SaveForkchoiceAttestation(att ethpb.Att) error { if att == nil { return nil } - r, err := hashFn(att) + + id, err := attestation.NewId(att, attestation.Full) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } c.forkchoiceAttLock.Lock() defer c.forkchoiceAttLock.Unlock() - c.forkchoiceAtt[r] = att.Copy() + c.forkchoiceAtt[id] = att return nil } @@ -51,14 +53,15 @@ func (c *AttCaches) DeleteForkchoiceAttestation(att ethpb.Att) error { if att == nil { return nil } - r, err := hashFn(att) + + id, err := attestation.NewId(att, attestation.Full) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } c.forkchoiceAttLock.Lock() defer c.forkchoiceAttLock.Unlock() - delete(c.forkchoiceAtt, r) + delete(c.forkchoiceAtt, id) return nil } diff --git a/beacon-chain/operations/attestations/kv/kv.go b/beacon-chain/operations/attestations/kv/kv.go index d0d1dc9ef85d..c8b51a57781d 100644 --- a/beacon-chain/operations/attestations/kv/kv.go +++ b/beacon-chain/operations/attestations/kv/kv.go @@ -9,24 +9,22 @@ import ( "github.com/patrickmn/go-cache" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" ) -var hashFn = hash.Proto - // AttCaches defines the caches used to satisfy attestation pool interface. // These caches are KV store for various attestations // such are unaggregated, aggregated or attestations within a block. type AttCaches struct { aggregatedAttLock sync.RWMutex - aggregatedAtt map[[32]byte][]ethpb.Att + aggregatedAtt map[attestation.Id][]ethpb.Att unAggregateAttLock sync.RWMutex - unAggregatedAtt map[[32]byte]ethpb.Att + unAggregatedAtt map[attestation.Id]ethpb.Att forkchoiceAttLock sync.RWMutex - forkchoiceAtt map[[32]byte]ethpb.Att + forkchoiceAtt map[attestation.Id]ethpb.Att blockAttLock sync.RWMutex - blockAtt map[[32]byte][]ethpb.Att + blockAtt map[attestation.Id][]ethpb.Att seenAtt *cache.Cache } @@ -36,10 +34,10 @@ func NewAttCaches() *AttCaches { secsInEpoch := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) c := cache.New(secsInEpoch*time.Second, 2*secsInEpoch*time.Second) pool := &AttCaches{ - unAggregatedAtt: make(map[[32]byte]ethpb.Att), - aggregatedAtt: make(map[[32]byte][]ethpb.Att), - forkchoiceAtt: make(map[[32]byte]ethpb.Att), - blockAtt: make(map[[32]byte][]ethpb.Att), + unAggregatedAtt: make(map[attestation.Id]ethpb.Att), + aggregatedAtt: make(map[attestation.Id][]ethpb.Att), + forkchoiceAtt: make(map[attestation.Id]ethpb.Att), + blockAtt: make(map[attestation.Id][]ethpb.Att), seenAtt: c, } diff --git a/beacon-chain/operations/attestations/kv/seen_bits.go b/beacon-chain/operations/attestations/kv/seen_bits.go index 03c565910470..7cdc958bd47f 100644 --- a/beacon-chain/operations/attestations/kv/seen_bits.go +++ b/beacon-chain/operations/attestations/kv/seen_bits.go @@ -1,21 +1,20 @@ package kv import ( - "fmt" - "github.com/patrickmn/go-cache" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" ) func (c *AttCaches) insertSeenBit(att ethpb.Att) error { - r, err := hashFn(att.GetData()) + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return err + return errors.Wrap(err, "could not create attestation ID") } - v, ok := c.seenAtt.Get(string(r[:])) + v, ok := c.seenAtt.Get(id.String()) if ok { seenBits, ok := v.([]bitfield.Bitlist) if !ok { @@ -24,7 +23,7 @@ func (c *AttCaches) insertSeenBit(att ethpb.Att) error { alreadyExists := false for _, bit := range seenBits { if c, err := bit.Contains(att.GetAggregationBits()); err != nil { - return fmt.Errorf("failed to check seen bits on attestation when inserting bit: %w", err) + return err } else if c { alreadyExists = true break @@ -33,21 +32,21 @@ func (c *AttCaches) insertSeenBit(att ethpb.Att) error { if !alreadyExists { seenBits = append(seenBits, att.GetAggregationBits()) } - c.seenAtt.Set(string(r[:]), seenBits, cache.DefaultExpiration /* one epoch */) + c.seenAtt.Set(id.String(), seenBits, cache.DefaultExpiration /* one epoch */) return nil } - c.seenAtt.Set(string(r[:]), []bitfield.Bitlist{att.GetAggregationBits()}, cache.DefaultExpiration /* one epoch */) + c.seenAtt.Set(id.String(), []bitfield.Bitlist{att.GetAggregationBits()}, cache.DefaultExpiration /* one epoch */) return nil } func (c *AttCaches) hasSeenBit(att ethpb.Att) (bool, error) { - r, err := hashFn(att.GetData()) + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return false, err + return false, errors.Wrap(err, "could not create attestation ID") } - v, ok := c.seenAtt.Get(string(r[:])) + v, ok := c.seenAtt.Get(id.String()) if ok { seenBits, ok := v.([]bitfield.Bitlist) if !ok { @@ -55,7 +54,7 @@ func (c *AttCaches) hasSeenBit(att ethpb.Att) (bool, error) { } for _, bit := range seenBits { if c, err := bit.Contains(att.GetAggregationBits()); err != nil { - return false, fmt.Errorf("failed to check seen bits on attestation when reading bit: %w", err) + return false, err } else if c { return true, nil } diff --git a/beacon-chain/operations/attestations/kv/seen_bits_test.go b/beacon-chain/operations/attestations/kv/seen_bits_test.go index 4ebe18204ade..61a6c66d3ab3 100644 --- a/beacon-chain/operations/attestations/kv/seen_bits_test.go +++ b/beacon-chain/operations/attestations/kv/seen_bits_test.go @@ -5,6 +5,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) @@ -39,18 +40,18 @@ func TestAttCaches_hasSeenBit(t *testing.T) { func TestAttCaches_insertSeenBitDuplicates(t *testing.T) { c := NewAttCaches() att1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b10000011}}) - r, err := hashFn(att1.Data) + id, err := attestation.NewId(att1, attestation.Data) require.NoError(t, err) require.NoError(t, c.insertSeenBit(att1)) require.Equal(t, 1, c.seenAtt.ItemCount()) - _, expirationTime1, ok := c.seenAtt.GetWithExpiration(string(r[:])) + _, expirationTime1, ok := c.seenAtt.GetWithExpiration(id.String()) require.Equal(t, true, ok) // Make sure that duplicates are not inserted, but expiration time gets updated. require.NoError(t, c.insertSeenBit(att1)) require.Equal(t, 1, c.seenAtt.ItemCount()) - _, expirationprysmTime, ok := c.seenAtt.GetWithExpiration(string(r[:])) + _, expirationprysmTime, ok := c.seenAtt.GetWithExpiration(id.String()) require.Equal(t, true, ok) require.Equal(t, true, expirationprysmTime.After(expirationTime1), "Expiration time is not updated") } diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index 63064773f180..8ec2d171f49b 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -7,6 +7,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "go.opencensus.io/trace" ) @@ -27,13 +29,14 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att ethpb.Att) error { return nil } - r, err := hashFn(att) + id, err := attestation.NewId(att, attestation.Full) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } + c.unAggregateAttLock.Lock() defer c.unAggregateAttLock.Unlock() - c.unAggregatedAtt[r] = att.Copy() + c.unAggregatedAtt[id] = att return nil } @@ -69,19 +72,56 @@ func (c *AttCaches) UnaggregatedAttestations() ([]ethpb.Att, error) { // UnaggregatedAttestationsBySlotIndex returns the unaggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att { +func (c *AttCaches) UnaggregatedAttestationsBySlotIndex( + ctx context.Context, + slot primitives.Slot, + committeeIndex primitives.CommitteeIndex, +) []*ethpb.Attestation { _, span := trace.StartSpan(ctx, "operations.attestations.kv.UnaggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]ethpb.Att, 0) + atts := make([]*ethpb.Attestation, 0) + + c.unAggregateAttLock.RLock() + defer c.unAggregateAttLock.RUnlock() + + unAggregatedAtts := c.unAggregatedAtt + for _, a := range unAggregatedAtts { + if a.Version() == version.Phase0 && slot == a.GetData().Slot && committeeIndex == a.GetData().CommitteeIndex { + att, ok := a.(*ethpb.Attestation) + // This will never fail in practice because we asserted the version + if ok { + atts = append(atts, att) + } + } + } + + return atts +} + +// UnaggregatedAttestationsBySlotIndexElectra returns the unaggregated attestations in cache, +// filtered by committee index and slot. +func (c *AttCaches) UnaggregatedAttestationsBySlotIndexElectra( + ctx context.Context, + slot primitives.Slot, + committeeIndex primitives.CommitteeIndex, +) []*ethpb.AttestationElectra { + _, span := trace.StartSpan(ctx, "operations.attestations.kv.UnaggregatedAttestationsBySlotIndexElectra") + defer span.End() + + atts := make([]*ethpb.AttestationElectra, 0) c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() unAggregatedAtts := c.unAggregatedAtt for _, a := range unAggregatedAtts { - if slot == a.GetData().Slot && committeeIndex == a.GetData().CommitteeIndex { - atts = append(atts, a) + if a.Version() == version.Electra && slot == a.GetData().Slot && a.CommitteeBitsVal().BitAt(uint64(committeeIndex)) { + att, ok := a.(*ethpb.AttestationElectra) + // This will never fail in practice because we asserted the version + if ok { + atts = append(atts, att) + } } } @@ -101,14 +141,14 @@ func (c *AttCaches) DeleteUnaggregatedAttestation(att ethpb.Att) error { return err } - r, err := hashFn(att) + id, err := attestation.NewId(att, attestation.Full) if err != nil { - return errors.Wrap(err, "could not tree hash attestation") + return errors.Wrap(err, "could not create attestation ID") } c.unAggregateAttLock.Lock() defer c.unAggregateAttLock.Unlock() - delete(c.unAggregatedAtt, r) + delete(c.unAggregatedAtt, id) return nil } diff --git a/beacon-chain/operations/attestations/kv/unaggregated_test.go b/beacon-chain/operations/attestations/kv/unaggregated_test.go index 9131f5850706..0fabeb2cbbe2 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated_test.go +++ b/beacon-chain/operations/attestations/kv/unaggregated_test.go @@ -7,10 +7,11 @@ import ( "testing" c "github.com/patrickmn/go-cache" - fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -39,7 +40,7 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { BeaconBlockRoot: []byte{0b0}, }, }, - wantErrString: fssz.ErrBytesLength.Error(), + wantErrString: "could not create attestation ID", }, { name: "normal save", @@ -57,13 +58,13 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { count: 0, }, } - r, err := hashFn(util.HydrateAttestationData(ðpb.AttestationData{Slot: 100})) + id, err := attestation.NewId(util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 100}}), attestation.Data) require.NoError(t, err) for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cache := NewAttCaches() - cache.seenAtt.Set(string(r[:]), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration) + cache.seenAtt.Set(id.String(), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration) assert.Equal(t, 0, len(cache.unAggregatedAtt), "Invalid start pool, atts: %d", len(cache.unAggregatedAtt)) if tt.att != nil && tt.att.GetSignature() == nil { @@ -246,9 +247,35 @@ func TestKV_Unaggregated_UnaggregatedAttestationsBySlotIndex(t *testing.T) { } ctx := context.Background() returned := cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 1) - assert.DeepEqual(t, []ethpb.Att{att1}, returned) + assert.DeepEqual(t, []*ethpb.Attestation{att1}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 2) - assert.DeepEqual(t, []ethpb.Att{att2}, returned) + assert.DeepEqual(t, []*ethpb.Attestation{att2}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 2, 1) - assert.DeepEqual(t, []ethpb.Att{att3}, returned) + assert.DeepEqual(t, []*ethpb.Attestation{att3}, returned) +} + +func TestKV_Unaggregated_UnaggregatedAttestationsBySlotIndexElectra(t *testing.T) { + cache := NewAttCaches() + + committeeBits := primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(1, true) + att1 := util.HydrateAttestationElectra(ðpb.AttestationElectra{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b101}, CommitteeBits: committeeBits}) + committeeBits = primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(2, true) + att2 := util.HydrateAttestationElectra(ðpb.AttestationElectra{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b110}, CommitteeBits: committeeBits}) + committeeBits = primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(1, true) + att3 := util.HydrateAttestationElectra(ðpb.AttestationElectra{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110}, CommitteeBits: committeeBits}) + atts := []*ethpb.AttestationElectra{att1, att2, att3} + + for _, att := range atts { + require.NoError(t, cache.SaveUnaggregatedAttestation(att)) + } + ctx := context.Background() + returned := cache.UnaggregatedAttestationsBySlotIndexElectra(ctx, 1, 1) + assert.DeepEqual(t, []*ethpb.AttestationElectra{att1}, returned) + returned = cache.UnaggregatedAttestationsBySlotIndexElectra(ctx, 1, 2) + assert.DeepEqual(t, []*ethpb.AttestationElectra{att2}, returned) + returned = cache.UnaggregatedAttestationsBySlotIndexElectra(ctx, 2, 1) + assert.DeepEqual(t, []*ethpb.AttestationElectra{att3}, returned) } diff --git a/beacon-chain/operations/attestations/pool.go b/beacon-chain/operations/attestations/pool.go index e3bcf8a585ef..41cf0706c0af 100644 --- a/beacon-chain/operations/attestations/pool.go +++ b/beacon-chain/operations/attestations/pool.go @@ -18,7 +18,8 @@ type Pool interface { SaveAggregatedAttestation(att ethpb.Att) error SaveAggregatedAttestations(atts []ethpb.Att) error AggregatedAttestations() []ethpb.Att - AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att + AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation + AggregatedAttestationsBySlotIndexElectra(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.AttestationElectra DeleteAggregatedAttestation(att ethpb.Att) error HasAggregatedAttestation(att ethpb.Att) (bool, error) AggregatedAttestationCount() int @@ -26,7 +27,8 @@ type Pool interface { SaveUnaggregatedAttestation(att ethpb.Att) error SaveUnaggregatedAttestations(atts []ethpb.Att) error UnaggregatedAttestations() ([]ethpb.Att, error) - UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []ethpb.Att + UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation + UnaggregatedAttestationsBySlotIndexElectra(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.AttestationElectra DeleteUnaggregatedAttestation(att ethpb.Att) error DeleteSeenUnaggregatedAttestations() (int, error) UnaggregatedAttestationCount() int diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index 057c8ca9ae69..34a561066ac2 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -3,14 +3,14 @@ package attestations import ( "bytes" "context" - "errors" "time" + "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -67,7 +67,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { atts := append(s.cfg.Pool.AggregatedAttestations(), s.cfg.Pool.BlockAttestations()...) atts = append(atts, s.cfg.Pool.ForkchoiceAttestations()...) - attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(atts)) + attsByVerAndDataRoot := make(map[attestation.Id][]ethpb.Att, len(atts)) // Consolidate attestations by aggregating them by similar data root. for _, att := range atts { @@ -79,14 +79,14 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { continue } - attDataRoot, err := att.GetData().HashTreeRoot() + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return err + return errors.Wrap(err, "could not create attestation ID") } - attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) + attsByVerAndDataRoot[id] = append(attsByVerAndDataRoot[id], att) } - for _, atts := range attsByDataRoot { + for _, atts := range attsByVerAndDataRoot { if err := s.aggregateAndSaveForkChoiceAtts(atts); err != nil { return err } @@ -119,12 +119,12 @@ func (s *Service) aggregateAndSaveForkChoiceAtts(atts []ethpb.Att) error { // This checks if the attestation has previously been aggregated for fork choice // return true if yes, false if no. func (s *Service) seen(att ethpb.Att) (bool, error) { - attRoot, err := hash.Proto(att.GetData()) + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return false, err + return false, errors.Wrap(err, "could not create attestation ID") } incomingBits := att.GetAggregationBits() - savedBits, ok := s.forkChoiceProcessedRoots.Get(attRoot) + savedBits, ok := s.forkChoiceProcessedAtts.Get(id) if ok { savedBitlist, ok := savedBits.(bitfield.Bitlist) if !ok { @@ -149,6 +149,6 @@ func (s *Service) seen(att ethpb.Att) (bool, error) { } } - s.forkChoiceProcessedRoots.Add(attRoot, incomingBits) + s.forkChoiceProcessedAtts.Add(id, incomingBits) return false, nil } diff --git a/beacon-chain/operations/attestations/service.go b/beacon-chain/operations/attestations/service.go index 177a552073fd..8dd57e995a23 100644 --- a/beacon-chain/operations/attestations/service.go +++ b/beacon-chain/operations/attestations/service.go @@ -13,16 +13,16 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" ) -var forkChoiceProcessedRootsSize = 1 << 16 +var forkChoiceProcessedAttsSize = 1 << 16 // Service of attestation pool operations. type Service struct { - cfg *Config - ctx context.Context - cancel context.CancelFunc - err error - forkChoiceProcessedRoots *lru.Cache - genesisTime uint64 + cfg *Config + ctx context.Context + cancel context.CancelFunc + err error + forkChoiceProcessedAtts *lru.Cache + genesisTime uint64 } // Config options for the service. @@ -35,7 +35,7 @@ type Config struct { // NewService instantiates a new attestation pool service instance that will // be registered into a running beacon node. func NewService(ctx context.Context, cfg *Config) (*Service, error) { - cache := lruwrpr.New(forkChoiceProcessedRootsSize) + cache := lruwrpr.New(forkChoiceProcessedAttsSize) if cfg.pruneInterval == 0 { // Prune expired attestations from the pool every slot interval. @@ -44,10 +44,10 @@ func NewService(ctx context.Context, cfg *Config) (*Service, error) { ctx, cancel := context.WithCancel(ctx) return &Service{ - cfg: cfg, - ctx: ctx, - cancel: cancel, - forkChoiceProcessedRoots: cache, + cfg: cfg, + ctx: ctx, + cancel: cancel, + forkChoiceProcessedAtts: cache, }, nil } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index 1d5d6d624d33..522c6fc32f2d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -2,7 +2,6 @@ package validator import ( "context" - "fmt" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" @@ -100,12 +99,8 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. best = aggregatedAtt } } - att, ok := best.(*ethpb.Attestation) - if !ok { - return nil, fmt.Errorf("best attestation has wrong type (expected %T, got %T)", ðpb.Attestation{}, best) - } a := ðpb.AggregateAttestationAndProof{ - Aggregate: att, + Aggregate: best, SelectionProof: req.SlotSignature, AggregatorIndex: validatorIndex, } diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index ebe984e2c688..587e12e1db7e 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -2,10 +2,14 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["attestation_utils.go"], + srcs = [ + "attestation_utils.go", + "id.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation", visibility = ["//visibility:public"], deps = [ + "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/signing:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", @@ -20,7 +24,10 @@ go_library( go_test( name = "go_default_test", - srcs = ["attestation_utils_test.go"], + srcs = [ + "attestation_utils_test.go", + "id_test.go", + ], deps = [ ":go_default_library", "//config/fieldparams:go_default_library", @@ -29,6 +36,7 @@ go_test( "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", + "//testing/util:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel index 1a537f2da053..1d67021b256c 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel @@ -12,6 +12,7 @@ go_library( "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation:go_default_library", + "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go index d399c7af671e..7a95728b5802 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go @@ -8,6 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" + "github.com/prysmaticlabs/prysm/v5/runtime/version" ) // MaxCoverAttestationAggregation relies on Maximum Coverage greedy algorithm for aggregation. @@ -171,11 +172,21 @@ func aggregateAttestations(atts []ethpb.Att, keys []int, coverage *bitfield.Bitl } } // Put aggregated attestation at a position of the first selected attestation. - atts[targetIdx] = ðpb.Attestation{ - // Append size byte, which will be unnecessary on switch to Bitlist64. - AggregationBits: coverage.ToBitlist(), - Data: data, - Signature: aggregateSignatures(signs).Marshal(), + if atts[0].Version() == version.Phase0 { + atts[targetIdx] = ðpb.Attestation{ + // Append size byte, which will be unnecessary on switch to Bitlist64. + AggregationBits: coverage.ToBitlist(), + Data: data, + Signature: aggregateSignatures(signs).Marshal(), + } + } else { + atts[targetIdx] = ðpb.AttestationElectra{ + // Append size byte, which will be unnecessary on switch to Bitlist64. + AggregationBits: coverage.ToBitlist(), + CommitteeBits: atts[0].CommitteeBitsVal().Bytes(), + Data: data, + Signature: aggregateSignatures(signs).Marshal(), + } } return } diff --git a/proto/prysm/v1alpha1/attestation/id.go b/proto/prysm/v1alpha1/attestation/id.go new file mode 100644 index 000000000000..4674c13974b6 --- /dev/null +++ b/proto/prysm/v1alpha1/attestation/id.go @@ -0,0 +1,71 @@ +package attestation + +import ( + "fmt" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" +) + +// IdSource represents the part of attestation that will be used to generate the Id. +type IdSource uint8 + +const ( + // Full generates the Id from the whole attestation. + Full IdSource = iota + // Data generates the Id from the tuple (slot, committee index, beacon block root, source, target). + Data +) + +// Id represents an attestation ID. Its uniqueness depends on the IdSource provided when constructing the Id. +type Id [33]byte + +// NewId -- +func NewId(att ethpb.Att, source IdSource) (Id, error) { + if err := helpers.ValidateNilAttestation(att); err != nil { + return Id{}, err + } + if att.Version() < 0 || att.Version() > 255 { + return Id{}, errors.New("attestation version must be between 0 and 255") + } + + var id Id + id[0] = byte(att.Version()) + + switch source { + case Full: + h, err := att.HashTreeRoot() + if err != nil { + return Id{}, err + } + copy(id[1:], h[:]) + return id, nil + case Data: + data := att.GetData() + if att.Version() >= version.Electra { + committeeIndices := att.CommitteeBitsVal().BitIndices() + if len(committeeIndices) != 1 { + return Id{}, fmt.Errorf("%d committee bits are set instead of 1", len(committeeIndices)) + } + dataCopy := ethpb.CopyAttestationData(att.GetData()) + dataCopy.CommitteeIndex = primitives.CommitteeIndex(committeeIndices[0]) + data = dataCopy + } + h, err := data.HashTreeRoot() + if err != nil { + return Id{}, err + } + copy(id[1:], h[:]) + return id, nil + default: + return Id{}, errors.New("invalid source requested") + } +} + +// String -- +func (id Id) String() string { + return string(id[:]) +} diff --git a/proto/prysm/v1alpha1/attestation/id_test.go b/proto/prysm/v1alpha1/attestation/id_test.go new file mode 100644 index 000000000000..cd6715464b72 --- /dev/null +++ b/proto/prysm/v1alpha1/attestation/id_test.go @@ -0,0 +1,63 @@ +package attestation_test + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestNewId(t *testing.T) { + t.Run("full source", func(t *testing.T) { + att := util.HydrateAttestation(ðpb.Attestation{}) + _, err := attestation.NewId(att, attestation.Full) + assert.NoError(t, err) + }) + t.Run("data source Phase 0", func(t *testing.T) { + att := util.HydrateAttestation(ðpb.Attestation{}) + _, err := attestation.NewId(att, attestation.Data) + assert.NoError(t, err) + }) + t.Run("data source Electra", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + att := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) + _, err := attestation.NewId(att, attestation.Data) + assert.NoError(t, err) + }) + t.Run("ID is different between versions", func(t *testing.T) { + phase0Att := util.HydrateAttestation(ðpb.Attestation{}) + phase0Id, err := attestation.NewId(phase0Att, attestation.Data) + require.NoError(t, err) + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) // setting committee bit 0 for Electra corresponds to attestation data's committee index 0 for Phase 0 + electraAtt := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) + electraId, err := attestation.NewId(electraAtt, attestation.Data) + require.NoError(t, err) + + assert.NotEqual(t, phase0Id, electraId) + }) + t.Run("invalid source", func(t *testing.T) { + att := util.HydrateAttestation(ðpb.Attestation{}) + _, err := attestation.NewId(att, 123) + assert.ErrorContains(t, "invalid source requested", err) + }) + t.Run("data source Electra - 0 bits set", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + att := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) + _, err := attestation.NewId(att, attestation.Data) + assert.ErrorContains(t, "0 committee bits are set", err) + }) + t.Run("data source Electra - multiple bits set", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(1, true) + att := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) + _, err := attestation.NewId(att, attestation.Data) + assert.ErrorContains(t, "2 committee bits are set", err) + }) +} From 4722446caf92263db6d0ba77694d990231007609 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:19:42 -0500 Subject: [PATCH 150/325] updating process deposit function to be more readable and fork specific, breaking out components of pr 13944 (#14139) --- beacon-chain/blockchain/BUILD.bazel | 1 + beacon-chain/blockchain/service_test.go | 4 +- beacon-chain/core/altair/BUILD.bazel | 1 + beacon-chain/core/altair/deposit.go | 172 ++++++++- beacon-chain/core/altair/deposit_fuzz_test.go | 53 +++ beacon-chain/core/altair/deposit_test.go | 188 +++++++-- .../core/blocks/block_operations_fuzz_test.go | 56 +-- beacon-chain/core/blocks/deposit.go | 159 +------- beacon-chain/core/blocks/deposit_test.go | 364 ++---------------- .../core/transition/state-bellatrix.go | 3 +- beacon-chain/core/transition/state.go | 6 +- .../transition/transition_no_verify_sig.go | 2 +- beacon-chain/execution/BUILD.bazel | 2 +- beacon-chain/execution/deposit.go | 5 +- runtime/interop/BUILD.bazel | 1 - runtime/interop/premine-state.go | 3 +- .../shared/phase0/operations/BUILD.bazel | 1 + .../shared/phase0/operations/deposit.go | 4 +- 18 files changed, 440 insertions(+), 585 deletions(-) diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index a078093903e3..dcb8ffc8b9d6 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -138,6 +138,7 @@ go_test( "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/cache:go_default_library", "//beacon-chain/cache/depositsnapshot:go_default_library", + "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/helpers:go_default_library", diff --git a/beacon-chain/blockchain/service_test.go b/beacon-chain/blockchain/service_test.go index 27582f1b8ed9..3eba33e170b7 100644 --- a/beacon-chain/blockchain/service_test.go +++ b/beacon-chain/blockchain/service_test.go @@ -10,7 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" @@ -203,7 +203,7 @@ func TestChainService_InitializeBeaconChain(t *testing.T) { BlockHash: make([]byte, 32), }) require.NoError(t, err) - genState, err = blocks.ProcessPreGenesisDeposits(ctx, genState, deposits) + genState, err = altair.ProcessPreGenesisDeposits(ctx, genState, deposits) require.NoError(t, err) _, err = bc.initializeBeaconChain(ctx, time.Unix(0, 0), genState, ðpb.Eth1Data{DepositRoot: hashTreeRoot[:], BlockHash: make([]byte, 32)}) diff --git a/beacon-chain/core/altair/BUILD.bazel b/beacon-chain/core/altair/BUILD.bazel index f2d9baf32cea..dcd3094e3029 100644 --- a/beacon-chain/core/altair/BUILD.bazel +++ b/beacon-chain/core/altair/BUILD.bazel @@ -36,6 +36,7 @@ go_library( "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", + "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", diff --git a/beacon-chain/core/altair/deposit.go b/beacon-chain/core/altair/deposit.go index bcc98ea1608d..9f3a0736c581 100644 --- a/beacon-chain/core/altair/deposit.go +++ b/beacon-chain/core/altair/deposit.go @@ -5,11 +5,32 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" ) +// ProcessPreGenesisDeposits processes a deposit for the beacon state before chainstart. +func ProcessPreGenesisDeposits( + ctx context.Context, + beaconState state.BeaconState, + deposits []*ethpb.Deposit, +) (state.BeaconState, error) { + var err error + beaconState, err = ProcessDeposits(ctx, beaconState, deposits) + if err != nil { + return nil, errors.Wrap(err, "could not process deposit") + } + beaconState, err = blocks.ActivateValidatorWithEffectiveBalance(beaconState, deposits) + if err != nil { + return nil, err + } + return beaconState, nil +} + // ProcessDeposits processes validator deposits for beacon state Altair. func ProcessDeposits( ctx context.Context, @@ -33,23 +54,158 @@ func ProcessDeposits( return beaconState, nil } -// ProcessDeposit processes validator deposit for beacon state Altair. +// ProcessDeposit takes in a deposit object and inserts it +// into the registry as a new validator or balance change. +// Returns the resulting state, a boolean to indicate whether or not the deposit +// resulted in a new validator entry into the beacon state, and any error. +// +// Spec pseudocode definition: +// def process_deposit(state: BeaconState, deposit: Deposit) -> None: +// +// # Verify the Merkle branch +// assert is_valid_merkle_branch( +// leaf=hash_tree_root(deposit.data), +// branch=deposit.proof, +// depth=DEPOSIT_CONTRACT_TREE_DEPTH + 1, # Add 1 for the List length mix-in +// index=state.eth1_deposit_index, +// root=state.eth1_data.deposit_root, +// ) +// +// # Deposits must be processed in order +// state.eth1_deposit_index += 1 +// +// apply_deposit( +// state=state, +// pubkey=deposit.data.pubkey, +// withdrawal_credentials=deposit.data.withdrawal_credentials, +// amount=deposit.data.amount, +// signature=deposit.data.signature, +// ) func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verifySignature bool) (state.BeaconState, error) { - beaconState, isNewValidator, err := blocks.ProcessDeposit(beaconState, deposit, verifySignature) - if err != nil { + if err := blocks.VerifyDeposit(beaconState, deposit); err != nil { + if deposit == nil || deposit.Data == nil { + return nil, err + } + return nil, errors.Wrapf(err, "could not verify deposit from %#x", bytesutil.Trunc(deposit.Data.PublicKey)) + } + if err := beaconState.SetEth1DepositIndex(beaconState.Eth1DepositIndex() + 1); err != nil { return nil, err } - if isNewValidator { - if err := beaconState.AppendInactivityScore(0); err != nil { + + return ApplyDeposit(beaconState, deposit.Data, verifySignature) +} + +// ApplyDeposit +// Spec pseudocode definition: +// def apply_deposit(state: BeaconState, pubkey: BLSPubkey, withdrawal_credentials: Bytes32, amount: uint64, signature: BLSSignature) -> None: +// +// validator_pubkeys = [v.pubkey for v in state.validators] +// if pubkey not in validator_pubkeys: +// # Verify the deposit signature (proof of possession) which is not checked by the deposit contract +// deposit_message = DepositMessage( +// pubkey=pubkey, +// withdrawal_credentials=withdrawal_credentials, +// amount=amount, +// ) +// domain = compute_domain(DOMAIN_DEPOSIT) # Fork-agnostic domain since deposits are valid across forks +// signing_root = compute_signing_root(deposit_message, domain) +// if bls.Verify(pubkey, signing_root, signature): +// add_validator_to_registry(state, pubkey, withdrawal_credentials, amount) +// else: +// # Increase balance by deposit amount +// index = ValidatorIndex(validator_pubkeys.index(pubkey)) +// increase_balance(state, index, amount) +func ApplyDeposit(beaconState state.BeaconState, data *ethpb.Deposit_Data, verifySignature bool) (state.BeaconState, error) { + pubKey := data.PublicKey + amount := data.Amount + withdrawalCredentials := data.WithdrawalCredentials + index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) + if !ok { + if verifySignature { + valid, err := blocks.IsValidDepositSignature(data) + if err != nil { + return nil, err + } + if !valid { + return beaconState, nil + } + } + if err := AddValidatorToRegistry(beaconState, pubKey, withdrawalCredentials, amount); err != nil { return nil, err } - if err := beaconState.AppendPreviousParticipationBits(0); err != nil { + } else { + if err := helpers.IncreaseBalance(beaconState, index, amount); err != nil { return nil, err } + } + return beaconState, nil +} + +// AddValidatorToRegistry updates the beacon state with validator information +// def add_validator_to_registry(state: BeaconState, +// +// pubkey: BLSPubkey, +// withdrawal_credentials: Bytes32, +// amount: uint64) -> None: +// index = get_index_for_new_validator(state) +// validator = get_validator_from_deposit(pubkey, withdrawal_credentials) +// set_or_append_list(state.validators, index, validator) +// set_or_append_list(state.balances, index, 0) +// set_or_append_list(state.previous_epoch_participation, index, ParticipationFlags(0b0000_0000)) // New in Altair +// set_or_append_list(state.current_epoch_participation, index, ParticipationFlags(0b0000_0000)) // New in Altair +// set_or_append_list(state.inactivity_scores, index, uint64(0)) // New in Altair +func AddValidatorToRegistry(beaconState state.BeaconState, pubKey []byte, withdrawalCredentials []byte, amount uint64) error { + val := GetValidatorFromDeposit(pubKey, withdrawalCredentials, amount) + if err := beaconState.AppendValidator(val); err != nil { + return err + } + if err := beaconState.AppendBalance(amount); err != nil { + return err + } + + // only active in altair and only when it's a new validator (after append balance) + if beaconState.Version() >= version.Altair { + if err := beaconState.AppendInactivityScore(0); err != nil { + return err + } + if err := beaconState.AppendPreviousParticipationBits(0); err != nil { + return err + } if err := beaconState.AppendCurrentParticipationBits(0); err != nil { - return nil, err + return err } } + return nil +} - return beaconState, nil +// GetValidatorFromDeposit gets a new validator object with provided parameters +// +// def get_validator_from_deposit(pubkey: BLSPubkey, withdrawal_credentials: Bytes32, amount: uint64) -> Validator: +// +// effective_balance = min(amount - amount % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE) +// +// return Validator( +// pubkey=pubkey, +// withdrawal_credentials=withdrawal_credentials, +// activation_eligibility_epoch=FAR_FUTURE_EPOCH, +// activation_epoch=FAR_FUTURE_EPOCH, +// exit_epoch=FAR_FUTURE_EPOCH, +// withdrawable_epoch=FAR_FUTURE_EPOCH, +// effective_balance=effective_balance, +// ) +func GetValidatorFromDeposit(pubKey []byte, withdrawalCredentials []byte, amount uint64) *ethpb.Validator { + effectiveBalance := amount - (amount % params.BeaconConfig().EffectiveBalanceIncrement) + if params.BeaconConfig().MaxEffectiveBalance < effectiveBalance { + effectiveBalance = params.BeaconConfig().MaxEffectiveBalance + } + + return ðpb.Validator{ + PublicKey: pubKey, + WithdrawalCredentials: withdrawalCredentials, + ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, + ActivationEpoch: params.BeaconConfig().FarFutureEpoch, + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + WithdrawableEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: effectiveBalance, + } } diff --git a/beacon-chain/core/altair/deposit_fuzz_test.go b/beacon-chain/core/altair/deposit_fuzz_test.go index afab34fe6186..2db12b58ec4a 100644 --- a/beacon-chain/core/altair/deposit_fuzz_test.go +++ b/beacon-chain/core/altair/deposit_fuzz_test.go @@ -30,6 +30,59 @@ func TestFuzzProcessDeposits_10000(t *testing.T) { } } +func TestFuzzProcessPreGenesisDeposit_10000(t *testing.T) { + fuzzer := fuzz.NewWithSeed(0) + state := ðpb.BeaconStateAltair{} + deposit := ðpb.Deposit{} + ctx := context.Background() + + for i := 0; i < 10000; i++ { + fuzzer.Fuzz(state) + fuzzer.Fuzz(deposit) + s, err := state_native.InitializeFromProtoUnsafeAltair(state) + require.NoError(t, err) + r, err := altair.ProcessPreGenesisDeposits(ctx, s, []*ethpb.Deposit{deposit}) + if err != nil && r != nil { + t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit) + } + } +} + +func TestFuzzProcessPreGenesisDeposit_Phase0_10000(t *testing.T) { + fuzzer := fuzz.NewWithSeed(0) + state := ðpb.BeaconState{} + deposit := ðpb.Deposit{} + ctx := context.Background() + + for i := 0; i < 10000; i++ { + fuzzer.Fuzz(state) + fuzzer.Fuzz(deposit) + s, err := state_native.InitializeFromProtoUnsafePhase0(state) + require.NoError(t, err) + r, err := altair.ProcessPreGenesisDeposits(ctx, s, []*ethpb.Deposit{deposit}) + if err != nil && r != nil { + t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit) + } + } +} + +func TestFuzzProcessDeposit_Phase0_10000(t *testing.T) { + fuzzer := fuzz.NewWithSeed(0) + state := ðpb.BeaconState{} + deposit := ðpb.Deposit{} + + for i := 0; i < 10000; i++ { + fuzzer.Fuzz(state) + fuzzer.Fuzz(deposit) + s, err := state_native.InitializeFromProtoUnsafePhase0(state) + require.NoError(t, err) + r, err := altair.ProcessDeposit(s, deposit, true) + if err != nil && r != nil { + t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit) + } + } +} + func TestFuzzProcessDeposit_10000(t *testing.T) { fuzzer := fuzz.NewWithSeed(0) state := ðpb.BeaconStateAltair{} diff --git a/beacon-chain/core/altair/deposit_test.go b/beacon-chain/core/altair/deposit_test.go index 8e95fee130b8..dda8b468d635 100644 --- a/beacon-chain/core/altair/deposit_test.go +++ b/beacon-chain/core/altair/deposit_test.go @@ -7,11 +7,14 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) @@ -44,36 +47,6 @@ func TestProcessDeposits_SameValidatorMultipleDepositsSameBlock(t *testing.T) { require.Equal(t, 2, len(newState.Validators()), "Incorrect validator count") } -func TestProcessDeposits_MerkleBranchFailsVerification(t *testing.T) { - deposit := ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1, 2, 3}, 48), - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - } - leaf, err := deposit.Data.HashTreeRoot() - require.NoError(t, err) - - // We then create a merkle branch for the test. - depositTrie, err := trie.GenerateTrieFromItems([][]byte{leaf[:]}, params.BeaconConfig().DepositContractTreeDepth) - require.NoError(t, err, "Could not generate trie") - proof, err := depositTrie.MerkleProof(0) - require.NoError(t, err, "Could not generate proof") - - deposit.Proof = proof - beaconState, err := state_native.InitializeFromProtoAltair(ðpb.BeaconStateAltair{ - Eth1Data: ðpb.Eth1Data{ - DepositRoot: []byte{0}, - BlockHash: []byte{1}, - }, - }) - require.NoError(t, err) - want := "deposit root did not verify" - _, err = altair.ProcessDeposits(context.Background(), beaconState, []*ethpb.Deposit{deposit}) - require.ErrorContains(t, want, err) -} - func TestProcessDeposits_AddsNewValidatorDeposit(t *testing.T) { dep, _, err := util.DeterministicDepositsAndKeys(1) require.NoError(t, err) @@ -245,3 +218,158 @@ func TestProcessDeposit_SkipsInvalidDeposit(t *testing.T) { t.Errorf("Expected validator balance at index 0 to stay 0, received: %v", newState.Balances()[0]) } } + +func TestPreGenesisDeposits_SkipInvalidDeposit(t *testing.T) { + + dep, _, err := util.DeterministicDepositsAndKeys(100) + require.NoError(t, err) + dep[0].Data.Signature = make([]byte, 96) + dt, _, err := util.DepositTrieFromDeposits(dep) + require.NoError(t, err) + + for i := range dep { + proof, err := dt.MerkleProof(i) + require.NoError(t, err) + dep[i].Proof = proof + } + root, err := dt.HashTreeRoot() + require.NoError(t, err) + + eth1Data := ðpb.Eth1Data{ + DepositRoot: root[:], + DepositCount: 1, + } + registry := []*ethpb.Validator{ + { + PublicKey: []byte{1}, + WithdrawalCredentials: []byte{1, 2, 3}, + }, + } + balances := []uint64{0} + beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ + Validators: registry, + Balances: balances, + Eth1Data: eth1Data, + Fork: ðpb.Fork{ + PreviousVersion: params.BeaconConfig().GenesisForkVersion, + CurrentVersion: params.BeaconConfig().GenesisForkVersion, + }, + }) + require.NoError(t, err) + newState, err := altair.ProcessPreGenesisDeposits(context.Background(), beaconState, dep) + require.NoError(t, err, "Expected invalid block deposit to be ignored without error") + + _, ok := newState.ValidatorIndexByPubkey(bytesutil.ToBytes48(dep[0].Data.PublicKey)) + require.Equal(t, false, ok, "bad pubkey should not exist in state") + + for i := 1; i < newState.NumValidators(); i++ { + val, err := newState.ValidatorAtIndex(primitives.ValidatorIndex(i)) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, val.EffectiveBalance, "unequal effective balance") + require.Equal(t, primitives.Epoch(0), val.ActivationEpoch) + require.Equal(t, primitives.Epoch(0), val.ActivationEligibilityEpoch) + } + if newState.Eth1DepositIndex() != 100 { + t.Errorf( + "Expected Eth1DepositIndex to be increased by 99 after processing an invalid deposit, received change: %v", + newState.Eth1DepositIndex(), + ) + } + if len(newState.Validators()) != 100 { + t.Errorf("Expected validator list to have length 100, received: %v", len(newState.Validators())) + } + if len(newState.Balances()) != 100 { + t.Errorf("Expected validator balances list to have length 100, received: %v", len(newState.Balances())) + } + if newState.Balances()[0] != 0 { + t.Errorf("Expected validator balance at index 0 to stay 0, received: %v", newState.Balances()[0]) + } +} + +func TestProcessDeposit_RepeatedDeposit_IncreasesValidatorBalance(t *testing.T) { + sk, err := bls.RandKey() + require.NoError(t, err) + deposit := ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: sk.PublicKey().Marshal(), + Amount: 1000, + WithdrawalCredentials: make([]byte, 32), + Signature: make([]byte, 96), + }, + } + sr, err := signing.ComputeSigningRoot(deposit.Data, bytesutil.ToBytes(3, 32)) + require.NoError(t, err) + sig := sk.Sign(sr[:]) + deposit.Data.Signature = sig.Marshal() + leaf, err := deposit.Data.HashTreeRoot() + require.NoError(t, err) + + // We then create a merkle branch for the test. + depositTrie, err := trie.GenerateTrieFromItems([][]byte{leaf[:]}, params.BeaconConfig().DepositContractTreeDepth) + require.NoError(t, err, "Could not generate trie") + proof, err := depositTrie.MerkleProof(0) + require.NoError(t, err, "Could not generate proof") + + deposit.Proof = proof + registry := []*ethpb.Validator{ + { + PublicKey: []byte{1, 2, 3}, + }, + { + PublicKey: sk.PublicKey().Marshal(), + WithdrawalCredentials: []byte{1}, + }, + } + balances := []uint64{0, 50} + root, err := depositTrie.HashTreeRoot() + require.NoError(t, err) + + beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ + Validators: registry, + Balances: balances, + Eth1Data: ðpb.Eth1Data{ + DepositRoot: root[:], + BlockHash: root[:], + }, + }) + require.NoError(t, err) + newState, err := altair.ProcessDeposit(beaconState, deposit, true /*verifySignature*/) + require.NoError(t, err, "Process deposit failed") + require.Equal(t, uint64(1000+50), newState.Balances()[1], "Expected balance at index 1 to be 1050") +} + +func TestProcessDeposits_MerkleBranchFailsVerification(t *testing.T) { + deposit := ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: bytesutil.PadTo([]byte{1, 2, 3}, fieldparams.BLSPubkeyLength), + WithdrawalCredentials: make([]byte, 32), + Signature: make([]byte, fieldparams.BLSSignatureLength), + }, + } + leaf, err := deposit.Data.HashTreeRoot() + require.NoError(t, err) + + // We then create a merkle branch for the test. + depositTrie, err := trie.GenerateTrieFromItems([][]byte{leaf[:]}, params.BeaconConfig().DepositContractTreeDepth) + require.NoError(t, err, "Could not generate trie") + proof, err := depositTrie.MerkleProof(0) + require.NoError(t, err, "Could not generate proof") + + deposit.Proof = proof + b := util.NewBeaconBlock() + b.Block = ðpb.BeaconBlock{ + Body: ðpb.BeaconBlockBody{ + Deposits: []*ethpb.Deposit{deposit}, + }, + } + beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ + Eth1Data: ðpb.Eth1Data{ + DepositRoot: []byte{0}, + BlockHash: []byte{1}, + }, + }) + require.NoError(t, err) + want := "deposit root did not verify" + _, err = altair.ProcessDeposits(context.Background(), beaconState, b.Block.Body.Deposits) + assert.ErrorContains(t, want, err) +} diff --git a/beacon-chain/core/blocks/block_operations_fuzz_test.go b/beacon-chain/core/blocks/block_operations_fuzz_test.go index 23adc4144a94..3e02b87f1112 100644 --- a/beacon-chain/core/blocks/block_operations_fuzz_test.go +++ b/beacon-chain/core/blocks/block_operations_fuzz_test.go @@ -297,60 +297,6 @@ func TestFuzzVerifyIndexedAttestationn_10000(t *testing.T) { } } -func TestFuzzProcessDeposits_10000(t *testing.T) { - fuzzer := fuzz.NewWithSeed(0) - state := ðpb.BeaconState{} - deposits := make([]*ethpb.Deposit, 100) - ctx := context.Background() - for i := 0; i < 10000; i++ { - fuzzer.Fuzz(state) - for i := range deposits { - fuzzer.Fuzz(deposits[i]) - } - s, err := state_native.InitializeFromProtoUnsafePhase0(state) - require.NoError(t, err) - r, err := ProcessDeposits(ctx, s, deposits) - if err != nil && r != nil { - t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposits) - } - } -} - -func TestFuzzProcessPreGenesisDeposit_10000(t *testing.T) { - fuzzer := fuzz.NewWithSeed(0) - state := ðpb.BeaconState{} - deposit := ðpb.Deposit{} - ctx := context.Background() - - for i := 0; i < 10000; i++ { - fuzzer.Fuzz(state) - fuzzer.Fuzz(deposit) - s, err := state_native.InitializeFromProtoUnsafePhase0(state) - require.NoError(t, err) - r, err := ProcessPreGenesisDeposits(ctx, s, []*ethpb.Deposit{deposit}) - if err != nil && r != nil { - t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit) - } - } -} - -func TestFuzzProcessDeposit_10000(t *testing.T) { - fuzzer := fuzz.NewWithSeed(0) - state := ðpb.BeaconState{} - deposit := ðpb.Deposit{} - - for i := 0; i < 10000; i++ { - fuzzer.Fuzz(state) - fuzzer.Fuzz(deposit) - s, err := state_native.InitializeFromProtoUnsafePhase0(state) - require.NoError(t, err) - r, _, err := ProcessDeposit(s, deposit, true) - if err != nil && r != nil { - t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit) - } - } -} - func TestFuzzverifyDeposit_10000(t *testing.T) { fuzzer := fuzz.NewWithSeed(0) state := ðpb.BeaconState{} @@ -360,7 +306,7 @@ func TestFuzzverifyDeposit_10000(t *testing.T) { fuzzer.Fuzz(deposit) s, err := state_native.InitializeFromProtoUnsafePhase0(state) require.NoError(t, err) - err = verifyDeposit(s, deposit) + err = VerifyDeposit(s, deposit) _ = err } } diff --git a/beacon-chain/core/blocks/deposit.go b/beacon-chain/core/blocks/deposit.go index 8458115952e2..3b8b715ca1a8 100644 --- a/beacon-chain/core/blocks/deposit.go +++ b/beacon-chain/core/blocks/deposit.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -17,24 +16,6 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -// ProcessPreGenesisDeposits processes a deposit for the beacon state before chainstart. -func ProcessPreGenesisDeposits( - ctx context.Context, - beaconState state.BeaconState, - deposits []*ethpb.Deposit, -) (state.BeaconState, error) { - var err error - beaconState, err = ProcessDeposits(ctx, beaconState, deposits) - if err != nil { - return nil, errors.Wrap(err, "could not process deposit") - } - beaconState, err = ActivateValidatorWithEffectiveBalance(beaconState, deposits) - if err != nil { - return nil, err - } - return beaconState, nil -} - // ActivateValidatorWithEffectiveBalance updates validator's effective balance, and if it's above MaxEffectiveBalance, validator becomes active in genesis. func ActivateValidatorWithEffectiveBalance(beaconState state.BeaconState, deposits []*ethpb.Deposit) (state.BeaconState, error) { for _, d := range deposits { @@ -66,38 +47,6 @@ func ActivateValidatorWithEffectiveBalance(beaconState state.BeaconState, deposi return beaconState, nil } -// ProcessDeposits is one of the operations performed on each processed -// beacon block to verify queued validators from the Ethereum 1.0 Deposit Contract -// into the beacon chain. -// -// Spec pseudocode definition: -// -// For each deposit in block.body.deposits: -// process_deposit(state, deposit) -func ProcessDeposits( - ctx context.Context, - beaconState state.BeaconState, - deposits []*ethpb.Deposit, -) (state.BeaconState, error) { - // Attempt to verify all deposit signatures at once, if this fails then fall back to processing - // individual deposits with signature verification enabled. - batchVerified, err := BatchVerifyDepositsSignatures(ctx, deposits) - if err != nil { - return nil, err - } - - for _, d := range deposits { - if d == nil || d.Data == nil { - return nil, errors.New("got a nil deposit in block") - } - beaconState, _, err = ProcessDeposit(beaconState, d, batchVerified) - if err != nil { - return nil, errors.Wrapf(err, "could not process deposit from %#x", bytesutil.Trunc(d.Data.PublicKey)) - } - } - return beaconState, nil -} - // BatchVerifyDepositsSignatures batch verifies deposit signatures. func BatchVerifyDepositsSignatures(ctx context.Context, deposits []*ethpb.Deposit) (bool, error) { var err error @@ -114,102 +63,28 @@ func BatchVerifyDepositsSignatures(ctx context.Context, deposits []*ethpb.Deposi return verified, nil } -// ProcessDeposit takes in a deposit object and inserts it -// into the registry as a new validator or balance change. -// Returns the resulting state, a boolean to indicate whether or not the deposit -// resulted in a new validator entry into the beacon state, and any error. -// -// Spec pseudocode definition: -// def process_deposit(state: BeaconState, deposit: Deposit) -> None: -// -// # Verify the Merkle branch -// assert is_valid_merkle_branch( -// leaf=hash_tree_root(deposit.data), -// branch=deposit.proof, -// depth=DEPOSIT_CONTRACT_TREE_DEPTH + 1, # Add 1 for the List length mix-in -// index=state.eth1_deposit_index, -// root=state.eth1_data.deposit_root, -// ) +// IsValidDepositSignature returns whether deposit_data is valid +// def is_valid_deposit_signature(pubkey: BLSPubkey, withdrawal_credentials: Bytes32, amount: uint64, signature: BLSSignature) -> bool: // -// # Deposits must be processed in order -// state.eth1_deposit_index += 1 -// -// pubkey = deposit.data.pubkey -// amount = deposit.data.amount -// validator_pubkeys = [v.pubkey for v in state.validators] -// if pubkey not in validator_pubkeys: -// # Verify the deposit signature (proof of possession) which is not checked by the deposit contract -// deposit_message = DepositMessage( -// pubkey=deposit.data.pubkey, -// withdrawal_credentials=deposit.data.withdrawal_credentials, -// amount=deposit.data.amount, -// ) -// domain = compute_domain(DOMAIN_DEPOSIT) # Fork-agnostic domain since deposits are valid across forks -// signing_root = compute_signing_root(deposit_message, domain) -// if not bls.Verify(pubkey, signing_root, deposit.data.signature): -// return -// -// # Add validator and balance entries -// state.validators.append(get_validator_from_deposit(state, deposit)) -// state.balances.append(amount) -// else: -// # Increase balance by deposit amount -// index = ValidatorIndex(validator_pubkeys.index(pubkey)) -// increase_balance(state, index, amount) -func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verifySignature bool) (state.BeaconState, bool, error) { - var newValidator bool - if err := verifyDeposit(beaconState, deposit); err != nil { - if deposit == nil || deposit.Data == nil { - return nil, newValidator, err - } - return nil, newValidator, errors.Wrapf(err, "could not verify deposit from %#x", bytesutil.Trunc(deposit.Data.PublicKey)) - } - if err := beaconState.SetEth1DepositIndex(beaconState.Eth1DepositIndex() + 1); err != nil { - return nil, newValidator, err +// deposit_message = DepositMessage( pubkey=pubkey, withdrawal_credentials=withdrawal_credentials, amount=amount, ) +// domain = compute_domain(DOMAIN_DEPOSIT) # Fork-agnostic domain since deposits are valid across forks +// signing_root = compute_signing_root(deposit_message, domain) +// return bls.Verify(pubkey, signing_root, signature) +func IsValidDepositSignature(data *ethpb.Deposit_Data) (bool, error) { + domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil) + if err != nil { + return false, err } - pubKey := deposit.Data.PublicKey - amount := deposit.Data.Amount - index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) - if !ok { - if verifySignature { - domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil) - if err != nil { - return nil, newValidator, err - } - if err := verifyDepositDataSigningRoot(deposit.Data, domain); err != nil { - // Ignore this error as in the spec pseudo code. - log.WithError(err).Debug("Skipping deposit: could not verify deposit data signature") - return beaconState, newValidator, nil - } - } - - effectiveBalance := amount - (amount % params.BeaconConfig().EffectiveBalanceIncrement) - if params.BeaconConfig().MaxEffectiveBalance < effectiveBalance { - effectiveBalance = params.BeaconConfig().MaxEffectiveBalance - } - if err := beaconState.AppendValidator(ðpb.Validator{ - PublicKey: pubKey, - WithdrawalCredentials: deposit.Data.WithdrawalCredentials, - ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, - ActivationEpoch: params.BeaconConfig().FarFutureEpoch, - ExitEpoch: params.BeaconConfig().FarFutureEpoch, - WithdrawableEpoch: params.BeaconConfig().FarFutureEpoch, - EffectiveBalance: effectiveBalance, - }); err != nil { - return nil, newValidator, err - } - newValidator = true - if err := beaconState.AppendBalance(amount); err != nil { - return nil, newValidator, err - } - } else if err := helpers.IncreaseBalance(beaconState, index, amount); err != nil { - return nil, newValidator, err + if err := verifyDepositDataSigningRoot(data, domain); err != nil { + // Ignore this error as in the spec pseudo code. + log.WithError(err).Debug("Skipping deposit: could not verify deposit data signature") + return false, nil } - - return beaconState, newValidator, nil + return true, nil } -func verifyDeposit(beaconState state.ReadOnlyBeaconState, deposit *ethpb.Deposit) error { +// VerifyDeposit verifies the deposit data and signature given the beacon state and deposit information +func VerifyDeposit(beaconState state.ReadOnlyBeaconState, deposit *ethpb.Deposit) error { // Verify Merkle proof of deposit and deposit trie root. if deposit == nil || deposit.Data == nil { return errors.New("received nil deposit or nil deposit data") diff --git a/beacon-chain/core/blocks/deposit_test.go b/beacon-chain/core/blocks/deposit_test.go index 1de014f1840c..31ba22f23d17 100644 --- a/beacon-chain/core/blocks/deposit_test.go +++ b/beacon-chain/core/blocks/deposit_test.go @@ -9,64 +9,23 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestProcessDeposits_SameValidatorMultipleDepositsSameBlock(t *testing.T) { - // Same validator created 3 valid deposits within the same block - - dep, _, err := util.DeterministicDepositsAndKeysSameValidator(3) - require.NoError(t, err) - eth1Data, err := util.DeterministicEth1Data(len(dep)) - require.NoError(t, err) - b := util.NewBeaconBlock() - b.Block = ðpb.BeaconBlock{ - Body: ðpb.BeaconBlockBody{ - // 3 deposits from the same validator - Deposits: []*ethpb.Deposit{dep[0], dep[1], dep[2]}, - }, - } - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1}, - WithdrawalCredentials: []byte{1, 2, 3}, - }, - } - balances := []uint64{0} - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, - Eth1Data: eth1Data, - Fork: ðpb.Fork{ - PreviousVersion: params.BeaconConfig().GenesisForkVersion, - CurrentVersion: params.BeaconConfig().GenesisForkVersion, - }, - }) - require.NoError(t, err) - newState, err := blocks.ProcessDeposits(context.Background(), beaconState, b.Block.Body.Deposits) - require.NoError(t, err, "Expected block deposits to process correctly") - - assert.Equal(t, 2, len(newState.Validators()), "Incorrect validator count") -} - -func TestProcessDeposits_MerkleBranchFailsVerification(t *testing.T) { +func TestBatchVerifyDepositsSignatures_Ok(t *testing.T) { deposit := ðpb.Deposit{ Data: ðpb.Deposit_Data{ - PublicKey: bytesutil.PadTo([]byte{1, 2, 3}, fieldparams.BLSPubkeyLength), + PublicKey: bytesutil.PadTo([]byte{1, 2, 3}, 48), WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, fieldparams.BLSSignatureLength), + Signature: make([]byte, 96), }, } leaf, err := deposit.Data.HashTreeRoot() require.NoError(t, err) - // We then create a merkle branch for the test. depositTrie, err := trie.GenerateTrieFromItems([][]byte{leaf[:]}, params.BeaconConfig().DepositContractTreeDepth) require.NoError(t, err, "Could not generate trie") @@ -74,79 +33,20 @@ func TestProcessDeposits_MerkleBranchFailsVerification(t *testing.T) { require.NoError(t, err, "Could not generate proof") deposit.Proof = proof - b := util.NewBeaconBlock() - b.Block = ðpb.BeaconBlock{ - Body: ðpb.BeaconBlockBody{ - Deposits: []*ethpb.Deposit{deposit}, - }, - } - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Eth1Data: ðpb.Eth1Data{ - DepositRoot: []byte{0}, - BlockHash: []byte{1}, - }, - }) require.NoError(t, err) - want := "deposit root did not verify" - _, err = blocks.ProcessDeposits(context.Background(), beaconState, b.Block.Body.Deposits) - assert.ErrorContains(t, want, err) -} - -func TestProcessDeposits_AddsNewValidatorDeposit(t *testing.T) { - dep, _, err := util.DeterministicDepositsAndKeys(1) - require.NoError(t, err) - eth1Data, err := util.DeterministicEth1Data(len(dep)) + ok, err := blocks.BatchVerifyDepositsSignatures(context.Background(), []*ethpb.Deposit{deposit}) require.NoError(t, err) - - b := util.NewBeaconBlock() - b.Block = ðpb.BeaconBlock{ - Body: ðpb.BeaconBlockBody{ - Deposits: []*ethpb.Deposit{dep[0]}, - }, - } - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1}, - WithdrawalCredentials: []byte{1, 2, 3}, - }, - } - balances := []uint64{0} - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, - Eth1Data: eth1Data, - Fork: ðpb.Fork{ - PreviousVersion: params.BeaconConfig().GenesisForkVersion, - CurrentVersion: params.BeaconConfig().GenesisForkVersion, - }, - }) - require.NoError(t, err) - newState, err := blocks.ProcessDeposits(context.Background(), beaconState, b.Block.Body.Deposits) - require.NoError(t, err, "Expected block deposits to process correctly") - if newState.Balances()[1] != dep[0].Data.Amount { - t.Errorf( - "Expected state validator balances index 0 to equal %d, received %d", - dep[0].Data.Amount, - newState.Balances()[1], - ) - } + require.Equal(t, true, ok) } -func TestProcessDeposits_RepeatedDeposit_IncreasesValidatorBalance(t *testing.T) { - sk, err := bls.RandKey() - require.NoError(t, err) +func TestVerifyDeposit_MerkleBranchFailsVerification(t *testing.T) { deposit := ðpb.Deposit{ Data: ðpb.Deposit_Data{ - PublicKey: sk.PublicKey().Marshal(), - Amount: 1000, + PublicKey: bytesutil.PadTo([]byte{1, 2, 3}, 48), WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, fieldparams.BLSSignatureLength), + Signature: make([]byte, 96), }, } - sr, err := signing.ComputeSigningRoot(deposit.Data, bytesutil.ToBytes(3, 32)) - require.NoError(t, err) - sig := sk.Sign(sr[:]) - deposit.Data.Signature = sig.Marshal() leaf, err := deposit.Data.HashTreeRoot() require.NoError(t, err) @@ -157,243 +57,39 @@ func TestProcessDeposits_RepeatedDeposit_IncreasesValidatorBalance(t *testing.T) require.NoError(t, err, "Could not generate proof") deposit.Proof = proof - b := util.NewBeaconBlock() - b.Block = ðpb.BeaconBlock{ - Body: ðpb.BeaconBlockBody{ - Deposits: []*ethpb.Deposit{deposit}, - }, - } - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1, 2, 3}, - }, - { - PublicKey: sk.PublicKey().Marshal(), - WithdrawalCredentials: []byte{1}, - }, - } - balances := []uint64{0, 50} - root, err := depositTrie.HashTreeRoot() - require.NoError(t, err) - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, + beaconState, err := state_native.InitializeFromProtoAltair(ðpb.BeaconStateAltair{ Eth1Data: ðpb.Eth1Data{ - DepositRoot: root[:], - BlockHash: root[:], - }, - }) - require.NoError(t, err) - newState, err := blocks.ProcessDeposits(context.Background(), beaconState, b.Block.Body.Deposits) - require.NoError(t, err, "Process deposit failed") - assert.Equal(t, uint64(1000+50), newState.Balances()[1], "Expected balance at index 1 to be 1050") -} - -func TestProcessDeposit_AddsNewValidatorDeposit(t *testing.T) { - // Similar to TestProcessDeposits_AddsNewValidatorDeposit except that this test directly calls ProcessDeposit - dep, _, err := util.DeterministicDepositsAndKeys(1) - require.NoError(t, err) - eth1Data, err := util.DeterministicEth1Data(len(dep)) - require.NoError(t, err) - - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1}, - WithdrawalCredentials: []byte{1, 2, 3}, - }, - } - balances := []uint64{0} - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, - Eth1Data: eth1Data, - Fork: ðpb.Fork{ - PreviousVersion: params.BeaconConfig().GenesisForkVersion, - CurrentVersion: params.BeaconConfig().GenesisForkVersion, - }, - }) - require.NoError(t, err) - newState, isNewValidator, err := blocks.ProcessDeposit(beaconState, dep[0], true) - require.NoError(t, err, "Process deposit failed") - assert.Equal(t, true, isNewValidator, "Expected isNewValidator to be true") - assert.Equal(t, 2, len(newState.Validators()), "Expected validator list to have length 2") - assert.Equal(t, 2, len(newState.Balances()), "Expected validator balances list to have length 2") - if newState.Balances()[1] != dep[0].Data.Amount { - t.Errorf( - "Expected state validator balances index 1 to equal %d, received %d", - dep[0].Data.Amount, - newState.Balances()[1], - ) - } -} - -func TestProcessDeposit_SkipsInvalidDeposit(t *testing.T) { - // Same test settings as in TestProcessDeposit_AddsNewValidatorDeposit, except that we use an invalid signature - dep, _, err := util.DeterministicDepositsAndKeys(1) - require.NoError(t, err) - dep[0].Data.Signature = make([]byte, 96) - dt, _, err := util.DepositTrieFromDeposits(dep) - require.NoError(t, err) - root, err := dt.HashTreeRoot() - require.NoError(t, err) - eth1Data := ðpb.Eth1Data{ - DepositRoot: root[:], - DepositCount: 1, - } - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1}, - WithdrawalCredentials: []byte{1, 2, 3}, - }, - } - balances := []uint64{0} - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, - Eth1Data: eth1Data, - Fork: ðpb.Fork{ - PreviousVersion: params.BeaconConfig().GenesisForkVersion, - CurrentVersion: params.BeaconConfig().GenesisForkVersion, + DepositRoot: []byte{0}, + BlockHash: []byte{1}, }, }) require.NoError(t, err) - newState, isNewValidator, err := blocks.ProcessDeposit(beaconState, dep[0], true) - require.NoError(t, err, "Expected invalid block deposit to be ignored without error") - assert.Equal(t, false, isNewValidator, "Expected isNewValidator to be false") - - if newState.Eth1DepositIndex() != 1 { - t.Errorf( - "Expected Eth1DepositIndex to be increased by 1 after processing an invalid deposit, received change: %v", - newState.Eth1DepositIndex(), - ) - } - if len(newState.Validators()) != 1 { - t.Errorf("Expected validator list to have length 1, received: %v", len(newState.Validators())) - } - if len(newState.Balances()) != 1 { - t.Errorf("Expected validator balances list to have length 1, received: %v", len(newState.Balances())) - } - if newState.Balances()[0] != 0 { - t.Errorf("Expected validator balance at index 0 to stay 0, received: %v", newState.Balances()[0]) - } + want := "deposit root did not verify" + err = blocks.VerifyDeposit(beaconState, deposit) + require.ErrorContains(t, want, err) } -func TestPreGenesisDeposits_SkipInvalidDeposit(t *testing.T) { - - dep, _, err := util.DeterministicDepositsAndKeys(100) - require.NoError(t, err) - dep[0].Data.Signature = make([]byte, 96) - dt, _, err := util.DepositTrieFromDeposits(dep) - require.NoError(t, err) - - for i := range dep { - proof, err := dt.MerkleProof(i) - require.NoError(t, err) - dep[i].Proof = proof - } - root, err := dt.HashTreeRoot() - require.NoError(t, err) - - eth1Data := ðpb.Eth1Data{ - DepositRoot: root[:], - DepositCount: 1, - } - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1}, - WithdrawalCredentials: []byte{1, 2, 3}, - }, - } - balances := []uint64{0} - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, - Eth1Data: eth1Data, - Fork: ðpb.Fork{ - PreviousVersion: params.BeaconConfig().GenesisForkVersion, - CurrentVersion: params.BeaconConfig().GenesisForkVersion, - }, - }) +func TestIsValidDepositSignature_Ok(t *testing.T) { + sk, err := bls.RandKey() require.NoError(t, err) - newState, err := blocks.ProcessPreGenesisDeposits(context.Background(), beaconState, dep) - require.NoError(t, err, "Expected invalid block deposit to be ignored without error") - - _, ok := newState.ValidatorIndexByPubkey(bytesutil.ToBytes48(dep[0].Data.PublicKey)) - require.Equal(t, false, ok, "bad pubkey should not exist in state") - - for i := 1; i < newState.NumValidators(); i++ { - val, err := newState.ValidatorAtIndex(primitives.ValidatorIndex(i)) - require.NoError(t, err) - require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, val.EffectiveBalance, "unequal effective balance") - require.Equal(t, primitives.Epoch(0), val.ActivationEpoch) - require.Equal(t, primitives.Epoch(0), val.ActivationEligibilityEpoch) + depositData := ðpb.Deposit_Data{ + PublicKey: sk.PublicKey().Marshal(), + Amount: 0, + WithdrawalCredentials: make([]byte, 32), + Signature: make([]byte, fieldparams.BLSSignatureLength), } - if newState.Eth1DepositIndex() != 100 { - t.Errorf( - "Expected Eth1DepositIndex to be increased by 99 after processing an invalid deposit, received change: %v", - newState.Eth1DepositIndex(), - ) + dm := ðpb.DepositMessage{ + PublicKey: sk.PublicKey().Marshal(), + WithdrawalCredentials: make([]byte, 32), + Amount: 0, } - if len(newState.Validators()) != 100 { - t.Errorf("Expected validator list to have length 100, received: %v", len(newState.Validators())) - } - if len(newState.Balances()) != 100 { - t.Errorf("Expected validator balances list to have length 100, received: %v", len(newState.Balances())) - } - if newState.Balances()[0] != 0 { - t.Errorf("Expected validator balance at index 0 to stay 0, received: %v", newState.Balances()[0]) - } -} - -func TestProcessDeposit_RepeatedDeposit_IncreasesValidatorBalance(t *testing.T) { - sk, err := bls.RandKey() + domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil) require.NoError(t, err) - deposit := ðpb.Deposit{ - Data: ðpb.Deposit_Data{ - PublicKey: sk.PublicKey().Marshal(), - Amount: 1000, - WithdrawalCredentials: make([]byte, 32), - Signature: make([]byte, 96), - }, - } - sr, err := signing.ComputeSigningRoot(deposit.Data, bytesutil.ToBytes(3, 32)) + sr, err := signing.ComputeSigningRoot(dm, domain) require.NoError(t, err) sig := sk.Sign(sr[:]) - deposit.Data.Signature = sig.Marshal() - leaf, err := deposit.Data.HashTreeRoot() - require.NoError(t, err) - - // We then create a merkle branch for the test. - depositTrie, err := trie.GenerateTrieFromItems([][]byte{leaf[:]}, params.BeaconConfig().DepositContractTreeDepth) - require.NoError(t, err, "Could not generate trie") - proof, err := depositTrie.MerkleProof(0) - require.NoError(t, err, "Could not generate proof") - - deposit.Proof = proof - registry := []*ethpb.Validator{ - { - PublicKey: []byte{1, 2, 3}, - }, - { - PublicKey: sk.PublicKey().Marshal(), - WithdrawalCredentials: []byte{1}, - }, - } - balances := []uint64{0, 50} - root, err := depositTrie.HashTreeRoot() - require.NoError(t, err) - - beaconState, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ - Validators: registry, - Balances: balances, - Eth1Data: ðpb.Eth1Data{ - DepositRoot: root[:], - BlockHash: root[:], - }, - }) + depositData.Signature = sig.Marshal() + valid, err := blocks.IsValidDepositSignature(depositData) require.NoError(t, err) - newState, isNewValidator, err := blocks.ProcessDeposit(beaconState, deposit, true /*verifySignature*/) - require.NoError(t, err, "Process deposit failed") - assert.Equal(t, false, isNewValidator, "Expected isNewValidator to be false") - assert.Equal(t, uint64(1000+50), newState.Balances()[1], "Expected balance at index 1 to be 1050") + require.Equal(t, true, valid) } diff --git a/beacon-chain/core/transition/state-bellatrix.go b/beacon-chain/core/transition/state-bellatrix.go index 62cd0735aeb5..6a881ec97359 100644 --- a/beacon-chain/core/transition/state-bellatrix.go +++ b/beacon-chain/core/transition/state-bellatrix.go @@ -5,7 +5,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -71,7 +70,7 @@ func GenesisBeaconStateBellatrix(ctx context.Context, deposits []*ethpb.Deposit, return nil, err } - st, err = b.ProcessPreGenesisDeposits(ctx, st, deposits) + st, err = altair.ProcessPreGenesisDeposits(ctx, st, deposits) if err != nil { return nil, errors.Wrap(err, "could not process validator deposits") } diff --git a/beacon-chain/core/transition/state.go b/beacon-chain/core/transition/state.go index c2d4b9930fbb..4e5c5e1ce049 100644 --- a/beacon-chain/core/transition/state.go +++ b/beacon-chain/core/transition/state.go @@ -4,7 +4,7 @@ import ( "context" "github.com/pkg/errors" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -69,7 +69,7 @@ func GenesisBeaconState(ctx context.Context, deposits []*ethpb.Deposit, genesisT return nil, err } - st, err = b.ProcessPreGenesisDeposits(ctx, st, deposits) + st, err = altair.ProcessPreGenesisDeposits(ctx, st, deposits) if err != nil { return nil, errors.Wrap(err, "could not process validator deposits") } @@ -92,7 +92,7 @@ func PreminedGenesisBeaconState(ctx context.Context, deposits []*ethpb.Deposit, if err != nil { return nil, err } - st, err = b.ProcessPreGenesisDeposits(ctx, st, deposits) + st, err = altair.ProcessPreGenesisDeposits(ctx, st, deposits) if err != nil { return nil, errors.Wrap(err, "could not process validator deposits") } diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index 58a546c97819..ee1e79e942b7 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -505,7 +505,7 @@ func phase0Operations( if err != nil { return nil, errors.Wrap(err, "could not process block attestations") } - if _, err := b.ProcessDeposits(ctx, st, beaconBlock.Body().Deposits()); err != nil { + if _, err := altair.ProcessDeposits(ctx, st, beaconBlock.Body().Deposits()); err != nil { return nil, errors.Wrap(err, "could not process deposits") } return b.ProcessVoluntaryExits(ctx, st, beaconBlock.Body().VoluntaryExits()) diff --git a/beacon-chain/execution/BUILD.bazel b/beacon-chain/execution/BUILD.bazel index 2d0edffd8744..15b1bb55a2b2 100644 --- a/beacon-chain/execution/BUILD.bazel +++ b/beacon-chain/execution/BUILD.bazel @@ -27,7 +27,7 @@ go_library( deps = [ "//beacon-chain/cache:go_default_library", "//beacon-chain/cache/depositsnapshot:go_default_library", - "//beacon-chain/core/blocks:go_default_library", + "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/helpers:go_default_library", diff --git a/beacon-chain/execution/deposit.go b/beacon-chain/execution/deposit.go index 90ea72c6debc..f24f05dc59c9 100644 --- a/beacon-chain/execution/deposit.go +++ b/beacon-chain/execution/deposit.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/config/params" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -28,7 +28,8 @@ func (s *Service) processDeposit(ctx context.Context, eth1Data *ethpb.Eth1Data, if err := s.preGenesisState.SetEth1Data(eth1Data); err != nil { return err } - beaconState, err := blocks.ProcessPreGenesisDeposits(ctx, s.preGenesisState, []*ethpb.Deposit{deposit}) + // preGenesisState is always a genesis state ( phase 0 ) and so state version does not need to be checked here for post electra deposit processing + beaconState, err := altair.ProcessPreGenesisDeposits(ctx, s.preGenesisState, []*ethpb.Deposit{deposit}) if err != nil { return errors.Wrap(err, "could not process pre-genesis deposits") } diff --git a/runtime/interop/BUILD.bazel b/runtime/interop/BUILD.bazel index c8b40cdae906..e82eda2dd5ea 100644 --- a/runtime/interop/BUILD.bazel +++ b/runtime/interop/BUILD.bazel @@ -15,7 +15,6 @@ go_library( deps = [ "//async:go_default_library", "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/transition:go_default_library", diff --git a/runtime/interop/premine-state.go b/runtime/interop/premine-state.go index 3eccfaab789f..ab18e1cde35c 100644 --- a/runtime/interop/premine-state.go +++ b/runtime/interop/premine-state.go @@ -6,7 +6,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -206,7 +205,7 @@ func (s *PremineGenesisConfig) processDeposits(ctx context.Context, g state.Beac if _, err = helpers.UpdateGenesisEth1Data(g, deposits, g.Eth1Data()); err != nil { return err } - _, err = b.ProcessPreGenesisDeposits(ctx, g, deposits) + _, err = altair.ProcessPreGenesisDeposits(ctx, g, deposits) if err != nil { return errors.Wrap(err, "could not process validator deposits") } diff --git a/testing/spectest/shared/phase0/operations/BUILD.bazel b/testing/spectest/shared/phase0/operations/BUILD.bazel index fd66fea0f82c..f2a69f1c9e9e 100644 --- a/testing/spectest/shared/phase0/operations/BUILD.bazel +++ b/testing/spectest/shared/phase0/operations/BUILD.bazel @@ -15,6 +15,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/phase0/operations", visibility = ["//testing/spectest:__subpackages__"], deps = [ + "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/validators:go_default_library", diff --git a/testing/spectest/shared/phase0/operations/deposit.go b/testing/spectest/shared/phase0/operations/deposit.go index 08bd7feb0691..010fb41208ba 100644 --- a/testing/spectest/shared/phase0/operations/deposit.go +++ b/testing/spectest/shared/phase0/operations/deposit.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -34,7 +34,7 @@ func RunDepositTest(t *testing.T, config string) { body := ðpb.BeaconBlockBody{Deposits: []*ethpb.Deposit{deposit}} processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) + return altair.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) } RunBlockOperationTest(t, folderPath, body, processDepositsFunc) }) From aad29ff9fc7c5e071262f0182c9e39e99bf3e35a Mon Sep 17 00:00:00 2001 From: Khanh Hoa <49144992+hoanguyenkh@users.noreply.github.com> Date: Wed, 26 Jun 2024 04:28:45 +0700 Subject: [PATCH 151/325] refactor: use go ticker instead of timer (#14134) Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --- beacon-chain/rpc/prysm/v1alpha1/validator/server.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go index 197d76910671..5dc6190151f6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go @@ -100,14 +100,13 @@ func (vs *Server) WaitForActivation(req *ethpb.ValidatorActivationRequest, strea } waitTime := time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second - timer := time.NewTimer(waitTime) - defer timer.Stop() + ticker := time.NewTicker(waitTime) + defer ticker.Stop() for { - timer.Reset(waitTime) select { // Pinging every slot for activation. - case <-timer.C: + case <-ticker.C: activeValidatorExists, validatorStatuses, err := vs.activationStatus(stream.Context(), req.PublicKeys) if err != nil { return status.Errorf(codes.Internal, "Could not fetch validator status: %v", err) From 539b981ac3e440fabeaa8714f0c598212fdc736f Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:36:32 -0500 Subject: [PATCH 152/325] Web3signer: persistent public keys (#13682) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * WIP * broken and still wip * more wip improving saving * wip * removing cyclic dependency * gaz * fixes * fixing more tests and how files load * fixing wallet tests * fixing test * updating keymanager tests * improving how the web3signer keymanager works * WIP * updated keymanager to read from file * gaz * reuse readkeyfile function and add in duplicate keys check * adding in locks to increase safety * refactored how saving keys work, more tests needed: * fix test * fix tests * adding unit tests and cleaning up locks * fixing tests * tests were not fixed properly * removing unneeded files * Update cmd/validator/accounts/wallet_utils.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Update validator/accounts/wallet/wallet.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * review feedback * updating flags and e2e * deepsource fix * resolving feedback * removing fatal test for now * addressing manu's feedback * gofmt * fixing tests * fixing unit tests * more idomatic feedback * updating log files * updating based on preston's suggestion * improving logs and event triggers * addressing comments from manu * truncating was not triggering key file reload * fixing unit test * removing wrong dependency * fix another broken unit test * fixing bad pathing on file * handle errors in test * fixing testdata dependency * resolving deepsource and comment around logs * removing unneeded buffer * reworking ux of web3signer file, unit tests to come * adding unit tests for file change retries * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * updating based on review feedback * missed err check * adding some aliases to make running easier * Update validator/keymanager/remote-web3signer/log.go Co-authored-by: Manu NALEPA * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * radek's review * Update validator/keymanager/remote-web3signer/internal/client.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * Update validator/keymanager/remote-web3signer/keymanager.go Co-authored-by: Radosław Kapka * addressing more review feedback and linting * fixing tests * adding log * adding 1 more test * improving logs --------- Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Co-authored-by: Manu NALEPA Co-authored-by: Radosław Kapka --- cmd/validator/accounts/exit.go | 4 +- cmd/validator/accounts/wallet_utils.go | 2 +- cmd/validator/flags/flags.go | 22 +- cmd/validator/main.go | 1 + cmd/validator/usage.go | 1 + io/file/BUILD.bazel | 6 +- io/file/fileutil.go | 24 + io/file/fileutil_test.go | 35 ++ io/file/log.go | 5 + testing/endtoend/components/validator.go | 15 +- testing/endtoend/minimal_scenario_e2e_test.go | 4 + testing/endtoend/types/types.go | 8 + validator/accounts/iface/wallet.go | 4 + validator/accounts/testing/mock.go | 12 + validator/accounts/wallet/wallet.go | 10 +- validator/accounts/wallet/wallet_test.go | 13 +- validator/client/BUILD.bazel | 2 + validator/client/validator_test.go | 19 +- .../keymanager/remote-web3signer/BUILD.bazel | 7 + .../remote-web3signer/internal/BUILD.bazel | 1 - .../remote-web3signer/internal/client.go | 30 +- .../remote-web3signer/internal/client_test.go | 19 +- .../remote-web3signer/keymanager.go | 465 ++++++++++++++--- .../remote-web3signer/keymanager_test.go | 484 ++++++++++++++++-- validator/keymanager/remote-web3signer/log.go | 5 + validator/keymanager/types.go | 4 +- validator/node/BUILD.bazel | 5 - validator/node/node.go | 29 +- validator/node/node_test.go | 60 +-- validator/rpc/BUILD.bazel | 1 + validator/rpc/handlers_keymanager.go | 15 +- validator/rpc/handlers_keymanager_test.go | 51 +- 32 files changed, 1096 insertions(+), 267 deletions(-) create mode 100644 io/file/log.go create mode 100644 validator/keymanager/remote-web3signer/log.go diff --git a/cmd/validator/accounts/exit.go b/cmd/validator/accounts/exit.go index 168657c195a3..85143f72fbbe 100644 --- a/cmd/validator/accounts/exit.go +++ b/cmd/validator/accounts/exit.go @@ -34,7 +34,7 @@ func Exit(c *cli.Context, r io.Reader) error { beaconRPCProvider := c.String(flags.BeaconRPCProviderFlag.Name) if !c.IsSet(flags.Web3SignerURLFlag.Name) && !c.IsSet(flags.WalletDirFlag.Name) && !c.IsSet(flags.InteropNumValidators.Name) { return errors.Errorf("No validators found, please provide a prysm wallet directory via flag --%s "+ - "or a web3signer location with corresponding public keys via flags --%s and --%s ", + "or a remote signer location with corresponding public keys via flags --%s and --%s ", flags.WalletDirFlag.Name, flags.Web3SignerURLFlag.Name, flags.Web3SignerPublicValidatorKeysFlag, @@ -62,7 +62,7 @@ func Exit(c *cli.Context, r io.Reader) error { } config, err := node.Web3SignerConfig(c) if err != nil { - return errors.Wrapf(err, "could not configure web3signer") + return errors.Wrapf(err, "could not configure remote signer") } config.GenesisValidatorsRoot = resp.GenesisValidatorsRoot w, km, err = walletWithWeb3SignerKeymanager(c, config) diff --git a/cmd/validator/accounts/wallet_utils.go b/cmd/validator/accounts/wallet_utils.go index 0e8c45c49335..abcccc837016 100644 --- a/cmd/validator/accounts/wallet_utils.go +++ b/cmd/validator/accounts/wallet_utils.go @@ -30,7 +30,7 @@ func walletWithKeymanager(c *cli.Context) (*wallet.Wallet, keymanager.IKeymanage } func walletWithWeb3SignerKeymanager(c *cli.Context, config *remote_web3signer.SetupConfig) (*wallet.Wallet, keymanager.IKeymanager, error) { - w := wallet.NewWalletForWeb3Signer() + w := wallet.NewWalletForWeb3Signer(c) km, err := w.InitializeKeymanager(c.Context, iface.InitKeymanagerConfig{ListenForChanges: false, Web3SignerConfig: config}) if err != nil { return nil, nil, err diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index d9822cc7223f..4a13aad669e4 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -288,18 +288,30 @@ var ( // example:--validators-external-signer-url=http://localhost:9000 // web3signer documentation can be found in Consensys' web3signer project docs Web3SignerURLFlag = &cli.StringFlag{ - Name: "validators-external-signer-url", - Usage: "URL for consensys' web3signer software to use with the Prysm validator client.", - Value: "", + Name: "validators-external-signer-url", + Usage: "URL for consensys' web3signer software to use with the Prysm validator client.", + Value: "", + Aliases: []string{"remote-signer-url"}, } // Web3SignerPublicValidatorKeysFlag defines a comma-separated list of hex string public keys or external url for web3signer to use for validator signing. // example with external url: --validators-external-signer-public-keys= https://web3signer.com/api/v1/eth2/publicKeys // example with public key: --validators-external-signer-public-keys=0xa99a...e44c,0xb89b...4a0b // web3signer documentation can be found in Consensys' web3signer project docs``` Web3SignerPublicValidatorKeysFlag = &cli.StringSliceFlag{ - Name: "validators-external-signer-public-keys", - Usage: "Comma separated list of public keys OR an external url endpoint for the validator to retrieve public keys from for usage with web3signer.", + Name: "validators-external-signer-public-keys", + Usage: "Comma separated list of public keys OR an external url endpoint for the validator to retrieve public keys from for usage with web3signer.", + Aliases: []string{"remote-signer-keys"}, + } + + // Web3SignerKeyFileFlag defines a file for keys to persist to. + // example:--validators-external-signer-key-file=./path/to/keys.txt + Web3SignerKeyFileFlag = &cli.StringFlag{ + Name: "validators-external-signer-key-file", + Usage: "A file path used to load remote public validator keys and persist them through restarts.", + Value: "", + Aliases: []string{"remote-signer-keys-file"}, } + // KeymanagerKindFlag defines the kind of keymanager desired by a user during wallet creation. KeymanagerKindFlag = &cli.StringFlag{ Name: "keymanager-kind", diff --git a/cmd/validator/main.go b/cmd/validator/main.go index f5ca240ee05a..c4584f955b07 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -79,6 +79,7 @@ var appFlags = []cli.Flag{ // Consensys' Web3Signer flags flags.Web3SignerURLFlag, flags.Web3SignerPublicValidatorKeysFlag, + flags.Web3SignerKeyFileFlag, flags.SuggestedFeeRecipientFlag, flags.ProposerSettingsURLFlag, flags.ProposerSettingsFlag, diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index cef63780bba8..59f720b2f152 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -127,6 +127,7 @@ var appHelpFlagGroups = []flagGroup{ Flags: []cli.Flag{ flags.Web3SignerURLFlag, flags.Web3SignerPublicValidatorKeysFlag, + flags.Web3SignerKeyFileFlag, }, }, { diff --git a/io/file/BUILD.bazel b/io/file/BUILD.bazel index 80f977fc11bd..1c8e2a346131 100644 --- a/io/file/BUILD.bazel +++ b/io/file/BUILD.bazel @@ -2,12 +2,16 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["fileutil.go"], + srcs = [ + "fileutil.go", + "log.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/io/file", visibility = ["//visibility:public"], deps = [ "//config/params:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", ], ) diff --git a/io/file/fileutil.go b/io/file/fileutil.go index dfe029457964..19b4ff976c6e 100644 --- a/io/file/fileutil.go +++ b/io/file/fileutil.go @@ -382,3 +382,27 @@ func DirFiles(dir string) ([]string, error) { } return files, nil } + +// WriteLinesToFile writes a slice of strings to a file, each string on a new line. +func WriteLinesToFile(lines []string, filename string) error { + // Open the file for writing. If the file does not exist, create it, or truncate it if it does. + f, err := os.Create(filepath.Clean(filename)) + if err != nil { + return fmt.Errorf("error creating file: %w", err) + } + defer func(file *os.File) { + err := file.Close() + if err != nil { + log.Error(err.Error()) + } + }(f) + + // Iterate through all lines in the slice and write them to the file + for _, line := range lines { + if _, err := f.WriteString(line + "\n"); err != nil { + return fmt.Errorf("error writing line to file: %w", err) + } + } + + return nil +} diff --git a/io/file/fileutil_test.go b/io/file/fileutil_test.go index 42754b59e0d3..dba58a192daf 100644 --- a/io/file/fileutil_test.go +++ b/io/file/fileutil_test.go @@ -24,6 +24,7 @@ import ( "os/user" "path/filepath" "sort" + "strings" "testing" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -567,3 +568,37 @@ func TestHasReadWritePermissions(t *testing.T) { }) } } + +func TestWriteLinesToFile(t *testing.T) { + filename := filepath.Join(t.TempDir(), "testfile.txt") + t.Run("write to a new file", func(t *testing.T) { + lines := []string{"line1", "line2", "line3"} + require.NoError(t, file.WriteLinesToFile(lines, filename)) + // Check file content + content, err := os.ReadFile(filepath.Clean(filename)) + if err != nil { + t.Fatalf("failed to read file: %v", err) + } + + // Join lines with newline for comparison + expectedContent := strings.Join(lines, "\n") + "\n" + if string(content) != expectedContent { + t.Errorf("file content = %q, want %q", string(content), expectedContent) + } + }) + t.Run("overwrite existing file", func(t *testing.T) { + lines := []string{"line4", "line5"} + require.NoError(t, file.WriteLinesToFile(lines, filename)) + // Check file content + content, err := os.ReadFile(filepath.Clean(filename)) + if err != nil { + t.Fatalf("failed to read file: %v", err) + } + + // Join lines with newline for comparison + expectedContent := strings.Join(lines, "\n") + "\n" + if string(content) != expectedContent { + t.Errorf("file content = %q, want %q", string(content), expectedContent) + } + }) +} diff --git a/io/file/log.go b/io/file/log.go new file mode 100644 index 000000000000..2489ef858575 --- /dev/null +++ b/io/file/log.go @@ -0,0 +1,5 @@ +package file + +import "github.com/sirupsen/logrus" + +var log = logrus.WithField("prefix", "fileutil") diff --git a/testing/endtoend/components/validator.go b/testing/endtoend/components/validator.go index 042a49bc7e55..117c2ec3cb7f 100644 --- a/testing/endtoend/components/validator.go +++ b/testing/endtoend/components/validator.go @@ -198,7 +198,7 @@ func (v *ValidatorNode) Start(ctx context.Context) error { beaconRPCPort = e2e.TestParams.Ports.PrysmBeaconNodeRPCPort } - file, err := helpers.DeleteAndCreateFile(e2e.TestParams.LogPath, fmt.Sprintf(e2e.ValidatorLogFileName, index)) + logFile, err := helpers.DeleteAndCreateFile(e2e.TestParams.LogPath, fmt.Sprintf(e2e.ValidatorLogFileName, index)) if err != nil { return err } @@ -223,7 +223,7 @@ func (v *ValidatorNode) Start(ctx context.Context) error { } args := []string{ fmt.Sprintf("--%s=%s/eth2-val-%d", cmdshared.DataDirFlag.Name, e2e.TestParams.TestPath, index), - fmt.Sprintf("--%s=%s", cmdshared.LogFileName.Name, file.Name()), + fmt.Sprintf("--%s=%s", cmdshared.LogFileName.Name, logFile.Name()), fmt.Sprintf("--%s=%s", flags.GraffitiFileFlag.Name, gFile), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.ValidatorMetricsPort+index), fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.ValidatorGatewayPort+index), @@ -258,7 +258,16 @@ func (v *ValidatorNode) Start(ctx context.Context) error { // See: https://docs.teku.consensys.net/en/latest/HowTo/External-Signer/Use-External-Signer/ args = append(args, fmt.Sprintf("--%s=http://localhost:%d", flags.Web3SignerURLFlag.Name, Web3RemoteSignerPort), - fmt.Sprintf("--%s=%s", flags.Web3SignerPublicValidatorKeysFlag.Name, strings.Join(validatorHexPubKeys, ","))) + ) + if v.config.UsePersistentKeyFile { + keysPath := filepath.Join(e2e.TestParams.TestPath, "proposer-settings", fmt.Sprintf("validator_%d", index), "keys.txt") + if err := file.WriteLinesToFile(validatorHexPubKeys, keysPath); err != nil { + return err + } + args = append(args, fmt.Sprintf("--%s=%s", flags.Web3SignerKeyFileFlag.Name, keysPath)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.Web3SignerPublicValidatorKeysFlag.Name, strings.Join(validatorHexPubKeys, ","))) + } } else { // When not using remote key signer, use interop keys. args = append(args, diff --git a/testing/endtoend/minimal_scenario_e2e_test.go b/testing/endtoend/minimal_scenario_e2e_test.go index abd029f4283a..33628927a709 100644 --- a/testing/endtoend/minimal_scenario_e2e_test.go +++ b/testing/endtoend/minimal_scenario_e2e_test.go @@ -20,6 +20,10 @@ func TestEndToEnd_MinimalConfig_Web3Signer(t *testing.T) { e2eMinimal(t, types.InitForkCfg(version.Phase0, version.Deneb, params.E2ETestConfig()), types.WithRemoteSigner()).run() } +func TestEndToEnd_MinimalConfig_Web3Signer_PersistentKeys(t *testing.T) { + e2eMinimal(t, types.InitForkCfg(version.Phase0, version.Deneb, params.E2ETestConfig()), types.WithRemoteSignerAndPersistentKeysFile()).run() +} + func TestEndToEnd_MinimalConfig_ValidatorRESTApi(t *testing.T) { e2eMinimal(t, types.InitForkCfg(version.Phase0, version.Deneb, params.E2ETestConfig()), types.WithCheckpointSync(), types.WithValidatorRESTApi()).run() } diff --git a/testing/endtoend/types/types.go b/testing/endtoend/types/types.go index 3d29af1bcaef..d5257a76f43f 100644 --- a/testing/endtoend/types/types.go +++ b/testing/endtoend/types/types.go @@ -26,6 +26,13 @@ func WithRemoteSigner() E2EConfigOpt { } } +func WithRemoteSignerAndPersistentKeysFile() E2EConfigOpt { + return func(cfg *E2EConfig) { + cfg.UseWeb3RemoteSigner = true + cfg.UsePersistentKeyFile = true + } +} + func WithCheckpointSync() E2EConfigOpt { return func(cfg *E2EConfig) { cfg.TestCheckpointSync = true @@ -58,6 +65,7 @@ type E2EConfig struct { UsePrysmShValidator bool UsePprof bool UseWeb3RemoteSigner bool + UsePersistentKeyFile bool TestDeposits bool UseFixedPeerIDs bool UseValidatorCrossClient bool diff --git a/validator/accounts/iface/wallet.go b/validator/accounts/iface/wallet.go index 19991556edd4..3e06a78569fe 100644 --- a/validator/accounts/iface/wallet.go +++ b/validator/accounts/iface/wallet.go @@ -19,6 +19,8 @@ type InitKeymanagerConfig struct { type Wallet interface { // Methods to retrieve wallet and accounts metadata. AccountsDir() string + // Method to retrieve wallet directory. + Dir() string Password() string // Read methods for important wallet and accounts-related files. ReadFileAtPath(ctx context.Context, filePath string, fileName string) ([]byte, error) @@ -26,4 +28,6 @@ type Wallet interface { WriteFileAtPath(ctx context.Context, pathName string, fileName string, data []byte) (bool, error) // Method for initializing a new keymanager. InitializeKeymanager(ctx context.Context, cfg InitKeymanagerConfig) (keymanager.IKeymanager, error) + // Method for returning keymanager kind. + KeymanagerKind() keymanager.Kind } diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index 2f1e3d0a9836..f1e9560e3794 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -29,6 +29,8 @@ type Wallet struct { UnlockAccounts bool lock sync.RWMutex HasWriteFileError bool + WalletDir string + Kind keymanager.Kind } // AccountNames -- @@ -47,6 +49,16 @@ func (w *Wallet) AccountsDir() string { return w.InnerAccountsDir } +// Dir for the wallet. +func (w *Wallet) Dir() string { + return w.WalletDir +} + +// KeymanagerKind -- +func (w *Wallet) KeymanagerKind() keymanager.Kind { + return w.Kind +} + // Exists -- func (w *Wallet) Exists() (bool, error) { return len(w.Directories) > 0, nil diff --git a/validator/accounts/wallet/wallet.go b/validator/accounts/wallet/wallet.go index b8bb3094c968..1ebcab12d48c 100644 --- a/validator/accounts/wallet/wallet.go +++ b/validator/accounts/wallet/wallet.go @@ -254,10 +254,11 @@ func OpenOrCreateNewWallet(cliCtx *cli.Context) (*Wallet, error) { } // NewWalletForWeb3Signer returns a new wallet for web3 signer which is temporary and not stored locally. -func NewWalletForWeb3Signer() *Wallet { +func NewWalletForWeb3Signer(cliCtx *cli.Context) *Wallet { + walletDir := cliCtx.String(flags.WalletDirFlag.Name) // wallet is just a temporary wallet for web3 signer used to call initialize keymanager. return &Wallet{ - walletDir: "", + walletDir: walletDir, // it's ok if there's an existing wallet accountsPath: "", keymanagerKind: keymanager.Web3Signer, walletPassword: "", @@ -318,6 +319,11 @@ func (w *Wallet) AccountsDir() string { return w.accountsPath } +// Dir for the wallet. +func (w *Wallet) Dir() string { + return w.walletDir +} + // Password for the wallet. func (w *Wallet) Password() string { return w.walletPassword diff --git a/validator/accounts/wallet/wallet_test.go b/validator/accounts/wallet/wallet_test.go index 586552e330a4..6b9f17b65880 100644 --- a/validator/accounts/wallet/wallet_test.go +++ b/validator/accounts/wallet/wallet_test.go @@ -61,7 +61,11 @@ func Test_IsValid_RandomFiles(t *testing.T) { } func TestWallet_InitializeKeymanager_web3Signer_HappyPath(t *testing.T) { - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) ctx := context.Background() root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") require.NoError(t, err) @@ -70,7 +74,6 @@ func TestWallet_InitializeKeymanager_web3Signer_HappyPath(t *testing.T) { Web3SignerConfig: &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://localhost:8545", GenesisValidatorsRoot: root, - PublicKeysURL: "http://localhost:8545/public_keys", }, } km, err := w.InitializeKeymanager(ctx, config) @@ -79,7 +82,11 @@ func TestWallet_InitializeKeymanager_web3Signer_HappyPath(t *testing.T) { } func TestWallet_InitializeKeymanager_web3Signer_nilConfig(t *testing.T) { - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) ctx := context.Background() config := iface.InitKeymanagerConfig{ ListenForChanges: false, diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index bbcab6f56385..6c9fbce2acd5 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -124,6 +124,7 @@ go_test( "//async/event:go_default_library", "//beacon-chain/core/signing:go_default_library", "//cache/lru:go_default_library", + "//cmd/validator/flags:go_default_library", "//config/features:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", @@ -169,6 +170,7 @@ go_test( "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_stretchr_testify//mock:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", + "@com_github_urfave_cli_v2//:go_default_library", "@com_github_wealdtech_go_eth2_util//:go_default_library", "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index d0ebbbfbdda2..88214ff28494 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -3,9 +3,12 @@ package client import ( "context" "errors" + "flag" "fmt" "io" "math" + "os" + "path/filepath" "strings" "sync" "testing" @@ -15,6 +18,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang/protobuf/ptypes/empty" "github.com/prysmaticlabs/prysm/v5/async/event" + "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -39,6 +43,7 @@ import ( remoteweb3signer "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer" "github.com/sirupsen/logrus" logTest "github.com/sirupsen/logrus/hooks/test" + "github.com/urfave/cli/v2" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -1356,19 +1361,19 @@ func TestValidator_WaitForKeymanagerInitialization_web3Signer(t *testing.T) { copy(root[2:], "a") err := db.SaveGenesisValidatorsRoot(ctx, root) require.NoError(t, err) - w := wallet.NewWalletForWeb3Signer() - decodedKey, err := hexutil.Decode("0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820") - require.NoError(t, err) - keys := [][48]byte{ - bytesutil.ToBytes48(decodedKey), - } + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + require.NoError(t, os.MkdirAll(newDir, 0700)) + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) v := validator{ db: db, useWeb: false, wallet: w, web3SignerConfig: &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://localhost:8545", - ProvidedPublicKeys: keys, + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, }, } err = v.WaitForKeymanagerInitialization(context.Background()) diff --git a/validator/keymanager/remote-web3signer/BUILD.bazel b/validator/keymanager/remote-web3signer/BUILD.bazel index 3063142ace6c..d3cc832bb8c6 100644 --- a/validator/keymanager/remote-web3signer/BUILD.bazel +++ b/validator/keymanager/remote-web3signer/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "keymanager.go", + "log.go", "metrics.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer", @@ -16,18 +17,22 @@ go_library( "//config/fieldparams:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", + "//io/file:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//validator/accounts/petnames:go_default_library", "//validator/keymanager:go_default_library", "//validator/keymanager/remote-web3signer/internal:go_default_library", "//validator/keymanager/remote-web3signer/v1:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_fsnotify_fsnotify//:go_default_library", "@com_github_go_playground_validator_v10//:go_default_library", "@com_github_logrusorgru_aurora//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", + "@io_opencensus_go//trace:go_default_library", + "@org_golang_x_exp//maps:go_default_library", ], ) @@ -38,12 +43,14 @@ go_test( deps = [ "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", + "//io/file:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//testing/require:go_default_library", "//validator/keymanager:go_default_library", "//validator/keymanager/remote-web3signer/internal:go_default_library", "//validator/keymanager/remote-web3signer/v1/mock:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_stretchr_testify//assert:go_default_library", ], ) diff --git a/validator/keymanager/remote-web3signer/internal/BUILD.bazel b/validator/keymanager/remote-web3signer/internal/BUILD.bazel index 609734f4b7b5..8b9e49daf3a9 100644 --- a/validator/keymanager/remote-web3signer/internal/BUILD.bazel +++ b/validator/keymanager/remote-web3signer/internal/BUILD.bazel @@ -12,7 +12,6 @@ go_library( deps = [ "//config/fieldparams:go_default_library", "//crypto/bls:go_default_library", - "//encoding/bytesutil:go_default_library", "//monitoring/tracing:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/validator/keymanager/remote-web3signer/internal/client.go b/validator/keymanager/remote-web3signer/internal/client.go index 572930a3b977..9c9c9fc0646f 100644 --- a/validator/keymanager/remote-web3signer/internal/client.go +++ b/validator/keymanager/remote-web3signer/internal/client.go @@ -17,7 +17,6 @@ import ( "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/crypto/bls" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -37,7 +36,7 @@ type SignatureResponse struct { // HttpSignerClient defines the interface for interacting with a remote web3signer. type HttpSignerClient interface { Sign(ctx context.Context, pubKey string, request SignRequestJson) (bls.Signature, error) - GetPublicKeys(ctx context.Context, url string) ([][48]byte, error) + GetPublicKeys(ctx context.Context, url string) ([]string, error) } // ApiClient a wrapper object around web3signer APIs. Please refer to the docs from Consensys' web3signer project. @@ -87,8 +86,8 @@ func (client *ApiClient) Sign(ctx context.Context, pubKey string, request SignRe } // GetPublicKeys is a wrapper method around the web3signer publickeys api (this may be removed in the future or moved to another location due to its usage). -func (client *ApiClient) GetPublicKeys(ctx context.Context, url string) ([][fieldparams.BLSPubkeyLength]byte, error) { - resp, err := client.doRequest(ctx, http.MethodGet, url, nil /* no body needed on get request */) +func (client *ApiClient) GetPublicKeys(ctx context.Context, url string) ([]string, error) { + resp, err := client.doRequest(ctx, http.MethodGet, url, http.NoBody) if err != nil { return nil, err } @@ -96,20 +95,19 @@ func (client *ApiClient) GetPublicKeys(ctx context.Context, url string) ([][fiel if err := unmarshalResponse(resp.Body, &publicKeys); err != nil { return nil, err } - decodedKeys := make([][fieldparams.BLSPubkeyLength]byte, len(publicKeys)) - var errorKeyPositions string - for i, value := range publicKeys { - decodedKey, err := hexutil.Decode(value) - if err != nil { - errorKeyPositions += fmt.Sprintf("%v, ", i) - continue - } - decodedKeys[i] = bytesutil.ToBytes48(decodedKey) + if len(publicKeys) == 0 { + return publicKeys, nil + } + // early check if it's a hex and a public key + // note: a full loop will be conducted in keymanager.go if the quick check passes + b, err := hexutil.Decode(publicKeys[0]) + if err != nil { + return nil, errors.Wrap(err, "unable to decode public key") } - if errorKeyPositions != "" { - return nil, errors.New("failed to decode from Hex from the following public key index locations: " + errorKeyPositions) + if len(b) != fieldparams.BLSPubkeyLength { + return nil, fmt.Errorf("invalid public key length of %v bytes", len(b)) } - return decodedKeys, nil + return publicKeys, nil } // ReloadSignerKeys is a wrapper method around the web3signer reload api. diff --git a/validator/keymanager/remote-web3signer/internal/client_test.go b/validator/keymanager/remote-web3signer/internal/client_test.go index 71a482baef52..b3048077a854 100644 --- a/validator/keymanager/remote-web3signer/internal/client_test.go +++ b/validator/keymanager/remote-web3signer/internal/client_test.go @@ -153,24 +153,7 @@ func TestClient_GetPublicKeys_HappyPath(t *testing.T) { assert.NotNil(t, resp) assert.Nil(t, err) // we would like them as 48byte base64 without 0x - assert.EqualValues(t, "[162 181 170 173 156 110 254 254 123 185 177 36 58 4 52 4 243 54 41 55 207 182 179 24 51 146 152 51 23 63 71 102 48 234 44 254 176 217 221 241 95 151 202 134 133 148 136 32]", fmt.Sprintf("%v", resp[0][:])) -} - -func TestClient_GetPublicKeys_EncodingError(t *testing.T) { - // public keys are returned hex encoded with 0x - j := `["a2b5aaad9c6efefe7bb9b1243a043404f3362937c","fb6b31833929833173f476630ea2cfe","b0d9ddf15fca8685948820"]` - // create a new reader with that JSON - r := io.NopCloser(bytes.NewReader([]byte(j))) - mock := &mockTransport{mockResponse: &http.Response{ - StatusCode: 200, - Body: r, - }} - u, err := url.Parse("example.com") - assert.NoError(t, err) - cl := internal.ApiClient{BaseURL: u, RestClient: &http.Client{Transport: mock}} - resp, err := cl.GetPublicKeys(context.Background(), "example.com/api/publickeys") - assert.Equal(t, err.Error(), "failed to decode from Hex from the following public key index locations: 0, 1, 2, ") - assert.Nil(t, resp) + require.Equal(t, "[0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820]", fmt.Sprintf("%v", resp)) } // TODO: not really in use, should be revisited diff --git a/validator/keymanager/remote-web3signer/keymanager.go b/validator/keymanager/remote-web3signer/keymanager.go index c213abbb00c3..0da752d72806 100644 --- a/validator/keymanager/remote-web3signer/keymanager.go +++ b/validator/keymanager/remote-web3signer/keymanager.go @@ -1,13 +1,19 @@ package remote_web3signer import ( - "bytes" + "bufio" "context" "encoding/json" "fmt" + "os" "path/filepath" + "slices" + "strings" + "sync" + "time" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/fsnotify/fsnotify" "github.com/go-playground/validator/v10" "github.com/logrusorgru/aurora" "github.com/pkg/errors" @@ -15,18 +21,27 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/io/file" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/validator/accounts/petnames" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer/internal" web3signerv1 "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer/v1" - log "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus" + "go.opencensus.io/trace" + "golang.org/x/exp/maps" +) + +const ( + maxRetries = 60 + retryDelay = 10 * time.Second ) // SetupConfig includes configuration values for initializing. // a keymanager, such as passwords, the wallet, and more. // Web3Signer contains one public keys option. Either through a URL or a static key list. type SetupConfig struct { + KeyFilePath string BaseEndpoint string GenesisValidatorsRoot []byte @@ -38,22 +53,26 @@ type SetupConfig struct { // Either URL or keylist must be set. // a static list of public keys to be passed by the user to determine what accounts should sign. // This will provide a layer of safety against slashing if the web3signer is shared across validators. - ProvidedPublicKeys [][48]byte + ProvidedPublicKeys []string } // Keymanager defines the web3signer keymanager. type Keymanager struct { client internal.HttpSignerClient genesisValidatorsRoot []byte - publicKeysURL string - providedPublicKeys [][48]byte + providedPublicKeys [][48]byte // (source of truth) flag loaded + file loaded + api loaded keys + flagLoadedKeysMap map[string][48]byte // stores what was provided from flag ( as opposed to from file ) accountsChangedFeed *event.Feed validator *validator.Validate - publicKeysUrlCalled bool + retriesRemaining int + keyFilePath string + lock sync.RWMutex } // NewKeymanager instantiates a new web3signer key manager. -func NewKeymanager(_ context.Context, cfg *SetupConfig) (*Keymanager, error) { +func NewKeymanager(ctx context.Context, cfg *SetupConfig) (*Keymanager, error) { + ctx, span := trace.StartSpan(ctx, "remote-keymanager.NewKeymanager") + defer span.End() if cfg.BaseEndpoint == "" || !bytesutil.IsValidRoot(cfg.GenesisValidatorsRoot) { return nil, fmt.Errorf("invalid setup config, one or more configs are empty: BaseEndpoint: %v, GenesisValidatorsRoot: %#x", cfg.BaseEndpoint, cfg.GenesisValidatorsRoot) } @@ -61,31 +80,297 @@ func NewKeymanager(_ context.Context, cfg *SetupConfig) (*Keymanager, error) { if err != nil { return nil, errors.Wrap(err, "could not create apiClient") } - return &Keymanager{ + + km := &Keymanager{ client: internal.HttpSignerClient(client), genesisValidatorsRoot: cfg.GenesisValidatorsRoot, accountsChangedFeed: new(event.Feed), - publicKeysURL: cfg.PublicKeysURL, - providedPublicKeys: cfg.ProvidedPublicKeys, validator: validator.New(), - publicKeysUrlCalled: false, - }, nil -} + retriesRemaining: maxRetries, + keyFilePath: cfg.KeyFilePath, + } -// FetchValidatingPublicKeys fetches the validating public keys -// from the remote server or from the provided keys if there are no existing public keys set -// or provides the existing keys in the keymanager. -func (km *Keymanager) FetchValidatingPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) { - if km.publicKeysURL != "" && !km.publicKeysUrlCalled { - providedPublicKeys, err := km.client.GetPublicKeys(ctx, km.publicKeysURL) + keyFileExists := false + if km.keyFilePath != "" { + keyFileExists, err = file.Exists(km.keyFilePath, file.Regular) + if err != nil { + return nil, errors.Wrapf(err, "could not check if remote signer persistent keys exist in %s", km.keyFilePath) + } + if !keyFileExists { + return nil, fmt.Errorf("no file exists in remote signer key file path %s", km.keyFilePath) + } + } + + var ppk []string + // load key values + if cfg.PublicKeysURL != "" { + providedPublicKeys, err := km.client.GetPublicKeys(ctx, cfg.PublicKeysURL) if err != nil { erroredResponsesTotal.Inc() - return nil, errors.Wrap(err, fmt.Sprintf("could not get public keys from remote server url: %v", km.publicKeysURL)) + return nil, errors.Wrapf(err, "could not get public keys from remote server URL %v", cfg.PublicKeysURL) + } + ppk = providedPublicKeys + } else if len(cfg.ProvidedPublicKeys) != 0 { + ppk = cfg.ProvidedPublicKeys + } + + // use a map to remove duplicates + flagLoadedKeys := make(map[string][48]byte) + + // Populate the map with existing keys + for _, key := range ppk { + decodedKey, err := hexutil.Decode(key) + if err != nil { + return nil, errors.Wrapf(err, "could not decode public key %s", key) + } + if len(decodedKey) != fieldparams.BLSPubkeyLength { + return nil, fmt.Errorf("public key %s has invalid length (expected %d, got %d)", decodedKey, fieldparams.BLSPubkeyLength, len(decodedKey)) + } + flagLoadedKeys[key] = bytesutil.ToBytes48(decodedKey) + } + km.flagLoadedKeysMap = flagLoadedKeys + + // load from file + if keyFileExists { + log.WithField("file", km.keyFilePath).Info("Loading keys from file") + _, fileKeys, err := km.readKeyFile() + if err != nil { + return nil, errors.Wrap(err, "could not read key file") + } + if len(flagLoadedKeys) != 0 { + log.WithField("flagLoadedKeyCount", len(flagLoadedKeys)).WithField("fileLoadedKeyCount", len(fileKeys)).Info("Combining flag loaded keys and file loaded keys.") + maps.Copy(fileKeys, flagLoadedKeys) + if err = km.savePublicKeysToFile(fileKeys); err != nil { + return nil, errors.Wrap(err, "could not save public keys to file") + } + } + km.lock.Lock() + km.providedPublicKeys = maps.Values(fileKeys) + km.lock.Unlock() + // create a file watcher + go func() { + err = km.refreshRemoteKeysFromFileChangesWithRetry(ctx, retryDelay) + if err != nil { + log.WithError(err).Error("Could not refresh remote keys from file changes") + } + }() + } else { + km.lock.Lock() + km.providedPublicKeys = maps.Values(flagLoadedKeys) + km.lock.Unlock() + } + + return km, nil +} + +func (km *Keymanager) refreshRemoteKeysFromFileChangesWithRetry(ctx context.Context, retryDelay time.Duration) error { + if ctx.Err() != nil { + return ctx.Err() + } + if km.retriesRemaining == 0 { + return errors.New("file check retries remaining exceeded") + } + err := km.refreshRemoteKeysFromFileChanges(ctx) + if err != nil { + km.updatePublicKeys(maps.Values(km.flagLoadedKeysMap)) // update the keys to flag provided defaults + km.retriesRemaining-- + log.WithError(err).Debug("Error occurred on key refresh") + log.WithFields(logrus.Fields{"path": km.keyFilePath, "retriesRemaining": km.retriesRemaining, "retryDelay": retryDelay}).Warnf("Could not refresh keys. Retrying...") + time.Sleep(retryDelay) + return km.refreshRemoteKeysFromFileChangesWithRetry(ctx, retryDelay) + } + return nil +} + +func (km *Keymanager) readKeyFile() ([][48]byte, map[string][48]byte, error) { + km.lock.RLock() + defer km.lock.RUnlock() + + if km.keyFilePath == "" { + return nil, nil, errors.New("no key file path provided") + } + f, err := os.Open(filepath.Clean(km.keyFilePath)) + if err != nil { + return nil, nil, errors.Wrap(err, "could not open remote signer public key file") + } + defer func() { + if err := f.Close(); err != nil { + log.WithError(err).Error("Could not close remote signer public key file") + } + }() + // Use a map to track and skip duplicate lines + seenKeys := make(map[string][48]byte) + scanner := bufio.NewScanner(f) + var keys [][48]byte + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + pubkeyLength := (fieldparams.BLSPubkeyLength * 2) + 2 + if line == "" { + // skip empty line + continue + } + // allow for pubkeys without the 0x + if len(line) == pubkeyLength-2 && !strings.HasPrefix(line, "0x") { + line = "0x" + line + } + if len(line) != pubkeyLength { + log.WithFields(logrus.Fields{ + "filepath": km.keyFilePath, + "key": line, + }).Error("Invalid public key in remote signer key file") + continue + } + if _, found := seenKeys[line]; !found { + // If it's a new line, mark it as seen and process it + pubkey, err := hexutil.Decode(line) + if err != nil { + return nil, nil, errors.Wrapf(err, "could not decode public key %s in remote signer key file", line) + } + bPubkey := bytesutil.ToBytes48(pubkey) + seenKeys[line] = bPubkey + keys = append(keys, bPubkey) + } + } + // Check for scanning errors + if err := scanner.Err(); err != nil { + return nil, nil, errors.Wrap(err, "could not scan remote signer public key file") + } + if len(keys) == 0 { + log.Warn("Remote signer key file: no valid public keys found. Defaulting to flag provided keys if any exist.") + } + return keys, seenKeys, nil +} + +func (km *Keymanager) savePublicKeysToFile(providedPublicKeys map[string][48]byte) error { + if km.keyFilePath == "" { + return errors.New("no key file provided") + } + pubkeys := make([][48]byte, 0) + // Open the file with write and truncate permissions + f, err := os.OpenFile(km.keyFilePath, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0600) + if err != nil { + return fmt.Errorf("failed to open file: %w", err) + } + defer func(f *os.File) { + err := f.Close() + if err != nil { + log.WithError(err).Error("Could not close file, proceeding without closing the file") + } + }(f) + + // Iterate through all lines in the slice and write them to the file + for key, value := range providedPublicKeys { + if _, err := f.WriteString(key + "\n"); err != nil { + return fmt.Errorf("error writing key %s to file: %w", value, err) + } + pubkeys = append(pubkeys, value) + } + km.updatePublicKeys(pubkeys) + return nil +} + +func (km *Keymanager) arePublicKeysEmpty() bool { + km.lock.RLock() + defer km.lock.RUnlock() + return len(km.providedPublicKeys) == 0 +} + +func (km *Keymanager) refreshRemoteKeysFromFileChanges(ctx context.Context) error { + watcher, err := fsnotify.NewWatcher() + if err != nil { + return errors.Wrap(err, "could not initialize file watcher") + } + defer func() { + if err := watcher.Close(); err != nil { + log.WithError(err).Error("Could not close file watcher") } - // makes sure that if the public keys are deleted the validator does not call URL again. - km.publicKeysUrlCalled = true - km.providedPublicKeys = providedPublicKeys + }() + initialFileInfo, err := os.Stat(km.keyFilePath) + if err != nil { + return errors.Wrap(err, "could not stat remote signer public key file") } + initialFileSize := initialFileInfo.Size() + if err := watcher.Add(km.keyFilePath); err != nil { + return errors.Wrap(err, "could not add file to file watcher") + } + log.WithField("path", km.keyFilePath).Info("Successfully initialized file watcher") + km.retriesRemaining = maxRetries // reset retries to default + // reinitialize keys if watcher reinitialized + if km.arePublicKeysEmpty() { + _, fk, err := km.readKeyFile() + if err != nil { + return errors.Wrap(err, "could not read key file") + } + maps.Copy(fk, km.flagLoadedKeysMap) + if err = km.savePublicKeysToFile(fk); err != nil { + return errors.Wrap(err, "could not save public keys to file") + } + km.updatePublicKeys(maps.Values(fk)) + } + for { + select { + case e, ok := <-watcher.Events: + if !ok { // Channel was closed (i.e. Watcher.Close() was called). + log.Info("Closing file watcher") + return nil + } + log.WithFields(logrus.Fields{ + "event": e.Name, + "op": e.Op.String(), + }).Debug("Remote signer key file event triggered") + if e.Has(fsnotify.Remove) { + return errors.New("remote signer key file was removed") + } + currentFileInfo, err := os.Stat(km.keyFilePath) + if err != nil { + return errors.Wrap(err, "could not stat remote signer public key file") + } + if currentFileInfo.Size() != initialFileSize { + log.Info("Remote signer key file updated") + fileKeys, _, err := km.readKeyFile() + if err != nil { + return errors.New("could not read key file") + } + // prioritize file keys over flag keys + if len(fileKeys) == 0 { + log.Warnln("Remote signer key file no longer has keys, defaulting to flag provided keys") + fileKeys = maps.Values(km.flagLoadedKeysMap) + } + currentKeys, err := km.FetchValidatingPublicKeys(ctx) + if err != nil { + return errors.Wrap(err, "could not fetch current keys") + } + if !slices.Equal(currentKeys, fileKeys) { + km.updatePublicKeys(fileKeys) + } + initialFileSize = currentFileInfo.Size() + } + case err, ok := <-watcher.Errors: + if !ok { // Channel was closed (i.e. Watcher.Close() was called). + log.Info("Closing file watcher") + return nil + } + return errors.Wrap(err, "could not watch for file changes") + case <-ctx.Done(): + log.Info("Closing file watcher") + return nil + } + } +} + +func (km *Keymanager) updatePublicKeys(keys [][48]byte) { + km.lock.Lock() + defer km.lock.Unlock() + km.providedPublicKeys = keys + km.accountsChangedFeed.Send(keys) + log.WithField("count", len(km.providedPublicKeys)).Debug("Updated public keys") +} + +// FetchValidatingPublicKeys fetches the validating public keys +func (km *Keymanager) FetchValidatingPublicKeys(_ context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) { + km.lock.RLock() + defer km.lock.RUnlock() + log.WithField("count", len(km.providedPublicKeys)).Debug("Fetched validating public keys") return km.providedPublicKeys, nil } @@ -96,10 +381,14 @@ func (km *Keymanager) Sign(ctx context.Context, request *validatorpb.SignRequest erroredResponsesTotal.Inc() return nil, err } - + signature, err := km.client.Sign(ctx, hexutil.Encode(request.PublicKey), signRequest) + if err != nil { + erroredResponsesTotal.Inc() + return nil, errors.Wrap(err, "failed to sign the request") + } + log.WithField("publicKey", request.PublicKey).Debug("Successfully signed the request") signRequestsTotal.Inc() - - return km.client.Sign(ctx, hexutil.Encode(request.PublicKey), signRequest) + return signature, nil } // getSignRequestJson returns a json request based on the SignRequest type. @@ -420,10 +709,21 @@ func DisplayRemotePublicKeys(validatingPubKeys [][48]byte) { } // AddPublicKeys imports a list of public keys into the keymanager for web3signer use. Returns status with message. -func (km *Keymanager) AddPublicKeys(pubKeys []string) []*keymanager.KeyStatus { +func (km *Keymanager) AddPublicKeys(pubKeys []string) ([]*keymanager.KeyStatus, error) { importedRemoteKeysStatuses := make([]*keymanager.KeyStatus, len(pubKeys)) + // Using a map to track both existing and new public keys efficiently + combinedKeys := make(map[string][48]byte) + + // Populate the map with existing keys + km.lock.RLock() + originalKeysLen := len(km.providedPublicKeys) + for _, key := range km.providedPublicKeys { + encodedKey := hexutil.Encode(key[:]) + combinedKeys[encodedKey] = key + } + km.lock.RUnlock() + for i, pubkey := range pubKeys { - found := false pubkeyBytes, err := hexutil.Decode(pubkey) if err != nil { importedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ @@ -439,76 +739,103 @@ func (km *Keymanager) AddPublicKeys(pubKeys []string) []*keymanager.KeyStatus { } continue } - for _, key := range km.providedPublicKeys { - if bytes.Equal(key[:], pubkeyBytes) { - found = true - break - } - } - if found { + + encodedPubkey := hexutil.Encode(pubkeyBytes) + if _, exists := combinedKeys[encodedPubkey]; exists { importedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ Status: keymanager.StatusDuplicate, Message: fmt.Sprintf("Duplicate pubkey: %v, already in use", pubkey), } continue } - km.providedPublicKeys = append(km.providedPublicKeys, bytesutil.ToBytes48(pubkeyBytes)) + + // Add the new key to the map + combinedKeys[encodedPubkey] = bytesutil.ToBytes48(pubkeyBytes) importedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ Status: keymanager.StatusImported, Message: fmt.Sprintf("Successfully added pubkey: %v", pubkey), } log.Debug("Added pubkey to keymanager for web3signer", "pubkey", pubkey) } - km.accountsChangedFeed.Send(km.providedPublicKeys) - return importedRemoteKeysStatuses + + if originalKeysLen != len(combinedKeys) { + if km.keyFilePath != "" { + if err := km.savePublicKeysToFile(combinedKeys); err != nil { + return nil, err + } + } else { + km.updatePublicKeys(maps.Values(combinedKeys)) + } + } + + return importedRemoteKeysStatuses, nil } // DeletePublicKeys removes a list of public keys from the keymanager for web3signer use. Returns status with message. -func (km *Keymanager) DeletePublicKeys(pubKeys []string) []*keymanager.KeyStatus { - deletedRemoteKeysStatuses := make([]*keymanager.KeyStatus, len(pubKeys)) - if len(km.providedPublicKeys) == 0 { +func (km *Keymanager) DeletePublicKeys(publicKeys []string) ([]*keymanager.KeyStatus, error) { + deletedRemoteKeysStatuses := make([]*keymanager.KeyStatus, len(publicKeys)) + // Using a map to track both existing and new public keys efficiently + combinedKeys := make(map[string][48]byte) + km.lock.RLock() + originalKeysLen := len(km.providedPublicKeys) + if originalKeysLen == 0 { for i := range deletedRemoteKeysStatuses { deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ Status: keymanager.StatusNotFound, Message: "No pubkeys are set in validator", } } - return deletedRemoteKeysStatuses + return deletedRemoteKeysStatuses, nil } - for i, pubkey := range pubKeys { - for in, key := range km.providedPublicKeys { - pubkeyBytes, err := hexutil.Decode(pubkey) - if err != nil { - deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ - Status: keymanager.StatusError, - Message: err.Error(), - } - continue - } - if len(pubkeyBytes) != fieldparams.BLSPubkeyLength { - deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ - Status: keymanager.StatusError, - Message: fmt.Sprintf("pubkey byte length (%d) did not match bls pubkey byte length (%d)", len(pubkeyBytes), fieldparams.BLSPubkeyLength), - } - continue + + // Populate the map with existing keys + for _, key := range km.providedPublicKeys { + encodedKey := hexutil.Encode(key[:]) + combinedKeys[encodedKey] = key + } + km.lock.RUnlock() + + for i, pubkey := range publicKeys { + pubkeyBytes, err := hexutil.Decode(pubkey) + if err != nil { + deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ + Status: keymanager.StatusError, + Message: err.Error(), } - if bytes.Equal(key[:], pubkeyBytes) { - km.providedPublicKeys = append(km.providedPublicKeys[:in], km.providedPublicKeys[in+1:]...) - deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ - Status: keymanager.StatusDeleted, - Message: fmt.Sprintf("Successfully deleted pubkey: %v", pubkey), - } - log.Debug("Deleted pubkey from keymanager for web3signer", "pubkey", pubkey) - break + continue + } + if len(pubkeyBytes) != fieldparams.BLSPubkeyLength { + deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ + Status: keymanager.StatusError, + Message: fmt.Sprintf("pubkey byte length (%d) did not match bls pubkey byte length (%d)", len(pubkeyBytes), fieldparams.BLSPubkeyLength), } + continue } - if deletedRemoteKeysStatuses[i] == nil { + _, exists := combinedKeys[pubkey] + if !exists { deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ Status: keymanager.StatusNotFound, Message: fmt.Sprintf("Pubkey: %v not found", pubkey), } + continue + } + delete(combinedKeys, pubkey) + deletedRemoteKeysStatuses[i] = &keymanager.KeyStatus{ + Status: keymanager.StatusDeleted, + Message: fmt.Sprintf("Successfully deleted pubkey: %v", pubkey), + } + log.WithField("pubkey", pubkey).Debug("Deleted pubkey from keymanager for remote signer") + } + + if originalKeysLen != len(combinedKeys) { + if km.keyFilePath != "" { + if err := km.savePublicKeysToFile(combinedKeys); err != nil { + return nil, err + } + } else { + km.updatePublicKeys(maps.Values(combinedKeys)) } } - km.accountsChangedFeed.Send(km.providedPublicKeys) - return deletedRemoteKeysStatuses + + return deletedRemoteKeysStatuses, nil } diff --git a/validator/keymanager/remote-web3signer/keymanager_test.go b/validator/keymanager/remote-web3signer/keymanager_test.go index aee8a4e5155e..9d47eda75359 100644 --- a/validator/keymanager/remote-web3signer/keymanager_test.go +++ b/validator/keymanager/remote-web3signer/keymanager_test.go @@ -1,20 +1,29 @@ package remote_web3signer import ( + "bytes" "context" - "encoding/hex" + "encoding/json" "fmt" - "strings" + "net/http" + "net/http/httptest" + "os" + "path" + "path/filepath" + "slices" "testing" + "time" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/io/file" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer/internal" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer/v1/mock" + logTest "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" ) @@ -31,19 +40,319 @@ func (mc *MockClient) Sign(_ context.Context, _ string, _ internal.SignRequestJs } return bls.SignatureFromBytes(decoded) } -func (mc *MockClient) GetPublicKeys(_ context.Context, _ string) ([][48]byte, error) { - var keys [][48]byte - for _, pk := range mc.PublicKeys { - decoded, err := hex.DecodeString(strings.TrimPrefix(pk, "0x")) - if err != nil { - return nil, err - } - keys = append(keys, bytesutil.ToBytes48(decoded)) - } - if mc.isThrowingError { - return nil, fmt.Errorf("mock error") - } - return keys, nil +func (mc *MockClient) GetPublicKeys(_ context.Context, _ string) ([]string, error) { + return mc.PublicKeys, nil +} + +func TestNewKeymanager(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Header().Set("Content-Type", "application/json") + err := json.NewEncoder(w).Encode([]string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}) + require.NoError(t, err) + })) + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + if err != nil { + fmt.Printf("error: %v", err) + } + tests := []struct { + name string + args *SetupConfig + fileContents []string + want []string + wantErr string + wantLog string + }{ + { + name: "happy path public key url", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + PublicKeysURL: srv.URL + "/public_keys", + }, + want: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, + }, + { + name: "bad public key url", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + PublicKeysURL: "0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69", + }, + wantErr: "could not get public keys from remote server URL", + }, + { + name: "happy path provided public keys", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, + }, + want: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, + }, + { + name: "path provided public keys, some bad key", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820", "http://prysm.xyz/"}, + }, + wantErr: "could not decode public key", + }, + { + name: "path provided public keys, some bad hex for key", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937"}, + }, + wantErr: "has invalid length", + }, + { + name: "happy path key file", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + KeyFilePath: filepath.Join(t.TempDir(), "good_keyfile.txt"), + }, + fileContents: []string{"8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", "0x800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be"}, + want: []string{"0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", "0x800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be"}, + }, + { + name: "happy path public key url with good keyfile", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + PublicKeysURL: srv.URL + "/public_keys", + KeyFilePath: filepath.Join(t.TempDir(), "good_keyfile.txt"), + }, + fileContents: []string{"0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", "800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be"}, + want: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820", "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", "0x800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be"}, + }, + { + name: "happy path provided public keys with good keyfile", + args: &SetupConfig{ + BaseEndpoint: "http://prysm.xyz/", + GenesisValidatorsRoot: root, + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, + }, + want: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820", "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", "0x800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + logHook := logTest.NewGlobal() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + if tt.args.KeyFilePath != "" && len(tt.fileContents) != 0 { + bytesBuf := new(bytes.Buffer) + for _, content := range tt.fileContents { + _, err := bytesBuf.WriteString(content) // test without 0x + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + } + err = file.WriteFile(tt.args.KeyFilePath, bytesBuf.Bytes()) + require.NoError(t, err) + } + + km, err := NewKeymanager(ctx, tt.args) + if tt.wantLog != "" { + require.LogsContain(t, logHook, tt.wantLog) + } + if tt.wantErr != "" { + require.ErrorContains(t, tt.wantErr, err) + return + } + keys := make([]string, len(km.providedPublicKeys)) + for i, key := range km.providedPublicKeys { + keys[i] = hexutil.Encode(key[:]) + require.Equal(t, true, slices.Contains(tt.want, keys[i])) + } + }) + } +} + +func TestNewKeyManager_fileMissing(t *testing.T) { + keyFilePath := filepath.Join(t.TempDir(), "keyfile.txt") + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + require.NoError(t, err) + _, err = NewKeymanager(context.TODO(), &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + KeyFilePath: keyFilePath, + ProvidedPublicKeys: []string{"0x800077e04f8d7496099b3d30ac5430aea64873a45e5bcfe004d2095babcbf55e21138ff0d5691abc29da190aa32755c6"}, + }) + require.ErrorContains(t, "no file exists in remote signer key file path", err) +} + +func TestNewKeyManager_ChangingFileCreated(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + keyFilePath := filepath.Join(t.TempDir(), "keyfile.txt") + bytesBuf := new(bytes.Buffer) + _, err := bytesBuf.WriteString("8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055") // test without 0x + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + _, err = bytesBuf.WriteString("0x800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be") + require.NoError(t, err) + _, err = bytesBuf.WriteString("\n") + require.NoError(t, err) + err = file.WriteFile(keyFilePath, bytesBuf.Bytes()) + require.NoError(t, err) + + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + require.NoError(t, err) + km, err := NewKeymanager(ctx, &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + KeyFilePath: keyFilePath, + ProvidedPublicKeys: []string{"0x800077e04f8d7496099b3d30ac5430aea64873a45e5bcfe004d2095babcbf55e21138ff0d5691abc29da190aa32755c6"}, + }) + require.NoError(t, err) + wantSlice := []string{"0x800077e04f8d7496099b3d30ac5430aea64873a45e5bcfe004d2095babcbf55e21138ff0d5691abc29da190aa32755c6", "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", "0x800057e262bfe42413c2cfce948ff77f11efeea19721f590c8b5b2f32fecb0e164cafba987c80465878408d05b97c9be"} + keys := make([]string, len(km.providedPublicKeys)) + require.Equal(t, 3, len(km.providedPublicKeys)) + for i, key := range km.providedPublicKeys { + keys[i] = hexutil.Encode(key[:]) + require.Equal(t, slices.Contains(wantSlice, keys[i]), true) + } + // sleep needs to be at the front because of how watching the file works + time.Sleep(1 * time.Second) + + // Open the file for writing, create it if it does not exist, and truncate it if it does. + f, err := os.OpenFile(keyFilePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) + require.NoError(t, err) + + // Write the buffer's contents to the file. + _, err = f.WriteString("0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055") + require.NoError(t, err) + require.NoError(t, f.Sync()) + require.NoError(t, f.Close()) + + ks, _, err := km.readKeyFile() + require.NoError(t, err) + require.Equal(t, 1, len(ks)) + require.Equal(t, "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", hexutil.Encode(ks[0][:])) + + require.Equal(t, 1, len(km.providedPublicKeys)) + require.Equal(t, "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055", hexutil.Encode(km.providedPublicKeys[0][:])) +} + +func TestNewKeyManager_FileAndFlagsWithDifferentKeys(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + logHook := logTest.NewGlobal() + keyFilePath := filepath.Join(t.TempDir(), "keyfile.txt") + bytesBuf := new(bytes.Buffer) + _, err := bytesBuf.WriteString("8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055") // test without 0x + require.NoError(t, err) + err = file.WriteFile(keyFilePath, bytesBuf.Bytes()) + require.NoError(t, err) + + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + require.NoError(t, err) + km, err := NewKeymanager(ctx, &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + KeyFilePath: keyFilePath, + ProvidedPublicKeys: []string{"0x800077e04f8d7496099b3d30ac5430aea64873a45e5bcfe004d2095babcbf55e21138ff0d5691abc29da190aa32755c6"}, + }) + require.NoError(t, err) + wantSlice := []string{"0x800077e04f8d7496099b3d30ac5430aea64873a45e5bcfe004d2095babcbf55e21138ff0d5691abc29da190aa32755c6", + "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055"} + // provided public keys are saved to the file + keys, _, err := km.readKeyFile() + require.NoError(t, err) + for _, key := range keys { + require.Equal(t, slices.Contains(wantSlice, hexutil.Encode(key[:])), true) + } + // wait for reading to be done + time.Sleep(2 * time.Second) + // test fall back by clearing file + go func() { + err = file.WriteFile(keyFilePath, []byte(" ")) + require.NoError(t, err) + }() + // waiting for writing to be done + time.Sleep(2 * time.Second) + require.LogsContain(t, logHook, "Remote signer key file no longer has keys, defaulting to flag provided keys") + + // fall back to flag provided keys + keys, err = km.FetchValidatingPublicKeys(context.TODO()) + require.NoError(t, err) + require.Equal(t, 1, len(keys)) + require.Equal(t, "0x800077e04f8d7496099b3d30ac5430aea64873a45e5bcfe004d2095babcbf55e21138ff0d5691abc29da190aa32755c6", hexutil.Encode(keys[0][:])) +} + +func TestRefreshRemoteKeysFromFileChangesWithRetry(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + logHook := logTest.NewGlobal() + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + require.NoError(t, err) + keyFilePath := filepath.Join(t.TempDir(), "keyfile.txt") + + require.NoError(t, err) + km, err := NewKeymanager(ctx, &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + }) + require.NoError(t, err) + go func() { + km.keyFilePath = keyFilePath + require.NoError(t, km.refreshRemoteKeysFromFileChangesWithRetry(ctx, 1*time.Second)) + }() + // wait for file detection + time.Sleep(1 * time.Second) + require.LogsContain(t, logHook, "Could not refresh keys") + go func() { + bytesBuf := new(bytes.Buffer) + _, err = bytesBuf.WriteString("8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055") // test without 0x + require.NoError(t, err) + err = file.WriteFile(keyFilePath, bytesBuf.Bytes()) + require.NoError(t, err) + }() + // wait for file write to reinitialize + time.Sleep(2 * time.Second) + cancel() + require.LogsContain(t, logHook, "Successfully initialized file watcher") + keys, err := km.FetchValidatingPublicKeys(ctx) + require.NoError(t, err) + require.Equal(t, 1, len(keys)) +} + +func TestReadKeyFile_PathMissing(t *testing.T) { + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + require.NoError(t, err) + + require.NoError(t, err) + km, err := NewKeymanager(context.TODO(), &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + }) + require.NoError(t, err) + _, _, err = km.readKeyFile() + require.ErrorContains(t, "no key file path provided", err) +} + +func TestRefreshRemoteKeysFromFileChangesWithRetry_maxRetryReached(t *testing.T) { + ctx := context.Background() + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + require.NoError(t, err) + keyFilePath := filepath.Join(t.TempDir(), "keyfile.txt") + + require.NoError(t, err) + km, err := NewKeymanager(ctx, &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + }) + require.NoError(t, err) + km.keyFilePath = keyFilePath + km.retriesRemaining = 1 + err = km.refreshRemoteKeysFromFileChangesWithRetry(ctx, 1*time.Millisecond) + require.ErrorContains(t, "file check retries remaining exceeded", err) } func TestKeymanager_Sign(t *testing.T) { @@ -187,20 +496,16 @@ func TestKeymanager_Sign(t *testing.T) { func TestKeymanager_FetchValidatingPublicKeys_HappyPath_WithKeyList(t *testing.T) { ctx := context.Background() decodedKey, err := hexutil.Decode("0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820") - if err != nil { - fmt.Printf("error: %v", err) - } + require.NoError(t, err) keys := [][48]byte{ bytesutil.ToBytes48(decodedKey), } root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") - if err != nil { - fmt.Printf("error: %v", err) - } + require.NoError(t, err) config := &SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - ProvidedPublicKeys: keys, + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, } km, err := NewKeymanager(ctx, config) if err != nil { @@ -217,9 +522,6 @@ func TestKeymanager_FetchValidatingPublicKeys_HappyPath_WithKeyList(t *testing.T func TestKeymanager_FetchValidatingPublicKeys_HappyPath_WithExternalURL(t *testing.T) { ctx := context.Background() - client := &MockClient{ - PublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, - } decodedKey, err := hexutil.Decode("0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820") if err != nil { fmt.Printf("error: %v", err) @@ -231,31 +533,53 @@ func TestKeymanager_FetchValidatingPublicKeys_HappyPath_WithExternalURL(t *testi if err != nil { fmt.Printf("error: %v", err) } + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Header().Set("Content-Type", "application/json") + err = json.NewEncoder(w).Encode([]string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}) + require.NoError(t, err) + })) + defer srv.Close() config := &SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - PublicKeysURL: "http://example2.com/api/v1/eth2/publicKeys", + PublicKeysURL: srv.URL + "/api/v1/eth2/publicKeys", } km, err := NewKeymanager(ctx, config) if err != nil { fmt.Printf("error: %v", err) } - km.client = client resp, err := km.FetchValidatingPublicKeys(ctx) - if err != nil { - fmt.Printf("error: %v", err) - } + require.NoError(t, err) assert.NotNil(t, resp) - assert.Nil(t, err) assert.EqualValues(t, resp, keys) } func TestKeymanager_FetchValidatingPublicKeys_WithExternalURL_ThrowsError(t *testing.T) { ctx := context.Background() - client := &MockClient{ - PublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, - isThrowingError: true, + + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + http.Error(w, "mock error", http.StatusInternalServerError) + })) + defer srv.Close() + + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + if err != nil { + fmt.Printf("error: %v", err) } + config := &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + PublicKeysURL: srv.URL + "/api/v1/eth2/publicKeys", + } + km, err := NewKeymanager(ctx, config) + require.ErrorContains(t, fmt.Sprintf("could not get public keys from remote server URL %s/api/v1/eth2/publicKeys", srv.URL), err) + assert.Nil(t, km) +} + +func TestKeymanager_AddPublicKeys(t *testing.T) { + ctx := context.Background() root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") if err != nil { fmt.Printf("error: %v", err) @@ -263,21 +587,32 @@ func TestKeymanager_FetchValidatingPublicKeys_WithExternalURL_ThrowsError(t *tes config := &SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - PublicKeysURL: "http://example2.com/api/v1/eth2/publicKeys", } km, err := NewKeymanager(ctx, config) if err != nil { fmt.Printf("error: %v", err) } - km.client = client - resp, err := km.FetchValidatingPublicKeys(ctx) - assert.NotNil(t, err) - assert.Nil(t, resp) - assert.Equal(t, "could not get public keys from remote server url: http://example2.com/api/v1/eth2/publicKeys: mock error", fmt.Sprintf("%v", err)) + publicKeys := []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"} + statuses, err := km.AddPublicKeys(publicKeys) + require.NoError(t, err) + for _, status := range statuses { + require.Equal(t, keymanager.StatusImported, status.Status) + } + statuses, err = km.AddPublicKeys(publicKeys) + require.NoError(t, err) + for _, status := range statuses { + require.Equal(t, keymanager.StatusDuplicate, status.Status) + } } -func TestKeymanager_AddPublicKeys(t *testing.T) { - ctx := context.Background() +func TestKeymanager_AddPublicKeys_WithFile(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + dir := t.TempDir() + stdOutFile, err := os.Create(filepath.Clean(path.Join(dir, "keyfile.txt"))) + require.NoError(t, err) + require.NoError(t, stdOutFile.Chmod(os.FileMode(0600))) + keyFilePath := filepath.Join(dir, "keyfile.txt") root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") if err != nil { fmt.Printf("error: %v", err) @@ -285,20 +620,27 @@ func TestKeymanager_AddPublicKeys(t *testing.T) { config := &SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, + KeyFilePath: keyFilePath, } km, err := NewKeymanager(ctx, config) if err != nil { fmt.Printf("error: %v", err) } publicKeys := []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"} - statuses := km.AddPublicKeys(publicKeys) + statuses, err := km.AddPublicKeys(publicKeys) + require.NoError(t, err) for _, status := range statuses { require.Equal(t, keymanager.StatusImported, status.Status) } - statuses = km.AddPublicKeys(publicKeys) + statuses, err = km.AddPublicKeys(publicKeys) + require.NoError(t, err) for _, status := range statuses { require.Equal(t, keymanager.StatusDuplicate, status.Status) } + keys, _, err := km.readKeyFile() + require.NoError(t, err) + require.Equal(t, len(keys), len(publicKeys)) + require.Equal(t, hexutil.Encode(keys[0][:]), publicKeys[0]) } func TestKeymanager_DeletePublicKeys(t *testing.T) { @@ -316,18 +658,66 @@ func TestKeymanager_DeletePublicKeys(t *testing.T) { fmt.Printf("error: %v", err) } publicKeys := []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"} - statuses := km.AddPublicKeys(publicKeys) + statuses, err := km.AddPublicKeys(publicKeys) + require.NoError(t, err) + for _, status := range statuses { + require.Equal(t, keymanager.StatusImported, status.Status) + } + + s, err := km.DeletePublicKeys(publicKeys) + require.NoError(t, err) + for _, status := range s { + require.Equal(t, keymanager.StatusDeleted, status.Status) + } + + s, err = km.DeletePublicKeys(publicKeys) + require.NoError(t, err) + for _, status := range s { + require.Equal(t, keymanager.StatusNotFound, status.Status) + } +} + +func TestKeymanager_DeletePublicKeys_WithFile(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + dir := t.TempDir() + stdOutFile, err := os.Create(filepath.Clean(path.Join(dir, "keyfile.txt"))) + require.NoError(t, err) + require.NoError(t, stdOutFile.Chmod(os.FileMode(0600))) + keyFilePath := filepath.Join(dir, "keyfile.txt") + root, err := hexutil.Decode("0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69") + if err != nil { + fmt.Printf("error: %v", err) + } + config := &SetupConfig{ + BaseEndpoint: "http://example.com", + GenesisValidatorsRoot: root, + KeyFilePath: keyFilePath, + } + km, err := NewKeymanager(ctx, config) + if err != nil { + fmt.Printf("error: %v", err) + } + publicKeys := []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820", "0x8000a9a6d3f5e22d783eefaadbcf0298146adb5d95b04db910a0d4e16976b30229d0b1e7b9cda6c7e0bfa11f72efe055"} + statuses, err := km.AddPublicKeys(publicKeys) + require.NoError(t, err) for _, status := range statuses { require.Equal(t, keymanager.StatusImported, status.Status) } - s := km.DeletePublicKeys(publicKeys) + s, err := km.DeletePublicKeys([]string{publicKeys[0]}) + require.NoError(t, err) for _, status := range s { require.Equal(t, keymanager.StatusDeleted, status.Status) } - s = km.DeletePublicKeys(publicKeys) + s, err = km.DeletePublicKeys([]string{publicKeys[0]}) + require.NoError(t, err) for _, status := range s { require.Equal(t, keymanager.StatusNotFound, status.Status) } + keys, _, err := km.readKeyFile() + require.NoError(t, err) + require.Equal(t, len(keys), 1) + require.Equal(t, hexutil.Encode(keys[0][:]), publicKeys[1]) } diff --git a/validator/keymanager/remote-web3signer/log.go b/validator/keymanager/remote-web3signer/log.go new file mode 100644 index 000000000000..f579bdb7ae3a --- /dev/null +++ b/validator/keymanager/remote-web3signer/log.go @@ -0,0 +1,5 @@ +package remote_web3signer + +import "github.com/sirupsen/logrus" + +var log = logrus.WithField("prefix", "remote-keymanager") diff --git a/validator/keymanager/types.go b/validator/keymanager/types.go index f778708247d5..986e9b2e07da 100644 --- a/validator/keymanager/types.go +++ b/validator/keymanager/types.go @@ -61,7 +61,7 @@ type KeyStoreExtractor interface { // PublicKeyAdder allows adding public keys to the keymanager. type PublicKeyAdder interface { - AddPublicKeys(publicKeys []string) []*KeyStatus + AddPublicKeys(publicKeys []string) ([]*KeyStatus, error) } // KeyStatus is a json representation of the status fields for the keymanager apis @@ -85,7 +85,7 @@ const ( // PublicKeyDeleter allows deleting public keys set in keymanager. type PublicKeyDeleter interface { - DeletePublicKeys(publicKeys []string) []*KeyStatus + DeletePublicKeys(publicKeys []string) ([]*KeyStatus, error) } type ListKeymanagerAccountConfig struct { diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 2a76b823f091..253255212ab8 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -8,7 +8,6 @@ go_test( deps = [ "//cmd:go_default_library", "//cmd/validator/flags:go_default_library", - "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", @@ -17,7 +16,6 @@ go_test( "//validator/db/kv:go_default_library", "//validator/keymanager:go_default_library", "//validator/keymanager/remote-web3signer:go_default_library", - "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", ], @@ -45,8 +43,6 @@ go_library( "//config/params:go_default_library", "//config/proposer:go_default_library", "//config/proposer/loader:go_default_library", - "//container/slice:go_default_library", - "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", "//monitoring/backup:go_default_library", "//monitoring/prometheus:go_default_library", @@ -67,7 +63,6 @@ go_library( "//validator/keymanager/remote-web3signer:go_default_library", "//validator/rpc:go_default_library", "//validator/web:go_default_library", - "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index e2a023361672..ed80038020c7 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -18,7 +18,6 @@ import ( "syscall" "time" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" @@ -32,8 +31,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/proposer" "github.com/prysmaticlabs/prysm/v5/config/proposer/loader" - "github.com/prysmaticlabs/prysm/v5/container/slice" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/monitoring/backup" "github.com/prysmaticlabs/prysm/v5/monitoring/prometheus" @@ -259,7 +256,7 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Rou if !isInteropNumValidatorsSet { // Custom Check For Web3Signer if isWeb3SignerURLFlagSet { - c.wallet = wallet.NewWalletForWeb3Signer() + c.wallet = wallet.NewWalletForWeb3Signer(cliCtx) } else { w, err := wallet.OpenWalletOrElseCli(cliCtx, func(cliCtx *cli.Context) (*wallet.Wallet, error) { return nil, wallet.ErrNoWalletFound @@ -302,7 +299,7 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Rou func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context, router *mux.Router) error { if cliCtx.IsSet(flags.Web3SignerURLFlag.Name) { // Custom Check For Web3Signer - c.wallet = wallet.NewWalletForWeb3Signer() + c.wallet = wallet.NewWalletForWeb3Signer(cliCtx) } else { // Read the wallet password file from the cli context. if err := setWalletPasswordFilePath(cliCtx); err != nil { @@ -565,30 +562,20 @@ func Web3SignerConfig(cliCtx *cli.Context) (*remoteweb3signer.SetupConfig, error } if publicKeysSlice := cliCtx.StringSlice(flags.Web3SignerPublicValidatorKeysFlag.Name); len(publicKeysSlice) > 0 { - pks := make([]string, 0) if len(publicKeysSlice) == 1 { pURL, err := url.ParseRequestURI(publicKeysSlice[0]) if err == nil && pURL.Scheme != "" && pURL.Host != "" { web3signerConfig.PublicKeysURL = publicKeysSlice[0] } else { - pks = strings.Split(publicKeysSlice[0], ",") + web3signerConfig.ProvidedPublicKeys = strings.Split(publicKeysSlice[0], ",") } - } else if len(publicKeysSlice) > 1 { - pks = publicKeysSlice - } - if len(pks) > 0 { - pks = slice.Unique[string](pks) - var validatorKeys [][48]byte - for _, key := range pks { - decodedKey, decodeErr := hexutil.Decode(key) - if decodeErr != nil { - return nil, errors.Wrapf(decodeErr, "could not decode public key for web3signer: %s", key) - } - validatorKeys = append(validatorKeys, bytesutil.ToBytes48(decodedKey)) - } - web3signerConfig.ProvidedPublicKeys = validatorKeys + } else { + web3signerConfig.ProvidedPublicKeys = publicKeysSlice } } + if cliCtx.IsSet(flags.Web3SignerKeyFileFlag.Name) { + web3signerConfig.KeyFilePath = cliCtx.String(flags.Web3SignerKeyFileFlag.Name) + } } return web3signerConfig, nil } diff --git a/validator/node/node_test.go b/validator/node/node_test.go index 2b70339d2de3..257714c0da75 100644 --- a/validator/node/node_test.go +++ b/validator/node/node_test.go @@ -9,10 +9,8 @@ import ( "path/filepath" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -211,17 +209,10 @@ func TestClearDB(t *testing.T) { // TestWeb3SignerConfig tests the web3 signer config returns the correct values. func TestWeb3SignerConfig(t *testing.T) { - pubkey1decoded, err := hexutil.Decode("0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c") - require.NoError(t, err) - bytepubkey1 := bytesutil.ToBytes48(pubkey1decoded) - - pubkey2decoded, err := hexutil.Decode("0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b") - require.NoError(t, err) - bytepubkey2 := bytesutil.ToBytes48(pubkey2decoded) - type args struct { baseURL string publicKeysOrURLs []string + persistentFile string } tests := []struct { name string @@ -240,9 +231,9 @@ func TestWeb3SignerConfig(t *testing.T) { BaseEndpoint: "http://localhost:8545", GenesisValidatorsRoot: nil, PublicKeysURL: "", - ProvidedPublicKeys: [][48]byte{ - bytepubkey1, - bytepubkey2, + ProvidedPublicKeys: []string{ + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", }, }, }, @@ -269,25 +260,6 @@ func TestWeb3SignerConfig(t *testing.T) { want: nil, wantErrMsg: "web3signer url 0xa99a76ed7796f7be22d5b7e85deeb7c5677e88, is invalid: parse \"0xa99a76ed7796f7be22d5b7e85deeb7c5677e88,\": invalid URI for request", }, - { - name: "Bad publicKeys", - args: &args{ - baseURL: "http://localhost:8545", - publicKeysOrURLs: []string{"0xa99a76ed7796f7be22c," + - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b"}, - }, - want: nil, - wantErrMsg: "could not decode public key for web3signer: 0xa99a76ed7796f7be22c: hex string of odd length", - }, - { - name: "Bad publicKeysURL", - args: &args{ - baseURL: "http://localhost:8545", - publicKeysOrURLs: []string{"localhost"}, - }, - want: nil, - wantErrMsg: "could not decode public key for web3signer: localhost: hex string without 0x prefix", - }, { name: "Base URL missing scheme or host", args: &args{ @@ -298,23 +270,15 @@ func TestWeb3SignerConfig(t *testing.T) { wantErrMsg: "web3signer url must be in the format of http(s)://host:port url used: localhost:8545", }, { - name: "Public Keys URL missing scheme or host", + name: "happy path with persistentFile", args: &args{ - baseURL: "http://localhost:8545", - publicKeysOrURLs: []string{"localhost:8545"}, + baseURL: "http://localhost:8545", + persistentFile: "/remote/key/file.txt", }, - want: nil, - wantErrMsg: "could not decode public key for web3signer: localhost:8545: hex string without 0x prefix", - }, - { - name: "incorrect amount of flag calls used with url", - args: &args{ - baseURL: "http://localhost:8545", - publicKeysOrURLs: []string{"0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c," + - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", "http://localhost:8545/api/v1/eth2/publicKeys"}, + want: &remoteweb3signer.SetupConfig{ + BaseEndpoint: "http://localhost:8545", + KeyFilePath: "/remote/key/file.txt", }, - want: nil, - wantErrMsg: "could not decode public key for web3signer", }, } for _, tt := range tests { @@ -322,6 +286,7 @@ func TestWeb3SignerConfig(t *testing.T) { app := cli.App{} set := flag.NewFlagSet(tt.name, 0) set.String("validators-external-signer-url", tt.args.baseURL, "baseUrl") + set.String(flags.Web3SignerKeyFileFlag.Name, "", "") c := &cli.StringSliceFlag{ Name: "validators-external-signer-public-keys", } @@ -331,6 +296,9 @@ func TestWeb3SignerConfig(t *testing.T) { for _, key := range tt.args.publicKeysOrURLs { require.NoError(t, set.Set(flags.Web3SignerPublicValidatorKeysFlag.Name, key)) } + if tt.args.persistentFile != "" { + require.NoError(t, set.Set(flags.Web3SignerKeyFileFlag.Name, tt.args.persistentFile)) + } cliCtx := cli.NewContext(&app, set, nil) got, err := Web3SignerConfig(cliCtx) if tt.wantErrMsg != "" { diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 5c07cd7a9c09..96701e719c63 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -148,6 +148,7 @@ go_test( "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", + "@com_github_urfave_cli_v2//:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index f5d1c9aebab8..236945a2489b 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -484,7 +484,12 @@ func (s *Server) ImportRemoteKeys(w http.ResponseWriter, r *http.Request) { log.Warnf("Setting the remote signer base url within the request is not supported. The remote signer url can only be set from the --%s flag.", flags.Web3SignerURLFlag.Name) } - httputil.WriteJson(w, &RemoteKeysResponse{Data: adder.AddPublicKeys(remoteKeys)}) + ks, err := adder.AddPublicKeys(remoteKeys) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + httputil.WriteJson(w, &RemoteKeysResponse{Data: ks}) } // DeleteRemoteKeys deletes a list of public keys defined for web3signer keymanager type. @@ -533,8 +538,12 @@ func (s *Server) DeleteRemoteKeys(w http.ResponseWriter, r *http.Request) { httputil.WriteJson(w, &RemoteKeysResponse{Data: statuses}) return } - - httputil.WriteJson(w, RemoteKeysResponse{Data: deleter.DeletePublicKeys(req.Pubkeys)}) + data, err := deleter.DeletePublicKeys(req.Pubkeys) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + httputil.WriteJson(w, RemoteKeysResponse{Data: data}) } // ListFeeRecipientByPubkey returns the public key to eth address mapping object to the end user. diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 330340c37413..4cb58217df26 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -4,9 +4,12 @@ import ( "bytes" "context" "encoding/json" + "flag" "fmt" "net/http" "net/http/httptest" + "os" + "path/filepath" "strings" "testing" "time" @@ -15,6 +18,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/proposer" @@ -40,6 +44,7 @@ import ( remoteweb3signer "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer" "github.com/prysmaticlabs/prysm/v5/validator/slashing-protection-history/format" mocks "github.com/prysmaticlabs/prysm/v5/validator/testing" + "github.com/urfave/cli/v2" "go.uber.org/mock/gomock" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" @@ -342,13 +347,18 @@ func TestServer_ImportKeystores(t *testing.T) { func TestServer_ImportKeystores_WrongKeymanagerKind(t *testing.T) { ctx := context.Background() - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + require.NoError(t, os.MkdirAll(newDir, 0700)) + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) root := make([]byte, fieldparams.RootLength) root[0] = 1 km, err := w.InitializeKeymanager(ctx, iface.InitKeymanagerConfig{ListenForChanges: false, Web3SignerConfig: &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - PublicKeysURL: "http://example.com/public_keys", + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, }}) require.NoError(t, err) vs, err := client.NewValidatorService(ctx, &client.Config{ @@ -620,14 +630,19 @@ func TestServer_DeleteKeystores_FailedSlashingProtectionExport(t *testing.T) { func TestServer_DeleteKeystores_WrongKeymanagerKind(t *testing.T) { ctx := context.Background() - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + require.NoError(t, os.MkdirAll(newDir, 0700)) + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) root := make([]byte, fieldparams.RootLength) root[0] = 1 km, err := w.InitializeKeymanager(ctx, iface.InitKeymanagerConfig{ListenForChanges: false, Web3SignerConfig: &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - PublicKeysURL: "http://example.com/public_keys", + ProvidedPublicKeys: []string{"0xa2b5aaad9c6efefe7bb9b1243a043404f3362937cfb6b31833929833173f476630ea2cfeb0d9ddf15f97ca8685948820"}, }}) require.NoError(t, err) vs, err := client.NewValidatorService(ctx, &client.Config{ @@ -1312,16 +1327,17 @@ func TestServer_DeleteGasLimit(t *testing.T) { func TestServer_ListRemoteKeys(t *testing.T) { ctx := context.Background() - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) root := make([]byte, fieldparams.RootLength) root[0] = 1 - bytevalue, err := hexutil.Decode("0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a") - require.NoError(t, err) - pubkeys := [][fieldparams.BLSPubkeyLength]byte{bytesutil.ToBytes48(bytevalue)} config := &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - ProvidedPublicKeys: pubkeys, + ProvidedPublicKeys: []string{"0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"}, } km, err := w.InitializeKeymanager(ctx, iface.InitKeymanagerConfig{ListenForChanges: false, Web3SignerConfig: config}) require.NoError(t, err) @@ -1357,7 +1373,11 @@ func TestServer_ListRemoteKeys(t *testing.T) { func TestServer_ImportRemoteKeys(t *testing.T) { ctx := context.Background() - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) root := make([]byte, fieldparams.RootLength) root[0] = 1 config := &remoteweb3signer.SetupConfig{ @@ -1414,17 +1434,18 @@ func TestServer_ImportRemoteKeys(t *testing.T) { func TestServer_DeleteRemoteKeys(t *testing.T) { ctx := context.Background() - w := wallet.NewWalletForWeb3Signer() + app := cli.App{} + set := flag.NewFlagSet("test", 0) + newDir := filepath.Join(t.TempDir(), "new") + set.String(flags.WalletDirFlag.Name, newDir, "") + w := wallet.NewWalletForWeb3Signer(cli.NewContext(&app, set, nil)) root := make([]byte, fieldparams.RootLength) root[0] = 1 pkey := "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" - bytevalue, err := hexutil.Decode(pkey) - require.NoError(t, err) - pubkeys := [][fieldparams.BLSPubkeyLength]byte{bytesutil.ToBytes48(bytevalue)} config := &remoteweb3signer.SetupConfig{ BaseEndpoint: "http://example.com", GenesisValidatorsRoot: root, - ProvidedPublicKeys: pubkeys, + ProvidedPublicKeys: []string{pkey}, } km, err := w.InitializeKeymanager(ctx, iface.InitKeymanagerConfig{ListenForChanges: false, Web3SignerConfig: config}) require.NoError(t, err) From f230a6af587134acae948923bd6448fd9b7b0e82 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:58:28 -0500 Subject: [PATCH 153/325] Finalized validator index cache saving (#14146) * adding logic for saving validator indicies in new cache * updating index cache for eip6110 * Update setters_misc.go Co-authored-by: Preston Van Loon * linting --------- Co-authored-by: Preston Van Loon --- beacon-chain/blockchain/BUILD.bazel | 1 + beacon-chain/blockchain/receive_block.go | 22 +++-- beacon-chain/blockchain/receive_block_test.go | 82 +++++++++++++++++++ beacon-chain/blockchain/service.go | 2 + beacon-chain/blockchain/service_test.go | 62 ++++++++++++++ .../state/state-native/setters_misc.go | 4 + 6 files changed, 166 insertions(+), 7 deletions(-) diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index dcb8ffc8b9d6..522eb0643892 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -182,6 +182,7 @@ go_test( "//time:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_ethereum_go_ethereum//core/types:go_default_library", "@com_github_holiman_uint256//:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index db2de5f1ff4e..8a3996025327 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -169,13 +169,8 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig } // Send finalized events and finalized deposits in the background if newFinalized { - finalized := s.cfg.ForkChoiceStore.FinalizedCheckpoint() - go s.sendNewFinalizedEvent(ctx, postState) - depCtx, cancel := context.WithTimeout(context.Background(), depositDeadline) - go func() { - s.insertFinalizedDeposits(depCtx, finalized.Root) - cancel() - }() + // hook to process all post state finalization tasks + s.executePostFinalizationTasks(ctx, postState) } // If slasher is configured, forward the attestations in the block via an event feed for processing. @@ -224,6 +219,19 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig return nil } +func (s *Service) executePostFinalizationTasks(ctx context.Context, finalizedState state.BeaconState) { + finalized := s.cfg.ForkChoiceStore.FinalizedCheckpoint() + go func() { + finalizedState.SaveValidatorIndices() // used to handle Validator index invariant from EIP6110 + s.sendNewFinalizedEvent(ctx, finalizedState) + }() + depCtx, cancel := context.WithTimeout(context.Background(), depositDeadline) + go func() { + s.insertFinalizedDeposits(depCtx, finalized.Root) + cancel() + }() +} + // ReceiveBlockBatch processes the whole block batch at once, assuming the block batch is linear ,transitioning // the state, performing batch verification of all collected signatures and then performing the appropriate // actions for a block post-transition. diff --git a/beacon-chain/blockchain/receive_block_test.go b/beacon-chain/blockchain/receive_block_test.go index 9c065d767506..f6ec1745c9fe 100644 --- a/beacon-chain/blockchain/receive_block_test.go +++ b/beacon-chain/blockchain/receive_block_test.go @@ -6,11 +6,14 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common/hexutil" blockchainTesting "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/voluntaryexits" + "github.com/prysmaticlabs/prysm/v5/config/features" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -20,6 +23,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" logTest "github.com/sirupsen/logrus/hooks/test" ) @@ -415,3 +419,81 @@ func Test_sendNewFinalizedEvent(t *testing.T) { assert.DeepEqual(t, finalizedStRoot[:], fc.State) assert.Equal(t, false, fc.ExecutionOptimistic) } + +func Test_executePostFinalizationTasks(t *testing.T) { + resetFn := features.InitWithReset(&features.Flags{ + EIP6110ValidatorIndexCache: true, + }) + defer resetFn() + + logHook := logTest.NewGlobal() + + headState, err := util.NewBeaconState() + require.NoError(t, err) + finalizedStRoot, err := headState.HashTreeRoot(context.Background()) + require.NoError(t, err) + + genesis := util.NewBeaconBlock() + genesisRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err) + finalizedSlot := params.BeaconConfig().SlotsPerEpoch*122 + 1 + headBlock := util.NewBeaconBlock() + headBlock.Block.Slot = finalizedSlot + headBlock.Block.StateRoot = finalizedStRoot[:] + headBlock.Block.ParentRoot = bytesutil.PadTo(genesisRoot[:], 32) + headRoot, err := headBlock.Block.HashTreeRoot() + require.NoError(t, err) + + hexKey := "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + key, err := hexutil.Decode(hexKey) + require.NoError(t, err) + require.NoError(t, headState.SetValidators([]*ethpb.Validator{ + { + PublicKey: key, + WithdrawalCredentials: make([]byte, fieldparams.RootLength), + }, + })) + require.NoError(t, headState.SetSlot(finalizedSlot)) + require.NoError(t, headState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: 123, + Root: headRoot[:], + })) + require.NoError(t, headState.SetGenesisValidatorsRoot(params.BeaconConfig().ZeroHash[:])) + + s, tr := minimalTestService(t, WithFinalizedStateAtStartUp(headState)) + ctx, beaconDB, stateGen := tr.ctx, tr.db, tr.sg + + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, genesisRoot)) + util.SaveBlock(t, ctx, beaconDB, genesis) + require.NoError(t, beaconDB.SaveState(ctx, headState, headRoot)) + require.NoError(t, beaconDB.SaveState(ctx, headState, genesisRoot)) + util.SaveBlock(t, ctx, beaconDB, headBlock) + require.NoError(t, beaconDB.SaveFinalizedCheckpoint(ctx, ðpb.Checkpoint{Epoch: slots.ToEpoch(finalizedSlot), Root: headRoot[:]})) + + require.NoError(t, err) + require.NoError(t, stateGen.SaveState(ctx, headRoot, headState)) + require.NoError(t, beaconDB.SaveLastValidatedCheckpoint(ctx, ðpb.Checkpoint{Epoch: slots.ToEpoch(finalizedSlot), Root: headRoot[:]})) + + notifier := &blockchainTesting.MockStateNotifier{RecordEvents: true} + s.cfg.StateNotifier = notifier + s.executePostFinalizationTasks(s.ctx, headState) + + time.Sleep(1 * time.Second) // sleep for a second because event is in a separate go routine + require.Equal(t, 1, len(notifier.ReceivedEvents())) + e := notifier.ReceivedEvents()[0] + assert.Equal(t, statefeed.FinalizedCheckpoint, int(e.Type)) + fc, ok := e.Data.(*ethpbv1.EventFinalizedCheckpoint) + require.Equal(t, true, ok, "event has wrong data type") + assert.Equal(t, primitives.Epoch(123), fc.Epoch) + assert.DeepEqual(t, headRoot[:], fc.Block) + assert.DeepEqual(t, finalizedStRoot[:], fc.State) + assert.Equal(t, false, fc.ExecutionOptimistic) + + // check the cache + index, ok := headState.ValidatorIndexByPubkey(bytesutil.ToBytes48(key)) + require.Equal(t, true, ok) + require.Equal(t, primitives.ValidatorIndex(0), index) // first index + + // check deposit + require.LogsContain(t, logHook, "Finalized deposit insertion completed at index") +} diff --git a/beacon-chain/blockchain/service.go b/beacon-chain/blockchain/service.go index 09d0cce7906d..52dea5958bb8 100644 --- a/beacon-chain/blockchain/service.go +++ b/beacon-chain/blockchain/service.go @@ -330,6 +330,8 @@ func (s *Service) StartFromSavedState(saved state.BeaconState) error { return errors.Wrap(err, "failed to initialize blockchain service") } + saved.SaveValidatorIndices() // used to handle Validator index invariant from EIP6110 + return nil } diff --git a/beacon-chain/blockchain/service_test.go b/beacon-chain/blockchain/service_test.go index 3eba33e170b7..73be76f80e4d 100644 --- a/beacon-chain/blockchain/service_test.go +++ b/beacon-chain/blockchain/service_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" @@ -29,6 +30,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -499,6 +501,66 @@ func TestChainService_EverythingOptimistic(t *testing.T) { require.Equal(t, true, op) } +func TestStartFromSavedState_ValidatorIndexCacheUpdated(t *testing.T) { + resetFn := features.InitWithReset(&features.Flags{ + EnableStartOptimistic: true, + EIP6110ValidatorIndexCache: true, + }) + defer resetFn() + + genesis := util.NewBeaconBlock() + genesisRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err) + finalizedSlot := params.BeaconConfig().SlotsPerEpoch*2 + 1 + headBlock := util.NewBeaconBlock() + headBlock.Block.Slot = finalizedSlot + headBlock.Block.ParentRoot = bytesutil.PadTo(genesisRoot[:], 32) + headState, err := util.NewBeaconState() + require.NoError(t, err) + hexKey := "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + key, err := hexutil.Decode(hexKey) + require.NoError(t, err) + hexKey2 := "0x42247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + key2, err := hexutil.Decode(hexKey2) + require.NoError(t, err) + require.NoError(t, headState.SetValidators([]*ethpb.Validator{ + { + PublicKey: key, + WithdrawalCredentials: make([]byte, fieldparams.RootLength), + }, + { + PublicKey: key2, + WithdrawalCredentials: make([]byte, fieldparams.RootLength), + }, + })) + require.NoError(t, headState.SetSlot(finalizedSlot)) + require.NoError(t, headState.SetGenesisValidatorsRoot(params.BeaconConfig().ZeroHash[:])) + headRoot, err := headBlock.Block.HashTreeRoot() + require.NoError(t, err) + + c, tr := minimalTestService(t, WithFinalizedStateAtStartUp(headState)) + ctx, beaconDB, stateGen := tr.ctx, tr.db, tr.sg + + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, genesisRoot)) + util.SaveBlock(t, ctx, beaconDB, genesis) + require.NoError(t, beaconDB.SaveState(ctx, headState, headRoot)) + require.NoError(t, beaconDB.SaveState(ctx, headState, genesisRoot)) + util.SaveBlock(t, ctx, beaconDB, headBlock) + require.NoError(t, beaconDB.SaveFinalizedCheckpoint(ctx, ðpb.Checkpoint{Epoch: slots.ToEpoch(finalizedSlot), Root: headRoot[:]})) + + require.NoError(t, err) + require.NoError(t, stateGen.SaveState(ctx, headRoot, headState)) + require.NoError(t, beaconDB.SaveLastValidatedCheckpoint(ctx, ðpb.Checkpoint{Epoch: slots.ToEpoch(finalizedSlot), Root: headRoot[:]})) + require.NoError(t, c.StartFromSavedState(headState)) + + index, ok := headState.ValidatorIndexByPubkey(bytesutil.ToBytes48(key)) + require.Equal(t, true, ok) + require.Equal(t, primitives.ValidatorIndex(0), index) // first index + index2, ok := headState.ValidatorIndexByPubkey(bytesutil.ToBytes48(key2)) + require.Equal(t, true, ok) + require.Equal(t, primitives.ValidatorIndex(1), index2) // first index +} + // MockClockSetter satisfies the ClockSetter interface for testing the conditions where blockchain.Service should // call SetGenesis. type MockClockSetter struct { diff --git a/beacon-chain/state/state-native/setters_misc.go b/beacon-chain/state/state-native/setters_misc.go index 661aa070961c..77d346fb4fc9 100644 --- a/beacon-chain/state/state-native/setters_misc.go +++ b/beacon-chain/state/state-native/setters_misc.go @@ -117,6 +117,10 @@ func (b *BeaconState) SaveValidatorIndices() { b.lock.Lock() defer b.lock.Unlock() + if b.validatorIndexCache == nil { + b.validatorIndexCache = newFinalizedValidatorIndexCache() + } + b.saveValidatorIndices() } From 4becd7b375faa9221eb7e831d44677d962fd80fb Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Thu, 27 Jun 2024 11:27:00 +0800 Subject: [PATCH 154/325] Remove Backoff when Searching for a lot of non-viable peers. Affects peer performance (#14148) --- beacon-chain/p2p/iterator.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/beacon-chain/p2p/iterator.go b/beacon-chain/p2p/iterator.go index 2530e46a5b8d..cd5451ba3048 100644 --- a/beacon-chain/p2p/iterator.go +++ b/beacon-chain/p2p/iterator.go @@ -2,14 +2,10 @@ package p2p import ( "context" - "runtime" - "time" "github.com/ethereum/go-ethereum/p2p/enode" ) -const backOffCounter = 50 - // filterNodes wraps an iterator such that Next only returns nodes for which // the 'check' function returns true. This custom implementation also // checks for context deadlines so that in the event the parent context has @@ -28,21 +24,13 @@ type filterIter struct { // Next looks up for the next valid node according to our // filter criteria. func (f *filterIter) Next() bool { - lookupCounter := 0 for f.Iterator.Next() { - // Do not excessively perform lookups if we constantly receive non-viable peers. - if lookupCounter > backOffCounter { - lookupCounter = 0 - runtime.Gosched() - time.Sleep(pollingPeriod) - } if f.Context.Err() != nil { return false } if f.check(f.Node()) { return true } - lookupCounter++ } return false } From eab9daf5f5a5b91da8b5ac70918cebc23e05d18c Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 27 Jun 2024 12:49:24 -0500 Subject: [PATCH 155/325] process_registry_updates without a full copy of the validator set (#14130) * Avoid copying validator set in ProcessRegistryUpdates * Fix bug with sortIndices. Thanks to @terencechain for the expert debugging --- beacon-chain/core/epoch/BUILD.bazel | 7 +- beacon-chain/core/epoch/epoch_processing.go | 112 +++++++++--------- .../core/epoch/epoch_processing_test.go | 12 +- beacon-chain/core/epoch/sortable_indices.go | 35 ++++++ .../core/epoch/sortable_indices_test.go | 53 +++++++++ beacon-chain/core/helpers/validators.go | 6 +- beacon-chain/core/helpers/validators_test.go | 4 +- 7 files changed, 163 insertions(+), 66 deletions(-) create mode 100644 beacon-chain/core/epoch/sortable_indices.go create mode 100644 beacon-chain/core/epoch/sortable_indices_test.go diff --git a/beacon-chain/core/epoch/BUILD.bazel b/beacon-chain/core/epoch/BUILD.bazel index 72e233695905..e6f559e55916 100644 --- a/beacon-chain/core/epoch/BUILD.bazel +++ b/beacon-chain/core/epoch/BUILD.bazel @@ -2,7 +2,10 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["epoch_processing.go"], + srcs = [ + "epoch_processing.go", + "sortable_indices.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch", visibility = [ "//beacon-chain:__subpackages__", @@ -31,6 +34,7 @@ go_test( srcs = [ "epoch_processing_fuzz_test.go", "epoch_processing_test.go", + "sortable_indices_test.go", ], embed = [":go_default_library"], deps = [ @@ -47,6 +51,7 @@ go_test( "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_google_gofuzz//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index e941997179e4..a1ea5a289759 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -24,27 +24,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/runtime/version" ) -// sortableIndices implements the Sort interface to sort newly activated validator indices -// by activation epoch and by index number. -type sortableIndices struct { - indices []primitives.ValidatorIndex - validators []*ethpb.Validator -} - -// Len is the number of elements in the collection. -func (s sortableIndices) Len() int { return len(s.indices) } - -// Swap swaps the elements with indexes i and j. -func (s sortableIndices) Swap(i, j int) { s.indices[i], s.indices[j] = s.indices[j], s.indices[i] } - -// Less reports whether the element with index i must sort before the element with index j. -func (s sortableIndices) Less(i, j int) bool { - if s.validators[s.indices[i]].ActivationEligibilityEpoch == s.validators[s.indices[j]].ActivationEligibilityEpoch { - return s.indices[i] < s.indices[j] - } - return s.validators[s.indices[i]].ActivationEligibilityEpoch < s.validators[s.indices[j]].ActivationEligibilityEpoch -} - // AttestingBalance returns the total balance from all the attesting indices. // // WARNING: This method allocates a new copy of the attesting validator indices set and is @@ -91,55 +70,78 @@ func AttestingBalance(ctx context.Context, state state.ReadOnlyBeaconState, atts // for index in activation_queue[:get_validator_churn_limit(state)]: // validator = state.validators[index] // validator.activation_epoch = compute_activation_exit_epoch(get_current_epoch(state)) -func ProcessRegistryUpdates(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { - currentEpoch := time.CurrentEpoch(state) - vals := state.Validators() +func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) (state.BeaconState, error) { + currentEpoch := time.CurrentEpoch(st) var err error ejectionBal := params.BeaconConfig().EjectionBalance - activationEligibilityEpoch := time.CurrentEpoch(state) + 1 - for idx, validator := range vals { - // Process the validators for activation eligibility. - if helpers.IsEligibleForActivationQueue(validator, currentEpoch) { - validator.ActivationEligibilityEpoch = activationEligibilityEpoch - if err := state.UpdateValidatorAtIndex(primitives.ValidatorIndex(idx), validator); err != nil { - return nil, err - } + + // To avoid copying the state validator set via st.Validators(), we will perform a read only pass + // over the validator set while collecting validator indices where the validator copy is actually + // necessary, then we will process these operations. + eligibleForActivationQ := make([]primitives.ValidatorIndex, 0) + eligibleForActivation := make([]primitives.ValidatorIndex, 0) + eligibleForEjection := make([]primitives.ValidatorIndex, 0) + + if err := st.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error { + // Collect validators eligible to enter the activation queue. + if helpers.IsEligibleForActivationQueue(val, currentEpoch) { + eligibleForActivationQ = append(eligibleForActivationQ, primitives.ValidatorIndex(idx)) } - // Process the validators for ejection. - isActive := helpers.IsActiveValidator(validator, currentEpoch) - belowEjectionBalance := validator.EffectiveBalance <= ejectionBal + // Collect validators to eject. + isActive := helpers.IsActiveValidatorUsingTrie(val, currentEpoch) + belowEjectionBalance := val.EffectiveBalance() <= ejectionBal if isActive && belowEjectionBalance { - // Here is fine to do a quadratic loop since this should - // barely happen - maxExitEpoch, churn := validators.MaxExitEpochAndChurn(state) - state, _, err = validators.InitiateValidatorExit(ctx, state, primitives.ValidatorIndex(idx), maxExitEpoch, churn) - if err != nil && !errors.Is(err, validators.ErrValidatorAlreadyExited) { - return nil, errors.Wrapf(err, "could not initiate exit for validator %d", idx) - } + eligibleForEjection = append(eligibleForEjection, primitives.ValidatorIndex(idx)) } + + // Collect validators eligible for activation and not yet dequeued for activation. + if helpers.IsEligibleForActivationUsingTrie(st, val) { + eligibleForActivation = append(eligibleForActivation, primitives.ValidatorIndex(idx)) + } + + return nil + }); err != nil { + return st, fmt.Errorf("failed to read validators: %w", err) } - // Queue validators eligible for activation and not yet dequeued for activation. - var activationQ []primitives.ValidatorIndex - for idx, validator := range vals { - if helpers.IsEligibleForActivation(state, validator) { - activationQ = append(activationQ, primitives.ValidatorIndex(idx)) + // Process validators for activation eligibility. + activationEligibilityEpoch := time.CurrentEpoch(st) + 1 + for _, idx := range eligibleForActivationQ { + v, err := st.ValidatorAtIndex(idx) + if err != nil { + return nil, err + } + v.ActivationEligibilityEpoch = activationEligibilityEpoch + if err := st.UpdateValidatorAtIndex(idx, v); err != nil { + return nil, err + } + } + + // Process validators eligible for ejection. + for _, idx := range eligibleForEjection { + // Here is fine to do a quadratic loop since this should + // barely happen + maxExitEpoch, churn := validators.MaxExitEpochAndChurn(st) + st, _, err = validators.InitiateValidatorExit(ctx, st, idx, maxExitEpoch, churn) + if err != nil && !errors.Is(err, validators.ErrValidatorAlreadyExited) { + return nil, errors.Wrapf(err, "could not initiate exit for validator %d", idx) } } - sort.Sort(sortableIndices{indices: activationQ, validators: vals}) + // Queue validators eligible for activation and not yet dequeued for activation. + sort.Sort(sortableIndices{indices: eligibleForActivation, state: st}) // Only activate just enough validators according to the activation churn limit. - limit := uint64(len(activationQ)) - activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, state, currentEpoch) + limit := uint64(len(eligibleForActivation)) + activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, st, currentEpoch) if err != nil { return nil, errors.Wrap(err, "could not get active validator count") } churnLimit := helpers.ValidatorActivationChurnLimit(activeValidatorCount) - if state.Version() >= version.Deneb { + if st.Version() >= version.Deneb { churnLimit = helpers.ValidatorActivationChurnLimitDeneb(activeValidatorCount) } @@ -149,17 +151,17 @@ func ProcessRegistryUpdates(ctx context.Context, state state.BeaconState) (state } activationExitEpoch := helpers.ActivationExitEpoch(currentEpoch) - for _, index := range activationQ[:limit] { - validator, err := state.ValidatorAtIndex(index) + for _, index := range eligibleForActivation[:limit] { + validator, err := st.ValidatorAtIndex(index) if err != nil { return nil, err } validator.ActivationEpoch = activationExitEpoch - if err := state.UpdateValidatorAtIndex(index, validator); err != nil { + if err := st.UpdateValidatorAtIndex(index, validator); err != nil { return nil, err } } - return state, nil + return st, nil } // ProcessSlashings processes the slashed validators during epoch processing, diff --git a/beacon-chain/core/epoch/epoch_processing_test.go b/beacon-chain/core/epoch/epoch_processing_test.go index 71ebe63cd1ad..dd78dd5ca626 100644 --- a/beacon-chain/core/epoch/epoch_processing_test.go +++ b/beacon-chain/core/epoch/epoch_processing_test.go @@ -307,14 +307,15 @@ func TestProcessRegistryUpdates_NoRotation(t *testing.T) { } func TestProcessRegistryUpdates_EligibleToActivate(t *testing.T) { + finalizedEpoch := primitives.Epoch(4) base := ðpb.BeaconState{ Slot: 5 * params.BeaconConfig().SlotsPerEpoch, - FinalizedCheckpoint: ðpb.Checkpoint{Epoch: 6, Root: make([]byte, fieldparams.RootLength)}, + FinalizedCheckpoint: ðpb.Checkpoint{Epoch: finalizedEpoch, Root: make([]byte, fieldparams.RootLength)}, } limit := helpers.ValidatorActivationChurnLimit(0) for i := uint64(0); i < limit+10; i++ { base.Validators = append(base.Validators, ðpb.Validator{ - ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, + ActivationEligibilityEpoch: finalizedEpoch, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, ActivationEpoch: params.BeaconConfig().FarFutureEpoch, }) @@ -325,7 +326,6 @@ func TestProcessRegistryUpdates_EligibleToActivate(t *testing.T) { newState, err := epoch.ProcessRegistryUpdates(context.Background(), beaconState) require.NoError(t, err) for i, validator := range newState.Validators() { - assert.Equal(t, currentEpoch+1, validator.ActivationEligibilityEpoch, "Could not update registry %d, unexpected activation eligibility epoch", i) if uint64(i) < limit && validator.ActivationEpoch != helpers.ActivationExitEpoch(currentEpoch) { t.Errorf("Could not update registry %d, validators failed to activate: wanted activation epoch %d, got %d", i, helpers.ActivationExitEpoch(currentEpoch), validator.ActivationEpoch) @@ -338,9 +338,10 @@ func TestProcessRegistryUpdates_EligibleToActivate(t *testing.T) { } func TestProcessRegistryUpdates_EligibleToActivate_Cancun(t *testing.T) { + finalizedEpoch := primitives.Epoch(4) base := ðpb.BeaconStateDeneb{ Slot: 5 * params.BeaconConfig().SlotsPerEpoch, - FinalizedCheckpoint: ðpb.Checkpoint{Epoch: 6, Root: make([]byte, fieldparams.RootLength)}, + FinalizedCheckpoint: ðpb.Checkpoint{Epoch: finalizedEpoch, Root: make([]byte, fieldparams.RootLength)}, } cfg := params.BeaconConfig() cfg.MinPerEpochChurnLimit = 10 @@ -349,7 +350,7 @@ func TestProcessRegistryUpdates_EligibleToActivate_Cancun(t *testing.T) { for i := uint64(0); i < 10; i++ { base.Validators = append(base.Validators, ðpb.Validator{ - ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, + ActivationEligibilityEpoch: finalizedEpoch, EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, ActivationEpoch: params.BeaconConfig().FarFutureEpoch, }) @@ -360,7 +361,6 @@ func TestProcessRegistryUpdates_EligibleToActivate_Cancun(t *testing.T) { newState, err := epoch.ProcessRegistryUpdates(context.Background(), beaconState) require.NoError(t, err) for i, validator := range newState.Validators() { - assert.Equal(t, currentEpoch+1, validator.ActivationEligibilityEpoch, "Could not update registry %d, unexpected activation eligibility epoch", i) // Note: In Deneb, only validators indices before `MaxPerEpochActivationChurnLimit` should be activated. if uint64(i) < params.BeaconConfig().MaxPerEpochActivationChurnLimit && validator.ActivationEpoch != helpers.ActivationExitEpoch(currentEpoch) { t.Errorf("Could not update registry %d, validators failed to activate: wanted activation epoch %d, got %d", diff --git a/beacon-chain/core/epoch/sortable_indices.go b/beacon-chain/core/epoch/sortable_indices.go new file mode 100644 index 000000000000..9c268bd24fa6 --- /dev/null +++ b/beacon-chain/core/epoch/sortable_indices.go @@ -0,0 +1,35 @@ +package epoch + +import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" +) + +// sortableIndices implements the Sort interface to sort newly activated validator indices +// by activation epoch and by index number. +type sortableIndices struct { + indices []primitives.ValidatorIndex + state state.ReadOnlyValidators +} + +// Len is the number of elements in the collection. +func (s sortableIndices) Len() int { return len(s.indices) } + +// Swap swaps the elements with indexes i and j. +func (s sortableIndices) Swap(i, j int) { s.indices[i], s.indices[j] = s.indices[j], s.indices[i] } + +// Less reports whether the element with index i must sort before the element with index j. +func (s sortableIndices) Less(i, j int) bool { + vi, erri := s.state.ValidatorAtIndexReadOnly(s.indices[i]) + vj, errj := s.state.ValidatorAtIndexReadOnly(s.indices[j]) + + if erri != nil || errj != nil { + return false + } + + a, b := vi.ActivationEligibilityEpoch(), vj.ActivationEligibilityEpoch() + if a == b { + return s.indices[i] < s.indices[j] + } + return a < b +} diff --git a/beacon-chain/core/epoch/sortable_indices_test.go b/beacon-chain/core/epoch/sortable_indices_test.go new file mode 100644 index 000000000000..45c29f0c784b --- /dev/null +++ b/beacon-chain/core/epoch/sortable_indices_test.go @@ -0,0 +1,53 @@ +package epoch + +import ( + "sort" + "testing" + + "github.com/google/go-cmp/cmp" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestSortableIndices(t *testing.T) { + st, err := state_native.InitializeFromProtoPhase0(ð.BeaconState{ + Validators: []*eth.Validator{ + {ActivationEligibilityEpoch: 0}, + {ActivationEligibilityEpoch: 5}, + {ActivationEligibilityEpoch: 4}, + {ActivationEligibilityEpoch: 4}, + {ActivationEligibilityEpoch: 2}, + {ActivationEligibilityEpoch: 1}, + }, + }) + require.NoError(t, err) + + s := sortableIndices{ + indices: []primitives.ValidatorIndex{ + 4, + 2, + 5, + 3, + 1, + 0, + }, + state: st, + } + + sort.Sort(s) + + want := []primitives.ValidatorIndex{ + 0, + 5, + 4, + 2, // Validators with the same ActivationEligibilityEpoch are sorted by index, ascending. + 3, + 1, + } + + if !cmp.Equal(s.indices, want) { + t.Errorf("Failed to sort indices correctly, wanted %v, got %v", want, s.indices) + } +} diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index a45c69562fe6..ccee87add7c5 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -404,11 +404,11 @@ func ComputeProposerIndex(bState state.ReadOnlyValidators, activeIndices []primi // validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH // and validator.effective_balance >= MIN_ACTIVATION_BALANCE # [Modified in Electra:EIP7251] // ) -func IsEligibleForActivationQueue(validator *ethpb.Validator, currentEpoch primitives.Epoch) bool { +func IsEligibleForActivationQueue(validator state.ReadOnlyValidator, currentEpoch primitives.Epoch) bool { if currentEpoch >= params.BeaconConfig().ElectraForkEpoch { - return isEligibleForActivationQueueElectra(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) + return isEligibleForActivationQueueElectra(validator.ActivationEligibilityEpoch(), validator.EffectiveBalance()) } - return isEligibleForActivationQueue(validator.ActivationEligibilityEpoch, validator.EffectiveBalance) + return isEligibleForActivationQueue(validator.ActivationEligibilityEpoch(), validator.EffectiveBalance()) } // isEligibleForActivationQueue carries out the logic for IsEligibleForActivationQueue diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index efa21c75cb63..a5df3c6bf83d 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -743,7 +743,9 @@ func TestIsEligibleForActivationQueue(t *testing.T) { t.Run(tt.name, func(t *testing.T) { helpers.ClearCache() - assert.Equal(t, tt.want, helpers.IsEligibleForActivationQueue(tt.validator, tt.currentEpoch), "IsEligibleForActivationQueue()") + v, err := state_native.NewValidator(tt.validator) + assert.NoError(t, err) + assert.Equal(t, tt.want, helpers.IsEligibleForActivationQueue(v, tt.currentEpoch), "IsEligibleForActivationQueue()") }) } } From 6d63dbe1af7c7f4d23a459ecc663a075a468e955 Mon Sep 17 00:00:00 2001 From: vickkkkkyy Date: Fri, 28 Jun 2024 03:26:54 +0800 Subject: [PATCH 156/325] removed some internal expired jump targets (#14128) --- third_party/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/third_party/README.md b/third_party/README.md index 7083c0b61894..dd5c44a8d197 100644 --- a/third_party/README.md +++ b/third_party/README.md @@ -16,8 +16,6 @@ unless really needed** - [Prerequisites](#prerequisites) - [Creating a Patch](#creating-a-patch) -- [Ethereum APIs Patch](#ethereum-apis-patch) -- [Updating Patches](#updating-patches) ## Prerequisites From 7898e65d4e04c3cccd769726c71f70145fbfede7 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 27 Jun 2024 14:28:30 -0500 Subject: [PATCH 157/325] Electra v1.5.0-alpha.3 changes: Move consolidations from beacon block body to the execution payload header. (#14152) --- beacon-chain/core/electra/BUILD.bazel | 7 - beacon-chain/core/electra/consolidations.go | 170 ----- .../core/electra/consolidations_test.go | 210 ------ beacon-chain/core/electra/upgrade.go | 39 +- beacon-chain/core/electra/upgrade_test.go | 35 +- .../transition/transition_no_verify_sig.go | 12 +- beacon-chain/db/kv/blocks_test.go | 20 - beacon-chain/db/kv/state_test.go | 27 +- beacon-chain/p2p/encoder/ssz_test.go | 28 - .../validator/construct_generic_block_test.go | 10 - .../prysm/v1alpha1/validator/proposer_test.go | 40 +- .../state-native/getters_withdrawal_test.go | 1 + .../state/state-native/setters_churn_test.go | 1 + .../state/state-native/state_trie_test.go | 1 + config/fieldparams/mainnet.go | 1 + config/fieldparams/minimal.go | 1 + consensus-types/blocks/execution.go | 54 +- consensus-types/blocks/factory.go | 6 - consensus-types/blocks/factory_test.go | 24 - consensus-types/blocks/getters.go | 5 - consensus-types/blocks/proto.go | 4 - consensus-types/blocks/types.go | 2 - consensus-types/interfaces/BUILD.bazel | 1 - consensus-types/interfaces/beacon_block.go | 6 +- consensus-types/interfaces/cast.go | 15 - consensus-types/mock/block.go | 5 - encoding/ssz/htrutils.go | 7 + proto/engine/v1/BUILD.bazel | 1 + proto/engine/v1/engine.ssz.go | 201 +++++- proto/engine/v1/execution_engine.pb.go | 672 ++++++++++-------- proto/engine/v1/execution_engine.proto | 15 +- proto/eth/v1/gateway.ssz.go | 2 +- proto/eth/v2/grpc.ssz.go | 2 +- proto/prysm/v1alpha1/BUILD.bazel | 2 - proto/prysm/v1alpha1/altair.ssz.go | 2 +- proto/prysm/v1alpha1/beacon_block.pb.go | 501 ++++++------- proto/prysm/v1alpha1/beacon_block.proto | 4 - proto/prysm/v1alpha1/bellatrix.ssz.go | 2 +- proto/prysm/v1alpha1/capella.ssz.go | 2 +- proto/prysm/v1alpha1/cloners.go | 66 +- proto/prysm/v1alpha1/cloners_test.go | 82 +-- proto/prysm/v1alpha1/deneb.ssz.go | 2 +- proto/prysm/v1alpha1/eip_7251.go | 12 - proto/prysm/v1alpha1/eip_7251.pb.go | 250 +------ proto/prysm/v1alpha1/eip_7251.proto | 17 - proto/prysm/v1alpha1/eip_7251_test.go | 21 - proto/prysm/v1alpha1/electra.ssz.go | 292 +------- proto/prysm/v1alpha1/non-core.ssz.go | 2 +- proto/prysm/v1alpha1/phase0.ssz.go | 2 +- proto/ssz_proto_library.bzl | 2 + .../electra/epoch_processing/helpers.go | 1 + .../shared/electra/fork/upgrade_to_electra.go | 1 + .../shared/electra/operations/block_header.go | 1 + .../electra/operations/consolidations.go | 23 +- .../electra/operations/execution_payload.go | 1 + .../shared/electra/operations/helpers.go | 1 + .../electra/operations/withdrawal_request.go | 3 +- .../shared/electra/operations/withdrawals.go | 1 + .../electra/rewards/rewards_penalties.go | 1 + .../shared/electra/sanity/block_processing.go | 1 + .../shared/electra/sanity/slot_processing.go | 1 + .../shared/electra/ssz_static/ssz_static.go | 16 +- testing/util/block.go | 54 +- testing/util/electra_state.go | 27 +- testing/util/state.go | 27 +- 65 files changed, 1138 insertions(+), 1907 deletions(-) delete mode 100644 consensus-types/interfaces/cast.go delete mode 100644 proto/prysm/v1alpha1/eip_7251.go delete mode 100644 proto/prysm/v1alpha1/eip_7251_test.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index ee8bfb1c86f6..92d647c5de64 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -21,14 +21,12 @@ go_library( "//beacon-chain/core/epoch:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", - "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/engine/v1:go_default_library", @@ -55,19 +53,14 @@ go_test( deps = [ ":go_default_library", "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", - "//crypto/bls/blst:go_default_library", - "//crypto/bls/common:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//runtime/interop:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", diff --git a/beacon-chain/core/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go index 52030c29e359..b4444d2753cc 100644 --- a/beacon-chain/core/electra/consolidations.go +++ b/beacon-chain/core/electra/consolidations.go @@ -5,12 +5,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/crypto/bls" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -91,168 +86,3 @@ func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) err return nil } - -// ProcessConsolidations implements the spec definition below. This method makes mutating calls to -// the beacon state. -// -// Spec definition: -// -// def process_consolidation(state: BeaconState, signed_consolidation: SignedConsolidation) -> None: -// # If the pending consolidations queue is full, no consolidations are allowed in the block -// assert len(state.pending_consolidations) < PENDING_CONSOLIDATIONS_LIMIT -// # If there is too little available consolidation churn limit, no consolidations are allowed in the block -// assert get_consolidation_churn_limit(state) > MIN_ACTIVATION_BALANCE -// consolidation = signed_consolidation.message -// # Verify that source != target, so a consolidation cannot be used as an exit. -// assert consolidation.source_index != consolidation.target_index -// -// source_validator = state.validators[consolidation.source_index] -// target_validator = state.validators[consolidation.target_index] -// # Verify the source and the target are active -// current_epoch = get_current_epoch(state) -// assert is_active_validator(source_validator, current_epoch) -// assert is_active_validator(target_validator, current_epoch) -// # Verify exits for source and target have not been initiated -// assert source_validator.exit_epoch == FAR_FUTURE_EPOCH -// assert target_validator.exit_epoch == FAR_FUTURE_EPOCH -// # Consolidations must specify an epoch when they become valid; they are not valid before then -// assert current_epoch >= consolidation.epoch -// -// # Verify the source and the target have Execution layer withdrawal credentials -// assert has_execution_withdrawal_credential(source_validator) -// assert has_execution_withdrawal_credential(target_validator) -// # Verify the same withdrawal address -// assert source_validator.withdrawal_credentials[12:] == target_validator.withdrawal_credentials[12:] -// -// # Verify consolidation is signed by the source and the target -// domain = compute_domain(DOMAIN_CONSOLIDATION, genesis_validators_root=state.genesis_validators_root) -// signing_root = compute_signing_root(consolidation, domain) -// pubkeys = [source_validator.pubkey, target_validator.pubkey] -// assert bls.FastAggregateVerify(pubkeys, signing_root, signed_consolidation.signature) -// -// # Initiate source validator exit and append pending consolidation -// source_validator.exit_epoch = compute_consolidation_epoch_and_update_churn( -// state, source_validator.effective_balance) -// source_validator.withdrawable_epoch = Epoch( -// source_validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY -// ) -// state.pending_consolidations.append(PendingConsolidation( -// source_index=consolidation.source_index, -// target_index=consolidation.target_index -// )) -func ProcessConsolidations(ctx context.Context, st state.BeaconState, cs []*ethpb.SignedConsolidation) error { - _, span := trace.StartSpan(ctx, "electra.ProcessConsolidations") - defer span.End() - - if st == nil || st.IsNil() { - return errors.New("nil state") - } - - if len(cs) == 0 { - return nil // Nothing to process. - } - - domain, err := signing.ComputeDomain( - params.BeaconConfig().DomainConsolidation, - nil, // Use genesis fork version - st.GenesisValidatorsRoot(), - ) - if err != nil { - return err - } - - totalBalance, err := helpers.TotalActiveBalance(st) - if err != nil { - return err - } - - if helpers.ConsolidationChurnLimit(primitives.Gwei(totalBalance)) <= primitives.Gwei(params.BeaconConfig().MinActivationBalance) { - return errors.New("too little available consolidation churn limit") - } - - currentEpoch := slots.ToEpoch(st.Slot()) - - for _, c := range cs { - if c == nil || c.Message == nil { - return errors.New("nil consolidation") - } - - if n, err := st.NumPendingConsolidations(); err != nil { - return err - } else if n >= params.BeaconConfig().PendingConsolidationsLimit { - return errors.New("pending consolidations queue is full") - } - - if c.Message.SourceIndex == c.Message.TargetIndex { - return errors.New("source and target index are the same") - } - source, err := st.ValidatorAtIndex(c.Message.SourceIndex) - if err != nil { - return err - } - target, err := st.ValidatorAtIndex(c.Message.TargetIndex) - if err != nil { - return err - } - if !helpers.IsActiveValidator(source, currentEpoch) { - return errors.New("source is not active") - } - if !helpers.IsActiveValidator(target, currentEpoch) { - return errors.New("target is not active") - } - if source.ExitEpoch != params.BeaconConfig().FarFutureEpoch { - return errors.New("source exit epoch has been initiated") - } - if target.ExitEpoch != params.BeaconConfig().FarFutureEpoch { - return errors.New("target exit epoch has been initiated") - } - if currentEpoch < c.Message.Epoch { - return errors.New("consolidation is not valid yet") - } - - if !helpers.HasExecutionWithdrawalCredentials(source) { - return errors.New("source does not have execution withdrawal credentials") - } - if !helpers.HasExecutionWithdrawalCredentials(target) { - return errors.New("target does not have execution withdrawal credentials") - } - if !helpers.IsSameWithdrawalCredentials(source, target) { - return errors.New("source and target have different withdrawal credentials") - } - - sr, err := signing.ComputeSigningRoot(c.Message, domain) - if err != nil { - return err - } - sourcePk, err := bls.PublicKeyFromBytes(source.PublicKey) - if err != nil { - return errors.Wrap(err, "could not convert source public key bytes to bls public key") - } - targetPk, err := bls.PublicKeyFromBytes(target.PublicKey) - if err != nil { - return errors.Wrap(err, "could not convert target public key bytes to bls public key") - } - sig, err := bls.SignatureFromBytes(c.Signature) - if err != nil { - return errors.Wrap(err, "could not convert bytes to signature") - } - if !sig.FastAggregateVerify([]bls.PublicKey{sourcePk, targetPk}, sr) { - return errors.New("consolidation signature verification failed") - } - - sEE, err := ComputeConsolidationEpochAndUpdateChurn(ctx, st, primitives.Gwei(source.EffectiveBalance)) - if err != nil { - return err - } - source.ExitEpoch = sEE - source.WithdrawableEpoch = sEE + params.BeaconConfig().MinValidatorWithdrawabilityDelay - if err := st.UpdateValidatorAtIndex(c.Message.SourceIndex, source); err != nil { - return err - } - if err := st.AppendPendingConsolidation(c.Message.ToPendingConsolidation()); err != nil { - return err - } - } - - return nil -} diff --git a/beacon-chain/core/electra/consolidations_test.go b/beacon-chain/core/electra/consolidations_test.go index fbb2fdcdd77b..a1b4e4cec67b 100644 --- a/beacon-chain/core/electra/consolidations_test.go +++ b/beacon-chain/core/electra/consolidations_test.go @@ -5,19 +5,11 @@ import ( "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/crypto/bls/blst" - "github.com/prysmaticlabs/prysm/v5/crypto/bls/common" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/runtime/interop" "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestProcessPendingConsolidations(t *testing.T) { @@ -237,205 +229,3 @@ func stateWithActiveBalanceETH(t *testing.T, balETH uint64) state.BeaconState { return st } - -func TestProcessConsolidations(t *testing.T) { - secretKeys, publicKeys, err := interop.DeterministicallyGenerateKeys(0, 2) - require.NoError(t, err) - - genesisValidatorRoot := bytesutil.PadTo([]byte("genesisValidatorRoot"), fieldparams.RootLength) - - _ = secretKeys - - tests := []struct { - name string - state state.BeaconState - scs []*eth.SignedConsolidation - check func(*testing.T, state.BeaconState) - wantErr string - }{ - { - name: "nil state", - scs: make([]*eth.SignedConsolidation, 10), - wantErr: "nil state", - }, - { - name: "nil consolidation in slice", - state: stateWithActiveBalanceETH(t, 19_000_000), - scs: []*eth.SignedConsolidation{nil, nil}, - wantErr: "nil consolidation", - }, - { - name: "state is 100% full of pending consolidations", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - pc := make([]*eth.PendingConsolidation, params.BeaconConfig().PendingConsolidationsLimit) - require.NoError(t, st.SetPendingConsolidations(pc)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{}}}, - wantErr: "pending consolidations queue is full", - }, - { - name: "state has too little consolidation churn limit available to process a consolidation", - state: func() state.BeaconState { - st, _ := util.DeterministicGenesisStateElectra(t, 1) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{}}}, - wantErr: "too little available consolidation churn limit", - }, - { - name: "consolidation with source and target as the same index is rejected", - state: stateWithActiveBalanceETH(t, 19_000_000), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 100}}}, - wantErr: "source and target index are the same", - }, - { - name: "consolidation with inactive source is rejected", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - val, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - val.ActivationEpoch = params.BeaconConfig().FarFutureEpoch - require.NoError(t, st.UpdateValidatorAtIndex(25, val)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 25, TargetIndex: 100}}}, - wantErr: "source is not active", - }, - { - name: "consolidation with inactive target is rejected", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - val, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - val.ActivationEpoch = params.BeaconConfig().FarFutureEpoch - require.NoError(t, st.UpdateValidatorAtIndex(25, val)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, - wantErr: "target is not active", - }, - { - name: "consolidation with exiting source is rejected", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - val, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - val.ExitEpoch = 256 - require.NoError(t, st.UpdateValidatorAtIndex(25, val)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 25, TargetIndex: 100}}}, - wantErr: "source exit epoch has been initiated", - }, - { - name: "consolidation with exiting target is rejected", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - val, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - val.ExitEpoch = 256 - require.NoError(t, st.UpdateValidatorAtIndex(25, val)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, - wantErr: "target exit epoch has been initiated", - }, - { - name: "consolidation with future epoch is rejected", - state: stateWithActiveBalanceETH(t, 19_000_000), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25, Epoch: 55}}}, - wantErr: "consolidation is not valid yet", - }, - { - name: "source validator without withdrawal credentials is rejected", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - val, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - val.WithdrawalCredentials = []byte{} - require.NoError(t, st.UpdateValidatorAtIndex(25, val)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 25, TargetIndex: 100}}}, - wantErr: "source does not have execution withdrawal credentials", - }, - { - name: "target validator without withdrawal credentials is rejected", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - val, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - val.WithdrawalCredentials = []byte{} - require.NoError(t, st.UpdateValidatorAtIndex(25, val)) - return st - }(), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, - wantErr: "target does not have execution withdrawal credentials", - }, - { - name: "source and target with different withdrawal credentials is rejected", - state: stateWithActiveBalanceETH(t, 19_000_000), - scs: []*eth.SignedConsolidation{{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25}}}, - wantErr: "source and target have different withdrawal credentials", - }, - { - name: "consolidation with valid signatures is OK", - state: func() state.BeaconState { - st := stateWithActiveBalanceETH(t, 19_000_000) - require.NoError(t, st.SetGenesisValidatorsRoot(genesisValidatorRoot)) - source, err := st.ValidatorAtIndex(100) - require.NoError(t, err) - target, err := st.ValidatorAtIndex(25) - require.NoError(t, err) - source.PublicKey = publicKeys[0].Marshal() - source.WithdrawalCredentials = target.WithdrawalCredentials - require.NoError(t, st.UpdateValidatorAtIndex(100, source)) - target.PublicKey = publicKeys[1].Marshal() - require.NoError(t, st.UpdateValidatorAtIndex(25, target)) - return st - }(), - scs: func() []*eth.SignedConsolidation { - sc := ð.SignedConsolidation{Message: ð.Consolidation{SourceIndex: 100, TargetIndex: 25, Epoch: 8}} - - domain, err := signing.ComputeDomain( - params.BeaconConfig().DomainConsolidation, - nil, - genesisValidatorRoot, - ) - require.NoError(t, err) - sr, err := signing.ComputeSigningRoot(sc.Message, domain) - require.NoError(t, err) - - sig0 := secretKeys[0].Sign(sr[:]) - sig1 := secretKeys[1].Sign(sr[:]) - - sc.Signature = blst.AggregateSignatures([]common.Signature{sig0, sig1}).Marshal() - - return []*eth.SignedConsolidation{sc} - }(), - check: func(t *testing.T, st state.BeaconState) { - source, err := st.ValidatorAtIndex(100) - require.NoError(t, err) - // The consolidated validator is exiting. - require.Equal(t, primitives.Epoch(15), source.ExitEpoch) // 15 = state.Epoch(10) + MIN_SEED_LOOKAHEAD(4) + 1 - require.Equal(t, primitives.Epoch(15+params.BeaconConfig().MinValidatorWithdrawabilityDelay), source.WithdrawableEpoch) - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := electra.ProcessConsolidations(context.TODO(), tt.state, tt.scs) - if len(tt.wantErr) > 0 { - require.ErrorContains(t, tt.wantErr, err) - } else { - require.NoError(t, err) - } - if tt.check != nil { - tt.check(t, tt.state) - } - }) - } -} diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index 7560175e7b33..f5cb4eb5c429 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -244,25 +244,26 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) CurrentSyncCommittee: currentSyncCommittee, NextSyncCommittee: nextSyncCommittee, LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: payloadHeader.ParentHash(), - FeeRecipient: payloadHeader.FeeRecipient(), - StateRoot: payloadHeader.StateRoot(), - ReceiptsRoot: payloadHeader.ReceiptsRoot(), - LogsBloom: payloadHeader.LogsBloom(), - PrevRandao: payloadHeader.PrevRandao(), - BlockNumber: payloadHeader.BlockNumber(), - GasLimit: payloadHeader.GasLimit(), - GasUsed: payloadHeader.GasUsed(), - Timestamp: payloadHeader.Timestamp(), - ExtraData: payloadHeader.ExtraData(), - BaseFeePerGas: payloadHeader.BaseFeePerGas(), - BlockHash: payloadHeader.BlockHash(), - TransactionsRoot: txRoot, - WithdrawalsRoot: wdRoot, - ExcessBlobGas: excessBlobGas, - BlobGasUsed: blobGasUsed, - DepositRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP6110] - WithdrawalRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7002] + ParentHash: payloadHeader.ParentHash(), + FeeRecipient: payloadHeader.FeeRecipient(), + StateRoot: payloadHeader.StateRoot(), + ReceiptsRoot: payloadHeader.ReceiptsRoot(), + LogsBloom: payloadHeader.LogsBloom(), + PrevRandao: payloadHeader.PrevRandao(), + BlockNumber: payloadHeader.BlockNumber(), + GasLimit: payloadHeader.GasLimit(), + GasUsed: payloadHeader.GasUsed(), + Timestamp: payloadHeader.Timestamp(), + ExtraData: payloadHeader.ExtraData(), + BaseFeePerGas: payloadHeader.BaseFeePerGas(), + BlockHash: payloadHeader.BlockHash(), + TransactionsRoot: txRoot, + WithdrawalsRoot: wdRoot, + ExcessBlobGas: excessBlobGas, + BlobGasUsed: blobGasUsed, + DepositRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP6110] + WithdrawalRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7002] + ConsolidationRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7251] }, NextWithdrawalIndex: wi, NextWithdrawalValidatorIndex: vi, diff --git a/beacon-chain/core/electra/upgrade_test.go b/beacon-chain/core/electra/upgrade_test.go index a5475acfd87c..9e6e20c8dff0 100644 --- a/beacon-chain/core/electra/upgrade_test.go +++ b/beacon-chain/core/electra/upgrade_test.go @@ -113,23 +113,24 @@ func TestUpgradeToElectra(t *testing.T) { wdRoot, err := prevHeader.WithdrawalsRoot() require.NoError(t, err) wanted := &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: prevHeader.ParentHash(), - FeeRecipient: prevHeader.FeeRecipient(), - StateRoot: prevHeader.StateRoot(), - ReceiptsRoot: prevHeader.ReceiptsRoot(), - LogsBloom: prevHeader.LogsBloom(), - PrevRandao: prevHeader.PrevRandao(), - BlockNumber: prevHeader.BlockNumber(), - GasLimit: prevHeader.GasLimit(), - GasUsed: prevHeader.GasUsed(), - Timestamp: prevHeader.Timestamp(), - ExtraData: prevHeader.ExtraData(), - BaseFeePerGas: prevHeader.BaseFeePerGas(), - BlockHash: prevHeader.BlockHash(), - TransactionsRoot: txRoot, - WithdrawalsRoot: wdRoot, - DepositRequestsRoot: bytesutil.Bytes32(0), - WithdrawalRequestsRoot: bytesutil.Bytes32(0), + ParentHash: prevHeader.ParentHash(), + FeeRecipient: prevHeader.FeeRecipient(), + StateRoot: prevHeader.StateRoot(), + ReceiptsRoot: prevHeader.ReceiptsRoot(), + LogsBloom: prevHeader.LogsBloom(), + PrevRandao: prevHeader.PrevRandao(), + BlockNumber: prevHeader.BlockNumber(), + GasLimit: prevHeader.GasLimit(), + GasUsed: prevHeader.GasUsed(), + Timestamp: prevHeader.Timestamp(), + ExtraData: prevHeader.ExtraData(), + BaseFeePerGas: prevHeader.BaseFeePerGas(), + BlockHash: prevHeader.BlockHash(), + TransactionsRoot: txRoot, + WithdrawalsRoot: wdRoot, + DepositRequestsRoot: bytesutil.Bytes32(0), + WithdrawalRequestsRoot: bytesutil.Bytes32(0), + ConsolidationRequestsRoot: bytesutil.Bytes32(0), } require.DeepEqual(t, wanted, protoHeader) diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index ee1e79e942b7..5d85879d8142 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -432,12 +432,7 @@ func electraOperations( if err != nil { return nil, err } - b := block.Body() - bod, ok := b.(interfaces.ROBlockBodyElectra) - if !ok { - return nil, errors.New("could not cast block body to electra block body") - } - e, err := bod.Execution() + e, err := block.Body().Execution() if err != nil { return nil, errors.Wrap(err, "could not get execution data from block") } @@ -455,9 +450,8 @@ func electraOperations( return nil, errors.Wrap(err, "could not process deposit receipts") } - if err := electra.ProcessConsolidations(ctx, st, bod.Consolidations()); err != nil { - return nil, errors.Wrap(err, "could not process consolidations") - } + // TODO: Process consolidations from execution header. + return st, nil } diff --git a/beacon-chain/db/kv/blocks_test.go b/beacon-chain/db/kv/blocks_test.go index 801c175b4f30..cc6805f1fbba 100644 --- a/beacon-chain/db/kv/blocks_test.go +++ b/beacon-chain/db/kv/blocks_test.go @@ -132,16 +132,6 @@ var blockTests = []struct { b.Block.Slot = slot if root != nil { b.Block.ParentRoot = root - b.Block.Body.Consolidations = []*ethpb.SignedConsolidation{ - { - Message: ðpb.Consolidation{ - SourceIndex: 1, - TargetIndex: 2, - Epoch: 3, - }, - Signature: make([]byte, 96), - }, - } } return blocks.NewSignedBeaconBlock(b) }, @@ -153,16 +143,6 @@ var blockTests = []struct { b.Message.Slot = slot if root != nil { b.Message.ParentRoot = root - b.Message.Body.Consolidations = []*ethpb.SignedConsolidation{ - { - Message: ðpb.Consolidation{ - SourceIndex: 1, - TargetIndex: 2, - Epoch: 3, - }, - Signature: make([]byte, 96), - }, - } } return blocks.NewSignedBeaconBlock(b) }}, diff --git a/beacon-chain/db/kv/state_test.go b/beacon-chain/db/kv/state_test.go index f7af8bd4213a..f6f63593f8be 100644 --- a/beacon-chain/db/kv/state_test.go +++ b/beacon-chain/db/kv/state_test.go @@ -138,19 +138,20 @@ func TestState_CanSaveRetrieve(t *testing.T) { require.NoError(t, err) require.NoError(t, st.SetSlot(100)) p, err := blocks.WrappedExecutionPayloadHeaderElectra(&enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: []byte("foo"), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - DepositRequestsRoot: make([]byte, 32), - WithdrawalRequestsRoot: make([]byte, 32), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: []byte("foo"), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + DepositRequestsRoot: make([]byte, 32), + WithdrawalRequestsRoot: make([]byte, 32), + ConsolidationRequestsRoot: make([]byte, 32), }) require.NoError(t, err) require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) diff --git a/beacon-chain/p2p/encoder/ssz_test.go b/beacon-chain/p2p/encoder/ssz_test.go index 9fa8a1cc4a10..17c93286fc2b 100644 --- a/beacon-chain/p2p/encoder/ssz_test.go +++ b/beacon-chain/p2p/encoder/ssz_test.go @@ -112,8 +112,6 @@ type HistoricalSummaryCreator struct{} type BlobIdentifierCreator struct{} type PendingBalanceDepositCreator struct{} type PendingPartialWithdrawalCreator struct{} -type ConsolidationCreator struct{} -type SignedConsolidationCreator struct{} type PendingConsolidationCreator struct{} type StatusCreator struct{} type BeaconBlocksByRangeRequestCreator struct{} @@ -287,10 +285,6 @@ func (PendingBalanceDepositCreator) Create() MarshalerProtoMessage { func (PendingPartialWithdrawalCreator) Create() MarshalerProtoMessage { return ðpb.PendingPartialWithdrawal{} } -func (ConsolidationCreator) Create() MarshalerProtoMessage { return ðpb.Consolidation{} } -func (SignedConsolidationCreator) Create() MarshalerProtoMessage { - return ðpb.SignedConsolidation{} -} func (PendingConsolidationCreator) Create() MarshalerProtoMessage { return ðpb.PendingConsolidation{} } @@ -405,8 +399,6 @@ var creators = []MarshalerProtoCreator{ BlobIdentifierCreator{}, PendingBalanceDepositCreator{}, PendingPartialWithdrawalCreator{}, - ConsolidationCreator{}, - SignedConsolidationCreator{}, PendingConsolidationCreator{}, StatusCreator{}, BeaconBlocksByRangeRequestCreator{}, @@ -553,26 +545,6 @@ func TestSszNetworkEncoder_RoundTrip_SignedVoluntaryExit(t *testing.T) { assertProtoMessagesEqual(t, decoded, msg) } -func TestSszNetworkEncoder_RoundTrip_Consolidation(t *testing.T) { - e := &encoder.SszNetworkEncoder{} - buf := new(bytes.Buffer) - - data := []byte("\xc800") - msg := ðpb.Consolidation{} - - if err := proto.Unmarshal(data, msg); err != nil { - t.Logf("Failed to unmarshal: %v", err) - return - } - - _, err := e.EncodeGossip(buf, msg) - require.NoError(t, err) - decoded := ðpb.Consolidation{} - require.NoError(t, e.DecodeGossip(buf.Bytes(), decoded)) - - assertProtoMessagesEqual(t, decoded, msg) -} - func TestSszNetworkEncoder_RoundTrip(t *testing.T) { e := &encoder.SszNetworkEncoder{} testRoundTripWithLength(t, e) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go index 8e1a9f9bcc1e..9a8365d3c0fa 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/construct_generic_block_test.go @@ -25,16 +25,6 @@ func TestConstructGenericBeaconBlock(t *testing.T) { // Test for Electra version t.Run("electra block", func(t *testing.T) { eb := util.NewBeaconBlockElectra() - eb.Block.Body.Consolidations = []*eth.SignedConsolidation{ - { - Signature: make([]byte, 96), - Message: ð.Consolidation{ - SourceIndex: 1, - TargetIndex: 2, - Epoch: 3, - }, - }, - } b, err := blocks.NewSignedBeaconBlock(eb) require.NoError(t, err) r1, err := eb.Block.HashTreeRoot() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index f10023a80c21..39bfb8b6d67c 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -592,16 +592,6 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { ParentRoot: parentRoot[:], StateRoot: genesis.Block.StateRoot, Body: ðpb.BeaconBlockBodyElectra{ - Consolidations: []*ethpb.SignedConsolidation{ - { - Message: ðpb.Consolidation{ - SourceIndex: 1, - TargetIndex: 2, - Epoch: 3, - }, - Signature: bytesutil.PadTo([]byte("sig"), 96), - }, - }, RandaoReveal: genesis.Block.Body.RandaoReveal, Graffiti: genesis.Block.Body.Graffiti, Eth1Data: genesis.Block.Body.Eth1Data, @@ -644,18 +634,26 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { Amount: 789, }, } + cr := []*enginev1.ConsolidationRequest{ + { + SourceAddress: bytesutil.PadTo([]byte("sa"), 20), + SourcePubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), + TargetPubkey: bytesutil.PadTo(privKeys[2].PublicKey().Marshal(), 48), + }, + } payload := &enginev1.ExecutionPayloadElectra{ - Timestamp: uint64(timeStamp.Unix()), - ParentHash: make([]byte, fieldparams.RootLength), - FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, fieldparams.LogsBloomLength), - PrevRandao: random, - BaseFeePerGas: make([]byte, fieldparams.RootLength), - BlockHash: make([]byte, fieldparams.RootLength), - DepositRequests: dr, - WithdrawalRequests: wr, + Timestamp: uint64(timeStamp.Unix()), + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: random, + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + DepositRequests: dr, + WithdrawalRequests: wr, + ConsolidationRequests: cr, } proposerServer := getProposerServer(db, beaconState, parentRoot[:]) diff --git a/beacon-chain/state/state-native/getters_withdrawal_test.go b/beacon-chain/state/state-native/getters_withdrawal_test.go index fc738949425e..bfaa841bc585 100644 --- a/beacon-chain/state/state-native/getters_withdrawal_test.go +++ b/beacon-chain/state/state-native/getters_withdrawal_test.go @@ -333,6 +333,7 @@ func TestExpectedWithdrawals(t *testing.T) { } t.Run("electra all pending partial withdrawals", func(t *testing.T) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // This spectest has a fully hydrated beacon state with partial pending withdrawals. serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/execution_layer_withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy") diff --git a/beacon-chain/state/state-native/setters_churn_test.go b/beacon-chain/state/state-native/setters_churn_test.go index 397932023d3b..eb4b7106e5d3 100644 --- a/beacon-chain/state/state-native/setters_churn_test.go +++ b/beacon-chain/state/state-native/setters_churn_test.go @@ -15,6 +15,7 @@ import ( ) func TestExitEpochAndUpdateChurn_SpectestCase(t *testing.T) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // The spec tests shows that the exit epoch is 262 for validator 0 performing a voluntary exit. serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/voluntary_exit/pyspec_tests/exit_existing_churn_and_churn_limit_balance/pre.ssz_snappy") diff --git a/beacon-chain/state/state-native/state_trie_test.go b/beacon-chain/state/state-native/state_trie_test.go index 2fa4858a9f73..6b36186fe6e3 100644 --- a/beacon-chain/state/state-native/state_trie_test.go +++ b/beacon-chain/state/state-native/state_trie_test.go @@ -844,6 +844,7 @@ func TestBeaconState_InitializeInactivityScoresCorrectly_Deneb(t *testing.T) { } func TestBeaconChainCopy_Electra(t *testing.T) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // This is a fully hydrated random test case from spectests. serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/ssz_static/BeaconState/ssz_random/case_0/serialized.ssz_snappy") diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index d6c838d269c7..6160fb2b1d51 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -38,4 +38,5 @@ const ( PendingConsolidationsLimit = 262144 // Maximum number of pending consolidations in the beacon state. MaxDepositRequestsPerPayload = 8192 // Maximum number of deposit requests in an execution payload. MaxWithdrawalRequestsPerPayload = 16 // Maximum number of execution layer withdrawal requests in an execution payload. + MaxConsolidationRequestsPerPayload = 1 // Maximum number of consolidation requests in an execution payload. ) diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index cf5dfdc925ae..d9bc80191532 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -38,4 +38,5 @@ const ( PendingConsolidationsLimit = 64 // Maximum number of pending consolidations in the beacon state. MaxDepositRequestsPerPayload = 4 // Maximum number of deposit requests in an execution payload. MaxWithdrawalRequestsPerPayload = 2 // Maximum number of execution layer withdrawal requests in an execution payload. + MaxConsolidationRequestsPerPayload = 1 // Maximum number of consolidation requests in an execution payload. ) diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index 26b415d78370..6d47aa3c5a8f 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -14,6 +14,8 @@ import ( "google.golang.org/protobuf/proto" ) +var _ interfaces.ExecutionDataElectra = (*executionPayloadElectra)(nil) + // executionPayload is a convenience wrapper around a beacon block body's execution payload data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -824,26 +826,33 @@ func PayloadToHeaderElectra(payload interfaces.ExecutionDataElectra) (*enginev1. return nil, err } + consolidationRequests := payload.ConsolidationRequests() + consolidationRequestsRoot, err := ssz.ConsolidationRequestsSliceRoot(consolidationRequests, fieldparams.MaxConsolidationRequestsPerPayload) + if err != nil { + return nil, err + } + return &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash()), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient()), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot()), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot()), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom()), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao()), - BlockNumber: payload.BlockNumber(), - GasLimit: payload.GasLimit(), - GasUsed: payload.GasUsed(), - Timestamp: payload.Timestamp(), - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData()), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas()), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash()), - TransactionsRoot: txRoot[:], - WithdrawalsRoot: withdrawalsRoot[:], - BlobGasUsed: blobGasUsed, - ExcessBlobGas: excessBlobGas, - DepositRequestsRoot: depositRequestsRoot[:], - WithdrawalRequestsRoot: withdrawalRequestsRoot[:], + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash()), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient()), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot()), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot()), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom()), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao()), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData()), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas()), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash()), + TransactionsRoot: txRoot[:], + WithdrawalsRoot: withdrawalsRoot[:], + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + DepositRequestsRoot: depositRequestsRoot[:], + WithdrawalRequestsRoot: withdrawalRequestsRoot[:], + ConsolidationRequestsRoot: consolidationRequestsRoot[:], }, nil } @@ -1243,7 +1252,6 @@ type executionPayloadHeaderElectra struct { } var _ interfaces.ExecutionData = &executionPayloadElectra{} -var _ interfaces.ExecutionDataElectra = &executionPayloadElectra{} // WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra) (interfaces.ExecutionData, error) { @@ -1421,7 +1429,6 @@ func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra) (interf } var _ interfaces.ExecutionData = &executionPayloadElectra{} -var _ interfaces.ExecutionDataElectra = &executionPayloadElectra{} // IsNil checks if the underlying data is nil. func (e executionPayloadElectra) IsNil() bool { @@ -1566,6 +1573,11 @@ func (e executionPayloadElectra) WithdrawalRequests() []*enginev1.WithdrawalRequ return e.p.WithdrawalRequests } +// ConsolidationRequests -- +func (e executionPayloadElectra) ConsolidationRequests() []*enginev1.ConsolidationRequest { + return e.p.ConsolidationRequests +} + // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadElectra) IsBlinded() bool { return false diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index 9e4db86fe6c5..2de69c0c03be 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -459,11 +459,6 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea if err != nil { return nil, err } - electraBody, ok := b.Body().(interfaces.ROBlockBodyElectra) - if !ok { - return nil, errors.Wrapf(interfaces.ErrInvalidCast, "%T does not support electra getters", b.Body()) - } - consolidations := electraBody.Consolidations() var atts []*eth.AttestationElectra if b.Body().Attestations() != nil { atts = make([]*eth.AttestationElectra, len(b.Body().Attestations())) @@ -505,7 +500,6 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea ExecutionPayload: p, BlsToExecutionChanges: blsToExecutionChanges, BlobKzgCommitments: commitments, - Consolidations: consolidations, }, }, Signature: sig[:], diff --git a/consensus-types/blocks/factory_test.go b/consensus-types/blocks/factory_test.go index cca68452581e..d2e9b7a870d0 100644 --- a/consensus-types/blocks/factory_test.go +++ b/consensus-types/blocks/factory_test.go @@ -6,7 +6,6 @@ import ( "testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -537,26 +536,3 @@ func TestBuildSignedBeaconBlockFromExecutionPayload(t *testing.T) { require.DeepEqual(t, uint64(321), payload.BlobGasUsed) }) } - -func TestElectraBlockBodyCast(t *testing.T) { - t.Run("deneb cast fails", func(t *testing.T) { - pb := ð.BeaconBlockBodyDeneb{} - i, err := NewBeaconBlockBody(pb) - require.NoError(t, err) - b, ok := i.(*BeaconBlockBody) - require.Equal(t, true, ok) - assert.Equal(t, version.Deneb, b.version) - _, err = interfaces.AsROBlockBodyElectra(b) - require.ErrorIs(t, err, interfaces.ErrInvalidCast) - }) - t.Run("electra cast succeeds", func(t *testing.T) { - pb := ð.BeaconBlockBodyElectra{} - i, err := NewBeaconBlockBody(pb) - require.NoError(t, err) - b, ok := i.(*BeaconBlockBody) - require.Equal(t, true, ok) - assert.Equal(t, version.Electra, b.version) - _, err = interfaces.AsROBlockBodyElectra(b) - require.NoError(t, err) - }) -} diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 4ba4b5176710..72ad16c76444 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -277,7 +277,6 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e ExecutionPayloadHeader: header, BlsToExecutionChanges: b.block.body.blsToExecutionChanges, BlobKzgCommitments: b.block.body.blobKzgCommitments, - Consolidations: b.block.body.signedConsolidations, }, }, Signature: b.signature[:], @@ -1132,10 +1131,6 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { } } -func (b *BeaconBlockBody) Consolidations() []*eth.SignedConsolidation { - return b.signedConsolidations -} - // Version returns the version of the beacon block body func (b *BeaconBlockBody) Version() int { return b.version diff --git a/consensus-types/blocks/proto.go b/consensus-types/blocks/proto.go index d00e42cdde6a..af75d83e6ee8 100644 --- a/consensus-types/blocks/proto.go +++ b/consensus-types/blocks/proto.go @@ -531,7 +531,6 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) { ExecutionPayloadHeader: ph, BlsToExecutionChanges: b.blsToExecutionChanges, BlobKzgCommitments: b.blobKzgCommitments, - Consolidations: b.signedConsolidations, }, nil } var p *enginev1.ExecutionPayloadElectra @@ -555,7 +554,6 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) { ExecutionPayload: p, BlsToExecutionChanges: b.blsToExecutionChanges, BlobKzgCommitments: b.blobKzgCommitments, - Consolidations: b.signedConsolidations, }, nil default: @@ -1158,7 +1156,6 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock executionPayload: p, blsToExecutionChanges: pb.BlsToExecutionChanges, blobKzgCommitments: pb.BlobKzgCommitments, - signedConsolidations: pb.Consolidations, } return b, nil } @@ -1187,7 +1184,6 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) executionPayloadHeader: ph, blsToExecutionChanges: pb.BlsToExecutionChanges, blobKzgCommitments: pb.BlobKzgCommitments, - signedConsolidations: pb.Consolidations, } return b, nil } diff --git a/consensus-types/blocks/types.go b/consensus-types/blocks/types.go index b450ede83332..093be45a2cd6 100644 --- a/consensus-types/blocks/types.go +++ b/consensus-types/blocks/types.go @@ -54,11 +54,9 @@ type BeaconBlockBody struct { executionPayloadHeader interfaces.ExecutionData blsToExecutionChanges []*eth.SignedBLSToExecutionChange blobKzgCommitments [][]byte - signedConsolidations []*eth.SignedConsolidation } var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{} -var _ interfaces.ROBlockBodyElectra = &BeaconBlockBody{} // BeaconBlock is the main beacon block structure. It can represent any block type. type BeaconBlock struct { diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index 0ae8ae86cb42..9e17fe3adf00 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", srcs = [ "beacon_block.go", - "cast.go", "error.go", "utils.go", "validator.go", diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index fd708746fd2a..42ad27d0a459 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -71,11 +71,6 @@ type ReadOnlyBeaconBlockBody interface { BlobKzgCommitments() ([][]byte, error) } -type ROBlockBodyElectra interface { - ReadOnlyBeaconBlockBody - Consolidations() []*ethpb.SignedConsolidation -} - type SignedBeaconBlock interface { ReadOnlySignedBeaconBlock SetExecution(ExecutionData) error @@ -132,4 +127,5 @@ type ExecutionDataElectra interface { ExecutionData DepositRequests() []*enginev1.DepositRequest WithdrawalRequests() []*enginev1.WithdrawalRequest + ConsolidationRequests() []*enginev1.ConsolidationRequest } diff --git a/consensus-types/interfaces/cast.go b/consensus-types/interfaces/cast.go deleted file mode 100644 index 29f0c7a83082..000000000000 --- a/consensus-types/interfaces/cast.go +++ /dev/null @@ -1,15 +0,0 @@ -package interfaces - -import "github.com/prysmaticlabs/prysm/v5/runtime/version" - -// AsROBlockBodyElectra safely asserts the ReadOnlyBeaconBlockBody to a ROBlockBodyElectra. -// This allows the caller to access methods on the block body which are only available on values after -// the Electra hard fork. If the value is for an earlier fork (based on comparing its Version() to the electra version) -// an error will be returned. Callers that want to conditionally process electra data can check for this condition -// and safely ignore it like `if err != nil && errors.Is(interfaces.ErrInvalidCast) {` -func AsROBlockBodyElectra(in ReadOnlyBeaconBlockBody) (ROBlockBodyElectra, error) { - if in.Version() >= version.Electra { - return in.(ROBlockBodyElectra), nil - } - return nil, NewInvalidCastError(in.Version(), version.Electra) -} diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index 36fd58671077..dade8e41c734 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -276,10 +276,6 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { func (b *BeaconBlockBody) Attestations() []eth.Att { panic("implement me") } -func (b *BeaconBlockBody) Consolidations() []*eth.SignedConsolidation { - panic("implement me") -} - func (b *BeaconBlockBody) Version() int { panic("implement me") } @@ -287,4 +283,3 @@ func (b *BeaconBlockBody) Version() int { var _ interfaces.ReadOnlySignedBeaconBlock = &SignedBeaconBlock{} var _ interfaces.ReadOnlyBeaconBlock = &BeaconBlock{} var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{} -var _ interfaces.ROBlockBodyElectra = &BeaconBlockBody{} diff --git a/encoding/ssz/htrutils.go b/encoding/ssz/htrutils.go index 5441d1612aed..d0581d47e809 100644 --- a/encoding/ssz/htrutils.go +++ b/encoding/ssz/htrutils.go @@ -153,6 +153,13 @@ func WithdrawalRequestsSliceRoot(withdrawalRequests []*enginev1.WithdrawalReques return SliceRoot(withdrawalRequests, limit) } +// ConsolidationRequestsSliceRoot computes the HTR of a slice of consolidation requests from the EL. +// The limit parameter is used as input to the bitwise merkleization algorithm. + +func ConsolidationRequestsSliceRoot(consolidationRequests []*enginev1.ConsolidationRequest, limit uint64) ([32]byte, error) { + return SliceRoot(consolidationRequests, limit) +} + // ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N] // this func runs Chunkify + MerkleizeVector // max length is dividable by 32 ( root length ) diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index af0a37c8e97f..bc9138b82dc5 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -49,6 +49,7 @@ ssz_gen_marshal( "Withdrawal", "WithdrawalRequest", "DepositRequest", + "ConsolidationRequest", ], ) diff --git a/proto/engine/v1/engine.ssz.go b/proto/engine/v1/engine.ssz.go index 8733bbdd88ec..0f5488b9bbc2 100644 --- a/proto/engine/v1/engine.ssz.go +++ b/proto/engine/v1/engine.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: fead48d52c26c5db4af980b0552c414ffc58387819201e533a44a3e8f4dde5df +// Hash: d1cee811bee5b5cfcedf5be00dfff21d5e6caf432cd8fc42f551264f7b8e296c package enginev1 import ( @@ -1266,7 +1266,7 @@ func (e *ExecutionPayloadElectra) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the ExecutionPayloadElectra object to a target array func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(536) + offset := int(540) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -1365,6 +1365,10 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro dst = ssz.WriteOffset(dst, offset) offset += len(e.WithdrawalRequests) * 76 + // Offset (19) 'ConsolidationRequests' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.ConsolidationRequests) * 116 + // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -1425,6 +1429,17 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro } } + // Field (19) 'ConsolidationRequests' + if size := len(e.ConsolidationRequests); size > 1 { + err = ssz.ErrListTooBigFn("--.ConsolidationRequests", size, 1) + return + } + for ii := 0; ii < len(e.ConsolidationRequests); ii++ { + if dst, err = e.ConsolidationRequests[ii].MarshalSSZTo(dst); err != nil { + return + } + } + return } @@ -1432,12 +1447,12 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 536 { + if size < 540 { return ssz.ErrSize } tail := buf - var o10, o13, o14, o17, o18 uint64 + var o10, o13, o14, o17, o18, o19 uint64 // Field (0) 'ParentHash' if cap(e.ParentHash) == 0 { @@ -1492,7 +1507,7 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 != 536 { + if o10 != 540 { return ssz.ErrInvalidVariableOffset } @@ -1534,6 +1549,11 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } + // Offset (19) 'ConsolidationRequests' + if o19 = ssz.ReadOffset(buf[536:540]); o19 > size || o18 > o19 { + return ssz.ErrOffset + } + // Field (10) 'ExtraData' { buf = tail[o10:o13] @@ -1607,7 +1627,7 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { // Field (18) 'WithdrawalRequests' { - buf = tail[o18:] + buf = tail[o18:o19] num, err := ssz.DivideInt2(len(buf), 76, 16) if err != nil { return err @@ -1622,12 +1642,30 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { } } } + + // Field (19) 'ConsolidationRequests' + { + buf = tail[o19:] + num, err := ssz.DivideInt2(len(buf), 116, 1) + if err != nil { + return err + } + e.ConsolidationRequests = make([]*ConsolidationRequest, num) + for ii := 0; ii < num; ii++ { + if e.ConsolidationRequests[ii] == nil { + e.ConsolidationRequests[ii] = new(ConsolidationRequest) + } + if err = e.ConsolidationRequests[ii].UnmarshalSSZ(buf[ii*116 : (ii+1)*116]); err != nil { + return err + } + } + } return err } // SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadElectra object func (e *ExecutionPayloadElectra) SizeSSZ() (size int) { - size = 536 + size = 540 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -1647,6 +1685,9 @@ func (e *ExecutionPayloadElectra) SizeSSZ() (size int) { // Field (18) 'WithdrawalRequests' size += len(e.WithdrawalRequests) * 76 + // Field (19) 'ConsolidationRequests' + size += len(e.ConsolidationRequests) * 116 + return } @@ -1816,6 +1857,22 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.MerkleizeWithMixin(subIndx, num, 16) } + // Field (19) 'ConsolidationRequests' + { + subIndx := hh.Index() + num := uint64(len(e.ConsolidationRequests)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.ConsolidationRequests { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1) + } + hh.Merkleize(indx) return } @@ -2813,7 +2870,7 @@ func (e *ExecutionPayloadHeaderElectra) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the ExecutionPayloadHeaderElectra object to a target array func (e *ExecutionPayloadHeaderElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(648) + offset := int(680) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -2921,6 +2978,13 @@ func (e *ExecutionPayloadHeaderElectra) MarshalSSZTo(buf []byte) (dst []byte, er } dst = append(dst, e.WithdrawalRequestsRoot...) + // Field (19) 'ConsolidationRequestsRoot' + if size := len(e.ConsolidationRequestsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ConsolidationRequestsRoot", size, 32) + return + } + dst = append(dst, e.ConsolidationRequestsRoot...) + // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -2935,7 +2999,7 @@ func (e *ExecutionPayloadHeaderElectra) MarshalSSZTo(buf []byte) (dst []byte, er func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 648 { + if size < 680 { return ssz.ErrSize } @@ -2995,7 +3059,7 @@ func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 != 648 { + if o10 != 680 { return ssz.ErrInvalidVariableOffset } @@ -3041,6 +3105,12 @@ func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { } e.WithdrawalRequestsRoot = append(e.WithdrawalRequestsRoot, buf[616:648]...) + // Field (19) 'ConsolidationRequestsRoot' + if cap(e.ConsolidationRequestsRoot) == 0 { + e.ConsolidationRequestsRoot = make([]byte, 0, len(buf[648:680])) + } + e.ConsolidationRequestsRoot = append(e.ConsolidationRequestsRoot, buf[648:680]...) + // Field (10) 'ExtraData' { buf = tail[o10:] @@ -3057,7 +3127,7 @@ func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { // SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderElectra object func (e *ExecutionPayloadHeaderElectra) SizeSSZ() (size int) { - size = 648 + size = 680 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -3188,6 +3258,13 @@ func (e *ExecutionPayloadHeaderElectra) HashTreeRootWith(hh *ssz.Hasher) (err er } hh.PutBytes(e.WithdrawalRequestsRoot) + // Field (19) 'ConsolidationRequestsRoot' + if size := len(e.ConsolidationRequestsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ConsolidationRequestsRoot", size, 32) + return + } + hh.PutBytes(e.ConsolidationRequestsRoot) + hh.Merkleize(indx) return } @@ -3721,3 +3798,105 @@ func (d *DepositRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.Merkleize(indx) return } + +// MarshalSSZ ssz marshals the ConsolidationRequest object +func (c *ConsolidationRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(c) +} + +// MarshalSSZTo ssz marshals the ConsolidationRequest object to a target array +func (c *ConsolidationRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'SourceAddress' + if size := len(c.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) + return + } + dst = append(dst, c.SourceAddress...) + + // Field (1) 'SourcePubkey' + if size := len(c.SourcePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.SourcePubkey", size, 48) + return + } + dst = append(dst, c.SourcePubkey...) + + // Field (2) 'TargetPubkey' + if size := len(c.TargetPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.TargetPubkey", size, 48) + return + } + dst = append(dst, c.TargetPubkey...) + + return +} + +// UnmarshalSSZ ssz unmarshals the ConsolidationRequest object +func (c *ConsolidationRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 116 { + return ssz.ErrSize + } + + // Field (0) 'SourceAddress' + if cap(c.SourceAddress) == 0 { + c.SourceAddress = make([]byte, 0, len(buf[0:20])) + } + c.SourceAddress = append(c.SourceAddress, buf[0:20]...) + + // Field (1) 'SourcePubkey' + if cap(c.SourcePubkey) == 0 { + c.SourcePubkey = make([]byte, 0, len(buf[20:68])) + } + c.SourcePubkey = append(c.SourcePubkey, buf[20:68]...) + + // Field (2) 'TargetPubkey' + if cap(c.TargetPubkey) == 0 { + c.TargetPubkey = make([]byte, 0, len(buf[68:116])) + } + c.TargetPubkey = append(c.TargetPubkey, buf[68:116]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ConsolidationRequest object +func (c *ConsolidationRequest) SizeSSZ() (size int) { + size = 116 + return +} + +// HashTreeRoot ssz hashes the ConsolidationRequest object +func (c *ConsolidationRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(c) +} + +// HashTreeRootWith ssz hashes the ConsolidationRequest object with a hasher +func (c *ConsolidationRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'SourceAddress' + if size := len(c.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) + return + } + hh.PutBytes(c.SourceAddress) + + // Field (1) 'SourcePubkey' + if size := len(c.SourcePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.SourcePubkey", size, 48) + return + } + hh.PutBytes(c.SourcePubkey) + + // Field (2) 'TargetPubkey' + if size := len(c.TargetPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.TargetPubkey", size, 48) + return + } + hh.PutBytes(c.TargetPubkey) + + hh.Merkleize(indx) + return +} diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index a24562c03984..f2edbf1c9597 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -571,25 +571,26 @@ type ExecutionPayloadElectra struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` - FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` - ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` - LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` - PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` - BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` - BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` - Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` - BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` - ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - DepositRequests []*DepositRequest `protobuf:"bytes,18,rep,name=deposit_requests,json=depositRequests,proto3" json:"deposit_requests,omitempty" ssz-max:"8192"` - WithdrawalRequests []*WithdrawalRequest `protobuf:"bytes,19,rep,name=withdrawal_requests,json=withdrawalRequests,proto3" json:"withdrawal_requests,omitempty" ssz-max:"16"` + ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` + FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` + StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` + LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` + PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` + BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` + BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` + Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` + Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` + BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` + ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` + DepositRequests []*DepositRequest `protobuf:"bytes,18,rep,name=deposit_requests,json=depositRequests,proto3" json:"deposit_requests,omitempty" ssz-max:"8192"` + WithdrawalRequests []*WithdrawalRequest `protobuf:"bytes,19,rep,name=withdrawal_requests,json=withdrawalRequests,proto3" json:"withdrawal_requests,omitempty" ssz-max:"16"` + ConsolidationRequests []*ConsolidationRequest `protobuf:"bytes,20,rep,name=consolidation_requests,json=consolidationRequests,proto3" json:"consolidation_requests,omitempty" ssz-max:"1"` } func (x *ExecutionPayloadElectra) Reset() { @@ -757,6 +758,13 @@ func (x *ExecutionPayloadElectra) GetWithdrawalRequests() []*WithdrawalRequest { return nil } +func (x *ExecutionPayloadElectra) GetConsolidationRequests() []*ConsolidationRequest { + if x != nil { + return x.ConsolidationRequests + } + return nil +} + type ExecutionPayloadElectraWithValueAndBlobsBundle struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1444,25 +1452,26 @@ type ExecutionPayloadHeaderElectra struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` - FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` - ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` - LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` - PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` - BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` - BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - TransactionsRoot []byte `protobuf:"bytes,14,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty" ssz-size:"32"` - WithdrawalsRoot []byte `protobuf:"bytes,15,opt,name=withdrawals_root,json=withdrawalsRoot,proto3" json:"withdrawals_root,omitempty" ssz-size:"32"` - BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` - ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - DepositRequestsRoot []byte `protobuf:"bytes,18,opt,name=deposit_requests_root,json=depositRequestsRoot,proto3" json:"deposit_requests_root,omitempty" ssz-size:"32"` - WithdrawalRequestsRoot []byte `protobuf:"bytes,19,opt,name=withdrawal_requests_root,json=withdrawalRequestsRoot,proto3" json:"withdrawal_requests_root,omitempty" ssz-size:"32"` + ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` + FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` + StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` + LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` + PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` + BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` + BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` + TransactionsRoot []byte `protobuf:"bytes,14,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty" ssz-size:"32"` + WithdrawalsRoot []byte `protobuf:"bytes,15,opt,name=withdrawals_root,json=withdrawalsRoot,proto3" json:"withdrawals_root,omitempty" ssz-size:"32"` + BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` + ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` + DepositRequestsRoot []byte `protobuf:"bytes,18,opt,name=deposit_requests_root,json=depositRequestsRoot,proto3" json:"deposit_requests_root,omitempty" ssz-size:"32"` + WithdrawalRequestsRoot []byte `protobuf:"bytes,19,opt,name=withdrawal_requests_root,json=withdrawalRequestsRoot,proto3" json:"withdrawal_requests_root,omitempty" ssz-size:"32"` + ConsolidationRequestsRoot []byte `protobuf:"bytes,20,opt,name=consolidation_requests_root,json=consolidationRequestsRoot,proto3" json:"consolidation_requests_root,omitempty" ssz-size:"32"` } func (x *ExecutionPayloadHeaderElectra) Reset() { @@ -1630,6 +1639,13 @@ func (x *ExecutionPayloadHeaderElectra) GetWithdrawalRequestsRoot() []byte { return nil } +func (x *ExecutionPayloadHeaderElectra) GetConsolidationRequestsRoot() []byte { + if x != nil { + return x.ConsolidationRequestsRoot + } + return nil +} + type PayloadAttributes struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2339,6 +2355,69 @@ func (x *DepositRequest) GetIndex() uint64 { return 0 } +type ConsolidationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress []byte `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" ssz-size:"20"` + SourcePubkey []byte `protobuf:"bytes,2,opt,name=source_pubkey,json=sourcePubkey,proto3" json:"source_pubkey,omitempty" ssz-size:"48"` + TargetPubkey []byte `protobuf:"bytes,3,opt,name=target_pubkey,json=targetPubkey,proto3" json:"target_pubkey,omitempty" ssz-size:"48"` +} + +func (x *ConsolidationRequest) Reset() { + *x = ConsolidationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConsolidationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsolidationRequest) ProtoMessage() {} + +func (x *ConsolidationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConsolidationRequest.ProtoReflect.Descriptor instead. +func (*ConsolidationRequest) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{22} +} + +func (x *ConsolidationRequest) GetSourceAddress() []byte { + if x != nil { + return x.SourceAddress + } + return nil +} + +func (x *ConsolidationRequest) GetSourcePubkey() []byte { + if x != nil { + return x.SourcePubkey + } + return nil +} + +func (x *ConsolidationRequest) GetTargetPubkey() []byte { + if x != nil { + return x.TargetPubkey + } + return nil +} + var File_proto_engine_v1_execution_engine_proto protoreflect.FileDescriptor var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ @@ -2472,7 +2551,7 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x9e, 0x07, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x86, 0x08, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, @@ -2530,220 +2609,231 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x89, 0x02, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, - 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, - 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, - 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, - 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x57, 0x69, - 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x57, 0x69, - 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, - 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, - 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, 0x04, 0x0a, - 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, - 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, - 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, - 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, - 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, - 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, - 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, - 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, - 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, - 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, - 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, - 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, - 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, - 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, - 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, - 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, - 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, 0x05, 0x0a, - 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, - 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, - 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, - 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, - 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, - 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, - 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, - 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, - 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, - 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, - 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, - 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, - 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, - 0x47, 0x61, 0x73, 0x22, 0xc4, 0x06, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, - 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, - 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, - 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, - 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, - 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, - 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, - 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, - 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, - 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, - 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, - 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, - 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, - 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, 0x0a, 0x15, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x73, 0x6f, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, + 0x89, 0x02, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, + 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, + 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x20, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, + 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, + 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, + 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, + 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, + 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, + 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, + 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, + 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, + 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, + 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, + 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, + 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, + 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, + 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, + 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, + 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, + 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, + 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, + 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, + 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, + 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, + 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, + 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, + 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, + 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, + 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, + 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, + 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, + 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, + 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x8c, 0x07, 0x0a, 0x1d, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, + 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, + 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, + 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, + 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, + 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, + 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, + 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, + 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, + 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, + 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, + 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, + 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, 0x0a, 0x15, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x46, 0x0a, 0x1b, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x19, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, @@ -2867,17 +2957,27 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, - 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, - 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x43, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, + 0x38, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, + 0x2b, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0c, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x42, 0x96, 0x01, 0x0a, + 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2893,7 +2993,7 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte { } var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload @@ -2918,6 +3018,7 @@ var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ (*ExchangeCapabilities)(nil), // 20: ethereum.engine.v1.ExchangeCapabilities (*WithdrawalRequest)(nil), // 21: ethereum.engine.v1.WithdrawalRequest (*DepositRequest)(nil), // 22: ethereum.engine.v1.DepositRequest + (*ConsolidationRequest)(nil), // 23: ethereum.engine.v1.ConsolidationRequest } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ 17, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal @@ -2925,19 +3026,20 @@ var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ 17, // 2: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal 22, // 3: ethereum.engine.v1.ExecutionPayloadElectra.deposit_requests:type_name -> ethereum.engine.v1.DepositRequest 21, // 4: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.WithdrawalRequest - 4, // 5: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra - 18, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 2, // 7: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 3, // 8: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 18, // 9: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 17, // 10: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 11: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 0, // 12: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 23, // 5: ethereum.engine.v1.ExecutionPayloadElectra.consolidation_requests:type_name -> ethereum.engine.v1.ConsolidationRequest + 4, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra + 18, // 7: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 2, // 8: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella + 3, // 9: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 18, // 10: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 17, // 11: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 17, // 12: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 0, // 13: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_proto_engine_v1_execution_engine_proto_init() } @@ -3210,6 +3312,18 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } + file_proto_engine_v1_execution_engine_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsolidationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3217,7 +3331,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc, NumEnums: 1, - NumMessages: 22, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index 7f56b8ea0aaf..33e3464410eb 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -102,6 +102,7 @@ message ExecutionPayloadElectra { uint64 excess_blob_gas = 17; repeated DepositRequest deposit_requests = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_requests_per_payload.size"]; // new in electra, eip6110 repeated WithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251 + repeated ConsolidationRequest consolidation_requests = 20 [(ethereum.eth.ext.ssz_max) = "max_consolidation_requests_per_payload.size"]; // new in electra, eip6110 } message ExecutionPayloadElectraWithValueAndBlobsBundle { @@ -199,6 +200,7 @@ message ExecutionPayloadHeaderElectra { uint64 excess_blob_gas = 17; bytes deposit_requests_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110 bytes withdrawal_requests_root = 19 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7002, eip7251 + bytes consolidation_requests_root = 20 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7251 } message PayloadAttributes { @@ -301,4 +303,15 @@ message DepositRequest { uint64 amount = 3; bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"]; uint64 index = 5; -} \ No newline at end of file +} + +// ConsolidationRequest is the message from the execution layer to trigger the consolidation of one +// validator to another validator. +message ConsolidationRequest { + // Source address of account which originated the request. + bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; + // Funds will be moved from this public key. + bytes source_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; + // Funds will be moved to this public key. + bytes target_pubkey = 3 [(ethereum.eth.ext.ssz_size) = "48"]; +} diff --git a/proto/eth/v1/gateway.ssz.go b/proto/eth/v1/gateway.ssz.go index a98bc8044622..630663138b11 100644 --- a/proto/eth/v1/gateway.ssz.go +++ b/proto/eth/v1/gateway.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 2874e1dadeb47411763f48fe31e5daaa91ac663e796933d9a508c2e7be94fa5e +// Hash: dc11029a7f019f6c900b35f68bbe0a9ff6ca31ba1f7d8c18518cad810690300d package v1 import ( diff --git a/proto/eth/v2/grpc.ssz.go b/proto/eth/v2/grpc.ssz.go index 3ccde83580b6..af4fd70ce818 100644 --- a/proto/eth/v2/grpc.ssz.go +++ b/proto/eth/v2/grpc.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6f33097dd41d3dd49d35b7cfceef5a1afca20f05d65b18215748b459db16f99b +// Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 package eth import ( diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 2b6e52ff9250..75b3b0cfd48f 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -309,7 +309,6 @@ go_library( srcs = [ "attestation.go", "cloners.go", - "eip_7251.go", "sync_committee_mainnet.go", "sync_committee_minimal.go", # keep ":ssz_generated_non_core", # keep @@ -373,7 +372,6 @@ go_test( name = "go_default_test", srcs = [ "cloners_test.go", - "eip_7251_test.go", ], embed = [":go_default_library"], deps = [ diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go index 80e4658f00fe..45521fbe747e 100644 --- a/proto/prysm/v1alpha1/altair.ssz.go +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: b49bce5f5d950b8c4ff7cad0c5c96bef67f82b91e1f36b2293b1b00e9755c051 +// Hash: c00c1be829cdae457076ef3e840f3af313626147927e503e90fb5585cf242d36 package eth import ( diff --git a/proto/prysm/v1alpha1/beacon_block.pb.go b/proto/prysm/v1alpha1/beacon_block.pb.go index 215e4b842d2c..7db66168e299 100755 --- a/proto/prysm/v1alpha1/beacon_block.pb.go +++ b/proto/prysm/v1alpha1/beacon_block.pb.go @@ -3594,7 +3594,6 @@ type BeaconBlockBodyElectra struct { ExecutionPayload *v1.ExecutionPayloadElectra `protobuf:"bytes,10,opt,name=execution_payload,json=executionPayload,proto3" json:"execution_payload,omitempty"` BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` - Consolidations []*SignedConsolidation `protobuf:"bytes,13,rep,name=consolidations,proto3" json:"consolidations,omitempty" ssz-max:"1"` } func (x *BeaconBlockBodyElectra) Reset() { @@ -3713,13 +3712,6 @@ func (x *BeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { return nil } -func (x *BeaconBlockBodyElectra) GetConsolidations() []*SignedConsolidation { - if x != nil { - return x.Consolidations - } - return nil -} - type SignedBlindedBeaconBlockElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3871,7 +3863,6 @@ type BlindedBeaconBlockBodyElectra struct { ExecutionPayloadHeader *v1.ExecutionPayloadHeaderElectra `protobuf:"bytes,10,opt,name=execution_payload_header,json=executionPayloadHeader,proto3" json:"execution_payload_header,omitempty"` BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` - Consolidations []*SignedConsolidation `protobuf:"bytes,13,rep,name=consolidations,proto3" json:"consolidations,omitempty" ssz-max:"1"` } func (x *BlindedBeaconBlockBodyElectra) Reset() { @@ -3990,13 +3981,6 @@ func (x *BlindedBeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { return nil } -func (x *BlindedBeaconBlockBodyElectra) GetConsolidations() []*SignedConsolidation { - if x != nil { - return x.Consolidations - } - return nil -} - type ValidatorRegistrationV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5767,8 +5751,8 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, - 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x9e, - 0x08, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xc3, + 0x07, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, @@ -5828,234 +5812,222 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x59, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, - 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, - 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0xb8, 0x08, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, - 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, - 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, - 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, - 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xdd, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, + 0xb5, 0x18, 0x01, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, + 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, + 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x12, 0x6b, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, + 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, + 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, + 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, + 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x31, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, + 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, + 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, 0x52, - 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, - 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, - 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, - 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, - 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, - 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x31, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, + 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, + 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0x8e, 0x01, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x22, 0x75, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, + 0x72, 0x42, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, + 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, - 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, - 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, - 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x59, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x0e, 0x63, 0x6f, 0x6e, - 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, - 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, - 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9c, 0x01, - 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x01, 0x0a, - 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, - 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, - 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, - 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5e, 0x0a, 0x13, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x1a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, 0x52, 0x18, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, - 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, - 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x42, 0x9b, 0x01, 0x0a, - 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, - 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, + 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, + 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, + 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, + 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, + 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, + 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, + 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, + 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, + 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, + 0x31, 0x37, 0x2c, 0x33, 0x32, 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, + 0x55, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, + 0x45, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, + 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, + 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6143,8 +6115,7 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_goTypes = []interface{}{ (*v1.ExecutionPayloadHeaderDeneb)(nil), // 68: ethereum.engine.v1.ExecutionPayloadHeaderDeneb (*AttestationElectra)(nil), // 69: ethereum.eth.v1alpha1.AttestationElectra (*v1.ExecutionPayloadElectra)(nil), // 70: ethereum.engine.v1.ExecutionPayloadElectra - (*SignedConsolidation)(nil), // 71: ethereum.eth.v1alpha1.SignedConsolidation - (*v1.ExecutionPayloadHeaderElectra)(nil), // 72: ethereum.engine.v1.ExecutionPayloadHeaderElectra + (*v1.ExecutionPayloadHeaderElectra)(nil), // 71: ethereum.engine.v1.ExecutionPayloadHeaderElectra } var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 3, // 0: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.phase0:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock @@ -6274,34 +6245,32 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 19, // 124: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate 70, // 125: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra 65, // 126: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 71, // 127: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.consolidations:type_name -> ethereum.eth.v1alpha1.SignedConsolidation - 46, // 128: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra - 47, // 129: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra - 14, // 130: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 131: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 10, // 132: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashingElectra - 69, // 133: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra - 11, // 134: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 13, // 135: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 19, // 136: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 72, // 137: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra - 65, // 138: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 71, // 139: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.consolidations:type_name -> ethereum.eth.v1alpha1.SignedConsolidation - 50, // 140: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 - 48, // 141: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 - 63, // 142: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 51, // 143: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid - 67, // 144: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 53, // 145: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella - 68, // 146: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb - 55, // 147: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb - 16, // 148: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader - 57, // 149: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar - 150, // [150:150] is the sub-list for method output_type - 150, // [150:150] is the sub-list for method input_type - 150, // [150:150] is the sub-list for extension type_name - 150, // [150:150] is the sub-list for extension extendee - 0, // [0:150] is the sub-list for field type_name + 46, // 127: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + 47, // 128: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra + 14, // 129: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 130: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 10, // 131: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashingElectra + 69, // 132: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 11, // 133: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 134: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 135: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 71, // 136: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra + 65, // 137: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 50, // 138: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 + 48, // 139: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 + 63, // 140: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 51, // 141: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid + 67, // 142: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 53, // 143: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella + 68, // 144: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 55, // 145: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb + 16, // 146: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 57, // 147: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar + 148, // [148:148] is the sub-list for method output_type + 148, // [148:148] is the sub-list for method input_type + 148, // [148:148] is the sub-list for extension type_name + 148, // [148:148] is the sub-list for extension extendee + 0, // [0:148] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_block_proto_init() } diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index a40dba62b81c..dec981c59adb 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -824,8 +824,6 @@ message BeaconBlockBodyElectra { repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; - - repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in Electra EIP-7251. } message SignedBlindedBeaconBlockElectra { @@ -889,8 +887,6 @@ message BlindedBeaconBlockBodyElectra { repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; - - repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in Electra EIP-7251. } message ValidatorRegistrationV1 { diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index dc1647191de5..6f1c86000129 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: ebbdaf40c27b22a94c77b725c65e63314fdb93dca0a54c76f098fb893240044f +// Hash: 61890aa32d72c0c0325f0bf6dd44776068840a9d50a102e4c3c53ac46cf66567 package eth import ( diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index 9a3c3448c7d5..48057c5b2a16 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 665ba6ebbfbcd818d1f4f54220aaf343e8bd814ead5f4d901b3f9bb44608fee2 +// Hash: 13b762a7d53ab6cf5d5ffb582d580edb05efc65de762692f09af914819d3bb3e package eth import ( diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index 7b736bab40c9..8e51844d7127 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -657,32 +657,6 @@ func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *Bli ExecutionPayloadHeader: CopyExecutionPayloadHeaderElectra(body.ExecutionPayloadHeader), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), - Consolidations: CopySignedConsolidations(body.Consolidations), - } -} - -func CopySignedConsolidations(c []*SignedConsolidation) []*SignedConsolidation { - if c == nil { - return nil - } - newC := make([]*SignedConsolidation, len(c)) - for i, cc := range c { - newC[i] = CopySignedConsolidation(cc) - } - return newC -} - -func CopySignedConsolidation(c *SignedConsolidation) *SignedConsolidation { - if c == nil { - return nil - } - return &SignedConsolidation{ - Message: &Consolidation{ - SourceIndex: c.Message.SourceIndex, - TargetIndex: c.Message.TargetIndex, - Epoch: c.Message.Epoch, - }, - Signature: bytesutil.SafeCopyBytes(c.Signature), } } @@ -1019,7 +993,6 @@ func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyEl ExecutionPayload: CopyExecutionPayloadElectra(body.ExecutionPayload), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), - Consolidations: CopySignedConsolidations(body.Consolidations), } } @@ -1090,25 +1063,26 @@ func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderE return nil } return &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), - WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - DepositRequestsRoot: bytesutil.SafeCopyBytes(payload.DepositRequestsRoot), - WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), + WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + DepositRequestsRoot: bytesutil.SafeCopyBytes(payload.DepositRequestsRoot), + WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), + ConsolidationRequestsRoot: bytesutil.SafeCopyBytes(payload.ConsolidationRequestsRoot), } } diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 87ecdad73f37..e408599cf50d 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -631,24 +631,6 @@ func TestCopyBlindedBeaconBlockBodyElectra(t *testing.T) { } } -func TestCopySignedConsolidations(t *testing.T) { - cs := genSignedConsolidations(10) - - got := v1alpha1.CopySignedConsolidations(cs) - if !reflect.DeepEqual(got, cs) { - t.Errorf("TestCopySignedConsolidations() = %v, want %v", got, cs) - } -} - -func TestCopySignedConsolidation(t *testing.T) { - c := genSignedConsolidation() - - got := v1alpha1.CopySignedConsolidation(c) - if !reflect.DeepEqual(got, c) { - t.Errorf("TestCopySignedConsolidation() = %v, want %v", got, c) - } -} - func TestCopySignedBeaconBlockElectra(t *testing.T) { sbb := genSignedBeaconBlockElectra() @@ -1419,54 +1401,31 @@ func genBlindedBeaconBlockBodyElectra() *v1alpha1.BlindedBeaconBlockBodyElectra ExecutionPayloadHeader: genExecutionPayloadHeaderElectra(), BlsToExecutionChanges: genBLSToExecutionChanges(10), BlobKzgCommitments: getKZGCommitments(4), - Consolidations: genSignedConsolidations(5), } } func genExecutionPayloadHeaderElectra() *enginev1.ExecutionPayloadHeaderElectra { return &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: bytes(32), - FeeRecipient: bytes(20), - StateRoot: bytes(32), - ReceiptsRoot: bytes(32), - LogsBloom: bytes(256), - PrevRandao: bytes(32), - BlockNumber: 1, - GasLimit: 2, - GasUsed: 3, - Timestamp: 4, - ExtraData: bytes(32), - BaseFeePerGas: bytes(32), - BlockHash: bytes(32), - TransactionsRoot: bytes(32), - WithdrawalsRoot: bytes(32), - BlobGasUsed: 5, - ExcessBlobGas: 6, - DepositRequestsRoot: bytes(32), - WithdrawalRequestsRoot: bytes(32), - } -} - -func genSignedConsolidations(num int) []*v1alpha1.SignedConsolidation { - cs := make([]*v1alpha1.SignedConsolidation, num) - for i := 0; i < num; i++ { - cs[i] = genSignedConsolidation() - } - return cs -} - -func genSignedConsolidation() *v1alpha1.SignedConsolidation { - return &v1alpha1.SignedConsolidation{ - Message: genConsolidation(), - Signature: bytes(96), - } -} - -func genConsolidation() *v1alpha1.Consolidation { - return &v1alpha1.Consolidation{ - SourceIndex: 1, - TargetIndex: 2, - Epoch: 3, + ParentHash: bytes(32), + FeeRecipient: bytes(20), + StateRoot: bytes(32), + ReceiptsRoot: bytes(32), + LogsBloom: bytes(256), + PrevRandao: bytes(32), + BlockNumber: 1, + GasLimit: 2, + GasUsed: 3, + Timestamp: 4, + ExtraData: bytes(32), + BaseFeePerGas: bytes(32), + BlockHash: bytes(32), + TransactionsRoot: bytes(32), + WithdrawalsRoot: bytes(32), + BlobGasUsed: 5, + ExcessBlobGas: 6, + DepositRequestsRoot: bytes(32), + WithdrawalRequestsRoot: bytes(32), + ConsolidationRequestsRoot: bytes(32), } } @@ -1501,7 +1460,6 @@ func genBeaconBlockBodyElectra() *v1alpha1.BeaconBlockBodyElectra { ExecutionPayload: genExecutionPayloadElectra(), BlsToExecutionChanges: genBLSToExecutionChanges(10), BlobKzgCommitments: getKZGCommitments(4), - Consolidations: genSignedConsolidations(5), } } diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index 272653017ab6..deeeacdb81df 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 9f8cc72419818e9c460c4079d52f90e5c23bf6565a6a234b4dee0d8f41d9b1ed +// Hash: adfca9994daf736f0526568d87329503d997b98308a409e71cd510115380af5a package eth import ( diff --git a/proto/prysm/v1alpha1/eip_7251.go b/proto/prysm/v1alpha1/eip_7251.go deleted file mode 100644 index cfaec4267490..000000000000 --- a/proto/prysm/v1alpha1/eip_7251.go +++ /dev/null @@ -1,12 +0,0 @@ -package eth - -func (c *Consolidation) ToPendingConsolidation() *PendingConsolidation { - if c == nil { - return nil - } - p := &PendingConsolidation{ - SourceIndex: c.SourceIndex, - TargetIndex: c.TargetIndex, - } - return p -} diff --git a/proto/prysm/v1alpha1/eip_7251.pb.go b/proto/prysm/v1alpha1/eip_7251.pb.go index 7330ffeb7206..569c74533b18 100755 --- a/proto/prysm/v1alpha1/eip_7251.pb.go +++ b/proto/prysm/v1alpha1/eip_7251.pb.go @@ -141,124 +141,6 @@ func (x *PendingPartialWithdrawal) GetWithdrawableEpoch() github_com_prysmaticla return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) } -type Consolidation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SourceIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=source_index,json=sourceIndex,proto3" json:"source_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - TargetIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=target_index,json=targetIndex,proto3" json:"target_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - Epoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` -} - -func (x *Consolidation) Reset() { - *x = Consolidation{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Consolidation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Consolidation) ProtoMessage() {} - -func (x *Consolidation) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Consolidation.ProtoReflect.Descriptor instead. -func (*Consolidation) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{2} -} - -func (x *Consolidation) GetSourceIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.SourceIndex - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *Consolidation) GetTargetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.TargetIndex - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *Consolidation) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { - if x != nil { - return x.Epoch - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -} - -type SignedConsolidation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message *Consolidation `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` -} - -func (x *SignedConsolidation) Reset() { - *x = SignedConsolidation{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignedConsolidation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignedConsolidation) ProtoMessage() {} - -func (x *SignedConsolidation) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignedConsolidation.ProtoReflect.Descriptor instead. -func (*SignedConsolidation) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{3} -} - -func (x *SignedConsolidation) GetMessage() *Consolidation { - if x != nil { - return x.Message - } - return nil -} - -func (x *SignedConsolidation) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - type PendingConsolidation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -271,7 +153,7 @@ type PendingConsolidation struct { func (x *PendingConsolidation) Reset() { *x = PendingConsolidation{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4] + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -284,7 +166,7 @@ func (x *PendingConsolidation) String() string { func (*PendingConsolidation) ProtoMessage() {} func (x *PendingConsolidation) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4] + mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -297,7 +179,7 @@ func (x *PendingConsolidation) ProtoReflect() protoreflect.Message { // Deprecated: Use PendingConsolidation.ProtoReflect.Descriptor instead. func (*PendingConsolidation) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{4} + return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{2} } func (x *PendingConsolidation) GetSourceIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -349,62 +231,33 @@ var file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = []byte{ 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xd5, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, - 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x7b, 0x0a, - 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19, - 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32, - 0x35, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, - 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, + 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32, 0x35, 0x31, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, + 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -419,21 +272,18 @@ func file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData } -var file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_proto_prysm_v1alpha1_eip_7251_proto_goTypes = []interface{}{ (*PendingBalanceDeposit)(nil), // 0: ethereum.eth.v1alpha1.PendingBalanceDeposit (*PendingPartialWithdrawal)(nil), // 1: ethereum.eth.v1alpha1.PendingPartialWithdrawal - (*Consolidation)(nil), // 2: ethereum.eth.v1alpha1.Consolidation - (*SignedConsolidation)(nil), // 3: ethereum.eth.v1alpha1.SignedConsolidation - (*PendingConsolidation)(nil), // 4: ethereum.eth.v1alpha1.PendingConsolidation + (*PendingConsolidation)(nil), // 2: ethereum.eth.v1alpha1.PendingConsolidation } var file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs = []int32{ - 2, // 0: ethereum.eth.v1alpha1.SignedConsolidation.message:type_name -> ethereum.eth.v1alpha1.Consolidation - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_eip_7251_proto_init() } @@ -467,30 +317,6 @@ func file_proto_prysm_v1alpha1_eip_7251_proto_init() { } } file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Consolidation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedConsolidation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PendingConsolidation); i { case 0: return &v.state @@ -509,7 +335,7 @@ func file_proto_prysm_v1alpha1_eip_7251_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/prysm/v1alpha1/eip_7251.proto b/proto/prysm/v1alpha1/eip_7251.proto index a587337cf02e..723743b70181 100644 --- a/proto/prysm/v1alpha1/eip_7251.proto +++ b/proto/prysm/v1alpha1/eip_7251.proto @@ -43,23 +43,6 @@ message PendingPartialWithdrawal { uint64 withdrawable_epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; } -message Consolidation { - // Validator from which the funds will be moved. - uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - // Validator to which the funds will be moved. - uint64 target_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - // A consolidation is valid at this epoch or later. - uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; -} - -message SignedConsolidation { - // The unsigned consolidation itself. - Consolidation message = 1; - - // Validator's 96 byte signature - bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; -} - message PendingConsolidation { // Validator from which the funds will be moved. uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; diff --git a/proto/prysm/v1alpha1/eip_7251_test.go b/proto/prysm/v1alpha1/eip_7251_test.go deleted file mode 100644 index 8f571d14a86c..000000000000 --- a/proto/prysm/v1alpha1/eip_7251_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package eth_test - -import ( - "testing" - - v1alpha1 "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/assert" -) - -func TestConsolidation_ToPendingConsolidation(t *testing.T) { - c := v1alpha1.Consolidation{ - SourceIndex: 1, - TargetIndex: 2, - Epoch: 3, - } - - pc := c.ToPendingConsolidation() - - assert.Equal(t, c.SourceIndex, pc.SourceIndex) - assert.Equal(t, c.TargetIndex, pc.TargetIndex) -} diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 6f32288014b8..570dbbd6a2ad 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: b388c6b0776ab0d4c45d83697580b9f0f823644b7a442cd4fe40d4cf64565134 +// Hash: 84572d8fa233c45a41477bced891ee355cc1745ae0fad290f110b7f6b5ed12e1 package eth import ( @@ -917,7 +917,7 @@ func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(396) + offset := int(392) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { @@ -990,10 +990,6 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error dst = ssz.WriteOffset(dst, offset) offset += len(b.BlobKzgCommitments) * 48 - // Offset (12) 'Consolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Consolidations) * 120 - // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) @@ -1092,17 +1088,6 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error dst = append(dst, b.BlobKzgCommitments[ii]...) } - // Field (12) 'Consolidations' - if size := len(b.Consolidations); size > 1 { - err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) - return - } - for ii := 0; ii < len(b.Consolidations); ii++ { - if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - return } @@ -1110,12 +1095,12 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 396 { + if size < 392 { return ssz.ErrSize } tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 + var o3, o4, o5, o6, o7, o9, o10, o11 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { @@ -1142,7 +1127,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 != 396 { + if o3 != 392 { return ssz.ErrInvalidVariableOffset } @@ -1189,11 +1174,6 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - // Offset (12) 'Consolidations' - if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] @@ -1323,7 +1303,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { // Field (11) 'BlobKzgCommitments' { - buf = tail[o11:o12] + buf = tail[o11:] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err @@ -1336,30 +1316,12 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } - - // Field (12) 'Consolidations' - { - buf = tail[o12:] - num, err := ssz.DivideInt2(len(buf), 120, 1) - if err != nil { - return err - } - b.Consolidations = make([]*SignedConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.Consolidations[ii] == nil { - b.Consolidations[ii] = new(SignedConsolidation) - } - if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { - return err - } - } - } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 396 + size = 392 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 @@ -1394,9 +1356,6 @@ func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { // Field (11) 'BlobKzgCommitments' size += len(b.BlobKzgCommitments) * 48 - // Field (12) 'Consolidations' - size += len(b.Consolidations) * 120 - return } @@ -1553,22 +1512,6 @@ func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - // Field (12) 'Consolidations' - { - subIndx := hh.Index() - num := uint64(len(b.Consolidations)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Consolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 1) - } - hh.Merkleize(indx) return } @@ -1837,7 +1780,7 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(396) + offset := int(392) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { @@ -1910,10 +1853,6 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er dst = ssz.WriteOffset(dst, offset) offset += len(b.BlobKzgCommitments) * 48 - // Offset (12) 'Consolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Consolidations) * 120 - // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) @@ -2012,17 +1951,6 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er dst = append(dst, b.BlobKzgCommitments[ii]...) } - // Field (12) 'Consolidations' - if size := len(b.Consolidations); size > 1 { - err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) - return - } - for ii := 0; ii < len(b.Consolidations); ii++ { - if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - return } @@ -2030,12 +1958,12 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 396 { + if size < 392 { return ssz.ErrSize } tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 + var o3, o4, o5, o6, o7, o9, o10, o11 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { @@ -2062,7 +1990,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 != 396 { + if o3 != 392 { return ssz.ErrInvalidVariableOffset } @@ -2109,11 +2037,6 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - // Offset (12) 'Consolidations' - if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] @@ -2243,7 +2166,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { // Field (11) 'BlobKzgCommitments' { - buf = tail[o11:o12] + buf = tail[o11:] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err @@ -2256,30 +2179,12 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } - - // Field (12) 'Consolidations' - { - buf = tail[o12:] - num, err := ssz.DivideInt2(len(buf), 120, 1) - if err != nil { - return err - } - b.Consolidations = make([]*SignedConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.Consolidations[ii] == nil { - b.Consolidations[ii] = new(SignedConsolidation) - } - if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { - return err - } - } - } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 396 + size = 392 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 @@ -2314,9 +2219,6 @@ func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { // Field (11) 'BlobKzgCommitments' size += len(b.BlobKzgCommitments) * 48 - // Field (12) 'Consolidations' - size += len(b.Consolidations) * 120 - return } @@ -2473,22 +2375,6 @@ func (b *BlindedBeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err er hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - // Field (12) 'Consolidations' - { - subIndx := hh.Index() - num := uint64(len(b.Consolidations)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Consolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 1) - } - hh.Merkleize(indx) return } @@ -3751,158 +3637,6 @@ func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) return } -// MarshalSSZ ssz marshals the Consolidation object -func (c *Consolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the Consolidation object to a target array -func (c *Consolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SourceIndex' - dst = ssz.MarshalUint64(dst, uint64(c.SourceIndex)) - - // Field (1) 'TargetIndex' - dst = ssz.MarshalUint64(dst, uint64(c.TargetIndex)) - - // Field (2) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Consolidation object -func (c *Consolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'SourceIndex' - c.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'TargetIndex' - c.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'Epoch' - c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Consolidation object -func (c *Consolidation) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the Consolidation object -func (c *Consolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the Consolidation object with a hasher -func (c *Consolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SourceIndex' - hh.PutUint64(uint64(c.SourceIndex)) - - // Field (1) 'TargetIndex' - hh.PutUint64(uint64(c.TargetIndex)) - - // Field (2) 'Epoch' - hh.PutUint64(uint64(c.Epoch)) - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the SignedConsolidation object -func (s *SignedConsolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedConsolidation object to a target array -func (s *SignedConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(Consolidation) - } - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedConsolidation object -func (s *SignedConsolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 120 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(Consolidation) - } - if err = s.Message.UnmarshalSSZ(buf[0:24]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[24:120])) - } - s.Signature = append(s.Signature, buf[24:120]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedConsolidation object -func (s *SignedConsolidation) SizeSSZ() (size int) { - size = 120 - return -} - -// HashTreeRoot ssz hashes the SignedConsolidation object -func (s *SignedConsolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedConsolidation object with a hasher -func (s *SignedConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - hh.Merkleize(indx) - return -} - // MarshalSSZ ssz marshals the PendingConsolidation object func (p *PendingConsolidation) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(p) diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go index 52616b8d46f5..2c720bc17b34 100644 --- a/proto/prysm/v1alpha1/non-core.ssz.go +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 9da8a498bd074553137a73197dadcae4d3b4239484f64bab4f0a734dce528d24 +// Hash: 6fe6b8a92c8bbb2fc95fc59fca0b73d1c787c00ec01137d73193b5b251e40c12 package eth import ( diff --git a/proto/prysm/v1alpha1/phase0.ssz.go b/proto/prysm/v1alpha1/phase0.ssz.go index 8be3c0272475..d9d2b40cb253 100644 --- a/proto/prysm/v1alpha1/phase0.ssz.go +++ b/proto/prysm/v1alpha1/phase0.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: eba8aa2c3520e9086420bb8b3b54fa3824148a30659a4a9413a1eebbec22712a +// Hash: 0858b1e553b943e9cbdba001604002341da98f82976954a2eafa7a97632f485c package eth import ( diff --git a/proto/ssz_proto_library.bzl b/proto/ssz_proto_library.bzl index 5024dccb6e12..982be54cc022 100644 --- a/proto/ssz_proto_library.bzl +++ b/proto/ssz_proto_library.bzl @@ -35,6 +35,7 @@ mainnet = { "pending_balance_deposits_limit": "134217728", "pending_partial_withdrawals_limit": "134217728", "pending_consolidations_limit": "262144", + "max_consolidation_requests_per_payload.size": "1", } minimal = { @@ -66,6 +67,7 @@ minimal = { "pending_balance_deposits_limit": "134217728", "pending_partial_withdrawals_limit": "64", "pending_consolidations_limit": "64", + "max_consolidation_requests_per_payload.size": "1", } ###### Rules definitions ####### diff --git a/testing/spectest/shared/electra/epoch_processing/helpers.go b/testing/spectest/shared/electra/epoch_processing/helpers.go index 6fe2e87c9534..5ad4178f2cd3 100644 --- a/testing/spectest/shared/electra/epoch_processing/helpers.go +++ b/testing/spectest/shared/electra/epoch_processing/helpers.go @@ -27,6 +27,7 @@ func RunEpochOperationTest( testFolderPath string, operationFn epochOperation, ) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") preBeaconStateFile, err := util.BazelFileBytes(path.Join(testFolderPath, "pre.ssz_snappy")) require.NoError(t, err) preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) diff --git a/testing/spectest/shared/electra/fork/upgrade_to_electra.go b/testing/spectest/shared/electra/fork/upgrade_to_electra.go index a17b42765c69..ad36b2dfe02a 100644 --- a/testing/spectest/shared/electra/fork/upgrade_to_electra.go +++ b/testing/spectest/shared/electra/fork/upgrade_to_electra.go @@ -20,6 +20,7 @@ import ( // RunUpgradeToElectra is a helper function that runs Electra's fork spec tests. // It unmarshals a pre- and post-state to check `UpgradeToElectra` comply with spec implementation. func RunUpgradeToElectra(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "fork/fork/pyspec_tests") diff --git a/testing/spectest/shared/electra/operations/block_header.go b/testing/spectest/shared/electra/operations/block_header.go index f0d141e3dc21..55abe1522d0f 100644 --- a/testing/spectest/shared/electra/operations/block_header.go +++ b/testing/spectest/shared/electra/operations/block_header.go @@ -22,6 +22,7 @@ import ( ) func RunBlockHeaderTest(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/block_header/pyspec_tests") for _, folder := range testFolders { diff --git a/testing/spectest/shared/electra/operations/consolidations.go b/testing/spectest/shared/electra/operations/consolidations.go index 56d3c4a2a290..04f0f0f06837 100644 --- a/testing/spectest/shared/electra/operations/consolidations.go +++ b/testing/spectest/shared/electra/operations/consolidations.go @@ -1,21 +1,18 @@ package operations import ( - "context" "path" "testing" "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" ) func RunConsolidationTest(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/consolidation/pyspec_tests") require.NotEqual(t, 0, len(testFolders), "missing tests for consolidation operation in folder") @@ -26,22 +23,10 @@ func RunConsolidationTest(t *testing.T, config string) { require.NoError(t, err) consolidationSSZ, err := snappy.Decode(nil /* dst */, consolidationFile) require.NoError(t, err, "Failed to decompress") - consolidation := ðpb.SignedConsolidation{} + consolidation := &enginev1.ConsolidationRequest{} require.NoError(t, consolidation.UnmarshalSSZ(consolidationSSZ), "Failed to unmarshal") - body := ðpb.BeaconBlockBodyElectra{Consolidations: []*ethpb.SignedConsolidation{consolidation}} - processConsolidationFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - body, ok := b.Block().Body().(interfaces.ROBlockBodyElectra) - if !ok { - t.Error("block body is not electra") - } - cs := body.Consolidations() - if len(cs) == 0 { - t.Error("no consolidations to test") - } - return s, electra.ProcessConsolidations(ctx, s, cs) - } - RunBlockOperationTest(t, folderPath, body, processConsolidationFunc) + t.Fatal("Implement me") }) } } diff --git a/testing/spectest/shared/electra/operations/execution_payload.go b/testing/spectest/shared/electra/operations/execution_payload.go index dc00fc5173eb..a2b5604f32d5 100644 --- a/testing/spectest/shared/electra/operations/execution_payload.go +++ b/testing/spectest/shared/electra/operations/execution_payload.go @@ -23,6 +23,7 @@ import ( ) func RunExecutionPayloadTest(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_payload/pyspec_tests") if len(testFolders) == 0 { diff --git a/testing/spectest/shared/electra/operations/helpers.go b/testing/spectest/shared/electra/operations/helpers.go index fe42a2c83e6f..ee26ab3a0621 100644 --- a/testing/spectest/shared/electra/operations/helpers.go +++ b/testing/spectest/shared/electra/operations/helpers.go @@ -32,6 +32,7 @@ func RunBlockOperationTest( body *ethpb.BeaconBlockBodyElectra, operationFn blockOperation, ) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) require.NoError(t, err) preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) diff --git a/testing/spectest/shared/electra/operations/withdrawal_request.go b/testing/spectest/shared/electra/operations/withdrawal_request.go index 2d2b3a4d3aff..5278dd97c00d 100644 --- a/testing/spectest/shared/electra/operations/withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/withdrawal_request.go @@ -37,8 +37,7 @@ func RunWithdrawalRequestTest(t *testing.T, config string) { }, }} RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - bod, ok := b.Block().Body().(interfaces.ROBlockBodyElectra) - require.Equal(t, true, ok) + bod := b.Block().Body() e, err := bod.Execution() require.NoError(t, err) exe, ok := e.(interfaces.ExecutionDataElectra) diff --git a/testing/spectest/shared/electra/operations/withdrawals.go b/testing/spectest/shared/electra/operations/withdrawals.go index 5ef4fcd2ee09..778509b94472 100644 --- a/testing/spectest/shared/electra/operations/withdrawals.go +++ b/testing/spectest/shared/electra/operations/withdrawals.go @@ -18,6 +18,7 @@ import ( ) func RunWithdrawalsTest(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawals/pyspec_tests") for _, folder := range testFolders { diff --git a/testing/spectest/shared/electra/rewards/rewards_penalties.go b/testing/spectest/shared/electra/rewards/rewards_penalties.go index b89d07b6e5dd..b40bad228235 100644 --- a/testing/spectest/shared/electra/rewards/rewards_penalties.go +++ b/testing/spectest/shared/electra/rewards/rewards_penalties.go @@ -39,6 +39,7 @@ func (d *Delta) unmarshalSSZ(buf []byte) error { // RunPrecomputeRewardsAndPenaltiesTests executes "rewards/{basic, leak, random}" tests. func RunPrecomputeRewardsAndPenaltiesTests(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) _, testsFolderPath := utils.TestFolders(t, config, "electra", "rewards") diff --git a/testing/spectest/shared/electra/sanity/block_processing.go b/testing/spectest/shared/electra/sanity/block_processing.go index d7fb00c6213a..c18d20d10c63 100644 --- a/testing/spectest/shared/electra/sanity/block_processing.go +++ b/testing/spectest/shared/electra/sanity/block_processing.go @@ -30,6 +30,7 @@ func init() { // RunBlockProcessingTest executes "sanity/blocks" tests. func RunBlockProcessingTest(t *testing.T, config, folderPath string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", folderPath) diff --git a/testing/spectest/shared/electra/sanity/slot_processing.go b/testing/spectest/shared/electra/sanity/slot_processing.go index a107afdbdcab..125a6ddcff62 100644 --- a/testing/spectest/shared/electra/sanity/slot_processing.go +++ b/testing/spectest/shared/electra/sanity/slot_processing.go @@ -21,6 +21,7 @@ func init() { // RunSlotProcessingTests executes "sanity/slots" tests. func RunSlotProcessingTests(t *testing.T, config string) { + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "sanity/slots/pyspec_tests") diff --git a/testing/spectest/shared/electra/ssz_static/ssz_static.go b/testing/spectest/shared/electra/ssz_static/ssz_static.go index ae149e6f36b7..d64e5d9968a8 100644 --- a/testing/spectest/shared/electra/ssz_static/ssz_static.go +++ b/testing/spectest/shared/electra/ssz_static/ssz_static.go @@ -37,8 +37,10 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i var obj interface{} switch folderName { case "ExecutionPayload": + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = &enginev1.ExecutionPayloadElectra{} case "ExecutionPayloadHeader": + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = &enginev1.ExecutionPayloadHeaderElectra{} case "Attestation": obj = ðpb.AttestationElectra{} @@ -49,12 +51,15 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i case "AggregateAndProof": obj = ðpb.AggregateAttestationAndProofElectra{} case "BeaconBlock": + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.BeaconBlockElectra{} case "BeaconBlockBody": + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.BeaconBlockBodyElectra{} case "BeaconBlockHeader": obj = ðpb.BeaconBlockHeader{} case "BeaconState": + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.BeaconStateElectra{} case "Checkpoint": obj = ðpb.Checkpoint{} @@ -84,6 +89,7 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i case "SignedAggregateAndProof": obj = ðpb.SignedAggregateAttestationAndProofElectra{} case "SignedBeaconBlock": + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.SignedBeaconBlockElectra{} case "SignedBeaconBlockHeader": obj = ðpb.SignedBeaconBlockHeader{} @@ -146,15 +152,21 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i case "PendingPartialWithdrawal": obj = ðpb.PendingPartialWithdrawal{} case "Consolidation": - obj = ðpb.Consolidation{} + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") + // TODO: Remove this case when the spectests are updated to v1.5.0-alpha.3 + return nil, nil case "SignedConsolidation": - obj = ðpb.SignedConsolidation{} + t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") + // TODO: Remove this case when the spectests are updated to v1.5.0-alpha.3 + return nil, nil case "PendingConsolidation": obj = ðpb.PendingConsolidation{} case "ExecutionLayerWithdrawalRequest": // TODO: update in spectest update obj = &enginev1.WithdrawalRequest{} case "DepositReceipt": // TODO: update in spectest update obj = &enginev1.DepositRequest{} + case "ConsolidationRequest": + obj = &enginev1.ConsolidationRequest{} default: return nil, errors.New("type not found") } diff --git a/testing/util/block.go b/testing/util/block.go index 96f3c82c5214..80a897f829fe 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -1360,19 +1360,20 @@ func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.Beaco } if b.ExecutionPayload == nil { b.ExecutionPayload = &enginev1.ExecutionPayloadElectra{ - ParentHash: make([]byte, fieldparams.RootLength), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, fieldparams.RootLength), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, fieldparams.RootLength), - BlockHash: make([]byte, fieldparams.RootLength), - Transactions: make([][]byte, 0), - Withdrawals: make([]*enginev1.Withdrawal, 0), - DepositRequests: make([]*enginev1.DepositRequest, 0), - WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), + DepositRequests: make([]*enginev1.DepositRequest, 0), + WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), + ConsolidationRequests: make([]*enginev1.ConsolidationRequest, 0), } } return b @@ -1566,19 +1567,20 @@ func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra } if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, fieldparams.RootLength), - WithdrawalsRoot: make([]byte, fieldparams.RootLength), - WithdrawalRequestsRoot: make([]byte, fieldparams.RootLength), - DepositRequestsRoot: make([]byte, fieldparams.RootLength), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, fieldparams.RootLength), + WithdrawalsRoot: make([]byte, fieldparams.RootLength), + WithdrawalRequestsRoot: make([]byte, fieldparams.RootLength), + DepositRequestsRoot: make([]byte, fieldparams.RootLength), + ConsolidationRequestsRoot: make([]byte, fieldparams.RootLength), } } return b diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go index f8571510d3bc..4b5d74b3aa97 100644 --- a/testing/util/electra_state.go +++ b/testing/util/electra_state.go @@ -258,19 +258,20 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta } st.LatestExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - DepositRequestsRoot: make([]byte, 32), - WithdrawalRequestsRoot: make([]byte, 32), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + DepositRequestsRoot: make([]byte, 32), + WithdrawalRequestsRoot: make([]byte, 32), + ConsolidationRequestsRoot: make([]byte, 32), } return state_native.InitializeFromProtoElectra(st) diff --git a/testing/util/state.go b/testing/util/state.go index 6977733a0f51..b0f4838860b4 100644 --- a/testing/util/state.go +++ b/testing/util/state.go @@ -425,19 +425,20 @@ func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) erro AggregatePubkey: make([]byte, 48), }, LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - DepositRequestsRoot: make([]byte, 32), - WithdrawalRequestsRoot: make([]byte, 32), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + DepositRequestsRoot: make([]byte, 32), + WithdrawalRequestsRoot: make([]byte, 32), + ConsolidationRequestsRoot: make([]byte, 32), }, } From 5edc64d88ca58287262015a54d17b8149d4f0206 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 27 Jun 2024 21:36:24 +0200 Subject: [PATCH 158/325] fix: update holesky repository layout (#14057) * fix: update holesky repository layout * Update holesky-testnet dependency --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: Preston Van Loon --- WORKSPACE | 8 ++++---- config/params/testnet_holesky_config_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 46e8e7c3c017..d853e226be4a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -332,14 +332,14 @@ http_archive( filegroup( name = "configs", srcs = [ - "custom_config_data/config.yaml", + "metadata/config.yaml", ], visibility = ["//visibility:public"], ) """, - sha256 = "5f4be6fd088683ea9db45c863b9c5a1884422449e5b59fd2d561d3ba0f73ffd9", - strip_prefix = "holesky-9d9aabf2d4de51334ee5fed6c79a4d55097d1a43", - url = "https://github.com/eth-clients/holesky/archive/9d9aabf2d4de51334ee5fed6c79a4d55097d1a43.tar.gz", # 2024-01-22 + integrity = "sha256-b7ZTT+olF+VXEJYNTV5jggNtCkt9dOejm1i2VE+zy+0=", + strip_prefix = "holesky-874c199423ccd180607320c38cbaca05d9a1573a", + url = "https://github.com/eth-clients/holesky/archive/874c199423ccd180607320c38cbaca05d9a1573a.tar.gz", # 2024-06-18 ) http_archive( diff --git a/config/params/testnet_holesky_config_test.go b/config/params/testnet_holesky_config_test.go index 5e6bcbaf54b5..0c64ff2ab6ac 100644 --- a/config/params/testnet_holesky_config_test.go +++ b/config/params/testnet_holesky_config_test.go @@ -20,7 +20,7 @@ func TestHoleskyConfigMatchesUpstreamYaml(t *testing.T) { } fPath, err := bazel.Runfile("external/holesky_testnet") require.NoError(t, err) - configFP := path.Join(fPath, "custom_config_data", "config.yaml") + configFP := path.Join(fPath, "metadata", "config.yaml") pcfg, err := params.UnmarshalConfigFile(configFP, nil) require.NoError(t, err) fields := fieldsFromYamls(t, append(presetFPs, configFP)) From fa370724f1e150918be00b020e69c21e96de0268 Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 27 Jun 2024 17:20:08 -0700 Subject: [PATCH 159/325] Increase attestation seen cache exp time to two epochs (#14156) --- beacon-chain/operations/attestations/kv/kv.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/operations/attestations/kv/kv.go b/beacon-chain/operations/attestations/kv/kv.go index c8b51a57781d..981525c1e2e2 100644 --- a/beacon-chain/operations/attestations/kv/kv.go +++ b/beacon-chain/operations/attestations/kv/kv.go @@ -32,7 +32,7 @@ type AttCaches struct { // various kind of attestations. func NewAttCaches() *AttCaches { secsInEpoch := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) - c := cache.New(secsInEpoch*time.Second, 2*secsInEpoch*time.Second) + c := cache.New(2*secsInEpoch*time.Second, 2*secsInEpoch*time.Second) pool := &AttCaches{ unAggregatedAtt: make(map[attestation.Id]ethpb.Att), aggregatedAtt: make(map[attestation.Id][]ethpb.Att), From 78cf75a0ed36c920534a7d386333ca0f6609991f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 28 Jun 2024 17:44:19 +0200 Subject: [PATCH 160/325] `IndexedAtt` wrapper for the slasher feed (#14150) * `IndexedAtt` wrapper for the slasher feed * test fixes * fix simulator * fix e2e * Revert "Auxiliary commit to revert individual files from 191bbf77accfc2523fa9f909837a2e9dca132afa" This reverts commit 2b0441a23a0e5f66e50cf36c3bbfbb39d587b17b. * extract interface from channel --- beacon-chain/blockchain/BUILD.bazel | 1 + beacon-chain/blockchain/receive_block.go | 3 ++- beacon-chain/slasher/receive.go | 4 +-- beacon-chain/slasher/receive_test.go | 25 +++++++++++-------- beacon-chain/slasher/service.go | 3 ++- beacon-chain/slasher/types/BUILD.bazel | 1 + beacon-chain/slasher/types/types.go | 7 ++++++ beacon-chain/sync/BUILD.bazel | 1 + .../sync/validate_beacon_attestation.go | 3 ++- testing/endtoend/evaluators/slashing.go | 4 +-- testing/slasher/simulator/BUILD.bazel | 1 + testing/slasher/simulator/simulator.go | 5 ++-- 12 files changed, 39 insertions(+), 19 deletions(-) diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index 522eb0643892..b60a763d0fde 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -64,6 +64,7 @@ go_library( "//beacon-chain/operations/slashings:go_default_library", "//beacon-chain/operations/voluntaryexits:go_default_library", "//beacon-chain/p2p:go_default_library", + "//beacon-chain/slasher/types:go_default_library", "//beacon-chain/startup:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index 8a3996025327..42f9a9542f55 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -13,6 +13,7 @@ import ( coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -497,7 +498,7 @@ func (s *Service) sendBlockAttestationsToSlasher(signed interfaces.ReadOnlySigne log.WithError(err).Error("Could not convert to indexed attestation") return } - s.cfg.SlasherAttestationsFeed.Send(indexedAtt) + s.cfg.SlasherAttestationsFeed.Send(&types.WrappedIndexedAtt{IndexedAtt: indexedAtt}) } } diff --git a/beacon-chain/slasher/receive.go b/beacon-chain/slasher/receive.go index b92efb90411a..d04a5b2604d9 100644 --- a/beacon-chain/slasher/receive.go +++ b/beacon-chain/slasher/receive.go @@ -22,7 +22,7 @@ const ( // Receive indexed attestations from some source event feed, // validating their integrity before appending them to an attestation queue // for batch processing in a separate routine. -func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan ethpb.IndexedAtt) { +func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan *slashertypes.WrappedIndexedAtt) { defer s.wg.Done() sub := s.serviceCfg.IndexedAttestationsFeed.Subscribe(indexedAttsChan) @@ -39,7 +39,7 @@ func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan continue } attWrapper := &slashertypes.IndexedAttestationWrapper{ - IndexedAttestation: att, + IndexedAttestation: att.IndexedAtt, DataRoot: dataRoot, } s.attsQueue.push(attWrapper) diff --git a/beacon-chain/slasher/receive_test.go b/beacon-chain/slasher/receive_test.go index f7b0eacefcbb..3bb389be3b78 100644 --- a/beacon-chain/slasher/receive_test.go +++ b/beacon-chain/slasher/receive_test.go @@ -29,7 +29,7 @@ func TestSlasher_receiveAttestations_OK(t *testing.T) { }, attsQueue: newAttestationsQueue(), } - indexedAttsChan := make(chan ethpb.IndexedAtt) + indexedAttsChan := make(chan *slashertypes.WrappedIndexedAtt) defer close(indexedAttsChan) s.wg.Add(1) @@ -40,13 +40,15 @@ func TestSlasher_receiveAttestations_OK(t *testing.T) { secondIndices := []uint64{4, 5, 6} att1 := createAttestationWrapperEmptySig(t, 1, 2, firstIndices, nil) att2 := createAttestationWrapperEmptySig(t, 1, 2, secondIndices, nil) - indexedAttsChan <- att1.IndexedAttestation - indexedAttsChan <- att2.IndexedAttestation + wrappedAtt1 := &slashertypes.WrappedIndexedAtt{IndexedAtt: att1.IndexedAttestation} + wrappedAtt2 := &slashertypes.WrappedIndexedAtt{IndexedAtt: att2.IndexedAttestation} + indexedAttsChan <- wrappedAtt1 + indexedAttsChan <- wrappedAtt2 cancel() s.wg.Wait() wanted := []*slashertypes.IndexedAttestationWrapper{ - att1, - att2, + {IndexedAttestation: att1.IndexedAttestation, DataRoot: att1.DataRoot}, + {IndexedAttestation: att2.IndexedAttestation, DataRoot: att2.DataRoot}, } require.DeepEqual(t, wanted, s.attsQueue.dequeue()) } @@ -212,7 +214,7 @@ func TestSlasher_receiveAttestations_OnlyValidAttestations(t *testing.T) { }, attsQueue: newAttestationsQueue(), } - indexedAttsChan := make(chan ethpb.IndexedAtt) + indexedAttsChan := make(chan *slashertypes.WrappedIndexedAtt) defer close(indexedAttsChan) s.wg.Add(1) @@ -223,18 +225,21 @@ func TestSlasher_receiveAttestations_OnlyValidAttestations(t *testing.T) { secondIndices := []uint64{4, 5, 6} // Add a valid attestation. validAtt := createAttestationWrapperEmptySig(t, 1, 2, firstIndices, nil) - indexedAttsChan <- validAtt.IndexedAttestation + wrappedValidAtt := &slashertypes.WrappedIndexedAtt{IndexedAtt: validAtt.IndexedAttestation} + indexedAttsChan <- wrappedValidAtt // Send an invalid, bad attestation which will not // pass integrity checks at it has invalid attestation data. - indexedAttsChan <- ðpb.IndexedAttestation{ - AttestingIndices: secondIndices, + indexedAttsChan <- &slashertypes.WrappedIndexedAtt{ + IndexedAtt: ðpb.IndexedAttestation{ + AttestingIndices: secondIndices, + }, } cancel() s.wg.Wait() // Expect only a single, valid attestation was added to the queue. require.Equal(t, 1, s.attsQueue.size()) wanted := []*slashertypes.IndexedAttestationWrapper{ - validAtt, + {IndexedAttestation: validAtt.IndexedAttestation, DataRoot: validAtt.DataRoot}, } require.DeepEqual(t, wanted, s.attsQueue.dequeue()) } diff --git a/beacon-chain/slasher/service.go b/beacon-chain/slasher/service.go index 8de75eba8251..d4c78994f9a0 100644 --- a/beacon-chain/slasher/service.go +++ b/beacon-chain/slasher/service.go @@ -14,6 +14,7 @@ import ( statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" beaconChainSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" @@ -117,7 +118,7 @@ func (s *Service) run() { "Finished retrieving last epoch written per validator", ) - indexedAttsChan := make(chan ethpb.IndexedAtt, 1) + indexedAttsChan := make(chan *types.WrappedIndexedAtt, 1) beaconBlockHeadersChan := make(chan *ethpb.SignedBeaconBlockHeader, 1) s.wg.Add(1) diff --git a/beacon-chain/slasher/types/BUILD.bazel b/beacon-chain/slasher/types/BUILD.bazel index e8b935388d1c..1da075211792 100644 --- a/beacon-chain/slasher/types/BUILD.bazel +++ b/beacon-chain/slasher/types/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = [ "//beacon-chain:__subpackages__", "//cmd/prysmctl:__subpackages__", + "//testing/slasher/simulator:__subpackages__", ], deps = [ "//consensus-types/primitives:go_default_library", diff --git a/beacon-chain/slasher/types/types.go b/beacon-chain/slasher/types/types.go index d2ee753174c5..956942016ead 100644 --- a/beacon-chain/slasher/types/types.go +++ b/beacon-chain/slasher/types/types.go @@ -26,6 +26,13 @@ func (c ChunkKind) String() string { } } +// WrappedIndexedAtt is a wrapper over the IndexedAtt interface. +// The wrapper is needed to overcome the limitation of the event feed library +// which doesn't work well with interface types. +type WrappedIndexedAtt struct { + ethpb.IndexedAtt +} + // IndexedAttestationWrapper contains an indexed attestation with its // data root to reduce duplicated computation. type IndexedAttestationWrapper struct { diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index c33ebdeb2e41..cba397bcf1bf 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -88,6 +88,7 @@ go_library( "//beacon-chain/p2p/encoder:go_default_library", "//beacon-chain/p2p/peers:go_default_library", "//beacon-chain/p2p/types:go_default_library", + "//beacon-chain/slasher/types:go_default_library", "//beacon-chain/startup:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index f72477031667..2cea8638bbd4 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -16,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -137,7 +138,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p tracing.AnnotateError(span, err) return } - s.cfg.slasherAttestationsFeed.Send(indexedAtt) + s.cfg.slasherAttestationsFeed.Send(&types.WrappedIndexedAtt{IndexedAtt: indexedAtt}) }() } diff --git a/testing/endtoend/evaluators/slashing.go b/testing/endtoend/evaluators/slashing.go index 9ce26403b39c..550e69233284 100644 --- a/testing/endtoend/evaluators/slashing.go +++ b/testing/endtoend/evaluators/slashing.go @@ -52,7 +52,7 @@ var ValidatorsSlashedAfterEpoch = func(n primitives.Epoch) e2eTypes.Evaluator { // SlashedValidatorsLoseBalanceAfterEpoch checks if the validators slashed lose the right balance. var SlashedValidatorsLoseBalanceAfterEpoch = func(n primitives.Epoch) e2eTypes.Evaluator { return e2eTypes.Evaluator{ - Name: "slashed_validators_lose_valance_epoch_%d", + Name: "slashed_validators_lose_balance_epoch_%d", Policy: policies.AfterNthEpoch(n), Evaluation: validatorsLoseBalance, } @@ -109,7 +109,7 @@ func validatorsLoseBalance(_ *e2eTypes.EvaluationContext, conns ...*grpc.ClientC slashedBal := params.BeaconConfig().MaxEffectiveBalance - slashedPenalty + params.BeaconConfig().EffectiveBalanceIncrement/10 if valResp.EffectiveBalance >= slashedBal { return fmt.Errorf( - "expected slashed validator %d to balance less than %d, received %d", + "expected slashed validator %d balance to be less than %d, received %d", i, slashedBal, valResp.EffectiveBalance, diff --git a/testing/slasher/simulator/BUILD.bazel b/testing/slasher/simulator/BUILD.bazel index d8dccd2d376a..679ded283765 100644 --- a/testing/slasher/simulator/BUILD.bazel +++ b/testing/slasher/simulator/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "//beacon-chain/db:go_default_library", "//beacon-chain/operations/slashings:go_default_library", "//beacon-chain/slasher:go_default_library", + "//beacon-chain/slasher/types:go_default_library", "//beacon-chain/startup:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", diff --git a/testing/slasher/simulator/simulator.go b/testing/slasher/simulator/simulator.go index b4d51c584691..e09f13d95bc0 100644 --- a/testing/slasher/simulator/simulator.go +++ b/testing/slasher/simulator/simulator.go @@ -11,6 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings" "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher" + slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" @@ -211,7 +212,7 @@ func (s *Simulator) simulateBlocksAndAttestations(ctx context.Context) { } log.WithFields(logrus.Fields{ "numAtts": len(atts), - "numSlashable": len(propSlashings), + "numSlashable": len(attSlashings), }).Infof("Producing attestations for slot %d", slot) for _, sl := range attSlashings { slashingRoot, err := sl.HashTreeRoot() @@ -221,7 +222,7 @@ func (s *Simulator) simulateBlocksAndAttestations(ctx context.Context) { s.sentAttesterSlashings[slashingRoot] = sl } for _, aa := range atts { - s.indexedAttsFeed.Send(aa) + s.indexedAttsFeed.Send(&slashertypes.WrappedIndexedAtt{IndexedAtt: aa}) } case <-ctx.Done(): return From 91c55c68803068f2d0c1b9da0dc082718ab11a2d Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:24:32 -0500 Subject: [PATCH 161/325] Electra: Properly Calculate Proposer Probabilities for MaxEB (#14010) * adding small change and tests for max eb spec change * gaz --------- Co-authored-by: Preston Van Loon --- beacon-chain/core/helpers/validators.go | 12 +++- beacon-chain/core/helpers/validators_test.go | 62 ++++++++++++++++++-- 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index ccee87add7c5..231e06351df9 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -17,6 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" log "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -357,10 +358,10 @@ func BeaconProposerIndexAtSlot(ctx context.Context, state state.ReadOnlyBeaconSt // candidate_index = indices[compute_shuffled_index(i % total, total, seed)] // random_byte = hash(seed + uint_to_bytes(uint64(i // 32)))[i % 32] // effective_balance = state.validators[candidate_index].effective_balance -// if effective_balance * MAX_RANDOM_BYTE >= MAX_EFFECTIVE_BALANCE * random_byte: +// if effective_balance * MAX_RANDOM_BYTE >= MAX_EFFECTIVE_BALANCE_ELECTRA * random_byte: #[Modified in Electra:EIP7251] // return candidate_index // i += 1 -func ComputeProposerIndex(bState state.ReadOnlyValidators, activeIndices []primitives.ValidatorIndex, seed [32]byte) (primitives.ValidatorIndex, error) { +func ComputeProposerIndex(bState state.ReadOnlyBeaconState, activeIndices []primitives.ValidatorIndex, seed [32]byte) (primitives.ValidatorIndex, error) { length := uint64(len(activeIndices)) if length == 0 { return 0, errors.New("empty active indices list") @@ -385,7 +386,12 @@ func ComputeProposerIndex(bState state.ReadOnlyValidators, activeIndices []primi } effectiveBal := v.EffectiveBalance() - if effectiveBal*maxRandomByte >= params.BeaconConfig().MaxEffectiveBalance*uint64(randomByte) { + maxEB := params.BeaconConfig().MaxEffectiveBalance + if bState.Version() >= version.Electra { + maxEB = params.BeaconConfig().MaxEffectiveBalanceElectra + } + + if effectiveBal*maxRandomByte >= maxEB*uint64(randomByte) { return candidateIndex, nil } } diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index a5df3c6bf83d..c0ab33d395f1 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -597,10 +597,11 @@ func TestComputeProposerIndex(t *testing.T) { seed [32]byte } tests := []struct { - name string - args args - want primitives.ValidatorIndex - wantedErr string + name string + isElectraOrAbove bool + args args + want primitives.ValidatorIndex + wantedErr string }{ { name: "all_active_indices", @@ -682,6 +683,54 @@ func TestComputeProposerIndex(t *testing.T) { }, want: 7, }, + { + name: "electra_probability_changes", + isElectraOrAbove: true, + args: args{ + validators: []*ethpb.Validator{ + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, + }, + indices: []primitives.ValidatorIndex{3}, + seed: seed, + }, + want: 3, + }, + { + name: "electra_probability_changes_all_active", + isElectraOrAbove: true, + args: args{ + validators: []*ethpb.Validator{ + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance}, // skip this one + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + }, + indices: []primitives.ValidatorIndex{0, 1, 2, 3, 4}, + seed: seed, + }, + want: 4, + }, + { + name: "electra_probability_returns_first_validator_with_criteria", + isElectraOrAbove: true, + args: args{ + validators: []*ethpb.Validator{ + {EffectiveBalance: 1}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + {EffectiveBalance: 1}, + {EffectiveBalance: 1}, + {EffectiveBalance: params.BeaconConfig().MaxEffectiveBalanceElectra}, + }, + indices: []primitives.ValidatorIndex{1}, + seed: seed, + }, + want: 1, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -690,6 +739,11 @@ func TestComputeProposerIndex(t *testing.T) { bState := ðpb.BeaconState{Validators: tt.args.validators} stTrie, err := state_native.InitializeFromProtoUnsafePhase0(bState) require.NoError(t, err) + if tt.isElectraOrAbove { + stTrie, err = state_native.InitializeFromProtoUnsafeElectra(ðpb.BeaconStateElectra{Validators: tt.args.validators}) + require.NoError(t, err) + } + got, err := helpers.ComputeProposerIndex(stTrie, tt.args.indices, tt.args.seed) if tt.wantedErr != "" { assert.ErrorContains(t, tt.wantedErr, err) From 028504ae9ac1179003284a691b4ed53203da751e Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:53:20 -0500 Subject: [PATCH 162/325] EIP-6110: Supply validator deposits on chain (#13944) * wip changes * wip changes refactoring deposit functions * wip on deposit functions * wip changes to fix deposit processing * more wip function logic * gaz * wip refactoring deposit changes * removing circlular dependency and other small fix * fixing circular dependencies * fixing validators file * fixing more tests * fixing unit tests * wip deposit packing * refactoring packing * changing packing code some more * fixing packing change * updating more tests * removing comment * fixing transition code for eip6110 * including inserts for validator index cache * adding tests and placeholder test * moving deposit related unit tests over * adding in test for electra proposer packing * spec test wip * moving cache saving to the correct spot * eip-6110: deposit spectests * adding deposit receipt spec tests * reverting altair operations in this pr and will be handled separately * fixing renames but need to refactor process deposits * gaz * fixing names * fixing linting * fixing unit test * fixing a test and updating test util * bal never used * fixing more tests * fixing one more test * addressing feedback * refactoring process deposits to be part of their own fork instead of in blocks package * adding new tests to cover functions and removing redundancies * removing comment based on feedback * resolving easy deepsource issue * refactoring for appropriate aliasing and readability * reverting some changes to simplify diff * small edit to comment * fixing linting * fixing merge changes and review comments * Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go Co-authored-by: Preston Van Loon * partial review comments * addressing slack feedback * moving function from deposits to validator.go * adding in batch verification and improving logs --------- Co-authored-by: Preston Van Loon Co-authored-by: Preston Van Loon --- beacon-chain/core/electra/BUILD.bazel | 13 + .../core/electra/deposit_fuzz_test.go | 48 ++++ beacon-chain/core/electra/deposits.go | 247 +++++++++++++++++- beacon-chain/core/electra/deposits_test.go | 198 ++++++++++++++ beacon-chain/core/electra/transition.go | 33 +++ .../core/electra/transition_no_verify_sig.go | 98 +++++++ beacon-chain/core/electra/transition_test.go | 49 ++++ beacon-chain/core/electra/validator.go | 68 ++++- beacon-chain/core/electra/validator_test.go | 15 ++ beacon-chain/core/electra/withdrawals_test.go | 7 +- beacon-chain/core/helpers/validators.go | 6 +- beacon-chain/core/transition/BUILD.bazel | 1 - beacon-chain/core/transition/transition.go | 28 +- .../transition/transition_no_verify_sig.go | 72 +---- .../v1alpha1/validator/proposer_deposits.go | 29 +- .../validator/proposer_deposits_test.go | 160 +++++++++++- runtime/interop/premine-state.go | 4 +- .../mainnet/electra/operations/BUILD.bazel | 2 + .../operations/deposit_requests_test.go | 11 + .../electra/operations/deposit_test.go | 11 + .../minimal/electra/operations/BUILD.bazel | 2 + .../operations/deposit_requests_test.go | 11 + .../electra/operations/deposit_test.go | 11 + .../shared/electra/operations/BUILD.bazel | 1 + .../shared/electra/operations/deposit.go | 38 +++ .../electra/operations/deposit_request.go | 42 ++- testing/util/electra_state.go | 14 + 27 files changed, 1118 insertions(+), 101 deletions(-) create mode 100644 beacon-chain/core/electra/deposit_fuzz_test.go create mode 100644 beacon-chain/core/electra/transition_no_verify_sig.go create mode 100644 beacon-chain/core/electra/transition_test.go create mode 100644 testing/spectest/mainnet/electra/operations/deposit_requests_test.go create mode 100644 testing/spectest/mainnet/electra/operations/deposit_test.go create mode 100644 testing/spectest/minimal/electra/operations/deposit_requests_test.go create mode 100644 testing/spectest/minimal/electra/operations/deposit_test.go create mode 100644 testing/spectest/shared/electra/operations/deposit.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 92d647c5de64..f703ff7aeb97 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -10,6 +10,7 @@ go_library( "effective_balance_updates.go", "registry_updates.go", "transition.go", + "transition_no_verify_sig.go", "upgrade.go", "validator.go", "withdrawals.go", @@ -18,15 +19,19 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/core/altair:go_default_library", + "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/epoch:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//contracts/deposit:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/engine/v1:go_default_library", @@ -44,8 +49,10 @@ go_test( srcs = [ "churn_test.go", "consolidations_test.go", + "deposit_fuzz_test.go", "deposits_test.go", "effective_balance_updates_test.go", + "transition_test.go", "upgrade_test.go", "validator_test.go", "withdrawals_test.go", @@ -53,11 +60,15 @@ go_test( deps = [ ":go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", + "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -65,7 +76,9 @@ go_test( "//testing/require:go_default_library", "//testing/util:go_default_library", "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_google_gofuzz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", ], diff --git a/beacon-chain/core/electra/deposit_fuzz_test.go b/beacon-chain/core/electra/deposit_fuzz_test.go new file mode 100644 index 000000000000..adf0d04dcd82 --- /dev/null +++ b/beacon-chain/core/electra/deposit_fuzz_test.go @@ -0,0 +1,48 @@ +package electra_test + +import ( + "context" + "testing" + + fuzz "github.com/google/gofuzz" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestFuzzProcessDeposits_10000(t *testing.T) { + fuzzer := fuzz.NewWithSeed(0) + state := ðpb.BeaconStateElectra{} + deposits := make([]*ethpb.Deposit, 100) + ctx := context.Background() + for i := 0; i < 10000; i++ { + fuzzer.Fuzz(state) + for i := range deposits { + fuzzer.Fuzz(deposits[i]) + } + s, err := state_native.InitializeFromProtoUnsafeElectra(state) + require.NoError(t, err) + r, err := electra.ProcessDeposits(ctx, s, deposits) + if err != nil && r != nil { + t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposits) + } + } +} + +func TestFuzzProcessDeposit_10000(t *testing.T) { + fuzzer := fuzz.NewWithSeed(0) + state := ðpb.BeaconStateElectra{} + deposit := ðpb.Deposit{} + + for i := 0; i < 10000; i++ { + fuzzer.Fuzz(state) + fuzzer.Fuzz(deposit) + s, err := state_native.InitializeFromProtoUnsafeElectra(state) + require.NoError(t, err) + r, err := electra.ProcessDeposit(s, deposit, true) + if err != nil && r != nil { + t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit) + } + } +} diff --git a/beacon-chain/core/electra/deposits.go b/beacon-chain/core/electra/deposits.go index 56916f26dea9..db18d5b575b7 100644 --- a/beacon-chain/core/electra/deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -2,15 +2,186 @@ package electra import ( "context" - "errors" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/contracts/deposit" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + log "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) +// ProcessDeposits is one of the operations performed on each processed +// beacon block to verify queued validators from the Ethereum 1.0 Deposit Contract +// into the beacon chain. +// +// Spec pseudocode definition: +// +// For each deposit in block.body.deposits: +// process_deposit(state, deposit) +func ProcessDeposits( + ctx context.Context, + beaconState state.BeaconState, + deposits []*ethpb.Deposit, +) (state.BeaconState, error) { + ctx, span := trace.StartSpan(ctx, "electra.ProcessDeposits") + defer span.End() + // Attempt to verify all deposit signatures at once, if this fails then fall back to processing + // individual deposits with signature verification enabled. + batchVerified, err := blocks.BatchVerifyDepositsSignatures(ctx, deposits) + if err != nil { + return nil, errors.Wrap(err, "could not verify deposit signatures in batch") + } + + for _, d := range deposits { + if d == nil || d.Data == nil { + return nil, errors.New("got a nil deposit in block") + } + beaconState, err = ProcessDeposit(beaconState, d, batchVerified) + if err != nil { + return nil, errors.Wrapf(err, "could not process deposit from %#x", bytesutil.Trunc(d.Data.PublicKey)) + } + } + return beaconState, nil +} + +// ProcessDeposit takes in a deposit object and inserts it +// into the registry as a new validator or balance change. +// Returns the resulting state, a boolean to indicate whether or not the deposit +// resulted in a new validator entry into the beacon state, and any error. +// +// Spec pseudocode definition: +// def process_deposit(state: BeaconState, deposit: Deposit) -> None: +// +// # Verify the Merkle branch +// assert is_valid_merkle_branch( +// leaf=hash_tree_root(deposit.data), +// branch=deposit.proof, +// depth=DEPOSIT_CONTRACT_TREE_DEPTH + 1, # Add 1 for the List length mix-in +// index=state.eth1_deposit_index, +// root=state.eth1_data.deposit_root, +// ) +// +// # Deposits must be processed in order +// state.eth1_deposit_index += 1 +// +// apply_deposit( +// state=state, +// pubkey=deposit.data.pubkey, +// withdrawal_credentials=deposit.data.withdrawal_credentials, +// amount=deposit.data.amount, +// signature=deposit.data.signature, +// ) +func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verifySignature bool) (state.BeaconState, error) { + if err := blocks.VerifyDeposit(beaconState, deposit); err != nil { + if deposit == nil || deposit.Data == nil { + return nil, err + } + return nil, errors.Wrapf(err, "could not verify deposit from %#x", bytesutil.Trunc(deposit.Data.PublicKey)) + } + if err := beaconState.SetEth1DepositIndex(beaconState.Eth1DepositIndex() + 1); err != nil { + return nil, err + } + return ApplyDeposit(beaconState, deposit.Data, verifySignature) +} + +// ApplyDeposit +// def apply_deposit(state: BeaconState, pubkey: BLSPubkey, withdrawal_credentials: Bytes32, amount: uint64, signature: BLSSignature) -> None: +// validator_pubkeys = [v.pubkey for v in state.validators] +// if pubkey not in validator_pubkeys: +// +// # Verify the deposit signature (proof of possession) which is not checked by the deposit contract +// if is_valid_deposit_signature(pubkey, withdrawal_credentials, amount, signature): +// add_validator_to_registry(state, pubkey, withdrawal_credentials, amount) +// +// else: +// +// # Increase balance by deposit amount +// index = ValidatorIndex(validator_pubkeys.index(pubkey)) +// state.pending_balance_deposits.append(PendingBalanceDeposit(index=index, amount=amount)) # [Modified in Electra:EIP-7251] +// # Check if valid deposit switch to compounding credentials +// +// if ( is_compounding_withdrawal_credential(withdrawal_credentials) and has_eth1_withdrawal_credential(state.validators[index]) +// +// and is_valid_deposit_signature(pubkey, withdrawal_credentials, amount, signature) +// ): +// switch_to_compounding_validator(state, index) +func ApplyDeposit(beaconState state.BeaconState, data *ethpb.Deposit_Data, verifySignature bool) (state.BeaconState, error) { + pubKey := data.PublicKey + amount := data.Amount + withdrawalCredentials := data.WithdrawalCredentials + index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) + if !ok { + if verifySignature { + valid, err := IsValidDepositSignature(data) + if err != nil { + return nil, errors.Wrap(err, "could not verify deposit signature") + } + if !valid { + return beaconState, nil + } + } + if err := AddValidatorToRegistry(beaconState, pubKey, withdrawalCredentials, amount); err != nil { + return nil, errors.Wrap(err, "could not add validator to registry") + } + } else { + // no validation on top-ups (phase0 feature). no validation before state change + if err := beaconState.AppendPendingBalanceDeposit(index, amount); err != nil { + return nil, err + } + val, err := beaconState.ValidatorAtIndex(index) + if err != nil { + return nil, err + } + if helpers.IsCompoundingWithdrawalCredential(withdrawalCredentials) && helpers.HasETH1WithdrawalCredential(val) { + if verifySignature { + valid, err := IsValidDepositSignature(data) + if err != nil { + return nil, errors.Wrap(err, "could not verify deposit signature") + } + if !valid { + return beaconState, nil + } + } + if err := SwitchToCompoundingValidator(beaconState, index); err != nil { + return nil, errors.Wrap(err, "could not switch to compound validator") + } + } + } + return beaconState, nil +} + +// IsValidDepositSignature returns whether deposit_data is valid +// def is_valid_deposit_signature(pubkey: BLSPubkey, withdrawal_credentials: Bytes32, amount: uint64, signature: BLSSignature) -> bool: +// +// deposit_message = DepositMessage( pubkey=pubkey, withdrawal_credentials=withdrawal_credentials, amount=amount, ) +// domain = compute_domain(DOMAIN_DEPOSIT) # Fork-agnostic domain since deposits are valid across forks +// signing_root = compute_signing_root(deposit_message, domain) +// return bls.Verify(pubkey, signing_root, signature) +func IsValidDepositSignature(data *ethpb.Deposit_Data) (bool, error) { + domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil) + if err != nil { + return false, err + } + if err := verifyDepositDataSigningRoot(data, domain); err != nil { + // Ignore this error as in the spec pseudo code. + log.WithError(err).Debug("Skipping deposit: could not verify deposit data signature") + return false, nil + } + return true, nil +} + +func verifyDepositDataSigningRoot(obj *ethpb.Deposit_Data, domain []byte) error { + return deposit.VerifyDepositSignature(obj, domain) +} + // ProcessPendingBalanceDeposits implements the spec definition below. This method mutates the state. // // Spec definition: @@ -54,14 +225,14 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac return err } - for _, deposit := range deposits { - if primitives.Gwei(deposit.Amount) > availableForProcessing { + for _, balanceDeposit := range deposits { + if primitives.Gwei(balanceDeposit.Amount) > availableForProcessing { break } - if err := helpers.IncreaseBalance(st, deposit.Index, deposit.Amount); err != nil { + if err := helpers.IncreaseBalance(st, balanceDeposit.Index, balanceDeposit.Amount); err != nil { return err } - availableForProcessing -= primitives.Gwei(deposit.Amount) + availableForProcessing -= primitives.Gwei(balanceDeposit.Amount) nextDepositIndex++ } @@ -79,9 +250,69 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac // ProcessDepositRequests is a function as part of electra to process execution layer deposits func ProcessDepositRequests(ctx context.Context, beaconState state.BeaconState, requests []*enginev1.DepositRequest) (state.BeaconState, error) { - _, span := trace.StartSpan(ctx, "electra.ProcessDepositRequests") + ctx, span := trace.StartSpan(ctx, "electra.ProcessDepositRequests") defer span.End() - // TODO: replace with 6110 logic - // return b.ProcessDepositRequests(beaconState, requests) + + if len(requests) == 0 { + log.Debug("ProcessDepositRequests: no deposit requests found") + return beaconState, nil + } + + deposits := make([]*ethpb.Deposit, 0) + for _, req := range requests { + if req == nil { + return nil, errors.New("got a nil DepositRequest") + } + deposits = append(deposits, ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: req.Pubkey, + WithdrawalCredentials: req.WithdrawalCredentials, + Amount: req.Amount, + Signature: req.Signature, + }, + }) + } + batchVerified, err := blocks.BatchVerifyDepositsSignatures(ctx, deposits) + if err != nil { + return nil, errors.Wrap(err, "could not verify deposit signatures in batch") + } + for _, receipt := range requests { + beaconState, err = processDepositRequest(beaconState, receipt, batchVerified) + if err != nil { + return nil, errors.Wrap(err, "could not apply deposit request") + } + } return beaconState, nil } + +// processDepositRequest processes the specific deposit receipt +// def process_deposit_request(state: BeaconState, deposit_request: DepositRequest) -> None: +// +// # Set deposit request start index +// if state.deposit_requests_start_index == UNSET_DEPOSIT_REQUEST_START_INDEX: +// state.deposit_requests_start_index = deposit_request.index +// +// apply_deposit( +// state=state, +// pubkey=deposit_request.pubkey, +// withdrawal_credentials=deposit_request.withdrawal_credentials, +// amount=deposit_request.amount, +// signature=deposit_request.signature, +// ) +func processDepositRequest(beaconState state.BeaconState, request *enginev1.DepositRequest, verifySignature bool) (state.BeaconState, error) { + requestsStartIndex, err := beaconState.DepositRequestsStartIndex() + if err != nil { + return nil, errors.Wrap(err, "could not get deposit requests start index") + } + if requestsStartIndex == params.BeaconConfig().UnsetDepositRequestsStartIndex { + if err := beaconState.SetDepositRequestsStartIndex(request.Index); err != nil { + return nil, errors.Wrap(err, "could not set deposit requests start index") + } + } + return ApplyDeposit(beaconState, ðpb.Deposit_Data{ + PublicKey: bytesutil.SafeCopyBytes(request.Pubkey), + Amount: request.Amount, + WithdrawalCredentials: bytesutil.SafeCopyBytes(request.WithdrawalCredentials), + Signature: bytesutil.SafeCopyBytes(request.Signature), + }, verifySignature) +} diff --git a/beacon-chain/core/electra/deposits_test.go b/beacon-chain/core/electra/deposits_test.go index 552ef548c54b..fe160d55c4bc 100644 --- a/beacon-chain/core/electra/deposits_test.go +++ b/beacon-chain/core/electra/deposits_test.go @@ -6,11 +6,18 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestProcessPendingBalanceDeposits(t *testing.T) { @@ -126,3 +133,194 @@ func TestProcessPendingBalanceDeposits(t *testing.T) { }) } } + +func TestProcessDepositRequests(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, 1) + sk, err := bls.RandKey() + require.NoError(t, err) + + t.Run("empty requests continues", func(t *testing.T) { + newSt, err := electra.ProcessDepositRequests(context.Background(), st, []*enginev1.DepositRequest{}) + require.NoError(t, err) + require.DeepEqual(t, newSt, st) + }) + t.Run("nil request errors", func(t *testing.T) { + _, err = electra.ProcessDepositRequests(context.Background(), st, []*enginev1.DepositRequest{nil}) + require.ErrorContains(t, "got a nil DepositRequest", err) + }) + + vals := st.Validators() + vals[0].PublicKey = sk.PublicKey().Marshal() + vals[0].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + require.NoError(t, st.SetValidators(vals)) + bals := st.Balances() + bals[0] = params.BeaconConfig().MinActivationBalance + 2000 + require.NoError(t, st.SetBalances(bals)) + require.NoError(t, st.SetPendingBalanceDeposits(make([]*eth.PendingBalanceDeposit, 0))) // reset pbd as the determinitstic state populates this already + withdrawalCred := make([]byte, 32) + withdrawalCred[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte + depositMessage := ð.DepositMessage{ + PublicKey: sk.PublicKey().Marshal(), + Amount: 1000, + WithdrawalCredentials: withdrawalCred, + } + domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil) + require.NoError(t, err) + sr, err := signing.ComputeSigningRoot(depositMessage, domain) + require.NoError(t, err) + sig := sk.Sign(sr[:]) + requests := []*enginev1.DepositRequest{ + { + Pubkey: depositMessage.PublicKey, + Index: 0, + WithdrawalCredentials: depositMessage.WithdrawalCredentials, + Amount: depositMessage.Amount, + Signature: sig.Marshal(), + }, + } + st, err = electra.ProcessDepositRequests(context.Background(), st, requests) + require.NoError(t, err) + + pbd, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 2, len(pbd)) + require.Equal(t, uint64(1000), pbd[0].Amount) + require.Equal(t, uint64(2000), pbd[1].Amount) +} + +func TestProcessDeposit_Electra_Simple(t *testing.T) { + deps, _, err := util.DeterministicDepositsAndKeysSameValidator(3) + require.NoError(t, err) + eth1Data, err := util.DeterministicEth1Data(len(deps)) + require.NoError(t, err) + registry := []*eth.Validator{ + { + PublicKey: []byte{1}, + WithdrawalCredentials: []byte{1, 2, 3}, + }, + } + balances := []uint64{0} + st, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Validators: registry, + Balances: balances, + Eth1Data: eth1Data, + Fork: ð.Fork{ + PreviousVersion: params.BeaconConfig().ElectraForkVersion, + CurrentVersion: params.BeaconConfig().ElectraForkVersion, + }, + }) + require.NoError(t, err) + pdSt, err := electra.ProcessDeposits(context.Background(), st, deps) + require.NoError(t, err) + pbd, err := pdSt.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance, pbd[2].Amount) + require.Equal(t, 3, len(pbd)) +} + +func TestProcessDeposit_SkipsInvalidDeposit(t *testing.T) { + // Same test settings as in TestProcessDeposit_AddsNewValidatorDeposit, except that we use an invalid signature + dep, _, err := util.DeterministicDepositsAndKeys(1) + require.NoError(t, err) + dep[0].Data.Signature = make([]byte, 96) + dt, _, err := util.DepositTrieFromDeposits(dep) + require.NoError(t, err) + root, err := dt.HashTreeRoot() + require.NoError(t, err) + eth1Data := ð.Eth1Data{ + DepositRoot: root[:], + DepositCount: 1, + } + registry := []*eth.Validator{ + { + PublicKey: []byte{1}, + WithdrawalCredentials: []byte{1, 2, 3}, + }, + } + balances := []uint64{0} + beaconState, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ + Validators: registry, + Balances: balances, + Eth1Data: eth1Data, + Fork: ð.Fork{ + PreviousVersion: params.BeaconConfig().GenesisForkVersion, + CurrentVersion: params.BeaconConfig().GenesisForkVersion, + }, + }) + require.NoError(t, err) + newState, err := electra.ProcessDeposit(beaconState, dep[0], true) + require.NoError(t, err, "Expected invalid block deposit to be ignored without error") + + if newState.Eth1DepositIndex() != 1 { + t.Errorf( + "Expected Eth1DepositIndex to be increased by 1 after processing an invalid deposit, received change: %v", + newState.Eth1DepositIndex(), + ) + } + if len(newState.Validators()) != 1 { + t.Errorf("Expected validator list to have length 1, received: %v", len(newState.Validators())) + } + if len(newState.Balances()) != 1 { + t.Errorf("Expected validator balances list to have length 1, received: %v", len(newState.Balances())) + } + if newState.Balances()[0] != 0 { + t.Errorf("Expected validator balance at index 0 to stay 0, received: %v", newState.Balances()[0]) + } +} + +func TestApplyDeposit_TopUps_WithBadSignature(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, 3) + sk, err := bls.RandKey() + require.NoError(t, err) + withdrawalCred := make([]byte, 32) + withdrawalCred[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte + topUpAmount := uint64(1234) + depositData := ð.Deposit_Data{ + PublicKey: sk.PublicKey().Marshal(), + Amount: topUpAmount, + WithdrawalCredentials: withdrawalCred, + Signature: make([]byte, fieldparams.BLSSignatureLength), + } + vals := st.Validators() + vals[0].PublicKey = sk.PublicKey().Marshal() + vals[0].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + require.NoError(t, st.SetValidators(vals)) + adSt, err := electra.ApplyDeposit(st, depositData, true) + require.NoError(t, err) + pbd, err := adSt.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbd)) + require.Equal(t, topUpAmount, pbd[0].Amount) +} + +func TestApplyDeposit_Electra_SwitchToCompoundingValidator(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, 3) + sk, err := bls.RandKey() + require.NoError(t, err) + withdrawalCred := make([]byte, 32) + withdrawalCred[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte + depositData := ð.Deposit_Data{ + PublicKey: sk.PublicKey().Marshal(), + Amount: 1000, + WithdrawalCredentials: withdrawalCred, + Signature: make([]byte, fieldparams.BLSSignatureLength), + } + vals := st.Validators() + vals[0].PublicKey = sk.PublicKey().Marshal() + vals[0].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + require.NoError(t, st.SetValidators(vals)) + bals := st.Balances() + bals[0] = params.BeaconConfig().MinActivationBalance + 2000 + require.NoError(t, st.SetBalances(bals)) + sr, err := signing.ComputeSigningRoot(depositData, bytesutil.ToBytes(3, 32)) + require.NoError(t, err) + sig := sk.Sign(sr[:]) + depositData.Signature = sig.Marshal() + adSt, err := electra.ApplyDeposit(st, depositData, false) + require.NoError(t, err) + pbd, err := adSt.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 2, len(pbd)) + require.Equal(t, uint64(1000), pbd[0].Amount) + require.Equal(t, uint64(2000), pbd[1].Amount) +} diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 12accfccad78..4b2c62269cf6 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -2,12 +2,15 @@ package electra import ( "context" + "fmt" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" e "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "go.opencensus.io/trace" ) @@ -127,3 +130,33 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { return nil } + +// VerifyBlockDepositLength +// +// Spec definition: +// +// # [Modified in Electra:EIP6110] +// # Disable former deposit mechanism once all prior deposits are processed +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) +// if state.eth1_deposit_index < eth1_deposit_index_limit: +// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) +// else: +// assert len(body.deposits) == 0 +func VerifyBlockDepositLength(body interfaces.ReadOnlyBeaconBlockBody, state state.BeaconState) error { + eth1Data := state.Eth1Data() + requestsStartIndex, err := state.DepositRequestsStartIndex() + if err != nil { + return errors.Wrap(err, "failed to get requests start index") + } + eth1DepositIndexLimit := min(eth1Data.DepositCount, requestsStartIndex) + if state.Eth1DepositIndex() < eth1DepositIndexLimit { + if uint64(len(body.Deposits())) != min(params.BeaconConfig().MaxDeposits, eth1DepositIndexLimit-state.Eth1DepositIndex()) { + return fmt.Errorf("incorrect outstanding deposits in block body, wanted: %d, got: %d", min(params.BeaconConfig().MaxDeposits, eth1DepositIndexLimit-state.Eth1DepositIndex()), len(body.Deposits())) + } + } else { + if len(body.Deposits()) != 0 { + return fmt.Errorf("incorrect outstanding deposits in block body, wanted: %d, got: %d", 0, len(body.Deposits())) + } + } + return nil +} diff --git a/beacon-chain/core/electra/transition_no_verify_sig.go b/beacon-chain/core/electra/transition_no_verify_sig.go new file mode 100644 index 000000000000..55ed84c2b3e6 --- /dev/null +++ b/beacon-chain/core/electra/transition_no_verify_sig.go @@ -0,0 +1,98 @@ +package electra + +import ( + "context" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" +) + +var ( + ProcessBLSToExecutionChanges = blocks.ProcessBLSToExecutionChanges + ProcessVoluntaryExits = blocks.ProcessVoluntaryExits + ProcessAttesterSlashings = blocks.ProcessAttesterSlashings + ProcessProposerSlashings = blocks.ProcessProposerSlashings +) + +// ProcessOperations +// +// Spec definition: +// +// def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: +// # [Modified in Electra:EIP6110] +// # Disable former deposit mechanism once all prior deposits are processed +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) +// if state.eth1_deposit_index < eth1_deposit_index_limit: +// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) +// else: +// assert len(body.deposits) == 0 +// +// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: +// for operation in operations: +// fn(state, operation) +// +// for_ops(body.proposer_slashings, process_proposer_slashing) +// for_ops(body.attester_slashings, process_attester_slashing) +// for_ops(body.attestations, process_attestation) # [Modified in Electra:EIP7549] +// for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251] +// for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251] +// for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) +// # [New in Electra:EIP7002:EIP7251] +// for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) +// for_ops(body.execution_payload.deposit_requests, process_deposit_requests) # [New in Electra:EIP6110] +// for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] +func ProcessOperations( + ctx context.Context, + st state.BeaconState, + block interfaces.ReadOnlyBeaconBlock) (state.BeaconState, error) { + // 6110 validations are in VerifyOperationLengths + bb := block.Body() + // Electra extends the altair operations. + st, err := ProcessProposerSlashings(ctx, st, bb.ProposerSlashings(), v.SlashValidator) + if err != nil { + return nil, errors.Wrap(err, "could not process altair proposer slashing") + } + st, err = ProcessAttesterSlashings(ctx, st, bb.AttesterSlashings(), v.SlashValidator) + if err != nil { + return nil, errors.Wrap(err, "could not process altair attester slashing") + } + st, err = ProcessAttestationsNoVerifySignature(ctx, st, block) + if err != nil { + return nil, errors.Wrap(err, "could not process altair attestation") + } + if _, err := ProcessDeposits(ctx, st, bb.Deposits()); err != nil { // new in electra + return nil, errors.Wrap(err, "could not process altair deposit") + } + st, err = ProcessVoluntaryExits(ctx, st, bb.VoluntaryExits()) + if err != nil { + return nil, errors.Wrap(err, "could not process voluntary exits") + } + st, err = ProcessBLSToExecutionChanges(st, block) + if err != nil { + return nil, errors.Wrap(err, "could not process bls-to-execution changes") + } + // new in electra + e, err := bb.Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution data from block") + } + exe, ok := e.(interfaces.ExecutionDataElectra) + if !ok { + return nil, errors.New("could not cast execution data to electra execution data") + } + st, err = ProcessWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) + if err != nil { + return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") + } + + st, err = ProcessDepositRequests(ctx, st, exe.DepositRequests()) // TODO: EIP-6110 deposit changes. + if err != nil { + return nil, errors.Wrap(err, "could not process deposit receipts") + } + + // TODO: Process consolidations from execution header. + return st, nil +} diff --git a/beacon-chain/core/electra/transition_test.go b/beacon-chain/core/electra/transition_test.go new file mode 100644 index 000000000000..5c111d2403dd --- /dev/null +++ b/beacon-chain/core/electra/transition_test.go @@ -0,0 +1,49 @@ +package electra_test + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestVerifyOperationLengths_Electra(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + s, _ := util.DeterministicGenesisStateElectra(t, 1) + sb, err := consensusblocks.NewSignedBeaconBlock(util.NewBeaconBlockElectra()) + require.NoError(t, err) + require.NoError(t, electra.VerifyBlockDepositLength(sb.Block().Body(), s)) + }) + t.Run("eth1depositIndex less than eth1depositIndexLimit & number of deposits incorrect", func(t *testing.T) { + s, _ := util.DeterministicGenesisStateElectra(t, 1) + sb, err := consensusblocks.NewSignedBeaconBlock(util.NewBeaconBlockElectra()) + require.NoError(t, err) + require.NoError(t, s.SetEth1DepositIndex(0)) + require.NoError(t, s.SetDepositRequestsStartIndex(1)) + err = electra.VerifyBlockDepositLength(sb.Block().Body(), s) + require.ErrorContains(t, "incorrect outstanding deposits in block body", err) + }) + t.Run("eth1depositIndex more than eth1depositIndexLimit & number of deposits is not 0", func(t *testing.T) { + s, _ := util.DeterministicGenesisStateElectra(t, 1) + sb, err := consensusblocks.NewSignedBeaconBlock(util.NewBeaconBlockElectra()) + require.NoError(t, err) + sb.SetDeposits([]*ethpb.Deposit{ + { + Data: ðpb.Deposit_Data{ + PublicKey: []byte{1, 2, 3}, + Amount: 1000, + WithdrawalCredentials: make([]byte, common.AddressLength), + Signature: []byte{4, 5, 6}, + }, + }, + }) + require.NoError(t, s.SetEth1DepositIndex(1)) + require.NoError(t, s.SetDepositRequestsStartIndex(1)) + err = electra.VerifyBlockDepositLength(sb.Block().Body(), s) + require.ErrorContains(t, "incorrect outstanding deposits in block body", err) + }) +} diff --git a/beacon-chain/core/electra/validator.go b/beacon-chain/core/electra/validator.go index 91fb0a87021a..82b41fd8d7b4 100644 --- a/beacon-chain/core/electra/validator.go +++ b/beacon-chain/core/electra/validator.go @@ -7,8 +7,74 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) +// AddValidatorToRegistry updates the beacon state with validator information +// def add_validator_to_registry(state: BeaconState, +// +// pubkey: BLSPubkey, +// withdrawal_credentials: Bytes32, +// amount: uint64) -> None: +// index = get_index_for_new_validator(state) +// validator = get_validator_from_deposit(pubkey, withdrawal_credentials) +// set_or_append_list(state.validators, index, validator) +// set_or_append_list(state.balances, index, 0) # [Modified in Electra:EIP7251] +// set_or_append_list(state.previous_epoch_participation, index, ParticipationFlags(0b0000_0000)) +// set_or_append_list(state.current_epoch_participation, index, ParticipationFlags(0b0000_0000)) +// set_or_append_list(state.inactivity_scores, index, uint64(0)) +// state.pending_balance_deposits.append(PendingBalanceDeposit(index=index, amount=amount)) # [New in Electra:EIP7251] +func AddValidatorToRegistry(beaconState state.BeaconState, pubKey []byte, withdrawalCredentials []byte, amount uint64) error { + val := ValidatorFromDeposit(pubKey, withdrawalCredentials) + if err := beaconState.AppendValidator(val); err != nil { + return err + } + index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) + if !ok { + return errors.New("could not find validator in registry") + } + if err := beaconState.AppendBalance(0); err != nil { + return err + } + if err := beaconState.AppendPendingBalanceDeposit(index, amount); err != nil { + return err + } + if err := beaconState.AppendInactivityScore(0); err != nil { + return err + } + if err := beaconState.AppendPreviousParticipationBits(0); err != nil { + return err + } + return beaconState.AppendCurrentParticipationBits(0) +} + +// ValidatorFromDeposit gets a new validator object with provided parameters +// +// def get_validator_from_deposit(pubkey: BLSPubkey, withdrawal_credentials: Bytes32) -> Validator: +// +// return Validator( +// pubkey=pubkey, +// withdrawal_credentials=withdrawal_credentials, +// activation_eligibility_epoch=FAR_FUTURE_EPOCH, +// activation_epoch=FAR_FUTURE_EPOCH, +// exit_epoch=FAR_FUTURE_EPOCH, +// withdrawable_epoch=FAR_FUTURE_EPOCH, +// effective_balance=0, # [Modified in Electra:EIP7251] +// +// ) +func ValidatorFromDeposit(pubKey []byte, withdrawalCredentials []byte) *ethpb.Validator { + return ðpb.Validator{ + PublicKey: pubKey, + WithdrawalCredentials: withdrawalCredentials, + ActivationEligibilityEpoch: params.BeaconConfig().FarFutureEpoch, + ActivationEpoch: params.BeaconConfig().FarFutureEpoch, + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + WithdrawableEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: 0, // [Modified in Electra:EIP7251] + } +} + // SwitchToCompoundingValidator // // Spec definition: @@ -36,7 +102,7 @@ func SwitchToCompoundingValidator(s state.BeaconState, idx primitives.ValidatorI return nil } -// QueueExcessActiveBalance +// QueueExcessActiveBalance queues validators with balances above the min activation balance and adds to pending balance deposit. // // Spec definition: // diff --git a/beacon-chain/core/electra/validator_test.go b/beacon-chain/core/electra/validator_test.go index b7d898f66420..a1fa8308ba22 100644 --- a/beacon-chain/core/electra/validator_test.go +++ b/beacon-chain/core/electra/validator_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,6 +14,20 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) +func TestAddValidatorToRegistry(t *testing.T) { + st, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{}) + require.NoError(t, err) + require.NoError(t, electra.AddValidatorToRegistry(st, make([]byte, fieldparams.BLSPubkeyLength), make([]byte, fieldparams.RootLength), 100)) + balances := st.Balances() + require.Equal(t, 1, len(balances)) + require.Equal(t, uint64(0), balances[0]) + pbds, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(pbds)) + require.Equal(t, uint64(100), pbds[0].Amount) + require.Equal(t, primitives.ValidatorIndex(0), pbds[0].Index) +} + func TestSwitchToCompoundingValidator(t *testing.T) { s, err := state_native.InitializeFromProtoElectra(ð.BeaconStateElectra{ Validators: []*eth.Validator{ diff --git a/beacon-chain/core/electra/withdrawals_test.go b/beacon-chain/core/electra/withdrawals_test.go index 4f2634ebd6a2..da00cdd9cb77 100644 --- a/beacon-chain/core/electra/withdrawals_test.go +++ b/beacon-chain/core/electra/withdrawals_test.go @@ -81,7 +81,6 @@ func TestProcessWithdrawRequests(t *testing.T) { })) _, err = wantPostSt.ExitEpochAndUpdateChurn(primitives.Gwei(v.EffectiveBalance)) require.NoError(t, err) - require.DeepEqual(t, wantPostSt.Validators(), got.Validators()) webc, err := wantPostSt.ExitBalanceToConsume() require.NoError(t, err) gebc, err := got.ExitBalanceToConsume() @@ -110,10 +109,7 @@ func TestProcessWithdrawRequests(t *testing.T) { prefix[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte v.WithdrawalCredentials = append(prefix, source...) require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) - bal, err := preSt.BalanceAtIndex(0) - require.NoError(t, err) - bal += 200 - require.NoError(t, preSt.SetBalances([]uint64{bal})) + require.NoError(t, preSt.SetBalances([]uint64{params.BeaconConfig().MinActivationBalance + 200})) require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ Index: 0, Amount: 100, @@ -168,7 +164,6 @@ func TestProcessWithdrawRequests(t *testing.T) { require.Equal(t, wece, gece) _, err = wantPostSt.ExitEpochAndUpdateChurn(primitives.Gwei(100)) require.NoError(t, err) - require.DeepEqual(t, wantPostSt.Validators(), got.Validators()) webc, err := wantPostSt.ExitBalanceToConsume() require.NoError(t, err) gebc, err := got.ExitBalanceToConsume() diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index 231e06351df9..23ef9a71a052 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -531,16 +531,16 @@ func HasCompoundingWithdrawalCredential(v interfaces.WithWithdrawalCredentials) if v == nil { return false } - return isCompoundingWithdrawalCredential(v.GetWithdrawalCredentials()) + return IsCompoundingWithdrawalCredential(v.GetWithdrawalCredentials()) } -// isCompoundingWithdrawalCredential checks if the credentials are a compounding withdrawal credential. +// IsCompoundingWithdrawalCredential checks if the credentials are a compounding withdrawal credential. // // Spec definition: // // def is_compounding_withdrawal_credential(withdrawal_credentials: Bytes32) -> bool: // return withdrawal_credentials[:1] == COMPOUNDING_WITHDRAWAL_PREFIX -func isCompoundingWithdrawalCredential(creds []byte) bool { +func IsCompoundingWithdrawalCredential(creds []byte) bool { return bytes.HasPrefix(creds, []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte}) } diff --git a/beacon-chain/core/transition/BUILD.bazel b/beacon-chain/core/transition/BUILD.bazel index 9f2ea105cb2e..0f5bb260b4b8 100644 --- a/beacon-chain/core/transition/BUILD.bazel +++ b/beacon-chain/core/transition/BUILD.bazel @@ -40,7 +40,6 @@ go_library( "//crypto/bls:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", - "//math:go_default_library", "//monitoring/tracing:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index d8f4a3b24289..cc7a38341a06 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -24,7 +24,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/prysmaticlabs/prysm/v5/runtime/version" "go.opencensus.io/trace" @@ -376,14 +375,25 @@ func VerifyOperationLengths(_ context.Context, state state.BeaconState, b interf if eth1Data == nil { return nil, errors.New("nil eth1data in state") } - if state.Eth1DepositIndex() > eth1Data.DepositCount { - return nil, fmt.Errorf("expected state.deposit_index %d <= eth1data.deposit_count %d", state.Eth1DepositIndex(), eth1Data.DepositCount) - } - maxDeposits := math.Min(params.BeaconConfig().MaxDeposits, eth1Data.DepositCount-state.Eth1DepositIndex()) - // Verify outstanding deposits are processed up to max number of deposits - if uint64(len(body.Deposits())) != maxDeposits { - return nil, fmt.Errorf("incorrect outstanding deposits in block body, wanted: %d, got: %d", - maxDeposits, len(body.Deposits())) + + if state.Version() < version.Electra { + // Deneb specs + // # Verify that outstanding deposits are processed up to the maximum number of deposits + // assert len(body.deposits) == min(MAX_DEPOSITS, state.eth1_data.deposit_count - state.eth1_deposit_index) + if state.Eth1DepositIndex() > eth1Data.DepositCount { + return nil, fmt.Errorf("expected state.deposit_index %d <= eth1data.deposit_count %d", state.Eth1DepositIndex(), eth1Data.DepositCount) + } + maxDeposits := min(params.BeaconConfig().MaxDeposits, eth1Data.DepositCount-state.Eth1DepositIndex()) + // Verify outstanding deposits are processed up to max number of deposits + if uint64(len(body.Deposits())) != maxDeposits { + return nil, fmt.Errorf("incorrect outstanding deposits in block body, wanted: %d, got: %d", + maxDeposits, len(body.Deposits())) + } + } else { + // Electra + if err := electra.VerifyBlockDepositLength(body, state); err != nil { + return nil, errors.Wrap(err, "failed to verify block deposit length") + } } return state, nil diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index 5d85879d8142..17bc3b7d435d 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -262,24 +262,21 @@ func ProcessOperationsNoVerifyAttsSigs( } var err error - switch beaconBlock.Version() { - case version.Phase0: + if beaconBlock.Version() == version.Phase0 { state, err = phase0Operations(ctx, state, beaconBlock) if err != nil { return nil, err } - case version.Altair, version.Bellatrix, version.Capella, version.Deneb: + } else if beaconBlock.Version() < version.Electra { state, err = altairOperations(ctx, state, beaconBlock) if err != nil { return nil, err } - case version.Electra: - state, err = electraOperations(ctx, state, beaconBlock) + } else { + state, err = electra.ProcessOperations(ctx, state, beaconBlock) if err != nil { return nil, err } - default: - return nil, errors.New("block does not have correct version") } return state, nil @@ -394,67 +391,6 @@ func VerifyBlobCommitmentCount(blk interfaces.ReadOnlyBeaconBlock) error { return nil } -// electraOperations -// -// Spec definition: -// -// def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: -// # [Modified in Electra:EIP6110] -// # Disable former deposit mechanism once all prior deposits are processed -// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) -// if state.eth1_deposit_index < eth1_deposit_index_limit: -// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) -// else: -// assert len(body.deposits) == 0 -// -// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: -// for operation in operations: -// fn(state, operation) -// -// for_ops(body.proposer_slashings, process_proposer_slashing) -// for_ops(body.attester_slashings, process_attester_slashing) -// for_ops(body.attestations, process_attestation) # [Modified in Electra:EIP7549] -// for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251] -// for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251] -// for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) -// # [New in Electra:EIP7002:EIP7251] -// for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) -// for_ops(body.execution_payload.deposit_requests, process_deposit_requests) # [New in Electra:EIP6110] -// for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] -func electraOperations( - ctx context.Context, - st state.BeaconState, - block interfaces.ReadOnlyBeaconBlock) (state.BeaconState, error) { - // 6110 validations are in VerifyOperationLengths - - // Electra extends the altair operations. - st, err := altairOperations(ctx, st, block) - if err != nil { - return nil, err - } - e, err := block.Body().Execution() - if err != nil { - return nil, errors.Wrap(err, "could not get execution data from block") - } - exe, ok := e.(interfaces.ExecutionDataElectra) - if !ok { - return nil, errors.New("could not cast execution data to electra execution data") - } - st, err = electra.ProcessWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) - if err != nil { - return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") - } - - st, err = electra.ProcessDepositRequests(ctx, st, exe.DepositRequests()) // TODO: EIP-6110 deposit changes. - if err != nil { - return nil, errors.Wrap(err, "could not process deposit receipts") - } - - // TODO: Process consolidations from execution header. - - return st, nil -} - // This calls altair block operations. func altairOperations( ctx context.Context, diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go index d2a6ecfb4bda..a32c68c42233 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go @@ -10,7 +10,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/container/trie" + "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/sirupsen/logrus" "go.opencensus.io/trace" "golang.org/x/sync/errgroup" @@ -107,9 +109,32 @@ func (vs *Server) deposits( // deposits are sorted from lowest to highest. var pendingDeps []*ethpb.DepositContainer for _, dep := range allPendingContainers { - if uint64(dep.Index) >= beaconState.Eth1DepositIndex() && uint64(dep.Index) < canonicalEth1Data.DepositCount { - pendingDeps = append(pendingDeps, dep) + if beaconState.Version() < version.Electra { + // Add deposits up to min(MAX_DEPOSITS, eth1_data.deposit_count - state.eth1_deposit_index) + if uint64(dep.Index) >= beaconState.Eth1DepositIndex() && uint64(dep.Index) < canonicalEth1Data.DepositCount { + pendingDeps = append(pendingDeps, dep) + } + } else { + // Electra change EIP6110 + // def get_eth1_pending_deposit_count(state: BeaconState) -> uint64: + // eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) + // if state.eth1_deposit_index < eth1_deposit_index_limit: + // return min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) + // else: + // return uint64(0) + requestsStartIndex, err := beaconState.DepositRequestsStartIndex() + if err != nil { + return nil, errors.Wrap(err, "could not retrieve requests start index") + } + eth1DepositIndexLimit := math.Min(canonicalEth1Data.DepositCount, requestsStartIndex) + if beaconState.Eth1DepositIndex() < eth1DepositIndexLimit { + if uint64(dep.Index) >= beaconState.Eth1DepositIndex() && uint64(dep.Index) < eth1DepositIndexLimit { + pendingDeps = append(pendingDeps, dep) + } + } + // just don't add any pending deps if it's not state.eth1_deposit_index < eth1_deposit_index_limit } + // Don't try to pack more than the max allowed in a block if uint64(len(pendingDeps)) == params.BeaconConfig().MaxDeposits { break diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits_test.go index 00f96db41b55..3b58a88f4fe1 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits_test.go @@ -1,6 +1,22 @@ package validator -import "testing" +import ( + "context" + "math/big" + "testing" + + mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositsnapshot" + mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/container/trie" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) func TestShouldFallback(t *testing.T) { tests := []struct { @@ -54,3 +70,145 @@ func TestShouldFallback(t *testing.T) { }) } } + +func TestProposer_PendingDeposits_Electra(t *testing.T) { + // Electra continues to pack deposits while the state eth1deposit index is less than the eth1depositIndexLimit + ctx := context.Background() + + height := big.NewInt(int64(params.BeaconConfig().Eth1FollowDistance)) + newHeight := big.NewInt(height.Int64() + 11000) + p := &mockExecution.Chain{ + LatestBlockNumber: height, + HashesByHeight: map[int][]byte{ + int(height.Int64()): []byte("0x0"), + int(newHeight.Int64()): []byte("0x1"), + }, + } + + var votes []*ethpb.Eth1Data + + vote := ðpb.Eth1Data{ + BlockHash: bytesutil.PadTo([]byte("0x1"), 32), + DepositRoot: make([]byte, 32), + DepositCount: 7, + } + period := uint64(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(params.BeaconConfig().EpochsPerEth1VotingPeriod))) + for i := 0; i <= int(period/2); i++ { + votes = append(votes, vote) + } + + beaconState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + Eth1Data: ðpb.Eth1Data{ + BlockHash: []byte("0x0"), + DepositRoot: make([]byte, 32), + DepositCount: 5, + }, + Eth1DepositIndex: 1, + DepositRequestsStartIndex: 7, + Eth1DataVotes: votes, + }) + require.NoError(t, err) + blk := util.NewBeaconBlockElectra() + blk.Block.Slot = beaconState.Slot() + + blkRoot, err := blk.HashTreeRoot() + require.NoError(t, err) + + var mockSig [96]byte + var mockCreds [32]byte + + // Using the merkleTreeIndex as the block number for this test... + readyDeposits := []*ethpb.DepositContainer{ + { + Index: 0, + Eth1BlockHeight: 8, + Deposit: ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: bytesutil.PadTo([]byte("a"), 48), + Signature: mockSig[:], + WithdrawalCredentials: mockCreds[:], + }}, + }, + { + Index: 1, + Eth1BlockHeight: 14, + Deposit: ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: bytesutil.PadTo([]byte("b"), 48), + Signature: mockSig[:], + WithdrawalCredentials: mockCreds[:], + }}, + }, + } + + recentDeposits := []*ethpb.DepositContainer{ + { + Index: 2, + Eth1BlockHeight: 5000, + Deposit: ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: bytesutil.PadTo([]byte("c"), 48), + Signature: mockSig[:], + WithdrawalCredentials: mockCreds[:], + }}, + }, + { + Index: 3, + Eth1BlockHeight: 6000, + Deposit: ðpb.Deposit{ + Data: ðpb.Deposit_Data{ + PublicKey: bytesutil.PadTo([]byte("d"), 48), + Signature: mockSig[:], + WithdrawalCredentials: mockCreds[:], + }}, + }, + } + + depositCache, err := depositsnapshot.New() + require.NoError(t, err) + + depositTrie, err := trie.NewTrie(params.BeaconConfig().DepositContractTreeDepth) + require.NoError(t, err, "Could not setup deposit trie") + for _, dp := range append(readyDeposits, recentDeposits...) { + depositHash, err := dp.Deposit.Data.HashTreeRoot() + require.NoError(t, err, "Unable to determine hashed value of deposit") + + assert.NoError(t, depositTrie.Insert(depositHash[:], int(dp.Index))) + root, err := depositTrie.HashTreeRoot() + require.NoError(t, err) + assert.NoError(t, depositCache.InsertDeposit(ctx, dp.Deposit, dp.Eth1BlockHeight, dp.Index, root)) + } + for _, dp := range recentDeposits { + root, err := depositTrie.HashTreeRoot() + require.NoError(t, err) + depositCache.InsertPendingDeposit(ctx, dp.Deposit, dp.Eth1BlockHeight, dp.Index, root) + } + + bs := &Server{ + ChainStartFetcher: p, + Eth1InfoFetcher: p, + Eth1BlockFetcher: p, + DepositFetcher: depositCache, + PendingDepositsFetcher: depositCache, + BlockReceiver: &mock.ChainService{State: beaconState, Root: blkRoot[:]}, + HeadFetcher: &mock.ChainService{State: beaconState, Root: blkRoot[:]}, + } + + deposits, err := bs.deposits(ctx, beaconState, ðpb.Eth1Data{}) + require.NoError(t, err) + assert.Equal(t, 0, len(deposits), "Received unexpected list of deposits") + + // It should also return the recent deposits after their follow window. + p.LatestBlockNumber = big.NewInt(0).Add(p.LatestBlockNumber, big.NewInt(10000)) + // we should get our pending deposits once this vote pushes the vote tally to include + // the updated eth1 data. + deposits, err = bs.deposits(ctx, beaconState, vote) + require.NoError(t, err) + assert.Equal(t, len(recentDeposits), len(deposits), "Received unexpected number of pending deposits") + + require.NoError(t, beaconState.SetDepositRequestsStartIndex(0)) // set it to 0 so it's less than Eth1DepositIndex + deposits, err = bs.deposits(ctx, beaconState, vote) + require.NoError(t, err) + assert.Equal(t, 0, len(deposits), "Received unexpected number of pending deposits") + +} diff --git a/runtime/interop/premine-state.go b/runtime/interop/premine-state.go index ab18e1cde35c..235f8a1968e3 100644 --- a/runtime/interop/premine-state.go +++ b/runtime/interop/premine-state.go @@ -66,7 +66,7 @@ func NewPreminedGenesis(ctx context.Context, t, nvals, pCreds uint64, version in func (s *PremineGenesisConfig) prepare(ctx context.Context) (state.BeaconState, error) { switch s.Version { - case version.Phase0, version.Altair, version.Bellatrix, version.Capella, version.Deneb: + case version.Phase0, version.Altair, version.Bellatrix, version.Capella, version.Deneb, version.Electra: default: return nil, errors.Wrapf(errUnsupportedVersion, "version=%s", version.String(s.Version)) } @@ -205,6 +205,8 @@ func (s *PremineGenesisConfig) processDeposits(ctx context.Context, g state.Beac if _, err = helpers.UpdateGenesisEth1Data(g, deposits, g.Eth1Data()); err != nil { return err } + + // TODO: should be updated when electra E2E is updated _, err = altair.ProcessPreGenesisDeposits(ctx, g, deposits) if err != nil { return errors.Wrap(err, "could not process validator deposits") diff --git a/testing/spectest/mainnet/electra/operations/BUILD.bazel b/testing/spectest/mainnet/electra/operations/BUILD.bazel index 21391d470691..82249f1b97e2 100644 --- a/testing/spectest/mainnet/electra/operations/BUILD.bazel +++ b/testing/spectest/mainnet/electra/operations/BUILD.bazel @@ -8,6 +8,8 @@ go_test( "block_header_test.go", "bls_to_execution_change_test.go", "consolidation_test.go", + "deposit_requests_test.go", + "deposit_test.go", "execution_layer_withdrawals_test.go", "execution_payload_test.go", "proposer_slashing_test.go", diff --git a/testing/spectest/mainnet/electra/operations/deposit_requests_test.go b/testing/spectest/mainnet/electra/operations/deposit_requests_test.go new file mode 100644 index 000000000000..45e2835fb3ab --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/deposit_requests_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_DepositRequests(t *testing.T) { + operations.RunDepositRequestsTest(t, "mainnet") +} diff --git a/testing/spectest/mainnet/electra/operations/deposit_test.go b/testing/spectest/mainnet/electra/operations/deposit_test.go new file mode 100644 index 000000000000..c53dc32d3082 --- /dev/null +++ b/testing/spectest/mainnet/electra/operations/deposit_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_Deposit(t *testing.T) { + operations.RunDepositTest(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/operations/BUILD.bazel b/testing/spectest/minimal/electra/operations/BUILD.bazel index 51d59c038bfb..4d44c8b94666 100644 --- a/testing/spectest/minimal/electra/operations/BUILD.bazel +++ b/testing/spectest/minimal/electra/operations/BUILD.bazel @@ -8,6 +8,8 @@ go_test( "block_header_test.go", "bls_to_execution_change_test.go", "consolidation_test.go", + "deposit_requests_test.go", + "deposit_test.go", "execution_layer_withdrawals_test.go", "execution_payload_test.go", "proposer_slashing_test.go", diff --git a/testing/spectest/minimal/electra/operations/deposit_requests_test.go b/testing/spectest/minimal/electra/operations/deposit_requests_test.go new file mode 100644 index 000000000000..ba06e23e1e31 --- /dev/null +++ b/testing/spectest/minimal/electra/operations/deposit_requests_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMainnet_Electra_Operations_DepositRequests(t *testing.T) { + operations.RunDepositRequestsTest(t, "minimal") +} diff --git a/testing/spectest/minimal/electra/operations/deposit_test.go b/testing/spectest/minimal/electra/operations/deposit_test.go new file mode 100644 index 000000000000..98879f411d9f --- /dev/null +++ b/testing/spectest/minimal/electra/operations/deposit_test.go @@ -0,0 +1,11 @@ +package operations + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations" +) + +func TestMinimal_Electra_Operations_Deposit(t *testing.T) { + operations.RunDepositTest(t, "minimal") +} diff --git a/testing/spectest/shared/electra/operations/BUILD.bazel b/testing/spectest/shared/electra/operations/BUILD.bazel index 01d0b339e9c6..87a8537b8ece 100644 --- a/testing/spectest/shared/electra/operations/BUILD.bazel +++ b/testing/spectest/shared/electra/operations/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "block_header.go", "bls_to_execution_changes.go", "consolidations.go", + "deposit.go", "deposit_request.go", "execution_payload.go", "helpers.go", diff --git a/testing/spectest/shared/electra/operations/deposit.go b/testing/spectest/shared/electra/operations/deposit.go new file mode 100644 index 000000000000..254b440a88d1 --- /dev/null +++ b/testing/spectest/shared/electra/operations/deposit.go @@ -0,0 +1,38 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunDepositTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") + require.NoError(t, err) + depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) + require.NoError(t, err, "Failed to decompress") + deposit := ðpb.Deposit{} + require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") + + body := ðpb.BeaconBlockBodyElectra{Deposits: []*ethpb.Deposit{deposit}} + processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + return electra.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) + } + RunBlockOperationTest(t, folderPath, body, processDepositsFunc) + }) + } +} diff --git a/testing/spectest/shared/electra/operations/deposit_request.go b/testing/spectest/shared/electra/operations/deposit_request.go index 4cb008a835ca..627e09883bf8 100644 --- a/testing/spectest/shared/electra/operations/deposit_request.go +++ b/testing/spectest/shared/electra/operations/deposit_request.go @@ -1,3 +1,43 @@ package operations -// TODO: Add tests. +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunDepositRequestsTest(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit_receipt/pyspec_tests") // TODO: update this + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + depositRequestFile, err := util.BazelFileBytes(folderPath, "deposit_receipt.ssz_snappy") // TODO: #14112 should update this value + require.NoError(t, err) + depositRequestSSZ, err := snappy.Decode(nil /* dst */, depositRequestFile) + require.NoError(t, err, "Failed to decompress") + depositRequest := &enginev1.DepositRequest{} + require.NoError(t, depositRequest.UnmarshalSSZ(depositRequestSSZ), "failed to unmarshal") + requests := []*enginev1.DepositRequest{depositRequest} + body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{DepositRequests: requests}} + processDepositRequestsFunc := func(ctx context.Context, s state.BeaconState, signedBlock interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + e, err := signedBlock.Block().Body().Execution() + require.NoError(t, err, "Failed to get execution") + ee, ok := e.(interfaces.ExecutionDataElectra) + require.Equal(t, true, ok, "Invalid execution payload") + return electra.ProcessDepositRequests(ctx, s, ee.DepositRequests()) + } + RunBlockOperationTest(t, folderPath, body, processDepositRequestsFunc) + }) + } +} diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go index 4b5d74b3aa97..437d2e62d6f5 100644 --- a/testing/util/electra_state.go +++ b/testing/util/electra_state.go @@ -32,10 +32,24 @@ func DeterministicGenesisStateElectra(t testing.TB, numValidators uint64) (state if err != nil { t.Fatal(errors.Wrapf(err, "failed to get genesis beacon state of %d validators", numValidators)) } + if err := setKeysToActive(beaconState); err != nil { + t.Fatal(errors.Wrapf(err, "failed to set keys to active")) + } resetCache() return beaconState, privKeys } +// setKeysToActive is a function to set the validators to active post electra, electra no longer processes deposits based on eth1data +func setKeysToActive(beaconState state.BeaconState) error { + vals := make([]*ethpb.Validator, len(beaconState.Validators())) + for i, val := range beaconState.Validators() { + val.ActivationEpoch = 0 + val.EffectiveBalance = params.BeaconConfig().MinActivationBalance + vals[i] = val + } + return beaconState.SetValidators(vals) +} + // genesisBeaconStateElectra returns the genesis beacon state. func genesisBeaconStateElectra(ctx context.Context, deposits []*ethpb.Deposit, genesisTime uint64, eth1Data *ethpb.Eth1Data) (state.BeaconState, error) { st, err := emptyGenesisStateElectra() From 041e81aad21c371e729e3738602e3ffe3ec2b0af Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sat, 29 Jun 2024 10:56:28 -0500 Subject: [PATCH 163/325] eip-7251: process_registry_updates (#14005) * eip-7251: registry_updates * Fix spectest violation * More unit tests for process_registry_updates * Update tests for ProcessRegistryUpdates * Minor refactorings and benchmark * Update beacon-chain/core/electra/registry_updates.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> * Wrap errors from process_registry_updates for easier debugging * Rewrite process_registry_updates not to use st.Validators() --------- Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --- beacon-chain/core/electra/BUILD.bazel | 1 + beacon-chain/core/electra/registry_updates.go | 81 +++++++++- .../core/electra/registry_updates_test.go | 145 ++++++++++++++++++ beacon-chain/core/electra/transition.go | 3 +- .../electra/epoch_processing/BUILD.bazel | 1 + .../epoch_processing/registry_updates_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 1 + .../epoch_processing/registry_updates_test.go | 11 ++ .../electra/epoch_processing/BUILD.bazel | 1 + .../epoch_processing/registry_updates.go | 32 ++++ 10 files changed, 280 insertions(+), 7 deletions(-) create mode 100644 beacon-chain/core/electra/registry_updates_test.go create mode 100644 testing/spectest/mainnet/electra/epoch_processing/registry_updates_test.go create mode 100644 testing/spectest/minimal/electra/epoch_processing/registry_updates_test.go create mode 100644 testing/spectest/shared/electra/epoch_processing/registry_updates.go diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index f703ff7aeb97..8e9da396597d 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -52,6 +52,7 @@ go_test( "deposit_fuzz_test.go", "deposits_test.go", "effective_balance_updates_test.go", + "registry_updates_test.go", "transition_test.go", "upgrade_test.go", "validator_test.go", diff --git a/beacon-chain/core/electra/registry_updates.go b/beacon-chain/core/electra/registry_updates.go index 546413058d31..f7991ea594d9 100644 --- a/beacon-chain/core/electra/registry_updates.go +++ b/beacon-chain/core/electra/registry_updates.go @@ -2,12 +2,18 @@ package electra import ( "context" + "fmt" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) -// ProcessRegistryUpdates rotates validators in and out of active pool. -// the amount to rotate is determined churn limit. +// ProcessRegistryUpdates processes all validators eligible for the activation queue, all validators +// which should be ejected, and all validators which are eligible for activation from the queue. // // Spec pseudocode definition: // @@ -28,7 +34,72 @@ import ( // for validator in state.validators: // if is_eligible_for_activation(state, validator): // validator.activation_epoch = activation_epoch -func ProcessRegistryUpdates(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { - // TODO: replace with real implementation - return state, nil +func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) error { + currentEpoch := time.CurrentEpoch(st) + ejectionBal := params.BeaconConfig().EjectionBalance + activationEpoch := helpers.ActivationExitEpoch(currentEpoch) + + // To avoid copying the state validator set via st.Validators(), we will perform a read only pass + // over the validator set while collecting validator indices where the validator copy is actually + // necessary, then we will process these operations. + eligibleForActivationQ := make([]primitives.ValidatorIndex, 0) + eligibleForEjection := make([]primitives.ValidatorIndex, 0) + eligibleForActivation := make([]primitives.ValidatorIndex, 0) + + if err := st.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error { + // Collect validators eligible to enter the activation queue. + if helpers.IsEligibleForActivationQueue(val, currentEpoch) { + eligibleForActivationQ = append(eligibleForActivationQ, primitives.ValidatorIndex(idx)) + } + + // Collect validators to eject. + if val.EffectiveBalance() <= ejectionBal && helpers.IsActiveValidatorUsingTrie(val, currentEpoch) { + eligibleForEjection = append(eligibleForEjection, primitives.ValidatorIndex(idx)) + } + + // Collect validators eligible for activation and not yet dequeued for activation. + if helpers.IsEligibleForActivationUsingTrie(st, val) { + eligibleForActivation = append(eligibleForActivation, primitives.ValidatorIndex(idx)) + } + + return nil + }); err != nil { + return fmt.Errorf("failed to read validators: %w", err) + } + + // Handle validators eligible to join the activation queue. + for _, idx := range eligibleForActivationQ { + v, err := st.ValidatorAtIndex(idx) + if err != nil { + return err + } + v.ActivationEligibilityEpoch = currentEpoch + 1 + if err := st.UpdateValidatorAtIndex(idx, v); err != nil { + return fmt.Errorf("failed to updated eligible validator at index %d: %w", idx, err) + } + } + + // Handle validator ejections. + for _, idx := range eligibleForEjection { + var err error + // exitQueueEpoch and churn arguments are not used in electra. + st, _, err = validators.InitiateValidatorExit(ctx, st, idx, 0 /*exitQueueEpoch*/, 0 /*churn*/) + if err != nil { + return fmt.Errorf("failed to initiate validator exit at index %d: %w", idx, err) + } + } + + for _, idx := range eligibleForActivation { + // Activate all eligible validators. + v, err := st.ValidatorAtIndex(idx) + if err != nil { + return err + } + v.ActivationEpoch = activationEpoch + if err := st.UpdateValidatorAtIndex(idx, v); err != nil { + return fmt.Errorf("failed to activate validator at index %d: %w", idx, err) + } + } + + return nil } diff --git a/beacon-chain/core/electra/registry_updates_test.go b/beacon-chain/core/electra/registry_updates_test.go new file mode 100644 index 000000000000..44449d66ca89 --- /dev/null +++ b/beacon-chain/core/electra/registry_updates_test.go @@ -0,0 +1,145 @@ +package electra_test + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func TestProcessRegistryUpdates(t *testing.T) { + finalizedEpoch := primitives.Epoch(4) + + tests := []struct { + name string + state state.BeaconState + check func(*testing.T, state.BeaconState) + }{ + { + name: "No rotation", + state: func() state.BeaconState { + base := ð.BeaconStateElectra{ + Slot: 5 * params.BeaconConfig().SlotsPerEpoch, + Validators: []*eth.Validator{ + {ExitEpoch: params.BeaconConfig().MaxSeedLookahead}, + {ExitEpoch: params.BeaconConfig().MaxSeedLookahead}, + }, + Balances: []uint64{ + params.BeaconConfig().MaxEffectiveBalance, + params.BeaconConfig().MaxEffectiveBalance, + }, + FinalizedCheckpoint: ð.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + } + st, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + for i, val := range st.Validators() { + require.Equal(t, params.BeaconConfig().MaxSeedLookahead, val.ExitEpoch, "validator updated unexpectedly at index %d", i) + } + }, + }, + { + name: "Validators are activated", + state: func() state.BeaconState { + base := ð.BeaconStateElectra{ + Slot: 5 * params.BeaconConfig().SlotsPerEpoch, + FinalizedCheckpoint: ð.Checkpoint{Epoch: finalizedEpoch, Root: make([]byte, fieldparams.RootLength)}, + } + for i := uint64(0); i < 10; i++ { + base.Validators = append(base.Validators, ð.Validator{ + ActivationEligibilityEpoch: finalizedEpoch, + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + ActivationEpoch: params.BeaconConfig().FarFutureEpoch, + }) + } + st, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + activationEpoch := helpers.ActivationExitEpoch(5) + // All validators should be activated. + for i, val := range st.Validators() { + require.Equal(t, activationEpoch, val.ActivationEpoch, "failed to update validator at index %d", i) + } + }, + }, + { + name: "Validators are exited", + state: func() state.BeaconState { + base := ð.BeaconStateElectra{ + Slot: 5 * params.BeaconConfig().SlotsPerEpoch, + FinalizedCheckpoint: ð.Checkpoint{Epoch: finalizedEpoch, Root: make([]byte, fieldparams.RootLength)}, + } + for i := uint64(0); i < 10; i++ { + base.Validators = append(base.Validators, ð.Validator{ + EffectiveBalance: params.BeaconConfig().EjectionBalance - 1, + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + WithdrawableEpoch: params.BeaconConfig().FarFutureEpoch, + }) + } + st, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + // All validators should be exited + for i, val := range st.Validators() { + require.NotEqual(t, params.BeaconConfig().FarFutureEpoch, val.ExitEpoch, "failed to update exit epoch on validator %d", i) + require.NotEqual(t, params.BeaconConfig().FarFutureEpoch, val.WithdrawableEpoch, "failed to update withdrawable epoch on validator %d", i) + } + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := electra.ProcessRegistryUpdates(context.TODO(), tt.state) + require.NoError(t, err) + if tt.check != nil { + tt.check(t, tt.state) + } + }) + } +} + +func Benchmark_ProcessRegistryUpdates_MassEjection(b *testing.B) { + bal := params.BeaconConfig().EjectionBalance - 1 + ffe := params.BeaconConfig().FarFutureEpoch + genValidators := func(num uint64) []*eth.Validator { + vals := make([]*eth.Validator, num) + for i := range vals { + vals[i] = ð.Validator{ + EffectiveBalance: bal, + ExitEpoch: ffe, + } + } + return vals + } + + st, err := util.NewBeaconStateElectra() + require.NoError(b, err) + + for i := 0; i < b.N; i++ { + b.StopTimer() + if err := st.SetValidators(genValidators(100000)); err != nil { + panic(err) + } + b.StartTimer() + + if err := electra.ProcessRegistryUpdates(context.TODO(), st); err != nil { + panic(err) + } + } +} diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 4b2c62269cf6..97388eba7bcc 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -77,8 +77,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { return errors.Wrap(err, "could not process rewards and penalties") } - state, err = ProcessRegistryUpdates(ctx, state) - if err != nil { + if err := ProcessRegistryUpdates(ctx, state); err != nil { return errors.Wrap(err, "could not process registry updates") } diff --git a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel index cd8b0de62edf..9315ef295420 100644 --- a/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/mainnet/electra/epoch_processing/BUILD.bazel @@ -12,6 +12,7 @@ go_test( "pending_balance_updates_test.go", "pending_consolidations_test.go", "randao_mixes_reset_test.go", + "registry_updates_test.go", "rewards_and_penalties_test.go", "slashings_reset_test.go", "slashings_test.go", diff --git a/testing/spectest/mainnet/electra/epoch_processing/registry_updates_test.go b/testing/spectest/mainnet/electra/epoch_processing/registry_updates_test.go new file mode 100644 index 000000000000..8eb9a05227a2 --- /dev/null +++ b/testing/spectest/mainnet/electra/epoch_processing/registry_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMainnet_Electra_EpochProcessing_RegistryUpdates(t *testing.T) { + epoch_processing.RunRegistryUpdatesTests(t, "mainnet") +} diff --git a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel index 162e4f072fe7..66efa96a1037 100644 --- a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel @@ -12,6 +12,7 @@ go_test( "pending_balance_updates_test.go", "pending_consolidations_test.go", "randao_mixes_reset_test.go", + "registry_updates_test.go", "rewards_and_penalties_test.go", "slashings_reset_test.go", "slashings_test.go", diff --git a/testing/spectest/minimal/electra/epoch_processing/registry_updates_test.go b/testing/spectest/minimal/electra/epoch_processing/registry_updates_test.go new file mode 100644 index 000000000000..b6986071f8dc --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/registry_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_RegistryUpdates(t *testing.T) { + epoch_processing.RunRegistryUpdatesTests(t, "minimal") +} diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index f651ce5c648e..f9b321866e33 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "pending_balance_updates.go", "pending_consolidations.go", "randao_mixes_reset.go", + "registry_updates.go", "rewards_and_penalties.go", "slashings.go", "slashings_reset.go", diff --git a/testing/spectest/shared/electra/epoch_processing/registry_updates.go b/testing/spectest/shared/electra/epoch_processing/registry_updates.go new file mode 100644 index 000000000000..bc00a1f85731 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/registry_updates.go @@ -0,0 +1,32 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +// RunRegistryUpdatesTests executes "epoch_processing/registry_updates" tests. +func RunRegistryUpdatesTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/registry_updates/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + // Important to clear cache for every test or else the old value of active validator count gets reused. + helpers.ClearCache() + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processRegistryUpdatesWrapper) + }) + } +} + +func processRegistryUpdatesWrapper(_ *testing.T, state state.BeaconState) (state.BeaconState, error) { + return state, electra.ProcessRegistryUpdates(context.Background(), state) +} From 0d49f6c142991ceeba6bba1f7303b52ab3e90541 Mon Sep 17 00:00:00 2001 From: Afanti <127061691+threewebcode@users.noreply.github.com> Date: Sun, 30 Jun 2024 05:03:15 +0800 Subject: [PATCH 164/325] chore: fix comments (#14149) fix the typos in the code comments. --- beacon-chain/p2p/subnets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/p2p/subnets.go b/beacon-chain/p2p/subnets.go index 1809c7db5f19..78b65cc3ebe5 100644 --- a/beacon-chain/p2p/subnets.go +++ b/beacon-chain/p2p/subnets.go @@ -31,7 +31,7 @@ var syncCommsSubnetCount = params.BeaconConfig().SyncCommitteeSubnetCount var attSubnetEnrKey = params.BeaconNetworkConfig().AttSubnetKey var syncCommsSubnetEnrKey = params.BeaconNetworkConfig().SyncCommsSubnetKey -// The value used with the subnet, inorder +// The value used with the subnet, in order // to create an appropriate key to retrieve // the relevant lock. This is used to differentiate // sync subnets from attestation subnets. This is deliberately From ca83d29eef8b65a11ec3b3e81a316665fd6be24c Mon Sep 17 00:00:00 2001 From: Brindrajsinh Chauhan <91854080+Brindrajsinh-Chauhan@users.noreply.github.com> Date: Sat, 29 Jun 2024 19:08:16 -0400 Subject: [PATCH 165/325] go version upgrade (#14161) --- WORKSPACE | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d853e226be4a..b85ecb2dcfbc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -182,7 +182,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() go_register_toolchains( - go_version = "1.21.8", + go_version = "1.21.11", nogo = "@//:nogo", ) diff --git a/go.mod b/go.mod index 14285f7f03a7..24f417e3c37d 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/prysmaticlabs/prysm/v5 go 1.21 -toolchain go1.21.5 +toolchain go1.21.11 require ( contrib.go.opencensus.io/exporter/jaeger v0.2.1 From 84e7f33fd99e8b3c86b411aed5a355e8168104ae Mon Sep 17 00:00:00 2001 From: terence Date: Sat, 29 Jun 2024 16:12:43 -0700 Subject: [PATCH 166/325] Update to v1.5.0-alpha.3 spec tests (#14112) * Update to v1.5.0-alpha.3 spec tests * Fix deposit request * Remove todo --- WORKSPACE | 10 +++--- beacon-chain/rpc/eth/config/handlers_test.go | 4 +-- .../state-native/getters_withdrawal_test.go | 2 +- config/params/config.go | 2 +- config/params/loader_test.go | 3 ++ config/params/mainnet_config.go | 2 +- proto/prysm/v1alpha1/attestation.pb.go | 34 +++++++++---------- proto/prysm/v1alpha1/attestation.proto | 6 ++-- .../electra/operations/deposit_request.go | 4 +-- .../electra/operations/withdrawal_request.go | 6 ++-- .../shared/electra/ssz_static/ssz_static.go | 18 ++-------- 11 files changed, 40 insertions(+), 51 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index b85ecb2dcfbc..f78a9b9a5919 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-alpha.2" +consensus_spec_version = "v1.5.0-alpha.3" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-NNXBa7SZ2sFb68HPNahgu1p0yDBpjuKJuLfRCl7vvoQ=", + integrity = "sha256-+byv+GUOQytex5GgtjBGVoNDseJZbiBdAjEtlgCbjEo=", 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-7BnlBvGWU92iAB100cMaAXVQhRrqpMQbavgrI+/paCw=", + integrity = "sha256-JJUy/jT1h3kGQkinTuzL7gMOA1+qgmPgJXVrYuH63Cg=", 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-VCHhcNt+fynf/sHK11qbRBAy608u9T1qAafvAGfxQhA=", + integrity = "sha256-T2VM4Qd0SwgGnTjWxjOX297DqEsovO9Ueij1UEJy48Y=", 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-a2aCNFyFkYLtf6QSwGOHdx7xXHjA2NNT8x8ZuxB0aes=", + integrity = "sha256-OP9BCBcQ7i+93bwj7ktY8pZ5uWsGjgTe4XTp7BDhX+I=", 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/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index 18a5159da585..1863f86cc1f7 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -144,7 +144,7 @@ func TestGetSpec(t *testing.T) { config.PendingConsolidationsLimit = 84 config.MaxPartialWithdrawalsPerPayload = 85 config.FullExitRequestAmount = 86 - config.MaxConsolidations = 87 + config.MaxConsolidationsRequestsPerPayload = 87 config.MaxAttesterSlashingsElectra = 88 config.MaxAttestationsElectra = 89 config.MaxWithdrawalRequestsPerPayload = 90 @@ -514,7 +514,7 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "85", v) case "FULL_EXIT_REQUEST_AMOUNT": assert.Equal(t, "86", v) - case "MAX_CONSOLIDATIONS": + case "MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD": assert.Equal(t, "87", v) case "DOMAIN_CONSOLIDATION": assert.Equal(t, "0x31313030", v) diff --git a/beacon-chain/state/state-native/getters_withdrawal_test.go b/beacon-chain/state/state-native/getters_withdrawal_test.go index bfaa841bc585..f296f4e6e53d 100644 --- a/beacon-chain/state/state-native/getters_withdrawal_test.go +++ b/beacon-chain/state/state-native/getters_withdrawal_test.go @@ -336,7 +336,7 @@ func TestExpectedWithdrawals(t *testing.T) { t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // This spectest has a fully hydrated beacon state with partial pending withdrawals. - serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/execution_layer_withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy") + serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy") require.NoError(t, err) serializedSSZ, err := snappy.Decode(nil /* dst */, serializedBytes) require.NoError(t, err) diff --git a/config/params/config.go b/config/params/config.go index 816089cbcbcf..5a33bc1a631d 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -246,7 +246,7 @@ type BeaconChainConfig struct { PendingBalanceDepositLimit uint64 `yaml:"PENDING_BALANCE_DEPOSITS_LIMIT" spec:"true"` // PendingBalanceDepositLimit is the maximum number of pending balance deposits allowed in the beacon state. PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT" spec:"true"` // PendingPartialWithdrawalsLimit is the maximum number of pending partial withdrawals allowed in the beacon state. PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT" spec:"true"` // PendingConsolidationsLimit is the maximum number of pending validator consolidations allowed in the beacon state. - MaxConsolidations uint64 `yaml:"MAX_CONSOLIDATIONS" spec:"true"` // MaxConsolidations is the maximum number of consolidations in a block. + MaxConsolidationsRequestsPerPayload uint64 `yaml:"MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxConsolidationsRequestsPerPayload is the maximum number of consolidations in a block. MaxPendingPartialsPerWithdrawalsSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalsSweep is the maximum number of pending partial withdrawals to process per payload. FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit. MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload. diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 09b9491f2b17..3045bb4a5e78 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -25,6 +25,7 @@ import ( // IMPORTANT: Use one field per line and sort these alphabetically to reduce conflicts. var placeholderFields = []string{ "BYTES_PER_LOGS_BLOOM", // Compile time constant on ExecutionPayload.logs_bloom. + "CUSTODY_REQUIREMENT", "EIP6110_FORK_EPOCH", "EIP6110_FORK_VERSION", "EIP7002_FORK_EPOCH", @@ -40,6 +41,8 @@ var placeholderFields = []string{ "MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. "REORG_HEAD_WEIGHT_THRESHOLD", + "SAMPLES_PER_SLOT", + "TARGET_NUMBER_OF_PEERS", "UPDATE_TIMEOUT", "WHISK_EPOCHS_PER_SHUFFLING_PHASE", "WHISK_FORK_EPOCH", diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index bfb8af28ef36..3cd9fc47a8d0 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -286,7 +286,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ PendingPartialWithdrawalsLimit: 134_217_728, PendingConsolidationsLimit: 262_144, MinActivationBalance: 32_000_000_000, - MaxConsolidations: 1, + MaxConsolidationsRequestsPerPayload: 1, MaxPendingPartialsPerWithdrawalsSweep: 8, FullExitRequestAmount: 0, MaxWithdrawalRequestsPerPayload: 16, diff --git a/proto/prysm/v1alpha1/attestation.pb.go b/proto/prysm/v1alpha1/attestation.pb.go index 1e5694b84c61..6b1f970fb1ef 100755 --- a/proto/prysm/v1alpha1/attestation.pb.go +++ b/proto/prysm/v1alpha1/attestation.pb.go @@ -94,8 +94,8 @@ type AttestationElectra struct { AggregationBits github_com_prysmaticlabs_go_bitfield.Bitlist `protobuf:"bytes,1,opt,name=aggregation_bits,json=aggregationBits,proto3" json:"aggregation_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitlist" ssz-max:"131072"` Data *AttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - CommitteeBits github_com_prysmaticlabs_go_bitfield.Bitvector64 `protobuf:"bytes,4,opt,name=committee_bits,json=committeeBits,proto3" json:"committee_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector64" ssz-size:"8"` Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + CommitteeBits github_com_prysmaticlabs_go_bitfield.Bitvector64 `protobuf:"bytes,4,opt,name=committee_bits,json=committeeBits,proto3" json:"committee_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector64" ssz-size:"8"` } func (x *AttestationElectra) Reset() { @@ -144,18 +144,18 @@ func (x *AttestationElectra) GetData() *AttestationData { return nil } -func (x *AttestationElectra) GetCommitteeBits() github_com_prysmaticlabs_go_bitfield.Bitvector64 { +func (x *AttestationElectra) GetSignature() []byte { if x != nil { - return x.CommitteeBits + return x.Signature } - return github_com_prysmaticlabs_go_bitfield.Bitvector64(nil) + return nil } -func (x *AttestationElectra) GetSignature() []byte { +func (x *AttestationElectra) GetCommitteeBits() github_com_prysmaticlabs_go_bitfield.Bitvector64 { if x != nil { - return x.Signature + return x.CommitteeBits } - return nil + return github_com_prysmaticlabs_go_bitfield.Bitvector64(nil) } type AggregateAttestationAndProof struct { @@ -561,16 +561,16 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{ 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x60, 0x0a, - 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x39, 0x82, 0xb5, 0x18, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, - 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x38, - 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, - 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x60, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x39, 0x82, 0xb5, 0x18, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, + 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x38, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x42, 0x69, 0x74, 0x73, 0x22, 0x8d, 0x02, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, diff --git a/proto/prysm/v1alpha1/attestation.proto b/proto/prysm/v1alpha1/attestation.proto index 630d05f90cd7..a41a3e685fcc 100644 --- a/proto/prysm/v1alpha1/attestation.proto +++ b/proto/prysm/v1alpha1/attestation.proto @@ -42,11 +42,11 @@ message AttestationElectra { AttestationData data = 2; - // TODO: doc - bytes committee_bits = 4 [(ethereum.eth.ext.ssz_size) = "committee_bits.size", (ethereum.eth.ext.cast_type) = "committee_bits.type"]; - // 96 byte BLS aggregate signature. bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; + + // Represents the committee which aggregated attestation belong. + bytes committee_bits = 4 [(ethereum.eth.ext.ssz_size) = "committee_bits.size", (ethereum.eth.ext.cast_type) = "committee_bits.type"]; } message AggregateAttestationAndProof { diff --git a/testing/spectest/shared/electra/operations/deposit_request.go b/testing/spectest/shared/electra/operations/deposit_request.go index 627e09883bf8..9f904959b4ea 100644 --- a/testing/spectest/shared/electra/operations/deposit_request.go +++ b/testing/spectest/shared/electra/operations/deposit_request.go @@ -18,11 +18,11 @@ import ( func RunDepositRequestsTest(t *testing.T, config string) { require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit_receipt/pyspec_tests") // TODO: update this + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit_request/pyspec_tests") for _, folder := range testFolders { t.Run(folder.Name(), func(t *testing.T) { folderPath := path.Join(testsFolderPath, folder.Name()) - depositRequestFile, err := util.BazelFileBytes(folderPath, "deposit_receipt.ssz_snappy") // TODO: #14112 should update this value + depositRequestFile, err := util.BazelFileBytes(folderPath, "deposit_request.ssz_snappy") require.NoError(t, err) depositRequestSSZ, err := snappy.Decode(nil /* dst */, depositRequestFile) require.NoError(t, err, "Failed to decompress") diff --git a/testing/spectest/shared/electra/operations/withdrawal_request.go b/testing/spectest/shared/electra/operations/withdrawal_request.go index 5278dd97c00d..2f5451a74972 100644 --- a/testing/spectest/shared/electra/operations/withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/withdrawal_request.go @@ -18,14 +18,14 @@ import ( func RunWithdrawalRequestTest(t *testing.T, config string) { require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests") + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawal_request/pyspec_tests") if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests") + t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/withdrawal_request/pyspec_tests") } for _, folder := range testFolders { t.Run(folder.Name(), func(t *testing.T) { folderPath := path.Join(testsFolderPath, folder.Name()) - withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "execution_layer_withdrawal_request.ssz_snappy") + withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "withdrawal_request.ssz_snappy") require.NoError(t, err) withdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, withdrawalRequestFile) require.NoError(t, err, "Failed to decompress") diff --git a/testing/spectest/shared/electra/ssz_static/ssz_static.go b/testing/spectest/shared/electra/ssz_static/ssz_static.go index d64e5d9968a8..86522ce4cdbf 100644 --- a/testing/spectest/shared/electra/ssz_static/ssz_static.go +++ b/testing/spectest/shared/electra/ssz_static/ssz_static.go @@ -37,10 +37,8 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i var obj interface{} switch folderName { case "ExecutionPayload": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = &enginev1.ExecutionPayloadElectra{} case "ExecutionPayloadHeader": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = &enginev1.ExecutionPayloadHeaderElectra{} case "Attestation": obj = ðpb.AttestationElectra{} @@ -51,15 +49,12 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i case "AggregateAndProof": obj = ðpb.AggregateAttestationAndProofElectra{} case "BeaconBlock": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.BeaconBlockElectra{} case "BeaconBlockBody": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.BeaconBlockBodyElectra{} case "BeaconBlockHeader": obj = ðpb.BeaconBlockHeader{} case "BeaconState": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.BeaconStateElectra{} case "Checkpoint": obj = ðpb.Checkpoint{} @@ -89,7 +84,6 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i case "SignedAggregateAndProof": obj = ðpb.SignedAggregateAttestationAndProofElectra{} case "SignedBeaconBlock": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") obj = ðpb.SignedBeaconBlockElectra{} case "SignedBeaconBlockHeader": obj = ðpb.SignedBeaconBlockHeader{} @@ -151,19 +145,11 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i obj = ðpb.PendingBalanceDeposit{} case "PendingPartialWithdrawal": obj = ðpb.PendingPartialWithdrawal{} - case "Consolidation": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") - // TODO: Remove this case when the spectests are updated to v1.5.0-alpha.3 - return nil, nil - case "SignedConsolidation": - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") - // TODO: Remove this case when the spectests are updated to v1.5.0-alpha.3 - return nil, nil case "PendingConsolidation": obj = ðpb.PendingConsolidation{} - case "ExecutionLayerWithdrawalRequest": // TODO: update in spectest update + case "WithdrawalRequest": obj = &enginev1.WithdrawalRequest{} - case "DepositReceipt": // TODO: update in spectest update + case "DepositRequest": obj = &enginev1.DepositRequest{} case "ConsolidationRequest": obj = &enginev1.ConsolidationRequest{} From af5eb822179a3b0b89e79c19af8febfb61941cb4 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 1 Jul 2024 12:11:09 -0500 Subject: [PATCH 167/325] Electra: get_next_sync_committee_indices. (#14164) --- beacon-chain/core/altair/BUILD.bazel | 1 + beacon-chain/core/altair/sync_committee.go | 11 +++- .../core/altair/sync_committee_test.go | 59 ++++++++++++------- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/beacon-chain/core/altair/BUILD.bazel b/beacon-chain/core/altair/BUILD.bazel index dcd3094e3029..37d83038eb83 100644 --- a/beacon-chain/core/altair/BUILD.bazel +++ b/beacon-chain/core/altair/BUILD.bazel @@ -79,6 +79,7 @@ go_test( "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", diff --git a/beacon-chain/core/altair/sync_committee.go b/beacon-chain/core/altair/sync_committee.go index 9bfcd8434c6e..88ef8650763d 100644 --- a/beacon-chain/core/altair/sync_committee.go +++ b/beacon-chain/core/altair/sync_committee.go @@ -18,6 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -101,7 +102,8 @@ func NextSyncCommittee(ctx context.Context, s state.BeaconState) (*ethpb.SyncCom // candidate_index = active_validator_indices[shuffled_index] // random_byte = hash(seed + uint_to_bytes(uint64(i // 32)))[i % 32] // effective_balance = state.validators[candidate_index].effective_balance -// if effective_balance * MAX_RANDOM_BYTE >= MAX_EFFECTIVE_BALANCE * random_byte: +// # [Modified in Electra:EIP7251] +// if effective_balance * MAX_RANDOM_BYTE >= MAX_EFFECTIVE_BALANCE_ELECTRA * random_byte: // sync_committee_indices.append(candidate_index) // i += 1 // return sync_committee_indices @@ -121,6 +123,11 @@ func NextSyncCommitteeIndices(ctx context.Context, s state.BeaconState) ([]primi cIndices := make([]primitives.ValidatorIndex, 0, syncCommitteeSize) hashFunc := hash.CustomSHA256Hasher() + maxEB := cfg.MaxEffectiveBalanceElectra + if s.Version() < version.Electra { + maxEB = cfg.MaxEffectiveBalance + } + for i := primitives.ValidatorIndex(0); uint64(len(cIndices)) < params.BeaconConfig().SyncCommitteeSize; i++ { if ctx.Err() != nil { return nil, ctx.Err() @@ -140,7 +147,7 @@ func NextSyncCommitteeIndices(ctx context.Context, s state.BeaconState) ([]primi } effectiveBal := v.EffectiveBalance() - if effectiveBal*maxRandomByte >= cfg.MaxEffectiveBalance*uint64(randomByte) { + if effectiveBal*maxRandomByte >= maxEB*uint64(randomByte) { cIndices = append(cIndices, cIndex) } } diff --git a/beacon-chain/core/altair/sync_committee_test.go b/beacon-chain/core/altair/sync_committee_test.go index c9406d876a8e..9e38b0065440 100644 --- a/beacon-chain/core/altair/sync_committee_test.go +++ b/beacon-chain/core/altair/sync_committee_test.go @@ -13,13 +13,14 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" prysmTime "github.com/prysmaticlabs/prysm/v5/time" ) func TestSyncCommitteeIndices_CanGet(t *testing.T) { - getState := func(t *testing.T, count uint64) state.BeaconState { + getState := func(t *testing.T, count uint64, vers int) state.BeaconState { validators := make([]*ethpb.Validator, count) for i := 0; i < len(validators); i++ { validators[i] = ðpb.Validator{ @@ -27,17 +28,28 @@ func TestSyncCommitteeIndices_CanGet(t *testing.T) { EffectiveBalance: params.BeaconConfig().MinDepositAmount, } } - st, err := state_native.InitializeFromProtoAltair(ðpb.BeaconStateAltair{ - RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), - }) + var st state.BeaconState + var err error + switch vers { + case version.Altair: + st, err = state_native.InitializeFromProtoAltair(ðpb.BeaconStateAltair{ + RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), + }) + case version.Electra: + st, err = state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{ + RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), + }) + default: + t.Fatal("Unknown version") + } require.NoError(t, err) require.NoError(t, st.SetValidators(validators)) return st } type args struct { - state state.BeaconState - epoch primitives.Epoch + validatorCount uint64 + epoch primitives.Epoch } tests := []struct { name string @@ -48,32 +60,32 @@ func TestSyncCommitteeIndices_CanGet(t *testing.T) { { name: "genesis validator count, epoch 0", args: args{ - state: getState(t, params.BeaconConfig().MinGenesisActiveValidatorCount), - epoch: 0, + validatorCount: params.BeaconConfig().MinGenesisActiveValidatorCount, + epoch: 0, }, wantErr: false, }, { name: "genesis validator count, epoch 100", args: args{ - state: getState(t, params.BeaconConfig().MinGenesisActiveValidatorCount), - epoch: 100, + validatorCount: params.BeaconConfig().MinGenesisActiveValidatorCount, + epoch: 100, }, wantErr: false, }, { name: "less than optimal validator count, epoch 100", args: args{ - state: getState(t, params.BeaconConfig().MaxValidatorsPerCommittee), - epoch: 100, + validatorCount: params.BeaconConfig().MaxValidatorsPerCommittee, + epoch: 100, }, wantErr: false, }, { name: "no active validators, epoch 100", args: args{ - state: getState(t, 0), // Regression test for divide by zero. Issue #13051. - epoch: 100, + validatorCount: 0, // Regression test for divide by zero. Issue #13051. + epoch: 100, }, wantErr: true, errString: "no active validator indices", @@ -81,13 +93,18 @@ func TestSyncCommitteeIndices_CanGet(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - helpers.ClearCache() - got, err := altair.NextSyncCommitteeIndices(context.Background(), tt.args.state) - if tt.wantErr { - require.ErrorContains(t, tt.errString, err) - } else { - require.NoError(t, err) - require.Equal(t, int(params.BeaconConfig().SyncCommitteeSize), len(got)) + for _, v := range []int{version.Altair, version.Electra} { + t.Run(version.String(v), func(t *testing.T) { + helpers.ClearCache() + st := getState(t, tt.args.validatorCount, v) + got, err := altair.NextSyncCommitteeIndices(context.Background(), st) + if tt.wantErr { + require.ErrorContains(t, tt.errString, err) + } else { + require.NoError(t, err) + require.Equal(t, int(params.BeaconConfig().SyncCommitteeSize), len(got)) + } + }) } }) } From 657750b803abd79a8e256e9d66e9258ec6923595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Mon, 1 Jul 2024 19:18:45 +0200 Subject: [PATCH 168/325] validator/client: process Sync Committee roles separately (#13995) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * validator/client: process Sync Committee roles separately In a DV context, to be compatible with the proposed selection endpoint, the VC must push all partial selections to it instead of just one. Process sync committee role separately within the RolesAt method, so that partial selections can be pushed to the DV client appropriately, if configured. * testing/util: re-add erroneously deleted state_test.go * validator/client: fix tests * validator/client: always process sync committee validator Process sync committee duty at slot boundary as well. * don't fail if validator is marked as sync committee but it is not in the list ignore the duty and continue * address code review comments * fix build --------- Co-authored-by: Radosław Kapka --- validator/client/validator.go | 108 +++++++++++++++++++---------- validator/client/validator_test.go | 24 ++++--- 2 files changed, 88 insertions(+), 44 deletions(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index 00a94f30f378..447f8e919fa2 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -701,14 +701,22 @@ func (v *validator) subscribeToSubnets(ctx context.Context, duties *ethpb.Duties // RolesAt slot returns the validator roles at the given slot. Returns nil if the // validator is known to not have a roles at the slot. Returns UNKNOWN if the -// validator assignments are unknown. Otherwise returns a valid ValidatorRole map. +// validator assignments are unknown. Otherwise, returns a valid ValidatorRole map. func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fieldparams.BLSPubkeyLength]byte][]iface.ValidatorRole, error) { ctx, span := trace.StartSpan(ctx, "validator.RolesAt") defer span.End() v.dutiesLock.RLock() defer v.dutiesLock.RUnlock() - rolesAt := make(map[[fieldparams.BLSPubkeyLength]byte][]iface.ValidatorRole) + + var ( + rolesAt = make(map[[fieldparams.BLSPubkeyLength]byte][]iface.ValidatorRole) + + // store sync committee duties pubkeys and share indices in slices for + // potential DV processing + syncCommitteeValidators = make(map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte) + ) + for validator, duty := range v.duties.CurrentEpochDuties { var roles []iface.ValidatorRole @@ -723,6 +731,7 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie } } } + if duty.AttesterSlot == slot { roles = append(roles, iface.RoleAttester) @@ -751,15 +760,9 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie inSyncCommittee = true } } + if inSyncCommittee { - aggregator, err := v.isSyncCommitteeAggregator(ctx, slot, bytesutil.ToBytes48(duty.PublicKey), duty.ValidatorIndex) - if err != nil { - aggregator = false - log.WithError(err).Errorf("Could not check if validator %#x is an aggregator", bytesutil.Trunc(duty.PublicKey)) - } - if aggregator { - roles = append(roles, iface.RoleSyncCommitteeAggregator) - } + syncCommitteeValidators[duty.ValidatorIndex] = bytesutil.ToBytes48(duty.PublicKey) } if len(roles) == 0 { @@ -770,6 +773,32 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie copy(pubKey[:], duty.PublicKey) rolesAt[pubKey] = roles } + + aggregator, err := v.isSyncCommitteeAggregator( + ctx, + slot, + syncCommitteeValidators, + ) + + if err != nil { + log.WithError(err).Error("Could not check if any validator is a sync committee aggregator") + return rolesAt, nil + } + + for valIdx, isAgg := range aggregator { + if isAgg { + valPubkey, ok := syncCommitteeValidators[valIdx] + if !ok { + log. + WithField("pubkey", fmt.Sprintf("%#x", bytesutil.Trunc(valPubkey[:]))). + Warn("Validator is marked as sync committee aggregator but cannot be found in sync committee validator list") + continue + } + + rolesAt[bytesutil.ToBytes48(valPubkey[:])] = append(rolesAt[bytesutil.ToBytes48(valPubkey[:])], iface.RoleSyncCommitteeAggregator) + } + } + return rolesAt, nil } @@ -827,54 +856,61 @@ func (v *validator) isAggregator( // // modulo = max(1, SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT // TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE) // return bytes_to_uint64(hash(signature)[0:8]) % modulo == 0 -func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte, validatorIndex primitives.ValidatorIndex) (bool, error) { +func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitives.Slot, validators map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte) (map[primitives.ValidatorIndex]bool, error) { ctx, span := trace.StartSpan(ctx, "validator.isSyncCommitteeAggregator") defer span.End() - res, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ - PublicKey: pubKey[:], - Slot: slot, - }) - if err != nil { - return false, err - } + var ( + selections []iface.SyncCommitteeSelection + isAgg = make(map[primitives.ValidatorIndex]bool) + ) + + for valIdx, pubKey := range validators { + res, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + PublicKey: pubKey[:], + Slot: slot, + }) - var selections []iface.SyncCommitteeSelection - for _, index := range res.Indices { - subCommitteeSize := params.BeaconConfig().SyncCommitteeSize / params.BeaconConfig().SyncCommitteeSubnetCount - subnet := uint64(index) / subCommitteeSize - sig, err := v.signSyncSelectionData(ctx, pubKey, subnet, slot) if err != nil { - return false, err + return nil, errors.Wrap(err, "can't fetch sync subcommittee index") } - selections = append(selections, iface.SyncCommitteeSelection{ - SelectionProof: sig, - Slot: slot, - SubcommitteeIndex: primitives.CommitteeIndex(subnet), - ValidatorIndex: validatorIndex, - }) + for _, index := range res.Indices { + subCommitteeSize := params.BeaconConfig().SyncCommitteeSize / params.BeaconConfig().SyncCommitteeSubnetCount + subnet := uint64(index) / subCommitteeSize + sig, err := v.signSyncSelectionData(ctx, pubKey, subnet, slot) + if err != nil { + return nil, errors.Wrap(err, "can't sign selection data") + } + + selections = append(selections, iface.SyncCommitteeSelection{ + SelectionProof: sig, + Slot: slot, + SubcommitteeIndex: primitives.CommitteeIndex(subnet), + ValidatorIndex: valIdx, + }) + } } // Override selections with aggregated ones if the node is part of a Distributed Validator. if v.distributed && len(selections) > 0 { + var err error selections, err = v.validatorClient.AggregatedSyncSelections(ctx, selections) if err != nil { - return false, errors.Wrap(err, "failed to get aggregated sync selections") + return nil, errors.Wrap(err, "failed to get aggregated sync selections") } } for _, s := range selections { isAggregator, err := altair.IsSyncCommitteeAggregator(s.SelectionProof) if err != nil { - return false, err - } - if isAggregator { - return true, nil + return nil, errors.Wrap(err, "can't detect sync committee aggregator") } + + isAgg[s.ValidatorIndex] = isAggregator } - return false, nil + return isAgg, nil } // UpdateDomainDataCaches by making calls for all of the possible domain data. These can change when diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 88214ff28494..98b96d02db85 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -1263,9 +1263,11 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) { }, ).Return(ðpb.SyncSubcommitteeIndexResponse{}, nil /*err*/) - aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 0) + aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{ + 0: bytesutil.ToBytes48(pubKey), + }) require.NoError(t, err) - require.Equal(t, false, aggregator) + require.Equal(t, false, aggregator[0]) c := params.BeaconConfig().Copy() c.TargetAggregatorsPerSyncSubcommittee = math.MaxUint64 @@ -1284,9 +1286,11 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) { }, ).Return(ðpb.SyncSubcommitteeIndexResponse{Indices: []primitives.CommitteeIndex{0}}, nil /*err*/) - aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 0) + aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{ + 0: bytesutil.ToBytes48(pubKey), + }) require.NoError(t, err) - require.Equal(t, true, aggregator) + require.Equal(t, true, aggregator[0]) }) } } @@ -1310,9 +1314,11 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { }, ).Return(ðpb.SyncSubcommitteeIndexResponse{}, nil /*err*/) - aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 0) + aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{ + 0: bytesutil.ToBytes48(pubKey), + }) require.NoError(t, err) - require.Equal(t, false, aggregator) + require.Equal(t, false, aggregator[0]) c := params.BeaconConfig().Copy() c.TargetAggregatorsPerSyncSubcommittee = math.MaxUint64 @@ -1345,9 +1351,11 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { []iface.SyncCommitteeSelection{selection}, ).Return([]iface.SyncCommitteeSelection{selection}, nil) - aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 123) + aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{ + 123: bytesutil.ToBytes48(pubKey), + }) require.NoError(t, err) - require.Equal(t, true, aggregator) + require.Equal(t, true, aggregator[123]) }) } } From 2e6f1de29a5dc5921f452e39a1ffe421e9c3eea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 1 Jul 2024 20:40:33 +0200 Subject: [PATCH 169/325] EIP-7549: Aggregation gRPC metods (#14115) * impl * tests * generate mock * review feedback * gofmt --- beacon-chain/rpc/core/validator.go | 55 +- beacon-chain/rpc/eth/validator/handlers.go | 5 +- .../prysm/v1alpha1/validator/aggregator.go | 143 +- .../v1alpha1/validator/aggregator_test.go | 155 ++ proto/prysm/v1alpha1/attestation.go | 4 +- proto/prysm/v1alpha1/validator.pb.go | 1719 ++++++++++------- proto/prysm/v1alpha1/validator.pb.gw.go | 162 ++ proto/prysm/v1alpha1/validator.proto | 28 + testing/mock/beacon_validator_client_mock.go | 40 + testing/mock/beacon_validator_server_mock.go | 30 + 10 files changed, 1562 insertions(+), 779 deletions(-) diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 9a5663bbfcad..4ab23e317594 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -250,37 +250,64 @@ func (s *Service) SubmitSignedContributionAndProof( // SubmitSignedAggregateSelectionProof verifies given aggregate and proofs and publishes them on appropriate gossipsub topic. func (s *Service) SubmitSignedAggregateSelectionProof( ctx context.Context, - req *ethpb.SignedAggregateSubmitRequest, + agg ethpb.SignedAggregateAttAndProof, ) *RpcError { ctx, span := trace.StartSpan(ctx, "coreService.SubmitSignedAggregateSelectionProof") defer span.End() - if req.SignedAggregateAndProof == nil || req.SignedAggregateAndProof.Message == nil || - req.SignedAggregateAndProof.Message.Aggregate == nil || req.SignedAggregateAndProof.Message.Aggregate.Data == nil { + if agg == nil { + return &RpcError{Err: errors.New("signed aggregate request can't be nil"), Reason: BadRequest} + } + attAndProof := agg.AggregateAttestationAndProof() + if attAndProof == nil { + return &RpcError{Err: errors.New("signed aggregate request can't be nil"), Reason: BadRequest} + } + att := attAndProof.AggregateVal() + if att == nil { + return &RpcError{Err: errors.New("signed aggregate request can't be nil"), Reason: BadRequest} + } + data := att.GetData() + if data == nil { return &RpcError{Err: errors.New("signed aggregate request can't be nil"), Reason: BadRequest} } emptySig := make([]byte, fieldparams.BLSSignatureLength) - if bytes.Equal(req.SignedAggregateAndProof.Signature, emptySig) || - bytes.Equal(req.SignedAggregateAndProof.Message.SelectionProof, emptySig) { + if bytes.Equal(agg.GetSignature(), emptySig) || bytes.Equal(attAndProof.GetSelectionProof(), emptySig) { return &RpcError{Err: errors.New("signed signatures can't be zero hashes"), Reason: BadRequest} } // As a preventive measure, a beacon node shouldn't broadcast an attestation whose slot is out of range. - if err := helpers.ValidateAttestationTime(req.SignedAggregateAndProof.Message.Aggregate.Data.Slot, - s.GenesisTimeFetcher.GenesisTime(), params.BeaconConfig().MaximumGossipClockDisparityDuration()); err != nil { + if err := helpers.ValidateAttestationTime( + data.Slot, + s.GenesisTimeFetcher.GenesisTime(), + params.BeaconConfig().MaximumGossipClockDisparityDuration(), + ); err != nil { return &RpcError{Err: errors.New("attestation slot is no longer valid from current time"), Reason: BadRequest} } - if err := s.Broadcaster.Broadcast(ctx, req.SignedAggregateAndProof); err != nil { + if err := s.Broadcaster.Broadcast(ctx, agg); err != nil { return &RpcError{Err: &AggregateBroadcastFailedError{err: err}, Reason: Internal} } - log.WithFields(logrus.Fields{ - "slot": req.SignedAggregateAndProof.Message.Aggregate.Data.Slot, - "committeeIndex": req.SignedAggregateAndProof.Message.Aggregate.Data.CommitteeIndex, - "validatorIndex": req.SignedAggregateAndProof.Message.AggregatorIndex, - "aggregatedCount": req.SignedAggregateAndProof.Message.Aggregate.AggregationBits.Count(), - }).Debug("Broadcasting aggregated attestation and proof") + if logrus.GetLevel() >= logrus.DebugLevel { + var fields logrus.Fields + if agg.Version() >= version.Electra { + fields = logrus.Fields{ + "slot": data.Slot, + "committeeCount": att.CommitteeBitsVal().Count(), + "committeeIndices": att.CommitteeBitsVal().BitIndices(), + "validatorIndex": attAndProof.GetAggregatorIndex(), + "aggregatedCount": att.GetAggregationBits().Count(), + } + } else { + fields = logrus.Fields{ + "slot": data.Slot, + "committeeIndex": data.CommitteeIndex, + "validatorIndex": attAndProof.GetAggregatorIndex(), + "aggregatedCount": att.GetAggregationBits().Count(), + } + } + log.WithFields(fields).Debug("Broadcasting aggregated attestation and proof") + } return nil } diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 639c1aa79129..c214697b3eed 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -173,10 +173,7 @@ func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request httputil.HandleError(w, "Could not convert request aggregate to consensus aggregate: "+err.Error(), http.StatusBadRequest) return } - rpcError := s.CoreService.SubmitSignedAggregateSelectionProof( - ctx, - ðpbalpha.SignedAggregateSubmitRequest{SignedAggregateAndProof: consensusItem}, - ) + rpcError := s.CoreService.SubmitSignedAggregateSelectionProof(ctx, consensusItem) if rpcError != nil { _, ok := rpcError.Err.(*core.AggregateBroadcastFailedError) if ok { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index 522c6fc32f2d..4376d0cab058 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -26,7 +27,8 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. return nil, status.Errorf(codes.Unavailable, "Syncing to latest head, not ready to respond") } - // An optimistic validator MUST NOT participate in attestation. (i.e., sign across the DOMAIN_BEACON_ATTESTER, DOMAIN_SELECTION_PROOF or DOMAIN_AGGREGATE_AND_PROOF domains). + // An optimistic validator MUST NOT participate in attestation + // (i.e., sign across the DOMAIN_BEACON_ATTESTER, DOMAIN_SELECTION_PROOF or DOMAIN_AGGREGATE_AND_PROOF domains). if err := vs.optimisticStatus(ctx); err != nil { return nil, err } @@ -64,11 +66,11 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. return nil, status.Errorf(codes.InvalidArgument, "Validator is not an aggregator") } - aggregatedAtts := vs.AttPool.AggregatedAttestationsBySlotIndex(ctx, req.Slot, req.CommitteeIndex) + atts := vs.AttPool.AggregatedAttestationsBySlotIndex(ctx, req.Slot, req.CommitteeIndex) // Filter out the best aggregated attestation (ie. the one with the most aggregated bits). - if len(aggregatedAtts) == 0 { - aggregatedAtts = vs.AttPool.UnaggregatedAttestationsBySlotIndex(ctx, req.Slot, req.CommitteeIndex) - if len(aggregatedAtts) == 0 { + if len(atts) == 0 { + atts = vs.AttPool.UnaggregatedAttestationsBySlotIndex(ctx, req.Slot, req.CommitteeIndex) + if len(atts) == 0 { return nil, status.Errorf(codes.NotFound, "Could not find attestation for slot and committee in pool") } } @@ -80,31 +82,91 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. } } - best := aggregatedAtts[0] - for _, aggregatedAtt := range aggregatedAtts[1:] { - // The aggregator should prefer an attestation that they have signed. We check this by - // looking at the attestation's committee index against the validator's committee index - // and check the aggregate bits to ensure the validator's index is set. - if aggregatedAtt.GetData().CommitteeIndex == req.CommitteeIndex && - aggregatedAtt.GetAggregationBits().BitAt(indexInCommittee) && - (!best.GetAggregationBits().BitAt(indexInCommittee) || - aggregatedAtt.GetAggregationBits().Count() > best.GetAggregationBits().Count()) { - best = aggregatedAtt + best := bestAggregate(atts, req.CommitteeIndex, indexInCommittee) + attAndProof := ðpb.AggregateAttestationAndProof{ + Aggregate: best, + SelectionProof: req.SlotSignature, + AggregatorIndex: validatorIndex, + } + return ðpb.AggregateSelectionResponse{AggregateAndProof: attAndProof}, nil +} + +// SubmitAggregateSelectionProofElectra is called by a validator when its assigned to be an aggregator. +// The aggregator submits the selection proof to obtain the aggregated attestation +// object to sign over. +func (vs *Server) SubmitAggregateSelectionProofElectra( + ctx context.Context, + req *ethpb.AggregateSelectionRequest, +) (*ethpb.AggregateSelectionElectraResponse, error) { + ctx, span := trace.StartSpan(ctx, "AggregatorServer.SubmitAggregateSelectionProofElectra") + defer span.End() + span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) + + if vs.SyncChecker.Syncing() { + return nil, status.Errorf(codes.Unavailable, "Syncing to latest head, not ready to respond") + } + + // An optimistic validator MUST NOT participate in attestation + // (i.e., sign across the DOMAIN_BEACON_ATTESTER, DOMAIN_SELECTION_PROOF or DOMAIN_AGGREGATE_AND_PROOF domains). + if err := vs.optimisticStatus(ctx); err != nil { + return nil, err + } + + st, err := vs.HeadFetcher.HeadStateReadOnly(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not determine head state: %v", err) + } + + validatorIndex, exists := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(req.PublicKey)) + if !exists { + return nil, status.Error(codes.Internal, "Could not locate validator index in DB") + } + + epoch := slots.ToEpoch(req.Slot) + activeValidatorIndices, err := helpers.ActiveValidatorIndices(ctx, st, epoch) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not get validators: %v", err) + } + seed, err := helpers.Seed(st, epoch, params.BeaconConfig().DomainBeaconAttester) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not get seed: %v", err) + } + committee, err := helpers.BeaconCommittee(ctx, activeValidatorIndices, seed, req.Slot, req.CommitteeIndex) + if err != nil { + return nil, err + } + + // Check if the validator is an aggregator + isAggregator, err := helpers.IsAggregator(uint64(len(committee)), req.SlotSignature) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not get aggregator status: %v", err) + } + if !isAggregator { + return nil, status.Errorf(codes.InvalidArgument, "Validator is not an aggregator") + } + + atts := vs.AttPool.AggregatedAttestationsBySlotIndexElectra(ctx, req.Slot, req.CommitteeIndex) + if len(atts) == 0 { + atts = vs.AttPool.UnaggregatedAttestationsBySlotIndexElectra(ctx, req.Slot, req.CommitteeIndex) + if len(atts) == 0 { + return nil, status.Errorf(codes.NotFound, "No attestations found in pool") } + } - // If the "best" still doesn't contain the validator's index, check the aggregation bits to - // choose the attestation with the most bits set. - if !best.GetAggregationBits().BitAt(indexInCommittee) && - aggregatedAtt.GetAggregationBits().Count() > best.GetAggregationBits().Count() { - best = aggregatedAtt + var indexInCommittee uint64 + for i, idx := range committee { + if idx == validatorIndex { + indexInCommittee = uint64(i) } } - a := ðpb.AggregateAttestationAndProof{ + + best := bestAggregate(atts, req.CommitteeIndex, indexInCommittee) + attAndProof := ðpb.AggregateAttestationAndProofElectra{ Aggregate: best, SelectionProof: req.SlotSignature, AggregatorIndex: validatorIndex, } - return ðpb.AggregateSelectionResponse{AggregateAndProof: a}, nil + return ðpb.AggregateSelectionElectraResponse{AggregateAndProof: attAndProof}, nil } // SubmitSignedAggregateSelectionProof is called by a validator to broadcast a signed @@ -113,8 +175,43 @@ func (vs *Server) SubmitSignedAggregateSelectionProof( ctx context.Context, req *ethpb.SignedAggregateSubmitRequest, ) (*ethpb.SignedAggregateSubmitResponse, error) { - if err := vs.CoreService.SubmitSignedAggregateSelectionProof(ctx, req); err != nil { + if err := vs.CoreService.SubmitSignedAggregateSelectionProof(ctx, req.SignedAggregateAndProof); err != nil { return nil, status.Errorf(core.ErrorReasonToGRPC(err.Reason), "Could not submit aggregate: %v", err.Err) } return ðpb.SignedAggregateSubmitResponse{}, nil } + +// SubmitSignedAggregateSelectionProofElectra is called by a validator to broadcast a signed +// aggregated and proof object. +func (vs *Server) SubmitSignedAggregateSelectionProofElectra( + ctx context.Context, + req *ethpb.SignedAggregateSubmitElectraRequest, +) (*ethpb.SignedAggregateSubmitResponse, error) { + if err := vs.CoreService.SubmitSignedAggregateSelectionProof(ctx, req.SignedAggregateAndProof); err != nil { + return nil, status.Errorf(core.ErrorReasonToGRPC(err.Reason), "Could not submit aggregate: %v", err.Err) + } + return ðpb.SignedAggregateSubmitResponse{}, nil +} + +func bestAggregate[T ethpb.Att](atts []T, committeeIndex primitives.CommitteeIndex, indexInCommittee uint64) T { + best := atts[0] + for _, a := range atts[1:] { + // The aggregator should prefer an attestation that they have signed. We check this by + // looking at the attestation's committee index against the validator's committee index + // and check the aggregate bits to ensure the validator's index is set. + if a.CommitteeBitsVal().BitAt(uint64(committeeIndex)) && + a.GetAggregationBits().BitAt(indexInCommittee) && + (!best.GetAggregationBits().BitAt(indexInCommittee) || + a.GetAggregationBits().Count() > best.GetAggregationBits().Count()) { + best = a + } + + // If the "best" still doesn't contain the validator's index, check the aggregation bits to + // choose the attestation with the most bits set. + if !best.GetAggregationBits().BitAt(indexInCommittee) && + a.GetAggregationBits().Count() > best.GetAggregationBits().Count() { + best = a + } + } + return best +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go index 59f2ad7bd799..16f973c3e40c 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go @@ -451,3 +451,158 @@ func TestSubmitSignedAggregateSelectionProof_InvalidSlot(t *testing.T) { _, err := aggregatorServer.SubmitSignedAggregateSelectionProof(context.Background(), req) require.ErrorContains(t, "attestation slot is no longer valid from current time", err) } + +func TestSubmitSignedAggregateSelectionProofElectra_ZeroHashesSignatures(t *testing.T) { + aggregatorServer := &Server{ + TimeFetcher: &mock.ChainService{Genesis: time.Now()}, + } + req := ðpb.SignedAggregateSubmitElectraRequest{ + SignedAggregateAndProof: ðpb.SignedAggregateAttestationAndProofElectra{ + Signature: make([]byte, fieldparams.BLSSignatureLength), + Message: ðpb.AggregateAttestationAndProofElectra{ + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{}, + }, + }, + }, + } + _, err := aggregatorServer.SubmitSignedAggregateSelectionProofElectra(context.Background(), req) + require.ErrorContains(t, "signed signatures can't be zero hashes", err) + + req = ðpb.SignedAggregateSubmitElectraRequest{ + SignedAggregateAndProof: ðpb.SignedAggregateAttestationAndProofElectra{ + Signature: []byte{'a'}, + Message: ðpb.AggregateAttestationAndProofElectra{ + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{}, + }, + SelectionProof: make([]byte, fieldparams.BLSSignatureLength), + }, + }, + } + _, err = aggregatorServer.SubmitSignedAggregateSelectionProofElectra(context.Background(), req) + require.ErrorContains(t, "signed signatures can't be zero hashes", err) +} + +func TestSubmitSignedAggregateSelectionProofElectra_InvalidSlot(t *testing.T) { + c := &mock.ChainService{Genesis: time.Now()} + aggregatorServer := &Server{ + CoreService: &core.Service{ + GenesisTimeFetcher: c, + }, + } + req := ðpb.SignedAggregateSubmitElectraRequest{ + SignedAggregateAndProof: ðpb.SignedAggregateAttestationAndProofElectra{ + Signature: []byte{'a'}, + Message: ðpb.AggregateAttestationAndProofElectra{ + SelectionProof: []byte{'a'}, + Aggregate: ðpb.AttestationElectra{ + Data: ðpb.AttestationData{Slot: 1000}, + }, + }, + }, + } + _, err := aggregatorServer.SubmitSignedAggregateSelectionProofElectra(context.Background(), req) + require.ErrorContains(t, "attestation slot is no longer valid from current time", err) +} + +func Test_bestAggregate(t *testing.T) { + type testCase struct { + name string + atts []*ethpb.Attestation + best *ethpb.Attestation + } + + var testCases []testCase + + tc := testCase{ + name: "single attestation", + atts: []*ethpb.Attestation{{}}, + } + tc.best = tc.atts[0] + testCases = append(testCases, tc) + + tc = testCase{ + name: "choose attestation with most aggregation bits", + atts: []*ethpb.Attestation{ + { + AggregationBits: bitfield.Bitlist{0b10001}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b11111}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b10101}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + }, + } + tc.best = tc.atts[1] + testCases = append(testCases, tc) + + tc = testCase{ + name: "do not choose attestation with other committee index", + atts: []*ethpb.Attestation{ + { + AggregationBits: bitfield.Bitlist{0b10001}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b11111}, + Data: ðpb.AttestationData{CommitteeIndex: 1}, + }, + { + AggregationBits: bitfield.Bitlist{0b10101}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + }, + } + tc.best = tc.atts[2] + testCases = append(testCases, tc) + + tc = testCase{ + name: "do not choose attestation with other index in committee", + atts: []*ethpb.Attestation{ + { + AggregationBits: bitfield.Bitlist{0b10001}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b11110}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b10101}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + }, + } + tc.best = tc.atts[2] + testCases = append(testCases, tc) + + tc = testCase{ + name: "no attestation with correct index in committee - choose max att bits", + atts: []*ethpb.Attestation{ + { + AggregationBits: bitfield.Bitlist{0b11000}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b11110}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + { + AggregationBits: bitfield.Bitlist{0b10110}, + Data: ðpb.AttestationData{CommitteeIndex: 0}, + }, + }, + } + tc.best = tc.atts[1] + testCases = append(testCases, tc) + + for _, tc := range testCases { + assert.Equal(t, tc.best, bestAggregate(tc.atts, 0, 0), tc.name) + } +} diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index ee5cfb98ef7f..92b7f146ddef 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -80,7 +80,9 @@ func (a *Attestation) Copy() Att { // CommitteeBitsVal -- func (a *Attestation) CommitteeBitsVal() bitfield.Bitfield { - return nil + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(uint64(a.Data.CommitteeIndex), true) + return cb } // Version -- diff --git a/proto/prysm/v1alpha1/validator.pb.go b/proto/prysm/v1alpha1/validator.pb.go index c88f93a09fd0..db4f82bdcd41 100755 --- a/proto/prysm/v1alpha1/validator.pb.go +++ b/proto/prysm/v1alpha1/validator.pb.go @@ -1650,6 +1650,53 @@ func (x *AggregateSelectionResponse) GetAggregateAndProof() *AggregateAttestatio return nil } +type AggregateSelectionElectraResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AggregateAndProof *AggregateAttestationAndProofElectra `protobuf:"bytes,1,opt,name=aggregate_and_proof,json=aggregateAndProof,proto3" json:"aggregate_and_proof,omitempty"` +} + +func (x *AggregateSelectionElectraResponse) Reset() { + *x = AggregateSelectionElectraResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregateSelectionElectraResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregateSelectionElectraResponse) ProtoMessage() {} + +func (x *AggregateSelectionElectraResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregateSelectionElectraResponse.ProtoReflect.Descriptor instead. +func (*AggregateSelectionElectraResponse) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{27} +} + +func (x *AggregateSelectionElectraResponse) GetAggregateAndProof() *AggregateAttestationAndProofElectra { + if x != nil { + return x.AggregateAndProof + } + return nil +} + type SignedAggregateSubmitRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1661,7 +1708,7 @@ type SignedAggregateSubmitRequest struct { func (x *SignedAggregateSubmitRequest) Reset() { *x = SignedAggregateSubmitRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[27] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1674,7 +1721,7 @@ func (x *SignedAggregateSubmitRequest) String() string { func (*SignedAggregateSubmitRequest) ProtoMessage() {} func (x *SignedAggregateSubmitRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[27] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1687,7 +1734,7 @@ func (x *SignedAggregateSubmitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedAggregateSubmitRequest.ProtoReflect.Descriptor instead. func (*SignedAggregateSubmitRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{27} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{28} } func (x *SignedAggregateSubmitRequest) GetSignedAggregateAndProof() *SignedAggregateAttestationAndProof { @@ -1697,6 +1744,53 @@ func (x *SignedAggregateSubmitRequest) GetSignedAggregateAndProof() *SignedAggre return nil } +type SignedAggregateSubmitElectraRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignedAggregateAndProof *SignedAggregateAttestationAndProofElectra `protobuf:"bytes,1,opt,name=signed_aggregate_and_proof,json=signedAggregateAndProof,proto3" json:"signed_aggregate_and_proof,omitempty"` +} + +func (x *SignedAggregateSubmitElectraRequest) Reset() { + *x = SignedAggregateSubmitElectraRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedAggregateSubmitElectraRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedAggregateSubmitElectraRequest) ProtoMessage() {} + +func (x *SignedAggregateSubmitElectraRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedAggregateSubmitElectraRequest.ProtoReflect.Descriptor instead. +func (*SignedAggregateSubmitElectraRequest) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{29} +} + +func (x *SignedAggregateSubmitElectraRequest) GetSignedAggregateAndProof() *SignedAggregateAttestationAndProofElectra { + if x != nil { + return x.SignedAggregateAndProof + } + return nil +} + type SignedAggregateSubmitResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1708,7 +1802,7 @@ type SignedAggregateSubmitResponse struct { func (x *SignedAggregateSubmitResponse) Reset() { *x = SignedAggregateSubmitResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[28] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1721,7 +1815,7 @@ func (x *SignedAggregateSubmitResponse) String() string { func (*SignedAggregateSubmitResponse) ProtoMessage() {} func (x *SignedAggregateSubmitResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[28] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1734,7 +1828,7 @@ func (x *SignedAggregateSubmitResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedAggregateSubmitResponse.ProtoReflect.Descriptor instead. func (*SignedAggregateSubmitResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{28} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{30} } func (x *SignedAggregateSubmitResponse) GetAttestationDataRoot() []byte { @@ -1757,7 +1851,7 @@ type CommitteeSubnetsSubscribeRequest struct { func (x *CommitteeSubnetsSubscribeRequest) Reset() { *x = CommitteeSubnetsSubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[29] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1770,7 +1864,7 @@ func (x *CommitteeSubnetsSubscribeRequest) String() string { func (*CommitteeSubnetsSubscribeRequest) ProtoMessage() {} func (x *CommitteeSubnetsSubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[29] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1783,7 +1877,7 @@ func (x *CommitteeSubnetsSubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CommitteeSubnetsSubscribeRequest.ProtoReflect.Descriptor instead. func (*CommitteeSubnetsSubscribeRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{29} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{31} } func (x *CommitteeSubnetsSubscribeRequest) GetSlots() []github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -1825,7 +1919,7 @@ type Validator struct { func (x *Validator) Reset() { *x = Validator{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[30] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1838,7 +1932,7 @@ func (x *Validator) String() string { func (*Validator) ProtoMessage() {} func (x *Validator) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[30] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1851,7 +1945,7 @@ func (x *Validator) ProtoReflect() protoreflect.Message { // Deprecated: Use Validator.ProtoReflect.Descriptor instead. func (*Validator) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{30} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{32} } func (x *Validator) GetPublicKey() []byte { @@ -1933,7 +2027,7 @@ type ValidatorParticipation struct { func (x *ValidatorParticipation) Reset() { *x = ValidatorParticipation{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[31] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1946,7 +2040,7 @@ func (x *ValidatorParticipation) String() string { func (*ValidatorParticipation) ProtoMessage() {} func (x *ValidatorParticipation) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[31] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1959,7 +2053,7 @@ func (x *ValidatorParticipation) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorParticipation.ProtoReflect.Descriptor instead. func (*ValidatorParticipation) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{31} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{33} } // Deprecated: Marked as deprecated in proto/prysm/v1alpha1/validator.proto. @@ -2052,7 +2146,7 @@ type ValidatorInfo struct { func (x *ValidatorInfo) Reset() { *x = ValidatorInfo{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[32] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2065,7 +2159,7 @@ func (x *ValidatorInfo) String() string { func (*ValidatorInfo) ProtoMessage() {} func (x *ValidatorInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[32] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2078,7 +2172,7 @@ func (x *ValidatorInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorInfo.ProtoReflect.Descriptor instead. func (*ValidatorInfo) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{32} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{34} } func (x *ValidatorInfo) GetPublicKey() []byte { @@ -2141,7 +2235,7 @@ type DoppelGangerRequest struct { func (x *DoppelGangerRequest) Reset() { *x = DoppelGangerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[33] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2154,7 +2248,7 @@ func (x *DoppelGangerRequest) String() string { func (*DoppelGangerRequest) ProtoMessage() {} func (x *DoppelGangerRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[33] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2167,7 +2261,7 @@ func (x *DoppelGangerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DoppelGangerRequest.ProtoReflect.Descriptor instead. func (*DoppelGangerRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{33} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{35} } func (x *DoppelGangerRequest) GetValidatorRequests() []*DoppelGangerRequest_ValidatorRequest { @@ -2188,7 +2282,7 @@ type DoppelGangerResponse struct { func (x *DoppelGangerResponse) Reset() { *x = DoppelGangerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[34] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2201,7 +2295,7 @@ func (x *DoppelGangerResponse) String() string { func (*DoppelGangerResponse) ProtoMessage() {} func (x *DoppelGangerResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[34] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2214,7 +2308,7 @@ func (x *DoppelGangerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DoppelGangerResponse.ProtoReflect.Descriptor instead. func (*DoppelGangerResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{34} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{36} } func (x *DoppelGangerResponse) GetResponses() []*DoppelGangerResponse_ValidatorResponse { @@ -2236,7 +2330,7 @@ type StreamSlotsRequest struct { func (x *StreamSlotsRequest) Reset() { *x = StreamSlotsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[35] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2249,7 +2343,7 @@ func (x *StreamSlotsRequest) String() string { func (*StreamSlotsRequest) ProtoMessage() {} func (x *StreamSlotsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[35] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2262,7 +2356,7 @@ func (x *StreamSlotsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamSlotsRequest.ProtoReflect.Descriptor instead. func (*StreamSlotsRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{35} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{37} } func (x *StreamSlotsRequest) GetVerifiedOnly() bool { @@ -2284,7 +2378,7 @@ type StreamBlocksRequest struct { func (x *StreamBlocksRequest) Reset() { *x = StreamBlocksRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[36] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2297,7 +2391,7 @@ func (x *StreamBlocksRequest) String() string { func (*StreamBlocksRequest) ProtoMessage() {} func (x *StreamBlocksRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[36] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2310,7 +2404,7 @@ func (x *StreamBlocksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamBlocksRequest.ProtoReflect.Descriptor instead. func (*StreamBlocksRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{36} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{38} } func (x *StreamBlocksRequest) GetVerifiedOnly() bool { @@ -2331,7 +2425,7 @@ type PrepareBeaconProposerRequest struct { func (x *PrepareBeaconProposerRequest) Reset() { *x = PrepareBeaconProposerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[37] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2344,7 +2438,7 @@ func (x *PrepareBeaconProposerRequest) String() string { func (*PrepareBeaconProposerRequest) ProtoMessage() {} func (x *PrepareBeaconProposerRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[37] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2357,7 +2451,7 @@ func (x *PrepareBeaconProposerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PrepareBeaconProposerRequest.ProtoReflect.Descriptor instead. func (*PrepareBeaconProposerRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{37} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{39} } func (x *PrepareBeaconProposerRequest) GetRecipients() []*PrepareBeaconProposerRequest_FeeRecipientContainer { @@ -2378,7 +2472,7 @@ type FeeRecipientByPubKeyRequest struct { func (x *FeeRecipientByPubKeyRequest) Reset() { *x = FeeRecipientByPubKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[38] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2391,7 +2485,7 @@ func (x *FeeRecipientByPubKeyRequest) String() string { func (*FeeRecipientByPubKeyRequest) ProtoMessage() {} func (x *FeeRecipientByPubKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[38] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2404,7 +2498,7 @@ func (x *FeeRecipientByPubKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FeeRecipientByPubKeyRequest.ProtoReflect.Descriptor instead. func (*FeeRecipientByPubKeyRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{38} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{40} } func (x *FeeRecipientByPubKeyRequest) GetPublicKey() []byte { @@ -2425,7 +2519,7 @@ type FeeRecipientByPubKeyResponse struct { func (x *FeeRecipientByPubKeyResponse) Reset() { *x = FeeRecipientByPubKeyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[39] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2438,7 +2532,7 @@ func (x *FeeRecipientByPubKeyResponse) String() string { func (*FeeRecipientByPubKeyResponse) ProtoMessage() {} func (x *FeeRecipientByPubKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[39] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2451,7 +2545,7 @@ func (x *FeeRecipientByPubKeyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FeeRecipientByPubKeyResponse.ProtoReflect.Descriptor instead. func (*FeeRecipientByPubKeyResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{39} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{41} } func (x *FeeRecipientByPubKeyResponse) GetFeeRecipient() []byte { @@ -2473,7 +2567,7 @@ type AssignValidatorToSubnetRequest struct { func (x *AssignValidatorToSubnetRequest) Reset() { *x = AssignValidatorToSubnetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[40] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2486,7 +2580,7 @@ func (x *AssignValidatorToSubnetRequest) String() string { func (*AssignValidatorToSubnetRequest) ProtoMessage() {} func (x *AssignValidatorToSubnetRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[40] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2499,7 +2593,7 @@ func (x *AssignValidatorToSubnetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AssignValidatorToSubnetRequest.ProtoReflect.Descriptor instead. func (*AssignValidatorToSubnetRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{40} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{42} } func (x *AssignValidatorToSubnetRequest) GetPublicKey() []byte { @@ -2530,7 +2624,7 @@ type AggregatedSigAndAggregationBitsRequest struct { func (x *AggregatedSigAndAggregationBitsRequest) Reset() { *x = AggregatedSigAndAggregationBitsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[41] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2543,7 +2637,7 @@ func (x *AggregatedSigAndAggregationBitsRequest) String() string { func (*AggregatedSigAndAggregationBitsRequest) ProtoMessage() {} func (x *AggregatedSigAndAggregationBitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[41] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2556,7 +2650,7 @@ func (x *AggregatedSigAndAggregationBitsRequest) ProtoReflect() protoreflect.Mes // Deprecated: Use AggregatedSigAndAggregationBitsRequest.ProtoReflect.Descriptor instead. func (*AggregatedSigAndAggregationBitsRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{41} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{43} } func (x *AggregatedSigAndAggregationBitsRequest) GetMsgs() []*SyncCommitteeMessage { @@ -2599,7 +2693,7 @@ type AggregatedSigAndAggregationBitsResponse struct { func (x *AggregatedSigAndAggregationBitsResponse) Reset() { *x = AggregatedSigAndAggregationBitsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[42] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2612,7 +2706,7 @@ func (x *AggregatedSigAndAggregationBitsResponse) String() string { func (*AggregatedSigAndAggregationBitsResponse) ProtoMessage() {} func (x *AggregatedSigAndAggregationBitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[42] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2625,7 +2719,7 @@ func (x *AggregatedSigAndAggregationBitsResponse) ProtoReflect() protoreflect.Me // Deprecated: Use AggregatedSigAndAggregationBitsResponse.ProtoReflect.Descriptor instead. func (*AggregatedSigAndAggregationBitsResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{42} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{44} } func (x *AggregatedSigAndAggregationBitsResponse) GetAggregatedSig() []byte { @@ -2655,7 +2749,7 @@ type ValidatorActivationResponse_Status struct { func (x *ValidatorActivationResponse_Status) Reset() { *x = ValidatorActivationResponse_Status{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[43] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2668,7 +2762,7 @@ func (x *ValidatorActivationResponse_Status) String() string { func (*ValidatorActivationResponse_Status) ProtoMessage() {} func (x *ValidatorActivationResponse_Status) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[43] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2724,7 +2818,7 @@ type DutiesResponse_Duty struct { func (x *DutiesResponse_Duty) Reset() { *x = DutiesResponse_Duty{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[44] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2737,7 +2831,7 @@ func (x *DutiesResponse_Duty) String() string { func (*DutiesResponse_Duty) ProtoMessage() {} func (x *DutiesResponse_Duty) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[44] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2829,7 +2923,7 @@ type DoppelGangerRequest_ValidatorRequest struct { func (x *DoppelGangerRequest_ValidatorRequest) Reset() { *x = DoppelGangerRequest_ValidatorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[45] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2842,7 +2936,7 @@ func (x *DoppelGangerRequest_ValidatorRequest) String() string { func (*DoppelGangerRequest_ValidatorRequest) ProtoMessage() {} func (x *DoppelGangerRequest_ValidatorRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[45] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2855,7 +2949,7 @@ func (x *DoppelGangerRequest_ValidatorRequest) ProtoReflect() protoreflect.Messa // Deprecated: Use DoppelGangerRequest_ValidatorRequest.ProtoReflect.Descriptor instead. func (*DoppelGangerRequest_ValidatorRequest) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{33, 0} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{35, 0} } func (x *DoppelGangerRequest_ValidatorRequest) GetPublicKey() []byte { @@ -2891,7 +2985,7 @@ type DoppelGangerResponse_ValidatorResponse struct { func (x *DoppelGangerResponse_ValidatorResponse) Reset() { *x = DoppelGangerResponse_ValidatorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[46] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2904,7 +2998,7 @@ func (x *DoppelGangerResponse_ValidatorResponse) String() string { func (*DoppelGangerResponse_ValidatorResponse) ProtoMessage() {} func (x *DoppelGangerResponse_ValidatorResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[46] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2917,7 +3011,7 @@ func (x *DoppelGangerResponse_ValidatorResponse) ProtoReflect() protoreflect.Mes // Deprecated: Use DoppelGangerResponse_ValidatorResponse.ProtoReflect.Descriptor instead. func (*DoppelGangerResponse_ValidatorResponse) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{34, 0} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{36, 0} } func (x *DoppelGangerResponse_ValidatorResponse) GetPublicKey() []byte { @@ -2946,7 +3040,7 @@ type PrepareBeaconProposerRequest_FeeRecipientContainer struct { func (x *PrepareBeaconProposerRequest_FeeRecipientContainer) Reset() { *x = PrepareBeaconProposerRequest_FeeRecipientContainer{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[47] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2959,7 +3053,7 @@ func (x *PrepareBeaconProposerRequest_FeeRecipientContainer) String() string { func (*PrepareBeaconProposerRequest_FeeRecipientContainer) ProtoMessage() {} func (x *PrepareBeaconProposerRequest_FeeRecipientContainer) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[47] + mi := &file_proto_prysm_v1alpha1_validator_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2972,7 +3066,7 @@ func (x *PrepareBeaconProposerRequest_FeeRecipientContainer) ProtoReflect() prot // Deprecated: Use PrepareBeaconProposerRequest_FeeRecipientContainer.ProtoReflect.Descriptor instead. func (*PrepareBeaconProposerRequest_FeeRecipientContainer) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{37, 0} + return file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP(), []int{39, 0} } func (x *PrepareBeaconProposerRequest_FeeRecipientContainer) GetFeeRecipient() []byte { @@ -3355,567 +3449,612 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{ 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x11, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x22, 0x96, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x76, 0x0a, 0x1a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x52, 0x17, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x5b, 0x0a, 0x1d, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x15, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x02, 0x0a, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x05, 0x73, - 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, - 0x74, 0x52, 0x05, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x74, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, - 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x64, 0x73, 0x12, 0x23, - 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x22, 0x9e, 0x05, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, - 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, - 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x88, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x71, 0x0a, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, - 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x65, 0x0a, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x09, 0x65, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x75, 0x0a, - 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x22, 0x8e, 0x05, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x3e, 0x0a, 0x19, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x02, 0x42, 0x02, 0x18, 0x01, 0x52, 0x17, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, - 0x23, 0x0a, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x0e, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, - 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, - 0x52, 0x0d, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x45, 0x74, 0x68, 0x65, 0x72, 0x12, - 0x39, 0x0a, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x3f, 0x0a, 0x1c, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x4c, 0x0a, 0x23, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, - 0x65, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x3b, 0x0a, 0x1a, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x41, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x4e, 0x0a, 0x24, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, - 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x12, 0x4a, 0x0a, 0x22, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, - 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x47, 0x77, 0x65, 0x69, 0x22, 0xad, 0x03, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5c, 0x0a, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, - 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, - 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, 0x65, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xce, 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, - 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, - 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0xca, 0x01, 0x0a, 0x10, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, - 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, - 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, - 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, - 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x22, 0x8f, 0x01, 0x0a, 0x21, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x13, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, + 0x11, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x22, 0x96, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x76, 0x0a, 0x1a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x17, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xa4, 0x01, 0x0a, 0x23, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x7d, 0x0a, 0x1a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x17, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x22, 0x5b, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x15, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0x9a, 0x02, 0x0a, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, + 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x05, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x05, 0x73, 0x6c, 0x6f, 0x74, + 0x73, 0x12, 0x74, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x49, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0c, + 0x69, 0x73, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x9e, 0x05, 0x0a, + 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, + 0x64, 0x12, 0x88, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x69, 0x67, + 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x71, 0x0a, 0x10, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0f, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x65, 0x0a, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x09, 0x65, 0x78, 0x69, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x75, 0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x8e, 0x05, + 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x19, 0x67, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x42, 0x02, 0x18, 0x01, 0x52, + 0x17, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0b, 0x76, 0x6f, 0x74, 0x65, + 0x64, 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, + 0x01, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x45, 0x74, 0x68, 0x65, 0x72, 0x12, 0x29, 0x0a, + 0x0e, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0d, 0x65, 0x6c, 0x69, 0x67, 0x69, + 0x62, 0x6c, 0x65, 0x45, 0x74, 0x68, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x19, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, + 0x77, 0x65, 0x69, 0x12, 0x3f, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, + 0x77, 0x65, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x47, 0x77, 0x65, 0x69, 0x12, 0x4c, 0x0a, 0x23, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x1f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, + 0x65, 0x69, 0x12, 0x3b, 0x0a, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, + 0x41, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, + 0x65, 0x69, 0x12, 0x4e, 0x0a, 0x24, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, + 0x65, 0x69, 0x12, 0x4a, 0x0a, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1e, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x77, 0x65, 0x69, 0x22, 0xad, + 0x03, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, + 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x27, 0x0a, - 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x70, 0x70, 0x65, - 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xce, + 0x02, 0x0a, 0x13, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, - 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x6f, 0x0a, 0x11, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x1a, 0xca, 0x01, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, + 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0xe4, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x6f, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x64, + 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x3d, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, + 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, + 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xca, 0x02, 0x0a, 0x1c, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x69, 0x0a, 0x0a, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x1a, 0xbe, 0x01, 0x0a, 0x15, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x66, + 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x22, 0x4e, 0x0a, 0x1b, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x75, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x3d, 0x0a, - 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, - 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3e, 0x0a, 0x13, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, - 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xca, 0x02, 0x0a, - 0x1c, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x69, 0x0a, - 0x0a, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x49, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x72, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0xbe, 0x01, 0x0a, 0x15, 0x46, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x79, 0x22, 0x4b, 0x0a, 0x1c, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, - 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x4e, 0x0a, 0x1b, 0x46, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x4b, 0x0a, 0x1c, 0x46, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, - 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x1e, 0x41, 0x73, 0x73, 0x69, 0x67, - 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x88, 0x02, 0x0a, 0x26, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x25, - 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x64, 0x0a, 0x27, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, - 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x69, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x69, 0x74, 0x73, 0x2a, 0x9a, 0x01, 0x0a, 0x0f, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, - 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, - 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x45, - 0x58, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4c, 0x41, 0x53, - 0x48, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, - 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x07, 0x12, - 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x44, 0x45, 0x50, - 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x08, 0x32, 0xa8, 0x24, 0x0a, 0x13, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x80, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, + 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, + 0x91, 0x01, 0x0a, 0x1e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, + 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0x88, 0x02, 0x0a, 0x26, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, + 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, + 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, + 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, + 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x64, + 0x0a, 0x27, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, + 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, + 0x12, 0x12, 0x0a, 0x04, 0x62, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x62, 0x69, 0x74, 0x73, 0x2a, 0x9a, 0x01, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, + 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, + 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, + 0x56, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, + 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, + 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, + 0x49, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, + 0x08, 0x32, 0xca, 0x27, 0x0a, 0x13, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x09, 0x47, 0x65, + 0x74, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x81, 0x01, 0x0a, + 0x0a, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x24, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x75, 0x74, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x75, 0x74, - 0x69, 0x65, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, - 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xaf, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, - 0x74, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, + 0x01, 0x12, 0xaf, 0x01, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x30, 0x01, 0x12, 0x94, 0x01, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x30, 0x01, 0x12, 0x94, 0x01, 0x0a, 0x0e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x98, 0x01, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xb2, 0x01, 0x0a, - 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, - 0x20, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, - 0x73, 0x12, 0x87, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x97, 0x01, 0x0a, 0x12, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0xa0, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, - 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3a, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, 0x22, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0xbf, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, - 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, - 0x62, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x01, 0x2a, 0x22, 0x30, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x62, 0x79, 0x5f, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, - 0x12, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8f, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x65, + 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x25, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x97, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, - 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, + 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0xa0, + 0x01, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, + 0x22, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x12, 0xbf, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x01, + 0x2a, 0x22, 0x30, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x66, 0x65, 0x65, 0x5f, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x75, 0x62, 0x5f, + 0x6b, 0x65, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0xbe, 0x01, 0x0a, - 0x23, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8f, + 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x8e, 0x01, - 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x2a, 0x2e, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, + 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0xc8, 0x01, 0x0a, 0x24, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x30, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0xbe, 0x01, 0x0a, 0x23, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, - 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, - 0x22, 0x1c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0xa1, - 0x01, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x65, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x12, 0xd4, 0x01, 0x0a, 0x2a, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, - 0x62, 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x33, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x6f, 0x70, 0x70, - 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x8e, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, - 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x67, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, - 0x9f, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, - 0x12, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, + 0x45, 0x78, 0x69, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x19, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xb4, 0x01, - 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, + 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x75, 0x62, + 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x9a, 0x01, + 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, + 0x67, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, + 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, + 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x6f, + 0x70, 0x70, 0x65, 0x6c, 0x67, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x9f, 0x01, 0x0a, 0x17, 0x47, + 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x33, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x89, 0x01, 0x0a, + 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, + 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xb4, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, + 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, - 0x63, 0x5f, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0xc4, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x75, 0x62, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0xc4, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x65, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0xaf, 0x01, 0x0a, 0x20, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x12, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x40, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x3a, 0x3a, 0x01, 0x2a, 0x22, 0x35, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x9e, 0x01, - 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x29, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, + 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0xaf, 0x01, 0x0a, 0x20, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x31, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x01, + 0x2a, 0x22, 0x35, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, + 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xa1, - 0x01, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x41, - 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, - 0x30, 0x01, 0x12, 0x9e, 0x01, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, + 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, + 0x6c, 0x6f, 0x74, 0x73, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, + 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0x9e, 0x01, + 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0xae, 0x01, 0x0a, 0x17, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, - 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x44, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x75, - 0x62, 0x6e, 0x65, 0x74, 0x12, 0xec, 0x01, 0x0a, 0x1f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, - 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, - 0x42, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x5f, 0x61, - 0x6e, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, - 0x69, 0x74, 0x73, 0x42, 0x93, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, - 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, - 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xae, + 0x01, 0x0a, 0x17, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, + 0xec, 0x01, 0x0a, 0x1f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, + 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x69, 0x74, 0x73, 0x12, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x42, 0x93, + 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3931,7 +4070,7 @@ func file_proto_prysm_v1alpha1_validator_proto_rawDescGZIP() []byte { } var file_proto_prysm_v1alpha1_validator_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_prysm_v1alpha1_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_proto_prysm_v1alpha1_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_proto_prysm_v1alpha1_validator_proto_goTypes = []interface{}{ (ValidatorStatus)(0), // 0: ethereum.eth.v1alpha1.ValidatorStatus (*SyncMessageBlockRootResponse)(nil), // 1: ethereum.eth.v1alpha1.SyncMessageBlockRootResponse @@ -3961,131 +4100,141 @@ var file_proto_prysm_v1alpha1_validator_proto_goTypes = []interface{}{ (*AttestResponse)(nil), // 25: ethereum.eth.v1alpha1.AttestResponse (*AggregateSelectionRequest)(nil), // 26: ethereum.eth.v1alpha1.AggregateSelectionRequest (*AggregateSelectionResponse)(nil), // 27: ethereum.eth.v1alpha1.AggregateSelectionResponse - (*SignedAggregateSubmitRequest)(nil), // 28: ethereum.eth.v1alpha1.SignedAggregateSubmitRequest - (*SignedAggregateSubmitResponse)(nil), // 29: ethereum.eth.v1alpha1.SignedAggregateSubmitResponse - (*CommitteeSubnetsSubscribeRequest)(nil), // 30: ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest - (*Validator)(nil), // 31: ethereum.eth.v1alpha1.Validator - (*ValidatorParticipation)(nil), // 32: ethereum.eth.v1alpha1.ValidatorParticipation - (*ValidatorInfo)(nil), // 33: ethereum.eth.v1alpha1.ValidatorInfo - (*DoppelGangerRequest)(nil), // 34: ethereum.eth.v1alpha1.DoppelGangerRequest - (*DoppelGangerResponse)(nil), // 35: ethereum.eth.v1alpha1.DoppelGangerResponse - (*StreamSlotsRequest)(nil), // 36: ethereum.eth.v1alpha1.StreamSlotsRequest - (*StreamBlocksRequest)(nil), // 37: ethereum.eth.v1alpha1.StreamBlocksRequest - (*PrepareBeaconProposerRequest)(nil), // 38: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest - (*FeeRecipientByPubKeyRequest)(nil), // 39: ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest - (*FeeRecipientByPubKeyResponse)(nil), // 40: ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse - (*AssignValidatorToSubnetRequest)(nil), // 41: ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest - (*AggregatedSigAndAggregationBitsRequest)(nil), // 42: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest - (*AggregatedSigAndAggregationBitsResponse)(nil), // 43: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse - (*ValidatorActivationResponse_Status)(nil), // 44: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status - (*DutiesResponse_Duty)(nil), // 45: ethereum.eth.v1alpha1.DutiesResponse.Duty - (*DoppelGangerRequest_ValidatorRequest)(nil), // 46: ethereum.eth.v1alpha1.DoppelGangerRequest.ValidatorRequest - (*DoppelGangerResponse_ValidatorResponse)(nil), // 47: ethereum.eth.v1alpha1.DoppelGangerResponse.ValidatorResponse - (*PrepareBeaconProposerRequest_FeeRecipientContainer)(nil), // 48: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.FeeRecipientContainer - (*SignedBeaconBlock)(nil), // 49: ethereum.eth.v1alpha1.SignedBeaconBlock - (*SignedBeaconBlockAltair)(nil), // 50: ethereum.eth.v1alpha1.SignedBeaconBlockAltair - (*SignedBeaconBlockBellatrix)(nil), // 51: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix - (*SignedBeaconBlockCapella)(nil), // 52: ethereum.eth.v1alpha1.SignedBeaconBlockCapella - (*SignedBeaconBlockDeneb)(nil), // 53: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - (*SignedBeaconBlockElectra)(nil), // 54: ethereum.eth.v1alpha1.SignedBeaconBlockElectra - (*wrapperspb.UInt64Value)(nil), // 55: google.protobuf.UInt64Value - (*AggregateAttestationAndProof)(nil), // 56: ethereum.eth.v1alpha1.AggregateAttestationAndProof - (*SignedAggregateAttestationAndProof)(nil), // 57: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof - (*SyncCommitteeMessage)(nil), // 58: ethereum.eth.v1alpha1.SyncCommitteeMessage - (*emptypb.Empty)(nil), // 59: google.protobuf.Empty - (*GenericSignedBeaconBlock)(nil), // 60: ethereum.eth.v1alpha1.GenericSignedBeaconBlock - (*Attestation)(nil), // 61: ethereum.eth.v1alpha1.Attestation - (*SignedVoluntaryExit)(nil), // 62: ethereum.eth.v1alpha1.SignedVoluntaryExit - (*SignedContributionAndProof)(nil), // 63: ethereum.eth.v1alpha1.SignedContributionAndProof - (*SignedValidatorRegistrationsV1)(nil), // 64: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - (*GenericBeaconBlock)(nil), // 65: ethereum.eth.v1alpha1.GenericBeaconBlock - (*AttestationData)(nil), // 66: ethereum.eth.v1alpha1.AttestationData - (*SyncCommitteeContribution)(nil), // 67: ethereum.eth.v1alpha1.SyncCommitteeContribution + (*AggregateSelectionElectraResponse)(nil), // 28: ethereum.eth.v1alpha1.AggregateSelectionElectraResponse + (*SignedAggregateSubmitRequest)(nil), // 29: ethereum.eth.v1alpha1.SignedAggregateSubmitRequest + (*SignedAggregateSubmitElectraRequest)(nil), // 30: ethereum.eth.v1alpha1.SignedAggregateSubmitElectraRequest + (*SignedAggregateSubmitResponse)(nil), // 31: ethereum.eth.v1alpha1.SignedAggregateSubmitResponse + (*CommitteeSubnetsSubscribeRequest)(nil), // 32: ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest + (*Validator)(nil), // 33: ethereum.eth.v1alpha1.Validator + (*ValidatorParticipation)(nil), // 34: ethereum.eth.v1alpha1.ValidatorParticipation + (*ValidatorInfo)(nil), // 35: ethereum.eth.v1alpha1.ValidatorInfo + (*DoppelGangerRequest)(nil), // 36: ethereum.eth.v1alpha1.DoppelGangerRequest + (*DoppelGangerResponse)(nil), // 37: ethereum.eth.v1alpha1.DoppelGangerResponse + (*StreamSlotsRequest)(nil), // 38: ethereum.eth.v1alpha1.StreamSlotsRequest + (*StreamBlocksRequest)(nil), // 39: ethereum.eth.v1alpha1.StreamBlocksRequest + (*PrepareBeaconProposerRequest)(nil), // 40: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest + (*FeeRecipientByPubKeyRequest)(nil), // 41: ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest + (*FeeRecipientByPubKeyResponse)(nil), // 42: ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse + (*AssignValidatorToSubnetRequest)(nil), // 43: ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest + (*AggregatedSigAndAggregationBitsRequest)(nil), // 44: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest + (*AggregatedSigAndAggregationBitsResponse)(nil), // 45: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse + (*ValidatorActivationResponse_Status)(nil), // 46: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status + (*DutiesResponse_Duty)(nil), // 47: ethereum.eth.v1alpha1.DutiesResponse.Duty + (*DoppelGangerRequest_ValidatorRequest)(nil), // 48: ethereum.eth.v1alpha1.DoppelGangerRequest.ValidatorRequest + (*DoppelGangerResponse_ValidatorResponse)(nil), // 49: ethereum.eth.v1alpha1.DoppelGangerResponse.ValidatorResponse + (*PrepareBeaconProposerRequest_FeeRecipientContainer)(nil), // 50: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.FeeRecipientContainer + (*SignedBeaconBlock)(nil), // 51: ethereum.eth.v1alpha1.SignedBeaconBlock + (*SignedBeaconBlockAltair)(nil), // 52: ethereum.eth.v1alpha1.SignedBeaconBlockAltair + (*SignedBeaconBlockBellatrix)(nil), // 53: ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix + (*SignedBeaconBlockCapella)(nil), // 54: ethereum.eth.v1alpha1.SignedBeaconBlockCapella + (*SignedBeaconBlockDeneb)(nil), // 55: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb + (*SignedBeaconBlockElectra)(nil), // 56: ethereum.eth.v1alpha1.SignedBeaconBlockElectra + (*wrapperspb.UInt64Value)(nil), // 57: google.protobuf.UInt64Value + (*AggregateAttestationAndProof)(nil), // 58: ethereum.eth.v1alpha1.AggregateAttestationAndProof + (*AggregateAttestationAndProofElectra)(nil), // 59: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra + (*SignedAggregateAttestationAndProof)(nil), // 60: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof + (*SignedAggregateAttestationAndProofElectra)(nil), // 61: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra + (*SyncCommitteeMessage)(nil), // 62: ethereum.eth.v1alpha1.SyncCommitteeMessage + (*emptypb.Empty)(nil), // 63: google.protobuf.Empty + (*GenericSignedBeaconBlock)(nil), // 64: ethereum.eth.v1alpha1.GenericSignedBeaconBlock + (*Attestation)(nil), // 65: ethereum.eth.v1alpha1.Attestation + (*SignedVoluntaryExit)(nil), // 66: ethereum.eth.v1alpha1.SignedVoluntaryExit + (*SignedContributionAndProof)(nil), // 67: ethereum.eth.v1alpha1.SignedContributionAndProof + (*SignedValidatorRegistrationsV1)(nil), // 68: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + (*GenericBeaconBlock)(nil), // 69: ethereum.eth.v1alpha1.GenericBeaconBlock + (*AttestationData)(nil), // 70: ethereum.eth.v1alpha1.AttestationData + (*SyncCommitteeContribution)(nil), // 71: ethereum.eth.v1alpha1.SyncCommitteeContribution } var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ - 49, // 0: ethereum.eth.v1alpha1.StreamBlocksResponse.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock - 50, // 1: ethereum.eth.v1alpha1.StreamBlocksResponse.altair_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockAltair - 51, // 2: ethereum.eth.v1alpha1.StreamBlocksResponse.bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix - 52, // 3: ethereum.eth.v1alpha1.StreamBlocksResponse.capella_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella - 53, // 4: ethereum.eth.v1alpha1.StreamBlocksResponse.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb - 54, // 5: ethereum.eth.v1alpha1.StreamBlocksResponse.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra - 44, // 6: ethereum.eth.v1alpha1.ValidatorActivationResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorActivationResponse.Status + 51, // 0: ethereum.eth.v1alpha1.StreamBlocksResponse.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock + 52, // 1: ethereum.eth.v1alpha1.StreamBlocksResponse.altair_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockAltair + 53, // 2: ethereum.eth.v1alpha1.StreamBlocksResponse.bellatrix_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockBellatrix + 54, // 3: ethereum.eth.v1alpha1.StreamBlocksResponse.capella_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockCapella + 55, // 4: ethereum.eth.v1alpha1.StreamBlocksResponse.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb + 56, // 5: ethereum.eth.v1alpha1.StreamBlocksResponse.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra + 46, // 6: ethereum.eth.v1alpha1.ValidatorActivationResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorActivationResponse.Status 0, // 7: ethereum.eth.v1alpha1.ValidatorStatusResponse.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus 16, // 8: ethereum.eth.v1alpha1.MultipleValidatorStatusResponse.statuses:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 45, // 9: ethereum.eth.v1alpha1.DutiesResponse.current_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty - 45, // 10: ethereum.eth.v1alpha1.DutiesResponse.next_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty - 55, // 11: ethereum.eth.v1alpha1.BlockRequest.builder_boost_factor:type_name -> google.protobuf.UInt64Value - 56, // 12: ethereum.eth.v1alpha1.AggregateSelectionResponse.aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof - 57, // 13: ethereum.eth.v1alpha1.SignedAggregateSubmitRequest.signed_aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof - 0, // 14: ethereum.eth.v1alpha1.ValidatorInfo.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 46, // 15: ethereum.eth.v1alpha1.DoppelGangerRequest.validator_requests:type_name -> ethereum.eth.v1alpha1.DoppelGangerRequest.ValidatorRequest - 47, // 16: ethereum.eth.v1alpha1.DoppelGangerResponse.responses:type_name -> ethereum.eth.v1alpha1.DoppelGangerResponse.ValidatorResponse - 48, // 17: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.recipients:type_name -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.FeeRecipientContainer - 0, // 18: ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 58, // 19: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest.msgs:type_name -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 16, // 20: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 0, // 21: ethereum.eth.v1alpha1.DutiesResponse.Duty.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 19, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:input_type -> ethereum.eth.v1alpha1.DutiesRequest - 7, // 23: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:input_type -> ethereum.eth.v1alpha1.DomainRequest - 59, // 24: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:input_type -> google.protobuf.Empty - 9, // 25: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:input_type -> ethereum.eth.v1alpha1.ValidatorActivationRequest - 13, // 26: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:input_type -> ethereum.eth.v1alpha1.ValidatorIndexRequest - 15, // 27: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:input_type -> ethereum.eth.v1alpha1.ValidatorStatusRequest - 17, // 28: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:input_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusRequest - 21, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest - 60, // 30: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:input_type -> ethereum.eth.v1alpha1.GenericSignedBeaconBlock - 38, // 31: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:input_type -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest - 39, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest - 24, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest - 61, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation - 26, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest - 28, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest - 62, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 30, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest - 34, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest - 59, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty - 58, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 2, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest - 3, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest - 63, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof - 36, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest - 37, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest - 64, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - 41, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest - 42, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest - 20, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse - 8, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse - 11, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse - 10, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse - 14, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse - 16, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 18, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse - 65, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock - 22, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse - 59, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty - 40, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse - 66, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData - 25, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse - 27, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse - 29, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse - 23, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse - 59, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty - 35, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse - 1, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse - 59, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty - 4, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse - 67, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution - 59, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty - 5, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse - 6, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse - 59, // 75: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty - 59, // 76: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:output_type -> google.protobuf.Empty - 43, // 77: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:output_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse - 50, // [50:78] is the sub-list for method output_type - 22, // [22:50] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 47, // 9: ethereum.eth.v1alpha1.DutiesResponse.current_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty + 47, // 10: ethereum.eth.v1alpha1.DutiesResponse.next_epoch_duties:type_name -> ethereum.eth.v1alpha1.DutiesResponse.Duty + 57, // 11: ethereum.eth.v1alpha1.BlockRequest.builder_boost_factor:type_name -> google.protobuf.UInt64Value + 58, // 12: ethereum.eth.v1alpha1.AggregateSelectionResponse.aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof + 59, // 13: ethereum.eth.v1alpha1.AggregateSelectionElectraResponse.aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra + 60, // 14: ethereum.eth.v1alpha1.SignedAggregateSubmitRequest.signed_aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof + 61, // 15: ethereum.eth.v1alpha1.SignedAggregateSubmitElectraRequest.signed_aggregate_and_proof:type_name -> ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra + 0, // 16: ethereum.eth.v1alpha1.ValidatorInfo.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 48, // 17: ethereum.eth.v1alpha1.DoppelGangerRequest.validator_requests:type_name -> ethereum.eth.v1alpha1.DoppelGangerRequest.ValidatorRequest + 49, // 18: ethereum.eth.v1alpha1.DoppelGangerResponse.responses:type_name -> ethereum.eth.v1alpha1.DoppelGangerResponse.ValidatorResponse + 50, // 19: ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.recipients:type_name -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest.FeeRecipientContainer + 0, // 20: ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 62, // 21: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest.msgs:type_name -> ethereum.eth.v1alpha1.SyncCommitteeMessage + 16, // 22: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse + 0, // 23: ethereum.eth.v1alpha1.DutiesResponse.Duty.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus + 19, // 24: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:input_type -> ethereum.eth.v1alpha1.DutiesRequest + 7, // 25: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:input_type -> ethereum.eth.v1alpha1.DomainRequest + 63, // 26: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:input_type -> google.protobuf.Empty + 9, // 27: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:input_type -> ethereum.eth.v1alpha1.ValidatorActivationRequest + 13, // 28: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:input_type -> ethereum.eth.v1alpha1.ValidatorIndexRequest + 15, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:input_type -> ethereum.eth.v1alpha1.ValidatorStatusRequest + 17, // 30: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:input_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusRequest + 21, // 31: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest + 64, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:input_type -> ethereum.eth.v1alpha1.GenericSignedBeaconBlock + 40, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:input_type -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest + 41, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest + 24, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest + 65, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation + 26, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest + 26, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProofElectra:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest + 29, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest + 30, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProofElectra:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitElectraRequest + 66, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 32, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest + 36, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest + 63, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty + 62, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage + 2, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest + 3, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest + 67, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof + 38, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest + 39, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest + 68, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + 43, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest + 44, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest + 20, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse + 8, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse + 11, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse + 10, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse + 14, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse + 16, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse + 18, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse + 69, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock + 22, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse + 63, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty + 42, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse + 70, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData + 25, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse + 27, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse + 28, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProofElectra:output_type -> ethereum.eth.v1alpha1.AggregateSelectionElectraResponse + 31, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse + 31, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProofElectra:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse + 23, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse + 63, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty + 37, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse + 1, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse + 63, // 75: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty + 4, // 76: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse + 71, // 77: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution + 63, // 78: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty + 5, // 79: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse + 6, // 80: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse + 63, // 81: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty + 63, // 82: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:output_type -> google.protobuf.Empty + 45, // 83: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:output_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse + 54, // [54:84] is the sub-list for method output_type + 24, // [24:54] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_validator_proto_init() } @@ -4422,7 +4571,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedAggregateSubmitRequest); i { + switch v := v.(*AggregateSelectionElectraResponse); i { case 0: return &v.state case 1: @@ -4434,7 +4583,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedAggregateSubmitResponse); i { + switch v := v.(*SignedAggregateSubmitRequest); i { case 0: return &v.state case 1: @@ -4446,7 +4595,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitteeSubnetsSubscribeRequest); i { + switch v := v.(*SignedAggregateSubmitElectraRequest); i { case 0: return &v.state case 1: @@ -4458,7 +4607,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Validator); i { + switch v := v.(*SignedAggregateSubmitResponse); i { case 0: return &v.state case 1: @@ -4470,7 +4619,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorParticipation); i { + switch v := v.(*CommitteeSubnetsSubscribeRequest); i { case 0: return &v.state case 1: @@ -4482,7 +4631,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorInfo); i { + switch v := v.(*Validator); i { case 0: return &v.state case 1: @@ -4494,7 +4643,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DoppelGangerRequest); i { + switch v := v.(*ValidatorParticipation); i { case 0: return &v.state case 1: @@ -4506,7 +4655,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DoppelGangerResponse); i { + switch v := v.(*ValidatorInfo); i { case 0: return &v.state case 1: @@ -4518,7 +4667,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamSlotsRequest); i { + switch v := v.(*DoppelGangerRequest); i { case 0: return &v.state case 1: @@ -4530,7 +4679,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamBlocksRequest); i { + switch v := v.(*DoppelGangerResponse); i { case 0: return &v.state case 1: @@ -4542,7 +4691,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrepareBeaconProposerRequest); i { + switch v := v.(*StreamSlotsRequest); i { case 0: return &v.state case 1: @@ -4554,7 +4703,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FeeRecipientByPubKeyRequest); i { + switch v := v.(*StreamBlocksRequest); i { case 0: return &v.state case 1: @@ -4566,7 +4715,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FeeRecipientByPubKeyResponse); i { + switch v := v.(*PrepareBeaconProposerRequest); i { case 0: return &v.state case 1: @@ -4578,7 +4727,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssignValidatorToSubnetRequest); i { + switch v := v.(*FeeRecipientByPubKeyRequest); i { case 0: return &v.state case 1: @@ -4590,7 +4739,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AggregatedSigAndAggregationBitsRequest); i { + switch v := v.(*FeeRecipientByPubKeyResponse); i { case 0: return &v.state case 1: @@ -4602,7 +4751,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AggregatedSigAndAggregationBitsResponse); i { + switch v := v.(*AssignValidatorToSubnetRequest); i { case 0: return &v.state case 1: @@ -4614,7 +4763,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorActivationResponse_Status); i { + switch v := v.(*AggregatedSigAndAggregationBitsRequest); i { case 0: return &v.state case 1: @@ -4626,7 +4775,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DutiesResponse_Duty); i { + switch v := v.(*AggregatedSigAndAggregationBitsResponse); i { case 0: return &v.state case 1: @@ -4638,7 +4787,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DoppelGangerRequest_ValidatorRequest); i { + switch v := v.(*ValidatorActivationResponse_Status); i { case 0: return &v.state case 1: @@ -4650,7 +4799,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DoppelGangerResponse_ValidatorResponse); i { + switch v := v.(*DutiesResponse_Duty); i { case 0: return &v.state case 1: @@ -4662,6 +4811,30 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { } } file_proto_prysm_v1alpha1_validator_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoppelGangerRequest_ValidatorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_validator_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoppelGangerResponse_ValidatorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_validator_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PrepareBeaconProposerRequest_FeeRecipientContainer); i { case 0: return &v.state @@ -4688,7 +4861,7 @@ func file_proto_prysm_v1alpha1_validator_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_validator_proto_rawDesc, NumEnums: 1, - NumMessages: 48, + NumMessages: 50, NumExtensions: 0, NumServices: 1, }, @@ -4730,7 +4903,9 @@ type BeaconNodeValidatorClient interface { GetAttestationData(ctx context.Context, in *AttestationDataRequest, opts ...grpc.CallOption) (*AttestationData, error) ProposeAttestation(ctx context.Context, in *Attestation, opts ...grpc.CallOption) (*AttestResponse, error) SubmitAggregateSelectionProof(ctx context.Context, in *AggregateSelectionRequest, opts ...grpc.CallOption) (*AggregateSelectionResponse, error) + SubmitAggregateSelectionProofElectra(ctx context.Context, in *AggregateSelectionRequest, opts ...grpc.CallOption) (*AggregateSelectionElectraResponse, error) SubmitSignedAggregateSelectionProof(ctx context.Context, in *SignedAggregateSubmitRequest, opts ...grpc.CallOption) (*SignedAggregateSubmitResponse, error) + SubmitSignedAggregateSelectionProofElectra(ctx context.Context, in *SignedAggregateSubmitElectraRequest, opts ...grpc.CallOption) (*SignedAggregateSubmitResponse, error) ProposeExit(ctx context.Context, in *SignedVoluntaryExit, opts ...grpc.CallOption) (*ProposeExitResponse, error) SubscribeCommitteeSubnets(ctx context.Context, in *CommitteeSubnetsSubscribeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) CheckDoppelGanger(ctx context.Context, in *DoppelGangerRequest, opts ...grpc.CallOption) (*DoppelGangerResponse, error) @@ -4929,6 +5104,15 @@ func (c *beaconNodeValidatorClient) SubmitAggregateSelectionProof(ctx context.Co return out, nil } +func (c *beaconNodeValidatorClient) SubmitAggregateSelectionProofElectra(ctx context.Context, in *AggregateSelectionRequest, opts ...grpc.CallOption) (*AggregateSelectionElectraResponse, error) { + out := new(AggregateSelectionElectraResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProofElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconNodeValidatorClient) SubmitSignedAggregateSelectionProof(ctx context.Context, in *SignedAggregateSubmitRequest, opts ...grpc.CallOption) (*SignedAggregateSubmitResponse, error) { out := new(SignedAggregateSubmitResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof", in, out, opts...) @@ -4938,6 +5122,15 @@ func (c *beaconNodeValidatorClient) SubmitSignedAggregateSelectionProof(ctx cont return out, nil } +func (c *beaconNodeValidatorClient) SubmitSignedAggregateSelectionProofElectra(ctx context.Context, in *SignedAggregateSubmitElectraRequest, opts ...grpc.CallOption) (*SignedAggregateSubmitResponse, error) { + out := new(SignedAggregateSubmitResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProofElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconNodeValidatorClient) ProposeExit(ctx context.Context, in *SignedVoluntaryExit, opts ...grpc.CallOption) (*ProposeExitResponse, error) { out := new(ProposeExitResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit", in, out, opts...) @@ -5120,7 +5313,9 @@ type BeaconNodeValidatorServer interface { GetAttestationData(context.Context, *AttestationDataRequest) (*AttestationData, error) ProposeAttestation(context.Context, *Attestation) (*AttestResponse, error) SubmitAggregateSelectionProof(context.Context, *AggregateSelectionRequest) (*AggregateSelectionResponse, error) + SubmitAggregateSelectionProofElectra(context.Context, *AggregateSelectionRequest) (*AggregateSelectionElectraResponse, error) SubmitSignedAggregateSelectionProof(context.Context, *SignedAggregateSubmitRequest) (*SignedAggregateSubmitResponse, error) + SubmitSignedAggregateSelectionProofElectra(context.Context, *SignedAggregateSubmitElectraRequest) (*SignedAggregateSubmitResponse, error) ProposeExit(context.Context, *SignedVoluntaryExit) (*ProposeExitResponse, error) SubscribeCommitteeSubnets(context.Context, *CommitteeSubnetsSubscribeRequest) (*emptypb.Empty, error) CheckDoppelGanger(context.Context, *DoppelGangerRequest) (*DoppelGangerResponse, error) @@ -5184,9 +5379,15 @@ func (*UnimplementedBeaconNodeValidatorServer) ProposeAttestation(context.Contex func (*UnimplementedBeaconNodeValidatorServer) SubmitAggregateSelectionProof(context.Context, *AggregateSelectionRequest) (*AggregateSelectionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitAggregateSelectionProof not implemented") } +func (*UnimplementedBeaconNodeValidatorServer) SubmitAggregateSelectionProofElectra(context.Context, *AggregateSelectionRequest) (*AggregateSelectionElectraResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitAggregateSelectionProofElectra not implemented") +} func (*UnimplementedBeaconNodeValidatorServer) SubmitSignedAggregateSelectionProof(context.Context, *SignedAggregateSubmitRequest) (*SignedAggregateSubmitResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitSignedAggregateSelectionProof not implemented") } +func (*UnimplementedBeaconNodeValidatorServer) SubmitSignedAggregateSelectionProofElectra(context.Context, *SignedAggregateSubmitElectraRequest) (*SignedAggregateSubmitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitSignedAggregateSelectionProofElectra not implemented") +} func (*UnimplementedBeaconNodeValidatorServer) ProposeExit(context.Context, *SignedVoluntaryExit) (*ProposeExitResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeExit not implemented") } @@ -5489,6 +5690,24 @@ func _BeaconNodeValidator_SubmitAggregateSelectionProof_Handler(srv interface{}, return interceptor(ctx, in, info, handler) } +func _BeaconNodeValidator_SubmitAggregateSelectionProofElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AggregateSelectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconNodeValidatorServer).SubmitAggregateSelectionProofElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProofElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconNodeValidatorServer).SubmitAggregateSelectionProofElectra(ctx, req.(*AggregateSelectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconNodeValidator_SubmitSignedAggregateSelectionProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignedAggregateSubmitRequest) if err := dec(in); err != nil { @@ -5507,6 +5726,24 @@ func _BeaconNodeValidator_SubmitSignedAggregateSelectionProof_Handler(srv interf return interceptor(ctx, in, info, handler) } +func _BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedAggregateSubmitElectraRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconNodeValidatorServer).SubmitSignedAggregateSelectionProofElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProofElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconNodeValidatorServer).SubmitSignedAggregateSelectionProofElectra(ctx, req.(*SignedAggregateSubmitElectraRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconNodeValidator_ProposeExit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignedVoluntaryExit) if err := dec(in); err != nil { @@ -5799,10 +6036,18 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitAggregateSelectionProof", Handler: _BeaconNodeValidator_SubmitAggregateSelectionProof_Handler, }, + { + MethodName: "SubmitAggregateSelectionProofElectra", + Handler: _BeaconNodeValidator_SubmitAggregateSelectionProofElectra_Handler, + }, { MethodName: "SubmitSignedAggregateSelectionProof", Handler: _BeaconNodeValidator_SubmitSignedAggregateSelectionProof_Handler, }, + { + MethodName: "SubmitSignedAggregateSelectionProofElectra", + Handler: _BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_Handler, + }, { MethodName: "ProposeExit", Handler: _BeaconNodeValidator_ProposeExit_Handler, diff --git a/proto/prysm/v1alpha1/validator.pb.gw.go b/proto/prysm/v1alpha1/validator.pb.gw.go index b5a85384e7a0..23abddf6f866 100755 --- a/proto/prysm/v1alpha1/validator.pb.gw.go +++ b/proto/prysm/v1alpha1/validator.pb.gw.go @@ -502,6 +502,40 @@ func local_request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx conte } +func request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AggregateSelectionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SubmitAggregateSelectionProofElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AggregateSelectionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SubmitAggregateSelectionProofElectra(ctx, &protoReq) + return msg, metadata, err + +} + func request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq SignedAggregateSubmitRequest var metadata runtime.ServerMetadata @@ -536,6 +570,40 @@ func local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx } +func request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SignedAggregateSubmitElectraRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SubmitSignedAggregateSelectionProofElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SignedAggregateSubmitElectraRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SubmitSignedAggregateSelectionProofElectra(ctx, &protoReq) + return msg, metadata, err + +} + func request_BeaconNodeValidator_ProposeExit_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq SignedVoluntaryExit var metadata runtime.ServerMetadata @@ -1252,6 +1320,29 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProofElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1275,6 +1366,29 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProofElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_BeaconNodeValidator_ProposeExit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1863,6 +1977,26 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProofElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1883,6 +2017,26 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProofElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_BeaconNodeValidator_ProposeExit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -2175,8 +2329,12 @@ var ( pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) + pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate_electra"}, "")) + pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) + pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate_electra"}, "")) + pattern_BeaconNodeValidator_ProposeExit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "exit"}, "")) pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "subnet", "subscribe"}, "")) @@ -2233,8 +2391,12 @@ var ( forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.ForwardResponseMessage + forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0 = runtime.ForwardResponseMessage + forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0 = runtime.ForwardResponseMessage + forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0 = runtime.ForwardResponseMessage + forward_BeaconNodeValidator_ProposeExit_0 = runtime.ForwardResponseMessage forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0 = runtime.ForwardResponseMessage diff --git a/proto/prysm/v1alpha1/validator.proto b/proto/prysm/v1alpha1/validator.proto index c4bc94dc9a24..c1778e4b2e87 100644 --- a/proto/prysm/v1alpha1/validator.proto +++ b/proto/prysm/v1alpha1/validator.proto @@ -197,6 +197,15 @@ service BeaconNodeValidator { }; } + // Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root. + // the beacon node responses with an aggregate and proof object back to validator to sign over. + rpc SubmitAggregateSelectionProofElectra(AggregateSelectionRequest) returns (AggregateSelectionElectraResponse) { + option (google.api.http) = { + post: "/eth/v1alpha1/validator/aggregate_electra" + body: "*" + }; + } + // Submit a signed aggregate and proof object, the beacon node will broadcast the // signed aggregated attestation and proof object. rpc SubmitSignedAggregateSelectionProof(SignedAggregateSubmitRequest) returns (SignedAggregateSubmitResponse) { @@ -206,6 +215,15 @@ service BeaconNodeValidator { }; } + // Submit a signed aggregate and proof object, the beacon node will broadcast the + // signed aggregated attestation and proof object. + rpc SubmitSignedAggregateSelectionProofElectra(SignedAggregateSubmitElectraRequest) returns (SignedAggregateSubmitResponse) { + option (google.api.http) = { + post: "/eth/v1alpha1/validator/aggregate_electra" + body: "*" + }; + } + // Propose to leave the list of active validators. // // The beacon node is expected to validate the request and make it available for inclusion in @@ -602,11 +620,21 @@ message AggregateSelectionResponse { AggregateAttestationAndProof aggregate_and_proof = 1; } +message AggregateSelectionElectraResponse { + // The aggregate and proof message without the signature. + AggregateAttestationAndProofElectra aggregate_and_proof = 1; +} + message SignedAggregateSubmitRequest { // The signed aggregate and proof message with the signature. SignedAggregateAttestationAndProof signed_aggregate_and_proof = 1; } +message SignedAggregateSubmitElectraRequest { + // The signed aggregate and proof message with the signature. + SignedAggregateAttestationAndProofElectra signed_aggregate_and_proof = 1; +} + message SignedAggregateSubmitResponse { // The 32 byte hash tree root of the aggregated attestation data. bytes attestation_data_root = 1 [(ethereum.eth.ext.ssz_size) = "32"]; diff --git a/testing/mock/beacon_validator_client_mock.go b/testing/mock/beacon_validator_client_mock.go index bed03fb8f49c..1ffaeb385a2d 100644 --- a/testing/mock/beacon_validator_client_mock.go +++ b/testing/mock/beacon_validator_client_mock.go @@ -423,6 +423,26 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitAggregateSelectionPro return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAggregateSelectionProof", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).SubmitAggregateSelectionProof), varargs...) } +// SubmitAggregateSelectionProofElectra mocks base method. +func (m *MockBeaconNodeValidatorClient) SubmitAggregateSelectionProofElectra(arg0 context.Context, arg1 *eth.AggregateSelectionRequest, arg2 ...grpc.CallOption) (*eth.AggregateSelectionElectraResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SubmitAggregateSelectionProofElectra", varargs...) + ret0, _ := ret[0].(*eth.AggregateSelectionElectraResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitAggregateSelectionProofElectra indicates an expected call of SubmitAggregateSelectionProofElectra. +func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitAggregateSelectionProofElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAggregateSelectionProofElectra", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).SubmitAggregateSelectionProofElectra), varargs...) +} + // SubmitSignedAggregateSelectionProof mocks base method. func (m *MockBeaconNodeValidatorClient) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *eth.SignedAggregateSubmitRequest, arg2 ...grpc.CallOption) (*eth.SignedAggregateSubmitResponse, error) { m.ctrl.T.Helper() @@ -443,6 +463,26 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitSignedAggregateSelect return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitSignedAggregateSelectionProof", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).SubmitSignedAggregateSelectionProof), varargs...) } +// SubmitSignedAggregateSelectionProofElectra mocks base method. +func (m *MockBeaconNodeValidatorClient) SubmitSignedAggregateSelectionProofElectra(arg0 context.Context, arg1 *eth.SignedAggregateSubmitElectraRequest, arg2 ...grpc.CallOption) (*eth.SignedAggregateSubmitResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SubmitSignedAggregateSelectionProofElectra", varargs...) + ret0, _ := ret[0].(*eth.SignedAggregateSubmitResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitSignedAggregateSelectionProofElectra indicates an expected call of SubmitSignedAggregateSelectionProofElectra. +func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitSignedAggregateSelectionProofElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitSignedAggregateSelectionProofElectra", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).SubmitSignedAggregateSelectionProofElectra), varargs...) +} + // SubmitSignedContributionAndProof mocks base method. func (m *MockBeaconNodeValidatorClient) SubmitSignedContributionAndProof(arg0 context.Context, arg1 *eth.SignedContributionAndProof, arg2 ...grpc.CallOption) (*emptypb.Empty, error) { m.ctrl.T.Helper() diff --git a/testing/mock/beacon_validator_server_mock.go b/testing/mock/beacon_validator_server_mock.go index c1722b39eaf7..32916231c7c2 100644 --- a/testing/mock/beacon_validator_server_mock.go +++ b/testing/mock/beacon_validator_server_mock.go @@ -325,6 +325,21 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitAggregateSelectionPro return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAggregateSelectionProof", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).SubmitAggregateSelectionProof), arg0, arg1) } +// SubmitAggregateSelectionProofElectra mocks base method. +func (m *MockBeaconNodeValidatorServer) SubmitAggregateSelectionProofElectra(arg0 context.Context, arg1 *eth.AggregateSelectionRequest) (*eth.AggregateSelectionElectraResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubmitAggregateSelectionProofElectra", arg0, arg1) + ret0, _ := ret[0].(*eth.AggregateSelectionElectraResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitAggregateSelectionProofElectra indicates an expected call of SubmitAggregateSelectionProofElectra. +func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitAggregateSelectionProofElectra(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAggregateSelectionProofElectra", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).SubmitAggregateSelectionProofElectra), arg0, arg1) +} + // SubmitSignedAggregateSelectionProof mocks base method. func (m *MockBeaconNodeValidatorServer) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *eth.SignedAggregateSubmitRequest) (*eth.SignedAggregateSubmitResponse, error) { m.ctrl.T.Helper() @@ -340,6 +355,21 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitSignedAggregateSelect return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitSignedAggregateSelectionProof", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).SubmitSignedAggregateSelectionProof), arg0, arg1) } +// SubmitSignedAggregateSelectionProofElectra mocks base method. +func (m *MockBeaconNodeValidatorServer) SubmitSignedAggregateSelectionProofElectra(arg0 context.Context, arg1 *eth.SignedAggregateSubmitElectraRequest) (*eth.SignedAggregateSubmitResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubmitSignedAggregateSelectionProofElectra", arg0, arg1) + ret0, _ := ret[0].(*eth.SignedAggregateSubmitResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitSignedAggregateSelectionProofElectra indicates an expected call of SubmitSignedAggregateSelectionProofElectra. +func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitSignedAggregateSelectionProofElectra(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitSignedAggregateSelectionProofElectra", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).SubmitSignedAggregateSelectionProofElectra), arg0, arg1) +} + // SubmitSignedContributionAndProof mocks base method. func (m *MockBeaconNodeValidatorServer) SubmitSignedContributionAndProof(arg0 context.Context, arg1 *eth.SignedContributionAndProof) (*emptypb.Empty, error) { m.ctrl.T.Helper() From 8c0d6b27d040b98e0a6200eba5ab70b672ba1af1 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Mon, 1 Jul 2024 21:42:55 +0100 Subject: [PATCH 170/325] use underscore to signify that it is not being used (#14162) Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --- beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 07bece2470f8..611cffa66901 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -110,7 +110,7 @@ func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) ( return resp, nil } -func (vs *Server) handleSuccesfulReorgAttempt(ctx context.Context, slot primitives.Slot, parentRoot, headRoot [32]byte) (state.BeaconState, error) { +func (vs *Server) handleSuccesfulReorgAttempt(ctx context.Context, slot primitives.Slot, parentRoot, _ [32]byte) (state.BeaconState, error) { // Try to get the state from the NSC head := transition.NextSlotState(parentRoot[:], slot) if head != nil { From a8ecf5d11878324690115c612beefd66ac6386dd Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Tue, 2 Jul 2024 12:03:24 +0800 Subject: [PATCH 171/325] Update to Go v1.22 (#13965) * Bump go version up * Update to go 1.22 compatible version * Fix NoSec declarations * Skip Gosec in GolangCi * Avoid Bug In Analyzer * Add in Gohashtree and Update to 1.22.4 * Fix Go Sum --- .github/actions/gomodtidy/Dockerfile | 2 +- .github/workflows/fuzz.yml | 4 ++-- .github/workflows/go.yml | 12 ++++++------ .golangci.yml | 3 ++- WORKSPACE | 2 +- deps.bzl | 4 ++-- go.mod | 6 +++--- go.sum | 4 ++-- testing/endtoend/components/eth1/transactions.go | 16 ++++++---------- 9 files changed, 25 insertions(+), 28 deletions(-) diff --git a/.github/actions/gomodtidy/Dockerfile b/.github/actions/gomodtidy/Dockerfile index 6dc48ee614ed..c9e1e740857d 100644 --- a/.github/actions/gomodtidy/Dockerfile +++ b/.github/actions/gomodtidy/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21-alpine +FROM golang:1.22-alpine COPY entrypoint.sh /entrypoint.sh diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 019dc922524e..07677c1c73e3 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22.3' - id: list uses: shogo82148/actions-go-fuzz/list@v0 with: @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: '1.22.3' - uses: shogo82148/actions-go-fuzz/run@v0 with: packages: ${{ matrix.package }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f6b8fa20a9d9..02f828499c25 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,14 +28,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Set up Go 1.21 + - name: Set up Go 1.22 uses: actions/setup-go@v3 with: - go-version: '1.21.5' + go-version: '1.22.3' - name: Run Gosec Security Scanner run: | # https://github.com/securego/gosec/issues/469 export PATH=$PATH:$(go env GOPATH)/bin - go install github.com/securego/gosec/v2/cmd/gosec@v2.15.0 + go install github.com/securego/gosec/v2/cmd/gosec@v2.19.0 gosec -exclude-generated -exclude=G307 -exclude-dir=crypto/bls/herumi ./... lint: @@ -45,10 +45,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Set up Go 1.21 + - name: Set up Go 1.22 uses: actions/setup-go@v3 with: - go-version: '1.21.5' + go-version: '1.22.3' id: go - name: Golangci-lint @@ -64,7 +64,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: '1.21.5' + go-version: '1.22.3' id: go - name: Check out code into the Go module directory diff --git a/.golangci.yml b/.golangci.yml index 63c6d3c523fe..92f26ea20900 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,7 +6,7 @@ run: - proto - tools/analyzers timeout: 10m - go: '1.21.5' + go: '1.22.3' linters: enable-all: true @@ -52,6 +52,7 @@ linters: - gofumpt - gomnd - gomoddirectives + - gosec - inamedparam - interfacebloat - ireturn diff --git a/WORKSPACE b/WORKSPACE index f78a9b9a5919..20d40d8b9f28 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -182,7 +182,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() go_register_toolchains( - go_version = "1.21.11", + go_version = "1.22.4", nogo = "@//:nogo", ) diff --git a/deps.bzl b/deps.bzl index 4166f23681c4..192c4fd13dbd 100644 --- a/deps.bzl +++ b/deps.bzl @@ -2985,8 +2985,8 @@ def prysm_deps(): go_repository( name = "com_github_prysmaticlabs_gohashtree", importpath = "github.com/prysmaticlabs/gohashtree", - sum = "h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=", - version = "v0.0.4-beta", + sum = "h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks=", + version = "v0.0.4-beta.0.20240624100937-73632381301b", ) go_repository( name = "com_github_prysmaticlabs_prombbolt", diff --git a/go.mod b/go.mod index 24f417e3c37d..7fef9c943ac8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/prysmaticlabs/prysm/v5 -go 1.21 +go 1.22 -toolchain go1.21.11 +toolchain go1.22.4 require ( contrib.go.opencensus.io/exporter/jaeger v0.2.1 @@ -272,7 +272,7 @@ require ( github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect - github.com/prysmaticlabs/gohashtree v0.0.4-beta + github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b golang.org/x/sys v0.20.0 // indirect google.golang.org/api v0.44.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index a91032596541..6b438f575979 100644 --- a/go.sum +++ b/go.sum @@ -971,8 +971,8 @@ github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2 github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= -github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= -github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= +github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks= +github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY= github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28= github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446/go.mod h1:IOyTYjcIO0rkmnGBfJTL0NJ11exy/Tc2QEuv7hCXp24= github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c h1:9PHRCuO/VN0s9k+RmLykho7AjDxblNYI5bYKed16NPU= diff --git a/testing/endtoend/components/eth1/transactions.go b/testing/endtoend/components/eth1/transactions.go index 180b2f7506df..15fd02277f31 100644 --- a/testing/endtoend/components/eth1/transactions.go +++ b/testing/endtoend/components/eth1/transactions.go @@ -78,8 +78,7 @@ func (t *TransactionGenerator) Start(ctx context.Context) error { } fundedAccount = newKey rnd := make([]byte, 10000) - // #nosec G404 - _, err = mathRand.Read(rnd) + _, err = mathRand.Read(rnd) // #nosec G404 if err != nil { return err } @@ -374,11 +373,9 @@ func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash { } func randomBlobData() ([]byte, error) { - // #nosec G404 - size := mathRand.Intn(fieldparams.BlobSize) + size := mathRand.Intn(fieldparams.BlobSize) // #nosec G404 data := make([]byte, size) - // #nosec G404 - n, err := mathRand.Read(data) + n, err := mathRand.Read(data) // #nosec G404 if err != nil { return nil, err } @@ -389,12 +386,11 @@ func randomBlobData() ([]byte, error) { } func randomAddress() common.Address { - // #nosec G404 - switch mathRand.Int31n(5) { + rNum := mathRand.Int31n(5) // #nosec G404 + switch rNum { case 0, 1, 2: b := make([]byte, 20) - // #nosec G404 - _, err := mathRand.Read(b) + _, err := mathRand.Read(b) // #nosec G404 if err != nil { panic(err) } From 0aab919d7c860c7ac3789aee6279e92bf900504b Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 2 Jul 2024 09:43:40 -0500 Subject: [PATCH 172/325] Electra: new `process_consolidation_request` (#14163) * Electra: process_consolidation_request * Enable consolidation_request spectests --- beacon-chain/core/electra/churn_test.go | 14 +- beacon-chain/core/electra/consolidations.go | 166 +++++++++++++++ .../core/electra/consolidations_test.go | 199 ++++++++++++++++++ beacon-chain/core/helpers/validators.go | 2 +- .../electra/operations/consolidation_test.go | 1 - .../electra/operations/consolidations.go | 25 ++- 6 files changed, 398 insertions(+), 9 deletions(-) diff --git a/beacon-chain/core/electra/churn_test.go b/beacon-chain/core/electra/churn_test.go index d1920229ca3b..4ce1731e7293 100644 --- a/beacon-chain/core/electra/churn_test.go +++ b/beacon-chain/core/electra/churn_test.go @@ -2,6 +2,7 @@ package electra_test import ( "context" + "fmt" "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" @@ -18,10 +19,17 @@ func createValidatorsWithTotalActiveBalance(totalBal primitives.Gwei) []*eth.Val num := totalBal / primitives.Gwei(params.BeaconConfig().MinActivationBalance) vals := make([]*eth.Validator, num) for i := range vals { + wd := make([]byte, 32) + wd[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte + wd[31] = byte(i) + vals[i] = ð.Validator{ - ActivationEpoch: primitives.Epoch(0), - ExitEpoch: params.BeaconConfig().FarFutureEpoch, - EffectiveBalance: params.BeaconConfig().MinActivationBalance, + ActivationEpoch: primitives.Epoch(0), + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + PublicKey: []byte(fmt.Sprintf("val_%d", i)), + WithdrawableEpoch: params.BeaconConfig().FarFutureEpoch, + WithdrawalCredentials: wd, } } if totalBal%primitives.Gwei(params.BeaconConfig().MinActivationBalance) != 0 { diff --git a/beacon-chain/core/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go index b4444d2753cc..6fe9c69c5721 100644 --- a/beacon-chain/core/electra/consolidations.go +++ b/beacon-chain/core/electra/consolidations.go @@ -1,11 +1,18 @@ package electra import ( + "bytes" "context" + "fmt" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -86,3 +93,162 @@ func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) err return nil } + +// ProcessConsolidationRequests implements the spec definition below. This method makes mutating +// calls to the beacon state. +// +// def process_consolidation_request( +// state: BeaconState, +// consolidation_request: ConsolidationRequest +// ) -> None: +// # If the pending consolidations queue is full, consolidation requests are ignored +// if len(state.pending_consolidations) == PENDING_CONSOLIDATIONS_LIMIT: +// return +// # If there is too little available consolidation churn limit, consolidation requests are ignored +// if get_consolidation_churn_limit(state) <= MIN_ACTIVATION_BALANCE: +// return +// +// validator_pubkeys = [v.pubkey for v in state.validators] +// # Verify pubkeys exists +// request_source_pubkey = consolidation_request.source_pubkey +// request_target_pubkey = consolidation_request.target_pubkey +// if request_source_pubkey not in validator_pubkeys: +// return +// if request_target_pubkey not in validator_pubkeys: +// return +// source_index = ValidatorIndex(validator_pubkeys.index(request_source_pubkey)) +// target_index = ValidatorIndex(validator_pubkeys.index(request_target_pubkey)) +// source_validator = state.validators[source_index] +// target_validator = state.validators[target_index] +// +// # Verify that source != target, so a consolidation cannot be used as an exit. +// if source_index == target_index: +// return +// +// # Verify source withdrawal credentials +// has_correct_credential = has_execution_withdrawal_credential(source_validator) +// is_correct_source_address = ( +// source_validator.withdrawal_credentials[12:] == consolidation_request.source_address +// ) +// if not (has_correct_credential and is_correct_source_address): +// return +// +// # Verify that target has execution withdrawal credentials +// if not has_execution_withdrawal_credential(target_validator): +// return +// +// # Verify the source and the target are active +// current_epoch = get_current_epoch(state) +// if not is_active_validator(source_validator, current_epoch): +// return +// if not is_active_validator(target_validator, current_epoch): +// return +// # Verify exits for source and target have not been initiated +// if source_validator.exit_epoch != FAR_FUTURE_EPOCH: +// return +// if target_validator.exit_epoch != FAR_FUTURE_EPOCH: +// return +// +// # Initiate source validator exit and append pending consolidation +// source_validator.exit_epoch = compute_consolidation_epoch_and_update_churn( +// state, source_validator.effective_balance +// ) +// source_validator.withdrawable_epoch = Epoch( +// source_validator.exit_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY +// ) +// state.pending_consolidations.append(PendingConsolidation( +// source_index=source_index, +// target_index=target_index +// )) +func ProcessConsolidationRequests(ctx context.Context, st state.BeaconState, reqs []*enginev1.ConsolidationRequest) error { + if len(reqs) == 0 || st == nil { + return nil + } + + activeBal, err := helpers.TotalActiveBalance(st) + if err != nil { + return err + } + churnLimit := helpers.ConsolidationChurnLimit(primitives.Gwei(activeBal)) + if churnLimit <= primitives.Gwei(params.BeaconConfig().MinActivationBalance) { + return nil + } + curEpoch := slots.ToEpoch(st.Slot()) + ffe := params.BeaconConfig().FarFutureEpoch + minValWithdrawDelay := params.BeaconConfig().MinValidatorWithdrawabilityDelay + pcLimit := params.BeaconConfig().PendingConsolidationsLimit + + for _, cr := range reqs { + if ctx.Err() != nil { + return fmt.Errorf("cannot process consolidation requests: %w", ctx.Err()) + } + if npc, err := st.NumPendingConsolidations(); err != nil { + return fmt.Errorf("failed to fetch number of pending consolidations: %w", err) // This should never happen. + } else if npc >= pcLimit { + return nil + } + + srcIdx, ok := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(cr.SourcePubkey)) + if !ok { + continue + } + tgtIdx, ok := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(cr.TargetPubkey)) + if !ok { + continue + } + + if srcIdx == tgtIdx { + continue + } + + srcV, err := st.ValidatorAtIndex(srcIdx) + if err != nil { + return fmt.Errorf("failed to fetch source validator: %w", err) // This should never happen. + } + + tgtV, err := st.ValidatorAtIndexReadOnly(tgtIdx) + if err != nil { + return fmt.Errorf("failed to fetch target validator: %w", err) // This should never happen. + } + + // Verify source withdrawal credentials + if !helpers.HasExecutionWithdrawalCredentials(srcV) { + continue + } + // Confirm source_validator.withdrawal_credentials[12:] == consolidation_request.source_address + if len(srcV.WithdrawalCredentials) != 32 || len(cr.SourceAddress) != 20 || !bytes.HasSuffix(srcV.WithdrawalCredentials, cr.SourceAddress) { + continue + } + + // Target validator must have their withdrawal credentials set appropriately. + if !helpers.HasExecutionWithdrawalCredentials(tgtV) { + continue + } + + // Both validators must be active. + if !helpers.IsActiveValidator(srcV, curEpoch) || !helpers.IsActiveValidatorUsingTrie(tgtV, curEpoch) { + continue + } + // Neither validator are exiting. + if srcV.ExitEpoch != ffe || tgtV.ExitEpoch() != ffe { + continue + } + + // Initiate the exit of the source validator. + exitEpoch, err := ComputeConsolidationEpochAndUpdateChurn(ctx, st, primitives.Gwei(srcV.EffectiveBalance)) + if err != nil { + return fmt.Errorf("failed to compute consolidaiton epoch: %w", err) + } + srcV.ExitEpoch = exitEpoch + srcV.WithdrawableEpoch = exitEpoch + minValWithdrawDelay + if err := st.UpdateValidatorAtIndex(srcIdx, srcV); err != nil { + return fmt.Errorf("failed to update validator: %w", err) // This should never happen. + } + + if err := st.AppendPendingConsolidation(ð.PendingConsolidation{SourceIndex: srcIdx, TargetIndex: tgtIdx}); err != nil { + return fmt.Errorf("failed to append pending consolidation: %w", err) // This should never happen. + } + } + + return nil +} diff --git a/beacon-chain/core/electra/consolidations_test.go b/beacon-chain/core/electra/consolidations_test.go index a1b4e4cec67b..98378fed3ca1 100644 --- a/beacon-chain/core/electra/consolidations_test.go +++ b/beacon-chain/core/electra/consolidations_test.go @@ -8,6 +8,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -229,3 +232,199 @@ func stateWithActiveBalanceETH(t *testing.T, balETH uint64) state.BeaconState { return st } + +func TestProcessConsolidationRequests(t *testing.T) { + tests := []struct { + name string + state state.BeaconState + reqs []*enginev1.ConsolidationRequest + validate func(*testing.T, state.BeaconState) + }{ + { + name: "one valid request", + state: func() state.BeaconState { + st := ð.BeaconStateElectra{ + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + } + // Validator scenario setup. See comments in reqs section. + st.Validators[3].WithdrawalCredentials = bytesutil.Bytes32(0) + st.Validators[8].WithdrawalCredentials = bytesutil.Bytes32(0) + st.Validators[9].ActivationEpoch = params.BeaconConfig().FarFutureEpoch + st.Validators[12].ActivationEpoch = params.BeaconConfig().FarFutureEpoch + st.Validators[13].ExitEpoch = 10 + st.Validators[16].ExitEpoch = 10 + s, err := state_native.InitializeFromProtoElectra(st) + require.NoError(t, err) + return s + }(), + reqs: []*enginev1.ConsolidationRequest{ + // Source doesn't have withdrawal credentials. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(1)), + SourcePubkey: []byte("val_3"), + TargetPubkey: []byte("val_4"), + }, + // Source withdrawal credentials don't match the consolidation address. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(0)), // Should be 5 + SourcePubkey: []byte("val_5"), + TargetPubkey: []byte("val_6"), + }, + // Target does not have their withdrawal credentials set appropriately. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(7)), + SourcePubkey: []byte("val_7"), + TargetPubkey: []byte("val_8"), + }, + // Source is inactive. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(9)), + SourcePubkey: []byte("val_9"), + TargetPubkey: []byte("val_10"), + }, + // Target is inactive. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(11)), + SourcePubkey: []byte("val_11"), + TargetPubkey: []byte("val_12"), + }, + // Source is exiting. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(13)), + SourcePubkey: []byte("val_13"), + TargetPubkey: []byte("val_14"), + }, + // Target is exiting. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(15)), + SourcePubkey: []byte("val_15"), + TargetPubkey: []byte("val_16"), + }, + // Source doesn't exist + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(0)), + SourcePubkey: []byte("INVALID"), + TargetPubkey: []byte("val_0"), + }, + // Target doesn't exist + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(0)), + SourcePubkey: []byte("val_0"), + TargetPubkey: []byte("INVALID"), + }, + // Source == target + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(0)), + SourcePubkey: []byte("val_0"), + TargetPubkey: []byte("val_0"), + }, + // Valid consolidation request. This should be last to ensure invalid requests do + // not end the processing early. + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(1)), + SourcePubkey: []byte("val_1"), + TargetPubkey: []byte("val_2"), + }, + }, + validate: func(t *testing.T, st state.BeaconState) { + // Verify a pending consolidation is created. + numPC, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(1), numPC) + pcs, err := st.PendingConsolidations() + require.NoError(t, err) + require.Equal(t, primitives.ValidatorIndex(1), pcs[0].SourceIndex) + require.Equal(t, primitives.ValidatorIndex(2), pcs[0].TargetIndex) + + // Verify the source validator is exiting. + src, err := st.ValidatorAtIndex(1) + require.NoError(t, err) + require.NotEqual(t, params.BeaconConfig().FarFutureEpoch, src.ExitEpoch, "source validator exit epoch not updated") + require.Equal(t, params.BeaconConfig().MinValidatorWithdrawabilityDelay, src.WithdrawableEpoch-src.ExitEpoch, "source validator withdrawable epoch not set correctly") + }, + }, + { + name: "pending consolidations limit reached", + state: func() state.BeaconState { + st := ð.BeaconStateElectra{ + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + PendingConsolidations: make([]*eth.PendingConsolidation, params.BeaconConfig().PendingConsolidationsLimit), + } + s, err := state_native.InitializeFromProtoElectra(st) + require.NoError(t, err) + return s + }(), + reqs: []*enginev1.ConsolidationRequest{ + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(1)), + SourcePubkey: []byte("val_1"), + TargetPubkey: []byte("val_2"), + }, + }, + validate: func(t *testing.T, st state.BeaconState) { + // Verify no pending consolidation is created. + numPC, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().PendingConsolidationsLimit, numPC) + + // Verify the source validator is not exiting. + src, err := st.ValidatorAtIndex(1) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().FarFutureEpoch, src.ExitEpoch, "source validator exit epoch should not be updated") + require.Equal(t, params.BeaconConfig().FarFutureEpoch, src.WithdrawableEpoch, "source validator withdrawable epoch should not be updated") + }, + }, + { + name: "pending consolidations limit reached during processing", + state: func() state.BeaconState { + st := ð.BeaconStateElectra{ + Validators: createValidatorsWithTotalActiveBalance(32000000000000000), // 32M ETH + PendingConsolidations: make([]*eth.PendingConsolidation, params.BeaconConfig().PendingConsolidationsLimit-1), + } + s, err := state_native.InitializeFromProtoElectra(st) + require.NoError(t, err) + return s + }(), + reqs: []*enginev1.ConsolidationRequest{ + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(1)), + SourcePubkey: []byte("val_1"), + TargetPubkey: []byte("val_2"), + }, + { + SourceAddress: append(bytesutil.PadTo(nil, 19), byte(3)), + SourcePubkey: []byte("val_3"), + TargetPubkey: []byte("val_4"), + }, + }, + validate: func(t *testing.T, st state.BeaconState) { + // Verify a pending consolidation is created. + numPC, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().PendingConsolidationsLimit, numPC) + + // The first consolidation was appended. + pcs, err := st.PendingConsolidations() + require.NoError(t, err) + require.Equal(t, primitives.ValidatorIndex(1), pcs[params.BeaconConfig().PendingConsolidationsLimit-1].SourceIndex) + require.Equal(t, primitives.ValidatorIndex(2), pcs[params.BeaconConfig().PendingConsolidationsLimit-1].TargetIndex) + + // Verify the second source validator is not exiting. + src, err := st.ValidatorAtIndex(3) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().FarFutureEpoch, src.ExitEpoch, "source validator exit epoch should not be updated") + require.Equal(t, params.BeaconConfig().FarFutureEpoch, src.WithdrawableEpoch, "source validator withdrawable epoch should not be updated") + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := electra.ProcessConsolidationRequests(context.TODO(), tt.state, tt.reqs) + require.NoError(t, err) + if tt.validate != nil { + tt.validate(t, tt.state) + } + }) + } +} diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index 23ef9a71a052..9726b5d2d042 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -554,7 +554,7 @@ func IsCompoundingWithdrawalCredential(creds []byte) bool { // Check if ``validator`` has a 0x01 or 0x02 prefixed withdrawal credential. // """ // return has_compounding_withdrawal_credential(validator) or has_eth1_withdrawal_credential(validator) -func HasExecutionWithdrawalCredentials(v *ethpb.Validator) bool { +func HasExecutionWithdrawalCredentials(v interfaces.WithWithdrawalCredentials) bool { if v == nil { return false } diff --git a/testing/spectest/mainnet/electra/operations/consolidation_test.go b/testing/spectest/mainnet/electra/operations/consolidation_test.go index 9f6b0208d8cf..3afe9874ec60 100644 --- a/testing/spectest/mainnet/electra/operations/consolidation_test.go +++ b/testing/spectest/mainnet/electra/operations/consolidation_test.go @@ -7,6 +7,5 @@ import ( ) func TestMainnet_Electra_Operations_Consolidation(t *testing.T) { - t.Skip("These tests were temporarily deleted in v1.5.0-alpha.2. See https://github.com/ethereum/consensus-specs/pull/3736") operations.RunConsolidationTest(t, "mainnet") } diff --git a/testing/spectest/shared/electra/operations/consolidations.go b/testing/spectest/shared/electra/operations/consolidations.go index 04f0f0f06837..66091df746ab 100644 --- a/testing/spectest/shared/electra/operations/consolidations.go +++ b/testing/spectest/shared/electra/operations/consolidations.go @@ -1,32 +1,49 @@ package operations import ( + "context" "path" "testing" "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" ) func RunConsolidationTest(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/consolidation/pyspec_tests") + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/consolidation_request/pyspec_tests") require.NotEqual(t, 0, len(testFolders), "missing tests for consolidation operation in folder") for _, folder := range testFolders { t.Run(folder.Name(), func(t *testing.T) { folderPath := path.Join(testsFolderPath, folder.Name()) - consolidationFile, err := util.BazelFileBytes(folderPath, "consolidation.ssz_snappy") + consolidationFile, err := util.BazelFileBytes(folderPath, "consolidation_request.ssz_snappy") require.NoError(t, err) consolidationSSZ, err := snappy.Decode(nil /* dst */, consolidationFile) require.NoError(t, err, "Failed to decompress") consolidation := &enginev1.ConsolidationRequest{} require.NoError(t, consolidation.UnmarshalSSZ(consolidationSSZ), "Failed to unmarshal") - t.Fatal("Implement me") + body := ð.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ + ConsolidationRequests: []*enginev1.ConsolidationRequest{consolidation}, + }} + RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + ed, err := b.Block().Body().Execution() + if err != nil { + return nil, err + } + eed, ok := ed.(interfaces.ExecutionDataElectra) + if !ok { + t.Fatal("block does not have execution data for electra") + } + return s, electra.ProcessConsolidationRequests(ctx, s, eed.ConsolidationRequests()) + }) }) } } From 40434ac209c927bf17c07eed44f0b1472868c920 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 2 Jul 2024 14:25:19 -0500 Subject: [PATCH 173/325] Electra: Unskip passing spectests at v1.5.0-alpha.3 (#14175) --- testing/spectest/mainnet/electra/finality/finality_test.go | 1 - testing/spectest/mainnet/electra/sanity/blocks_test.go | 1 - testing/spectest/shared/electra/rewards/rewards_penalties.go | 1 - testing/spectest/shared/electra/sanity/block_processing.go | 1 - testing/spectest/shared/electra/sanity/slot_processing.go | 1 - 5 files changed, 5 deletions(-) diff --git a/testing/spectest/mainnet/electra/finality/finality_test.go b/testing/spectest/mainnet/electra/finality/finality_test.go index 6b290ca7cc3c..7cebe2685027 100644 --- a/testing/spectest/mainnet/electra/finality/finality_test.go +++ b/testing/spectest/mainnet/electra/finality/finality_test.go @@ -7,6 +7,5 @@ import ( ) func TestMainnet_Electra_Finality(t *testing.T) { - t.Skip("TODO: Electra") finality.RunFinalityTest(t, "mainnet") } diff --git a/testing/spectest/mainnet/electra/sanity/blocks_test.go b/testing/spectest/mainnet/electra/sanity/blocks_test.go index 27cef36e34ba..8e3fc1bcb93e 100644 --- a/testing/spectest/mainnet/electra/sanity/blocks_test.go +++ b/testing/spectest/mainnet/electra/sanity/blocks_test.go @@ -7,6 +7,5 @@ import ( ) func TestMainnet_Electra_Sanity_Blocks(t *testing.T) { - t.Skip("TODO: Electra") sanity.RunBlockProcessingTest(t, "mainnet", "sanity/blocks/pyspec_tests") } diff --git a/testing/spectest/shared/electra/rewards/rewards_penalties.go b/testing/spectest/shared/electra/rewards/rewards_penalties.go index b40bad228235..b89d07b6e5dd 100644 --- a/testing/spectest/shared/electra/rewards/rewards_penalties.go +++ b/testing/spectest/shared/electra/rewards/rewards_penalties.go @@ -39,7 +39,6 @@ func (d *Delta) unmarshalSSZ(buf []byte) error { // RunPrecomputeRewardsAndPenaltiesTests executes "rewards/{basic, leak, random}" tests. func RunPrecomputeRewardsAndPenaltiesTests(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) _, testsFolderPath := utils.TestFolders(t, config, "electra", "rewards") diff --git a/testing/spectest/shared/electra/sanity/block_processing.go b/testing/spectest/shared/electra/sanity/block_processing.go index c18d20d10c63..d7fb00c6213a 100644 --- a/testing/spectest/shared/electra/sanity/block_processing.go +++ b/testing/spectest/shared/electra/sanity/block_processing.go @@ -30,7 +30,6 @@ func init() { // RunBlockProcessingTest executes "sanity/blocks" tests. func RunBlockProcessingTest(t *testing.T, config, folderPath string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", folderPath) diff --git a/testing/spectest/shared/electra/sanity/slot_processing.go b/testing/spectest/shared/electra/sanity/slot_processing.go index 125a6ddcff62..a107afdbdcab 100644 --- a/testing/spectest/shared/electra/sanity/slot_processing.go +++ b/testing/spectest/shared/electra/sanity/slot_processing.go @@ -21,7 +21,6 @@ func init() { // RunSlotProcessingTests executes "sanity/slots" tests. func RunSlotProcessingTests(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "sanity/slots/pyspec_tests") From d6aeaf77b34de70267858ab7b3458d45d48fd538 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 2 Jul 2024 14:33:27 -0500 Subject: [PATCH 174/325] Electra: Unskip state-native tests for spectest v1.5.0-alpha.3 (#14174) --- beacon-chain/state/state-native/getters_withdrawal_test.go | 1 - beacon-chain/state/state-native/setters_churn_test.go | 1 - beacon-chain/state/state-native/state_trie_test.go | 1 - 3 files changed, 3 deletions(-) diff --git a/beacon-chain/state/state-native/getters_withdrawal_test.go b/beacon-chain/state/state-native/getters_withdrawal_test.go index f296f4e6e53d..2b247c255bf8 100644 --- a/beacon-chain/state/state-native/getters_withdrawal_test.go +++ b/beacon-chain/state/state-native/getters_withdrawal_test.go @@ -333,7 +333,6 @@ func TestExpectedWithdrawals(t *testing.T) { } t.Run("electra all pending partial withdrawals", func(t *testing.T) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // This spectest has a fully hydrated beacon state with partial pending withdrawals. serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy") diff --git a/beacon-chain/state/state-native/setters_churn_test.go b/beacon-chain/state/state-native/setters_churn_test.go index eb4b7106e5d3..397932023d3b 100644 --- a/beacon-chain/state/state-native/setters_churn_test.go +++ b/beacon-chain/state/state-native/setters_churn_test.go @@ -15,7 +15,6 @@ import ( ) func TestExitEpochAndUpdateChurn_SpectestCase(t *testing.T) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // The spec tests shows that the exit epoch is 262 for validator 0 performing a voluntary exit. serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/voluntary_exit/pyspec_tests/exit_existing_churn_and_churn_limit_balance/pre.ssz_snappy") diff --git a/beacon-chain/state/state-native/state_trie_test.go b/beacon-chain/state/state-native/state_trie_test.go index 6b36186fe6e3..2fa4858a9f73 100644 --- a/beacon-chain/state/state-native/state_trie_test.go +++ b/beacon-chain/state/state-native/state_trie_test.go @@ -844,7 +844,6 @@ func TestBeaconState_InitializeInactivityScoresCorrectly_Deneb(t *testing.T) { } func TestBeaconChainCopy_Electra(t *testing.T) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") // Load a serialized Electra state from disk. // This is a fully hydrated random test case from spectests. serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/ssz_static/BeaconState/ssz_random/case_0/serialized.ssz_snappy") From 8070fc8ecef3c2003dea7e1fe6dba179ddf76151 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Wed, 3 Jul 2024 15:33:07 +0200 Subject: [PATCH 175/325] Fix slasher disk usage leak. (#14151) * `PruneProposalsAtEpoch`: Test return value in case of nothing to prune. * `TestStore_PruneAttestations_OK`: Create unique validator indexes. Before this commit, `attester2` for `j = n` was the same than `attester1` for `j = n + 1`, resulting in erasure of a lot of attesters. I guess it was not the initial intent. * Slasher pruning: Check if the number of pruned items corresponds to the expectation. Before this commit, if the pruning function did remove a superset of the expected pruned items (including all the items), then the test would pass. * Prune items that should be pruned and stop pruning items that should not be pruned. The first 8 bytes of the key of `attestation-data-roots` and `proposal-records` bytes correspond respectively to an encoded epoch and and encoded slot. The important word in this sentence is "encoded". Before this commit, these slot/epoch are SSZ encoded, which means that they are little-endian encoded. However: - `uint64PrefixGreaterThan` uses `bytes.Compare` which expects big-endian encoded values. - `for k, _ := c.First(); k != nil; k, _ = c.Next()` iters over the keys in big-endian order. The consequence is: - Some items that should be pruned are not pruned, provoking a disk usage leak. - Some items that should not be pruned are pruned, provoking errors like in https://github.com/prysmaticlabs/prysm/issues/13658. This commit encodes the slot/epoch as big-endian before storing them in the database keys. Why this bug has not been detected in unit test before? The values used in unit tests before this commit in `TestStore_PruneProposalsAtEpoch` and `TestStore_PruneAttestations_OK` are `10` and `20`. Unfortunately, checking if `littleEndian(20) > littlenEndien(10)` with the `>` operator considering operands as big-endian encoded returns the expected result... Just replacing `20` by `30` trigs the bug. * Make deepsource happy. * Slasher: Migrate database from little-endian to big-endian. * Update beacon-chain/slasher/service.go Co-authored-by: Preston Van Loon * Update beacon-chain/db/slasherkv/migrate.go Co-authored-by: Preston Van Loon * `TestMigrate`: Fix documentation. --------- Co-authored-by: Preston Van Loon --- beacon-chain/db/iface/interface.go | 1 + beacon-chain/db/slasherkv/BUILD.bazel | 2 + beacon-chain/db/slasherkv/migrate.go | 231 +++++++++++++++++++++ beacon-chain/db/slasherkv/migrate_test.go | 239 ++++++++++++++++++++++ beacon-chain/db/slasherkv/pruning.go | 11 +- beacon-chain/db/slasherkv/pruning_test.go | 58 +++--- beacon-chain/db/slasherkv/slasher.go | 33 +-- beacon-chain/slasher/service.go | 20 ++ 8 files changed, 539 insertions(+), 56 deletions(-) create mode 100644 beacon-chain/db/slasherkv/migrate.go create mode 100644 beacon-chain/db/slasherkv/migrate_test.go diff --git a/beacon-chain/db/iface/interface.go b/beacon-chain/db/iface/interface.go index 9f56e24446a2..82e5a019f7d2 100644 --- a/beacon-chain/db/iface/interface.go +++ b/beacon-chain/db/iface/interface.go @@ -161,6 +161,7 @@ type SlasherDatabase interface { ) ([]*ethpb.HighestAttestation, error) DatabasePath() string ClearDB() error + Migrate(ctx context.Context, headEpoch, maxPruningEpoch primitives.Epoch, batchSize int) error } // Database interface with full access. diff --git a/beacon-chain/db/slasherkv/BUILD.bazel b/beacon-chain/db/slasherkv/BUILD.bazel index 03d3a5105588..5cfdd142b48b 100644 --- a/beacon-chain/db/slasherkv/BUILD.bazel +++ b/beacon-chain/db/slasherkv/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "kv.go", "log.go", "metrics.go", + "migrate.go", "pruning.go", "schema.go", "slasher.go", @@ -37,6 +38,7 @@ go_test( name = "go_default_test", srcs = [ "kv_test.go", + "migrate_test.go", "pruning_test.go", "slasher_test.go", "slasherkv_test.go", diff --git a/beacon-chain/db/slasherkv/migrate.go b/beacon-chain/db/slasherkv/migrate.go new file mode 100644 index 000000000000..ed9ca87ad9af --- /dev/null +++ b/beacon-chain/db/slasherkv/migrate.go @@ -0,0 +1,231 @@ +package slasherkv + +import ( + "context" + "encoding/binary" + "time" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/sirupsen/logrus" + bolt "go.etcd.io/bbolt" +) + +// Migrate , its corresponding usage and tests can be totally removed once Electra is on mainnet. +// Previously, the first 8 bytes of keys of `attestation-data-roots` and `proposal-records` buckets +// were stored as little-endian respectively epoch and slots. It was the source of +// https://github.com/prysmaticlabs/prysm/issues/14142 and potentially +// https://github.com/prysmaticlabs/prysm/issues/13658. +// To solve this (or these) issue(s), we decided to store the first 8 bytes of keys as big-endian. +// See https://github.com/prysmaticlabs/prysm/pull/14151. +// However, not to break the backward compatibility, we need to migrate the existing data. +// The strategy is quite simple: If, for these bucket keys in the store, we detect +// a slot (resp. epoch) higher, than the current slot (resp. epoch), then we consider that the data +// is stored in little-endian. We create a new entry with the same value, but with the slot (resp. epoch) +// part in the key stored as a big-endian. +// We start the iterate by the highest key and iterate down until we reach the current slot (resp. epoch). +func (s *Store) Migrate(ctx context.Context, headEpoch, maxPruningEpoch primitives.Epoch, batchSize int) error { + // Migrate attestations. + log.Info("Starting migration of attestations. This may take a while.") + start := time.Now() + + if err := s.migrateAttestations(ctx, headEpoch, maxPruningEpoch, batchSize); err != nil { + return errors.Wrap(err, "migrate attestations") + } + + log.WithField("duration", time.Since(start)).Info("Migration of attestations completed successfully") + + // Migrate proposals. + log.Info("Starting migration of proposals. This may take a while.") + start = time.Now() + + if err := s.migrateProposals(ctx, headEpoch, maxPruningEpoch, batchSize); err != nil { + return errors.Wrap(err, "migrate proposals") + } + + log.WithField("duration", time.Since(start)).Info("Migration of proposals completed successfully") + + return nil +} + +func (s *Store) migrateAttestations(ctx context.Context, headEpoch, maxPruningEpoch primitives.Epoch, batchSize int) error { + done := false + var epochLittleEndian uint64 + + for !done { + count := 0 + + if err := s.db.Update(func(tx *bolt.Tx) error { + signingRootsBkt := tx.Bucket(attestationDataRootsBucket) + attRecordsBkt := tx.Bucket(attestationRecordsBucket) + + // We begin a migrating iteration starting from the last item in the bucket. + c := signingRootsBkt.Cursor() + for k, v := c.Last(); k != nil; k, v = c.Prev() { + if count >= batchSize { + log.WithField("epoch", epochLittleEndian).Info("Migrated attestations") + + return nil + } + + // Check if the context is done. + if ctx.Err() != nil { + return ctx.Err() + } + + // Extract the epoch encoded in the first 8 bytes of the key. + encodedEpoch := k[:8] + + // Convert it to an uint64, considering it is stored as big-endian. + epochBigEndian := binary.BigEndian.Uint64(encodedEpoch) + + // If the epoch is smaller or equal to the current epoch, we are done. + if epochBigEndian <= uint64(headEpoch) { + break + } + + // Otherwise, we consider that the epoch is stored as little-endian. + epochLittleEndian = binary.LittleEndian.Uint64(encodedEpoch) + + // Increment the count of migrated items. + count++ + + // If the epoch is still higher than the current epoch, then it is an issue. + // This should never happen. + if epochLittleEndian > uint64(headEpoch) { + log.WithFields(logrus.Fields{ + "epochLittleEndian": epochLittleEndian, + "epochBigEndian": epochBigEndian, + "headEpoch": headEpoch, + }).Error("Epoch is higher than the current epoch both if stored as little-endian or as big-endian") + + continue + } + + epoch := primitives.Epoch(epochLittleEndian) + if err := signingRootsBkt.Delete(k); err != nil { + return err + } + + // We don't bother migrating data that is going to be pruned by the pruning routine. + if epoch <= maxPruningEpoch { + if err := attRecordsBkt.Delete(v); err != nil { + return err + } + + continue + } + + // Create a new key with the epoch stored as big-endian. + newK := make([]byte, 8) + binary.BigEndian.PutUint64(newK, uint64(epoch)) + newK = append(newK, k[8:]...) + + // Store the same value with the new key. + if err := signingRootsBkt.Put(newK, v); err != nil { + return err + } + } + + done = true + + return nil + }); err != nil { + return err + } + } + + return nil +} + +func (s *Store) migrateProposals(ctx context.Context, headEpoch, maxPruningEpoch primitives.Epoch, batchSize int) error { + done := false + + if !done { + count := 0 + + // Compute the max pruning slot. + maxPruningSlot, err := slots.EpochEnd(maxPruningEpoch) + if err != nil { + return errors.Wrap(err, "compute max pruning slot") + } + + // Compute the head slot. + headSlot, err := slots.EpochEnd(headEpoch) + if err != nil { + return errors.Wrap(err, "compute head slot") + } + + if err := s.db.Update(func(tx *bolt.Tx) error { + proposalBkt := tx.Bucket(proposalRecordsBucket) + + // We begin a migrating iteration starting from the last item in the bucket. + c := proposalBkt.Cursor() + for k, v := c.Last(); k != nil; k, v = c.Prev() { + if count >= batchSize { + return nil + } + + // Check if the context is done. + if ctx.Err() != nil { + return ctx.Err() + } + + // Extract the slot encoded in the first 8 bytes of the key. + encodedSlot := k[:8] + + // Convert it to an uint64, considering it is stored as big-endian. + slotBigEndian := binary.BigEndian.Uint64(encodedSlot) + + // If the epoch is smaller or equal to the current epoch, we are done. + if slotBigEndian <= uint64(headSlot) { + break + } + + // Otherwise, we consider that the epoch is stored as little-endian. + slotLittleEndian := binary.LittleEndian.Uint64(encodedSlot) + + // If the slot is still higher than the current slot, then it is an issue. + // This should never happen. + if slotLittleEndian > uint64(headSlot) { + log.WithFields(logrus.Fields{ + "slotLittleEndian": slotLittleEndian, + "slotBigEndian": slotBigEndian, + "headSlot": headSlot, + }).Error("Slot is higher than the current slot both if stored as little-endian or as big-endian") + + continue + } + + slot := primitives.Slot(slotLittleEndian) + if err := proposalBkt.Delete(k); err != nil { + return err + } + + // We don't bother migrating data that is going to be pruned by the pruning routine. + if slot <= maxPruningSlot { + continue + } + + // Create a new key with the epoch stored as big-endian. + newK := make([]byte, 8) + binary.BigEndian.PutUint64(newK, uint64(slot)) + newK = append(newK, k[8:]...) + + // Store the same value with the new key. + if err := proposalBkt.Put(newK, v); err != nil { + return err + } + } + + done = true + + return nil + }); err != nil { + return err + } + } + + return nil +} diff --git a/beacon-chain/db/slasherkv/migrate_test.go b/beacon-chain/db/slasherkv/migrate_test.go new file mode 100644 index 000000000000..4f971e079e1e --- /dev/null +++ b/beacon-chain/db/slasherkv/migrate_test.go @@ -0,0 +1,239 @@ +package slasherkv + +import ( + "context" + "encoding/binary" + "testing" + + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/testing/require" + bolt "go.etcd.io/bbolt" +) + +type endianness int + +const ( + bigEndian endianness = iota + littleEndian +) + +func encodeEpochLittleEndian(epoch primitives.Epoch) []byte { + buf := make([]byte, 8) + binary.LittleEndian.PutUint64(buf, uint64(epoch)) + return buf +} + +func createAttestation(signingRootBucket, attRecordsBucket *bolt.Bucket, epoch primitives.Epoch, encoding endianness) error { + // Encode the target epoch. + var key []byte + if encoding == bigEndian { + key = encodeTargetEpoch(epoch) + } else { + key = encodeEpochLittleEndian(epoch) + } + + // Encode the validator index. + encodedValidatorIndex := encodeValidatorIndex(primitives.ValidatorIndex(epoch)) + + // Write the attestation to the database. + key = append(key, encodedValidatorIndex...) + if err := signingRootBucket.Put(key, encodedValidatorIndex); err != nil { + return err + } + + err := attRecordsBucket.Put(encodedValidatorIndex, []byte("dummy")) + + return err +} + +func createProposal(proposalBucket *bolt.Bucket, epoch primitives.Epoch, encoding endianness) error { + // Get the slot for the epoch. + slot := primitives.Slot(epoch) * params.BeaconConfig().SlotsPerEpoch + + // Encode the slot. + key := make([]byte, 8) + if encoding == bigEndian { + binary.BigEndian.PutUint64(key, uint64(slot)) + } else { + binary.LittleEndian.PutUint64(key, uint64(slot)) + } + + // Encode the validator index. + encodedValidatorIndex := encodeValidatorIndex(primitives.ValidatorIndex(slot)) + + // Write the proposal to the database. + key = append(key, encodedValidatorIndex...) + err := proposalBucket.Put(key, []byte("dummy")) + + return err +} + +func TestMigrate(t *testing.T) { + const ( + headEpoch = primitives.Epoch(65000) + maxPruningEpoch = primitives.Epoch(60000) + batchSize = 3 + ) + + /* + State of the DB before migration: + ================================= + + LE: Little-endian encoding + BE: Big-endian encoding + + Attestations: + ------------- + 59000 (LE), 59100 (LE), 59200 (BE), 59300 (LE), 59400 (LE), 59500 (LE), 59600 (LE), 59700 (LE), 59800 (LE), 59900 (LE), + 60000 (LE), 60100 (LE), 60200 (LE), 60300 (LE), 60400 (BE), 60500 (LE), 60600 (LE), 60700 (LE), 60800 (LE), 60900 (LE) + + + Proposals: + ---------- + 59000*32 (LE), 59100*32 (LE), 59200*32 (BE), 59300*32 (LE), 59400*32 (LE), 59500*32 (LE), 59600*32 (LE), 59700*32 (LE), 59800*32 (LE), 59900*32 (LE), + 60000*32 (LE), 60100*32 (LE), 60200*32 (LE), 60300*32 (LE), 60400*32 (BE), 60500*32 (LE), 60600*32 (LE), 60700*32 (LE), 60800*32 (LE), 60900*32 (LE) + + + State of the DB after migration: + ================================ + + Attestations: + ------------- + 59200 (BE), 60100 (BE), 60200 (BE), 60300(BE), 60400 (BE), 60500 (BE), 60600 (BE), 60700 (BE), 60800 (BE), 60900 (BE) + + Proposals: + ---------- + 59200*32 (BE), 60100*32 (BE), 60200*32 (BE), 60300*32 (BE), 60400*32 (BE), 60500*32 (BE), 60600*32 (BE), 60700*32 (BE), 60800*32 (BE), 60900*32 (BE) + + */ + + beforeLittleEndianEpochs := []primitives.Epoch{ + 59000, 59100, 59300, 59400, 59500, 59600, 59700, 59800, 59900, + 60000, 60100, 60200, 60300, 60500, 60600, 60700, 60800, 60900, + } + + beforeBigEndianEpochs := []primitives.Epoch{59200, 60400} + + afterBigEndianEpochs := []primitives.Epoch{ + 59200, 60100, 60200, 60300, 60400, 60500, 60600, 60700, 60800, 60900, + } + + // Create a new context. + ctx := context.Background() + + // Setup a test database. + beaconDB := setupDB(t) + + // Write attestations and proposals to the database. + err := beaconDB.db.Update(func(tx *bolt.Tx) error { + signingRootsBkt := tx.Bucket(attestationDataRootsBucket) + attRecordsBkt := tx.Bucket(attestationRecordsBucket) + proposalBkt := tx.Bucket(proposalRecordsBucket) + + // Create attestations with little-endian encoding. + for _, epoch := range beforeLittleEndianEpochs { + if err := createAttestation(signingRootsBkt, attRecordsBkt, epoch, littleEndian); err != nil { + return err + } + } + + // Create attestations with big-endian encoding. + for _, epoch := range beforeBigEndianEpochs { + if err := createAttestation(signingRootsBkt, attRecordsBkt, epoch, bigEndian); err != nil { + return err + } + } + + // Create proposals with little-endian encoding. + for _, epoch := range beforeLittleEndianEpochs { + if err := createProposal(proposalBkt, epoch, littleEndian); err != nil { + return err + } + } + + // Create proposals with big-endian encoding. + for _, epoch := range beforeBigEndianEpochs { + if err := createProposal(proposalBkt, epoch, bigEndian); err != nil { + return err + } + } + + return nil + }) + + require.NoError(t, err) + + // Migrate the database. + err = beaconDB.Migrate(ctx, headEpoch, maxPruningEpoch, batchSize) + require.NoError(t, err) + + // Check the state of the database after migration. + err = beaconDB.db.View(func(tx *bolt.Tx) error { + signingRootsBkt := tx.Bucket(attestationDataRootsBucket) + attRecordsBkt := tx.Bucket(attestationRecordsBucket) + proposalBkt := tx.Bucket(proposalRecordsBucket) + + // Check that all the expected attestations are in the store. + for _, epoch := range afterBigEndianEpochs { + // Check if the attestation exists. + key := encodeTargetEpoch(epoch) + encodedValidatorIndex := encodeValidatorIndex(primitives.ValidatorIndex(epoch)) + key = append(key, encodedValidatorIndex...) + + // Check the signing root bucket. + indexedAtt := signingRootsBkt.Get(key) + require.DeepSSZEqual(t, encodedValidatorIndex, indexedAtt) + + // Check the attestation records bucket. + attestationRecord := attRecordsBkt.Get(encodedValidatorIndex) + require.DeepSSZEqual(t, []byte("dummy"), attestationRecord) + } + + // Check only the expected attestations are in the store. + c := signingRootsBkt.Cursor() + count := 0 + for k, _ := c.First(); k != nil; k, _ = c.Next() { + count++ + } + + require.Equal(t, len(afterBigEndianEpochs), count) + + c = attRecordsBkt.Cursor() + count = 0 + for k, _ := c.First(); k != nil; k, _ = c.Next() { + count++ + } + + require.Equal(t, len(afterBigEndianEpochs), count) + + // Check that all the expected proposals are in the store. + slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch + + for _, epoch := range afterBigEndianEpochs { + // Check if the proposal exists. + slot := primitives.Slot(epoch) * slotsPerEpoch + key := make([]byte, 8) + binary.BigEndian.PutUint64(key, uint64(slot)) + encodedValidatorIndex := encodeValidatorIndex(primitives.ValidatorIndex(slot)) + key = append(key, encodedValidatorIndex...) + + // Check the proposal bucket. + proposal := proposalBkt.Get(key) + require.DeepEqual(t, []byte("dummy"), proposal) + } + + // Check only the expected proposals are in the store. + c = proposalBkt.Cursor() + count = 0 + for k, _ := c.First(); k != nil; k, _ = c.Next() { + count++ + } + + require.Equal(t, len(afterBigEndianEpochs), count) + + return nil + }) + + require.NoError(t, err) +} diff --git a/beacon-chain/db/slasherkv/pruning.go b/beacon-chain/db/slasherkv/pruning.go index a5916f0b27d8..500b132c7f68 100644 --- a/beacon-chain/db/slasherkv/pruning.go +++ b/beacon-chain/db/slasherkv/pruning.go @@ -5,7 +5,6 @@ import ( "context" "encoding/binary" - fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/time/slots" bolt "go.etcd.io/bbolt" @@ -17,7 +16,8 @@ func (s *Store) PruneAttestationsAtEpoch( _ context.Context, maxEpoch primitives.Epoch, ) (numPruned uint, err error) { // We can prune everything less than the current epoch - history length. - encodedEndPruneEpoch := fssz.MarshalUint64([]byte{}, uint64(maxEpoch)) + encodedEndPruneEpoch := make([]byte, 8) + binary.BigEndian.PutUint64(encodedEndPruneEpoch, uint64(maxEpoch)) // We retrieve the lowest stored epoch in the attestations bucket. var lowestEpoch primitives.Epoch @@ -30,7 +30,7 @@ func (s *Store) PruneAttestationsAtEpoch( return nil } hasData = true - lowestEpoch = primitives.Epoch(binary.LittleEndian.Uint64(k)) + lowestEpoch = primitives.Epoch(binary.BigEndian.Uint64(k)) return nil }); err != nil { return @@ -92,7 +92,8 @@ func (s *Store) PruneProposalsAtEpoch( if err != nil { return } - encodedEndPruneSlot := fssz.MarshalUint64([]byte{}, uint64(endPruneSlot)) + encodedEndPruneSlot := make([]byte, 8) + binary.BigEndian.PutUint64(encodedEndPruneSlot, uint64(endPruneSlot)) // We retrieve the lowest stored slot in the proposals bucket. var lowestSlot primitives.Slot @@ -157,7 +158,7 @@ func (s *Store) PruneProposalsAtEpoch( } func slotFromProposalKey(key []byte) primitives.Slot { - return primitives.Slot(binary.LittleEndian.Uint64(key[:8])) + return primitives.Slot(binary.BigEndian.Uint64(key[:8])) } func uint64PrefixGreaterThan(key, lessThan []byte) bool { diff --git a/beacon-chain/db/slasherkv/pruning_test.go b/beacon-chain/db/slasherkv/pruning_test.go index aae3a4662e70..131fdcbd664b 100644 --- a/beacon-chain/db/slasherkv/pruning_test.go +++ b/beacon-chain/db/slasherkv/pruning_test.go @@ -23,9 +23,9 @@ func TestStore_PruneProposalsAtEpoch(t *testing.T) { hook := logTest.NewGlobal() beaconDB := setupDB(t) - // With a current epoch of 20 and a history length of 10, we should be pruning - // everything before epoch (20 - 10) = 10. - currentEpoch := primitives.Epoch(20) + // With a current epoch of 30 and a history length of 10, we should be pruning + // everything before epoch (30 - 10) = 20. + currentEpoch := primitives.Epoch(30) historyLength := primitives.Epoch(10) pruningLimitEpoch := currentEpoch - historyLength @@ -34,16 +34,14 @@ func TestStore_PruneProposalsAtEpoch(t *testing.T) { err = beaconDB.db.Update(func(tx *bolt.Tx) error { bkt := tx.Bucket(proposalRecordsBucket) - key, err := keyForValidatorProposal(lowestStoredSlot+1, 0 /* proposer index */) - if err != nil { - return err - } + key := keyForValidatorProposal(lowestStoredSlot+1, 0 /* proposer index */) return bkt.Put(key, []byte("hi")) }) require.NoError(t, err) - _, err = beaconDB.PruneProposalsAtEpoch(ctx, pruningLimitEpoch) + numPruned, err := beaconDB.PruneProposalsAtEpoch(ctx, pruningLimitEpoch) require.NoError(t, err) + require.Equal(t, uint(0), numPruned) expectedLog := fmt.Sprintf( "Lowest slot %d is > pruning slot %d, nothing to prune", lowestStoredSlot+1, lowestStoredSlot, ) @@ -59,12 +57,14 @@ func TestStore_PruneProposalsAtEpoch(t *testing.T) { params.OverrideBeaconConfig(config) historyLength := primitives.Epoch(10) - currentEpoch := primitives.Epoch(20) + currentEpoch := primitives.Epoch(30) pruningLimitEpoch := currentEpoch - historyLength // We create proposals from genesis to the current epoch, with 2 proposals // at each slot to ensure the entire pruning logic works correctly. slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch + expectedNumPruned := 2 * uint(pruningLimitEpoch+1) * uint(slotsPerEpoch) + proposals := make([]*slashertypes.SignedBlockHeaderWrapper, 0, uint64(currentEpoch)*uint64(slotsPerEpoch)*2) for i := primitives.Epoch(0); i < currentEpoch; i++ { startSlot, err := slots.EpochStart(i) @@ -81,8 +81,9 @@ func TestStore_PruneProposalsAtEpoch(t *testing.T) { require.NoError(t, beaconDB.SaveBlockProposals(ctx, proposals)) // We expect pruning completes without an issue and properly logs progress. - _, err := beaconDB.PruneProposalsAtEpoch(ctx, pruningLimitEpoch) + actualNumPruned, err := beaconDB.PruneProposalsAtEpoch(ctx, pruningLimitEpoch) require.NoError(t, err) + require.Equal(t, expectedNumPruned, actualNumPruned) // Everything before epoch 10 should be deleted. for i := primitives.Epoch(0); i < pruningLimitEpoch; i++ { @@ -93,14 +94,8 @@ func TestStore_PruneProposalsAtEpoch(t *testing.T) { endSlot, err := slots.EpochStart(i + 1) require.NoError(t, err) for j := startSlot; j < endSlot; j++ { - prop1Key, err := keyForValidatorProposal(j, 0) - if err != nil { - return err - } - prop2Key, err := keyForValidatorProposal(j, 1) - if err != nil { - return err - } + prop1Key := keyForValidatorProposal(j, 0) + prop2Key := keyForValidatorProposal(j, 1) if bkt.Get(prop1Key) != nil { return fmt.Errorf("proposal still exists for epoch %d, validator 0", j) } @@ -124,9 +119,9 @@ func TestStore_PruneAttestations_OK(t *testing.T) { hook := logTest.NewGlobal() beaconDB := setupDB(t) - // With a current epoch of 20 and a history length of 10, we should be pruning - // everything before epoch (20 - 10) = 10. - currentEpoch := primitives.Epoch(20) + // With a current epoch of 30 and a history length of 10, we should be pruning + // everything before epoch (30 - 10) = 20. + currentEpoch := primitives.Epoch(30) historyLength := primitives.Epoch(10) pruningLimitEpoch := currentEpoch - historyLength @@ -134,14 +129,16 @@ func TestStore_PruneAttestations_OK(t *testing.T) { err := beaconDB.db.Update(func(tx *bolt.Tx) error { bkt := tx.Bucket(attestationDataRootsBucket) - encIdx := encodeValidatorIndex(primitives.ValidatorIndex(0)) - encodedTargetEpoch := encodeTargetEpoch(lowestStoredEpoch + 1) - key := append(encodedTargetEpoch, encIdx...) + key := append( + encodeTargetEpoch(lowestStoredEpoch+1), + encodeValidatorIndex(primitives.ValidatorIndex(0))..., + ) return bkt.Put(key, []byte("hi")) }) require.NoError(t, err) - _, err = beaconDB.PruneAttestationsAtEpoch(ctx, pruningLimitEpoch) + numPruned, err := beaconDB.PruneAttestationsAtEpoch(ctx, pruningLimitEpoch) + require.Equal(t, uint(0), numPruned) require.NoError(t, err) expectedLog := fmt.Sprintf( "Lowest epoch %d is > pruning epoch %d, nothing to prune", lowestStoredEpoch+1, lowestStoredEpoch, @@ -158,12 +155,14 @@ func TestStore_PruneAttestations_OK(t *testing.T) { params.OverrideBeaconConfig(config) historyLength := primitives.Epoch(10) - currentEpoch := primitives.Epoch(20) + currentEpoch := primitives.Epoch(30) pruningLimitEpoch := currentEpoch - historyLength // We create attestations from genesis to the current epoch, with 2 attestations // at each slot to ensure the entire pruning logic works correctly. slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch + expectedNumPruned := 2 * uint(pruningLimitEpoch+1) * uint(slotsPerEpoch) + attestations := make([]*slashertypes.IndexedAttestationWrapper, 0, uint64(currentEpoch)*uint64(slotsPerEpoch)*2) for i := primitives.Epoch(0); i < currentEpoch; i++ { startSlot, err := slots.EpochStart(i) @@ -171,8 +170,8 @@ func TestStore_PruneAttestations_OK(t *testing.T) { endSlot, err := slots.EpochStart(i + 1) require.NoError(t, err) for j := startSlot; j < endSlot; j++ { - attester1 := uint64(j + 10) - attester2 := uint64(j + 11) + attester1 := uint64(2 * j) + attester2 := uint64(2*j + 1) target := i var source primitives.Epoch if i > 0 { @@ -187,8 +186,9 @@ func TestStore_PruneAttestations_OK(t *testing.T) { require.NoError(t, beaconDB.SaveAttestationRecordsForValidators(ctx, attestations)) // We expect pruning completes without an issue. - _, err := beaconDB.PruneAttestationsAtEpoch(ctx, pruningLimitEpoch) + actualNumPruned, err := beaconDB.PruneAttestationsAtEpoch(ctx, pruningLimitEpoch) require.NoError(t, err) + require.Equal(t, expectedNumPruned, actualNumPruned) // Everything before epoch 10 should be deleted. for i := primitives.Epoch(0); i < pruningLimitEpoch; i++ { diff --git a/beacon-chain/db/slasherkv/slasher.go b/beacon-chain/db/slasherkv/slasher.go index 1c558e3c59d5..2d52da30ee0e 100644 --- a/beacon-chain/db/slasherkv/slasher.go +++ b/beacon-chain/db/slasherkv/slasher.go @@ -484,15 +484,11 @@ func (s *Store) CheckDoubleBlockProposals( for _, incomingProposal := range incomingProposals { // Build the key corresponding to this slot + validator index combination - key, err := keyForValidatorProposal( + key := keyForValidatorProposal( incomingProposal.SignedBeaconBlockHeader.Header.Slot, incomingProposal.SignedBeaconBlockHeader.Header.ProposerIndex, ) - if err != nil { - return err - } - // Retrieve the existing proposal record from the database encExistingProposalWrapper := bkt.Get(key) @@ -531,11 +527,9 @@ func (s *Store) BlockProposalForValidator( _, span := trace.StartSpan(ctx, "BeaconDB.BlockProposalForValidator") defer span.End() var record *slashertypes.SignedBlockHeaderWrapper - key, err := keyForValidatorProposal(slot, validatorIdx) - if err != nil { - return nil, err - } - err = s.db.View(func(tx *bolt.Tx) error { + key := keyForValidatorProposal(slot, validatorIdx) + + err := s.db.View(func(tx *bolt.Tx) error { bkt := tx.Bucket(proposalRecordsBucket) encProposal := bkt.Get(key) if encProposal == nil { @@ -567,13 +561,10 @@ func (s *Store) SaveBlockProposals( // Loop over all proposals to encode keys and proposals themselves. for i, proposal := range proposals { // Encode the key for this proposal. - key, err := keyForValidatorProposal( + key := keyForValidatorProposal( proposal.SignedBeaconBlockHeader.Header.Slot, proposal.SignedBeaconBlockHeader.Header.ProposerIndex, ) - if err != nil { - return err - } // Encode the proposal itself. enc, err := encodeProposalRecord(proposal) @@ -657,13 +648,11 @@ func suffixForAttestationRecordsKey(key, encodedValidatorIndex []byte) bool { } // keyForValidatorProposal returns a disk key for a validator proposal, including a slot+validatorIndex as a byte slice. -func keyForValidatorProposal(slot primitives.Slot, proposerIndex primitives.ValidatorIndex) ([]byte, error) { - encSlot, err := slot.MarshalSSZ() - if err != nil { - return nil, err - } +func keyForValidatorProposal(slot primitives.Slot, proposerIndex primitives.ValidatorIndex) []byte { + encSlot := make([]byte, 8) + binary.BigEndian.PutUint64(encSlot, uint64(slot)) encValidatorIdx := encodeValidatorIndex(proposerIndex) - return append(encSlot, encValidatorIdx...), nil + return append(encSlot, encValidatorIdx...) } func encodeSlasherChunk(chunk []uint16) ([]byte, error) { @@ -780,10 +769,10 @@ func decodeProposalRecord(encoded []byte) (*slashertypes.SignedBlockHeaderWrappe }, nil } -// Encodes an epoch into little-endian bytes. +// Encodes an epoch into big-endian bytes. func encodeTargetEpoch(epoch primitives.Epoch) []byte { buf := make([]byte, 8) - binary.LittleEndian.PutUint64(buf, uint64(epoch)) + binary.BigEndian.PutUint64(buf, uint64(epoch)) return buf } diff --git a/beacon-chain/slasher/service.go b/beacon-chain/slasher/service.go index d4c78994f9a0..f293886238a1 100644 --- a/beacon-chain/slasher/service.go +++ b/beacon-chain/slasher/service.go @@ -121,6 +121,26 @@ func (s *Service) run() { indexedAttsChan := make(chan *types.WrappedIndexedAtt, 1) beaconBlockHeadersChan := make(chan *ethpb.SignedBeaconBlockHeader, 1) + // This section can be totally removed once Electra is on mainnet. + headSlot := s.serviceCfg.HeadStateFetcher.HeadSlot() + headEpoch := slots.ToEpoch(headSlot) + + maxPruningEpoch := primitives.Epoch(0) + if headEpoch >= s.params.historyLength { + maxPruningEpoch = headEpoch - s.params.historyLength + } + + // For database performance reasons, database read/write operations + // are chunked into batches of maximum `batchSize` elements. + const migrationBatchSize = 100_000 + + err = s.serviceCfg.Database.Migrate(s.ctx, headEpoch, maxPruningEpoch, migrationBatchSize) + if err != nil { + log.WithError(err).Error("Failed to migrate slasher database") + return + } + // End of section that can be removed once Electra is on mainnet. + s.wg.Add(1) go s.receiveAttestations(s.ctx, indexedAttsChan) From 7a394062e1054d73014e793819cb9cf0d20ff2e3 Mon Sep 17 00:00:00 2001 From: Khanh Hoa <49144992+hoanguyenkh@users.noreply.github.com> Date: Fri, 5 Jul 2024 05:40:13 +0700 Subject: [PATCH 176/325] refactor: enable errorlint and refactor code (#14110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: enable errorlint and refactor code * revert * revert * add bazel * gofmt * gofmt * gofmt * gofmt * gci * lint --------- Co-authored-by: Radosław Kapka --- .golangci.yml | 1 - api/client/beacon/checkpoint_test.go | 14 ++++++------- api/client/builder/BUILD.bazel | 1 + api/client/builder/types_test.go | 4 +++- api/server/error.go | 4 +++- api/server/structs/conversions.go | 5 ++--- beacon-chain/blockchain/chain_info.go | 3 +-- beacon-chain/blockchain/execution_engine.go | 15 +++++++------ beacon-chain/blockchain/lightclient.go | 18 ++++++++-------- beacon-chain/blockchain/process_block.go | 5 ++--- .../blockchain/process_block_helpers.go | 5 ++--- beacon-chain/blockchain/service.go | 5 ++--- beacon-chain/core/helpers/sync_committee.go | 8 +++---- beacon-chain/execution/engine_client.go | 11 ++++++---- beacon-chain/node/node.go | 2 +- beacon-chain/node/prometheus.go | 2 +- beacon-chain/node/registration/log.go | 4 ---- beacon-chain/node/registration/p2p.go | 4 +++- beacon-chain/p2p/handshake.go | 2 +- beacon-chain/p2p/options.go | 1 - beacon-chain/p2p/pubsub.go | 4 ++-- beacon-chain/p2p/subnets.go | 5 ++--- beacon-chain/p2p/types/rpc_goodbye_codes.go | 6 ++++-- beacon-chain/rpc/eth/beacon/handlers_pool.go | 12 +++++------ beacon-chain/rpc/eth/beacon/handlers_state.go | 13 ++++++------ beacon-chain/rpc/eth/beacon/handlers_test.go | 7 +++---- .../rpc/eth/beacon/handlers_validator.go | 5 +++-- beacon-chain/rpc/eth/config/handlers_test.go | 1 - .../rpc/eth/helpers/error_handling.go | 9 +++++--- beacon-chain/rpc/eth/helpers/sync_test.go | 4 ++-- beacon-chain/rpc/eth/light-client/handlers.go | 16 +++++++------- .../rpc/eth/light-client/handlers_test.go | 1 - beacon-chain/rpc/eth/shared/BUILD.bazel | 1 + beacon-chain/rpc/eth/shared/errors.go | 10 ++++++--- beacon-chain/rpc/eth/validator/handlers.go | 21 ++++++++++--------- beacon-chain/rpc/lookup/stater_test.go | 7 +++---- .../rpc/prysm/beacon/validator_count.go | 6 +++--- .../rpc/prysm/beacon/validator_count_test.go | 10 ++++----- .../prysm/v1alpha1/beacon/slashings_test.go | 11 +++++----- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../rpc/prysm/v1alpha1/validator/status.go | 4 ++-- beacon-chain/rpc/testutil/mock_stater.go | 3 +-- beacon-chain/state/stategen/history_test.go | 3 +-- .../state/testing/getters_checkpoint.go | 4 ++-- beacon-chain/sync/backfill/status_test.go | 5 ++--- beacon-chain/sync/genesis/file.go | 5 ++--- beacon-chain/sync/rpc.go | 7 ++++--- .../sync/rpc_beacon_blocks_by_range_test.go | 3 ++- beacon-chain/sync/rpc_status.go | 6 +++--- beacon-chain/sync/subscriber.go | 2 +- beacon-chain/verification/blob_test.go | 3 ++- beacon-chain/verification/cache.go | 5 ++--- cmd/prysmctl/p2p/handler.go | 7 ++++--- cmd/prysmctl/testnet/generate_genesis.go | 6 +++--- config/features/config.go | 5 ++--- config/params/loader.go | 3 ++- consensus-types/blocks/proto.go | 16 +++++++------- encoding/ssz/detect/configfork.go | 11 +++++----- encoding/ssz/detect/configfork_test.go | 7 +++---- io/file/fileutil.go | 4 ++-- monitoring/clientstats/updaters.go | 2 +- runtime/interop/generate_keys.go | 3 +-- .../formatter_test.go | 5 ++--- .../logrus_prefixed_formatter_suite_test.go | 4 ++-- runtime/tos/tos.go | 3 +-- .../components/eth1/depositor_test.go | 1 - .../endtoend/components/eth1/transactions.go | 2 +- testing/endtoend/endtoend_test.go | 15 +++++++------ testing/endtoend/evaluators/fork.go | 8 +++---- testing/endtoend/params/params.go | 3 +-- testing/middleware/builder/builder.go | 3 +-- .../shared/common/forkchoice/runner.go | 4 +++- .../logruswitherror/testdata/src/a/a.go | 2 +- tools/replay-http/BUILD.bazel | 5 ++++- tools/replay-http/main.go | 3 ++- validator/accounts/userprompt/prompt.go | 8 +++---- validator/client/aggregate_test.go | 3 +-- .../client/beacon-api/beacon_api_helpers.go | 1 - .../beacon_api_validator_client_test.go | 7 +++---- .../beacon-api/beacon_committee_selections.go | 3 +-- .../beacon_committee_selections_test.go | 3 +-- validator/client/beacon-api/doppelganger.go | 3 +-- validator/client/beacon-api/status.go | 3 +-- validator/client/beacon-api/status_test.go | 5 ++--- .../grpc_prysm_beacon_chain_client.go | 7 +++---- validator/client/iface/validator_client.go | 3 +-- validator/client/key_reload.go | 3 +-- validator/client/key_reload_test.go | 5 ++--- validator/client/sync_committee.go | 5 ++--- validator/client/validator.go | 2 +- validator/client/wait_for_activation_test.go | 7 +++---- validator/db/common/progress.go | 1 - validator/db/convert.go | 7 +++---- validator/db/convert_test.go | 1 - validator/db/filesystem/db.go | 5 ++--- validator/db/filesystem/db_test.go | 1 - validator/db/filesystem/proposer_settings.go | 1 - .../db/filesystem/proposer_settings_test.go | 4 ++-- validator/graffiti/BUILD.bazel | 1 + validator/graffiti/parse_graffiti.go | 4 +++- validator/helpers/metadata_test.go | 1 - .../remote-web3signer/v1/custom_mappers.go | 20 +++++++++--------- validator/rpc/handler_wallet.go | 6 +++--- validator/rpc/handlers_accounts.go | 6 +++--- validator/rpc/handlers_keymanager.go | 18 ++++++++-------- validator/rpc/handlers_slashing.go | 2 +- 106 files changed, 279 insertions(+), 304 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 92f26ea20900..2a5b771b78d4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -34,7 +34,6 @@ linters: - dogsled - dupl - durationcheck - - errorlint - exhaustive - exhaustruct - forbidigo diff --git a/api/client/beacon/checkpoint_test.go b/api/client/beacon/checkpoint_test.go index 232a9914c269..250608ebf99d 100644 --- a/api/client/beacon/checkpoint_test.go +++ b/api/client/beacon/checkpoint_test.go @@ -9,22 +9,20 @@ import ( "net/http" "testing" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/client" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" blocktest "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks/testing" - "github.com/prysmaticlabs/prysm/v5/network/forks" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "github.com/prysmaticlabs/prysm/v5/time/slots" - - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/ssz/detect" + "github.com/prysmaticlabs/prysm/v5/network/forks" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" ) type testRT struct { diff --git a/api/client/builder/BUILD.bazel b/api/client/builder/BUILD.bazel index 6248a2051e75..e8dd1ce1a27a 100644 --- a/api/client/builder/BUILD.bazel +++ b/api/client/builder/BUILD.bazel @@ -55,6 +55,7 @@ go_test( "//testing/assert:go_default_library", "//testing/require:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", ], diff --git a/api/client/builder/types_test.go b/api/client/builder/types_test.go index 0bc6b1b57c50..fbcf5a854e7f 100644 --- a/api/client/builder/types_test.go +++ b/api/client/builder/types_test.go @@ -12,6 +12,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/api/server/structs" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -1914,7 +1915,8 @@ func TestEmptyResponseBody(t *testing.T) { var b []byte r := &ExecutionPayloadResponse{} err := json.Unmarshal(b, r) - _, ok := err.(*json.SyntaxError) + var syntaxError *json.SyntaxError + ok := errors.As(err, &syntaxError) require.Equal(t, true, ok) }) t.Run("empty object", func(t *testing.T) { diff --git a/api/server/error.go b/api/server/error.go index 809fcae01744..feb09facb8ec 100644 --- a/api/server/error.go +++ b/api/server/error.go @@ -1,6 +1,7 @@ package server import ( + "errors" "fmt" "strings" ) @@ -15,7 +16,8 @@ type DecodeError struct { // NewDecodeError wraps an error (either the initial decoding error or another DecodeError). // The current field that failed decoding must be passed in. func NewDecodeError(err error, field string) *DecodeError { - de, ok := err.(*DecodeError) + var de *DecodeError + ok := errors.As(err, &de) if ok { return &DecodeError{path: append([]string{field}, de.path...), err: de.err} } diff --git a/api/server/structs/conversions.go b/api/server/structs/conversions.go index 4cee5e8964d6..6e1b66ed9852 100644 --- a/api/server/structs/conversions.go +++ b/api/server/structs/conversions.go @@ -8,11 +8,10 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server" - "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" - "github.com/prysmaticlabs/prysm/v5/container/slice" - fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" + "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" diff --git a/beacon-chain/blockchain/chain_info.go b/beacon-chain/blockchain/chain_info.go index f6a6e5dec924..e3fbac167eb7 100644 --- a/beacon-chain/blockchain/chain_info.go +++ b/beacon-chain/blockchain/chain_info.go @@ -6,8 +6,6 @@ import ( "time" "github.com/pkg/errors" - "go.opencensus.io/trace" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" f "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" @@ -20,6 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" + "go.opencensus.io/trace" ) // ChainInfoFetcher defines a common interface for methods in blockchain service which diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 3ef06e3f443d..f6e287f4c525 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -74,8 +74,8 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *fcuConfig) (* } payloadID, lastValidHash, err := s.cfg.ExecutionEngineCaller.ForkchoiceUpdated(ctx, fcs, arg.attributes) if err != nil { - switch err { - case execution.ErrAcceptedSyncingPayloadStatus: + switch { + case errors.Is(err, execution.ErrAcceptedSyncingPayloadStatus): forkchoiceUpdatedOptimisticNodeCount.Inc() log.WithFields(logrus.Fields{ "headSlot": headBlk.Slot(), @@ -83,7 +83,7 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *fcuConfig) (* "finalizedPayloadBlockHash": fmt.Sprintf("%#x", bytesutil.Trunc(finalizedHash[:])), }).Info("Called fork choice updated with optimistic block") return payloadID, nil - case execution.ErrInvalidPayloadStatus: + case errors.Is(err, execution.ErrInvalidPayloadStatus): forkchoiceUpdatedInvalidNodeCount.Inc() headRoot := arg.headRoot if len(lastValidHash) == 0 { @@ -139,7 +139,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *fcuConfig) (* "newHeadRoot": fmt.Sprintf("%#x", bytesutil.Trunc(r[:])), }).Warn("Pruned invalid blocks") return pid, invalidBlock{error: ErrInvalidPayload, root: arg.headRoot, invalidAncestorRoots: invalidRoots} - default: log.WithError(err).Error(ErrUndefinedExecutionEngineError) return nil, nil @@ -231,18 +230,18 @@ func (s *Service) notifyNewPayload(ctx context.Context, preStateVersion int, } else { lastValidHash, err = s.cfg.ExecutionEngineCaller.NewPayload(ctx, payload, []common.Hash{}, &common.Hash{} /*empty version hashes and root before Deneb*/) } - switch err { - case nil: + switch { + case err == nil: newPayloadValidNodeCount.Inc() return true, nil - case execution.ErrAcceptedSyncingPayloadStatus: + case errors.Is(err, execution.ErrAcceptedSyncingPayloadStatus): newPayloadOptimisticNodeCount.Inc() log.WithFields(logrus.Fields{ "slot": blk.Block().Slot(), "payloadBlockHash": fmt.Sprintf("%#x", bytesutil.Trunc(payload.BlockHash())), }).Info("Called new payload with optimistic block") return false, nil - case execution.ErrInvalidPayloadStatus: + case errors.Is(err, execution.ErrInvalidPayloadStatus): lvh := bytesutil.ToBytes32(lastValidHash) return false, invalidBlock{ error: ErrInvalidPayload, diff --git a/beacon-chain/blockchain/lightclient.go b/beacon-chain/blockchain/lightclient.go index 1183b1d577d4..4a6890659510 100644 --- a/beacon-chain/blockchain/lightclient.go +++ b/beacon-chain/blockchain/lightclient.go @@ -69,7 +69,7 @@ func NewLightClientOptimisticUpdateFromBeaconState( // assert sum(block.message.body.sync_aggregate.sync_committee_bits) >= MIN_SYNC_COMMITTEE_PARTICIPANTS syncAggregate, err := block.Block().Body().SyncAggregate() if err != nil { - return nil, fmt.Errorf("could not get sync aggregate %v", err) + return nil, fmt.Errorf("could not get sync aggregate %w", err) } if syncAggregate.SyncCommitteeBits.Count() < params.BeaconConfig().MinSyncCommitteeParticipants { @@ -85,18 +85,18 @@ func NewLightClientOptimisticUpdateFromBeaconState( header := state.LatestBlockHeader() stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get state root %v", err) + return nil, fmt.Errorf("could not get state root %w", err) } header.StateRoot = stateRoot[:] headerRoot, err := header.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get header root %v", err) + return nil, fmt.Errorf("could not get header root %w", err) } blockRoot, err := block.Block().HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get block root %v", err) + return nil, fmt.Errorf("could not get block root %w", err) } if headerRoot != blockRoot { @@ -114,14 +114,14 @@ func NewLightClientOptimisticUpdateFromBeaconState( // attested_header.state_root = hash_tree_root(attested_state) attestedStateRoot, err := attestedState.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get attested state root %v", err) + return nil, fmt.Errorf("could not get attested state root %w", err) } attestedHeader.StateRoot = attestedStateRoot[:] // assert hash_tree_root(attested_header) == block.message.parent_root attestedHeaderRoot, err := attestedHeader.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get attested header root %v", err) + return nil, fmt.Errorf("could not get attested header root %w", err) } if attestedHeaderRoot != block.Block().ParentRoot() { @@ -175,13 +175,13 @@ func NewLightClientFinalityUpdateFromBeaconState( if finalizedBlock.Block().Slot() != 0 { tempFinalizedHeader, err := finalizedBlock.Header() if err != nil { - return nil, fmt.Errorf("could not get finalized header %v", err) + return nil, fmt.Errorf("could not get finalized header %w", err) } finalizedHeader = migration.V1Alpha1SignedHeaderToV1(tempFinalizedHeader).GetMessage() finalizedHeaderRoot, err := finalizedHeader.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get finalized header root %v", err) + return nil, fmt.Errorf("could not get finalized header root %w", err) } if finalizedHeaderRoot != bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root) { @@ -204,7 +204,7 @@ func NewLightClientFinalityUpdateFromBeaconState( var bErr error finalityBranch, bErr = attestedState.FinalizedRootProof(ctx) if bErr != nil { - return nil, fmt.Errorf("could not get finalized root proof %v", bErr) + return nil, fmt.Errorf("could not get finalized root proof %w", bErr) } } else { finalizedHeader = ðpbv1.BeaconBlockHeader{ diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 1ea9e28a5dc5..fc52ca2b0b9d 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -6,9 +6,6 @@ import ( "time" "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "go.opencensus.io/trace" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" @@ -32,6 +29,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/sirupsen/logrus" + "go.opencensus.io/trace" ) // A custom slot deadline for processing state slots in our cache. diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 810be735abf9..5e1e7a3e6ef6 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -7,9 +7,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "go.opencensus.io/trace" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" @@ -25,6 +22,8 @@ import ( ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/sirupsen/logrus" + "go.opencensus.io/trace" ) // CurrentSlot returns the current slot based on time. diff --git a/beacon-chain/blockchain/service.go b/beacon-chain/blockchain/service.go index 52dea5958bb8..efbc70c7941f 100644 --- a/beacon-chain/blockchain/service.go +++ b/beacon-chain/blockchain/service.go @@ -11,8 +11,6 @@ import ( "time" "github.com/pkg/errors" - "go.opencensus.io/trace" - "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/kzg" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" @@ -44,6 +42,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" + "go.opencensus.io/trace" ) // Service represents a service that handles the internal @@ -506,7 +505,7 @@ func (s *Service) saveGenesisData(ctx context.Context, genesisState state.Beacon } genesisBlk, err := s.cfg.BeaconDB.GenesisBlock(ctx) if err != nil || genesisBlk == nil || genesisBlk.IsNil() { - return fmt.Errorf("could not load genesis block: %v", err) + return fmt.Errorf("could not load genesis block: %w", err) } genesisBlkRoot, err := genesisBlk.Block().HashTreeRoot() if err != nil { diff --git a/beacon-chain/core/helpers/sync_committee.go b/beacon-chain/core/helpers/sync_committee.go index 8c930945828d..c28926f062b3 100644 --- a/beacon-chain/core/helpers/sync_committee.go +++ b/beacon-chain/core/helpers/sync_committee.go @@ -31,7 +31,7 @@ func IsCurrentPeriodSyncCommittee(st state.BeaconState, valIdx primitives.Valida return false, err } indices, err := syncCommitteeCache.CurrentPeriodIndexPosition(root, valIdx) - if err == cache.ErrNonExistingSyncCommitteeKey { + if errors.Is(err, cache.ErrNonExistingSyncCommitteeKey) { val, err := st.ValidatorAtIndex(valIdx) if err != nil { return false, err @@ -68,7 +68,7 @@ func IsNextPeriodSyncCommittee( return false, err } indices, err := syncCommitteeCache.NextPeriodIndexPosition(root, valIdx) - if err == cache.ErrNonExistingSyncCommitteeKey { + if errors.Is(err, cache.ErrNonExistingSyncCommitteeKey) { val, err := st.ValidatorAtIndex(valIdx) if err != nil { return false, err @@ -95,7 +95,7 @@ func CurrentPeriodSyncSubcommitteeIndices( return nil, err } indices, err := syncCommitteeCache.CurrentPeriodIndexPosition(root, valIdx) - if err == cache.ErrNonExistingSyncCommitteeKey { + if errors.Is(err, cache.ErrNonExistingSyncCommitteeKey) { val, err := st.ValidatorAtIndex(valIdx) if err != nil { return nil, err @@ -129,7 +129,7 @@ func NextPeriodSyncSubcommitteeIndices( return nil, err } indices, err := syncCommitteeCache.NextPeriodIndexPosition(root, valIdx) - if err == cache.ErrNonExistingSyncCommitteeKey { + if errors.Is(err, cache.ErrNonExistingSyncCommitteeKey) { val, err := st.ValidatorAtIndex(valIdx) if err != nil { return nil, err diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 7ce50bae0cd9..17a4c74c17d3 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -647,14 +647,15 @@ func handleRPCError(err error) error { if isTimeout(err) { return ErrHTTPTimeout } - e, ok := err.(gethRPC.Error) + var e gethRPC.Error + ok := errors.As(err, &e) if !ok { if strings.Contains(err.Error(), "401 Unauthorized") { log.Error("HTTP authentication to your execution client is not working. Please ensure " + "you are setting a correct value for the --jwt-secret flag in Prysm, or use an IPC connection if on " + "the same machine. Please see our documentation for more information on authenticating connections " + "here https://docs.prylabs.network/docs/execution-node/authentication") - return fmt.Errorf("could not authenticate connection to execution client: %v", err) + return fmt.Errorf("could not authenticate connection to execution client: %w", err) } return errors.Wrapf(err, "got an unexpected error in JSON-RPC response") } @@ -689,7 +690,8 @@ func handleRPCError(err error) error { case -32000: errServerErrorCount.Inc() // Only -32000 status codes are data errors in the RPC specification. - errWithData, ok := err.(gethRPC.DataError) + var errWithData gethRPC.DataError + ok := errors.As(err, &errWithData) if !ok { return errors.Wrapf(err, "got an unexpected error in JSON-RPC response") } @@ -708,7 +710,8 @@ type httpTimeoutError interface { } func isTimeout(e error) bool { - t, ok := e.(httpTimeoutError) + var t httpTimeoutError + ok := errors.As(e, &t) return ok && t.Timeout() } diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index e965d9956b99..d3f3af2ecfbd 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -572,7 +572,7 @@ func (b *BeaconNode) startDB(cliCtx *cli.Context, depositAddress string) error { if b.GenesisInitializer != nil { if err := b.GenesisInitializer.Initialize(b.ctx, d); err != nil { - if err == db.ErrExistingGenesisState { + if errors.Is(err, db.ErrExistingGenesisState) { return errors.Errorf("Genesis state flag specified but a genesis state "+ "exists already. Run again with --%s and/or ensure you are using the "+ "appropriate testnet flag to load the given genesis state.", cmd.ClearDB.Name) diff --git a/beacon-chain/node/prometheus.go b/beacon-chain/node/prometheus.go index 66f0b9dc301b..4431b2bdde8e 100644 --- a/beacon-chain/node/prometheus.go +++ b/beacon-chain/node/prometheus.go @@ -51,7 +51,7 @@ func (bc *bcnodeCollector) Collect(ch chan<- prometheus.Metric) { func (bc *bcnodeCollector) getCurrentDbBytes() (float64, error) { fs, err := os.Stat(bc.dbPath) if err != nil { - return 0, fmt.Errorf("could not collect database file size for prometheus, path=%s, err=%s", bc.dbPath, err) + return 0, fmt.Errorf("could not collect database file size for prometheus, path=%s, err=%w", bc.dbPath, err) } return float64(fs.Size()), nil } diff --git a/beacon-chain/node/registration/log.go b/beacon-chain/node/registration/log.go index 7e3060955643..0e3ed0b8e3cc 100644 --- a/beacon-chain/node/registration/log.go +++ b/beacon-chain/node/registration/log.go @@ -1,5 +1 @@ package registration - -import "github.com/sirupsen/logrus" - -var log = logrus.WithField("prefix", "registration") diff --git a/beacon-chain/node/registration/p2p.go b/beacon-chain/node/registration/p2p.go index 6675f2544641..01929014d788 100644 --- a/beacon-chain/node/registration/p2p.go +++ b/beacon-chain/node/registration/p2p.go @@ -7,6 +7,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/config/params" + log "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" "gopkg.in/yaml.v2" ) @@ -50,7 +51,8 @@ func readbootNodes(fileName string) ([]string, error) { listNodes := make([]string, 0) err = yaml.UnmarshalStrict(fileContent, &listNodes) if err != nil { - if _, ok := err.(*yaml.TypeError); !ok { + var typeError *yaml.TypeError + if !errors.As(err, &typeError) { return nil, err } else { log.WithError(err).Error("There were some issues parsing the bootnodes from a yaml file.") diff --git a/beacon-chain/p2p/handshake.go b/beacon-chain/p2p/handshake.go index a6086252152f..97d2af8eed72 100644 --- a/beacon-chain/p2p/handshake.go +++ b/beacon-chain/p2p/handshake.go @@ -138,7 +138,7 @@ func (s *Service) AddConnectionHandler(reqFunc, goodByeFunc func(ctx context.Con } s.peers.SetConnectionState(conn.RemotePeer(), peers.PeerConnecting) - if err := reqFunc(context.TODO(), conn.RemotePeer()); err != nil && err != io.EOF { + if err := reqFunc(context.TODO(), conn.RemotePeer()); err != nil && !errors.Is(err, io.EOF) { log.WithError(err).Trace("Handshake failed") disconnectFromPeer() return diff --git a/beacon-chain/p2p/options.go b/beacon-chain/p2p/options.go index de213848333a..272a1d7d9b28 100644 --- a/beacon-chain/p2p/options.go +++ b/beacon-chain/p2p/options.go @@ -18,7 +18,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/config/features" ecdsaprysm "github.com/prysmaticlabs/prysm/v5/crypto/ecdsa" - "github.com/prysmaticlabs/prysm/v5/runtime/version" ) diff --git a/beacon-chain/p2p/pubsub.go b/beacon-chain/p2p/pubsub.go index 0cc0b4f13013..3549841c9034 100644 --- a/beacon-chain/p2p/pubsub.go +++ b/beacon-chain/p2p/pubsub.go @@ -165,14 +165,14 @@ func (s *Service) pubsubOptions() []pubsub.Option { func parsePeersEnr(peers []string) ([]peer.AddrInfo, error) { addrs, err := PeersFromStringAddrs(peers) if err != nil { - return nil, fmt.Errorf("Cannot convert peers raw ENRs into multiaddresses: %v", err) + return nil, fmt.Errorf("Cannot convert peers raw ENRs into multiaddresses: %w", err) } if len(addrs) == 0 { return nil, fmt.Errorf("Converting peers raw ENRs into multiaddresses resulted in an empty list") } directAddrInfos, err := peer.AddrInfosFromP2pAddrs(addrs...) if err != nil { - return nil, fmt.Errorf("Cannot convert peers multiaddresses into AddrInfos: %v", err) + return nil, fmt.Errorf("Cannot convert peers multiaddresses into AddrInfos: %w", err) } return directAddrInfos, nil } diff --git a/beacon-chain/p2p/subnets.go b/beacon-chain/p2p/subnets.go index 78b65cc3ebe5..37ccea8ad998 100644 --- a/beacon-chain/p2p/subnets.go +++ b/beacon-chain/p2p/subnets.go @@ -14,15 +14,14 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" + "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/wrapper" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" mathutil "github.com/prysmaticlabs/prysm/v5/math" - "go.opencensus.io/trace" - - "github.com/prysmaticlabs/prysm/v5/config/params" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "go.opencensus.io/trace" ) var attestationSubnetCount = params.BeaconConfig().AttestationSubnetCount diff --git a/beacon-chain/p2p/types/rpc_goodbye_codes.go b/beacon-chain/p2p/types/rpc_goodbye_codes.go index 82870e692837..ab66ada455b2 100644 --- a/beacon-chain/p2p/types/rpc_goodbye_codes.go +++ b/beacon-chain/p2p/types/rpc_goodbye_codes.go @@ -1,6 +1,8 @@ package types import ( + "errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) @@ -35,8 +37,8 @@ var GoodbyeCodeMessages = map[RPCGoodbyeCode]string{ // ErrToGoodbyeCode converts given error to RPC goodbye code. func ErrToGoodbyeCode(err error) RPCGoodbyeCode { - switch err { - case ErrWrongForkDigestVersion: + switch { + case errors.Is(err, ErrWrongForkDigestVersion): return GoodbyeCodeWrongNetwork default: return GoodbyeCodeGenericError diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool.go b/beacon-chain/rpc/eth/beacon/handlers_pool.go index eee3a7a70dad..e78a91ca9aed 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool.go @@ -98,7 +98,7 @@ func (s *Server) SubmitAttestations(w http.ResponseWriter, r *http.Request) { var req structs.SubmitAttestationsRequest err := json.NewDecoder(r.Body).Decode(&req.Data) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -216,7 +216,7 @@ func (s *Server) SubmitVoluntaryExit(w http.ResponseWriter, r *http.Request) { var req structs.SignedVoluntaryExit err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -274,7 +274,7 @@ func (s *Server) SubmitSyncCommitteeSignatures(w http.ResponseWriter, r *http.Re var req structs.SubmitSyncCommitteeSignaturesRequest err := json.NewDecoder(r.Body).Decode(&req.Data) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -333,7 +333,7 @@ func (s *Server) SubmitBLSToExecutionChanges(w http.ResponseWriter, r *http.Requ var req []*structs.SignedBLSToExecutionChange err = json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -491,7 +491,7 @@ func (s *Server) SubmitAttesterSlashing(w http.ResponseWriter, r *http.Request) var req structs.AttesterSlashing err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -565,7 +565,7 @@ func (s *Server) SubmitProposerSlashing(w http.ResponseWriter, r *http.Request) var req structs.ProposerSlashing err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: diff --git a/beacon-chain/rpc/eth/beacon/handlers_state.go b/beacon-chain/rpc/eth/beacon/handlers_state.go index bd6659fa9473..6ada905f6dae 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_state.go +++ b/beacon-chain/rpc/eth/beacon/handlers_state.go @@ -2,6 +2,7 @@ package beacon import ( "context" + "errors" "fmt" "net/http" "strconv" @@ -41,12 +42,10 @@ func (s *Server) GetStateRoot(w http.ResponseWriter, r *http.Request) { stateRoot, err := s.Stater.StateRoot(ctx, []byte(stateId)) if err != nil { - if rootNotFoundErr, ok := err.(*lookup.StateRootNotFoundError); ok { + var rootNotFoundErr *lookup.StateRootNotFoundError + if errors.As(err, &rootNotFoundErr) { httputil.HandleError(w, "State root not found: "+rootNotFoundErr.Error(), http.StatusNotFound) return - } else if parseErr, ok := err.(*lookup.StateIdParseError); ok { - httputil.HandleError(w, "Invalid state ID: "+parseErr.Error(), http.StatusBadRequest) - return } httputil.HandleError(w, "Could not get state root: "+err.Error(), http.StatusInternalServerError) return @@ -270,7 +269,7 @@ func currentCommitteeIndicesFromState(st state.BeaconState) ([]string, *ethpbalp committee, err := st.CurrentSyncCommittee() if err != nil { return nil, nil, fmt.Errorf( - "could not get sync committee: %v", err, + "could not get sync committee: %w", err, ) } @@ -281,7 +280,7 @@ func nextCommitteeIndicesFromState(st state.BeaconState) ([]string, *ethpbalpha. committee, err := st.NextSyncCommittee() if err != nil { return nil, nil, fmt.Errorf( - "could not get sync committee: %v", err, + "could not get sync committee: %w", err, ) } @@ -295,7 +294,7 @@ func extractSyncSubcommittees(st state.BeaconState, committee *ethpbalpha.SyncCo pubkeys, err := altair.SyncSubCommitteePubkeys(committee, primitives.CommitteeIndex(i)) if err != nil { return nil, fmt.Errorf( - "failed to get subcommittee pubkeys: %v", err, + "failed to get subcommittee pubkeys: %w", err, ) } subcommittee := make([]string, len(pubkeys)) diff --git a/beacon-chain/rpc/eth/beacon/handlers_test.go b/beacon-chain/rpc/eth/beacon/handlers_test.go index 592122c9ec1c..67b571042268 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_test.go @@ -13,10 +13,6 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" - mockp2p "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" - logTest "github.com/sirupsen/logrus/hooks/test" - "go.uber.org/mock/gomock" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" @@ -28,6 +24,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" + mockp2p "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" rpctesting "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" @@ -46,7 +43,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/time/slots" + logTest "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/mock" + "go.uber.org/mock/gomock" ) func fillDBTestBlocks(ctx context.Context, t *testing.T, beaconDB db.Database) (*eth.SignedBeaconBlock, []*eth.BeaconBlockContainer) { diff --git a/beacon-chain/rpc/eth/beacon/handlers_validator.go b/beacon-chain/rpc/eth/beacon/handlers_validator.go index 706e55a59b2e..d14fd6bf87ea 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_validator.go +++ b/beacon-chain/rpc/eth/beacon/handlers_validator.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" @@ -56,7 +57,7 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { if r.Method == http.MethodPost { err = json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -272,7 +273,7 @@ func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request) { } else { err = json.NewDecoder(r.Body).Decode(&rawIds) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index 1863f86cc1f7..080082e35e6f 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -12,7 +12,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" diff --git a/beacon-chain/rpc/eth/helpers/error_handling.go b/beacon-chain/rpc/eth/helpers/error_handling.go index da1b5d49c827..12561e13fa60 100644 --- a/beacon-chain/rpc/eth/helpers/error_handling.go +++ b/beacon-chain/rpc/eth/helpers/error_handling.go @@ -17,10 +17,12 @@ func PrepareStateFetchGRPCError(err error) error { if errors.Is(err, stategen.ErrNoDataForSlot) { return status.Errorf(codes.NotFound, "lacking historical data needed to fulfill request") } - if stateNotFoundErr, ok := err.(*lookup.StateNotFoundError); ok { + var stateNotFoundErr *lookup.StateNotFoundError + if errors.As(err, &stateNotFoundErr) { return status.Errorf(codes.NotFound, "State not found: %v", stateNotFoundErr) } - if parseErr, ok := err.(*lookup.StateIdParseError); ok { + var parseErr *lookup.StateIdParseError + if errors.As(err, &parseErr) { return status.Errorf(codes.InvalidArgument, "Invalid state ID: %v", parseErr) } return status.Errorf(codes.Internal, "Invalid state ID: %v", err) @@ -38,7 +40,8 @@ type SingleIndexedVerificationFailure struct { } func HandleGetBlockError(blk interfaces.ReadOnlySignedBeaconBlock, err error) error { - if invalidBlockIdErr, ok := err.(*lookup.BlockIdParseError); ok { + var invalidBlockIdErr *lookup.BlockIdParseError + if errors.As(err, &invalidBlockIdErr) { return status.Errorf(codes.InvalidArgument, "Invalid block ID: %v", invalidBlockIdErr) } if err != nil { diff --git a/beacon-chain/rpc/eth/helpers/sync_test.go b/beacon-chain/rpc/eth/helpers/sync_test.go index 54832c7e7321..014e61888a5f 100644 --- a/beacon-chain/rpc/eth/helpers/sync_test.go +++ b/beacon-chain/rpc/eth/helpers/sync_test.go @@ -97,7 +97,7 @@ func TestIsOptimistic(t *testing.T) { t.Run("finalized checkpoint is optimistic", func(t *testing.T) { st, err := util.NewBeaconState() require.NoError(t, err) - cs := &chainmock.ChainService{Optimistic: true, FinalizedCheckPoint: ð.Checkpoint{}, OptimisticRoots: map[[32]byte]bool{[32]byte{}: true}} + cs := &chainmock.ChainService{Optimistic: true, FinalizedCheckPoint: ð.Checkpoint{}, OptimisticRoots: map[[32]byte]bool{{}: true}} mf := &testutil.MockStater{BeaconState: st} o, err := IsOptimistic(ctx, []byte("finalized"), cs, mf, cs, nil) require.NoError(t, err) @@ -117,7 +117,7 @@ func TestIsOptimistic(t *testing.T) { t.Run("justified checkpoint is optimistic", func(t *testing.T) { st, err := util.NewBeaconState() require.NoError(t, err) - cs := &chainmock.ChainService{Optimistic: true, CurrentJustifiedCheckPoint: ð.Checkpoint{}, OptimisticRoots: map[[32]byte]bool{[32]byte{}: true}} + cs := &chainmock.ChainService{Optimistic: true, CurrentJustifiedCheckPoint: ð.Checkpoint{}, OptimisticRoots: map[[32]byte]bool{{}: true}} mf := &testutil.MockStater{BeaconState: st} o, err := IsOptimistic(ctx, []byte("justified"), cs, mf, cs, nil) require.NoError(t, err) diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 4ba524bbf692..74296f192e85 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -9,10 +9,6 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "go.opencensus.io/trace" - - "github.com/wealdtech/go-bytesutil" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -20,6 +16,8 @@ import ( types "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/wealdtech/go-bytesutil" + "go.opencensus.io/trace" ) // GetLightClientBootstrap - implements https://github.com/ethereum/beacon-APIs/blob/263f4ed6c263c967f13279c7a9f5629b51c5fc55/apis/beacon/light_client/bootstrap.yaml @@ -353,24 +351,24 @@ func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequ // Get the current state state, err := s.HeadFetcher.HeadState(ctx) if err != nil { - return nil, fmt.Errorf("could not get head state %v", err) + return nil, fmt.Errorf("could not get head state %w", err) } // Get the block latestBlockHeader := *state.LatestBlockHeader() stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get state root %v", err) + return nil, fmt.Errorf("could not get state root %w", err) } latestBlockHeader.StateRoot = stateRoot[:] latestBlockHeaderRoot, err := latestBlockHeader.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get latest block header root %v", err) + return nil, fmt.Errorf("could not get latest block header root %w", err) } block, err := s.Blocker.Block(ctx, latestBlockHeaderRoot[:]) if err != nil { - return nil, fmt.Errorf("could not get latest block %v", err) + return nil, fmt.Errorf("could not get latest block %w", err) } if block == nil { return nil, fmt.Errorf("latest block is nil") @@ -387,7 +385,7 @@ func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequ parentRoot := block.Block().ParentRoot() block, err = s.Blocker.Block(ctx, parentRoot[:]) if err != nil { - return nil, fmt.Errorf("could not get parent block %v", err) + return nil, fmt.Errorf("could not get parent block %w", err) } if block == nil { return nil, fmt.Errorf("parent block is nil") diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index aa65d9b29203..aff9643128cc 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -12,7 +12,6 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" - mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" diff --git a/beacon-chain/rpc/eth/shared/BUILD.bazel b/beacon-chain/rpc/eth/shared/BUILD.bazel index 81baa76dcee5..78c012169402 100644 --- a/beacon-chain/rpc/eth/shared/BUILD.bazel +++ b/beacon-chain/rpc/eth/shared/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//network/httputil:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", + "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/shared/errors.go b/beacon-chain/rpc/eth/shared/errors.go index 84cdacea4275..bfcd781822af 100644 --- a/beacon-chain/rpc/eth/shared/errors.go +++ b/beacon-chain/rpc/eth/shared/errors.go @@ -3,6 +3,7 @@ package shared import ( "net/http" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -12,11 +13,13 @@ import ( // WriteStateFetchError writes an appropriate error based on the supplied argument. // The argument error should be a result of fetching state. func WriteStateFetchError(w http.ResponseWriter, err error) { - if _, ok := err.(*lookup.StateNotFoundError); ok { + var stateNotFoundError *lookup.StateNotFoundError + if errors.As(err, &stateNotFoundError) { httputil.HandleError(w, "State not found", http.StatusNotFound) return } - if parseErr, ok := err.(*lookup.StateIdParseError); ok { + var parseErr *lookup.StateIdParseError + if errors.As(err, &parseErr) { httputil.HandleError(w, "Invalid state ID: "+parseErr.Error(), http.StatusBadRequest) return } @@ -26,7 +29,8 @@ func WriteStateFetchError(w http.ResponseWriter, err error) { // WriteBlockFetchError writes an appropriate error based on the supplied argument. // The argument error should be a result of fetching block. func WriteBlockFetchError(w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock, err error) bool { - if invalidBlockIdErr, ok := err.(*lookup.BlockIdParseError); ok { + var invalidBlockIdErr *lookup.BlockIdParseError + if errors.As(err, &invalidBlockIdErr) { httputil.HandleError(w, "Invalid block ID: "+invalidBlockIdErr.Error(), http.StatusBadRequest) return false } diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index c214697b3eed..f20ab9c5cc4d 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -121,7 +121,7 @@ func (s *Server) SubmitContributionAndProofs(w http.ResponseWriter, r *http.Requ var req structs.SubmitContributionAndProofsRequest err := json.NewDecoder(r.Body).Decode(&req.Data) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -154,7 +154,7 @@ func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request var req structs.SubmitAggregateAndProofsRequest err := json.NewDecoder(r.Body).Decode(&req.Data) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -175,7 +175,8 @@ func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request } rpcError := s.CoreService.SubmitSignedAggregateSelectionProof(ctx, consensusItem) if rpcError != nil { - _, ok := rpcError.Err.(*core.AggregateBroadcastFailedError) + var aggregateBroadcastFailedError *core.AggregateBroadcastFailedError + ok := errors.As(rpcError.Err, &aggregateBroadcastFailedError) if ok { broadcastFailed = true } else { @@ -206,7 +207,7 @@ func (s *Server) SubmitSyncCommitteeSubscription(w http.ResponseWriter, r *http. var req structs.SubmitSyncCommitteeSubscriptionsRequest err := json.NewDecoder(r.Body).Decode(&req.Data) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -316,7 +317,7 @@ func (s *Server) SubmitBeaconCommitteeSubscription(w http.ResponseWriter, r *htt var req structs.SubmitBeaconCommitteeSubscriptionsRequest err := json.NewDecoder(r.Body).Decode(&req.Data) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -519,7 +520,7 @@ func (s *Server) RegisterValidator(w http.ResponseWriter, r *http.Request) { var jsonRegistrations []*structs.SignedValidatorRegistration err := json.NewDecoder(r.Body).Decode(&jsonRegistrations) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -552,7 +553,7 @@ func (s *Server) PrepareBeaconProposer(w http.ResponseWriter, r *http.Request) { var jsonFeeRecipients []*structs.FeeRecipient err := json.NewDecoder(r.Body).Decode(&jsonFeeRecipients) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -612,7 +613,7 @@ func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request) { var indices []string err := json.NewDecoder(r.Body).Decode(&indices) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -892,7 +893,7 @@ func (s *Server) GetSyncCommitteeDuties(w http.ResponseWriter, r *http.Request) var indices []string err := json.NewDecoder(r.Body).Decode(&indices) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -1017,7 +1018,7 @@ func (s *Server) GetLiveness(w http.ResponseWriter, r *http.Request) { var indices []string err := json.NewDecoder(r.Body).Decode(&indices) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: diff --git a/beacon-chain/rpc/lookup/stater_test.go b/beacon-chain/rpc/lookup/stater_test.go index 027212257ea7..009c8c30267f 100644 --- a/beacon-chain/rpc/lookup/stater_test.go +++ b/beacon-chain/rpc/lookup/stater_test.go @@ -7,15 +7,14 @@ import ( "testing" "time" - statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" - "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/ethereum/go-ethereum/common/hexutil" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" testDB "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" + statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" diff --git a/beacon-chain/rpc/prysm/beacon/validator_count.go b/beacon-chain/rpc/prysm/beacon/validator_count.go index 166a8c5c684d..ba9b6f744f8a 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count.go @@ -131,15 +131,15 @@ func validatorCountByStatus(validators []*eth.Validator, statuses []validator.St for _, val := range validators { readOnlyVal, err := statenative.NewValidator(val) if err != nil { - return nil, fmt.Errorf("could not convert validator: %v", err) + return nil, fmt.Errorf("could not convert validator: %w", err) } valStatus, err := helpers.ValidatorStatus(readOnlyVal, epoch) if err != nil { - return nil, fmt.Errorf("could not get validator status: %v", err) + return nil, fmt.Errorf("could not get validator status: %w", err) } valSubStatus, err := helpers.ValidatorSubStatus(readOnlyVal, epoch) if err != nil { - return nil, fmt.Errorf("could not get validator sub status: %v", err) + return nil, fmt.Errorf("could not get validator sub status: %w", err) } for _, status := range statuses { diff --git a/beacon-chain/rpc/prysm/beacon/validator_count_test.go b/beacon-chain/rpc/prysm/beacon/validator_count_test.go index 85f79d3be8e0..7d4f9b330186 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count_test.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count_test.go @@ -12,17 +12,15 @@ import ( "strings" "testing" - "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - - "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" - "github.com/prysmaticlabs/prysm/v5/network/httputil" - "github.com/gorilla/mux" + "github.com/prysmaticlabs/prysm/v5/api/server/structs" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go index 7c72515f75a8..63bd3a92a158 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go @@ -4,17 +4,16 @@ import ( "context" "testing" - "github.com/prysmaticlabs/prysm/v5/config/features" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings" mockp2p "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" + "github.com/prysmaticlabs/prysm/v5/config/features" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" ) func TestServer_SubmitProposerSlashing(t *testing.T) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 611cffa66901..27d1a5f297fd 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -89,7 +89,7 @@ func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) ( // Set proposer index. idx, err := helpers.BeaconProposerIndex(ctx, head) if err != nil { - return nil, fmt.Errorf("could not calculate proposer index %v", err) + return nil, fmt.Errorf("could not calculate proposer index %w", err) } sBlk.SetProposerIndex(idx) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go index 643f0a96d183..67bf6da2a60d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go @@ -288,12 +288,12 @@ func (vs *Server) validatorStatus( ActivationEpoch: params.BeaconConfig().FarFutureEpoch, } vStatus, idx, err := statusForPubKey(headState, pubKey) - if err != nil && err != errPubkeyDoesNotExist { + if err != nil && !errors.Is(err, errPubkeyDoesNotExist) { tracing.AnnotateError(span, err) return resp, nonExistentIndex } resp.Status = vStatus - if err != errPubkeyDoesNotExist { + if !errors.Is(err, errPubkeyDoesNotExist) { val, err := headState.ValidatorAtIndexReadOnly(idx) if err != nil { tracing.AnnotateError(span, err) diff --git a/beacon-chain/rpc/testutil/mock_stater.go b/beacon-chain/rpc/testutil/mock_stater.go index d478c896ae61..872aab459663 100644 --- a/beacon-chain/rpc/testutil/mock_stater.go +++ b/beacon-chain/rpc/testutil/mock_stater.go @@ -3,10 +3,9 @@ package testutil import ( "context" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) // MockStater is a fake implementation of lookup.Stater. diff --git a/beacon-chain/state/stategen/history_test.go b/beacon-chain/state/stategen/history_test.go index 14c2fe3b649b..fd17abd7631e 100644 --- a/beacon-chain/state/stategen/history_test.go +++ b/beacon-chain/state/stategen/history_test.go @@ -6,12 +6,11 @@ import ( "fmt" "testing" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/mock" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" ) diff --git a/beacon-chain/state/testing/getters_checkpoint.go b/beacon-chain/state/testing/getters_checkpoint.go index a9edf294ea15..c2b8b177ee3f 100644 --- a/beacon-chain/state/testing/getters_checkpoint.go +++ b/beacon-chain/state/testing/getters_checkpoint.go @@ -1,14 +1,14 @@ package testing import ( + "testing" + "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" - - "testing" ) func VerifyBeaconStateJustificationBitsNil(t *testing.T, factory getState) { diff --git a/beacon-chain/sync/backfill/status_test.go b/beacon-chain/sync/backfill/status_test.go index c6e455596900..940f47780b7e 100644 --- a/beacon-chain/sync/backfill/status_test.go +++ b/beacon-chain/sync/backfill/status_test.go @@ -5,16 +5,15 @@ import ( "context" "testing" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" blocktest "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks/testing" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/proto/dbval" - - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/proto/dbval" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) diff --git a/beacon-chain/sync/genesis/file.go b/beacon-chain/sync/genesis/file.go index dcfcabe7c843..ef2f1b309936 100644 --- a/beacon-chain/sync/genesis/file.go +++ b/beacon-chain/sync/genesis/file.go @@ -5,11 +5,10 @@ import ( "fmt" "os" - "github.com/prysmaticlabs/prysm/v5/crypto/hash" - "github.com/prysmaticlabs/prysm/v5/io/file" - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" + "github.com/prysmaticlabs/prysm/v5/crypto/hash" + "github.com/prysmaticlabs/prysm/v5/io/file" ) // Initializer describes a type that is able to obtain the checkpoint sync data (BeaconState and SignedBeaconBlock) diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index fb6e0530c909..7ada5cc609f3 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -10,6 +10,7 @@ import ( libp2pcore "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/protocol" + "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" p2ptypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" @@ -195,7 +196,7 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { if baseTopic == p2p.RPCMetaDataTopicV1 || baseTopic == p2p.RPCMetaDataTopicV2 { if err := handle(ctx, base, stream); err != nil { messageFailedProcessingCounter.WithLabelValues(topic).Inc() - if err != p2ptypes.ErrWrongForkDigestVersion { + if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") } tracing.AnnotateError(span, err) @@ -220,7 +221,7 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { } if err := handle(ctx, msg, stream); err != nil { messageFailedProcessingCounter.WithLabelValues(topic).Inc() - if err != p2ptypes.ErrWrongForkDigestVersion { + if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") } tracing.AnnotateError(span, err) @@ -240,7 +241,7 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { } if err := handle(ctx, nTyp.Elem().Interface(), stream); err != nil { messageFailedProcessingCounter.WithLabelValues(topic).Inc() - if err != p2ptypes.ErrWrongForkDigestVersion { + if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") } tracing.AnnotateError(span, err) diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go b/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go index 5138893e97f2..55e838718ab0 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go @@ -12,6 +12,7 @@ import ( gethTypes "github.com/ethereum/go-ethereum/core/types" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/protocol" + "github.com/pkg/errors" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" db2 "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" db "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" @@ -857,7 +858,7 @@ func TestRPCBeaconBlocksByRange_FilterBlocks(t *testing.T) { if err != nil && err != io.EOF { t.Fatal(err) } - if code != 0 || err == io.EOF { + if code != 0 || errors.Is(err, io.EOF) { break } blk := util.NewBeaconBlock() diff --git a/beacon-chain/sync/rpc_status.go b/beacon-chain/sync/rpc_status.go index d8f4d60d2b09..e688301d66de 100644 --- a/beacon-chain/sync/rpc_status.go +++ b/beacon-chain/sync/rpc_status.go @@ -211,10 +211,10 @@ func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream }).Debug("Invalid status message from peer") var respCode byte - switch err { - case p2ptypes.ErrGeneric: + switch { + case errors.Is(err, p2ptypes.ErrGeneric): respCode = responseCodeServerError - case p2ptypes.ErrWrongForkDigestVersion: + case errors.Is(err, p2ptypes.ErrWrongForkDigestVersion): // Respond with our status and disconnect with the peer. s.cfg.p2p.Peers().SetChainState(remotePeer, m) if err := s.respondWithStatus(ctx, stream); err != nil { diff --git a/beacon-chain/sync/subscriber.go b/beacon-chain/sync/subscriber.go index ee7691a2b806..3b7f7def672c 100644 --- a/beacon-chain/sync/subscriber.go +++ b/beacon-chain/sync/subscriber.go @@ -230,7 +230,7 @@ func (s *Service) subscribeWithBase(topic string, validator wrappedVal, handle s msg, err := sub.Next(s.ctx) if err != nil { // This should only happen when the context is cancelled or subscription is cancelled. - if err != pubsub.ErrSubscriptionCancelled { // Only log a warning on unexpected errors. + if !errors.Is(err, pubsub.ErrSubscriptionCancelled) { // Only log a warning on unexpected errors. log.WithError(err).Warn("Subscription next failed") } // Cancel subscription in the event of an error, as we are diff --git a/beacon-chain/verification/blob_test.go b/beacon-chain/verification/blob_test.go index 9148c4a6a902..d5df7db2a65d 100644 --- a/beacon-chain/verification/blob_test.go +++ b/beacon-chain/verification/blob_test.go @@ -507,7 +507,8 @@ func TestRequirementSatisfaction(t *testing.T) { _, err := v.VerifiedROBlob() require.ErrorIs(t, err, ErrBlobInvalid) - me, ok := err.(VerificationMultiError) + var me VerificationMultiError + ok := errors.As(err, &me) require.Equal(t, true, ok) fails := me.Failures() // we haven't performed any verification, so all the results should be this type diff --git a/beacon-chain/verification/cache.go b/beacon-chain/verification/cache.go index d1ca89def527..ebfb09bd53fa 100644 --- a/beacon-chain/verification/cache.go +++ b/beacon-chain/verification/cache.go @@ -5,20 +5,19 @@ import ( "fmt" lru "github.com/hashicorp/golang-lru" - lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" - log "github.com/sirupsen/logrus" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/network/forks" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" + log "github.com/sirupsen/logrus" ) const ( diff --git a/cmd/prysmctl/p2p/handler.go b/cmd/prysmctl/p2p/handler.go index 085e3c8352a9..c0aa289e0a56 100644 --- a/cmd/prysmctl/p2p/handler.go +++ b/cmd/prysmctl/p2p/handler.go @@ -9,6 +9,7 @@ import ( libp2pcore "github.com/libp2p/go-libp2p/core" corenet "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/protocol" + "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" p2ptypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" @@ -51,7 +52,7 @@ func (c *client) registerRPCHandler(baseTopic string, handle rpcHandler) { // do not decode anything. if baseTopic == p2p.RPCMetaDataTopicV1 || baseTopic == p2p.RPCMetaDataTopicV2 { if err := handle(context.Background(), base, stream); err != nil { - if err != p2ptypes.ErrWrongForkDigestVersion { + if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") } } @@ -73,7 +74,7 @@ func (c *client) registerRPCHandler(baseTopic string, handle rpcHandler) { return } if err := handle(context.Background(), msg, stream); err != nil { - if err != p2ptypes.ErrWrongForkDigestVersion { + if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") } } @@ -89,7 +90,7 @@ func (c *client) registerRPCHandler(baseTopic string, handle rpcHandler) { return } if err := handle(context.Background(), nTyp.Elem().Interface(), stream); err != nil { - if err != p2ptypes.ErrWrongForkDigestVersion { + if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") } } diff --git a/cmd/prysmctl/testnet/generate_genesis.go b/cmd/prysmctl/testnet/generate_genesis.go index 9fcee9a064fe..00357e075e6e 100644 --- a/cmd/prysmctl/testnet/generate_genesis.go +++ b/cmd/prysmctl/testnet/generate_genesis.go @@ -174,11 +174,11 @@ func cliActionGenerateGenesisState(cliCtx *cli.Context) error { ) } if err := setGlobalParams(); err != nil { - return fmt.Errorf("could not set config params: %v", err) + return fmt.Errorf("could not set config params: %w", err) } st, err := generateGenesis(cliCtx.Context) if err != nil { - return fmt.Errorf("could not generate genesis state: %v", err) + return fmt.Errorf("could not generate genesis state: %w", err) } if outputJson != "" { @@ -218,7 +218,7 @@ func setGlobalParams() error { } cfg, err := params.ByName(generateGenesisStateFlags.ConfigName) if err != nil { - return fmt.Errorf("unable to find config using name %s: %v", generateGenesisStateFlags.ConfigName, err) + return fmt.Errorf("unable to find config using name %s: %w", generateGenesisStateFlags.ConfigName, err) } return params.SetActive(cfg.Copy()) } diff --git a/config/features/config.go b/config/features/config.go index 833c562d7587..925d32a89e28 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -23,11 +23,10 @@ import ( "sync" "time" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" - "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" ) var log = logrus.WithField("prefix", "flags") diff --git a/config/params/loader.go b/config/params/loader.go index 6a4359064129..e8e2aba491ab 100644 --- a/config/params/loader.go +++ b/config/params/loader.go @@ -53,7 +53,8 @@ func UnmarshalConfig(yamlFile []byte, conf *BeaconChainConfig) (*BeaconChainConf } yamlFile = []byte(strings.Join(lines, "\n")) if err := yaml.UnmarshalStrict(yamlFile, conf); err != nil { - if _, ok := err.(*yaml.TypeError); !ok { + var typeError *yaml.TypeError + if !errors.As(err, &typeError) { return nil, errors.Wrap(err, "Failed to parse chain config yaml file.") } else { log.WithError(err).Error("There were some issues parsing the config from a yaml file") diff --git a/consensus-types/blocks/proto.go b/consensus-types/blocks/proto.go index af75d83e6ee8..4704c08ed4e0 100644 --- a/consensus-types/blocks/proto.go +++ b/consensus-types/blocks/proto.go @@ -977,7 +977,7 @@ func initBlockBodyFromProtoBellatrix(pb *eth.BeaconBlockBodyBellatrix) (*BeaconB p, err := WrappedExecutionPayload(pb.ExecutionPayload) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1003,7 +1003,7 @@ func initBlindedBlockBodyFromProtoBellatrix(pb *eth.BlindedBeaconBlockBodyBellat ph, err := WrappedExecutionPayloadHeader(pb.ExecutionPayloadHeader) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1029,7 +1029,7 @@ func initBlockBodyFromProtoCapella(pb *eth.BeaconBlockBodyCapella) (*BeaconBlock p, err := WrappedExecutionPayloadCapella(pb.ExecutionPayload) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1056,7 +1056,7 @@ func initBlindedBlockBodyFromProtoCapella(pb *eth.BlindedBeaconBlockBodyCapella) ph, err := WrappedExecutionPayloadHeaderCapella(pb.ExecutionPayloadHeader) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1083,7 +1083,7 @@ func initBlockBodyFromProtoDeneb(pb *eth.BeaconBlockBodyDeneb) (*BeaconBlockBody p, err := WrappedExecutionPayloadDeneb(pb.ExecutionPayload) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1111,7 +1111,7 @@ func initBlindedBlockBodyFromProtoDeneb(pb *eth.BlindedBeaconBlockBodyDeneb) (*B ph, err := WrappedExecutionPayloadHeaderDeneb(pb.ExecutionPayloadHeader) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1139,7 +1139,7 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock p, err := WrappedExecutionPayloadElectra(pb.ExecutionPayload) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ @@ -1167,7 +1167,7 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) ph, err := WrappedExecutionPayloadHeaderElectra(pb.ExecutionPayloadHeader) // We allow the payload to be nil - if err != nil && err != consensus_types.ErrNilObjectWrapped { + if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } b := &BeaconBlockBody{ diff --git a/encoding/ssz/detect/configfork.go b/encoding/ssz/detect/configfork.go index 79099512cc9b..327b68198cd4 100644 --- a/encoding/ssz/detect/configfork.go +++ b/encoding/ssz/detect/configfork.go @@ -3,18 +3,17 @@ package detect import ( "fmt" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - "github.com/prysmaticlabs/prysm/v5/network/forks" - "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/network/forks" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" diff --git a/encoding/ssz/detect/configfork_test.go b/encoding/ssz/detect/configfork_test.go index 5a5e41a912f2..d417eeeb1fd9 100644 --- a/encoding/ssz/detect/configfork_test.go +++ b/encoding/ssz/detect/configfork_test.go @@ -9,14 +9,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/time/slots" - - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" ) func TestSlotFromBlock(t *testing.T) { diff --git a/io/file/fileutil.go b/io/file/fileutil.go index 19b4ff976c6e..f00a55f94f32 100644 --- a/io/file/fileutil.go +++ b/io/file/fileutil.go @@ -198,7 +198,7 @@ func RecursiveFileFind(filename, dir string) (bool, string, error) { // no errors or file found return nil }) - if err != nil && err != errStopWalk { + if err != nil && !errors.Is(err, errStopWalk) { return false, "", err } return found, fpath, nil @@ -231,7 +231,7 @@ func RecursiveDirFind(dirname, dir string) (bool, string, error) { return nil }) - if err != nil && err != errStopWalk { + if err != nil && !errors.Is(err, errStopWalk) { return false, "", errors.Wrapf(err, "error walking directory %s", dir) } diff --git a/monitoring/clientstats/updaters.go b/monitoring/clientstats/updaters.go index a431339d4af1..19bedd6eaf4d 100644 --- a/monitoring/clientstats/updaters.go +++ b/monitoring/clientstats/updaters.go @@ -43,7 +43,7 @@ func (gw *httpPoster) Update(r io.Reader) error { buf := new(bytes.Buffer) _, err = io.Copy(buf, resp.Body) if err != nil { - return fmt.Errorf("error reading response body for non-200 response status code (%d), err=%s", resp.StatusCode, err) + return fmt.Errorf("error reading response body for non-200 response status code (%d), err=%w", resp.StatusCode, err) } return fmt.Errorf("non-200 response status code (%d). response body=%s", resp.StatusCode, buf.String()) } diff --git a/runtime/interop/generate_keys.go b/runtime/interop/generate_keys.go index 915eb19a6fb5..c3990fda9a0c 100644 --- a/runtime/interop/generate_keys.go +++ b/runtime/interop/generate_keys.go @@ -5,12 +5,11 @@ import ( "math/big" "sync" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/async" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/crypto/hash" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) const ( diff --git a/runtime/logging/logrus-prefixed-formatter/formatter_test.go b/runtime/logging/logrus-prefixed-formatter/formatter_test.go index f3a26d474301..615ff5c6a5f9 100644 --- a/runtime/logging/logrus-prefixed-formatter/formatter_test.go +++ b/runtime/logging/logrus-prefixed-formatter/formatter_test.go @@ -5,12 +5,11 @@ import ( "regexp" "testing" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" "github.com/pkg/errors" prefixed "github.com/prysmaticlabs/prysm/v5/runtime/logging/logrus-prefixed-formatter" "github.com/prysmaticlabs/prysm/v5/testing/require" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" "github.com/sirupsen/logrus" ) diff --git a/runtime/logging/logrus-prefixed-formatter/logrus_prefixed_formatter_suite_test.go b/runtime/logging/logrus-prefixed-formatter/logrus_prefixed_formatter_suite_test.go index c95894a70f54..78e9b2fbf756 100644 --- a/runtime/logging/logrus-prefixed-formatter/logrus_prefixed_formatter_suite_test.go +++ b/runtime/logging/logrus-prefixed-formatter/logrus_prefixed_formatter_suite_test.go @@ -1,10 +1,10 @@ package prefixed_test import ( + "testing" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - - "testing" ) type LogOutput struct { diff --git a/runtime/tos/tos.go b/runtime/tos/tos.go index f4727e6673fc..7b9b9f6a4811 100644 --- a/runtime/tos/tos.go +++ b/runtime/tos/tos.go @@ -4,9 +4,8 @@ import ( "path/filepath" "strings" - "github.com/pkg/errors" - "github.com/logrusorgru/aurora" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/io/prompt" diff --git a/testing/endtoend/components/eth1/depositor_test.go b/testing/endtoend/components/eth1/depositor_test.go index 87e37955737a..7f01282c90c5 100644 --- a/testing/endtoend/components/eth1/depositor_test.go +++ b/testing/endtoend/components/eth1/depositor_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/testing/require" ) diff --git a/testing/endtoend/components/eth1/transactions.go b/testing/endtoend/components/eth1/transactions.go index 15fd02277f31..5426adae257d 100644 --- a/testing/endtoend/components/eth1/transactions.go +++ b/testing/endtoend/components/eth1/transactions.go @@ -380,7 +380,7 @@ func randomBlobData() ([]byte, error) { return nil, err } if n != size { - return nil, fmt.Errorf("could not create random blob data with size %d: %v", size, err) + return nil, fmt.Errorf("could not create random blob data with size %d: %w", size, err) } return data, nil } diff --git a/testing/endtoend/endtoend_test.go b/testing/endtoend/endtoend_test.go index 96200ccb5cc1..8e8f3d51e4f8 100644 --- a/testing/endtoend/endtoend_test.go +++ b/testing/endtoend/endtoend_test.go @@ -16,18 +16,15 @@ import ( "testing" "time" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/client/beacon" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/network/forks" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/endtoend/components" @@ -40,6 +37,8 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" ) @@ -417,7 +416,7 @@ func (r *testRunner) testDoppelGangerProtection(ctx context.Context) error { } logFile, err := os.Create(path.Join(e2e.TestParams.LogPath, fmt.Sprintf(e2e.ValidatorLogFileName, valIndex))) if err != nil { - return fmt.Errorf("unable to open log file: %v", err) + return fmt.Errorf("unable to open log file: %w", err) } r.t.Run("doppelganger found", func(t *testing.T) { assert.NoError(t, helpers.WaitForTextInFile(logFile, "Duplicate instances exists in the network for validator keys"), "Failed to carry out doppelganger check correctly") diff --git a/testing/endtoend/evaluators/fork.go b/testing/endtoend/evaluators/fork.go index bb04f3146358..54463043585a 100644 --- a/testing/endtoend/evaluators/fork.go +++ b/testing/endtoend/evaluators/fork.go @@ -75,7 +75,7 @@ func altairForkOccurs(_ *types.EvaluationContext, conns ...*grpc.ClientConn) err if err != nil { return err } - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.New("context canceled prematurely") } res, err := stream.Recv() @@ -117,7 +117,7 @@ func bellatrixForkOccurs(_ *types.EvaluationContext, conns ...*grpc.ClientConn) if err != nil { return err } - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.New("context canceled prematurely") } res, err := stream.Recv() @@ -162,7 +162,7 @@ func capellaForkOccurs(_ *types.EvaluationContext, conns ...*grpc.ClientConn) er if err != nil { return err } - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.New("context canceled prematurely") } res, err := stream.Recv() @@ -205,7 +205,7 @@ func denebForkOccurs(_ *types.EvaluationContext, conns ...*grpc.ClientConn) erro if err != nil { return err } - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.New("context canceled prematurely") } res, err := stream.Recv() diff --git a/testing/endtoend/params/params.go b/testing/endtoend/params/params.go index 8ef153c9fd61..dd71b9c53cdd 100644 --- a/testing/endtoend/params/params.go +++ b/testing/endtoend/params/params.go @@ -14,9 +14,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/core/types" - "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/ethereum/go-ethereum/core/types" "github.com/prysmaticlabs/prysm/v5/io/file" ) diff --git a/testing/middleware/builder/builder.go b/testing/middleware/builder/builder.go index 592b96eefff7..a0ed717c0fd3 100644 --- a/testing/middleware/builder/builder.go +++ b/testing/middleware/builder/builder.go @@ -29,7 +29,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" types "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/network" @@ -795,7 +794,7 @@ func decodeTransactions(enc [][]byte) ([]*gethTypes.Transaction, error) { for i, encTx := range enc { var tx gethTypes.Transaction if err := tx.UnmarshalBinary(encTx); err != nil { - return nil, fmt.Errorf("invalid transaction %d: %v", i, err) + return nil, fmt.Errorf("invalid transaction %d: %w", i, err) } txs[i] = &tx } diff --git a/testing/spectest/shared/common/forkchoice/runner.go b/testing/spectest/shared/common/forkchoice/runner.go index 3ca092873692..4f4784446f6c 100644 --- a/testing/spectest/shared/common/forkchoice/runner.go +++ b/testing/spectest/shared/common/forkchoice/runner.go @@ -2,6 +2,7 @@ package forkchoice import ( "context" + "errors" "fmt" "os" "path" @@ -415,7 +416,8 @@ func errAssertionForStep(step Step, expect error) func(t *testing.T, err error) return func(t *testing.T, err error) { if err != nil { require.ErrorIs(t, err, verification.ErrBlobInvalid) - me, ok := err.(verification.VerificationMultiError) + var me verification.VerificationMultiError + ok := errors.As(err, &me) require.Equal(t, true, ok) fails := me.Failures() // we haven't performed any verification, so all the results should be this type diff --git a/tools/analyzers/logruswitherror/testdata/src/a/a.go b/tools/analyzers/logruswitherror/testdata/src/a/a.go index 6bbb4b082869..51ab1f662524 100644 --- a/tools/analyzers/logruswitherror/testdata/src/a/a.go +++ b/tools/analyzers/logruswitherror/testdata/src/a/a.go @@ -31,7 +31,7 @@ func LogThis(err error) { log.WithError(err).Error("Something bad happened, but this log statement is OK :)") - _ = fmt.Errorf("this is ok: %v", err) + _ = fmt.Errorf("this is ok: %w", err) } func do() (bool, error) { diff --git a/tools/replay-http/BUILD.bazel b/tools/replay-http/BUILD.bazel index 81c3bef62b91..2e49a793a2b6 100644 --- a/tools/replay-http/BUILD.bazel +++ b/tools/replay-http/BUILD.bazel @@ -6,7 +6,10 @@ go_library( srcs = ["main.go"], importpath = "github.com/prysmaticlabs/prysm/v5/tools/replay-http", visibility = ["//visibility:private"], - deps = ["@com_github_sirupsen_logrus//:go_default_library"], + deps = [ + "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", + ], ) go_binary( diff --git a/tools/replay-http/main.go b/tools/replay-http/main.go index 517afad2a4b5..9c1bddcdde37 100644 --- a/tools/replay-http/main.go +++ b/tools/replay-http/main.go @@ -16,6 +16,7 @@ import ( "os" "path" + "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) @@ -42,7 +43,7 @@ func main() { lr := bufio.NewReader(f) for { line, err := lr.ReadBytes([]byte("\n")[0]) - if err == io.EOF { + if errors.Is(err, io.EOF) { os.Exit(0) } if err != nil { diff --git a/validator/accounts/userprompt/prompt.go b/validator/accounts/userprompt/prompt.go index 2aad4ba01ef6..e7083ab3d739 100644 --- a/validator/accounts/userprompt/prompt.go +++ b/validator/accounts/userprompt/prompt.go @@ -59,12 +59,12 @@ func InputDirectory(cliCtx *cli.Context, promptText string, flag *cli.StringFlag // FormatPromptError for the user. func FormatPromptError(err error) error { - switch err { - case promptui.ErrAbort: + switch { + case errors.Is(err, promptui.ErrAbort): return errors.New("wallet creation aborted, closing") - case promptui.ErrInterrupt: + case errors.Is(err, promptui.ErrInterrupt): return errors.New("keyboard interrupt, closing") - case promptui.ErrEOF: + case errors.Is(err, promptui.ErrEOF): return errors.New("no input received, closing") default: return err diff --git a/validator/client/aggregate_test.go b/validator/client/aggregate_test.go index 7951a744a2f0..fc820b0ed5ef 100644 --- a/validator/client/aggregate_test.go +++ b/validator/client/aggregate_test.go @@ -6,8 +6,6 @@ import ( "fmt" "testing" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -19,6 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" logTest "github.com/sirupsen/logrus/hooks/test" "go.uber.org/mock/gomock" ) diff --git a/validator/client/beacon-api/beacon_api_helpers.go b/validator/client/beacon-api/beacon_api_helpers.go index a931e4d96905..ea82f84d6e9e 100644 --- a/validator/client/beacon-api/beacon_api_helpers.go +++ b/validator/client/beacon-api/beacon_api_helpers.go @@ -12,7 +12,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) diff --git a/validator/client/beacon-api/beacon_api_validator_client_test.go b/validator/client/beacon-api/beacon_api_validator_client_test.go index 5b7587862ff2..63599d9f2f82 100644 --- a/validator/client/beacon-api/beacon_api_validator_client_test.go +++ b/validator/client/beacon-api/beacon_api_validator_client_test.go @@ -6,17 +6,16 @@ import ( "fmt" "testing" - "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "go.uber.org/mock/gomock" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" + "go.uber.org/mock/gomock" ) // Make sure that AttestationData() returns the same thing as the internal attestationData() diff --git a/validator/client/beacon-api/beacon_committee_selections.go b/validator/client/beacon-api/beacon_committee_selections.go index 304b2a7abfe4..44a25ebd8ea9 100644 --- a/validator/client/beacon-api/beacon_committee_selections.go +++ b/validator/client/beacon-api/beacon_committee_selections.go @@ -5,9 +5,8 @@ import ( "context" "encoding/json" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" ) type aggregatedSelectionResponse struct { diff --git a/validator/client/beacon-api/beacon_committee_selections_test.go b/validator/client/beacon-api/beacon_committee_selections_test.go index c0f1ff3d1523..647e7eee98d0 100644 --- a/validator/client/beacon-api/beacon_committee_selections_test.go +++ b/validator/client/beacon-api/beacon_committee_selections_test.go @@ -6,12 +6,11 @@ import ( "encoding/json" "testing" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "go.uber.org/mock/gomock" ) diff --git a/validator/client/beacon-api/doppelganger.go b/validator/client/beacon-api/doppelganger.go index 3b9c52c4ca80..2fa3887156f6 100644 --- a/validator/client/beacon-api/doppelganger.go +++ b/validator/client/beacon-api/doppelganger.go @@ -6,9 +6,8 @@ import ( "fmt" "strconv" - "github.com/pkg/errors" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" diff --git a/validator/client/beacon-api/status.go b/validator/client/beacon-api/status.go index bdec7502fec5..e0055b34a599 100644 --- a/validator/client/beacon-api/status.go +++ b/validator/client/beacon-api/status.go @@ -4,13 +4,12 @@ import ( "context" "strconv" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" ) func (c *beaconApiValidatorClient) validatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) { diff --git a/validator/client/beacon-api/status_test.go b/validator/client/beacon-api/status_test.go index 1803929d4f72..abff246c8f3e 100644 --- a/validator/client/beacon-api/status_test.go +++ b/validator/client/beacon-api/status_test.go @@ -6,16 +6,15 @@ import ( "fmt" "testing" - "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "go.uber.org/mock/gomock" ) diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go index 5082107af548..dac34f019dc6 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go @@ -6,7 +6,6 @@ import ( "sort" "github.com/golang/protobuf/ptypes/empty" - "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -58,15 +57,15 @@ func validatorCountByStatus(validators []*ethpb.Validator, statuses []validator. for _, val := range validators { readOnlyVal, err := statenative.NewValidator(val) if err != nil { - return nil, fmt.Errorf("could not convert validator: %v", err) + return nil, fmt.Errorf("could not convert validator: %w", err) } valStatus, err := helpers.ValidatorStatus(readOnlyVal, epoch) if err != nil { - return nil, fmt.Errorf("could not get validator status: %v", err) + return nil, fmt.Errorf("could not get validator status: %w", err) } valSubStatus, err := helpers.ValidatorSubStatus(readOnlyVal, epoch) if err != nil { - return nil, fmt.Errorf("could not get validator sub status: %v", err) + return nil, fmt.Errorf("could not get validator sub status: %w", err) } for _, status := range statuses { diff --git a/validator/client/iface/validator_client.go b/validator/client/iface/validator_client.go index f22d64e8cfa9..1fe0e85530ca 100644 --- a/validator/client/iface/validator_client.go +++ b/validator/client/iface/validator_client.go @@ -6,9 +6,8 @@ import ( "strconv" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/pkg/errors" - "github.com/golang/protobuf/ptypes/empty" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/client/event" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" diff --git a/validator/client/key_reload.go b/validator/client/key_reload.go index abb452071423..ab01e89f9306 100644 --- a/validator/client/key_reload.go +++ b/validator/client/key_reload.go @@ -4,11 +4,10 @@ import ( "context" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "go.opencensus.io/trace" ) diff --git a/validator/client/key_reload_test.go b/validator/client/key_reload_test.go index ae48c159eba4..781317341470 100644 --- a/validator/client/key_reload_test.go +++ b/validator/client/key_reload_test.go @@ -4,15 +4,14 @@ import ( "context" "testing" - validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" validatormock "github.com/prysmaticlabs/prysm/v5/testing/validator-mock" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/client/testutil" logTest "github.com/sirupsen/logrus/hooks/test" "go.uber.org/mock/gomock" diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index cefa2bd53f2b..f32b1ce0fede 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -6,11 +6,9 @@ import ( "sync/atomic" "time" - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/ethereum/go-ethereum/common/hexutil" emptypb "github.com/golang/protobuf/ptypes/empty" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -21,6 +19,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) diff --git a/validator/client/validator.go b/validator/client/validator.go index 447f8e919fa2..4d8fbc668061 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -265,7 +265,7 @@ func (v *validator) WaitForChainStart(ctx context.Context) error { log.Info("Syncing with beacon node to align on chain genesis info") chainStartRes, err := v.validatorClient.WaitForChainStart(ctx, &emptypb.Empty{}) - if err == io.EOF { + if errors.Is(err, io.EOF) { return client.ErrConnectionIssue } diff --git a/validator/client/wait_for_activation_test.go b/validator/client/wait_for_activation_test.go index 5b6200466fa7..333075fb637d 100644 --- a/validator/client/wait_for_activation_test.go +++ b/validator/client/wait_for_activation_test.go @@ -7,18 +7,17 @@ import ( "testing" "time" - "github.com/prysmaticlabs/prysm/v5/config/params" - validatorType "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" - "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + validatorType "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/mock" "github.com/prysmaticlabs/prysm/v5/testing/require" validatormock "github.com/prysmaticlabs/prysm/v5/testing/validator-mock" walletMock "github.com/prysmaticlabs/prysm/v5/validator/accounts/testing" + "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/derived" constant "github.com/prysmaticlabs/prysm/v5/validator/testing" logTest "github.com/sirupsen/logrus/hooks/test" diff --git a/validator/db/common/progress.go b/validator/db/common/progress.go index c9bbf211bbd3..9d622f682456 100644 --- a/validator/db/common/progress.go +++ b/validator/db/common/progress.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/k0kubun/go-ansi" - "github.com/schollz/progressbar/v3" ) diff --git a/validator/db/convert.go b/validator/db/convert.go index 25126e9e9e04..4b9626541838 100644 --- a/validator/db/convert.go +++ b/validator/db/convert.go @@ -125,14 +125,13 @@ func ConvertDatabase(ctx context.Context, sourceDataDir string, targetDataDir st // Get the proposer settings. proposerSettings, err := sourceDatabase.ProposerSettings(ctx) - switch err { - case nil: + switch { + case err == nil: // Save the proposer settings. if err := targetDatabase.SaveProposerSettings(ctx, proposerSettings); err != nil { return errors.Wrap(err, "could not save proposer settings") } - - case kv.ErrNoProposerSettingsFound, filesystem.ErrNoProposerSettingsFound: + case errors.Is(err, kv.ErrNoProposerSettingsFound), errors.Is(err, filesystem.ErrNoProposerSettingsFound): // Nothing to do. default: return errors.Wrap(err, "could not get proposer settings from source database") diff --git a/validator/db/convert_test.go b/validator/db/convert_test.go index 4718891daf92..eb581c109ffd 100644 --- a/validator/db/convert_test.go +++ b/validator/db/convert_test.go @@ -16,7 +16,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/db/common" "github.com/prysmaticlabs/prysm/v5/validator/db/filesystem" "github.com/prysmaticlabs/prysm/v5/validator/db/iface" - "github.com/prysmaticlabs/prysm/v5/validator/db/kv" ) diff --git a/validator/db/filesystem/db.go b/validator/db/filesystem/db.go index edaf9ea61c5e..50d1f27e29c1 100644 --- a/validator/db/filesystem/db.go +++ b/validator/db/filesystem/db.go @@ -11,14 +11,13 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/io/file" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/validator/db/iface" - "gopkg.in/yaml.v3" - - "github.com/pkg/errors" "github.com/sirupsen/logrus" + "gopkg.in/yaml.v3" ) const ( diff --git a/validator/db/filesystem/db_test.go b/validator/db/filesystem/db_test.go index 5d1b5110ceaa..0a2df5c1f632 100644 --- a/validator/db/filesystem/db_test.go +++ b/validator/db/filesystem/db_test.go @@ -11,7 +11,6 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/proposer" - "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/testing/require" diff --git a/validator/db/filesystem/proposer_settings.go b/validator/db/filesystem/proposer_settings.go index b4f443542d7b..db539f8c9b83 100644 --- a/validator/db/filesystem/proposer_settings.go +++ b/validator/db/filesystem/proposer_settings.go @@ -4,7 +4,6 @@ import ( "context" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/config/proposer" ) diff --git a/validator/db/filesystem/proposer_settings_test.go b/validator/db/filesystem/proposer_settings_test.go index 6d481775e176..3905210b8b9b 100644 --- a/validator/db/filesystem/proposer_settings_test.go +++ b/validator/db/filesystem/proposer_settings_test.go @@ -61,7 +61,7 @@ func TestStore_ProposerSettings(t *testing.T) { configuration: &Configuration{ ProposerSettings: &validatorpb.ProposerSettingsPayload{ ProposerConfig: map[string]*validatorpb.ProposerOptionPayload{ - pubkeyString: &validatorpb.ProposerOptionPayload{ + pubkeyString: { FeeRecipient: customFeeRecipientString, }, }, @@ -72,7 +72,7 @@ func TestStore_ProposerSettings(t *testing.T) { }, expectedProposerSettings: &proposer.Settings{ ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*proposer.Option{ - pubkey: &proposer.Option{ + pubkey: { FeeRecipientConfig: &proposer.FeeRecipientConfig{ FeeRecipient: customFeeRecipient, }, diff --git a/validator/graffiti/BUILD.bazel b/validator/graffiti/BUILD.bazel index dac4a43cf662..5dc68db9c998 100644 --- a/validator/graffiti/BUILD.bazel +++ b/validator/graffiti/BUILD.bazel @@ -11,6 +11,7 @@ go_library( deps = [ "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@in_gopkg_yaml_v2//:go_default_library", ], diff --git a/validator/graffiti/parse_graffiti.go b/validator/graffiti/parse_graffiti.go index b1199a97e264..358eabd4935e 100644 --- a/validator/graffiti/parse_graffiti.go +++ b/validator/graffiti/parse_graffiti.go @@ -5,6 +5,7 @@ import ( "os" "strings" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "gopkg.in/yaml.v2" @@ -32,7 +33,8 @@ func ParseGraffitiFile(f string) (*Graffiti, error) { } g := &Graffiti{} if err := yaml.UnmarshalStrict(yamlFile, g); err != nil { - if _, ok := err.(*yaml.TypeError); !ok { + var typeError *yaml.TypeError + if !errors.As(err, &typeError) { return nil, err } else { log.WithError(err).Error("There were some issues parsing graffiti from a yaml file.") diff --git a/validator/helpers/metadata_test.go b/validator/helpers/metadata_test.go index ca010f058198..0df70229c697 100644 --- a/validator/helpers/metadata_test.go +++ b/validator/helpers/metadata_test.go @@ -9,7 +9,6 @@ import ( "github.com/prometheus/client_golang/prometheus" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/proposer" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" diff --git a/validator/keymanager/remote-web3signer/v1/custom_mappers.go b/validator/keymanager/remote-web3signer/v1/custom_mappers.go index e6440445d688..69581fb5b00a 100644 --- a/validator/keymanager/remote-web3signer/v1/custom_mappers.go +++ b/validator/keymanager/remote-web3signer/v1/custom_mappers.go @@ -121,35 +121,35 @@ func MapBeaconBlockBody(body *ethpb.BeaconBlockBody) (*BeaconBlockBody, error) { for i, slashing := range body.ProposerSlashings { slashing, err := MapProposerSlashing(slashing) if err != nil { - return nil, fmt.Errorf("could not map proposer slashing at index %v: %v", i, err) + return nil, fmt.Errorf("could not map proposer slashing at index %v: %w", i, err) } block.ProposerSlashings[i] = slashing } for i, slashing := range body.AttesterSlashings { slashing, err := MapAttesterSlashing(slashing) if err != nil { - return nil, fmt.Errorf("could not map attester slashing at index %v: %v", i, err) + return nil, fmt.Errorf("could not map attester slashing at index %v: %w", i, err) } block.AttesterSlashings[i] = slashing } for i, attestation := range body.Attestations { attestation, err := MapAttestation(attestation) if err != nil { - return nil, fmt.Errorf("could not map attestation at index %v: %v", i, err) + return nil, fmt.Errorf("could not map attestation at index %v: %w", i, err) } block.Attestations[i] = attestation } for i, Deposit := range body.Deposits { deposit, err := MapDeposit(Deposit) if err != nil { - return nil, fmt.Errorf("could not map deposit at index %v: %v", i, err) + return nil, fmt.Errorf("could not map deposit at index %v: %w", i, err) } block.Deposits[i] = deposit } for i, signedVoluntaryExit := range body.VoluntaryExits { signedVoluntaryExit, err := MapSignedVoluntaryExit(signedVoluntaryExit) if err != nil { - return nil, fmt.Errorf("could not map signed voluntary exit at index %v: %v", i, err) + return nil, fmt.Errorf("could not map signed voluntary exit at index %v: %w", i, err) } block.VoluntaryExits[i] = signedVoluntaryExit } @@ -322,35 +322,35 @@ func MapBeaconBlockBodyAltair(body *ethpb.BeaconBlockBodyAltair) (*BeaconBlockBo for i, slashing := range body.ProposerSlashings { proposer, err := MapProposerSlashing(slashing) if err != nil { - return nil, fmt.Errorf("could not map proposer slashing at index %v: %v", i, err) + return nil, fmt.Errorf("could not map proposer slashing at index %v: %w", i, err) } block.ProposerSlashings[i] = proposer } for i, slashing := range body.AttesterSlashings { attesterSlashing, err := MapAttesterSlashing(slashing) if err != nil { - return nil, fmt.Errorf("could not map attester slashing at index %v: %v", i, err) + return nil, fmt.Errorf("could not map attester slashing at index %v: %w", i, err) } block.AttesterSlashings[i] = attesterSlashing } for i, attestation := range body.Attestations { attestation, err := MapAttestation(attestation) if err != nil { - return nil, fmt.Errorf("could not map attestation at index %v: %v", i, err) + return nil, fmt.Errorf("could not map attestation at index %v: %w", i, err) } block.Attestations[i] = attestation } for i, deposit := range body.Deposits { deposit, err := MapDeposit(deposit) if err != nil { - return nil, fmt.Errorf("could not map deposit at index %v: %v", i, err) + return nil, fmt.Errorf("could not map deposit at index %v: %w", i, err) } block.Deposits[i] = deposit } for i, exit := range body.VoluntaryExits { exit, err := MapSignedVoluntaryExit(exit) if err != nil { - return nil, fmt.Errorf("could not map signed voluntary exit at index %v: %v", i, err) + return nil, fmt.Errorf("could not map signed voluntary exit at index %v: %w", i, err) } block.VoluntaryExits[i] = exit } diff --git a/validator/rpc/handler_wallet.go b/validator/rpc/handler_wallet.go index e3771ac69175..d100d6ce0e3d 100644 --- a/validator/rpc/handler_wallet.go +++ b/validator/rpc/handler_wallet.go @@ -31,7 +31,7 @@ func (s *Server) CreateWallet(w http.ResponseWriter, r *http.Request) { var req CreateWalletRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -176,7 +176,7 @@ func (s *Server) RecoverWallet(w http.ResponseWriter, r *http.Request) { var req RecoverWalletRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -278,7 +278,7 @@ func (*Server) ValidateKeystores(w http.ResponseWriter, r *http.Request) { var req ValidateKeystoresRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: diff --git a/validator/rpc/handlers_accounts.go b/validator/rpc/handlers_accounts.go index 8ad2bbb85a32..724c0353b77c 100644 --- a/validator/rpc/handlers_accounts.go +++ b/validator/rpc/handlers_accounts.go @@ -95,7 +95,7 @@ func (s *Server) ListAccounts(w http.ResponseWriter, r *http.Request) { } start, end, nextPageToken, err := pagination.StartAndEndPage(pageToken, int(ps), len(keys)) if err != nil { - httputil.HandleError(w, fmt.Errorf("Could not paginate results: %v", + httputil.HandleError(w, fmt.Errorf("Could not paginate results: %w", err).Error(), http.StatusInternalServerError) return } @@ -123,7 +123,7 @@ func (s *Server) BackupAccounts(w http.ResponseWriter, r *http.Request) { var req BackupAccountsRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -232,7 +232,7 @@ func (s *Server) VoluntaryExit(w http.ResponseWriter, r *http.Request) { var req VoluntaryExitRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index 236945a2489b..d45dc17ce355 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -95,7 +95,7 @@ func (s *Server) ImportKeystores(w http.ResponseWriter, r *http.Request) { var req ImportKeystoresRequest err = json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -190,7 +190,7 @@ func (s *Server) DeleteKeystores(w http.ResponseWriter, r *http.Request) { var req DeleteKeystoresRequest err = json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -287,11 +287,11 @@ func (s *Server) publicKeysInDB(ctx context.Context) (map[[fieldparams.BLSPubkey pubKeysInDB := make(map[[fieldparams.BLSPubkeyLength]byte]bool) attestedPublicKeys, err := s.db.AttestedPublicKeys(ctx) if err != nil { - return nil, fmt.Errorf("could not get attested public keys from DB: %v", err) + return nil, fmt.Errorf("could not get attested public keys from DB: %w", err) } proposedPublicKeys, err := s.db.ProposedPublicKeys(ctx) if err != nil { - return nil, fmt.Errorf("could not get proposed public keys from DB: %v", err) + return nil, fmt.Errorf("could not get proposed public keys from DB: %w", err) } for _, pk := range append(attestedPublicKeys, proposedPublicKeys...) { pubKeysInDB[pk] = true @@ -451,7 +451,7 @@ func (s *Server) ImportRemoteKeys(w http.ResponseWriter, r *http.Request) { var req ImportRemoteKeysRequest err = json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -518,7 +518,7 @@ func (s *Server) DeleteRemoteKeys(w http.ResponseWriter, r *http.Request) { var req DeleteRemoteKeysRequest err = json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -605,7 +605,7 @@ func (s *Server) SetFeeRecipientByPubkey(w http.ResponseWriter, r *http.Request) var req SetFeeRecipientByPubkeyRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -756,7 +756,7 @@ func (s *Server) SetGasLimit(w http.ResponseWriter, r *http.Request) { var req SetGasLimitRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: @@ -899,7 +899,7 @@ func (s *Server) SetGraffiti(w http.ResponseWriter, r *http.Request) { } err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: diff --git a/validator/rpc/handlers_slashing.go b/validator/rpc/handlers_slashing.go index 49a1596bd66e..595047e2f25a 100644 --- a/validator/rpc/handlers_slashing.go +++ b/validator/rpc/handlers_slashing.go @@ -62,7 +62,7 @@ func (s *Server) ImportSlashingProtection(w http.ResponseWriter, r *http.Request var req ImportSlashingProtectionRequest err := json.NewDecoder(r.Body).Decode(&req) switch { - case err == io.EOF: + case errors.Is(err, io.EOF): httputil.HandleError(w, "No data submitted", http.StatusBadRequest) return case err != nil: From aea2a469cceb0d32c9b1998fbce14fdda524e014 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Mon, 8 Jul 2024 14:29:10 +0800 Subject: [PATCH 177/325] Update Libp2p (#14192) --- deps.bzl | 16 ++++++++-------- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/deps.bzl b/deps.bzl index 192c4fd13dbd..da7c8c7d02ff 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1443,8 +1443,8 @@ def prysm_deps(): go_repository( name = "com_github_gorilla_websocket", importpath = "github.com/gorilla/websocket", - sum = "h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=", - version = "v1.5.1", + sum = "h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=", + version = "v1.5.3", ) go_repository( name = "com_github_gostaticanalysis_comment", @@ -2105,8 +2105,8 @@ def prysm_deps(): ], build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p", - sum = "h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc=", - version = "v0.35.0", + sum = "h1:287oHbuplkrLdAF+syB0n/qDgd50AUBtEODqS0e0HDs=", + version = "v0.35.2", ) go_repository( name = "com_github_libp2p_go_libp2p_asn_util", @@ -2799,8 +2799,8 @@ def prysm_deps(): go_repository( name = "com_github_pion_ice_v2", importpath = "github.com/pion/ice/v2", - sum = "h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI=", - version = "v2.3.24", + sum = "h1:M5rJA07dqhi3nobJIg+uPtcVjFECTrhcR3n0ns8kDZs=", + version = "v2.3.25", ) go_repository( name = "com_github_pion_interceptor", @@ -4929,8 +4929,8 @@ def prysm_deps(): go_repository( name = "org_uber_go_fx", importpath = "go.uber.org/fx", - sum = "h1:RqBh3cYdzZS0uqwVeEjOX2p73dddLpym315myy/Bpb0=", - version = "v1.21.1", + sum = "h1:nvvln7mwyT5s1q201YE29V/BFrGor6vMiDNpU/78Mys=", + version = "v1.22.1", ) go_repository( name = "org_uber_go_goleak", diff --git a/go.mod b/go.mod index 7fef9c943ac8..482659fb5423 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/json-iterator/go v1.1.12 github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 github.com/kr/pretty v0.3.1 - github.com/libp2p/go-libp2p v0.35.0 + github.com/libp2p/go-libp2p v0.35.2 github.com/libp2p/go-libp2p-mplex v0.9.0 github.com/libp2p/go-libp2p-pubsub v0.11.0 github.com/libp2p/go-mplex v0.7.0 @@ -149,7 +149,7 @@ require ( github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect - github.com/gorilla/websocket v1.5.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/graph-gophers/graphql-go v1.3.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect @@ -211,7 +211,7 @@ require ( github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pion/datachannel v1.5.6 // indirect github.com/pion/dtls/v2 v2.2.11 // indirect - github.com/pion/ice/v2 v2.3.24 // indirect + github.com/pion/ice/v2 v2.3.25 // indirect github.com/pion/interceptor v0.1.29 // indirect github.com/pion/logging v0.2.2 // indirect github.com/pion/mdns v0.0.12 // indirect @@ -246,7 +246,7 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect go.uber.org/dig v1.17.1 // indirect - go.uber.org/fx v1.21.1 // indirect + go.uber.org/fx v1.22.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect diff --git a/go.sum b/go.sum index 6b438f575979..c15dec2fca65 100644 --- a/go.sum +++ b/go.sum @@ -480,8 +480,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= @@ -636,8 +636,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= -github.com/libp2p/go-libp2p v0.35.0 h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc= -github.com/libp2p/go-libp2p v0.35.0/go.mod h1:snyJQix4ET6Tj+LeI0VPjjxTtdWpeOhYt5lEY0KirkQ= +github.com/libp2p/go-libp2p v0.35.2 h1:287oHbuplkrLdAF+syB0n/qDgd50AUBtEODqS0e0HDs= +github.com/libp2p/go-libp2p v0.35.2/go.mod h1:RKCDNt30IkFipGL0tl8wQW/3zVWEGFUZo8g2gAKxwjU= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= @@ -868,8 +868,8 @@ github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNI github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= github.com/pion/dtls/v2 v2.2.11 h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks= github.com/pion/dtls/v2 v2.2.11/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= -github.com/pion/ice/v2 v2.3.24 h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI= -github.com/pion/ice/v2 v2.3.24/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= +github.com/pion/ice/v2 v2.3.25 h1:M5rJA07dqhi3nobJIg+uPtcVjFECTrhcR3n0ns8kDZs= +github.com/pion/ice/v2 v2.3.25/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M= github.com/pion/interceptor v0.1.29/go.mod h1:ri+LGNjRUc5xUNtDEPzfdkmSqISixVTBF/z/Zms/6T4= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= @@ -1188,8 +1188,8 @@ go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= -go.uber.org/fx v1.21.1 h1:RqBh3cYdzZS0uqwVeEjOX2p73dddLpym315myy/Bpb0= -go.uber.org/fx v1.21.1/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= +go.uber.org/fx v1.22.1 h1:nvvln7mwyT5s1q201YE29V/BFrGor6vMiDNpU/78Mys= +go.uber.org/fx v1.22.1/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= From 74b5f6ecf29b3cde457f4e52a71d1c81ea7cb54f Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Mon, 8 Jul 2024 17:28:41 +0800 Subject: [PATCH 178/325] Add Aggregated Public Key Method (#14178) * Add aggregated key method * Gazelle * Manu's Review --- beacon-chain/core/blocks/signature.go | 7 +---- beacon-chain/state/BUILD.bazel | 1 + beacon-chain/state/interfaces.go | 2 ++ beacon-chain/state/state-native/BUILD.bazel | 2 ++ .../state/state-native/getters_validator.go | 31 +++++++++++++++++++ .../state-native/getters_validator_test.go | 17 ++++++++++ 6 files changed, 54 insertions(+), 6 deletions(-) diff --git a/beacon-chain/core/blocks/signature.go b/beacon-chain/core/blocks/signature.go index c0f9741589cf..dedd5856ec68 100644 --- a/beacon-chain/core/blocks/signature.go +++ b/beacon-chain/core/blocks/signature.go @@ -204,12 +204,7 @@ func createAttestationSignatureBatch( return nil, err } indices := ia.GetAttestingIndices() - pubkeys := make([][]byte, len(indices)) - for i := 0; i < len(indices); i++ { - pubkeyAtIdx := beaconState.PubkeyAtIndex(primitives.ValidatorIndex(indices[i])) - pubkeys[i] = pubkeyAtIdx[:] - } - aggP, err := bls.AggregatePublicKeys(pubkeys) + aggP, err := beaconState.AggregateKeyFromIndices(indices) if err != nil { return nil, err } diff --git a/beacon-chain/state/BUILD.bazel b/beacon-chain/state/BUILD.bazel index fa1ee84cff41..295cfa2110d5 100644 --- a/beacon-chain/state/BUILD.bazel +++ b/beacon-chain/state/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "//config/fieldparams:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//crypto/bls:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 85c9bb9e25e2..949d735881ea 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -11,6 +11,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -129,6 +130,7 @@ type ReadOnlyValidators interface { ValidatorIndexByPubkey(key [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool) PublicKeys() ([][fieldparams.BLSPubkeyLength]byte, error) PubkeyAtIndex(idx primitives.ValidatorIndex) [fieldparams.BLSPubkeyLength]byte + AggregateKeyFromIndices(idxs []uint64) (bls.PublicKey, error) NumValidators() int ReadFromEveryValidator(f func(idx int, val ReadOnlyValidator) error) error } diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 46c8bb8e4497..da2f397025f1 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -68,6 +68,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//container/multi-value-slice:go_default_library", "//container/slice:go_default_library", + "//crypto/bls:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", @@ -141,6 +142,7 @@ go_test( "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/trie:go_default_library", + "//crypto/bls:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index 0f1df58b9cef..cfc3779c170e 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -223,6 +224,36 @@ func (b *BeaconState) PubkeyAtIndex(idx primitives.ValidatorIndex) [fieldparams. return bytesutil.ToBytes48(v.PublicKey) } +// AggregateKeyFromIndices builds an aggregated public key from the provided +// validator indices. +func (b *BeaconState) AggregateKeyFromIndices(idxs []uint64) (bls.PublicKey, error) { + b.lock.RLock() + defer b.lock.RUnlock() + + pubKeys := make([][]byte, len(idxs)) + for i, idx := range idxs { + var v *ethpb.Validator + if features.Get().EnableExperimentalState { + var err error + v, err = b.validatorsMultiValue.At(b, idx) + if err != nil { + return nil, err + } + } else { + if idx >= uint64(len(b.validators)) { + return nil, consensus_types.ErrOutOfBounds + } + v = b.validators[idx] + } + + if v == nil { + return nil, ErrNilWrappedValidator + } + pubKeys[i] = v.PublicKey + } + return bls.AggregatePublicKeys(pubKeys) +} + // PublicKeys builds a list of all validator public keys, with each key's index aligned to its validator index. func (b *BeaconState) PublicKeys() ([][fieldparams.BLSPubkeyLength]byte, error) { b.lock.RLock() diff --git a/beacon-chain/state/state-native/getters_validator_test.go b/beacon-chain/state/state-native/getters_validator_test.go index 81e823c19487..c4938832067d 100644 --- a/beacon-chain/state/state-native/getters_validator_test.go +++ b/beacon-chain/state/state-native/getters_validator_test.go @@ -10,7 +10,9 @@ import ( testtmpl "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/testing" "github.com/prysmaticlabs/prysm/v5/config/params" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) @@ -145,3 +147,18 @@ func TestPendingBalanceToWithdraw(t *testing.T) { require.NoError(t, err) require.Equal(t, uint64(600), ab) } + +func TestAggregateKeyFromIndices(t *testing.T) { + dState, _ := util.DeterministicGenesisState(t, 10) + pKey1 := dState.PubkeyAtIndex(3) + pKey2 := dState.PubkeyAtIndex(7) + pKey3 := dState.PubkeyAtIndex(9) + + aggKey, err := bls.AggregatePublicKeys([][]byte{pKey1[:], pKey2[:], pKey3[:]}) + require.NoError(t, err) + + retKey, err := dState.AggregateKeyFromIndices([]uint64{3, 7, 9}) + require.NoError(t, err) + + assert.Equal(t, true, aggKey.Equals(retKey), "unequal aggregated keys") +} From ae5b0b4391a1f929418977107e6c2ec529425f41 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 8 Jul 2024 11:37:57 -0500 Subject: [PATCH 179/325] Electra: EIP-7251 update `process_pending_balance_deposits` (#14177) * EIP-7251: Implement changes from https://github.com/ethereum/consensus-specs/pull/3776 * Unskip epoch processing spectest * EIP-7251: unit tests for logic in https://github.com/ethereum/consensus-specs/pull/3776 * Radek feedback --- beacon-chain/core/electra/deposits.go | 80 ++++++++++++++++--- beacon-chain/core/electra/deposits_test.go | 74 +++++++++++++++++ .../electra/epoch_processing/helpers.go | 1 - 3 files changed, 141 insertions(+), 14 deletions(-) diff --git a/beacon-chain/core/electra/deposits.go b/beacon-chain/core/electra/deposits.go index db18d5b575b7..80c16bea3668 100644 --- a/beacon-chain/core/electra/deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -2,6 +2,7 @@ package electra import ( "context" + "fmt" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" @@ -13,7 +14,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/contracts/deposit" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" log "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -190,12 +193,27 @@ func verifyDepositDataSigningRoot(obj *ethpb.Deposit_Data, domain []byte) error // available_for_processing = state.deposit_balance_to_consume + get_activation_exit_churn_limit(state) // processed_amount = 0 // next_deposit_index = 0 +// deposits_to_postpone = [] // // for deposit in state.pending_balance_deposits: -// if processed_amount + deposit.amount > available_for_processing: -// break -// increase_balance(state, deposit.index, deposit.amount) -// processed_amount += deposit.amount +// validator = state.validators[deposit.index] +// # Validator is exiting, postpone the deposit until after withdrawable epoch +// if validator.exit_epoch < FAR_FUTURE_EPOCH: +// if get_current_epoch(state) <= validator.withdrawable_epoch: +// deposits_to_postpone.append(deposit) +// # Deposited balance will never become active. Increase balance but do not consume churn +// else: +// increase_balance(state, deposit.index, deposit.amount) +// # Validator is not exiting, attempt to process deposit +// else: +// # Deposit does not fit in the churn, no more deposit processing in this epoch. +// if processed_amount + deposit.amount > available_for_processing: +// break +// # Deposit fits in the churn, process it. Increase balance and consume churn. +// else: +// increase_balance(state, deposit.index, deposit.amount) +// processed_amount += deposit.amount +// # Regardless of how the deposit was handled, we move on in the queue. // next_deposit_index += 1 // // state.pending_balance_deposits = state.pending_balance_deposits[next_deposit_index:] @@ -204,6 +222,8 @@ func verifyDepositDataSigningRoot(obj *ethpb.Deposit_Data, domain []byte) error // state.deposit_balance_to_consume = Gwei(0) // else: // state.deposit_balance_to_consume = available_for_processing - processed_amount +// +// state.pending_balance_deposits += deposits_to_postpone func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, activeBalance primitives.Gwei) error { _, span := trace.StartSpan(ctx, "electra.ProcessPendingBalanceDeposits") defer span.End() @@ -216,35 +236,69 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac if err != nil { return err } - availableForProcessing := depBalToConsume + helpers.ActivationExitChurnLimit(activeBalance) + processedAmount := uint64(0) nextDepositIndex := 0 + var depositsToPostpone []*eth.PendingBalanceDeposit deposits, err := st.PendingBalanceDeposits() if err != nil { return err } + // constants + ffe := params.BeaconConfig().FarFutureEpoch + curEpoch := slots.ToEpoch(st.Slot()) + for _, balanceDeposit := range deposits { - if primitives.Gwei(balanceDeposit.Amount) > availableForProcessing { - break + v, err := st.ValidatorAtIndexReadOnly(balanceDeposit.Index) + if err != nil { + return fmt.Errorf("failed to fetch validator at index: %w", err) } - if err := helpers.IncreaseBalance(st, balanceDeposit.Index, balanceDeposit.Amount); err != nil { - return err + + // If the validator is currently exiting, postpone the deposit until after the withdrawable + // epoch. + if v.ExitEpoch() < ffe { + if curEpoch <= v.WithdrawableEpoch() { + depositsToPostpone = append(depositsToPostpone, balanceDeposit) + } else { + // The deposited balance will never become active. Therefore, we increase the balance but do + // not consume the churn. + if err := helpers.IncreaseBalance(st, balanceDeposit.Index, balanceDeposit.Amount); err != nil { + return err + } + } + } else { + // Validator is not exiting, attempt to process deposit. + if primitives.Gwei(processedAmount+balanceDeposit.Amount) > availableForProcessing { + break + } + // Deposit fits in churn, process it. Increase balance and consume churn. + if err := helpers.IncreaseBalance(st, balanceDeposit.Index, balanceDeposit.Amount); err != nil { + return err + } + processedAmount += balanceDeposit.Amount } - availableForProcessing -= primitives.Gwei(balanceDeposit.Amount) + + // Regardless of how the deposit was handled, we move on in the queue. nextDepositIndex++ } - deposits = deposits[nextDepositIndex:] + // Combined operation: + // - state.pending_balance_deposits = state.pending_balance_deposits[next_deposit_index:] + // - state.pending_balance_deposits += deposits_to_postpone + // However, the number of remaining deposits must be maintained to properly update the deposit + // balance to consume. + numRemainingDeposits := len(deposits[nextDepositIndex:]) + deposits = append(deposits[nextDepositIndex:], depositsToPostpone...) if err := st.SetPendingBalanceDeposits(deposits); err != nil { return err } - if len(deposits) == 0 { + if numRemainingDeposits == 0 { return st.SetDepositBalanceToConsume(0) } else { - return st.SetDepositBalanceToConsume(availableForProcessing) + return st.SetDepositBalanceToConsume(availableForProcessing - primitives.Gwei(processedAmount)) } } diff --git a/beacon-chain/core/electra/deposits_test.go b/beacon-chain/core/electra/deposits_test.go index fe160d55c4bc..e498ea613119 100644 --- a/beacon-chain/core/electra/deposits_test.go +++ b/beacon-chain/core/electra/deposits_test.go @@ -107,6 +107,80 @@ func TestProcessPendingBalanceDeposits(t *testing.T) { require.Equal(t, params.BeaconConfig().MinActivationBalance+uint64(amountAvailForProcessing)/5, b) } + // All of the balance deposits should have been processed. + remaining, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(remaining)) + }, + }, + { + name: "exiting validator deposit postponed", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 1_000) + require.NoError(t, st.SetDepositBalanceToConsume(0)) + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + deps := make([]*eth.PendingBalanceDeposit, 5) + for i := 0; i < len(deps); i += 1 { + deps[i] = ð.PendingBalanceDeposit{ + Amount: uint64(amountAvailForProcessing) / 5, + Index: primitives.ValidatorIndex(i), + } + } + require.NoError(t, st.SetPendingBalanceDeposits(deps)) + v, err := st.ValidatorAtIndex(0) + require.NoError(t, err) + v.ExitEpoch = 10 + v.WithdrawableEpoch = 20 + require.NoError(t, st.UpdateValidatorAtIndex(0, v)) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + res, err := st.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, primitives.Gwei(0), res) + // Validators 1..4 should have their balance increased + for i := primitives.ValidatorIndex(1); i < 4; i++ { + b, err := st.BalanceAtIndex(i) + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MinActivationBalance+uint64(amountAvailForProcessing)/5, b) + } + + // All of the balance deposits should have been processed, except validator index 0 was + // added back to the pending deposits queue. + remaining, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 1, len(remaining)) + }, + }, + { + name: "exited validator balance increased", + state: func() state.BeaconState { + st := stateWithActiveBalanceETH(t, 1_000) + deps := make([]*eth.PendingBalanceDeposit, 1) + for i := 0; i < len(deps); i += 1 { + deps[i] = ð.PendingBalanceDeposit{ + Amount: 1_000_000, + Index: primitives.ValidatorIndex(i), + } + } + require.NoError(t, st.SetPendingBalanceDeposits(deps)) + v, err := st.ValidatorAtIndex(0) + require.NoError(t, err) + v.ExitEpoch = 2 + v.WithdrawableEpoch = 8 + require.NoError(t, st.UpdateValidatorAtIndex(0, v)) + require.NoError(t, st.UpdateBalancesAtIndex(0, 100_000)) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + res, err := st.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, primitives.Gwei(0), res) + b, err := st.BalanceAtIndex(0) + require.NoError(t, err) + require.Equal(t, uint64(1_100_000), b) + // All of the balance deposits should have been processed. remaining, err := st.PendingBalanceDeposits() require.NoError(t, err) diff --git a/testing/spectest/shared/electra/epoch_processing/helpers.go b/testing/spectest/shared/electra/epoch_processing/helpers.go index 5ad4178f2cd3..6fe2e87c9534 100644 --- a/testing/spectest/shared/electra/epoch_processing/helpers.go +++ b/testing/spectest/shared/electra/epoch_processing/helpers.go @@ -27,7 +27,6 @@ func RunEpochOperationTest( testFolderPath string, operationFn epochOperation, ) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") preBeaconStateFile, err := util.BazelFileBytes(path.Join(testFolderPath, "pre.ssz_snappy")) require.NoError(t, err) preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) From 318561999d93b892458e7dfbeeb7a0d29ab6ce63 Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 8 Jul 2024 20:47:29 -0300 Subject: [PATCH 180/325] copy just the pointer in the votes loop (#14196) --- beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go index 941d3c47d51a..caacb7807528 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go +++ b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go @@ -267,11 +267,12 @@ func (f *ForkChoice) updateBalances() error { newBalances := f.justifiedBalances zHash := params.BeaconConfig().ZeroHash - for index, vote := range f.votes { + for index := 0; index < len(f.votes); index++ { // Skip if validator has been slashed if f.store.slashedIndices[primitives.ValidatorIndex(index)] { continue } + vote := &f.votes[index] // Skip if validator has never voted for current root and next root (i.e. if the // votes are zero hash aka genesis block), there's nothing to compute. if vote.currentRoot == zHash && vote.nextRoot == zHash { From 9dc3b645c46956f7ff3ff1a04b0fefc0a9c5366f Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Tue, 9 Jul 2024 20:41:07 +0800 Subject: [PATCH 181/325] Optimize ProcessRegistryUpdates Further (#14197) * Add it in * Clean it Up --- beacon-chain/core/electra/registry_updates.go | 2 +- beacon-chain/core/epoch/epoch_processing.go | 2 +- beacon-chain/core/helpers/validators.go | 10 +++------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/beacon-chain/core/electra/registry_updates.go b/beacon-chain/core/electra/registry_updates.go index f7991ea594d9..89824fb84fbe 100644 --- a/beacon-chain/core/electra/registry_updates.go +++ b/beacon-chain/core/electra/registry_updates.go @@ -58,7 +58,7 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) error { } // Collect validators eligible for activation and not yet dequeued for activation. - if helpers.IsEligibleForActivationUsingTrie(st, val) { + if helpers.IsEligibleForActivationUsingROVal(st, val) { eligibleForActivation = append(eligibleForActivation, primitives.ValidatorIndex(idx)) } diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index a1ea5a289759..7856b83d45dc 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -96,7 +96,7 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) (state.Be } // Collect validators eligible for activation and not yet dequeued for activation. - if helpers.IsEligibleForActivationUsingTrie(st, val) { + if helpers.IsEligibleForActivationUsingROVal(st, val) { eligibleForActivation = append(eligibleForActivation, primitives.ValidatorIndex(idx)) } diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index 9726b5d2d042..d213c136f197 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -470,13 +470,9 @@ func IsEligibleForActivation(state state.ReadOnlyCheckpoint, validator *ethpb.Va return isEligibleForActivation(validator.ActivationEligibilityEpoch, validator.ActivationEpoch, finalizedEpoch) } -// IsEligibleForActivationUsingTrie checks if the validator is eligible for activation. -func IsEligibleForActivationUsingTrie(state state.ReadOnlyCheckpoint, validator state.ReadOnlyValidator) bool { - cpt := state.FinalizedCheckpoint() - if cpt == nil { - return false - } - return isEligibleForActivation(validator.ActivationEligibilityEpoch(), validator.ActivationEpoch(), cpt.Epoch) +// IsEligibleForActivationUsingROVal checks if the validator is eligible for activation using the provided read only validator. +func IsEligibleForActivationUsingROVal(state state.ReadOnlyCheckpoint, validator state.ReadOnlyValidator) bool { + return isEligibleForActivation(validator.ActivationEligibilityEpoch(), validator.ActivationEpoch(), state.FinalizedCheckpointEpoch()) } // isEligibleForActivation carries out the logic for IsEligibleForActivation* From 18be899aefdab3ae448f77dd7639bbc30a83c3ee Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 9 Jul 2024 15:13:48 -0500 Subject: [PATCH 182/325] Electra: EIP-7251 Update `process_voluntary_exit` (#14176) * Electra: EIP-7251 Update `process_voluntary_exit` * Add unit test for VerifyExitAndSignature EIP-7251 * @potuz peer feedback --- beacon-chain/core/blocks/exit.go | 23 ++++++-- beacon-chain/core/blocks/exit_test.go | 53 ++++++++++++++++++- .../electra/operations/voluntary_exit_test.go | 1 - .../electra/operations/voluntary_exit_test.go | 1 - 4 files changed, 71 insertions(+), 7 deletions(-) diff --git a/beacon-chain/core/blocks/exit.go b/beacon-chain/core/blocks/exit.go index 046b9bbc1a49..99da22fae90a 100644 --- a/beacon-chain/core/blocks/exit.go +++ b/beacon-chain/core/blocks/exit.go @@ -98,6 +98,8 @@ func ProcessVoluntaryExits( // assert get_current_epoch(state) >= voluntary_exit.epoch // # Verify the validator has been active long enough // assert get_current_epoch(state) >= validator.activation_epoch + SHARD_COMMITTEE_PERIOD +// # Only exit validator if it has no pending withdrawals in the queue +// assert get_pending_balance_to_withdraw(state, voluntary_exit.validator_index) == 0 # [New in Electra:EIP7251] // # Verify signature // domain = get_domain(state, DOMAIN_VOLUNTARY_EXIT, voluntary_exit.epoch) // signing_root = compute_signing_root(voluntary_exit, domain) @@ -113,7 +115,6 @@ func VerifyExitAndSignature( return errors.New("nil exit") } - currentSlot := state.Slot() fork := state.Fork() genesisRoot := state.GenesisValidatorsRoot() @@ -128,7 +129,7 @@ func VerifyExitAndSignature( } exit := signed.Exit - if err := verifyExitConditions(validator, currentSlot, exit); err != nil { + if err := verifyExitConditions(state, validator, exit); err != nil { return err } domain, err := signing.Domain(fork, exit.Epoch, params.BeaconConfig().DomainVoluntaryExit, genesisRoot) @@ -157,14 +158,16 @@ func VerifyExitAndSignature( // assert get_current_epoch(state) >= voluntary_exit.epoch // # Verify the validator has been active long enough // assert get_current_epoch(state) >= validator.activation_epoch + SHARD_COMMITTEE_PERIOD +// # Only exit validator if it has no pending withdrawals in the queue +// assert get_pending_balance_to_withdraw(state, voluntary_exit.validator_index) == 0 # [New in Electra:EIP7251] // # Verify signature // domain = get_domain(state, DOMAIN_VOLUNTARY_EXIT, voluntary_exit.epoch) // signing_root = compute_signing_root(voluntary_exit, domain) // assert bls.Verify(validator.pubkey, signing_root, signed_voluntary_exit.signature) // # Initiate exit // initiate_validator_exit(state, voluntary_exit.validator_index) -func verifyExitConditions(validator state.ReadOnlyValidator, currentSlot primitives.Slot, exit *ethpb.VoluntaryExit) error { - currentEpoch := slots.ToEpoch(currentSlot) +func verifyExitConditions(st state.ReadOnlyBeaconState, validator state.ReadOnlyValidator, exit *ethpb.VoluntaryExit) error { + currentEpoch := slots.ToEpoch(st.Slot()) // Verify the validator is active. if !helpers.IsActiveValidatorUsingTrie(validator, currentEpoch) { return errors.New("non-active validator cannot exit") @@ -187,5 +190,17 @@ func verifyExitConditions(validator state.ReadOnlyValidator, currentSlot primiti validator.ActivationEpoch()+params.BeaconConfig().ShardCommitteePeriod, ) } + + if st.Version() >= version.Electra { + // Only exit validator if it has no pending withdrawals in the queue. + pbw, err := st.PendingBalanceToWithdraw(exit.ValidatorIndex) + if err != nil { + return fmt.Errorf("unable to retrieve pending balance to withdraw for validator %d: %w", exit.ValidatorIndex, err) + } + if pbw != 0 { + return fmt.Errorf("validator %d must have no pending balance to withdraw, got %d pending balance to withdraw", exit.ValidatorIndex, pbw) + } + } + return nil } diff --git a/beacon-chain/core/blocks/exit_test.go b/beacon-chain/core/blocks/exit_test.go index d40f35f7a2be..bda5f7ef81b4 100644 --- a/beacon-chain/core/blocks/exit_test.go +++ b/beacon-chain/core/blocks/exit_test.go @@ -135,6 +135,11 @@ func TestProcessVoluntaryExits_AppliesCorrectStatus(t *testing.T) { } func TestVerifyExitAndSignature(t *testing.T) { + // Remove after electra fork epoch is defined. + cfg := params.BeaconConfig() + cfg.ElectraForkEpoch = cfg.DenebForkEpoch * 2 + params.SetActiveTestCleanup(t, cfg) + // End remove section. denebSlot, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch) require.NoError(t, err) tests := []struct { @@ -167,7 +172,7 @@ func TestVerifyExitAndSignature(t *testing.T) { wantErr: "nil exit", }, { - name: "Happy Path", + name: "Happy Path phase0", setup: func() (*ethpb.Validator, *ethpb.SignedVoluntaryExit, state.ReadOnlyBeaconState, error) { fork := ðpb.Fork{ PreviousVersion: params.BeaconConfig().GenesisForkVersion, @@ -275,6 +280,52 @@ func TestVerifyExitAndSignature(t *testing.T) { return validator, signedExit, bs, nil }, }, + { + name: "EIP-7251 - pending balance to withdraw must be zero", + setup: func() (*ethpb.Validator, *ethpb.SignedVoluntaryExit, state.ReadOnlyBeaconState, error) { + fork := ðpb.Fork{ + PreviousVersion: params.BeaconConfig().DenebForkVersion, + CurrentVersion: params.BeaconConfig().ElectraForkVersion, + Epoch: params.BeaconConfig().ElectraForkEpoch, + } + signedExit := ðpb.SignedVoluntaryExit{ + Exit: ðpb.VoluntaryExit{ + Epoch: params.BeaconConfig().DenebForkEpoch + 1, + ValidatorIndex: 0, + }, + } + electraSlot, err := slots.EpochStart(params.BeaconConfig().ElectraForkEpoch) + require.NoError(t, err) + bs, keys := util.DeterministicGenesisState(t, 1) + bs, err = state_native.InitializeFromProtoUnsafeElectra(ðpb.BeaconStateElectra{ + GenesisValidatorsRoot: bs.GenesisValidatorsRoot(), + Fork: fork, + Slot: electraSlot, + Validators: bs.Validators(), + }) + if err != nil { + return nil, nil, nil, err + } + validator := bs.Validators()[0] + validator.ActivationEpoch = 1 + err = bs.UpdateValidatorAtIndex(0, validator) + require.NoError(t, err) + sb, err := signing.ComputeDomainAndSign(bs, signedExit.Exit.Epoch, signedExit.Exit, params.BeaconConfig().DomainVoluntaryExit, keys[0]) + require.NoError(t, err) + sig, err := bls.SignatureFromBytes(sb) + require.NoError(t, err) + signedExit.Signature = sig.Marshal() + + // Give validator a pending balance to withdraw. + require.NoError(t, bs.AppendPendingPartialWithdrawal(ðpb.PendingPartialWithdrawal{ + Index: 0, + Amount: 500, + })) + + return validator, signedExit, bs, nil + }, + wantErr: "validator 0 must have no pending balance to withdraw", + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go b/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go index ed87d6df8b87..c0f18adecf2f 100644 --- a/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go +++ b/testing/spectest/mainnet/electra/operations/voluntary_exit_test.go @@ -7,6 +7,5 @@ import ( ) func TestMainnet_Electra_Operations_VoluntaryExit(t *testing.T) { - t.Skip("TODO: Electra") operations.RunVoluntaryExitTest(t, "mainnet") } diff --git a/testing/spectest/minimal/electra/operations/voluntary_exit_test.go b/testing/spectest/minimal/electra/operations/voluntary_exit_test.go index ab3098ed6b0c..ef54818ada01 100644 --- a/testing/spectest/minimal/electra/operations/voluntary_exit_test.go +++ b/testing/spectest/minimal/electra/operations/voluntary_exit_test.go @@ -7,6 +7,5 @@ import ( ) func TestMinimal_Electra_Operations_VoluntaryExit(t *testing.T) { - t.Skip("TODO: Electra") operations.RunVoluntaryExitTest(t, "minimal") } From f8950c8c4044aea38ca09a734963d27193f6cb49 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Wed, 10 Jul 2024 13:51:41 +0800 Subject: [PATCH 183/325] Avoid Cloning When Creating a New Gossip Message (#14201) * Add Current Changes * add back check * Avoid a Panic --- beacon-chain/p2p/gossip_topic_mappings.go | 42 +++++++++++-------- .../p2p/gossip_topic_mappings_test.go | 2 +- beacon-chain/sync/decode_pubsub.go | 3 +- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/beacon-chain/p2p/gossip_topic_mappings.go b/beacon-chain/p2p/gossip_topic_mappings.go index 31733df0aa83..d88a4499ce2b 100644 --- a/beacon-chain/p2p/gossip_topic_mappings.go +++ b/beacon-chain/p2p/gossip_topic_mappings.go @@ -11,17 +11,17 @@ import ( // gossipTopicMappings represent the protocol ID to protobuf message type map for easy // lookup. -var gossipTopicMappings = map[string]proto.Message{ - BlockSubnetTopicFormat: ðpb.SignedBeaconBlock{}, - AttestationSubnetTopicFormat: ðpb.Attestation{}, - ExitSubnetTopicFormat: ðpb.SignedVoluntaryExit{}, - ProposerSlashingSubnetTopicFormat: ðpb.ProposerSlashing{}, - AttesterSlashingSubnetTopicFormat: ðpb.AttesterSlashing{}, - AggregateAndProofSubnetTopicFormat: ðpb.SignedAggregateAttestationAndProof{}, - SyncContributionAndProofSubnetTopicFormat: ðpb.SignedContributionAndProof{}, - SyncCommitteeSubnetTopicFormat: ðpb.SyncCommitteeMessage{}, - BlsToExecutionChangeSubnetTopicFormat: ðpb.SignedBLSToExecutionChange{}, - BlobSubnetTopicFormat: ðpb.BlobSidecar{}, +var gossipTopicMappings = map[string]func() proto.Message{ + BlockSubnetTopicFormat: func() proto.Message { return ðpb.SignedBeaconBlock{} }, + AttestationSubnetTopicFormat: func() proto.Message { return ðpb.Attestation{} }, + ExitSubnetTopicFormat: func() proto.Message { return ðpb.SignedVoluntaryExit{} }, + ProposerSlashingSubnetTopicFormat: func() proto.Message { return ðpb.ProposerSlashing{} }, + AttesterSlashingSubnetTopicFormat: func() proto.Message { return ðpb.AttesterSlashing{} }, + AggregateAndProofSubnetTopicFormat: func() proto.Message { return ðpb.SignedAggregateAttestationAndProof{} }, + SyncContributionAndProofSubnetTopicFormat: func() proto.Message { return ðpb.SignedContributionAndProof{} }, + SyncCommitteeSubnetTopicFormat: func() proto.Message { return ðpb.SyncCommitteeMessage{} }, + BlsToExecutionChangeSubnetTopicFormat: func() proto.Message { return ðpb.SignedBLSToExecutionChange{} }, + BlobSubnetTopicFormat: func() proto.Message { return ðpb.BlobSidecar{} }, } // GossipTopicMappings is a function to return the assigned data type @@ -44,27 +44,35 @@ func GossipTopicMappings(topic string, epoch primitives.Epoch) proto.Message { if epoch >= params.BeaconConfig().AltairForkEpoch { return ðpb.SignedBeaconBlockAltair{} } - return gossipTopicMappings[topic] + return gossipMessage(topic) case AttestationSubnetTopicFormat: if epoch >= params.BeaconConfig().ElectraForkEpoch { return ðpb.AttestationElectra{} } - return gossipTopicMappings[topic] + return gossipMessage(topic) case AttesterSlashingSubnetTopicFormat: if epoch >= params.BeaconConfig().ElectraForkEpoch { return ðpb.AttesterSlashingElectra{} } - return gossipTopicMappings[topic] + return gossipMessage(topic) case AggregateAndProofSubnetTopicFormat: if epoch >= params.BeaconConfig().ElectraForkEpoch { return ðpb.SignedAggregateAttestationAndProofElectra{} } - return gossipTopicMappings[topic] + return gossipMessage(topic) default: - return gossipTopicMappings[topic] + return gossipMessage(topic) } } +func gossipMessage(topic string) proto.Message { + msgGen, ok := gossipTopicMappings[topic] + if !ok { + return nil + } + return msgGen() +} + // AllTopics returns all topics stored in our // gossip mapping. func AllTopics() []string { @@ -81,7 +89,7 @@ var GossipTypeMapping = make(map[reflect.Type]string, len(gossipTopicMappings)) func init() { for k, v := range gossipTopicMappings { - GossipTypeMapping[reflect.TypeOf(v)] = k + GossipTypeMapping[reflect.TypeOf(v())] = k } // Specially handle Altair objects. GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockAltair{})] = BlockSubnetTopicFormat diff --git a/beacon-chain/p2p/gossip_topic_mappings_test.go b/beacon-chain/p2p/gossip_topic_mappings_test.go index efe7f00e6e4f..2c134f425fa6 100644 --- a/beacon-chain/p2p/gossip_topic_mappings_test.go +++ b/beacon-chain/p2p/gossip_topic_mappings_test.go @@ -15,7 +15,7 @@ func TestMappingHasNoDuplicates(t *testing.T) { params.SetupTestConfigCleanup(t) m := make(map[reflect.Type]bool) for _, v := range gossipTopicMappings { - if _, ok := m[reflect.TypeOf(v)]; ok { + if _, ok := m[reflect.TypeOf(v())]; ok { t.Errorf("%T is duplicated in the topic mapping", v) } m[reflect.TypeOf(v)] = true diff --git a/beacon-chain/sync/decode_pubsub.go b/beacon-chain/sync/decode_pubsub.go index a0e6070149c2..1ec9d079448a 100644 --- a/beacon-chain/sync/decode_pubsub.go +++ b/beacon-chain/sync/decode_pubsub.go @@ -16,7 +16,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "google.golang.org/protobuf/proto" ) var errNilPubsubMessage = errors.New("nil pubsub message") @@ -52,7 +51,7 @@ func (s *Service) decodePubsubMessage(msg *pubsub.Message) (ssz.Unmarshaler, err if base == nil { return nil, p2p.ErrMessageNotMapped } - m, ok := proto.Clone(base).(ssz.Unmarshaler) + m, ok := base.(ssz.Unmarshaler) if !ok { return nil, errors.Errorf("message of %T does not support marshaller interface", base) } From 7c81c7da903884fd34ead687cfcba2ab6848639b Mon Sep 17 00:00:00 2001 From: kira Date: Wed, 10 Jul 2024 04:08:37 -0700 Subject: [PATCH 184/325] fix: Multiple network flags should prevent the BN to start (#14169) * Implement Initial Logic * Include check in main.go * Add tests for multiple flags * remove usage of append * remove config/features dependency * Move ValidateNetworkFlags to config/features * Nit * removed NetworkFlags from cmd * remove usage of empty string literal * add comment * add flag validation to prysctl validator-exit --------- Co-authored-by: Manu NALEPA --- cmd/beacon-chain/main.go | 4 +++ cmd/prysmctl/validator/cmd.go | 3 +++ cmd/validator/main.go | 4 +++ config/features/config.go | 24 +++++++++++++++++ config/features/config_test.go | 47 ++++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+) diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index b74f9d523671..19819c8e4316 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -212,6 +212,10 @@ func before(ctx *cli.Context) error { return errors.Wrap(err, "failed to set max fd limits") } + if err := features.ValidateNetworkFlags(ctx); err != nil { + return errors.Wrap(err, "provided multiple network flags") + } + return cmd.ValidateNoArgs(ctx) } diff --git a/cmd/prysmctl/validator/cmd.go b/cmd/prysmctl/validator/cmd.go index 54cb99a5e70d..fa25ca70df4b 100644 --- a/cmd/prysmctl/validator/cmd.go +++ b/cmd/prysmctl/validator/cmd.go @@ -175,6 +175,9 @@ var Commands = []*cli.Command{ if err := cmd.LoadFlagsFromConfig(cliCtx, cliCtx.Command.Flags); err != nil { return err } + if err := features.ValidateNetworkFlags(cliCtx); err != nil { + return err + } if err := tos.VerifyTosAcceptedOrPrompt(cliCtx); err != nil { return err } diff --git a/cmd/validator/main.go b/cmd/validator/main.go index c4584f955b07..cb0287a60c7f 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -193,6 +193,10 @@ func main() { return errors.Wrap(err, "failed to setup debug") } + if err := features.ValidateNetworkFlags(ctx); err != nil { + return errors.Wrap(err, "provided multiple network flags") + } + return cmd.ValidateNoArgs(ctx) }, After: func(ctx *cli.Context) error { diff --git a/config/features/config.go b/config/features/config.go index 925d32a89e28..3926af4a2f0d 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -20,6 +20,8 @@ The process for implementing new features using this package is as follows: package features import ( + "fmt" + "strings" "sync" "time" @@ -337,3 +339,25 @@ func logDisabled(flag cli.DocGenerationFlag) { } log.WithField(name, flag.GetUsage()).Warn(disabledFeatureFlag) } + +// ValidateNetworkFlags validates provided flags and +// prevents beacon node or validator to start +// if more than one network flag is provided +func ValidateNetworkFlags(ctx *cli.Context) error { + networkFlagsCount := 0 + for _, flag := range NetworkFlags { + if ctx.IsSet(flag.Names()[0]) { + networkFlagsCount++ + if networkFlagsCount > 1 { + // using a forLoop so future addition + // doesn't require changes in this function + var flagNames []string + for _, flag := range NetworkFlags { + flagNames = append(flagNames, "--"+flag.Names()[0]) + } + return fmt.Errorf("cannot use more than one network flag at the same time. Possible network flags are: %s", strings.Join(flagNames, ", ")) + } + } + } + return nil +} diff --git a/config/features/config_test.go b/config/features/config_test.go index 313945c0cc21..35ee7dfe5fcd 100644 --- a/config/features/config_test.go +++ b/config/features/config_test.go @@ -46,3 +46,50 @@ func TestConfigureBeaconConfig(t *testing.T) { c := Get() assert.Equal(t, true, c.EnableSlasher) } + +func TestValidateNetworkFlags(t *testing.T) { + // Define the test cases + tests := []struct { + name string + args []string + wantErr bool + }{ + { + name: "No network flags", + args: []string{"command"}, + wantErr: false, + }, + { + name: "One network flag", + args: []string{"command", "--sepolia"}, + wantErr: false, + }, + { + name: "Two network flags", + args: []string{"command", "--sepolia", "--holesky"}, + wantErr: true, + }, + { + name: "All network flags", + args: []string{"command", "--sepolia", "--holesky", "--mainnet"}, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create a new CLI app with the ValidateNetworkFlags function as the Before action + app := &cli.App{ + Before: ValidateNetworkFlags, + Action: func(c *cli.Context) error { + return nil + }, + // Set the network flags for the app + Flags: NetworkFlags, + } + err := app.Run(tt.args) + if (err != nil) != tt.wantErr { + t.Errorf("ValidateNetworkFlags() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} From 365c6252baa4ed30731c84fbdefdf9090fd4bf5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 11 Jul 2024 20:41:09 +0200 Subject: [PATCH 185/325] EIP-7549: validator client (#14158) * EIP-7549: validator client * server code * tests * build fix * review * remove context * Revert "Auxiliary commit to revert individual files from 16fed79a1ae0bbe4a08cb9819c2785d6e34958dd" This reverts commit f59e1459f3f7561e0483bc8542110794951585c5. --- .../rpc/prysm/v1alpha1/validator/BUILD.bazel | 1 + .../rpc/prysm/v1alpha1/validator/attester.go | 100 +++- .../prysm/v1alpha1/validator/attester_test.go | 115 +++- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../validator/proposer_attestations.go | 56 +- .../validator/proposer_attestations_test.go | 106 ++++ .../v1alpha1/validator/proposer_deposits.go | 10 +- .../validator-client/keymanager.pb.go | 246 ++++---- .../validator-client/keymanager.proto | 1 + proto/prysm/v1alpha1/validator.pb.go | 536 ++++++++++-------- proto/prysm/v1alpha1/validator.pb.gw.go | 81 +++ proto/prysm/v1alpha1/validator.proto | 12 + testing/mock/beacon_service_mock.go | 80 +++ testing/mock/beacon_validator_client_mock.go | 20 + testing/mock/beacon_validator_server_mock.go | 15 + testing/validator-mock/chain_client_mock.go | 60 +- .../validator-mock/prysm_chain_client_mock.go | 6 +- .../validator-mock/validator_client_mock.go | 45 ++ validator/client/aggregate.go | 141 +++-- validator/client/aggregate_test.go | 88 ++- validator/client/attest.go | 105 ++-- validator/client/attest_test.go | 85 ++- .../beacon-api/beacon_api_validator_client.go | 12 + .../grpc_prysm_beacon_chain_client_test.go | 4 +- .../client/grpc-api/grpc_validator_client.go | 12 + validator/client/iface/validator_client.go | 3 + validator/client/key_reload_test.go | 4 +- validator/client/validator_test.go | 6 +- validator/client/wait_for_activation_test.go | 16 +- validator/rpc/handlers_beacon_test.go | 4 +- 30 files changed, 1431 insertions(+), 541 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel index caec5549b905..f8acf2305e1c 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel @@ -82,6 +82,7 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/sync_contribution:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index 0425348c2883..2f0342c36e99 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -39,54 +39,59 @@ func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.Attestation } // ProposeAttestation is a function called by an attester to vote -// on a block via an attestation object as defined in the Ethereum Serenity specification. +// on a block via an attestation object as defined in the Ethereum specification. func (vs *Server) ProposeAttestation(ctx context.Context, att *ethpb.Attestation) (*ethpb.AttestResponse, error) { ctx, span := trace.StartSpan(ctx, "AttesterServer.ProposeAttestation") defer span.End() - if _, err := bls.SignatureFromBytes(att.Signature); err != nil { - return nil, status.Error(codes.InvalidArgument, "Incorrect attestation signature") - } - - root, err := att.Data.HashTreeRoot() + resp, err := vs.proposeAtt(ctx, att, att.GetData().CommitteeIndex) if err != nil { - return nil, status.Errorf(codes.Internal, "Could not tree hash attestation: %v", err) + return nil, err } - // Broadcast the unaggregated attestation on a feed to notify other services in the beacon node - // of a received unaggregated attestation. - vs.OperationNotifier.OperationFeed().Send(&feed.Event{ - Type: operation.UnaggregatedAttReceived, - Data: &operation.UnAggregatedAttReceivedData{ - Attestation: att, - }, - }) + go func() { + attCopy := ethpb.CopyAttestation(att) + if err := vs.AttPool.SaveUnaggregatedAttestation(attCopy); err != nil { + log.WithError(err).Error("Could not save unaggregated attestation") + return + } + }() - // Determine subnet to broadcast attestation to - wantedEpoch := slots.ToEpoch(att.Data.Slot) - vals, err := vs.HeadFetcher.HeadValidatorsIndices(ctx, wantedEpoch) - if err != nil { - return nil, err + return resp, nil +} + +// ProposeAttestationElectra is a function called by an attester to vote +// on a block via an attestation object as defined in the Ethereum specification. +func (vs *Server) ProposeAttestationElectra(ctx context.Context, att *ethpb.AttestationElectra) (*ethpb.AttestResponse, error) { + ctx, span := trace.StartSpan(ctx, "AttesterServer.ProposeAttestationElectra") + defer span.End() + + if att.GetData().CommitteeIndex != 0 { + return nil, status.Errorf(codes.InvalidArgument, "Committee index must be set to 0") + } + committeeIndices := helpers.CommitteeIndices(att.CommitteeBits) + if len(committeeIndices) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "Committee bits has no bit set") + } + if len(committeeIndices) > 1 { + return nil, status.Errorf(codes.InvalidArgument, "Committee bits has more than one bit set") } - subnet := helpers.ComputeSubnetFromCommitteeAndSlot(uint64(len(vals)), att.Data.CommitteeIndex, att.Data.Slot) - // Broadcast the new attestation to the network. - if err := vs.P2P.BroadcastAttestation(ctx, subnet, att); err != nil { - return nil, status.Errorf(codes.Internal, "Could not broadcast attestation: %v", err) + resp, err := vs.proposeAtt(ctx, att, committeeIndices[0]) + if err != nil { + return nil, err } go func() { ctx = trace.NewContext(context.Background(), trace.FromContext(ctx)) - attCopy := ethpb.CopyAttestation(att) + attCopy := ethpb.CopyAttestationElectra(att) if err := vs.AttPool.SaveUnaggregatedAttestation(attCopy); err != nil { - log.WithError(err).Error("Could not handle attestation in operations service") + log.WithError(err).Error("Could not save unaggregated attestation") return } }() - return ðpb.AttestResponse{ - AttestationDataRoot: root[:], - }, nil + return resp, nil } // SubscribeCommitteeSubnets subscribes to the committee ID subnet given subscribe request. @@ -136,3 +141,40 @@ func (vs *Server) SubscribeCommitteeSubnets(ctx context.Context, req *ethpb.Comm return &emptypb.Empty{}, nil } + +func (vs *Server) proposeAtt(ctx context.Context, att ethpb.Att, committee primitives.CommitteeIndex) (*ethpb.AttestResponse, error) { + if _, err := bls.SignatureFromBytes(att.GetSignature()); err != nil { + return nil, status.Error(codes.InvalidArgument, "Incorrect attestation signature") + } + + root, err := att.GetData().HashTreeRoot() + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not tree hash attestation: %v", err) + } + + // Broadcast the unaggregated attestation on a feed to notify other services in the beacon node + // of a received unaggregated attestation. + vs.OperationNotifier.OperationFeed().Send(&feed.Event{ + Type: operation.UnaggregatedAttReceived, + Data: &operation.UnAggregatedAttReceivedData{ + Attestation: att, + }, + }) + + // Determine subnet to broadcast attestation to + wantedEpoch := slots.ToEpoch(att.GetData().Slot) + vals, err := vs.HeadFetcher.HeadValidatorsIndices(ctx, wantedEpoch) + if err != nil { + return nil, err + } + subnet := helpers.ComputeSubnetFromCommitteeAndSlot(uint64(len(vals)), committee, att.GetData().Slot) + + // Broadcast the new attestation to the network. + if err := vs.P2P.BroadcastAttestation(ctx, subnet, att); err != nil { + return nil, status.Errorf(codes.Internal, "Could not broadcast attestation: %v", err) + } + + return ðpb.AttestResponse{ + AttestationDataRoot: root[:], + }, nil +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go index e3d10f92ec67..7b6e87c53451 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go @@ -30,7 +30,7 @@ import ( "google.golang.org/protobuf/proto" ) -func TestProposeAttestation_OK(t *testing.T) { +func TestProposeAttestation(t *testing.T) { attesterServer := &Server{ HeadFetcher: &mock.ChainService{}, P2P: &mockp2p.MockBroadcaster{}, @@ -53,24 +53,107 @@ func TestProposeAttestation_OK(t *testing.T) { } } - state, err := util.NewBeaconState() - require.NoError(t, err) - require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) - require.NoError(t, state.SetValidators(validators)) - sk, err := bls.RandKey() require.NoError(t, err) sig := sk.Sign([]byte("dummy_test_data")) - req := ðpb.Attestation{ - Signature: sig.Marshal(), - Data: ðpb.AttestationData{ - BeaconBlockRoot: root[:], - Source: ðpb.Checkpoint{Root: make([]byte, 32)}, - Target: ðpb.Checkpoint{Root: make([]byte, 32)}, - }, - } - _, err = attesterServer.ProposeAttestation(context.Background(), req) - assert.NoError(t, err) + + t.Run("Phase 0", func(t *testing.T) { + state, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + require.NoError(t, state.SetValidators(validators)) + + req := ðpb.Attestation{ + Signature: sig.Marshal(), + Data: ðpb.AttestationData{ + BeaconBlockRoot: root[:], + Source: ðpb.Checkpoint{Root: make([]byte, 32)}, + Target: ðpb.Checkpoint{Root: make([]byte, 32)}, + }, + } + _, err = attesterServer.ProposeAttestation(context.Background(), req) + assert.NoError(t, err) + }) + t.Run("Electra", func(t *testing.T) { + state, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + require.NoError(t, state.SetValidators(validators)) + + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + req := ðpb.AttestationElectra{ + Signature: sig.Marshal(), + Data: ðpb.AttestationData{ + BeaconBlockRoot: root[:], + Source: ðpb.Checkpoint{Root: make([]byte, 32)}, + Target: ðpb.Checkpoint{Root: make([]byte, 32)}, + }, + CommitteeBits: cb, + } + _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) + assert.NoError(t, err) + }) + t.Run("Electra - non-zero committee index", func(t *testing.T) { + state, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + require.NoError(t, state.SetValidators(validators)) + + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + req := ðpb.AttestationElectra{ + Signature: sig.Marshal(), + Data: ðpb.AttestationData{ + BeaconBlockRoot: root[:], + Source: ðpb.Checkpoint{Root: make([]byte, 32)}, + Target: ðpb.Checkpoint{Root: make([]byte, 32)}, + CommitteeIndex: 1, + }, + CommitteeBits: cb, + } + _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) + assert.ErrorContains(t, "Committee index must be set to 0", err) + }) + t.Run("Electra - no committee bit set", func(t *testing.T) { + state, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + require.NoError(t, state.SetValidators(validators)) + + req := ðpb.AttestationElectra{ + Signature: sig.Marshal(), + Data: ðpb.AttestationData{ + BeaconBlockRoot: root[:], + Source: ðpb.Checkpoint{Root: make([]byte, 32)}, + Target: ðpb.Checkpoint{Root: make([]byte, 32)}, + }, + CommitteeBits: primitives.NewAttestationCommitteeBits(), + } + _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) + assert.ErrorContains(t, "Committee bits has no bit set", err) + }) + t.Run("Electra - multiple committee bits set", func(t *testing.T) { + state, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, state.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + require.NoError(t, state.SetValidators(validators)) + + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(1, true) + req := ðpb.AttestationElectra{ + Signature: sig.Marshal(), + Data: ðpb.AttestationData{ + BeaconBlockRoot: root[:], + Source: ðpb.Checkpoint{Root: make([]byte, 32)}, + Target: ðpb.Checkpoint{Root: make([]byte, 32)}, + }, + CommitteeBits: cb, + } + _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) + assert.ErrorContains(t, "Committee bits has more than one bit set", err) + }) } func TestProposeAttestation_IncorrectSignature(t *testing.T) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 27d1a5f297fd..6faba0afd60e 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -194,7 +194,7 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed sBlk.SetEth1Data(eth1Data) // Set deposit and attestation. - deposits, atts, err := vs.packDepositsAndAttestations(ctx, head, eth1Data) // TODO: split attestations and deposits + deposits, atts, err := vs.packDepositsAndAttestations(ctx, head, sBlk.Block().Slot(), eth1Data) // TODO: split attestations and deposits if err != nil { sBlk.SetDeposits([]*ethpb.Deposit{}) if err := sBlk.SetAttestations([]ethpb.Att{}); err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index 6e3cebb4b792..c6138e211361 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -12,14 +12,17 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) type proposerAtts []ethpb.Att -func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]ethpb.Att, error) { +func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState, blkSlot primitives.Slot) ([]ethpb.Att, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.packAttestations") defer span.End() @@ -39,20 +42,37 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon } atts = append(atts, uAtts...) + postElectra := slots.ToEpoch(blkSlot) >= params.BeaconConfig().ElectraForkEpoch + + versionAtts := make([]ethpb.Att, 0, len(atts)) + if postElectra { + for _, a := range atts { + if a.Version() == version.Electra { + versionAtts = append(versionAtts, a) + } + } + } else { + for _, a := range atts { + if a.Version() == version.Phase0 { + versionAtts = append(versionAtts, a) + } + } + } + // Remove duplicates from both aggregated/unaggregated attestations. This // prevents inefficient aggregates being created. - atts, err = proposerAtts(atts).dedup() + versionAtts, err = proposerAtts(versionAtts).dedup() if err != nil { return nil, err } - attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(atts)) - for _, att := range atts { - attDataRoot, err := att.GetData().HashTreeRoot() + attsByDataRoot := make(map[attestation.Id][]ethpb.Att, len(versionAtts)) + for _, att := range versionAtts { + id, err := attestation.NewId(att, attestation.Data) if err != nil { - return nil, err + return nil, errors.Wrap(err, "could not create attestation ID") } - attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) + attsByDataRoot[id] = append(attsByDataRoot[id], att) } attsForInclusion := proposerAtts(make([]ethpb.Att, 0)) @@ -169,8 +189,18 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { // limitToMaxAttestations limits attestations to maximum attestations per block. func (a proposerAtts) limitToMaxAttestations() proposerAtts { - if uint64(len(a)) > params.BeaconConfig().MaxAttestations { - return a[:params.BeaconConfig().MaxAttestations] + if len(a) == 0 { + return a + } + + var limit uint64 + if a[0].Version() == version.Phase0 { + limit = params.BeaconConfig().MaxAttestations + } else { + limit = params.BeaconConfig().MaxAttestationsElectra + } + if uint64(len(a)) > limit { + return a[:limit] } return a } @@ -182,13 +212,13 @@ func (a proposerAtts) dedup() (proposerAtts, error) { if len(a) < 2 { return a, nil } - attsByDataRoot := make(map[[32]byte][]ethpb.Att, len(a)) + attsByDataRoot := make(map[attestation.Id][]ethpb.Att, len(a)) for _, att := range a { - attDataRoot, err := att.GetData().HashTreeRoot() + id, err := attestation.NewId(att, attestation.Data) if err != nil { - continue + return nil, errors.Wrap(err, "failed to create attestation ID") } - attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) + attsByDataRoot[id] = append(attsByDataRoot[id], att) } uniqAtts := make([]ethpb.Att, 0, len(a)) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index f3705c671b10..fbbf62d7992d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -2,10 +2,13 @@ package validator import ( "bytes" + "context" "sort" "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" + "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -423,3 +426,106 @@ func TestProposer_ProposerAtts_dedup(t *testing.T) { }) } } + +func Test_packAttestations(t *testing.T) { + ctx := context.Background() + phase0Att := ðpb.Attestation{ + AggregationBits: bitfield.Bitlist{0b11111}, + Data: ðpb.AttestationData{ + BeaconBlockRoot: make([]byte, 32), + Source: ðpb.Checkpoint{ + Epoch: 0, + Root: make([]byte, 32), + }, + Target: ðpb.Checkpoint{ + Epoch: 0, + Root: make([]byte, 32), + }, + }, + Signature: make([]byte, 96), + } + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + electraAtt := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b11111}, + CommitteeBits: cb, + Data: ðpb.AttestationData{ + BeaconBlockRoot: make([]byte, 32), + Source: ðpb.Checkpoint{ + Epoch: 0, + Root: make([]byte, 32), + }, + Target: ðpb.Checkpoint{ + Epoch: 0, + Root: make([]byte, 32), + }, + }, + Signature: make([]byte, 96), + } + pool := attestations.NewPool() + require.NoError(t, pool.SaveAggregatedAttestations([]ethpb.Att{phase0Att, electraAtt})) + s := &Server{AttPool: pool} + + t.Run("Phase 0", func(t *testing.T) { + st, _ := util.DeterministicGenesisState(t, 64) + require.NoError(t, st.SetSlot(1)) + + atts, err := s.packAttestations(ctx, st, 0) + require.NoError(t, err) + require.Equal(t, 1, len(atts)) + assert.DeepEqual(t, phase0Att, atts[0]) + }) + t.Run("Electra", func(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = 1 + params.OverrideBeaconConfig(cfg) + + st, _ := util.DeterministicGenesisStateElectra(t, 64) + require.NoError(t, st.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + + atts, err := s.packAttestations(ctx, st, params.BeaconConfig().SlotsPerEpoch) + require.NoError(t, err) + require.Equal(t, 1, len(atts)) + assert.DeepEqual(t, electraAtt, atts[0]) + }) +} + +func Test_limitToMaxAttestations(t *testing.T) { + t.Run("Phase 0", func(t *testing.T) { + atts := make([]ethpb.Att, params.BeaconConfig().MaxAttestations+1) + for i := range atts { + atts[i] = ðpb.Attestation{} + } + + // 1 less than limit + pAtts := proposerAtts(atts[:len(atts)-3]) + assert.Equal(t, len(pAtts), len(pAtts.limitToMaxAttestations())) + + // equal to limit + pAtts = atts[:len(atts)-2] + assert.Equal(t, len(pAtts), len(pAtts.limitToMaxAttestations())) + + // 1 more than limit + pAtts = atts + assert.Equal(t, len(pAtts)-1, len(pAtts.limitToMaxAttestations())) + }) + t.Run("Electra", func(t *testing.T) { + atts := make([]ethpb.Att, params.BeaconConfig().MaxAttestationsElectra+1) + for i := range atts { + atts[i] = ðpb.AttestationElectra{} + } + + // 1 less than limit + pAtts := proposerAtts(atts[:len(atts)-3]) + assert.Equal(t, len(pAtts), len(pAtts.limitToMaxAttestations())) + + // equal to limit + pAtts = atts[:len(atts)-2] + assert.Equal(t, len(pAtts), len(pAtts.limitToMaxAttestations())) + + // 1 more than limit + pAtts = atts + assert.Equal(t, len(pAtts)-1, len(pAtts.limitToMaxAttestations())) + }) +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go index a32c68c42233..3e322963c78d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -20,7 +21,12 @@ import ( "google.golang.org/grpc/status" ) -func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []ethpb.Att, error) { +func (vs *Server) packDepositsAndAttestations( + ctx context.Context, + head state.BeaconState, + blkSlot primitives.Slot, + eth1Data *ethpb.Eth1Data, +) ([]*ethpb.Deposit, []ethpb.Att, error) { eg, egctx := errgroup.WithContext(ctx) var deposits []*ethpb.Deposit var atts []ethpb.Att @@ -43,7 +49,7 @@ func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.Be eg.Go(func() error { // Pack aggregated attestations which have not been included in the beacon chain. - localAtts, err := vs.packAttestations(egctx, head) + localAtts, err := vs.packAttestations(egctx, head, blkSlot) if err != nil { return status.Errorf(codes.Internal, "Could not get attestations to pack into block: %v", err) } diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go index e0906f5541f3..b6e9f1b1542a 100755 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go +++ b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go @@ -106,6 +106,7 @@ type SignRequest struct { // *SignRequest_BlindedBlockDeneb // *SignRequest_BlockElectra // *SignRequest_BlindedBlockElectra + // *SignRequest_AggregateAttestationAndProofElectra Object isSignRequest_Object `protobuf_oneof:"object"` SigningSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=signing_slot,json=signingSlot,proto3" json:"signing_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` } @@ -303,6 +304,13 @@ func (x *SignRequest) GetBlindedBlockElectra() *v1alpha1.BlindedBeaconBlockElect return nil } +func (x *SignRequest) GetAggregateAttestationAndProofElectra() *v1alpha1.AggregateAttestationAndProofElectra { + if x, ok := x.GetObject().(*SignRequest_AggregateAttestationAndProofElectra); ok { + return x.AggregateAttestationAndProofElectra + } + return nil +} + func (x *SignRequest) GetSigningSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { if x != nil { return x.SigningSlot @@ -390,6 +398,10 @@ type SignRequest_BlindedBlockElectra struct { BlindedBlockElectra *v1alpha1.BlindedBeaconBlockElectra `protobuf:"bytes,119,opt,name=blinded_block_electra,json=blindedBlockElectra,proto3,oneof"` } +type SignRequest_AggregateAttestationAndProofElectra struct { + AggregateAttestationAndProofElectra *v1alpha1.AggregateAttestationAndProofElectra `protobuf:"bytes,120,opt,name=aggregate_attestation_and_proof_electra,json=aggregateAttestationAndProofElectra,proto3,oneof"` +} + func (*SignRequest_Block) isSignRequest_Object() {} func (*SignRequest_AttestationData) isSignRequest_Object() {} @@ -428,6 +440,8 @@ func (*SignRequest_BlockElectra) isSignRequest_Object() {} func (*SignRequest_BlindedBlockElectra) isSignRequest_Object() {} +func (*SignRequest_AggregateAttestationAndProofElectra) isSignRequest_Object() {} + type SignResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -684,7 +698,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x0f, 0x0a, 0x0b, 0x53, + 0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x10, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67, @@ -799,85 +813,94 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x68, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, - 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, - 0x6f, 0x74, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42, - 0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, - 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x92, 0x01, 0x0a, 0x27, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x18, 0x78, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x23, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x68, 0x0a, 0x0c, 0x73, 0x69, + 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, + 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c, 0x53, + 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, + 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, + 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, + 0x45, 0x44, 0x10, 0x03, 0x22, 0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, - 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, - 0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, - 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, - 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, - 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, - 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, + 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, + 0x09, 0x5f, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, + 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, + 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, + 0x61, 0x79, 0x73, 0x22, 0xe7, 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x74, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, - 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, - 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x1a, 0x78, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, + 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -895,29 +918,30 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDescGZIP() [ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_goTypes = []interface{}{ - (SignResponse_Status)(0), // 0: ethereum.validator.accounts.v2.SignResponse.Status - (*SignRequest)(nil), // 1: ethereum.validator.accounts.v2.SignRequest - (*SignResponse)(nil), // 2: ethereum.validator.accounts.v2.SignResponse - (*ProposerOptionPayload)(nil), // 3: ethereum.validator.accounts.v2.ProposerOptionPayload - (*BuilderConfig)(nil), // 4: ethereum.validator.accounts.v2.BuilderConfig - (*ProposerSettingsPayload)(nil), // 5: ethereum.validator.accounts.v2.ProposerSettingsPayload - nil, // 6: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry - (*v1alpha1.BeaconBlock)(nil), // 7: ethereum.eth.v1alpha1.BeaconBlock - (*v1alpha1.AttestationData)(nil), // 8: ethereum.eth.v1alpha1.AttestationData - (*v1alpha1.AggregateAttestationAndProof)(nil), // 9: ethereum.eth.v1alpha1.AggregateAttestationAndProof - (*v1alpha1.VoluntaryExit)(nil), // 10: ethereum.eth.v1alpha1.VoluntaryExit - (*v1alpha1.BeaconBlockAltair)(nil), // 11: ethereum.eth.v1alpha1.BeaconBlockAltair - (*v1alpha1.SyncAggregatorSelectionData)(nil), // 12: ethereum.eth.v1alpha1.SyncAggregatorSelectionData - (*v1alpha1.ContributionAndProof)(nil), // 13: ethereum.eth.v1alpha1.ContributionAndProof - (*v1alpha1.BeaconBlockBellatrix)(nil), // 14: ethereum.eth.v1alpha1.BeaconBlockBellatrix - (*v1alpha1.BlindedBeaconBlockBellatrix)(nil), // 15: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix - (*v1alpha1.ValidatorRegistrationV1)(nil), // 16: ethereum.eth.v1alpha1.ValidatorRegistrationV1 - (*v1alpha1.BeaconBlockCapella)(nil), // 17: ethereum.eth.v1alpha1.BeaconBlockCapella - (*v1alpha1.BlindedBeaconBlockCapella)(nil), // 18: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella - (*v1alpha1.BeaconBlockDeneb)(nil), // 19: ethereum.eth.v1alpha1.BeaconBlockDeneb - (*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 20: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb - (*v1alpha1.BeaconBlockElectra)(nil), // 21: ethereum.eth.v1alpha1.BeaconBlockElectra - (*v1alpha1.BlindedBeaconBlockElectra)(nil), // 22: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + (SignResponse_Status)(0), // 0: ethereum.validator.accounts.v2.SignResponse.Status + (*SignRequest)(nil), // 1: ethereum.validator.accounts.v2.SignRequest + (*SignResponse)(nil), // 2: ethereum.validator.accounts.v2.SignResponse + (*ProposerOptionPayload)(nil), // 3: ethereum.validator.accounts.v2.ProposerOptionPayload + (*BuilderConfig)(nil), // 4: ethereum.validator.accounts.v2.BuilderConfig + (*ProposerSettingsPayload)(nil), // 5: ethereum.validator.accounts.v2.ProposerSettingsPayload + nil, // 6: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry + (*v1alpha1.BeaconBlock)(nil), // 7: ethereum.eth.v1alpha1.BeaconBlock + (*v1alpha1.AttestationData)(nil), // 8: ethereum.eth.v1alpha1.AttestationData + (*v1alpha1.AggregateAttestationAndProof)(nil), // 9: ethereum.eth.v1alpha1.AggregateAttestationAndProof + (*v1alpha1.VoluntaryExit)(nil), // 10: ethereum.eth.v1alpha1.VoluntaryExit + (*v1alpha1.BeaconBlockAltair)(nil), // 11: ethereum.eth.v1alpha1.BeaconBlockAltair + (*v1alpha1.SyncAggregatorSelectionData)(nil), // 12: ethereum.eth.v1alpha1.SyncAggregatorSelectionData + (*v1alpha1.ContributionAndProof)(nil), // 13: ethereum.eth.v1alpha1.ContributionAndProof + (*v1alpha1.BeaconBlockBellatrix)(nil), // 14: ethereum.eth.v1alpha1.BeaconBlockBellatrix + (*v1alpha1.BlindedBeaconBlockBellatrix)(nil), // 15: ethereum.eth.v1alpha1.BlindedBeaconBlockBellatrix + (*v1alpha1.ValidatorRegistrationV1)(nil), // 16: ethereum.eth.v1alpha1.ValidatorRegistrationV1 + (*v1alpha1.BeaconBlockCapella)(nil), // 17: ethereum.eth.v1alpha1.BeaconBlockCapella + (*v1alpha1.BlindedBeaconBlockCapella)(nil), // 18: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella + (*v1alpha1.BeaconBlockDeneb)(nil), // 19: ethereum.eth.v1alpha1.BeaconBlockDeneb + (*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 20: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb + (*v1alpha1.BeaconBlockElectra)(nil), // 21: ethereum.eth.v1alpha1.BeaconBlockElectra + (*v1alpha1.BlindedBeaconBlockElectra)(nil), // 22: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + (*v1alpha1.AggregateAttestationAndProofElectra)(nil), // 23: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra } var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int32{ 7, // 0: ethereum.validator.accounts.v2.SignRequest.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock @@ -936,16 +960,17 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int3 20, // 13: ethereum.validator.accounts.v2.SignRequest.blinded_block_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb 21, // 14: ethereum.validator.accounts.v2.SignRequest.block_electra:type_name -> ethereum.eth.v1alpha1.BeaconBlockElectra 22, // 15: ethereum.validator.accounts.v2.SignRequest.blinded_block_electra:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra - 0, // 16: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status - 4, // 17: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig - 6, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry - 3, // 19: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload - 3, // 20: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload - 21, // [21:21] is the sub-list for method output_type - 21, // [21:21] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 23, // 16: ethereum.validator.accounts.v2.SignRequest.aggregate_attestation_and_proof_electra:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra + 0, // 17: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status + 4, // 18: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig + 6, // 19: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry + 3, // 20: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload + 3, // 21: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() } @@ -1035,6 +1060,7 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() { (*SignRequest_BlindedBlockDeneb)(nil), (*SignRequest_BlockElectra)(nil), (*SignRequest_BlindedBlockElectra)(nil), + (*SignRequest_AggregateAttestationAndProofElectra)(nil), } file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.proto b/proto/prysm/v1alpha1/validator-client/keymanager.proto index 9c6888ea87a0..81769612a17c 100644 --- a/proto/prysm/v1alpha1/validator-client/keymanager.proto +++ b/proto/prysm/v1alpha1/validator-client/keymanager.proto @@ -64,6 +64,7 @@ message SignRequest { // Electra objects. ethereum.eth.v1alpha1.BeaconBlockElectra block_electra = 118; ethereum.eth.v1alpha1.BlindedBeaconBlockElectra blinded_block_electra = 119; + ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra aggregate_attestation_and_proof_electra = 120; } reserved 4, 5; // Reserving old, deleted fields. uint64 signing_slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; diff --git a/proto/prysm/v1alpha1/validator.pb.go b/proto/prysm/v1alpha1/validator.pb.go index db4f82bdcd41..53416223b4fe 100755 --- a/proto/prysm/v1alpha1/validator.pb.go +++ b/proto/prysm/v1alpha1/validator.pb.go @@ -3728,7 +3728,7 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, - 0x08, 0x32, 0xca, 0x27, 0x0a, 0x13, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, + 0x08, 0x32, 0xf2, 0x28, 0x0a, 0x13, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, @@ -3856,205 +3856,216 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{ 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, - 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0xc8, 0x01, 0x0a, 0x24, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x30, + 0x12, 0xa5, 0x01, 0x0a, 0x19, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x12, 0xbe, 0x01, 0x0a, 0x23, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x12, 0xd4, 0x01, 0x0a, 0x2a, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x12, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, 0x2a, 0x22, 0x2b, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0xc8, 0x01, + 0x0a, 0x24, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x8e, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0xbe, 0x01, 0x0a, 0x23, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0xd4, 0x01, 0x0a, 0x2a, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, - 0x45, 0x78, 0x69, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x65, 0x74, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0x8e, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, + 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, + 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x1a, 0x2a, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x45, 0x78, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, + 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x69, + 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, + 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x19, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, + 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x73, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, - 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x75, 0x62, - 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x9a, 0x01, - 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, - 0x67, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, - 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, - 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x6f, - 0x70, 0x70, 0x65, 0x6c, 0x67, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x9f, 0x01, 0x0a, 0x17, 0x47, - 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x33, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x89, 0x01, 0x0a, - 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, - 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0xb4, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, - 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, + 0x44, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x47, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x70, 0x70, 0x65, 0x6c, 0x67, 0x61, 0x6e, 0x67, + 0x65, 0x72, 0x12, 0x9f, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, + 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x75, 0x62, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0xc4, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, - 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0xaf, 0x01, 0x0a, 0x20, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x31, 0x2e, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0xb4, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x62, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, + 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, + 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0xc4, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, + 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0xaf, + 0x01, 0x0a, 0x20, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x12, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x40, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x01, 0x2a, 0x22, 0x35, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, + 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, + 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x01, - 0x2a, 0x22, 0x35, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, - 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, + 0x2b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x88, 0x02, 0x01, 0x30, + 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, - 0x6c, 0x6f, 0x74, 0x73, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, - 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0x9e, 0x01, - 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xae, - 0x01, 0x0a, 0x17, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, - 0xec, 0x01, 0x0a, 0x1f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, - 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x69, 0x74, 0x73, 0x12, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x88, 0x02, 0x01, 0x30, 0x01, 0x12, 0x9e, 0x01, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, + 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xae, 0x01, 0x0a, 0x17, 0x41, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x6f, 0x53, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x73, 0x73, + 0x69, 0x67, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x74, 0x6f, + 0x5f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0xec, 0x01, 0x0a, 0x1f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x42, 0x93, - 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x3d, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, + 0x67, 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, + 0x41, 0x6e, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x44, 0x12, 0x42, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, + 0x67, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x42, 0x93, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, + 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, + 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, + 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4138,12 +4149,13 @@ var file_proto_prysm_v1alpha1_validator_proto_goTypes = []interface{}{ (*emptypb.Empty)(nil), // 63: google.protobuf.Empty (*GenericSignedBeaconBlock)(nil), // 64: ethereum.eth.v1alpha1.GenericSignedBeaconBlock (*Attestation)(nil), // 65: ethereum.eth.v1alpha1.Attestation - (*SignedVoluntaryExit)(nil), // 66: ethereum.eth.v1alpha1.SignedVoluntaryExit - (*SignedContributionAndProof)(nil), // 67: ethereum.eth.v1alpha1.SignedContributionAndProof - (*SignedValidatorRegistrationsV1)(nil), // 68: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - (*GenericBeaconBlock)(nil), // 69: ethereum.eth.v1alpha1.GenericBeaconBlock - (*AttestationData)(nil), // 70: ethereum.eth.v1alpha1.AttestationData - (*SyncCommitteeContribution)(nil), // 71: ethereum.eth.v1alpha1.SyncCommitteeContribution + (*AttestationElectra)(nil), // 66: ethereum.eth.v1alpha1.AttestationElectra + (*SignedVoluntaryExit)(nil), // 67: ethereum.eth.v1alpha1.SignedVoluntaryExit + (*SignedContributionAndProof)(nil), // 68: ethereum.eth.v1alpha1.SignedContributionAndProof + (*SignedValidatorRegistrationsV1)(nil), // 69: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + (*GenericBeaconBlock)(nil), // 70: ethereum.eth.v1alpha1.GenericBeaconBlock + (*AttestationData)(nil), // 71: ethereum.eth.v1alpha1.AttestationData + (*SyncCommitteeContribution)(nil), // 72: ethereum.eth.v1alpha1.SyncCommitteeContribution } var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ 51, // 0: ethereum.eth.v1alpha1.StreamBlocksResponse.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock @@ -4183,55 +4195,57 @@ var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ 41, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest 24, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest 65, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation - 26, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest - 26, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProofElectra:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest - 29, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest - 30, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProofElectra:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitElectraRequest - 66, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 32, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest - 36, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest - 63, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty - 62, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 2, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest - 3, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest - 67, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof - 38, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest - 39, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest - 68, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 - 43, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest - 44, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest - 20, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse - 8, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse - 11, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse - 10, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse - 14, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse - 16, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse - 18, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse - 69, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock - 22, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse - 63, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty - 42, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse - 70, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData - 25, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse - 27, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse - 28, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProofElectra:output_type -> ethereum.eth.v1alpha1.AggregateSelectionElectraResponse - 31, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse - 31, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProofElectra:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse - 23, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse - 63, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty - 37, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse - 1, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse - 63, // 75: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty - 4, // 76: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse - 71, // 77: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution - 63, // 78: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty - 5, // 79: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse - 6, // 80: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse - 63, // 81: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty - 63, // 82: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:output_type -> google.protobuf.Empty - 45, // 83: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:output_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse - 54, // [54:84] is the sub-list for method output_type - 24, // [24:54] is the sub-list for method input_type + 66, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestationElectra:input_type -> ethereum.eth.v1alpha1.AttestationElectra + 26, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest + 26, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProofElectra:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest + 29, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest + 30, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProofElectra:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitElectraRequest + 67, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 32, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest + 36, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest + 63, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty + 62, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage + 2, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest + 3, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest + 68, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof + 38, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest + 39, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest + 69, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 + 43, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest + 44, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest + 20, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse + 8, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse + 11, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse + 10, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse + 14, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse + 16, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse + 18, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse + 70, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock + 22, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse + 63, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty + 42, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse + 71, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData + 25, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse + 25, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestationElectra:output_type -> ethereum.eth.v1alpha1.AttestResponse + 27, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse + 28, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProofElectra:output_type -> ethereum.eth.v1alpha1.AggregateSelectionElectraResponse + 31, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse + 31, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProofElectra:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse + 23, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse + 63, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty + 37, // 75: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse + 1, // 76: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse + 63, // 77: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty + 4, // 78: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse + 72, // 79: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution + 63, // 80: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty + 5, // 81: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse + 6, // 82: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse + 63, // 83: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty + 63, // 84: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:output_type -> google.protobuf.Empty + 45, // 85: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:output_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsResponse + 55, // [55:86] is the sub-list for method output_type + 24, // [24:55] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name 24, // [24:24] is the sub-list for extension extendee 0, // [0:24] is the sub-list for field type_name @@ -4902,6 +4916,7 @@ type BeaconNodeValidatorClient interface { GetFeeRecipientByPubKey(ctx context.Context, in *FeeRecipientByPubKeyRequest, opts ...grpc.CallOption) (*FeeRecipientByPubKeyResponse, error) GetAttestationData(ctx context.Context, in *AttestationDataRequest, opts ...grpc.CallOption) (*AttestationData, error) ProposeAttestation(ctx context.Context, in *Attestation, opts ...grpc.CallOption) (*AttestResponse, error) + ProposeAttestationElectra(ctx context.Context, in *AttestationElectra, opts ...grpc.CallOption) (*AttestResponse, error) SubmitAggregateSelectionProof(ctx context.Context, in *AggregateSelectionRequest, opts ...grpc.CallOption) (*AggregateSelectionResponse, error) SubmitAggregateSelectionProofElectra(ctx context.Context, in *AggregateSelectionRequest, opts ...grpc.CallOption) (*AggregateSelectionElectraResponse, error) SubmitSignedAggregateSelectionProof(ctx context.Context, in *SignedAggregateSubmitRequest, opts ...grpc.CallOption) (*SignedAggregateSubmitResponse, error) @@ -5095,6 +5110,15 @@ func (c *beaconNodeValidatorClient) ProposeAttestation(ctx context.Context, in * return out, nil } +func (c *beaconNodeValidatorClient) ProposeAttestationElectra(ctx context.Context, in *AttestationElectra, opts ...grpc.CallOption) (*AttestResponse, error) { + out := new(AttestResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestationElectra", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *beaconNodeValidatorClient) SubmitAggregateSelectionProof(ctx context.Context, in *AggregateSelectionRequest, opts ...grpc.CallOption) (*AggregateSelectionResponse, error) { out := new(AggregateSelectionResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof", in, out, opts...) @@ -5312,6 +5336,7 @@ type BeaconNodeValidatorServer interface { GetFeeRecipientByPubKey(context.Context, *FeeRecipientByPubKeyRequest) (*FeeRecipientByPubKeyResponse, error) GetAttestationData(context.Context, *AttestationDataRequest) (*AttestationData, error) ProposeAttestation(context.Context, *Attestation) (*AttestResponse, error) + ProposeAttestationElectra(context.Context, *AttestationElectra) (*AttestResponse, error) SubmitAggregateSelectionProof(context.Context, *AggregateSelectionRequest) (*AggregateSelectionResponse, error) SubmitAggregateSelectionProofElectra(context.Context, *AggregateSelectionRequest) (*AggregateSelectionElectraResponse, error) SubmitSignedAggregateSelectionProof(context.Context, *SignedAggregateSubmitRequest) (*SignedAggregateSubmitResponse, error) @@ -5376,6 +5401,9 @@ func (*UnimplementedBeaconNodeValidatorServer) GetAttestationData(context.Contex func (*UnimplementedBeaconNodeValidatorServer) ProposeAttestation(context.Context, *Attestation) (*AttestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeAttestation not implemented") } +func (*UnimplementedBeaconNodeValidatorServer) ProposeAttestationElectra(context.Context, *AttestationElectra) (*AttestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProposeAttestationElectra not implemented") +} func (*UnimplementedBeaconNodeValidatorServer) SubmitAggregateSelectionProof(context.Context, *AggregateSelectionRequest) (*AggregateSelectionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitAggregateSelectionProof not implemented") } @@ -5672,6 +5700,24 @@ func _BeaconNodeValidator_ProposeAttestation_Handler(srv interface{}, ctx contex return interceptor(ctx, in, info, handler) } +func _BeaconNodeValidator_ProposeAttestationElectra_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AttestationElectra) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeaconNodeValidatorServer).ProposeAttestationElectra(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestationElectra", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeaconNodeValidatorServer).ProposeAttestationElectra(ctx, req.(*AttestationElectra)) + } + return interceptor(ctx, in, info, handler) +} + func _BeaconNodeValidator_SubmitAggregateSelectionProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AggregateSelectionRequest) if err := dec(in); err != nil { @@ -6032,6 +6078,10 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ MethodName: "ProposeAttestation", Handler: _BeaconNodeValidator_ProposeAttestation_Handler, }, + { + MethodName: "ProposeAttestationElectra", + Handler: _BeaconNodeValidator_ProposeAttestationElectra_Handler, + }, { MethodName: "SubmitAggregateSelectionProof", Handler: _BeaconNodeValidator_SubmitAggregateSelectionProof_Handler, diff --git a/proto/prysm/v1alpha1/validator.pb.gw.go b/proto/prysm/v1alpha1/validator.pb.gw.go index 23abddf6f866..a045a335ef21 100755 --- a/proto/prysm/v1alpha1/validator.pb.gw.go +++ b/proto/prysm/v1alpha1/validator.pb.gw.go @@ -468,6 +468,40 @@ func local_request_BeaconNodeValidator_ProposeAttestation_0(ctx context.Context, } +func request_BeaconNodeValidator_ProposeAttestationElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AttestationElectra + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ProposeAttestationElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BeaconNodeValidator_ProposeAttestationElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AttestationElectra + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ProposeAttestationElectra(ctx, &protoReq) + return msg, metadata, err + +} + func request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AggregateSelectionRequest var metadata runtime.ServerMetadata @@ -1297,6 +1331,29 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestationElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestationElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BeaconNodeValidator_ProposeAttestationElectra_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconNodeValidator_ProposeAttestationElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1957,6 +2014,26 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestationElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestationElectra") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BeaconNodeValidator_ProposeAttestationElectra_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_BeaconNodeValidator_ProposeAttestationElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -2327,6 +2404,8 @@ var ( pattern_BeaconNodeValidator_ProposeAttestation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation"}, "")) + pattern_BeaconNodeValidator_ProposeAttestationElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation_electra"}, "")) + pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate_electra"}, "")) @@ -2389,6 +2468,8 @@ var ( forward_BeaconNodeValidator_ProposeAttestation_0 = runtime.ForwardResponseMessage + forward_BeaconNodeValidator_ProposeAttestationElectra_0 = runtime.ForwardResponseMessage + forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.ForwardResponseMessage forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0 = runtime.ForwardResponseMessage diff --git a/proto/prysm/v1alpha1/validator.proto b/proto/prysm/v1alpha1/validator.proto index c1778e4b2e87..bd0e235e83e3 100644 --- a/proto/prysm/v1alpha1/validator.proto +++ b/proto/prysm/v1alpha1/validator.proto @@ -188,6 +188,18 @@ service BeaconNodeValidator { }; } + // Sends the newly signed attestation to beacon node. + // + // The validator sends the newly signed attestation to the beacon node for the attestation to + // be included in the beacon chain. The beacon node is expected to validate and publish attestation on + // appropriate committee subnet. + rpc ProposeAttestationElectra(AttestationElectra) returns (AttestResponse) { + option (google.api.http) = { + post: "/eth/v1alpha1/validator/attestation_electra" + body: "*" + }; + } + // Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root. // the beacon node responses with an aggregate and proof object back to validator to sign over. rpc SubmitAggregateSelectionProof(AggregateSelectionRequest) returns (AggregateSelectionResponse) { diff --git a/testing/mock/beacon_service_mock.go b/testing/mock/beacon_service_mock.go index 78bf69ec1165..f5e506ba34d2 100644 --- a/testing/mock/beacon_service_mock.go +++ b/testing/mock/beacon_service_mock.go @@ -62,6 +62,26 @@ func (mr *MockBeaconChainClientMockRecorder) AttestationPool(arg0, arg1 any, arg return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationPool", reflect.TypeOf((*MockBeaconChainClient)(nil).AttestationPool), varargs...) } +// AttestationPoolElectra mocks base method. +func (m *MockBeaconChainClient) AttestationPoolElectra(arg0 context.Context, arg1 *eth.AttestationPoolRequest, arg2 ...grpc.CallOption) (*eth.AttestationPoolElectraResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AttestationPoolElectra", varargs...) + ret0, _ := ret[0].(*eth.AttestationPoolElectraResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AttestationPoolElectra indicates an expected call of AttestationPoolElectra. +func (mr *MockBeaconChainClientMockRecorder) AttestationPoolElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationPoolElectra", reflect.TypeOf((*MockBeaconChainClient)(nil).AttestationPoolElectra), varargs...) +} + // GetBeaconConfig mocks base method. func (m *MockBeaconChainClient) GetBeaconConfig(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*eth.BeaconConfig, error) { m.ctrl.T.Helper() @@ -242,6 +262,26 @@ func (mr *MockBeaconChainClientMockRecorder) ListAttestations(arg0, arg1 any, ar return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAttestations", reflect.TypeOf((*MockBeaconChainClient)(nil).ListAttestations), varargs...) } +// ListAttestationsElectra mocks base method. +func (m *MockBeaconChainClient) ListAttestationsElectra(arg0 context.Context, arg1 *eth.ListAttestationsRequest, arg2 ...grpc.CallOption) (*eth.ListAttestationsElectraResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListAttestationsElectra", varargs...) + ret0, _ := ret[0].(*eth.ListAttestationsElectraResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAttestationsElectra indicates an expected call of ListAttestationsElectra. +func (mr *MockBeaconChainClientMockRecorder) ListAttestationsElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAttestationsElectra", reflect.TypeOf((*MockBeaconChainClient)(nil).ListAttestationsElectra), varargs...) +} + // ListBeaconBlocks mocks base method. func (m *MockBeaconChainClient) ListBeaconBlocks(arg0 context.Context, arg1 *eth.ListBlocksRequest, arg2 ...grpc.CallOption) (*eth.ListBeaconBlocksResponse, error) { m.ctrl.T.Helper() @@ -302,6 +342,26 @@ func (mr *MockBeaconChainClientMockRecorder) ListIndexedAttestations(arg0, arg1 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListIndexedAttestations", reflect.TypeOf((*MockBeaconChainClient)(nil).ListIndexedAttestations), varargs...) } +// ListIndexedAttestationsElectra mocks base method. +func (m *MockBeaconChainClient) ListIndexedAttestationsElectra(arg0 context.Context, arg1 *eth.ListIndexedAttestationsRequest, arg2 ...grpc.CallOption) (*eth.ListIndexedAttestationsElectraResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListIndexedAttestationsElectra", varargs...) + ret0, _ := ret[0].(*eth.ListIndexedAttestationsElectraResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListIndexedAttestationsElectra indicates an expected call of ListIndexedAttestationsElectra. +func (mr *MockBeaconChainClientMockRecorder) ListIndexedAttestationsElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListIndexedAttestationsElectra", reflect.TypeOf((*MockBeaconChainClient)(nil).ListIndexedAttestationsElectra), varargs...) +} + // ListValidatorAssignments mocks base method. func (m *MockBeaconChainClient) ListValidatorAssignments(arg0 context.Context, arg1 *eth.ListValidatorAssignmentsRequest, arg2 ...grpc.CallOption) (*eth.ValidatorAssignments, error) { m.ctrl.T.Helper() @@ -382,6 +442,26 @@ func (mr *MockBeaconChainClientMockRecorder) SubmitAttesterSlashing(arg0, arg1 a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAttesterSlashing", reflect.TypeOf((*MockBeaconChainClient)(nil).SubmitAttesterSlashing), varargs...) } +// SubmitAttesterSlashingElectra mocks base method. +func (m *MockBeaconChainClient) SubmitAttesterSlashingElectra(arg0 context.Context, arg1 *eth.AttesterSlashingElectra, arg2 ...grpc.CallOption) (*eth.SubmitSlashingResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SubmitAttesterSlashingElectra", varargs...) + ret0, _ := ret[0].(*eth.SubmitSlashingResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitAttesterSlashingElectra indicates an expected call of SubmitAttesterSlashingElectra. +func (mr *MockBeaconChainClientMockRecorder) SubmitAttesterSlashingElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAttesterSlashingElectra", reflect.TypeOf((*MockBeaconChainClient)(nil).SubmitAttesterSlashingElectra), varargs...) +} + // SubmitProposerSlashing mocks base method. func (m *MockBeaconChainClient) SubmitProposerSlashing(arg0 context.Context, arg1 *eth.ProposerSlashing, arg2 ...grpc.CallOption) (*eth.SubmitSlashingResponse, error) { m.ctrl.T.Helper() diff --git a/testing/mock/beacon_validator_client_mock.go b/testing/mock/beacon_validator_client_mock.go index 1ffaeb385a2d..24c55182c7f6 100644 --- a/testing/mock/beacon_validator_client_mock.go +++ b/testing/mock/beacon_validator_client_mock.go @@ -323,6 +323,26 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) ProposeAttestation(arg0, ar return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeAttestation", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).ProposeAttestation), varargs...) } +// ProposeAttestationElectra mocks base method. +func (m *MockBeaconNodeValidatorClient) ProposeAttestationElectra(arg0 context.Context, arg1 *eth.AttestationElectra, arg2 ...grpc.CallOption) (*eth.AttestResponse, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ProposeAttestationElectra", varargs...) + ret0, _ := ret[0].(*eth.AttestResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProposeAttestationElectra indicates an expected call of ProposeAttestationElectra. +func (mr *MockBeaconNodeValidatorClientMockRecorder) ProposeAttestationElectra(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeAttestationElectra", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).ProposeAttestationElectra), varargs...) +} + // ProposeBeaconBlock mocks base method. func (m *MockBeaconNodeValidatorClient) ProposeBeaconBlock(arg0 context.Context, arg1 *eth.GenericSignedBeaconBlock, arg2 ...grpc.CallOption) (*eth.ProposeResponse, error) { m.ctrl.T.Helper() diff --git a/testing/mock/beacon_validator_server_mock.go b/testing/mock/beacon_validator_server_mock.go index 32916231c7c2..9643784dfc27 100644 --- a/testing/mock/beacon_validator_server_mock.go +++ b/testing/mock/beacon_validator_server_mock.go @@ -252,6 +252,21 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) ProposeAttestation(arg0, ar return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeAttestation", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).ProposeAttestation), arg0, arg1) } +// ProposeAttestationElectra mocks base method. +func (m *MockBeaconNodeValidatorServer) ProposeAttestationElectra(arg0 context.Context, arg1 *eth.AttestationElectra) (*eth.AttestResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProposeAttestationElectra", arg0, arg1) + ret0, _ := ret[0].(*eth.AttestResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProposeAttestationElectra indicates an expected call of ProposeAttestationElectra. +func (mr *MockBeaconNodeValidatorServerMockRecorder) ProposeAttestationElectra(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeAttestationElectra", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).ProposeAttestationElectra), arg0, arg1) +} + // ProposeBeaconBlock mocks base method. func (m *MockBeaconNodeValidatorServer) ProposeBeaconBlock(arg0 context.Context, arg1 *eth.GenericSignedBeaconBlock) (*eth.ProposeResponse, error) { m.ctrl.T.Helper() diff --git a/testing/validator-mock/chain_client_mock.go b/testing/validator-mock/chain_client_mock.go index b31172f9a451..8725f363cfb0 100644 --- a/testing/validator-mock/chain_client_mock.go +++ b/testing/validator-mock/chain_client_mock.go @@ -41,7 +41,7 @@ func (m *MockChainClient) EXPECT() *MockChainClientMockRecorder { return m.recorder } -// GetChainHead mocks base method. +// ChainHead mocks base method. func (m *MockChainClient) ChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ChainHead", arg0, arg1) @@ -50,13 +50,28 @@ func (m *MockChainClient) ChainHead(arg0 context.Context, arg1 *emptypb.Empty) ( return ret0, ret1 } -// GetChainHead indicates an expected call of GetChainHead. -func (mr *MockChainClientMockRecorder) GetChainHead(arg0, arg1 any) *gomock.Call { +// ChainHead indicates an expected call of ChainHead. +func (mr *MockChainClientMockRecorder) ChainHead(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockChainClient)(nil).ChainHead), arg0, arg1) } -// GetValidatorParticipation mocks base method. +// ValidatorBalances mocks base method. +func (m *MockChainClient) ValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorBalances", arg0, arg1) + ret0, _ := ret[0].(*eth.ValidatorBalances) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ValidatorBalances indicates an expected call of ValidatorBalances. +func (mr *MockChainClientMockRecorder) ValidatorBalances(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ValidatorBalances), arg0, arg1) +} + +// ValidatorParticipation mocks base method. func (m *MockChainClient) ValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorParticipation", arg0, arg1) @@ -65,13 +80,13 @@ func (m *MockChainClient) ValidatorParticipation(arg0 context.Context, arg1 *eth return ret0, ret1 } -// GetValidatorParticipation indicates an expected call of GetValidatorParticipation. -func (mr *MockChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any) *gomock.Call { +// ValidatorParticipation indicates an expected call of ValidatorParticipation. +func (mr *MockChainClientMockRecorder) ValidatorParticipation(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).ValidatorParticipation), arg0, arg1) } -// GetValidatorPerformance mocks base method. +// ValidatorPerformance mocks base method. func (m *MockChainClient) ValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorPerformance", arg0, arg1) @@ -80,13 +95,13 @@ func (m *MockChainClient) ValidatorPerformance(arg0 context.Context, arg1 *eth.V return ret0, ret1 } -// GetValidatorPerformance indicates an expected call of GetValidatorPerformance. -func (mr *MockChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any) *gomock.Call { +// ValidatorPerformance indicates an expected call of ValidatorPerformance. +func (mr *MockChainClientMockRecorder) ValidatorPerformance(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).ValidatorPerformance), arg0, arg1) } -// GetValidatorQueue mocks base method. +// ValidatorQueue mocks base method. func (m *MockChainClient) ValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorQueue", arg0, arg1) @@ -95,28 +110,13 @@ func (m *MockChainClient) ValidatorQueue(arg0 context.Context, arg1 *emptypb.Emp return ret0, ret1 } -// GetValidatorQueue indicates an expected call of GetValidatorQueue. -func (mr *MockChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any) *gomock.Call { +// ValidatorQueue indicates an expected call of ValidatorQueue. +func (mr *MockChainClientMockRecorder) ValidatorQueue(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).ValidatorQueue), arg0, arg1) } -// ListValidatorBalances mocks base method. -func (m *MockChainClient) ValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidatorBalances", arg0, arg1) - ret0, _ := ret[0].(*eth.ValidatorBalances) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListValidatorBalances indicates an expected call of ListValidatorBalances. -func (mr *MockChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ValidatorBalances), arg0, arg1) -} - -// ListValidators mocks base method. +// Validators mocks base method. func (m *MockChainClient) Validators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validators", arg0, arg1) @@ -125,8 +125,8 @@ func (m *MockChainClient) Validators(arg0 context.Context, arg1 *eth.ListValidat return ret0, ret1 } -// ListValidators indicates an expected call of ListValidators. -func (mr *MockChainClientMockRecorder) ListValidators(arg0, arg1 any) *gomock.Call { +// Validators indicates an expected call of Validators. +func (mr *MockChainClientMockRecorder) Validators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockChainClient)(nil).Validators), arg0, arg1) } diff --git a/testing/validator-mock/prysm_chain_client_mock.go b/testing/validator-mock/prysm_chain_client_mock.go index 303f5d91df99..d439cbc7fbfe 100644 --- a/testing/validator-mock/prysm_chain_client_mock.go +++ b/testing/validator-mock/prysm_chain_client_mock.go @@ -41,7 +41,7 @@ func (m *MockPrysmChainClient) EXPECT() *MockPrysmChainClientMockRecorder { return m.recorder } -// GetValidatorCount mocks base method. +// ValidatorCount mocks base method. func (m *MockPrysmChainClient) ValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorCount", arg0, arg1, arg2) @@ -50,8 +50,8 @@ func (m *MockPrysmChainClient) ValidatorCount(arg0 context.Context, arg1 string, return ret0, ret1 } -// GetValidatorCount indicates an expected call of GetValidatorCount. -func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 any) *gomock.Call { +// ValidatorCount indicates an expected call of ValidatorCount. +func (mr *MockPrysmChainClientMockRecorder) ValidatorCount(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).ValidatorCount), arg0, arg1, arg2) } diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index bd6768bfa2e7..cd4f21b5b044 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -237,6 +237,21 @@ func (mr *MockValidatorClientMockRecorder) ProposeAttestation(arg0, arg1 any) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeAttestation", reflect.TypeOf((*MockValidatorClient)(nil).ProposeAttestation), arg0, arg1) } +// ProposeAttestationElectra mocks base method. +func (m *MockValidatorClient) ProposeAttestationElectra(arg0 context.Context, arg1 *eth.AttestationElectra) (*eth.AttestResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProposeAttestationElectra", arg0, arg1) + ret0, _ := ret[0].(*eth.AttestResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProposeAttestationElectra indicates an expected call of ProposeAttestationElectra. +func (mr *MockValidatorClientMockRecorder) ProposeAttestationElectra(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposeAttestationElectra", reflect.TypeOf((*MockValidatorClient)(nil).ProposeAttestationElectra), arg0, arg1) +} + // ProposeBeaconBlock mocks base method. func (m *MockValidatorClient) ProposeBeaconBlock(arg0 context.Context, arg1 *eth.GenericSignedBeaconBlock) (*eth.ProposeResponse, error) { m.ctrl.T.Helper() @@ -306,6 +321,21 @@ func (mr *MockValidatorClientMockRecorder) SubmitAggregateSelectionProof(arg0, a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAggregateSelectionProof", reflect.TypeOf((*MockValidatorClient)(nil).SubmitAggregateSelectionProof), arg0, arg1, arg2, arg3) } +// SubmitAggregateSelectionProofElectra mocks base method. +func (m *MockValidatorClient) SubmitAggregateSelectionProofElectra(arg0 context.Context, arg1 *eth.AggregateSelectionRequest, arg2 primitives.ValidatorIndex, arg3 uint64) (*eth.AggregateSelectionElectraResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubmitAggregateSelectionProofElectra", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*eth.AggregateSelectionElectraResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitAggregateSelectionProofElectra indicates an expected call of SubmitAggregateSelectionProofElectra. +func (mr *MockValidatorClientMockRecorder) SubmitAggregateSelectionProofElectra(arg0, arg1, arg2, arg3 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitAggregateSelectionProofElectra", reflect.TypeOf((*MockValidatorClient)(nil).SubmitAggregateSelectionProofElectra), arg0, arg1, arg2, arg3) +} + // SubmitSignedAggregateSelectionProof mocks base method. func (m *MockValidatorClient) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *eth.SignedAggregateSubmitRequest) (*eth.SignedAggregateSubmitResponse, error) { m.ctrl.T.Helper() @@ -321,6 +351,21 @@ func (mr *MockValidatorClientMockRecorder) SubmitSignedAggregateSelectionProof(a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitSignedAggregateSelectionProof", reflect.TypeOf((*MockValidatorClient)(nil).SubmitSignedAggregateSelectionProof), arg0, arg1) } +// SubmitSignedAggregateSelectionProofElectra mocks base method. +func (m *MockValidatorClient) SubmitSignedAggregateSelectionProofElectra(arg0 context.Context, arg1 *eth.SignedAggregateSubmitElectraRequest) (*eth.SignedAggregateSubmitResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubmitSignedAggregateSelectionProofElectra", arg0, arg1) + ret0, _ := ret[0].(*eth.SignedAggregateSubmitResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SubmitSignedAggregateSelectionProofElectra indicates an expected call of SubmitSignedAggregateSelectionProofElectra. +func (mr *MockValidatorClientMockRecorder) SubmitSignedAggregateSelectionProofElectra(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitSignedAggregateSelectionProofElectra", reflect.TypeOf((*MockValidatorClient)(nil).SubmitSignedAggregateSelectionProofElectra), arg0, arg1) +} + // SubmitSignedContributionAndProof mocks base method. func (m *MockValidatorClient) SubmitSignedContributionAndProof(arg0 context.Context, arg1 *eth.SignedContributionAndProof) (*emptypb.Empty, error) { m.ctrl.T.Helper() diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index 1a56b4860281..ca45c5dd1284 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -16,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" + "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -79,52 +80,84 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives // https://github.com/ethereum/consensus-specs/blob/v0.9.3/specs/validator/0_beacon-chain-validator.md#broadcast-aggregate v.waitToSlotTwoThirds(ctx, slot) - res, err := v.validatorClient.SubmitAggregateSelectionProof(ctx, ðpb.AggregateSelectionRequest{ + postElectra := slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch + + aggSelectionRequest := ðpb.AggregateSelectionRequest{ Slot: slot, CommitteeIndex: duty.CommitteeIndex, PublicKey: pubKey[:], SlotSignature: slotSig, - }, duty.ValidatorIndex, uint64(len(duty.Committee))) - if err != nil { - // handle grpc not found - s, ok := status.FromError(err) - grpcNotFound := ok && s.Code() == codes.NotFound - // handle http not found - jsonErr := &httputil.DefaultJsonError{} - httpNotFound := errors.As(err, &jsonErr) && jsonErr.Code == http.StatusNotFound - - if grpcNotFound || httpNotFound { - log.WithField("slot", slot).WithError(err).Warn("No attestations to aggregate") - } else { - log.WithField("slot", slot).WithError(err).Error("Could not submit aggregate selection proof to beacon node") - if v.emitAccountMetrics { - ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() - } + } + var agg ethpb.AggregateAttAndProof + if postElectra { + res, err := v.validatorClient.SubmitAggregateSelectionProofElectra(ctx, aggSelectionRequest, duty.ValidatorIndex, uint64(len(duty.Committee))) + if err != nil { + v.handleSubmitAggSelectionProofError(err, slot, fmtKey) + return } - - return + agg = res.AggregateAndProof + } else { + res, err := v.validatorClient.SubmitAggregateSelectionProof(ctx, aggSelectionRequest, duty.ValidatorIndex, uint64(len(duty.Committee))) + if err != nil { + v.handleSubmitAggSelectionProofError(err, slot, fmtKey) + return + } + agg = res.AggregateAndProof } - sig, err := v.aggregateAndProofSig(ctx, pubKey, res.AggregateAndProof, slot) + sig, err := v.aggregateAndProofSig(ctx, pubKey, agg, slot) if err != nil { log.WithError(err).Error("Could not sign aggregate and proof") return } - _, err = v.validatorClient.SubmitSignedAggregateSelectionProof(ctx, ðpb.SignedAggregateSubmitRequest{ - SignedAggregateAndProof: ðpb.SignedAggregateAttestationAndProof{ - Message: res.AggregateAndProof, - Signature: sig, - }, - }) - if err != nil { - log.WithError(err).Error("Could not submit signed aggregate and proof to beacon node") - if v.emitAccountMetrics { - ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() + + if postElectra { + msg, ok := agg.(*ethpb.AggregateAttestationAndProofElectra) + if !ok { + log.Errorf("Message is not %T", ðpb.AggregateAttestationAndProofElectra{}) + if v.emitAccountMetrics { + ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() + } + return + } + _, err = v.validatorClient.SubmitSignedAggregateSelectionProofElectra(ctx, ðpb.SignedAggregateSubmitElectraRequest{ + SignedAggregateAndProof: ðpb.SignedAggregateAttestationAndProofElectra{ + Message: msg, + Signature: sig, + }, + }) + if err != nil { + log.WithError(err).Error("Could not submit signed aggregate and proof to beacon node") + if v.emitAccountMetrics { + ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() + } + return + } + } else { + msg, ok := agg.(*ethpb.AggregateAttestationAndProof) + if !ok { + log.Errorf("Message is not %T", ðpb.AggregateAttestationAndProof{}) + if v.emitAccountMetrics { + ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() + } + return + } + _, err = v.validatorClient.SubmitSignedAggregateSelectionProof(ctx, ðpb.SignedAggregateSubmitRequest{ + SignedAggregateAndProof: ðpb.SignedAggregateAttestationAndProof{ + Message: msg, + Signature: sig, + }, + }) + if err != nil { + log.WithError(err).Error("Could not submit signed aggregate and proof to beacon node") + if v.emitAccountMetrics { + ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() + } + return } - return } - if err := v.saveSubmittedAtt(res.AggregateAndProof.Aggregate.Data, pubKey[:], true); err != nil { + if err := v.saveSubmittedAtt(agg.AggregateVal().GetData(), pubKey[:], true); err != nil { log.WithError(err).Error("Could not add aggregator indices to logs") if v.emitAccountMetrics { ValidatorAggFailVec.WithLabelValues(fmtKey).Inc() @@ -196,29 +229,61 @@ func (v *validator) waitToSlotTwoThirds(ctx context.Context, slot primitives.Slo // This returns the signature of validator signing over aggregate and // proof object. -func (v *validator) aggregateAndProofSig(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, agg *ethpb.AggregateAttestationAndProof, slot primitives.Slot) ([]byte, error) { +func (v *validator) aggregateAndProofSig(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, agg ethpb.AggregateAttAndProof, slot primitives.Slot) ([]byte, error) { ctx, span := trace.StartSpan(ctx, "validator.aggregateAndProofSig") defer span.End() - d, err := v.domainData(ctx, slots.ToEpoch(agg.Aggregate.Data.Slot), params.BeaconConfig().DomainAggregateAndProof[:]) + d, err := v.domainData(ctx, slots.ToEpoch(agg.AggregateVal().GetData().Slot), params.BeaconConfig().DomainAggregateAndProof[:]) if err != nil { return nil, err } - var sig bls.Signature root, err := signing.ComputeSigningRoot(agg, d.SignatureDomain) if err != nil { return nil, err } - sig, err = v.km.Sign(ctx, &validatorpb.SignRequest{ + + signRequest := &validatorpb.SignRequest{ PublicKey: pubKey[:], SigningRoot: root[:], SignatureDomain: d.SignatureDomain, - Object: &validatorpb.SignRequest_AggregateAttestationAndProof{AggregateAttestationAndProof: agg}, SigningSlot: slot, - }) + } + if agg.Version() >= version.Electra { + aggregate, ok := agg.(*ethpb.AggregateAttestationAndProofElectra) + if !ok { + return nil, fmt.Errorf("wrong aggregate type (expected %T, got %T)", ðpb.AggregateAttestationAndProofElectra{}, agg) + } + signRequest.Object = &validatorpb.SignRequest_AggregateAttestationAndProofElectra{AggregateAttestationAndProofElectra: aggregate} + } else { + aggregate, ok := agg.(*ethpb.AggregateAttestationAndProof) + if !ok { + return nil, fmt.Errorf("wrong aggregate type (expected %T, got %T)", ðpb.AggregateAttestationAndProof{}, agg) + } + signRequest.Object = &validatorpb.SignRequest_AggregateAttestationAndProof{AggregateAttestationAndProof: aggregate} + } + + sig, err := v.km.Sign(ctx, signRequest) if err != nil { return nil, err } return sig.Marshal(), nil } + +func (v *validator) handleSubmitAggSelectionProofError(err error, slot primitives.Slot, hexPubkey string) { + // handle grpc not found + s, ok := status.FromError(err) + grpcNotFound := ok && s.Code() == codes.NotFound + // handle http not found + jsonErr := &httputil.DefaultJsonError{} + httpNotFound := errors.As(err, &jsonErr) && jsonErr.Code == http.StatusNotFound + + if grpcNotFound || httpNotFound { + log.WithField("slot", slot).WithError(err).Warn("No attestations to aggregate") + } else { + log.WithField("slot", slot).WithError(err).Error("Could not submit aggregate selection proof to beacon node") + if v.emitAccountMetrics { + ValidatorAggFailVec.WithLabelValues(hexPubkey).Inc() + } + } +} diff --git a/validator/client/aggregate_test.go b/validator/client/aggregate_test.go index fc820b0ed5ef..be61693530ba 100644 --- a/validator/client/aggregate_test.go +++ b/validator/client/aggregate_test.go @@ -86,7 +86,7 @@ func TestSubmitAggregateAndProof_SignFails(t *testing.T) { func TestSubmitAggregateAndProof_Ok(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { - t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + t.Run(fmt.Sprintf("Phase 0 (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() var pubKey [fieldparams.BLSPubkeyLength]byte @@ -132,6 +132,59 @@ func TestSubmitAggregateAndProof_Ok(t *testing.T) { validator.SubmitAggregateAndProof(context.Background(), 0, pubKey) }) } + for _, isSlashingProtectionMinimal := range [...]bool{false, true} { + t.Run(fmt.Sprintf("Electra (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { + electraForkEpoch := uint64(1) + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = primitives.Epoch(electraForkEpoch) + params.OverrideBeaconConfig(cfg) + + validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) + defer finish() + var pubKey [fieldparams.BLSPubkeyLength]byte + copy(pubKey[:], validatorKey.PublicKey().Marshal()) + validator.duties = ðpb.DutiesResponse{ + CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{ + { + PublicKey: validatorKey.PublicKey().Marshal(), + }, + }, + } + + m.validatorClient.EXPECT().DomainData( + gomock.Any(), // ctx + gomock.Any(), // epoch + ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) + + m.validatorClient.EXPECT().SubmitAggregateSelectionProofElectra( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(ðpb.AggregateSelectionRequest{}), + gomock.Any(), + gomock.Any(), + ).Return(ðpb.AggregateSelectionElectraResponse{ + AggregateAndProof: ðpb.AggregateAttestationAndProofElectra{ + AggregatorIndex: 0, + Aggregate: util.HydrateAttestationElectra(ðpb.AttestationElectra{ + AggregationBits: make([]byte, 1), + }), + SelectionProof: make([]byte, 96), + }, + }, nil) + + m.validatorClient.EXPECT().DomainData( + gomock.Any(), // ctx + gomock.Any(), // epoch + ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) + + m.validatorClient.EXPECT().SubmitSignedAggregateSelectionProofElectra( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(ðpb.SignedAggregateSubmitElectraRequest{}), + ).Return(ðpb.SignedAggregateSubmitResponse{AttestationDataRoot: make([]byte, 32)}, nil) + + validator.SubmitAggregateAndProof(context.Background(), params.BeaconConfig().SlotsPerEpoch.Mul(electraForkEpoch), pubKey) + }) + } } func TestSubmitAggregateAndProof_Distributed(t *testing.T) { @@ -236,7 +289,7 @@ func TestWaitForSlotTwoThird_DoneContext_ReturnsImmediately(t *testing.T) { func TestAggregateAndProofSignature_CanSignValidSignature(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { - t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + t.Run(fmt.Sprintf("Phase 0 (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() @@ -260,4 +313,35 @@ func TestAggregateAndProofSignature_CanSignValidSignature(t *testing.T) { require.NoError(t, err) }) } + for _, isSlashingProtectionMinimal := range [...]bool{false, true} { + t.Run(fmt.Sprintf("Electra (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { + electraForkEpoch := uint64(1) + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = primitives.Epoch(electraForkEpoch) + params.OverrideBeaconConfig(cfg) + + validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) + defer finish() + + var pubKey [fieldparams.BLSPubkeyLength]byte + copy(pubKey[:], validatorKey.PublicKey().Marshal()) + m.validatorClient.EXPECT().DomainData( + gomock.Any(), // ctx + ðpb.DomainRequest{Epoch: 0, Domain: params.BeaconConfig().DomainAggregateAndProof[:]}, + ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) + + agg := ðpb.AggregateAttestationAndProofElectra{ + AggregatorIndex: 0, + Aggregate: util.HydrateAttestationElectra(ðpb.AttestationElectra{ + AggregationBits: bitfield.NewBitlist(1), + }), + SelectionProof: make([]byte, 96), + } + sig, err := validator.aggregateAndProofSig(context.Background(), pubKey, agg, params.BeaconConfig().SlotsPerEpoch.Mul(electraForkEpoch) /* slot */) + require.NoError(t, err) + _, err = bls.SignatureFromBytes(sig) + require.NoError(t, err) + }) + } } diff --git a/validator/client/attest.go b/validator/client/attest.go index eaa02dac634e..024bfaa0e813 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -85,14 +85,9 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, return } - indexedAtt := ðpb.IndexedAttestation{ - AttestingIndices: []uint64{uint64(duty.ValidatorIndex)}, - Data: data, - } - - _, signingRoot, err := v.domainAndSigningRoot(ctx, indexedAtt.Data) + sig, _, err := v.signAtt(ctx, pubKey, data, slot) if err != nil { - log.WithError(err).Error("Could not get domain and signing root from attestation") + log.WithError(err).Error("Could not sign attestation") if v.emitAccountMetrics { ValidatorAttestFailVec.WithLabelValues(fmtKey).Inc() } @@ -100,9 +95,26 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, return } - sig, _, err := v.signAtt(ctx, pubKey, data, slot) + postElectra := slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch + + var indexedAtt ethpb.IndexedAtt + if postElectra { + indexedAtt = ðpb.IndexedAttestationElectra{ + AttestingIndices: []uint64{uint64(duty.ValidatorIndex)}, + Data: data, + Signature: sig, + } + } else { + indexedAtt = ðpb.IndexedAttestation{ + AttestingIndices: []uint64{uint64(duty.ValidatorIndex)}, + Data: data, + Signature: sig, + } + } + + _, signingRoot, err := v.domainAndSigningRoot(ctx, indexedAtt.GetData()) if err != nil { - log.WithError(err).Error("Could not sign attestation") + log.WithError(err).Error("Could not get domain and signing root from attestation") if v.emitAccountMetrics { ValidatorAttestFailVec.WithLabelValues(fmtKey).Inc() } @@ -127,25 +139,42 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, return } - aggregationBitfield := bitfield.NewBitlist(uint64(len(duty.Committee))) - aggregationBitfield.SetBitAt(indexInCommittee, true) - attestation := ðpb.Attestation{ - Data: data, - AggregationBits: aggregationBitfield, - Signature: sig, + // TODO: Extend to Electra + phase0Att, ok := indexedAtt.(*ethpb.IndexedAttestation) + if ok { + // Send the attestation to the beacon node. + if err := v.db.SlashableAttestationCheck(ctx, phase0Att, pubKey, signingRoot, v.emitAccountMetrics, ValidatorAttestFailVec); err != nil { + log.WithError(err).Error("Failed attestation slashing protection check") + log.WithFields( + attestationLogFields(pubKey, indexedAtt), + ).Debug("Attempted slashable attestation details") + tracing.AnnotateError(span, err) + return + } } - // Set the signature of the attestation and send it out to the beacon node. - indexedAtt.Signature = sig - if err := v.db.SlashableAttestationCheck(ctx, indexedAtt, pubKey, signingRoot, v.emitAccountMetrics, ValidatorAttestFailVec); err != nil { - log.WithError(err).Error("Failed attestation slashing protection check") - log.WithFields( - attestationLogFields(pubKey, indexedAtt), - ).Debug("Attempted slashable attestation details") - tracing.AnnotateError(span, err) - return + aggregationBitfield := bitfield.NewBitlist(uint64(len(duty.Committee))) + aggregationBitfield.SetBitAt(indexInCommittee, true) + committeeBits := primitives.NewAttestationCommitteeBits() + + var attResp *ethpb.AttestResponse + if postElectra { + attestation := ðpb.AttestationElectra{ + Data: data, + AggregationBits: aggregationBitfield, + CommitteeBits: committeeBits, + Signature: sig, + } + attestation.CommitteeBits.SetBitAt(uint64(req.CommitteeIndex), true) + attResp, err = v.validatorClient.ProposeAttestationElectra(ctx, attestation) + } else { + attestation := ðpb.Attestation{ + Data: data, + AggregationBits: aggregationBitfield, + Signature: sig, + } + attResp, err = v.validatorClient.ProposeAttestation(ctx, attestation) } - attResp, err := v.validatorClient.ProposeAttestation(ctx, attestation) if err != nil { log.WithError(err).Error("Could not submit attestation to beacon node") if v.emitAccountMetrics { @@ -167,12 +196,16 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, span.AddAttributes( trace.Int64Attribute("slot", int64(slot)), // lint:ignore uintcast -- This conversion is OK for tracing. trace.StringAttribute("attestationHash", fmt.Sprintf("%#x", attResp.AttestationDataRoot)), - trace.Int64Attribute("committeeIndex", int64(data.CommitteeIndex)), trace.StringAttribute("blockRoot", fmt.Sprintf("%#x", data.BeaconBlockRoot)), trace.Int64Attribute("justifiedEpoch", int64(data.Source.Epoch)), trace.Int64Attribute("targetEpoch", int64(data.Target.Epoch)), - trace.StringAttribute("bitfield", fmt.Sprintf("%#x", aggregationBitfield)), + trace.StringAttribute("aggregationBitfield", fmt.Sprintf("%#x", aggregationBitfield)), ) + if postElectra { + span.AddAttributes(trace.StringAttribute("committeeBitfield", fmt.Sprintf("%#x", committeeBits))) + } else { + span.AddAttributes(trace.Int64Attribute("committeeIndex", int64(data.CommitteeIndex))) + } if v.emitAccountMetrics { ValidatorAttestSuccessVec.WithLabelValues(fmtKey).Inc() @@ -296,16 +329,16 @@ func (v *validator) waitOneThirdOrValidBlock(ctx context.Context, slot primitive } } -func attestationLogFields(pubKey [fieldparams.BLSPubkeyLength]byte, indexedAtt *ethpb.IndexedAttestation) logrus.Fields { +func attestationLogFields(pubKey [fieldparams.BLSPubkeyLength]byte, indexedAtt ethpb.IndexedAtt) logrus.Fields { return logrus.Fields{ "pubkey": fmt.Sprintf("%#x", pubKey), - "slot": indexedAtt.Data.Slot, - "committeeIndex": indexedAtt.Data.CommitteeIndex, - "blockRoot": fmt.Sprintf("%#x", indexedAtt.Data.BeaconBlockRoot), - "sourceEpoch": indexedAtt.Data.Source.Epoch, - "sourceRoot": fmt.Sprintf("%#x", indexedAtt.Data.Source.Root), - "targetEpoch": indexedAtt.Data.Target.Epoch, - "targetRoot": fmt.Sprintf("%#x", indexedAtt.Data.Target.Root), - "signature": fmt.Sprintf("%#x", indexedAtt.Signature), + "slot": indexedAtt.GetData().Slot, + "committeeIndex": indexedAtt.GetData().CommitteeIndex, + "blockRoot": fmt.Sprintf("%#x", indexedAtt.GetData().BeaconBlockRoot), + "sourceEpoch": indexedAtt.GetData().Source.Epoch, + "sourceRoot": fmt.Sprintf("%#x", indexedAtt.GetData().Source.Root), + "targetEpoch": indexedAtt.GetData().Target.Epoch, + "targetRoot": fmt.Sprintf("%#x", indexedAtt.GetData().Target.Root), + "signature": fmt.Sprintf("%#x", indexedAtt.GetSignature()), } } diff --git a/validator/client/attest_test.go b/validator/client/attest_test.go index 2ecab88bc167..68a5b2cce7ec 100644 --- a/validator/client/attest_test.go +++ b/validator/client/attest_test.go @@ -108,7 +108,7 @@ func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) { func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { - t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + t.Run(fmt.Sprintf("Phase 0 (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() hook := logTest.NewGlobal() @@ -167,6 +167,89 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { root, err := signing.ComputeSigningRoot(expectedAttestation.Data, make([]byte, 32)) require.NoError(t, err) + sig, err := validator.km.Sign(context.Background(), &validatorpb.SignRequest{ + PublicKey: validatorKey.PublicKey().Marshal(), + SigningRoot: root[:], + }) + require.NoError(t, err) + expectedAttestation.Signature = sig.Marshal() + if !reflect.DeepEqual(generatedAttestation, expectedAttestation) { + t.Errorf("Incorrectly attested head, wanted %v, received %v", expectedAttestation, generatedAttestation) + diff, _ := messagediff.PrettyDiff(expectedAttestation, generatedAttestation) + t.Log(diff) + } + require.LogsDoNotContain(t, hook, "Could not") + }) + } + for _, isSlashingProtectionMinimal := range [...]bool{false, true} { + t.Run(fmt.Sprintf("Electra (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { + electraForkEpoch := uint64(1) + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = primitives.Epoch(electraForkEpoch) + params.OverrideBeaconConfig(cfg) + + validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) + defer finish() + hook := logTest.NewGlobal() + validatorIndex := primitives.ValidatorIndex(7) + committee := []primitives.ValidatorIndex{0, 3, 4, 2, validatorIndex, 6, 8, 9, 10} + var pubKey [fieldparams.BLSPubkeyLength]byte + copy(pubKey[:], validatorKey.PublicKey().Marshal()) + validator.duties = ðpb.DutiesResponse{CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{ + { + PublicKey: validatorKey.PublicKey().Marshal(), + CommitteeIndex: 5, + Committee: committee, + ValidatorIndex: validatorIndex, + }, + }} + + beaconBlockRoot := bytesutil.ToBytes32([]byte("A")) + targetRoot := bytesutil.ToBytes32([]byte("B")) + sourceRoot := bytesutil.ToBytes32([]byte("C")) + m.validatorClient.EXPECT().AttestationData( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(ðpb.AttestationDataRequest{}), + ).Return(ðpb.AttestationData{ + BeaconBlockRoot: beaconBlockRoot[:], + Target: ðpb.Checkpoint{Root: targetRoot[:]}, + Source: ðpb.Checkpoint{Root: sourceRoot[:], Epoch: 3}, + }, nil) + + m.validatorClient.EXPECT().DomainData( + gomock.Any(), // ctx + gomock.Any(), // epoch + ).Times(2).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) + + var generatedAttestation *ethpb.AttestationElectra + m.validatorClient.EXPECT().ProposeAttestationElectra( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(ðpb.AttestationElectra{}), + ).Do(func(_ context.Context, att *ethpb.AttestationElectra) { + generatedAttestation = att + }).Return(ðpb.AttestResponse{}, nil /* error */) + + validator.SubmitAttestation(context.Background(), params.BeaconConfig().SlotsPerEpoch.Mul(electraForkEpoch), pubKey) + + aggregationBitfield := bitfield.NewBitlist(uint64(len(committee))) + aggregationBitfield.SetBitAt(4, true) + committeeBits := primitives.NewAttestationCommitteeBits() + committeeBits.SetBitAt(5, true) + expectedAttestation := ðpb.AttestationElectra{ + Data: ðpb.AttestationData{ + BeaconBlockRoot: beaconBlockRoot[:], + Target: ðpb.Checkpoint{Root: targetRoot[:]}, + Source: ðpb.Checkpoint{Root: sourceRoot[:], Epoch: 3}, + }, + AggregationBits: aggregationBitfield, + CommitteeBits: committeeBits, + Signature: make([]byte, 96), + } + + root, err := signing.ComputeSigningRoot(expectedAttestation.Data, make([]byte, 32)) + require.NoError(t, err) + sig, err := validator.km.Sign(context.Background(), &validatorpb.SignRequest{ PublicKey: validatorKey.PublicKey().Marshal(), SigningRoot: root[:], diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 973687d76151..56dad0c777eb 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -154,6 +154,10 @@ func (c *beaconApiValidatorClient) ProposeAttestation(ctx context.Context, in *e }) } +func (c *beaconApiValidatorClient) ProposeAttestationElectra(ctx context.Context, in *ethpb.AttestationElectra) (*ethpb.AttestResponse, error) { + return nil, errors.New("ProposeAttestationElectra is not implemented") +} + func (c *beaconApiValidatorClient) ProposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { ctx, span := trace.StartSpan(ctx, "beacon-api.ProposeBeaconBlock") defer span.End() @@ -185,6 +189,10 @@ func (c *beaconApiValidatorClient) SubmitAggregateSelectionProof(ctx context.Con }) } +func (c *beaconApiValidatorClient) SubmitAggregateSelectionProofElectra(ctx context.Context, in *ethpb.AggregateSelectionRequest, index primitives.ValidatorIndex, committeeLength uint64) (*ethpb.AggregateSelectionElectraResponse, error) { + return nil, errors.New("SubmitAggregateSelectionProofElectra is not implemented") +} + func (c *beaconApiValidatorClient) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) { ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitSignedAggregateSelectionProof") defer span.End() @@ -194,6 +202,10 @@ func (c *beaconApiValidatorClient) SubmitSignedAggregateSelectionProof(ctx conte }) } +func (c *beaconApiValidatorClient) SubmitSignedAggregateSelectionProofElectra(ctx context.Context, in *ethpb.SignedAggregateSubmitElectraRequest) (*ethpb.SignedAggregateSubmitResponse, error) { + return nil, errors.New("SubmitSignedAggregateSelectionProofElectra is not implemented") +} + func (c *beaconApiValidatorClient) SubmitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) (*empty.Empty, error) { ctx, span := trace.StartSpan(ctx, "beacon-api.SubmitSignedContributionAndProof") defer span.End() diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go index bc1f6c1ca26d..f4e758bd23aa 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go @@ -292,7 +292,7 @@ func TestGetValidatorCount(t *testing.T) { } chainClient := mock.NewMockChainClient(ctrl) - chainClient.EXPECT().ListValidators( + chainClient.EXPECT().Validators( gomock.Any(), gomock.Any(), ).Return( @@ -300,7 +300,7 @@ func TestGetValidatorCount(t *testing.T) { nil, ) - chainClient.EXPECT().GetChainHead( + chainClient.EXPECT().ChainHead( gomock.Any(), gomock.Any(), ).Return( diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index da2001965e4a..c03d504dff80 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -71,6 +71,10 @@ func (c *grpcValidatorClient) ProposeAttestation(ctx context.Context, in *ethpb. return c.beaconNodeValidatorClient.ProposeAttestation(ctx, in) } +func (c *grpcValidatorClient) ProposeAttestationElectra(ctx context.Context, in *ethpb.AttestationElectra) (*ethpb.AttestResponse, error) { + return c.beaconNodeValidatorClient.ProposeAttestationElectra(ctx, in) +} + func (c *grpcValidatorClient) ProposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { return c.beaconNodeValidatorClient.ProposeBeaconBlock(ctx, in) } @@ -87,10 +91,18 @@ func (c *grpcValidatorClient) SubmitAggregateSelectionProof(ctx context.Context, return c.beaconNodeValidatorClient.SubmitAggregateSelectionProof(ctx, in) } +func (c *grpcValidatorClient) SubmitAggregateSelectionProofElectra(ctx context.Context, in *ethpb.AggregateSelectionRequest, _ primitives.ValidatorIndex, _ uint64) (*ethpb.AggregateSelectionElectraResponse, error) { + return c.beaconNodeValidatorClient.SubmitAggregateSelectionProofElectra(ctx, in) +} + func (c *grpcValidatorClient) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) { return c.beaconNodeValidatorClient.SubmitSignedAggregateSelectionProof(ctx, in) } +func (c *grpcValidatorClient) SubmitSignedAggregateSelectionProofElectra(ctx context.Context, in *ethpb.SignedAggregateSubmitElectraRequest) (*ethpb.SignedAggregateSubmitResponse, error) { + return c.beaconNodeValidatorClient.SubmitSignedAggregateSelectionProofElectra(ctx, in) +} + func (c *grpcValidatorClient) SubmitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) (*empty.Empty, error) { return c.beaconNodeValidatorClient.SubmitSignedContributionAndProof(ctx, in) } diff --git a/validator/client/iface/validator_client.go b/validator/client/iface/validator_client.go index 1fe0e85530ca..71388211f9d8 100644 --- a/validator/client/iface/validator_client.go +++ b/validator/client/iface/validator_client.go @@ -134,8 +134,11 @@ type ValidatorClient interface { FeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) ProposeAttestation(ctx context.Context, in *ethpb.Attestation) (*ethpb.AttestResponse, error) + ProposeAttestationElectra(ctx context.Context, in *ethpb.AttestationElectra) (*ethpb.AttestResponse, error) SubmitAggregateSelectionProof(ctx context.Context, in *ethpb.AggregateSelectionRequest, index primitives.ValidatorIndex, committeeLength uint64) (*ethpb.AggregateSelectionResponse, error) + SubmitAggregateSelectionProofElectra(ctx context.Context, in *ethpb.AggregateSelectionRequest, _ primitives.ValidatorIndex, _ uint64) (*ethpb.AggregateSelectionElectraResponse, error) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) + SubmitSignedAggregateSelectionProofElectra(ctx context.Context, in *ethpb.SignedAggregateSubmitElectraRequest) (*ethpb.SignedAggregateSubmitResponse, error) ProposeExit(ctx context.Context, in *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) SubscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) (*empty.Empty, error) CheckDoppelGanger(ctx context.Context, in *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error) diff --git a/validator/client/key_reload_test.go b/validator/client/key_reload_test.go index 781317341470..df8e0435e1a0 100644 --- a/validator/client/key_reload_test.go +++ b/validator/client/key_reload_test.go @@ -47,7 +47,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { PublicKeys: [][]byte{inactive.pub[:], active.pub[:]}, }, ).Return(resp, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validator2.Status{validator2.Active}, @@ -83,7 +83,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(resp, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validator2.Status{validator2.Active}, diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 98b96d02db85..734dfbd40702 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -315,7 +315,7 @@ func TestCanonicalHeadSlot_FailedRPC(t *testing.T) { chainClient: client, genesisTime: 1, } - client.EXPECT().GetChainHead( + client.EXPECT().ChainHead( gomock.Any(), gomock.Any(), ).Return(nil, errors.New("failed")) @@ -330,7 +330,7 @@ func TestCanonicalHeadSlot_OK(t *testing.T) { v := validator{ chainClient: client, } - client.EXPECT().GetChainHead( + client.EXPECT().ChainHead( gomock.Any(), gomock.Any(), ).Return(ðpb.ChainHead{HeadSlot: 0}, nil) @@ -369,7 +369,7 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) { resp, nil, ) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, diff --git a/validator/client/wait_for_activation_test.go b/validator/client/wait_for_activation_test.go index 333075fb637d..e3e5f3392198 100644 --- a/validator/client/wait_for_activation_test.go +++ b/validator/client/wait_for_activation_test.go @@ -73,7 +73,7 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, errors.New("failed stream")).Return(clientStream, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -104,7 +104,7 @@ func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testin PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -143,7 +143,7 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -178,7 +178,7 @@ func TestWaitForActivation_Exiting(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -221,7 +221,7 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) { PublicKeys: [][]byte{kp.pub[:]}, }, ).Return(clientStream, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -278,7 +278,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { time.Sleep(time.Second * 2) return inactiveClientStream, nil }) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -370,7 +370,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { time.Sleep(time.Second * 2) return inactiveClientStream, nil }) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, @@ -431,7 +431,7 @@ func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) { gomock.Any(), gomock.Any(), ).Return(clientStream, nil) - prysmChainClient.EXPECT().GetValidatorCount( + prysmChainClient.EXPECT().ValidatorCount( gomock.Any(), "head", []validatorType.Status{validatorType.Active}, diff --git a/validator/rpc/handlers_beacon_test.go b/validator/rpc/handlers_beacon_test.go index aac83632a582..dd2b5a8518b5 100644 --- a/validator/rpc/handlers_beacon_test.go +++ b/validator/rpc/handlers_beacon_test.go @@ -60,7 +60,7 @@ func TestGetBeaconStatus_OK(t *testing.T) { GenesisTime: timeStamp, DepositContractAddress: []byte("hello"), }, nil) - chainClient.EXPECT().GetChainHead( + chainClient.EXPECT().ChainHead( gomock.Any(), // ctx gomock.Any(), ).Return(ðpb.ChainHead{ @@ -230,7 +230,7 @@ func TestServer_GetValidators(t *testing.T) { ctrl := gomock.NewController(t) beaconChainClient := validatormock.NewMockChainClient(ctrl) if tt.wantErr == "" { - beaconChainClient.EXPECT().ListValidators( + beaconChainClient.EXPECT().Validators( gomock.Any(), // ctx tt.expectedReq, ).Return(tt.chainResp, nil) From a00b40fa8166af1144971f511002d0de54d5ad2b Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 11 Jul 2024 15:31:08 -0500 Subject: [PATCH 186/325] State: HasPendingBalanceToWithdraw (#14200) * Implement HasPendingBalanceToWithdraw to improve the best / average case lookup * Add tests for HasPendingBalanceToWithdraw --- beacon-chain/core/blocks/exit.go | 6 ++-- beacon-chain/state/interfaces.go | 1 + .../state/state-native/getters_validator.go | 21 ++++++++++++++ .../state-native/getters_validator_test.go | 29 +++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/beacon-chain/core/blocks/exit.go b/beacon-chain/core/blocks/exit.go index 99da22fae90a..ca0e8f33e127 100644 --- a/beacon-chain/core/blocks/exit.go +++ b/beacon-chain/core/blocks/exit.go @@ -193,12 +193,12 @@ func verifyExitConditions(st state.ReadOnlyBeaconState, validator state.ReadOnly if st.Version() >= version.Electra { // Only exit validator if it has no pending withdrawals in the queue. - pbw, err := st.PendingBalanceToWithdraw(exit.ValidatorIndex) + ok, err := st.HasPendingBalanceToWithdraw(exit.ValidatorIndex) if err != nil { return fmt.Errorf("unable to retrieve pending balance to withdraw for validator %d: %w", exit.ValidatorIndex, err) } - if pbw != 0 { - return fmt.Errorf("validator %d must have no pending balance to withdraw, got %d pending balance to withdraw", exit.ValidatorIndex, pbw) + if ok { + return fmt.Errorf("validator %d must have no pending balance to withdraw", exit.ValidatorIndex) } } diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 949d735881ea..39f2a476d24b 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -200,6 +200,7 @@ type ReadOnlyWithdrawals interface { NextWithdrawalIndex() (uint64, error) PendingBalanceToWithdraw(idx primitives.ValidatorIndex) (uint64, error) NumPendingPartialWithdrawals() (uint64, error) + HasPendingBalanceToWithdraw(idx primitives.ValidatorIndex) (bool, error) } // ReadOnlyParticipation defines a struct which only has read access to participation methods. diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index cfc3779c170e..12bd1c45bb99 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -501,3 +501,24 @@ func (b *BeaconState) PendingBalanceToWithdraw(idx primitives.ValidatorIndex) (u } return sum, nil } + +func (b *BeaconState) HasPendingBalanceToWithdraw(idx primitives.ValidatorIndex) (bool, error) { + if b.version < version.Electra { + return false, errNotSupported("HasPendingBalanceToWithdraw", b.version) + } + + b.lock.RLock() + defer b.lock.RUnlock() + + // TODO: Consider maintaining this value in the state, if it's a potential bottleneck. + // This is n*m complexity, but this method can only be called + // MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD per slot. A more optimized storage indexing such as a + // lookup map could be used to reduce the complexity marginally. + for _, w := range b.pendingPartialWithdrawals { + if w.Index == idx { + return true, nil + } + } + + return false, nil +} diff --git a/beacon-chain/state/state-native/getters_validator_test.go b/beacon-chain/state/state-native/getters_validator_test.go index c4938832067d..fed0359806e3 100644 --- a/beacon-chain/state/state-native/getters_validator_test.go +++ b/beacon-chain/state/state-native/getters_validator_test.go @@ -162,3 +162,32 @@ func TestAggregateKeyFromIndices(t *testing.T) { assert.Equal(t, true, aggKey.Equals(retKey), "unequal aggregated keys") } + +func TestHasPendingBalanceToWithdraw(t *testing.T) { + pb := ðpb.BeaconStateElectra{ + PendingPartialWithdrawals: []*ethpb.PendingPartialWithdrawal{ + { + Amount: 100, + Index: 1, + }, + { + Amount: 200, + Index: 2, + }, + { + Amount: 300, + Index: 3, + }, + }, + } + state, err := statenative.InitializeFromProtoUnsafeElectra(pb) + require.NoError(t, err) + + ok, err := state.HasPendingBalanceToWithdraw(1) + require.NoError(t, err) + require.Equal(t, true, ok) + + ok, err = state.HasPendingBalanceToWithdraw(5) + require.NoError(t, err) + require.Equal(t, false, ok) +} From afb7383225f925fb37cdb7ca51bcaac6ec515d03 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:21:06 -0500 Subject: [PATCH 187/325] adding electra version to payload attribute event (#14212) --- beacon-chain/rpc/eth/events/events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 942b02545a8b..205f29a46901 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -459,7 +459,7 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()), Withdrawals: structs.WithdrawalsFromConsensus(withdrawals), } - case version.Deneb: + case version.Deneb, version.Electra: withdrawals, _, err := headState.ExpectedWithdrawals() if err != nil { return write(w, flusher, "Could not get head state expected withdrawals: "+err.Error()) From ec84a1b49c8db2e0b0009058d8b1299a66153530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 12 Jul 2024 17:37:29 +0200 Subject: [PATCH 188/325] EIP-7549: Allow multiple committee bits (#14203) --- proto/prysm/v1alpha1/attestation/BUILD.bazel | 1 + proto/prysm/v1alpha1/attestation/id.go | 27 +++++++++++--------- proto/prysm/v1alpha1/attestation/id_test.go | 26 ++++++++++++------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index 587e12e1db7e..b1ee168216a5 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", + "//crypto/hash:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/id.go b/proto/prysm/v1alpha1/attestation/id.go index 4674c13974b6..2d98fbbb7e65 100644 --- a/proto/prysm/v1alpha1/attestation/id.go +++ b/proto/prysm/v1alpha1/attestation/id.go @@ -1,11 +1,12 @@ package attestation import ( - "fmt" + "strconv" + "strings" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -44,19 +45,21 @@ func NewId(att ethpb.Att, source IdSource) (Id, error) { copy(id[1:], h[:]) return id, nil case Data: - data := att.GetData() + dataHash, err := att.GetData().HashTreeRoot() + if err != nil { + return Id{}, err + } + h := dataHash if att.Version() >= version.Electra { committeeIndices := att.CommitteeBitsVal().BitIndices() - if len(committeeIndices) != 1 { - return Id{}, fmt.Errorf("%d committee bits are set instead of 1", len(committeeIndices)) + if len(committeeIndices) == 0 { + return Id{}, errors.New("no committee bits are set") } - dataCopy := ethpb.CopyAttestationData(att.GetData()) - dataCopy.CommitteeIndex = primitives.CommitteeIndex(committeeIndices[0]) - data = dataCopy - } - h, err := data.HashTreeRoot() - if err != nil { - return Id{}, err + stringCommitteeIndices := make([]string, len(committeeIndices)) + for i, ix := range committeeIndices { + stringCommitteeIndices[i] = strconv.Itoa(ix) + } + h = hash.Hash(append(dataHash[:], []byte(strings.Join(stringCommitteeIndices, ","))...)) } copy(id[1:], h[:]) return id, nil diff --git a/proto/prysm/v1alpha1/attestation/id_test.go b/proto/prysm/v1alpha1/attestation/id_test.go index cd6715464b72..a2943d482a80 100644 --- a/proto/prysm/v1alpha1/attestation/id_test.go +++ b/proto/prysm/v1alpha1/attestation/id_test.go @@ -41,6 +41,22 @@ func TestNewId(t *testing.T) { assert.NotEqual(t, phase0Id, electraId) }) + t.Run("ID is different for different committee bits", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(1, true) + att := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) + id1, err := attestation.NewId(att, attestation.Data) + assert.NoError(t, err) + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(2, true) + att = util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) + id2, err := attestation.NewId(att, attestation.Data) + assert.NoError(t, err) + + assert.NotEqual(t, id1, id2) + }) t.Run("invalid source", func(t *testing.T) { att := util.HydrateAttestation(ðpb.Attestation{}) _, err := attestation.NewId(att, 123) @@ -50,14 +66,6 @@ func TestNewId(t *testing.T) { cb := primitives.NewAttestationCommitteeBits() att := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) _, err := attestation.NewId(att, attestation.Data) - assert.ErrorContains(t, "0 committee bits are set", err) - }) - t.Run("data source Electra - multiple bits set", func(t *testing.T) { - cb := primitives.NewAttestationCommitteeBits() - cb.SetBitAt(0, true) - cb.SetBitAt(1, true) - att := util.HydrateAttestationElectra(ðpb.AttestationElectra{CommitteeBits: cb}) - _, err := attestation.NewId(att, attestation.Data) - assert.ErrorContains(t, "2 committee bits are set", err) + assert.ErrorContains(t, "no committee bits are set", err) }) } From 5267b4b4d4ce8aa4b940b22982e98e60ee225590 Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 12 Jul 2024 13:38:17 -0300 Subject: [PATCH 189/325] Fix Merkle proof generator for Electra (#14211) --- beacon-chain/verification/blob_test.go | 20 ++++++++++++++++++++ consensus-types/blocks/kzg.go | 13 +++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/beacon-chain/verification/blob_test.go b/beacon-chain/verification/blob_test.go index d5df7db2a65d..e08707de464f 100644 --- a/beacon-chain/verification/blob_test.go +++ b/beacon-chain/verification/blob_test.go @@ -403,6 +403,26 @@ func TestSidecarInclusionProven(t *testing.T) { require.NotNil(t, v.results.result(RequireSidecarInclusionProven)) } +func TestSidecarInclusionProvenElectra(t *testing.T) { + // GenerateTestDenebBlockWithSidecar is supposed to generate valid inclusion proofs + _, blobs := util.GenerateTestElectraBlockWithSidecar(t, [32]byte{}, 1, 1) + b := blobs[0] + + ini := Initializer{} + v := ini.NewBlobVerifier(b, GossipSidecarRequirements) + require.NoError(t, v.SidecarInclusionProven()) + require.Equal(t, true, v.results.executed(RequireSidecarInclusionProven)) + require.NoError(t, v.results.result(RequireSidecarInclusionProven)) + + // Invert bits of the first byte of the body root to mess up the proof + byte0 := b.SignedBlockHeader.Header.BodyRoot[0] + b.SignedBlockHeader.Header.BodyRoot[0] = byte0 ^ 255 + v = ini.NewBlobVerifier(b, GossipSidecarRequirements) + require.ErrorIs(t, v.SidecarInclusionProven(), ErrSidecarInclusionProofInvalid) + require.Equal(t, true, v.results.executed(RequireSidecarInclusionProven)) + require.NotNil(t, v.results.result(RequireSidecarInclusionProven)) +} + func TestSidecarKzgProofVerified(t *testing.T) { // GenerateTestDenebBlockWithSidecar is supposed to generate valid commitments _, blobs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 1, 1) diff --git a/consensus-types/blocks/kzg.go b/consensus-types/blocks/kzg.go index 2be40c9928b5..b5e2800bf702 100644 --- a/consensus-types/blocks/kzg.go +++ b/consensus-types/blocks/kzg.go @@ -156,7 +156,12 @@ func topLevelRoots(body interfaces.ReadOnlyBeaconBlockBody) ([][]byte, error) { // Attester slashings as := body.AttesterSlashings() - root, err = ssz.MerkleizeListSSZ(as, params.BeaconConfig().MaxAttesterSlashings) + bodyVersion := body.Version() + if bodyVersion < version.Electra { + root, err = ssz.MerkleizeListSSZ(as, params.BeaconConfig().MaxAttesterSlashings) + } else { + root, err = ssz.MerkleizeListSSZ(as, params.BeaconConfig().MaxAttesterSlashingsElectra) + } if err != nil { return nil, err } @@ -164,7 +169,11 @@ func topLevelRoots(body interfaces.ReadOnlyBeaconBlockBody) ([][]byte, error) { // Attestations att := body.Attestations() - root, err = ssz.MerkleizeListSSZ(att, params.BeaconConfig().MaxAttestations) + if bodyVersion < version.Electra { + root, err = ssz.MerkleizeListSSZ(att, params.BeaconConfig().MaxAttestations) + } else { + root, err = ssz.MerkleizeListSSZ(att, params.BeaconConfig().MaxAttestationsElectra) + } if err != nil { return nil, err } From 3eacc378312fc251f2cf7d9b354e31bbc8b3b658 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 12 Jul 2024 11:50:29 -0500 Subject: [PATCH 190/325] Electra: Forkchoice spectest fix (#14180) --- testing/spectest/shared/common/forkchoice/builder.go | 2 +- testing/spectest/shared/common/forkchoice/runner.go | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/testing/spectest/shared/common/forkchoice/builder.go b/testing/spectest/shared/common/forkchoice/builder.go index 81421dc8875d..ac07073d6fd0 100644 --- a/testing/spectest/shared/common/forkchoice/builder.go +++ b/testing/spectest/shared/common/forkchoice/builder.go @@ -120,7 +120,7 @@ func (bb *Builder) PoWBlock(pb *ethpb.PowBlock) { } // Attestation receives the attestation and updates forkchoice. -func (bb *Builder) Attestation(t testing.TB, a *ethpb.Attestation) { +func (bb *Builder) Attestation(t testing.TB, a ethpb.Att) { require.NoError(t, bb.service.OnAttestation(context.TODO(), a, params.BeaconConfig().MaximumGossipClockDisparityDuration())) } diff --git a/testing/spectest/shared/common/forkchoice/runner.go b/testing/spectest/shared/common/forkchoice/runner.go index 4f4784446f6c..c999888c80db 100644 --- a/testing/spectest/shared/common/forkchoice/runner.go +++ b/testing/spectest/shared/common/forkchoice/runner.go @@ -37,7 +37,7 @@ func Run(t *testing.T, config string, fork int) { } } -func runTest(t *testing.T, config string, fork int, basePath string) { +func runTest(t *testing.T, config string, fork int, basePath string) { // nolint:gocognit require.NoError(t, utils.SetConfig(t, config)) testFolders, _ := utils.TestFolders(t, config, version.String(fork), basePath) if len(testFolders) == 0 { @@ -144,7 +144,12 @@ func runTest(t *testing.T, config string, fork int, basePath string) { require.NoError(t, err) attSSZ, err := snappy.Decode(nil /* dst */, attFile) require.NoError(t, err) - att := ðpb.Attestation{} + var att ethpb.Att + if fork < version.Electra { + att = ðpb.Attestation{} + } else { + att = ðpb.AttestationElectra{} + } require.NoError(t, att.UnmarshalSSZ(attSSZ), "Failed to unmarshal") builder.Attestation(t, att) } From c238c00630d9c13f75a2ee25b17e93158b916b62 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 12 Jul 2024 11:59:04 -0500 Subject: [PATCH 191/325] Electra: EIP-7251 implement process_withdrawal updates (#14181) * Electra: EIP-7251 implement process_withdrawal updates * Unit tests for new process_withdrawal logic in electra --- beacon-chain/core/blocks/withdrawals.go | 57 ++++--- beacon-chain/core/blocks/withdrawals_test.go | 141 +++++++++++++----- beacon-chain/core/electra/withdrawals.go | 105 ++++++------- beacon-chain/core/helpers/BUILD.bazel | 1 + beacon-chain/core/helpers/validators.go | 8 +- beacon-chain/core/helpers/validators_test.go | 10 +- .../state/state-native/getters_withdrawal.go | 4 +- 7 files changed, 207 insertions(+), 119 deletions(-) diff --git a/beacon-chain/core/blocks/withdrawals.go b/beacon-chain/core/blocks/withdrawals.go index 5b234d1614a8..e2f202ce9081 100644 --- a/beacon-chain/core/blocks/withdrawals.go +++ b/beacon-chain/core/blocks/withdrawals.go @@ -120,32 +120,35 @@ func ValidateBLSToExecutionChange(st state.ReadOnlyBeaconState, signed *ethpb.Si // // Spec pseudocode definition: // -// def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None: +// def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None: +// expected_withdrawals, partial_withdrawals_count = get_expected_withdrawals(state) # [Modified in Electra:EIP7251] // -// expected_withdrawals = get_expected_withdrawals(state) -// assert len(payload.withdrawals) == len(expected_withdrawals) +// assert len(payload.withdrawals) == len(expected_withdrawals) // -// for expected_withdrawal, withdrawal in zip(expected_withdrawals, payload.withdrawals): -// assert withdrawal == expected_withdrawal -// decrease_balance(state, withdrawal.validator_index, withdrawal.amount) +// for expected_withdrawal, withdrawal in zip(expected_withdrawals, payload.withdrawals): +// assert withdrawal == expected_withdrawal +// decrease_balance(state, withdrawal.validator_index, withdrawal.amount) // -// # Update the next withdrawal index if this block contained withdrawals -// if len(expected_withdrawals) != 0: -// latest_withdrawal = expected_withdrawals[-1] -// state.next_withdrawal_index = WithdrawalIndex(latest_withdrawal.index + 1) +// # Update pending partial withdrawals [New in Electra:EIP7251] +// state.pending_partial_withdrawals = state.pending_partial_withdrawals[partial_withdrawals_count:] // -// # Update the next validator index to start the next withdrawal sweep -// if len(expected_withdrawals) == MAX_WITHDRAWALS_PER_PAYLOAD: -// # Next sweep starts after the latest withdrawal's validator index -// next_validator_index = ValidatorIndex((expected_withdrawals[-1].validator_index + 1) % len(state.validators)) -// state.next_withdrawal_validator_index = next_validator_index -// else: -// # Advance sweep by the max length of the sweep if there was not a full set of withdrawals -// next_index = state.next_withdrawal_validator_index + MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP -// next_validator_index = ValidatorIndex(next_index % len(state.validators)) -// state.next_withdrawal_validator_index = next_validator_index +// # Update the next withdrawal index if this block contained withdrawals +// if len(expected_withdrawals) != 0: +// latest_withdrawal = expected_withdrawals[-1] +// state.next_withdrawal_index = WithdrawalIndex(latest_withdrawal.index + 1) +// +// # Update the next validator index to start the next withdrawal sweep +// if len(expected_withdrawals) == MAX_WITHDRAWALS_PER_PAYLOAD: +// # Next sweep starts after the latest withdrawal's validator index +// next_validator_index = ValidatorIndex((expected_withdrawals[-1].validator_index + 1) % len(state.validators)) +// state.next_withdrawal_validator_index = next_validator_index +// else: +// # Advance sweep by the max length of the sweep if there was not a full set of withdrawals +// next_index = state.next_withdrawal_validator_index + MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP +// next_validator_index = ValidatorIndex(next_index % len(state.validators)) +// state.next_withdrawal_validator_index = next_validator_index func ProcessWithdrawals(st state.BeaconState, executionData interfaces.ExecutionData) (state.BeaconState, error) { - expectedWithdrawals, _, err := st.ExpectedWithdrawals() + expectedWithdrawals, partialWithdrawalsCount, err := st.ExpectedWithdrawals() if err != nil { return nil, errors.Wrap(err, "could not get expected withdrawals") } @@ -162,6 +165,11 @@ func ProcessWithdrawals(st state.BeaconState, executionData interfaces.Execution if err != nil { return nil, errors.Wrap(err, "could not get withdrawals") } + + if len(wds) != len(expectedWithdrawals) { + return nil, fmt.Errorf("execution payload header has %d withdrawals when %d were expected", len(wds), len(expectedWithdrawals)) + } + wdRoot, err = ssz.WithdrawalSliceRoot(wds, fieldparams.MaxWithdrawalsPerPayload) if err != nil { return nil, errors.Wrap(err, "could not get withdrawals root") @@ -182,6 +190,13 @@ func ProcessWithdrawals(st state.BeaconState, executionData interfaces.Execution return nil, errors.Wrap(err, "could not decrease balance") } } + + if st.Version() >= version.Electra { + if err := st.DequeuePartialWithdrawals(partialWithdrawalsCount); err != nil { + return nil, fmt.Errorf("unable to dequeue partial withdrawals from state: %w", err) + } + } + if len(expectedWithdrawals) > 0 { if err := st.SetNextWithdrawalIndex(expectedWithdrawals[len(expectedWithdrawals)-1].Index + 1); err != nil { return nil, errors.Wrap(err, "could not set next withdrawal index") diff --git a/beacon-chain/core/blocks/withdrawals_test.go b/beacon-chain/core/blocks/withdrawals_test.go index 6b0f6caf660b..7d7dc5dc08f6 100644 --- a/beacon-chain/core/blocks/withdrawals_test.go +++ b/beacon-chain/core/blocks/withdrawals_test.go @@ -12,6 +12,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/crypto/bls/common" @@ -19,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/ssz" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -675,6 +677,7 @@ func TestProcessWithdrawals(t *testing.T) { FullWithdrawalIndices []primitives.ValidatorIndex PendingPartialWithdrawalIndices []primitives.ValidatorIndex Withdrawals []*enginev1.Withdrawal + PendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal // Electra } type control struct { NextWithdrawalValidatorIndex primitives.ValidatorIndex @@ -772,7 +775,7 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "Less than max sweep at end", + Name: "less than max sweep at end", NextWithdrawalIndex: 22, NextWithdrawalValidatorIndex: 4, FullWithdrawalIndices: []primitives.ValidatorIndex{80, 81, 82, 83}, @@ -789,7 +792,7 @@ func TestProcessWithdrawals(t *testing.T) { }, { Args: args{ - Name: "Less than max sweep and beginning", + Name: "less than max sweep and beginning", NextWithdrawalIndex: 22, NextWithdrawalValidatorIndex: 4, FullWithdrawalIndices: []primitives.ValidatorIndex{4, 5, 6}, @@ -846,6 +849,36 @@ func TestProcessWithdrawals(t *testing.T) { }, }, }, + { + Args: args{ + Name: "success many withdrawals with pending partial withdrawals in state", + NextWithdrawalIndex: 22, + NextWithdrawalValidatorIndex: 88, + FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28}, + PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15}, + Withdrawals: []*enginev1.Withdrawal{ + PendingPartialWithdrawal(89, 22), PendingPartialWithdrawal(1, 23), PendingPartialWithdrawal(2, 24), + fullWithdrawal(7, 25), PendingPartialWithdrawal(15, 26), fullWithdrawal(19, 27), + fullWithdrawal(28, 28), + }, + PendingPartialWithdrawals: []*ethpb.PendingPartialWithdrawal{ + { + Index: 11, + Amount: withdrawalAmount(11) - maxEffectiveBalance, + }, + }, + }, + Control: control{ + NextWithdrawalValidatorIndex: 40, + NextWithdrawalIndex: 29, + Balances: map[uint64]uint64{ + 7: 0, 19: 0, 28: 0, + 2: maxEffectiveBalance, 1: maxEffectiveBalance, 89: maxEffectiveBalance, + 15: maxEffectiveBalance, + }, + }, + }, + { Args: args{ Name: "success more than max fully withdrawals", @@ -1011,65 +1044,97 @@ func TestProcessWithdrawals(t *testing.T) { } } - prepareValidators := func(st *ethpb.BeaconStateCapella, arguments args) (state.BeaconState, error) { + prepareValidators := func(st state.BeaconState, arguments args) error { validators := make([]*ethpb.Validator, numValidators) - st.Balances = make([]uint64, numValidators) + if err := st.SetBalances(make([]uint64, numValidators)); err != nil { + return err + } for i := range validators { v := ðpb.Validator{} v.EffectiveBalance = maxEffectiveBalance v.WithdrawableEpoch = epochInFuture v.WithdrawalCredentials = make([]byte, 32) v.WithdrawalCredentials[31] = byte(i) - st.Balances[i] = v.EffectiveBalance - uint64(rand.Intn(1000)) + if err := st.UpdateBalancesAtIndex(primitives.ValidatorIndex(i), v.EffectiveBalance-uint64(rand.Intn(1000))); err != nil { + return err + } validators[i] = v } for _, idx := range arguments.FullWithdrawalIndices { if idx != notWithdrawableIndex { validators[idx].WithdrawableEpoch = epochInPast } - st.Balances[idx] = withdrawalAmount(idx) + if err := st.UpdateBalancesAtIndex(idx, withdrawalAmount(idx)); err != nil { + return err + } validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte } for _, idx := range arguments.PendingPartialWithdrawalIndices { validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte - st.Balances[idx] = withdrawalAmount(idx) + if err := st.UpdateBalancesAtIndex(idx, withdrawalAmount(idx)); err != nil { + return err + } } - st.Validators = validators - return state_native.InitializeFromProtoCapella(st) + return st.SetValidators(validators) } for _, test := range tests { t.Run(test.Args.Name, func(t *testing.T) { - saved := params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep - params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = maxSweep - if test.Args.Withdrawals == nil { - test.Args.Withdrawals = make([]*enginev1.Withdrawal, 0) - } - if test.Args.FullWithdrawalIndices == nil { - test.Args.FullWithdrawalIndices = make([]primitives.ValidatorIndex, 0) - } - if test.Args.PendingPartialWithdrawalIndices == nil { - test.Args.PendingPartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0) - } - slot, err := slots.EpochStart(currentEpoch) - require.NoError(t, err) - spb := ðpb.BeaconStateCapella{ - Slot: slot, - NextWithdrawalValidatorIndex: test.Args.NextWithdrawalValidatorIndex, - NextWithdrawalIndex: test.Args.NextWithdrawalIndex, - } - st, err := prepareValidators(spb, test.Args) - require.NoError(t, err) - p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: test.Args.Withdrawals}) - require.NoError(t, err) - post, err := blocks.ProcessWithdrawals(st, p) - if test.Control.ExpectedError { - require.NotNil(t, err) - } else { - require.NoError(t, err) - checkPostState(t, test.Control, post) + for _, fork := range []int{version.Capella, version.Electra} { + t.Run(version.String(fork), func(t *testing.T) { + saved := params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep + params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = maxSweep + if test.Args.Withdrawals == nil { + test.Args.Withdrawals = make([]*enginev1.Withdrawal, 0) + } + if test.Args.FullWithdrawalIndices == nil { + test.Args.FullWithdrawalIndices = make([]primitives.ValidatorIndex, 0) + } + if test.Args.PendingPartialWithdrawalIndices == nil { + test.Args.PendingPartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0) + } + slot, err := slots.EpochStart(currentEpoch) + require.NoError(t, err) + var st state.BeaconState + var p interfaces.ExecutionData + switch fork { + case version.Capella: + spb := ðpb.BeaconStateCapella{ + Slot: slot, + NextWithdrawalValidatorIndex: test.Args.NextWithdrawalValidatorIndex, + NextWithdrawalIndex: test.Args.NextWithdrawalIndex, + } + st, err = state_native.InitializeFromProtoUnsafeCapella(spb) + require.NoError(t, err) + p, err = consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: test.Args.Withdrawals}) + require.NoError(t, err) + case version.Electra: + spb := ðpb.BeaconStateElectra{ + Slot: slot, + NextWithdrawalValidatorIndex: test.Args.NextWithdrawalValidatorIndex, + NextWithdrawalIndex: test.Args.NextWithdrawalIndex, + PendingPartialWithdrawals: test.Args.PendingPartialWithdrawals, + } + st, err = state_native.InitializeFromProtoUnsafeElectra(spb) + require.NoError(t, err) + p, err = consensusblocks.WrappedExecutionPayloadElectra(&enginev1.ExecutionPayloadElectra{Withdrawals: test.Args.Withdrawals}) + require.NoError(t, err) + default: + t.Fatalf("Add a beacon state setup for version %s", version.String(fork)) + } + err = prepareValidators(st, test.Args) + require.NoError(t, err) + post, err := blocks.ProcessWithdrawals(st, p) + if test.Control.ExpectedError { + require.NotNil(t, err) + } else { + require.NoError(t, err) + checkPostState(t, test.Control, post) + } + params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = saved + + }) } - params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep = saved }) } } diff --git a/beacon-chain/core/electra/withdrawals.go b/beacon-chain/core/electra/withdrawals.go index c1f2bd5fdce0..13ccbc08f204 100644 --- a/beacon-chain/core/electra/withdrawals.go +++ b/beacon-chain/core/electra/withdrawals.go @@ -26,66 +26,67 @@ import ( // // def process_withdrawal_request( // -// state: BeaconState, -// withdrawal_request: WithdrawalRequest +// state: BeaconState, +// withdrawal_request: WithdrawalRequest // -// ) -> None: -// amount = execution_layer_withdrawal_request.amount -// is_full_exit_request = amount == FULL_EXIT_REQUEST_AMOUNT +// ) -> None: // -// # If partial withdrawal queue is full, only full exits are processed -// if len(state.pending_partial_withdrawals) == PENDING_PARTIAL_WITHDRAWALS_LIMIT and not is_full_exit_request: -// return +// amount = withdrawal_request.amount +// is_full_exit_request = amount == FULL_EXIT_REQUEST_AMOUNT // -// validator_pubkeys = [v.pubkey for v in state.validators] -// # Verify pubkey exists -// request_pubkey = execution_layer_withdrawal_request.validator_pubkey -// if request_pubkey not in validator_pubkeys: -// return -// index = ValidatorIndex(validator_pubkeys.index(request_pubkey)) -// validator = state.validators[index] +// # If partial withdrawal queue is full, only full exits are processed +// if len(state.pending_partial_withdrawals) == PENDING_PARTIAL_WITHDRAWALS_LIMIT and not is_full_exit_request: +// return // -// # Verify withdrawal credentials -// has_correct_credential = has_execution_withdrawal_credential(validator) -// is_correct_source_address = ( -// validator.withdrawal_credentials[12:] == execution_layer_withdrawal_request.source_address -// ) -// if not (has_correct_credential and is_correct_source_address): -// return -// # Verify the validator is active -// if not is_active_validator(validator, get_current_epoch(state)): -// return -// # Verify exit has not been initiated -// if validator.exit_epoch != FAR_FUTURE_EPOCH: -// return -// # Verify the validator has been active long enough -// if get_current_epoch(state) < validator.activation_epoch + SHARD_COMMITTEE_PERIOD: -// return +// validator_pubkeys = [v.pubkey for v in state.validators] +// # Verify pubkey exists +// request_pubkey = withdrawal_request.validator_pubkey +// if request_pubkey not in validator_pubkeys: +// return +// index = ValidatorIndex(validator_pubkeys.index(request_pubkey)) +// validator = state.validators[index] // -// pending_balance_to_withdraw = get_pending_balance_to_withdraw(state, index) +// # Verify withdrawal credentials +// has_correct_credential = has_execution_withdrawal_credential(validator) +// is_correct_source_address = ( +// validator.withdrawal_credentials[12:] == withdrawal_request.source_address +// ) +// if not (has_correct_credential and is_correct_source_address): +// return +// # Verify the validator is active +// if not is_active_validator(validator, get_current_epoch(state)): +// return +// # Verify exit has not been initiated +// if validator.exit_epoch != FAR_FUTURE_EPOCH: +// return +// # Verify the validator has been active long enough +// if get_current_epoch(state) < validator.activation_epoch + SHARD_COMMITTEE_PERIOD: +// return // -// if is_full_exit_request: -// # Only exit validator if it has no pending withdrawals in the queue -// if pending_balance_to_withdraw == 0: -// initiate_validator_exit(state, index) -// return +// pending_balance_to_withdraw = get_pending_balance_to_withdraw(state, index) // -// has_sufficient_effective_balance = validator.effective_balance >= MIN_ACTIVATION_BALANCE -// has_excess_balance = state.balances[index] > MIN_ACTIVATION_BALANCE + pending_balance_to_withdraw +// if is_full_exit_request: +// # Only exit validator if it has no pending withdrawals in the queue +// if pending_balance_to_withdraw == 0: +// initiate_validator_exit(state, index) +// return // -// # Only allow partial withdrawals with compounding withdrawal credentials -// if has_compounding_withdrawal_credential(validator) and has_sufficient_effective_balance and has_excess_balance: -// to_withdraw = min( -// state.balances[index] - MIN_ACTIVATION_BALANCE - pending_balance_to_withdraw, -// amount -// ) -// exit_queue_epoch = compute_exit_epoch_and_update_churn(state, to_withdraw) -// withdrawable_epoch = Epoch(exit_queue_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY) -// state.pending_partial_withdrawals.append(PendingPartialWithdrawal( -// index=index, -// amount=to_withdraw, -// withdrawable_epoch=withdrawable_epoch, -// )) +// has_sufficient_effective_balance = validator.effective_balance >= MIN_ACTIVATION_BALANCE +// has_excess_balance = state.balances[index] > MIN_ACTIVATION_BALANCE + pending_balance_to_withdraw +// +// # Only allow partial withdrawals with compounding withdrawal credentials +// if has_compounding_withdrawal_credential(validator) and has_sufficient_effective_balance and has_excess_balance: +// to_withdraw = min( +// state.balances[index] - MIN_ACTIVATION_BALANCE - pending_balance_to_withdraw, +// amount +// ) +// exit_queue_epoch = compute_exit_epoch_and_update_churn(state, to_withdraw) +// withdrawable_epoch = Epoch(exit_queue_epoch + MIN_VALIDATOR_WITHDRAWABILITY_DELAY) +// state.pending_partial_withdrawals.append(PendingPartialWithdrawal( +// index=index, +// amount=to_withdraw, +// withdrawable_epoch=withdrawable_epoch, +// )) func ProcessWithdrawalRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.WithdrawalRequest) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "electra.ProcessWithdrawalRequests") defer span.End() diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index 4e2a79941552..c33980c260f3 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -79,6 +79,7 @@ go_test( "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index d213c136f197..d896fe2de7f5 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -584,13 +584,13 @@ func IsSameWithdrawalCredentials(a, b *ethpb.Validator) bool { // and validator.withdrawable_epoch <= epoch // and balance > 0 // ) -func IsFullyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool { +func IsFullyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch primitives.Epoch, fork int) bool { if val == nil || balance <= 0 { return false } // Electra / EIP-7251 logic - if epoch >= params.BeaconConfig().ElectraForkEpoch { + if fork >= version.Electra { return HasExecutionWithdrawalCredentials(val) && val.WithdrawableEpoch <= epoch } @@ -600,12 +600,12 @@ func IsFullyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch pr // IsPartiallyWithdrawableValidator returns whether the validator is able to perform a // partial withdrawal. This function assumes that the caller has a lock on the state. // This method conditionally calls the fork appropriate implementation based on the epoch argument. -func IsPartiallyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch primitives.Epoch) bool { +func IsPartiallyWithdrawableValidator(val *ethpb.Validator, balance uint64, epoch primitives.Epoch, fork int) bool { if val == nil { return false } - if epoch < params.BeaconConfig().ElectraForkEpoch { + if fork < version.Electra { return isPartiallyWithdrawableValidatorCapella(val, balance, epoch) } diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index c0ab33d395f1..3d10c711db43 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -16,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -970,6 +971,7 @@ func TestIsFullyWithdrawableValidator(t *testing.T) { validator *ethpb.Validator balance uint64 epoch primitives.Epoch + fork int want bool }{ { @@ -1027,13 +1029,14 @@ func TestIsFullyWithdrawableValidator(t *testing.T) { }, balance: params.BeaconConfig().MaxEffectiveBalance, epoch: params.BeaconConfig().ElectraForkEpoch, + fork: version.Electra, want: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - assert.Equal(t, tt.want, helpers.IsFullyWithdrawableValidator(tt.validator, tt.balance, tt.epoch)) + assert.Equal(t, tt.want, helpers.IsFullyWithdrawableValidator(tt.validator, tt.balance, tt.epoch, tt.fork)) }) } } @@ -1044,6 +1047,7 @@ func TestIsPartiallyWithdrawableValidator(t *testing.T) { validator *ethpb.Validator balance uint64 epoch primitives.Epoch + fork int want bool }{ { @@ -1091,6 +1095,7 @@ func TestIsPartiallyWithdrawableValidator(t *testing.T) { }, balance: params.BeaconConfig().MinActivationBalance * 2, epoch: params.BeaconConfig().ElectraForkEpoch, + fork: version.Electra, want: true, }, { @@ -1101,13 +1106,14 @@ func TestIsPartiallyWithdrawableValidator(t *testing.T) { }, balance: params.BeaconConfig().MaxEffectiveBalanceElectra * 2, epoch: params.BeaconConfig().ElectraForkEpoch, + fork: version.Electra, want: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - assert.Equal(t, tt.want, helpers.IsPartiallyWithdrawableValidator(tt.validator, tt.balance, tt.epoch)) + assert.Equal(t, tt.want, helpers.IsPartiallyWithdrawableValidator(tt.validator, tt.balance, tt.epoch, tt.fork)) }) } } diff --git a/beacon-chain/state/state-native/getters_withdrawal.go b/beacon-chain/state/state-native/getters_withdrawal.go index 2950900140ce..116363c772d4 100644 --- a/beacon-chain/state/state-native/getters_withdrawal.go +++ b/beacon-chain/state/state-native/getters_withdrawal.go @@ -154,7 +154,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err if err != nil { return nil, 0, errors.Wrapf(err, "could not retrieve balance at index %d", validatorIndex) } - if helpers.IsFullyWithdrawableValidator(val, balance, epoch) { + if helpers.IsFullyWithdrawableValidator(val, balance, epoch, b.version) { withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, ValidatorIndex: validatorIndex, @@ -162,7 +162,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err Amount: balance, }) withdrawalIndex++ - } else if helpers.IsPartiallyWithdrawableValidator(val, balance, epoch) { + } else if helpers.IsPartiallyWithdrawableValidator(val, balance, epoch, b.version) { withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, ValidatorIndex: validatorIndex, From 498ee635e17bcecf585e975dc4036758f3b91f84 Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 15 Jul 2024 08:23:09 -0700 Subject: [PATCH 192/325] Remove warning eip_7251.proto is unused (#14213) --- proto/prysm/v1alpha1/beacon_block.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index dec981c59adb..7b93a4ae1678 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -19,7 +19,6 @@ import "proto/eth/ext/options.proto"; import "proto/prysm/v1alpha1/attestation.proto"; import "proto/prysm/v1alpha1/withdrawals.proto"; import "proto/engine/v1/execution_engine.proto"; -import "proto/prysm/v1alpha1/eip_7251.proto"; option csharp_namespace = "Ethereum.Eth.v1alpha1"; option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; From e5b25071f9b7b59ae9827c14a2529b72fe66f2e5 Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 15 Jul 2024 12:28:56 -0300 Subject: [PATCH 193/325] Fix effective balance updates in Electra (#14215) --- beacon-chain/core/electra/effective_balance_updates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/core/electra/effective_balance_updates.go b/beacon-chain/core/electra/effective_balance_updates.go index 0458d3550e88..60627d378ad1 100644 --- a/beacon-chain/core/electra/effective_balance_updates.go +++ b/beacon-chain/core/electra/effective_balance_updates.go @@ -56,7 +56,7 @@ func ProcessEffectiveBalanceUpdates(state state.BeaconState) error { if balance+downwardThreshold < val.EffectiveBalance || val.EffectiveBalance+upwardThreshold < balance { effectiveBal := min(balance-balance%effBalanceInc, effectiveBalanceLimit) val.EffectiveBalance = effectiveBal - return false, val, nil + return true, val, nil } return false, val, nil } From 422438f515cddfb69c799c144feef9bfacad7ecc Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 15 Jul 2024 11:22:20 -0500 Subject: [PATCH 194/325] Electra: ProcessConsolidationRequests (#14219) --- beacon-chain/core/electra/transition_no_verify_sig.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beacon-chain/core/electra/transition_no_verify_sig.go b/beacon-chain/core/electra/transition_no_verify_sig.go index 55ed84c2b3e6..79e34c4f9a0e 100644 --- a/beacon-chain/core/electra/transition_no_verify_sig.go +++ b/beacon-chain/core/electra/transition_no_verify_sig.go @@ -2,6 +2,7 @@ package electra import ( "context" + "fmt" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" @@ -93,6 +94,8 @@ func ProcessOperations( return nil, errors.Wrap(err, "could not process deposit receipts") } - // TODO: Process consolidations from execution header. + if err := ProcessConsolidationRequests(ctx, st, exe.ConsolidationRequests()); err != nil { + return nil, fmt.Errorf("could not process consolidation requests: %w", err) + } return st, nil } From d6f86269a4e145fbec66aad153a59866417fee64 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 15 Jul 2024 12:53:34 -0500 Subject: [PATCH 195/325] Electra: process_registry_updates handle exiting validators (#14221) * Handle case where validator is already exited * unit test for a slashed validator --- beacon-chain/core/electra/registry_updates.go | 3 ++- .../core/electra/registry_updates_test.go | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/beacon-chain/core/electra/registry_updates.go b/beacon-chain/core/electra/registry_updates.go index 89824fb84fbe..5a85f41cb1be 100644 --- a/beacon-chain/core/electra/registry_updates.go +++ b/beacon-chain/core/electra/registry_updates.go @@ -2,6 +2,7 @@ package electra import ( "context" + "errors" "fmt" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" @@ -84,7 +85,7 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) error { var err error // exitQueueEpoch and churn arguments are not used in electra. st, _, err = validators.InitiateValidatorExit(ctx, st, idx, 0 /*exitQueueEpoch*/, 0 /*churn*/) - if err != nil { + if err != nil && !errors.Is(err, validators.ErrValidatorAlreadyExited) { return fmt.Errorf("failed to initiate validator exit at index %d: %w", idx, err) } } diff --git a/beacon-chain/core/electra/registry_updates_test.go b/beacon-chain/core/electra/registry_updates_test.go index 44449d66ca89..cec76adc27a1 100644 --- a/beacon-chain/core/electra/registry_updates_test.go +++ b/beacon-chain/core/electra/registry_updates_test.go @@ -101,6 +101,32 @@ func TestProcessRegistryUpdates(t *testing.T) { } }, }, + { + name: "Validators are exiting", + state: func() state.BeaconState { + base := ð.BeaconStateElectra{ + Slot: 5 * params.BeaconConfig().SlotsPerEpoch, + FinalizedCheckpoint: ð.Checkpoint{Epoch: finalizedEpoch, Root: make([]byte, fieldparams.RootLength)}, + } + for i := uint64(0); i < 10; i++ { + base.Validators = append(base.Validators, ð.Validator{ + EffectiveBalance: params.BeaconConfig().EjectionBalance - 1, + ExitEpoch: 10, + WithdrawableEpoch: 20, + }) + } + st, err := state_native.InitializeFromProtoElectra(base) + require.NoError(t, err) + return st + }(), + check: func(t *testing.T, st state.BeaconState) { + // All validators should be exited + for i, val := range st.Validators() { + require.NotEqual(t, params.BeaconConfig().FarFutureEpoch, val.ExitEpoch, "failed to update exit epoch on validator %d", i) + require.NotEqual(t, params.BeaconConfig().FarFutureEpoch, val.WithdrawableEpoch, "failed to update withdrawable epoch on validator %d", i) + } + }, + }, } for _, tt := range tests { From 5a48e002dd3621ea94d148f0347a1fc064669d77 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 15 Jul 2024 14:14:32 -0500 Subject: [PATCH 196/325] Unskip electra spectests (#14220) --- .../spectest/mainnet/electra/fork_transition/transition_test.go | 1 - testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go | 1 - testing/spectest/mainnet/electra/random/random_test.go | 1 - testing/spectest/minimal/electra/finality/finality_test.go | 1 - .../spectest/minimal/electra/fork_transition/transition_test.go | 1 - testing/spectest/minimal/electra/forkchoice/forkchoice_test.go | 1 - testing/spectest/minimal/electra/random/random_test.go | 1 - testing/spectest/minimal/electra/sanity/blocks_test.go | 1 - testing/spectest/shared/electra/fork/upgrade_to_electra.go | 1 - testing/spectest/shared/electra/operations/block_header.go | 1 - testing/spectest/shared/electra/operations/execution_payload.go | 1 - testing/spectest/shared/electra/operations/helpers.go | 1 - testing/spectest/shared/electra/operations/withdrawals.go | 1 - 13 files changed, 13 deletions(-) diff --git a/testing/spectest/mainnet/electra/fork_transition/transition_test.go b/testing/spectest/mainnet/electra/fork_transition/transition_test.go index bfde60ba213e..0c0622b0aaed 100644 --- a/testing/spectest/mainnet/electra/fork_transition/transition_test.go +++ b/testing/spectest/mainnet/electra/fork_transition/transition_test.go @@ -7,6 +7,5 @@ import ( ) func TestMainnet_Electra_Transition(t *testing.T) { - t.Skip("TODO: Electra") fork.RunForkTransitionTest(t, "mainnet") } diff --git a/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go b/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go index e46b5557a8a3..50f73e858f6f 100644 --- a/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go +++ b/testing/spectest/mainnet/electra/forkchoice/forkchoice_test.go @@ -8,6 +8,5 @@ import ( ) func TestMainnet_Electra_Forkchoice(t *testing.T) { - t.Skip("TODO: Electra") forkchoice.Run(t, "mainnet", version.Electra) } diff --git a/testing/spectest/mainnet/electra/random/random_test.go b/testing/spectest/mainnet/electra/random/random_test.go index 02c8c474f083..c7404380a1d7 100644 --- a/testing/spectest/mainnet/electra/random/random_test.go +++ b/testing/spectest/mainnet/electra/random/random_test.go @@ -7,6 +7,5 @@ import ( ) func TestMainnet_Electra_Random(t *testing.T) { - t.Skip("TODO: Electra") sanity.RunBlockProcessingTest(t, "mainnet", "random/random/pyspec_tests") } diff --git a/testing/spectest/minimal/electra/finality/finality_test.go b/testing/spectest/minimal/electra/finality/finality_test.go index 05b498488e09..8e53a2f926f3 100644 --- a/testing/spectest/minimal/electra/finality/finality_test.go +++ b/testing/spectest/minimal/electra/finality/finality_test.go @@ -7,6 +7,5 @@ import ( ) func TestMinimal_Electra_Finality(t *testing.T) { - t.Skip("TODO: Electra") finality.RunFinalityTest(t, "minimal") } diff --git a/testing/spectest/minimal/electra/fork_transition/transition_test.go b/testing/spectest/minimal/electra/fork_transition/transition_test.go index 547dc4e66e8a..2cb5dfc39091 100644 --- a/testing/spectest/minimal/electra/fork_transition/transition_test.go +++ b/testing/spectest/minimal/electra/fork_transition/transition_test.go @@ -7,6 +7,5 @@ import ( ) func TestMinimal_Electra_Transition(t *testing.T) { - t.Skip("TODO: Electra") fork.RunForkTransitionTest(t, "minimal") } diff --git a/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go b/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go index aa04917b5ae6..19c0acd78ad4 100644 --- a/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go +++ b/testing/spectest/minimal/electra/forkchoice/forkchoice_test.go @@ -8,6 +8,5 @@ import ( ) func TestMinimal_Electra_Forkchoice(t *testing.T) { - t.Skip("TODO: Electra") forkchoice.Run(t, "minimal", version.Electra) } diff --git a/testing/spectest/minimal/electra/random/random_test.go b/testing/spectest/minimal/electra/random/random_test.go index d454d894bcd0..8ac53e297f2d 100644 --- a/testing/spectest/minimal/electra/random/random_test.go +++ b/testing/spectest/minimal/electra/random/random_test.go @@ -7,6 +7,5 @@ import ( ) func TestMinimal_Electra_Random(t *testing.T) { - t.Skip("TODO: Electra") sanity.RunBlockProcessingTest(t, "minimal", "random/random/pyspec_tests") } diff --git a/testing/spectest/minimal/electra/sanity/blocks_test.go b/testing/spectest/minimal/electra/sanity/blocks_test.go index a6a7b8188764..5d2e27fcd24e 100644 --- a/testing/spectest/minimal/electra/sanity/blocks_test.go +++ b/testing/spectest/minimal/electra/sanity/blocks_test.go @@ -7,6 +7,5 @@ import ( ) func TestMinimal_Electra_Sanity_Blocks(t *testing.T) { - t.Skip("TODO: Electra") sanity.RunBlockProcessingTest(t, "minimal", "sanity/blocks/pyspec_tests") } diff --git a/testing/spectest/shared/electra/fork/upgrade_to_electra.go b/testing/spectest/shared/electra/fork/upgrade_to_electra.go index ad36b2dfe02a..a17b42765c69 100644 --- a/testing/spectest/shared/electra/fork/upgrade_to_electra.go +++ b/testing/spectest/shared/electra/fork/upgrade_to_electra.go @@ -20,7 +20,6 @@ import ( // RunUpgradeToElectra is a helper function that runs Electra's fork spec tests. // It unmarshals a pre- and post-state to check `UpgradeToElectra` comply with spec implementation. func RunUpgradeToElectra(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "fork/fork/pyspec_tests") diff --git a/testing/spectest/shared/electra/operations/block_header.go b/testing/spectest/shared/electra/operations/block_header.go index 55abe1522d0f..f0d141e3dc21 100644 --- a/testing/spectest/shared/electra/operations/block_header.go +++ b/testing/spectest/shared/electra/operations/block_header.go @@ -22,7 +22,6 @@ import ( ) func RunBlockHeaderTest(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/block_header/pyspec_tests") for _, folder := range testFolders { diff --git a/testing/spectest/shared/electra/operations/execution_payload.go b/testing/spectest/shared/electra/operations/execution_payload.go index a2b5604f32d5..dc00fc5173eb 100644 --- a/testing/spectest/shared/electra/operations/execution_payload.go +++ b/testing/spectest/shared/electra/operations/execution_payload.go @@ -23,7 +23,6 @@ import ( ) func RunExecutionPayloadTest(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_payload/pyspec_tests") if len(testFolders) == 0 { diff --git a/testing/spectest/shared/electra/operations/helpers.go b/testing/spectest/shared/electra/operations/helpers.go index ee26ab3a0621..fe42a2c83e6f 100644 --- a/testing/spectest/shared/electra/operations/helpers.go +++ b/testing/spectest/shared/electra/operations/helpers.go @@ -32,7 +32,6 @@ func RunBlockOperationTest( body *ethpb.BeaconBlockBodyElectra, operationFn blockOperation, ) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) require.NoError(t, err) preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) diff --git a/testing/spectest/shared/electra/operations/withdrawals.go b/testing/spectest/shared/electra/operations/withdrawals.go index 778509b94472..5ef4fcd2ee09 100644 --- a/testing/spectest/shared/electra/operations/withdrawals.go +++ b/testing/spectest/shared/electra/operations/withdrawals.go @@ -18,7 +18,6 @@ import ( ) func RunWithdrawalsTest(t *testing.T, config string) { - t.Skip("Failing until spectests are updated to v1.5.0-alpha.3") require.NoError(t, utils.SetConfig(t, config)) testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawals/pyspec_tests") for _, folder := range testFolders { From 05784a6c28d479dfaa209f2e27aba66a00369d4f Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 15 Jul 2024 15:47:31 -0500 Subject: [PATCH 197/325] Electra: Add minimal spectests for sync_committee_updates (#14224) --- .../electra/epoch_processing/BUILD.bazel | 1 + .../sync_committee_updates_test.go | 11 +++++++ .../electra/epoch_processing/BUILD.bazel | 1 + .../sync_committee_updates.go | 30 +++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 testing/spectest/minimal/electra/epoch_processing/sync_committee_updates_test.go create mode 100644 testing/spectest/shared/electra/epoch_processing/sync_committee_updates.go diff --git a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel index 66efa96a1037..2e85ef9c939c 100644 --- a/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/minimal/electra/epoch_processing/BUILD.bazel @@ -16,6 +16,7 @@ go_test( "rewards_and_penalties_test.go", "slashings_reset_test.go", "slashings_test.go", + "sync_committee_updates_test.go", ], data = glob(["*.yaml"]) + [ "@consensus_spec_tests_minimal//:test_data", diff --git a/testing/spectest/minimal/electra/epoch_processing/sync_committee_updates_test.go b/testing/spectest/minimal/electra/epoch_processing/sync_committee_updates_test.go new file mode 100644 index 000000000000..91bfb6a8c9c9 --- /dev/null +++ b/testing/spectest/minimal/electra/epoch_processing/sync_committee_updates_test.go @@ -0,0 +1,11 @@ +package epoch_processing + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing" +) + +func TestMinimal_Electra_EpochProcessing_SyncCommitteeUpdates(t *testing.T) { + epoch_processing.RunSyncCommitteeUpdatesTests(t, "minimal") +} diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index f9b321866e33..b82d6a6ba643 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "rewards_and_penalties.go", "slashings.go", "slashings_reset.go", + "sync_committee_updates.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/epoch_processing", visibility = ["//visibility:public"], diff --git a/testing/spectest/shared/electra/epoch_processing/sync_committee_updates.go b/testing/spectest/shared/electra/epoch_processing/sync_committee_updates.go new file mode 100644 index 000000000000..7c4f18143266 --- /dev/null +++ b/testing/spectest/shared/electra/epoch_processing/sync_committee_updates.go @@ -0,0 +1,30 @@ +package epoch_processing + +import ( + "context" + "path" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" +) + +func RunSyncCommitteeUpdatesTests(t *testing.T, config string) { + require.NoError(t, utils.SetConfig(t, config)) + + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "epoch_processing/sync_committee_updates/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + folderPath := path.Join(testsFolderPath, folder.Name()) + RunEpochOperationTest(t, folderPath, processSyncCommitteeUpdates) + }) + } +} + +func processSyncCommitteeUpdates(t *testing.T, st state.BeaconState) (state.BeaconState, error) { + return electra.ProcessSyncCommitteeUpdates(context.Background(), st) +} From fadff022a07f69ae970fbb9aaca04aa355360365 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:38:15 -0500 Subject: [PATCH 198/325] Payload attributes misleading value fix (#14209) * draft solution to corrected suggested fee recipient * removing electra from this PR * gaz * adding test for endpoint * gaz --- beacon-chain/rpc/endpoints.go | 9 ++-- beacon-chain/rpc/eth/events/BUILD.bazel | 3 ++ beacon-chain/rpc/eth/events/events.go | 12 +++-- beacon-chain/rpc/eth/events/events_test.go | 52 ++++++++++++++++++---- beacon-chain/rpc/eth/events/server.go | 10 +++-- 5 files changed, 66 insertions(+), 20 deletions(-) diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 8c5f6a9fae0b..f603f75e45d4 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -904,10 +904,11 @@ func (s *Service) debugEndpoints(stater lookup.Stater) []endpoint { func (s *Service) eventsEndpoints() []endpoint { server := &events.Server{ - StateNotifier: s.cfg.StateNotifier, - OperationNotifier: s.cfg.OperationNotifier, - HeadFetcher: s.cfg.HeadFetcher, - ChainInfoFetcher: s.cfg.ChainInfoFetcher, + StateNotifier: s.cfg.StateNotifier, + OperationNotifier: s.cfg.OperationNotifier, + HeadFetcher: s.cfg.HeadFetcher, + ChainInfoFetcher: s.cfg.ChainInfoFetcher, + TrackedValidatorsCache: s.cfg.TrackedValidatorsCache, } const namespace = "events" diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index 419848a71cb2..37d627b50820 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -12,6 +12,7 @@ go_library( "//api:go_default_library", "//api/server/structs:go_default_library", "//beacon-chain/blockchain:go_default_library", + "//beacon-chain/cache:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/state:go_default_library", @@ -37,6 +38,7 @@ go_test( embed = [":go_default_library"], deps = [ "//beacon-chain/blockchain/testing:go_default_library", + "//beacon-chain/cache:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/state:go_default_library", @@ -50,5 +52,6 @@ go_test( "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "@com_github_ethereum_go_ethereum//common:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 205f29a46901..c4782f8c14b3 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -439,14 +439,18 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite if err != nil { return write(w, flusher, "Could not get head state proposer index: "+err.Error()) } - + feeRecipient := params.BeaconConfig().DefaultFeeRecipient.Bytes() + tValidator, exists := s.TrackedValidatorsCache.Validator(proposerIndex) + if exists { + feeRecipient = tValidator.FeeRecipient[:] + } var attributes interface{} switch headState.Version() { case version.Bellatrix: attributes = &structs.PayloadAttributesV1{ Timestamp: fmt.Sprintf("%d", t.Unix()), PrevRandao: hexutil.Encode(prevRando), - SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()), + SuggestedFeeRecipient: hexutil.Encode(feeRecipient), } case version.Capella: withdrawals, _, err := headState.ExpectedWithdrawals() @@ -456,7 +460,7 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite attributes = &structs.PayloadAttributesV2{ Timestamp: fmt.Sprintf("%d", t.Unix()), PrevRandao: hexutil.Encode(prevRando), - SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()), + SuggestedFeeRecipient: hexutil.Encode(feeRecipient), Withdrawals: structs.WithdrawalsFromConsensus(withdrawals), } case version.Deneb, version.Electra: @@ -471,7 +475,7 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite attributes = &structs.PayloadAttributesV3{ Timestamp: fmt.Sprintf("%d", t.Unix()), PrevRandao: hexutil.Encode(prevRando), - SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()), + SuggestedFeeRecipient: hexutil.Encode(feeRecipient), Withdrawals: structs.WithdrawalsFromConsensus(withdrawals), ParentBeaconBlockRoot: hexutil.Encode(parentRoot[:]), } diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index 9f9f6590fc09..d44ca7e04938 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -10,7 +10,9 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" @@ -280,10 +282,11 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { }) t.Run("payload attributes", func(t *testing.T) { type testCase struct { - name string - getState func() state.BeaconState - getBlock func() interfaces.SignedBeaconBlock - expected string + name string + getState func() state.BeaconState + getBlock func() interfaces.SignedBeaconBlock + expected string + SetTrackedValidatorsCache func(*cache.TrackedValidatorsCache) } testCases := []testCase{ { @@ -328,6 +331,27 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { }, expected: payloadAttributesDenebResult, }, + { + name: "electra", + getState: func() state.BeaconState { + st, err := util.NewBeaconStateElectra() + require.NoError(t, err) + return st + }, + getBlock: func() interfaces.SignedBeaconBlock { + b, err := blocks.NewSignedBeaconBlock(util.HydrateSignedBeaconBlockElectra(ð.SignedBeaconBlockElectra{})) + require.NoError(t, err) + return b + }, + expected: payloadAttributesElectraResultWithTVC, + SetTrackedValidatorsCache: func(c *cache.TrackedValidatorsCache) { + c.Set(cache.TrackedValidator{ + Active: true, + Index: 0, + FeeRecipient: primitives.ExecutionAddress(common.HexToAddress("0xd2DBd02e4efe087d7d195de828b9Dd25f19A89C9").Bytes()), + }) + }, + }, } for _, tc := range testCases { st := tc.getState() @@ -343,11 +367,16 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { Block: b, Slot: ¤tSlot, } + s := &Server{ - StateNotifier: &mockChain.MockStateNotifier{}, - OperationNotifier: &mockChain.MockOperationNotifier{}, - HeadFetcher: mockChainService, - ChainInfoFetcher: mockChainService, + StateNotifier: &mockChain.MockStateNotifier{}, + OperationNotifier: &mockChain.MockOperationNotifier{}, + HeadFetcher: mockChainService, + ChainInfoFetcher: mockChainService, + TrackedValidatorsCache: cache.NewTrackedValidatorsCache(), + } + if tc.SetTrackedValidatorsCache != nil { + tc.SetTrackedValidatorsCache(s.TrackedValidatorsCache) } request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/events?topics=%s", PayloadAttributesTopic), nil) @@ -439,3 +468,10 @@ event: payload_attributes data: {"version":"deneb","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0x0000000000000000000000000000000000000000","withdrawals":[],"parent_beacon_block_root":"0xbef96cb938fd48b2403d3e662664325abb0102ed12737cbb80d717520e50cf4a"}}} ` + +const payloadAttributesElectraResultWithTVC = `: + +event: payload_attributes +data: {"version":"electra","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0xd2dbd02e4efe087d7d195de828b9dd25f19a89c9","withdrawals":[],"parent_beacon_block_root":"0x66d641f7eae038f2dd28081b09d2ba279462cc47655c7b7e1fd1159a50c8eb32"}}} + +` diff --git a/beacon-chain/rpc/eth/events/server.go b/beacon-chain/rpc/eth/events/server.go index 653bab5137e4..58cd671e9c4b 100644 --- a/beacon-chain/rpc/eth/events/server.go +++ b/beacon-chain/rpc/eth/events/server.go @@ -5,6 +5,7 @@ package events import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" ) @@ -12,8 +13,9 @@ import ( // Server defines a server implementation of the gRPC events service, // providing RPC endpoints to subscribe to events from the beacon node. type Server struct { - StateNotifier statefeed.Notifier - OperationNotifier opfeed.Notifier - HeadFetcher blockchain.HeadFetcher - ChainInfoFetcher blockchain.ChainInfoFetcher + StateNotifier statefeed.Notifier + OperationNotifier opfeed.Notifier + HeadFetcher blockchain.HeadFetcher + ChainInfoFetcher blockchain.ChainInfoFetcher + TrackedValidatorsCache *cache.TrackedValidatorsCache } From 637cbc88e80af24d6d7df449cfc657475ba7929b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 16 Jul 2024 21:33:40 +0200 Subject: [PATCH 199/325] Add missing pieces of Electra (#14227) * Add missing pieces of Electra * update mock --- beacon-chain/blockchain/execution_engine.go | 2 +- .../blockchain/execution_engine_test.go | 88 ++++++++++++------- beacon-chain/db/kv/encoding.go | 4 +- beacon-chain/rpc/core/validator.go | 11 ++- .../prysm/v1alpha1/validator/attester_test.go | 68 ++++++++++++++ .../db/filesystem/attester_protection.go | 14 +-- validator/db/iface/interface.go | 4 +- validator/db/kv/attester_protection.go | 40 ++++----- validator/helpers/metadata_test.go | 4 +- 9 files changed, 165 insertions(+), 70 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index f6e287f4c525..db911b31ab4e 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -323,7 +323,7 @@ func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, var attr payloadattribute.Attributer switch st.Version() { - case version.Deneb: + case version.Deneb, version.Electra: withdrawals, _, err := st.ExpectedWithdrawals() if err != nil { log.WithError(err).Error("Could not get expected withdrawals to get payload attribute") diff --git a/beacon-chain/blockchain/execution_engine_test.go b/beacon-chain/blockchain/execution_engine_test.go index aee047ca0f1d..be5d700d52ea 100644 --- a/beacon-chain/blockchain/execution_engine_test.go +++ b/beacon-chain/blockchain/execution_engine_test.go @@ -855,41 +855,63 @@ func Test_GetPayloadAttributeV2(t *testing.T) { require.Equal(t, 0, len(a)) } -func Test_GetPayloadAttributeDeneb(t *testing.T) { - service, tr := minimalTestService(t, WithPayloadIDCache(cache.NewPayloadIDCache())) - ctx := tr.ctx - - st, _ := util.DeterministicGenesisStateDeneb(t, 1) - attr := service.getPayloadAttribute(ctx, st, 0, []byte{}) - require.Equal(t, true, attr.IsEmpty()) - - // Cache hit, advance state, no fee recipient - slot := primitives.Slot(1) - service.cfg.TrackedValidatorsCache.Set(cache.TrackedValidator{Active: true, Index: 0}) - service.cfg.PayloadIDCache.Set(slot, [32]byte{}, [8]byte{}) - attr = service.getPayloadAttribute(ctx, st, slot, params.BeaconConfig().ZeroHash[:]) - require.Equal(t, false, attr.IsEmpty()) - require.Equal(t, params.BeaconConfig().EthBurnAddressHex, common.BytesToAddress(attr.SuggestedFeeRecipient()).String()) - a, err := attr.Withdrawals() - require.NoError(t, err) - require.Equal(t, 0, len(a)) - - // Cache hit, advance state, has fee recipient - suggestedAddr := common.HexToAddress("123") - service.cfg.TrackedValidatorsCache.Set(cache.TrackedValidator{Active: true, FeeRecipient: primitives.ExecutionAddress(suggestedAddr), Index: 0}) - service.cfg.PayloadIDCache.Set(slot, [32]byte{}, [8]byte{}) - attr = service.getPayloadAttribute(ctx, st, slot, params.BeaconConfig().ZeroHash[:]) - require.Equal(t, false, attr.IsEmpty()) - require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) - a, err = attr.Withdrawals() - require.NoError(t, err) - require.Equal(t, 0, len(a)) +func Test_GetPayloadAttributeV3(t *testing.T) { + var testCases = []struct { + name string + st bstate.BeaconState + }{ + { + name: "deneb", + st: func() bstate.BeaconState { + st, _ := util.DeterministicGenesisStateDeneb(t, 1) + return st + }(), + }, + { + name: "electra", + st: func() bstate.BeaconState { + st, _ := util.DeterministicGenesisStateElectra(t, 1) + return st + }(), + }, + } - attrV3, err := attr.PbV3() - require.NoError(t, err) - hr := service.headRoot() - require.Equal(t, hr, [32]byte(attrV3.ParentBeaconBlockRoot)) + for _, test := range testCases { + t.Run(test.name, func(t *testing.T) { + service, tr := minimalTestService(t, WithPayloadIDCache(cache.NewPayloadIDCache())) + ctx := tr.ctx + + attr := service.getPayloadAttribute(ctx, test.st, 0, []byte{}) + require.Equal(t, true, attr.IsEmpty()) + + // Cache hit, advance state, no fee recipient + slot := primitives.Slot(1) + service.cfg.TrackedValidatorsCache.Set(cache.TrackedValidator{Active: true, Index: 0}) + service.cfg.PayloadIDCache.Set(slot, [32]byte{}, [8]byte{}) + attr = service.getPayloadAttribute(ctx, test.st, slot, params.BeaconConfig().ZeroHash[:]) + require.Equal(t, false, attr.IsEmpty()) + require.Equal(t, params.BeaconConfig().EthBurnAddressHex, common.BytesToAddress(attr.SuggestedFeeRecipient()).String()) + a, err := attr.Withdrawals() + require.NoError(t, err) + require.Equal(t, 0, len(a)) + + // Cache hit, advance state, has fee recipient + suggestedAddr := common.HexToAddress("123") + service.cfg.TrackedValidatorsCache.Set(cache.TrackedValidator{Active: true, FeeRecipient: primitives.ExecutionAddress(suggestedAddr), Index: 0}) + service.cfg.PayloadIDCache.Set(slot, [32]byte{}, [8]byte{}) + attr = service.getPayloadAttribute(ctx, test.st, slot, params.BeaconConfig().ZeroHash[:]) + require.Equal(t, false, attr.IsEmpty()) + require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) + a, err = attr.Withdrawals() + require.NoError(t, err) + require.Equal(t, 0, len(a)) + attrV3, err := attr.PbV3() + require.NoError(t, err) + hr := service.headRoot() + require.Equal(t, hr, [32]byte(attrV3.ParentBeaconBlockRoot)) + }) + } } func Test_UpdateLastValidatedCheckpoint(t *testing.T) { diff --git a/beacon-chain/db/kv/encoding.go b/beacon-chain/db/kv/encoding.go index 1a2e01fc2b77..8af8efa035d3 100644 --- a/beacon-chain/db/kv/encoding.go +++ b/beacon-chain/db/kv/encoding.go @@ -68,11 +68,11 @@ func isSSZStorageFormat(obj interface{}) bool { return true case *ethpb.BeaconBlock: return true - case *ethpb.Attestation: + case *ethpb.Attestation, *ethpb.AttestationElectra: return true case *ethpb.Deposit: return true - case *ethpb.AttesterSlashing: + case *ethpb.AttesterSlashing, *ethpb.AttesterSlashingElectra: return true case *ethpb.ProposerSlashing: return true diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 4ab23e317594..44c534f83776 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -368,13 +368,18 @@ func (s *Service) GetAttestationData( return nil, &RpcError{Reason: BadRequest, Err: errors.Errorf("invalid request: %v", err)} } + committeeIndex := primitives.CommitteeIndex(0) + if slots.ToEpoch(req.Slot) < params.BeaconConfig().ElectraForkEpoch { + committeeIndex = req.CommitteeIndex + } + s.AttestationCache.RLock() res := s.AttestationCache.Get() if res != nil && res.Slot == req.Slot { s.AttestationCache.RUnlock() return ðpb.AttestationData{ Slot: res.Slot, - CommitteeIndex: req.CommitteeIndex, + CommitteeIndex: committeeIndex, BeaconBlockRoot: res.HeadRoot, Source: ðpb.Checkpoint{ Epoch: res.Source.Epoch, @@ -398,7 +403,7 @@ func (s *Service) GetAttestationData( if res != nil && res.Slot == req.Slot { return ðpb.AttestationData{ Slot: res.Slot, - CommitteeIndex: req.CommitteeIndex, + CommitteeIndex: committeeIndex, BeaconBlockRoot: res.HeadRoot, Source: ðpb.Checkpoint{ Epoch: res.Source.Epoch, @@ -458,7 +463,7 @@ func (s *Service) GetAttestationData( return ðpb.AttestationData{ Slot: req.Slot, - CommitteeIndex: req.CommitteeIndex, + CommitteeIndex: committeeIndex, BeaconBlockRoot: headRoot, Source: ðpb.Checkpoint{ Epoch: justifiedCheckpoint.Epoch, diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go index 7b6e87c53451..6fe5e884d4f9 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go @@ -475,6 +475,74 @@ func TestGetAttestationData_SucceedsInFirstEpoch(t *testing.T) { } } +func TestGetAttestationData_CommitteeIndexIsZeroPostElectra(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = 0 + params.OverrideBeaconConfig(cfg) + + block := util.NewBeaconBlock() + block.Block.Slot = 3*params.BeaconConfig().SlotsPerEpoch + 1 + targetBlock := util.NewBeaconBlock() + targetBlock.Block.Slot = params.BeaconConfig().SlotsPerEpoch + targetRoot, err := targetBlock.Block.HashTreeRoot() + require.NoError(t, err) + + justifiedBlock := util.NewBeaconBlock() + justifiedBlock.Block.Slot = 2 * params.BeaconConfig().SlotsPerEpoch + blockRoot, err := block.Block.HashTreeRoot() + require.NoError(t, err) + justifiedRoot, err := justifiedBlock.Block.HashTreeRoot() + require.NoError(t, err) + slot := 3*params.BeaconConfig().SlotsPerEpoch + 1 + beaconState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, beaconState.SetSlot(slot)) + justifiedCheckpoint := ðpb.Checkpoint{ + Epoch: 2, + Root: justifiedRoot[:], + } + require.NoError(t, beaconState.SetCurrentJustifiedCheckpoint(justifiedCheckpoint)) + offset := int64(slot.Mul(params.BeaconConfig().SecondsPerSlot)) + attesterServer := &Server{ + SyncChecker: &mockSync.Sync{IsSyncing: false}, + OptimisticModeFetcher: &mock.ChainService{Optimistic: false}, + TimeFetcher: &mock.ChainService{Genesis: time.Now().Add(time.Duration(-1*offset) * time.Second)}, + CoreService: &core.Service{ + HeadFetcher: &mock.ChainService{TargetRoot: targetRoot, Root: blockRoot[:], State: beaconState}, + GenesisTimeFetcher: &mock.ChainService{ + Genesis: time.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{CurrentJustifiedCheckPoint: justifiedCheckpoint}, + AttestationCache: cache.NewAttestationCache(), + OptimisticModeFetcher: &mock.ChainService{Optimistic: false}, + }, + } + + req := ðpb.AttestationDataRequest{ + CommitteeIndex: 123, // set non-zero committee index + Slot: 3*params.BeaconConfig().SlotsPerEpoch + 1, + } + res, err := attesterServer.GetAttestationData(context.Background(), req) + require.NoError(t, err) + + expected := ðpb.AttestationData{ + Slot: 3*params.BeaconConfig().SlotsPerEpoch + 1, + CommitteeIndex: 0, + BeaconBlockRoot: blockRoot[:], + Source: ðpb.Checkpoint{ + Epoch: 2, + Root: justifiedRoot[:], + }, + Target: ðpb.Checkpoint{ + Epoch: 3, + Root: targetRoot[:], + }, + } + + assert.DeepEqual(t, expected, res) +} + func TestServer_SubscribeCommitteeSubnets_NoSlots(t *testing.T) { attesterServer := &Server{ HeadFetcher: &mock.ChainService{}, diff --git a/validator/db/filesystem/attester_protection.go b/validator/db/filesystem/attester_protection.go index d6e9e1cea47c..996538e0137d 100644 --- a/validator/db/filesystem/attester_protection.go +++ b/validator/db/filesystem/attester_protection.go @@ -99,7 +99,7 @@ func (s *Store) AttestedPublicKeys(_ context.Context) ([][fieldparams.BLSPubkeyL // If it is not, it updates the database. func (s *Store) SlashableAttestationCheck( ctx context.Context, - indexedAtt *ethpb.IndexedAttestation, + indexedAtt ethpb.IndexedAtt, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot32 [32]byte, _ bool, @@ -128,10 +128,10 @@ func (s *Store) SaveAttestationForPubKey( _ context.Context, pubkey [fieldparams.BLSPubkeyLength]byte, _ [32]byte, - att *ethpb.IndexedAttestation, + att ethpb.IndexedAtt, ) error { // If there is no attestation, return on error. - if att == nil || att.Data == nil || att.Data.Source == nil || att.Data.Target == nil { + if att == nil || att.GetData() == nil || att.GetData().Source == nil || att.GetData().Target == nil { return errors.New("incoming attestation does not contain source and/or target epoch") } @@ -141,8 +141,8 @@ func (s *Store) SaveAttestationForPubKey( return errors.Wrap(err, "could not get validator slashing protection") } - incomingSourceEpochUInt64 := uint64(att.Data.Source.Epoch) - incomingTargetEpochUInt64 := uint64(att.Data.Target.Epoch) + incomingSourceEpochUInt64 := uint64(att.GetData().Source.Epoch) + incomingTargetEpochUInt64 := uint64(att.GetData().Target.Epoch) if validatorSlashingProtection == nil { // If there is no validator slashing protection, create one. @@ -167,7 +167,7 @@ func (s *Store) SaveAttestationForPubKey( if incomingSourceEpochUInt64 < savedSourceEpoch { return errors.Errorf( "could not sign attestation with source lower than recorded source epoch, %d < %d", - att.Data.Source.Epoch, + att.GetData().Source.Epoch, validatorSlashingProtection.LastSignedAttestationSourceEpoch, ) } @@ -177,7 +177,7 @@ func (s *Store) SaveAttestationForPubKey( if savedTargetEpoch != nil && incomingTargetEpochUInt64 <= *savedTargetEpoch { return errors.Errorf( "could not sign attestation with target lower than or equal to recorded target epoch, %d <= %d", - att.Data.Target.Epoch, + att.GetData().Target.Epoch, *savedTargetEpoch, ) } diff --git a/validator/db/iface/interface.go b/validator/db/iface/interface.go index 25391e645d6f..7c68eb166a8d 100644 --- a/validator/db/iface/interface.go +++ b/validator/db/iface/interface.go @@ -55,13 +55,13 @@ type ValidatorDB interface { LowestSignedSourceEpoch(ctx context.Context, publicKey [fieldparams.BLSPubkeyLength]byte) (primitives.Epoch, bool, error) AttestedPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) SlashableAttestationCheck( - ctx context.Context, indexedAtt *ethpb.IndexedAttestation, pubKey [fieldparams.BLSPubkeyLength]byte, + ctx context.Context, indexedAtt ethpb.IndexedAtt, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot32 [32]byte, emitAccountMetrics bool, validatorAttestFailVec *prometheus.CounterVec, ) error SaveAttestationForPubKey( - ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot [fieldparams.RootLength]byte, att *ethpb.IndexedAttestation, + ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot [fieldparams.RootLength]byte, att ethpb.IndexedAtt, ) error SaveAttestationsForPubKey( ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoots [][]byte, atts []*ethpb.IndexedAttestation, diff --git a/validator/db/kv/attester_protection.go b/validator/db/kv/attester_protection.go index 4e29af3fbf72..5187b2f30f74 100644 --- a/validator/db/kv/attester_protection.go +++ b/validator/db/kv/attester_protection.go @@ -139,7 +139,7 @@ func (s *Store) AttestationHistoryForPubKey(ctx context.Context, pubKey [fieldpa // If it is not, it updates the database. func (s *Store) SlashableAttestationCheck( ctx context.Context, - indexedAtt *ethpb.IndexedAttestation, + indexedAtt ethpb.IndexedAtt, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot32 [32]byte, emitAccountMetrics bool, @@ -156,14 +156,14 @@ func (s *Store) SlashableAttestationCheck( if err != nil { return err } - if exists && indexedAtt.Data.Source.Epoch < lowestSourceEpoch { + if exists && indexedAtt.GetData().Source.Epoch < lowestSourceEpoch { return fmt.Errorf( "could not sign attestation lower than lowest source epoch in db, %d < %d", - indexedAtt.Data.Source.Epoch, + indexedAtt.GetData().Source.Epoch, lowestSourceEpoch, ) } - existingSigningRoot, err := s.SigningRootAtTargetEpoch(ctx, pubKey, indexedAtt.Data.Target.Epoch) + existingSigningRoot, err := s.SigningRootAtTargetEpoch(ctx, pubKey, indexedAtt.GetData().Target.Epoch) if err != nil { return err } @@ -176,10 +176,10 @@ func (s *Store) SlashableAttestationCheck( if err != nil { return err } - if signingRootsDiffer && exists && indexedAtt.Data.Target.Epoch <= lowestTargetEpoch { + if signingRootsDiffer && exists && indexedAtt.GetData().Target.Epoch <= lowestTargetEpoch { return fmt.Errorf( "could not sign attestation lower than or equal to lowest target epoch in db if signing roots differ, %d <= %d", - indexedAtt.Data.Target.Epoch, + indexedAtt.GetData().Target.Epoch, lowestTargetEpoch, ) } @@ -210,7 +210,7 @@ func (s *Store) SlashableAttestationCheck( // CheckSlashableAttestation verifies an incoming attestation is // not a double vote for a validator public key nor a surround vote. func (s *Store) CheckSlashableAttestation( - ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot []byte, att *ethpb.IndexedAttestation, + ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot []byte, att ethpb.IndexedAtt, ) (SlashingKind, error) { ctx, span := trace.StartSpan(ctx, "Validator.CheckSlashableAttestation") defer span.End() @@ -228,14 +228,14 @@ func (s *Store) CheckSlashableAttestation( // First we check for double votes. signingRootsBucket := pkBucket.Bucket(attestationSigningRootsBucket) if signingRootsBucket != nil { - targetEpochBytes := bytesutil.EpochToBytesBigEndian(att.Data.Target.Epoch) + targetEpochBytes := bytesutil.EpochToBytesBigEndian(att.GetData().Target.Epoch) existingSigningRoot := signingRootsBucket.Get(targetEpochBytes) // If a signing root exists in the database, and if this database signing root is empty => We consider the new attestation as a double vote. // If a signing root exists in the database, and if this database signing differs from the signing root of the new attestation => We consider the new attestation as a double vote. if existingSigningRoot != nil && (len(existingSigningRoot) == 0 || slashings.SigningRootsDiffer(existingSigningRoot, signingRoot)) { slashKind = DoubleVote - return fmt.Errorf(doubleVoteMessage, att.Data.Target.Epoch, existingSigningRoot) + return fmt.Errorf(doubleVoteMessage, att.GetData().Target.Epoch, existingSigningRoot) } } @@ -269,12 +269,12 @@ func (s *Store) CheckSlashableAttestation( // Iterate from the back of the bucket since we are looking for target_epoch > att.target_epoch func (*Store) checkSurroundedVote( - targetEpochsBucket *bolt.Bucket, att *ethpb.IndexedAttestation, + targetEpochsBucket *bolt.Bucket, att ethpb.IndexedAtt, ) (SlashingKind, error) { c := targetEpochsBucket.Cursor() for k, v := c.Last(); k != nil; k, v = c.Prev() { existingTargetEpoch := bytesutil.BytesToEpochBigEndian(k) - if existingTargetEpoch <= att.Data.Target.Epoch { + if existingTargetEpoch <= att.GetData().Target.Epoch { break } @@ -296,8 +296,8 @@ func (*Store) checkSurroundedVote( if surrounded { return SurroundedVote, fmt.Errorf( surroundedVoteMessage, - att.Data.Source.Epoch, - att.Data.Target.Epoch, + att.GetData().Source.Epoch, + att.GetData().Target.Epoch, existingSourceEpoch, existingTargetEpoch, ) @@ -309,12 +309,12 @@ func (*Store) checkSurroundedVote( // Iterate from the back of the bucket since we are looking for source_epoch > att.source_epoch func (*Store) checkSurroundingVote( - sourceEpochsBucket *bolt.Bucket, att *ethpb.IndexedAttestation, + sourceEpochsBucket *bolt.Bucket, att ethpb.IndexedAtt, ) (SlashingKind, error) { c := sourceEpochsBucket.Cursor() for k, v := c.Last(); k != nil; k, v = c.Prev() { existingSourceEpoch := bytesutil.BytesToEpochBigEndian(k) - if existingSourceEpoch <= att.Data.Source.Epoch { + if existingSourceEpoch <= att.GetData().Source.Epoch { break } @@ -336,8 +336,8 @@ func (*Store) checkSurroundingVote( if surrounding { return SurroundingVote, fmt.Errorf( surroundingVoteMessage, - att.Data.Source.Epoch, - att.Data.Target.Epoch, + att.GetData().Source.Epoch, + att.GetData().Target.Epoch, existingSourceEpoch, existingTargetEpoch, ) @@ -375,7 +375,7 @@ func (s *Store) SaveAttestationsForPubKey( // SaveAttestationForPubKey saves an attestation for a validator public // key for local validator slashing protection. func (s *Store) SaveAttestationForPubKey( - ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot [fieldparams.RootLength]byte, att *ethpb.IndexedAttestation, + ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot [fieldparams.RootLength]byte, att ethpb.IndexedAtt, ) error { ctx, span := trace.StartSpan(ctx, "Validator.SaveAttestationForPubKey") defer span.End() @@ -383,8 +383,8 @@ func (s *Store) SaveAttestationForPubKey( ctx: ctx, record: &common.AttestationRecord{ PubKey: pubKey, - Source: att.Data.Source.Epoch, - Target: att.Data.Target.Epoch, + Source: att.GetData().Source.Epoch, + Target: att.GetData().Target.Epoch, SigningRoot: signingRoot[:], }, } diff --git a/validator/helpers/metadata_test.go b/validator/helpers/metadata_test.go index 0df70229c697..90c6cd455c9b 100644 --- a/validator/helpers/metadata_test.go +++ b/validator/helpers/metadata_test.go @@ -105,7 +105,7 @@ func (db *ValidatorDBMock) AttestedPublicKeys(ctx context.Context) ([][fieldpara } func (db *ValidatorDBMock) SlashableAttestationCheck( - ctx context.Context, indexedAtt *ethpb.IndexedAttestation, pubKey [fieldparams.BLSPubkeyLength]byte, + ctx context.Context, indexedAtt ethpb.IndexedAtt, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot32 [32]byte, emitAccountMetrics bool, validatorAttestFailVec *prometheus.CounterVec, @@ -114,7 +114,7 @@ func (db *ValidatorDBMock) SlashableAttestationCheck( } func (db *ValidatorDBMock) SaveAttestationForPubKey( - ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot [fieldparams.RootLength]byte, att *ethpb.IndexedAttestation, + ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, signingRoot [fieldparams.RootLength]byte, att ethpb.IndexedAtt, ) error { panic("not implemented") } From 2f76ba542f961a5aea0f507d564daefca7a156f6 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 17 Jul 2024 08:24:15 -0500 Subject: [PATCH 200/325] adding consolidation requests to json serialization (#14229) * adding consolidation requests to json serialization * fixing test * missed file checkin * fixing unit tests --- beacon-chain/execution/engine_client.go | 43 ++--- beacon-chain/execution/engine_client_test.go | 57 ++++--- beacon-chain/execution/payload_body_test.go | 1 + proto/engine/v1/json_marshal_unmarshal.go | 151 +++++++++++++----- .../engine/v1/json_marshal_unmarshal_test.go | 21 ++- testing/util/electra.go | 7 + 6 files changed, 196 insertions(+), 84 deletions(-) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 17a4c74c17d3..6d604065d70d 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -612,27 +612,32 @@ func fullPayloadFromPayloadBody( if err != nil { return nil, err } + cr, err := pb.JsonConsolidationRequestsToProto(body.ConsolidationRequests) + if err != nil { + return nil, err + } return blocks.WrappedExecutionPayloadElectra( &pb.ExecutionPayloadElectra{ - ParentHash: header.ParentHash(), - FeeRecipient: header.FeeRecipient(), - StateRoot: header.StateRoot(), - ReceiptsRoot: header.ReceiptsRoot(), - LogsBloom: header.LogsBloom(), - PrevRandao: header.PrevRandao(), - BlockNumber: header.BlockNumber(), - GasLimit: header.GasLimit(), - GasUsed: header.GasUsed(), - Timestamp: header.Timestamp(), - ExtraData: header.ExtraData(), - BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: header.BlockHash(), - Transactions: pb.RecastHexutilByteSlice(body.Transactions), - Withdrawals: body.Withdrawals, - ExcessBlobGas: ebg, - BlobGasUsed: bgu, - DepositRequests: dr, - WithdrawalRequests: wr, + ParentHash: header.ParentHash(), + FeeRecipient: header.FeeRecipient(), + StateRoot: header.StateRoot(), + ReceiptsRoot: header.ReceiptsRoot(), + LogsBloom: header.LogsBloom(), + PrevRandao: header.PrevRandao(), + BlockNumber: header.BlockNumber(), + GasLimit: header.GasLimit(), + GasUsed: header.GasUsed(), + Timestamp: header.Timestamp(), + ExtraData: header.ExtraData(), + BaseFeePerGas: header.BaseFeePerGas(), + BlockHash: header.BlockHash(), + Transactions: pb.RecastHexutilByteSlice(body.Transactions), + Withdrawals: body.Withdrawals, + ExcessBlobGas: ebg, + BlobGasUsed: bgu, + DepositRequests: dr, + WithdrawalRequests: wr, + ConsolidationRequests: cr, }) // We can't get the block value and don't care about the block value for this instance default: return nil, fmt.Errorf("unknown execution block version for payload %d", bVersion) diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index 246085a932e3..2977249c0a7b 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -1533,6 +1533,20 @@ func fixturesStruct() *payloadFixtures { Index: &idx, } } + consolidationRequests := make([]pb.ConsolidationRequestV1, 1) + for i := range consolidationRequests { + address := &common.Address{} + address.SetBytes([]byte{0, 0, byte(i)}) + sPubkey := pb.BlsPubkey{} + copy(sPubkey[:], []byte{0, byte(i)}) + tPubkey := pb.BlsPubkey{} + copy(tPubkey[:], []byte{0, byte(i)}) + consolidationRequests[i] = pb.ConsolidationRequestV1{ + SourceAddress: address, + SourcePubkey: &sPubkey, + TargetPubkey: &tPubkey, + } + } dr, err := pb.JsonDepositRequestsToProto(depositRequests) if err != nil { panic(err) @@ -1541,26 +1555,31 @@ func fixturesStruct() *payloadFixtures { if err != nil { panic(err) } + cr, err := pb.JsonConsolidationRequestsToProto(consolidationRequests) + if err != nil { + panic(err) + } executionPayloadFixtureElectra := &pb.ExecutionPayloadElectra{ - ParentHash: foo[:], - FeeRecipient: bar, - StateRoot: foo[:], - ReceiptsRoot: foo[:], - LogsBloom: baz, - PrevRandao: foo[:], - BlockNumber: 1, - GasLimit: 1, - GasUsed: 1, - Timestamp: 1, - ExtraData: foo[:], - BaseFeePerGas: bytesutil.PadTo(baseFeePerGas.Bytes(), fieldparams.RootLength), - BlockHash: foo[:], - Transactions: [][]byte{foo[:]}, - Withdrawals: []*pb.Withdrawal{}, - BlobGasUsed: 2, - ExcessBlobGas: 3, - DepositRequests: dr, - WithdrawalRequests: wr, + ParentHash: foo[:], + FeeRecipient: bar, + StateRoot: foo[:], + ReceiptsRoot: foo[:], + LogsBloom: baz, + PrevRandao: foo[:], + BlockNumber: 1, + GasLimit: 1, + GasUsed: 1, + Timestamp: 1, + ExtraData: foo[:], + BaseFeePerGas: bytesutil.PadTo(baseFeePerGas.Bytes(), fieldparams.RootLength), + BlockHash: foo[:], + Transactions: [][]byte{foo[:]}, + Withdrawals: []*pb.Withdrawal{}, + BlobGasUsed: 2, + ExcessBlobGas: 3, + DepositRequests: dr, + WithdrawalRequests: wr, + ConsolidationRequests: cr, } hexUint := hexutil.Uint64(1) executionPayloadWithValueFixtureCapella := &pb.GetPayloadV2ResponseJson{ diff --git a/beacon-chain/execution/payload_body_test.go b/beacon-chain/execution/payload_body_test.go index f94192dec00f..ab447502c054 100644 --- a/beacon-chain/execution/payload_body_test.go +++ b/beacon-chain/execution/payload_body_test.go @@ -68,6 +68,7 @@ func payloadToBody(t *testing.T, ed interfaces.ExecutionData) *pb.ExecutionPaylo if isElectra { body.DepositRequests = pb.ProtoDepositRequestsToJson(eed.DepositRequests()) body.WithdrawalRequests = pb.ProtoWithdrawalRequestsToJson(eed.WithdrawalRequests()) + body.ConsolidationRequests = pb.ProtoConsolidationRequestsToJson(eed.ConsolidationRequests()) } return body } diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index 61466a7d7ca5..8e489154f4d6 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -306,33 +306,35 @@ type GetPayloadV4ResponseJson struct { // ExecutionPayloadElectraJSON represents the engine API ExecutionPayloadV4 type. type ExecutionPayloadElectraJSON struct { - ParentHash *common.Hash `json:"parentHash"` - FeeRecipient *common.Address `json:"feeRecipient"` - StateRoot *common.Hash `json:"stateRoot"` - ReceiptsRoot *common.Hash `json:"receiptsRoot"` - LogsBloom *hexutil.Bytes `json:"logsBloom"` - PrevRandao *common.Hash `json:"prevRandao"` - BlockNumber *hexutil.Uint64 `json:"blockNumber"` - GasLimit *hexutil.Uint64 `json:"gasLimit"` - GasUsed *hexutil.Uint64 `json:"gasUsed"` - Timestamp *hexutil.Uint64 `json:"timestamp"` - ExtraData hexutil.Bytes `json:"extraData"` - BaseFeePerGas string `json:"baseFeePerGas"` - BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` - ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` - BlockHash *common.Hash `json:"blockHash"` - Transactions []hexutil.Bytes `json:"transactions"` - Withdrawals []*Withdrawal `json:"withdrawals"` - WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` - DepositRequests []DepositRequestV1 `json:"depositRequests"` + ParentHash *common.Hash `json:"parentHash"` + FeeRecipient *common.Address `json:"feeRecipient"` + StateRoot *common.Hash `json:"stateRoot"` + ReceiptsRoot *common.Hash `json:"receiptsRoot"` + LogsBloom *hexutil.Bytes `json:"logsBloom"` + PrevRandao *common.Hash `json:"prevRandao"` + BlockNumber *hexutil.Uint64 `json:"blockNumber"` + GasLimit *hexutil.Uint64 `json:"gasLimit"` + GasUsed *hexutil.Uint64 `json:"gasUsed"` + Timestamp *hexutil.Uint64 `json:"timestamp"` + ExtraData hexutil.Bytes `json:"extraData"` + BaseFeePerGas string `json:"baseFeePerGas"` + BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` + ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` + BlockHash *common.Hash `json:"blockHash"` + Transactions []hexutil.Bytes `json:"transactions"` + Withdrawals []*Withdrawal `json:"withdrawals"` + WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` + DepositRequests []DepositRequestV1 `json:"depositRequests"` + ConsolidationRequests []ConsolidationRequestV1 `json:"consolidationRequests"` } // ExecutionPayloadBody represents the engine API ExecutionPayloadV1 or ExecutionPayloadV2 type. type ExecutionPayloadBody struct { - Transactions []hexutil.Bytes `json:"transactions"` - Withdrawals []*Withdrawal `json:"withdrawals"` - WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` - DepositRequests []DepositRequestV1 `json:"depositRequests"` + Transactions []hexutil.Bytes `json:"transactions"` + Withdrawals []*Withdrawal `json:"withdrawals"` + WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` + DepositRequests []DepositRequestV1 `json:"depositRequests"` + ConsolidationRequests []ConsolidationRequestV1 `json:"consolidationRequests"` } // Validate returns an error if key fields in GetPayloadV4ResponseJson are nil or invalid. @@ -468,6 +470,30 @@ func (r DepositRequestV1) Validate() error { return nil } +// ConsolidationRequestV1 represents an execution engine ConsolidationRequestV1 value +// https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#consolidationrequestv1 +type ConsolidationRequestV1 struct { + // sourceAddress: DATA, 20 Bytes + SourceAddress *common.Address `json:"sourceAddress"` + // sourcePubkey: DATA, 48 Bytes + SourcePubkey *BlsPubkey `json:"sourcePubkey"` + // targetPubkey: DATA, 48 Bytes + TargetPubkey *BlsPubkey `json:"targetPubkey"` +} + +func (r ConsolidationRequestV1) Validate() error { + if r.SourceAddress == nil { + return errors.Wrap(errJsonNilField, "missing required field 'sourceAddress' for ConsolidationRequestV1") + } + if r.SourcePubkey == nil { + return errors.Wrap(errJsonNilField, "missing required field 'sourcePubkey' for ConsolidationRequestV1") + } + if r.TargetPubkey == nil { + return errors.Wrap(errJsonNilField, "missing required field 'targetPubkey' for ConsolidationRequestV1") + } + return nil +} + // MarshalJSON -- func (e *ExecutionPayload) MarshalJSON() ([]byte, error) { transactions := make([]hexutil.Bytes, len(e.Transactions)) @@ -1065,6 +1091,42 @@ func ProtoWithdrawalRequestsToJson(reqs []*WithdrawalRequest) []WithdrawalReques return j } +func JsonConsolidationRequestsToProto(j []ConsolidationRequestV1) ([]*ConsolidationRequest, error) { + reqs := make([]*ConsolidationRequest, len(j)) + + for i := range j { + req := j[i] + if err := req.Validate(); err != nil { + return nil, err + } + reqs[i] = &ConsolidationRequest{ + SourceAddress: req.SourceAddress.Bytes(), + SourcePubkey: req.SourcePubkey.Bytes(), + TargetPubkey: req.TargetPubkey.Bytes(), + } + } + + return reqs, nil +} + +func ProtoConsolidationRequestsToJson(reqs []*ConsolidationRequest) []ConsolidationRequestV1 { + j := make([]ConsolidationRequestV1, len(reqs)) + for i := range reqs { + r := reqs[i] + spk := BlsPubkey{} + copy(spk[:], r.SourcePubkey) + tpk := BlsPubkey{} + copy(tpk[:], r.TargetPubkey) + address := common.BytesToAddress(r.SourceAddress) + j[i] = ConsolidationRequestV1{ + SourceAddress: &address, + SourcePubkey: &spk, + TargetPubkey: &tpk, + } + } + return j +} + func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra, error) { baseFeeBigEnd, err := hexutil.DecodeBig(j.BaseFeePerGas) if err != nil { @@ -1087,26 +1149,31 @@ func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra if err != nil { return nil, err } + cr, err := JsonConsolidationRequestsToProto(j.ConsolidationRequests) + if err != nil { + return nil, err + } return &ExecutionPayloadElectra{ - ParentHash: j.ParentHash.Bytes(), - FeeRecipient: j.FeeRecipient.Bytes(), - StateRoot: j.StateRoot.Bytes(), - ReceiptsRoot: j.ReceiptsRoot.Bytes(), - LogsBloom: *j.LogsBloom, - PrevRandao: j.PrevRandao.Bytes(), - BlockNumber: uint64(*j.BlockNumber), - GasLimit: uint64(*j.GasLimit), - GasUsed: uint64(*j.GasUsed), - Timestamp: uint64(*j.Timestamp), - ExtraData: j.ExtraData, - BaseFeePerGas: baseFee, - BlockHash: j.BlockHash.Bytes(), - Transactions: transactions, - Withdrawals: j.Withdrawals, - BlobGasUsed: uint64(*j.BlobGasUsed), - ExcessBlobGas: uint64(*j.ExcessBlobGas), - DepositRequests: dr, - WithdrawalRequests: wr, + ParentHash: j.ParentHash.Bytes(), + FeeRecipient: j.FeeRecipient.Bytes(), + StateRoot: j.StateRoot.Bytes(), + ReceiptsRoot: j.ReceiptsRoot.Bytes(), + LogsBloom: *j.LogsBloom, + PrevRandao: j.PrevRandao.Bytes(), + BlockNumber: uint64(*j.BlockNumber), + GasLimit: uint64(*j.GasLimit), + GasUsed: uint64(*j.GasUsed), + Timestamp: uint64(*j.Timestamp), + ExtraData: j.ExtraData, + BaseFeePerGas: baseFee, + BlockHash: j.BlockHash.Bytes(), + Transactions: transactions, + Withdrawals: j.Withdrawals, + BlobGasUsed: uint64(*j.BlobGasUsed), + ExcessBlobGas: uint64(*j.ExcessBlobGas), + DepositRequests: dr, + WithdrawalRequests: wr, + ConsolidationRequests: cr, }, nil } diff --git a/proto/engine/v1/json_marshal_unmarshal_test.go b/proto/engine/v1/json_marshal_unmarshal_test.go index f7aaf66d2161..bc1d8dab6fd6 100644 --- a/proto/engine/v1/json_marshal_unmarshal_test.go +++ b/proto/engine/v1/json_marshal_unmarshal_test.go @@ -330,6 +330,14 @@ func TestJsonMarshalUnmarshal(t *testing.T) { }, } + consolidationReq := []*enginev1.ConsolidationRequest{ + { + SourceAddress: bytesutil.PadTo([]byte("sourceAddress-1"), 20), + SourcePubkey: bytesutil.PadTo([]byte("s-pubKey-1"), 48), + TargetPubkey: bytesutil.PadTo([]byte("t-pubKey-1"), 48), + }, + } + resp := &enginev1.GetPayloadV4ResponseJson{ BlobsBundle: &enginev1.BlobBundleJSON{ Commitments: []hexutil.Bytes{{'a'}, {'b'}, {'c'}, {'d'}}, @@ -358,10 +366,11 @@ func TestJsonMarshalUnmarshal(t *testing.T) { Address: bytesutil.PadTo([]byte("address"), 20), Amount: 1, }}, - BlobGasUsed: &bgu, - ExcessBlobGas: &ebg, - WithdrawalRequests: enginev1.ProtoWithdrawalRequestsToJson(withdrawalReq), - DepositRequests: enginev1.ProtoDepositRequestsToJson(depositReq), + BlobGasUsed: &bgu, + ExcessBlobGas: &ebg, + WithdrawalRequests: enginev1.ProtoWithdrawalRequestsToJson(withdrawalReq), + DepositRequests: enginev1.ProtoDepositRequestsToJson(depositReq), + ConsolidationRequests: enginev1.ProtoConsolidationRequestsToJson(consolidationReq), }, } enc, err := json.Marshal(resp) @@ -414,6 +423,10 @@ func TestJsonMarshalUnmarshal(t *testing.T) { for i := range pb.Payload.DepositRequests { require.DeepEqual(t, pb.Payload.DepositRequests[i], depositReq[i]) } + require.Equal(t, len(pb.Payload.ConsolidationRequests), len(consolidationReq)) + for i := range pb.Payload.ConsolidationRequests { + require.DeepEqual(t, pb.Payload.ConsolidationRequests[i], consolidationReq[i]) + } }) t.Run("execution block", func(t *testing.T) { baseFeePerGas := big.NewInt(1770307273) diff --git a/testing/util/electra.go b/testing/util/electra.go index 59889a0e1215..dc009427bac1 100644 --- a/testing/util/electra.go +++ b/testing/util/electra.go @@ -116,6 +116,13 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri ExcessBlobGas: 0, DepositRequests: generateTestDepositRequests(uint64(g.slot), 4), WithdrawalRequests: generateTestWithdrawalRequests(uint64(g.slot), 4), + ConsolidationRequests: []*enginev1.ConsolidationRequest{ + { + SourceAddress: make([]byte, 20), + SourcePubkey: make([]byte, 48), + TargetPubkey: make([]byte, 48), + }, + }, } } From 8b4b3a269b92c77946dda1d3576df91699d04acf Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Wed, 17 Jul 2024 15:52:36 -0500 Subject: [PATCH 201/325] Fix typo (#14233) --- beacon-chain/execution/engine_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 6d604065d70d..7875fa6c2d77 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -170,7 +170,7 @@ func (s *Service) NewPayload(ctx context.Context, payload interfaces.ExecutionDa case *pb.ExecutionPayloadElectra: payloadPb, ok := payload.Proto().(*pb.ExecutionPayloadElectra) if !ok { - return nil, errors.New("execution data must be a Deneb execution payload") + return nil, errors.New("execution data must be a Electra execution payload") } err := s.rpcClient.CallContext(ctx, result, NewPayloadMethodV4, payloadPb, versionedHashes, parentBlockRoot) if err != nil { From c7e2d709cf04649f13ccc57dd855d64a6ece6097 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:25:54 -0500 Subject: [PATCH 202/325] electra payload fix for devnet1 (#14235) * fixing marshalling and adding more to unit test * updating missed consolidation requests * renaming variables * adding test gen * reverting config change --- beacon-chain/execution/engine_client_test.go | 48 ++++++++++------- proto/engine/v1/json_marshal_unmarshal.go | 39 +++++++------- proto/prysm/v1alpha1/cloners.go | 55 +++++++++++++------- proto/prysm/v1alpha1/cloners_test.go | 55 +++++++++++++------- 4 files changed, 122 insertions(+), 75 deletions(-) diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index 2977249c0a7b..2e3e29b1defb 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -374,6 +374,17 @@ func TestClient_HTTP(t *testing.T) { require.DeepEqual(t, proofs, resp.BlobsBundle.Proofs) blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} require.DeepEqual(t, blobs, resp.BlobsBundle.Blobs) + ede, ok := resp.ExecutionData.(interfaces.ExecutionDataElectra) + require.Equal(t, true, ok) + require.NotNil(t, ede.WithdrawalRequests()) + wrequestsNotOverMax := len(ede.WithdrawalRequests()) <= int(params.BeaconConfig().MaxWithdrawalRequestsPerPayload) + require.Equal(t, true, wrequestsNotOverMax) + require.NotNil(t, ede.DepositRequests()) + drequestsNotOverMax := len(ede.DepositRequests()) <= int(params.BeaconConfig().MaxDepositRequestsPerPayload) + require.Equal(t, true, drequestsNotOverMax) + require.NotNil(t, ede.ConsolidationRequests()) + consolidationsNotOverMax := len(ede.ConsolidationRequests()) <= int(params.BeaconConfig().MaxConsolidationsRequestsPerPayload) + require.Equal(t, true, consolidationsNotOverMax) }) t.Run(ForkchoiceUpdatedMethod+" VALID status", func(t *testing.T) { forkChoiceState := &pb.ForkchoiceState{ @@ -1633,24 +1644,25 @@ func fixturesStruct() *payloadFixtures { executionPayloadWithValueFixtureElectra := &pb.GetPayloadV4ResponseJson{ ShouldOverrideBuilder: true, ExecutionPayload: &pb.ExecutionPayloadElectraJSON{ - ParentHash: &common.Hash{'a'}, - FeeRecipient: &common.Address{'b'}, - StateRoot: &common.Hash{'c'}, - ReceiptsRoot: &common.Hash{'d'}, - LogsBloom: &hexutil.Bytes{'e'}, - PrevRandao: &common.Hash{'f'}, - BaseFeePerGas: "0x123", - BlockHash: &common.Hash{'g'}, - Transactions: []hexutil.Bytes{{'h'}}, - Withdrawals: []*pb.Withdrawal{}, - BlockNumber: &hexUint, - GasLimit: &hexUint, - GasUsed: &hexUint, - Timestamp: &hexUint, - BlobGasUsed: &bgu, - ExcessBlobGas: &ebg, - DepositRequests: depositRequests, - WithdrawalRequests: withdrawalRequests, + ParentHash: &common.Hash{'a'}, + FeeRecipient: &common.Address{'b'}, + StateRoot: &common.Hash{'c'}, + ReceiptsRoot: &common.Hash{'d'}, + LogsBloom: &hexutil.Bytes{'e'}, + PrevRandao: &common.Hash{'f'}, + BaseFeePerGas: "0x123", + BlockHash: &common.Hash{'g'}, + Transactions: []hexutil.Bytes{{'h'}}, + Withdrawals: []*pb.Withdrawal{}, + BlockNumber: &hexUint, + GasLimit: &hexUint, + GasUsed: &hexUint, + Timestamp: &hexUint, + BlobGasUsed: &bgu, + ExcessBlobGas: &ebg, + DepositRequests: depositRequests, + WithdrawalRequests: withdrawalRequests, + ConsolidationRequests: consolidationRequests, }, BlockValue: "0x11fffffffff", BlobsBundle: &pb.BlobBundleJSON{ diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index 8e489154f4d6..3a7de3a5efe4 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -992,25 +992,26 @@ func (e *ExecutionPayloadElectra) MarshalJSON() ([]byte, error) { excessBlobGas := hexutil.Uint64(e.ExcessBlobGas) return json.Marshal(ExecutionPayloadElectraJSON{ - ParentHash: &pHash, - FeeRecipient: &recipient, - StateRoot: &sRoot, - ReceiptsRoot: &recRoot, - LogsBloom: &logsBloom, - PrevRandao: &prevRan, - BlockNumber: &blockNum, - GasLimit: &gasLimit, - GasUsed: &gasUsed, - Timestamp: &timeStamp, - ExtraData: e.ExtraData, - BaseFeePerGas: baseFeeHex, - BlockHash: &bHash, - Transactions: transactions, - Withdrawals: withdrawals, - BlobGasUsed: &blobGasUsed, - ExcessBlobGas: &excessBlobGas, - WithdrawalRequests: ProtoWithdrawalRequestsToJson(e.WithdrawalRequests), - DepositRequests: ProtoDepositRequestsToJson(e.DepositRequests), + ParentHash: &pHash, + FeeRecipient: &recipient, + StateRoot: &sRoot, + ReceiptsRoot: &recRoot, + LogsBloom: &logsBloom, + PrevRandao: &prevRan, + BlockNumber: &blockNum, + GasLimit: &gasLimit, + GasUsed: &gasUsed, + Timestamp: &timeStamp, + ExtraData: e.ExtraData, + BaseFeePerGas: baseFeeHex, + BlockHash: &bHash, + Transactions: transactions, + Withdrawals: withdrawals, + BlobGasUsed: &blobGasUsed, + ExcessBlobGas: &excessBlobGas, + WithdrawalRequests: ProtoWithdrawalRequestsToJson(e.WithdrawalRequests), + DepositRequests: ProtoDepositRequestsToJson(e.DepositRequests), + ConsolidationRequests: ProtoConsolidationRequestsToJson(e.ConsolidationRequests), }) } diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index 8e51844d7127..1727c0ab0af0 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -1002,25 +1002,26 @@ func CopyExecutionPayloadElectra(payload *enginev1.ExecutionPayloadElectra) *eng return nil } return &enginev1.ExecutionPayloadElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - DepositRequests: CopyDepositRequests(payload.DepositRequests), - WithdrawalRequests: CopyWithdrawalRequests(payload.WithdrawalRequests), + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), + Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + DepositRequests: CopyDepositRequests(payload.DepositRequests), + WithdrawalRequests: CopyWithdrawalRequests(payload.WithdrawalRequests), + ConsolidationRequests: CopyConsolidationRequests(payload.ConsolidationRequests), } } @@ -1058,6 +1059,22 @@ func CopyWithdrawalRequests(wr []*enginev1.WithdrawalRequest) []*enginev1.Withdr return newWr } +func CopyConsolidationRequests(cr []*enginev1.ConsolidationRequest) []*enginev1.ConsolidationRequest { + if cr == nil { + return nil + } + newCr := make([]*enginev1.ConsolidationRequest, len(cr)) + for i, w := range cr { + newCr[i] = &enginev1.ConsolidationRequest{ + SourceAddress: bytesutil.SafeCopyBytes(w.SourceAddress), + SourcePubkey: bytesutil.SafeCopyBytes(w.SourcePubkey), + TargetPubkey: bytesutil.SafeCopyBytes(w.TargetPubkey), + } + } + + return newCr +} + func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderElectra) *enginev1.ExecutionPayloadHeaderElectra { if payload == nil { return nil diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index e408599cf50d..5383970c9dec 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -1465,25 +1465,26 @@ func genBeaconBlockBodyElectra() *v1alpha1.BeaconBlockBodyElectra { func genExecutionPayloadElectra() *enginev1.ExecutionPayloadElectra { return &enginev1.ExecutionPayloadElectra{ - ParentHash: bytes(32), - FeeRecipient: bytes(20), - StateRoot: bytes(32), - ReceiptsRoot: bytes(32), - LogsBloom: bytes(256), - PrevRandao: bytes(32), - BlockNumber: 1, - GasLimit: 2, - GasUsed: 3, - Timestamp: 4, - ExtraData: bytes(32), - BaseFeePerGas: bytes(32), - BlockHash: bytes(32), - Transactions: [][]byte{{'a'}, {'b'}, {'c'}}, - Withdrawals: genWithdrawals(10), - BlobGasUsed: 5, - ExcessBlobGas: 6, - DepositRequests: genDepositRequests(10), - WithdrawalRequests: genWithdrawalRequests(10), + ParentHash: bytes(32), + FeeRecipient: bytes(20), + StateRoot: bytes(32), + ReceiptsRoot: bytes(32), + LogsBloom: bytes(256), + PrevRandao: bytes(32), + BlockNumber: 1, + GasLimit: 2, + GasUsed: 3, + Timestamp: 4, + ExtraData: bytes(32), + BaseFeePerGas: bytes(32), + BlockHash: bytes(32), + Transactions: [][]byte{{'a'}, {'b'}, {'c'}}, + Withdrawals: genWithdrawals(10), + BlobGasUsed: 5, + ExcessBlobGas: 6, + DepositRequests: genDepositRequests(10), + WithdrawalRequests: genWithdrawalRequests(10), + ConsolidationRequests: genConsolidationRequests(10), } } @@ -1521,6 +1522,22 @@ func genWithdrawalRequest() *enginev1.WithdrawalRequest { } } +func genConsolidationRequests(num int) []*enginev1.ConsolidationRequest { + crs := make([]*enginev1.ConsolidationRequest, num) + for i := 0; i < num; i++ { + crs[i] = genConsolidationRequest() + } + return crs +} + +func genConsolidationRequest() *enginev1.ConsolidationRequest { + return &enginev1.ConsolidationRequest{ + SourceAddress: bytes(20), + SourcePubkey: bytes(48), + TargetPubkey: bytes(48), + } +} + func genPendingPartialWithdrawals(num int) []*v1alpha1.PendingPartialWithdrawal { ppws := make([]*v1alpha1.PendingPartialWithdrawal, num) for i := 0; i < num; i++ { From 3a734f51e0ae85eaab08fdf610ac5d80d25113ef Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:40:06 -0500 Subject: [PATCH 203/325] removing unused naming convention (#14241) --- config/params/loader_test.go | 9 ++++----- testing/spectest/exclusions.txt | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 3045bb4a5e78..4f8872b29235 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -35,11 +35,10 @@ var placeholderFields = []string{ "FIELD_ELEMENTS_PER_BLOB", // Compile time constant. "KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", // Compile time constant on BlobSidecar.commitment_inclusion_proof. "MAX_BLOBS_PER_BLOCK", - "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_DEPOSIT_RECEIPTS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.deposit_receipts. TODO: rename when updating spec configs - "MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. - "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. + "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_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. "REORG_HEAD_WEIGHT_THRESHOLD", "SAMPLES_PER_SLOT", "TARGET_NUMBER_OF_PEERS", diff --git a/testing/spectest/exclusions.txt b/testing/spectest/exclusions.txt index 8e12f2dbcbb3..6da3a2125169 100644 --- a/testing/spectest/exclusions.txt +++ b/testing/spectest/exclusions.txt @@ -47,7 +47,6 @@ tests/mainnet/eip6110/operations/attester_slashing tests/mainnet/eip6110/operations/block_header tests/mainnet/eip6110/operations/bls_to_execution_change tests/mainnet/eip6110/operations/deposit -tests/mainnet/eip6110/operations/deposit_receipt tests/mainnet/eip6110/operations/execution_payload tests/mainnet/eip6110/operations/proposer_slashing tests/mainnet/eip6110/operations/sync_aggregate @@ -136,7 +135,6 @@ tests/minimal/eip6110/operations/attester_slashing tests/minimal/eip6110/operations/block_header tests/minimal/eip6110/operations/bls_to_execution_change tests/minimal/eip6110/operations/deposit -tests/minimal/eip6110/operations/deposit_receipt tests/minimal/eip6110/operations/execution_payload tests/minimal/eip6110/operations/proposer_slashing tests/minimal/eip6110/operations/sync_aggregate From 0e8f98b2a4e2313e9ed0e5ca3cf6d2a40fed314a Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 18 Jul 2024 21:29:53 -0700 Subject: [PATCH 204/325] Remove electra todo for process deposit requests (#14243) --- beacon-chain/core/electra/transition_no_verify_sig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/core/electra/transition_no_verify_sig.go b/beacon-chain/core/electra/transition_no_verify_sig.go index 79e34c4f9a0e..12da1a6c6fe5 100644 --- a/beacon-chain/core/electra/transition_no_verify_sig.go +++ b/beacon-chain/core/electra/transition_no_verify_sig.go @@ -89,7 +89,7 @@ func ProcessOperations( return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") } - st, err = ProcessDepositRequests(ctx, st, exe.DepositRequests()) // TODO: EIP-6110 deposit changes. + st, err = ProcessDepositRequests(ctx, st, exe.DepositRequests()) if err != nil { return nil, errors.Wrap(err, "could not process deposit receipts") } From d066480a514908bb62a7d1129b5e185ef73cab70 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:56:13 +0200 Subject: [PATCH 205/325] GetValidatorPerformance empty body bug (#14240) * fix possible empty body panic bug * gaz * fix test --- beacon-chain/rpc/prysm/validator/BUILD.bazel | 1 + .../prysm/validator/validator_performance.go | 23 ++++++++++++------- .../validator/validator_performance_test.go | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/beacon-chain/rpc/prysm/validator/BUILD.bazel b/beacon-chain/rpc/prysm/validator/BUILD.bazel index 1f8767bc55b8..1c0e4f9368cb 100644 --- a/beacon-chain/rpc/prysm/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/validator/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "//beacon-chain/rpc/core:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/validator/validator_performance.go b/beacon-chain/rpc/prysm/validator/validator_performance.go index fbd7547ad273..2af8d00414e1 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance.go @@ -2,8 +2,10 @@ package validator import ( "encoding/json" + "io" "net/http" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/network/httputil" @@ -17,21 +19,26 @@ func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) defer span.End() var req structs.GetValidatorPerformanceRequest - if r.Body != http.NoBody { - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - handleHTTPError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest) - return - } + + err := json.NewDecoder(r.Body).Decode(&req) + switch { + case errors.Is(err, io.EOF): + httputil.HandleError(w, "No data submitted", http.StatusBadRequest) + return + case err != nil: + httputil.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest) + return } - computed, err := s.CoreService.ComputeValidatorPerformance( + + computed, rpcError := s.CoreService.ComputeValidatorPerformance( ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: req.PublicKeys, Indices: req.Indices, }, ) - if err != nil { - handleHTTPError(w, "Could not compute validator performance: "+err.Err.Error(), core.ErrorReasonToHTTP(err.Reason)) + if rpcError != nil { + handleHTTPError(w, "Could not compute validator performance: "+rpcError.Err.Error(), core.ErrorReasonToHTTP(rpcError.Reason)) return } response := &structs.GetValidatorPerformanceResponse{ diff --git a/beacon-chain/rpc/prysm/validator/validator_performance_test.go b/beacon-chain/rpc/prysm/validator/validator_performance_test.go index 98b3aa9390b9..379f5669a9d0 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance_test.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance_test.go @@ -41,7 +41,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) require.NoError(t, err) - require.Equal(t, http.StatusServiceUnavailable, rawResp.StatusCode) + require.Equal(t, http.StatusBadRequest, rawResp.StatusCode) }) t.Run("OK", func(t *testing.T) { helpers.ClearCache() From 57ffc12f1716c6271909dff23f91ccc958f482d1 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:23:36 +0200 Subject: [PATCH 206/325] HTTP endpoint `GetIndividualVotes` (#14198) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add http endpoint * add tests * Gaz * Add pointers * add endpoint to test * Electra: EIP-7251 Update `process_voluntary_exit` (#14176) * Electra: EIP-7251 Update `process_voluntary_exit` * Add unit test for VerifyExitAndSignature EIP-7251 * @potuz peer feedback * Avoid Cloning When Creating a New Gossip Message (#14201) * Add Current Changes * add back check * Avoid a Panic * fix: Multiple network flags should prevent the BN to start (#14169) * Implement Initial Logic * Include check in main.go * Add tests for multiple flags * remove usage of append * remove config/features dependency * Move ValidateNetworkFlags to config/features * Nit * removed NetworkFlags from cmd * remove usage of empty string literal * add comment * add flag validation to prysctl validator-exit --------- Co-authored-by: Manu NALEPA * fix tests * Radek' review + tests * fix tests * Radek' review * forgot one * almost forgot the tests --------- Co-authored-by: Preston Van Loon Co-authored-by: Nishant Das Co-authored-by: kira Co-authored-by: Manu NALEPA Co-authored-by: Radosław Kapka --- api/server/structs/endpoints_beacon.go | 29 + beacon-chain/rpc/core/service.go | 1 + beacon-chain/rpc/core/validator.go | 125 ++++ beacon-chain/rpc/endpoints.go | 20 +- beacon-chain/rpc/endpoints_test.go | 1 + beacon-chain/rpc/prysm/beacon/BUILD.bazel | 17 +- beacon-chain/rpc/prysm/beacon/handlers.go | 85 +++ .../rpc/prysm/beacon/handlers_test.go | 660 ++++++++++++++++++ beacon-chain/rpc/prysm/beacon/server.go | 2 + .../rpc/prysm/v1alpha1/beacon/assignments.go | 2 +- .../prysm/v1alpha1/beacon/committees_test.go | 3 + .../rpc/prysm/v1alpha1/beacon/validators.go | 100 +-- .../prysm/v1alpha1/beacon/validators_test.go | 49 +- 13 files changed, 976 insertions(+), 118 deletions(-) create mode 100644 beacon-chain/rpc/prysm/beacon/handlers_test.go diff --git a/api/server/structs/endpoints_beacon.go b/api/server/structs/endpoints_beacon.go index f7a3116572cf..0ee92bc0d5ab 100644 --- a/api/server/structs/endpoints_beacon.go +++ b/api/server/structs/endpoints_beacon.go @@ -196,3 +196,32 @@ type DepositSnapshot struct { ExecutionBlockHash string `json:"execution_block_hash"` ExecutionBlockHeight string `json:"execution_block_height"` } + +type GetIndividualVotesRequest struct { + Epoch string `json:"epoch"` + PublicKeys []string `json:"public_keys,omitempty"` + Indices []string `json:"indices,omitempty"` +} + +type GetIndividualVotesResponse struct { + IndividualVotes []*IndividualVote `json:"individual_votes"` +} + +type IndividualVote struct { + Epoch string `json:"epoch"` + PublicKey string `json:"public_keys,omitempty"` + ValidatorIndex string `json:"validator_index"` + IsSlashed bool `json:"is_slashed"` + IsWithdrawableInCurrentEpoch bool `json:"is_withdrawable_in_current_epoch"` + IsActiveInCurrentEpoch bool `json:"is_active_in_current_epoch"` + IsActiveInPreviousEpoch bool `json:"is_active_in_previous_epoch"` + IsCurrentEpochAttester bool `json:"is_current_epoch_attester"` + IsCurrentEpochTargetAttester bool `json:"is_current_epoch_target_attester"` + IsPreviousEpochAttester bool `json:"is_previous_epoch_attester"` + IsPreviousEpochTargetAttester bool `json:"is_previous_epoch_target_attester"` + IsPreviousEpochHeadAttester bool `json:"is_previous_epoch_head_attester"` + CurrentEpochEffectiveBalanceGwei string `json:"current_epoch_effective_balance_gwei"` + InclusionSlot string `json:"inclusion_slot"` + InclusionDistance string `json:"inclusion_distance"` + InactivityScore string `json:"inactivity_score"` +} diff --git a/beacon-chain/rpc/core/service.go b/beacon-chain/rpc/core/service.go index ad37804886c9..d407c881f4cd 100644 --- a/beacon-chain/rpc/core/service.go +++ b/beacon-chain/rpc/core/service.go @@ -21,5 +21,6 @@ type Service struct { AttestationCache *cache.AttestationCache StateGen stategen.StateManager P2P p2p.Broadcaster + ReplayerBuilder stategen.ReplayerBuilder OptimisticModeFetcher blockchain.OptimisticModeFetcher } diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 44c534f83776..251e29ca68e1 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -211,6 +211,131 @@ func (s *Service) ComputeValidatorPerformance( }, nil } +// IndividualVotes retrieves individual voting status of validators. +func (s *Service) IndividualVotes( + ctx context.Context, + req *ethpb.IndividualVotesRequest, +) (*ethpb.IndividualVotesRespond, *RpcError) { + currentEpoch := slots.ToEpoch(s.GenesisTimeFetcher.CurrentSlot()) + if req.Epoch > currentEpoch { + return nil, &RpcError{ + Err: fmt.Errorf("cannot retrieve information about an epoch in the future, current epoch %d, requesting %d\n", currentEpoch, req.Epoch), + Reason: BadRequest, + } + } + + slot, err := slots.EpochEnd(req.Epoch) + if err != nil { + return nil, &RpcError{Err: err, Reason: Internal} + } + st, err := s.ReplayerBuilder.ReplayerForSlot(slot).ReplayBlocks(ctx) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "failed to replay blocks for state at epoch %d", req.Epoch), + Reason: Internal, + } + } + // Track filtered validators to prevent duplication in the response. + filtered := map[primitives.ValidatorIndex]bool{} + filteredIndices := make([]primitives.ValidatorIndex, 0) + votes := make([]*ethpb.IndividualVotesRespond_IndividualVote, 0, len(req.Indices)+len(req.PublicKeys)) + // Filter out assignments by public keys. + for _, pubKey := range req.PublicKeys { + index, ok := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) + if !ok { + votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{PublicKey: pubKey, ValidatorIndex: primitives.ValidatorIndex(^uint64(0))}) + continue + } + filtered[index] = true + filteredIndices = append(filteredIndices, index) + } + // Filter out assignments by validator indices. + for _, index := range req.Indices { + if !filtered[index] { + filteredIndices = append(filteredIndices, index) + } + } + sort.Slice(filteredIndices, func(i, j int) bool { + return filteredIndices[i] < filteredIndices[j] + }) + + var v []*precompute.Validator + var bal *precompute.Balance + if st.Version() == version.Phase0 { + v, bal, err = precompute.New(ctx, st) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not set up pre compute instance"), + Reason: Internal, + } + } + v, _, err = precompute.ProcessAttestations(ctx, st, v, bal) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not pre compute attestations"), + Reason: Internal, + } + } + } else if st.Version() >= version.Altair { + v, bal, err = altair.InitializePrecomputeValidators(ctx, st) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not set up altair pre compute instance"), + Reason: Internal, + } + } + v, _, err = altair.ProcessEpochParticipation(ctx, st, bal, v) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not pre compute attestations"), + Reason: Internal, + } + } + } else { + return nil, &RpcError{ + Err: errors.Wrapf(err, "invalid state type retrieved with a version of %d", st.Version()), + Reason: Internal, + } + } + + for _, index := range filteredIndices { + if uint64(index) >= uint64(len(v)) { + votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{ValidatorIndex: index}) + continue + } + val, err := st.ValidatorAtIndexReadOnly(index) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not retrieve validator"), + Reason: Internal, + } + } + pb := val.PublicKey() + votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{ + Epoch: req.Epoch, + PublicKey: pb[:], + ValidatorIndex: index, + IsSlashed: v[index].IsSlashed, + IsWithdrawableInCurrentEpoch: v[index].IsWithdrawableCurrentEpoch, + IsActiveInCurrentEpoch: v[index].IsActiveCurrentEpoch, + IsActiveInPreviousEpoch: v[index].IsActivePrevEpoch, + IsCurrentEpochAttester: v[index].IsCurrentEpochAttester, + IsCurrentEpochTargetAttester: v[index].IsCurrentEpochTargetAttester, + IsPreviousEpochAttester: v[index].IsPrevEpochAttester, + IsPreviousEpochTargetAttester: v[index].IsPrevEpochTargetAttester, + IsPreviousEpochHeadAttester: v[index].IsPrevEpochHeadAttester, + CurrentEpochEffectiveBalanceGwei: v[index].CurrentEpochEffectiveBalance, + InclusionSlot: v[index].InclusionSlot, + InclusionDistance: v[index].InclusionDistance, + InactivityScore: v[index].InactivityScore, + }) + } + + return ðpb.IndividualVotesRespond{ + IndividualVotes: votes, + }, nil +} + // SubmitSignedContributionAndProof is called by a sync committee aggregator // to submit signed contribution and proof object. func (s *Service) SubmitSignedContributionAndProof( diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index f603f75e45d4..c8a15a3b4e09 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -68,7 +68,7 @@ func (s *Service) endpoints( endpoints = append(endpoints, s.configEndpoints()...) endpoints = append(endpoints, s.lightClientEndpoints(blocker, stater)...) endpoints = append(endpoints, s.eventsEndpoints()...) - endpoints = append(endpoints, s.prysmBeaconEndpoints(ch, stater)...) + endpoints = append(endpoints, s.prysmBeaconEndpoints(ch, stater, coreService)...) endpoints = append(endpoints, s.prysmNodeEndpoints()...) endpoints = append(endpoints, s.prysmValidatorEndpoints(coreService)...) if enableDebug { @@ -926,8 +926,11 @@ func (s *Service) eventsEndpoints() []endpoint { } // Prysm custom endpoints - -func (s *Service) prysmBeaconEndpoints(ch *stategen.CanonicalHistory, stater lookup.Stater) []endpoint { +func (s *Service) prysmBeaconEndpoints( + ch *stategen.CanonicalHistory, + stater lookup.Stater, + coreService *core.Service, +) []endpoint { server := &beaconprysm.Server{ SyncChecker: s.cfg.SyncService, HeadFetcher: s.cfg.HeadFetcher, @@ -938,6 +941,7 @@ func (s *Service) prysmBeaconEndpoints(ch *stategen.CanonicalHistory, stater loo Stater: stater, ChainInfoFetcher: s.cfg.ChainInfoFetcher, FinalizationFetcher: s.cfg.FinalizationFetcher, + CoreService: coreService, } const namespace = "prysm.beacon" @@ -969,6 +973,16 @@ func (s *Service) prysmBeaconEndpoints(ch *stategen.CanonicalHistory, stater loo handler: server.GetValidatorCount, methods: []string{http.MethodGet}, }, + { + template: "/prysm/v1/beacon/individual_votes", + name: namespace + ".GetIndividualVotes", + middleware: []mux.MiddlewareFunc{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetIndividualVotes, + methods: []string{http.MethodPost}, + }, } } diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index aa9b0f069f6d..e3d8d753b114 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -44,6 +44,7 @@ func Test_endpoints(t *testing.T) { "/eth/v1/beacon/pool/sync_committees": {http.MethodPost}, "/eth/v1/beacon/pool/voluntary_exits": {http.MethodGet, http.MethodPost}, "/eth/v1/beacon/pool/bls_to_execution_changes": {http.MethodGet, http.MethodPost}, + "/prysm/v1/beacon/individual_votes": {http.MethodPost}, } lightClientRoutes := map[string][]string{ diff --git a/beacon-chain/rpc/prysm/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/beacon/BUILD.bazel index 54c4a6b9223c..0dd081b0a8f8 100644 --- a/beacon-chain/rpc/prysm/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/beacon/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "//beacon-chain/blockchain:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/db:go_default_library", + "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/eth/helpers:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", @@ -29,26 +30,40 @@ go_library( "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], ) go_test( name = "go_default_test", - srcs = ["validator_count_test.go"], + srcs = [ + "handlers_test.go", + "validator_count_test.go", + ], embed = [":go_default_library"], deps = [ "//api/server/structs:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/db/testing:go_default_library", + "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", + "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", + "//beacon-chain/state/stategen:go_default_library", + "//beacon-chain/state/stategen/mock:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", + "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/beacon/handlers.go b/beacon-chain/rpc/prysm/beacon/handlers.go index dc60043c7d6f..eca22946a95f 100644 --- a/beacon-chain/rpc/prysm/beacon/handlers.go +++ b/beacon-chain/rpc/prysm/beacon/handlers.go @@ -1,17 +1,23 @@ package beacon import ( + "encoding/json" "fmt" + "io" "log" "net/http" "strconv" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/network/httputil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -69,3 +75,82 @@ func (s *Server) GetWeakSubjectivity(w http.ResponseWriter, r *http.Request) { } httputil.WriteJson(w, resp) } + +// GetIndividualVotes returns a list of validators individual vote status of a given epoch. +func (s *Server) GetIndividualVotes(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.GetIndividualVotes") + defer span.End() + + var req structs.GetIndividualVotesRequest + err := json.NewDecoder(r.Body).Decode(&req) + switch { + case errors.Is(err, io.EOF): + httputil.HandleError(w, "No data submitted", http.StatusBadRequest) + return + case err != nil: + httputil.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest) + return + } + + publicKeyBytes := make([][]byte, len(req.PublicKeys)) + for i, s := range req.PublicKeys { + bs, err := hexutil.Decode(s) + if err != nil { + httputil.HandleError(w, "could not decode public keys: "+err.Error(), http.StatusBadRequest) + return + } + publicKeyBytes[i] = bs + } + epoch, err := strconv.ParseUint(req.Epoch, 10, 64) + if err != nil { + httputil.HandleError(w, "invalid epoch: "+err.Error(), http.StatusBadRequest) + return + } + var indices []primitives.ValidatorIndex + for _, i := range req.Indices { + u, err := strconv.ParseUint(i, 10, 64) + if err != nil { + httputil.HandleError(w, "invalid indices: "+err.Error(), http.StatusBadRequest) + return + } + indices = append(indices, primitives.ValidatorIndex(u)) + } + votes, rpcError := s.CoreService.IndividualVotes( + ctx, + ðpb.IndividualVotesRequest{ + Epoch: primitives.Epoch(epoch), + PublicKeys: publicKeyBytes, + Indices: indices, + }, + ) + + if rpcError != nil { + httputil.HandleError(w, rpcError.Err.Error(), core.ErrorReasonToHTTP(rpcError.Reason)) + return + } + v := make([]*structs.IndividualVote, 0, len(votes.IndividualVotes)) + for _, vote := range votes.IndividualVotes { + v = append(v, &structs.IndividualVote{ + Epoch: fmt.Sprintf("%d", vote.Epoch), + PublicKey: hexutil.Encode(vote.PublicKey), + ValidatorIndex: fmt.Sprintf("%d", vote.ValidatorIndex), + IsSlashed: vote.IsSlashed, + IsWithdrawableInCurrentEpoch: vote.IsWithdrawableInCurrentEpoch, + IsActiveInCurrentEpoch: vote.IsActiveInCurrentEpoch, + IsActiveInPreviousEpoch: vote.IsActiveInPreviousEpoch, + IsCurrentEpochAttester: vote.IsCurrentEpochAttester, + IsCurrentEpochTargetAttester: vote.IsCurrentEpochTargetAttester, + IsPreviousEpochAttester: vote.IsPreviousEpochAttester, + IsPreviousEpochTargetAttester: vote.IsPreviousEpochTargetAttester, + IsPreviousEpochHeadAttester: vote.IsPreviousEpochHeadAttester, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", vote.CurrentEpochEffectiveBalanceGwei), + InclusionSlot: fmt.Sprintf("%d", vote.InclusionSlot), + InclusionDistance: fmt.Sprintf("%d", vote.InclusionDistance), + InactivityScore: fmt.Sprintf("%d", vote.InactivityScore), + }) + } + response := &structs.GetIndividualVotesResponse{ + IndividualVotes: v, + } + httputil.WriteJson(w, response) +} diff --git a/beacon-chain/rpc/prysm/beacon/handlers_test.go b/beacon-chain/rpc/prysm/beacon/handlers_test.go new file mode 100644 index 000000000000..521126548fce --- /dev/null +++ b/beacon-chain/rpc/prysm/beacon/handlers_test.go @@ -0,0 +1,660 @@ +package beacon + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "math" + "net/http" + "net/http/httptest" + "testing" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/api/server/structs" + chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" + doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" + mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +func individualVotesHelper(t *testing.T, request *structs.GetIndividualVotesRequest, s *Server) (string, *structs.GetIndividualVotesResponse) { + var buf bytes.Buffer + err := json.NewEncoder(&buf).Encode(request) + require.NoError(t, err) + + srv := httptest.NewServer(http.HandlerFunc(s.GetIndividualVotes)) + defer srv.Close() + req := httptest.NewRequest( + http.MethodGet, + "http://example.com/eth/v1/beacon/individual_votes", + &buf, + ) + client := &http.Client{} + rawResp, err := client.Post(srv.URL, "application/json", req.Body) + require.NoError(t, err) + defer func() { + if err := rawResp.Body.Close(); err != nil { + t.Fatal(err) + } + }() + body, err := io.ReadAll(rawResp.Body) + require.NoError(t, err) + type ErrorResponse struct { + Message string `json:"message"` + } + if rawResp.StatusCode != 200 { + var errorResponse ErrorResponse + err = json.Unmarshal(body, &errorResponse) + require.NoError(t, err) + return errorResponse.Message, &structs.GetIndividualVotesResponse{} + } + var votes *structs.GetIndividualVotesResponse + err = json.Unmarshal(body, &votes) + require.NoError(t, err) + return "", votes +} + +func TestServer_GetIndividualVotes_RequestFutureSlot(t *testing.T) { + s := &Server{ + CoreService: &core.Service{ + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + request := &structs.GetIndividualVotesRequest{ + Epoch: fmt.Sprintf("%d", slots.ToEpoch(s.CoreService.GenesisTimeFetcher.CurrentSlot())+1), + } + errorResp, _ := individualVotesHelper(t, request, s) + require.StringContains(t, "cannot retrieve information about an epoch in the future", errorResp) +} + +func addDefaultReplayerBuilder(s *Server, h stategen.HistoryAccessor) { + cc := &mockstategen.CanonicalChecker{Is: true, Err: nil} + cs := &mockstategen.CurrentSlotter{Slot: math.MaxUint64 - 1} + s.CoreService.ReplayerBuilder = stategen.NewCanonicalHistory(h, cc, cs) +} + +func TestServer_GetIndividualVotes_ValidatorsDontExist(t *testing.T) { + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + + var slot primitives.Slot = 0 + validators := uint64(64) + stateWithValidators, _ := util.DeterministicGenesisState(t, validators) + beaconState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, beaconState.SetValidators(stateWithValidators.Validators())) + require.NoError(t, beaconState.SetSlot(slot)) + + b := util.NewBeaconBlock() + b.Block.Slot = slot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + gen := stategen.New(beaconDB, doublylinkedtree.New()) + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + s := &Server{ + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + // Test non exist public key. + request := &structs.GetIndividualVotesRequest{ + PublicKeys: []string{"0xaa"}, + Epoch: "0", + } + errStr, resp := individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want := &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "0", + PublicKey: "0xaa", + ValidatorIndex: fmt.Sprintf("%d", ^uint64(0)), + CurrentEpochEffectiveBalanceGwei: "0", + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") + + // Test non-existent validator index. + request = &structs.GetIndividualVotesRequest{ + Indices: []string{"100"}, + Epoch: "0", + } + errStr, resp = individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want = &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "0", + PublicKey: "0x", + ValidatorIndex: "100", + CurrentEpochEffectiveBalanceGwei: "0", + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") + + // Test both. + request = &structs.GetIndividualVotesRequest{ + PublicKeys: []string{"0xaa", "0xbb"}, + Indices: []string{"100", "101"}, + Epoch: "0", + } + errStr, resp = individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want = &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + {Epoch: "0", PublicKey: "0xaa", ValidatorIndex: fmt.Sprintf("%d", ^uint64(0)), CurrentEpochEffectiveBalanceGwei: "0", InclusionSlot: "0", InclusionDistance: "0", InactivityScore: "0"}, + { + Epoch: "0", + PublicKey: "0xbb", + ValidatorIndex: fmt.Sprintf("%d", ^uint64(0)), + CurrentEpochEffectiveBalanceGwei: "0", + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + { + Epoch: "0", + PublicKey: "0x", + ValidatorIndex: "100", + CurrentEpochEffectiveBalanceGwei: "0", + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + { + Epoch: "0", + PublicKey: "0x", + ValidatorIndex: "101", + CurrentEpochEffectiveBalanceGwei: "0", + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") +} + +func TestServer_GetIndividualVotes_Working(t *testing.T) { + helpers.ClearCache() + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + + validators := uint64(32) + stateWithValidators, _ := util.DeterministicGenesisState(t, validators) + beaconState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, beaconState.SetValidators(stateWithValidators.Validators())) + + bf := bitfield.NewBitlist(validators / uint64(params.BeaconConfig().SlotsPerEpoch)) + att1 := util.NewAttestation() + att1.AggregationBits = bf + att2 := util.NewAttestation() + att2.AggregationBits = bf + rt := [32]byte{'A'} + att1.Data.Target.Root = rt[:] + att1.Data.BeaconBlockRoot = rt[:] + br := beaconState.BlockRoots() + newRt := [32]byte{'B'} + br[0] = newRt[:] + require.NoError(t, beaconState.SetBlockRoots(br)) + att2.Data.Target.Root = rt[:] + att2.Data.BeaconBlockRoot = newRt[:] + err = beaconState.AppendPreviousEpochAttestations(ð.PendingAttestation{ + Data: att1.Data, AggregationBits: bf, InclusionDelay: 1, + }) + require.NoError(t, err) + err = beaconState.AppendCurrentEpochAttestations(ð.PendingAttestation{ + Data: att2.Data, AggregationBits: bf, InclusionDelay: 1, + }) + require.NoError(t, err) + + b := util.NewBeaconBlock() + b.Block.Slot = 0 + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + gen := stategen.New(beaconDB, doublylinkedtree.New()) + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + s := &Server{ + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + request := &structs.GetIndividualVotesRequest{ + Indices: []string{"0", "1"}, + Epoch: "0", + } + errStr, resp := individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want := &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "0", + ValidatorIndex: "0", + PublicKey: hexutil.Encode(beaconState.Validators()[0].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: fmt.Sprintf("%d", params.BeaconConfig().FarFutureSlot), + InclusionDistance: fmt.Sprintf("%d", params.BeaconConfig().FarFutureSlot), + InactivityScore: "0", + }, + { + Epoch: "0", + ValidatorIndex: "1", + PublicKey: hexutil.Encode(beaconState.Validators()[1].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: fmt.Sprintf("%d", params.BeaconConfig().FarFutureSlot), + InclusionDistance: fmt.Sprintf("%d", params.BeaconConfig().FarFutureSlot), + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") +} + +func TestServer_GetIndividualVotes_WorkingAltair(t *testing.T) { + helpers.ClearCache() + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + + var slot primitives.Slot = 0 + validators := uint64(32) + beaconState, _ := util.DeterministicGenesisStateAltair(t, validators) + require.NoError(t, beaconState.SetSlot(slot)) + + pb, err := beaconState.CurrentEpochParticipation() + require.NoError(t, err) + for i := range pb { + pb[i] = 0xff + } + require.NoError(t, beaconState.SetCurrentParticipationBits(pb)) + require.NoError(t, beaconState.SetPreviousParticipationBits(pb)) + + b := util.NewBeaconBlock() + b.Block.Slot = slot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + gen := stategen.New(beaconDB, doublylinkedtree.New()) + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + s := &Server{ + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + request := &structs.GetIndividualVotesRequest{ + Indices: []string{"0", "1"}, + Epoch: "0", + } + errStr, resp := individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want := &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "0", + ValidatorIndex: "0", + PublicKey: hexutil.Encode(beaconState.Validators()[0].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + { + Epoch: "0", + ValidatorIndex: "1", + PublicKey: hexutil.Encode(beaconState.Validators()[1].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") +} + +func TestServer_GetIndividualVotes_AltairEndOfEpoch(t *testing.T) { + helpers.ClearCache() + params.SetupTestConfigCleanup(t) + params.OverrideBeaconConfig(params.BeaconConfig()) + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + + validators := uint64(32) + beaconState, _ := util.DeterministicGenesisStateAltair(t, validators) + startSlot, err := slots.EpochStart(1) + assert.NoError(t, err) + require.NoError(t, beaconState.SetSlot(startSlot)) + + b := util.NewBeaconBlock() + b.Block.Slot = startSlot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + gen := stategen.New(beaconDB, doublylinkedtree.New()) + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + // Save State at the end of the epoch: + endSlot, err := slots.EpochEnd(1) + assert.NoError(t, err) + + beaconState, _ = util.DeterministicGenesisStateAltair(t, validators) + require.NoError(t, beaconState.SetSlot(endSlot)) + + pb, err := beaconState.CurrentEpochParticipation() + require.NoError(t, err) + for i := range pb { + pb[i] = 0xff + } + require.NoError(t, beaconState.SetCurrentParticipationBits(pb)) + require.NoError(t, beaconState.SetPreviousParticipationBits(pb)) + + b.Block.Slot = endSlot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err = b.Block.HashTreeRoot() + require.NoError(t, err) + + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + s := &Server{ + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + request := &structs.GetIndividualVotesRequest{ + Indices: []string{"0", "1"}, + Epoch: "1", + } + errStr, resp := individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want := &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "1", + ValidatorIndex: "0", + PublicKey: hexutil.Encode(beaconState.Validators()[0].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + { + Epoch: "1", + ValidatorIndex: "1", + PublicKey: hexutil.Encode(beaconState.Validators()[1].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") +} + +func TestServer_GetIndividualVotes_BellatrixEndOfEpoch(t *testing.T) { + helpers.ClearCache() + params.SetupTestConfigCleanup(t) + params.OverrideBeaconConfig(params.BeaconConfig()) + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + + validators := uint64(32) + beaconState, _ := util.DeterministicGenesisStateBellatrix(t, validators) + startSlot, err := slots.EpochStart(1) + assert.NoError(t, err) + require.NoError(t, beaconState.SetSlot(startSlot)) + + b := util.NewBeaconBlock() + b.Block.Slot = startSlot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + gen := stategen.New(beaconDB, doublylinkedtree.New()) + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + // Save State at the end of the epoch: + endSlot, err := slots.EpochEnd(1) + assert.NoError(t, err) + + beaconState, _ = util.DeterministicGenesisStateBellatrix(t, validators) + require.NoError(t, beaconState.SetSlot(endSlot)) + + pb, err := beaconState.CurrentEpochParticipation() + require.NoError(t, err) + for i := range pb { + pb[i] = 0xff + } + require.NoError(t, beaconState.SetCurrentParticipationBits(pb)) + require.NoError(t, beaconState.SetPreviousParticipationBits(pb)) + + b.Block.Slot = endSlot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err = b.Block.HashTreeRoot() + require.NoError(t, err) + + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + s := &Server{ + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + request := &structs.GetIndividualVotesRequest{ + Indices: []string{"0", "1"}, + Epoch: "1", + } + errStr, resp := individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want := &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "1", + ValidatorIndex: "0", + PublicKey: hexutil.Encode(beaconState.Validators()[0].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + { + Epoch: "1", + ValidatorIndex: "1", + PublicKey: hexutil.Encode(beaconState.Validators()[1].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") +} + +func TestServer_GetIndividualVotes_CapellaEndOfEpoch(t *testing.T) { + helpers.ClearCache() + params.SetupTestConfigCleanup(t) + params.OverrideBeaconConfig(params.BeaconConfig()) + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + + validators := uint64(32) + beaconState, _ := util.DeterministicGenesisStateCapella(t, validators) + startSlot, err := slots.EpochStart(1) + assert.NoError(t, err) + require.NoError(t, beaconState.SetSlot(startSlot)) + + b := util.NewBeaconBlock() + b.Block.Slot = startSlot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + gen := stategen.New(beaconDB, doublylinkedtree.New()) + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + // Save State at the end of the epoch: + endSlot, err := slots.EpochEnd(1) + assert.NoError(t, err) + + beaconState, _ = util.DeterministicGenesisStateCapella(t, validators) + require.NoError(t, beaconState.SetSlot(endSlot)) + + pb, err := beaconState.CurrentEpochParticipation() + require.NoError(t, err) + for i := range pb { + pb[i] = 0xff + } + require.NoError(t, beaconState.SetCurrentParticipationBits(pb)) + require.NoError(t, beaconState.SetPreviousParticipationBits(pb)) + + b.Block.Slot = endSlot + util.SaveBlock(t, ctx, beaconDB, b) + gRoot, err = b.Block.HashTreeRoot() + require.NoError(t, err) + + require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) + require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) + s := &Server{ + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &chainMock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + request := &structs.GetIndividualVotesRequest{ + Indices: []string{"0", "1"}, + Epoch: "1", + } + errStr, resp := individualVotesHelper(t, request, s) + require.Equal(t, "", errStr) + want := &structs.GetIndividualVotesResponse{ + IndividualVotes: []*structs.IndividualVote{ + { + Epoch: "1", + ValidatorIndex: "0", + PublicKey: hexutil.Encode(beaconState.Validators()[0].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + { + Epoch: "1", + ValidatorIndex: "1", + PublicKey: hexutil.Encode(beaconState.Validators()[1].PublicKey), + IsActiveInCurrentEpoch: true, + IsActiveInPreviousEpoch: true, + IsCurrentEpochTargetAttester: true, + IsCurrentEpochAttester: true, + IsPreviousEpochAttester: true, + IsPreviousEpochHeadAttester: true, + IsPreviousEpochTargetAttester: true, + CurrentEpochEffectiveBalanceGwei: fmt.Sprintf("%d", params.BeaconConfig().MaxEffectiveBalance), + InclusionSlot: "0", + InclusionDistance: "0", + InactivityScore: "0", + }, + }, + } + assert.DeepEqual(t, want, resp, "Unexpected response") +} diff --git a/beacon-chain/rpc/prysm/beacon/server.go b/beacon-chain/rpc/prysm/beacon/server.go index a7f4616ee089..5af654712f69 100644 --- a/beacon-chain/rpc/prysm/beacon/server.go +++ b/beacon-chain/rpc/prysm/beacon/server.go @@ -3,6 +3,7 @@ package beacon import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" beacondb "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" @@ -18,4 +19,5 @@ type Server struct { Stater lookup.Stater ChainInfoFetcher blockchain.ChainInfoFetcher FinalizationFetcher blockchain.FinalizationFetcher + CoreService *core.Service } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go index 26ff052b4458..ed1965710557 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go @@ -16,7 +16,7 @@ import ( "google.golang.org/grpc/status" ) -const errEpoch = "Cannot retrieve information about an epoch in the future, current epoch %d, requesting %d" +const errEpoch = "cannot retrieve information about an epoch in the future, current epoch %d, requesting %d" // ListValidatorAssignments retrieves the validator assignments for a given epoch, // optional validator indices or public keys may be included to filter validator assignments. diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/committees_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/committees_test.go index 7d2fa10c1dd5..be1beb965eda 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/committees_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/committees_test.go @@ -79,6 +79,9 @@ func addDefaultReplayerBuilder(s *Server, h stategen.HistoryAccessor) { cc := &mockstategen.CanonicalChecker{Is: true, Err: nil} cs := &mockstategen.CurrentSlotter{Slot: math.MaxUint64 - 1} s.ReplayerBuilder = stategen.NewCanonicalHistory(h, cc, cs) + if s.CoreService != nil { + s.CoreService.ReplayerBuilder = stategen.NewCanonicalHistory(h, cc, cs) + } } func TestServer_ListBeaconCommittees_PreviousEpoch(t *testing.T) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index efad2fa89da6..4b4e59b04802 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -672,105 +672,11 @@ func (bs *Server) GetIndividualVotes( ctx context.Context, req *ethpb.IndividualVotesRequest, ) (*ethpb.IndividualVotesRespond, error) { - currentEpoch := slots.ToEpoch(bs.GenesisTimeFetcher.CurrentSlot()) - if req.Epoch > currentEpoch { - return nil, status.Errorf( - codes.InvalidArgument, - errEpoch, - currentEpoch, - req.Epoch, - ) - } - - s, err := slots.EpochEnd(req.Epoch) - if err != nil { - return nil, err - } - st, err := bs.ReplayerBuilder.ReplayerForSlot(s).ReplayBlocks(ctx) + response, err := bs.CoreService.IndividualVotes(ctx, req) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to replay blocks for state at epoch %d: %v", req.Epoch, err) - } - // Track filtered validators to prevent duplication in the response. - filtered := map[primitives.ValidatorIndex]bool{} - filteredIndices := make([]primitives.ValidatorIndex, 0) - votes := make([]*ethpb.IndividualVotesRespond_IndividualVote, 0, len(req.Indices)+len(req.PublicKeys)) - // Filter out assignments by public keys. - for _, pubKey := range req.PublicKeys { - index, ok := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) - if !ok { - votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{PublicKey: pubKey, ValidatorIndex: primitives.ValidatorIndex(^uint64(0))}) - continue - } - filtered[index] = true - filteredIndices = append(filteredIndices, index) - } - // Filter out assignments by validator indices. - for _, index := range req.Indices { - if !filtered[index] { - filteredIndices = append(filteredIndices, index) - } - } - sort.Slice(filteredIndices, func(i, j int) bool { - return filteredIndices[i] < filteredIndices[j] - }) - - var v []*precompute.Validator - var bal *precompute.Balance - if st.Version() == version.Phase0 { - v, bal, err = precompute.New(ctx, st) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not set up pre compute instance: %v", err) - } - v, _, err = precompute.ProcessAttestations(ctx, st, v, bal) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not pre compute attestations: %v", err) - } - } else if st.Version() >= version.Altair { - v, bal, err = altair.InitializePrecomputeValidators(ctx, st) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not set up altair pre compute instance: %v", err) - } - v, _, err = altair.ProcessEpochParticipation(ctx, st, bal, v) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not pre compute attestations: %v", err) - } - } else { - return nil, status.Errorf(codes.Internal, "Invalid state type retrieved with a version of %d", st.Version()) - } - - for _, index := range filteredIndices { - if uint64(index) >= uint64(len(v)) { - votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{ValidatorIndex: index}) - continue - } - val, err := st.ValidatorAtIndexReadOnly(index) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not retrieve validator: %v", err) - } - pb := val.PublicKey() - votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{ - Epoch: req.Epoch, - PublicKey: pb[:], - ValidatorIndex: index, - IsSlashed: v[index].IsSlashed, - IsWithdrawableInCurrentEpoch: v[index].IsWithdrawableCurrentEpoch, - IsActiveInCurrentEpoch: v[index].IsActiveCurrentEpoch, - IsActiveInPreviousEpoch: v[index].IsActivePrevEpoch, - IsCurrentEpochAttester: v[index].IsCurrentEpochAttester, - IsCurrentEpochTargetAttester: v[index].IsCurrentEpochTargetAttester, - IsPreviousEpochAttester: v[index].IsPrevEpochAttester, - IsPreviousEpochTargetAttester: v[index].IsPrevEpochTargetAttester, - IsPreviousEpochHeadAttester: v[index].IsPrevEpochHeadAttester, - CurrentEpochEffectiveBalanceGwei: v[index].CurrentEpochEffectiveBalance, - InclusionSlot: v[index].InclusionSlot, - InclusionDistance: v[index].InclusionDistance, - InactivityScore: v[index].InactivityScore, - }) + return nil, status.Errorf(core.ErrorReasonToGRPC(err.Reason), "Could not retrieve individual votes: %v", err.Err) } - - return ðpb.IndividualVotesRespond{ - IndividualVotes: votes, - }, nil + return response, nil } // Determines whether a validator has already exited. diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go index 56a6a3f3e516..83abeb5ae372 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go @@ -44,7 +44,7 @@ import ( ) const ( - errNoEpochInfoError = "Cannot retrieve information about an epoch in the future" + errNoEpochInfoError = "cannot retrieve information about an epoch in the future" ) func TestServer_GetValidatorActiveSetChanges_CannotRequestFutureEpoch(t *testing.T) { @@ -2258,12 +2258,17 @@ func setupValidators(t testing.TB, _ db.Database, count int) ([]*ethpb.Validator } func TestServer_GetIndividualVotes_RequestFutureSlot(t *testing.T) { - ds := &Server{GenesisTimeFetcher: &mock.ChainService{}} + bs := &Server{ + CoreService: &core.Service{ + GenesisTimeFetcher: &mock.ChainService{}, + }, + } + req := ðpb.IndividualVotesRequest{ - Epoch: slots.ToEpoch(ds.GenesisTimeFetcher.CurrentSlot()) + 1, + Epoch: slots.ToEpoch(bs.CoreService.GenesisTimeFetcher.CurrentSlot()) + 1, } wanted := errNoEpochInfoError - _, err := ds.GetIndividualVotes(context.Background(), req) + _, err := bs.GetIndividualVotes(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -2292,8 +2297,10 @@ func TestServer_GetIndividualVotes_ValidatorsDontExist(t *testing.T) { require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) bs := &Server{ - StateGen: gen, - GenesisTimeFetcher: &mock.ChainService{}, + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &mock.ChainService{}, + }, } addDefaultReplayerBuilder(bs, beaconDB) @@ -2388,8 +2395,10 @@ func TestServer_GetIndividualVotes_Working(t *testing.T) { require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) bs := &Server{ - StateGen: gen, - GenesisTimeFetcher: &mock.ChainService{}, + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &mock.ChainService{}, + }, } addDefaultReplayerBuilder(bs, beaconDB) @@ -2451,8 +2460,10 @@ func TestServer_GetIndividualVotes_WorkingAltair(t *testing.T) { require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) bs := &Server{ - StateGen: gen, - GenesisTimeFetcher: &mock.ChainService{}, + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &mock.ChainService{}, + }, } addDefaultReplayerBuilder(bs, beaconDB) @@ -2537,8 +2548,10 @@ func TestServer_GetIndividualVotes_AltairEndOfEpoch(t *testing.T) { require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) bs := &Server{ - StateGen: gen, - GenesisTimeFetcher: &mock.ChainService{}, + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &mock.ChainService{}, + }, } addDefaultReplayerBuilder(bs, beaconDB) @@ -2625,8 +2638,10 @@ func TestServer_GetIndividualVotes_BellatrixEndOfEpoch(t *testing.T) { require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) bs := &Server{ - StateGen: gen, - GenesisTimeFetcher: &mock.ChainService{}, + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &mock.ChainService{}, + }, } addDefaultReplayerBuilder(bs, beaconDB) @@ -2713,8 +2728,10 @@ func TestServer_GetIndividualVotes_CapellaEndOfEpoch(t *testing.T) { require.NoError(t, gen.SaveState(ctx, gRoot, beaconState)) require.NoError(t, beaconDB.SaveState(ctx, beaconState, gRoot)) bs := &Server{ - StateGen: gen, - GenesisTimeFetcher: &mock.ChainService{}, + CoreService: &core.Service{ + StateGen: gen, + GenesisTimeFetcher: &mock.ChainService{}, + }, } addDefaultReplayerBuilder(bs, beaconDB) From 49055acf811fa8792640389fefb7897d61a4fbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 19 Jul 2024 16:08:39 +0200 Subject: [PATCH 207/325] EIP-7549: Attestation packing (#14238) * EIP-7549: Attestation packing * new files * change var name * test fixes * enhance comment * unit test for Deneb state --- .../attestations/prepare_forkchoice.go | 6 +- .../rpc/prysm/v1alpha1/validator/BUILD.bazel | 3 + .../validator/proposer_attestations.go | 32 +++- .../proposer_attestations_electra.go | 98 +++++++++++ .../proposer_attestations_electra_test.go | 163 ++++++++++++++++++ .../validator/proposer_attestations_test.go | 20 ++- 6 files changed, 313 insertions(+), 9 deletions(-) create mode 100644 beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra.go create mode 100644 beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra_test.go diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index 34a561066ac2..38b69b9583dc 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -67,7 +67,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { atts := append(s.cfg.Pool.AggregatedAttestations(), s.cfg.Pool.BlockAttestations()...) atts = append(atts, s.cfg.Pool.ForkchoiceAttestations()...) - attsByVerAndDataRoot := make(map[attestation.Id][]ethpb.Att, len(atts)) + attsById := make(map[attestation.Id][]ethpb.Att, len(atts)) // Consolidate attestations by aggregating them by similar data root. for _, att := range atts { @@ -83,10 +83,10 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { if err != nil { return errors.Wrap(err, "could not create attestation ID") } - attsByVerAndDataRoot[id] = append(attsByVerAndDataRoot[id], att) + attsById[id] = append(attsById[id], att) } - for _, atts := range attsByVerAndDataRoot { + for _, atts := range attsById { if err := s.aggregateAndSaveForkChoiceAtts(atts); err != nil { return err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel index f8acf2305e1c..34ef244e1977 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "proposer.go", "proposer_altair.go", "proposer_attestations.go", + "proposer_attestations_electra.go", "proposer_bellatrix.go", "proposer_builder.go", "proposer_capella.go", @@ -147,6 +148,7 @@ common_deps = [ "//consensus-types/primitives:go_default_library", "//container/trie:go_default_library", "//crypto/bls:go_default_library", + "//crypto/bls/blst:go_default_library", "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", "//proto/engine/v1:go_default_library", @@ -186,6 +188,7 @@ go_test( "duties_test.go", "exit_test.go", "proposer_altair_test.go", + "proposer_attestations_electra_test.go", "proposer_attestations_test.go", "proposer_bellatrix_test.go", "proposer_builder_test.go", diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index c6138e211361..7ae8e3662c8b 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -42,6 +42,8 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon } atts = append(atts, uAtts...) + // Checking the state's version here will give the wrong result if the last slot of Deneb is missed. + // The head state will still be in Deneb while we are trying to build an Electra block. postElectra := slots.ToEpoch(blkSlot) >= params.BeaconConfig().ElectraForkEpoch versionAtts := make([]ethpb.Att, 0, len(atts)) @@ -66,23 +68,43 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon return nil, err } - attsByDataRoot := make(map[attestation.Id][]ethpb.Att, len(versionAtts)) + attsById := make(map[attestation.Id][]ethpb.Att, len(versionAtts)) for _, att := range versionAtts { id, err := attestation.NewId(att, attestation.Data) if err != nil { return nil, errors.Wrap(err, "could not create attestation ID") } - attsByDataRoot[id] = append(attsByDataRoot[id], att) + attsById[id] = append(attsById[id], att) } - attsForInclusion := proposerAtts(make([]ethpb.Att, 0)) - for _, as := range attsByDataRoot { + for id, as := range attsById { as, err := attaggregation.Aggregate(as) if err != nil { return nil, err } - attsForInclusion = append(attsForInclusion, as...) + attsById[id] = as + } + + var attsForInclusion proposerAtts + if postElectra { + // TODO: hack for Electra devnet-1, take only one aggregate per ID + // (which essentially means one aggregate for an attestation_data+committee combination + topAggregates := make([]ethpb.Att, 0) + for _, v := range attsById { + topAggregates = append(topAggregates, v[0]) + } + + attsForInclusion, err = computeOnChainAggregate(topAggregates) + if err != nil { + return nil, err + } + } else { + attsForInclusion = make([]ethpb.Att, 0) + for _, as := range attsById { + attsForInclusion = append(attsForInclusion, as...) + } } + deduped, err := attsForInclusion.dedup() if err != nil { return nil, err diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra.go new file mode 100644 index 000000000000..e15df73bcaa4 --- /dev/null +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra.go @@ -0,0 +1,98 @@ +package validator + +import ( + "slices" + + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +// computeOnChainAggregate constructs a final aggregate form a list of network aggregates with equal attestation data. +// It assumes that each network aggregate has exactly one committee bit set. +// +// Spec definition: +// +// def compute_on_chain_aggregate(network_aggregates: Sequence[Attestation]) -> Attestation: +// aggregates = sorted(network_aggregates, key=lambda a: get_committee_indices(a.committee_bits)[0]) +// +// data = aggregates[0].data +// aggregation_bits = Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]() +// for a in aggregates: +// for b in a.aggregation_bits: +// aggregation_bits.append(b) +// +// signature = bls.Aggregate([a.signature for a in aggregates]) +// +// committee_indices = [get_committee_indices(a.committee_bits)[0] for a in aggregates] +// committee_flags = [(index in committee_indices) for index in range(0, MAX_COMMITTEES_PER_SLOT)] +// committee_bits = Bitvector[MAX_COMMITTEES_PER_SLOT](committee_flags) +// +// return Attestation( +// aggregation_bits=aggregation_bits, +// data=data, +// committee_bits=committee_bits, +// signature=signature, +// ) +func computeOnChainAggregate(aggregates []ethpb.Att) ([]ethpb.Att, error) { + aggsByDataRoot := make(map[[32]byte][]ethpb.Att) + for _, agg := range aggregates { + key, err := agg.GetData().HashTreeRoot() + if err != nil { + return nil, err + } + existing, ok := aggsByDataRoot[key] + if ok { + aggsByDataRoot[key] = append(existing, agg) + } else { + aggsByDataRoot[key] = []ethpb.Att{agg} + } + } + + result := make([]ethpb.Att, 0) + + for _, aggs := range aggsByDataRoot { + slices.SortFunc(aggs, func(a, b ethpb.Att) int { + return a.CommitteeBitsVal().BitIndices()[0] - b.CommitteeBitsVal().BitIndices()[0] + }) + + sigs := make([]bls.Signature, len(aggs)) + committeeIndices := make([]primitives.CommitteeIndex, len(aggs)) + aggBitsIndices := make([]uint64, 0) + aggBitsOffset := uint64(0) + var err error + for i, a := range aggs { + for _, bi := range a.GetAggregationBits().BitIndices() { + aggBitsIndices = append(aggBitsIndices, uint64(bi)+aggBitsOffset) + } + sigs[i], err = bls.SignatureFromBytes(a.GetSignature()) + if err != nil { + return nil, err + } + committeeIndices[i] = helpers.CommitteeIndices(a.CommitteeBitsVal())[0] + + aggBitsOffset += a.GetAggregationBits().Len() + } + + aggregationBits := bitfield.NewBitlist(aggBitsOffset) + for _, bi := range aggBitsIndices { + aggregationBits.SetBitAt(bi, true) + } + + cb := primitives.NewAttestationCommitteeBits() + att := ðpb.AttestationElectra{ + AggregationBits: aggregationBits, + Data: aggs[0].GetData(), + CommitteeBits: cb, + Signature: bls.AggregateSignatures(sigs).Marshal(), + } + for _, ci := range committeeIndices { + att.CommitteeBits.SetBitAt(uint64(ci), true) + } + result = append(result, att) + } + + return result, nil +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra_test.go new file mode 100644 index 000000000000..b28dca4c296c --- /dev/null +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra_test.go @@ -0,0 +1,163 @@ +package validator + +import ( + "reflect" + "testing" + + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls/blst" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func Test_computeOnChainAggregate(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.MainnetConfig().Copy() + cfg.MaxCommitteesPerSlot = 64 + params.OverrideBeaconConfig(cfg) + + key, err := blst.RandKey() + require.NoError(t, err) + sig := key.Sign([]byte{'X'}) + + data1 := ðpb.AttestationData{ + Slot: 123, + CommitteeIndex: 123, + BeaconBlockRoot: bytesutil.PadTo([]byte("root"), 32), + Source: ðpb.Checkpoint{ + Epoch: 123, + Root: bytesutil.PadTo([]byte("root"), 32), + }, + Target: ðpb.Checkpoint{ + Epoch: 123, + Root: bytesutil.PadTo([]byte("root"), 32), + }, + } + data2 := ðpb.AttestationData{ + Slot: 456, + CommitteeIndex: 456, + BeaconBlockRoot: bytesutil.PadTo([]byte("root"), 32), + Source: ðpb.Checkpoint{ + Epoch: 456, + Root: bytesutil.PadTo([]byte("root"), 32), + }, + Target: ðpb.Checkpoint{ + Epoch: 456, + Root: bytesutil.PadTo([]byte("root"), 32), + }, + } + + t.Run("single aggregate", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + att := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00011111}, + Data: data1, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + result, err := computeOnChainAggregate([]ethpb.Att{att}) + require.NoError(t, err) + require.Equal(t, 1, len(result)) + assert.DeepEqual(t, att.AggregationBits, result[0].GetAggregationBits()) + assert.DeepEqual(t, att.Data, result[0].GetData()) + assert.DeepEqual(t, att.CommitteeBits, result[0].CommitteeBitsVal()) + }) + t.Run("all aggregates for one root", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + att1 := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00010011}, // aggregation bits 0,1 + Data: data1, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(1, true) + att2 := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00010011}, // aggregation bits 0,1 + Data: data1, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + result, err := computeOnChainAggregate([]ethpb.Att{att1, att2}) + require.NoError(t, err) + require.Equal(t, 1, len(result)) + assert.DeepEqual(t, bitfield.Bitlist{0b00110011, 0b00000001}, result[0].GetAggregationBits()) + assert.DeepEqual(t, data1, result[0].GetData()) + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(1, true) + assert.DeepEqual(t, cb, result[0].CommitteeBitsVal()) + }) + t.Run("aggregates for multiple roots", func(t *testing.T) { + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + att1 := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00010011}, // aggregation bits 0,1 + Data: data1, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(1, true) + att2 := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00010011}, // aggregation bits 0,1 + Data: data1, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + att3 := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00011001}, // aggregation bits 0,3 + Data: data2, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(1, true) + att4 := ðpb.AttestationElectra{ + AggregationBits: bitfield.Bitlist{0b00010010}, // aggregation bits 1 + Data: data2, + CommitteeBits: cb, + Signature: sig.Marshal(), + } + result, err := computeOnChainAggregate([]ethpb.Att{att1, att2, att3, att4}) + require.NoError(t, err) + require.Equal(t, 2, len(result)) + cb = primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + cb.SetBitAt(1, true) + + expectedAggBits := bitfield.Bitlist{0b00110011, 0b00000001} + expectedData := data1 + found := false + for _, a := range result { + if reflect.DeepEqual(expectedAggBits, a.GetAggregationBits()) && reflect.DeepEqual(expectedData, a.GetData()) && reflect.DeepEqual(cb, a.CommitteeBitsVal()) { + found = true + break + } + } + if !found { + t.Error("Expected aggregate not found") + } + + expectedAggBits = bitfield.Bitlist{0b00101001, 0b00000001} + expectedData = data2 + found = false + for _, a := range result { + if reflect.DeepEqual(expectedAggBits, a.GetAggregationBits()) && reflect.DeepEqual(expectedData, a.GetData()) && reflect.DeepEqual(cb, a.CommitteeBitsVal()) { + found = true + break + } + } + if !found { + t.Error("Expected aggregate not found") + } + }) +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index fbbf62d7992d..84c0c9449af9 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -10,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls/blst" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -446,6 +447,9 @@ func Test_packAttestations(t *testing.T) { } cb := primitives.NewAttestationCommitteeBits() cb.SetBitAt(0, true) + key, err := blst.RandKey() + require.NoError(t, err) + sig := key.Sign([]byte{'X'}) electraAtt := ðpb.AttestationElectra{ AggregationBits: bitfield.Bitlist{0b11111}, CommitteeBits: cb, @@ -460,7 +464,7 @@ func Test_packAttestations(t *testing.T) { Root: make([]byte, 32), }, }, - Signature: make([]byte, 96), + Signature: sig.Marshal(), } pool := attestations.NewPool() require.NoError(t, pool.SaveAggregatedAttestations([]ethpb.Att{phase0Att, electraAtt})) @@ -484,6 +488,20 @@ func Test_packAttestations(t *testing.T) { st, _ := util.DeterministicGenesisStateElectra(t, 64) require.NoError(t, st.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + atts, err := s.packAttestations(ctx, st, params.BeaconConfig().SlotsPerEpoch) + require.NoError(t, err) + require.Equal(t, 1, len(atts)) + assert.DeepEqual(t, electraAtt, atts[0]) + }) + t.Run("Electra block with Deneb state", func(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.ElectraForkEpoch = 1 + params.OverrideBeaconConfig(cfg) + + st, _ := util.DeterministicGenesisStateDeneb(t, 64) + require.NoError(t, st.SetSlot(params.BeaconConfig().SlotsPerEpoch+1)) + atts, err := s.packAttestations(ctx, st, params.BeaconConfig().SlotsPerEpoch) require.NoError(t, err) require.Equal(t, 1, len(atts)) From 8364226b689d4bb23a97988cc074fbe872b0aa42 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:07:30 -0500 Subject: [PATCH 208/325] payload electra cloning (#14239) * poc for payload electra cloning * partial fixes * fixing build * addressing kasey's comment * forgot to unexport interface * making test more generic * making fuzzing slightly more robust * renaming based on kasey's comment * using fuzz test in same package to avoid exporting interface * fixing build --- proto/engine/v1/BUILD.bazel | 6 +- proto/engine/v1/execution_engine.go | 92 +++++++++++++ proto/engine/v1/execution_engine_fuzz_test.go | 30 +++++ proto/engine/v1/export_test.go | 3 + proto/prysm/v1alpha1/cloners.go | 125 +++--------------- proto/prysm/v1alpha1/cloners_test.go | 47 ------- 6 files changed, 146 insertions(+), 157 deletions(-) create mode 100644 proto/engine/v1/execution_engine.go create mode 100644 proto/engine/v1/execution_engine_fuzz_test.go create mode 100644 proto/engine/v1/export_test.go diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index bc9138b82dc5..a7c1615015f8 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -75,6 +75,7 @@ go_proto_library( go_library( name = "go_default_library", srcs = [ + "execution_engine.go", "json_marshal_unmarshal.go", ":ssz_generated_files", # keep ], @@ -121,15 +122,18 @@ ssz_proto_files( go_test( name = "go_default_test", srcs = [ + "export_test.go", + "execution_engine_fuzz_test.go", "json_marshal_unmarshal_test.go", ], + embed = [":go_default_library"], deps = [ - ":go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//testing/require:go_default_library", + "@com_github_google_gofuzz//:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_ethereum_go_ethereum//core/types:go_default_library", diff --git a/proto/engine/v1/execution_engine.go b/proto/engine/v1/execution_engine.go new file mode 100644 index 000000000000..fb03e21af6ea --- /dev/null +++ b/proto/engine/v1/execution_engine.go @@ -0,0 +1,92 @@ +package enginev1 + +import "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + +type copier[T any] interface { + Copy() T +} + +func copySlice[T any, C copier[T]](original []C) []T { + // Create a new slice with the same length as the original + newSlice := make([]T, len(original)) + for i := 0; i < len(newSlice); i++ { + newSlice[i] = original[i].Copy() + } + return newSlice +} + +func (w *Withdrawal) Copy() *Withdrawal { + if w == nil { + return nil + } + + return &Withdrawal{ + Index: w.Index, + ValidatorIndex: w.ValidatorIndex, + Address: bytesutil.SafeCopyBytes(w.Address), + Amount: w.Amount, + } +} + +func (d *DepositRequest) Copy() *DepositRequest { + if d == nil { + return nil + } + return &DepositRequest{ + Pubkey: bytesutil.SafeCopyBytes(d.Pubkey), + WithdrawalCredentials: bytesutil.SafeCopyBytes(d.WithdrawalCredentials), + Amount: d.Amount, + Signature: bytesutil.SafeCopyBytes(d.Signature), + Index: d.Index, + } +} + +func (wr *WithdrawalRequest) Copy() *WithdrawalRequest { + if wr == nil { + return nil + } + return &WithdrawalRequest{ + SourceAddress: bytesutil.SafeCopyBytes(wr.SourceAddress), + ValidatorPubkey: bytesutil.SafeCopyBytes(wr.ValidatorPubkey), + Amount: wr.Amount, + } +} + +func (cr *ConsolidationRequest) Copy() *ConsolidationRequest { + if cr == nil { + return nil + } + return &ConsolidationRequest{ + SourceAddress: bytesutil.SafeCopyBytes(cr.SourceAddress), + SourcePubkey: bytesutil.SafeCopyBytes(cr.SourcePubkey), + TargetPubkey: bytesutil.SafeCopyBytes(cr.TargetPubkey), + } +} + +func (payload *ExecutionPayloadElectra) Copy() *ExecutionPayloadElectra { + if payload == nil { + return nil + } + return &ExecutionPayloadElectra{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), + Withdrawals: copySlice(payload.Withdrawals), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + DepositRequests: copySlice(payload.DepositRequests), + WithdrawalRequests: copySlice(payload.WithdrawalRequests), + ConsolidationRequests: copySlice(payload.ConsolidationRequests), + } +} diff --git a/proto/engine/v1/execution_engine_fuzz_test.go b/proto/engine/v1/execution_engine_fuzz_test.go new file mode 100644 index 000000000000..28d4fb9fa964 --- /dev/null +++ b/proto/engine/v1/execution_engine_fuzz_test.go @@ -0,0 +1,30 @@ +package enginev1_test + +import ( + "fmt" + "testing" + + fuzz "github.com/google/gofuzz" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestCopyExecutionPayload_Fuzz(t *testing.T) { + fuzzCopies(t, &enginev1.ExecutionPayloadElectra{}) +} + +func fuzzCopies[T any, C enginev1.Copier[T]](t *testing.T, obj C) { + fuzzer := fuzz.NewWithSeed(0) + amount := 1000 + t.Run(fmt.Sprintf("%T", obj), func(t *testing.T) { + for i := 0; i < amount; i++ { + fuzzer.Fuzz(obj) // Populate thing with random values + got := obj.Copy() + require.DeepEqual(t, obj, got) + // check shallow copy working + fuzzer.Fuzz(got) + require.DeepNotEqual(t, obj, got) + // TODO: think of deeper not equal fuzzing + } + }) +} diff --git a/proto/engine/v1/export_test.go b/proto/engine/v1/export_test.go new file mode 100644 index 000000000000..17f4cde64607 --- /dev/null +++ b/proto/engine/v1/export_test.go @@ -0,0 +1,3 @@ +package enginev1 + +type Copier[T any] copier[T] diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index 1727c0ab0af0..04009820059e 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -705,7 +705,7 @@ func CopyExecutionPayloadCapella(payload *enginev1.ExecutionPayloadCapella) *eng BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), + Withdrawals: copySlice(payload.Withdrawals), } } @@ -800,33 +800,6 @@ func CopyBlindedBeaconBlockBodyBellatrix(body *BlindedBeaconBlockBodyBellatrix) } } -// CopyWithdrawalSlice copies the provided slice of withdrawals. -func CopyWithdrawalSlice(withdrawals []*enginev1.Withdrawal) []*enginev1.Withdrawal { - if withdrawals == nil { - return nil - } - - res := make([]*enginev1.Withdrawal, len(withdrawals)) - for i := 0; i < len(res); i++ { - res[i] = CopyWithdrawal(withdrawals[i]) - } - return res -} - -// CopyWithdrawal copies the provided withdrawal object. -func CopyWithdrawal(withdrawal *enginev1.Withdrawal) *enginev1.Withdrawal { - if withdrawal == nil { - return nil - } - - return &enginev1.Withdrawal{ - Index: withdrawal.Index, - ValidatorIndex: withdrawal.ValidatorIndex, - Address: bytesutil.SafeCopyBytes(withdrawal.Address), - Amount: withdrawal.Amount, - } -} - func CopyBLSToExecutionChanges(changes []*SignedBLSToExecutionChange) []*SignedBLSToExecutionChange { if changes == nil { return nil @@ -944,7 +917,7 @@ func CopyExecutionPayloadDeneb(payload *enginev1.ExecutionPayloadDeneb) *enginev BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), + Withdrawals: copySlice(payload.Withdrawals), BlobGasUsed: payload.BlobGasUsed, ExcessBlobGas: payload.ExcessBlobGas, } @@ -990,91 +963,12 @@ func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyEl Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayload: CopyExecutionPayloadElectra(body.ExecutionPayload), + ExecutionPayload: body.ExecutionPayload.Copy(), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } -// CopyExecutionPayloadElectra copies the provided execution payload. -func CopyExecutionPayloadElectra(payload *enginev1.ExecutionPayloadElectra) *enginev1.ExecutionPayloadElectra { - if payload == nil { - return nil - } - return &enginev1.ExecutionPayloadElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: CopyWithdrawalSlice(payload.Withdrawals), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - DepositRequests: CopyDepositRequests(payload.DepositRequests), - WithdrawalRequests: CopyWithdrawalRequests(payload.WithdrawalRequests), - ConsolidationRequests: CopyConsolidationRequests(payload.ConsolidationRequests), - } -} - -func CopyDepositRequests(dr []*enginev1.DepositRequest) []*enginev1.DepositRequest { - if dr == nil { - return nil - } - - newDr := make([]*enginev1.DepositRequest, len(dr)) - for i, d := range dr { - newDr[i] = &enginev1.DepositRequest{ - Pubkey: bytesutil.SafeCopyBytes(d.Pubkey), - WithdrawalCredentials: bytesutil.SafeCopyBytes(d.WithdrawalCredentials), - Amount: d.Amount, - Signature: bytesutil.SafeCopyBytes(d.Signature), - Index: d.Index, - } - } - return newDr -} - -func CopyWithdrawalRequests(wr []*enginev1.WithdrawalRequest) []*enginev1.WithdrawalRequest { - if wr == nil { - return nil - } - newWr := make([]*enginev1.WithdrawalRequest, len(wr)) - for i, w := range wr { - newWr[i] = &enginev1.WithdrawalRequest{ - SourceAddress: bytesutil.SafeCopyBytes(w.SourceAddress), - ValidatorPubkey: bytesutil.SafeCopyBytes(w.ValidatorPubkey), - Amount: w.Amount, - } - } - - return newWr -} - -func CopyConsolidationRequests(cr []*enginev1.ConsolidationRequest) []*enginev1.ConsolidationRequest { - if cr == nil { - return nil - } - newCr := make([]*enginev1.ConsolidationRequest, len(cr)) - for i, w := range cr { - newCr[i] = &enginev1.ConsolidationRequest{ - SourceAddress: bytesutil.SafeCopyBytes(w.SourceAddress), - SourcePubkey: bytesutil.SafeCopyBytes(w.SourcePubkey), - TargetPubkey: bytesutil.SafeCopyBytes(w.TargetPubkey), - } - } - - return newCr -} - func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderElectra) *enginev1.ExecutionPayloadHeaderElectra { if payload == nil { return nil @@ -1161,3 +1055,16 @@ func CopyPendingBalanceDeposits(pbd []*PendingBalanceDeposit) []*PendingBalanceD } return newPbd } + +type cloneable[T any] interface { + Copy() T +} + +func copySlice[T any, C cloneable[T]](original []C) []T { + // Create a new slice with the same length as the original + newSlice := make([]T, len(original)) + for i := 0; i < len(newSlice); i++ { + newSlice[i] = original[i].Copy() + } + return newSlice +} diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 5383970c9dec..22a348f31660 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -527,26 +527,6 @@ func bytes(length int) []byte { return b } -func TestCopyWithdrawals(t *testing.T) { - ws := genWithdrawals(10) - - got := v1alpha1.CopyWithdrawalSlice(ws) - if !reflect.DeepEqual(got, ws) { - t.Errorf("TestCopyWithdrawals() = %v, want %v", got, ws) - } - assert.NotEmpty(t, got, "Copied withdrawals have empty fields") -} - -func TestCopyWithdrawal(t *testing.T) { - w := genWithdrawal() - - got := v1alpha1.CopyWithdrawal(w) - if !reflect.DeepEqual(got, w) { - t.Errorf("TestCopyWithdrawal() = %v, want %v", got, w) - } - assert.NotEmpty(t, got, "Copied withdrawal has empty fields") -} - func TestCopyBLSToExecutionChanges(t *testing.T) { changes := genBLSToExecutionChanges(10) @@ -658,33 +638,6 @@ func TestCopyBeaconBlockBodyElectra(t *testing.T) { } } -func TestCopyExecutionPayloadElectra(t *testing.T) { - p := genExecutionPayloadElectra() - - got := v1alpha1.CopyExecutionPayloadElectra(p) - if !reflect.DeepEqual(got, p) { - t.Errorf("TestCopyExecutionPayloadElectra() = %v, want %v", got, p) - } -} - -func TestCopyDepositRequests(t *testing.T) { - drs := genDepositRequests(10) - - got := v1alpha1.CopyDepositRequests(drs) - if !reflect.DeepEqual(got, drs) { - t.Errorf("TestCopyDepositRequests() = %v, want %v", got, drs) - } -} - -func TestCopyWithdrawalRequests(t *testing.T) { - wrs := genWithdrawalRequests(10) - - got := v1alpha1.CopyWithdrawalRequests(wrs) - if !reflect.DeepEqual(got, wrs) { - t.Errorf("TestCopyWithdrawalRequests() = %v, want %v", got, wrs) - } -} - func TestCopyExecutionPayloadHeaderElectra(t *testing.T) { p := genExecutionPayloadHeaderElectra() From fd9321f6ba063de5bc71ccef3e7449bd747d90f0 Mon Sep 17 00:00:00 2001 From: stellrust Date: Mon, 22 Jul 2024 21:41:27 +0900 Subject: [PATCH 209/325] chore: fix comment for struct field (#14218) Signed-off-by: stellrust Co-authored-by: terence --- beacon-chain/core/epoch/precompute/type.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/core/epoch/precompute/type.go b/beacon-chain/core/epoch/precompute/type.go index bcd73598e95f..29331301fc4d 100644 --- a/beacon-chain/core/epoch/precompute/type.go +++ b/beacon-chain/core/epoch/precompute/type.go @@ -24,7 +24,7 @@ type Validator struct { IsPrevEpochSourceAttester bool // IsPrevEpochTargetAttester is true if the validator attested previous epoch target. IsPrevEpochTargetAttester bool - // IsHeadAttester is true if the validator attested head. + // IsPrevEpochHeadAttester is true if the validator attested the previous epoch head. IsPrevEpochHeadAttester bool // CurrentEpochEffectiveBalance is how much effective balance this validator has current epoch. From b1be6cd20be152dfac2c4fcaaa14e1e99b4811a8 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 22 Jul 2024 08:34:42 -0500 Subject: [PATCH 210/325] creating execution payload copy and fuzz tests (#14246) * creating execution payload copy and fuzz tests * fixing build * removing unused code --- .../state-native/getters_payload_header.go | 30 +-- .../state/state-native/getters_state.go | 8 +- beacon-chain/state/state-native/state_trie.go | 8 +- proto/engine/v1/execution_engine.go | 183 ++++++++++++++++ proto/engine/v1/execution_engine_fuzz_test.go | 10 + proto/prysm/v1alpha1/cloners.go | 204 +----------------- proto/prysm/v1alpha1/cloners_test.go | 39 ---- 7 files changed, 212 insertions(+), 270 deletions(-) diff --git a/beacon-chain/state/state-native/getters_payload_header.go b/beacon-chain/state/state-native/getters_payload_header.go index ff27b8a7ab32..577105346c5a 100644 --- a/beacon-chain/state/state-native/getters_payload_header.go +++ b/beacon-chain/state/state-native/getters_payload_header.go @@ -5,8 +5,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -21,34 +19,14 @@ func (b *BeaconState) LatestExecutionPayloadHeader() (interfaces.ExecutionData, switch b.version { case version.Bellatrix: - return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeaderVal()) + return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeader.Copy()) case version.Capella: - return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapellaVal()) + return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapella.Copy()) case version.Deneb: - return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDenebVal()) + return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDeneb.Copy()) case version.Electra: - return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectraVal()) + return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectra.Copy()) default: return nil, fmt.Errorf("unsupported version (%s) for latest execution payload header", version.String(b.version)) } } - -// latestExecutionPayloadHeaderVal of the beacon state. -// This assumes that a lock is already held on BeaconState. -func (b *BeaconState) latestExecutionPayloadHeaderVal() *enginev1.ExecutionPayloadHeader { - return ethpb.CopyExecutionPayloadHeader(b.latestExecutionPayloadHeader) -} - -// latestExecutionPayloadHeaderCapellaVal of the beacon state. -// This assumes that a lock is already held on BeaconState. -func (b *BeaconState) latestExecutionPayloadHeaderCapellaVal() *enginev1.ExecutionPayloadHeaderCapella { - return ethpb.CopyExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapella) -} - -func (b *BeaconState) latestExecutionPayloadHeaderDenebVal() *enginev1.ExecutionPayloadHeaderDeneb { - return ethpb.CopyExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDeneb) -} - -func (b *BeaconState) latestExecutionPayloadHeaderElectraVal() *enginev1.ExecutionPayloadHeaderElectra { - return ethpb.CopyExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectra) -} diff --git a/beacon-chain/state/state-native/getters_state.go b/beacon-chain/state/state-native/getters_state.go index 65cae0787134..66f512369f9b 100644 --- a/beacon-chain/state/state-native/getters_state.go +++ b/beacon-chain/state/state-native/getters_state.go @@ -314,7 +314,7 @@ func (b *BeaconState) ToProto() interface{} { InactivityScores: inactivityScores, CurrentSyncCommittee: b.currentSyncCommitteeVal(), NextSyncCommittee: b.nextSyncCommitteeVal(), - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderVal(), + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeader.Copy(), } case version.Capella: return ðpb.BeaconStateCapella{ @@ -342,7 +342,7 @@ func (b *BeaconState) ToProto() interface{} { InactivityScores: inactivityScores, CurrentSyncCommittee: b.currentSyncCommitteeVal(), NextSyncCommittee: b.nextSyncCommitteeVal(), - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderCapellaVal(), + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderCapella.Copy(), NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummariesVal(), @@ -373,7 +373,7 @@ func (b *BeaconState) ToProto() interface{} { InactivityScores: b.inactivityScoresVal(), CurrentSyncCommittee: b.currentSyncCommitteeVal(), NextSyncCommittee: b.nextSyncCommitteeVal(), - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderDenebVal(), + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderDeneb.Copy(), NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummariesVal(), @@ -404,7 +404,7 @@ func (b *BeaconState) ToProto() interface{} { InactivityScores: b.inactivityScoresVal(), CurrentSyncCommittee: b.currentSyncCommitteeVal(), NextSyncCommittee: b.nextSyncCommitteeVal(), - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectraVal(), + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectra.Copy(), NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummariesVal(), diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 095fd9e52817..c1c052ed3fbe 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -907,10 +907,10 @@ func (b *BeaconState) Copy() state.BeaconState { finalizedCheckpoint: b.finalizedCheckpointVal(), currentSyncCommittee: b.currentSyncCommitteeVal(), nextSyncCommittee: b.nextSyncCommitteeVal(), - latestExecutionPayloadHeader: b.latestExecutionPayloadHeaderVal(), - latestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapellaVal(), - latestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDenebVal(), - latestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectraVal(), + latestExecutionPayloadHeader: b.latestExecutionPayloadHeader.Copy(), + latestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella.Copy(), + latestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb.Copy(), + latestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra.Copy(), id: types.Enumerator.Inc(), diff --git a/proto/engine/v1/execution_engine.go b/proto/engine/v1/execution_engine.go index fb03e21af6ea..5b9691184a5f 100644 --- a/proto/engine/v1/execution_engine.go +++ b/proto/engine/v1/execution_engine.go @@ -15,6 +15,7 @@ func copySlice[T any, C copier[T]](original []C) []T { return newSlice } +// Copy -- func (w *Withdrawal) Copy() *Withdrawal { if w == nil { return nil @@ -28,6 +29,7 @@ func (w *Withdrawal) Copy() *Withdrawal { } } +// Copy -- func (d *DepositRequest) Copy() *DepositRequest { if d == nil { return nil @@ -41,6 +43,7 @@ func (d *DepositRequest) Copy() *DepositRequest { } } +// Copy -- func (wr *WithdrawalRequest) Copy() *WithdrawalRequest { if wr == nil { return nil @@ -52,6 +55,7 @@ func (wr *WithdrawalRequest) Copy() *WithdrawalRequest { } } +// Copy -- func (cr *ConsolidationRequest) Copy() *ConsolidationRequest { if cr == nil { return nil @@ -63,6 +67,7 @@ func (cr *ConsolidationRequest) Copy() *ConsolidationRequest { } } +// Copy -- Electra func (payload *ExecutionPayloadElectra) Copy() *ExecutionPayloadElectra { if payload == nil { return nil @@ -90,3 +95,181 @@ func (payload *ExecutionPayloadElectra) Copy() *ExecutionPayloadElectra { ConsolidationRequests: copySlice(payload.ConsolidationRequests), } } + +// Copy -- Deneb +func (payload *ExecutionPayloadDeneb) Copy() *ExecutionPayloadDeneb { + if payload == nil { + return nil + } + return &ExecutionPayloadDeneb{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), + Withdrawals: copySlice(payload.Withdrawals), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + } +} + +// Copy -- Capella +func (payload *ExecutionPayloadCapella) Copy() *ExecutionPayloadCapella { + if payload == nil { + return nil + } + + return &ExecutionPayloadCapella{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), + Withdrawals: copySlice(payload.Withdrawals), + } +} + +// Copy -- Bellatrix +func (payload *ExecutionPayload) Copy() *ExecutionPayload { + if payload == nil { + return nil + } + + return &ExecutionPayload{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), + } +} + +// Copy -- Electra +func (payload *ExecutionPayloadHeaderElectra) Copy() *ExecutionPayloadHeaderElectra { + if payload == nil { + return nil + } + + return &ExecutionPayloadHeaderElectra{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), + WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + DepositRequestsRoot: bytesutil.SafeCopyBytes(payload.DepositRequestsRoot), + WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), + ConsolidationRequestsRoot: bytesutil.SafeCopyBytes(payload.ConsolidationRequestsRoot), + } +} + +// Copy -- Deneb +func (payload *ExecutionPayloadHeaderDeneb) Copy() *ExecutionPayloadHeaderDeneb { + if payload == nil { + return nil + } + return &ExecutionPayloadHeaderDeneb{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), + WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), + BlobGasUsed: payload.BlobGasUsed, + ExcessBlobGas: payload.ExcessBlobGas, + } +} + +// Copy -- Capella +func (payload *ExecutionPayloadHeaderCapella) Copy() *ExecutionPayloadHeaderCapella { + if payload == nil { + return nil + } + return &ExecutionPayloadHeaderCapella{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), + WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), + } +} + +// Copy -- Bellatrix +func (payload *ExecutionPayloadHeader) Copy() *ExecutionPayloadHeader { + if payload == nil { + return nil + } + return &ExecutionPayloadHeader{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), + BlockNumber: payload.BlockNumber, + GasLimit: payload.GasLimit, + GasUsed: payload.GasUsed, + Timestamp: payload.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), + } +} diff --git a/proto/engine/v1/execution_engine_fuzz_test.go b/proto/engine/v1/execution_engine_fuzz_test.go index 28d4fb9fa964..fbed9d9b6141 100644 --- a/proto/engine/v1/execution_engine_fuzz_test.go +++ b/proto/engine/v1/execution_engine_fuzz_test.go @@ -11,6 +11,16 @@ import ( func TestCopyExecutionPayload_Fuzz(t *testing.T) { fuzzCopies(t, &enginev1.ExecutionPayloadElectra{}) + fuzzCopies(t, &enginev1.ExecutionPayloadDeneb{}) + fuzzCopies(t, &enginev1.ExecutionPayloadCapella{}) + fuzzCopies(t, &enginev1.ExecutionPayload{}) +} + +func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) { + fuzzCopies(t, &enginev1.ExecutionPayloadHeaderElectra{}) + fuzzCopies(t, &enginev1.ExecutionPayloadHeaderDeneb{}) + fuzzCopies(t, &enginev1.ExecutionPayloadHeaderCapella{}) + fuzzCopies(t, &enginev1.ExecutionPayloadHeader{}) } func fuzzCopies[T any, C enginev1.Copier[T]](t *testing.T, obj C) { diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index 04009820059e..f8c4610ccf42 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -2,7 +2,6 @@ package eth import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ) // CopyETH1Data copies the provided eth1data object. @@ -474,7 +473,7 @@ func CopyBeaconBlockBodyBellatrix(body *BeaconBlockBodyBellatrix) *BeaconBlockBo Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayload: CopyExecutionPayload(body.ExecutionPayload), + ExecutionPayload: body.ExecutionPayload.Copy(), } } @@ -518,7 +517,7 @@ func CopyBeaconBlockBodyCapella(body *BeaconBlockBodyCapella) *BeaconBlockBodyCa Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayload: CopyExecutionPayloadCapella(body.ExecutionPayload), + ExecutionPayload: body.ExecutionPayload.Copy(), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), } } @@ -563,7 +562,7 @@ func CopyBlindedBeaconBlockBodyCapella(body *BlindedBeaconBlockBodyCapella) *Bli Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayloadHeader: CopyExecutionPayloadHeaderCapella(body.ExecutionPayloadHeader), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), } } @@ -608,7 +607,7 @@ func CopyBlindedBeaconBlockBodyDeneb(body *BlindedBeaconBlockBodyDeneb) *Blinded Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayloadHeader: CopyExecutionPayloadHeaderDeneb(body.ExecutionPayloadHeader), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } @@ -654,108 +653,12 @@ func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *Bli Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayloadHeader: CopyExecutionPayloadHeaderElectra(body.ExecutionPayloadHeader), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } -// CopyExecutionPayload copies the provided execution payload. -func CopyExecutionPayload(payload *enginev1.ExecutionPayload) *enginev1.ExecutionPayload { - if payload == nil { - return nil - } - - return &enginev1.ExecutionPayload{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - } -} - -// CopyExecutionPayloadCapella copies the provided execution payload. -func CopyExecutionPayloadCapella(payload *enginev1.ExecutionPayloadCapella) *enginev1.ExecutionPayloadCapella { - if payload == nil { - return nil - } - - return &enginev1.ExecutionPayloadCapella{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: copySlice(payload.Withdrawals), - } -} - -// CopyExecutionPayloadHeader copies the provided execution payload object. -func CopyExecutionPayloadHeader(payload *enginev1.ExecutionPayloadHeader) *enginev1.ExecutionPayloadHeader { - if payload == nil { - return nil - } - return &enginev1.ExecutionPayloadHeader{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), - } -} - -// CopyExecutionPayloadHeaderCapella copies the provided execution payload object. -func CopyExecutionPayloadHeaderCapella(payload *enginev1.ExecutionPayloadHeaderCapella) *enginev1.ExecutionPayloadHeaderCapella { - if payload == nil { - return nil - } - return &enginev1.ExecutionPayloadHeaderCapella{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), - WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), - } -} - // CopySignedBlindedBeaconBlockBellatrix copies the provided SignedBlindedBeaconBlockBellatrix. func CopySignedBlindedBeaconBlockBellatrix(sigBlock *SignedBlindedBeaconBlockBellatrix) *SignedBlindedBeaconBlockBellatrix { if sigBlock == nil { @@ -796,7 +699,7 @@ func CopyBlindedBeaconBlockBodyBellatrix(body *BlindedBeaconBlockBodyBellatrix) Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayloadHeader: CopyExecutionPayloadHeader(body.ExecutionPayloadHeader), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), } } @@ -865,64 +768,12 @@ func CopyBeaconBlockBodyDeneb(body *BeaconBlockBodyDeneb) *BeaconBlockBodyDeneb Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), - ExecutionPayload: CopyExecutionPayloadDeneb(body.ExecutionPayload), + ExecutionPayload: body.ExecutionPayload.Copy(), BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } -// CopyExecutionPayloadHeaderDeneb copies the provided execution payload object. -func CopyExecutionPayloadHeaderDeneb(payload *enginev1.ExecutionPayloadHeaderDeneb) *enginev1.ExecutionPayloadHeaderDeneb { - if payload == nil { - return nil - } - return &enginev1.ExecutionPayloadHeaderDeneb{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), - WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - } -} - -// CopyExecutionPayloadDeneb copies the provided execution payload. -func CopyExecutionPayloadDeneb(payload *enginev1.ExecutionPayloadDeneb) *enginev1.ExecutionPayloadDeneb { - if payload == nil { - return nil - } - return &enginev1.ExecutionPayloadDeneb{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: copySlice(payload.Withdrawals), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - } -} - // CopySignedBeaconBlockElectra copies the provided SignedBeaconBlockElectra. func CopySignedBeaconBlockElectra(sigBlock *SignedBeaconBlockElectra) *SignedBeaconBlockElectra { if sigBlock == nil { @@ -969,34 +820,6 @@ func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyEl } } -func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderElectra) *enginev1.ExecutionPayloadHeaderElectra { - if payload == nil { - return nil - } - return &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), - WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - DepositRequestsRoot: bytesutil.SafeCopyBytes(payload.DepositRequestsRoot), - WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), - ConsolidationRequestsRoot: bytesutil.SafeCopyBytes(payload.ConsolidationRequestsRoot), - } -} - // CopyHistoricalSummaries copies the historical summaries. func CopyHistoricalSummaries(summaries []*HistoricalSummary) []*HistoricalSummary { if summaries == nil { @@ -1055,16 +878,3 @@ func CopyPendingBalanceDeposits(pbd []*PendingBalanceDeposit) []*PendingBalanceD } return newPbd } - -type cloneable[T any] interface { - Copy() T -} - -func copySlice[T any, C cloneable[T]](original []C) []T { - // Create a new slice with the same length as the original - newSlice := make([]T, len(original)) - for i := 0; i < len(newSlice); i++ { - newSlice[i] = original[i].Copy() - } - return newSlice -} diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 22a348f31660..90dbdd450381 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -309,36 +309,6 @@ func TestCopyPendingAttestationSlice(t *testing.T) { } } -func TestCopyPayloadHeader(t *testing.T) { - p := genPayloadHeader() - - got := v1alpha1.CopyExecutionPayloadHeader(p) - if !reflect.DeepEqual(got, p) { - t.Errorf("CopyExecutionPayloadHeader() = %v, want %v", got, p) - } - assert.NotEmpty(t, got, "Copied execution payload header has empty fields") -} - -func TestCopyPayloadHeaderCapella(t *testing.T) { - p := genPayloadHeaderCapella() - - got := v1alpha1.CopyExecutionPayloadHeaderCapella(p) - if !reflect.DeepEqual(got, p) { - t.Errorf("TestCopyPayloadHeaderCapella() = %v, want %v", got, p) - } - assert.NotEmpty(t, got, "Copied execution payload header has empty fields") -} - -func TestCopyPayloadHeaderDeneb(t *testing.T) { - p := genPayloadHeaderDeneb() - - got := v1alpha1.CopyExecutionPayloadHeaderDeneb(p) - if !reflect.DeepEqual(got, p) { - t.Errorf("TestCopyPayloadHeaderDeneb() = %v, want %v", got, p) - } - assert.NotEmpty(t, got, "Copied execution payload header has empty fields") -} - func TestCopySignedBeaconBlockBellatrix(t *testing.T) { sbb := genSignedBeaconBlockBellatrix() @@ -638,15 +608,6 @@ func TestCopyBeaconBlockBodyElectra(t *testing.T) { } } -func TestCopyExecutionPayloadHeaderElectra(t *testing.T) { - p := genExecutionPayloadHeaderElectra() - - got := v1alpha1.CopyExecutionPayloadHeaderElectra(p) - if !reflect.DeepEqual(got, p) { - t.Errorf("TestCopyExecutionPayloadHeaderElectra() = %v, want %v", got, p) - } -} - func TestCopyPendingPartialWithdrawals(t *testing.T) { ppws := genPendingPartialWithdrawals(10) From aa868e5e8ca3dbf3b33608fe32b0750eb22bc025 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:39:48 -0500 Subject: [PATCH 211/325] remove eip6110flag for validator index cache (#14173) * using fork instead of eip6110flag for validator index cache * updating validator indicies on initialize from poroto unsafe * fixing bad version check * attempting to fix unit test * reverting test changes * changing incorrect initialization * updating comment * radek's comment' --- beacon-chain/blockchain/receive_block_test.go | 8 +-- beacon-chain/blockchain/service_test.go | 7 +- .../state/state-native/getters_validator.go | 2 +- .../state/state-native/setters_misc.go | 3 +- beacon-chain/state/state-native/state_trie.go | 66 ++++++++++--------- config/features/config.go | 10 +-- config/features/flags.go | 6 -- 7 files changed, 44 insertions(+), 58 deletions(-) diff --git a/beacon-chain/blockchain/receive_block_test.go b/beacon-chain/blockchain/receive_block_test.go index f6ec1745c9fe..1fdcb196e450 100644 --- a/beacon-chain/blockchain/receive_block_test.go +++ b/beacon-chain/blockchain/receive_block_test.go @@ -12,7 +12,6 @@ import ( statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/das" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/voluntaryexits" - "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -421,14 +420,9 @@ func Test_sendNewFinalizedEvent(t *testing.T) { } func Test_executePostFinalizationTasks(t *testing.T) { - resetFn := features.InitWithReset(&features.Flags{ - EIP6110ValidatorIndexCache: true, - }) - defer resetFn() - logHook := logTest.NewGlobal() - headState, err := util.NewBeaconState() + headState, err := util.NewBeaconStateElectra() require.NoError(t, err) finalizedStRoot, err := headState.HashTreeRoot(context.Background()) require.NoError(t, err) diff --git a/beacon-chain/blockchain/service_test.go b/beacon-chain/blockchain/service_test.go index 73be76f80e4d..a2bf18ac1485 100644 --- a/beacon-chain/blockchain/service_test.go +++ b/beacon-chain/blockchain/service_test.go @@ -503,16 +503,15 @@ func TestChainService_EverythingOptimistic(t *testing.T) { func TestStartFromSavedState_ValidatorIndexCacheUpdated(t *testing.T) { resetFn := features.InitWithReset(&features.Flags{ - EnableStartOptimistic: true, - EIP6110ValidatorIndexCache: true, + EnableStartOptimistic: true, }) defer resetFn() - genesis := util.NewBeaconBlock() + genesis := util.NewBeaconBlockElectra() genesisRoot, err := genesis.Block.HashTreeRoot() require.NoError(t, err) finalizedSlot := params.BeaconConfig().SlotsPerEpoch*2 + 1 - headBlock := util.NewBeaconBlock() + headBlock := util.NewBeaconBlockElectra() headBlock.Block.Slot = finalizedSlot headBlock.Block.ParentRoot = bytesutil.PadTo(genesisRoot[:], 32) headState, err := util.NewBeaconState() diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index 12bd1c45bb99..6acac6100040 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -180,7 +180,7 @@ func (b *BeaconState) ValidatorIndexByPubkey(key [fieldparams.BLSPubkeyLength]by b.lock.RLock() defer b.lock.RUnlock() - if features.Get().EIP6110ValidatorIndexCache { + if b.Version() >= version.Electra { return b.getValidatorIndex(key) } diff --git a/beacon-chain/state/state-native/setters_misc.go b/beacon-chain/state/state-native/setters_misc.go index 77d346fb4fc9..affd7ef520be 100644 --- a/beacon-chain/state/state-native/setters_misc.go +++ b/beacon-chain/state/state-native/setters_misc.go @@ -4,7 +4,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" - "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" @@ -110,7 +109,7 @@ func (b *BeaconState) SetHistoricalRoots(val [][]byte) error { // SaveValidatorIndices save validator indices of beacon chain to cache func (b *BeaconState) SaveValidatorIndices() { - if !features.Get().EIP6110ValidatorIndexCache { + if b.Version() < version.Electra { return } diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index c1c052ed3fbe..e4b3e29fdc10 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -189,11 +189,12 @@ func InitializeFromProtoUnsafePhase0(st *ethpb.BeaconState) (state.BeaconState, id: types.Enumerator.Inc(), - dirtyFields: make(map[types.FieldIndex]bool, fieldCount), - dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), - stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), - rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), - valMapHandler: stateutil.NewValMapHandler(st.Validators), + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + validatorIndexCache: newFinalizedValidatorIndexCache(), } if features.Get().EnableExperimentalState { @@ -295,11 +296,12 @@ func InitializeFromProtoUnsafeAltair(st *ethpb.BeaconStateAltair) (state.BeaconS id: types.Enumerator.Inc(), - dirtyFields: make(map[types.FieldIndex]bool, fieldCount), - dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), - stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), - rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), - valMapHandler: stateutil.NewValMapHandler(st.Validators), + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + validatorIndexCache: newFinalizedValidatorIndexCache(), } if features.Get().EnableExperimentalState { @@ -405,11 +407,12 @@ func InitializeFromProtoUnsafeBellatrix(st *ethpb.BeaconStateBellatrix) (state.B id: types.Enumerator.Inc(), - dirtyFields: make(map[types.FieldIndex]bool, fieldCount), - dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), - stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), - rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), - valMapHandler: stateutil.NewValMapHandler(st.Validators), + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + validatorIndexCache: newFinalizedValidatorIndexCache(), } if features.Get().EnableExperimentalState { @@ -519,11 +522,12 @@ func InitializeFromProtoUnsafeCapella(st *ethpb.BeaconStateCapella) (state.Beaco id: types.Enumerator.Inc(), - dirtyFields: make(map[types.FieldIndex]bool, fieldCount), - dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), - stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), - rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), - valMapHandler: stateutil.NewValMapHandler(st.Validators), + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + validatorIndexCache: newFinalizedValidatorIndexCache(), } if features.Get().EnableExperimentalState { @@ -632,11 +636,12 @@ func InitializeFromProtoUnsafeDeneb(st *ethpb.BeaconStateDeneb) (state.BeaconSta nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex, historicalSummaries: st.HistoricalSummaries, - dirtyFields: make(map[types.FieldIndex]bool, fieldCount), - dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), - stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), - rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), - valMapHandler: stateutil.NewValMapHandler(st.Validators), + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + validatorIndexCache: newFinalizedValidatorIndexCache(), } if features.Get().EnableExperimentalState { @@ -754,11 +759,12 @@ func InitializeFromProtoUnsafeElectra(st *ethpb.BeaconStateElectra) (state.Beaco pendingPartialWithdrawals: st.PendingPartialWithdrawals, pendingConsolidations: st.PendingConsolidations, - dirtyFields: make(map[types.FieldIndex]bool, fieldCount), - dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), - stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), - rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), - valMapHandler: stateutil.NewValMapHandler(st.Validators), + dirtyFields: make(map[types.FieldIndex]bool, fieldCount), + dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), + stateFieldLeaves: make(map[types.FieldIndex]*fieldtrie.FieldTrie, fieldCount), + rebuildTrie: make(map[types.FieldIndex]bool, fieldCount), + valMapHandler: stateutil.NewValMapHandler(st.Validators), + validatorIndexCache: newFinalizedValidatorIndexCache(), //only used in post-electra and only populates when finalizing, otherwise it falls back to processing the full validator set } if features.Get().EnableExperimentalState { diff --git a/config/features/config.go b/config/features/config.go index 3926af4a2f0d..98ae1ed49ebd 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -74,9 +74,8 @@ type Flags struct { // BlobSaveFsync requires blob saving to block on fsync to ensure blobs are durably persisted before passing DA. BlobSaveFsync bool - SaveInvalidBlock bool // SaveInvalidBlock saves invalid block to temp. - SaveInvalidBlob bool // SaveInvalidBlob saves invalid blob to temp. - EIP6110ValidatorIndexCache bool // EIP6110ValidatorIndexCache specifies whether to use the new validator index cache. + SaveInvalidBlock bool // SaveInvalidBlock saves invalid block to temp. + SaveInvalidBlob bool // SaveInvalidBlob saves invalid blob to temp. // KeystoreImportDebounceInterval specifies the time duration the validator waits to reload new keys if they have // changed on disk. This feature is for advanced use cases only. @@ -256,11 +255,6 @@ func ConfigureBeaconChain(ctx *cli.Context) error { cfg.EnableQUIC = true } - if ctx.IsSet(eip6110ValidatorCache.Name) { - logEnabled(eip6110ValidatorCache) - cfg.EIP6110ValidatorIndexCache = true - } - cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value} Init(cfg) return nil diff --git a/config/features/flags.go b/config/features/flags.go index 3c7314704434..af97adaaab8f 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -166,11 +166,6 @@ var ( Name: "enable-quic", Usage: "Enables connection using the QUIC protocol for peers which support it.", } - // eip6110ValidatorCache is a flag for enabling the EIP-6110 validator cache. - eip6110ValidatorCache = &cli.BoolFlag{ - Name: "eip6110-validator-cache", - Usage: "Enables the EIP-6110 validator cache.", - } ) // devModeFlags holds list of flags that are set when development mode is on. @@ -228,7 +223,6 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c EnableLightClient, BlobSaveFsync, EnableQUIC, - eip6110ValidatorCache, }...)...) // E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E. From 4d823acf453e77a4e9c6504b4732895f784f3da2 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:31:12 -0500 Subject: [PATCH 212/325] moving cloners to attestation.go and adding fuzzing (#14254) * moving cloners to attestation.go and adding fuzzing * fixing bazel * fixing build --- .../blockchain/process_attestation.go | 2 +- .../operations/attestations/kv/aggregated.go | 2 +- .../operations/attestations/kv/block.go | 2 +- .../operations/attestations/kv/forkchoice.go | 2 +- .../attestations/kv/unaggregated.go | 2 +- .../attestations/prepare_forkchoice.go | 2 +- .../rpc/prysm/v1alpha1/validator/attester.go | 4 +- .../validator/proposer_utils_bench_test.go | 2 +- .../state/state-native/getters_attestation.go | 20 +- .../state/state-native/getters_checkpoint.go | 6 +- .../state/state-native/references_test.go | 4 +- proto/prysm/v1alpha1/BUILD.bazel | 4 + proto/prysm/v1alpha1/attestation.go | 131 ++++++++++- .../aggregation/attestations/attestations.go | 4 +- .../aggregation/attestations/maxcover.go | 4 +- proto/prysm/v1alpha1/attestation_fuzz_test.go | 38 +++ proto/prysm/v1alpha1/cloners.go | 216 +++--------------- proto/prysm/v1alpha1/cloners_test.go | 107 +-------- proto/prysm/v1alpha1/export_test.go | 3 + 19 files changed, 239 insertions(+), 316 deletions(-) create mode 100644 proto/prysm/v1alpha1/attestation_fuzz_test.go create mode 100644 proto/prysm/v1alpha1/export_test.go diff --git a/beacon-chain/blockchain/process_attestation.go b/beacon-chain/blockchain/process_attestation.go index 19d2abd46c75..d4bd636b7783 100644 --- a/beacon-chain/blockchain/process_attestation.go +++ b/beacon-chain/blockchain/process_attestation.go @@ -46,7 +46,7 @@ func (s *Service) OnAttestation(ctx context.Context, a ethpb.Att, disparity time if err := helpers.ValidateSlotTargetEpoch(a.GetData()); err != nil { return err } - tgt := ethpb.CopyCheckpoint(a.GetData().Target) + tgt := a.GetData().Target.Copy() // Note that target root check is ignored here because it was performed in sync's validation pipeline: // validate_aggregate_proof.go and validate_beacon_attestation.go diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index 24a19e41d888..8d6081f280e3 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -145,7 +145,7 @@ func (c *AttCaches) SaveAggregatedAttestation(att ethpb.Att) error { if err != nil { return errors.Wrap(err, "could not create attestation ID") } - copiedAtt := att.Copy() + copiedAtt := att.Clone() c.aggregatedAttLock.Lock() defer c.aggregatedAttLock.Unlock() diff --git a/beacon-chain/operations/attestations/kv/block.go b/beacon-chain/operations/attestations/kv/block.go index 08d6f7ed90df..5f675bfad201 100644 --- a/beacon-chain/operations/attestations/kv/block.go +++ b/beacon-chain/operations/attestations/kv/block.go @@ -33,7 +33,7 @@ func (c *AttCaches) SaveBlockAttestation(att ethpb.Att) error { } } - c.blockAtt[id] = append(atts, att.Copy()) + c.blockAtt[id] = append(atts, att.Clone()) return nil } diff --git a/beacon-chain/operations/attestations/kv/forkchoice.go b/beacon-chain/operations/attestations/kv/forkchoice.go index 609d55f64c50..26bb0634ccbd 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice.go +++ b/beacon-chain/operations/attestations/kv/forkchoice.go @@ -42,7 +42,7 @@ func (c *AttCaches) ForkchoiceAttestations() []ethpb.Att { atts := make([]ethpb.Att, 0, len(c.forkchoiceAtt)) for _, att := range c.forkchoiceAtt { - atts = append(atts, att.Copy()) + atts = append(atts, att.Clone()) } return atts diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index 8ec2d171f49b..f49f666b561f 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -64,7 +64,7 @@ func (c *AttCaches) UnaggregatedAttestations() ([]ethpb.Att, error) { return nil, err } if !seen { - atts = append(atts, att.Copy()) + atts = append(atts, att.Clone()) } } return atts, nil diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index 38b69b9583dc..7eef4065c62f 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -106,7 +106,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { func (s *Service) aggregateAndSaveForkChoiceAtts(atts []ethpb.Att) error { clonedAtts := make([]ethpb.Att, len(atts)) for i, a := range atts { - clonedAtts[i] = a.Copy() + clonedAtts[i] = a.Clone() } aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index 2f0342c36e99..26ab6d7c7586 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -50,7 +50,7 @@ func (vs *Server) ProposeAttestation(ctx context.Context, att *ethpb.Attestation } go func() { - attCopy := ethpb.CopyAttestation(att) + attCopy := att.Copy() if err := vs.AttPool.SaveUnaggregatedAttestation(attCopy); err != nil { log.WithError(err).Error("Could not save unaggregated attestation") return @@ -84,7 +84,7 @@ func (vs *Server) ProposeAttestationElectra(ctx context.Context, att *ethpb.Atte go func() { ctx = trace.NewContext(context.Background(), trace.FromContext(ctx)) - attCopy := ethpb.CopyAttestationElectra(att) + attCopy := att.Copy() if err := vs.AttPool.SaveUnaggregatedAttestation(attCopy); err != nil { log.WithError(err).Error("Could not save unaggregated attestation") return diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go index c88b97a645e5..d1407a9b7b86 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go @@ -47,7 +47,7 @@ func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { runner := func(atts []ethpb.Att) { attsCopy := make(proposerAtts, len(atts)) for i, att := range atts { - attsCopy[i] = ethpb.CopyAttestation(att.(*ethpb.Attestation)) + attsCopy[i] = att.(*ethpb.Attestation).Copy() } _, err := attsCopy.sortByProfitability() require.NoError(b, err, "Could not sort attestations by profitability") diff --git a/beacon-chain/state/state-native/getters_attestation.go b/beacon-chain/state/state-native/getters_attestation.go index dcc387d0b11c..0139313018e1 100644 --- a/beacon-chain/state/state-native/getters_attestation.go +++ b/beacon-chain/state/state-native/getters_attestation.go @@ -24,7 +24,15 @@ func (b *BeaconState) PreviousEpochAttestations() ([]*ethpb.PendingAttestation, // previousEpochAttestationsVal corresponding to blocks on the beacon chain. // This assumes that a lock is already held on BeaconState. func (b *BeaconState) previousEpochAttestationsVal() []*ethpb.PendingAttestation { - return ethpb.CopyPendingAttestationSlice(b.previousEpochAttestations) + if b.previousEpochAttestations == nil { + return nil + } + + res := make([]*ethpb.PendingAttestation, len(b.previousEpochAttestations)) + for i := 0; i < len(res); i++ { + res[i] = b.previousEpochAttestations[i].Copy() + } + return res } // CurrentEpochAttestations corresponding to blocks on the beacon chain. @@ -46,5 +54,13 @@ func (b *BeaconState) CurrentEpochAttestations() ([]*ethpb.PendingAttestation, e // currentEpochAttestations corresponding to blocks on the beacon chain. // This assumes that a lock is already held on BeaconState. func (b *BeaconState) currentEpochAttestationsVal() []*ethpb.PendingAttestation { - return ethpb.CopyPendingAttestationSlice(b.currentEpochAttestations) + if b.currentEpochAttestations == nil { + return nil + } + + res := make([]*ethpb.PendingAttestation, len(b.currentEpochAttestations)) + for i := 0; i < len(res); i++ { + res[i] = b.currentEpochAttestations[i].Copy() + } + return res } diff --git a/beacon-chain/state/state-native/getters_checkpoint.go b/beacon-chain/state/state-native/getters_checkpoint.go index e7f753f16ede..a592f747a0be 100644 --- a/beacon-chain/state/state-native/getters_checkpoint.go +++ b/beacon-chain/state/state-native/getters_checkpoint.go @@ -47,7 +47,7 @@ func (b *BeaconState) PreviousJustifiedCheckpoint() *ethpb.Checkpoint { // previousJustifiedCheckpointVal denoting an epoch and block root. // This assumes that a lock is already held on BeaconState. func (b *BeaconState) previousJustifiedCheckpointVal() *ethpb.Checkpoint { - return ethpb.CopyCheckpoint(b.previousJustifiedCheckpoint) + return b.previousJustifiedCheckpoint.Copy() } // CurrentJustifiedCheckpoint denoting an epoch and block root. @@ -65,7 +65,7 @@ func (b *BeaconState) CurrentJustifiedCheckpoint() *ethpb.Checkpoint { // currentJustifiedCheckpointVal denoting an epoch and block root. // This assumes that a lock is already held on BeaconState. func (b *BeaconState) currentJustifiedCheckpointVal() *ethpb.Checkpoint { - return ethpb.CopyCheckpoint(b.currentJustifiedCheckpoint) + return b.currentJustifiedCheckpoint.Copy() } // MatchCurrentJustifiedCheckpoint returns true if input justified checkpoint matches @@ -109,7 +109,7 @@ func (b *BeaconState) FinalizedCheckpoint() *ethpb.Checkpoint { // finalizedCheckpointVal denoting an epoch and block root. // This assumes that a lock is already held on BeaconState. func (b *BeaconState) finalizedCheckpointVal() *ethpb.Checkpoint { - return ethpb.CopyCheckpoint(b.finalizedCheckpoint) + return b.finalizedCheckpoint.Copy() } // FinalizedCheckpointEpoch returns the epoch value of the finalized checkpoint. diff --git a/beacon-chain/state/state-native/references_test.go b/beacon-chain/state/state-native/references_test.go index 95066efb50e3..82596e11ccf3 100644 --- a/beacon-chain/state/state-native/references_test.go +++ b/beacon-chain/state/state-native/references_test.go @@ -789,7 +789,7 @@ func TestStateReferenceCopy_NoUnexpectedAttestationsMutation(t *testing.T) { currEpochAtts, err = state.CurrentEpochAttestations() require.NoError(t, err) for i := range currEpochAtts { - att := ethpb.CopyPendingAttestation(currEpochAtts[i]) + att := currEpochAtts[i].Copy() att.AggregationBits = bitfield.NewBitlist(3) currEpochAtts[i] = att } @@ -803,7 +803,7 @@ func TestStateReferenceCopy_NoUnexpectedAttestationsMutation(t *testing.T) { prevEpochAtts, err = state.PreviousEpochAttestations() require.NoError(t, err) for i := range prevEpochAtts { - att := ethpb.CopyPendingAttestation(prevEpochAtts[i]) + att := prevEpochAtts[i].Copy() att.AggregationBits = bitfield.NewBitlist(3) prevEpochAtts[i] = att } diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 75b3b0cfd48f..2acb80cafeec 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -371,10 +371,14 @@ ssz_proto_files( go_test( name = "go_default_test", srcs = [ + "attestation_fuzz_test.go", "cloners_test.go", + "export_test.go", ], embed = [":go_default_library"], deps = [ "//testing/assert:go_default_library", + "//testing/require:go_default_library", + "@com_github_google_gofuzz//:go_default_library", ], ) diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index 92b7f146ddef..d59d2cfcdb5d 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -4,6 +4,7 @@ import ( ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/runtime/version" "google.golang.org/protobuf/proto" ) @@ -15,7 +16,7 @@ type Att interface { ssz.Unmarshaler ssz.HashRoot Version() int - Copy() Att + Clone() Att GetAggregationBits() bitfield.Bitlist GetData() *AttestationData CommitteeBitsVal() bitfield.Bitfield @@ -68,14 +69,51 @@ type AttSlashing interface { SecondAttestation() IndexedAtt } +// Copy -- +func (cp *Checkpoint) Copy() *Checkpoint { + if cp == nil { + return nil + } + return &Checkpoint{ + Epoch: cp.Epoch, + Root: bytesutil.SafeCopyBytes(cp.Root), + } +} + +// Copy -- +func (attData *AttestationData) Copy() *AttestationData { + if attData == nil { + return nil + } + return &AttestationData{ + Slot: attData.Slot, + CommitteeIndex: attData.CommitteeIndex, + BeaconBlockRoot: bytesutil.SafeCopyBytes(attData.BeaconBlockRoot), + Source: attData.Source.Copy(), + Target: attData.Target.Copy(), + } +} + // Version -- func (a *Attestation) Version() int { return version.Phase0 } +// Clone -- +func (a *Attestation) Clone() Att { + return a.Copy() +} + // Copy -- -func (a *Attestation) Copy() Att { - return CopyAttestation(a) +func (att *Attestation) Copy() *Attestation { + if att == nil { + return nil + } + return &Attestation{ + AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits), + Data: att.Data.Copy(), + Signature: bytesutil.SafeCopyBytes(att.Signature), + } } // CommitteeBitsVal -- @@ -90,9 +128,22 @@ func (a *PendingAttestation) Version() int { return version.Phase0 } +// Clone -- +func (a *PendingAttestation) Clone() Att { + return a.Copy() +} + // Copy -- -func (a *PendingAttestation) Copy() Att { - return CopyPendingAttestation(a) +func (a *PendingAttestation) Copy() *PendingAttestation { + if a == nil { + return nil + } + return &PendingAttestation{ + AggregationBits: bytesutil.SafeCopyBytes(a.AggregationBits), + Data: a.Data.Copy(), + InclusionDelay: a.InclusionDelay, + ProposerIndex: a.ProposerIndex, + } } // CommitteeBitsVal -- @@ -110,9 +161,22 @@ func (a *AttestationElectra) Version() int { return version.Electra } +// Clone -- +func (a *AttestationElectra) Clone() Att { + return a.Copy() +} + // Copy -- -func (a *AttestationElectra) Copy() Att { - return CopyAttestationElectra(a) +func (att *AttestationElectra) Copy() *AttestationElectra { + if att == nil { + return nil + } + return &AttestationElectra{ + AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits), + CommitteeBits: bytesutil.SafeCopyBytes(att.CommitteeBits), + Data: att.Data.Copy(), + Signature: bytesutil.SafeCopyBytes(att.Signature), + } } // CommitteeBitsVal -- @@ -130,6 +194,38 @@ func (a *IndexedAttestationElectra) Version() int { return version.Electra } +// Copy -- +func (indexedAtt *IndexedAttestation) Copy() *IndexedAttestation { + var indices []uint64 + if indexedAtt == nil { + return nil + } else if indexedAtt.AttestingIndices != nil { + indices = make([]uint64, len(indexedAtt.AttestingIndices)) + copy(indices, indexedAtt.AttestingIndices) + } + return &IndexedAttestation{ + AttestingIndices: indices, + Data: indexedAtt.Data.Copy(), + Signature: bytesutil.SafeCopyBytes(indexedAtt.Signature), + } +} + +// Copy -- +func (indexedAtt *IndexedAttestationElectra) Copy() *IndexedAttestationElectra { + var indices []uint64 + if indexedAtt == nil { + return nil + } else if indexedAtt.AttestingIndices != nil { + indices = make([]uint64, len(indexedAtt.AttestingIndices)) + copy(indices, indexedAtt.AttestingIndices) + } + return &IndexedAttestationElectra{ + AttestingIndices: indices, + Data: indexedAtt.Data.Copy(), + Signature: bytesutil.SafeCopyBytes(indexedAtt.Signature), + } +} + // Version -- func (a *AttesterSlashing) Version() int { return version.Phase0 @@ -160,6 +256,27 @@ func (a *AttesterSlashingElectra) SecondAttestation() IndexedAtt { return a.Attestation_2 } +func (a *AttesterSlashing) Copy() *AttesterSlashing { + if a == nil { + return nil + } + return &AttesterSlashing{ + Attestation_1: a.Attestation_1.Copy(), + Attestation_2: a.Attestation_2.Copy(), + } +} + +// Copy -- +func (a *AttesterSlashingElectra) Copy() *AttesterSlashingElectra { + if a == nil { + return nil + } + return &AttesterSlashingElectra{ + Attestation_1: a.Attestation_1.Copy(), + Attestation_2: a.Attestation_2.Copy(), + } +} + // Version -- func (a *AggregateAttestationAndProof) Version() int { return version.Phase0 diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go index 8828687d8149..3f192d372bf6 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go @@ -83,8 +83,8 @@ func AggregatePair(a1, a2 *ethpb.Attestation) (*ethpb.Attestation, error) { return nil, aggregation.ErrBitsOverlap } - baseAtt := ethpb.CopyAttestation(a1) - newAtt := ethpb.CopyAttestation(a2) + baseAtt := a1.Copy() + newAtt := a2.Copy() if newAtt.AggregationBits.Count() > baseAtt.AggregationBits.Count() { baseAtt, newAtt = newAtt, baseAtt } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go index 7a95728b5802..2c1e6ea582c8 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go @@ -135,7 +135,7 @@ func (al attList) aggregate(coverage bitfield.Bitlist) (*ethpb.Attestation, erro } return ðpb.Attestation{ AggregationBits: coverage, - Data: ethpb.CopyAttestationData(al[0].GetData()), + Data: al[0].GetData().Copy(), Signature: aggregateSignatures(signs).Marshal(), }, nil } @@ -167,7 +167,7 @@ func aggregateAttestations(atts []ethpb.Att, keys []int, coverage *bitfield.Bitl } signs = append(signs, sig) if i == 0 { - data = ethpb.CopyAttestationData(atts[idx].GetData()) + data = atts[idx].GetData().Copy() targetIdx = idx } } diff --git a/proto/prysm/v1alpha1/attestation_fuzz_test.go b/proto/prysm/v1alpha1/attestation_fuzz_test.go new file mode 100644 index 000000000000..1334d0b62f51 --- /dev/null +++ b/proto/prysm/v1alpha1/attestation_fuzz_test.go @@ -0,0 +1,38 @@ +package eth_test + +import ( + "fmt" + "testing" + + fuzz "github.com/google/gofuzz" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) { + fuzzCopies(t, ð.Checkpoint{}) + fuzzCopies(t, ð.AttestationData{}) + fuzzCopies(t, ð.Attestation{}) + fuzzCopies(t, ð.AttestationElectra{}) + fuzzCopies(t, ð.PendingAttestation{}) + fuzzCopies(t, ð.IndexedAttestation{}) + fuzzCopies(t, ð.IndexedAttestationElectra{}) + fuzzCopies(t, ð.AttesterSlashing{}) + fuzzCopies(t, ð.AttesterSlashingElectra{}) +} + +func fuzzCopies[T any, C eth.Copier[T]](t *testing.T, obj C) { + fuzzer := fuzz.NewWithSeed(0) + amount := 1000 + t.Run(fmt.Sprintf("%T", obj), func(t *testing.T) { + for i := 0; i < amount; i++ { + fuzzer.Fuzz(obj) // Populate thing with random values + got := obj.Copy() + require.DeepEqual(t, obj, got) + // check shallow copy working + fuzzer.Fuzz(got) + require.DeepNotEqual(t, obj, got) + // TODO: think of deeper not equal fuzzing + } + }) +} diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index f8c4610ccf42..b5a1517f7872 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -4,6 +4,19 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) +type copier[T any] interface { + Copy() T +} + +func copySlice[T any, C copier[T]](original []C) []T { + // Create a new slice with the same length as the original + newSlice := make([]T, len(original)) + for i := 0; i < len(newSlice); i++ { + newSlice[i] = original[i].Copy() + } + return newSlice +} + // CopyETH1Data copies the provided eth1data object. func CopyETH1Data(data *Eth1Data) *Eth1Data { if data == nil { @@ -16,83 +29,6 @@ func CopyETH1Data(data *Eth1Data) *Eth1Data { } } -// CopyPendingAttestationSlice copies the provided slice of pending attestation objects. -func CopyPendingAttestationSlice(input []*PendingAttestation) []*PendingAttestation { - if input == nil { - return nil - } - - res := make([]*PendingAttestation, len(input)) - for i := 0; i < len(res); i++ { - res[i] = CopyPendingAttestation(input[i]) - } - return res -} - -// CopyPendingAttestation copies the provided pending attestation object. -func CopyPendingAttestation(att *PendingAttestation) *PendingAttestation { - if att == nil { - return nil - } - data := CopyAttestationData(att.Data) - return &PendingAttestation{ - AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits), - Data: data, - InclusionDelay: att.InclusionDelay, - ProposerIndex: att.ProposerIndex, - } -} - -// CopyAttestation copies the provided attestation object. -func CopyAttestation(att *Attestation) *Attestation { - if att == nil { - return nil - } - return &Attestation{ - AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits), - Data: CopyAttestationData(att.Data), - Signature: bytesutil.SafeCopyBytes(att.Signature), - } -} - -// CopyAttestationElectra copies the provided attestation object. -func CopyAttestationElectra(att *AttestationElectra) *AttestationElectra { - if att == nil { - return nil - } - return &AttestationElectra{ - AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits), - CommitteeBits: bytesutil.SafeCopyBytes(att.CommitteeBits), - Data: CopyAttestationData(att.Data), - Signature: bytesutil.SafeCopyBytes(att.Signature), - } -} - -// CopyAttestationData copies the provided AttestationData object. -func CopyAttestationData(attData *AttestationData) *AttestationData { - if attData == nil { - return nil - } - return &AttestationData{ - Slot: attData.Slot, - CommitteeIndex: attData.CommitteeIndex, - BeaconBlockRoot: bytesutil.SafeCopyBytes(attData.BeaconBlockRoot), - Source: CopyCheckpoint(attData.Source), - Target: CopyCheckpoint(attData.Target), - } -} - -// CopyCheckpoint copies the provided checkpoint. -func CopyCheckpoint(cp *Checkpoint) *Checkpoint { - if cp == nil { - return nil - } - return &Checkpoint{ - Epoch: cp.Epoch, - Root: bytesutil.SafeCopyBytes(cp.Root), - } -} - // CopySignedBeaconBlock copies the provided SignedBeaconBlock. func CopySignedBeaconBlock(sigBlock *SignedBeaconBlock) *SignedBeaconBlock { if sigBlock == nil { @@ -128,8 +64,8 @@ func CopyBeaconBlockBody(body *BeaconBlockBody) *BeaconBlockBody { Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), } @@ -170,8 +106,8 @@ func CopyBeaconBlockBodyAltair(body *BeaconBlockBodyAltair) *BeaconBlockBodyAlta Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -229,92 +165,6 @@ func CopyBeaconBlockHeader(header *BeaconBlockHeader) *BeaconBlockHeader { } } -// CopyAttesterSlashings copies the provided AttesterSlashings array. -func CopyAttesterSlashings(slashings []*AttesterSlashing) []*AttesterSlashing { - if slashings == nil { - return nil - } - newSlashings := make([]*AttesterSlashing, len(slashings)) - for i, slashing := range slashings { - newSlashings[i] = &AttesterSlashing{ - Attestation_1: CopyIndexedAttestation(slashing.Attestation_1), - Attestation_2: CopyIndexedAttestation(slashing.Attestation_2), - } - } - return newSlashings -} - -// CopyAttesterSlashingsElectra copies the provided AttesterSlashings array. -func CopyAttesterSlashingsElectra(slashings []*AttesterSlashingElectra) []*AttesterSlashingElectra { - if slashings == nil { - return nil - } - newSlashings := make([]*AttesterSlashingElectra, len(slashings)) - for i, slashing := range slashings { - newSlashings[i] = &AttesterSlashingElectra{ - Attestation_1: CopyIndexedAttestationElectra(slashing.Attestation_1), - Attestation_2: CopyIndexedAttestationElectra(slashing.Attestation_2), - } - } - return newSlashings -} - -// CopyIndexedAttestation copies the provided IndexedAttestation. -func CopyIndexedAttestation(indexedAtt *IndexedAttestation) *IndexedAttestation { - var indices []uint64 - if indexedAtt == nil { - return nil - } else if indexedAtt.AttestingIndices != nil { - indices = make([]uint64, len(indexedAtt.AttestingIndices)) - copy(indices, indexedAtt.AttestingIndices) - } - return &IndexedAttestation{ - AttestingIndices: indices, - Data: CopyAttestationData(indexedAtt.Data), - Signature: bytesutil.SafeCopyBytes(indexedAtt.Signature), - } -} - -// CopyIndexedAttestationElectra copies the provided IndexedAttestation. -func CopyIndexedAttestationElectra(indexedAtt *IndexedAttestationElectra) *IndexedAttestationElectra { - var indices []uint64 - if indexedAtt == nil { - return nil - } else if indexedAtt.AttestingIndices != nil { - indices = make([]uint64, len(indexedAtt.AttestingIndices)) - copy(indices, indexedAtt.AttestingIndices) - } - return &IndexedAttestationElectra{ - AttestingIndices: indices, - Data: CopyAttestationData(indexedAtt.Data), - Signature: bytesutil.SafeCopyBytes(indexedAtt.Signature), - } -} - -// CopyAttestations copies the provided Attestation array. -func CopyAttestations(attestations []*Attestation) []*Attestation { - if attestations == nil { - return nil - } - newAttestations := make([]*Attestation, len(attestations)) - for i, att := range attestations { - newAttestations[i] = CopyAttestation(att) - } - return newAttestations -} - -// CopyAttestations copies the provided AttestationElectra array. -func CopyAttestationsElectra(attestations []*AttestationElectra) []*AttestationElectra { - if attestations == nil { - return nil - } - newAttestations := make([]*AttestationElectra, len(attestations)) - for i, att := range attestations { - newAttestations[i] = CopyAttestationElectra(att) - } - return newAttestations -} - // CopyDeposits copies the provided deposit array. func CopyDeposits(deposits []*Deposit) []*Deposit { if deposits == nil { @@ -468,8 +318,8 @@ func CopyBeaconBlockBodyBellatrix(body *BeaconBlockBodyBellatrix) *BeaconBlockBo Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -512,8 +362,8 @@ func CopyBeaconBlockBodyCapella(body *BeaconBlockBodyCapella) *BeaconBlockBodyCa Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -557,8 +407,8 @@ func CopyBlindedBeaconBlockBodyCapella(body *BlindedBeaconBlockBodyCapella) *Bli Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -602,8 +452,8 @@ func CopyBlindedBeaconBlockBodyDeneb(body *BlindedBeaconBlockBodyDeneb) *Blinded Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -648,8 +498,8 @@ func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *Bli Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashingsElectra(body.AttesterSlashings), - Attestations: CopyAttestationsElectra(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -694,8 +544,8 @@ func CopyBlindedBeaconBlockBodyBellatrix(body *BlindedBeaconBlockBodyBellatrix) Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -763,8 +613,8 @@ func CopyBeaconBlockBodyDeneb(body *BeaconBlockBodyDeneb) *BeaconBlockBodyDeneb Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashings(body.AttesterSlashings), - Attestations: CopyAttestations(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), @@ -809,8 +659,8 @@ func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyEl Eth1Data: CopyETH1Data(body.Eth1Data), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: CopyAttesterSlashingsElectra(body.AttesterSlashings), - Attestations: CopyAttestationsElectra(body.Attestations), + AttesterSlashings: copySlice(body.AttesterSlashings), + Attestations: copySlice(body.Attestations), Deposits: CopyDeposits(body.Deposits), VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), SyncAggregate: CopySyncAggregate(body.SyncAggregate), diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 90dbdd450381..78baa17935d5 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -20,45 +20,6 @@ func TestCopyETH1Data(t *testing.T) { assert.NotEmpty(t, got, "Copied eth1data has empty fields") } -func TestCopyPendingAttestation(t *testing.T) { - pa := genPendingAttestation() - - got := v1alpha1.CopyPendingAttestation(pa) - if !reflect.DeepEqual(got, pa) { - t.Errorf("CopyPendingAttestation() = %v, want %v", got, pa) - } - assert.NotEmpty(t, got, "Copied pending attestation has empty fields") -} - -func TestCopyAttestation(t *testing.T) { - att := genAttestation() - - got := v1alpha1.CopyAttestation(att) - if !reflect.DeepEqual(got, att) { - t.Errorf("CopyAttestation() = %v, want %v", got, att) - } - assert.NotEmpty(t, got, "Copied attestation has empty fields") -} -func TestCopyAttestationData(t *testing.T) { - att := genAttData() - - got := v1alpha1.CopyAttestationData(att) - if !reflect.DeepEqual(got, att) { - t.Errorf("CopyAttestationData() = %v, want %v", got, att) - } - assert.NotEmpty(t, got, "Copied attestation data has empty fields") -} - -func TestCopyCheckpoint(t *testing.T) { - cp := genCheckpoint() - - got := v1alpha1.CopyCheckpoint(cp) - if !reflect.DeepEqual(got, cp) { - t.Errorf("CopyCheckpoint() = %v, want %v", got, cp) - } - assert.NotEmpty(t, got, "Copied checkpoint has empty fields") -} - func TestCopySignedBeaconBlock(t *testing.T) { blk := genSignedBeaconBlock() @@ -159,36 +120,6 @@ func TestCopyBeaconBlockHeader(t *testing.T) { assert.NotEmpty(t, got, "Copied beacon block header has empty fields") } -func TestCopyAttesterSlashings(t *testing.T) { - as := genAttesterSlashings(10) - - got := v1alpha1.CopyAttesterSlashings(as) - if !reflect.DeepEqual(got, as) { - t.Errorf("CopyAttesterSlashings() = %v, want %v", got, as) - } - assert.NotEmpty(t, got, "Copied attester slashings have empty fields") -} - -func TestCopyIndexedAttestation(t *testing.T) { - ia := genIndexedAttestation() - - got := v1alpha1.CopyIndexedAttestation(ia) - if !reflect.DeepEqual(got, ia) { - t.Errorf("CopyIndexedAttestation() = %v, want %v", got, ia) - } - assert.NotEmpty(t, got, "Copied indexed attestation has empty fields") -} - -func TestCopyAttestations(t *testing.T) { - atts := genAttestations(10) - - got := v1alpha1.CopyAttestations(atts) - if !reflect.DeepEqual(got, atts) { - t.Errorf("CopyAttestations() = %v, want %v", got, atts) - } - assert.NotEmpty(t, got, "Copied attestations have empty fields") -} - func TestCopyDeposits(t *testing.T) { d := genDeposits(10) @@ -302,7 +233,7 @@ func TestCopyPendingAttestationSlice(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := v1alpha1.CopyPendingAttestationSlice(tt.input); !reflect.DeepEqual(got, tt.input) { + if got := tt.input; !reflect.DeepEqual(got, tt.input) { t.Errorf("CopyPendingAttestationSlice() = %v, want %v", got, tt.input) } }) @@ -518,42 +449,6 @@ func TestCopyHistoricalSummaries(t *testing.T) { } } -func TestCopyAttestationElectra(t *testing.T) { - att := genAttestationElectra() - - got := v1alpha1.CopyAttestationElectra(att) - if !reflect.DeepEqual(got, att) { - t.Errorf("TestCopyAttestationElectra() = %v, want %v", got, att) - } -} - -func TestCopyAttesterSlashingsElectra(t *testing.T) { - as := genAttesterSlashingsElectra(10) - - got := v1alpha1.CopyAttesterSlashingsElectra(as) - if !reflect.DeepEqual(got, as) { - t.Errorf("TestCopyAttesterSlashingsElectra() = %v, want %v", got, as) - } -} - -func TestCopyIndexedAttestationElectra(t *testing.T) { - ia := genIndexedAttestationElectra() - - got := v1alpha1.CopyIndexedAttestationElectra(ia) - if !reflect.DeepEqual(got, ia) { - t.Errorf("TestCopyIndexedAttestationElectra() = %v, want %v", got, ia) - } -} - -func TestCopyAttestationsElectra(t *testing.T) { - atts := genAttestationsElectra(10) - - got := v1alpha1.CopyAttestationsElectra(atts) - if !reflect.DeepEqual(got, atts) { - t.Errorf("TestCopyAttestationsElectra() = %v, want %v", got, atts) - } -} - func TestCopySignedBlindedBeaconBlockElectra(t *testing.T) { sbb := genSignedBlindedBeaconBlockElectra() diff --git a/proto/prysm/v1alpha1/export_test.go b/proto/prysm/v1alpha1/export_test.go new file mode 100644 index 000000000000..4d944620a8d4 --- /dev/null +++ b/proto/prysm/v1alpha1/export_test.go @@ -0,0 +1,3 @@ +package eth + +type Copier[T any] copier[T] From b108d5bf541520e468cc6ab83615fc516df75b51 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:42:35 -0500 Subject: [PATCH 213/325] moving cloners to beacon_block.go and adding fuzzing (#14255) * moving beacon block fields from cloners to individual files and adding fuzzing tests * adding missed tests * fixing tests: * removing deep not equals for now * adding clarifying comment --- beacon-chain/core/blocks/eth1_data.go | 3 +- beacon-chain/core/blocks/eth1_data_test.go | 2 +- .../altair_transition_no_verify_sig_test.go | 4 +- ...bellatrix_transition_no_verify_sig_test.go | 4 +- .../state-native/getters_balance_deposits.go | 2 +- .../state-native/getters_consolidation.go | 2 +- .../state/state-native/getters_eth1.go | 4 +- .../state/state-native/getters_misc.go | 2 +- .../state/state-native/getters_withdrawal.go | 2 +- .../state/state-native/setters_block.go | 2 +- contracts/deposit/deposit.go | 2 +- proto/prysm/v1alpha1/BUILD.bazel | 5 + proto/prysm/v1alpha1/attestation_fuzz_test.go | 21 +- proto/prysm/v1alpha1/beacon_block.go | 156 ++++++++ .../prysm/v1alpha1/beacon_block_fuzz_test.go | 23 ++ proto/prysm/v1alpha1/cloners.go | 367 ++++-------------- proto/prysm/v1alpha1/cloners_test.go | 158 -------- proto/prysm/v1alpha1/eip_7521.go | 24 ++ proto/prysm/v1alpha1/eip_7521_fuzz_test.go | 12 + proto/prysm/v1alpha1/fuzz_test.go | 25 ++ 20 files changed, 336 insertions(+), 484 deletions(-) create mode 100644 proto/prysm/v1alpha1/beacon_block.go create mode 100644 proto/prysm/v1alpha1/beacon_block_fuzz_test.go create mode 100644 proto/prysm/v1alpha1/eip_7521.go create mode 100644 proto/prysm/v1alpha1/eip_7521_fuzz_test.go create mode 100644 proto/prysm/v1alpha1/fuzz_test.go diff --git a/beacon-chain/core/blocks/eth1_data.go b/beacon-chain/core/blocks/eth1_data.go index 11b06c903a45..7d44edb8f895 100644 --- a/beacon-chain/core/blocks/eth1_data.go +++ b/beacon-chain/core/blocks/eth1_data.go @@ -58,10 +58,9 @@ func AreEth1DataEqual(a, b *ethpb.Eth1Data) bool { // votes to see if they match the eth1data. func Eth1DataHasEnoughSupport(beaconState state.ReadOnlyBeaconState, data *ethpb.Eth1Data) (bool, error) { voteCount := uint64(0) - data = ethpb.CopyETH1Data(data) for _, vote := range beaconState.Eth1DataVotes() { - if AreEth1DataEqual(vote, data) { + if AreEth1DataEqual(vote, data.Copy()) { voteCount++ } } diff --git a/beacon-chain/core/blocks/eth1_data_test.go b/beacon-chain/core/blocks/eth1_data_test.go index 31e7295ecdda..aee84afb9192 100644 --- a/beacon-chain/core/blocks/eth1_data_test.go +++ b/beacon-chain/core/blocks/eth1_data_test.go @@ -186,7 +186,7 @@ func TestProcessEth1Data_SetsCorrectly(t *testing.T) { if len(newETH1DataVotes) <= 1 { t.Error("Expected new ETH1 data votes to have length > 1") } - if !proto.Equal(beaconState.Eth1Data(), ethpb.CopyETH1Data(b.Block.Body.Eth1Data)) { + if !proto.Equal(beaconState.Eth1Data(), b.Block.Body.Eth1Data.Copy()) { t.Errorf( "Expected latest eth1 data to have been set to %v, received %v", b.Block.Body.Eth1Data, diff --git a/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go b/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go index 783b37f9a9d3..d2ddb0b700fe 100644 --- a/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go +++ b/beacon-chain/core/transition/altair_transition_no_verify_sig_test.go @@ -70,7 +70,7 @@ func TestExecuteAltairStateTransitionNoVerify_FullProcess(t *testing.T) { } indices, err := altair.NextSyncCommitteeIndices(context.Background(), beaconState) require.NoError(t, err) - h := ethpb.CopyBeaconBlockHeader(beaconState.LatestBlockHeader()) + h := beaconState.LatestBlockHeader().Copy() prevStateRoot, err := beaconState.HashTreeRoot(context.Background()) require.NoError(t, err) h.StateRoot = prevStateRoot[:] @@ -157,7 +157,7 @@ func TestExecuteAltairStateTransitionNoVerifySignature_CouldNotVerifyStateRoot(t } indices, err := altair.NextSyncCommitteeIndices(context.Background(), beaconState) require.NoError(t, err) - h := ethpb.CopyBeaconBlockHeader(beaconState.LatestBlockHeader()) + h := beaconState.LatestBlockHeader().Copy() prevStateRoot, err := beaconState.HashTreeRoot(context.Background()) require.NoError(t, err) h.StateRoot = prevStateRoot[:] diff --git a/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go b/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go index cb36c1b8b223..bef3baa8a534 100644 --- a/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go +++ b/beacon-chain/core/transition/bellatrix_transition_no_verify_sig_test.go @@ -72,7 +72,7 @@ func TestExecuteBellatrixStateTransitionNoVerify_FullProcess(t *testing.T) { } indices, err := altair.NextSyncCommitteeIndices(context.Background(), beaconState) require.NoError(t, err) - h := ethpb.CopyBeaconBlockHeader(beaconState.LatestBlockHeader()) + h := beaconState.LatestBlockHeader().Copy() prevStateRoot, err := beaconState.HashTreeRoot(context.Background()) require.NoError(t, err) h.StateRoot = prevStateRoot[:] @@ -159,7 +159,7 @@ func TestExecuteBellatrixStateTransitionNoVerifySignature_CouldNotVerifyStateRoo } indices, err := altair.NextSyncCommitteeIndices(context.Background(), beaconState) require.NoError(t, err) - h := ethpb.CopyBeaconBlockHeader(beaconState.LatestBlockHeader()) + h := beaconState.LatestBlockHeader().Copy() prevStateRoot, err := beaconState.HashTreeRoot(context.Background()) require.NoError(t, err) h.StateRoot = prevStateRoot[:] diff --git a/beacon-chain/state/state-native/getters_balance_deposits.go b/beacon-chain/state/state-native/getters_balance_deposits.go index e7257dd0c270..b31b872f082e 100644 --- a/beacon-chain/state/state-native/getters_balance_deposits.go +++ b/beacon-chain/state/state-native/getters_balance_deposits.go @@ -35,5 +35,5 @@ func (b *BeaconState) pendingBalanceDepositsVal() []*ethpb.PendingBalanceDeposit return nil } - return ethpb.CopyPendingBalanceDeposits(b.pendingBalanceDeposits) + return ethpb.CopySlice(b.pendingBalanceDeposits) } diff --git a/beacon-chain/state/state-native/getters_consolidation.go b/beacon-chain/state/state-native/getters_consolidation.go index 0ec07328f5a0..b2b4abdd3fff 100644 --- a/beacon-chain/state/state-native/getters_consolidation.go +++ b/beacon-chain/state/state-native/getters_consolidation.go @@ -59,5 +59,5 @@ func (b *BeaconState) pendingConsolidationsVal() []*ethpb.PendingConsolidation { return nil } - return ethpb.CopyPendingConsolidations(b.pendingConsolidations) + return ethpb.CopySlice(b.pendingConsolidations) } diff --git a/beacon-chain/state/state-native/getters_eth1.go b/beacon-chain/state/state-native/getters_eth1.go index f81697abb5b4..c0450c543788 100644 --- a/beacon-chain/state/state-native/getters_eth1.go +++ b/beacon-chain/state/state-native/getters_eth1.go @@ -23,7 +23,7 @@ func (b *BeaconState) eth1DataVal() *ethpb.Eth1Data { return nil } - return ethpb.CopyETH1Data(b.eth1Data) + return b.eth1Data.Copy() } // Eth1DataVotes corresponds to votes from Ethereum on the canonical proof-of-work chain @@ -49,7 +49,7 @@ func (b *BeaconState) eth1DataVotesVal() []*ethpb.Eth1Data { res := make([]*ethpb.Eth1Data, len(b.eth1DataVotes)) for i := 0; i < len(res); i++ { - res[i] = ethpb.CopyETH1Data(b.eth1DataVotes[i]) + res[i] = b.eth1DataVotes[i].Copy() } return res } diff --git a/beacon-chain/state/state-native/getters_misc.go b/beacon-chain/state/state-native/getters_misc.go index 21f3de011736..89f165614ebb 100644 --- a/beacon-chain/state/state-native/getters_misc.go +++ b/beacon-chain/state/state-native/getters_misc.go @@ -103,5 +103,5 @@ func (b *BeaconState) HistoricalSummaries() ([]*ethpb.HistoricalSummary, error) // historicalSummariesVal of the beacon state. // This assumes that a lock is already held on BeaconState. func (b *BeaconState) historicalSummariesVal() []*ethpb.HistoricalSummary { - return ethpb.CopyHistoricalSummaries(b.historicalSummaries) + return ethpb.CopySlice(b.historicalSummaries) } diff --git a/beacon-chain/state/state-native/getters_withdrawal.go b/beacon-chain/state/state-native/getters_withdrawal.go index 116363c772d4..e2a26d029673 100644 --- a/beacon-chain/state/state-native/getters_withdrawal.go +++ b/beacon-chain/state/state-native/getters_withdrawal.go @@ -184,7 +184,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err } func (b *BeaconState) pendingPartialWithdrawalsVal() []*ethpb.PendingPartialWithdrawal { - return ethpb.CopyPendingPartialWithdrawals(b.pendingPartialWithdrawals) + return ethpb.CopySlice(b.pendingPartialWithdrawals) } func (b *BeaconState) NumPendingPartialWithdrawals() (uint64, error) { diff --git a/beacon-chain/state/state-native/setters_block.go b/beacon-chain/state/state-native/setters_block.go index 95e8414964c3..977c434094c7 100644 --- a/beacon-chain/state/state-native/setters_block.go +++ b/beacon-chain/state/state-native/setters_block.go @@ -15,7 +15,7 @@ func (b *BeaconState) SetLatestBlockHeader(val *ethpb.BeaconBlockHeader) error { b.lock.Lock() defer b.lock.Unlock() - b.latestBlockHeader = ethpb.CopyBeaconBlockHeader(val) + b.latestBlockHeader = val.Copy() b.markFieldAsDirty(types.LatestBlockHeader) return nil } diff --git a/contracts/deposit/deposit.go b/contracts/deposit/deposit.go index cd399a65e087..ff07d5d96ce5 100644 --- a/contracts/deposit/deposit.go +++ b/contracts/deposit/deposit.go @@ -81,7 +81,7 @@ func WithdrawalCredentialsHash(withdrawalKey bls.SecretKey) []byte { // VerifyDepositSignature verifies the correctness of Eth1 deposit BLS signature func VerifyDepositSignature(dd *ethpb.Deposit_Data, domain []byte) error { - ddCopy := ethpb.CopyDepositData(dd) + ddCopy := dd.Copy() publicKey, err := bls.PublicKeyFromBytes(ddCopy.PublicKey) if err != nil { return errors.Wrap(err, "could not convert bytes to public key") diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 2acb80cafeec..0c6f88327c1f 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -308,7 +308,9 @@ go_library( name = "go_default_library", srcs = [ "attestation.go", + "beacon_block.go", "cloners.go", + "eip_7521.go", "sync_committee_mainnet.go", "sync_committee_minimal.go", # keep ":ssz_generated_non_core", # keep @@ -372,8 +374,11 @@ go_test( name = "go_default_test", srcs = [ "attestation_fuzz_test.go", + "beacon_block_fuzz_test.go", "cloners_test.go", + "eip_7521_fuzz_test.go", "export_test.go", + "fuzz_test.go", ], embed = [":go_default_library"], deps = [ diff --git a/proto/prysm/v1alpha1/attestation_fuzz_test.go b/proto/prysm/v1alpha1/attestation_fuzz_test.go index 1334d0b62f51..174d509cdb00 100644 --- a/proto/prysm/v1alpha1/attestation_fuzz_test.go +++ b/proto/prysm/v1alpha1/attestation_fuzz_test.go @@ -1,15 +1,12 @@ package eth_test import ( - "fmt" "testing" - fuzz "github.com/google/gofuzz" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" ) -func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) { +func TestCopyAttestation_Fuzz(t *testing.T) { fuzzCopies(t, ð.Checkpoint{}) fuzzCopies(t, ð.AttestationData{}) fuzzCopies(t, ð.Attestation{}) @@ -20,19 +17,3 @@ func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) { fuzzCopies(t, ð.AttesterSlashing{}) fuzzCopies(t, ð.AttesterSlashingElectra{}) } - -func fuzzCopies[T any, C eth.Copier[T]](t *testing.T, obj C) { - fuzzer := fuzz.NewWithSeed(0) - amount := 1000 - t.Run(fmt.Sprintf("%T", obj), func(t *testing.T) { - for i := 0; i < amount; i++ { - fuzzer.Fuzz(obj) // Populate thing with random values - got := obj.Copy() - require.DeepEqual(t, obj, got) - // check shallow copy working - fuzzer.Fuzz(got) - require.DeepNotEqual(t, obj, got) - // TODO: think of deeper not equal fuzzing - } - }) -} diff --git a/proto/prysm/v1alpha1/beacon_block.go b/proto/prysm/v1alpha1/beacon_block.go new file mode 100644 index 000000000000..50171fa2dc7d --- /dev/null +++ b/proto/prysm/v1alpha1/beacon_block.go @@ -0,0 +1,156 @@ +package eth + +import "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + +// Copy -- +func (data *Eth1Data) Copy() *Eth1Data { + if data == nil { + return nil + } + return &Eth1Data{ + DepositRoot: bytesutil.SafeCopyBytes(data.DepositRoot), + DepositCount: data.DepositCount, + BlockHash: bytesutil.SafeCopyBytes(data.BlockHash), + } +} + +// Copy -- +func (slashing *ProposerSlashing) Copy() *ProposerSlashing { + if slashing == nil { + return nil + } + return &ProposerSlashing{ + Header_1: slashing.Header_1.Copy(), + Header_2: slashing.Header_2.Copy(), + } +} + +// Copy -- +func (header *SignedBeaconBlockHeader) Copy() *SignedBeaconBlockHeader { + if header == nil { + return nil + } + return &SignedBeaconBlockHeader{ + Header: header.Header.Copy(), + Signature: bytesutil.SafeCopyBytes(header.Signature), + } +} + +// Copy -- +func (header *BeaconBlockHeader) Copy() *BeaconBlockHeader { + if header == nil { + return nil + } + parentRoot := bytesutil.SafeCopyBytes(header.ParentRoot) + stateRoot := bytesutil.SafeCopyBytes(header.StateRoot) + bodyRoot := bytesutil.SafeCopyBytes(header.BodyRoot) + return &BeaconBlockHeader{ + Slot: header.Slot, + ProposerIndex: header.ProposerIndex, + ParentRoot: parentRoot, + StateRoot: stateRoot, + BodyRoot: bodyRoot, + } +} + +// Copy -- +func (deposit *Deposit) Copy() *Deposit { + if deposit == nil { + return nil + } + return &Deposit{ + Proof: bytesutil.SafeCopy2dBytes(deposit.Proof), + Data: deposit.Data.Copy(), + } +} + +// Copy -- +func (depData *Deposit_Data) Copy() *Deposit_Data { + if depData == nil { + return nil + } + return &Deposit_Data{ + PublicKey: bytesutil.SafeCopyBytes(depData.PublicKey), + WithdrawalCredentials: bytesutil.SafeCopyBytes(depData.WithdrawalCredentials), + Amount: depData.Amount, + Signature: bytesutil.SafeCopyBytes(depData.Signature), + } +} + +// Copy -- +func (exit *SignedVoluntaryExit) Copy() *SignedVoluntaryExit { + if exit == nil { + return nil + } + return &SignedVoluntaryExit{ + Exit: exit.Exit.Copy(), + Signature: bytesutil.SafeCopyBytes(exit.Signature), + } +} + +// Copy -- +func (exit *VoluntaryExit) Copy() *VoluntaryExit { + if exit == nil { + return nil + } + return &VoluntaryExit{ + Epoch: exit.Epoch, + ValidatorIndex: exit.ValidatorIndex, + } +} + +// Copy -- +func (a *SyncAggregate) Copy() *SyncAggregate { + if a == nil { + return nil + } + return &SyncAggregate{ + SyncCommitteeBits: bytesutil.SafeCopyBytes(a.SyncCommitteeBits), + SyncCommitteeSignature: bytesutil.SafeCopyBytes(a.SyncCommitteeSignature), + } +} + +// Copy -- +func (change *SignedBLSToExecutionChange) Copy() *SignedBLSToExecutionChange { + if change == nil { + return nil + } + return &SignedBLSToExecutionChange{ + Message: change.Message.Copy(), + Signature: bytesutil.SafeCopyBytes(change.Signature), + } +} + +// Copy -- +func (change *BLSToExecutionChange) Copy() *BLSToExecutionChange { + if change == nil { + return nil + } + return &BLSToExecutionChange{ + ValidatorIndex: change.ValidatorIndex, + FromBlsPubkey: bytesutil.SafeCopyBytes(change.FromBlsPubkey), + ToExecutionAddress: bytesutil.SafeCopyBytes(change.ToExecutionAddress), + } +} + +// Copy -- +func (summary *HistoricalSummary) Copy() *HistoricalSummary { + if summary == nil { + return nil + } + return &HistoricalSummary{ + BlockSummaryRoot: bytesutil.SafeCopyBytes(summary.BlockSummaryRoot), + StateSummaryRoot: bytesutil.SafeCopyBytes(summary.StateSummaryRoot), + } +} + +// Copy -- +func (pbd *PendingBalanceDeposit) Copy() *PendingBalanceDeposit { + if pbd == nil { + return nil + } + return &PendingBalanceDeposit{ + Index: pbd.Index, + Amount: pbd.Amount, + } +} diff --git a/proto/prysm/v1alpha1/beacon_block_fuzz_test.go b/proto/prysm/v1alpha1/beacon_block_fuzz_test.go new file mode 100644 index 000000000000..71b81db9fe85 --- /dev/null +++ b/proto/prysm/v1alpha1/beacon_block_fuzz_test.go @@ -0,0 +1,23 @@ +package eth_test + +import ( + "testing" + + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +func TestCopyBeaconBlockFields_Fuzz(t *testing.T) { + fuzzCopies(t, ð.Eth1Data{}) + fuzzCopies(t, ð.ProposerSlashing{}) + fuzzCopies(t, ð.SignedBeaconBlockHeader{}) + fuzzCopies(t, ð.BeaconBlockHeader{}) + fuzzCopies(t, ð.Deposit{}) + fuzzCopies(t, ð.Deposit_Data{}) + fuzzCopies(t, ð.SignedVoluntaryExit{}) + fuzzCopies(t, ð.VoluntaryExit{}) + fuzzCopies(t, ð.SyncAggregate{}) + fuzzCopies(t, ð.SignedBLSToExecutionChange{}) + fuzzCopies(t, ð.BLSToExecutionChange{}) + fuzzCopies(t, ð.HistoricalSummary{}) + fuzzCopies(t, ð.PendingBalanceDeposit{}) +} diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index b5a1517f7872..2104a0863fb9 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -8,7 +8,7 @@ type copier[T any] interface { Copy() T } -func copySlice[T any, C copier[T]](original []C) []T { +func CopySlice[T any, C copier[T]](original []C) []T { // Create a new slice with the same length as the original newSlice := make([]T, len(original)) for i := 0; i < len(newSlice); i++ { @@ -17,18 +17,6 @@ func copySlice[T any, C copier[T]](original []C) []T { return newSlice } -// CopyETH1Data copies the provided eth1data object. -func CopyETH1Data(data *Eth1Data) *Eth1Data { - if data == nil { - return nil - } - return &Eth1Data{ - DepositRoot: bytesutil.SafeCopyBytes(data.DepositRoot), - DepositCount: data.DepositCount, - BlockHash: bytesutil.SafeCopyBytes(data.BlockHash), - } -} - // CopySignedBeaconBlock copies the provided SignedBeaconBlock. func CopySignedBeaconBlock(sigBlock *SignedBeaconBlock) *SignedBeaconBlock { if sigBlock == nil { @@ -61,13 +49,13 @@ func CopyBeaconBlockBody(body *BeaconBlockBody) *BeaconBlockBody { } return &BeaconBlockBody{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), } } @@ -103,127 +91,14 @@ func CopyBeaconBlockBodyAltair(body *BeaconBlockBodyAltair) *BeaconBlockBodyAlta } return &BeaconBlockBodyAltair{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), - } -} - -// CopyProposerSlashings copies the provided ProposerSlashing array. -func CopyProposerSlashings(slashings []*ProposerSlashing) []*ProposerSlashing { - if slashings == nil { - return nil - } - newSlashings := make([]*ProposerSlashing, len(slashings)) - for i, att := range slashings { - newSlashings[i] = CopyProposerSlashing(att) - } - return newSlashings -} - -// CopyProposerSlashing copies the provided ProposerSlashing. -func CopyProposerSlashing(slashing *ProposerSlashing) *ProposerSlashing { - if slashing == nil { - return nil - } - return &ProposerSlashing{ - Header_1: CopySignedBeaconBlockHeader(slashing.Header_1), - Header_2: CopySignedBeaconBlockHeader(slashing.Header_2), - } -} - -// CopySignedBeaconBlockHeader copies the provided SignedBeaconBlockHeader. -func CopySignedBeaconBlockHeader(header *SignedBeaconBlockHeader) *SignedBeaconBlockHeader { - if header == nil { - return nil - } - return &SignedBeaconBlockHeader{ - Header: CopyBeaconBlockHeader(header.Header), - Signature: bytesutil.SafeCopyBytes(header.Signature), - } -} - -// CopyBeaconBlockHeader copies the provided BeaconBlockHeader. -func CopyBeaconBlockHeader(header *BeaconBlockHeader) *BeaconBlockHeader { - if header == nil { - return nil - } - parentRoot := bytesutil.SafeCopyBytes(header.ParentRoot) - stateRoot := bytesutil.SafeCopyBytes(header.StateRoot) - bodyRoot := bytesutil.SafeCopyBytes(header.BodyRoot) - return &BeaconBlockHeader{ - Slot: header.Slot, - ProposerIndex: header.ProposerIndex, - ParentRoot: parentRoot, - StateRoot: stateRoot, - BodyRoot: bodyRoot, - } -} - -// CopyDeposits copies the provided deposit array. -func CopyDeposits(deposits []*Deposit) []*Deposit { - if deposits == nil { - return nil - } - newDeposits := make([]*Deposit, len(deposits)) - for i, dep := range deposits { - newDeposits[i] = CopyDeposit(dep) - } - return newDeposits -} - -// CopyDeposit copies the provided deposit. -func CopyDeposit(deposit *Deposit) *Deposit { - if deposit == nil { - return nil - } - return &Deposit{ - Proof: bytesutil.SafeCopy2dBytes(deposit.Proof), - Data: CopyDepositData(deposit.Data), - } -} - -// CopyDepositData copies the provided deposit data. -func CopyDepositData(depData *Deposit_Data) *Deposit_Data { - if depData == nil { - return nil - } - return &Deposit_Data{ - PublicKey: bytesutil.SafeCopyBytes(depData.PublicKey), - WithdrawalCredentials: bytesutil.SafeCopyBytes(depData.WithdrawalCredentials), - Amount: depData.Amount, - Signature: bytesutil.SafeCopyBytes(depData.Signature), - } -} - -// CopySignedVoluntaryExits copies the provided SignedVoluntaryExits array. -func CopySignedVoluntaryExits(exits []*SignedVoluntaryExit) []*SignedVoluntaryExit { - if exits == nil { - return nil - } - newExits := make([]*SignedVoluntaryExit, len(exits)) - for i, exit := range exits { - newExits[i] = CopySignedVoluntaryExit(exit) - } - return newExits -} - -// CopySignedVoluntaryExit copies the provided SignedVoluntaryExit. -func CopySignedVoluntaryExit(exit *SignedVoluntaryExit) *SignedVoluntaryExit { - if exit == nil { - return nil - } - return &SignedVoluntaryExit{ - Exit: &VoluntaryExit{ - Epoch: exit.Exit.Epoch, - ValidatorIndex: exit.Exit.ValidatorIndex, - }, - Signature: bytesutil.SafeCopyBytes(exit.Signature), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), } } @@ -272,17 +147,6 @@ func CopySyncCommitteeContribution(c *SyncCommitteeContribution) *SyncCommitteeC } } -// CopySyncAggregate copies the provided sync aggregate object. -func CopySyncAggregate(a *SyncAggregate) *SyncAggregate { - if a == nil { - return nil - } - return &SyncAggregate{ - SyncCommitteeBits: bytesutil.SafeCopyBytes(a.SyncCommitteeBits), - SyncCommitteeSignature: bytesutil.SafeCopyBytes(a.SyncCommitteeSignature), - } -} - // CopySignedBeaconBlockBellatrix copies the provided SignedBeaconBlockBellatrix. func CopySignedBeaconBlockBellatrix(sigBlock *SignedBeaconBlockBellatrix) *SignedBeaconBlockBellatrix { if sigBlock == nil { @@ -315,14 +179,14 @@ func CopyBeaconBlockBodyBellatrix(body *BeaconBlockBodyBellatrix) *BeaconBlockBo } return &BeaconBlockBodyBellatrix{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayload: body.ExecutionPayload.Copy(), } } @@ -359,16 +223,16 @@ func CopyBeaconBlockBodyCapella(body *BeaconBlockBodyCapella) *BeaconBlockBodyCa } return &BeaconBlockBodyCapella{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayload: body.ExecutionPayload.Copy(), - BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), } } @@ -404,16 +268,16 @@ func CopyBlindedBeaconBlockBodyCapella(body *BlindedBeaconBlockBodyCapella) *Bli } return &BlindedBeaconBlockBodyCapella{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), } } @@ -449,16 +313,16 @@ func CopyBlindedBeaconBlockBodyDeneb(body *BlindedBeaconBlockBodyDeneb) *Blinded } return &BlindedBeaconBlockBodyDeneb{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } @@ -495,16 +359,16 @@ func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *Bli } return &BlindedBeaconBlockBodyElectra{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } @@ -541,38 +405,18 @@ func CopyBlindedBeaconBlockBodyBellatrix(body *BlindedBeaconBlockBodyBellatrix) } return &BlindedBeaconBlockBodyBellatrix{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), } } -func CopyBLSToExecutionChanges(changes []*SignedBLSToExecutionChange) []*SignedBLSToExecutionChange { - if changes == nil { - return nil - } - - res := make([]*SignedBLSToExecutionChange, len(changes)) - for i := 0; i < len(changes); i++ { - res[i] = &SignedBLSToExecutionChange{ - Message: &BLSToExecutionChange{ - ValidatorIndex: changes[i].Message.ValidatorIndex, - FromBlsPubkey: bytesutil.SafeCopyBytes(changes[i].Message.FromBlsPubkey), - ToExecutionAddress: bytesutil.SafeCopyBytes(changes[i].Message.ToExecutionAddress), - }, - Signature: bytesutil.SafeCopyBytes(changes[i].Signature), - } - } - - return res -} - // CopyBlobKZGs copies the provided blob kzgs object. func CopyBlobKZGs(b [][]byte) [][]byte { return bytesutil.SafeCopy2dBytes(b) @@ -610,16 +454,16 @@ func CopyBeaconBlockBodyDeneb(body *BeaconBlockBodyDeneb) *BeaconBlockBodyDeneb } return &BeaconBlockBodyDeneb{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayload: body.ExecutionPayload.Copy(), - BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } @@ -656,75 +500,16 @@ func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyEl } return &BeaconBlockBodyElectra{ RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: CopyETH1Data(body.Eth1Data), + Eth1Data: body.Eth1Data.Copy(), Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings), - AttesterSlashings: copySlice(body.AttesterSlashings), - Attestations: copySlice(body.Attestations), - Deposits: CopyDeposits(body.Deposits), - VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits), - SyncAggregate: CopySyncAggregate(body.SyncAggregate), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), ExecutionPayload: body.ExecutionPayload.Copy(), - BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), } } - -// CopyHistoricalSummaries copies the historical summaries. -func CopyHistoricalSummaries(summaries []*HistoricalSummary) []*HistoricalSummary { - if summaries == nil { - return nil - } - newSummaries := make([]*HistoricalSummary, len(summaries)) - for i, s := range summaries { - newSummaries[i] = &HistoricalSummary{ - BlockSummaryRoot: bytesutil.SafeCopyBytes(s.BlockSummaryRoot), - StateSummaryRoot: bytesutil.SafeCopyBytes(s.StateSummaryRoot), - } - } - return newSummaries -} - -// CopyPartialWithdrawals copies the provided partial withdrawals. -func CopyPendingPartialWithdrawals(pws []*PendingPartialWithdrawal) []*PendingPartialWithdrawal { - if pws == nil { - return nil - } - newPws := make([]*PendingPartialWithdrawal, len(pws)) - for i, pw := range pws { - newPws[i] = &PendingPartialWithdrawal{ - Index: pw.Index, - Amount: pw.Amount, - WithdrawableEpoch: pw.WithdrawableEpoch, - } - } - return newPws -} - -func CopyPendingConsolidations(pcs []*PendingConsolidation) []*PendingConsolidation { - if pcs == nil { - return nil - } - newPcs := make([]*PendingConsolidation, len(pcs)) - for i, pc := range pcs { - newPcs[i] = &PendingConsolidation{ - SourceIndex: pc.SourceIndex, - TargetIndex: pc.TargetIndex, - } - } - return newPcs -} - -func CopyPendingBalanceDeposits(pbd []*PendingBalanceDeposit) []*PendingBalanceDeposit { - if pbd == nil { - return nil - } - newPbd := make([]*PendingBalanceDeposit, len(pbd)) - for i, pb := range pbd { - newPbd[i] = &PendingBalanceDeposit{ - Index: pb.Index, - Amount: pb.Amount, - } - } - return newPbd -} diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 78baa17935d5..1cffb5d49ed3 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -10,16 +10,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" ) -func TestCopyETH1Data(t *testing.T) { - data := genEth1Data() - - got := v1alpha1.CopyETH1Data(data) - if !reflect.DeepEqual(got, data) { - t.Errorf("CopyETH1Data() = %v, want %v", got, data) - } - assert.NotEmpty(t, got, "Copied eth1data has empty fields") -} - func TestCopySignedBeaconBlock(t *testing.T) { blk := genSignedBeaconBlock() @@ -80,96 +70,6 @@ func TestCopyBeaconBlockBodyAltair(t *testing.T) { assert.NotEmpty(t, bb, "Copied beacon block body altair has empty fields") } -func TestCopyProposerSlashings(t *testing.T) { - ps := genProposerSlashings(10) - - got := v1alpha1.CopyProposerSlashings(ps) - if !reflect.DeepEqual(got, ps) { - t.Errorf("CopyProposerSlashings() = %v, want %v", got, ps) - } - assert.NotEmpty(t, got, "Copied proposer slashings have empty fields") -} - -func TestCopyProposerSlashing(t *testing.T) { - ps := genProposerSlashing() - - got := v1alpha1.CopyProposerSlashing(ps) - if !reflect.DeepEqual(got, ps) { - t.Errorf("CopyProposerSlashing() = %v, want %v", got, ps) - } - assert.NotEmpty(t, got, "Copied proposer slashing has empty fields") -} - -func TestCopySignedBeaconBlockHeader(t *testing.T) { - sbh := genSignedBeaconBlockHeader() - - got := v1alpha1.CopySignedBeaconBlockHeader(sbh) - if !reflect.DeepEqual(got, sbh) { - t.Errorf("CopySignedBeaconBlockHeader() = %v, want %v", got, sbh) - } - assert.NotEmpty(t, got, "Copied signed beacon block header has empty fields") -} - -func TestCopyBeaconBlockHeader(t *testing.T) { - bh := genBeaconBlockHeader() - - got := v1alpha1.CopyBeaconBlockHeader(bh) - if !reflect.DeepEqual(got, bh) { - t.Errorf("CopyBeaconBlockHeader() = %v, want %v", got, bh) - } - assert.NotEmpty(t, got, "Copied beacon block header has empty fields") -} - -func TestCopyDeposits(t *testing.T) { - d := genDeposits(10) - - got := v1alpha1.CopyDeposits(d) - if !reflect.DeepEqual(got, d) { - t.Errorf("CopyDeposits() = %v, want %v", got, d) - } - assert.NotEmpty(t, got, "Copied deposits have empty fields") -} - -func TestCopyDeposit(t *testing.T) { - d := genDeposit() - - got := v1alpha1.CopyDeposit(d) - if !reflect.DeepEqual(got, d) { - t.Errorf("CopyDeposit() = %v, want %v", got, d) - } - assert.NotEmpty(t, got, "Copied deposit has empty fields") -} - -func TestCopyDepositData(t *testing.T) { - dd := genDepositData() - - got := v1alpha1.CopyDepositData(dd) - if !reflect.DeepEqual(got, dd) { - t.Errorf("CopyDepositData() = %v, want %v", got, dd) - } - assert.NotEmpty(t, got, "Copied deposit data has empty fields") -} - -func TestCopySignedVoluntaryExits(t *testing.T) { - sv := genSignedVoluntaryExits(10) - - got := v1alpha1.CopySignedVoluntaryExits(sv) - if !reflect.DeepEqual(got, sv) { - t.Errorf("CopySignedVoluntaryExits() = %v, want %v", got, sv) - } - assert.NotEmpty(t, got, "Copied signed voluntary exits have empty fields") -} - -func TestCopySignedVoluntaryExit(t *testing.T) { - sv := genSignedVoluntaryExit() - - got := v1alpha1.CopySignedVoluntaryExit(sv) - if !reflect.DeepEqual(got, sv) { - t.Errorf("CopySignedVoluntaryExit() = %v, want %v", got, sv) - } - assert.NotEmpty(t, got, "Copied signed voluntary exit has empty fields") -} - func TestCopyValidator(t *testing.T) { v := genValidator() @@ -200,16 +100,6 @@ func TestCopySyncCommitteeContribution(t *testing.T) { assert.NotEmpty(t, got, "Copied sync committee contribution has empty fields") } -func TestCopySyncAggregate(t *testing.T) { - sa := genSyncAggregate() - - got := v1alpha1.CopySyncAggregate(sa) - if !reflect.DeepEqual(got, sa) { - t.Errorf("CopySyncAggregate() = %v, want %v", got, sa) - } - assert.NotEmpty(t, got, "Copied sync aggregate has empty fields") -} - func TestCopyPendingAttestationSlice(t *testing.T) { tests := []struct { name string @@ -428,27 +318,6 @@ func bytes(length int) []byte { return b } -func TestCopyBLSToExecutionChanges(t *testing.T) { - changes := genBLSToExecutionChanges(10) - - got := v1alpha1.CopyBLSToExecutionChanges(changes) - if !reflect.DeepEqual(got, changes) { - t.Errorf("TestCopyBLSToExecutionChanges() = %v, want %v", got, changes) - } -} - -func TestCopyHistoricalSummaries(t *testing.T) { - summaries := []*v1alpha1.HistoricalSummary{ - {BlockSummaryRoot: []byte("block summary root 0"), StateSummaryRoot: []byte("state summary root 0")}, - {BlockSummaryRoot: []byte("block summary root 1"), StateSummaryRoot: []byte("state summary root 1")}, - } - - got := v1alpha1.CopyHistoricalSummaries(summaries) - if !reflect.DeepEqual(got, summaries) { - t.Errorf("TestCopyHistoricalSummariesing() = %v, want %v", got, summaries) - } -} - func TestCopySignedBlindedBeaconBlockElectra(t *testing.T) { sbb := genSignedBlindedBeaconBlockElectra() @@ -503,33 +372,6 @@ func TestCopyBeaconBlockBodyElectra(t *testing.T) { } } -func TestCopyPendingPartialWithdrawals(t *testing.T) { - ppws := genPendingPartialWithdrawals(10) - - got := v1alpha1.CopyPendingPartialWithdrawals(ppws) - if !reflect.DeepEqual(got, ppws) { - t.Errorf("TestCopyPendingPartialWithdrawals() = %v, want %v", got, ppws) - } -} - -func TestCopyPendingConsolidations(t *testing.T) { - pcs := genPendingConsolidations(10) - - got := v1alpha1.CopyPendingConsolidations(pcs) - if !reflect.DeepEqual(got, pcs) { - t.Errorf("TestCopyPendingConsolidations() = %v, want %v", got, pcs) - } -} - -func TestCopyPendingBalanceDeposits(t *testing.T) { - pbds := genPendingBalanceDeposits(10) - - got := v1alpha1.CopyPendingBalanceDeposits(pbds) - if !reflect.DeepEqual(got, pbds) { - t.Errorf("TestCopyPendingBalanceDeposits() = %v, want %v", got, pbds) - } -} - func genAttestation() *v1alpha1.Attestation { return &v1alpha1.Attestation{ AggregationBits: bytes(32), diff --git a/proto/prysm/v1alpha1/eip_7521.go b/proto/prysm/v1alpha1/eip_7521.go new file mode 100644 index 000000000000..473ab2de9882 --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7521.go @@ -0,0 +1,24 @@ +package eth + +// Copy -- +func (pw *PendingPartialWithdrawal) Copy() *PendingPartialWithdrawal { + if pw == nil { + return nil + } + return &PendingPartialWithdrawal{ + Index: pw.Index, + Amount: pw.Amount, + WithdrawableEpoch: pw.WithdrawableEpoch, + } +} + +// Copy -- +func (pc *PendingConsolidation) Copy() *PendingConsolidation { + if pc == nil { + return nil + } + return &PendingConsolidation{ + SourceIndex: pc.SourceIndex, + TargetIndex: pc.TargetIndex, + } +} diff --git a/proto/prysm/v1alpha1/eip_7521_fuzz_test.go b/proto/prysm/v1alpha1/eip_7521_fuzz_test.go new file mode 100644 index 000000000000..5123be544d75 --- /dev/null +++ b/proto/prysm/v1alpha1/eip_7521_fuzz_test.go @@ -0,0 +1,12 @@ +package eth_test + +import ( + "testing" + + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +func TestCopyEip7521Types_Fuzz(t *testing.T) { + fuzzCopies(t, ð.PendingPartialWithdrawal{}) + fuzzCopies(t, ð.PendingConsolidation{}) +} diff --git a/proto/prysm/v1alpha1/fuzz_test.go b/proto/prysm/v1alpha1/fuzz_test.go new file mode 100644 index 000000000000..53b663cd298f --- /dev/null +++ b/proto/prysm/v1alpha1/fuzz_test.go @@ -0,0 +1,25 @@ +package eth_test + +import ( + "fmt" + "testing" + + fuzz "github.com/google/gofuzz" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func fuzzCopies[T any, C eth.Copier[T]](t *testing.T, obj C) { + fuzzer := fuzz.NewWithSeed(0) + amount := 1000 + t.Run(fmt.Sprintf("%T", obj), func(t *testing.T) { + for i := 0; i < amount; i++ { + fuzzer.Fuzz(obj) // Populate thing with random values + + got := obj.Copy() + require.DeepEqual(t, obj, got) + // TODO: add deep fuzzing and checks for deep not equals + // we should test that modifying the copy doesn't modify the original object + } + }) +} From cd8907f76cd8a6626fc0a57eeb583ac4e57717ef Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:46:53 +0530 Subject: [PATCH 214/325] feat: implement ``is_better_update`` for light client (#14186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: implement ``is_better_update`` for light client * replace ``!=`` with ``!reflect.DeepEqual`` * chore: import constant instead of redeclaring and some minor fixes * feat: add test for ``newHasSupermajority != oldHasSupermajority`` * chore: capitalise first letter of function names * refactor: rewrite test setups in a more readable manner * two test cases * feat: add tests for ``IsBetterUpdate`` * refactor: remove double import * wording fix 1 Co-authored-by: Radosław Kapka * wording fix 2 Co-authored-by: Radosław Kapka * minor fixes * fix: change function names to lowercase and fix dependencies --------- Co-authored-by: rkapka Co-authored-by: Radosław Kapka --- beacon-chain/blockchain/lightclient.go | 6 +- beacon-chain/blockchain/lightclient_test.go | 2 +- beacon-chain/rpc/eth/light-client/BUILD.bazel | 10 +- beacon-chain/rpc/eth/light-client/helpers.go | 62 +++ .../rpc/eth/light-client/helpers_test.go | 453 ++++++++++++++++++ 5 files changed, 528 insertions(+), 5 deletions(-) create mode 100644 beacon-chain/rpc/eth/light-client/helpers_test.go diff --git a/beacon-chain/blockchain/lightclient.go b/beacon-chain/blockchain/lightclient.go index 4a6890659510..ade4258cbb12 100644 --- a/beacon-chain/blockchain/lightclient.go +++ b/beacon-chain/blockchain/lightclient.go @@ -16,7 +16,7 @@ import ( ) const ( - finalityBranchNumOfLeaves = 6 + FinalityBranchNumOfLeaves = 6 ) // CreateLightClientFinalityUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_finality_update @@ -215,8 +215,8 @@ func NewLightClientFinalityUpdateFromBeaconState( BodyRoot: make([]byte, 32), } - finalityBranch = make([][]byte, finalityBranchNumOfLeaves) - for i := 0; i < finalityBranchNumOfLeaves; i++ { + finalityBranch = make([][]byte, FinalityBranchNumOfLeaves) + for i := 0; i < FinalityBranchNumOfLeaves; i++ { finalityBranch[i] = make([]byte, 32) } } diff --git a/beacon-chain/blockchain/lightclient_test.go b/beacon-chain/blockchain/lightclient_test.go index a635558a0d87..41a3a7cfacdb 100644 --- a/beacon-chain/blockchain/lightclient_test.go +++ b/beacon-chain/blockchain/lightclient_test.go @@ -153,7 +153,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.ParentRoot, "Finalized header parent root is not zero") require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.StateRoot, "Finalized header state root is not zero") require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.BodyRoot, "Finalized header body root is not zero") - require.Equal(t, finalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + require.Equal(t, FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") for _, leaf := range update.FinalityBranch { require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") } diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index ade330207cbe..db4370fd4ede 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -34,20 +34,28 @@ go_library( go_test( name = "go_default_test", - srcs = ["handlers_test.go"], + srcs = [ + "handlers_test.go", + "helpers_test.go", + ], embed = [":go_default_library"], deps = [ "//api/server/structs:go_default_library", + "//beacon-chain/blockchain:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", + "//proto/eth/v1:go_default_library", + "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index cde39540b66e..d6fe7a22f9dd 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -3,6 +3,7 @@ package lightclient import ( "context" "fmt" + "reflect" "strconv" "github.com/ethereum/go-ethereum/common/hexutil" @@ -311,3 +312,64 @@ func newLightClientUpdateToJSON(input *v2.LightClientUpdate) *structs.LightClien SignatureSlot: strconv.FormatUint(uint64(input.SignatureSlot), 10), } } + +func IsSyncCommitteeUpdate(update *v2.LightClientUpdate) bool { + nextSyncCommitteeBranch := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) + return !reflect.DeepEqual(update.NextSyncCommitteeBranch, nextSyncCommitteeBranch) +} + +func IsFinalityUpdate(update *v2.LightClientUpdate) bool { + finalityBranch := make([][]byte, blockchain.FinalityBranchNumOfLeaves) + return !reflect.DeepEqual(update.FinalityBranch, finalityBranch) +} + +func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) bool { + maxActiveParticipants := newUpdate.SyncAggregate.SyncCommitteeBits.Len() + newNumActiveParticipants := newUpdate.SyncAggregate.SyncCommitteeBits.Count() + oldNumActiveParticipants := oldUpdate.SyncAggregate.SyncCommitteeBits.Count() + newHasSupermajority := newNumActiveParticipants*3 >= maxActiveParticipants*2 + oldHasSupermajority := oldNumActiveParticipants*3 >= maxActiveParticipants*2 + + if newHasSupermajority != oldHasSupermajority { + return newHasSupermajority + } + if !newHasSupermajority && newNumActiveParticipants != oldNumActiveParticipants { + return newNumActiveParticipants > oldNumActiveParticipants + } + + // Compare presence of relevant sync committee + newHasRelevantSyncCommittee := IsSyncCommitteeUpdate(newUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.SignatureSlot))) + oldHasRelevantSyncCommittee := IsSyncCommitteeUpdate(oldUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.SignatureSlot))) + + if newHasRelevantSyncCommittee != oldHasRelevantSyncCommittee { + return newHasRelevantSyncCommittee + } + + // Compare indication of any finality + newHasFinality := IsFinalityUpdate(newUpdate) + oldHasFinality := IsFinalityUpdate(oldUpdate) + if newHasFinality != oldHasFinality { + return newHasFinality + } + + // Compare sync committee finality + if newHasFinality { + newHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.FinalizedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Slot)) + oldHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.FinalizedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Slot)) + + if newHasSyncCommitteeFinality != oldHasSyncCommitteeFinality { + return newHasSyncCommitteeFinality + } + } + + // Tiebreaker 1: Sync committee participation beyond supermajority + if newNumActiveParticipants != oldNumActiveParticipants { + return newNumActiveParticipants > oldNumActiveParticipants + } + + // Tiebreaker 2: Prefer older data (fewer changes to best) + if newUpdate.AttestedHeader.Slot != oldUpdate.AttestedHeader.Slot { + return newUpdate.AttestedHeader.Slot < oldUpdate.AttestedHeader.Slot + } + return newUpdate.SignatureSlot < oldUpdate.SignatureSlot +} diff --git a/beacon-chain/rpc/eth/light-client/helpers_test.go b/beacon-chain/rpc/eth/light-client/helpers_test.go new file mode 100644 index 000000000000..97a817717c29 --- /dev/null +++ b/beacon-chain/rpc/eth/light-client/helpers_test.go @@ -0,0 +1,453 @@ +package lightclient + +import ( + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" + ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + "github.com/prysmaticlabs/prysm/v5/testing/assert" +) + +// When the update has relevant sync committee +func createNonEmptySyncCommitteeBranch() [][]byte { + res := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) + res[0] = []byte("xyz") + return res +} + +// When the update has finality +func createNonEmptyFinalityBranch() [][]byte { + res := make([][]byte, blockchain.FinalityBranchNumOfLeaves) + res[0] = []byte("xyz") + return res +} + +func TestIsBetterUpdate(t *testing.T) { + testCases := []struct { + name string + oldUpdate *ethpbv2.LightClientUpdate + newUpdate *ethpbv2.LightClientUpdate + expectedResult bool + }{ + { + name: "new has supermajority but old doesn't", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,0,1,1,1,1,1,0] + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b11111100, 0b1}, // [0,0,1,1,1,1,1,1] + }, + }, + expectedResult: true, + }, + { + name: "old has supermajority but new doesn't", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b11111100, 0b1}, // [0,0,1,1,1,1,1,1] + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,0,1,1,1,1,1,0] + }, + }, + expectedResult: false, + }, + { + name: "new doesn't have supermajority and newNumActiveParticipants is greater than oldNumActiveParticipants", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,0,1,1,1,1,1,0] + }, + }, + expectedResult: true, + }, + { + name: "new doesn't have supermajority and newNumActiveParticipants is lesser than oldNumActiveParticipants", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,0,1,1,1,1,1,0] + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + }, + expectedResult: false, + }, + { + name: "new has relevant sync committee but old doesn't", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), + SignatureSlot: 9999, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000001, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 1000000, + }, + expectedResult: true, + }, + { + name: "old has relevant sync committee but new doesn't", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000001, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 1000000, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), + SignatureSlot: 9999, + }, + expectedResult: false, + }, + { + name: "new has finality but old doesn't", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: make([][]byte, blockchain.FinalityBranchNumOfLeaves), + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + }, + expectedResult: true, + }, + { + name: "old has finality but new doesn't", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: make([][]byte, blockchain.FinalityBranchNumOfLeaves), + }, + expectedResult: false, + }, + { + name: "new has finality and sync committee finality both but old doesn't have sync committee finality", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 999999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }, + }, + expectedResult: true, + }, + { + name: "new has finality but doesn't have sync committee finality and old has sync committee finality", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 999999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: false, + }, + { + name: "new has more active participants than old", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,1,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: true, + }, + { + name: "new has less active participants than old", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,1,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: false, + }, + { + name: "new's attested header's slot is lesser than old's attested header's slot", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: true, + }, + { + name: "new's attested header's slot is greater than old's attested header's slot", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: false, + }, + { + name: "none of the above conditions are met and new signature's slot is lesser than old signature's slot", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9998, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: true, + }, + { + name: "none of the above conditions are met and new signature's slot is greater than old signature's slot", + oldUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9998, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + newUpdate: ðpbv2.LightClientUpdate{ + SyncAggregate: ðpbv1.SyncAggregate{ + SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] + }, + AttestedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }, + NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), + SignatureSlot: 9999, + FinalityBranch: createNonEmptyFinalityBranch(), + FinalizedHeader: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }, + }, + expectedResult: false, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + assert.Equal(t, testCase.expectedResult, IsBetterUpdate(testCase.newUpdate, testCase.oldUpdate)) + }) + } +} From 5d04b3668092a2f3955f4570129732926886415c Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 23 Jul 2024 13:40:19 -0700 Subject: [PATCH 215/325] Remove no deposit requests found debug log (#14257) --- beacon-chain/core/electra/deposits.go | 1 - 1 file changed, 1 deletion(-) diff --git a/beacon-chain/core/electra/deposits.go b/beacon-chain/core/electra/deposits.go index 80c16bea3668..aab787b4f2dd 100644 --- a/beacon-chain/core/electra/deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -308,7 +308,6 @@ func ProcessDepositRequests(ctx context.Context, beaconState state.BeaconState, defer span.End() if len(requests) == 0 { - log.Debug("ProcessDepositRequests: no deposit requests found") return beaconState, nil } From 345aabe996e1bacc66b23b7749b0ebf993523dc4 Mon Sep 17 00:00:00 2001 From: John <33443230+gazzua@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:02:48 +0900 Subject: [PATCH 216/325] Fix: Adjust fieldRefCount for capella, deneb, electra (#14252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- beacon-chain/state/state-native/state_trie.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index e4b3e29fdc10..29ba8c0abb21 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -115,15 +115,15 @@ const ( phase0SharedFieldRefCount = 10 altairSharedFieldRefCount = 11 bellatrixSharedFieldRefCount = 12 - capellaSharedFieldRefCount = 14 - denebSharedFieldRefCount = 14 - electraSharedFieldRefCount = 17 + capellaSharedFieldRefCount = 13 + denebSharedFieldRefCount = 13 + electraSharedFieldRefCount = 16 experimentalStatePhase0SharedFieldRefCount = 5 experimentalStateAltairSharedFieldRefCount = 5 experimentalStateBellatrixSharedFieldRefCount = 6 - experimentalStateCapellaSharedFieldRefCount = 8 - experimentalStateDenebSharedFieldRefCount = 8 - experimentalStateElectraSharedFieldRefCount = 11 + experimentalStateCapellaSharedFieldRefCount = 7 + experimentalStateDenebSharedFieldRefCount = 7 + experimentalStateElectraSharedFieldRefCount = 10 ) // InitializeFromProtoPhase0 the beacon state from a protobuf representation. From 7d48b45152f7b218876c7695927486d1fc8355d4 Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 23 Jul 2024 16:19:14 -0700 Subject: [PATCH 217/325] Proposer: filter attestations for invalid signature (#14225) * Proposer: filter attestations for invalid signature * Nishant's feedback Co-authored-by: Nishant Das * Add more checks based on potuz's feedback * Fix filter by fork choice conditions * Potuz's feedback * Pass in epoch * Potuz feedback 2 * Fix test --------- Co-authored-by: Nishant Das --- beacon-chain/blockchain/chain_info.go | 2 + .../validator/proposer_attestations.go | 199 ++++++++++++++++++ .../validator/proposer_attestations_test.go | 158 +++++++++++++- 3 files changed, 358 insertions(+), 1 deletion(-) diff --git a/beacon-chain/blockchain/chain_info.go b/beacon-chain/blockchain/chain_info.go index e3fbac167eb7..f73652add1a8 100644 --- a/beacon-chain/blockchain/chain_info.go +++ b/beacon-chain/blockchain/chain_info.go @@ -48,6 +48,8 @@ type ForkchoiceFetcher interface { ForkChoiceDump(context.Context) (*forkchoice.Dump, error) NewSlot(context.Context, primitives.Slot) error ProposerBoost() [32]byte + RecentBlockSlot(root [32]byte) (primitives.Slot, error) + IsCanonical(ctx context.Context, blockRoot [32]byte) (bool, error) } // TimeFetcher retrieves the Ethereum consensus data that's related to time. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index 7ae8e3662c8b..b17d39900adf 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -1,7 +1,9 @@ package validator import ( + "bytes" "context" + "fmt" "sort" "github.com/pkg/errors" @@ -17,6 +19,7 @@ import ( attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" + "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -114,6 +117,12 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon return nil, err } atts = sorted.limitToMaxAttestations() + + atts, err = vs.filterAttestationBySignature(ctx, atts, latestState) + if err != nil { + return nil, err + } + return atts, nil } @@ -309,3 +318,193 @@ func (vs *Server) deleteAttsInPool(ctx context.Context, atts []ethpb.Att) error } return nil } + +// isAttestationFromCurrentEpoch returns true if the attestation is from the current epoch. +func (vs *Server) isAttestationFromCurrentEpoch(att ethpb.Att, currentEpoch primitives.Epoch) bool { + return att.GetData().Target.Epoch == currentEpoch +} + +// isAttestationFromPreviousEpoch returns true if the attestation is from the previous epoch. +func (vs *Server) isAttestationFromPreviousEpoch(att ethpb.Att, currentEpoch primitives.Epoch) bool { + return att.GetData().Target.Epoch+1 == currentEpoch +} + +// filterCurrentEpochAttestationByForkchoice filters attestations from the current epoch based on fork choice conditions. +// Returns true if all of the following conditions are met: +// 1. The attestation beacon block root is for a slot in the previous epoch (according to fork choice). +// 2. The attestation target root is the same as the attestation beacon block root. +// 3. The attestation beacon block root is canonical according to fork choice. +func (vs *Server) filterCurrentEpochAttestationByForkchoice(ctx context.Context, att ethpb.Att, currentEpoch primitives.Epoch) (bool, error) { + if !vs.isAttestationFromCurrentEpoch(att, currentEpoch) { + return false, nil + } + + attTargetRoot := [32]byte(att.GetData().Target.Root) + attBlockRoot := [32]byte(att.GetData().BeaconBlockRoot) + if attBlockRoot != attTargetRoot { + return false, nil + } + + slot, err := vs.ForkchoiceFetcher.RecentBlockSlot(attBlockRoot) + if err != nil { + return false, err + } + epoch := slots.ToEpoch(slot) + if epoch+1 != currentEpoch { + return false, nil + } + + return vs.ForkchoiceFetcher.IsCanonical(ctx, attBlockRoot) +} + +// filterCurrentEpochAttestationByTarget returns true if an attestation from the current epoch matches the fork choice target view. +// The conditions checked are: +// 1. The attestation's target epoch matches the forkchoice target epoch. +// 2. The attestation's target root matches the forkchoice target root. +func (vs *Server) filterCurrentEpochAttestationByTarget(att ethpb.Att, targetRoot [32]byte, targetEpoch, currentEpoch primitives.Epoch) (bool, error) { + if !vs.isAttestationFromCurrentEpoch(att, currentEpoch) { + return false, nil + } + + attTargetRoot := [32]byte(att.GetData().Target.Root) + return att.GetData().Target.Epoch == targetEpoch && attTargetRoot == targetRoot, nil +} + +// filterPreviousEpochAttestationByTarget returns true if an attestation from the previous epoch matches the fork choice previous target view. +// The conditions checked are: +// 1. The attestation's target epoch matches the forkchoice previous target epoch. +// 2. The attestation's target root matches the forkchoice previous target root. +func (vs *Server) filterPreviousEpochAttestationByTarget(att ethpb.Att, cp *ethpb.Checkpoint, currentEpoch primitives.Epoch) (bool, error) { + if !vs.isAttestationFromPreviousEpoch(att, currentEpoch) { + return false, nil + } + + return att.GetData().Target.Epoch == cp.Epoch && bytes.Equal(att.GetData().Target.Root, cp.Root), nil +} + +// filterAttestationBySignature filters attestations based on specific conditions and performs batch signature verification. +// The conditions checked are: +// 1. The attestation matches the current target view defined in `filterCurrentEpochAttestationByTarget`. +// 2. The attestation matches the previous target view defined in `filterPreviousEpochAttestationByTarget`. +// 3. The attestation matches certain fork choice conditions defined in `filterCurrentEpochAttestationByForkchoice`. +// The remaining attestations are sent for batch signature verification. If the batch verification fails, each signature is verified individually. +func (vs *Server) filterAttestationBySignature(ctx context.Context, atts proposerAtts, st state.BeaconState) (proposerAtts, error) { + headSlot := vs.HeadFetcher.HeadSlot() + targetEpoch := slots.ToEpoch(headSlot) + r, err := vs.HeadFetcher.HeadRoot(ctx) + if err != nil { + return nil, err + } + headRoot := [32]byte(r) + + targetRoot, err := vs.HeadFetcher.TargetRootForEpoch(headRoot, targetEpoch) + if err != nil { + return nil, err + } + + prevTargetEpoch := primitives.Epoch(0) + if targetEpoch >= 1 { + prevTargetEpoch = targetEpoch.Sub(1) + } + prevTargetRoot, err := vs.HeadFetcher.TargetRootForEpoch(headRoot, prevTargetEpoch) + if err != nil { + return nil, err + } + + currentSlot := vs.TimeFetcher.CurrentSlot() + currentEpoch := slots.ToEpoch(currentSlot) + + var verifiedAtts proposerAtts + var unverifiedAtts proposerAtts + for _, att := range atts { + ok, err := vs.filterCurrentEpochAttestationByTarget(att, targetRoot, targetEpoch, currentEpoch) + if err != nil { + log.WithFields(attestationFields(att)).WithError(err).Error("Could not filter current epoch attestation by target") + } + if ok { + verifiedAtts = append(verifiedAtts, att) + continue + } + + ok, err = vs.filterPreviousEpochAttestationByTarget(att, ðpb.Checkpoint{Root: prevTargetRoot[:], Epoch: prevTargetEpoch}, currentEpoch) + if err != nil { + log.WithFields(attestationFields(att)).WithError(err).Error("Could not filter previous epoch attestation by target") + } + if ok { + verifiedAtts = append(verifiedAtts, att) + continue + } + + ok, err = vs.filterCurrentEpochAttestationByForkchoice(ctx, att, currentEpoch) + if err != nil { + log.WithFields(attestationFields(att)).WithError(err).Error("Could not filter current epoch attestation by fork choice") + } + if ok { + verifiedAtts = append(verifiedAtts, att) + continue + } + + unverifiedAtts = append(unverifiedAtts, att) + } + + if len(unverifiedAtts) == 0 { + return verifiedAtts, nil + } + + unverifiedAtts = unverifiedAtts.filterBatchSignature(ctx, st) + + return append(verifiedAtts, unverifiedAtts...), nil +} + +// filterBatchSignature verifies the signatures of the attestation set. +// If batch verification fails, the attestation set is filtered by verifying each signature individually. +func (a proposerAtts) filterBatchSignature(ctx context.Context, st state.BeaconState) proposerAtts { + aSet, err := blocks.AttestationSignatureBatch(ctx, st, a) + if err != nil { + log.WithError(err).Error("Could not create attestation signature set") + return a.filterIndividualSignature(ctx, st) + } + + if verified, err := aSet.Verify(); err != nil || !verified { + if err != nil { + log.WithError(err).Error("Batch verification failed") + } else { + log.Error("Batch verification failed: signatures not verified") + } + return a.filterIndividualSignature(ctx, st) + } + return a +} + +// filterIndividualSignature filters the attestation set by verifying each signature individually. +func (a proposerAtts) filterIndividualSignature(ctx context.Context, st state.BeaconState) proposerAtts { + var validAtts proposerAtts + for _, att := range a { + aSet, err := blocks.AttestationSignatureBatch(ctx, st, []ethpb.Att{att}) + if err != nil { + log.WithFields(attestationFields(att)).WithError(err).Error("Could not create individual attestation signature set") + continue + } + if verified, err := aSet.Verify(); err != nil || !verified { + logEntry := log.WithFields(attestationFields(att)) + if err != nil { + logEntry.WithError(err).Error("Verification of individual attestation failed") + } else { + logEntry.Error("Verification of individual attestation failed: signature not verified") + } + continue + } + validAtts = append(validAtts, att) + } + return validAtts +} + +func attestationFields(att ethpb.Att) logrus.Fields { + return logrus.Fields{ + "slot": att.GetData().Slot, + "index": att.GetData().CommitteeIndex, + "targetRoot": fmt.Sprintf("%x", att.GetData().Target.Root), + "targetEpoch": att.GetData().Target.Epoch, + "beaconBlockRoot": fmt.Sprintf("%x", att.GetData().BeaconBlockRoot), + } +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index 84c0c9449af9..c1ea5d35401d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -15,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" + "github.com/prysmaticlabs/prysm/v5/time/slots" ) func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { @@ -468,7 +470,8 @@ func Test_packAttestations(t *testing.T) { } pool := attestations.NewPool() require.NoError(t, pool.SaveAggregatedAttestations([]ethpb.Att{phase0Att, electraAtt})) - s := &Server{AttPool: pool} + slot := primitives.Slot(1) + s := &Server{AttPool: pool, HeadFetcher: &chainMock.ChainService{}, TimeFetcher: &chainMock.ChainService{Slot: &slot}} t.Run("Phase 0", func(t *testing.T) { st, _ := util.DeterministicGenesisState(t, 64) @@ -547,3 +550,156 @@ func Test_limitToMaxAttestations(t *testing.T) { assert.Equal(t, len(pAtts)-1, len(pAtts.limitToMaxAttestations())) }) } + +func Test_filterBatchSignature(t *testing.T) { + st, k := util.DeterministicGenesisState(t, 64) + // Generate 1 good signature + aGood, err := util.GenerateAttestations(st, k, 1, 0, false) + require.NoError(t, err) + // Generate 1 bad signature + aBad := util.NewAttestation() + pa := proposerAtts(aGood) + pa = append(pa, aBad) + aFiltered := pa.filterBatchSignature(context.Background(), st) + assert.Equal(t, 1, len(aFiltered)) + assert.DeepEqual(t, aGood[0], aFiltered[0]) +} + +func Test_isAttestationFromCurrentEpoch(t *testing.T) { + slot := primitives.Slot(1) + epoch := slots.ToEpoch(slot) + s := &Server{} + a := ðpb.Attestation{ + Data: ðpb.AttestationData{Target: ðpb.Checkpoint{}}, + } + require.Equal(t, true, s.isAttestationFromCurrentEpoch(a, epoch)) + + a.Data.Target.Epoch = 1 + require.Equal(t, false, s.isAttestationFromCurrentEpoch(a, epoch)) +} + +func Test_isAttestationFromPreviousEpoch(t *testing.T) { + slot := params.BeaconConfig().SlotsPerEpoch + epoch := slots.ToEpoch(slot) + s := &Server{} + a := ðpb.Attestation{ + Data: ðpb.AttestationData{Target: ðpb.Checkpoint{}}, + } + require.Equal(t, true, s.isAttestationFromPreviousEpoch(a, epoch)) + + a.Data.Target.Epoch = 1 + require.Equal(t, false, s.isAttestationFromPreviousEpoch(a, epoch)) +} + +func Test_filterCurrentEpochAttestationByTarget(t *testing.T) { + slot := params.BeaconConfig().SlotsPerEpoch + epoch := slots.ToEpoch(slot) + s := &Server{} + targetRoot := [32]byte{'a'} + a := ðpb.Attestation{ + Data: ðpb.AttestationData{ + Slot: 1, + Target: ðpb.Checkpoint{ + Epoch: 1, + Root: targetRoot[:], + }, + }, + } + got, err := s.filterCurrentEpochAttestationByTarget(a, targetRoot, 1, epoch) + require.NoError(t, err) + require.Equal(t, true, got) + + got, err = s.filterCurrentEpochAttestationByTarget(a, [32]byte{}, 1, epoch) + require.NoError(t, err) + require.Equal(t, false, got) + + got, err = s.filterCurrentEpochAttestationByTarget(a, targetRoot, 2, epoch) + require.NoError(t, err) + require.Equal(t, false, got) + + a.Data.Target.Epoch = 2 + got, err = s.filterCurrentEpochAttestationByTarget(a, targetRoot, 1, epoch) + require.NoError(t, err) + require.Equal(t, false, got) +} + +func Test_filterPreviousEpochAttestationByTarget(t *testing.T) { + slot := 2 * params.BeaconConfig().SlotsPerEpoch + epoch := slots.ToEpoch(slot) + s := &Server{} + targetRoot := [32]byte{'a'} + a := ðpb.Attestation{ + Data: ðpb.AttestationData{ + Slot: 1, + Target: ðpb.Checkpoint{ + Epoch: 1, + Root: targetRoot[:], + }, + }, + } + got, err := s.filterPreviousEpochAttestationByTarget(a, ðpb.Checkpoint{ + Epoch: 1, + Root: targetRoot[:], + }, epoch) + require.NoError(t, err) + require.Equal(t, true, got) + + got, err = s.filterPreviousEpochAttestationByTarget(a, ðpb.Checkpoint{ + Epoch: 1, + }, epoch) + require.NoError(t, err) + require.Equal(t, false, got) + + got, err = s.filterPreviousEpochAttestationByTarget(a, ðpb.Checkpoint{ + Epoch: 2, + Root: targetRoot[:], + }, epoch) + require.NoError(t, err) + require.Equal(t, false, got) + + got, err = s.filterPreviousEpochAttestationByTarget(a, ðpb.Checkpoint{ + Epoch: 3, + Root: targetRoot[:], + }, epoch) + require.NoError(t, err) + require.Equal(t, false, got) +} + +func Test_filterCurrentEpochAttestationByForkchoice(t *testing.T) { + slot := params.BeaconConfig().SlotsPerEpoch + epoch := slots.ToEpoch(slot) + s := &Server{} + targetRoot := [32]byte{'a'} + a := ðpb.Attestation{ + Data: ðpb.AttestationData{ + BeaconBlockRoot: make([]byte, 32), + Slot: params.BeaconConfig().SlotsPerEpoch, + Target: ðpb.Checkpoint{ + Epoch: 1, + Root: targetRoot[:], + }, + }, + } + + ctx := context.Background() + got, err := s.filterCurrentEpochAttestationByForkchoice(ctx, a, epoch) + require.NoError(t, err) + require.Equal(t, false, got) + + a.Data.BeaconBlockRoot = targetRoot[:] + s.ForkchoiceFetcher = &chainMock.ChainService{BlockSlot: 1} + got, err = s.filterCurrentEpochAttestationByForkchoice(ctx, a, epoch) + require.NoError(t, err) + require.Equal(t, true, got) + + s.ForkchoiceFetcher = &chainMock.ChainService{BlockSlot: 100} + got, err = s.filterCurrentEpochAttestationByForkchoice(ctx, a, epoch) + require.NoError(t, err) + require.Equal(t, false, got) + + slot = params.BeaconConfig().SlotsPerEpoch * 2 + epoch = slots.ToEpoch(slot) + got, err = s.filterCurrentEpochAttestationByForkchoice(ctx, a, epoch) + require.NoError(t, err) + require.Equal(t, false, got) +} From 5c369361b008f71075fd1762fe03ee5d1293732d Mon Sep 17 00:00:00 2001 From: Samuel VIDEAU <70749906+samuel-videau@users.noreply.github.com> Date: Thu, 25 Jul 2024 07:13:17 +1000 Subject: [PATCH 218/325] Fix Event stream with carriage return support (#14250) * fix: event stream with carriage return * lint: bazel --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- api/client/event/BUILD.bazel | 10 ++- api/client/event/event_stream.go | 4 +- api/client/event/event_stream_test.go | 9 +-- api/client/event/utils.go | 36 ++++++++++ api/client/event/utils_test.go | 97 +++++++++++++++++++++++++++ 5 files changed, 149 insertions(+), 7 deletions(-) create mode 100644 api/client/event/utils.go create mode 100644 api/client/event/utils_test.go diff --git a/api/client/event/BUILD.bazel b/api/client/event/BUILD.bazel index 75135de1a7b5..87938ab39616 100644 --- a/api/client/event/BUILD.bazel +++ b/api/client/event/BUILD.bazel @@ -2,7 +2,10 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["event_stream.go"], + srcs = [ + "event_stream.go", + "utils.go", + ], importpath = "github.com/prysmaticlabs/prysm/v5/api/client/event", visibility = ["//visibility:public"], deps = [ @@ -15,7 +18,10 @@ go_library( go_test( name = "go_default_test", - srcs = ["event_stream_test.go"], + srcs = [ + "event_stream_test.go", + "utils_test.go", + ], embed = [":go_default_library"], deps = [ "//testing/require:go_default_library", diff --git a/api/client/event/event_stream.go b/api/client/event/event_stream.go index 48a1951b2b90..e85269038ddf 100644 --- a/api/client/event/event_stream.go +++ b/api/client/event/event_stream.go @@ -102,6 +102,8 @@ func (h *EventStream) Subscribe(eventsChannel chan<- *Event) { }() // Create a new scanner to read lines from the response body scanner := bufio.NewScanner(resp.Body) + // Set the split function for the scanning operation + scanner.Split(scanLinesWithCarriage) var eventType, data string // Variables to store event type and data @@ -113,7 +115,7 @@ func (h *EventStream) Subscribe(eventsChannel chan<- *Event) { close(eventsChannel) return default: - line := scanner.Text() // TODO(13730): scanner does not handle /r and does not fully adhere to https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface + line := scanner.Text() // Handle the event based on your specific format if line == "" { // Empty line indicates the end of an event diff --git a/api/client/event/event_stream_test.go b/api/client/event/event_stream_test.go index 28b6a7f874bc..66aa5c05f706 100644 --- a/api/client/event/event_stream_test.go +++ b/api/client/event/event_stream_test.go @@ -43,8 +43,9 @@ func TestEventStream(t *testing.T) { mux.HandleFunc("/eth/v1/events", func(w http.ResponseWriter, r *http.Request) { flusher, ok := w.(http.Flusher) require.Equal(t, true, ok) - for i := 1; i <= 2; i++ { - _, err := fmt.Fprintf(w, "event: head\ndata: data%d\n\n", i) + for i := 1; i <= 3; i++ { + events := [3]string{"event: head\ndata: data%d\n\n", "event: head\rdata: data%d\r\r", "event: head\r\ndata: data%d\r\n\r\n"} + _, err := fmt.Fprintf(w, events[i-1], i) require.NoError(t, err) flusher.Flush() // Trigger flush to simulate streaming data time.Sleep(100 * time.Millisecond) // Simulate delay between events @@ -62,7 +63,7 @@ func TestEventStream(t *testing.T) { // Collect events var events []*Event - for len(events) != 2 { + for len(events) != 3 { select { case event := <-eventsChannel: log.Info(event) @@ -71,7 +72,7 @@ func TestEventStream(t *testing.T) { } // Assertions to verify the events content - expectedData := []string{"data1", "data2"} + expectedData := []string{"data1", "data2", "data3"} for i, event := range events { if string(event.Data) != expectedData[i] { t.Errorf("Expected event data %q, got %q", expectedData[i], string(event.Data)) diff --git a/api/client/event/utils.go b/api/client/event/utils.go new file mode 100644 index 000000000000..e6a03e88bf74 --- /dev/null +++ b/api/client/event/utils.go @@ -0,0 +1,36 @@ +package event + +import ( + "bytes" +) + +// adapted from ScanLines in scan.go to handle carriage return characters as separators +func scanLinesWithCarriage(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } + if i, j := bytes.IndexByte(data, '\n'), bytes.IndexByte(data, '\r'); i >= 0 || j >= 0 { + in := i + // Select the first index of \n or \r or the second index of \r if it is followed by \n + if i < 0 || (i > j && i != j+1 && j >= 0) { + in = j + } + + // We have a full newline-terminated line. + return in + 1, dropCR(data[0:in]), nil + } + // If we're at EOF, we have a final, non-terminated line. Return it. + if atEOF { + return len(data), dropCR(data), nil + } + // Request more data. + return 0, nil, nil +} + +// dropCR drops a terminal \r from the data. +func dropCR(data []byte) []byte { + if len(data) > 0 && data[len(data)-1] == '\r' { + return data[0 : len(data)-1] + } + return data +} diff --git a/api/client/event/utils_test.go b/api/client/event/utils_test.go new file mode 100644 index 000000000000..e671ce8ae08b --- /dev/null +++ b/api/client/event/utils_test.go @@ -0,0 +1,97 @@ +package event + +import ( + "bufio" + "bytes" + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestScanLinesWithCarriage(t *testing.T) { + testCases := []struct { + name string + input string + expected []string + }{ + { + name: "LF line endings", + input: "line1\nline2\nline3", + expected: []string{"line1", "line2", "line3"}, + }, + { + name: "CR line endings", + input: "line1\rline2\rline3", + expected: []string{"line1", "line2", "line3"}, + }, + { + name: "CRLF line endings", + input: "line1\r\nline2\r\nline3", + expected: []string{"line1", "line2", "line3"}, + }, + { + name: "Mixed line endings", + input: "line1\nline2\rline3\r\nline4", + expected: []string{"line1", "line2", "line3", "line4"}, + }, + { + name: "Empty lines", + input: "line1\n\nline2\r\rline3", + expected: []string{"line1", "", "line2", "", "line3"}, + }, + { + name: "Empty lines 2", + input: "line1\n\rline2\n\rline3", + expected: []string{"line1", "", "line2", "", "line3"}, + }, + { + name: "No line endings", + input: "single line without ending", + expected: []string{"single line without ending"}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + scanner := bufio.NewScanner(bytes.NewReader([]byte(tc.input))) + scanner.Split(scanLinesWithCarriage) + + var lines []string + for scanner.Scan() { + lines = append(lines, scanner.Text()) + } + + require.NoError(t, scanner.Err()) + require.Equal(t, len(tc.expected), len(lines), "Number of lines does not match") + for i, line := range lines { + require.Equal(t, tc.expected[i], line, "Line %d does not match", i) + } + }) + } +} + +// TestScanLinesWithCarriageEdgeCases tests edge cases and potential error scenarios +func TestScanLinesWithCarriageEdgeCases(t *testing.T) { + t.Run("Empty input", func(t *testing.T) { + scanner := bufio.NewScanner(bytes.NewReader([]byte(""))) + scanner.Split(scanLinesWithCarriage) + require.Equal(t, scanner.Scan(), false) + require.NoError(t, scanner.Err()) + }) + + t.Run("Very long line", func(t *testing.T) { + longLine := bytes.Repeat([]byte("a"), bufio.MaxScanTokenSize+1) + scanner := bufio.NewScanner(bytes.NewReader(longLine)) + scanner.Split(scanLinesWithCarriage) + require.Equal(t, scanner.Scan(), false) + require.NotNil(t, scanner.Err()) + }) + + t.Run("Line ending at max token size", func(t *testing.T) { + input := append(bytes.Repeat([]byte("a"), bufio.MaxScanTokenSize-1), '\n') + scanner := bufio.NewScanner(bytes.NewReader(input)) + scanner.Split(scanLinesWithCarriage) + require.Equal(t, scanner.Scan(), true) + require.Equal(t, string(bytes.Repeat([]byte("a"), bufio.MaxScanTokenSize-1)), scanner.Text()) + }) +} From 6f7976766d23db64d5680266b542f1b531b07bc6 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:13:21 -0500 Subject: [PATCH 219/325] moving cloner functions to beacon_block.go (#14265) * moving cloner functions for beacon block and adding fuzzing tests * fixing test --- .../sync/pending_blocks_queue_test.go | 6 +- consensus-types/blocks/getters.go | 61 +-- proto/prysm/v1alpha1/beacon_block.go | 452 ++++++++++++++++++ .../prysm/v1alpha1/beacon_block_fuzz_test.go | 43 ++ proto/prysm/v1alpha1/cloners.go | 452 ------------------ proto/prysm/v1alpha1/cloners_test.go | 60 +-- 6 files changed, 548 insertions(+), 526 deletions(-) diff --git a/beacon-chain/sync/pending_blocks_queue_test.go b/beacon-chain/sync/pending_blocks_queue_test.go index e986d20dda86..3e367b214691 100644 --- a/beacon-chain/sync/pending_blocks_queue_test.go +++ b/beacon-chain/sync/pending_blocks_queue_test.go @@ -684,9 +684,9 @@ func TestService_AddPendingBlockToQueueOverMax(t *testing.T) { } b := util.NewBeaconBlock() - b1 := ethpb.CopySignedBeaconBlock(b) + b1 := b.Copy() b1.Block.StateRoot = []byte{'a'} - b2 := ethpb.CopySignedBeaconBlock(b) + b2 := b.Copy() b2.Block.StateRoot = []byte{'b'} wsb, err := blocks.NewSignedBeaconBlock(b) require.NoError(t, err) @@ -698,7 +698,7 @@ func TestService_AddPendingBlockToQueueOverMax(t *testing.T) { require.NoError(t, err) require.NoError(t, r.insertBlockToPendingQueue(0, wsb, [32]byte{2})) - b3 := ethpb.CopySignedBeaconBlock(b) + b3 := b.Copy() b3.Block.StateRoot = []byte{'c'} wsb, err = blocks.NewSignedBeaconBlock(b2) require.NoError(t, err) diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 72ad16c76444..410e53317d6b 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -52,40 +52,29 @@ func (b *SignedBeaconBlock) Copy() (interfaces.SignedBeaconBlock, error) { } switch b.version { case version.Phase0: - cp := eth.CopySignedBeaconBlock(pb.(*eth.SignedBeaconBlock)) - return initSignedBlockFromProtoPhase0(cp) + return initSignedBlockFromProtoPhase0(pb.(*eth.SignedBeaconBlock).Copy()) case version.Altair: - cp := eth.CopySignedBeaconBlockAltair(pb.(*eth.SignedBeaconBlockAltair)) - return initSignedBlockFromProtoAltair(cp) + return initSignedBlockFromProtoAltair(pb.(*eth.SignedBeaconBlockAltair).Copy()) case version.Bellatrix: if b.IsBlinded() { - cp := eth.CopySignedBlindedBeaconBlockBellatrix(pb.(*eth.SignedBlindedBeaconBlockBellatrix)) - return initBlindedSignedBlockFromProtoBellatrix(cp) + return initBlindedSignedBlockFromProtoBellatrix(pb.(*eth.SignedBlindedBeaconBlockBellatrix).Copy()) } - cp := eth.CopySignedBeaconBlockBellatrix(pb.(*eth.SignedBeaconBlockBellatrix)) - return initSignedBlockFromProtoBellatrix(cp) + return initSignedBlockFromProtoBellatrix(pb.(*eth.SignedBeaconBlockBellatrix).Copy()) case version.Capella: if b.IsBlinded() { - cp := eth.CopySignedBlindedBeaconBlockCapella(pb.(*eth.SignedBlindedBeaconBlockCapella)) - return initBlindedSignedBlockFromProtoCapella(cp) + return initBlindedSignedBlockFromProtoCapella(pb.(*eth.SignedBlindedBeaconBlockCapella).Copy()) } - cp := eth.CopySignedBeaconBlockCapella(pb.(*eth.SignedBeaconBlockCapella)) - return initSignedBlockFromProtoCapella(cp) + return initSignedBlockFromProtoCapella(pb.(*eth.SignedBeaconBlockCapella).Copy()) case version.Deneb: if b.IsBlinded() { - cp := eth.CopySignedBlindedBeaconBlockDeneb(pb.(*eth.SignedBlindedBeaconBlockDeneb)) - return initBlindedSignedBlockFromProtoDeneb(cp) + return initBlindedSignedBlockFromProtoDeneb(pb.(*eth.SignedBlindedBeaconBlockDeneb).Copy()) } - cp := eth.CopySignedBeaconBlockDeneb(pb.(*eth.SignedBeaconBlockDeneb)) - return initSignedBlockFromProtoDeneb(cp) + return initSignedBlockFromProtoDeneb(pb.(*eth.SignedBeaconBlockDeneb).Copy()) case version.Electra: if b.IsBlinded() { - cp := eth.CopySignedBlindedBeaconBlockElectra(pb.(*eth.SignedBlindedBeaconBlockElectra)) - return initBlindedSignedBlockFromProtoElectra(cp) + return initBlindedSignedBlockFromProtoElectra(pb.(*eth.SignedBlindedBeaconBlockElectra).Copy()) } - cp := eth.CopySignedBeaconBlockElectra(pb.(*eth.SignedBeaconBlockElectra)) - return initSignedBlockFromProtoElectra(cp) - + return initSignedBlockFromProtoElectra(pb.(*eth.SignedBeaconBlockElectra).Copy()) default: return nil, errIncorrectBlockVersion } @@ -972,39 +961,29 @@ func (b *BeaconBlock) Copy() (interfaces.ReadOnlyBeaconBlock, error) { } switch b.version { case version.Phase0: - cp := eth.CopyBeaconBlock(pb.(*eth.BeaconBlock)) - return initBlockFromProtoPhase0(cp) + return initBlockFromProtoPhase0(pb.(*eth.BeaconBlock).Copy()) case version.Altair: - cp := eth.CopyBeaconBlockAltair(pb.(*eth.BeaconBlockAltair)) - return initBlockFromProtoAltair(cp) + return initBlockFromProtoAltair(pb.(*eth.BeaconBlockAltair).Copy()) case version.Bellatrix: if b.IsBlinded() { - cp := eth.CopyBlindedBeaconBlockBellatrix(pb.(*eth.BlindedBeaconBlockBellatrix)) - return initBlindedBlockFromProtoBellatrix(cp) + return initBlindedBlockFromProtoBellatrix(pb.(*eth.BlindedBeaconBlockBellatrix).Copy()) } - cp := eth.CopyBeaconBlockBellatrix(pb.(*eth.BeaconBlockBellatrix)) - return initBlockFromProtoBellatrix(cp) + return initBlockFromProtoBellatrix(pb.(*eth.BeaconBlockBellatrix).Copy()) case version.Capella: if b.IsBlinded() { - cp := eth.CopyBlindedBeaconBlockCapella(pb.(*eth.BlindedBeaconBlockCapella)) - return initBlindedBlockFromProtoCapella(cp) + return initBlindedBlockFromProtoCapella(pb.(*eth.BlindedBeaconBlockCapella).Copy()) } - cp := eth.CopyBeaconBlockCapella(pb.(*eth.BeaconBlockCapella)) - return initBlockFromProtoCapella(cp) + return initBlockFromProtoCapella(pb.(*eth.BeaconBlockCapella).Copy()) case version.Deneb: if b.IsBlinded() { - cp := eth.CopyBlindedBeaconBlockDeneb(pb.(*eth.BlindedBeaconBlockDeneb)) - return initBlindedBlockFromProtoDeneb(cp) + return initBlindedBlockFromProtoDeneb(pb.(*eth.BlindedBeaconBlockDeneb).Copy()) } - cp := eth.CopyBeaconBlockDeneb(pb.(*eth.BeaconBlockDeneb)) - return initBlockFromProtoDeneb(cp) + return initBlockFromProtoDeneb(pb.(*eth.BeaconBlockDeneb).Copy()) case version.Electra: if b.IsBlinded() { - cp := eth.CopyBlindedBeaconBlockElectra(pb.(*eth.BlindedBeaconBlockElectra)) - return initBlindedBlockFromProtoElectra(cp) + return initBlindedBlockFromProtoElectra(pb.(*eth.BlindedBeaconBlockElectra).Copy()) } - cp := eth.CopyBeaconBlockElectra(pb.(*eth.BeaconBlockElectra)) - return initBlockFromProtoElectra(cp) + return initBlockFromProtoElectra(pb.(*eth.BeaconBlockElectra).Copy()) default: return nil, errIncorrectBlockVersion } diff --git a/proto/prysm/v1alpha1/beacon_block.go b/proto/prysm/v1alpha1/beacon_block.go index 50171fa2dc7d..ddf48f5c2c5d 100644 --- a/proto/prysm/v1alpha1/beacon_block.go +++ b/proto/prysm/v1alpha1/beacon_block.go @@ -2,6 +2,458 @@ package eth import "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" +// Copy -- +func (sigBlock *SignedBeaconBlock) Copy() *SignedBeaconBlock { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlock{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BeaconBlock) Copy() *BeaconBlock { + if block == nil { + return nil + } + return &BeaconBlock{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BeaconBlockBody) Copy() *BeaconBlockBody { + if body == nil { + return nil + } + return &BeaconBlockBody{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + } +} + +// Copy -- +func (sigBlock *SignedBeaconBlockAltair) Copy() *SignedBeaconBlockAltair { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlockAltair{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BeaconBlockAltair) Copy() *BeaconBlockAltair { + if block == nil { + return nil + } + return &BeaconBlockAltair{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BeaconBlockBodyAltair) Copy() *BeaconBlockBodyAltair { + if body == nil { + return nil + } + return &BeaconBlockBodyAltair{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + } +} + +// Copy -- +func (sigBlock *SignedBeaconBlockBellatrix) Copy() *SignedBeaconBlockBellatrix { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlockBellatrix{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BeaconBlockBellatrix) Copy() *BeaconBlockBellatrix { + if block == nil { + return nil + } + return &BeaconBlockBellatrix{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BeaconBlockBodyBellatrix) Copy() *BeaconBlockBodyBellatrix { + if body == nil { + return nil + } + return &BeaconBlockBodyBellatrix{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayload: body.ExecutionPayload.Copy(), + } +} + +// Copy -- +func (sigBlock *SignedBeaconBlockCapella) Copy() *SignedBeaconBlockCapella { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlockCapella{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BeaconBlockCapella) Copy() *BeaconBlockCapella { + if block == nil { + return nil + } + return &BeaconBlockCapella{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BeaconBlockBodyCapella) Copy() *BeaconBlockBodyCapella { + if body == nil { + return nil + } + return &BeaconBlockBodyCapella{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayload: body.ExecutionPayload.Copy(), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), + } +} + +// Copy -- +func (sigBlock *SignedBlindedBeaconBlockCapella) Copy() *SignedBlindedBeaconBlockCapella { + if sigBlock == nil { + return nil + } + return &SignedBlindedBeaconBlockCapella{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BlindedBeaconBlockCapella) Copy() *BlindedBeaconBlockCapella { + if block == nil { + return nil + } + return &BlindedBeaconBlockCapella{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BlindedBeaconBlockBodyCapella) Copy() *BlindedBeaconBlockBodyCapella { + if body == nil { + return nil + } + return &BlindedBeaconBlockBodyCapella{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), + } +} + +// Copy -- +func (sigBlock *SignedBlindedBeaconBlockDeneb) Copy() *SignedBlindedBeaconBlockDeneb { + if sigBlock == nil { + return nil + } + return &SignedBlindedBeaconBlockDeneb{ + Message: sigBlock.Message.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BlindedBeaconBlockDeneb) Copy() *BlindedBeaconBlockDeneb { + if block == nil { + return nil + } + return &BlindedBeaconBlockDeneb{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BlindedBeaconBlockBodyDeneb) Copy() *BlindedBeaconBlockBodyDeneb { + if body == nil { + return nil + } + return &BlindedBeaconBlockBodyDeneb{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), + BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + } +} + +// Copy -- +func (sigBlock *SignedBlindedBeaconBlockElectra) Copy() *SignedBlindedBeaconBlockElectra { + if sigBlock == nil { + return nil + } + return &SignedBlindedBeaconBlockElectra{ + Message: sigBlock.Message.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BlindedBeaconBlockElectra) Copy() *BlindedBeaconBlockElectra { + if block == nil { + return nil + } + return &BlindedBeaconBlockElectra{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BlindedBeaconBlockBodyElectra) Copy() *BlindedBeaconBlockBodyElectra { + if body == nil { + return nil + } + return &BlindedBeaconBlockBodyElectra{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), + BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + } +} + +// Copy -- +func (sigBlock *SignedBlindedBeaconBlockBellatrix) Copy() *SignedBlindedBeaconBlockBellatrix { + if sigBlock == nil { + return nil + } + return &SignedBlindedBeaconBlockBellatrix{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BlindedBeaconBlockBellatrix) Copy() *BlindedBeaconBlockBellatrix { + if block == nil { + return nil + } + return &BlindedBeaconBlockBellatrix{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BlindedBeaconBlockBodyBellatrix) Copy() *BlindedBeaconBlockBodyBellatrix { + if body == nil { + return nil + } + return &BlindedBeaconBlockBodyBellatrix{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), + } +} + +// CopyBlobKZGs copies the provided blob kzgs object. +func CopyBlobKZGs(b [][]byte) [][]byte { + return bytesutil.SafeCopy2dBytes(b) +} + +// Copy -- +func (sigBlock *SignedBeaconBlockDeneb) Copy() *SignedBeaconBlockDeneb { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlockDeneb{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BeaconBlockDeneb) Copy() *BeaconBlockDeneb { + if block == nil { + return nil + } + return &BeaconBlockDeneb{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BeaconBlockBodyDeneb) Copy() *BeaconBlockBodyDeneb { + if body == nil { + return nil + } + return &BeaconBlockBodyDeneb{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayload: body.ExecutionPayload.Copy(), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), + BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + } +} + +// Copy -- +func (sigBlock *SignedBeaconBlockElectra) Copy() *SignedBeaconBlockElectra { + if sigBlock == nil { + return nil + } + return &SignedBeaconBlockElectra{ + Block: sigBlock.Block.Copy(), + Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), + } +} + +// Copy -- +func (block *BeaconBlockElectra) Copy() *BeaconBlockElectra { + if block == nil { + return nil + } + return &BeaconBlockElectra{ + Slot: block.Slot, + ProposerIndex: block.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), + Body: block.Body.Copy(), + } +} + +// Copy -- +func (body *BeaconBlockBodyElectra) Copy() *BeaconBlockBodyElectra { + if body == nil { + return nil + } + return &BeaconBlockBodyElectra{ + RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), + Eth1Data: body.Eth1Data.Copy(), + Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), + ProposerSlashings: CopySlice(body.ProposerSlashings), + AttesterSlashings: CopySlice(body.AttesterSlashings), + Attestations: CopySlice(body.Attestations), + Deposits: CopySlice(body.Deposits), + VoluntaryExits: CopySlice(body.VoluntaryExits), + SyncAggregate: body.SyncAggregate.Copy(), + ExecutionPayload: body.ExecutionPayload.Copy(), + BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), + BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + } +} + // Copy -- func (data *Eth1Data) Copy() *Eth1Data { if data == nil { diff --git a/proto/prysm/v1alpha1/beacon_block_fuzz_test.go b/proto/prysm/v1alpha1/beacon_block_fuzz_test.go index 71b81db9fe85..043728777455 100644 --- a/proto/prysm/v1alpha1/beacon_block_fuzz_test.go +++ b/proto/prysm/v1alpha1/beacon_block_fuzz_test.go @@ -6,6 +6,49 @@ import ( eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) +func TestBeaconBlock_Fuzz(t *testing.T) { + // Phase 0 Full + fuzzCopies(t, ð.SignedBeaconBlock{}) + fuzzCopies(t, ð.BeaconBlock{}) + fuzzCopies(t, ð.BeaconBlockBody{}) + // Altair Full + fuzzCopies(t, ð.SignedBeaconBlockAltair{}) + fuzzCopies(t, ð.BeaconBlockAltair{}) + fuzzCopies(t, ð.BeaconBlockBodyAltair{}) + // Bellatrix Full + fuzzCopies(t, ð.SignedBeaconBlockBellatrix{}) + fuzzCopies(t, ð.BeaconBlockBellatrix{}) + fuzzCopies(t, ð.BeaconBlockBodyBellatrix{}) + // Bellatrix Blinded + fuzzCopies(t, ð.SignedBlindedBeaconBlockBellatrix{}) + fuzzCopies(t, ð.BlindedBeaconBlockBellatrix{}) + fuzzCopies(t, ð.BlindedBeaconBlockBodyBellatrix{}) + // Capella Full + fuzzCopies(t, ð.SignedBeaconBlockCapella{}) + fuzzCopies(t, ð.BeaconBlockCapella{}) + fuzzCopies(t, ð.BeaconBlockBodyCapella{}) + // Capella Blinded + fuzzCopies(t, ð.SignedBlindedBeaconBlockCapella{}) + fuzzCopies(t, ð.BlindedBeaconBlockCapella{}) + fuzzCopies(t, ð.BlindedBeaconBlockBodyCapella{}) + // Deneb Full + fuzzCopies(t, ð.SignedBeaconBlockDeneb{}) + fuzzCopies(t, ð.BeaconBlockDeneb{}) + fuzzCopies(t, ð.BeaconBlockBodyDeneb{}) + // Deneb Blinded + fuzzCopies(t, ð.SignedBlindedBeaconBlockDeneb{}) + fuzzCopies(t, ð.BlindedBeaconBlockDeneb{}) + fuzzCopies(t, ð.BlindedBeaconBlockBodyDeneb{}) + // Electra Full + fuzzCopies(t, ð.SignedBeaconBlockElectra{}) + fuzzCopies(t, ð.BeaconBlockElectra{}) + fuzzCopies(t, ð.BeaconBlockBodyElectra{}) + // Electra Blinded + fuzzCopies(t, ð.SignedBlindedBeaconBlockElectra{}) + fuzzCopies(t, ð.BlindedBeaconBlockElectra{}) + fuzzCopies(t, ð.BlindedBeaconBlockBodyElectra{}) +} + func TestCopyBeaconBlockFields_Fuzz(t *testing.T) { fuzzCopies(t, ð.Eth1Data{}) fuzzCopies(t, ð.ProposerSlashing{}) diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index 2104a0863fb9..d4180948ccf2 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -17,91 +17,6 @@ func CopySlice[T any, C copier[T]](original []C) []T { return newSlice } -// CopySignedBeaconBlock copies the provided SignedBeaconBlock. -func CopySignedBeaconBlock(sigBlock *SignedBeaconBlock) *SignedBeaconBlock { - if sigBlock == nil { - return nil - } - return &SignedBeaconBlock{ - Block: CopyBeaconBlock(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBeaconBlock copies the provided BeaconBlock. -func CopyBeaconBlock(block *BeaconBlock) *BeaconBlock { - if block == nil { - return nil - } - return &BeaconBlock{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBeaconBlockBody(block.Body), - } -} - -// CopyBeaconBlockBody copies the provided BeaconBlockBody. -func CopyBeaconBlockBody(body *BeaconBlockBody) *BeaconBlockBody { - if body == nil { - return nil - } - return &BeaconBlockBody{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - } -} - -// CopySignedBeaconBlockAltair copies the provided SignedBeaconBlock. -func CopySignedBeaconBlockAltair(sigBlock *SignedBeaconBlockAltair) *SignedBeaconBlockAltair { - if sigBlock == nil { - return nil - } - return &SignedBeaconBlockAltair{ - Block: CopyBeaconBlockAltair(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBeaconBlockAltair copies the provided BeaconBlock. -func CopyBeaconBlockAltair(block *BeaconBlockAltair) *BeaconBlockAltair { - if block == nil { - return nil - } - return &BeaconBlockAltair{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBeaconBlockBodyAltair(block.Body), - } -} - -// CopyBeaconBlockBodyAltair copies the provided BeaconBlockBody. -func CopyBeaconBlockBodyAltair(body *BeaconBlockBodyAltair) *BeaconBlockBodyAltair { - if body == nil { - return nil - } - return &BeaconBlockBodyAltair{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - } -} - // CopyValidator copies the provided validator. func CopyValidator(val *Validator) *Validator { pubKey := make([]byte, len(val.PublicKey)) @@ -146,370 +61,3 @@ func CopySyncCommitteeContribution(c *SyncCommitteeContribution) *SyncCommitteeC Signature: bytesutil.SafeCopyBytes(c.Signature), } } - -// CopySignedBeaconBlockBellatrix copies the provided SignedBeaconBlockBellatrix. -func CopySignedBeaconBlockBellatrix(sigBlock *SignedBeaconBlockBellatrix) *SignedBeaconBlockBellatrix { - if sigBlock == nil { - return nil - } - return &SignedBeaconBlockBellatrix{ - Block: CopyBeaconBlockBellatrix(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBeaconBlockBellatrix copies the provided BeaconBlockBellatrix. -func CopyBeaconBlockBellatrix(block *BeaconBlockBellatrix) *BeaconBlockBellatrix { - if block == nil { - return nil - } - return &BeaconBlockBellatrix{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBeaconBlockBodyBellatrix(block.Body), - } -} - -// CopyBeaconBlockBodyBellatrix copies the provided BeaconBlockBodyBellatrix. -func CopyBeaconBlockBodyBellatrix(body *BeaconBlockBodyBellatrix) *BeaconBlockBodyBellatrix { - if body == nil { - return nil - } - return &BeaconBlockBodyBellatrix{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayload: body.ExecutionPayload.Copy(), - } -} - -// CopySignedBeaconBlockCapella copies the provided SignedBeaconBlockCapella. -func CopySignedBeaconBlockCapella(sigBlock *SignedBeaconBlockCapella) *SignedBeaconBlockCapella { - if sigBlock == nil { - return nil - } - return &SignedBeaconBlockCapella{ - Block: CopyBeaconBlockCapella(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBeaconBlockCapella copies the provided BeaconBlockCapella. -func CopyBeaconBlockCapella(block *BeaconBlockCapella) *BeaconBlockCapella { - if block == nil { - return nil - } - return &BeaconBlockCapella{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBeaconBlockBodyCapella(block.Body), - } -} - -// CopyBeaconBlockBodyCapella copies the provided BeaconBlockBodyCapella. -func CopyBeaconBlockBodyCapella(body *BeaconBlockBodyCapella) *BeaconBlockBodyCapella { - if body == nil { - return nil - } - return &BeaconBlockBodyCapella{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayload: body.ExecutionPayload.Copy(), - BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), - } -} - -// CopySignedBlindedBeaconBlockCapella copies the provided SignedBlindedBeaconBlockCapella. -func CopySignedBlindedBeaconBlockCapella(sigBlock *SignedBlindedBeaconBlockCapella) *SignedBlindedBeaconBlockCapella { - if sigBlock == nil { - return nil - } - return &SignedBlindedBeaconBlockCapella{ - Block: CopyBlindedBeaconBlockCapella(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBlindedBeaconBlockCapella copies the provided BlindedBeaconBlockCapella. -func CopyBlindedBeaconBlockCapella(block *BlindedBeaconBlockCapella) *BlindedBeaconBlockCapella { - if block == nil { - return nil - } - return &BlindedBeaconBlockCapella{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBlindedBeaconBlockBodyCapella(block.Body), - } -} - -// CopyBlindedBeaconBlockBodyCapella copies the provided BlindedBeaconBlockBodyCapella. -func CopyBlindedBeaconBlockBodyCapella(body *BlindedBeaconBlockBodyCapella) *BlindedBeaconBlockBodyCapella { - if body == nil { - return nil - } - return &BlindedBeaconBlockBodyCapella{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), - } -} - -// CopySignedBlindedBeaconBlockDeneb copies the provided SignedBlindedBeaconBlockDeneb. -func CopySignedBlindedBeaconBlockDeneb(sigBlock *SignedBlindedBeaconBlockDeneb) *SignedBlindedBeaconBlockDeneb { - if sigBlock == nil { - return nil - } - return &SignedBlindedBeaconBlockDeneb{ - Message: CopyBlindedBeaconBlockDeneb(sigBlock.Message), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBlindedBeaconBlockDeneb copies the provided BlindedBeaconBlockDeneb. -func CopyBlindedBeaconBlockDeneb(block *BlindedBeaconBlockDeneb) *BlindedBeaconBlockDeneb { - if block == nil { - return nil - } - return &BlindedBeaconBlockDeneb{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBlindedBeaconBlockBodyDeneb(block.Body), - } -} - -// CopyBlindedBeaconBlockBodyDeneb copies the provided BlindedBeaconBlockBodyDeneb. -func CopyBlindedBeaconBlockBodyDeneb(body *BlindedBeaconBlockBodyDeneb) *BlindedBeaconBlockBodyDeneb { - if body == nil { - return nil - } - return &BlindedBeaconBlockBodyDeneb{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), - BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), - } -} - -// CopySignedBlindedBeaconBlockElectra copies the provided SignedBlindedBeaconBlockElectra. -func CopySignedBlindedBeaconBlockElectra(sigBlock *SignedBlindedBeaconBlockElectra) *SignedBlindedBeaconBlockElectra { - if sigBlock == nil { - return nil - } - return &SignedBlindedBeaconBlockElectra{ - Message: CopyBlindedBeaconBlockElectra(sigBlock.Message), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBlindedBeaconBlockElectra copies the provided BlindedBeaconBlockElectra. -func CopyBlindedBeaconBlockElectra(block *BlindedBeaconBlockElectra) *BlindedBeaconBlockElectra { - if block == nil { - return nil - } - return &BlindedBeaconBlockElectra{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBlindedBeaconBlockBodyElectra(block.Body), - } -} - -// CopyBlindedBeaconBlockBodyElectra copies the provided BlindedBeaconBlockBodyElectra. -func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *BlindedBeaconBlockBodyElectra { - if body == nil { - return nil - } - return &BlindedBeaconBlockBodyElectra{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), - BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), - } -} - -// CopySignedBlindedBeaconBlockBellatrix copies the provided SignedBlindedBeaconBlockBellatrix. -func CopySignedBlindedBeaconBlockBellatrix(sigBlock *SignedBlindedBeaconBlockBellatrix) *SignedBlindedBeaconBlockBellatrix { - if sigBlock == nil { - return nil - } - return &SignedBlindedBeaconBlockBellatrix{ - Block: CopyBlindedBeaconBlockBellatrix(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBlindedBeaconBlockBellatrix copies the provided BlindedBeaconBlockBellatrix. -func CopyBlindedBeaconBlockBellatrix(block *BlindedBeaconBlockBellatrix) *BlindedBeaconBlockBellatrix { - if block == nil { - return nil - } - return &BlindedBeaconBlockBellatrix{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBlindedBeaconBlockBodyBellatrix(block.Body), - } -} - -// CopyBlindedBeaconBlockBodyBellatrix copies the provided BlindedBeaconBlockBodyBellatrix. -func CopyBlindedBeaconBlockBodyBellatrix(body *BlindedBeaconBlockBodyBellatrix) *BlindedBeaconBlockBodyBellatrix { - if body == nil { - return nil - } - return &BlindedBeaconBlockBodyBellatrix{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), - } -} - -// CopyBlobKZGs copies the provided blob kzgs object. -func CopyBlobKZGs(b [][]byte) [][]byte { - return bytesutil.SafeCopy2dBytes(b) -} - -// CopySignedBeaconBlockDeneb copies the provided SignedBeaconBlockDeneb. -func CopySignedBeaconBlockDeneb(sigBlock *SignedBeaconBlockDeneb) *SignedBeaconBlockDeneb { - if sigBlock == nil { - return nil - } - return &SignedBeaconBlockDeneb{ - Block: CopyBeaconBlockDeneb(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBeaconBlockDeneb copies the provided BeaconBlockDeneb. -func CopyBeaconBlockDeneb(block *BeaconBlockDeneb) *BeaconBlockDeneb { - if block == nil { - return nil - } - return &BeaconBlockDeneb{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBeaconBlockBodyDeneb(block.Body), - } -} - -// CopyBeaconBlockBodyDeneb copies the provided BeaconBlockBodyDeneb. -func CopyBeaconBlockBodyDeneb(body *BeaconBlockBodyDeneb) *BeaconBlockBodyDeneb { - if body == nil { - return nil - } - return &BeaconBlockBodyDeneb{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayload: body.ExecutionPayload.Copy(), - BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), - BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), - } -} - -// CopySignedBeaconBlockElectra copies the provided SignedBeaconBlockElectra. -func CopySignedBeaconBlockElectra(sigBlock *SignedBeaconBlockElectra) *SignedBeaconBlockElectra { - if sigBlock == nil { - return nil - } - return &SignedBeaconBlockElectra{ - Block: CopyBeaconBlockElectra(sigBlock.Block), - Signature: bytesutil.SafeCopyBytes(sigBlock.Signature), - } -} - -// CopyBeaconBlockElectra copies the provided BeaconBlockElectra. -func CopyBeaconBlockElectra(block *BeaconBlockElectra) *BeaconBlockElectra { - if block == nil { - return nil - } - return &BeaconBlockElectra{ - Slot: block.Slot, - ProposerIndex: block.ProposerIndex, - ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot), - StateRoot: bytesutil.SafeCopyBytes(block.StateRoot), - Body: CopyBeaconBlockBodyElectra(block.Body), - } -} - -// CopyBeaconBlockBodyElectra copies the provided BeaconBlockBodyElectra. -func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyElectra { - if body == nil { - return nil - } - return &BeaconBlockBodyElectra{ - RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal), - Eth1Data: body.Eth1Data.Copy(), - Graffiti: bytesutil.SafeCopyBytes(body.Graffiti), - ProposerSlashings: CopySlice(body.ProposerSlashings), - AttesterSlashings: CopySlice(body.AttesterSlashings), - Attestations: CopySlice(body.Attestations), - Deposits: CopySlice(body.Deposits), - VoluntaryExits: CopySlice(body.VoluntaryExits), - SyncAggregate: body.SyncAggregate.Copy(), - ExecutionPayload: body.ExecutionPayload.Copy(), - BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), - BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), - } -} diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 1cffb5d49ed3..2cd98fc7b7c8 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -13,7 +13,7 @@ import ( func TestCopySignedBeaconBlock(t *testing.T) { blk := genSignedBeaconBlock() - got := v1alpha1.CopySignedBeaconBlock(blk) + got := blk.Copy() if !reflect.DeepEqual(got, blk) { t.Errorf("CopySignedBeaconBlock() = %v, want %v", got, blk) } @@ -23,7 +23,7 @@ func TestCopySignedBeaconBlock(t *testing.T) { func TestCopyBeaconBlock(t *testing.T) { blk := genBeaconBlock() - got := v1alpha1.CopyBeaconBlock(blk) + got := blk.Copy() if !reflect.DeepEqual(got, blk) { t.Errorf("CopyBeaconBlock() = %v, want %v", got, blk) } @@ -33,7 +33,7 @@ func TestCopyBeaconBlock(t *testing.T) { func TestCopyBeaconBlockBody(t *testing.T) { body := genBeaconBlockBody() - got := v1alpha1.CopyBeaconBlockBody(body) + got := body.Copy() if !reflect.DeepEqual(got, body) { t.Errorf("CopyBeaconBlockBody() = %v, want %v", got, body) } @@ -43,7 +43,7 @@ func TestCopyBeaconBlockBody(t *testing.T) { func TestCopySignedBeaconBlockAltair(t *testing.T) { sbb := genSignedBeaconBlockAltair() - got := v1alpha1.CopySignedBeaconBlockAltair(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBeaconBlockAltair() = %v, want %v", got, sbb) } @@ -53,7 +53,7 @@ func TestCopySignedBeaconBlockAltair(t *testing.T) { func TestCopyBeaconBlockAltair(t *testing.T) { b := genBeaconBlockAltair() - got := v1alpha1.CopyBeaconBlockAltair(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBeaconBlockAltair() = %v, want %v", got, b) } @@ -63,7 +63,7 @@ func TestCopyBeaconBlockAltair(t *testing.T) { func TestCopyBeaconBlockBodyAltair(t *testing.T) { bb := genBeaconBlockBodyAltair() - got := v1alpha1.CopyBeaconBlockBodyAltair(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBeaconBlockBodyAltair() = %v, want %v", got, bb) } @@ -133,7 +133,7 @@ func TestCopyPendingAttestationSlice(t *testing.T) { func TestCopySignedBeaconBlockBellatrix(t *testing.T) { sbb := genSignedBeaconBlockBellatrix() - got := v1alpha1.CopySignedBeaconBlockBellatrix(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBeaconBlockBellatrix() = %v, want %v", got, sbb) } @@ -143,7 +143,7 @@ func TestCopySignedBeaconBlockBellatrix(t *testing.T) { func TestCopyBeaconBlockBellatrix(t *testing.T) { b := genBeaconBlockBellatrix() - got := v1alpha1.CopyBeaconBlockBellatrix(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBeaconBlockBellatrix() = %v, want %v", got, b) } @@ -153,7 +153,7 @@ func TestCopyBeaconBlockBellatrix(t *testing.T) { func TestCopyBeaconBlockBodyBellatrix(t *testing.T) { bb := genBeaconBlockBodyBellatrix() - got := v1alpha1.CopyBeaconBlockBodyBellatrix(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBeaconBlockBodyBellatrix() = %v, want %v", got, bb) } @@ -163,7 +163,7 @@ func TestCopyBeaconBlockBodyBellatrix(t *testing.T) { func TestCopySignedBlindedBeaconBlockBellatrix(t *testing.T) { sbb := genSignedBeaconBlockBellatrix() - got := v1alpha1.CopySignedBeaconBlockBellatrix(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBeaconBlockBellatrix() = %v, want %v", got, sbb) } @@ -173,7 +173,7 @@ func TestCopySignedBlindedBeaconBlockBellatrix(t *testing.T) { func TestCopyBlindedBeaconBlockBellatrix(t *testing.T) { b := genBeaconBlockBellatrix() - got := v1alpha1.CopyBeaconBlockBellatrix(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBeaconBlockBellatrix() = %v, want %v", got, b) } @@ -183,7 +183,7 @@ func TestCopyBlindedBeaconBlockBellatrix(t *testing.T) { func TestCopyBlindedBeaconBlockBodyBellatrix(t *testing.T) { bb := genBeaconBlockBodyBellatrix() - got := v1alpha1.CopyBeaconBlockBodyBellatrix(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBeaconBlockBodyBellatrix() = %v, want %v", got, bb) } @@ -193,7 +193,7 @@ func TestCopyBlindedBeaconBlockBodyBellatrix(t *testing.T) { func TestCopySignedBeaconBlockCapella(t *testing.T) { sbb := genSignedBeaconBlockCapella() - got := v1alpha1.CopySignedBeaconBlockCapella(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBeaconBlockCapella() = %v, want %v", got, sbb) } @@ -203,7 +203,7 @@ func TestCopySignedBeaconBlockCapella(t *testing.T) { func TestCopyBeaconBlockCapella(t *testing.T) { b := genBeaconBlockCapella() - got := v1alpha1.CopyBeaconBlockCapella(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBeaconBlockCapella() = %v, want %v", got, b) } @@ -213,7 +213,7 @@ func TestCopyBeaconBlockCapella(t *testing.T) { func TestCopyBeaconBlockBodyCapella(t *testing.T) { bb := genBeaconBlockBodyCapella() - got := v1alpha1.CopyBeaconBlockBodyCapella(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBeaconBlockBodyCapella() = %v, want %v", got, bb) } @@ -223,7 +223,7 @@ func TestCopyBeaconBlockBodyCapella(t *testing.T) { func TestCopySignedBlindedBeaconBlockCapella(t *testing.T) { sbb := genSignedBlindedBeaconBlockCapella() - got := v1alpha1.CopySignedBlindedBeaconBlockCapella(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBlindedBeaconBlockCapella() = %v, want %v", got, sbb) } @@ -233,7 +233,7 @@ func TestCopySignedBlindedBeaconBlockCapella(t *testing.T) { func TestCopyBlindedBeaconBlockCapella(t *testing.T) { b := genBlindedBeaconBlockCapella() - got := v1alpha1.CopyBlindedBeaconBlockCapella(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBlindedBeaconBlockCapella() = %v, want %v", got, b) } @@ -243,7 +243,7 @@ func TestCopyBlindedBeaconBlockCapella(t *testing.T) { func TestCopyBlindedBeaconBlockBodyCapella(t *testing.T) { bb := genBlindedBeaconBlockBodyCapella() - got := v1alpha1.CopyBlindedBeaconBlockBodyCapella(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBlindedBeaconBlockBodyCapella() = %v, want %v", got, bb) } @@ -253,7 +253,7 @@ func TestCopyBlindedBeaconBlockBodyCapella(t *testing.T) { func TestCopySignedBeaconBlockDeneb(t *testing.T) { sbb := genSignedBeaconBlockDeneb() - got := v1alpha1.CopySignedBeaconBlockDeneb(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBeaconBlockDeneb() = %v, want %v", got, sbb) } @@ -263,7 +263,7 @@ func TestCopySignedBeaconBlockDeneb(t *testing.T) { func TestCopyBeaconBlockDeneb(t *testing.T) { b := genBeaconBlockDeneb() - got := v1alpha1.CopyBeaconBlockDeneb(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBeaconBlockDeneb() = %v, want %v", got, b) } @@ -273,7 +273,7 @@ func TestCopyBeaconBlockDeneb(t *testing.T) { func TestCopyBeaconBlockBodyDeneb(t *testing.T) { bb := genBeaconBlockBodyDeneb() - got := v1alpha1.CopyBeaconBlockBodyDeneb(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBeaconBlockBodyDeneb() = %v, want %v", got, bb) } @@ -283,7 +283,7 @@ func TestCopyBeaconBlockBodyDeneb(t *testing.T) { func TestCopySignedBlindedBeaconBlockDeneb(t *testing.T) { sbb := genSignedBlindedBeaconBlockDeneb() - got := v1alpha1.CopySignedBlindedBeaconBlockDeneb(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("CopySignedBlindedBeaconBlockDeneb() = %v, want %v", got, sbb) } @@ -293,7 +293,7 @@ func TestCopySignedBlindedBeaconBlockDeneb(t *testing.T) { func TestCopyBlindedBeaconBlockDeneb(t *testing.T) { b := genBlindedBeaconBlockDeneb() - got := v1alpha1.CopyBlindedBeaconBlockDeneb(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("CopyBlindedBeaconBlockDeneb() = %v, want %v", got, b) } @@ -303,7 +303,7 @@ func TestCopyBlindedBeaconBlockDeneb(t *testing.T) { func TestCopyBlindedBeaconBlockBodyDeneb(t *testing.T) { bb := genBlindedBeaconBlockBodyDeneb() - got := v1alpha1.CopyBlindedBeaconBlockBodyDeneb(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("CopyBlindedBeaconBlockBodyDeneb() = %v, want %v", got, bb) } @@ -321,7 +321,7 @@ func bytes(length int) []byte { func TestCopySignedBlindedBeaconBlockElectra(t *testing.T) { sbb := genSignedBlindedBeaconBlockElectra() - got := v1alpha1.CopySignedBlindedBeaconBlockElectra(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("TestCopySignedBlindedBeaconBlockElectra() = %v, want %v", got, sbb) } @@ -330,7 +330,7 @@ func TestCopySignedBlindedBeaconBlockElectra(t *testing.T) { func TestCopyBlindedBeaconBlockElectra(t *testing.T) { b := genBlindedBeaconBlockElectra() - got := v1alpha1.CopyBlindedBeaconBlockElectra(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("TestCopyBlindedBeaconBlockElectra() = %v, want %v", got, b) } @@ -339,7 +339,7 @@ func TestCopyBlindedBeaconBlockElectra(t *testing.T) { func TestCopyBlindedBeaconBlockBodyElectra(t *testing.T) { bb := genBlindedBeaconBlockBodyElectra() - got := v1alpha1.CopyBlindedBeaconBlockBodyElectra(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("TestCopyBlindedBeaconBlockBodyElectra() = %v, want %v", got, bb) } @@ -348,7 +348,7 @@ func TestCopyBlindedBeaconBlockBodyElectra(t *testing.T) { func TestCopySignedBeaconBlockElectra(t *testing.T) { sbb := genSignedBeaconBlockElectra() - got := v1alpha1.CopySignedBeaconBlockElectra(sbb) + got := sbb.Copy() if !reflect.DeepEqual(got, sbb) { t.Errorf("TestCopySignedBeaconBlockElectra() = %v, want %v", got, sbb) } @@ -357,7 +357,7 @@ func TestCopySignedBeaconBlockElectra(t *testing.T) { func TestCopyBeaconBlockElectra(t *testing.T) { b := genBeaconBlockElectra() - got := v1alpha1.CopyBeaconBlockElectra(b) + got := b.Copy() if !reflect.DeepEqual(got, b) { t.Errorf("TestCopyBeaconBlockElectra() = %v, want %v", got, b) } @@ -366,7 +366,7 @@ func TestCopyBeaconBlockElectra(t *testing.T) { func TestCopyBeaconBlockBodyElectra(t *testing.T) { bb := genBeaconBlockBodyElectra() - got := v1alpha1.CopyBeaconBlockBodyElectra(bb) + got := bb.Copy() if !reflect.DeepEqual(got, bb) { t.Errorf("TestCopyBeaconBlockBodyElectra() = %v, want %v", got, bb) } From 2fc7cdeba7b8d990cdf8a3668d779d63be947e4e Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:30:56 -0500 Subject: [PATCH 220/325] Push proposer settings every slot (#14155) * test push settings every slot * updating comments * changing design a little bit based on feedback * adding corrected deadline --- validator/client/runner.go | 19 +++++------------ validator/client/runner_test.go | 34 ------------------------------ validator/client/validator.go | 12 ++++++++--- validator/client/validator_test.go | 7 +++++- 4 files changed, 20 insertions(+), 52 deletions(-) diff --git a/validator/client/runner.go b/validator/client/runner.go index c60de6423759..c07e6cb2dbe4 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -63,11 +63,7 @@ func run(ctx context.Context, v iface.Validator) { } deadline := time.Now().Add(5 * time.Minute) if err := v.PushProposerSettings(ctx, km, headSlot, deadline); err != nil { - if errors.Is(err, ErrBuilderValidatorRegistration) { - log.WithError(err).Warn("Push proposer settings error") - } else { - log.WithError(err).Fatal("Failed to update proposer settings") // allow fatal. skipcq - } + log.WithError(err).Fatal("Failed to update proposer settings") // allow fatal. skipcq } for { ctx, span := trace.StartSpan(ctx, "validator.processSlot") @@ -98,16 +94,11 @@ func run(ctx context.Context, v iface.Validator) { continue } - // call push proposer setting at the start of each epoch to account for the following edge case: + // call push proposer settings often to account for the following edge cases: // proposer is activated at the start of epoch and tries to propose immediately - if slots.IsEpochStart(slot) { - go func() { - // deadline set for 1 epoch from call to not overlap. - epochDeadline := v.SlotDeadline(slot + params.BeaconConfig().SlotsPerEpoch - 1) - if err := v.PushProposerSettings(ctx, km, slot, epochDeadline); err != nil { - log.WithError(err).Warn("Failed to update proposer settings") - } - }() + // account has changed in the middle of an epoch + if err := v.PushProposerSettings(ctx, km, slot, deadline); err != nil { + log.WithError(err).Warn("Failed to update proposer settings") } // Start fetching domain data for the next epoch. diff --git a/validator/client/runner_test.go b/validator/client/runner_test.go index dffadbabcc82..aee9800da4a9 100644 --- a/validator/client/runner_test.go +++ b/validator/client/runner_test.go @@ -370,37 +370,3 @@ func TestUpdateProposerSettingsAt_EpochEndOk(t *testing.T) { // can't test "Failed to update proposer settings" because of log.fatal assert.LogsContain(t, hook, "Mock updated proposer settings") } - -func TestUpdateProposerSettings_ContinuesAfterValidatorRegistrationFails(t *testing.T) { - errSomeOtherError := errors.New("some internal error") - ctrl := gomock.NewController(t) - defer ctrl.Finish() - node := healthTesting.NewMockHealthClient(ctrl) - tracker := beacon.NewNodeHealthTracker(node) - node.EXPECT().IsHealthy(gomock.Any()).Return(true).AnyTimes() - v := &testutil.FakeValidator{ - ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeOtherError.Error()), - Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, - Tracker: tracker, - } - err := v.SetProposerSettings(context.Background(), &proposer.Settings{ - DefaultConfig: &proposer.Option{ - FeeRecipientConfig: &proposer.FeeRecipientConfig{ - FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"), - }, - }, - }) - require.NoError(t, err) - ctx, cancel := context.WithCancel(context.Background()) - hook := logTest.NewGlobal() - slot := params.BeaconConfig().SlotsPerEpoch - ticker := make(chan primitives.Slot) - v.NextSlotRet = ticker - go func() { - ticker <- slot - - cancel() - }() - run(ctx, v) - assert.LogsContain(t, hook, ErrBuilderValidatorRegistration.Error()) -} diff --git a/validator/client/validator.go b/validator/client/validator.go index 4d8fbc668061..9423cfaad92e 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -1125,6 +1125,7 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey if err != nil { return err } + proposerReqs, err := v.buildPrepProposerReqs(filteredKeys) if err != nil { return err @@ -1139,16 +1140,21 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey "proposerSettingsRequestCount": len(proposerReqs), }).Debugln("Request count did not match included validator count. Only keys that have been activated will be included in the request.") } + if _, err := v.validatorClient.PrepareBeaconProposer(ctx, ðpb.PrepareBeaconProposerRequest{ Recipients: proposerReqs, }); err != nil { return err } - signedRegReqs := v.buildSignedRegReqs(ctx, filteredKeys, km.Sign) - if err := SubmitValidatorRegistrations(ctx, v.validatorClient, signedRegReqs, v.validatorsRegBatchSize); err != nil { - return errors.Wrap(ErrBuilderValidatorRegistration, err.Error()) + if len(signedRegReqs) > 0 { + go func() { + if err := SubmitValidatorRegistrations(ctx, v.validatorClient, signedRegReqs, v.validatorsRegBatchSize); err != nil { + log.WithError(errors.Wrap(ErrBuilderValidatorRegistration, err.Error())).Warn("failed to register validator on builder") + } + }() } + return nil } diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 734dfbd40702..69af50cf72e7 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -1477,6 +1477,7 @@ func TestValidator_PushSettings(t *testing.T) { feeRecipientMap map[primitives.ValidatorIndex]string mockExpectedRequests []ExpectedValidatorRegistration err string + logDelay time.Duration logMessages []string doesntContainLogs bool }{ @@ -1993,7 +1994,8 @@ func TestValidator_PushSettings(t *testing.T) { ).Return(&empty.Empty{}, errors.New("request failed")) return &v }, - err: "could not submit signed registrations to beacon node", + logMessages: []string{"request failed"}, + logDelay: 1 * time.Second, }, } for _, tt := range tests { @@ -2030,6 +2032,9 @@ func TestValidator_PushSettings(t *testing.T) { assert.ErrorContains(t, tt.err, err) } if len(tt.logMessages) > 0 { + if tt.logDelay > 0 { + time.Sleep(tt.logDelay) + } for _, message := range tt.logMessages { if tt.doesntContainLogs { assert.LogsDoNotContain(t, hook, message) From 52c036c3abecb1dea1ea5c7a2756a5abfc183a5f Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:52:55 -0500 Subject: [PATCH 221/325] missed adding electra process epoch on state replay - devnet 1 (#14272) * missed adding electra process epoch on state replay * abstracting common functionality as to not forget in processing * removing unnessesary error check * breaking out core process slots logic out * fixing small bug in epoch processing * adding small log to fix linting and make use of logrus in the package * adding some unit tests for process epoch * potuz's review feedback * reversing processing order based on feedback --- beacon-chain/core/electra/transition_test.go | 69 ++++++++++++ beacon-chain/core/transition/transition.go | 111 ++++++++++++------- beacon-chain/state/stategen/BUILD.bazel | 7 -- beacon-chain/state/stategen/replay.go | 78 +------------ beacon-chain/state/stategen/replay_test.go | 48 ++++++++ 5 files changed, 189 insertions(+), 124 deletions(-) diff --git a/beacon-chain/core/electra/transition_test.go b/beacon-chain/core/electra/transition_test.go index 5c111d2403dd..b94fb21611ec 100644 --- a/beacon-chain/core/electra/transition_test.go +++ b/beacon-chain/core/electra/transition_test.go @@ -1,11 +1,15 @@ package electra_test import ( + "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/config/params" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -47,3 +51,68 @@ func TestVerifyOperationLengths_Electra(t *testing.T) { require.ErrorContains(t, "incorrect outstanding deposits in block body", err) }) } + +func TestProcessEpoch_CanProcessElectra(t *testing.T) { + st, _ := util.DeterministicGenesisStateElectra(t, params.BeaconConfig().MaxValidatorsPerCommittee) + require.NoError(t, st.SetSlot(10*params.BeaconConfig().SlotsPerEpoch)) + require.NoError(t, st.SetDepositBalanceToConsume(100)) + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + deps := make([]*ethpb.PendingBalanceDeposit, 20) + for i := 0; i < len(deps); i += 1 { + deps[i] = ðpb.PendingBalanceDeposit{ + Amount: uint64(amountAvailForProcessing) / 10, + Index: primitives.ValidatorIndex(i), + } + } + require.NoError(t, st.SetPendingBalanceDeposits(deps)) + require.NoError(t, st.SetPendingConsolidations([]*ethpb.PendingConsolidation{ + { + SourceIndex: 2, + TargetIndex: 3, + }, + { + SourceIndex: 0, + TargetIndex: 1, + }, + })) + err := electra.ProcessEpoch(context.Background(), st) + require.NoError(t, err) + require.Equal(t, uint64(0), st.Slashings()[2], "Unexpected slashed balance") + + b := st.Balances() + require.Equal(t, params.BeaconConfig().MaxValidatorsPerCommittee, uint64(len(b))) + require.Equal(t, uint64(44799839993), b[0]) + + s, err := st.InactivityScores() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxValidatorsPerCommittee, uint64(len(s))) + + p, err := st.PreviousEpochParticipation() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxValidatorsPerCommittee, uint64(len(p))) + + p, err = st.CurrentEpochParticipation() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().MaxValidatorsPerCommittee, uint64(len(p))) + + sc, err := st.CurrentSyncCommittee() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().SyncCommitteeSize, uint64(len(sc.Pubkeys))) + + sc, err = st.NextSyncCommittee() + require.NoError(t, err) + require.Equal(t, params.BeaconConfig().SyncCommitteeSize, uint64(len(sc.Pubkeys))) + + res, err := st.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, primitives.Gwei(100), res) + + // Half of the balance deposits should have been processed. + remaining, err := st.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 10, len(remaining)) + + num, err := st.NumPendingConsolidations() + require.NoError(t, err) + require.Equal(t, uint64(2), num) +} diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index cc7a38341a06..fa64765bc404 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -29,6 +29,8 @@ import ( "go.opencensus.io/trace" ) +type customProcessingFn func(context.Context, state.BeaconState) error + // ExecuteStateTransition defines the procedure for a state transition function. // // Note: This method differs from the spec pseudocode as it uses a batch signature verification. @@ -173,18 +175,7 @@ func ProcessSlotsIfPossible(ctx context.Context, state state.BeaconState, target return state, nil } -// ProcessSlots process through skip slots and apply epoch transition when it's needed -// -// Spec pseudocode definition: -// -// def process_slots(state: BeaconState, slot: Slot) -> None: -// assert state.slot < slot -// while state.slot < slot: -// process_slot(state) -// # Process epoch on the start slot of the next epoch -// if (state.slot + 1) % SLOTS_PER_EPOCH == 0: -// process_epoch(state) -// state.slot = Slot(state.slot + 1) +// ProcessSlots includes core slot processing as well as a cache func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives.Slot) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "core.state.ProcessSlots") defer span.End() @@ -231,42 +222,63 @@ func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives. defer func() { SkipSlotCache.MarkNotInProgress(key) }() + state, err = ProcessSlotsCore(ctx, span, state, slot, cacheBestBeaconStateOnErrFn(highestSlot, key)) + if err != nil { + return nil, err + } + if highestSlot < state.Slot() { + SkipSlotCache.Put(ctx, key, state) + } - for state.Slot() < slot { + return state, nil +} + +func cacheBestBeaconStateOnErrFn(highestSlot primitives.Slot, key [32]byte) customProcessingFn { + return func(ctx context.Context, state state.BeaconState) error { if ctx.Err() != nil { - tracing.AnnotateError(span, ctx.Err()) // Cache last best value. if highestSlot < state.Slot() { - if SkipSlotCache.Put(ctx, key, state); err != nil { - log.WithError(err).Error("Failed to put skip slot cache value") - } + SkipSlotCache.Put(ctx, key, state) + } + return ctx.Err() + } + return nil + } +} + +// ProcessSlotsCore process through skip slots and apply epoch transition when it's needed +// +// Spec pseudocode definition: +// +// def process_slots(state: BeaconState, slot: Slot) -> None: +// assert state.slot < slot +// while state.slot < slot: +// process_slot(state) +// # Process epoch on the start slot of the next epoch +// if (state.slot + 1) % SLOTS_PER_EPOCH == 0: +// process_epoch(state) +// state.slot = Slot(state.slot + 1) +func ProcessSlotsCore(ctx context.Context, span *trace.Span, state state.BeaconState, slot primitives.Slot, fn customProcessingFn) (state.BeaconState, error) { + var err error + for state.Slot() < slot { + if fn != nil { + if err = fn(ctx, state); err != nil { + tracing.AnnotateError(span, err) + return nil, err } - return nil, ctx.Err() } state, err = ProcessSlot(ctx, state) if err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, "could not process slot") } - if time.CanProcessEpoch(state) { - if state.Version() == version.Phase0 { - state, err = ProcessEpochPrecompute(ctx, state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, "could not process epoch with optimizations") - } - } else if state.Version() <= version.Deneb { - if err = altair.ProcessEpoch(ctx, state); err != nil { - tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) - } - } else { - if err = electra.ProcessEpoch(ctx, state); err != nil { - tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) - } - } + + state, err = ProcessEpoch(ctx, state) + if err != nil { + tracing.AnnotateError(span, err) + return nil, err } + if err := state.SetSlot(state.Slot() + 1); err != nil { tracing.AnnotateError(span, err) return nil, errors.Wrap(err, "failed to increment state slot") @@ -278,12 +290,29 @@ func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives. return nil, errors.Wrap(err, "failed to upgrade state") } } + return state, nil +} - if highestSlot < state.Slot() { - SkipSlotCache.Put(ctx, key, state) +// ProcessEpoch is a wrapper on fork specific epoch processing +func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { + var err error + if time.CanProcessEpoch(state) { + if state.Version() == version.Electra { + if err = electra.ProcessEpoch(ctx, state); err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) + } + } else if state.Version() >= version.Altair { + if err = altair.ProcessEpoch(ctx, state); err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("could not process %s epoch", version.String(state.Version()))) + } + } else { + state, err = ProcessEpochPrecompute(ctx, state) + if err != nil { + return nil, errors.Wrap(err, "could not process epoch with optimizations") + } + } } - - return state, nil + return state, err } // UpgradeState upgrades the state to the next version if possible. @@ -330,6 +359,8 @@ func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconSta return nil, err } } + + log.Debugf("upgraded state to %s", version.String(state.Version())) return state, nil } diff --git a/beacon-chain/state/stategen/BUILD.bazel b/beacon-chain/state/stategen/BUILD.bazel index 8f0b0b3ed514..294a6680db4c 100644 --- a/beacon-chain/state/stategen/BUILD.bazel +++ b/beacon-chain/state/stategen/BUILD.bazel @@ -20,11 +20,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen", visibility = ["//visibility:public"], deps = [ - "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/capella:go_default_library", - "//beacon-chain/core/deneb:go_default_library", - "//beacon-chain/core/electra:go_default_library", - "//beacon-chain/core/execution:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", @@ -40,9 +35,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", - "//monitoring/tracing:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_hashicorp_golang_lru//:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/beacon-chain/state/stategen/replay.go b/beacon-chain/state/stategen/replay.go index 0ff967762ce6..12b64d0fed62 100644 --- a/beacon-chain/state/stategen/replay.go +++ b/beacon-chain/state/stategen/replay.go @@ -6,20 +6,12 @@ import ( "time" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/capella" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/deneb" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/execution" - prysmtime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -185,7 +177,6 @@ func ReplayProcessSlots(ctx context.Context, state state.BeaconState, slot primi if state == nil || state.IsNil() { return nil, errUnknownState } - if state.Slot() > slot { err := fmt.Errorf("expected state.slot %d <= slot %d", state.Slot(), slot) return nil, err @@ -195,74 +186,7 @@ func ReplayProcessSlots(ctx context.Context, state state.BeaconState, slot primi return state, nil } - var err error - for state.Slot() < slot { - state, err = transition.ProcessSlot(ctx, state) - if err != nil { - return nil, errors.Wrap(err, "could not process slot") - } - if prysmtime.CanProcessEpoch(state) { - if state.Version() == version.Phase0 { - state, err = transition.ProcessEpochPrecompute(ctx, state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, "could not process epoch with optimizations") - } - } else { - err = altair.ProcessEpoch(ctx, state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, "could not process epoch") - } - } - } - if err := state.SetSlot(state.Slot() + 1); err != nil { - tracing.AnnotateError(span, err) - return nil, errors.Wrap(err, "failed to increment state slot") - } - - if prysmtime.CanUpgradeToAltair(state.Slot()) { - state, err = altair.UpgradeToAltair(ctx, state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, err - } - } - - if prysmtime.CanUpgradeToBellatrix(state.Slot()) { - state, err = execution.UpgradeToBellatrix(state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, err - } - } - - if prysmtime.CanUpgradeToCapella(state.Slot()) { - state, err = capella.UpgradeToCapella(state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, err - } - } - - if prysmtime.CanUpgradeToDeneb(state.Slot()) { - state, err = deneb.UpgradeToDeneb(state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, err - } - } - - if prysmtime.CanUpgradeToElectra(state.Slot()) { - state, err = electra.UpgradeToElectra(state) - if err != nil { - tracing.AnnotateError(span, err) - return nil, err - } - } - } - - return state, nil + return transition.ProcessSlotsCore(ctx, span, state, slot, nil) } // Given the start slot and the end slot, this returns the finalized beacon blocks in between. diff --git a/beacon-chain/state/stategen/replay_test.go b/beacon-chain/state/stategen/replay_test.go index 4cbc53012330..768b84e59a52 100644 --- a/beacon-chain/state/stategen/replay_test.go +++ b/beacon-chain/state/stategen/replay_test.go @@ -5,12 +5,14 @@ import ( "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" testDB "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" "github.com/prysmaticlabs/prysm/v5/config/params" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -197,6 +199,52 @@ func TestReplayBlocks_ThroughFutureForkBoundaries(t *testing.T) { assert.Equal(t, version.Electra, newState.Version()) } +func TestReplayBlocks_ProcessEpoch_Electra(t *testing.T) { + params.SetupTestConfigCleanup(t) + bCfg := params.BeaconConfig().Copy() + bCfg.ElectraForkEpoch = 1 + bCfg.ForkVersionSchedule[bytesutil.ToBytes4(bCfg.ElectraForkVersion)] = 1 + params.OverrideBeaconConfig(bCfg) + + beaconState, _ := util.DeterministicGenesisStateElectra(t, 1) + require.NoError(t, beaconState.SetDepositBalanceToConsume(100)) + amountAvailForProcessing := helpers.ActivationExitChurnLimit(1_000 * 1e9) + require.NoError(t, beaconState.SetPendingBalanceDeposits([]*ethpb.PendingBalanceDeposit{ + { + Amount: uint64(amountAvailForProcessing) / 10, + Index: primitives.ValidatorIndex(0), + }, + })) + genesisBlock := util.NewBeaconBlockElectra() + bodyRoot, err := genesisBlock.Block.HashTreeRoot() + require.NoError(t, err) + err = beaconState.SetLatestBlockHeader(ðpb.BeaconBlockHeader{ + Slot: genesisBlock.Block.Slot, + ParentRoot: genesisBlock.Block.ParentRoot, + StateRoot: params.BeaconConfig().ZeroHash[:], + BodyRoot: bodyRoot[:], + }) + require.NoError(t, err) + + assert.Equal(t, version.Electra, beaconState.Version()) + require.Equal(t, params.BeaconConfig().MinActivationBalance, beaconState.Balances()[0]) + service := New(testDB.SetupDB(t), doublylinkedtree.New()) + targetSlot := (params.BeaconConfig().SlotsPerEpoch * 2) - 1 + newState, err := service.replayBlocks(context.Background(), beaconState, []interfaces.ReadOnlySignedBeaconBlock{}, targetSlot) + require.NoError(t, err) + + require.Equal(t, version.Electra, newState.Version()) + res, err := newState.DepositBalanceToConsume() + require.NoError(t, err) + require.Equal(t, primitives.Gwei(0), res) + + remaining, err := newState.PendingBalanceDeposits() + require.NoError(t, err) + require.Equal(t, 0, len(remaining)) + + require.Equal(t, params.BeaconConfig().MinActivationBalance+(uint64(amountAvailForProcessing)/10), newState.Balances()[0]) +} + func TestLoadBlocks_FirstBranch(t *testing.T) { beaconDB := testDB.SetupDB(t) ctx := context.Background() From 09028033c04a4fd1c85bc20b29673168d49d7baf Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:02:25 -0500 Subject: [PATCH 222/325] adding corrected returns under handle error (#14280) --- beacon-chain/rpc/eth/beacon/handlers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 914541ae0789..4f3cf8d9658c 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -116,9 +116,11 @@ func (s *Server) getBlockV2Ssz(w http.ResponseWriter, blk interfaces.ReadOnlySig result, err := s.getBlockResponseBodySsz(blk) if err != nil { httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError) + return } if result == nil { httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) + return } w.Header().Set(api.VersionHeader, version.String(blk.Version())) httputil.WriteSsz(w, result, "beacon_block.ssz") @@ -149,6 +151,11 @@ func (s *Server) getBlockV2Json(ctx context.Context, w http.ResponseWriter, blk result, err := s.getBlockResponseBodyJson(ctx, blk) if err != nil { httputil.HandleError(w, "Error processing request: "+err.Error(), http.StatusInternalServerError) + return + } + if result == nil { + httputil.HandleError(w, fmt.Sprintf("Unknown block type %T", blk), http.StatusInternalServerError) + return } w.Header().Set(api.VersionHeader, result.Version) httputil.WriteJson(w, result) From be807283205a257b041dd81281cc1f0ae049a646 Mon Sep 17 00:00:00 2001 From: shangchengbabaiban Date: Wed, 31 Jul 2024 20:06:15 +0900 Subject: [PATCH 223/325] chore: fix some comments (#14270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shangchengbabaiban Co-authored-by: Radosław Kapka --- beacon-chain/state/state-native/setters_consolidation.go | 2 +- config/proposer/settings.go | 2 +- network/endpoint.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/state/state-native/setters_consolidation.go b/beacon-chain/state/state-native/setters_consolidation.go index 525230578f0a..d814832dd72b 100644 --- a/beacon-chain/state/state-native/setters_consolidation.go +++ b/beacon-chain/state/state-native/setters_consolidation.go @@ -48,7 +48,7 @@ func (b *BeaconState) SetPendingConsolidations(val []*ethpb.PendingConsolidation return nil } -// SetEarliestConsolidationEpoch is a mutating call to the beacon state which sets the earlest +// SetEarliestConsolidationEpoch is a mutating call to the beacon state which sets the earliest // consolidation epoch value. This method requires access to the Lock on the state and only applies // in electra or later. func (b *BeaconState) SetEarliestConsolidationEpoch(epoch primitives.Epoch) error { diff --git a/config/proposer/settings.go b/config/proposer/settings.go index eea44066c973..88338eca7dbe 100644 --- a/config/proposer/settings.go +++ b/config/proposer/settings.go @@ -108,7 +108,7 @@ type Settings struct { DefaultConfig *Option } -// ShouldBeSaved goes through checks to see if the value should be savable +// ShouldBeSaved goes through checks to see if the value should be saveable // Pseudocode: conditions for being saved into the database // 1. settings are not nil // 2. proposeconfig is not nil (this defines specific settings for each validator key), default config can be nil in this case and fall back to beacon node settings diff --git a/network/endpoint.go b/network/endpoint.go index a7456793861d..0012fff1e6d8 100644 --- a/network/endpoint.go +++ b/network/endpoint.go @@ -32,7 +32,7 @@ func (e Endpoint) Equals(other Endpoint) bool { return e.Url == other.Url && e.Auth.Equals(other.Auth) } -// HttpClient creates a http client object dependant +// HttpClient creates a http client object dependent // on the properties of the network endpoint. func (e Endpoint) HttpClient() *http.Client { if e.Auth.Method != authorization.Bearer { From 38d4e179bafb394481b9a0b451fdc8fad4f52f36 Mon Sep 17 00:00:00 2001 From: ethfanWilliam Date: Wed, 31 Jul 2024 16:10:18 +0400 Subject: [PATCH 224/325] chore: fix unfound image (#14167) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove Feature Flag From Prater (#12082) * Use Epoch boundary cache to retrieve balances (#12083) * Use Epoch boundary cache to retrieve balances * save boundary states before inserting to forkchoice * move up last block save * remove boundary checks on balances * fix ordering --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> * chore: fix unfound image * fix link --------- Co-authored-by: Nishant Das Co-authored-by: Potuz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Preston Van Loon Co-authored-by: Radosław Kapka --- runtime/logging/logrus-prefixed-formatter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/logging/logrus-prefixed-formatter/README.md b/runtime/logging/logrus-prefixed-formatter/README.md index cf15699db6cd..e51b5d2e0f1b 100644 --- a/runtime/logging/logrus-prefixed-formatter/README.md +++ b/runtime/logging/logrus-prefixed-formatter/README.md @@ -6,7 +6,7 @@ Originally from [github.com/x-cray/logrus-prefixed-formatter(https://github.com/ modified colored output and support for log entry prefixes, e.g. message source followed by a colon. In addition, custom color themes are supported. -![Formatter screenshot](http://cl.ly/image/1w0B3F233F3z/formatter-screenshot@2x.png) +![Formatter screenshot](http://i.imgur.com/PY7qMwd.png) Just like with the original `logrus.TextFormatter` when a TTY is not attached, the output is compatible with the [logfmt](http://godoc.org/github.com/kr/logfmt) format: From c50cfb044aa482f875496b8e69f19a4ccc8c26a4 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 31 Jul 2024 09:52:23 -0300 Subject: [PATCH 225/325] Get all beacon committees at once (#14282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Get all beacon committees at once * Update beacon-chain/core/helpers/beacon_committee.go --------- Co-authored-by: Radosław Kapka --- beacon-chain/core/helpers/beacon_committee.go | 41 +++++++++++++++++++ .../core/helpers/beacon_committee_test.go | 25 +++++++++++ 2 files changed, 66 insertions(+) diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 91d6c5a863ac..6437670ca678 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -82,6 +82,47 @@ func AttestationCommittees(ctx context.Context, st state.ReadOnlyBeaconState, at return committees, nil } +// BeaconCommittees returns the list of all beacon committees for a given state at a given slot. +func BeaconCommittees(ctx context.Context, state state.ReadOnlyBeaconState, slot primitives.Slot) ([][]primitives.ValidatorIndex, error) { + epoch := slots.ToEpoch(slot) + activeCount, err := ActiveValidatorCount(ctx, state, epoch) + if err != nil { + return nil, errors.Wrap(err, "could not compute active validator count") + } + committeesPerSlot := SlotCommitteeCount(activeCount) + seed, err := Seed(state, epoch, params.BeaconConfig().DomainBeaconAttester) + if err != nil { + return nil, errors.Wrap(err, "could not get seed") + } + + committees := make([][]primitives.ValidatorIndex, committeesPerSlot) + var activeIndices []primitives.ValidatorIndex + + for idx := primitives.CommitteeIndex(0); idx < primitives.CommitteeIndex(len(committees)); idx++ { + committee, err := committeeCache.Committee(ctx, slot, seed, idx) + if err != nil { + return nil, errors.Wrap(err, "could not interface with committee cache") + } + if committee != nil { + committees[idx] = committee + continue + } + + if len(activeIndices) == 0 { + activeIndices, err = ActiveValidatorIndices(ctx, state, epoch) + if err != nil { + return nil, errors.Wrap(err, "could not get active indices") + } + } + committee, err = BeaconCommittee(ctx, activeIndices, seed, slot, idx) + if err != nil { + return nil, errors.Wrap(err, "could not compute beacon committee") + } + committees[idx] = committee + } + return committees, nil +} + // BeaconCommitteeFromState returns the crosslink committee of a given slot and committee index. This // is a spec implementation where state is used as an argument. In case of state retrieval // becomes expensive, consider using BeaconCommittee below. diff --git a/beacon-chain/core/helpers/beacon_committee_test.go b/beacon-chain/core/helpers/beacon_committee_test.go index 2bbafdd0fa9e..9604ede6f596 100644 --- a/beacon-chain/core/helpers/beacon_committee_test.go +++ b/beacon-chain/core/helpers/beacon_committee_test.go @@ -18,6 +18,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -749,3 +750,27 @@ func TestAttestationCommittees(t *testing.T) { assert.Equal(t, params.BeaconConfig().TargetCommitteeSize, uint64(len(committees[1]))) }) } + +func TestBeaconCommittees(t *testing.T) { + prevConfig := params.BeaconConfig().Copy() + defer params.OverrideBeaconConfig(prevConfig) + c := params.BeaconConfig().Copy() + c.MinGenesisActiveValidatorCount = 128 + c.SlotsPerEpoch = 4 + c.TargetCommitteeSize = 16 + params.OverrideBeaconConfig(c) + + state, _ := util.DeterministicGenesisState(t, 256) + + activeCount, err := helpers.ActiveValidatorCount(context.Background(), state, 0) + require.NoError(t, err) + committeesPerSlot := helpers.SlotCommitteeCount(activeCount) + committees, err := helpers.BeaconCommittees(context.Background(), state, 0) + require.NoError(t, err) + require.Equal(t, committeesPerSlot, uint64(len(committees))) + for idx := primitives.CommitteeIndex(0); idx < primitives.CommitteeIndex(len(committees)); idx++ { + committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, 0, idx) + require.NoError(t, err) + require.DeepEqual(t, committees[idx], committee) + } +} From 7c69a9aa1c7e56d667666a261cb071416e0dd3f2 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 31 Jul 2024 13:01:19 -0300 Subject: [PATCH 226/325] Refactor CommitteeAssignments to get all committees at once (#14284) --- beacon-chain/core/helpers/beacon_committee.go | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 6437670ca678..e8443630a7ee 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -294,36 +294,22 @@ func CommitteeAssignments(ctx context.Context, state state.BeaconState, epoch pr if err := verifyAssignmentEpoch(epoch, state); err != nil { return nil, err } - - // Retrieve active validator count for the specified epoch. - activeValidatorCount, err := ActiveValidatorCount(ctx, state, epoch) - if err != nil { - return nil, err - } - - // Determine the number of committees per slot based on the number of active validator indices. - numCommitteesPerSlot := SlotCommitteeCount(activeValidatorCount) - startSlot, err := slots.EpochStart(epoch) if err != nil { return nil, err } - - assignments := make(map[primitives.ValidatorIndex]*CommitteeAssignment) vals := make(map[primitives.ValidatorIndex]struct{}) for _, v := range validators { vals[v] = struct{}{} } - + assignments := make(map[primitives.ValidatorIndex]*CommitteeAssignment) // Compute committee assignments for each slot in the epoch. for slot := startSlot; slot < startSlot+params.BeaconConfig().SlotsPerEpoch; slot++ { - // Compute committees for the current slot. - for j := uint64(0); j < numCommitteesPerSlot; j++ { - committee, err := BeaconCommitteeFromState(ctx, state, slot, primitives.CommitteeIndex(j)) - if err != nil { - return nil, err - } - + committees, err := BeaconCommittees(ctx, state, slot) + if err != nil { + return nil, errors.Wrap(err, "could not compute beacon committees") + } + for j, committee := range committees { for _, vIndex := range committee { if _, ok := vals[vIndex]; !ok { // Skip if the validator is not in the provided validators slice. continue @@ -337,7 +323,6 @@ func CommitteeAssignments(ctx context.Context, state state.BeaconState, epoch pr } } } - return assignments, nil } From 0ed74b3c4a8618dcb8032cd807c95daa05947dce Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:28:50 -0500 Subject: [PATCH 227/325] removing explicit deadlines on push proposer settings (#14285) * removing deadlines * fixing mock interface implementation --- validator/accounts/testing/mock.go | 2 +- validator/client/iface/validator.go | 2 +- validator/client/runner.go | 10 ++++------ validator/client/testutil/mock_validator.go | 5 +---- validator/client/validator.go | 5 +---- validator/client/validator_test.go | 3 +-- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index f1e9560e3794..e98a0592a12a 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -204,7 +204,7 @@ func (*Validator) HasProposerSettings() bool { } // PushProposerSettings for mocking -func (_ *Validator) PushProposerSettings(_ context.Context, _ keymanager.IKeymanager, _ primitives.Slot, _ time.Time) error { +func (_ *Validator) PushProposerSettings(_ context.Context, _ keymanager.IKeymanager, _ primitives.Slot) error { panic("implement me") } diff --git a/validator/client/iface/validator.go b/validator/client/iface/validator.go index 60757e748718..647ef06a2faa 100644 --- a/validator/client/iface/validator.go +++ b/validator/client/iface/validator.go @@ -57,7 +57,7 @@ type Validator interface { Keymanager() (keymanager.IKeymanager, error) HandleKeyReload(ctx context.Context, currentKeys [][fieldparams.BLSPubkeyLength]byte) (bool, error) CheckDoppelGanger(ctx context.Context) error - PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, deadline time.Time) error + PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot) error SignValidatorRegistrationRequest(ctx context.Context, signer SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error) StartEventStream(ctx context.Context, topics []string, eventsChan chan<- *event.Event) EventStreamIsRunning() bool diff --git a/validator/client/runner.go b/validator/client/runner.go index c07e6cb2dbe4..34bc8273496c 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -61,9 +61,8 @@ func run(ctx context.Context, v iface.Validator) { log.Warn("Validator client started without proposer settings such as fee recipient" + " and will continue to use settings provided in the beacon node.") } - deadline := time.Now().Add(5 * time.Minute) - if err := v.PushProposerSettings(ctx, km, headSlot, deadline); err != nil { - log.WithError(err).Fatal("Failed to update proposer settings") // allow fatal. skipcq + if err := v.PushProposerSettings(ctx, km, headSlot); err != nil { + log.WithError(err).Fatal("Failed to update proposer settings") } for { ctx, span := trace.StartSpan(ctx, "validator.processSlot") @@ -97,7 +96,7 @@ func run(ctx context.Context, v iface.Validator) { // call push proposer settings often to account for the following edge cases: // proposer is activated at the start of epoch and tries to propose immediately // account has changed in the middle of an epoch - if err := v.PushProposerSettings(ctx, km, slot, deadline); err != nil { + if err := v.PushProposerSettings(ctx, km, slot); err != nil { log.WithError(err).Warn("Failed to update proposer settings") } @@ -316,8 +315,7 @@ func runHealthCheckRoutine(ctx context.Context, v iface.Validator, eventsChan ch log.WithError(err).Error("Could not get canonical head slot") return } - deadline := time.Now().Add(5 * time.Minute) // Should consider changing to a constant - if err := v.PushProposerSettings(ctx, km, slot, deadline); err != nil { + if err := v.PushProposerSettings(ctx, km, slot); err != nil { log.WithError(err).Warn("Failed to update proposer settings") } } diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index 883206d8ea0a..0e462c1c6203 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -254,10 +254,7 @@ func (*FakeValidator) HasProposerSettings() bool { } // PushProposerSettings for mocking -func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, _ primitives.Slot, deadline time.Time) error { - nctx, cancel := context.WithDeadline(ctx, deadline) - ctx = nctx - defer cancel() +func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, _ primitives.Slot) error { time.Sleep(fv.ProposerSettingWait) if errors.Is(ctx.Err(), context.DeadlineExceeded) { log.Error("deadline exceeded") diff --git a/validator/client/validator.go b/validator/client/validator.go index 9423cfaad92e..b89c9e88fcd9 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -1102,16 +1102,13 @@ func (v *validator) SetProposerSettings(ctx context.Context, settings *proposer. } // PushProposerSettings calls the prepareBeaconProposer RPC to set the fee recipient and also the register validator API if using a custom builder. -func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, deadline time.Time) error { +func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot) error { ctx, span := trace.StartSpan(ctx, "validator.PushProposerSettings") defer span.End() if km == nil { return errors.New("keymanager is nil when calling PrepareBeaconProposer") } - nctx, cancel := context.WithDeadline(ctx, deadline) - ctx = nctx - defer cancel() pubkeys, err := km.FetchValidatingPublicKeys(ctx) if err != nil { diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 69af50cf72e7..2d9eca2ff3e9 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -2027,8 +2027,7 @@ func TestValidator_PushSettings(t *testing.T) { require.Equal(t, len(tt.mockExpectedRequests), len(signedRegisterValidatorRequests)) require.Equal(t, len(signedRegisterValidatorRequests), len(v.signedValidatorRegistrations)) } - deadline := time.Now().Add(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) - if err := v.PushProposerSettings(ctx, km, 0, deadline); tt.err != "" { + if err := v.PushProposerSettings(ctx, km, 0); tt.err != "" { assert.ErrorContains(t, tt.err, err) } if len(tt.logMessages) > 0 { From 600ca08aa897bafad1b0bb49ee5c3aa2c763d156 Mon Sep 17 00:00:00 2001 From: Potuz Date: Thu, 1 Aug 2024 17:22:37 -0300 Subject: [PATCH 228/325] Use the beacon block root to verify the prestate (#14290) --- beacon-chain/blockchain/process_block.go | 2 +- beacon-chain/blockchain/process_block_helpers.go | 6 +++--- beacon-chain/blockchain/process_block_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index fc52ca2b0b9d..454928b0a39d 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -142,7 +142,7 @@ func (s *Service) onBlockBatch(ctx context.Context, blks []consensusblocks.ROBlo b := blks[0].Block() // Retrieve incoming block's pre state. - if err := s.verifyBlkPreState(ctx, b); err != nil { + if err := s.verifyBlkPreState(ctx, b.ParentRoot()); err != nil { return err } preState, err := s.cfg.StateGen.StateByRootInitialSync(ctx, b.ParentRoot()) diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 5e1e7a3e6ef6..9e07cb4e17b3 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -14,6 +14,7 @@ import ( forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" + field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -285,7 +286,7 @@ func (s *Service) getBlockPreState(ctx context.Context, b interfaces.ReadOnlyBea defer span.End() // Verify incoming block has a valid pre state. - if err := s.verifyBlkPreState(ctx, b); err != nil { + if err := s.verifyBlkPreState(ctx, b.ParentRoot()); err != nil { return nil, err } @@ -311,11 +312,10 @@ func (s *Service) getBlockPreState(ctx context.Context, b interfaces.ReadOnlyBea } // verifyBlkPreState validates input block has a valid pre-state. -func (s *Service) verifyBlkPreState(ctx context.Context, b interfaces.ReadOnlyBeaconBlock) error { +func (s *Service) verifyBlkPreState(ctx context.Context, parentRoot [field_params.RootLength]byte) error { ctx, span := trace.StartSpan(ctx, "blockChain.verifyBlkPreState") defer span.End() - parentRoot := b.ParentRoot() // Loosen the check to HasBlock because state summary gets saved in batches // during initial syncing. There's no risk given a state summary object is just a // subset of the block object. diff --git a/beacon-chain/blockchain/process_block_test.go b/beacon-chain/blockchain/process_block_test.go index d1d1f606ea92..8d47d014cea5 100644 --- a/beacon-chain/blockchain/process_block_test.go +++ b/beacon-chain/blockchain/process_block_test.go @@ -117,7 +117,7 @@ func TestCachedPreState_CanGetFromStateSummary(t *testing.T) { require.NoError(t, service.cfg.BeaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Slot: 1, Root: root[:]})) require.NoError(t, service.cfg.StateGen.SaveState(ctx, root, st)) - require.NoError(t, service.verifyBlkPreState(ctx, wsb.Block())) + require.NoError(t, service.verifyBlkPreState(ctx, wsb.Block().ParentRoot())) } func TestFillForkChoiceMissingBlocks_CanSave(t *testing.T) { From 13e09c58f6212a4f0737dfb81b3707b5296dde20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 2 Aug 2024 13:53:43 +0200 Subject: [PATCH 229/325] Committee-aware attestation packing (#14245) * initial algorithm * ready for review * feature flag * typo * review * comment fix * fix TestProposer_sort_DifferentCommittees * flag usage --- .../validator/proposer_attestations.go | 156 +++++++++- .../validator/proposer_attestations_test.go | 278 +++++++++++++++--- .../validator/proposer_utils_bench_test.go | 2 +- config/features/config.go | 5 + config/features/flags.go | 5 + .../attestation/aggregation/maxcover_test.go | 12 + 6 files changed, 408 insertions(+), 50 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index b17d39900adf..f278b9316ab6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -11,6 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -112,18 +113,12 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon if err != nil { return nil, err } - sorted, err := deduped.sortByProfitability() + sorted, err := deduped.sort() if err != nil { return nil, err } atts = sorted.limitToMaxAttestations() - - atts, err = vs.filterAttestationBySignature(ctx, atts, latestState) - if err != nil { - return nil, err - } - - return atts, nil + return vs.filterAttestationBySignature(ctx, atts, latestState) } // filter separates attestation list into two groups: valid and invalid attestations. @@ -143,14 +138,6 @@ func (a proposerAtts) filter(ctx context.Context, st state.BeaconState) (propose return validAtts, invalidAtts } -// sortByProfitability orders attestations by highest slot and by highest aggregation bit count. -func (a proposerAtts) sortByProfitability() (proposerAtts, error) { - if len(a) < 2 { - return a, nil - } - return a.sortByProfitabilityUsingMaxCover() -} - // sortByProfitabilityUsingMaxCover orders attestations by highest slot and by highest aggregation bit count. // Duplicate bits are counted only once, using max-cover algorithm. func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { @@ -218,6 +205,143 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { return sortedAtts, nil } +// sort attestations as follows: +// +// - all attestations selected by max-cover are taken, leftover attestations are discarded +// (with current parameters all bits of a leftover attestation are already covered by selected attestations) +// - selected attestations are ordered by slot, with higher slot coming first +// - within a slot, all top attestations (one per committee) are ordered before any second-best attestations, second-best before third-best etc. +// - within top/second-best/etc. attestations (one per committee), attestations are ordered by bit count, with higher bit count coming first +func (a proposerAtts) sort() (proposerAtts, error) { + if len(a) < 2 { + return a, nil + } + + if features.Get().EnableCommitteeAwarePacking { + return a.sortBySlotAndCommittee() + } + return a.sortByProfitabilityUsingMaxCover() +} + +// Separate attestations by slot, as slot number takes higher precedence when sorting. +// Also separate by committee index because maxcover will prefer attestations for the same +// committee with disjoint bits over attestations for different committees with overlapping +// bits, even though same bits for different committees are separate votes. +func (a proposerAtts) sortBySlotAndCommittee() (proposerAtts, error) { + type slotAtts struct { + candidates map[primitives.CommitteeIndex]proposerAtts + selected map[primitives.CommitteeIndex]proposerAtts + leftover map[primitives.CommitteeIndex]proposerAtts + } + + var slots []primitives.Slot + attsBySlot := map[primitives.Slot]*slotAtts{} + for _, att := range a { + slot := att.GetData().Slot + ci := att.GetData().CommitteeIndex + if _, ok := attsBySlot[slot]; !ok { + attsBySlot[slot] = &slotAtts{} + attsBySlot[slot].candidates = make(map[primitives.CommitteeIndex]proposerAtts) + slots = append(slots, slot) + } + attsBySlot[slot].candidates[ci] = append(attsBySlot[slot].candidates[ci], att) + } + + var err error + for _, sa := range attsBySlot { + sa.selected = make(map[primitives.CommitteeIndex]proposerAtts) + sa.leftover = make(map[primitives.CommitteeIndex]proposerAtts) + for ci, committeeAtts := range sa.candidates { + sa.selected[ci], err = committeeAtts.sortByProfitabilityUsingMaxCover_committeeAwarePacking() + if err != nil { + return nil, err + } + } + } + + var sortedAtts proposerAtts + sort.Slice(slots, func(i, j int) bool { + return slots[i] > slots[j] + }) + for _, slot := range slots { + sortedAtts = append(sortedAtts, sortSlotAttestations(attsBySlot[slot].selected)...) + } + for _, slot := range slots { + sortedAtts = append(sortedAtts, sortSlotAttestations(attsBySlot[slot].leftover)...) + } + + return sortedAtts, nil +} + +// sortByProfitabilityUsingMaxCover orders attestations by highest aggregation bit count. +// Duplicate bits are counted only once, using max-cover algorithm. +func (a proposerAtts) sortByProfitabilityUsingMaxCover_committeeAwarePacking() (proposerAtts, error) { + if len(a) < 2 { + return a, nil + } + candidates := make([]*bitfield.Bitlist64, len(a)) + for i := 0; i < len(a); i++ { + var err error + candidates[i], err = a[i].GetAggregationBits().ToBitlist64() + if err != nil { + return nil, err + } + } + // Add selected candidates on top, those that are not selected - append at bottom. + selectedKeys, _, err := aggregation.MaxCover(candidates, len(candidates), true /* allowOverlaps */) + if err != nil { + log.WithError(err).Debug("MaxCover aggregation failed") + return a, nil + } + + // Pick selected attestations first, leftover attestations will be appended at the end. + // Both lists will be sorted by number of bits set. + selected := make(proposerAtts, selectedKeys.Count()) + for i, key := range selectedKeys.BitIndices() { + selected[i] = a[key] + } + sort.Slice(selected, func(i, j int) bool { + return selected[i].GetAggregationBits().Count() > selected[j].GetAggregationBits().Count() + }) + return selected, nil +} + +// sortSlotAttestations assumes each proposerAtts value in the map is ordered by profitability. +// The function takes the first attestation from each value, orders these attestations by bit count +// and places them at the start of the resulting slice. It then takes the second attestation for each value, +// orders these attestations by bit count and appends them to the end. +// It continues this pattern until all attestations are processed. +func sortSlotAttestations(slotAtts map[primitives.CommitteeIndex]proposerAtts) proposerAtts { + attCount := 0 + for _, committeeAtts := range slotAtts { + attCount += len(committeeAtts) + } + + sorted := make([]ethpb.Att, 0, attCount) + + processedCount := 0 + index := 0 + for processedCount < attCount { + var atts []ethpb.Att + + for _, committeeAtts := range slotAtts { + if len(committeeAtts) > index { + atts = append(atts, committeeAtts[index]) + } + } + + sort.Slice(atts, func(i, j int) bool { + return atts[i].GetAggregationBits().Count() > atts[j].GetAggregationBits().Count() + }) + sorted = append(sorted, atts...) + + processedCount += len(atts) + index++ + } + + return sorted +} + // limitToMaxAttestations limits attestations to maximum attestations per block. func (a proposerAtts) limitToMaxAttestations() proposerAtts { if len(a) == 0 { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index c1ea5d35401d..d15cdfd7b1d9 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" + "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls/blst" @@ -19,31 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" ) -func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { - atts := proposerAtts([]ethpb.Att{ - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11000000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11100000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11110000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11100000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), - }) - want := proposerAtts([]ethpb.Att{ - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11110000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11100000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11100000}}), - util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11000000}}), - }) - atts, err := atts.sortByProfitability() - if err != nil { - t.Error(err) - } - require.DeepEqual(t, want, atts) -} - -func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { +func TestProposer_ProposerAtts_sort(t *testing.T) { type testData struct { slot primitives.Slot bits bitfield.Bitlist @@ -60,7 +37,7 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { t.Run("no atts", func(t *testing.T) { atts := getAtts([]testData{}) want := getAtts([]testData{}) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } @@ -74,7 +51,7 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { want := getAtts([]testData{ {4, bitfield.Bitlist{0b11100000, 0b1}}, }) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } @@ -90,7 +67,7 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { {4, bitfield.Bitlist{0b11100000, 0b1}}, {1, bitfield.Bitlist{0b11000000, 0b1}}, }) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } @@ -108,7 +85,7 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { {4, bitfield.Bitlist{0b11100000, 0b1}}, {1, bitfield.Bitlist{0b11000000, 0b1}}, }) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } @@ -129,7 +106,7 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { {1, bitfield.Bitlist{0b00001100, 0b1}}, {1, bitfield.Bitlist{0b11001000, 0b1}}, }) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } @@ -154,14 +131,14 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { {1, bitfield.Bitlist{0b11100000, 0b1}}, {1, bitfield.Bitlist{0b11000000, 0b1}}, }) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } require.DeepEqual(t, want, atts) }) - t.Run("selected and non selected atts sorted by bit count", func(t *testing.T) { + t.Run("follows max-cover", func(t *testing.T) { // Items at slot 4, must be first split into two lists by max-cover, with // 0b10000011 scoring higher (as it provides more info in addition to already selected // attestations) than 0b11100001 (despite naive bit count suggesting otherwise). Then, @@ -186,7 +163,7 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { {1, bitfield.Bitlist{0b11100000, 0b1}}, {1, bitfield.Bitlist{0b11000000, 0b1}}, }) - atts, err := atts.sortByProfitability() + atts, err := atts.sort() if err != nil { t.Error(err) } @@ -194,6 +171,241 @@ func TestProposer_ProposerAtts_sortByProfitabilityUsingMaxCover(t *testing.T) { }) } +func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { + type testData struct { + slot primitives.Slot + bits bitfield.Bitlist + } + getAtts := func(data []testData) proposerAtts { + var atts proposerAtts + for _, att := range data { + atts = append(atts, util.HydrateAttestation(ðpb.Attestation{ + Data: ðpb.AttestationData{Slot: att.slot}, AggregationBits: att.bits})) + } + return atts + } + + t.Run("no atts", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + atts := getAtts([]testData{}) + want := getAtts([]testData{}) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) + + t.Run("single att", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + atts := getAtts([]testData{ + {4, bitfield.Bitlist{0b11100000, 0b1}}, + }) + want := getAtts([]testData{ + {4, bitfield.Bitlist{0b11100000, 0b1}}, + }) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) + + t.Run("single att per slot", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + atts := getAtts([]testData{ + {1, bitfield.Bitlist{0b11000000, 0b1}}, + {4, bitfield.Bitlist{0b11100000, 0b1}}, + }) + want := getAtts([]testData{ + {4, bitfield.Bitlist{0b11100000, 0b1}}, + {1, bitfield.Bitlist{0b11000000, 0b1}}, + }) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) + + t.Run("two atts on one of the slots", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + atts := getAtts([]testData{ + {1, bitfield.Bitlist{0b11000000, 0b1}}, + {4, bitfield.Bitlist{0b11100000, 0b1}}, + {4, bitfield.Bitlist{0b11110000, 0b1}}, + }) + want := getAtts([]testData{ + {4, bitfield.Bitlist{0b11110000, 0b1}}, + {1, bitfield.Bitlist{0b11000000, 0b1}}, + }) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) + + t.Run("compare to native sort", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + // The max-cover based approach will select 0b00001100 instead, despite lower bit count + // (since it has two new/unknown bits). + t.Run("max-cover", func(t *testing.T) { + atts := getAtts([]testData{ + {1, bitfield.Bitlist{0b11000011, 0b1}}, + {1, bitfield.Bitlist{0b11001000, 0b1}}, + {1, bitfield.Bitlist{0b00001100, 0b1}}, + }) + want := getAtts([]testData{ + {1, bitfield.Bitlist{0b11000011, 0b1}}, + {1, bitfield.Bitlist{0b00001100, 0b1}}, + }) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) + }) + + t.Run("multiple slots", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + atts := getAtts([]testData{ + {2, bitfield.Bitlist{0b11100000, 0b1}}, + {4, bitfield.Bitlist{0b11100000, 0b1}}, + {1, bitfield.Bitlist{0b11000000, 0b1}}, + {4, bitfield.Bitlist{0b11110000, 0b1}}, + {1, bitfield.Bitlist{0b11100000, 0b1}}, + {3, bitfield.Bitlist{0b11000000, 0b1}}, + }) + want := getAtts([]testData{ + {4, bitfield.Bitlist{0b11110000, 0b1}}, + {3, bitfield.Bitlist{0b11000000, 0b1}}, + {2, bitfield.Bitlist{0b11100000, 0b1}}, + {1, bitfield.Bitlist{0b11100000, 0b1}}, + }) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) + + t.Run("follows max-cover", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + // Items at slot 4 must be first split into two lists by max-cover, with + // 0b10000011 being selected and 0b11100001 being leftover (despite naive bit count suggesting otherwise). + atts := getAtts([]testData{ + {4, bitfield.Bitlist{0b00000001, 0b1}}, + {4, bitfield.Bitlist{0b11100001, 0b1}}, + {1, bitfield.Bitlist{0b11000000, 0b1}}, + {2, bitfield.Bitlist{0b11100000, 0b1}}, + {4, bitfield.Bitlist{0b10000011, 0b1}}, + {4, bitfield.Bitlist{0b11111000, 0b1}}, + {1, bitfield.Bitlist{0b11100000, 0b1}}, + {3, bitfield.Bitlist{0b11000000, 0b1}}, + }) + want := getAtts([]testData{ + {4, bitfield.Bitlist{0b11111000, 0b1}}, + {4, bitfield.Bitlist{0b10000011, 0b1}}, + {3, bitfield.Bitlist{0b11000000, 0b1}}, + {2, bitfield.Bitlist{0b11100000, 0b1}}, + {1, bitfield.Bitlist{0b11100000, 0b1}}, + }) + atts, err := atts.sort() + if err != nil { + t.Error(err) + } + require.DeepEqual(t, want, atts) + }) +} + +func TestProposer_sort_DifferentCommittees(t *testing.T) { + t.Run("one att per committee", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 1}}) + c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11100000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 2}}) + atts := proposerAtts{c1_a1, c2_a1} + atts, err := atts.sort() + require.NoError(t, err) + want := proposerAtts{c1_a1, c2_a1} + assert.DeepEqual(t, want, atts) + }) + t.Run("multiple atts per committee", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111100, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 1}}) + c1_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b10000010, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 1}}) + c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11110000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 2}}) + c2_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11100000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 2}}) + atts := proposerAtts{c1_a1, c1_a2, c2_a1, c2_a2} + atts, err := atts.sort() + require.NoError(t, err) + + want := proposerAtts{c1_a1, c2_a1, c1_a2} + assert.DeepEqual(t, want, atts) + }) + t.Run("multiple atts per committee, multiple slots", func(t *testing.T) { + feat := features.Get() + feat.EnableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + + s2_c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111100, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 1}}) + s2_c1_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b10000010, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 1}}) + s2_c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11110000, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 2}}) + s2_c2_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11000000, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 2}}) + s1_c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111100, 0b1}, Data: ðpb.AttestationData{Slot: 1, CommitteeIndex: 1}}) + s1_c1_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b10000010, 0b1}, Data: ðpb.AttestationData{Slot: 1, CommitteeIndex: 1}}) + s1_c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11110000, 0b1}, Data: ðpb.AttestationData{Slot: 1, CommitteeIndex: 2}}) + s1_c2_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11000000, 0b1}, Data: ðpb.AttestationData{Slot: 1, CommitteeIndex: 2}}) + + // Arrange in some random order + atts := proposerAtts{s1_c1_a1, s2_c1_a2, s1_c2_a2, s2_c2_a2, s1_c2_a1, s2_c2_a1, s1_c1_a2, s2_c1_a1} + + atts, err := atts.sort() + require.NoError(t, err) + + want := proposerAtts{s2_c1_a1, s2_c2_a1, s2_c1_a2, s1_c1_a1, s1_c2_a1, s1_c1_a2} + assert.DeepEqual(t, want, atts) + }) +} + func TestProposer_ProposerAtts_dedup(t *testing.T) { data1 := util.HydrateAttestationData(ðpb.AttestationData{ Slot: 4, diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go index d1407a9b7b86..ac38a9283e81 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go @@ -49,7 +49,7 @@ func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { for i, att := range atts { attsCopy[i] = att.(*ethpb.Attestation).Copy() } - _, err := attsCopy.sortByProfitability() + _, err := attsCopy.sort() require.NoError(b, err, "Could not sort attestations by profitability") } diff --git a/config/features/config.go b/config/features/config.go index 98ae1ed49ebd..e570274a352c 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -48,6 +48,7 @@ type Flags struct { EnableDoppelGanger bool // EnableDoppelGanger enables doppelganger protection on startup for the validator. EnableHistoricalSpaceRepresentation bool // EnableHistoricalSpaceRepresentation enables the saving of registry validators in separate buckets to save space EnableBeaconRESTApi bool // EnableBeaconRESTApi enables experimental usage of the beacon REST API by the validator when querying a beacon node + EnableCommitteeAwarePacking bool // EnableCommitteeAwarePacking TODO // Logging related toggles. DisableGRPCConnectionLogs bool // Disables logging when a new grpc client has connected. EnableFullSSZDataLogging bool // Enables logging for full ssz data on rejected gossip messages @@ -254,6 +255,10 @@ func ConfigureBeaconChain(ctx *cli.Context) error { logEnabled(EnableQUIC) cfg.EnableQUIC = true } + if ctx.IsSet(EnableCommitteeAwarePacking.Name) { + logEnabled(EnableCommitteeAwarePacking) + cfg.EnableCommitteeAwarePacking = true + } cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value} Init(cfg) diff --git a/config/features/flags.go b/config/features/flags.go index af97adaaab8f..b53f08522923 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -166,6 +166,10 @@ var ( Name: "enable-quic", Usage: "Enables connection using the QUIC protocol for peers which support it.", } + EnableCommitteeAwarePacking = &cli.BoolFlag{ + Name: "enable-committee-aware-packing", + Usage: "Changes the attestation packing algorithm to one that is aware of attesting committees.", + } ) // devModeFlags holds list of flags that are set when development mode is on. @@ -223,6 +227,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c EnableLightClient, BlobSaveFsync, EnableQUIC, + EnableCommitteeAwarePacking, }...)...) // E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E. diff --git a/proto/prysm/v1alpha1/attestation/aggregation/maxcover_test.go b/proto/prysm/v1alpha1/attestation/aggregation/maxcover_test.go index 47a6aca454c4..22ef91e73574 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/maxcover_test.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/maxcover_test.go @@ -663,6 +663,18 @@ func TestMaxCover_MaxCover(t *testing.T) { }}, wantedErr: "empty bitlists: invalid max_cover problem", }, + { + name: "doesn't select bitlist which is a subset of another bitlist", + args: args{k: 3, allowOverlaps: true, candidates: []*bitfield.Bitlist64{ + bitfield.NewBitlist64From([]uint64{0b00011100}), + bitfield.NewBitlist64From([]uint64{0b00011110}), + bitfield.NewBitlist64From([]uint64{0b00000001}), + }}, + want: &BitSetAggregation{ + Coverage: bitfield.NewBitlist64From([]uint64{0b00011111}), + Keys: []int{1, 2}, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 836608537e6239d21ef7933abb147ede8e3dca74 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:55:17 +0100 Subject: [PATCH 230/325] HTTP endpoint for `GetValidatorParticipation` (#14261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add endpoint * remove canonicalFetcher * Add replayerBuilder to coreService * fix endpoint template * fix string query params * gaz * fix linter * test fix * Radek' review * remove unused request struct + gaz * linter * gaz --------- Co-authored-by: rkapka Co-authored-by: Radosław Kapka --- api/server/structs/endpoints_validator.go | 19 + beacon-chain/rpc/core/validator.go | 84 ++++ beacon-chain/rpc/endpoints.go | 17 +- beacon-chain/rpc/endpoints_test.go | 5 +- .../rpc/prysm/v1alpha1/beacon/BUILD.bazel | 2 - .../rpc/prysm/v1alpha1/beacon/validators.go | 78 +--- .../prysm/v1alpha1/beacon/validators_test.go | 56 +-- beacon-chain/rpc/prysm/validator/BUILD.bazel | 26 +- beacon-chain/rpc/prysm/validator/handlers.go | 58 +++ .../rpc/prysm/validator/handlers_test.go | 407 ++++++++++++++++++ beacon-chain/rpc/prysm/validator/server.go | 10 +- beacon-chain/rpc/service.go | 1 + 12 files changed, 654 insertions(+), 109 deletions(-) create mode 100644 beacon-chain/rpc/prysm/validator/handlers.go create mode 100644 beacon-chain/rpc/prysm/validator/handlers_test.go diff --git a/api/server/structs/endpoints_validator.go b/api/server/structs/endpoints_validator.go index 960033375f28..c24d4c795345 100644 --- a/api/server/structs/endpoints_validator.go +++ b/api/server/structs/endpoints_validator.go @@ -118,3 +118,22 @@ type GetValidatorPerformanceResponse struct { MissingValidators [][]byte `json:"missing_validators,omitempty"` InactivityScores []uint64 `json:"inactivity_scores,omitempty"` } + +type GetValidatorParticipationResponse struct { + Epoch string `json:"epoch"` + Finalized bool `json:"finalized"` + Participation *ValidatorParticipation `json:"participation"` +} + +type ValidatorParticipation struct { + GlobalParticipationRate string `json:"global_participation_rate" deprecated:"true"` + VotedEther string `json:"voted_ether" deprecated:"true"` + EligibleEther string `json:"eligible_ether" deprecated:"true"` + CurrentEpochActiveGwei string `json:"current_epoch_active_gwei"` + CurrentEpochAttestingGwei string `json:"current_epoch_attesting_gwei"` + CurrentEpochTargetAttestingGwei string `json:"current_epoch_target_attesting_gwei"` + PreviousEpochActiveGwei string `json:"previous_epoch_active_gwei"` + PreviousEpochAttestingGwei string `json:"previous_epoch_attesting_gwei"` + PreviousEpochTargetAttestingGwei string `json:"previous_epoch_target_attesting_gwei"` + PreviousEpochHeadAttestingGwei string `json:"previous_epoch_head_attesting_gwei"` +} diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 251e29ca68e1..871a94589456 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -752,3 +752,87 @@ func subnetsFromCommittee(pubkey []byte, comm *ethpb.SyncCommittee) []uint64 { } return positions } + +// ValidatorParticipation retrieves the validator participation information for a given epoch, +// it returns the information about validator's participation rate in voting on the proof of stake +// rules based on their balance compared to the total active validator balance. +func (s *Service) ValidatorParticipation( + ctx context.Context, + requestedEpoch primitives.Epoch, +) ( + *ethpb.ValidatorParticipationResponse, + *RpcError, +) { + currentSlot := s.GenesisTimeFetcher.CurrentSlot() + currentEpoch := slots.ToEpoch(currentSlot) + + if requestedEpoch > currentEpoch { + return nil, &RpcError{ + Err: fmt.Errorf("cannot retrieve information about an epoch greater than current epoch, current epoch %d, requesting %d", currentEpoch, requestedEpoch), + Reason: BadRequest, + } + } + // Use the last slot of requested epoch to obtain current and previous epoch attestations. + // This ensures that we don't miss previous attestations when input requested epochs. + endSlot, err := slots.EpochEnd(requestedEpoch) + if err != nil { + return nil, &RpcError{Reason: Internal, Err: errors.Wrap(err, "could not get slot from requested epoch")} + } + // Get as close as we can to the end of the current epoch without going past the current slot. + // The above check ensures a future *epoch* isn't requested, but the end slot of the requested epoch could still + // be past the current slot. In that case, use the current slot as the best approximation of the requested epoch. + // Replayer will make sure the slot ultimately used is canonical. + if endSlot > currentSlot { + endSlot = currentSlot + } + + // ReplayerBuilder ensures that a canonical chain is followed to the slot + beaconSt, err := s.ReplayerBuilder.ReplayerForSlot(endSlot).ReplayBlocks(ctx) + if err != nil { + return nil, &RpcError{Reason: Internal, Err: errors.Wrapf(err, "error replaying blocks for state at slot %d", endSlot)} + } + var v []*precompute.Validator + var b *precompute.Balance + + if beaconSt.Version() == version.Phase0 { + v, b, err = precompute.New(ctx, beaconSt) + if err != nil { + return nil, &RpcError{Reason: Internal, Err: errors.Wrap(err, "could not set up pre compute instance")} + } + _, b, err = precompute.ProcessAttestations(ctx, beaconSt, v, b) + if err != nil { + return nil, &RpcError{Reason: Internal, Err: errors.Wrap(err, "could not pre compute attestations")} + } + } else if beaconSt.Version() >= version.Altair { + v, b, err = altair.InitializePrecomputeValidators(ctx, beaconSt) + if err != nil { + return nil, &RpcError{Reason: Internal, Err: errors.Wrap(err, "could not set up altair pre compute instance")} + } + _, b, err = altair.ProcessEpochParticipation(ctx, beaconSt, b, v) + if err != nil { + return nil, &RpcError{Reason: Internal, Err: errors.Wrap(err, "could not pre compute attestations: %v")} + } + } else { + return nil, &RpcError{Reason: Internal, Err: fmt.Errorf("invalid state type retrieved with a version of %s", version.String(beaconSt.Version()))} + } + + cp := s.FinalizedFetcher.FinalizedCheckpt() + p := ðpb.ValidatorParticipationResponse{ + Epoch: requestedEpoch, + Finalized: requestedEpoch <= cp.Epoch, + Participation: ðpb.ValidatorParticipation{ + // TODO(7130): Remove these three deprecated fields. + GlobalParticipationRate: float32(b.PrevEpochTargetAttested) / float32(b.ActivePrevEpoch), + VotedEther: b.PrevEpochTargetAttested, + EligibleEther: b.ActivePrevEpoch, + CurrentEpochActiveGwei: b.ActiveCurrentEpoch, + CurrentEpochAttestingGwei: b.CurrentEpochAttested, + CurrentEpochTargetAttestingGwei: b.CurrentEpochTargetAttested, + PreviousEpochActiveGwei: b.ActivePrevEpoch, + PreviousEpochAttestingGwei: b.PrevEpochAttested, + PreviousEpochTargetAttestingGwei: b.PrevEpochTargetAttested, + PreviousEpochHeadAttestingGwei: b.PrevEpochHeadAttested, + }, + } + return p, nil +} diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index c8a15a3b4e09..ef9502cd97cd 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -70,7 +70,7 @@ func (s *Service) endpoints( endpoints = append(endpoints, s.eventsEndpoints()...) endpoints = append(endpoints, s.prysmBeaconEndpoints(ch, stater, coreService)...) endpoints = append(endpoints, s.prysmNodeEndpoints()...) - endpoints = append(endpoints, s.prysmValidatorEndpoints(coreService)...) + endpoints = append(endpoints, s.prysmValidatorEndpoints(stater, coreService)...) if enableDebug { endpoints = append(endpoints, s.debugEndpoints(stater)...) } @@ -1060,9 +1060,11 @@ func (s *Service) prysmNodeEndpoints() []endpoint { } } -func (*Service) prysmValidatorEndpoints(coreService *core.Service) []endpoint { +func (s *Service) prysmValidatorEndpoints(stater lookup.Stater, coreService *core.Service) []endpoint { server := &validatorprysm.Server{ - CoreService: coreService, + ChainInfoFetcher: s.cfg.ChainInfoFetcher, + Stater: stater, + CoreService: coreService, } const namespace = "prysm.validator" @@ -1087,5 +1089,14 @@ func (*Service) prysmValidatorEndpoints(coreService *core.Service) []endpoint { handler: server.GetValidatorPerformance, methods: []string{http.MethodPost}, }, + { + template: "/prysm/v1/validators/participation", + name: namespace + ".GetValidatorParticipation", + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetValidatorParticipation, + methods: []string{http.MethodGet}, + }, } } diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index e3d8d753b114..8e9277ed5bf5 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -124,8 +124,9 @@ func Test_endpoints(t *testing.T) { } prysmValidatorRoutes := map[string][]string{ - "/prysm/validators/performance": {http.MethodPost}, - "/prysm/v1/validators/performance": {http.MethodPost}, + "/prysm/validators/performance": {http.MethodPost}, + "/prysm/v1/validators/performance": {http.MethodPost}, + "/prysm/v1/validators/participation": {http.MethodGet}, } s := &Service{cfg: &Config{}} diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel index e9ee37d4291c..22aa404d2d75 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel @@ -19,8 +19,6 @@ go_library( "//api/pagination:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/cache:go_default_library", - "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/feed/block:go_default_library", "//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/state:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index 4b4e59b04802..9e3dcd6dfdd8 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -7,8 +7,6 @@ import ( "strconv" "github.com/prysmaticlabs/prysm/v5/api/pagination" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" @@ -477,7 +475,7 @@ func (bs *Server) GetValidatorActiveSetChanges( func (bs *Server) GetValidatorParticipation( ctx context.Context, req *ethpb.GetValidatorParticipationRequest, ) (*ethpb.ValidatorParticipationResponse, error) { - currentSlot := bs.GenesisTimeFetcher.CurrentSlot() + currentSlot := bs.CoreService.GenesisTimeFetcher.CurrentSlot() currentEpoch := slots.ToEpoch(currentSlot) var requestedEpoch primitives.Epoch @@ -489,79 +487,11 @@ func (bs *Server) GetValidatorParticipation( default: requestedEpoch = currentEpoch } - - if requestedEpoch > currentEpoch { - return nil, status.Errorf( - codes.InvalidArgument, - "Cannot retrieve information about an epoch greater than current epoch, current epoch %d, requesting %d", - currentEpoch, - requestedEpoch, - ) - } - // Use the last slot of requested epoch to obtain current and previous epoch attestations. - // This ensures that we don't miss previous attestations when input requested epochs. - endSlot, err := slots.EpochEnd(requestedEpoch) + vp, err := bs.CoreService.ValidatorParticipation(ctx, requestedEpoch) if err != nil { - return nil, err + return nil, status.Errorf(core.ErrorReasonToGRPC(err.Reason), "Could not retrieve validator participation: %v", err.Err) } - // Get as close as we can to the end of the current epoch without going past the current slot. - // The above check ensures a future *epoch* isn't requested, but the end slot of the requested epoch could still - // be past the current slot. In that case, use the current slot as the best approximation of the requested epoch. - // Replayer will make sure the slot ultimately used is canonical. - if endSlot > currentSlot { - endSlot = currentSlot - } - - // ReplayerBuilder ensures that a canonical chain is followed to the slot - beaconState, err := bs.ReplayerBuilder.ReplayerForSlot(endSlot).ReplayBlocks(ctx) - if err != nil { - return nil, status.Error(codes.Internal, fmt.Sprintf("error replaying blocks for state at slot %d: %v", endSlot, err)) - } - var v []*precompute.Validator - var b *precompute.Balance - - if beaconState.Version() == version.Phase0 { - v, b, err = precompute.New(ctx, beaconState) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not set up pre compute instance: %v", err) - } - _, b, err = precompute.ProcessAttestations(ctx, beaconState, v, b) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not pre compute attestations: %v", err) - } - } else if beaconState.Version() >= version.Altair { - v, b, err = altair.InitializePrecomputeValidators(ctx, beaconState) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not set up altair pre compute instance: %v", err) - } - _, b, err = altair.ProcessEpochParticipation(ctx, beaconState, b, v) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not pre compute attestations: %v", err) - } - } else { - return nil, status.Errorf(codes.Internal, "Invalid state type retrieved with a version of %d", beaconState.Version()) - } - - cp := bs.FinalizationFetcher.FinalizedCheckpt() - p := ðpb.ValidatorParticipationResponse{ - Epoch: requestedEpoch, - Finalized: requestedEpoch <= cp.Epoch, - Participation: ðpb.ValidatorParticipation{ - // TODO(7130): Remove these three deprecated fields. - GlobalParticipationRate: float32(b.PrevEpochTargetAttested) / float32(b.ActivePrevEpoch), - VotedEther: b.PrevEpochTargetAttested, - EligibleEther: b.ActivePrevEpoch, - CurrentEpochActiveGwei: b.ActiveCurrentEpoch, - CurrentEpochAttestingGwei: b.CurrentEpochAttested, - CurrentEpochTargetAttestingGwei: b.CurrentEpochTargetAttested, - PreviousEpochActiveGwei: b.ActivePrevEpoch, - PreviousEpochAttestingGwei: b.PrevEpochAttested, - PreviousEpochTargetAttestingGwei: b.PrevEpochTargetAttested, - PreviousEpochHeadAttestingGwei: b.PrevEpochHeadAttested, - }, - } - - return p, nil + return vp, nil } // GetValidatorQueue retrieves the current validator queue information. diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go index 83abeb5ae372..fa012e50368b 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go @@ -1476,27 +1476,25 @@ func TestServer_GetValidatorQueue_PendingExit(t *testing.T) { } func TestServer_GetValidatorParticipation_CannotRequestFutureEpoch(t *testing.T) { - beaconDB := dbTest.SetupDB(t) - ctx := context.Background() headState, err := util.NewBeaconState() require.NoError(t, err) require.NoError(t, headState.SetSlot(0)) bs := &Server{ - BeaconDB: beaconDB, - HeadFetcher: &mock.ChainService{ - State: headState, + CoreService: &core.Service{ + HeadFetcher: &mock.ChainService{ + State: headState, + }, + GenesisTimeFetcher: &mock.ChainService{}, }, - GenesisTimeFetcher: &mock.ChainService{}, - StateGen: stategen.New(beaconDB, doublylinkedtree.New()), } - wanted := "Cannot retrieve information about an epoch" + wanted := "cannot retrieve information about an epoch" _, err = bs.GetValidatorParticipation( ctx, ðpb.GetValidatorParticipationRequest{ QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{ - Epoch: slots.ToEpoch(bs.GenesisTimeFetcher.CurrentSlot()) + 1, + Epoch: slots.ToEpoch(bs.CoreService.GenesisTimeFetcher.CurrentSlot()) + 1, }, }, ) @@ -1549,18 +1547,20 @@ func TestServer_GetValidatorParticipation_CurrentAndPrevEpoch(t *testing.T) { m := &mock.ChainService{State: headState} offset := int64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) bs := &Server{ - BeaconDB: beaconDB, - HeadFetcher: m, - StateGen: stategen.New(beaconDB, doublylinkedtree.New()), - GenesisTimeFetcher: &mock.ChainService{ - Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + BeaconDB: beaconDB, + StateGen: stategen.New(beaconDB, doublylinkedtree.New()), + CoreService: &core.Service{ + HeadFetcher: m, + GenesisTimeFetcher: &mock.ChainService{ + Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, }, CanonicalFetcher: &mock.ChainService{ CanonicalRoots: map[[32]byte]bool{ bRoot: true, }, }, - FinalizationFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, } addDefaultReplayerBuilder(bs, beaconDB) @@ -1628,18 +1628,20 @@ func TestServer_GetValidatorParticipation_OrphanedUntilGenesis(t *testing.T) { m := &mock.ChainService{State: headState} offset := int64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) bs := &Server{ - BeaconDB: beaconDB, - HeadFetcher: m, - StateGen: stategen.New(beaconDB, doublylinkedtree.New()), - GenesisTimeFetcher: &mock.ChainService{ - Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + BeaconDB: beaconDB, + StateGen: stategen.New(beaconDB, doublylinkedtree.New()), + CoreService: &core.Service{ + HeadFetcher: m, + GenesisTimeFetcher: &mock.ChainService{ + Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, }, CanonicalFetcher: &mock.ChainService{ CanonicalRoots: map[[32]byte]bool{ bRoot: true, }, }, - FinalizationFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, } addDefaultReplayerBuilder(bs, beaconDB) @@ -1744,13 +1746,15 @@ func runGetValidatorParticipationCurrentAndPrevEpoch(t *testing.T, genState stat m := &mock.ChainService{State: genState} offset := int64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) bs := &Server{ - BeaconDB: beaconDB, + BeaconDB: beaconDB, + CoreService: &core.Service{ + GenesisTimeFetcher: &mock.ChainService{ + Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, + }, HeadFetcher: m, StateGen: stategen.New(beaconDB, doublylinkedtree.New()), - GenesisTimeFetcher: &mock.ChainService{ - Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), - }, - FinalizationFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, } addDefaultReplayerBuilder(bs, beaconDB) diff --git a/beacon-chain/rpc/prysm/validator/BUILD.bazel b/beacon-chain/rpc/prysm/validator/BUILD.bazel index 1c0e4f9368cb..b5ba1d424dc9 100644 --- a/beacon-chain/rpc/prysm/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/validator/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "handlers.go", "server.go", "validator_performance.go", ], @@ -10,9 +11,15 @@ go_library( visibility = ["//visibility:public"], deps = [ "//api/server/structs:go_default_library", + "//beacon-chain/blockchain:go_default_library", + "//beacon-chain/db:go_default_library", "//beacon-chain/rpc/core:go_default_library", + "//beacon-chain/rpc/eth/shared:go_default_library", + "//beacon-chain/rpc/lookup:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//time/slots:go_default_library", + "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], @@ -20,23 +27,40 @@ go_library( go_test( name = "go_default_test", - srcs = ["validator_performance_test.go"], + srcs = [ + "handlers_test.go", + "validator_performance_test.go", + ], embed = [":go_default_library"], deps = [ "//api/server/structs:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", + "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/db/testing:go_default_library", + "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", "//beacon-chain/rpc/core:go_default_library", + "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", + "//beacon-chain/state/stategen:go_default_library", + "//beacon-chain/state/stategen/mock:go_default_library", "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", + "//consensus-types/blocks/testing:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", + "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "//time:go_default_library", + "//time/slots:go_default_library", + "@com_github_gorilla_mux//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/validator/handlers.go b/beacon-chain/rpc/prysm/validator/handlers.go new file mode 100644 index 000000000000..983c11ac1c55 --- /dev/null +++ b/beacon-chain/rpc/prysm/validator/handlers.go @@ -0,0 +1,58 @@ +package validator + +import ( + "fmt" + "net/http" + + "github.com/gorilla/mux" + "github.com/prysmaticlabs/prysm/v5/api/server/structs" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v5/network/httputil" + "github.com/prysmaticlabs/prysm/v5/time/slots" + "go.opencensus.io/trace" +) + +// GetValidatorParticipation retrieves the validator participation information for a given epoch, +// it returns the information about validator's participation rate in voting on the proof of stake +// rules based on their balance compared to the total active validator balance. +func (s *Server) GetValidatorParticipation(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.GetValidatorParticipation") + defer span.End() + + stateId := mux.Vars(r)["state_id"] + if stateId == "" { + httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) + return + } + + st, err := s.Stater.State(ctx, []byte(stateId)) + if err != nil { + shared.WriteStateFetchError(w, err) + return + } + stEpoch := slots.ToEpoch(st.Slot()) + vp, rpcError := s.CoreService.ValidatorParticipation(ctx, stEpoch) + if rpcError != nil { + httputil.HandleError(w, rpcError.Err.Error(), core.ErrorReasonToHTTP(rpcError.Reason)) + return + } + + response := &structs.GetValidatorParticipationResponse{ + Epoch: fmt.Sprintf("%d", vp.Epoch), + Finalized: vp.Finalized, + Participation: &structs.ValidatorParticipation{ + GlobalParticipationRate: fmt.Sprintf("%f", vp.Participation.GlobalParticipationRate), + VotedEther: fmt.Sprintf("%d", vp.Participation.VotedEther), + EligibleEther: fmt.Sprintf("%d", vp.Participation.EligibleEther), + CurrentEpochActiveGwei: fmt.Sprintf("%d", vp.Participation.CurrentEpochActiveGwei), + CurrentEpochAttestingGwei: fmt.Sprintf("%d", vp.Participation.CurrentEpochAttestingGwei), + CurrentEpochTargetAttestingGwei: fmt.Sprintf("%d", vp.Participation.CurrentEpochTargetAttestingGwei), + PreviousEpochActiveGwei: fmt.Sprintf("%d", vp.Participation.PreviousEpochActiveGwei), + PreviousEpochAttestingGwei: fmt.Sprintf("%d", vp.Participation.PreviousEpochAttestingGwei), + PreviousEpochTargetAttestingGwei: fmt.Sprintf("%d", vp.Participation.PreviousEpochTargetAttestingGwei), + PreviousEpochHeadAttestingGwei: fmt.Sprintf("%d", vp.Participation.PreviousEpochHeadAttestingGwei), + }, + } + httputil.WriteJson(w, response) +} diff --git a/beacon-chain/rpc/prysm/validator/handlers_test.go b/beacon-chain/rpc/prysm/validator/handlers_test.go new file mode 100644 index 000000000000..d73276ab712f --- /dev/null +++ b/beacon-chain/rpc/prysm/validator/handlers_test.go @@ -0,0 +1,407 @@ +package validator + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "math" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/gorilla/mux" + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/api/server/structs" + mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" + doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" + mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + blocktest "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks/testing" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + prysmTime "github.com/prysmaticlabs/prysm/v5/time" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +func addDefaultReplayerBuilder(s *Server, h stategen.HistoryAccessor) { + cc := &mockstategen.CanonicalChecker{Is: true, Err: nil} + cs := &mockstategen.CurrentSlotter{Slot: math.MaxUint64 - 1} + s.CoreService.ReplayerBuilder = stategen.NewCanonicalHistory(h, cc, cs) +} + +func TestServer_GetValidatorParticipation_NoState(t *testing.T) { + headState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, headState.SetSlot(0)) + + var st state.BeaconState + st, _ = util.DeterministicGenesisState(t, 4) + + s := &Server{ + Stater: &testutil.MockStater{ + BeaconState: st, + }, + CoreService: &core.Service{ + HeadFetcher: &mock.ChainService{ + State: headState, + }, + GenesisTimeFetcher: &mock.ChainService{}, + }, + } + + url := "http://example.com" + fmt.Sprintf("%d", slots.ToEpoch(s.CoreService.GenesisTimeFetcher.CurrentSlot())+1) + request := httptest.NewRequest(http.MethodGet, url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetValidatorParticipation(writer, request) + require.Equal(t, http.StatusBadRequest, writer.Code) + require.StringContains(t, "state_id is required in URL params", writer.Body.String()) +} + +func TestServer_GetValidatorParticipation_CurrentAndPrevEpoch(t *testing.T) { + helpers.ClearCache() + beaconDB := dbTest.SetupDB(t) + + ctx := context.Background() + validatorCount := uint64(32) + + validators := make([]*ethpb.Validator, validatorCount) + balances := make([]uint64, validatorCount) + for i := 0; i < len(validators); i++ { + validators[i] = ðpb.Validator{ + PublicKey: bytesutil.ToBytes(uint64(i), 48), + WithdrawalCredentials: make([]byte, 32), + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + } + balances[i] = params.BeaconConfig().MaxEffectiveBalance + } + + atts := []*ethpb.PendingAttestation{{ + Data: util.HydrateAttestationData(ðpb.AttestationData{}), + InclusionDelay: 1, + AggregationBits: bitfield.NewBitlist(validatorCount / uint64(params.BeaconConfig().SlotsPerEpoch)), + }} + headState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, headState.SetSlot(8)) + require.NoError(t, headState.SetValidators(validators)) + require.NoError(t, headState.SetBalances(balances)) + require.NoError(t, headState.AppendCurrentEpochAttestations(atts[0])) + require.NoError(t, headState.AppendPreviousEpochAttestations(atts[0])) + + b := util.NewBeaconBlock() + b.Block.Slot = 8 + util.SaveBlock(t, ctx, beaconDB, b) + bRoot, err := b.Block.HashTreeRoot() + require.NoError(t, beaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Root: bRoot[:]})) + require.NoError(t, beaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Root: params.BeaconConfig().ZeroHash[:]})) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, bRoot)) + require.NoError(t, err) + require.NoError(t, beaconDB.SaveState(ctx, headState, bRoot)) + require.NoError(t, beaconDB.SaveState(ctx, headState, params.BeaconConfig().ZeroHash)) + + m := &mock.ChainService{State: headState} + offset := int64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) + + var st state.BeaconState + st, _ = util.DeterministicGenesisState(t, 4) + + s := &Server{ + Stater: &testutil.MockStater{ + BeaconState: st, + }, + BeaconDB: beaconDB, + CoreService: &core.Service{ + HeadFetcher: m, + StateGen: stategen.New(beaconDB, doublylinkedtree.New()), + GenesisTimeFetcher: &mock.ChainService{ + Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, + }, + CanonicalFetcher: &mock.ChainService{ + CanonicalRoots: map[[32]byte]bool{ + bRoot: true, + }, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetValidatorParticipation(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + + want := &structs.GetValidatorParticipationResponse{ + Participation: &structs.ValidatorParticipation{ + GlobalParticipationRate: fmt.Sprintf("%f", float32(params.BeaconConfig().EffectiveBalanceIncrement)/float32(validatorCount*params.BeaconConfig().MaxEffectiveBalance)), + VotedEther: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + EligibleEther: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochActiveGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + CurrentEpochTargetAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + PreviousEpochActiveGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + PreviousEpochAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + PreviousEpochTargetAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + PreviousEpochHeadAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + }, + } + var vp *structs.GetValidatorParticipationResponse + err = json.NewDecoder(writer.Body).Decode(&vp) + require.NoError(t, err) + + // Compare the response with the expected values + assert.Equal(t, true, vp.Finalized, "Incorrect validator participation response") + assert.Equal(t, *want.Participation, *vp.Participation, "Incorrect validator participation response") +} + +func TestServer_GetValidatorParticipation_OrphanedUntilGenesis(t *testing.T) { + helpers.ClearCache() + params.SetupTestConfigCleanup(t) + params.OverrideBeaconConfig(params.BeaconConfig()) + + beaconDB := dbTest.SetupDB(t) + ctx := context.Background() + validatorCount := uint64(100) + + validators := make([]*ethpb.Validator, validatorCount) + balances := make([]uint64, validatorCount) + for i := 0; i < len(validators); i++ { + validators[i] = ðpb.Validator{ + PublicKey: bytesutil.ToBytes(uint64(i), 48), + WithdrawalCredentials: make([]byte, 32), + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, + } + balances[i] = params.BeaconConfig().MaxEffectiveBalance + } + + atts := []*ethpb.PendingAttestation{{ + Data: util.HydrateAttestationData(ðpb.AttestationData{}), + InclusionDelay: 1, + AggregationBits: bitfield.NewBitlist(validatorCount / uint64(params.BeaconConfig().SlotsPerEpoch)), + }} + headState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, headState.SetSlot(0)) + require.NoError(t, headState.SetValidators(validators)) + require.NoError(t, headState.SetBalances(balances)) + require.NoError(t, headState.AppendCurrentEpochAttestations(atts[0])) + require.NoError(t, headState.AppendPreviousEpochAttestations(atts[0])) + + b := util.NewBeaconBlock() + util.SaveBlock(t, ctx, beaconDB, b) + bRoot, err := b.Block.HashTreeRoot() + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, bRoot)) + require.NoError(t, err) + require.NoError(t, beaconDB.SaveState(ctx, headState, bRoot)) + require.NoError(t, beaconDB.SaveState(ctx, headState, params.BeaconConfig().ZeroHash)) + + m := &mock.ChainService{State: headState} + offset := int64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) + + var st state.BeaconState + st, _ = util.DeterministicGenesisState(t, 4) + s := &Server{ + BeaconDB: beaconDB, + Stater: &testutil.MockStater{ + BeaconState: st, + }, + CoreService: &core.Service{ + HeadFetcher: m, + StateGen: stategen.New(beaconDB, doublylinkedtree.New()), + GenesisTimeFetcher: &mock.ChainService{ + Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, + }, + CanonicalFetcher: &mock.ChainService{ + CanonicalRoots: map[[32]byte]bool{ + bRoot: true, + }, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetValidatorParticipation(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + + want := &structs.GetValidatorParticipationResponse{ + Participation: &structs.ValidatorParticipation{ + GlobalParticipationRate: fmt.Sprintf("%f", float32(params.BeaconConfig().EffectiveBalanceIncrement)/float32(validatorCount*params.BeaconConfig().MaxEffectiveBalance)), + VotedEther: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + EligibleEther: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochActiveGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + CurrentEpochTargetAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + PreviousEpochActiveGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + PreviousEpochAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + PreviousEpochTargetAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + PreviousEpochHeadAttestingGwei: fmt.Sprintf("%d", params.BeaconConfig().EffectiveBalanceIncrement), + }, + } + var vp *structs.GetValidatorParticipationResponse + err = json.NewDecoder(writer.Body).Decode(&vp) + require.NoError(t, err) + + assert.DeepEqual(t, true, vp.Finalized, "Incorrect validator participation respond") + assert.DeepEqual(t, want.Participation, vp.Participation, "Incorrect validator participation respond") +} + +func TestServer_GetValidatorParticipation_CurrentAndPrevEpochWithBits(t *testing.T) { + params.SetupTestConfigCleanup(t) + params.OverrideBeaconConfig(params.BeaconConfig()) + transition.SkipSlotCache.Disable() + + t.Run("altair", func(t *testing.T) { + validatorCount := uint64(32) + genState, _ := util.DeterministicGenesisStateAltair(t, validatorCount) + + c, err := altair.NextSyncCommittee(context.Background(), genState) + require.NoError(t, err) + require.NoError(t, genState.SetCurrentSyncCommittee(c)) + + bits := make([]byte, validatorCount) + for i := range bits { + bits[i] = 0xff + } + require.NoError(t, genState.SetCurrentParticipationBits(bits)) + require.NoError(t, genState.SetPreviousParticipationBits(bits)) + gb, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockAltair()) + assert.NoError(t, err) + runGetValidatorParticipationCurrentEpoch(t, genState, gb) + }) + + t.Run("bellatrix", func(t *testing.T) { + validatorCount := uint64(32) + genState, _ := util.DeterministicGenesisStateBellatrix(t, validatorCount) + c, err := altair.NextSyncCommittee(context.Background(), genState) + require.NoError(t, err) + require.NoError(t, genState.SetCurrentSyncCommittee(c)) + + bits := make([]byte, validatorCount) + for i := range bits { + bits[i] = 0xff + } + require.NoError(t, genState.SetCurrentParticipationBits(bits)) + require.NoError(t, genState.SetPreviousParticipationBits(bits)) + gb, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockBellatrix()) + assert.NoError(t, err) + runGetValidatorParticipationCurrentEpoch(t, genState, gb) + }) + + t.Run("capella", func(t *testing.T) { + validatorCount := uint64(32) + genState, _ := util.DeterministicGenesisStateCapella(t, validatorCount) + c, err := altair.NextSyncCommittee(context.Background(), genState) + require.NoError(t, err) + require.NoError(t, genState.SetCurrentSyncCommittee(c)) + + bits := make([]byte, validatorCount) + for i := range bits { + bits[i] = 0xff + } + require.NoError(t, genState.SetCurrentParticipationBits(bits)) + require.NoError(t, genState.SetPreviousParticipationBits(bits)) + gb, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) + assert.NoError(t, err) + runGetValidatorParticipationCurrentEpoch(t, genState, gb) + }) +} + +func runGetValidatorParticipationCurrentEpoch(t *testing.T, genState state.BeaconState, gb interfaces.SignedBeaconBlock) { + helpers.ClearCache() + beaconDB := dbTest.SetupDB(t) + + ctx := context.Background() + validatorCount := uint64(32) + + gsr, err := genState.HashTreeRoot(ctx) + require.NoError(t, err) + gb, err = blocktest.SetBlockStateRoot(gb, gsr) + require.NoError(t, err) + require.NoError(t, err) + gRoot, err := gb.Block().HashTreeRoot() + require.NoError(t, err) + + require.NoError(t, beaconDB.SaveState(ctx, genState, gRoot)) + require.NoError(t, beaconDB.SaveBlock(ctx, gb)) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + + m := &mock.ChainService{State: genState} + offset := int64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) + + s := &Server{ + BeaconDB: beaconDB, + Stater: &testutil.MockStater{ + BeaconState: genState, + }, + CoreService: &core.Service{ + HeadFetcher: m, + StateGen: stategen.New(beaconDB, doublylinkedtree.New()), + GenesisTimeFetcher: &mock.ChainService{ + Genesis: prysmTime.Now().Add(time.Duration(-1*offset) * time.Second), + }, + FinalizedFetcher: &mock.ChainService{FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 100}}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetValidatorParticipation(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + + want := &structs.GetValidatorParticipationResponse{ + Participation: &structs.ValidatorParticipation{ + GlobalParticipationRate: "1.000000", + VotedEther: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + EligibleEther: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochActiveGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochAttestingGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + CurrentEpochTargetAttestingGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + PreviousEpochActiveGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + PreviousEpochAttestingGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + PreviousEpochTargetAttestingGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + PreviousEpochHeadAttestingGwei: fmt.Sprintf("%d", validatorCount*params.BeaconConfig().MaxEffectiveBalance), + }, + } + + var vp *structs.GetValidatorParticipationResponse + err = json.NewDecoder(writer.Body).Decode(&vp) + require.NoError(t, err) + + assert.DeepEqual(t, true, vp.Finalized, "Incorrect validator participation respond") + assert.DeepEqual(t, *want.Participation, *vp.Participation, "Incorrect validator participation respond") +} diff --git a/beacon-chain/rpc/prysm/validator/server.go b/beacon-chain/rpc/prysm/validator/server.go index f8729417aab2..513dddcf9ccb 100644 --- a/beacon-chain/rpc/prysm/validator/server.go +++ b/beacon-chain/rpc/prysm/validator/server.go @@ -1,9 +1,17 @@ package validator import ( + "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" ) type Server struct { - CoreService *core.Service + BeaconDB db.ReadOnlyDatabase + Stater lookup.Stater + CanonicalFetcher blockchain.CanonicalFetcher + FinalizationFetcher blockchain.FinalizationFetcher + ChainInfoFetcher blockchain.ChainInfoFetcher + CoreService *core.Service } diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index c80331d65130..3110707f57e8 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -225,6 +225,7 @@ func NewService(ctx context.Context, cfg *Config) *Service { StateGen: s.cfg.StateGen, P2P: s.cfg.Broadcaster, FinalizedFetcher: s.cfg.FinalizationFetcher, + ReplayerBuilder: ch, OptimisticModeFetcher: s.cfg.OptimisticModeFetcher, } validatorServer := &validatorv1alpha1.Server{ From 10f520accb12bb9646ab75eefbea01cfaa3c60a7 Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 2 Aug 2024 11:30:52 -0300 Subject: [PATCH 231/325] process Electra operations in the right order (#14294) * process Electra operations in the right order * godoc --- .../core/electra/transition_no_verify_sig.go | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/beacon-chain/core/electra/transition_no_verify_sig.go b/beacon-chain/core/electra/transition_no_verify_sig.go index 12da1a6c6fe5..4f417f18ade0 100644 --- a/beacon-chain/core/electra/transition_no_verify_sig.go +++ b/beacon-chain/core/electra/transition_no_verify_sig.go @@ -22,29 +22,31 @@ var ( // // Spec definition: // -// def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: -// # [Modified in Electra:EIP6110] -// # Disable former deposit mechanism once all prior deposits are processed -// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) -// if state.eth1_deposit_index < eth1_deposit_index_limit: -// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) -// else: -// assert len(body.deposits) == 0 +// def process_operations(state: BeaconState, body: BeaconBlockBody) -> None: +// # [Modified in Electra:EIP6110] +// # Disable former deposit mechanism once all prior deposits are processed +// eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index) +// if state.eth1_deposit_index < eth1_deposit_index_limit: +// assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index) +// else: +// assert len(body.deposits) == 0 // -// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: -// for operation in operations: -// fn(state, operation) +// def for_ops(operations: Sequence[Any], fn: Callable[[BeaconState, Any], None]) -> None: +// for operation in operations: +// fn(state, operation) // -// for_ops(body.proposer_slashings, process_proposer_slashing) -// for_ops(body.attester_slashings, process_attester_slashing) -// for_ops(body.attestations, process_attestation) # [Modified in Electra:EIP7549] -// for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251] -// for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251] -// for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) -// # [New in Electra:EIP7002:EIP7251] -// for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request) -// for_ops(body.execution_payload.deposit_requests, process_deposit_requests) # [New in Electra:EIP6110] -// for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251] +// for_ops(body.proposer_slashings, process_proposer_slashing) +// for_ops(body.attester_slashings, process_attester_slashing) +// for_ops(body.attestations, process_attestation) # [Modified in Electra:EIP7549] +// for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251] +// for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251] +// for_ops(body.bls_to_execution_changes, process_bls_to_execution_change) +// for_ops(body.execution_payload.deposit_requests, process_deposit_request) # [New in Electra:EIP6110] +// # [New in Electra:EIP7002:EIP7251] +// for_ops(body.execution_payload.withdrawal_requests, process_withdrawal_request) +// # [New in Electra:EIP7251] +// for_ops(body.execution_payload.consolidation_requests, process_consolidation_request) + func ProcessOperations( ctx context.Context, st state.BeaconState, @@ -84,16 +86,14 @@ func ProcessOperations( if !ok { return nil, errors.New("could not cast execution data to electra execution data") } - st, err = ProcessWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) - if err != nil { - return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") - } - st, err = ProcessDepositRequests(ctx, st, exe.DepositRequests()) if err != nil { return nil, errors.Wrap(err, "could not process deposit receipts") } - + st, err = ProcessWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) + if err != nil { + return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") + } if err := ProcessConsolidationRequests(ctx, st, exe.ConsolidationRequests()); err != nil { return nil, fmt.Errorf("could not process consolidation requests: %w", err) } From 85f334b663a820c0482da5d93d1a082d48aba996 Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 2 Aug 2024 11:36:37 -0300 Subject: [PATCH 232/325] Return parent root from forkchoice (#14293) --- .../blockchain/chain_info_forkchoice.go | 7 +++++ .../doubly-linked-tree/forkchoice.go | 15 +++++++++++ .../doubly-linked-tree/forkchoice_test.go | 26 +++++++++++++++++++ beacon-chain/forkchoice/interfaces.go | 1 + beacon-chain/forkchoice/ro.go | 7 +++++ beacon-chain/forkchoice/ro_test.go | 6 +++++ 6 files changed, 62 insertions(+) diff --git a/beacon-chain/blockchain/chain_info_forkchoice.go b/beacon-chain/blockchain/chain_info_forkchoice.go index d2fb6a96de57..afc02ddd7dac 100644 --- a/beacon-chain/blockchain/chain_info_forkchoice.go +++ b/beacon-chain/blockchain/chain_info_forkchoice.go @@ -99,3 +99,10 @@ func (s *Service) FinalizedBlockHash() [32]byte { defer s.cfg.ForkChoiceStore.RUnlock() return s.cfg.ForkChoiceStore.FinalizedPayloadBlockHash() } + +// ParentRoot wraps a call to the corresponding method in forkchoice +func (s *Service) ParentRoot(root [32]byte) ([32]byte, error) { + s.cfg.ForkChoiceStore.RLock() + defer s.cfg.ForkChoiceStore.RUnlock() + return s.cfg.ForkChoiceStore.ParentRoot(root) +} diff --git a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go index caacb7807528..807e0d80f9b3 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go +++ b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go @@ -676,3 +676,18 @@ func (f *ForkChoice) TargetRootForEpoch(root [32]byte, epoch primitives.Epoch) ( } return f.TargetRootForEpoch(targetNode.root, epoch) } + +// ParentRoot returns the block root of the parent node if it is in forkchoice. +// The exception is for the finalized checkpoint root which we return the zero +// hash. +func (f *ForkChoice) ParentRoot(root [32]byte) ([32]byte, error) { + n, ok := f.store.nodeByRoot[root] + if !ok || n == nil { + return [32]byte{}, ErrNilNode + } + // Return the zero hash for the tree root + if n.parent == nil { + return [32]byte{}, nil + } + return n.parent.root, nil +} diff --git a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice_test.go b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice_test.go index 62472e288630..54c6c53edad9 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice_test.go +++ b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice_test.go @@ -861,3 +861,29 @@ func TestForkChoiceSlot(t *testing.T) { require.NoError(t, err) require.Equal(t, primitives.Slot(3), slot) } + +func TestForkchoiceParentRoot(t *testing.T) { + f := setup(0, 0) + ctx := context.Background() + root1 := [32]byte{'a'} + st, root, err := prepareForkchoiceState(ctx, 3, root1, params.BeaconConfig().ZeroHash, [32]byte{'A'}, 0, 0) + require.NoError(t, err) + require.NoError(t, f.InsertNode(ctx, st, root)) + + root2 := [32]byte{'b'} + st, root, err = prepareForkchoiceState(ctx, 3, root2, root1, [32]byte{'A'}, 0, 0) + require.NoError(t, err) + require.NoError(t, f.InsertNode(ctx, st, root)) + + root, err = f.ParentRoot(root2) + require.NoError(t, err) + require.Equal(t, root1, root) + + _, err = f.ParentRoot([32]byte{'c'}) + require.ErrorIs(t, err, ErrNilNode) + + zeroHash := [32]byte{} + root, err = f.ParentRoot(zeroHash) + require.NoError(t, err) + require.Equal(t, zeroHash, root) +} diff --git a/beacon-chain/forkchoice/interfaces.go b/beacon-chain/forkchoice/interfaces.go index d8d94e246a05..9db82c6920a4 100644 --- a/beacon-chain/forkchoice/interfaces.go +++ b/beacon-chain/forkchoice/interfaces.go @@ -80,6 +80,7 @@ type FastGetter interface { TargetRootForEpoch([32]byte, primitives.Epoch) ([32]byte, error) UnrealizedJustifiedPayloadBlockHash() [32]byte Weight(root [32]byte) (uint64, error) + ParentRoot(root [32]byte) ([32]byte, error) } // Setter allows to set forkchoice information diff --git a/beacon-chain/forkchoice/ro.go b/beacon-chain/forkchoice/ro.go index cf536c5228e2..196deed84180 100644 --- a/beacon-chain/forkchoice/ro.go +++ b/beacon-chain/forkchoice/ro.go @@ -169,3 +169,10 @@ func (ro *ROForkChoice) TargetRootForEpoch(root [32]byte, epoch primitives.Epoch defer ro.l.RUnlock() return ro.getter.TargetRootForEpoch(root, epoch) } + +// ParentRoot delegates to the underlying forkchoice call, under a lock. +func (ro *ROForkChoice) ParentRoot(root [32]byte) ([32]byte, error) { + ro.l.RLock() + defer ro.l.RUnlock() + return ro.getter.ParentRoot(root) +} diff --git a/beacon-chain/forkchoice/ro_test.go b/beacon-chain/forkchoice/ro_test.go index e24e2fcdf4e5..cca8aa1d1534 100644 --- a/beacon-chain/forkchoice/ro_test.go +++ b/beacon-chain/forkchoice/ro_test.go @@ -37,6 +37,7 @@ const ( slotCalled lastRootCalled targetRootForEpochCalled + parentRootCalled ) func _discard(t *testing.T, e error) { @@ -291,3 +292,8 @@ func (ro *mockROForkchoice) TargetRootForEpoch(_ [32]byte, _ primitives.Epoch) ( ro.calls = append(ro.calls, targetRootForEpochCalled) return [32]byte{}, nil } + +func (ro *mockROForkchoice) ParentRoot(_ [32]byte) ([32]byte, error) { + ro.calls = append(ro.calls, parentRootCalled) + return [32]byte{}, nil +} From ff3e0856a13145674379a3c6f2a87b5f52f79542 Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Sat, 3 Aug 2024 06:32:53 +0900 Subject: [PATCH 233/325] fix(tests): Correct misleading variable names and expressions in test files (#14292) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- .../rpc/prysm/v1alpha1/beacon/validators_test.go | 6 +++--- beacon-chain/state/state-native/proofs_test.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go index fa012e50368b..515322b135aa 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go @@ -1029,7 +1029,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { ctx := context.Background() slot := primitives.Slot(0) - epochs := 10 + epochs := primitives.Epoch(10) numVals := uint64(10) beaconDB := dbTest.SetupDB(t) @@ -1065,7 +1065,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { } res, err := bs.ListValidators(context.Background(), req) require.NoError(t, err) - assert.Equal(t, epochs, len(res.ValidatorList)) + assert.Equal(t, int(numVals), len(res.ValidatorList)) vals := st.Validators() want := make([]*ethpb.Validators_ValidatorContainer, 0) @@ -1077,7 +1077,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { } req = ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ - Epoch: 10, + Epoch: epochs, }, } res, err = bs.ListValidators(context.Background(), req) diff --git a/beacon-chain/state/state-native/proofs_test.go b/beacon-chain/state/state-native/proofs_test.go index ceb094051098..ecf169d48a0f 100644 --- a/beacon-chain/state/state-native/proofs_test.go +++ b/beacon-chain/state/state-native/proofs_test.go @@ -43,17 +43,17 @@ func TestBeaconStateMerkleProofs_altair(t *testing.T) { t.Run("current sync committee", func(t *testing.T) { cscp, err := altair.CurrentSyncCommitteeProof(ctx) require.NoError(t, err) - require.Equal(t, len(cscp), 5) + require.Equal(t, 5, len(cscp)) for i, bytes := range cscp { - require.Equal(t, hexutil.Encode(bytes), results[i]) + require.Equal(t, results[i], hexutil.Encode(bytes)) } }) t.Run("next sync committee", func(t *testing.T) { nscp, err := altair.NextSyncCommitteeProof(ctx) require.NoError(t, err) - require.Equal(t, len(nscp), 5) + require.Equal(t, 5, len(nscp)) for i, bytes := range nscp { - require.Equal(t, hexutil.Encode(bytes), results[i]) + require.Equal(t, results[i], hexutil.Encode(bytes)) } }) t.Run("finalized root", func(t *testing.T) { @@ -112,17 +112,17 @@ func TestBeaconStateMerkleProofs_bellatrix(t *testing.T) { t.Run("current sync committee", func(t *testing.T) { cscp, err := bellatrix.CurrentSyncCommitteeProof(ctx) require.NoError(t, err) - require.Equal(t, len(cscp), 5) + require.Equal(t, 5, len(cscp)) for i, bytes := range cscp { - require.Equal(t, hexutil.Encode(bytes), results[i]) + require.Equal(t, results[i], hexutil.Encode(bytes)) } }) t.Run("next sync committee", func(t *testing.T) { nscp, err := bellatrix.NextSyncCommitteeProof(ctx) require.NoError(t, err) - require.Equal(t, len(nscp), 5) + require.Equal(t, 5, len(nscp)) for i, bytes := range nscp { - require.Equal(t, hexutil.Encode(bytes), results[i]) + require.Equal(t, results[i], hexutil.Encode(bytes)) } }) t.Run("finalized root", func(t *testing.T) { From 68b38b6666b70353332e3d840d19658b3189e812 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 2 Aug 2024 17:36:09 -0400 Subject: [PATCH 234/325] remove broken link (#14291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- monitoring/tracing/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring/tracing/README.md b/monitoring/tracing/README.md index a50102737355..ec0e168a0b39 100644 --- a/monitoring/tracing/README.md +++ b/monitoring/tracing/README.md @@ -35,7 +35,7 @@ $ go tool trace trace.out #### How to collect additional traces We use the OpenCensus library to create traces. To trace the execution of a p2p -message through the system, we must define [spans](https://godoc.org/go.opencensus.io/trace#Span) around the code that handles the message. To correlate the trace with other spans defined for the same message, use the context passed inside the [Message](https://godoc.org/github.com/prysmaticlabs/prysm/shared/deprecated-p2p#Message) struct to create a span: +message through the system, we must define [spans](https://godoc.org/go.opencensus.io/trace#Span) around the code that handles the message. To correlate the trace with other spans defined for the same message, use the context passed inside the Message struct to create a span: ```go var msg p2p.Message From fb2620364af2ee3d62456a5ba33689c530fa74fe Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:49:37 +0200 Subject: [PATCH 235/325] HTTP endpoint for `GetChainHead` (#14262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add getChainHead endpoint * James' review * Radek' review --------- Co-authored-by: Radosław Kapka --- api/server/structs/endpoints_beacon.go | 16 ++ beacon-chain/rpc/core/BUILD.bazel | 3 + beacon-chain/rpc/core/beacon.go | 128 ++++++++++ beacon-chain/rpc/core/service.go | 2 + beacon-chain/rpc/endpoints.go | 9 + beacon-chain/rpc/endpoints_test.go | 1 + beacon-chain/rpc/prysm/beacon/BUILD.bazel | 4 + beacon-chain/rpc/prysm/beacon/handlers.go | 29 +++ .../rpc/prysm/beacon/handlers_test.go | 218 +++++++++++++++++- .../rpc/prysm/v1alpha1/beacon/blocks.go | 91 +------- .../rpc/prysm/v1alpha1/beacon/blocks_test.go | 62 ++--- beacon-chain/rpc/service.go | 1 + 12 files changed, 448 insertions(+), 116 deletions(-) create mode 100644 beacon-chain/rpc/core/beacon.go diff --git a/api/server/structs/endpoints_beacon.go b/api/server/structs/endpoints_beacon.go index 0ee92bc0d5ab..3fa8a4bc8f47 100644 --- a/api/server/structs/endpoints_beacon.go +++ b/api/server/structs/endpoints_beacon.go @@ -225,3 +225,19 @@ type IndividualVote struct { InclusionDistance string `json:"inclusion_distance"` InactivityScore string `json:"inactivity_score"` } + +type ChainHead struct { + HeadSlot string `json:"head_slot"` + HeadEpoch string `json:"head_epoch"` + HeadBlockRoot string `json:"head_block_root"` + FinalizedSlot string `json:"finalized_slot"` + FinalizedEpoch string `json:"finalized_epoch"` + FinalizedBlockRoot string `json:"finalized_block_root"` + JustifiedSlot string `json:"justified_slot"` + JustifiedEpoch string `json:"justified_epoch"` + JustifiedBlockRoot string `json:"justified_block_root"` + PreviousJustifiedSlot string `json:"previous_justified_slot"` + PreviousJustifiedEpoch string `json:"previous_justified_epoch"` + PreviousJustifiedBlockRoot string `json:"previous_justified_block_root"` + OptimisticStatus bool `json:"optimistic_status"` +} diff --git a/beacon-chain/rpc/core/BUILD.bazel b/beacon-chain/rpc/core/BUILD.bazel index 4cfff1e05453..2b4a49179b5d 100644 --- a/beacon-chain/rpc/core/BUILD.bazel +++ b/beacon-chain/rpc/core/BUILD.bazel @@ -3,6 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "beacon.go", "errors.go", "log.go", "service.go", @@ -20,6 +21,7 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/db:go_default_library", "//beacon-chain/forkchoice/types:go_default_library", "//beacon-chain/operations/synccommittee:go_default_library", "//beacon-chain/p2p:go_default_library", @@ -28,6 +30,7 @@ go_library( "//beacon-chain/sync:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//crypto/bls:go_default_library", diff --git a/beacon-chain/rpc/core/beacon.go b/beacon-chain/rpc/core/beacon.go new file mode 100644 index 000000000000..f9da716fd7f6 --- /dev/null +++ b/beacon-chain/rpc/core/beacon.go @@ -0,0 +1,128 @@ +package core + +import ( + "context" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/config/params" + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +// Retrieve chain head information from the DB and the current beacon state. +func (s *Service) ChainHead(ctx context.Context) (*ethpb.ChainHead, *RpcError) { + headBlock, err := s.HeadFetcher.HeadBlock(ctx) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not get head block"), + Reason: Internal, + } + } + if err := consensusblocks.BeaconBlockIsNil(headBlock); err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "head block of chain was nil"), + Reason: NotFound, + } + } + optimisticStatus, err := s.OptimisticModeFetcher.IsOptimistic(ctx) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not get optimistic status"), + Reason: Internal, + } + } + headBlockRoot, err := headBlock.Block().HashTreeRoot() + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not get head block root"), + Reason: Internal, + } + } + + validGenesis := false + validateCP := func(cp *ethpb.Checkpoint, name string) error { + if bytesutil.ToBytes32(cp.Root) == params.BeaconConfig().ZeroHash && cp.Epoch == 0 { + if validGenesis { + return nil + } + // Retrieve genesis block in the event we have genesis checkpoints. + genBlock, err := s.BeaconDB.GenesisBlock(ctx) + if err != nil || consensusblocks.BeaconBlockIsNil(genBlock) != nil { + return errors.New("could not get genesis block") + } + validGenesis = true + return nil + } + b, err := s.BeaconDB.Block(ctx, bytesutil.ToBytes32(cp.Root)) + if err != nil { + return errors.Errorf("could not get %s block: %v", name, err) + } + if err := consensusblocks.BeaconBlockIsNil(b); err != nil { + return errors.Errorf("could not get %s block: %v", name, err) + } + return nil + } + + finalizedCheckpoint := s.FinalizedFetcher.FinalizedCheckpt() + if err := validateCP(finalizedCheckpoint, "finalized"); err != nil { + return nil, &RpcError{ + Err: errors.Wrap(err, "could not get finalized checkpoint"), + Reason: Internal, + } + } + + justifiedCheckpoint := s.FinalizedFetcher.CurrentJustifiedCheckpt() + if err := validateCP(justifiedCheckpoint, "justified"); err != nil { + return nil, &RpcError{ + Err: errors.Wrap(err, "could not get current justified checkpoint"), + Reason: Internal, + } + } + + prevJustifiedCheckpoint := s.FinalizedFetcher.PreviousJustifiedCheckpt() + if err := validateCP(prevJustifiedCheckpoint, "prev justified"); err != nil { + return nil, &RpcError{ + Err: errors.Wrap(err, "could not get previous justified checkpoint"), + Reason: Internal, + } + } + + fSlot, err := slots.EpochStart(finalizedCheckpoint.Epoch) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not get epoch start slot from finalized checkpoint epoch"), + Reason: Internal, + } + } + jSlot, err := slots.EpochStart(justifiedCheckpoint.Epoch) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not get epoch start slot from justified checkpoint epoch"), + Reason: Internal, + } + } + pjSlot, err := slots.EpochStart(prevJustifiedCheckpoint.Epoch) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "could not get epoch start slot from prev justified checkpoint epoch"), + Reason: Internal, + } + } + return ðpb.ChainHead{ + HeadSlot: headBlock.Block().Slot(), + HeadEpoch: slots.ToEpoch(headBlock.Block().Slot()), + HeadBlockRoot: headBlockRoot[:], + FinalizedSlot: fSlot, + FinalizedEpoch: finalizedCheckpoint.Epoch, + FinalizedBlockRoot: finalizedCheckpoint.Root, + JustifiedSlot: jSlot, + JustifiedEpoch: justifiedCheckpoint.Epoch, + JustifiedBlockRoot: justifiedCheckpoint.Root, + PreviousJustifiedSlot: pjSlot, + PreviousJustifiedEpoch: prevJustifiedCheckpoint.Epoch, + PreviousJustifiedBlockRoot: prevJustifiedCheckpoint.Root, + OptimisticStatus: optimisticStatus, + }, nil +} diff --git a/beacon-chain/rpc/core/service.go b/beacon-chain/rpc/core/service.go index d407c881f4cd..2345d26abd4f 100644 --- a/beacon-chain/rpc/core/service.go +++ b/beacon-chain/rpc/core/service.go @@ -4,6 +4,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/synccommittee" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" @@ -11,6 +12,7 @@ import ( ) type Service struct { + BeaconDB db.ReadOnlyDatabase HeadFetcher blockchain.HeadFetcher FinalizedFetcher blockchain.FinalizationFetcher GenesisTimeFetcher blockchain.TimeFetcher diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index ef9502cd97cd..09ae99a3d5a0 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -983,6 +983,15 @@ func (s *Service) prysmBeaconEndpoints( handler: server.GetIndividualVotes, methods: []string{http.MethodPost}, }, + { + template: "/prysm/v1/beacon/chain_head", + name: namespace + ".GetChainHead", + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetChainHead, + methods: []string{http.MethodGet}, + }, } } diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index 8e9277ed5bf5..9b0253982cd5 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -114,6 +114,7 @@ func Test_endpoints(t *testing.T) { "/prysm/v1/beacon/weak_subjectivity": {http.MethodGet}, "/eth/v1/beacon/states/{state_id}/validator_count": {http.MethodGet}, "/prysm/v1/beacon/states/{state_id}/validator_count": {http.MethodGet}, + "/prysm/v1/beacon/chain_head": {http.MethodGet}, } prysmNodeRoutes := map[string][]string{ diff --git a/beacon-chain/rpc/prysm/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/beacon/BUILD.bazel index 0dd081b0a8f8..d92fb3f9516b 100644 --- a/beacon-chain/rpc/prysm/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/beacon/BUILD.bazel @@ -52,10 +52,14 @@ go_test( "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", + "//beacon-chain/state/state-native:go_default_library", "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/state/stategen/mock:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", + "//encoding/bytesutil:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/beacon-chain/rpc/prysm/beacon/handlers.go b/beacon-chain/rpc/prysm/beacon/handlers.go index eca22946a95f..c6189334fec5 100644 --- a/beacon-chain/rpc/prysm/beacon/handlers.go +++ b/beacon-chain/rpc/prysm/beacon/handlers.go @@ -154,3 +154,32 @@ func (s *Server) GetIndividualVotes(w http.ResponseWriter, r *http.Request) { } httputil.WriteJson(w, response) } + +// GetChainHead retrieves information about the head of the beacon chain from +// the view of the beacon chain node. +func (s *Server) GetChainHead(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "beacon.GetChainHead") + defer span.End() + + ch, rpcError := s.CoreService.ChainHead(ctx) + if rpcError != nil { + httputil.HandleError(w, rpcError.Err.Error(), core.ErrorReasonToHTTP(rpcError.Reason)) + return + } + response := &structs.ChainHead{ + HeadSlot: fmt.Sprintf("%d", ch.HeadSlot), + HeadEpoch: fmt.Sprintf("%d", ch.HeadEpoch), + HeadBlockRoot: hexutil.Encode(ch.HeadBlockRoot), + FinalizedSlot: fmt.Sprintf("%d", ch.FinalizedSlot), + FinalizedEpoch: fmt.Sprintf("%d", ch.FinalizedEpoch), + FinalizedBlockRoot: hexutil.Encode(ch.FinalizedBlockRoot), + JustifiedSlot: fmt.Sprintf("%d", ch.JustifiedSlot), + JustifiedEpoch: fmt.Sprintf("%d", ch.JustifiedEpoch), + JustifiedBlockRoot: hexutil.Encode(ch.JustifiedBlockRoot), + PreviousJustifiedSlot: fmt.Sprintf("%d", ch.PreviousJustifiedSlot), + PreviousJustifiedEpoch: fmt.Sprintf("%d", ch.PreviousJustifiedEpoch), + PreviousJustifiedBlockRoot: hexutil.Encode(ch.PreviousJustifiedBlockRoot), + OptimisticStatus: ch.OptimisticStatus, + } + httputil.WriteJson(w, response) +} diff --git a/beacon-chain/rpc/prysm/beacon/handlers_test.go b/beacon-chain/rpc/prysm/beacon/handlers_test.go index 521126548fce..ec8a66511141 100644 --- a/beacon-chain/rpc/prysm/beacon/handlers_test.go +++ b/beacon-chain/rpc/prysm/beacon/handlers_test.go @@ -19,11 +19,15 @@ import ( dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" @@ -227,11 +231,11 @@ func TestServer_GetIndividualVotes_Working(t *testing.T) { require.NoError(t, beaconState.SetBlockRoots(br)) att2.Data.Target.Root = rt[:] att2.Data.BeaconBlockRoot = newRt[:] - err = beaconState.AppendPreviousEpochAttestations(ð.PendingAttestation{ + err = beaconState.AppendPreviousEpochAttestations(ðpb.PendingAttestation{ Data: att1.Data, AggregationBits: bf, InclusionDelay: 1, }) require.NoError(t, err) - err = beaconState.AppendCurrentEpochAttestations(ð.PendingAttestation{ + err = beaconState.AppendCurrentEpochAttestations(ðpb.PendingAttestation{ Data: att2.Data, AggregationBits: bf, InclusionDelay: 1, }) require.NoError(t, err) @@ -658,3 +662,211 @@ func TestServer_GetIndividualVotes_CapellaEndOfEpoch(t *testing.T) { } assert.DeepEqual(t, want, resp, "Unexpected response") } + +// ensures that if any of the checkpoints are zero-valued, an error will be generated without genesis being present +func TestServer_GetChainHead_NoGenesis(t *testing.T) { + db := dbTest.SetupDB(t) + + s, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, s.SetSlot(1)) + + genBlock := util.NewBeaconBlock() + genBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'G'}, fieldparams.RootLength) + util.SaveBlock(t, context.Background(), db, genBlock) + gRoot, err := genBlock.Block.HashTreeRoot() + require.NoError(t, err) + cases := []struct { + name string + zeroSetter func(val *ethpb.Checkpoint) error + }{ + { + name: "zero-value prev justified", + zeroSetter: s.SetPreviousJustifiedCheckpoint, + }, + { + name: "zero-value current justified", + zeroSetter: s.SetCurrentJustifiedCheckpoint, + }, + { + name: "zero-value finalized", + zeroSetter: s.SetFinalizedCheckpoint, + }, + } + finalized := ðpb.Checkpoint{Epoch: 1, Root: gRoot[:]} + prevJustified := ðpb.Checkpoint{Epoch: 2, Root: gRoot[:]} + justified := ðpb.Checkpoint{Epoch: 3, Root: gRoot[:]} + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + require.NoError(t, s.SetPreviousJustifiedCheckpoint(prevJustified)) + require.NoError(t, s.SetCurrentJustifiedCheckpoint(justified)) + require.NoError(t, s.SetFinalizedCheckpoint(finalized)) + require.NoError(t, c.zeroSetter(ðpb.Checkpoint{Epoch: 0, Root: params.BeaconConfig().ZeroHash[:]})) + }) + wsb, err := blocks.NewSignedBeaconBlock(genBlock) + require.NoError(t, err) + s := &Server{ + CoreService: &core.Service{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, + FinalizedFetcher: &chainMock.ChainService{ + FinalizedCheckPoint: s.FinalizedCheckpoint(), + CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), + PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint(), + }, + OptimisticModeFetcher: &chainMock.ChainService{}, + }, + } + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetChainHead(writer, request) + require.Equal(t, http.StatusInternalServerError, writer.Code) + require.StringContains(t, "could not get genesis block", writer.Body.String()) + } +} + +func TestServer_GetChainHead_NoFinalizedBlock(t *testing.T) { + db := dbTest.SetupDB(t) + + bs, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, bs.SetSlot(1)) + require.NoError(t, bs.SetPreviousJustifiedCheckpoint(ðpb.Checkpoint{Epoch: 3, Root: bytesutil.PadTo([]byte{'A'}, fieldparams.RootLength)})) + require.NoError(t, bs.SetCurrentJustifiedCheckpoint(ðpb.Checkpoint{Epoch: 2, Root: bytesutil.PadTo([]byte{'B'}, fieldparams.RootLength)})) + require.NoError(t, bs.SetFinalizedCheckpoint(ðpb.Checkpoint{Epoch: 1, Root: bytesutil.PadTo([]byte{'C'}, fieldparams.RootLength)})) + + genBlock := util.NewBeaconBlock() + genBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'G'}, fieldparams.RootLength) + util.SaveBlock(t, context.Background(), db, genBlock) + gRoot, err := genBlock.Block.HashTreeRoot() + require.NoError(t, err) + require.NoError(t, db.SaveGenesisBlockRoot(context.Background(), gRoot)) + + wsb, err := blocks.NewSignedBeaconBlock(genBlock) + require.NoError(t, err) + + s := &Server{ + CoreService: &core.Service{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{Block: wsb, State: bs}, + FinalizedFetcher: &chainMock.ChainService{ + FinalizedCheckPoint: bs.FinalizedCheckpoint(), + CurrentJustifiedCheckPoint: bs.CurrentJustifiedCheckpoint(), + PreviousJustifiedCheckPoint: bs.PreviousJustifiedCheckpoint()}, + OptimisticModeFetcher: &chainMock.ChainService{}, + }, + } + + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetChainHead(writer, request) + require.Equal(t, http.StatusInternalServerError, writer.Code) + require.StringContains(t, "ould not get finalized block", writer.Body.String()) +} + +func TestServer_GetChainHead_NoHeadBlock(t *testing.T) { + s := &Server{ + CoreService: &core.Service{ + HeadFetcher: &chainMock.ChainService{Block: nil}, + OptimisticModeFetcher: &chainMock.ChainService{}, + }, + } + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetChainHead(writer, request) + require.Equal(t, http.StatusNotFound, writer.Code) + require.StringContains(t, "head block of chain was nil", writer.Body.String()) +} + +func TestServer_GetChainHead(t *testing.T) { + params.SetupTestConfigCleanup(t) + params.OverrideBeaconConfig(params.MinimalSpecConfig()) + + db := dbTest.SetupDB(t) + genBlock := util.NewBeaconBlock() + genBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'G'}, fieldparams.RootLength) + util.SaveBlock(t, context.Background(), db, genBlock) + gRoot, err := genBlock.Block.HashTreeRoot() + require.NoError(t, err) + require.NoError(t, db.SaveGenesisBlockRoot(context.Background(), gRoot)) + + finalizedBlock := util.NewBeaconBlock() + finalizedBlock.Block.Slot = 1 + finalizedBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'A'}, fieldparams.RootLength) + util.SaveBlock(t, context.Background(), db, finalizedBlock) + fRoot, err := finalizedBlock.Block.HashTreeRoot() + require.NoError(t, err) + + justifiedBlock := util.NewBeaconBlock() + justifiedBlock.Block.Slot = 2 + justifiedBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'B'}, fieldparams.RootLength) + util.SaveBlock(t, context.Background(), db, justifiedBlock) + jRoot, err := justifiedBlock.Block.HashTreeRoot() + require.NoError(t, err) + + prevJustifiedBlock := util.NewBeaconBlock() + prevJustifiedBlock.Block.Slot = 3 + prevJustifiedBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'C'}, fieldparams.RootLength) + util.SaveBlock(t, context.Background(), db, prevJustifiedBlock) + pjRoot, err := prevJustifiedBlock.Block.HashTreeRoot() + require.NoError(t, err) + + st, err := state_native.InitializeFromProtoPhase0(ðpb.BeaconState{ + Slot: 1, + PreviousJustifiedCheckpoint: ðpb.Checkpoint{Epoch: 3, Root: pjRoot[:]}, + CurrentJustifiedCheckpoint: ðpb.Checkpoint{Epoch: 2, Root: jRoot[:]}, + FinalizedCheckpoint: ðpb.Checkpoint{Epoch: 1, Root: fRoot[:]}, + }) + require.NoError(t, err) + + b := util.NewBeaconBlock() + b.Block.Slot, err = slots.EpochStart(st.PreviousJustifiedCheckpoint().Epoch) + require.NoError(t, err) + b.Block.Slot++ + wsb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + s := &Server{ + CoreService: &core.Service{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{Block: wsb, State: st}, + OptimisticModeFetcher: &chainMock.ChainService{}, + FinalizedFetcher: &chainMock.ChainService{ + FinalizedCheckPoint: st.FinalizedCheckpoint(), + CurrentJustifiedCheckPoint: st.CurrentJustifiedCheckpoint(), + PreviousJustifiedCheckPoint: st.PreviousJustifiedCheckpoint()}, + }, + } + + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetChainHead(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + + var ch *structs.ChainHead + err = json.NewDecoder(writer.Body).Decode(&ch) + require.NoError(t, err) + + assert.Equal(t, "3", ch.PreviousJustifiedEpoch, "Unexpected PreviousJustifiedEpoch") + assert.Equal(t, "2", ch.JustifiedEpoch, "Unexpected JustifiedEpoch") + assert.Equal(t, "1", ch.FinalizedEpoch, "Unexpected FinalizedEpoch") + assert.Equal(t, "24", ch.PreviousJustifiedSlot, "Unexpected PreviousJustifiedSlot") + assert.Equal(t, "16", ch.JustifiedSlot, "Unexpected JustifiedSlot") + assert.Equal(t, "8", ch.FinalizedSlot, "Unexpected FinalizedSlot") + assert.DeepEqual(t, hexutil.Encode(pjRoot[:]), ch.PreviousJustifiedBlockRoot, "Unexpected PreviousJustifiedBlockRoot") + assert.DeepEqual(t, hexutil.Encode(jRoot[:]), ch.JustifiedBlockRoot, "Unexpected JustifiedBlockRoot") + assert.DeepEqual(t, hexutil.Encode(fRoot[:]), ch.FinalizedBlockRoot, "Unexpected FinalizedBlockRoot") + assert.Equal(t, false, ch.OptimisticStatus) +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go index b6315f886698..c3c7fc226bcd 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go @@ -7,13 +7,12 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/pagination" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/cmd" - "github.com/prysmaticlabs/prysm/v5/config/params" consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/time/slots" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" @@ -244,91 +243,9 @@ func (bs *Server) listBlocksForGenesis(ctx context.Context, _ *ethpb.ListBlocksR // the most recent finalized and justified slots. // DEPRECATED: This endpoint is superseded by the /eth/v1/beacon API endpoint func (bs *Server) GetChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.ChainHead, error) { - return bs.chainHeadRetrieval(ctx) -} - -// Retrieve chain head information from the DB and the current beacon state. -func (bs *Server) chainHeadRetrieval(ctx context.Context) (*ethpb.ChainHead, error) { - headBlock, err := bs.HeadFetcher.HeadBlock(ctx) - if err != nil { - return nil, status.Error(codes.Internal, "Could not get head block") - } - optimisticStatus, err := bs.OptimisticModeFetcher.IsOptimistic(ctx) - if err != nil { - return nil, status.Error(codes.Internal, "Could not get optimistic status") - } - if err := consensusblocks.BeaconBlockIsNil(headBlock); err != nil { - return nil, status.Errorf(codes.NotFound, "Head block of chain was nil: %v", err) - } - headBlockRoot, err := headBlock.Block().HashTreeRoot() - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get head block root: %v", err) - } - - validGenesis := false - validateCP := func(cp *ethpb.Checkpoint, name string) error { - if bytesutil.ToBytes32(cp.Root) == params.BeaconConfig().ZeroHash && cp.Epoch == 0 { - if validGenesis { - return nil - } - // Retrieve genesis block in the event we have genesis checkpoints. - genBlock, err := bs.BeaconDB.GenesisBlock(ctx) - if err != nil || consensusblocks.BeaconBlockIsNil(genBlock) != nil { - return status.Error(codes.Internal, "Could not get genesis block") - } - validGenesis = true - return nil - } - b, err := bs.BeaconDB.Block(ctx, bytesutil.ToBytes32(cp.Root)) - if err != nil { - return status.Errorf(codes.Internal, "Could not get %s block: %v", name, err) - } - if err := consensusblocks.BeaconBlockIsNil(b); err != nil { - return status.Errorf(codes.Internal, "Could not get %s block: %v", name, err) - } - return nil - } - - finalizedCheckpoint := bs.FinalizationFetcher.FinalizedCheckpt() - if err := validateCP(finalizedCheckpoint, "finalized"); err != nil { - return nil, err - } - - justifiedCheckpoint := bs.FinalizationFetcher.CurrentJustifiedCheckpt() - if err := validateCP(justifiedCheckpoint, "justified"); err != nil { - return nil, err - } - - prevJustifiedCheckpoint := bs.FinalizationFetcher.PreviousJustifiedCheckpt() - if err := validateCP(prevJustifiedCheckpoint, "prev justified"); err != nil { - return nil, err - } - - fSlot, err := slots.EpochStart(finalizedCheckpoint.Epoch) - if err != nil { - return nil, errors.Wrap(err, "could not get epoch start slot from finalized checkpoint epoch") - } - jSlot, err := slots.EpochStart(justifiedCheckpoint.Epoch) + ch, err := bs.CoreService.ChainHead(ctx) if err != nil { - return nil, errors.Wrap(err, "could not get epoch start slot from justified checkpoint epoch") + return nil, status.Errorf(core.ErrorReasonToGRPC(err.Reason), "Could not retrieve chain head: %v", err.Err) } - pjSlot, err := slots.EpochStart(prevJustifiedCheckpoint.Epoch) - if err != nil { - return nil, errors.Wrap(err, "could not get epoch start slot from prev justified checkpoint epoch") - } - return ðpb.ChainHead{ - HeadSlot: headBlock.Block().Slot(), - HeadEpoch: slots.ToEpoch(headBlock.Block().Slot()), - HeadBlockRoot: headBlockRoot[:], - FinalizedSlot: fSlot, - FinalizedEpoch: finalizedCheckpoint.Epoch, - FinalizedBlockRoot: finalizedCheckpoint.Root, - JustifiedSlot: jSlot, - JustifiedEpoch: justifiedCheckpoint.Epoch, - JustifiedBlockRoot: justifiedCheckpoint.Root, - PreviousJustifiedSlot: pjSlot, - PreviousJustifiedEpoch: prevJustifiedCheckpoint.Epoch, - PreviousJustifiedBlockRoot: prevJustifiedCheckpoint.Root, - OptimisticStatus: optimisticStatus, - }, nil + return ch, nil } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go index fb6900d5eed1..98d47224bea5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go @@ -8,6 +8,7 @@ import ( chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/features" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -68,16 +69,19 @@ func TestServer_GetChainHead_NoGenesis(t *testing.T) { wsb, err := blocks.NewSignedBeaconBlock(genBlock) require.NoError(t, err) bs := &Server{ - BeaconDB: db, - HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, - FinalizationFetcher: &chainMock.ChainService{ - FinalizedCheckPoint: s.FinalizedCheckpoint(), - CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), - PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, - OptimisticModeFetcher: &chainMock.ChainService{}, + CoreService: &core.Service{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, + FinalizedFetcher: &chainMock.ChainService{ + FinalizedCheckPoint: s.FinalizedCheckpoint(), + CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), + PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint(), + }, + OptimisticModeFetcher: &chainMock.ChainService{}, + }, } _, err = bs.GetChainHead(context.Background(), nil) - require.ErrorContains(t, "Could not get genesis block", err) + require.ErrorContains(t, "could not get genesis block", err) } } @@ -102,26 +106,30 @@ func TestServer_GetChainHead_NoFinalizedBlock(t *testing.T) { require.NoError(t, err) bs := &Server{ - BeaconDB: db, - HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, - FinalizationFetcher: &chainMock.ChainService{ - FinalizedCheckPoint: s.FinalizedCheckpoint(), - CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), - PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, - OptimisticModeFetcher: &chainMock.ChainService{}, + CoreService: &core.Service{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, + FinalizedFetcher: &chainMock.ChainService{ + FinalizedCheckPoint: s.FinalizedCheckpoint(), + CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), + PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, + OptimisticModeFetcher: &chainMock.ChainService{}, + }, } _, err = bs.GetChainHead(context.Background(), nil) - require.ErrorContains(t, "Could not get finalized block", err) + require.ErrorContains(t, "could not get finalized block", err) } func TestServer_GetChainHead_NoHeadBlock(t *testing.T) { bs := &Server{ - HeadFetcher: &chainMock.ChainService{Block: nil}, - OptimisticModeFetcher: &chainMock.ChainService{}, + CoreService: &core.Service{ + HeadFetcher: &chainMock.ChainService{Block: nil}, + OptimisticModeFetcher: &chainMock.ChainService{}, + }, } _, err := bs.GetChainHead(context.Background(), nil) - assert.ErrorContains(t, "Head block of chain was nil", err) + assert.ErrorContains(t, "head block of chain was nil", err) } func TestServer_GetChainHead(t *testing.T) { @@ -172,13 +180,15 @@ func TestServer_GetChainHead(t *testing.T) { wsb, err := blocks.NewSignedBeaconBlock(b) require.NoError(t, err) bs := &Server{ - BeaconDB: db, - HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, - OptimisticModeFetcher: &chainMock.ChainService{}, - FinalizationFetcher: &chainMock.ChainService{ - FinalizedCheckPoint: s.FinalizedCheckpoint(), - CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), - PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, + CoreService: &core.Service{ + BeaconDB: db, + HeadFetcher: &chainMock.ChainService{Block: wsb, State: s}, + OptimisticModeFetcher: &chainMock.ChainService{}, + FinalizedFetcher: &chainMock.ChainService{ + FinalizedCheckPoint: s.FinalizedCheckpoint(), + CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(), + PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, + }, } head, err := bs.GetChainHead(context.Background(), nil) diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 3110707f57e8..335b60e0ad38 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -215,6 +215,7 @@ func NewService(ctx context.Context, cfg *Config) *Service { } rewardFetcher := &rewards.BlockRewardService{Replayer: ch, DB: s.cfg.BeaconDB} coreService := &core.Service{ + BeaconDB: s.cfg.BeaconDB, HeadFetcher: s.cfg.HeadFetcher, GenesisTimeFetcher: s.cfg.GenesisTimeFetcher, SyncChecker: s.cfg.SyncService, From 1e4ede55851eeab7836ab4af2d9551c4b9fc9db4 Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 5 Aug 2024 09:44:49 -0300 Subject: [PATCH 236/325] Reduce cognitive complexity of ReceiveBlock (#14296) * Reduce cognitive complexity of ReceiveBlock * Remove stray line Co-authored-by: terence --------- Co-authored-by: terence --- beacon-chain/blockchain/receive_block.go | 186 ++++++++++++++--------- 1 file changed, 118 insertions(+), 68 deletions(-) diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index 42f9a9542f55..e439de0badd4 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -77,59 +77,20 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig if err != nil { return err } - rob, err := blocks.NewROBlockWithRoot(block, blockRoot) - if err != nil { - return err - } - preState, err := s.getBlockPreState(ctx, blockCopy.Block()) if err != nil { return errors.Wrap(err, "could not get block's prestate") } - // Save current justified and finalized epochs for future use. - currStoreJustifiedEpoch := s.CurrentJustifiedCheckpt().Epoch - currStoreFinalizedEpoch := s.FinalizedCheckpt().Epoch - currentEpoch := coreTime.CurrentEpoch(preState) - preStateVersion, preStateHeader, err := getStateVersionAndPayload(preState) + currentCheckpoints := s.saveCurrentCheckpoints(preState) + postState, isValidPayload, err := s.validateExecutionAndConsensus(ctx, preState, blockCopy, blockRoot) if err != nil { return err } - eg, _ := errgroup.WithContext(ctx) - var postState state.BeaconState - eg.Go(func() error { - var err error - postState, err = s.validateStateTransition(ctx, preState, blockCopy) - if err != nil { - return errors.Wrap(err, "failed to validate consensus state transition function") - } - return nil - }) - var isValidPayload bool - eg.Go(func() error { - var err error - isValidPayload, err = s.validateExecutionOnBlock(ctx, preStateVersion, preStateHeader, blockCopy, blockRoot) - if err != nil { - return errors.Wrap(err, "could not notify the engine of the new payload") - } - return nil - }) - if err := eg.Wait(); err != nil { + daWaitedTime, err := s.handleDA(ctx, blockCopy, blockRoot, avs) + if err != nil { return err } - daStartTime := time.Now() - if avs != nil { - if err := avs.IsDataAvailable(ctx, s.CurrentSlot(), rob); err != nil { - return errors.Wrap(err, "could not validate blob data availability (AvailabilityStore.IsDataAvailable)") - } - } else { - if err := s.isDataAvailable(ctx, blockRoot, blockCopy); err != nil { - return errors.Wrap(err, "could not validate blob data availability") - } - } - daWaitedTime := time.Since(daStartTime) - dataAvailWaitedTime.Observe(float64(daWaitedTime.Milliseconds())) - // Defragment the state before continuing block processing. s.defragmentState(postState) @@ -151,7 +112,51 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig tracing.AnnotateError(span, err) return err } - if coreTime.CurrentEpoch(postState) > currentEpoch && s.cfg.ForkChoiceStore.IsCanonical(blockRoot) { + if err := s.updateCheckpoints(ctx, currentCheckpoints, preState, postState, blockRoot); err != nil { + return err + } + // If slasher is configured, forward the attestations in the block via an event feed for processing. + if features.Get().EnableSlasher { + go s.sendBlockAttestationsToSlasher(blockCopy, preState) + } + + // Handle post block operations such as pruning exits and bls messages if incoming block is the head + if err := s.prunePostBlockOperationPools(ctx, blockCopy, blockRoot); err != nil { + log.WithError(err).Error("Could not prune canonical objects from pool ") + } + + // Have we been finalizing? Should we start saving hot states to db? + if err := s.checkSaveHotStateDB(ctx); err != nil { + return err + } + + // We apply the same heuristic to some of our more important caches. + if err := s.handleCaches(); err != nil { + return err + } + s.reportPostBlockProcessing(blockCopy, blockRoot, receivedTime, daWaitedTime) + return nil +} + +type ffgCheckpoints struct { + j, f, c primitives.Epoch +} + +func (s *Service) saveCurrentCheckpoints(state state.BeaconState) (cp ffgCheckpoints) { + // Save current justified and finalized epochs for future use. + cp.j = s.CurrentJustifiedCheckpt().Epoch + cp.f = s.FinalizedCheckpt().Epoch + cp.c = coreTime.CurrentEpoch(state) + return +} + +func (s *Service) updateCheckpoints( + ctx context.Context, + cp ffgCheckpoints, + preState, postState state.BeaconState, + blockRoot [32]byte, +) error { + if coreTime.CurrentEpoch(postState) > cp.c && s.cfg.ForkChoiceStore.IsCanonical(blockRoot) { headSt, err := s.HeadState(ctx) if err != nil { return errors.Wrap(err, "could not get head state") @@ -160,11 +165,11 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig log.WithError(err).Error("could not report epoch metrics") } } - if err := s.updateJustificationOnBlock(ctx, preState, postState, currStoreJustifiedEpoch); err != nil { + if err := s.updateJustificationOnBlock(ctx, preState, postState, cp.j); err != nil { return errors.Wrap(err, "could not update justified checkpoint") } - newFinalized, err := s.updateFinalizationOnBlock(ctx, preState, postState, currStoreFinalizedEpoch) + newFinalized, err := s.updateFinalizationOnBlock(ctx, preState, postState, cp.f) if err != nil { return errors.Wrap(err, "could not update finalized checkpoint") } @@ -173,51 +178,96 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig // hook to process all post state finalization tasks s.executePostFinalizationTasks(ctx, postState) } + return nil +} - // If slasher is configured, forward the attestations in the block via an event feed for processing. - if features.Get().EnableSlasher { - go s.sendBlockAttestationsToSlasher(blockCopy, preState) - } - - // Handle post block operations such as pruning exits and bls messages if incoming block is the head - if err := s.prunePostBlockOperationPools(ctx, blockCopy, blockRoot); err != nil { - log.WithError(err).Error("Could not prune canonical objects from pool ") +func (s *Service) validateExecutionAndConsensus( + ctx context.Context, + preState state.BeaconState, + block interfaces.SignedBeaconBlock, + blockRoot [32]byte, +) (state.BeaconState, bool, error) { + preStateVersion, preStateHeader, err := getStateVersionAndPayload(preState) + if err != nil { + return nil, false, err } - - // Have we been finalizing? Should we start saving hot states to db? - if err := s.checkSaveHotStateDB(ctx); err != nil { - return err + eg, _ := errgroup.WithContext(ctx) + var postState state.BeaconState + eg.Go(func() error { + var err error + postState, err = s.validateStateTransition(ctx, preState, block) + if err != nil { + return errors.Wrap(err, "failed to validate consensus state transition function") + } + return nil + }) + var isValidPayload bool + eg.Go(func() error { + var err error + isValidPayload, err = s.validateExecutionOnBlock(ctx, preStateVersion, preStateHeader, block, blockRoot) + if err != nil { + return errors.Wrap(err, "could not notify the engine of the new payload") + } + return nil + }) + if err := eg.Wait(); err != nil { + return nil, false, err } + return postState, isValidPayload, nil +} - // We apply the same heuristic to some of our more important caches. - if err := s.handleCaches(); err != nil { - return err +func (s *Service) handleDA( + ctx context.Context, + block interfaces.SignedBeaconBlock, + blockRoot [32]byte, + avs das.AvailabilityStore, +) (time.Duration, error) { + daStartTime := time.Now() + if avs != nil { + rob, err := blocks.NewROBlockWithRoot(block, blockRoot) + if err != nil { + return 0, err + } + if err := avs.IsDataAvailable(ctx, s.CurrentSlot(), rob); err != nil { + return 0, errors.Wrap(err, "could not validate blob data availability (AvailabilityStore.IsDataAvailable)") + } + } else { + if err := s.isDataAvailable(ctx, blockRoot, block); err != nil { + return 0, errors.Wrap(err, "could not validate blob data availability") + } } + daWaitedTime := time.Since(daStartTime) + dataAvailWaitedTime.Observe(float64(daWaitedTime.Milliseconds())) + return daWaitedTime, nil +} +func (s *Service) reportPostBlockProcessing( + block interfaces.SignedBeaconBlock, + blockRoot [32]byte, + receivedTime time.Time, + daWaitedTime time.Duration, +) { // Reports on block and fork choice metrics. cp := s.cfg.ForkChoiceStore.FinalizedCheckpoint() finalized := ðpb.Checkpoint{Epoch: cp.Epoch, Root: bytesutil.SafeCopyBytes(cp.Root[:])} - reportSlotMetrics(blockCopy.Block().Slot(), s.HeadSlot(), s.CurrentSlot(), finalized) + reportSlotMetrics(block.Block().Slot(), s.HeadSlot(), s.CurrentSlot(), finalized) // Log block sync status. cp = s.cfg.ForkChoiceStore.JustifiedCheckpoint() justified := ðpb.Checkpoint{Epoch: cp.Epoch, Root: bytesutil.SafeCopyBytes(cp.Root[:])} - if err := logBlockSyncStatus(blockCopy.Block(), blockRoot, justified, finalized, receivedTime, uint64(s.genesisTime.Unix()), daWaitedTime); err != nil { + if err := logBlockSyncStatus(block.Block(), blockRoot, justified, finalized, receivedTime, uint64(s.genesisTime.Unix()), daWaitedTime); err != nil { log.WithError(err).Error("Unable to log block sync status") } // Log payload data - if err := logPayload(blockCopy.Block()); err != nil { + if err := logPayload(block.Block()); err != nil { log.WithError(err).Error("Unable to log debug block payload data") } // Log state transition data. - if err := logStateTransitionData(blockCopy.Block()); err != nil { + if err := logStateTransitionData(block.Block()); err != nil { log.WithError(err).Error("Unable to log state transition data") } - timeWithoutDaWait := time.Since(receivedTime) - daWaitedTime chainServiceProcessingTime.Observe(float64(timeWithoutDaWait.Milliseconds())) - - return nil } func (s *Service) executePostFinalizationTasks(ctx context.Context, finalizedState state.BeaconState) { From af098e737ef3fa5ae2eb5b069607d1f016ff64c9 Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 5 Aug 2024 11:20:26 -0300 Subject: [PATCH 237/325] Check locally for min-bid and min-bid-difference (#14205) * Check locally for min-bid and min-bid-difference * fix tests * Terence's fix Co-authored-by: terence * Terence's review * fix tests --------- Co-authored-by: terence --- beacon-chain/node/config.go | 15 ++++++++ .../v1alpha1/validator/proposer_bellatrix.go | 21 +++++++++++ .../validator/proposer_bellatrix_test.go | 36 ++++++++++++++++++- cmd/beacon-chain/flags/base.go | 17 +++++++++ cmd/beacon-chain/main.go | 2 ++ cmd/beacon-chain/usage.go | 2 ++ config/params/config.go | 3 +- 7 files changed, 94 insertions(+), 2 deletions(-) diff --git a/beacon-chain/node/config.go b/beacon-chain/node/config.go index bb2aa2de1049..19f7d74d700a 100644 --- a/beacon-chain/node/config.go +++ b/beacon-chain/node/config.go @@ -73,6 +73,21 @@ func configureBuilderCircuitBreaker(cliCtx *cli.Context) error { return err } } + if cliCtx.IsSet(flags.MinBuilderBid.Name) { + c := params.BeaconConfig().Copy() + c.MinBuilderBid = cliCtx.Uint64(flags.MinBuilderBid.Name) + if err := params.SetActive(c); err != nil { + return err + } + } + if cliCtx.IsSet(flags.MinBuilderDiff.Name) { + c := params.BeaconConfig().Copy() + c.MinBuilderDiff = cliCtx.Uint64(flags.MinBuilderDiff.Name) + if err := params.SetActive(c); err != nil { + return err + } + } + return nil } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index e33bc4f2fa70..636858144ae6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -96,6 +96,27 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc // Compare payload values between local and builder. Default to the local value if it is higher. localValueGwei := primitives.WeiToGwei(local.Bid) builderValueGwei := primitives.WeiToGwei(bid.Value()) + minBid := primitives.Gwei(params.BeaconConfig().MinBuilderBid) + // Use local block if min bid is not attained + if builderValueGwei < minBid { + log.WithFields(logrus.Fields{ + "minBuilderBid": minBid, + "builderGweiValue": builderValueGwei, + }).Warn("Proposer: using local execution payload because min bid not attained") + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) + } + + // Use local block if min difference is not attained + minDiff := localValueGwei + primitives.Gwei(params.BeaconConfig().MinBuilderDiff) + if builderValueGwei < minDiff { + log.WithFields(logrus.Fields{ + "localGweiValue": localValueGwei, + "minBidDiff": minDiff, + "builderGweiValue": builderValueGwei, + }).Warn("Proposer: using local execution payload because min difference with local value was not attained") + return local.Bid, local.BlobsBundle, setLocalExecution(blk, local) + } + // Use builder payload if the following in true: // builder_bid_value * builderBoostFactor(default 100) > local_block_value * (local-block-value-boost + 100) boost := primitives.Gwei(params.BeaconConfig().LocalBlockValueBoost) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go index 6e79ada339c5..7d02c392539e 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go @@ -420,7 +420,41 @@ func TestServer_setExecutionData(t *testing.T) { require.NoError(t, err) require.Equal(t, uint64(3), e.BlockNumber()) // Local block - require.LogsContain(t, hook, "builderGweiValue=1 localBoostPercentage=0 localGweiValue=2") + require.LogsContain(t, hook, "\"Proposer: using local execution payload because min difference with local value was not attained\" builderGweiValue=1 localGweiValue=2") + }) + t.Run("Builder configured. Builder block does not achieve min bid", func(t *testing.T) { + cfg := params.BeaconConfig().Copy() + cfg.MinBuilderBid = 5 + params.OverrideBeaconConfig(cfg) + + blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockCapella()) + require.NoError(t, err) + elBid := primitives.Uint64ToWei(2 * 1e9) + ed, err := blocks.NewWrappedExecutionData(&v1.ExecutionPayloadCapella{BlockNumber: 3}) + require.NoError(t, err) + vs.ExecutionEngineCaller = &powtesting.EngineClient{PayloadIDBytes: id, GetPayloadResponse: &blocks.GetPayloadResponse{ExecutionData: ed, Bid: elBid}} + b := blk.Block() + res, err := vs.getLocalPayload(ctx, b, capellaTransitionState) + require.NoError(t, err) + builderBid, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) + require.NoError(t, err) + _, err = builderBid.Header() + require.NoError(t, err) + builderKzgCommitments, err := builderBid.BlobKzgCommitments() + if builderBid.Version() >= version.Deneb { + require.NoError(t, err) + } + require.DeepEqual(t, [][]uint8{}, builderKzgCommitments) + _, bundle, err := setExecutionData(context.Background(), blk, res, builderBid, defaultBuilderBoostFactor) + require.NoError(t, err) + require.IsNil(t, bundle) + e, err := blk.Block().Body().Execution() + require.NoError(t, err) + require.Equal(t, uint64(3), e.BlockNumber()) // Local block + + require.LogsContain(t, hook, "\"Proposer: using local execution payload because min bid not attained\" builderGweiValue=1 minBuilderBid=5") + cfg.MinBuilderBid = 0 + params.OverrideBeaconConfig(cfg) }) t.Run("Builder configured. Local block and local boost has higher value", func(t *testing.T) { cfg := params.BeaconConfig().Copy() diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 4e8c94882043..731aac2e5c20 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -31,6 +31,23 @@ var ( "Boost is an additional percentage to multiple local block value. Use builder block if: builder_bid_value * 100 > local_block_value * (local-block-value-boost + 100)", Value: 10, } + // MinBuilderBid sets an absolute value for the builder bid that this + // node will accept without reverting to local building + MinBuilderBid = &cli.Uint64Flag{ + Name: "min-builder-bid", + Usage: "An absolute value in Gwei that the builder bid has to have in order for this beacon node to use the builder's block. Anything less than this value" + + " and the beacon will revert to local building.", + Value: 0, + } + // MinBuilderDiff sets an absolute value for the difference between the + // builder's bid and the local block value that this node will accept + // without reverting to local building + MinBuilderDiff = &cli.Uint64Flag{ + Name: "min-builder-to-local-difference", + Usage: "An absolute value in Gwei that the builder bid has to have in order for this beacon node to use the builder's block. Anything less than this value" + + " and the beacon will revert to local building.", + Value: 0, + } // ExecutionEngineEndpoint provides an HTTP access endpoint to connect to an execution client on the execution layer ExecutionEngineEndpoint = &cli.StringFlag{ Name: "execution-endpoint", diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 19819c8e4316..0f3a42547615 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -82,6 +82,8 @@ var appFlags = []cli.Flag{ flags.MaxBuilderConsecutiveMissedSlots, flags.EngineEndpointTimeoutSeconds, flags.LocalBlockValueBoost, + flags.MinBuilderBid, + flags.MinBuilderDiff, cmd.BackupWebhookOutputDir, cmd.MinimalConfigFlag, cmd.E2EConfigFlag, diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 6d0f39cc2535..66f7c1013f2f 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -131,6 +131,8 @@ var appHelpFlagGroups = []flagGroup{ flags.EngineEndpointTimeoutSeconds, flags.SlasherDirFlag, flags.LocalBlockValueBoost, + flags.MinBuilderBid, + flags.MinBuilderDiff, flags.JwtId, checkpoint.BlockPath, checkpoint.StatePath, diff --git a/config/params/config.go b/config/params/config.go index 5a33bc1a631d..69f7193df13a 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -222,7 +222,8 @@ type BeaconChainConfig struct { MaxBuilderConsecutiveMissedSlots primitives.Slot // MaxBuilderConsecutiveMissedSlots defines the number of consecutive skip slot to fallback from using relay/builder to local execution engine for block construction. MaxBuilderEpochMissedSlots primitives.Slot // MaxBuilderEpochMissedSlots is defining the number of total skip slot (per epoch rolling windows) to fallback from using relay/builder to local execution engine for block construction. LocalBlockValueBoost uint64 // LocalBlockValueBoost is the value boost for local block construction. This is used to prioritize local block construction over relay/builder block construction. - + MinBuilderBid uint64 // MinBuilderBid is the minimum value that the builder's block can have to be considered by this node. + MinBuilderDiff uint64 // MinBuilderDiff is the minimum value above the local block value that the builder has to bid to be considered by this node // Execution engine timeout value ExecutionEngineTimeoutValue uint64 // ExecutionEngineTimeoutValue defines the seconds to wait before timing out engine endpoints with execution payload execution semantics (newPayload, forkchoiceUpdated). From e0785a89393d0765b33d7805d312d9da398ce4ed Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:56:43 +0200 Subject: [PATCH 238/325] HTTP endpoint for `GetValidatorActiveSetChanges` (#14264) * add GetValidatorActiveSetChanges * fix linter * fix errors * James' review * use stater * fix merge conflict errors * remove validator from func names * rename util funcs --- api/server/structs/endpoints_validator.go | 12 ++ beacon-chain/rpc/core/BUILD.bazel | 1 + beacon-chain/rpc/core/service.go | 1 + beacon-chain/rpc/core/validator.go | 91 ++++++++++ beacon-chain/rpc/endpoints.go | 21 ++- beacon-chain/rpc/endpoints_test.go | 7 +- .../rpc/prysm/v1alpha1/beacon/BUILD.bazel | 1 - .../rpc/prysm/v1alpha1/beacon/validators.go | 69 +------- .../prysm/v1alpha1/beacon/validators_test.go | 20 ++- beacon-chain/rpc/prysm/validator/BUILD.bazel | 4 + beacon-chain/rpc/prysm/validator/handlers.go | 65 ++++++- .../rpc/prysm/validator/handlers_test.go | 159 +++++++++++++++++- .../prysm/validator/validator_performance.go | 6 +- .../validator/validator_performance_test.go | 14 +- 14 files changed, 371 insertions(+), 100 deletions(-) diff --git a/api/server/structs/endpoints_validator.go b/api/server/structs/endpoints_validator.go index c24d4c795345..dfb94daea20a 100644 --- a/api/server/structs/endpoints_validator.go +++ b/api/server/structs/endpoints_validator.go @@ -137,3 +137,15 @@ type ValidatorParticipation struct { PreviousEpochTargetAttestingGwei string `json:"previous_epoch_target_attesting_gwei"` PreviousEpochHeadAttestingGwei string `json:"previous_epoch_head_attesting_gwei"` } + +type ActiveSetChanges struct { + Epoch string `json:"epoch"` + ActivatedPublicKeys []string `json:"activated_public_keys"` + ActivatedIndices []string `json:"activated_indices"` + ExitedPublicKeys []string `json:"exited_public_keys"` + ExitedIndices []string `json:"exited_indices"` + SlashedPublicKeys []string `json:"slashed_public_keys"` + SlashedIndices []string `json:"slashed_indices"` + EjectedPublicKeys []string `json:"ejected_public_keys"` + EjectedIndices []string `json:"ejected_indices"` +} diff --git a/beacon-chain/rpc/core/BUILD.bazel b/beacon-chain/rpc/core/BUILD.bazel index 2b4a49179b5d..221b83286eb7 100644 --- a/beacon-chain/rpc/core/BUILD.bazel +++ b/beacon-chain/rpc/core/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", + "//beacon-chain/core/validators:go_default_library", "//beacon-chain/db:go_default_library", "//beacon-chain/forkchoice/types:go_default_library", "//beacon-chain/operations/synccommittee:go_default_library", diff --git a/beacon-chain/rpc/core/service.go b/beacon-chain/rpc/core/service.go index 2345d26abd4f..3b1639d2eca8 100644 --- a/beacon-chain/rpc/core/service.go +++ b/beacon-chain/rpc/core/service.go @@ -13,6 +13,7 @@ import ( type Service struct { BeaconDB db.ReadOnlyDatabase + ChainInfoFetcher blockchain.ChainInfoFetcher HeadFetcher blockchain.HeadFetcher FinalizedFetcher blockchain.FinalizationFetcher GenesisTimeFetcher blockchain.TimeFetcher diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 871a94589456..171b55d57419 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -16,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" beaconState "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" @@ -836,3 +837,93 @@ func (s *Service) ValidatorParticipation( } return p, nil } + +// ValidatorActiveSetChanges retrieves the active set changes for a given epoch. +// +// This data includes any activations, voluntary exits, and involuntary +// ejections. +func (s *Service) ValidatorActiveSetChanges( + ctx context.Context, + requestedEpoch primitives.Epoch, +) ( + *ethpb.ActiveSetChanges, + *RpcError, +) { + currentEpoch := slots.ToEpoch(s.GenesisTimeFetcher.CurrentSlot()) + if requestedEpoch > currentEpoch { + return nil, &RpcError{ + Err: errors.Errorf("cannot retrieve information about an epoch in the future, current epoch %d, requesting %d", currentEpoch, requestedEpoch), + Reason: BadRequest, + } + } + + slot, err := slots.EpochStart(requestedEpoch) + if err != nil { + return nil, &RpcError{Err: err, Reason: BadRequest} + } + requestedState, err := s.ReplayerBuilder.ReplayerForSlot(slot).ReplayBlocks(ctx) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrapf(err, "error replaying blocks for state at slot %d", slot), + Reason: Internal, + } + } + + activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, requestedState, coreTime.CurrentEpoch(requestedState)) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrap(err, "could not get active validator count"), + Reason: Internal, + } + } + vs := requestedState.Validators() + activatedIndices := validators.ActivatedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs) + exitedIndices, err := validators.ExitedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs, activeValidatorCount) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrap(err, "could not determine exited validator indices"), + Reason: Internal, + } + } + slashedIndices := validators.SlashedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs) + ejectedIndices, err := validators.EjectedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs, activeValidatorCount) + if err != nil { + return nil, &RpcError{ + Err: errors.Wrap(err, "could not determine ejected validator indices"), + Reason: Internal, + } + } + + // Retrieve public keys for the indices. + activatedKeys := make([][]byte, len(activatedIndices)) + exitedKeys := make([][]byte, len(exitedIndices)) + slashedKeys := make([][]byte, len(slashedIndices)) + ejectedKeys := make([][]byte, len(ejectedIndices)) + for i, idx := range activatedIndices { + pubkey := requestedState.PubkeyAtIndex(idx) + activatedKeys[i] = pubkey[:] + } + for i, idx := range exitedIndices { + pubkey := requestedState.PubkeyAtIndex(idx) + exitedKeys[i] = pubkey[:] + } + for i, idx := range slashedIndices { + pubkey := requestedState.PubkeyAtIndex(idx) + slashedKeys[i] = pubkey[:] + } + for i, idx := range ejectedIndices { + pubkey := requestedState.PubkeyAtIndex(idx) + ejectedKeys[i] = pubkey[:] + } + return ðpb.ActiveSetChanges{ + Epoch: requestedEpoch, + ActivatedPublicKeys: activatedKeys, + ActivatedIndices: activatedIndices, + ExitedPublicKeys: exitedKeys, + ExitedIndices: exitedIndices, + SlashedPublicKeys: slashedKeys, + SlashedIndices: slashedIndices, + EjectedPublicKeys: ejectedKeys, + EjectedIndices: ejectedIndices, + }, nil +} diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 09ae99a3d5a0..9a67d2d8f38c 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -1080,31 +1080,40 @@ func (s *Service) prysmValidatorEndpoints(stater lookup.Stater, coreService *cor return []endpoint{ { template: "/prysm/validators/performance", - name: namespace + ".GetValidatorPerformance", + name: namespace + ".GetPerformance", middleware: []mux.MiddlewareFunc{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, - handler: server.GetValidatorPerformance, + handler: server.GetPerformance, methods: []string{http.MethodPost}, }, { template: "/prysm/v1/validators/performance", - name: namespace + ".GetValidatorPerformance", + name: namespace + ".GetPerformance", middleware: []mux.MiddlewareFunc{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, - handler: server.GetValidatorPerformance, + handler: server.GetPerformance, methods: []string{http.MethodPost}, }, { template: "/prysm/v1/validators/participation", - name: namespace + ".GetValidatorParticipation", + name: namespace + ".GetParticipation", middleware: []mux.MiddlewareFunc{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, - handler: server.GetValidatorParticipation, + handler: server.GetParticipation, + methods: []string{http.MethodGet}, + }, + { + template: "/prysm/v1/validators/active_set_changes", + name: namespace + ".GetActiveSetChanges", + middleware: []mux.MiddlewareFunc{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetActiveSetChanges, methods: []string{http.MethodGet}, }, } diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index 9b0253982cd5..6b7799303f31 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -125,9 +125,10 @@ func Test_endpoints(t *testing.T) { } prysmValidatorRoutes := map[string][]string{ - "/prysm/validators/performance": {http.MethodPost}, - "/prysm/v1/validators/performance": {http.MethodPost}, - "/prysm/v1/validators/participation": {http.MethodGet}, + "/prysm/validators/performance": {http.MethodPost}, + "/prysm/v1/validators/performance": {http.MethodPost}, + "/prysm/v1/validators/participation": {http.MethodGet}, + "/prysm/v1/validators/active_set_changes": {http.MethodGet}, } s := &Service{cfg: &Config{}} diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel index 22aa404d2d75..81c180d28d46 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel @@ -25,7 +25,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/db:go_default_library", "//beacon-chain/db/filters:go_default_library", "//beacon-chain/execution:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index 9e3dcd6dfdd8..e1c77ce9f25f 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -10,7 +10,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/cmd" @@ -390,7 +389,7 @@ func (bs *Server) GetValidator( func (bs *Server) GetValidatorActiveSetChanges( ctx context.Context, req *ethpb.GetValidatorActiveSetChangesRequest, ) (*ethpb.ActiveSetChanges, error) { - currentEpoch := slots.ToEpoch(bs.GenesisTimeFetcher.CurrentSlot()) + currentEpoch := slots.ToEpoch(bs.CoreService.GenesisTimeFetcher.CurrentSlot()) var requestedEpoch primitives.Epoch switch q := req.QueryFilter.(type) { @@ -401,72 +400,12 @@ func (bs *Server) GetValidatorActiveSetChanges( default: requestedEpoch = currentEpoch } - if requestedEpoch > currentEpoch { - return nil, status.Errorf( - codes.InvalidArgument, - errEpoch, - currentEpoch, - requestedEpoch, - ) - } - s, err := slots.EpochStart(requestedEpoch) + as, err := bs.CoreService.ValidatorActiveSetChanges(ctx, requestedEpoch) if err != nil { - return nil, err + return nil, status.Errorf(core.ErrorReasonToGRPC(err.Reason), "Could not retrieve validator active set changes: %v", err.Err) } - requestedState, err := bs.ReplayerBuilder.ReplayerForSlot(s).ReplayBlocks(ctx) - if err != nil { - return nil, status.Error(codes.Internal, fmt.Sprintf("error replaying blocks for state at slot %d: %v", s, err)) - } - - activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, requestedState, coreTime.CurrentEpoch(requestedState)) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get active validator count: %v", err) - } - vs := requestedState.Validators() - activatedIndices := validators.ActivatedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs) - exitedIndices, err := validators.ExitedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs, activeValidatorCount) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not determine exited validator indices: %v", err) - } - slashedIndices := validators.SlashedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs) - ejectedIndices, err := validators.EjectedValidatorIndices(coreTime.CurrentEpoch(requestedState), vs, activeValidatorCount) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not determine ejected validator indices: %v", err) - } - - // Retrieve public keys for the indices. - activatedKeys := make([][]byte, len(activatedIndices)) - exitedKeys := make([][]byte, len(exitedIndices)) - slashedKeys := make([][]byte, len(slashedIndices)) - ejectedKeys := make([][]byte, len(ejectedIndices)) - for i, idx := range activatedIndices { - pubkey := requestedState.PubkeyAtIndex(idx) - activatedKeys[i] = pubkey[:] - } - for i, idx := range exitedIndices { - pubkey := requestedState.PubkeyAtIndex(idx) - exitedKeys[i] = pubkey[:] - } - for i, idx := range slashedIndices { - pubkey := requestedState.PubkeyAtIndex(idx) - slashedKeys[i] = pubkey[:] - } - for i, idx := range ejectedIndices { - pubkey := requestedState.PubkeyAtIndex(idx) - ejectedKeys[i] = pubkey[:] - } - return ðpb.ActiveSetChanges{ - Epoch: requestedEpoch, - ActivatedPublicKeys: activatedKeys, - ActivatedIndices: activatedIndices, - ExitedPublicKeys: exitedKeys, - ExitedIndices: exitedIndices, - SlashedPublicKeys: slashedKeys, - SlashedIndices: slashedIndices, - EjectedPublicKeys: ejectedKeys, - EjectedIndices: ejectedIndices, - }, nil + return as, nil } // GetValidatorParticipation retrieves the validator participation information for a given epoch, diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go index 515322b135aa..85d620a1fcb3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go @@ -54,11 +54,13 @@ func TestServer_GetValidatorActiveSetChanges_CannotRequestFutureEpoch(t *testing require.NoError(t, err) require.NoError(t, st.SetSlot(0)) bs := &Server{ - GenesisTimeFetcher: &mock.ChainService{}, - HeadFetcher: &mock.ChainService{ - State: st, + CoreService: &core.Service{ + BeaconDB: beaconDB, + GenesisTimeFetcher: &mock.ChainService{}, + HeadFetcher: &mock.ChainService{ + State: st, + }, }, - BeaconDB: beaconDB, } wanted := errNoEpochInfoError @@ -66,7 +68,7 @@ func TestServer_GetValidatorActiveSetChanges_CannotRequestFutureEpoch(t *testing ctx, ðpb.GetValidatorActiveSetChangesRequest{ QueryFilter: ðpb.GetValidatorActiveSetChangesRequest_Epoch{ - Epoch: slots.ToEpoch(bs.GenesisTimeFetcher.CurrentSlot()) + 1, + Epoch: slots.ToEpoch(bs.CoreService.GenesisTimeFetcher.CurrentSlot()) + 1, }, }, ) @@ -1283,10 +1285,12 @@ func TestServer_GetValidatorActiveSetChanges(t *testing.T) { require.NoError(t, beaconDB.SaveState(ctx, headState, gRoot)) bs := &Server{ - FinalizationFetcher: &mock.ChainService{ - FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, fieldparams.RootLength)}, + CoreService: &core.Service{ + FinalizedFetcher: &mock.ChainService{ + FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, fieldparams.RootLength)}, + }, + GenesisTimeFetcher: &mock.ChainService{}, }, - GenesisTimeFetcher: &mock.ChainService{}, } addDefaultReplayerBuilder(bs, beaconDB) res, err := bs.GetValidatorActiveSetChanges(ctx, ðpb.GetValidatorActiveSetChangesRequest{ diff --git a/beacon-chain/rpc/prysm/validator/BUILD.bazel b/beacon-chain/rpc/prysm/validator/BUILD.bazel index b5ba1d424dc9..86cdf38192b0 100644 --- a/beacon-chain/rpc/prysm/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/validator/BUILD.bazel @@ -16,9 +16,11 @@ go_library( "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", + "//consensus-types/primitives:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", @@ -47,6 +49,7 @@ go_test( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/state/stategen/mock:go_default_library", "//beacon-chain/sync/initial-sync/testing:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/blocks/testing:go_default_library", @@ -60,6 +63,7 @@ go_test( "//testing/util:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], diff --git a/beacon-chain/rpc/prysm/validator/handlers.go b/beacon-chain/rpc/prysm/validator/handlers.go index 983c11ac1c55..4c48a8708876 100644 --- a/beacon-chain/rpc/prysm/validator/handlers.go +++ b/beacon-chain/rpc/prysm/validator/handlers.go @@ -4,20 +4,22 @@ import ( "fmt" "net/http" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) -// GetValidatorParticipation retrieves the validator participation information for a given epoch, +// GetParticipation retrieves the validator participation information for a given epoch, // it returns the information about validator's participation rate in voting on the proof of stake // rules based on their balance compared to the total active validator balance. -func (s *Server) GetValidatorParticipation(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.GetValidatorParticipation") +func (s *Server) GetParticipation(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.GetParticipation") defer span.End() stateId := mux.Vars(r)["state_id"] @@ -56,3 +58,60 @@ func (s *Server) GetValidatorParticipation(w http.ResponseWriter, r *http.Reques } httputil.WriteJson(w, response) } + +// GetActiveSetChanges retrieves the active set changes for a given epoch. +// +// This data includes any activations, voluntary exits, and involuntary +// ejections. +func (s *Server) GetActiveSetChanges(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.GetActiveSetChanges") + defer span.End() + + stateId := mux.Vars(r)["state_id"] + if stateId == "" { + httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) + return + } + + st, err := s.Stater.State(ctx, []byte(stateId)) + if err != nil { + shared.WriteStateFetchError(w, err) + return + } + stEpoch := slots.ToEpoch(st.Slot()) + + as, rpcError := s.CoreService.ValidatorActiveSetChanges(ctx, stEpoch) + if rpcError != nil { + httputil.HandleError(w, rpcError.Err.Error(), core.ErrorReasonToHTTP(rpcError.Reason)) + return + } + + response := &structs.ActiveSetChanges{ + Epoch: fmt.Sprintf("%d", as.Epoch), + ActivatedPublicKeys: byteSlice2dToStringSlice(as.ActivatedPublicKeys), + ActivatedIndices: uint64SliceToStringSlice(as.ActivatedIndices), + ExitedPublicKeys: byteSlice2dToStringSlice(as.ExitedPublicKeys), + ExitedIndices: uint64SliceToStringSlice(as.ExitedIndices), + SlashedPublicKeys: byteSlice2dToStringSlice(as.SlashedPublicKeys), + SlashedIndices: uint64SliceToStringSlice(as.SlashedIndices), + EjectedPublicKeys: byteSlice2dToStringSlice(as.EjectedPublicKeys), + EjectedIndices: uint64SliceToStringSlice(as.EjectedIndices), + } + httputil.WriteJson(w, response) +} + +func byteSlice2dToStringSlice(byteArrays [][]byte) []string { + s := make([]string, len(byteArrays)) + for i, b := range byteArrays { + s[i] = hexutil.Encode(b) + } + return s +} + +func uint64SliceToStringSlice(indices []primitives.ValidatorIndex) []string { + s := make([]string, len(indices)) + for i, u := range indices { + s[i] = fmt.Sprintf("%d", u) + } + return s +} diff --git a/beacon-chain/rpc/prysm/validator/handlers_test.go b/beacon-chain/rpc/prysm/validator/handlers_test.go index d73276ab712f..9956926e54e9 100644 --- a/beacon-chain/rpc/prysm/validator/handlers_test.go +++ b/beacon-chain/rpc/prysm/validator/handlers_test.go @@ -3,6 +3,7 @@ package validator import ( "bytes" "context" + "encoding/binary" "encoding/json" "fmt" "math" @@ -11,6 +12,7 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/api/server/structs" @@ -25,10 +27,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" blocktest "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks/testing" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -69,7 +73,7 @@ func TestServer_GetValidatorParticipation_NoState(t *testing.T) { writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetValidatorParticipation(writer, request) + s.GetParticipation(writer, request) require.Equal(t, http.StatusBadRequest, writer.Code) require.StringContains(t, "state_id is required in URL params", writer.Body.String()) } @@ -150,7 +154,7 @@ func TestServer_GetValidatorParticipation_CurrentAndPrevEpoch(t *testing.T) { writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetValidatorParticipation(writer, request) + s.GetParticipation(writer, request) assert.Equal(t, http.StatusOK, writer.Code) want := &structs.GetValidatorParticipationResponse{ @@ -250,7 +254,7 @@ func TestServer_GetValidatorParticipation_OrphanedUntilGenesis(t *testing.T) { writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetValidatorParticipation(writer, request) + s.GetParticipation(writer, request) assert.Equal(t, http.StatusOK, writer.Code) want := &structs.GetValidatorParticipationResponse{ @@ -380,7 +384,7 @@ func runGetValidatorParticipationCurrentEpoch(t *testing.T, genState state.Beaco writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetValidatorParticipation(writer, request) + s.GetParticipation(writer, request) assert.Equal(t, http.StatusOK, writer.Code) want := &structs.GetValidatorParticipationResponse{ @@ -405,3 +409,150 @@ func runGetValidatorParticipationCurrentEpoch(t *testing.T, genState state.Beaco assert.DeepEqual(t, true, vp.Finalized, "Incorrect validator participation respond") assert.DeepEqual(t, *want.Participation, *vp.Participation, "Incorrect validator participation respond") } + +func TestServer_GetValidatorActiveSetChanges_NoState(t *testing.T) { + beaconDB := dbTest.SetupDB(t) + var st state.BeaconState + st, _ = util.DeterministicGenesisState(t, 4) + + s := &Server{ + Stater: &testutil.MockStater{ + BeaconState: st, + }, + CoreService: &core.Service{ + BeaconDB: beaconDB, + GenesisTimeFetcher: &mock.ChainService{}, + HeadFetcher: &mock.ChainService{ + State: st, + }, + }, + } + + url := "http://example.com" + fmt.Sprintf("%d", slots.ToEpoch(s.CoreService.GenesisTimeFetcher.CurrentSlot())+1) + request := httptest.NewRequest(http.MethodGet, url, nil) + request = mux.SetURLVars(request, map[string]string{"state_id": ""}) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetActiveSetChanges(writer, request) + require.Equal(t, http.StatusBadRequest, writer.Code) + require.StringContains(t, "state_id is required in URL params", writer.Body.String()) +} + +func TestServer_GetValidatorActiveSetChanges(t *testing.T) { + beaconDB := dbTest.SetupDB(t) + + ctx := context.Background() + validators := make([]*ethpb.Validator, 8) + headState, err := util.NewBeaconState() + require.NoError(t, err) + require.NoError(t, headState.SetSlot(0)) + require.NoError(t, headState.SetValidators(validators)) + for i := 0; i < len(validators); i++ { + activationEpoch := params.BeaconConfig().FarFutureEpoch + withdrawableEpoch := params.BeaconConfig().FarFutureEpoch + exitEpoch := params.BeaconConfig().FarFutureEpoch + slashed := false + balance := params.BeaconConfig().MaxEffectiveBalance + // Mark indices divisible by two as activated. + if i%2 == 0 { + activationEpoch = 0 + } else if i%3 == 0 { + // Mark indices divisible by 3 as slashed. + withdrawableEpoch = params.BeaconConfig().EpochsPerSlashingsVector + slashed = true + } else if i%5 == 0 { + // Mark indices divisible by 5 as exited. + exitEpoch = 0 + withdrawableEpoch = params.BeaconConfig().MinValidatorWithdrawabilityDelay + } else if i%7 == 0 { + // Mark indices divisible by 7 as ejected. + exitEpoch = 0 + withdrawableEpoch = params.BeaconConfig().MinValidatorWithdrawabilityDelay + balance = params.BeaconConfig().EjectionBalance + } + err := headState.UpdateValidatorAtIndex(primitives.ValidatorIndex(i), ðpb.Validator{ + ActivationEpoch: activationEpoch, + PublicKey: pubKey(uint64(i)), + EffectiveBalance: balance, + WithdrawalCredentials: make([]byte, 32), + WithdrawableEpoch: withdrawableEpoch, + Slashed: slashed, + ExitEpoch: exitEpoch, + }) + require.NoError(t, err) + } + b := util.NewBeaconBlock() + util.SaveBlock(t, ctx, beaconDB, b) + + gRoot, err := b.Block.HashTreeRoot() + require.NoError(t, err) + require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) + require.NoError(t, beaconDB.SaveState(ctx, headState, gRoot)) + + var st state.BeaconState + st, _ = util.DeterministicGenesisState(t, 4) + s := &Server{ + Stater: &testutil.MockStater{ + BeaconState: st, + }, + CoreService: &core.Service{ + FinalizedFetcher: &mock.ChainService{ + FinalizedCheckPoint: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, fieldparams.RootLength)}, + }, + GenesisTimeFetcher: &mock.ChainService{}, + }, + } + addDefaultReplayerBuilder(s, beaconDB) + + url := "http://example.com" + request := httptest.NewRequest(http.MethodGet, url, nil) + request = mux.SetURLVars(request, map[string]string{"state_id": "genesis"}) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetActiveSetChanges(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + + wantedActive := []string{ + hexutil.Encode(pubKey(0)), + hexutil.Encode(pubKey(2)), + hexutil.Encode(pubKey(4)), + hexutil.Encode(pubKey(6)), + } + wantedActiveIndices := []string{"0", "2", "4", "6"} + wantedExited := []string{ + hexutil.Encode(pubKey(5)), + } + wantedExitedIndices := []string{"5"} + wantedSlashed := []string{ + hexutil.Encode(pubKey(3)), + } + wantedSlashedIndices := []string{"3"} + wantedEjected := []string{ + hexutil.Encode(pubKey(7)), + } + wantedEjectedIndices := []string{"7"} + want := &structs.ActiveSetChanges{ + Epoch: "0", + ActivatedPublicKeys: wantedActive, + ActivatedIndices: wantedActiveIndices, + ExitedPublicKeys: wantedExited, + ExitedIndices: wantedExitedIndices, + SlashedPublicKeys: wantedSlashed, + SlashedIndices: wantedSlashedIndices, + EjectedPublicKeys: wantedEjected, + EjectedIndices: wantedEjectedIndices, + } + + var as *structs.ActiveSetChanges + err = json.NewDecoder(writer.Body).Decode(&as) + require.NoError(t, err) + require.DeepEqual(t, *want, *as) +} + +func pubKey(i uint64) []byte { + pubKey := make([]byte, params.BeaconConfig().BLSPubkeyLength) + binary.LittleEndian.PutUint64(pubKey, i) + return pubKey +} diff --git a/beacon-chain/rpc/prysm/validator/validator_performance.go b/beacon-chain/rpc/prysm/validator/validator_performance.go index 2af8d00414e1..faa8325a78b9 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance.go @@ -13,9 +13,9 @@ import ( "go.opencensus.io/trace" ) -// GetValidatorPerformance is an HTTP handler for GetValidatorPerformance. -func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.GetValidatorPerformance") +// GetPerformance is an HTTP handler for GetPerformance. +func (s *Server) GetPerformance(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.GetPerformance") defer span.End() var req structs.GetValidatorPerformanceRequest diff --git a/beacon-chain/rpc/prysm/validator/validator_performance_test.go b/beacon-chain/rpc/prysm/validator/validator_performance_test.go index 379f5669a9d0..903734e4af5c 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance_test.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance_test.go @@ -35,7 +35,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { }, } - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", nil) client := &http.Client{} @@ -86,7 +86,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { err = json.NewEncoder(&buf).Encode(request) require.NoError(t, err) - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", &buf) client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) @@ -151,7 +151,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { err = json.NewEncoder(&buf).Encode(request) require.NoError(t, err) - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", &buf) client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) @@ -216,7 +216,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { err = json.NewEncoder(&buf).Encode(request) require.NoError(t, err) - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", &buf) client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) @@ -278,7 +278,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { err := json.NewEncoder(&buf).Encode(request) require.NoError(t, err) - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", &buf) client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) @@ -340,7 +340,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { err := json.NewEncoder(&buf).Encode(request) require.NoError(t, err) - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", &buf) client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) @@ -402,7 +402,7 @@ func TestServer_GetValidatorPerformance(t *testing.T) { err := json.NewEncoder(&buf).Encode(request) require.NoError(t, err) - srv := httptest.NewServer(http.HandlerFunc(vs.GetValidatorPerformance)) + srv := httptest.NewServer(http.HandlerFunc(vs.GetPerformance)) req := httptest.NewRequest("POST", "/foo", &buf) client := &http.Client{} rawResp, err := client.Post(srv.URL, "application/json", req.Body) From 0c0a497651b4388503dba60be55d26959281909f Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 7 Aug 2024 10:05:24 -0500 Subject: [PATCH 239/325] engine_getPayloadBodiesByRangeV1 - fix, adding hexutil encoding on request parameters (#14314) * adding hexutil encoding on request parameters * fix for test * fixing more tests * deepsource fix --- beacon-chain/execution/mock_test.go | 40 +++++++++++++++----------- beacon-chain/execution/payload_body.go | 3 +- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/beacon-chain/execution/mock_test.go b/beacon-chain/execution/mock_test.go index a77c83ecc446..046ccaaa5255 100644 --- a/beacon-chain/execution/mock_test.go +++ b/beacon-chain/execution/mock_test.go @@ -84,11 +84,15 @@ func (s *mockEngine) callCount(method string) int { } func mockParseUintList(t *testing.T, data json.RawMessage) []uint64 { - var list []uint64 + var list []string if err := json.Unmarshal(data, &list); err != nil { t.Fatalf("failed to parse uint list: %v", err) } - return list + uints := make([]uint64, len(list)) + for i, u := range list { + uints[i] = hexutil.MustDecodeUint64(u) + } + return uints } func mockParseHexByteList(t *testing.T, data json.RawMessage) []hexutil.Bytes { @@ -117,7 +121,7 @@ func TestParseRequest(t *testing.T) { ctx := context.Background() cases := []struct { method string - uintArgs []uint64 + hexArgs []string // uint64 as hex byteArgs []hexutil.Bytes }{ { @@ -135,26 +139,28 @@ func TestParseRequest(t *testing.T) { }, }, { - method: GetPayloadBodiesByRangeV1, - uintArgs: []uint64{0, 1}, + method: GetPayloadBodiesByRangeV1, + hexArgs: []string{hexutil.EncodeUint64(0), hexutil.EncodeUint64(1)}, }, { - method: GetPayloadBodiesByRangeV2, - uintArgs: []uint64{math.MaxUint64, 1}, + method: GetPayloadBodiesByRangeV2, + hexArgs: []string{hexutil.EncodeUint64(math.MaxUint64), hexutil.EncodeUint64(1)}, }, } for _, c := range cases { t.Run(c.method, func(t *testing.T) { cli, srv := newMockEngine(t) - srv.register(c.method, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + srv.register(c.method, func(msg *jsonrpcMessage, w http.ResponseWriter, _ *http.Request) { require.Equal(t, c.method, msg.Method) nr := uint64(len(c.byteArgs)) if len(c.byteArgs) > 0 { require.DeepEqual(t, c.byteArgs, mockParseHexByteList(t, msg.Params)) } - if len(c.uintArgs) > 0 { + if len(c.hexArgs) > 0 { rang := mockParseUintList(t, msg.Params) - require.DeepEqual(t, c.uintArgs, rang) + for i, r := range rang { + require.Equal(t, c.hexArgs[i], hexutil.EncodeUint64(r)) + } nr = rang[1] } mockWriteResult(t, w, msg, make([]*pb.ExecutionPayloadBody, nr)) @@ -165,18 +171,18 @@ func TestParseRequest(t *testing.T) { if len(c.byteArgs) > 0 { args = []interface{}{c.byteArgs} } - if len(c.uintArgs) > 0 { - args = make([]interface{}, len(c.uintArgs)) - for i := range c.uintArgs { - args[i] = c.uintArgs[i] + if len(c.hexArgs) > 0 { + args = make([]interface{}, len(c.hexArgs)) + for i := range c.hexArgs { + args[i] = c.hexArgs[i] } } require.NoError(t, cli.CallContext(ctx, &result, c.method, args...)) if len(c.byteArgs) > 0 { require.Equal(t, len(c.byteArgs), len(result)) } - if len(c.uintArgs) > 0 { - require.Equal(t, int(c.uintArgs[1]), len(result)) + if len(c.hexArgs) > 0 { + require.Equal(t, int(hexutil.MustDecodeUint64(c.hexArgs[1])), len(result)) } }) } @@ -203,7 +209,7 @@ func TestCallCount(t *testing.T) { for _, c := range cases { t.Run(c.method, func(t *testing.T) { cli, srv := newMockEngine(t) - srv.register(c.method, func(msg *jsonrpcMessage, w http.ResponseWriter, r *http.Request) { + srv.register(c.method, func(msg *jsonrpcMessage, w http.ResponseWriter, _ *http.Request) { mockWriteResult(t, w, msg, nil) }) for i := 0; i < c.count; i++ { diff --git a/beacon-chain/execution/payload_body.go b/beacon-chain/execution/payload_body.go index 71e8f7473978..a895044319f4 100644 --- a/beacon-chain/execution/payload_body.go +++ b/beacon-chain/execution/payload_body.go @@ -5,6 +5,7 @@ import ( "sort" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -160,7 +161,7 @@ func computeRanges(hbns []hashBlockNumber) []byRangeReq { func (r *blindedBlockReconstructor) requestBodiesByRange(ctx context.Context, client RPCClient, method string, req byRangeReq) error { result := make([]*pb.ExecutionPayloadBody, 0) - if err := client.CallContext(ctx, &result, method, req.start, req.count); err != nil { + if err := client.CallContext(ctx, &result, method, hexutil.EncodeUint64(req.start), hexutil.EncodeUint64(req.count)); err != nil { return err } if uint64(len(result)) != req.count { From 102f94f91423f0a1256a22143c7ba123b3b44c02 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Wed, 7 Aug 2024 10:16:37 -0500 Subject: [PATCH 240/325] Clean up: Deduplicate fork spec tests pasta (#14289) * Deduplicate code in spectest operations Deduplicate code in blockchain core packages. * Deduplicate code in blockchain core packages. --- beacon-chain/core/blocks/exports_test.go | 2 + beacon-chain/core/blocks/payload.go | 76 +++---------- beacon-chain/core/blocks/payload_test.go | 44 ++++++-- .../transition/transition_no_verify_sig.go | 29 ++--- .../transition_no_verify_sig_test.go | 14 --- .../shared/altair/operations/BUILD.bazel | 12 +-- .../shared/altair/operations/attestation.go | 58 +++------- .../altair/operations/attester_slashing.go | 41 +++---- .../shared/altair/operations/block_header.go | 84 +-------------- .../shared/altair/operations/deposit.go | 40 +++---- .../shared/altair/operations/helpers.go | 85 ++------------- .../altair/operations/proposer_slashing.go | 41 +++---- .../altair/operations/sync_committee.go | 44 +++----- .../altair/operations/voluntary_exit.go | 40 +++---- .../shared/bellatrix/operations/BUILD.bazel | 12 +-- .../bellatrix/operations/attestation.go | 58 +++------- .../bellatrix/operations/attester_slashing.go | 41 +++---- .../bellatrix/operations/block_header.go | 84 +-------------- .../shared/bellatrix/operations/deposit.go | 40 +++---- .../bellatrix/operations/execution_payload.go | 92 +--------------- .../shared/bellatrix/operations/helpers.go | 89 +++------------- .../bellatrix/operations/proposer_slashing.go | 41 +++---- .../bellatrix/operations/sync_committee.go | 44 +++----- .../bellatrix/operations/voluntary_exit.go | 40 +++---- .../shared/capella/operations/BUILD.bazel | 13 +-- .../shared/capella/operations/attestation.go | 58 +++------- .../capella/operations/attester_slashing.go | 41 +++---- .../shared/capella/operations/block_header.go | 84 +-------------- .../operations/bls_to_execution_changes.go | 62 +++-------- .../shared/capella/operations/deposit.go | 40 +++---- .../capella/operations/execution_payload.go | 93 +--------------- .../shared/capella/operations/helpers.go | 89 +++------------- .../capella/operations/proposer_slashing.go | 41 +++---- .../capella/operations/sync_committee.go | 44 +++----- .../capella/operations/voluntary_exit.go | 40 +++---- .../shared/capella/operations/withdrawals.go | 51 +++------ .../shared/common/operations/BUILD.bazel | 46 ++++++++ .../shared/common/operations/attestation.go | 57 ++++++++++ .../common/operations/attester_slashing.go | 17 +++ .../shared/common/operations/block_header.go | 74 +++++++++++++ .../operations/bls_to_execution_changes.go | 57 ++++++++++ .../common/operations/consolidations.go | 43 ++++++++ .../shared/common/operations/deposit.go | 36 +++++++ .../common/operations/deposit_request.go | 38 +++++++ .../common/operations/execution_payload.go | 76 +++++++++++++ .../common/operations/proposer_slashing.go | 17 +++ .../shared/common/operations/slashing.go | 31 ++++++ .../common/operations/sync_aggregate.go | 45 ++++++++ .../shared/common/operations/test_runner.go | 83 +++++++++++++++ .../common/operations/voluntary_exit.go | 37 +++++++ .../common/operations/withdrawal_request.go | 42 ++++++++ .../shared/common/operations/withdrawals.go | 50 +++++++++ .../shared/deneb/operations/BUILD.bazel | 12 +-- .../shared/deneb/operations/attestation.go | 57 +++------- .../deneb/operations/attester_slashing.go | 40 +++---- .../shared/deneb/operations/block_header.go | 77 +------------- .../operations/bls_to_execution_changes.go | 62 +++-------- .../shared/deneb/operations/deposit.go | 39 +++---- .../deneb/operations/execution_payload.go | 98 +---------------- .../shared/deneb/operations/helpers.go | 86 +++------------ .../deneb/operations/proposer_slashing.go | 40 +++---- .../shared/deneb/operations/sync_committee.go | 43 +++----- .../shared/deneb/operations/voluntary_exit.go | 39 +++---- .../shared/deneb/operations/withdrawals.go | 50 +++------ .../shared/electra/operations/BUILD.bazel | 14 +-- .../shared/electra/operations/attestation.go | 58 +++------- .../electra/operations/attester_slashing.go | 40 +++---- .../shared/electra/operations/block_header.go | 80 +------------- .../operations/bls_to_execution_changes.go | 62 +++-------- .../electra/operations/consolidations.go | 52 +++------ .../shared/electra/operations/deposit.go | 39 +++---- .../electra/operations/deposit_request.go | 44 +++----- .../electra/operations/execution_payload.go | 100 +----------------- .../shared/electra/operations/helpers.go | 89 +++------------- .../electra/operations/proposer_slashing.go | 40 +++---- .../electra/operations/sync_committee.go | 43 +++----- .../electra/operations/voluntary_exit.go | 39 +++---- .../electra/operations/withdrawal_request.go | 50 +++------ .../shared/electra/operations/withdrawals.go | 50 +++------ .../shared/phase0/operations/BUILD.bazel | 12 +-- .../shared/phase0/operations/attestation.go | 59 +++-------- .../phase0/operations/attester_slashing.go | 42 +++----- .../shared/phase0/operations/block_header.go | 86 +-------------- .../shared/phase0/operations/deposit.go | 41 +++---- .../shared/phase0/operations/helpers.go | 85 ++------------- .../phase0/operations/proposer_slashing.go | 42 +++----- .../phase0/operations/voluntary_exit.go | 41 +++---- 87 files changed, 1529 insertions(+), 2878 deletions(-) create mode 100644 testing/spectest/shared/common/operations/BUILD.bazel create mode 100644 testing/spectest/shared/common/operations/attestation.go create mode 100644 testing/spectest/shared/common/operations/attester_slashing.go create mode 100644 testing/spectest/shared/common/operations/block_header.go create mode 100644 testing/spectest/shared/common/operations/bls_to_execution_changes.go create mode 100644 testing/spectest/shared/common/operations/consolidations.go create mode 100644 testing/spectest/shared/common/operations/deposit.go create mode 100644 testing/spectest/shared/common/operations/deposit_request.go create mode 100644 testing/spectest/shared/common/operations/execution_payload.go create mode 100644 testing/spectest/shared/common/operations/proposer_slashing.go create mode 100644 testing/spectest/shared/common/operations/slashing.go create mode 100644 testing/spectest/shared/common/operations/sync_aggregate.go create mode 100644 testing/spectest/shared/common/operations/test_runner.go create mode 100644 testing/spectest/shared/common/operations/voluntary_exit.go create mode 100644 testing/spectest/shared/common/operations/withdrawal_request.go create mode 100644 testing/spectest/shared/common/operations/withdrawals.go diff --git a/beacon-chain/core/blocks/exports_test.go b/beacon-chain/core/blocks/exports_test.go index 3d92819f3449..3508883b03bd 100644 --- a/beacon-chain/core/blocks/exports_test.go +++ b/beacon-chain/core/blocks/exports_test.go @@ -1,3 +1,5 @@ package blocks var ProcessBLSToExecutionChange = processBLSToExecutionChange + +var VerifyBlobCommitmentCount = verifyBlobCommitmentCount diff --git a/beacon-chain/core/blocks/payload.go b/beacon-chain/core/blocks/payload.go index 9529aa087bad..a7ffde06aa5f 100644 --- a/beacon-chain/core/blocks/payload.go +++ b/beacon-chain/core/blocks/payload.go @@ -2,11 +2,13 @@ package blocks import ( "bytes" + "fmt" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -200,13 +202,13 @@ func ValidatePayload(st state.BeaconState, payload interfaces.ExecutionData) err // block_hash=payload.block_hash, // transactions_root=hash_tree_root(payload.transactions), // ) -func ProcessPayload(st state.BeaconState, payload interfaces.ExecutionData) (state.BeaconState, error) { - var err error - if st.Version() >= version.Capella { - st, err = ProcessWithdrawals(st, payload) - if err != nil { - return nil, errors.Wrap(err, "could not process withdrawals") - } +func ProcessPayload(st state.BeaconState, body interfaces.ReadOnlyBeaconBlockBody) (state.BeaconState, error) { + payload, err := body.Execution() + if err != nil { + return nil, err + } + if err := verifyBlobCommitmentCount(body); err != nil { + return nil, err } if err := ValidatePayloadWhenMergeCompletes(st, payload); err != nil { return nil, err @@ -220,70 +222,20 @@ func ProcessPayload(st state.BeaconState, payload interfaces.ExecutionData) (sta return st, nil } -// ValidatePayloadHeaderWhenMergeCompletes validates the payload header when the merge completes. -func ValidatePayloadHeaderWhenMergeCompletes(st state.BeaconState, header interfaces.ExecutionData) error { - // Skip validation if the state is not merge compatible. - complete, err := IsMergeTransitionComplete(st) - if err != nil { - return err - } - if !complete { +func verifyBlobCommitmentCount(body interfaces.ReadOnlyBeaconBlockBody) error { + if body.Version() < version.Deneb { return nil } - // Validate current header's parent hash matches state header's block hash. - h, err := st.LatestExecutionPayloadHeader() - if err != nil { - return err - } - if !bytes.Equal(header.ParentHash(), h.BlockHash()) { - return ErrInvalidPayloadBlockHash - } - return nil -} - -// ValidatePayloadHeader validates the payload header. -func ValidatePayloadHeader(st state.BeaconState, header interfaces.ExecutionData) error { - // Validate header's random mix matches with state in current epoch - random, err := helpers.RandaoMix(st, time.CurrentEpoch(st)) - if err != nil { - return err - } - if !bytes.Equal(header.PrevRandao(), random) { - return ErrInvalidPayloadPrevRandao - } - - // Validate header's timestamp matches with state in current slot. - t, err := slots.ToTime(st.GenesisTime(), st.Slot()) + kzgs, err := body.BlobKzgCommitments() if err != nil { return err } - if header.Timestamp() != uint64(t.Unix()) { - return ErrInvalidPayloadTimeStamp + if len(kzgs) > field_params.MaxBlobsPerBlock { + return fmt.Errorf("too many kzg commitments in block: %d", len(kzgs)) } return nil } -// ProcessPayloadHeader processes the payload header. -func ProcessPayloadHeader(st state.BeaconState, header interfaces.ExecutionData) (state.BeaconState, error) { - var err error - if st.Version() >= version.Capella { - st, err = ProcessWithdrawals(st, header) - if err != nil { - return nil, errors.Wrap(err, "could not process withdrawals") - } - } - if err := ValidatePayloadHeaderWhenMergeCompletes(st, header); err != nil { - return nil, err - } - if err := ValidatePayloadHeader(st, header); err != nil { - return nil, err - } - if err := st.SetLatestExecutionPayloadHeader(header); err != nil { - return nil, err - } - return st, nil -} - // GetBlockPayloadHash returns the hash of the execution payload of the block func GetBlockPayloadHash(blk interfaces.ReadOnlyBeaconBlock) ([32]byte, error) { var payloadHash [32]byte diff --git a/beacon-chain/core/blocks/payload_test.go b/beacon-chain/core/blocks/payload_test.go index 0da3e9b523ff..20992c949aa2 100644 --- a/beacon-chain/core/blocks/payload_test.go +++ b/beacon-chain/core/blocks/payload_test.go @@ -1,6 +1,7 @@ package blocks_test import ( + "fmt" "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" @@ -13,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -581,14 +583,18 @@ func Test_ProcessPayload(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - wrappedPayload, err := consensusblocks.WrappedExecutionPayload(tt.payload) + body, err := consensusblocks.NewBeaconBlockBody(ðpb.BeaconBlockBodyBellatrix{ + ExecutionPayload: tt.payload, + }) require.NoError(t, err) - st, err := blocks.ProcessPayload(st, wrappedPayload) + st, err := blocks.ProcessPayload(st, body) if err != nil { require.Equal(t, tt.err.Error(), err.Error()) } else { require.Equal(t, tt.err, err) - want, err := consensusblocks.PayloadToHeader(wrappedPayload) + payload, err := body.Execution() + require.NoError(t, err) + want, err := consensusblocks.PayloadToHeader(payload) require.Equal(t, tt.err, err) h, err := st.LatestExecutionPayloadHeader() require.NoError(t, err) @@ -609,13 +615,15 @@ func Test_ProcessPayloadCapella(t *testing.T) { random, err := helpers.RandaoMix(st, time.CurrentEpoch(st)) require.NoError(t, err) payload.PrevRandao = random - wrapped, err := consensusblocks.WrappedExecutionPayloadCapella(payload) + body, err := consensusblocks.NewBeaconBlockBody(ðpb.BeaconBlockBodyCapella{ + ExecutionPayload: payload, + }) require.NoError(t, err) - _, err = blocks.ProcessPayload(st, wrapped) + _, err = blocks.ProcessPayload(st, body) require.NoError(t, err) } -func Test_ProcessPayloadHeader(t *testing.T) { +func Test_ProcessPayload_Blinded(t *testing.T) { st, _ := util.DeterministicGenesisStateBellatrix(t, 1) random, err := helpers.RandaoMix(st, time.CurrentEpoch(st)) require.NoError(t, err) @@ -663,7 +671,13 @@ func Test_ProcessPayloadHeader(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - st, err := blocks.ProcessPayloadHeader(st, tt.header) + p, ok := tt.header.Proto().(*enginev1.ExecutionPayloadHeader) + require.Equal(t, true, ok) + body, err := consensusblocks.NewBeaconBlockBody(ðpb.BlindedBeaconBlockBodyBellatrix{ + ExecutionPayloadHeader: p, + }) + require.NoError(t, err) + st, err := blocks.ProcessPayload(st, body) if err != nil { require.Equal(t, tt.err.Error(), err.Error()) } else { @@ -728,7 +742,7 @@ func Test_ValidatePayloadHeader(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err = blocks.ValidatePayloadHeader(st, tt.header) + err = blocks.ValidatePayload(st, tt.header) require.Equal(t, tt.err, err) }) } @@ -785,7 +799,7 @@ func Test_ValidatePayloadHeaderWhenMergeCompletes(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err = blocks.ValidatePayloadHeaderWhenMergeCompletes(tt.state, tt.header) + err = blocks.ValidatePayloadWhenMergeCompletes(tt.state, tt.header) require.Equal(t, tt.err, err) }) } @@ -906,3 +920,15 @@ func emptyPayloadCapella() *enginev1.ExecutionPayloadCapella { Withdrawals: make([]*enginev1.Withdrawal, 0), } } + +func TestVerifyBlobCommitmentCount(t *testing.T) { + b := ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{}} + rb, err := consensusblocks.NewBeaconBlock(b) + require.NoError(t, err) + require.NoError(t, blocks.VerifyBlobCommitmentCount(rb.Body())) + + b = ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{BlobKzgCommitments: make([][]byte, fieldparams.MaxBlobsPerBlock+1)}} + rb, err = consensusblocks.NewBeaconBlock(b) + require.NoError(t, err) + require.ErrorContains(t, fmt.Sprintf("too many kzg commitments in block: %d", fieldparams.MaxBlobsPerBlock+1), blocks.VerifyBlobCommitmentCount(rb.Body())) +} diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index 17bc3b7d435d..63dffe970822 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -12,7 +12,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition/interop" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" @@ -328,20 +327,18 @@ func ProcessBlockForStateRoot( if err != nil { return nil, err } - if blk.IsBlinded() { - state, err = b.ProcessPayloadHeader(state, executionData) - } else { - state, err = b.ProcessPayload(state, executionData) + if state.Version() >= version.Capella { + state, err = b.ProcessWithdrawals(state, executionData) + if err != nil { + return nil, errors.Wrap(err, "could not process withdrawals") + } } + state, err = b.ProcessPayload(state, blk.Body()) if err != nil { return nil, errors.Wrap(err, "could not process execution data") } } - if err := VerifyBlobCommitmentCount(blk); err != nil { - return nil, err - } - randaoReveal := signed.Block().Body().RandaoReveal() state, err = b.ProcessRandaoNoVerify(state, randaoReveal[:]) if err != nil { @@ -377,20 +374,6 @@ func ProcessBlockForStateRoot( return state, nil } -func VerifyBlobCommitmentCount(blk interfaces.ReadOnlyBeaconBlock) error { - if blk.Version() < version.Deneb { - return nil - } - kzgs, err := blk.Body().BlobKzgCommitments() - if err != nil { - return err - } - if len(kzgs) > field_params.MaxBlobsPerBlock { - return fmt.Errorf("too many kzg commitments in block: %d", len(kzgs)) - } - return nil -} - // This calls altair block operations. func altairOperations( ctx context.Context, diff --git a/beacon-chain/core/transition/transition_no_verify_sig_test.go b/beacon-chain/core/transition/transition_no_verify_sig_test.go index 5c5b786a2bb1..03472fd4a272 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig_test.go +++ b/beacon-chain/core/transition/transition_no_verify_sig_test.go @@ -2,13 +2,11 @@ package transition_test import ( "context" - "fmt" "testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" - field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -212,15 +210,3 @@ func TestProcessBlockDifferentVersion(t *testing.T) { _, _, err = transition.ProcessBlockNoVerifyAnySig(context.Background(), beaconState, wsb) require.ErrorContains(t, "state and block are different version. 0 != 1", err) } - -func TestVerifyBlobCommitmentCount(t *testing.T) { - b := ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{}} - rb, err := blocks.NewBeaconBlock(b) - require.NoError(t, err) - require.NoError(t, transition.VerifyBlobCommitmentCount(rb)) - - b = ðpb.BeaconBlockDeneb{Body: ðpb.BeaconBlockBodyDeneb{BlobKzgCommitments: make([][]byte, field_params.MaxBlobsPerBlock+1)}} - rb, err = blocks.NewBeaconBlock(b) - require.NoError(t, err) - require.ErrorContains(t, fmt.Sprintf("too many kzg commitments in block: %d", field_params.MaxBlobsPerBlock+1), transition.VerifyBlobCommitmentCount(rb)) -} diff --git a/testing/spectest/shared/altair/operations/BUILD.bazel b/testing/spectest/shared/altair/operations/BUILD.bazel index a668f22b8e56..05aeecc89e81 100644 --- a/testing/spectest/shared/altair/operations/BUILD.bazel +++ b/testing/spectest/shared/altair/operations/BUILD.bazel @@ -17,21 +17,13 @@ go_library( visibility = ["//testing/spectest:__subpackages__"], deps = [ "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/blocks:go_default_library", - "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/require:go_default_library", - "//testing/spectest/utils:go_default_library", + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/operations:go_default_library", "//testing/util:go_default_library", - "@com_github_golang_snappy//:go_default_library", - "@com_github_google_go_cmp//cmp:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/operations/attestation.go b/testing/spectest/shared/altair/operations/attestation.go index 2de911878881..efba6a2fdd67 100644 --- a/testing/spectest/shared/altair/operations/attestation.go +++ b/testing/spectest/shared/altair/operations/attestation.go @@ -1,59 +1,27 @@ package operations import ( - "context" - "errors" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttestationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/attestation/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/attestation/pyspec_tests") +func blockWithAttestation(attestationSSZ []byte) (interfaces.SignedBeaconBlock, error) { + att := ðpb.Attestation{} + if err := att.UnmarshalSSZ(attestationSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") - require.NoError(t, err) - attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) - require.NoError(t, err, "Failed to decompress") - att := ðpb.Attestation{} - require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyAltair{Attestations: []*ethpb.Attestation{att}} - processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err = altair.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) - if err != nil { - return nil, err - } - aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) - if err != nil { - return nil, err - } - verified, err := aSet.Verify() - if err != nil { - return nil, err - } - if !verified { - return nil, errors.New("could not batch verify attestation signature") - } - return st, nil - } + b := util.NewBeaconBlockAltair() + b.Block.Body = ðpb.BeaconBlockBodyAltair{Attestations: []*ethpb.Attestation{att}} + return blocks.NewSignedBeaconBlock(b) +} - RunBlockOperationTest(t, folderPath, body, processAtt) - }) - } +func RunAttestationTest(t *testing.T, config string) { + common.RunAttestationTest(t, config, version.String(version.Altair), blockWithAttestation, altair.ProcessAttestationsNoVerifySignature, sszToState) } diff --git a/testing/spectest/shared/altair/operations/attester_slashing.go b/testing/spectest/shared/altair/operations/attester_slashing.go index 93c9e2c5537f..f80832a7a104 100644 --- a/testing/spectest/shared/altair/operations/attester_slashing.go +++ b/testing/spectest/shared/altair/operations/attester_slashing.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttesterSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/attester_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/attester_slashing/pyspec_tests") +func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) { + as := ðpb.AttesterSlashing{} + if err := as.UnmarshalSSZ(asSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") - require.NoError(t, err) - attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) - require.NoError(t, err, "Failed to decompress") - attSlashing := ðpb.AttesterSlashing{} - require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockAltair() + b.Block.Body = ðpb.BeaconBlockBodyAltair{AttesterSlashings: []*ethpb.AttesterSlashing{as}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyAltair{AttesterSlashings: []*ethpb.AttesterSlashing{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) - }) - }) - } +func RunAttesterSlashingTest(t *testing.T, config string) { + common.RunAttesterSlashingTest(t, config, version.String(version.Altair), blockWithAttesterSlashing, sszToState) } diff --git a/testing/spectest/shared/altair/operations/block_header.go b/testing/spectest/shared/altair/operations/block_header.go index 103b6e33d3aa..f43176b9d0e6 100644 --- a/testing/spectest/shared/altair/operations/block_header.go +++ b/testing/spectest/shared/altair/operations/block_header.go @@ -1,90 +1,12 @@ package operations import ( - "context" - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunBlockHeaderTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/block_header/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/block_header/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockAltair{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateAltair{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoAltair(preBeaconStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. - bodyRoot, err := block.Body.HashTreeRoot() - require.NoError(t, err) - beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateAltair{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } + common.RunBlockHeaderTest(t, config, version.String(version.Altair), sszToBlock, sszToState) } diff --git a/testing/spectest/shared/altair/operations/deposit.go b/testing/spectest/shared/altair/operations/deposit.go index 7b18ef1ae3e1..fa9e101291d9 100644 --- a/testing/spectest/shared/altair/operations/deposit.go +++ b/testing/spectest/shared/altair/operations/deposit.go @@ -1,41 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunDepositTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/deposit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/deposit/pyspec_tests") +func blockWithDeposit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + d := ðpb.Deposit{} + if err := d.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") - require.NoError(t, err) - depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) - require.NoError(t, err, "Failed to decompress") - deposit := ðpb.Deposit{} - require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockAltair() + b.Block.Body = ðpb.BeaconBlockBodyAltair{Deposits: []*ethpb.Deposit{d}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyAltair{Deposits: []*ethpb.Deposit{deposit}} - processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return altair.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) - } - RunBlockOperationTest(t, folderPath, body, processDepositsFunc) - }) - } +func RunDepositTest(t *testing.T, config string) { + common.RunDepositTest(t, config, version.String(version.Altair), blockWithDeposit, altair.ProcessDeposits, sszToState) } diff --git a/testing/spectest/shared/altair/operations/helpers.go b/testing/spectest/shared/altair/operations/helpers.go index 188eb237e3b8..4312d2a366d6 100644 --- a/testing/spectest/shared/altair/operations/helpers.go +++ b/testing/spectest/shared/altair/operations/helpers.go @@ -1,88 +1,25 @@ package operations import ( - "context" - "os" - "path" - "strings" - "testing" - - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) - -// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the -// passed in block operation function and checks the post state with the expected post state. -func RunBlockOperationTest( - t *testing.T, - folderPath string, - body *ethpb.BeaconBlockBodyAltair, - operationFn blockOperation, -) { - preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preStateBase := ðpb.BeaconStateAltair{} - if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - preState, err := state_native.InitializeFromProtoAltair(preStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else if err != nil { - t.Fatal(err) +func sszToState(b []byte) (state.BeaconState, error) { + base := ðpb.BeaconStateAltair{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return state_native.InitializeFromProtoAltair(base) +} - helpers.ClearCache() - b := util.NewBeaconBlockAltair() - b.Block.Body = body - wsb, err := blocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - beaconState, err := operationFn(context.Background(), preState, wsb) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateAltair{} - if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return +func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) { + base := ðpb.BeaconBlockAltair{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockAltair{Block: base}) } diff --git a/testing/spectest/shared/altair/operations/proposer_slashing.go b/testing/spectest/shared/altair/operations/proposer_slashing.go index 29af6d0a0d77..99b9be588aa9 100644 --- a/testing/spectest/shared/altair/operations/proposer_slashing.go +++ b/testing/spectest/shared/altair/operations/proposer_slashing.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunProposerSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/proposer_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/proposer_slashing/pyspec_tests") +func blockWithProposerSlashing(ssz []byte) (interfaces.SignedBeaconBlock, error) { + ps := ðpb.ProposerSlashing{} + if err := ps.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") - require.NoError(t, err) - proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) - require.NoError(t, err, "Failed to decompress") - proposerSlashing := ðpb.ProposerSlashing{} - require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockAltair() + b.Block.Body = ðpb.BeaconBlockBodyAltair{ProposerSlashings: []*ethpb.ProposerSlashing{ps}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyAltair{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) - }) - }) - } +func RunProposerSlashingTest(t *testing.T, config string) { + common.RunProposerSlashingTest(t, config, version.String(version.Altair), blockWithProposerSlashing, sszToState) } diff --git a/testing/spectest/shared/altair/operations/sync_committee.go b/testing/spectest/shared/altair/operations/sync_committee.go index 173a8aea7665..2ef08cecb12b 100644 --- a/testing/spectest/shared/altair/operations/sync_committee.go +++ b/testing/spectest/shared/altair/operations/sync_committee.go @@ -1,44 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunSyncCommitteeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/sync_aggregate/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/sync_aggregate/pyspec_tests") +func blockWithSyncAggregate(ssz []byte) (interfaces.SignedBeaconBlock, error) { + sa := ðpb.SyncAggregate{} + if err := sa.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - syncCommitteeFile, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") - require.NoError(t, err) - syncCommitteeSSZ, err := snappy.Decode(nil /* dst */, syncCommitteeFile) - require.NoError(t, err, "Failed to decompress") - sc := ðpb.SyncAggregate{} - require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockAltair() + b.Block.Body = ðpb.BeaconBlockBodyAltair{SyncAggregate: sa} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyAltair{SyncAggregate: sc} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, _, err := altair.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) - if err != nil { - return nil, err - } - return st, nil - }) - }) - } +func RunSyncCommitteeTest(t *testing.T, config string) { + common.RunSyncCommitteeTest(t, config, version.String(version.Altair), blockWithSyncAggregate, sszToState) } diff --git a/testing/spectest/shared/altair/operations/voluntary_exit.go b/testing/spectest/shared/altair/operations/voluntary_exit.go index 5e1bbf919d8a..f602930683b6 100644 --- a/testing/spectest/shared/altair/operations/voluntary_exit.go +++ b/testing/spectest/shared/altair/operations/voluntary_exit.go @@ -1,40 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunVoluntaryExitTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "operations/voluntary_exit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "altair", "operations/voluntary_exit/pyspec_tests") +func blockWithVoluntaryExit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := ðpb.SignedVoluntaryExit{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") - require.NoError(t, err) - exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) - require.NoError(t, err, "Failed to decompress") - voluntaryExit := ðpb.SignedVoluntaryExit{} - require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockAltair() + b.Block.Body = ðpb.BeaconBlockBodyAltair{VoluntaryExits: []*ethpb.SignedVoluntaryExit{e}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyAltair{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) - }) - }) - } +func RunVoluntaryExitTest(t *testing.T, config string) { + common.RunVoluntaryExitTest(t, config, version.String(version.Altair), blockWithVoluntaryExit, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/BUILD.bazel b/testing/spectest/shared/bellatrix/operations/BUILD.bazel index 3e5b2027dc0c..8ab888a3ddd3 100644 --- a/testing/spectest/shared/bellatrix/operations/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/operations/BUILD.bazel @@ -18,21 +18,13 @@ go_library( visibility = ["//testing/spectest:__subpackages__"], deps = [ "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/blocks:go_default_library", - "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/require:go_default_library", - "//testing/spectest/utils:go_default_library", + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/operations:go_default_library", "//testing/util:go_default_library", - "@com_github_golang_snappy//:go_default_library", - "@com_github_google_go_cmp//cmp:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/operations/attestation.go b/testing/spectest/shared/bellatrix/operations/attestation.go index 2839bf38b7f9..0a2f88093e70 100644 --- a/testing/spectest/shared/bellatrix/operations/attestation.go +++ b/testing/spectest/shared/bellatrix/operations/attestation.go @@ -1,59 +1,27 @@ package operations import ( - "context" - "errors" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttestationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/attestation/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/attestation/pyspec_tests") +func blockWithAttestation(attestationSSZ []byte) (interfaces.SignedBeaconBlock, error) { + att := ðpb.Attestation{} + if err := att.UnmarshalSSZ(attestationSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") - require.NoError(t, err) - attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) - require.NoError(t, err, "Failed to decompress") - att := ðpb.Attestation{} - require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyBellatrix{Attestations: []*ethpb.Attestation{att}} - processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err = altair.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) - if err != nil { - return nil, err - } - aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) - if err != nil { - return nil, err - } - verified, err := aSet.Verify() - if err != nil { - return nil, err - } - if !verified { - return nil, errors.New("could not batch verify attestation signature") - } - return st, nil - } + b := util.NewBeaconBlockBellatrix() + b.Block.Body = ðpb.BeaconBlockBodyBellatrix{Attestations: []*ethpb.Attestation{att}} + return blocks.NewSignedBeaconBlock(b) +} - RunBlockOperationTest(t, folderPath, body, processAtt) - }) - } +func RunAttestationTest(t *testing.T, config string) { + common.RunAttestationTest(t, config, version.String(version.Bellatrix), blockWithAttestation, altair.ProcessAttestationsNoVerifySignature, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/attester_slashing.go b/testing/spectest/shared/bellatrix/operations/attester_slashing.go index 76d61b0021e5..ef6c7e81017a 100644 --- a/testing/spectest/shared/bellatrix/operations/attester_slashing.go +++ b/testing/spectest/shared/bellatrix/operations/attester_slashing.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttesterSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/attester_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/attester_slashing/pyspec_tests") +func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) { + as := ðpb.AttesterSlashing{} + if err := as.UnmarshalSSZ(asSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") - require.NoError(t, err) - attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) - require.NoError(t, err, "Failed to decompress") - attSlashing := ðpb.AttesterSlashing{} - require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockBellatrix() + b.Block.Body = ðpb.BeaconBlockBodyBellatrix{AttesterSlashings: []*ethpb.AttesterSlashing{as}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyBellatrix{AttesterSlashings: []*ethpb.AttesterSlashing{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) - }) - }) - } +func RunAttesterSlashingTest(t *testing.T, config string) { + common.RunAttesterSlashingTest(t, config, version.String(version.Bellatrix), blockWithAttesterSlashing, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/block_header.go b/testing/spectest/shared/bellatrix/operations/block_header.go index 51d911bedabb..ae06b1f4e51b 100644 --- a/testing/spectest/shared/bellatrix/operations/block_header.go +++ b/testing/spectest/shared/bellatrix/operations/block_header.go @@ -1,90 +1,12 @@ package operations import ( - "context" - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunBlockHeaderTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/block_header/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/block_header/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockBellatrix{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateBellatrix{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoBellatrix(preBeaconStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. - bodyRoot, err := block.Body.HashTreeRoot() - require.NoError(t, err) - beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateBellatrix{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } + common.RunBlockHeaderTest(t, config, version.String(version.Bellatrix), sszToBlock, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/deposit.go b/testing/spectest/shared/bellatrix/operations/deposit.go index ac1b807cc28b..55ef0c904918 100644 --- a/testing/spectest/shared/bellatrix/operations/deposit.go +++ b/testing/spectest/shared/bellatrix/operations/deposit.go @@ -1,41 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunDepositTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/deposit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/deposit/pyspec_tests") +func blockWithDeposit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + d := ðpb.Deposit{} + if err := d.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") - require.NoError(t, err) - depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) - require.NoError(t, err, "Failed to decompress") - deposit := ðpb.Deposit{} - require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockBellatrix() + b.Block.Body = ðpb.BeaconBlockBodyBellatrix{Deposits: []*ethpb.Deposit{d}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyBellatrix{Deposits: []*ethpb.Deposit{deposit}} - processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return altair.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) - } - RunBlockOperationTest(t, folderPath, body, processDepositsFunc) - }) - } +func RunDepositTest(t *testing.T, config string) { + common.RunDepositTest(t, config, version.String(version.Bellatrix), blockWithDeposit, altair.ProcessDeposits, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/execution_payload.go b/testing/spectest/shared/bellatrix/operations/execution_payload.go index 233e57175752..4283f9d256e0 100644 --- a/testing/spectest/shared/bellatrix/operations/execution_payload.go +++ b/testing/spectest/shared/bellatrix/operations/execution_payload.go @@ -1,98 +1,12 @@ package operations import ( - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - blocks2 "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunExecutionPayloadTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/execution_payload/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/execution_payload/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockBodyFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "body.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockBodyFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockBodyBellatrix{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateBellatrix{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoBellatrix(preBeaconStateBase) - require.NoError(t, err) - - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - payload, err := blocks2.WrappedExecutionPayload(block.ExecutionPayload) - require.NoError(t, err) - - file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") - require.NoError(t, err) - config := &ExecutionConfig{} - require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") - - gotState, err := blocks.ProcessPayload(preBeaconState, payload) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateBellatrix{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateBellatrix(gotState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else if config.Valid { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } -} - -type ExecutionConfig struct { - Valid bool `json:"execution_valid"` + common.RunExecutionPayloadTest(t, config, version.String(version.Bellatrix), sszToBlockBody, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/helpers.go b/testing/spectest/shared/bellatrix/operations/helpers.go index c234c6d0f7e9..b1b4d3cb3f93 100644 --- a/testing/spectest/shared/bellatrix/operations/helpers.go +++ b/testing/spectest/shared/bellatrix/operations/helpers.go @@ -1,88 +1,33 @@ package operations import ( - "context" - "os" - "path" - "strings" - "testing" - - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) - -// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the -// passed in block operation function and checks the post state with the expected post state. -func RunBlockOperationTest( - t *testing.T, - folderPath string, - body *ethpb.BeaconBlockBodyBellatrix, - operationFn blockOperation, -) { - preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preStateBase := ðpb.BeaconStateBellatrix{} - if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) +func sszToState(b []byte) (state.BeaconState, error) { + base := ðpb.BeaconStateBellatrix{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } - preState, err := state_native.InitializeFromProtoBellatrix(preStateBase) - require.NoError(t, err) + return state_native.InitializeFromProtoBellatrix(base) +} - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else if err != nil { - t.Fatal(err) +func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) { + base := ðpb.BeaconBlockBellatrix{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockBellatrix{Block: base}) +} - helpers.ClearCache() - b := util.NewBeaconBlockBellatrix() - b.Block.Body = body - wsb, err := blocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - beaconState, err := operationFn(context.Background(), preState, wsb) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateBellatrix{} - if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return +func sszToBlockBody(b []byte) (interfaces.ReadOnlyBeaconBlockBody, error) { + base := ðpb.BeaconBlockBodyBellatrix{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewBeaconBlockBody(base) } diff --git a/testing/spectest/shared/bellatrix/operations/proposer_slashing.go b/testing/spectest/shared/bellatrix/operations/proposer_slashing.go index 39631c054273..3f0bfa2d75b3 100644 --- a/testing/spectest/shared/bellatrix/operations/proposer_slashing.go +++ b/testing/spectest/shared/bellatrix/operations/proposer_slashing.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunProposerSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/proposer_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/proposer_slashing/pyspec_tests") +func blockWithProposerSlashing(ssz []byte) (interfaces.SignedBeaconBlock, error) { + ps := ðpb.ProposerSlashing{} + if err := ps.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") - require.NoError(t, err) - proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) - require.NoError(t, err, "Failed to decompress") - proposerSlashing := ðpb.ProposerSlashing{} - require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockBellatrix() + b.Block.Body = ðpb.BeaconBlockBodyBellatrix{ProposerSlashings: []*ethpb.ProposerSlashing{ps}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyBellatrix{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) - }) - }) - } +func RunProposerSlashingTest(t *testing.T, config string) { + common.RunProposerSlashingTest(t, config, version.String(version.Bellatrix), blockWithProposerSlashing, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/sync_committee.go b/testing/spectest/shared/bellatrix/operations/sync_committee.go index 431e0bd98731..f74db78539a7 100644 --- a/testing/spectest/shared/bellatrix/operations/sync_committee.go +++ b/testing/spectest/shared/bellatrix/operations/sync_committee.go @@ -1,44 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunSyncCommitteeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/sync_aggregate/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/sync_aggregate/pyspec_tests") +func blockWithSyncAggregate(ssz []byte) (interfaces.SignedBeaconBlock, error) { + sa := ðpb.SyncAggregate{} + if err := sa.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - syncCommitteeFile, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") - require.NoError(t, err) - syncCommitteeSSZ, err := snappy.Decode(nil /* dst */, syncCommitteeFile) - require.NoError(t, err, "Failed to decompress") - sc := ðpb.SyncAggregate{} - require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockBellatrix() + b.Block.Body = ðpb.BeaconBlockBodyBellatrix{SyncAggregate: sa} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyBellatrix{SyncAggregate: sc} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, _, err := altair.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) - if err != nil { - return nil, err - } - return st, nil - }) - }) - } +func RunSyncCommitteeTest(t *testing.T, config string) { + common.RunSyncCommitteeTest(t, config, version.String(version.Bellatrix), blockWithSyncAggregate, sszToState) } diff --git a/testing/spectest/shared/bellatrix/operations/voluntary_exit.go b/testing/spectest/shared/bellatrix/operations/voluntary_exit.go index 6c07aa7e725d..330a4fb05217 100644 --- a/testing/spectest/shared/bellatrix/operations/voluntary_exit.go +++ b/testing/spectest/shared/bellatrix/operations/voluntary_exit.go @@ -1,40 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunVoluntaryExitTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "bellatrix", "operations/voluntary_exit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "bellatrix", "operations/voluntary_exit/pyspec_tests") +func blockWithVoluntaryExit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := ðpb.SignedVoluntaryExit{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") - require.NoError(t, err) - exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) - require.NoError(t, err, "Failed to decompress") - voluntaryExit := ðpb.SignedVoluntaryExit{} - require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockBellatrix() + b.Block.Body = ðpb.BeaconBlockBodyBellatrix{VoluntaryExits: []*ethpb.SignedVoluntaryExit{e}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyBellatrix{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) - }) - }) - } +func RunVoluntaryExitTest(t *testing.T, config string) { + common.RunVoluntaryExitTest(t, config, version.String(version.Bellatrix), blockWithVoluntaryExit, sszToState) } diff --git a/testing/spectest/shared/capella/operations/BUILD.bazel b/testing/spectest/shared/capella/operations/BUILD.bazel index f3c6b5fbe260..95c7369130f0 100644 --- a/testing/spectest/shared/capella/operations/BUILD.bazel +++ b/testing/spectest/shared/capella/operations/BUILD.bazel @@ -20,23 +20,14 @@ go_library( visibility = ["//testing/spectest:__subpackages__"], deps = [ "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/blocks:go_default_library", - "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/require:go_default_library", - "//testing/spectest/utils:go_default_library", + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/operations:go_default_library", "//testing/util:go_default_library", - "@com_github_golang_snappy//:go_default_library", - "@com_github_google_go_cmp//cmp:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/operations/attestation.go b/testing/spectest/shared/capella/operations/attestation.go index c23cda82aa39..d649070a8290 100644 --- a/testing/spectest/shared/capella/operations/attestation.go +++ b/testing/spectest/shared/capella/operations/attestation.go @@ -1,59 +1,27 @@ package operations import ( - "context" - "errors" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttestationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/attestation/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/attestation/pyspec_tests") +func blockWithAttestation(attestationSSZ []byte) (interfaces.SignedBeaconBlock, error) { + att := ðpb.Attestation{} + if err := att.UnmarshalSSZ(attestationSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") - require.NoError(t, err) - attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) - require.NoError(t, err, "Failed to decompress") - att := ðpb.Attestation{} - require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyCapella{Attestations: []*ethpb.Attestation{att}} - processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err = altair.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) - if err != nil { - return nil, err - } - aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) - if err != nil { - return nil, err - } - verified, err := aSet.Verify() - if err != nil { - return nil, err - } - if !verified { - return nil, errors.New("could not batch verify attestation signature") - } - return st, nil - } + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{Attestations: []*ethpb.Attestation{att}} + return blocks.NewSignedBeaconBlock(b) +} - RunBlockOperationTest(t, folderPath, body, processAtt) - }) - } +func RunAttestationTest(t *testing.T, config string) { + common.RunAttestationTest(t, config, version.String(version.Capella), blockWithAttestation, altair.ProcessAttestationsNoVerifySignature, sszToState) } diff --git a/testing/spectest/shared/capella/operations/attester_slashing.go b/testing/spectest/shared/capella/operations/attester_slashing.go index 47909240dd7e..c7b035e07144 100644 --- a/testing/spectest/shared/capella/operations/attester_slashing.go +++ b/testing/spectest/shared/capella/operations/attester_slashing.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttesterSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/attester_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/attester_slashing/pyspec_tests") +func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) { + as := ðpb.AttesterSlashing{} + if err := as.UnmarshalSSZ(asSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") - require.NoError(t, err) - attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) - require.NoError(t, err, "Failed to decompress") - attSlashing := ðpb.AttesterSlashing{} - require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{AttesterSlashings: []*ethpb.AttesterSlashing{as}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{AttesterSlashings: []*ethpb.AttesterSlashing{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) - }) - }) - } +func RunAttesterSlashingTest(t *testing.T, config string) { + common.RunAttesterSlashingTest(t, config, version.String(version.Capella), blockWithAttesterSlashing, sszToState) } diff --git a/testing/spectest/shared/capella/operations/block_header.go b/testing/spectest/shared/capella/operations/block_header.go index 1ca2ff80d6da..328ae6526589 100644 --- a/testing/spectest/shared/capella/operations/block_header.go +++ b/testing/spectest/shared/capella/operations/block_header.go @@ -1,90 +1,12 @@ package operations import ( - "context" - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunBlockHeaderTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/block_header/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/block_header/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockCapella{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateCapella{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoCapella(preBeaconStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. - bodyRoot, err := block.Body.HashTreeRoot() - require.NoError(t, err) - beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateCapella{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } + common.RunBlockHeaderTest(t, config, version.String(version.Capella), sszToBlock, sszToState) } diff --git a/testing/spectest/shared/capella/operations/bls_to_execution_changes.go b/testing/spectest/shared/capella/operations/bls_to_execution_changes.go index 1a41a6ca7d77..6fa289bfc98a 100644 --- a/testing/spectest/shared/capella/operations/bls_to_execution_changes.go +++ b/testing/spectest/shared/capella/operations/bls_to_execution_changes.go @@ -1,62 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunBLSToExecutionChangeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/bls_to_execution_change/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/bls_to_execution_change/pyspec_tests") +func blockWithBlsChange(ssz []byte) (interfaces.SignedBeaconBlock, error) { + c := ðpb.SignedBLSToExecutionChange{} + if err := c.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - changeFile, err := util.BazelFileBytes(folderPath, "address_change.ssz_snappy") - require.NoError(t, err) - changeSSZ, err := snappy.Decode(nil /* dst */, changeFile) - require.NoError(t, err, "Failed to decompress") - change := ðpb.SignedBLSToExecutionChange{} - require.NoError(t, change.UnmarshalSSZ(changeSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{c}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{ - BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{change}, - } - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err := blocks.ProcessBLSToExecutionChanges(s, b.Block()) - if err != nil { - return nil, err - } - changes, err := b.Block().Body().BLSToExecutionChanges() - if err != nil { - return nil, err - } - cSet, err := blocks.BLSChangesSignatureBatch(st, changes) - if err != nil { - return nil, err - } - ok, err := cSet.Verify() - if err != nil { - return nil, err - } - if !ok { - return nil, errors.New("signature did not verify") - } - return st, nil - }) - }) - } +func RunBLSToExecutionChangeTest(t *testing.T, config string) { + common.RunBLSToExecutionChangeTest(t, config, version.String(version.Capella), blockWithBlsChange, sszToState) } diff --git a/testing/spectest/shared/capella/operations/deposit.go b/testing/spectest/shared/capella/operations/deposit.go index 59c384bd4762..09320013b58e 100644 --- a/testing/spectest/shared/capella/operations/deposit.go +++ b/testing/spectest/shared/capella/operations/deposit.go @@ -1,41 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunDepositTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/deposit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/deposit/pyspec_tests") +func blockWithDeposit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + d := ðpb.Deposit{} + if err := d.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") - require.NoError(t, err) - depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) - require.NoError(t, err, "Failed to decompress") - deposit := ðpb.Deposit{} - require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{Deposits: []*ethpb.Deposit{d}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{Deposits: []*ethpb.Deposit{deposit}} - processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return altair.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) - } - RunBlockOperationTest(t, folderPath, body, processDepositsFunc) - }) - } +func RunDepositTest(t *testing.T, config string) { + common.RunDepositTest(t, config, version.String(version.Capella), blockWithDeposit, altair.ProcessDeposits, sszToState) } diff --git a/testing/spectest/shared/capella/operations/execution_payload.go b/testing/spectest/shared/capella/operations/execution_payload.go index 453c265110fc..470e70531bc3 100644 --- a/testing/spectest/shared/capella/operations/execution_payload.go +++ b/testing/spectest/shared/capella/operations/execution_payload.go @@ -1,99 +1,12 @@ package operations import ( - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - blocks2 "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunExecutionPayloadTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/execution_payload/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/execution_payload/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockBodyFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "body.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockBodyFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockBodyCapella{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateCapella{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoCapella(preBeaconStateBase) - require.NoError(t, err) - - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - payload, err := blocks2.WrappedExecutionPayloadCapella(block.ExecutionPayload) - require.NoError(t, err) - - file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") - require.NoError(t, err) - config := &ExecutionConfig{} - require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") - - if postSSZExists { - require.NoError(t, blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload)) - require.NoError(t, blocks.ValidatePayload(preBeaconState, payload)) - require.NoError(t, preBeaconState.SetLatestExecutionPayloadHeader(payload)) - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateCapella{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateCapella(preBeaconState.ToProto()) - require.NoError(t, err) - t.Log(pbState) - t.Log(postBeaconState) - if !proto.Equal(pbState, postBeaconState) { - t.Fatal("Post state does not match expected") - } - } else if config.Valid { - err1 := blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload) - err2 := blocks.ValidatePayload(preBeaconState, payload) - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err1 == nil && err2 == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } -} - -type ExecutionConfig struct { - Valid bool `json:"execution_valid"` + common.RunExecutionPayloadTest(t, config, version.String(version.Capella), sszToBlockBody, sszToState) } diff --git a/testing/spectest/shared/capella/operations/helpers.go b/testing/spectest/shared/capella/operations/helpers.go index 918fd6c86b57..0f11f910c1ca 100644 --- a/testing/spectest/shared/capella/operations/helpers.go +++ b/testing/spectest/shared/capella/operations/helpers.go @@ -1,88 +1,33 @@ package operations import ( - "context" - "os" - "path" - "strings" - "testing" - - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) - -// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the -// passed in block operation function and checks the post state with the expected post state. -func RunBlockOperationTest( - t *testing.T, - folderPath string, - body *ethpb.BeaconBlockBodyCapella, - operationFn blockOperation, -) { - preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preStateBase := ðpb.BeaconStateCapella{} - if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) +func sszToState(b []byte) (state.BeaconState, error) { + base := ðpb.BeaconStateCapella{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } - preState, err := state_native.InitializeFromProtoCapella(preStateBase) - require.NoError(t, err) + return state_native.InitializeFromProtoCapella(base) +} - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else if err != nil { - t.Fatal(err) +func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) { + base := ðpb.BeaconBlockCapella{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockCapella{Block: base}) +} - helpers.ClearCache() - b := util.NewBeaconBlockCapella() - b.Block.Body = body - wsb, err := blocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - beaconState, err := operationFn(context.Background(), preState, wsb) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateCapella{} - if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return +func sszToBlockBody(b []byte) (interfaces.ReadOnlyBeaconBlockBody, error) { + base := ðpb.BeaconBlockBodyCapella{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewBeaconBlockBody(base) } diff --git a/testing/spectest/shared/capella/operations/proposer_slashing.go b/testing/spectest/shared/capella/operations/proposer_slashing.go index 908a7eaa8ead..793065455b22 100644 --- a/testing/spectest/shared/capella/operations/proposer_slashing.go +++ b/testing/spectest/shared/capella/operations/proposer_slashing.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunProposerSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/proposer_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/proposer_slashing/pyspec_tests") +func blockWithProposerSlashing(ssz []byte) (interfaces.SignedBeaconBlock, error) { + ps := ðpb.ProposerSlashing{} + if err := ps.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") - require.NoError(t, err) - proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) - require.NoError(t, err, "Failed to decompress") - proposerSlashing := ðpb.ProposerSlashing{} - require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{ProposerSlashings: []*ethpb.ProposerSlashing{ps}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) - }) - }) - } +func RunProposerSlashingTest(t *testing.T, config string) { + common.RunProposerSlashingTest(t, config, version.String(version.Capella), blockWithProposerSlashing, sszToState) } diff --git a/testing/spectest/shared/capella/operations/sync_committee.go b/testing/spectest/shared/capella/operations/sync_committee.go index 27c1ea66a029..e95c86723cba 100644 --- a/testing/spectest/shared/capella/operations/sync_committee.go +++ b/testing/spectest/shared/capella/operations/sync_committee.go @@ -1,44 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunSyncCommitteeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/sync_aggregate/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/sync_aggregate/pyspec_tests") +func blockWithSyncAggregate(ssz []byte) (interfaces.SignedBeaconBlock, error) { + sa := ðpb.SyncAggregate{} + if err := sa.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - syncCommitteeFile, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") - require.NoError(t, err) - syncCommitteeSSZ, err := snappy.Decode(nil /* dst */, syncCommitteeFile) - require.NoError(t, err, "Failed to decompress") - sc := ðpb.SyncAggregate{} - require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{SyncAggregate: sa} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{SyncAggregate: sc} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, _, err := altair.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) - if err != nil { - return nil, err - } - return st, nil - }) - }) - } +func RunSyncCommitteeTest(t *testing.T, config string) { + common.RunSyncCommitteeTest(t, config, version.String(version.Capella), blockWithSyncAggregate, sszToState) } diff --git a/testing/spectest/shared/capella/operations/voluntary_exit.go b/testing/spectest/shared/capella/operations/voluntary_exit.go index c133725c8510..6be69ab56749 100644 --- a/testing/spectest/shared/capella/operations/voluntary_exit.go +++ b/testing/spectest/shared/capella/operations/voluntary_exit.go @@ -1,40 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunVoluntaryExitTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/voluntary_exit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/voluntary_exit/pyspec_tests") +func blockWithVoluntaryExit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := ðpb.SignedVoluntaryExit{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") - require.NoError(t, err) - exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) - require.NoError(t, err, "Failed to decompress") - voluntaryExit := ðpb.SignedVoluntaryExit{} - require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{VoluntaryExits: []*ethpb.SignedVoluntaryExit{e}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) - }) - }) - } +func RunVoluntaryExitTest(t *testing.T, config string) { + common.RunVoluntaryExitTest(t, config, version.String(version.Capella), blockWithVoluntaryExit, sszToState) } diff --git a/testing/spectest/shared/capella/operations/withdrawals.go b/testing/spectest/shared/capella/operations/withdrawals.go index edfb56a8ea61..886739f6e3df 100644 --- a/testing/spectest/shared/capella/operations/withdrawals.go +++ b/testing/spectest/shared/capella/operations/withdrawals.go @@ -1,52 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunWithdrawalsTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "capella", "operations/withdrawals/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "capella", "operations/withdrawals/pyspec_tests") +func blockWithWithdrawals(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := &enginev1.ExecutionPayloadCapella{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - payloadFile, err := util.BazelFileBytes(folderPath, "execution_payload.ssz_snappy") - require.NoError(t, err) - payloadSSZ, err := snappy.Decode(nil /* dst */, payloadFile) - require.NoError(t, err, "Failed to decompress") - payload := &enginev1.ExecutionPayloadCapella{} - require.NoError(t, payload.UnmarshalSSZ(payloadSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockCapella() + b.Block.Body = ðpb.BeaconBlockBodyCapella{ExecutionPayload: e} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyCapella{ExecutionPayload: payload} - RunBlockOperationTest(t, folderPath, body, func(_ context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - payload, err := b.Block().Body().Execution() - if err != nil { - return nil, err - } - withdrawals, err := payload.Withdrawals() - if err != nil { - return nil, err - } - p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: withdrawals}) - require.NoError(t, err) - return blocks.ProcessWithdrawals(s, p) - }) - }) - } +func RunWithdrawalsTest(t *testing.T, config string) { + common.RunWithdrawalsTest(t, config, version.String(version.Capella), blockWithWithdrawals, sszToState) } diff --git a/testing/spectest/shared/common/operations/BUILD.bazel b/testing/spectest/shared/common/operations/BUILD.bazel new file mode 100644 index 000000000000..07b46dee0a20 --- /dev/null +++ b/testing/spectest/shared/common/operations/BUILD.bazel @@ -0,0 +1,46 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = [ + "attestation.go", + "attester_slashing.go", + "block_header.go", + "bls_to_execution_changes.go", + "consolidations.go", + "deposit.go", + "deposit_request.go", + "execution_payload.go", + "proposer_slashing.go", + "slashing.go", + "sync_aggregate.go", + "test_runner.go", + "voluntary_exit.go", + "withdrawal_request.go", + "withdrawals.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/core/altair:go_default_library", + "//beacon-chain/core/blocks:go_default_library", + "//beacon-chain/core/electra:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/validators:go_default_library", + "//beacon-chain/state:go_default_library", + "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", + "//proto/engine/v1:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/utils:go_default_library", + "//testing/util:go_default_library", + "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", + "@com_github_pkg_errors//:go_default_library", + "@io_bazel_rules_go//go/tools/bazel:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", + ], +) diff --git a/testing/spectest/shared/common/operations/attestation.go b/testing/spectest/shared/common/operations/attestation.go new file mode 100644 index 000000000000..f2dac069337a --- /dev/null +++ b/testing/spectest/shared/common/operations/attestation.go @@ -0,0 +1,57 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/pkg/errors" + b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +// RunAttestationTest executes "operations/attestation" tests. +func RunAttestationTest(t *testing.T, config string, fork string, blockWithAttestation blockWithSSZObject, processBlock ProcessBlock, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/attestation/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/attestation/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") + require.NoError(t, err) + attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) + require.NoError(t, err, "Failed to decompress") + blk, err := blockWithAttestation(attestationSSZ) + require.NoError(t, err) + + processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + st, err = processBlock(ctx, st, blk.Block()) + if err != nil { + return nil, err + } + aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) + if err != nil { + return nil, err + } + verified, err := aSet.Verify() + if err != nil { + return nil, err + } + if !verified { + return nil, errors.New("could not batch verify attestation signature") + } + return st, nil + } + + RunBlockOperationTest(t, folderPath, blk, sszToState, processAtt) + }) + } +} diff --git a/testing/spectest/shared/common/operations/attester_slashing.go b/testing/spectest/shared/common/operations/attester_slashing.go new file mode 100644 index 000000000000..85f2aabc4e35 --- /dev/null +++ b/testing/spectest/shared/common/operations/attester_slashing.go @@ -0,0 +1,17 @@ +package operations + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" +) + +func RunAttesterSlashingTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + runSlashingTest(t, config, fork, "attester_slashing", block, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), v.SlashValidator) + }) +} diff --git a/testing/spectest/shared/common/operations/block_header.go b/testing/spectest/shared/common/operations/block_header.go new file mode 100644 index 000000000000..d38221535aff --- /dev/null +++ b/testing/spectest/shared/common/operations/block_header.go @@ -0,0 +1,74 @@ +package operations + +import ( + "context" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +type SSZToBlock func([]byte) (interfaces.SignedBeaconBlock, error) + +func RunBlockHeaderTest(t *testing.T, config string, fork string, sszToBlock SSZToBlock, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/block_header/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/block_header/pyspec_tests") + } + + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + + blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") + require.NoError(t, err) + blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) + require.NoError(t, err, "Failed to decompress") + block, err := sszToBlock(blockSSZ) + require.NoError(t, err, "Failed to unmarshal") + + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preBeaconState, err := sszToState(preBeaconStateSSZ) + require.NoError(t, err) + + // If the post.ssz is not present, it means the test should fail on our end. + postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else { + require.NoError(t, err) + } + + // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. + bodyRoot, err := block.Block().Body().HashTreeRoot() + require.NoError(t, err) + pr := block.Block().ParentRoot() + beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Block().Slot(), block.Block().ProposerIndex(), pr[:], bodyRoot[:]) + if postSSZExists { + require.NoError(t, err) + comparePostState(t, postSSZFilepath, sszToState, preBeaconState, beaconState) + } else { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } + }) + } +} diff --git a/testing/spectest/shared/common/operations/bls_to_execution_changes.go b/testing/spectest/shared/common/operations/bls_to_execution_changes.go new file mode 100644 index 000000000000..2aa38b102eb4 --- /dev/null +++ b/testing/spectest/shared/common/operations/bls_to_execution_changes.go @@ -0,0 +1,57 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunBLSToExecutionChangeTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/bls_to_execution_change/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/bls_to_execution_change/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + changeFile, err := util.BazelFileBytes(folderPath, "address_change.ssz_snappy") + require.NoError(t, err) + changeSSZ, err := snappy.Decode(nil /* dst */, changeFile) + require.NoError(t, err, "Failed to decompress") + blk, err := block(changeSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + st, err := blocks.ProcessBLSToExecutionChanges(s, b.Block()) + if err != nil { + return nil, err + } + changes, err := b.Block().Body().BLSToExecutionChanges() + if err != nil { + return nil, err + } + cSet, err := blocks.BLSChangesSignatureBatch(st, changes) + if err != nil { + return nil, err + } + ok, err := cSet.Verify() + if err != nil { + return nil, err + } + if !ok { + return nil, errors.New("signature did not verify") + } + return st, nil + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/consolidations.go b/testing/spectest/shared/common/operations/consolidations.go new file mode 100644 index 000000000000..ff833943f153 --- /dev/null +++ b/testing/spectest/shared/common/operations/consolidations.go @@ -0,0 +1,43 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunConsolidationTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/consolidation_request/pyspec_tests") + require.NotEqual(t, 0, len(testFolders), "missing tests for consolidation operation in folder") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + consolidationFile, err := util.BazelFileBytes(folderPath, "consolidation_request.ssz_snappy") + require.NoError(t, err) + consolidationSSZ, err := snappy.Decode(nil /* dst */, consolidationFile) + require.NoError(t, err, "Failed to decompress") + blk, err := block(consolidationSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + ed, err := b.Block().Body().Execution() + if err != nil { + return nil, err + } + eed, ok := ed.(interfaces.ExecutionDataElectra) + if !ok { + t.Fatal("block does not have execution data for electra") + } + return s, electra.ProcessConsolidationRequests(ctx, s, eed.ConsolidationRequests()) + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/deposit.go b/testing/spectest/shared/common/operations/deposit.go new file mode 100644 index 000000000000..5cecde94a700 --- /dev/null +++ b/testing/spectest/shared/common/operations/deposit.go @@ -0,0 +1,36 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +type ProcessDeposits func(ctx context.Context, beaconState state.BeaconState, deposits []*ethpb.Deposit) (state.BeaconState, error) + +func RunDepositTest(t *testing.T, config string, fork string, blockWithDeposit blockWithSSZObject, process ProcessDeposits, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/deposit/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") + require.NoError(t, err) + depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) + require.NoError(t, err, "Failed to decompress") + blk, err := blockWithDeposit(depositSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + return process(ctx, s, b.Block().Body().Deposits()) + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/deposit_request.go b/testing/spectest/shared/common/operations/deposit_request.go new file mode 100644 index 000000000000..ee1f51f677c7 --- /dev/null +++ b/testing/spectest/shared/common/operations/deposit_request.go @@ -0,0 +1,38 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunDepositRequestsTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit_request/pyspec_tests") + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + depositRequestFile, err := util.BazelFileBytes(folderPath, "deposit_request.ssz_snappy") + require.NoError(t, err) + depositRequestSSZ, err := snappy.Decode(nil /* dst */, depositRequestFile) + require.NoError(t, err, "Failed to decompress") + blk, err := block(depositRequestSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + e, err := b.Block().Body().Execution() + require.NoError(t, err, "Failed to get execution") + ee, ok := e.(interfaces.ExecutionDataElectra) + require.Equal(t, true, ok, "Invalid execution payload") + return electra.ProcessDepositRequests(ctx, s, ee.DepositRequests()) + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/execution_payload.go b/testing/spectest/shared/common/operations/execution_payload.go new file mode 100644 index 000000000000..c305efae2cd0 --- /dev/null +++ b/testing/spectest/shared/common/operations/execution_payload.go @@ -0,0 +1,76 @@ +package operations + +import ( + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +type SSZToBlockBody func([]byte) (interfaces.ReadOnlyBeaconBlockBody, error) + +func RunExecutionPayloadTest(t *testing.T, config string, fork string, sszToBlockBody SSZToBlockBody, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/execution_payload/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/execution_payload/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + helpers.ClearCache() + + blockBodyFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "body.ssz_snappy") + require.NoError(t, err) + bodySSZ, err := snappy.Decode(nil /* dst */, blockBodyFile) + require.NoError(t, err, "Failed to decompress") + body, err := sszToBlockBody(bodySSZ) + require.NoError(t, err, "Failed to unmarshal") + + preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preBeaconState, err := sszToState(preBeaconStateSSZ) + require.NoError(t, err) + + postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else { + require.NoError(t, err) + } + + file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") + require.NoError(t, err) + config := &ExecutionConfig{} + require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") + + gotState, err := blocks.ProcessPayload(preBeaconState, body) + if postSSZExists { + require.NoError(t, err) + comparePostState(t, postSSZFilepath, sszToState, preBeaconState, gotState) + } else if config.Valid { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } + }) + } +} + +type ExecutionConfig struct { + Valid bool `json:"execution_valid"` +} diff --git a/testing/spectest/shared/common/operations/proposer_slashing.go b/testing/spectest/shared/common/operations/proposer_slashing.go new file mode 100644 index 000000000000..dda287e6a16e --- /dev/null +++ b/testing/spectest/shared/common/operations/proposer_slashing.go @@ -0,0 +1,17 @@ +package operations + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" +) + +func RunProposerSlashingTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + runSlashingTest(t, config, fork, "proposer_slashing", block, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), v.SlashValidator) + }) +} diff --git a/testing/spectest/shared/common/operations/slashing.go b/testing/spectest/shared/common/operations/slashing.go new file mode 100644 index 000000000000..e4a79b26fda1 --- /dev/null +++ b/testing/spectest/shared/common/operations/slashing.go @@ -0,0 +1,31 @@ +package operations + +import ( + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func runSlashingTest(t *testing.T, config string, fork string, objName string, block blockWithSSZObject, sszToState SSZToState, operationFn BlockOperation) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/"+objName+"/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/"+objName+"/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + slashingFile, err := util.BazelFileBytes(folderPath, objName+".ssz_snappy") + require.NoError(t, err) + slashingSSZ, err := snappy.Decode(nil /* dst */, slashingFile) + require.NoError(t, err, "Failed to decompress") + blk, err := block(slashingSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, operationFn) + }) + } +} diff --git a/testing/spectest/shared/common/operations/sync_aggregate.go b/testing/spectest/shared/common/operations/sync_aggregate.go new file mode 100644 index 000000000000..8194aed4edbf --- /dev/null +++ b/testing/spectest/shared/common/operations/sync_aggregate.go @@ -0,0 +1,45 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunSyncCommitteeTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/sync_aggregate/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/sync_aggregate/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + f, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") + require.NoError(t, err) + ssz, err := snappy.Decode(nil /* dst */, f) + require.NoError(t, err, "Failed to decompress") + blk, err := block(ssz) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + sa, err := b.Block().Body().SyncAggregate() + if err != nil { + return nil, err + } + st, _, err := altair.ProcessSyncAggregate(context.Background(), s, sa) + if err != nil { + return nil, err + } + return st, nil + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/test_runner.go b/testing/spectest/shared/common/operations/test_runner.go new file mode 100644 index 000000000000..e166c830f0dc --- /dev/null +++ b/testing/spectest/shared/common/operations/test_runner.go @@ -0,0 +1,83 @@ +package operations + +import ( + "context" + "os" + "path" + "strings" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +type blockWithSSZObject func([]byte) (interfaces.SignedBeaconBlock, error) +type BlockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) +type ProcessBlock func(context.Context, state.BeaconState, interfaces.ReadOnlyBeaconBlock) (state.BeaconState, error) +type SSZToState func([]byte) (state.BeaconState, error) + +// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the +// passed in block operation function and checks the post state with the expected post state. +func RunBlockOperationTest( + t *testing.T, + folderPath string, + wsb interfaces.SignedBeaconBlock, + sszToState SSZToState, + operationFn BlockOperation, +) { + preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) + require.NoError(t, err) + preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + preState, err := sszToState(preBeaconStateSSZ) + require.NoError(t, err) + + // If the post.ssz is not present, it means the test should fail on our end. + postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) + postSSZExists := true + if err != nil && strings.Contains(err.Error(), "could not locate file") { + postSSZExists = false + } else if err != nil { + t.Fatal(err) + } + + helpers.ClearCache() + beaconState, err := operationFn(context.Background(), preState, wsb) + if postSSZExists { + require.NoError(t, err) + comparePostState(t, postSSZFilepath, sszToState, preState, beaconState) + } else { + // Note: This doesn't test anything worthwhile. It essentially tests + // that *any* error has occurred, not any specific error. + if err == nil { + t.Fatal("Did not fail when expected") + } + t.Logf("Expected failure; failure reason = %v", err) + return + } +} + +func comparePostState(t *testing.T, postSSZFilepath string, sszToState SSZToState, want state.BeaconState, got state.BeaconState) { + postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 + require.NoError(t, err) + postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) + require.NoError(t, err, "Failed to decompress") + postBeaconState, err := sszToState(postBeaconStateSSZ) + require.NoError(t, err) + postBeaconStatePb, ok := postBeaconState.ToProtoUnsafe().(proto.Message) + require.Equal(t, true, ok, "post beacon state did not return a proto.Message") + pbState, ok := want.ToProtoUnsafe().(proto.Message) + require.Equal(t, true, ok, "beacon state did not return a proto.Message") + if !proto.Equal(pbState, postBeaconStatePb) { + t.Log(cmp.Diff(postBeaconStatePb, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected") + } +} diff --git a/testing/spectest/shared/common/operations/voluntary_exit.go b/testing/spectest/shared/common/operations/voluntary_exit.go new file mode 100644 index 000000000000..ec2829d5bda4 --- /dev/null +++ b/testing/spectest/shared/common/operations/voluntary_exit.go @@ -0,0 +1,37 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunVoluntaryExitTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/voluntary_exit/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/voluntary_exit/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") + require.NoError(t, err) + exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) + require.NoError(t, err, "Failed to decompress") + blk, err := block(exitSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/withdrawal_request.go b/testing/spectest/shared/common/operations/withdrawal_request.go new file mode 100644 index 000000000000..fdb06b6809ef --- /dev/null +++ b/testing/spectest/shared/common/operations/withdrawal_request.go @@ -0,0 +1,42 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunWithdrawalRequestTest(t *testing.T, config string, fork string, block blockWithSSZObject, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/withdrawal_request/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/withdrawal_request/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "withdrawal_request.ssz_snappy") + require.NoError(t, err) + withdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, withdrawalRequestFile) + require.NoError(t, err, "Failed to decompress") + blk, err := block(withdrawalRequestSSZ) + require.NoError(t, err) + RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + bod := b.Block().Body() + e, err := bod.Execution() + require.NoError(t, err) + exe, ok := e.(interfaces.ExecutionDataElectra) + require.Equal(t, true, ok) + return electra.ProcessWithdrawalRequests(ctx, s, exe.WithdrawalRequests()) + }) + }) + } +} diff --git a/testing/spectest/shared/common/operations/withdrawals.go b/testing/spectest/shared/common/operations/withdrawals.go new file mode 100644 index 000000000000..2534576658df --- /dev/null +++ b/testing/spectest/shared/common/operations/withdrawals.go @@ -0,0 +1,50 @@ +package operations + +import ( + "context" + "path" + "testing" + + "github.com/golang/snappy" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/testing/util" +) + +func RunWithdrawalsTest(t *testing.T, config string, fork string, sszToBlock SSZToBlock, sszToState SSZToState) { + require.NoError(t, utils.SetConfig(t, config)) + testFolders, testsFolderPath := utils.TestFolders(t, config, fork, "operations/withdrawals/pyspec_tests") + if len(testFolders) == 0 { + t.Fatalf("No test folders found for %s/%s/%s", config, fork, "operations/withdrawals/pyspec_tests") + } + for _, folder := range testFolders { + t.Run(folder.Name(), func(t *testing.T) { + folderPath := path.Join(testsFolderPath, folder.Name()) + payloadFile, err := util.BazelFileBytes(folderPath, "execution_payload.ssz_snappy") + require.NoError(t, err) + payloadSSZ, err := snappy.Decode(nil /* dst */, payloadFile) + require.NoError(t, err, "Failed to decompress") + blk, err := sszToBlock(payloadSSZ) + require.NoError(t, err) + + RunBlockOperationTest(t, folderPath, blk, sszToState, func(_ context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { + payload, err := b.Block().Body().Execution() + if err != nil { + return nil, err + } + withdrawals, err := payload.Withdrawals() + if err != nil { + return nil, err + } + p, err := consensusblocks.WrappedExecutionPayloadCapella(&enginev1.ExecutionPayloadCapella{Withdrawals: withdrawals}) + require.NoError(t, err) + return blocks.ProcessWithdrawals(s, p) + }) + }) + } +} diff --git a/testing/spectest/shared/deneb/operations/BUILD.bazel b/testing/spectest/shared/deneb/operations/BUILD.bazel index 7cb96e31f486..43971362c5c1 100644 --- a/testing/spectest/shared/deneb/operations/BUILD.bazel +++ b/testing/spectest/shared/deneb/operations/BUILD.bazel @@ -20,22 +20,14 @@ go_library( visibility = ["//testing/spectest:__subpackages__"], deps = [ "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/blocks:go_default_library", - "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/transition:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/require:go_default_library", - "//testing/spectest/utils:go_default_library", + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/operations:go_default_library", "//testing/util:go_default_library", - "@com_github_golang_snappy//:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/testing/spectest/shared/deneb/operations/attestation.go b/testing/spectest/shared/deneb/operations/attestation.go index 85885818b3ad..2ca496c5b071 100644 --- a/testing/spectest/shared/deneb/operations/attestation.go +++ b/testing/spectest/shared/deneb/operations/attestation.go @@ -1,56 +1,27 @@ package operations import ( - "context" - "errors" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttestationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/attestation/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") - require.NoError(t, err) - attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) - require.NoError(t, err, "Failed to decompress") - att := ðpb.Attestation{} - require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{Attestations: []*ethpb.Attestation{att}} - processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.SignedBeaconBlock) (state.BeaconState, error) { - st, err = altair.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) - if err != nil { - return nil, err - } - aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) - if err != nil { - return nil, err - } - verified, err := aSet.Verify() - if err != nil { - return nil, err - } - if !verified { - return nil, errors.New("could not batch verify attestation signature") - } - return st, nil - } - - RunBlockOperationTest(t, folderPath, body, processAtt) - }) +func blockWithAttestation(attestationSSZ []byte) (interfaces.SignedBeaconBlock, error) { + att := ðpb.Attestation{} + if err := att.UnmarshalSSZ(attestationSSZ); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{Attestations: []*ethpb.Attestation{att}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunAttestationTest(t *testing.T, config string) { + common.RunAttestationTest(t, config, version.String(version.Deneb), blockWithAttestation, altair.ProcessAttestationsNoVerifySignature, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/attester_slashing.go b/testing/spectest/shared/deneb/operations/attester_slashing.go index 7871296412f8..02a1fcaf87be 100644 --- a/testing/spectest/shared/deneb/operations/attester_slashing.go +++ b/testing/spectest/shared/deneb/operations/attester_slashing.go @@ -1,38 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttesterSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/attester_slashing/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") - require.NoError(t, err) - attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) - require.NoError(t, err, "Failed to decompress") - attSlashing := ðpb.AttesterSlashing{} - require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{AttesterSlashings: []*ethpb.AttesterSlashing{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) - }) - }) +func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) { + as := ðpb.AttesterSlashing{} + if err := as.UnmarshalSSZ(asSSZ); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{AttesterSlashings: []*ethpb.AttesterSlashing{as}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunAttesterSlashingTest(t *testing.T, config string) { + common.RunAttesterSlashingTest(t, config, version.String(version.Deneb), blockWithAttesterSlashing, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/block_header.go b/testing/spectest/shared/deneb/operations/block_header.go index db03c9a03bc1..7c5f882e516a 100644 --- a/testing/spectest/shared/deneb/operations/block_header.go +++ b/testing/spectest/shared/deneb/operations/block_header.go @@ -1,83 +1,12 @@ package operations import ( - "context" - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunBlockHeaderTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/block_header/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockDeneb{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateDeneb{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoDeneb(preBeaconStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. - bodyRoot, err := block.Body.HashTreeRoot() - require.NoError(t, err) - beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateDeneb{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateDeneb(beaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } + common.RunBlockHeaderTest(t, config, version.String(version.Deneb), sszToBlock, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/bls_to_execution_changes.go b/testing/spectest/shared/deneb/operations/bls_to_execution_changes.go index b7f25c1e9710..6c4601f5318b 100644 --- a/testing/spectest/shared/deneb/operations/bls_to_execution_changes.go +++ b/testing/spectest/shared/deneb/operations/bls_to_execution_changes.go @@ -1,62 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunBLSToExecutionChangeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/bls_to_execution_change/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "deneb", "operations/bls_to_execution_change/pyspec_tests") +func blockWithBlsChange(ssz []byte) (interfaces.SignedBeaconBlock, error) { + c := ðpb.SignedBLSToExecutionChange{} + if err := c.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - changeFile, err := util.BazelFileBytes(folderPath, "address_change.ssz_snappy") - require.NoError(t, err) - changeSSZ, err := snappy.Decode(nil /* dst */, changeFile) - require.NoError(t, err, "Failed to decompress") - change := ðpb.SignedBLSToExecutionChange{} - require.NoError(t, change.UnmarshalSSZ(changeSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{c}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyDeneb{ - BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{change}, - } - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - st, err := blocks.ProcessBLSToExecutionChanges(s, b.Block()) - if err != nil { - return nil, err - } - changes, err := b.Block().Body().BLSToExecutionChanges() - if err != nil { - return nil, err - } - cSet, err := blocks.BLSChangesSignatureBatch(st, changes) - if err != nil { - return nil, err - } - ok, err := cSet.Verify() - if err != nil { - return nil, err - } - if !ok { - return nil, errors.New("signature did not verify") - } - return st, nil - }) - }) - } +func RunBLSToExecutionChangeTest(t *testing.T, config string) { + common.RunBLSToExecutionChangeTest(t, config, version.String(version.Deneb), blockWithBlsChange, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/deposit.go b/testing/spectest/shared/deneb/operations/deposit.go index 8a463e923a2f..97a06fc16085 100644 --- a/testing/spectest/shared/deneb/operations/deposit.go +++ b/testing/spectest/shared/deneb/operations/deposit.go @@ -1,38 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunDepositTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/deposit/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") - require.NoError(t, err) - depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) - require.NoError(t, err, "Failed to decompress") - deposit := ðpb.Deposit{} - require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{Deposits: []*ethpb.Deposit{deposit}} - processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - return altair.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) - } - RunBlockOperationTest(t, folderPath, body, processDepositsFunc) - }) +func blockWithDeposit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + d := ðpb.Deposit{} + if err := d.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{Deposits: []*ethpb.Deposit{d}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunDepositTest(t *testing.T, config string) { + common.RunDepositTest(t, config, version.String(version.Deneb), blockWithDeposit, altair.ProcessDeposits, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/execution_payload.go b/testing/spectest/shared/deneb/operations/execution_payload.go index d1069e4a600f..c5fc1e5c0647 100644 --- a/testing/spectest/shared/deneb/operations/execution_payload.go +++ b/testing/spectest/shared/deneb/operations/execution_payload.go @@ -1,104 +1,12 @@ package operations import ( - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - blocks2 "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunExecutionPayloadTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/execution_payload/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "deneb", "operations/execution_payload/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockBodyFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "body.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockBodyFile) - require.NoError(t, err, "Failed to decompress") - body := ðpb.BeaconBlockBodyDeneb{} - require.NoError(t, body.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - b, err := blocks2.NewBeaconBlock(ðpb.BeaconBlockDeneb{Body: body}) - require.NoError(t, err) - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateDeneb{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoDeneb(preBeaconStateBase) - require.NoError(t, err) - - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - payload, err := blocks2.WrappedExecutionPayloadDeneb(body.ExecutionPayload) - require.NoError(t, err) - - file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") - require.NoError(t, err) - config := &ExecutionConfig{} - require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") - - if postSSZExists { - require.NoError(t, blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload)) - require.NoError(t, blocks.ValidatePayload(preBeaconState, payload)) - require.NoError(t, transition.VerifyBlobCommitmentCount(b)) - require.NoError(t, preBeaconState.SetLatestExecutionPayloadHeader(payload)) - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateDeneb{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateDeneb(preBeaconState.ToProto()) - require.NoError(t, err) - t.Log(pbState) - t.Log(postBeaconState) - if !proto.Equal(pbState, postBeaconState) { - t.Fatal("Post state does not match expected") - } - } else if config.Valid { - err1 := blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload) - err2 := blocks.ValidatePayload(preBeaconState, payload) - err3 := transition.VerifyBlobCommitmentCount(b) - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err1 == nil && err2 == nil && err3 == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } -} - -type ExecutionConfig struct { - Valid bool `json:"execution_valid"` + common.RunExecutionPayloadTest(t, config, version.String(version.Deneb), sszToBlockBody, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/helpers.go b/testing/spectest/shared/deneb/operations/helpers.go index 1cfe64c0ea06..73c822bea2b1 100644 --- a/testing/spectest/shared/deneb/operations/helpers.go +++ b/testing/spectest/shared/deneb/operations/helpers.go @@ -1,85 +1,33 @@ package operations import ( - "context" - "os" - "path" - "strings" - "testing" - - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.SignedBeaconBlock) (state.BeaconState, error) - -// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the -// passed in block operation function and checks the post state with the expected post state. -func RunBlockOperationTest( - t *testing.T, - folderPath string, - body *ethpb.BeaconBlockBodyDeneb, - operationFn blockOperation, -) { - preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preStateBase := ðpb.BeaconStateDeneb{} - if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) +func sszToState(b []byte) (state.BeaconState, error) { + base := ðpb.BeaconStateDeneb{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } - preState, err := state_native.InitializeFromProtoDeneb(preStateBase) - require.NoError(t, err) + return state_native.InitializeFromProtoDeneb(base) +} - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else if err != nil { - t.Fatal(err) +func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) { + base := ðpb.BeaconBlockDeneb{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockDeneb{Block: base}) +} - helpers.ClearCache() - b := util.NewBeaconBlockDeneb() - b.Block.Body = body - wsb, err := blocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - beaconState, err := operationFn(context.Background(), preState, wsb) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateDeneb{} - if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - pbState, err := state_native.ProtobufBeaconStateDeneb(beaconState.ToProtoUnsafe()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Error("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return +func sszToBlockBody(b []byte) (interfaces.ReadOnlyBeaconBlockBody, error) { + base := ðpb.BeaconBlockBodyDeneb{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewBeaconBlockBody(base) } diff --git a/testing/spectest/shared/deneb/operations/proposer_slashing.go b/testing/spectest/shared/deneb/operations/proposer_slashing.go index e02bc9574bf9..1991db96b49d 100644 --- a/testing/spectest/shared/deneb/operations/proposer_slashing.go +++ b/testing/spectest/shared/deneb/operations/proposer_slashing.go @@ -1,38 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunProposerSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/proposer_slashing/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") - require.NoError(t, err) - proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) - require.NoError(t, err, "Failed to decompress") - proposerSlashing := ðpb.ProposerSlashing{} - require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) - }) - }) +func blockWithProposerSlashing(ssz []byte) (interfaces.SignedBeaconBlock, error) { + ps := ðpb.ProposerSlashing{} + if err := ps.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{ProposerSlashings: []*ethpb.ProposerSlashing{ps}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunProposerSlashingTest(t *testing.T, config string) { + common.RunProposerSlashingTest(t, config, version.String(version.Deneb), blockWithProposerSlashing, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/sync_committee.go b/testing/spectest/shared/deneb/operations/sync_committee.go index a43747cdd3e3..0faff606d68b 100644 --- a/testing/spectest/shared/deneb/operations/sync_committee.go +++ b/testing/spectest/shared/deneb/operations/sync_committee.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunSyncCommitteeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/sync_aggregate/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - syncCommitteeFile, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") - require.NoError(t, err) - syncCommitteeSSZ, err := snappy.Decode(nil /* dst */, syncCommitteeFile) - require.NoError(t, err, "Failed to decompress") - sc := ðpb.SyncAggregate{} - require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{SyncAggregate: sc} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - st, _, err := altair.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) - if err != nil { - return nil, err - } - return st, nil - }) - }) +func blockWithSyncAggregate(ssz []byte) (interfaces.SignedBeaconBlock, error) { + sa := ðpb.SyncAggregate{} + if err := sa.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{SyncAggregate: sa} + return blocks.NewSignedBeaconBlock(b) +} + +func RunSyncCommitteeTest(t *testing.T, config string) { + common.RunSyncCommitteeTest(t, config, version.String(version.Deneb), blockWithSyncAggregate, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/voluntary_exit.go b/testing/spectest/shared/deneb/operations/voluntary_exit.go index a16ed3a993b7..cbf2b569b3bb 100644 --- a/testing/spectest/shared/deneb/operations/voluntary_exit.go +++ b/testing/spectest/shared/deneb/operations/voluntary_exit.go @@ -1,37 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunVoluntaryExitTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/voluntary_exit/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") - require.NoError(t, err) - exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) - require.NoError(t, err, "Failed to decompress") - voluntaryExit := ðpb.SignedVoluntaryExit{} - require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) - }) - }) +func blockWithVoluntaryExit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := ðpb.SignedVoluntaryExit{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{VoluntaryExits: []*ethpb.SignedVoluntaryExit{e}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunVoluntaryExitTest(t *testing.T, config string) { + common.RunVoluntaryExitTest(t, config, version.String(version.Deneb), blockWithVoluntaryExit, sszToState) } diff --git a/testing/spectest/shared/deneb/operations/withdrawals.go b/testing/spectest/shared/deneb/operations/withdrawals.go index ac8905bc768c..119ef0033d2d 100644 --- a/testing/spectest/shared/deneb/operations/withdrawals.go +++ b/testing/spectest/shared/deneb/operations/withdrawals.go @@ -1,49 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunWithdrawalsTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "deneb", "operations/withdrawals/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - payloadFile, err := util.BazelFileBytes(folderPath, "execution_payload.ssz_snappy") - require.NoError(t, err) - payloadSSZ, err := snappy.Decode(nil /* dst */, payloadFile) - require.NoError(t, err, "Failed to decompress") - payload := &enginev1.ExecutionPayloadDeneb{} - require.NoError(t, payload.UnmarshalSSZ(payloadSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyDeneb{ExecutionPayload: payload} - RunBlockOperationTest(t, folderPath, body, func(_ context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) { - payload, err := b.Block().Body().Execution() - if err != nil { - return nil, err - } - withdrawals, err := payload.Withdrawals() - if err != nil { - return nil, err - } - p, err := consensusblocks.WrappedExecutionPayloadDeneb(&enginev1.ExecutionPayloadDeneb{Withdrawals: withdrawals}) - require.NoError(t, err) - return blocks.ProcessWithdrawals(s, p) - }) - }) +func blockWithWithdrawals(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := &enginev1.ExecutionPayloadDeneb{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockDeneb() + b.Block.Body = ðpb.BeaconBlockBodyDeneb{ExecutionPayload: e} + return blocks.NewSignedBeaconBlock(b) +} + +func RunWithdrawalsTest(t *testing.T, config string) { + common.RunWithdrawalsTest(t, config, version.String(version.Deneb), blockWithWithdrawals, sszToState) } diff --git a/testing/spectest/shared/electra/operations/BUILD.bazel b/testing/spectest/shared/electra/operations/BUILD.bazel index 87a8537b8ece..d5d42aab6391 100644 --- a/testing/spectest/shared/electra/operations/BUILD.bazel +++ b/testing/spectest/shared/electra/operations/BUILD.bazel @@ -22,25 +22,15 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/operations", visibility = ["//visibility:public"], deps = [ - "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/electra:go_default_library", - "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/transition:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/require:go_default_library", - "//testing/spectest/utils:go_default_library", + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/operations:go_default_library", "//testing/util:go_default_library", - "@com_github_golang_snappy//:go_default_library", - "@com_github_google_go_cmp//cmp:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/electra/operations/attestation.go b/testing/spectest/shared/electra/operations/attestation.go index ab219b508b46..ceb6d9fca8fd 100644 --- a/testing/spectest/shared/electra/operations/attestation.go +++ b/testing/spectest/shared/electra/operations/attestation.go @@ -1,59 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/pkg/errors" - b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttestationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/attestation/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/attestation/pyspec_tests") +func blockWithAttestation(attestationSSZ []byte) (interfaces.SignedBeaconBlock, error) { + att := ðpb.AttestationElectra{} + if err := att.UnmarshalSSZ(attestationSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") - require.NoError(t, err) - attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) - require.NoError(t, err, "Failed to decompress") - att := ðpb.AttestationElectra{} - require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{Attestations: []*ethpb.AttestationElectra{att}} - processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err = electra.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) - if err != nil { - return nil, err - } - aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) - if err != nil { - return nil, err - } - verified, err := aSet.Verify() - if err != nil { - return nil, err - } - if !verified { - return nil, errors.New("could not batch verify attestation signature") - } - return st, nil - } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{Attestations: []*ethpb.AttestationElectra{att}} + return blocks.NewSignedBeaconBlock(b) +} - RunBlockOperationTest(t, folderPath, body, processAtt) - }) - } +func RunAttestationTest(t *testing.T, config string) { + common.RunAttestationTest(t, config, version.String(version.Electra), blockWithAttestation, electra.ProcessAttestationsNoVerifySignature, sszToState) } diff --git a/testing/spectest/shared/electra/operations/attester_slashing.go b/testing/spectest/shared/electra/operations/attester_slashing.go index 8fd621330c7e..7ff5d8c626f8 100644 --- a/testing/spectest/shared/electra/operations/attester_slashing.go +++ b/testing/spectest/shared/electra/operations/attester_slashing.go @@ -1,38 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunAttesterSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/attester_slashing/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") - require.NoError(t, err) - attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) - require.NoError(t, err, "Failed to decompress") - attSlashing := ðpb.AttesterSlashingElectra{} - require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{AttesterSlashings: []*ethpb.AttesterSlashingElectra{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), validators.SlashValidator) - }) - }) +func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) { + as := ðpb.AttesterSlashingElectra{} + if err := as.UnmarshalSSZ(asSSZ); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{AttesterSlashings: []*ethpb.AttesterSlashingElectra{as}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunAttesterSlashingTest(t *testing.T, config string) { + common.RunAttesterSlashingTest(t, config, version.String(version.Electra), blockWithAttesterSlashing, sszToState) } diff --git a/testing/spectest/shared/electra/operations/block_header.go b/testing/spectest/shared/electra/operations/block_header.go index f0d141e3dc21..7af3c4ed1560 100644 --- a/testing/spectest/shared/electra/operations/block_header.go +++ b/testing/spectest/shared/electra/operations/block_header.go @@ -1,86 +1,12 @@ package operations import ( - "context" - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunBlockHeaderTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/block_header/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlockElectra{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateElectra{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoElectra(preBeaconStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. - bodyRoot, err := block.Body.HashTreeRoot() - require.NoError(t, err) - beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateElectra{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } + common.RunBlockHeaderTest(t, config, version.String(version.Electra), sszToBlock, sszToState) } diff --git a/testing/spectest/shared/electra/operations/bls_to_execution_changes.go b/testing/spectest/shared/electra/operations/bls_to_execution_changes.go index ee033f72d0c7..a30f26d3f035 100644 --- a/testing/spectest/shared/electra/operations/bls_to_execution_changes.go +++ b/testing/spectest/shared/electra/operations/bls_to_execution_changes.go @@ -1,62 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunBLSToExecutionChangeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/bls_to_execution_change/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/bls_to_execution_change/pyspec_tests") +func blockWithBlsChange(ssz []byte) (interfaces.SignedBeaconBlock, error) { + c := ðpb.SignedBLSToExecutionChange{} + if err := c.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - changeFile, err := util.BazelFileBytes(folderPath, "address_change.ssz_snappy") - require.NoError(t, err) - changeSSZ, err := snappy.Decode(nil /* dst */, changeFile) - require.NoError(t, err, "Failed to decompress") - change := ðpb.SignedBLSToExecutionChange{} - require.NoError(t, change.UnmarshalSSZ(changeSSZ), "Failed to unmarshal") + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{c}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBodyElectra{ - BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{change}, - } - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err := blocks.ProcessBLSToExecutionChanges(s, b.Block()) - if err != nil { - return nil, err - } - changes, err := b.Block().Body().BLSToExecutionChanges() - if err != nil { - return nil, err - } - cSet, err := blocks.BLSChangesSignatureBatch(st, changes) - if err != nil { - return nil, err - } - ok, err := cSet.Verify() - if err != nil { - return nil, err - } - if !ok { - return nil, errors.New("signature did not verify") - } - return st, nil - }) - }) - } +func RunBLSToExecutionChangeTest(t *testing.T, config string) { + common.RunBLSToExecutionChangeTest(t, config, version.String(version.Electra), blockWithBlsChange, sszToState) } diff --git a/testing/spectest/shared/electra/operations/consolidations.go b/testing/spectest/shared/electra/operations/consolidations.go index 66091df746ab..44ccf1b69d37 100644 --- a/testing/spectest/shared/electra/operations/consolidations.go +++ b/testing/spectest/shared/electra/operations/consolidations.go @@ -1,49 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" - eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunConsolidationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/consolidation_request/pyspec_tests") - require.NotEqual(t, 0, len(testFolders), "missing tests for consolidation operation in folder") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - consolidationFile, err := util.BazelFileBytes(folderPath, "consolidation_request.ssz_snappy") - require.NoError(t, err) - consolidationSSZ, err := snappy.Decode(nil /* dst */, consolidationFile) - require.NoError(t, err, "Failed to decompress") - consolidation := &enginev1.ConsolidationRequest{} - require.NoError(t, consolidation.UnmarshalSSZ(consolidationSSZ), "Failed to unmarshal") - - body := ð.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ - ConsolidationRequests: []*enginev1.ConsolidationRequest{consolidation}, - }} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - ed, err := b.Block().Body().Execution() - if err != nil { - return nil, err - } - eed, ok := ed.(interfaces.ExecutionDataElectra) - if !ok { - t.Fatal("block does not have execution data for electra") - } - return s, electra.ProcessConsolidationRequests(ctx, s, eed.ConsolidationRequests()) - }) - }) +func blockWithConsolidation(ssz []byte) (interfaces.SignedBeaconBlock, error) { + cr := &enginev1.ConsolidationRequest{} + if err := cr.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ConsolidationRequests: []*enginev1.ConsolidationRequest{cr}}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunConsolidationTest(t *testing.T, config string) { + common.RunConsolidationTest(t, config, version.String(version.Electra), blockWithConsolidation, sszToState) } diff --git a/testing/spectest/shared/electra/operations/deposit.go b/testing/spectest/shared/electra/operations/deposit.go index 254b440a88d1..405671ea2fa9 100644 --- a/testing/spectest/shared/electra/operations/deposit.go +++ b/testing/spectest/shared/electra/operations/deposit.go @@ -1,38 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunDepositTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") - require.NoError(t, err) - depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) - require.NoError(t, err, "Failed to decompress") - deposit := ðpb.Deposit{} - require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{Deposits: []*ethpb.Deposit{deposit}} - processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return electra.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) - } - RunBlockOperationTest(t, folderPath, body, processDepositsFunc) - }) +func blockWithDeposit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + d := ðpb.Deposit{} + if err := d.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{Deposits: []*ethpb.Deposit{d}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunDepositTest(t *testing.T, config string) { + common.RunDepositTest(t, config, version.String(version.Electra), blockWithDeposit, electra.ProcessDeposits, sszToState) } diff --git a/testing/spectest/shared/electra/operations/deposit_request.go b/testing/spectest/shared/electra/operations/deposit_request.go index 9f904959b4ea..686ea39f754b 100644 --- a/testing/spectest/shared/electra/operations/deposit_request.go +++ b/testing/spectest/shared/electra/operations/deposit_request.go @@ -1,43 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunDepositRequestsTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/deposit_request/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositRequestFile, err := util.BazelFileBytes(folderPath, "deposit_request.ssz_snappy") - require.NoError(t, err) - depositRequestSSZ, err := snappy.Decode(nil /* dst */, depositRequestFile) - require.NoError(t, err, "Failed to decompress") - depositRequest := &enginev1.DepositRequest{} - require.NoError(t, depositRequest.UnmarshalSSZ(depositRequestSSZ), "failed to unmarshal") - requests := []*enginev1.DepositRequest{depositRequest} - body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{DepositRequests: requests}} - processDepositRequestsFunc := func(ctx context.Context, s state.BeaconState, signedBlock interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - e, err := signedBlock.Block().Body().Execution() - require.NoError(t, err, "Failed to get execution") - ee, ok := e.(interfaces.ExecutionDataElectra) - require.Equal(t, true, ok, "Invalid execution payload") - return electra.ProcessDepositRequests(ctx, s, ee.DepositRequests()) - } - RunBlockOperationTest(t, folderPath, body, processDepositRequestsFunc) - }) +func blockWithDepositRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) { + dr := &enginev1.DepositRequest{} + if err := dr.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{DepositRequests: []*enginev1.DepositRequest{dr}}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunDepositRequestsTest(t *testing.T, config string) { + common.RunDepositRequestsTest(t, config, version.String(version.Electra), blockWithDepositRequest, sszToState) } diff --git a/testing/spectest/shared/electra/operations/execution_payload.go b/testing/spectest/shared/electra/operations/execution_payload.go index dc00fc5173eb..4ce07c0a05d3 100644 --- a/testing/spectest/shared/electra/operations/execution_payload.go +++ b/testing/spectest/shared/electra/operations/execution_payload.go @@ -1,105 +1,13 @@ package operations import ( - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - blocks2 "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) func RunExecutionPayloadTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_payload/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/execution_payload/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockBodyFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "body.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockBodyFile) - require.NoError(t, err, "Failed to decompress") - body := ðpb.BeaconBlockBodyElectra{} - require.NoError(t, body.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - b, err := blocks2.NewBeaconBlock(ðpb.BeaconBlockElectra{Body: body}) - require.NoError(t, err) - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconStateElectra{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoElectra(preBeaconStateBase) - require.NoError(t, err) - - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - payload, err := blocks2.WrappedExecutionPayloadElectra(body.ExecutionPayload) - require.NoError(t, err) - - file, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "execution.yaml") - require.NoError(t, err) - config := &ExecutionConfig{} - require.NoError(t, utils.UnmarshalYaml(file, config), "Failed to Unmarshal") - - if postSSZExists { - require.NoError(t, blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload)) - require.NoError(t, blocks.ValidatePayload(preBeaconState, payload)) - require.NoError(t, transition.VerifyBlobCommitmentCount(b)) - require.NoError(t, preBeaconState.SetLatestExecutionPayloadHeader(payload)) - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateElectra{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStateElectra(preBeaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else if config.Valid { - err1 := blocks.ValidatePayloadWhenMergeCompletes(preBeaconState, payload) - err2 := blocks.ValidatePayload(preBeaconState, payload) - err3 := transition.VerifyBlobCommitmentCount(b) - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err1 == nil && err2 == nil && err3 == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } -} - -type ExecutionConfig struct { - Valid bool `json:"execution_valid"` + t.Skip("TODO: Electra uses a different execution payload") + common.RunExecutionPayloadTest(t, config, version.String(version.Electra), sszToBlockBody, sszToState) } diff --git a/testing/spectest/shared/electra/operations/helpers.go b/testing/spectest/shared/electra/operations/helpers.go index fe42a2c83e6f..64cfad193760 100644 --- a/testing/spectest/shared/electra/operations/helpers.go +++ b/testing/spectest/shared/electra/operations/helpers.go @@ -1,88 +1,33 @@ package operations import ( - "context" - "os" - "path" - "strings" - "testing" - - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) - -// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the -// passed in block operation function and checks the post state with the expected post state. -func RunBlockOperationTest( - t *testing.T, - folderPath string, - body *ethpb.BeaconBlockBodyElectra, - operationFn blockOperation, -) { - preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preStateBase := ðpb.BeaconStateElectra{} - if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) +func sszToState(b []byte) (state.BeaconState, error) { + base := ðpb.BeaconStateElectra{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } - preState, err := state_native.InitializeFromProtoElectra(preStateBase) - require.NoError(t, err) + return state_native.InitializeFromProtoElectra(base) +} - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else if err != nil { - t.Fatal(err) +func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) { + base := ðpb.BeaconBlockElectra{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: base}) +} - helpers.ClearCache() - b := util.NewBeaconBlockElectra() - b.Block.Body = body - wsb, err := blocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - beaconState, err := operationFn(context.Background(), preState, wsb) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconStateElectra{} - if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - pbState, err := state_native.ProtobufBeaconStateElectra(beaconState.ToProtoUnsafe()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Error("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return +func sszToBlockBody(b []byte) (interfaces.ReadOnlyBeaconBlockBody, error) { + base := ðpb.BeaconBlockBodyElectra{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewBeaconBlockBody(base) } diff --git a/testing/spectest/shared/electra/operations/proposer_slashing.go b/testing/spectest/shared/electra/operations/proposer_slashing.go index d31e771cd188..64f11edf4248 100644 --- a/testing/spectest/shared/electra/operations/proposer_slashing.go +++ b/testing/spectest/shared/electra/operations/proposer_slashing.go @@ -1,38 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunProposerSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/proposer_slashing/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") - require.NoError(t, err) - proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) - require.NoError(t, err, "Failed to decompress") - proposerSlashing := ðpb.ProposerSlashing{} - require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), validators.SlashValidator) - }) - }) +func blockWithProposerSlashing(ssz []byte) (interfaces.SignedBeaconBlock, error) { + ps := ðpb.ProposerSlashing{} + if err := ps.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{ProposerSlashings: []*ethpb.ProposerSlashing{ps}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunProposerSlashingTest(t *testing.T, config string) { + common.RunProposerSlashingTest(t, config, version.String(version.Electra), blockWithProposerSlashing, sszToState) } diff --git a/testing/spectest/shared/electra/operations/sync_committee.go b/testing/spectest/shared/electra/operations/sync_committee.go index 373cc0046412..b14de68c2f20 100644 --- a/testing/spectest/shared/electra/operations/sync_committee.go +++ b/testing/spectest/shared/electra/operations/sync_committee.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunSyncCommitteeTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/sync_aggregate/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - syncCommitteeFile, err := util.BazelFileBytes(folderPath, "sync_aggregate.ssz_snappy") - require.NoError(t, err) - syncCommitteeSSZ, err := snappy.Decode(nil /* dst */, syncCommitteeFile) - require.NoError(t, err, "Failed to decompress") - sc := ðpb.SyncAggregate{} - require.NoError(t, sc.UnmarshalSSZ(syncCommitteeSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{SyncAggregate: sc} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, _, err := electra.ProcessSyncAggregate(context.Background(), s, body.SyncAggregate) - if err != nil { - return nil, err - } - return st, nil - }) - }) +func blockWithSyncAggregate(ssz []byte) (interfaces.SignedBeaconBlock, error) { + sa := ðpb.SyncAggregate{} + if err := sa.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{SyncAggregate: sa} + return blocks.NewSignedBeaconBlock(b) +} + +func RunSyncCommitteeTest(t *testing.T, config string) { + common.RunSyncCommitteeTest(t, config, version.String(version.Electra), blockWithSyncAggregate, sszToState) } diff --git a/testing/spectest/shared/electra/operations/voluntary_exit.go b/testing/spectest/shared/electra/operations/voluntary_exit.go index b423c63f3e1b..706e4a9db358 100644 --- a/testing/spectest/shared/electra/operations/voluntary_exit.go +++ b/testing/spectest/shared/electra/operations/voluntary_exit.go @@ -1,37 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunVoluntaryExitTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/voluntary_exit/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") - require.NoError(t, err) - exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) - require.NoError(t, err, "Failed to decompress") - voluntaryExit := ðpb.SignedVoluntaryExit{} - require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) - }) - }) +func blockWithVoluntaryExit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := ðpb.SignedVoluntaryExit{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlock() + b.Block.Body = ðpb.BeaconBlockBody{VoluntaryExits: []*ethpb.SignedVoluntaryExit{e}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunVoluntaryExitTest(t *testing.T, config string) { + common.RunVoluntaryExitTest(t, config, version.String(version.Electra), blockWithVoluntaryExit, sszToState) } diff --git a/testing/spectest/shared/electra/operations/withdrawal_request.go b/testing/spectest/shared/electra/operations/withdrawal_request.go index 2f5451a74972..db594f586a3a 100644 --- a/testing/spectest/shared/electra/operations/withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/withdrawal_request.go @@ -1,49 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunWithdrawalRequestTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawal_request/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/withdrawal_request/pyspec_tests") - } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "withdrawal_request.ssz_snappy") - require.NoError(t, err) - withdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, withdrawalRequestFile) - require.NoError(t, err, "Failed to decompress") - withdrawalRequest := &enginev1.WithdrawalRequest{} - require.NoError(t, withdrawalRequest.UnmarshalSSZ(withdrawalRequestSSZ), "Failed to unmarshal") - body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ - WithdrawalRequests: []*enginev1.WithdrawalRequest{ - withdrawalRequest, - }, - }} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - bod := b.Block().Body() - e, err := bod.Execution() - require.NoError(t, err) - exe, ok := e.(interfaces.ExecutionDataElectra) - require.Equal(t, true, ok) - return electra.ProcessWithdrawalRequests(ctx, s, exe.WithdrawalRequests()) - }) - }) +func blockWithWithdrawalRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) { + dr := &enginev1.WithdrawalRequest{} + if err := dr.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{WithdrawalRequests: []*enginev1.WithdrawalRequest{dr}}} + return blocks.NewSignedBeaconBlock(b) +} + +func RunWithdrawalRequestTest(t *testing.T, config string) { + common.RunWithdrawalRequestTest(t, config, version.String(version.Electra), blockWithWithdrawalRequest, sszToState) } diff --git a/testing/spectest/shared/electra/operations/withdrawals.go b/testing/spectest/shared/electra/operations/withdrawals.go index 5ef4fcd2ee09..38fb73d8323b 100644 --- a/testing/spectest/shared/electra/operations/withdrawals.go +++ b/testing/spectest/shared/electra/operations/withdrawals.go @@ -1,49 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func RunWithdrawalsTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawals/pyspec_tests") - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - payloadFile, err := util.BazelFileBytes(folderPath, "execution_payload.ssz_snappy") - require.NoError(t, err) - payloadSSZ, err := snappy.Decode(nil /* dst */, payloadFile) - require.NoError(t, err, "Failed to decompress") - payload := &enginev1.ExecutionPayloadElectra{} - require.NoError(t, payload.UnmarshalSSZ(payloadSSZ), "failed to unmarshal") - - body := ðpb.BeaconBlockBodyElectra{ExecutionPayload: payload} - RunBlockOperationTest(t, folderPath, body, func(_ context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - payload, err := b.Block().Body().Execution() - if err != nil { - return nil, err - } - withdrawals, err := payload.Withdrawals() - if err != nil { - return nil, err - } - p, err := consensusblocks.WrappedExecutionPayloadElectra(&enginev1.ExecutionPayloadElectra{Withdrawals: withdrawals}) - require.NoError(t, err) - return blocks.ProcessWithdrawals(s, p) - }) - }) +func blockWithWithdrawals(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := &enginev1.ExecutionPayloadElectra{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } + b := util.NewBeaconBlockElectra() + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: e} + return blocks.NewSignedBeaconBlock(b) +} + +func RunWithdrawalsTest(t *testing.T, config string) { + common.RunWithdrawalsTest(t, config, version.String(version.Electra), blockWithWithdrawals, sszToState) } diff --git a/testing/spectest/shared/phase0/operations/BUILD.bazel b/testing/spectest/shared/phase0/operations/BUILD.bazel index f2a69f1c9e9e..8f69fb427e01 100644 --- a/testing/spectest/shared/phase0/operations/BUILD.bazel +++ b/testing/spectest/shared/phase0/operations/BUILD.bazel @@ -17,21 +17,13 @@ go_library( deps = [ "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/blocks:go_default_library", - "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/validators:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/require:go_default_library", - "//testing/spectest/utils:go_default_library", + "//runtime/version:go_default_library", + "//testing/spectest/shared/common/operations:go_default_library", "//testing/util:go_default_library", - "@com_github_golang_snappy//:go_default_library", - "@com_github_google_go_cmp//cmp:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/operations/attestation.go b/testing/spectest/shared/phase0/operations/attestation.go index 7c2ff9a3352b..173904a68d90 100644 --- a/testing/spectest/shared/phase0/operations/attestation.go +++ b/testing/spectest/shared/phase0/operations/attestation.go @@ -1,59 +1,28 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/pkg/errors" b "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -// RunAttestationTest executes "operations/attestation" tests. -func RunAttestationTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "operations/attestation/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "phase0", "operations/attestation/pyspec_tests") +func blockWithAttestation(attestationSSZ []byte) (interfaces.SignedBeaconBlock, error) { + att := ðpb.Attestation{} + if err := att.UnmarshalSSZ(attestationSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attestationFile, err := util.BazelFileBytes(folderPath, "attestation.ssz_snappy") - require.NoError(t, err) - attestationSSZ, err := snappy.Decode(nil /* dst */, attestationFile) - require.NoError(t, err, "Failed to decompress") - att := ðpb.Attestation{} - require.NoError(t, att.UnmarshalSSZ(attestationSSZ), "Failed to unmarshal") - - body := ðpb.BeaconBlockBody{Attestations: []*ethpb.Attestation{att}} - processAtt := func(ctx context.Context, st state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - st, err = b.ProcessAttestationsNoVerifySignature(ctx, st, blk.Block()) - if err != nil { - return nil, err - } - aSet, err := b.AttestationSignatureBatch(ctx, st, blk.Block().Body().Attestations()) - if err != nil { - return nil, err - } - verified, err := aSet.Verify() - if err != nil { - return nil, err - } - if !verified { - return nil, errors.New("could not batch verify attestation signature") - } - return st, nil - } + b := util.NewBeaconBlock() + b.Block.Body = ðpb.BeaconBlockBody{Attestations: []*ethpb.Attestation{att}} + return blocks.NewSignedBeaconBlock(b) +} - RunBlockOperationTest(t, folderPath, body, processAtt) - }) - } +// RunAttestationTest executes "operations/attestation" tests. +func RunAttestationTest(t *testing.T, config string) { + common.RunAttestationTest(t, config, version.String(version.Phase0), blockWithAttestation, b.ProcessAttestationsNoVerifySignature, sszToState) } diff --git a/testing/spectest/shared/phase0/operations/attester_slashing.go b/testing/spectest/shared/phase0/operations/attester_slashing.go index df86d5116859..9f1d50d6513d 100644 --- a/testing/spectest/shared/phase0/operations/attester_slashing.go +++ b/testing/spectest/shared/phase0/operations/attester_slashing.go @@ -1,42 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -// RunAttesterSlashingTest executes "operations/attester_slashing" tests. -func RunAttesterSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "operations/attester_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "phase0", "operations/attester_slashing/pyspec_tests") +func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) { + as := ðpb.AttesterSlashing{} + if err := as.UnmarshalSSZ(asSSZ); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - attSlashingFile, err := util.BazelFileBytes(folderPath, "attester_slashing.ssz_snappy") - require.NoError(t, err) - attSlashingSSZ, err := snappy.Decode(nil /* dst */, attSlashingFile) - require.NoError(t, err, "Failed to decompress") - attSlashing := ðpb.AttesterSlashing{} - require.NoError(t, attSlashing.UnmarshalSSZ(attSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlock() + b.Block.Body = ðpb.BeaconBlockBody{AttesterSlashings: []*ethpb.AttesterSlashing{as}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBody{AttesterSlashings: []*ethpb.AttesterSlashing{attSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessAttesterSlashings(ctx, s, b.Block().Body().AttesterSlashings(), v.SlashValidator) - }) - }) - } +func RunAttesterSlashingTest(t *testing.T, config string) { + common.RunAttesterSlashingTest(t, config, version.String(version.Phase0), blockWithAttesterSlashing, sszToState) } diff --git a/testing/spectest/shared/phase0/operations/block_header.go b/testing/spectest/shared/phase0/operations/block_header.go index 0e95a5b66ca7..812f43e8411b 100644 --- a/testing/spectest/shared/phase0/operations/block_header.go +++ b/testing/spectest/shared/phase0/operations/block_header.go @@ -1,92 +1,12 @@ package operations import ( - "context" - "os" - "path" - "strings" "testing" - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" ) -// RunBlockHeaderTest executes "operations/block_header" tests. func RunBlockHeaderTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "operations/block_header/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "phase0", "operations/block_header/pyspec_tests") - } - - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - helpers.ClearCache() - - blockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "block.ssz_snappy") - require.NoError(t, err) - blockSSZ, err := snappy.Decode(nil /* dst */, blockFile) - require.NoError(t, err, "Failed to decompress") - block := ðpb.BeaconBlock{} - require.NoError(t, block.UnmarshalSSZ(blockSSZ), "Failed to unmarshal") - - preBeaconStateFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), "pre.ssz_snappy") - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preBeaconStateBase := ðpb.BeaconState{} - require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") - preBeaconState, err := state_native.InitializeFromProtoPhase0(preBeaconStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(testsFolderPath, folder.Name(), "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else { - require.NoError(t, err) - } - - // Spectest blocks are not signed, so we'll call NoVerify to skip sig verification. - bodyRoot, err := block.Body.HashTreeRoot() - require.NoError(t, err) - beaconState, err := blocks.ProcessBlockHeaderNoVerify(context.Background(), preBeaconState, block.Slot, block.ProposerIndex, block.ParentRoot, bodyRoot[:]) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconState{} - require.NoError(t, postBeaconState.UnmarshalSSZ(postBeaconStateSSZ), "Failed to unmarshal") - pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProto()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return - } - }) - } + common.RunBlockHeaderTest(t, config, version.String(version.Phase0), sszToBlock, sszToState) } diff --git a/testing/spectest/shared/phase0/operations/deposit.go b/testing/spectest/shared/phase0/operations/deposit.go index 010fb41208ba..f137c2a8067a 100644 --- a/testing/spectest/shared/phase0/operations/deposit.go +++ b/testing/spectest/shared/phase0/operations/deposit.go @@ -1,42 +1,27 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -// RunDepositTest executes "operations/deposit" tests. -func RunDepositTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "operations/deposit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "phase0", "operations/deposit/pyspec_tests") +func blockWithDeposit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + d := ðpb.Deposit{} + if err := d.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - depositFile, err := util.BazelFileBytes(folderPath, "deposit.ssz_snappy") - require.NoError(t, err) - depositSSZ, err := snappy.Decode(nil /* dst */, depositFile) - require.NoError(t, err, "Failed to decompress") - deposit := ðpb.Deposit{} - require.NoError(t, deposit.UnmarshalSSZ(depositSSZ), "Failed to unmarshal") + b := util.NewBeaconBlock() + b.Block.Body = ðpb.BeaconBlockBody{Deposits: []*ethpb.Deposit{d}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBody{Deposits: []*ethpb.Deposit{deposit}} - processDepositsFunc := func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return altair.ProcessDeposits(ctx, s, b.Block().Body().Deposits()) - } - RunBlockOperationTest(t, folderPath, body, processDepositsFunc) - }) - } +func RunDepositTest(t *testing.T, config string) { + common.RunDepositTest(t, config, version.String(version.Phase0), blockWithDeposit, altair.ProcessDeposits, sszToState) } diff --git a/testing/spectest/shared/phase0/operations/helpers.go b/testing/spectest/shared/phase0/operations/helpers.go index 419dbbb32e9d..262b40a394c2 100644 --- a/testing/spectest/shared/phase0/operations/helpers.go +++ b/testing/spectest/shared/phase0/operations/helpers.go @@ -1,88 +1,25 @@ package operations import ( - "context" - "os" - "path" - "strings" - "testing" - - "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/golang/snappy" - "github.com/google/go-cmp/cmp" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" ) -type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) - -// RunBlockOperationTest takes in the prestate and the beacon block body, processes it through the -// passed in block operation function and checks the post state with the expected post state. -func RunBlockOperationTest( - t *testing.T, - folderPath string, - body *ethpb.BeaconBlockBody, - operationFn blockOperation, -) { - preBeaconStateFile, err := util.BazelFileBytes(path.Join(folderPath, "pre.ssz_snappy")) - require.NoError(t, err) - preBeaconStateSSZ, err := snappy.Decode(nil /* dst */, preBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - preStateBase := ðpb.BeaconState{} - if err := preStateBase.UnmarshalSSZ(preBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - preState, err := state_native.InitializeFromProtoPhase0(preStateBase) - require.NoError(t, err) - - // If the post.ssz is not present, it means the test should fail on our end. - postSSZFilepath, err := bazel.Runfile(path.Join(folderPath, "post.ssz_snappy")) - postSSZExists := true - if err != nil && strings.Contains(err.Error(), "could not locate file") { - postSSZExists = false - } else if err != nil { - t.Fatal(err) +func sszToState(b []byte) (state.BeaconState, error) { + base := ðpb.BeaconState{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return state_native.InitializeFromProtoPhase0(base) +} - helpers.ClearCache() - b := util.NewBeaconBlock() - b.Block.Body = body - wsb, err := blocks.NewSignedBeaconBlock(b) - require.NoError(t, err) - beaconState, err := operationFn(context.Background(), preState, wsb) - if postSSZExists { - require.NoError(t, err) - - postBeaconStateFile, err := os.ReadFile(postSSZFilepath) // #nosec G304 - require.NoError(t, err) - postBeaconStateSSZ, err := snappy.Decode(nil /* dst */, postBeaconStateFile) - require.NoError(t, err, "Failed to decompress") - - postBeaconState := ðpb.BeaconState{} - if err := postBeaconState.UnmarshalSSZ(postBeaconStateSSZ); err != nil { - t.Fatalf("Failed to unmarshal: %v", err) - } - pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) - require.NoError(t, err) - if !proto.Equal(pbState, postBeaconState) { - t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) - t.Fatal("Post state does not match expected") - } - } else { - // Note: This doesn't test anything worthwhile. It essentially tests - // that *any* error has occurred, not any specific error. - if err == nil { - t.Fatal("Did not fail when expected") - } - t.Logf("Expected failure; failure reason = %v", err) - return +func sszToBlock(b []byte) (interfaces.SignedBeaconBlock, error) { + base := ðpb.BeaconBlock{} + if err := base.UnmarshalSSZ(b); err != nil { + return nil, err } + return blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlock{Block: base}) } diff --git a/testing/spectest/shared/phase0/operations/proposer_slashing.go b/testing/spectest/shared/phase0/operations/proposer_slashing.go index 5c862fbbee74..3511e1e5d216 100644 --- a/testing/spectest/shared/phase0/operations/proposer_slashing.go +++ b/testing/spectest/shared/phase0/operations/proposer_slashing.go @@ -1,42 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -// RunProposerSlashingTest executes "operations/proposer_slashing" tests. -func RunProposerSlashingTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "operations/proposer_slashing/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "phase0", "operations/proposer_slashing/pyspec_tests") +func blockWithProposerSlashing(ssz []byte) (interfaces.SignedBeaconBlock, error) { + ps := ðpb.ProposerSlashing{} + if err := ps.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - proposerSlashingFile, err := util.BazelFileBytes(folderPath, "proposer_slashing.ssz_snappy") - require.NoError(t, err) - proposerSlashingSSZ, err := snappy.Decode(nil /* dst */, proposerSlashingFile) - require.NoError(t, err, "Failed to decompress") - proposerSlashing := ðpb.ProposerSlashing{} - require.NoError(t, proposerSlashing.UnmarshalSSZ(proposerSlashingSSZ), "Failed to unmarshal") + b := util.NewBeaconBlock() + b.Block.Body = ðpb.BeaconBlockBody{ProposerSlashings: []*ethpb.ProposerSlashing{ps}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBody{ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessProposerSlashings(ctx, s, b.Block().Body().ProposerSlashings(), v.SlashValidator) - }) - }) - } +func RunProposerSlashingTest(t *testing.T, config string) { + common.RunProposerSlashingTest(t, config, version.String(version.Phase0), blockWithProposerSlashing, sszToState) } diff --git a/testing/spectest/shared/phase0/operations/voluntary_exit.go b/testing/spectest/shared/phase0/operations/voluntary_exit.go index 30a5b8e976d6..4f42065d783c 100644 --- a/testing/spectest/shared/phase0/operations/voluntary_exit.go +++ b/testing/spectest/shared/phase0/operations/voluntary_exit.go @@ -1,41 +1,26 @@ package operations import ( - "context" - "path" "testing" - "github.com/golang/snappy" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/operations" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -// RunVoluntaryExitTest executes "operations/voluntary_exit" tests. -func RunVoluntaryExitTest(t *testing.T, config string) { - require.NoError(t, utils.SetConfig(t, config)) - testFolders, testsFolderPath := utils.TestFolders(t, config, "phase0", "operations/voluntary_exit/pyspec_tests") - if len(testFolders) == 0 { - t.Fatalf("No test folders found for %s/%s/%s", config, "phase0", "operations/voluntary_exit/pyspec_tests") +func blockWithVoluntaryExit(ssz []byte) (interfaces.SignedBeaconBlock, error) { + e := ðpb.SignedVoluntaryExit{} + if err := e.UnmarshalSSZ(ssz); err != nil { + return nil, err } - for _, folder := range testFolders { - t.Run(folder.Name(), func(t *testing.T) { - folderPath := path.Join(testsFolderPath, folder.Name()) - exitFile, err := util.BazelFileBytes(folderPath, "voluntary_exit.ssz_snappy") - require.NoError(t, err) - exitSSZ, err := snappy.Decode(nil /* dst */, exitFile) - require.NoError(t, err, "Failed to decompress") - voluntaryExit := ðpb.SignedVoluntaryExit{} - require.NoError(t, voluntaryExit.UnmarshalSSZ(exitSSZ), "Failed to unmarshal") + b := util.NewBeaconBlock() + b.Block.Body = ðpb.BeaconBlockBody{VoluntaryExits: []*ethpb.SignedVoluntaryExit{e}} + return blocks.NewSignedBeaconBlock(b) +} - body := ðpb.BeaconBlockBody{VoluntaryExits: []*ethpb.SignedVoluntaryExit{voluntaryExit}} - RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - return blocks.ProcessVoluntaryExits(ctx, s, b.Block().Body().VoluntaryExits()) - }) - }) - } +func RunVoluntaryExitTest(t *testing.T, config string) { + common.RunVoluntaryExitTest(t, config, version.String(version.Phase0), blockWithVoluntaryExit, sszToState) } From 9a7f521f8a8b762f5bc6249081bc037c9629f70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Wed, 7 Aug 2024 17:32:54 +0200 Subject: [PATCH 241/325] Fix state upgrade log (#14316) --- beacon-chain/core/transition/transition.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index fa64765bc404..139bfdefdf8f 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -319,13 +319,17 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "core.state.UpgradeState") defer span.End() + var err error + upgraded := false + if time.CanUpgradeToAltair(state.Slot()) { state, err = altair.UpgradeToAltair(ctx, state) if err != nil { tracing.AnnotateError(span, err) return nil, err } + upgraded = true } if time.CanUpgradeToBellatrix(state.Slot()) { @@ -334,6 +338,7 @@ func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconSta tracing.AnnotateError(span, err) return nil, err } + upgraded = true } if time.CanUpgradeToCapella(state.Slot()) { @@ -342,6 +347,7 @@ func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconSta tracing.AnnotateError(span, err) return nil, err } + upgraded = true } if time.CanUpgradeToDeneb(state.Slot()) { @@ -350,6 +356,7 @@ func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconSta tracing.AnnotateError(span, err) return nil, err } + upgraded = true } if time.CanUpgradeToElectra(state.Slot()) { @@ -358,9 +365,13 @@ func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconSta tracing.AnnotateError(span, err) return nil, err } + upgraded = true + } + + if upgraded { + log.Debugf("upgraded state to %s", version.String(state.Version())) } - log.Debugf("upgraded state to %s", version.String(state.Version())) return state, nil } From b8cd77945df2b8fa8fe50520df0495309a52c2f3 Mon Sep 17 00:00:00 2001 From: Potuz Date: Thu, 8 Aug 2024 10:51:40 -0300 Subject: [PATCH 242/325] Move slasher handling down the pipeline (#14322) --- .../sync/validate_beacon_attestation.go | 80 ++++++++++--------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index 2cea8638bbd4..860b0d8a2ba7 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -113,46 +113,19 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p committeeIndex = data.CommitteeIndex } - if features.Get().EnableSlasher { - // Feed the indexed attestation to slasher if enabled. This action - // is done in the background to avoid adding more load to this critical code path. - go func() { - // Using a different context to prevent timeouts as this operation can be expensive - // and we want to avoid affecting the critical code path. - ctx := context.TODO() - preState, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) - if err != nil { - log.WithError(err).Error("Could not retrieve pre state") - tracing.AnnotateError(span, err) - return - } - committee, err := helpers.BeaconCommitteeFromState(ctx, preState, data.Slot, committeeIndex) - if err != nil { - log.WithError(err).Error("Could not get attestation committee") - tracing.AnnotateError(span, err) - return - } - indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) - if err != nil { - log.WithError(err).Error("Could not convert to indexed attestation") - tracing.AnnotateError(span, err) - return - } - s.cfg.slasherAttestationsFeed.Send(&types.WrappedIndexedAtt{IndexedAtt: indexedAtt}) - }() - } - - // Verify this the first attestation received for the participating validator for the slot. - if s.hasSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) { - return pubsub.ValidationIgnore, nil - } + if !features.Get().EnableSlasher { + // Verify this the first attestation received for the participating validator for the slot. + if s.hasSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) { + return pubsub.ValidationIgnore, nil + } - // Reject an attestation if it references an invalid block. - if s.hasBadBlock(bytesutil.ToBytes32(data.BeaconBlockRoot)) || - s.hasBadBlock(bytesutil.ToBytes32(data.Target.Root)) || - s.hasBadBlock(bytesutil.ToBytes32(data.Source.Root)) { - attBadBlockCount.Inc() - return pubsub.ValidationReject, errors.New("attestation data references bad block root") + // Reject an attestation if it references an invalid block. + if s.hasBadBlock(bytesutil.ToBytes32(data.BeaconBlockRoot)) || + s.hasBadBlock(bytesutil.ToBytes32(data.Target.Root)) || + s.hasBadBlock(bytesutil.ToBytes32(data.Source.Root)) { + attBadBlockCount.Inc() + return pubsub.ValidationReject, errors.New("attestation data references bad block root") + } } // Verify the block being voted and the processed state is in beaconDB and the block has passed validation if it's in the beaconDB. @@ -203,6 +176,35 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p return validationRes, err } + if features.Get().EnableSlasher { + // Feed the indexed attestation to slasher if enabled. This action + // is done in the background to avoid adding more load to this critical code path. + go func() { + // Using a different context to prevent timeouts as this operation can be expensive + // and we want to avoid affecting the critical code path. + ctx := context.TODO() + preState, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) + if err != nil { + log.WithError(err).Error("Could not retrieve pre state") + tracing.AnnotateError(span, err) + return + } + committee, err := helpers.BeaconCommitteeFromState(ctx, preState, data.Slot, committeeIndex) + if err != nil { + log.WithError(err).Error("Could not get attestation committee") + tracing.AnnotateError(span, err) + return + } + indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) + if err != nil { + log.WithError(err).Error("Could not convert to indexed attestation") + tracing.AnnotateError(span, err) + return + } + s.cfg.slasherAttestationsFeed.Send(&types.WrappedIndexedAtt{IndexedAtt: indexedAtt}) + }() + } + s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) msg.ValidatorData = att From e011f0540360d6e87837311240aa2f0ccf9c4069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Thu, 8 Aug 2024 18:32:19 +0200 Subject: [PATCH 243/325] Electra committe validation for aggregate and proof (#14317) * Electra committe validation for aggregate and proof * review * update comments --- beacon-chain/sync/validate_aggregate_proof.go | 8 +++-- .../sync/validate_aggregate_proof_test.go | 25 ++++++++++++---- .../sync/validate_beacon_attestation.go | 29 +++++++++++++++---- .../validate_beacon_attestation_electra.go | 3 ++ 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index 8c753b6eb7d8..e5f4d0436a9f 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -266,16 +266,20 @@ func (s *Service) setAggregatorIndexEpochSeen(epoch primitives.Epoch, aggregator // - [REJECT] The aggregate attestation has participants -- that is, len(get_attesting_indices(state, aggregate.data, aggregate.aggregation_bits)) >= 1. // - [REJECT] The aggregator's validator index is within the committee -- // i.e. `aggregate_and_proof.aggregator_index in get_beacon_committee(state, aggregate.data.slot, aggregate.data.index)`. +// +// Post-Electra: +// - [REJECT] len(committee_indices) == 1, where committee_indices = get_committee_indices(aggregate). +// - [REJECT] aggregate.data.index == 0 func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a ethpb.Att, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateIndexInCommittee") defer span.End() - _, result, err := s.validateCommitteeIndex(ctx, a, bs) + committeeIndex, _, result, err := s.validateCommitteeIndex(ctx, a, bs) if result != pubsub.ValidationAccept { return result, err } - committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex, a.GetAggregationBits()) + committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, committeeIndex, a.GetAggregationBits()) if result != pubsub.ValidationAccept { return result, err } diff --git a/beacon-chain/sync/validate_aggregate_proof_test.go b/beacon-chain/sync/validate_aggregate_proof_test.go index a8e5539aed13..f1dd12292ddf 100644 --- a/beacon-chain/sync/validate_aggregate_proof_test.go +++ b/beacon-chain/sync/validate_aggregate_proof_test.go @@ -44,9 +44,7 @@ func TestVerifyIndexInCommittee_CanVerify(t *testing.T) { bf := bitfield.NewBitlist(validators / uint64(params.BeaconConfig().SlotsPerEpoch)) bf.SetBitAt(0, true) - att := ðpb.Attestation{Data: ðpb.AttestationData{ - Target: ðpb.Checkpoint{Epoch: 0}}, - AggregationBits: bf} + att := ðpb.Attestation{Data: ðpb.AttestationData{}, AggregationBits: bf} committee, err := helpers.BeaconCommitteeFromState(context.Background(), s, att.Data.Slot, att.Data.CommitteeIndex) assert.NoError(t, err) @@ -71,8 +69,7 @@ func TestVerifyIndexInCommittee_ExistsInBeaconCommittee(t *testing.T) { s, _ := util.DeterministicGenesisState(t, validators) require.NoError(t, s.SetSlot(params.BeaconConfig().SlotsPerEpoch)) - att := ðpb.Attestation{Data: ðpb.AttestationData{ - Target: ðpb.Checkpoint{Epoch: 0}}} + att := ðpb.Attestation{Data: ðpb.AttestationData{}} committee, err := helpers.BeaconCommitteeFromState(context.Background(), s, att.Data.Slot, att.Data.CommitteeIndex) require.NoError(t, err) @@ -107,6 +104,24 @@ func TestVerifyIndexInCommittee_ExistsInBeaconCommittee(t *testing.T) { assert.Equal(t, pubsub.ValidationReject, result) } +func TestVerifyIndexInCommittee_Electra(t *testing.T) { + ctx := context.Background() + s, _ := util.DeterministicGenesisStateElectra(t, 64) + service := &Service{} + cb := primitives.NewAttestationCommitteeBits() + cb.SetBitAt(0, true) + att := ðpb.AttestationElectra{Data: ðpb.AttestationData{}, CommitteeBits: cb} + committee, err := helpers.BeaconCommitteeFromState(context.Background(), s, att.Data.Slot, att.Data.CommitteeIndex) + require.NoError(t, err) + bl := bitfield.NewBitlist(uint64(len(committee))) + bl.SetBitAt(0, true) + att.AggregationBits = bl + + result, err := service.validateIndexInCommittee(ctx, s, att, committee[0]) + require.NoError(t, err) + assert.Equal(t, pubsub.ValidationAccept, result) +} + func TestVerifySelection_NotAnAggregator(t *testing.T) { ctx := context.Background() params.SetupTestConfigCleanup(t) diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index 860b0d8a2ba7..79a86f83bf60 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -217,7 +217,7 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, b ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttTopic") defer span.End() - valCount, result, err := s.validateCommitteeIndex(ctx, a, bs) + _, valCount, result, err := s.validateCommitteeIndex(ctx, a, bs) if result != pubsub.ValidationAccept { return result, err } @@ -235,16 +235,35 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, b return pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndex(ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { +func (s *Service) validateCommitteeIndex( + ctx context.Context, + a eth.Att, + bs state.ReadOnlyBeaconState, +) (primitives.CommitteeIndex, uint64, pubsub.ValidationResult, error) { valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.GetData().Slot)) if err != nil { - return 0, pubsub.ValidationIgnore, err + return 0, 0, pubsub.ValidationIgnore, err } count := helpers.SlotCommitteeCount(valCount) if uint64(a.GetData().CommitteeIndex) > count { - return 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.GetData().CommitteeIndex, count) + return 0, 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.GetData().CommitteeIndex, count) + } + + var ci primitives.CommitteeIndex + if a.Version() >= version.Electra { + dataCi := a.GetData().CommitteeIndex + if dataCi != 0 { + return 0, 0, pubsub.ValidationReject, fmt.Errorf("committee index must be 0 but was %d", dataCi) + } + indices := helpers.CommitteeIndices(a.CommitteeBitsVal()) + if len(indices) != 1 { + return 0, 0, pubsub.ValidationReject, fmt.Errorf("exactly 1 committee index must be set but %d were set", len(indices)) + } + ci = indices[0] + } else { + ci = a.GetData().CommitteeIndex } - return valCount, pubsub.ValidationAccept, nil + return ci, valCount, pubsub.ValidationAccept, nil } // This validates beacon unaggregated attestation using the given state, the validation consists of bitfield length and count consistency diff --git a/beacon-chain/sync/validate_beacon_attestation_electra.go b/beacon-chain/sync/validate_beacon_attestation_electra.go index 3ed3fe9c1899..e0693f0f3d91 100644 --- a/beacon-chain/sync/validate_beacon_attestation_electra.go +++ b/beacon-chain/sync/validate_beacon_attestation_electra.go @@ -11,6 +11,9 @@ import ( "go.opencensus.io/trace" ) +// validateCommitteeIndexElectra implements the following checks from the spec: +// - [REJECT] len(committee_indices) == 1, where committee_indices = get_committee_indices(attestation). +// - [REJECT] attestation.data.index == 0 func validateCommitteeIndexElectra(ctx context.Context, a *ethpb.AttestationElectra) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { _, span := trace.StartSpan(ctx, "sync.validateCommitteeIndexElectra") defer span.End() From e3d27f29c79da09b686616b595eb714ddcaa9637 Mon Sep 17 00:00:00 2001 From: terence Date: Fri, 9 Aug 2024 10:04:43 -0700 Subject: [PATCH 244/325] Refactor get local payload (#14327) * Refactor get local payload * Fix go lint: new line --- .../validator/proposer_execution_payload.go | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 78db18d85c14..1d87e299ec78 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -59,14 +59,26 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe slot := blk.Slot() vIdx := blk.ProposerIndex() headRoot := blk.ParentRoot() + + return vs.getLocalPayloadFromEngine(ctx, st, headRoot, slot, vIdx) +} + +// This returns the local execution payload of a slot, proposer ID, and parent root assuming payload Is cached. +// If the payload ID is not cached, the function will prepare a new payload through local EL engine and return it by using the head state. +func (vs *Server) getLocalPayloadFromEngine( + ctx context.Context, + st state.BeaconState, + parentRoot [32]byte, + slot primitives.Slot, + proposerId primitives.ValidatorIndex) (*consensusblocks.GetPayloadResponse, error) { logFields := logrus.Fields{ - "validatorIndex": vIdx, + "validatorIndex": proposerId, "slot": slot, - "headRoot": fmt.Sprintf("%#x", headRoot), + "headRoot": fmt.Sprintf("%#x", parentRoot), } - payloadId, ok := vs.PayloadIDCache.PayloadID(slot, headRoot) + payloadId, ok := vs.PayloadIDCache.PayloadID(slot, parentRoot) - val, tracked := vs.TrackedValidatorsCache.Validator(vIdx) + val, tracked := vs.TrackedValidatorsCache.Validator(proposerId) if !tracked { logrus.WithFields(logFields).Warn("could not find tracked proposer index") } @@ -135,7 +147,7 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe PrevRandao: random, SuggestedFeeRecipient: val.FeeRecipient[:], Withdrawals: withdrawals, - ParentBeaconBlockRoot: headRoot[:], + ParentBeaconBlockRoot: parentRoot[:], }) if err != nil { return nil, err From 2a44e8e6ec1e88236115d3a923a4e67e672744cc Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:36:03 -0500 Subject: [PATCH 245/325] test util functions for electra field generation (#14320) * adding some util functions for electra field generation * linting * adding missed linting --- beacon-chain/blockchain/process_block_test.go | 10 +- testing/util/block.go | 76 +++++-- testing/util/electra_block.go | 198 ++++++++++++++++-- 3 files changed, 250 insertions(+), 34 deletions(-) diff --git a/beacon-chain/blockchain/process_block_test.go b/beacon-chain/blockchain/process_block_test.go index 8d47d014cea5..886fb1b1fcf2 100644 --- a/beacon-chain/blockchain/process_block_test.go +++ b/beacon-chain/blockchain/process_block_test.go @@ -2044,7 +2044,11 @@ func TestOnBlock_HandleBlockAttestations(t *testing.T) { st, err = service.HeadState(ctx) require.NoError(t, err) - b, err := util.GenerateFullBlockElectra(st, keys, util.DefaultBlockGenConfig(), 1) + defaultConfig := util.DefaultBlockGenConfig() + defaultConfig.NumWithdrawalRequests = 1 + defaultConfig.NumDepositRequests = 2 + defaultConfig.NumConsolidationRequests = 1 + b, err := util.GenerateFullBlockElectra(st, keys, defaultConfig, 1) require.NoError(t, err) wsb, err := consensusblocks.NewSignedBeaconBlock(b) require.NoError(t, err) @@ -2059,7 +2063,7 @@ func TestOnBlock_HandleBlockAttestations(t *testing.T) { st, err = service.HeadState(ctx) require.NoError(t, err) - b, err = util.GenerateFullBlockElectra(st, keys, util.DefaultBlockGenConfig(), 2) + b, err = util.GenerateFullBlockElectra(st, keys, defaultConfig, 2) require.NoError(t, err) wsb, err = consensusblocks.NewSignedBeaconBlock(b) require.NoError(t, err) @@ -2067,7 +2071,7 @@ func TestOnBlock_HandleBlockAttestations(t *testing.T) { // prepare another block that is not inserted st3, err := transition.ExecuteStateTransition(ctx, st, wsb) require.NoError(t, err) - b3, err := util.GenerateFullBlockElectra(st3, keys, util.DefaultBlockGenConfig(), 3) + b3, err := util.GenerateFullBlockElectra(st3, keys, defaultConfig, 3) require.NoError(t, err) wsb3, err := consensusblocks.NewSignedBeaconBlock(b3) require.NoError(t, err) diff --git a/testing/util/block.go b/testing/util/block.go index 80a897f829fe..372647b48699 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -2,8 +2,11 @@ package util import ( "context" + rd "crypto/rand" "fmt" + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" @@ -30,27 +33,35 @@ import ( // BlockGenConfig is used to define the requested conditions // for block generation. type BlockGenConfig struct { - NumProposerSlashings uint64 - NumAttesterSlashings uint64 - NumAttestations uint64 - NumDeposits uint64 - NumVoluntaryExits uint64 - NumTransactions uint64 // Only for post Bellatrix blocks - FullSyncAggregate bool - NumBLSChanges uint64 // Only for post Capella blocks + NumProposerSlashings uint64 + NumAttesterSlashings uint64 + NumAttestations uint64 + NumDeposits uint64 + NumVoluntaryExits uint64 + NumTransactions uint64 // Only for post Bellatrix blocks + FullSyncAggregate bool + NumBLSChanges uint64 // Only for post Capella blocks + NumWithdrawals uint64 + NumDepositRequests uint64 // Only for post Electra blocks + NumWithdrawalRequests uint64 // Only for post Electra blocks + NumConsolidationRequests uint64 // Only for post Electra blocks } // DefaultBlockGenConfig returns the block config that utilizes the // current params in the beacon config. func DefaultBlockGenConfig() *BlockGenConfig { return &BlockGenConfig{ - NumProposerSlashings: 0, - NumAttesterSlashings: 0, - NumAttestations: 1, - NumDeposits: 0, - NumVoluntaryExits: 0, - NumTransactions: 0, - NumBLSChanges: 0, + NumProposerSlashings: 0, + NumAttesterSlashings: 0, + NumAttestations: 1, + NumDeposits: 0, + NumVoluntaryExits: 0, + NumTransactions: 0, + NumBLSChanges: 0, + NumWithdrawals: 0, + NumConsolidationRequests: 0, + NumWithdrawalRequests: 0, + NumDepositRequests: 0, } } @@ -487,6 +498,41 @@ func randValIndex(bState state.BeaconState) (primitives.ValidatorIndex, error) { return primitives.ValidatorIndex(rand.NewGenerator().Uint64() % activeCount), nil } +func generateWithdrawals( + bState state.BeaconState, + privs []bls.SecretKey, + numWithdrawals uint64, +) ([]*enginev1.Withdrawal, error) { + withdrawalRequests := make([]*enginev1.Withdrawal, numWithdrawals) + for i := uint64(0); i < numWithdrawals; i++ { + valIndex, err := randValIndex(bState) + if err != nil { + return nil, err + } + amount := uint64(10000) + bal, err := bState.BalanceAtIndex(valIndex) + if err != nil { + return nil, err + } + amounts := []uint64{ + amount, // some smaller amount + bal, // the entire balance + } + // Get a random index + nBig, err := rd.Int(rd.Reader, big.NewInt(int64(len(amounts)))) + if err != nil { + return nil, err + } + randomIndex := nBig.Uint64() + withdrawalRequests[i] = &enginev1.Withdrawal{ + ValidatorIndex: valIndex, + Address: make([]byte, common.AddressLength), + Amount: amounts[randomIndex], + } + } + return withdrawalRequests, nil +} + // HydrateSignedBeaconHeader hydrates a signed beacon block header with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateSignedBeaconHeader(h *ethpb.SignedBeaconBlockHeader) *ethpb.SignedBeaconBlockHeader { diff --git a/testing/util/electra_block.go b/testing/util/electra_block.go index e285fdfc2a2c..d74bfefa3943 100644 --- a/testing/util/electra_block.go +++ b/testing/util/electra_block.go @@ -2,11 +2,15 @@ package util import ( "context" + "crypto/rand" "fmt" + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -108,7 +112,6 @@ func GenerateFullBlockElectra( for i := uint64(0); i < numToGen; i++ { newTransactions[i] = bytesutil.Uint64ToBytesLittleEndian(i) } - newWithdrawals := make([]*v1.Withdrawal, 0) random, err := helpers.RandaoMix(bState, time.CurrentEpoch(bState)) if err != nil { @@ -126,25 +129,59 @@ func GenerateFullBlockElectra( return nil, err } + newWithdrawals := make([]*v1.Withdrawal, 0) + if conf.NumWithdrawals > 0 { + newWithdrawals, err = generateWithdrawals(bState, privs, numToGen) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d withdrawals:", numToGen) + } + } + + depositRequests := make([]*v1.DepositRequest, 0) + if conf.NumDepositRequests > 0 { + depositRequests, err = generateDepositRequests(bState, privs, conf.NumDepositRequests) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d deposit requests:", conf.NumDepositRequests) + } + } + + withdrawalRequests := make([]*v1.WithdrawalRequest, 0) + if conf.NumWithdrawalRequests > 0 { + withdrawalRequests, err = generateWithdrawalRequests(bState, privs, conf.NumWithdrawalRequests) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d withdrawal requests:", conf.NumWithdrawalRequests) + } + } + + consolidationRequests := make([]*v1.ConsolidationRequest, 0) + if conf.NumConsolidationRequests > 0 { + consolidationRequests, err = generateConsolidationRequests(bState, privs, conf.NumConsolidationRequests) + if err != nil { + return nil, errors.Wrapf(err, "failed generating %d consolidation requests:", conf.NumConsolidationRequests) + } + } parentExecution, err := stCopy.LatestExecutionPayloadHeader() if err != nil { return nil, err } blockHash := indexToHash(uint64(slot)) - newExecutionPayloadCapella := &v1.ExecutionPayloadElectra{ - ParentHash: parentExecution.BlockHash(), - FeeRecipient: make([]byte, 20), - StateRoot: params.BeaconConfig().ZeroHash[:], - ReceiptsRoot: params.BeaconConfig().ZeroHash[:], - LogsBloom: make([]byte, 256), - PrevRandao: random, - BlockNumber: uint64(slot), - ExtraData: params.BeaconConfig().ZeroHash[:], - BaseFeePerGas: params.BeaconConfig().ZeroHash[:], - BlockHash: blockHash[:], - Timestamp: uint64(timestamp.Unix()), - Transactions: newTransactions, - Withdrawals: newWithdrawals, + newExecutionPayloadElectra := &v1.ExecutionPayloadElectra{ + ParentHash: parentExecution.BlockHash(), + FeeRecipient: make([]byte, 20), + StateRoot: params.BeaconConfig().ZeroHash[:], + ReceiptsRoot: params.BeaconConfig().ZeroHash[:], + LogsBloom: make([]byte, 256), + PrevRandao: random, + BlockNumber: uint64(slot), + ExtraData: params.BeaconConfig().ZeroHash[:], + BaseFeePerGas: params.BeaconConfig().ZeroHash[:], + BlockHash: blockHash[:], + Timestamp: uint64(timestamp.Unix()), + Transactions: newTransactions, + Withdrawals: newWithdrawals, + DepositRequests: depositRequests, + WithdrawalRequests: withdrawalRequests, + ConsolidationRequests: consolidationRequests, } var syncCommitteeBits []byte currSize := new(ethpb.SyncAggregate).SyncCommitteeBits.Len() @@ -208,7 +245,7 @@ func GenerateFullBlockElectra( Deposits: newDeposits, Graffiti: make([]byte, fieldparams.RootLength), SyncAggregate: newSyncAggregate, - ExecutionPayload: newExecutionPayloadCapella, + ExecutionPayload: newExecutionPayloadElectra, BlsToExecutionChanges: changes, }, } @@ -221,3 +258,132 @@ func GenerateFullBlockElectra( return ðpb.SignedBeaconBlockElectra{Block: block, Signature: signature.Marshal()}, nil } + +func generateWithdrawalRequests( + bState state.BeaconState, + privs []bls.SecretKey, + numRequests uint64, +) ([]*v1.WithdrawalRequest, error) { + withdrawalRequests := make([]*v1.WithdrawalRequest, numRequests) + for i := uint64(0); i < numRequests; i++ { + valIndex, err := randValIndex(bState) + if err != nil { + return nil, err + } + // Get a random index + nBig, err := rand.Int(rand.Reader, big.NewInt(60000)) + if err != nil { + return nil, err + } + amount := nBig.Uint64() // random amount created + bal, err := bState.BalanceAtIndex(valIndex) + if err != nil { + return nil, err + } + amounts := []uint64{ + amount, // some smaller amount + bal, // the entire balance + } + // Get a random index + nBig, err = rand.Int(rand.Reader, big.NewInt(int64(len(amounts)))) + if err != nil { + return nil, err + } + randomIndex := nBig.Uint64() + withdrawalRequests[i] = &v1.WithdrawalRequest{ + ValidatorPubkey: privs[valIndex].PublicKey().Marshal(), + SourceAddress: make([]byte, common.AddressLength), + Amount: amounts[randomIndex], + } + } + return withdrawalRequests, nil +} + +func generateDepositRequests( + bState state.BeaconState, + privs []bls.SecretKey, + numRequests uint64, +) ([]*v1.DepositRequest, error) { + depositRequests := make([]*v1.DepositRequest, numRequests) + for i := uint64(0); i < numRequests; i++ { + valIndex, err := randValIndex(bState) + if err != nil { + return nil, err + } + // Get a random index + nBig, err := rand.Int(rand.Reader, big.NewInt(60000)) + if err != nil { + return nil, err + } + amount := nBig.Uint64() // random amount created + prefixes := []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0, params.BeaconConfig().BLSWithdrawalPrefixByte} + withdrawalCred := make([]byte, 32) + // Get a random index + nBig, err = rand.Int(rand.Reader, big.NewInt(int64(len(prefixes)))) + if err != nil { + return nil, err + } + randPrefixIndex := nBig.Uint64() + withdrawalCred[0] = prefixes[randPrefixIndex] + + depositMessage := ðpb.DepositMessage{ + PublicKey: privs[valIndex].PublicKey().Marshal(), + Amount: amount, + WithdrawalCredentials: withdrawalCred, + } + domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil) + if err != nil { + return nil, err + } + sr, err := signing.ComputeSigningRoot(depositMessage, domain) + if err != nil { + return nil, err + } + sig := privs[i].Sign(sr[:]) + depositRequests[i] = &v1.DepositRequest{ + Pubkey: depositMessage.PublicKey, + Index: uint64(valIndex), + WithdrawalCredentials: depositMessage.WithdrawalCredentials, + Amount: depositMessage.Amount, + Signature: sig.Marshal(), + } + } + return depositRequests, nil +} + +func generateConsolidationRequests( + bState state.BeaconState, + privs []bls.SecretKey, + numRequests uint64, +) ([]*v1.ConsolidationRequest, error) { + consolidationRequests := make([]*v1.ConsolidationRequest, numRequests) + for i := uint64(0); i < numRequests; i++ { + valIndex, err := randValIndex(bState) + if err != nil { + return nil, err + } + valIndex2, err := randValIndex(bState) + if err != nil { + return nil, err + } + source, err := randomAddress() + if err != nil { + return nil, err + } + consolidationRequests[i] = &v1.ConsolidationRequest{ + TargetPubkey: privs[valIndex2].PublicKey().Marshal(), + SourceAddress: source.Bytes(), + SourcePubkey: privs[valIndex].PublicKey().Marshal(), + } + } + return consolidationRequests, nil +} + +func randomAddress() (common.Address, error) { + b := make([]byte, 20) + _, err := rand.Read(b) + if err != nil { + return common.Address{}, err + } + return common.BytesToAddress(b), nil +} From fad92472d87a47f3ad28abbf32df8391ce0345f8 Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:25:43 +0900 Subject: [PATCH 246/325] fix(tests): Fix v1alpha1/node/server_test.go (#14321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --- .../p2p/testing/mock_peersprovider.go | 9 ++++-- .../rpc/prysm/v1alpha1/node/server_test.go | 28 +++++++++++++++---- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/beacon-chain/p2p/testing/mock_peersprovider.go b/beacon-chain/p2p/testing/mock_peersprovider.go index d41e4a55b2d2..1e2eca27bb94 100644 --- a/beacon-chain/p2p/testing/mock_peersprovider.go +++ b/beacon-chain/p2p/testing/mock_peersprovider.go @@ -16,6 +16,11 @@ import ( log "github.com/sirupsen/logrus" ) +const ( + MockRawPeerId0 = "16Uiu2HAkyWZ4Ni1TpvDS8dPxsozmHY85KaiFjodQuV6Tz5tkHVeR" + MockRawPeerId1 = "16Uiu2HAm4HgJ9N1o222xK61o7LSgToYWoAy1wNTJRkh9gLZapVAy" +) + // MockPeersProvider implements PeersProvider for testing. type MockPeersProvider struct { lock sync.Mutex @@ -50,7 +55,7 @@ func (m *MockPeersProvider) Peers() *peers.Status { }, }) // Pretend we are connected to two peers - id0, err := peer.Decode("16Uiu2HAkyWZ4Ni1TpvDS8dPxsozmHY85KaiFjodQuV6Tz5tkHVeR") + id0, err := peer.Decode(MockRawPeerId0) if err != nil { log.WithError(err).Debug("Cannot decode") } @@ -61,7 +66,7 @@ func (m *MockPeersProvider) Peers() *peers.Status { m.peers.Add(createENR(), id0, ma0, network.DirInbound) m.peers.SetConnectionState(id0, peers.PeerConnected) m.peers.SetChainState(id0, &pb.Status{FinalizedEpoch: 10}) - id1, err := peer.Decode("16Uiu2HAm4HgJ9N1o222xK61o7LSgToYWoAy1wNTJRkh9gLZapVAy") + id1, err := peer.Decode(MockRawPeerId1) if err != nil { log.WithError(err).Debug("Cannot decode") } diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index 1d99a2e7b3ab..5783fc29a646 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -128,13 +128,12 @@ func TestNodeServer_GetPeer(t *testing.T) { } ethpb.RegisterNodeServer(server, ns) reflection.Register(server) - firstPeer := peersProvider.Peers().All()[0] - res, err := ns.GetPeer(context.Background(), ðpb.PeerRequest{PeerId: firstPeer.String()}) + res, err := ns.GetPeer(context.Background(), ðpb.PeerRequest{PeerId: mockP2p.MockRawPeerId0}) require.NoError(t, err) - assert.Equal(t, firstPeer.String(), res.PeerId, "Unexpected peer ID") + assert.Equal(t, "16Uiu2HAkyWZ4Ni1TpvDS8dPxsozmHY85KaiFjodQuV6Tz5tkHVeR" /* first peer's raw id */, res.PeerId, "Unexpected peer ID") assert.Equal(t, int(ethpb.PeerDirection_INBOUND), int(res.Direction), "Expected 1st peer to be an inbound connection") - assert.Equal(t, ethpb.ConnectionState_CONNECTED, res.ConnectionState, "Expected peer to be connected") + assert.Equal(t, int(ethpb.ConnectionState_CONNECTED), int(res.ConnectionState), "Expected peer to be connected") } func TestNodeServer_ListPeers(t *testing.T) { @@ -149,8 +148,25 @@ func TestNodeServer_ListPeers(t *testing.T) { res, err := ns.ListPeers(context.Background(), &emptypb.Empty{}) require.NoError(t, err) assert.Equal(t, 2, len(res.Peers)) - assert.Equal(t, int(ethpb.PeerDirection_INBOUND), int(res.Peers[0].Direction)) - assert.Equal(t, ethpb.PeerDirection_OUTBOUND, res.Peers[1].Direction) + + var ( + firstPeer *ethpb.Peer + secondPeer *ethpb.Peer + ) + + for _, p := range res.Peers { + if p.PeerId == mockP2p.MockRawPeerId0 { + firstPeer = p + } + if p.PeerId == mockP2p.MockRawPeerId1 { + secondPeer = p + } + } + + assert.NotNil(t, firstPeer) + assert.NotNil(t, secondPeer) + assert.Equal(t, int(ethpb.PeerDirection_INBOUND), int(firstPeer.Direction)) + assert.Equal(t, int(ethpb.PeerDirection_OUTBOUND), int(secondPeer.Direction)) } func TestNodeServer_GetETH1ConnectionStatus(t *testing.T) { From 0c6a068fd5f9ecd4a3ba854bb355730266007fa7 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:16:19 +0200 Subject: [PATCH 247/325] Remove identical beacon state (#14338) * rename + delete * remove ref --- beacon-chain/state/state-native/BUILD.bazel | 3 +- ...eacon_state_minimal.go => beacon_state.go} | 2 - .../state-native/beacon_state_mainnet.go | 203 ------------------ 3 files changed, 1 insertion(+), 207 deletions(-) rename beacon-chain/state/state-native/{beacon_state_minimal.go => beacon_state.go} (99%) delete mode 100644 beacon-chain/state/state-native/beacon_state_mainnet.go diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index da2f397025f1..85de3ebd0aeb 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -3,8 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ - "beacon_state_mainnet.go", - "beacon_state_minimal.go", # keep + "beacon_state.go", "doc.go", "error.go", "getters_attestation.go", diff --git a/beacon-chain/state/state-native/beacon_state_minimal.go b/beacon-chain/state/state-native/beacon_state.go similarity index 99% rename from beacon-chain/state/state-native/beacon_state_minimal.go rename to beacon-chain/state/state-native/beacon_state.go index ad5a51d9349f..d10325929e34 100644 --- a/beacon-chain/state/state-native/beacon_state_minimal.go +++ b/beacon-chain/state/state-native/beacon_state.go @@ -1,5 +1,3 @@ -//go:build minimal - package state_native import ( diff --git a/beacon-chain/state/state-native/beacon_state_mainnet.go b/beacon-chain/state/state-native/beacon_state_mainnet.go deleted file mode 100644 index 922f870989d0..000000000000 --- a/beacon-chain/state/state-native/beacon_state_mainnet.go +++ /dev/null @@ -1,203 +0,0 @@ -//go:build !minimal - -package state_native - -import ( - "encoding/json" - "sync" - - "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/fieldtrie" - customtypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/custom-types" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" - "github.com/prysmaticlabs/prysm/v5/config/features" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" -) - -// BeaconState defines a struct containing utilities for the Ethereum Beacon Chain state, defining -// getters and setters for its respective values and helpful functions such as HashTreeRoot(). -type BeaconState struct { - version int - genesisTime uint64 - genesisValidatorsRoot [32]byte - slot primitives.Slot - fork *ethpb.Fork - latestBlockHeader *ethpb.BeaconBlockHeader - blockRoots customtypes.BlockRoots - blockRootsMultiValue *MultiValueBlockRoots - stateRoots customtypes.StateRoots - stateRootsMultiValue *MultiValueStateRoots - historicalRoots customtypes.HistoricalRoots - historicalSummaries []*ethpb.HistoricalSummary - eth1Data *ethpb.Eth1Data - eth1DataVotes []*ethpb.Eth1Data - eth1DepositIndex uint64 - validators []*ethpb.Validator - validatorsMultiValue *MultiValueValidators - balances []uint64 - balancesMultiValue *MultiValueBalances - randaoMixes customtypes.RandaoMixes - randaoMixesMultiValue *MultiValueRandaoMixes - slashings []uint64 - previousEpochAttestations []*ethpb.PendingAttestation - currentEpochAttestations []*ethpb.PendingAttestation - previousEpochParticipation []byte - currentEpochParticipation []byte - justificationBits bitfield.Bitvector4 - previousJustifiedCheckpoint *ethpb.Checkpoint - currentJustifiedCheckpoint *ethpb.Checkpoint - finalizedCheckpoint *ethpb.Checkpoint - inactivityScores []uint64 - inactivityScoresMultiValue *MultiValueInactivityScores - currentSyncCommittee *ethpb.SyncCommittee - nextSyncCommittee *ethpb.SyncCommittee - latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader - latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella - latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb - latestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra - nextWithdrawalIndex uint64 - nextWithdrawalValidatorIndex primitives.ValidatorIndex - - // Electra fields - depositRequestsStartIndex uint64 - depositBalanceToConsume primitives.Gwei - exitBalanceToConsume primitives.Gwei - earliestExitEpoch primitives.Epoch - consolidationBalanceToConsume primitives.Gwei - earliestConsolidationEpoch primitives.Epoch - pendingBalanceDeposits []*ethpb.PendingBalanceDeposit // pending_balance_deposits: List[PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT] - pendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal // pending_partial_withdrawals: List[PartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT] - pendingConsolidations []*ethpb.PendingConsolidation // pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT] - - id uint64 - lock sync.RWMutex - dirtyFields map[types.FieldIndex]bool - dirtyIndices map[types.FieldIndex][]uint64 - stateFieldLeaves map[types.FieldIndex]*fieldtrie.FieldTrie - rebuildTrie map[types.FieldIndex]bool - valMapHandler *stateutil.ValidatorMapHandler - validatorIndexCache *finalizedValidatorIndexCache - merkleLayers [][][]byte - sharedFieldReferences map[types.FieldIndex]*stateutil.Reference -} - -type beaconStateMarshalable struct { - Version int `json:"version" yaml:"version"` - GenesisTime uint64 `json:"genesis_time" yaml:"genesis_time"` - GenesisValidatorsRoot [32]byte `json:"genesis_validators_root" yaml:"genesis_validators_root"` - Slot primitives.Slot `json:"slot" yaml:"slot"` - Fork *ethpb.Fork `json:"fork" yaml:"fork"` - LatestBlockHeader *ethpb.BeaconBlockHeader `json:"latest_block_header" yaml:"latest_block_header"` - BlockRoots customtypes.BlockRoots `json:"block_roots" yaml:"block_roots"` - StateRoots customtypes.StateRoots `json:"state_roots" yaml:"state_roots"` - HistoricalRoots customtypes.HistoricalRoots `json:"historical_roots" yaml:"historical_roots"` - HistoricalSummaries []*ethpb.HistoricalSummary `json:"historical_summaries" yaml:"historical_summaries"` - Eth1Data *ethpb.Eth1Data `json:"eth_1_data" yaml:"eth_1_data"` - Eth1DataVotes []*ethpb.Eth1Data `json:"eth_1_data_votes" yaml:"eth_1_data_votes"` - Eth1DepositIndex uint64 `json:"eth_1_deposit_index" yaml:"eth_1_deposit_index"` - Validators []*ethpb.Validator `json:"validators" yaml:"validators"` - Balances []uint64 `json:"balances" yaml:"balances"` - RandaoMixes customtypes.RandaoMixes `json:"randao_mixes" yaml:"randao_mixes"` - Slashings []uint64 `json:"slashings" yaml:"slashings"` - PreviousEpochAttestations []*ethpb.PendingAttestation `json:"previous_epoch_attestations" yaml:"previous_epoch_attestations"` - CurrentEpochAttestations []*ethpb.PendingAttestation `json:"current_epoch_attestations" yaml:"current_epoch_attestations"` - PreviousEpochParticipation []byte `json:"previous_epoch_participation" yaml:"previous_epoch_participation"` - CurrentEpochParticipation []byte `json:"current_epoch_participation" yaml:"current_epoch_participation"` - JustificationBits bitfield.Bitvector4 `json:"justification_bits" yaml:"justification_bits"` - PreviousJustifiedCheckpoint *ethpb.Checkpoint `json:"previous_justified_checkpoint" yaml:"previous_justified_checkpoint"` - CurrentJustifiedCheckpoint *ethpb.Checkpoint `json:"current_justified_checkpoint" yaml:"current_justified_checkpoint"` - FinalizedCheckpoint *ethpb.Checkpoint `json:"finalized_checkpoint" yaml:"finalized_checkpoint"` - InactivityScores []uint64 `json:"inactivity_scores" yaml:"inactivity_scores"` - CurrentSyncCommittee *ethpb.SyncCommittee `json:"current_sync_committee" yaml:"current_sync_committee"` - NextSyncCommittee *ethpb.SyncCommittee `json:"next_sync_committee" yaml:"next_sync_committee"` - LatestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader `json:"latest_execution_payload_header" yaml:"latest_execution_payload_header"` - LatestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella `json:"latest_execution_payload_header_capella" yaml:"latest_execution_payload_header_capella"` - LatestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb `json:"latest_execution_payload_header_deneb" yaml:"latest_execution_payload_header_deneb"` - LatestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header_electra" yaml:"latest_execution_payload_header_electra"` - NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` - NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` - DepositRequestsStartIndex uint64 `json:"deposit_requests_start_index" yaml:"deposit_requests_start_index"` - DepositBalanceToConsume primitives.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"` - ExitBalanceToConsume primitives.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"` - EarliestExitEpoch primitives.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"` - ConsolidationBalanceToConsume primitives.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"` - EarliestConsolidationEpoch primitives.Epoch `json:"earliest_consolidation_epoch" yaml:"earliest_consolidation_epoch"` - PendingBalanceDeposits []*ethpb.PendingBalanceDeposit `json:"pending_balance_deposits" yaml:"pending_balance_deposits"` - PendingPartialWithdrawals []*ethpb.PendingPartialWithdrawal `json:"pending_partial_withdrawals" yaml:"pending_partial_withdrawals"` - PendingConsolidations []*ethpb.PendingConsolidation `json:"pending_consolidations" yaml:"pending_consolidations"` -} - -func (b *BeaconState) MarshalJSON() ([]byte, error) { - var bRoots customtypes.BlockRoots - var sRoots customtypes.StateRoots - var mixes customtypes.RandaoMixes - var balances []uint64 - var inactivityScores []uint64 - var vals []*ethpb.Validator - - if features.Get().EnableExperimentalState { - bRoots = b.blockRootsMultiValue.Value(b) - sRoots = b.stateRootsMultiValue.Value(b) - mixes = b.randaoMixesMultiValue.Value(b) - balances = b.balancesMultiValue.Value(b) - inactivityScores = b.inactivityScoresMultiValue.Value(b) - vals = b.validatorsMultiValue.Value(b) - } else { - bRoots = b.blockRoots - sRoots = b.stateRoots - mixes = b.randaoMixes - balances = b.balances - inactivityScores = b.inactivityScores - vals = b.validators - } - - marshalable := &beaconStateMarshalable{ - Version: b.version, - GenesisTime: b.genesisTime, - GenesisValidatorsRoot: b.genesisValidatorsRoot, - Slot: b.slot, - Fork: b.fork, - LatestBlockHeader: b.latestBlockHeader, - BlockRoots: bRoots, - StateRoots: sRoots, - HistoricalRoots: b.historicalRoots, - HistoricalSummaries: b.historicalSummaries, - Eth1Data: b.eth1Data, - Eth1DataVotes: b.eth1DataVotes, - Eth1DepositIndex: b.eth1DepositIndex, - Validators: vals, - Balances: balances, - RandaoMixes: mixes, - Slashings: b.slashings, - PreviousEpochAttestations: b.previousEpochAttestations, - CurrentEpochAttestations: b.currentEpochAttestations, - PreviousEpochParticipation: b.previousEpochParticipation, - CurrentEpochParticipation: b.currentEpochParticipation, - JustificationBits: b.justificationBits, - PreviousJustifiedCheckpoint: b.previousJustifiedCheckpoint, - CurrentJustifiedCheckpoint: b.currentJustifiedCheckpoint, - FinalizedCheckpoint: b.finalizedCheckpoint, - InactivityScores: inactivityScores, - CurrentSyncCommittee: b.currentSyncCommittee, - NextSyncCommittee: b.nextSyncCommittee, - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeader, - LatestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella, - LatestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb, - LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra, - NextWithdrawalIndex: b.nextWithdrawalIndex, - NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, - DepositRequestsStartIndex: b.depositRequestsStartIndex, - DepositBalanceToConsume: b.depositBalanceToConsume, - ExitBalanceToConsume: b.exitBalanceToConsume, - EarliestExitEpoch: b.earliestExitEpoch, - ConsolidationBalanceToConsume: b.consolidationBalanceToConsume, - EarliestConsolidationEpoch: b.earliestConsolidationEpoch, - PendingBalanceDeposits: b.pendingBalanceDeposits, - PendingPartialWithdrawals: b.pendingPartialWithdrawals, - PendingConsolidations: b.pendingConsolidations, - } - return json.Marshal(marshalable) -} From 74ddb84e0a55c4d23275bec33c9bf45882d780c7 Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:16:07 +0530 Subject: [PATCH 248/325] feat: implement ``ComputeFieldRootsForBlockBody`` function (#14278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: (WIP)implement ``ComputeFieldRootsForBlockBody`` function to compute roots of fields in BlockBody * calculate field roots upto ``deposits`` * add some required constants fix some errors * implement ``ComputeFieldRootsForBlockBody`` function for all fields in ``BeaconBlockBody`` * populate `fieldRoots` based on block body version * fix constants * `bazel run //:gazelle -- fix` * remove nested `if`s * formatting 1 Co-authored-by: Radosław Kapka * formatting 2 Co-authored-by: Radosław Kapka * remove unrequired check Co-authored-by: Radosław Kapka * update naming 1 Co-authored-by: Radosław Kapka * update function name * add test for Phase0 block body * update Phase0 test * update phase0 test without setting any fields * fix some errors in Phase0 test * don't set fields * add altair test * add tests upto Electra * fix the function for deneb and newer forks * update dependencies * add checks to ensure interface implements the asserted type --------- Co-authored-by: Radosław Kapka Co-authored-by: Radosław Kapka --- config/fieldparams/mainnet.go | 8 ++ config/fieldparams/minimal.go | 8 ++ config/params/minimal_config.go | 1 + consensus-types/blocks/BUILD.bazel | 4 + consensus-types/blocks/getters_test.go | 129 ++++++++++++++++++ consensus-types/blocks/proofs.go | 174 +++++++++++++++++++++++++ consensus-types/blocks/proofs_test.go | 147 +++++++++++++++++++++ 7 files changed, 471 insertions(+) create mode 100644 consensus-types/blocks/proofs.go create mode 100644 consensus-types/blocks/proofs_test.go diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index 6160fb2b1d51..d66549e381d1 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -39,4 +39,12 @@ const ( MaxDepositRequestsPerPayload = 8192 // Maximum number of deposit requests in an execution payload. MaxWithdrawalRequestsPerPayload = 16 // Maximum number of execution layer withdrawal requests in an execution payload. MaxConsolidationRequestsPerPayload = 1 // Maximum number of consolidation requests in an execution payload. + MaxProposerSlashings = 16 // Maximum number of proposer slashings in a block. + MaxAttesterSlashings = 2 // Maximum number of attester slashings in a block. + MaxAttesterSlashingsElectra = 1 // Maximum number of attester slashings in a block. + MaxAttestations = 128 // Maximum number of attestations in a block. + MaxAttestationsElectra = 8 // Maximum number of attestations in a block. + MaxDeposits = 16 // Maximum number of deposits in a block. + MaxVoluntaryExits = 16 // Maximum number of voluntary exits in a block. + MaxBlsToExecutionChanges = 16 // Maximum number of bls to execution changes in a block. ) diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index d9bc80191532..ee48143e5262 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -39,4 +39,12 @@ const ( MaxDepositRequestsPerPayload = 4 // Maximum number of deposit requests in an execution payload. MaxWithdrawalRequestsPerPayload = 2 // Maximum number of execution layer withdrawal requests in an execution payload. MaxConsolidationRequestsPerPayload = 1 // Maximum number of consolidation requests in an execution payload. + MaxProposerSlashings = 16 // Maximum number of proposer slashings in a block. + MaxAttesterSlashings = 2 // Maximum number of attester slashings in a block. + MaxAttesterSlashingsElectra = 1 // Maximum number of attester slashings in a block. + MaxAttestations = 128 // Maximum number of attestations in a block. + MaxAttestationsElectra = 8 // Maximum number of attestations in a block. + MaxDeposits = 16 // Maximum number of deposits in a block. + MaxVoluntaryExits = 16 // Maximum number of voluntary exits in a block. + MaxBlsToExecutionChanges = 16 // Maximum number of bls to execution changes in a block. ) diff --git a/config/params/minimal_config.go b/config/params/minimal_config.go index 0fd7d0fb378e..d5c3e4b0ada7 100644 --- a/config/params/minimal_config.go +++ b/config/params/minimal_config.go @@ -70,6 +70,7 @@ func MinimalSpecConfig() *BeaconChainConfig { minimalConfig.MaxDeposits = 16 minimalConfig.MaxVoluntaryExits = 16 minimalConfig.MaxWithdrawalsPerPayload = 4 + minimalConfig.MaxBlsToExecutionChanges = 16 minimalConfig.MaxValidatorsPerWithdrawalsSweep = 16 // Signature domains diff --git a/consensus-types/blocks/BUILD.bazel b/consensus-types/blocks/BUILD.bazel index c39b47ed342a..1cf938c92152 100644 --- a/consensus-types/blocks/BUILD.bazel +++ b/consensus-types/blocks/BUILD.bazel @@ -8,6 +8,7 @@ go_library( "get_payload.go", "getters.go", "kzg.go", + "proofs.go", "proto.go", "roblob.go", "roblock.go", @@ -23,6 +24,7 @@ go_library( "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/trie:go_default_library", + "//crypto/hash/htr:go_default_library", "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", "//proto/engine/v1:go_default_library", @@ -32,6 +34,7 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_gohashtree//:go_default_library", + "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) @@ -43,6 +46,7 @@ go_test( "factory_test.go", "getters_test.go", "kzg_test.go", + "proofs_test.go", "proto_test.go", "roblob_test.go", "roblock_test.go", diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index 826db3bc13e6..22249ba54218 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -503,6 +503,135 @@ func hydrateBeaconBlockBody() *eth.BeaconBlockBody { } } +func hydrateBeaconBlockBodyAltair() *eth.BeaconBlockBodyAltair { + return ð.BeaconBlockBodyAltair{ + RandaoReveal: make([]byte, fieldparams.BLSSignatureLength), + Graffiti: make([]byte, fieldparams.RootLength), + Eth1Data: ð.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: make([]byte, 64), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + } +} + +func hydrateBeaconBlockBodyBellatrix() *eth.BeaconBlockBodyBellatrix { + return ð.BeaconBlockBodyBellatrix{ + RandaoReveal: make([]byte, fieldparams.BLSSignatureLength), + Graffiti: make([]byte, fieldparams.RootLength), + Eth1Data: ð.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: make([]byte, 64), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + ExecutionPayload: &pb.ExecutionPayload{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + }, + } +} + +func hydrateBeaconBlockBodyCapella() *eth.BeaconBlockBodyCapella { + return ð.BeaconBlockBodyCapella{ + RandaoReveal: make([]byte, fieldparams.BLSSignatureLength), + Graffiti: make([]byte, fieldparams.RootLength), + Eth1Data: ð.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncAggregateSyncCommitteeBytesLength), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + ExecutionPayload: &pb.ExecutionPayloadCapella{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*pb.Withdrawal, 0), + }, + } +} + +func hydrateBeaconBlockBodyDeneb() *eth.BeaconBlockBodyDeneb { + return ð.BeaconBlockBodyDeneb{ + RandaoReveal: make([]byte, fieldparams.BLSSignatureLength), + Graffiti: make([]byte, fieldparams.RootLength), + Eth1Data: ð.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncAggregateSyncCommitteeBytesLength), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + ExecutionPayload: &pb.ExecutionPayloadDeneb{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*pb.Withdrawal, 0), + }, + } +} + +func hydrateBeaconBlockBodyElectra() *eth.BeaconBlockBodyElectra { + return ð.BeaconBlockBodyElectra{ + RandaoReveal: make([]byte, fieldparams.BLSSignatureLength), + Graffiti: make([]byte, fieldparams.RootLength), + Eth1Data: ð.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncAggregateSyncCommitteeBytesLength), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + ExecutionPayload: &pb.ExecutionPayloadElectra{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*pb.Withdrawal, 0), + DepositRequests: make([]*pb.DepositRequest, 0), + WithdrawalRequests: make([]*pb.WithdrawalRequest, 0), + ConsolidationRequests: make([]*pb.ConsolidationRequest, 0), + }, + } +} + func TestPreElectraFailsInterfaceAssertion(t *testing.T) { var epd interfaces.ExecutionData = &executionPayloadDeneb{} _, ok := epd.(interfaces.ExecutionDataElectra) diff --git a/consensus-types/blocks/proofs.go b/consensus-types/blocks/proofs.go new file mode 100644 index 000000000000..b3181da579ce --- /dev/null +++ b/consensus-types/blocks/proofs.go @@ -0,0 +1,174 @@ +package blocks + +import ( + "context" + "encoding/binary" + "fmt" + + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/crypto/hash/htr" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "go.opencensus.io/trace" +) + +func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) ([][]byte, error) { + _, span := trace.StartSpan(ctx, "blocks.ComputeBlockBodyFieldRoots") + defer span.End() + + if blockBody == nil { + return nil, errNilBlockBody + } + + var fieldRoots [][]byte + switch blockBody.version { + case version.Phase0: + fieldRoots = make([][]byte, 8) + case version.Altair: + fieldRoots = make([][]byte, 9) + case version.Bellatrix: + fieldRoots = make([][]byte, 10) + case version.Capella: + fieldRoots = make([][]byte, 11) + case version.Deneb: + fieldRoots = make([][]byte, 12) + case version.Electra: + fieldRoots = make([][]byte, 12) + default: + return nil, fmt.Errorf("unknown block body version %s", version.String(blockBody.version)) + } + + for i := range fieldRoots { + fieldRoots[i] = make([]byte, 32) + } + + // Randao Reveal + randao := blockBody.RandaoReveal() + root, err := ssz.MerkleizeByteSliceSSZ(randao[:]) + if err != nil { + return nil, err + } + copy(fieldRoots[0], root[:]) + + // eth1_data + eth1 := blockBody.Eth1Data() + root, err = eth1.HashTreeRoot() + if err != nil { + return nil, err + } + copy(fieldRoots[1], root[:]) + + // graffiti + root = blockBody.Graffiti() + copy(fieldRoots[2], root[:]) + + // Proposer slashings + ps := blockBody.ProposerSlashings() + root, err = ssz.MerkleizeListSSZ(ps, params.BeaconConfig().MaxProposerSlashings) + if err != nil { + return nil, err + } + copy(fieldRoots[3], root[:]) + + // Attester slashings + as := blockBody.AttesterSlashings() + bodyVersion := blockBody.Version() + if bodyVersion < version.Electra { + root, err = ssz.MerkleizeListSSZ(as, params.BeaconConfig().MaxAttesterSlashings) + } else { + root, err = ssz.MerkleizeListSSZ(as, params.BeaconConfig().MaxAttesterSlashingsElectra) + } + if err != nil { + return nil, err + } + copy(fieldRoots[4], root[:]) + + // Attestations + att := blockBody.Attestations() + if bodyVersion < version.Electra { + root, err = ssz.MerkleizeListSSZ(att, params.BeaconConfig().MaxAttestations) + } else { + root, err = ssz.MerkleizeListSSZ(att, params.BeaconConfig().MaxAttestationsElectra) + } + if err != nil { + return nil, err + } + copy(fieldRoots[5], root[:]) + + // Deposits + dep := blockBody.Deposits() + root, err = ssz.MerkleizeListSSZ(dep, params.BeaconConfig().MaxDeposits) + if err != nil { + return nil, err + } + copy(fieldRoots[6], root[:]) + + // Voluntary Exits + ve := blockBody.VoluntaryExits() + root, err = ssz.MerkleizeListSSZ(ve, params.BeaconConfig().MaxVoluntaryExits) + if err != nil { + return nil, err + } + copy(fieldRoots[7], root[:]) + + if blockBody.version >= version.Altair { + // Sync Aggregate + sa, err := blockBody.SyncAggregate() + if err != nil { + return nil, err + } + root, err = sa.HashTreeRoot() + if err != nil { + return nil, err + } + copy(fieldRoots[8], root[:]) + } + + if blockBody.version >= version.Bellatrix { + // Execution Payload + ep, err := blockBody.Execution() + if err != nil { + return nil, err + } + root, err = ep.HashTreeRoot() + if err != nil { + return nil, err + } + copy(fieldRoots[9], root[:]) + } + + if blockBody.version >= version.Capella { + // BLS Changes + bls, err := blockBody.BLSToExecutionChanges() + if err != nil { + return nil, err + } + root, err = ssz.MerkleizeListSSZ(bls, params.BeaconConfig().MaxBlsToExecutionChanges) + if err != nil { + return nil, err + } + copy(fieldRoots[10], root[:]) + } + + if blockBody.version >= version.Deneb { + // KZG commitments + roots := make([][32]byte, len(blockBody.blobKzgCommitments)) + for i, commitment := range blockBody.blobKzgCommitments { + chunks, err := ssz.PackByChunk([][]byte{commitment}) + if err != nil { + return nil, err + } + roots[i] = htr.VectorizedSha256(chunks)[0] + } + commitmentsRoot, err := ssz.BitwiseMerkleize(roots, uint64(len(roots)), 4096) + if err != nil { + return nil, err + } + length := make([]byte, 32) + binary.LittleEndian.PutUint64(length[:8], uint64(len(roots))) + root = ssz.MixInLength(commitmentsRoot, length) + copy(fieldRoots[11], root[:]) + } + + return fieldRoots, nil +} diff --git a/consensus-types/blocks/proofs_test.go b/consensus-types/blocks/proofs_test.go new file mode 100644 index 000000000000..ad3067024e42 --- /dev/null +++ b/consensus-types/blocks/proofs_test.go @@ -0,0 +1,147 @@ +package blocks + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/container/trie" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestComputeBlockBodyFieldRoots_Phase0(t *testing.T) { + blockBodyPhase0 := hydrateBeaconBlockBody() + i, err := NewBeaconBlockBody(blockBodyPhase0) + require.NoError(t, err) + + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + + fieldRoots, err := ComputeBlockBodyFieldRoots(context.Background(), b) + require.NoError(t, err) + trie, err := trie.GenerateTrieFromItems(fieldRoots, 3) + require.NoError(t, err) + layers := trie.ToProto().GetLayers() + + hash := layers[len(layers)-1].Layer[0] + require.NoError(t, err) + + correctHash, err := b.HashTreeRoot() + require.NoError(t, err) + + require.DeepEqual(t, correctHash[:], hash) +} + +func TestComputeBlockBodyFieldRoots_Altair(t *testing.T) { + blockBodyAltair := hydrateBeaconBlockBodyAltair() + i, err := NewBeaconBlockBody(blockBodyAltair) + require.NoError(t, err) + + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + + fieldRoots, err := ComputeBlockBodyFieldRoots(context.Background(), b) + require.NoError(t, err) + trie, err := trie.GenerateTrieFromItems(fieldRoots, 4) + require.NoError(t, err) + layers := trie.ToProto().GetLayers() + + hash := layers[len(layers)-1].Layer[0] + require.NoError(t, err) + + correctHash, err := b.HashTreeRoot() + require.NoError(t, err) + + require.DeepEqual(t, correctHash[:], hash) +} + +func TestComputeBlockBodyFieldRoots_Bellatrix(t *testing.T) { + blockBodyBellatrix := hydrateBeaconBlockBodyBellatrix() + i, err := NewBeaconBlockBody(blockBodyBellatrix) + require.NoError(t, err) + + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + + fieldRoots, err := ComputeBlockBodyFieldRoots(context.Background(), b) + require.NoError(t, err) + trie, err := trie.GenerateTrieFromItems(fieldRoots, 4) + require.NoError(t, err) + layers := trie.ToProto().GetLayers() + + hash := layers[len(layers)-1].Layer[0] + require.NoError(t, err) + + correctHash, err := b.HashTreeRoot() + require.NoError(t, err) + + require.DeepEqual(t, correctHash[:], hash) +} + +func TestComputeBlockBodyFieldRoots_Capella(t *testing.T) { + blockBodyCapella := hydrateBeaconBlockBodyCapella() + i, err := NewBeaconBlockBody(blockBodyCapella) + require.NoError(t, err) + + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + + fieldRoots, err := ComputeBlockBodyFieldRoots(context.Background(), b) + require.NoError(t, err) + trie, err := trie.GenerateTrieFromItems(fieldRoots, 4) + require.NoError(t, err) + layers := trie.ToProto().GetLayers() + + hash := layers[len(layers)-1].Layer[0] + require.NoError(t, err) + + correctHash, err := b.HashTreeRoot() + require.NoError(t, err) + + require.DeepEqual(t, correctHash[:], hash) +} + +func TestComputeBlockBodyFieldRoots_Deneb(t *testing.T) { + blockBodyDeneb := hydrateBeaconBlockBodyDeneb() + i, err := NewBeaconBlockBody(blockBodyDeneb) + require.NoError(t, err) + + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + + fieldRoots, err := ComputeBlockBodyFieldRoots(context.Background(), b) + require.NoError(t, err) + trie, err := trie.GenerateTrieFromItems(fieldRoots, 4) + require.NoError(t, err) + layers := trie.ToProto().GetLayers() + + hash := layers[len(layers)-1].Layer[0] + require.NoError(t, err) + + correctHash, err := b.HashTreeRoot() + require.NoError(t, err) + + require.DeepEqual(t, correctHash[:], hash) +} + +func TestComputeBlockBodyFieldRoots_Electra(t *testing.T) { + blockBodyElectra := hydrateBeaconBlockBodyElectra() + i, err := NewBeaconBlockBody(blockBodyElectra) + require.NoError(t, err) + + b, ok := i.(*BeaconBlockBody) + require.Equal(t, true, ok) + + fieldRoots, err := ComputeBlockBodyFieldRoots(context.Background(), b) + require.NoError(t, err) + trie, err := trie.GenerateTrieFromItems(fieldRoots, 4) + require.NoError(t, err) + layers := trie.ToProto().GetLayers() + + hash := layers[len(layers)-1].Layer[0] + require.NoError(t, err) + + correctHash, err := b.HashTreeRoot() + require.NoError(t, err) + + require.DeepEqual(t, correctHash[:], hash) +} From de2c86670737b5b6064733a35f7cdbbebdacf52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Wed, 14 Aug 2024 15:09:29 +0200 Subject: [PATCH 249/325] Keep read lock in BeaconState.getValidatorIndex (#14341) --- beacon-chain/state/state-native/validator_index_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/state/state-native/validator_index_cache.go b/beacon-chain/state/state-native/validator_index_cache.go index dcb8ce33684f..83115fef110a 100644 --- a/beacon-chain/state/state-native/validator_index_cache.go +++ b/beacon-chain/state/state-native/validator_index_cache.go @@ -30,8 +30,8 @@ func newFinalizedValidatorIndexCache() *finalizedValidatorIndexCache { // If the public key is not found in the cache, it searches through the state starting from the last finalized index. func (b *BeaconState) getValidatorIndex(pubKey [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool) { b.validatorIndexCache.RLock() + defer b.validatorIndexCache.RUnlock() index, found := b.validatorIndexCache.indexMap[pubKey] - b.validatorIndexCache.RUnlock() if found { return index, true } From 6cb845660a3ae2efee06cb33ec7c123628d2b3cd Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:24:53 -0500 Subject: [PATCH 250/325] fixing electra attestation inconsistencies (#14331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixing electra attestation inconsistencies * adding dependencies * removing helper circular dependency * adding error * simplifying function * improving get committee index function * fixing more instances of GetData().committeeIndex and fixing tests * Update proto/prysm/v1alpha1/attestation.go Co-authored-by: Radosław Kapka * addressing feedback and fixing linting * removing unused functions and associated tests * fixing test error checks * removing helpers.VerifyAttestationBitfieldLengths to reduce beaconCommitteeFromState calls * small optimizations * fixing linting --------- Co-authored-by: Radosław Kapka --- .../blockchain/receive_attestation.go | 28 +++- beacon-chain/core/blocks/attestation.go | 43 +++--- beacon-chain/core/epoch/BUILD.bazel | 2 - beacon-chain/core/epoch/epoch_processing.go | 71 ---------- .../core/epoch/epoch_processing_test.go | 126 ------------------ .../core/epoch/precompute/BUILD.bazel | 1 - .../epoch/precompute/reward_penalty_test.go | 85 ------------ beacon-chain/core/helpers/beacon_committee.go | 18 --- .../core/helpers/beacon_committee_test.go | 7 +- .../rpc/prysm/v1alpha1/validator/attester.go | 14 +- .../prysm/v1alpha1/validator/attester_test.go | 6 +- .../sync/subscriber_beacon_attestation.go | 6 +- beacon-chain/sync/validate_aggregate_proof.go | 61 +++------ .../sync/validate_aggregate_proof_test.go | 24 ++-- .../sync/validate_beacon_attestation.go | 63 ++++----- .../validate_beacon_attestation_electra.go | 18 ++- proto/prysm/v1alpha1/BUILD.bazel | 1 + proto/prysm/v1alpha1/attestation.go | 38 ++++++ 18 files changed, 168 insertions(+), 444 deletions(-) diff --git a/beacon-chain/blockchain/receive_attestation.go b/beacon-chain/blockchain/receive_attestation.go index 89f344383cf6..3e788b9d1e4e 100644 --- a/beacon-chain/blockchain/receive_attestation.go +++ b/beacon-chain/blockchain/receive_attestation.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -190,13 +191,26 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati } if err := s.receiveAttestationNoPubsub(ctx, a, disparity); err != nil { - log.WithFields(logrus.Fields{ - "slot": a.GetData().Slot, - "committeeIndex": a.GetData().CommitteeIndex, - "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().BeaconBlockRoot)), - "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().Target.Root)), - "aggregationCount": a.GetAggregationBits().Count(), - }).WithError(err).Warn("Could not process attestation for fork choice") + var fields logrus.Fields + if a.Version() >= version.Electra { + fields = logrus.Fields{ + "slot": a.GetData().Slot, + "committeeCount": a.CommitteeBitsVal().Count(), + "committeeIndices": a.CommitteeBitsVal().BitIndices(), + "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().BeaconBlockRoot)), + "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().Target.Root)), + "aggregatedCount": a.GetAggregationBits().Count(), + } + } else { + fields = logrus.Fields{ + "slot": a.GetData().Slot, + "committeeIndex": a.GetData().CommitteeIndex, + "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().BeaconBlockRoot)), + "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().Target.Root)), + "aggregatedCount": a.GetAggregationBits().Count(), + } + } + log.WithFields(fields).WithError(err).Warn("Could not process attestation for fork choice") } } } diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index fe71802126e1..67712ecbe684 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -110,25 +110,7 @@ func VerifyAttestationNoVerifySignature( var indexedAtt ethpb.IndexedAtt - if att.Version() < version.Electra { - if uint64(att.GetData().CommitteeIndex) >= c { - return fmt.Errorf("committee index %d >= committee count %d", att.GetData().CommitteeIndex, c) - } - - if err = helpers.VerifyAttestationBitfieldLengths(ctx, beaconState, att); err != nil { - return errors.Wrap(err, "could not verify attestation bitfields") - } - - // Verify attesting indices are correct. - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) - if err != nil { - return err - } - indexedAtt, err = attestation.ConvertToIndexed(ctx, att, committee) - if err != nil { - return err - } - } else { + if att.Version() >= version.Electra { if att.GetData().CommitteeIndex != 0 { return errors.New("committee index must be 0 post-Electra") } @@ -154,6 +136,29 @@ func VerifyAttestationNoVerifySignature( if err != nil { return err } + } else { + if uint64(att.GetData().CommitteeIndex) >= c { + return fmt.Errorf("committee index %d >= committee count %d", att.GetData().CommitteeIndex, c) + } + + // Verify attesting indices are correct. + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) + if err != nil { + return err + } + + if committee == nil { + return errors.New("no committee exist for this attestation") + } + + if err := helpers.VerifyBitfieldLength(att.GetAggregationBits(), uint64(len(committee))); err != nil { + return errors.Wrap(err, "failed to verify aggregation bitfield") + } + + indexedAtt, err = attestation.ConvertToIndexed(ctx, att, committee) + if err != nil { + return err + } } return attestation.IsValidAttestationIndices(ctx, indexedAtt) diff --git a/beacon-chain/core/epoch/BUILD.bazel b/beacon-chain/core/epoch/BUILD.bazel index e6f559e55916..3a3ea5c5eec5 100644 --- a/beacon-chain/core/epoch/BUILD.bazel +++ b/beacon-chain/core/epoch/BUILD.bazel @@ -22,7 +22,6 @@ go_library( "//consensus-types/primitives:go_default_library", "//math:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//proto/prysm/v1alpha1/attestation:go_default_library", "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", ], @@ -53,7 +52,6 @@ go_test( "//testing/util:go_default_library", "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_google_gofuzz//:go_default_library", - "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 7856b83d45dc..1fe1293b53b3 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -20,32 +20,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/math" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) -// AttestingBalance returns the total balance from all the attesting indices. -// -// WARNING: This method allocates a new copy of the attesting validator indices set and is -// considered to be very memory expensive. Avoid using this unless you really -// need to get attesting balance from attestations. -// -// Spec pseudocode definition: -// -// def get_attesting_balance(state: BeaconState, attestations: Sequence[PendingAttestation]) -> Gwei: -// """ -// Return the combined effective balance of the set of unslashed validators participating in ``attestations``. -// Note: ``get_total_balance`` returns ``EFFECTIVE_BALANCE_INCREMENT`` Gwei minimum to avoid divisions by zero. -// """ -// return get_total_balance(state, get_unslashed_attesting_indices(state, attestations)) -func AttestingBalance(ctx context.Context, state state.ReadOnlyBeaconState, atts []*ethpb.PendingAttestation) (uint64, error) { - indices, err := UnslashedAttestingIndices(ctx, state, atts) - if err != nil { - return 0, errors.Wrap(err, "could not get attesting indices") - } - return helpers.TotalBalance(state, indices), nil -} - // ProcessRegistryUpdates rotates validators in and out of active pool. // the amount to rotate is determined churn limit. // @@ -455,51 +432,3 @@ func ProcessFinalUpdates(state state.BeaconState) (state.BeaconState, error) { return state, nil } - -// UnslashedAttestingIndices returns all the attesting indices from a list of attestations, -// it sorts the indices and filters out the slashed ones. -// -// Spec pseudocode definition: -// -// def get_unslashed_attesting_indices(state: BeaconState, -// attestations: Sequence[PendingAttestation]) -> Set[ValidatorIndex]: -// output = set() # type: Set[ValidatorIndex] -// for a in attestations: -// output = output.union(get_attesting_indices(state, a.data, a.aggregation_bits)) -// return set(filter(lambda index: not state.validators[index].slashed, output)) -func UnslashedAttestingIndices(ctx context.Context, state state.ReadOnlyBeaconState, atts []*ethpb.PendingAttestation) ([]primitives.ValidatorIndex, error) { - var setIndices []primitives.ValidatorIndex - seen := make(map[uint64]bool) - - for _, att := range atts { - committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) - if err != nil { - return nil, err - } - attestingIndices, err := attestation.AttestingIndices(att, committee) - if err != nil { - return nil, err - } - // Create a set for attesting indices - for _, index := range attestingIndices { - if !seen[index] { - setIndices = append(setIndices, primitives.ValidatorIndex(index)) - } - seen[index] = true - } - } - // Sort the attesting set indices by increasing order. - sort.Slice(setIndices, func(i, j int) bool { return setIndices[i] < setIndices[j] }) - // Remove the slashed validator indices. - for i := 0; i < len(setIndices); i++ { - v, err := state.ValidatorAtIndexReadOnly(setIndices[i]) - if err != nil { - return nil, errors.Wrap(err, "failed to look up validator") - } - if !v.IsNil() && v.Slashed() { - setIndices = append(setIndices[:i], setIndices[i+1:]...) - } - } - - return setIndices, nil -} diff --git a/beacon-chain/core/epoch/epoch_processing_test.go b/beacon-chain/core/epoch/epoch_processing_test.go index dd78dd5ca626..caeee1a1b25d 100644 --- a/beacon-chain/core/epoch/epoch_processing_test.go +++ b/beacon-chain/core/epoch/epoch_processing_test.go @@ -6,7 +6,6 @@ import ( "math" "testing" - "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" @@ -24,131 +23,6 @@ import ( "google.golang.org/protobuf/proto" ) -func TestUnslashedAttestingIndices_CanSortAndFilter(t *testing.T) { - // Generate 2 attestations. - atts := make([]*ethpb.PendingAttestation, 2) - for i := 0; i < len(atts); i++ { - atts[i] = ðpb.PendingAttestation{ - Data: ðpb.AttestationData{Source: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, - Target: ðpb.Checkpoint{Epoch: 0, Root: make([]byte, fieldparams.RootLength)}, - }, - AggregationBits: bitfield.Bitlist{0x00, 0xFF, 0xFF, 0xFF}, - } - } - - // Generate validators and state for the 2 attestations. - validatorCount := 1000 - validators := make([]*ethpb.Validator, validatorCount) - for i := 0; i < len(validators); i++ { - validators[i] = ðpb.Validator{ - ExitEpoch: params.BeaconConfig().FarFutureEpoch, - } - } - base := ðpb.BeaconState{ - Validators: validators, - RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), - } - beaconState, err := state_native.InitializeFromProtoPhase0(base) - require.NoError(t, err) - - indices, err := epoch.UnslashedAttestingIndices(context.Background(), beaconState, atts) - require.NoError(t, err) - for i := 0; i < len(indices)-1; i++ { - if indices[i] >= indices[i+1] { - t.Error("sorted indices not sorted or duplicated") - } - } - - // Verify the slashed validator is filtered. - slashedValidator := indices[0] - validators = beaconState.Validators() - validators[slashedValidator].Slashed = true - require.NoError(t, beaconState.SetValidators(validators)) - indices, err = epoch.UnslashedAttestingIndices(context.Background(), beaconState, atts) - require.NoError(t, err) - for i := 0; i < len(indices); i++ { - assert.NotEqual(t, slashedValidator, indices[i], "Slashed validator %d is not filtered", slashedValidator) - } -} - -func TestUnslashedAttestingIndices_DuplicatedAttestations(t *testing.T) { - // Generate 5 of the same attestations. - atts := make([]*ethpb.PendingAttestation, 5) - for i := 0; i < len(atts); i++ { - atts[i] = ðpb.PendingAttestation{ - Data: ðpb.AttestationData{Source: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, - Target: ðpb.Checkpoint{Epoch: 0}}, - AggregationBits: bitfield.Bitlist{0x00, 0xFF, 0xFF, 0xFF}, - } - } - - // Generate validators and state for the 5 attestations. - validatorCount := 1000 - validators := make([]*ethpb.Validator, validatorCount) - for i := 0; i < len(validators); i++ { - validators[i] = ðpb.Validator{ - ExitEpoch: params.BeaconConfig().FarFutureEpoch, - } - } - base := ðpb.BeaconState{ - Validators: validators, - RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), - } - beaconState, err := state_native.InitializeFromProtoPhase0(base) - require.NoError(t, err) - - indices, err := epoch.UnslashedAttestingIndices(context.Background(), beaconState, atts) - require.NoError(t, err) - - for i := 0; i < len(indices)-1; i++ { - if indices[i] >= indices[i+1] { - t.Error("sorted indices not sorted or duplicated") - } - } -} - -func TestAttestingBalance_CorrectBalance(t *testing.T) { - helpers.ClearCache() - // Generate 2 attestations. - atts := make([]*ethpb.PendingAttestation, 2) - for i := 0; i < len(atts); i++ { - atts[i] = ðpb.PendingAttestation{ - Data: ðpb.AttestationData{ - Target: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, - Source: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, - Slot: primitives.Slot(i), - }, - AggregationBits: bitfield.Bitlist{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01}, - } - } - - // Generate validators with balances and state for the 2 attestations. - validators := make([]*ethpb.Validator, params.BeaconConfig().MinGenesisActiveValidatorCount) - balances := make([]uint64, params.BeaconConfig().MinGenesisActiveValidatorCount) - for i := 0; i < len(validators); i++ { - validators[i] = ðpb.Validator{ - ExitEpoch: params.BeaconConfig().FarFutureEpoch, - EffectiveBalance: params.BeaconConfig().MaxEffectiveBalance, - } - balances[i] = params.BeaconConfig().MaxEffectiveBalance - } - base := ðpb.BeaconState{ - Slot: 2, - RandaoMixes: make([][]byte, params.BeaconConfig().EpochsPerHistoricalVector), - - Validators: validators, - Balances: balances, - } - beaconState, err := state_native.InitializeFromProtoPhase0(base) - require.NoError(t, err) - - balance, err := epoch.AttestingBalance(context.Background(), beaconState, atts) - require.NoError(t, err) - wanted := 256 * params.BeaconConfig().MaxEffectiveBalance - assert.Equal(t, wanted, balance) -} - func TestProcessSlashings_NotSlashed(t *testing.T) { base := ðpb.BeaconState{ Slot: 0, diff --git a/beacon-chain/core/epoch/precompute/BUILD.bazel b/beacon-chain/core/epoch/precompute/BUILD.bazel index 18a12269b84a..588697ca3c7f 100644 --- a/beacon-chain/core/epoch/precompute/BUILD.bazel +++ b/beacon-chain/core/epoch/precompute/BUILD.bazel @@ -47,7 +47,6 @@ go_test( embed = [":go_default_library"], deps = [ "//beacon-chain/core/altair:go_default_library", - "//beacon-chain/core/epoch:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", diff --git a/beacon-chain/core/epoch/precompute/reward_penalty_test.go b/beacon-chain/core/epoch/precompute/reward_penalty_test.go index 4c4e3c40911f..9ab32f65a9da 100644 --- a/beacon-chain/core/epoch/precompute/reward_penalty_test.go +++ b/beacon-chain/core/epoch/precompute/reward_penalty_test.go @@ -6,7 +6,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -59,90 +58,6 @@ func TestProcessRewardsAndPenaltiesPrecompute(t *testing.T) { assert.Equal(t, wanted, beaconState.Balances()[0], "Unexpected balance") } -func TestAttestationDeltaPrecompute(t *testing.T) { - e := params.BeaconConfig().SlotsPerEpoch - validatorCount := uint64(2048) - base := buildState(e+2, validatorCount) - atts := make([]*ethpb.PendingAttestation, 3) - var emptyRoot [32]byte - for i := 0; i < len(atts); i++ { - atts[i] = ðpb.PendingAttestation{ - Data: ðpb.AttestationData{ - Target: ðpb.Checkpoint{ - Root: emptyRoot[:], - }, - Source: ðpb.Checkpoint{ - Root: emptyRoot[:], - }, - BeaconBlockRoot: emptyRoot[:], - }, - AggregationBits: bitfield.Bitlist{0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x01}, - InclusionDelay: 1, - } - } - base.PreviousEpochAttestations = atts - beaconState, err := state_native.InitializeFromProtoPhase0(base) - require.NoError(t, err) - slashedAttestedIndices := []primitives.ValidatorIndex{1413} - for _, i := range slashedAttestedIndices { - vs := beaconState.Validators() - vs[i].Slashed = true - require.Equal(t, nil, beaconState.SetValidators(vs)) - } - - vp, bp, err := New(context.Background(), beaconState) - require.NoError(t, err) - vp, bp, err = ProcessAttestations(context.Background(), beaconState, vp, bp) - require.NoError(t, err) - - // Add some variances to target and head balances. - // See: https://github.com/prysmaticlabs/prysm/issues/5593 - bp.PrevEpochTargetAttested /= 2 - bp.PrevEpochHeadAttested = bp.PrevEpochHeadAttested * 2 / 3 - rewards, penalties, err := AttestationsDelta(beaconState, bp, vp) - require.NoError(t, err) - attestedBalance, err := epoch.AttestingBalance(context.Background(), beaconState, atts) - require.NoError(t, err) - totalBalance, err := helpers.TotalActiveBalance(beaconState) - require.NoError(t, err) - - attestedIndices := []primitives.ValidatorIndex{55, 1339, 1746, 1811, 1569} - for _, i := range attestedIndices { - base, err := baseReward(beaconState, i) - require.NoError(t, err, "Could not get base reward") - - // Base rewards for getting source right - wanted := attestedBalance*base/totalBalance + - bp.PrevEpochTargetAttested*base/totalBalance + - bp.PrevEpochHeadAttested*base/totalBalance - // Base rewards for proposer and attesters working together getting attestation - // on chain in the fatest manner - proposerReward := base / params.BeaconConfig().ProposerRewardQuotient - wanted += (base-proposerReward)*uint64(params.BeaconConfig().MinAttestationInclusionDelay) - 1 - assert.Equal(t, wanted, rewards[i], "Unexpected reward balance for validator with index %d", i) - // Since all these validators attested, they shouldn't get penalized. - assert.Equal(t, uint64(0), penalties[i], "Unexpected penalty balance") - } - - for _, i := range slashedAttestedIndices { - base, err := baseReward(beaconState, i) - assert.NoError(t, err, "Could not get base reward") - assert.Equal(t, uint64(0), rewards[i], "Unexpected slashed indices reward balance") - assert.Equal(t, 3*base, penalties[i], "Unexpected slashed indices penalty balance") - } - - nonAttestedIndices := []primitives.ValidatorIndex{434, 677, 872, 791} - for _, i := range nonAttestedIndices { - base, err := baseReward(beaconState, i) - assert.NoError(t, err, "Could not get base reward") - wanted := 3 * base - // Since all these validators did not attest, they shouldn't get rewarded. - assert.Equal(t, uint64(0), rewards[i], "Unexpected reward balance") - // Base penalties for not attesting. - assert.Equal(t, wanted, penalties[i], "Unexpected penalty balance") - } -} - func TestAttestationDeltas_ZeroEpoch(t *testing.T) { e := params.BeaconConfig().SlotsPerEpoch validatorCount := uint64(2048) diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index e8443630a7ee..2e70cf5f0fd4 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -337,24 +337,6 @@ func VerifyBitfieldLength(bf bitfield.Bitfield, committeeSize uint64) error { return nil } -// VerifyAttestationBitfieldLengths verifies that an attestations aggregation bitfields is -// a valid length matching the size of the committee. -func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att ethpb.Att) error { - committee, err := BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) - if err != nil { - return errors.Wrap(err, "could not retrieve beacon committees") - } - - if committee == nil { - return errors.New("no committee exist for this attestation") - } - - if err := VerifyBitfieldLength(att.GetAggregationBits(), uint64(len(committee))); err != nil { - return errors.Wrap(err, "failed to verify aggregation bitfield") - } - return nil -} - // ShuffledIndices uses input beacon state and returns the shuffled indices of the input epoch, // the shuffled indices then can be used to break up into committees. func ShuffledIndices(s state.ReadOnlyBeaconState, epoch primitives.Epoch) ([]primitives.ValidatorIndex, error) { diff --git a/beacon-chain/core/helpers/beacon_committee_test.go b/beacon-chain/core/helpers/beacon_committee_test.go index 9604ede6f596..007685617e22 100644 --- a/beacon-chain/core/helpers/beacon_committee_test.go +++ b/beacon-chain/core/helpers/beacon_committee_test.go @@ -403,7 +403,12 @@ func TestVerifyAttestationBitfieldLengths_OK(t *testing.T) { helpers.ClearCache() require.NoError(t, state.SetSlot(tt.stateSlot)) - err := helpers.VerifyAttestationBitfieldLengths(context.Background(), state, tt.attestation) + att := tt.attestation + // Verify attesting indices are correct. + committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.GetData().Slot, att.GetData().CommitteeIndex) + require.NoError(t, err) + require.NotNil(t, committee) + err = helpers.VerifyBitfieldLength(att.GetAggregationBits(), uint64(len(committee))) if tt.verificationFailure { assert.NotNil(t, err, "Verification succeeded when it was supposed to fail") } else { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index 26ab6d7c7586..802d551bd765 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -66,18 +66,12 @@ func (vs *Server) ProposeAttestationElectra(ctx context.Context, att *ethpb.Atte ctx, span := trace.StartSpan(ctx, "AttesterServer.ProposeAttestationElectra") defer span.End() - if att.GetData().CommitteeIndex != 0 { - return nil, status.Errorf(codes.InvalidArgument, "Committee index must be set to 0") - } - committeeIndices := helpers.CommitteeIndices(att.CommitteeBits) - if len(committeeIndices) == 0 { - return nil, status.Errorf(codes.InvalidArgument, "Committee bits has no bit set") - } - if len(committeeIndices) > 1 { - return nil, status.Errorf(codes.InvalidArgument, "Committee bits has more than one bit set") + committeeIndex, err := att.GetCommitteeIndex() + if err != nil { + return nil, err } - resp, err := vs.proposeAtt(ctx, att, committeeIndices[0]) + resp, err := vs.proposeAtt(ctx, att, committeeIndex) if err != nil { return nil, err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go index 6fe5e884d4f9..e293d09f2574 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go @@ -113,7 +113,7 @@ func TestProposeAttestation(t *testing.T) { CommitteeBits: cb, } _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) - assert.ErrorContains(t, "Committee index must be set to 0", err) + assert.ErrorContains(t, "attestation data's committee index must be 0 but was 1", err) }) t.Run("Electra - no committee bit set", func(t *testing.T) { state, err := util.NewBeaconStateElectra() @@ -131,7 +131,7 @@ func TestProposeAttestation(t *testing.T) { CommitteeBits: primitives.NewAttestationCommitteeBits(), } _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) - assert.ErrorContains(t, "Committee bits has no bit set", err) + assert.ErrorContains(t, "exactly 1 committee index must be set but 0 were set", err) }) t.Run("Electra - multiple committee bits set", func(t *testing.T) { state, err := util.NewBeaconStateElectra() @@ -152,7 +152,7 @@ func TestProposeAttestation(t *testing.T) { CommitteeBits: cb, } _, err = attesterServer.ProposeAttestationElectra(context.Background(), req) - assert.ErrorContains(t, "Committee bits has more than one bit set", err) + assert.ErrorContains(t, "exactly 1 committee index must be set but 2 were set", err) }) } diff --git a/beacon-chain/sync/subscriber_beacon_attestation.go b/beacon-chain/sync/subscriber_beacon_attestation.go index d6d280c38811..ab440132e477 100644 --- a/beacon-chain/sync/subscriber_beacon_attestation.go +++ b/beacon-chain/sync/subscriber_beacon_attestation.go @@ -25,7 +25,11 @@ func (s *Service) committeeIndexBeaconAttestationSubscriber(_ context.Context, m if data == nil { return errors.New("nil attestation") } - s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, a.GetAggregationBits()) + committeeIndex, err := a.GetCommitteeIndex() + if err != nil { + return errors.Wrap(err, "committeeIndexBeaconAttestationSubscriber failed to get committee index") + } + s.setSeenCommitteeIndicesSlot(data.Slot, committeeIndex, a.GetAggregationBits()) exists, err := s.cfg.attPool.HasAggregatedAttestation(a) if err != nil { diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index e5f4d0436a9f..188ced2430b0 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -167,39 +167,32 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed ethpb.Signed return pubsub.ValidationIgnore, err } + committeeIndex, _, result, err := s.validateCommitteeIndexAndCount(ctx, aggregate, bs) + if result != pubsub.ValidationAccept { + wrappedErr := errors.Wrapf(err, "could not validate committee index") + tracing.AnnotateError(span, wrappedErr) + return result, err + } + + committee, result, err := s.validateBitLength(ctx, bs, aggregate.GetData().Slot, committeeIndex, aggregate.GetAggregationBits()) + if result != pubsub.ValidationAccept { + return result, err + } + // Verify validator index is within the beacon committee. - result, err := s.validateIndexInCommittee(ctx, bs, aggregate, aggregatorIndex) + result, err = s.validateIndexInCommittee(ctx, aggregate, aggregatorIndex, committee) if result != pubsub.ValidationAccept { wrappedErr := errors.Wrapf(err, "could not validate index in committee") tracing.AnnotateError(span, wrappedErr) return result, wrappedErr } - var committeeIndex primitives.CommitteeIndex - if signed.Version() >= version.Electra { - a, ok := aggregate.(*ethpb.AttestationElectra) - // This will never fail in practice because we asserted the version - if !ok { - err := fmt.Errorf("aggregate attestation has wrong type (expected %T, got %T)", ðpb.AttestationElectra{}, aggregate) - tracing.AnnotateError(span, err) - return pubsub.ValidationIgnore, err - } - committeeIndex, result, err = validateCommitteeIndexElectra(ctx, a) - if result != pubsub.ValidationAccept { - wrappedErr := errors.Wrapf(err, "could not validate committee index for Electra version") - tracing.AnnotateError(span, wrappedErr) - return result, wrappedErr - } - } else { - committeeIndex = data.CommitteeIndex - } - // Verify selection proof reflects to the right validator. selectionSigSet, err := validateSelectionIndex( ctx, bs, data.Slot, - committeeIndex, + committee, aggregatorIndex, aggregateAndProof.GetSelectionProof(), ) @@ -266,24 +259,10 @@ func (s *Service) setAggregatorIndexEpochSeen(epoch primitives.Epoch, aggregator // - [REJECT] The aggregate attestation has participants -- that is, len(get_attesting_indices(state, aggregate.data, aggregate.aggregation_bits)) >= 1. // - [REJECT] The aggregator's validator index is within the committee -- // i.e. `aggregate_and_proof.aggregator_index in get_beacon_committee(state, aggregate.data.slot, aggregate.data.index)`. -// -// Post-Electra: -// - [REJECT] len(committee_indices) == 1, where committee_indices = get_committee_indices(aggregate). -// - [REJECT] aggregate.data.index == 0 -func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a ethpb.Att, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { - ctx, span := trace.StartSpan(ctx, "sync.validateIndexInCommittee") +func (s *Service) validateIndexInCommittee(ctx context.Context, a ethpb.Att, validatorIndex primitives.ValidatorIndex, committee []primitives.ValidatorIndex) (pubsub.ValidationResult, error) { + _, span := trace.StartSpan(ctx, "sync.validateIndexInCommittee") defer span.End() - committeeIndex, _, result, err := s.validateCommitteeIndex(ctx, a, bs) - if result != pubsub.ValidationAccept { - return result, err - } - - committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, committeeIndex, a.GetAggregationBits()) - if result != pubsub.ValidationAccept { - return result, err - } - if a.GetAggregationBits().Count() == 0 { return pubsub.ValidationReject, errors.New("no attesting indices") } @@ -308,17 +287,13 @@ func validateSelectionIndex( ctx context.Context, bs state.ReadOnlyBeaconState, slot primitives.Slot, - committeeIndex primitives.CommitteeIndex, + committee []primitives.ValidatorIndex, validatorIndex primitives.ValidatorIndex, proof []byte, ) (*bls.SignatureBatch, error) { - ctx, span := trace.StartSpan(ctx, "sync.validateSelectionIndex") + _, span := trace.StartSpan(ctx, "sync.validateSelectionIndex") defer span.End() - committee, err := helpers.BeaconCommitteeFromState(ctx, bs, slot, committeeIndex) - if err != nil { - return nil, err - } aggregator, err := helpers.IsAggregator(uint64(len(committee)), proof) if err != nil { return nil, err diff --git a/beacon-chain/sync/validate_aggregate_proof_test.go b/beacon-chain/sync/validate_aggregate_proof_test.go index f1dd12292ddf..6376e3f42d6e 100644 --- a/beacon-chain/sync/validate_aggregate_proof_test.go +++ b/beacon-chain/sync/validate_aggregate_proof_test.go @@ -50,12 +50,13 @@ func TestVerifyIndexInCommittee_CanVerify(t *testing.T) { assert.NoError(t, err) indices, err := attestation.AttestingIndices(att, committee) require.NoError(t, err) - result, err := service.validateIndexInCommittee(ctx, s, att, primitives.ValidatorIndex(indices[0])) + + result, err := service.validateIndexInCommittee(ctx, att, primitives.ValidatorIndex(indices[0]), committee) require.NoError(t, err) assert.Equal(t, pubsub.ValidationAccept, result) wanted := "validator index 1000 is not within the committee" - result, err = service.validateIndexInCommittee(ctx, s, att, 1000) + result, err = service.validateIndexInCommittee(ctx, att, 1000, committee) assert.ErrorContains(t, wanted, err) assert.Equal(t, pubsub.ValidationReject, result) } @@ -78,28 +79,30 @@ func TestVerifyIndexInCommittee_ExistsInBeaconCommittee(t *testing.T) { att.AggregationBits = bl service := &Service{} - result, err := service.validateIndexInCommittee(ctx, s, att, committee[0]) + result, err := service.validateIndexInCommittee(ctx, att, committee[0], committee) require.ErrorContains(t, "no attesting indices", err) assert.Equal(t, pubsub.ValidationReject, result) att.AggregationBits.SetBitAt(0, true) - result, err = service.validateIndexInCommittee(ctx, s, att, committee[0]) + result, err = service.validateIndexInCommittee(ctx, att, committee[0], committee) require.NoError(t, err) assert.Equal(t, pubsub.ValidationAccept, result) wanted := "validator index 1000 is not within the committee" - result, err = service.validateIndexInCommittee(ctx, s, att, 1000) + result, err = service.validateIndexInCommittee(ctx, att, 1000, committee) assert.ErrorContains(t, wanted, err) assert.Equal(t, pubsub.ValidationReject, result) att.AggregationBits = bitfield.NewBitlist(1) - result, err = service.validateIndexInCommittee(ctx, s, att, committee[0]) + committeeIndex, err := att.GetCommitteeIndex() + require.NoError(t, err) + _, result, err = service.validateBitLength(ctx, s, att.Data.Slot, committeeIndex, att.AggregationBits) require.ErrorContains(t, "wanted participants bitfield length 4, got: 1", err) assert.Equal(t, pubsub.ValidationReject, result) att.Data.CommitteeIndex = 10000 - result, err = service.validateIndexInCommittee(ctx, s, att, committee[0]) + _, _, result, err = service.validateCommitteeIndexAndCount(ctx, att, s) require.ErrorContains(t, "committee index 10000 > 2", err) assert.Equal(t, pubsub.ValidationReject, result) } @@ -117,7 +120,7 @@ func TestVerifyIndexInCommittee_Electra(t *testing.T) { bl.SetBitAt(0, true) att.AggregationBits = bl - result, err := service.validateIndexInCommittee(ctx, s, att, committee[0]) + result, err := service.validateIndexInCommittee(ctx, att, committee[0], committee) require.NoError(t, err) assert.Equal(t, pubsub.ValidationAccept, result) } @@ -131,8 +134,9 @@ func TestVerifySelection_NotAnAggregator(t *testing.T) { sig := privKeys[0].Sign([]byte{'A'}) data := util.HydrateAttestationData(ðpb.AttestationData{}) - - _, err := validateSelectionIndex(ctx, beaconState, data.Slot, data.CommitteeIndex, 0, sig.Marshal()) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, data.Slot, data.CommitteeIndex) + require.NoError(t, err) + _, err = validateSelectionIndex(ctx, beaconState, data.Slot, committee, 0, sig.Marshal()) wanted := "validator is not an aggregator for slot" assert.ErrorContains(t, wanted, err) } diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index 79a86f83bf60..a57eb9b4b9ec 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -94,28 +94,16 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p var validationRes pubsub.ValidationResult - var committeeIndex primitives.CommitteeIndex - if att.Version() >= version.Electra { - a, ok := att.(*eth.AttestationElectra) - // This will never fail in practice because we asserted the version - if !ok { - err := fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.AttestationElectra{}, att) - tracing.AnnotateError(span, err) - return pubsub.ValidationIgnore, err - } - committeeIndex, validationRes, err = validateCommitteeIndexElectra(ctx, a) - if validationRes != pubsub.ValidationAccept { - wrappedErr := errors.Wrapf(err, "could not validate committee index for Electra version") - tracing.AnnotateError(span, wrappedErr) - return validationRes, wrappedErr - } - } else { - committeeIndex = data.CommitteeIndex + committeeIndex, result, err := s.validateCommitteeIndex(ctx, att) + if result != pubsub.ValidationAccept { + wrappedErr := errors.Wrapf(err, "could not validate committee index for %s version", version.String(att.Version())) + tracing.AnnotateError(span, wrappedErr) + return result, wrappedErr } if !features.Get().EnableSlasher { // Verify this the first attestation received for the participating validator for the slot. - if s.hasSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) { + if s.hasSeenCommitteeIndicesSlot(data.Slot, committeeIndex, att.GetAggregationBits()) { return pubsub.ValidationIgnore, nil } @@ -205,7 +193,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p }() } - s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) + s.setSeenCommitteeIndicesSlot(data.Slot, committeeIndex, att.GetAggregationBits()) msg.ValidatorData = att @@ -217,7 +205,7 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, b ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttTopic") defer span.End() - _, valCount, result, err := s.validateCommitteeIndex(ctx, a, bs) + _, valCount, result, err := s.validateCommitteeIndexAndCount(ctx, a, bs) if result != pubsub.ValidationAccept { return result, err } @@ -235,35 +223,31 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, b return pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndex( +func (s *Service) validateCommitteeIndexAndCount( ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState, ) (primitives.CommitteeIndex, uint64, pubsub.ValidationResult, error) { + ci, result, err := s.validateCommitteeIndex(ctx, a) + if result != pubsub.ValidationAccept { + return 0, 0, result, err + } valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.GetData().Slot)) if err != nil { return 0, 0, pubsub.ValidationIgnore, err } count := helpers.SlotCommitteeCount(valCount) - if uint64(a.GetData().CommitteeIndex) > count { - return 0, 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.GetData().CommitteeIndex, count) + if uint64(ci) > count { + return 0, 0, pubsub.ValidationReject, fmt.Errorf("committee index %d > %d", a.GetData().CommitteeIndex, count) } + return ci, valCount, pubsub.ValidationAccept, nil +} - var ci primitives.CommitteeIndex +func (s *Service) validateCommitteeIndex(ctx context.Context, a eth.Att) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { if a.Version() >= version.Electra { - dataCi := a.GetData().CommitteeIndex - if dataCi != 0 { - return 0, 0, pubsub.ValidationReject, fmt.Errorf("committee index must be 0 but was %d", dataCi) - } - indices := helpers.CommitteeIndices(a.CommitteeBitsVal()) - if len(indices) != 1 { - return 0, 0, pubsub.ValidationReject, fmt.Errorf("exactly 1 committee index must be set but %d were set", len(indices)) - } - ci = indices[0] - } else { - ci = a.GetData().CommitteeIndex + return validateCommitteeIndexElectra(ctx, a) } - return ci, valCount, pubsub.ValidationAccept, nil + return a.GetData().CommitteeIndex, pubsub.ValidationAccept, nil } // This validates beacon unaggregated attestation using the given state, the validation consists of bitfield length and count consistency @@ -272,7 +256,12 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a eth.At ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttWithState") defer span.End() - committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex, a.GetAggregationBits()) + committeeIndex, err := a.GetCommitteeIndex() + if err != nil { + return pubsub.ValidationIgnore, err + } + + committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, committeeIndex, a.GetAggregationBits()) if result != pubsub.ValidationAccept { return result, err } diff --git a/beacon-chain/sync/validate_beacon_attestation_electra.go b/beacon-chain/sync/validate_beacon_attestation_electra.go index e0693f0f3d91..8ceaee41b9a1 100644 --- a/beacon-chain/sync/validate_beacon_attestation_electra.go +++ b/beacon-chain/sync/validate_beacon_attestation_electra.go @@ -5,7 +5,6 @@ import ( "fmt" pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" @@ -14,17 +13,16 @@ import ( // validateCommitteeIndexElectra implements the following checks from the spec: // - [REJECT] len(committee_indices) == 1, where committee_indices = get_committee_indices(attestation). // - [REJECT] attestation.data.index == 0 -func validateCommitteeIndexElectra(ctx context.Context, a *ethpb.AttestationElectra) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { +func validateCommitteeIndexElectra(ctx context.Context, a ethpb.Att) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { _, span := trace.StartSpan(ctx, "sync.validateCommitteeIndexElectra") defer span.End() - - ci := a.Data.CommitteeIndex - if ci != 0 { - return 0, pubsub.ValidationReject, fmt.Errorf("committee index must be 0 but was %d", ci) + _, ok := a.(*ethpb.AttestationElectra) + if !ok { + return 0, pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ðpb.AttestationElectra{}, a) } - committeeIndices := helpers.CommitteeIndices(a.CommitteeBits) - if len(committeeIndices) != 1 { - return 0, pubsub.ValidationReject, fmt.Errorf("exactly 1 committee index must be set but %d were set", len(committeeIndices)) + committeeIndex, err := a.GetCommitteeIndex() + if err != nil { + return 0, pubsub.ValidationReject, err } - return committeeIndices[0], pubsub.ValidationAccept, nil + return committeeIndex, pubsub.ValidationAccept, nil } diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 0c6f88327c1f..26453a39ca86 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -332,6 +332,7 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "//runtime/version:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index d59d2cfcdb5d..81d37f3fbb7f 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -1,6 +1,9 @@ package eth import ( + "fmt" + + "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -21,6 +24,7 @@ type Att interface { GetData() *AttestationData CommitteeBitsVal() bitfield.Bitfield GetSignature() []byte + GetCommitteeIndex() (primitives.CommitteeIndex, error) } // IndexedAtt defines common functionality for all indexed attestation types. @@ -123,6 +127,14 @@ func (a *Attestation) CommitteeBitsVal() bitfield.Bitfield { return cb } +// GetCommitteeIndex -- +func (a *Attestation) GetCommitteeIndex() (primitives.CommitteeIndex, error) { + if a == nil || a.Data == nil { + return 0, errors.New("nil attestation data") + } + return a.Data.CommitteeIndex, nil +} + // Version -- func (a *PendingAttestation) Version() int { return version.Phase0 @@ -156,6 +168,14 @@ func (a *PendingAttestation) GetSignature() []byte { return nil } +// GetCommitteeIndex -- +func (a *PendingAttestation) GetCommitteeIndex() (primitives.CommitteeIndex, error) { + if a == nil || a.Data == nil { + return 0, errors.New("nil attestation data") + } + return a.Data.CommitteeIndex, nil +} + // Version -- func (a *AttestationElectra) Version() int { return version.Electra @@ -184,6 +204,24 @@ func (a *AttestationElectra) CommitteeBitsVal() bitfield.Bitfield { return a.CommitteeBits } +// GetCommitteeIndex -- +func (a *AttestationElectra) GetCommitteeIndex() (primitives.CommitteeIndex, error) { + if a == nil || a.Data == nil { + return 0, errors.New("nil attestation data") + } + if len(a.CommitteeBits) == 0 { + return 0, errors.New("no committee bits found in attestation") + } + if a.Data.CommitteeIndex != 0 { + return 0, fmt.Errorf("attestation data's committee index must be 0 but was %d", a.Data.CommitteeIndex) + } + indices := a.CommitteeBits.BitIndices() + if len(indices) != 1 { + return 0, fmt.Errorf("exactly 1 committee index must be set but %d were set", len(indices)) + } + return primitives.CommitteeIndex(uint64(indices[0])), nil +} + // Version -- func (a *IndexedAttestation) Version() int { return version.Phase0 From 44b39860252c240dfbc8b407c1b05cd09c4d5e9d Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:33:01 -0500 Subject: [PATCH 251/325] removing skip from test (#14343) --- testing/spectest/shared/electra/operations/execution_payload.go | 1 - 1 file changed, 1 deletion(-) diff --git a/testing/spectest/shared/electra/operations/execution_payload.go b/testing/spectest/shared/electra/operations/execution_payload.go index 4ce07c0a05d3..ad7b0e97eb15 100644 --- a/testing/spectest/shared/electra/operations/execution_payload.go +++ b/testing/spectest/shared/electra/operations/execution_payload.go @@ -8,6 +8,5 @@ import ( ) func RunExecutionPayloadTest(t *testing.T, config string) { - t.Skip("TODO: Electra uses a different execution payload") common.RunExecutionPayloadTest(t, config, version.String(version.Electra), sszToBlockBody, sszToState) } From 22f6f787e1f85cc67d45268b406baeb51fdbd83c Mon Sep 17 00:00:00 2001 From: terence Date: Wed, 14 Aug 2024 22:59:41 -0700 Subject: [PATCH 252/325] Update spec tests to v1.5.0-alpha.4 (#14340) * Update spec tests to v1.5.0-alpha.4 * Add Fix for Off By 1 In Consolidations --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: nisdas --- WORKSPACE | 10 +++++----- beacon-chain/core/electra/consolidations.go | 4 ++-- beacon-chain/core/electra/deposits.go | 4 ++-- config/params/loader.go | 2 -- config/params/loader_test.go | 2 ++ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 20d40d8b9f28..19948e919b08 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-alpha.3" +consensus_spec_version = "v1.5.0-alpha.4" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-+byv+GUOQytex5GgtjBGVoNDseJZbiBdAjEtlgCbjEo=", + integrity = "sha256-sSw6c9IR/ZiWjyk1cbfVGC/aUkId4r7+eSl3haWsq0E=", 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-JJUy/jT1h3kGQkinTuzL7gMOA1+qgmPgJXVrYuH63Cg=", + integrity = "sha256-OGlKhbA6TjTP0p1ojXVCJPzLEHJzewKkhAa+PQggoiU=", 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-T2VM4Qd0SwgGnTjWxjOX297DqEsovO9Ueij1UEJy48Y=", + integrity = "sha256-ah2Gj4ci5hw5vQgpUWkNjEQutoBCepg5jcpTi0DKVB0=", 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-OP9BCBcQ7i+93bwj7ktY8pZ5uWsGjgTe4XTp7BDhX+I=", + integrity = "sha256-I+llAsIF6lPP8RUtZ2DFsJqtCs4UPh+st3hFs12FWpY=", 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/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go index 6fe9c69c5721..0db8168e1cab 100644 --- a/beacon-chain/core/electra/consolidations.go +++ b/beacon-chain/core/electra/consolidations.go @@ -49,7 +49,7 @@ func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) err return errors.New("nil state") } - currentEpoch := slots.ToEpoch(st.Slot()) + nextEpoch := slots.ToEpoch(st.Slot()) + 1 var nextPendingConsolidation uint64 pendingConsolidations, err := st.PendingConsolidations() @@ -66,7 +66,7 @@ func ProcessPendingConsolidations(ctx context.Context, st state.BeaconState) err nextPendingConsolidation++ continue } - if sourceValidator.WithdrawableEpoch > currentEpoch { + if sourceValidator.WithdrawableEpoch > nextEpoch { break } diff --git a/beacon-chain/core/electra/deposits.go b/beacon-chain/core/electra/deposits.go index aab787b4f2dd..27733667115b 100644 --- a/beacon-chain/core/electra/deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -248,7 +248,7 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac // constants ffe := params.BeaconConfig().FarFutureEpoch - curEpoch := slots.ToEpoch(st.Slot()) + nextEpoch := slots.ToEpoch(st.Slot()) + 1 for _, balanceDeposit := range deposits { v, err := st.ValidatorAtIndexReadOnly(balanceDeposit.Index) @@ -259,7 +259,7 @@ func ProcessPendingBalanceDeposits(ctx context.Context, st state.BeaconState, ac // If the validator is currently exiting, postpone the deposit until after the withdrawable // epoch. if v.ExitEpoch() < ffe { - if curEpoch <= v.WithdrawableEpoch() { + if nextEpoch <= v.WithdrawableEpoch() { depositsToPostpone = append(depositsToPostpone, balanceDeposit) } else { // The deposited balance will never become active. Therefore, we increase the balance but do diff --git a/config/params/loader.go b/config/params/loader.go index e8e2aba491ab..880c33e0f509 100644 --- a/config/params/loader.go +++ b/config/params/loader.go @@ -233,8 +233,6 @@ func ConfigToYaml(cfg *BeaconChainConfig) []byte { fmt.Sprintf("MESSAGE_DOMAIN_INVALID_SNAPPY: %#x", cfg.MessageDomainInvalidSnappy), fmt.Sprintf("MESSAGE_DOMAIN_VALID_SNAPPY: %#x", cfg.MessageDomainValidSnappy), fmt.Sprintf("MIN_EPOCHS_FOR_BLOCK_REQUESTS: %d", int(cfg.MinEpochsForBlockRequests)), - fmt.Sprintf("ELECTRA_FORK_EPOCH: %d", cfg.ElectraForkEpoch), - fmt.Sprintf("ELECTRA_FORK_VERSION: %#x", cfg.ElectraForkVersion), } yamlFile := []byte(strings.Join(lines, "\n")) diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 4f8872b29235..3b20fcdeb7ea 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -32,6 +32,8 @@ var placeholderFields = []string{ "EIP7002_FORK_VERSION", "EIP7594_FORK_EPOCH", "EIP7594_FORK_VERSION", + "EIP7732_FORK_EPOCH", + "EIP7732_FORK_VERSION", "FIELD_ELEMENTS_PER_BLOB", // Compile time constant. "KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", // Compile time constant on BlobSidecar.commitment_inclusion_proof. "MAX_BLOBS_PER_BLOCK", From f43383a3fb2eed07db7706595cce8b939d6c8faa Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 15 Aug 2024 14:03:11 -0700 Subject: [PATCH 253/325] Proposer checks gas limit before accepting builder's bid (#14311) * Proposer checks gas limit before accepting builder's bid * James feedback * Use cache --- .../v1alpha1/validator/proposer_bellatrix.go | 9 ++++ .../validator/proposer_bellatrix_test.go | 49 ++++++++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 636858144ae6..6fbd69215204 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -242,6 +242,15 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv return nil, fmt.Errorf("incorrect parent hash %#x != %#x", header.ParentHash(), h.BlockHash()) } + reg, err := vs.BlockBuilder.RegistrationByValidatorID(ctx, idx) + if err != nil { + log.WithError(err).Warn("Proposer: failed to get registration by validator ID, could not check gas limit") + } else { + if reg.GasLimit != header.GasLimit() { + return nil, fmt.Errorf("incorrect header gas limit %d != %d", reg.GasLimit, header.GasLimit()) + } + } + t, err := slots.ToTime(uint64(vs.TimeFetcher.GenesisTime().Unix()), slot) if err != nil { return nil, err diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go index 7d02c392539e..c0d1c9d1aebc 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix_test.go @@ -720,6 +720,29 @@ func TestServer_getPayloadHeader(t *testing.T) { Signature: sk.Sign(srCapella[:]).Marshal(), } + incorrectGasLimitBid := ðpb.BuilderBid{ + Header: &v1.ExecutionPayloadHeader{ + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: make([]byte, fieldparams.RootLength), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + TransactionsRoot: bytesutil.PadTo([]byte{1}, fieldparams.RootLength), + ParentHash: params.BeaconConfig().ZeroHash[:], + Timestamp: uint64(tiCapella.Unix()), + GasLimit: 100, + }, + Pubkey: sk.PublicKey().Marshal(), + Value: bytesutil.PadTo([]byte{1, 2, 3}, 32), + } + signedIncorrectGasLimitBid := + ðpb.SignedBuilderBid{ + Message: incorrectGasLimitBid, + Signature: sk.Sign(srCapella[:]).Marshal(), + } + require.NoError(t, err) tests := []struct { name string @@ -832,6 +855,21 @@ func TestServer_getPayloadHeader(t *testing.T) { }, err: "is different from head block version", }, + { + name: "incorrect gas limit", + mock: &builderTest.MockBuilderService{ + Bid: signedIncorrectGasLimitBid, + }, + fetcher: &blockchainTest.ChainService{ + Block: func() interfaces.ReadOnlySignedBeaconBlock { + wb, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockBellatrix()) + require.NoError(t, err) + wb.SetSlot(primitives.Slot(params.BeaconConfig().BellatrixForkEpoch) * params.BeaconConfig().SlotsPerEpoch) + return wb + }(), + }, + err: "incorrect header gas limit 0 != 100", + }, { name: "different bid version during hard fork", mock: &builderTest.MockBuilderService{ @@ -850,9 +888,18 @@ func TestServer_getPayloadHeader(t *testing.T) { } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - vs := &Server{BlockBuilder: tc.mock, HeadFetcher: tc.fetcher, TimeFetcher: &blockchainTest.ChainService{ + vs := &Server{BeaconDB: dbTest.SetupDB(t), BlockBuilder: tc.mock, HeadFetcher: tc.fetcher, TimeFetcher: &blockchainTest.ChainService{ Genesis: genesis, }} + regCache := cache.NewRegistrationCache() + regCache.UpdateIndexToRegisteredMap(context.Background(), map[primitives.ValidatorIndex]*ethpb.ValidatorRegistrationV1{ + 0: { + GasLimit: 0, + FeeRecipient: make([]byte, 20), + Pubkey: make([]byte, 48), + }, + }) + tc.mock.RegistrationCache = regCache hb, err := vs.HeadFetcher.HeadBlock(context.Background()) require.NoError(t, err) bid, err := vs.getPayloadHeaderFromBuilder(context.Background(), hb.Block().Slot(), 0) From be317c439d365b1bf707cfdcfc7ba9550989a00c Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Fri, 16 Aug 2024 23:39:15 +0800 Subject: [PATCH 254/325] Allow Block With Blobs To Be Proposed in Electra (#14353) * Allow blobs in Electra * Add Test * Add Error for unknown request type * Fix Test * fix tests * clean up logic --------- Co-authored-by: rkapka --- .../rpc/prysm/v1alpha1/validator/proposer.go | 28 ++++-- .../prysm/v1alpha1/validator/proposer_test.go | 90 +++++++++++++------ 2 files changed, 83 insertions(+), 35 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 6faba0afd60e..4370d1e3d9ab 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -277,8 +277,8 @@ func (vs *Server) ProposeBeaconBlock(ctx context.Context, req *ethpb.GenericSign var sidecars []*ethpb.BlobSidecar if block.IsBlinded() { block, sidecars, err = vs.handleBlindedBlock(ctx, block) - } else { - sidecars, err = vs.handleUnblindedBlock(block, req) + } else if block.Version() >= version.Deneb { + sidecars, err = vs.blobSidecarsFromUnblindedBlock(block, req) } if err != nil { return nil, status.Errorf(codes.Internal, "%s: %v", "handle block failed", err) @@ -345,13 +345,12 @@ func (vs *Server) handleBlindedBlock(ctx context.Context, block interfaces.Signe return copiedBlock, sidecars, nil } -// handleUnblindedBlock processes unblinded beacon blocks. -func (vs *Server) handleUnblindedBlock(block interfaces.SignedBeaconBlock, req *ethpb.GenericSignedBeaconBlock) ([]*ethpb.BlobSidecar, error) { - dbBlockContents := req.GetDeneb() - if dbBlockContents == nil { - return nil, nil +func (vs *Server) blobSidecarsFromUnblindedBlock(block interfaces.SignedBeaconBlock, req *ethpb.GenericSignedBeaconBlock) ([]*ethpb.BlobSidecar, error) { + rawBlobs, proofs, err := blobsAndProofs(req) + if err != nil { + return nil, err } - return BuildBlobSidecars(block, dbBlockContents.Blobs, dbBlockContents.KzgProofs) + return BuildBlobSidecars(block, rawBlobs, proofs) } // broadcastReceiveBlock broadcasts a block and handles its reception. @@ -502,3 +501,16 @@ func (vs *Server) SubmitValidatorRegistrations(ctx context.Context, reg *ethpb.S return &emptypb.Empty{}, nil } + +func blobsAndProofs(req *ethpb.GenericSignedBeaconBlock) ([][]byte, [][]byte, error) { + switch { + case req.GetDeneb() != nil: + dbBlockContents := req.GetDeneb() + return dbBlockContents.Blobs, dbBlockContents.KzgProofs, nil + case req.GetElectra() != nil: + dbBlockContents := req.GetElectra() + return dbBlockContents.Blobs, dbBlockContents.KzgProofs, nil + default: + return nil, nil, errors.Errorf("unknown request type provided: %T", req) + } +} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 39bfb8b6d67c..b9e6caf89f9b 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -879,33 +879,6 @@ func TestProposer_ProposeBlock_OK(t *testing.T) { }, err: "blob KZG commitments don't match number of blobs or KZG proofs", }, - { - name: "electra block no blob", - block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { - sb := ðpb.SignedBeaconBlockContentsElectra{ - Block: ðpb.SignedBeaconBlockElectra{ - Block: ðpb.BeaconBlockElectra{Slot: 5, ParentRoot: parent[:], Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{})}, - }, - } - blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} - return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} - }, - }, - { - name: "electra block some blob", - block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { - - sb := ðpb.SignedBeaconBlockContentsElectra{ - Block: ðpb.SignedBeaconBlockElectra{ - Block: ðpb.BeaconBlockElectra{Slot: 5, ParentRoot: parent[:], Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{})}, - }, - KzgProofs: [][]byte{{0x01}, {0x02}, {0x03}}, - Blobs: [][]byte{{0x01}, {0x02}, {0x03}}, - } - blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} - return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} - }, - }, { name: "blind deneb block some blobs", block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { @@ -943,6 +916,57 @@ func TestProposer_ProposeBlock_OK(t *testing.T) { useBuilder: true, err: "unblind sidecars failed: commitment value doesn't match block", }, + { + name: "electra block no blob", + block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { + sb := ðpb.SignedBeaconBlockContentsElectra{ + Block: ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{Slot: 5, ParentRoot: parent[:], Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{})}, + }, + } + blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} + return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} + }, + }, + { + name: "electra block some blob", + block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { + sb := ðpb.SignedBeaconBlockContentsElectra{ + Block: ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{ + Slot: 5, ParentRoot: parent[:], + Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{ + BlobKzgCommitments: [][]byte{bytesutil.PadTo([]byte("kc"), 48), bytesutil.PadTo([]byte("kc1"), 48), bytesutil.PadTo([]byte("kc2"), 48)}, + }), + }, + }, + KzgProofs: [][]byte{{0x01}, {0x02}, {0x03}}, + Blobs: [][]byte{{0x01}, {0x02}, {0x03}}, + } + blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} + return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} + }, + }, + { + name: "electra block some blob (kzg and blob count mismatch)", + block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock { + sb := ðpb.SignedBeaconBlockContentsElectra{ + Block: ðpb.SignedBeaconBlockElectra{ + Block: ðpb.BeaconBlockElectra{ + Slot: 5, ParentRoot: parent[:], + Body: util.HydrateBeaconBlockBodyElectra(ðpb.BeaconBlockBodyElectra{ + BlobKzgCommitments: [][]byte{bytesutil.PadTo([]byte("kc"), 48), bytesutil.PadTo([]byte("kc1"), 48)}, + }), + }, + }, + KzgProofs: [][]byte{{0x01}, {0x02}, {0x03}}, + Blobs: [][]byte{{0x01}, {0x02}, {0x03}}, + } + blk := ðpb.GenericSignedBeaconBlock_Electra{Electra: sb} + return ðpb.GenericSignedBeaconBlock{Block: blk, IsBlinded: false} + }, + err: "blob KZG commitments don't match number of blobs or KZG proofs", + }, } for _, tt := range tests { @@ -3092,3 +3116,15 @@ func TestProposer_GetParentHeadState(t *testing.T) { require.LogsContain(t, hook, "late block attempted reorg failed") }) } + +func TestProposer_ElectraBlobsAndProofs(t *testing.T) { + electraContents := ðpb.SignedBeaconBlockContentsElectra{Block: ðpb.SignedBeaconBlockElectra{}} + electraContents.KzgProofs = make([][]byte, 10) + electraContents.Blobs = make([][]byte, 10) + + genBlock := ðpb.GenericSignedBeaconBlock{Block: ðpb.GenericSignedBeaconBlock_Electra{Electra: electraContents}} + blobs, proofs, err := blobsAndProofs(genBlock) + require.NoError(t, err) + require.Equal(t, 10, len(blobs)) + require.Equal(t, 10, len(proofs)) +} From 7a5a6c7e54e44b0f408c44594ce3e17b28894b2e Mon Sep 17 00:00:00 2001 From: kira Date: Fri, 16 Aug 2024 12:06:00 -0700 Subject: [PATCH 255/325] fix a deep source error (#14345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- config/params/mainnet_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 3cd9fc47a8d0..d15c2333d6fc 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -242,7 +242,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ EpochsPerSyncCommitteePeriod: 256, // Updated penalty values. - InactivityPenaltyQuotientAltair: 3 * 1 << 24, //50331648 + InactivityPenaltyQuotientAltair: 3 * 1 << 24, // 50331648 MinSlashingPenaltyQuotientAltair: 64, ProportionalSlashingMultiplierAltair: 2, MinSlashingPenaltyQuotientBellatrix: 32, From 9e9559df607843ab1cc5d3afa202f92c44ae6642 Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Sat, 17 Aug 2024 04:46:00 +0900 Subject: [PATCH 256/325] docs: Add consolidation_requests_root on comment (#14335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: Radosław Kapka --- beacon-chain/core/electra/upgrade.go | 1 + 1 file changed, 1 insertion(+) diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index f5cb4eb5c429..e547df446c07 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -40,6 +40,7 @@ import ( // excess_blob_gas=pre.latest_execution_payload_header.excess_blob_gas, // deposit_requests_root=Root(), # [New in Electra:EIP6110] // withdrawal_requests_root=Root(), # [New in Electra:EIP7002], +// consolidation_requests_root=Root(), # [New in Electra:EIP7251] // ) // // exit_epochs = [v.exit_epoch for v in pre.validators if v.exit_epoch != FAR_FUTURE_EPOCH] From 9e2502651961f3f9b05f649e07eca17b8e46600a Mon Sep 17 00:00:00 2001 From: John <33443230+gazzua@users.noreply.github.com> Date: Sat, 17 Aug 2024 05:18:16 +0900 Subject: [PATCH 257/325] Fix error handling to use os.IsNotExist (#14315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- validator/accounts/wallet/wallet.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/validator/accounts/wallet/wallet.go b/validator/accounts/wallet/wallet.go index 1ebcab12d48c..8dd3f853cb5f 100644 --- a/validator/accounts/wallet/wallet.go +++ b/validator/accounts/wallet/wallet.go @@ -119,9 +119,7 @@ func IsValid(walletDir string) (bool, error) { } f, err := os.Open(expanded) // #nosec G304 if err != nil { - if strings.Contains(err.Error(), "no such file") || - strings.Contains(err.Error(), "cannot find the file") || - strings.Contains(err.Error(), "cannot find the path") { + if os.IsNotExist(err) { return false, nil } return false, err From 41ea1d230a4db8cbf8e7eb53ca9e27cde2ea999c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 19 Aug 2024 13:46:56 +0200 Subject: [PATCH 258/325] Electra API struct conversions (#14339) * Electra API conversions * reduce function complexity --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- api/server/structs/block.go | 134 +++ api/server/structs/conversions.go | 421 +++++++ api/server/structs/conversions_block.go | 1004 ++++++++++++++++- api/server/structs/conversions_state.go | 182 +++ api/server/structs/other.go | 65 ++ api/server/structs/state.go | 40 + beacon-chain/state/interfaces.go | 1 + .../state/state-native/getters_withdrawal.go | 9 + 8 files changed, 1794 insertions(+), 62 deletions(-) diff --git a/api/server/structs/block.go b/api/server/structs/block.go index 7615f3653a4e..43b3cc879758 100644 --- a/api/server/structs/block.go +++ b/api/server/structs/block.go @@ -317,6 +317,94 @@ type BlindedBeaconBlockBodyDeneb struct { BlobKzgCommitments []string `json:"blob_kzg_commitments"` } +type SignedBeaconBlockContentsElectra struct { + SignedBlock *SignedBeaconBlockElectra `json:"signed_block"` + KzgProofs []string `json:"kzg_proofs"` + Blobs []string `json:"blobs"` +} + +type BeaconBlockContentsElectra struct { + Block *BeaconBlockElectra `json:"block"` + KzgProofs []string `json:"kzg_proofs"` + Blobs []string `json:"blobs"` +} + +type SignedBeaconBlockElectra struct { + Message *BeaconBlockElectra `json:"message"` + Signature string `json:"signature"` +} + +var _ SignedMessageJsoner = &SignedBeaconBlockElectra{} + +func (s *SignedBeaconBlockElectra) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBeaconBlockElectra) SigString() string { + return s.Signature +} + +type BeaconBlockElectra struct { + Slot string `json:"slot"` + ProposerIndex string `json:"proposer_index"` + ParentRoot string `json:"parent_root"` + StateRoot string `json:"state_root"` + Body *BeaconBlockBodyElectra `json:"body"` +} + +type BeaconBlockBodyElectra struct { + RandaoReveal string `json:"randao_reveal"` + Eth1Data *Eth1Data `json:"eth1_data"` + Graffiti string `json:"graffiti"` + ProposerSlashings []*ProposerSlashing `json:"proposer_slashings"` + AttesterSlashings []*AttesterSlashingElectra `json:"attester_slashings"` + Attestations []*AttestationElectra `json:"attestations"` + Deposits []*Deposit `json:"deposits"` + VoluntaryExits []*SignedVoluntaryExit `json:"voluntary_exits"` + SyncAggregate *SyncAggregate `json:"sync_aggregate"` + ExecutionPayload *ExecutionPayloadElectra `json:"execution_payload"` + BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"` + BlobKzgCommitments []string `json:"blob_kzg_commitments"` +} + +type BlindedBeaconBlockElectra struct { + Slot string `json:"slot"` + ProposerIndex string `json:"proposer_index"` + ParentRoot string `json:"parent_root"` + StateRoot string `json:"state_root"` + Body *BlindedBeaconBlockBodyElectra `json:"body"` +} + +type SignedBlindedBeaconBlockElectra struct { + Message *BlindedBeaconBlockElectra `json:"message"` + Signature string `json:"signature"` +} + +var _ SignedMessageJsoner = &SignedBlindedBeaconBlockElectra{} + +func (s *SignedBlindedBeaconBlockElectra) MessageRawJson() ([]byte, error) { + return json.Marshal(s.Message) +} + +func (s *SignedBlindedBeaconBlockElectra) SigString() string { + return s.Signature +} + +type BlindedBeaconBlockBodyElectra struct { + RandaoReveal string `json:"randao_reveal"` + Eth1Data *Eth1Data `json:"eth1_data"` + Graffiti string `json:"graffiti"` + ProposerSlashings []*ProposerSlashing `json:"proposer_slashings"` + AttesterSlashings []*AttesterSlashingElectra `json:"attester_slashings"` + Attestations []*AttestationElectra `json:"attestations"` + Deposits []*Deposit `json:"deposits"` + VoluntaryExits []*SignedVoluntaryExit `json:"voluntary_exits"` + SyncAggregate *SyncAggregate `json:"sync_aggregate"` + ExecutionPayloadHeader *ExecutionPayloadHeaderElectra `json:"execution_payload_header"` + BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"` + BlobKzgCommitments []string `json:"blob_kzg_commitments"` +} + type SignedBeaconBlockHeaderContainer struct { Header *SignedBeaconBlockHeader `json:"header"` Root string `json:"root"` @@ -445,3 +533,49 @@ type ExecutionPayloadHeaderDeneb struct { BlobGasUsed string `json:"blob_gas_used"` ExcessBlobGas string `json:"excess_blob_gas"` } + +type ExecutionPayloadElectra struct { + ParentHash string `json:"parent_hash"` + FeeRecipient string `json:"fee_recipient"` + StateRoot string `json:"state_root"` + ReceiptsRoot string `json:"receipts_root"` + LogsBloom string `json:"logs_bloom"` + PrevRandao string `json:"prev_randao"` + BlockNumber string `json:"block_number"` + GasLimit string `json:"gas_limit"` + GasUsed string `json:"gas_used"` + Timestamp string `json:"timestamp"` + ExtraData string `json:"extra_data"` + BaseFeePerGas string `json:"base_fee_per_gas"` + BlockHash string `json:"block_hash"` + Transactions []string `json:"transactions"` + Withdrawals []*Withdrawal `json:"withdrawals"` + BlobGasUsed string `json:"blob_gas_used"` + ExcessBlobGas string `json:"excess_blob_gas"` + DepositRequests []*DepositRequest `json:"deposit_requests"` + WithdrawalRequests []*WithdrawalRequest `json:"withdrawal_requests"` + ConsolidationRequests []*ConsolidationRequest `json:"consolidation_requests"` +} + +type ExecutionPayloadHeaderElectra struct { + ParentHash string `json:"parent_hash"` + FeeRecipient string `json:"fee_recipient"` + StateRoot string `json:"state_root"` + ReceiptsRoot string `json:"receipts_root"` + LogsBloom string `json:"logs_bloom"` + PrevRandao string `json:"prev_randao"` + BlockNumber string `json:"block_number"` + GasLimit string `json:"gas_limit"` + GasUsed string `json:"gas_used"` + Timestamp string `json:"timestamp"` + ExtraData string `json:"extra_data"` + BaseFeePerGas string `json:"base_fee_per_gas"` + BlockHash string `json:"block_hash"` + TransactionsRoot string `json:"transactions_root"` + WithdrawalsRoot string `json:"withdrawals_root"` + BlobGasUsed string `json:"blob_gas_used"` + ExcessBlobGas string `json:"excess_blob_gas"` + DepositRequestsRoot string `json:"deposit_requests_root"` + WithdrawalRequestsRoot string `json:"withdrawal_requests_root"` + ConsolidationRequestsRoot string `json:"consolidation_requests_root"` +} diff --git a/api/server/structs/conversions.go b/api/server/structs/conversions.go index 6e1b66ed9852..b8bc72f136a7 100644 --- a/api/server/structs/conversions.go +++ b/api/server/structs/conversions.go @@ -340,6 +340,42 @@ func (a *AggregateAttestationAndProof) ToConsensus() (*eth.AggregateAttestationA }, nil } +func (s *SignedAggregateAttestationAndProofElectra) ToConsensus() (*eth.SignedAggregateAttestationAndProofElectra, error) { + msg, err := s.Message.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Message") + } + sig, err := bytesutil.DecodeHexWithLength(s.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + + return ð.SignedAggregateAttestationAndProofElectra{ + Message: msg, + Signature: sig, + }, nil +} + +func (a *AggregateAttestationAndProofElectra) ToConsensus() (*eth.AggregateAttestationAndProofElectra, error) { + aggIndex, err := strconv.ParseUint(a.AggregatorIndex, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "AggregatorIndex") + } + agg, err := a.Aggregate.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Aggregate") + } + proof, err := bytesutil.DecodeHexWithLength(a.SelectionProof, 96) + if err != nil { + return nil, server.NewDecodeError(err, "SelectionProof") + } + return ð.AggregateAttestationAndProofElectra{ + AggregatorIndex: primitives.ValidatorIndex(aggIndex), + Aggregate: agg, + SelectionProof: proof, + }, nil +} + func (a *Attestation) ToConsensus() (*eth.Attestation, error) { aggBits, err := hexutil.Decode(a.AggregationBits) if err != nil { @@ -369,6 +405,41 @@ func AttFromConsensus(a *eth.Attestation) *Attestation { } } +func (a *AttestationElectra) ToConsensus() (*eth.AttestationElectra, error) { + aggBits, err := hexutil.Decode(a.AggregationBits) + if err != nil { + return nil, server.NewDecodeError(err, "AggregationBits") + } + data, err := a.Data.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Data") + } + sig, err := bytesutil.DecodeHexWithLength(a.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + committeeBits, err := hexutil.Decode(a.CommitteeBits) + if err != nil { + return nil, server.NewDecodeError(err, "CommitteeBits") + } + + return ð.AttestationElectra{ + AggregationBits: aggBits, + Data: data, + Signature: sig, + CommitteeBits: committeeBits, + }, nil +} + +func AttElectraFromConsensus(a *eth.AttestationElectra) *AttestationElectra { + return &AttestationElectra{ + AggregationBits: hexutil.Encode(a.AggregationBits), + Data: AttDataFromConsensus(a.Data), + Signature: hexutil.Encode(a.Signature), + CommitteeBits: hexutil.Encode(a.CommitteeBits), + } +} + func (a *AttestationData) ToConsensus() (*eth.AttestationData, error) { slot, err := strconv.ParseUint(a.Slot, 10, 64) if err != nil { @@ -623,6 +694,18 @@ func (s *AttesterSlashing) ToConsensus() (*eth.AttesterSlashing, error) { return ð.AttesterSlashing{Attestation_1: att1, Attestation_2: att2}, nil } +func (s *AttesterSlashingElectra) ToConsensus() (*eth.AttesterSlashingElectra, error) { + att1, err := s.Attestation1.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Attestation1") + } + att2, err := s.Attestation2.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Attestation2") + } + return ð.AttesterSlashingElectra{Attestation_1: att1, Attestation_2: att2}, nil +} + func (a *IndexedAttestation) ToConsensus() (*eth.IndexedAttestation, error) { indices := make([]uint64, len(a.AttestingIndices)) var err error @@ -648,6 +731,31 @@ func (a *IndexedAttestation) ToConsensus() (*eth.IndexedAttestation, error) { }, nil } +func (a *IndexedAttestationElectra) ToConsensus() (*eth.IndexedAttestationElectra, error) { + indices := make([]uint64, len(a.AttestingIndices)) + var err error + for i, ix := range a.AttestingIndices { + indices[i], err = strconv.ParseUint(ix, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("AttestingIndices[%d]", i)) + } + } + data, err := a.Data.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Data") + } + sig, err := bytesutil.DecodeHexWithLength(a.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + + return ð.IndexedAttestationElectra{ + AttestingIndices: indices, + Data: data, + Signature: sig, + }, nil +} + func WithdrawalsFromConsensus(ws []*enginev1.Withdrawal) []*Withdrawal { result := make([]*Withdrawal, len(ws)) for i, w := range ws { @@ -665,6 +773,126 @@ func WithdrawalFromConsensus(w *enginev1.Withdrawal) *Withdrawal { } } +func WithdrawalRequestsFromConsensus(ws []*enginev1.WithdrawalRequest) []*WithdrawalRequest { + result := make([]*WithdrawalRequest, len(ws)) + for i, w := range ws { + result[i] = WithdrawalRequestFromConsensus(w) + } + return result +} + +func WithdrawalRequestFromConsensus(w *enginev1.WithdrawalRequest) *WithdrawalRequest { + return &WithdrawalRequest{ + SourceAddress: hexutil.Encode(w.SourceAddress), + ValidatorPubkey: hexutil.Encode(w.ValidatorPubkey), + Amount: fmt.Sprintf("%d", w.Amount), + } +} + +func (w *WithdrawalRequest) ToConsensus() (*enginev1.WithdrawalRequest, error) { + src, err := bytesutil.DecodeHexWithLength(w.SourceAddress, common.AddressLength) + if err != nil { + return nil, server.NewDecodeError(err, "SourceAddress") + } + pubkey, err := bytesutil.DecodeHexWithLength(w.ValidatorPubkey, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, "ValidatorPubkey") + } + amount, err := strconv.ParseUint(w.Amount, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Amount") + } + return &enginev1.WithdrawalRequest{ + SourceAddress: src, + ValidatorPubkey: pubkey, + Amount: amount, + }, nil +} + +func ConsolidationRequestsFromConsensus(cs []*enginev1.ConsolidationRequest) []*ConsolidationRequest { + result := make([]*ConsolidationRequest, len(cs)) + for i, c := range cs { + result[i] = ConsolidationRequestFromConsensus(c) + } + return result +} + +func ConsolidationRequestFromConsensus(c *enginev1.ConsolidationRequest) *ConsolidationRequest { + return &ConsolidationRequest{ + SourceAddress: hexutil.Encode(c.SourceAddress), + SourcePubkey: hexutil.Encode(c.SourcePubkey), + TargetPubkey: hexutil.Encode(c.TargetPubkey), + } +} + +func (c *ConsolidationRequest) ToConsensus() (*enginev1.ConsolidationRequest, error) { + srcAddress, err := bytesutil.DecodeHexWithLength(c.SourceAddress, common.AddressLength) + if err != nil { + return nil, server.NewDecodeError(err, "SourceAddress") + } + srcPubkey, err := bytesutil.DecodeHexWithLength(c.SourcePubkey, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, "SourcePubkey") + } + targetPubkey, err := bytesutil.DecodeHexWithLength(c.TargetPubkey, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, "TargetPubkey") + } + return &enginev1.ConsolidationRequest{ + SourceAddress: srcAddress, + SourcePubkey: srcPubkey, + TargetPubkey: targetPubkey, + }, nil +} + +func DepositRequestsFromConsensus(ds []*enginev1.DepositRequest) []*DepositRequest { + result := make([]*DepositRequest, len(ds)) + for i, d := range ds { + result[i] = DepositRequestFromConsensus(d) + } + return result +} + +func DepositRequestFromConsensus(d *enginev1.DepositRequest) *DepositRequest { + return &DepositRequest{ + Pubkey: hexutil.Encode(d.Pubkey), + WithdrawalCredentials: hexutil.Encode(d.WithdrawalCredentials), + Amount: fmt.Sprintf("%d", d.Amount), + Signature: hexutil.Encode(d.Signature), + Index: fmt.Sprintf("%d", d.Index), + } +} + +func (d *DepositRequest) ToConsensus() (*enginev1.DepositRequest, error) { + pubkey, err := bytesutil.DecodeHexWithLength(d.Pubkey, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, "Pubkey") + } + withdrawalCredentials, err := bytesutil.DecodeHexWithLength(d.WithdrawalCredentials, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "WithdrawalCredentials") + } + amount, err := strconv.ParseUint(d.Amount, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Amount") + } + sig, err := bytesutil.DecodeHexWithLength(d.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + index, err := strconv.ParseUint(d.Index, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Index") + } + return &enginev1.DepositRequest{ + Pubkey: pubkey, + WithdrawalCredentials: withdrawalCredentials, + Amount: amount, + Signature: sig, + Index: index, + }, nil +} + func ProposerSlashingsToConsensus(src []*ProposerSlashing) ([]*eth.ProposerSlashing, error) { if src == nil { return nil, errNilValue @@ -930,6 +1158,138 @@ func AttesterSlashingFromConsensus(src *eth.AttesterSlashing) *AttesterSlashing } } +func AttesterSlashingsElectraToConsensus(src []*AttesterSlashingElectra) ([]*eth.AttesterSlashingElectra, error) { + if src == nil { + return nil, errNilValue + } + err := slice.VerifyMaxLength(src, 2) + if err != nil { + return nil, err + } + + attesterSlashings := make([]*eth.AttesterSlashingElectra, len(src)) + for i, s := range src { + if s == nil { + return nil, server.NewDecodeError(errNilValue, fmt.Sprintf("[%d]", i)) + } + if s.Attestation1 == nil { + return nil, server.NewDecodeError(errNilValue, fmt.Sprintf("[%d].Attestation1", i)) + } + if s.Attestation2 == nil { + return nil, server.NewDecodeError(errNilValue, fmt.Sprintf("[%d].Attestation2", i)) + } + + a1Sig, err := bytesutil.DecodeHexWithLength(s.Attestation1.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation1.Signature", i)) + } + err = slice.VerifyMaxLength(s.Attestation1.AttestingIndices, 2048) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation1.AttestingIndices", i)) + } + a1AttestingIndices := make([]uint64, len(s.Attestation1.AttestingIndices)) + for j, ix := range s.Attestation1.AttestingIndices { + attestingIndex, err := strconv.ParseUint(ix, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation1.AttestingIndices[%d]", i, j)) + } + a1AttestingIndices[j] = attestingIndex + } + a1Data, err := s.Attestation1.Data.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation1.Data", i)) + } + a2Sig, err := bytesutil.DecodeHexWithLength(s.Attestation2.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation2.Signature", i)) + } + err = slice.VerifyMaxLength(s.Attestation2.AttestingIndices, 2048) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation2.AttestingIndices", i)) + } + a2AttestingIndices := make([]uint64, len(s.Attestation2.AttestingIndices)) + for j, ix := range s.Attestation2.AttestingIndices { + attestingIndex, err := strconv.ParseUint(ix, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation2.AttestingIndices[%d]", i, j)) + } + a2AttestingIndices[j] = attestingIndex + } + a2Data, err := s.Attestation2.Data.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d].Attestation2.Data", i)) + } + attesterSlashings[i] = ð.AttesterSlashingElectra{ + Attestation_1: ð.IndexedAttestationElectra{ + AttestingIndices: a1AttestingIndices, + Data: a1Data, + Signature: a1Sig, + }, + Attestation_2: ð.IndexedAttestationElectra{ + AttestingIndices: a2AttestingIndices, + Data: a2Data, + Signature: a2Sig, + }, + } + } + return attesterSlashings, nil +} + +func AttesterSlashingsElectraFromConsensus(src []*eth.AttesterSlashingElectra) []*AttesterSlashingElectra { + attesterSlashings := make([]*AttesterSlashingElectra, len(src)) + for i, s := range src { + attesterSlashings[i] = AttesterSlashingElectraFromConsensus(s) + } + return attesterSlashings +} + +func AttesterSlashingElectraFromConsensus(src *eth.AttesterSlashingElectra) *AttesterSlashingElectra { + a1AttestingIndices := make([]string, len(src.Attestation_1.AttestingIndices)) + for j, ix := range src.Attestation_1.AttestingIndices { + a1AttestingIndices[j] = fmt.Sprintf("%d", ix) + } + a2AttestingIndices := make([]string, len(src.Attestation_2.AttestingIndices)) + for j, ix := range src.Attestation_2.AttestingIndices { + a2AttestingIndices[j] = fmt.Sprintf("%d", ix) + } + return &AttesterSlashingElectra{ + Attestation1: &IndexedAttestationElectra{ + AttestingIndices: a1AttestingIndices, + Data: &AttestationData{ + Slot: fmt.Sprintf("%d", src.Attestation_1.Data.Slot), + CommitteeIndex: fmt.Sprintf("%d", src.Attestation_1.Data.CommitteeIndex), + BeaconBlockRoot: hexutil.Encode(src.Attestation_1.Data.BeaconBlockRoot), + Source: &Checkpoint{ + Epoch: fmt.Sprintf("%d", src.Attestation_1.Data.Source.Epoch), + Root: hexutil.Encode(src.Attestation_1.Data.Source.Root), + }, + Target: &Checkpoint{ + Epoch: fmt.Sprintf("%d", src.Attestation_1.Data.Target.Epoch), + Root: hexutil.Encode(src.Attestation_1.Data.Target.Root), + }, + }, + Signature: hexutil.Encode(src.Attestation_1.Signature), + }, + Attestation2: &IndexedAttestationElectra{ + AttestingIndices: a2AttestingIndices, + Data: &AttestationData{ + Slot: fmt.Sprintf("%d", src.Attestation_2.Data.Slot), + CommitteeIndex: fmt.Sprintf("%d", src.Attestation_2.Data.CommitteeIndex), + BeaconBlockRoot: hexutil.Encode(src.Attestation_2.Data.BeaconBlockRoot), + Source: &Checkpoint{ + Epoch: fmt.Sprintf("%d", src.Attestation_2.Data.Source.Epoch), + Root: hexutil.Encode(src.Attestation_2.Data.Source.Root), + }, + Target: &Checkpoint{ + Epoch: fmt.Sprintf("%d", src.Attestation_2.Data.Target.Epoch), + Root: hexutil.Encode(src.Attestation_2.Data.Target.Root), + }, + }, + Signature: hexutil.Encode(src.Attestation_2.Signature), + }, + } +} + func AttsToConsensus(src []*Attestation) ([]*eth.Attestation, error) { if src == nil { return nil, errNilValue @@ -957,6 +1317,33 @@ func AttsFromConsensus(src []*eth.Attestation) []*Attestation { return atts } +func AttsElectraToConsensus(src []*AttestationElectra) ([]*eth.AttestationElectra, error) { + if src == nil { + return nil, errNilValue + } + err := slice.VerifyMaxLength(src, 8) + if err != nil { + return nil, err + } + + atts := make([]*eth.AttestationElectra, len(src)) + for i, a := range src { + atts[i], err = a.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("[%d]", i)) + } + } + return atts, nil +} + +func AttsElectraFromConsensus(src []*eth.AttestationElectra) []*AttestationElectra { + atts := make([]*AttestationElectra, len(src)) + for i, a := range src { + atts[i] = AttElectraFromConsensus(a) + } + return atts +} + func DepositsToConsensus(src []*Deposit) ([]*eth.Deposit, error) { if src == nil { return nil, errNilValue @@ -1087,3 +1474,37 @@ func DepositSnapshotFromConsensus(ds *eth.DepositSnapshot) *DepositSnapshot { ExecutionBlockHeight: fmt.Sprintf("%d", ds.ExecutionDepth), } } + +func PendingBalanceDepositsFromConsensus(ds []*eth.PendingBalanceDeposit) []*PendingBalanceDeposit { + deposits := make([]*PendingBalanceDeposit, len(ds)) + for i, d := range ds { + deposits[i] = &PendingBalanceDeposit{ + Index: fmt.Sprintf("%d", d.Index), + Amount: fmt.Sprintf("%d", d.Amount), + } + } + return deposits +} + +func PendingPartialWithdrawalsFromConsensus(ws []*eth.PendingPartialWithdrawal) []*PendingPartialWithdrawal { + withdrawals := make([]*PendingPartialWithdrawal, len(ws)) + for i, w := range ws { + withdrawals[i] = &PendingPartialWithdrawal{ + Index: fmt.Sprintf("%d", w.Index), + Amount: fmt.Sprintf("%d", w.Amount), + WithdrawableEpoch: fmt.Sprintf("%d", w.WithdrawableEpoch), + } + } + return withdrawals +} + +func PendingConsolidationsFromConsensus(cs []*eth.PendingConsolidation) []*PendingConsolidation { + consolidations := make([]*PendingConsolidation, len(cs)) + for i, c := range cs { + consolidations[i] = &PendingConsolidation{ + SourceIndex: fmt.Sprintf("%d", c.SourceIndex), + TargetIndex: fmt.Sprintf("%d", c.TargetIndex), + } + } + return consolidations +} diff --git a/api/server/structs/conversions_block.go b/api/server/structs/conversions_block.go index 6a3f4e912997..df9c03710039 100644 --- a/api/server/structs/conversions_block.go +++ b/api/server/structs/conversions_block.go @@ -1827,6 +1827,654 @@ func (b *BlindedBeaconBlockDeneb) ToGeneric() (*eth.GenericBeaconBlock, error) { return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blindedBlock}, IsBlinded: true}, nil } +func (b *SignedBeaconBlockContentsElectra) ToGeneric() (*eth.GenericSignedBeaconBlock, error) { + if b == nil { + return nil, errNilValue + } + + signedElectraBlock, err := b.SignedBlock.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "SignedBlock") + } + proofs := make([][]byte, len(b.KzgProofs)) + for i, proof := range b.KzgProofs { + proofs[i], err = bytesutil.DecodeHexWithLength(proof, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("KzgProofs[%d]", i)) + } + } + blbs := make([][]byte, len(b.Blobs)) + for i, blob := range b.Blobs { + blbs[i], err = bytesutil.DecodeHexWithLength(blob, fieldparams.BlobLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Blobs[%d]", i)) + } + } + blk := ð.SignedBeaconBlockContentsElectra{ + Block: signedElectraBlock, + KzgProofs: proofs, + Blobs: blbs, + } + return ð.GenericSignedBeaconBlock{Block: ð.GenericSignedBeaconBlock_Electra{Electra: blk}}, nil +} + +func (b *SignedBeaconBlockContentsElectra) ToUnsigned() *BeaconBlockContentsElectra { + return &BeaconBlockContentsElectra{ + Block: b.SignedBlock.Message, + KzgProofs: b.KzgProofs, + Blobs: b.Blobs, + } +} + +func (b *BeaconBlockContentsElectra) ToGeneric() (*eth.GenericBeaconBlock, error) { + block, err := b.ToConsensus() + if err != nil { + return nil, err + } + + return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_Electra{Electra: block}}, nil +} + +func (b *BeaconBlockContentsElectra) ToConsensus() (*eth.BeaconBlockContentsElectra, error) { + if b == nil { + return nil, errNilValue + } + + electraBlock, err := b.Block.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Block") + } + proofs := make([][]byte, len(b.KzgProofs)) + for i, proof := range b.KzgProofs { + proofs[i], err = bytesutil.DecodeHexWithLength(proof, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("KzgProofs[%d]", i)) + } + } + blbs := make([][]byte, len(b.Blobs)) + for i, blob := range b.Blobs { + blbs[i], err = bytesutil.DecodeHexWithLength(blob, fieldparams.BlobLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Blobs[%d]", i)) + } + } + return ð.BeaconBlockContentsElectra{ + Block: electraBlock, + KzgProofs: proofs, + Blobs: blbs, + }, nil +} + +func (b *BeaconBlockElectra) ToConsensus() (*eth.BeaconBlockElectra, error) { + if b == nil { + return nil, errNilValue + } + if b.Body == nil { + return nil, server.NewDecodeError(errNilValue, "Body") + } + if b.Body.Eth1Data == nil { + return nil, server.NewDecodeError(errNilValue, "Body.Eth1Data") + } + if b.Body.SyncAggregate == nil { + return nil, server.NewDecodeError(errNilValue, "Body.SyncAggregate") + } + if b.Body.ExecutionPayload == nil { + return nil, server.NewDecodeError(errNilValue, "Body.ExecutionPayload") + } + + slot, err := strconv.ParseUint(b.Slot, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Slot") + } + proposerIndex, err := strconv.ParseUint(b.ProposerIndex, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "ProposerIndex") + } + parentRoot, err := bytesutil.DecodeHexWithLength(b.ParentRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "ParentRoot") + } + stateRoot, err := bytesutil.DecodeHexWithLength(b.StateRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "StateRoot") + } + randaoReveal, err := bytesutil.DecodeHexWithLength(b.Body.RandaoReveal, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.RandaoReveal") + } + depositRoot, err := bytesutil.DecodeHexWithLength(b.Body.Eth1Data.DepositRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Eth1Data.DepositRoot") + } + depositCount, err := strconv.ParseUint(b.Body.Eth1Data.DepositCount, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Eth1Data.DepositCount") + } + blockHash, err := bytesutil.DecodeHexWithLength(b.Body.Eth1Data.BlockHash, common.HashLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Eth1Data.BlockHash") + } + graffiti, err := bytesutil.DecodeHexWithLength(b.Body.Graffiti, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Graffiti") + } + proposerSlashings, err := ProposerSlashingsToConsensus(b.Body.ProposerSlashings) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ProposerSlashings") + } + attesterSlashings, err := AttesterSlashingsElectraToConsensus(b.Body.AttesterSlashings) + if err != nil { + return nil, server.NewDecodeError(err, "Body.AttesterSlashings") + } + atts, err := AttsElectraToConsensus(b.Body.Attestations) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Attestations") + } + deposits, err := DepositsToConsensus(b.Body.Deposits) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Deposits") + } + exits, err := SignedExitsToConsensus(b.Body.VoluntaryExits) + if err != nil { + return nil, server.NewDecodeError(err, "Body.VoluntaryExits") + } + syncCommitteeBits, err := bytesutil.DecodeHexWithLength(b.Body.SyncAggregate.SyncCommitteeBits, fieldparams.SyncAggregateSyncCommitteeBytesLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.SyncAggregate.SyncCommitteeBits") + } + syncCommitteeSig, err := bytesutil.DecodeHexWithLength(b.Body.SyncAggregate.SyncCommitteeSignature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.SyncAggregate.SyncCommitteeSignature") + } + payloadParentHash, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.ParentHash, common.HashLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ParentHash") + } + payloadFeeRecipient, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.FeeRecipient, fieldparams.FeeRecipientLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.FeeRecipient") + } + payloadStateRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.StateRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.StateRoot") + } + payloadReceiptsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.ReceiptsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ReceiptsRoot") + } + payloadLogsBloom, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.LogsBloom, fieldparams.LogsBloomLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.LogsBloom") + } + payloadPrevRandao, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.PrevRandao, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.PrevRandao") + } + payloadBlockNumber, err := strconv.ParseUint(b.Body.ExecutionPayload.BlockNumber, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.BlockNumber") + } + payloadGasLimit, err := strconv.ParseUint(b.Body.ExecutionPayload.GasLimit, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.GasLimit") + } + payloadGasUsed, err := strconv.ParseUint(b.Body.ExecutionPayload.GasUsed, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.GasUsed") + } + payloadTimestamp, err := strconv.ParseUint(b.Body.ExecutionPayload.Timestamp, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.Timestamp") + } + payloadExtraData, err := bytesutil.DecodeHexWithMaxLength(b.Body.ExecutionPayload.ExtraData, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExtraData") + } + payloadBaseFeePerGas, err := bytesutil.Uint256ToSSZBytes(b.Body.ExecutionPayload.BaseFeePerGas) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.BaseFeePerGas") + } + payloadBlockHash, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayload.BlockHash, common.HashLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.BlockHash") + } + err = slice.VerifyMaxLength(b.Body.ExecutionPayload.Transactions, fieldparams.MaxTxsPerPayloadLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.Transactions") + } + txs := make([][]byte, len(b.Body.ExecutionPayload.Transactions)) + for i, tx := range b.Body.ExecutionPayload.Transactions { + txs[i], err = bytesutil.DecodeHexWithMaxLength(tx, fieldparams.MaxBytesPerTxLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.Transactions[%d]", i)) + } + } + err = slice.VerifyMaxLength(b.Body.ExecutionPayload.Withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.Withdrawals") + } + withdrawals := make([]*enginev1.Withdrawal, len(b.Body.ExecutionPayload.Withdrawals)) + for i, w := range b.Body.ExecutionPayload.Withdrawals { + withdrawalIndex, err := strconv.ParseUint(w.WithdrawalIndex, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.Withdrawals[%d].WithdrawalIndex", i)) + } + validatorIndex, err := strconv.ParseUint(w.ValidatorIndex, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.Withdrawals[%d].ValidatorIndex", i)) + } + address, err := bytesutil.DecodeHexWithLength(w.ExecutionAddress, common.AddressLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.Withdrawals[%d].ExecutionAddress", i)) + } + amount, err := strconv.ParseUint(w.Amount, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.Withdrawals[%d].Amount", i)) + } + withdrawals[i] = &enginev1.Withdrawal{ + Index: withdrawalIndex, + ValidatorIndex: primitives.ValidatorIndex(validatorIndex), + Address: address, + Amount: amount, + } + } + + payloadBlobGasUsed, err := strconv.ParseUint(b.Body.ExecutionPayload.BlobGasUsed, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.BlobGasUsed") + } + payloadExcessBlobGas, err := strconv.ParseUint(b.Body.ExecutionPayload.ExcessBlobGas, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas") + } + + depositRequests := make([]*enginev1.DepositRequest, len(b.Body.ExecutionPayload.DepositRequests)) + for i, d := range b.Body.ExecutionPayload.DepositRequests { + depositRequests[i], err = d.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.DepositRequests[%d]", i)) + } + } + + withdrawalRequests := make([]*enginev1.WithdrawalRequest, len(b.Body.ExecutionPayload.WithdrawalRequests)) + for i, w := range b.Body.ExecutionPayload.WithdrawalRequests { + withdrawalRequests[i], err = w.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.WithdrawalRequests[%d]", i)) + } + } + + consolidationRequests := make([]*enginev1.ConsolidationRequest, len(b.Body.ExecutionPayload.ConsolidationRequests)) + for i, c := range b.Body.ExecutionPayload.ConsolidationRequests { + consolidationRequests[i], err = c.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.ConsolidationRequests[%d]", i)) + } + } + + blsChanges, err := SignedBLSChangesToConsensus(b.Body.BLSToExecutionChanges) + if err != nil { + return nil, server.NewDecodeError(err, "Body.BLSToExecutionChanges") + } + err = slice.VerifyMaxLength(b.Body.BlobKzgCommitments, fieldparams.MaxBlobCommitmentsPerBlock) + if err != nil { + return nil, server.NewDecodeError(err, "Body.BlobKzgCommitments") + } + blobKzgCommitments := make([][]byte, len(b.Body.BlobKzgCommitments)) + for i, b := range b.Body.BlobKzgCommitments { + kzg, err := bytesutil.DecodeHexWithLength(b, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.BlobKzgCommitments[%d]", i)) + } + blobKzgCommitments[i] = kzg + } + return ð.BeaconBlockElectra{ + Slot: primitives.Slot(slot), + ProposerIndex: primitives.ValidatorIndex(proposerIndex), + ParentRoot: parentRoot, + StateRoot: stateRoot, + Body: ð.BeaconBlockBodyElectra{ + RandaoReveal: randaoReveal, + Eth1Data: ð.Eth1Data{ + DepositRoot: depositRoot, + DepositCount: depositCount, + BlockHash: blockHash, + }, + Graffiti: graffiti, + ProposerSlashings: proposerSlashings, + AttesterSlashings: attesterSlashings, + Attestations: atts, + Deposits: deposits, + VoluntaryExits: exits, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: syncCommitteeBits, + SyncCommitteeSignature: syncCommitteeSig, + }, + ExecutionPayload: &enginev1.ExecutionPayloadElectra{ + ParentHash: payloadParentHash, + FeeRecipient: payloadFeeRecipient, + StateRoot: payloadStateRoot, + ReceiptsRoot: payloadReceiptsRoot, + LogsBloom: payloadLogsBloom, + PrevRandao: payloadPrevRandao, + BlockNumber: payloadBlockNumber, + GasLimit: payloadGasLimit, + GasUsed: payloadGasUsed, + Timestamp: payloadTimestamp, + ExtraData: payloadExtraData, + BaseFeePerGas: payloadBaseFeePerGas, + BlockHash: payloadBlockHash, + Transactions: txs, + Withdrawals: withdrawals, + BlobGasUsed: payloadBlobGasUsed, + ExcessBlobGas: payloadExcessBlobGas, + DepositRequests: depositRequests, + WithdrawalRequests: withdrawalRequests, + ConsolidationRequests: consolidationRequests, + }, + BlsToExecutionChanges: blsChanges, + BlobKzgCommitments: blobKzgCommitments, + }, + }, nil +} + +func (b *SignedBeaconBlockElectra) ToConsensus() (*eth.SignedBeaconBlockElectra, error) { + if b == nil { + return nil, errNilValue + } + + sig, err := bytesutil.DecodeHexWithLength(b.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + block, err := b.Message.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "Message") + } + return ð.SignedBeaconBlockElectra{ + Block: block, + Signature: sig, + }, nil +} + +func (b *SignedBlindedBeaconBlockElectra) ToConsensus() (*eth.SignedBlindedBeaconBlockElectra, error) { + if b == nil { + return nil, errNilValue + } + + sig, err := bytesutil.DecodeHexWithLength(b.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + blindedBlock, err := b.Message.ToConsensus() + if err != nil { + return nil, err + } + return ð.SignedBlindedBeaconBlockElectra{ + Message: blindedBlock, + Signature: sig, + }, nil +} + +func (b *SignedBlindedBeaconBlockElectra) ToGeneric() (*eth.GenericSignedBeaconBlock, error) { + if b == nil { + return nil, errNilValue + } + sig, err := bytesutil.DecodeHexWithLength(b.Signature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Signature") + } + blindedBlock, err := b.Message.ToConsensus() + if err != nil { + return nil, err + } + return ð.GenericSignedBeaconBlock{Block: ð.GenericSignedBeaconBlock_BlindedElectra{BlindedElectra: ð.SignedBlindedBeaconBlockElectra{ + Message: blindedBlock, + Signature: sig, + }}, IsBlinded: true}, nil +} + +func (b *BlindedBeaconBlockElectra) ToConsensus() (*eth.BlindedBeaconBlockElectra, error) { + if b == nil { + return nil, errNilValue + } + if b.Body == nil { + return nil, server.NewDecodeError(errNilValue, "Body") + } + if b.Body.Eth1Data == nil { + return nil, server.NewDecodeError(errNilValue, "Body.Eth1Data") + } + if b.Body.SyncAggregate == nil { + return nil, server.NewDecodeError(errNilValue, "Body.SyncAggregate") + } + if b.Body.ExecutionPayloadHeader == nil { + return nil, server.NewDecodeError(errNilValue, "Body.ExecutionPayloadHeader") + } + + slot, err := strconv.ParseUint(b.Slot, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Slot") + } + proposerIndex, err := strconv.ParseUint(b.ProposerIndex, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "ProposerIndex") + } + parentRoot, err := bytesutil.DecodeHexWithLength(b.ParentRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "ParentRoot") + } + stateRoot, err := bytesutil.DecodeHexWithLength(b.StateRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "StateRoot") + } + randaoReveal, err := bytesutil.DecodeHexWithLength(b.Body.RandaoReveal, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.RandaoReveal") + } + depositRoot, err := bytesutil.DecodeHexWithLength(b.Body.Eth1Data.DepositRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Eth1Data.DepositRoot") + } + depositCount, err := strconv.ParseUint(b.Body.Eth1Data.DepositCount, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Eth1Data.DepositCount") + } + blockHash, err := bytesutil.DecodeHexWithLength(b.Body.Eth1Data.BlockHash, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Eth1Data.BlockHash") + } + graffiti, err := bytesutil.DecodeHexWithLength(b.Body.Graffiti, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Graffiti") + } + proposerSlashings, err := ProposerSlashingsToConsensus(b.Body.ProposerSlashings) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ProposerSlashings") + } + attesterSlashings, err := AttesterSlashingsElectraToConsensus(b.Body.AttesterSlashings) + if err != nil { + return nil, server.NewDecodeError(err, "Body.AttesterSlashings") + } + atts, err := AttsElectraToConsensus(b.Body.Attestations) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Attestations") + } + deposits, err := DepositsToConsensus(b.Body.Deposits) + if err != nil { + return nil, server.NewDecodeError(err, "Body.Deposits") + } + exits, err := SignedExitsToConsensus(b.Body.VoluntaryExits) + if err != nil { + return nil, server.NewDecodeError(err, "Body.VoluntaryExits") + } + syncCommitteeBits, err := bytesutil.DecodeHexWithLength(b.Body.SyncAggregate.SyncCommitteeBits, fieldparams.SyncAggregateSyncCommitteeBytesLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.SyncAggregate.SyncCommitteeBits") + } + syncCommitteeSig, err := bytesutil.DecodeHexWithLength(b.Body.SyncAggregate.SyncCommitteeSignature, fieldparams.BLSSignatureLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.SyncAggregate.SyncCommitteeSignature") + } + payloadParentHash, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.ParentHash, common.HashLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.ParentHash") + } + payloadFeeRecipient, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.FeeRecipient, fieldparams.FeeRecipientLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.FeeRecipient") + } + payloadStateRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.StateRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.StateRoot") + } + payloadReceiptsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.ReceiptsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.ReceiptsRoot") + } + payloadLogsBloom, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.LogsBloom, fieldparams.LogsBloomLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.LogsBloom") + } + payloadPrevRandao, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.PrevRandao, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.PrevRandao") + } + payloadBlockNumber, err := strconv.ParseUint(b.Body.ExecutionPayloadHeader.BlockNumber, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.BlockNumber") + } + payloadGasLimit, err := strconv.ParseUint(b.Body.ExecutionPayloadHeader.GasLimit, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.GasLimit") + } + payloadGasUsed, err := strconv.ParseUint(b.Body.ExecutionPayloadHeader.GasUsed, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.GasUsed") + } + payloadTimestamp, err := strconv.ParseUint(b.Body.ExecutionPayloadHeader.Timestamp, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.Timestamp") + } + payloadExtraData, err := bytesutil.DecodeHexWithMaxLength(b.Body.ExecutionPayloadHeader.ExtraData, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.ExtraData") + } + payloadBaseFeePerGas, err := bytesutil.Uint256ToSSZBytes(b.Body.ExecutionPayloadHeader.BaseFeePerGas) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.BaseFeePerGas") + } + payloadBlockHash, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.BlockHash, common.HashLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.BlockHash") + } + payloadTxsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.TransactionsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.TransactionsRoot") + } + payloadWithdrawalsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.WithdrawalsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.WithdrawalsRoot") + } + payloadBlobGasUsed, err := strconv.ParseUint(b.Body.ExecutionPayloadHeader.BlobGasUsed, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.BlobGasUsed") + } + payloadExcessBlobGas, err := strconv.ParseUint(b.Body.ExecutionPayloadHeader.ExcessBlobGas, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas") + } + payloadDepositRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.DepositRequestsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.DepositRequestsRoot") + } + payloadWithdrawalRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.WithdrawalRequestsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.WithdrawalRequestsRoot") + } + payloadConsolidationRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.ConsolidationRequestsRoot, fieldparams.RootLength) + if err != nil { + return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.ConsolidationRequestsRoot") + } + + blsChanges, err := SignedBLSChangesToConsensus(b.Body.BLSToExecutionChanges) + if err != nil { + return nil, server.NewDecodeError(err, "Body.BLSToExecutionChanges") + } + err = slice.VerifyMaxLength(b.Body.BlobKzgCommitments, fieldparams.MaxBlobCommitmentsPerBlock) + if err != nil { + return nil, server.NewDecodeError(err, "Body.BlobKzgCommitments") + } + blobKzgCommitments := make([][]byte, len(b.Body.BlobKzgCommitments)) + for i, b := range b.Body.BlobKzgCommitments { + kzg, err := bytesutil.DecodeHexWithLength(b, fieldparams.BLSPubkeyLength) + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.BlobKzgCommitments[%d]", i)) + } + blobKzgCommitments[i] = kzg + } + + return ð.BlindedBeaconBlockElectra{ + Slot: primitives.Slot(slot), + ProposerIndex: primitives.ValidatorIndex(proposerIndex), + ParentRoot: parentRoot, + StateRoot: stateRoot, + Body: ð.BlindedBeaconBlockBodyElectra{ + RandaoReveal: randaoReveal, + Eth1Data: ð.Eth1Data{ + DepositRoot: depositRoot, + DepositCount: depositCount, + BlockHash: blockHash, + }, + Graffiti: graffiti, + ProposerSlashings: proposerSlashings, + AttesterSlashings: attesterSlashings, + Attestations: atts, + Deposits: deposits, + VoluntaryExits: exits, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeBits: syncCommitteeBits, + SyncCommitteeSignature: syncCommitteeSig, + }, + ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: payloadParentHash, + FeeRecipient: payloadFeeRecipient, + StateRoot: payloadStateRoot, + ReceiptsRoot: payloadReceiptsRoot, + LogsBloom: payloadLogsBloom, + PrevRandao: payloadPrevRandao, + BlockNumber: payloadBlockNumber, + GasLimit: payloadGasLimit, + GasUsed: payloadGasUsed, + Timestamp: payloadTimestamp, + ExtraData: payloadExtraData, + BaseFeePerGas: payloadBaseFeePerGas, + BlockHash: payloadBlockHash, + TransactionsRoot: payloadTxsRoot, + WithdrawalsRoot: payloadWithdrawalsRoot, + BlobGasUsed: payloadBlobGasUsed, + ExcessBlobGas: payloadExcessBlobGas, + DepositRequestsRoot: payloadDepositRequestsRoot, + WithdrawalRequestsRoot: payloadWithdrawalRequestsRoot, + ConsolidationRequestsRoot: payloadConsolidationRequestsRoot, + }, + BlsToExecutionChanges: blsChanges, + BlobKzgCommitments: blobKzgCommitments, + }, + }, nil +} + +func (b *BlindedBeaconBlockElectra) ToGeneric() (*eth.GenericBeaconBlock, error) { + if b == nil { + return nil, errNilValue + } + + blindedBlock, err := b.ToConsensus() + if err != nil { + return nil, err + } + return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_BlindedElectra{BlindedElectra: blindedBlock}, IsBlinded: true}, nil +} + func BeaconBlockHeaderFromConsensus(h *eth.BeaconBlockHeader) *BeaconBlockHeader { return &BeaconBlockHeader{ Slot: fmt.Sprintf("%d", h.Slot), @@ -1878,6 +2526,8 @@ func SignedBeaconBlockMessageJsoner(block interfaces.ReadOnlySignedBeaconBlock) return SignedBlindedBeaconBlockDenebFromConsensus(pbStruct) case *eth.SignedBeaconBlockDeneb: return SignedBeaconBlockDenebFromConsensus(pbStruct) + case *eth.SignedBeaconBlockElectra: + return SignedBeaconBlockElectraFromConsensus(pbStruct) default: return nil, ErrUnsupportedConversion } @@ -1961,14 +2611,10 @@ func SignedBlindedBeaconBlockBellatrixFromConsensus(b *eth.SignedBlindedBeaconBl } func BeaconBlockBellatrixFromConsensus(b *eth.BeaconBlockBellatrix) (*BeaconBlockBellatrix, error) { - baseFeePerGas, err := sszBytesToUint256String(b.Body.ExecutionPayload.BaseFeePerGas) + payload, err := ExecutionPayloadFromConsensus(b.Body.ExecutionPayload) if err != nil { return nil, err } - transactions := make([]string, len(b.Body.ExecutionPayload.Transactions)) - for i, tx := range b.Body.ExecutionPayload.Transactions { - transactions[i] = hexutil.Encode(tx) - } return &BeaconBlockBellatrix{ Slot: fmt.Sprintf("%d", b.Slot), @@ -1988,22 +2634,7 @@ func BeaconBlockBellatrixFromConsensus(b *eth.BeaconBlockBellatrix) (*BeaconBloc SyncCommitteeBits: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeBits), SyncCommitteeSignature: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeSignature), }, - ExecutionPayload: &ExecutionPayload{ - ParentHash: hexutil.Encode(b.Body.ExecutionPayload.ParentHash), - FeeRecipient: hexutil.Encode(b.Body.ExecutionPayload.FeeRecipient), - StateRoot: hexutil.Encode(b.Body.ExecutionPayload.StateRoot), - ReceiptsRoot: hexutil.Encode(b.Body.ExecutionPayload.ReceiptsRoot), - LogsBloom: hexutil.Encode(b.Body.ExecutionPayload.LogsBloom), - PrevRandao: hexutil.Encode(b.Body.ExecutionPayload.PrevRandao), - BlockNumber: fmt.Sprintf("%d", b.Body.ExecutionPayload.BlockNumber), - GasLimit: fmt.Sprintf("%d", b.Body.ExecutionPayload.GasLimit), - GasUsed: fmt.Sprintf("%d", b.Body.ExecutionPayload.GasUsed), - Timestamp: fmt.Sprintf("%d", b.Body.ExecutionPayload.Timestamp), - ExtraData: hexutil.Encode(b.Body.ExecutionPayload.ExtraData), - BaseFeePerGas: baseFeePerGas, - BlockHash: hexutil.Encode(b.Body.ExecutionPayload.BlockHash), - Transactions: transactions, - }, + ExecutionPayload: payload, }, }, nil } @@ -2061,23 +2692,10 @@ func SignedBlindedBeaconBlockCapellaFromConsensus(b *eth.SignedBlindedBeaconBloc } func BeaconBlockCapellaFromConsensus(b *eth.BeaconBlockCapella) (*BeaconBlockCapella, error) { - baseFeePerGas, err := sszBytesToUint256String(b.Body.ExecutionPayload.BaseFeePerGas) + payload, err := ExecutionPayloadCapellaFromConsensus(b.Body.ExecutionPayload) if err != nil { return nil, err } - transactions := make([]string, len(b.Body.ExecutionPayload.Transactions)) - for i, tx := range b.Body.ExecutionPayload.Transactions { - transactions[i] = hexutil.Encode(tx) - } - withdrawals := make([]*Withdrawal, len(b.Body.ExecutionPayload.Withdrawals)) - for i, w := range b.Body.ExecutionPayload.Withdrawals { - withdrawals[i] = &Withdrawal{ - WithdrawalIndex: fmt.Sprintf("%d", w.Index), - ValidatorIndex: fmt.Sprintf("%d", w.ValidatorIndex), - ExecutionAddress: hexutil.Encode(w.Address), - Amount: fmt.Sprintf("%d", w.Amount), - } - } return &BeaconBlockCapella{ Slot: fmt.Sprintf("%d", b.Slot), @@ -2097,23 +2715,7 @@ func BeaconBlockCapellaFromConsensus(b *eth.BeaconBlockCapella) (*BeaconBlockCap SyncCommitteeBits: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeBits), SyncCommitteeSignature: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeSignature), }, - ExecutionPayload: &ExecutionPayloadCapella{ - ParentHash: hexutil.Encode(b.Body.ExecutionPayload.ParentHash), - FeeRecipient: hexutil.Encode(b.Body.ExecutionPayload.FeeRecipient), - StateRoot: hexutil.Encode(b.Body.ExecutionPayload.StateRoot), - ReceiptsRoot: hexutil.Encode(b.Body.ExecutionPayload.ReceiptsRoot), - LogsBloom: hexutil.Encode(b.Body.ExecutionPayload.LogsBloom), - PrevRandao: hexutil.Encode(b.Body.ExecutionPayload.PrevRandao), - BlockNumber: fmt.Sprintf("%d", b.Body.ExecutionPayload.BlockNumber), - GasLimit: fmt.Sprintf("%d", b.Body.ExecutionPayload.GasLimit), - GasUsed: fmt.Sprintf("%d", b.Body.ExecutionPayload.GasUsed), - Timestamp: fmt.Sprintf("%d", b.Body.ExecutionPayload.Timestamp), - ExtraData: hexutil.Encode(b.Body.ExecutionPayload.ExtraData), - BaseFeePerGas: baseFeePerGas, - BlockHash: hexutil.Encode(b.Body.ExecutionPayload.BlockHash), - Transactions: transactions, - Withdrawals: withdrawals, - }, + ExecutionPayload: payload, BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), }, }, nil @@ -2228,15 +2830,6 @@ func BeaconBlockDenebFromConsensus(b *eth.BeaconBlockDeneb) (*BeaconBlockDeneb, for i, tx := range b.Body.ExecutionPayload.Transactions { transactions[i] = hexutil.Encode(tx) } - withdrawals := make([]*Withdrawal, len(b.Body.ExecutionPayload.Withdrawals)) - for i, w := range b.Body.ExecutionPayload.Withdrawals { - withdrawals[i] = &Withdrawal{ - WithdrawalIndex: fmt.Sprintf("%d", w.Index), - ValidatorIndex: fmt.Sprintf("%d", w.ValidatorIndex), - ExecutionAddress: hexutil.Encode(w.Address), - Amount: fmt.Sprintf("%d", w.Amount), - } - } blobKzgCommitments := make([]string, len(b.Body.BlobKzgCommitments)) for i := range b.Body.BlobKzgCommitments { blobKzgCommitments[i] = hexutil.Encode(b.Body.BlobKzgCommitments[i]) @@ -2275,7 +2868,7 @@ func BeaconBlockDenebFromConsensus(b *eth.BeaconBlockDeneb) (*BeaconBlockDeneb, BaseFeePerGas: baseFeePerGas, BlockHash: hexutil.Encode(b.Body.ExecutionPayload.BlockHash), Transactions: transactions, - Withdrawals: withdrawals, + Withdrawals: WithdrawalsFromConsensus(b.Body.ExecutionPayload.Withdrawals), BlobGasUsed: fmt.Sprintf("%d", b.Body.ExecutionPayload.BlobGasUsed), ExcessBlobGas: fmt.Sprintf("%d", b.Body.ExecutionPayload.ExcessBlobGas), }, @@ -2296,6 +2889,263 @@ func SignedBeaconBlockDenebFromConsensus(b *eth.SignedBeaconBlockDeneb) (*Signed }, nil } +func BeaconBlockContentsElectraFromConsensus(b *eth.BeaconBlockContentsElectra) (*BeaconBlockContentsElectra, error) { + block, err := BeaconBlockElectraFromConsensus(b.Block) + if err != nil { + return nil, err + } + proofs := make([]string, len(b.KzgProofs)) + for i, proof := range b.KzgProofs { + proofs[i] = hexutil.Encode(proof) + } + blbs := make([]string, len(b.Blobs)) + for i, blob := range b.Blobs { + blbs[i] = hexutil.Encode(blob) + } + return &BeaconBlockContentsElectra{ + Block: block, + KzgProofs: proofs, + Blobs: blbs, + }, nil +} + +func SignedBeaconBlockContentsElectraFromConsensus(b *eth.SignedBeaconBlockContentsElectra) (*SignedBeaconBlockContentsElectra, error) { + block, err := SignedBeaconBlockElectraFromConsensus(b.Block) + if err != nil { + return nil, err + } + + proofs := make([]string, len(b.KzgProofs)) + for i, proof := range b.KzgProofs { + proofs[i] = hexutil.Encode(proof) + } + + blbs := make([]string, len(b.Blobs)) + for i, blob := range b.Blobs { + blbs[i] = hexutil.Encode(blob) + } + + return &SignedBeaconBlockContentsElectra{ + SignedBlock: block, + KzgProofs: proofs, + Blobs: blbs, + }, nil +} + +func BlindedBeaconBlockElectraFromConsensus(b *eth.BlindedBeaconBlockElectra) (*BlindedBeaconBlockElectra, error) { + blobKzgCommitments := make([]string, len(b.Body.BlobKzgCommitments)) + for i := range b.Body.BlobKzgCommitments { + blobKzgCommitments[i] = hexutil.Encode(b.Body.BlobKzgCommitments[i]) + } + payload, err := ExecutionPayloadHeaderElectraFromConsensus(b.Body.ExecutionPayloadHeader) + if err != nil { + return nil, err + } + + return &BlindedBeaconBlockElectra{ + Slot: fmt.Sprintf("%d", b.Slot), + ProposerIndex: fmt.Sprintf("%d", b.ProposerIndex), + ParentRoot: hexutil.Encode(b.ParentRoot), + StateRoot: hexutil.Encode(b.StateRoot), + Body: &BlindedBeaconBlockBodyElectra{ + RandaoReveal: hexutil.Encode(b.Body.RandaoReveal), + Eth1Data: Eth1DataFromConsensus(b.Body.Eth1Data), + Graffiti: hexutil.Encode(b.Body.Graffiti), + ProposerSlashings: ProposerSlashingsFromConsensus(b.Body.ProposerSlashings), + AttesterSlashings: AttesterSlashingsElectraFromConsensus(b.Body.AttesterSlashings), + Attestations: AttsElectraFromConsensus(b.Body.Attestations), + Deposits: DepositsFromConsensus(b.Body.Deposits), + VoluntaryExits: SignedExitsFromConsensus(b.Body.VoluntaryExits), + SyncAggregate: &SyncAggregate{ + SyncCommitteeBits: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeBits), + SyncCommitteeSignature: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeSignature), + }, + ExecutionPayloadHeader: payload, + BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), + BlobKzgCommitments: blobKzgCommitments, + }, + }, nil +} + +func SignedBlindedBeaconBlockElectraFromConsensus(b *eth.SignedBlindedBeaconBlockElectra) (*SignedBlindedBeaconBlockElectra, error) { + block, err := BlindedBeaconBlockElectraFromConsensus(b.Message) + if err != nil { + return nil, err + } + return &SignedBlindedBeaconBlockElectra{ + Message: block, + Signature: hexutil.Encode(b.Signature), + }, nil +} + +func BeaconBlockElectraFromConsensus(b *eth.BeaconBlockElectra) (*BeaconBlockElectra, error) { + payload, err := ExecutionPayloadElectraFromConsensus(b.Body.ExecutionPayload) + if err != nil { + return nil, err + } + blobKzgCommitments := make([]string, len(b.Body.BlobKzgCommitments)) + for i := range b.Body.BlobKzgCommitments { + blobKzgCommitments[i] = hexutil.Encode(b.Body.BlobKzgCommitments[i]) + } + + return &BeaconBlockElectra{ + Slot: fmt.Sprintf("%d", b.Slot), + ProposerIndex: fmt.Sprintf("%d", b.ProposerIndex), + ParentRoot: hexutil.Encode(b.ParentRoot), + StateRoot: hexutil.Encode(b.StateRoot), + Body: &BeaconBlockBodyElectra{ + RandaoReveal: hexutil.Encode(b.Body.RandaoReveal), + Eth1Data: Eth1DataFromConsensus(b.Body.Eth1Data), + Graffiti: hexutil.Encode(b.Body.Graffiti), + ProposerSlashings: ProposerSlashingsFromConsensus(b.Body.ProposerSlashings), + AttesterSlashings: AttesterSlashingsElectraFromConsensus(b.Body.AttesterSlashings), + Attestations: AttsElectraFromConsensus(b.Body.Attestations), + Deposits: DepositsFromConsensus(b.Body.Deposits), + VoluntaryExits: SignedExitsFromConsensus(b.Body.VoluntaryExits), + SyncAggregate: &SyncAggregate{ + SyncCommitteeBits: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeBits), + SyncCommitteeSignature: hexutil.Encode(b.Body.SyncAggregate.SyncCommitteeSignature), + }, + ExecutionPayload: payload, + BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), + BlobKzgCommitments: blobKzgCommitments, + }, + }, nil +} + +func SignedBeaconBlockElectraFromConsensus(b *eth.SignedBeaconBlockElectra) (*SignedBeaconBlockElectra, error) { + block, err := BeaconBlockElectraFromConsensus(b.Block) + if err != nil { + return nil, err + } + return &SignedBeaconBlockElectra{ + Message: block, + Signature: hexutil.Encode(b.Signature), + }, nil +} + +func ExecutionPayloadFromConsensus(payload *enginev1.ExecutionPayload) (*ExecutionPayload, error) { + baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) + if err != nil { + return nil, err + } + transactions := make([]string, len(payload.Transactions)) + for i, tx := range payload.Transactions { + transactions[i] = hexutil.Encode(tx) + } + + return &ExecutionPayload{ + ParentHash: hexutil.Encode(payload.ParentHash), + FeeRecipient: hexutil.Encode(payload.FeeRecipient), + StateRoot: hexutil.Encode(payload.StateRoot), + ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), + LogsBloom: hexutil.Encode(payload.LogsBloom), + PrevRandao: hexutil.Encode(payload.PrevRandao), + BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), + GasLimit: fmt.Sprintf("%d", payload.GasLimit), + GasUsed: fmt.Sprintf("%d", payload.GasUsed), + Timestamp: fmt.Sprintf("%d", payload.Timestamp), + ExtraData: hexutil.Encode(payload.ExtraData), + BaseFeePerGas: baseFeePerGas, + BlockHash: hexutil.Encode(payload.BlockHash), + Transactions: transactions, + }, nil +} + +func ExecutionPayloadCapellaFromConsensus(payload *enginev1.ExecutionPayloadCapella) (*ExecutionPayloadCapella, error) { + baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) + if err != nil { + return nil, err + } + transactions := make([]string, len(payload.Transactions)) + for i, tx := range payload.Transactions { + transactions[i] = hexutil.Encode(tx) + } + + return &ExecutionPayloadCapella{ + ParentHash: hexutil.Encode(payload.ParentHash), + FeeRecipient: hexutil.Encode(payload.FeeRecipient), + StateRoot: hexutil.Encode(payload.StateRoot), + ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), + LogsBloom: hexutil.Encode(payload.LogsBloom), + PrevRandao: hexutil.Encode(payload.PrevRandao), + BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), + GasLimit: fmt.Sprintf("%d", payload.GasLimit), + GasUsed: fmt.Sprintf("%d", payload.GasUsed), + Timestamp: fmt.Sprintf("%d", payload.Timestamp), + ExtraData: hexutil.Encode(payload.ExtraData), + BaseFeePerGas: baseFeePerGas, + BlockHash: hexutil.Encode(payload.BlockHash), + Transactions: transactions, + Withdrawals: WithdrawalsFromConsensus(payload.Withdrawals), + }, nil +} + +func ExecutionPayloadDenebFromConsensus(payload *enginev1.ExecutionPayloadDeneb) (*ExecutionPayloadDeneb, error) { + baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) + if err != nil { + return nil, err + } + transactions := make([]string, len(payload.Transactions)) + for i, tx := range payload.Transactions { + transactions[i] = hexutil.Encode(tx) + } + + return &ExecutionPayloadDeneb{ + ParentHash: hexutil.Encode(payload.ParentHash), + FeeRecipient: hexutil.Encode(payload.FeeRecipient), + StateRoot: hexutil.Encode(payload.StateRoot), + ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), + LogsBloom: hexutil.Encode(payload.LogsBloom), + PrevRandao: hexutil.Encode(payload.PrevRandao), + BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), + GasLimit: fmt.Sprintf("%d", payload.GasLimit), + GasUsed: fmt.Sprintf("%d", payload.GasUsed), + Timestamp: fmt.Sprintf("%d", payload.Timestamp), + ExtraData: hexutil.Encode(payload.ExtraData), + BaseFeePerGas: baseFeePerGas, + BlockHash: hexutil.Encode(payload.BlockHash), + Transactions: transactions, + Withdrawals: WithdrawalsFromConsensus(payload.Withdrawals), + BlobGasUsed: fmt.Sprintf("%d", payload.BlobGasUsed), + ExcessBlobGas: fmt.Sprintf("%d", payload.ExcessBlobGas), + }, nil +} + +func ExecutionPayloadElectraFromConsensus(payload *enginev1.ExecutionPayloadElectra) (*ExecutionPayloadElectra, error) { + baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) + if err != nil { + return nil, err + } + transactions := make([]string, len(payload.Transactions)) + for i, tx := range payload.Transactions { + transactions[i] = hexutil.Encode(tx) + } + + return &ExecutionPayloadElectra{ + ParentHash: hexutil.Encode(payload.ParentHash), + FeeRecipient: hexutil.Encode(payload.FeeRecipient), + StateRoot: hexutil.Encode(payload.StateRoot), + ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), + LogsBloom: hexutil.Encode(payload.LogsBloom), + PrevRandao: hexutil.Encode(payload.PrevRandao), + BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), + GasLimit: fmt.Sprintf("%d", payload.GasLimit), + GasUsed: fmt.Sprintf("%d", payload.GasUsed), + Timestamp: fmt.Sprintf("%d", payload.Timestamp), + ExtraData: hexutil.Encode(payload.ExtraData), + BaseFeePerGas: baseFeePerGas, + BlockHash: hexutil.Encode(payload.BlockHash), + Transactions: transactions, + Withdrawals: WithdrawalsFromConsensus(payload.Withdrawals), + BlobGasUsed: fmt.Sprintf("%d", payload.BlobGasUsed), + ExcessBlobGas: fmt.Sprintf("%d", payload.ExcessBlobGas), + DepositRequests: DepositRequestsFromConsensus(payload.DepositRequests), + WithdrawalRequests: WithdrawalRequestsFromConsensus(payload.WithdrawalRequests), + ConsolidationRequests: ConsolidationRequestsFromConsensus(payload.ConsolidationRequests), + }, nil +} + func ExecutionPayloadHeaderFromConsensus(payload *enginev1.ExecutionPayloadHeader) (*ExecutionPayloadHeader, error) { baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) if err != nil { @@ -2371,3 +3221,33 @@ func ExecutionPayloadHeaderDenebFromConsensus(payload *enginev1.ExecutionPayload ExcessBlobGas: fmt.Sprintf("%d", payload.ExcessBlobGas), }, nil } + +func ExecutionPayloadHeaderElectraFromConsensus(payload *enginev1.ExecutionPayloadHeaderElectra) (*ExecutionPayloadHeaderElectra, error) { + baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) + if err != nil { + return nil, err + } + + return &ExecutionPayloadHeaderElectra{ + ParentHash: hexutil.Encode(payload.ParentHash), + FeeRecipient: hexutil.Encode(payload.FeeRecipient), + StateRoot: hexutil.Encode(payload.StateRoot), + ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), + LogsBloom: hexutil.Encode(payload.LogsBloom), + PrevRandao: hexutil.Encode(payload.PrevRandao), + BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), + GasLimit: fmt.Sprintf("%d", payload.GasLimit), + GasUsed: fmt.Sprintf("%d", payload.GasUsed), + Timestamp: fmt.Sprintf("%d", payload.Timestamp), + ExtraData: hexutil.Encode(payload.ExtraData), + BaseFeePerGas: baseFeePerGas, + BlockHash: hexutil.Encode(payload.BlockHash), + TransactionsRoot: hexutil.Encode(payload.TransactionsRoot), + WithdrawalsRoot: hexutil.Encode(payload.WithdrawalsRoot), + BlobGasUsed: fmt.Sprintf("%d", payload.BlobGasUsed), + ExcessBlobGas: fmt.Sprintf("%d", payload.ExcessBlobGas), + DepositRequestsRoot: hexutil.Encode(payload.DepositRequestsRoot), + WithdrawalRequestsRoot: hexutil.Encode(payload.WithdrawalRequestsRoot), + ConsolidationRequestsRoot: hexutil.Encode(payload.ConsolidationRequestsRoot), + }, nil +} diff --git a/api/server/structs/conversions_state.go b/api/server/structs/conversions_state.go index 33dc3af0813a..885ff861e3e4 100644 --- a/api/server/structs/conversions_state.go +++ b/api/server/structs/conversions_state.go @@ -593,3 +593,185 @@ func BeaconStateDenebFromConsensus(st beaconState.BeaconState) (*BeaconStateDene HistoricalSummaries: hs, }, nil } + +func BeaconStateElectraFromConsensus(st beaconState.BeaconState) (*BeaconStateElectra, error) { + srcBr := st.BlockRoots() + br := make([]string, len(srcBr)) + for i, r := range srcBr { + br[i] = hexutil.Encode(r) + } + srcSr := st.StateRoots() + sr := make([]string, len(srcSr)) + for i, r := range srcSr { + sr[i] = hexutil.Encode(r) + } + srcHr, err := st.HistoricalRoots() + if err != nil { + return nil, err + } + hr := make([]string, len(srcHr)) + for i, r := range srcHr { + hr[i] = hexutil.Encode(r) + } + srcVotes := st.Eth1DataVotes() + votes := make([]*Eth1Data, len(srcVotes)) + for i, e := range srcVotes { + votes[i] = Eth1DataFromConsensus(e) + } + srcVals := st.Validators() + vals := make([]*Validator, len(srcVals)) + for i, v := range srcVals { + vals[i] = ValidatorFromConsensus(v) + } + srcBals := st.Balances() + bals := make([]string, len(srcBals)) + for i, b := range srcBals { + bals[i] = fmt.Sprintf("%d", b) + } + srcRm := st.RandaoMixes() + rm := make([]string, len(srcRm)) + for i, m := range srcRm { + rm[i] = hexutil.Encode(m) + } + srcSlashings := st.Slashings() + slashings := make([]string, len(srcSlashings)) + for i, s := range srcSlashings { + slashings[i] = fmt.Sprintf("%d", s) + } + srcPrevPart, err := st.PreviousEpochParticipation() + if err != nil { + return nil, err + } + prevPart := make([]string, len(srcPrevPart)) + for i, p := range srcPrevPart { + prevPart[i] = fmt.Sprintf("%d", p) + } + srcCurrPart, err := st.CurrentEpochParticipation() + if err != nil { + return nil, err + } + currPart := make([]string, len(srcCurrPart)) + for i, p := range srcCurrPart { + currPart[i] = fmt.Sprintf("%d", p) + } + srcIs, err := st.InactivityScores() + if err != nil { + return nil, err + } + is := make([]string, len(srcIs)) + for i, s := range srcIs { + is[i] = fmt.Sprintf("%d", s) + } + currSc, err := st.CurrentSyncCommittee() + if err != nil { + return nil, err + } + nextSc, err := st.NextSyncCommittee() + if err != nil { + return nil, err + } + execData, err := st.LatestExecutionPayloadHeader() + if err != nil { + return nil, err + } + srcPayload, ok := execData.Proto().(*enginev1.ExecutionPayloadHeaderElectra) + if !ok { + return nil, errPayloadHeaderNotFound + } + payload, err := ExecutionPayloadHeaderElectraFromConsensus(srcPayload) + if err != nil { + return nil, err + } + srcHs, err := st.HistoricalSummaries() + if err != nil { + return nil, err + } + hs := make([]*HistoricalSummary, len(srcHs)) + for i, s := range srcHs { + hs[i] = HistoricalSummaryFromConsensus(s) + } + nwi, err := st.NextWithdrawalIndex() + if err != nil { + return nil, err + } + nwvi, err := st.NextWithdrawalValidatorIndex() + if err != nil { + return nil, err + } + drsi, err := st.DepositRequestsStartIndex() + if err != nil { + return nil, err + } + dbtc, err := st.DepositBalanceToConsume() + if err != nil { + return nil, err + } + ebtc, err := st.ExitBalanceToConsume() + if err != nil { + return nil, err + } + eee, err := st.EarliestExitEpoch() + if err != nil { + return nil, err + } + cbtc, err := st.ConsolidationBalanceToConsume() + if err != nil { + return nil, err + } + ece, err := st.EarliestConsolidationEpoch() + if err != nil { + return nil, err + } + pbd, err := st.PendingBalanceDeposits() + if err != nil { + return nil, err + } + ppw, err := st.PendingPartialWithdrawals() + if err != nil { + return nil, err + } + pc, err := st.PendingConsolidations() + if err != nil { + return nil, err + } + + return &BeaconStateElectra{ + GenesisTime: fmt.Sprintf("%d", st.GenesisTime()), + GenesisValidatorsRoot: hexutil.Encode(st.GenesisValidatorsRoot()), + Slot: fmt.Sprintf("%d", st.Slot()), + Fork: ForkFromConsensus(st.Fork()), + LatestBlockHeader: BeaconBlockHeaderFromConsensus(st.LatestBlockHeader()), + BlockRoots: br, + StateRoots: sr, + HistoricalRoots: hr, + Eth1Data: Eth1DataFromConsensus(st.Eth1Data()), + Eth1DataVotes: votes, + Eth1DepositIndex: fmt.Sprintf("%d", st.Eth1DepositIndex()), + Validators: vals, + Balances: bals, + RandaoMixes: rm, + Slashings: slashings, + PreviousEpochParticipation: prevPart, + CurrentEpochParticipation: currPart, + JustificationBits: hexutil.Encode(st.JustificationBits()), + PreviousJustifiedCheckpoint: CheckpointFromConsensus(st.PreviousJustifiedCheckpoint()), + CurrentJustifiedCheckpoint: CheckpointFromConsensus(st.CurrentJustifiedCheckpoint()), + FinalizedCheckpoint: CheckpointFromConsensus(st.FinalizedCheckpoint()), + InactivityScores: is, + CurrentSyncCommittee: SyncCommitteeFromConsensus(currSc), + NextSyncCommittee: SyncCommitteeFromConsensus(nextSc), + LatestExecutionPayloadHeader: payload, + NextWithdrawalIndex: fmt.Sprintf("%d", nwi), + NextWithdrawalValidatorIndex: fmt.Sprintf("%d", nwvi), + HistoricalSummaries: hs, + DepositRequestsStartIndex: fmt.Sprintf("%d", drsi), + DepositBalanceToConsume: fmt.Sprintf("%d", dbtc), + ExitBalanceToConsume: fmt.Sprintf("%d", ebtc), + EarliestExitEpoch: fmt.Sprintf("%d", eee), + ConsolidationBalanceToConsume: fmt.Sprintf("%d", cbtc), + EarliestConsolidationEpoch: fmt.Sprintf("%d", ece), + PendingBalanceDeposits: PendingBalanceDepositsFromConsensus(pbd), + PendingPartialWithdrawals: PendingPartialWithdrawalsFromConsensus(ppw), + PendingConsolidations: PendingConsolidationsFromConsensus(pc), + }, nil +} diff --git a/api/server/structs/other.go b/api/server/structs/other.go index 5694893d13cc..0a91b69ee752 100644 --- a/api/server/structs/other.go +++ b/api/server/structs/other.go @@ -29,6 +29,13 @@ type Attestation struct { Signature string `json:"signature"` } +type AttestationElectra struct { + AggregationBits string `json:"aggregation_bits"` + Data *AttestationData `json:"data"` + Signature string `json:"signature"` + CommitteeBits string `json:"committee_bits"` +} + type AttestationData struct { Slot string `json:"slot"` CommitteeIndex string `json:"index"` @@ -78,6 +85,17 @@ type AggregateAttestationAndProof struct { SelectionProof string `json:"selection_proof"` } +type SignedAggregateAttestationAndProofElectra struct { + Message *AggregateAttestationAndProofElectra `json:"message"` + Signature string `json:"signature"` +} + +type AggregateAttestationAndProofElectra struct { + AggregatorIndex string `json:"aggregator_index"` + Aggregate *AttestationElectra `json:"aggregate"` + SelectionProof string `json:"selection_proof"` +} + type SyncCommitteeSubscription struct { ValidatorIndex string `json:"validator_index"` SyncCommitteeIndices []string `json:"sync_committee_indices"` @@ -178,6 +196,11 @@ type AttesterSlashing struct { Attestation2 *IndexedAttestation `json:"attestation_2"` } +type AttesterSlashingElectra struct { + Attestation1 *IndexedAttestationElectra `json:"attestation_1"` + Attestation2 *IndexedAttestationElectra `json:"attestation_2"` +} + type Deposit struct { Proof []string `json:"proof"` Data *DepositData `json:"data"` @@ -196,6 +219,12 @@ type IndexedAttestation struct { Signature string `json:"signature"` } +type IndexedAttestationElectra struct { + AttestingIndices []string `json:"attesting_indices"` + Data *AttestationData `json:"data"` + Signature string `json:"signature"` +} + type SyncAggregate struct { SyncCommitteeBits string `json:"sync_committee_bits"` SyncCommitteeSignature string `json:"sync_committee_signature"` @@ -207,3 +236,39 @@ type Withdrawal struct { ExecutionAddress string `json:"address"` Amount string `json:"amount"` } + +type DepositRequest struct { + Pubkey string `json:"pubkey"` + WithdrawalCredentials string `json:"withdrawal_credentials"` + Amount string `json:"amount"` + Signature string `json:"signature"` + Index string `json:"index"` +} + +type WithdrawalRequest struct { + SourceAddress string `json:"source_address"` + ValidatorPubkey string `json:"validator_pubkey"` + Amount string `json:"amount"` +} + +type ConsolidationRequest struct { + SourceAddress string `json:"source_address"` + SourcePubkey string `json:"source_pubkey"` + TargetPubkey string `json:"target_pubkey"` +} + +type PendingBalanceDeposit struct { + Index string `json:"index"` + Amount string `json:"amount"` +} + +type PendingPartialWithdrawal struct { + Index string `json:"index"` + Amount string `json:"amount"` + WithdrawableEpoch string `json:"withdrawable_epoch"` +} + +type PendingConsolidation struct { + SourceIndex string `json:"source_index"` + TargetIndex string `json:"target_index"` +} diff --git a/api/server/structs/state.go b/api/server/structs/state.go index 4b07cfc20a8a..56a15e0c98e7 100644 --- a/api/server/structs/state.go +++ b/api/server/structs/state.go @@ -140,3 +140,43 @@ type BeaconStateDeneb struct { NextWithdrawalValidatorIndex string `json:"next_withdrawal_validator_index"` HistoricalSummaries []*HistoricalSummary `json:"historical_summaries"` } + +type BeaconStateElectra struct { + GenesisTime string `json:"genesis_time"` + GenesisValidatorsRoot string `json:"genesis_validators_root"` + Slot string `json:"slot"` + Fork *Fork `json:"fork"` + LatestBlockHeader *BeaconBlockHeader `json:"latest_block_header"` + BlockRoots []string `json:"block_roots"` + StateRoots []string `json:"state_roots"` + HistoricalRoots []string `json:"historical_roots"` + Eth1Data *Eth1Data `json:"eth1_data"` + Eth1DataVotes []*Eth1Data `json:"eth1_data_votes"` + Eth1DepositIndex string `json:"eth1_deposit_index"` + Validators []*Validator `json:"validators"` + Balances []string `json:"balances"` + RandaoMixes []string `json:"randao_mixes"` + Slashings []string `json:"slashings"` + PreviousEpochParticipation []string `json:"previous_epoch_participation"` + CurrentEpochParticipation []string `json:"current_epoch_participation"` + JustificationBits string `json:"justification_bits"` + PreviousJustifiedCheckpoint *Checkpoint `json:"previous_justified_checkpoint"` + CurrentJustifiedCheckpoint *Checkpoint `json:"current_justified_checkpoint"` + FinalizedCheckpoint *Checkpoint `json:"finalized_checkpoint"` + InactivityScores []string `json:"inactivity_scores"` + CurrentSyncCommittee *SyncCommittee `json:"current_sync_committee"` + NextSyncCommittee *SyncCommittee `json:"next_sync_committee"` + LatestExecutionPayloadHeader *ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header"` + NextWithdrawalIndex string `json:"next_withdrawal_index"` + NextWithdrawalValidatorIndex string `json:"next_withdrawal_validator_index"` + HistoricalSummaries []*HistoricalSummary `json:"historical_summaries"` + DepositRequestsStartIndex string `json:"deposit_requests_start_index"` + DepositBalanceToConsume string `json:"deposit_balance_to_consume"` + ExitBalanceToConsume string `json:"exit_balance_to_consume"` + EarliestExitEpoch string `json:"earliest_exit_epoch"` + ConsolidationBalanceToConsume string `json:"consolidation_balance_to_consume"` + EarliestConsolidationEpoch string `json:"earliest_consolidation_epoch"` + PendingBalanceDeposits []*PendingBalanceDeposit `json:"pending_balance_deposits"` + PendingPartialWithdrawals []*PendingPartialWithdrawal `json:"pending_partial_withdrawals"` + PendingConsolidations []*PendingConsolidation `json:"pending_consolidations"` +} diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index 39f2a476d24b..e7b4915e1c14 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -199,6 +199,7 @@ type ReadOnlyWithdrawals interface { NextWithdrawalValidatorIndex() (primitives.ValidatorIndex, error) NextWithdrawalIndex() (uint64, error) PendingBalanceToWithdraw(idx primitives.ValidatorIndex) (uint64, error) + PendingPartialWithdrawals() ([]*ethpb.PendingPartialWithdrawal, error) NumPendingPartialWithdrawals() (uint64, error) HasPendingBalanceToWithdraw(idx primitives.ValidatorIndex) (bool, error) } diff --git a/beacon-chain/state/state-native/getters_withdrawal.go b/beacon-chain/state/state-native/getters_withdrawal.go index e2a26d029673..5014f45db0cc 100644 --- a/beacon-chain/state/state-native/getters_withdrawal.go +++ b/beacon-chain/state/state-native/getters_withdrawal.go @@ -183,6 +183,15 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err return withdrawals, partialWithdrawalsCount, nil } +func (b *BeaconState) PendingPartialWithdrawals() ([]*ethpb.PendingPartialWithdrawal, error) { + if b.version < version.Electra { + return nil, errNotSupported("PendingPartialWithdrawals", b.version) + } + b.lock.RLock() + defer b.lock.RUnlock() + return b.pendingPartialWithdrawalsVal(), nil +} + func (b *BeaconState) pendingPartialWithdrawalsVal() []*ethpb.PendingPartialWithdrawal { return ethpb.CopySlice(b.pendingPartialWithdrawals) } From 8dd7361b6a8b190a0c62ff20f8515ab963be8fef Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Mon, 19 Aug 2024 22:29:49 +0800 Subject: [PATCH 259/325] Fix Gas Limit in Genesis (#14359) * Fix Gas Limit in Genesis * Comment --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- runtime/interop/genesis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/interop/genesis.go b/runtime/interop/genesis.go index df2dc0ad5a33..d7d442a15dde 100644 --- a/runtime/interop/genesis.go +++ b/runtime/interop/genesis.go @@ -172,7 +172,7 @@ func GethTestnetGenesis(genesisTime uint64, cfg *clparams.BeaconChainConfig) *co Nonce: 0, // overridden for authorized signer votes in clique, so we should leave it empty? Timestamp: genesisTime, ExtraData: extra, - GasLimit: math.MaxUint64 >> 1, // shift 1 back from the max, just in case + GasLimit: cfg.DefaultBuilderGasLimit, Difficulty: common.HexToHash(defaultDifficulty).Big(), Mixhash: common.HexToHash(defaultMixhash), Coinbase: common.HexToAddress(defaultCoinbase), From 068139a78a6a077529e0ff1c9ae5a713abe2836c Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 19 Aug 2024 13:20:57 -0300 Subject: [PATCH 260/325] remove unused function (#14360) --- beacon-chain/blockchain/chain_info_forkchoice.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/beacon-chain/blockchain/chain_info_forkchoice.go b/beacon-chain/blockchain/chain_info_forkchoice.go index afc02ddd7dac..cf735806fc58 100644 --- a/beacon-chain/blockchain/chain_info_forkchoice.go +++ b/beacon-chain/blockchain/chain_info_forkchoice.go @@ -22,13 +22,6 @@ func (s *Service) GetProposerHead() [32]byte { return s.cfg.ForkChoiceStore.GetProposerHead() } -// ShouldOverrideFCU returns the corresponding value from forkchoice -func (s *Service) ShouldOverrideFCU() bool { - s.cfg.ForkChoiceStore.RLock() - defer s.cfg.ForkChoiceStore.RUnlock() - return s.cfg.ForkChoiceStore.ShouldOverrideFCU() -} - // SetForkChoiceGenesisTime sets the genesis time in Forkchoice func (s *Service) SetForkChoiceGenesisTime(timestamp uint64) { s.cfg.ForkChoiceStore.Lock() From ed3d7d49ece44d2efaffdf3d564a56e0a7f2f2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Tue, 20 Aug 2024 18:57:08 +0200 Subject: [PATCH 261/325] Update block publishing Beacon APIs to Electra (#14361) * Update block publishing Beacon APIs to Electra * linter --- beacon-chain/rpc/eth/beacon/handlers.go | 116 ++++- beacon-chain/rpc/eth/beacon/handlers_test.go | 199 ++++++++ .../rpc/eth/shared/testing/BUILD.bazel | 6 +- beacon-chain/rpc/eth/shared/testing/json.go | 425 ++++++++++++++++++ .../rpc/eth/shared/testing/json_mainnet.go | 5 + .../rpc/eth/shared/testing/json_minimal.go | 5 + proto/prysm/v1alpha1/BUILD.bazel | 44 +- proto/prysm/v1alpha1/electra.ssz.go | 259 +++++++++-- 8 files changed, 1007 insertions(+), 52 deletions(-) create mode 100644 beacon-chain/rpc/eth/shared/testing/json_mainnet.go create mode 100644 beacon-chain/rpc/eth/shared/testing/json_minimal.go diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 4f3cf8d9658c..6f2c20d75bbb 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -286,7 +286,7 @@ func (s *Server) PublishBlindedBlockV2(w http.ResponseWriter, r *http.Request) { } } -func (s *Server) publishBlindedBlockSSZ(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { +func (s *Server) publishBlindedBlockSSZ(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { // nolint:gocognit body, err := io.ReadAll(r.Body) if err != nil { httputil.HandleError(w, "Could not read request body: "+err.Error(), http.StatusInternalServerError) @@ -297,6 +297,29 @@ func (s *Server) publishBlindedBlockSSZ(ctx context.Context, w http.ResponseWrit httputil.HandleError(w, api.VersionHeader+" header is required", http.StatusBadRequest) } + electraBlock := ð.SignedBlindedBeaconBlockElectra{} + if err = electraBlock.UnmarshalSSZ(body); err == nil { + genericBlock := ð.GenericSignedBeaconBlock{ + Block: ð.GenericSignedBeaconBlock_BlindedElectra{ + BlindedElectra: electraBlock, + }, + } + if err = s.validateBroadcast(ctx, r, genericBlock); err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + s.proposeBlock(ctx, w, genericBlock) + return + } + if versionHeader == version.String(version.Electra) { + httputil.HandleError( + w, + fmt.Sprintf("Could not decode request body into %s consensus block: %v", version.String(version.Electra), err.Error()), + http.StatusBadRequest, + ) + return + } + denebBlock := ð.SignedBlindedBeaconBlockDeneb{} if err = denebBlock.UnmarshalSSZ(body); err == nil { genericBlock := ð.GenericSignedBeaconBlock{ @@ -415,7 +438,7 @@ func (s *Server) publishBlindedBlockSSZ(ctx context.Context, w http.ResponseWrit httputil.HandleError(w, "Body does not represent a valid block type", http.StatusBadRequest) } -func (s *Server) publishBlindedBlock(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { +func (s *Server) publishBlindedBlock(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { // nolint:gocognit body, err := io.ReadAll(r.Body) if err != nil { httputil.HandleError(w, "Could not read request body", http.StatusInternalServerError) @@ -428,6 +451,27 @@ func (s *Server) publishBlindedBlock(ctx context.Context, w http.ResponseWriter, var consensusBlock *eth.GenericSignedBeaconBlock + var electraBlock *structs.SignedBlindedBeaconBlockElectra + if err = unmarshalStrict(body, &electraBlock); err == nil { + consensusBlock, err = electraBlock.ToGeneric() + if err == nil { + if err = s.validateBroadcast(ctx, r, consensusBlock); err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + s.proposeBlock(ctx, w, consensusBlock) + return + } + } + if versionHeader == version.String(version.Electra) { + httputil.HandleError( + w, + fmt.Sprintf("Could not decode request body into %s consensus block: %v", version.String(version.Electra), err.Error()), + http.StatusBadRequest, + ) + return + } + var denebBlock *structs.SignedBlindedBeaconBlockDeneb if err = unmarshalStrict(body, &denebBlock); err == nil { consensusBlock, err = denebBlock.ToGeneric() @@ -579,7 +623,7 @@ func (s *Server) PublishBlockV2(w http.ResponseWriter, r *http.Request) { } } -func (s *Server) publishBlockSSZ(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { +func (s *Server) publishBlockSSZ(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { // nolint:gocognit body, err := io.ReadAll(r.Body) if err != nil { httputil.HandleError(w, "Could not read request body", http.StatusInternalServerError) @@ -591,6 +635,39 @@ func (s *Server) publishBlockSSZ(ctx context.Context, w http.ResponseWriter, r * return } + electraBlock := ð.SignedBeaconBlockContentsElectra{} + if err = electraBlock.UnmarshalSSZ(body); err == nil { + genericBlock := ð.GenericSignedBeaconBlock{ + Block: ð.GenericSignedBeaconBlock_Electra{ + Electra: electraBlock, + }, + } + if err = s.validateBroadcast(ctx, r, genericBlock); err != nil { + if errors.Is(err, errEquivocatedBlock) { + b, err := blocks.NewSignedBeaconBlock(genericBlock) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + if err := s.broadcastSeenBlockSidecars(ctx, b, genericBlock.GetElectra().Blobs, genericBlock.GetElectra().KzgProofs); err != nil { + log.WithError(err).Error("Failed to broadcast blob sidecars") + } + } + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + s.proposeBlock(ctx, w, genericBlock) + return + } + if versionHeader == version.String(version.Electra) { + httputil.HandleError( + w, + fmt.Sprintf("Could not decode request body into %s consensus block: %v", version.String(version.Electra), err.Error()), + http.StatusBadRequest, + ) + return + } + denebBlock := ð.SignedBeaconBlockContentsDeneb{} if err = denebBlock.UnmarshalSSZ(body); err == nil { genericBlock := ð.GenericSignedBeaconBlock{ @@ -719,7 +796,7 @@ func (s *Server) publishBlockSSZ(ctx context.Context, w http.ResponseWriter, r * httputil.HandleError(w, "Body does not represent a valid block type", http.StatusBadRequest) } -func (s *Server) publishBlock(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { +func (s *Server) publishBlock(ctx context.Context, w http.ResponseWriter, r *http.Request, versionRequired bool) { // nolint:gocognit body, err := io.ReadAll(r.Body) if err != nil { httputil.HandleError(w, "Could not read request body", http.StatusInternalServerError) @@ -733,6 +810,37 @@ func (s *Server) publishBlock(ctx context.Context, w http.ResponseWriter, r *htt var consensusBlock *eth.GenericSignedBeaconBlock + var electraBlockContents *structs.SignedBeaconBlockContentsElectra + if err = unmarshalStrict(body, &electraBlockContents); err == nil { + consensusBlock, err = electraBlockContents.ToGeneric() + if err == nil { + if err = s.validateBroadcast(ctx, r, consensusBlock); err != nil { + if errors.Is(err, errEquivocatedBlock) { + b, err := blocks.NewSignedBeaconBlock(consensusBlock) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + if err := s.broadcastSeenBlockSidecars(ctx, b, consensusBlock.GetElectra().Blobs, consensusBlock.GetElectra().KzgProofs); err != nil { + log.WithError(err).Error("Failed to broadcast blob sidecars") + } + } + httputil.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + s.proposeBlock(ctx, w, consensusBlock) + return + } + } + if versionHeader == version.String(version.Electra) { + httputil.HandleError( + w, + fmt.Sprintf("Could not decode request body into %s consensus block: %v", version.String(version.Electra), err.Error()), + http.StatusBadRequest, + ) + return + } + var denebBlockContents *structs.SignedBeaconBlockContentsDeneb if err = unmarshalStrict(body, &denebBlockContents); err == nil { consensusBlock, err = denebBlockContents.ToGeneric() diff --git a/beacon-chain/rpc/eth/beacon/handlers_test.go b/beacon-chain/rpc/eth/beacon/handlers_test.go index 67b571042268..bd3fb3b1ec71 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_test.go @@ -1071,6 +1071,29 @@ func TestPublishBlock(t *testing.T) { server.PublishBlock(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + block, ok := req.Block.(*eth.GenericSignedBeaconBlock_Electra) + converted, err := structs.SignedBeaconBlockContentsElectraFromConsensus(block.Electra) + require.NoError(t, err) + var signedblock *structs.SignedBeaconBlockContentsElectra + err = json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &signedblock) + require.NoError(t, err) + require.DeepEqual(t, converted, signedblock) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.ElectraBlockContents))) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlock(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -1254,6 +1277,32 @@ func TestPublishBlockSSZ(t *testing.T) { server.PublishBlock(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + _, ok := req.Block.(*eth.GenericSignedBeaconBlock_Electra) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + var blk structs.SignedBeaconBlockContentsElectra + err := json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &blk) + require.NoError(t, err) + genericBlock, err := blk.ToGeneric() + require.NoError(t, err) + ssz, err := genericBlock.GetElectra().MarshalSSZ() + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(ssz)) + request.Header.Set("Content-Type", api.OctetStreamMediaType) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlock(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -1433,6 +1482,30 @@ func TestPublishBlindedBlock(t *testing.T) { server.PublishBlindedBlock(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Blinded Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + block, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedElectra) + converted, err := structs.BlindedBeaconBlockElectraFromConsensus(block.BlindedElectra.Message) + require.NoError(t, err) + var signedblock *structs.SignedBlindedBeaconBlockElectra + err = json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &signedblock) + require.NoError(t, err) + require.DeepEqual(t, converted, signedblock.Message) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.BlindedElectraBlock))) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlindedBlock(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -1617,6 +1690,32 @@ func TestPublishBlindedBlockSSZ(t *testing.T) { server.PublishBlindedBlock(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + _, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedElectra) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + var blk structs.SignedBlindedBeaconBlockElectra + err := json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &blk) + require.NoError(t, err) + genericBlock, err := blk.ToGeneric() + require.NoError(t, err) + ssz, err := genericBlock.GetBlindedElectra().MarshalSSZ() + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(ssz)) + request.Header.Set("Content-Type", api.OctetStreamMediaType) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlindedBlock(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -1788,6 +1887,30 @@ func TestPublishBlockV2(t *testing.T) { server.PublishBlockV2(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + block, ok := req.Block.(*eth.GenericSignedBeaconBlock_Electra) + converted, err := structs.SignedBeaconBlockContentsElectraFromConsensus(block.Electra) + require.NoError(t, err) + var signedblock *structs.SignedBeaconBlockContentsElectra + err = json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &signedblock) + require.NoError(t, err) + require.DeepEqual(t, converted, signedblock) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.ElectraBlockContents))) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlockV2(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -1984,6 +2107,32 @@ func TestPublishBlockV2SSZ(t *testing.T) { server.PublishBlockV2(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + _, ok := req.Block.(*eth.GenericSignedBeaconBlock_Electra) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + var blk structs.SignedBeaconBlockContentsElectra + err := json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &blk) + require.NoError(t, err) + genericBlock, err := blk.ToGeneric() + require.NoError(t, err) + ssz, err := genericBlock.GetElectra().MarshalSSZ() + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(ssz)) + request.Header.Set("Content-Type", api.OctetStreamMediaType) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlockV2(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -2176,6 +2325,30 @@ func TestPublishBlindedBlockV2(t *testing.T) { server.PublishBlindedBlockV2(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Blinded Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + block, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedElectra) + converted, err := structs.BlindedBeaconBlockElectraFromConsensus(block.BlindedElectra.Message) + require.NoError(t, err) + var signedblock *structs.SignedBlindedBeaconBlockElectra + err = json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &signedblock) + require.NoError(t, err) + require.DeepEqual(t, converted, signedblock.Message) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.BlindedElectraBlock))) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlindedBlockV2(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, @@ -2372,6 +2545,32 @@ func TestPublishBlindedBlockV2SSZ(t *testing.T) { server.PublishBlindedBlock(writer, request) assert.Equal(t, http.StatusOK, writer.Code) }) + t.Run("Electra", func(t *testing.T) { + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool { + _, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedElectra) + return ok + })) + server := &Server{ + V1Alpha1ValidatorServer: v1alpha1Server, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + var blk structs.SignedBlindedBeaconBlockElectra + err := json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &blk) + require.NoError(t, err) + genericBlock, err := blk.ToGeneric() + require.NoError(t, err) + ssz, err := genericBlock.GetBlindedElectra().MarshalSSZ() + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(ssz)) + request.Header.Set("Content-Type", api.OctetStreamMediaType) + request.Header.Set(api.VersionHeader, version.String(version.Electra)) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlindedBlock(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) t.Run("invalid block", func(t *testing.T) { server := &Server{ SyncChecker: &mockSync.Sync{IsSyncing: false}, diff --git a/beacon-chain/rpc/eth/shared/testing/BUILD.bazel b/beacon-chain/rpc/eth/shared/testing/BUILD.bazel index 0ef68bda6595..d9a33634e8c4 100644 --- a/beacon-chain/rpc/eth/shared/testing/BUILD.bazel +++ b/beacon-chain/rpc/eth/shared/testing/BUILD.bazel @@ -3,7 +3,11 @@ load("@prysm//tools/go:def.bzl", "go_library") go_library( name = "go_default_library", testonly = True, - srcs = ["json.go"], + srcs = [ + "json.go", + "json_mainnet.go", + "json_minimal.go", # keep + ], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared/testing", visibility = ["//visibility:public"], ) diff --git a/beacon-chain/rpc/eth/shared/testing/json.go b/beacon-chain/rpc/eth/shared/testing/json.go index 16aa30ce10d5..bad370cea5e5 100644 --- a/beacon-chain/rpc/eth/shared/testing/json.go +++ b/beacon-chain/rpc/eth/shared/testing/json.go @@ -1639,6 +1639,202 @@ const ( }` ) +var BlindedElectraBlock = fmt.Sprintf(`{ + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body": { + "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "eth1_data": { + "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "deposit_count": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "proposer_slashings": [ + { + "signed_header_1": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "signed_header_2": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } + ], + "attester_slashings": [ + { + "attestation_1": { + "attesting_indices": [ + "1" + ], + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + }, + "attestation_2": { + "attesting_indices": [ + "1" + ], + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + } + } + ], + "attestations": [ + { + "aggregation_bits": "0xffffffffffffffffffffffffffffffffff3f", + "committee_bits": "%s", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "0", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + } + ], + "deposits": [ + { + "proof": [ + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + ], + "data": { + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "amount": "1", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } + ], + "voluntary_exits": [ + { + "message": { + "epoch": "1", + "validator_index": "1" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ], + "sync_aggregate": { + "sync_committee_bits": "0x6451e9f951ebf05edc01de67e593484b672877054f055903ff0df1a1a945cf30ca26bb4d4b154f94a1bc776bcf5d0efb3603e1f9b8ee2499ccdcfe2a18cef458", + "sync_committee_signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "execution_payload_header": { + "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "block_number": "1", + "gas_limit": "1", + "gas_used": "1", + "timestamp": "1", + "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "base_fee_per_gas": "14074904626401341155369551180448584754667373453244490859944217516317499064576", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "blob_gas_used": "1", + "excess_blob_gas": "2", + "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "deposit_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "withdrawal_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "consolidation_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "bls_to_execution_changes": [ + { + "message": { + "validator_index": "1", + "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "to_execution_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ], + "blob_kzg_commitments":["0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8000"] + } + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" +}`, attestationCommitteeBits) + var DenebBlockContents = fmt.Sprintf(`{ "signed_block":{ "message": { @@ -1844,4 +2040,233 @@ var DenebBlockContents = fmt.Sprintf(`{ "blobs":["%s"] }`, Blob) +var ElectraBlockContents = fmt.Sprintf(`{ + "signed_block":{ + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body": { + "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "eth1_data": { + "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "deposit_count": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "proposer_slashings": [ + { + "signed_header_1": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "signed_header_2": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } + ], + "attester_slashings": [ + { + "attestation_1": { + "attesting_indices": [ + "1" + ], + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + }, + "attestation_2": { + "attesting_indices": [ + "1" + ], + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + } + } + ], + "attestations": [ + { + "aggregation_bits": "0x01", + "committee_bits": "%s", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + } + ], + "deposits": [ + { + "proof": [ + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + ], + "data": { + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "amount": "1", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } + ], + "voluntary_exits": [ + { + "message": { + "epoch": "1", + "validator_index": "1" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ], + "sync_aggregate": { + "sync_committee_bits": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "sync_committee_signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "execution_payload": { + "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "block_number": "1", + "gas_limit": "1", + "gas_used": "1", + "timestamp": "1", + "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "base_fee_per_gas": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "blob_gas_used": "1", + "excess_blob_gas": "2", + "transactions": [ + "0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86" + ], + "withdrawals": [ + { + "index": "1", + "validator_index": "1", + "address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "amount": "1" + } + ], + "deposit_requests": [ + { + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "amount": "123", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "index": "123" + } + ], + "withdrawal_requests": [ + { + "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "validator_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "amount": "123" + } + ], + "consolidation_requests": [ + { + "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "source_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "target_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + } + ] + }, + "bls_to_execution_changes": [ + { + "message": { + "validator_index": "1", + "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "to_execution_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ], + "blob_kzg_commitments":["0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8000"] + } + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "kzg_proofs":["0xaa0ef7404c3a164741856c78cc844072448886291e3c5b29514001d1bd8c5ccc9c342a1caa58c3b45734195ef4b4122a"], + "blobs":["%s"] +}`, attestationCommitteeBits, Blob) + var Blob = `0xe3078ecee8c4625a862b8abab2e220be24d7bcbb6b72dbcf0a2afa6b6b5ea77afb84bfa2ec47e6fbce8f3d4fa8a46b70a1db8adaec6cb2bdd1c36cda64ecfc9128aecf2d1b73c7ffe75dbac4efb9e49a5f05bda1df6f7caad2ebcea7fe9919de9afefc6581f2b7bfeac8bcdbfbaec107fdcdaf3cbe765898c01ada724ebca0aaf356ba584aec7a9f2e44d07ae60ed29347dbe0930ee05ada11b861d24a7f1e5afbcca9eaea56e714eca0a54194e6da9e2a34dfa3d2cebe6c1c9eeed7fde1ce8af8ed66d9a63273df5240d20e0e2b3cdffcf6ae8aa1698fb2204adcdd1e79afc4a4fecc7e096edee38c9bb9980dfac02518ff88dc44b20a664dcbb34661da4df5af8f97ac41dfb7cdaec2acc91cb3bb7acceabb1db6f0cbe71fe2580ed83d056d7ebaf87e4a1dac19143d6b889782ae0c7aa65e4af3feb4c7da479a1a3b6f102cf7c1dfd26b6ee2baafc281297be1fcf5e032dbde78a67123a920bf5b6bfefdb8dd94a86b6eefde5e7f9d683acf6a0c3b1ea013a5dfdf54be6a6cb3ae262fecffeee90bff4f556bfc4e9dddffdd4756611f8facb8666637aa3dcefcf1bfca29dda307c349b0cef9f0ec40bfeb1cfd4aaa8a85570487c4f834ab12ecbbfe1bdf932abd1d484b7d9e7efdba6215d34c6201da6ed9f907a50197b5067f7cd7d01ba94b1af82efbc8e9ef5d781ff1efecececfff36fafb16957bbffad95fbafb14ccfe2a2bf570bf90a6f98fc660d80c712f13d0d630d4710eefcd27603bfb3cb1b2c1e3d6c7bcdc537d80f7eb31ed785de8b47a4119415c83b352cef30d23dad7f3c701162aa37db213da385785aacc79faa5f5f6ec4bff4cbf51e82f56ad33870ae74fdc7dd2dbd8d76ff92a8446f723a8e42c79bdfde1c6b61bdafa97a9cc25ae83a3d9b1e493f5fc5e5999fbfebe1c0879dbf4d64d14e0ca6abe8b0b7dda5b95fc65370aaded9086ab27d0e2fbdbe7eaebf0abfe0befb3aa844eec5c563275daae53daeefebf8ce92abec499becabcfdfc8dbbf60cebf00e45195dd8ba2e3bc1cfd80f1aabbcc0cd805e402addee1aaeb99d4dcef8b37d6767d96c671f1d9115fa5a69dc14603ea8db1aeee78cdccafcef8dc8e7dedc821dfd8a6ede6f15aa797dfb3f5ebb2bbff023eeddce3b3a2f4ea041aa07e513a928dbf7eed9184fb54fc12385c4e494cea1e6bf00bf6f1560edfd027f5c98bd1a4ee38a3b14e2f2ae07ebdcd663ae1aacd5b1aeba14bae9f14cbeb4bfed399e9b0285cf1efee8f2ab31dfdf33b5e3defbd6ae6ab5b18e9e19cc5a35a8b1d76f9f90ae38cb564fe386da0a586d0dde1c7c80f19a442c365aa1f1c10fdb1765f6bf21dac76aa1e8ecbc31f8909605456aa1bf5d10851cc6c6c9ecee8cce790e4fcaccaecdde7a4f5a40cc20d18de0978132cdc4e5aa53b97ac84d942dbcd23bf0c8bb3c02bc87d0f3ac518b482d87dfa411aa795aee85a5b55c3b4e136cfc43fed3dbdcf2def75309ddaf34bed3cfa1bed1ccf0b4c5b8dd14a69e3edfb5ec17a2affda52193c372cecfb1cceb8274edcc9e49576d629de561602880ebce92a68200a441bbd0c1556ccc2aeb16fcaa78db1fdd755acc6c762fecedba1f2b78e9b5bcbf494e6178b63ca8d4f40ffc7e3bd4a16dbfd7db2e4e6dfe10a47f0cd6196ca7a2f4b33efa514dee868d0a21c6dadb909aad1eeb05eb3fcc7d144b1eaabfadbe027e3cafb4e4c8d7e0d2cfbcfba535200478f33f6a04eaffdaaac1508ab6971ab84e6845a528bc91d5d9bbdd1c873589e896c300d069ffce5ceaad93e460d992ec6b1becff291aec8eed5dd9df92ff389dfecef3dedf41ddebfb7186cfaae9df2ba8eb9fb331cdfbfa5ca5040ade7cfbc6e6d9719e4626dbc66d9bc6ceb8cdf2cffff78fe2f077cfdd7320e6e2dfe44eabcbfedae887ecc8d55f7844983cf4ec54956aa6fcdb9cf0e37d9ecc77fe1f8e8cc5e568dcf5e2d83e1daea5cabf7fdd8bacc4996163a168bf28458eaaa39fecb4fae8cd0fcbdb09bc8f41fc5fe332ce455caddc4a8fa8594b5f0d0109acfadfaacacdca2c59fac1a20a414cfd9a4efeab415be18e9a18eaeeda0faceb64a2aaa58ddbbaafb29dbff8f4b52ced51bbac4ed67ccf4cb711ac14e8bf58f17d50e729bafc3be97bb4e6354f855feecb504fa2f35efb184abde5f29ee1ae2c394be8efa2cad872b624ac2de8febcc55da95aa5b3998de83dd4deb3acd3a9fa4aaac50fc6e7c15fba147f0cf0bb7c62d675559cc95e4abaedefe4e1cfeadfb71efb5deed5351c8c5f56e4b99b13de9ffe6fdb27f4e20fe325af01c8e5a949a0d9ddbbf9500506baab9b19a5fd7222dbe63cedcbbddcc6e8d66ab2b05273acb9bc04d48dae12d4fbca9ed26fdd93fa75e010dc5e388cf3d082ffe6bb3f55ac4703ec56fdd1700eef433bd601aff0f321aaf4d3cc6dff15c7c719a0e2f7fc6882c9d4b88b78f750cb7ba1ae67ccf19b61f55c3d236cd0c5dc0e9cfbe0bf903bbedb2bd9e2e88ee8ca61b3fedffb4bbeeba18a3eac0f4c087abfdcfa279e9b9672dea173ece706a1a1bb04e937d52ad3d2ed27c3be082dcca4eeac9a2adfafab1ccfb15b7ecefcbaaf6dfab4eedff1baa59be84eb1dca03d81f0c6befdeee1ef2bc4c343c1bcab0b6fa7481ae4d9db769bedbd5d94fdb41992c9cffeca918b6fbccefcec37d55a6efcc7c03cebf1180be704daf2d9bce12ab6e09acb84b8accec9d34ab83fa7281eddc2b6a3ddbca9eebbf535db14153faa7aca596c2daadef89ca3dcc8da4f96751a38235c83f6d87ab57c47e72be6d9aa410d4d7bcf9d6d563ce8cbeba7ad6827a1c71b5ce31c1ee2c80fce8ac7c9e6ec8fe5d6e1a1a81db61adaddbaae52d07db73cac7e5cbcab253ef1cc3b7494cca8beda70f6adff3c7b730ff00faa39d655fb447abe997fadcd298d9385ebcdba5cd9f97b53c0a0bdb7bddb5eecee609c8dfb12e001ce4aeada75e85e0ef8f6a1cea84bee6aaddca7876b79f1ebd639dfa3b9890fbe7d80f5cecadcf37daaaa5b6c5142f951eafd7c16c533ab826ae1ce236f7603b2bd23e6629de1dfcb17ddc52f42780eb333f04fd2149aaac49f258a0e4cbc97aae3943d8edbc646f3f4ec652a195ead95a3e1310cfa8dceddd187de4bbb369a7abae6e8d95333bee5a53e6e5ecff7b8849eace10e8cdfbf5a3e4fff70c4e638ef22c7bae4355caefa0fb7b36baca793ad5d1be0ce93ef35fec8eeb8fac83a5da4cea7ccbab2e5b1ed5acb22197b3a75eb1fcde1e3dcd0a51aaf655790e58fabdc3aadefebbaed828fdbfefa98baaabda5d5b203aca7fc5369b62364d4a57c7c3e3cd77ac0d3de428b5ce61e93c05d8f11db6e3b0adc9c1ffabaa998ca827d8d87b69fb12caf5c6b0f70c7f989044c3dc8c8baebaafe0ccacaebaaae6026e596bc92e1bd6dcdc524ab90f3ae0ff0d1d252bf37c777f3addd72dbdeb9e2a79b563110fc623bed79ade04aab96e319621e69fde576eef79cc0e6a7b292f8faadedd9fc720fcbccfb7fcec60f930e4fbee3b4a2f1a091894c5447666f15f8a2a3f2e2cff0d1630ab2e8cbce90b4ecd8eb18fe741e8abbca937b8a430afa8f1a18b2ccb966fb42fd7237b1a8ac23c085b9229c4ccd0589e7f7a636dbabb7b706afa1be145216caff4e56cbb04ed36005a65202e1fb8bf6d7d2065d2ab64fa45fdbfbda455aaa10ecf9a51fed69d784dac36833aabc47f9aa2a3e0c60d6cef59cacabde633735f5dba4d5b3aac7c8064d2a2adff84c2f9763c58cfe0c794ca5bfec7ec65e8e3930ed78bcdf8e2203b04ee8bdb69faf6ea94aea5496fcf8aadeb233da3ccd4bdeead54aeffd3f8cebf50fcaaf55ffadbae92ece813e3d83aecfcf0cfb9d16d4c9a2e7ad3f972fd69197b84e2915d8bd84d0ca98acb296da9dece7dac0b7f068e2aaaa6f1cdf8559fb57e09fdda81cb30ea8bbf58a4e6d42bd9bced5c32a0d1a834ef33d37a31e9d07febdfdfc211defa2c5d4deafcdd9efac0da96ac77f921f3f7eec06418f2c434c66cfa1242f21b247caf08bd33dc8f78ca9abbcafefbaf67ff7ae4bcb6924f1edc88761e70eba8dc2a97dc31cbde7932cffee930163f916db61bc2c793edddcaf4429857cee1be109cfbfaeadb0c49ba6c8dba6ff7a2f47c05d3c3c3bc5c434fb058a807b09b1a2e94fa9a8fa4e2fac6268665acbdcaeaf7ab05e5ec2ec0f48601150e7c7aefdbe97ddfc09eb2f1f22a50513d7dfefa60cbcd7e42dcce8bceb2feca4d0ee4143b8848df89ce121df5acda10fe45ef707aceaad6504edb2aaaf668aab4ed3f1a1bfc5f88a009c307dcc396f0e5ea51ef484fbdbccefd110fd85cafe5c78ec95b35d63d0fd9fbc4ccdee95055fb23accaa875bda9ffde534bb9dabeecaf3e90d7f5bc5dd15dffac15fd811300adfdc66573abe0869df8c3a495db6ddef7beda9d52c28f31a5afaee99c3f64ace76acd8812dce37be20d9f4cad7b56a6dfd1f0a1edab62b3eafd30aeaaa6cd02afe6bc04d3fa38ea79d5d8ecba5c04ffecfa13cde8e54ccffdd812c192fa9fdfaaadfaa2bafcc7b3debcc6d84bdcdae4b3aeda5bd0b9acbeb39fd7ebc2eff082ecde91e1eac63cfaf1d4efe94f6ad44acaf5fd3d5feaaab6ebace2cf5ced0c02bce1b933fd0aacdcc8eeee9fa60e2ad5991eac44cf86eaccdbcb5ede1bc89e346bddeaf6032197dac0ab0ce8cd1f2bbf19bcdc0eb6b098e3b62bbb3edb62a8aca92bb8d4d01aaf1fca82ea3a4efb927ac507cecb93ce14eda836cdd83bae1a4eab4cad9f6f975a56ab8ab0ada8faea40ffb9f1f4f2c6d574dc5f1e1defc5a9ab5e0deb735b49fb3b6d10fe8eb3f51f77fffffccc6a1c57b17bf10285bdac91abc9c993f403ece1b85e1df7ffcf7bddf486ea3e9ffb838dcecddb89afb85fe30874b0b8add794cf3344baf161b9baff96b08ea04ddfa7232a66e2a1decafcdeb4a26e3bbac8089c63bcc4fdf3d42ca5d6d454aebadddb7614c81f53f5eee7f6d82edb98e042afeabdedaf573de15bb0a25c48cb1cdd22e1517ffe370db7f6bb1d4eab8236ca466fede9cd3fbb88eb5e1dec8e994aef3cc80c346aafbaa25ccce5d9b5a4caceb5ea7fbf7e4d5bd16c21fb16ec7d7da21b3d7fdc31ec54be605eeb921fa6f5c998a4fc2ce1ec059c6a6faca7e10ec7dad9cccfc4c08c0dc69cae4b7aeec96e8d49becaba3f43dbfdd29a4dddf3bf0ecd2e4ea1a76f816f00c7cb12b51182420697fde6859b6a01aecbbfdb02fdc6cfcde4a6d1e98de70d5a6dbaf42f7a2ddf4d5412a8ed5f36c719bf22261d783abeec2ae6da933d04e4aace69194ad52654dc48a9bf49ab84d0a41c9dc6c6fde6647ef0e1cfe7e5cf05dc15ebd632bead5a385f6da2114faea1d88baaabb99f7adae24d3b0ecf1fc8c9d0b1fccec2d6b2ae4bfacedde489be4bca282a1a8cfafad7ff2eee628da39fcdcb34a123f66aa6cfc9efaabc3cd819d23c8abdfbab31adff1c5f7131ed6b8bbd5aec4bfbb9a2b8fce8aa7c70ceb7fa774b26dbaefa786e449aa3794f7b3558cc84b2fc2df1a2d311f9d429f4d91c2fcd9cd07c0dfd924cd5e495851ec7433353beddc94326dbadcef6e0ffde56b6351312b2a306d4f4eca6eb2bbd19980f3567c5b02ae822717adaeb90aa843bd90c6368157b2622fb1ae69baf7a1ee3dbbf9c5c295f825ddb25f1791b13a7dbd2cedbe1ceecfa0bcca3cf92b8c7f7f7ffce9e982dbe7ca9e6f4fdf3b852a1479fbfb263814ba75beebaa1af0ff4acdfbc225d4e281069acf20f03ddceada3b9ab42a92adeb72f52a0a2e2bbcca6ac35fc39e74e910fbf0dfeeafc3accbf2f4c3ff88ba31a469bec96daff2adf1232eb6fdeefa7b764793b46f291bc27669d57e5ff60ea4eb88dab8f2834c4d26b2940e60376f524b119fb9881c4ac9644fdfae5d6656d7cd25136714a94af50dffcfe9583143abe0ad3ac9ffe6b42c2a5ae2d3456e5bb9231ef6e15f0cf6ff413ec07bbacc26cbe7c8f33ddb7c1eeb407f382a44ed12cad18abbbbfb0add2bc81a078b54da80d90bdc50396a7171ee577efb9577caa460c1c8debcf669481f4bc67ca15888c94b8381cfad6beafcfac41eb7fc0a7eb521667dc80ef3fd0b10f6decd72af98dfeedbac2a7bde4b481da60bbd6e8ee09a9bfb59beee7900aefb2c89d7f0d2ef6f2706031d6e2da3dc95cde1caf4bcfc4fcba7071aecde8bf870aa67feeaf4a8caebaf7c31ee1afe69fcfa4ad66e9afd9434c0ff898a9d82ba8de1b7cfeeeadfaa0d5bf57ccdcdc3a5bcfb0ddfd14b14cd6ccaf94119ccb13c8ea02f6edf652ee0f8c8beeb496d5c1aaa5ba4aebd0eae4ba190e38bd80416ba4ace6e5ed1fee4bfd1cbcac618a3b2eaa9bcf6851c2400e2cf7ae2aa5e7dc1aa61badc0944d4aee7f2adaf7e87bd6d6abcae1ccfcfeb7ff75acfdbbdcbb5157d49b7bbba76b8aba0f4768cc0acb8c549777ed5caaa6263774fa1ceb5aab25a64a92cd0dc2e2ddb448c36c8bbcc2a5cce68ce9c17890538ccfefecdb58aefb3aeeaad745a80b8b0bf7e751c8bcee6d293ed1abafe46fec88fbaef4b28c220cb36dbb7fe01b856afa6d8b748bdbf5f13c6dbd0ac9f2fdc0bdbf8a1454cbefbf22761aaa4fb0564ab569c7f78a91ddbfcfca466e3de9a1d4c8d3b9fdf1eb352aef54bdbd03accbd8ab35cdfbde2abe80eafbf3f3e9d8c1b4deba76ddaaab8b6d486fa2b92817fdbaeb1ade398a7d6eae2349c04e8bdaca4a1410cdcb9277cbe3d414aa57f6d2bba4aef3f1c8564bae93b2b3cface3ddcf63c3dacd67bc4dbd6f9a2e09eec18723a5da60b47eaeaadaecdf4f48d6ccf9ad873cfbb3bf8a4d31abcf79ddac7f2bd8e55107e2ecea8c7fab1df7d1d5dcadcf62afff4cb7ceb32cdb6f319a55476cfeaf0d5e2301b4ccb4cf9d08ac909f42f0daff13b6f0a7b2a7eb9e0d4ff7e63819bfeb5e37d595f26abf92fdee8aa7a2ec674ee4ff9ec25e837b2e63aba21fbfc5eeaeaeef9906685b52bc4bdda5d2fd65957a0dde7c680ea5e6fb324da2fdd551ff2fbb9f911b84c5babafb7dbb032ed0b88ffb2cbd06eedbbdc9faf9fb8ce5afc19febcaeca9f99c448887b91dc55fd62768acfa81c5ecb5d1a0eeea963cd8cfa0f80dfe17c150ca0dea0c18130eeb1a88fdbd6a31123dcbcb015cfece7ed2f31f0aab6fbd2c82bf7f2c9b4e19ce613daf0e07b5bf37dcc9c3f4d09ae2fb55e212bdda94d1ead77aaf9ce4b0ff658fc1e5d69b97ae757bcbe4fcf85b984d92357b64bb21e6dd253e141be9441cdfb706cd7e7edf0d1d7a3defddb1ef27b1785a560fccb5cdbb26ad4ceaafe4bfc9471aeb2db61773f522fb5ebe17c5679bba785f7123a47b2babe2b45fbf4e1ec92c1400cb5c2d6b4b75c9cfa018bb1ad425ca1e5f1decab7dcec177450b952d84ed6d8e18a6844dc34eeaf30cdee4cbe0d4ec56c5dddf5fc36f2ba6bdbdf19a99eca8460feed3dcd9cbeb4cce7d1ed0d668ad8d86aa2d7fac046b0a51dbbdfeedacb56f0a5db7eeabcfad863e6ef1a4ce9219febff0cd9f9a5edcb5898addeec181f41faf7bc0e1c7aeb961473cc4eb8acac46b7db6c79cfbcecee17a01010697b1ca5380ce438c93fc4f0fd26cb114dadca528c32dabcbaebeb478e6cfd35dd95e67dd13dc2df6f8fdbd2d0f54edda6c73ea63cd7d9232ef760f40eb0895b14eb1d2b093f61908e5f2673d4bd7d9363aaddbea90f878fa7f9fdd6628f5e7adaec780f88e4cd4c8cd8fdea5c4cbd09caea7ebbaecae999aaec0ceffa6db6598720edb1145eb479fdacabfdfc58a8727ffd05a9515ac0dae0acdc082c1dddcbb6cba729d25f208b00bd03c7f36e44effbe6c1ca7c2b0daa46cdafad4c4d01afed1b4f2c2af6b3fcfccd33963de2e85a3ffe1cfefbc7b9dedc27fa153dabc462dad095fe800cf1e6990d03bf94deee2c0cfca5441f397c1bfbb6ffe90a13dbadaea22baf7878ee8ee6b9febcc9b95eac4a1dba1cc28a816bd1d37caff08bbffbee004b0bf200fa1c7f968fadbe49ab76fb0ebe475a7cadf943eb0cebf7df87bf9fbf8aee807d4bc9fc53d7fef5aff32f3eabfa5ddafcfeb4f4b0d9dc2e6fd50695f1fe3a0bba14cd2eb94b5d97c8bddf74e9a47208d21105e3ed92cd78afbd3ee13cbb1cfdbcda6bd8fe31ded1dd255d09cd8e9d616bfe3fc9ad2165e6d98571db8eb779d70bcdf3ab75cade3e7a4dcded77ca5a1ed77cd0b203f03755ee5fdec84f97af902ecefd2a122d0a0ea1ec267ce2be7f6bb331e632bddfcc1dc32a6ae8f5e6662afaf9f7ff430eb412c071fdce1bc8e908ee1e17bfc3e6ef1e6a77577efd302ea9bcc3b10e1ebf11eb2aa7bf663d2e8ea286daeedb1dad3115bd3edbaacfbf9deedecc28bedce2fbb19ec10df16d739b003efbadf50e94c5cb8ba8f5ae4b639b3f6bc7e7bdf416bee17d09b771bd9baea355d63c69fcb909af4d73de7b120c6dee5cfeabeeec2059fc69f06252caa9baef1c5d33bdc6334adac49dbb8f1fef2cdbf41c42f5ebcdfc54bbddf5841c8aeffb58a6f3db38f8c9ccf25d4e7f3fc89e177624c6b698d33af5eb3900efe830c94af8feacc7a2a363a58128fb9cbedf2b9b6bede41f6cdb70ff55e5bfbbae417c92fa6a84d4f30ffa83aa34796cb6ab1dffeef7df937dc490ea7c9ad34e5f70f67f1b3bfda319ca1ee65bdfd9aaa9f44b809bcbc09a4f3dc974dcdd87bd22a6acbaf0457b38d3add82be44748d7b00c9665bbf1aeef96e58e6d89f2c5d6ec3adab6a9fee16f29be5204a191bb3bfd5061fed19e5c69302be04d96e67bfffbf1dee44123fa6ad799cfd6955bceada21caafe9350e03a01704dd4f6ecd4ef9bbd35e6f3cad57c9db744dbc4ceaf5f0e5eebacc1f2d5b8ebec5d48aa39daffc9c7d1a3acaaa7d72d06c96441306bbdb81d9b951be4f1eda8f6fa1c0eacbedc71fd3d1439803ebba3b56e11ce2071ed6495a6fb69acc6dfcf1718afeabe6fbf7973f8e0acc117f220bd68fa0e7723cd4adc84eb7ba490cbed9eff0d0aeefe1a94ccf1dafdc8c65dcdadff8c1cf9ddecb9c09bada29caecdaee2cbedf8b780661ab4e696d1f69ff8cbefa9920e8cad924e8ba766bc8541cba6f7ca850d3f63e27e0ecb40bbdcb9b7cd7bfda9aa4d0efe1de4d06dac08606efc9c16accddc22aed4f2d53da35d8d241770c9b157d09216ec5e0f59edeef93c4bbf223e8b2c2c863ccc37ee2c2d07bfd964dfbfc66db44cc2a1cfbb5ba23aedca07c753b0a0cdb3be2e68c07b3546af624ad0f9d4f3d1fe0cda95c3de9db51f3aab1e90df5d1e2e30389fbf350eed613f3a1eac940bd77990975436f152abd7cdc0ae49642d0ca2958e8d8eee5a6cec4ab9d852b16a261a8af537fde21e59a970acd5d3c784efa2534056bd827df9aec046dbcc2ecccb5b0df9653ef4a7ad2c64ce3d4afcbeaf7fcfc1a8a6fef2a5afbdcd7f6dba58edc7168ef149a9bda5b2f9422deeeaace01db0eb4dc9c1fa8d5a89c3b8e92fd4c7b81e6e7df39e47617fdcebec9329d5bfd6078587b08a7d0890ac7a0f2a54b8e3e3f28f4ddbaaed0de2aaafc8f3e5e7f39ffbca28f5e1abfd9c5ffa1f7adc36a68edece08a66c1d3ecea56572b5c1abfd39709cb8decc0cddc54ff7dcb2eb93cfd7acccc5126cee21c3e4ea91cffb4e5182dee6bc11bd721dda301cf41e42d5abd8418e3e5af3df6d5acffd012faffbac88cf23d68ceafd3f0cceffd4809bcdad320211b7a032ee09e51da61d22448db0a590dfe3a97e892ebb3ab736d0aa6d6d96d6d2ad18b0fd6eae2d0ec374bad124aeb2b4a1adb0d7f3fbc740a0be9a12ef5da86ba5c3d40c9e203dc07f81a062c7acfd410a4e6bdfa19c8df1f1d8aa995679e7d493ce760edb1e8dad0c2adfcc62b0abaacbcd88ef90f5efa4e20adfe5fc7a1024b4eaf8d42e4cbd2dbbaa48e0bbd9a1761cb2e7ad119f3652da3181cb55f8ac9aff93cb8d23e361deeca4dae907acaf09dbaebcafacf4ae3ea78edfc3e1793dbcc0a8585b0352faa31c4cf60cef8483982afb0df1e7c5cbe270674c8ebcae667fea4cbd3ca8d7e112fdb96d7ff3ea3dedd909b1c28900a57a69bd5cbaccaff6bab2d8a7fbaaeda11f2ce6ff856ae51e029db6717bcadb79d73a99a56e5ef35dfc5af3af7f15f2f6fb7a91a08be9e8af979382337acab6d750638f0e9eabe5fe4820da5dce1bcbaefc3feefef2f6cbb664a5beda1bc702e7fc7c5f1fbf03236a8dab3fefbc05eababbbc97cb14bcaf7c8ba3a8de71639b9d4a9efb0f8f26dcc3bac5fc0b4497917e35eeae493ba6eb47fa1748c5e6aacd79940739fd11aaa91d9d9d3c17e1fddfe2cf1c14deae07545b71043be9ccc9deef6d4d947bc01ebb3dd9c09cafca4dea4f69f1e74bba0eda5e6c96ffc0f0b0a58bbfadff3ade7cecae0f1d419a3ad7e89e7bed01bccd3f449b0ef1fe4eb9ecb0fbdee65defaece4f1b1444842dcbaacdcffbaacb2c054aaa31f9dadd5ca22cfa367b5fae0c7fccb434c0a1ca4fa3eadd8f9ec0bccfeaeb94afb9eac9269df81cce3cef8424f8ee09afdf8bd346b9314b91ddf976cabaaff5d27ed4ffd9e4b53e63d68630d7e55afb8d6bcfc4c13bc89d2acefef68e82d5649a8cdcfd01baa129600511b3cf8ab0d94b68e98f42ffa60decb26720edaf50259afaaf4dedbe13e72e9fbea2e4943fbf777b72ac9a1caaca9eaf9267ab851dc44fa5a9add92e22ada4f0c6fcdff3eafbb842bf8d52d8cd57ee6def44b670eb46f08ad2f08fc9caeecbab6f928beb4aa4fcab5e6bcccda1e3c61aac6cd85a9b274dca9ebdafedd66dfd7bebabac13540a8cadd5c6b7c2bd0c043a625ba2d2ca6e7aa559e2aeebeedbe85b0d539679eb9df6fcc932d27984b25aaecba93f0c2c9cbed6419b56532d2e0c80ac4956da2bbe3bda939670c851a5cf55cd71b8cb810ae2d034ede81b9effaa4eab44bd0dc7c69ac96be4fa2d511fea982e6fce8aa9bb0fca304efff4c1261f2e0bc042bdbfe6299e1eeac2ba7400ebe8aecae85c5bdc24b6e102febcff721edcb2bef81f7cc1c8e2b4b4e544e2a37b081af96ef18eb6bbaa1dac3f73a53bf4aa8f68bf2f0bdbead885cfd25ac5bd53caa4ee4a433e528e8dd5eebcef375a7bcac7ddd4c4f9cfcb8f7a2aef0c5b66aeba577385e3a3ffcbf7d705cc4beaffedb0ccced0e0ccac5aef6c254f0ccc7d65ddedaa5a0d3cd7567c93f28a0e1c0af7ca738d7ab0d096dcdebbacefcc6bcc16ee1a1f224fd6a94e3b2c2d8b78f9ccccfde1edbf4fcbc065a3d08e1c19146ae556ee3e1d1b32daa5f1b4be2f80adfd06ee7ec24bd4dc8aa7cbae33bbfed50bbebe8603e474fde208cdb8bdcb93bc62c7bced97ebca1c01ac9bae23bfedc7d888b7fef3aa0c3949fcaf4b3ffea1b6e3da9defeb9ae99aafc94e97db56c704caebe845e5bdbc6faebda40fc206d48f09a339141fbbe6a38030dd52d2f0f5b9f09ddb12b8f0ecadfc545df243c028ada2a6c877f558deedabef2e4b97b3d2a36c6919bce4d8fbad0f5cb163bcabcaf6eb644665b0828d04acaba9be4c4dfdc4b59fbaa55f5d966a41884aa87f3f4af2ea27d8eca1781deeb44c32d3f5a833cfde73a9a0a75dfad0a5a2feded1bf075c0af3cb47f107f1ec347dbbbcd2e78dca630daa089c6c8eb69ce9adde2744b0dea5b3337db5abd1ddcbdffaed2fb0be24daf4714a8008189bd1c0a8e411e5b5eea346607ea60cead0289ac1bf334ac0afac94bfe762cde4aa21f2c5ff686a4a6dd9ecd8e27f00be2efe0801488cefdfc722599b1fa4ddfa94bbde8db9d5a430aee2a2bfda15fc86bcadead9679d41bff7f8fadbbcea3d9b829e8decde446f5efbfccbda815f4fbec66b3caab0bccbdd06a2aefecff4bddb2c9bf5898ae655cd4cbdd9ba9aedac7ec78b1fbffef51ec6db4ab28ae7e85b80bb7cfe586b8ec9abf6def036d78bacfabedd5aa2e1b1d9667f5aae46dadfd793a00bdeb7eeee164852064ad848761fc1bafcfaadc3c21dc7e57ee7fa844a8aa1d9ee32567cca3fd1a0e108f8f4cde3c50b6d80ddbebb493fa8d5ae324a6d229aaa8b81e7c5efb6ab3810dbbb30bfbbd6e4c3deb0c6cf8c5619c30c1dbfbac7c8925ac364e5d4f3066513912be3ad9aded8b1e73c95bffbea4bb2dcda7ebb5ce7bdbaae1d72e997ecf81f71bac1e3f6bfbaf51fddbfbcda79c02cbdfce0446efce69f72fd39ceba4af9cadadffee6cb52cb672ddfdfc0da4f46fdd6cdd0e68cc66e0a2de3f3d3afa1b70f42d49dbd3cf95f32eaeb936947f8de4a810eff41fcce901737cac73bee92db006b1735c0a0b919abea8f887322dcfed9e8ae6edde8e42e8da9a059c5eecdcad9caebffd9cbb916a21460eaf6eeb481ccc41377ffbeaeebf70833bfa2f9cc8f0dc3df4eab5eecd9d9d8ae66eacfa7c7bb2d51360ad7a7adccf7ac4401bc96a419bce85e98b0353ebe457cb6b228efb8dcfdfcceefea9d9ee485afc764af4baae67b88e8e9803bc7e6bed8c2ffcec4b210b9ac1b9a15fe6dccd63bcba0dc53e789d1b02acccb3d834b3bfd3d0cb8c80f4bf9da4ece4ff286e16c7a1d2eea31e82eedbd6fd3aae8c5031ea2914deebaefbf01fdf48d696a6ada8b13faf0bdd5126ea1bbc758bfcffd6d0fdc1fbadbcdfbbb5f7d947cbeaedfb3668ee788b631bca58c1db3c55e4de1ac571a6c1b9ce1af4d88f39c9abefba128e2ff40c48e7af841ebae6feb2eabe4fc5aef54a55fda0b94b1ad0ad9b6fc26e04a5c919cca9ba1aa5bfddc81deea0acf239164b55eccbdce674d467f2f3bebf05092daf6aac8a66dfe5efebce64e14dbbecdffdf645ae4aec2befec35f916ed9bb82b36a2ab5c1e8f266ddb1a70fef2a4bd3cf8f9e71cddc8c7be19a93ff8c6fc98a19f6a7c986d90f0d1ebc950497d8a0d6fd49dc9e6f237da1ed7cb4681b7305aeea80ffec7da2d4eed97ee8124caab90af7e0a3b0a0eaedbdc5efe5a89eeec22aedfc29ca1879e2ea813201cc7be594bfe9fdd7dabca37daf2cea9e3aa40ed2d22dd6653b63eabc5eedb2cbc6cceaeea49fadcc6aafa0837febce0d41ea4ff7befad7507a0f6afc92b8de1bcaecb3e11fc3266a60090ec342c3c0cc363d72e11a5eca95d4ef9b2badb813681af2e5bbf5aa1aa9bbbfed5dbfcee2adcec9abe161d4d6aec0ff743c7ef7d2fd95b7d27831ad863c48a0ce61ea801a7eb18e4ae454afef0d51ba55a719f0436aaaa8b26e1860ea5e4c8b11d1a258e5d4e9fc4f3c33e18b35fda7bdfddfebfe41c1ebdebd2bbedb34bffdccdecdcde6eaebc0cce76ec4a13c4a1c8ddcacd0adde2f4588aeef63f3fc33f613aa42831215cfde9c508a5cd2fee1e446cba942a19a2e8efc5adf6301aaf937301cbdaad38ab4ceac5bac7ae576f3aef98fcab97ffdf4fe81d2ffccd6bda2e28ce8e918dda98beb64fff100b1dc9a556133cac119c9ffeee4d4addeacafbbdabefe0db3cb48eb06f8d46526be73cfdd06607dfaba73a5ffaadddbf2ba23a14e6f2e2bbaf1a3bd4f5ceabcde119b7af89ed90e5c9ff88fb0a2f6f7d8eb1c3dafd3c8cfd52d7afbcbb1ce1debb84f9708eca3c37bcc14ab8b56ed62ed1a64decffffb69da0c09afacf2bbba2aaddcc0bcb51d274e8d2a5adfd367f0ba50ebdee7ecd07b4fadebd99dfbc7f1eca840a1d83b1f9b8cc6ac9f9b5f21eca2dd5cfb5af8a8b3dd9769e0ec7620f4cd23b2cd4fa0a8ec7cdfff8f451af1afa27f7fdf010a66a962f6fb015c32a6cd53ce7b35ebce4a6f6c7e868dbbbe21fa2ce8efb569d6b379bde7afb4bd6b4c5761d92ede1cbfe5af9bc42a114c21fde478d4c6d5a94edaf95efeec2d67d7f486b84f7b24eef5295eebcf3c3c1ece2cfd369cd4ccfeccb1edb04b162d899bdef35faee327ceece11b17cf3c3ec68e9dab88ffc9942efdce03bbfddd3e7421ed847d8577633c0fb8f0afd47c9b6eff791bde78c2f9bdb01d67aafbb861fae89ca2adfb51d8420db39101f16fed569a6edef3c92a4dbebf74fdc423a1dfdff13c5bcaa9a32c0dca986ca14ceb54dddaa40ea1b21d3bbf7a761aeadede77b6aba2cfb35eaadaa642edc03337c0eca213e8ae51c32ff61798378ca2ab370796daa38efa417860a740e27abce38c1ab8ce0bf0a1ab58cacd13330ff9c2fc74bf7de87b2103361c6d8dd09f5e45ce5edbbea819afbdda5f5782a1b8595feffcbf8e6cd10bdbd6a5dbcd486cbb99eab1c71bff7fadcfc78d31fba7efb15bb7f5e9e4391e4dc46fac8cecac692e97feeefbea85780dc834a8f9ddcb6a5ccc45f0ae5ee42914902d1c6916c78cf187cadd39fcba6a596e75fcd178607e3781beffacf76bf05d00cb70501fff494ebb0aa24c165e2ec8bd8fa91f8a8eac12b8e6aecfbb1418ca8713d0cfd0dc4f6ab1ab63ba39da63226cdcbac81cfca8f040dfbfdb6b1cdcf5e6a1335e56cbab72bbee3053f1f3a2bace8dfaeedc9daa6c9a2f8d77e35dcbd1fc29b61acfefba3dbce54cfc82ab881d6be35ac2bf5326fa6fefb2dbed80648e1b16bc0de51964f9bf5531c21aff09edca821fda33ba2c4ef179c87ace0b0b09bbabdf3f7e2d387e45a1cddf1a0f3853281f39b5cdde67a4eabbe6e38b800bca1faa8a3d545fdec553d62e57c0c3002f7b9c217edbbc4e6bb1f8bfea56c7ded8a7c981cfc4d6f9af03beaf5ddde4bff386ed5bb7eaa4218449bf3e5df2808b3a1dcaa8afaa3abe48b48b4044e1ed4c3c6cc5b1cfec50c5a22ba9dacd81140b6d374bdae09fff4aeaa0fcc7bd2b4b70bcbbf0dde3deaa4fc14bd17bfe0f5fdebe98a1e80d3c1a9ead8ac151fa8213269c3e67ebcfc6b115cfcdda44ad84ba9ecdab619f2831e4efdfacdc896aebf05fc5c4876c9bbbdd2eb61c2a502ca61eacb4d9a1a8ecf5fe6d4bd977cbccd91c97a7f4106d00dd1b4ed002477082722b26ab8a5caf316179422dda0c4af52efd6bd0ae9adf8f270432fde70ae5340a8d8022ed8f2bc5da7a7db667e85ddb2bf0dda0cdee42c8a91f6174e8f0dc9eb5d451fe5fd3b8aecf332cb204abb7afd90a150fe535d8ef4eb42b6fcee66a6e7a9e39d8e0b69ae8d4103ca6a3c2ae6cc28ffc5c4f1f40dafeedba0ca8f2daa8b7ca5e3da2c4dfb6fc44ca4a02dabff72acef98b1d031fb2c9ee421e722c064cec61bd92a4edc3b5d0e55d926a33dab2abce3fd31ed1c2009bb4b443c3753ca11edfaa4aa906fafe3c07ba12fa11fb44e3aabe131f7c95fdc3e20e27fbacbe3fbabfc1ac3a62d3e3d75b5bc8ff30001ecd3d23c80c3b4bb048d7e228ae10a7fcdaf9c3a4736cdd7bc57b2a612b7ec5e8d12b50abc4b2fd4ba8ba20b55cba48beecc0a6c8cd944202483faa9ac2605035bfb1fab98208d2a1908dcc3ce72d0d9c04ca6a8ce27cb0273e29bcf0cc4cf2ae79ff78ce64f6a4a047d788fac0fcf79406cbec24e7ad82b9bfed0d10119be2c23a1a9c02cc05591c99af789fcfc92be2eaf98faabaa058fda500afcab232600b3dacf1f17fcc45aff670b1deecfe9babb0552d46252d7edc794bbb0331d51fbc25e6a1a921b893baaae6575ae24d82cd527739feea0dfcf26ae9a4ed6644ac60f6108c7eb961c3acc5d007c0e2a0141b2da5b8f4e85fec3e2b7f275f47bf417e4bc5bbadd7632faeba32a0e481d7b8fed3ab9711cdd4c7dbdc716ffdb3af7a3e05ccc83564ca1fe5affdbf51a20fa7be4b85c8d9929d24bbfbe897cd67b1bf1fefbd9c7cbdbdf0a32fada822b7647a1c1510635cac979edf333164bfa2e7bc18e9eafcdaaabea4b95acc648eff2ffe45d352cf02a5a2e40cd2d2db5abb73e18fe16e4cf47c1b222dbb0848d5a5d12eff5bdf1aa52bff9f8aefaaff6ddaaceddac79bfd5eee7f2b18de2ad3deae8bb2245430ea2181fd49ee8419bda96eed1bcba93d30dde6b54ccaaa1c45de7cbcdbb977bad9fa42fda02ffe6c7aee7df14721b12a1eacb13dab90e18ceede8cc9ff6be49fd0e011ce467a5b5c9a49cc8f705fec8fd0284cad1ee1f1df34e8fb3e28de0631c6e7558a538af8eab7ad63b5e2bf009b73ac226c10a979b0d4ff47ccb71995523fd5cfe5bd96e94ec27a3da8dd8ccbea91fe5e8d4e8c9cbac75d01af11b8da4cfbcdd0fcbc515a4adfacbd2d6eefe7bde46f45892add4eccf8db4ac18bb6eeee7afb3ed5cd1b3c297ef34ba6b6ac8b1d1f117d56e2bb76c5b31f25ac0d4a0ddd46ac6dda8a5b8064ba1ca4cbeac1168f3a2a357bffe7eab9fdae7c3ca749cadbfdc8c965cd009f6ba3b6debaa4f16dfc006a4a76928affea2781cb2db7efcfadfabaee5b0f1596eaadc725fbe855d7069a5da0cf2c5b483f1ba4de1eb1fac7fda2dc70d84f17d47afa07968ab3b81dee22ecc0475ad7a061ac7193adea1a7df97eb28bba3d2342d6c3b4d0b3b0ad4c9afbb3dfc1850dd33ba6633ac5b8c34cfdf3dc317b77d02bdfdfa6e97d7fa184eaedb1948d62ab8cc35a1854499afd9161febd4a9b2f8cfec3ff9ad7f6faefa2ce65110d12cefaab7c462ba19d15a0acba85d4a9c79b1946fead2a580badd7dd0b00294a16cb2a4cde1e9f929796ba8333c45bfc2345b09bb0f4babc4dda29d971581da4ece8fa13962d9ffe9cefdfc5c8f3f62aabffe2cce9b1cc5cdf36defd055f5304bdce62bcf851a38209dbaf7ddaa07e4f4d0f445039fe8fff6ef6d1ae7ca48c62aaaad39afc9ddf6828b7428c684fe1b73465ebea95fed8d5ebd2dc7feafcde2b9ccd3e19bf5de98151efd60b93edfd1556dd7af3857bfc59bc37d029b2bea8a4a5a5efc0ddec401be106a5c9fd3abbafdb3ceb99c2b7b927212ec485d02e4af566a283cc5e7ac1b0a09cdea6e16edcd9be6f906d8e2e5ea5ed96d62eef84b5c95a710fea34b9bb693247bd5c27cded11e7bebcbdafd896a0ffc8cabb3ae8ccbbcbcd2f6c329e1df8fb7b7dcfbabd1daccf8a82dfecf707fb8d191ada048bb0fe7c8d90842e9d9eca1ed23aebfa812a7a89d51cd766cd6df8ecca7dc4dee178cb7de6e8efaafceaa77efcbec0b879de2ff56ecbfccbadad72d6d0dfa8eac1faf7bebb40d69bc47c4aed2e7aad7252a1ebff0eacf0b62718b605c9be9fabd0056086be5eebfdce5f6576f179deadda96dd8ae9fcb0dd5a80eed8bbbe2a07c5fd5a8e3ff6a0e4fa3bc285dba5cca3bd9bb84eebf3dff4e595fdaca57d97fae65b5e55f6dcf099ab33d5e6a57c43e9fb9dd5effef6fdf01e3e5d94d1a65dd64913fbf079ca4bfcff0fd7db64962911c9a0c9cf62a28fbe2b140f31c76bd85ab3d41b1d8f01c450dd4aaa39dd9cdb7dc0abe01e04eba3adbc43433cdbdcb9f1c0ce46aace9a2fdbc523f2c6ea7cdaa3dc475212adff2d3be0fcbec0e85ec41c1fae7a3accc6bce52e0d204f1622d94b37bafad7ddfe295bbd97ebf07ecc72f03b8aad80d709c72ac654fc4ba9f261dce83e4ec9fdd6a7eaecb4e2b64ccabd65a675c2ebaafea829fdbabcef881b1b2b0aeee16cbc722feb951dfecfc1da8f989fc5f14a829e2ed1fb1f21f8cb7d69031cfdc4d7a35c6fcf3f2fb4bbe5acedbaf5a701ad61b0c1662b3226b0ed7cd30228da85aec8dc096dab9dbfc9e39ef6016c75b328b50d032df87ebd8cda9cccb1e9f32d6bcdbecf2d8a679bc4b5c35bab3ebdbb9e86c133b8b185eb1fb3cafd20f558c8f27c15c6eb1f1fa7b2575b1fd3dd806c868d36bbba850065c18ee891bea9563dddfcba58dcbfbe3c4a86d9a4dfee92c7f1ba98fe1ea03c9deef2f5e2a95d740a00b525797b713bc05108293a1f55cb2adccd1cb375b7b50e5d8a5953fc3c7e0376cb36dffef0b1ab2cef57f6ca7f4db4d52eceedcdc1acc21c7da9efe2d79b7ebeb5abaeeaadbfba22dfdfdfc0d591cbcaeee480dfcaecfbc778c7ba8eb7faaf2fb067cf4c5a18ec51ec03aead9bd5ea20eedc6b062c2e7a8907d9cbc5a8a9cacd1aace7ecf255bad409d68b36564cf9bcf0ad0ce0be94d6bb6ead25cfcbcbe3d8711d6abac37d31fe20ec729ce20e6a54967b4d5d5c9739ca2ff7fd790eabd9ff4ce7df4ee4cded3ebcdcbbb9f2bbbc8bbdcf1b5df67e701059daecf8c4fedd0e63faed4bcbf0957e4b2f7f647efe79a5f7c6bab4b3a4f8af226dcbe4c37b37fbceb7fb4ace8d2adc4b6643a626cef76efbc653c4bd65dccdcbaac41dd48ae7aaeacddbcacf7d48e3b634bdbdbbcbccae8603becfd012c6e69dd63a9dea68c0389f91c0c4d8b2a05b9be57bb64d4ed7d5d6aae37b3aed5ab651e28b8dba7d3de68dcd7ae271fefd67b7632efbadcd73bdaaac3f93d913af2bf32791de8dee44c5cc2c863f1e5c7cafda2f1a9c9abeffd84fe0cb7fdd3af4512aaff9659e9d363caaf369ccaa98345f697c9fe650400a1e4538ccd1410d48d41a8178ad4a832f0c1f8cd1a41ef8110a5cee4a7045402a550bedc1df41d782fcbe562bf6ecfa163e97f34f712cfa9de08e831f3a7b6e888defb660081f47b1d7be4e9b2ff3e9ab9909e1acea7960c1fda0e295cf62acdf9adb02aef138bb0a0a998bfb61cf1611563d3a97e8bf9085dfaf8d84d86a81e89080d8ee6b6d6768bfde0aa9c7ceefc2accadc3eea5427bc276ab7edcaf6abd194f4cca9e57d20a748db2d8376ba30ce6daf0f1abcfa2cc3057532aefec0c78ec3dee2abaee5ff810fcbe701efc7cbe4dae6cdebba97bceb6a5f8e520f9e10bbefa5a9c1bff02802ed84faacde02aa0cdf926c314faed12ec9af1feacc3a59ccdab6d1cbc5edb78abcffebd7fa13fcc2caa959cc9c1adffd5c5dabfebafcfb6ef546d30077a5bcb0bad2b693e5b3152dd73ed9afc6bbc72faf63fe2fd39eff1ded9e5caefe2635707b03efe2eabc9bd8e5605faeaa2e9ef5dba2a2b659d2fbb0b8b4174fb22add0395b7f3b4a73b7e4d21ed6235a49f520790cc297f3cfb56abf19ffaea3f615ea11a086887f6bbf2d4fc2a4094cf9bcf5ecb1a35bb2f3055860ffefe9fcccc5bc6c4cfad10caaeda5fe85cfabd4ce66d3ab5c372243a6ab21ebcba9bb9ebab2cb86a7a4bf2ca0c82c05c0ed1bde4ee4f05812bf196870fe8d3ea0c417fd3973497dcbaccf1d661e0e8f05088837ba53fe54e1faa3e5bcc0ae5c6da613d3db3234eae6c90adbdfb9ffe56af0ad28cff7fbadadc7d7f589fa352ae18aab65f6cda97c5dba343c7cce4ce5be7c522c9b3fcce6ad10e04f95e2dcbf12bcdc292bdfcc6deda65c7cfea0112dfb2caaf8d54ee5ca4b5484db99ad7e71dee8d08b4fabbd14abc1a3f03541dde9f94efeaa6e1dfd90170cccacb69be7af2a7dbf86320ff5ab9ef5dd660ccaa9f261f96ca5f5e0e44f00b1fdb3083fc3aae6af65bcb71f3939b73a155aff8e2cfc7ebc02afa3fcf5965f3ba9f5ff3fcf7fcf2cf0e46b33cb0edbbf41cd6a94fddf3ba4be8bebca9b0efacbb8f2c5f59ca35befacc3f1b300da18b15abc9ef311b7c9b87cffc375072020525bb36bfbbefccf386fcc1b5feebd93cc713e544a9f3cc2005e5d4af971fba9b9ae1b74de70bf0cdedae5d6d22a825cd91bc63d2fafe5fb69ef9d3db9f412bd7f08adb5dc70ca56ce0ab6fd3fb2eea9c4b5b7d27cac3b8b4121a73e5eaf8f9eb5bef51eb7ddc87e19bfffadd87abadac2dea99ff0e6ca8af1db7ef0c048ce9f924fdb1def9f1bcea7e2deac0771cc0ccd7bfea3b3ea2fb98f03a4cdee954c6ee08acc033f5e08ba46f87eeb56f3c7349bff3e0cc7e54feb647beb4855713499bdffa2bfe4c6efaa1d6daf64dcb9e0495bb4b9fb0cf302ffe0ef92073cab9966bbfb7cbbabd95b5481e9d6d88b11d2efd3a25daaed08bc1cbfaceedca023ba7ffb102ffabdf878ee0fdcdecfa6ecaade06c29ae06036edde24a56ae1a28f22eda51b89ad6fdebf82f7075bbb5feae7bfc6a86e43fd974c5df6b07d5baae561f45fce35dd7bd8a308fefffb835ecb6d2044abd0f8ff3ba5dc80ffa45f26caecc2dff41ed0baf03f8325feace5b8cbaaed74c08386d14d77fc7eebe2a766b4c127c9ba412b6d6bae130a921cd3a2d9ec91fba1b4dcf24a82aeeb6a5cf479ccf46e75fa0ab514c4bef38fab6fd5f27a2ecbcefb9c87eaef2cd7cd01cfed9a72ed25a2eacfbed86e169d035b27cdadcce66e8cccbda1b83b5ab563f9b4a7adabede6bf5e92ed55d3eedc2a5ec3d4030a01cf0fff49c1bfcb9b5ba6013fec63ad2fcc18a8696ea7bbe9fcca8e18577b3bf4db546b2b039b416a13fc001ddcb19fbae5ccc4d6fec27f1f4cc1d77b271cbe5cbf5f0df595c1b12ca36ebbea3ad14dabb21368fa7a498fb9f2fdeaa5a4ae02ee34f0e292d8083dd00c22fedda603d05db8d291937fab444f9a5d2be0a8fc56cdf6daeea66d3fbb3a579a319f27ded0e7737c7c2f4e6fa8cce67119e9c03da176628f857ed0d7d5b09391b9be2fbcda45eb8bdefbbfcaab719a6babcbee8f7c13ad0e9d799ea514bacaecb37dfcfe0282b90ad90d4f85c8f5c2fc3ddee3f25aeeb74ad6abff8ef94073fa973f52e56c1fece3c9d7f32d2c30c31be3edd3a7a79ddbe0ee8eaf7fdcdef50d784c60ee115fa6bce8f6d3b0bf6a305e7df9406b6302538b55369bb900426dee2447ce9b00e9ba37ca91cc76f5d6a347edc82e11f348dfa971c5ad5bfc159f66e1b3abf03fc8c80b1ca7c173e87fa7ec1b5e32aebee07e0e817ddd6374dfcca4840ecf88c0acad4c25d3d35e3758eae98e386e3abc9fba3a46d4d094ed59ba9f75b9653d6bdacfffb2d394cecdb17e4e406592d33dfcaecce9af75bd9d4c674b9a7f2c4f9cdd6e67bcc1809fbde7fbcf40aeabfb853681b6332bbbfdce4c25f629ae2efa2376c3acedc0ebdd4cb03bdca881f64bee8c42eb9afa9b1e3bff67fa0d24fbf11fe0da152ab6befa4e3380f85b2ac4d0b6d1fbaa0f52b8feb4e41508a8892cf2e774d8cbcfa84931e7612e8bf1af167b627e9ada0d9d540bebb424b36bffffb9164ede7d19b28b46ace227d8d23a7e385d97dbd8e954dfdbbe046dc1735a3d946fcebaec41e977d3f8d4d996ca53fe588ecf7bd2fa7cbb5fdec788a4c0110feb67fea5befdd50c51eef50bd1ee84171671e49eefce10cd4fb38433a1167b8c60e3a503c50e2dd7ad2d0c8aaebef67b24f0f0e7d4cd8e3c9c25a25a82885f4aaebc4dd66cddcc36c6cd5b23147fa329af28fe9c8c974998ec4cd2abea72bbeafc8cabaa70db7e99dc3a28c7bfad2fdc4dcccee7fa8fff5dadfb31effc6a96ddcb60b4bfc0cc1fe96c3bef3dffd9a697e25ecadcbf9ea014ebdacaaed69b9a6bfaac043afac6d13cd11a0d2dfe36cdcc3569cd3d467bfc13edb4ccecf2fac8a2d81defba0629d767ce1e33f54de8ea17a2813b6e868fc9bddccca808cf101ed41c7a3b3fb05bbc0292fd6bacf031dda14cbb67ebd9fab292fddceffcafee49acbafb0d1d854b2ef5c9ad0ca5c57c3fac1cd7281affdb73e6418ba25efc3c8c721cacb0ad550fad8add55a2177bf536a0aab1cede6d36bd883da9db1c7adcbae540ebe9e7400b5e51f2eefec6fde68696d3d92b3eddeaf3b9d7aa5e2ee2bc1adf4c3746aac7f8ca6ed9dada76dcb5adca6e5dbc10eab4ad2eb4d903ce5d9adbaafb0bf554b27e54a8b2bdfa60090bc0238ea7c7d753341deedd4baecbb5accadc22dca9dad4fef3bec07c68192ad13f3f194d56c222e39b411b31ac4fcf7c0d8153d0c53ee857d93ec0e078e13754be6b7e9ff0ed966d0f1fc9bc63419d1cdfb0ab1a2f9f2ba13fe2ff71d8307b77fdb202fcb2bb6e4e3dafb8bd9e9de20be2decadf80294c5ec2e3e77ecce0a4ac9bd3dcd5a87a622e53b6a7cccddecad43acebdcbd4ad656d62ca7710a3a29e9430b09c9d5c7f437c41a3b486deeffbc7cfbf2bac16e7db5caaccc497f0c09d7b2f9c51ecacdfedddedda7f6eee0de4dc11afca8bffbd53371efccaff77e4aad9fab7fec58ddff6c4aba6ea214fadc6ced4e1047daaff4ab89a8f0aba4e6ea0f6b011023a5e53ef9e76c5f2f566ddfe4e2d62e1cf08e63baab61d9b5dea8c8d2ce3e18c2c3317d824a2a9cfb3c431d56e258dfafda81ee67a07ad80fb9af6916abece6d5c74fdcf2b8d10a61ab0c4eae03906fa610abc78a73adb7ea3cbfca035c00b64cd566d0367e5d85c05b1396fbb9adcb4fd81ae4197c9edd9c5b5cb6deac9afd6dab08decbed7ebdb03198ed234135338acd667db3e9d1e4403c0378136e21c81c0fbcf673f2851fcada0f128ad64c58ce8eb8dc713cb24ff1adbec4adbd40da2f5ebdcff4e1aeda7eede191d7fdeccdcce891ba3dc858be6a4cb22f3b9c09cbc4e28dde7c3d925fc5d31569b5a9c6ae85c41a8118daededce4b9a434ced2a311edb5955247c03b5f9be40d356ac0eda45588c8e027a1c4c1fe2f0f6beddafcaf3eab5e4faaa1a59fdacc0aefccafccbb03ca30eee36f220bbfadaaeed3cd5a8dc7b3f087e95de1d97f2efdb2dceaa0e6e02f689eed90a5abb8c934dad44f85123c21a1abd4e011f4dfd55839cceaa788419621fc082862501fddef8c54ffbdfea7b3d61b37e7dd9e7a18ad058e9edada1d8c0e8eeeae84ea6e938cfae4d7bcff42ce19b49badda1b45adcc80a73e0c38bc6cbe6bccf7aeeb65fe3ca8be8e7d8d84caceb27cbab4f1baccf5bf16fe0ca0a1b46ddbcebcdfb658ca9f92da4fc3cff201dca83ba3c971dc37bab15f44cf17ad7c4f0b72ba46bb169c1d8fdfd4f2f9e8c109d0dc14d29f39be60bfeacfa2fa473cd7c172afcddabb66cf089bccfefadef7c4e82a3f38db87ac7cad29bbb3bd02a0f57ddcac0c9b3bd80ba365bf976e08acbe3c5d8bfbdd320809b64dded39ac298a961e725fe5b13d8f496edcf6ab30e9fd4f94bfd97baf0fae02f81dba840efddd7d63fba91c7d7b6ac222ebeafd3ad1fbe6de5cfae0d1d08ac7b5fe435e5af9faa91c5d6b519cf3ad6bccad1cbb83ea52efc1d4fadcd1d906fdebcb35dd0df07ceabfd2e210a5bf60ad9c91cb9b18fc76a977bf4c9e2feacbe1c8fa98bfacaff4df61edeb9e1ebae3b3bf8d6dea5e9dc207bdf3f0e34ceeab41bbe00a7a3d56a5fff4feeb95b0effdbe4a8eb49c58b4ddcb0fbda2c4aaed35b066a44da5bfb7bd89bb70be33c6acac2bb1f65dcb3afc9da6bfbdacf7c8aef0d72fb900d4a6a0acd1c47393dafca1c5144f3bbebf6b228ee9e8ebd00e6e6c8af50fab33d0eaa7a60ed18507ed45ea88977461bdd8aa40faa889eab556dab7dedead49eac93cb50c89d7a6a97fcd4a17c5feb8ae6a42dcacde3305df43ab2e58c477baedd75d03bb2ccbc4d7edbfebbe3a3ead2ca4f3cfc850fcdfa2e84efc1e60c216abfeccb31a7dabc47ca6fbabb6f9ce559e7faf8bd9cebb88f0f296efcd6bd7bf0ddbbc9db9d8642abefa798b8e9988b9caa901f2d663acdcdb00efbe513cb9ab450bb50606efa1ea7ad21f3ad83cfdd0f2a6a271196a4642f712beb8be8bcebfb33d9ba8d133edbb9a5cbf92cce8a51fc8aefabbf47d2be91f5fdcdce76c6891fcf04d7fadfc9e709ac4cb6b7ff56529353bdd0fef1a150ff5d19b0db4d1a98a0be429c94fbf7ecc1a7ff0fffbb52bf9fffd7bfe7c1f7cd2c8f2e57063ebd7ebaed6b81d827dd3cdbe8a5e8805e44a3288301aebc83a555ac927be2fccceae74174a64467f4eaa91d2ac4fffa51d7ee4788a8fd6a10e8dc1b6e15b596a0476f449f9facc70ecec125aadca109ab8f66dbcdd7e856f3abdfcdd944edaa4bdd8fefe1ab5ecb6bb79fdeca5cf5190ba8da051ccba46ffddb7ff4ae695fefff8f8d2d0ec63b88e78ea7aebfbfef1fc5969df08700d0868175e27deeb270bbb1ab8fb6167fc32fadc5fb2b8ed3d0fd395e98afc81fdebe81bee01cb2ca385eca0d8f3afc5aacaefc9c1efbabdcecdc9ac3b62d893faef266de1edfe852b6da0ff6fa056e449dbdbfb3fb76fcd3c5c57eb2a26d79b1c5bfa6a39ed6bd8d975d534652e0dda60ddefaaadf0ea79f176ce0cef8aeffceb3d98cd51c8b9acc93cfa1fbe76db28ab6119f2d79bba1cc36010c1eda9549d2ab855d8ce1a9fa5e0faefb9eb408a7fec6176780b2d2e99450cc8dec1baddbaf9e2ef2a3ca4800de52dede2beaca2feccae663ecabffdd7cee1d5da5eeeada912d334a7ea3bc043c5cedecaaabfefedb0cd9a340a1e9c58d615b5a864ab3d0934b711ced0ebeb584163a48bca7f46aa8afd2480b5f8da39576facc9862e8716c20d43a5a8e92a13fc77b1ccadd2cfec6ee6a0388cbbaec6268dc11efff37ca3cffae90079fdfdd88bbe1bcd48e91577cfdec0512f8de4cd0ca5c3ce4ff56bb0ef9bdec88ab9e5cea18bcbcbb4bb4ffdf5e5a8da8fbfbb9eafb071da26feee46de7f6904236a13ceb796e66cf8ffb7e8b4fcba25b880e36db866ec709edbc84ff1288b0511e1bca2d078b8cf503877faad92f3ca02deab06a5cae0143b9b42d50b4af6b0d6f405bddea0035aba1614aa479eb810d8caceabaefbac2f769bf175ee4e9ab5f16d98d7d85c88d954e8d8810cbd13f3bbceef9b19bda0fbd9ca6be328fc2dd64bbe08922af37c32771fb83a628a1ae545ff8a4fa4b6f54bbbee5e612da18bdf21b1a5262f40d65fdb64ceb7e7cc4fef673ee3dfafe449d7355ac964148e61b08eb3ab71583b46fadbf48d8f0f4a9fd3b46a67ccffacfcbf7ee4aee9eae0dec3cd0fe7c7f8ddea140e9dfa86bddf39c5817cff6b3ddc2627c4df3dd83bce9bbd5d7880e99cb14cbbc079a2bc9e4eccdafb42c69315a8caa88055b691beabd2eaafadb9b8cf2cb240fb86be24d3de9f3df8fc7dd07e05bee2bed6eb757aff630464f604b0cf9a5d5db1e1bd7fb5bea897ba66809b7e2f4623f2d5a5df430b8aa3d23ee3514ba174bc95a0e343574fe5f4b11fb3f33d7443f1673e41180ad2bdbfdafefb3c9fbe232d9a6f16ca683c26203c5ed92aaf15b86eb1fdc2fbf84bde56e27ebddbf510aebf1cdd8be8caa9dff19ff72fd8ee7d3a8987efee2efcaf0cd80fbbb7cc3a2dad59b7bac6eccad7c1cbaefbfb9362141bbba8fbc2019ac6c5c6a6ccecff8acc359ea30d63f94c2bee5ca1450e47e0dcfeef526d6ecce580fca2bce9ecc755681de6748c50fa95b19531f1194b5c0ee1cdbb2afc6e604e5a03a910d7416c49c4d6eb128efcf2ac9ef4d015dedf044e54dfef007b5bfa1788c879410acbfd92e825dcab1e6a5acc0adacbcff1fd7b09cbc8f8ee3306559141ced65b913c9fea2d08c9da626dc1d4dd3edb8aa98eea527a5fc3ff936bfaf13cf289a5e3571f63fe75afabec6d1ad8e1d9133a0bcfc39f8b01ec281fca06ab61b23aeddbac5db8e4c51f6bbc7cef39bd0cedff0f2eb5cf244c00c6b80ff4f0ccf38e3e656ebbace5d0c4bde46c7f37b3b8ddf369ddcd4d8ead41d7dded53f803f25a1d84c925c25adcbdf78c25a6ef7e48bec7bbdeb2f5bfa6f8cee7d87d4383d161b1eabfac5e7cdcaf5ff92bbe37dff9f2bd0a6cc12b24343cdf3ea9f2c3f82fbe2bb18d31b997deeff386bec7ac727e9e9ff89dafacac4729cb6bb71878d639448cab52523bf81f0cdcd0d7af29df2deb5cbcbb44d1f6ca70eea7f32fe08a56d5dee46ecded5c03c61bdcc7cedc0ef0cbce142fde4998c4ef1414d0d8e3a913f0074c1ed73b1aa567f2ccba7da2bfec01ac8d9edba948962adcaf43205afddfb552bc0dfca42dbcbe676852da4daca619efbca48f298edeee8027ff58df6f3bb7f9fa5e9c8de688bcd31d7b77a978dacf5e31e8eca5e0cd2cbdc3df95d3ecde870ffcc7445bb3ee6f29bf4db19f65096fee9ac8ea4d1de50eb6ef15bfc01cceaad0064f656ef4c068a19a712dfcb64dcdde3442becb74475199d848af790c83c4dc45bfed3ec9c83cbb923ecef71c91c7dfbcbaf34daada3f9eacd322cfefc05c8000380c334c099aceec523dd8bd6bf6ce3105fdfcd7af9dedc50a8e7e1d10e0ff2f4a4f00ef8eb94fc35ed0cb9cdb3957af9a09bfaee30fbaec68aa1d50abdde5d2a6082cebb6f7bda1e377d618fd4cbf2b1a8ccbb4883f0a6ef87faaa8c4d57bea8bfd5e5fc3ce4cb4bca7bbeb9a03a9b725ebacda7d9991fe5c94dbe3a1647fdf1ecd9fffb2bdb0caa0b91ad760d837cc6bc69ca26d2ffb0165f4d73ca0f7e6889e9fc3fa5f36b56bfe75678e3db0cdacc3d577df0abd86a02e7dd8bd62f7f8b46f8cbfec2f250df025da3eca9397d83c73628afe769e74d0f8c88ca6b7eabf9c5f8bd4ffaeecfa94e04d36ae0f5decb4028ab1b954a4b4c33aa668c2efc3df320efffffa7b05deabe16be4afbb2ff612a66696a9ed929ca17ecaa7eeeef6ddea8445e5d1d0cdaba56e493cdfeca6dbbe12a8c056f0449cec5b4cebb45e6b2ba0eff80beb484d6fca94cbecd5f590c0782fecf87b4bed6ba2843ec6257de7f79dbd2b2edaa80d9d0ccceb924a59dfd9adbdc282f1a725d5dead258b2296d1adefdb3aa14e6542bfbfcd6af49490ce41bafd1d6ad6ffe9f0d70fccbba2541ed88938dff38ec5e57b856742bce12fdbea7f8a71a57653a3de397f6eb1294dcce2fd7f5c8d63ac3abea39b1adcd9abf6e432d4dad32eefd87bff88f2e78f546b1ce4c44b7ef2ef3d1afcd8e95dfde26b805bc36d85442e1aae65ea3c10e8d1d3db8bba0aedc4a229607dc5aba62da5294c6e1e52b132aa0acacd9a7eeee71a398a3eb1353d6a3f68b3f13cacd6dde33cc42d8f3febfec7df51b6beea4630e23ab2a5c93c106b9390f310e95b623535baaafb391d5cac87aa3cbc332e5ec8baeec343bdeca5bbc31ebe9d7bfad0ac8d4ef6e79302d94beeedcec5f12ed63dafe3fe0a3fc37f28b9ddd3315a9ab4b07f26e0ec4b4a5c2b7c55b6748e1efc585898c3e951af9dbf1821e0eab51187bbfb85c67ded1b9fcbcd4f8c1ceb87decaafb38bbc7aadfeab70e04fcc508f1d41dab6ad4ebffeadf0cdcece5c65a4edaca3fe372bedb0c3ebdb9b3cabd54fb93bdf5cdccf57476bbfe8f35df4f90ff16fd0eabead2b7a19d0f21107708a74df3b0dff55e4d928c8fcc55df73d8dbddacc77328d4df9ec59fc7ea576ce5cbb3e49bafd7159b3cef7fae2de0aaecdbce39d7faaf7cada1d7de988fbae416e3401209d0eb0e68ce11dba6de924faf1db0aefd2cff4eeb13601fbceedbbeedde2c5bddd7d4534dbfcddd09366bca6dfcfd0b3ddafaeccaefe953d18c85b05381f6dddc65381a81f51c89e2cad0a74d1e4de81588a9d27b1d2db4d3e245ae7271cc881aa5b8528b8acb9fc7814d71f766eb7fdb95c22ff3f2eaaece7bfbd112c115ddb369cdb20ee43e031d1a6b06cd1ad9a0e64bdd74bfddaeb6a8fb56082de6fcada2aff2bdb3af55cac6aed6bbfa3d33ea93d6ae4ddeb2d4e4e75bfa7cdcaedd1ffad2ab8a1ffacfdd7a9eecacafc82fefc6cbbaa8caaa60141ce4fccfa69a377d1522bbd55cbb1d071b2a7b1d5d5ff6d0d36d8b53924afb0c5bedf7eb14bd5fc169aefe5daf7b5f7b19af09e2f94682aab0ad4dbd3d68e0949e8fd4234adebb3299d309c3edd58abead53c3ba74791eddecea0a208c3da448f6052b21fee17e58633780fd654a1e9d8cd97fab5cbcb0fccd19ce94d872deac381b6ee7dbebec57aa3773ae1530376e7338a3baa2f1e8ebcb78a0f71dd37d04e77c3df497a5b5728cc7eade1e22c979708e904174b18b0be471c77df2a6ed4e0b99baffe5b1ddaec4ae4d1fb7d4cb7be6dd2ff4c57aa7cf659cf84ea7acb19816dcbb9a9fea8cbce5dea0a0c592dd0141ccab3cf12ee2bf45dbd64996736440632e46cf5eb1effa70fcc12a1aca0fc8ee05952c006f59a21755f94a1adcca46c292abeddeedec5c8c360fa9defe9a8dc6e1b2a625baafa81cb92f4aebef8af3afe2c1a686f3a19c307d5c112f0db99aadf2ad51d7b4c182cba4dcf768f9eb0b2fa0447a4b38fa9ae5358e6ebfadbb24754d70ea4bdafdaffefd22e723da5cb417ad9b9a19cab15b2e7b0254a3b24d1a71bc8d7b4ff6aaa5b4c6abdc85de065049268e7eaa2f0cabecf23fd540cdfcfa67faf46ff5bf062b1dcc3d370eaf70ddc7ccff407bd7e1dedeaecfcfffebd29d4c7a1ed2dd2c5869df28f1f33eca1ae0c5024a3dc7cd488e85e18f26275dfba76edbf0f82ace46c33b50bcb961eff3e8826a3bcfbdd85a2bc78e6debb50ac1401dcaed4dfdae7f161a9d841c69c35a58080781dbdbd93c1caf562a73fc44e8ca49cd8bce5bbcadc660e3da1a78d1a54dffdece5a76fbf4b292a0c58b3ba798ccc8eff4dfa4d73a4c3cf26499ad6181b5aa1ebdf8ccb2cec7ce030baee18aa3bcbccb16f574aa9f3a2b078ee8aea8f641dcfc40defe7c8a49b0af8d83542f0fcbfdb6c472a883ce457fef18eb4139cfe6403fbaefb88eaaaa3ed78dad23fcee71350b0d1b6c8b0e4287d3ff1edd22e81dc3d0e1e81e816ff0df0bbc3bfc3f250a7c55ee664f85cb3d040db8a7eac01a35667f2b2907e6ad85d279379d2af08a3af46c8af361eab5f7cdca6f93c71db1caf3067e8381cf4655a155bd60742b5aac8b09fc275fb0cbfc0ed6cfcd229dcacbe927796d20ef4efdb0ed4c4aee70e99cbfbbf624feac7cd0bf7edfd478ac1a509e4bd710bfdd2a4b1df2c8cf7ae86cd5e7f18a742c7dd2cdbeebff4c10be5e8bf8d0cafffb03548e65afdcac063c6c27d5e2e6dd6a40ce3aea32709cc999d8d8b31f1a65aacbc4daa8faaf68660e02efaddeaf9b6ac8bf9a61cade1ad10be6e552721aecfb599b8e61ff5c1f0fdb8f9de96212f5577cd1fe041762e6b7e3bb93d07a2c1ce1a8f4d333f9f62f9c9ee76052ff68efc7d4b46fa59a36dfa1cb1f871d8f0ad21f5ba9f8dcbafda38d2913837b6fcb944df83f9fcfdbeec6fa7e53d07b25ae0fe5dc64698af48c857df4038ecbc1bf3bf2a45b4da0c385c954f69c113e9b1dcfd59ce265cdf46cfef893cb3fcffaa04df3e08a80eb3c69a6d6bcaedeabe1ad9cc7d0dc5f880aff1ca1bcbcd16469efc4a9adc5b8077aa8adb1ec3a62216df650c8ae956a74f7c83bac1d871b1ada59a1d66ddd6c1e0ca8b923e4f3bc95b9eacdbe6ef9ccbeea2b3d2ffceccfa5dafb5ad37bb368d35db7d619a3380a773cc4bf5f625fad3dd0a3dd160bfbcb174aaf8b58f1dec2cf7137c55cbabf4e3c06bbbdaec3cd49dafdcd2bb9e1abcaab1dfd78fe4cdfa0feddeedaf0a27bfadf7d4d06ce7274f7f95ee50432deed16734cf0e049ed33f0ebfbfb2097bfeaa2cbfa35cb7bef55e72c3aea8aaf5f7e5c4cbcf62f5d2cf650da17784c49dffccf1d7aaab0b0616aadeca55beddcdb9eef714aa69cf6c8e3b6b5a4d4fdfc3c7dbf9ef0bf1ee8c88116255b71aeef98faaded31dded7e3db3e3ded6e0dd53d81c9658ee1d8279d2c4ff4eddcc5d94771e63fe44c45de96c2ea3393a17531bab6ef72bb9db1cdefcba1a8e62b04e62f5f3c553f3b6bb22f1ae5bffbb09b1aab3f0875efab62b3cad7c45fddebbb5b7fffdfb3e21ee2c53ca2cdc2c4baedcbbe5917e2b2d5b253bbaf5fbbf58cfde7eccd7db1ccc2dff91fc1de53aecfac87ace7cd16aed303cebbe8120cdc79071b98c1fdc0dfa7fca66124cf1be411e6f1bef8daed38ffb0b2100cc06e3351ae53b21ded32430d1c2046dfc3e4bdb1acf94f5cfc5cfa2a9c3a9bbd2fad5c8586fdae0ccbfdfbc7aafdf9c387b36ab3c1c5cd8042a6cb0e1cfa03dfeaceeaa9baae8df09c8fed13ccd1da15ee68f93c2c4acddc3efba62bf24aeed6db41920652cfb701dceee2aca659d5771e82efa9aef9bd9e31bcfc2f95dcc976c53079ec3dc481fc17b9cdedbaaacd6a5b7dd3c60964ac87560eb6a8ff2155eed39ec00e31b0d245bbf5952a31ffedc58ece4dc60ffc9cdaab8bda41b391b1c3a81badeb3db9fc437adbb8cfb2ceb8b0e2894ce369bd03aa96f8c4db11bb594aae65d6add9ad7ebab93c714ecb7eff2eb2b09d18de14f3da18bde2acbcccb95ba4cadbfb96effaae0cef013ae1897ac5ab4a94433f0be50ace8fc5c2ccd31f42b353a7b588f0befddad821250cf20acbf85effb9fe07c9fb6de77cfca68cf4ebab8b8df7adefeb0e59fb7f4afbc3f30e3af02ca5c1cec32cfdb4a5bcc30ddbb6ceecadb7ee595fbe4d3b60cad1aaaf318e440ebe44ebc83ecab729d0ddcf47ce1daf712c69d1e9afecc6d5c3538a34db0cef1ca0a51ede9e9f988dfbeb9afe63956ba6775e4ded809bdc3edafd1ddc9acfdcaf789fdbd1ded0bde966c2f34f600b3c959aaabcdb3f97ea2e94db92d87bd359e940df3a0334ecfa0dcf31d44d9cbb91fded625dcfe835e40e16aacb0b5be6fdca81dfdaad88fd8c86d09b1bc756d7e42cb50d5f390dc8005d166aa0036e3ac6cbb5a194140e7aa7792df7ef94c4db5c98ad0c2c99cf5cb43a7e7d25fba9b16a8be675bcfdbb9169fc78ddfc44cf85fc95ee21d9f0fde1bd2fd005c8dafca8401bd3847a433eefff5949f9fb4ffcef6da2fb5d3818acd70dccc4ee85dbeea9d2baf4343e412a42905449017b535a3e8eeee7c9d3fbcfa1e56cc9cffdef40eee40f33a8ea66d1abfe4addb1cd6adddb1ff8fa15ef34e05fdea2b3c4a6190d6efc3adfaf887d4e0d2fc1de7b22cd995bb63669ad2ebf32aa918a0cfd9da6b32ce9aa5f2fadec03dd02a03f3ff1c045d071ac0d1b6a2aeadddbc284ebea7f18345ffa3c2c2aecdbddac1ffcddfe788ee7af41498a631b84f1bd3fa8e9dfea5bafad439fa7eabe3b0f67f1e7f4aef2f0ec7dcaa6bffbe0b02bdac7bed83e4caeacad8e9b676bfe2bec80cea48a00b8aa599a1d1562494dea6ca2dacccdd8ae5fd55f8f4dca5ff6abec6cecf00a6cde4c26fdfac3cb3ce4bab290fffe10cf7ca6bd3dd45b07f4bceb7543fbf4ccb9a5b9a2bfe1f3dea5bfc23bf77c98caa4398e9818cbbbf2236f8142abdd682ba68e999cbc1bbfee79a5beace5b3815c0cd54b02040dfca8c99e8b6db6f98bfa6c7efcf3f6b5d5c3a722a3e3bdbfc277accd5bfa8c5873d489aedf5a3c93fe9a4c6a0c9eeead6ff3579fc422cdb55b02db715cbddbbcf5d0de6c2ac6da0f4fbb59b45e9acfeddf43edfddb03eb974e97adbed1db0cdaef657fc8e5a1abefee3f8bc670a0f8a5c790caba43529bcb7e2afdf283ab85af441fbbbd042a4eff8fb8568f75e5bbfab16de7d06d57a6b1208a1fa5a5da11ffb9f84be161ddd5ebe54e3dc0deb3b9ed1a430535188f23b65d53eda6faedb0bcdf4cfaab6adc11bec2c5c840f6323663bff0e46fca3eed7d8ac2c041cd4beb4a32678f33ecaaa21dc0d18fda5dbd2deee7bbf7dcbfe7ef5ed8e5ed2dfc6da17125d5bf6ab65a089aa63e7f9dccfddea9aad4eb31e7efdfc31a7ab6829ef1f11880c4ebbc8931bb727a6d5aaefbf65bce947c60ef37e6d50a9fbd4c93e8cee81e7a0f7ac04cd2fc0ec87cfe5cdbdaf1ef8f23c6e965d75a4528d5cdad89f1bffbbcc360da594f2c8ac3def9ae5fee9331fb3fe2983d02c9cb01e6a394fdd5e3ef5e0eef7addd3d0142bd8d3b60bc898de0cdc15bec9b794adc30f081aaeeb7e052663f793e7ade7fa024cf71ef92bfb2f8fc01dd93fbadb77ec07f2244b3dcbe095a24bdad5f10d51a99c4e246dddc2d2df8fffba34ded9f9fcf5dce0efd9cb9810c1a14e514cfbc7fadc923a601ed7ad191c76a3e9100bdcffc611bcf6adfdba9f2b591696e13a57ed7bef206a4ad8beee54fc03faa4a27b41f2d861dbb0dcff8ab9c12e762beca13874540ecb5d2767ebbeebbfeca8b32fe7aaf699b432c1792f82640bec6abdb87e3414505bc8db9708cc16fcfc19aaceae0fbcfcbe68e50a8b24b4dbff1d9dfecba7625e3445eecdade10adde3bf017ca68dd480efdaa7fbca1e7039f1e2f20ef061b02d08e5bf769e2ea23854d3a60f8074bea127d30e0ec39efcc53d1b4b10ac4d2aa4c56fe9f178fadba6b32bd79cfc6dcb482dda4bb15b3cd082bbee81b8bad4bbd4ab98ee679413d352cb221d7bd3a3e162a317b58df7e9cf5f10a1ef161fa54b9c0bb5b51efb1ca6846a000949a4f3ae0dea3badf1cacd763ffddeaf51f0bdde8ae3ce56f00b91a7d2bfc6eae142bbbedf0f4b2aade8f5e365ad29c753afa9c48e5fa6d77e6dd07aca9a922ba94fce8fb1122ffab3a744140a087b20edcab15e70599f677bb01aed9bdcc2ef10d5d2845b2a6d6c607cfe0dea4fefe1d3f96a280d2d4fcdc5d61bb5a7eb7f6dfa278bcddefba3c6f5a69738a0027b814bd84aee015a32fbdf5e267d62bfa31b809ae68fadd37dbf3bed6ddf71e999829bcf1fc7aeadad738c7ec02fefdd28f407c8cd498ed04d2bb1c5dbf18aefeae10da51be91afb7eda5f27eb7dedfbc32d70cb289ea0fbc8a4c2d26b8c0aa75ce355b26b6d7e3a2decf098ead7ec2ceae22c0ffea7b9a5a4246861d9e9ab1d9cfc9be31da595e7e0a1e5ccaaa574bbf3b5bff825264f18cc5bbeab317d6c6ac440efec6b80e8c74dc3a618bbc59bff1ea49a586afbec0fb6d9a0be61e72aabd4cbf3cea4c38ff7bbbbe7deaddcf28ec11a6a67efa823daf1bfd4ec9b4fc01e7a5ae58eefeba21c7c9ffc2eb675551cb6bb68d7fc9eef420b4e49dfaf4f6e714199751ccfb8218d169edc543c576a77ae8dbfbbb63a2cc7dc5cc95a1eae72f6ef2e42a8cc9a9f520ab8942ebde57b8cbc4285d5905e6adefb0bb3febd75003e0d584ee19b1121c1defbe2cacdcaefc78b0c6f35bda70cc31c24ebffdcbc1b6d68334ba02112b6dda8d226a565b45ae7cf6af45f8db31aa5ea3fbba699aabe9dbd1f2eb2bdded9f9d0d3cdffb92bbb5e42a80ddecc50c61ddfe80e670ea81bcef5cb87bceb3bf52cc064d0dacb565dbf26c2485abbbbda9baba4afb8de6efb5afdedce2e5bdb7d8be2076ed715fb485da8c0be420ebbf67f17bc2fb0caa23ad71ccfcbbee6ce8d2fa5eb1a86fa92edfb2c3636ce73b81a3326c1769b4ff5aea47efcd7fa2fbf8ecd0e15ae1dabd9873f7a2db18c44a780cb53bb811c5cf216f1b7a05ddc994c4bc4db7beebca6f0eaeaffeda50fadd047999e52df0b31d0fd6c7eee8fa653eef6bf8bcc27f7e6d1feec56bfc2b128bbf1cffced0a223ddc6acd3d8cbc1ee99cac922a8bcdaa72a51f4affcae18f7aaa7edfb41aae04f8daec40df6c5c2fbaa5ed5ae0ad8cb5ff015d985584a75ef6cabdb29385d6edfd96fdc6e9179454cf24beb4a2a0b063ccdcdeb4d2a9754ff8af7e5ea5a5f700dfacdcaab38ea48f4ddb94c3e929345a00c1caa76ceab040abc12e2e1c4ae905112959017fa07314f7bfc426452b2cab7d7e54d23acdcdeca564d6cf1b5effc4322be3b86bf05353facc5e040ac3cc5a911d606bcbccdce9feda748914eaece8cd0ba3a8df8bc36b81ab9cfd42aadd2394fcd6e62f9e75df50aaed2a1ddfb33b4dce982fadee1ade37a02fee36e8d19f7fdce7daddd4793fac5030c4d4a7abfcd0baaefadedea5a9e8dba95a8af26f3b693dae6c9caac0ba8bee62db4afef41b6bfd4a18cffffb94173bead55bfd84dacd2de2b0f15cbf3386bd6dfcd5da0cadab0befd278f4c39de66331e18c6daea1d3af5fca73ddfc7c642acea0433ebdf1c932e3e6db9da22866ee2dface2b0ffdcc7ce94accb413fdbf4206fe4d2c8d77af8b422bda45c46bcf2c3dfbd5ad20ef2abdc68dcd88e152ef884a32191ef5bca6de79ff8cd3a79c325ddbaabb561e8be555d6bbbf630982e9dedcfe84ffb5bf4d01a640baaba337a63ef7165b25e0bfb994ce8c7ddef6fceccc10adaebf73f3eeb9ea4173a696dad2c67e747ab2c9ca2573a41fb9a16c3cecffbb4913c3edb0daf71afa4becc53dfaef9fa1f2ecdb0b3fee46e34867f9a9c3fd7e9eea483a5bcdd7c401e8a2f0b35fc50e6afb6b84c5bb2dc0abff08aaad5efb9eb75e2b10f55e4a40c3d095bf19d89f4bf1808540aa833bff076667e445c0ec3de103bd156ca03cc1f02eac53c5a72aeb3b02e19b29c43ccbf8633a498bfbb80d61441ad92db9449d9b7114dacfdf3a46adadf19fabff8bc2a04b10cfbe14341ccb34c2c635ceb6dd2fabb5c6a0ebafc21f43fc5efdfe7665e157d29df6dccbba3dae73cfae01cc15d6945dfe5b18cc0a3a3bdccf30d7cda7e8c8c7cc66dab3931f35eccdcd7143b6182141c39ec45bb5d7f3ac0f7d88de7b1e6b37fab0a32bd4a456fe2c68fd0b113aaae5a08bdfaec4af9ec4be6d92a1463b4c4a44a4cd81d9e40d9a6ab5dddfdb4ef09c65a9cd67dbbf5c3ecceebff7e8a072fcfcac4d17cd256acc5bee307e5b69c88ed7fb7a6abb3dcedb67cd803b166ecd988fa67a9d1a0fd14e2fcae21324eeabcc8d9d4d03e8694e772e0b392bc66cc90dbc99416af0bf42ba50f6dfbacee8ebff5dcb7e118e8979b2e7e7cddcd4f64000d9ea8ff5a151f3b0d21ee970dc96e5fe8eae7eb181fbe3c8ece6deb3cbd3b3cf09cf12adaff2e22cbf2fce0bfdc99d25bff10ff21dab766d720c37edc8fa9bf6832fa790aacc85e3ebebf0eb8f00e14c2c35fed724fbb08ca6a05f8bb5c19684a90dab22f0cde34a4d0b7cc9cb4aa1f8bafea768ca4dbfafa7486ebca3bdfab46fd9cf13ad63c485e146b5fe2dfb84447ddefafb4cc4b2ae4bb5c995bed31cf0fd2dbeb3bea8f29629b3a71b10e8b428ce72ba642e1dbdc69c4b4ed02cd4d0fc7b72d4ece6c2ec8d8bf8ec7d65edd4573ac3aa6ee92dd166a1f4d5ebfdc4ecf915ecec2142ccfee4687d4b62acdc0d7c12fce1cf541c5fdebee2deecf3dfbd2bd231dead714cbe5df062523cd7abac3cceffbed5c14abfddc49d7fa9ec7b8fda9a63dfaef9dc137f0fa36958e286f5ca8f9ffe8304bfc3b71c06f704fd0ef59f863a5b4d01282a1cef7b0824dfd39c92379afe0acd9c7b9c5ed79cbf9b13ec78f5f7e86ba8e672cac6a0d70e3d5f9fcdddede59feddbecbdc64af3151dbb9bf6be15cdabda4deca957ba9afbe6ba68abbb2ff878fb8e30f10463c141f7baf253edceede72fc8b5b9f1d2ddb6eceb445ec0c013ab5c8c8af4bbe1d5422d0f7169a5d3aebe7a7380ea0d2d87decffdda94ef2b3346fdc718ba7214e0d3aadfc1b5f9a7b6023563d3fcecd01cf8fe52d867ff23dd6ee4ca72da3dfd1c1db01bf7766e3fae910c26d7ab4d32e4427d7b441cccafb4e1c8f70ce3286604caddebdadbbc3c99537e9df4ddb590c87b3c297f8deaa50ff5cebbffdcb28ad8dba6e7ec1a72b2a14bdbdec5da79af90e8befa72be518cffe2fcdf873e8e8ae1aafae8dab4854dca8210fce4f3c6b0ef86d8b5cbf2c584d7f9175c848eb157cd6e2bc64c62ebaa13ca1aa050027dc0abdb9f4c3e6a2d22c4bedda10e3d67bb0bffc9b8dfbf7ff4e0bbbdfabd00d7bfbeaafdce2b1087d2ac5221fd9b8da5f2c68884348daacafffc2a4075bcdbbcdebaab265befdceddfa8b27c43b49e12dfc786ef5eabc8abafa0c8dedaf9d60fdeaac7d8f0bbefadab673d5dcdaa2d0a735c5e3d69b3eb7ac2a3a70f441bce0d86bfdcac7db8df15aa5e5a5aae7fadbfaf7cf41a1aae6dbe2a26d73b570d60c51ba2befafe8bbaac0accd25f280ecedca06a2eea1b1ec1dd7975ccb516b91e3b68734badecd73daabbdfbbdfbceef85cbf0b58495c24fdfff81bfe880364fd841fe23dc8c1fafafd2dec2df68eae29acb9cee67daece5ed8f850d6ccc2ba0ae49df72df48d6d8caed6cd390df464be7c33ef2df7d7cfaa9d5f6a133f2ecef8afdbcaee34b1abcdbeda7f1dcfdb7af1dfdb4b9cecd7fc6c1bbd41604aa34302bb4b78ba3f170e6e510a01ae6f29edcd23065ebc13baec0efca3b65a4c32aa0d1ab6f0e0547cebedfd11897b5dda4edceb541db087141eb8c9d9dc2aa6facdd6ecb6c5df1be3bddbd429e2dddabdacc6495e63b3c4bed6c36bfc75f49fcdf44c9ddae0b1aecbe6ffebd0ed426d2bae3275bdbfee9a108efbe7eeccdd311daa3c685aafe9bc3cbe639de8cbc4dbff8780d1556677bbfedcc1a3d46629229fcaaa4bedba016eafaa4f91dcbe06e4129e0ca71e073d2aa9c3a6abc0ebb0ea40cc2c881ff8bafb6c161e21b7cfacc8bf5bdf6dffa2e0daa8eded8bccfce47dffddf39f99bd2d94cf5f1d6faf6a9d1cb654ba55d4bfdbbfdf56bde5ca9f19ab3c50e5dfd5edfe7ab1cdfa33b8c0dc4fd5b65e21d85e07d52eceb2747b11c21a64b5ce3cfabde9af4555e2a7c79c1538b31d2ed367a7c21fb7d27dcfbfc263c51f362e62fbb834de1d4e67c25116b4d39ea7bceadb95aad1c7c57adcf0aa6b3c5f1c8a0f4d9fa4fdf36ca894caccd3a2dacec7fc5b5961399c0bddecfbde4156aaf3b1c9f6a0c11affbbabdcfe1a93ed22aaa7cdbdfee4efbae7e8ad03cbcd7e0f7da8cbaebe4faa1abcfb029d82c0ab61daa5dce3930314ddeb31f58cf2bdf6c99afd6d89612bdf5aee4f9617b8ce7ec0fd08b42eca1dde36c4ebcd6295eddfdd81e9ac66eaaf5ef12d4c045a3a2873fcf946e9fb2bb45e30d4fb82efd97bf7d51ff8429d5445cf90e29c50ac4b2e7f0d960f8c9af23f7b61c3d3633e2e1dd8ab8a8aea7abbacbbe4b1dadaf9a0fea14ab9fde0dede3a07a28eafb9c0cbcbafada46bcdcc240aeb52dcca0ff98f6bcaa24ebca0e7208dfaeffcff4edbbe4a2dcd7184ba46c0ab0ab51ffc99fdf76d77b41fcdd7cff924b6d79fa6c315af7fe63dec5f0a1fa185323f1ba0c8ad523c0d34ddffeb1eee219a5e5caf05c9c4eabbda77aa3c8dd8aabdc7ebb4ebc7bdbf6dcab6294ccf9eb115afaa2ccca2c5fcdac4f1eef0aebcbfad427b9ebc26cba6ac91c449f3f106e0d55b088bffcaac5a6a2d9a3f9beec0d83db49beef02efadd8cb9df4bec8d14bba9fbfb89d85f43a2c1ebb100dfa97ef9fc3e3fe0dea5d5db1e79fdd4604dd0dc492a2509becc1d0cad7fb4c01daeb00f2d8518cf4ba23dfec5dc0defc0aec571decc9ede6bba5c3e36eb5a121a8faae6f21f6d41c49b4fabe806a5d174bf892f948ffaa35ede467c0eafacc9c884e165bd728e315b5cada2b20246bcec5de4a25ccfb17bddfbe2a3addd8ae34b6227f0f997de42fda5f5445fd4b2198aafc7b5b3681b80f3dbdbdcbe4b3f461e5f6a6838718acd4f3a5aefb5e0abdc2f2dba5eea97f5a702c4607fadd72befe75a1442bbba7dbdba5648ae5857b1bcfb243691be0d5a571cbb820f56ebbd0b87ee853c3e7b18a29c69b512abcef8acdc14d3fccc7bcc6ad7cbb2ef76d5fd8f6f031137868d9b25a41c535dd7bb83f84070ea6affbc0d9fbacee00402f0cbb0be18a5eaf76ee3baeccbbd7ecb1fd4a5d7cdca7eaa08901d955aaea26a5a7da9fd8deb5a3c7bebcb4b226a47f7efea4e15bacbbcb7ade0c9d4567b1ccf7fafbc11af4faef8db7a77e85a4be5e9bbfcde372decebd21ce0acd315ce0e3fe20cf2e54bdd407ec6c10983add9e38ea1cfb4d75fba90fdcfe5d6afcd1a568e9824a77a2830c3d87caca5aff818a36babde22adc38aedee0dda1b9e3bd253bcfdea08df97a7e03edd757ec0d2cbfaea01cbbe2da4d309df375ebab827e0bc2cab2e99b0d2d5b23afa8ad64ff19bcec32e36fcd66aaabba8980dab9cb1fe2943af57edab5f46affcb06cdb9ffd5a67e6feffb347dae9fdbd9f2b6a1001ea881fbabbff71a488fd4c4ced8f897bf08bff27c5c1adb7de6abeac1583bbeba7c02398abcccdd9b75cbadfc6565aeb0b580aed618ee896eacc7b1078a990dad5be017db207fc55bf31ae77edae07dcaadddc83aa746bae6d1ca4aff9effefc1ace18dc0ced2c6b3b3ec6ef85aed960d299df79ac97e1c3c3d3626c0b6fab33afeddfae21a6cd5ecbaa56c769d44f3d6b041a24a2af93e60d9d2270d848aeb4d1efa3b6fea42f5ba5e75cf27d993b490ae2cfcd65f0421b32d1db7ae5b99ccbc9eec9acaeec2e29f4171f844ecdedc9538eac0d65bfedd2bc3b3b9a4541b3e01f2af8f2266a004dc29ebdadffb9c866d5aa323cbbc7d6dbcceeca0dfd5e09dd5d82c88d5a09da5e8314bb79aadaf0e7b488abcdfbbdaa0b71de7c19d30215b6ddc4fbc0fb95fec129b04ae253a6bf5abc7df4b8d49ced8fcb19005a6deda1dfffd1f258a7f4ed16ebf27dd10dd83acafbd4e6f957e41cfbfe72aa417ab5f2cfeec61efc6c6cee9f6efb3ab79ca5dad5d8e48ffb9833f6d3166f2bf6bfefcd5addb7b4e1c60e9794ef7daa3fedaaba47b2c9ebd6ad67c2d6aa53752dcfda2c16a8ef28eda23c72c544fc1e4e7bad52a40a99fc7de0133af83959e360978ca5a41cec5c98a2f9bccd141daa8ccf682bcfc7366d2ab1ed9bbdac6a3811f3dcd4f43ccd273a278414131ed7b00fa7462eadb7ae3ba627a461daed8c8d49a4ff48adeff89ff6cbbddbe6883cddaf30414ca7fb7aaddf709dd6f667d7de02ccddebb5ebb14e3b7ed464e7bd6b01cf4bcddb694e2c725cd7fefacacf6e6cdb8efcfeabb5d4799f7277ef703c3d907c9eab3b0eec8ddf7cc264e583fb37ef4dace9734bfa7ef12cc51c53d238f0f1acfa8b4fcc90909ca43ae38f0f3c7daf3b58bc1cdb1f5abeb120dbecd90ce490c27bfab1220523bcc81f2a2ba3b7958d0fefc9af36faaa951873fbd0d487286d671a81974dbdcbddb8e8cc2fcc4c154f8f79ae2a9bc1ded7decdcacf89ea91bf6cddddcbeb6f174dceb4eb4df220aac298abf404d6be942ee7bbbf09ae21cbb34db23abaac228a895d072cece483ccf50f362eaf1f7488b0aca5dd0c5df5d5f0cdccb1db8ebeb84babd9b6d7133357cbf6a4b1f0cb89d02fe4172bd5755edaa03ff57af41ebe22f64c3bc2ddd935019eae27110c5e417bdd354c9d5daec2a29b04483f3fff36dc3c221f5d13e04f3fcadcffcefdadadcacada8abb93a63b6f5d328085f54c6bb4da6f5ceef3dea642adcb57efcfefafc3eed9d2babaa97c8acd80b083bcba6b0cbb2b0bbc6ffba2bde9dd60f533dbeabdeea16caf3a60f59fb5c0f068cf37e2d615713ae16a773e49a6d606cb2ae48d95bce6d16bb8cfe43e4286fb54cf6ed9fbd08a4a2b4119852daca099bebd99859e64bbdebb983c5bdbce07be5c996cfedfb688d24f1a25db333d1ff5e690ccbb0ad45a2ff26ffbbbe53dede918b220b4e3ef0adaad3c9aff04962dab1fbaf476c1b1c60b2eb7edd3c99fbebecb8fcac676a5350b9ebbafed40a4ebbd756bb99218a8b2dfbdcd55e6a71af128d8a2a443cee49e89defc60b1e8b8cb7a1acbf07ca3bcaca83dddf8f283eee9efc33db8c0da57d2bea6dc1d88ce03fc6fe4eeebcc7ab345e16c0115be0f8c3eabe598aafecbcfb71ef6032f509cda93edfb227ebfabef287cfb0c8239bca08dbd5d26cf65fe8380856538a1efbcbfd76e5fc6f8bd23bba43a8f6dd0cd408c9ec0820f9bbed2bc3b2640fabc51f3ce1dfc3bb6b3eefea5a5c5dbbccdb4d50fe2fb4febd2a15cdbcd0ae0edae6748bc9dd9e7883fd84eedcf4ccbf4ca6cba4af1a53b499bedbf8a32beddf1f48657c7674078b1b75b1dbf3af2e4aebbb5c24cfccd7cd651d84a5ab3a4c7bfbf206fe3bccad471e051eaf97aaf7dd7937f4089e3a72397ec4cf6ac32ea229b72ca4e761aec6dee10aecee7e3eea7a491aecfb2f89ebb2a2d2943a6ef10cef62dad58bdd48a27281abaeec15dbf4168cd481e0cbfd43cb45a8abf3965eee1986ada7e4ecd778ee000b3bdb02a2ef91ca5f455724aeac4dab4614e4aebdb5371effa4a285406d04c53db5f6faf1e0b7d7cb7becefbdcccdc09e2ddaccd34ed339fc0811a7572af47baeead5d47edbacecdf78d3cef99cd313cfaebd6b5b414dfbce6d4c3fbc5e95e508fff0fb5ac48c88eefac7aacd437d55bf975ca832fc50c1dbce7d7991f2eeb56c93a5ad7cebf94bad669730e084d1cbccbb47abea27b3dbc9d766aeee0f02682bd4c45b12a6f152e4ad04aba9b0a1bfd0cfd3d31fc7a684fcdfa48d341bf6dd8e3ac93e8737e77dbac6cbebeab1b8976f8ff4d2c22e692a7affcc730b706b69eacc0cdaa5efa76b3ae54ef8e24b988067abaecdc78882f6ca32f0bc1746abbd6c79f0e2dbcf7a9863f16a6bdb17c5fb85531744b36c6c6930d71a15ede1a2134a82c2e4f2fcf6aafb9c7dbcb768f3405a6c9eeffea9169cb6281c6fd52edb5a8bac8ae4839d8c7a09f2cecb7cbcc7fe37d1166acdbeafdddbdbaa1cdda9ce1c17e07fcda58bd9a8dfa87bf0ee8603e48fc5aeb0de0bdc872deedf7e50a14e1d99fb8a8e5e169ad17fccf34fdd4f44eb3e40ca3f96ceda4dc9dbcb423c1cb66b6f34f5bc029cbb9701999e81d9cf7d8fe34acefcaeb2ec92fd66ff2fb3873a48dbadf85dbcb5adf2a6edb904b3afebd67a2f63f33c2b5a998fa008fa8c8ccd64aeaf327dfe5cf5d8b5ec31c4c034c338016059f845d6333e4d2a71a12fea197baabdd3fbdc20c4cc8aa4e5d62ddeed1d46ffdbfd1a97f6ff56313cde61ce5e85738ddaa8fe4c26aabd8aaefd2cf26fccae9a7d5a4bbfee2fbecc87976425ce951af12ce4f8dcaa7ef4eb3ea040dfee294c52c1b5b57ed3813ea86aaf7cc8f4c2ef8f60c779ef949debdd2dbeec56aae2fa13be0e3a7a33ffe3bcbcbe67b01ca458ceeccd56e7849d8d44d2bff7daeedaead5ccde2d64985c2fb35a24af05fab1cb9c4e03ccd34c5bf6fb2f9df839e9baeac79c9cfef56d7bdbc4fb5eaca9eb9154e3ecf2dd6ef9b43c26f1f9b781af0c13a9fb996c949cc0e4acdf79dccc3a876daafb30892661354df158bbacff3b6fd2a3df0ec7357ae8d0332fabe39cecfd66733deadea0ad86e73fbaee9163f67edf75caeede1f8134bd2e456f8249a4d3efe5fcda62ee76afadb00ec5a6e9ea7ac5fef9e99fd8ccb4df88c8bb6a85c1cac6ef9acb9447eb6c9d9c3be438df3c4f87be93fc2efb67acbc9c3f16c7d8f84aff2c38a36b8c7f0efdb79f9a2af2230acfaaca9ef71ededf0ac53377f39f7b3102e11d928baaaabf513d2eff17db89b742bdcccbebda1a1f579abe45bf472ffaacbf25e6a6a0f0b98feafcfd39cba91a5de473b0ba6beb45c73ea59acba52ceed25dd68a0c64823ebed4b40edfe852baef23ffae21ea7b3c8d542cd7ed15e11fec1a1d9d2d6cfcbec8a625b1e5f1b4ebd6bf3e2e84bec9b78bef1bd7b8a0cacec4d852b2ccfa722ffdebbce9bc85ad68ae78ec0291ea2cbfdb9baafdd7fb54f9d4d03b12cedbedeec5c4a07baad005bbaa3ab575a1aff6a3ee5edecfea80fa522d31f23af24b6e4ebbff68d2c4f5e77e7e7dc4df1455fb0c05abe9eaf1edabe74e4ec84bf0f7861300f39bf9f8ab2b30d28e8fffd620aae06f9f2aba445ae8fb267bfed56ce97c5d83eac2a9c0d6cefafb53c45e82ecbb5f982038c05ff0f96f5ba31d9f4bb7e5fe8fe4a1bd8ddf194ad6dd1ef0121cd74eb6e8e3ed1e0d6ccccdb7043d1f505f7592f2aba19632aeb45bceedbdc74a8f5bda1de5dbfaf654b430deec051c0bdbc1dc0af74cd097fcab1e3dbfee671c274fd953afeb0aab63f5e53a3d5024ed814401cca6feda5ec1c3616cda9aacfd84d2ee1f54f240dc77b73194250648d08cb566cdaaa203aa75d2bffce43e5a70dc9e25ddf1a782714ecfbf2464c3ef63a71ddd4edacaf41d77ab6ea5ef98de5cfd5e52ffb0edc518d6cbbdb43076cf42ff4aadeebefd8d930709d21e2c26b2feb6fb5d908384ee5bcbfd34fcefed6a4571f90df1a1fd2cdf97db272378242f9f3205b7a2338a38a0cfeee8f26cb52a626b5c4c804b2bf50cbcecab1f916bad72372bbfefb9ee03fbefbaca4af83eec7b5ecca6e6ad55de7ab9a11edf5b8cad82781c0facbecad6f499c3ddfdd70002ea0d7cd8c561dcdcdf64d96750f92b7cc25df31d400ee4398831fbe536d4aeddccafce9ffdc9e4ba6ac7eabe439ebb64a45dfa09510041c86817bddebd48d6c5254fcbe0dfc893f53cf35a3bdb060d7a27c6dae1bbbf0bc8e7ddccc0bbe60be1fed361ca21e5e1df9cea1dc3ddeb4bad6fcadfccb77d8bf4ab6dfb7acaa8a1ecb1abec92ec7fe1afe86538be49db1e9ecadadd5d1eec5aa98513ce2f00b24213b39ce0a4dda27ef91b5ef630fa705fa2efbbeaca1670c26eeab1ec4149006a9f49a63e7da5aadd769dda7fe01d4ef62c78bef2aeabed234e5fa7f4deefe4a24b35a1cb6541ebad95efff3ecca7f49abb8fc9a9eacccac28c2f9ddd88aeeb8216d735afa8cf9ea1aed5c8cfeea4d5e79027eadcc963caa6c4abda89b11dea2224c6b34e7fb6e4ecfed67fbb75f06fb8c2e09eb2eccc716a526e1d63abe96effa4da10c0da6b2bdbb40826aa55149f625275b4dccfc8a9ff7ceaffb3ffde02bb663d32bf362c33cd94a6a1da977c8007adfab72fcdad7ec5c3aaeb5ef0fd5006fa831298d8df7cf1ffb620c98f38ca4d91c1e10c8f0ec6f7fc67e338acefacd9ddca8aafecc7aac05d4beed6fb35ef7bfdbe127795ddd78cd2a38c8d165bdfadb434c3cd4e0da4b24d2b8edca0d2cccc5f5c9ac081b4f0e06bb4bbcaf4c1c784c8e00b3a47dbc4ace4bd8c014ff402084a84cf94a1ec64feea15ebe8224a206eb3e2b7d2b4f72b069cda5fee46ddcf5013cc4a6e3f6addd8493533dae9cf3b97ba8ef8a58bdd599836bc7cdad0d3c1f3538022f43f3fc3dcacce045ebb5dabbbe8993acdd10409eb9fe3cd0c17729b77f8ecfa01dbdddf9bf18e827975a2aeeb09cb3eac2bce3d8a50ec6667a6688bf7aa0a52d3f32cf9f89d77bd414e7aa456fd90029a06b717d0b20eafd322bdbbef27af7d6722e9d20ce8c88eaa09c6eed3e17c769e7a9f05db1751e2cf03d37ddd3c8a6f8e752b527e64b73d432d39e18ca450ed53def9b8045be8d06a3be7af1dda36b1f8882a72b677fd29ae546bd2f98eafe26eb0a9f9072fd225d82b390f01e990a9f3f3de86c32bd7ad2dc16dc51eaa8dd3ede7390ec1691979bfbbfb530f8daaedaccdf003d753a8fb276dbcbef60baeebaf33db10a95fa61a7aa3eaafb86f5efbe1a417b45c405f55f25fcd48f6cfd1a0b3bbbaf43ac783d04838ef74ebd68c60fcd6cdcda7d9bf2b8bda835f88b96fffd8fdf5ffbf47bbc9a558a0af0d8a3d2320c2238e4d7dff4b00b39bf6d65ecb1dc5b295e5102ab1c75c1ce1edd3baeefc69c714be13645a5a6a4b43ec8df4a3bbdae57a2bae70d6c294cf4968e3bf74e59cf47af3e38b6f4ad5f83f9c3fd7adeee71def8c523e83de1aeee58d64ed11eef8aac1ed22dfffe369768de12bd3dc1baeadbf09dde7769e8d3d63a0fcc9b1aa5e47d0bccaab6d9e3ba68dabbc8cd1d4ddad0db6aec53d30f80d968e9b6deab4e9f4a3c1dff6c7aec62799cab772f993f2b9bc51da0adb07f5f330bddc470dfbfc021f6ec6e0a7b13cab9ad35c0ea29f6e05ae0adf2eafc1ffde233543cfcbd2c1f2db37df7acbdd5a3dfab13c0d251ebba5efc53b4893f4e53af4bd41d2340bccdffc0dd63bd5c2d1595314acd0a5dced8bc0b654dbdcea6e61d158daaa22bc3ea8ae3b547baba53e59dbd7c9f7e04a548da55322acb27cd584bcacafbebbb0609fbe5c7af5bfc0c1cdd33fdbefccc1aa6f453a6f56312c378eeac8adede3ce86cdaf440162abcba864cbfc27f5be07f5dbd50d4175eb1819783fbc231cb9f3ae1209bcef0c136fe21ed294a8495025f1c24f78dac55be00d1494dcc6d5dfeebf7f1ffbc2276dad3f8042cae73eba1e5cb135a06efff2a15a500456b36e190ce84a9daafdab570f9966dfbd0d6ee6fd5cc3e34cbeff5a81d000acce6f1bef0f0043c4ba7b55cbd972cab76698afd9b2edc0beacc42286fcdbfca90dfd6f693987d185efbea5bf860af4c4e95cdd97caba0ae7f699eea37f1f26f624feea96dc06fd8a1f6eef22f5c4d22d190be41ad03e8c049f74a042a1f452bdbafc1dbea9cc8bdcc2badd40d1c0f16daac3c2dc1cdec7e16fcae83adafdce8c6243ca5cb1d4d7da5cadf5d3741fcc032e824ddaa27bd23ee29506a24aabef432df5a4acfdb06a6038bd8501e427eaf2c87a7740a2fc7d9135f7ed171fbaad657c2d77dc5afbfc0a7acc37e575cb76aefa28abbf39c29cecea6bf1dddf0c4ee1bd7e503a3feb5233ea2cdbe05dbf1a7c1a29dfbe1b438bfddfa94b096a7a662d081cab540fc891d93b1cb8a09a0c3c2e7f8992fcc51adb20daf426956c6c8dc1774c96f80abe66eed32670ef0cc6e3cfd51eddbe49f14d8ac14ea4edc2dcb8ccea7beba8a88a76e53f65bddb282f54fad3f7a4badfe4c7865cf38de88760c0073f67c0ec4fe59f9ff4faf21a1facd4a6d2edfaa4e327185c17b0d97ebbb82ffa9818a83d0a438ec2d0edecd69134ea72ec73fab37a53acde2e8bbd0ceb7c5846d1ab4a139e2ff2f7de6e2c9c0b8e4daebfbcadf5e3bb6bb409adb5bdc5d966b4fea4fbfdcb71b5e02ac91fdc04cfebc396b5215fcaff2f3c8d651fe57df49cbdb0d979becf6b7c89693afc5c3ccefab36bd84d49c2e5aaf2cc9e75ded9e4da385c7afcacb728acafc26d6dbb2dcee18e626075fc2812aaa769d4fcfdeb3b74b28bfcc8ae3ec78cdac34f1fd80feacfbd858fbd6b6febeca51dffc36068fd47dea1c9f901ea2b5a0fff0ecfbcb25c0607c2b5d50550272d3ee6ae18b371eedeebddf2eab4221448edfa9a9c7c4ceaf732d1f7934051b59f3d2dca6e2a5a8151fde5f1c9bcc9ac585f7acefa9fc2dd9dd90eed1b092924d7882a1ca5fdeb0cf1cc0fd2b7aeeda4d6afe5dbd0782aed3d7bcdd7ba2e1f51b38befdae6dc76aacd3af6cd39c3fd920d7f950edf7aef3e4ea6fafbde4d8a1f88ff548d5e4fbefacbf95cc1f5ccbbde5e078da8c34f1ed9edad81f0da531adfc32444efc5bfb5e4ebadcfde2e2daaccf3ecd2deef5b0ee4dde15322c65bc52dca98c9c2a97f3c5dfd6da4cdb17b2b38b4b820e09e625ad03b0ca6fd85fdafdf1957afa16342fca26babac284c7c2ec0195b18fd594bc3d2ccdcaedbe5018ac3c9c434c81d853378add180caa7de953abf6efccfbbdbeaa0efccb996d9838c62a8d6e0eef98a538ffd295dfdeac71448f8ad5a7008325da56f2fc9dfcd9fd823eacc8fb1d00bb57df1b3bac10fe51c4be8df2fb5dee6b4f80be4ccc0bf17ad4aecf488d6d2dae0fd2e0aafff243fc717d0ab094aa1d620dd157acdbcacfdbc15f1c419cda295d94aeeed0f4adabe9e8532bac6b799f87dbfc1f7624b5bd74aa272f5efc2b395cdd187a5b36ceec1984cb16a2db4a7abfbb0c5afaa3ce4acabcf78afbfc9beab74faa4affbed6b74db11766a09dc2d33ad43a1d0f65b9ff0abeb86aa9e741b84abeabaf1badde5a077d9dd9502a39bde08bfea3b7f15f6def14482fdeb56eac528ab1ae866cbb1c0bb3d6f4bc9dad0f89faa3116d393ee9ffffbcadcb4dda200e599581c3c9b8e0f3275c3e7b9bca98abb0fa456d8e0dea8fa8f669a0901f1f50dda0356cbafbfee84486ddd4decf2bd54a7c4aa005db8dae6a6b8aab47dae598cab66cb2a9fa1ed6ba55fe345cac5f9a98abc6e4ae87559cd4c43f7f2edefcd88b0332ff7ec603e7986cdeacd28c95d1dad17d21b40e308ac4c550f353b3bb2d8ad84c4ee42975bfbcdad1dce5c5b28cbef3aff1e9bafce50cfeb76ffdc6d893fbec9c5f1fff7ea91fdf1bf1e7e20915c8eef2abfcdaae47c02aeb8f09aa5d63ea0dcf7cefd8c2d1bb63bfb1e9bea418ebe7ea0b5ac59a8ee23ef8adc49fe2a5439ec5efbdc28bd84be7e2d8b4cfb3e58839cc0aeb9b3409ae77f301a124472bfd6bcfd3eeecf8c9fc780ddd0d55efe35de4a04fb17d5d450cb24bd6106b75843fcc8573c3fdbea87dd7cc7b58eefa02aff1fc1bcdc957ac78ff31db760e1b040bad79c38b6fc07c9638beffc06f0bfbcce91737f0c9c6fd58bbfbdeaee9822d3bf65dfdeb7c6e5fca914b6cce008dbce2e6e2bd77aefdc0a3aecfaa28c4eb3afb3fb8aadd5699b7002a7265ef94c4bc7c76de3ba2aa0fddd9b87d9faa3e00a1e3ffefe8e819c88c1a36693c2f1cb4fe9a60a6cdc416cd62f7d3ab2b93735e6750eddfaf4bcafeecba7ace4f82c49e6fd2dd9b60fcfbf13fad7ac4c1bd4ed855add69444f664b58b16de6b3702a1fb54ae1e8c996cd739af71fb7c0f97d2452dabfd0faf1deb7ae1477041d8815957ae0a432b4ce0ec9acf0cdd5fec9c52b30adb4acbde4f8d6ce7aad2bab4c804c60aab1bcf8f7219eb3f2c5a247a81f9de26c8d6dbacf26bfbe74ac4b36cfe83849eab505efcca64a473c4dc5bfa5f35af295b2ca1fe39fcddc2e8d802b2eaee3539cfa15e1ee35c8cdef88bca55486762e2defcb1d8faa5e4142ec02f7c73dbfd484e7f3ae84fab4f4e2cdf0117d521cc65ffb2a3a61913be481ccccbd5d14283cab2e0c84e52e10836e61ccccfcacb384bef09fcc8ef80e80a84f0bfddeab14e1d6fd2e068b49bfd85eb663a5fbdada4cc54f77c1dffdfac3dfb69a21aa3c528ddf50e3ac34a7bcdc4aab0d1af5f35d22bf9ffb4a6cf38ae4a8d3bfc2d8ef5f43ac2f0beb46f5f89fb1aa7c0e1eb25c63df7ee04ca27d0fcc3ac6ebfba38becfbb3477fbd3d9fcc005ebfb5ea232caf1108a6591507fda282c407e5f04e5db6e0aca68d3fcdf8bf87cd1139f0bd30ab8a684b7a1ee37ba7e2de9ee5af328f0afb547aab1fdfbfef2fbf5bf7b5bd9d734e642dc4a784ab8af0a58b1e39323ae571a9f10baa6ab53054df3dde6def8f3bfad61ddd5ee3608137d7a6fadc64db0d8c67dccd099ad1e7c94acc895a096f37ec80dc64b19f0ab2b60cf4ec76fc941dd4deaf4f5f6d9adcfcecedc5aa46be759fc0aa4abdbaeb8a0b1b4c88f2b5ccd64cb19ffacf50dafcd4d4b3f60deaf4d1e7918df14ef6afa2b0fcc37d9c34c8fd0a0f81df320599dbd974dabfc1d217eabfb0dde14a9b8ddacf946dad46d2b12ebba7dfcbd8d2eb5abbd9d6ebd7110dbee0ea4a2c1d9ea194e96fc207abfe4f15cece67d4e3edb30200d0ee4b8f310daa2296aab0acbfab2f900298ea19390f7c2c30aa492e4e34db6cf7b4eeca02142eb3696ecad2dcdfb35107ba39d0caa2728bfa6656d3cb3edc8e5f6944c99edf8a0fd2daf08ba3edb0aad070dfac84e0adbb00ed375bc6f16d3ff173e71bab66af5020ddeb003e1f859070dca9d7cee57c63aebf68f7c3a3d3c82d3ceea5db3e6fb96e5ece2ecd05accac105aa88850f59ddd978ea3c8cd7e21dd2a09ff5bbdce8dca9db1bfb1dfc77bb1bce521dfebf91a9ffab91cc3daadf5237b49febc1ff6e4e316fbfceee9d4be9aaeef8f6a276bd73117df1c0aa0620d5d8d98be5dae10c8aaec72a8edfddada8ed75a5aa9ad55b4a29e9e0fdc7bcfa5ab026bb96a55aba4ed76d8aca87cac981fee42bbdfca8a3a5b9e7efbfcc00297c05dddcffcd19dffde6eaab9a3f2d2f8ccfd63345be1e792d3caaa68b6aae644cfb29d5e2b3e16bf3fa7d1bcb0f7a4da1ddf4a8db8594b9dda9bbbbc4abbdcdef8d7bfa37fe28d6aed917f1764d96b3e02a64ac6722fbebffce58ed7682c434fbff6adec73e4921d0aa67bb2e7b4afaff4fcec7facce5b638d0e647e25dff09ba0ed9f4edef4fe7e570ba50ec8b1bafdb19dde9cefebd6e20b127e57ecbecfb1dfc010e98ced25cfacce50d924263fe3931c65e44fe07ac673695d67dce58c26cecadc1b6f8eb8f4f6e74a26d4ffab614a8697f0f30dadcb263b0a4afbfe06c5d33adbcbd7cd0ee1fcf4ea69b2df6dddfdec42efafbb8bb8c7cadcfee8691c9e3564cbd8ce252e89bb5bcf927dc88a2d517caafd3714b1cbfcdcbef9ae383ea8abc83fdc93cba3aa72bcee257dbf8083a7582afddaf645f9c8d75df0b64eff05c1cfdafbecbe82aafaedddb7ed00490fa369f0ba2105bb4c86f76a8e0ffc77fb4918c60230bd4e69ae0f6fbcdadb3edb31b394b6aaf9cd98de3d3bcd416e9bc4b4ca715cf243e6adc7dadf477ad0ccdbdd9b11c049dcfa7f2afeaecfa8d75daa29a0c392dd1bc78abd5efb9faffa81aeef7dd77234f67d403e4cb5cde5fc44a284bc27f7c625bb31dd15aefacea675f2db0c29cd49d9caeb8dfad54c817deb732a2331386b3fe7ed9d1a61e23aaab23c6d86239bcb0e7d3e8b068426e5fcac1839ade17b2bfcf1e4151e4dcf20f64868ac62fd4fb2cf44d893991aebd3d29fc6072b0da10c349bcacab9acf68c9dbc3eee6c5cf9219c8acb67dfbec8dbff97fae99d2546b7babbbbf1bbcc2ca1ae0ea6deeedddd5a179a0ae76b7c6d8dbbdd6b5c400ebd34a1cfeefa9a244dadbadd88897b8785fbb9ecf02aa5b9c7baff9fae80eff5b65fb35abfd3abd41f65b656cc8ffafadfceb2d3bbc07a694cda81b83bccae96dba47ebcae3ba52f8f94bbe810466e29f9bbfdbc6bc730eebef226b08dbe00bf0e96031d848bd64d95cd39cee3b8b9df6a9fcf6b9e7a57b91f30aebcb655516e6bebdc92de2bd52e9fb9eb8df8d495edd14f1eab5a9ece6bcb9cbdefb54b54bc0f7c6f68d5ed1e9bd4dcbb873f1cb4e4caca3eef4aa12b068acfa0af99f37eb9abbfba4f1c9dcc1ee8c85da474a9f067d17459190f36be06accaa735da27fd9e21f0d073c2930cc9b51cddd81a12a46ef87eeee1f1aa94fb6a05eb8b7d8fdbf6da32cd62104fbaba68b3ec6f1b3c4ff9d3b2096cadd097124ffce3d0bb11cb3b102eeb55d58f416ccff4b10e32f64527bba1bd3594abf0775c283b93d4aace47dee1a040dba4e2411b36bca3f5cda62d1f7ab0b207ff3798de8dcfbb49f57073cdfeabcf5beeafbda781872583d6e9bfec143e1f3d962a4eb75f94abbff61289ebf0bbf4f6ebdeed64bd69a4a3fd83c2b4f211ad2c221aa946adf0e7ff0ad732bc3ca5be41ec12ec9a8a458fbe5956d3b6c72eb7dded5b32ff4eedcbc9c2ed4a6e4e7ea55bc0b328cdede49ac8593faea41bffaea7ae0ab7c2c6ae24f409accbe0e0fa82091f65eea6ffcbad85eff30d76d9f8c40bc8b0a9cf4c73cb879b3769f05a76c2bbb3eddeccb0efd787ac03dbaaba888a2c56abeaaace860df96b4fc81d8bac1d1ed18e8b30c6ed7cc83ed86a42a5e618a6a4beaf0341a66941fed10ec4bd7b40cef0cfb6f05deee39cb2029d0edf3aa961bee2fdcb9bab1e4faa62b4fc50a8abe2f6de3ded6bbcc612aafbc28b7b11f9dd7167ce91b7cfd2858a0db5e03ca2dd4fd4ce1b1a7ade5cfe2fd67070921587a76a6df54a2e589ae0b84a40dafb93d074ed3fdf5a1b2ace12d0a65ddcc5dc1891beeb1ab2dcfa6bee5aef2ab3a68224dad417023eebd3e4af66344c7ec0cde7bb5537f59caaeb2814fdafcd1cff8d745a9df36f5ebb9945f1dcfc7b1ee8bfeba17ecb87dacaebd6fcca1ff301bc0adea418d8fd2defb3bb43cf023d5cfddccf602ed7dd68e72da9e36f733ecd8fee8b66405abbad2edb3cadfeec9c98718343b7aaf53c71b7db55fb0cf1ff3fa0db7bbbfdc78bedad4f3ada02caf09e3a7dc2cced03e888e2ee20ab2a07a9a74a1afccdd84edefed40ad1abd62b7dedb954dc8e0d2dca88e31bd25aa2ba2c2bcddb0cfdef9ad614deb9eec159feab03392feb376b54e726adccd5666e8fdaf130b6f1e2e472de3ae16adfa205cd45e6c67776fbf6c75daddff6bdea24e3b7de7cf2afc54aa270d5a562480ac91fbaacbc7705eece6fc6116ec3b44ede8a1b261b1e4becdc594143f9cee740c599cec1ca81e2eecfcfee3aa0bcb72a8e7e3c6eed27e024d105ae7c5aaad45dc52e45dc0f253d77e47d9efaac6686fdca6ac9c52e0f32a9aefea089faaab0cb24a02ed3734ecbefe69ebee1e73a7e4f3cfe7f7cbfed33bd333fca5865ebeaa2bd8f7af0cd83b31e04f4ab6deecd56debce5aba93213e7f9cbd632cb7886bdb84eff7a0be63a857edd544ae9c3f89b4125c6cc3ebfe3cef3f7bcbb055a6ab22fe80c61ff96e0fcce0ec34ac1ec84d59689aff6f38cdacad66d7ab71c26d0b77ecc9576e5f4ea14f4c0dab7fd04d0da4eb7feb1fcc1c82f17e0f5bfaffb9b1a5104741f6f5cd6accada374a7cebe1859adc03cce17523e9beea0cc5541b0e0bc1ff7ee969abcc6a6299cafbca7606ef733d8b10676ddaa7d773cce6ec749df6a9359b4bdad99cfff931ff407edaa02733d1edffdc625db7002c21fdbb9e37e51a527c9cf93ad8d3d1f5244cf9b5b9fa58fd4a989ac6aaa4c5ed4b631eadbebfa3fa6b110deabccfdd7bf3cacba6b38b3c2d50ed33627dcc6eb576b15e13dee5dea5c3122b0bcfde7f5dce3bc12ea2fdbdd0ae2aaea6e3a2f3b9d1e4cf2bef0e5ffa12a66ee36384ffbdb15be5bcba1fedca17de8d60ebcd57cebb1ec4edcd7ff81c5aa5dc3bb721ab578ecbc234eaaba1b8aa7fec1db84ffab703ef207d4acdcdc0397a5dcea50bffae4cf5e2f55a0ba24afb1eafaabe0dedecba7fbe3b75b1df1caaaf384a57d94b0f9b1d4ccdbae72dcdca464a2ba26ae6cd1fcb7ebd6ba1dc6d01317fb25cb4ab419f059d956fdb26cdaa4db8a8383c91c0dd253887ca19aad7dfa2d29beba91b9122605b0134bb51484bc2db053cf1fe3f7ad5d7c4bf2b71bfb1bd35cfcc7a3ecce9c608fd3270cf8385f54e9a09cd7ced7b4f307ae9d4bcbcbcdf82c06c0cf8aba115e35fdacadb2e45f0bdb027afaed2af1efebd95bcecabda8efebd71e2be2c0d1f3c22d2cf91edc297592fec5fde8b038604baf25d5dd796c49d48d2e9f613bddced3baed86f48c9ac436cdda8f169cadbd06773cac934ded2cfbfeaccece39a50e09fcfc9cdd40a3c5f9483fe525e8b9d1d513dcc43cdac2ccccda79edb0c2e66abf94a8adafdcceadaaaabdc65fc1a88ac6dbebab0307dfbbd8d021f8dff58b9aa1e8b170b660ab5cee701a9c1eae505b623d065f30fcabceb41b69be1bcbecf051feea8f4f02c85fceaa4c0b2d77ffdeefe4ffb8eeaf6daa4f3d72bb6f6aed0ca1a32fbd03e5ae7cdb0ae3e60fee6e3dbd98c8a0afe9404f6adfc23c490f3ec473fc7ccbaedcecc15e6e243d94bf643a2fbd8e068d9e38898876116a4ead75f8693771cbbccf470b7e1eba9c4bc7eaeb37625c0e9ff6ef48d5fee72beddd8d0fae312dc6bb4b3e2b438cc11be4e88edd520cd252a45dbf0fa9b59fab9af14ee48deede7a41cc2151b51b30eca2ca1c5f7fdf0ba622d0d859c2dcc76b8a372a35adf6e2cca7a431ebb56379f9415be5ef8d37b1ac59ba95e6a5ddc82ba7ecbf1cbac1e47fcf32f3d9dfca331edeaeaacea846c8d666c8fa722320723b9ccf5abf0decbd5d1dbfdc63ef87e2b9e3faafe6311eeab031c6d5cfbd5e2fd4a4ecf2e7bc3aa35aa1fc13d9ece5ebbecf23ba66bed3deec69fab8ff857a7b46ccf89a2dadaf4935f7afaacbee46fc223f9c4f54af7eb5507fc1c45bddf97a18ff486aeb209602b92704e443fff5fe767cdfdfeadbbf3f2a421db7f331587cce7d175b1c94ae592f5db2ae1eba048cfb894c7b37bbd00ce2d1f0fa11abff5e00a4eb10eadf9f48bf91014e9a9edbabfebd035bca8be5e25c7c54f41bfed033ed6c063de4caeeb04be56acc109d14cbb5beac7e7b12febf39aba644b0f20460f57ed34cbab4f2d2db0dd5ab84af3600c1da1cc1c38a9a1c28d0fdcc9dc834bb899c5dfd656b15bf5a66f92da91692d4dce39c0b6f8ca5e8951af0ddb7da7fa8adcc9f7aca4bbc542fd87e348ad773fa51dc8b010aa459fbc77de433b38d8a99f7fd89a5b426d54eabbafc30d1bb8e73c25b6b8ef45bfcdf13d5c6dcb1d1dab8521cdf7ce6bbcba9d43d7392b62e18e3a6fdfef791971818b4ac2c61f1dd13dd780d3ebf82dd2814d4dababc379ffdfd4d1d5d1b5b892efaa9bebfaeca643ea36ff77e3f130831cbded1ff56ab6efa46e0b9af5c89dc9df2856850968d2b409a6444156e5827fda8d52efb1edd8b5dc0cc6b4358b1ccef13f3ffffeaa754fef89bbbb5f52285201cf948bccb741ac0cdbf0caa2e4cddffffdf352b15864836b5c0cb4ffeb9513255afcc55faccce9dd605118b899d38ce9bd8dff8e64a2bcdc7afbd380d2d3a9ddf3029a7a2157f6bc495d8bea93c7e17ab1ff28202cba2e8bfbe7c4982ffa7ca4d8fe62bb3d2b396fe83e7fbefefee62da9b6dd0a9fe5dec16b3cccfd7d6efdf0fce7f34efdaeae204bdcb611ccd1be4dd6f17b0afaf8ce323767b6de1e0aab3d88e862feee84afc1caeed5b591d9fde5a5cdc48481cbafa6ccfcd77c2b2e2d2bcedb9b04ec25eedaf79ae25c3f8608ffcf4cb7d2ec6a00bf94f2bfe4c9ac9ee36dfafdec929c3a29dde2b99f66abac702917de766e2f9637ec5bbfc3cb8cd631a3eddb08d8e31e6dd0ef6631cffb77f1fe3db1ec61da5626d9c2e76bdb6c1e3cc0488a79beeebd58ea545a284d4ee3d3c284d4eaef2deb7cdc971afaaaf8cbe39fe3e2aca0c1ef6dd0c53ca6bbbdf47dcbb57b36ac5543b103258ad867b22b790be343570b5fb39acc28b2cfc04c89efb46fecc4d236dbcfaead0c2341bd6c23c0ca741d6e6f868fb60ecabe04f8332d3c4c09c321596beeff5d6ae9d3e0079a9ec5e0eaf1aca1fc8534bc9d058ebb8c02c9b77c97976e71bb1eb9b68dfcf35a3941afaf9acccbdf40b7ddfd8ee78351e9539a3d2ed47c68f8c3946efecafe450d584fd5c123e6d27a123d80cad8adcf6eadf5fa09feacca4713fbafc285b4bfae8bafe4d28dfe7799d9faab7effcfcdd9f86e31ada737d4ced2786d37d0a5fe5b9651bcff3b131f7c7fae6385b0fa95d750d17f508189d115a4cc1f7cdcf0f5d7a01af59203a847ee422ed0e8cfc79a52adcdeafcee9f314db20a262cacfdeaba1bcebf37b9a9aa8bccabfdcdcb55086cafe1433e42aff35e70ff591282bd9d9e3dac7e8eecd399bab8adedce3ebedcd5ebcb96fdfd93c7c6073f57cf04efd83ce7c594e5fc0a0ba399fdfaa45513fc7dd32cc0cc2ecbaa98dddff646aeabad1c1a9a3eba964e5e4bb9c53ac9ea65af02dc7bfd3edbb97cf9eb0cffe531dfbf3eb5bd6b051c45d236ab24d5e8c2f8d8c89e3fcbb9d5110dd0ca1562b9dcbd809a2573b9abffabfd2d22a67a3a28f5e7849d2bb83a4fecdf83d06acfba0afe8b70f5e630baad1fbb9fa9b31dedb9bc5ffabebe7f4f36b0b7e05eba8cf4e121cd7b8ef4abdc22f0cfdcf1fe1bf1aaf39b68a788adf62cb1fca3c0fd975bc7918dfd98ed28ba143afbba6ace0baa7db29c25dddb0fe6a89e5dd43d8b2190c2a0f09fb2c25d729c2b16a8793e1b697cd4bbee879d446f4e87cd933faa0ced0dea7ec24bb9abd1edab58edd24c1ceacd771c7c5da7b20ec81c873a8eed4f5d5aeddd5cd043c41233bfbdfb1e0af0a663bdc06e2be9f02bb9bafde8cc9efac9b9478add0a92a87cc2d8bab313b24cfdcec2e8df6e9d5384d69ed40dc2dbc61736ac6df1f8dd1d7c9c4b3dec9aec7923fe73187c0a38bd5dfbb191bbc476eef3a8acf8b7dc22d8f27d7adfa8330b94cafbf1cafaf05bf936a5e887d246a8a4b9b568f777dd61feb886d76d9f06e0d83e6eba2d4eb4abd3eaa6acc81cbb89c7a09fac8bfbfc1da15c162f1deed7e0bfce2057200db2cfbdd9cfa00e839abdbfdbe2a5b3edee20b9c6cbad9ff5ac81c7259f5ccae5cd587cbd4ccdeabffccb4ffd7d10f0d0cdb6adca7d1302d1c39eaabba6c2cfbd5ec9a5e05ecac1d0eaabf97a29d5e8b00a415afc3a22d1fe0f375eafc6afa5da9c65bca27eee0d718fa2dcaecdadc0c6fb4cfaceaac19eabaebe6e2ce3a35747fa1fcf7eed0a3308c1ea8fefb00835ab10dc93a5bbe1bae99caec1c22c41fe9fd62bf400d91e07ebbebcaeeafeac902aaeac23fd516fd72bafd0c549eafaf5b70a978bb7aeab74cec0366ff8aa8e87a9f68eeedfc63f958d55e0dd0dfea421adaca729fddc4b2acdf8bbcd4267bd18a329d602bbc53a28c71da9ee1cf6eccefcf4aecec76ed64acbfcbbae3cefffe4cf8ddf6ad22f27fbdb39f23e8f73e3a3575dbaf76f45bf4dfbd5bbeb7c8b82f1d4ef50ef97d8dbaec38a3801bad96abeeec398b9da4f7a2b8a1b3ffbbfb50dfb0a6a4ba512eab0842ff05d9dd2104f3c208a09cdea09a5d74f9934d4e5dfadaacf4ab47baa828de7cdc6ce2ae28fe1faa9e30fdf5dea2520ae4ed6a653defc8c0bb56d6bbba2bf84482ecf573690aedc34ef2cebddf574b42b6ad6d44761ffa481f609ca42ebe493da2bebcac4dbc49a8ac1c3aea45c60fdca3b4acaaa219a53eb97bb7a3b6f1eb9cfdcdd8fd19846fc229b2bcb87df110d4030fc8bacdcffc64cdc285dafc498fb7ef4d2f1bdcf9ba9dfe137e4e3bbffffbe15fdefefaafdfbf3df8ec5cde99c3edd785f80a5a1eaa0f7fbf925e8a08e0dd111c8a9abc4e57ccc9dccbbdac15c0ebf609b46afa5d865bcfd01f6bcfdcc0a8eafb24f4b264ea63a2fed34f1dbb618cebbfaa22d8aefea7134cb804c6f5d693dfaeca6ef9a76b3eb2beeafc253b8230bbb8abfbd02c2cdfd5f6564efac9cfb6dec7e52848a1dc8dfcc400a190b6cddc1743255edb2dd0dcd3673bcbeaac0facfe941f59db2dce8ae180262062b69f1c69f77dd6a53256fe4ed75ae9bc06fddcadff024bc7ba1e832c2bd07e2f619afdd5bb0dcf37caabb0d3da0b2bd63cbf6dfb058c18df2aa5497daab75bf1ccd4657ca6e01ddfbe2c3f2f383ad3dbd3d4dfe82a7d0f92be5fabaeedfe9cbdf8d08fe4754f6eb48bee5a1c5cfd0cc1fe8dcbcffa5fd07509bd5803f50cddebaf1befcef4385d51e60f02aadcb85242ed55aaafa71bc4cfbcb28ac9112edffa0acbb29efefdc0e9ddb6d58aacabbaaa75e3fe0bf823ffff8a2d3755ea1aabf67e8a2ff1bcdbf4bffabfdb110b574448fecffb4fb08fa36c07fa0d5f2dda5bd9ab8d7ecaf4f6c540dfd76b8aefe81cdaa86f64dd406ad632311fde0feaa1d0fc2f3342d1de8dfbcf7b42a81aa6fa4edf493feb6cd237c3bb27b9a05badc40df0afa11797a737ff2f85bbe80dcacccfbbdca9df49c47bb5cd14dcff346d294b8fceb729686bbcfdabfb0d0eef57f592811cf7fcbac4ddff38bed58653d5d12cccbe6faacb03e2e88bc8db0fb1a8aa1c6e64cc09672caaefeea15cec89a0f4cf2158b2bd4cb01ef7c9a9733de4df1bde8271bdc4ba72ed8ffaaf2d1d255a4dcdc2b7eccbbcc22ef93edfd0b4c3edcc5dfbea1f5acecc8ea276a8c63f97d5dc46843c6d2d57a7ecdfd8d84d6beefc8e0f991ce39c70cef99b5ffbb86e6141bbccdba1837bcda43bd39fe3caa7d1eeccec8debcacb3a4a6df3fb6bbcc3866cfdbea514329b8e19bc0bb2efbee0bbb4a9eda7accfc1d55ffccceb0dda6ee8ded20fd9515bd53a4e525db6a2dce0092784560b17b710b9aa3ef2952bffec5a5dc99e3f52c0b5badfbd8acf4d5736ffe9995f4e3a3a4e6aec2bfcdbad9cbfdc51caf32befc6a15dc94a336debca3b410cafcb6e9abdcfbbfb837d953aaa07d2d6fe0e5dddaafde7cb696f5a8f3d0cbaf43bc5265fa3cf4e8cfe8d11afcb487dbdfccdfdc1511a3fff35b938df13ee9b5c9a6ad028a80600d4afecbbe0beba72aee4b0035ddca68d29c6c7a3fda9beb0f66b73e7cd3aa11d160d2b6471417e467e72abce0a1bf715fe9bcaa9faa0fa845414aebc2effcc17a6dfc1a06da2a8109b6da21aedacb8fff05974c25e6a6ac9f5ceaf1ddf28a32a75ab5a9df1afc01dac1f4b68cb2ebba2dc261e9a1d6fda3fbdb1b4b6bded2be1865f8c6cb5ce93e2cdfbfebb68eac9de60fbc503be7eff7afab362aee81cde7fb7556bcbba6ba9fe3bee5301fe342eac2a33ef0e4510de45182e3e3dbfbcbd953d5aeddda6fe0f51d5bdfb8b9d4f5ed4cdcb2a032ab02c5ce79a6d2cb7dbfeafd9dde4121f0357e1ddcb2daaa6b28d1fa65d5fa1db9e3bcefe1b0b795acb81acfdbddc6ea5626b3a3baa02a12df6fa74f1ecb42ce5c6f0eab6d4ff44601aa8bdf21fef6e21765dced297cebaadeeb2ebaaedec0caceea5ef0ab40d9002eeff4acac62f9dffee0b6ea4d53a2bc26cf38c714ea086a182099abb44d8ae3bfb4b4aba10a3e5a7bf179c3e22e437969ffd81aae83c6fece59afe97ff5beb5c4d3a7ed8b04fadbbedf004a2af07dfdaf5b7eccb825e5e1e6ab68cef1b95e0d3dca0b9b3386809e44cecdfdb50ef76c55125c6ad0a93bedac282f84efde455bf2bc94e26dcf2d1e5fdb7e40caad6bf01faea3fbffb315a588958e1dbfbb76fa1b4644af27a43ebf4607b3cb4cc01d8fa1d2db3d39e1eef1e3cacafdcdffad1887ac0e596e8ac8bdd0abfee1c4dbd5eef54f98d4575e42676eca83f1acd12af2abce9d4dcdbf1d31cd09b41deb577d265af3cddfe0397b5ab7f6dd9a1eb2c2fcbc5ecb36b0f05fa54838bdbd3e6e5cd96be09d9fbcf73ec964e6c19ad3949209be9b193df97fcb78bce9c8df790f41eca7e7d04b7b8422af2a34b27d87b51fcfcba1f2ad88d57b5dc525febda4beaffae63ee24c3767b3f22ba007bb3494ebfb15cbbf90bc090cd6d5bc951e1db607a533148d8c4d5aef4ce3a8841cb9ec6c459255ef00fb4167735070da5dffa5bdb8b85cd8cd0bffe99bc617d40152c9e74cdd3eac11e8072dcb5cf5e5ed7ef8a7f2e25020db8a82a59a362b599a1e3e63d9b845da3afcb1160bf227bfdabff2248602d1522c5fe993460cd1220de1dee42879dde457462051cb6c5a5dbbbade008ac9bb8f713fadfd92d13eaeae8cfde8cc4cfceed577ba31fff8aeb2aaeb02a5ce45c8adaaef7664548e088ddbc422d1c46cad2af5647df071060bfe95fc565ff744f2dcae5baec2b7dddfc1ccb06ce8f1d6e596bdc9ce51418a812a0359bcc4c16be6beb60cbf3876d42c91db3800e24aecb58a5a3e2e2edb4d7fe587d4848f53eace3cc0bc96be4fbbd0d13c63bebe198b0cfbcbf935cbded5a5ceacbf6994db248d04abed42688adbe83a3fcbfc4faeffcfc26a558baab9390db9fb68ac1df8721486c77c0fe375a25ebf9ccb44feacecf19c9b350fedbd7a4e77a2caacef4243b7b1f0b2effc18942ac4d7edbacf6aacedcdb389ebfcec63035c44ab09b3acefd0dcedaad37aceb92debf1fcda5afadf997d874ffc4b8bf3ac2bcf4effaca0daefe2ff2a496bf5a8dc4da4eeb93f08bdc9507b6128ed0c8751ed465cd653ded6ab7dfebbbb73edb69ae024d868f57a1f227d60568a9eacd39c4caef072f6b3c05eadf015fc06dff465bdca65ede49c3d30fcebadd0c9af7a0e177f81510ccc975470abf9a1a44693e798156b0c63efb3ddc744f457ea2be7d31eb5282db6298d4e6904029bbf9aecb43fb1f464aae391efe7cee6ceae7685d50503b9fcc7146b4befabab24cfb2b164aa3ec1e046b88e54dfadfdc86dfeaecfeab72fecc44fb6acd3f07cc9065c3afab0fbc6a0dc8bad5d4651c9adbfeb36e2b42ca60cbd4f30f4ee4770f1dfdcacab6f8eac52df6ac6649dabcb8de9c5ee5af6ea520debccc0f1b7ed599c96bed32d0ffc5d1e0862d79ba1d5d531bad85bbed588ffebfcf6b0ee0ba169df02ec1b6d6bc8bdb1fedb2abd0ae964fefbb5e3700ebf91d01bcef09cdfffc20e612ebd721017e6494d0a1dcf241cca2a43fc234c04b6bef7be779db6e6cafbf623eeffb776adff483c13ee2550fee6f874bf1bebb9843be55babbedc0bf0c5daa39bfc7429b07f675c707cb83d419c83d6f02d32531ddf23708fb68fdc61c96ac99eaa828de3d0cb02dd5fcaa9518adafbfa052fc6b9e8fe94a9e0eb420dcb320e6c5eea7faab2ea372cb1f90908f2d8c4d3d8a99a5dd6abbf90bbe610b5bebcb85d59d3b4184f474d86ed4ff7f1b9ee4ecbcff3eca267cb1adab3b00cb2e831cc283cefcf797ed8d3286b8b2241dc012e89c8ffeeea7c8e11bf9e9cabe6d1da00d5f5fac52cdc07a8028bbfaf911f0162e0aed492cb33ede16e59f0092b730d1b2c1b1cd63ead3e3a62e3eb1d5eced5a1e842da5df3bfdf5a12eabcd44c5968fbdee7c8b669d5fd7f7c3f44dd413e1f4c3b18d75aaccba743c1fd95fea324a25f2cdff8fbea9faee42c56aa42c56dd5989e625dff5075e87cf8ff626361cfce86faef41e0d7dcfed59aaec566f9be1c05cbfb74c6f3a3fac83dfacc74d9c91a02ef7aef08dff5e6ee95e5afed9b14ac7ad76f31afc2efeb632aada7524fdfe1aef8dcbf39aee3bc6fe553bb74adf4e03c1fdcc2a024a53ed08aadbefa8bf62803d52cbad6bfc97b2e9bf80fbd151b9161307e310efa6098a6f9bccb44d82d117c3ebfe6bbdcd6c4ef2fc1abe905c8cb87d5cd7dcc7bd32ca6dcdb44fcf78fac63df27afeefb23baaf665fe87a5135c05ca419ad028d2dcafa05bcdcdf5a0d451104876b4bae4ae3d60b4abb0cece374846a8bef74ddba62c788fccb63b7a9bbea5bff539bfcc6983e7fe55de49a81eceb3df786a9093bacedcb7f43a36aaa7acf57e7fe38153b4fb03dead5d3a9bac9b541da2dbbd15eab67192ed0bd135ad6cf58d8cbf661d63182c332bf25b1f95c13afa6bd7b6abc41d54e0fbf32e07717d7cb440e61cf671d1d64b066df1320757e73088fcfa22f863d0a8fcfdfbd0e670deecedd3f0085f16e6b55ca25dc0ef65c1adfaf5169a12dd0b96cafbdf956edaf7ab76fa35beb6e3d349c9fd3f8bba7f6eadeb1a5eb9f9b572f4afa06fd3ca2493f22d77ebad578ab184b96fffffb4a7b1f1aab05eb414f4d0aad5cb64b05f15e1d94b6b25afa42b76de2f9308ce0feebd810193e52b0acfdadebf16f04ab28d6eef27ac9bfb44bb72ac6d91f6b4b8ee2d96123af5b8ef191bcefedbebabaa2ccacedac0860ddeedcda6b5cc69b9fbcd2a16ff6cccbc10e1ecab1ca7622ccdd054b9cd7a3b7d400a38ff2a85ec5cd3ccd8ebf9bacefb1f351fc0dadeb271d44d946a01a85b6b3a0fd9d85245e7b67dff32fb1efcac7e70d8934eccd0a17b3c2a8764b2e7150efdfeed7f91b64c623b36f0bc67256fddf0cb2ac5de80342f2fee33dbac16f5a091c11bed1f28decbefefdbdb326ccd7b6a2e92a1b9dcd9245bdce72cb3bef2cebae3bd3adbce12ece60cfd2bff4acd61d93bbae5fe77cc3ae9dae6c24e46062df8c6d8fac39499403d52d0e6052d2402cac1aefcc3a5bff476fab60dda2bafaa3dd88d692cde151ec13dc2dd69d0285d9c439817cff3dc6d030c973cba7a7da475d2ed99f9bcced21faffcffebaa82bae4afba14f3727ca4b487cfa8eedb2bd4f81c3fa9de9359dcdb9b580faefc6f7e080baefce6c7fcb72ca12829fcf70ff7b691b17601ba7d2f9699fde7312b52cf80cef8ce247bef6b85fb0ee1a45db5d29af810acbe519adfb5abedeb8dedb400f299d6c6f6efe165940fbffafb852deba608b1d9fe76f4fda2cc053aba30c399d7dcb8344295eefddc99b7e9fc5ceead2ae1e0d071cdab5c5c7672cc6a690897d29110c6e67bc850546b5a16ef4f7dfab05bcefea207ca645bb70d95dff947c78ebf037082c743542ceedaeb6aeedfe2cabf9e0bd2dfff60ebe7a83dca3d307b2b92de270e415d7cca5d5d49c1b17c22a98b29493dde20c881c1c83d67ead3fdf6d8f0ca3cfbadd975cdf3aefa519cfe6d8b9997dec5afff36cdde81bbfc27d25fcaed0ef6edae22f05dabebbbffc8f839ccadac7aeb88ba1f0b951e0aac192bf0ce4879cae25d3d6ca7204fec273ac4fd66e66fbdba0c50ad44b1cd6dddd4b61d6e42c3bd2bab90dbbfa0b4ce849aeca95f1a032a1ec7606d52d446f1da8f6bf3bfcbf1e16f9f8668c27d2912947a6be4cd10495aea222532aa8ccaecded4fdafcef4d7c62d9b661211efd09bf1fd6c70cc76e986bbeeec4dfb80ea54dfefc0f3ab9e0d0e84713a8d716dd528f4e0fd67aadecd0ce6eabeed4eeef3a873c9fdaa8a7e280bfb96e6948c1ecea24405e45076fc4aa3c31dd449eef8aa1e3aea53ffa70353efdefd7eb670f39c38fafbabdc6d1d941fede5c42eccbac68ffc2d9fb34a50947d987e5e8cf90a7cf3a5f9f6ffb6cf5ad387ea7eb1b9bcccec8ed9acae8e4a0e51a5b3e2641fdf9f5bbeb523c56a735ece68ded252a0aaffc05bd2344d78e5cb8b5661fb0bb91aa32dca92ca7b9eb37c7e52f6e56f2bcbdba90daf01ebaaf3bafb2abfa8e5c6fac372861c42ce4d76fb4c2e5179d1b770e8a595b24b04d7d31e2ffcfbd0be0cdebfd72e81a66ef915ad757b42eb809ded69e718f4b31cdddfc7ad3586767f9936fabdcefcdbbd8bedc8d6dcb0bcd2ffceccce39fdfac276be263eaefc603a0ca5af1c2eba3b6b3c82fbb0badec90edbe7fab4aeddb35fb9eaafeffcd40c3e078df5a6e7abde4bb3d4cd3b894f560c59ffedb1fb9c67c4c534af9011294deca5ac1b9cd63a50224acc44194fd0ae7fbbcb8f4c8e7d43f6cb7aa2c821b17fea0560a4ad0c2b42d6cd8ff33cdcb4df5a6f88af5cff65ed81e5cf7c8bf57f536cb07a8fd78fee314f6f8b712a5efb4c75a0cae48a6759199036c3ddedcfde88a967f8eb9f2fb3bf52ebffdccf41bf2dba3afcca0b66ab3b6eec7dcd2fe0b194d53e6ed92b3adc22afaebaaccbdb6b81428cc56dcfc1f25b76cdcfbe2e4fca04831fe2acbd96da6afd1f5fadb3bd9e1bcf3a1bc02a63fefdc4369a4ecdf24f9707f81e0b1adbbbbbf6cdbb3dfbe8f2f2f21f5bd391ccddaa98af8ab8caa3e2a8af5ee91c39b2a4ff04ddd01684838df9eff7e422bf3070c9f3d83d0e32bab6d48c376f68348c40aa5cacbcec17ef3a3b9d4f6fe5aaecfddea602616bbaf2f1d1dd1ecc9dbcaea943c4faa55fa703dfd00e678ff279ec7b9be04adeebcbfcb3fbd2ea476dbd0b1e9b604ab4f3fc1fe4343adaa5aa1e9a5cf994eed6afeda5ccf5662dd4a11f6c3d42ea9fc6d7a1df6b974dcba5bf34ffb1f7bdf70adeb763ab40b5be3abed45dd4fad86bcebdd3dbaedd2ce0ba854e880737d93b24d7e8b2dc369cbfe0dffff86f7f83d4dcc4da4cba9a446344f10bad8faec7bbfd391e1b70e3dfc5e58ccb5f2009ce0a9cedfcbf24f917aa381f86f53fe8ad0f597b2dc8af24fc1511a7162fa68bee6d39faabbdf3cd9e5f2e2d7e8ac6fef9a8ec64d6c3c5cafb1dc4ebcab9cc1aab297a3ebfcffb0fe1bf2731f02a6bf64ab70a89345cbe45dd3b2aa68c0f2adf415abffbb72bd2f95b1bb26efca5d1ff5bdacad9db8dd8d77e9e787bb7a88ebedcac8cd0603f0187eac2ebcdad36bef9ba0e718a03bdda00fe0ad2bd3b1fb3a24fb6935645217b5edcf6b0f67f1b4ddd0a44aabf2e5cafd58aa4fb65cabe90bbf9d8ae68a4d3dc1cdbedf5ac42a3a1f994e4fa2290653bc9d18e0cb63145efb4cca20fc418b8ce8ff65fdcd326e5bbe1f02e8388c2af5aef14dfeb16283c2f3d82cfcdc6afb93f96e8ebec7a54da9f1cc9922ed25b8da19bbab3c8358f6fbb2fa675c2e07fd53a1b14bed6ba31ab54f5dd53d629fc6e754e24e8f67d5f73ec3a884becaa5f4ed85f2afd8afbdede830cb0ff1ec6ab1efaca4bafdacdefd310a4be3d193f9c8ac27b78abca1ccbff5849cea3ff500b9f4f4bea7d64dcff2de6cb1f8afbcdbfcabaaf667e817acc1ba5de80374ae1e9f62eba2e5b7ca153c2d3cbb58f4bdc8acdec5bcf33f1dbe5e10f5904ac850dbf8feee147efe15cfadef43def10393355da1bec348b570eada01cbeeae6ac0fc5ae20870df5afba1ba7b7c2cd7dbbbc248e36deae8e9e7ba36ebedefd45f81ef42413f9d4c7b1c246fb4db57e66e8dea4efce6d45ed1bfdef25cc0cc7a8a80b5270ec3d85bd8e9dcca5b6ed3efaf0c1eea1537ef1f4f3272e2ab03c9d382b14bcc945718cee341be34a0753e2f32dba7d3a35ccc5c452cc74d86d9342b73a5b033f0257222dcf9d2bf75a431c5d92bd8e5584d4aa8d642f366c7aa65bec5122ff9bd59c7cfaebac669bdced61fd5e04b24eecf4ff7f55ebb1bab01aa56d3a1327d43b593cffa5f2ec9fab8918aeacb34347a6f47ca95b427bdad7cf1cda2f3e358ffad12f26c18dbbb315c2d5ccaceab294ea118f9cece5cbafc1c53fafbae4faddd1dafe0d2e507af4b10eaf49d4c3baaa13eecf68d88fecdf37c0a4dec43daddce7e998bb4cc15cd8dd5c360b1e02b60a9dab3ed3c8feaafde6e18c0e17c38d3acb7ffa3d1350b0fd772430e9cc282ea7fcdb1cfc61d6cdc41fc0f33b2bf1dbed6ab42d559abaeeda38f2efd15a0aedbe73c13c46555fc1208de24c3c8ef20c9dc1cefd959c8305dfbbd7624c3bfa904c5889cc9cffa69d4eb7c5c4d9552293c1dbc5b4dab04063042eb7e6c25ecce02e3ae1fff1712656a5aa16ff62eadf61afbf56ddd9b72badb7d0c07cf38c338ec58eb4ffae2d0ad5dd9a31c664d5cacd06935339df476b9db9ee8dc9d8cf6d7532df2891b51a32dcba7c3c24a5dc4de9bec99fe24999c2fbef16cb3e9cbefbefea6eaaa0838534a09aba02ebec1bf319bef71c6de3bdf5ff4fdc9c93abc96a4b9b5341cab109db83ac4e07a2ee16bbb4f82b65e3ebcce7681fcbdc4b9d756fb09dae23b56b2d1ca261ead6972b5681f20b879f9b1db7ce559e2ac306633fa98c5fb9bdd24a6a0c54f4739ef7e462c2abde8fd047a78408ebc5c0a6dfe2fad8dd4da85f019d2f5fd4b3e57ff1e896dce2bfbbef0ffee7eabc117bfec2e0c0db639a5386bd74a0adfef759a1e0a9aa7644ae792e8d1ae40c6d3c2f6e7213c56a19d1ee8cf20acdefefd4fd8fdba20b44ab4a1ce3f0674e0f9dd231071efde77baa12ebeefafec5cc977cfcf5b9a4ac9e09bb39e77cff10ecfc722f5c1a69ec584aa4e4f3243c25ffbc1ee456c96e90efddb78155ec723d8b77ddc2f279eac4adbad030c9ef1c3aaa74e5efa6bfee6076a6cf8c2ccbd0c4a767eabc8ad3def8862eebd23ea401ff9625f20e4dcbf9482a006cc8fab7bfcacded3dde17ffdbfdaecfc2aaa64d0dcba201acc3fdfbe9b3c814cfcfbeefd3e071a9f5ab9bc93e91ea130234621b1dad19c946325b04a76d2a1d09de9b4ec5cc6c49ecbfacbba7fd4ecbc07ebcfce5bf8bb5615cace5b17ef09f04f8db9eb78c0b23c4eb1cbd3ca96bcbfff63da2f5fc5ee4bb37cacf5d29415eba5f2d9bcd9c095b16cfbdd08fedd6add82bf00eca2f9e8e902db8cc8ea6c32a171337e6e54276d3faa8ea8daacec316a71e037a52c0402bc90fddacf3e4dea6fa0edf9167cbd2b8bb0b2c99e964ec5cb9fe430ce4b953de6aff78eff328bcb1ccd48f7d5f0ba0aea36bde44b3aed023176bec2e49f36cebeafbb0bb9f0fcfbaef390bca2b1bdf012dffd6fa4c8fab91290ceea28965af132a08858c05e6eb20c5f1410cdae9d49b95ca113c74df6e4f09251bf9e1ec75eab3d6acf207ddd8fd7f6a5d793468c2b9f7fdd9d67c29c98dcc51566b5b42addec93cfca4d34c27df88f0d9abcb3bc4a0d3bc8f1adc9b27be28abf7dff2eeddd5825dfabccfcbc2f9e8c8bbfa09dbc7979330078d77c4effbdbbb4cdfccc0fbc8536b8eabf9f94acd8fb4d517b4b0eb5f17beb6b8fdaf2b3d9abe9becaadaaa080d06e2f332be85b4cf1ed73e8f55deb0ca3eab0b5c8beb5917a465e38bba23f6fb92cac4eeaaebc73993ebe9a14c9009f79b50ce178de1edbee612f39ee9b5d8ab1cfae783cbfee2daa86f7d5b5abafae7ae7c0ee7fb5e1129f28bce3e28ffadb8f3a0c03bdeb576bf497a6f66f61027bef1eab1bef346cfb5cc505ab2c2d0b356ffe4e1a1f0fabdd6f2d7c34474eac6a92e52c0dd82c14badd3db637d72f9bc7c3ede5cbebff76a92f36efcbbeab1e3be93db5edaafc3ac63b0893e6935ffb3b32fed183ef50c6162bb422fb69eaf9a856b1cc6a6b4e05a11484a2696b2ab3de1dfbfd6f6537ca129a522d6c1fb8c3dcfc0ae1bfbcbebb708dcecfaa717a36eec9f66a68ac2e7cdfdb7eff9d5033a58e9765efa0dbb9f8d4b0a28af72db8f0e3bf6bb180c3e190cead5abeedcfb067c3b78d018cb2e4abdf6d6ccd62818eca99d3fbedf628bed8ddaaceec8e65ebb566f41aeec83e5c7d7801d3ed0d073bdf3d52b1dc37536a161d52775e37c3dbc12e6e12dad8b31c5b69aeb0af3ea2bb164f4c9afa93dea6eaa9d652eb149a407583bdada35c1dca39a85ec1fcd3c69a7982324eeccc8d3cb92a5ebdeca7027a3f646bef7727faf4e3de3c668bd2edc86ca5b4c1fe87d4b5fe4e1afdbfc66dbeed9ce2f4d50aaadeeeed38baecf1fcfcfd7484c5eadd059c3caba457dbfc1ad58e1cbcded98e76aebcaff9c240eccdbaf7bb1cebadd7b67c95f260beacd5aebc2eef6f9dcaadaef6ebf67a01f90b8a54ee2fcd6f7e0256d1fca4e70f3913abbae674d2afe3bacebebe57efdbd3d2a4bb8f1ce6c0ef7cc6f673d20db99cbdd4b1c77d0b98fc92aac3b389dd8602aaa5df95bdf1646b1d70d07d81ef059cdb2af477ec02f5caa1bfe48f9baac14defdcc9bd337df9a2fc7c1addeb4ca44fa75dd0a7adba343eadb9f8ded3a89dbd010b5eb119eba9ded7b4bd8ec1e39bc7fcbaa0f5bdbb0c6f4ff780cfa67ab7a12e1e06e4e7ff9c8a113cc52ce5eaef2acbe8fa90483c5ba0f31fc15ace8a2d19b1dcef1dd0a2fadab8edc6b4cbe629bda98fa0be3b65aab6bb1e9f5dbde14def7cbd54e5affa5e45acb28a32bbefcde7c6d8012fb0f02b3ce0e0ea3ea9f5a3ba0f0fd1c2220b69dead21f6debee01b7fa6e73586fe83bf662e63088dfc65eace06ce34d01bbaa7d0e4caad9aee5ae9d08d32a5e9a023f0ac17a7efb3becf7f47287c6d7d8ba5019f726e2c7a09fb0fadccc76e6bebb56eccc3ae2c07c99a94edcceeb5384a60ed0bdc95dfb89e27209ef4bdc0d25cecdbba3bc83b5d7bce103da2f68dcd17a480fe6b0efa6f1c0caaabe316d3cbdf309f7c5e07d94fc65dc6c7a3b9763ce8452081acada2b8e20e37edcbbccafd0ffa3ea2121c62b5ba82f8b87b7ee5dd614a74acd6b867ce1ebeb9cd6c15f761ea6a2be83d3c18f98a899322debb666cbe1ddecdc8bfedce51e2fd2669436a058f081fb7f2ad53b3caabc9ecce5e7f3dcd9ab73ecc295b2720e38bf3f3b9a9ca20b6faf3c5161e45f0e5c0ebf8b0fb04fec61d54477fd3bbcd8c4e4bdd65a5cfd5e74cef02c17ffacdaa5d486f7e5a55cc2cf1d6e842eefaf7f27cae270ca30adf024deb81c8aedd86904deef543ef92eddff90f94acd1189ff8fda08ffff26c6ab292dc1be148ae0ed27eebd3aafde764a01521fb5428cbbeabacdcae18c841665ffbc1bf99f7ae98e66f3d0d8afa50f08c4bcc5ade311550f7a74c61adc70f4feac4ffdf24970ce6f7f2cf5a065c2eb3468fbdbf0f2aeacbb2bf33cefdc0dc9c6df37fe1369baf0d5b7a434fdd8da492e9e4434acebf9fb8de77cfe40fdb6fa6fe647ef1a393afc66fcf62ca8b8fccfeac0bfbf37b20d1d07bbd7cf0f730d2cb0d985d6ec5bfe04ca30c0d107ed0a382df9e1e2273aadcc3dc0dd5b6a0e59ad2f3e3eb6b74f074ddcf6fde9a2ecb99ed39a1bcaffea2bef46eaca1d7a8358dc7d8e3fdaa5abbfcd99b6114025a07d67fe9fe11ee783cdd309437d581358ccdda598fef581bbddd90f155a8af8b04efac2bd4b7728bdbbbadb2f17e4cc72f071c43da9c6ae691b1abc8c7ba8ba078db6dba25ff05cb41aa6befce5ae420a4d67ecffe5fadee749d5eef0ca8d1ffc1ec877caafad104abc32def2c8d0abad0eaecbe4afafc3d2bbe66cfe1e0a2aadb76db8647f9fba8a2fae3fcaa87cecbb12e05aef01dbfeccf0a9ad23596beafb1ffddbad084d93c1fccbbf37eadfb4b4ee57bdb634708cd11e99866e0bd1d78af79acabfbf7dabde55f15dc83c9cdec73f7bf50f4fa64be45aa7a19fcd1c3a499eaadeee8bc5d2284eff7882c2a5ecabbc5edcb18fc9cbcdaa6ad9dd391cbfeecc02ee68ee9ae0bceff42d17a62bed3faffecf63bfee3fc35e89d5915fc71a20fdfe9a7adc1a9adfeafadf1ff563fef8aa98751eeaccd0fce2bf239ec3e8abfef5ffe54bfd7a6f5bdb3b3349af68f629c38fedee5524de9e8abb646b60d8ebcee8c6dbd9543af8a55d0b1d5b0cce2405dcc49b9846da1a0ee60b5afdc6cc8fb1a2dcb592cf81905343ae69e57f556c551dad4ccc9b269ddd0bf171a03cd3d3f74eb75653dedac0fb5fa48e72cc40b5e11cd6eac66fae51393e80eabd89dabbf01d27dbf1d2c2ee5d1fba77deafe2effeabad8c9ffdcfabb2b7c969affdf0825dea7efb16a69b36d4f51cbbbfd7e1ce8b8a9f7ae210cb248aada0cf2e1880b5e2def03d4fcdac91f2a8da0ed63fdfa71afdeeacafa2fccbbde0ffdd6baefc60340f869140bebbaebef4ff55c1403746077df3e9e708e86b5d0b0fcfbcceea4dead13bdff874830b81beab92ddaad41e5d8bfae36ed7a8aab01eb615fce99bc2e1b84d32236cd2b8edc87b2f7ec4cc9fc8059eaaa763b0c939b3519bb1d3ddcfc39adf3dfe8717fd685bf3d02e3f8d458f5c0a88acefb2efee4e050ae14eef1cfe6180dbfcf6383dbf97edfed27729d0dbf06bbd69ecdaa0f5e03bc23ce99edacaa3d9e9fca97e4a8562c61d30f5abce1ffb95e2703781dad7b3388b7213ce32ff406ffdfdff98eeca14c51d3629bbb4243ca8e572ef24c346cacfa7904a2bd2aa4632e02235b4c626bd4cfdcf2874fcb78ec5778eba0da9af40dfffbb31ac2ecabea2ff707bbf91541c929d8daf0ced3ac489efcfb3caff8f82ba3b81dfbb9107a53c685aed9bdd86ddb4aba0e42ec02ee5ed3a4cecb032af062bfbb6db43de3bb4df763530ccacf9edcf2cdeb2ace05fc48769bed1f3354d4eb4adfdb5c3aa4c0e2cda638c126061303fac09deffde7d64d3934cca27c75ddfed7d6c90ffb5f3f2c5fab5724e7faffce693d983eb6dc7dfdd6d5fa11b1ecce15489a4cb5c4b01ffe667e1430906d3706e777dd7bbae95cc11be77debea8911af585aeb98c83acad0acf2b4add5ed9d4cddd9fbdcfdd8bf9e1accabcdd311248a3db3ca84ededeb5c7dc380aeae89ef8787a80ce2e82bba1a52a4a0ce4f43a30fa0bbaae3daa4e7a6c561205ca7f68bcee3eabbcb2328f54bd147ec7622bbafbd2eb527bd9dce8ccff94fc125b3cc509d3cfffc689c0fbee0ef0afc7164bf3f6baa676a9caafbc741fecca40ec47a1ae9150fd21777baacdf84cacd342d5f25a9bb7ccdcaeaedabeb54d26b337329bd1734bddbf2e4e6b5daec7e5bccb2ea77bf00b360a1ec131e5b8e93ac1b7f6b517481ec45ab7ceb88aec2c8e9d6afb65bd034a9faeb62391bad1cb5ddd921dc66de229b63cdb7dc5f36447162cdfeeafb123ebf5c3ceccc583b6d13e6e766bd78a7ab3cceefbff237c20329d196adfa43caaee2cd8e1fafefd8244fe7349d1e96c90dcfbafbc8d32aaeebaad04e8fe3f86f8cfe661ef7f153095a1e46ef2da5ea119c0537eb7b43f4728a4e8cba08da45373db482d9ce7b921da97e6c9e5fdbd9ecdfd9abced783b5f3cce034e7bed7be9e0277b82b9f7d7db7da7f25f998d4e1eb526d739a867d60293f6afe00bc74ac9cdbac62e7d3ad865f793cf0f0bb7c70a7bf48a78cd83c3ee5c1b66aed0c66ef7b0dacacb5abe5de549593601ebdca1ac76e04fcbccad43707cb3d9acacbfdbd9ae8de715fc20403bc402ca4e5e07f56edafee5fe5dbc0aff9cbbe91474cde7d3920f8a5c2b198f95e0badba508a7ef59d52ef8b41f9be70ecc30dcbcbf2f3db866d0f3ef7af1facadaef92e633efb4ba6a1f9b9e54031d5a0efec1bae8aadaea56d408e903c60e4e4fd83fb2debe4afcba236df92ccc639210068b4a19c64e83ec9a9d3c0c0addefec408fcb845bcdb5dc6e42d9feac1c26b0a4f1395bde69caee2f9faa28039d847ddeb6bd9f03fcac1a79e8efb88dbdee424e2ab1193aaa876c16fdc4bdd4caa9bee437b1ec60fcbe41ab9cbd04c1cede1f5ebdba9e70d68fbb97410da6d324f6b55442e12be6f5658fc54dafdfa8b3193cea845aaf784dfd925d61f1bb71dff2f4a5cd3aff3bd8d06e8717dd35dfc84203b7bbb8bde9c3d1e278fde76cbef6511048d8024f31f6be55be1d1effc51641cfabbaaadffae395218ec0facb1d25face54f2d17bbb597fe2dda8b644715cfd6b6e2f616978466feff76cf4ac44fddbeef5caa6ad7de28334dbff1a6bac5a9262aacfa10bd29c6f7ac1aeef138ee5fff82ffa6bd5a2bf9323c18b81df7c4bfead867dac2b3b064cef33e7ac7b05dfcc65d8c7c0ced21cb4d3aaeeff6f7d8033d2e5180dfbbcf6d8c2beddd7ff8aefc1cfce27cc7e8a8d5fa8a1596d5a655b3afc1281f6e65c0a0a4c91bc0ac6d546eeaaebccdf599aa29cfa06fa33fcb7cbfdfe87c8d4e0aacb13a71ec62deeccece7aeeaabbf5ccf3e8ee7cda1ba0c45ddf99cabfdf9da1c7c4aed86f9fbea2ca7caadfcc78c109cf6994a01f5aeefba25e8e614d67bca2fc550ae7edbfbd3d9deccf87dd10557a201f9a67b4acdadfd3ae43fa42d106cf8cda5fa4efd5cfff6f70eba48af7b89ef5f18044cf43adb21fd3ef9c3eaa70aa06e4efa07dbfebb29a8adf7aabbcb24bbe04152ca4cc920cafed6fa1f2eaddd2cfad3bbcef8f5a8bbba520c1d62dddc5e2b2f62aaa94d4f8cba4400bf2ff5c5fea7b6541aa6ca0afeb325cbd1bdab8db5a30d0fe46b62f242c2db17db28ade9f7bc3aad5e8c5d7f19cddbfdc7dba0abdfdb5336db5a6ed7db9107dcdba1e0df2ef3ae13cec69bedbec92fac984e4b09556e5c78beef5c6905f62fdbeed4b4f61a55a4aa86530eaa181aa4fac1c2cc84adc0a17dcc8e08a40d0df3862de7dfe93943aa2da1363ebfa1180f3cddc0af9fbf81ba4c0d4bcdc1ac8ccc1f770cc07c65b9a30fcabd9d4202ea0d7d831a0bdb9e97abbd7e19c1f66d0eaffdc66ea2b6fa1c11fb8ee6a00bde8add7f5a785a8cdcbaff0a55e902622cbbf33bbfff9bd6033aeafc8ecfbde0c5aaeeefe321c89b2e77fec88ed814b96178a5c5af3f9f60ef3c70bb5d8eafa4dd6ef940fbdccdaa1ee5eaa557c94fdc58af99d154333cba62e5da8ad90c37e7afdc5d3f8f573a84a2defbdf5dae490fbae4b5573a1916dde804b2be2af59f74cc6296b150bf4eaebbad8e2f1fdbb5bb19aaf460ae5d5ae7df49fd8fbd73debb6fcddabb1d60c3bd9f2f4b81c92ebcf7d15441ac96cddedcfece4ea997e43afbfc9e5d7c7819a0700a8acf5e83bb0e6915830a767a634e87beabdde3afbd56db740c36a24ddc5bba559cffc5cae5ad5a0b6abfadc5c7cdddaae109eaac69c1bd8cf0fb7573e22c5999ec2e18f66ab81bb3acd6d995bb5bc8cc20bff6fb23a5e1bc4cd9aa5fe3ef49f3fd4cec8fdd785be49b5b1b14c1bc309de4ad55beee34ff7c8ba2112ff7129cc638c09b6d8bfaac53e8783bd11e427e4e55ef81c9cfd5bfc4fa463ac8bdad90aa29fa1addbc29bcfb5f7f98bf2737cfa4caabbd6fbe68b92cf8a98ebae9ed8ee82feebe7f8e518fae0c6edf20ed315e743ec5ad17196aa0aff37839be1bedfe0cadebb2d309bbac0ce38c7c63dcd7cd4cb77ac9e5620fffccde589dda8eddac1cda1d5d895dbfb6bd1efd78676cde80c52ef59ad22ee3d42635bdddffa2b2d777bdcafae3d7476c14e7e2a08ebeaebd5f7ca8544c8dd61c5b5c2d11f0ec45ee56c701d0cfa404fdbee4d58cf6e4dcab8529ceabd2bddb5b0ad67a631310c401a987b0be5d7a26ce5ec7a894a42e1eb1fe6c5128aef2b779169efa2fc7d9f4adbb0bae1c2eff9ff8a4e11ebbc1ae28f8bcadcbf6657de18842bbb4abdd0ce1a6acf9357cfaaec47a4e8d5de9f04ccb33e75f3c719208edd92ccf4314ea2c58fa9f988fd2d3ec0cadf9b8be99cb5ad952893c3fa27c8c8a87d1e8d89e5002ddb686782cec4f492deff7b06dffe0cbda6d311bc9f63e118c2ff0eb894128fb7b8b9ea5360b9f05e4e750a9ecbf44eae76adaad064a6c06d5048cf99e603e1946e2b75cca0bfcc240bb2ed7dab8074eaa4d5c0cbc5ad53ca4642d2bcf0e62ba77aee9b6dc8be84dccfecdcd6ed1b0bcb8ac5ef2c6fdb7b18c1a0ed8c1dd6fb647f59d5dd07d2bf3116bb47bc752d144b1a4bafbdd2e6181dead3f2e6d2bdbf3fcae57aacaa9e188253cccf354c2b6efc2edf7208c5bb5294dbdedfadad1fd31f9cb4eb5c9eb19ebef8edebc1aebb73fbcad9bdb2dbdbca3431ba590df5122c33edc3f6ad2a557e3ced1a64f389bcf84d8abaee439e2d56d829bd9d63fba73f95fbdcfedea1b12eef08ec23c3c2fad4c0ecf9d1fe7e6b8c5aca8dabab4edece32596dde79f2bb78f30f3ce4f3f76adb8acafb1f8520f48b5c22348efb2ace3becd9ffd33f6cb1ab39976cec3281cd1dbf6fede6a3bdc2dd53e4a1d4b88e5be975be30122ed3611facc31c3eccfc4799c0eac595de390bc0c8f6de656eabd78929caab6bfcfc4ee25ec1badc2cebeaea8e3bee916ef2fc592cabefa7a5e227302fb6cdaff513bb3c2feb0e5182be6f35bf8fb0ccc3f0772dd7ee99d3acaea2d7fac3637ef5e3eb0eccc1ddffb068109882f36eeed1cc3ebe3acfcefc17b8bb5b312fbc67ee8dadee337f58fbdac4bada18aadfecfe2ed2fef051deccf2fd7ae3ee3fcfd793feb4fd3bd9c8fd19dded2fb1e96dafc9936d7c195b2d1ebeecdeb58dfd71cd7438dc91464c3d9a582bcbdccae52ac70c8a67baf346ecbfa1a9a8d662abba8baca4342efacd9a00bdc629cd49b91c4ea2883749b9b08be4497c4fbf83066fcb1eff606e6bfa2bd94c69c82dbd95374bf8dfdad46defc6f1b695ef5a5147ecafab1d6b8cffacfcd2c6343feefe6ddaff6ac5ecde4416bf2d279a66a7594ab3ef8dcf22efad52faf9de934c80387d9e5b0f35aead187770064da0dfedeee7d4289d56fe5f5cb106d4776705dac0c4fd6bb9eccaf5cc38750fc2c3e062dcb1bb835cd7c8ac0cfac3c2e5cb02ca3c7bbc3a7636eeabbceb45be5b52d20d6fa6fcc5daedbbd69a31a116cf8abaccbab3bda7fccffcdcd484f7fc39cdbf782db4760a57459e296245ebca63f51c2dccb7ad8caecff749efa51dbeca02dfaf6cffa49f4c8afb1b0ddabccc4cc3f99cacc68ec34a72bcb0cf6afea83f06fdfef5fcddcb3a5d3b2f4515edfffd26d58dd5bff5b823fbedf40b14afcaab09ba47d20f6caa010be294bcbc0c811ec1b87badb6a2be488b9c2f9a3e1bbe9b924b1aac2f962d7ecbd6c7cb1916aaf2d40fa6cc063dfcf5ad16edcd53ae63cc81bdbb6aeadb0dfeced3cf80a8de9e128c2f7fa61ebd608e26b3ec87490a76ca986768bbb9decedd8daa803c9b0d65608fd0dcc38e7a67de97d9ca6ce6d15cefe4aabdfb00d596acddafacce1ace22aaa6dfeced1c6acabdc3da20523b1d2e2ffffc71cc73c0e70ec531bc3eec8e6117add64ae4e1fcbebaacaf6af2e1cbbaac470e2ecfdcdcd04acec92cdefabbf143acccb3c8dd0b6aaa953da556d4f2eccdc4acc9fea1d95ab6ca1e8b8efc87e2e21b2df8f00af6654fd7dafb7f1c21cd550c9ce36d7b540fc37588bde64b242fec58cba11ca8efa2ab1f5bdcf8566e756e2b438f929ddc1bdc187aba83aceef15557efdbdbe51fbe71cf7ee747bedd34ff9eae68db79cfdeda98dcbaa8f6fd262cd0bb5e62b91bcfd8ffcfdc3ddacbf0f79566bcaaea0fc776cdc62babfa6340dfcd21a7ff354bff77c928ee2fffcf870bb9435374a08c203e391ebba6ed2bbbbfc08efba09abeafe5fa2a7da5a88d8093ee7ce0cdcd31bdb97acdfda88aebee7f6eecf434faead8c03516e3e141d0870b8ad6382dc5d358fedb12ed4d636d001bc87fea47825a6da588628d9fd5cd0a0fa15fef25cc7e7b50448c67571efcf1bf823b58241eaa816da415f8fc4e0ee1ade554d419aa6b01ccdee0d96a0b9ceeabed8bd55f0caee5d1adff12c44385d231abec8c8dbfa69fc7bddbc2fedbbf66cd9ef95c2c428461081fca89eddaedc8f83cbf5733154d2700f8c35f4be7dcf538b308b5349119baf24c248eb3b81db78524ca6d7cfcdc57acebfde03dfdae606cfd0e0baee8870decc22218f32db17bdbbe688ae4f65682dd12a9eb2dcf6f456652b2f38c99cf01606551f8ab4afcb0664d6ac66a9c34582d6cff71f0da32073caeefca7da63db39aafb0ab3ec70ba8bf34fdcdfa64975045b862768ed59a8c4ced5f97ffafacafa4850adefe4faa3e4ae3cd0b6714e15e1da5204eafe6c3e7fadc7adc12de3fad25aeb8796e6b70b8f0bf14f481daead7b53c825fea35d3ace4c4f28e2ad4dccb29680f9fd0c4c8aad6958ebfebe0c79aafceafdab355127d2a0c1d23cd2bc1ac9cedc483907ea808bf0e22baa6bffdcedf95dadabceb3f9aadafeb326ad84ea582dfc5e66aaea0e77d3dfbba0eb1e7bdd1452ffd8beaaacbaeca3521a84fdcefba1e3c24fc39c41e743be8de2caaf1f7ca1dc481eceb8ebdbe71a5e5f21b0ab4e48160d0e2f8b76cead0aa5fa77e14f6e8c92e36883a5d8bad3efdb832006589a48273b06f36eabdfa5bcb10ef2d0c77dbefed1add6abacea2b55db15c1eefbb548407d8c0c89ae70baf9c0c4fb02c124ad6bfb62171cafdc096cb0fbb3d4fdceae6adf61a163a3fae5a7cf21e5fd02dae96aa37dccbf8e10cd927daedfa0bc7bcbd7ee0aba6eefd69bd7bd8fbf67dc8f4b2e9395c020e1f46c7897fb1cf62c7c33f133f9264cffc70baa81c6bdfe272d9d3b4ecdda70ef1f8aebd0eeaac1ee04cceb1e8bbfc1266c9ccfc20fe1496b4faeefdfedfd15c49e178c4f04fcf5c160a0d5fccbff5192c4c45e6678fcd8fa27cef4efebbd5ade0eaaf27906d8b737acef5f32def9e1b0ea0141bae4aa6c32baa1d98fac2e1decabffcacd9ced63310f454e0ed47ced55dad98cb4eafcc4cedcc7dfaa08db075de937c1cee4addf74e74f28c7cd95f8db70efffebe23baa1aebebd7e37b9a60ae5960be698be8d3aec233cedbcb5a8acadaa6d17bcfeddb92c754aadfbbf5e611b3a4bb024108b17a600ee62cddde25bdebfd5ebedcecc8b74afbec0bec096fde1766c7a36bbffa9e95ef0355ba6a1cad9af405e8f8fd53fd072ad381befa8ede8c2fa3b1920619f1f93bacbb0b4aef7555bcce35d5b7de83b99c7b7e5db8cbc8afcfce0183eba1abc38379e7833e36c60cccc090f0feb2f9cdbefb479f4c62f06c501b0fbecbdc6d94ecbacdc1cf4cc83fa15ec38df9a0db13bc9b043e3718b21d8c1c05674f4c4ef5e1d6794d52f83cc1919a33de91a9c72fdbc8c6e4faa00a83be25bfafc96edaecd1e0f8adfbe83383f7a52a51ccbd3ea4e0f9ab39ee07fc1edf32adf2f8486d0efcf17bd26aeabb9f5d0d6bca988bebd2a95e07aeced2f27b36a12bcaf6bc7cef4fadcdb765e0a1b8aad3f47a8ae1ff3c0bdca14c1dbaf81d3a66daf7b9a0ba07ae5c64326eaf7108367ad0ecca5e6358a593f6221cb84dfecc05b9834a4db23dcf0a5ce0b1dfb321ddf8ab03f5a6aa7d15ec231b3adcacd7b8219ff899d58c73ad2dd0be2e0167f9fcade23904b2f7586a45f1bbaac037cf5cdf018fab812bf8aeda4fcdd2cfe3c38af9e85106efa5b2ca5cacde5486bea5fb5f2a2ce4a1ed1d69bd5e4bef83d4f14cba5de40acca62da2f492dcd7beebf201266cca9fa8f119e9b5edeb6eadfc74ab1aadfdcffbaa6a8cae4f59befdc5122ba7ce3a0f3a75ccbf5a4257edf73dc94cd0f2488fadef0c3545849ee12e9b506a62319c4a6ec608acd014edc01e9ac2c70dd1bfd6de16fed3f5c5b9eff6fcc9ddfcbd9137d9abdcffdeed5b622d1dadf2e588e65fd438d7857c6b6e4a75fd84ae9f96ca3d449d69f7f0bfa4dc808a4cb3dd1abff26bc71dc9a748bbe2ffb32eaf8946aa90fcceadd54a787fde34b1cc2627d88b9bb9aec03045e6f772fba805207ba99dcbfd1b0f6ae3b36cd655e6f7e3acc6ebd9e4cbacc35afb0b153ff4b404da73c127dd5e6a7cdf0ca2359e95ba32ddba568c6ba5f1bd4cf90951b6c3e45fc4abc84aeffbebda5e41adf03fba1ad1faa7cacb8cbd3de99a5e793bfbd257a34dd9bb3bc03ec8cfcd820fa87ba994214eb2ccacf8df4d2efbc9bafab565a33d02d11e3f9fb0a5dd4ec5affff7bebc020abcdf78753ffc08cef5fb41c339a590578c06b77bee7c5cb4ea453cef8b14db2f821839ebed31b39e837bbd3c4e5a22acefec9fbab6ae5ebf13bffe7a7f713a0dbf4ce1d7cc2fdf2111b7c11e6014c5d8938adee41e0caefe55d77bfeee12388d08344f3b21cd67b851975b1153a9cb1fe1af09daf28ebdf13bf547a1037bcc21ea49ac0e2725a981d23acc02da384726023cda8fadd82edd2dfe962e43ffd97eef4b3aa3b5be6c81cfc0caa9b0c6d6c39e8df12b84df11986dd661a0cad34cb745ef5aed8c913d63eeffd7b997f50dab1eedfbf2b4c3b0828daaaefe96aba24cd5d2573a632c2f57fd2a00ce65b6127afe1a9eebccdb8dffec1eeb62cf7f5d6dbfffdbd9c23bfc29917a5f3bbdf181771b6bc9e3fb0483abde0c0308afdebab9ce8e508f37507dfcebf3c3f2af7a2cce0df2f6bb71fafa1e2a17afaab6beacd5e9cd4feae7dfafd8d5286cbaa03155ee5d30c1d0addf2eb1c06cbfdc57f41ebfded4aae70b4a629f797ca7c2ff93b98ceaaf6ddfbdd1e10a14141ba9fc4bce7fa6e678f6a088bdbdeacbd897ceef8a7f1f0c59519b50cbaec2cda3f38349e95da28bed3af47beeda7a4ec6b8fbc0e7785aabc6df2edb435357a1ae0282acf04f1ff2e7f4ca809e76f0a69ea9f5a2b7ecdd3aeabfcf9f381ebb48a857a19daa19b4def106ebffaf7dadecfccab37ca45fdce899a6b56bd3e63fafdeee6cf396b1779fbfe95aed42c8fadadc0e31fc1cf51c2ac633fd73fe0d7cb17cbc6e8fb9e8bc3c8e44b9933cb2286f43e2d4e7bdba27aa8d5acbbf47d284c26ecfdefb6aeea1f27dda938ebe48ce39f7edf18bed5dbafc3bfffc3cb21166afe27e2a9fbcf4ab9353d080f36bc34e540fe720fdef339abafcc10dbc1ffb16ce5d7a2d416cb84ef636a3a40115522fd75ecf48f3b1f0582eb8b5ffca9fbeb9f93f2cac8ee8ddb62b56e826490abe4d8d3ba43f54a49fa670ea9bb0d7ee4c006c3eb9a3ec3a1dd72a2d8adac1c1cfa08bebe797aad5548c226adebbbb960dc4edbec9efaef18837a93c6dd6b8dcf2672ff5f1bd2fd89ac7cdd534fd2a3ae743863b855ceeeef0d2bd5c42369d8fa23ccafbed1453d790f95ac1af5df761a5784770e5e33aacc0ddbf57bd107b692dbbd33ddddcf7ebf7de24cebcc287f80eeae5e2c5f0bb06b6e7d3adcd6dedba252484dbcd56af6df1afa7cc2a92dfb43e935bacfbfbdeb3f7cc4e14d0bfb02baafddfccf578260bc3e73da1aafdf34bbd6e8bbb01ee8ccce491ceff4ca0bb5525fc34b9fceb1abb3f7fec33a6a8bc352fbb47e74e3aaa80cca0cbbe4d7b125f090feb095b6ebbe1bc7663e0576da63870aa3b31a2adfb416bdbd99cf3a6e933db3bf182c1c17d830a6efeaf1dc1aca7fe1b376fda2cae11ad095a7804a96b958fc065d7554ad65cfe7b572c50b71ee9569efede1698e55e2dd4efe0d8bda7fafe3fac2ab86edfa4c1cde7dee3b9e2decec8e4ce7a2b8408aaec521189977484b684a986ba17d71f111c91ebb1cbb1afd6ee6c8e649945bf748cacbc4cbf0dd4b0da1ed4ab35f21bdb05aee2dbbdc2b4f6a80ebc58d6432d171f6be3acbb7b3ba349408eba0e4ba14f63f7d908bfbe1c3f3fa03aeaa51d38ef7ffc7a97dadad45a65deef8031ea5d6ad97c0ec1fccbd4ea8ee6be78b7f8b8cfdc9c6d4536aeec3dd8beade1ce3bbeb6edf6eae9aff3bb6d2ed6cef22194cf6bbc1bea650f8fb06230ecef54ccf02f627cc72b6ace2a8536b0dd58821e963bdba6bfde51e8b551bdbcde27adfe03efa4ab33fceb2473df07e817442db37c62e1d6cdc8134e41bd5faecb730d3bfb9adb14060172eab1b8190375f5275b71a88d2913bc4ae2bee8aecce7eebaa88e7a8cb1272ba432c3efad3b3f0d3fa75569f754b2eb4a5e5afdbb560b7929e5f858acf3dd3eca3b6d374727a68eea5c5db7beb8f1ae9d8e2f1c25cfb74456e8d60dffb8cc2fa9acefb6cb141a13dfded6143e0288a78acbaebb1055d6b1a5eaf1e1cfdfc83f65cc2882f8cda58be0efacb200cd77d9b2e6e6b02cf47acc2b665eb4cebcc003a1ad947be5e6e2c9ba8ad73a22bbca7f3bdeb31c35a7c700006bfdfde2ca7f328eb1e3ccfabf3bec5dc33a45b83f9f6da1df346fcb53362ce8ad9115f2df7e49f07b09bd6ae85c04cbac8bea75fdd2ed40eccaf0bb3d6eb81292c169e1f99905ca3b3f843e04c8fdee57fdb072b4ecc976d64e1dbab7142c1d4b11aace50b1ec895ad78dfbabadc3418afd9bda37f8752b539e2d6e91e59af36227b77b468c5f6c47d53a51ba6ac97e9a5a2adc9f0bec65bf7eaebaf70bdd31108db31bce4ac9a0eacff5ebb2dfadeaacce059837d7bec8bd6f08a2bbcead1ae7dfd2ec1af744b1ed56f62d72e4adcb2dbbfbc304dc0e0b2b02afca0f8cef6be9b3d76a812dde6fcd8bf7a30aa1ad2acdfb8fd1bb7af7feb90ac03ebc3e534b25dc57d948b9b43eda1fef333fc1fa0608d0f31f74904fd15e8fa44cfbc7c282a8da97cb61d89c6e5dc9f40bc7c185dabeec0ffb8b2a296bed406ef09bcbbdeadaedaa2cdab9bf5e1fb2b1bc3beeea819c10cc5469510eeacca012bf1913ac88aec4abca7a93eaaee6363e2eada239fe6aa05c13cb7ebb0dc91a464bc9ea0e4ff461c51a5bfb47fc307c7fafc89feb8fad8c67aaa78dcbbaebbe95dedf0edaa7d113e805deaf049ddbe819e6b0a79d2245eac8c7f25a04eea3db5de7af814267e0f121e0b20c1eeee515bce8e7d23bc2b02ac94bf45bfbbc1adfa7de82c5cbadc27c62dda30f430bae4a1c761eaafc954b5bddc54dffdeba6718a1d17603c9f32c1b13ff4cdaa48e90a15caf42dd1dfddfdad4f54ce5bed7c07eab985c56e8e250d3bb50298ac52b0eddbf4deedfe7035e6fd41cf47c7ef7e01ed2ce889be7cdfa5d4eccaa7eabb3dcdcc1da68cfca1d3fcfb977bba497c517f95397d4dbe52dc00cf50e52c734ecab3ab948de4dbec238cc01bcca9d1bbd8f4eadbfceba2eb8e602374f7bcfcfcebfccfb12dcee69fcd24ec8549f5f0d92b5eadebea5dad077ad292c87aef16ebc14cd7377a0fdbedfe6fc15eebe07eea71bfde01601be36febaadb3ae2dca0acde6ca39b55fde11811959bbb69db19523b846b4b8d5d89e9cf94bc0b130cf7f12bbfc6aeadee99c2c4e44b66a6b1addfe136a9caca2cb4ebd7c8a8499d0581d1c5d13a9c50ddde1d76bf24ce407fecfcfd6b2c3afdd82ae1ac03bd2dbf8edecfd3f3c1afe4add4dcb2ea58df0cb8efdc07bf5baba2ddc4ca2730cc3e8dda2ecd712fcdac302f9f5bdebb00a783b9f7e2affbb12da52086ed9e66ee3fafd7100be224dd03c1e6ec5ce8c66ca440d4f2803ebbbae63dee4faf4da06bbca3f5d386cef9c1afe8fbad7c1ad5eea85eaeff21e8d4daa6bef5ea2d12fd94c54bb5e3dff3cb50bca988dc405e2fd2030dcf7afca9bc86bab364eed6acda2bd52ff1aac04d6ecaea77bad6ef854fb9923ad9dec11e88a6f0ff80228cb2d982514d5c223ddfb4a8a8450ebd2cf544a3bdedaba6a422faf78ca3c766dc8f6a7d69d9d79ddc19fdd8a145accb307cd1eef372dc0dd95dc75eec1d6db2efc34ab357ddd7aacf4de9b1adb4aa5d1f441ec107beefada59dbb70abdbfce2fcbf2f22dbad60c440eb2928dbdb0c63bdbbe866ced7dab7fb1f5b0485f4bdf69fa06ffe46cea14aefc7a9966afcc6b9c0d8afcf828e3b5afd5f6dffafbceaabf09e8e0f51ff0b4b100caeadffbdcd5666fccc3c28196d430ea15f9c6feadaecea47a1d92c36ec67aed7adcf2e1ca85dc64acb9a2d9a6d3015f4e8ff364d5ad1adfeb608145c9be926fe147ce92befddcbfc3ea016e1558f3e2baecf0af7c5cf6af55b934ffaeb5d9e1c8ddfd35cbbf77df6c2bdda10f42522e6fad9bfcbb51fb6fc98cf9c52d5fbe17a3ef7c2326cd6143b342daeed22ccf883d0fbcddbb81c4fed2d4cd36ebfecfeaccb1da648ebafc6944fccc8d7fbfdd152c4da527c3dc6e0ff200cbbd7c2d3e51758ddb03b66ae3eef6d7ddf888990770ffb92cf33efeaffb6b8de6948fd7cbcfa7b8cdeb3cb1a9dc3bcdff16a233809e70ae0e5d8073dfef14e21578bba77d4dcbb9704a4e74f98d40f2c4fdba6622a55d0ffcf538cff77b29f0abbf72db0c40ed6dcc0ce4f1cfb2941c183fdaabc93acc8ccecdfc2c9b73f9ac5b6adac316aaa0be45aaff08d8beefc8cb4eefc7ed707a6670d6ce02dfbfefa38e7a5d1a666b1b9eecc951f1e15bb5bbaeba5f4500d204d00055ebce66ab1c3a3cfc7001fd6df5fea2dedddcc0dec15f88a13dbf34bae60b2cd5cd449f8ade66fd5b9ab79c4174ec81b0b942cfab1861aea4b752b943be5bdeba02ff2d16c91fba3cbee04bca0ff7bb1ff3947d2d0d12fcdf7f96c048aedb33bce0addd3768ebcaeef4d5aee5ba46e87fd48aff3cb0eaeeaae8d7dc1d9bafa326b93d81df61a078b73bbdcf6b7eff382efa0eab9eb5dd6eafc9391ec99e245291674f82ae59943bfd5a48f4f775f8cf76b67ff6dd17a21d3679e1df1dc2dcbbc6484bafa5882191a1eb5eb3e7cb4ea3c8ab30c0463f630758d2bacc95d6d0acaaafcbd5c67c22a13db9a3a5e84b5aeea62ba6e0d0bdd0527ddcf0c4219f8138ed1c8c8d6b6f9d10b78f06f94a33790bfeb4b7112588792f01e9bbf549f35afffcc9cbf7a63b3ef5cf31d7f9e8fcc70aeb4d8ab61ee214929fb5c895f68cfb277dfc6a1eea0b1cdb89d914da9ebb34e6af54535a4b622f4daebad33ccff8ef1606dfffe8d82f2a40a65a9e90e58f65e0ce1e6b0976fdbcbb4ea05f37fda5ff4acc907bec9dd5a103ff0afce24daec68c9b8cadcb4c0ef98a5c8a4d5ff97cd0cdac6a1b7ee1fc78e8d70ad5209e3bc10af2046f4235a7b483c5cece6d1aedfada063d7d3df35fd4c4c3bfc58d84dc69a3bb3dfb0cf09bbf195beec088af73e1d2b7a3cbeaf5e78af5752031dd0feef4d6e262fff2fda6d772e1c7d9144877caa56ddfa93aa2272e6aa974d18dcde012a9ab2cc2cf47d23aaeed5b5bef5d34cab67b744c739d6ab0409fbaa878bebbdccd3446a0fd0ec51e1efbddfab82aeedf1ed885adafb49acbf8fa3cdb77419cda3db6d695b5be3c11f79502f14a94de45074dce9cb1130e8e8bec6ce8fa6c5d6e1abee081dd674ff407ce3b754bc8caacce449bab9abf9c7c5d3f9ebeef6f4ac16c98824ba2fa92bcc280ccf703afce8d634c5fc0b6e22fb96feadf9afa6ff4f33a63e3be45f3ff1bbf6d6c027faef7fe4eaf6e94fb5cdf30cbeacc2927d0e23e4abecdea1db8edccaccf76a0e8dbbe6fd013ee7fa5069e64cf3fb97faa7fe9ddcf76edaa51d4317242b437d273bffbe452897a0c7ed3bd0b2caffe3b94a1a3d5cb3a524baf119a9d8ba0b4b94a909fcb22a3efe7e4cf3ad0512d6ddfaaa942c984cbf91dd7ae1d3b336f377b2dcd9fe9c9c5654ccdc56aa9592fe3b9d338df8cd9db5eed7a50d3e48a1adfc41e0ba3f0053a5aaa504a8df43c8cdeab264d1159bcc3a5e5eb6647cb1917ef50b14aeead28ff6f9feca14301ce9fc4ee103ce328e0e0a9ef563325edd7ca5ece66c85affe200490fad170d8029b78dc722d9e1f6cf3cdbb1dc5ed3acba41fcb7cc4d66fe611fefedc95389e41181ffb33dab62ef7ddb6e51aae5d5ddf4e3bafabbd966daebda3dc56d54bddb67064cee3d8b998e4f031d41e3b5aeb30babffdac53f8fdceccd4c0ac829b5b0524f887c4e3ae22db06c1bfb75ca162b949f85d6060c35d3e48c3a4b32b0f52fa58dce4a5aae2a5bd1beb6b3135abf71ef476cfd5308c801face9f1cb7084fdabc63116d1abfabdcbd0eb0da5c364bcab8c1153e80dcf7a7bffddfbf867e5cfed1318be0fdcaedad0169faeea2cefc81724f8fb94888fbbc6d677cb4c2305dea7dceafc423e24dedfcc0cfa1339bb18b119f75e8109aeef70f8ff023da9856a710aef6aa884af54d9537b4ab04a1f4ff8f5b0adcc2ae5cef2ed5c6baa342edbf8ecf5cb5ea9ecfb176e5c3313d0e6eaa9d2fe198140fa92d571dbc04bc454bba18dad3bd90cf26118ffe020ce2bb0e1f3ec7d6bbba13fbab316de4bdc2fee20ea6958fc46531417e7e8e8eca7a7dcacf0d15ef0be9cd70f06fdc1ada3c1a3fd0590fcf704b8f1ecd5b38dbdedfaaaf4abeebefaebc4efaf90ccd3bce206bea9612d2e9acd5ac2c10ebca3710170ef32a82392c4b67e62edba3fe6e675e13513405ae1fadfff4f58f305b3104cc382ab4a38fbeddc3e9dceefa6be23cedb41eb22eecff193d8fefa3bfa4e5e3c69aab3e982ae9c016fed81e66bfe53aeeddf34053bd82385b6d1fd4378bcefea13017f9b76c73a2f507bfb7dcba264d5b6e8bc962ca52a991ff8bdbebda59e77fe9c62fcef1415a993ffe4cad9fa3a96984489bd9edcb1a4bb134735cbe7d6bbbc1df6dec8809a45aaecab1bcaebaf06fbfe90cbd8dab61f50bca34156b47f4de94cb3075d37e9c7ae8f7f540ed6cdd9ed7dcffb90d24add5dbfefd06ca1e6ebcc4ba52dd7dabc8106acccc7ad0a4dfff94d9ccc1b104bccfcdccb8e3d6c1dc3f88acc4e3fbcf5df561fd7a0b1eba7dd58f7c9b05d9eae7c5da7d5dbd4df7ffa1dfcb34f9fe0ef3bbaaba9cbabee477cdbc9f0f1064ee1c1fc1ebce136995bfb7c8cd22dee5fdcbdeb1f457dd7302caac50dc5d9ea07fe01cecc5a7cfebc915e8c7eedd68dc1178dbef71c9771f3c7e1febee6ddedf6cdcceccf2a3af1a93a3bb4eaa508f72adfa6d33b9b358cfca16d4f7dbe3ea07bb331dc552be2145932b6bf94deabf7aeb0efd59b7be6ca30ddcdad948a87b1044bad23cddd45abb2bae5bda00d4eededcfebc38525f58aab0c5c7dcafe8c6fcf0f44dfa44d38f4fd1faae2e6bff4cc205def25be1d1db0b50f2a57d9af0caddb95eee0ba96c435d2cb737b7aeb6d43ffa29882eaaf2ba84f9fe1a7bc10ef0ec856257a8a58d9dca1c47a6e214dcfedbfb2e4e5d8a5729fa2db9e61b2abdb5aa39addebc3e7a6ed4d24fdfbdd5edf21cb770df102c4edea8b6b0dedbe1e8aabe8cfb8cee5820e6bae44dd4d22a1e65fce8bbec9ebf7bab8db20e4e690068168732ade64edbfaa4164abcb5202dedc8e1fbae9551ac8c2f01a1ddda29fedbf45de5cff09b8bdcdc21bfa660ae5ad6deacbc0cabda1d63abfd5be47bf8e47babffd0ecfabbcdc99bef9f1d5c5a4ea0fbac9fc3c49e9f56640fa5afe6ede1d03ab98dc417adbf06aaafda17f4f5babc83e12cdedcdc92fc1bddc6007efaecf38a7ee3a231ab7e3fea538305e1d0aee81ad84b188fc4515da14ace9ae82471f2ee50cca0bad2f324e1eb88df5a55d8fb4faef71b9cbb50f8611d43cb9f83e40d562ddde15fbecdc0ead901df4f8aa25ad1dbba35ee4ff37da9d46eccbd51a4c03df52d42c1c2fe82f930c9dbbcace5c86d38a79b5fda30aca8c46ef7ba95cbacf11ae39e0d200de44c5ac6adf350eaeedc82d4cc8b7c37a67a3bacac95dab3eb4ac3dd83e5237ddea307ebebc9bfeb8d3b8c2a4020a67e19dfba305555f2c22f4db7c0707008257ead57d0fb9d01ed6bb5a84ee1afd86f1ceedf8cf2d59251c21222c67c86dcfdc92a21daeea401fa9cb7a165adb0e9cd739aa3ca7a145ddbfdfe8c5e2f2b1bbdf1cc3ffdae9e49f15f7cbc3bebdbb49acbaeb5abbcbbae7b891a5fe7a4b0b5c1d7ac26ec6ccce3bdb822cb5c41ea5ea06586f49fe08bfce04edb2306bcaf5f6ef1e987b343ef5dc10b6ad45bcd219cce26adff0d12bbae7c15b5bc5d5ad11b573b931beac50ac53f4ddfeed5de1dd5aeba82f7ffbd6dd5aaa6b7a1f3ded71c8b2a1ad9f337bbbf447ab2f4c7bf04ecb88b37b1c44efc3c12ce9daee28ffca447f388ddb5f9c0fcd4042d08241be3aea1e6dedb02fded70aab5c7c7843e990dcd2a93b3a9f208c9be3ffefc241a6daa9e6effc7d9d1ccd4ad11abb82dce281afbde2bfc3faef4500ae10e36fc90b6ee231f42e4de8d1bb67a5cb6502f26d2ad2fdcd379f0f0cfc29c0dcb33fba67ced17dbcb5ecf5afe7a4f505f5ecfb2e20e11adafd51dbb70dc63effbe81cbc67d5a38dfabfe66da42e8e09f420e4ef21d54ed112b6c51f9e6de590b4bea72581ddcafbcd2062a693addea977d8c6f42e44508cbf57e8d9b0bec9b5ed482c392d1d6b7bcbef16a3f89b446ea3dc90650dc3b0cfeb6f3edbcdd3c76fd694a268a4e15c6ec8c137cf9a9e76caa9c7edfb5203ced03ecff2cb7caaaa2abd5f77ee874ff7d4d7fc2cbc2875952c358bd4a1b1facae59ee83bfcebc5be7b6038b4d67794de3d4abc4cdacadfb0dc19e3daa42e4cfe26bdfa64a70a39f0e2eed5f7ca86fcea7ad4ab1d6faefbc24a9a3fdebf7ebabf0ca5ceb9270e4f7cbbe23b2fdfb0ec93dbf6f1daf5fc4cbcdeaadd8ced3032eb785cfed83605618cfeb20b74dbd9dbede9ddcdcbf6f1efc5d0e529ff24e3ffdd5ad0aab7b3bbd9a2f8c05bbee448a8ee8fb46afb3ea1905eabfdff3cc1c7ae65ba0ba2390160de6d9f75cc7daab2acd6659af93e291bb7a4e02853fad4adc0aeaedcb77fd672a65efdfc0aa57aaa2f15aaf6cd34fc60b1bba8f1d2bc96de82d7ee2a31b24bf7eae80430d7af2f0d883a0c8b3bc28bec8cc3ac6efe3c5353e211475cef82d2f1e7c53ef0ace6e0939ba59baf718b719f4e967cda08d0cbece3a60fbd9effb75cb52fcc0dad5bbefe4d1f7cfbfc0cca9c06f53fbaba19ac382f5a18bea27cd9d0cc1dece7dac3bc7ae63ce71aed6caa5a5ef6a4edb9e66dc6c3d489e17dab6f942566bf3f65fb45adb0f77f2cca8dd3b8cc5dde7196e193f2dc8fca15e272e2d0dae1a0c17fad5fa296f1a27a0eae8bfabc38c28c2d6dc0361f6bcec4f0bed6cab5726def4b564ecaa8b80dcc9e3c21c7839d54ccad2abdc88ea47f2127ae96e8f41d4674f46b04a6ff7eef3e5dcb4b7078cb6706bf8edec2f30bba58c96fc8e7b3dcf6dcb6acca40a42afaff3ea73dcd8ce2bddb55c65eef6c4f8b2c676b7e32e6f8d6fabcb5afcfe5c978c17091381911d4ffcdba7315abbed1f4dbf72dabd76053faeca562a2c9dc96fdf3a3a54adeeefbec36e2b1b4f4984ecc5ba7f1d34ba376ab4f0fcc4c72e887d6c33cbae1cc90f31b7d99d7f096f62f3ed9fbba88eef2cdb5feac0fd30c3be5efdfbade0eb4bcbab3f38cf42bb89dc4fbd0f8a7caf39f0dae4edededea17669bbaeae2fdfc231df5fa87dbf6deb41ad67ae813a1416b549050ed02acbfed8acb7cbeabf2a7a3c18602fa0dfadaedcf2bcfaa5dd0fdb9b39dfbd56ecc801ce078af6924f5ab76c1ac4b7daf34a6fd1aec4f9ffd13f8ec89f9f47c7dffc575d7ddaafff6ed18513a4d070776eccd33afb3b9ebd46ae7f3fde0821c8afa8de5eebafa7e55b85fac023ea3ccad1dcbdbb0e1d869707517c8fc0c45ce21dcdbfb1fc2757886739adbfacdc2bf7bd8d980996c05e17d87113c72e56a1eb2c1dabdf76549f2ffb882e5c6928ede090fad1abaf784ad28ad6ad292e98900ff982409ea707ebc6304ed79444c3ee059cb3e1ceeeacbd1e4ac23d5ae5a237bae75a8ddb11acc4d32e7af2bfa3382fbb921e6617f5ed4c3e9e3bf79def807efebdcfddbacda6bf4c0b76ccc28efe7aaf8cc4dcc4f1e00f8f96c05254fe86bbebbacde28ebdc0ef0c4c973469834b1a1e27dbdb5b9ed7dec79e187cfdc9fabcada8e7e3dfcc0cfdd2381e4ef2981a4c2975add70c2cfac327a09aef0fa7256bef58aa314cdfed5ad1bf8cec6fd48dee9a993e7cff4aff08bcaeda3dce8ff43cb2e54224317fcdebed4cfffe9e8acd4ee6bedfc4eb5755e375b9ed49ed4e9e00c7a2e931bcf90b1bbda4ebc73020c5c1367125b6aaaacb14aa3d6f210ab4c0baf89ea6f33e230be6eed9482debfbaad9cabeda3db6ce154dd9734adfb64c3d9defa84be5b35c01cdaab6c4eb782b4cbbbbabc61a7fbc1cb25ec46bb2affb50e3b536feafe6ea7eabd69fcd0e1fcacb14bfd7e1deb52c3fe6a61d78bce4e8ebdef6bbb210a5dee6fcba66bbca5fdffacea7dbece63ab42af9afeea3c2c9b1580fe2dec9c9606eababa2a7bafabbd6eccd34b0ece0d5efeb210288ceceadffe3c75dccda6a3983c8041ecb1fc65ae8edec9e63febe295dfadf6e4ffde29b31ff89ffec4de8fac4e9f260e1264a79f9628db94b419c69a4afeeb9ebadcf4cff5ed4ecbe5eaee4c2acb0fdc4a077e07aee9f92121f2a70234301ac7a733acd682749f83f13ed8537a21eb18bcfb65a28d44d5b5caa80c5c1d4deeaccabf6dda448b4bbf68c61bcc651a5ccc7aab9ecfcfc5acf8e12adee00efcce66a94099f05f9c3dfb0c9b0a89714c3d7e0bea874a2fdd0922fb0cbbbb9f0aa95a0caa0dacc0e497cb41fc41addfeac307bff7dadab0fbbdf4edad28ceffef943dc7a95f3b2f542b7ce0abda38df85db9828ac03c9d830f72ecddf6eed5d2dab0aabf82a12b32e9b9e8ccf9524dcf86eca50d7acbd9f2db07cb77d1bafe7bdcde9c2b6ebf78dd7cdc358bc5b712bbd8fb37ffc7fd4eaafefdb0bfdc1ee2f4da98ba7cfa0cae9cde79c5dc11e40dcb344a618bef5d0fddd938dac92493c5dc6ba1b6bf51c48bc0bd3c2a0eaeaf095c06e3f06ffaa9762ec5c3cfdfebe9e69fd6acae3f72cabc02c75b4bbef9fc4fb13abb9acd88fd5f3a5f7baee24beab3a6aebdfacafd9c7395fddd1484cbcadf68fcdcfc9c3757a1ba8a892ed5ab8646bb5c368b7661dd048a45fd2112679a28a058e2ebde8ecb4ce38bfdf4b740e72acdcd9ab6fcae4f8eef44adcbecc2ad91fd4c2aecbdee314bdfcb061b646daad0c3cc9a91370d22a00d66fb2892bab7bdcecfac6632d238fed80b6fee96513cc660ce1bf34b93bdb91af3e1d19f2cebabf5d5bbbaadb54cc269edefee4d4ddfcbecb5dafb588dd6cac3f2589eb3bfdbd0b99fed5aabfc9dbffa17f94cddadb505adca2012eede7560b2ccb264a8aacd2faaafb86abc44c77ec47e18e8c7bb1fc58f578bca6cc05be0ceedfbbd76b5d7a65fcc84bfceacb8dfcb3b0afffe97e63ba72bcdeac4790faba71179c6be75f018b0afb48db60750b41b596eb3d77e9adcbdef8eba5cdd1b8f2d4696073fbaf84eac07db07cedabff0e9d7fdd882f97f44ce77a8fa83ce34326dc7bf9e19bc7211d1e0fe5bcaea3385b22f09e1cfcaa01fd51dbcf9a8f35be67e2021a5a25a6eb9120deb0a0cac668e3545ff10bcbcdfe7ce641ddc7b2ed8cb0fe332c4dc73e7cbe63060ede4d7da3dfacc6b1ad70da4c58c70bc5b679c11e4bcac9e8fc7bb96af23eaeacc5469bfb3588abcc41de26a6740d8ae5aceb5e0d3c3e63362d6088aaa4fdc6e87bfe32a49e0ce78dcea26d9dbc2ab1c2255f8a094d86fcfc2fd4b7ad6a4232eecf870be3bdd9b5ded600d8443c73efbf21bcc1ec6d3e3ccc1b5b39babdfef125d225e31df8881dcfcbc12e0d7f5d7fbd1a29ce0effc61bdbbcd1e0d8ea44fe29fad05cfca4a67c9e24d59ba44def1f3f349130f2a66827c8a7020a3fdfe956bdda9fadfdabd2ea29cfb65d867f088dad8bb88f9a1c8ffeaa1689d7d4f8cce1439ff53b76eccbe1b2b655e3b8c9b3655964ce2b07cd76eeabab2ffcccbfdfe6f6bf92ca1c0bcc0ab1f8083bccef4bf52edcf34bc4b80dca3bdf7ba6cccdcb4f2d41dd554f9674a3fb8a4e4a643bc4b49bf2cda0abd20747c7dc8eb5f4ab0f7f7a0a1f9cfcb653ac34da8dfb88d485bf3f1021b853ffed4dcc9eba3bc8448b06d0fe8d3fe7b4fb7f20e21c8fbf45f2631e33c7dbfb8feaba089e4dbbecdca5277b2c89be7a1e9fbc750671ec2f4fe32b32de4a2465ddeeaacaace43d3ab74ccc6266d21bdbbd515f6edae53ebdf855f9dec0150f92e4cbc2d9e6bdbf77fe3e46facb2fa33acbf2cb3ab8bc8b2eab42323c6659d9bcfddf9ea87a5dd23339b02d9ab35ef84fdc42e22bd481d81ea4d33ae0561b6eadbdb6a130c49c5c1f6d7faddf6cd25b87baf49fffb9769b8adc316fced6fa8aa2edfa399adc7fbcea41544f7a8add3d023ecca3f17cae1977fefc23220f1f9a2ecb56c91ea625b9ee03cecfe58e4282520eeb91cfbdb18dce012bb7efacee73abaaa5ddc75beaabbb33ca2fb9eaaaec9d3e960eb88feee485cdfb9ffdac16bbbbf9c7b7a1ebc9b07fcefb88d6f6a47fe7c2a342d645f1acfec5c794c1cf36aeff35febfddb8eecf000ca81fbbdcb55b53a661ae5dcdabda28f3d04aaab37f279d37a1e82adf686a5b0bfcab3ec6b9fb0c484badfdea2ac9fbcaa9c3da53dddbcaba2d5bb9a15a7f4cf58673d29ce68899f87ee9dfddc0fddeecbbeb600f941f4ba6b1f8dcecc6bd9a5759cfdf688ada6c01df78d32aa6dbcd8145f5528e793f07fdd97ec777ec28ccb36de6edfeba35cce1358eeea17996795783c2ce5c2c23fca60171ac89b8c18ae4aa7fece5141a3bc34e2383932ffc73ecaaeecb05c617db2aaf4077f62cfdb4b9e05346fa9cb82ffde6d9f6a4e9fbb1e49dacffd94597e393bdf9efaf848fcfd3441bbd1a9dfe9e8bbd29a7efb9bbca9dcd1c7dc32fc026a9de74df70b8cacbbcbd5e4054a9dec5e80d0d9d7bcddacbacaefb9dcbf47cbbfbb503abc8411d6a7e7ccdc6fa90cfe8f8ad05cdca8ffa4e75fb9b81be08757c1dfb43dddf3ebcaf1bd4dd4f0c8962ec3c5bdca4c9bb0e4a951addce9d1ed87c0e39ffc3a7a189fd8a62dcb7bbe10d9248efb3de2758ab2ca0ab668fc8cc8cbbd5639aa7f2f3b802f3c699aea8e91ed8a58df11f2c4be4eb8a8eed5bd5ca9a225e8e8af37c2aec7d714be7ad0ac7ed64dbdc50251cf9ddb0c23af834ffe0892a8ebfbceea6f471cefecb3afe87f21debcd5010fd3bf79d3ee2af252f2612a2d78ce5d6e7cb0ad9b10edbaf07fa4c1caef66add93a0bfeedce38b17e6b2db88676c2c5cbaeb67f2d4facc925cb7b0efacddfe35ded7defe5e977e15c71997ef0479d97dacdffcbf2c0c06b3fe8d0bc9a71d7fdebbb2e910b1e3004b5ca88288f1a2bf84ceda3e5e1a66672cec6bb759db7faf6fffea4da7fa462f8b418157a90c14d8c1c75beadca0919043baea22dfc6b6d32aecebf7fdc1cf2ed5f7f58fc7c0c0ec55faf0da4ecdce7d1e97faf6af180412f5be6a44d9c64928ab33b6a2cac30def3389db95f7f32eb56ade3232dcab0c7b6a850d2afd70ed2bcfc0db9e0dbd46fbaf5d5bf31d97c6b26e3fa9908cd9aced2833ead9c2e4ec870d1e9b7fbf2233d1ec64aafde62ac0f8dc6b216afdd2b47b6caeeee40376ecbec0369aaca715dfdb77b99b0f7de8cc1cd6111ccc9e7ba81dfa16d36ad9cfbc8bd0b5df3b23dbfd91bc0a0debea0c1b7feef77eefbc1fa2f8eedb5f746f652c1f8639cbe67d30d9ba729dfebe41ddcc3ca1ff6cc4e7bba7c4fb2028b291b880f6aff9db3fbe8fc27f0150c408fa0eceef5ea736f8ade2b7d5fba43f487ae4980efacbcbd80dea9b2aa04ce4b8746ecc2fadfcbbc4122ab49f6d7a86341eedeae55c31748cafc29bbd4558949eff8724abf99ee54be6da344fecc8cf27ede8225a05fc5dafee1a131f060e92a2fbe83faf595bcebb6ba51eb2f6b2aa76a1f4cbcfa4c8ebdaa98a0a56151ad13ddda5aebfb2bbed57daab66a61ac77cbbed19ddc8a6537eafb4c86ca6dc2fd584a2ecd76abcafaa9866e81a8e5f5ecefd9bb5787f9d4aabefb83bef7abf597cbbfca8a932a6be19a28fb0a88eadfda2cdc342d14327506d094589eb95f4b6bba54e46741106f7211ef4c77df0ccfdcfadfa4995ea973f5f13ec1f9cdadbc1b6b48d2a11767d9ba5e7c807b0af2fa2fbbd03d69337ff17ccd63b0ac17d24a0de4dfe9aaee86bc7d0fdea34b52ca9ea66fdfde50e4d47bd71e10661ccbef40788d0e7d03eea42768a73f2ccc6badef6f6eb753eb6c03bd6acc1a420eb3c300afbfe8a3edceb02f6ebdfa7cabeafce6c0cad46dbea3a29587f0b068e389ae869b5ae47fafebfced6dea3a8b66dd4e6bca24cc3ffd1acec7a7fae6132dacbd9ec97f7d4b9f9cbdfefce60a9b6ffcfeb2effd62354b8f20c2b2dadbf0eec119edc74bed3aff645f51fd90621af8abb55d9cdc37e52dc90b3054bbc23a5fbc19dddd6c1e8f2d3fe57ad4cae2dae9fac15caa2ead9ee7e33be6c47ec516bce5fb6cf10e5ee4232ba8cebf5e7401f6c0b5bfe9b2804c9b92942e1fc8bba31bb26c404002284a2c58f583d8085cb97cce17e20ad7feeccceb478fec56c7aea01e8580eadbe8a65f5737cfb4d4d6d7ce30b16b6a2eb5fc5cfb36eff87fa1ddae6b8cfafcdb88d8de57e8e4c458af9df33ac57195af0bd40dfd4e09be761fd60faeb68d73fdbcf9edb1c27af0eb0e4993e4ed61bebcdc483eebb27aa36f2ecd2accb2d9d7edcd717be1cfe732fd7aedb4db28fa7ae12f1caae3c3f81aaf7dd6b0ed3566641aafc5be96e1304ddb48abb63e4ee0a316b699b66e6bbf2fcfde85dc9046c234edc8a9a987c687fa7a94e354f2f3c0230e109afbabe78d013cb015af289c49de59b8087eacb83ce50995eedc4b96d8e11c97c22d2f130b2afeb6f9d4dcedee4fc3fbcdb98165e11ccd6d5ddbe0f4cedcc8ce1ef012c3ddb3d17119a7bff8b1e9cffbafd0ab6bc5db68d5a2f50bebf92cf8df4cec32df1daf6f391b1bedfbd8f6cdddb5ae8a4afdbf05eba3f7f1b887a9994703edacf454d7bd6674baec2a0be83faf9862be5cacc8f6eab8d4323bf45d1fde09f4bce66b37c77763bd583f9a1e7cd3ddcee9adbabc58f304dce1aebccceaa24c23d9d09cbcd2ae3ad2ace95ab2adea70a9cfe5d5ce55d2cf1ccaeef7d371dfd75670cb9d4f3661ef2c5bb03946dc7cef49ebfb65df1ebdfafe26a82cfff1bc962fe277cfdbeb2d2fce36fa7c7ee1a6e75e0db68d6ae984abd55d0b80c2a3b3840c85a754819f56172da86ffffb6727bc5e1e832eaccf9082d5d903bb03ea96fab94c57cdafa9c9e4614a46adba4f09326eff20d63fc1f8fc5beec0f9f2ecdc3e7ed53deebb926df74abf1c50d82dd74a177cc271ea511af6363f8bd9bf9d4f08022029eba76acf7b617efbfb8ffa61a2663ce74c81956fb14f3a61dc6f8b80513ca9da0fa45ecde0ff980c83b5e8e8372dfbe50af0a6d26ebcde2cda6d7d0bc7bed0bd2184b8599ca626cc6170653e1e5f5cec15ac382e51bf61d21fcf7cbc9c8d49f66394332ec0ff2d80814f8aa5d06fbeddc31ef8b30ecbf74caa8b58fc8e49952ecedfa8675fac9ad5082cdb6dde939aaab7cf8bed96cbd4f1fe14916a79fbdfe5be6dd78f8a2ebfa6fcfe3de0b0b8bb4fb8f5dfc6ce8aedfecf7a5c9022f37aa98f08dc2e372b32ea18482b3def8a8ba8ae24aa1e63eea5174925982aa1b7d96e453bcd2e6370f9bfda23f1e1b2eea46bffcd97a47ae307d8da9ee8baf1b2eab8565da4dbefeaaa180bfcdbb580cf2002de1fe3c87b8ae6adccef1ca2f542bfdf8c8b1cfaefc4cbf9bbf0ccbadbf9f12b345cada0d98518daa4ddea459adbec72b07f9493bcee7fdf5a069eebb9f9dba86ed49fbd65e4faa04cd0696121609fe68e23ffe98f59b28b52a3263c57acbe5ccbeeed4a20df9aba219dba8fa5c72a7f478f61a1bbe51a7afd3bbf3a1cfe49ffa2ef285bcda6bf5e3f89657050e93a5648bac02ef8c3eec8250bb686a8f7895df53b4bf77d6f20649abc7b49ee9d3f4ddb696e04e36a2ce91abd907fc97eae5ff0baa9ee68eaa8cc4cd08fdcccc77c72d2b28f7cef4efde2a4538fca8cdc34fc77df7fe801add213c034fddab2c3c3bcdd55f7c046bf7d4f2f0df24a2bbed0fac12abaeeb23ebfaf5615eeca18cca7c52e43cef40b0fc5d3ecff55e9bcaa71cbd0aab6395183cbfdd4ef9b33dbbe3dce8bab3c0adf6a6ebcaaaf26c4bc8ce5cc183b6f0d620c3ebaad3ef3a5d3c2522d70fb50cafcbc744c3c3793aca5562b9edde573224afbc2abbba677131cfd5742ffb79b21c7b19f91703fd3bc5b4ce042619696d5c73d38e734c2bd37f8abca8c3c9cdcc842f57cb1aade81bd8f5caf5c767dd8b0dd74e5c3bf310e910fa6e69e9775ffc3373cb3ed6617fdb29f4deff3bfb02ecfe93cebdea82d7273d14fbaae400ba302fe3e0bea9b27ccbecc8de15acfd9b45c2d275e380acbdfa0c42199753346e38bbbdfacdbb5c63394e88c71ee1ee58496f7a7e3afda6e1f4e02e0ae70bbf0beb8de13ecdf0aabcf5fbc739ce088ad544cfa5c3aef3bffd4da900fb02672f32caddcbbf44e7cd0a4fed8f1bb3c37aef0b43df0d7e308e50bc9e2d1b6ebd5e5412f8cc325edf64a509c9a4deaefd580bda502c0e657f76edc8fa93967e0384acecddf9cf2918fbbffadddec7843cc4aeeb0e232ed7c9d0a5d6fec7bae7a09d6db9abeda3dff7e4764f456fcc194d2d23eecd29bb3ef2d1f6d1d99bcf09ef57dc89df82ee65ab5c1cb9e5fa30aad709087e15d9c95fb266fdfbfc9c625ac77ca4d3ca385cadecbdccee3fe6caf69ef8a5065a7ea25acb653ad5f98f2dbaefd9cad462b5141f5cf5df6b9fca0ebb79f50d9f9c818de557abbc7bd3baaada8abb4eb4a7a47eaeebe2d30ebec5ecfc75a49edcace722765da6daeaedd18dbfd3a4bebadcfade577beea1782b41f64e7a7ac878b6a356cae9ecb28af236bbef8dc79bbf6127f0abc657ed5b79ef93ecee98bf5705b5f92efc9a0ec847ddbc9b4668056861ef477b86cdae87289ab8dfb01fa03be29c4b7a1e600c444e96e888bb1eb46ff9abdafebac5a09a544eaaa427d654bfdd99e658aea82b8c7e3ebfe9284e49e1e8e9e8bbff199988e96ec4bf8bbe96ffeefa6d2849d5f0d4cacf7fae9dfb2ccc23d83caa3f1bb1aabdce8ebf4edcdecab7467bc3d0b2bf3baa40bbceabb9cbea5abbcf5bd03b2e8aebd3fcc7aabd5bcfed83da787c5ad57dd6f6d51be75dc5d5dcfc6d12206b0cbcabf6f82f0ecd9a355bc0a16fed9ee479c252931ea45be3becfd814ce6eaf536cbb9ba12ac42dbb7ac0f4327cf8e7afbe56dea9beb24cd6ae43dc21f5aed611dca9fbcd3dcf2e7d979cab801ae973d1dfdfdbf9cdaf9ac6198557b7a1c0cdcf46a03e022410e28d2abc0a71ce1329df61ee4cd3d19ed049cbb7a8d70bbefb617b633ff134ceeac2c667b53445c4a5df3a4ccd34b4efeebf921ffe7601aad3b0c04cffad3a8bbfaa5edacea6a7ede7ac7a8decdd917cbc9b59e2fea17e3c1fabf11d023d82edde8fbdf1e4fbeb221f1d7ca42835faf313dd9189dcf1212e4adba3b62b1e0d663e8d60c40ac02ed33fc8f063f8afb8beaa82eaab2fb6cfc43bdcda8902525cf11e7afca82c03b0e5bcdac4cd9c6fed46deddfd6b92ecddb21cc52a1d45fcb9faad3d7cddead6cd95bd52cf6031664cda0a715cf6c0bcebcf3fa41f3f0ac25ebbe8fc8af88f7afea2fcbbec4fbb2beb27f170e860b3ee1eae60e9fe43961af4f5a5cabfe3c15b49b74f28dcbf9ceed3dc27bb18da8e96b558a3b481ab2fd75ac084b102aa593ea32b80aefe4e3d3ac09fc5e7b09d84bf1e9ec81b4a1faa8ce0dbffeea0cf8833dacdf3020e3c9d07a693c62014e8bd37340cafabfde63f9b6275a3dbc1ac9cceebdd75bbbfba3e0b5c4cefbd60dfcba08c70dfe3ceeacc73f1cc7d70ecc9aab6faf3bfd574be8ac81cee7373512aa1a2fa36baadb8e08da0ab58dd92a1431da223454e4ccedad45881365b73c82cb789d7ec5c0a93dccb2d4aeb3692be46bfad952bbf4ec27c97c39e709b20330a169b7d5b90021e24e122bbadee24ca2a161f21a523dddef45bb3e13638a54ac7ade56b8f14b7bdcaad28efebac66b0ffed1e2eadd1ebc9b2ed6da78f610cc65faa75cedeabc4f614fbdfd070f52345f5b5c00af32fd2bee7c4a0b3025984d1892c0a72f36df7e1eeb1bd0b0fd448c9d99da65eb047dc772101efbe7e0da96ef1a9ee30a32863cfb8bc5c4e8eddfdbad4f4cad08facb1e6e08f3d9d4dacd73c41def737edcfda4cc5fb19980f667e107ca9cffbbe699d9efcdbaeeeff8d7f01dafba08af99fdfa36d7054e82094e09ade0b14cf238c6dfec95ad897a9dbbb2c859c829ecc8cf4d7d5c3a05805aafac51a95dbdfccd870a2c15bea1fb70fd408fddbddfbf05d3ad7e7cdbfb7c3c20a71a411ef3cf8abfbdf50fdab66cccfaf15fe20abcc8fae2b34f270e0202b1bbc91ccadafeec8c209edb35ccfb9469ca5d9adcfdfc9acb1c6defaf35a7fd8c54b1f9fffbbaebb294c089a70e9fbd5eb0b4eab7dd830c28a6d840bd7ba74719c5bc951dafbfe09c72d55fce7de4ea8a08fcb09276baf7cbefff6f0d043df03baecd7ba68f5bc3d9a0bc09f02fcef9e0abdd5a4184741ff1f8b5ed8d3eae388b9f9462e4371a8c680cba41f81f9dce07ecddd684ee5d532de00c5e9b58ab8cbc5cffcc6922756a0d064e84ea55a5baafcf29e272bd98bc4ae5d3eea799fda0e55e722b7c42bfca4cb2a0471e1ecdbbca0fe32ada9047c60d9ff5235cca6e8eb6ada43963cbcafdff2eb0e9c34e8b2dd3a4067ac65fe4acabfcb9d3aa5aad28cea0ee9bf2f603e5dfff47510ff3a796a3df2f3da0ebdffb87aeda03cce8febcc4ba13e8386fe30b1cebacc338b1aa52dba7bb880c72cf7ffd757097c6428dfeaf4134baf27bb5ea28dfbe39d31b64597d9cf462a2b860f2d3fed0167dee3f1ebb8f21bff9dcf6f9799265d9804dca3e4e1d36f7b5b02f95afa6f8cae923d82369f5d2fcacd33bbdbafeac5c26754baf14a04f046b8ac1e907a8fba0e0d80c0fc6bc768beadd41f39c1d111d2b6b2fe5d7dbbcdcabfbfacb04ebafdc0d7eb5e2fed249d8561f3cd6c1d5c57722ab2bc4af19efddafcfdf8fedfcbce06ba4d82e41fcb3bb9b70cc30b6accaab54aa912bdece76eeca6a2032ebbdf0aa9acbcace80bfeb2d9aaad0aabd3aaaec0fb5eea38eb7bddde50aaed84f439babab1de4c6b60b84965a23bb058edd5dcb0e4ba2dca3dce5afcc9fc11adcf18ac682aacdc8f575a53d3e6240794ebd59c10639ba7adf3322352d9ab9578bfc88d0cddbfba1ccbfc1dd88b78cc3e734ccde327cc14a2227b19aaa1af8bc9bacfd29c5eaf924cf8df6f60f87073fa0bb388a05f6e9b860ba5adaa3a62ced21d23cded375c939ec9c374e2c81cf0b4fb5ade8ca0b1ce0d7000edfe1bbfaf13cfe8fffbb64d1efcf41e3af85ccafc3bebb13ff8f48b3d0dcc3cfc5b5adbef8fbde5db73bcfdedccee7916d4acaa1a693edc81794a249c7ea9435efca5fba3e9ccfc839aeeead2c38c853796dc13ecbae8af00fc7fffeca4368cc1bcdc2e75f4fe88845c7db6cda266620cb9b1ae8abdadda4de8f221cfbd5d3cde76cce9ecaf93cc6dcb0ae3caea76da97dc876b8dd01fc8a703c6b2146c032e5be26df0dca0c5d0a953667c3ea67a08e6c4633878330d2caaca3e4e8b8e07efc67bfcf3945acfaffe011eabdbb2af5feb3da681a09041e8ccabb2abe094db6b0171ddedafe9cdea72a3ecae34c6f8e97b77f8961eaeb16bff9117946cbddfb236b7c066a4bbbcabc7cef13493b9bb828f5e7f34ce0387fb6e15ade89ddf8feffcb45476f20c21db85ab957fe98a2a8bb2f78266e48a91eb5f6a1079d9f1de9b726ba8ebb5f61ee5ded3e338c3b19ca1fb97f3d371acb9898fd6bae6cad3aaba2fce0aaa5cf7b44fd1054e0dfb26992ddb4220afb167463dc73aadbeffab58ef6ea33d4aab47e1ddefa7ddefaf744bd9638fc77a6abe39efac7a5a1ad9c30cf453668e8a15e8b02296ce6693abaff0d251084af3d3bafdaebfb1f1e0f617ca41ee0ea7c79f5c1b0e245efd81d16acd9f2bc7ebcfb3bbfac28908f7ad44b0de2a97dddad6398b1d31fece1dfca2b3f519334dd01c8a9f34a2cb9a4c7e493eae9e11a8ffc2e7747c56341b9c45bac253bcdfe8f28af1d5daeae19bbf8afcba7ca1c20eedefc1de223e6a8fbeda11af36ab10b08ceeb3223fc415a8aefba2c2e4ccb789b15ef5e31a823e3cbeaf04c48b98ab32e390da577fec2fa8bfb7d8a3efa5f90c68ffbcbc64e8fccefd4db75e9dff78baa6c8c6ac15bfe9e7bca8b2ef14a48dfaed511dd4a0ca1c4f74c1706e7ceb9edb584536cccdddf22a2dabf54f62dc5afdab64fcc1ebcde199fb4fcb4bae0d6daee54b3a3f4ae4af2fd33b13c27f3f97bbef0f6ee8218ef778c3bee130cfdd4ba33bd0a8db1659d69b0c741dcc3761330dacea70e4b6583bbcbbb4cdd13fd6c97d44543d9cbaca08fffe98df09ffffb732dcac6b4dcdafac0daeee0b6ab7b47a738a8df5d769fce9b4bac33135f793d9a476feaa65727b121a1d37cff8f370c5af086bc6b46e65aadcb9bbcbc066e4af1eb79c14c1b0c2c45a75f8ddb666c3967a299d0c5ac6e941cad0f01fd5bfecaa1be2fefcf19bba5d9331c54ea6bb1cdc051ecd762b876b775ef5bbc4ff6ec6ed09ba0ff386d4ef7f77aeceecc6dafdaf36cbab57ef0b3eb8a3aaffd72fa0bccdafaadbfc0bf90cffab9b02b094f0e8fc354d8caef66bbfebcd9eb03ec3dc1cbfecffad6edcb376f2e39c0dcdcbb08983aecb7bcdba61d7a43fcdaeeca2d45a4fdcc502a3ed19d7c8de028dd918874aef509adfd113afc7630900deca93de023bfaaacafb13fc28c35aadc9cc6c4cc85f02bbbd5bcb181cbdeecdc20be26fdd8c6acbfbfb1ba0b1f21e5ef1a8acb1b9c41eb4c8a4a2ecd8296dd62a0cc6c00e8cf124fd6e0c31ee63a7c068cd73db676f69d63652d9e8fdb7abdda6e6b6bbe635e5c9d5dbd8f93c6d2e1dfcd6494f5aefdb0608a6b3eecec11af63da9feacc77277bdedf4cc2f04908fa2e33aa3efcea30f94a63c3bb56bb494a6e5ecb17bd3ddbc76ba3db8ecf0feebdc5be94b0a79b8c85cc5d5ddaffdbae1edea1bfe1addfc5ca87ac7efd2a7d1db150acbee21f555de8cdac19bcaccde8bb3bbb7035e5a0d1c7edfea089e328ef8b0d614fe7f57d5cef094a97b9fc6fd211e97b7aa0beaccefdde1e80db9f18a59d4761bdaac34eca6c4bd7dcadf4c9c937c13cfbfe24ebfe82bef5b10f123bedb761a3ee96d247c2532bec66536fde332b0d62a0d13c3def3ab51e3e5e18f53ee06c48ebaa9302c274afe021caa1260b15ade3ecda6263ce37b5e2ede0c3eb043debff57212a2db2647bd4d6bc4027d2af3a488cf6d34df741b0ba448b36a8a6dfb9b3095bc7f13efcb42c92b5dc5e6ef2ca5b01acc0017b67ec7cfa8fee2b2bde0cb3baa1c18159edfd654977ae6afcff372e752fd032ba8e44e0b7be17ceaaabc7bdbbfe9f808daefc2d3db685e5ff7c50bf8289f2665da8409a4b312769629b8d19c02a7d379b260b3ecd771e6a7206caf5d5c9cd7fd4c8a1bed5db0b2fda8c9fe2734ecf656d0b92c87a5abadcb8f0ce8d559f7ae29efcc6d095f4aaff7a5ec7dbd5f73c84ec65aaf4fa5ebd3f7e5cacf7631867c1aea3ec4fe2ab47daf30c250b2f27c0de3753ca1cc0f9b8f38bafc4dd20dcef665aa3330a116744828da88eb5dfbbe2458b4dfdb77f07e1ddb2bc2ab88afa2d8f0dec6ebfe8ba45da27866d66b7ec2df85f4986742d82f2c302aa22ed722fba0cda3105b8ad84a3553c0dacd6d6f06efa0bbfe1bbcaca84c8adc047217aebb1e7f350aef9b5b71ac5f2f0ab2df0fc8baa04371c5ed363f5814adeac6efda6cfce0cdbd35acffbfbbb50ed181cb4bcecbf86bcac5e26d4bdcf13bfa97a4bcc1ed4eecdbe3bda42f24ec6beaa451ae66629bd3d162bea8a32aae81ff78c6d8d4a5a8ff6babbd1a0eaddeb2dfc4ce485335f27bc4a8f72e2681cd84fb37dca79bedc0fcf7dfafc6cd9b19afcd11c2d74f9de0ebdefd112cd0550d6143f4211c41e0e0552aafcf6cedfe3bee36eb37d40b75f3e2bf96adddbfdfaabcff2fd42de7df6f1dcc446d8ceff7b0ba0cd0ca7fcabfeddddbccbfa02faef728af4b23abe626fbc8c7d8a8dca5e5dfb0dfcf28af6a3e1d2baa4ba17bca54d901cbedcbd457cfefb4fa98d6d52c63addaaef9aaa670f78ecf28bf8f8ad64bd7fb88f3ceed27ff5b541ed0c6faa485bedefbb979cd16ae8a4d27222ac14dcce14a85bcbef1c8d28fefc760aa8a0ffdfedc5e32fc6aabcfeacdf3cf3f2a2dabb47e3ec6af9f4cbe399ad9e6df5a561d9dfd9e9835bc9ded628e85a0a2fe0e1dff5f5ad43e8cac01337dbd6e0cf619b886a73d487d770d107ab9e9eb2abb4c84f6ded10cdbdedd4dae27eaf2cb18c4847f8c3371c523f97dbd2efc3d65ebe619135b77ea7d13087b349f76e9deab9dd11ac46dd9bad419cef641535a112443efa3e0eecfef726cbefc5efad482cbcbcbea50fe72f053ddf686fbcd7ed2fcfe1dc015fb458a5ae2ec7f2caf783d23ffe116fe59a1cdbcaef68beeac2dc33abec19cb47c740cde8ebf230dfd9258e6adfef94c7668045ddbc0c8da1004ca9a10a773e3bfe6f19acae67ccbc0294fdfbc9cfef3337f6a48350b376ae56d73da8fe3a04b2d61b901e7dc3eff31bfce5db7ebaf87aecbaf2a6acfd21cbda520aacc4cdb47b4ff50ff344a52a5be31a61bccffdf4aca5c2a244bedd4ff02cfcf5d3156380a82fc0efd8504f94bdef2bddd71baeaeced03a52ecdea1bdbde2de4a2cece69d48edf2bee3a7f9ad66fe8eac3f12ddbcdcc7423f85495754d7dab41eaca58bb4ebdacdb1fafe46eaaf0fd1eddb4cfca39fdbf5d6d9babd3ed2b6138cf99a9eed8b48aa08cd48ad5dcea2aac1e7c7baf171dcecfcfa1dbe0dec877b10e2f530be8eaceea205c0490bbfcad6b0ddfaab776e18fcde0e895301b645ed6ccf0cfeee9ec5b86ea1baedbbadbd8133eb25fd71dbbbc7fb8ceffb2ebe2d4514ca0372eda63e70543daaeb9e806aacfef0bafe3d18dbbdf6f75f5dbeae3da2f8dbc7ec9a6aea855d42a0f5fe93aaabce77422a51cfefe31a40ff3ecbdb40ea2c9deed4b0ab4ba05f93b7cdb2618ebd9e64ed879cffbcc62cfddd5acdc1421adef7d044da9fdbdb03ca6704b6bee4fd267f2dbc5acfc87054dd74ee02fbc5b4ccaf90698cc2619c54239c2fd668d1a12bcc9eaeb0efc9b8c7d4d1adfbefa8ca5ee40ecaeb7afab52338037fd6fec1c74a68ef0e74efbbe7ae1efaea19f4aec79dabdb472ae0ea87ef2fa59e4b2bb4ace7f4a0ce8a7dcbc7bdef43ac2c8d74a76dfc20f4a5c7be8c38b9f7c9d9d1e1a95a0bff6dd2213d3f1f898bfbe7be2b5f2c6ddba884ca24a60ffedd0e9cefcfac4ffef89babf3aede783c565cdafcd6cf8ef17ad0ddd434ec8bfdbefcacf6aaec3f2fff1bf4bc26f42bb3d91cbed60a9fdedfcd91a2e3fdd3bbebaeeffad86edd6492d7cd1adbea47451d7fd270ea50c80ea6812112bc5bb1f9711be7a53ab32607b2bafaf564b1c5f1de0d4039f20c6fc67a5efac367a4dfa3e45edfe7561ddeb5ef7ecfcabccbe681ca62cb48faaea2c98f526ba15ef51aaecb2edaaac28ec5e8eb0cbfaacccc87bfc1433dee045ac2bd55bfb6cccccd236e722d5ac75ce3f682f7f87bd892e4edfbabef748bda9148ecac3bedff2bb023e76d03f9d507019ed06499eed0d353d2b4496bae4e41c92818fcfcdb1ed0bfb9f28bb49b6ebb5ac9ff8a46b694912f00cbc92266ba58a55968d5d404e058fdaf2efebccf4da6e1e1deabd910dfd5aa99f83501fbbb2fc145bc4aeefebb1afbdbd2b0b23dffd6db14fcf6a98160fa2ca69944428bde5cfa01b0d17fddfeb23116886ce3fea37868f5ba944f7ecc0d7d7df50ec6efb6efbf4edea0abd9940ad4c3af4afa568e50b3a2b4c24dbf1f81dd06221eec86aad2cafdc2aed2f2ca18310f7ace0adaec8da05124874095a1da54d6d2fde6e6fdd9c930fac9f71fae95a57bcf52e25a48f985dc2170ebbff76fd5c1bbc728f3dc2da27de173cee77db7f7adec0b9dce4c9ebef02097d6cc8da300d14caacac659dafdcee845fd0eb3e8deb895d7dd3abdfce3caf3656f0dcde0ebe47daa1ea593475a9edcc31583ae2e9c4356b357de1cfb8ba0d78f23caea5dffd664f117c8433064fb99eccd7be0cfb89adbfecc6d0e3ff0a2dda42daf11a363a43eff9c34a8ecbbeaa3c69b98dbf6b3fbcb68a5076e2a76ab46a00ffc0e07025fc4cef8b4b21f21f23610f909dccbaa61ad0af03cfb0cee9d0fedfcf02748fb2bdedf13b4da5ed3c0fabadddbb7f6f178004cd2f9096166d1ad3add4f8dcae646b7bfee74fa8cb7a2b94be1ffd52721ae23bb4571adebba99d5aa5b89f437cacc5040bcadcbedc14f2464dcb01345ac8fcfc7abfacd9afd0dc3719fab4cbbae4ceec6fe5e6e84cf1a6adee72cf131ad7eafd1f4c1f5e0e6cab4aeb7bd0607f6e0e5baae01c62d7c85cc644fb05f0f2e7bfc14d4361eb96e832bcaefec9ccccbbbb2effa87dbeeba7ecb2ddd49c71bbe119afed3c4d7cacf214297eacd58440a98633a6afd35fa6d7cfe292568dbb5db5ba55b48cdfa6ae9ef6c1d41024d8a4b1a0faa29a2ff613a10fd50bad1d3e968b40fb0aa388790098b9e24c26ebce9cec4a2baf9e1724b10ddd36b0492c9e8b0ccfa4c2ffde781ff4aa498ad7775c48e89660ced6dbbd9a4bed9f5a472fa5c0be019f5a1daae87c6f9dcaddba2582e3f6fabfdb67dbd3a0fce94f1ceaac333ae7ef5fc0a8a84ac36de6b3ed9caf46fce01ab3bd5c47e56ea5fb6ec3f1eb82dab9dffee24ad3a45a0debedd1dbdbfaadbaa0f5777eeebd44b89bdba45177abe7f6b99bab6b3b0fb1ef316369667ddbc5d0e67beea73775fe1bd8febb67dbd9edd6cdff43c3ca7645aba5d86e11db117a61ffab1e6d6c35c502eff35d58dbeb7a1c051fa00db8d237dddcaeffae31255c2fbbabca2fb541da6f9a3fbe0e1a354a74a5fec1d4aecbcffa86dd8c3a6b068fcf0ffcefc4a0191db69ca1c9aebbb5abe7c4f4eb8bc54e692bcdf93e8f4d181eefade07c976aa95a7387c6d7bb971ec96eb633cad97189e2aacedacf2207ee3a4c6e94a848c09af17dbcbdbe3bb8c4baa8287abf1b08d42c4868e5bf6ddc33feba308e4aa1e9abc3fd7cfc75fad65eb59b1da08db33cf05d5ede1bfb98bd8de88e37fc6653ef43cca9bcfa8c3b1cdecfb74d4c0e4b4cc69d6df3e0adeade4e2eb4c39f1cf4f2a1bffa27f3b1debda7c7231abc6aec5d389ae68ad1f1a9bcc73daaa1e5c6bdf14b6c2f3dbeafc2be73caeb0fca4c48538bf47039aa1a9d1a64105fea9fd7bdfdda767163dc4aa7fa47cdbfecf3bd1c8c84aef13fd8ff6d5e4353eb91e02ba129d7f8362ddbeade0fcc7838c60dce964ebdaa9b376bab23b39901b32da6837e7145cd025eeb61a304fce1da8d5ec90faf2f8c6b86b51be82161db91efe90bf2fff8bddf64681c3fcc61f2d4833b85ebbc4c8bd8b2aae61bfd21411235d71730967ae762bde90ac9f68dc0c7fbba28fd9e1a6dc7a67ffabce7ec57db8242eecaea79b00e8abbe2f7cb88f8c2ed71af0bcfeed279e8d94de582044e39ec87dca337cce68fbec558a6caf9366a2cd02aed1a1723b6caff6defedb006a00375e77fe205fe90ef73e6b18dcfafe645f5e9915ff4fb17ccdfca2f58291f5ffc258f66fdb5585e79222ddba6ce77ddf58114e85d0c66ddcabda5dd197ded01a3f6352def0f4ddabe0fa95e0d4bdfccdaccda3a948dfb19bfbcbcf9e9bccc003db64ef7dddd2253b239ebf2bed4ed580bd033c0fc55c6aa56ccd1651ec056e7e7bddb2ec42ca9da039cc0a397b2adaf0d9b13bc4ca5bcf26ab6a3ab5944fc563ba6d493eca8cdcbd1cc0eae45f1cafb57d059e7accd7cf49cd9efbffbd0ff431cab5baafb2714be5bc9ad622dcac0fac3abed804ee6f3051d35d6a58ae0dbcbe359bad67d5c9feba9efcfeadd51bafe1c3a3c541aa7bba51de4cba6e74aecf40ee07f509acef85db5dad6be0e3ad9c43ec19badf1fb879eb0cc0e8979c06f0ad40f1bdecc7720afee5c5258f10ddc0365504e66e9bded1facbabddfdc6abe0add1a31daaebeaed8ecedcd2fcef5fcc4c34dbdf387aad365dec0087cb0c987fa3543e25eccf7bec46a1cae24b66cfc987de2ceff2fe3d0bda1cadd4fb64610d3fb9e5ba345dd3337affa324d93c68eebf19de69ce5db4fd3aa95960fffc0dceecd96d04291c898ddd6a1eab388b9cd762cb0dacfaef83734bfbe0a3e5eb69cd63d834d4c92b00761fbebdd8c8e7281ad7ccf409aee7ccecbf3d1ac856115f1ada932547ef9ce85bcacad02dabf95ce4d4bbddaf8eb1f210f7b2c9e67daa0d81acefdd641a3ab0ecb1fdbc46488aee2bd582b831fe4dadeee4f6bf5fa6bac55454cca3e06edca197fcc8bb8e49dfdde1fcddd574f9e0fee1e66dfdc3f91f844ddefcdb3a9f452deeedc71f9dbbe4d19d0f1b9fcedf9a26cff71b05b942b24ddcfb178a1be3beba1d1e3010afd0f6cf8004eb5dbaa2b04d6aaceae505bdfa7504fddfec5ad6e48f8dce6e1003efd40dafefc1dee6ab9043cfb2f238bdf61e84adff9d6fbc68d9eca6bff7badb430af62e7fbf18b64f3a355affe9d28ffad0560305ebaaaf49e242567a2b47741dfffdda1dfcbccb790deaba3f30b4e447bf2703131dfd887bed1c6f3bcd0f4a2f807d17f89dd4130ed76aaecff700d6cb9cedb55b9fa0c8b86aeac804d88dc0ea42a9111efb9937d70fabe6ebd928893bbda6f7fcbe14db74cc07897b3605fec3459d2fa8fe13995cef09650a90e8ee14a8fcc2ef63f4ebdfffc372aed4847d684ad79dcec3ce2f8b3230e927c2dfe1ee01d987986f8bd48fda890cecadc4cbfc4565cd984dbcd21b3d44e8100a63d346632c7bc433b3eadf4bffc14b95be4f8fdfaaba31d010ed14df496167bbd5bc5abcec9551f38bb0ebbea126fed3a6ad31abbc98ce196d2a693cdd79c44909c406cfe8bccdcdeaa9fcdbb5b1f9ce7545a15f55f1fbcb35cbda56cae493f2daec8dea33ada56c4a6aa6ccf96f4db7fb6b35eeafcd2190fd1cddffc4c40194e0adff928ab89b1026ffce4c6aebc2e7fa5be19dc6d9ad3ef1f68d6bc22d46ed8aef60768f7b90a3234dc174c5c3b7694adcbfb273bdcfc5fad609dfaf7a99a9337defb0fa36cf09ccbd8de3f099dc07110ca2f8a74d7e2cdc67cbfe7ccfdaec7c2cebc66179f98ca793c8fddaaebce58edb1f8cbfa07bda6bf5f2d5bade395d6fbcd897dbefeebcb521ed4da90ce551dce57b552cdab0193ea1fc3b3ff1666db80b226d1e5c90ad2e4bff1cfed9a240c1188cae6627b889baeef2bbbdae72ab3adcbea16a14afb95acaaa8d304acb16c7bdc9e10addaae81f0fbf3005dfa02effbc72ce0e2c597803c9ddc64a18c0b6fb5b2be63cbbc8540bd5c56278fca7a4c017c89f57658bcd0089daac8ec84a499a6cb1f3cfec874f22b46057e773e24da1ead9cefbda9e9d08f8b7db9c45fa5ccd0ee956bcabce52dae07b9f7b9f7aaceb3971207ada3e4350ce7813b8ee3fc7dde2b4a62b911aa2bf25f1c2f4c7ad7a2be34c9b0a06a7daed124c4e2b22cdc115ffa91c3eff25d2ab6f61d3776bcc81ffbbe04aeb96175cb1dddfa9c84a7a9eef3ff7edcebb1e12afae66a85eaba5b9ef15bfd0cbdd60fe8dbf7dbf17df906caad7fc6a9cedafb8f2bd11f4eb37f88e07f8da43fffab03fba7dfce0d452ead84fdcdd4dacc28ca246a0d0fcdd1c7d85db8a36086aaeee2edb9b4ab9cabe14ede716deaef6c4f0e701b4ba85fe0b6769e52bbbdec72a3afd6e6fe040474b15a5dcfb38eafb69cb7e9caeec3bdc9deabd4f5aadf1603bc1adafee097cb9b3f4dfd540ac7ef6f1ca46aecdca942fc0c9e775f39a5f75fb7f1c0fcfeb7ea0d17bc180c355cfd2ecffad8ed0d0423a462b3cd6edbdf3f19fed4ad05999fc92f27bb0f1908878a3f5acac1aaf56ac3e3f233fbc75ff0fb0d6e81e22c4bdee4ba0ce9dc83334c4c9c9ee8650984c68df2af0d15fd6cde11aa85d9d55de0d0b446dfccbdf4dfce71aac4fafb9d0ee236d858928f28cfe4558c77c0a34f0fcd1ebdeeefe3034cbada5edadaab77f57b823bf7c23ea4afcbb9e9ed86aabdc985c967aa0026fea9df87ac3c99fce87bd9aaa5ea993d7d50b9af4c132caad98adb244b3c2df00cfdcba551c2a09df4efbab7cef3f264e49ea6ac5645dffc4077fdf854747bbcd7108638faaf198a7fca2bc24ef2abef429b0abdf592f1ee0ab3e92bd316b84f0c20f8fb33fe7ee7bb25dfea0d5f2bf440fbcaf4edaefcd6caf87faffeccedcac1faf7c6de7da0f56c314fabbdaa6acf1967b397ac509b33645b76ece1ea9ca41c68ae59a84b7be515fceefbd0cfbdb3ed7ed5ede4c7e79b1b2c7a7131cbef73ed8c5702ebbd241abea2afb8ce5fd4a435babaae81a74a23b1f545858aeceff66e7ccd7e49f0d31ffc2b92a4b8cb4aff5f290c25b8f0d8b7871af7b5e34e02b89aabe9ecd00dcaebcb6bbdc1e7adaa895527aa47c5a2a1dc0a27ba4ba4cedaa50fdecbbc0ee730ff30e78c44c5fdcfeccb6b2e25e9ebac07e32283addbabe41dcd1e4ebdff041a34b7c031dd9e1cdbbedfbeceb571959e40ebf204dcc54429daba62ccaf800b598e8d0064df6b5849e6cfcd22d3aefc38fadc07cf7e9d7031cf8ae11bfadd1e18beaeacb55ff161f26ee41ce3a6cda461c3bcc2b0c163a0b2ec927b795039aeaeaab9be1e2ca9ce2a532f5cfbc2b13ddf00fbbf4ef87c075c99eb96cf45fac35ac88e1b22f6ecbfeced7efb8ac26a3eecfe76a13ebd5d4086b571c53174c6a89255c4baff22aee409f26ef27981c27b4b67ce267ceaeab31b7eab8adf0bba24f5eb2192a5bef0a8522ef6e1c66f2fce2fc4aff2f5b1ee4a7abbf3ebc09ccc06c231ead4b4b04f8ef8ddf59a34acafcc42b3a99bf1bd33e3ffed458bccb79736dcbd2e15e0bcad23c3dcdeeebdffcefbccaead2cafaafa188463ca5f8cebdfe0c505c0cc4ebedd8caffcff1abed174c61dfab59ab3ed0067ba2ad39d7def88a53bc8dccbbba7a4ba8ce1fcb822edcdf224fd586da537a442281a23a6f1baa4b21873aa5344b3aea20d782543aeaedd1cb9a680cfe1c208a48a17eac9cbabcff6807f4948324afaf2cbfa19e0ee1edddca279a9e0a0aa5d99a1bd5b128c9baf0f83d7400a13dd5c268c2ac3aadedd67f7fa59256b7edd4386ece0ec1d1f2983adb25e0a9b0b1aa3d32ddb9dcb26d58ceec2f02d39fb4e232cad0fcce37ebfbc922dc11519cf9925c1b0de1152546c8d714e40dd4b1c1e3fadbd5fec452bad5b2fe362d6d358faf5e9afb666dee831dbfae690c1ab76ec6f6eaff7e3ffc225cfb426aedafd6fbb37dfe371b84a8e60d55ed1d8c64ef4f96d832d3fa69fb4cabf6fcaf8fe66fbcbbc3fffae6a39647be37c8a1bd3e946afdf17b644b2dc34928c98aa4d50ec70acdbf5ec041ab5fe389ed6877f274dddbade41e7eb1d5d7998e7a6e1ea7aaffeb42a44aaf0ce7f9bfcb6b9ddfd2c34f7cbb75331afd751bb2a8ebcebeaae394b388cf1f70cffe97f131dbcd3ccf419a63acaec620e4be7aa8db8df33e928f45f5b942c1ba0bf2fd0a6de9b36c947b05efda13cffd94a5c8b1b2c8ab1adfbb44d7affbacaf5f9d6f6e15b2df90ce3c0f9f53be10e69fe627a4d3ab4d79c99cf75fecdb3cc2f7cbdaa24c84cc07db5a21cbad482a2faffe24bdd2f0ace504436bb68edc30ae60efb3534baafed9ecd4112f1128c4216ae2551df29ba7158fcc278b19609cbcff0ae6daccd1b8cd1ccc3761ed8a6facd1dbf2cc72fb991afe70adbadf419ee1aedebc93b24bd28e2fefe2a2cfac38e78ac582cd60ed83e8f2de54dfadb3a52d4aaafaf3d3addbe13fa337a4d0f050eec96ce103aec5babdece9090e70d2b059da2aecabf9b79fb55ab65aab0bcd0d6aca7acdb665f04551b85ab14a080dbb40fffb69ace5ff0dfe3e5a79b3fadac524e910eadc1eca51459d6da1cef8d131fa95baead63af5e754ece737ec3d29e49d1becce4d62e9cc9ddcd753db0aacff5a9a4dd5b0ae8ce8c14bcfbce75a3be2d0f902cc3afd7b76db65bf4aab463643bff99dfb225dcceb71ed400de2d2eea4b7ddf5f5fadfff4742d9ccb81c4ab2b38f8fe3ad5abb8e3a31e28e6e691b74b51dfb40b99c8dccb3a63d3b21f1ab307354eebb0abe5cf45d2cd6eacb13f3c63a6aeab38f21ceeb78b85ae2c8f3f140336bc5eef6e62f4b55aaae9c6852d31739d8af9eed12a76387aa0826d9641eb1ccdb99cbec3dc3db4bfa69ab64713ce640e2db9524dd33ff6d2b82fc57a36f372ff6a637f3db1b7aad8aef38e8a2d4adb25df3c951dce141bee729ded992efb173ac25916be3cca2df3a05c4d0cf0bd5b05d1b0cf768addce3732e25b1e87ec79077e4bd6ea055e5c0f1c46d4dfa521afc7cd2fab9aa926d4fd60dfe5b79df25f7afff9b8d65bdac73ffdec4e0a69f66156bd51fdf42ecfdbcd67b5eba9dc433ed7dba89be4c3fe4fdd61ceebefe8278dfc16e7beb0820c1fbfed6c52ae23dcb736ee0982328b722464cd3b4d1e9906a27afa28b455eeb2b006e7fdff28e2e6cd9ff355f0dadc6e62ebfb6d35f2adbffab0dfc20be860c3ab70dccde11a801fe1cc9aac73b6d2abaf2c67fa265adfe3cc2bb7dac79aaa20f3df49b199db58abdf14e58ca7ab7ac07317d2fcf20f1d7bf8a2cbd3de6c9caf49e6f9e445abefc92d6b3edb6fbac9f75b6c0975bf9afdade5acbbeadbabd4aa017dc9de9d0d6ee7e5bc091924428bec8a6bcca2409b1afb68d2db804ce7a1eb9ef52bf0a6bab8e5bfbdcbeaaff68e5fdd2e3c4a04a542eafbcddda63eaf27d22b1b87b8b03ade75a7feeb2335cbbc77cacfcbf7a6ef4fef2db3eed8b697e5e06aca8d6a597ceef00acab7aaeaeac39c6bddd856b570eb62cb9103f2fadc5f2f31fdaefccdb57d5f36edacfbcbafbc9fb3c750ca95e882a5dfb9b00cddfcfbc54f5f9acf2f05f9c96baf3338d9fecc6fdeed239088f96390b91c1b44d6cd30beea87e429c432cb59fa1c3cac7c33f5f4d03bad2d5e27b2dba18bc37d9d687e650e4abbb4bd08307f06762a89a37a16ceba722cabe6fcfecc424acee6f8c2ef4b027010cdcfdb85afc8f41fdddfbdf9cf515cda3f7e9ccb1afba946f5267b0fcfa1d2eb12e4d1af40d661eac4cabdfba61b755c1cc0cbcda6e5cfde791fcb4b92e029ddc29abd6cc1ab955bfbdbc1cd04df5576810948eb4d76aaffd47ceae811ddb8dca2aa45c310ed9c25162c8ba0b7ab4f62b8c9edfac521e62bc8b4af88efc81be2facbdc438be8cfccde557ce3ab6adfeee56d6ac629cca87dafb2dd3cd8d6ededfbbef5e7533211afdad36d4faff3e0bd3bd97b41667fcfaf5fe8bdcfe93190d31e0abd6eec052c92520a962118e2ebc6017cd87fdaaa2ed8792cec40cb5608cf40fa8ba09dcec23d0d8ecdd08d7a8c1d2bc697dac9fc0513b30c585fffcfd77c3e6fbbad5c64cd38ee42cccf530edc3f0bb7fa7efb7d5a1d1cb5c497f4a4986febcfbaeef69b3ae05c282a45fe0ff1ca4dffc1a3b1dddd1a53cfd5a79b9ae62ddaebecc995ef5ade23691f8312a1c9f2176abda4ae8edba49e1e48caa31d7962bdda7ed2c7ff4bf58ce57ccd9f3bcbf5ebe211fb8b1f0cbd2e5b1343b7a1e2e34fad6dfadfb84417b13f993e91daadbb8f0dca76aff40e94be5acd294c7ffb1d77ebc4caa704fe0bf5868ba80bc5c7dc1fc260635c96ceea6beeea8d4ff0c1ddd6fe24fded9cadcca5db8e223bc7ca4ac1bb80dd6edd2aa4b0a20257ac5d9d5e1c3ffbf87d2e8c1744ea6061e3ef9aecdf55c48fdefc2bcff6319cebbcdabe751157be74abe66ecd3f3c939cdcd0cb88fca910a74df6c8fc6b48807eef5a2a34be217b5988f0da6df5114fcd52c6576eb7f3b0d9b8d4a8847deefbfcf4ec3cf2eff3fb6b0cc08d7db87ef9e9a7b8d76b2fbfebd546a26fc15dea6dc0cb6feaad34b0bc9bf8496adeefbaf2c0a86cd3f02b11a65f60acee041d87abef2f3bcfa01a06ae2295bbc02e7bbb9369d3fbbe147d0dfcbca367efbf4955cbf3b5d5ebe6b7f09d93e17ad8dce54e16e9ce8b95f9de0dd6582a9a35d5e9e00cbd7debdcafaf34ff7a25d18bf188dab605060d74e70cfb1ceedd18dafdf3a987e1278f0deff19bddab31e747b32ebf5d10ccaecc9a1bc4930dfaa76e6eccbc97c3defeb3ebd5240bd5aa86bd0a8a5d28b5fbece1a8b7d8e2e2fb8cc75cfc05fd97eafdaa61daea9d66bb7e089a2b2fdbeca04b1d1d9bdddfe0d0e0b7cff2bc12c2b9fd1615c80e3bca55e5dbcedca2f1ea65ebb7cdad1a69634b4c5c7ee752893e7545af2daa4c428a1ddc433516bad7914bf74a3a2f677802fdea38afdb77bb0dcfb4ddedaaaec80d9ea2ca3a7fd90deeeecafdffbb0cb77acce761ffe8bb4ff95bb7fdfd9eb31daea4ebfebd9a1aacaaadcef9d2bbf76e9bbe9e8198180eee0fa8abcdabd0375e7aded743b4035de8661068aa6fc13fcd1be7edf6f83d2d98f3804c553926cbcfef63daf131dea5c76dffa1e2c941ee27182d55cc10eb2df3acdbd33e41c2168ff5e3ebf1c7c4d2bd72311e2eb8087c57bdfbaacf5efc53bb9e6ebcfca5ccabdf8fdcbc946c7accb57c3be33b7fdb4fed4b2b81ca0abde6a2557c79aafedb4de59259b3c0f9779eaa9646a96d5808f6389fa3fb4a4169aeaccbbedb803673d35e6d3fbc1b66346bcc894e8beecbbfb88f5be05ab11dfbe6da7be2e271d190e47c36f56db1fa39fff5db44d9cdbad7e2f9406bf9a43cbeb9a7cfb162c2bad7f77c2d9bfed6307d2afada1402cdb0df6a5bc0e2af655fb102cff34afabd3a11c4cd9f015125ff04bcd1ea06bcddaedbb1fed6ba69c2aaf4634c0e8adfa02d73d04af849bfed278f1eadb6ec9fe26cbc4a8e69f44e4eefa4d8eeea4b3b8d94b241e3960c909a6ba1d8f4abb31cbeaf1321beafafaa8c126da47e6ad2a2ae6c79dffaf9dbf2c6f0f0e395afd0248c1bdb9f3bbbe4841c1f3589d906fa82deceef62ae8fb9952cac1b4eac99f5e1dbfdbdca21c9b6b7f7e25ccc8a2b7ce9dc2cde6607dabcb82e5dbfdf064de8b2b93ab785cc6bbdcafbe2ee7fb41066d8ef8a7d6e61bba979f36befe433afcadfdc85be0f526d980bbd9cf0bbbb40faeabdeac5f9b0decb1ec51da5e72d89290a5933bcb8b92cd738309bc9ef2effb643b54de300fc1ccfa7ffc13ff6ce8f87cfc246126c8f97d7fc1a0db572dee2eea377806bf08c2dec05cbe0d3c340e7dccae9796de6b7163ddac7efe5eec62ca8ebdd8bad5041cd8ed5aec1fa1ae48ae7db1ea37bbb2ddb7aedae0f4caaa4c48f22ae3957f2dec91b5ff6c1fa0feaa45e17eadbfc46bbd0cb9a77da0a1f2f4e7b2bec3a4d00c3c0c55dfb6deedba254406d27e1fb7faba1acbe6cc6dfe3d0ddb0b1e6edcd50ecbe56da59e9bd75befb76facbefa0dcde72acdef194a6c1b3aea4e9f5d2347aafe12fe4baf5318c3a9fd5f27f014cf0ccfedcd3d32f4a3af0fc784c2fcabddb0e9ecae3e0b48ee574e55e3e6a17d92b12ebdcc1b6cbfe71ae0cd02e9fd6a2d77c2a245eb0cef90dee0ac2aa6b422f69a87cbab5edc12db8a48df734a96b0b3e0c6772feaea12f87befe5ca5aea9e7a23df73c3073845c11ac5595cfa81ff9d2f4babe1fc82fa3ab6a20fe6643441397de2d4edee4838a812c63dfff9f7bdcefbf40c20e0e026d3f7b4befcc86a99f2a1ad6a73dffef4a74d124f3970fa78af5e19e690acfb7595b690fbb1d83a3e0f2feeccaed47451a99bde504c1abf8d0a36bffd0a2d7b051fc05dfeec82ed7fccb2dcbfffbabd9f9cfef5bfa2e2c5b7fbe1af8ee8b32ad3b8a7e7b0598b8dda06949d8f3dd9aa1fd5fa865cfbc0b1c2bedeb250df3f09deecc5ee65367df8f7c9eeee5bdaf251fffb05e10f3fd3bde3fd462dca3c8ce0a8fdae34ebe9812c4db23e51bcbbd1b9f53cd8d72e4b9cc15e79cacefa3ee4effd8ecfffbaaa141749ecadfccbe276aa9fa6dd6b1ab87ab4837bccfb2a4fcf4bfe9c3f0780c6f9f8b7bd6d812fe68d6aeac7dffaf8db8a85a45a2efc03b0eba8c3ab7edd9d191caa6b34ea7d45e9bebff43c18f868e71acdaff6be2be3c54b98ee47a16c10e4fcd5ba050ce9aaa50c57ec3ea592aaaf544ec6c2c8fdeccb3eb9bcb7cfea493cadaa5a7c44e061c58f8eb17bfa08a4dcc947d245ca09d43ce5f9f0a1c853ed3b5257cfcfb29dd5116ece5fc60baadbb9b37a55dec16ddfe2b9e11eee778bdaddbacbbcddb1fd0dec4dceccdaddc8b52ddbab92c2b73b8c6c4bb0c3df18ed9cfe03e169cb3bf90e7acada801bcae9ae84c913afa912851de811cae53cb5ecca2bdf11bf4ba8a82d10c653e2cfb3c50fe5ec25ed934156dbed11f37ed8bc3e6fed5c0f9540dcdfc1effb3cffc43ddbc394fc858bdbede4b9f431dc88f5dced31d14fbb902f9adaab02c219663fa8ebef97bd2fbe4e59b0fca3ddd8d988def23de6453f660a2eed74436d0a65dff2fbf6d3ab3a2fa7c7bbd8ce76cafc5a93686df1ccf3d30c1aecab544a0c25bea5bd8fdfcf72dba7e8cbea0af75fb39674ccf7eecc57e97894bcc0fea0f8c62b954bbb292d9c6ebc18a8f2d25cf4c645a2bc9eedbd68bdf90328cde89bd795a4b2c713b966dbb3164a59ef9c2e7c7fdce1fde1d258cb0cf27b0dce8ed4ef52ecffcb5fa2fcf354c8dfa6aa2e9ecc3aa3ea63dcd52a06a3732978a72a38d28d842c4bd9be06af9cdedf8218e7efed37ae38fc4572eac7d6eb2fdc8fd3520cbfaa845bb3d7fd715ff2d9c5fedfe9ba3dfca2aa41bcdabc18acc6d0eb50f22ac23ccd8911aa9750e26732da730c7ca9b8ebe440f77493aa09764c1bc156b5cefb8d7f2228dea0ee3edf5ec886a81cad57ec00be23fed3c4784d4bc0cdcf0ff8b0a27cdee0980eced60cfade29eebefd3f8ac25ee75d6cc37e499df3ef8a177e183fac1bebcbab3596c2fe87f3b5f8fbfec2657fc5f3ceb2850c772dad0bde75195949b770d03abffdae0ebcec369ab49ca1c1860e79f2e7c41e3dc8c71a601a37abfb932c11622cdebdb5fd3d4a5a31e60afb54def28f518d5fb9b5180602e20f3affbebfcb85ce60f3dcdaacdf5adfab167eedf3cbbd3d5caed8a83e4fe64d80adef39951e7bdf85ae6ab3e3d8a2cdb7cfb6f4e8cf9feacc4226e0667ec4bebae01d7b8d4c77f2ce396c6e19c4ecac58337948c3adff8cf0495b7bdb0bbbaaafaac9f90d6c207e8c65c15f6cda9d5f79dfea4ddb175f6bdfbbd1ac8bb4aba1c10c85f946f54e42c62dee4a2eaf2dc10b29ce60a6a46ebf4e8f1362bf3b1d445f32447866eddb695ac1ecaa6e49058d0fa70cabf77d1e5135f2ae198bd3fa040dedafe1b6ce4be4c0bd5ac6fb89c1552b076aac9cf9ed7ccfc28f0df009de130db5ed6018f733bd5ddcce88b8aa524e6dbcc905c796449e088cece75f11bbf0f240fbdcedffd1cc22a72de24ec60eacf7989a7dabf505939e3a0ae915e22ddcc05d2be031ccfaf3cab4f1ef1f95efc6bfc422b77be6dbade2e3da86ec137dc72bd9fcadf7ddf683c62bfd2c0fc35eebeb6aba6c8a2a1cf48a4f942c4a8ff2aea1a4c65facdfb904efce8dd4b7fbd08f3f487fecf9fcfb5d2eceb15ff1de11d21ce64cbae7a2c919e60c8fea9ad1bb79b6fc2dae5e6a5beb2dd677fcdd81f7be7cacafdfac318a4fccd61b5e0a4b1cb027cbfaedacab15f4b3d296b48f4cb8afbfbdd3e5899cfaf38acfe5e7e6d1f0f647358a57f3c7c410cb5e35cacf75ea0cfe9e82ffd2839edcfa7df6a0c7c38cbbc7e93e5be4f9d8c1ca2b87863eafefe4da342d1472faa1dbfdb0cbf741ca617da2f89df1df6ddadeee10d38e09e1bfa71db74adcfcd9ed644ba50fb153dca4dced46ecd5d2dd2a825d0e877edee7ae8c43a0197facd6fdad0c3fface83aadb4fe9e6cfc2f70a6972a76edebbed61bf8498ba081e7f7edcf64e4638341aa8c2bffe0f64e789ee4fb547b2eefe786a8025dffbb9ef1fcdcab20ccd91c6c1d99ca6accb1ae0d168fe7def12072fbdaeaf91b68e4d47b1dcaebeb7cb7f9754b8d742a3cfb73b4f520e6ddeda40ecfbd03513fcd53daeb4f782df72ea5ac8c9abe5b33cfb344b607ddff0c91bd088109c5e77aadeff68cc3144eb506e466f5bede4b90cbcef70baaebafb8cebcffc8cbddd309f3db424edf0eb5aa38e9a9722a3d4ebac1fa9cdd7c2f3f8dc0142fa2269a82ea3f7e1bf0c6abef10dbfff5bee9f0dd83d0dd6bf7fd4c8ff2c1a193beb5b4ec3ffc3a00afcff0ebcb5fdbf8a9eae5442a946efc9e0287ae52b5ca96d1bcf305eb22deb9662041aab35aaa91f5dba98c7ecd82ffc1f2a3459213f7cab23759fefa7e8f7dafeca18d0cb6b10a77bb3bcaffd7a7be3fa67e828eb1b1b5229e02dae56159a6b80fba0fc3f7c1bed9c8f53e7a2fe9bffaf6dd6043ccbdec7bab66aac25e6b8fa3fdb5eb18ef9aa6e04a3c8b4cd504e0bf9ad10ad118e0a0efcdfa052a8a0c7bf5be6a21b981b70e0daa9ae35abf2fce418ca3e9ffac8d4bae8df6215d3eb0fea1facebfee1d6cba54bd61236ce3b0b82bd614decc6904a36a4a3cce1e0da4fd4cfd44fee743d41ce433b027258aa8eaaae9cf4fc3e5544cbea4dcede808dd729db39cab725bbb60a42f3e4ff0f7ad51e260af41cff59422cb164390ccaa9ebdced979adb17cbc8c27deb8ea144e14935bfee1cfe8ef3f3c85ede816f5e4ff4b37d3a8bf93bc34b0ce027e4ddcea959bebcdaaec6bd540cf2b5ffc3deae0a49fafa2ad3aaba8b5c3d2ea1ca1c2b3d9df344b650edeaed7439415472c05dfca3e96ac64b0cc3ac3cf4bf3e697a35eedb0abebf15dbaea37b8ef4a5c4ca5dbcc1a17aade50fbd83bdb531ee16516dbc6ca3cfaab1deaaaffcb68afdea29e44f210b67fe2068a02f2212eaca9c1cdc129a98bcbe7df1cb070e50ef0e425ee6a5face2aeacab73ab2cdb2f6ef0ba21bb490add5abfbfb99fa32a7cca9efdfdeee9aabe229884fccf2838cd96a9fe7ba199da7bde1bdabad552dba4adf48655ac3df52eda1df119f2dc3a9fefa3cb61d7dc0665c4b2bfcebdd5fc67dcc1b03e5f8ae10d96feff41b2d9dd0b691733cecbc9e71075800e77fa7ceaef401a1a836a6a75582a19579ef44d0c9cf1eedf6dab35eea41bbed8eedf8d6ad08ddfeb4cafdcb1a96b838f12f7e4fdaff4df48feefc0c0bf3c79179dbd3ed7de1dd55ccb55de906b11854b19bc8e6d1c8b0d0c8c20fdc2e62bc5e96dbf76ca3386cd1e8f99b8a5a4ea240e6aa77008bade3a118dcaca7dfc5d435e9fc9dd7fa1ce2cdfacd7cc57d07adbb0b6c9b9817581d987c0fc7b1d6d0a7a52baa9b18c39114fcc2e71a9583143a60d63ab1e32c0f96c0aa44ad9190de9120d2ad3bb2f41ab422c9bfe11df049aeafee11e8a7b87faed87ad21d8e21bcd90dc8acaabf8e3eebfdab8ca15d9f8729f11c00b66bbfddbd741b85bfaadf9d3d8affd4ea44be7f10faeb67dedccbd1e8b7b8122c7aedac8e74fba4caeac0bf58aca0abc4247fd3ade7edddfadbe0ea328214eb5d25b8fe8d65dff90ec7b45f6ccd9e7fd4dcfce2d5009f6b5b845cabcfa3b7a6fe5d0f9be4dcdd4b8de60ea7ed540b1e5039ccf31ab14d9bfaedbfc14bccf94c4aedf6a13a7b2c7bc320ee60a99c755c7f0dd1d1151d8ab4cbdd76e2e610fefd2ffe16c2db11fccc96cf8cacae7ce8c96bddb5a48a84123581431afc84dffefbbbd621c96a58fde0afcdcf2f187fee518a53e5847ab2dab5757e756b1a3e8f1aadb77fedd6b4ad201601b0fcbc5b41e7dfe7e5d4a668df6482dea4f9c6ad0c01eb02e9c580defa98afaf74c9d69e15bbbb20f89086decadfaaffd6ebd7c41cd1af1412b5a914a4b2d2d1b37d1f6996cbdccdce472fded28bcdbded48acf1e3eb42d7eaade8fdcda88adaca5f9317cbbd42caf2fcffc1adaa8f22a897b6bbefebecb2e718aad4f2d0c8f7ea6e1f3ed1faabd253dc6e2ceb2d11a214f5d1dbc44dc234a3ffff9ede3b9adc57d0ddc8ff0dd2d38cfeb00ebfd57d3d54b4add9fd1b8e4e4f0c15c7e8a08deef5bc02b3accfdeee84c9a6205d38d6d7eebeed10fe8999ebf4dbcc77ba6bc718319cfd20b48feb9b05fc3c0dc56ac03f8a2ef90aed0fa3d7bd2678cc17bd8f0ef57b6a332c3da7b335b90b0d507bff4ca6ffbbff4ab58df0d83de64d71b5ede09ebafa7e0bc5b43611bbffa2eaa38adc648d6e98cbdd3cefaf40abfc865e6ac42befdfa1df41deb5eaead7014aedabcb54a620ad6db3f6c2a3cb3dfaebac6f9ee2cf5dfc4a7ccde270ebca77be3aa2ccea0b980aa96a07851f30be7e53729bbac8ef7db7aabef93dbcfe24752b8e1cb4db285a25fa0ba2aeadb2eb0333f7ebe0bc103206d965a0dbfeadacdc7a26b8cb487ca6ee77abd7f011dc2de2fcdeb3eb2dd6ade6b4fbd79e25fd6b84dbbc0e926a9e42d35dc6f9071ae0e1984adbc20012c1bebb4abaaf91f24ed24d5ddc02523ccd9ca4c0cdc5bcfdf85a972fd6b23a9c0270e1244a9cfbd7b6b81db55a5da92efba1a2ac9185fe5ed5e7bdbe1eedadf2d129f7ce98c2dc59fab7906e2baea57ad1952dcdd18beddec34e2aa575aea508cb3bba9e17762c81cfccd53b9dabde3a4aeadcb2aee5e9bf55b8f752ace04e929fdfd3d1ccc96dd9a45196e1b6b2dfe2082abb8eae545ee6a2ae3e77a70ea9dd5cc3fad6e0503b9acaa945afdc85afc62f40e77ebdf5a6c6de35df6eb15e65a47cfecf3a1fffce5e59adc328cbd25267a3594d0f0558aace9236a4bd1caa5109d7b5c3590a01cbddb527ddb469deb3dd4d88ac1c8ab39f6d6762def2e7ab193edb7c1ccaaf6aadcded2f1ecf92c5f16a94fb160ffa1c8a4f6aeaed799db2379ded0c6b56a54af6dbe4b6aa91343ace9ef8a36ac71cefbda4aa14769fdc0d3befeecab36dd08abb3836afebcadbe35fc0eba0d2beae44dc7ee48fc52a19932e0b84f97ea49aa0a257eb7cbabdef29937eeeab91fc9f8184a1d0eca34aeaebccbb6cfdda3df4af9eebcaa0a539feafdbcab3dbdceabda676aeefed8cffad6bfbf05dfafcade32954dfde24a0646fcfde0bbceb1fa6edfffbfef56871caa0467f52e65edb8b9ee7b4678f14ac2e0e28f9dac9e89dc708a24854084ceb6bf58dcc121a7adce1fd1fedfbc01fc9dfddc3dba47ab9eceffc6df2220e2b0eada9efc8e40fabcd25f0dbcc767deac43289e152ffe24b643c7aa9ff7be67724daaa299cf7df094b6cbb6abf55eade33dd2e23f76fe9235fef562333aeb7f158ed2aefe019584d32c8711ccdcdb7a925c695ca6ec35d0c23892dcc8cf69290b22cea1ac697dc9ec86a35ffca907ed48ec03b1ef5f73dca6de4f92191e3ed1edf2728dbbc85b3676f2b2afdb0cdec17e4dfede300166ba620c06cfa31ebfd3b8ca13b6337f6058e98b31ebf0b2bcf2ba9cf2d6fdb44e0f1e9e7e9aa7f3f5ebf0aa434aaddcda30f46dab4e9324c61bd76e88dead4024fe68c6872f3ff7bbc1b9eeca6723ee45dd4eef91de61df0fe4eee1fa385ec869ae7e5f6c8d8ead668ae67eceb03a4dd701bf1ca56bcae4478adee966eab2bbedf751d7b8f04d7edffadbc62fbdcb9ca353feabed9eddeb0c6db5a10eeee1d8aeafa340d1df7278a2d1dbeaf9666ed1ee4ae5f4bbddd7f8cb311bcfb32ac80e46b7b9567752abffad506c95b9c1badea1e597bdadd45a8ff1add93ddeee6fbe15caa230a9eaaa4d57e8bbbe37cee1ab4ac3f4feda5a08bdb9dacced1f4abdd8caa8affa9e00b4efc6bf4c94c22dcfb6d4e5fdad9f142a9d78ea9f0fbddc5de3720b131aec918e3aaea9cdc2f1daed79ee3bb0dd3e434cb17f78f56dbaf7996f8c4e7f37a5f298b5fdcaff2a659d51fa36fbe6fb5f3c69c24cc5b74b2ec0b8ceaddfb8cdfcc8229844088acc88e65a7f2daaebe224ad96d2fa6cd6ad2afddf53a023e2eebf63ddaefdeff5a696cf3b1c04e3ed79da5e24db7f956d87ebd68f2e815844dd54b3b2a181738dfbe6ae3d8f16c3d76a75c30b33083aa81654a0e695a41a3fbdfef98a86b47daecbe7fca7bf50d57b1dbbee7ed7d3c6debe9d1e3eeb967c9bc7f25f583339fadfc51d526f8469bea633eac9dc241da5e6dbc5d9dd6f7ba50267c2a734773809cde16f1fee7079afafbb1459bbd20ebcb554a23f8584ab8b3ab013cd8bd0ccca3f1066d018404ffc0a76c7dffb3faa16b3aaf6419af89ef69ee6cbaa6a9d9cf9850b9ab67b773a56ba16fa258b9e4aa0adce4921e5cfedfb9f146891dc47cdab2e3246f0daa47fbd70d963e29bd0b5b6fa3ffa9e87cbb8ccea5fe04b457903c9fd610bcff87d91fcc53b4f414ffca8d26d2f7ba75cb1aa2353b304a902fea6e856fafcaee09ef0456cb87eef7887d09a2472dbcfcf6bf75bad2dfd7948ec23e7cacbb070ac1cc6ac91845dbc6aadc8f4ffe1e31a6c1fe63f0bc0d7dc43061b8daedae2fdd315185cc4080738c53bae55f827f188b8ef9e0ff84aafbffcab25231ebfc0dcb2ecceb7aed44c75aabcb32488ffd5c5d1d9bc9f433f3e6c3eabbfd111ed5d4eef9fabf341d571a71d6c70cf69f2cec01ff345d1cbcf7cbed38f3ce59a13ac6cd1efbe65f711cba24b3a5f190b21ee37e5e9ca9b5ce0863dd59d8b9199feeb6d3db8dbd58eacb87ea288fff22791d6b892b124066bb88fb563535850cfb19bceeb1d9bdae139bbfeb85d0b279874228aaa25c9b9914bd98eefb6ee83eab666df2dffcca6abee58b5e4b37711a98bcf4db4a5563be13e4dcade7e7f38171eccf4a96a6510b9d3123a73ddf1c42dbcffa6498ecb3abf9facfced271ff6dc3b78dcdeece1ef3310fe199e02ede32fdafb3e0cb9d0ba06a542e6c3b71a4a209e23f1dcfca9bbfa5ffcf82b16bedeaf3cbdcaecb887eee8ecd08f132e57ebde3cf82f875b4013fee0aec399549177601bac38837e5ffcf35bcd1fe373cffc1c4679a60610cd4dd69e5a09b12fa3effe6ef67c923bfa7c2bceecfef9f190328a4d54b601bd3aa060cd21cd8c385da2bafeb9bbbaba74eced25ffa9cadd0d2ad5d32fb9ece569badacfeb595f1cbce2dc11fba389caca7aeedffed014f49f7c5dfed35eba9ea25dbb54dad3bcf1ac6dfc71d6415f35de1512b09cf1cb0273e3c4054410d8daa4bb93d8aa9cf6791e0a4eba803db270775d8519123b639fccef201dd0c3beccff0d3ae72abeabd5e95f52dfaf9a3bdec7e17ee921fc6935fa7555fbc2e7a05bff8bdcf5063d7b5edc3b8ffee39efa8ba6cc91e584dd098b8833f2dce3e4dfbbce7d0c31f9e70c1bcd8a3cb19d5ce8fce7542d6ce1756919c0b9bed46fa93caccbecbed8ed501cf0dfbefaab80f8bc0fa6eef1e4951fdb31463d82d48cbfbc929abc02ce13ca1cf8d0ec1fc88d8f1bbc94c0b9e3ed6e20e6c80d6bf06c2c8ce37a30920d1b96740889f72b0f26b2296af44383fedf26a7d0e639c8e5d7cac962f166d336c8c3ddd2ddefafc4ff8a73fc4da11daebbca2fcac86bac1f3870260b1a520d4d297ac22df60729e06ea2d03fd8f5b0d6649fa7ae2bb5c5cd2ef3aedfcc99ec5ed7acedc30b14af0beaacee58e28cefd3cb975da7df4207b278df3f767ff8927b3cd23783ad2bec11acedc1a6cb7b921751ba1f0eeb9c4160c39cbded3aaef77aef50d184835dcc5ad9d565a3eddaa0ac5fa1e8d34aadc9fff7e7fefd10c7f3c8caa0cae4220b5cef5ce5c59de3fb4483b2e0422afdea4fe6b622309ccef85dae5d9cb4bcfbcfe54d0311c5d90999cadc9bcdf61be0bdd479529b2c1eacd02f6b2f4f62c82ae2d1e2b3d9eac7cd00747ff8ceaf8bd077fcf1afdcfed05ae98b6be05f9acf1abf2da00ff7e7eec12b3c8dbb7a4cc55aefcfdc2e0adf2eabdb4ee47bbdbeefd8f19add88d4ce3fbb8eaef90d906acffdd5d394afe910870fe56ca6bb2dec361ffd50e2a280df38139cd122c8dadca2c3a9ebacd30bf3f1ed0ffe87baeeccab4d851d6fe2a6261e2ed3f0bac1c8833986e1cb28d4a2e3c81bf3cce4ba7bffafbd9d9db7ad04bed4a2da5c91dba8734990dbb2d3a194e324cf1f743ec1db0c5dacdda0a31af2b19dbbed8a8dcc0f7c5ccce9abffcfd9c0837e1c4da8facb19ecf62d0ed0d93be4e647eae8f39ba8fa693afacdcfdea4f46ee3b1fb05312eb52cda561ae9bf601fe1d562efdbb0cadfbd8baaaeacad8433cceeebead05ad53b32fef5e327dee5a34aa861ebaa9dc2a3a1ebb340ff9762f5ed7bf1fccc5b8d5535da5c5a4e3aa2dec9b59beeea90fbcc08db87df06dd4cdc7d582f0c0eba66e0c8d1afaf7c6bc4bc4cc9f08c30e662add5d3cf4d2ff41fdba8109d468cda5d8caae8567cfe313ebe721e9ec7c3b5333b0e6b6cffafa0c50fcec756ecd42e082e09a20fadb0703ae7d317488cfddacdfbd533e36a00cc89c1bd3724cec85637d5c1bb30ae52d878ef65ee5dd9cb46bbdedadfbecef8defee0583d64aeae32eccba5dd67bebbd93ea232075f625e984facdaaaeb0a3bd1edb5ee6afd5abaa4ef2b893ced39e948fd91e176548d6fdb0b01bdaa27bd7acb0e344fcb3e63a33e87e2edb3bd07414005ced37a3bd952aee5ce5dcddf9caaeebced344b4cd6cdf4cc3c33a679b67bd539c2108b25f5deaea964e3dcb3fcd9aaabbefd1bfe1de7a4b05dd9f5b63bf7bcceacdd766aef142a720a9c663cc839ade15401b72ea1908c37e7b6bcb168dcd2cfc3dadadcfe2cded8fcfb8de9cc1eff73eedfc29b63ca45471efccde89fbedff158bffab38d201ee4ceda6fe8cc5f76ca203c7de9a4ebca76f6eaf5a40f0ebeebefa05bda2a347e1451f4be0dc0d526abbcdcbeca5e873ade2faa5e54a09eaa43e203d77eadeba3cf8fd161fadf2c26b493c5d04ba4be6a307c6172a27ecf3aa09ea0e28bc53a8c55afb08bcff638cebdeecf48a88c1c8c2a352b9bfb53d2e28cd70c051fffbcf433e28067f63bbdafd7bbf129273ffd90e08ba2828ffad7ff8a5a1fae03252da8cd7ffa4fa46db5ba0b2796acdd4c5fdf311f0d7ad3140f732b4d0c583faffa72a3bbb5b91cb442c15fdae8d7f823fbbe384dbcea14c83efcc6ccebecd68af0c27e0829ddcb0a53b0811aedcec60d08ea7ea4ec88429bccf31677b4fcf73b2db6f4ea6de5d3aab79a782b414a11bbf54da2d412bbccf7fdb0f21f9b9aa0e4e1aeabf36ecc61fa4bfed1cb07e46612de1bf73cdac97d98e33eaad8488d610d852dd7ddb092ffddeb19f9de397add5deddbd77eefc3d6ba63c6fc7fb5df85fcb0a5decfca6fe1a1ce1ec9d8ebcffefc5d3a87c0acfc54c16389ea57ea857a6e8e8bbbbba7dff57fefa9e2b547f66106c28ec9d120de94b4aaac5116bc333cbd2b6fd345c30a2ec5f0bd0e344fa7f2e50faab8f4a941bd0cb09475312c21f26a8dd46ba86dcdedfbf3b76a86b4dee13e5e84ace0f15178c3c81cd0c100a537b2cf26ff6beffbbae36f0aadde36cfea0f5a9daed8d38f7facee9aac3d559ba0acdba3b053fefd31ab54154aaae71b6b6c7c5e4cb0aaa9e3ec299ba1ddda4e28d36faa8e7caa5ce4eec4b5d3cb38d83a94b0c75af6efff02292cdabfc7abdeb4e9cd511cb4bd486080e40c4cfebf1ced3a0de5cedab96c91cbf97faebddffdfa44a7f19f84bcd09018ae8ecedd02f3f0ab20818e3b4a08f71cfccce5bef15384be17eb65d0c4dd6cbb6acaf0f2efb58cc8cb1cee93bdb6d962bccaaceb6abea0c2a2a26debafbc1d8c83ededb5ca5455f10efe31735ba7cb88ecf46f4dc77dfbdfe58dacb994ea2d4bb74d06d1afcab8ebc5790f8ec9d9cbc8ccadd961dbd23b10f982fe1a52b9a6cc8bfeabc7b3c34f2dc8f7ed508d8fab44d3f89aa436942b4efde5b3f67dbac506a5b54d9a69fd1bad9ebe83acc4a666569ee3e4a82c0a921befc70b59cb78be00f31fda4a6ba89ab52cbab5befe3e56deaca58692a23dbcedee73175e6bbee72e6a6c3776cb81be4fb336bfd5ffe721660a58bbf81dde56e475a85c87eb97f165dc4ce5bbae6ee099f11daf43d8d35e1cf4bc30b2b5bccae1d533c580ecf1b7bb2eefb6ca8f5b405d3ef95ecccf5a054ac5c0d3dbabc987eea7575ebb1f000cce17258e5fdaf38afb98fd5ffddd14ca9f67b62c811e42c118bb7cce0bd0adcd5a3cfe7aeceadd6c5c5aa5a0f7d8dd3e37f939fdef8c1dc33ca14a5ed669bf53eab5dea64eefed1ec9cea6b5255c773bad3de3db42ee661deea90fdaf37a0dfdf6b55d15d82c98157be7edaa1baccfda5a1daba6fed5e0e05f556845384e9ac5f6a19ff1e2c8461ae11bbe1832efcdf92cdd5da3cddfe004d7287d389a2e2de52b9fbf926ee41f6fc116fcc5d2d6f078ac4bb1a31b6b6ceed98e26aab4f2875e07535419d28a5e3dd5d2cd104edd7685cf62dee3dfe2aebf097f76f938dfb6e1f84f99dacad7d84c1bc4a8491dcb99cdff8ff05edef9b6253f36298a705df4eee7ca6e52dfe5c81dfc3173fb9f969bfa56b4ae26dda7f3bbefc1cfdab9abacedc8dfc4ebafbf0fefbf07c8e3939feb4ed299e18b57fddbd9f8aa3ae5f28be5c0cc0cb8a2250ad2afd5a0fca411834eba3dbccbb4c17e2ebcdda1bd1d7da13cc7ec6289cec7bcc5d02d50d5e9a8abd3b87dd19d3def615ae1febaff132992bdcdac834aa6f79baf7df677bd8f3fa0ccf81cfd2f55204efea9dca829b80cb2bf4aa419fac1d998f20f70eadad3a4c5c7ab7fd4fed4cdf24d6912d7c9ba54c5aaed7ae3b4e1d85a6a9bf0aab5a6cf4aab17a1bdccfaddd552bb13aa674e69e93962e0dd6eaa1098a67a1939783aaacf6cce9feac6e62cf3c2dbdd1bc54f0eeca20dcde4fb651e1dac82eec3326de4410c7cddbceba2f42d6387838e69fef6c216ff9fcb6ee67cb9d6fdead79ecfddbaa6f6553e312de58ca6db83fa2b2fdadee8d9afeb0d4d179c640c626e9f38bddbf0cb50fe7ea02da34caed4e1dbf3a54aa9f1bb8e8d8f7dedcda546f5cff92ff00a50fff1a761e7b05a54eaeb4cdcbc014aadfbd0e5a5e722ccb3e385bca5ef54fa6a617722d5b8c783bef6c039f39d1db794b94dd87ee53adf6e30ea3ac64a10a08eecd64d2ff55c11c15bbaaf97d16c5d1a815c16eaa1a5ead84fddade697f5d50572637b09c3abe4400ab22e7f7cae55958f6c77f1b0e50aabde4f5c9d5966cfa572fcca64bb7e4dbc6e33e6fbb2fd4aafc6dd613a359efd1497f0a1bb5ddcac8baaeb25fc04cd4bb7bafe91deceb255b2f0f23fad924f86c4b29bcfdac793cbc7a2edce2cfeeaad255cfb6a653c6c95bede55ca51356bed0c63fc9bac31225b99cd699e0f4bcbe1fa3bf33dbd5d64e7f1aafddebffd1fad8efb5cd6b797b9fdde7fcbfa8e23eb90c6adc30af7291f054cee00fc8dcf9dd3e8c1bfbbdbac6d61ededf4f71bfdf330aec9df40484bb3038b1a1ea097e8f2dff1242b8afe039ddcad25e38406fef0a7e70a2f7d3d12fe82cb5a54ae8ca456ee51bcee3850d55ff64962f4cddeae7ee6d8a73a20065ff7eaa9ffbc28b35df8d0786bcf9bbf6e987b64edfb83b863471ffd3c6e028cdadadff2662aaef6dba9de67dcf29f32bfcda6a96e2c0667bf96ab90a3e0dbcc80fe5f5cc94201dd5c29d1c78505ad598a9ae0e527ecefad39eceff8d82fcd8ffe2d62bc322bfd0f40daf5d91fbdf99f4d53f95bf9e3e4fbf98dcde2a2d6fdfa719ded127ccfdecf1bca31adda8ac1be559ca10abf1ebfa09f44f3915cbcd8e9e9a1d4dc7d3e5032eab1d94968d5e5ac449756762d5127dd1df006c4a8a366c1cdc45c08fc0986e889afa652a8bfed0bbabaa3a4ff5254e4d409a807be0e80ee0142f690f0cf33dcaaff0d4f078334da53cbccfbc18a8fb22e798154310956938411ef9c5aeefeb1d12dbb6dc0bc7ad1cd3f8dbf25ec10ae4aeaab15e1965b648ea7e8ad8ffc33662e0cddce7e685aa940fdabddd86b9afa39ccdfeb3f4adfdfa6d8218515fac9e405fcdd8c7cbea2f4ee5c6fffda3cfcb5decf0c09fd4cdbf87a9f72bf5baaa3ffb746505f38c9d6889aa1f1c7cb63f3f3f329953ffcaddd9f0ed7fe32fefa023088036d2c632e70bb5cdebd6499626aaa76b87ad81d944d4dce23ab682bc3c361f5ce186bb4dd3eff92dbee55b019c654ff325466c8cf3a9186483f6ddd6dfb5f4f6d2039feaebbd4beefd684abe4f461640d5c5f1a1bfba8a91c2a2dadbb1d8a7d932b6eefed8ae82bad52ddac6464f141bb2dca9bb9de1becbdda521efcd9dfb0deb40cb02fb8e611bf8bbfdd3af813dc1d8682ad494ebeaef4cdd69edc3e2fc1ad76cdc223630fdd6acf77a40c47a24aa8cec6e24183f8816d588efdda4eb4aab5cbb1d8b5ec8ca34c470e6b26f26ebf7adf065e7fdeb1c1ecce359cdd7bbda1eb2d52ddaebb00cae323ebbbc04fd4a2c13b3dc0644dfacdae7bb62e1f5a158dfdfef4c4dd83c8da8b0adc1fdbc0eb05cc903becece082e907eedee574b760da9c1bb32e6d8af7e7adc7d800fb245ebf5ab04acd7e6d142ee6b0ebe78dc5f0ffe3fa4c7940eea5b9e06a3f8dfacc036ea66ed1ba5605c4b1b4075a54c852ce9912f9aed88cfeca7bd90e80efd3ce98627a233ce44ee56ad62e9e25fa0e2b8d1ab3f8579dbc47763ae138db4f190df1ed4dde7beb0b6a0dc2b20cfb3f7c9bcefd4b3fc158dcb3adb033123ccbdfdd3bb82ce27acf453da9aa1bf47df278b2f0289dbb876ba70cdaaa5207cf4dd267cec783bcd8d7cbd8fc62b4a0c3b2cad94dad8c1efaaed13cad639ceeffff860626fe836be4adfc6f667ca5bda34fbe74e5c36acd5c0fe3f624ccd27a70bed404243bf41beaadb4eef7d5eaa0eeb24bccdbad2f2513c8d08dbbd9f0da52e7ff0f7aca7da106de3ee9c2314f8f9161ec0cd5e0edae4f9dd4efe1bbf8cae18cbd90f12d0d787f8b446abef1d7567cf6193eb47eeaebd51cab93eab1a1da8172ffe768bcc355d97184efb0dbad7c91deacefd3a04c7b29aacbfcf0f03fc22d0f10bdbcfebcdc0993e1eb3208ac201a72029baedfdf9f68cbdc6310d3dad0d0acc774cc77de627dd9cd7cbfae4f7af3dad08fa5d20a8b3b41f8ead7cf5f2bce4cdd6d1daafdf5e2efd317abc94e6bea6dd8fd8b829e6ce2f4eb698bc26730febcc08ba83e413e9dacefd2ca48ddf39c17b3a3a1f6dbb0de8e96c394a281eaef6abdc3e4d7c594afc6f649b25df03aee61d7c90aab9fcaf3c41bd5fb4b7115ea1545ebf3d4a78ce2cc7dcdc4d730ad9f9aa7bc8f11ca5fdfa0ded8fabfd1d3cf5ee7cab3e9c8d2f53b6acb5dbb5ed88a7da1b8421926e57cf9a5c68aea5c5ac7ea7d00afe2a4bb4f5ecee11cf2d3e7d4fb3243969da441b6ff5ef3ad8eedefccbaa91cea73a6b808879de7fe2edbfd5afeefc2e7f3e68c1de1aa8d6ad3e1d6be2e48067d1da9ba9dd4cfb4efdebfeb8d0e9129bcb4ecbd8eb3cbcdefbea299beff1dfe36a0da4bfd4fd6ddcdd2c1f77a167ab1c0d3f4e0121324aa4e3a8f42e38d8b3cb2dee1bfbfbde6ed9441f7c10aac9a80fe4daeadae49dda18caf2f3fbc482eeac8cfeab7b3e7a6bba8fcde74f7dafe5e27a90fbaafeefbccac0bdef65a02b4cdafa394cac3e0dde31aad4cc0ddcfe9a2362e9edd2c9ae2be91767d4defdefef4a38d6ee07bd3fe06834e5c804cc3bb2bce2a0aefca7ac49a41d65cadbab78a90225ae6edf63bd713ed93c0ab7d35d8d00623494ca08eccb9171229c1cd3d1806d25157de19a0d1c53b3dfb9aed2e3f8e5d0e78bd91dfbdbb57ece8fcb7c65e56b30fb0b75acc4dc3c0bba809b96bbbd808a7a1c0fd5b9afc172134eceba0eedfa4a70ccecc3fc531b7d9325e34adb93bd7da26ca11ad4abe2c66c42b0d3cbc8ef455aebccc30cbfd3dff0a5693d38bfa4f23ecebf5e42ba8cc86decbbdabc7e833bae03ea1d567f0fabf0a0c54994af7cc80dcf684722f1bfa7a77e2b16ae6baafef4fef92eae55ebbf36aa0f404a1fdfbd1cd7d2752b6f6eeac4cb354f92735b9ca5e8cc8bcb03ac894aaacf97ead12fbecc5c423d8a86b4f41928fd537a2ecbe57d691ede7d0b8a3db6f70abbcef7f6ebf1cdc3434210181dec41bf5be76cfc52464f6bebef6ad168ae204ec06ead1e6e5dc7cecf21656bbcce8a9c9f6d5be7a1cd656c21628b6ceb28d3d65b5d8afeb7ecf04fbeeadff1dd4ba1c922ebb829ebebf5da85c1bbeb5565125ed4a6c36fa491f1bd42aa1fed8d1882a5b01af1ffb28c87a3349a0df1bac1bab6aeefdefc9f34debb16acefc1bee058fcbaa0d5138cbc54e7dbe7d766dcda34d9a51eeec89aadaa6aa2f75a75abce7ad0bea22b7b14b9a8efae9aa0088dbce0f321c70ccb1c6afe86d58dffa3dfad1c1aa9be035aeaa0ffafc0b68ffb6e9a6944ca46debada27ebe4bceafac44afc5d31af04cdeaac9c2c918beefb3c1bcc8bd8ae2ab32cc99ff4b37ac7a6ecd67551aae5f02cd58ff5eb543a907224ea4e73af32e837cbbeaa6bbd06a2ec9bf7c59828fe21d4faf2aece37fa09d3bba8274bf7d2bfcb71feefdebaffcfe0cdb2d942e1dd9b3d11ed6ffd66c87288f68ab651de675e28ccbea33b10de6ac405305772d616fca9e4e16e7cc522e09f14831d26c4fdaeac1f9fbeef6fd4e7cf7eda2caecdf6351af7b37ce070d9b2660b861509ee63dea3c38e71ef9b10ae28a93afdf26cf7bde48abeaeb5674cce0c08102cdbd09ec14c691fdec8bcee16f1dd87f5b31bef3a10dd0faccefce3caafe205fcbb9bcef34acb422ba7d3d5530fef5d5c04570b90e2a95b51c3e3c53da1b5237bdfccafb5dae469bfaba3fcfdfd06a8f0a5e7b66e2caa6b8d188cff7b5ada73ee9b97b7fcbbc3b9bdaf86b2b55a5b00f9e4c1bc8f460ac3feb0e7a1ade2ff5dd582bffde5a1fcc06beac2fa28f571eeb1f4f5cde2d35bb8ee1ee284ab181c5f049a6ee6633b5e0acad7f0eed50e38cdd78593b32538c13d6acf7fb346fbdd874bd8b094a42923ee1df64cfb6dcd0d87e33ccfaade48e619db94387f90775edaec161fad5c0748c01ace105cfacd81b03d51d7a60ccbf43775db638fbbda0c3e7cda6feeadee238a5fccb65896efdd3febaff5a2d0c1ddf746f4fea7d7c5dbbe335bd8befcf69b8ffd9ef35e23fff5e20443bb7fc0adef49aa23ac343fbe8b75cea4cd96a1bfb42abebbb53a4538f7de3f8c630d353cbea2747bd36d7debfba2091cc925bea8fa7b108c0d62bd3e2e983be4d0dd50afaffb8a8aa48b5a87dce9f82fbdf9ee82ee0c81eaeeea69ebf5defad85f66ff0dfbda6cefcdfb1ae8089e97d4d230ef17376a74b2dacefe5ac2a78d75a3f64a2bd2ec4438ba6adff0df21fdaa4b85fc91cfd2955e84dac8efcfab3d7fa7cfffaa0a7385f0fd4fafbef40a0b939d8521ea6da2c9dad97bdfff8f56bf8d24b0f2d1f4bc8b2ae21b43f8cfccaf4bd216d545f1dadde450d8c5360d2dd88b30a5afe2fcb1e9176a2f34c6f2c3f94e3f2ae6bc4bedae525d52e2ba2c4f9a1edddb50f1ed0bbccae2797c2ecfedf8f652df9d8f0fb50ddbdf920f884a59c01e964f30b1fecdc2c477ae4b2808d3de6f211eba7a8f8fddd601a0464fd08fdca5115f2a19d5ba809c7200cb3cacbecab52b28477fd59b55aaf4fec40ce0d82cda4def5ec556cf938847cafaad903f4c4ca3f7dd74dcfbc7b2a3eb770a0a6eb9c6bf9ebde5a38dedf4eae05f29ee121ecdee9690b1adaa6cbbbecaac402bcdfd4298be2bd5aa28ec78d0a42e4cbca0ec33e911ac5ff02aabb5fb6e48bfb879ca7cdb8e34e072bde6fad7ad02e0a5eb68b0fcafdbb2daedb36d1fb4f2ffdb1cfcb7ada54c0d9e276a428c5f1ac0b861629b4df756a6bb0fd68ad5cbbbce6feee8bb7ef8c540e88f7dee705aa7caf2bbe60afe1616bb4cadf4bcf5e4dd9d1ccc3ce4cdf5b3fc0a5ffb1f2945dc61f4f33342dcd386bcefccfc1b4c7bac78cce75a1efb243b5cce6df1c186a35c0d5c0bdb520ef8eeddfa57aebda316fece80e66ebdedcbd9ddff6efd32aa30aa0dfab5cd4febf3ecdafd2d0ade7d3aa20841ea9cc2dd5fc4fca914f36aa75bffc51df44ba396eb13909ff2b2d3b0c9bebe9bfdd4b6dc6e67a97ebecc47140fffeeecc0d31aebcefe465bf6fd138ffd993676a4b4fc5fbedb1fcfc8a48ab33878bf5db81e7aeffbcef5d11f51a3aadcc3bbe4bd42c87dde44a1a2e4fe2dcd8ebbbbe36ce1f68db0ccfd3adf8a9fb9fc4e3898c65b87a4ed3b5a3dea1bd06c879bbefce51ecf2f656d96cacf80cf3cb8cfc8a38ef6fc26faf26a2dadcbf6ce883cfcabdfbfc922d26dc61ce7ad2a8e2b091ef4f9685ea6de102441e194b53ec7ac8d4bc0df791b2e62bd9deeefc9dc6dca5a9fc23e70e3026fb3b1afafb375cc2b0269991cbe57b9c6bdc43d24d8ecf6bf9fff1eca07eb69feecae1c101ff50ff731cbe88e1b099a830ac51e231a1d3afb0caea381e697affd8255d83bde297ed8d6da4a7b1e8a40be96c69b28b19fd5df04babbc4c838ab0d39a4c2c2a2eceb9dabfbb9320516ecfe6bd24b970c9e5c7eeea59b8cfadf1a089da141fca3dab481aecaf3c32a1a1eae0b4db7c52c9ce2ddfb9b8cffffc51afc3ef3bd2cbe35f6e5a455da1d2fdbfa86f9fdef24baaee8b8790df17fa5e2825dd86ffeb796c3d8dcfeaeeab73e7bedbcad2e1cbed3d125eedbb34fcb4bf88dbcb07c4c4a2f7eaf9edc06527a22f34f7e0b62dc53c9393444d4aeef0a7c5f74ac38adea23b65a0d1da60138eedd6e5b7c78d3fee1da3d7d24e3e1ab1ee96131b5ba1c5ff719d3dc56f3bcebb0fda6562fccdda88cb2b985cc1b824c3c8873adcc1602f832b5dbcbba5d72e868c8dbd8d7ecaed1d7188a7a94ecca0dd3afa6ac8a8e1d8492b86b6140c91fe787a8e0f3cbfec5b0dadbed60ba62acefba9f11b41d5e39aefacba3a9647019e50909843af8ace879e27a62ff56c23525bfbe8884afdb570358fa5d47fdc4ff3c60da1714d0af0df0dcdca835d732aef6d7e62c36ee024dcee4ebef002a24cdcbaa9b10e62f3ff8acb0ecb2df501662daba3e1a3ae5d3d16157bf9186ee4a4ecc1ab990db14ad2bd903dca1c02dcee9a5a8c3eae6befe19ce4ecff5b9aa1e2e074aaedea695b9fddd1ad8b1fcb7d4b3bfbe4a6bdebdb1cbca8ada1c6cdeb9cfc083aebc34b6cc14daf6692cd7c5ac978c0f9bef08678ba99e4cdefe2561e9abfd3fc6c7cc216cb4f518a0fb69d1bfd300aec106af30dbcc6c7edca5fffd48dfd3b671f07bbd4ee1e6e1a6b5ee7ffeb9875aef52e4757bb0bd30d8cdc277b75bcf2df6307de6dfa69bbfc9a9c848c2f3ac0670de7b8abfd30e2bcabeef39aef1c7238679adabf1dfe9beec2d40abce00bcd0223ea079fdfe451d1c5aff985e83fcf492b3e92dd205faa3bfaa0efdcbe4efe8235ceafb674ee573b4a179ed021f8fbd2b91dfca6a81bd3df26e60ade0e0286eebb6dfec2e9abb47bfb9fafce1c38cfde2c595fc2d86d5f20c12c665cf5e4ef63d6eb3e8c77a4fd3f31da041abbbdcfd2b629cba2a4abe262daadbff62ecddcf0ce7ebaa9c071acdd1ebfab5da3abd2e7e84b75a7d9d7f13eedff7f5402ec048bb83a4e849dfdd6cc9bdab867d4aca9eaecedbdcf0ad5e0c56cb8ab2ac6b234bc9837e1d6438dcd9cbfade477bbe4f356f84af2052eac1f8af94afede79cc3ae2fdec11beb720f243efa2ef5763fe4fdebe55b162f765119baa2ed5f8d4eab8aed83fd3cbe9dc39454e7b631eefb0bcf60ca91e634ec5b9725f7deabad2ceebaab0eefbd8c22d02eafc2b6b2b3dee6836ad213cd7b79ce8fa25cfd1ebbfdee3cda770c7e604fe2f6ead2d4bc06cadeca1fea47e38af6a8cdef7d084470f1dba2f24df01649cefb74ba0de0c7b8d419e5f3ebbbb71acea1da2fc3d05bb64aaf7d0eea75b0efbef78dafcc943c35b2bd5fdcbccfbfe5c5cea08f4e55e74dafef2bbbaef20cafbbad7a205ca9be2eefec83b9e96a4fb8bb4eff86fdee05ce23bbed4d78e69f44a12e398929eabed23e0dbcca9ee57a566f1f01b7af6ed9d2a9a07bfa2bca7fda2ed19f0b37aa980fcecec78fabe1e3fa0ff61e5c3dbd4bcfb5e87857c3fda2db83e8a8dedcd1b6ddd0cbd9a13a12bede8969eddaae4dc228db628bddcd2eb3a0f9ffaaff8f4eada3cff7310cbe5a09c7c8595e6d9dffddbeea8e7cc6e4bc15fd7f8433cae29a5803979dbbe4cb6d0a0d36163b6904ee795216d4b82ef9bdb350fcbce8a33c1cbef932228dbc4ab447bb207b7cad2464df4ebaedefbade52dba7577e0ce5abe72e3fd851eed3f38de84f0115c1f5b8aec019e11fc486dfa00757eac2df2be90eea19cfbd9ed9ef5b8daeb2c6e53d9fded1780f603dffc3bfeadf036aac30138004e4f1f2ed6ab07eee54f57bacaadec4415ddcfbe080dcfdcdacab162ab97cec062bdcaaefebfac771e2e7cffeee45b95def2dcbbe8ac7c09615cb5022ef1daaa17fdbc4ccea8b99cfc9dcf9c7fbd8e7ea89daffcac39392d04521113140e7eefe23eac46cccffa0fa4828cc3d66f90af116fed91b0fcfd0c7e1d2bcf3b929fe5ecb24480af95abf30d3dbceae7dae8bc2e82ac6dbfebd6e0992ee2fe75b9326ac3e5ba39b35fd7eedc1cf6e3f09ab23cadddeeeff983702a3a9cef381a1182af2bdc3e29f5a96e58af1e11df3c504cf115c3dcdd44a4ff3fce7ccbbbb83b3f2d1fa4caefcc83eaf6ea161c74d58d1447579ebf27ecbdaa74c31fbd571d16a07ceccd4ecabf7e06b1a6d311d9e1abe13ec404fc64908aa64f10e8acd63bae4cad87be343aea7ce190cbef46db83210afdceb8eb11c7b8df2446ebc0869b0cfcfedb613bbabe6ac91fa2e159a8bfd5dfd12e5ffefc1ee54a6caedfdeda05e60b6a3f3fd9377eba68ddaff9b455b02be492bda4f0fbaffd346c04f766d2a4fb45ef4ca085d95ce6a71c8efbe2fbbb2ca7fe80a92da3e66dbebeedb0cd446cbc4be96db641abe9bdecf43a7ddcbbd15bdfebdd581d7fb34e7718a1ee56e5f7ad1d029735ade8ef01a8bad6fce919be607ec7bbade65e3ef38a78d9ea8fb3a9e80bdb4ec56ef3db8ff833ac84233302e2076ef9ccecdf46a50f4e462a306c972f3abffcec398cf59f836db1b9d0fc379487f12b87e04d57f72bea09ea8721a6ce3afd76e42d3fccf7a553c80f7e0ef5c6d2d35db98c0b6baa5fe781b55bc69a5a00ffb19f3bddd0b3fd9f9948bbfaeea9c3f7cbeae0b2feed116bdaaaeabfae7dced8a5dafd6fea20459e2fca01b6d6a7adc6dcddd09d8cf97dbeafcdf11aa4ec0481741ef0c110abdaabffb24ddb91138bf9c3b8b505df7fa6a4e88370ea7eaf518f6761b308d7e2aaf07bf65efb93e3f5f9ab087fa3fc690e5f25eeebfdfac625bf98b62bb7b0ce41bfbf2cf7582985dd8fbadddfd7e7cab2af95acf7b14040a072b14f80eef55757ebadba7bc2394fbc9d56b7fdab023c53fed92bbb6ad6a3e3a6439f2c226d8db7bdc77ad25cbae5b5a5848ea94c6eefdf8fc754afe94d6aa4a4db8bc4f0f5f4b607ac13bdd3b6ab4ccc2e8aafda4dcf08a4eadf3ddeebf3dcfa730c1bc5e7a574dc5bcef11cea71d4b3bd13e6b1dc3e3a436dd92ab4d96c2d5ceb4e7e2d26ecbe6ccce10d9ed64e0eff4c6fb8a58164c1f3790cbfcfe6efd891fc4dcf99a4bf4d0c3b5ff2b75a5750a976cecedb5c53dec9d1195abec8af2fcee5dfc7deaa4c9eeb428744a0ff0dcee574bed94f54c17cd70debc25cf7cfe489fa82b4bc3eab2eedbab58e6b9aeb8dfa4c3ae5bce37a1bbccf3acfbc5b7a76f73d49867b3fd0f8be83afdefcafde18c4aacb82e31ccbcb484e48ea27b5e0fe2acf8ee717cfba05152ae6c1ab7cfb959cc41dc218ad930ac89d44a1fa15daa4ceacac4aaa556c9038ff8ddd8c56984bf4a42c45495fdfd0b8c3fe4f9d7c44235721adcecb611e8a7ffb2f1b3cebd4dea8275b12a58fd849a5b7dbd0affef79cfd2ce10e697a66bd5a788b16173a49fe88eddeefbf6825bcd0aa74fd2e968bfdbb2f7bd7e1bc5dff9d0f27debb66bdd4d446c1a29ba6fee8ed53ff37d7d6ee170b6fedd5c40d60ddb208b6ac7da7e2ba129b7fef0e72addd1722b8026126b20c47f27fdb0fa2e9a309a093f9dec1f97c9a642be7cbdfe0f4f7ca4b855b35915248f39abfc7d381fcfd7fbc816bdccafceb7faf06c1ef9bc8b39dffe9a72ffca79e48a8cdd4463ca5d8aaaf238c60bb46c18bcd01ea3fcd9f0dbc9f39011b6cce7cc9eccb735b5ea9eecfc95e51aaab675cfdbbdb0bfc4a9cb742a3311acbedfc3d7ba307ef5faeafdcfccc533ab638272fc8c7bd8d477697e38ebce0e3c2cb924effdd4f55deaab6efecb12f70af41f2cb9fb2ab4bbe0e6aaceed5bd9ade8bbdf2c155eb49a7dfa366c9bb6ef0eb1980b8bbe8d1afa4451aa176749fb94ddd1bfb9e27c9bdd35ce5abfd8bd7edbbf70c29d6abcbc4a1b37a964acbb6ed31f9ec5ba9a06dc2c3235ab04bbaa0aeeef9dfbecbef3ac69a4697c1d7c8cf6dd20a7fe8efeed6d2cdb0506c53f41a2f1ad0e20a92df8bcaddec3b0a2a8d0bbf5bdcf2d1daf6f35cdb072285ecbcdb9539fc2cac4cbf1dc8fd22d0fbf8e4d99cb04aa2496b8fb51bcda9db114bbd63842c08dfa8b83a8d01f73f7f1509ee38ce75b7a5c0a5cad8b70e45ac6ef03c916cbd183f6caf8a3802cdc54fefed71a6df146429f4dd6d1aa4fe0fea27bf222d583ca40ae329b8e45c64fd6fac3f385265af1c023320df581da243b72c1dd5e17392dcd6c84ddefcddcd3cc0db3d3cca19ab0cac330d7bbabacf4d4f1216aac30ed09e8d1eefd1bac23535c4b5a7abd56baf0edb1f6cbf6d4ffc9cbf24a6adcbfb3ad48ee3299a6fc74fbbeefc1832ed673dac4e73db3ed7bd83072f38fd432a037d506bdd9590e780b6aedf1e88f04bd9ee0446ace6fbbfcd4d01db2406ae8ee8adcb67ff6a7f4e405bbcba08b68caadc37ff2da23d4bc8fbfb7aefa1ffe1a95fdb5a8c1d6bdbeae116f15dcfb5a80cbf5b9be1a7304f85a3dd71bc55fcbad6e58a2a9dda599dee2ed2bbfaf6b20dddbaf3dd663b17cbd65decea492adb265bf860aef9a3f8e5ffb61e40ee56dfbb145fafb08bb7abdbe17ccde650cac6c2dcdd26a2b85bb4eef0ef0d9cc067e8e286beca4cdbf445636aa7d3aecd5afbb009d9aa3fd7e20aee9dad7dadbbb40ab74f83e09fb1df77efff8b93556dffedefa7a5ab281b8f1920532aaab25852ef6acdfae5e4fdb0e5ecb7bd7ccffbeecedd7fb5791c06da5aee3af2ec7b224e526ad1fa953d3929aa6e72d85ad0858eb69cbee3662e861c2efd6ef141adb3bf5b001bceb8ef3afb3c7eb31c3ea3fd9ba1d1fbbbedb8199e0ccae23aafec73afffe1f0532a6fc32bda497382d11dbaf5ce1b97b0c2ebecc8d5e0b80cdb7eed98003f09b4730fe6acda7ec3f9728b68f54e3045abed53dddf699d3df85ef526df5cfa392d6febd864e0a1fb4fec047be6e06127ade6e1dc6dba31099964e76b024dbf4ce6e1ab46c5582a82aca4fac4edc1beafefd8cde38cbfcf5f18045db436ad2710ddc0dd3d0da7f43d28cb69a00fb3fc7847d50db20ccb7d2cbdc2e55c1f46c95f7d31cfa7ac86bef61d3ec04edbeef23d0ed9fd497cd3aae3ea9b91923a5fafe1accf3c3c90839cecc4a9cceeecfd3dfcfd799e2e6cb3a085aa6ebe97fb99caa1aafea41dfcf0afe2faad927ac3adc1dce3d4fe05474ccbe9b6d6e7d29f682ecd15f4ac6960dabeed1f6fb372cdcfe022e87d9a30fb10d317ea0df9d3dfabcfb8ad2cf96c59735add2e6dba6fd30ce8ed692021d0eadddee5aa6c3a4ea9e3be0aa2cfabaa5917b41b60b77f53fd10739636baeddd00c4ca0087d7ab931abcfec432947e165991efff3fd672d8ed4cda9f39bf7cb64da775acfdc41f7b407fe3bfed48a06ff2cb53d0ddadbccae57cbd58fbf9e39bdc464fa710fd3befb9c5b4f5bacc6ac8f62acfe0c2c44180efdbdd171318fd719f21720b07d1aa3839cfcc8ae708a3f6cbfa409faf5d69eea9f4cc58586d88ae81b1edbff470a1bcb9b1aadcb1e04ef0bbf99fad2a5edcb3f96bf0bf6ddaf7ccba9c325d3fdfcb1e8ffae6be22fbbb76b3cdf60cdaec82663a6b4cb6aede7c44cb9cde77a80b5c3c7a78beb2b082e4c8f6c79a5a53f01c18a421aceddcade937a7ea2c74c9fd22ae04933fcec9bb1a0c69dac5df52deca86fca964ecf4db7da793c5f034c3ceff121101fc6ab146bfbb15ac7bd7d2cb188488d5dae7a0dabba1ef9d1181158dcccbbaa75d75f2d8dbd76c162da74a71b1decd9f4332ad9cdde5cfe56cb66d166a7fbfae91f3ccd1c5e067bee59217cc2f2784cb6fcd081abf95ea6ca95edffbebede6b3eef0cfdf64ef1fce60c1cf33c9c3526adc0a9c9e9d33b8bd8e7eaf4f757deeda0b8a21b6cfd14a2cba8ae6816afcc59da26de4eb45faaa642597fac3b2b4cc0bfcb1152fa8d2a5acb962f8d8e9f80eece4c5b68cd11bd9f88a11c8af6c05be48df0953feced98421c93eefc1ad6c4f6eff0da930ee099c1bc28349f7a4a7c4d2ae919e3434ba1dc5f23cdda4c6b2bffe7d4d35df91eb7bb198d4deae7a8efe2aa9c5af2afeba4eb2cfedee37bfcdfea4c3d29afc9091fa2b2357cedf4c22e2af3358aa595f19e3bbf6d797fa5a39db99dcbfedd549b3dd8f7f6dff7c000d231a33a4e0dd7d749c9581c5feceb0acbfaafe63ee15a90da4d7a5baca25007ad9eba0efa5f7ba77a72b488a8e88a9a2cb1c2fb62afa633f0d1ec9e2de7b0087422b7bbd0a8e15bd03f5f191afd7ef3de5568f7ae0cfec9e737cd4dde6bdbf02da5bf8bebb98327c6117275e0fa57dce2eb9afeed3cbf1388cefdbda4ee05ddadfbbbeda55f5ac70b0bcacebba030a21d08fc044c9a37f2ef1949a8fef8c3bf1bfd91d43db1c45bee6717d016dd0f6f6ebfeef1c9cacfbb7c7e1fac24df4eea0bbd5de66bb27cfd678b2b14578944a72fa2214fe7c2da24a21b8fc0d5ccfc76f0d5cadabaaacfc1e63ebeb1a2ea4edc7c3efbcafafd74deacfe75cdecc63f0d91b95aa3dabdde54436c511c2fdc1e78dcba0eee9f0d2bba9df37eeb2aa2eceefccf2caa00f429cdab4ba9089db62f2e8ab19abc56a0a2a9e8c1afad27b58681f2c9d35fe08d3b7f05e0252abc0fc695fba2985fe011e4caf8bcfdb4e2517cac3e3e2ef1bdc5bab24fbccb94dbcaed99e64b8bdbdfc1e8efd319b7a2deee7d45fa7a05ce692699ecacbb72df0ef812bbdb614a63fcff7e3bfdec221245b6dbfd26573e61a12d5e3470dadb7df53fabddfdeae1a0e99f568ecaaa9f3e4ff8b1ef7546c1cacc6a6baadcc6f6e8ea8acbaaebb0cbb1eaccf269b1adad1eedfe64ecfd82b86004da812ba9a2c0af99cbf1c30a82d4167782b1325ec1ebb30409ffbf0bdff4fa8edc18982d0d1d03116b4e18ec9da1da8aa6a6fcb8d2eb5ddbbc3a5bb7fcb87bedfa4c98dcfa0bba8adcc5cfbfcb1dba6bd48b0f99fbe8a2ca48f1c2a6cf182ab5c0efbf509e33f5062df2dcc7959ca7d0fd1eba6ce72f9dcdab97e69944a7c5b283ec94d4aa01fcbdfb25abd50bae75a7fbba7c52d2cadbce4ffb2db1cc33fa6dfb3e173abc9467f0c4ff35dd0dcb1e550410013e0bead1ffb4ddcac617f14cdbb1515e77dbf19df0bb2efaedce3f2b0f992ba2c4d1a3cd1fa15c0b6bcba3fd2afdcded76290dcd3ce86bbdf125d93b08dfe8caca45efaa3d28a20b8ac1bcee1caf0dabb1ceb3a4d62691b2bec138d7a64fbcf7dcf2c066b742ee95e726299d9ed8f0aeaaeded85bfebe36f984ac3fc32ce05505dfb062beaf7229fed6eb5ea927c53edf2f49be35f4dccb2d4d9cac3d190137ecfd4ef5d55cc7bf79f867c8ae0c4b42fbed52c7a7b2cede341c68cd4cbb6756b594cd9dc3981dfcef559ef0fcb6bbec2c7fadc7dd8a9a49cec17ccb8b0e3cc5f5873d483fc1478b22dff3f6b4c2ceed48da03f7729435af2fd11738a40adafebb7d9ef2e010ccf601a51c7edbbbcb6d50de2ad04ee5e7f6c2aa89bcde90a931c1acaf14df3e3a9aef551bb14b93c047200bd9be9bfaf53daffbba4faabe9bb2caae83a0c1b5bff7ff0ea6aaddfc9f6eefa0bff67d4d82958aead9f3a9decd71cd93ff7eb4f41cbd005d0b9b1423fe6dcbdba599ae42faeefdcdcdda60249f77f7ae92294dbbe7b15b9dbc0d7ffb0a588cc45a1f40f7b354c659aa0bd5a4de8bacdffca47f3bdc22e2d38211e3cfbbdc1b6abb466b7e4eb9ab6e6e6e842ebd07fdcec520d2a3912c27f855d2dd0edf6f0c68ad0f4f9baef2debff579d7bf3b6d1f2bed9674dc7e7bbbbd84cddefdac5f48d3dccbad1b1cb6b8b8bf0daf3b871d40e6ae98cadbff525fbb9ff8ee47dcfc5f3af8e1aaeb286e1b0080ab5e8bac2fd3b1cba15f8a1b0a5d5e2f5ccae5f11d5b1be17adec6f1a819792de1ef47bef7a63a3836580e7d74a3a0fd792f6c311bb9e51dd83e994e1e4b0c1b32d73b797e4be806fd20c5df71c42b9771fcdbc05d44c73fca04e41ebdef620e3b8fac67c87feecc61fcfbc4f3a83f4b2a0f313c2848c0ecc4b1875aa09cc2ceefbc7fff64025aa21e6b384fdeaf6beb2c1ca5c3bb6dd0dadaa96bd26fa559a4204ff1bb1e5ebbcb2db60bb8fbe28da5f44562533aab2efbeca3aef2dab6bd22c6fecb41dbb3ddc5894ffec65f55df08d06ffb9904de867b954ebbe9b9c6b26c690fd509a4a6acfffd0ecac9ff601f1d1ccbd1f517ff98e823bdded4df4a039ab6ea4cb6bc442bda4efcb94bd3d850c046ee69e9e3bff4fe5fb2bed62bbfb7e0fed8876fecfcdd1de165ef282bbfa83e7bd8dfb5abb65fea4ba19a2dafa035f16fdfdb203b9fb8cf5ff7f04a2dcdcb1b2200e7d9604d5cb3ff8af9244a4847fe7dceed89feb03bec9f0faf0fd2daf013235ff9cbffc2cfb3abb0bfcd97fbc9739b2ef10ce673cf03f1c17d986a8f20bfcffd95fcd5dde4f4bae1eb94cabeff0b11ec15a63d9e8b38e1235b9a5c86eba5c64fe86de7475eb8c1ae8ab2c90b86ef37e3fab1d8caf57da857cea9abd9fdaf2bf5ada00b46a6fabf8a15ab20facacd67ac6326c0d159015c1bf5cc2dbe84e7f6cade4fdfcba094c1ec4245b31f5dc1facde44fc76665dfb10b4b6af7ff77a1db3c06eeebdb2732a4266287c6bafd73e596aec9edecd65ebc3bfbade740fa44f095acb128faa8fffc1d9fbaacf5bafa8758f05edf065c1ca37fbe2e1cc9c5d35a2a5e2e5b76dc5ac9929d25463079fab27a7af26ec41a1abf3c4f387e4e8cbffaccd5bc70a8d3cd4acaac5d456cfce69b8af9ba3cd0e03105b0ee68eedeed2fbb5ea8f0e140a561da71914c11703fcd8e8c6cd2d0eec0eeacd6f8bbf7420e6cf3dbb6575ef3eda77e7f0cb1df8a1a74cb4cdbbecb7dc0bddcaf49b94f2f6bdc6cd32ba36db8f24cedca9becce7f22620ad38cabcf39a2454fd2eb60ed4fbaa849a7d958b4ec9bed3ba901181fd2ffe551258ed30ba785d6b31910b76a97f8a3afd894e1d2ed01c72a0155a18d497bb91ad75c0ca52ae2be4caec92bbe0c77d5179d34e2571c74a9ede5cb2d31ab472bf33617bcb8338fa701dbd03e6a416b61cab1a28de778fcab8988cae3ffdbb56f1a0d857aecbb4330d3cda8a73dae8dd0d7caffbe1d50ee271a20223ec154dccc10a59bdbbfcc3ddbb0d73d6079d8ad5ebafdbfef8fccaefdfcd500b0cd458c647a714df0cde0c5cab4f0e5c15ef54af3fe5c5ad4a9fc5a6515db262dcfbf5f2987ab18caecb4f68cfab6dbcfb5e434cadb77eebe4b1dce4d5bfd580114c43177e8a6a1a0c39dcf480abe5f7d9bf20aaa1a92207cbf050eddefa61aa2dfbdf7ca8d5fdec5aece5cde3db8fc4549e77579cdb88d259f4813c16be92a67adb4837ea6e0d60d68f3c6f05eefcf8b1b271b1b26c74e63d8153c8b00799cbfc1cace5adeb5b5de3cf5b204efbb185ad09f267041bdb31c6a0ac09efaeef3b05fe630debcd69feff7e5459cfcf13f9e3c5db11e68936acfafdbdd276d9dd4f8cfa14253e84226871cae3cb5c9e5bac39ffe886df7ad06e57f408e39ce75f138ca4ad4d1f6aeee4bbb142eadb9c3dff123bd2f6c5009c6d417fbf0dccead0bbd3fede2ddcc0fcdac25e15e6c7ad34f20e3ceda39c89ed21f54f2e2a8c85c34f0c1d39ef6535bff2c6dc7ab6eead9ef0fe8ad1decb108975b4bde045c2ed0927e15bae71e4468ea3b875fb5e79caebd063d851048eedfaa4aaa5ad9f7b8b1f80ab2dceca58d380b1c977ac7d6996abb97b70ae558fd9dfd1b70aeac5c0936ddca99b2a5aaaace65f31bdffeb2def275a1ef4ffedb0feb110de61b72b14de6d02cadfccdc8cdccfa89f1c3bfecc39b184217dcf1b653b6ada63f60bb1c022e57ce8ba8a3bfe364eee1ad8907648dbbc5ac26c33e97e8ffdc2cead9356f7aea1bfa3bca1bfd06ee656c0ca9fbd7bbac1f85f4e5e1d4b5ac2d22afb9cdc208a56c8cbc5a7acc07fc68ac9dc9c8202bfdf5abebbed6cdedb4b4a5c52c503ccbc0abe0a5d665bdaeef7c126e62daf5eebed8af7c674f4daf6d8ff0b2be9344df201cc1b3efd5a62c7c278c69a4b03a1be04abfecfb5decafe938ad5950644a302dc86aa10ffaa21befeb9ef929a9df103bab7c7deb0ddf1e4f9e0b0c5cdaacfdaf1f1caf32dad438cecb8bd6e29e7a18bd5ffffb6630ba98d5a5ee6eced51130c6cbebf3e91a9da4ccdb5eed871d0bddcab06fd5bdd4f53c8ea3f17cbe5d0dca4dfebd383084be4b2992eefbff25654fe98687da5faeda9decba9eeaebfaafd1d9a21fbf7d6aa4b1665ca494f8efea8f3a5d0fbf1d9511cef7e5d79e2a29042eaa196bd48705d341dfcb7aeeee864efa0f764d37d2af07034a1c686abc9ff0dc6f6486d63afe82ebeee1d994cdd13ea7629b7be4ecd31d59bdda7520e6a28fdf7a38038dd758aa6a2a67af09e93fcf6dceecfa4dd945cfd19c5ae46bca7d0fd11f19e853df40f42bda163b532b76eacc1585cf7bbe9f1fbd610e5b6fc8cd8a3e6aac62b23790ba6bc6cedecd16fbfabb8bda806fea0ee4aabfda16abe4eae1bc5eadeb4dbfdb4f12439acc5b39ffbc37efda9d4df6a937384d2ef10b0c5ba5cdb8f5ecb3ac054d7656fe30caf90bd4436726f3abee83008ff53c03b9bdfee6cd7ceeea0c0a5800dc251692e2e3a4173dacaaaabfdf04c9924c14f5ab3955faffaff4f2c6bffbbca7806ee3f85d3dc920f0e3bad0ca43f958909dfa9ffc6e9fded0bacfce384ccaa7ffc5c6bc2cf13bedff3cad1cbdfbffbbedbb8fcf7ee5ce488cd9970648cfe4eeeccf302507afd9ececd361bffb5ec8f5a8bc5bae78b0cb8d744a861aea23f48436efe799c02fe6ef668f9709def8ea3217cefdec61bf15709c4dca269a8dbaee4afd7b955db7b59bb4ca2daac85dbe3ce4d5fcf12aa610f8b80f3ccf1cca87cf55eebfc4f31cc4da6bc6859b06fdeea7a3a019c04f44d8d84ef32b48db55a501be4369fea6e8f67aba5dd1b12c211a3b2ec2cf33cecadc5ac6b98f7ab08d1db75e49926c48c36cea4aa838ff0bb4a08adad3bbe4faa5f87bc6bc57ce04130cabcbefb7797c15c7616c2e1ce0de802d23b09f2e5fd2ec83c4dd1bbac9144adde8cba7a1257270f1fe4795392bddaa5daa981f817dddf770faac61b5da06b4d9c4f158fd11abce0cfebc950d5bccfacb26c2cf3e14caeb4edfa9aa7f9d4fabecedc204d85bce23c7e08dd0d9c7aad935a8482b0d311b4dd71d7ebe4b4db3bd6cbae7d7baa43d0a6ecc0e489da3d92dfdffa45899b48db10cabfecafe0b6df8e00f2d06538da5b18e2ee511d1f229bbf7cea949ecce68094d8c1ebeee31af3c3b01bc3a96aeb53ffc690a46b1c851af09c8d4aac1ae59ad4907412bfe1f9f7aebf605f24f77d2a3e2ac71257bbbac61a5dda8e934e0b4cfdcb56532e39fed67ba3b3ebaef7db7566b5d60cc16f470ff8e50a3713e15abc1cef7ac80556e4fffa4c4bb6288b4f0d6ea1a5e9bfda44fe619a8908d6be97da8bad6beaaaceeb2a2c4dedbecf0fec48f06bb0ef36cbfcb42fea0cde92aabbcf41d27824eaf6a3ec5ded2efcb454be14d193fb70bdc98db7c1261b1aeaf97db2e124ebda15b3e4ecd7e650bf45e31264a41dc62bf4f2bdfefcbd9fbe7eb5c3b565feba8d916c13191deb4637597eba1b2e9f807d06dbb6af8ea17dbbfe4bc4b2ddfc90ca83a60d46e644ff536a38fde4d917cea2cf722febdbe35ef455f77ccd4e78ff7fec38bf1aef5f73ebaf8fd7aed6dce05a4d0dd3ff0a9dcdd98c99dbc3edc30b176b0aaaab65daa5e22cafdc5d31b6e856c7d1ff1ab0dd8cf29cffaae5b6e235ed4e1ce0989fa74bdabc5d040cbe6ce9a7b4bcf82a1fe3ef5aede6ae348a63055b60449a864755d8f37c69ddffecb32a4db6c2a0677450682e3bc8504b7fc71bca9dcc22d84ed9e9128d08803b926d90b55cec4ff94d1bbbca4edefd969cc3619abafad06ce5bdeefc1d11caa03bdae66a41b2fe1dbbaebae038d91f6e0d6972ccd6c463bfadc7ddd526bc3c88e5a9aacbca8bbdaa2ceab0ea9483b613d6e03167ff39cdcebdd9c77bdf7aa8e4709fdebfebb15c6cae72cbcd104651f06f3cdb7c9e8762a691d7ef1ea11d67e693dce3b7abb2af7d850ffaf38a28ff7a75b225cfd0d8572b08048fae17fe58e9cd4471f168356aa859cdeead3bd56c8d289b17143aeafae523fb4e5f3b2a9d88fa8ecc455b62f29f0dcaa4cab54d0a768b12e1e3d3af6dbae4c9aac61ad2673f7bae0f9ac4389e7f84b35d5bdec8acaeebb1ab9af1a87d62457d5ad298ebe77bdda8ecd19fe1db1eb05af438b0457bcf3a78a0ddc029782133a0ee812af251e7a2ea1f707bf262b9bacc66d48a50c4ffbf8abd54ec1ed9abce0b004bf22fb3eedc4ccadbac16caff8d767f4a9db163aa45122b200bad8d8205aff7d5f8928bda82eecfc2b85a52f28ece6ff5acaf6907a1eb7a1bbdcff3e78faaeced98a7dfff46a7f9e41ad39aecaad4d9aacbbcdc3bd8b42b83bd8ad466dace828b3caf0972ebdbf3ca7ba2dc3a4fddb08c6bf451c317b9db99cd4c4dcbaeaa95c6f23a62bbd16123aa5eaf9f6ce4c5b3df68f964df0dd71edcac30ac7fb66e4f3aa98bfc7cd27a1d012ecbfaeb29ece06f2f8d5bc462da5d28b9f8a3e6cdcfa7c278dba56d189c6ffde85166e2caef5595c7b6293bfae7d3ab4d94bf3acb792307b4ae3860f1a75cfcebdeaeef8bcdee27c2abe5ab15c227c6ada15eda16b70ddec6433de467fd4beccb198b9cdcb04fa058720c402fafabfcac0cdf48cf4e5af064d1ab1c64c8c03a7bf78540cdfa82bdce948ff8cbac79e6edde3dafdaffdddf57de6fd01efffc7fb5c5ac066bd0e94d4dadffcbb2e8bcc7c1bc69de4d1d2766bdde4433ed7021385eab7ccb8656ce3a90f77de98d2d8db5cbc6a4650e3ba905a756be53a5e7abfa7fcf5987a976d5ebfdec3ffb42c031e346affcb7cd6ddd3eee9009d397002f4aadc4eb4167cf4ed4f7f25cfcd22c28bf0a32ccef39e71d09ec029419c4fd2b7e51e35cfcdabb9b5fda7fb344c288c27e377a8d9afb3d6e154bf9b2b2028ae2163edecba26d05b06a9c90c4b51f3ba5d9688c8194de2b70edfcbf0f7e53ca4b7bfb9d2d0e629f06a2fc71f9edcee5f7bbd8d0b415b4a32ae4f272cabaec470c8ac2a1afaf825338ac1cbe67ae2354dbdaecd4cb0d6e7d296aafc8ec7e09f27dcea01f4ffe1ead77ffcb4d630a11c10fe8b91e9f027daadc19bb2b4b860ff28c0cebded0ce86f1d60a513b58efbcb9e5ad7fee49bba98ed19cd960477fb3930e6dde8ecc04c68dbefe4ef8ead95f4ffd1acfefd1df174bd7518876e1a0a57e7eded9a4b3abbfafc9db5b695afda73b228bc21047a70e4a63b9bfb8f6bfc1a6ed9da25d94d0d5ff5d3f8765bc89cdec7e16a34e34ce1eb10a6ff429296bddf68adbd4bc52aaa61cdbcbdf1c44c9cd33a03caabcdb13568733e023fad3038c8b0b77f70abc7ebb80fdcec9dc8acac22b166c5011e987a80feae3a690b6dcb3402a56c06d0bb5a6abbbaba6df7beb579cde1e30aeeda5f04ada97f365f48cc249bdfdab05bebdbadb44ee09ccdedacab45b345b8fb89cacfdbdc92bfe3381edeeef8e9f7d7cc6125690acbcedb7dbedc414acada12dc646fa78fa77bbd6fbedf08a0e2bddcba9f5fae93eab1ec69c8e5f0ddbfedde5bf4392aa6e6f58a724caa6add8fce3f94483b0ebccce1b3e268b50b3e6da3ed12cf75eabe7af1cbbe5571daa5ffbc99b8f5aadbc7ddcca11bf5c5a4f0aa36c0a4085458a36c392edecde61477afcef98fbabdb0bf6050dac2fcfc3d414bc198bb8bf24bff7bbb7abc3f2fcdffc03da0f8356eca2f8178862f0ca4de83d9a350fca648894e2c7ccc352bd73b39eb9abe655ca7ffbf2defacdf008af328f9b75bb784ac8670af559ea2afb23dbfc462ec40f4f3469970bf1aa393cdad6348afc97ac92ca5d5dbfd1978cbb775977d2bacc48b1d0a834cfe35dadd4eac11c4490bbca9e4cf6e1eafcfcaf3cbad8a20eca3b0796bf3a9b2bbc47abcb2a404842be4aa76cc4abfec8a47a0aefffc44e9cacb8974469ddafee0d1b9b1b6bbedf587bf1e26da1d2c684c4bfff584e4282ae4424ddc141dd43dddb299a6a0ed8ef2f78fa7ab68af3e5ce99bb4aa9bfe18a901dadbdc6def93e51afa6f953f94ff121beddca6826fe8f20cc66147acec01dc75fcea0fd3efcc7eab03339cae22e1674ad6277acdf5b7a30e3fc5ca1a30c6ee5caaecea6c6ffce4cf2a92dd3f68dc51f6bb42c43b2f6ada70e27220eb4a6ebaea4ee9cd71bdb0be0bc9cefbe20bedc9b0f184b9eac8b56b0503bc22122a1c8f0d3af0b37cce0d24afce3ebcf3b983a56bfb12b1fbda5dae62188ff2cb7cd73d60a8e2bb1cbfbdbaaf8acb32a8ae23bddf5b062aa3fe79e13ebdbc1aebffcf3b1dad4a92304fd1c2dab614fd82b1febeeedebc202068b0fa1df850e5e5f9ac6bff24ed22daa90b6c44f2a3ad94e07ff35bfd9be25142ab6ad96b1b5e5efaaff58ffc1d34debef8cafcde6fdf9ee8cd2f4cec3af1d767d18eadecffd71f2ccbf169c49c1edfca8fe3faad1a67f0242ed5da471b97aee81ec5f5d6ef23ccd2ab3d5b85df0acfcc9edd9808bc5f8ac5c1ee4af6ebbc40f1ecad24d8c86aa54a14a54df7ee1aff2e66be66658aab9fcf2f1cc2b2c6c826df4ba6996ebddef910da513acbb46af6cb7aaebea6fa968cbfaf682c5204f80bce1f4cfea8d1edc24ebd1e1c1588a5e95e7fededdecbd3bad96ceb8b04ace74465d16b6ca0fcfed5e34d0ac70a394d1b379df40d787cc9dc439cac3ffab3f15c2f0bc1ba76b5d8a1fbedb07e5bf5accea409687abd7da060cd8bdbc3fffcdf027c9e544d16bfaaa9b72cc540c7dd3f5e06fc7dcacecebf79fed4f98d84af5c5fe22af4904f89cb01ad0bcafe4ac5a4bdb0843712ddeedda17bcace4407adfb4c5d1a26e65aa6a52c99f22c129c29669d25bff30c89edc1c9fe5bfe9ef8d7b75bb832bebd21344f25d8d3d28489b6fbe673eecf4e5fdcbd928dae29aead1c61ff642ab3c77737fdf4eee520b5ca0c99abebe1fd6068aa31667db3dca3e1da1cd63be50c6c6de5fdd9cd8f02ce58b48535d685b79f7fbf1e056cebd5a9ff8c7d39f2eda6fe7bbad5da21feff4dffd91ac573bead5d0ccb4dc8dab9ad37ecfa7cabcae6e9cd3bf8db65aabfa69358dde5a546bae25bb8ae80acace29f3bd209e60bb2bab407da849a14d6d7ed605f7c5a9f4dbcfd6edff1dcf8d5faafed0c5b6a3ade0bdb6d8dceab1bfdc3225ce045190eda0f01dcbf3c8eb4b33e42f01ee5cbca74fa07dc502c8fc23bcd25f35f4f0fb829907b3e90aaddfdeda3cfbb78cde2dc5a679edd60f0f4ed699ccacee226aab7aba8aabd94d65ea204c4a02d27cfce50ac9d4b054ef848b566a7a112b8ebdc947afba97f8962e6bab20ef02e7adcafdaaedab8ccbb2cb04de0acf888d1f0d9b7c51e03df0138d48d3eb53fb0816fa2dd75babc15202a30c6abab8bd212faafcac0e57d0c3ec8e7f6f97ec9e5f0bdf5c80b68aca327a1eb8f863965e2ddfe4f08a0f3be9fd58c72afcb6dd0b0c2e88b6a3d4353bed988783c9ad1f7dfa5cef1ecfeab87bb3b54c6385c2afacba7deed6ee11aa8df03f1bba0e5b46e9bfbbeabdac10233cc0a6acae9be1fd1ea6c19dde32e9f4b546aaec4763e7c3a5bf0689f09c5d8cf8c5375afdbd8f5e8eb90aaec1af812f1a13e4a9af0c6decfe7869465ceeebbb852c0ddace73d5fc00be92f01019f2cede12faeca1c9d8c6b310afad5e26ccb00a903f4f0573e8f0f43aacbfa793e01ce2fe1ddba7bbdc922431efcfdfddcca0ff9bff035c61ac8d8ef1914e9c15b2b1b1aebb3edbe6f5cb44349d65d65c03f0ab8abac6bff8c76f5a2fd9df3fbccd9ad31af2dcadd3ccc0a5d9e0efcebcaaf4bce0e9bd882826aa84088d3cebaef4dee0b0e6bcec60cb8cc8447d1fe7de81cc48c9d7a0d451ffd0cf2e0ac1a1f4ea631231fa4f6ed4baf37ac3848beaaf8ab53b45ddcc95b45c5ffdc3223cd8d9c7583fec8ebdd3586606a744bdbe25a537d1edd1faa58af91d39da9fefcced7c9bb8aa09cc1aad9e991fcd3fee8752e96d1ee5ba79c6c8458fa2d4faafbe7058dafe8fa3c4dbade4fecb6b1e03d76ef2abaca5da906f305ddce740ac152eeed95fb974c9cf57c2e489c9ac0ccc2e1d4f91da1bbc2e756f6f24eddcad7de2c998bcc4bfa0d5e02d0dbba33c152e2cbbf1cfd8aebfdbaa9eba29ea6776debecedce7b72bebfbaf2b8ddd64f07f7c28f79a6bb1fc6b8fdf44d5c4b51689dcb80f209741adeadb7e8c1626c3ef3d2d6ff0e1cb5ab80bb49947ce3abdabbb12cdd9eac9c0baea2bc281827ff9f6c8698cf47c61e1c07c373c3e1a766c679fccfe149b1b8e92befecd5ccf7f027ee9f25ac8b78bbb58a7c9545aabb68415a97a7154e9b4e1cdeebf1a30eaca39c703c913ba0e1dbdfef1646b3ec33baa40c9d0ddb0816b2c9c5dd9fb6f7a5d59eca7bddcc81283765bce6bc2a4f30a5abfdaeda0cd48f1736be5fb27e230bca7b9e92d00dc9ee2a7059b4eefcbfef29b4eacd03e976fce5e9fadb9d051cebbf7f941d8b640424a25afe369dc00f94bed4fa452feb1e5cea39cc3a57fac6badd8fa6c38feeb3fdbea187bcaaf0b5a1fb4b8e457fd6332802aa6dcc5dacfdefe47ec8b6e07a62dedcdf11db4eecaffc074eddcb56ef83eddd96217f6bebb8fef18bbef1ef7558e8bc3d215d9f22d854e5fe7f155f73db54a05f3e520efdaef5bed0aecb62aeca77bad1da97daecc852a049e2e9fe36fed729db7bfbffad5b91991aff1ed0c38c254ae1dfcae8fd58d3dab7eb50aee77539a231a7da89ddc2ec5ac18b2fd30db19fac28e1ebacba08ed6604b8caa47f71a9aefcdd9b4e107085ed76e0eb6c1c811dc203419b95d958be0f3be01cfa28aae4f5b1fbee7226b3502f3aeb6f575ab28a23bfdd53aba4dde47daafce1bcd5fc64fc71fe454779f809574bddd0cf20ea41af4ddf16b26cbf069465f7adf554d54c0489cf039b620953d78064cbaec8a41b7eadb1cbbd8fdff3e7da4c0a00ec5a470adec8b08793e9cfcb5f7eacb3e0a7ae8f7ec87adca242ff001fad0ffde9a9ece202eed62695d8a53af6ffa06e26b5b261658c49f3f9a1293eef40e10b7fffa68e4c6cc9b1cbd8e0fce8c2dae166d1bb12bcea9cc63f72e0bed0764efacaaafe4e1fc8feafc6e9d2faafe1f2f07dfeb8ab6fbe941e9f6acc1bde4cf11b5ca7fbbccb9ddff1dd92c347dcb914796b3ecaa24be9fa5bed7ee69516b8f9baea9f8e4573dbbf8e591ddb5bb18d63bd2f1ebefbda5dd778cb305ffb72e6b2a9ee7ebc0dc37f9d1caf6ec70d8d0bf05e82f82cb81a0ec0fab0fa92605373aac837cbb29f8f24bc3d94901ab7ded8bddb64f3ac7cedca7615dddcadcba645acfec371daef69201fbbebacbd30f3f298fc853edfcb24c86bc90425a36fdce4b5cab6ca4819daf0ef9decb0e18f0e4cbc52e9ef452583be8af61a09b3dfcd3a5f7d8cdadb2839de93f8f0c47feecad7da385fdab1f8f1f9c1cebe2f857ebaab354960bad4ffbda8dd24c5be72c5f8ba4dcc4b7a46d11ea3214f3b1a7ae66fcdfd2a21edeba9d66c4bbf76e2eadb8ee86deabdd4bc7eaddefea2862cfbe1bcda48058aeea6b10bdfbb5fa4aaeb5fafe935fc7dfa5676ae3e67bacb6a9b0d617686e98c2aff3cbc1963b316be68cbfd7afa6b2cac3488ad4e882bca6f67ca6e899cf324fbba45a78753bc58cd37efeeefe85db2ffc512ec8b1adba67c6b1f6dcac40a8fa1bc166a2ca2045e81e507da9f7be29ddad96d2f9f2dfc08e5f5ba4e06f7f579b7adc86f7750b20bf3c85fc4f2ab8721ef2521e0aa6cdbc7f504cdada5ca9bca03cb8d12acae474ae4c8c9cbea8eeee65ced81ff6a8de7ef8968dbacc108d9ef4d00bc174e1cfeb49edc8dff022bebace3dd70f1b92bfd6dbf5b3c3e759f289911090deb1cb51ccbc991ae42b0dfe528edfd5b12aaeaff4237d9cec8f15137a3f85dee0200a68c052dff96ddbaa4b662cf194c16fb35debdaaa115cb7ddd6b37cf33ef7ee8b93369ae183455daad9aa1d90d5dcf111cd175086d0bc9aef2a7feecdeb6607ac985cb2ae2dfeca9bbf85b35b044eb1ffbeec3f1ce193ed1fdc4d4ad6f0da1f9ae33c4ecedeabeb9c4f9f3e810c6bafa513c654ffacc4bad10bab9acf79d5ef43efba99ce5cfae68dddf0695c4acaad76d7be51bbb1dbb71fca50ecb049febef848efee4d04ea99c3bfebe91a5162ec3c6abbfc05d91b844b8d68ca527a0f11eb53ab3aea4b1affffafebfa23ffbd8ee04a5fea3cb0ab5bd39b45b0f9f0d1ccaddeca0ffb1618aea12485520fdbf01a6dcefaf1deddbfd31b3fd03a0d9bc02abbdbffcb1eddcd64fe8d5ad05d5a4effc9213b754afc7a5bca7382a53c5425eaeb5eec581c2e9ec92afea02105fac2404eb233de142bbb1d0aaaef6ad5c6893ee3acb7c33d2ebb1fffd504aee020f876f8822aaeffa2b6f6dd95babdbd2f5de1acf9b5e9efa1ceb782206e0bd24dd2ddc4d6637cf4129da46efe25f3e33277aab1bfc1eca13accee4abb478d8aa3cdd337e78cccd7fedcaa9dfab9ea35f2ab29a8122b7e9b9afcf7faeddeaec79dc860606fdc64c82709c35fb15cac88ad4bbefd971b6ffbd9ebfcd1cc7a4193ea6e68fe88f34601839b8abd08a64aeedeba32be321ac72c1ebccec8d8ccdfe46bacf6bb7ba05ea5d7d3b857efaa17ecf075f2721629d42e56d9d7e7a3cd2bea68f4ad022eebdc57e2cdd797e476d35546eed6ab2ffecaf80c65dbfadacb250caac5bb3b5dc5794c08fe7b65f5a6e822b1a8f7cb1214bbf900de29e25fceadbdbadc1aabd198da0d2dd4a94bdca4ecfa4875cebac62d9ebd3cf84da4dc3436dbd8426903cda63cffca5f5d9ca99fa9938db7a156c2ffbe82a7c918eb65dfc0241e7328cdc75f12fd5a6d10fa3ec77a83ccebaaff755b7cc8b03bb1dd7634d6e6c037c46a696a3bfcfc356e69ad5e5fed71fd02ce310fa9ed5a67e51df9f96cce4b8a3fbcdf2fbe9d4537633b43cedb58cdeacb3d45ac9a78f6cb90a9ec34cfc96b22ccca56a98a9d1aa1ace29c54fdf3eb05d4cdb90d5cffcaeb4d8b0ed0fe09f6786cf5f2d44dcca10febfcdb8c9f2fb03c058f4dd6f9a9ced931b98aaabd1a7abd889ac0adbcf08f0f310d57c3a4a18caaba6bb27f120ce2f01e57aaab3a7b7fdefeea4345af5c6cacebf07112a3557004dbccbe4bef9fbfdfad69fa993bfdbbbd8e4eee35baac56dbbb1ad04326cfedbcfed3badeabf8ccab2883f2a9cde0ebed7befc737bf48b8bcd84bed1b7fd0cdca8bd55fc2ec3a4cabcedd8a25cd5dd5ccdfab3bd664caa3e1ea6eebad9e3c8bca33293eabc78dbe109c99e29e6cbaf5d08e8e4a6108dca58fdf42da6e25bcdf0bafd9b3a76baf8be35dadf5ee3fee040cfdf2bc6ebf0ebd92d075ff9fddf3a8fca9b4b9eaa3baed2d3f93581fc5ecdff6ddbcdfd8ba27bb0d3cdfe263c3cabbcdec08e57cc6bca02a9c400bd0de7bf66d13dbee829aed0f5abe2cb60f459cb44b786fef739d074ec7f37bbf4ecf710388ea669eeee64fa8bcf1dcfbedac4baf6c2dc378f6e78f2eb82ec5abc1b87069666abc3d7b87f4bde2bdd1edfe7eabaae27cd34ed1aa77bb44b17053eac0617adbea9ecb2f252eb6ce83ba4cddfcaf5fefc9bdacf2d43b7dbd28b8c737ddb09f6bb99a3a0f1fe6b1baae1547c108040bdfaece48891c6ace9ecc60bfdeffea2dfbef4ef093dd9fe18f31cb6dbac3ffeebfb8bafa243ad2aa391cc3ea88cf11fca6e1cde97acb9dadfefbce53af0f91cfe5ba48ebdcdbb5a11a0fded6409f546afdfb638e3f5ffce7cdc3cecd9dcf505d5a3bafacb9fdcaab58eb6e577b48a1a3f75bddeb1abfebd5bd1ab7cdae8ac18eab824f9ffae9abe8cbfacdb6deac1c02e93defd5a625bdbfcede7efce4a8cf13bcdaeecafae7c74db0e2ac5d85d3b28fbb5bfd5bcdf6ad2dd1deaa429beccf5ff6ab5dce89a92dbbc5221aaa193b5dbcd4adaa1db1fffaef747ffcdf9cbccff7a7e20b3f3ceec08d2ae004f7402b6dcc5bf10d1dec0685de84cfb9ffbedbfdd2ed437092e460ade9bfbadbfdaa9d6413ada2d8cfbaac5d8496e9f3f00a0deac9448dfdcefb29e9e5c28a69d334ea0e8cc57ddea7cbc7c45497d59ebaae627e451d9faaf35251ca5e86afc61274c9d6bf4ebe3bfdcfecbec780c3f20a29b1bcebde5b35cbfeafb0ebcabf6865bb1fbd99cfd6683addcb4e885a3a7e08d9ecdb696ef0b90785e519ffb652fa75bfb8dbe5bbc4eca010cf2cfc98330cef9dcd56deaec3afe1bb8ace3018eb10b8fcc8ea7b2eca096183acff41dccbf1cdac4d64fae3ed0edfc20277ea97ff144a3f809ecec2e699f7ffbe5da54aac0ea39d3ea7102dbf226ac806d07a7cffc602dd5dca7a88e8eec18dcdacae10c3b3ef5c325be136923dd7fc62ccfdee0ef380a9be4d89dcdbdcdcec560febac1501f377abf5f3ddc57aaca2faaffa37c490bbd5339a9fb3a1d5a145bf40fc97ed8cae35da31bb121b8dfbcf4bde06c817c8df949af1e35ceed4c1b7248d4d25dfb75b4bcccfda6aa9ffe57cd985ea02fb0338de9a43daee2d028bc1b7f4b2cfc32266f1bef19b0c03f53fc62e2c58db9998ee7be0bde4ad5f8bac0eaa7a3bfc2edb79cfde1bcfc85aaea9bbc3ec0dda6398eefe5b6e1a440c94e3b8ae4ea3f4a16f29cdefdecf49ab9ac58f87d811b3dd6dbeff7d328bcded2a1cabcedfc3ae7d073501f6c877e2b6822efe46b1ea3b69fcfa29971ad938cfc34bd4dfdb3be3a7a7f7d54314dd2d13c87c4dcffc3be79ddedeae27544cdda357ab8cbdfec318abcdb84e3c82f6972f3f2e07df51ed8e969ed9dafa3230c8caef0f4438e19c3eb2d83bea9988dab37d19adad78cb31de21eb4a2a3fe7fef1d72409f4d2b0dbb2603b0279aabd7bff22206ea8b3178f4ffd25f2c2e1d11df9edeaec10bd4b8d178b0bcbc8cadb75f75e86bb3fe4dacbba0f40db5031750e5f6e2be91ee32dfbeaa11be7ca775d521ea1d7a2fc76f44ad0a038fd8db01463ee3aa6dab3456a1edbdc3bc241b1fa0ba537aa3ebfaea319ab97f269ddafff120dde3d91343ddefdc9dd1b5ff324cf9218d3627e741d165678afed7fd24cf1966b119b91c75adea6db2a3a106425ef7d6ed715964fa909dc2a4348b31e1db6f39d83c5f2db6eecc8ee4f1be24a8e7edafef6ee05a45d4a2a8f72f3858d5aeed865ccc2d82e4bff9deb9fd94ca212a3cd8e0afa7e2affa9806e325c24fe8fa2d80ba4e2cfb5f1b032fddcee7f3e14fcf2ddd6d666abeaaac488faab5d75e09dcfee436eecce2dc29fe1ed2577a5cdb3ab7c2bf34cca3b6bab8e6436f55ecd0c91d9958cc5d7aa06fdea3faee78af3edfed3acf1edf2f4edfbdb65bba4eae8c26fbbbb273f1cd2681b5d84eadf683c9e0bae26bd7ef3be3c1909bb49afeaff1265d5d1674f8fdb0d2d04ccf4657bbed3770fefc302ddaa46ec7e52ccef7ad9a8eb2e6fbf0b1d7f1ccdf3a7bfdfafdee8b8a67625bbee09aedb7719427af364502b7df114759b1d4c838f5f72fc76ec7bbabd06d49eecbf22f79732eeebb1b607068baa40fcf6bfb8e2225c9da6bb62dfd2a7f1f2bbbe48dbc357e6b2aedac8ae499bdee2eb4fdba528d59beff79ffbf67dafdb86ccc161c3fb0fddd9455da73e8b5aadfe0c9a3e2c29fcba27ddb1fa7a50ca84573b38e78daac2c42fbbfd2f1cfa98e9e130cfda262e0ab55703dbceaadcfc62ad29d95accecc0ad50dfee8ec449cbd8ebfbe0777977cfb35d3f3d38dffd53ff6d483f951bc5fb98bd46f57079f32bf8a1fff124f335a79d6d31feff9ce9fceecddf0ab1a8ba9339a5b5eee8c8eba416d3ceba25a2cbf577cdfbd8122a976cbdb4467f575d6dfcdabf50598db028909fcac21d7ccfcbf7fd4cb3e304beb2260ebcbb2fccaeab65b9d592cf4d1786a84db39887cbda0b5f14e17576124a696b9cc32f3786cbd90cf4ab4ec3ea5cfa78b5bbde7c53feeb8efcbc09bd5a4fe8bb8b4b4f6a77dd0ecde2354d9cee7bdfca0bcee282dbc25f5931cf5effcafb38862f8ded3ddedac0a71fdea23e50ff1f72ef273d80dff32afcfffa6f773dfade7ab1ccc828d6edfeccda0cda2af2ecd7f9b0d8fb5c81bfdf55aeae615bf6fe131f289d03a8fbcc891e348c3001dd69038804403ead326b3c335b7d3bfe6cf63efefd760c37caac5b2f1821cbfecdc97aa0e44b93ca9eff9ff38ab6fcf6f4fd1caf5188ad1ac2ae26d3b0cffa2cba0e6edccfef02eeedeea6e8ceaf2d8c1eebdaecfbec854fa42aead150fdd39d5de2c8b57d3ef51dfa5e1fecc5eaf2ccaf2effb32a17fad3c6b42d58c6cc6b33ddbcbdeda18bec057de5f9c88bd111de9ca2e78a5faddcc3a00dd4aa8d8bda6ffd72fa687edff606fe6d037fdbf6aeb355af2cfbdd0bedeac196f8bcc40b1ed3fd3c87f6a209b70bfbbbc3b5a7c13fcb502ada4b02cddb7dc9eebae2aa0ff94f8d7a7866bb43c4bcc7ddcbfffc4640654326fab4cd0ba0457cd3ecb74c07bc3ffd0dee632c3daeeafcac93c0d5edbe9c0a56fa68a677e5aaedc3ba5e2bbfdd06f7e03498c1fd3461cea9c9df0bc300ec6cd8ae1ff6c2cbfe0f8290e1739b8babbb91032fe7aab20c9ca431124592f357efc7a892605caf7af9f5ea39939fdb83f8cd42a8debbffb0fc3c5dbd72e9cf40720ba175db1eb68da563cb0aebedefecda1be6b0eb0affafd26b6fdd87aaf5a1e0ea4dcba2319cabab596ff9dde5da1a9e8dd04fbaeaddacbbfb62fffc991abee21a3c1facbe9f561f22aa1ffedb8a1eb672eccde22244eafef6ff1d8efcb50ec1c28635cbefaded98cf2c260817b6bcd2bdccf783a5d694a83303fda05fbced36033418c06ab9d9e20f179cd1d2b0fe4cc6cfaf04ced9e712c28d7ce6fd19f2b4a05bd3c216bfe6feda5fadfdddb5afac7de84dde9ccb474f18a1dd1f9a34bcab4ae1b9f6d3967d4fabc2f5a7adfceea5692bc2c8eaa6beaf6f127da5aa0ace539a5ff591cd7fdf543fb32fd976789ff7b9dcadccf4df77d9a5dcbd56bd7663e77afa8b4fd5eb9054f3f1dd710914a6a6de0d499cca39e4df1b157caa79b1f7b13d07618cde9adfd089fb4b1b304139b7c89d2f5674f0eb5ae9c6ecf32740af602f5c5ddca550baf7eb1f86a2b5bdde47cb9ca2a12e809f7034e3ad6c7fcc9742efc1eba7b9ba69d93f3f0d98b7fbfed64fbb0f3c7cc94348b090bacd7fe75c7b4f9d6a83bc40cc5e83e12fc2c33bf7dcce1731933d25bedcdd6f311c7f99dafa5ebf250cf24528b3e5b26ea07f7dd7fe5f9ee2efbd3abf55b9826179588feee6efdf6bacb9d69f8c39eda97f0d9ee28ad1ef1fe89cdeffecad2cea5c2604ac936f0ba04d1df0ffeb8fbc9b42627ec459cc1ea35eba8bdb299ae1aa29aec23f3fbdbe86affabc3de7cfaefff0bedff5a0e9ec4f08f288bf9d575bae1d2fef7332bbd5aaabc7af61b81b6a70a87fea1a430825feddb5f75d23ead515b53020dd2d3ffea9c12ad1a8667ebb8e1caa6fda8f6da2cc0af3261f86bd8defecd0f9dbf5e0cb3dab91d4d59fede9f612cfbdfe396e033ffa6dafb9ecda8de3de319ea0edb60dcb14fcded6eefbe2e0dbe41ad7ecedfc5cdc6afc7b7b0f1de3cd680bbec3c9f400db186ae5239ea2c5488eadf78b3a99ada5b857fc01946afab4ccae0e7db65a58183df5becd98a9b70ecbb709d4d2f4ac2e9899a8b71bbd34379abd126faee09fa428ab2bebebbbd4a3aafbcfd6b1bb0b05ec1a43cbddfb1d3b992369aa555a89a47e072a274ab53f02cf94a3da83daa81fc9e3bbf8fd9c0ab5bfa39a1ee72f87bd4396b6b12475a0ef8a68f5bea4b31efaac9c8fe3b1b49d78cfa39ced7dceecddbf8eea51ef8b2602aedeb02ad5597108b712c638d5e2d1ccbe3a6410b4983e52fb940abe4d3f3dfaa0adcfcdce252e3165bdadc071efea5b22ff5f1e51b0f8cb58065ef4ba7a1cdc6c2f033bd3538cab0e750fefa2b5a7127cbff6d58fd4839c43af579b5c82c114acaa5fad9dcf46ee3dbbfdb85410f1eee187652638ef733fbc5873751fcdad20240f23cc6a0bf5130f0cff5cbfd0c80fa2a5fc306fd0eeeb7afec8c8c6aedf806b01fe0a65a49960e5d5eb13fca1eebddddf3756e0d684fcde612c233aecca278b53f76a8b8e747a9cdd31f0adbf1d5fbe2a938e7aaff6cabacdd5aaa7f1ffaa6cbcbed4cdb37fbfa2d5bb9d6c150181e22ed40efe1c53c02b1aa9cfe3b68f4b353dc5caa5cfb9d5ebeff1e62b3ca8ba3b43bf0baa81fcda8cb06cf3be04cab9e2fccbefe5fa4f09be1bbcdf0dabe4af455c9bc9ded5370fc8a44fde8ec96ccf5ac3e0c20d2b9d69ed12b87e7eccd9e08f25f304cee5bbcd41b9beacc3ffbe3ec989d9faaa0a11ddfab47edd8e85e91b52bad037969ce1ae6bb4f28c4bf511751af591dbb317112ce691fdc2be1fceaa8481f6adc4fb43e68bebb0d4a93b77ef6a07d3edee5b20e56aa4abcfdcfdff31ef23f2a7160e00ffa3d8f8fdb7acd6dae3ddbaedf76c2d808eeee467e26e3f04b2a553deffcaf8a7fbd746925be42fe146a56063bf1feb33cdc28bbb0ddae9e8a2bead0f27b83efe8dc1aaa5f6aaafb6e6cf57dcb0c3f2ee49d4ccfc66b90b702ffccefa509bb62faca7bda316fc7aef9c9d86befadab0571bd6ccce31d0f93f7deab8bcc716b6c6bcb1b4dec6e92ed49cd9caa259ad62aaac6cbdaaedbba55b42ac90ad3c213fe0c59ff3d16ffb0fedea3f910a45f69a1c3dfa5ef63e8c3af12dfe5a9e211fa92d9ad9cd1fb580ab50d1afea6c2c3d3cff5ecccbce63d3bad3ac18ae50b0f166230bfc5a582aaf34adbfd05a9bc63aad7dec2e2dbe3337c96ca3d207de0aceaddcf304fffce4c7beda69d9ca7a19ceaffaccf3525aaab7f3a1bb3e6e62777e9cc67ffa4da4e1e52d5e89e4564fe4fc37dde6cbf1ca98cfbad509ef1df062f9ecec0ba27bbeedc6c947fe844049a3e8e97bb2166adab6118be875b3bbbe75cdd4a7f57828c6e0b35270f257e3fea36d65e51a45431c8995e15b78b35f7b1bb6faffdf6bebfbfecd3db007ede82d83fe6b81e73de58d93b6ac4a4a7bbb9d240fb80ffdbc9ec061eaabccf361fc5d3f322c8a5ccb6acc2c0c8bec5a2c5c341fca94bc0c5eecdc0b08707766bda0d0ce2fa10b0b31a9aecfbeb1be9c5192fdd5ecf683b1f69cdfb5fdf6c2725135deda035c9a8bec755af712c5dcbfc40deeb24f8324c06b2e7fdfc74127c3a4ade9666bbb115a05fad0516deb93bb9dfbe8828703cfe3f5b40fefe9d5514b06529ee306edd67edb32d0bcef9b027aac9dfdca24f1ffa62beb1d6ea3f77d264dfbdebfd82fcd92a9389d7dac3dbacfe3becdfd2a784f4390c4a65c8a6138485bff692c001dfcd1c6f87309fd9fa4bcae9eecab2692731df4e86a46263295ff174385ba9c1d6711bfcee99fcebb9c1cf5bcab1ee5f2345e6cbcefde444c8e0066e6fdd4e2e26aa5bb0dcec4ecbdacf4ee920ed19dee6ec62cfafd88ce278d12f9dc4fe42cca5dde597eea4cadeea986efecb2fd0fbb438e9f6c1aff99f41aa46937bada8a42da9ac31abb5edbdfabc3514defebf88dac9e22a2a5bd031fb3014b8c07be21b0bee5cfefdaf6acdf4df0c8d42fc0a3a0c9fdf67cda93cd5a6f181d724da2ef31726abbd7eb2de463905f3eab2ba995a1b55fd09da580f09cfd9a4bfbb45d742dd1da36c2dbef00af73c5beccfc6cdcf1d0afef03cfe3ee3daf0e7433b5ee5abbfab3570fce94c7921cc75dbab70d3a213f8bfa10c7af3bce8ef5aefb3adeddec4bde5abd41baacc1db6c6d24ae13b8245a1dc57eda5cde15daac8675bf3c2587adb1eac70772adb42a09061e3fcbbd6ed5e8c0d424fb2ac589ba7e4059835a95950bb25af3cee7edc15fcda8c31365bddcc22ac1bfe1cdd5cb22d5b27f1d0ba9eeabf84db0cf0e8cacaad7cd5eee4d59dddbb1f3f02ad6ddcccbce4c00e8ac7d559cfd72eeaa9b67c89dfdfdadcadff7ef23c0a75eab56f5f5890e80b37d943a87cd4d6f2ab383947c3db180bc9a0b10fea8ffff94a8398af31a2f3a9a058fb22dfbb3ec00b5bdfba5fee78b0d6f1ccca41c0e11d72de9ddf1ff6ae29b47503dee1d73b3badee1b3cac974a636e5a9ea8582fb25a2ac7444bf5b615821fb7ac7fcafc950ccf6a0b5a3543735b80ae527ded5e8996c3c9b8404a59f5a4decdf41aa076ee8a8b6fd26ea2cf01ae1edba3f46d32b3d8e7c2bc1c5b6a8fc1b5c6ba284c867dadecb19ac211fb25abcfdaddb2f9a481f42bcbbdd45f20feadbcfff8dd4c129221c8b9dd2daafce6ab72fbd15c9dc31ba63baddbfc17c94b003de1cb0faf9df5dac707e6f2efa5efda0ecebeea14a9cee696e9a5ecbd4298a24149ccc7aaafd7aedf62f613ea5c6c668eb505cd35d3d54bd1fcdd5a1c75bbecfecc6dbca88d8c844fdc842a12f9a6d29cebad1adb6a5acfdb0edc88deac1e02bf1a623df7aefd1d5b71ae42f72154906bb03b05c2bfd267bebe04c9aba47f58be8df8becdeab65c700ea96abef64ae7bbb1d364fdc0da6ea97db855efecba2cef2c388b4ef217753bec2ec0d88dc7a456fb9cee6beed1dcf7e6bfea51fade18a8af87bfe0b137ebc0e6c69a8b0b5b637d391cd839eccd889ec32ab0ec1e12dd8a8ecd85ded77adaaba9cec994bb6bb8ecf777b29dcaecb7dcbc2bd03b44cefd41c0fdfee32d0ec9d7ea39ee72fce9ff47c2e008eb51e5e134b7bf48a09be9a0bbe94dc5ca0debe599e9e5b3f79b3a10bcf6f0d95bebac6b30ab028e9b849854a79bfacba9a2911cfae2449d8ae015a720bcdb33fcde0aea4b87cc0c5abd62c51eb8e89454049d83efed6cec2f7fee544dacecebefc0acf6c6ed5dba9f4aa1320ade5eef6cc8aaec9a8db90765abe2cbdee02a4c9818fa52b1d23db8ac0d1e6c7de7b6247f6e7adcd12fc6b1df6d63d5dedae8710e42ea8176ffb2d41065e9baf54cb6ec499dbf4a2c76697ac9b0ff65e02f9f34cf4aa806a065e4f7e70a41668be5ebeb2bdf98dca4fbdb66855d5b1d8f6822f794efbdcc9e56fd2eeeaa3e1e9f07b22cf5a4ee1eafa2a7aeccd5b506dfca5eb0d4dff46ecf99db060aa0afcf8fc4d9e00ffb5ec2eff8e06681cfdae57ecd7b1f4be36b23ea5bea3b4d7aedb42c7c483c23d03e835dcfbc16ed9eba9fe7ba88ffacfcaf4d051a7c21b03621e7adad811afc34c7be8cb4beb96ad5a262bcb2c3d7883fc0f0afbfddaefa51edeb0fcc03e04b35d3e2c0df3c57d5d51fbe48e2aafbe9363ecf61ded37835b1e133bd4c6196827ceec7cfadf365b5adec722d4b45df8883abddcd3bbba9b3246d1cd0b5baa8d0f33afd0eab91c8fb9705d67b3081597f8ccbfdcdfe94a10ee9eafee2fbc9dbea077a10bcc6b7bb5a9cc6eee7abda39d7e00bfadf783772c98ef13f0cd2dca2a3ad332cdb4634e988b21aadb52d4b5c7ade2ee0c4d248855a7ab174bbefd396547d4eae4be0406a31fafcd2df2bab2c996ca7c1d0c01d15b6b15e3afe553dc1cd675e21ce8effbeaa8b0aa38461e6bdfe42f47caf4dad6033e0e6eb09d18b32fba1d5a5fdd39fd6ff612950c1a7f178f1119adda695bae8d86bdb0c0ea853e1add3e044bbc8cc5fc1df87f0bdd5a9fd07b34daac5aab1dbcc51e9bbc1ed5fb9e2a542eea0fbd2450ac5bd9d0b904172fb3dfb58cd77ccccdfdba6d2c9e38cf0a2fee5ff53c3ab50b78bafc475e00ce7e5186fddcef4cd6a9b5c2decfcdc3cac26d6c6cc0a5b19560ab4c4baaebeee34eaa3e8e5b8811decf8347abcd025ba81063370598a7589b445ab79f41b20bcacaae5bf6cbffa7d72ffccb2cbbb0c56e4860aefbf19d3e6a2bd567abf399d0df95aacf8e7ffb3ba3d3bdbb2fe2d4bb7dc604d4fddc81ae01d9e4bfcf0dd45ee7008d71b719fff55b379a8df907c53bb43c561bbdbd1e452afa7ba3c1a4d911ac2ff9b259eb243f72b816af0079e88ad20fb2eeabc14bf9ff8e6b1bb25ac9b2dd1ea958cd50aeaf59161caaff06cbdf9a4ccba4e18ee8a9ab7caff67b4e3b7855e9b5a558fd06167c962c58868a919a070ba4fac9cbdbd4af24cccd58208921bacb8743f17ba776c1bdd0bbbcafcf7d0cdbcbd7b009ad7d1ae88fff006fa365c5b1dbeba9fa9a0e9dacee3b164cac609ff0e0aef68e8fc3f16cdf6fcdafdbfaabd8abba1fe75fc7bf34eeadf8c64cd02d1ded5724da2154e9cd542a1ea907c673ad7ae7e37a9b4fb92aa976b84a39d09feec11a266bd5eeb9bb5d9ad07ee309dddabdd4dde0eb8cf12bccbdddc285cd23c22626976cc5967ea301adebb6e6eec3598dc863faeedb1df05be55c69c20bc7dda588fe8ff2bffde6e6c080acb9f83cbeada2cec1052aeb53ed35459c2063c98aef9c8feb04ff6ffcab9fc0d8cbdc2dac67c6f7d66db74abedfa2a61cf9a9fb11c3d228f8c1ed6823e3ffaeabc540f9006a0df8d1fba73397ec5f7c681ad8f16abfa4249da7df2dd0c67ff7bfa389c1eaad6c322be154e40faf13aaee6ed9d2b9804a82af2ee6eb17eccbf7a54b4e53ccdc4e0f7fd28c048ddb74ea91d9cbacbcada3beb82deb95efc095e0e9fcb2f4218f4f106be47bcb5d3ceec38edcb17a3e5fade27ebfc3b54d23a0ccef2aaaab9438f8efce0bbef1dbad649987e4906fddcbd9231af63bddcbffe0160edd8b4a3fa56f6df5b0b1e8eef9164cd5cdd71fa3fcbd5769ecd911aafb782c4b75e0dfc3caa36ce14ad7c3d6cefe2a25a6a8ac6ce7b7eb44fedaeecede51dbf7368baba94aabfbfeadc2775710bb57aab6d35c2d5c4634d04bfbcdf47ca161b2eb922c2deccecca67cbcf55ed6ec8ffee94c6c2a127b46274ed32e6dcb83ec81b9cc184aee1fa6c367f34ad35dc4dbb26f7a597b8bf6b0f18a9d72bf5d1bb8deeacfa88c30dee92ab68a0dcacddf3fbabaec3142b6501d4b6bf2503b79df6e4f8b311e42db5c8dd6bc1dbf7db6ee56c2ababadd2d28de719f1dcb93c4ebc71fca1be4c572cca51c72bcaf1b0d7c05177ec7af67894eed2eb04fdedf0d217e9ebc7ef47ded9cf27dd6a4b67328e82aeea20fc7fddfdb9b56faea9abe10fcea6a8c339030d2b518968fa2878dd4e1b133e9ba8e090760bd72ae17ff0dd0325ad3deecf81fa7f1e952696ba7ecc9e5edab3b971940d80ab5114bf6098b4ee90c04bbfedd2aaaab2dc7beeb3ebd802fdf1caee1a0a0cedf2a5dfa0ff3c2c67c83ffe1867a311dbd62ecb3795dcf5baa1ee2a4e63f9724e72deb9ff1ea472fa1fbbbacbef85afe9bae7e85b5acbcaafdbacee0aa8790d6f390fc0e1567aa16c56dbbf1fad6fcbc90aeb74eb61d7c09ee57a54c209bfd217eced632464b46e4c52b27dcd9aaacf0abaf69185f9bda253cf6d28c20f46cefa3bbc45ed79adbc9effd460fad4304a561ef0ad14fcf0bbd930c3deb1bf9cab7c1d5b9da8077bfbfc11e3ffdee5a88fc7c7dce5cdf1ab5ea22fae25476db59f88971b7a6dd8f14e7cf13aed9aaefb73e2ebba2cfae7bbd4a0d7cb2c1622c159b8dd43a75ed85140bda0afbd79dbc0c37e49243f0f63fec9aa1b1ed0e293b8abace3c4edc67bd9dcc5d2fffe4fcccbbd97d093c44e14dd428e9eea563134d6aed0b698bbcfa01feca297abefa8da4eccd8a6a5ad8ae99ceecdde3054a56caf77cece6d62ffabecaedbfeb0340036b4df96df166d4cbce4672bdafaadfe126cf9bf0aca7c7f1df89bdf1a194decb17e898a44efaec234ec72799850280ffc93aabf0bdbcfa3b0def135ebce2e62d6cd52dff7c23cb35996a8a4ba85bb6811377e7bd3c15162eddcac337f99b4e1c535e1565f92905767da2cbfab5af020443beed376571ad736beeccf3afce3ef5950b1f9a0b8792b948c2498d0e427e62a1c2c8781e93aa29ad13ea4ba24cf0220a5165b597e1edcb9c2ddb3a54471dfbcbde5d5dec198cfbb94f9dde8f5c9be9dddd5ff4bede64360f28558bbe6dcc8ecdfdba0b551b04d3fdd11629dc36cabe39dd8d8ddef0e71b4df2fa2aef383f0a334153411bfa8b7e34b24686faa04a4f5dc8cbeb0fd646ef4bb2f67baca4f150e2a16befddf3ba1fb9ababc022e0baf6353c30c8fe5050b21cc19bf4bac5e03cb3daa2e4f28f3acf932beff34e1adc86dd2f1580120dbeafbec08b1b0ee8b3a60f2cf2ecddea8dcbb5efc8bde1e481ae5885abab2b89c52918fa67c53a0a731cc787c04c1db2aa9dbd25e09ddc38cbd9eff7bef31a4a5c50adf9c8fbeeaef17d6dcd58a6a4eb4daef9ece1264adeba5b81ac0fcfb66ee6eafe5b0e0d23cb8e4bdf2cda2a8ab213effa000dac44e130bea89fe82ffd63dfff95ceafa2c2ece8cf3adcff3eb0b76c93121794a94dbfcbdfae0a7fed33fd1bdddbfdf5a9befa0d611a3db0dcccafb75bdef8234ffb88fda822ac495b4d3cdd2ea3b2ddd0ceda5a9cdf64ebd8e50fb66706dff86eaab0b492f6720d61feaccfbd95c6ac8f9744e1a18c7ddcaa6ea32d0eacdbeb5be490e509de9b29be0ebb6d5e8af0b9be99cbbec91f7494a425f5a44d0a9c660d1d5770ae6b1c1ced9112db0e0d04af2cf47aa49c1dba65de9f3c6428da3ae6fed68dd8e986dc4c1f950e4aa2cac88bdbc9b63dacf9de13dc73a9c006f4d79eecdacc196b74cd8cd05d5c282c90dabb3c1df19efed0c535dc96d0b8cd2dede98718a439efa6a3da062a2b75e49cec2bbc4cbe9d2bcac4237acb619f46b5423cefbcdfd7970b3b04fda46f31ecb4e8fb6dcccaf8fdd7896a1b55abedad7f1a72c3a3d6dc38b8dd95d69fae1a03ecd5e94dda05b1cbe869d777ee1eb9cfe64f5a07deea07f8f7ecd8da18c7bddb57b9f6ac998c8e1cc02c2ec6f6ba7c0a89abb0be3662612b4ac91a363f03795ca2defea0cae4d3436dad0af1bb9edddd422fdf4a8cfe9d57eced5ed7ebdf6b6b500baf93d848fd35ee3d66aaa383aae47d44f5cc5c97cbd0cc9cade59fdcfeba5ed5b6abf0d2aa2bdaeee9ba8bddecba3ac025c25c9e1dd5e60de5ea0bf4ee47edb43291e40d04660e8d66ea3d38bbffc724f1fff1dbc8fd9f476cdb1a4cedeac2c697c35cd8bbcefda60ded2ec9dcaada46f2eb903aad72914c750707bfbfb2bfb7808b6c2afdbd7bcb8ecddcfb376f898a89dd9f85a4e051ecac4acb859a9deb60afeadfbb61d7b0ae11eae23a981109221435cab68edaabd3ea4d83604664ad883bcbe25dfd1956b1e1153cf12deb53de212f69f2b55dad976a696badf9cc4a4a2d76e8daa63eae6e6810bcee294fc2bd4a81cf99cee83eeafed6e87bad0683e17fa8f20d12dc8baafbaf14ad8c1a1393a2bcceff332ccdf0cddecdd01a5c90e5cabbfee3ab50a92bafcebadbf3f012daf0dd3c8b5b9e0ee4d6471a1ea07fd3ddd3a87d7bef38a629f334cda74cb9f2195a5d4fea09e5054bfa9afda2ed2feee014aa47effc3bb68c24ef2af3e4afe57b51e3bdbda709df7dc5a39ccfb74fff40eecd96bd09ee10270bed9e08606cc304ddbfce8f7b16f180614e4f6fde58ffc5d5efdcc283e1fe3dc28b4ca5ccd4c234bddc3f5a5eb6ebb01c7bb8fe03c99717b00f93cee37c9d5c69e31e2bda86f48380f2ec3b9cf095feda3c158e4bc2b3dbba37ded177e016cd05b7d185e0c912bcd7bbcda5160efdb3e3f9ca176bfd7df91dc5a066afedc4d5cb9d3fac0d9b9d30158c239ebec81dbad34ea33bdca3eb1104f9912ff7d8f7a5ff2eaf3f0be4ccad26dbf3ccad9e0cef9cad4db9abb2afa4606eea3e6bca41ca5a0da6b4f9e52ba78d6f558caada5f3fe84bed8a2ef8668c65dde3229a2afbdaec71fd00ccb5a9bf6f7f7cd2e228ded13ac98713c0c0fb75fcdb3eebfbe5039bf8a844cdfab3b223afdbef96045593abaccffbeaffbe4e7a324f8bdaf6b4f1ed443b77246bfdef5fa7ce3e79ea6af844cf7232fd01f0bbbfc2583400c0e0bdab18fa0f10ef2bdb0d67a426387cd8afdfccbb83dbe40466098959aa334cb12be8baa2e9bedd48552aa8fbc9aaaf5ee106adf54f82a18aaaced0a88daeabfe4e9b3c76a39ab570ce77cebcf3dbf4d55065ebfeeaf7635c04bb1b1b1fbdf00a042835db1703ebbf4a984dcf3accaee812ac18b94ae2d05dd4df219cca71fd2bcd2eb470812d613fd4245bf4a28a4d6d1a6bc2a74d9bc8b88de49b90fbe8dc9d1ace77b1dc6aac69e595dacd83d3fc66df7db8926baad08b0490dfd897f3f0f0fd04a615e32dbfbc2fb2bcb2bd388c989bafb3cbaadd6bbdeca1d17ebe6b38dccdaca9b4a4bb8aa79efae78554b2597acaaeccefdccafbeda87fea159b25bb8fc2b2efdf395923df142ca1d3b29fab4d9d28bc692bb1f8d2f9be133cafb5f3dfc36da8accfcfd443d5b2fed6e0e16fcbdbd3a221000e10ce2286eafa9cedea9dffa625cfdb21bf6eaee51d9bb4ee3c4f56ef1ecac7aaada45eb27ac6fbdbd4cb1806f1067eaa4cbaa0fdcac7fffcc19ba1d9d8186ae7e2c3efee24fd2f6d57cf1e491add5f47cbe4bff68113d672bb4a7f355d2de0e6ce7c0fc97e4bd13eacefd5ca7d8cfeef5eef3c43dafcc3eb37dde9cbae1323de4ee1be6dbdab7cddd6c1e2e5eb8ecc8eacced9d7bed9c6ebb4cbe9cd112f4cc61cace8e3859afefe6e140bd5e5f8ecaeddd6f53ac4b0acdacc5bfbbb251bac28ceefd9322e3cea0ec2a1f9dbbbaed7dafb70c61ed7da69dd0437ebf0e40de5855e80cce32f4d718f67fc7353b62a550fa7af48b8db65460d18ed01a7e3f5acbada8db9e6f9e5eaaaec88c555efbbba0ffaed0ebdcdde7df87efecc9d61e3c225c14afcde95c6f1ea374f83e2aa9beb89aa3c980c8052bb3e81d0d3ad5f2cc8af8f1eba69ac62f83ae088b3bebb19945dfefbb5e52a4260ca8d4f2ded26bf78fd5f0ad8a369affe6499c6510ac9f3bc8bfb1192a8fc7cb3eebefd87a468b47fd8d5acebd6f0febfbdeea40dc1ff3dfa9faded33f8da6ffdcd9d395c9178edfe126cd329ccb6aa956cfebc877ae5733ead0d1eafb612da3dd4869da5fa8b23eba063fdde0bdd764ed0cd4d69e3beb24c7fdfe26e0e2ebfb54706abeced452f95875bbaf814e661b588e7188dfafba3eac4d50e68fcf41fdbd5468f9802f46cedcd9d3ded3ebe072ed2ff9bfad51cb04dacf06ce7ffa2d43b4182a6b0afebac91cc65fbd4a35c4ab2dc38e5bf0ab5b3b4de54aa3eb08a5fd2f64d78b57665b0fa2ace7cce7ee7da4bbdf329eeb7d8e4b0c9583adaf340fa1ecebbf8c6045ee6b9de3b26e85a1c8583c13cf9dde06eefd067350eec8e86b91bb4aa1f3a75ca9c8faca5cb0cf85b9a2cb6aa66e22d0386a3fdeffdfa6a5aedea8d5d1fad1b6fdbdeeceadbdef781d2ded915acf1a5a35baee0feb9dce54b4f6a492639654fbb6f2eadc45d42bb2dccdc83bf8584647da5f4daeff54a95bcfbd6e1324af6cd0df1cebcdb7f0caea8813cb164a2ce3ddcff8ee6cfc6acbb5c669bdbbd0fe08c959f9ecf5f89dfefcafdadfdd0addaecb9c63dfa37dcb28840299caed58fdcbbcb2d77df23f598aeb1d7512bfbdbe5941fc1ebd6bccf459be236129ab7db60e5adf04bdaaadbbd0cc8fe43ed6fb5e895ca8aebd8afdf3bc5aaef4dedc71c5264a7dc9c7b8fe206d0de68fdfeb5c48cdec1bade8abca552eece752a0ae6fb0a9d7ad152cccfdbcc3868f4181e9c4ecbbad5cb48f728d3cd5e4ee2bba75f7f8e111279a41acc5bdc7ea9e376518ddfaef5102920628ae2ea66f5e4da6f7850d241e95da3bf3fd5bb3bbe905b3bb8fcf2bdbd508ba6e3a3d28369dd4ec26d947be15b0f6a6a82e9d3b6cd35e6ea9bdeb2160d23d9f0e5ca91def929ecfc6c3c18829bfc2d539ddde8dc36effed5cad110467bef2e6c063bc30c3ff5e560ae084fc1dcd2d2b6cf5c420b83d5e8510afdbfb5b2c3e6cd13bd8a690fe5bcea2250409c4da99ef3ee7bb48c9fdf029dabae97a13d2073ae9bab7ecd6b24644cd5f07c6af5de57ec2336d7dcfdb0dedf90393cd307a8596edb6b3dce434e5e7cea5f32df923c39aaaf7a1f0aad2fe8a5e69be02d0a2384ccc9bf6b44e10765cfd11d2cb07c40f0d4d4efe439c3b02e55af2ceaecf71cef2674e2bfb2badd5ddc9ecaf8c2dde042ab7d624ba9d3a56b3b0ef916d3f0b6d2afd83c6b9c7a5295bb3e8989ac1aaf7a279aa7f78ce9f07b5f6dc6fd4731af4d45fac39efd2e2cfcffdc4d7b7affafbf6dfd9cd2baf8e7e6efbf5bc137f5fcc2540e789e4f77a6eaec93cac28830d9b4a7266eafbfaf95ad4eb2e8ad6f918225dccc0dbfaee801c2ced9daf9dc715868ecb80a1843fbe5880e16a6e6f9b555630a1add7f1231fcde3d3ef10cdeebeb39dcdce70ddfecc908aee6ab47c0c401e85e05dde4e38b39f3b26cf48cfbeeaeeefe313e0ef0bb64b0d4adcf7bbbf1a00bcd8ac47ff10b0decfdd14d4c6dedfd0cbd9d1131deafc68e3fb1749c74c8a68bad34538c2fd6a13d75dabc89f060c85bbcc60364cf8dfcba9bcb55bcd062f34e3d851198e760ca0ea2880a3b8004f77e8dcfade8d8e7a868d74dfb97fbafde5cae0b7baebda98f003c9dbf0da5bd5709b5a5edacbf0d1f2ac71a6dd5ce0e20de1fd53aaa84c2ec2f8ae08927f958edfc77cab8ae47a210c3fb1bd4cb33aed6b6cacf2b4f5cd0f24750ddcbd2771b0c199bb0fee9abb13cdf1a4f97352b355205f1a77ab06533af5cbd508dff5eea094bbafff7dc9bcb29fcb9aced92c0eb9f88d66ff1520cedeb98edc1cc0eeea7a9fbe1dbed7bcd861fcbc9fa5b1f39fa211c8d3ba54ee7dfa0aac9ea2e46b23aacbaf8339af4c2e7c06ae7facab3e79a7df5ea1b752ce1db74fed02b8fd06ccc1ad05ef1aad26b6aa1352eeb767d43d263d82e0e4ed2c4a9d2baa6288b91dd024fa39b8cc912ab07b61961b5d702fec16cbea0058d68fde1b0e6d3ae6a3898ff1eb705cfa1b1dc4bdd31b1c1cddbac2eff8def7faff7fa18cb8b5cab2ddc6eaa89fc118efdc5b4b2ce2eccdf9f5a626c5bef9fbca8d8507d836b86b58f22cf1bd70cfaefb3fec6cb7f63afb29bf541c1d3830beb300127cfc76bc4af4fa8fca2cb72da1db0f0750afd4def0fd716c6753439ea4d1d0cb48a9fc025c2b48dab7e3e6fcfc49aae8a7fc3d3e913cffa598a803bca6bcea25635b5cb79e107b543c55dcc78cfef2ad6926e1caabacca849ef052eaaa31aa3bb9e5babfdf9b50b44cddfea0de7d2e68bb8d5ba76bd7699be75d44bfbbbcfd39fa3a2cb8f15aae24bcf5b0a58fb06a5a2fe28fb8f5eaadc8eedddf9eeabd8d04db9febeb8cff9a34c1f8aa3b53d37d27ddac025f4302fc34e468997d6f0de7b74312153f0c20c3fc31d09b744e7fe4ac79dd5293b24480ef1f5a11ee1bcedf3ca6b7bea4ee69a17a2a2a984e5ee67235e2b681d68bc1429e8bc88d02e329ebaae6ffc049e29ded65e4c09b42a15407aded8386a8d9d3b06c5b7ffe07750b13b1eb8b5a2022afa255e79fe328d8bb1dd861dbdd776bfa53f782cedbf6db93d06d056ced3cbb6e8feadaabd7d3bb4fc3acb0a0b9abdce1975b40414e37a052cadeebfb9af7c3ba4b1c4e04b09b112dedb13e2cf5c64f65bd4dfedd0e9ced63c1aeb3712af38579b627c31b69a7ed44e84bface3c5bccea84f8c6e99d375ce82deebca014369e29c9ef0a1ff9ecdea351c1dcd51ca31651fe61ede6c0e9a4ac3b805ded4cecd59d72afd9d9817f9b6c9fcfecb53b66daf398f2fc2c4add912634d9df2bbdaa555d92bc81cc2fa1a9a3bfeebddac1a94fb7bde5ad36f7822d5fdfe5a13572b0f545dc67b925b5ecd4f54b45fad26beed5dce3ac0d352a3a3bcefaaf018c8abcfadcff4f9db496daaf98f5b3e0a106b5efbf7cc98babaf09ceaf8e8fca57acdf81fa5f6aba2b8b6c0f0058c9db32baa6ebef84ed7efbe988ec930bc0dc73d63f9ba9efcb737ffb14fcfb91f11a1ec8bf5adc7daba9fe223a7ad2fbfbca60e4ed962a4c2feffcae98445c56afec573bf1fdfc4c7bd24ddea5abb26de74e22b251a1591dded73deeaabc6bc6c5aaec28eeb13f444acb0e66fb7a0b1bff77a1d0dddcc6a409ebeb36d85eae6fd6af1b6272fc97bfffe50eef60e1f3b7f7c8bf67a09b25def45f631ce8c256bce7bf6ac00fd94bee85aac5aecc9471f3ed11e307fddcc7490f28e68546ae6cde624aa35af0c5a6f5620efaddce62bf6d9ddc1bedbd5dec9d0debe0f2acef6c33dda26f8fe97aa6269e20cc346ce870eb11dbd0dce2da0ed7bb72af865e5faf1a2cad5dab88bcadd813d02e0ed3fc042b8c69fdceb29bfe5de3e3f91eb7f0ead270e952bcc29afdadbc5c3fcdea06ceeaeba8c0abcf1ea10bbc7b4c9fa7e722b6cbc4bd9be1366f63c249ccade33dca1be5ff5cb64b2feadcad030a3cfcf2ff60c6df106a029de8e3a1def7fcecfd65ba3a81cda70780561a08c98d1fa6aafd7babfbbad6f87ca82beea7dc96bf240c77bbc7dfdeaa6728986b40bf78118ee4b9d0a32d3296daff380a9d6f9ef1c2c939e515b8cf0fef7c3faf690ca8e955c2f4407971afefd9bdbd740fdceadfa0dfab8afddcafc21deabe1ca7f1acfc6f9aafebe4e7dbca427fdcc2ac5ddf23f0c9b4c53f31edfcbd0e39f284202b4cbc46744157ab85b9d1f954baacd5e3fddc69363a6ea6ca7fe9cafdcfcdbe9f7adbec288cc9fabfd7b4d4dcac8838eecb9820ee40e6c8c3a84d795661ab1d0bbba256fa984c058e0025eaf5db92c2cbcddda9f4c2f8a71c51336b1c8e6b0a50eabdad1bce8082bfadeed1e60a6f673a1d1de1badebdb9732efbc3cbd6fbf7cc2f1d7ec44e64fedb8cecee1c5ec88e1b6fdc28216d400ccc2cda15f920aaebafd1941bd8832b91104e962e1a477fc4be0b0cf0a2c5ab2ab7013c2bfe96ca8c6f75dce0b9efaca88efac9a5e3933ff25bae70bc7b8bbc7d17da2b81275cd20df80bb79abfbf466ff87a3ba6b7ef4e5efb7c66c56e2c5b7802fd8eecbd9b2d2cce751a3e1d5ad5bb9e10a646d203a5e94cd86ae7e2d60b58bcc3e0d9e9dc5d4c89eb6aed965eee8893f3c6d9fe844ebfbafc4bff2c1aacb18b254f8490f50de5acd841c5d4dcb9cb73f2faa227a9efd67dbd15a92e21fd0ab3214e62a2e2c9d87da19cbea4bbaef5d0cecfa7844ef657db8b6fa2fcaddfedfbc52e89626a707fe78d4aec6c0fcd1f36b5e875ba10da1545d9c7d55d7e8cf95fdcf0507d30bd5d2af16663866e4ddff2e5a8efeb8a300a8c7acdebacf988bc214bd42a0d3aa86f70900a0ebec328c223eb7ff2d5c22db9daa1e7fa9dd71d875b52f94fb6afafeeeea2dc9cfe671c80de3d9dcfba1a31e4de1fdf208fad81634c112080f7ed1b1dae2d8e1edfdb77f64ccec545ed8bcd59fd6dbc5cea3f582262a4480dd08509e533c1aec85cd549ccf0e52f645cde8ecdf90dc1ce2b3aafb3dcdd94abeceedba043d215fb7c934dddf4f5fdedf26fabed1cfb9dd04a7c79cab23c7383d8bb4bede1c932e7fccbbaceac7c96d3153bdfc09b1beb9c3ffeedd168f8c152aee98bd3a6289fea78c1c4efe8efeb448aba125ddf8ad8fdbbdaa69cccf198ab02beb950cdda58cfe66a77294badc9c9c8bbb32993ddeec24840a66efcffc47e396b51b1e7edaafbf77101ddeb4b53c7fbd4f4ef3648f37beb5d1ec29ec6a83d477fbdfcb401cf91eabebbdf9c0c71e8ebecbdab240910fabe437bd781d9f5ed4d9e96d989418bbc1ecc9db2be8b3e46afff9c9f7e9ae10a43bdb8eb0ccc8d66fff1bf514597ffacf30fef13e5f9cc84dcedd99cd55e8d4db7e2c7ad0c78bd786314fa3785af8157e1aafe2210cc3d151a1efafeaea5bd5ca6aceeba7a1dba1e8b89b17ecee208cd90be9da9cf8daf5a76a236facb8f53d2472c24785789ab04eaea6f5fc4873ec02f8aa985c52df4f2ededdf09a4f76c290f0c1fefb20e11681b05aa3850e725bcadd51def2b8e71ddb81e88f6f38ece8d5cd7fc6d3f3738f349db92f15e312f9acd248a768fb4096ccffa8bbeb15ad5954bd9d6db6dbff2d86ccaf3cfe437f98815e76544a55e49e6ac539153beefc8ead4dd1a46d1cd4acf9ec75c68d831aad9e2f0a0bee0dfca631efabced47459fd0bbadefe1ff1c8ba1b0cc0bcdbfe219aee9fb2ff19a53a8dbbd79ffe181c7ab3d50d7beea81bd95b9188df5ecab141d56da594b66cff6818a4d0c58ae0ec69ba7cb35a7698fdef6fbc1cbc61a5ce7ef27bdfed901b3861a63dc26e8a6e9d9bfb95554ba3be4f46dc5efcc979b8ab332dbc29b78f50abf07ecfcb95120357d096922772dde74a6942c3ae80ec8451fc90d5cf6be27c53df9ac0bafa2f0aaec1dfe7aa3b21d5ff34f8509496a2a5c2fd39754dcef8afbbff5ce2bcdca7ef1c1c7bcab9ce0dbecbfccf1e7baedaac24eacc9100e7361c8c035fdf2aebc039ab4a5df5d93dc6ba83ed9d8703b6f79c34f66acae23bb2d6fd80a0dad3f4155716a5cc04af2a34fdcee92d2a70cb468b72d8b4a0fceaa8bb17a9bcafacc04c647a1877bb46113646e500cdfb6ea7e1d0b2cf89bacca0927ac7dedcd2d71fad80cb6b42fdb0b3a7e8dc68d9edebfc6adc13b4a4dfd7b4bfa3c751d003151b27ed63a09680e5adf762dffba1d1eed7ce8b50de884e4b2fab7afceba190fe020ac8dc7fccac5c96fbb79fb4ae30bb9f5d0f9dc1a7a65d82052f039fd38bd2fea7d4477478e9fa015f41c25e0f3696a1e3de69dac2b3ddc6645c1ecb8ecbe5ece0c5aada72fdc5be1ebecef38bfaba6a1710a8e776bbe3d3b2adb3dc9e4d6db5c95e5fb12fd3562c2980b44bfaa0de47cc2bcb45fdccb7b9be58aa530dc0ecfb08fdcf16201bea15fd56d8027a4cbcbeeefeb2f4f2ce32c976f9891d6d0cb00ffd65acdd6c494554db4dface8cf5d001bdd7308a67dd34e38b6298cec14b1841da47bdaeab6cbae042fcbaeb769843fab9d1848b331f47e1afd5cf07c5bb93f36be72fab893f5dda18dbfaaca9affc63e5cbbf4a92ce352f3b3ab0a4ce6d90d1c59aeffdc606f49a32f76caeb4f5e923cebbc2f444ae27d5ce318c7026cc2631f33fa581ffc0ba2a2eac90abcc9bbc7f0e4ad05a9bec86c8b1bbbac335afb8cc0c38ddb327dcdb2af778b6c29bb8fa5224dab2f5f298da139a1ac3d1177852fb58313cbcc9edcbdedfeda2b3efbc3a0a49fa67dbadb25cc2b997873b3bed40749a0c7ef9c7b64f41abf6c1dc8483ba4baf6ab80cddbeb1baeab526050dfef8afb7cac7ad017a4cbe3e50b9b03b6e4e6bb4ebb3a1ad256951a86d7fc5bafd8d4f8d4fbc389de4b47bbfde33a2fa5d1e6bd6d3a85b5c423b3005ff7eef3fc1eecdca50f703b8a4ebaa3621eda6fbaca7c8d7cb0e4c3fc70c4d0cc963189cbaffac7438a1dde650e7baafad87be1d1f1f514d1bf72ba16ade89de134aa7fde6bd774daaf65bfb90bf0529e3af0a9bda6eddfe6cceae18e775ba11eceaeeeb9cbb23aff4bcea71f79f2d63efb707fbcd9f6ad38baaaf9ada2b0ccb8d5139d44a465a2c408b43346beff70eab6df006b2efcc3cde4748d26ed4aabfbf022377fababcfd2eb17a7181acbfca0dfe2ed1df080e2beb30d981f7a8914d9804a6e3cfbcb2ee8caaf2ffe9dd795fb253a6bcb5a0d6bc257e4bc8c5e0fbf12ad0e1bcbba4742b2fd6db46bbcfda3ef173a70ae02beb621eb2efe473c79a7af8d8fcc61b8fdfdd4cc88c7b35716edfcabeea6cad93651c66a0abc5d25aa0e1f1feee678845bfa2acdc5dc0eedbfeed07be2ef4b1af4fbdc9ed98c00cceeed8b951a9ddfded61ec3d75a5dc05bd6c4c0cb2e3c0618ddaba7ff185f8ac270ab59be19ab02a84286664094ceff6810e1e505a0aa5cc273ea2cd8ebcffb6bcee63e0b4b8fe9d440c2ff98b7bca7cdd17946a8fb6d4ee9f5f9ee8fca65188cfe2afb0cfdcfd4ee552f2fabd4d1cba7097adaaab0a63d8cf4cd21db6206d55fabddcefc0fd454dd0feaf6889854eec2c0bdd03aa8bf8ba3cd6da4ab59dc1bdf1bec9576ce9e4509cf04ceb2bcc9a70e2aacbbe1eb6aaa384d63b04afac6b55a7df12ff17d7e0ec46e41fcc93d5fb970d031a0fce7ffef1af6f32db4af15e0ddbf3e4ee27b71edffc924ad99d5d35f60abe7b697f46ebedfc38d06f418871cefba3cb477bf2e9abbd4d35a887ea7dc9d22ba42cae1a96f5e0e3da20deeefbd4fde40c657e89fc0a1391a3c59e356bcceba90d1f0afab1af5af91f0cc24fe6dfeece2d1dd7eff25b51681dc2cbe49cc04d39cf1f0d3620a59a2621a80986ba4f76dfcfa1205a3f09045c0c450afd1cbcd2cc13afda5b05df30f43afad6cfe9c9986be1b91c6ee9ad79e13b7471fb0ad03333a8c36a60d296b1be5653ba6e6aea8d27fabccb3c1d5dc0bf6a05f4657a070a23f0f28aababc74ec5e509cd0c4df19e1be302ef3e9ee26429bb7a5f625469f1f109bafa8b3cbaef33f2d992ffbd15c4abe7b92943ad187c40ceebdbcd9a6cacaa7af752a4aaf108cc7cdc214694d2fc87f6fd70b9ced3d31f0810bc2a0cafdaa6e0e1b2c0ec667e6bc026ffad0d5efece3dab4636bfd4fdac60c6fea8d96fb4be1ef8fe3f72f4a57e8cf985ee7eed2f5c4cdff3a47ff6dbbff014a4a9aa9c7ff7dca5b59f1ffd6bf58eca77c2bb478857e8eab9267dfdef63aa5bfcf84ea74fbefa421eef8af7a8c0c2ded21461a7ec441ef6bbf4d8dd64901d0f12f1c85e857149079b83fca8d11302ac6f712eead7f6c71b13358af1df2d271e688f2aaf3c8fba5b4b87b01cb49e6dcfc7cfceb9fddd6298afdd4afccc0fccdabbcbef20027269d6cd7448dd5bfedd743c021fce76b50826ff21469b24bdea3bd8d4692decc4f82ecbd5cef45e1eadca6bd9df88ebdd1fef2c82ee3ee1e23a1c49b6a26b898de0b81ec109d6a26edb24e3e5a5d20a79cd32cc9badd8bcfb83cba0ba29f6b31cc3ee423d541eaeb4e4f3caefeacf949ee018294e0bcbdf16eee6ebaf554db9c47b2edbdb8adea3eaca247a340c6a0cf7f31ae4323ccc1daf1a91c9cf1481e6fa12affcaca80555717e1b1f1a8c32aae8cdec7fbeb2d5fdaf7eead5ad92a7567f32e13c85edbee3b5b1acf75bbb8fb30ccfbac028bb9d2ca9aa6d6b6c346b4bd1cc8b56bbc234916ef453fb099aa9fd2e5adaeedef8f2201a86de1ef26e56aa2d48c91d4ee5deb10671f00f8be8a4d1bbd71ad8df2f0b675fac6ae4fc0ecea8fa7b823d3bb6e04e8fffa8dedce13befd7192ee7a948e271db52fb71c4aab81e96a72b04ca4cdb805a119cc76f1fdc5ae72b41456ba9f10adac7dbf78e76ee33556b7cc2d32303f265d33da51c2f4caccdea414fabecee3f41fab490e2968f44e7efeacb42bbebaf053a94819fe6bbca190d8b4fc3d1eabfc62a2aac14feedfafc1cbdaade76355b529412fcc2e4c98fb687aab44ce00ceeffc312fac0df06c0af9c8febfcb5fec6aa1767f1ed5f000f6a6fb2deb377e2fbb0e33fbbe7c68ab92a79ed0fda2ccfdfce2ebfd644cfec44db1641083b3e5eae961a049dd2ab4bf0f33c6c26268b5632a3eadd70c3bc6018e68ac9b1bcbab8572ffeb78a1185de5f0cbaf3bb1dadd217c0cfb0693ca3bcd4eedfa7ed87feef1e4e3f62a5ae0f9c3d5fb6e55c1a18ddef5b6a0f2ddfafcb1b8961871d0bc9617ba2eb7d07d8efedc10e947fbbc44ab7dcbcd9f0a8db39ece959bdfda505bbeb3ceba788d04964e4746f16aad227ff6b0d1ea99cda3fcf3bfbf666832f8a49518d4e60ebd8dbafc1eedd6e09d7e1cc4f7c9ea1e7bddcbabba3a96eb348f3addeb31e5df2f4bc52ab9fd7eaebeedfd1f33d990967cf01841eff1d6cdccaee4852f428c2adf5a172dfc2ce4f3ff23edeadcd501093c8b33fcf07cbcbeb1ffcacf3a380f5ff66559b6be8adddacefa6651dfc8e6fcc3f273c6a8b6dfa5ef8efab66cbe67efe0441753f0d713b82eefd182b0cd144169c342bccb0c3bb122b73bff89bfeff27fef797ea14ffef5815a6eed6b9b605da3ee74c39fea7edff0cb78bc7da225e8af73bddcf7f6cc7aa6b91c2cb117755fee024fed9b2abab96e1aabdca772fd5fa56dc5be0dd26fb5f5d305c63ab1bc1c9239fbded94cae0a7777b0aaeea5034bc405c01b69e3b597ef7ad1bca7facbc1e3b590ab8dc6bfb5c205ff72ba10edadc17d8cb2a55fad702bad30fbdddbdc5cee42be8af9cf6df43abd08ba89758da5b0157ceeca08ee2ac885f9fb09c77df14cbd8e5f10a2058bc5bc211a421f64754a8fcbf0ff68d372644e2b841aa4af6d79c4fd0bdc47c0d42f21b2b81fee93a22714fecdddb38d4aac9cad621ca9ea6fcaa67eed2dfec95d38d229ad7c37960f0d8dab16f768d03ee604f8dfb31d4ca42ae05acbfdb3efe3caafc3df74a18afb5f03c4ecc2fc34aaadbbc8d187eb0e4eeb2c744affb2f75f03c8da6525c9fbc4f0b477e295990d8570dbee425acdb4a6dba73aaf59be82bccb3d5ff2eab0ca5e9a810dc8f6bb58a8d3f25a27af1bce95a4eea2fde0430a88d55328bbc70c9a8cfce7dadb0e7c0e9e5561d1059cabbdb1aae5c2d7f2ede3e1cba0dfcbb6818dcaffbd36f7dce0386e0e6b0dfc8fb5b59f7e06e39eca3ee953dfa4a0c506ee6bc2faad1a9e1f1b320cc0201104a6f39cf3a27c6e455de4df1d2f3f3c3191ab7ccc1eacbad070b2d9da4d0d81f3ce5dbb0f94fc9cec0cd0d0b3f2c828e6342c7e715dfac0fb890c17a3bf31b5adaf5cc6e3fe45fa1015a39f53dfd9dfadb8af6500e95a1eeb9e5d23dccfc3026da71ae588b3cbd472d1b122e6ea05ad5e730cb482fdc37a368a2ef74baa8faafebfc7acabd0cd70ba1c7aecc2ffcf0690bbdf5ddf533d7da0a3601fbd39aab1aa86ad2bd70eb46ea43486fd7abf196131c7f813f718a3b0b9eac9eb84ecd5cdb7f4ec337849b04abb9cc08464bf7ba8dd3bb01d7eede5b6764b1cf5b93cb83ef6f6040695c27f3ecbcfd6fddc72c4c8c0f9388172db3d40abb8df374dc3d5cae8562a06abafcfe0dec03b72f60fffc6acbd1e787fc71aa6deadea8b2bfff6a5f06b44b001a911eccd56cb8e95a1aeef4cebc6c42a9ef442c1bde98e75ae031e5963bbbcf6996b45721acf7d36c4d8b73ab5e6b3805325d13aa83daf12dc2d1d6cbdfc9f4c91bc8bfa5b0aae69effc41d3aacfabb25b772c40a9af058bfbfbbd5f9b19ee5f79a4db9f2bebfc6099e4aaa08bd82dfcc2de36cf0ded3cca8cafceefcebfa893adeaab8c5d6760cafaa9b7f4f7ae8960d2a62de48ed8aacaca00eee9b0e9daf01e83943f8c3bc755f18a875cbab6d481877a05da33ac7d9bad8daffc7551ad09a0c5ccbffe8bc506c1b3c1715a04758be51fd4fb4b9cf9a61cb246ca6affab96ced5f57c97aeacc4d2bf4ab9d1dde4146dfc2cf4c4259b4e74d1dfee1cd1d2bc2b70e4fda2b7e14b1ad000fabc93b6ad73b63de85fce8fb5b0e1bdb161ba91defebe2dbfc7bb56192b7bfa29e1efe85a84b87a1c1f7fd1e7a094488fc344e959ecdb2e98f510e958c1d39faafe348a5fdce0a81cc481f02e33de030efd37c53c6c27c6edd8e022169e556f8e8dbb61a15e05eafa06d7be683af4f8cf9cb4bb6f2c52eda28f9cf8ce55f92996eae1013326ddc1ddf7d47f20efb7a98f2d008c8c882dd5a69b46e8db4a9e3a8f233babfabaab9591f6b38f5b320a6f97a4ed3dcb3fea4e46c2facc8f4c8f23ef93c40b0b97a0bc4f305bc71e8faad8affb8d8f491dfefbcb42b37b1dcfcf4a51cfde72e7ad4d3b0a42df75d2f9bd85dd7e332c0e0e59cf29cd8df570eba6ad054dfaec3869ef63eaa4ab2f779cb5c2cf9fab789f9f5e6927c571acbc2bbd4ef8ac48ef2c45f0ddc6a3f8dc3bf64de5dce3dad35ffc3bff77dd76ff80aacc921bbed21aecb6b20fdfeba37cf2edc8b249bf0e38c05eef58e6075c77a7ccd4efa4cbdf5cbc7fbdc7eb705cc75fdb1ff0b304fa3da997b4f696a43f6b7f58ee0dadc7e6deeee8da075249ac4b4cb86f4eaea67d6b7be50be1e2bcdad74efbfb6dcfaefe6aa0b40b27ca6a99cec98e34439a5309bebfceedad616f2f6ceaf28bcb6bdcc48e996b5f5448dcca5ca9ee8c21afcfa390f9bf2253fce5835f595ba0bf1f5fe2e7b41252e6fb9d210f48ffb46e5680a7afb55afed9c11bfdad1d2e6eca509efbf9aec18fdea7ecccbfb9daad9e77fe3fdfb4b0e3a69a234d0aefcbaaf3fcbb45a37845661aa3a17e2e1f5d7f4715fda7b56d14cfce6ac33f7e3f4f6ba7deaadbaffdce9c1a10eefcc7fed0a50df109b4a1fe6e4d297f65c74cc4a32323cbecf86416435caa6e8ba7efdae91ccbc579a53ba8d4dcc5e95df1a463ae4af9ceb428c80f0d753caa39a02fc6c07baed19c47af079ad8b6f4abb3dcdd07fd5de291a17d032eb09dabea6ae97babf7680dc22aeb6ffabc7ea744d6cbe65e0cb14edae1dbbb628cf6e4ff5b43302edb273c8df730f4091c343f7f4df98fb4f6d5afed6ca4f025709e6cb875d4685c7ce7ffcc3b9fb44d4f25ff6bbd3ed4b0b5fa6ad6b98d4ec1eb063c8becbd1b7f4a8afdfcf4caec88b0c8306fbfeadd0e62dd625eed22d85ff5cb1660ddb77d12bf4db53abdb7dfd6b4fb6abe66f0497d019dffb64f7df13cd277a2f5fbe88c5e65d57a1c5f8ecdf271aeedf1d48b657dbce412ea7f0be7b4c87b296ac66b084a47ea2d3d23cdb410cd94ecaa3af15cfd868d3f64eaceb04c72150741688bba935616a88efe625801df06f2f9c0c582feebc49f94d27eb6ce8121ebd9f52865f2fc21ef6e0a25b01d0d1efdcd306ecef2edced4cb3cdacc044bcfdee81cd7d7d617c99e6bc77b7d50b1da1f42dace1df516eefa77dbac8ba5c6d28fc537e37cfe1d20a9ac8dba11e60a5ffb4dabfda3ae6a36b5aaa15ac8f2fc02bf9b534b7caace0e938fef1dbd75dffbffc143b1abce29fe0dfa9fdea7eed22ef6fec7e09ab2c59d7cf2d911363a9a3bde9bd174dcb9f69a1b1ef19ef0aea516f8acfc5ac1083f048fe9761331cfc6eebbadab3a359c05bddc85e03a777cda2e5a5473c61a91241b1dbd8dc0bcd4c24a6a430db2bfb33c3a1b4e3cce8eeb76ead99d733caf6a55ebf42ab89698fc51a5e46aa4f24c3ccfcf78d4c58d9adbf9a81ffd8ffeec3f6a5ce1eb2118fcfae9f8f2adadf38a77a1bdd0bd34c97ffcc4ca81a17ae51d45bfe15f0facdeb0f95b8841fb90adafe1eef1fbcdada91aed2d98dea825df783172acdbf8cd3cd6cf924c933a4c95c028cf31be9fd6d23cfcd352e1c699ef1cc574cd9f419441f2c07652da974abbe9f638ad2c0bb8042a49f4ba66add2cbfbccbe2f79577cacdf49baedb3b7feac0ddcf4aeb33a1e98a0f09491fa6bcff5ddd5da99ddf10c485b513aad48a66a072b7ddee7c58cf973fada8a4a66eff816b0b6ee06b9c46bb04bea9b2ccafeaf01edeacdddd81fedb104a65bca7bbbf1eadda6b9da84fceac5ab0de34ac28aaefdeea7da626b3bc2a58ad8f2edfc20a1f0deea31bbae13ea2f79593d8eceb8c1af0f122274fcb6d56beff9f68b07fdd15cfa81208ddad89bcb033af8eba826f66d51b1fef2fcb0abcabe4c717abee6fe71e9bab0a80fc4dd337dc8eddb7ee3d05aac0e3e8fb0cdf3a6d951a8dbc5b4f9ba4f712af0d35ae25866caab76ddde931c0aa037dfcfa202defdbbcdd94af3bfdff6eac1c37e7cdeeaddadbd18b59ed8de85e2ee8bf2fdc63bef0cab71a66f5cd26b81dcd6cdb001ebb4fa204da0ddaeccc5aeb0cc7b18c9322a6ff3a400b1bb0efd1a07e782a7d7dbf747d1fb40a792b56f63cc78728e08baf5d24ca06ddcefeea2c88d11eb26c8e7dca5d5b7cdfb30dbeb50d6d7b8c75cd94dbeee8a588c4465b6cf62d2fc7fee82f896566afd04edf21d2b8bcdf40eedfba2e3b0b15bbc980b4d4bc16b0ecc5cac5cf8eedeb3c34ffdceef064ff534da6ff1aac7b6fd8992ab2fa1d9bc5cfb71da6cee3a2c49adefdd7f67ede1cbbeea7fb3aba19cbbf6e8eda74c115d7b09bb5d5cde2fe8a6d537adedfebadc7bef3cf6f16f76bf6faf00f3217a47669eb2949ff107ccd2f16bcf9c963090d711bf1bdffc55f0b9250c0a7f121cde228dca1a0c0ace0bfee7ace128b0aaf096e25fc6bb4b1a01abef9bdedd47d02245f6af722c3ab8c97e47dbeba79a9e3abd448f8e5f12a220c134ebcabeace61dcfebeaea4ed4a2f95ead3aaacc74f56fbd9557bf23a31b0c9d0adcfac82e78f402e115d6cd2b9a6e79d4463eb2c8ca04be44c1006eb57e4ad7f0c1dc79e6aae16464c1ed776204176d8efcbc0be1b3c4741cceebdf60e5411e42a3025543ee7784ceeba9b79bb709c5cf00fafc9e4fdeb5c6ab8c1a81fb5d734bc1e0b2a0936dc8c7fc03bd11df6feb92fb0b488394e84988d05df90cdb31c3d39ee7bc5f0a4ccaa82012f1a8fbf2a5cd1baabadc9c6fd9d779a4b285ccf889aa1ef9f1f4d6b1c69717e77df50e4dcaadcdccea2afa82dadf705e26e7d4e20a8b16ac68c51752f2c4c5f8baafacfce0ce8bc6fb9eba1bae433dc8bf27bdae2c9b69c2b61e514abc2961c02c38e8c35754faeac49135a8bdc6591cd2ed7fe640fa342b2aac12fc3b1fd32593ebd8be22fe1addbca8dfe0b3aac1ac943ef98f5ac86ef2fb9ec60ba4fd16cbf3aee8d8479a3ffe9fad9b60a5be6d8fd58c4c7edaebdefeec9b67f96caa34dbc3534bda2dba6daf2a49c3b13de67bd8707ae48ca1cbbeb60a60d34b3fbad943eea03c7cb60672a1d84034054f856dbc6ad506dacf1b61acd9cc632f33bc1b9f4066efdc6b2897973cc1ac7cce0d4e360466dafbca24abc58e737313b6c8aab7a3dbee50bdf4c774fcaacafcfb8a63b47de2e6e4a9adf093ddca35fe8baebba4c4a3e0c66834308b6b2ab8bc7792226987a9db6b1cd915aa91c1ab3ad1dad37cbeaf157b8deaec0d7e5ed4befaed02787cfcafc5eed9c61cccaad6ae650ecdfd74e91ba89bddfdfa7c0f28e4ad4e00a7ca31ab4bec1f9c5add8afefd4a64f8b57e1ffc70c2c8ed699be8c7668bb61f4cd481ea6d35f74da4cdf4d1af51bd15efc50def32fa27811ef83e8979f9934be286f0b0fbe118fa3c5e71ecbbbc22d1ea101afacb01f247a0c7dd3bb684a4a3b69b0f0c7eb5b5c6c648da0c9271775f86aee3e3b93ceb8921ab96cca16c2caff5150ab47a4ce52020be07ba95e425bc4d8d6fd3a8d8513c6ba0b06cd5d979ce53aa15d518d937cd0ddb2e1bd5faa84e6ecccaae78114071d7ddf4733187c4774efbb06beecc4ba788bdd694baac5cad6fb68a1b9ddc8e2aa198ce2ffdf9ab2080fdafea22209e0a71aec928951a81a4b3ad02bfcbfa2c0db01d7dc00abcc5c8daacafca661a56dc8178f1b9f2aacbbc5de4bffcbdcb1b03b22fabdb8fcd3a12af7dff9b50f1dd02d966a2bd9dedc5a99dbe441bb9615f801b822cd527b3aafebf331542ced74a7ccff4d4e06cee120ca1a8d57eaa7fde42affbfa86e089eff12b1ace39b32379103ff62ae6cd605c43cf6abda17bc0eeefbb5c5eefbb28f42d254ad70efe2b92ab1d4a5ae38d68ce85dfdd64ab0f1cc9ca024c33e363b0fae78c5abf6fdd1addccabc0310dfdaafdce06d689f4dcd47c4cadaffad9f3e5fb852c0cdfef8adf7a4ba59266c43fae9129439f8907a1963a603aaefaa8af99cfdf2712e4fbccef23fe9e8eca8ad02d281ab85bbbff66e54f2d47bf9cf51beacac9564c51622fd8be7a88b4fd472bf7c8f8e3c0663fe4f8f8983da1cb05e1df4f2ccdeaaa2fa2ef0e701bf4cb40940dd15195434dea41aea9199bd1c502ad0ce00aef63fa1f0a6b4adb145dd3cac5d1fa0d3bed20bfc4d6d7736aac0dfdccbea4336d5ac0beaeb0f9d2eef08161ee743fce9effad23eeafe7575ecdbb40ebbdbfbe86cf1e1f6afb2acb8edd237a615fee06ca1c532bceed6f1e3a7da2a2c90d24129cc0bcbaa86fad8c9b6f3c5d78c5d5cf04f6b70ec4e2bfb6eca58952aba0cfe558afed4fa6ffffc26922afd6e0ba2e5ea2ece8cb3faf3fbf4cc2ccb885d885c0c3bc786fbdec5dac7bc3aed0ddee33cdeed9acbb92ebdeca23b511d7040bcfdc7682cbce176dadbd87b0808def6ca1aefab93fd7bcd3fc5d88bdbcbe0bb763bba817ce6c2b5a0067be7f9eea2bccdaff1dabd16de5a6c7075b4ba1f0aa702be412ee78a9d95ccbce5b899efe7cb5ff31a0c57eab3aef23adc3dccba0ca24e7bc5b9757cacbda8b01aff12a3bb9a06e1d0fee0290fab8a3dd9acf29cff3cc337fd10ff054c9f5c861e1c4007ba2a06aeff882440c27ba69dcabc24c3572f622f6cf22a2fd65e8dafa12b6dabf638eeb2c4f9d34ad44a90ddd3b92fee60b48ec865a3fe2d63495eac94d5830eaa294cb34dfacc5fdece0b5e7cfb4dafdc3b8edebf68ffae260adf5e5d7430da7bdaa49959ee90d49fee2fc34f707accb8ef4dc0dec897234f4ceeeab5eac034332b760f9adef0cfdbf2ff82ff6ac3dd8f0e6b0eb9dcf6c757aff7c7e8dafd50f41d32cd37f3e970c7dea84fdc72fbb132cbb91c7ebe85039d89c5d49ee7fccafa91f6ece4ef31ccab37ba7b08652b8a577bfdccee631d8da190ce5bf9ad81a6eb4abaca34ce82d480d5a0c2e711215d9b9bea90f4c13470b1f983aca0fd2f7d6fce71eab7d03e0aeeeef8d42413de67be5a752e3cf08ebca9a0196f54abab5d2ee50eaffd2daee4f9696fb8a8ba5efb98386f651dc5efaed6c606b2f6fc5496e876d3d6f6bae61b23fc1d4fcab0bca53c65a343eabbb0a3cac08bc9eceef30bac4aef2ad38cbbef9ffb75ae6dcaa764aeee35e144bfbccacec8f0be9a233366f8bf3b968fcca0275d0e37fd2adbbd568d08108eebfdc51ef57fea3ce9fcde6e4cdc5188b3eccfc5e9a30c4aebbd2c5e06f5a34ce1820ea2b594573d61c9e7a369c8ddf1fc4edd56ebc13972b39d7f80dcad3a29e93ef4c93ac4441ff4aaf72d155d486df610e7baee5df0bde22d6dae1bad86e2c9e361fbfe38eee10a019e1a923b9eef2eeecb05e826b4c9bdf3f7bf67f1dfb24fb73fffd76ef6c0a7e2f36caddb5d130c74eeccc8af2edcd0fd3dd3beeb9808d84d3a8cf1b92f4e8a54ea63edbd5aa615e58ce3b9fba60dceecef1591bfeed7f4d63baefda1de2cb02bd508ab7f0768e253b91ccfb2a172bd6bd5be2c60841aaa079ad4ae9427ecfcbb9d30a8ebf4ae4ba3ee69c2fc008f7f2f9e3235dfff1720e675fedab8c727defadeb2afd923ddb12e8777fbabcbb026f771dc086ddcb56ed567eb2dd7c8851c71895a06d1f32ebcd0d8eafcab3d0c5aea0bdbb60ce1c1bffaadbbfa6bf65306fc396e587c333ad799a05d74e81c885c707d16def101bcfee1ab6ab5394f1d82ba9ed08aeab3a671dc4f3309e5daf554eb5455a7cecba68a3dfeeacde124ce1e7e0fbbb74cd59e907ed68feae6c0ea1decec8db3eeed273aedad0c2caffae1a0cd8fe0fe0baad9caf3aeeb12f20fd64fa1baf23e5ed3a35f49c7decadeab9f69598dfc6e7f7bd56ecf07ad3985c0faef18f5cbab2dfb067ad674339a7b03244edf6abadf2a42bfa8b80edc4edceaec2be6cfcc8ad455f0dfb901ce0a3c03bfeadfc4884fe70e385cfacde31ad28acfcd9dfa1fe4a2b9becedd6f777d3cbdb93daeb57bccefe3fecabe06fac40ff0acdda2ec0dbd4f1fcb3def5d7df7f7d30f3e1a0ecdbf75d7251fabf513edf1cfa2a423b217d325dcf9beeb5aee4bf647eb18f347fd7fb97e4cc5cda21e0b7b349ddacbbe7b8081dc7d26e6fb88b3e45fe93ced2a8dc009fec5df3ac23dcf3e5c910bb5f9cb3b57ef541ceb6fe3e7e00c425ff4caeaba96495cd9ca062b76aea40ec33cddbeacf2ff6fbefabe9cbde8ab8cfd9ef5cad692e114ca5dcb01ab3fdb68f33f8d337e2fb12a5b7ed4adbed12af4ccffbc8fa0bae4e8eee7a9a16bbd5d2ef5551dad1821db3c9c903dbfd2b2ef2c2b37eeddfef9d7a64a51b7c3c0d2cbaa6f2d8aec40a779e7fa66654d1dae1c858165f8d38fcf3fe6ed409166f6acc958d2edcb0cc56c5afecf2239662e648f2286a8f2f7eed95aa4dd3fbb3b8f5e5ec0bcdd9fd2db8d7822c11c27d0e74f5446ac64f84bdecdde71e9f92dbac88df844e74aac57f5de6324d412f7bad2cae2ac2b80b9dab56435d874bdd5e6aafe5a25af4d499c0afabc22c4cdae95caaade2a226b9ae028f1beabb6ac0b7756d8963e2a52fc7fd1f39eccaacc90947a0c7e5634d4b43bd0dc472aba281aa4cb935eb2fe5a9b5b6efe8aa7d1e0ae3be19c9cbed82b238dc0ffdab50990a74a960da8dab45cd168c85494faaeea079eedec2bf8e6f69942f86cf596caed8d6eaa8d7274c86b6ceff2acc0258b6ad8fcd6fb5ac854d7d88f3a9698d6641ea37baf3295be1cac4a4e5f48a7ec02dc2f47d3fcf92eecc2fcfc1fae1dbd6095db51ee1d2d4d984e270bfdfc574d3b2ee58a86e05f11df6ecdde958def8a2afcd3d6c354f7be2cf38fae5a79e4f5ca72d1ad1ad1aa6ab7a777df9a5e943c434ca8b56044cd4f5eff66b45fdeefe045903fe10cfaf9be4dee56a9ad4c9a4e7511af82de48e7f0ebea718df3ac44ab6c4b297b18899ea0b16cf62f764c0a5e9c9f44bb6acb9ac89c8d2b954a5b52ccdaaeeeb4c5032fb38aae1c5c6caef0ecfa7a5ccefba75c01727aea21bedfa1a63f4e64db4fd7ad1dc22cc174fada1472ab1ad54d56abb3cb8f3acb321cec46d72f8f6df65aaef2d078ce7ee51ef2f5f86c08dc39c93a20adfbde28c20fbdb3532ee114eae7c6f9c4557cc32ff10dbed3ccdb02d30caf4c5d2bfba699cd8beb58e0bfcec2139c97efde025abd03cadcb7a64c98ccf3b7ddde44bdee12bba0948ff014ac5e0ef5fbc99d61aba2f619cdca73fd51f0a98ab102a0f235ec4e2fbf552092dbe67d2bfc6cf6ed754acd38ebe426f763324c3d7dde410bbb8d6beabb376f2a5a5498fbdb4fdd7af47b2ee6ad2dec91091f119bda2cd5d2bf9848dfee78addedec8ba91900bacda4f1e2ef8b20a9a96683d4ef55c7bafdec1dca6c6faf65eeb8bce7de6bd0fe90e68ccae7bacfa4ecef9ab3c406fe0cf513e89399cb2a0c2357aecfe0ca3f1cc5aaff3d0ad9952b04ba1ec10846dd6c3eeaae3fedf87c731af12c25cb44d4ad13cbdd0c8fc10e4a43dbcbd82f462ba6fc5da36f346d17f37d7e165a73df3dba87b6d6e0ba57faed68a041bafa9936c4dbcf4582dfb2acabeaeacefa9c9d0a5b2fdfffa2081f9cceea236d4bd1c90ce7ddeedfd8dc85d4c5c07afabe80c0698ca3d6fac77d5eebc29a1ff9c59ff8dea8fb6a73d3636942f2fb1f563b53ed671664f181de6a226c6ebb28ab819ca4b6c6f55b7211f7dde5f466e6ebdcd3e5cd225cccebab2ec9c2cfcc0deae3939efbe46d7b35c8e76d4cfe0a6edd7dcfa2bbcdceb42e7c4ee0c4a9ef92c3ed321d456ae1ade9cbefabaec2a27b4ec9ababa1d9719e78bdf94bdbdcd44a9a5e1eaddbcecff26fcb6e2f5ad27ef05ef89c406eeead13e05e9efddd5b878a77cfe20adec5bdf0a73fff2ba44fd7cdb46b5cde5f44bddeabcc67f18d8cefead27bfa6ccd6079eaafce606e2dfbbe843f6fbffb3d17f1f96b4fdae3d4daa99471bf671fccd705adda3107fd8f3cfb658aacfb5eca6f8423eabfa1fdbed6acf34bc8c533cc2ecee43abe76438caf17fbade2ecd3fa0aac9a48cf5e38b6ef10d029c32fc2bcb7bbff932c924e9cd6dfa049fbb8eb0dbcf2cb8c3cdf63aa5cb0ccaadcc09accf5e5b6b965dbad6640e647cc6ebea50e28c1a1beadd4bad401b1b500e5a4cfef0e48b3bc4da3a0b24cb6d56acee0cbd2497aecd35cc3bca02bbdafcd91ef8777b5db1d99e810f0d86123af73427adfda303fffff42cead85ce1cd05eeecce67bf1f6314deb0ed53ee94f2dba9ba7eae9dfa24efadce3c1cc02dd21a3f3c4a4b9dbb2eaab942643dcfea091a10189ab760b3af8a81c748afa9c2aff55c84cfd3b5767dcea8e2da678e86dba19dc59603646a7d359052a4faddde4be3bab7715dfba0acf5bb3d017b9ce5f965df6b1dd4a2cf0bfebaa1a12611822a69a3fe0bc2db5183cb4cb1ef5ef3d8dae9fbbcfd7b43adade85d2df0f5fd0a6cefe4beca56c24e3a0ab89ce615aca99d7d71f46fc2cd9378eec70cfe6b3c8dedbb989dac7ef08c8fd8eecd11b42cdd9f9d14eaef31bbb08bb29b47badb0b3ecb4edc86ebebf3b9dbdde145dad1667c5af4de0f25ddd58f63efadfc7aa61ccbf874afa2a5aabe4faaccd4e9bb91eecde6017fdacf6caa22ec9a45070fa354e9107cdc478a76c3ccc0c8427f00a3cef30bf46cb272cb9bccef7ad4cd89dfaf12a428f37d0c1eaf7afacb75f00ae276df7a4aae9f34aceab3ae4a68c1348e2d4cbde0efd0d5abf8ae7dd3bc903875db7aabd3deecbfeee0228c06231ffdb6612c255dc4c3f4511da28b50fde56bac35f94eabf1aef9cdb9d7cc016bcbcaf2bd8eda8baf4afafc852878156c214dfb4e67457d7cbded0baeedd047b26cde5ac736c010d4fb82ed6ebebea5ffc3ebcda8e79364e93aaba15ce57c5f32fb37736b8abd8f273cf6bcd16181bd8c6f8fda5f18f32e0baad1c37f9cdbe4b99349bbadb5bd8afb9e8aee071fbae73ba3dfddf130ee0b971857d3fe2ff85f6de9f5d7bcb24faf9b12d87d7fbe92d0fa2a45bc64c2ed3ac188a11adfbf154fccb9f22c6fc881201bd0a5eefecaa07ed1bfa77dc8cb2e275a6b75cace71540d9443f2baffdbd9884c09c31feccf4abbdaaaa8bac2dc2fd14ac0ca392b8bb5ce858bb2e464abf42cabbaed8cdab30a838ec7c21157c3bfad2a05f733e07bbc8ff3cb6be9eea5fcc9e77c86cdafdbcadc4ae2cf1f452e2819f66cc0aa9efededf23ab87dc75ecfc0c3ddce3f674dada6b3e37e62a9b30966fdaa0967398fd20f43f7991bd7becacdf272feba25c878fa636a57a1ce0aee70d2ba934578b86f83ff7ae85b2f94abe3ecf17b8504cb0cd69dabe7b9bc5fb2f3edd8a1f200e2bb1fa5dffe29dffda2874fecd8efeaca4bc146bfe900ad7bbee435b116d25dcc801db28bfb5f7dac6cb882dafddb4acc24b6fee943527dac3375b9fee8a740709f87dfcbbebbd13cfb4fd243ddeaa4b440eb00498ca38c2ec7c1f86f28cb81b978acd242a50abdd0c3e39c736bf6e943078f38fc9bbaac113d8b5a43c1bf9d8ebd49d0ff2c7e186e05e0eea9108bf0a88c4dabb18dc053b283bcaa4b58c09f2fc0b1cb3bef677c2b128fc1fd93cfef88b7cf4ed0f18ac4ffed5f51502e89cf23ef421caafe26ee075ec1caecb18ecefceaa08fae15825c3d45e7bbcefbe7e5c35ff7ba94cce0bff3a5ca4f0bb597cd4ccb8de3baf9b44bd450b1a9e4f7dd874bce3985cc96ecde6fcb2e061efefac5a25bb38efa5699aa80d6affede86c1ed7794644cd30a7bad204303b87ba6f4d5ca9fc311fd77f9fbd0c5208affcd8089f30ecff3fe0a0cda6ec24ab444bcde7c7afe2badeaea39d6bcebd4d4efd8f54bb8ddc956208f1de9bd7d6921d3aadce53bc76eec9b74461afeecf7c09e3f3abd3bfcc9453eb17afa5d067f7728fbd7ca50f43fc11871b7f3d9c2e4642cdea1a0b8bdc00228ee2db71cef84d9194c0f9b1ebf54d02044ba9b9e8cd789c57ace8270bb61ddda87dcf222ec2ada3b7ac4b2a596daa1067b3448fac30f9db7a6bf9ba5cc7fdb2b491d331fdccfafb53df5dcf805dff6f2ac3178845ab2f9ca4b8ebbc3acdccb9da668deee5aa06216ebd342b7815ff8d6cef7fe34ddad84480c6696a1b4a31cfe7bfde03c0fc1c39fa3e37aa12fca9dc705579b898e7ad30a2ac7cef9bc2dadd432ff74b49dbfa42e22cdc21d0fb587f6ae7af9edb418aeeeb8c4a5d27f7549c81e6aa5495fe1acf1ab1adadadcbd186eba0a944edcceeeb4abd7bdba0eea3cb5ecd6e97bb43a9e52af99ece9eed20be67c9b8e376de2aa50941b57be0d8ffe9e4df8126b1bc67b79aec42aeb5cdbdbe006b7e3e9a79facff2bd07643c23b0ce4dcff1046ab88cbdd859179a5c565e4b3d1eb0bb3d3c854fdbe56a2d7af8ed1ee324c9f1fa66fee7ff1b1a90eb028cbd4fe9fd5adbb1e7251f0bd22e7e0a9cdb73b1ab01b847bbe4097eabea04ebdcb2cbadaceefbcfb1da5fdff6cae580a1714e95c1e3c103ccbfc2efec917d9bc3e3c26f399bedc5ca0fbce7c8e6fbeedcecd54ddbf9db8feb6d2bccc3018850cfbd7d2ab1dcae13aa2c6bd79cc74e7fac36d2d3839a01cece2d3bd53b9ec5f56e4e6eb8fca39d688b6b58feec3823c0788ddbdebff5afbfcee08dbcde9bd9ec2e0c371822ca6dbc5ec51324f486fa7b11fdfb1c99ffdcb77caafce1875cbdfcabf5fba7263a8c76ff0992cc83fd5cad43fefccf10b39e5a7cedec434547eeb3e48a07ca02f5cd57be8efdefda83acdbbafbdbd13aafced4aea4feba4df3a882dbf41de4a5f4bbbe6474ce691e3ee0e0e05ac2958dbdfd7cf7e16eb7e037edf47dacb2b3b06bb35feefa4ee3c73eb833de77fcff321fb41bcedada3f1aab6cd85da62823faac1bc73bd3b8721f2eabc8bcadc0d5bc2de2e05ec3904a875e2a2a35805ff70a8eb4ff13eb04e49b0783d62beebb3241b1d1dad63ebc56d9079c56cd3ab2aeafa7c4ee0cf5ff3ff86c3e4e6df11e0acecaf3beb04bcc3d7053227698aa3ddaea1de08ad8776cdab372cc7bda6cbce3f65c97d013acad0eaa7981aebb5b5c36dcaf5f7cdc384f0aa302b35920a9dc075c3c2b3dff2ab004d1efe5a6b4def6eec08dfe7fc0fe0d3c9a9be84d98dc4ee6d2cbb6bc1b3c4c5646e372a06ba2ada9e3dec09cb007aab1da0e0d0f0787bbbfaadf104c1bf5c0ef9298e14fadeafdc856edc1be403edfda4c4aaa5f4eee2f5b177ba1dafa14faaddbeab7dc8f528baa4add34ebfdad9fe887edfbb9ced900afeecc9ceebac50ad774dfff47f6fa45449c05da2e85188b641ff9dc1ea3fb71fa4bbc568e5e63fec961f2a68afcd121fdbbda3fea7fec4d04cce24c62e62ccae67e620ca1ab88c460e60e10159540e145ead922ffd9a8a76ac02bdac4f98bf4a7fe54b755b52e4add8ac79fd6cfe0dab24efadff0aa8b7f92bcccd9e1ceeaae7bed7ec2e0d71cdc66cf08526240cffb806d43c7df4a29c56b2f2c3d2affe0bdfbe2bf9b6efe05785ffaabc1f5ebc5abad9ce69a003fd0f3a7094f9af3efb8ad21e02ed38d04d4d50ce54a3e3100cbb66deaff5d448f8f284a69f84b08eb23ea795d4ceefcab22faafa4876e87c57dbc5eae173c1d3b1ce85ccfd373b3af89aaf1907ece4abe154c7dd530edfb3caaefe3e77d63e833499a3decbe0ecd9e7e837a7d37dfccefbf4a45bde3cf130bfbee741b3cb0f7c820cecbfdedbb97c6b628d6fb32eeea2ee6adab6b15025fcd2a3bb464ea8abaadcfbfddffeca93ba6ec2facfdd7a39cfc3c01ae4eb194eebc02a5efcdf16926e2b7fceead06bf912aab96ff45ca0208aef52d5cde4948a22b9dace24c53b2300b24f94d98ac3648e4c1abab319a9704ae038e5d5c29c0f4763026da2320aca7aa7cc932b3bbadbad3dacd6703a77cdc1cdaa8f410e98adda8bcff366ce2bd5a3f48cbef7cfa3ec7b4ae8fd3d8b846977bc9e2e6abd9a4b177ed10ce7da4accce3ebfecfbf4e5ba6ff3ec66538e1d23f2ef671bc02f66ae05fb42a2fe2b71a015e3e2054efb6bc083d68e7afda378a8de0a67baf2a8594b8150dead75beaddbcef7eed251a582df825af31adfe580d0bce73b3ee81cb42f1d4acced00c7beba6a5e4b2bdeeccf6fcb84a1dccddc736b45d3e85bbe7b71fcadda47e4fdcba2352aa21845b51db45baac3f7f4cfaf1eacbd8fc0f5b9878f09f1454d0bfb76abdd2efb73d7bbdb5f72eef42fc84bcddabbbe33a7c4b4ac179a3d0aba775dadcdc2aaecfce54501581c01cc7180f3f0b9aff2ca6e9ad3fad5c867c4ce298ff31a9cdc5fa6cf8c1bb98dbd742c7a97fac9fa8ff3bad5da4eca0b9d1e6edbef15c07bb5ce6a7bbbd0d7c4558744703055b9db759f6fdf26996d07aaecfe997dd1efed6b4692fbfccf0fc1ecc01da64303b2bdccee8812ac556798cf9e6077fd591f1353ca1b894b6d12fb86ddefefd03fefc04aebf2124aeabdc16afecabe4d0ff3fdcb3deb66ecbff31acdacd9b46a2fcaf1d3bcc8f80b8c5a6b91bfce8d5649dadd90eadc00f30a755f8bebb2f79799f9effda4f680d21ae8dc0d725a17dae3ef29a15ee0ce865edaae4130ce438e36b0912d7d13edcbd9c0b2fbbff66947f84b8c7985f45c7c363adb467deec13ed8ee3c0cee67222b074cec9bed0593ca35215bd1bcdcb30ffe509df0d2a0b98ce9f67d5fade6a6417dee7eb53efc4db8dafa8dde7257ded0cafadb5abdc6c1aedf85b1de4b9ba0b414e3f75aaf2a061cfa1e0b473feafaec6c0aad06f1de57af1b24a452cee64bd20f65cd9c20d800d987c45281b72fbbfffa552fb7ec60fdbee0b5af07ddcd4f11bdca2ae651ea7e8b335816ccc05ec2ab334fe4dafccb8a26bef4cbeec91bbaaccd0aed2cc7cf57984fb1fe713cc9783defd94fb62088fabc6a78bf2d922a139c9faddef06e3f9332d0a33696e3cefcfce8e871f1be8a0c710084a74cc7fd51eed4ff7bc0ab02a6b2267fe5ac8afdde8d8ec695dac3d40eaa2247db93d87fad8c14a7c4fedaebeb7db1c1938e56436dfbc3ddae38e7df2fb0cc9f9581bc7adfbebd20eab369865e12e4f9aa71a0baf95dcbc46c6cfee2edc9eb220a8e4bbe28faab6e78aacb719fbb0332cdb36fa11a85abbceb45b8faa70f5d1dc66e8abba541e6bc2ffe823fb4ccfd967eedba10cbc740c6ac98aef2e2d346dfd27eed90bdfcaee33af6ed582a3f1df8d10e9cefe391dc3990cb4bf8d6a7ad3cdfd2faf01af4bb27a5ec3dedc325b8cdbeacfefe9c3bfefb9e3db4ae1a48de084e28dedbbfe8e4cf17ea8eb8a1e1d42dae8f934588beb1db67eea39b1bd42efca62957f23efedc41fe4c1c6bc85c06f587f7fcdfd7c0ab26ce90c03faffe6ea9dd603dbcf295b2a1ec4e27ad68975a5af3fdcb90b4bac46de6d90f6a6f6abc83b0cf75956d78fd1360d66bdb5fbc436f79c3c6605b952e6684f659bb1f4ddb5eeb5dfe51bf84b1b9fdd430700ec1b99bfab5e8124574ec46ee6c10eb7583ccd5c6dddf72455fd12facabacbca6d180cd7fecf723abae81bcbab6f9eb76475fad45c2056cebdfd176a5a5eac5c7c6eeec41edae47c6b1102f86c3cecbba6d6b2cedcecfb9cd200fee97fdfefef3ba9abef31f4c0fc6fa8e24eecf75ffde2d582beca15fd1ca913928ab83fa4b4e6e28cb62aa6bf80adbfb65b0a704c3fdbb1f0a8ac8bb1b6b6dffa6df2bd6d3efa39ec0952f5c3fecf437cc55711cbcc6ede7c7898b6ed447c08c8ede0ecde7fad90f678aed85cb0346cb1088c25c4b7eeae0d1e438f9bc5cb45425c8fddf8ba56ead6af77dc6bcd3e0daf5b948e59fbdc36b73177f04a4afeb4e6bdad1cdaafb40df2e6f1deece30c6117c508fef3534c1fb1f3aaceb39cbb74979384ed055b72a85dbaa3189ef6eeab5ffefe996de18ebd40b6a21de4fde8cf2f5e75898adf318fd96b3e01e3d8d6c5aad06cd0afa0ba82fe0f8ce6bf71ff9d17fcc59c64c15d2a0eb8dcee16e5972e8c40f1bbfdca8bc8dac94c8b428e5be1c7e7fde50d106bc7e7cd09dfcfdbdad09ecb5d0bb79ecc6b785e27a4ddfafa9ceedbcdd38ec603ba1a1bccceca68a097ee218be5a6f63a41dc8fa3ccf3f2d6b1b79f4b7a638a7f5aa0bbbac0b0200aa96ae47ccf6c7c10b78ebbaaa822a0a6323ec72943c3294bec0cf08ff6c6d4bed4adaaeac5be0a6df35870fcabd1d393ae8c5bd7c3f3f7f3d6519333daca54bbcaef804cf1fbbf1d7a3e556cdce4b57a5c91fcd0a95ddaae543fa5493cefafdcafb63f9a7850bd4cce63dea2e63febaee42dd3bddd6eedceab304bbcb3cb5e3a58fa3aa704ba23afb1cd7ed8ff9909b70a1613c1fffdaaa130e89cb12b597befa680c6ccbbdf1d2b9abf9eaf2ba697fc9e1a6340bb33fd6be11c08c5eacafe991bffe926f4d6e4de7ba94fdff5b8bb3cee0aeb6187c68d8cabc8bed77ff54a8ed3ba87ed96dd1098ed8481bfad3219dd096e1140b3eefb6c07bccb6f5d2a9f4ffcbf57cb1831ddf0db3b346f0dc4232a9a0fdc4ea3bfbbbe94cb49b4ab6a01c116e9f1c3322d3121fe69cca90c0fee37dce6d4fec6e9c2d6d25ccd466bd909e9d97e5ddde0b96d8adbfd6f332ad3c293af5dd9dad3e8ef688c63eb28d3a6f83afbf4babbcd716405f6e7edc143d0bfa0effb0d6ab915c859de5d81f3e4cbd9adfdcb4dcb890f37bc1c1b7ae9d1f2cdd432e2d72264d9ff07f67ceabdeceab22c50748e622ecae1d09cd1abcfd5fafd6ac363deaaa4bbfaabd961abbd9d0c4ee96dcfc2d822e51c9a825b57421afbbd628320a5ca8f0cbbeccebc625faef878fa7eef12f6fff1abe57fae1683675a9efceaead868ea073111a64cd5eeadc22bc6fd3fcfca1fa3bf96e3ee5c1895ada074d137da81aacabe458e20f50bcad7802eaacfcb88fb45438bdbfb486dc65f030fd276e2707befcbb52e73731eac048a15ec4f80f7a27ecedb56ece7ffb32cec16d2a1e3f063fd75ae27abb39cd3d22989acaa95e71838374ca6d53a3ab7deab3d9aea4b9ef9e8ca74fffea033baa4b6fc0dd4489ca20661f2c0f28deefbfb2ec5fce3f4beaeb43f3aa4bd1b9faac40ddb40ebcead9605ffefb11b2c4da67742fa6579e98fbbc23a22096ccc51927c94d0a755f305cddc442c1ce45dca3d9c611950dc4fb546daafa8c0bfacfcc552cc3bac230b3ab026caae8605b7cff6f3d0ad8edc443ef9c6c4a875dc1a686ebcdecfcafe8fca0af3d2b479a5ad3c02eca591b82c216cfa77ec77a5c12e2f6d9af38cfc9e0dc7d6cb32e1d9fcc0ada8f87ed40a0d4b2aba8c4b0aede373f6ee4cd971ed58eabbe4fc8df5443c0ee6ca316ba7dcdb74bfd2d68800faf06fe0dff116435acbd7ca6f6443dd29daad8ecad53f9dbe739a6c1b22f68764aab7d95cbf29d4fdcec6f9ba68e90edd2fdc909a81dd70c6efdfe17d40f64a91d1b6ce5f7c3cacba0eb4f3b76041e0d1c83e4c7040e74dea76b47fff1ba937eaeabd23db6aeacff59b27b3bf866b5fbceb13f746b04ecb558d8fce4aa5ceae865027f0ee5e0a58b81ac800f3103cabd47dd9ece5066bb9bc7a35ba29bb5ae533ac8bfc4d55b2fe3ba625e18ffb4c9ba17becd16bad2fc3fe49fa3cf1dc1a5cafdff89edfada53a7a42da1677e1c7caafdfad6eadfcf82bf3babaeeb5fba82cef5302cbdc733afae5ab95ef2cf806c1e623f5f9a027ded2dea55bddbef07ea8c339af3ad555a9c2de41b100fdd51fa3b1ab619a6c1db0a948a81927caefd167de40dacfe10eb00e41bdd70810e46c187d42360edeae4acbdccd31b5cf193662a7d96d149ae32bdeb42ebbabd4401b3fc5eb8e8f0371b1baf04b0edc8eaebfb3ca9acbabdf9bcb49bcc19bdfb4cdce9d3ef6ffdc8e5e2a99b4e7fbabfaaea8edd15df5aa1baa64bfef64120bdb6ea46f20f420e80951cfe7eaa8474be0abcdf7f6d5cdfe38ffc15fcff33cbea93a9c2befe4ead1a50c9e985feffc9ebabdc4dda9629c8ef77b6d9eb31a5b4b0784df9f579e9ac7dfdf7a71ff180b2dff4bbccfc6fc5e8b0c1e628d9dd20fed1206c1caf21efacbb290bfbe63b4ba3ce6abfb6a78fd2f6ccda6245d6743b8eb479eba54aefe5feededd05d0deb37a1c01e49a683efb59ed8c614dca9ddededcee87bb44de12aa95a4d15e4b3f7beb5ab1993f4ffaf4d0af5bed4e48b0faa5ebadffa17b6805f922b321bdd90fdfbdfa252f0a38a33f7ffab488dcb77beaec6da837c5dced7dad0bafe5ff2a8adcca702dbb9a161da47a75b2dd28cafd552801ddd17dd3e81eb9eea248dd5ffd24bdf11e31f077b4a14f509f3506abfb1a0d0ba73c43019a5c9ec3c14d9c225db893dcbe90eec0da2a943618fc0f8c8bd4fab3c8e8f78db7cf0577a2cd277feab5e3615eacb1fdb19b6dc87dcd416eaee3ded0b1b1eae6c7ec6ceb5af78aa450c6ac5bc1968c8ac7ef2e3d8bebad8b9b3b7917a8ba21adf791a6b64fa6fd7ccb4dbfc1879ebbbef81f3ecc2a572eecab07aa69e3c149f214226acefb2a2ecc9e1edef14f3b8b16ea25ec3dedb444e3c4ffd6f400baaa359cb1dbc5a6a53fc6f0ada76b82ec5e548f4a931dccc6222afb4e80f136f94a3c060add59acacfdc4681669ad630a1e2dc6ad80aa39f66bbf792b815ab81b1dcc3dab56cd9e63adfb6ddd657463b646febdbe6a2dfc0eef6a48b15facaa916a67276bd80acba49a94cc3f0dddde8bd4c145c0aabdf6dfeacfea4c28d48dbaecc5cc57cbeee9dbeef3fea8c690cd3a1ab186cd408fdad3933cb0a09e538e9bdbe74ddde4ee2f9092c48f02e1696f63996d5026fa0c7779e5fbdef855ccfdead6adfd1a607a4e1a57c6f224c37f2fccb6f7bfec4683d4437b9b2cc79f36c9f46f2f5fcff4fcc4c1838bd239a841c8d55a0621e3deb40cebee39c0dbcf449e700be94dbaf9f4f05df2b03fe4dd1b685e66db7f3caf1cedecdd59ecfa4d962322cb22b7d8c03dfbd6f6cb81ab59bf6b244cf44ae62f6d5acc1b63edd0fabf3009fb1ef628b3d93b8ccb21abefc56c80ea4fd11baf9312f89ebed4fbde84adfaddbca67d7aaedef4ecd4aa183dfcb9bdecae95bdf53f8fc2249f0a46ebacc4aa97b38deba4babfcbc46aec62cbbbfd00c8b495ae08f35ebd7b9c15ea1eb891d86eddf6a5d5ed35cdf9ff927dace9ded8552afbbc2ed0dfa529e2eac4035cd1baaf30da5ccd2bac641c3e3b1949e7f43ee0b87dae4041bec27ccdc9de3ef0a6d1ffd3d0fb90a7d928f34f8ad4ba9bcaf06a235cbf2daee3ebb51bffda3f9fb3dddc5ebacba70f6fcab975caa3aa4734e2903d1e5e4366eedea4f7ffeac7bebfe4149cf40ff2cdc891effe0a3e04df0ae8c8fa3eec8a454eedcad054ce9d9b7a53aa7a6e7abe1aabbe0e5a9cebdfe84ce2aadb032a6cbeaf1eba9cfdc3edbfefd9e7e1ce03b5df6b6a2c51ffcb418e55a6ef20ef90633a6d28feddbcea97cd7dfdc1e6e93ef4ce31f6aee4c5cd6bb32b182ecdaba0d4e45cebb891b577ddfcd2ba0fbdbfd299a7bbc6d59e9c9c097aa1101de62b5ba3b89bf377ab6f70e6ab7cef299e8dafb3e330d6eeaca2b46db67dad437c243afd8afeb1a0ead24537e4a9e9d2dbeda9c908ac67426a0d4acd17b7bc11c6080d552dc16cbb67f0db4ccd68553ae912ac939e9deba4c69ca738dcb12a8bcdbfe95ffec9f5f4dabffda121f99dfcacecfcc17d2abea440ec17b6793cc081d3aabc89fb661a0e57ec58dfd5bd5d0fbf66acfbbf26beaf3daaf0baab9cd7df7f5e7afefcb4704d7fb60467dc061fc214fed4b1c08f6d21aa802c0bf3cfe457d6fc2edc0ed0aedb3760afa8beb805f2c51ffea55bacdb4e86a909afdfe4db9b20cafddaa65c3f13da4ed20c45f7e7d39ecf5eab2b760def3bf6aac965e7c72ffd5e4aa0fbfbd869b36febfd82bc97a7e9dfffcd7450aed29d87b4bed8cae3f1147ad2bbe705bc97dcbd8ac712e165bc13f3cdc8ffd693f335b3dc332adc9ef0c0a05c2d271da6da5cceb2f4af6978f21bf5dafbd8f2bcae8d302ac5bddab528aaf1f3eac5ad45bafcfa36d0d0f2adebbccf13c09a4bbf1edbf` diff --git a/beacon-chain/rpc/eth/shared/testing/json_mainnet.go b/beacon-chain/rpc/eth/shared/testing/json_mainnet.go new file mode 100644 index 000000000000..965d0127134b --- /dev/null +++ b/beacon-chain/rpc/eth/shared/testing/json_mainnet.go @@ -0,0 +1,5 @@ +//go:build !minimal + +package testing + +const attestationCommitteeBits = "0x0100000000000000" diff --git a/beacon-chain/rpc/eth/shared/testing/json_minimal.go b/beacon-chain/rpc/eth/shared/testing/json_minimal.go new file mode 100644 index 000000000000..858dbeb3ae10 --- /dev/null +++ b/beacon-chain/rpc/eth/shared/testing/json_minimal.go @@ -0,0 +1,5 @@ +//go:build minimal + +package testing + +const attestationCommitteeBits = "0x01" diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 26453a39ca86..7056133ec320 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -149,6 +149,7 @@ ssz_electra_objs = [ "PendingConsolidation", "PendingPartialWithdrawal", "SignedAggregateAttestationAndProofElectra", + "SignedBeaconBlockContentsElectra", "SignedBeaconBlockElectra", "SignedBlindedBeaconBlockElectra", "SignedConsolidation", @@ -156,90 +157,89 @@ ssz_electra_objs = [ ssz_gen_marshal( name = "ssz_generated_phase0", - go_proto = ":go_proto", out = "phase0.ssz.go", + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = ssz_phase0_objs, ) ssz_gen_marshal( name = "ssz_generated_altair", - go_proto = ":go_proto", out = "altair.ssz.go", + exclude_objs = ssz_phase0_objs, + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = ssz_altair_objs, - exclude_objs = ssz_phase0_objs, ) ssz_gen_marshal( name = "ssz_generated_bellatrix", - go_proto = ":go_proto", out = "bellatrix.ssz.go", + exclude_objs = ssz_phase0_objs + ssz_altair_objs, + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = ssz_bellatrix_objs, - exclude_objs = ssz_phase0_objs + ssz_altair_objs, ) ssz_gen_marshal( name = "ssz_generated_capella", - go_proto = ":go_proto", out = "capella.ssz.go", + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs, + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = ssz_capella_objs, - exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs, ) ssz_gen_marshal( name = "ssz_generated_deneb", - go_proto = ":go_proto", out = "deneb.ssz.go", + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs, + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = ssz_deneb_objs, - exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs, ) ssz_gen_marshal( name = "ssz_generated_electra", - go_proto = ":go_proto", out = "electra.ssz.go", + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs + ssz_deneb_objs, + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = ssz_electra_objs, - exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs + ssz_deneb_objs, ) - ssz_gen_marshal( name = "ssz_generated_non_core", - go_proto = ":go_proto", out = "non-core.ssz.go", + go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", - "//proto/engine/v1:go_default_library", "//math:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = [ "BeaconBlocksByRangeRequest", @@ -313,13 +313,13 @@ go_library( "eip_7521.go", "sync_committee_mainnet.go", "sync_committee_minimal.go", # keep - ":ssz_generated_non_core", # keep - ":ssz_generated_phase0", # keep ":ssz_generated_altair", # keep ":ssz_generated_bellatrix", # keep ":ssz_generated_capella", # keep ":ssz_generated_deneb", # keep ":ssz_generated_electra", # keep + ":ssz_generated_non_core", # keep + ":ssz_generated_phase0", # keep ], embed = [ ":go_grpc_gateway_library", diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 570dbbd6a2ad..585864c4ab44 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 84572d8fa233c45a41477bced891ee355cc1745ae0fad290f110b7f6b5ed12e1 +// Hash: 502599304fd370b8602d212eaf1956fe5bf034fe59c75d1a3a6e3db8bcde291a package eth import ( @@ -30,20 +30,20 @@ func (a *AttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { return } - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - dst = append(dst, a.CommitteeBits...) - - // Field (3) 'Signature' + // Field (2) 'Signature' if size := len(a.Signature); size != 96 { err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, a.Signature...) + // Field (3) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + dst = append(dst, a.CommitteeBits...) + // Field (0) 'AggregationBits' if size := len(a.AggregationBits); size > 131072 { err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 131072) @@ -82,17 +82,17 @@ func (a *AttestationElectra) UnmarshalSSZ(buf []byte) error { return err } - // Field (2) 'CommitteeBits' - if cap(a.CommitteeBits) == 0 { - a.CommitteeBits = make([]byte, 0, len(buf[132:140])) + // Field (2) 'Signature' + if cap(a.Signature) == 0 { + a.Signature = make([]byte, 0, len(buf[132:228])) } - a.CommitteeBits = append(a.CommitteeBits, buf[132:140]...) + a.Signature = append(a.Signature, buf[132:228]...) - // Field (3) 'Signature' - if cap(a.Signature) == 0 { - a.Signature = make([]byte, 0, len(buf[140:236])) + // Field (3) 'CommitteeBits' + if cap(a.CommitteeBits) == 0 { + a.CommitteeBits = make([]byte, 0, len(buf[228:236])) } - a.Signature = append(a.Signature, buf[140:236]...) + a.CommitteeBits = append(a.CommitteeBits, buf[228:236]...) // Field (0) 'AggregationBits' { @@ -139,20 +139,20 @@ func (a *AttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - hh.PutBytes(a.CommitteeBits) - - // Field (3) 'Signature' + // Field (2) 'Signature' if size := len(a.Signature); size != 96 { err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(a.Signature) + // Field (3) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + hh.PutBytes(a.CommitteeBits) + hh.Merkleize(indx) return } @@ -653,6 +653,215 @@ func (i *IndexedAttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) return } +// MarshalSSZ ssz marshals the SignedBeaconBlockContentsElectra object +func (s *SignedBeaconBlockContentsElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockContentsElectra object to a target array +func (s *SignedBeaconBlockContentsElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(12) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(SignedBeaconBlockElectra) + } + offset += s.Block.SizeSSZ() + + // Offset (1) 'KzgProofs' + dst = ssz.WriteOffset(dst, offset) + offset += len(s.KzgProofs) * 48 + + // Offset (2) 'Blobs' + dst = ssz.WriteOffset(dst, offset) + offset += len(s.Blobs) * 131072 + + // Field (0) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'KzgProofs' + if size := len(s.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + for ii := 0; ii < len(s.KzgProofs); ii++ { + if size := len(s.KzgProofs[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) + return + } + dst = append(dst, s.KzgProofs[ii]...) + } + + // Field (2) 'Blobs' + if size := len(s.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + for ii := 0; ii < len(s.Blobs); ii++ { + if size := len(s.Blobs[ii]); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) + return + } + dst = append(dst, s.Blobs[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockContentsElectra object +func (s *SignedBeaconBlockContentsElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 12 { + return ssz.ErrSize + } + + tail := buf + var o0, o1, o2 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 12 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'KzgProofs' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Offset (2) 'Blobs' + if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Field (0) 'Block' + { + buf = tail[o0:o1] + if s.Block == nil { + s.Block = new(SignedBeaconBlockElectra) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'KzgProofs' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + s.KzgProofs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(s.KzgProofs[ii]) == 0 { + s.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + s.KzgProofs[ii] = append(s.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (2) 'Blobs' + { + buf = tail[o2:] + num, err := ssz.DivideInt2(len(buf), 131072, 4096) + if err != nil { + return err + } + s.Blobs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(s.Blobs[ii]) == 0 { + s.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) + } + s.Blobs[ii] = append(s.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockContentsElectra object +func (s *SignedBeaconBlockContentsElectra) SizeSSZ() (size int) { + size = 12 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(SignedBeaconBlockElectra) + } + size += s.Block.SizeSSZ() + + // Field (1) 'KzgProofs' + size += len(s.KzgProofs) * 48 + + // Field (2) 'Blobs' + size += len(s.Blobs) * 131072 + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockContentsElectra object +func (s *SignedBeaconBlockContentsElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockContentsElectra object with a hasher +func (s *SignedBeaconBlockContentsElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'KzgProofs' + { + if size := len(s.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range s.KzgProofs { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(s.KzgProofs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (2) 'Blobs' + { + if size := len(s.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range s.Blobs { + if len(i) != 131072 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(s.Blobs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the SignedBeaconBlockElectra object func (s *SignedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) From 7c213ce161cb929659c9cd96c7bfa08bcd8ef820 Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Wed, 21 Aug 2024 21:34:35 +0530 Subject: [PATCH 262/325] feat: implement `PayloadProof` function (#14356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: implement function `PayloadProof` to calculate proof of execution payload * remove comments * feat: implement function to compute field roots of * feat: implement function to compute `BeaconBlock` field roots and add tests * fix dependencies * check if interface implements the assserted type * fix: lint * replace `ok != true` with `!ok` * remove unused parameter from `PayloadProof` * remove test and move `PayloadProof` to `blocks/proofs.go` * remove `PayloadProof` from `fieldtrie` * replace `fieldtrie.ProofFromMerkleLayers` with `trie.ProofFromMerkleLayers` * Update container/trie/sparse_merkle.go * update dependencies --------- Co-authored-by: Radosław Kapka Co-authored-by: Radosław Kapka --- .../state/fieldtrie/field_trie_helpers.go | 15 ---- beacon-chain/state/state-native/BUILD.bazel | 1 + beacon-chain/state/state-native/proofs.go | 8 +- consensus-types/blocks/BUILD.bazel | 1 + consensus-types/blocks/proofs.go | 73 +++++++++++++++++++ container/trie/sparse_merkle.go | 15 ++++ 6 files changed, 94 insertions(+), 19 deletions(-) diff --git a/beacon-chain/state/fieldtrie/field_trie_helpers.go b/beacon-chain/state/fieldtrie/field_trie_helpers.go index bef64470976b..9d6585005d00 100644 --- a/beacon-chain/state/fieldtrie/field_trie_helpers.go +++ b/beacon-chain/state/fieldtrie/field_trie_helpers.go @@ -14,21 +14,6 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -// ProofFromMerkleLayers creates a proof starting at the leaf index of the state Merkle layers. -func ProofFromMerkleLayers(layers [][][]byte, startingLeafIndex int) [][]byte { - // The merkle tree structure looks as follows: - // [[r1, r2, r3, r4], [parent1, parent2], [root]] - proof := make([][]byte, 0) - currentIndex := startingLeafIndex - for i := 0; i < len(layers)-1; i++ { - neighborIdx := currentIndex ^ 1 - neighbor := layers[i][neighborIdx] - proof = append(proof, neighbor) - currentIndex = currentIndex / 2 - } - return proof -} - func (f *FieldTrie) validateIndices(idxs []uint64) error { length := f.length if f.dataType == types.CompressedArray { diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 85de3ebd0aeb..9e24c64e914f 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -67,6 +67,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//container/multi-value-slice:go_default_library", "//container/slice:go_default_library", + "//container/trie:go_default_library", "//crypto/bls:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", diff --git a/beacon-chain/state/state-native/proofs.go b/beacon-chain/state/state-native/proofs.go index c08fcd8b29ed..c1b12c4e388f 100644 --- a/beacon-chain/state/state-native/proofs.go +++ b/beacon-chain/state/state-native/proofs.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/fieldtrie" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" + "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) @@ -56,7 +56,7 @@ func (b *BeaconState) CurrentSyncCommitteeProof(ctx context.Context) ([][]byte, if err := b.recomputeDirtyFields(ctx); err != nil { return nil, err } - return fieldtrie.ProofFromMerkleLayers(b.merkleLayers, types.CurrentSyncCommittee.RealPosition()), nil + return trie.ProofFromMerkleLayers(b.merkleLayers, types.CurrentSyncCommittee.RealPosition()), nil } // NextSyncCommitteeProof from the state's Merkle trie representation. @@ -74,7 +74,7 @@ func (b *BeaconState) NextSyncCommitteeProof(ctx context.Context) ([][]byte, err if err := b.recomputeDirtyFields(ctx); err != nil { return nil, err } - return fieldtrie.ProofFromMerkleLayers(b.merkleLayers, types.NextSyncCommittee.RealPosition()), nil + return trie.ProofFromMerkleLayers(b.merkleLayers, types.NextSyncCommittee.RealPosition()), nil } // FinalizedRootProof crafts a Merkle proof for the finalized root @@ -102,7 +102,7 @@ func (b *BeaconState) FinalizedRootProof(ctx context.Context) ([][]byte, error) epochRoot := bytesutil.ToBytes32(epochBuf) proof := make([][]byte, 0) proof = append(proof, epochRoot[:]) - branch := fieldtrie.ProofFromMerkleLayers(b.merkleLayers, types.FinalizedCheckpoint.RealPosition()) + branch := trie.ProofFromMerkleLayers(b.merkleLayers, types.FinalizedCheckpoint.RealPosition()) proof = append(proof, branch...) return proof, nil } diff --git a/consensus-types/blocks/BUILD.bazel b/consensus-types/blocks/BUILD.bazel index 1cf938c92152..30b4ff0cc1f9 100644 --- a/consensus-types/blocks/BUILD.bazel +++ b/consensus-types/blocks/BUILD.bazel @@ -18,6 +18,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks", visibility = ["//visibility:public"], deps = [ + "//beacon-chain/state/stateutil:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types:go_default_library", diff --git a/consensus-types/blocks/proofs.go b/consensus-types/blocks/proofs.go index b3181da579ce..34e0f394a055 100644 --- a/consensus-types/blocks/proofs.go +++ b/consensus-types/blocks/proofs.go @@ -3,15 +3,23 @@ package blocks import ( "context" "encoding/binary" + "errors" "fmt" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/hash/htr" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" "github.com/prysmaticlabs/prysm/v5/runtime/version" "go.opencensus.io/trace" ) +const ( + payloadFieldIndex = 9 + bodyFieldIndex = 4 +) + func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) ([][]byte, error) { _, span := trace.StartSpan(ctx, "blocks.ComputeBlockBodyFieldRoots") defer span.End() @@ -172,3 +180,68 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) return fieldRoots, nil } + +func ComputeBlockFieldRoots(ctx context.Context, block *BeaconBlock) ([][]byte, error) { + _, span := trace.StartSpan(ctx, "blocks.ComputeBlockFieldRoots") + defer span.End() + + if block == nil { + return nil, errNilBlock + } + + fieldRoots := make([][]byte, 5) + for i := range fieldRoots { + fieldRoots[i] = make([]byte, 32) + } + + // Slot + slotRoot := ssz.Uint64Root(uint64(block.slot)) + copy(fieldRoots[0], slotRoot[:]) + + // Proposer Index + proposerRoot := ssz.Uint64Root(uint64(block.proposerIndex)) + copy(fieldRoots[1], proposerRoot[:]) + + // Parent Root + copy(fieldRoots[2], block.parentRoot[:]) + + // State Root + copy(fieldRoots[3], block.stateRoot[:]) + + // block body Root + blockBodyRoot, err := block.body.HashTreeRoot() + if err != nil { + return nil, err + } + copy(fieldRoots[4], blockBodyRoot[:]) + + return fieldRoots, nil +} + +func PayloadProof(ctx context.Context, block *BeaconBlock) ([][]byte, error) { + i := block.Body() + blockBody, ok := i.(*BeaconBlockBody) + if !ok { + return nil, errors.New("failed to cast block body") + } + + blockBodyFieldRoots, err := ComputeBlockBodyFieldRoots(ctx, blockBody) + if err != nil { + return nil, err + } + + blockBodyFieldRootsTrie := stateutil.Merkleize(blockBodyFieldRoots) + blockBodyProof := trie.ProofFromMerkleLayers(blockBodyFieldRootsTrie, payloadFieldIndex) + + beaconBlockFieldRoots, err := ComputeBlockFieldRoots(ctx, block) + if err != nil { + return nil, err + } + + beaconBlockFieldRootsTrie := stateutil.Merkleize(beaconBlockFieldRoots) + beaconBlockProof := trie.ProofFromMerkleLayers(beaconBlockFieldRootsTrie, bodyFieldIndex) + + finalProof := append(blockBodyProof, beaconBlockProof...) + + return finalProof, nil +} diff --git a/container/trie/sparse_merkle.go b/container/trie/sparse_merkle.go index 6fbb3dc3a9ee..4aea824fba3a 100644 --- a/container/trie/sparse_merkle.go +++ b/container/trie/sparse_merkle.go @@ -259,3 +259,18 @@ func (m *SparseMerkleTrie) NumOfItems() int { } return len(m.originalItems) } + +// ProofFromMerkleLayers creates a proof starting at the leaf index of the merkle layers. +func ProofFromMerkleLayers(layers [][][]byte, startingLeafIndex int) [][]byte { + // The merkle tree structure looks as follows: + // [[r1, r2, r3, r4], [parent1, parent2], [root]] + proof := make([][]byte, 0) + currentIndex := startingLeafIndex + for i := 0; i < len(layers)-1; i++ { + neighborIdx := currentIndex ^ 1 + neighbor := layers[i][neighborIdx] + proof = append(proof, neighbor) + currentIndex = currentIndex / 2 + } + return proof +} From 2fa3547644f6523d88a160f9c21dcbfbd493ae14 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 22 Aug 2024 09:03:48 -0500 Subject: [PATCH 263/325] Update spectests to v1.5.0-alpha.5. Copied from #14352 (#14368) --- WORKSPACE | 10 +++++----- beacon-chain/rpc/eth/config/handlers_test.go | 2 +- config/params/mainnet_config.go | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 19948e919b08..03fef7769878 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-alpha.4" +consensus_spec_version = "v1.5.0-alpha.5" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-sSw6c9IR/ZiWjyk1cbfVGC/aUkId4r7+eSl3haWsq0E=", + integrity = "sha256-R9vG5HEL5eGMOAmbkKfJ2jfelNqL5V0xBUPiXOiGM6U=", 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-OGlKhbA6TjTP0p1ojXVCJPzLEHJzewKkhAa+PQggoiU=", + integrity = "sha256-AEIiEOlf1XuxoRMCsN+kgJMo4LrS05+biTA1p/7Ro00=", 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-ah2Gj4ci5hw5vQgpUWkNjEQutoBCepg5jcpTi0DKVB0=", + integrity = "sha256-LH/Xr20yrJRYnbpjRGupMWTIOWt3cpxZJWXgThwVDsk=", 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-I+llAsIF6lPP8RUtZ2DFsJqtCs4UPh+st3hFs12FWpY=", + integrity = "sha256-mlytz4MPjKh0DwV7FMiAtnRbJw9B6o78/x66/vmnYc8=", 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/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index 080082e35e6f..b7bec05faada 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -488,7 +488,7 @@ func TestGetSpec(t *testing.T) { case "MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT": assert.Equal(t, "256000000000", v) case "DATA_COLUMN_SIDECAR_SUBNET_COUNT": - assert.Equal(t, "32", v) + assert.Equal(t, "128", v) case "MAX_REQUEST_DATA_COLUMN_SIDECARS": assert.Equal(t, "16384", v) case "MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA": diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index d15c2333d6fc..1131c9823b05 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -276,7 +276,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ // Values related to electra MaxRequestDataColumnSidecars: 16384, - DataColumnSidecarSubnetCount: 32, + DataColumnSidecarSubnetCount: 128, MinPerEpochChurnLimitElectra: 128_000_000_000, MaxPerEpochActivationExitChurnLimit: 256_000_000_000, MaxEffectiveBalanceElectra: 2048_000_000_000, @@ -293,6 +293,10 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxDepositRequestsPerPayload: 8192, // 2**13 (= 8192) UnsetDepositRequestsStartIndex: math.MaxUint64, + // PeerDAS + NumberOfColumns: 128, + MaxCellsInExtendedMatrix: 768, + // Values related to networking parameters. GossipMaxSize: 10 * 1 << 20, // 10 MiB MaxChunkSize: 10 * 1 << 20, // 10 MiB @@ -310,10 +314,6 @@ var mainnetBeaconConfig = &BeaconChainConfig{ AttestationSubnetPrefixBits: 6, SubnetsPerNode: 2, NodeIdBits: 256, - - // PeerDAS - NumberOfColumns: 128, - MaxCellsInExtendedMatrix: 768, } // MainnetTestConfig provides a version of the mainnet config that has a different name From 022a53f8f2c6f56198ecf13cc7d4ed04508a5997 Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:00:18 +0200 Subject: [PATCH 264/325] create light-client-updates bucket (#14266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * create light-client-updates bucket * Electra committe validation for aggregate and proof (#14317) * Electra committe validation for aggregate and proof * review * update comments * Refactor get local payload (#14327) * Refactor get local payload * Fix go lint: new line * add lightclient db kv functions * lightclient db tests * move blockchain/lightclient.go to core/light-client package * add comparison check for start and end period * create testing/utils/lightcilent.go * lightclient db tests * fix imports and usages * fix imports and usages in process_block_helpers * fix bazel dependencies * remove unnecessary nil check * add more tests for lightclient kv functions * refactor tests * refactor kv.LightClientUpdates * fix db to return every update that is available in the requested range * run gazzele fix * return empty map in case of empty db * fix goimports errors * goimports * Revert "Auxiliary commit to revert individual files from aa7ce6f37cb6767cf11642b022b2ce59d42ae621" This reverts commit 33c707f5bd164386449dc14ff27d95ad5f195161. --------- Co-authored-by: Radosław Kapka Co-authored-by: terence Co-authored-by: rkapka --- beacon-chain/blockchain/BUILD.bazel | 5 +- beacon-chain/blockchain/lightclient_test.go | 160 ----- .../blockchain/process_block_helpers.go | 10 +- beacon-chain/core/light-client/BUILD.bazel | 31 + .../light-client}/lightclient.go | 8 +- .../core/light-client/lightclient_test.go | 54 ++ beacon-chain/db/iface/BUILD.bazel | 1 + beacon-chain/db/iface/interface.go | 7 + beacon-chain/db/kv/BUILD.bazel | 4 + beacon-chain/db/kv/kv.go | 1 + beacon-chain/db/kv/lightclient.go | 79 +++ beacon-chain/db/kv/lightclient_test.go | 648 ++++++++++++++++++ beacon-chain/db/kv/schema.go | 3 + beacon-chain/rpc/endpoints.go | 1 + beacon-chain/rpc/eth/light-client/BUILD.bazel | 4 +- beacon-chain/rpc/eth/light-client/helpers.go | 11 +- .../rpc/eth/light-client/helpers_test.go | 9 +- beacon-chain/rpc/eth/light-client/server.go | 2 + proto/eth/v2/beacon_lightclient.pb.go | 147 +++- proto/eth/v2/beacon_lightclient.proto | 49 +- testing/util/BUILD.bazel | 1 + testing/util/lightclient.go | 117 ++++ 22 files changed, 1115 insertions(+), 237 deletions(-) delete mode 100644 beacon-chain/blockchain/lightclient_test.go create mode 100644 beacon-chain/core/light-client/BUILD.bazel rename beacon-chain/{blockchain => core/light-client}/lightclient.go (99%) create mode 100644 beacon-chain/core/light-client/lightclient_test.go create mode 100644 beacon-chain/db/kv/lightclient.go create mode 100644 beacon-chain/db/kv/lightclient_test.go create mode 100644 testing/util/lightclient.go diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index b60a763d0fde..8bbd65338cee 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -13,7 +13,6 @@ go_library( "head.go", "head_sync_committee_info.go", "init_sync_process_block.go", - "lightclient.go", "log.go", "merge_ascii_art.go", "metrics.go", @@ -48,6 +47,7 @@ go_library( "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/light-client:go_default_library", "//beacon-chain/core/signing:go_default_library", "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", @@ -84,7 +84,6 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", - "//proto/migration:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", "//runtime/version:go_default_library", @@ -117,7 +116,6 @@ go_test( "head_test.go", "init_sync_process_block_test.go", "init_test.go", - "lightclient_test.go", "log_test.go", "metrics_test.go", "mock_test.go", @@ -174,7 +172,6 @@ go_test( "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", - "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//testing/assert:go_default_library", diff --git a/beacon-chain/blockchain/lightclient_test.go b/beacon-chain/blockchain/lightclient_test.go deleted file mode 100644 index 41a3a7cfacdb..000000000000 --- a/beacon-chain/blockchain/lightclient_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package blockchain - -import ( - "context" - "testing" - - "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" - ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/require" - "github.com/prysmaticlabs/prysm/v5/testing/util" -) - -type testlc struct { - t *testing.T - ctx context.Context - state state.BeaconState - block interfaces.ReadOnlySignedBeaconBlock - attestedState state.BeaconState - attestedHeader *ethpb.BeaconBlockHeader -} - -func newTestLc(t *testing.T) *testlc { - return &testlc{t: t} -} - -func (l *testlc) setupTest() *testlc { - ctx := context.Background() - - slot := primitives.Slot(params.BeaconConfig().AltairForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) - - attestedState, err := util.NewBeaconStateCapella() - require.NoError(l.t, err) - err = attestedState.SetSlot(slot) - require.NoError(l.t, err) - - parent := util.NewBeaconBlockCapella() - parent.Block.Slot = slot - - signedParent, err := blocks.NewSignedBeaconBlock(parent) - require.NoError(l.t, err) - - parentHeader, err := signedParent.Header() - require.NoError(l.t, err) - attestedHeader := parentHeader.Header - - err = attestedState.SetLatestBlockHeader(attestedHeader) - require.NoError(l.t, err) - attestedStateRoot, err := attestedState.HashTreeRoot(ctx) - require.NoError(l.t, err) - - // get a new signed block so the root is updated with the new state root - parent.Block.StateRoot = attestedStateRoot[:] - signedParent, err = blocks.NewSignedBeaconBlock(parent) - require.NoError(l.t, err) - - state, err := util.NewBeaconStateCapella() - require.NoError(l.t, err) - err = state.SetSlot(slot) - require.NoError(l.t, err) - - parentRoot, err := signedParent.Block().HashTreeRoot() - require.NoError(l.t, err) - - block := util.NewBeaconBlockCapella() - block.Block.Slot = slot - block.Block.ParentRoot = parentRoot[:] - - for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { - block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) - } - - signedBlock, err := blocks.NewSignedBeaconBlock(block) - require.NoError(l.t, err) - - h, err := signedBlock.Header() - require.NoError(l.t, err) - - err = state.SetLatestBlockHeader(h.Header) - require.NoError(l.t, err) - stateRoot, err := state.HashTreeRoot(ctx) - require.NoError(l.t, err) - - // get a new signed block so the root is updated with the new state root - block.Block.StateRoot = stateRoot[:] - signedBlock, err = blocks.NewSignedBeaconBlock(block) - require.NoError(l.t, err) - - l.state = state - l.attestedState = attestedState - l.attestedHeader = attestedHeader - l.block = signedBlock - l.ctx = ctx - - return l -} - -func (l *testlc) checkAttestedHeader(update *ethpbv2.LightClientUpdate) { - require.Equal(l.t, l.attestedHeader.Slot, update.AttestedHeader.Slot, "Attested header slot is not equal") - require.Equal(l.t, l.attestedHeader.ProposerIndex, update.AttestedHeader.ProposerIndex, "Attested header proposer index is not equal") - require.DeepSSZEqual(l.t, l.attestedHeader.ParentRoot, update.AttestedHeader.ParentRoot, "Attested header parent root is not equal") - require.DeepSSZEqual(l.t, l.attestedHeader.BodyRoot, update.AttestedHeader.BodyRoot, "Attested header body root is not equal") - - attestedStateRoot, err := l.attestedState.HashTreeRoot(l.ctx) - require.NoError(l.t, err) - require.DeepSSZEqual(l.t, attestedStateRoot[:], update.AttestedHeader.StateRoot, "Attested header state root is not equal") -} - -func (l *testlc) checkSyncAggregate(update *ethpbv2.LightClientUpdate) { - syncAggregate, err := l.block.Block().Body().SyncAggregate() - require.NoError(l.t, err) - require.DeepSSZEqual(l.t, syncAggregate.SyncCommitteeBits, update.SyncAggregate.SyncCommitteeBits, "SyncAggregate bits is not equal") - require.DeepSSZEqual(l.t, syncAggregate.SyncCommitteeSignature, update.SyncAggregate.SyncCommitteeSignature, "SyncAggregate signature is not equal") -} - -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) { - l := newTestLc(t).setupTest() - - update, err := NewLightClientOptimisticUpdateFromBeaconState(l.ctx, l.state, l.block, l.attestedState) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.checkSyncAggregate(update) - l.checkAttestedHeader(update) - - require.Equal(t, (*v1.BeaconBlockHeader)(nil), update.FinalizedHeader, "Finalized header is not nil") - require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") -} - -func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { - l := newTestLc(t).setupTest() - - update, err := NewLightClientFinalityUpdateFromBeaconState(l.ctx, l.state, l.block, l.attestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.checkSyncAggregate(update) - l.checkAttestedHeader(update) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - require.Equal(t, primitives.Slot(0), update.FinalizedHeader.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), update.FinalizedHeader.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.BodyRoot, "Finalized header body root is not zero") - require.Equal(t, FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } -} diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 9e07cb4e17b3..b878b95e6a9e 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + lightclient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" + "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" @@ -176,7 +178,7 @@ func (s *Service) sendLightClientFinalityUpdate(ctx context.Context, signed inte } } - update, err := NewLightClientFinalityUpdateFromBeaconState( + update, err := lightclient.NewLightClientFinalityUpdateFromBeaconState( ctx, postState, signed, @@ -191,7 +193,7 @@ func (s *Service) sendLightClientFinalityUpdate(ctx context.Context, signed inte // Return the result result := ðpbv2.LightClientFinalityUpdateWithVersion{ Version: ethpbv2.Version(signed.Version()), - Data: CreateLightClientFinalityUpdate(update), + Data: lightclient.CreateLightClientFinalityUpdate(update), } // Send event @@ -211,7 +213,7 @@ func (s *Service) sendLightClientOptimisticUpdate(ctx context.Context, signed in return 0, errors.Wrap(err, "could not get attested state") } - update, err := NewLightClientOptimisticUpdateFromBeaconState( + update, err := lightclient.NewLightClientOptimisticUpdateFromBeaconState( ctx, postState, signed, @@ -225,7 +227,7 @@ func (s *Service) sendLightClientOptimisticUpdate(ctx context.Context, signed in // Return the result result := ðpbv2.LightClientOptimisticUpdateWithVersion{ Version: ethpbv2.Version(signed.Version()), - Data: CreateLightClientOptimisticUpdate(update), + Data: lightclient.CreateLightClientOptimisticUpdate(update), } return s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel new file mode 100644 index 000000000000..bd96ab17749d --- /dev/null +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -0,0 +1,31 @@ +load("@prysm//tools/go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["lightclient.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client", + visibility = ["//visibility:public"], + deps = [ + "//beacon-chain/state:go_default_library", + "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", + "//encoding/bytesutil:go_default_library", + "//proto/eth/v1:go_default_library", + "//proto/eth/v2:go_default_library", + "//proto/migration:go_default_library", + "//time/slots:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["lightclient_test.go"], + deps = [ + ":go_default_library", + "//config/params:go_default_library", + "//consensus-types/primitives:go_default_library", + "//proto/eth/v1:go_default_library", + "//testing/require:go_default_library", + "//testing/util:go_default_library", + ], +) diff --git a/beacon-chain/blockchain/lightclient.go b/beacon-chain/core/light-client/lightclient.go similarity index 99% rename from beacon-chain/blockchain/lightclient.go rename to beacon-chain/core/light-client/lightclient.go index ade4258cbb12..009d07b43282 100644 --- a/beacon-chain/blockchain/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -1,18 +1,20 @@ -package blockchain +package light_client import ( "bytes" - "context" "fmt" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" "github.com/prysmaticlabs/prysm/v5/proto/migration" "github.com/prysmaticlabs/prysm/v5/time/slots" + + "context" + + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) const ( diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go new file mode 100644 index 000000000000..729a51416a80 --- /dev/null +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -0,0 +1,54 @@ +package light_client_test + +import ( + "testing" + + lightClient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + + v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" +) + +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) { + l := util.NewTestLightClient(t).SetupTest() + + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update) + l.CheckAttestedHeader(update) + + require.Equal(t, (*v1.BeaconBlockHeader)(nil), update.FinalizedHeader, "Finalized header is not nil") + require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") +} + +func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { + l := util.NewTestLightClient(t).SetupTest() + + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update) + l.CheckAttestedHeader(update) + + zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + require.Equal(t, primitives.Slot(0), update.FinalizedHeader.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), update.FinalizedHeader.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.BodyRoot, "Finalized header body root is not zero") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + for _, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") + } +} diff --git a/beacon-chain/db/iface/BUILD.bazel b/beacon-chain/db/iface/BUILD.bazel index 81929a26a47d..993d1fd84c98 100644 --- a/beacon-chain/db/iface/BUILD.bazel +++ b/beacon-chain/db/iface/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//monitoring/backup:go_default_library", "//proto/dbval:go_default_library", + "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", ], diff --git a/beacon-chain/db/iface/interface.go b/beacon-chain/db/iface/interface.go index 82e5a019f7d2..b75960ef553c 100644 --- a/beacon-chain/db/iface/interface.go +++ b/beacon-chain/db/iface/interface.go @@ -7,6 +7,8 @@ import ( "context" "io" + ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + "github.com/ethereum/go-ethereum/common" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" @@ -56,6 +58,9 @@ type ReadOnlyDatabase interface { // Fee recipients operations. FeeRecipientByValidatorID(ctx context.Context, id primitives.ValidatorIndex) (common.Address, error) RegistrationByValidatorID(ctx context.Context, id primitives.ValidatorIndex) (*ethpb.ValidatorRegistrationV1, error) + // light client operations + LightClientUpdates(ctx context.Context, startPeriod, endPeriod uint64) (map[uint64]*ethpbv2.LightClientUpdateWithVersion, error) + LightClientUpdate(ctx context.Context, period uint64) (*ethpbv2.LightClientUpdateWithVersion, error) // origin checkpoint sync support OriginCheckpointBlockRoot(ctx context.Context) ([32]byte, error) @@ -92,6 +97,8 @@ type NoHeadAccessDatabase interface { // Fee recipients operations. SaveFeeRecipientsByValidatorIDs(ctx context.Context, ids []primitives.ValidatorIndex, addrs []common.Address) error SaveRegistrationsByValidatorIDs(ctx context.Context, ids []primitives.ValidatorIndex, regs []*ethpb.ValidatorRegistrationV1) error + // light client operations + SaveLightClientUpdate(ctx context.Context, period uint64, update *ethpbv2.LightClientUpdateWithVersion) error CleanUpDirtyStates(ctx context.Context, slotsPerArchivedPoint primitives.Slot) error } diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index 464a6c82e196..1d634375f3a6 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -16,6 +16,7 @@ go_library( "genesis.go", "key.go", "kv.go", + "lightclient.go", "log.go", "migration.go", "migration_archived_index.go", @@ -51,6 +52,7 @@ go_library( "//monitoring/progress:go_default_library", "//monitoring/tracing:go_default_library", "//proto/dbval:go_default_library", + "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//time:go_default_library", @@ -87,6 +89,7 @@ go_test( "genesis_test.go", "init_test.go", "kv_test.go", + "lightclient_test.go", "migration_archived_index_test.go", "migration_block_slot_index_test.go", "migration_state_validators_test.go", @@ -113,6 +116,7 @@ go_test( "//encoding/bytesutil:go_default_library", "//proto/dbval:go_default_library", "//proto/engine/v1:go_default_library", + "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/testing:go_default_library", "//runtime/version:go_default_library", diff --git a/beacon-chain/db/kv/kv.go b/beacon-chain/db/kv/kv.go index 90f01a63dffa..63e49e30485d 100644 --- a/beacon-chain/db/kv/kv.go +++ b/beacon-chain/db/kv/kv.go @@ -107,6 +107,7 @@ var Buckets = [][]byte{ powchainBucket, stateSummaryBucket, stateValidatorsBucket, + lightClientUpdatesBucket, // Indices buckets. blockSlotIndicesBucket, stateSlotIndicesBucket, diff --git a/beacon-chain/db/kv/lightclient.go b/beacon-chain/db/kv/lightclient.go new file mode 100644 index 000000000000..4677dc6adbbe --- /dev/null +++ b/beacon-chain/db/kv/lightclient.go @@ -0,0 +1,79 @@ +package kv + +import ( + "context" + "encoding/binary" + "fmt" + + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + bolt "go.etcd.io/bbolt" + "go.opencensus.io/trace" +) + +func (s *Store) SaveLightClientUpdate(ctx context.Context, period uint64, update *ethpbv2.LightClientUpdateWithVersion) error { + ctx, span := trace.StartSpan(ctx, "BeaconDB.saveLightClientUpdate") + defer span.End() + + return s.db.Update(func(tx *bolt.Tx) error { + bkt := tx.Bucket(lightClientUpdatesBucket) + updateMarshalled, err := encode(ctx, update) + if err != nil { + return err + } + return bkt.Put(bytesutil.Uint64ToBytesBigEndian(period), updateMarshalled) + }) +} + +func (s *Store) LightClientUpdates(ctx context.Context, startPeriod, endPeriod uint64) (map[uint64]*ethpbv2.LightClientUpdateWithVersion, error) { + ctx, span := trace.StartSpan(ctx, "BeaconDB.LightClientUpdates") + defer span.End() + + if startPeriod > endPeriod { + return nil, fmt.Errorf("start period %d is greater than end period %d", startPeriod, endPeriod) + } + + updates := make(map[uint64]*ethpbv2.LightClientUpdateWithVersion) + err := s.db.View(func(tx *bolt.Tx) error { + bkt := tx.Bucket(lightClientUpdatesBucket) + c := bkt.Cursor() + + firstPeriodInDb, _ := c.First() + if firstPeriodInDb == nil { + return nil + } + + for k, v := c.Seek(bytesutil.Uint64ToBytesBigEndian(startPeriod)); k != nil && binary.BigEndian.Uint64(k) <= endPeriod; k, v = c.Next() { + currentPeriod := binary.BigEndian.Uint64(k) + + var update ethpbv2.LightClientUpdateWithVersion + if err := decode(ctx, v, &update); err != nil { + return err + } + updates[currentPeriod] = &update + } + + return nil + }) + + if err != nil { + return nil, err + } + return updates, err +} + +func (s *Store) LightClientUpdate(ctx context.Context, period uint64) (*ethpbv2.LightClientUpdateWithVersion, error) { + ctx, span := trace.StartSpan(ctx, "BeaconDB.LightClientUpdate") + defer span.End() + + var update ethpbv2.LightClientUpdateWithVersion + err := s.db.View(func(tx *bolt.Tx) error { + bkt := tx.Bucket(lightClientUpdatesBucket) + updateBytes := bkt.Get(bytesutil.Uint64ToBytesBigEndian(period)) + if updateBytes == nil { + return nil + } + return decode(ctx, updateBytes, &update) + }) + return &update, err +} diff --git a/beacon-chain/db/kv/lightclient_test.go b/beacon-chain/db/kv/lightclient_test.go new file mode 100644 index 000000000000..528e55023d39 --- /dev/null +++ b/beacon-chain/db/kv/lightclient_test.go @@ -0,0 +1,648 @@ +package kv + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestStore_LightclientUpdate_CanSaveRetrieve(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + update := ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + } + + period := uint64(1) + err := db.SaveLightClientUpdate(ctx, period, ðpbv2.LightClientUpdateWithVersion{ + Version: 1, + Data: update, + }) + require.NoError(t, err) + + // Retrieve the update + retrievedUpdate, err := db.LightClientUpdate(ctx, period) + require.NoError(t, err) + require.Equal(t, update.SignatureSlot, retrievedUpdate.Data.SignatureSlot, "retrieved update does not match saved update") + +} + +func TestStore_LightclientUpdates_canRetrieveRange(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 9, + }, + }, + } + + for i, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(i+1), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdatesMap, err := db.LightClientUpdates(ctx, 1, 3) + require.NoError(t, err) + require.Equal(t, len(updates), len(retrievedUpdatesMap), "retrieved updates do not match saved updates") + for i, update := range updates { + require.Equal(t, update.Data.SignatureSlot, retrievedUpdatesMap[uint64(i+1)].Data.SignatureSlot, "retrieved update does not match saved update") + } + +} + +func TestStore_LightClientUpdate_EndPeriodSmallerThanStartPeriod(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 9, + }, + }, + } + + for i, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(i+1), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 3, 1) + require.NotNil(t, err) + require.Equal(t, err.Error(), "start period 3 is greater than end period 1") + require.IsNil(t, retrievedUpdates) + +} + +func TestStore_LightClientUpdate_EndPeriodEqualToStartPeriod(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 9, + }, + }, + } + + for i, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(i+1), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 2, 2) + require.NoError(t, err) + require.Equal(t, 1, len(retrievedUpdates)) + require.Equal(t, updates[1].Data.SignatureSlot, retrievedUpdates[2].Data.SignatureSlot, "retrieved update does not match saved update") +} + +func TestStore_LightClientUpdate_StartPeriodBeforeFirstUpdate(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 9, + }, + }, + } + + for i, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(i+2), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 0, 4) + require.NoError(t, err) + require.Equal(t, 3, len(retrievedUpdates)) + for i, update := range updates { + require.Equal(t, update.Data.SignatureSlot, retrievedUpdates[uint64(i+2)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_EndPeriodAfterLastUpdate(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 9, + }, + }, + } + + for i, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(i+1), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 1, 6) + require.NoError(t, err) + require.Equal(t, 3, len(retrievedUpdates)) + for i, update := range updates { + require.Equal(t, update.Data.SignatureSlot, retrievedUpdates[uint64(i+1)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_PartialUpdates(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 9, + }, + }, + } + + for i, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(i+1), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 1, 2) + require.NoError(t, err) + require.Equal(t, 2, len(retrievedUpdates)) + for i, update := range updates[:2] { + require.Equal(t, update.Data.SignatureSlot, retrievedUpdates[uint64(i+1)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_MissingPeriods_SimpleData(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + updates := []*ethpbv2.LightClientUpdateWithVersion{ + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 8, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 11, + }, + }, + { + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 12, + }, + }, + } + + for _, update := range updates { + err := db.SaveLightClientUpdate(ctx, uint64(update.Data.SignatureSlot), update) + require.NoError(t, err) + } + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 7, 12) + require.NoError(t, err) + require.Equal(t, 4, len(retrievedUpdates)) + for _, update := range updates { + require.Equal(t, update.Data.SignatureSlot, retrievedUpdates[uint64(update.Data.SignatureSlot)].Data.SignatureSlot, "retrieved update does not match saved update") + } + + // Retrieve the updates from the middle + retrievedUpdates, err = db.LightClientUpdates(ctx, 8, 12) + require.NoError(t, err) + require.Equal(t, 3, len(retrievedUpdates)) + require.Equal(t, updates[1].Data.SignatureSlot, retrievedUpdates[8].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, updates[2].Data.SignatureSlot, retrievedUpdates[11].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, updates[3].Data.SignatureSlot, retrievedUpdates[12].Data.SignatureSlot, "retrieved update does not match saved update") + + // Retrieve the updates from after the missing period + retrievedUpdates, err = db.LightClientUpdates(ctx, 11, 12) + require.NoError(t, err) + require.Equal(t, 2, len(retrievedUpdates)) + require.Equal(t, updates[2].Data.SignatureSlot, retrievedUpdates[11].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, updates[3].Data.SignatureSlot, retrievedUpdates[12].Data.SignatureSlot, "retrieved update does not match saved update") + + //retrieve the updates from before the missing period to after the missing period + retrievedUpdates, err = db.LightClientUpdates(ctx, 3, 15) + require.NoError(t, err) + require.Equal(t, 4, len(retrievedUpdates)) + require.Equal(t, updates[0].Data.SignatureSlot, retrievedUpdates[7].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, updates[1].Data.SignatureSlot, retrievedUpdates[8].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, updates[2].Data.SignatureSlot, retrievedUpdates[11].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, updates[3].Data.SignatureSlot, retrievedUpdates[12].Data.SignatureSlot, "retrieved update does not match saved update") +} + +func TestStore_LightClientUpdate_EmptyDB(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + + // Retrieve the updates + retrievedUpdates, err := db.LightClientUpdates(ctx, 1, 3) + require.IsNil(t, err) + require.Equal(t, 0, len(retrievedUpdates)) +} + +func TestStore_LightClientUpdate_MissingPeriodsAtTheEnd_SimpleData(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + + for i := 1; i < 4; i++ { + update := ðpbv2.LightClientUpdateWithVersion{ + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: primitives.Slot(uint64(i)), + }, + } + err := db.SaveLightClientUpdate(ctx, uint64(i), update) + require.NoError(t, err) + } + for i := 7; i < 10; i++ { + update := ðpbv2.LightClientUpdateWithVersion{ + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: primitives.Slot(uint64(i)), + }, + } + err := db.SaveLightClientUpdate(ctx, uint64(i), update) + require.NoError(t, err) + } + + // Retrieve the updates from 1 to 5 + retrievedUpdates, err := db.LightClientUpdates(ctx, 1, 5) + require.NoError(t, err) + require.Equal(t, 3, len(retrievedUpdates)) + require.Equal(t, primitives.Slot(1), retrievedUpdates[1].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, primitives.Slot(2), retrievedUpdates[2].Data.SignatureSlot, "retrieved update does not match saved update") + require.Equal(t, primitives.Slot(3), retrievedUpdates[3].Data.SignatureSlot, "retrieved update does not match saved update") + +} + +func setupLightClientTestDB(t *testing.T) (*Store, context.Context) { + db := setupDB(t) + ctx := context.Background() + + for i := 10; i < 101; i++ { // 10 to 100 + update := ðpbv2.LightClientUpdateWithVersion{ + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: primitives.Slot(uint64(i)), + }, + } + err := db.SaveLightClientUpdate(ctx, uint64(i), update) + require.NoError(t, err) + } + + for i := 110; i < 201; i++ { // 110 to 200 + update := ðpbv2.LightClientUpdateWithVersion{ + Version: 1, + Data: ðpbv2.LightClientUpdate{ + AttestedHeader: nil, + NextSyncCommittee: nil, + NextSyncCommitteeBranch: nil, + FinalizedHeader: nil, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: primitives.Slot(uint64(i)), + }, + } + err := db.SaveLightClientUpdate(ctx, uint64(i), update) + require.NoError(t, err) + } + + return db, ctx +} + +func TestStore_LightClientUpdate_MissingPeriodsInTheMiddleDistributed(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // Retrieve the updates - should fail because of missing periods in the middle + retrievedUpdates, err := db.LightClientUpdates(ctx, 1, 300) + require.NoError(t, err) + require.Equal(t, 91*2, len(retrievedUpdates)) + for i := 10; i < 101; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } + for i := 110; i < 201; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } + +} + +func TestStore_LightClientUpdate_RetrieveValidRangeFromStart(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // retrieve 1 to 100 - should work because all periods are present after the firstPeriodInDB > startPeriod + retrievedUpdates, err := db.LightClientUpdates(ctx, 1, 100) + require.NoError(t, err) + require.Equal(t, 91, len(retrievedUpdates)) + for i := 10; i < 101; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_RetrieveValidRangeInTheMiddle(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // retrieve 110 to 200 - should work because all periods are present + retrievedUpdates, err := db.LightClientUpdates(ctx, 110, 200) + require.NoError(t, err) + require.Equal(t, 91, len(retrievedUpdates)) + for i := 110; i < 201; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_MissingPeriodInTheMiddleConcentrated(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // retrieve 100 to 200 + retrievedUpdates, err := db.LightClientUpdates(ctx, 100, 200) + require.NoError(t, err) + require.Equal(t, 92, len(retrievedUpdates)) + require.Equal(t, primitives.Slot(100), retrievedUpdates[100].Data.SignatureSlot, "retrieved update does not match saved update") + for i := 110; i < 201; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_MissingPeriodsAtTheEnd(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // retrieve 10 to 109 + retrievedUpdates, err := db.LightClientUpdates(ctx, 10, 109) + require.NoError(t, err) + require.Equal(t, 91, len(retrievedUpdates)) + for i := 10; i < 101; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_MissingPeriodsAtTheBeginning(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // retrieve 105 to 200 + retrievedUpdates, err := db.LightClientUpdates(ctx, 105, 200) + require.NoError(t, err) + require.Equal(t, 91, len(retrievedUpdates)) + for i := 110; i < 201; i++ { + require.Equal(t, primitives.Slot(uint64(i)), retrievedUpdates[uint64(i)].Data.SignatureSlot, "retrieved update does not match saved update") + } +} + +func TestStore_LightClientUpdate_StartPeriodGreaterThanLastPeriod(t *testing.T) { + db, ctx := setupLightClientTestDB(t) + + // retrieve 300 to 400 + retrievedUpdates, err := db.LightClientUpdates(ctx, 300, 400) + require.NoError(t, err) + require.Equal(t, 0, len(retrievedUpdates)) + +} diff --git a/beacon-chain/db/kv/schema.go b/beacon-chain/db/kv/schema.go index 108849e9f652..30d950514ca2 100644 --- a/beacon-chain/db/kv/schema.go +++ b/beacon-chain/db/kv/schema.go @@ -17,6 +17,9 @@ var ( feeRecipientBucket = []byte("fee-recipient") registrationBucket = []byte("registration") + // Light Client Updates Bucket + lightClientUpdatesBucket = []byte("light-client-updates") + // Deprecated: This bucket was migrated in PR 6461. Do not use, except for migrations. slotsHasObjectBucket = []byte("slots-has-objects") // Deprecated: This bucket was migrated in PR 6461. Do not use, except for migrations. diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 9a67d2d8f38c..622e6be9122b 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -815,6 +815,7 @@ func (s *Service) lightClientEndpoints(blocker lookup.Blocker, stater lookup.Sta Blocker: blocker, Stater: stater, HeadFetcher: s.cfg.HeadFetcher, + BeaconDB: s.cfg.BeaconDB, } const namespace = "lightclient" diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index db4370fd4ede..a95416814183 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -12,6 +12,8 @@ go_library( deps = [ "//api/server/structs:go_default_library", "//beacon-chain/blockchain:go_default_library", + "//beacon-chain/core/light-client:go_default_library", + "//beacon-chain/db:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/state:go_default_library", @@ -41,9 +43,9 @@ go_test( embed = [":go_default_library"], deps = [ "//api/server/structs:go_default_library", - "//beacon-chain/blockchain:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/light-client:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index d6fe7a22f9dd..eb87610d78c3 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -6,9 +6,10 @@ import ( "reflect" "strconv" + lightclient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -152,7 +153,7 @@ func createLightClientUpdate( block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientUpdate, error) { - result, err := blockchain.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + result, err := lightclient.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) if err != nil { return nil, err } @@ -210,7 +211,7 @@ func newLightClientFinalityUpdateFromBeaconState( block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientUpdate, error) { - result, err := blockchain.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + result, err := lightclient.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) if err != nil { return nil, err } @@ -223,7 +224,7 @@ func newLightClientOptimisticUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState) (*structs.LightClientUpdate, error) { - result, err := blockchain.NewLightClientOptimisticUpdateFromBeaconState(ctx, state, block, attestedState) + result, err := lightclient.NewLightClientOptimisticUpdateFromBeaconState(ctx, state, block, attestedState) if err != nil { return nil, err } @@ -319,7 +320,7 @@ func IsSyncCommitteeUpdate(update *v2.LightClientUpdate) bool { } func IsFinalityUpdate(update *v2.LightClientUpdate) bool { - finalityBranch := make([][]byte, blockchain.FinalityBranchNumOfLeaves) + finalityBranch := make([][]byte, lightclient.FinalityBranchNumOfLeaves) return !reflect.DeepEqual(update.FinalityBranch, finalityBranch) } diff --git a/beacon-chain/rpc/eth/light-client/helpers_test.go b/beacon-chain/rpc/eth/light-client/helpers_test.go index 97a817717c29..f93a49e25f5a 100644 --- a/beacon-chain/rpc/eth/light-client/helpers_test.go +++ b/beacon-chain/rpc/eth/light-client/helpers_test.go @@ -3,7 +3,8 @@ package lightclient import ( "testing" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" + lightclient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" @@ -19,7 +20,7 @@ func createNonEmptySyncCommitteeBranch() [][]byte { // When the update has finality func createNonEmptyFinalityBranch() [][]byte { - res := make([][]byte, blockchain.FinalityBranchNumOfLeaves) + res := make([][]byte, lightclient.FinalityBranchNumOfLeaves) res[0] = []byte("xyz") return res } @@ -146,7 +147,7 @@ func TestIsBetterUpdate(t *testing.T) { }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, - FinalityBranch: make([][]byte, blockchain.FinalityBranchNumOfLeaves), + FinalityBranch: make([][]byte, lightclient.FinalityBranchNumOfLeaves), }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ @@ -183,7 +184,7 @@ func TestIsBetterUpdate(t *testing.T) { }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, - FinalityBranch: make([][]byte, blockchain.FinalityBranchNumOfLeaves), + FinalityBranch: make([][]byte, lightclient.FinalityBranchNumOfLeaves), }, expectedResult: false, }, diff --git a/beacon-chain/rpc/eth/light-client/server.go b/beacon-chain/rpc/eth/light-client/server.go index f01100a259fa..e0773a306405 100644 --- a/beacon-chain/rpc/eth/light-client/server.go +++ b/beacon-chain/rpc/eth/light-client/server.go @@ -2,6 +2,7 @@ package lightclient import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" ) @@ -9,4 +10,5 @@ type Server struct { Blocker lookup.Blocker Stater lookup.Stater HeadFetcher blockchain.HeadFetcher + BeaconDB db.HeadAccessDatabase } diff --git a/proto/eth/v2/beacon_lightclient.pb.go b/proto/eth/v2/beacon_lightclient.pb.go index 812355cdbd11..33daa3abaa9d 100755 --- a/proto/eth/v2/beacon_lightclient.pb.go +++ b/proto/eth/v2/beacon_lightclient.pb.go @@ -434,6 +434,61 @@ func (x *LightClientOptimisticUpdate) GetSignatureSlot() github_com_prysmaticlab return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) } +type LightClientUpdateWithVersion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version Version `protobuf:"varint,1,opt,name=version,proto3,enum=ethereum.eth.v2.Version" json:"version,omitempty"` + Data *LightClientUpdate `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *LightClientUpdateWithVersion) Reset() { + *x = LightClientUpdateWithVersion{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientUpdateWithVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientUpdateWithVersion) ProtoMessage() {} + +func (x *LightClientUpdateWithVersion) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientUpdateWithVersion.ProtoReflect.Descriptor instead. +func (*LightClientUpdateWithVersion) Descriptor() ([]byte, []int) { + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{6} +} + +func (x *LightClientUpdateWithVersion) GetVersion() Version { + if x != nil { + return x.Version + } + return Version_PHASE0 +} + +func (x *LightClientUpdateWithVersion) GetData() *LightClientUpdate { + if x != nil { + return x.Data + } + return nil +} + var File_proto_eth_v2_beacon_lightclient_proto protoreflect.FileDescriptor var file_proto_eth_v2_beacon_lightclient_proto_rawDesc = []byte{ @@ -560,16 +615,25 @@ var file_proto_eth_v2_beacon_lightclient_proto_rawDesc = []byte{ 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, - 0x42, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x67, + 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x12, 0x53, + 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -584,7 +648,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP() []byte { return file_proto_eth_v2_beacon_lightclient_proto_rawDescData } -var file_proto_eth_v2_beacon_lightclient_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_proto_eth_v2_beacon_lightclient_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_proto_eth_v2_beacon_lightclient_proto_goTypes = []interface{}{ (*LightClientBootstrap)(nil), // 0: ethereum.eth.v2.LightClientBootstrap (*LightClientUpdate)(nil), // 1: ethereum.eth.v2.LightClientUpdate @@ -592,32 +656,35 @@ var file_proto_eth_v2_beacon_lightclient_proto_goTypes = []interface{}{ (*LightClientFinalityUpdate)(nil), // 3: ethereum.eth.v2.LightClientFinalityUpdate (*LightClientOptimisticUpdateWithVersion)(nil), // 4: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion (*LightClientOptimisticUpdate)(nil), // 5: ethereum.eth.v2.LightClientOptimisticUpdate - (*v1.BeaconBlockHeader)(nil), // 6: ethereum.eth.v1.BeaconBlockHeader - (*SyncCommittee)(nil), // 7: ethereum.eth.v2.SyncCommittee - (*v1.SyncAggregate)(nil), // 8: ethereum.eth.v1.SyncAggregate - (Version)(0), // 9: ethereum.eth.v2.Version + (*LightClientUpdateWithVersion)(nil), // 6: ethereum.eth.v2.LightClientUpdateWithVersion + (*v1.BeaconBlockHeader)(nil), // 7: ethereum.eth.v1.BeaconBlockHeader + (*SyncCommittee)(nil), // 8: ethereum.eth.v2.SyncCommittee + (*v1.SyncAggregate)(nil), // 9: ethereum.eth.v1.SyncAggregate + (Version)(0), // 10: ethereum.eth.v2.Version } var file_proto_eth_v2_beacon_lightclient_proto_depIdxs = []int32{ - 6, // 0: ethereum.eth.v2.LightClientBootstrap.header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 7, // 1: ethereum.eth.v2.LightClientBootstrap.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 6, // 2: ethereum.eth.v2.LightClientUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 7, // 3: ethereum.eth.v2.LightClientUpdate.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 6, // 4: ethereum.eth.v2.LightClientUpdate.finalized_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 8, // 5: ethereum.eth.v2.LightClientUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 9, // 6: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 7, // 0: ethereum.eth.v2.LightClientBootstrap.header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 8, // 1: ethereum.eth.v2.LightClientBootstrap.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 7, // 2: ethereum.eth.v2.LightClientUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 8, // 3: ethereum.eth.v2.LightClientUpdate.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 7, // 4: ethereum.eth.v2.LightClientUpdate.finalized_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 9, // 5: ethereum.eth.v2.LightClientUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 10, // 6: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version 3, // 7: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientFinalityUpdate - 6, // 8: ethereum.eth.v2.LightClientFinalityUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 6, // 9: ethereum.eth.v2.LightClientFinalityUpdate.finalized_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 8, // 10: ethereum.eth.v2.LightClientFinalityUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 9, // 11: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 7, // 8: ethereum.eth.v2.LightClientFinalityUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 7, // 9: ethereum.eth.v2.LightClientFinalityUpdate.finalized_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 9, // 10: ethereum.eth.v2.LightClientFinalityUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 10, // 11: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version 5, // 12: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientOptimisticUpdate - 6, // 13: ethereum.eth.v2.LightClientOptimisticUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 8, // 14: ethereum.eth.v2.LightClientOptimisticUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 7, // 13: ethereum.eth.v2.LightClientOptimisticUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 9, // 14: ethereum.eth.v2.LightClientOptimisticUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 10, // 15: ethereum.eth.v2.LightClientUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 1, // 16: ethereum.eth.v2.LightClientUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientUpdate + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_proto_eth_v2_beacon_lightclient_proto_init() } @@ -700,6 +767,18 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { return nil } } + file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientUpdateWithVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -707,7 +786,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v2_beacon_lightclient_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/eth/v2/beacon_lightclient.proto b/proto/eth/v2/beacon_lightclient.proto index 6f3bcd62f745..c967e61883bd 100644 --- a/proto/eth/v2/beacon_lightclient.proto +++ b/proto/eth/v2/beacon_lightclient.proto @@ -30,41 +30,46 @@ option php_namespace = "Ethereum\\Eth\\v2"; // Beacon LightClient API related messages. message LightClientBootstrap { - v1.BeaconBlockHeader header = 1; - SyncCommittee current_sync_committee = 2; - repeated bytes current_sync_committee_branch = 3; + v1.BeaconBlockHeader header = 1; + SyncCommittee current_sync_committee = 2; + repeated bytes current_sync_committee_branch = 3; } message LightClientUpdate { - v1.BeaconBlockHeader attested_header = 1; - SyncCommittee next_sync_committee = 2; - repeated bytes next_sync_committee_branch = 3; - v1.BeaconBlockHeader finalized_header = 4; - repeated bytes finality_branch = 5; - v1.SyncAggregate sync_aggregate = 6; - uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + v1.BeaconBlockHeader attested_header = 1; + SyncCommittee next_sync_committee = 2; + repeated bytes next_sync_committee_branch = 3; + v1.BeaconBlockHeader finalized_header = 4; + repeated bytes finality_branch = 5; + v1.SyncAggregate sync_aggregate = 6; + uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; } message LightClientFinalityUpdateWithVersion { - v2.Version version = 1; - LightClientFinalityUpdate data = 2; + v2.Version version = 1; + LightClientFinalityUpdate data = 2; } message LightClientFinalityUpdate { - v1.BeaconBlockHeader attested_header = 1; - v1.BeaconBlockHeader finalized_header = 2; - repeated bytes finality_branch = 3; - v1.SyncAggregate sync_aggregate = 4; - uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + v1.BeaconBlockHeader attested_header = 1; + v1.BeaconBlockHeader finalized_header = 2; + repeated bytes finality_branch = 3; + v1.SyncAggregate sync_aggregate = 4; + uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; } message LightClientOptimisticUpdateWithVersion { - v2.Version version = 1; - LightClientOptimisticUpdate data = 2; + v2.Version version = 1; + LightClientOptimisticUpdate data = 2; } message LightClientOptimisticUpdate { - v1.BeaconBlockHeader attested_header = 1; - v1.SyncAggregate sync_aggregate = 2; - uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + v1.BeaconBlockHeader attested_header = 1; + v1.SyncAggregate sync_aggregate = 2; + uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; } + +message LightClientUpdateWithVersion { + v2.Version version = 1; + LightClientUpdate data = 2; +} \ No newline at end of file diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index 8456b8d17824..f41aa3bc2ef9 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "electra_block.go", "electra_state.go", "helpers.go", + "lightclient.go", "merge.go", "state.go", "sync_aggregate.go", diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go new file mode 100644 index 000000000000..5c6ac635678a --- /dev/null +++ b/testing/util/lightclient.go @@ -0,0 +1,117 @@ +package util + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +type TestLightClient struct { + T *testing.T + Ctx context.Context + State state.BeaconState + Block interfaces.ReadOnlySignedBeaconBlock + AttestedState state.BeaconState + AttestedHeader *ethpb.BeaconBlockHeader +} + +func NewTestLightClient(t *testing.T) *TestLightClient { + return &TestLightClient{T: t} +} + +func (l *TestLightClient) SetupTest() *TestLightClient { + ctx := context.Background() + + slot := primitives.Slot(params.BeaconConfig().AltairForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + attestedState, err := NewBeaconStateCapella() + require.NoError(l.T, err) + err = attestedState.SetSlot(slot) + require.NoError(l.T, err) + + parent := NewBeaconBlockCapella() + parent.Block.Slot = slot + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + parentHeader, err := signedParent.Header() + require.NoError(l.T, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(l.T, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + state, err := NewBeaconStateCapella() + require.NoError(l.T, err) + err = state.SetSlot(slot) + require.NoError(l.T, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(l.T, err) + + block := NewBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + l.State = state + l.AttestedState = attestedState + l.AttestedHeader = attestedHeader + l.Block = signedBlock + l.Ctx = ctx + + return l +} + +func (l *TestLightClient) CheckAttestedHeader(update *ethpbv2.LightClientUpdate) { + require.Equal(l.T, l.AttestedHeader.Slot, update.AttestedHeader.Slot, "Attested header slot is not equal") + require.Equal(l.T, l.AttestedHeader.ProposerIndex, update.AttestedHeader.ProposerIndex, "Attested header proposer index is not equal") + require.DeepSSZEqual(l.T, l.AttestedHeader.ParentRoot, update.AttestedHeader.ParentRoot, "Attested header parent root is not equal") + require.DeepSSZEqual(l.T, l.AttestedHeader.BodyRoot, update.AttestedHeader.BodyRoot, "Attested header body root is not equal") + + attestedStateRoot, err := l.AttestedState.HashTreeRoot(l.Ctx) + require.NoError(l.T, err) + require.DeepSSZEqual(l.T, attestedStateRoot[:], update.AttestedHeader.StateRoot, "Attested header state root is not equal") +} + +func (l *TestLightClient) CheckSyncAggregate(update *ethpbv2.LightClientUpdate) { + syncAggregate, err := l.Block.Block().Body().SyncAggregate() + require.NoError(l.T, err) + require.DeepSSZEqual(l.T, syncAggregate.SyncCommitteeBits, update.SyncAggregate.SyncCommitteeBits, "SyncAggregate bits is not equal") + require.DeepSSZEqual(l.T, syncAggregate.SyncCommitteeSignature, update.SyncAggregate.SyncCommitteeSignature, "SyncAggregate signature is not equal") +} From dd3c9652c39e2afddbd75f4e754caed4b827a811 Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:43:10 +0530 Subject: [PATCH 265/325] fix: replace `BeaconBlockHeader` in `createLightClientBootstrap` with `LightClientHeader` (#14374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: replace `BeaconBlockHeader` in `createLightClientBootstrap` with `LightClientHeader` * minor fix in `handlers_test.go` * check if `beacon` is `nil` instead of `header` --------- Co-authored-by: Radosław Kapka --- api/server/structs/endpoints_lightclient.go | 6 +++++- beacon-chain/rpc/eth/light-client/handlers_test.go | 2 +- beacon-chain/rpc/eth/light-client/helpers.go | 11 +++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/api/server/structs/endpoints_lightclient.go b/api/server/structs/endpoints_lightclient.go index 7204e177dc5c..d7380073395b 100644 --- a/api/server/structs/endpoints_lightclient.go +++ b/api/server/structs/endpoints_lightclient.go @@ -1,12 +1,16 @@ package structs +type LightClientHeader struct { + Beacon *BeaconBlockHeader `json:"beacon"` +} + type LightClientBootstrapResponse struct { Version string `json:"version"` Data *LightClientBootstrap `json:"data"` } type LightClientBootstrap struct { - Header *BeaconBlockHeader `json:"header"` + Header *LightClientHeader `json:"header"` CurrentSyncCommittee *SyncCommittee `json:"current_sync_committee"` CurrentSyncCommitteeBranch []string `json:"current_sync_committee_branch"` } diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index aff9643128cc..59e34923948d 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -73,7 +73,7 @@ func TestLightClientHandler_GetLightClientBootstrap(t *testing.T) { resp := &structs.LightClientBootstrapResponse{} require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(header.Header.BodyRoot), resp.Data.Header.BodyRoot) + require.Equal(t, hexutil.Encode(header.Header.BodyRoot), resp.Data.Header.Beacon.BodyRoot) require.NotNil(t, resp.Data) } diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index eb87610d78c3..e5c8a94966dc 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -67,17 +67,20 @@ func createLightClientBootstrap(ctx context.Context, state state.BeaconState) (* branch[i] = hexutil.Encode(proof) } - header := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) - if header == nil { + beacon := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) + if beacon == nil { return nil, fmt.Errorf("could not get beacon block header") } + header := &structs.LightClientHeader{ + Beacon: beacon, + } // Above shared util function won't calculate state root, so we need to do it manually stateRoot, err := state.HashTreeRoot(ctx) if err != nil { return nil, fmt.Errorf("could not get state root: %s", err.Error()) } - header.StateRoot = hexutil.Encode(stateRoot[:]) + header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) // Return result result := &structs.LightClientBootstrap{ @@ -237,7 +240,7 @@ func NewLightClientBootstrapFromJSON(bootstrapJSON *structs.LightClientBootstrap var err error - v1Alpha1Header, err := bootstrapJSON.Header.ToConsensus() + v1Alpha1Header, err := bootstrapJSON.Header.Beacon.ToConsensus() if err != nil { return nil, err } From 3392fdb21d864810709e6b02c6907d2f0d8fdf03 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Fri, 23 Aug 2024 10:11:06 -0500 Subject: [PATCH 266/325] Add CHANGELOG.md and update CONTRIBUTING.md (#13673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add github action requiring a diff to changelog.md. * Update CONTRIBUTING.md with CHANGELOG.md requirements and restrictions on trivial PRs * Update tj-actions/changed-files * Backfill CHANGELOG.md * Remove hashtag references to PRs * Append PR template * Add unreleased changes * Update CONTRIBUTING.md Co-authored-by: Radosław Kapka --------- Co-authored-by: Radosław Kapka --- .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/workflows/changelog.yml | 33 + CHANGELOG.md | 2580 ++++++++++++++++++++++++++++++ CONTRIBUTING.md | 37 +- 4 files changed, 2650 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/changelog.yml create mode 100644 CHANGELOG.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b9816ce5aff2..4298e714f1f9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,6 +10,7 @@ in review. 4. Note that PRs updating dependencies and new Go versions are not accepted. Please file an issue instead. +5. A changelog entry is required for user facing issues. --> **What type of PR is this?** @@ -28,3 +29,9 @@ Fixes # **Other notes for review** + +**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 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 new file mode 100644 index 000000000000..d44281e341db --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,33 @@ +name: CI + +on: + pull_request: + branches: + - develop + +jobs: + changed_files: + runs-on: ubuntu-latest + name: Check CHANGELOG.md + steps: + - uses: actions/checkout@v4 + - name: changelog modified + id: changelog-modified + uses: tj-actions/changed-files@v45 + with: + files: CHANGELOG.md + + - name: List all changed files + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000000..b96333a68ef4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2580 @@ +# Changelog + +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.1.0...HEAD) + +### Added + +- Aggregate and proof committee validation for Electra. +- More tests for electra field generation. +- Light client support: implement `ComputeFieldRootsForBlockBody`. +- Light client support: Add light client database changes. + +### Changed + +- `getLocalPayload` has been refactored to enable work in ePBS branch. +- `TestNodeServer_GetPeer` and `TestNodeServer_ListPeers` test flakes resolved by iterating the whole peer list to find a match rather than taking the first peer in the map. +- Passing spectests v1.5.0-alpha.4 and v1.5.0-alpha.5. +- Beacon chain now asserts that the external builder block uses the expected gas limit. +- Electra: Add electra objects to beacon API. +- Electra: Updated block publishing beacon APIs to support Electra. + +### Deprecated + + +### Removed + + +### Fixed + +- Fixed early release of read lock in BeaconState.getValidatorIndex. +- Electra: resolve inconsistencies with validator committee index validation. +- Electra: build blocks with blobs. +- E2E: fixed gas limit at genesis +- Light client support: use LightClientHeader instead of BeaconBlockHeader. + +### Security + + +## [v5.1.0](https://github.com/prysmaticlabs/prysm/compare/v5.0.4...v5.1.0) - 2024-08-20 + +This release contains 171 new changes and many of these are related to Electra! Along side the Electra changes, there are nearly 100 changes related to bug fixes, feature additions, and other improvements to Prysm. Updating to this release is recommended at your convenience. + +⚠️ Deprecation Notice: Removal of gRPC Gateway and Gateway Flag Renaming ⚠️ + +In an upcoming release, we will be deprecating the gRPC gateway and renaming several associated flags. This change will result in the removal of access to several internal APIs via REST, though the gRPC endpoints will remain unaffected. We strongly encourage systems to transition to using the beacon API endpoints moving forward. Please refer to PR for more details. + +### Added + +- Electra work +- Fork-specific consensus-types interfaces +- Fuzz ssz roundtrip marshalling, cloner fuzzing +- Add support for multiple beacon nodes in the REST API +- Add middleware for Content-Type and Accept headers +- Add debug logs for proposer settings +- Add tracing to beacon api package +- Add support for persistent validator keys when using remote signer. --validators-external-signer-public-keys and --validators-external-signer-key-file See the docs page for more info. +- Add AggregateKeyFromIndices to beacon state to reduce memory usage when processing attestations +- Add GetIndividualVotes endpoint +- Implement is_better_update for light client +- HTTP endpoint for GetValidatorParticipation +- HTTP endpoint for GetChainHead +- HTTP endpoint for GetValidatorActiveSetChanges +- Check locally for min-bid and min-bid-difference + +### Changed + +- Refactored slasher operations to their logical order +- Refactored Gwei and Wei types from math to primitives package. +- Unwrap payload bid from ExecutionData +- Change ZeroWei to a func to avoid shared ptr +- Updated go-libp2p to v0.35.2 and go-libp2p-pubsub to v0.11.0 +- Use genesis block root in epoch 1 for attester duties +- Cleanup validator client code +- Old attestations log moved to debug. "Attestation is too old to broadcast, discarding it" +- Modify ProcessEpoch not to return the state as a returned value +- Updated go-bitfield to latest release +- Use go ticker instead of timer +- process_registry_updates no longer makes a full copy of the validator set +- Validator client processes sync committee roll separately +- Use vote pointers in forkchoice to reduce memory churn +- Avoid Cloning When Creating a New Gossip Message +- Proposer filters invalid attestation signatures +- Validator now pushes proposer settings every slot +- Get all beacon committees at once +- Committee-aware attestation packing + +### Deprecated + +- `--enable-debug-rpc-endpoints` is deprecated and debug rpc points are on by default. + +### Removed + +- Removed fork specific getter functions (i.e. PbCapellaBlock, PbDenebBlock, etc) + +### Fixed + +- Fixed debug log "upgraded stake to $fork" to only log on upgrades instead of every state transition +- Fixed nil block panic in API +- Fixed mockgen script +- Do not fail to build block when block value is unknown +- Fix prysmctl TUI when more than 20 validators were listed +- Revert peer backoff changes from. This was causing some sync committee performance issues. +- Increased attestation seen cache expiration to two epochs +- Fixed slasher db disk usage leak +- fix: Multiple network flags should prevent the BN to start +- Correctly handle empty payload from GetValidatorPerformance requests +- Fix Event stream with carriage return support +- Fix panic on empty block result in REST API +- engine_getPayloadBodiesByRangeV1 - fix, adding hexutil encoding on request parameters + + +### Security + +- Go version updated to 1.22 + +## [v5.0.4](https://github.com/prysmaticlabs/prysm/compare/v5.0.3...v5.0.4) - 2024-07-21 + +This release has many wonderful bug fixes and improvements. Some highlights include p2p peer fix for windows users, beacon API fix for retrieving blobs older than the minimum blob retention period, and improvements to initial sync by avoiding redundant blob downloads. + +Updating to this release is recommended at your earliest convenience, especially for windows users. + +### Added + +- Beacon-api: broadcast blobs in the event of seen block +- P2P: Add QUIC support + +### Changed + +- Use slices package for various slice operations +- Initsync skip local blobs +- Use read only validators in Beacon API +- Return syncing status when node is optimistic +- Upgrade the Beacon API e2e evaluator +- Don't return error that can be internally handled +- Allow consistent auth token for validator apis +- Change example.org DNS record +- Simplify prune invalid by reusing existing fork choice store call +- use [32]byte keys in the filesystem cache +- Update Libp2p Dependencies +- Parallelize Broadcasting And Processing Each Blob +- Substantial VC cleanup +- Only log error when aggregator check fails +- Update Libp2p Dependencies +- Change Attestation Log To Debug +- update codegen dep and cleanup organization + +### Deprecated + +- Remove eip4881 flag (--disable-eip-4881) + +### Removed + +- Remove the Goerli/Prater support +- Remove unused IsViableForCheckpoint +- Remove unused validator map copy method + +### Fixed + +- Various typos and other cosmetic fixes +- Send correct state root with finalized event stream +- Extend Broadcast Window For Attestations +- Beacon API: Use retention period when fetching blobs +- Backfill throttling +- Use correct port for health check in Beacon API e2e evaluator +- Do not remove blobs DB in slasher. +- use time.NewTimer() to avoid possible memory leaks +- paranoid underflow protection without error handling +- Fix CommitteeAssignments to not return every validator +- Fix dependent root retrival genesis case +- Restrict Dials From Discovery +- Always close cache warm chan to prevent blocking +- Keep only the latest value in the health channel + +### Security + +- Bump golang.org/x/net from 0.21.0 to 0.23.0 + +## [v5.0.3](https://github.com/prysmaticlabs/prysm/compare/v5.0.2...v5.0.3) - 2024-04-04 + +Prysm v5.0.3 is a small patch release with some nice additions and bug fixes. Updating to this release is recommended for users on v5.0.0 or v5.0.1. There aren't many changes since last week's v5.0.2 so upgrading is not strictly required, but there are still improvements in this release so update if you can! + +### Added + +- Testing: spec test coverage tool +- Add bid value metrics +- prysmctl: Command-line interface for visualizing min/max span bucket +- Explicit Peering Agreement implementation + +### Changed + +- Utilize next slot cache in block rewards rpc +- validator: Call GetGenesis only once when using beacon API +- Simplify ValidateAttestationTime +- Various typo / commentary improvements +- Change goodbye message from rate limited peer to debug verbosity +- Bump libp2p to v0.33.1 +- Fill in missing debug logs for blob p2p IGNORE/REJECT + +### Fixed + +- Remove check for duplicates in pending attestation queue +- Repair finalized index issue +- Maximize Peer Capacity When Syncing +- Reject Empty Bundles + +### Security + +No security updates in this release. + +## [v5.0.2](https://github.com/prysmaticlabs/prysm/compare/v5.0.1...v5.0.2) - 2024-03-27 + +This release has many optimizations, UX improvements, and bug fixes. Due to the number of important bug fixes and optimizations, we encourage all operators to update to v5.0.2 at their earliest convenience. + +In this release, there is a notable change to the default value of --local-block-value-boost from 0 to 10. This means that the default behavior of using the builder API / mev-boost requires the builder bid to be 10% better than your local block profit. If you want to preserve the existing behavior, set --local-block-value-boost=0. + + +### Added + +- API: Add support for sync committee selections +- blobs: call fsync between part file write and rename (feature flag --blob-save-fsync) +- Implement EIP-3076 minimal slashing protection, using a filesystem database (feature flag --enable-minimal-slashing-protection) +- Save invalid block to temp --save-invalid-block-temp +- Compute unrealized checkpoints with pcli +- Add gossip blob sidecar verification ms metric +- Backfill min slot flag (feature flag --backfill-oldest-slot) +- adds a metric to track blob sig cache lookups +- Keymanager APIs - get,post,delete graffiti +- Set default LocalBlockValueBoost to 10 +- Add bid value metrics +- REST VC metrics + +### Changed + +- Normalized checkpoint logs +- Normalize filesystem/blob logs +- Updated gomock libraries +- Use Max Request Limit in Initial Sync +- Do not Persist Startup State +- Normalize backfill logs/errors +- Unify log fields +- Do Not Compute Block Root Again +- Optimize Adding Dirty Indices +- Use a Validator Reader When Computing Unrealized Balances +- Copy Validator Field Trie +- Do not log zero sync committee messages +- small cleanup on functions: use slots.PrevSlot +- Set the log level for running on as INFO. +- Employ Dynamic Cache Sizes +- VC: Improve logging in case of fatal error +- refactoring how proposer settings load into validator client +- Spectest: Unskip Merkle Proof test +- Improve logging. +- Check Unrealized Justification Balances In Spectests +- Optimize SubscribeCommitteeSubnets VC action +- Clean up unreachable code; use new(big.Int) instead of big.NewInt(0) +- Update bazel, rules_go, gazelle, and go versions +- replace receive slot with event stream +- New gossip cache size +- Use headstate for recent checkpoints +- Update spec test to official 1.4.0 +- Additional tests for KZG commitments +- Enable Configurable Mplex Timeouts +- Optimize SubmitAggregateSelectionProof VC action +- Re-design TestStartDiscV5_DiscoverPeersWithSubnets test +- Add da waited time to sync block log +- add log message if in da check at slot end +- Log da block root in hex +- Log the slot and blockroot when we deadline waiting for blobs +- Modify the algorithm of updateFinalizedBlockRoots +- Rename payloadattribute Timestamps to Timestamp +- Optimize GetDuties VC action +- docker: Add bazel target for building docker tarball +- Utilize next slot cache in block rewards rpc +- Spec test coverage report +- Refactor batch verifier for sharing across packages + +### Removed + +- Remove unused bolt buckets +- config: Remove DOMAIN_BLOB_SIDECAR. +- Remove unused deneb code +- Clean up: remove some unused beacon state protos +- Cleaned up code in the sync package +- P2P: Simplify code + +### Fixed + +- Slasher: Reduce surrounding/surrounded attestations processing time +- Fix blob batch verifier pointer receiver +- db/blobs: Check non-zero data is written to disk +- avoid part path collisions with mem addr entropy +- Download checkpoint sync origin blobs in init-sync +- bazel: Update aspect-build/bazel-lib to v2.5.0 +- move setting route handlers to registration from start +- Downgrade Level DB to Stable Version +- Fix failed reorg log +- Fix Data Race in Epoch Boundary +- exit blob fetching for cp block if outside retention +- Do not check parent weight on early FCU +- Fix VC DB conversion when no proposer settings is defined and add Experimental flag in the --enable-minimal-slashing-protection help. +- keymanager api: lowercase statuses +- Fix unrealized justification +- fix race condition when pinging peers +- Fix/race receive block +- Blob verification spectest +- Ignore Pubsub Messages Hitting Context Deadlines +- Use justified checkpoint from head state to build attestation +- only update head at 10 seconds when validating +- Use correct gossip validation time +- fix 1-worker underflow; lower default batch size +- handle special case of batch size=1 +- Always Set Inprogress Boolean In Cache +- Builder APIs: adding headers to post endpoint +- Rename mispelled variable +- allow blob by root within da period +- Rewrite Pruning Implementation To Handle EIP 7045 +- Set default fee recipient if tracked val fails +- validator client on rest mode has an inappropriate context deadline for events +- validator client should set beacon API endpoint in configurations +- Fix get validator endpoint for empty query parameters +- Expand Our TTL for our Message ID Cache +- fix some typos +- fix handling of goodbye messages for limited peers +- create the log file along with its parent directory if not present +- Call GetGenesis only once + +### Security + +- Go version has been updated from 1.21.6 to 1.21.8. + +## [v5.0.1](https://github.com/prysmaticlabs/prysm/compare/v5.0.0...v5.0.1) - 2024-03-08 + +This minor patch release has some nice improvements over the recent v5.0.0 for Deneb. We have minimized this patch release to include only low risk and valuable fixes or features ahead of the upcoming network upgrade on March 13th. + +Deneb is scheduled for mainnet epoch 269568 on March 13, 2024 at 01:55:35pm UTC. All operators MUST update their Prysm software to v5.0.0 or later before the upgrade in order to continue following the blockchain. + +### Added + +- A new flag to ensure that blobs are flushed to disk via fsync immediately after write. --blob-save-fsync + +### Changed + +- Enforce a lower maximum batch limit value to prevent annoying peers +- Download blobs for checkpoint sync block before starting sync +- Set justified epoch to the finalized epoch in Goerli to unstuck some Prysm nodes on Goerli + +### Fixed + +- Data race in epoch boundary cache +- "Failed reorg" log was misplaced +- Do not check parent weights on early fork choice update calls +- Compute unrealized justification with slashed validators +- Missing libxml dependency + +### Security + +Prysm version v5.0.0 or later is required to maintain participation in the network after the Deneb upgrade. + +## [v5.0.0](https://github.com/prysmaticlabs/prysm/compare/v4.2.1...v5.0.0) + +Behold the Prysm v5 release with official support for Deneb on Ethereum mainnet! + +Deneb is scheduled for mainnet epoch 269568 on March 13, 2024 at 01:55:35pm UTC. All operators MUST update their Prysm software to v5.0.0 or later before the upgrade in order to continue following the blockchain. + +This release brings improvements to the backfill functionality of the beacon node to support backfilling blobs. If running a beacon node with checkpoint sync, we encourage you to test the backfilling functionality and share your feedback. Run with backfill enabled using the flag --enable-experimental-backfill. + +Known Issues + +- --backfill-batch-size with a value of 1 or less breaks backfill. +- Validator client on v4.2.0 or older uses some API methods that are incompatible with beacon node v5. Ensure that you have updated the beacon node and validator client to v4.2.1 and then upgrade to v5 or update both processes at the same time to minimize downtime. + +### Added + +- Support beacon_committee_selections +- /eth/v1/beacon/deposit_snapshot +- Docker images now have coreutils pre-installed +- da_waited_time_milliseconds tracks total time waiting for data availablity check in ReceiveBlock +- blob_written, blob_disk_count, blob_disk_bytes new metrics for tracking blobs on disk +- Backfill supports blob backfilling +- Add mainnet deneb fork epoch config + +### Changed + +- --clear-db and --force-clear-db flags now remove blobs as well as beaconchain.db +- EIP-4881 is now on by default. +- Updates filtering logic to match spec +- Verbose signature verification is now on by default +- gossip_block_arrival_milliseconds and gossip_block_verification_milliseconds measure in +- milliseconds instead of nanoseconds +- aggregate_attestations_t1 histogram buckets have been updated +- Reduce lookahead period from 8 to 4. This reduces block batch sizes during sync to account for +- larger blocks in deneb. +- Update gohashtree to v0.0.4-beta +- Various logging improvements +- Improved operations during syncing +- Backfill starts after initial-sync is complete + +### Deprecated + +The following flags have been removed entirely: + +- --enable-reorg-late-blocks +- --disable-vectorized-htr +- --aggregate-parallel +- --build-block-parallel +- --enable-registration-cache, disable-gossip-batch-aggregation +- --safe-slots-to-import-optimistically +- --show-deposit-data + + +### Removed + +- Prysm gRPC slasher endpoints are removed +- Remove /eth/v1/debug/beacon/states/{state_id} +- Prysm gRPC endpoints that were marked as deprecated in v4 have been removed +- Remove /eth/v1/beacon/blocks/{block_id} + +### Fixed + +- Return unaggregated if no aggregated attestations available in GetAggregateAttestation +- Fix JWT auth checks in certain API endpoints used by the web UI +- Return consensus block value in wei units +- Minor fixes in protobuf files +- Fix 500 error when requesting blobs from a block without blobs +- Handle cases were EL client is syncing and unable to provide payloads +- /eth/v1/beacon/blob_sidecars/{block_id} correctly returns an error when invalid indices are requested +- Fix head state fetch when proposing a failed reorg +- Fix data race in background forkchoice update call +- Correctly return "unavailable" response to peers requesting batches before the node completes +- backfill. +- Many significant improvements and fixes to the prysm slasher +- Fixed slashing gossip checks, improves peer scores for slasher peers +- Log warning if attempting to exit more than 5 validators at a time +- Do not cache inactive public keys +- Validator exits prints testnet URLs +- Fix pending block/blob zero peer edge case +- Check non-zero blob data is written to disk +- Avoid blob partial filepath collisions with mem addr entropy + + +### Security + +v5.0.0 of Prysm is required to maintain participation in the network after the Deneb upgrade. + +## [v4.2.1](https://github.com/prysmaticlabs/prysm/compare/v4.2.0...v4.2.1) - 2024-01-29 + +Welcome to Prysm Release v4.2.1! This release is highly recommended for stakers and node operators, possibly being the final update before V5. + +⚠️ This release will cause failures on Goerli, Sepolia and Holeski testnets, when running on certain older CPUs without AVX support (eg Celeron) after the Deneb fork. This is not an issue for mainnet. + +### Added + +- Linter: Wastedassign linter enabled to improve code quality. +- API Enhancements: + - Added payload return in Wei for /eth/v3/validator/blocks. + - Added Holesky Deneb Epoch for better epoch management. +- Testing Enhancements: + - Clear cache in tests of core helpers to ensure test reliability. + - Added Debug State Transition Method for improved debugging. + - Backfilling test: Enabled backfill in E2E tests for more comprehensive coverage. +- API Updates: Re-enabled jwt on keymanager API for enhanced security. +- Logging Improvements: Enhanced block by root log for better traceability. +- Validator Client Improvements: + - Added Spans to Core Validator Methods for enhanced monitoring. + - Improved readability in validator client code for better maintenance (various commits). + +### Changed + +- Optimizations and Refinements: + - Lowered resource usage in certain processes for efficiency. + - Moved blob rpc validation closer to peer read for optimized processing. + - Cleaned up validate beacon block code for clarity and efficiency. + - Updated Sepolia Deneb fork epoch for alignment with network changes. + - Changed blob latency metrics to milliseconds for more precise measurement. + - Altered getLegacyDatabaseLocation message for better clarity. + - Improved wait for activation method for enhanced performance. + - Capitalized Aggregated Unaggregated Attestations Log for consistency. + - Modified HistoricalRoots usage for accuracy. + - Adjusted checking of attribute emptiness for efficiency. +- Database Management: + - Moved --db-backup-output-dir as a deprecated flag for database management simplification. + - Added the Ability to Defragment the Beacon State for improved database performance. +- Dependency Update: Bumped quic-go version from 0.39.3 to 0.39.4 for up-to-date dependencies. + +### Removed + +- Removed debug setting highest slot log to clean up the logging process. +- Deleted invalid blob at block processing for data integrity. + +### Fixed + +- Bug Fixes: + - Fixed off by one error for improved accuracy. + - Resolved small typo in error messages for clarity. + - Addressed minor issue in blsToExecChange validator for better validation. + - Corrected blobsidecar json tag for commitment inclusion proof. + - Fixed ssz post-requests content type check. + - Resolved issue with port logging in bootnode. +- Test Fixes: Re-enabled Slasher E2E Test for more comprehensive testing. + +### Security + +No security issues in this release. + +## [v4.2.0](https://github.com/prysmaticlabs/prysm/compare/v4.1.1...v4.2.0) - 2024-01-11 + +Happy new year! We have an incredibly exciting release to kick off the new year. This release is **strongly recommended** for all operators to update as it has many bug fixes, security patches, and features that will improve the Prysm experience on mainnet. This release has so many wonderful changes that we've deviated from our normal release notes format to aptly categorize the changes. + +### Highlights + +#### Upgrading / Downgrading Validators + +There are some API changes bundled in this release that require you to upgrade or downgrade in particular order. If the validator is updated before the beacon node, it will see repeated 404 errors at start up until the beacon node is updated as it uses a new API endpoint introduced in v4.2.0. + +:arrow_up_small: **Upgrading**: Upgrade the beacon node, then the validator. +:arrow_down_small: **Downgrading**: Downgrade the validator to v4.1.1 then downgrade the beacon node. + +#### Deneb Goerli Support +This release adds in full support for the upcoming deneb hard fork on goerli next week on January 17th. + +#### Networking Parameter Changes +This release increases the default peer count to 70 from 45. The reason this is done is so that node's running +with default peer counts can perform their validator duties as expected. Users who want to use the old peer count +can add in `--p2p-max-peers=45` as a flag. + +#### Profile Guided Optimization +This release has binaries built using PGO, for more information on how it works feel free to look here: https://tip.golang.org/doc/pgo . +This allows the go compiler to build more optimized Prysm binaries using production profiles and workloads. + +#### ARM Supported Docker Images + +Our docker images now support amd64 and arm64 architecture! This long awaited feature is finally here for Apple Silicon and Raspberry Pi users. + +### Deneb + +#### Core + +- Use ROForkchoice in blob verifier +- Add Goerli Deneb Fork Epoch +- Use deneb key for deneb state in saveStatesEfficientInternal +- Initialize Inactivity Scores Correctly +- Excluse DA wait time for chain processing time +- Initialize sig cache for verification.Initializer +- Verify roblobs +- KZG Commitment inclusion proof verifier +- Merkle Proofs of KZG commitments +- Add RO blob sidecar +- Check blob index duplication for blob notifier +- Remove sidecars with invalid proofs +- Proposer: better handling of blobs bundle +- Update proposer RPC to new blob sidecar format +- Implement Slot-Dependent Caching for Blobs Bundle +- Verified roblobs + +#### Networking + +- Check sidecar index in BlobSidecarsByRoot response +- Use proposer index cache for blob verification +- VerifiedROBlobs in initial-sync +- Reordered blob validation +- Initialize blob storage for initial sync service +- Use verified blob for gossip checks +- Update broadcast method to use `BlobSidecar` instead of `SingedBlobSidecar` +- Remove pending blobs queue +- Reject Blob Sidecar Incorrect Index +- Check return and request lengths for blob sidecar by root +- Fix blob sidecar subnet check +- Add pending blobs queue for missing parent block +- Verify blobs that arrived from by root request +- Reject blobs with invalid parent +- Add more blob and block checks for by range +- Exit early if blob by root request is empty +- Request missing blobs while processing pending queue +- Check blob exists before requesting from peer +- Passing block as arugment for sidecar validation + +#### Blob Management + +- Remove old blob types +- minimize syscalls in pruning routine +- Prune dangling blob +- Use Afero Walk for Pruning Blob +- Initialize blob storage without pruning +- Fix batch pruning errors +- Blob filesystem add pruning during blob write +- Blob filesystem add pruning at startup +- Ensure partial blob is deleted if there's an error +- Split blob pruning into two funcs +- Use functional options for `--blob-retention-epochs` +- Blob filesystem: delete blobs +- Fix Blob Storage Path +- Add blob getters +- Blob filesystem: Save Blobs +- Blob filesystem: prune blobs +- blobstorage: Improve mkdirall error + +#### Beacon-API + +- Add rpc trigger for blob sidecar event +- Do not skip mev boost in `v3` block production endpoint +- Beacon APIs: re enabling blob events +- Beacon API: update Deneb endpoints after removing blob signing +- Beacon API: fix get blob returns 500 instead of empty +- Fix bug in Beacon API getBlobs +- Fix blob_sidecar SSE payload +- fix(beacon-chain/rpc): blob_sidecar event stream handler +- Improvements to `produceBlockV3` +- Deneb: Produce Block V3 - adding consensus block value + +#### Validator Client + +- Validator client: remove blob signing +- Deneb - web3signer + +#### Testing + +- Enable Deneb For E2E Scenario Tests +- Activate deneb in E2E +- Deneb E2E + +#### Miscellaneous + +- Update blob pruning log +- Fix total pruned metric + add to logging +- Check kzg commitment count from builder +- Add error wrapping to blob initialization errors +- Blob filesystem metrics +- Check builder header kzg commitment +- Add more color to sending blob by range req log +- Move pruning log to after retention check +- Enhance Pruning Logs +- Rename Blob retention epoch flag +- Check that blobs count is correct when unblinding +- Log blob's kzg commmitment at sync +- Replace MAX_BLOB_EPOCHS usages with more accurate terms +- Fix comment of `BlobSidecarsBySlot` + +### Core Prysm Work(Non-Deneb) + +#### Core Protocol + +- Only process blocks which haven't been processed +- Initialize exec payload fields and enforce order +- Add nil check for head in IsOptimistic +- Unlock forkchoice store if attribute is empty +- Make Aggregating In Parallel The Permanent Default +- Break out several helpers from `postBlockProcess` +- Don't hardcode 4 seconds in forkchoice +- Simplify fcu 4 +- Remove the getPayloadAttribute call from updateForkchoiceWithExecution +- Simplify fcu 2 +- Remove getPayloadAttributes from FCU call +- Simplify fcu 1 +- Remove unsafe proposer indices cache +- Rewrite `ProposeBlock` endpoint +- Remove blind field from block type +- update shuffling caches before calling FCU on epoch boundaries +- Return SignedBeaconBlock from ReadOnlySignedBeaconBlock.Copy +- Use advanced epoch cache when preparing proposals +- refactor Payload Id caches +- Use block value correctly when proposing a block +- use different keys for the proposer indices cache +- Use a cache of one entry to build attestation +- Remove signed block requirement from no-verify functions +- Allow requests for old target roots +- Remove Redundant Hash Computation in Cache +- Fix FFG LMD Consistency Check (Option 2) +- Verify lmd without ancestor +- Track target in forkchoice +- Return early from ReceiveBlock if already sycned + +#### Builder + +- Adding builder boost factor to get block v3 +- Builder API: Fix max field check on toProto function +- Add sanity checks for bundle from builder +- Update Prysm Proposer end points for Builder API +- Builder API: remove blinded blob sidecar +- Allow validators registration batching on Builder API `/eth/v1/builder/validators` + +#### State-Management + +- Add Detailed Multi Value Metrics +- Optimize Multivalue Slice For Trie Recomputation +- Fix Multivalue Slice Deadlock +- Set Better Slice Capacities in the State + +#### Networking + +- Refactor Network Config Into Main Config +- Handle potential error from newBlockRangeBatcher +- Clean Up Goodbye Stream Errors +- Support New Subnet Backbone +- Increase Networking Defaults +- Bump Up Gossip Queue Size +- Improve Gossipsub Rejection Metric +- Add Gossipsub Queue Flag +- Fix Deadlock With Subscriber Checker +- Add Additional Pubsub Metrics +- Verify Block Signatures On Insertion Into Pending Queue +- Enhance Validation for Block by Root RPC Requests +- Add a helper for max request block +- Fix Pending Queue Deadline Bug +- Add context deadline for pending queue's receive block +- Fix Pending Queue Expiration Bug +- sync only up to previous epoch on phase 1 +- Use correct context for sendBatchRootRequest +- Refactor Pending Block Queue Logic in Sync Package +- Check block exists in pending queue before requesting from peer +- Set Verbosity of Goodbye Logs to Trace +- use read only head state + +#### Beacon-API + +_Most of the PRs here involve shifting our http endpoints to using vanilla http handlers(without the API middleware)._ + +- http endpoint cleanup +- Revert "REST VC: Subscribe to Beacon API events " +- proposer and attester slashing sse +- REST VC: Subscribe to Beacon API events +- Simplify error handling for JsonRestHandler +- Update block publishing to 2.4.2 spec +- Use `SkipMevBoost` properly during block production +- Handle HTTP 404 Not Found in `SubmitAggregateAndProof` +- beacon-chain/rpc: use BalanceAtIndex instead of Balances to reduce memory copy +- HTTP endpoints cleanup +- APIs: reusing grpc cors middleware for rest +- Beacon API: routes unit test +- Remove API Middleware +- HTTP validator API: beacon and account endpoints +- REST VC: Use POST to fetch validators +- HTTP handler for Beacon API events +- Move weak subjectivity endpoint to HTTP +- Handle non-JSON responses from Beacon API +- POST version of GetValidators and GetValidatorBalances +- [2/5] light client http api +- HTTP validator API: wallet endpoints +- HTTP Validator API: slashing protection import and export +- Config HTTP endpoints +- Return 404 from `eth/v1/beacon/headers` when there are no blocks +- Pool slashings HTTP endpoints +- Validator HTTP endpoints +- Debug HTTP endpoints +- HTTP validator API: health endpoints +- HTTP Validator API: `/eth/v1/keystores` +- Allow unknown fields in Beacon API responses +- HTTP state endpoints +- HTTP Validator API: `/eth/v1/validator/{pubkey}/feerecipient` +- HTTP Validator API: `/eth/v1/validator/{pubkey}/gas_limit` +- HTTP VALIDATOR API: remote keymanager api `/eth/v1/remotekeys` +- rpc/apimiddleware: Test all paths can be created +- HTTP Beacon APIs for blocks +- HTTP VALIDATOR API: `/eth/v1/validator/{pubkey}/voluntary_exit` +- HTTP Beacon APIs: 3 state endpoints +- HTTP Beacon APIs for node +- HTTP API: `/eth/v1/beacon/pool/bls_to_execution_changes` +- Register sync subnet when fetching sync committee duties through Beacon API + +#### Validator Client + +- Refactor validator client help. +- `--validatorS-registration-batch-size` (add `s`) +- Validator client: Always use the `--datadir` value. +- Hook to slot stream instead of block stream on the VC +- CLI: fixing account import ux bugs +- `filterAndCacheActiveKeys`: Stop filtering out exiting validators +- Gracefully handle unknown validator index in the REST VC +- Don't fetch duties for unknown keys +- Fix Domain Data Caching +- Add `--jwt-id` flag +- Make Prysm VC compatible with the version `v5.3.0` of the slashing protections interchange tests. +- Fix handling POST requests in the REST VC +- Better error handling in REST VC +- Fix block proposals in the REST validator client +- CLEANUP: validator exit prompt +- integrate validator count endpoint in validator client + +#### Build/CI Work + +- Bazel 7.0.0 +- Sort static analyzers, add more, fix violations +- For golangci-lint, enable all by default +- Enable mirror linter and fix findings +- Enable usestdlibvars linter and fix findings +- Fix docker image version strings in CI +- fixing sa4006 +- Enable errname linter and fix findings +- Remove rules_docker, make multiarch images canonical +- Fix staticcheck violations +- Add staticchecks to bazel builds +- CI: Add merge queue events trigger for github workflows +- Update bazel and other CI improvements +- bazel: Run buildifier, general cleanup +- pgo: Enable pgo behind release flag +- pgo: remove default pprof profile +- zig: Update zig to recent main branch commit +- Enable profile guided optimization for beacon-chain +- Refactor Exported Names to Follow Golang Best Practices +- Update rules_go and gazelle to 0.42 & 0.33 (latest releases) +- Fix image deps + +#### Dependency Updates + +- Update go to 1.21.6 +- Update Our Golang Crypto Library +- Update libp2p/go-libp2p-asn-util to v0.4.1 +- Update Libp2p To v0.32.1 and Go to v1.21.5 +- Bump google.golang.org/grpc from 1.53.0 to 1.56.3 +- Update go to 1.20.10 + +#### Testing + +- Enable Profiling for Long Running E2E Runs +- Fetch Goroutine Traces in E2E +- Fix Up Builder Evaluator +- Increase Blob Batch Parameters in E2E +- Uncomment e2e flakiness +- Update spectests to 1.4.0-beta.5 +- Test improvement TestValidateVoluntaryExit_ValidExit +- Simplify post-evaluation in Beacon API evaluator +- Run Evaluator In the Middle Of An Epoch +- Simplify Beacon API evaluator +- Fix Optimistic Sync Evaluator +- Add test helpers to produce commitments and proofs +- Redesign of Beacon API evaluator +- Drop Transaction Count for Transaction Generator +- Add concurrency test for getting attestation state +- Add `construct_generic_block_test` to build file +- Implement Merkle proof spectests +- Remove `/node/peers/{peer_id}` from Beacon API evaluator +- Update spectest and changed minimal preset for field elements +- Better Beacon API evaluator part 1 +- beacon-chain/blockchain: fix some datarace in go test +- beacon-node/rpc: fix go test datarace +- Fix Builder Testing For Multiclient Runs +- Fill state attestations +- beacon-chain/sync: fix some datarace in go test +- beacon-chain/execution: fix a data race in testcase +- Add state not found test case + +#### Feature Updates + +- Make New Engine Methods The Permanent Default +- Make Reorging Of Late Blocks The Permanent Default + +#### Miscellaneous + +- Update teku's bootnode +- fix metric for exited validator +- Fix typos +- Replace validator count with validator indices in update fee recipient log +- Log value of local payload when proposing +- Small encoding fixes on logs and http error code change +- typo fix +- Fix error string generation for missing commitments +- Increase buffer of events channel +- Fix missing testnet versions. Issue +- Update README.md +- Only run metrics for canonical blocks +- Relax file permissions check on existing directories +- forkchoice.Getter wrapper with locking wrappers +- Initialize cancellable root context in main.go +- Fix forkchoice pkg's comments grammar +- lock RecentBlockSlot +- Comment typo +- Optimize `ReplayBlocks` for Zero Diff +- Remove default value of circuit breaker flags +- Fix Withdrawals +- Remove no-op cancel func +- Update Terms of Service +- fix head slot in log +- DEPRECTATION: Remove exchange transition configuration call +- fix segmentation fork when Capella for epoch is MaxUint64 +- Return Error Gracefully When Removing 4881 Flag +- Add zero length check on indices during NextSyncCommitteeIndices +- Replace Empty Slice Literals with Nil Slices +- Refactor Error String Formatting According to Go Best Practices +- Fix redundant type converstion +- docs: fix typo +- Add Clarification To Sync Committee Cache +- Fix typos +- remove bad comment +- Remove confusing comment +- Log when sending FCU with payload attributes +- Fix Withdrawals Marshalling +- beacon-chain/execution: no need to reread and unmarshal the eth1Data twice + +## [v4.1.1](https://github.com/prysmaticlabs/prysm/compare/v4.1.0...v4.1.1) - 2023-10-24 + +This patch release includes two cherry-picked changes from the develop branch to resolve critical issues that affect a small set of users. + +### Fixed + +- Fix improperly registered REST API endpoint for validators using Prysm's REST API with an external builder +- Fix deadlock when using --enable-experimental-state feature + +### Security + +No security issues in thsi release. + +## [v4.1.0](https://github.com/prysmaticlabs/prysm/compare/v4.0.8...v4.1.0) - 2023-08-22 + +- **Fundamental Deneb Support**: This release lays the foundation for Deneb support, although features like backwards syncing and filesystem-based blob storage are planned for Q4 2024. +- **Multi-Value Slices for Beacon State**: Implemented multi-value slices to reduce the memory footprint and optimize certain processing paths. This data structure allows for storing values shared between state instances more efficiently. This feature is controller by the `--enable-experimental-state` flag. +- **EIP-4881 Deposit Tree**: Integrated the EIP-4881 Deposit Tree into Prysm to optimize runtime block processing and production. This feature is controlled by a flag: `--enable-eip-4881` +- **BLST version 0.3.11**: Introduced a significant improvement to the portable build's performance. The portable build now features runtime detection, automatically enabling optimized code paths if your CPU supports it. +- **Multiarch Containers Preview Available**: multiarch (:wave: arm64 support :wave:) containers will be offered for preview at the following locations: + - Beacon Chain: [gcr.io/prylabs-dev/prysm/beacon-chain:v4.1.0](gcr.io/prylabs-dev/prysm/beacon-chain:v4.1.0) + - Validator: [gcr.io/prylabs-dev/prysm/validator:v4.1.0](gcr.io/prylabs-dev/prysm/validator:v4.1.0) + - Please note that in the next cycle, we will exclusively use these containers at the canonical URLs. + +### Added + +#### EIP-4844: +##### Core: +- **Deneb State & Block Types**: New state and block types added specifically for Deneb. +- **Deneb Protobufs**: Protocol Buffers designed exclusively for Deneb. +- **Deneb Engine API**: Specialized API endpoints for Deneb. +- **Deneb Config/Params**: Deneb-specific configurations and parameters from the deneb-integration branch. + +##### Blob Management: +- **Blob Retention Epoch Period**: Configurable retention periods for blobs. +- **Blob Arrival Gossip Metric**: Metrics for blob arrivals via gossip protocol. +- **Blob Merge Function**: Functionality to merge and validate saved/new blobs. +- **Blob Channel**: A channel dedicated to blob processing. +- **Save Blobs to DB**: Feature to save blobs to the database for subscribers. + +##### Logging and Validation: +- **Logging for Blob Sidecar**: Improved logging functionalities for Blob Sidecar. +- **Blob Commitment Count Logging**: Introduced logging for blob commitment counts. +- **Blob Validation**: A feature to validate blobs. + +##### Additional Features and Tests: +- **Deneb Changes & Blobs to Builder**: Deneb-specific changes and blob functionality added to the builder. +- **Deneb Blob Sidecar Events**: Blob sidecar events added as part of the Deneb release. +- **KZG Commitments**: Functionality to copy KZG commitments when using the builder block. +- **Deneb Validator Beacon APIs**: New REST APIs specifically for the Deneb release. +- **Deneb Tests**: Test cases specific to the Deneb version. +- **PublishBlockV2 for Deneb**: The `publishblockv2` endpoint implemented specifically for Deneb. +- **Builder Override & Builder Flow for Deneb**: An override for the builder and a new RPC to handle the builder flow in Deneb. +- **SSZ Detection for Deneb**: SSZ detection capabilities added for Deneb. +- **Validator Signing for Deneb**: Validators can now sign Deneb blocks. +- **Deneb Upgrade Function**: A function to handle the upgrade to Deneb. + +#### Rest of EIPs +- **EIP-4788**: Added support for Beacon block root in the EVM. +- **EIP-7044** and **EIP-7045**: Implemented support for Perpetually Valid Signed Voluntary Exits and increased the max attestation inclusion slot. + +#### Beacon API: + +*Note: All Beacon API work is related with moving endpoints into pure HTTP handlers. This is NOT new functionality.* + +##### Endpoints moved to HTTP: +- `/eth/v1/beacon/blocks` and `/eth/v1/beacon/blinded_blocks`. +- `/eth/v1/beacon/states/{state_id}/committees`. +- `/eth/v1/config/deposit_contract`. +- `/eth/v1/beacon/pool/sync_committees`. +- `/eth/v1/beacon/states/{state_id}/validators`, `/eth/v1/beacon/states/{state_id}/validators/{validator_id}` and `/eth/v1/beacon/states/{state_id}/validator_balances`. +- `/eth/v1/validator/duties/attester/{epoch}`, `/eth/v1/validator/duties/proposer/{epoch}` and `/eth/v1/validator/duties/sync/{epoch}`. +- `/eth/v1/validator/register_validator`. +- `/eth/v1/validator/prepare_beacon_proposer`. +- `/eth/v1/beacon/headers`. +- `/eth/v1/beacon/blocks/{block_id}/root`. +- `/eth/v1/validator/attestation_data`. +- `/eth/v1/validator/sync_committee_contribution`. +- `/eth/v1/beacon/genesis` and `/eth/v1/beacon/states/{state_id}/finality_checkpoints`. +- `/eth/v1/node/syncing`. +- `/eth/v1/beacon/pool/voluntary_exits`. +- `/eth/v1/beacon/headers/{block_id}` and `/eth/v1/validator/liveness/{epoch}`. + +##### Miscellaneous: +- **Comma-Separated Query Params**: Support for comma-separated query parameters added to Beacon API. +- **Middleware for Query Params**: Middleware introduced for handling comma-separated query parameters. +- **Content-Type Header**: Compliance improved by adding Content-Type header to VC POST requests. +- **Node Version**: REST-based node version endpoint implemented. + +#### Other additions +##### Protocol: +- **Multi-Value Slice for Beacon State**: Enhanced the beacon state by utilizing a multi-value slice. +- **EIP-4881 Deposit Tree**: EIP-4881 Deposit Tree integrated into Prysm, controlled by a feature flag. +- **New Engine Methods**: New engine methods set as the default. +- **Light Client Sync Protocol**: Initiation of a 5-part light client sync protocol. +- **Block Commitment Checks**: Functionality to reject blocks with excessive commitments added. + +##### State Management: +- **Alloc More Items**: Modified beacon-node/state to allocate an additional item during appends. +- **GetParentBlockHash Helper**: Refactoring of `getLocalPayloadAndBlobs` with a new helper function for fetching parent block hashes. +- **RW Lock for Duties**: Read-Write lock mechanism introduced for managing validator duties. + +##### Build and CI/CD Improvements: +- **Manual Build Tag**: A "manual" build tag introduced to expedite CI build times. +- **Multiarch Docker Containers**: Support for multiple architectures in Docker containers added. + +##### Testing: +- **Init-Sync DA Tests**: Tests for initial sync Data Availability (DA) included. +- **Fuzz List Timeout**: Github workflow for fuzz testing now includes a timeout setting. +- **Go Fuzzing Workflow**: New Github workflow for Go fuzzing on a cron schedule. + +##### Logging and Monitoring: +- **FFG-LMD Consistency Logging**: Enhanced logging for Finality Gadget LMD (FFG-LMD) consistency. +- **Validator Count Endpoint**: New endpoint to count the number of validators. + +##### User Interface and Web: +- **Web UI Release**: Prysm Web UI v2.0.4 released with unspecified updates and improvements. + +##### Testnet support: +- **Holesky Support**: Support for Holesky decompositions integrated into the codebase. + +##### Error Handling and Responses: +- **Validation Error in ForkchoiceUpdatedResponse**: Included validation errors in fork choice update responses. +- **Wrapped Invalid Block Error**: Improved error handling for cases where an invalid block error is wrapped.. + +### Changed + +#### General: +- **Skip MEV-Boost Flag**: Updated `GetBlock` RPC to utilize `skip mev-boost` flag. +- **Portable Version of BLST**: Transitioned to portable BLST version as default. +- **Teku Mainnet Bootnodes**: Refreshed Teku mainnet bootnodes ENRs. +- **Geth Version Updates**: Elevated geth to version v1.13.1 for additional stability and features. +- **Parallel Block Building**: Deprecated sequential block building path + +#### Deneb-Specific Changes: +- **Deneb Spectests Release**: Upgraded to Deneb spectests v1.4.0-beta.2-hotfix. +- **Deneb API and Builder Cleanup**: Conducted clean-up activities for Deneb-specific API and builder. +- **Deneb Block Versioning**: Introduced changes related to Deneb produce block version 3. +- **Deneb Database Methods**: Adapted database methods to accommodate Deneb. +- **Unused Code Removal**: Eliminated an unused function and pending blobs queue. +- **Blob Sidecar Syncing**: Altered behavior when value is 0. + +#### Code Cleanup and Refactor: +- **API Types Cleanup**: Reorganized API types for improved readability. +- **Geth Client Headers**: Simplified code for setting geth client headers. +- **Bug Report Template**: Revised requirements for more clarity. + +#### Flags and Configuration: +- **Safe Slots to Import Flag**: Deprecated this flag for standard alignment. +- **Holesky Config**: Revised the Holesky configuration for new genesis. + +#### Logging: +- **Genesis State Warning**: Will log a warning if the genesis state size is under 1KB. +- **Debug Log Removal**: Excised debug logs for cleaner output. + +#### Miscellaneous: +- **First Aggregation Timing**: Default setting for first aggregation is 7 seconds post-genesis. +- **Pointer Usage**: Modified execution chain to use pointers, reducing copy operations. + +#### Dependency Updates: +- **Go Version Update**: Updated to Go version 1.20.7. +- **Go Version Update**: Updated to Go version 1.20.9 for better security. +- **Various Dependencies**: Updated multiple dependencies including Geth, Bazel, rules_go, Gazelle, BLST, and go-libp2p. + +### Removed + +- **Remote Slashing Protection**: Eliminated the remote slashing protection feature. +- **Go-Playground/Validator**: Removed the go-playground/validator dependency from the Beacon API. +- **Revert Cache Proposer ID**: Reverted the caching of proposer ID on GetProposerDuties. +- **Go-Playground/Validator**: Removed go-playground/validator from Beacon API. +- **Reverted Cache Proposer ID**: Reversed the change that cached proposer ID on GetProposerDuties. +- **Cache Proposer ID**: Reversed the functionality that cached proposer ID on GetProposerDuties. +- **Quadratic Loops in Exiting**: Eliminated quadratic loops that occurred during voluntary exits, improving performance. +- **Deprecated Go Embed Rules**: Removed deprecated `go_embed` rules from rules_go, to stay up-to-date with best practices. +- **Alpine Images**: Removed Alpine images from the Prysm project. + +### Fixed + +#### Deneb-Specific Bug Fixes: +- **Deneb Builder Bid HTR**: Fixed an issue related to HashTreeRoot (HTR) in Deneb builder bid. +- **PBV2 Condition**: Corrected conditions related to PBV2. +- **Route Handler and Cleanup**: Updated the route handler and performed minor cleanups. +- **Devnet6 Interop Issues**: Resolved interoperability issues specific to Devnet6. +- **Sepolia Version**: Updated the version information for the Sepolia testnet. +- **No Blob Bundle Handling**: Rectified the handling when no blob bundle exists. +- **Blob Sidecar Prefix**: Corrected the database prefix used for blob sidecars. +- **Blob Retrieval Error**: Added specific error handling for blob retrieval from the database. +- **Blob Sidecar Count**: Adjusted metrics for accurate blob sidecar count. +- **Sync/RPC Blob Usage**: Rectified blob usage when requesting a block by root in Sync/RPC. + +#### Cache Fixes: +- **Don't Prune Proposer ID Cache**: Fixed a loop erroneously pruning the proposer ID cache. +- **LastRoot Adjustment**: Altered `LastRoot` to return the head root. +- **Last Canonical Root**: Modified forkchoice to return the last canonical root of the epoch. + +#### Block Processing fixes: +- **Block Validation**: Fixed an issue where blocks were incorrectly marked as bad during validation. +- **Churn Limit Helpers**: Improved churn limit calculations through refactoring. +- **Churn with 0 Exits**: Rectified a bug that calculated churn even when there were 0 exits. +- **Proposer Duties Sorting**: Resolved sorting issues in proposer duties. +- **Duplicate Block Processing**: Eliminated redundant block processing. + +#### Error Handling and Logging: +- **RpcError from Core Service**: Ensured that `RpcError` is returned from core services. +- **Unhandled Error**: Enhanced error management by handling previously unhandled errors. +- **Error Handling**: Wrapped `ctx.Err` for improved error handling. +- **Attestation Error**: Optimized error management in attestation processing. + +#### Test and Build Fixes: +- **Racy Tests in Blockchain**: Resolved race conditions in blockchain tests. +- **TestService_ReceiveBlock**: Modified `TestService_ReceiveBlock` to work as expected. +- **Build Issue with @com_github_ethereum_c_kzg_4844**: Resolved build issues related to this specific library. +- **Fuzz Testing**: Addressed fuzz testing issues in the `origin/deneb-integration` +- **Long-Running E2E Tests**: Fixed issues that were causing the end-to-end tests to run for an extended period. + +#### Additional Fixes: +- **Public Key Copies During Aggregation**: Optimized to avoid unnecessary public key copies during aggregation. +- **Epoch Participations**: Fixed the setting of current and previous epoch participations. +- **Verify Attestations**: Resolved an attestation verification issue in proposer logic. +- **Empty JSON/YAML Files**: Fixed an issue where `prysmctl` was writing empty configuration files. +- **Generic Fixes**: Addressed various unspecified issues. +- **Phase0 Block Parsing**: Resolved parsing issues in phase0 blocks on submit. +- **Hex Handling**: Upgraded the hex handling in various modules. +- **Initial Sync PreProcessing**: Resolved an issue affecting the initial sync preprocessing. + + +### Security + +No security updates in this release. + +## [v4.0.8](https://github.com/prysmaticlabs/prysm/compare/v4.0.7...v4.0.8) - 2023-08-22 + +Welcome to Prysm Release v4.0.8! This release is recommended. Highlights: + +- Parallel hashing of validator entries in the beacon state. This results in a faster hash tree root. ~3x reduction +- Parallel validations of consensus and execution checks. This results in a faster block verification +- Aggregate parallel is now the default. This results in faster attestation aggregation time if a node is subscribed to multiple beacon attestation subnets. ~3x reduction +- Better process block epoch boundary cache usages and bug fixes +- Beacon-API endpoints optimizations and bug fixes + +### Added + +- Optimization: parallelize hashing for validator entries in beacon state +- Optimization: parallelize consensus & execution validation when processing beacon block +- Optimization: integrate LRU cache (above) for validator public keys +- Cache: threadsafe LRU with non-blocking reads for concurrent readers +- PCLI: add deserialization time in benchmark +- PCLI: add allocation data To benchmark +- Beacon-API: GetSyncCommitteeRewards endpoint +- Beacon-API: SSZ responses for the Publishblockv2 +- Beacon-API client: use GetValidatorPerformance +- Spec tests: mainnet withdrawals and bls spec tests +- Spec tests: random and fork transition spec tests +- Spec tests execution payload operation tests +- Metric: block gossip arrival time +- Metric: state regen duration +- Metric: validator is in the next sync committee +- New data structure: multi-value slice + +### Changed + +- Build: update Go version to 1.20.6 +- Build: update hermetic_cc_toolchain +- Optimization: aggregate parallel is now default +- Optimization: do not perform full copies for metrics reporting +- Optimization: use GetPayloadBodies in Execution Engine Client +- Optimization: better nil check for reading validator +- Optimization: better cache update at epoch boundary +- Optimization: improve InnerShuffleList for shuffling +- Optimization: remove span for converting to indexed attestation` +- Beacon-API: optimize GetValidatorPerformance as POST +- Beacon-API: optimize /eth/v1/validator/aggregate_attestation +- Beacon-API: optimize /eth/v1/validator/contribution_and_proofs +- Beacon-API: optimize /eth/v1/validator/aggregate_and_proofs +- Beacon-API: use struct in beacon-chain/rpc/core to store dependencies +- Beacon-API: set CoreService in beaconv1alpha1.Server +- Beacon-API: use BlockProcessed event in certain endpoints +- Syncing: exit sync early with 0 peers to sync +- Cache: only call epoch boundary processing on canonical blocks +- Build: update server-side events dependency +- Refactor: slot tickers with intervals +- Logging: shift Error Logs To Debug +- Logging: clean up attestation routine logs + +### Fixed + +- Cache: update shuffling caches at epoch boundary +- Cache: committee cache correctly for epoch + 1 +- Cache: use the correct context for UpdateCommitteeCache +- Cache: proposer-settings edge case for activating validators +- Cache: prevent the public key cache from overwhelming runtime +- Sync: correctly set optimistic status in the head when syncing +- Sync: use last optimistic status on batch +- Flag: adds local boost flag to main/usage +- Beacon-API: correct header for get block and get blinded block calls +- Beacon-API: GetValidatorPerformance endpoint +- Beacon-API: return correct historical roots in Capella state +- Beacon-API: use the correct root in consensus validation +- Prysm API: size of SyncCommitteeBits +- Mev-boost: builder gas limit fix default to 0 in some cases +- PCLI: benchmark deserialize without clone and init trie +- PCLI: state trie for HTR duration +- Metric: adding fix pending validators balance +- Metric: effective balance for unknown/pending validators +- Comment: comments when receiving block +- Comment: cleanups to blockchain pkg + +### Security + +No security updates in this release. + +## [v4.0.7](https://github.com/prysmaticlabs/prysm/compare/v4.0.6...v4.0.7) - 2023-07-13 + +Welcome to the v4.0.7 release of Prysm! This recommended release contains many essential optimizations since v4.0.6. + +Highlights: + +- The validator proposal time for slot 0 has been reduced by 800ms. Writeup and PR +- The attestation aggregation time has been reduced by 400ms—roughly 75% with all subnets subscribed. Flag --aggregate-parallel. PR. This is only useful if running more than a dozen validator keys. The more subnets your node subscribe to, the more useful. +- The usage of fork choice lock has been reduced and optimized, significantly reducing block processing time. This results in a higher proposal and attest rate. PR +- The block proposal path has been optimized with more efficient copies and a better pruning algorithm for pending deposits. PR and PR +- Validator Registration cache is enabled by default, this affects users who have used webui along with mevboost. Please review PR for details. + +Note: We remind our users that there are two versions of the cryptographic library BLST, one is "portable" and less performant, and another is "non-portable" or "modern" and more performant. Most users would want to use the second one. You can set the environment variable USE_PRYSM_MODERN=true when using prysm.sh. The released docker images are using the non-portable version by default. + +### Added + +- Optimize multiple validator status query +- Track optimistic status on head +- Get attestation rewards API end point +- Expected withdrawals API +- Validator voluntary exit endpoint +- Aggregate atts using fixed pool of go routines +- Use the incoming payload status instead of calling forkchoice +- Add hermetic_cc_toolchain for a hermetic cc toolchain +- Cache next epoch proposers at epoch boundary +- Optimize Validator Roots Computation +- Log Finalized Deposit Insertion +- Move consensus and execution validation outside of onBlock +- Add metric for ReceiveBlock +- Prune Pending Deposits on Finalization +- GetValidatorPerformance http endpoint +- Block proposal copy Bytes Alternatively +- Append Dynamic Adding Trusted Peer Apis + +### Changed + +- Do not validate merge transition block after Capella +- Metric for balance displayed for public keys without validator indexes +- Set blst_modern=true to be the bazel default build +- Rename payloadHash to lastValidHash in setOptimisticToInvalid +- Clarify sync committee message validation +- Checkpoint sync ux +- Registration Cache by default + +### Removed + +- Disable nil payloadid log on relayers flags +- Remove unneeded helper +- Remove forkchoice call from notify new payload + +### Fixed + +- Late block task wait for initial sync +- Log the right block number +- Fix for keystore field name to align with EIP2335 +- Fix epoch participation parsing for API +- Spec checker, ensure file does not exit or error +- Uint256 parsing for builder API +- Fuzz target for execution payload +- Contribution doc typo +- Unit test TestFieldTrie_NativeState_fieldConvertersNative +- Typo on beacon-chain/node/node.go +- Remove single bit aggregation for aggregator +- Deflake cloners_test.go +- Use diff context to update proposer cache background +- Update protobuf and protobuf deps +- Run ineffassign for all code +- Increase validator client startup proposer settings deadline +- Correct log level for 'Could not send a chunked response' +- Rrune invalid blocks during initial sync +- Handle Epoch Boundary Misses +- Bump google.golang.org/grpc from 1.40.0 to 1.53.0 +- Fix bls signature batch unit test +- Fix Context Cancellation for insertFinalizedDeposits +- Lock before saving the poststate to db + +### Security + +No security updates in this release. + +## [v4.0.6](https://github.com/prysmaticlabs/prysm/compare/v4.0.5...v4.0.6) - 2023-07-15 + +Welcome to v4.0.6 release of Prysm! This recommended release contains many essential optimizations since v4.0.5. Notable highlights: + +Better handling of state field trie under late block scenario. This improves the next slot proposer's proposed time +Better utilization of next slot cache under various conditions + +**Important read:** + +1.) We use this opportunity to remind you that two different implementations of the underlying cryptographic library BLST exist. + +- portable: supports every CPU made in the modern era +- non-portable: more performant but requires your CPU to support special instructions + +Most users will want to use the "non-portable" version since most CPUs support these instructions. Our docker builds are now non-portable by default. Most users will benefit from the performance improvements. You can run with the "portable" versions if your CPU is old or unsupported. For binary distributions and to maintain backward compatibility with older versions of prysm.sh or prysm.bat, users that want to benefit from the non-portable performance improvements need to add an environment variable, like so: USE_PRYSM_MODERN=true prysm.sh beacon-chain prefix, or download the "non-portable" version of the binaries from the github repo. + +2.) A peering bug that led to nodes losing peers gradually and eventually needing a restart has been patched. Nodes previously affected by it can remove the --disable-resource-manager flag from v4.0.6 onwards. + +### Added + +- Copy state field tries for late block +- Utilize next slot cache correctly under late block scenario +- Epoch boundary uses next slot cache +- Beacon API broadcast_validation to block publishing +- Appropriate Size for the P2P Attestation Queue +- Flag --disable-resource-manager to disable resource manager for libp2p +- Beacon RPC start and end block building time logs +- Prysmctl: output proposer settings +- Libp2p patch +- Handle trusted peers for libp2p +- Spec test v1.4.0-alpha.1 + +### Changed + +- Use fork-choice store to validate sync message faster +- Proposer RPc unblind block workflow +- Restore flag disable-peer-scorer +- Validator import logs improvement +- Optimize zero hash comparisons in forkchoice +- Check peer threshold is met before giving up on context deadline +- Cleanup of proposer payload ID cache +- Clean up set execution data for proposer RPC +- Update Libp2p to v0.27.5 +- Always Favour Yamux for Multiplexing +- Ignore Phase0 Blocks For Monitor +- Move hash tree root to after block broadcast +- Use next slot cache for sync committee +- Log validation time for blocks +- Change update duties to handle all validators exited check +- Ignore late message log + +### Removed + +- SubmitblindBlock context timeout +- Defer state feed In propose block + +### Fixed + +- Sandwich attack on honest reorgs +- Missing config yamls for specific domains +- Release lock before panic for feed +- Return 500 in `/eth/v1/node/peers` interface +- Checkpoint sync uses correct slot + +### Security + +No security updates in this release. + +## [v4.0.5](https://github.com/prysmaticlabs/prysm/compare/v4.0.4...v4.0.5) - 2023-05-22 + +Welcome to v4.0.5 release of Prysm! This release contains many important improvements and bug fixes since v4.0.4, including significant improvements to attestation aggregation. See @potuz's notes [here](https://hackmd.io/TtyFurRJRKuklG3n8lMO9Q). This release is **strongly** recommended for all users. + +Note: The released docker images are using the portable version of the blst cryptography library. The Prysm team will release docker images with the non-portable blst library as the default image. In the meantime, you can compile docker images with blst non-portable locally with the `--define=blst_modern=true` bazel flag, use the "-modern-" assets attached to releases, or set environment varaible USE_PRYSM_MODERN=true when using prysm.sh. + +### Added + +- Added epoch and root to "not a checkpt in forkchoice" log message +- Added cappella support for eth1voting tool +- Persist validator proposer settings in the validator db. +- Add flag to disable p2p resource management. This flag is for debugging purposes and should not be used in production for extended periods of time. Use this flag if you are experiencing significant peering issues. --disable-resource-manager + +### Changed + +- Improved slot ticker for attestation aggregation +- Parallel block production enabled by default. Opt out with --disable-build-block-parallel if issues are suspected with this feature. +- Improve attestation aggregation by not using max cover on unaggregated attestations and not checking subgroup of previously validated signatures. +- Improve sync message processing by using forkchoice + +### Fixed + +- Fixed --slasher flag. +- Fixed state migration for capella / bellatrix +- Fix deadlock when using --monitor-indices + +### Security + +No security updates in this release. + +## [v4.0.4](https://github.com/prysmaticlabs/prysm/compare/v4.0.3...v4.0.4) - 2023-05-15 + +Welcome to v4.0.4 release of Prysm! This is the first full release following the recent mainnet issues and it is very important that all stakers update to this release as soon as possible. + +Aside from the critical fixes for mainnet, this release contains a number of new features and other fixes since v4.0.3. + +### Added + +- Feature to build consensus and execution blocks in parallel. This feature has shown a noticeable reduction (~200ms) in block proposal times. Enable with --build-block-parallel +- An in memory cache for validator registration can be enabled with --enable-registration-cache. See PR description before enabling. +- Added new linters +- Improved tracing data for builder pipeline +- Improved withdrawal phrasing in validator withdrawal tooling +- Improved blinded block error message +- Added test for future slot tolerance +- Pre-populate bls pubkey cache +- Builder API support in E2E tests + +### Changed + +- Updated spectests to v1.3 +- Cleanup duplicated code +- Updated method signature for UnrealizedJustifiedPayloadBlockHash() +- Updated k8s.io/client-go to 0.20.0 +- Removed unused method argument +- Refactored / moved some errors to different package +- Update next slot cache at an earlier point in block processing +- Use next slot cache for payload attribute +- Cleanup keymanager mock +- Update to go 1.20 +- Modify InsertFinalizedDeposits signature to return an error +- Improved statefeed initialization +- Use v1alpha1 server in block production +- Updated go generated files +- Typo corrections + +### Fixed + +- Fixed e2e tx fuzzer nilerr lint issue +- Fixed status for pending validators with multiple deposits +- Use gwei in builder value evaluation +- Return correct error when failing to unmarshal genesis state +- Avoid double state copy in latestAncestor call +- Fix mock v1alpha1 server +- Fix committee race test +- Fix flaky validator tests +- Log correctly when the forkchoice head changed +- Filter inactive keys from mev-boost / builder API validator registration +- Save attestation to cache when calling SubmitAttestation in beacon API +- Avoid panic on nil broadcast object +- Fix initialization race +- Properly close subnet iterator +- ⚠️ Ignore untimely attestations +- Fix inverted metric +- ⚠️ Save to checkpoint cache if next state cache hits + +### Security + +This release contains some important fixes that improve the resiliency of Ethereum Consensus Layer. See https://github.com/prysmaticlabs/prysm/pull/12387 and https://github.com/prysmaticlabs/prysm/pull/12398. + +## [v4.0.3](https://github.com/prysmaticlabs/prysm/compare/v4.0.2...v4.0.3) - 2023-04-20 + +### Added + +- Add REST API endpoint for beacon chain client's GetChainHead +- Add prepare-all-payloads flag +- support modifying genesis.json for capella +- Add support for engine_exchangeCapabilities +- prysmctl: Add support for writing signed validator exits to disk + +### Changed + +- Enable misspell linter & fix findings + +### Fixed + +- Fix Panic In Builder Service +- prysmctl using the same genesis func as e2e +- Check that Builder Is Configured +- Correctly use Gwei to compare builder bid value +- Fix Broken Dependency +- Deflake TestWaitForActivation_AccountsChanged +- Fix Attester Slashing Validation In Gossip +- Keymanager fixes for bad file writes +- windows: Fix build after PR 12293 + +### Security + +No security updates in this release. + +## [v4.0.2](https://github.com/prysmaticlabs/prysm/compare/v4.0.1...v4.0.2) - 2023-04-12 + +This release fixes a critical bug on Prysm interacting with mev-boost / relayer. You MUST upgrade to this release if you run Prysm with mev boost and relayer, or you will be missing block proposals during the first days after the Shapella fork while the block has bls-to-exec changes. +Post-mortem that describes this incident will be provided by the end of the week. + +One of this release's main optimizations is revamping the next slot cache. It has been upgraded to be more performant across edge case re-org scenarios. This can help with the bad head attestation vote. + +Minor fixes in this release address a bug that affected certain large operators querying RPC endpoints. This bug caused unexpected behavior and may have impacted the performance of affected operators. To resolve this issue, we have included a patch that ensures proper functionality when querying RPC endpoints. + +### Added + +- CLI: New beacon node flag local-block-value-boost that allows the local block value to be multiplied by the boost value +- Smart caching for square root computation +- Beacon-API: Implemented Block rewards endpoint +- Beacon-API client: Implemented GetSyncStatus endpoint +- Beacon-API client: Implemented GetGenesis endpoint +- Beacon-API client: Implemented ListValidators endpoint + +### Changed + +- Block processing: Optimize next slot cache +- Execution-API: Used unrealized justified block hash for FCU call +- CLI: Improved voluntary exit confirmation prompt +- Unit test: Unskip API tests +- End to end test: Misc improvements +- Build: Build tag to exclude mainnet genesis from prysmctl +- Dependency: Update go-ethereum to v1.11.3 +- Dependency: Update lighthouse to v4.0.1 + +### Fixed + +- Builder: Unblind beacon block correctly with bls-to-exec changes +- Block construction: Default to local payload on error correctly +- Block construction: Default to local payload on nil value correctly +- Block processing: Fallback in update head on error +- Block processing: Add orphaned operations to the appropriate pool +- Prysm-API: Fix Deadlock in StreamChainHead +- Beacon-API: Get header error, nil summary returned from the DB +- Beacon-API: Broadcast correct slashing object + +### Security + +No security updates in this release. + +## [v4.0.1](https://github.com/prysmaticlabs/prysm/compare/v4.0.0...v4.0.1) + +This is a reissue of v4.0.0. See https://github.com/prysmaticlabs/prysm/issues/12201 for more information. + +## [v4.0.0](https://github.com/prysmaticlabs/prysm/compare/v3.2.2...v4.0.0) + +### Added + +- Config: set mainnet capella epoch +- Validator: enable proposer to reorg late block +- Metric: bls-to-exec count in the operation pool +- Metric: pubsub metrics racer +- Metric: add late block metric +- Engine-API: Implement GetPayloadBodies +- Beacon-API: Implement GetPayloadAttribute SSE +- Prysm CLI: add experimental flags to dev mode +- Prysmctl utility: add eth1data to genesis state +- Spec test: EIP4881 spec compliance tests +- Spec test: forkchoice lock to fix flaskyness + +### Changed + +- Prysm: upgrade v3 to v4 +- Prysm: apply goimports to generated files +- Validator: lower builder circuit breaker thresholds to 5 missed slots per epoch and updates off by 1 +- Validator: reorg late block by default +- Forkchoice: cleanups +- Forkchoice: remove bouncing attack fix and strength equivocation discarding +- Forkchoice: call FCU at 4s mark if there's no new head +- Forkchoice: better locking on calls to retrieving ancestor root +- Forkchoice: stricker visibility for blockchain package access +- Block processing: optimizing validator balance retrieval by using epoch boundary cache +- Block processing: reduce FCU calls +- Block processing: increase attempted reorgs at the correct spot +- Block processing: remove duplicated bls to exec message pruning +- Block processing: skip hash tree root state when checking optimistic mode +- Prysm-API: mark GetChainHead deprecated +- Logging: add late block logs +- Logging: enhancements and clean ups +- Build: fix bazel remote cache upload +- Build: update cross compile toolchains +- Build: only build non-test targets in hack/update-go-pbs.sh +- Build: update rules_go to v0.38.1 and go_version to 1.19.7 +- Build: replace bazel pkg_tar rule with canonical @rules_pkg pkg_tar +- Build: update bazel to 6.1.0 +- Libp2p: updated to latest version +- Libp2p: make peer scorer permanent default +- Test: disable e2e slasher test +- CLI: derecate the following flags + + +### Deprecated + +The following flags have been deprecated. + +- disable-peer-scorer +- disable-vectorized-htr +- disable-gossip-batch-aggregation + +### Removed + +- Prsym remote signer +- CLI: Prater feature flag +- CLI: Deprecated flags +- Unit test: unused beacon chain altair mocks +- Validator REST API: unused endpoints + +The following flags have been removed. + +- http-web3provider +- enable-db-backup-webhook +- bolt-mmap-initial-size +- disable-discv5 +- enable-reorg-late-blocks +- disable-attesting-history-db-cache +- enable-vectorized-htr +- enable-peer-scorer +- enable-forkchoice-doubly-linked-tree +- enable-back-pull +- enable-duty-count-down +- head-sync +- enable-gossip-batch-aggregation +- enable-larger-gossip-history +- fallback-web3provider +- disable-native-state +- enable-only-blinded-beacon-blocks +- ropsten +- interop-genesis-state +- experimental-enable-boundary-checks +- disable-back-pull +- disable-forkchoice-doubly-linked-tree + +### Fixed + +- Validator: startup deadline +- Prysmctl: withdrawals fork checking logic +- End-to-end test: fix flakes +- End-to-end test: fix altair transition +- Unit test: fix error message in + +### Security + +This release is required to participate in the Capella upgrade. + +## [v3.2.2](https://github.com/prysmaticlabs/prysm/compare/v3.2.2...v3.2.1) - 2023-05-10 + +Gm! ☀️ We are excited to announce our release for upgrading Goerli testnet to Shanghai / Capella! 🚀 + +This release is MANDATORY for Goerli testnet. You must upgrade your Prysm beacon node and validator client to this release before Shapella hard fork time epoch=162304 or UTC=14/03/2023, 10:25:36 pm. + +This release is a low-priority for the mainnet. +This release is the same commit as v3.2.2-rc.3. If you are already running v3.2.2-rc.3, then you do not need to update your client. + +### Added + +- Capella fork epoch +- Validator client REST implementation GetFeeRecipientByPubKey +- New end-to-end test for post-attester duties + +### Changed + +- Storing blind beacon block by default for new Prysm Database +- Raise the max grpc message size to a very large value by default +- Update rules docker to v0.25.0 +- Update distroless base images +- Update protoc-gen-go-cast to suppress tool output +- Update deps for Capella +- Remove gRPC fallback client from validator REST API +- Prysmctl now verifies capella fork for bls to exec message change +- Core block processing cleanup +- Better locking design around forkchoice store +- Core process sync aggregate function returns reward amount +- Use Epoch boundary cache to retrieve balances +- Misc end-to-end test improvements and fixes +- Add slot number to proposal error log + +### Deprecated + +- Deprecate flag --interop-genesis-state + +### Removed + +- Remove Ropsten testnet config and feature flag + +### Security + +This release is required for Goerli to upgrade to Capella. + +## [v3.2.1](https://github.com/prysmaticlabs/prysm/compare/v3.2.0...v3.2.1) - 2023-02-13 + +We are excited to announce the release of Prysm v3.2.1 🎉 + +This is the first release to support Capella / Shanghai. The Sepolia testnet Capella upgrade time is currently set to 2/28/2023, 4:04:48 AM UTC. The Goerli testnet and Mainnet upgrade times are still yet to be determined. In Summary: + +- This is a mandatory upgrade for Sepolia nodes and validators +- This is a recommended upgrade for Goerli and Mainnet nodes and validators + +There are some known issues with this release. + +- mev-boost, relayer, and builder support for Capella upgrade are built in but still need to be tested. Given the lack of testing infrastructure, none of the clients could test this for withdrawals testnet. There may be hiccups when using mev-boost on the Capella upgraded testnets. + +### Added + +- Capella Withdrawal support +- Add Capella fork epoch for Sepolia +- Various Validator client REST implementations (Part of EPF) +- Various Beacon API additions +- Cache Fork Digest Computation to save compute +- Beacon node can bootstrap from non-genesis state (i.e bellatrix state) +- Refactor bytesutil, add support for go1.20 slice to array conversions +- Add Span information for attestation record save request +- Matric addition +- Identify invalid signature within batch verification +- Support for getting consensus values from beacon config +- EIP-4881: Spec implementation +- Test helper to generate valid bls-to-exec message +- Spec tests v1.3.0 rc.2 + +### Changed + +- Prysm CLI utility support for exit +- Beacon API improvement +- Prysm API get block RPC +- Prysm API cleanups +- Block processing cleanup, +- Forkchoice logging improvements +- Syncing logging improvement +- Validator client set event improvement for readability and error handling +- Engine API implementation cleanups +- End to end test improvements +- Prysm CLI withdrawal ux improvement +- Better log for the block that never became head + +### Removed + +- Remove cache lookup and lock request for database boltdb transaction + +### Fixed + +- Beacon API +- Use the correct attribute if there's a payload ID cache miss +- Call FCU with an attribute on non-head block +- Sparse merkle trie bug fix +- Waiting For Bandwidth Issue While Syncing +- State Fetcher to retrieve correct epoch +- Exit properly with terminal block hash +- PrepareBeaconProposer API duplicating validator indexes when not persisted in DB +- Multiclient end-to-end +- Deep source warnings + +### Security + +There are no security updates in this release. + +## [v3.2.0](https://github.com/prysmaticlabs/prysm/compare/v3.1.2...v3.2.0) - 2022-12-16 + +This release contains a number of great features and improvements as well as progress towards the upcoming Capella upgrade. This release also includes some API changes which are reflected in the minor version bump. If you are using mev-boost, you will need to update your prysm client to v3.2.0 before updating your mev-boost instance in the future. See [flashbots/mev-boost#404](https://github.com/flashbots/mev-boost/issues/404) for more details. + +### Added + +- Support for non-english mnemonic phrases in wallet creation. +- Exit validator without confirmation prompt using --force-exit flag +- Progress on Capella and eip-4844 upgrades +- Added randao json endpoint. /eth/v1/beacon/states/{state_id}/randao +- Added liveness endpoint /eth/v1/validator/liveness/{epoch} +- Progress on adding json-api support for prysm validator +- Prysmctl can now generate genesis.ssz for forks after phase0. + +### Changed + +- --chain-config-file now throws an error if used concurrently with --network flag. +- Added more histogram metrics for block arrival latency times block_arrival_latency_milliseconds +- Priority queue RetrieveByKey now uses read lock instead of write lock +- Use custom types for certain ethclient requests. Fixes an issue when using prysm on gnosis chain. +- Updted forkchoice endpoint /eth/v1/debug/forkchoice (was /eth/v1/debug/beacon/forkchoice) +- Include empty fields in builder json client. +- Computing committee assignments for slots older than the oldest historical root in the beacon state is now forbidden + +### Removed + +- Deprecated protoarray tests have been removed + +### Fixed + +- Unlock pending block queue if there is any error on inserting a block +- Prysmctl generate-genesis yaml file now uses the correct format +- ENR serialization now correctly serializes some inputs that did not work previously +- Use finalized block hash if a payload ID cache miss occurs +- prysm.sh now works correctly with Mac M1 chips (it downloads darwin-arm64 binaries) +- Use the correct block root for block events api +- Users running a VPN should be able to make p2p dials. +- Several minor typos and code cleanups + +### Security + +- Go is updated to 1.19.4. + +## [v3.1.2](https://github.com/prysmaticlabs/prysm/compare/v3.1.1...v3.1.2) - 2022-10-27 + +### Added + +- Timestamp field to forkchoice node json responses +- Further tests to non-trivial functions of the builder service +- Support for VotedFraction in forkchoice +- Metrics for reorg distance and depths +- Support for optimistic sync spectests +- CLI flag for customizing engine endpoint timeout --engine-endpoint-timeout-seconds +- Support for lodestar identification in p2p monitoring +- --enable-full-ssz-data-logging to display debug ssz data on gossip messages that fail validation +- Progress on capella and withdrawals support +- Validator exit can be performed from prysmctl +- Blinded block support through the json API + +### Changed + +- Refactoring / cleanup of keymanager +- Refactoring / improvements in initial sync +- Forkchoice hardening +- Improved log warnings when fee recipient is not set +- Changed ready for merge log frequency to 1 minute +- Move log Unable to cache headers for execution client votes to debug +- Rename field in invalid pruned blocks log +- Validate checkpoint slot +- Return an error if marshaling invalid Uint256 +- Fallback to uncached getPayload if timeout +- Update bazel to 5.3.0 +- godocs cleanup and other cleanups +- Forkchoice track highest received root +- Metrics updated block arrival time histograms +- Log error and continue when proposer boost roots are missing +- Do not return on error during on_tick +- Do not return on error after update head +- Update default RPC HTTP timeout to 30s +- Improved fee recipient UX. +- Produce block skips mev-boost +- Builder getPayload timeout set to 3s +- Make stategen aware of forkchoice +- Increase verbosity of warning to error when new head cannot be determined when receiving an attestation +- Provide justified balances to forkchoice +- Update head continues without attestations +- Migrate historical states in another goroutine to avoid blocking block execution +- Made API middleware structs public +- Updated web UI to v2.0.2 +- Default value for --block-batch-limit-burst-factor changed from 10 to 2. +- Vendored leaky bucket implementation with minor modifications + +### Deprecated + +- --disable-native-state flag and associated feature + +### Removed + +- Unused WithTimeout for builder client +- Optimistic sync candidate check +- Cleans up proto states +- Protoarray implementation of forkchoice + +### Fixed + +- Block fields to return a fixed sized array rather than slice +- Lost cancel in validator runner +- Release held lock on error +- Properly submit blinded blocks +- Unwanted wrapper of gRPC status errors +- Sync tests fixed and updated spectests to 1.2.0 +- Prevent timeTillDuty from reporting a negative value +- Don't mark /healthz as unhealthy when mev-boost relayer is down +- Proposer index cache and slot is used for GetProposerDuties +- Properly retrieve values for validator monitoring flag from cli +- Fee recipient fixes and persistence +- Handle panic when rpc client is not yet initialized +- Improved comments and error messages +- SSL support for multiple gRPC endpoints +- Addressed some tool feedback and code complaints +- Handle unaggregated attestations in the event feed +- Prune / expire payload ID cache entries when using beacon json API +- Payload ID cache may have missed on skip slots due to incorrect key computation + +### Security + +- Libp2p updated to v0.22.0 + +## [v3.1.1](https://github.com/prysmaticlabs/prysm/compare/v3.1.0...v3.1.1) - 2022-09-09 + +This is another highly recommended release. It contains a forkchoice pruning fix and a gossipsub optimization. It is recommended to upgrade to this release before the Merge next week, which is currently tracking for Wed Sept 14 (https://bordel.wtf/). Happy staking! See you on the other side! + +### Fixed + +- Fix memory leaks in fork choice store which leads to node becoming slower +- Improve connectivity and solves issues connecting with peers + +### Security + +No security updates in this release. + +## [v3.1.0](https://github.com/prysmaticlabs/prysm/compare/v3.1.0...v3.0.0) - 2022-09-05 + +Updating to this release is highly recommended as it contains several important fixes and features for the merge. You must be using Prysm v3 or later before Bellatrix activates on September 6th. + +**Important docs links** + +- [How to prepare for the merge](https://docs.prylabs.network/docs/prepare-for-merge) +- [How to check merge readiness status](https://docs.prylabs.network/docs/monitoring/checking-status) + + +### Added + +- Add time until next duty in epoch logs for validator +- Builder API: Added support for deleting gas limit endpoint +- Added debug endpoint GetForkChoice for doubly-linked-tree +- Added support for engine API headers. --execution-headers=key=value +- New merge specific metrics. See + +### Changed + +- Deposit cache now returns shallow copy of deposits +- Updated go-ethereum dependency to v1.10.23 +- Updated LLVM compiler version to 13.0.1 +- Builder API: filter 0 bid and empty tx root responses +- Allow attestations/blocks to be received by beacon node when the nodes only optimistically synced +- Add depth and distance to CommonAncestorRoot reorg object +- Allocate slice array to expected length in several methods +- Updated lighthouse to version v3 in E2E runner +- Improved handling of execution client errors +- Updated web3signer version in E2E runner +- Improved error messages for db unmarshalling failures in ancestor state lookup +- Only updated finalized checkpoints in database if its more recent than previous checkpoint + +### Removed + +- Dead / unused code delete + +### Fixed + +- Fixed improper wrapping of certain errors +- Only log fee recipient message if changed +- Simplify ListAttestations RPC method fixes +- Fix several RPC methods to be aware of the appropriate fork +- Fixed encoding issue with builder API register validator method. fixes +- Improved blinded block handling in API. fixes +- Fixed IPC path for windows users +- Fix proposal of blinded blocks +- Prysm no longer crashes on start up if builder endpoint is not available + +### Security + +There are no security updates in this release. + +## [v3.0.0](https://github.com/prysmaticlabs/prysm/compare/v3.0.0...v2.1.4) 2022-08-22 + +### Added + +- Passing spectests v1.2.0-rc.3 +- prysmctl: Generate genesis state via prysmctl testnet generate-genesis [command options] [arguments...] +- Keymanager: Add support for setting the gas limit via API. +- Merge: Mainnet merge epoch and TTD defined! +- Validator: Added expected wait time for pending validator activation in log message. +- Go: Prysm now uses proper versioning suffix v3 for this release. GoDocs and downstream users can now import prysm as expected for go projects. +- Builder API: Register validator via HTTP REST Beacon API endpoint /eth/v1/validator/register_validator +- Cross compilation support for Mac ARM64 chips (Mac M1, M2) + +### Changed + +- **Require an execution client** `--execution-endpoint=...`. The default value has changed to `localhost:8551` and you must use the jwt flag `--jwt-secret=...`. Review [the docs](https://docs.prylabs.network/docs/prepare-for-merge) for more information +- `--http-web3provider` has been renamed to `--execution-endpoint`. Please update your configuration as `--http-web3provider` will be removed in a future release. +- Insert attestations into forkchoice sooner +- Builder API: `gas_limit` changed from int to string to support JSON / YAML configs. `--suggested-gas-limit` changed from int to string. +- Fork choice: Improved handling of double locks / deadlocks +- Lower libp2p log level +- Improved re-org logs with additional metadata +- Improved error messages found by semgrep +- Prysm Web UI updated to release v2.0.1 +- Protobuf message renaming (non-breaking changes) +- Enabled feature to use gohashtree by default. Disable with `--disable-vectorized-htr` +- Enabled fork choice doubly linked tree feature by default. Disable with `--disable-forkchoice-doubly-linked-tree` +- Remote signer: Renamed some field names to better represent block types (non-breaking changes for gRPC users, possibly breaking change for JSON API users) +- Builder API: require header and payload root match. +- Improved responses for json-rpc requests batching when using blinded beacon blocks. +- Builder API: Improved error messages +- Builder API: Issue warning when validator expects builder ready beacon node, but beacon node is not configured with a relay. +- Execution API: Improved payload ID to handle reorg scenarios + +### Deprecated + +- Several features have been promoted to stable or removed. The following flags are now deprecated and will be removed in a future release. `--enable-db-backup-webhook`, `--bolt-mmap-initial-size`, `--disable-discv5`, `--disable-attesting-history-db-cache`, `--enable-vectorized-htr`, `--enable-peer-scorer`, `--enable-forkchoice-doubly-linked-tree`, `--enable-duty-count-down`, `--head-sync`, `--enable-gossip-batch-aggregateion`, `--enable-larger-gossip-history`, `--fallback-web3provider`, `--use-check-point-cache`. +- Several beacon API endpoints marked as deprecated + +### Removed + +- Logging: Removed phase0 fields from validator performance log messages +- Deprecated slasher protos have been removed +- Deprecated beacon API endpoints removed: `GetBeaconState`, `ProduceBlock`, `ListForkChoiceHeads`, `ListBlocks`, `SubmitValidatorRegistration`, `GetBlock`, `ProposeBlock` +- API: Forkchoice method `GetForkChoice` has been removed. +- All previously deprecated feature flags have been removed. `--enable-active-balance-cache`, `--correctly-prune-canonical-atts`, `--correctly-insert-orphaned-atts`, `--enable-next-slot-state-cache`, `--enable-batch-gossip-verification`, `--enable-get-block-optimizations`, `--enable-balance-trie-computation`, `--disable-next-slot-state-cache`, `--attestation-aggregation-strategy`, `--attestation-aggregation-force-opt-maxcover`, `--pyrmont`, `--disable-get-block-optimizations`, `--disable-proposer-atts-selection-using-max-cover`, `--disable-optimized-balance-update`, `--disable-active-balance-cache`, `--disable-balance-trie-computation`, `--disable-batch-gossip-verification`, `--disable-correctly-prune-canonical-atts`, `--disable-correctly-insert-orphaned-atts`, `--enable-native-state`, `--enable-peer-scorer`, `--enable-gossip-batch-aggregation`, `--experimental-disable-boundry-checks` +- Validator Web API: Removed unused ImportAccounts and DeleteAccounts rpc options + +### Fixed + +- Keymanager API: Status enum values are now returned as lowercase strings. +- Misc builder API fixes +- API: Fix GetBlock to return canonical block +- Cache: Fix cache overwrite policy for bellatrix proposer payload ID cache. +- Fixed string slice flags with file based configuration + +### Security + +- Upgrade your Prysm beacon node and validator before the merge! + +## [v2.1.4](https://github.com/prysmaticlabs/prysm/compare/v2.1.4...v2.1.3) - 2022-08-10 + +As we prepare our `v3` mainnet release for [The Merge](https://ethereum.org/en/upgrades/merge/), `v2.1.4` marks the end of the `v2` era. Node operators and validators are **highly encouraged** to upgrade to release `v2.1.4` - many bug fixes and improvements have been included in preparation for The Merge. `v3` will contain breaking changes, and will be released within the next few weeks. Using `v2.1.4` in the meantime will give you access to a more streamlined user experience. See our [v2.1.4 doc](https://docs.prylabs.network/docs/vnext/214-rc) to learn how to use v2.1.4 to run a Merge-ready configuration on the Goerli-Prater network pair. + +### Added + +- Sepolia testnet configs `--sepolia` +- Goerli as an alias to Prater and testnet configs `--prater` or `--goerli` +- Fee recipient API for key manager +- YML config flag support for web3 signer +- Validator registration API for web3 signer +- JSON tcontent type with optional metadata +- Flashbots MEV boost support +- Store blind block (i.e block with payload header) instead of full block (i.e. block with payload) for storage efficiency (currently only available when the `enable-only-blinded-beacon-blocks` feature flag is enabled) +- Pcli utility support to print blinded block +- New Web v2.0 release into Prysm + +### Changed + +- Native state improvement is enabled by default +- Use native blocks instead of protobuf blocks +- Peer scorer is enabled by default +- Enable fastssz to use vectorized HTR hash algorithm improvement +- Forkchoice store refactor and cleanups +- Update libp2p library dependency +- RPC proposer duty is now allowed next epoch query +- Do not print traces with `log.withError(err)` +- Testnets are running with pre-defined feature flags + +### Removed + +- Deprecate Step Parameter from our Block By Range Requests + +### Fixed + +- Ignore nil forkchoice node when saving orphaned atts +- Sync: better handling of missing state summary in DB +- Validator: creates invalid terminal block using the same timestamp as payload +- P2P: uses incorrect goodbye codes +- P2p: defaults Incorrectly to using Mplex, which results in losing Teku peers +- Disable returning future state for API +- Eth1 connection API panic + +### Security + +There are no security updates in this release. + +## [v2.1.3](https://github.com/prysmaticlabs/prysm/compare/v2.1.2...v2.1.3) - 2022-07-06 + +### Added + +- Many fuzz test additions +- Support bellatrix blocks with web3signer +- Support for the Sepolia testnet with `--terminal-total-difficulty-override 17000000000000000`. The override flag is required in this release. +- Support for the Ropsten testnet. No override flag required +- JSON API allows SSZ-serialized blocks in `publishBlock` +- JSON API allows SSZ-serialized blocks in `publishBlindedBlock` +- JSON API allows SSZ-serialized requests in `produceBlockV2` and `produceBlindedBlock` +- Progress towards Builder API and MEV boost support (not ready for testing in this release) +- Support for `DOMAIN_APPLICATION_MARK` configuration +- Ignore subset aggregates if a better aggregate has been seen already +- Reinsertion of reorg'd attestations +- Command `beacon-chain generate-auth-secret` to assist with generating a hex encoded secret for engine API +- Return optimistic status to `ChainHead` related grpc service +- TTD log and prometheus metric +- Panda ascii art banner for the merge! + +### Changed + +- Improvements to forkchoice +- Invalid checksummed (or no checksum) addresses used for fee recipient will log a warning. fixes, +- Use cache backed `getBlock` method in several places of blockchain package +- Reduced log frequency of "beacon node doesn't have a parent in db with root" error +- Improved nil checks for state management +- Enhanced debug logs for p2p block validation +- Many helpful refactoring and cosmetic changes +- Move WARN level message about weak subjectivity sync and improve message content +- Handle connection closing for web3/eth1 nil connection +- Testing improvements +- E2E test improvements +- Increase file descriptor limit up to the maximum by default +- Improved classification of "bad blocks" +- Updated engine API error code handling +- Improved "Synced new block" message to include minimal information based on the log verbosity. +- Add nil checks for nil finalized checkpoints +- Change weak subjectivity sync to use the most recent finalized state rather than the oldest state within the current period. +- Ensure a finalized root can't be all zeros +- Improved db lookup of HighestSlotBlocksBelow to start from the end of the index rather than the beginning. +- Improved packing of state balances for hashtreeroot +- Improved field trie recomputation + +### Removed + +- Removed handling of `INVALID_TERMINAL_BLOCK` response from engine API + +### Fixed + +- `/eth/v1/beacon/blinded_blocks` JSON API endpoint +- SSZ handling of JSON API payloads +- Config registry fixes +- Withdrawal epoch overflows +- Race condition with blockchain service Head() +- Race condition with validator's highest valid slot accessor +- Do not update cache with the result of a cancelled request +- `validator_index` should be a string integer rather than a number integer per spec. +- Use timestamp heuristic to determine deposits to process rather than simple calculation of follow distance +- Return `IsOptimistic` in `ValidateSync` responses + +### Security + +There are no security updates in this release. + +## [v2.1.2](https://github.com/prysmaticlabs/prysm/compare/v2.1.1...v2.1.2) - 2022-05-16 + +### Added + +- Update forkchoice head before produce block +- Support for blst modern builds on linux amd64 +- [Beacon API support](ethereum/beacon-APIs#194) for blinded block +- Proposer index and graffiti fields in Received block debug log for verbosity +- Forkchoice removes equivocating votes for weight accounting + +### Changed + +- Updated to Go [1.18](https://github.com/golang/go/releases/tag/go1.18) +- Updated go-libp2p to [v0.18.0](https://github.com/libp2p/go-libp2p/releases/tag/v0.18.0) +- Updated beacon API's Postman collection to 2.2.0 +- Moved eth2-types into Prysm for cleaner consolidation of consensus types + +### Removed + +- Prymont testnet support +- Flag `disable-proposer-atts-selection-using-max-cover` which disables defaulting max cover strategy for proposer selecting attestations +- Flag `disable-get-block-optimizations` which disables optimization with beacon block construction +- Flag `disable-optimized-balance-update"` which disables optimized effective balance update +- Flag `disable-active-balance-cache` which disables active balance cache +- Flag `disable-balance-trie-computation` which disables balance trie optimization for hash tree root +- Flag `disable-batch-gossip-verification` which disables batch gossip verification +- Flag `disable-correctly-insert-orphaned-atts` which disables the fix for orphaned attestations insertion + +### Fixed + +- `end block roots don't match` bug which caused beacon node down time +- Doppelganger off by 1 bug which introduced some false-positive +- Fee recipient warning log is only disabled after Bellatrix fork epoch + +### Security + +There are no security updates in this release. + +## [v2.1.1](https://github.com/prysmaticlabs/prysm/compare/v2.1.0...v2.1.1) - 2022-05-03 + +This patch release includes 3 cherry picked fixes for regressions found in v2.1.0. + +View the full changelist from v2.1.0: https://github.com/prysmaticlabs/prysm/compare/v2.1.0...v2.1.1 + +If upgrading from v2.0.6, please review the [full changelist](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.1) of both v2.1.0 and v2.1.1. + +This release is required for users on v2.1.0 and recommended for anyone on v2.0.6. + +The following known issues exist in v2.1.0 and also exist in this release. + +- Erroneous warning message in validator client when bellatrix fee recipient is unset. This is a cosmetic message and does not affect run time behavior in Phase0/Altair. +- In Bellatrix/Kiln: Fee recipient flags may not work as expected. See for a fix and more details. + +### Fixed + +- Doppelganger false positives may have caused a failure to start in the validator client. +- Connections to execution layer clients were not properly cleaned up and lead to resource leaks when using ipc. +- Initial sync (or resync when beacon node falls out of sync) could lead to a panic. + +### Security + +There are no security updates in this release. + +## [v2.1.0](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.0) - 2022-04-26 + +There are two known issues with this release: + +- Erroneous warning message in validator client when bellatrix fee recipient is unset. This is a cosmetic message and does not affect run time behavior in Phase0/Altair. +- In Bellatrix/Kiln: Fee recipient flags may not work as expected. See for a fix and more details. + +### Added + +- Web3Signer support. See the [documentation](https://docs.prylabs.network/docs/next/wallet/web3signer) for more details. +- Bellatrix support. See [kiln testnet instructions](https://hackmd.io/OqIoTiQvS9KOIataIFksBQ?view) +- Weak subjectivity sync / checkpoint sync. This is an experimental feature and may have unintended side effects for certain operators serving historical data. See the [documentation](https://docs.prylabs.network/docs/next/prysm-usage/checkpoint-sync) for more details. +- A faster build of blst for beacon chain on linux amd64. Use the environment variable `USE_PRYSM_MODERN=true` with prysm.sh, use the "modern" binary, or bazel build with `--define=blst_modern=true`. +- Vectorized sha256. This may have performance improvements with use of the new flag `--enable-vectorized-htr`. +- A new forkchoice structure that uses a doubly linked tree implementation. Try this feature with the flag `--enable-forkchoice-doubly-linked-tree` +- Fork choice proposer boost is implemented and enabled by default. See PR description for more details. + +### Changed + +- **Flag Default Change** The default value for `--http-web3provider` is now `localhost:8545`. Previously was empty string. +- Updated spectest compliance to v1.1.10. +- Updated to bazel 5.0.0 +- Gossip peer scorer is now part of the `--dev` flag. + +### Removed + +- Removed released feature for next slot cache. `--disable-next-slot-state-cache` flag has been deprecated and removed. + +### Fixed + +Too many bug fixes and improvements to mention all of them. See the [full changelist](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.0) + +### Security + +There are no security updates in this release. + +## [v2.0.6](https://github.com/prysmaticlabs/prysm/compare/v2.0.5...v2.0.6) 2022-01-31 + +### Added + +- Bellatrix/Merge progress +- Light client support merkle proof retrieval for beacon state finalized root and sync committees +- Web3Signer support (work in progress) +- Implement state management with native go structs (work in progress) +- Added static analysis for mutex lock management +- Add endpoint to query eth1 connections +- Batch gossipsub verification enabled +- Get block optimizations enabled +- Batch decompression for signatures +- Balance trie feature enabled + +### Changed + +- Use build time constants for field lengths. +- Monitoring service logging improvements / cleanup +- Renamed state v3 import alias +- Spec tests passing at tag 1.1.8 +- Bazel version updated to 4.2.2 +- Renamed github.com/eth2-clients -> github.com/eth-clients +- p2p reduce memory allocation in gossip digest calculation +- Allow comma separated formatting for event topics in API requests +- Update builder image from buster to bullseye +- Renaming "merge" to "bellatrix" +- Refactoring / code dedupication / general clean up +- Update libp2p +- Reduce state copy in state upgrades +- Deduplicate sync committee messages from pool before retrieval + +### Removed + +- tools/deployContract: removed k8s specific logic + +### Fixed + +- Sync committee API endpoint can now be queried for future epochs +- Initialize merkle layers and recompute dirty fields in beacon state proofs +- Fixed data race in API calls + +### Security + +- Clean variable filepaths in validator wallet back up commands, e2e tests, and other tooling (gosec G304) + +## [v2.0.5](https://github.com/prysmaticlabs/prysm/compare/v2.0.4...v2.0.5) - 2021-12-13 + +### Added + +- Implement import keystores standard API +- Added more fields to "Processed attestation aggregation" log +- Incremental changes to support The Merge hardfork +- Implement validator monitoring service in beacon chain node via flag `--monitor-indices`. +- Added validator log to display "aggregated since launch" every 5 epochs. +- Add HTTP client wrapper for interfacing with remote signer See +- Update web UI to version v1.0.2. + +### Changed + +- Refactor beacon state to allow for a single cached hasher +- Default config name to "devnet" when not provided in the config yaml. +- Alter erroneously capitalized error messages +- Bump spec tests to version v1.1.6 +- Improvements to Doppelganger check +- Improvements to "grpc client connected" log. +- Update libp2p to v0.15.1 +- Resolve several checks from deepsource +- Update go-ethereum to v1.10.13 +- Update some flags from signed integer flags to unsigned flags. +- Filter errored keys from slashing protection history in standard API. +- Ensure slashing protection exports and key manager api work according to spec +- Improve memory performance by properly allocating slice size +- Typos fix +- Remove unused imports +- Use cashed finalized state when pruning deposits +- Significant slasher improvements +- Various code cleanups +- Standard API improvements for keymanager API +- Use safe sub64 for safer math +- Fix CORS in middleware API +- Add more fields to remote signer request object +- Refactoring to support checkpoint or genesis origin. + +### Deprecated + +Please be advised that Prysm's package path naming will change in the next release. If you are a downstream user of Prysm (i.e. import prysm libraries into your project) then you may be impacted. Please see issue https://github.com/prysmaticlabs/prysm/issues/10006. + +### Fixed + +- Allow API requests for next sync committee. +- Check sync status before performing a voluntary exit. +- Fixed issue where historical requests for validator balances would time out by removing the 30s timeout limitation. +- Add missing ssz spec tests + +### Security + +- Add justifications to gosec security finding suppression. + +## [v2.0.4](https://github.com/prysmaticlabs/prysm/compare/v2.0.3...v2.0.4) - 2021-11-29 + +### Added + +- Several changes for The Merge +- More monitoring functionality for blocks and sync committees + +### Changed + +- Improvements to block proposal computation when packing deposits. +- Renaming SignatureSet -> SignatureBatch + +### Deprecated + +### Fixed + +- Revert PR [9830](https://github.com/prysmaticlabs/prysm/pull/9830) to remove performance regression. See: issue [9935](https://github.com/prysmaticlabs/prysm/issues/9935) + +### Security + +No security updates in this release. + +## [v2.0.3](https://github.com/prysmaticlabs/prysm/compare/v2.0.2...v2.0.3) - 2021-11-22 + +This release also includes a major update to the web UI. Please review the v1 web UI notes [here](https://github.com/prysmaticlabs/prysm-web-ui/releases/tag/v1.0.0) + +### Added + +- Web v1 released +- Updated Beacon API to v2.1.0 +- Add validation of keystores via validator client RPC endpoint to support new web UI +- GitHub actions: errcheck and gosimple lint +- Event API support for `contribution_and_proof` and `voluntar_exit` events. +- Validator key management standard API schema and some implementation +- Add helpers for The Merge fork epoch calculation +- Add cli overrides for certain constants for The Merge +- Add beacon block and state structs for The Merge +- Validator monitoring improvements +- Cache deposits to improve deposit selection/processing +- Emit warning upon empty validator slashing protection export +- Add balance field trie cache and optimized hash trie root operations. `--enable-balance-trie-computation` + +### Changed + +- Updated to spectests v1.1.5 +- Refactor web authentication +- Added uint64 overflow protection +- Sync committee pool returns empty slice instead of nil on cache miss +- Improved description of datadir flag +- Simplied web password requirements +- Web JWT tokens no longer expire. +- Updated keymanager protos +- Watch and update jwt secret when auth token file updated on disk. +- Update web based slashing protection export from POST to GET +- Reuse helpers to validate fully populated objects. +- Rename interop-cold-start to deterministic-genesis +- Validate password on RPC create wallet request +- Refactor for weak subjectivity sync implementation +- Update naming for Atlair previous epoch attester +- Remove duplicate MerkleizeTrieLeaves method. +- Add explict error for validator flag checks on out of bound positions +- Simplify method to check if the beacon chain client should update the justified epoch value. +- Rename web UI performance endpoint to "summary" +- Refactor powchain service to be more functional +- Use math.MaxUint64 +- Share / reused finalized state on prysm start up services +- Refactor slashing protection history code packages +- Improve RNG commentary +- Use next slot cache in more areas of the application +- Improve context aware p2p peer scoring loops +- Various code clean up +- Prevent redundant processing of blocks from pending queue +- Enable Altair tests on e2e against prior release client +- Use lazy state balance cache + +### Deprecated + +- Web UI login has been replaced. +- Web UI bar graph removed. + +### Removed + +- Prysmatic Labs' [go-ethereum fork](https://github.com/prysmaticlabs/bazel-go-ethereum) removed from build tooling. Upstream go-ethereum is now used with familiar go.mod tooling. +- Removed duplicate aggergation validation p2p pipelines. +- Metrics calculation removed extra condition +- Removed superflous errors from peer scoring parameters registration + +### Fixed + +- Allow submitting sync committee subscriptions for next period +- Ignore validators without committee assignment when fetching attester duties +- Return "version" field for ssz blocks in beacon API +- Fixed bazel build transitions for dbg builds. Allows IDEs to hook into debugger again. +- Fixed case where GetDuties RPC endpoint might return a false positive for sync committee selection for validators that have no deposited yet +- Fixed validator exits in v1 method, broadcast correct object +- Fix Altair individual votes endpoint +- Validator performance calculations fixed +- Return correct response from key management api service +- Check empty genesis validators root on slashing protection data export +- Fix stategen with genesis state. +- Fixed multiple typos +- Fix genesis state registration in interop mode +- Fix network flags in slashing protection export + +### Security + +- Added another encryption key to security.txt. + +## [v2.0.2](https://github.com/prysmaticlabs/prysm/compare/v2.0.1...v2.0.2) - 2021-10-18 + +### Added + +- Optimizations to block proposals. Enabled with `--enable-get-block-optimizations`. See [issue 8943](https://github.com/prysmaticlabs/prysm/issues/8943) and [issue 9708](https://github.com/prysmaticlabs/prysm/issues/9708) before enabling. +- Beacon Standard API: register v1alpha2 endpoints + +### Changed + +- Beacon Standard API: Improved sync error messages +- Beacon Standard API: Omit validators without sync duties +- Beacon Standard API: Return errors for unknown state/block versions +- Spec alignment: Passing spec vectors at v1.1.2 +- Logs: Improved "synced block.." +- Bazel: updated to v4.2.1 +- E2E: more strict participation checks +- Eth1data: Reduce disk i/o saving interval + +### Deprecated + +- ⚠️ v2 Remote slashing protection server disabled for now ⚠️ + +### Fixed + +- Beacon Standard API: fetch sync committee duties for current and next period's epoch +- Beacon Standard API: remove special treatment to graffiti in block results +- Beacon Standard API: fix epoch calculation in sync committee duties +- Doppelganger: Fix false positives +- UI: Validator gRPC gateway health endpoint fixed + +### Security + +- Spec alignment: Update Eth2FastAggregateVerify to match spec +- Helpers: enforce stronger slice index checks +- Deposit Trie: Handle impossible non-power of 2 trie leaves +- UI: Add security headers + +## [v2.0.1](https://github.com/prysmaticlabs/prysm/compare/v2.0.0...v2.0.1) - 2021-10-06 + +### Fixed + +- Updated libp2p transport library to stop metrics logging errors on windows. +- Prysm's web UI assets serve properly +- Eth2 api returns full validator balance rather than effective balance +- Slashing protection service registered properly in validator. + +### Security + +We've updated the Prysm base docker images to a more recent build. + +## [v2.0.0](https://github.com/prysmaticlabs/prysm/compare/v1.4.4...v2.0.0) + +This release is the largest release of Prysm to date. v2.0.0 includes support for the upcoming Altair hard fork on the mainnet Ethereum Beacon Chain. +This release consists of [380 changes](https://github.com/prysmaticlabs/prysm/compare/v1.4.4...f7845afa575963302116e673d400d2ab421252ac) to support Altair, improve performance of phase0 beacon nodes, and various bug fixes from v1.4.4. + +### Upgrading From v1 + +Please update your beacon node to v2.0.0 prior to updating your validator. The beacon node can serve requests to a v1.4.4 validator, however a v2.0.0 validator will not start against a v1.4.4 beacon node. If you're operating a highly available beacon chain service, ensure that all of your beacon nodes are updated to v2.0.0 before starting the upgrade on your validators. + +### Added + +- Full Altair support. [Learn more about Altair.](https://github.com/ethereum/annotated-spec/blob/8473024d745a3a2b8a84535d57773a8e86b66c9a/altair/beacon-chain.md) +- Added bootnodes from the Nimbus team. +- Revamped slasher implementation. The slasher functionality is no longer a standalone binary. Slasher functionality is available from the beacon node with the `--slasher` flag. Note: Running the slasher has considerably increased resource requirements. Be sure to review the latest documentation before enabling this feature. This feature is experimental. +- Support for standard JSON API in the beacon node. Prysm validators continue to use Prysm's API. +- Configurable subnet peer requirements. Increased minimum desired peers per subnet from 4 to 6. This can be modified with `--minimum-peers-per-subnet` in the beacon node.. +- Support for go build on darwin_arm64 devices (Mac M1 chips). Cross compiling for darwin_arm64 is not yet supported.. +- Batch verification of pubsub objects. This should improve pubsub processing performance on multithreaded machines. +- Improved attestation pruning. This feature should improve block proposer performance and overall network attestation inclusion rates. Opt-out with `--disable-correctly-prune-canonical-atts` in the beacon node. +- Active balance cache to improve epoch processing. Opt-out with `--disable-active-balance-cache` +- Experimental database improvements to reduce history state entry space usage in the beaconchain.db. This functionality can be permanently enabled with the flag `--enable-historical-state-representation`. Enabling this feature can realize a 25% improvement in space utilization for the average user , while 70 -80% for power users(archival node operators). Note: once this feature is toggled on, it modifies the structure of the database with a migration and cannot be rolled back. This feature is experimental and should only be used in non-serving beacon nodes in case of database corruption or other critical issue. + +#### New Metrics + +**Beacon chain node** + +| Metric | Description | References | +|--------------------------------------------------|-------------------------------------------------------------------------------------------------------|-------------| +| `p2p_message_ignored_validation_total` | Count of messages that were ignored in validation | | +| `beacon_current_active_validators` | Current total active validators | | +| `beacon_processed_deposits_total` | Total number of deposits processed | | +| `sync_head_state_miss` | The number of sync head state requests that are not present in the cache | | +| `sync_head_state_hit` | The number of sync head state requests that are present in the cache | | +| `total_effective_balance_cache_miss` | The number of get requests that are not present in the cache | | +| `total_effective_balance_cache_hit` | The number of get requests that are present in the cache | | +| `sync_committee_index_cache_miss_total` | The number of committee requests that aren't present in the sync committee index cache | | +| `sync_committee_index_cache_hit_total` | The number of committee requests that are present in the sync committee index cache | | +| `next_slot_cache_hit` | The number of cache hits on the next slot state cache | | +| `next_slot_cache_miss` | The number of cache misses on the next slot state cache | | +| `validator_entry_cache_hit_total` | The number of cache hits on the validator entry cache | | +| `validator_entry_cache_miss_total` | The number of cache misses on the validator entry cache | | +| `validator_entry_cache_delete_total` | The number of cache deletes on the validator entry cache | | +| `saved_sync_committee_message_total` | The number of saved sync committee message total | | +| `saved_sync_committee_contribution_total` | The number of saved sync committee contribution total | | +| `libp2p_peers` | Tracks the total number of libp2p peers | | +| `p2p_status_message_missing` | The number of attempts the connection handler rejects a peer for a missing status message | | +| `p2p_sync_committee_subnet_recovered_broadcasts` | The number of sync committee messages that were attempted to be broadcast with no peers on the subnet | | +| `p2p_sync_committee_subnet_attempted_broadcasts` | The number of sync committees that were attempted to be broadcast | | +| `p2p_subscribed_topic_peer_total` | The number of peers subscribed to topics that a host node is also subscribed to | | +| `saved_orphaned_att_total` | Count the number of times an orphaned attestation is saved | | + +### Changed + +- Much refactoring of "util" packages into more canonical packages. Please review Prysm package structure and godocs. +- Altair object keys in beacon-chain/db/kv are prefixed with "altair". BeaconBlocks and BeaconStates are the only objects affected by database key changes for Altair. This affects any third party tooling directly querying Prysm's beaconchain.db. +- Updated Teku bootnodes. +- Updated Lighthouse bootnodes. +- End to end testing now collects jaeger spans +- Improvements to experimental peer quality scoring. This feature is only enabled with `--enable-peer-scorer`. +- Validator performance logging behavior has changed in Altair. Post-Altair hardfork has the following changes: Inclusion distance and inclusion slots will no longer be displayed. Correctly voted target will only be true if also included within 32 slots. Correctly voted head will only be true if the attestation was included in the next slot. Correctly voted source will only be true if attestation is included within 5 slots. Inactivity score will be displayed. +- Increased pubsub message queue size from 256 to 600 to support larger networks and higher message volume. +- The default attestation aggregation changed to the improved optimized max cover algorithm. +- Prysm is passing spectests at v1.1.0 (latest available release). +- `--subscribe-all-subnets` will subscribe to all attestation subnets and sync subnets in post-altair hard fork. +- "eth2" is now an illegal term. If you say it or type it then something bad might happen. +- Improved cache hit ratio for validator entry cache. +- Reduced memory overhead during database migrations. +- Improvements to beacon state writes to database. + +#### Changed Metrics + +**Beacon chain node** +| Metric | Old Name | Description | References | +|-----------------------|----------------------|------------------------------------------------------|------------| +| `beacon_reorgs_total` | `beacon_reorg_total` | Count the number of times a beacon chain has a reorg | | + +### Deprecated + +These flags are hidden from the help text and no longer modify the behavior of Prysm. These flags should be removed from user runtime configuration as the flags will eventually be removed entirely and Prysm will fail to start if a deleted or unknown flag is provided. + +- `--enable-active-balance-cache` +- `--correctly-prune-canonical-atts` +- `--correctly-insert-orphaned-atts` +- `--enable-next-slot-state-cache` + +### Removed + +Note: Removed flags will block starting up with an error "flag provided but not defined:". +Please check that you are not using any of the removed flags in this section! + +- Prysm's standalone slasher application (cmd/slasher) has been fully removed. Use the `--slasher` flag with a beacon chain node for full slasher functionality. +- `--disable-blst` (beacon node and validator). [blst](https://github.com/supranational/blst) is the only BLS library offered for Prysm. +- `--disable-sync-backtracking` and `--enable-sync-backtracking` (beacon node). This feature has been released for some time. See. +- `--diable-pruning-deposit-proofs` (beacon node). This feature has been released for some time. See. +- `--disable-eth1-data-majority-vote` (beacon node). This feature is no longer in use in Prysm. See,. +- `--proposer-atts-selection-using-max-cover` (beacon node). This feature has been released for some time. See. +- `--update-head-timely` (beacon node). This feature was released in v1.4.4. See. +- `--enable-optimized-balance-update` (beacon node). This feature was released in v1.4.4. See. +- Kafka support is no longer available in the beacon node. This functionality was never fully completed and did not fulfill many desirable use cases. This removed the flag `--kafka-url` (beacon node). See. +- Removed tools/faucet. Use the faucet in [prysmaticlabs/periphery](https://github.com/prysmaticlabs/periphery/tree/c2ac600882c37fc0f2a81b0508039124fb6bcf47/eth-faucet) if operating a testnet faucet server. +- Tooling for prior testnet contracts has been removed. Any of the old testnet contracts with `drain()` function have been removed as well. +- Toledo tesnet config is removed. +- Removed --eth-api-port (beacon node). All APIs interactions have been moved to --grpc-gateway-port. See. + +### Fixed + +- Database lock contention improved in block database operations. +- JSON API now returns an error when unknown fields are provided. +- Correctly return `epoch_transition` field in `head` JSON API events stream. +- Various fixes in standard JSON API +- Finalize deposits before initializing the beacon node. This may improve missed proposals +- JSON API returns header "Content-Length" 0 when returning an empty JSON object. +- Initial sync fixed when there is a very long period of missing blocks. +- Fixed log statement when a web3 endpoint failover occurs. +- Windows prysm.bat is fixed + +### Security + +- You MUST update to v2.0.0 or later release before epoch 74240 or your client will fork off from the rest of the network. +- Prysm's JWT library has been updated to a maintained version of the previous JWT library. JWTs are only used in the UI. + +Please review our newly updated [security reporting policy](https://github.com/prysmaticlabs/prysm/blob/develop/SECURITY.md). +- Fix subcommands such as validator accounts list + +### Security + +There are no security updates in this release. + +# Older than v2.0.0 + +For changelog history for releases older than v2.0.0, please refer to https://github.com/prysmaticlabs/prysm/releases diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f9cf9811bff..0d6269768671 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,8 @@ Excited by our work and want to get involved in building out our sharding releas You can explore our [Open Issues](https://github.com/prysmaticlabs/prysm/issues) in-the works for our different releases. Feel free to fork our repo and start creating PR’s after assigning yourself to an issue of interest. We are always chatting on [Discord](https://discord.gg/CTYGPUJ) drop us a line there if you want to get more involved or have any questions on our implementation! +Please, do not send pull requests for trivial changes, such as typos, these will be rejected. These types of pull requests incur a cost to reviewers and do not provide much value to the project. If you are unsure, please open an issue first to discuss the change. + ## Contribution Steps **1. Set up Prysm following the instructions in README.md.** @@ -120,15 +122,19 @@ $ git push myrepo feature-in-progress-branch Navigate to your fork of the repo on GitHub. On the upper left where the current branch is listed, change the branch to your feature-in-progress-branch. Open the files that you have worked on and check to make sure they include your changes. -**16. Create a pull request.** +**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. + +**17. Create a pull request.** -Navigate your browser to https://github.com/prysmaticlabs/prysm and click on the new pull request button. In the “base” box on the left, leave the default selection “base master”, the branch that you want your changes to be applied to. In the “compare” box on the right, select feature-in-progress-branch, the branch containing the changes you want to apply. You will then be asked to answer a few questions about your pull request. After you complete the questionnaire, the pull request will appear in the list of pull requests at https://github.com/prysmaticlabs/prysm/pulls. +Navigate your browser to https://github.com/prysmaticlabs/prysm and click on the new pull request button. In the “base” box on the left, leave the default selection “base master”, the branch that you want your changes to be applied to. In the “compare” box on the right, select feature-in-progress-branch, the branch containing the changes you want to apply. You will then be asked to answer a few questions about your pull request. After you complete the questionnaire, the pull request will appear in the list of pull requests at https://github.com/prysmaticlabs/prysm/pulls. Ensure that you have added an entry to CHANGELOG.md if your PR is a user-facing change. See the [Maintaining CHANGELOG.md](#maintaining-changelogmd) section for more information. -**17. Respond to comments by Core Contributors.** +**18. Respond to comments by Core Contributors.** Core Contributors may ask questions and request that you make edits. If you set notifications at the top of the page to “not watching,” you will still be notified by email whenever someone comments on the page of a pull request you have created. If you are asked to modify your pull request, repeat steps 8 through 15, then leave a comment to notify the Core Contributors that the pull request is ready for further review. -**18. If the number of commits becomes excessive, you may be asked to squash your commits.** +**19. If the number of commits becomes excessive, you may be asked to squash your commits.** You can do this with an interactive rebase. Start by running the following command to determine the commit that is the base of your branch... @@ -136,7 +142,7 @@ Core Contributors may ask questions and request that you make edits. If you set $ git merge-base feature-in-progress-branch prysm/master ``` -**19. The previous command will return a commit-hash that you should use in the following command.** +**20. The previous command will return a commit-hash that you should use in the following command.** ``` $ git rebase -i commit-hash @@ -160,13 +166,30 @@ squash hash add a feature Save and close the file, then a commit command will appear in the terminal that squashes the smaller commits into one. Check to be sure the commit message accurately reflects your changes and then hit enter to execute it. -**20. Update your pull request with the following command.** +**21. Update your pull request with the following command.** ``` $ git push myrepo feature-in-progress-branch -f ``` -**21. Finally, again leave a comment to the Core Contributors on the pull request to let them know that the pull request has been updated.** +**22. Finally, again leave a comment to the Core Contributors on the pull request to let them know that the pull request has been updated.** + +## 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. + +### Releasing + +When a new release is made, the "Unreleased" section should be moved to a new section with the release version and the current date. Then a new "Unreleased" section is made at the top of the file with the categories listed above. ## Contributor Responsibilities From 50e53265a1bc5f917c8a09a759d6a435687248d9 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 24 Aug 2024 01:28:26 +0900 Subject: [PATCH 267/325] bugfix : Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage (#14357) * Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage * bugfix for checking stringslice flag to use isSet --- beacon-chain/node/config.go | 2 +- validator/node/node.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/node/config.go b/beacon-chain/node/config.go index 19f7d74d700a..f389cba98eae 100644 --- a/beacon-chain/node/config.go +++ b/beacon-chain/node/config.go @@ -132,7 +132,7 @@ func configureEth1Config(cliCtx *cli.Context) error { } func configureNetwork(cliCtx *cli.Context) { - if len(cliCtx.StringSlice(cmd.BootstrapNode.Name)) > 0 { + if cliCtx.IsSet(cmd.BootstrapNode.Name) { c := params.BeaconNetworkConfig() c.BootstrapNodes = cliCtx.StringSlice(cmd.BootstrapNode.Name) params.OverrideBeaconNetworkConfig(c) diff --git a/validator/node/node.go b/validator/node/node.go index ed80038020c7..fb7cc8f9c405 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -560,8 +560,8 @@ func Web3SignerConfig(cliCtx *cli.Context) (*remoteweb3signer.SetupConfig, error if cliCtx.IsSet(flags.WalletPasswordFileFlag.Name) { log.Warnf("%s was provided while using web3signer and will be ignored", flags.WalletPasswordFileFlag.Name) } - - if publicKeysSlice := cliCtx.StringSlice(flags.Web3SignerPublicValidatorKeysFlag.Name); len(publicKeysSlice) > 0 { + if cliCtx.IsSet(flags.Web3SignerPublicValidatorKeysFlag.Name) { + publicKeysSlice := cliCtx.StringSlice(flags.Web3SignerPublicValidatorKeysFlag.Name) if len(publicKeysSlice) == 1 { pURL, err := url.ParseRequestURI(publicKeysSlice[0]) if err == nil && pURL.Scheme != "" && pURL.Host != "" { From 6ad8a104dd1bb1482941c6cefcfae31c31c69139 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:38:49 -0700 Subject: [PATCH 268/325] Re-use duplicate code in aggregator (#14342) * move shared duplicate code * rename function --- .../prysm/v1alpha1/validator/aggregator.go | 105 ++++++------------ 1 file changed, 32 insertions(+), 73 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index 4376d0cab058..cee94fe76759 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -23,49 +23,10 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. defer span.End() span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) - if vs.SyncChecker.Syncing() { - return nil, status.Errorf(codes.Unavailable, "Syncing to latest head, not ready to respond") - } - - // An optimistic validator MUST NOT participate in attestation - // (i.e., sign across the DOMAIN_BEACON_ATTESTER, DOMAIN_SELECTION_PROOF or DOMAIN_AGGREGATE_AND_PROOF domains). - if err := vs.optimisticStatus(ctx); err != nil { - return nil, err - } - - st, err := vs.HeadFetcher.HeadStateReadOnly(ctx) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not determine head state: %v", err) - } - - validatorIndex, exists := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(req.PublicKey)) - if !exists { - return nil, status.Error(codes.Internal, "Could not locate validator index in DB") - } - - epoch := slots.ToEpoch(req.Slot) - activeValidatorIndices, err := helpers.ActiveValidatorIndices(ctx, st, epoch) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get validators: %v", err) - } - seed, err := helpers.Seed(st, epoch, params.BeaconConfig().DomainBeaconAttester) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get seed: %v", err) - } - committee, err := helpers.BeaconCommittee(ctx, activeValidatorIndices, seed, req.Slot, req.CommitteeIndex) + indexInCommittee, validatorIndex, err := vs.processAggregateSelection(ctx, req) if err != nil { return nil, err } - - // Check if the validator is an aggregator - isAggregator, err := helpers.IsAggregator(uint64(len(committee)), req.SlotSignature) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get aggregator status: %v", err) - } - if !isAggregator { - return nil, status.Errorf(codes.InvalidArgument, "Validator is not an aggregator") - } - atts := vs.AttPool.AggregatedAttestationsBySlotIndex(ctx, req.Slot, req.CommitteeIndex) // Filter out the best aggregated attestation (ie. the one with the most aggregated bits). if len(atts) == 0 { @@ -74,14 +35,6 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. return nil, status.Errorf(codes.NotFound, "Could not find attestation for slot and committee in pool") } } - - var indexInCommittee uint64 - for i, idx := range committee { - if idx == validatorIndex { - indexInCommittee = uint64(i) - } - } - best := bestAggregate(atts, req.CommitteeIndex, indexInCommittee) attAndProof := ðpb.AggregateAttestationAndProof{ Aggregate: best, @@ -102,55 +55,68 @@ func (vs *Server) SubmitAggregateSelectionProofElectra( defer span.End() span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) + indexInCommittee, validatorIndex, err := vs.processAggregateSelection(ctx, req) + if err != nil { + return nil, err + } + atts := vs.AttPool.AggregatedAttestationsBySlotIndexElectra(ctx, req.Slot, req.CommitteeIndex) + if len(atts) == 0 { + atts = vs.AttPool.UnaggregatedAttestationsBySlotIndexElectra(ctx, req.Slot, req.CommitteeIndex) + if len(atts) == 0 { + return nil, status.Errorf(codes.NotFound, "No attestations found in pool") + } + } + best := bestAggregate(atts, req.CommitteeIndex, indexInCommittee) + attAndProof := ðpb.AggregateAttestationAndProofElectra{ + Aggregate: best, + SelectionProof: req.SlotSignature, + AggregatorIndex: validatorIndex, + } + return ðpb.AggregateSelectionElectraResponse{AggregateAndProof: attAndProof}, nil +} + +func (vs *Server) processAggregateSelection(ctx context.Context, req *ethpb.AggregateSelectionRequest) (uint64, primitives.ValidatorIndex, error) { if vs.SyncChecker.Syncing() { - return nil, status.Errorf(codes.Unavailable, "Syncing to latest head, not ready to respond") + return 0, 0, status.Errorf(codes.Unavailable, "Syncing to latest head, not ready to respond") } // An optimistic validator MUST NOT participate in attestation // (i.e., sign across the DOMAIN_BEACON_ATTESTER, DOMAIN_SELECTION_PROOF or DOMAIN_AGGREGATE_AND_PROOF domains). if err := vs.optimisticStatus(ctx); err != nil { - return nil, err + return 0, 0, err } st, err := vs.HeadFetcher.HeadStateReadOnly(ctx) if err != nil { - return nil, status.Errorf(codes.Internal, "Could not determine head state: %v", err) + return 0, 0, status.Errorf(codes.Internal, "Could not determine head state: %v", err) } validatorIndex, exists := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(req.PublicKey)) if !exists { - return nil, status.Error(codes.Internal, "Could not locate validator index in DB") + return 0, 0, status.Error(codes.Internal, "Could not locate validator index in DB") } epoch := slots.ToEpoch(req.Slot) activeValidatorIndices, err := helpers.ActiveValidatorIndices(ctx, st, epoch) if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get validators: %v", err) + return 0, 0, status.Errorf(codes.Internal, "Could not get validators: %v", err) } seed, err := helpers.Seed(st, epoch, params.BeaconConfig().DomainBeaconAttester) if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get seed: %v", err) + return 0, 0, status.Errorf(codes.Internal, "Could not get seed: %v", err) } committee, err := helpers.BeaconCommittee(ctx, activeValidatorIndices, seed, req.Slot, req.CommitteeIndex) if err != nil { - return nil, err + return 0, 0, err } // Check if the validator is an aggregator isAggregator, err := helpers.IsAggregator(uint64(len(committee)), req.SlotSignature) if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get aggregator status: %v", err) + return 0, 0, status.Errorf(codes.Internal, "Could not get aggregator status: %v", err) } if !isAggregator { - return nil, status.Errorf(codes.InvalidArgument, "Validator is not an aggregator") - } - - atts := vs.AttPool.AggregatedAttestationsBySlotIndexElectra(ctx, req.Slot, req.CommitteeIndex) - if len(atts) == 0 { - atts = vs.AttPool.UnaggregatedAttestationsBySlotIndexElectra(ctx, req.Slot, req.CommitteeIndex) - if len(atts) == 0 { - return nil, status.Errorf(codes.NotFound, "No attestations found in pool") - } + return 0, 0, status.Errorf(codes.InvalidArgument, "Validator is not an aggregator") } var indexInCommittee uint64 @@ -159,14 +125,7 @@ func (vs *Server) SubmitAggregateSelectionProofElectra( indexInCommittee = uint64(i) } } - - best := bestAggregate(atts, req.CommitteeIndex, indexInCommittee) - attAndProof := ðpb.AggregateAttestationAndProofElectra{ - Aggregate: best, - SelectionProof: req.SlotSignature, - AggregatorIndex: validatorIndex, - } - return ðpb.AggregateSelectionElectraResponse{AggregateAndProof: attAndProof}, nil + return indexInCommittee, validatorIndex, nil } // SubmitSignedAggregateSelectionProof is called by a validator to broadcast a signed From 261921ae4cedfd21d308cdc9056ff5341fc8c1ad Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:47:47 -0500 Subject: [PATCH 269/325] reduce validator registration logs (#14370) * reduce validator registration logs * reverting a log change that's probably better as warn * Update CHANGELOG.md --------- Co-authored-by: Preston Van Loon Co-authored-by: Preston Van Loon --- CHANGELOG.md | 1 + validator/client/registration.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b96333a68ef4..2329b9765a63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Beacon chain now asserts that the external builder block uses the expected gas limit. - Electra: Add electra objects to beacon API. - Electra: Updated block publishing beacon APIs to support Electra. +- "Submitted builder validator registration settings for custom builders" log message moved to debug level. ### Deprecated diff --git a/validator/client/registration.go b/validator/client/registration.go index fa5ca997f841..bc4ae46bfcab 100644 --- a/validator/client/registration.go +++ b/validator/client/registration.go @@ -52,7 +52,7 @@ func SubmitValidatorRegistrations( } if lastErr == nil { - log.Infoln("Submitted builder validator registration settings for custom builders") + log.Debugln("Submitted builder validator registration settings for custom builders") } else { log.WithError(lastErr).Warn("Could not submit all signed registrations to beacon node") } From 19d9a1915d31fb1ded228aad00562f05eb556f7d Mon Sep 17 00:00:00 2001 From: Taranpreet26311 <58771072+Taranpreet26311@users.noreply.github.com> Date: Mon, 26 Aug 2024 20:25:38 +0400 Subject: [PATCH 270/325] PR to update workflow check dependencies (#14379) * PR to update workflow check dependencies * Updated build checkout version to v4 * Updated to go 1.23.0 * Updated lint version to v1.60.3 * Revert to 1.22.3 * Updated go to 1.23 * revert * Updated setup-go to v5 * Update lint to 1.60.2 * Revert changes * Update Lint version to v1.60.3 * Update lint to go 1.23.0 * Update golanci.yml to 1.23.0 * Revert and keep to golang 1.22.4 * Disable mnd * Downgrade to current version * Add update to go 1.26 * Update to go 1.22.6 * Update .golangci.yml to 1.22.6 --- .github/workflows/go.yml | 22 +++++++++++----------- .golangci.yml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 02f828499c25..0f18ac7833be 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Go mod tidy checker id: gomodtidy @@ -27,11 +27,11 @@ jobs: GO111MODULE: on steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go 1.22 - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: '1.22.3' + go-version: '1.22.6' - name: Run Gosec Security Scanner run: | # https://github.com/securego/gosec/issues/469 export PATH=$PATH:$(go env GOPATH)/bin @@ -43,16 +43,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go 1.22 - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: '1.22.3' + go-version: '1.22.6' id: go - name: Golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v5 with: version: v1.55.2 args: --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number @@ -62,13 +62,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: '1.22.3' + go-version: '1.22.6' id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get dependencies run: | diff --git a/.golangci.yml b/.golangci.yml index 2a5b771b78d4..b2fb5ee8e9df 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,7 +6,7 @@ run: - proto - tools/analyzers timeout: 10m - go: '1.22.3' + go: '1.22.6' linters: enable-all: true From 23994518690870ede7d131212604561438126cd9 Mon Sep 17 00:00:00 2001 From: Md Amaan <114795592+Redidacove@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:20:29 +0530 Subject: [PATCH 271/325] Hardcoded GenesisValidatorsRoot (#14365) * hardcoded GenesisValidatorsRoot * added in mainnet.config * updated desc * added it in all testnets * minor change * added roots instead of empty and fn to compute byte32 from hex * added in e2e testnet_config * fixed test * minor fix * removed fn and added bytes output directly * Add test for genesis validator root mainnet value * removed root from minimal and testnet * removed root * Update CHANGELOG.md * Fix bazel package visiblity --------- Co-authored-by: Preston Van Loon Co-authored-by: Preston Van Loon --- CHANGELOG.md | 1 + beacon-chain/state/genesis/BUILD.bazel | 5 ++++- config/params/BUILD.bazel | 1 + config/params/config.go | 1 + config/params/config_test.go | 13 +++++++++++++ config/params/mainnet_config.go | 1 + config/params/testnet_holesky_config.go | 1 + config/params/testnet_sepolia_config.go | 1 + 8 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2329b9765a63..939bfbd523e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Electra: Add electra objects to beacon API. - Electra: Updated block publishing beacon APIs to support Electra. - "Submitted builder validator registration settings for custom builders" log message moved to debug level. +- config: Genesis validator root is now hardcoded in params.BeaconConfig() ### Deprecated diff --git a/beacon-chain/state/genesis/BUILD.bazel b/beacon-chain/state/genesis/BUILD.bazel index 41948e5b6482..2c5a225e98a8 100644 --- a/beacon-chain/state/genesis/BUILD.bazel +++ b/beacon-chain/state/genesis/BUILD.bazel @@ -8,7 +8,10 @@ go_library( ], embedsrcs = ["mainnet.ssz.snappy"], importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/genesis", - visibility = ["//beacon-chain/db:__subpackages__"], + visibility = [ + "//beacon-chain/db:__subpackages__", + "//config/params:__pkg__", + ], deps = [ "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", diff --git a/config/params/BUILD.bazel b/config/params/BUILD.bazel index e97f4d1f9f18..35660c89b96f 100644 --- a/config/params/BUILD.bazel +++ b/config/params/BUILD.bazel @@ -62,6 +62,7 @@ go_test( gotags = ["develop"], tags = ["CI_race_detection"], deps = [ + "//beacon-chain/state/genesis:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", diff --git a/config/params/config.go b/config/params/config.go index 69f7193df13a..5f9e37f0df34 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -128,6 +128,7 @@ type BeaconChainConfig struct { DomainConsolidation [4]byte `yaml:"DOMAIN_CONSOLIDATION" spec:"true"` // Prysm constants. + GenesisValidatorsRoot [32]byte // GenesisValidatorsRoot is the root hash of the genesis validators. GweiPerEth uint64 // GweiPerEth is the amount of gwei corresponding to 1 eth. BLSSecretKeyLength int // BLSSecretKeyLength defines the expected length of BLS secret keys in bytes. BLSPubkeyLength int // BLSPubkeyLength defines the expected length of BLS public keys in bytes. diff --git a/config/params/config_test.go b/config/params/config_test.go index 52cb4b23e549..6e29127f0ab5 100644 --- a/config/params/config_test.go +++ b/config/params/config_test.go @@ -1,9 +1,11 @@ package params_test import ( + "bytes" "sync" "testing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/genesis" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -92,3 +94,14 @@ func TestConfig_WithinDAPeriod(t *testing.T) { }) } } + +func TestConfigGenesisValidatorRoot(t *testing.T) { + g, err := genesis.State(params.MainnetName) + require.NoError(t, err) + + gvr := g.GenesisValidatorsRoot() + + if !bytes.Equal(gvr, params.BeaconConfig().GenesisValidatorsRoot[:]) { + t.Fatal("mainnet params genesis validator root does not match the mainnet genesis state value") + } +} diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 1131c9823b05..334aec572c74 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -174,6 +174,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000), // Prysm constants. + GenesisValidatorsRoot: [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149}, GweiPerEth: 1000000000, BLSSecretKeyLength: 32, BLSPubkeyLength: 48, diff --git a/config/params/testnet_holesky_config.go b/config/params/testnet_holesky_config.go index 66bf9bd23fcb..03cefd8988fe 100644 --- a/config/params/testnet_holesky_config.go +++ b/config/params/testnet_holesky_config.go @@ -26,6 +26,7 @@ func HoleskyConfig() *BeaconChainConfig { cfg.MinGenesisTime = 1695902100 cfg.GenesisDelay = 300 cfg.ConfigName = HoleskyName + cfg.GenesisValidatorsRoot = [32]byte{145, 67, 170, 124, 97, 90, 127, 113, 21, 226, 182, 170, 195, 25, 192, 53, 41, 223, 130, 66, 174, 112, 95, 186, 157, 243, 155, 121, 197, 159, 168, 177} cfg.GenesisForkVersion = []byte{0x01, 0x01, 0x70, 0x00} cfg.SecondsPerETH1Block = 14 cfg.DepositChainID = 17000 diff --git a/config/params/testnet_sepolia_config.go b/config/params/testnet_sepolia_config.go index 0df3e1e51d00..353c874be7ec 100644 --- a/config/params/testnet_sepolia_config.go +++ b/config/params/testnet_sepolia_config.go @@ -26,6 +26,7 @@ func SepoliaConfig() *BeaconChainConfig { cfg.MinGenesisTime = 1655647200 cfg.GenesisDelay = 86400 cfg.MinGenesisActiveValidatorCount = 1300 + cfg.GenesisValidatorsRoot = [32]byte{216, 234, 23, 31, 60, 148, 174, 162, 30, 188, 66, 161, 237, 97, 5, 42, 207, 63, 146, 9, 192, 14, 78, 251, 170, 221, 172, 9, 237, 155, 128, 120} cfg.ConfigName = SepoliaName cfg.GenesisForkVersion = []byte{0x90, 0x00, 0x00, 0x69} cfg.SecondsPerETH1Block = 14 From a7c86a6d1bf5a60ee8d105630814fb4c1e979293 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 26 Aug 2024 13:05:24 -0500 Subject: [PATCH 272/325] Update CONTRIBUTING.md to highlight no trivial changes (#14384) --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d6269768671..aede79dd60ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,8 @@ Excited by our work and want to get involved in building out our sharding releas You can explore our [Open Issues](https://github.com/prysmaticlabs/prysm/issues) in-the works for our different releases. Feel free to fork our repo and start creating PR’s after assigning yourself to an issue of interest. We are always chatting on [Discord](https://discord.gg/CTYGPUJ) drop us a line there if you want to get more involved or have any questions on our implementation! -Please, do not send pull requests for trivial changes, such as typos, these will be rejected. These types of pull requests incur a cost to reviewers and do not provide much value to the project. If you are unsure, please open an issue first to discuss the change. +> [!IMPORTANT] +> Please, **do not send pull requests for trivial changes**, such as typos, these will be rejected. These types of pull requests incur a cost to reviewers and do not provide much value to the project. If you are unsure, please open an issue first to discuss the change. ## Contribution Steps From 2f42f7e313b4e925cb656deff954cb33a2a196bb Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Wed, 28 Aug 2024 04:00:53 +0800 Subject: [PATCH 273/325] Add a Tracing Wrapper Package (#14207) * Adds a wrapper package * Gazelle * Add in Empty Span * Revert It Back * Add back reference * Set It As Empty * fix missing import * remove redundant alias * remove unused --------- Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Co-authored-by: Saolyn --- api/client/builder/BUILD.bazel | 2 +- api/client/builder/client.go | 2 +- beacon-chain/blockchain/BUILD.bazel | 1 + beacon-chain/blockchain/chain_info.go | 2 +- beacon-chain/blockchain/execution_engine.go | 2 +- beacon-chain/blockchain/head.go | 2 +- beacon-chain/blockchain/process_block.go | 2 +- .../blockchain/process_block_helpers.go | 2 +- .../blockchain/receive_attestation.go | 2 +- beacon-chain/blockchain/receive_block.go | 2 +- beacon-chain/blockchain/service.go | 2 +- beacon-chain/core/altair/BUILD.bazel | 2 +- beacon-chain/core/altair/attestation.go | 2 +- beacon-chain/core/altair/epoch_precompute.go | 2 +- beacon-chain/core/altair/transition.go | 2 +- beacon-chain/core/blocks/BUILD.bazel | 2 +- beacon-chain/core/blocks/attestation.go | 2 +- .../core/epoch/precompute/BUILD.bazel | 1 + .../core/epoch/precompute/attestation.go | 2 +- beacon-chain/core/helpers/BUILD.bazel | 2 +- beacon-chain/core/helpers/validators.go | 2 +- beacon-chain/core/transition/BUILD.bazel | 1 + beacon-chain/core/transition/transition.go | 5 +- .../transition/transition_no_verify_sig.go | 2 +- beacon-chain/db/kv/BUILD.bazel | 1 + beacon-chain/db/kv/backup.go | 2 +- beacon-chain/db/kv/blocks.go | 2 +- beacon-chain/db/kv/checkpoint.go | 2 +- beacon-chain/db/kv/execution_chain.go | 2 +- beacon-chain/db/kv/finalized_block_roots.go | 2 +- beacon-chain/db/kv/state_summary.go | 2 +- beacon-chain/db/kv/utils.go | 2 +- beacon-chain/db/kv/validated_checkpoint.go | 2 +- beacon-chain/execution/BUILD.bazel | 2 +- beacon-chain/execution/block_reader.go | 2 +- beacon-chain/execution/engine_client.go | 2 +- .../forkchoice/doubly-linked-tree/BUILD.bazel | 2 +- .../doubly-linked-tree/forkchoice.go | 2 +- .../forkchoice/doubly-linked-tree/store.go | 2 +- beacon-chain/p2p/BUILD.bazel | 1 + beacon-chain/p2p/broadcaster.go | 2 +- beacon-chain/p2p/service.go | 2 +- beacon-chain/p2p/subnets.go | 2 +- beacon-chain/rpc/eth/events/BUILD.bazel | 2 +- beacon-chain/rpc/eth/events/events.go | 2 +- beacon-chain/rpc/eth/validator/BUILD.bazel | 1 + beacon-chain/rpc/eth/validator/handlers.go | 2 +- .../rpc/prysm/v1alpha1/node/BUILD.bazel | 2 +- .../rpc/prysm/v1alpha1/node/server.go | 2 +- .../rpc/prysm/v1alpha1/validator/BUILD.bazel | 1 + .../prysm/v1alpha1/validator/aggregator.go | 2 +- .../rpc/prysm/v1alpha1/validator/attester.go | 2 +- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../v1alpha1/validator/proposer_altair.go | 2 +- .../validator/proposer_attestations.go | 2 +- .../v1alpha1/validator/proposer_bellatrix.go | 2 +- .../v1alpha1/validator/proposer_deposits.go | 2 +- .../validator/proposer_execution_payload.go | 2 +- .../rpc/prysm/v1alpha1/validator/status.go | 2 +- beacon-chain/state/state-native/BUILD.bazel | 1 + beacon-chain/state/state-native/state_trie.go | 2 +- beacon-chain/state/stategen/BUILD.bazel | 1 + beacon-chain/state/stategen/getter.go | 2 +- beacon-chain/state/stategen/migrate.go | 2 +- beacon-chain/state/stategen/replay.go | 2 +- beacon-chain/state/stategen/replayer.go | 2 +- beacon-chain/state/stategen/service.go | 2 +- beacon-chain/state/stategen/setter.go | 2 +- beacon-chain/sync/BUILD.bazel | 1 + beacon-chain/sync/batch_verifier.go | 2 +- beacon-chain/sync/initial-sync/BUILD.bazel | 2 +- .../sync/initial-sync/blocks_fetcher.go | 2 +- .../sync/initial-sync/blocks_fetcher_peers.go | 2 +- .../sync/initial-sync/blocks_fetcher_utils.go | 2 +- .../sync/pending_attestations_queue.go | 2 +- beacon-chain/sync/pending_blocks_queue.go | 7 +- beacon-chain/sync/rpc.go | 2 +- .../sync/rpc_beacon_blocks_by_range.go | 2 +- beacon-chain/sync/validate_aggregate_proof.go | 2 +- .../sync/validate_beacon_attestation.go | 2 +- beacon-chain/sync/validate_beacon_blocks.go | 2 +- .../sync/validate_sync_committee_message.go | 2 +- .../sync/validate_sync_contribution_proof.go | 2 +- cmd/prysmctl/p2p/BUILD.bazel | 2 +- cmd/prysmctl/p2p/client.go | 2 +- cmd/prysmctl/validator/BUILD.bazel | 2 +- cmd/prysmctl/validator/proposer_settings.go | 2 +- cmd/prysmctl/validator/withdraw.go | 2 +- monitoring/tracing/BUILD.bazel | 1 + monitoring/tracing/trace/BUILD.bazel | 9 ++ monitoring/tracing/trace/span.go | 97 +++++++++++++++++++ monitoring/tracing/tracer.go | 2 + proto/prysm/v1alpha1/attestation/BUILD.bazel | 2 +- .../v1alpha1/attestation/attestation_utils.go | 2 +- validator/client/BUILD.bazel | 1 + validator/client/aggregate.go | 2 +- validator/client/attest.go | 2 +- validator/client/beacon-api/BUILD.bazel | 2 +- .../beacon-api/beacon_api_validator_client.go | 2 +- validator/client/grpc-api/BUILD.bazel | 2 +- .../client/grpc-api/grpc_validator_client.go | 2 +- validator/client/key_reload.go | 2 +- validator/client/propose.go | 2 +- validator/client/registration.go | 2 +- validator/client/runner.go | 5 +- validator/client/sync_committee.go | 2 +- validator/client/validator.go | 2 +- validator/client/wait_for_activation.go | 2 +- validator/db/filesystem/BUILD.bazel | 2 +- .../db/filesystem/attester_protection.go | 2 +- validator/db/kv/BUILD.bazel | 2 +- validator/db/kv/attester_protection.go | 2 +- validator/db/kv/backup.go | 2 +- validator/db/kv/eip_blacklisted_keys.go | 2 +- validator/db/kv/proposer_protection.go | 2 +- validator/db/kv/proposer_settings.go | 2 +- validator/db/kv/prune_attester_protection.go | 2 +- validator/keymanager/local/BUILD.bazel | 2 +- validator/keymanager/local/keymanager.go | 2 +- .../keymanager/remote-web3signer/BUILD.bazel | 2 +- .../remote-web3signer/internal/BUILD.bazel | 2 +- .../remote-web3signer/internal/client.go | 2 +- .../remote-web3signer/keymanager.go | 2 +- validator/rpc/BUILD.bazel | 2 +- validator/rpc/handler_wallet.go | 2 +- validator/rpc/handlers_accounts.go | 2 +- validator/rpc/handlers_auth.go | 2 +- validator/rpc/handlers_beacon.go | 2 +- validator/rpc/handlers_health.go | 2 +- validator/rpc/handlers_keymanager.go | 2 +- validator/rpc/handlers_slashing.go | 2 +- 131 files changed, 243 insertions(+), 120 deletions(-) create mode 100644 monitoring/tracing/trace/BUILD.bazel create mode 100644 monitoring/tracing/trace/span.go diff --git a/api/client/builder/BUILD.bazel b/api/client/builder/BUILD.bazel index e8dd1ce1a27a..b37b48b6b63d 100644 --- a/api/client/builder/BUILD.bazel +++ b/api/client/builder/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", @@ -28,7 +29,6 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 97acd7237c58..a6554c6eb9fb 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -19,11 +19,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) const ( diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index 8bbd65338cee..818134b58f1b 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -81,6 +81,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", diff --git a/beacon-chain/blockchain/chain_info.go b/beacon-chain/blockchain/chain_info.go index f73652add1a8..166f9e9c15ba 100644 --- a/beacon-chain/blockchain/chain_info.go +++ b/beacon-chain/blockchain/chain_info.go @@ -16,9 +16,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // ChainInfoFetcher defines a common interface for methods in blockchain service which diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index db911b31ab4e..8cfcb385fdb7 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -21,11 +21,11 @@ import ( payloadattribute "github.com/prysmaticlabs/prysm/v5/consensus-types/payload-attribute" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) const blobCommitmentVersionKZG uint8 = 0x01 diff --git a/beacon-chain/blockchain/head.go b/beacon-chain/blockchain/head.go index bda360a84ba0..eb82cd0fdf63 100644 --- a/beacon-chain/blockchain/head.go +++ b/beacon-chain/blockchain/head.go @@ -18,11 +18,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // UpdateAndSaveHeadWithBalances updates the beacon state head after getting justified balanced from cache. diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 454928b0a39d..425da163ecd0 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -25,12 +25,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // A custom slot deadline for processing state slots in our cache. diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index b878b95e6a9e..19410068a36d 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -22,11 +22,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" mathutil "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // CurrentSlot returns the current slot based on time. diff --git a/beacon-chain/blockchain/receive_attestation.go b/beacon-chain/blockchain/receive_attestation.go index 3e788b9d1e4e..e4776eae4d37 100644 --- a/beacon-chain/blockchain/receive_attestation.go +++ b/beacon-chain/blockchain/receive_attestation.go @@ -12,11 +12,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // reorgLateBlockCountAttestations is the time until the end of the slot in which we count diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index e439de0badd4..200d22207414 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -21,12 +21,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" "golang.org/x/sync/errgroup" ) diff --git a/beacon-chain/blockchain/service.go b/beacon-chain/blockchain/service.go index efbc70c7941f..23106e032a79 100644 --- a/beacon-chain/blockchain/service.go +++ b/beacon-chain/blockchain/service.go @@ -39,10 +39,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // Service represents a service that handles the internal diff --git a/beacon-chain/core/altair/BUILD.bazel b/beacon-chain/core/altair/BUILD.bazel index 37d83038eb83..e73e251e33d4 100644 --- a/beacon-chain/core/altair/BUILD.bazel +++ b/beacon-chain/core/altair/BUILD.bazel @@ -34,13 +34,13 @@ go_library( "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/core/altair/attestation.go b/beacon-chain/core/altair/attestation.go index 6c9c251e5f7b..7c11d68b7514 100644 --- a/beacon-chain/core/altair/attestation.go +++ b/beacon-chain/core/altair/attestation.go @@ -14,9 +14,9 @@ import ( consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" - "go.opencensus.io/trace" ) // ProcessAttestationsNoVerifySignature applies processing operations to a block's inner attestation diff --git a/beacon-chain/core/altair/epoch_precompute.go b/beacon-chain/core/altair/epoch_precompute.go index dbe519830578..817650893afd 100644 --- a/beacon-chain/core/altair/epoch_precompute.go +++ b/beacon-chain/core/altair/epoch_precompute.go @@ -10,7 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/math" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) // AttDelta contains rewards and penalties for a single attestation. diff --git a/beacon-chain/core/altair/transition.go b/beacon-chain/core/altair/transition.go index cc060d6203ee..a7526e346b8c 100644 --- a/beacon-chain/core/altair/transition.go +++ b/beacon-chain/core/altair/transition.go @@ -7,7 +7,7 @@ import ( e "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) // ProcessEpoch describes the per epoch operations that are performed on the beacon state. diff --git a/beacon-chain/core/blocks/BUILD.bazel b/beacon-chain/core/blocks/BUILD.bazel index 92e511ea1e27..64d5861acd63 100644 --- a/beacon-chain/core/blocks/BUILD.bazel +++ b/beacon-chain/core/blocks/BUILD.bazel @@ -40,6 +40,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/forks:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -49,7 +50,6 @@ go_library( "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index 67712ecbe684..aafcddffba7e 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -14,10 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) // ProcessAttestationsNoVerifySignature applies processing operations to a block's inner attestation diff --git a/beacon-chain/core/epoch/precompute/BUILD.bazel b/beacon-chain/core/epoch/precompute/BUILD.bazel index 588697ca3c7f..73cca06e2840 100644 --- a/beacon-chain/core/epoch/precompute/BUILD.bazel +++ b/beacon-chain/core/epoch/precompute/BUILD.bazel @@ -24,6 +24,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//math:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", "//runtime/version:go_default_library", diff --git a/beacon-chain/core/epoch/precompute/attestation.go b/beacon-chain/core/epoch/precompute/attestation.go index a510fbb83e6f..45daa1f9b847 100644 --- a/beacon-chain/core/epoch/precompute/attestation.go +++ b/beacon-chain/core/epoch/precompute/attestation.go @@ -11,10 +11,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) // ProcessAttestations process the attestations in state and update individual validator's pre computes, diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index c33980c260f3..b0cbd9c16061 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//time:go_default_library", @@ -42,7 +43,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index d896fe2de7f5..6c1f64a39480 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -16,11 +16,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var ( diff --git a/beacon-chain/core/transition/BUILD.bazel b/beacon-chain/core/transition/BUILD.bazel index 0f5bb260b4b8..dde088dd563f 100644 --- a/beacon-chain/core/transition/BUILD.bazel +++ b/beacon-chain/core/transition/BUILD.bazel @@ -41,6 +41,7 @@ go_library( "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index 139bfdefdf8f..e16b5c920e59 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -25,8 +25,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" + goTrace "go.opencensus.io/trace" ) type customProcessingFn func(context.Context, state.BeaconState) error @@ -258,7 +259,7 @@ func cacheBestBeaconStateOnErrFn(highestSlot primitives.Slot, key [32]byte) cust // if (state.slot + 1) % SLOTS_PER_EPOCH == 0: // process_epoch(state) // state.slot = Slot(state.slot + 1) -func ProcessSlotsCore(ctx context.Context, span *trace.Span, state state.BeaconState, slot primitives.Slot, fn customProcessingFn) (state.BeaconState, error) { +func ProcessSlotsCore(ctx context.Context, span *goTrace.Span, state state.BeaconState, slot primitives.Slot, fn customProcessingFn) (state.BeaconState, error) { var err error for state.Slot() < slot { if fn != nil { diff --git a/beacon-chain/core/transition/transition_no_verify_sig.go b/beacon-chain/core/transition/transition_no_verify_sig.go index 63dffe970822..402d607837b3 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig.go +++ b/beacon-chain/core/transition/transition_no_verify_sig.go @@ -16,8 +16,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) // ExecuteStateTransitionNoVerifyAnySig defines the procedure for a state transition function. diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index 1d634375f3a6..71b7f7ba4172 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -51,6 +51,7 @@ go_library( "//io/file:go_default_library", "//monitoring/progress:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/dbval:go_default_library", "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/db/kv/backup.go b/beacon-chain/db/kv/backup.go index 60eb7afd18ae..d005f559ea36 100644 --- a/beacon-chain/db/kv/backup.go +++ b/beacon-chain/db/kv/backup.go @@ -8,8 +8,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/io/file" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) const backupsDirectoryName = "backups" diff --git a/beacon-chain/db/kv/blocks.go b/beacon-chain/db/kv/blocks.go index 466afb3f6789..459672f95951 100644 --- a/beacon-chain/db/kv/blocks.go +++ b/beacon-chain/db/kv/blocks.go @@ -16,11 +16,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // used to represent errors for inconsistent slot ranges. diff --git a/beacon-chain/db/kv/checkpoint.go b/beacon-chain/db/kv/checkpoint.go index 01579396e77d..30e93d769722 100644 --- a/beacon-chain/db/kv/checkpoint.go +++ b/beacon-chain/db/kv/checkpoint.go @@ -8,9 +8,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) var errMissingStateForCheckpoint = errors.New("missing state summary for checkpoint root") diff --git a/beacon-chain/db/kv/execution_chain.go b/beacon-chain/db/kv/execution_chain.go index 2d67f4c4d7f4..a496e0e7cee2 100644 --- a/beacon-chain/db/kv/execution_chain.go +++ b/beacon-chain/db/kv/execution_chain.go @@ -5,9 +5,9 @@ import ( "errors" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" v2 "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/beacon-chain/db/kv/finalized_block_roots.go b/beacon-chain/db/kv/finalized_block_roots.go index 3376abc8ef40..1f39d431320a 100644 --- a/beacon-chain/db/kv/finalized_block_roots.go +++ b/beacon-chain/db/kv/finalized_block_roots.go @@ -10,9 +10,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) var previousFinalizedCheckpointKey = []byte("previous-finalized-checkpoint") diff --git a/beacon-chain/db/kv/state_summary.go b/beacon-chain/db/kv/state_summary.go index d99dde29753f..187129a556cd 100644 --- a/beacon-chain/db/kv/state_summary.go +++ b/beacon-chain/db/kv/state_summary.go @@ -4,9 +4,9 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // SaveStateSummary saves a state summary object to the DB. diff --git a/beacon-chain/db/kv/utils.go b/beacon-chain/db/kv/utils.go index 1a292c7122c3..522b3860cd5c 100644 --- a/beacon-chain/db/kv/utils.go +++ b/beacon-chain/db/kv/utils.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // lookupValuesForIndices takes in a list of indices and looks up diff --git a/beacon-chain/db/kv/validated_checkpoint.go b/beacon-chain/db/kv/validated_checkpoint.go index 4223097e0953..3317cd1a3a4d 100644 --- a/beacon-chain/db/kv/validated_checkpoint.go +++ b/beacon-chain/db/kv/validated_checkpoint.go @@ -3,9 +3,9 @@ package kv import ( "context" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // LastValidatedCheckpoint returns the latest fully validated checkpoint in beacon chain. diff --git a/beacon-chain/execution/BUILD.bazel b/beacon-chain/execution/BUILD.bazel index 15b1bb55a2b2..828ca2ea7fd5 100644 --- a/beacon-chain/execution/BUILD.bazel +++ b/beacon-chain/execution/BUILD.bazel @@ -50,6 +50,7 @@ go_library( "//io/logs:go_default_library", "//monitoring/clientstats:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network:go_default_library", "//network/authorization:go_default_library", "//proto/engine/v1:go_default_library", @@ -70,7 +71,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_k8s_client_go//tools/cache:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/execution/block_reader.go b/beacon-chain/execution/block_reader.go index 6918a6e9e978..985b92e90391 100644 --- a/beacon-chain/execution/block_reader.go +++ b/beacon-chain/execution/block_reader.go @@ -10,7 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/types" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) // searchThreshold to apply for when searching for blocks of a particular time. If the buffer diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 7875fa6c2d77..12fdd0393b98 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -21,11 +21,11 @@ import ( payloadattribute "github.com/prysmaticlabs/prysm/v5/consensus-types/payload-attribute" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" pb "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/beacon-chain/forkchoice/doubly-linked-tree/BUILD.bazel b/beacon-chain/forkchoice/doubly-linked-tree/BUILD.bazel index 85e199d2abce..f7bdf4696334 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/BUILD.bazel +++ b/beacon-chain/forkchoice/doubly-linked-tree/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//consensus-types/forkchoice:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", @@ -40,7 +41,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go index 807e0d80f9b3..dea38cb49183 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go +++ b/beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go @@ -15,11 +15,11 @@ import ( forkchoice2 "github.com/prysmaticlabs/prysm/v5/consensus-types/forkchoice" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // New initializes a new fork choice store. diff --git a/beacon-chain/forkchoice/doubly-linked-tree/store.go b/beacon-chain/forkchoice/doubly-linked-tree/store.go index 23b58a05811b..77c896c46caf 100644 --- a/beacon-chain/forkchoice/doubly-linked-tree/store.go +++ b/beacon-chain/forkchoice/doubly-linked-tree/store.go @@ -9,8 +9,8 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // head starts from justified root and then follows the best descendant links diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index ddbbf7b5b105..baa53ee11d1a 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -66,6 +66,7 @@ go_library( "//io/file:go_default_library", "//math:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network:go_default_library", "//network/forks:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index d770bff91acc..2c274fb2a3df 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -14,10 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/beacon-chain/p2p/service.go b/beacon-chain/p2p/service.go index 8192d9b0b67f..0234408f26a8 100644 --- a/beacon-chain/p2p/service.go +++ b/beacon-chain/p2p/service.go @@ -27,12 +27,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" leakybucket "github.com/prysmaticlabs/prysm/v5/container/leaky-bucket" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" prysmnetwork "github.com/prysmaticlabs/prysm/v5/network" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/prysmaticlabs/prysm/v5/runtime" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var _ runtime.Service = (*Service)(nil) diff --git a/beacon-chain/p2p/subnets.go b/beacon-chain/p2p/subnets.go index 37ccea8ad998..25c335a5421e 100644 --- a/beacon-chain/p2p/subnets.go +++ b/beacon-chain/p2p/subnets.go @@ -20,8 +20,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" mathutil "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) var attestationSubnetCount = params.BeaconConfig().AttestationSubnetCount diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index 37d627b50820..640017b6b2b1 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", "//config/params:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", @@ -28,7 +29,6 @@ go_library( "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index c4782f8c14b3..93187e31a5e4 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -19,13 +19,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) const ( diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index b4964a0570e0..38b3dcabb96e 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -37,6 +37,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index f20ab9c5cc4d..597af22476a6 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -28,11 +28,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpbalpha "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel index 428753ab1481..59afef99c055 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel @@ -12,13 +12,13 @@ go_library( "//beacon-chain/p2p:go_default_library", "//beacon-chain/sync:go_default_library", "//io/logs:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "@com_github_golang_protobuf//ptypes/empty", "@com_github_golang_protobuf//ptypes/timestamp", "@com_github_libp2p_go_libp2p//core/network:go_default_library", "@com_github_libp2p_go_libp2p//core/peer:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server.go b/beacon-chain/rpc/prysm/v1alpha1/node/server.go index 67c3b863f8c1..135d08ee37e2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server.go @@ -21,9 +21,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/io/logs" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel index 34ef244e1977..50acfb14486e 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel @@ -79,6 +79,7 @@ go_library( "//encoding/ssz:go_default_library", "//math:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/forks:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index cee94fe76759..82fbce0ef92d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -8,9 +8,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index 802d551bd765..d71beb5faf17 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -10,9 +10,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 4370d1e3d9ab..15111c24cdcc 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -26,12 +26,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "golang.org/x/sync/errgroup" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_altair.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_altair.go index abb1564724ea..c99fdd51ca84 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_altair.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_altair.go @@ -9,11 +9,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" synccontribution "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/sync_contribution" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) func (vs *Server) setSyncAggregate(ctx context.Context, blk interfaces.SignedBeaconBlock) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index f278b9316ab6..ca4785d34f55 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -14,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -21,7 +22,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) type proposerAtts []ethpb.Att diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 6fbd69215204..23379cb2e000 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -21,12 +21,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/forks" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var ( diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go index 3e322963c78d..fc6d238add4a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go @@ -12,10 +12,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "golang.org/x/sync/errgroup" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 1d87e299ec78..631437fbcea6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -21,11 +21,11 @@ import ( payloadattribute "github.com/prysmaticlabs/prysm/v5/consensus-types/payload-attribute" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var ( diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go index 67bf6da2a60d..67a5799d65c7 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go @@ -14,10 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/contracts/deposit" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 9e24c64e914f..10adeab9263a 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -73,6 +73,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 29ba8c0abb21..648d18879eed 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -19,9 +19,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/beacon-chain/state/stategen/BUILD.bazel b/beacon-chain/state/stategen/BUILD.bazel index 294a6680db4c..896bab3d0f04 100644 --- a/beacon-chain/state/stategen/BUILD.bazel +++ b/beacon-chain/state/stategen/BUILD.bazel @@ -35,6 +35,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_hashicorp_golang_lru//:go_default_library", diff --git a/beacon-chain/state/stategen/getter.go b/beacon-chain/state/stategen/getter.go index 6f3cc3eaf772..c1033a5a7c0d 100644 --- a/beacon-chain/state/stategen/getter.go +++ b/beacon-chain/state/stategen/getter.go @@ -12,8 +12,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) var ErrNoDataForSlot = errors.New("cannot retrieve data for slot") diff --git a/beacon-chain/state/stategen/migrate.go b/beacon-chain/state/stategen/migrate.go index 32e0d0db4fcb..21e697160890 100644 --- a/beacon-chain/state/stategen/migrate.go +++ b/beacon-chain/state/stategen/migrate.go @@ -7,8 +7,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // MigrateToCold advances the finalized info in between the cold and hot state sections. diff --git a/beacon-chain/state/stategen/replay.go b/beacon-chain/state/stategen/replay.go index 12b64d0fed62..ef8c3e1089d7 100644 --- a/beacon-chain/state/stategen/replay.go +++ b/beacon-chain/state/stategen/replay.go @@ -12,8 +12,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // ReplayBlocks replays the input blocks on the input state until the target slot is reached. diff --git a/beacon-chain/state/stategen/replayer.go b/beacon-chain/state/stategen/replayer.go index aa6ea3eb3a1d..beff7a1a438e 100644 --- a/beacon-chain/state/stategen/replayer.go +++ b/beacon-chain/state/stategen/replayer.go @@ -9,8 +9,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var ErrFutureSlotRequested = errors.New("cannot replay to future slots") diff --git a/beacon-chain/state/stategen/service.go b/beacon-chain/state/stategen/service.go index 6fc26cf6852e..3fa8011907c2 100644 --- a/beacon-chain/state/stategen/service.go +++ b/beacon-chain/state/stategen/service.go @@ -19,8 +19,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) var defaultHotStateDBInterval primitives.Slot = 128 diff --git a/beacon-chain/state/stategen/setter.go b/beacon-chain/state/stategen/setter.go index 9804bcc7d044..88c29356035b 100644 --- a/beacon-chain/state/stategen/setter.go +++ b/beacon-chain/state/stategen/setter.go @@ -9,10 +9,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // SaveState saves the state in the cache and/or DB. diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index cba397bcf1bf..c19ba7e4c4b0 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -112,6 +112,7 @@ go_library( "//encoding/ssz/equality:go_default_library", "//io/file:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/forks:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", diff --git a/beacon-chain/sync/batch_verifier.go b/beacon-chain/sync/batch_verifier.go index e2a275accbb7..0edb70524553 100644 --- a/beacon-chain/sync/batch_verifier.go +++ b/beacon-chain/sync/batch_verifier.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) const signatureVerificationInterval = 50 * time.Millisecond diff --git a/beacon-chain/sync/initial-sync/BUILD.bazel b/beacon-chain/sync/initial-sync/BUILD.bazel index 3d4ab052ec1e..1291f2fc20f5 100644 --- a/beacon-chain/sync/initial-sync/BUILD.bazel +++ b/beacon-chain/sync/initial-sync/BUILD.bazel @@ -39,6 +39,7 @@ go_library( "//container/leaky-bucket:go_default_library", "//crypto/rand:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime:go_default_library", "//runtime/version:go_default_library", @@ -48,7 +49,6 @@ go_library( "@com_github_paulbellamy_ratecounter//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher.go b/beacon-chain/sync/initial-sync/blocks_fetcher.go index 915826801ed7..0667983fedf0 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher.go @@ -26,11 +26,11 @@ import ( leakybucket "github.com/prysmaticlabs/prysm/v5/container/leaky-bucket" "github.com/prysmaticlabs/prysm/v5/crypto/rand" "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" p2ppb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) const ( diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher_peers.go b/beacon-chain/sync/initial-sync/blocks_fetcher_peers.go index fd83ead9c585..ddb9c39cfd36 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher_peers.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher_peers.go @@ -11,10 +11,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/config/params" mathutil "github.com/prysmaticlabs/prysm/v5/math" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // peerLock returns peer lock for a given peer. If lock is not found, it is created. diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go b/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go index dcdaf161ab94..e1ebb8f2e218 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher_utils.go @@ -12,10 +12,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" p2ppb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // forkData represents alternative chain path supported by a given peer. diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index f827d4fd6b11..448875c203c2 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -14,11 +14,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/rand" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // This defines how often a node cleans up and processes pending attestations in the queue. diff --git a/beacon-chain/sync/pending_blocks_queue.go b/beacon-chain/sync/pending_blocks_queue.go index 698ee4572654..a50179aed43c 100644 --- a/beacon-chain/sync/pending_blocks_queue.go +++ b/beacon-chain/sync/pending_blocks_queue.go @@ -21,10 +21,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz/equality" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" "github.com/trailofbits/go-mutexasserts" - "go.opencensus.io/trace" + goTrace "go.opencensus.io/trace" ) var processPendingBlocksPeriod = slots.DivideSlotBy(3 /* times per slot */) @@ -157,7 +158,7 @@ func (s *Service) processPendingBlocks(ctx context.Context) error { } // startInnerSpan starts a new tracing span for an inner loop and returns the new context and span. -func startInnerSpan(ctx context.Context, slot primitives.Slot) (context.Context, *trace.Span) { +func startInnerSpan(ctx context.Context, slot primitives.Slot) (context.Context, *goTrace.Span) { ctx, span := trace.StartSpan(ctx, "processPendingBlocks.InnerLoop") span.AddAttributes(trace.Int64Attribute("slot", int64(slot))) // lint:ignore uintcast -- This conversion is OK for tracing. return ctx, span @@ -254,7 +255,7 @@ func (s *Service) getBestPeers() []core.PeerID { func (s *Service) checkIfBlockIsBad( ctx context.Context, - span *trace.Span, + span *goTrace.Span, slot primitives.Slot, b interfaces.ReadOnlySignedBeaconBlock, blkRoot [32]byte, diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index 7ada5cc609f3..d2bc38f16c30 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -16,8 +16,8 @@ import ( p2ptypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // Time to first byte timeout. The maximum time to wait for first byte of diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_range.go b/beacon-chain/sync/rpc_beacon_blocks_by_range.go index 0236b22681d7..d60533c876f1 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_range.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_range.go @@ -13,9 +13,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // beaconBlocksByRangeRPCHandler looks up the request blocks from the database from a given start block. diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index 188ced2430b0..ba32cbe11bc8 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -19,11 +19,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // validateAggregateAndProof verifies the aggregated signature and the selection proof is valid before forwarding to the diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index a57eb9b4b9ec..135812bb8454 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -22,11 +22,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // Validation diff --git a/beacon-chain/sync/validate_beacon_blocks.go b/beacon-chain/sync/validate_beacon_blocks.go index 37699e189456..302107cbeb52 100644 --- a/beacon-chain/sync/validate_beacon_blocks.go +++ b/beacon-chain/sync/validate_beacon_blocks.go @@ -23,11 +23,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var ( diff --git a/beacon-chain/sync/validate_sync_committee_message.go b/beacon-chain/sync/validate_sync_committee_message.go index e60bfc9806a3..f52a3591534c 100644 --- a/beacon-chain/sync/validate_sync_committee_message.go +++ b/beacon-chain/sync/validate_sync_committee_message.go @@ -18,8 +18,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // Sync committee subnets are used to propagate unaggregated sync committee messages to subsections of the network. diff --git a/beacon-chain/sync/validate_sync_contribution_proof.go b/beacon-chain/sync/validate_sync_contribution_proof.go index 12829db2d257..acb5b20fb660 100644 --- a/beacon-chain/sync/validate_sync_contribution_proof.go +++ b/beacon-chain/sync/validate_sync_contribution_proof.go @@ -16,8 +16,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // validateSyncContributionAndProof verifies the aggregated signature and the selection proof is valid before forwarding to the diff --git a/cmd/prysmctl/p2p/BUILD.bazel b/cmd/prysmctl/p2p/BUILD.bazel index bb04938b454f..712f4756a89e 100644 --- a/cmd/prysmctl/p2p/BUILD.bazel +++ b/cmd/prysmctl/p2p/BUILD.bazel @@ -29,6 +29,7 @@ go_library( "//crypto/ecdsa:go_default_library", "//encoding/bytesutil:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network:go_default_library", "//network/forks:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -50,7 +51,6 @@ go_library( "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", ], diff --git a/cmd/prysmctl/p2p/client.go b/cmd/prysmctl/p2p/client.go index 146e7f0ef365..470844194d8d 100644 --- a/cmd/prysmctl/p2p/client.go +++ b/cmd/prysmctl/p2p/client.go @@ -25,13 +25,13 @@ import ( ecdsaprysm "github.com/prysmaticlabs/prysm/v5/crypto/ecdsa" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network" "github.com/prysmaticlabs/prysm/v5/network/forks" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" ) diff --git a/cmd/prysmctl/validator/BUILD.bazel b/cmd/prysmctl/validator/BUILD.bazel index 0d1174c503b6..7acc73159979 100644 --- a/cmd/prysmctl/validator/BUILD.bazel +++ b/cmd/prysmctl/validator/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", "//io/prompt:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//runtime/tos:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", @@ -33,7 +34,6 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/cmd/prysmctl/validator/proposer_settings.go b/cmd/prysmctl/validator/proposer_settings.go index 5c9d84341b16..26de12a58dc0 100644 --- a/cmd/prysmctl/validator/proposer_settings.go +++ b/cmd/prysmctl/validator/proposer_settings.go @@ -14,10 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/io/prompt" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" log "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" - "go.opencensus.io/trace" ) func getProposerSettings(c *cli.Context, r io.Reader) error { diff --git a/cmd/prysmctl/validator/withdraw.go b/cmd/prysmctl/validator/withdraw.go index 6db3e1c99c23..e142e0ca548f 100644 --- a/cmd/prysmctl/validator/withdraw.go +++ b/cmd/prysmctl/validator/withdraw.go @@ -17,9 +17,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" log "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" - "go.opencensus.io/trace" ) func setWithdrawalAddresses(c *cli.Context) error { diff --git a/monitoring/tracing/BUILD.bazel b/monitoring/tracing/BUILD.bazel index 9d132bba3e41..bfae1ed82732 100644 --- a/monitoring/tracing/BUILD.bazel +++ b/monitoring/tracing/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/monitoring/tracing", visibility = ["//visibility:public"], deps = [ + "//monitoring/tracing/trace:go_default_library", "//runtime/version:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", diff --git a/monitoring/tracing/trace/BUILD.bazel b/monitoring/tracing/trace/BUILD.bazel new file mode 100644 index 000000000000..f92aa2295380 --- /dev/null +++ b/monitoring/tracing/trace/BUILD.bazel @@ -0,0 +1,9 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["span.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace", + visibility = ["//visibility:public"], + deps = ["@io_opencensus_go//trace:go_default_library"], +) diff --git a/monitoring/tracing/trace/span.go b/monitoring/tracing/trace/span.go new file mode 100644 index 000000000000..e05ebc4d81bf --- /dev/null +++ b/monitoring/tracing/trace/span.go @@ -0,0 +1,97 @@ +package trace + +import ( + "context" + + "go.opencensus.io/trace" +) + +// TracingEnabled tracks whether tracing is enabled in prysm. +var TracingEnabled = false + +// StartSpan is a wrapper over the opencensus package method. This is to allow us to skip +// calling that particular method if tracing has been disabled. +func StartSpan(ctx context.Context, name string, o ...trace.StartOption) (context.Context, *trace.Span) { + if !TracingEnabled { + // Return an empty span if tracing has been disabled. + return ctx, trace.NewSpan(EmptySpan{}) + } + return trace.StartSpan(ctx, name, o...) +} + +// NewContext is a wrapper which returns back the parent context +// if tracing is disabled. +func NewContext(parent context.Context, s *trace.Span) context.Context { + if !TracingEnabled { + return parent + } + return trace.NewContext(parent, s) +} + +// FromContext is a wrapper which returns a nil span +// if tracing is disabled. +func FromContext(ctx context.Context) *trace.Span { + if !TracingEnabled { + return trace.NewSpan(EmptySpan{}) + } + return trace.FromContext(ctx) +} + +// Int64Attribute -- +func Int64Attribute(key string, value int64) trace.Attribute { + return trace.Int64Attribute(key, value) +} + +// StringAttribute -- +func StringAttribute(key, value string) trace.Attribute { + return trace.StringAttribute(key, value) +} + +// BoolAttribute -- +func BoolAttribute(key string, value bool) trace.Attribute { + return trace.BoolAttribute(key, value) +} + +type EmptySpan struct{} + +func (EmptySpan) IsRecordingEvents() bool { + return false +} + +func (EmptySpan) End() { +} + +func (EmptySpan) SpanContext() trace.SpanContext { + return trace.SpanContext{} +} + +func (EmptySpan) SetName(string) { + +} + +func (EmptySpan) SetStatus(trace.Status) { + +} + +func (EmptySpan) AddAttributes(...trace.Attribute) { +} + +func (EmptySpan) Annotate([]trace.Attribute, string) { + +} + +func (EmptySpan) Annotatef([]trace.Attribute, string, ...interface{}) { +} + +func (EmptySpan) AddMessageSendEvent(_, _, _ int64) { +} + +func (EmptySpan) AddMessageReceiveEvent(_, _, _ int64) { +} + +func (EmptySpan) AddLink(trace.Link) { +} + +func (EmptySpan) String() string { + return "" +} diff --git a/monitoring/tracing/tracer.go b/monitoring/tracing/tracer.go index 28b78c1894ec..2fb5fc33b8ea 100644 --- a/monitoring/tracing/tracer.go +++ b/monitoring/tracing/tracer.go @@ -6,6 +6,7 @@ import ( "errors" "contrib.go.opencensus.io/exporter/jaeger" + prysmTrace "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -19,6 +20,7 @@ func Setup(serviceName, processName, endpoint string, sampleFraction float64, en trace.ApplyConfig(trace.Config{DefaultSampler: trace.NeverSample()}) return nil } + prysmTrace.TracingEnabled = true if serviceName == "" { return errors.New("tracing service name cannot be empty") diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index b1ee168216a5..c27b0bf90d37 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -15,11 +15,11 @@ go_library( "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/hash:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils.go b/proto/prysm/v1alpha1/attestation/attestation_utils.go index ba9db2872480..160378b7d803 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils.go @@ -15,9 +15,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) // ConvertToIndexed converts attestation to (almost) indexed-verifiable form. diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index 6c9fbce2acd5..28c9e410cf52 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -49,6 +49,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index ca45c5dd1284..0808f7028269 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -13,13 +13,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/validator/client/attest.go b/validator/client/attest.go index 024bfaa0e813..b5996773f5eb 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -17,13 +17,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var failedAttLocalProtectionErr = "attempted to make slashable attestation, rejected by local slashing protection" diff --git a/validator/client/beacon-api/BUILD.bazel b/validator/client/beacon-api/BUILD.bazel index 7ee6a6ac4f2e..92751d7d6dcd 100644 --- a/validator/client/beacon-api/BUILD.bazel +++ b/validator/client/beacon-api/BUILD.bazel @@ -51,6 +51,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/forks:go_default_library", "//network/httputil:go_default_library", "//proto/engine/v1:go_default_library", @@ -64,7 +65,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", "@org_golang_x_sync//errgroup:go_default_library", diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 56dad0c777eb..b80806fcf0a1 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -11,9 +11,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/client/event" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "go.opencensus.io/trace" ) type ValidatorClientOpt func(*beaconApiValidatorClient) diff --git a/validator/client/grpc-api/BUILD.bazel b/validator/client/grpc-api/BUILD.bazel index 3fdd649792ae..3dd77c8311cb 100644 --- a/validator/client/grpc-api/BUILD.bazel +++ b/validator/client/grpc-api/BUILD.bazel @@ -19,13 +19,13 @@ go_library( "//beacon-chain/state/state-native:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/eth/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//validator/client/iface:go_default_library", "@com_github_golang_protobuf//ptypes/empty", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index c03d504dff80..3f7acc739a9f 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -11,10 +11,10 @@ import ( eventClient "github.com/prysmaticlabs/prysm/v5/api/client/event" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/grpc" ) diff --git a/validator/client/key_reload.go b/validator/client/key_reload.go index ab01e89f9306..99250bb2a370 100644 --- a/validator/client/key_reload.go +++ b/validator/client/key_reload.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "go.opencensus.io/trace" ) // HandleKeyReload makes sure the validator keeps operating correctly after a change to the underlying keys. diff --git a/validator/client/propose.go b/validator/client/propose.go index 656f7d38da4a..411d02bac7f1 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/crypto/rand" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/runtime/version" @@ -27,7 +28,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/validator/client/registration.go b/validator/client/registration.go index bc4ae46bfcab..fb54d27eb1bc 100644 --- a/validator/client/registration.go +++ b/validator/client/registration.go @@ -10,10 +10,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "go.opencensus.io/trace" ) // SubmitValidatorRegistrations signs validator registration objects and submits it to the beacon node by batch of validatorRegsBatchSize size maximum. diff --git a/validator/client/runner.go b/validator/client/runner.go index 34bc8273496c..1f42363116a7 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -14,9 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "go.opencensus.io/trace" + goTrace "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -225,7 +226,7 @@ func initializeValidatorAndGetHeadSlot(ctx context.Context, v iface.Validator) ( return headSlot, nil } -func performRoles(slotCtx context.Context, allRoles map[[48]byte][]iface.ValidatorRole, v iface.Validator, slot primitives.Slot, wg *sync.WaitGroup, span *trace.Span) { +func performRoles(slotCtx context.Context, allRoles map[[48]byte][]iface.ValidatorRole, v iface.Validator, slot primitives.Slot, wg *sync.WaitGroup, span *goTrace.Span) { for pubKey, roles := range allRoles { wg.Add(len(roles)) for _, role := range roles { diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index f32b1ce0fede..6b7dbfdd9e64 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -16,12 +16,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // SubmitSyncCommitteeMessage submits the sync committee message to the beacon chain. diff --git a/validator/client/validator.go b/validator/client/validator.go index b89c9e88fcd9..5b9f99ec270b 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -35,6 +35,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" accountsiface "github.com/prysmaticlabs/prysm/v5/validator/accounts/iface" @@ -48,7 +49,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/keymanager/local" remoteweb3signer "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index 0c2f6b5f417c..28b3e048acb3 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -11,9 +11,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "go.opencensus.io/trace" ) // WaitForActivation checks whether the validator pubkey is in the active diff --git a/validator/db/filesystem/BUILD.bazel b/validator/db/filesystem/BUILD.bazel index f61ff14cf3b3..39810f59da9a 100644 --- a/validator/db/filesystem/BUILD.bazel +++ b/validator/db/filesystem/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//io/file:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//validator/db/common:go_default_library", @@ -31,7 +32,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@in_gopkg_yaml_v3//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/validator/db/filesystem/attester_protection.go b/validator/db/filesystem/attester_protection.go index 996538e0137d..226eaee9c2c1 100644 --- a/validator/db/filesystem/attester_protection.go +++ b/validator/db/filesystem/attester_protection.go @@ -8,9 +8,9 @@ import ( "github.com/prometheus/client_golang/prometheus" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/db/common" - "go.opencensus.io/trace" ) const failedAttLocalProtectionErr = "attempted to make slashable attestation, rejected by local slashing protection" diff --git a/validator/db/kv/BUILD.bazel b/validator/db/kv/BUILD.bazel index 1df227591d2d..38e61170b651 100644 --- a/validator/db/kv/BUILD.bazel +++ b/validator/db/kv/BUILD.bazel @@ -38,6 +38,7 @@ go_library( "//io/file:go_default_library", "//monitoring/progress:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/slashings:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", @@ -51,7 +52,6 @@ go_library( "@com_github_prysmaticlabs_prombbolt//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_etcd_go_bbolt//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/validator/db/kv/attester_protection.go b/validator/db/kv/attester_protection.go index 5187b2f30f74..762f883f0286 100644 --- a/validator/db/kv/attester_protection.go +++ b/validator/db/kv/attester_protection.go @@ -13,11 +13,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/slashings" "github.com/prysmaticlabs/prysm/v5/validator/db/common" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // SlashingKind used for helpful information upon detection. diff --git a/validator/db/kv/backup.go b/validator/db/kv/backup.go index afbe122a964b..20a4fba678eb 100644 --- a/validator/db/kv/backup.go +++ b/validator/db/kv/backup.go @@ -8,8 +8,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/io/file" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) const backupsDirectoryName = "backups" diff --git a/validator/db/kv/eip_blacklisted_keys.go b/validator/db/kv/eip_blacklisted_keys.go index db3921d42b83..618d43849f01 100644 --- a/validator/db/kv/eip_blacklisted_keys.go +++ b/validator/db/kv/eip_blacklisted_keys.go @@ -4,8 +4,8 @@ import ( "context" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // EIPImportBlacklistedPublicKeys returns keys that were marked as blacklisted during EIP-3076 slashing diff --git a/validator/db/kv/proposer_protection.go b/validator/db/kv/proposer_protection.go index eb1ebfefdb84..4dd1d622faa2 100644 --- a/validator/db/kv/proposer_protection.go +++ b/validator/db/kv/proposer_protection.go @@ -11,10 +11,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/validator/db/common" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // ProposedPublicKeys retrieves all public keys in our proposals history bucket. diff --git a/validator/db/kv/proposer_settings.go b/validator/db/kv/proposer_settings.go index 6b573dbc2796..1cb7ffd4dae6 100644 --- a/validator/db/kv/proposer_settings.go +++ b/validator/db/kv/proposer_settings.go @@ -5,9 +5,9 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/config/proposer" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/validator/db/kv/prune_attester_protection.go b/validator/db/kv/prune_attester_protection.go index ef73cb68e4cd..1b3ec2f109cc 100644 --- a/validator/db/kv/prune_attester_protection.go +++ b/validator/db/kv/prune_attester_protection.go @@ -6,8 +6,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // PruneAttestations loops through every public key in the public keys bucket diff --git a/validator/keymanager/local/BUILD.bazel b/validator/keymanager/local/BUILD.bazel index cd44564f44a8..5b21621c6be8 100644 --- a/validator/keymanager/local/BUILD.bazel +++ b/validator/keymanager/local/BUILD.bazel @@ -27,6 +27,7 @@ go_library( "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//runtime/interop:go_default_library", "//validator/accounts/iface:go_default_library", @@ -40,7 +41,6 @@ go_library( "@com_github_schollz_progressbar_v3//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/validator/keymanager/local/keymanager.go b/validator/keymanager/local/keymanager.go index 5346a11078f7..241610c13e92 100644 --- a/validator/keymanager/local/keymanager.go +++ b/validator/keymanager/local/keymanager.go @@ -15,13 +15,13 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/runtime/interop" "github.com/prysmaticlabs/prysm/v5/validator/accounts/iface" "github.com/prysmaticlabs/prysm/v5/validator/accounts/petnames" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" - "go.opencensus.io/trace" ) var ( diff --git a/validator/keymanager/remote-web3signer/BUILD.bazel b/validator/keymanager/remote-web3signer/BUILD.bazel index d3cc832bb8c6..50f84cf2d714 100644 --- a/validator/keymanager/remote-web3signer/BUILD.bazel +++ b/validator/keymanager/remote-web3signer/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", "//validator/accounts/petnames:go_default_library", "//validator/keymanager:go_default_library", @@ -31,7 +32,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_x_exp//maps:go_default_library", ], ) diff --git a/validator/keymanager/remote-web3signer/internal/BUILD.bazel b/validator/keymanager/remote-web3signer/internal/BUILD.bazel index 8b9e49daf3a9..1b36d622e14b 100644 --- a/validator/keymanager/remote-web3signer/internal/BUILD.bazel +++ b/validator/keymanager/remote-web3signer/internal/BUILD.bazel @@ -13,12 +13,12 @@ go_library( "//config/fieldparams:go_default_library", "//crypto/bls:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/validator/keymanager/remote-web3signer/internal/client.go b/validator/keymanager/remote-web3signer/internal/client.go index 9c9c9fc0646f..5ba892891c9b 100644 --- a/validator/keymanager/remote-web3signer/internal/client.go +++ b/validator/keymanager/remote-web3signer/internal/client.go @@ -18,8 +18,8 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) const ( diff --git a/validator/keymanager/remote-web3signer/keymanager.go b/validator/keymanager/remote-web3signer/keymanager.go index 0da752d72806..3c346a1c5497 100644 --- a/validator/keymanager/remote-web3signer/keymanager.go +++ b/validator/keymanager/remote-web3signer/keymanager.go @@ -22,13 +22,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/io/file" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" "github.com/prysmaticlabs/prysm/v5/validator/accounts/petnames" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer/internal" web3signerv1 "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer/v1" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "golang.org/x/exp/maps" ) diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 96701e719c63..34165e3489d0 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -43,6 +43,7 @@ go_library( "//io/logs:go_default_library", "//io/prompt:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", @@ -78,7 +79,6 @@ go_library( "@com_github_tyler_smith_go_bip39//wordlists:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", "@io_opencensus_go//plugin/ocgrpc:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", diff --git a/validator/rpc/handler_wallet.go b/validator/rpc/handler_wallet.go index d100d6ce0e3d..72918cfa6c2f 100644 --- a/validator/rpc/handler_wallet.go +++ b/validator/rpc/handler_wallet.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/io/prompt" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/validator/accounts" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" @@ -20,7 +21,6 @@ import ( "github.com/tyler-smith/go-bip39" "github.com/tyler-smith/go-bip39/wordlists" keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" - "go.opencensus.io/trace" ) // CreateWallet via an API request, allowing a user to save a new wallet. diff --git a/validator/rpc/handlers_accounts.go b/validator/rpc/handlers_accounts.go index 724c0353b77c..91ca00324d23 100644 --- a/validator/rpc/handlers_accounts.go +++ b/validator/rpc/handlers_accounts.go @@ -18,13 +18,13 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/validator/accounts" "github.com/prysmaticlabs/prysm/v5/validator/accounts/petnames" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/derived" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/local" - "go.opencensus.io/trace" ) // ListAccounts allows retrieval of validating keys and their petnames diff --git a/validator/rpc/handlers_auth.go b/validator/rpc/handlers_auth.go index 24c29491945a..52a4b8986df5 100644 --- a/validator/rpc/handlers_auth.go +++ b/validator/rpc/handlers_auth.go @@ -5,9 +5,9 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/io/file" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" - "go.opencensus.io/trace" ) // Initialize returns metadata regarding whether the caller has authenticated and has a wallet. diff --git a/validator/rpc/handlers_beacon.go b/validator/rpc/handlers_beacon.go index 345d36a1bf80..87163985246a 100644 --- a/validator/rpc/handlers_beacon.go +++ b/validator/rpc/handlers_beacon.go @@ -13,9 +13,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" "google.golang.org/protobuf/types/known/emptypb" ) diff --git a/validator/rpc/handlers_health.go b/validator/rpc/handlers_health.go index 7c65ea81d268..b84ac98ce8bd 100644 --- a/validator/rpc/handlers_health.go +++ b/validator/rpc/handlers_health.go @@ -6,10 +6,10 @@ import ( "net/http" "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" "google.golang.org/protobuf/types/known/emptypb" ) diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index d45dc17ce355..39b8fd296297 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -21,13 +21,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/validator/client" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" "github.com/prysmaticlabs/prysm/v5/validator/keymanager/derived" slashingprotection "github.com/prysmaticlabs/prysm/v5/validator/slashing-protection-history" "github.com/prysmaticlabs/prysm/v5/validator/slashing-protection-history/format" - "go.opencensus.io/trace" "google.golang.org/protobuf/types/known/emptypb" ) diff --git a/validator/rpc/handlers_slashing.go b/validator/rpc/handlers_slashing.go index 595047e2f25a..97439cec9d36 100644 --- a/validator/rpc/handlers_slashing.go +++ b/validator/rpc/handlers_slashing.go @@ -7,9 +7,9 @@ import ( "net/http" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" slashing "github.com/prysmaticlabs/prysm/v5/validator/slashing-protection-history" - "go.opencensus.io/trace" ) // ExportSlashingProtection handles the rpc call returning the json slashing history. From 3015eea4e32c6dd7b5581214dd4943a7bb37036f Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:57:21 +0200 Subject: [PATCH 274/325] Fix lightclient header (#14389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * change LCUpdate to use LCHeader * fix api struct usages * fix api struct finalized_header * add lightclientheader to proto structs * fix proto usages * fix proto usages in events * fix uppercase field in protobuf defenition --------- Co-authored-by: Radosław Kapka --- api/server/structs/endpoints_lightclient.go | 4 +- beacon-chain/core/light-client/BUILD.bazel | 2 +- beacon-chain/core/light-client/lightclient.go | 31 +- .../core/light-client/lightclient_test.go | 15 +- beacon-chain/rpc/eth/events/events.go | 28 +- .../rpc/eth/light-client/handlers_test.go | 12 +- beacon-chain/rpc/eth/light-client/helpers.go | 22 +- .../rpc/eth/light-client/helpers_test.go | 162 +- proto/eth/v2/beacon_lightclient.pb.go | 478 ++-- proto/eth/v2/beacon_lightclient.proto | 16 +- proto/prysm/v1alpha1/beacon_block.pb.go | 2165 ++++++++--------- testing/util/lightclient.go | 10 +- 12 files changed, 1507 insertions(+), 1438 deletions(-) diff --git a/api/server/structs/endpoints_lightclient.go b/api/server/structs/endpoints_lightclient.go index d7380073395b..9ef4a3880a67 100644 --- a/api/server/structs/endpoints_lightclient.go +++ b/api/server/structs/endpoints_lightclient.go @@ -16,9 +16,9 @@ type LightClientBootstrap struct { } type LightClientUpdate struct { - AttestedHeader *BeaconBlockHeader `json:"attested_header"` + AttestedHeader *LightClientHeader `json:"attested_header"` NextSyncCommittee *SyncCommittee `json:"next_sync_committee,omitempty"` - FinalizedHeader *BeaconBlockHeader `json:"finalized_header,omitempty"` + FinalizedHeader *LightClientHeader `json:"finalized_header,omitempty"` SyncAggregate *SyncAggregate `json:"sync_aggregate"` NextSyncCommitteeBranch []string `json:"next_sync_committee_branch,omitempty"` FinalityBranch []string `json:"finality_branch,omitempty"` diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel index bd96ab17749d..1643fdff3184 100644 --- a/beacon-chain/core/light-client/BUILD.bazel +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -24,7 +24,7 @@ go_test( ":go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", - "//proto/eth/v1:go_default_library", + "//proto/eth/v2:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", ], diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index 009d07b43282..d0038af7b3a1 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -131,13 +131,16 @@ func NewLightClientOptimisticUpdateFromBeaconState( } // Return result - attestedHeaderResult := ðpbv1.BeaconBlockHeader{ - Slot: attestedHeader.Slot, - ProposerIndex: attestedHeader.ProposerIndex, - ParentRoot: attestedHeader.ParentRoot, - StateRoot: attestedHeader.StateRoot, - BodyRoot: attestedHeader.BodyRoot, - } + attestedHeaderResult := + ðpbv2.LightClientHeader{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: attestedHeader.Slot, + ProposerIndex: attestedHeader.ProposerIndex, + ParentRoot: attestedHeader.ParentRoot, + StateRoot: attestedHeader.StateRoot, + BodyRoot: attestedHeader.BodyRoot, + }, + } syncAggregateResult := ðpbv1.SyncAggregate{ SyncCommitteeBits: syncAggregate.SyncCommitteeBits, @@ -170,7 +173,7 @@ func NewLightClientFinalityUpdateFromBeaconState( } // Indicate finality whenever possible - var finalizedHeader *ethpbv1.BeaconBlockHeader + var finalizedHeader *ethpbv2.LightClientHeader var finalityBranch [][]byte if finalizedBlock != nil && !finalizedBlock.IsNil() { @@ -179,9 +182,9 @@ func NewLightClientFinalityUpdateFromBeaconState( if err != nil { return nil, fmt.Errorf("could not get finalized header %w", err) } - finalizedHeader = migration.V1Alpha1SignedHeaderToV1(tempFinalizedHeader).GetMessage() + finalizedHeader = ðpbv2.LightClientHeader{Beacon: migration.V1Alpha1SignedHeaderToV1(tempFinalizedHeader).GetMessage()} - finalizedHeaderRoot, err := finalizedHeader.HashTreeRoot() + finalizedHeaderRoot, err := finalizedHeader.Beacon.HashTreeRoot() if err != nil { return nil, fmt.Errorf("could not get finalized header root %w", err) } @@ -194,13 +197,13 @@ func NewLightClientFinalityUpdateFromBeaconState( return nil, fmt.Errorf("invalid finalized header root %v", attestedState.FinalizedCheckpoint().Root) } - finalizedHeader = ðpbv1.BeaconBlockHeader{ + finalizedHeader = ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 0, ProposerIndex: 0, ParentRoot: make([]byte, 32), StateRoot: make([]byte, 32), BodyRoot: make([]byte, 32), - } + }} } var bErr error @@ -209,13 +212,13 @@ func NewLightClientFinalityUpdateFromBeaconState( return nil, fmt.Errorf("could not get finalized root proof %w", bErr) } } else { - finalizedHeader = ðpbv1.BeaconBlockHeader{ + finalizedHeader = ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 0, ProposerIndex: 0, ParentRoot: make([]byte, 32), StateRoot: make([]byte, 32), BodyRoot: make([]byte, 32), - } + }} finalityBranch = make([][]byte, FinalityBranchNumOfLeaves) for i := 0; i < FinalityBranchNumOfLeaves; i++ { diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index 729a51416a80..568075c2db76 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -6,10 +6,9 @@ import ( lightClient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" - - v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ) func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) { @@ -24,7 +23,7 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) l.CheckSyncAggregate(update) l.CheckAttestedHeader(update) - require.Equal(t, (*v1.BeaconBlockHeader)(nil), update.FinalizedHeader, "Finalized header is not nil") + require.Equal(t, (*v2.LightClientHeader)(nil), update.FinalizedHeader, "Finalized header is not nil") require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") } @@ -42,11 +41,11 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { zeroHash := params.BeaconConfig().ZeroHash[:] require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - require.Equal(t, primitives.Slot(0), update.FinalizedHeader.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), update.FinalizedHeader.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.BodyRoot, "Finalized header body root is not zero") + require.Equal(t, primitives.Slot(0), update.FinalizedHeader.Beacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), update.FinalizedHeader.Beacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.Beacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.Beacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.Beacon.BodyRoot, "Finalized header body root is not zero") require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") for _, leaf := range update.FinalityBranch { require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 93187e31a5e4..b39d99165d40 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -310,17 +310,17 @@ func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, f Version: version.String(int(updateData.Version)), Data: &structs.LightClientFinalityUpdate{ AttestedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Slot), - ProposerIndex: fmt.Sprintf("%d", updateData.Data.AttestedHeader.ProposerIndex), - ParentRoot: hexutil.Encode(updateData.Data.AttestedHeader.ParentRoot), - StateRoot: hexutil.Encode(updateData.Data.AttestedHeader.StateRoot), - BodyRoot: hexutil.Encode(updateData.Data.AttestedHeader.BodyRoot), + Slot: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.Slot), + ProposerIndex: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.ProposerIndex), + ParentRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.ParentRoot), + StateRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.StateRoot), + BodyRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.BodyRoot), }, FinalizedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", updateData.Data.FinalizedHeader.Slot), - ProposerIndex: fmt.Sprintf("%d", updateData.Data.FinalizedHeader.ProposerIndex), - ParentRoot: hexutil.Encode(updateData.Data.FinalizedHeader.ParentRoot), - StateRoot: hexutil.Encode(updateData.Data.FinalizedHeader.StateRoot), + Slot: fmt.Sprintf("%d", updateData.Data.FinalizedHeader.Beacon.Slot), + ProposerIndex: fmt.Sprintf("%d", updateData.Data.FinalizedHeader.Beacon.ProposerIndex), + ParentRoot: hexutil.Encode(updateData.Data.FinalizedHeader.Beacon.ParentRoot), + StateRoot: hexutil.Encode(updateData.Data.FinalizedHeader.Beacon.StateRoot), }, FinalityBranch: finalityBranch, SyncAggregate: &structs.SyncAggregate{ @@ -343,11 +343,11 @@ func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, f Version: version.String(int(updateData.Version)), Data: &structs.LightClientOptimisticUpdate{ AttestedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Slot), - ProposerIndex: fmt.Sprintf("%d", updateData.Data.AttestedHeader.ProposerIndex), - ParentRoot: hexutil.Encode(updateData.Data.AttestedHeader.ParentRoot), - StateRoot: hexutil.Encode(updateData.Data.AttestedHeader.StateRoot), - BodyRoot: hexutil.Encode(updateData.Data.AttestedHeader.BodyRoot), + Slot: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.Slot), + ProposerIndex: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.ProposerIndex), + ParentRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.ParentRoot), + StateRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.StateRoot), + BodyRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.BodyRoot), }, SyncAggregate: &structs.SyncAggregate{ SyncCommitteeBits: hexutil.Encode(updateData.Data.SyncAggregate.SyncCommitteeBits), diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index 59e34923948d..8855aad8c57e 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -175,7 +175,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange(t *testing.T) { require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) require.Equal(t, 1, len(resp)) require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) require.NotNil(t, resp) } @@ -278,7 +278,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCount(t *tes require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) require.Equal(t, 1, len(resp)) // Even with big count input, the response is still the max available period, which is 1 in test case. require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) require.NotNil(t, resp) } @@ -381,7 +381,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriod(t *testi require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) require.Equal(t, 1, len(resp)) require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) require.NotNil(t, resp) } @@ -484,7 +484,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigCount(t *testing. require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) require.Equal(t, 1, len(resp)) require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) require.NotNil(t, resp) } @@ -687,7 +687,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { resp := &structs.LightClientUpdateWithVersion{} require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp.Data.AttestedHeader.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp.Data.AttestedHeader.Beacon.BodyRoot) require.NotNil(t, resp.Data) } @@ -793,7 +793,7 @@ func TestLightClientHandler_GetLightClientOptimisticUpdate(t *testing.T) { resp := &structs.LightClientUpdateWithVersion{} require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp.Data.AttestedHeader.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp.Data.AttestedHeader.Beacon.BodyRoot) require.NotNil(t, resp.Data) } diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index e5c8a94966dc..91fa9c62612c 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -169,7 +169,7 @@ func createLightClientUpdate( updateSignaturePeriod := slots.ToEpoch(block.Block().Slot()) // update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) - updateAttestedPeriod := slots.ToEpoch(result.AttestedHeader.Slot) + updateAttestedPeriod := slots.ToEpoch(result.AttestedHeader.Beacon.Slot) if updateAttestedPeriod == updateSignaturePeriod { tempNextSyncCommittee, err := attestedState.NextSyncCommittee() @@ -244,7 +244,7 @@ func NewLightClientBootstrapFromJSON(bootstrapJSON *structs.LightClientBootstrap if err != nil { return nil, err } - bootstrap.Header = migration.V1Alpha1HeaderToV1(v1Alpha1Header) + bootstrap.Header = &v2.LightClientHeader{Beacon: migration.V1Alpha1HeaderToV1(v1Alpha1Header)} currentSyncCommittee, err := bootstrapJSON.CurrentSyncCommittee.ToConsensus() if err != nil { @@ -303,14 +303,14 @@ func newLightClientUpdateToJSON(input *v2.LightClientUpdate) *structs.LightClien var finalizedHeader *structs.BeaconBlockHeader if input.FinalizedHeader != nil { - finalizedHeader = structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(input.FinalizedHeader)) + finalizedHeader = structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(input.FinalizedHeader.Beacon)) } return &structs.LightClientUpdate{ - AttestedHeader: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(input.AttestedHeader)), + AttestedHeader: &structs.LightClientHeader{Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(input.AttestedHeader.Beacon))}, NextSyncCommittee: nextSyncCommittee, NextSyncCommitteeBranch: branchToJSON(input.NextSyncCommitteeBranch), - FinalizedHeader: finalizedHeader, + FinalizedHeader: &structs.LightClientHeader{Beacon: finalizedHeader}, FinalityBranch: branchToJSON(input.FinalityBranch), SyncAggregate: syncAggregateToJSON(input.SyncAggregate), SignatureSlot: strconv.FormatUint(uint64(input.SignatureSlot), 10), @@ -342,8 +342,8 @@ func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) bool { } // Compare presence of relevant sync committee - newHasRelevantSyncCommittee := IsSyncCommitteeUpdate(newUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.SignatureSlot))) - oldHasRelevantSyncCommittee := IsSyncCommitteeUpdate(oldUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.SignatureSlot))) + newHasRelevantSyncCommittee := IsSyncCommitteeUpdate(newUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.SignatureSlot))) + oldHasRelevantSyncCommittee := IsSyncCommitteeUpdate(oldUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.SignatureSlot))) if newHasRelevantSyncCommittee != oldHasRelevantSyncCommittee { return newHasRelevantSyncCommittee @@ -358,8 +358,8 @@ func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) bool { // Compare sync committee finality if newHasFinality { - newHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.FinalizedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Slot)) - oldHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.FinalizedHeader.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Slot)) + newHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.FinalizedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Beacon.Slot)) + oldHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.FinalizedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Beacon.Slot)) if newHasSyncCommitteeFinality != oldHasSyncCommitteeFinality { return newHasSyncCommitteeFinality @@ -372,8 +372,8 @@ func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) bool { } // Tiebreaker 2: Prefer older data (fewer changes to best) - if newUpdate.AttestedHeader.Slot != oldUpdate.AttestedHeader.Slot { - return newUpdate.AttestedHeader.Slot < oldUpdate.AttestedHeader.Slot + if newUpdate.AttestedHeader.Beacon.Slot != oldUpdate.AttestedHeader.Beacon.Slot { + return newUpdate.AttestedHeader.Beacon.Slot < oldUpdate.AttestedHeader.Beacon.Slot } return newUpdate.SignatureSlot < oldUpdate.SignatureSlot } diff --git a/beacon-chain/rpc/eth/light-client/helpers_test.go b/beacon-chain/rpc/eth/light-client/helpers_test.go index f93a49e25f5a..f693f9b88be3 100644 --- a/beacon-chain/rpc/eth/light-client/helpers_test.go +++ b/beacon-chain/rpc/eth/light-client/helpers_test.go @@ -94,9 +94,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), SignatureSlot: 9999, }, @@ -104,9 +104,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000001, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 1000000, }, @@ -118,9 +118,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000001, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 1000000, }, @@ -128,9 +128,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), SignatureSlot: 9999, }, @@ -142,9 +142,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: make([][]byte, lightclient.FinalityBranchNumOfLeaves), @@ -153,9 +153,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), @@ -168,9 +168,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), @@ -179,9 +179,9 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: make([][]byte, lightclient.FinalityBranchNumOfLeaves), @@ -194,29 +194,29 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 999999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 999999, - }, + }}, }, expectedResult: true, }, @@ -226,29 +226,29 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 999999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 999999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: false, }, @@ -258,29 +258,29 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,1,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: true, }, @@ -290,29 +290,29 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,1,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: false, }, @@ -322,29 +322,29 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 999999, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: true, }, @@ -354,61 +354,61 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 999999, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: false, }, { - name: "none of the above conditions are met and new signature's slot is lesser than old signature's slot", + name: "none of the above conditions are met and new signature's slot is less than old signature's slot", oldUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9998, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: true, }, @@ -418,29 +418,29 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9998, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv1.BeaconBlockHeader{ + AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 1000000, - }, + }}, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv1.BeaconBlockHeader{ + FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ Slot: 9999, - }, + }}, }, expectedResult: false, }, diff --git a/proto/eth/v2/beacon_lightclient.pb.go b/proto/eth/v2/beacon_lightclient.pb.go index 33daa3abaa9d..c5020da60529 100755 --- a/proto/eth/v2/beacon_lightclient.pb.go +++ b/proto/eth/v2/beacon_lightclient.pb.go @@ -24,20 +24,67 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type LightClientHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beacon *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"` +} + +func (x *LightClientHeader) Reset() { + *x = LightClientHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeader) ProtoMessage() {} + +func (x *LightClientHeader) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeader.ProtoReflect.Descriptor instead. +func (*LightClientHeader) Descriptor() ([]byte, []int) { + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{0} +} + +func (x *LightClientHeader) GetBeacon() *v1.BeaconBlockHeader { + if x != nil { + return x.Beacon + } + return nil +} + type LightClientBootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Header *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` - CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty"` + Header *LightClientHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty"` } func (x *LightClientBootstrap) Reset() { *x = LightClientBootstrap{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[0] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -50,7 +97,7 @@ func (x *LightClientBootstrap) String() string { func (*LightClientBootstrap) ProtoMessage() {} func (x *LightClientBootstrap) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[0] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -63,10 +110,10 @@ func (x *LightClientBootstrap) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientBootstrap.ProtoReflect.Descriptor instead. func (*LightClientBootstrap) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{0} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{1} } -func (x *LightClientBootstrap) GetHeader() *v1.BeaconBlockHeader { +func (x *LightClientBootstrap) GetHeader() *LightClientHeader { if x != nil { return x.Header } @@ -92,10 +139,10 @@ type LightClientUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + AttestedHeader *LightClientHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty"` - FinalizedHeader *v1.BeaconBlockHeader `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalizedHeader *LightClientHeader `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty"` SyncAggregate *v1.SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` @@ -104,7 +151,7 @@ type LightClientUpdate struct { func (x *LightClientUpdate) Reset() { *x = LightClientUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -117,7 +164,7 @@ func (x *LightClientUpdate) String() string { func (*LightClientUpdate) ProtoMessage() {} func (x *LightClientUpdate) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -130,10 +177,10 @@ func (x *LightClientUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientUpdate.ProtoReflect.Descriptor instead. func (*LightClientUpdate) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{1} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{2} } -func (x *LightClientUpdate) GetAttestedHeader() *v1.BeaconBlockHeader { +func (x *LightClientUpdate) GetAttestedHeader() *LightClientHeader { if x != nil { return x.AttestedHeader } @@ -154,7 +201,7 @@ func (x *LightClientUpdate) GetNextSyncCommitteeBranch() [][]byte { return nil } -func (x *LightClientUpdate) GetFinalizedHeader() *v1.BeaconBlockHeader { +func (x *LightClientUpdate) GetFinalizedHeader() *LightClientHeader { if x != nil { return x.FinalizedHeader } @@ -194,7 +241,7 @@ type LightClientFinalityUpdateWithVersion struct { func (x *LightClientFinalityUpdateWithVersion) Reset() { *x = LightClientFinalityUpdateWithVersion{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -207,7 +254,7 @@ func (x *LightClientFinalityUpdateWithVersion) String() string { func (*LightClientFinalityUpdateWithVersion) ProtoMessage() {} func (x *LightClientFinalityUpdateWithVersion) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -220,7 +267,7 @@ func (x *LightClientFinalityUpdateWithVersion) ProtoReflect() protoreflect.Messa // Deprecated: Use LightClientFinalityUpdateWithVersion.ProtoReflect.Descriptor instead. func (*LightClientFinalityUpdateWithVersion) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{2} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{3} } func (x *LightClientFinalityUpdateWithVersion) GetVersion() Version { @@ -242,8 +289,8 @@ type LightClientFinalityUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` - FinalizedHeader *v1.BeaconBlockHeader `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + AttestedHeader *LightClientHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + FinalizedHeader *LightClientHeader `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty"` SyncAggregate *v1.SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` @@ -252,7 +299,7 @@ type LightClientFinalityUpdate struct { func (x *LightClientFinalityUpdate) Reset() { *x = LightClientFinalityUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -265,7 +312,7 @@ func (x *LightClientFinalityUpdate) String() string { func (*LightClientFinalityUpdate) ProtoMessage() {} func (x *LightClientFinalityUpdate) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -278,17 +325,17 @@ func (x *LightClientFinalityUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientFinalityUpdate.ProtoReflect.Descriptor instead. func (*LightClientFinalityUpdate) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{3} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{4} } -func (x *LightClientFinalityUpdate) GetAttestedHeader() *v1.BeaconBlockHeader { +func (x *LightClientFinalityUpdate) GetAttestedHeader() *LightClientHeader { if x != nil { return x.AttestedHeader } return nil } -func (x *LightClientFinalityUpdate) GetFinalizedHeader() *v1.BeaconBlockHeader { +func (x *LightClientFinalityUpdate) GetFinalizedHeader() *LightClientHeader { if x != nil { return x.FinalizedHeader } @@ -328,7 +375,7 @@ type LightClientOptimisticUpdateWithVersion struct { func (x *LightClientOptimisticUpdateWithVersion) Reset() { *x = LightClientOptimisticUpdateWithVersion{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -341,7 +388,7 @@ func (x *LightClientOptimisticUpdateWithVersion) String() string { func (*LightClientOptimisticUpdateWithVersion) ProtoMessage() {} func (x *LightClientOptimisticUpdateWithVersion) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -354,7 +401,7 @@ func (x *LightClientOptimisticUpdateWithVersion) ProtoReflect() protoreflect.Mes // Deprecated: Use LightClientOptimisticUpdateWithVersion.ProtoReflect.Descriptor instead. func (*LightClientOptimisticUpdateWithVersion) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{4} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{5} } func (x *LightClientOptimisticUpdateWithVersion) GetVersion() Version { @@ -376,7 +423,7 @@ type LightClientOptimisticUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + AttestedHeader *LightClientHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` SyncAggregate *v1.SyncAggregate `protobuf:"bytes,2,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` } @@ -384,7 +431,7 @@ type LightClientOptimisticUpdate struct { func (x *LightClientOptimisticUpdate) Reset() { *x = LightClientOptimisticUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -397,7 +444,7 @@ func (x *LightClientOptimisticUpdate) String() string { func (*LightClientOptimisticUpdate) ProtoMessage() {} func (x *LightClientOptimisticUpdate) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -410,10 +457,10 @@ func (x *LightClientOptimisticUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientOptimisticUpdate.ProtoReflect.Descriptor instead. func (*LightClientOptimisticUpdate) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{5} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{6} } -func (x *LightClientOptimisticUpdate) GetAttestedHeader() *v1.BeaconBlockHeader { +func (x *LightClientOptimisticUpdate) GetAttestedHeader() *LightClientHeader { if x != nil { return x.AttestedHeader } @@ -446,7 +493,7 @@ type LightClientUpdateWithVersion struct { func (x *LightClientUpdateWithVersion) Reset() { *x = LightClientUpdateWithVersion{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -459,7 +506,7 @@ func (x *LightClientUpdateWithVersion) String() string { func (*LightClientUpdateWithVersion) ProtoMessage() {} func (x *LightClientUpdateWithVersion) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -472,7 +519,7 @@ func (x *LightClientUpdateWithVersion) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientUpdateWithVersion.ProtoReflect.Descriptor instead. func (*LightClientUpdateWithVersion) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{6} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{7} } func (x *LightClientUpdateWithVersion) GetVersion() Version { @@ -503,137 +550,142 @@ var file_proto_eth_v2_beacon_lightclient_proto_rawDesc = []byte{ 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xeb, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3a, - 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x16, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x12, 0x41, 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x22, 0x9a, 0x04, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x17, 0x6e, 0x65, 0x78, 0x74, - 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x66, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, - 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, - 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, - 0x22, 0x9a, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, - 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, 0x03, - 0x0a, 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9f, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x67, 0x68, 0x74, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x62, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x22, 0xeb, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x67, 0x68, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, + 0x3a, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, - 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x67, - 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x12, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x16, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x12, 0x41, 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x22, 0x9a, 0x04, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x17, 0x6e, 0x65, 0x78, + 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x45, 0x0a, 0x0e, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, + 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, + 0x03, 0x0a, 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x67, 0x68, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9f, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x67, 0x68, + 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, + 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x1c, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x12, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -648,43 +700,45 @@ func file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP() []byte { return file_proto_eth_v2_beacon_lightclient_proto_rawDescData } -var file_proto_eth_v2_beacon_lightclient_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_proto_eth_v2_beacon_lightclient_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_proto_eth_v2_beacon_lightclient_proto_goTypes = []interface{}{ - (*LightClientBootstrap)(nil), // 0: ethereum.eth.v2.LightClientBootstrap - (*LightClientUpdate)(nil), // 1: ethereum.eth.v2.LightClientUpdate - (*LightClientFinalityUpdateWithVersion)(nil), // 2: ethereum.eth.v2.LightClientFinalityUpdateWithVersion - (*LightClientFinalityUpdate)(nil), // 3: ethereum.eth.v2.LightClientFinalityUpdate - (*LightClientOptimisticUpdateWithVersion)(nil), // 4: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion - (*LightClientOptimisticUpdate)(nil), // 5: ethereum.eth.v2.LightClientOptimisticUpdate - (*LightClientUpdateWithVersion)(nil), // 6: ethereum.eth.v2.LightClientUpdateWithVersion - (*v1.BeaconBlockHeader)(nil), // 7: ethereum.eth.v1.BeaconBlockHeader - (*SyncCommittee)(nil), // 8: ethereum.eth.v2.SyncCommittee - (*v1.SyncAggregate)(nil), // 9: ethereum.eth.v1.SyncAggregate - (Version)(0), // 10: ethereum.eth.v2.Version + (*LightClientHeader)(nil), // 0: ethereum.eth.v2.LightClientHeader + (*LightClientBootstrap)(nil), // 1: ethereum.eth.v2.LightClientBootstrap + (*LightClientUpdate)(nil), // 2: ethereum.eth.v2.LightClientUpdate + (*LightClientFinalityUpdateWithVersion)(nil), // 3: ethereum.eth.v2.LightClientFinalityUpdateWithVersion + (*LightClientFinalityUpdate)(nil), // 4: ethereum.eth.v2.LightClientFinalityUpdate + (*LightClientOptimisticUpdateWithVersion)(nil), // 5: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion + (*LightClientOptimisticUpdate)(nil), // 6: ethereum.eth.v2.LightClientOptimisticUpdate + (*LightClientUpdateWithVersion)(nil), // 7: ethereum.eth.v2.LightClientUpdateWithVersion + (*v1.BeaconBlockHeader)(nil), // 8: ethereum.eth.v1.BeaconBlockHeader + (*SyncCommittee)(nil), // 9: ethereum.eth.v2.SyncCommittee + (*v1.SyncAggregate)(nil), // 10: ethereum.eth.v1.SyncAggregate + (Version)(0), // 11: ethereum.eth.v2.Version } var file_proto_eth_v2_beacon_lightclient_proto_depIdxs = []int32{ - 7, // 0: ethereum.eth.v2.LightClientBootstrap.header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 8, // 1: ethereum.eth.v2.LightClientBootstrap.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 7, // 2: ethereum.eth.v2.LightClientUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 8, // 3: ethereum.eth.v2.LightClientUpdate.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 7, // 4: ethereum.eth.v2.LightClientUpdate.finalized_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 9, // 5: ethereum.eth.v2.LightClientUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 10, // 6: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version - 3, // 7: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientFinalityUpdate - 7, // 8: ethereum.eth.v2.LightClientFinalityUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 7, // 9: ethereum.eth.v2.LightClientFinalityUpdate.finalized_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 9, // 10: ethereum.eth.v2.LightClientFinalityUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 10, // 11: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version - 5, // 12: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientOptimisticUpdate - 7, // 13: ethereum.eth.v2.LightClientOptimisticUpdate.attested_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 9, // 14: ethereum.eth.v2.LightClientOptimisticUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 10, // 15: ethereum.eth.v2.LightClientUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version - 1, // 16: ethereum.eth.v2.LightClientUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientUpdate - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 8, // 0: ethereum.eth.v2.LightClientHeader.beacon:type_name -> ethereum.eth.v1.BeaconBlockHeader + 0, // 1: ethereum.eth.v2.LightClientBootstrap.header:type_name -> ethereum.eth.v2.LightClientHeader + 9, // 2: ethereum.eth.v2.LightClientBootstrap.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 0, // 3: ethereum.eth.v2.LightClientUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeader + 9, // 4: ethereum.eth.v2.LightClientUpdate.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 0, // 5: ethereum.eth.v2.LightClientUpdate.finalized_header:type_name -> ethereum.eth.v2.LightClientHeader + 10, // 6: ethereum.eth.v2.LightClientUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 11, // 7: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 4, // 8: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientFinalityUpdate + 0, // 9: ethereum.eth.v2.LightClientFinalityUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeader + 0, // 10: ethereum.eth.v2.LightClientFinalityUpdate.finalized_header:type_name -> ethereum.eth.v2.LightClientHeader + 10, // 11: ethereum.eth.v2.LightClientFinalityUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 11, // 12: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 6, // 13: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientOptimisticUpdate + 0, // 14: ethereum.eth.v2.LightClientOptimisticUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeader + 10, // 15: ethereum.eth.v2.LightClientOptimisticUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 11, // 16: ethereum.eth.v2.LightClientUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 2, // 17: ethereum.eth.v2.LightClientUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientUpdate + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_proto_eth_v2_beacon_lightclient_proto_init() } @@ -696,7 +750,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { file_proto_eth_v2_sync_committee_proto_init() if !protoimpl.UnsafeEnabled { file_proto_eth_v2_beacon_lightclient_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientBootstrap); i { + switch v := v.(*LightClientHeader); i { case 0: return &v.state case 1: @@ -708,7 +762,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientUpdate); i { + switch v := v.(*LightClientBootstrap); i { case 0: return &v.state case 1: @@ -720,7 +774,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientFinalityUpdateWithVersion); i { + switch v := v.(*LightClientUpdate); i { case 0: return &v.state case 1: @@ -732,7 +786,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientFinalityUpdate); i { + switch v := v.(*LightClientFinalityUpdateWithVersion); i { case 0: return &v.state case 1: @@ -744,7 +798,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientOptimisticUpdateWithVersion); i { + switch v := v.(*LightClientFinalityUpdate); i { case 0: return &v.state case 1: @@ -756,7 +810,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientOptimisticUpdate); i { + switch v := v.(*LightClientOptimisticUpdateWithVersion); i { case 0: return &v.state case 1: @@ -768,6 +822,18 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientOptimisticUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LightClientUpdateWithVersion); i { case 0: return &v.state @@ -786,7 +852,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v2_beacon_lightclient_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/eth/v2/beacon_lightclient.proto b/proto/eth/v2/beacon_lightclient.proto index c967e61883bd..6a3933daf99a 100644 --- a/proto/eth/v2/beacon_lightclient.proto +++ b/proto/eth/v2/beacon_lightclient.proto @@ -29,17 +29,21 @@ option php_namespace = "Ethereum\\Eth\\v2"; // Beacon LightClient API related messages. +message LightClientHeader { + v1.BeaconBlockHeader beacon = 1; +} + message LightClientBootstrap { - v1.BeaconBlockHeader header = 1; + LightClientHeader header = 1; SyncCommittee current_sync_committee = 2; repeated bytes current_sync_committee_branch = 3; } message LightClientUpdate { - v1.BeaconBlockHeader attested_header = 1; + LightClientHeader attested_header = 1; SyncCommittee next_sync_committee = 2; repeated bytes next_sync_committee_branch = 3; - v1.BeaconBlockHeader finalized_header = 4; + LightClientHeader finalized_header = 4; repeated bytes finality_branch = 5; v1.SyncAggregate sync_aggregate = 6; uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; @@ -51,8 +55,8 @@ message LightClientFinalityUpdateWithVersion { } message LightClientFinalityUpdate { - v1.BeaconBlockHeader attested_header = 1; - v1.BeaconBlockHeader finalized_header = 2; + LightClientHeader attested_header = 1; + LightClientHeader finalized_header = 2; repeated bytes finality_branch = 3; v1.SyncAggregate sync_aggregate = 4; uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; @@ -64,7 +68,7 @@ message LightClientOptimisticUpdateWithVersion { } message LightClientOptimisticUpdate { - v1.BeaconBlockHeader attested_header = 1; + LightClientHeader attested_header = 1; v1.SyncAggregate sync_aggregate = 2; uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; } diff --git a/proto/prysm/v1alpha1/beacon_block.pb.go b/proto/prysm/v1alpha1/beacon_block.pb.go index 7db66168e299..15c3774b84a4 100755 --- a/proto/prysm/v1alpha1/beacon_block.pb.go +++ b/proto/prysm/v1alpha1/beacon_block.pb.go @@ -4737,448 +4737,223 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x69, 0x70, 0x5f, - 0x37, 0x32, 0x35, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x07, 0x0a, 0x18, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, - 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x48, 0x0a, 0x06, 0x61, - 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, - 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x51, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, - 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x67, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, - 0x10, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x12, 0x4b, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x07, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x61, - 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, - 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x12, 0x4d, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x5b, 0x0a, 0x0d, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, - 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, - 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x53, 0x0a, - 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, + 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, + 0x12, 0x51, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, + 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, + 0x72, 0x69, 0x78, 0x12, 0x67, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, + 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x04, 0x08, - 0x65, 0x10, 0x66, 0x22, 0x83, 0x07, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x68, - 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, - 0x52, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, - 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, - 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x4b, 0x0a, 0x09, - 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, - 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x61, 0x0a, 0x11, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x45, 0x0a, 0x07, - 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x4b, 0x0a, 0x07, + 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x12, 0x5b, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, - 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x12, 0x47, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x55, 0x0a, 0x0d, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x4d, 0x0a, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, - 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, - 0x5b, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x4d, 0x0a, 0x05, + 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x5b, 0x0a, 0x0d, 0x62, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x53, 0x0a, 0x07, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x61, 0x0a, + 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, + 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x04, 0x08, 0x65, 0x10, 0x66, 0x22, 0x83, + 0x07, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, 0x68, 0x61, + 0x73, 0x65, 0x30, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, + 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x4b, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, + 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, + 0x74, 0x72, 0x69, 0x78, 0x12, 0x61, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, + 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, + 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x65, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xec, 0x02, 0x0a, 0x0b, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, + 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x5b, + 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x64, + 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, + 0x65, 0x6e, 0x65, 0x62, 0x12, 0x55, 0x0a, 0x0d, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, + 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x4d, 0x0a, 0x07, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, + 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x5b, 0x0a, 0x0f, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xec, 0x02, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, + 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, - 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x22, 0x73, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x38, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x11, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x59, + 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, + 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x73, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x38, 0x0a, - 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf8, 0x02, - 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, - 0x61, 0x69, 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, + 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, - 0x69, 0x72, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x7f, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, - 0x61, 0x69, 0x72, 0x12, 0x3e, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xd1, 0x04, 0x0a, 0x0f, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, - 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, - 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x22, 0x7f, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x3e, + 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, - 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, - 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, - 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, - 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, - 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, - 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x22, 0xa4, 0x05, - 0x0a, 0x15, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, - 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, - 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, - 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, - 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x22, 0xa8, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x5f, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x31, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x32, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x22, - 0xb2, 0x01, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x12, 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x31, 0x12, 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x32, 0x22, 0xc7, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0x9a, - 0x02, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x33, - 0x33, 0x2c, 0x33, 0x32, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb4, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, - 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, - 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x0d, - 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, - 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x78, 0x0a, 0x0f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x75, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x04, - 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, - 0x52, 0x04, 0x65, 0x78, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, - 0x08, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, - 0x22, 0xdb, 0x02, 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, - 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, - 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x62, 0x6f, 0x64, - 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x81, - 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x11, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x10, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, - 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x19, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x12, 0x37, 0x0a, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x0a, 0x92, 0xb5, 0x18, - 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0d, - 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, - 0x13, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, - 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, - 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, 0x52, 0x11, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x18, 0x73, 0x79, - 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x39, 0x36, 0x52, 0x16, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x85, 0x01, 0x0a, - 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, - 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, - 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, - 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, - 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xfa, 0x05, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, - 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, + 0x74, 0x75, 0x72, 0x65, 0x22, 0xd1, 0x04, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, + 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, + 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, + 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, + 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, + 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x22, 0xa4, 0x05, 0x0a, 0x15, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, @@ -5218,23 +4993,164 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, - 0x51, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x21, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x48, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x1b, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, + 0xa8, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x31, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x31, 0x12, + 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x22, 0xb2, 0x01, 0x0a, 0x10, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, + 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, + 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, + 0xc7, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x55, 0x0a, 0x0d, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x31, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0x9a, 0x02, 0x0a, 0x07, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x33, 0x33, 0x2c, 0x33, 0x32, 0x52, + 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, + 0xb4, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, + 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x0d, 0x56, 0x6f, 0x6c, 0x75, 0x6e, + 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x22, 0x75, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, + 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x65, 0x78, 0x69, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x52, 0x04, 0x65, 0x78, 0x69, + 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x45, 0x74, 0x68, 0x31, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xdb, 0x02, 0x0a, 0x11, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x08, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xad, 0x01, + 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, + 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xb6, 0x01, + 0x0a, 0x19, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x37, 0x0a, 0x11, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, + 0x37, 0x32, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0d, 0x53, 0x79, 0x6e, 0x63, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, + 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, + 0x36, 0x34, 0x52, 0x11, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x18, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x16, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, + 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0xfe, 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, @@ -5253,118 +5169,13 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x94, 0x06, 0x0a, 0x1f, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, - 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, - 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, - 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, - 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, - 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x64, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xc2, - 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x12, 0x43, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, - 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, - 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, - 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, - 0x6f, 0x62, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, - 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, - 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, - 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x7d, 0x0a, 0x16, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf6, 0x02, 0x0a, 0x10, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x22, 0xb3, 0x07, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, + 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, + 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x22, 0xfa, 0x05, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, @@ -5405,58 +5216,49 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, - 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x65, 0x78, + 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x51, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, - 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, - 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, - 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, - 0x02, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xf3, 0x06, 0x0a, 0x16, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x10, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x93, 0x01, + 0x0a, 0x21, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, + 0x72, 0x69, 0x78, 0x12, 0x48, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, + 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, + 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x22, 0x94, 0x06, 0x0a, 0x1f, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, + 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, @@ -5497,11 +5299,115 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, + 0x61, 0x74, 0x65, 0x12, 0x64, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x1e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x43, 0x0a, 0x05, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, + 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, + 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xb6, + 0x01, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, + 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, + 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, + 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x7d, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf6, 0x02, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, + 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, + 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3f, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, + 0xb3, 0x07, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, + 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, + 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, + 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, + 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, + 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, @@ -5510,108 +5416,109 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, - 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x46, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, - 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8d, - 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, + 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, + 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, - 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, - 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, - 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, - 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, - 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, - 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, - 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, + 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xf3, 0x06, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, + 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, + 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, + 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, - 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, - 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, - 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, - 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, - 0x6c, 0x61, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, - 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, - 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0x84, 0x03, 0x0a, 0x17, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, + 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, + 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, + 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, + 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x58, + 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, + 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, + 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x12, 0x46, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, + 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, @@ -5630,404 +5537,495 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x46, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xcd, 0x07, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, - 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, - 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8d, 0x07, 0x0a, 0x1d, 0x42, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, + 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, + 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, + 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, + 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, + 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, + 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x16, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, + 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x48, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x84, 0x03, 0x0a, 0x17, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, - 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x12, 0x69, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, - 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, - 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x20, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x45, 0x0a, 0x05, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, - 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, - 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x22, 0xba, 0x01, 0x0a, 0x1a, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, - 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x22, 0xcd, 0x07, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, + 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, + 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, + 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, + 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, + 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, - 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, - 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x81, 0x01, - 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, + 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, + 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, + 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, + 0x69, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, + 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, + 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, + 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, + 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x45, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, + 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, + 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, + 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, + 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, + 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x1a, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, - 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, + 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, + 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, + 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, + 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, + 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, + 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, + 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, - 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, - 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xc3, - 0x07, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, - 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xc3, 0x07, 0x0a, 0x16, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, + 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, + 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, + 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, + 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, + 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, + 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, + 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, + 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x58, 0x0a, + 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, + 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, - 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, - 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, - 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, - 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, - 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, - 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, + 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, + 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, + 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x22, 0xdd, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, + 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, + 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, + 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, + 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, + 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, 0x52, + 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, + 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, + 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, + 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, + 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, + 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, - 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, - 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, - 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, - 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, + 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, + 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, + 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, + 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, + 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, + 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, + 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, - 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xdd, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, - 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, - 0xb5, 0x18, 0x01, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, - 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, - 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, - 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x12, 0x6b, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, - 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, - 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, - 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, - 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, - 0x31, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, - 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, - 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, - 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x56, 0x31, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, - 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, - 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0x8e, 0x01, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, - 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x22, 0x75, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x42, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, - 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, + 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, + 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, + 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, - 0x6c, 0x61, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, - 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, - 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, - 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, - 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, - 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, - 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, - 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, - 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, - 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, - 0x31, 0x37, 0x2c, 0x33, 0x32, 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, - 0x55, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, - 0x45, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, - 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, - 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, + 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, + 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, + 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, + 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, + 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, + 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, + 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, + 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, + 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, + 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, + 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, + 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, + 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, + 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, + 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6280,7 +6278,6 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { } file_proto_prysm_v1alpha1_attestation_proto_init() file_proto_prysm_v1alpha1_withdrawals_proto_init() - file_proto_prysm_v1alpha1_eip_7251_proto_init() if !protoimpl.UnsafeEnabled { file_proto_prysm_v1alpha1_beacon_block_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenericSignedBeaconBlock); i { diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index 5c6ac635678a..37cd8f26ffd1 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -99,14 +99,14 @@ func (l *TestLightClient) SetupTest() *TestLightClient { } func (l *TestLightClient) CheckAttestedHeader(update *ethpbv2.LightClientUpdate) { - require.Equal(l.T, l.AttestedHeader.Slot, update.AttestedHeader.Slot, "Attested header slot is not equal") - require.Equal(l.T, l.AttestedHeader.ProposerIndex, update.AttestedHeader.ProposerIndex, "Attested header proposer index is not equal") - require.DeepSSZEqual(l.T, l.AttestedHeader.ParentRoot, update.AttestedHeader.ParentRoot, "Attested header parent root is not equal") - require.DeepSSZEqual(l.T, l.AttestedHeader.BodyRoot, update.AttestedHeader.BodyRoot, "Attested header body root is not equal") + require.Equal(l.T, l.AttestedHeader.Slot, update.AttestedHeader.Beacon.Slot, "Attested header slot is not equal") + require.Equal(l.T, l.AttestedHeader.ProposerIndex, update.AttestedHeader.Beacon.ProposerIndex, "Attested header proposer index is not equal") + require.DeepSSZEqual(l.T, l.AttestedHeader.ParentRoot, update.AttestedHeader.Beacon.ParentRoot, "Attested header parent root is not equal") + require.DeepSSZEqual(l.T, l.AttestedHeader.BodyRoot, update.AttestedHeader.Beacon.BodyRoot, "Attested header body root is not equal") attestedStateRoot, err := l.AttestedState.HashTreeRoot(l.Ctx) require.NoError(l.T, err) - require.DeepSSZEqual(l.T, attestedStateRoot[:], update.AttestedHeader.StateRoot, "Attested header state root is not equal") + require.DeepSSZEqual(l.T, attestedStateRoot[:], update.AttestedHeader.Beacon.StateRoot, "Attested header state root is not equal") } func (l *TestLightClient) CheckSyncAggregate(update *ethpbv2.LightClientUpdate) { From 93e6bd7929d02409391935735252253b4c24d5a3 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 29 Aug 2024 15:42:32 -0500 Subject: [PATCH 275/325] Flip --enable-experimental-state to opt-out. (#14398) --- CHANGELOG.md | 1 + config/features/config.go | 7 ++++--- config/features/deprecated_flags.go | 6 ++++++ config/features/flags.go | 9 ++++----- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 939bfbd523e1..4840fa3ededa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve ### Deprecated +- `--enable-experimental-state` flag is deprecated. This feature is now on by default. Opt-out with `--disable-experimental-state`. ### Removed diff --git a/config/features/config.go b/config/features/config.go index e570274a352c..d342b499dd22 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -172,9 +172,10 @@ func ConfigureBeaconChain(ctx *cli.Context) error { return err } - if ctx.Bool(enableExperimentalState.Name) { - logEnabled(enableExperimentalState) - cfg.EnableExperimentalState = true + cfg.EnableExperimentalState = true + if ctx.Bool(disableExperimentalState.Name) { + logEnabled(disableExperimentalState) + cfg.EnableExperimentalState = false } if ctx.Bool(writeSSZStateTransitionsFlag.Name) { diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index ce04f877cff3..317698d1fad4 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -57,6 +57,11 @@ var ( Usage: deprecatedUsage, Hidden: true, } + deprecatedEnableExperimentalState = &cli.BoolFlag{ + Name: "enable-experimental-state", + Usage: deprecatedUsage, + Hidden: true, + } ) // Deprecated flags for both the beacon node and validator client. @@ -71,6 +76,7 @@ var deprecatedFlags = []cli.Flag{ deprecatedDisableEIP4881, deprecatedVerboseSigVerification, deprecatedEnableDebugRPCEndpoints, + deprecatedEnableExperimentalState, } // deprecatedBeaconFlags contains flags that are still used by other components diff --git a/config/features/flags.go b/config/features/flags.go index b53f08522923..361bb66e02c6 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -28,9 +28,9 @@ var ( Name: "dev", Usage: "Enables experimental features still in development. These features may not be stable.", } - enableExperimentalState = &cli.BoolFlag{ - Name: "enable-experimental-state", - Usage: "Turns on the latest and greatest (but potentially unstable) changes to the beacon state.", + disableExperimentalState = &cli.BoolFlag{ + Name: "disable-experimental-state", + Usage: "Turns off the latest and greatest changes to the beacon state. Disabling this is safe to do after the feature has been enabled.", } writeSSZStateTransitionsFlag = &cli.BoolFlag{ Name: "interop-write-ssz-state-transitions", @@ -174,7 +174,6 @@ var ( // devModeFlags holds list of flags that are set when development mode is on. var devModeFlags = []cli.Flag{ - enableExperimentalState, backfill.EnableExperimentalBackfill, EnableQUIC, } @@ -201,7 +200,7 @@ var E2EValidatorFlags = []string{ // BeaconChainFlags contains a list of all the feature flags that apply to the beacon-chain client. var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []cli.Flag{ devModeFlag, - enableExperimentalState, + disableExperimentalState, writeSSZStateTransitionsFlag, saveInvalidBlockTempFlag, saveInvalidBlobTempFlag, From 342bb0fcefa8cbd3a40631e68e6582be69d86ac7 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Fri, 30 Aug 2024 23:08:50 +0800 Subject: [PATCH 276/325] Add value for MaxBuilderEpochMissedSlots (#14334) * add value for MaxBuilderEpochMissedSlots * make usage for MaxBuilderEpochMisedSlots more friendly --------- Co-authored-by: Preston Van Loon Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- cmd/beacon-chain/flags/base.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 731aac2e5c20..b849acba73c5 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -21,8 +21,9 @@ var ( Value: 3, } MaxBuilderEpochMissedSlots = &cli.IntFlag{ - Name: "max-builder-epoch-missed-slots", - Usage: "Number of total skip slot to fallback from using relay/builder to local execution engine for block construction in last epoch rolling window", + Name: "max-builder-epoch-missed-slots", + Usage: "Number of total skip slot to fallback from using relay/builder to local execution engine for block construction in last epoch rolling window. " + + "The values are on the basis of the networks and the default value for mainnet is 5.", } // LocalBlockValueBoost sets a percentage boost for local block construction while using a custom builder. LocalBlockValueBoost = &cli.Uint64Flag{ From 77c845043ddffe6e1631f179e75c765bda33b9ed Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:14:08 +0530 Subject: [PATCH 277/325] fix: make some places use sync committee period instead of epoch (#14406) * fix: make some places use sync committee period instead of epoch * add fix details to `CHANGELOG.md` * update `CHANGELOG.md` comment --- CHANGELOG.md | 1 + beacon-chain/rpc/eth/light-client/helpers.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4840fa3ededa..26a8d1abd1c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,7 @@ In an upcoming release, we will be deprecating the gRPC gateway and renaming sev - Fix Event stream with carriage return support - Fix panic on empty block result in REST API - engine_getPayloadBodiesByRangeV1 - fix, adding hexutil encoding on request parameters +- Use sync committee period instead of epoch in `createLightClientUpdate` ### Security diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index 91fa9c62612c..c871f8b4943a 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -166,10 +166,10 @@ func createLightClientUpdate( var nextSyncCommitteeBranch [][]byte // update_signature_period = compute_sync_committee_period(compute_epoch_at_slot(block.message.slot)) - updateSignaturePeriod := slots.ToEpoch(block.Block().Slot()) + updateSignaturePeriod := slots.SyncCommitteePeriod(slots.ToEpoch(block.Block().Slot())) // update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) - updateAttestedPeriod := slots.ToEpoch(result.AttestedHeader.Beacon.Slot) + updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(result.AttestedHeader.Beacon.Slot)) if updateAttestedPeriod == updateSignaturePeriod { tempNextSyncCommittee, err := attestedState.NextSyncCommittee() From 963a1b4cb73c686b28a89ba4eff6228c203864e1 Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 3 Sep 2024 07:41:40 -0700 Subject: [PATCH 278/325] Fix electra balance update (#14410) --- CHANGELOG.md | 1 + .../core/electra/effective_balance_updates.go | 5 ++-- .../electra/effective_balance_updates_test.go | 23 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26a8d1abd1c9..f817e58be347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Electra: build blocks with blobs. - E2E: fixed gas limit at genesis - Light client support: use LightClientHeader instead of BeaconBlockHeader. +- Core: Fix process effective balance update to safe copy validator for Electra. ### Security diff --git a/beacon-chain/core/electra/effective_balance_updates.go b/beacon-chain/core/electra/effective_balance_updates.go index 60627d378ad1..bc5a73b9f11c 100644 --- a/beacon-chain/core/electra/effective_balance_updates.go +++ b/beacon-chain/core/electra/effective_balance_updates.go @@ -55,8 +55,9 @@ func ProcessEffectiveBalanceUpdates(state state.BeaconState) error { if balance+downwardThreshold < val.EffectiveBalance || val.EffectiveBalance+upwardThreshold < balance { effectiveBal := min(balance-balance%effBalanceInc, effectiveBalanceLimit) - val.EffectiveBalance = effectiveBal - return true, val, nil + newVal := ethpb.CopyValidator(val) + newVal.EffectiveBalance = effectiveBal + return true, newVal, nil } return false, val, nil } diff --git a/beacon-chain/core/electra/effective_balance_updates_test.go b/beacon-chain/core/electra/effective_balance_updates_test.go index 8d3350fb4d7d..b66de1d1156b 100644 --- a/beacon-chain/core/electra/effective_balance_updates_test.go +++ b/beacon-chain/core/electra/effective_balance_updates_test.go @@ -11,6 +11,29 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" ) +func TestProcessEffectiveBalanceUpdates_SafeCopy(t *testing.T) { + pb := ð.BeaconStateElectra{ + Validators: []*eth.Validator{ + { + EffectiveBalance: params.BeaconConfig().MinActivationBalance, + WithdrawalCredentials: []byte{params.BeaconConfig().CompoundingWithdrawalPrefixByte, 0x11}, + }, + }, + Balances: []uint64{ + params.BeaconConfig().MaxEffectiveBalanceElectra * 2, + }, + } + st, err := state_native.InitializeFromProtoElectra(pb) + require.NoError(t, err) + copiedState := st.Copy() + + err = electra.ProcessEffectiveBalanceUpdates(copiedState) + require.NoError(t, err) + + require.Equal(t, st.Validators()[0].EffectiveBalance, params.BeaconConfig().MinActivationBalance) + require.Equal(t, copiedState.Validators()[0].EffectiveBalance, params.BeaconConfig().MaxEffectiveBalanceElectra) +} + func TestProcessEffectiveBalnceUpdates(t *testing.T) { effBalanceInc := params.BeaconConfig().EffectiveBalanceIncrement hysteresisInc := effBalanceInc / params.BeaconConfig().HysteresisQuotient From 45fd3eb1bfd7827540c942807b503ee861dae31d Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:40:31 -0500 Subject: [PATCH 279/325] gRPC Gateway Removal (#14089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip passing e2e * reverting temp comment * remove unneeded comments * fixing merge errors * fixing more bugs from merge * fixing test * WIP moving code around and fixing tests * unused linting * gaz * temp removing these tests as we need placeholder/wrapper APIs for them with the removal of the gateway * attempting to remove dependencies to gRPC gateway , 1 mroe left in deps.bzl * renaming flags and other gateway services to http * goimport * fixing deepsource * git mv * Update validator/package/validator.yaml Co-authored-by: Radosław Kapka * Update validator/package/validator.yaml Co-authored-by: Radosław Kapka * Update cmd/beacon-chain/flags/base.go Co-authored-by: Radosław Kapka * Update cmd/beacon-chain/flags/base.go Co-authored-by: Radosław Kapka * Update cmd/beacon-chain/flags/base.go Co-authored-by: Radosław Kapka * addressing feedback * missed lint * renaming import * reversal based on feedback * fixing web ui registration * don't require mux handler * gaz * removing gRPC service from validator completely, merged with http service, renames are a work in progress * updating go.sum * linting * trailing white space * realized there was more cleanup i could do with code reuse * adding wrapper for routes * reverting version * fixing dependencies from merging develop * gaz * fixing unit test * fixing dependencies * reverting unit test * fixing conflict * updating change log * Update log.go Co-authored-by: Preston Van Loon * gaz * Update api/server/httprest/server.go Co-authored-by: Preston Van Loon * addressing some feedback * forgot to remove deprecated flag in usage * gofmt * fixing test * fixing deepsource issue * moving deprecated flag and adding timeout handler * missed removal of a flag * fixing test: * Update CHANGELOG.md Co-authored-by: Radosław Kapka * addressing feedback * updating comments based on feedback * removing unused field for now, we can add it back in if we need to use the option * removing unused struct * changing api-timeout flag based on feedback --------- Co-authored-by: Radosław Kapka Co-authored-by: Preston Van Loon --- BUILD.bazel | 7 - CHANGELOG.md | 8 +- api/gateway/gateway.go | 212 -- api/gateway/gateway_test.go | 107 - api/gateway/log.go | 5 - api/gateway/modifiers.go | 30 - api/gateway/options.go | 79 - api/grpc/BUILD.bazel | 2 - api/grpc/grpcutils.go | 15 - api/grpc/grpcutils_test.go | 18 - api/{gateway => server/httprest}/BUILD.bazel | 19 +- api/server/httprest/log.go | 5 + api/server/httprest/options.go | 34 + api/server/httprest/server.go | 101 + api/server/httprest/server_test.go | 68 + beacon-chain/gateway/BUILD.bazel | 27 - beacon-chain/gateway/helpers.go | 78 - beacon-chain/gateway/helpers_test.go | 29 - beacon-chain/node/BUILD.bazel | 3 +- beacon-chain/node/node.go | 62 +- beacon-chain/node/node_test.go | 6 +- beacon-chain/rpc/eth/helpers/BUILD.bazel | 7 - beacon-chain/rpc/eth/helpers/sync.go | 43 - beacon-chain/rpc/eth/helpers/sync_test.go | 49 - .../rpc/prysm/v1alpha1/node/BUILD.bazel | 2 - .../rpc/prysm/v1alpha1/node/server_test.go | 22 +- cmd/beacon-chain/flags/BUILD.bazel | 2 +- cmd/beacon-chain/flags/base.go | 58 +- cmd/beacon-chain/main.go | 7 +- cmd/beacon-chain/usage.go | 7 +- cmd/flags.go | 5 +- cmd/validator/flags/flags.go | 51 +- cmd/validator/main.go | 7 +- cmd/validator/usage.go | 7 +- cmd/validator/web/web.go | 10 +- config/features/deprecated_flags.go | 19 +- deps.bzl | 160 +- go.mod | 4 - go.sum | 68 - hack/interop_start.sh | 2 +- proto/eth/v1/BUILD.bazel | 13 +- proto/eth/v1/README.md | 4 - proto/eth/v2/BUILD.bazel | 13 +- proto/prysm/v1alpha1/BUILD.bazel | 34 +- proto/prysm/v1alpha1/README.md | 4 - proto/prysm/v1alpha1/attestation.pb.gw.go | 4 - proto/prysm/v1alpha1/beacon_block.pb.gw.go | 4 - proto/prysm/v1alpha1/beacon_chain.pb.gw.go | 1862 ------------ proto/prysm/v1alpha1/beacon_chain.proto | 1 - proto/prysm/v1alpha1/beacon_state.pb.gw.go | 4 - proto/prysm/v1alpha1/blobs.pb.gw.go | 4 - proto/prysm/v1alpha1/debug.pb.gw.go | 487 ---- proto/prysm/v1alpha1/eip_7251.pb.gw.go | 4 - .../finalized_block_root_container.pb.gw.go | 4 - proto/prysm/v1alpha1/health.pb.gw.go | 138 - proto/prysm/v1alpha1/node.pb.gw.go | 711 ----- proto/prysm/v1alpha1/p2p_messages.pb.gw.go | 4 - proto/prysm/v1alpha1/powchain.pb.gw.go | 4 - proto/prysm/v1alpha1/slasher.pb.gw.go | 4 - proto/prysm/v1alpha1/sync_committee.pb.gw.go | 4 - .../v1alpha1/validator-client/BUILD.bazel | 34 +- .../validator-client/keymanager.pb.gw.go | 4 - proto/prysm/v1alpha1/validator.pb.gw.go | 2506 ----------------- proto/prysm/v1alpha1/withdrawals.pb.gw.go | 4 - testing/endtoend/components/beacon_node.go | 2 +- .../components/lighthouse_validator.go | 27 +- testing/endtoend/components/validator.go | 8 +- testing/endtoend/endtoend_setup_test.go | 4 - testing/endtoend/evaluators/BUILD.bazel | 2 - .../evaluators/api_gateway_v1alpha1.go | 501 ---- testing/endtoend/evaluators/beaconapi/util.go | 6 +- .../endtoend/evaluators/beaconapi/verify.go | 2 +- .../endtoend/evaluators/execution_engine.go | 4 +- testing/endtoend/evaluators/operations.go | 2 +- testing/endtoend/evaluators/validator.go | 2 +- testing/endtoend/helpers/helpers.go | 4 +- testing/endtoend/params/params.go | 18 +- testing/endtoend/params/params_test.go | 2 +- .../validator-mock/validator_client_mock.go | 4 +- ...ithub_grpc_ecosystem_grpc_gateway_v2.patch | 12 - ...cosystem_grpc_gateway_v2_fix_emptypb.patch | 22 - ...c_ecosystem_grpc_gateway_v2_prysm_v5.patch | 40 - .../beacon-api/mock/json_rest_handler_mock.go | 4 +- validator/node/BUILD.bazel | 5 - validator/node/node.go | 117 +- validator/package/validator.yaml | 4 +- validator/rpc/BUILD.bazel | 7 +- validator/rpc/auth_token.go | 2 +- validator/rpc/beacon.go | 3 +- validator/rpc/handlers_beacon.go | 1 + validator/rpc/handlers_keymanager_test.go | 12 +- validator/rpc/server.go | 134 +- validator/web/BUILD.bazel | 1 - validator/web/handler.go | 1 - 94 files changed, 498 insertions(+), 7755 deletions(-) delete mode 100644 api/gateway/gateway.go delete mode 100644 api/gateway/gateway_test.go delete mode 100644 api/gateway/log.go delete mode 100644 api/gateway/modifiers.go delete mode 100644 api/gateway/options.go rename api/{gateway => server/httprest}/BUILD.bazel (53%) create mode 100644 api/server/httprest/log.go create mode 100644 api/server/httprest/options.go create mode 100644 api/server/httprest/server.go create mode 100644 api/server/httprest/server_test.go delete mode 100644 beacon-chain/gateway/BUILD.bazel delete mode 100644 beacon-chain/gateway/helpers.go delete mode 100644 beacon-chain/gateway/helpers_test.go delete mode 100644 proto/eth/v1/README.md delete mode 100644 proto/prysm/v1alpha1/README.md delete mode 100755 proto/prysm/v1alpha1/attestation.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/beacon_block.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/beacon_chain.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/beacon_state.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/blobs.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/debug.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/eip_7251.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/health.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/node.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/p2p_messages.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/powchain.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/slasher.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/sync_committee.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/validator.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/withdrawals.pb.gw.go delete mode 100644 testing/endtoend/evaluators/api_gateway_v1alpha1.go delete mode 100644 third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch delete mode 100644 third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch delete mode 100644 third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch diff --git a/BUILD.bazel b/BUILD.bazel index cfe2ee4863af..4020dcac406b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -55,13 +55,6 @@ alias( visibility = ["//visibility:public"], ) -# Protobuf gRPC gateway compiler -alias( - name = "grpc_gateway_proto_compiler", - actual = "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - visibility = ["//visibility:public"], -) - gometalinter( name = "gometalinter", config = "//:.gometalinter.json", diff --git a/CHANGELOG.md b/CHANGELOG.md index f817e58be347..667ea9ce90ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,13 +23,17 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Electra: Updated block publishing beacon APIs to support Electra. - "Submitted builder validator registration settings for custom builders" log message moved to debug level. - config: Genesis validator root is now hardcoded in params.BeaconConfig() +- `grpc-gateway-host` is renamed to http-host. The old name can still be used as an alias. +- `grpc-gateway-port` is renamed to http-port. +- `grpc-gateway-corsdomain` is renamed to http-cors-domain. +- `api-timeout` is changed from int flag to duration flag, default value updated. ### Deprecated - +- `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. - `--enable-experimental-state` flag is deprecated. This feature is now on by default. Opt-out with `--disable-experimental-state`. ### Removed - +- removed gRPC Gateway ### Fixed diff --git a/api/gateway/gateway.go b/api/gateway/gateway.go deleted file mode 100644 index 29d6365902ad..000000000000 --- a/api/gateway/gateway.go +++ /dev/null @@ -1,212 +0,0 @@ -// Package gateway defines a grpc-gateway server that serves HTTP-JSON traffic and acts a proxy between HTTP and gRPC. -package gateway - -import ( - "context" - "fmt" - "net" - "net/http" - "time" - - "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/server/middleware" - "github.com/prysmaticlabs/prysm/v5/runtime" - "google.golang.org/grpc" - "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" -) - -var _ runtime.Service = (*Gateway)(nil) - -// PbMux serves grpc-gateway requests for selected patterns using registered protobuf handlers. -type PbMux struct { - Registrations []PbHandlerRegistration // Protobuf registrations to be registered in Mux. - Patterns []string // URL patterns that will be handled by Mux. - Mux *gwruntime.ServeMux // The router that will be used for grpc-gateway requests. -} - -// PbHandlerRegistration is a function that registers a protobuf handler. -type PbHandlerRegistration func(context.Context, *gwruntime.ServeMux, *grpc.ClientConn) error - -// MuxHandler is a function that implements the mux handler functionality. -type MuxHandler func( - h http.HandlerFunc, - w http.ResponseWriter, - req *http.Request, -) - -// Config parameters for setting up the gateway service. -type config struct { - maxCallRecvMsgSize uint64 - remoteCert string - gatewayAddr string - remoteAddr string - allowedOrigins []string - muxHandler MuxHandler - pbHandlers []*PbMux - router *mux.Router - timeout time.Duration -} - -// Gateway is the gRPC gateway to serve HTTP JSON traffic as a proxy and forward it to the gRPC server. -type Gateway struct { - cfg *config - conn *grpc.ClientConn - server *http.Server - cancel context.CancelFunc - ctx context.Context - startFailure error -} - -// New returns a new instance of the Gateway. -func New(ctx context.Context, opts ...Option) (*Gateway, error) { - g := &Gateway{ - ctx: ctx, - cfg: &config{}, - } - for _, opt := range opts { - if err := opt(g); err != nil { - return nil, err - } - } - if g.cfg.router == nil { - g.cfg.router = mux.NewRouter() - } - return g, nil -} - -// Start the gateway service. -func (g *Gateway) Start() { - ctx, cancel := context.WithCancel(g.ctx) - g.cancel = cancel - - conn, err := g.dial(ctx, "tcp", g.cfg.remoteAddr) - if err != nil { - log.WithError(err).Error("Failed to connect to gRPC server") - g.startFailure = err - return - } - g.conn = conn - - for _, h := range g.cfg.pbHandlers { - for _, r := range h.Registrations { - if err := r(ctx, h.Mux, g.conn); err != nil { - log.WithError(err).Error("Failed to register handler") - g.startFailure = err - return - } - } - for _, p := range h.Patterns { - g.cfg.router.PathPrefix(p).Handler(h.Mux) - } - } - - corsMux := middleware.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) - - if g.cfg.muxHandler != nil { - g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - g.cfg.muxHandler(corsMux.ServeHTTP, w, r) - }) - } - - g.server = &http.Server{ - Addr: g.cfg.gatewayAddr, - Handler: corsMux, - ReadHeaderTimeout: time.Second, - } - - go func() { - log.WithField("address", g.cfg.gatewayAddr).Info("Starting gRPC gateway") - if err := g.server.ListenAndServe(); err != http.ErrServerClosed { - log.WithError(err).Error("Failed to start gRPC gateway") - g.startFailure = err - return - } - }() -} - -// Status of grpc gateway. Returns an error if this service is unhealthy. -func (g *Gateway) Status() error { - if g.startFailure != nil { - return g.startFailure - } - if s := g.conn.GetState(); s != connectivity.Ready { - return fmt.Errorf("grpc server is %s", s) - } - return nil -} - -// Stop the gateway with a graceful shutdown. -func (g *Gateway) Stop() error { - if g.server != nil { - shutdownCtx, shutdownCancel := context.WithTimeout(g.ctx, 2*time.Second) - defer shutdownCancel() - if err := g.server.Shutdown(shutdownCtx); err != nil { - if errors.Is(err, context.DeadlineExceeded) { - log.Warn("Existing connections terminated") - } else { - log.WithError(err).Error("Failed to gracefully shut down server") - } - } - } - if g.cancel != nil { - g.cancel() - } - return nil -} - -// dial the gRPC server. -func (g *Gateway) dial(ctx context.Context, network, addr string) (*grpc.ClientConn, error) { - switch network { - case "tcp": - return g.dialTCP(ctx, addr) - case "unix": - return g.dialUnix(ctx, addr) - default: - return nil, fmt.Errorf("unsupported network type %q", network) - } -} - -// dialTCP creates a client connection via TCP. -// "addr" must be a valid TCP address with a port number. -func (g *Gateway) dialTCP(ctx context.Context, addr string) (*grpc.ClientConn, error) { - var security grpc.DialOption - if len(g.cfg.remoteCert) > 0 { - creds, err := credentials.NewClientTLSFromFile(g.cfg.remoteCert, "") - if err != nil { - return nil, err - } - security = grpc.WithTransportCredentials(creds) - } else { - // Use insecure credentials when there's no remote cert provided. - security = grpc.WithTransportCredentials(insecure.NewCredentials()) - } - opts := []grpc.DialOption{ - security, - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(int(g.cfg.maxCallRecvMsgSize))), - } - return grpc.DialContext(ctx, addr, opts...) -} - -// dialUnix creates a client connection via a unix domain socket. -// "addr" must be a valid path to the socket. -func (g *Gateway) dialUnix(ctx context.Context, addr string) (*grpc.ClientConn, error) { - d := func(addr string, timeout time.Duration) (net.Conn, error) { - return net.DialTimeout("unix", addr, timeout) - } - f := func(ctx context.Context, addr string) (net.Conn, error) { - if deadline, ok := ctx.Deadline(); ok { - return d(addr, time.Until(deadline)) - } - return d(addr, 0) - } - opts := []grpc.DialOption{ - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithContextDialer(f), - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(int(g.cfg.maxCallRecvMsgSize))), - } - return grpc.DialContext(ctx, addr, opts...) -} diff --git a/api/gateway/gateway_test.go b/api/gateway/gateway_test.go deleted file mode 100644 index d03d0dc28448..000000000000 --- a/api/gateway/gateway_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package gateway - -import ( - "context" - "flag" - "fmt" - "net/http" - "net/http/httptest" - "net/url" - "testing" - - "github.com/gorilla/mux" - "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" - "github.com/prysmaticlabs/prysm/v5/testing/assert" - "github.com/prysmaticlabs/prysm/v5/testing/require" - logTest "github.com/sirupsen/logrus/hooks/test" - "github.com/urfave/cli/v2" -) - -func TestGateway_Customized(t *testing.T) { - r := mux.NewRouter() - cert := "cert" - origins := []string{"origin"} - size := uint64(100) - - opts := []Option{ - WithRouter(r), - WithRemoteCert(cert), - WithAllowedOrigins(origins), - WithMaxCallRecvMsgSize(size), - WithMuxHandler(func( - _ http.HandlerFunc, - _ http.ResponseWriter, - _ *http.Request, - ) { - }), - } - - g, err := New(context.Background(), opts...) - require.NoError(t, err) - - assert.Equal(t, r, g.cfg.router) - assert.Equal(t, cert, g.cfg.remoteCert) - require.Equal(t, 1, len(g.cfg.allowedOrigins)) - assert.Equal(t, origins[0], g.cfg.allowedOrigins[0]) - assert.Equal(t, size, g.cfg.maxCallRecvMsgSize) -} - -func TestGateway_StartStop(t *testing.T) { - hook := logTest.NewGlobal() - - app := cli.App{} - set := flag.NewFlagSet("test", 0) - ctx := cli.NewContext(&app, set, nil) - - gatewayPort := ctx.Int(flags.GRPCGatewayPort.Name) - gatewayHost := ctx.String(flags.GRPCGatewayHost.Name) - rpcHost := ctx.String(flags.RPCHost.Name) - selfAddress := fmt.Sprintf("%s:%d", rpcHost, ctx.Int(flags.RPCPort.Name)) - gatewayAddress := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) - - opts := []Option{ - WithGatewayAddr(gatewayAddress), - WithRemoteAddr(selfAddress), - WithMuxHandler(func( - _ http.HandlerFunc, - _ http.ResponseWriter, - _ *http.Request, - ) { - }), - } - - g, err := New(context.Background(), opts...) - require.NoError(t, err) - - g.Start() - go func() { - require.LogsContain(t, hook, "Starting gRPC gateway") - require.LogsDoNotContain(t, hook, "Starting API middleware") - }() - err = g.Stop() - require.NoError(t, err) -} - -func TestGateway_NilHandler_NotFoundHandlerRegistered(t *testing.T) { - app := cli.App{} - set := flag.NewFlagSet("test", 0) - ctx := cli.NewContext(&app, set, nil) - - gatewayPort := ctx.Int(flags.GRPCGatewayPort.Name) - gatewayHost := ctx.String(flags.GRPCGatewayHost.Name) - rpcHost := ctx.String(flags.RPCHost.Name) - selfAddress := fmt.Sprintf("%s:%d", rpcHost, ctx.Int(flags.RPCPort.Name)) - gatewayAddress := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) - - opts := []Option{ - WithGatewayAddr(gatewayAddress), - WithRemoteAddr(selfAddress), - } - - g, err := New(context.Background(), opts...) - require.NoError(t, err) - - writer := httptest.NewRecorder() - g.cfg.router.ServeHTTP(writer, &http.Request{Method: "GET", Host: "localhost", URL: &url.URL{Path: "/foo"}}) - assert.Equal(t, http.StatusNotFound, writer.Code) -} diff --git a/api/gateway/log.go b/api/gateway/log.go deleted file mode 100644 index fe3dcc54cd4d..000000000000 --- a/api/gateway/log.go +++ /dev/null @@ -1,5 +0,0 @@ -package gateway - -import "github.com/sirupsen/logrus" - -var log = logrus.WithField("prefix", "gateway") diff --git a/api/gateway/modifiers.go b/api/gateway/modifiers.go deleted file mode 100644 index dab4e608942f..000000000000 --- a/api/gateway/modifiers.go +++ /dev/null @@ -1,30 +0,0 @@ -package gateway - -import ( - "context" - "net/http" - "strconv" - - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "google.golang.org/protobuf/proto" -) - -func HttpResponseModifier(ctx context.Context, w http.ResponseWriter, _ proto.Message) error { - md, ok := gwruntime.ServerMetadataFromContext(ctx) - if !ok { - return nil - } - // set http status code - if vals := md.HeaderMD.Get("x-http-code"); len(vals) > 0 { - code, err := strconv.Atoi(vals[0]) - if err != nil { - return err - } - // delete the headers to not expose any grpc-metadata in http response - delete(md.HeaderMD, "x-http-code") - delete(w.Header(), "Grpc-Metadata-X-Http-Code") - w.WriteHeader(code) - } - - return nil -} diff --git a/api/gateway/options.go b/api/gateway/options.go deleted file mode 100644 index f029314214f7..000000000000 --- a/api/gateway/options.go +++ /dev/null @@ -1,79 +0,0 @@ -package gateway - -import ( - "time" - - "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" -) - -type Option func(g *Gateway) error - -func WithPbHandlers(handlers []*PbMux) Option { - return func(g *Gateway) error { - g.cfg.pbHandlers = handlers - return nil - } -} - -func WithMuxHandler(m MuxHandler) Option { - return func(g *Gateway) error { - g.cfg.muxHandler = m - return nil - } -} - -func WithGatewayAddr(addr string) Option { - return func(g *Gateway) error { - g.cfg.gatewayAddr = addr - return nil - } -} - -func WithRemoteAddr(addr string) Option { - return func(g *Gateway) error { - g.cfg.remoteAddr = addr - return nil - } -} - -// WithRouter allows adding a custom mux router to the gateway. -func WithRouter(r *mux.Router) Option { - return func(g *Gateway) error { - g.cfg.router = r - return nil - } -} - -// WithAllowedOrigins allows adding a set of allowed origins to the gateway. -func WithAllowedOrigins(origins []string) Option { - return func(g *Gateway) error { - g.cfg.allowedOrigins = origins - return nil - } -} - -// WithRemoteCert allows adding a custom certificate to the gateway, -func WithRemoteCert(cert string) Option { - return func(g *Gateway) error { - g.cfg.remoteCert = cert - return nil - } -} - -// WithMaxCallRecvMsgSize allows specifying the maximum allowed gRPC message size. -func WithMaxCallRecvMsgSize(size uint64) Option { - return func(g *Gateway) error { - g.cfg.maxCallRecvMsgSize = size - return nil - } -} - -// WithTimeout allows changing the timeout value for API calls. -func WithTimeout(seconds uint64) Option { - return func(g *Gateway) error { - g.cfg.timeout = time.Second * time.Duration(seconds) - gwruntime.DefaultContextTimeout = time.Second * time.Duration(seconds) - return nil - } -} diff --git a/api/grpc/BUILD.bazel b/api/grpc/BUILD.bazel index 6ee34f669937..9284944b385b 100644 --- a/api/grpc/BUILD.bazel +++ b/api/grpc/BUILD.bazel @@ -22,9 +22,7 @@ go_test( deps = [ "//testing/assert:go_default_library", "//testing/require:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", ], ) diff --git a/api/grpc/grpcutils.go b/api/grpc/grpcutils.go index 53378b6c1a5f..b1d9444d5788 100644 --- a/api/grpc/grpcutils.go +++ b/api/grpc/grpcutils.go @@ -2,8 +2,6 @@ package grpc import ( "context" - "encoding/json" - "fmt" "strings" "time" @@ -81,16 +79,3 @@ func AppendHeaders(parent context.Context, headers []string) context.Context { } return parent } - -// AppendCustomErrorHeader sets a CustomErrorMetadataKey gRPC header on the passed in context, -// using the passed in error data as the header's value. The data is serialized as JSON. -func AppendCustomErrorHeader(ctx context.Context, errorData interface{}) error { - j, err := json.Marshal(errorData) - if err != nil { - return fmt.Errorf("could not marshal error data into JSON: %w", err) - } - if err := grpc.SetHeader(ctx, metadata.Pairs(CustomErrorMetadataKey, string(j))); err != nil { - return fmt.Errorf("could not set custom error header: %w", err) - } - return nil -} diff --git a/api/grpc/grpcutils_test.go b/api/grpc/grpcutils_test.go index b7094319b4c1..8bae339a5637 100644 --- a/api/grpc/grpcutils_test.go +++ b/api/grpc/grpcutils_test.go @@ -2,15 +2,11 @@ package grpc import ( "context" - "encoding/json" - "strings" "testing" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" logTest "github.com/sirupsen/logrus/hooks/test" - "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -62,17 +58,3 @@ func TestAppendHeaders(t *testing.T) { assert.Equal(t, "value=1", md.Get("first")[0]) }) } - -func TestAppendCustomErrorHeader(t *testing.T) { - stream := &runtime.ServerTransportStream{} - ctx := grpc.NewContextWithServerTransportStream(context.Background(), stream) - data := &customErrorData{Message: "foo"} - require.NoError(t, AppendCustomErrorHeader(ctx, data)) - // The stream used in test setup sets the metadata key in lowercase. - value, ok := stream.Header()[strings.ToLower(CustomErrorMetadataKey)] - require.Equal(t, true, ok, "Failed to retrieve custom error metadata value") - expected, err := json.Marshal(data) - require.NoError(t, err) - assert.Equal(t, string(expected), value[0]) - -} diff --git a/api/gateway/BUILD.bazel b/api/server/httprest/BUILD.bazel similarity index 53% rename from api/gateway/BUILD.bazel rename to api/server/httprest/BUILD.bazel index 0aafeb732956..bef932abc364 100644 --- a/api/gateway/BUILD.bazel +++ b/api/server/httprest/BUILD.bazel @@ -3,34 +3,23 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ - "gateway.go", "log.go", - "modifiers.go", "options.go", + "server.go", ], - importpath = "github.com/prysmaticlabs/prysm/v5/api/gateway", - visibility = [ - "//beacon-chain:__subpackages__", - "//validator:__subpackages__", - ], + importpath = "github.com/prysmaticlabs/prysm/v5/api/server/httprest", + visibility = ["//visibility:public"], deps = [ - "//api/server/middleware:go_default_library", "//runtime:go_default_library", "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//connectivity:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", - "@org_golang_google_grpc//credentials/insecure:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", ], ) go_test( name = "go_default_test", - srcs = ["gateway_test.go"], + srcs = ["server_test.go"], embed = [":go_default_library"], deps = [ "//cmd/beacon-chain/flags:go_default_library", diff --git a/api/server/httprest/log.go b/api/server/httprest/log.go new file mode 100644 index 000000000000..6208a403ea4d --- /dev/null +++ b/api/server/httprest/log.go @@ -0,0 +1,5 @@ +package httprest + +import "github.com/sirupsen/logrus" + +var log = logrus.WithField("prefix", "httprest") diff --git a/api/server/httprest/options.go b/api/server/httprest/options.go new file mode 100644 index 000000000000..87b4764ae7aa --- /dev/null +++ b/api/server/httprest/options.go @@ -0,0 +1,34 @@ +package httprest + +import ( + "time" + + "github.com/gorilla/mux" +) + +// Option is a http rest server functional parameter type. +type Option func(g *Server) error + +// WithHTTPAddr sets the full address ( host and port ) of the server. +func WithHTTPAddr(addr string) Option { + return func(g *Server) error { + g.cfg.httpAddr = addr + return nil + } +} + +// WithRouter sets the internal router of the server, this is required. +func WithRouter(r *mux.Router) Option { + return func(g *Server) error { + g.cfg.router = r + return nil + } +} + +// WithTimeout allows changing the timeout value for API calls. +func WithTimeout(duration time.Duration) Option { + return func(g *Server) error { + g.cfg.timeout = duration + return nil + } +} diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go new file mode 100644 index 000000000000..2e8f907a6478 --- /dev/null +++ b/api/server/httprest/server.go @@ -0,0 +1,101 @@ +package httprest + +import ( + "context" + "net/http" + "time" + + "github.com/gorilla/mux" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/runtime" +) + +var _ runtime.Service = (*Server)(nil) + +// Config parameters for setting up the http-rest service. +type config struct { + httpAddr string + router *mux.Router + timeout time.Duration +} + +// Server serves HTTP traffic. +type Server struct { + cfg *config + server *http.Server + cancel context.CancelFunc + ctx context.Context + startFailure error +} + +// New returns a new instance of the Server. +func New(ctx context.Context, opts ...Option) (*Server, error) { + g := &Server{ + ctx: ctx, + cfg: &config{}, + } + for _, opt := range opts { + if err := opt(g); err != nil { + return nil, err + } + } + if g.cfg.router == nil { + return nil, errors.New("router option not configured") + } + var handler http.Handler + defaultReadHeaderTimeout := time.Second + if g.cfg.timeout > 0*time.Second { + defaultReadHeaderTimeout = g.cfg.timeout + handler = http.TimeoutHandler(g.cfg.router, g.cfg.timeout, "request timed out") + } else { + handler = g.cfg.router + } + g.server = &http.Server{ + Addr: g.cfg.httpAddr, + Handler: handler, + ReadHeaderTimeout: defaultReadHeaderTimeout, + } + + return g, nil +} + +// Start the http rest service. +func (g *Server) Start() { + g.ctx, g.cancel = context.WithCancel(g.ctx) + + go func() { + log.WithField("address", g.cfg.httpAddr).Info("Starting HTTP server") + if err := g.server.ListenAndServe(); err != http.ErrServerClosed { + log.WithError(err).Error("Failed to start HTTP server") + g.startFailure = err + return + } + }() +} + +// Status of the HTTP server. Returns an error if this service is unhealthy. +func (g *Server) Status() error { + if g.startFailure != nil { + return g.startFailure + } + return nil +} + +// Stop the HTTP server with a graceful shutdown. +func (g *Server) Stop() error { + if g.server != nil { + shutdownCtx, shutdownCancel := context.WithTimeout(g.ctx, 2*time.Second) + defer shutdownCancel() + if err := g.server.Shutdown(shutdownCtx); err != nil { + if errors.Is(err, context.DeadlineExceeded) { + log.Warn("Existing connections terminated") + } else { + log.WithError(err).Error("Failed to gracefully shut down server") + } + } + } + if g.cancel != nil { + g.cancel() + } + return nil +} diff --git a/api/server/httprest/server_test.go b/api/server/httprest/server_test.go new file mode 100644 index 000000000000..9e9d90a89559 --- /dev/null +++ b/api/server/httprest/server_test.go @@ -0,0 +1,68 @@ +package httprest + +import ( + "context" + "flag" + "fmt" + "net/http" + "net/http/httptest" + "net/url" + "testing" + + "github.com/gorilla/mux" + "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" + "github.com/prysmaticlabs/prysm/v5/testing/assert" + "github.com/prysmaticlabs/prysm/v5/testing/require" + logTest "github.com/sirupsen/logrus/hooks/test" + "github.com/urfave/cli/v2" +) + +func TestServer_StartStop(t *testing.T) { + hook := logTest.NewGlobal() + + app := cli.App{} + set := flag.NewFlagSet("test", 0) + ctx := cli.NewContext(&app, set, nil) + + port := ctx.Int(flags.HTTPServerPort.Name) + host := ctx.String(flags.HTTPServerHost.Name) + address := fmt.Sprintf("%s:%d", host, port) + + opts := []Option{ + WithHTTPAddr(address), + WithRouter(mux.NewRouter()), + } + + g, err := New(context.Background(), opts...) + require.NoError(t, err) + + g.Start() + go func() { + require.LogsContain(t, hook, "Starting HTTP server") + require.LogsDoNotContain(t, hook, "Starting API middleware") + }() + err = g.Stop() + require.NoError(t, err) +} + +func TestServer_NilHandler_NotFoundHandlerRegistered(t *testing.T) { + app := cli.App{} + set := flag.NewFlagSet("test", 0) + ctx := cli.NewContext(&app, set, nil) + + port := ctx.Int(flags.HTTPServerPort.Name) + host := ctx.String(flags.HTTPServerHost.Name) + address := fmt.Sprintf("%s:%d", host, port) + + opts := []Option{ + WithHTTPAddr(address), + WithRouter(mux.NewRouter()), + } + + g, err := New(context.Background(), opts...) + require.NoError(t, err) + + writer := httptest.NewRecorder() + g.cfg.router.ServeHTTP(writer, &http.Request{Method: "GET", Host: "localhost", URL: &url.URL{Path: "/foo"}}) + assert.Equal(t, http.StatusNotFound, writer.Code) +} diff --git a/beacon-chain/gateway/BUILD.bazel b/beacon-chain/gateway/BUILD.bazel deleted file mode 100644 index 60df0caac826..000000000000 --- a/beacon-chain/gateway/BUILD.bazel +++ /dev/null @@ -1,27 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["helpers.go"], - importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/gateway", - visibility = ["//beacon-chain:__subpackages__"], - deps = [ - "//api:go_default_library", - "//api/gateway:go_default_library", - "//cmd/beacon-chain/flags:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["helpers_test.go"], - embed = [":go_default_library"], - deps = [ - "//api/gateway:go_default_library", - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - ], -) diff --git a/beacon-chain/gateway/helpers.go b/beacon-chain/gateway/helpers.go deleted file mode 100644 index fb74f2a8e6eb..000000000000 --- a/beacon-chain/gateway/helpers.go +++ /dev/null @@ -1,78 +0,0 @@ -package gateway - -import ( - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/gateway" - "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" - ethpbalpha "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "google.golang.org/protobuf/encoding/protojson" -) - -// MuxConfig contains configuration that should be used when registering the beacon node in the gateway. -type MuxConfig struct { - EthPbMux *gateway.PbMux - V1AlphaPbMux *gateway.PbMux -} - -// DefaultConfig returns a fully configured MuxConfig with standard gateway behavior. -func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig { - var v1AlphaPbHandler, ethPbHandler *gateway.PbMux - if flags.EnableHTTPPrysmAPI(httpModules) { - v1AlphaRegistrations := []gateway.PbHandlerRegistration{ - ethpbalpha.RegisterNodeHandler, - ethpbalpha.RegisterBeaconChainHandler, - ethpbalpha.RegisterBeaconNodeValidatorHandler, - ethpbalpha.RegisterHealthHandler, - } - if enableDebugRPCEndpoints { - v1AlphaRegistrations = append(v1AlphaRegistrations, ethpbalpha.RegisterDebugHandler) - } - v1AlphaMux := gwruntime.NewServeMux( - gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ - Marshaler: &gwruntime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - EmitUnpopulated: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - }), - gwruntime.WithMarshalerOption( - api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, - ), - ) - v1AlphaPbHandler = &gateway.PbMux{ - Registrations: v1AlphaRegistrations, - Patterns: []string{"/eth/v1alpha1/", "/eth/v1alpha2/"}, - Mux: v1AlphaMux, - } - } - if flags.EnableHTTPEthAPI(httpModules) { - ethRegistrations := []gateway.PbHandlerRegistration{} - ethMux := gwruntime.NewServeMux( - gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ - Marshaler: &gwruntime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - UseProtoNames: true, - EmitUnpopulated: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - }), - ) - ethPbHandler = &gateway.PbMux{ - Registrations: ethRegistrations, - Patterns: []string{"/internal/eth/v1/", "/internal/eth/v2/"}, - Mux: ethMux, - } - } - - return MuxConfig{ - EthPbMux: ethPbHandler, - V1AlphaPbMux: v1AlphaPbHandler, - } -} diff --git a/beacon-chain/gateway/helpers_test.go b/beacon-chain/gateway/helpers_test.go deleted file mode 100644 index e5d076790047..000000000000 --- a/beacon-chain/gateway/helpers_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package gateway - -import ( - "testing" - - "github.com/prysmaticlabs/prysm/v5/api/gateway" - "github.com/prysmaticlabs/prysm/v5/testing/assert" - "github.com/prysmaticlabs/prysm/v5/testing/require" -) - -func TestDefaultConfig(t *testing.T) { - t.Run("Without Prysm API", func(t *testing.T) { - cfg := DefaultConfig(true, "eth") - assert.NotNil(t, cfg.EthPbMux.Mux) - require.Equal(t, 2, len(cfg.EthPbMux.Patterns)) - assert.Equal(t, "/internal/eth/v1/", cfg.EthPbMux.Patterns[0]) - assert.Equal(t, 0, len(cfg.EthPbMux.Registrations)) - assert.Equal(t, (*gateway.PbMux)(nil), cfg.V1AlphaPbMux) - }) - t.Run("Without Eth API", func(t *testing.T) { - cfg := DefaultConfig(true, "prysm") - assert.Equal(t, (*gateway.PbMux)(nil), cfg.EthPbMux) - assert.NotNil(t, cfg.V1AlphaPbMux.Mux) - require.Equal(t, 2, len(cfg.V1AlphaPbMux.Patterns)) - assert.Equal(t, "/eth/v1alpha1/", cfg.V1AlphaPbMux.Patterns[0]) - assert.Equal(t, "/eth/v1alpha2/", cfg.V1AlphaPbMux.Patterns[1]) - assert.Equal(t, 5, len(cfg.V1AlphaPbMux.Registrations)) - }) -} diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 883a6078fd38..34255da7a159 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -15,7 +15,7 @@ go_library( "//cmd/beacon-chain:__subpackages__", ], deps = [ - "//api/gateway:go_default_library", + "//api/server/httprest:go_default_library", "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//beacon-chain/blockchain:go_default_library", @@ -30,7 +30,6 @@ go_library( "//beacon-chain/execution:go_default_library", "//beacon-chain/forkchoice:go_default_library", "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", - "//beacon-chain/gateway:go_default_library", "//beacon-chain/monitor:go_default_library", "//beacon-chain/node/registration:go_default_library", "//beacon-chain/operations/attestations:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index d3f3af2ecfbd..be52d679a954 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/gorilla/mux" "github.com/pkg/errors" - apigateway "github.com/prysmaticlabs/prysm/v5/api/gateway" + "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" @@ -34,7 +34,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution" "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/gateway" "github.com/prysmaticlabs/prysm/v5/beacon-chain/monitor" "github.com/prysmaticlabs/prysm/v5/beacon-chain/node/registration" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" @@ -367,9 +366,9 @@ func registerServices(cliCtx *cli.Context, beacon *BeaconNode, synchronizer *sta return errors.Wrap(err, "could not register RPC service") } - log.Debugln("Registering GRPC Gateway Service") - if err := beacon.registerGRPCGateway(router); err != nil { - return errors.Wrap(err, "could not register GRPC gateway service") + log.Debugln("Registering HTTP Service") + if err := beacon.registerHTTPService(router); err != nil { + return errors.Wrap(err, "could not register HTTP service") } log.Debugln("Registering Validator Monitoring Service") @@ -400,10 +399,10 @@ func initSyncWaiter(ctx context.Context, complete chan struct{}) func() error { func newRouter(cliCtx *cli.Context) *mux.Router { var allowedOrigins []string - if cliCtx.IsSet(flags.GPRCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") + if cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GPRCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") } r := mux.NewRouter() r.Use(middleware.NormalizeQueryValuesHandler) @@ -1044,43 +1043,18 @@ func (b *BeaconNode) registerPrometheusService(_ *cli.Context) error { return b.services.RegisterService(service) } -func (b *BeaconNode) registerGRPCGateway(router *mux.Router) error { - if b.cliCtx.Bool(flags.DisableGRPCGateway.Name) { - return nil +func (b *BeaconNode) registerHTTPService(router *mux.Router) error { + host := b.cliCtx.String(flags.HTTPServerHost.Name) + port := b.cliCtx.Int(flags.HTTPServerPort.Name) + address := net.JoinHostPort(host, strconv.Itoa(port)) + opts := []httprest.Option{ + httprest.WithRouter(router), + httprest.WithHTTPAddr(address), } - gatewayHost := b.cliCtx.String(flags.GRPCGatewayHost.Name) - gatewayPort := b.cliCtx.Int(flags.GRPCGatewayPort.Name) - rpcHost := b.cliCtx.String(flags.RPCHost.Name) - rpcPort := b.cliCtx.Int(flags.RPCPort.Name) - enableDebugRPCEndpoints := !b.cliCtx.Bool(flags.DisableDebugRPCEndpoints.Name) - selfAddress := net.JoinHostPort(rpcHost, strconv.Itoa(rpcPort)) - gatewayAddress := net.JoinHostPort(gatewayHost, strconv.Itoa(gatewayPort)) - allowedOrigins := strings.Split(b.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") - selfCert := b.cliCtx.String(flags.CertFlag.Name) - maxCallSize := b.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - httpModules := b.cliCtx.String(flags.HTTPModules.Name) - timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - - gatewayConfig := gateway.DefaultConfig(enableDebugRPCEndpoints, httpModules) - muxs := make([]*apigateway.PbMux, 0) - if gatewayConfig.V1AlphaPbMux != nil { - muxs = append(muxs, gatewayConfig.V1AlphaPbMux) - } - if gatewayConfig.EthPbMux != nil { - muxs = append(muxs, gatewayConfig.EthPbMux) - } - - opts := []apigateway.Option{ - apigateway.WithRouter(router), - apigateway.WithGatewayAddr(gatewayAddress), - apigateway.WithRemoteAddr(selfAddress), - apigateway.WithPbHandlers(muxs), - apigateway.WithRemoteCert(selfCert), - apigateway.WithMaxCallRecvMsgSize(maxCallSize), - apigateway.WithAllowedOrigins(allowedOrigins), - apigateway.WithTimeout(uint64(timeout)), - } - g, err := apigateway.New(b.ctx, opts...) + if b.cliCtx.IsSet(cmd.ApiTimeoutFlag.Name) { + opts = append(opts, httprest.WithTimeout(b.cliCtx.Duration(cmd.ApiTimeoutFlag.Name))) + } + g, err := httprest.New(b.ctx, opts...) if err != nil { return err } diff --git a/beacon-chain/node/node_test.go b/beacon-chain/node/node_test.go index c7aca7d8d777..c27d0788e7d8 100644 --- a/beacon-chain/node/node_test.go +++ b/beacon-chain/node/node_test.go @@ -255,14 +255,14 @@ func TestCORS(t *testing.T) { // Mock CLI context with a test CORS domain app := cli.App{} set := flag.NewFlagSet("test", 0) - set.String(flags.GPRCGatewayCorsDomain.Name, "http://allowed-example.com", "") + set.String(flags.HTTPServerCorsDomain.Name, "http://allowed-example.com", "") cliCtx := cli.NewContext(&app, set, nil) - require.NoError(t, cliCtx.Set(flags.GPRCGatewayCorsDomain.Name, "http://allowed-example.com")) + require.NoError(t, cliCtx.Set(flags.HTTPServerCorsDomain.Name, "http://allowed-example.com")) router := newRouter(cliCtx) // Ensure a test route exists - router.HandleFunc("/some-path", func(w http.ResponseWriter, r *http.Request) { + router.HandleFunc("/some-path", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) }).Methods(http.MethodGet) diff --git a/beacon-chain/rpc/eth/helpers/BUILD.bazel b/beacon-chain/rpc/eth/helpers/BUILD.bazel index 29abaf29b165..c9e1b5ff4b4d 100644 --- a/beacon-chain/rpc/eth/helpers/BUILD.bazel +++ b/beacon-chain/rpc/eth/helpers/BUILD.bazel @@ -10,14 +10,11 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers", visibility = ["//visibility:public"], deps = [ - "//api/grpc:go_default_library", - "//api/server/structs:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/db:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", - "//beacon-chain/sync:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", @@ -40,14 +37,12 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//api/grpc:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/db/testing:go_default_library", "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", @@ -62,7 +57,5 @@ go_test( "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/helpers/sync.go b/beacon-chain/rpc/eth/helpers/sync.go index 856f1c0aced8..0f1d4509306a 100644 --- a/beacon-chain/rpc/eth/helpers/sync.go +++ b/beacon-chain/rpc/eth/helpers/sync.go @@ -8,58 +8,15 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/grpc" - "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/time/slots" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) -// ValidateSyncGRPC checks whether the node is currently syncing and returns an error if it is. -// It also appends syncing info to gRPC headers. -func ValidateSyncGRPC( - ctx context.Context, - syncChecker sync.Checker, - headFetcher blockchain.HeadFetcher, - timeFetcher blockchain.TimeFetcher, - optimisticModeFetcher blockchain.OptimisticModeFetcher, -) error { - if !syncChecker.Syncing() { - return nil - } - headSlot := headFetcher.HeadSlot() - isOptimistic, err := optimisticModeFetcher.IsOptimistic(ctx) - if err != nil { - return status.Errorf(codes.Internal, "Could not check optimistic status: %v", err) - } - - syncDetailsContainer := &structs.SyncDetailsContainer{ - Data: &structs.SyncDetails{ - HeadSlot: strconv.FormatUint(uint64(headSlot), 10), - SyncDistance: strconv.FormatUint(uint64(timeFetcher.CurrentSlot()-headSlot), 10), - IsSyncing: true, - IsOptimistic: isOptimistic, - }, - } - - err = grpc.AppendCustomErrorHeader(ctx, syncDetailsContainer) - if err != nil { - return status.Errorf( - codes.Internal, - "Syncing to latest head, not ready to respond. Could not prepare sync details: %v", - err, - ) - } - return status.Error(codes.Unavailable, "Syncing to latest head, not ready to respond") -} - // IsOptimistic checks whether the beacon state's block is optimistic. func IsOptimistic( ctx context.Context, diff --git a/beacon-chain/rpc/eth/helpers/sync_test.go b/beacon-chain/rpc/eth/helpers/sync_test.go index 014e61888a5f..a760d1a0aaab 100644 --- a/beacon-chain/rpc/eth/helpers/sync_test.go +++ b/beacon-chain/rpc/eth/helpers/sync_test.go @@ -3,19 +3,15 @@ package helpers import ( "context" "strconv" - "strings" "testing" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - grpcutil "github.com/prysmaticlabs/prysm/v5/api/grpc" chainmock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbtest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - syncmock "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -26,53 +22,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/grpc" ) -func TestValidateSync(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) - t.Run("syncing", func(t *testing.T) { - syncChecker := &syncmock.Sync{ - IsSyncing: true, - } - headSlot := primitives.Slot(100) - st, err := util.NewBeaconState() - require.NoError(t, err) - require.NoError(t, st.SetSlot(50)) - chainService := &chainmock.ChainService{ - Slot: &headSlot, - State: st, - } - err = ValidateSyncGRPC(ctx, syncChecker, chainService, chainService, chainService) - require.NotNil(t, err) - sts, ok := grpc.ServerTransportStreamFromContext(ctx).(*runtime.ServerTransportStream) - require.Equal(t, true, ok, "type assertion failed") - md := sts.Header() - v, ok := md[strings.ToLower(grpcutil.CustomErrorMetadataKey)] - require.Equal(t, true, ok, "could not retrieve custom error metadata value") - assert.DeepEqual( - t, - []string{`{"data":{"head_slot":"50","sync_distance":"50","is_syncing":true,"is_optimistic":false,"el_offline":false}}`}, - v, - ) - }) - t.Run("not syncing", func(t *testing.T) { - syncChecker := &syncmock.Sync{ - IsSyncing: false, - } - headSlot := primitives.Slot(100) - st, err := util.NewBeaconState() - require.NoError(t, err) - require.NoError(t, st.SetSlot(50)) - chainService := &chainmock.ChainService{ - Slot: &headSlot, - State: st, - } - err = ValidateSyncGRPC(ctx, syncChecker, nil, nil, chainService) - require.NoError(t, err) - }) -} - func TestIsOptimistic(t *testing.T) { ctx := context.Background() diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel index 59afef99c055..7331e4ddab5d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel @@ -47,9 +47,7 @@ go_test( "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enode:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//reflection:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index 5783fc29a646..0d6f2d04a328 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -3,14 +3,12 @@ package node import ( "context" "errors" - "fmt" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" @@ -24,7 +22,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/grpc" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/reflection" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" @@ -92,7 +89,7 @@ func TestNodeServer_GetImplementedServices(t *testing.T) { res, err := ns.ListImplementedServices(context.Background(), &emptypb.Empty{}) require.NoError(t, err) - // We verify the services include the node service + the registered reflection service. + // We verify the services include the node service + the 2 registered reflection services. assert.Equal(t, 2, len(res.Services)) } @@ -206,11 +203,6 @@ func TestNodeServer_GetHealth(t *testing.T) { input: &mockSync.Sync{IsSyncing: false}, wantedErr: "service unavailable", }, - { - name: "custom sync status", - input: &mockSync.Sync{IsSyncing: true}, - customStatus: 206, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -220,21 +212,11 @@ func TestNodeServer_GetHealth(t *testing.T) { } ethpb.RegisterNodeServer(server, ns) reflection.Register(server) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) - _, err := ns.GetHealth(ctx, ðpb.HealthRequest{SyncingStatus: tt.customStatus}) + _, err := ns.GetHealth(context.Background(), ðpb.HealthRequest{SyncingStatus: tt.customStatus}) if tt.wantedErr == "" { require.NoError(t, err) return } - if tt.customStatus != 0 { - // Assuming the call was successful, now extract the headers - headers, _ := metadata.FromIncomingContext(ctx) - // Check for the specific header - values, ok := headers["x-http-code"] - require.Equal(t, true, ok && len(values) > 0) - require.Equal(t, fmt.Sprintf("%d", tt.customStatus), values[0]) - - } require.ErrorContains(t, tt.wantedErr, err) }) } diff --git a/cmd/beacon-chain/flags/BUILD.bazel b/cmd/beacon-chain/flags/BUILD.bazel index 0dfdcd088e4c..2385a70931c2 100644 --- a/cmd/beacon-chain/flags/BUILD.bazel +++ b/cmd/beacon-chain/flags/BUILD.bazel @@ -11,7 +11,7 @@ go_library( ], importpath = "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags", visibility = [ - "//api/gateway:__pkg__", + "//api:__subpackages__", "//beacon-chain:__subpackages__", "//cmd/beacon-chain:__subpackages__", "//testing/endtoend:__subpackages__", diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index b849acba73c5..70a851fc9669 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -3,11 +3,24 @@ package flags import ( + "strings" + "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/urfave/cli/v2" ) +var ( + DefaultWebDomains = []string{"http://localhost:4200", "http://127.0.0.1:4200", "http://0.0.0.0:4200"} + DefaultHTTPServerDomains = []string{"http://localhost:7500", "http://127.0.0.1:7500", "http://0.0.0.0:7500"} + DefaultHTTPCorsDomains = func() []string { + s := []string{"http://localhost:3000", "http://0.0.0.0:3000", "http://127.0.0.1:3000"} + s = append(s, DefaultWebDomains...) + s = append(s, DefaultHTTPServerDomains...) + return s + }() +) + var ( // MevRelayEndpoint provides an HTTP access endpoint to a MEV builder network. MevRelayEndpoint = &cli.StringFlag{ @@ -118,30 +131,29 @@ var ( Usage: "Comma-separated list of API module names. Possible values: `" + PrysmAPIModule + `,` + EthAPIModule + "`.", Value: PrysmAPIModule + `,` + EthAPIModule, } - // DisableGRPCGateway for JSON-HTTP requests to the beacon node. - DisableGRPCGateway = &cli.BoolFlag{ - Name: "disable-grpc-gateway", - Usage: "Disable the gRPC gateway for JSON-HTTP requests", - } - // GRPCGatewayHost specifies a gRPC gateway host for Prysm. - GRPCGatewayHost = &cli.StringFlag{ - Name: "grpc-gateway-host", - Usage: "The host on which the gateway server runs on", - Value: "127.0.0.1", - } - // GRPCGatewayPort specifies a gRPC gateway port for Prysm. - GRPCGatewayPort = &cli.IntFlag{ - Name: "grpc-gateway-port", - Usage: "The port on which the gateway server runs on", - Value: 3500, - } - // GPRCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway. - GPRCGatewayCorsDomain = &cli.StringFlag{ - Name: "grpc-gateway-corsdomain", - Usage: "Comma separated list of domains from which to accept cross origin requests " + - "(browser enforced). This flag has no effect if not used with --grpc-gateway-port.", - Value: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", + + // HTTPServerHost specifies a HTTP server host for the validator client. + HTTPServerHost = &cli.StringFlag{ + Name: "http-host", + Usage: "Host on which the HTTP server runs on.", + Value: "127.0.0.1", + Aliases: []string{"grpc-gateway-host"}, + } + // HTTPServerPort enables a REST server port to be exposed for the validator client. + HTTPServerPort = &cli.IntFlag{ + Name: "http-port", + Usage: "Port on which the HTTP server runs on.", + Value: 3500, + Aliases: []string{"grpc-gateway-port"}, + } + // HTTPServerCorsDomain serves preflight requests when serving HTTP. + HTTPServerCorsDomain = &cli.StringFlag{ + Name: "http-cors-domain", + Usage: "Comma separated list of domains from which to accept cross origin requests.", + Value: strings.Join(DefaultHTTPCorsDomains, ", "), + Aliases: []string{"grpc-gateway-corsdomain"}, } + // MinSyncPeers specifies the required number of successful peer handshakes in order // to start syncing with external peers. MinSyncPeers = &cli.IntFlag{ diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 0f3a42547615..57eb8928ac41 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -49,10 +49,9 @@ var appFlags = []cli.Flag{ flags.CertFlag, flags.KeyFlag, flags.HTTPModules, - flags.DisableGRPCGateway, - flags.GRPCGatewayHost, - flags.GRPCGatewayPort, - flags.GPRCGatewayCorsDomain, + flags.HTTPServerHost, + flags.HTTPServerPort, + flags.HTTPServerCorsDomain, flags.MinSyncPeers, flags.ContractDeploymentBlock, flags.SetGCPercent, diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 66f7c1013f2f..5ac63e8f4baf 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -103,10 +103,9 @@ var appHelpFlagGroups = []flagGroup{ flags.CertFlag, flags.KeyFlag, flags.HTTPModules, - flags.DisableGRPCGateway, - flags.GRPCGatewayHost, - flags.GRPCGatewayPort, - flags.GPRCGatewayCorsDomain, + flags.HTTPServerHost, + flags.HTTPServerPort, + flags.HTTPServerCorsDomain, flags.ExecutionEngineEndpoint, flags.ExecutionEngineHeaders, flags.ExecutionJWTSecretFlag, diff --git a/cmd/flags.go b/cmd/flags.go index bd7d135f6a0f..6c1c44e8d947 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -6,6 +6,7 @@ import ( "math" "slices" "strings" + "time" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/urfave/cli/v2" @@ -267,10 +268,10 @@ var ( Value: DefaultDataDir(), } // ApiTimeoutFlag specifies the timeout value for API requests in seconds. A timeout of zero means no timeout. - ApiTimeoutFlag = &cli.IntFlag{ + ApiTimeoutFlag = &cli.DurationFlag{ Name: "api-timeout", Usage: "Specifies the timeout value for API requests in seconds.", - Value: 120, + Value: 10 * time.Second, } // JwtOutputFileFlag specifies the JWT file path that gets generated into when invoked by generate-jwt-secret. JwtOutputFileFlag = &cli.StringFlag{ diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index 4a13aad669e4..fbacc9ca9752 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -17,8 +17,8 @@ import ( const ( // WalletDefaultDirName for accounts. WalletDefaultDirName = "prysm-wallet-v2" - // DefaultGatewayHost for the validator client. - DefaultGatewayHost = "127.0.0.1" + // DefaultHTTPServerHost for the validator client. + DefaultHTTPServerHost = "127.0.0.1" ) var ( @@ -35,12 +35,7 @@ var ( Usage: "Beacon node RPC provider endpoint.", Value: "127.0.0.1:4000", } - // BeaconRPCGatewayProviderFlag defines a beacon node JSON-RPC endpoint. - BeaconRPCGatewayProviderFlag = &cli.StringFlag{ - Name: "beacon-rpc-gateway-provider", - Usage: "Beacon node RPC gateway provider endpoint.", - Value: "127.0.0.1:3500", - } + // BeaconRESTApiProviderFlag defines a beacon node REST API endpoint. BeaconRESTApiProviderFlag = &cli.StringFlag{ Name: "beacon-rest-api-provider", @@ -109,25 +104,27 @@ var ( Usage: `Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls. Example: --grpc-headers=key=value`, } - // GRPCGatewayHost specifies a gRPC gateway host for the validator client. - GRPCGatewayHost = &cli.StringFlag{ - Name: "grpc-gateway-host", - Usage: "Host on which the gateway server runs on.", - Value: DefaultGatewayHost, - } - // GRPCGatewayPort enables a gRPC gateway to be exposed for the validator client. - GRPCGatewayPort = &cli.IntFlag{ - Name: "grpc-gateway-port", - Usage: "Enables gRPC gateway for JSON requests.", - Value: 7500, - } - // GRPCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway. - GRPCGatewayCorsDomain = &cli.StringFlag{ - Name: "grpc-gateway-corsdomain", - Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced). - This flag has no effect if not used with --grpc-gateway-port. -`, - Value: "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000"} + // HTTPServerHost specifies a HTTP server host for the validator client. + HTTPServerHost = &cli.StringFlag{ + Name: "http-host", + Usage: "Host on which the HTTP server runs on.", + Value: DefaultHTTPServerHost, + Aliases: []string{"grpc-gateway-host"}, + } + // HTTPServerPort enables a HTTP server port to be exposed for the validator client. + HTTPServerPort = &cli.IntFlag{ + Name: "http-port", + Usage: "Port on which the HTTP server runs on.", + Value: 7500, + Aliases: []string{"grpc-gateway-port"}, + } + // HTTPServerCorsDomain adds accepted cross origin request addresses. + HTTPServerCorsDomain = &cli.StringFlag{ + Name: "corsdomain", + Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced).`, + Value: "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", + Aliases: []string{"grpc-gateway-corsdomain"}, + } // MonitoringPortFlag defines the http port used to serve prometheus metrics. MonitoringPortFlag = &cli.IntFlag{ Name: "monitoring-port", diff --git a/cmd/validator/main.go b/cmd/validator/main.go index cb0287a60c7f..1177b960a1ea 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -50,7 +50,6 @@ func startNode(ctx *cli.Context) error { var appFlags = []cli.Flag{ flags.BeaconRPCProviderFlag, - flags.BeaconRPCGatewayProviderFlag, flags.BeaconRESTApiProviderFlag, flags.CertFlag, flags.GraffitiFlag, @@ -60,12 +59,12 @@ var appFlags = []cli.Flag{ flags.EnableRPCFlag, flags.RPCHost, flags.RPCPort, - flags.GRPCGatewayPort, - flags.GRPCGatewayHost, + flags.HTTPServerPort, + flags.HTTPServerHost, flags.GRPCRetriesFlag, flags.GRPCRetryDelayFlag, flags.GRPCHeadersFlag, - flags.GRPCGatewayCorsDomain, + flags.HTTPServerCorsDomain, flags.DisableAccountMetricsFlag, flags.MonitoringPortFlag, flags.SlasherRPCProviderFlag, diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index 59f720b2f152..1341f797c037 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -96,15 +96,14 @@ var appHelpFlagGroups = []flagGroup{ Flags: []cli.Flag{ flags.CertFlag, flags.BeaconRPCProviderFlag, - flags.BeaconRPCGatewayProviderFlag, flags.EnableRPCFlag, flags.RPCHost, flags.RPCPort, - flags.GRPCGatewayPort, - flags.GRPCGatewayHost, + flags.HTTPServerPort, + flags.HTTPServerHost, flags.GRPCRetriesFlag, flags.GRPCRetryDelayFlag, - flags.GRPCGatewayCorsDomain, + flags.HTTPServerCorsDomain, flags.GRPCHeadersFlag, flags.BeaconRESTApiProviderFlag, }, diff --git a/cmd/validator/web/web.go b/cmd/validator/web/web.go index 34a4edb22ace..91c2c08c5724 100644 --- a/cmd/validator/web/web.go +++ b/cmd/validator/web/web.go @@ -24,8 +24,8 @@ var Commands = &cli.Command{ Description: `Generate an authentication token for the Prysm web interface`, Flags: cmd.WrapFlags([]cli.Flag{ flags.WalletDirFlag, - flags.GRPCGatewayHost, - flags.GRPCGatewayPort, + flags.HTTPServerHost, + flags.HTTPServerPort, flags.AuthTokenPathFlag, cmd.AcceptTosFlag, }), @@ -43,9 +43,9 @@ var Commands = &cli.Command{ if walletDirPath == "" { log.Fatal("--wallet-dir not specified") } - gatewayHost := cliCtx.String(flags.GRPCGatewayHost.Name) - gatewayPort := cliCtx.Int(flags.GRPCGatewayPort.Name) - validatorWebAddr := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) + host := cliCtx.String(flags.HTTPServerHost.Name) + port := cliCtx.Int(flags.HTTPServerPort.Name) + validatorWebAddr := fmt.Sprintf("%s:%d", host, port) authTokenPath := filepath.Join(walletDirPath, api.AuthTokenFileName) tempAuthTokenPath := cliCtx.String(flags.AuthTokenPathFlag.Name) if tempAuthTokenPath != "" { diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index 317698d1fad4..d5754bcff61c 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -1,6 +1,8 @@ package features -import "github.com/urfave/cli/v2" +import ( + "github.com/urfave/cli/v2" +) // Deprecated flags list. const deprecatedUsage = "DEPRECATED. DO NOT USE." @@ -57,6 +59,19 @@ var ( Usage: deprecatedUsage, Hidden: true, } + + deprecatedBeaconRPCGatewayProviderFlag = &cli.StringFlag{ + Name: "beacon-rpc-gateway-provider", + Usage: deprecatedUsage, + Hidden: true, + } + + deprecatedDisableGRPCGateway = &cli.BoolFlag{ + Name: "disable-grpc-gateway", + Usage: deprecatedUsage, + Hidden: true, + } + deprecatedEnableExperimentalState = &cli.BoolFlag{ Name: "enable-experimental-state", Usage: deprecatedUsage, @@ -76,6 +91,8 @@ var deprecatedFlags = []cli.Flag{ deprecatedDisableEIP4881, deprecatedVerboseSigVerification, deprecatedEnableDebugRPCEndpoints, + deprecatedBeaconRPCGatewayProviderFlag, + deprecatedDisableGRPCGateway, deprecatedEnableExperimentalState, } diff --git a/deps.bzl b/deps.bzl index da7c8c7d02ff..cd363c82bf14 100644 --- a/deps.bzl +++ b/deps.bzl @@ -94,12 +94,6 @@ def prysm_deps(): sum = "h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=", version = "v0.0.0-20161002113705-648efa622239", ) - go_repository( - name = "com_github_antihax_optional", - importpath = "github.com/antihax/optional", - sum = "h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=", - version = "v1.0.0", - ) go_repository( name = "com_github_apache_thrift", importpath = "github.com/apache/thrift", @@ -334,12 +328,6 @@ def prysm_deps(): sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", version = "v1.0.1", ) - go_repository( - name = "com_github_bgentry_go_netrc", - importpath = "github.com/bgentry/go-netrc", - sum = "h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=", - version = "v0.0.0-20140422174119-9fd32a8b3d3d", - ) go_repository( name = "com_github_bgentry_speakeasy", importpath = "github.com/bgentry/speakeasy", @@ -352,12 +340,6 @@ def prysm_deps(): sum = "h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k=", version = "v1.11.0", ) - go_repository( - name = "com_github_bketelsen_crypt", - importpath = "github.com/bketelsen/crypt", - sum = "h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc=", - version = "v0.0.3-0.20200106085610-5cbc8cc4026c", - ) go_repository( name = "com_github_bradfitz_go_smtpd", importpath = "github.com/bradfitz/go-smtpd", @@ -382,12 +364,6 @@ def prysm_deps(): sum = "h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=", version = "v1.0.1", ) - go_repository( - name = "com_github_bufbuild_buf", - importpath = "github.com/bufbuild/buf", - sum = "h1:11zJVA0D4uJVGOC9h+oOVHrKKoBgMYIqJJ0d1Xt6oeQ=", - version = "v0.37.0", - ) go_repository( name = "com_github_buger_jsonparser", importpath = "github.com/buger/jsonparser", @@ -600,23 +576,11 @@ def prysm_deps(): sum = "h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=", version = "v1.1.0", ) - go_repository( - name = "com_github_coreos_bbolt", - importpath = "github.com/coreos/bbolt", - sum = "h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s=", - version = "v1.3.2", - ) - go_repository( - name = "com_github_coreos_etcd", - importpath = "github.com/coreos/etcd", - sum = "h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=", - version = "v3.3.13+incompatible", - ) go_repository( name = "com_github_coreos_go_semver", importpath = "github.com/coreos/go-semver", - sum = "h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=", - version = "v0.3.0", + sum = "h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=", + version = "v0.2.0", ) go_repository( name = "com_github_coreos_go_systemd", @@ -633,8 +597,8 @@ def prysm_deps(): go_repository( name = "com_github_coreos_pkg", importpath = "github.com/coreos/pkg", - sum = "h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=", - version = "v0.0.0-20180928190104-399ea9e2e55f", + sum = "h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI=", + version = "v0.0.0-20160727233714-3ac0863d7acf", ) go_repository( name = "com_github_cpuguy83_go_md2man_v2", @@ -738,12 +702,6 @@ def prysm_deps(): sum = "h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=", version = "v0.0.0-20190423205320-6a90982ecee2", ) - go_repository( - name = "com_github_dgryski_go_sip13", - importpath = "github.com/dgryski/go-sip13", - sum = "h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4=", - version = "v0.0.0-20181026042036-e10d5fee7954", - ) go_repository( name = "com_github_dlclark_regexp2", importpath = "github.com/dlclark/regexp2", @@ -1230,12 +1188,6 @@ def prysm_deps(): sum = "h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=", version = "v0.8.1", ) - go_repository( - name = "com_github_gofrs_uuid", - importpath = "github.com/gofrs/uuid", - sum = "h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=", - version = "v4.0.0+incompatible", - ) go_repository( name = "com_github_gogo_googleapis", importpath = "github.com/gogo/googleapis", @@ -1416,12 +1368,6 @@ def prysm_deps(): sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", version = "v0.0.0-20181017120253-0766667cb4d1", ) - go_repository( - name = "com_github_gordonklaus_ineffassign", - importpath = "github.com/gordonklaus/ineffassign", - sum = "h1:vc7Dmrk4JwS0ZPS6WZvWlwDflgDTA26jItmbSj83nug=", - version = "v0.0.0-20200309095847-7953dde2c7bf", - ) go_repository( name = "com_github_gorilla_context", importpath = "github.com/gorilla/context", @@ -1488,20 +1434,6 @@ def prysm_deps(): sum = "h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=", version = "v1.9.5", ) - go_repository( - name = "com_github_grpc_ecosystem_grpc_gateway_v2", - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2", - patch_args = ["-p1"], - patches = [ - "//third_party:com_github_grpc_ecosystem_grpc_gateway_v2.patch", - "//third_party:com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch", - "//third_party:com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch", - ], - replace = "github.com/prysmaticlabs/grpc-gateway/v2", - repo_mapping = {"@go_googleapis": "@googleapis"}, - sum = "h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28=", - version = "v2.3.1-0.20230315201114-09284ba20446", - ) go_repository( name = "com_github_guptarohit_asciigraph", importpath = "github.com/guptarohit/asciigraph", @@ -1619,8 +1551,8 @@ def prysm_deps(): go_repository( name = "com_github_hashicorp_hcl", importpath = "github.com/hashicorp/hcl", - sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", - version = "v1.0.0", + sum = "h1:LFTfzwAUSKPijQbJrMWZm/CysECsF/U1UUniUeXxzFw=", + version = "v0.0.0-20170914154624-68e816d1c783", ) go_repository( name = "com_github_hashicorp_logutils", @@ -1833,12 +1765,6 @@ def prysm_deps(): sum = "h1:ujPKutqRlJtcfWk6toYVYagwra7HQHbXOaS171b4Tg8=", version = "v0.0.0-20150330215556-f50fe3d243e1", ) - go_repository( - name = "com_github_jhump_protoreflect", - importpath = "github.com/jhump/protoreflect", - sum = "h1:z7Ciiz3Bz37zSd485fbiTW8ABafIasyOWZI0N9EUUdo=", - version = "v1.8.1", - ) go_repository( name = "com_github_jmespath_go_jmespath", importpath = "github.com/jmespath/go-jmespath", @@ -1990,12 +1916,6 @@ def prysm_deps(): sum = "h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=", version = "v2.2.7", ) - go_repository( - name = "com_github_klauspost_pgzip", - importpath = "github.com/klauspost/pgzip", - sum = "h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=", - version = "v1.2.5", - ) go_repository( name = "com_github_klauspost_reedsolomon", importpath = "github.com/klauspost/reedsolomon", @@ -2214,8 +2134,8 @@ def prysm_deps(): go_repository( name = "com_github_magiconair_properties", importpath = "github.com/magiconair/properties", - sum = "h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=", - version = "v1.8.1", + sum = "h1:SesWF0c8l/IKQX0NlsED38qoBhUpneg5HIHNdy5LyEE=", + version = "v1.7.4-0.20170902060319-8d7837e64d3c", ) go_repository( name = "com_github_mailgun_raymond_v2", @@ -2364,8 +2284,8 @@ def prysm_deps(): go_repository( name = "com_github_mitchellh_go_homedir", importpath = "github.com/mitchellh/go-homedir", - sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", - version = "v1.1.0", + sum = "h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=", + version = "v1.0.0", ) go_repository( name = "com_github_mitchellh_go_testing_interface", @@ -2568,12 +2488,6 @@ def prysm_deps(): sum = "h1:eFXv9Nu1lGbrNbj619aWwZfVF5HBrm9Plte8aNptuTI=", version = "v0.0.0-20151028013722-8c68805598ab", ) - go_repository( - name = "com_github_nishanths_predeclared", - importpath = "github.com/nishanths/predeclared", - sum = "h1:3f0nxAmdj/VoCGN/ijdMy7bj6SBagaqYg1B0hu8clMA=", - version = "v0.0.0-20200524104333-86fad755b4d3", - ) go_repository( name = "com_github_nxadm_tail", importpath = "github.com/nxadm/tail", @@ -2598,12 +2512,6 @@ def prysm_deps(): sum = "h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=", version = "v1.0.0", ) - go_repository( - name = "com_github_oklog_ulid", - importpath = "github.com/oklog/ulid", - sum = "h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=", - version = "v1.3.1", - ) go_repository( name = "com_github_olekukonko_tablewriter", importpath = "github.com/olekukonko/tablewriter", @@ -2745,8 +2653,8 @@ def prysm_deps(): go_repository( name = "com_github_pelletier_go_toml", importpath = "github.com/pelletier/go-toml", - sum = "h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=", - version = "v1.2.0", + sum = "h1:6P7XZEBu/ZWizC/liUX4UYm4nEAACofmSkOzY39RBxM=", + version = "v1.0.1-0.20170904195809-1d6b12b7cb29", ) go_repository( name = "com_github_pelletier_go_toml_v2", @@ -2958,12 +2866,6 @@ def prysm_deps(): sum = "h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y=", version = "v1.3.0", ) - go_repository( - name = "com_github_prometheus_tsdb", - importpath = "github.com/prometheus/tsdb", - sum = "h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=", - version = "v0.7.1", - ) go_repository( name = "com_github_protolambda_bls12_381_util", importpath = "github.com/protolambda/bls12-381-util", @@ -3068,8 +2970,8 @@ def prysm_deps(): go_repository( name = "com_github_rogpeppe_fastuuid", importpath = "github.com/rogpeppe/fastuuid", - sum = "h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=", - version = "v1.2.0", + sum = "h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng=", + version = "v0.0.0-20150106093220-6724a57986af", ) go_repository( name = "com_github_rogpeppe_go_internal", @@ -3356,8 +3258,8 @@ def prysm_deps(): go_repository( name = "com_github_spf13_cast", importpath = "github.com/spf13/cast", - sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", - version = "v1.3.0", + sum = "h1:0Rhw4d6C8J9VPu6cjZLIhZ8+aAOHcDvGeKn+cq5Aq3k=", + version = "v1.1.0", ) go_repository( name = "com_github_spf13_cobra", @@ -3368,8 +3270,8 @@ def prysm_deps(): go_repository( name = "com_github_spf13_jwalterweatherman", importpath = "github.com/spf13/jwalterweatherman", - sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", - version = "v1.0.0", + sum = "h1:zBoLErXXAvWnNsu+pWkRYl6Cx1KXmIfAVsIuYkPN6aY=", + version = "v0.0.0-20170901151539-12bd96e66386", ) go_repository( name = "com_github_spf13_pflag", @@ -3380,8 +3282,8 @@ def prysm_deps(): go_repository( name = "com_github_spf13_viper", importpath = "github.com/spf13/viper", - sum = "h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=", - version = "v1.7.0", + sum = "h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I=", + version = "v1.0.0", ) go_repository( name = "com_github_stackexchange_wmi", @@ -3419,12 +3321,6 @@ def prysm_deps(): sum = "h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=", version = "v1.9.0", ) - go_repository( - name = "com_github_subosito_gotenv", - importpath = "github.com/subosito/gotenv", - sum = "h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=", - version = "v1.2.0", - ) go_repository( name = "com_github_syndtr_goleveldb", importpath = "github.com/syndtr/goleveldb", @@ -3500,8 +3396,8 @@ def prysm_deps(): go_repository( name = "com_github_tmc_grpc_websocket_proxy", importpath = "github.com/tmc/grpc-websocket-proxy", - sum = "h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=", - version = "v0.0.0-20190109142713-0ad062ec5ee5", + sum = "h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE=", + version = "v0.0.0-20170815181823-89b8d40f7ca8", ) go_repository( name = "com_github_trailofbits_go_mutexasserts", @@ -3509,12 +3405,6 @@ def prysm_deps(): sum = "h1:+LynomhWB+14Plp/bOONEAZCtvCZk4leRbTvNzNVkL0=", version = "v0.0.0-20230328101604-8cdbc5f3d279", ) - go_repository( - name = "com_github_twitchtv_twirp", - importpath = "github.com/twitchtv/twirp", - sum = "h1:3fNSDoSPyq+fTrifIvGue9XM/tptzuhiGY83rxPVNUg=", - version = "v7.1.0+incompatible", - ) go_repository( name = "com_github_tyler_smith_go_bip39", importpath = "github.com/tyler-smith/go-bip39", @@ -4777,12 +4667,6 @@ def prysm_deps(): sum = "h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=", version = "v1.56.3", ) - go_repository( - name = "org_golang_google_grpc_cmd_protoc_gen_go_grpc", - importpath = "google.golang.org/grpc/cmd/protoc-gen-go-grpc", - sum = "h1:lQ+dE99pFsb8osbJB3oRfE5eW4Hx6a/lZQr8Jh+eoT4=", - version = "v1.0.0", - ) go_repository( name = "org_golang_google_protobuf", importpath = "google.golang.org/protobuf", diff --git a/go.mod b/go.mod index 482659fb5423..19a28a16ffc1 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,6 @@ require ( github.com/gostaticanalysis/comment v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e github.com/holiman/uint256 v1.2.4 @@ -281,6 +280,3 @@ require ( ) replace github.com/json-iterator/go => github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b - -// See https://github.com/prysmaticlabs/grpc-gateway/issues/2 -replace github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 diff --git a/go.sum b/go.sum index c15dec2fca65..18b359a993ba 100644 --- a/go.sum +++ b/go.sum @@ -31,7 +31,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -93,7 +92,6 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= @@ -119,18 +117,15 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.11.0 h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k= github.com/bits-and-blooms/bitset v1.11.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/bufbuild/buf v0.37.0/go.mod h1:lQ1m2HkIaGOFba6w/aC3KYBHhKEOESP3gaAEpS3dAFM= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -181,20 +176,15 @@ github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5U github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= @@ -225,7 +215,6 @@ github.com/dgraph-io/ristretto v0.0.4-0.20210318174700-74754f61e018/go.mod h1:MI github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= @@ -260,7 +249,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= @@ -354,10 +342,8 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -370,10 +356,7 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c h1:HoqgYR60VYu5+0BuG6pjeGp7LKEPZnHt+dUClx9PeIs= github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c/go.mod h1:sam69Hju0uq+5uvLJUMDlsKlQ21Vrs1Kd/1YFPNYdOU= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= @@ -404,7 +387,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -472,14 +454,12 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= @@ -489,18 +469,14 @@ github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY4 github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= @@ -525,7 +501,6 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:i github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -573,7 +548,6 @@ github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/U github.com/jedib0t/go-pretty/v6 v6.5.4 h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/5l91s= github.com/jedib0t/go-pretty/v6 v6.5.4/go.mod h1:5LQIxa52oJ/DlDSLv0HEkWOFMDGoWkJb9ss5KqPpJBg= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/jhump/protoreflect v1.8.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d h1:k+SfYbN66Ev/GDVq39wYOXVW5RNd5kzzairbCe9dK5Q= @@ -597,13 +571,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -667,7 +639,6 @@ github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+L github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.7.4-0.20170902060319-8d7837e64d3c/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -726,7 +697,6 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -790,14 +760,12 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= @@ -853,7 +821,6 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.2.0 h1:w/UPXyl5GfahFxcTOz2j9wCIHNI+pUPr2laqpojKNCg= @@ -913,7 +880,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -925,7 +891,6 @@ github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b/go.mod h1:KdQU github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= @@ -942,9 +907,7 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= @@ -955,7 +918,6 @@ github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5E github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= @@ -965,7 +927,6 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk= github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2OlIZD/M6wFvV3YMZbW16lFgh3Rsye00G44J2cwLyU= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= @@ -973,8 +934,6 @@ github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks= github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY= -github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28= -github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446/go.mod h1:IOyTYjcIO0rkmnGBfJTL0NJ11exy/Tc2QEuv7hCXp24= github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c h1:9PHRCuO/VN0s9k+RmLykho7AjDxblNYI5bYKed16NPU= github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c/go.mod h1:ZRws458tYHS/Zs936OQ6oCrL+Ict5O4Xpwve1UQ6C9M= github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU= @@ -993,7 +952,6 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -1053,24 +1011,18 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.1-0.20201006035406-b97b5ead31f7/go.mod h1:yk5b0mALVusDL5fMM6Rd1wgnoO5jUPhwsQ6LQAJTidQ= github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1097,7 +1049,6 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= @@ -1115,10 +1066,8 @@ github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5I github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279 h1:+LynomhWB+14Plp/bOONEAZCtvCZk4leRbTvNzNVkL0= github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279/go.mod h1:GA3+Mq3kt3tYAfM0WZCu7ofy+GW9PuGysHfhr+6JX7s= -github.com/twitchtv/twirp v7.1.0+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= @@ -1160,7 +1109,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= @@ -1175,14 +1123,12 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -1197,14 +1143,12 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= @@ -1361,7 +1305,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= @@ -1546,7 +1489,6 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1570,10 +1512,8 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1679,14 +1619,12 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210426193834-eac7f76ac494/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1712,14 +1650,11 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0-dev.0.20201218190559-666aea1fb34c/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1730,8 +1665,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8/go.mod h1:hFxJC2f0epmp1elRCiEGJTKAWbwxZ2nvqZdHl3FQXCY= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= @@ -1751,7 +1684,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= diff --git a/hack/interop_start.sh b/hack/interop_start.sh index e6655f6d530a..dd2d4a08c985 100755 --- a/hack/interop_start.sh +++ b/hack/interop_start.sh @@ -86,7 +86,7 @@ echo -n "$IDENTITY" > /tmp/id.key BEACON_FLAGS="--bootstrap-node= \ --deposit-contract=0xD775140349E6A5D12524C6ccc3d6A1d4519D4029 \ --p2p-port=$PORT \ - --grpc-gateway-port=$RPCPORT \ + --http-port=$RPCPORT \ --peer=$PEERS \ --interop-genesis-state=$GEN_STATE \ --p2p-priv-key=/tmp/id.key \ diff --git a/proto/eth/v1/BUILD.bazel b/proto/eth/v1/BUILD.bazel index 670f614a9ba9..af9c03a76e4c 100644 --- a/proto/eth/v1/BUILD.bazel +++ b/proto/eth/v1/BUILD.bazel @@ -84,24 +84,13 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v1", - protos = [":proto"], - visibility = ["//proto:__subpackages__"], -) - go_library( name = "go_default_library", srcs = [ ":ssz_generated_files", ], embed = [ - ":go_grpc_gateway_library", + ":go_proto", ], importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v1", visibility = ["//visibility:public"], diff --git a/proto/eth/v1/README.md b/proto/eth/v1/README.md deleted file mode 100644 index af9cfcca7034..000000000000 --- a/proto/eth/v1/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# gRPC Gateway - -This package is contains generated files for applications that wish to use eth/v1alpha as a -[gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway). \ No newline at end of file diff --git a/proto/eth/v2/BUILD.bazel b/proto/eth/v2/BUILD.bazel index f5a6728a6e9f..1e8dab8675d2 100644 --- a/proto/eth/v2/BUILD.bazel +++ b/proto/eth/v2/BUILD.bazel @@ -73,23 +73,12 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v2", - protos = [":proto"], - visibility = ["//proto:__subpackages__"], -) - go_library( name = "go_default_library", srcs = [ ":ssz_generated_files", ], - embed = [":go_grpc_gateway_library"], + embed = [":go_proto"], importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v2", visibility = ["//visibility:public"], deps = SSZ_DEPS, diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 7056133ec320..ddb843cddffa 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -32,7 +32,6 @@ proto_library( deps = [ "//proto/engine/v1:proto", "//proto/eth/ext:proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//:empty_proto", @@ -267,7 +266,6 @@ go_proto_library( "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", @@ -281,29 +279,6 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1", - protos = [":proto"], - visibility = ["//visibility:private"], - deps = [ - "//proto/engine/v1:go_default_library", - "//proto/eth/ext:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@googleapis//google/api:annotations_go_proto", - "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", - "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", - "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", - "@org_golang_google_protobuf//types/descriptorpb:go_default_library", - "@org_golang_google_protobuf//types/known/emptypb:go_default_library", - ], -) - go_library( name = "go_default_library", srcs = [ @@ -321,9 +296,7 @@ go_library( ":ssz_generated_non_core", # keep ":ssz_generated_phase0", # keep ], - embed = [ - ":go_grpc_gateway_library", - ], + embed = [":go_proto"], importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1", visibility = ["//visibility:public"], deps = SSZ_DEPS + [ @@ -332,11 +305,9 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "//runtime/version:go_default_library", + "//consensus-types/primitives:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", @@ -347,6 +318,7 @@ go_library( "@org_golang_google_grpc//grpclog:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//status:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", "@org_golang_google_protobuf//runtime/protoimpl:go_default_library", "@org_golang_google_protobuf//types/descriptorpb:go_default_library", diff --git a/proto/prysm/v1alpha1/README.md b/proto/prysm/v1alpha1/README.md deleted file mode 100644 index af9cfcca7034..000000000000 --- a/proto/prysm/v1alpha1/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# gRPC Gateway - -This package is contains generated files for applications that wish to use eth/v1alpha as a -[gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway). \ No newline at end of file diff --git a/proto/prysm/v1alpha1/attestation.pb.gw.go b/proto/prysm/v1alpha1/attestation.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/attestation.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/beacon_block.pb.gw.go b/proto/prysm/v1alpha1/beacon_block.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/beacon_block.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go deleted file mode 100755 index a7f81408911e..000000000000 --- a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go +++ /dev/null @@ -1,1862 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/beacon_chain.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -var ( - filter_BeaconChain_ListAttestations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListAttestations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListAttestations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListAttestations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListAttestations(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListAttestationsElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListIndexedAttestations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListIndexedAttestations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListIndexedAttestations(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListIndexedAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListIndexedAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListIndexedAttestationsElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_AttestationPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_AttestationPool_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPool_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AttestationPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_AttestationPool_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPool_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AttestationPool(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_AttestationPoolElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AttestationPoolElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AttestationPoolElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListBeaconBlocks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListBeaconBlocks_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListBlocksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconBlocks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListBeaconBlocks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListBeaconBlocks_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListBlocksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconBlocks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListBeaconBlocks(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetChainHead(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetChainHead(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListBeaconCommittees_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListBeaconCommittees_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListCommitteesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconCommittees_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListBeaconCommittees(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListBeaconCommittees_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListCommitteesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconCommittees_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListBeaconCommittees(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListValidatorBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListValidatorBalances_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorBalancesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListValidatorBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListValidatorBalances_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorBalancesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListValidatorBalances(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListValidators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListValidators_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidators_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListValidators_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidators_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListValidators(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidator_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidator_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidator_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidator_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidator_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidator(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidatorActiveSetChanges_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidatorActiveSetChanges_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorActiveSetChangesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorActiveSetChanges_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorActiveSetChanges(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorActiveSetChanges_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorActiveSetChangesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorActiveSetChanges_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorActiveSetChanges(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconChain_GetValidatorQueue_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetValidatorQueue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorQueue_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetValidatorQueue(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidatorPerformance_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidatorPerformance_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorPerformanceRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorPerformance_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorPerformance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorPerformance_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorPerformanceRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorPerformance_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorPerformance(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListValidatorAssignments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListValidatorAssignments_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorAssignmentsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorAssignments_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListValidatorAssignments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListValidatorAssignments_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorAssignmentsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorAssignments_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListValidatorAssignments(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidatorParticipation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidatorParticipation_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorParticipationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorParticipation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorParticipation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorParticipation_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorParticipationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorParticipation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorParticipation(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconChain_GetBeaconConfig_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetBeaconConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetBeaconConfig_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetBeaconConfig(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_SubmitAttesterSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_SubmitAttesterSlashing_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAttesterSlashing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_SubmitAttesterSlashing_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAttesterSlashing(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_SubmitAttesterSlashingElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashingElectra - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAttesterSlashingElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashingElectra - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAttesterSlashingElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_SubmitProposerSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_SubmitProposerSlashing_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ProposerSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitProposerSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitProposerSlashing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_SubmitProposerSlashing_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ProposerSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitProposerSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitProposerSlashing(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetIndividualVotes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetIndividualVotes_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq IndividualVotesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetIndividualVotes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetIndividualVotes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetIndividualVotes_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq IndividualVotesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetIndividualVotes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetIndividualVotes(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterBeaconChainHandlerServer registers the http handlers for service BeaconChain to "mux". -// UnaryRPC :call BeaconChainServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBeaconChainHandlerFromEndpoint instead. -func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BeaconChainServer) error { - - mux.Handle("GET", pattern_BeaconChain_ListAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListAttestations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListIndexedAttestations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPool") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_AttestationPool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconBlocks") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListBeaconBlocks_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetChainHead_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetChainHead_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconCommittees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListBeaconCommittees_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconCommittees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListValidatorBalances_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListValidators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidator") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidator_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorActiveSetChanges_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorActiveSetChanges_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorActiveSetChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorQueue_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorPerformance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorPerformance_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorPerformance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorAssignments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListValidatorAssignments_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorAssignments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorParticipation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorParticipation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorParticipation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetBeaconConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetBeaconConfig_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetBeaconConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_SubmitAttesterSlashing_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_SubmitProposerSlashing_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitProposerSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetIndividualVotes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetIndividualVotes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetIndividualVotes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterBeaconChainHandlerFromEndpoint is same as RegisterBeaconChainHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterBeaconChainHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterBeaconChainHandler(ctx, mux, conn) -} - -// RegisterBeaconChainHandler registers the http handlers for service BeaconChain to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterBeaconChainHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterBeaconChainHandlerClient(ctx, mux, NewBeaconChainClient(conn)) -} - -// RegisterBeaconChainHandlerClient registers the http handlers for service BeaconChain -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BeaconChainClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BeaconChainClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "BeaconChainClient" to call the correct interceptors. -func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BeaconChainClient) error { - - mux.Handle("GET", pattern_BeaconChain_ListAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListAttestations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListIndexedAttestations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPool") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_AttestationPool_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconBlocks") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListBeaconBlocks_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetChainHead_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetChainHead_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconCommittees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListBeaconCommittees_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconCommittees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListValidatorBalances_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListValidators_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidator") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidator_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorActiveSetChanges_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorActiveSetChanges_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorActiveSetChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorQueue_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorPerformance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorPerformance_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorPerformance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorAssignments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListValidatorAssignments_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorAssignments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorParticipation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorParticipation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorParticipation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetBeaconConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetBeaconConfig_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetBeaconConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_SubmitAttesterSlashing_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_SubmitProposerSlashing_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitProposerSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetIndividualVotes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetIndividualVotes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetIndividualVotes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_BeaconChain_ListAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations"}, "")) - - pattern_BeaconChain_ListAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations_electra"}, "")) - - pattern_BeaconChain_ListIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed"}, "")) - - pattern_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed_electra"}, "")) - - pattern_BeaconChain_AttestationPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool"}, "")) - - pattern_BeaconChain_AttestationPoolElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool_electra"}, "")) - - pattern_BeaconChain_ListBeaconBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "beacon", "blocks"}, "")) - - pattern_BeaconChain_GetChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "chainhead"}, "")) - - pattern_BeaconChain_ListBeaconCommittees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "committees"}, "")) - - pattern_BeaconChain_ListValidatorBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "balances"}, "")) - - pattern_BeaconChain_ListValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"eth", "v1alpha1", "validators"}, "")) - - pattern_BeaconChain_GetValidator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"eth", "v1alpha1", "validator"}, "")) - - pattern_BeaconChain_GetValidatorActiveSetChanges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "activesetchanges"}, "")) - - pattern_BeaconChain_GetValidatorQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "queue"}, "")) - - pattern_BeaconChain_GetValidatorPerformance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "performance"}, "")) - - pattern_BeaconChain_ListValidatorAssignments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "assignments"}, "")) - - pattern_BeaconChain_GetValidatorParticipation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "participation"}, "")) - - pattern_BeaconChain_GetBeaconConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "config"}, "")) - - pattern_BeaconChain_SubmitAttesterSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit"}, "")) - - pattern_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit_electra"}, "")) - - pattern_BeaconChain_SubmitProposerSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "proposer", "submit"}, "")) - - pattern_BeaconChain_GetIndividualVotes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "individual_votes"}, "")) -) - -var ( - forward_BeaconChain_ListAttestations_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListAttestationsElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListIndexedAttestations_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_AttestationPool_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_AttestationPoolElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListBeaconBlocks_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetChainHead_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListBeaconCommittees_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListValidatorBalances_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListValidators_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidator_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorActiveSetChanges_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorQueue_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorPerformance_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListValidatorAssignments_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorParticipation_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetBeaconConfig_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_SubmitAttesterSlashing_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_SubmitProposerSlashing_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetIndividualVotes_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/beacon_chain.proto b/proto/prysm/v1alpha1/beacon_chain.proto index b6d24cb4d5ec..7cfc1b113444 100644 --- a/proto/prysm/v1alpha1/beacon_chain.proto +++ b/proto/prysm/v1alpha1/beacon_chain.proto @@ -288,7 +288,6 @@ message ListIndexedAttestationsRequest { // Request for attestations. message ListAttestationsRequest { - // TODO(preston): Test oneof with gRPC gateway. oneof query_filter { // Filter attestations by epoch processed. diff --git a/proto/prysm/v1alpha1/beacon_state.pb.gw.go b/proto/prysm/v1alpha1/beacon_state.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/beacon_state.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/blobs.pb.gw.go b/proto/prysm/v1alpha1/blobs.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/blobs.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/debug.pb.gw.go b/proto/prysm/v1alpha1/debug.pb.gw.go deleted file mode 100755 index 750a64dc7280..000000000000 --- a/proto/prysm/v1alpha1/debug.pb.gw.go +++ /dev/null @@ -1,487 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/debug.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -var ( - filter_Debug_GetBeaconState_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_GetBeaconState_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BeaconStateRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBeaconState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetBeaconState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_GetBeaconState_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BeaconStateRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBeaconState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetBeaconState(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Debug_GetBlock_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_GetBlock_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequestByRoot - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_GetBlock_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequestByRoot - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetBlock(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Debug_SetLoggingLevel_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_SetLoggingLevel_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoggingLevelRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_SetLoggingLevel_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SetLoggingLevel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_SetLoggingLevel_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoggingLevelRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_SetLoggingLevel_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SetLoggingLevel(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Debug_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.ListPeers(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Debug_GetPeer_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPeer(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterDebugHandlerServer registers the http handlers for service Debug to "mux". -// UnaryRPC :call DebugServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDebugHandlerFromEndpoint instead. -func RegisterDebugHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DebugServer) error { - - mux.Handle("GET", pattern_Debug_GetBeaconState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBeaconState") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_GetBeaconState_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBeaconState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_GetBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Debug_SetLoggingLevel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/SetLoggingLevel") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_SetLoggingLevel_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_SetLoggingLevel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_ListPeers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_GetPeer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterDebugHandlerFromEndpoint is same as RegisterDebugHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDebugHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterDebugHandler(ctx, mux, conn) -} - -// RegisterDebugHandler registers the http handlers for service Debug to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterDebugHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDebugHandlerClient(ctx, mux, NewDebugClient(conn)) -} - -// RegisterDebugHandlerClient registers the http handlers for service Debug -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DebugClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DebugClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DebugClient" to call the correct interceptors. -func RegisterDebugHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugClient) error { - - mux.Handle("GET", pattern_Debug_GetBeaconState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBeaconState") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_GetBeaconState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBeaconState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_GetBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Debug_SetLoggingLevel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/SetLoggingLevel") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_SetLoggingLevel_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_SetLoggingLevel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_ListPeers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_GetPeer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Debug_GetBeaconState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "state"}, "")) - - pattern_Debug_GetBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "block"}, "")) - - pattern_Debug_SetLoggingLevel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "logging"}, "")) - - pattern_Debug_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peers"}, "")) - - pattern_Debug_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peer"}, "")) -) - -var ( - forward_Debug_GetBeaconState_0 = runtime.ForwardResponseMessage - - forward_Debug_GetBlock_0 = runtime.ForwardResponseMessage - - forward_Debug_SetLoggingLevel_0 = runtime.ForwardResponseMessage - - forward_Debug_ListPeers_0 = runtime.ForwardResponseMessage - - forward_Debug_GetPeer_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/eip_7251.pb.gw.go b/proto/prysm/v1alpha1/eip_7251.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/eip_7251.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go b/proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/health.pb.gw.go b/proto/prysm/v1alpha1/health.pb.gw.go deleted file mode 100755 index 099b72831001..000000000000 --- a/proto/prysm/v1alpha1/health.pb.gw.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/health.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -func request_Health_StreamBeaconLogs_0(ctx context.Context, marshaler runtime.Marshaler, client HealthClient, req *http.Request, pathParams map[string]string) (Health_StreamBeaconLogsClient, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - stream, err := client.StreamBeaconLogs(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -// RegisterHealthHandlerServer registers the http handlers for service Health to "mux". -// UnaryRPC :call HealthServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHealthHandlerFromEndpoint instead. -func RegisterHealthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthServer) error { - - mux.Handle("GET", pattern_Health_StreamBeaconLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - return nil -} - -// RegisterHealthHandlerFromEndpoint is same as RegisterHealthHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterHealthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterHealthHandler(ctx, mux, conn) -} - -// RegisterHealthHandler registers the http handlers for service Health to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterHealthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterHealthHandlerClient(ctx, mux, NewHealthClient(conn)) -} - -// RegisterHealthHandlerClient registers the http handlers for service Health -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "HealthClient" to call the correct interceptors. -func RegisterHealthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthClient) error { - - mux.Handle("GET", pattern_Health_StreamBeaconLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Health/StreamBeaconLogs") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Health_StreamBeaconLogs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Health_StreamBeaconLogs_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Health_StreamBeaconLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "health", "logs", "stream"}, "")) -) - -var ( - forward_Health_StreamBeaconLogs_0 = runtime.ForwardResponseStream -) diff --git a/proto/prysm/v1alpha1/node.pb.gw.go b/proto/prysm/v1alpha1/node.pb.gw.go deleted file mode 100755 index 104633765f54..000000000000 --- a/proto/prysm/v1alpha1/node.pb.gw.go +++ /dev/null @@ -1,711 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/node.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -func request_Node_GetSyncStatus_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetSyncStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetSyncStatus_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetSyncStatus(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetGenesis_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetGenesis(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetGenesis_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetGenesis(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetVersion(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Node_GetHealth_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Node_GetHealth_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq HealthRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetHealth_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetHealth(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetHealth_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq HealthRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetHealth_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetHealth(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_ListImplementedServices_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.ListImplementedServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_ListImplementedServices_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.ListImplementedServices(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetHost_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetHost(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetHost_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetHost(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Node_GetPeer_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Node_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPeer(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.ListPeers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetETH1ConnectionStatus_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetETH1ConnectionStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetETH1ConnectionStatus_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetETH1ConnectionStatus(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterNodeHandlerServer registers the http handlers for service Node to "mux". -// UnaryRPC :call NodeServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeHandlerFromEndpoint instead. -func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeServer) error { - - mux.Handle("GET", pattern_Node_GetSyncStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetSyncStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetSyncStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetGenesis_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetGenesis_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetGenesis_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetVersion_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHealth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHealth") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetHealth_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListImplementedServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListImplementedServices") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_ListImplementedServices_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListImplementedServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHost") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetHost_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetPeer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_ListPeers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetETH1ConnectionStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetETH1ConnectionStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetETH1ConnectionStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetETH1ConnectionStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterNodeHandlerFromEndpoint is same as RegisterNodeHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterNodeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterNodeHandler(ctx, mux, conn) -} - -// RegisterNodeHandler registers the http handlers for service Node to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterNodeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterNodeHandlerClient(ctx, mux, NewNodeClient(conn)) -} - -// RegisterNodeHandlerClient registers the http handlers for service Node -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "NodeClient" to call the correct interceptors. -func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeClient) error { - - mux.Handle("GET", pattern_Node_GetSyncStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetSyncStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetSyncStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetGenesis_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetGenesis_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetGenesis_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHealth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHealth") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetHealth_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListImplementedServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListImplementedServices") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_ListImplementedServices_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListImplementedServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHost") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetHost_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetPeer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_ListPeers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetETH1ConnectionStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetETH1ConnectionStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetETH1ConnectionStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetETH1ConnectionStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Node_GetSyncStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "syncing"}, "")) - - pattern_Node_GetGenesis_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "genesis"}, "")) - - pattern_Node_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "version"}, "")) - - pattern_Node_GetHealth_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "health"}, "")) - - pattern_Node_ListImplementedServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "services"}, "")) - - pattern_Node_GetHost_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "p2p"}, "")) - - pattern_Node_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "peer"}, "")) - - pattern_Node_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "peers"}, "")) - - pattern_Node_GetETH1ConnectionStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "node", "eth1", "connections"}, "")) -) - -var ( - forward_Node_GetSyncStatus_0 = runtime.ForwardResponseMessage - - forward_Node_GetGenesis_0 = runtime.ForwardResponseMessage - - forward_Node_GetVersion_0 = runtime.ForwardResponseMessage - - forward_Node_GetHealth_0 = runtime.ForwardResponseMessage - - forward_Node_ListImplementedServices_0 = runtime.ForwardResponseMessage - - forward_Node_GetHost_0 = runtime.ForwardResponseMessage - - forward_Node_GetPeer_0 = runtime.ForwardResponseMessage - - forward_Node_ListPeers_0 = runtime.ForwardResponseMessage - - forward_Node_GetETH1ConnectionStatus_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/p2p_messages.pb.gw.go b/proto/prysm/v1alpha1/p2p_messages.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/p2p_messages.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/powchain.pb.gw.go b/proto/prysm/v1alpha1/powchain.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/powchain.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/slasher.pb.gw.go b/proto/prysm/v1alpha1/slasher.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/slasher.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/sync_committee.pb.gw.go b/proto/prysm/v1alpha1/sync_committee.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/sync_committee.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/validator-client/BUILD.bazel b/proto/prysm/v1alpha1/validator-client/BUILD.bazel index bd4607d598bc..df99b795100a 100644 --- a/proto/prysm/v1alpha1/validator-client/BUILD.bazel +++ b/proto/prysm/v1alpha1/validator-client/BUILD.bazel @@ -11,11 +11,6 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") -############################################################################## -# OpenAPI (Swagger) V2 -############################################################################## -load("@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2:defs.bzl", "protoc_gen_openapiv2") - proto_library( name = "proto", srcs = [ @@ -25,7 +20,6 @@ proto_library( deps = [ "//proto/eth/ext:proto", "//proto/prysm/v1alpha1:proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//:empty_proto", @@ -49,7 +43,6 @@ go_proto_library( "//proto/eth/ext:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", @@ -63,35 +56,13 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client", - protos = [":proto"], - visibility = ["//visibility:private"], - deps = [ - "//proto/eth/ext:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@googleapis//google/api:annotations_go_proto", - "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", - "@io_bazel_rules_go//proto/wkt:empty_go_proto", - "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", - "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", - ], -) - go_library( name = "go_default_library", srcs = [ "interface.go", ], embed = [ - ":go_grpc_gateway_library", + ":go_proto", ], importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client", visibility = ["//visibility:public"], @@ -99,9 +70,6 @@ go_library( "//proto/eth/ext:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/validator.pb.gw.go b/proto/prysm/v1alpha1/validator.pb.gw.go deleted file mode 100755 index a045a335ef21..000000000000 --- a/proto/prysm/v1alpha1/validator.pb.gw.go +++ /dev/null @@ -1,2506 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/validator.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -var ( - filter_BeaconNodeValidator_GetDuties_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetDuties_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DutiesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetDuties_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetDuties(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetDuties_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DutiesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetDuties_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetDuties(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_DomainData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_DomainData_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DomainRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_DomainData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DomainData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_DomainData_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DomainRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_DomainData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DomainData(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_WaitForChainStart_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_WaitForChainStartClient, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - stream, err := client.WaitForChainStart(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -var ( - filter_BeaconNodeValidator_WaitForActivation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_WaitForActivation_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_WaitForActivationClient, runtime.ServerMetadata, error) { - var protoReq ValidatorActivationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_WaitForActivation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - stream, err := client.WaitForActivation(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -var ( - filter_BeaconNodeValidator_ValidatorIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_ValidatorIndex_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatorIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ValidatorIndex_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatorIndex(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_ValidatorStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_ValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatorStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatorStatus(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_MultipleValidatorStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_MultipleValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MultipleValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_MultipleValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.MultipleValidatorStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_MultipleValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MultipleValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_MultipleValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.MultipleValidatorStatus(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_GetBeaconBlock_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetBeaconBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetBeaconBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetBeaconBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetBeaconBlock(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GenericSignedBeaconBlock - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeBeaconBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GenericSignedBeaconBlock - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeBeaconBlock(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_PrepareBeaconProposer_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PrepareBeaconProposerRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PrepareBeaconProposer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_PrepareBeaconProposer_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PrepareBeaconProposerRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.PrepareBeaconProposer(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq FeeRecipientByPubKeyRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetFeeRecipientByPubKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq FeeRecipientByPubKeyRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetFeeRecipientByPubKey(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_GetAttestationData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetAttestationData_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetAttestationData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetAttestationData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetAttestationData_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetAttestationData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetAttestationData(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeAttestation_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Attestation - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeAttestation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeAttestation_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Attestation - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeAttestation(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeAttestationElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationElectra - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeAttestationElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeAttestationElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationElectra - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeAttestationElectra(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregateSelectionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAggregateSelectionProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregateSelectionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAggregateSelectionProof(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregateSelectionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAggregateSelectionProofElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregateSelectionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAggregateSelectionProofElectra(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedAggregateSubmitRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSignedAggregateSelectionProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedAggregateSubmitRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSignedAggregateSelectionProof(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedAggregateSubmitElectraRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSignedAggregateSelectionProofElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedAggregateSubmitElectraRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSignedAggregateSelectionProofElectra(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeExit_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedVoluntaryExit - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeExit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeExit_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedVoluntaryExit - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeExit(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommitteeSubnetsSubscribeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubscribeCommitteeSubnets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommitteeSubnetsSubscribeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubscribeCommitteeSubnets(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_CheckDoppelGanger_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_CheckDoppelGanger_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DoppelGangerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_CheckDoppelGanger_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CheckDoppelGanger(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_CheckDoppelGanger_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DoppelGangerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_CheckDoppelGanger_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CheckDoppelGanger(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetSyncMessageBlockRoot(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetSyncMessageBlockRoot(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSyncMessage_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeMessage - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSyncMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSyncMessage_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeMessage - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSyncMessage(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_GetSyncSubcommitteeIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncSubcommitteeIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetSyncSubcommitteeIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetSyncSubcommitteeIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncSubcommitteeIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetSyncSubcommitteeIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetSyncSubcommitteeIndex(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeContributionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetSyncCommitteeContribution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeContributionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetSyncCommitteeContribution(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedContributionAndProof - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSignedContributionAndProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedContributionAndProof - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSignedContributionAndProof(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_StreamSlots_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_StreamSlots_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_StreamSlotsClient, runtime.ServerMetadata, error) { - var protoReq StreamSlotsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_StreamSlots_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - stream, err := client.StreamSlots(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -var ( - filter_BeaconNodeValidator_StreamBlocksAltair_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_StreamBlocksAltair_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_StreamBlocksAltairClient, runtime.ServerMetadata, error) { - var protoReq StreamBlocksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_StreamBlocksAltair_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - stream, err := client.StreamBlocksAltair(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -func request_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedValidatorRegistrationsV1 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitValidatorRegistrations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedValidatorRegistrationsV1 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitValidatorRegistrations(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AssignValidatorToSubnetRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AssignValidatorToSubnet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AssignValidatorToSubnetRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AssignValidatorToSubnet(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_AggregatedSigAndAggregationBits_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregatedSigAndAggregationBitsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_AggregatedSigAndAggregationBits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AggregatedSigAndAggregationBits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregatedSigAndAggregationBitsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_AggregatedSigAndAggregationBits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AggregatedSigAndAggregationBits(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterBeaconNodeValidatorHandlerServer registers the http handlers for service BeaconNodeValidator to "mux". -// UnaryRPC :call BeaconNodeValidatorServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBeaconNodeValidatorHandlerFromEndpoint instead. -func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BeaconNodeValidatorServer) error { - - mux.Handle("GET", pattern_BeaconNodeValidator_GetDuties_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetDuties_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/DomainData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_DomainData_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_DomainData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForChainStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForActivation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ValidatorIndex_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ValidatorStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_MultipleValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/MultipleValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_MultipleValidatorStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_MultipleValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetBeaconBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeBeaconBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_PrepareBeaconProposer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/PrepareBeaconProposer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_PrepareBeaconProposer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_PrepareBeaconProposer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetFeeRecipientByPubKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetAttestationData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetAttestationData_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetAttestationData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeAttestation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeAttestation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestationElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestationElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeAttestationElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeAttestationElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProofElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProofElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeExit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeExit_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeExit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubscribeCommitteeSubnets") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_CheckDoppelGanger_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/CheckDoppelGanger") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_CheckDoppelGanger_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_CheckDoppelGanger_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncMessageBlockRoot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSyncMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSyncMessage") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSyncMessage_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSyncMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncSubcommitteeIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetSyncCommitteeContribution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetSyncCommitteeContribution_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedContributionAndProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedContributionAndProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamSlots_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamBlocksAltair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitValidatorRegistrations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_AssignValidatorToSubnet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AssignValidatorToSubnet") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_AssignValidatorToSubnet_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_AggregatedSigAndAggregationBits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AggregatedSigAndAggregationBits") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterBeaconNodeValidatorHandlerFromEndpoint is same as RegisterBeaconNodeValidatorHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterBeaconNodeValidatorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterBeaconNodeValidatorHandler(ctx, mux, conn) -} - -// RegisterBeaconNodeValidatorHandler registers the http handlers for service BeaconNodeValidator to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterBeaconNodeValidatorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterBeaconNodeValidatorHandlerClient(ctx, mux, NewBeaconNodeValidatorClient(conn)) -} - -// RegisterBeaconNodeValidatorHandlerClient registers the http handlers for service BeaconNodeValidator -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BeaconNodeValidatorClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BeaconNodeValidatorClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "BeaconNodeValidatorClient" to call the correct interceptors. -func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BeaconNodeValidatorClient) error { - - mux.Handle("GET", pattern_BeaconNodeValidator_GetDuties_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetDuties_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/DomainData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_DomainData_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_DomainData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForChainStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForChainStart") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_WaitForChainStart_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_WaitForChainStart_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForActivation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForActivation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_WaitForActivation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_WaitForActivation_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ValidatorIndex_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ValidatorStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_MultipleValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/MultipleValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_MultipleValidatorStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_MultipleValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetBeaconBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeBeaconBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_PrepareBeaconProposer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/PrepareBeaconProposer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_PrepareBeaconProposer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_PrepareBeaconProposer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetFeeRecipientByPubKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetAttestationData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetAttestationData_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetAttestationData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeAttestation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeAttestation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestationElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestationElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeAttestationElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeAttestationElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProofElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProofElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeExit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeExit_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeExit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubscribeCommitteeSubnets") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_CheckDoppelGanger_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/CheckDoppelGanger") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_CheckDoppelGanger_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_CheckDoppelGanger_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncMessageBlockRoot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSyncMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSyncMessage") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSyncMessage_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSyncMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncSubcommitteeIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetSyncCommitteeContribution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetSyncCommitteeContribution_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedContributionAndProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedContributionAndProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamSlots_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/StreamSlots") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_StreamSlots_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_StreamSlots_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamBlocksAltair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/StreamBlocksAltair") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_StreamBlocksAltair_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_StreamBlocksAltair_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitValidatorRegistrations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_AssignValidatorToSubnet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AssignValidatorToSubnet") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_AssignValidatorToSubnet_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_AggregatedSigAndAggregationBits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AggregatedSigAndAggregationBits") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_BeaconNodeValidator_GetDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "duties"}, "")) - - pattern_BeaconNodeValidator_DomainData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "domain"}, "")) - - pattern_BeaconNodeValidator_WaitForChainStart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "chainstart", "stream"}, "")) - - pattern_BeaconNodeValidator_WaitForActivation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "activation", "stream"}, "")) - - pattern_BeaconNodeValidator_ValidatorIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "index"}, "")) - - pattern_BeaconNodeValidator_ValidatorStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "status"}, "")) - - pattern_BeaconNodeValidator_MultipleValidatorStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "statuses"}, "")) - - pattern_BeaconNodeValidator_GetBeaconBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "validator", "block"}, "")) - - pattern_BeaconNodeValidator_ProposeBeaconBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "validator", "block"}, "")) - - pattern_BeaconNodeValidator_PrepareBeaconProposer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "prepare_beacon_proposer"}, "")) - - pattern_BeaconNodeValidator_GetFeeRecipientByPubKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "fee_recipient_by_pub_key"}, "")) - - pattern_BeaconNodeValidator_GetAttestationData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation"}, "")) - - pattern_BeaconNodeValidator_ProposeAttestation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation"}, "")) - - pattern_BeaconNodeValidator_ProposeAttestationElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation_electra"}, "")) - - pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) - - pattern_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate_electra"}, "")) - - pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) - - pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate_electra"}, "")) - - pattern_BeaconNodeValidator_ProposeExit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "exit"}, "")) - - pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "subnet", "subscribe"}, "")) - - pattern_BeaconNodeValidator_CheckDoppelGanger_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "doppelganger"}, "")) - - pattern_BeaconNodeValidator_GetSyncMessageBlockRoot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "sync_message_block_root"}, "")) - - pattern_BeaconNodeValidator_SubmitSyncMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "sync_message"}, "")) - - pattern_BeaconNodeValidator_GetSyncSubcommitteeIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"eth", "v1alpha1", "sync_subcommittee_index"}, "")) - - pattern_BeaconNodeValidator_GetSyncCommitteeContribution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "contribution_and_proof"}, "")) - - pattern_BeaconNodeValidator_SubmitSignedContributionAndProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "signed_contribution_and_proof"}, "")) - - pattern_BeaconNodeValidator_StreamSlots_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "stream_slots"}, "")) - - pattern_BeaconNodeValidator_StreamBlocksAltair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "stream"}, "")) - - pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "registration"}, "")) - - pattern_BeaconNodeValidator_AssignValidatorToSubnet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "assign_validator_to_subnet"}, "")) - - pattern_BeaconNodeValidator_AggregatedSigAndAggregationBits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "aggregated_sig_and_aggregation_bits"}, "")) -) - -var ( - forward_BeaconNodeValidator_GetDuties_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_DomainData_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_WaitForChainStart_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_WaitForActivation_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_ValidatorIndex_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ValidatorStatus_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_MultipleValidatorStatus_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetBeaconBlock_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeBeaconBlock_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_PrepareBeaconProposer_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetFeeRecipientByPubKey_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetAttestationData_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeAttestation_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeAttestationElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitAggregateSelectionProofElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProofElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeExit_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_CheckDoppelGanger_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetSyncMessageBlockRoot_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSyncMessage_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetSyncSubcommitteeIndex_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetSyncCommitteeContribution_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSignedContributionAndProof_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_StreamSlots_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_StreamBlocksAltair_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_SubmitValidatorRegistrations_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_AssignValidatorToSubnet_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_AggregatedSigAndAggregationBits_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/withdrawals.pb.gw.go b/proto/prysm/v1alpha1/withdrawals.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/withdrawals.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/testing/endtoend/components/beacon_node.go b/testing/endtoend/components/beacon_node.go index a42da708bf35..bd1ec4de2531 100644 --- a/testing/endtoend/components/beacon_node.go +++ b/testing/endtoend/components/beacon_node.go @@ -261,7 +261,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { fmt.Sprintf("--%s=%d", cmdshared.P2PTCPPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeTCPPort+index), fmt.Sprintf("--%s=%d", cmdshared.P2PMaxPeers.Name, expectedNumOfPeers), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.PrysmBeaconNodeMetricsPort+index), - fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort+index), + fmt.Sprintf("--%s=%d", flags.HTTPServerPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort+index), fmt.Sprintf("--%s=%d", flags.ContractDeploymentBlock.Name, 0), fmt.Sprintf("--%s=%d", flags.MinPeersPerSubnet.Name, 0), fmt.Sprintf("--%s=%d", cmdshared.RPCMaxPageSizeFlag.Name, params.BeaconConfig().MinGenesisActiveValidatorCount), diff --git a/testing/endtoend/components/lighthouse_validator.go b/testing/endtoend/components/lighthouse_validator.go index a412480aa154..fde4a0f26e7d 100644 --- a/testing/endtoend/components/lighthouse_validator.go +++ b/testing/endtoend/components/lighthouse_validator.go @@ -20,26 +20,25 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/endtoend/helpers" e2e "github.com/prysmaticlabs/prysm/v5/testing/endtoend/params" "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" - e2etypes "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" "golang.org/x/sync/errgroup" ) -var _ e2etypes.ComponentRunner = (*LighthouseValidatorNode)(nil) -var _ e2etypes.ComponentRunner = (*LighthouseValidatorNodeSet)(nil) -var _ e2etypes.MultipleComponentRunners = (*LighthouseValidatorNodeSet)(nil) +var _ types.ComponentRunner = (*LighthouseValidatorNode)(nil) +var _ types.ComponentRunner = (*LighthouseValidatorNodeSet)(nil) +var _ types.MultipleComponentRunners = (*LighthouseValidatorNodeSet)(nil) // LighthouseValidatorNodeSet represents set of lighthouse validator nodes. type LighthouseValidatorNodeSet struct { - e2etypes.ComponentRunner - config *e2etypes.E2EConfig + types.ComponentRunner + config *types.E2EConfig started chan struct{} - nodes []e2etypes.ComponentRunner + nodes []types.ComponentRunner } // NewLighthouseValidatorNodeSet creates and returns a set of lighthouse validator nodes. -func NewLighthouseValidatorNodeSet(config *e2etypes.E2EConfig) *LighthouseValidatorNodeSet { +func NewLighthouseValidatorNodeSet(config *types.E2EConfig) *LighthouseValidatorNodeSet { return &LighthouseValidatorNodeSet{ config: config, started: make(chan struct{}, 1), @@ -59,7 +58,7 @@ func (s *LighthouseValidatorNodeSet) Start(ctx context.Context) error { validatorsPerNode := validatorNum / beaconNodeNum // Create validator nodes. - nodes := make([]e2etypes.ComponentRunner, lighthouseBeaconNum) + nodes := make([]types.ComponentRunner, lighthouseBeaconNum) for i := 0; i < lighthouseBeaconNum; i++ { offsetIdx := i + prysmBeaconNum nodes[i] = NewLighthouseValidatorNode(s.config, validatorsPerNode, i, validatorsPerNode*offsetIdx) @@ -134,7 +133,7 @@ func (s *LighthouseValidatorNodeSet) StopAtIndex(i int) error { } // ComponentAtIndex returns the component at the provided index. -func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error) { +func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (types.ComponentRunner, error) { if i >= len(s.nodes) { return nil, errors.Errorf("provided index exceeds slice size: %d >= %d", i, len(s.nodes)) } @@ -143,8 +142,8 @@ func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.Component // LighthouseValidatorNode represents a lighthouse validator node. type LighthouseValidatorNode struct { - e2etypes.ComponentRunner - config *e2etypes.E2EConfig + types.ComponentRunner + config *types.E2EConfig started chan struct{} validatorNum int index int @@ -153,7 +152,7 @@ type LighthouseValidatorNode struct { } // NewLighthouseValidatorNode creates and returns a lighthouse validator node. -func NewLighthouseValidatorNode(config *e2etypes.E2EConfig, validatorNum, index, offset int) *LighthouseValidatorNode { +func NewLighthouseValidatorNode(config *types.E2EConfig, validatorNum, index, offset int) *LighthouseValidatorNode { return &LighthouseValidatorNode{ config: config, validatorNum: validatorNum, @@ -179,7 +178,7 @@ func (v *LighthouseValidatorNode) Start(ctx context.Context) error { // beacon node, we split half the validators to run with // lighthouse and the other half with prysm. if v.config.UseValidatorCrossClient && index%2 == 0 { - httpPort = e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + httpPort = e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort } args := []string{ "validator_client", diff --git a/testing/endtoend/components/validator.go b/testing/endtoend/components/validator.go index 117c2ec3cb7f..580b74be8fff 100644 --- a/testing/endtoend/components/validator.go +++ b/testing/endtoend/components/validator.go @@ -226,7 +226,7 @@ func (v *ValidatorNode) Start(ctx context.Context) error { fmt.Sprintf("--%s=%s", cmdshared.LogFileName.Name, logFile.Name()), fmt.Sprintf("--%s=%s", flags.GraffitiFileFlag.Name, gFile), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.ValidatorMetricsPort+index), - fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.ValidatorGatewayPort+index), + fmt.Sprintf("--%s=%d", flags.HTTPServerPort.Name, e2e.TestParams.Ports.ValidatorHTTPPort+index), fmt.Sprintf("--%s=localhost:%d", flags.BeaconRPCProviderFlag.Name, beaconRPCPort), fmt.Sprintf("--%s=%s", flags.GRPCHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything. @@ -238,10 +238,10 @@ func (v *ValidatorNode) Start(ctx context.Context) error { } if v.config.UseBeaconRestApi { - beaconRestApiPort := e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + index - if beaconRestApiPort >= e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort+e2e.TestParams.BeaconNodeCount { + beaconRestApiPort := e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort + index + if beaconRestApiPort >= e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort+e2e.TestParams.BeaconNodeCount { // Point any extra validator clients to a node we know is running. - beaconRestApiPort = e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + beaconRestApiPort = e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort } args = append(args, diff --git a/testing/endtoend/endtoend_setup_test.go b/testing/endtoend/endtoend_setup_test.go index b4518853e1a7..7d1de12653e6 100644 --- a/testing/endtoend/endtoend_setup_test.go +++ b/testing/endtoend/endtoend_setup_test.go @@ -57,7 +57,6 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, @@ -133,7 +132,6 @@ func e2eMainnet(t *testing.T, usePrysmSh, useMultiClient bool, cfg *params.Beaco ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.FeeRecipientIsPresent, @@ -189,7 +187,6 @@ func scenarioEvals() []types.Evaluator { ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, @@ -210,7 +207,6 @@ func scenarioEvalsMulti() []types.Evaluator { ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, } diff --git a/testing/endtoend/evaluators/BUILD.bazel b/testing/endtoend/evaluators/BUILD.bazel index 8a4da9abd7fe..3b59c0095cf6 100644 --- a/testing/endtoend/evaluators/BUILD.bazel +++ b/testing/endtoend/evaluators/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", testonly = True, srcs = [ - "api_gateway_v1alpha1.go", "builder.go", "data.go", "execution_engine.go", @@ -55,7 +54,6 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_ethereum_go_ethereum//ethclient:go_default_library", "@com_github_ethereum_go_ethereum//rpc:go_default_library", - "@com_github_golang_protobuf//ptypes/empty", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", diff --git a/testing/endtoend/evaluators/api_gateway_v1alpha1.go b/testing/endtoend/evaluators/api_gateway_v1alpha1.go deleted file mode 100644 index 3b1ed1f893a6..000000000000 --- a/testing/endtoend/evaluators/api_gateway_v1alpha1.go +++ /dev/null @@ -1,501 +0,0 @@ -package evaluators - -import ( - "context" - "encoding/base64" - "encoding/json" - "fmt" - "net/http" - - "github.com/golang/protobuf/ptypes/empty" - "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - e2e "github.com/prysmaticlabs/prysm/v5/testing/endtoend/params" - "github.com/prysmaticlabs/prysm/v5/testing/endtoend/policies" - e2etypes "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" - "google.golang.org/grpc" -) - -// APIGatewayV1Alpha1VerifyIntegrity of our API gateway for the Prysm v1alpha1 API. -// This ensures our gRPC HTTP gateway returns and processes the same data _for the same endpoints_ -// as using a gRPC connection to interact with the API. Running this in end-to-end tests helps us -// ensure parity between our HTTP gateway for our API and gRPC never breaks. -// This evaluator checks a few request/response trips for both GET and POST requests. -var APIGatewayV1Alpha1VerifyIntegrity = e2etypes.Evaluator{ - Name: "api_gateway_v1alpha1_verify_integrity_epoch_%d", - Policy: policies.OnEpoch(2), - Evaluation: apiGatewayV1Alpha1Verify, -} - -const ( - v1Alpha1GatewayPathTemplate = "http://localhost:%d/eth/v1alpha1" -) - -type apiComparisonFunc func(beaconNodeIdx int, conn *grpc.ClientConn) error - -func apiGatewayV1Alpha1Verify(_ *e2etypes.EvaluationContext, conns ...*grpc.ClientConn) error { - for beaconNodeIdx, conn := range conns { - if err := runAPIComparisonFunctions( - beaconNodeIdx, - conn, - withComparePeers, - withCompareListAttestations, - withCompareValidators, - withCompareChainHead, - ); err != nil { - return err - } - } - return nil -} - -func withComparePeers(beaconNodeIdx int, conn *grpc.ClientConn) error { - type peerJSON struct { - Address string `json:"address"` - Direction string `json:"direction"` - ConnectionState string `json:"connectionState"` - PeerId string `json:"peerId"` - Enr string `json:"enr"` - } - type peersResponseJSON struct { - Peers []*peerJSON `json:"peers"` - } - ctx := context.Background() - nodeClient := ethpb.NewNodeClient(conn) - resp, err := nodeClient.ListPeers(ctx, &empty.Empty{}) - if err != nil { - return err - } - respJSON := &peersResponseJSON{} - if err := doGatewayJSONRequest( - "/node/peers", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - if len(respJSON.Peers) != len(resp.Peers) { - return fmt.Errorf( - "HTTP gateway number of peers %d does not match gRPC %d", - len(respJSON.Peers), - len(resp.Peers), - ) - } - grpcPeerMap := make(map[string]*ethpb.Peer) - jsonPeerMap := make(map[string]*peerJSON) - for i := 0; i < len(respJSON.Peers); i++ { - grpcPeerMap[resp.Peers[i].PeerId] = resp.Peers[i] - jsonPeerMap[respJSON.Peers[i].PeerId] = respJSON.Peers[i] - } - - for id, peer := range jsonPeerMap { - grpcPeer, ok := grpcPeerMap[id] - if !ok { - return errors.Errorf("grpc peer %s doesn't exist", id) - } - if peer.Address != grpcPeer.Address { - return fmt.Errorf( - "HTTP gateway peer %s with address %s does not match gRPC %s", - id, - peer.Address, - grpcPeer.Address, - ) - } - if peer.Direction != grpcPeer.Direction.String() { - return fmt.Errorf( - "HTTP gateway peer %s with direction %s does not match gRPC %s", - id, - peer.Direction, - grpcPeer.Direction, - ) - } - if peer.ConnectionState != grpcPeer.ConnectionState.String() { - return fmt.Errorf( - "HTTP gateway peer %s with connection state %s does not match gRPC %s", - id, - peer.ConnectionState, - grpcPeer.ConnectionState, - ) - } - if peer.PeerId != grpcPeer.PeerId { - return fmt.Errorf( - "HTTP gateway peer %s with peer id %s does not match gRPC %s", - id, - peer.PeerId, - grpcPeer.PeerId, - ) - } - if peer.Enr != grpcPeer.Enr { - return fmt.Errorf( - "HTTP gateway peer %s with enr %s does not match gRPC %s", - id, - peer.Enr, - grpcPeer.Enr, - ) - } - } - return nil -} - -func withCompareListAttestations(beaconNodeIdx int, conn *grpc.ClientConn) error { - type checkpointJSON struct { - Epoch string `json:"epoch"` - Root string `json:"root"` - } - type attestationDataJSON struct { - Slot string `json:"slot"` - CommitteeIndex string `json:"committeeIndex"` - BeaconBlockRoot string `json:"beaconBlockRoot"` - Source *checkpointJSON `json:"source"` - Target *checkpointJSON `json:"target"` - } - type attestationJSON struct { - AggregationBits string `json:"aggregationBits"` - Data *attestationDataJSON `json:"data"` - Signature string `json:"signature"` - } - type attestationsResponseJSON struct { - Attestations []*attestationJSON `json:"attestations"` - NextPageToken string `json:"nextPageToken"` - TotalSize int32 `json:"totalSize"` - } - ctx := context.Background() - beaconClient := ethpb.NewBeaconChainClient(conn) - resp, err := beaconClient.ListAttestations(ctx, ðpb.ListAttestationsRequest{ - QueryFilter: ðpb.ListAttestationsRequest_GenesisEpoch{GenesisEpoch: true}, - }) - if err != nil { - return err - } - respJSON := &attestationsResponseJSON{} - if err := doGatewayJSONRequest( - "/beacon/attestations?genesis_epoch=true", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - // Begin comparisons. - if respJSON.NextPageToken != resp.NextPageToken { - return fmt.Errorf( - "HTTP gateway next page token %s does not match gRPC %s", - respJSON.NextPageToken, - resp.NextPageToken, - ) - } - if respJSON.TotalSize != resp.TotalSize { - return fmt.Errorf( - "HTTP gateway total size %d does not match gRPC %d", - respJSON.TotalSize, - resp.TotalSize, - ) - } - for i, att := range respJSON.Attestations { - grpcAtt := resp.Attestations[i] - if att.AggregationBits != base64.StdEncoding.EncodeToString(grpcAtt.AggregationBits) { - return fmt.Errorf( - "HTTP gateway attestation %d aggregation bits %s does not match gRPC %d", - i, - att.AggregationBits, - grpcAtt.AggregationBits, - ) - } - data := att.Data - grpcData := grpcAtt.Data - if data.Slot != fmt.Sprintf("%d", grpcData.Slot) { - return fmt.Errorf( - "HTTP gateway attestation %d slot %s does not match gRPC %d", - i, - data.Slot, - grpcData.Slot, - ) - } - if data.CommitteeIndex != fmt.Sprintf("%d", grpcData.CommitteeIndex) { - return fmt.Errorf( - "HTTP gateway attestation %d committee index %s does not match gRPC %d", - i, - data.CommitteeIndex, - grpcData.CommitteeIndex, - ) - } - if data.BeaconBlockRoot != base64.StdEncoding.EncodeToString(grpcData.BeaconBlockRoot) { - return fmt.Errorf( - "HTTP gateway attestation %d beacon block root %s does not match gRPC %d", - i, - data.BeaconBlockRoot, - grpcData.BeaconBlockRoot, - ) - } - if data.Source.Epoch != fmt.Sprintf("%d", grpcData.Source.Epoch) { - return fmt.Errorf( - "HTTP gateway attestation %d source epoch %s does not match gRPC %d", - i, - data.Source.Epoch, - grpcData.Source.Epoch, - ) - } - if data.Source.Root != base64.StdEncoding.EncodeToString(grpcData.Source.Root) { - return fmt.Errorf( - "HTTP gateway attestation %d source root %s does not match gRPC %d", - i, - data.Source.Root, - grpcData.Source.Root, - ) - } - if data.Target.Epoch != fmt.Sprintf("%d", grpcData.Target.Epoch) { - return fmt.Errorf( - "HTTP gateway attestation %d target epoch %s does not match gRPC %d", - i, - data.Target.Epoch, - grpcData.Target.Epoch, - ) - } - if data.Target.Root != base64.StdEncoding.EncodeToString(grpcData.Target.Root) { - return fmt.Errorf( - "HTTP gateway attestation %d target root %s does not match gRPC %d", - i, - data.Target.Root, - grpcData.Target.Root, - ) - } - if att.Signature != base64.StdEncoding.EncodeToString(grpcAtt.Signature) { - return fmt.Errorf( - "HTTP gateway attestation %d signature %s does not match gRPC %d", - i, - att.Signature, - grpcAtt.Signature, - ) - } - } - return nil -} - -func withCompareValidators(beaconNodeIdx int, conn *grpc.ClientConn) error { - type validatorJSON struct { - PublicKey string `json:"publicKey"` - WithdrawalCredentials string `json:"withdrawalCredentials"` - EffectiveBalance string `json:"effectiveBalance"` - Slashed bool `json:"slashed"` - ActivationEligibilityEpoch string `json:"activationEligibilityEpoch"` - ActivationEpoch string `json:"activationEpoch"` - ExitEpoch string `json:"exitEpoch"` - WithdrawableEpoch string `json:"withdrawableEpoch"` - } - type validatorContainerJSON struct { - Index string `json:"index"` - Validator *validatorJSON `json:"validator"` - } - type validatorsResponseJSON struct { - Epoch string `json:"epoch"` - ValidatorList []*validatorContainerJSON `json:"validatorList"` - NextPageToken string `json:"nextPageToken"` - TotalSize int32 `json:"totalSize"` - } - ctx := context.Background() - beaconClient := ethpb.NewBeaconChainClient(conn) - resp, err := beaconClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ - QueryFilter: ðpb.ListValidatorsRequest_Genesis{ - Genesis: true, - }, - PageSize: 4, - }) - if err != nil { - return err - } - respJSON := &validatorsResponseJSON{} - if err := doGatewayJSONRequest( - "/validators?genesis=true&page_size=4", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - // Begin comparisons. - if respJSON.Epoch != fmt.Sprintf("%d", resp.Epoch) { - return fmt.Errorf( - "HTTP gateway epoch %s does not match gRPC %d", - respJSON.Epoch, - resp.Epoch, - ) - } - if respJSON.NextPageToken != resp.NextPageToken { - return fmt.Errorf( - "HTTP gateway next page token %s does not match gRPC %s", - respJSON.NextPageToken, - resp.NextPageToken, - ) - } - if respJSON.TotalSize != resp.TotalSize { - return fmt.Errorf( - "HTTP gateway total size %d does not match gRPC %d", - respJSON.TotalSize, - resp.TotalSize, - ) - } - - // Compare validators. - for i, val := range respJSON.ValidatorList { - if val.Index != fmt.Sprintf("%d", resp.ValidatorList[i].Index) { - return fmt.Errorf( - "HTTP gateway validator %d index %s does not match gRPC %d", - i, - val.Index, - resp.ValidatorList[i].Index, - ) - } - httpVal := val.Validator - grpcVal := resp.ValidatorList[i].Validator - if httpVal.PublicKey != base64.StdEncoding.EncodeToString(grpcVal.PublicKey) { - return fmt.Errorf( - "HTTP gateway validator %d public key %s does not match gRPC %d", - i, - httpVal.PublicKey, - grpcVal.PublicKey, - ) - } - continue - } - return nil -} - -// Compares a regular beacon chain head GET request with no arguments gRPC and gRPC gateway. -func withCompareChainHead(beaconNodeIdx int, conn *grpc.ClientConn) error { - // used for gateway, if using pure HTTP use shared.ChainHead - type chainHeadResponseJSON struct { - HeadSlot string `json:"headSlot"` - HeadEpoch string `json:"headEpoch"` - HeadBlockRoot string `json:"headBlockRoot"` - FinalizedSlot string `json:"finalizedSlot"` - FinalizedEpoch string `json:"finalizedEpoch"` - FinalizedBlockRoot string `json:"finalizedBlockRoot"` - JustifiedSlot string `json:"justifiedSlot"` - JustifiedEpoch string `json:"justifiedEpoch"` - JustifiedBlockRoot string `json:"justifiedBlockRoot"` - PreviousJustifiedSlot string `json:"previousJustifiedSlot"` - PreviousJustifiedEpoch string `json:"previousJustifiedEpoch"` - PreviousJustifiedBlockRoot string `json:"previousJustifiedBlockRoot"` - } - beaconClient := ethpb.NewBeaconChainClient(conn) - ctx := context.Background() - resp, err := beaconClient.GetChainHead(ctx, &empty.Empty{}) - if err != nil { - return err - } - respJSON := &chainHeadResponseJSON{} - if err := doGatewayJSONRequest( - "/beacon/chainhead", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - if respJSON.HeadSlot != fmt.Sprintf("%d", resp.HeadSlot) { - return fmt.Errorf( - "HTTP gateway head slot %s does not match gRPC %d", - respJSON.HeadSlot, - resp.HeadSlot, - ) - } - if respJSON.HeadEpoch != fmt.Sprintf("%d", resp.HeadEpoch) { - return fmt.Errorf( - "HTTP gateway head epoch %s does not match gRPC %d", - respJSON.HeadEpoch, - resp.HeadEpoch, - ) - } - if respJSON.HeadBlockRoot != base64.StdEncoding.EncodeToString(resp.HeadBlockRoot) { - return fmt.Errorf( - "HTTP gateway head block root %s does not match gRPC %s", - respJSON.HeadBlockRoot, - resp.HeadBlockRoot, - ) - } - if respJSON.FinalizedSlot != fmt.Sprintf("%d", resp.FinalizedSlot) { - return fmt.Errorf( - "HTTP gateway finalized slot %s does not match gRPC %d", - respJSON.FinalizedSlot, - resp.FinalizedSlot, - ) - } - if respJSON.FinalizedEpoch != fmt.Sprintf("%d", resp.FinalizedEpoch) { - return fmt.Errorf( - "HTTP gateway finalized epoch %s does not match gRPC %d", - respJSON.FinalizedEpoch, - resp.FinalizedEpoch, - ) - } - if respJSON.FinalizedBlockRoot != base64.StdEncoding.EncodeToString(resp.FinalizedBlockRoot) { - return fmt.Errorf( - "HTTP gateway finalized block root %s does not match gRPC %s", - respJSON.FinalizedBlockRoot, - resp.FinalizedBlockRoot, - ) - } - if respJSON.JustifiedSlot != fmt.Sprintf("%d", resp.JustifiedSlot) { - return fmt.Errorf( - "HTTP gateway justified slot %s does not match gRPC %d", - respJSON.JustifiedSlot, - resp.JustifiedSlot, - ) - } - if respJSON.JustifiedEpoch != fmt.Sprintf("%d", resp.JustifiedEpoch) { - return fmt.Errorf( - "HTTP gateway justified epoch %s does not match gRPC %d", - respJSON.JustifiedEpoch, - resp.JustifiedEpoch, - ) - } - if respJSON.JustifiedBlockRoot != base64.StdEncoding.EncodeToString(resp.JustifiedBlockRoot) { - return fmt.Errorf( - "HTTP gateway justified block root %s does not match gRPC %s", - respJSON.JustifiedBlockRoot, - resp.JustifiedBlockRoot, - ) - } - if respJSON.PreviousJustifiedSlot != fmt.Sprintf("%d", resp.PreviousJustifiedSlot) { - return fmt.Errorf( - "HTTP gateway justified slot %s does not match gRPC %d", - respJSON.FinalizedSlot, - resp.FinalizedSlot, - ) - } - if respJSON.PreviousJustifiedEpoch != fmt.Sprintf("%d", resp.PreviousJustifiedEpoch) { - return fmt.Errorf( - "HTTP gateway justified epoch %s does not match gRPC %d", - respJSON.FinalizedEpoch, - resp.FinalizedEpoch, - ) - } - if respJSON.PreviousJustifiedBlockRoot != base64.StdEncoding.EncodeToString(resp.PreviousJustifiedBlockRoot) { - return fmt.Errorf( - "HTTP gateway justified block root %s does not match gRPC %s", - respJSON.JustifiedBlockRoot, - resp.JustifiedBlockRoot, - ) - } - return nil -} - -func doGatewayJSONRequest(requestPath string, beaconNodeIdx int, dst interface{}) error { - basePath := fmt.Sprintf(v1Alpha1GatewayPathTemplate, e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort+beaconNodeIdx) - httpResp, err := http.Get( - basePath + requestPath, - ) - if err != nil { - return err - } - return json.NewDecoder(httpResp.Body).Decode(&dst) -} - -func runAPIComparisonFunctions(beaconNodeIdx int, conn *grpc.ClientConn, fs ...apiComparisonFunc) error { - for _, f := range fs { - if err := f(beaconNodeIdx, conn); err != nil { - return err - } - } - return nil -} diff --git a/testing/endtoend/evaluators/beaconapi/util.go b/testing/endtoend/evaluators/beaconapi/util.go index 5c8aa1d70fb5..3d0f7914f9ca 100644 --- a/testing/endtoend/evaluators/beaconapi/util.go +++ b/testing/endtoend/evaluators/beaconapi/util.go @@ -33,7 +33,7 @@ func doJSONGetRequest(template, requestPath string, beaconNodeIdx int, resp inte var port int switch bnType[0] { case "Prysm": - port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort + port = params.TestParams.Ports.PrysmBeaconNodeHTTPPort case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: @@ -74,7 +74,7 @@ func doSSZGetRequest(template, requestPath string, beaconNodeIdx int, bnType ... var port int switch bnType[0] { case "Prysm": - port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort + port = params.TestParams.Ports.PrysmBeaconNodeHTTPPort case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: @@ -116,7 +116,7 @@ func doJSONPostRequest(template, requestPath string, beaconNodeIdx int, postObj, var port int switch bnType[0] { case "Prysm": - port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort + port = params.TestParams.Ports.PrysmBeaconNodeHTTPPort case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: diff --git a/testing/endtoend/evaluators/beaconapi/verify.go b/testing/endtoend/evaluators/beaconapi/verify.go index baa9a12d2068..1352fc1c32e0 100644 --- a/testing/endtoend/evaluators/beaconapi/verify.go +++ b/testing/endtoend/evaluators/beaconapi/verify.go @@ -181,7 +181,7 @@ func postEvaluation(nodeIdx int, requests map[string]endpoint, epoch primitives. } // perform a health check - basePath := fmt.Sprintf(v1PathTemplate, params2.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIdx) + basePath := fmt.Sprintf(v1PathTemplate, params2.TestParams.Ports.PrysmBeaconNodeHTTPPort+nodeIdx) resp, err := http.Get(basePath + "/node/health") if err != nil { return errors.Wrap(err, "could not perform a health check") diff --git a/testing/endtoend/evaluators/execution_engine.go b/testing/endtoend/evaluators/execution_engine.go index f02dae04c4fd..7719ceaaf4cb 100644 --- a/testing/endtoend/evaluators/execution_engine.go +++ b/testing/endtoend/evaluators/execution_engine.go @@ -27,7 +27,7 @@ var OptimisticSyncEnabled = types.Evaluator{ func optimisticSyncEnabled(_ *types.EvaluationContext, conns ...*grpc.ClientConn) error { for nodeIndex := range conns { - path := fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/head", params.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIndex) + path := fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/head", params.TestParams.Ports.PrysmBeaconNodeHTTPPort+nodeIndex) resp := structs.GetBlockV2Response{} httpResp, err := http.Get(path) // #nosec G107 -- path can't be constant because it depends on port param and node index if err != nil { @@ -53,7 +53,7 @@ func optimisticSyncEnabled(_ *types.EvaluationContext, conns ...*grpc.ClientConn return err } for i := startSlot; i <= primitives.Slot(headSlot); i++ { - path = fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/%d", params.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIndex, i) + path = fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/%d", params.TestParams.Ports.PrysmBeaconNodeHTTPPort+nodeIndex, i) resp = structs.GetBlockV2Response{} httpResp, err = http.Get(path) // #nosec G107 -- path can't be constant because it depends on port param and node index if err != nil { diff --git a/testing/endtoend/evaluators/operations.go b/testing/endtoend/evaluators/operations.go index b683f8c863b3..6b23b314da80 100644 --- a/testing/endtoend/evaluators/operations.go +++ b/testing/endtoend/evaluators/operations.go @@ -626,7 +626,7 @@ func submitWithdrawal(ec *e2etypes.EvaluationContext, conns ...*grpc.ClientConn) }) } - beaconAPIClient, err := beacon.NewClient(fmt.Sprintf("http://localhost:%d/eth/v1", e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort)) // only uses the first node so no updates to port + beaconAPIClient, err := beacon.NewClient(fmt.Sprintf("http://localhost:%d/eth/v1", e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort)) // only uses the first node so no updates to port if err != nil { return err } diff --git a/testing/endtoend/evaluators/validator.go b/testing/endtoend/evaluators/validator.go index e8d9b4e2a403..02137d366d7a 100644 --- a/testing/endtoend/evaluators/validator.go +++ b/testing/endtoend/evaluators/validator.go @@ -133,7 +133,7 @@ func validatorsParticipating(_ *types.EvaluationContext, conns ...*grpc.ClientCo expected = 0.95 } if partRate < expected { - path := fmt.Sprintf("http://localhost:%d/eth/v2/debug/beacon/states/head", e2eparams.TestParams.Ports.PrysmBeaconNodeGatewayPort) + path := fmt.Sprintf("http://localhost:%d/eth/v2/debug/beacon/states/head", e2eparams.TestParams.Ports.PrysmBeaconNodeHTTPPort) resp := structs.GetBeaconStateV2Response{} httpResp, err := http.Get(path) // #nosec G107 -- path can't be constant because it depends on port param if err != nil { diff --git a/testing/endtoend/helpers/helpers.go b/testing/endtoend/helpers/helpers.go index d9dbd29adfbc..7f0ce6767abc 100644 --- a/testing/endtoend/helpers/helpers.go +++ b/testing/endtoend/helpers/helpers.go @@ -132,7 +132,7 @@ func WaitForTextInFile(src *os.File, match string) error { select { case <-ctx.Done(): - return fmt.Errorf("could not find requested text \"%s\" in %s before deadline:\n", match, f.Name()) + return fmt.Errorf("could not find requested text \"%s\" in %s before deadline", match, f.Name()) case <-foundChan: return nil case err = <-errChan: @@ -323,7 +323,7 @@ func NewLocalConnections(ctx context.Context, numConns int) ([]*grpc.ClientConn, func BeaconAPIHostnames(numConns int) []string { hostnames := make([]string, 0) for i := 0; i < numConns; i++ { - port := e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + i + port := e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort + i hostnames = append(hostnames, net.JoinHostPort("127.0.0.1", strconv.Itoa(port))) } return hostnames diff --git a/testing/endtoend/params/params.go b/testing/endtoend/params/params.go index dd71b9c53cdd..ea58554f33f8 100644 --- a/testing/endtoend/params/params.go +++ b/testing/endtoend/params/params.go @@ -47,14 +47,14 @@ type ports struct { PrysmBeaconNodeUDPPort int PrysmBeaconNodeQUICPort int PrysmBeaconNodeTCPPort int - PrysmBeaconNodeGatewayPort int + PrysmBeaconNodeHTTPPort int PrysmBeaconNodeMetricsPort int PrysmBeaconNodePprofPort int LighthouseBeaconNodeP2PPort int LighthouseBeaconNodeHTTPPort int LighthouseBeaconNodeMetricsPort int ValidatorMetricsPort int - ValidatorGatewayPort int + ValidatorHTTPPort int JaegerTracingPort int } @@ -146,7 +146,7 @@ const ( prysmBeaconNodeUDPPort = prysmBeaconNodeRPCPort + portSpan prysmBeaconNodeQUICPort = prysmBeaconNodeRPCPort + 2*portSpan prysmBeaconNodeTCPPort = prysmBeaconNodeRPCPort + 3*portSpan - prysmBeaconNodeGatewayPort = prysmBeaconNodeRPCPort + 4*portSpan + prysmBeaconNodeHTTPPort = prysmBeaconNodeRPCPort + 4*portSpan prysmBeaconNodeMetricsPort = prysmBeaconNodeRPCPort + 5*portSpan prysmBeaconNodePprofPort = prysmBeaconNodeRPCPort + 6*portSpan @@ -154,8 +154,8 @@ const ( lighthouseBeaconNodeHTTPPort = lighthouseBeaconNodeP2PPort + portSpan lighthouseBeaconNodeMetricsPort = lighthouseBeaconNodeP2PPort + 2*portSpan - validatorGatewayPort = 6150 - validatorMetricsPort = validatorGatewayPort + portSpan + validatorHTTPPort = 6150 + validatorMetricsPort = validatorHTTPPort + portSpan jaegerTracingPort = 9150 @@ -339,7 +339,7 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR if err != nil { return err } - beaconNodeGatewayPort, err := port(prysmBeaconNodeGatewayPort, shardCount, shardIndex, existingRegistrations) + beaconNodeHTTPPort, err := port(prysmBeaconNodeHTTPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } @@ -351,7 +351,7 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR if err != nil { return err } - validatorGatewayPort, err := port(validatorGatewayPort, shardCount, shardIndex, existingRegistrations) + validatorHTTPPort, err := port(validatorHTTPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } @@ -374,11 +374,11 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR ports.PrysmBeaconNodeUDPPort = beaconNodeUDPPort ports.PrysmBeaconNodeQUICPort = beaconNodeQUICPort ports.PrysmBeaconNodeTCPPort = beaconNodeTCPPort - ports.PrysmBeaconNodeGatewayPort = beaconNodeGatewayPort + ports.PrysmBeaconNodeHTTPPort = beaconNodeHTTPPort ports.PrysmBeaconNodeMetricsPort = beaconNodeMetricsPort ports.PrysmBeaconNodePprofPort = beaconNodePprofPort ports.ValidatorMetricsPort = validatorMetricsPort - ports.ValidatorGatewayPort = validatorGatewayPort + ports.ValidatorHTTPPort = validatorHTTPPort ports.JaegerTracingPort = jaegerTracingPort return nil } diff --git a/testing/endtoend/params/params_test.go b/testing/endtoend/params/params_test.go index e0f795984b37..cc7fbfea5ff1 100644 --- a/testing/endtoend/params/params_test.go +++ b/testing/endtoend/params/params_test.go @@ -31,7 +31,7 @@ func TestStandardPorts(t *testing.T) { testPorts := &ports{} assert.NoError(t, initializeStandardPorts(2, 0, testPorts, &existingRegistrations)) assert.Equal(t, 17, len(existingRegistrations)) - assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeGatewayPort) + assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeHTTPPort) assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeTCPPort) assert.NotEqual(t, 0, testPorts.JaegerTracingPort) } diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index cd4f21b5b044..afbe08b5e2a3 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -181,7 +181,7 @@ func (mr *MockValidatorClientMockRecorder) FeeRecipientByPubKey(arg0, arg1 any) // Host mocks base method. func (m *MockValidatorClient) Host() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Host") + ret := m.ctrl.Call(m, "HTTPHost") ret0, _ := ret[0].(string) return ret0 } @@ -189,7 +189,7 @@ func (m *MockValidatorClient) Host() string { // Host indicates an expected call of Host. func (mr *MockValidatorClientMockRecorder) Host() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockValidatorClient)(nil).Host)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HTTPHost", reflect.TypeOf((*MockValidatorClient)(nil).Host)) } // MultipleValidatorStatus mocks base method. diff --git a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch b/third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch deleted file mode 100644 index e7b94f9794da..000000000000 --- a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/internal/descriptor/apiconfig/BUILD.bazel b/internal/descriptor/apiconfig/BUILD.bazel -index 80dc57a2..76d4374f 100644 ---- a/internal/descriptor/apiconfig/BUILD.bazel -+++ b/internal/descriptor/apiconfig/BUILD.bazel -@@ -11,6 +11,7 @@ proto_library( - ], - deps = [ - "@go_googleapis//google/api:annotations_proto", -+ "@go_googleapis//google/api:http_proto", - ], - ) - diff --git a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch b/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch deleted file mode 100644 index 707ee5da4b7c..000000000000 --- a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go -index 6d3476df..6392af9a 100644 ---- a/protoc-gen-grpc-gateway/internal/gengateway/template.go -+++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go -@@ -243,8 +243,7 @@ It translates gRPC into RESTful JSON APIs. - package {{.GoPkg.Name}} - import ( - github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" -- emptypb "github.com/golang/protobuf/ptypes/empty" -- "github.com/golang/protobuf/ptypes/empty" -+ "google.golang.org/protobuf/types/known/emptypb" - {{range $i := .Imports}}{{if $i | printf "%q" | ne "github.com/golang/protobuf/ptypes/empty"}}{{$i | printf "%s\n"}}{{end}}{{end}} - ) - -@@ -257,7 +256,6 @@ var _ = utilities.NewDoubleArray - var _ = metadata.Join - var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0) - var _ = emptypb.Empty{} --var _ = empty.Empty{} - `)) - - handlerTemplate = template.Must(template.New("handler").Parse(` diff --git a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch b/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch deleted file mode 100644 index 8d568a4b1b26..000000000000 --- a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go -index 6392af9..2d28493 100644 ---- a/protoc-gen-grpc-gateway/internal/gengateway/template.go -+++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go -@@ -152,13 +152,13 @@ type trailerParams struct { - func typeFromName(name string) string { - lowerName := strings.ToLower(name) - if strings.Contains(lowerName, "epoch") { -- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch" -+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch" - } else if strings.Contains(lowerName, "slot") { -- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot" -+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot" - } else if strings.Contains(lowerName, "committee") { -- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex" -+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.CommitteeIndex" - } else if strings.Contains(lowerName, "index") { -- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex" -+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex" - } - return "" - } -@@ -242,7 +242,7 @@ It translates gRPC into RESTful JSON APIs. - */{{end}} - package {{.GoPkg.Name}} - import ( -- github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" -+ github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/protobuf/types/known/emptypb" - {{range $i := .Imports}}{{if $i | printf "%q" | ne "github.com/golang/protobuf/ptypes/empty"}}{{$i | printf "%s\n"}}{{end}}{{end}} - ) -@@ -254,7 +254,7 @@ var _ status.Status - var _ = runtime.String - var _ = utilities.NewDoubleArray - var _ = metadata.Join --var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0) -+var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) - var _ = emptypb.Empty{} - `)) - diff --git a/validator/client/beacon-api/mock/json_rest_handler_mock.go b/validator/client/beacon-api/mock/json_rest_handler_mock.go index 1e2e98499cd3..33722c5bb9e5 100644 --- a/validator/client/beacon-api/mock/json_rest_handler_mock.go +++ b/validator/client/beacon-api/mock/json_rest_handler_mock.go @@ -58,7 +58,7 @@ func (mr *MockJsonRestHandlerMockRecorder) Get(ctx, endpoint, resp any) *gomock. // Host mocks base method. func (m *MockJsonRestHandler) Host() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Host") + ret := m.ctrl.Call(m, "HTTPHost") ret0, _ := ret[0].(string) return ret0 } @@ -66,7 +66,7 @@ func (m *MockJsonRestHandler) Host() string { // Host indicates an expected call of Host. func (mr *MockJsonRestHandlerMockRecorder) Host() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockJsonRestHandler)(nil).Host)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HTTPHost", reflect.TypeOf((*MockJsonRestHandler)(nil).Host)) } // HttpClient mocks base method. diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 253255212ab8..58c2016c79bd 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -34,7 +34,6 @@ go_library( ], deps = [ "//api:go_default_library", - "//api/gateway:go_default_library", "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", @@ -47,7 +46,6 @@ go_library( "//monitoring/backup:go_default_library", "//monitoring/prometheus:go_default_library", "//monitoring/tracing:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "//runtime:go_default_library", "//runtime/debug:go_default_library", "//runtime/prereqs:go_default_library", @@ -62,12 +60,9 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/keymanager/remote-web3signer:go_default_library", "//validator/rpc:go_default_library", - "//validator/web:go_default_library", "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", ], ) diff --git a/validator/node/node.go b/validator/node/node.go index fb7cc8f9c405..7301057001d7 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -6,8 +6,6 @@ package node import ( "context" "fmt" - "net" - "net/http" "net/url" "os" "os/signal" @@ -19,10 +17,8 @@ import ( "time" "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/gateway" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" @@ -35,7 +31,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/monitoring/backup" "github.com/prysmaticlabs/prysm/v5/monitoring/prometheus" tracing2 "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime" "github.com/prysmaticlabs/prysm/v5/runtime/debug" "github.com/prysmaticlabs/prysm/v5/runtime/prereqs" @@ -50,10 +45,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/keymanager/local" remoteweb3signer "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer" "github.com/prysmaticlabs/prysm/v5/validator/rpc" - "github.com/prysmaticlabs/prysm/v5/validator/web" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" - "google.golang.org/protobuf/encoding/protojson" ) // ValidatorClient defines an instance of an Ethereum validator that manages @@ -143,10 +136,10 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { func newRouter(cliCtx *cli.Context) *mux.Router { var allowedOrigins []string - if cliCtx.IsSet(flags.GRPCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.GRPCGatewayCorsDomain.Name), ",") + if cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") } r := mux.NewRouter() r.Use(middleware.NormalizeQueryValuesHandler) @@ -289,9 +282,6 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Rou if err := c.registerRPCService(router); err != nil { return err } - if err := c.registerRPCGatewayService(router); err != nil { - return err - } } return nil } @@ -332,12 +322,10 @@ func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context, router *mux.Rout if err := c.registerRPCService(router); err != nil { return err } - if err := c.registerRPCGatewayService(router); err != nil { - return err - } - gatewayHost := cliCtx.String(flags.GRPCGatewayHost.Name) - gatewayPort := cliCtx.Int(flags.GRPCGatewayPort.Name) - webAddress := fmt.Sprintf("http://%s:%d", gatewayHost, gatewayPort) + + host := cliCtx.String(flags.HTTPServerHost.Name) + port := cliCtx.Int(flags.HTTPServerPort.Name) + webAddress := fmt.Sprintf("http://%s:%d", host, port) log.WithField("address", webAddress).Info( "Starting Prysm web UI on address, open in browser to access", ) @@ -608,11 +596,18 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { authTokenPath = filepath.Join(walletDir, api.AuthTokenFileName) } } + host := c.cliCtx.String(flags.HTTPServerHost.Name) + if host != flags.DefaultHTTPServerHost { + log.WithField("webHost", host).Warn( + "You are using a non-default web host. Web traffic is served by HTTP, so be wary of " + + "changing this parameter if you are exposing this host to the Internet!", + ) + } + port := c.cliCtx.Int(flags.HTTPServerPort.Name) + s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ - Host: c.cliCtx.String(flags.RPCHost.Name), - Port: fmt.Sprintf("%d", c.cliCtx.Int(flags.RPCPort.Name)), - GRPCGatewayHost: c.cliCtx.String(flags.GRPCGatewayHost.Name), - GRPCGatewayPort: c.cliCtx.Int(flags.GRPCGatewayPort.Name), + HTTPHost: host, + HTTPPort: port, GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), GRPCRetries: c.cliCtx.Uint(flags.GRPCRetriesFlag.Name), GRPCRetryDelay: c.cliCtx.Duration(flags.GRPCRetryDelayFlag.Name), @@ -632,82 +627,6 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { return c.services.RegisterService(s) } -func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { - gatewayHost := c.cliCtx.String(flags.GRPCGatewayHost.Name) - if gatewayHost != flags.DefaultGatewayHost { - log.WithField("webHost", gatewayHost).Warn( - "You are using a non-default web host. Web traffic is served by HTTP, so be wary of " + - "changing this parameter if you are exposing this host to the Internet!", - ) - } - gatewayPort := c.cliCtx.Int(flags.GRPCGatewayPort.Name) - rpcHost := c.cliCtx.String(flags.RPCHost.Name) - rpcPort := c.cliCtx.Int(flags.RPCPort.Name) - rpcAddr := net.JoinHostPort(rpcHost, fmt.Sprintf("%d", rpcPort)) - gatewayAddress := net.JoinHostPort(gatewayHost, fmt.Sprintf("%d", gatewayPort)) - timeout := c.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - var allowedOrigins []string - if c.cliCtx.IsSet(flags.GRPCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(c.cliCtx.String(flags.GRPCGatewayCorsDomain.Name), ",") - } else { - allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") - } - maxCallSize := c.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - - registrations := []gateway.PbHandlerRegistration{ - pb.RegisterHealthHandler, - } - gwmux := gwruntime.NewServeMux( - gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ - Marshaler: &gwruntime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - EmitUnpopulated: true, - UseProtoNames: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - }), - gwruntime.WithMarshalerOption( - api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, // TODO: remove this - ), - gwruntime.WithForwardResponseOption(gateway.HttpResponseModifier), - ) - - muxHandler := func(h http.HandlerFunc, w http.ResponseWriter, req *http.Request) { - // The validator gateway handler requires this special logic as it serves the web APIs and the web UI. - if strings.HasPrefix(req.URL.Path, "/api") { - req.URL.Path = strings.Replace(req.URL.Path, "/api", "", 1) - // Else, we handle with the Prysm API gateway without a middleware. - h(w, req) - } else { - // Finally, we handle with the web server. - web.Handler(w, req) - } - } - - pbHandler := &gateway.PbMux{ - Registrations: registrations, - Mux: gwmux, - } - opts := []gateway.Option{ - gateway.WithMuxHandler(muxHandler), - gateway.WithRouter(router), // note some routes are registered in server.go - gateway.WithRemoteAddr(rpcAddr), - gateway.WithGatewayAddr(gatewayAddress), - gateway.WithMaxCallRecvMsgSize(maxCallSize), - gateway.WithPbHandlers([]*gateway.PbMux{pbHandler}), - gateway.WithAllowedOrigins(allowedOrigins), - gateway.WithTimeout(uint64(timeout)), - } - gw, err := gateway.New(c.cliCtx.Context, opts...) - if err != nil { - return err - } - return c.services.RegisterService(gw) -} - func setWalletPasswordFilePath(cliCtx *cli.Context) error { walletDir := cliCtx.String(flags.WalletDirFlag.Name) defaultWalletPasswordFilePath := filepath.Join(walletDir, wallet.DefaultWalletPasswordFile) diff --git a/validator/package/validator.yaml b/validator/package/validator.yaml index 4cee5808a874..4cf7e716629e 100644 --- a/validator/package/validator.yaml +++ b/validator/package/validator.yaml @@ -15,7 +15,7 @@ wallet-dir: /var/lib/prysm/validator # beacon-rpc-provider: Beacon node RPC provider endpoint. Default: localhost:4000 # rpc-host: Specify the RPC host exposed by the validator. Default: localhost # rpc-port: Specify the RPC port exposed by the validator. Default: 7000 -# grpc-gateway-host: Specify the gRPC gateway port exposed by the validator. Default: localhost -# grpc-gateway-port: Specify the gRPC gateway port exposed by the validator. Default: 7500 +# http-host: Specify the HTTP host exposed by the validator. Default: localhost +# http-port: Specify the HTTP port exposed by the validator. Default: 7500 # graffiti: A string to include in proposed block. # graffiti-file: Path to Yaml file containing advanced graffiti settings. See https://docs.prylabs.network/docs/prysm-usage/graffiti-file \ No newline at end of file diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 34165e3489d0..999c04e854ab 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//api/grpc:go_default_library", "//api/pagination:go_default_library", "//api/server:go_default_library", + "//api/server/httprest:go_default_library", "//api/server/structs:go_default_library", "//async/event:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", @@ -42,7 +43,6 @@ go_library( "//io/file:go_default_library", "//io/logs:go_default_library", "//io/prompt:go_default_library", - "//monitoring/tracing:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -63,13 +63,13 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/slashing-protection-history:go_default_library", "//validator/slashing-protection-history/format:go_default_library", + "//validator/web:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_fsnotify_fsnotify//:go_default_library", "@com_github_golang_jwt_jwt_v4//:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library", - "@com_github_grpc_ecosystem_go_grpc_middleware//recovery:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//retry:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//tracing/opentracing:go_default_library", "@com_github_grpc_ecosystem_go_grpc_prometheus//:go_default_library", @@ -78,11 +78,9 @@ go_library( "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_tyler_smith_go_bip39//wordlists:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", - "@io_opencensus_go//plugin/ocgrpc:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", - "@org_golang_google_grpc//reflection:go_default_library", "@org_golang_google_grpc//status:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", ], @@ -144,7 +142,6 @@ go_test( "@com_github_golang_protobuf//ptypes/empty", "@com_github_google_uuid//:go_default_library", "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", diff --git a/validator/rpc/auth_token.go b/validator/rpc/auth_token.go index ecff1019b570..df67fae07965 100644 --- a/validator/rpc/auth_token.go +++ b/validator/rpc/auth_token.go @@ -104,7 +104,7 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) continue } - validatorWebAddr := fmt.Sprintf("%s:%d", s.grpcGatewayHost, s.grpcGatewayPort) + validatorWebAddr := fmt.Sprintf("%s:%d", s.httpHost, s.httpPort) logValidatorWebAuth(validatorWebAddr, s.authToken, authTokenPath) case err := <-watcher.Errors: log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) diff --git a/validator/rpc/beacon.go b/validator/rpc/beacon.go index 5ae024d3011a..b6ccd2f507f4 100644 --- a/validator/rpc/beacon.go +++ b/validator/rpc/beacon.go @@ -19,7 +19,7 @@ import ( "google.golang.org/grpc" ) -// Initialize a client connect to a beacon node gRPC endpoint. +// Initialize a client connect to a beacon node gRPC or HTTP endpoint. func (s *Server) registerBeaconClient() error { streamInterceptor := grpc.WithStreamInterceptor(middleware.ChainStreamClient( grpcopentracing.StreamClientInterceptor(), @@ -62,6 +62,5 @@ func (s *Server) registerBeaconClient() error { s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler) - return nil } diff --git a/validator/rpc/handlers_beacon.go b/validator/rpc/handlers_beacon.go index 87163985246a..b69a0dfc47ae 100644 --- a/validator/rpc/handlers_beacon.go +++ b/validator/rpc/handlers_beacon.go @@ -42,6 +42,7 @@ func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { } genesisTime := uint64(time.Unix(genesis.GenesisTime.Seconds, 0).Unix()) address := genesis.DepositContractAddress + chainHead, err := s.chainClient.ChainHead(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "ChainHead").Error(), http.StatusInternalServerError) diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 4cb58217df26..e55b5b94d992 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -17,7 +17,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -46,7 +45,6 @@ import ( mocks "github.com/prysmaticlabs/prysm/v5/validator/testing" "github.com/urfave/cli/v2" "go.uber.org/mock/gomock" - "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -707,7 +705,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := context.Background() defaultWalletPath = setupWalletDir(t) opts := []accounts.Option{ accounts.WithWalletDir(defaultWalletPath), @@ -970,7 +968,7 @@ func TestServer_SetGasLimit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := context.Background() pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") @@ -1178,7 +1176,7 @@ func TestServer_SetGasLimit_InvalidPubKey(t *testing.T) { } func TestServer_DeleteGasLimit(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := context.Background() pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") require.NoError(t, err) @@ -1621,7 +1619,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) { defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := context.Background() pubkey := "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493" byteval, err := hexutil.Decode(pubkey) require.NoError(t, err) @@ -1831,7 +1829,7 @@ func TestServer_SetFeeRecipientByPubkey_InvalidFeeRecipient(t *testing.T) { } func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := context.Background() pubkey := "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493" byteval, err := hexutil.Decode(pubkey) require.NoError(t, err) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index 6120e5ccfd08..25ffe8c21a9e 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -6,34 +6,27 @@ import ( "net" "net/http" "path/filepath" + "strings" "time" "github.com/gorilla/mux" - middleware "github.com/grpc-ecosystem/go-grpc-middleware" - recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" - grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" - grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/io/logs" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" "github.com/prysmaticlabs/prysm/v5/validator/client" iface "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/db" - "go.opencensus.io/plugin/ocgrpc" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" + "github.com/prysmaticlabs/prysm/v5/validator/web" ) -// Config options for the gRPC server. +// Config options for the HTTP server. type Config struct { - Host string - Port string - GRPCGatewayHost string - GRPCGatewayPort int + HTTPHost string + HTTPPort int GRPCMaxCallRecvMsgSize int GRPCRetries uint GRPCRetryDelay time.Duration @@ -51,20 +44,17 @@ type Config struct { Router *mux.Router } -// Server defining a gRPC server for the remote signer API. +// Server defining a HTTP server for the remote signer API and registering clients type Server struct { ctx context.Context cancel context.CancelFunc - host string - port string - grpcGatewayHost string - grpcGatewayPort int - listener net.Listener + httpHost string + httpPort int + server *httprest.Server grpcMaxCallRecvMsgSize int grpcRetries uint grpcRetryDelay time.Duration grpcHeaders []string - grpcServer *grpc.Server beaconNodeValidatorClient iface.ValidatorClient chainClient iface.ChainClient nodeClient iface.NodeClient @@ -85,9 +75,10 @@ type Server struct { router *mux.Router logStreamer logs.Streamer logStreamerBufferSize int + startFailure error } -// NewServer instantiates a new gRPC server. +// NewServer instantiates a new HTTP server. func NewServer(ctx context.Context, cfg *Config) *Server { ctx, cancel := context.WithCancel(ctx) server := &Server{ @@ -95,10 +86,8 @@ func NewServer(ctx context.Context, cfg *Config) *Server { cancel: cancel, logStreamer: logs.NewStreamServer(), logStreamerBufferSize: 1000, // Enough to handle most bursts of logs in the validator client. - host: cfg.Host, - port: cfg.Port, - grpcGatewayHost: cfg.GRPCGatewayHost, - grpcGatewayPort: cfg.GRPCGatewayPort, + httpHost: cfg.HTTPHost, + httpPort: cfg.HTTPPort, grpcMaxCallRecvMsgSize: cfg.GRPCMaxCallRecvMsgSize, grpcRetries: cfg.GRPCRetries, grpcRetryDelay: cfg.GRPCRetryDelay, @@ -124,62 +113,54 @@ func NewServer(ctx context.Context, cfg *Config) *Server { if err := server.initializeAuthToken(); err != nil { log.WithError(err).Error("Could not initialize web auth token") } - validatorWebAddr := fmt.Sprintf("%s:%d", server.grpcGatewayHost, server.grpcGatewayPort) + validatorWebAddr := fmt.Sprintf("%s:%d", server.httpHost, server.httpPort) logValidatorWebAuth(validatorWebAddr, server.authToken, server.authTokenPath) go server.refreshAuthTokenFromFileChanges(server.ctx, server.authTokenPath) } - // immediately register routes to override any catchalls - if err := server.InitializeRoutes(); err != nil { - log.WithError(err).Fatal("Could not initialize routes") + // Register a gRPC or HTTP client to the beacon node. + // Used for proxy calls to beacon node from validator REST handlers + if err := server.registerBeaconClient(); err != nil { + log.WithError(err).Fatal("Could not register beacon chain gRPC or HTTP client") } - return server -} -// Start the gRPC server. -func (s *Server) Start() { - // Setup the gRPC server options and TLS configuration. - address := net.JoinHostPort(s.host, s.port) - lis, err := net.Listen("tcp", address) - if err != nil { - log.WithError(err).Errorf("Could not listen to port in Start() %s", address) - } - s.listener = lis - - // Register interceptors for metrics gathering as well as our - // own, custom JWT unary interceptor. - opts := []grpc.ServerOption{ - grpc.StatsHandler(&ocgrpc.ServerHandler{}), - grpc.UnaryInterceptor(middleware.ChainUnaryServer( - recovery.UnaryServerInterceptor( - recovery.WithRecoveryHandlerContext(tracing.RecoveryHandlerFunc), - ), - grpcprometheus.UnaryServerInterceptor, - grpcopentracing.UnaryServerInterceptor(), - s.AuthTokenInterceptor(), - )), + if err := server.InitializeRoutesWithWebHandler(); err != nil { + log.WithError(err).Fatal("Could not initialize routes with web handler") } - grpcprometheus.EnableHandlingTimeHistogram() - s.grpcServer = grpc.NewServer(opts...) - - // Register a gRPC client to the beacon node. - if err := s.registerBeaconClient(); err != nil { - log.WithError(err).Fatal("Could not register beacon chain gRPC client") + opts := []httprest.Option{ + httprest.WithRouter(cfg.Router), + httprest.WithHTTPAddr(net.JoinHostPort(server.httpHost, fmt.Sprintf("%d", server.httpPort))), + } + // create and set a new http server + s, err := httprest.New(server.ctx, opts...) + if err != nil { + log.WithError(err).Fatal("Failed to create HTTP server") } + server.server = s + + return server +} - // Register services available for the gRPC server. - reflection.Register(s.grpcServer) +// Start the HTTP server and registers clients that can communicate via HTTP or gRPC. +func (s *Server) Start() { + s.server.Start() +} - // routes needs to be set before the server calls the server function - go func() { - if s.listener != nil { - if err := s.grpcServer.Serve(s.listener); err != nil { - log.WithError(err).Error("Could not serve") - } +// InitializeRoutesWithWebHandler adds a catchall wrapper for web handling +func (s *Server) InitializeRoutesWithWebHandler() error { + if err := s.InitializeRoutes(); err != nil { + return err + } + s.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/api") { + r.URL.Path = strings.Replace(r.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs + s.router.ServeHTTP(w, r) + } else { + // Finally, we handle with the web server. + web.Handler(w, r) } - }() - - log.WithField("address", address).Info("gRPC server listening on address") + }) + return nil } // InitializeRoutes initializes pure HTTP REST endpoints for the validator client. @@ -233,21 +214,20 @@ func (s *Server) InitializeRoutes() error { // slashing protection endpoints s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/export", s.ExportSlashingProtection).Methods(http.MethodGet) s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/import", s.ImportSlashingProtection).Methods(http.MethodPost) + log.Info("Initialized REST API routes") return nil } -// Stop the gRPC server. +// Stop the HTTP server. func (s *Server) Stop() error { - s.cancel() - if s.listener != nil { - s.grpcServer.GracefulStop() - log.Debug("Initiated graceful stop of server") - } - return nil + return s.server.Stop() } // Status returns an error if the service is unhealthy. func (s *Server) Status() error { + if s.startFailure != nil { + return s.startFailure + } return nil } diff --git a/validator/web/BUILD.bazel b/validator/web/BUILD.bazel index f9a4a63935fa..63a3d714541a 100644 --- a/validator/web/BUILD.bazel +++ b/validator/web/BUILD.bazel @@ -11,7 +11,6 @@ go_library( ], importpath = "github.com/prysmaticlabs/prysm/v5/validator/web", visibility = [ - "//api/gateway:__pkg__", "//validator:__subpackages__", ], deps = ["@com_github_sirupsen_logrus//:go_default_library"], diff --git a/validator/web/handler.go b/validator/web/handler.go index ac9ad89d3083..c5f5f46199c1 100644 --- a/validator/web/handler.go +++ b/validator/web/handler.go @@ -10,7 +10,6 @@ import ( const prefix = "prysm-web-ui" // Handler serves web requests from the bundled site data. -// DEPRECATED: Prysm Web UI and associated endpoints will be fully removed in a future hard fork. var Handler = func(res http.ResponseWriter, req *http.Request) { addSecurityHeaders(res) u, err := url.ParseRequestURI(req.RequestURI) From 2bffb83a00e8a6ed58b138feaee5ddf98ad2ac63 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:19:56 -0500 Subject: [PATCH 280/325] gateway flag changes breaking release e2e (#14418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * e2e release test breaks due to changes in flag naming * changing approach to fix * adding some small alias test * fixing test, changelog, and flag name * Update config_test.go Co-authored-by: Radosław Kapka --------- Co-authored-by: Radosław Kapka --- CHANGELOG.md | 4 ++-- beacon-chain/node/config_test.go | 23 +++++++++++++++++++++++ cmd/validator/flags/flags.go | 2 +- testing/endtoend/components/validator.go | 3 ++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 667ea9ce90ce..350a871ef228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,8 +24,8 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - "Submitted builder validator registration settings for custom builders" log message moved to debug level. - config: Genesis validator root is now hardcoded in params.BeaconConfig() - `grpc-gateway-host` is renamed to http-host. The old name can still be used as an alias. -- `grpc-gateway-port` is renamed to http-port. -- `grpc-gateway-corsdomain` is renamed to http-cors-domain. +- `grpc-gateway-port` is renamed to http-port. The old name can still be used as an alias. +- `grpc-gateway-corsdomain` is renamed to http-cors-domain. The old name can still be used as an alias. - `api-timeout` is changed from int flag to duration flag, default value updated. ### Deprecated diff --git a/beacon-chain/node/config_test.go b/beacon-chain/node/config_test.go index f2c08f380b51..4c045f4dcd1b 100644 --- a/beacon-chain/node/config_test.go +++ b/beacon-chain/node/config_test.go @@ -228,3 +228,26 @@ func TestConfigureInterop(t *testing.T) { }) } } + +func TestAliasFlag(t *testing.T) { + // Create a new app with the flag + app := &cli.App{ + Flags: []cli.Flag{flags.HTTPServerHost}, + Action: func(c *cli.Context) error { + // Test if the alias works and sets the flag correctly + if c.IsSet("grpc-gateway-host") && c.IsSet("http-host") { + return nil + } + return cli.Exit("Alias or flag not set", 1) + }, + } + + // Simulate command line arguments that include the alias + args := []string{"app", "--grpc-gateway-host", "config.yml"} + + // Run the app with the simulated arguments + err := app.Run(args) + + // Check if the alias set the flag correctly + assert.NoError(t, err) +} diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index fbacc9ca9752..e873d16c3f20 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -120,7 +120,7 @@ var ( } // HTTPServerCorsDomain adds accepted cross origin request addresses. HTTPServerCorsDomain = &cli.StringFlag{ - Name: "corsdomain", + Name: "http-cors-domain", Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced).`, Value: "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", Aliases: []string{"grpc-gateway-corsdomain"}, diff --git a/testing/endtoend/components/validator.go b/testing/endtoend/components/validator.go index 580b74be8fff..4135c99539c0 100644 --- a/testing/endtoend/components/validator.go +++ b/testing/endtoend/components/validator.go @@ -221,12 +221,13 @@ func (v *ValidatorNode) Start(ctx context.Context) error { if err != nil { return err } + portFlagName := "grpc-gateway-port" // TODO: replace port flag name with flags.HTTPServerPort.Name in a future release args := []string{ fmt.Sprintf("--%s=%s/eth2-val-%d", cmdshared.DataDirFlag.Name, e2e.TestParams.TestPath, index), fmt.Sprintf("--%s=%s", cmdshared.LogFileName.Name, logFile.Name()), fmt.Sprintf("--%s=%s", flags.GraffitiFileFlag.Name, gFile), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.ValidatorMetricsPort+index), - fmt.Sprintf("--%s=%d", flags.HTTPServerPort.Name, e2e.TestParams.Ports.ValidatorHTTPPort+index), + fmt.Sprintf("--%s=%d", portFlagName, e2e.TestParams.Ports.ValidatorHTTPPort+index), fmt.Sprintf("--%s=localhost:%d", flags.BeaconRPCProviderFlag.Name, beaconRPCPort), fmt.Sprintf("--%s=%s", flags.GRPCHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything. From eec3b0b7fecd5bb5609e3095dab1f6bae74a1d62 Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:36:31 +0530 Subject: [PATCH 281/325] feat: introduce Capella and Deneb `full-node.md` lc changes (#14376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: introduce Capella and Deneb `full-node.md` lc changes * add switch-case and replace `[][]byte` with `[][]string` * return version name in http header * populate header and use `interfaces.ReadOnlyBeaconBlock` * fix lint * merge cases in switch case and replace `interfaces.ExecutionData` with `*ExecutionPayloadHeader` * minor fixes * refactor `createLightClientBootstrapCapella` and `createLightClientBootstrapDeneb` * use lightclientheader instead of different versions * fix failing `TestLightClientHandler_GetLightClientBootstrap` tests * fix lint * refactor handlers * refactor handlers more * refactor handlers even more * create conversions_lightclient * fix lint errors * add deneb and capella proto headers * update lightclientbootstrap proto struct to capella&deneb * update usecases * update usecases * resolve panic in header.GetBeacon * fix spacings * refactor core/lightclient.go * fix isBetterUpdate * use errors.wrap instead of fmt.errorf * changelog entry * fix lint errors * fix api structs to use json rawMessage * inline unmarshal * remove redundant nil check * revert remove redundant nil check * return error in newLightClientUpdateToJSON * inline getExecutionData * better error handling --------- Co-authored-by: Radosław Kapka Co-authored-by: Inspector-Butters Co-authored-by: Bastin <43618253+Inspector-Butters@users.noreply.github.com> --- CHANGELOG.md | 626 ++++++--- api/server/structs/BUILD.bazel | 1 + api/server/structs/conversions_lightclient.go | 3 + api/server/structs/endpoints_lightclient.go | 40 +- beacon-chain/core/light-client/BUILD.bazel | 7 + beacon-chain/core/light-client/lightclient.go | 373 ++++- .../core/light-client/lightclient_test.go | 109 +- beacon-chain/rpc/eth/events/events.go | 41 +- beacon-chain/rpc/eth/light-client/BUILD.bazel | 5 + beacon-chain/rpc/eth/light-client/handlers.go | 20 +- .../rpc/eth/light-client/handlers_test.go | 1216 +++++++++++++++-- beacon-chain/rpc/eth/light-client/helpers.go | 404 +++++- .../rpc/eth/light-client/helpers_test.go | 404 ++++-- consensus-types/blocks/proofs.go | 17 +- proto/eth/v2/BUILD.bazel | 1 + proto/eth/v2/beacon_lightclient.pb.go | 744 +++++++--- proto/eth/v2/beacon_lightclient.proto | 34 +- proto/eth/v2/custom.go | 18 +- testing/util/lightclient.go | 159 ++- 19 files changed, 3403 insertions(+), 819 deletions(-) create mode 100644 api/server/structs/conversions_lightclient.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 350a871ef228..7d48ebdb7fca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Changelog +# Changelog All notable changes to this project will be documented in this file. @@ -10,13 +10,15 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Aggregate and proof committee validation for Electra. - More tests for electra field generation. -- Light client support: implement `ComputeFieldRootsForBlockBody`. +- Light client support: Implement `ComputeFieldRootsForBlockBody`. - Light client support: Add light client database changes. +- Light client support: Implement capella and deneb changes. ### Changed - `getLocalPayload` has been refactored to enable work in ePBS branch. -- `TestNodeServer_GetPeer` and `TestNodeServer_ListPeers` test flakes resolved by iterating the whole peer list to find a match rather than taking the first peer in the map. +- `TestNodeServer_GetPeer` and `TestNodeServer_ListPeers` test flakes resolved by iterating the whole peer list to find + a match rather than taking the first peer in the map. - Passing spectests v1.5.0-alpha.4 and v1.5.0-alpha.5. - Beacon chain now asserts that the external builder block uses the expected gas limit. - Electra: Add electra objects to beacon API. @@ -27,6 +29,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `grpc-gateway-port` is renamed to http-port. The old name can still be used as an alias. - `grpc-gateway-corsdomain` is renamed to http-cors-domain. The old name can still be used as an alias. - `api-timeout` is changed from int flag to duration flag, default value updated. +- Light client support: abstracted out the light client headers with different versions. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. @@ -46,14 +49,18 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve ### Security - ## [v5.1.0](https://github.com/prysmaticlabs/prysm/compare/v5.0.4...v5.1.0) - 2024-08-20 -This release contains 171 new changes and many of these are related to Electra! Along side the Electra changes, there are nearly 100 changes related to bug fixes, feature additions, and other improvements to Prysm. Updating to this release is recommended at your convenience. +This release contains 171 new changes and many of these are related to Electra! Along side the Electra changes, there +are nearly 100 changes related to bug fixes, feature additions, and other improvements to Prysm. Updating to this +release is recommended at your convenience. ⚠️ Deprecation Notice: Removal of gRPC Gateway and Gateway Flag Renaming ⚠️ -In an upcoming release, we will be deprecating the gRPC gateway and renaming several associated flags. This change will result in the removal of access to several internal APIs via REST, though the gRPC endpoints will remain unaffected. We strongly encourage systems to transition to using the beacon API endpoints moving forward. Please refer to PR for more details. +In an upcoming release, we will be deprecating the gRPC gateway and renaming several associated flags. This change will +result in the removal of access to several internal APIs via REST, though the gRPC endpoints will remain unaffected. We +strongly encourage systems to transition to using the beacon API endpoints moving forward. Please refer to PR for more +details. ### Added @@ -64,7 +71,8 @@ In an upcoming release, we will be deprecating the gRPC gateway and renaming sev - Add middleware for Content-Type and Accept headers - Add debug logs for proposer settings - Add tracing to beacon api package -- Add support for persistent validator keys when using remote signer. --validators-external-signer-public-keys and --validators-external-signer-key-file See the docs page for more info. +- Add support for persistent validator keys when using remote signer. --validators-external-signer-public-keys and + --validators-external-signer-key-file See the docs page for more info. - Add AggregateKeyFromIndices to beacon state to reduce memory usage when processing attestations - Add GetIndividualVotes endpoint - Implement is_better_update for light client @@ -118,8 +126,7 @@ In an upcoming release, we will be deprecating the gRPC gateway and renaming sev - Fix Event stream with carriage return support - Fix panic on empty block result in REST API - engine_getPayloadBodiesByRangeV1 - fix, adding hexutil encoding on request parameters -- Use sync committee period instead of epoch in `createLightClientUpdate` - +- Use sync committee period instead of epoch in `createLightClientUpdate` ### Security @@ -127,7 +134,9 @@ In an upcoming release, we will be deprecating the gRPC gateway and renaming sev ## [v5.0.4](https://github.com/prysmaticlabs/prysm/compare/v5.0.3...v5.0.4) - 2024-07-21 -This release has many wonderful bug fixes and improvements. Some highlights include p2p peer fix for windows users, beacon API fix for retrieving blobs older than the minimum blob retention period, and improvements to initial sync by avoiding redundant blob downloads. +This release has many wonderful bug fixes and improvements. Some highlights include p2p peer fix for windows users, +beacon API fix for retrieving blobs older than the minimum blob retention period, and improvements to initial sync by +avoiding redundant blob downloads. Updating to this release is recommended at your earliest convenience, especially for windows users. @@ -189,7 +198,9 @@ Updating to this release is recommended at your earliest convenience, especially ## [v5.0.3](https://github.com/prysmaticlabs/prysm/compare/v5.0.2...v5.0.3) - 2024-04-04 -Prysm v5.0.3 is a small patch release with some nice additions and bug fixes. Updating to this release is recommended for users on v5.0.0 or v5.0.1. There aren't many changes since last week's v5.0.2 so upgrading is not strictly required, but there are still improvements in this release so update if you can! +Prysm v5.0.3 is a small patch release with some nice additions and bug fixes. Updating to this release is recommended +for users on v5.0.0 or v5.0.1. There aren't many changes since last week's v5.0.2 so upgrading is not strictly required, +but there are still improvements in this release so update if you can! ### Added @@ -221,16 +232,19 @@ No security updates in this release. ## [v5.0.2](https://github.com/prysmaticlabs/prysm/compare/v5.0.1...v5.0.2) - 2024-03-27 -This release has many optimizations, UX improvements, and bug fixes. Due to the number of important bug fixes and optimizations, we encourage all operators to update to v5.0.2 at their earliest convenience. - -In this release, there is a notable change to the default value of --local-block-value-boost from 0 to 10. This means that the default behavior of using the builder API / mev-boost requires the builder bid to be 10% better than your local block profit. If you want to preserve the existing behavior, set --local-block-value-boost=0. +This release has many optimizations, UX improvements, and bug fixes. Due to the number of important bug fixes and +optimizations, we encourage all operators to update to v5.0.2 at their earliest convenience. +In this release, there is a notable change to the default value of --local-block-value-boost from 0 to 10. This means +that the default behavior of using the builder API / mev-boost requires the builder bid to be 10% better than your local +block profit. If you want to preserve the existing behavior, set --local-block-value-boost=0. ### Added - API: Add support for sync committee selections - blobs: call fsync between part file write and rename (feature flag --blob-save-fsync) -- Implement EIP-3076 minimal slashing protection, using a filesystem database (feature flag --enable-minimal-slashing-protection) +- Implement EIP-3076 minimal slashing protection, using a filesystem database (feature flag + --enable-minimal-slashing-protection) - Save invalid block to temp --save-invalid-block-temp - Compute unrealized checkpoints with pcli - Add gossip blob sidecar verification ms metric @@ -309,7 +323,8 @@ In this release, there is a notable change to the default value of --local-block - Fix Data Race in Epoch Boundary - exit blob fetching for cp block if outside retention - Do not check parent weight on early FCU -- Fix VC DB conversion when no proposer settings is defined and add Experimental flag in the --enable-minimal-slashing-protection help. +- Fix VC DB conversion when no proposer settings is defined and add Experimental flag in the + --enable-minimal-slashing-protection help. - keymanager api: lowercase statuses - Fix unrealized justification - fix race condition when pinging peers @@ -342,9 +357,11 @@ In this release, there is a notable change to the default value of --local-block ## [v5.0.1](https://github.com/prysmaticlabs/prysm/compare/v5.0.0...v5.0.1) - 2024-03-08 -This minor patch release has some nice improvements over the recent v5.0.0 for Deneb. We have minimized this patch release to include only low risk and valuable fixes or features ahead of the upcoming network upgrade on March 13th. +This minor patch release has some nice improvements over the recent v5.0.0 for Deneb. We have minimized this patch +release to include only low risk and valuable fixes or features ahead of the upcoming network upgrade on March 13th. -Deneb is scheduled for mainnet epoch 269568 on March 13, 2024 at 01:55:35pm UTC. All operators MUST update their Prysm software to v5.0.0 or later before the upgrade in order to continue following the blockchain. +Deneb is scheduled for mainnet epoch 269568 on March 13, 2024 at 01:55:35pm UTC. All operators MUST update their Prysm +software to v5.0.0 or later before the upgrade in order to continue following the blockchain. ### Added @@ -372,14 +389,19 @@ Prysm version v5.0.0 or later is required to maintain participation in the netwo Behold the Prysm v5 release with official support for Deneb on Ethereum mainnet! -Deneb is scheduled for mainnet epoch 269568 on March 13, 2024 at 01:55:35pm UTC. All operators MUST update their Prysm software to v5.0.0 or later before the upgrade in order to continue following the blockchain. +Deneb is scheduled for mainnet epoch 269568 on March 13, 2024 at 01:55:35pm UTC. All operators MUST update their Prysm +software to v5.0.0 or later before the upgrade in order to continue following the blockchain. -This release brings improvements to the backfill functionality of the beacon node to support backfilling blobs. If running a beacon node with checkpoint sync, we encourage you to test the backfilling functionality and share your feedback. Run with backfill enabled using the flag --enable-experimental-backfill. +This release brings improvements to the backfill functionality of the beacon node to support backfilling blobs. If +running a beacon node with checkpoint sync, we encourage you to test the backfilling functionality and share your +feedback. Run with backfill enabled using the flag --enable-experimental-backfill. Known Issues - --backfill-batch-size with a value of 1 or less breaks backfill. -- Validator client on v4.2.0 or older uses some API methods that are incompatible with beacon node v5. Ensure that you have updated the beacon node and validator client to v4.2.1 and then upgrade to v5 or update both processes at the same time to minimize downtime. +- Validator client on v4.2.0 or older uses some API methods that are incompatible with beacon node v5. Ensure that you + have updated the beacon node and validator client to v4.2.1 and then upgrade to v5 or update both processes at the + same time to minimize downtime. ### Added @@ -419,7 +441,6 @@ The following flags have been removed entirely: - --safe-slots-to-import-optimistically - --show-deposit-data - ### Removed - Prysm gRPC slasher endpoints are removed @@ -449,49 +470,50 @@ The following flags have been removed entirely: - Check non-zero blob data is written to disk - Avoid blob partial filepath collisions with mem addr entropy - ### Security v5.0.0 of Prysm is required to maintain participation in the network after the Deneb upgrade. ## [v4.2.1](https://github.com/prysmaticlabs/prysm/compare/v4.2.0...v4.2.1) - 2024-01-29 -Welcome to Prysm Release v4.2.1! This release is highly recommended for stakers and node operators, possibly being the final update before V5. +Welcome to Prysm Release v4.2.1! This release is highly recommended for stakers and node operators, possibly being the +final update before V5. -⚠️ This release will cause failures on Goerli, Sepolia and Holeski testnets, when running on certain older CPUs without AVX support (eg Celeron) after the Deneb fork. This is not an issue for mainnet. +⚠️ This release will cause failures on Goerli, Sepolia and Holeski testnets, when running on certain older CPUs without +AVX support (eg Celeron) after the Deneb fork. This is not an issue for mainnet. ### Added - Linter: Wastedassign linter enabled to improve code quality. - API Enhancements: - - Added payload return in Wei for /eth/v3/validator/blocks. - - Added Holesky Deneb Epoch for better epoch management. + - Added payload return in Wei for /eth/v3/validator/blocks. + - Added Holesky Deneb Epoch for better epoch management. - Testing Enhancements: - - Clear cache in tests of core helpers to ensure test reliability. - - Added Debug State Transition Method for improved debugging. - - Backfilling test: Enabled backfill in E2E tests for more comprehensive coverage. + - Clear cache in tests of core helpers to ensure test reliability. + - Added Debug State Transition Method for improved debugging. + - Backfilling test: Enabled backfill in E2E tests for more comprehensive coverage. - API Updates: Re-enabled jwt on keymanager API for enhanced security. - Logging Improvements: Enhanced block by root log for better traceability. - Validator Client Improvements: - - Added Spans to Core Validator Methods for enhanced monitoring. - - Improved readability in validator client code for better maintenance (various commits). + - Added Spans to Core Validator Methods for enhanced monitoring. + - Improved readability in validator client code for better maintenance (various commits). ### Changed - Optimizations and Refinements: - - Lowered resource usage in certain processes for efficiency. - - Moved blob rpc validation closer to peer read for optimized processing. - - Cleaned up validate beacon block code for clarity and efficiency. - - Updated Sepolia Deneb fork epoch for alignment with network changes. - - Changed blob latency metrics to milliseconds for more precise measurement. - - Altered getLegacyDatabaseLocation message for better clarity. - - Improved wait for activation method for enhanced performance. - - Capitalized Aggregated Unaggregated Attestations Log for consistency. - - Modified HistoricalRoots usage for accuracy. - - Adjusted checking of attribute emptiness for efficiency. + - Lowered resource usage in certain processes for efficiency. + - Moved blob rpc validation closer to peer read for optimized processing. + - Cleaned up validate beacon block code for clarity and efficiency. + - Updated Sepolia Deneb fork epoch for alignment with network changes. + - Changed blob latency metrics to milliseconds for more precise measurement. + - Altered getLegacyDatabaseLocation message for better clarity. + - Improved wait for activation method for enhanced performance. + - Capitalized Aggregated Unaggregated Attestations Log for consistency. + - Modified HistoricalRoots usage for accuracy. + - Adjusted checking of attribute emptiness for efficiency. - Database Management: - - Moved --db-backup-output-dir as a deprecated flag for database management simplification. - - Added the Ability to Defragment the Beacon State for improved database performance. + - Moved --db-backup-output-dir as a deprecated flag for database management simplification. + - Added the Ability to Defragment the Beacon State for improved database performance. - Dependency Update: Bumped quic-go version from 0.39.3 to 0.39.4 for up-to-date dependencies. ### Removed @@ -502,12 +524,12 @@ Welcome to Prysm Release v4.2.1! This release is highly recommended for stakers ### Fixed - Bug Fixes: - - Fixed off by one error for improved accuracy. - - Resolved small typo in error messages for clarity. - - Addressed minor issue in blsToExecChange validator for better validation. - - Corrected blobsidecar json tag for commitment inclusion proof. - - Fixed ssz post-requests content type check. - - Resolved issue with port logging in bootnode. + - Fixed off by one error for improved accuracy. + - Resolved small typo in error messages for clarity. + - Addressed minor issue in blsToExecChange validator for better validation. + - Corrected blobsidecar json tag for commitment inclusion proof. + - Fixed ssz post-requests content type check. + - Resolved issue with port logging in bootnode. - Test Fixes: Re-enabled Slasher E2E Test for more comprehensive testing. ### Security @@ -516,32 +538,42 @@ No security issues in this release. ## [v4.2.0](https://github.com/prysmaticlabs/prysm/compare/v4.1.1...v4.2.0) - 2024-01-11 -Happy new year! We have an incredibly exciting release to kick off the new year. This release is **strongly recommended** for all operators to update as it has many bug fixes, security patches, and features that will improve the Prysm experience on mainnet. This release has so many wonderful changes that we've deviated from our normal release notes format to aptly categorize the changes. +Happy new year! We have an incredibly exciting release to kick off the new year. This release is **strongly recommended +** for all operators to update as it has many bug fixes, security patches, and features that will improve the Prysm +experience on mainnet. This release has so many wonderful changes that we've deviated from our normal release notes +format to aptly categorize the changes. ### Highlights #### Upgrading / Downgrading Validators -There are some API changes bundled in this release that require you to upgrade or downgrade in particular order. If the validator is updated before the beacon node, it will see repeated 404 errors at start up until the beacon node is updated as it uses a new API endpoint introduced in v4.2.0. +There are some API changes bundled in this release that require you to upgrade or downgrade in particular order. If the +validator is updated before the beacon node, it will see repeated 404 errors at start up until the beacon node is +updated as it uses a new API endpoint introduced in v4.2.0. :arrow_up_small: **Upgrading**: Upgrade the beacon node, then the validator. :arrow_down_small: **Downgrading**: Downgrade the validator to v4.1.1 then downgrade the beacon node. #### Deneb Goerli Support + This release adds in full support for the upcoming deneb hard fork on goerli next week on January 17th. #### Networking Parameter Changes + This release increases the default peer count to 70 from 45. The reason this is done is so that node's running with default peer counts can perform their validator duties as expected. Users who want to use the old peer count can add in `--p2p-max-peers=45` as a flag. #### Profile Guided Optimization -This release has binaries built using PGO, for more information on how it works feel free to look here: https://tip.golang.org/doc/pgo . -This allows the go compiler to build more optimized Prysm binaries using production profiles and workloads. + +This release has binaries built using PGO, for more information on how it works feel free to look +here: https://tip.golang.org/doc/pgo . +This allows the go compiler to build more optimized Prysm binaries using production profiles and workloads. #### ARM Supported Docker Images -Our docker images now support amd64 and arm64 architecture! This long awaited feature is finally here for Apple Silicon and Raspberry Pi users. +Our docker images now support amd64 and arm64 architecture! This long awaited feature is finally here for Apple Silicon +and Raspberry Pi users. ### Deneb @@ -593,18 +625,18 @@ Our docker images now support amd64 and arm64 architecture! This long awaited fe - Prune dangling blob - Use Afero Walk for Pruning Blob - Initialize blob storage without pruning -- Fix batch pruning errors +- Fix batch pruning errors - Blob filesystem add pruning during blob write - Blob filesystem add pruning at startup - Ensure partial blob is deleted if there's an error - Split blob pruning into two funcs - Use functional options for `--blob-retention-epochs` -- Blob filesystem: delete blobs +- Blob filesystem: delete blobs - Fix Blob Storage Path - Add blob getters - Blob filesystem: Save Blobs - Blob filesystem: prune blobs -- blobstorage: Improve mkdirall error +- blobstorage: Improve mkdirall error #### Beacon-API @@ -622,7 +654,7 @@ Our docker images now support amd64 and arm64 architecture! This long awaited fe #### Validator Client - Validator client: remove blob signing -- Deneb - web3signer +- Deneb - web3signer #### Testing @@ -640,7 +672,7 @@ Our docker images now support amd64 and arm64 architecture! This long awaited fe - Check builder header kzg commitment - Add more color to sending blob by range req log - Move pruning log to after retention check -- Enhance Pruning Logs +- Enhance Pruning Logs - Rename Blob retention epoch flag - Check that blobs count is correct when unblinding - Log blob's kzg commmitment at sync @@ -680,7 +712,7 @@ Our docker images now support amd64 and arm64 architecture! This long awaited fe - Verify lmd without ancestor - Track target in forkchoice - Return early from ReceiveBlock if already sycned - + #### Builder - Adding builder boost factor to get block v3 @@ -729,7 +761,7 @@ _Most of the PRs here involve shifting our http endpoints to using vanilla http - http endpoint cleanup - Revert "REST VC: Subscribe to Beacon API events " - proposer and attester slashing sse -- REST VC: Subscribe to Beacon API events +- REST VC: Subscribe to Beacon API events - Simplify error handling for JsonRestHandler - Update block publishing to 2.4.2 spec - Use `SkipMevBoost` properly during block production @@ -869,12 +901,12 @@ _Most of the PRs here involve shifting our http endpoints to using vanilla http - Fix missing testnet versions. Issue - Update README.md - Only run metrics for canonical blocks -- Relax file permissions check on existing directories +- Relax file permissions check on existing directories - forkchoice.Getter wrapper with locking wrappers - Initialize cancellable root context in main.go - Fix forkchoice pkg's comments grammar - lock RecentBlockSlot -- Comment typo +- Comment typo - Optimize `ReplayBlocks` for Zero Diff - Remove default value of circuit breaker flags - Fix Withdrawals @@ -899,7 +931,8 @@ _Most of the PRs here involve shifting our http endpoints to using vanilla http ## [v4.1.1](https://github.com/prysmaticlabs/prysm/compare/v4.1.0...v4.1.1) - 2023-10-24 -This patch release includes two cherry-picked changes from the develop branch to resolve critical issues that affect a small set of users. +This patch release includes two cherry-picked changes from the develop branch to resolve critical issues that affect a +small set of users. ### Fixed @@ -912,11 +945,17 @@ No security issues in thsi release. ## [v4.1.0](https://github.com/prysmaticlabs/prysm/compare/v4.0.8...v4.1.0) - 2023-08-22 -- **Fundamental Deneb Support**: This release lays the foundation for Deneb support, although features like backwards syncing and filesystem-based blob storage are planned for Q4 2024. -- **Multi-Value Slices for Beacon State**: Implemented multi-value slices to reduce the memory footprint and optimize certain processing paths. This data structure allows for storing values shared between state instances more efficiently. This feature is controller by the `--enable-experimental-state` flag. -- **EIP-4881 Deposit Tree**: Integrated the EIP-4881 Deposit Tree into Prysm to optimize runtime block processing and production. This feature is controlled by a flag: `--enable-eip-4881` -- **BLST version 0.3.11**: Introduced a significant improvement to the portable build's performance. The portable build now features runtime detection, automatically enabling optimized code paths if your CPU supports it. -- **Multiarch Containers Preview Available**: multiarch (:wave: arm64 support :wave:) containers will be offered for preview at the following locations: +- **Fundamental Deneb Support**: This release lays the foundation for Deneb support, although features like backwards + syncing and filesystem-based blob storage are planned for Q4 2024. +- **Multi-Value Slices for Beacon State**: Implemented multi-value slices to reduce the memory footprint and optimize + certain processing paths. This data structure allows for storing values shared between state instances more + efficiently. This feature is controller by the `--enable-experimental-state` flag. +- **EIP-4881 Deposit Tree**: Integrated the EIP-4881 Deposit Tree into Prysm to optimize runtime block processing and + production. This feature is controlled by a flag: `--enable-eip-4881` +- **BLST version 0.3.11**: Introduced a significant improvement to the portable build's performance. The portable build + now features runtime detection, automatically enabling optimized code paths if your CPU supports it. +- **Multiarch Containers Preview Available**: multiarch (:wave: arm64 support :wave:) containers will be offered for + preview at the following locations: - Beacon Chain: [gcr.io/prylabs-dev/prysm/beacon-chain:v4.1.0](gcr.io/prylabs-dev/prysm/beacon-chain:v4.1.0) - Validator: [gcr.io/prylabs-dev/prysm/validator:v4.1.0](gcr.io/prylabs-dev/prysm/validator:v4.1.0) - Please note that in the next cycle, we will exclusively use these containers at the canonical URLs. @@ -924,13 +963,16 @@ No security issues in thsi release. ### Added #### EIP-4844: + ##### Core: + - **Deneb State & Block Types**: New state and block types added specifically for Deneb. - **Deneb Protobufs**: Protocol Buffers designed exclusively for Deneb. - **Deneb Engine API**: Specialized API endpoints for Deneb. - **Deneb Config/Params**: Deneb-specific configurations and parameters from the deneb-integration branch. ##### Blob Management: + - **Blob Retention Epoch Period**: Configurable retention periods for blobs. - **Blob Arrival Gossip Metric**: Metrics for blob arrivals via gossip protocol. - **Blob Merge Function**: Functionality to merge and validate saved/new blobs. @@ -938,37 +980,45 @@ No security issues in thsi release. - **Save Blobs to DB**: Feature to save blobs to the database for subscribers. ##### Logging and Validation: + - **Logging for Blob Sidecar**: Improved logging functionalities for Blob Sidecar. - **Blob Commitment Count Logging**: Introduced logging for blob commitment counts. - **Blob Validation**: A feature to validate blobs. ##### Additional Features and Tests: + - **Deneb Changes & Blobs to Builder**: Deneb-specific changes and blob functionality added to the builder. - **Deneb Blob Sidecar Events**: Blob sidecar events added as part of the Deneb release. - **KZG Commitments**: Functionality to copy KZG commitments when using the builder block. - **Deneb Validator Beacon APIs**: New REST APIs specifically for the Deneb release. - **Deneb Tests**: Test cases specific to the Deneb version. - **PublishBlockV2 for Deneb**: The `publishblockv2` endpoint implemented specifically for Deneb. -- **Builder Override & Builder Flow for Deneb**: An override for the builder and a new RPC to handle the builder flow in Deneb. +- **Builder Override & Builder Flow for Deneb**: An override for the builder and a new RPC to handle the builder flow in + Deneb. - **SSZ Detection for Deneb**: SSZ detection capabilities added for Deneb. - **Validator Signing for Deneb**: Validators can now sign Deneb blocks. - **Deneb Upgrade Function**: A function to handle the upgrade to Deneb. #### Rest of EIPs + - **EIP-4788**: Added support for Beacon block root in the EVM. -- **EIP-7044** and **EIP-7045**: Implemented support for Perpetually Valid Signed Voluntary Exits and increased the max attestation inclusion slot. +- **EIP-7044** and **EIP-7045**: Implemented support for Perpetually Valid Signed Voluntary Exits and increased the max + attestation inclusion slot. #### Beacon API: *Note: All Beacon API work is related with moving endpoints into pure HTTP handlers. This is NOT new functionality.* ##### Endpoints moved to HTTP: + - `/eth/v1/beacon/blocks` and `/eth/v1/beacon/blinded_blocks`. - `/eth/v1/beacon/states/{state_id}/committees`. - `/eth/v1/config/deposit_contract`. - `/eth/v1/beacon/pool/sync_committees`. -- `/eth/v1/beacon/states/{state_id}/validators`, `/eth/v1/beacon/states/{state_id}/validators/{validator_id}` and `/eth/v1/beacon/states/{state_id}/validator_balances`. -- `/eth/v1/validator/duties/attester/{epoch}`, `/eth/v1/validator/duties/proposer/{epoch}` and `/eth/v1/validator/duties/sync/{epoch}`. +- `/eth/v1/beacon/states/{state_id}/validators`, `/eth/v1/beacon/states/{state_id}/validators/{validator_id}` + and `/eth/v1/beacon/states/{state_id}/validator_balances`. +- `/eth/v1/validator/duties/attester/{epoch}`, `/eth/v1/validator/duties/proposer/{epoch}` + and `/eth/v1/validator/duties/sync/{epoch}`. - `/eth/v1/validator/register_validator`. - `/eth/v1/validator/prepare_beacon_proposer`. - `/eth/v1/beacon/headers`. @@ -981,13 +1031,16 @@ No security issues in thsi release. - `/eth/v1/beacon/headers/{block_id}` and `/eth/v1/validator/liveness/{epoch}`. ##### Miscellaneous: + - **Comma-Separated Query Params**: Support for comma-separated query parameters added to Beacon API. - **Middleware for Query Params**: Middleware introduced for handling comma-separated query parameters. - **Content-Type Header**: Compliance improved by adding Content-Type header to VC POST requests. - **Node Version**: REST-based node version endpoint implemented. #### Other additions + ##### Protocol: + - **Multi-Value Slice for Beacon State**: Enhanced the beacon state by utilizing a multi-value slice. - **EIP-4881 Deposit Tree**: EIP-4881 Deposit Tree integrated into Prysm, controlled by a feature flag. - **New Engine Methods**: New engine methods set as the default. @@ -995,36 +1048,45 @@ No security issues in thsi release. - **Block Commitment Checks**: Functionality to reject blocks with excessive commitments added. ##### State Management: + - **Alloc More Items**: Modified beacon-node/state to allocate an additional item during appends. -- **GetParentBlockHash Helper**: Refactoring of `getLocalPayloadAndBlobs` with a new helper function for fetching parent block hashes. +- **GetParentBlockHash Helper**: Refactoring of `getLocalPayloadAndBlobs` with a new helper function for fetching parent + block hashes. - **RW Lock for Duties**: Read-Write lock mechanism introduced for managing validator duties. ##### Build and CI/CD Improvements: + - **Manual Build Tag**: A "manual" build tag introduced to expedite CI build times. - **Multiarch Docker Containers**: Support for multiple architectures in Docker containers added. ##### Testing: + - **Init-Sync DA Tests**: Tests for initial sync Data Availability (DA) included. - **Fuzz List Timeout**: Github workflow for fuzz testing now includes a timeout setting. - **Go Fuzzing Workflow**: New Github workflow for Go fuzzing on a cron schedule. ##### Logging and Monitoring: + - **FFG-LMD Consistency Logging**: Enhanced logging for Finality Gadget LMD (FFG-LMD) consistency. - **Validator Count Endpoint**: New endpoint to count the number of validators. ##### User Interface and Web: + - **Web UI Release**: Prysm Web UI v2.0.4 released with unspecified updates and improvements. ##### Testnet support: + - **Holesky Support**: Support for Holesky decompositions integrated into the codebase. ##### Error Handling and Responses: + - **Validation Error in ForkchoiceUpdatedResponse**: Included validation errors in fork choice update responses. - **Wrapped Invalid Block Error**: Improved error handling for cases where an invalid block error is wrapped.. ### Changed #### General: + - **Skip MEV-Boost Flag**: Updated `GetBlock` RPC to utilize `skip mev-boost` flag. - **Portable Version of BLST**: Transitioned to portable BLST version as default. - **Teku Mainnet Bootnodes**: Refreshed Teku mainnet bootnodes ENRs. @@ -1032,6 +1094,7 @@ No security issues in thsi release. - **Parallel Block Building**: Deprecated sequential block building path #### Deneb-Specific Changes: + - **Deneb Spectests Release**: Upgraded to Deneb spectests v1.4.0-beta.2-hotfix. - **Deneb API and Builder Cleanup**: Conducted clean-up activities for Deneb-specific API and builder. - **Deneb Block Versioning**: Introduced changes related to Deneb produce block version 3. @@ -1040,23 +1103,28 @@ No security issues in thsi release. - **Blob Sidecar Syncing**: Altered behavior when value is 0. #### Code Cleanup and Refactor: + - **API Types Cleanup**: Reorganized API types for improved readability. - **Geth Client Headers**: Simplified code for setting geth client headers. - **Bug Report Template**: Revised requirements for more clarity. #### Flags and Configuration: + - **Safe Slots to Import Flag**: Deprecated this flag for standard alignment. - **Holesky Config**: Revised the Holesky configuration for new genesis. #### Logging: + - **Genesis State Warning**: Will log a warning if the genesis state size is under 1KB. - **Debug Log Removal**: Excised debug logs for cleaner output. #### Miscellaneous: + - **First Aggregation Timing**: Default setting for first aggregation is 7 seconds post-genesis. - **Pointer Usage**: Modified execution chain to use pointers, reducing copy operations. #### Dependency Updates: + - **Go Version Update**: Updated to Go version 1.20.7. - **Go Version Update**: Updated to Go version 1.20.9 for better security. - **Various Dependencies**: Updated multiple dependencies including Geth, Bazel, rules_go, Gazelle, BLST, and go-libp2p. @@ -1069,13 +1137,16 @@ No security issues in thsi release. - **Go-Playground/Validator**: Removed go-playground/validator from Beacon API. - **Reverted Cache Proposer ID**: Reversed the change that cached proposer ID on GetProposerDuties. - **Cache Proposer ID**: Reversed the functionality that cached proposer ID on GetProposerDuties. -- **Quadratic Loops in Exiting**: Eliminated quadratic loops that occurred during voluntary exits, improving performance. -- **Deprecated Go Embed Rules**: Removed deprecated `go_embed` rules from rules_go, to stay up-to-date with best practices. +- **Quadratic Loops in Exiting**: Eliminated quadratic loops that occurred during voluntary exits, improving + performance. +- **Deprecated Go Embed Rules**: Removed deprecated `go_embed` rules from rules_go, to stay up-to-date with best + practices. - **Alpine Images**: Removed Alpine images from the Prysm project. ### Fixed #### Deneb-Specific Bug Fixes: + - **Deneb Builder Bid HTR**: Fixed an issue related to HashTreeRoot (HTR) in Deneb builder bid. - **PBV2 Condition**: Corrected conditions related to PBV2. - **Route Handler and Cleanup**: Updated the route handler and performed minor cleanups. @@ -1088,11 +1159,13 @@ No security issues in thsi release. - **Sync/RPC Blob Usage**: Rectified blob usage when requesting a block by root in Sync/RPC. #### Cache Fixes: + - **Don't Prune Proposer ID Cache**: Fixed a loop erroneously pruning the proposer ID cache. - **LastRoot Adjustment**: Altered `LastRoot` to return the head root. - **Last Canonical Root**: Modified forkchoice to return the last canonical root of the epoch. #### Block Processing fixes: + - **Block Validation**: Fixed an issue where blocks were incorrectly marked as bad during validation. - **Churn Limit Helpers**: Improved churn limit calculations through refactoring. - **Churn with 0 Exits**: Rectified a bug that calculated churn even when there were 0 exits. @@ -1100,19 +1173,22 @@ No security issues in thsi release. - **Duplicate Block Processing**: Eliminated redundant block processing. #### Error Handling and Logging: + - **RpcError from Core Service**: Ensured that `RpcError` is returned from core services. - **Unhandled Error**: Enhanced error management by handling previously unhandled errors. - **Error Handling**: Wrapped `ctx.Err` for improved error handling. - **Attestation Error**: Optimized error management in attestation processing. #### Test and Build Fixes: + - **Racy Tests in Blockchain**: Resolved race conditions in blockchain tests. - **TestService_ReceiveBlock**: Modified `TestService_ReceiveBlock` to work as expected. - **Build Issue with @com_github_ethereum_c_kzg_4844**: Resolved build issues related to this specific library. -- **Fuzz Testing**: Addressed fuzz testing issues in the `origin/deneb-integration` +- **Fuzz Testing**: Addressed fuzz testing issues in the `origin/deneb-integration` - **Long-Running E2E Tests**: Fixed issues that were causing the end-to-end tests to run for an extended period. #### Additional Fixes: + - **Public Key Copies During Aggregation**: Optimized to avoid unnecessary public key copies during aggregation. - **Epoch Participations**: Fixed the setting of current and previous epoch participations. - **Verify Attestations**: Resolved an attestation verification issue in proposer logic. @@ -1122,7 +1198,6 @@ No security issues in thsi release. - **Hex Handling**: Upgraded the hex handling in various modules. - **Initial Sync PreProcessing**: Resolved an issue affecting the initial sync preprocessing. - ### Security No security updates in this release. @@ -1133,7 +1208,8 @@ Welcome to Prysm Release v4.0.8! This release is recommended. Highlights: - Parallel hashing of validator entries in the beacon state. This results in a faster hash tree root. ~3x reduction - Parallel validations of consensus and execution checks. This results in a faster block verification -- Aggregate parallel is now the default. This results in faster attestation aggregation time if a node is subscribed to multiple beacon attestation subnets. ~3x reduction +- Aggregate parallel is now the default. This results in faster attestation aggregation time if a node is subscribed to + multiple beacon attestation subnets. ~3x reduction - Better process block epoch boundary cache usages and bug fixes - Beacon-API endpoints optimizations and bug fixes @@ -1215,12 +1291,20 @@ Welcome to the v4.0.7 release of Prysm! This recommended release contains many e Highlights: - The validator proposal time for slot 0 has been reduced by 800ms. Writeup and PR -- The attestation aggregation time has been reduced by 400ms—roughly 75% with all subnets subscribed. Flag --aggregate-parallel. PR. This is only useful if running more than a dozen validator keys. The more subnets your node subscribe to, the more useful. -- The usage of fork choice lock has been reduced and optimized, significantly reducing block processing time. This results in a higher proposal and attest rate. PR -- The block proposal path has been optimized with more efficient copies and a better pruning algorithm for pending deposits. PR and PR -- Validator Registration cache is enabled by default, this affects users who have used webui along with mevboost. Please review PR for details. - -Note: We remind our users that there are two versions of the cryptographic library BLST, one is "portable" and less performant, and another is "non-portable" or "modern" and more performant. Most users would want to use the second one. You can set the environment variable USE_PRYSM_MODERN=true when using prysm.sh. The released docker images are using the non-portable version by default. +- The attestation aggregation time has been reduced by 400ms—roughly 75% with all subnets subscribed. Flag + --aggregate-parallel. PR. This is only useful if running more than a dozen validator keys. The more subnets your node + subscribe to, the more useful. +- The usage of fork choice lock has been reduced and optimized, significantly reducing block processing time. This + results in a higher proposal and attest rate. PR +- The block proposal path has been optimized with more efficient copies and a better pruning algorithm for pending + deposits. PR and PR +- Validator Registration cache is enabled by default, this affects users who have used webui along with mevboost. Please + review PR for details. + +Note: We remind our users that there are two versions of the cryptographic library BLST, one is "portable" and less +performant, and another is "non-portable" or "modern" and more performant. Most users would want to use the second one. +You can set the environment variable USE_PRYSM_MODERN=true when using prysm.sh. The released docker images are using the +non-portable version by default. ### Added @@ -1290,21 +1374,29 @@ No security updates in this release. ## [v4.0.6](https://github.com/prysmaticlabs/prysm/compare/v4.0.5...v4.0.6) - 2023-07-15 -Welcome to v4.0.6 release of Prysm! This recommended release contains many essential optimizations since v4.0.5. Notable highlights: +Welcome to v4.0.6 release of Prysm! This recommended release contains many essential optimizations since v4.0.5. Notable +highlights: Better handling of state field trie under late block scenario. This improves the next slot proposer's proposed time Better utilization of next slot cache under various conditions **Important read:** -1.) We use this opportunity to remind you that two different implementations of the underlying cryptographic library BLST exist. +1.) We use this opportunity to remind you that two different implementations of the underlying cryptographic library +BLST exist. - portable: supports every CPU made in the modern era - non-portable: more performant but requires your CPU to support special instructions -Most users will want to use the "non-portable" version since most CPUs support these instructions. Our docker builds are now non-portable by default. Most users will benefit from the performance improvements. You can run with the "portable" versions if your CPU is old or unsupported. For binary distributions and to maintain backward compatibility with older versions of prysm.sh or prysm.bat, users that want to benefit from the non-portable performance improvements need to add an environment variable, like so: USE_PRYSM_MODERN=true prysm.sh beacon-chain prefix, or download the "non-portable" version of the binaries from the github repo. +Most users will want to use the "non-portable" version since most CPUs support these instructions. Our docker builds are +now non-portable by default. Most users will benefit from the performance improvements. You can run with the "portable" +versions if your CPU is old or unsupported. For binary distributions and to maintain backward compatibility with older +versions of prysm.sh or prysm.bat, users that want to benefit from the non-portable performance improvements need to add +an environment variable, like so: USE_PRYSM_MODERN=true prysm.sh beacon-chain prefix, or download the "non-portable" +version of the binaries from the github repo. -2.) A peering bug that led to nodes losing peers gradually and eventually needing a restart has been patched. Nodes previously affected by it can remove the --disable-resource-manager flag from v4.0.6 onwards. +2.) A peering bug that led to nodes losing peers gradually and eventually needing a restart has been patched. Nodes +previously affected by it can remove the --disable-resource-manager flag from v4.0.6 onwards. ### Added @@ -1358,22 +1450,31 @@ No security updates in this release. ## [v4.0.5](https://github.com/prysmaticlabs/prysm/compare/v4.0.4...v4.0.5) - 2023-05-22 -Welcome to v4.0.5 release of Prysm! This release contains many important improvements and bug fixes since v4.0.4, including significant improvements to attestation aggregation. See @potuz's notes [here](https://hackmd.io/TtyFurRJRKuklG3n8lMO9Q). This release is **strongly** recommended for all users. +Welcome to v4.0.5 release of Prysm! This release contains many important improvements and bug fixes since v4.0.4, +including significant improvements to attestation aggregation. See @potuz's +notes [here](https://hackmd.io/TtyFurRJRKuklG3n8lMO9Q). This release is **strongly** recommended for all users. -Note: The released docker images are using the portable version of the blst cryptography library. The Prysm team will release docker images with the non-portable blst library as the default image. In the meantime, you can compile docker images with blst non-portable locally with the `--define=blst_modern=true` bazel flag, use the "-modern-" assets attached to releases, or set environment varaible USE_PRYSM_MODERN=true when using prysm.sh. +Note: The released docker images are using the portable version of the blst cryptography library. The Prysm team will +release docker images with the non-portable blst library as the default image. In the meantime, you can compile docker +images with blst non-portable locally with the `--define=blst_modern=true` bazel flag, use the "-modern-" assets +attached to releases, or set environment varaible USE_PRYSM_MODERN=true when using prysm.sh. ### Added - Added epoch and root to "not a checkpt in forkchoice" log message - Added cappella support for eth1voting tool - Persist validator proposer settings in the validator db. -- Add flag to disable p2p resource management. This flag is for debugging purposes and should not be used in production for extended periods of time. Use this flag if you are experiencing significant peering issues. --disable-resource-manager +- Add flag to disable p2p resource management. This flag is for debugging purposes and should not be used in production + for extended periods of time. Use this flag if you are experiencing significant peering issues. + --disable-resource-manager ### Changed - Improved slot ticker for attestation aggregation -- Parallel block production enabled by default. Opt out with --disable-build-block-parallel if issues are suspected with this feature. -- Improve attestation aggregation by not using max cover on unaggregated attestations and not checking subgroup of previously validated signatures. +- Parallel block production enabled by default. Opt out with --disable-build-block-parallel if issues are suspected with + this feature. +- Improve attestation aggregation by not using max cover on unaggregated attestations and not checking subgroup of + previously validated signatures. - Improve sync message processing by using forkchoice ### Fixed @@ -1388,14 +1489,17 @@ No security updates in this release. ## [v4.0.4](https://github.com/prysmaticlabs/prysm/compare/v4.0.3...v4.0.4) - 2023-05-15 -Welcome to v4.0.4 release of Prysm! This is the first full release following the recent mainnet issues and it is very important that all stakers update to this release as soon as possible. +Welcome to v4.0.4 release of Prysm! This is the first full release following the recent mainnet issues and it is very +important that all stakers update to this release as soon as possible. Aside from the critical fixes for mainnet, this release contains a number of new features and other fixes since v4.0.3. ### Added -- Feature to build consensus and execution blocks in parallel. This feature has shown a noticeable reduction (~200ms) in block proposal times. Enable with --build-block-parallel -- An in memory cache for validator registration can be enabled with --enable-registration-cache. See PR description before enabling. +- Feature to build consensus and execution blocks in parallel. This feature has shown a noticeable reduction (~200ms) in + block proposal times. Enable with --build-block-parallel +- An in memory cache for validator registration can be enabled with --enable-registration-cache. See PR description + before enabling. - Added new linters - Improved tracing data for builder pipeline - Improved withdrawal phrasing in validator withdrawal tooling @@ -1444,7 +1548,8 @@ Aside from the critical fixes for mainnet, this release contains a number of new ### Security -This release contains some important fixes that improve the resiliency of Ethereum Consensus Layer. See https://github.com/prysmaticlabs/prysm/pull/12387 and https://github.com/prysmaticlabs/prysm/pull/12398. +This release contains some important fixes that improve the resiliency of Ethereum Consensus Layer. +See https://github.com/prysmaticlabs/prysm/pull/12387 and https://github.com/prysmaticlabs/prysm/pull/12398. ## [v4.0.3](https://github.com/prysmaticlabs/prysm/compare/v4.0.2...v4.0.3) - 2023-04-20 @@ -1478,21 +1583,27 @@ No security updates in this release. ## [v4.0.2](https://github.com/prysmaticlabs/prysm/compare/v4.0.1...v4.0.2) - 2023-04-12 -This release fixes a critical bug on Prysm interacting with mev-boost / relayer. You MUST upgrade to this release if you run Prysm with mev boost and relayer, or you will be missing block proposals during the first days after the Shapella fork while the block has bls-to-exec changes. +This release fixes a critical bug on Prysm interacting with mev-boost / relayer. You MUST upgrade to this release if you +run Prysm with mev boost and relayer, or you will be missing block proposals during the first days after the Shapella +fork while the block has bls-to-exec changes. Post-mortem that describes this incident will be provided by the end of the week. -One of this release's main optimizations is revamping the next slot cache. It has been upgraded to be more performant across edge case re-org scenarios. This can help with the bad head attestation vote. +One of this release's main optimizations is revamping the next slot cache. It has been upgraded to be more performant +across edge case re-org scenarios. This can help with the bad head attestation vote. -Minor fixes in this release address a bug that affected certain large operators querying RPC endpoints. This bug caused unexpected behavior and may have impacted the performance of affected operators. To resolve this issue, we have included a patch that ensures proper functionality when querying RPC endpoints. +Minor fixes in this release address a bug that affected certain large operators querying RPC endpoints. This bug caused +unexpected behavior and may have impacted the performance of affected operators. To resolve this issue, we have included +a patch that ensures proper functionality when querying RPC endpoints. ### Added -- CLI: New beacon node flag local-block-value-boost that allows the local block value to be multiplied by the boost value +- CLI: New beacon node flag local-block-value-boost that allows the local block value to be multiplied by the boost + value - Smart caching for square root computation - Beacon-API: Implemented Block rewards endpoint - Beacon-API client: Implemented GetSyncStatus endpoint - Beacon-API client: Implemented GetGenesis endpoint -- Beacon-API client: Implemented ListValidators endpoint +- Beacon-API client: Implemented ListValidators endpoint ### Changed @@ -1570,7 +1681,6 @@ This is a reissue of v4.0.0. See https://github.com/prysmaticlabs/prysm/issues/1 - Test: disable e2e slasher test - CLI: derecate the following flags - ### Deprecated The following flags have been deprecated. @@ -1628,10 +1738,12 @@ This release is required to participate in the Capella upgrade. Gm! ☀️ We are excited to announce our release for upgrading Goerli testnet to Shanghai / Capella! 🚀 -This release is MANDATORY for Goerli testnet. You must upgrade your Prysm beacon node and validator client to this release before Shapella hard fork time epoch=162304 or UTC=14/03/2023, 10:25:36 pm. +This release is MANDATORY for Goerli testnet. You must upgrade your Prysm beacon node and validator client to this +release before Shapella hard fork time epoch=162304 or UTC=14/03/2023, 10:25:36 pm. This release is a low-priority for the mainnet. -This release is the same commit as v3.2.2-rc.3. If you are already running v3.2.2-rc.3, then you do not need to update your client. +This release is the same commit as v3.2.2-rc.3. If you are already running v3.2.2-rc.3, then you do not need to update +your client. ### Added @@ -1672,14 +1784,17 @@ This release is required for Goerli to upgrade to Capella. We are excited to announce the release of Prysm v3.2.1 🎉 -This is the first release to support Capella / Shanghai. The Sepolia testnet Capella upgrade time is currently set to 2/28/2023, 4:04:48 AM UTC. The Goerli testnet and Mainnet upgrade times are still yet to be determined. In Summary: +This is the first release to support Capella / Shanghai. The Sepolia testnet Capella upgrade time is currently set to +2/28/2023, 4:04:48 AM UTC. The Goerli testnet and Mainnet upgrade times are still yet to be determined. In Summary: - This is a mandatory upgrade for Sepolia nodes and validators - This is a recommended upgrade for Goerli and Mainnet nodes and validators There are some known issues with this release. -- mev-boost, relayer, and builder support for Capella upgrade are built in but still need to be tested. Given the lack of testing infrastructure, none of the clients could test this for withdrawals testnet. There may be hiccups when using mev-boost on the Capella upgraded testnets. +- mev-boost, relayer, and builder support for Capella upgrade are built in but still need to be tested. Given the lack + of testing infrastructure, none of the clients could test this for withdrawals testnet. There may be hiccups when + using mev-boost on the Capella upgraded testnets. ### Added @@ -1736,7 +1851,10 @@ There are no security updates in this release. ## [v3.2.0](https://github.com/prysmaticlabs/prysm/compare/v3.1.2...v3.2.0) - 2022-12-16 -This release contains a number of great features and improvements as well as progress towards the upcoming Capella upgrade. This release also includes some API changes which are reflected in the minor version bump. If you are using mev-boost, you will need to update your prysm client to v3.2.0 before updating your mev-boost instance in the future. See [flashbots/mev-boost#404](https://github.com/flashbots/mev-boost/issues/404) for more details. +This release contains a number of great features and improvements as well as progress towards the upcoming Capella +upgrade. This release also includes some API changes which are reflected in the minor version bump. If you are using +mev-boost, you will need to update your prysm client to v3.2.0 before updating your mev-boost instance in the future. +See [flashbots/mev-boost#404](https://github.com/flashbots/mev-boost/issues/404) for more details. ### Added @@ -1864,7 +1982,9 @@ This release contains a number of great features and improvements as well as pro ## [v3.1.1](https://github.com/prysmaticlabs/prysm/compare/v3.1.0...v3.1.1) - 2022-09-09 -This is another highly recommended release. It contains a forkchoice pruning fix and a gossipsub optimization. It is recommended to upgrade to this release before the Merge next week, which is currently tracking for Wed Sept 14 (https://bordel.wtf/). Happy staking! See you on the other side! +This is another highly recommended release. It contains a forkchoice pruning fix and a gossipsub optimization. It is +recommended to upgrade to this release before the Merge next week, which is currently tracking for Wed Sept +14 (https://bordel.wtf/). Happy staking! See you on the other side! ### Fixed @@ -1877,14 +1997,14 @@ No security updates in this release. ## [v3.1.0](https://github.com/prysmaticlabs/prysm/compare/v3.1.0...v3.0.0) - 2022-09-05 -Updating to this release is highly recommended as it contains several important fixes and features for the merge. You must be using Prysm v3 or later before Bellatrix activates on September 6th. +Updating to this release is highly recommended as it contains several important fixes and features for the merge. You +must be using Prysm v3 or later before Bellatrix activates on September 6th. **Important docs links** - [How to prepare for the merge](https://docs.prylabs.network/docs/prepare-for-merge) - [How to check merge readiness status](https://docs.prylabs.network/docs/monitoring/checking-status) - ### Added - Add time until next duty in epoch logs for validator @@ -1937,16 +2057,21 @@ There are no security updates in this release. - Keymanager: Add support for setting the gas limit via API. - Merge: Mainnet merge epoch and TTD defined! - Validator: Added expected wait time for pending validator activation in log message. -- Go: Prysm now uses proper versioning suffix v3 for this release. GoDocs and downstream users can now import prysm as expected for go projects. +- Go: Prysm now uses proper versioning suffix v3 for this release. GoDocs and downstream users can now import prysm as + expected for go projects. - Builder API: Register validator via HTTP REST Beacon API endpoint /eth/v1/validator/register_validator - Cross compilation support for Mac ARM64 chips (Mac M1, M2) ### Changed -- **Require an execution client** `--execution-endpoint=...`. The default value has changed to `localhost:8551` and you must use the jwt flag `--jwt-secret=...`. Review [the docs](https://docs.prylabs.network/docs/prepare-for-merge) for more information -- `--http-web3provider` has been renamed to `--execution-endpoint`. Please update your configuration as `--http-web3provider` will be removed in a future release. +- **Require an execution client** `--execution-endpoint=...`. The default value has changed to `localhost:8551` and you + must use the jwt flag `--jwt-secret=...`. Review [the docs](https://docs.prylabs.network/docs/prepare-for-merge) for + more information +- `--http-web3provider` has been renamed to `--execution-endpoint`. Please update your configuration + as `--http-web3provider` will be removed in a future release. - Insert attestations into forkchoice sooner -- Builder API: `gas_limit` changed from int to string to support JSON / YAML configs. `--suggested-gas-limit` changed from int to string. +- Builder API: `gas_limit` changed from int to string to support JSON / YAML configs. `--suggested-gas-limit` changed + from int to string. - Fork choice: Improved handling of double locks / deadlocks - Lower libp2p log level - Improved re-org logs with additional metadata @@ -1955,25 +2080,31 @@ There are no security updates in this release. - Protobuf message renaming (non-breaking changes) - Enabled feature to use gohashtree by default. Disable with `--disable-vectorized-htr` - Enabled fork choice doubly linked tree feature by default. Disable with `--disable-forkchoice-doubly-linked-tree` -- Remote signer: Renamed some field names to better represent block types (non-breaking changes for gRPC users, possibly breaking change for JSON API users) +- Remote signer: Renamed some field names to better represent block types (non-breaking changes for gRPC users, possibly + breaking change for JSON API users) - Builder API: require header and payload root match. - Improved responses for json-rpc requests batching when using blinded beacon blocks. - Builder API: Improved error messages -- Builder API: Issue warning when validator expects builder ready beacon node, but beacon node is not configured with a relay. +- Builder API: Issue warning when validator expects builder ready beacon node, but beacon node is not configured with a + relay. - Execution API: Improved payload ID to handle reorg scenarios ### Deprecated -- Several features have been promoted to stable or removed. The following flags are now deprecated and will be removed in a future release. `--enable-db-backup-webhook`, `--bolt-mmap-initial-size`, `--disable-discv5`, `--disable-attesting-history-db-cache`, `--enable-vectorized-htr`, `--enable-peer-scorer`, `--enable-forkchoice-doubly-linked-tree`, `--enable-duty-count-down`, `--head-sync`, `--enable-gossip-batch-aggregateion`, `--enable-larger-gossip-history`, `--fallback-web3provider`, `--use-check-point-cache`. +- Several features have been promoted to stable or removed. The following flags are now deprecated and will be removed + in a future + release. `--enable-db-backup-webhook`, `--bolt-mmap-initial-size`, `--disable-discv5`, `--disable-attesting-history-db-cache`, `--enable-vectorized-htr`, `--enable-peer-scorer`, `--enable-forkchoice-doubly-linked-tree`, `--enable-duty-count-down`, `--head-sync`, `--enable-gossip-batch-aggregateion`, `--enable-larger-gossip-history`, `--fallback-web3provider`, `--use-check-point-cache`. - Several beacon API endpoints marked as deprecated ### Removed - Logging: Removed phase0 fields from validator performance log messages - Deprecated slasher protos have been removed -- Deprecated beacon API endpoints removed: `GetBeaconState`, `ProduceBlock`, `ListForkChoiceHeads`, `ListBlocks`, `SubmitValidatorRegistration`, `GetBlock`, `ProposeBlock` +- Deprecated beacon API endpoints + removed: `GetBeaconState`, `ProduceBlock`, `ListForkChoiceHeads`, `ListBlocks`, `SubmitValidatorRegistration`, `GetBlock`, `ProposeBlock` - API: Forkchoice method `GetForkChoice` has been removed. -- All previously deprecated feature flags have been removed. `--enable-active-balance-cache`, `--correctly-prune-canonical-atts`, `--correctly-insert-orphaned-atts`, `--enable-next-slot-state-cache`, `--enable-batch-gossip-verification`, `--enable-get-block-optimizations`, `--enable-balance-trie-computation`, `--disable-next-slot-state-cache`, `--attestation-aggregation-strategy`, `--attestation-aggregation-force-opt-maxcover`, `--pyrmont`, `--disable-get-block-optimizations`, `--disable-proposer-atts-selection-using-max-cover`, `--disable-optimized-balance-update`, `--disable-active-balance-cache`, `--disable-balance-trie-computation`, `--disable-batch-gossip-verification`, `--disable-correctly-prune-canonical-atts`, `--disable-correctly-insert-orphaned-atts`, `--enable-native-state`, `--enable-peer-scorer`, `--enable-gossip-batch-aggregation`, `--experimental-disable-boundry-checks` +- All previously deprecated feature flags have been + removed. `--enable-active-balance-cache`, `--correctly-prune-canonical-atts`, `--correctly-insert-orphaned-atts`, `--enable-next-slot-state-cache`, `--enable-batch-gossip-verification`, `--enable-get-block-optimizations`, `--enable-balance-trie-computation`, `--disable-next-slot-state-cache`, `--attestation-aggregation-strategy`, `--attestation-aggregation-force-opt-maxcover`, `--pyrmont`, `--disable-get-block-optimizations`, `--disable-proposer-atts-selection-using-max-cover`, `--disable-optimized-balance-update`, `--disable-active-balance-cache`, `--disable-balance-trie-computation`, `--disable-batch-gossip-verification`, `--disable-correctly-prune-canonical-atts`, `--disable-correctly-insert-orphaned-atts`, `--enable-native-state`, `--enable-peer-scorer`, `--enable-gossip-batch-aggregation`, `--experimental-disable-boundry-checks` - Validator Web API: Removed unused ImportAccounts and DeleteAccounts rpc options ### Fixed @@ -1990,44 +2121,50 @@ There are no security updates in this release. ## [v2.1.4](https://github.com/prysmaticlabs/prysm/compare/v2.1.4...v2.1.3) - 2022-08-10 -As we prepare our `v3` mainnet release for [The Merge](https://ethereum.org/en/upgrades/merge/), `v2.1.4` marks the end of the `v2` era. Node operators and validators are **highly encouraged** to upgrade to release `v2.1.4` - many bug fixes and improvements have been included in preparation for The Merge. `v3` will contain breaking changes, and will be released within the next few weeks. Using `v2.1.4` in the meantime will give you access to a more streamlined user experience. See our [v2.1.4 doc](https://docs.prylabs.network/docs/vnext/214-rc) to learn how to use v2.1.4 to run a Merge-ready configuration on the Goerli-Prater network pair. +As we prepare our `v3` mainnet release for [The Merge](https://ethereum.org/en/upgrades/merge/), `v2.1.4` marks the end +of the `v2` era. Node operators and validators are **highly encouraged** to upgrade to release `v2.1.4` - many bug fixes +and improvements have been included in preparation for The Merge. `v3` will contain breaking changes, and will be +released within the next few weeks. Using `v2.1.4` in the meantime will give you access to a more streamlined user +experience. See our [v2.1.4 doc](https://docs.prylabs.network/docs/vnext/214-rc) to learn how to use v2.1.4 to run a +Merge-ready configuration on the Goerli-Prater network pair. ### Added - Sepolia testnet configs `--sepolia` -- Goerli as an alias to Prater and testnet configs `--prater` or `--goerli` +- Goerli as an alias to Prater and testnet configs `--prater` or `--goerli` - Fee recipient API for key manager - YML config flag support for web3 signer -- Validator registration API for web3 signer +- Validator registration API for web3 signer - JSON tcontent type with optional metadata -- Flashbots MEV boost support -- Store blind block (i.e block with payload header) instead of full block (i.e. block with payload) for storage efficiency (currently only available when the `enable-only-blinded-beacon-blocks` feature flag is enabled) -- Pcli utility support to print blinded block +- Flashbots MEV boost support +- Store blind block (i.e block with payload header) instead of full block (i.e. block with payload) for storage + efficiency (currently only available when the `enable-only-blinded-beacon-blocks` feature flag is enabled) +- Pcli utility support to print blinded block - New Web v2.0 release into Prysm ### Changed -- Native state improvement is enabled by default -- Use native blocks instead of protobuf blocks +- Native state improvement is enabled by default +- Use native blocks instead of protobuf blocks - Peer scorer is enabled by default -- Enable fastssz to use vectorized HTR hash algorithm improvement +- Enable fastssz to use vectorized HTR hash algorithm improvement - Forkchoice store refactor and cleanups -- Update libp2p library dependency -- RPC proposer duty is now allowed next epoch query +- Update libp2p library dependency +- RPC proposer duty is now allowed next epoch query - Do not print traces with `log.withError(err)` - Testnets are running with pre-defined feature flags ### Removed -- Deprecate Step Parameter from our Block By Range Requests +- Deprecate Step Parameter from our Block By Range Requests ### Fixed -- Ignore nil forkchoice node when saving orphaned atts -- Sync: better handling of missing state summary in DB -- Validator: creates invalid terminal block using the same timestamp as payload -- P2P: uses incorrect goodbye codes -- P2p: defaults Incorrectly to using Mplex, which results in losing Teku peers +- Ignore nil forkchoice node when saving orphaned atts +- Sync: better handling of missing state summary in DB +- Validator: creates invalid terminal block using the same timestamp as payload +- P2P: uses incorrect goodbye codes +- P2p: defaults Incorrectly to using Mplex, which results in losing Teku peers - Disable returning future state for API - Eth1 connection API panic @@ -2041,14 +2178,15 @@ There are no security updates in this release. - Many fuzz test additions - Support bellatrix blocks with web3signer -- Support for the Sepolia testnet with `--terminal-total-difficulty-override 17000000000000000`. The override flag is required in this release. +- Support for the Sepolia testnet with `--terminal-total-difficulty-override 17000000000000000`. The override flag is + required in this release. - Support for the Ropsten testnet. No override flag required - JSON API allows SSZ-serialized blocks in `publishBlock` - JSON API allows SSZ-serialized blocks in `publishBlindedBlock` - JSON API allows SSZ-serialized requests in `produceBlockV2` and `produceBlindedBlock` - Progress towards Builder API and MEV boost support (not ready for testing in this release) - Support for `DOMAIN_APPLICATION_MARK` configuration -- Ignore subset aggregates if a better aggregate has been seen already +- Ignore subset aggregates if a better aggregate has been seen already - Reinsertion of reorg'd attestations - Command `beacon-chain generate-auth-secret` to assist with generating a hex encoded secret for engine API - Return optimistic status to `ChainHead` related grpc service @@ -2058,7 +2196,7 @@ There are no security updates in this release. ### Changed - Improvements to forkchoice -- Invalid checksummed (or no checksum) addresses used for fee recipient will log a warning. fixes, +- Invalid checksummed (or no checksum) addresses used for fee recipient will log a warning. fixes, - Use cache backed `getBlock` method in several places of blockchain package - Reduced log frequency of "beacon node doesn't have a parent in db with root" error - Improved nil checks for state management @@ -2068,26 +2206,27 @@ There are no security updates in this release. - Handle connection closing for web3/eth1 nil connection - Testing improvements - E2E test improvements -- Increase file descriptor limit up to the maximum by default +- Increase file descriptor limit up to the maximum by default - Improved classification of "bad blocks" - Updated engine API error code handling - Improved "Synced new block" message to include minimal information based on the log verbosity. - Add nil checks for nil finalized checkpoints -- Change weak subjectivity sync to use the most recent finalized state rather than the oldest state within the current period. +- Change weak subjectivity sync to use the most recent finalized state rather than the oldest state within the current + period. - Ensure a finalized root can't be all zeros -- Improved db lookup of HighestSlotBlocksBelow to start from the end of the index rather than the beginning. +- Improved db lookup of HighestSlotBlocksBelow to start from the end of the index rather than the beginning. - Improved packing of state balances for hashtreeroot - Improved field trie recomputation ### Removed -- Removed handling of `INVALID_TERMINAL_BLOCK` response from engine API +- Removed handling of `INVALID_TERMINAL_BLOCK` response from engine API ### Fixed - `/eth/v1/beacon/blinded_blocks` JSON API endpoint - SSZ handling of JSON API payloads -- Config registry fixes +- Config registry fixes - Withdrawal epoch overflows - Race condition with blockchain service Head() - Race condition with validator's highest valid slot accessor @@ -2120,11 +2259,12 @@ There are no security updates in this release. ### Removed - Prymont testnet support -- Flag `disable-proposer-atts-selection-using-max-cover` which disables defaulting max cover strategy for proposer selecting attestations +- Flag `disable-proposer-atts-selection-using-max-cover` which disables defaulting max cover strategy for proposer + selecting attestations - Flag `disable-get-block-optimizations` which disables optimization with beacon block construction - Flag `disable-optimized-balance-update"` which disables optimized effective balance update - Flag `disable-active-balance-cache` which disables active balance cache -- Flag `disable-balance-trie-computation` which disables balance trie optimization for hash tree root +- Flag `disable-balance-trie-computation` which disables balance trie optimization for hash tree root - Flag `disable-batch-gossip-verification` which disables batch gossip verification - Flag `disable-correctly-insert-orphaned-atts` which disables the fix for orphaned attestations insertion @@ -2144,45 +2284,54 @@ This patch release includes 3 cherry picked fixes for regressions found in v2.1. View the full changelist from v2.1.0: https://github.com/prysmaticlabs/prysm/compare/v2.1.0...v2.1.1 -If upgrading from v2.0.6, please review the [full changelist](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.1) of both v2.1.0 and v2.1.1. +If upgrading from v2.0.6, please review +the [full changelist](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.1) of both v2.1.0 and v2.1.1. This release is required for users on v2.1.0 and recommended for anyone on v2.0.6. The following known issues exist in v2.1.0 and also exist in this release. - -- Erroneous warning message in validator client when bellatrix fee recipient is unset. This is a cosmetic message and does not affect run time behavior in Phase0/Altair. + +- Erroneous warning message in validator client when bellatrix fee recipient is unset. This is a cosmetic message and + does not affect run time behavior in Phase0/Altair. - In Bellatrix/Kiln: Fee recipient flags may not work as expected. See for a fix and more details. ### Fixed -- Doppelganger false positives may have caused a failure to start in the validator client. -- Connections to execution layer clients were not properly cleaned up and lead to resource leaks when using ipc. -- Initial sync (or resync when beacon node falls out of sync) could lead to a panic. +- Doppelganger false positives may have caused a failure to start in the validator client. +- Connections to execution layer clients were not properly cleaned up and lead to resource leaks when using ipc. +- Initial sync (or resync when beacon node falls out of sync) could lead to a panic. ### Security There are no security updates in this release. -## [v2.1.0](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.0) - 2022-04-26 +## [v2.1.0](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.0) - 2022-04-26 There are two known issues with this release: -- Erroneous warning message in validator client when bellatrix fee recipient is unset. This is a cosmetic message and does not affect run time behavior in Phase0/Altair. +- Erroneous warning message in validator client when bellatrix fee recipient is unset. This is a cosmetic message and + does not affect run time behavior in Phase0/Altair. - In Bellatrix/Kiln: Fee recipient flags may not work as expected. See for a fix and more details. ### Added -- Web3Signer support. See the [documentation](https://docs.prylabs.network/docs/next/wallet/web3signer) for more details. +- Web3Signer support. See the [documentation](https://docs.prylabs.network/docs/next/wallet/web3signer) for more + details. - Bellatrix support. See [kiln testnet instructions](https://hackmd.io/OqIoTiQvS9KOIataIFksBQ?view) -- Weak subjectivity sync / checkpoint sync. This is an experimental feature and may have unintended side effects for certain operators serving historical data. See the [documentation](https://docs.prylabs.network/docs/next/prysm-usage/checkpoint-sync) for more details. -- A faster build of blst for beacon chain on linux amd64. Use the environment variable `USE_PRYSM_MODERN=true` with prysm.sh, use the "modern" binary, or bazel build with `--define=blst_modern=true`. +- Weak subjectivity sync / checkpoint sync. This is an experimental feature and may have unintended side effects for + certain operators serving historical data. See + the [documentation](https://docs.prylabs.network/docs/next/prysm-usage/checkpoint-sync) for more details. +- A faster build of blst for beacon chain on linux amd64. Use the environment variable `USE_PRYSM_MODERN=true` with + prysm.sh, use the "modern" binary, or bazel build with `--define=blst_modern=true`. - Vectorized sha256. This may have performance improvements with use of the new flag `--enable-vectorized-htr`. -- A new forkchoice structure that uses a doubly linked tree implementation. Try this feature with the flag `--enable-forkchoice-doubly-linked-tree` +- A new forkchoice structure that uses a doubly linked tree implementation. Try this feature with the + flag `--enable-forkchoice-doubly-linked-tree` - Fork choice proposer boost is implemented and enabled by default. See PR description for more details. ### Changed -- **Flag Default Change** The default value for `--http-web3provider` is now `localhost:8545`. Previously was empty string. +- **Flag Default Change** The default value for `--http-web3provider` is now `localhost:8545`. Previously was empty + string. - Updated spectest compliance to v1.1.10. - Updated to bazel 5.0.0 - Gossip peer scorer is now part of the `--dev` flag. @@ -2193,7 +2342,8 @@ There are two known issues with this release: ### Fixed -Too many bug fixes and improvements to mention all of them. See the [full changelist](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.0) +Too many bug fixes and improvements to mention all of them. See +the [full changelist](https://github.com/prysmaticlabs/prysm/compare/v2.0.6...v2.1.0) ### Security @@ -2285,7 +2435,9 @@ There are no security updates in this release. ### Deprecated -Please be advised that Prysm's package path naming will change in the next release. If you are a downstream user of Prysm (i.e. import prysm libraries into your project) then you may be impacted. Please see issue https://github.com/prysmaticlabs/prysm/issues/10006. +Please be advised that Prysm's package path naming will change in the next release. If you are a downstream user of +Prysm (i.e. import prysm libraries into your project) then you may be impacted. Please see +issue https://github.com/prysmaticlabs/prysm/issues/10006. ### Fixed @@ -2314,7 +2466,8 @@ Please be advised that Prysm's package path naming will change in the next relea ### Fixed -- Revert PR [9830](https://github.com/prysmaticlabs/prysm/pull/9830) to remove performance regression. See: issue [9935](https://github.com/prysmaticlabs/prysm/issues/9935) +- Revert PR [9830](https://github.com/prysmaticlabs/prysm/pull/9830) to remove performance regression. See: + issue [9935](https://github.com/prysmaticlabs/prysm/issues/9935) ### Security @@ -2322,7 +2475,8 @@ No security updates in this release. ## [v2.0.3](https://github.com/prysmaticlabs/prysm/compare/v2.0.2...v2.0.3) - 2021-11-22 -This release also includes a major update to the web UI. Please review the v1 web UI notes [here](https://github.com/prysmaticlabs/prysm-web-ui/releases/tag/v1.0.0) +This release also includes a major update to the web UI. Please review the v1 web UI +notes [here](https://github.com/prysmaticlabs/prysm-web-ui/releases/tag/v1.0.0) ### Added @@ -2380,7 +2534,8 @@ This release also includes a major update to the web UI. Please review the v1 we ### Removed -- Prysmatic Labs' [go-ethereum fork](https://github.com/prysmaticlabs/bazel-go-ethereum) removed from build tooling. Upstream go-ethereum is now used with familiar go.mod tooling. +- Prysmatic Labs' [go-ethereum fork](https://github.com/prysmaticlabs/bazel-go-ethereum) removed from build tooling. + Upstream go-ethereum is now used with familiar go.mod tooling. - Removed duplicate aggergation validation p2p pipelines. - Metrics calculation removed extra condition - Removed superflous errors from peer scoring parameters registration @@ -2391,7 +2546,8 @@ This release also includes a major update to the web UI. Please review the v1 we - Ignore validators without committee assignment when fetching attester duties - Return "version" field for ssz blocks in beacon API - Fixed bazel build transitions for dbg builds. Allows IDEs to hook into debugger again. -- Fixed case where GetDuties RPC endpoint might return a false positive for sync committee selection for validators that have no deposited yet +- Fixed case where GetDuties RPC endpoint might return a false positive for sync committee selection for validators that + have no deposited yet - Fixed validator exits in v1 method, broadcast correct object - Fix Altair individual votes endpoint - Validator performance calculations fixed @@ -2400,7 +2556,7 @@ This release also includes a major update to the web UI. Please review the v1 we - Fix stategen with genesis state. - Fixed multiple typos - Fix genesis state registration in interop mode -- Fix network flags in slashing protection export +- Fix network flags in slashing protection export ### Security @@ -2410,7 +2566,9 @@ This release also includes a major update to the web UI. Please review the v1 we ### Added -- Optimizations to block proposals. Enabled with `--enable-get-block-optimizations`. See [issue 8943](https://github.com/prysmaticlabs/prysm/issues/8943) and [issue 9708](https://github.com/prysmaticlabs/prysm/issues/9708) before enabling. +- Optimizations to block proposals. Enabled with `--enable-get-block-optimizations`. + See [issue 8943](https://github.com/prysmaticlabs/prysm/issues/8943) + and [issue 9708](https://github.com/prysmaticlabs/prysm/issues/9708) before enabling. - Beacon Standard API: register v1alpha2 endpoints ### Changed @@ -2458,64 +2616,87 @@ We've updated the Prysm base docker images to a more recent build. ## [v2.0.0](https://github.com/prysmaticlabs/prysm/compare/v1.4.4...v2.0.0) -This release is the largest release of Prysm to date. v2.0.0 includes support for the upcoming Altair hard fork on the mainnet Ethereum Beacon Chain. -This release consists of [380 changes](https://github.com/prysmaticlabs/prysm/compare/v1.4.4...f7845afa575963302116e673d400d2ab421252ac) to support Altair, improve performance of phase0 beacon nodes, and various bug fixes from v1.4.4. +This release is the largest release of Prysm to date. v2.0.0 includes support for the upcoming Altair hard fork on the +mainnet Ethereum Beacon Chain. +This release consists +of [380 changes](https://github.com/prysmaticlabs/prysm/compare/v1.4.4...f7845afa575963302116e673d400d2ab421252ac) to +support Altair, improve performance of phase0 beacon nodes, and various bug fixes from v1.4.4. ### Upgrading From v1 -Please update your beacon node to v2.0.0 prior to updating your validator. The beacon node can serve requests to a v1.4.4 validator, however a v2.0.0 validator will not start against a v1.4.4 beacon node. If you're operating a highly available beacon chain service, ensure that all of your beacon nodes are updated to v2.0.0 before starting the upgrade on your validators. +Please update your beacon node to v2.0.0 prior to updating your validator. The beacon node can serve requests to a +v1.4.4 validator, however a v2.0.0 validator will not start against a v1.4.4 beacon node. If you're operating a highly +available beacon chain service, ensure that all of your beacon nodes are updated to v2.0.0 before starting the upgrade +on your validators. ### Added -- Full Altair support. [Learn more about Altair.](https://github.com/ethereum/annotated-spec/blob/8473024d745a3a2b8a84535d57773a8e86b66c9a/altair/beacon-chain.md) +- Full Altair + support. [Learn more about Altair.](https://github.com/ethereum/annotated-spec/blob/8473024d745a3a2b8a84535d57773a8e86b66c9a/altair/beacon-chain.md) - Added bootnodes from the Nimbus team. -- Revamped slasher implementation. The slasher functionality is no longer a standalone binary. Slasher functionality is available from the beacon node with the `--slasher` flag. Note: Running the slasher has considerably increased resource requirements. Be sure to review the latest documentation before enabling this feature. This feature is experimental. +- Revamped slasher implementation. The slasher functionality is no longer a standalone binary. Slasher functionality is + available from the beacon node with the `--slasher` flag. Note: Running the slasher has considerably increased + resource requirements. Be sure to review the latest documentation before enabling this feature. This feature is + experimental. - Support for standard JSON API in the beacon node. Prysm validators continue to use Prysm's API. -- Configurable subnet peer requirements. Increased minimum desired peers per subnet from 4 to 6. This can be modified with `--minimum-peers-per-subnet` in the beacon node.. +- Configurable subnet peer requirements. Increased minimum desired peers per subnet from 4 to 6. This can be modified + with `--minimum-peers-per-subnet` in the beacon node.. - Support for go build on darwin_arm64 devices (Mac M1 chips). Cross compiling for darwin_arm64 is not yet supported.. - Batch verification of pubsub objects. This should improve pubsub processing performance on multithreaded machines. -- Improved attestation pruning. This feature should improve block proposer performance and overall network attestation inclusion rates. Opt-out with `--disable-correctly-prune-canonical-atts` in the beacon node. +- Improved attestation pruning. This feature should improve block proposer performance and overall network attestation + inclusion rates. Opt-out with `--disable-correctly-prune-canonical-atts` in the beacon node. - Active balance cache to improve epoch processing. Opt-out with `--disable-active-balance-cache` -- Experimental database improvements to reduce history state entry space usage in the beaconchain.db. This functionality can be permanently enabled with the flag `--enable-historical-state-representation`. Enabling this feature can realize a 25% improvement in space utilization for the average user , while 70 -80% for power users(archival node operators). Note: once this feature is toggled on, it modifies the structure of the database with a migration and cannot be rolled back. This feature is experimental and should only be used in non-serving beacon nodes in case of database corruption or other critical issue. +- Experimental database improvements to reduce history state entry space usage in the beaconchain.db. This functionality + can be permanently enabled with the flag `--enable-historical-state-representation`. Enabling this feature can realize + a 25% improvement in space utilization for the average user , while 70 -80% for power users(archival node operators). + Note: once this feature is toggled on, it modifies the structure of the database with a migration and cannot be rolled + back. This feature is experimental and should only be used in non-serving beacon nodes in case of database corruption + or other critical issue. #### New Metrics **Beacon chain node** -| Metric | Description | References | -|--------------------------------------------------|-------------------------------------------------------------------------------------------------------|-------------| -| `p2p_message_ignored_validation_total` | Count of messages that were ignored in validation | | -| `beacon_current_active_validators` | Current total active validators | | -| `beacon_processed_deposits_total` | Total number of deposits processed | | -| `sync_head_state_miss` | The number of sync head state requests that are not present in the cache | | -| `sync_head_state_hit` | The number of sync head state requests that are present in the cache | | -| `total_effective_balance_cache_miss` | The number of get requests that are not present in the cache | | -| `total_effective_balance_cache_hit` | The number of get requests that are present in the cache | | -| `sync_committee_index_cache_miss_total` | The number of committee requests that aren't present in the sync committee index cache | | -| `sync_committee_index_cache_hit_total` | The number of committee requests that are present in the sync committee index cache | | -| `next_slot_cache_hit` | The number of cache hits on the next slot state cache | | -| `next_slot_cache_miss` | The number of cache misses on the next slot state cache | | -| `validator_entry_cache_hit_total` | The number of cache hits on the validator entry cache | | -| `validator_entry_cache_miss_total` | The number of cache misses on the validator entry cache | | -| `validator_entry_cache_delete_total` | The number of cache deletes on the validator entry cache | | -| `saved_sync_committee_message_total` | The number of saved sync committee message total | | -| `saved_sync_committee_contribution_total` | The number of saved sync committee contribution total | | -| `libp2p_peers` | Tracks the total number of libp2p peers | | -| `p2p_status_message_missing` | The number of attempts the connection handler rejects a peer for a missing status message | | -| `p2p_sync_committee_subnet_recovered_broadcasts` | The number of sync committee messages that were attempted to be broadcast with no peers on the subnet | | -| `p2p_sync_committee_subnet_attempted_broadcasts` | The number of sync committees that were attempted to be broadcast | | -| `p2p_subscribed_topic_peer_total` | The number of peers subscribed to topics that a host node is also subscribed to | | -| `saved_orphaned_att_total` | Count the number of times an orphaned attestation is saved | | +| Metric | Description | References | +|--------------------------------------------------|-------------------------------------------------------------------------------------------------------|------------| +| `p2p_message_ignored_validation_total` | Count of messages that were ignored in validation | | +| `beacon_current_active_validators` | Current total active validators | | +| `beacon_processed_deposits_total` | Total number of deposits processed | | +| `sync_head_state_miss` | The number of sync head state requests that are not present in the cache | | +| `sync_head_state_hit` | The number of sync head state requests that are present in the cache | | +| `total_effective_balance_cache_miss` | The number of get requests that are not present in the cache | | +| `total_effective_balance_cache_hit` | The number of get requests that are present in the cache | | +| `sync_committee_index_cache_miss_total` | The number of committee requests that aren't present in the sync committee index cache | | +| `sync_committee_index_cache_hit_total` | The number of committee requests that are present in the sync committee index cache | | +| `next_slot_cache_hit` | The number of cache hits on the next slot state cache | | +| `next_slot_cache_miss` | The number of cache misses on the next slot state cache | | +| `validator_entry_cache_hit_total` | The number of cache hits on the validator entry cache | | +| `validator_entry_cache_miss_total` | The number of cache misses on the validator entry cache | | +| `validator_entry_cache_delete_total` | The number of cache deletes on the validator entry cache | | +| `saved_sync_committee_message_total` | The number of saved sync committee message total | | +| `saved_sync_committee_contribution_total` | The number of saved sync committee contribution total | | +| `libp2p_peers` | Tracks the total number of libp2p peers | | +| `p2p_status_message_missing` | The number of attempts the connection handler rejects a peer for a missing status message | | +| `p2p_sync_committee_subnet_recovered_broadcasts` | The number of sync committee messages that were attempted to be broadcast with no peers on the subnet | | +| `p2p_sync_committee_subnet_attempted_broadcasts` | The number of sync committees that were attempted to be broadcast | | +| `p2p_subscribed_topic_peer_total` | The number of peers subscribed to topics that a host node is also subscribed to | | +| `saved_orphaned_att_total` | Count the number of times an orphaned attestation is saved | | ### Changed - Much refactoring of "util" packages into more canonical packages. Please review Prysm package structure and godocs. -- Altair object keys in beacon-chain/db/kv are prefixed with "altair". BeaconBlocks and BeaconStates are the only objects affected by database key changes for Altair. This affects any third party tooling directly querying Prysm's beaconchain.db. +- Altair object keys in beacon-chain/db/kv are prefixed with "altair". BeaconBlocks and BeaconStates are the only + objects affected by database key changes for Altair. This affects any third party tooling directly querying Prysm's + beaconchain.db. - Updated Teku bootnodes. - Updated Lighthouse bootnodes. - End to end testing now collects jaeger spans - Improvements to experimental peer quality scoring. This feature is only enabled with `--enable-peer-scorer`. -- Validator performance logging behavior has changed in Altair. Post-Altair hardfork has the following changes: Inclusion distance and inclusion slots will no longer be displayed. Correctly voted target will only be true if also included within 32 slots. Correctly voted head will only be true if the attestation was included in the next slot. Correctly voted source will only be true if attestation is included within 5 slots. Inactivity score will be displayed. +- Validator performance logging behavior has changed in Altair. Post-Altair hardfork has the following changes: + Inclusion distance and inclusion slots will no longer be displayed. Correctly voted target will only be true if also + included within 32 slots. Correctly voted head will only be true if the attestation was included in the next slot. + Correctly voted source will only be true if attestation is included within 5 slots. Inactivity score will be + displayed. - Increased pubsub message queue size from 256 to 600 to support larger networks and higher message volume. - The default attestation aggregation changed to the improved optimized max cover algorithm. - Prysm is passing spectests at v1.1.0 (latest available release). @@ -2528,13 +2709,15 @@ Please update your beacon node to v2.0.0 prior to updating your validator. The b #### Changed Metrics **Beacon chain node** -| Metric | Old Name | Description | References | +| Metric | Old Name | Description | References | |-----------------------|----------------------|------------------------------------------------------|------------| -| `beacon_reorgs_total` | `beacon_reorg_total` | Count the number of times a beacon chain has a reorg | | +| `beacon_reorgs_total` | `beacon_reorg_total` | Count the number of times a beacon chain has a reorg | | ### Deprecated -These flags are hidden from the help text and no longer modify the behavior of Prysm. These flags should be removed from user runtime configuration as the flags will eventually be removed entirely and Prysm will fail to start if a deleted or unknown flag is provided. +These flags are hidden from the help text and no longer modify the behavior of Prysm. These flags should be removed from +user runtime configuration as the flags will eventually be removed entirely and Prysm will fail to start if a deleted or +unknown flag is provided. - `--enable-active-balance-cache` - `--correctly-prune-canonical-atts` @@ -2546,17 +2729,24 @@ These flags are hidden from the help text and no longer modify the behavior of P Note: Removed flags will block starting up with an error "flag provided but not defined:". Please check that you are not using any of the removed flags in this section! -- Prysm's standalone slasher application (cmd/slasher) has been fully removed. Use the `--slasher` flag with a beacon chain node for full slasher functionality. -- `--disable-blst` (beacon node and validator). [blst](https://github.com/supranational/blst) is the only BLS library offered for Prysm. -- `--disable-sync-backtracking` and `--enable-sync-backtracking` (beacon node). This feature has been released for some time. See. +- Prysm's standalone slasher application (cmd/slasher) has been fully removed. Use the `--slasher` flag with a beacon + chain node for full slasher functionality. +- `--disable-blst` (beacon node and validator). [blst](https://github.com/supranational/blst) is the only BLS library + offered for Prysm. +- `--disable-sync-backtracking` and `--enable-sync-backtracking` (beacon node). This feature has been released for some + time. See. - `--diable-pruning-deposit-proofs` (beacon node). This feature has been released for some time. See. - `--disable-eth1-data-majority-vote` (beacon node). This feature is no longer in use in Prysm. See,. - `--proposer-atts-selection-using-max-cover` (beacon node). This feature has been released for some time. See. - `--update-head-timely` (beacon node). This feature was released in v1.4.4. See. - `--enable-optimized-balance-update` (beacon node). This feature was released in v1.4.4. See. -- Kafka support is no longer available in the beacon node. This functionality was never fully completed and did not fulfill many desirable use cases. This removed the flag `--kafka-url` (beacon node). See. -- Removed tools/faucet. Use the faucet in [prysmaticlabs/periphery](https://github.com/prysmaticlabs/periphery/tree/c2ac600882c37fc0f2a81b0508039124fb6bcf47/eth-faucet) if operating a testnet faucet server. -- Tooling for prior testnet contracts has been removed. Any of the old testnet contracts with `drain()` function have been removed as well. +- Kafka support is no longer available in the beacon node. This functionality was never fully completed and did not + fulfill many desirable use cases. This removed the flag `--kafka-url` (beacon node). See. +- Removed tools/faucet. Use the faucet + in [prysmaticlabs/periphery](https://github.com/prysmaticlabs/periphery/tree/c2ac600882c37fc0f2a81b0508039124fb6bcf47/eth-faucet) + if operating a testnet faucet server. +- Tooling for prior testnet contracts has been removed. Any of the old testnet contracts with `drain()` function have + been removed as well. - Toledo tesnet config is removed. - Removed --eth-api-port (beacon node). All APIs interactions have been moved to --grpc-gateway-port. See. @@ -2574,10 +2764,14 @@ Please check that you are not using any of the removed flags in this section! ### Security -- You MUST update to v2.0.0 or later release before epoch 74240 or your client will fork off from the rest of the network. -- Prysm's JWT library has been updated to a maintained version of the previous JWT library. JWTs are only used in the UI. +- You MUST update to v2.0.0 or later release before epoch 74240 or your client will fork off from the rest of the + network. +- Prysm's JWT library has been updated to a maintained version of the previous JWT library. JWTs are only used in the + UI. + +Please review our newly +updated [security reporting policy](https://github.com/prysmaticlabs/prysm/blob/develop/SECURITY.md). -Please review our newly updated [security reporting policy](https://github.com/prysmaticlabs/prysm/blob/develop/SECURITY.md). - Fix subcommands such as validator accounts list ### Security diff --git a/api/server/structs/BUILD.bazel b/api/server/structs/BUILD.bazel index df11af3b0221..cbe01272a175 100644 --- a/api/server/structs/BUILD.bazel +++ b/api/server/structs/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "block.go", "conversions.go", "conversions_block.go", + "conversions_lightclient.go", "conversions_state.go", "endpoints_beacon.go", "endpoints_blob.go", diff --git a/api/server/structs/conversions_lightclient.go b/api/server/structs/conversions_lightclient.go new file mode 100644 index 000000000000..aa780a37ac30 --- /dev/null +++ b/api/server/structs/conversions_lightclient.go @@ -0,0 +1,3 @@ +package structs + +// diff --git a/api/server/structs/endpoints_lightclient.go b/api/server/structs/endpoints_lightclient.go index 9ef4a3880a67..0abf361c44f0 100644 --- a/api/server/structs/endpoints_lightclient.go +++ b/api/server/structs/endpoints_lightclient.go @@ -1,28 +1,42 @@ package structs +import "encoding/json" + type LightClientHeader struct { Beacon *BeaconBlockHeader `json:"beacon"` } -type LightClientBootstrapResponse struct { - Version string `json:"version"` - Data *LightClientBootstrap `json:"data"` +type LightClientHeaderCapella struct { + Beacon *BeaconBlockHeader `json:"beacon"` + Execution *ExecutionPayloadHeaderCapella `json:"execution"` + ExecutionBranch []string `json:"execution_branch"` +} + +type LightClientHeaderDeneb struct { + Beacon *BeaconBlockHeader `json:"beacon"` + Execution *ExecutionPayloadHeaderDeneb `json:"execution"` + ExecutionBranch []string `json:"execution_branch"` } type LightClientBootstrap struct { - Header *LightClientHeader `json:"header"` - CurrentSyncCommittee *SyncCommittee `json:"current_sync_committee"` - CurrentSyncCommitteeBranch []string `json:"current_sync_committee_branch"` + Header json.RawMessage `json:"header"` + CurrentSyncCommittee *SyncCommittee `json:"current_sync_committee"` + CurrentSyncCommitteeBranch []string `json:"current_sync_committee_branch"` +} + +type LightClientBootstrapResponse struct { + Version string `json:"version"` + Data *LightClientBootstrap `json:"data"` } type LightClientUpdate struct { - AttestedHeader *LightClientHeader `json:"attested_header"` - NextSyncCommittee *SyncCommittee `json:"next_sync_committee,omitempty"` - FinalizedHeader *LightClientHeader `json:"finalized_header,omitempty"` - SyncAggregate *SyncAggregate `json:"sync_aggregate"` - NextSyncCommitteeBranch []string `json:"next_sync_committee_branch,omitempty"` - FinalityBranch []string `json:"finality_branch,omitempty"` - SignatureSlot string `json:"signature_slot"` + AttestedHeader json.RawMessage `json:"attested_header"` + NextSyncCommittee *SyncCommittee `json:"next_sync_committee,omitempty"` + FinalizedHeader json.RawMessage `json:"finalized_header,omitempty"` + SyncAggregate *SyncAggregate `json:"sync_aggregate"` + NextSyncCommitteeBranch []string `json:"next_sync_committee_branch,omitempty"` + FinalityBranch []string `json:"finality_branch,omitempty"` + SignatureSlot string `json:"signature_slot"` } type LightClientUpdateWithVersion struct { diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel index 1643fdff3184..094c8782a2f6 100644 --- a/beacon-chain/core/light-client/BUILD.bazel +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -7,13 +7,20 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/state:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//encoding/bytesutil:go_default_library", + "//encoding/ssz:go_default_library", + "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", "//proto/migration:go_default_library", + "//runtime/version:go_default_library", "//time/slots:go_default_library", + "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index d0038af7b3a1..c572a6325c29 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -4,12 +4,19 @@ import ( "bytes" "fmt" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" "github.com/prysmaticlabs/prysm/v5/proto/migration" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "context" @@ -32,13 +39,15 @@ const ( // signature_slot=update.signature_slot, // ) func CreateLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientFinalityUpdate { - return ðpbv2.LightClientFinalityUpdate{ + finalityUpdate := ðpbv2.LightClientFinalityUpdate{ AttestedHeader: update.AttestedHeader, FinalizedHeader: update.FinalizedHeader, FinalityBranch: update.FinalityBranch, SyncAggregate: update.SyncAggregate, SignatureSlot: update.SignatureSlot, } + + return finalityUpdate } // CreateLightClientOptimisticUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_optimistic_update @@ -50,11 +59,13 @@ func CreateLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2 // signature_slot=update.signature_slot, // ) func CreateLightClientOptimisticUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientOptimisticUpdate { - return ðpbv2.LightClientOptimisticUpdate{ + optimisticUpdate := ðpbv2.LightClientOptimisticUpdate{ AttestedHeader: update.AttestedHeader, SyncAggregate: update.SyncAggregate, SignatureSlot: update.SignatureSlot, } + + return optimisticUpdate } func NewLightClientOptimisticUpdateFromBeaconState( @@ -71,7 +82,7 @@ func NewLightClientOptimisticUpdateFromBeaconState( // assert sum(block.message.body.sync_aggregate.sync_committee_bits) >= MIN_SYNC_COMMITTEE_PARTICIPANTS syncAggregate, err := block.Block().Body().SyncAggregate() if err != nil { - return nil, fmt.Errorf("could not get sync aggregate %w", err) + return nil, errors.Wrap(err, "could not get sync aggregate") } if syncAggregate.SyncCommitteeBits.Count() < params.BeaconConfig().MinSyncCommitteeParticipants { @@ -87,18 +98,18 @@ func NewLightClientOptimisticUpdateFromBeaconState( header := state.LatestBlockHeader() stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get state root %w", err) + return nil, errors.Wrap(err, "could not get state root") } header.StateRoot = stateRoot[:] headerRoot, err := header.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get header root %w", err) + return nil, errors.Wrap(err, "could not get header root") } blockRoot, err := block.Block().HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get block root %w", err) + return nil, errors.Wrap(err, "could not get block root") } if headerRoot != blockRoot { @@ -116,41 +127,100 @@ func NewLightClientOptimisticUpdateFromBeaconState( // attested_header.state_root = hash_tree_root(attested_state) attestedStateRoot, err := attestedState.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get attested state root %w", err) + return nil, errors.Wrap(err, "could not get attested state root") } attestedHeader.StateRoot = attestedStateRoot[:] // assert hash_tree_root(attested_header) == block.message.parent_root attestedHeaderRoot, err := attestedHeader.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get attested header root %w", err) + return nil, errors.Wrap(err, "could not get attested header root") } if attestedHeaderRoot != block.Block().ParentRoot() { return nil, fmt.Errorf("attested header root %#x not equal to block parent root %#x", attestedHeaderRoot, block.Block().ParentRoot()) } - // Return result - attestedHeaderResult := - ðpbv2.LightClientHeader{ - Beacon: ðpbv1.BeaconBlockHeader{ - Slot: attestedHeader.Slot, - ProposerIndex: attestedHeader.ProposerIndex, - ParentRoot: attestedHeader.ParentRoot, - StateRoot: attestedHeader.StateRoot, - BodyRoot: attestedHeader.BodyRoot, - }, - } - syncAggregateResult := ðpbv1.SyncAggregate{ SyncCommitteeBits: syncAggregate.SyncCommitteeBits, SyncCommitteeSignature: syncAggregate.SyncCommitteeSignature, } result := ðpbv2.LightClientUpdate{ - AttestedHeader: attestedHeaderResult, - SyncAggregate: syncAggregateResult, - SignatureSlot: block.Block().Slot(), + SyncAggregate: syncAggregateResult, + SignatureSlot: block.Block().Slot(), + } + + switch block.Block().Version() { + case version.Altair, version.Bellatrix: + result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: attestedHeader.Slot, + ProposerIndex: attestedHeader.ProposerIndex, + ParentRoot: attestedHeader.ParentRoot, + StateRoot: attestedHeader.StateRoot, + BodyRoot: attestedHeader.BodyRoot, + }, + }, + }, + } + case version.Capella: + executionPayloadHeader, err := getExecutionPayloadHeaderCapella(block) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload header") + } + + executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + + result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: attestedHeader.Slot, + ProposerIndex: attestedHeader.ProposerIndex, + ParentRoot: attestedHeader.ParentRoot, + StateRoot: attestedHeader.StateRoot, + BodyRoot: attestedHeader.BodyRoot, + }, + Execution: executionPayloadHeader, + ExecutionBranch: executionPayloadProof, + }, + }, + } + + case version.Deneb, version.Electra: + executionPayloadHeader, err := getExecutionPayloadHeaderDeneb(block) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload header") + } + + executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + + result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: attestedHeader.Slot, + ProposerIndex: attestedHeader.ProposerIndex, + ParentRoot: attestedHeader.ParentRoot, + StateRoot: attestedHeader.StateRoot, + BodyRoot: attestedHeader.BodyRoot, + }, + Execution: executionPayloadHeader, + ExecutionBranch: executionPayloadProof, + }, + }, + } + default: + return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) } return result, nil @@ -173,20 +243,20 @@ func NewLightClientFinalityUpdateFromBeaconState( } // Indicate finality whenever possible - var finalizedHeader *ethpbv2.LightClientHeader + var finalizedHeaderBeacon *ethpbv1.BeaconBlockHeader var finalityBranch [][]byte if finalizedBlock != nil && !finalizedBlock.IsNil() { if finalizedBlock.Block().Slot() != 0 { tempFinalizedHeader, err := finalizedBlock.Header() if err != nil { - return nil, fmt.Errorf("could not get finalized header %w", err) + return nil, errors.Wrap(err, "could not get finalized header") } - finalizedHeader = ðpbv2.LightClientHeader{Beacon: migration.V1Alpha1SignedHeaderToV1(tempFinalizedHeader).GetMessage()} + finalizedHeaderBeacon := migration.V1Alpha1SignedHeaderToV1(tempFinalizedHeader).GetMessage() - finalizedHeaderRoot, err := finalizedHeader.Beacon.HashTreeRoot() + finalizedHeaderRoot, err := finalizedHeaderBeacon.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get finalized header root %w", err) + return nil, errors.Wrap(err, "could not get finalized header root") } if finalizedHeaderRoot != bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root) { @@ -197,28 +267,28 @@ func NewLightClientFinalityUpdateFromBeaconState( return nil, fmt.Errorf("invalid finalized header root %v", attestedState.FinalizedCheckpoint().Root) } - finalizedHeader = ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + finalizedHeaderBeacon = ðpbv1.BeaconBlockHeader{ Slot: 0, ProposerIndex: 0, ParentRoot: make([]byte, 32), StateRoot: make([]byte, 32), BodyRoot: make([]byte, 32), - }} + } } var bErr error finalityBranch, bErr = attestedState.FinalizedRootProof(ctx) if bErr != nil { - return nil, fmt.Errorf("could not get finalized root proof %w", bErr) + return nil, errors.Wrap(bErr, "could not get finalized root proof") } } else { - finalizedHeader = ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + finalizedHeaderBeacon = ðpbv1.BeaconBlockHeader{ Slot: 0, ProposerIndex: 0, ParentRoot: make([]byte, 32), StateRoot: make([]byte, 32), BodyRoot: make([]byte, 32), - }} + } finalityBranch = make([][]byte, FinalityBranchNumOfLeaves) for i := 0; i < FinalityBranchNumOfLeaves; i++ { @@ -226,11 +296,244 @@ func NewLightClientFinalityUpdateFromBeaconState( } } - result.FinalizedHeader = finalizedHeader - result.FinalityBranch = finalityBranch + switch block.Block().Version() { + case version.Altair, version.Bellatrix: + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: finalizedHeaderBeacon}, + }, + } + result.FinalityBranch = finalityBranch + case version.Capella: + if finalizedBlock != nil && !finalizedBlock.IsNil() { + execution, err := getExecutionPayloadHeaderCapella(finalizedBlock) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload header") + } + executionBranch, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: finalizedHeaderBeacon, + Execution: execution, + ExecutionBranch: executionBranch, + }, + }, + } + result.FinalityBranch = finalityBranch + } else { + execution := createEmptyExecutionPayloadHeaderCapella() + executionBranch := make([][]byte, 0) + + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: finalizedHeaderBeacon, + Execution: execution, + ExecutionBranch: executionBranch, + }, + }, + } + + result.FinalityBranch = finalityBranch + } + case version.Deneb, version.Electra: + if finalizedBlock != nil && !finalizedBlock.IsNil() { + execution, err := getExecutionPayloadHeaderDeneb(finalizedBlock) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload header") + } + executionBranch, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: finalizedHeaderBeacon, + Execution: execution, + ExecutionBranch: executionBranch, + }, + }, + } + result.FinalityBranch = finalityBranch + } else { + execution := createEmptyExecutionPayloadHeaderDeneb() + executionBranch := make([][]byte, 0) + + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: finalizedHeaderBeacon, + Execution: execution, + ExecutionBranch: executionBranch, + }, + }, + } + + result.FinalityBranch = finalityBranch + } + default: + return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) + } + return result, nil } +func createEmptyExecutionPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella { + return &enginev1.ExecutionPayloadHeaderCapella{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + BlockNumber: 0, + GasLimit: 0, + GasUsed: 0, + Timestamp: 0, + ExtraData: make([]byte, 32), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + } +} + +func createEmptyExecutionPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb { + return &enginev1.ExecutionPayloadHeaderDeneb{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + BlockNumber: 0, + GasLimit: 0, + GasUsed: 0, + Timestamp: 0, + ExtraData: make([]byte, 32), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + } +} + +func getExecutionPayloadHeaderCapella(block interfaces.ReadOnlySignedBeaconBlock) (*enginev1.ExecutionPayloadHeaderCapella, error) { + payloadInterface, err := block.Block().Body().Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution data") + } + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + if err != nil { + return nil, errors.Wrap(err, "could not get transactions") + } + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + transactionsRoot = transactionsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals") + } + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + withdrawalsRoot = withdrawalsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + + execution := &enginev1.ExecutionPayloadHeaderCapella{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + return execution, nil +} + +func getExecutionPayloadHeaderDeneb(block interfaces.ReadOnlySignedBeaconBlock) (*enginev1.ExecutionPayloadHeaderDeneb, error) { + payloadInterface, err := block.Block().Body().Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution data") + } + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + if err != nil { + return nil, errors.Wrap(err, "could not get transactions") + } + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + transactionsRoot = transactionsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals") + } + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + withdrawalsRoot = withdrawalsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + + execution := &enginev1.ExecutionPayloadHeaderDeneb{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + return execution, nil +} func NewLightClientUpdateFromFinalityUpdate(update *ethpbv2.LightClientFinalityUpdate) *ethpbv2.LightClientUpdate { return ðpbv2.LightClientUpdate{ AttestedHeader: update.AttestedHeader, diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index 568075c2db76..51e706706d23 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -11,8 +11,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) { - l := util.NewTestLightClient(t).SetupTest() +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateCapella(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella() update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) require.NoError(t, err) @@ -23,12 +23,96 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) l.CheckSyncAggregate(update) l.CheckAttestedHeader(update) - require.Equal(t, (*v2.LightClientHeader)(nil), update.FinalizedHeader, "Finalized header is not nil") + require.Equal(t, (*v2.LightClientHeaderContainer)(nil), update.FinalizedHeader, "Finalized header is not nil") require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") } -func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { - l := util.NewTestLightClient(t).SetupTest() +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateAltair(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() + + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update) + l.CheckAttestedHeader(update) + + require.Equal(t, (*v2.LightClientHeaderContainer)(nil), update.FinalizedHeader, "Finalized header is not nil") + require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") +} + +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateDeneb(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb() + + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update) + l.CheckAttestedHeader(update) + + require.Equal(t, (*v2.LightClientHeaderContainer)(nil), update.FinalizedHeader, "Finalized header is not nil") + require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") +} +func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateCapella(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella() + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update) + l.CheckAttestedHeader(update) + + zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + for _, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") + } +} + +func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateAltair(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() + + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update) + l.CheckAttestedHeader(update) + + zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + for _, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") + } +} + +func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateDeneb(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb() update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) require.NoError(t, err) @@ -41,13 +125,18 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { zeroHash := params.BeaconConfig().ZeroHash[:] require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - require.Equal(t, primitives.Slot(0), update.FinalizedHeader.Beacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), update.FinalizedHeader.Beacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.Beacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.Beacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.Beacon.BodyRoot, "Finalized header body root is not zero") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.GetHeaderDeneb().Execution.BlockHash, "Execution BlockHash is not zero") require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") for _, leaf := range update.FinalityBranch { require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") } } + +// TODO - add finality update tests with non-nil finalized block for different versions diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index b39d99165d40..980171cd9f2b 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -306,21 +306,30 @@ func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, f for _, b := range updateData.Data.FinalityBranch { finalityBranch = append(finalityBranch, hexutil.Encode(b)) } + + attestedBeacon, err := updateData.Data.AttestedHeader.GetBeacon() + if err != nil { + return errors.Wrap(err, "could not get attested header") + } + finalizedBeacon, err := updateData.Data.FinalizedHeader.GetBeacon() + if err != nil { + return errors.Wrap(err, "could not get finalized header") + } update := &structs.LightClientFinalityUpdateEvent{ Version: version.String(int(updateData.Version)), Data: &structs.LightClientFinalityUpdate{ AttestedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.Slot), - ProposerIndex: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.ProposerIndex), - ParentRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.ParentRoot), - StateRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.StateRoot), - BodyRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.BodyRoot), + Slot: fmt.Sprintf("%d", attestedBeacon.Slot), + ProposerIndex: fmt.Sprintf("%d", attestedBeacon.ProposerIndex), + ParentRoot: hexutil.Encode(attestedBeacon.ParentRoot), + StateRoot: hexutil.Encode(attestedBeacon.StateRoot), + BodyRoot: hexutil.Encode(attestedBeacon.BodyRoot), }, FinalizedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", updateData.Data.FinalizedHeader.Beacon.Slot), - ProposerIndex: fmt.Sprintf("%d", updateData.Data.FinalizedHeader.Beacon.ProposerIndex), - ParentRoot: hexutil.Encode(updateData.Data.FinalizedHeader.Beacon.ParentRoot), - StateRoot: hexutil.Encode(updateData.Data.FinalizedHeader.Beacon.StateRoot), + Slot: fmt.Sprintf("%d", finalizedBeacon.Slot), + ProposerIndex: fmt.Sprintf("%d", finalizedBeacon.ProposerIndex), + ParentRoot: hexutil.Encode(finalizedBeacon.ParentRoot), + StateRoot: hexutil.Encode(finalizedBeacon.StateRoot), }, FinalityBranch: finalityBranch, SyncAggregate: &structs.SyncAggregate{ @@ -339,15 +348,19 @@ func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, f if !ok { return write(w, flusher, topicDataMismatch, event.Data, LightClientOptimisticUpdateTopic) } + attestedBeacon, err := updateData.Data.AttestedHeader.GetBeacon() + if err != nil { + return errors.Wrap(err, "could not get attested header") + } update := &structs.LightClientOptimisticUpdateEvent{ Version: version.String(int(updateData.Version)), Data: &structs.LightClientOptimisticUpdate{ AttestedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.Slot), - ProposerIndex: fmt.Sprintf("%d", updateData.Data.AttestedHeader.Beacon.ProposerIndex), - ParentRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.ParentRoot), - StateRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.StateRoot), - BodyRoot: hexutil.Encode(updateData.Data.AttestedHeader.Beacon.BodyRoot), + Slot: fmt.Sprintf("%d", attestedBeacon.Slot), + ProposerIndex: fmt.Sprintf("%d", attestedBeacon.ProposerIndex), + ParentRoot: hexutil.Encode(attestedBeacon.ParentRoot), + StateRoot: hexutil.Encode(attestedBeacon.StateRoot), + BodyRoot: hexutil.Encode(attestedBeacon.BodyRoot), }, SyncAggregate: &structs.SyncAggregate{ SyncCommitteeBits: hexutil.Encode(updateData.Data.SyncAggregate.SyncCommitteeBits), diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index a95416814183..04848190b738 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/light-client", visibility = ["//beacon-chain:__subpackages__"], deps = [ + "//api:go_default_library", "//api/server/structs:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/core/light-client:go_default_library", @@ -19,8 +20,11 @@ go_library( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//encoding/ssz:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", @@ -29,6 +33,7 @@ go_library( "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@com_github_wealdtech_go_bytesutil//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 74296f192e85..33f07cf214e2 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -8,6 +8,8 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -46,16 +48,16 @@ func (s *Server) GetLightClientBootstrap(w http.ResponseWriter, req *http.Reques return } - bootstrap, err := createLightClientBootstrap(ctx, state) + bootstrap, err := createLightClientBootstrap(ctx, state, blk.Block()) if err != nil { httputil.HandleError(w, "could not get light client bootstrap: "+err.Error(), http.StatusInternalServerError) return } - response := &structs.LightClientBootstrapResponse{ Version: version.String(blk.Version()), Data: bootstrap, } + w.Header().Set(api.VersionHeader, version.String(version.Deneb)) httputil.WriteJson(w, response) } @@ -351,27 +353,27 @@ func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequ // Get the current state state, err := s.HeadFetcher.HeadState(ctx) if err != nil { - return nil, fmt.Errorf("could not get head state %w", err) + return nil, errors.Wrap(err, "could not get head state") } // Get the block latestBlockHeader := *state.LatestBlockHeader() stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get state root %w", err) + return nil, errors.Wrap(err, "could not get state root") } latestBlockHeader.StateRoot = stateRoot[:] latestBlockHeaderRoot, err := latestBlockHeader.HashTreeRoot() if err != nil { - return nil, fmt.Errorf("could not get latest block header root %w", err) + return nil, errors.Wrap(err, "could not get latest block header root") } block, err := s.Blocker.Block(ctx, latestBlockHeaderRoot[:]) if err != nil { - return nil, fmt.Errorf("could not get latest block %w", err) + return nil, errors.Wrap(err, "could not get latest block") } if block == nil { - return nil, fmt.Errorf("latest block is nil") + return nil, errors.New("latest block is nil") } // Loop through the blocks until we find a block that satisfies minSignaturesRequired requirement @@ -385,10 +387,10 @@ func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequ parentRoot := block.Block().ParentRoot() block, err = s.Blocker.Block(ctx, parentRoot[:]) if err != nil { - return nil, fmt.Errorf("could not get parent block %w", err) + return nil, errors.Wrap(err, "could not get parent block") } if block == nil { - return nil, fmt.Errorf("parent block is nil") + return nil, errors.New("parent block is nil") } // Get the number of sync committee signatures diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index 8855aad8c57e..807afd578a8d 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -26,10 +26,65 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestLightClientHandler_GetLightClientBootstrap(t *testing.T) { +func TestLightClientHandler_GetLightClientBootstrap_Altair(t *testing.T) { helpers.ClearCache() slot := primitives.Slot(params.BeaconConfig().AltairForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + b := util.NewBeaconBlockAltair() + b.Block.StateRoot = bytesutil.PadTo([]byte("foo"), 32) + b.Block.Slot = slot + + signedBlock, err := blocks.NewSignedBeaconBlock(b) + + require.NoError(t, err) + header, err := signedBlock.Header() + require.NoError(t, err) + + r, err := b.Block.HashTreeRoot() + require.NoError(t, err) + + bs, err := util.NewBeaconStateAltair(func(state *ethpb.BeaconStateAltair) error { + state.BlockRoots[0] = r[:] + return nil + }) + require.NoError(t, err) + + require.NoError(t, bs.SetSlot(slot)) + require.NoError(t, bs.SetLatestBlockHeader(header.Header)) + + mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot: bs, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + muxVars := make(map[string]string) + muxVars["block_root"] = hexutil.Encode(r[:]) + request := httptest.NewRequest("GET", "http://foo.com/", nil) + request = mux.SetURLVars(request, muxVars) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientBootstrap(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientBootstrapResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Data.Header, &respHeader) + require.NoError(t, err) + require.Equal(t, "altair", resp.Version) + require.Equal(t, hexutil.Encode(header.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) +} + +func TestLightClientHandler_GetLightClientBootstrap_Capella(t *testing.T) { + helpers.ClearCache() + slot := primitives.Slot(params.BeaconConfig().CapellaForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + b := util.NewBeaconBlockCapella() b.Block.StateRoot = bytesutil.PadTo([]byte("foo"), 32) b.Block.Slot = slot @@ -37,58 +92,865 @@ func TestLightClientHandler_GetLightClientBootstrap(t *testing.T) { signedBlock, err := blocks.NewSignedBeaconBlock(b) require.NoError(t, err) - header, err := signedBlock.Header() + header, err := signedBlock.Header() + require.NoError(t, err) + + r, err := b.Block.HashTreeRoot() + require.NoError(t, err) + + bs, err := util.NewBeaconStateCapella(func(state *ethpb.BeaconStateCapella) error { + state.BlockRoots[0] = r[:] + return nil + }) + require.NoError(t, err) + + require.NoError(t, bs.SetSlot(slot)) + require.NoError(t, bs.SetLatestBlockHeader(header.Header)) + + mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot: bs, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + muxVars := make(map[string]string) + muxVars["block_root"] = hexutil.Encode(r[:]) + request := httptest.NewRequest("GET", "http://foo.com/", nil) + request = mux.SetURLVars(request, muxVars) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientBootstrap(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientBootstrapResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeaderCapella + err = json.Unmarshal(resp.Data.Header, &respHeader) + require.NoError(t, err) + require.Equal(t, "capella", resp.Version) + require.Equal(t, hexutil.Encode(header.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) +} + +func TestLightClientHandler_GetLightClientBootstrap_Deneb(t *testing.T) { + helpers.ClearCache() + slot := primitives.Slot(params.BeaconConfig().DenebForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + b := util.NewBeaconBlockDeneb() + b.Block.StateRoot = bytesutil.PadTo([]byte("foo"), 32) + b.Block.Slot = slot + + signedBlock, err := blocks.NewSignedBeaconBlock(b) + + require.NoError(t, err) + header, err := signedBlock.Header() + require.NoError(t, err) + + r, err := b.Block.HashTreeRoot() + require.NoError(t, err) + + bs, err := util.NewBeaconStateDeneb(func(state *ethpb.BeaconStateDeneb) error { + state.BlockRoots[0] = r[:] + return nil + }) + require.NoError(t, err) + + require.NoError(t, bs.SetSlot(slot)) + require.NoError(t, bs.SetLatestBlockHeader(header.Header)) + + mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot: bs, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + muxVars := make(map[string]string) + muxVars["block_root"] = hexutil.Encode(r[:]) + request := httptest.NewRequest("GET", "http://foo.com/", nil) + request = mux.SetURLVars(request, muxVars) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientBootstrap(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientBootstrapResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeaderDeneb + err = json.Unmarshal(resp.Data.Header, &respHeader) + require.NoError(t, err) + require.Equal(t, "deneb", resp.Version) + require.Equal(t, hexutil.Encode(header.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) +} + +func TestLightClientHandler_GetLightClientUpdatesByRangeAltair(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateAltair() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockAltair() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateAltair() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockAltair() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) + url := fmt.Sprintf("http://foo.com/?count=1&start_period=%d", startPeriod) + request := httptest.NewRequest("GET", url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientUpdatesByRange(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) + require.Equal(t, "altair", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) +} + +func TestLightClientHandler_GetLightClientUpdatesByRangeCapella(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.CapellaForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateCapella() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockCapella() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateCapella() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) + url := fmt.Sprintf("http://foo.com/?count=1&start_period=%d", startPeriod) + request := httptest.NewRequest("GET", url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientUpdatesByRange(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeaderCapella + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) + require.Equal(t, "capella", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) +} + +func TestLightClientHandler_GetLightClientUpdatesByRangeDeneb(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.DenebForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockDeneb() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockDeneb() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) + url := fmt.Sprintf("http://foo.com/?count=1&start_period=%d", startPeriod) + request := httptest.NewRequest("GET", url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientUpdatesByRange(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeaderDeneb + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) + require.Equal(t, "deneb", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) +} + +func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCountAltair(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateAltair() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockAltair() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateAltair() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockAltair() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) + count := 129 // config.MaxRequestLightClientUpdates is 128 + url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) + request := httptest.NewRequest("GET", url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientUpdatesByRange(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) // Even with big count input, the response is still the max available period, which is 1 in test case. + require.Equal(t, "altair", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) +} + +func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCountCapella(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.CapellaForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateCapella() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockCapella() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateCapella() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) + count := 129 // config.MaxRequestLightClientUpdates is 128 + url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) + request := httptest.NewRequest("GET", url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientUpdatesByRange(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeaderCapella + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) // Even with big count input, the response is still the max available period, which is 1 in test case. + require.Equal(t, "capella", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) +} + +func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCountDeneb(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.DenebForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockDeneb() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockDeneb() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) + count := 129 // config.MaxRequestLightClientUpdates is 128 + url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) + request := httptest.NewRequest("GET", url, nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientUpdatesByRange(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeaderDeneb + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) // Even with big count input, the response is still the max available period, which is 1 in test case. + require.Equal(t, "deneb", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) +} + +// TODO - check for not having any blocks from the min period, and startPeriod being too early +func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriodAltair(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateAltair() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + parent := util.NewBeaconBlockAltair() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateAltair() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockAltair() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() require.NoError(t, err) - r, err := b.Block.HashTreeRoot() + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) require.NoError(t, err) - bs, err := util.NewBeaconStateCapella(func(state *ethpb.BeaconStateCapella) error { - state.BlockRoots[0] = r[:] - return nil - }) + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) require.NoError(t, err) - require.NoError(t, bs.SetSlot(slot)) - require.NoError(t, bs.SetLatestBlockHeader(header.Header)) + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) - mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} - mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ - slot: bs, + slot.Sub(1): attestedState, + slot: st, }}, Blocker: mockBlocker, HeadFetcher: mockChainService, } - muxVars := make(map[string]string) - muxVars["block_root"] = hexutil.Encode(r[:]) - request := httptest.NewRequest("GET", "http://foo.com/", nil) - request = mux.SetURLVars(request, muxVars) + startPeriod := 1 // very early period before Altair fork + count := 1 + url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) + request := httptest.NewRequest("GET", url, nil) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetLightClientBootstrap(writer, request) + s.GetLightClientUpdatesByRange(writer, request) + require.Equal(t, http.StatusOK, writer.Code) - resp := &structs.LightClientBootstrapResponse{} - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) - require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(header.Header.BodyRoot), resp.Data.Header.Beacon.BodyRoot) - require.NotNil(t, resp.Data) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) + require.Equal(t, "altair", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp) } -func TestLightClientHandler_GetLightClientUpdatesByRange(t *testing.T) { +// TODO - same as above +func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigCountAltair(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) - attestedState, err := util.NewBeaconStateCapella() + attestedState, err := util.NewBeaconStateAltair() require.NoError(t, err) err = attestedState.SetSlot(slot.Sub(1)) require.NoError(t, err) - parent := util.NewBeaconBlockCapella() + parent := util.NewBeaconBlockAltair() parent.Block.Slot = slot.Sub(1) signedParent, err := blocks.NewSignedBeaconBlock(parent) @@ -108,7 +970,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange(t *testing.T) { signedParent, err = blocks.NewSignedBeaconBlock(parent) require.NoError(t, err) - st, err := util.NewBeaconStateCapella() + st, err := util.NewBeaconStateAltair() require.NoError(t, err) err = st.SetSlot(slot) require.NoError(t, err) @@ -116,7 +978,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange(t *testing.T) { parentRoot, err := signedParent.Block().HashTreeRoot() require.NoError(t, err) - block := util.NewBeaconBlockCapella() + block := util.NewBeaconBlockAltair() block.Block.Slot = slot block.Block.ParentRoot = parentRoot[:] @@ -162,8 +1024,9 @@ func TestLightClientHandler_GetLightClientUpdatesByRange(t *testing.T) { Blocker: mockBlocker, HeadFetcher: mockChainService, } - startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) - url := fmt.Sprintf("http://foo.com/?count=1&start_period=%d", startPeriod) + startPeriod := 1 // very early period before Altair fork + count := 10 // This is big count as we only have one period in test case. + url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) request := httptest.NewRequest("GET", url, nil) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -171,19 +1034,23 @@ func TestLightClientHandler_GetLightClientUpdatesByRange(t *testing.T) { s.GetLightClientUpdatesByRange(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp []structs.LightClientUpdateWithVersion - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) - require.Equal(t, 1, len(resp)) - require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) + var resp structs.LightClientUpdatesByRangeResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp.Updates) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Updates[0].Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, 1, len(resp.Updates)) + require.Equal(t, "altair", resp.Updates[0].Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) require.NotNil(t, resp) } -func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCount(t *testing.T) { +func TestLightClientHandler_GetLightClientUpdatesByRange_BeforeAltair(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() - slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Sub(1) attestedState, err := util.NewBeaconStateCapella() require.NoError(t, err) @@ -265,7 +1132,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCount(t *tes HeadFetcher: mockChainService, } startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) - count := 129 // config.MaxRequestLightClientUpdates is 128 + count := 1 url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) request := httptest.NewRequest("GET", url, nil) writer := httptest.NewRecorder() @@ -273,27 +1140,26 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigInputCount(t *tes s.GetLightClientUpdatesByRange(writer, request) - require.Equal(t, http.StatusOK, writer.Code) - var resp []structs.LightClientUpdateWithVersion - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) - require.Equal(t, 1, len(resp)) // Even with big count input, the response is still the max available period, which is 1 in test case. - require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) - require.NotNil(t, resp) + require.Equal(t, http.StatusNotFound, writer.Code) } -func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriod(t *testing.T) { +func TestLightClientHandler_GetLightClientFinalityUpdateAltair(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) - attestedState, err := util.NewBeaconStateCapella() + attestedState, err := util.NewBeaconStateAltair() require.NoError(t, err) err = attestedState.SetSlot(slot.Sub(1)) require.NoError(t, err) - parent := util.NewBeaconBlockCapella() + require.NoError(t, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: config.AltairForkEpoch - 10, + Root: make([]byte, 32), + })) + + parent := util.NewBeaconBlockAltair() parent.Block.Slot = slot.Sub(1) signedParent, err := blocks.NewSignedBeaconBlock(parent) @@ -313,7 +1179,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriod(t *testi signedParent, err = blocks.NewSignedBeaconBlock(parent) require.NoError(t, err) - st, err := util.NewBeaconStateCapella() + st, err := util.NewBeaconStateAltair() require.NoError(t, err) err = st.SetSlot(slot) require.NoError(t, err) @@ -321,7 +1187,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriod(t *testi parentRoot, err := signedParent.Block().HashTreeRoot() require.NoError(t, err) - block := util.NewBeaconBlockCapella() + block := util.NewBeaconBlockAltair() block.Block.Slot = slot block.Block.ParentRoot = parentRoot[:] @@ -358,7 +1224,9 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriod(t *testi slot: signedBlock, }, } - mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st, FinalizedRoots: map[[32]byte]bool{ + root: true, + }} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ slot.Sub(1): attestedState, @@ -367,35 +1235,40 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooEarlyPeriod(t *testi Blocker: mockBlocker, HeadFetcher: mockChainService, } - startPeriod := 1 // very early period before Altair fork - count := 1 - url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) - request := httptest.NewRequest("GET", url, nil) + request := httptest.NewRequest("GET", "http://foo.com", nil) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetLightClientUpdatesByRange(writer, request) + s.GetLightClientFinalityUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp []structs.LightClientUpdateWithVersion - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) - require.Equal(t, 1, len(resp)) - require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) - require.NotNil(t, resp) + var resp structs.LightClientUpdateWithVersion + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, "altair", resp.Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) } -func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigCount(t *testing.T) { +func TestLightClientHandler_GetLightClientFinalityUpdateCapella(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() - slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + slot := primitives.Slot(config.CapellaForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) attestedState, err := util.NewBeaconStateCapella() require.NoError(t, err) err = attestedState.SetSlot(slot.Sub(1)) require.NoError(t, err) + require.NoError(t, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: config.AltairForkEpoch - 10, + Root: make([]byte, 32), + })) + parent := util.NewBeaconBlockCapella() parent.Block.Slot = slot.Sub(1) @@ -461,7 +1334,9 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigCount(t *testing. slot: signedBlock, }, } - mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st, FinalizedRoots: map[[32]byte]bool{ + root: true, + }} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ slot.Sub(1): attestedState, @@ -470,36 +1345,41 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_TooBigCount(t *testing. Blocker: mockBlocker, HeadFetcher: mockChainService, } - startPeriod := 1 // very early period before Altair fork - count := 10 // This is big count as we only have one period in test case. - url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) - request := httptest.NewRequest("GET", url, nil) + request := httptest.NewRequest("GET", "http://foo.com", nil) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetLightClientUpdatesByRange(writer, request) + s.GetLightClientFinalityUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp []structs.LightClientUpdateWithVersion - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), &resp)) - require.Equal(t, 1, len(resp)) - require.Equal(t, "capella", resp[0].Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp[0].Data.AttestedHeader.Beacon.BodyRoot) - require.NotNil(t, resp) + var resp structs.LightClientUpdateWithVersion + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, "capella", resp.Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) } -func TestLightClientHandler_GetLightClientUpdatesByRange_BeforeAltair(t *testing.T) { +func TestLightClientHandler_GetLightClientFinalityUpdateDeneb(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() - slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Sub(1) + slot := primitives.Slot(config.DenebForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) - attestedState, err := util.NewBeaconStateCapella() + attestedState, err := util.NewBeaconStateDeneb() require.NoError(t, err) err = attestedState.SetSlot(slot.Sub(1)) require.NoError(t, err) - parent := util.NewBeaconBlockCapella() + require.NoError(t, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: config.AltairForkEpoch - 10, + Root: make([]byte, 32), + })) + + parent := util.NewBeaconBlockDeneb() parent.Block.Slot = slot.Sub(1) signedParent, err := blocks.NewSignedBeaconBlock(parent) @@ -519,7 +1399,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_BeforeAltair(t *testing signedParent, err = blocks.NewSignedBeaconBlock(parent) require.NoError(t, err) - st, err := util.NewBeaconStateCapella() + st, err := util.NewBeaconStateDeneb() require.NoError(t, err) err = st.SetSlot(slot) require.NoError(t, err) @@ -527,7 +1407,7 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_BeforeAltair(t *testing parentRoot, err := signedParent.Block().HashTreeRoot() require.NoError(t, err) - block := util.NewBeaconBlockCapella() + block := util.NewBeaconBlockDeneb() block.Block.Slot = slot block.Block.ParentRoot = parentRoot[:] @@ -564,7 +1444,9 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_BeforeAltair(t *testing slot: signedBlock, }, } - mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st, FinalizedRoots: map[[32]byte]bool{ + root: true, + }} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ slot.Sub(1): attestedState, @@ -573,25 +1455,31 @@ func TestLightClientHandler_GetLightClientUpdatesByRange_BeforeAltair(t *testing Blocker: mockBlocker, HeadFetcher: mockChainService, } - startPeriod := slot.Div(uint64(config.EpochsPerSyncCommitteePeriod)).Div(uint64(config.SlotsPerEpoch)) - count := 1 - url := fmt.Sprintf("http://foo.com/?count=%d&start_period=%d", count, startPeriod) - request := httptest.NewRequest("GET", url, nil) + request := httptest.NewRequest("GET", "http://foo.com", nil) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetLightClientUpdatesByRange(writer, request) + s.GetLightClientFinalityUpdate(writer, request) - require.Equal(t, http.StatusNotFound, writer.Code) + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdateWithVersion + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeaderDeneb + err = json.Unmarshal(resp.Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, "deneb", resp.Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) } -func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { +func TestLightClientHandler_GetLightClientOptimisticUpdateAltair(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) - attestedState, err := util.NewBeaconStateCapella() + attestedState, err := util.NewBeaconStateAltair() require.NoError(t, err) err = attestedState.SetSlot(slot.Sub(1)) require.NoError(t, err) @@ -601,7 +1489,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { Root: make([]byte, 32), })) - parent := util.NewBeaconBlockCapella() + parent := util.NewBeaconBlockAltair() parent.Block.Slot = slot.Sub(1) signedParent, err := blocks.NewSignedBeaconBlock(parent) @@ -621,7 +1509,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { signedParent, err = blocks.NewSignedBeaconBlock(parent) require.NoError(t, err) - st, err := util.NewBeaconStateCapella() + st, err := util.NewBeaconStateAltair() require.NoError(t, err) err = st.SetSlot(slot) require.NoError(t, err) @@ -629,7 +1517,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { parentRoot, err := signedParent.Block().HashTreeRoot() require.NoError(t, err) - block := util.NewBeaconBlockCapella() + block := util.NewBeaconBlockAltair() block.Block.Slot = slot block.Block.ParentRoot = parentRoot[:] @@ -681,21 +1569,25 @@ func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.GetLightClientFinalityUpdate(writer, request) + s.GetLightClientOptimisticUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - resp := &structs.LightClientUpdateWithVersion{} - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) - require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp.Data.AttestedHeader.Beacon.BodyRoot) + var resp structs.LightClientUpdateWithVersion + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, "altair", resp.Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) require.NotNil(t, resp.Data) } -func TestLightClientHandler_GetLightClientOptimisticUpdate(t *testing.T) { +func TestLightClientHandler_GetLightClientOptimisticUpdateCapella(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() - slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + slot := primitives.Slot(config.CapellaForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) attestedState, err := util.NewBeaconStateCapella() require.NoError(t, err) @@ -790,10 +1682,124 @@ func TestLightClientHandler_GetLightClientOptimisticUpdate(t *testing.T) { s.GetLightClientOptimisticUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - resp := &structs.LightClientUpdateWithVersion{} - require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) + var resp structs.LightClientUpdateWithVersion + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeaderCapella + err = json.Unmarshal(resp.Data.AttestedHeader, &respHeader) + require.NoError(t, err) require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), resp.Data.AttestedHeader.Beacon.BodyRoot) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) + require.NotNil(t, resp.Data) +} + +func TestLightClientHandler_GetLightClientOptimisticUpdateDeneb(t *testing.T) { + helpers.ClearCache() + ctx := context.Background() + config := params.BeaconConfig() + slot := primitives.Slot(config.DenebForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + + attestedState, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + err = attestedState.SetSlot(slot.Sub(1)) + require.NoError(t, err) + + require.NoError(t, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: config.AltairForkEpoch - 10, + Root: make([]byte, 32), + })) + + parent := util.NewBeaconBlockDeneb() + parent.Block.Slot = slot.Sub(1) + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + parentHeader, err := signedParent.Header() + require.NoError(t, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(t, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(t, err) + + st, err := util.NewBeaconStateDeneb() + require.NoError(t, err) + err = st.SetSlot(slot) + require.NoError(t, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(t, err) + + block := util.NewBeaconBlockDeneb() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < config.SyncCommitteeSize; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + h, err := signedBlock.Header() + require.NoError(t, err) + + err = st.SetLatestBlockHeader(h.Header) + require.NoError(t, err) + stateRoot, err := st.HashTreeRoot(ctx) + require.NoError(t, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(t, err) + + root, err := block.Block.HashTreeRoot() + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{ + RootBlockMap: map[[32]byte]interfaces.ReadOnlySignedBeaconBlock{ + parentRoot: signedParent, + root: signedBlock, + }, + SlotBlockMap: map[primitives.Slot]interfaces.ReadOnlySignedBeaconBlock{ + slot.Sub(1): signedParent, + slot: signedBlock, + }, + } + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot, State: st, FinalizedRoots: map[[32]byte]bool{ + root: true, + }} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot.Sub(1): attestedState, + slot: st, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + request := httptest.NewRequest("GET", "http://foo.com", nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientOptimisticUpdate(writer, request) + + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientUpdateWithVersion + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeaderDeneb + err = json.Unmarshal(resp.Data.AttestedHeader, &respHeader) + require.NoError(t, err) + require.Equal(t, "deneb", resp.Version) + require.Equal(t, hexutil.Encode(attestedHeader.BodyRoot), respHeader.Beacon.BodyRoot) require.NotNil(t, resp.Data) } @@ -801,7 +1807,7 @@ func TestLightClientHandler_GetLightClientEventBlock(t *testing.T) { helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() - slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + slot := primitives.Slot(config.CapellaForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) attestedState, err := util.NewBeaconStateCapella() require.NoError(t, err) @@ -905,7 +1911,7 @@ func TestLightClientHandler_GetLightClientEventBlock_NeedFetchParent(t *testing. helpers.ClearCache() ctx := context.Background() config := params.BeaconConfig() - slot := primitives.Slot(config.AltairForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) + slot := primitives.Slot(config.CapellaForkEpoch * primitives.Epoch(config.SlotsPerEpoch)).Add(1) attestedState, err := util.NewBeaconStateCapella() require.NoError(t, err) diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index c871f8b4943a..aa5f8a6b81dd 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -2,17 +2,24 @@ package lightclient import ( "context" + "encoding/json" "fmt" "reflect" "strconv" + "github.com/pkg/errors" + lightclient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" @@ -20,7 +27,21 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" ) -// createLightClientBootstrap - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_bootstrap +func createLightClientBootstrap(ctx context.Context, state state.BeaconState, blk interfaces.ReadOnlyBeaconBlock) (*structs.LightClientBootstrap, error) { + switch blk.Version() { + case version.Phase0: + return nil, fmt.Errorf("light client bootstrap is not supported for phase0") + case version.Altair, version.Bellatrix: + return createLightClientBootstrapAltair(ctx, state) + case version.Capella: + return createLightClientBootstrapCapella(ctx, state, blk) + case version.Deneb, version.Electra: + return createLightClientBootstrapDeneb(ctx, state, blk) + } + return nil, fmt.Errorf("unsupported block version %s", version.String(blk.Version())) +} + +// createLightClientBootstrapAltair - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_bootstrap // def create_light_client_bootstrap(state: BeaconState) -> LightClientBootstrap: // // assert compute_epoch_at_slot(state.slot) >= ALTAIR_FORK_EPOCH @@ -37,7 +58,7 @@ import ( // current_sync_committee=state.current_sync_committee, // current_sync_committee_branch=compute_merkle_proof_for_state(state, CURRENT_SYNC_COMMITTEE_INDEX) // ) -func createLightClientBootstrap(ctx context.Context, state state.BeaconState) (*structs.LightClientBootstrap, error) { +func createLightClientBootstrapAltair(ctx context.Context, state state.BeaconState) (*structs.LightClientBootstrap, error) { // assert compute_epoch_at_slot(state.slot) >= ALTAIR_FORK_EPOCH if slots.ToEpoch(state.Slot()) < params.BeaconConfig().AltairForkEpoch { return nil, fmt.Errorf("light client bootstrap is not supported before Altair, invalid slot %d", state.Slot()) @@ -52,14 +73,14 @@ func createLightClientBootstrap(ctx context.Context, state state.BeaconState) (* // Prepare data currentSyncCommittee, err := state.CurrentSyncCommittee() if err != nil { - return nil, fmt.Errorf("could not get current sync committee: %s", err.Error()) + return nil, errors.Wrap(err, "could not get current sync committee") } committee := structs.SyncCommitteeFromConsensus(currentSyncCommittee) currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) if err != nil { - return nil, fmt.Errorf("could not get current sync committee proof: %s", err.Error()) + return nil, errors.Wrap(err, "could not get current sync committee proof") } branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) @@ -78,13 +99,249 @@ func createLightClientBootstrap(ctx context.Context, state state.BeaconState) (* // Above shared util function won't calculate state root, so we need to do it manually stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, fmt.Errorf("could not get state root: %s", err.Error()) + return nil, errors.Wrap(err, "could not get state root") } header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) + headerJson, err := json.Marshal(header) + if err != nil { + return nil, errors.Wrap(err, "could not convert header to raw message") + } + // Return result result := &structs.LightClientBootstrap{ - Header: header, + Header: headerJson, + CurrentSyncCommittee: committee, + CurrentSyncCommitteeBranch: branch, + } + + return result, nil +} + +func createLightClientBootstrapCapella(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlyBeaconBlock) (*structs.LightClientBootstrap, error) { + // assert compute_epoch_at_slot(state.slot) >= CAPELLA_FORK_EPOCH + if slots.ToEpoch(state.Slot()) < params.BeaconConfig().CapellaForkEpoch { + return nil, fmt.Errorf("creating Capella light client bootstrap is not supported before Capella, invalid slot %d", state.Slot()) + } + + // assert state.slot == state.latest_block_header.slot + latestBlockHeader := state.LatestBlockHeader() + if state.Slot() != latestBlockHeader.Slot { + return nil, fmt.Errorf("state slot %d not equal to latest block header slot %d", state.Slot(), latestBlockHeader.Slot) + } + + // Prepare data + currentSyncCommittee, err := state.CurrentSyncCommittee() + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee") + } + + committee := structs.SyncCommitteeFromConsensus(currentSyncCommittee) + + currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee proof") + } + + branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + for i, proof := range currentSyncCommitteeProof { + branch[i] = hexutil.Encode(proof) + } + + beacon := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) + + payloadInterface, err := block.Body().Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload") + } + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + if err != nil { + return nil, errors.Wrap(err, "could not get transactions") + } + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + transactionsRoot = transactionsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals") + } + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + withdrawalsRoot = withdrawalsRootArray[:] + } + executionPayloadHeader := &structs.ExecutionPayloadHeaderCapella{ + ParentHash: hexutil.Encode(payloadInterface.ParentHash()), + FeeRecipient: hexutil.Encode(payloadInterface.FeeRecipient()), + StateRoot: hexutil.Encode(payloadInterface.StateRoot()), + ReceiptsRoot: hexutil.Encode(payloadInterface.ReceiptsRoot()), + LogsBloom: hexutil.Encode(payloadInterface.LogsBloom()), + PrevRandao: hexutil.Encode(payloadInterface.PrevRandao()), + BlockNumber: hexutil.EncodeUint64(payloadInterface.BlockNumber()), + GasLimit: hexutil.EncodeUint64(payloadInterface.GasLimit()), + GasUsed: hexutil.EncodeUint64(payloadInterface.GasUsed()), + Timestamp: hexutil.EncodeUint64(payloadInterface.Timestamp()), + ExtraData: hexutil.Encode(payloadInterface.ExtraData()), + BaseFeePerGas: hexutil.Encode(payloadInterface.BaseFeePerGas()), + BlockHash: hexutil.Encode(payloadInterface.BlockHash()), + TransactionsRoot: hexutil.Encode(transactionsRoot), + WithdrawalsRoot: hexutil.Encode(withdrawalsRoot), + } + + executionPayloadProof, err := blocks.PayloadProof(ctx, block) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + executionPayloadProofStr := make([]string, len(executionPayloadProof)) + for i, proof := range executionPayloadProof { + executionPayloadProofStr[i] = hexutil.Encode(proof) + } + header := &structs.LightClientHeaderCapella{ + Beacon: beacon, + Execution: executionPayloadHeader, + ExecutionBranch: executionPayloadProofStr, + } + + // Above shared util function won't calculate state root, so we need to do it manually + stateRoot, err := state.HashTreeRoot(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get state root") + } + header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) + + headerJson, err := json.Marshal(header) + if err != nil { + return nil, errors.Wrap(err, "could not convert header to raw message") + } + + // Return result + result := &structs.LightClientBootstrap{ + Header: headerJson, + CurrentSyncCommittee: committee, + CurrentSyncCommitteeBranch: branch, + } + + return result, nil +} + +func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlyBeaconBlock) (*structs.LightClientBootstrap, error) { + // assert compute_epoch_at_slot(state.slot) >= DENEB_FORK_EPOCH + if slots.ToEpoch(state.Slot()) < params.BeaconConfig().DenebForkEpoch { + return nil, fmt.Errorf("creating Deneb light client bootstrap is not supported before Deneb, invalid slot %d", state.Slot()) + } + + // assert state.slot == state.latest_block_header.slot + latestBlockHeader := state.LatestBlockHeader() + if state.Slot() != latestBlockHeader.Slot { + return nil, fmt.Errorf("state slot %d not equal to latest block header slot %d", state.Slot(), latestBlockHeader.Slot) + } + + // Prepare data + currentSyncCommittee, err := state.CurrentSyncCommittee() + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee") + } + + committee := structs.SyncCommitteeFromConsensus(currentSyncCommittee) + + currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee proof") + } + + branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + for i, proof := range currentSyncCommitteeProof { + branch[i] = hexutil.Encode(proof) + } + + beacon := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) + + payloadInterface, err := block.Body().Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload") + } + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + if err != nil { + return nil, errors.Wrap(err, "could not get transactions") + } + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + transactionsRoot = transactionsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals") + } + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + withdrawalsRoot = withdrawalsRootArray[:] + } + executionPayloadHeader := &structs.ExecutionPayloadHeaderDeneb{ + ParentHash: hexutil.Encode(payloadInterface.ParentHash()), + FeeRecipient: hexutil.Encode(payloadInterface.FeeRecipient()), + StateRoot: hexutil.Encode(payloadInterface.StateRoot()), + ReceiptsRoot: hexutil.Encode(payloadInterface.ReceiptsRoot()), + LogsBloom: hexutil.Encode(payloadInterface.LogsBloom()), + PrevRandao: hexutil.Encode(payloadInterface.PrevRandao()), + BlockNumber: hexutil.EncodeUint64(payloadInterface.BlockNumber()), + GasLimit: hexutil.EncodeUint64(payloadInterface.GasLimit()), + GasUsed: hexutil.EncodeUint64(payloadInterface.GasUsed()), + Timestamp: hexutil.EncodeUint64(payloadInterface.Timestamp()), + ExtraData: hexutil.Encode(payloadInterface.ExtraData()), + BaseFeePerGas: hexutil.Encode(payloadInterface.BaseFeePerGas()), + BlockHash: hexutil.Encode(payloadInterface.BlockHash()), + TransactionsRoot: hexutil.Encode(transactionsRoot), + WithdrawalsRoot: hexutil.Encode(withdrawalsRoot), + } + + executionPayloadProof, err := blocks.PayloadProof(ctx, block) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + executionPayloadProofStr := make([]string, len(executionPayloadProof)) + for i, proof := range executionPayloadProof { + executionPayloadProofStr[i] = hexutil.Encode(proof) + } + header := &structs.LightClientHeaderDeneb{ + Beacon: beacon, + Execution: executionPayloadHeader, + ExecutionBranch: executionPayloadProofStr, + } + + // Above shared util function won't calculate state root, so we need to do it manually + stateRoot, err := state.HashTreeRoot(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get state root") + } + header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) + + headerJson, err := json.Marshal(header) + if err != nil { + return nil, errors.Wrap(err, "could not convert header to raw message") + } + // Return result + result := &structs.LightClientBootstrap{ + Header: headerJson, CurrentSyncCommittee: committee, CurrentSyncCommitteeBranch: branch, } @@ -169,12 +426,16 @@ func createLightClientUpdate( updateSignaturePeriod := slots.SyncCommitteePeriod(slots.ToEpoch(block.Block().Slot())) // update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) - updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(result.AttestedHeader.Beacon.Slot)) + resultAttestedHeaderBeacon, err := result.AttestedHeader.GetBeacon() + if err != nil { + return nil, errors.Wrap(err, "could not get attested header beacon") + } + updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(resultAttestedHeaderBeacon.Slot)) if updateAttestedPeriod == updateSignaturePeriod { tempNextSyncCommittee, err := attestedState.NextSyncCommittee() if err != nil { - return nil, fmt.Errorf("could not get next sync committee: %s", err.Error()) + return nil, errors.Wrap(err, "could not get next sync committee") } nextSyncCommittee = &v2.SyncCommittee{ @@ -184,7 +445,7 @@ func createLightClientUpdate( nextSyncCommitteeBranch, err = attestedState.NextSyncCommitteeProof(ctx) if err != nil { - return nil, fmt.Errorf("could not get next sync committee proof: %s", err.Error()) + return nil, errors.Wrap(err, "could not get next sync committee proof") } } else { syncCommitteeSize := params.BeaconConfig().SyncCommitteeSize @@ -205,7 +466,11 @@ func createLightClientUpdate( result.NextSyncCommittee = nextSyncCommittee result.NextSyncCommitteeBranch = nextSyncCommitteeBranch - return newLightClientUpdateToJSON(result), nil + res, err := newLightClientUpdateToJSON(result) + if err != nil { + return nil, errors.Wrap(err, "could not convert light client update to JSON") + } + return res, nil } func newLightClientFinalityUpdateFromBeaconState( @@ -219,7 +484,11 @@ func newLightClientFinalityUpdateFromBeaconState( return nil, err } - return newLightClientUpdateToJSON(result), nil + res, err := newLightClientUpdateToJSON(result) + if err != nil { + return nil, errors.Wrap(err, "could not convert light client update to JSON") + } + return res, nil } func newLightClientOptimisticUpdateFromBeaconState( @@ -232,42 +501,11 @@ func newLightClientOptimisticUpdateFromBeaconState( return nil, err } - return newLightClientUpdateToJSON(result), nil -} - -func NewLightClientBootstrapFromJSON(bootstrapJSON *structs.LightClientBootstrap) (*v2.LightClientBootstrap, error) { - bootstrap := &v2.LightClientBootstrap{} - - var err error - - v1Alpha1Header, err := bootstrapJSON.Header.Beacon.ToConsensus() + res, err := newLightClientUpdateToJSON(result) if err != nil { - return nil, err - } - bootstrap.Header = &v2.LightClientHeader{Beacon: migration.V1Alpha1HeaderToV1(v1Alpha1Header)} - - currentSyncCommittee, err := bootstrapJSON.CurrentSyncCommittee.ToConsensus() - if err != nil { - return nil, err - } - bootstrap.CurrentSyncCommittee = migration.V1Alpha1SyncCommitteeToV2(currentSyncCommittee) - - if bootstrap.CurrentSyncCommitteeBranch, err = branchFromJSON(bootstrapJSON.CurrentSyncCommitteeBranch); err != nil { - return nil, err - } - return bootstrap, nil -} - -func branchFromJSON(branch []string) ([][]byte, error) { - var branchBytes [][]byte - for _, root := range branch { - branch, err := hexutil.Decode(root) - if err != nil { - return nil, err - } - branchBytes = append(branchBytes, branch) + return nil, errors.Wrap(err, "could not convert light client update to JSON") } - return branchBytes, nil + return res, nil } func branchToJSON(branchBytes [][]byte) []string { @@ -291,9 +529,9 @@ func syncAggregateToJSON(input *v1.SyncAggregate) *structs.SyncAggregate { } } -func newLightClientUpdateToJSON(input *v2.LightClientUpdate) *structs.LightClientUpdate { +func newLightClientUpdateToJSON(input *v2.LightClientUpdate) (*structs.LightClientUpdate, error) { if input == nil { - return nil + return nil, errors.New("input is nil") } var nextSyncCommittee *structs.SyncCommittee @@ -303,18 +541,36 @@ func newLightClientUpdateToJSON(input *v2.LightClientUpdate) *structs.LightClien var finalizedHeader *structs.BeaconBlockHeader if input.FinalizedHeader != nil { - finalizedHeader = structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(input.FinalizedHeader.Beacon)) + inputFinalizedHeaderBeacon, err := input.FinalizedHeader.GetBeacon() + if err != nil { + return nil, errors.Wrap(err, "could not get finalized header beacon") + } + finalizedHeader = structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(inputFinalizedHeaderBeacon)) } - return &structs.LightClientUpdate{ - AttestedHeader: &structs.LightClientHeader{Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(input.AttestedHeader.Beacon))}, + inputAttestedHeaderBeacon, err := input.AttestedHeader.GetBeacon() + if err != nil { + return nil, errors.Wrap(err, "could not get attested header beacon") + } + attestedHeaderJson, err := json.Marshal(&structs.LightClientHeader{Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(inputAttestedHeaderBeacon))}) + if err != nil { + return nil, errors.Wrap(err, "could not convert attested header to raw message") + } + finalizedHeaderJson, err := json.Marshal(&structs.LightClientHeader{Beacon: finalizedHeader}) + if err != nil { + return nil, errors.Wrap(err, "could not convert finalized header to raw message") + } + result := &structs.LightClientUpdate{ + AttestedHeader: attestedHeaderJson, NextSyncCommittee: nextSyncCommittee, NextSyncCommitteeBranch: branchToJSON(input.NextSyncCommitteeBranch), - FinalizedHeader: &structs.LightClientHeader{Beacon: finalizedHeader}, + FinalizedHeader: finalizedHeaderJson, FinalityBranch: branchToJSON(input.FinalityBranch), SyncAggregate: syncAggregateToJSON(input.SyncAggregate), SignatureSlot: strconv.FormatUint(uint64(input.SignatureSlot), 10), } + + return result, nil } func IsSyncCommitteeUpdate(update *v2.LightClientUpdate) bool { @@ -327,7 +583,7 @@ func IsFinalityUpdate(update *v2.LightClientUpdate) bool { return !reflect.DeepEqual(update.FinalityBranch, finalityBranch) } -func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) bool { +func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) (bool, error) { maxActiveParticipants := newUpdate.SyncAggregate.SyncCommitteeBits.Len() newNumActiveParticipants := newUpdate.SyncAggregate.SyncCommitteeBits.Count() oldNumActiveParticipants := oldUpdate.SyncAggregate.SyncCommitteeBits.Count() @@ -335,45 +591,63 @@ func IsBetterUpdate(newUpdate, oldUpdate *v2.LightClientUpdate) bool { oldHasSupermajority := oldNumActiveParticipants*3 >= maxActiveParticipants*2 if newHasSupermajority != oldHasSupermajority { - return newHasSupermajority + return newHasSupermajority, nil } if !newHasSupermajority && newNumActiveParticipants != oldNumActiveParticipants { - return newNumActiveParticipants > oldNumActiveParticipants + return newNumActiveParticipants > oldNumActiveParticipants, nil + } + + newUpdateAttestedHeaderBeacon, err := newUpdate.AttestedHeader.GetBeacon() + if err != nil { + return false, errors.Wrap(err, "could not get attested header beacon") + } + oldUpdateAttestedHeaderBeacon, err := oldUpdate.AttestedHeader.GetBeacon() + if err != nil { + return false, errors.Wrap(err, "could not get attested header beacon") } // Compare presence of relevant sync committee - newHasRelevantSyncCommittee := IsSyncCommitteeUpdate(newUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.SignatureSlot))) - oldHasRelevantSyncCommittee := IsSyncCommitteeUpdate(oldUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.SignatureSlot))) + newHasRelevantSyncCommittee := IsSyncCommitteeUpdate(newUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(newUpdateAttestedHeaderBeacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.SignatureSlot))) + oldHasRelevantSyncCommittee := IsSyncCommitteeUpdate(oldUpdate) && (slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdateAttestedHeaderBeacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.SignatureSlot))) if newHasRelevantSyncCommittee != oldHasRelevantSyncCommittee { - return newHasRelevantSyncCommittee + return newHasRelevantSyncCommittee, nil } // Compare indication of any finality newHasFinality := IsFinalityUpdate(newUpdate) oldHasFinality := IsFinalityUpdate(oldUpdate) if newHasFinality != oldHasFinality { - return newHasFinality + return newHasFinality, nil + } + + newUpdateFinalizedHeaderBeacon, err := newUpdate.FinalizedHeader.GetBeacon() + if err != nil { + return false, errors.Wrap(err, "could not get finalized header beacon") + } + oldUpdateFinalizedHeaderBeacon, err := oldUpdate.FinalizedHeader.GetBeacon() + if err != nil { + return false, errors.Wrap(err, "could not get finalized header beacon") } // Compare sync committee finality if newHasFinality { - newHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.FinalizedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdate.AttestedHeader.Beacon.Slot)) - oldHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.FinalizedHeader.Beacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdate.AttestedHeader.Beacon.Slot)) + newHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(newUpdateFinalizedHeaderBeacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(newUpdateAttestedHeaderBeacon.Slot)) + oldHasSyncCommitteeFinality := slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdateFinalizedHeaderBeacon.Slot)) == slots.SyncCommitteePeriod(slots.ToEpoch(oldUpdateAttestedHeaderBeacon.Slot)) if newHasSyncCommitteeFinality != oldHasSyncCommitteeFinality { - return newHasSyncCommitteeFinality + return newHasSyncCommitteeFinality, nil } } // Tiebreaker 1: Sync committee participation beyond supermajority if newNumActiveParticipants != oldNumActiveParticipants { - return newNumActiveParticipants > oldNumActiveParticipants + return newNumActiveParticipants > oldNumActiveParticipants, nil } // Tiebreaker 2: Prefer older data (fewer changes to best) - if newUpdate.AttestedHeader.Beacon.Slot != oldUpdate.AttestedHeader.Beacon.Slot { - return newUpdate.AttestedHeader.Beacon.Slot < oldUpdate.AttestedHeader.Beacon.Slot + if newUpdateAttestedHeaderBeacon.Slot != oldUpdateAttestedHeaderBeacon.Slot { + return newUpdateAttestedHeaderBeacon.Slot < oldUpdateAttestedHeaderBeacon.Slot, nil } - return newUpdate.SignatureSlot < oldUpdate.SignatureSlot + return newUpdate.SignatureSlot < oldUpdate.SignatureSlot, nil } diff --git a/beacon-chain/rpc/eth/light-client/helpers_test.go b/beacon-chain/rpc/eth/light-client/helpers_test.go index f693f9b88be3..726527ef8be4 100644 --- a/beacon-chain/rpc/eth/light-client/helpers_test.go +++ b/beacon-chain/rpc/eth/light-client/helpers_test.go @@ -94,9 +94,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), SignatureSlot: 9999, }, @@ -104,9 +108,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000001, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000001, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 1000000, }, @@ -118,9 +126,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000001, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000001, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 1000000, }, @@ -128,9 +140,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), SignatureSlot: 9999, }, @@ -142,9 +158,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: make([][]byte, lightclient.FinalityBranchNumOfLeaves), @@ -153,9 +173,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), @@ -168,9 +192,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), @@ -179,9 +207,13 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: make([][]byte, lightclient.FinalityBranchNumOfLeaves), @@ -194,29 +226,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 999999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 999999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }}, + }, + }, }, expectedResult: true, }, @@ -226,29 +274,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 999999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 999999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: false, }, @@ -258,29 +322,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,1,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: true, }, @@ -290,29 +370,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b01111100, 0b1}, // [0,1,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: false, }, @@ -322,29 +418,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 999999, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: true, }, @@ -354,29 +466,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 999999, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 999999, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: false, }, @@ -386,29 +514,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9998, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: true, }, @@ -418,29 +562,45 @@ func TestIsBetterUpdate(t *testing.T) { SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9998, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, newUpdate: ðpbv2.LightClientUpdate{ SyncAggregate: ðpbv1.SyncAggregate{ SyncCommitteeBits: []byte{0b00111100, 0b1}, // [0,0,1,1,1,1,0,0] }, - AttestedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 1000000, - }}, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1000000, + }}, + }, + }, NextSyncCommitteeBranch: createNonEmptySyncCommitteeBranch(), SignatureSlot: 9999, FinalityBranch: createNonEmptyFinalityBranch(), - FinalizedHeader: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ - Slot: 9999, - }}, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 9999, + }}, + }, + }, }, expectedResult: false, }, @@ -448,7 +608,9 @@ func TestIsBetterUpdate(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - assert.Equal(t, testCase.expectedResult, IsBetterUpdate(testCase.newUpdate, testCase.oldUpdate)) + result, err := IsBetterUpdate(testCase.newUpdate, testCase.oldUpdate) + assert.NoError(t, err) + assert.Equal(t, testCase.expectedResult, result) }) } } diff --git a/consensus-types/blocks/proofs.go b/consensus-types/blocks/proofs.go index 34e0f394a055..5b9c756a2b74 100644 --- a/consensus-types/blocks/proofs.go +++ b/consensus-types/blocks/proofs.go @@ -8,6 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/hash/htr" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" @@ -181,7 +182,7 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) return fieldRoots, nil } -func ComputeBlockFieldRoots(ctx context.Context, block *BeaconBlock) ([][]byte, error) { +func ComputeBlockFieldRoots(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([][]byte, error) { _, span := trace.StartSpan(ctx, "blocks.ComputeBlockFieldRoots") defer span.End() @@ -195,21 +196,23 @@ func ComputeBlockFieldRoots(ctx context.Context, block *BeaconBlock) ([][]byte, } // Slot - slotRoot := ssz.Uint64Root(uint64(block.slot)) + slotRoot := ssz.Uint64Root(uint64(block.Slot())) copy(fieldRoots[0], slotRoot[:]) // Proposer Index - proposerRoot := ssz.Uint64Root(uint64(block.proposerIndex)) + proposerRoot := ssz.Uint64Root(uint64(block.ProposerIndex())) copy(fieldRoots[1], proposerRoot[:]) // Parent Root - copy(fieldRoots[2], block.parentRoot[:]) + parentRoot := block.ParentRoot() + copy(fieldRoots[2], parentRoot[:]) // State Root - copy(fieldRoots[3], block.stateRoot[:]) + stateRoot := block.StateRoot() + copy(fieldRoots[3], stateRoot[:]) // block body Root - blockBodyRoot, err := block.body.HashTreeRoot() + blockBodyRoot, err := block.Body().HashTreeRoot() if err != nil { return nil, err } @@ -218,7 +221,7 @@ func ComputeBlockFieldRoots(ctx context.Context, block *BeaconBlock) ([][]byte, return fieldRoots, nil } -func PayloadProof(ctx context.Context, block *BeaconBlock) ([][]byte, error) { +func PayloadProof(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([][]byte, error) { i := block.Body() blockBody, ok := i.(*BeaconBlockBody) if !ok { diff --git a/proto/eth/v2/BUILD.bazel b/proto/eth/v2/BUILD.bazel index 1e8dab8675d2..37b7368c46b8 100644 --- a/proto/eth/v2/BUILD.bazel +++ b/proto/eth/v2/BUILD.bazel @@ -77,6 +77,7 @@ go_library( name = "go_default_library", srcs = [ ":ssz_generated_files", + "custom.go", ], embed = [":go_proto"], importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v2", diff --git a/proto/eth/v2/beacon_lightclient.pb.go b/proto/eth/v2/beacon_lightclient.pb.go index c5020da60529..e9f2f3704e5c 100755 --- a/proto/eth/v2/beacon_lightclient.pb.go +++ b/proto/eth/v2/beacon_lightclient.pb.go @@ -11,6 +11,7 @@ import ( sync "sync" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -71,20 +72,241 @@ func (x *LightClientHeader) GetBeacon() *v1.BeaconBlockHeader { return nil } +type LightClientHeaderCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beacon *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"` + Execution *v11.ExecutionPayloadHeaderCapella `protobuf:"bytes,2,opt,name=execution,proto3" json:"execution,omitempty"` + ExecutionBranch [][]byte `protobuf:"bytes,3,rep,name=execution_branch,json=executionBranch,proto3" json:"execution_branch,omitempty"` +} + +func (x *LightClientHeaderCapella) Reset() { + *x = LightClientHeaderCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeaderCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeaderCapella) ProtoMessage() {} + +func (x *LightClientHeaderCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeaderCapella.ProtoReflect.Descriptor instead. +func (*LightClientHeaderCapella) Descriptor() ([]byte, []int) { + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{1} +} + +func (x *LightClientHeaderCapella) GetBeacon() *v1.BeaconBlockHeader { + if x != nil { + return x.Beacon + } + return nil +} + +func (x *LightClientHeaderCapella) GetExecution() *v11.ExecutionPayloadHeaderCapella { + if x != nil { + return x.Execution + } + return nil +} + +func (x *LightClientHeaderCapella) GetExecutionBranch() [][]byte { + if x != nil { + return x.ExecutionBranch + } + return nil +} + +type LightClientHeaderDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beacon *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"` + Execution *v11.ExecutionPayloadHeaderDeneb `protobuf:"bytes,2,opt,name=execution,proto3" json:"execution,omitempty"` + ExecutionBranch [][]byte `protobuf:"bytes,3,rep,name=execution_branch,json=executionBranch,proto3" json:"execution_branch,omitempty"` +} + +func (x *LightClientHeaderDeneb) Reset() { + *x = LightClientHeaderDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeaderDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeaderDeneb) ProtoMessage() {} + +func (x *LightClientHeaderDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeaderDeneb.ProtoReflect.Descriptor instead. +func (*LightClientHeaderDeneb) Descriptor() ([]byte, []int) { + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{2} +} + +func (x *LightClientHeaderDeneb) GetBeacon() *v1.BeaconBlockHeader { + if x != nil { + return x.Beacon + } + return nil +} + +func (x *LightClientHeaderDeneb) GetExecution() *v11.ExecutionPayloadHeaderDeneb { + if x != nil { + return x.Execution + } + return nil +} + +func (x *LightClientHeaderDeneb) GetExecutionBranch() [][]byte { + if x != nil { + return x.ExecutionBranch + } + return nil +} + +type LightClientHeaderContainer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Header: + // + // *LightClientHeaderContainer_HeaderAltair + // *LightClientHeaderContainer_HeaderCapella + // *LightClientHeaderContainer_HeaderDeneb + Header isLightClientHeaderContainer_Header `protobuf_oneof:"header"` +} + +func (x *LightClientHeaderContainer) Reset() { + *x = LightClientHeaderContainer{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeaderContainer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeaderContainer) ProtoMessage() {} + +func (x *LightClientHeaderContainer) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeaderContainer.ProtoReflect.Descriptor instead. +func (*LightClientHeaderContainer) Descriptor() ([]byte, []int) { + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{3} +} + +func (m *LightClientHeaderContainer) GetHeader() isLightClientHeaderContainer_Header { + if m != nil { + return m.Header + } + return nil +} + +func (x *LightClientHeaderContainer) GetHeaderAltair() *LightClientHeader { + if x, ok := x.GetHeader().(*LightClientHeaderContainer_HeaderAltair); ok { + return x.HeaderAltair + } + return nil +} + +func (x *LightClientHeaderContainer) GetHeaderCapella() *LightClientHeaderCapella { + if x, ok := x.GetHeader().(*LightClientHeaderContainer_HeaderCapella); ok { + return x.HeaderCapella + } + return nil +} + +func (x *LightClientHeaderContainer) GetHeaderDeneb() *LightClientHeaderDeneb { + if x, ok := x.GetHeader().(*LightClientHeaderContainer_HeaderDeneb); ok { + return x.HeaderDeneb + } + return nil +} + +type isLightClientHeaderContainer_Header interface { + isLightClientHeaderContainer_Header() +} + +type LightClientHeaderContainer_HeaderAltair struct { + HeaderAltair *LightClientHeader `protobuf:"bytes,1,opt,name=header_altair,json=headerAltair,proto3,oneof"` +} + +type LightClientHeaderContainer_HeaderCapella struct { + HeaderCapella *LightClientHeaderCapella `protobuf:"bytes,2,opt,name=header_capella,json=headerCapella,proto3,oneof"` +} + +type LightClientHeaderContainer_HeaderDeneb struct { + HeaderDeneb *LightClientHeaderDeneb `protobuf:"bytes,3,opt,name=header_deneb,json=headerDeneb,proto3,oneof"` +} + +func (*LightClientHeaderContainer_HeaderAltair) isLightClientHeaderContainer_Header() {} + +func (*LightClientHeaderContainer_HeaderCapella) isLightClientHeaderContainer_Header() {} + +func (*LightClientHeaderContainer_HeaderDeneb) isLightClientHeaderContainer_Header() {} + type LightClientBootstrap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Header *LightClientHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` - CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty"` + Header *LightClientHeaderContainer `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty"` } func (x *LightClientBootstrap) Reset() { *x = LightClientBootstrap{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -97,7 +319,7 @@ func (x *LightClientBootstrap) String() string { func (*LightClientBootstrap) ProtoMessage() {} func (x *LightClientBootstrap) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -110,10 +332,10 @@ func (x *LightClientBootstrap) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientBootstrap.ProtoReflect.Descriptor instead. func (*LightClientBootstrap) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{1} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{4} } -func (x *LightClientBootstrap) GetHeader() *LightClientHeader { +func (x *LightClientBootstrap) GetHeader() *LightClientHeaderContainer { if x != nil { return x.Header } @@ -139,10 +361,10 @@ type LightClientUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AttestedHeader *LightClientHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + AttestedHeader *LightClientHeaderContainer `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty"` - FinalizedHeader *LightClientHeader `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalizedHeader *LightClientHeaderContainer `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty"` SyncAggregate *v1.SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` @@ -151,7 +373,7 @@ type LightClientUpdate struct { func (x *LightClientUpdate) Reset() { *x = LightClientUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -164,7 +386,7 @@ func (x *LightClientUpdate) String() string { func (*LightClientUpdate) ProtoMessage() {} func (x *LightClientUpdate) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -177,10 +399,10 @@ func (x *LightClientUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientUpdate.ProtoReflect.Descriptor instead. func (*LightClientUpdate) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{2} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{5} } -func (x *LightClientUpdate) GetAttestedHeader() *LightClientHeader { +func (x *LightClientUpdate) GetAttestedHeader() *LightClientHeaderContainer { if x != nil { return x.AttestedHeader } @@ -201,7 +423,7 @@ func (x *LightClientUpdate) GetNextSyncCommitteeBranch() [][]byte { return nil } -func (x *LightClientUpdate) GetFinalizedHeader() *LightClientHeader { +func (x *LightClientUpdate) GetFinalizedHeader() *LightClientHeaderContainer { if x != nil { return x.FinalizedHeader } @@ -241,7 +463,7 @@ type LightClientFinalityUpdateWithVersion struct { func (x *LightClientFinalityUpdateWithVersion) Reset() { *x = LightClientFinalityUpdateWithVersion{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -254,7 +476,7 @@ func (x *LightClientFinalityUpdateWithVersion) String() string { func (*LightClientFinalityUpdateWithVersion) ProtoMessage() {} func (x *LightClientFinalityUpdateWithVersion) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -267,7 +489,7 @@ func (x *LightClientFinalityUpdateWithVersion) ProtoReflect() protoreflect.Messa // Deprecated: Use LightClientFinalityUpdateWithVersion.ProtoReflect.Descriptor instead. func (*LightClientFinalityUpdateWithVersion) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{3} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{6} } func (x *LightClientFinalityUpdateWithVersion) GetVersion() Version { @@ -289,8 +511,8 @@ type LightClientFinalityUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AttestedHeader *LightClientHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` - FinalizedHeader *LightClientHeader `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + AttestedHeader *LightClientHeaderContainer `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + FinalizedHeader *LightClientHeaderContainer `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty"` SyncAggregate *v1.SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` @@ -299,7 +521,7 @@ type LightClientFinalityUpdate struct { func (x *LightClientFinalityUpdate) Reset() { *x = LightClientFinalityUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -312,7 +534,7 @@ func (x *LightClientFinalityUpdate) String() string { func (*LightClientFinalityUpdate) ProtoMessage() {} func (x *LightClientFinalityUpdate) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -325,17 +547,17 @@ func (x *LightClientFinalityUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientFinalityUpdate.ProtoReflect.Descriptor instead. func (*LightClientFinalityUpdate) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{4} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{7} } -func (x *LightClientFinalityUpdate) GetAttestedHeader() *LightClientHeader { +func (x *LightClientFinalityUpdate) GetAttestedHeader() *LightClientHeaderContainer { if x != nil { return x.AttestedHeader } return nil } -func (x *LightClientFinalityUpdate) GetFinalizedHeader() *LightClientHeader { +func (x *LightClientFinalityUpdate) GetFinalizedHeader() *LightClientHeaderContainer { if x != nil { return x.FinalizedHeader } @@ -375,7 +597,7 @@ type LightClientOptimisticUpdateWithVersion struct { func (x *LightClientOptimisticUpdateWithVersion) Reset() { *x = LightClientOptimisticUpdateWithVersion{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -388,7 +610,7 @@ func (x *LightClientOptimisticUpdateWithVersion) String() string { func (*LightClientOptimisticUpdateWithVersion) ProtoMessage() {} func (x *LightClientOptimisticUpdateWithVersion) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -401,7 +623,7 @@ func (x *LightClientOptimisticUpdateWithVersion) ProtoReflect() protoreflect.Mes // Deprecated: Use LightClientOptimisticUpdateWithVersion.ProtoReflect.Descriptor instead. func (*LightClientOptimisticUpdateWithVersion) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{5} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{8} } func (x *LightClientOptimisticUpdateWithVersion) GetVersion() Version { @@ -423,7 +645,7 @@ type LightClientOptimisticUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AttestedHeader *LightClientHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + AttestedHeader *LightClientHeaderContainer `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` SyncAggregate *v1.SyncAggregate `protobuf:"bytes,2,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` } @@ -431,7 +653,7 @@ type LightClientOptimisticUpdate struct { func (x *LightClientOptimisticUpdate) Reset() { *x = LightClientOptimisticUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -444,7 +666,7 @@ func (x *LightClientOptimisticUpdate) String() string { func (*LightClientOptimisticUpdate) ProtoMessage() {} func (x *LightClientOptimisticUpdate) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -457,10 +679,10 @@ func (x *LightClientOptimisticUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientOptimisticUpdate.ProtoReflect.Descriptor instead. func (*LightClientOptimisticUpdate) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{6} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{9} } -func (x *LightClientOptimisticUpdate) GetAttestedHeader() *LightClientHeader { +func (x *LightClientOptimisticUpdate) GetAttestedHeader() *LightClientHeaderContainer { if x != nil { return x.AttestedHeader } @@ -493,7 +715,7 @@ type LightClientUpdateWithVersion struct { func (x *LightClientUpdateWithVersion) Reset() { *x = LightClientUpdateWithVersion{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -506,7 +728,7 @@ func (x *LightClientUpdateWithVersion) String() string { func (*LightClientUpdateWithVersion) ProtoMessage() {} func (x *LightClientUpdateWithVersion) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7] + mi := &file_proto_eth_v2_beacon_lightclient_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -519,7 +741,7 @@ func (x *LightClientUpdateWithVersion) ProtoReflect() protoreflect.Message { // Deprecated: Use LightClientUpdateWithVersion.ProtoReflect.Descriptor instead. func (*LightClientUpdateWithVersion) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{7} + return file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP(), []int{10} } func (x *LightClientUpdateWithVersion) GetVersion() Version { @@ -550,142 +772,191 @@ var file_proto_eth_v2_beacon_lightclient_proto_rawDesc = []byte{ 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x62, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, - 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x22, 0xeb, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x67, 0x68, 0x74, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, - 0x3a, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x16, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x12, 0x41, 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, - 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, - 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x22, 0x9a, 0x04, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x17, 0x6e, 0x65, 0x78, - 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, - 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, - 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x66, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x45, 0x0a, 0x0e, - 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, - 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, - 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, - 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, - 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, - 0x03, 0x0a, 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, + 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x22, 0xd2, + 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x3a, 0x0a, 0x06, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x09, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x22, 0xce, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3a, + 0x0a, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x09, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x09, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x22, 0x93, 0x02, 0x0a, 0x1a, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x6c, + 0x74, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, + 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x52, + 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x48, 0x00, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x12, 0x4c, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x6e, + 0x65, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x48, 0x00, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x42, 0x08, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xf4, 0x01, 0x0a, 0x14, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, + 0x72, 0x61, 0x70, 0x12, 0x43, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x67, 0x68, 0x74, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9f, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x67, 0x68, - 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, - 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x41, + 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, + 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x22, 0xac, 0x04, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, - 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x1c, 0x4c, 0x69, - 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, - 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x12, - 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, - 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0e, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4e, 0x0a, + 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x3b, 0x0a, + 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x17, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x56, 0x0a, 0x10, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, + 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, + 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, + 0x22, 0x9a, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, + 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa7, 0x03, + 0x0a, 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x56, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x67, 0x68, + 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa8, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x67, + 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0e, + 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, + 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x6c, 0x6f, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, + 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, + 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, + 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -700,45 +971,57 @@ func file_proto_eth_v2_beacon_lightclient_proto_rawDescGZIP() []byte { return file_proto_eth_v2_beacon_lightclient_proto_rawDescData } -var file_proto_eth_v2_beacon_lightclient_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_proto_eth_v2_beacon_lightclient_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_proto_eth_v2_beacon_lightclient_proto_goTypes = []interface{}{ (*LightClientHeader)(nil), // 0: ethereum.eth.v2.LightClientHeader - (*LightClientBootstrap)(nil), // 1: ethereum.eth.v2.LightClientBootstrap - (*LightClientUpdate)(nil), // 2: ethereum.eth.v2.LightClientUpdate - (*LightClientFinalityUpdateWithVersion)(nil), // 3: ethereum.eth.v2.LightClientFinalityUpdateWithVersion - (*LightClientFinalityUpdate)(nil), // 4: ethereum.eth.v2.LightClientFinalityUpdate - (*LightClientOptimisticUpdateWithVersion)(nil), // 5: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion - (*LightClientOptimisticUpdate)(nil), // 6: ethereum.eth.v2.LightClientOptimisticUpdate - (*LightClientUpdateWithVersion)(nil), // 7: ethereum.eth.v2.LightClientUpdateWithVersion - (*v1.BeaconBlockHeader)(nil), // 8: ethereum.eth.v1.BeaconBlockHeader - (*SyncCommittee)(nil), // 9: ethereum.eth.v2.SyncCommittee - (*v1.SyncAggregate)(nil), // 10: ethereum.eth.v1.SyncAggregate - (Version)(0), // 11: ethereum.eth.v2.Version + (*LightClientHeaderCapella)(nil), // 1: ethereum.eth.v2.LightClientHeaderCapella + (*LightClientHeaderDeneb)(nil), // 2: ethereum.eth.v2.LightClientHeaderDeneb + (*LightClientHeaderContainer)(nil), // 3: ethereum.eth.v2.LightClientHeaderContainer + (*LightClientBootstrap)(nil), // 4: ethereum.eth.v2.LightClientBootstrap + (*LightClientUpdate)(nil), // 5: ethereum.eth.v2.LightClientUpdate + (*LightClientFinalityUpdateWithVersion)(nil), // 6: ethereum.eth.v2.LightClientFinalityUpdateWithVersion + (*LightClientFinalityUpdate)(nil), // 7: ethereum.eth.v2.LightClientFinalityUpdate + (*LightClientOptimisticUpdateWithVersion)(nil), // 8: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion + (*LightClientOptimisticUpdate)(nil), // 9: ethereum.eth.v2.LightClientOptimisticUpdate + (*LightClientUpdateWithVersion)(nil), // 10: ethereum.eth.v2.LightClientUpdateWithVersion + (*v1.BeaconBlockHeader)(nil), // 11: ethereum.eth.v1.BeaconBlockHeader + (*v11.ExecutionPayloadHeaderCapella)(nil), // 12: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*v11.ExecutionPayloadHeaderDeneb)(nil), // 13: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*SyncCommittee)(nil), // 14: ethereum.eth.v2.SyncCommittee + (*v1.SyncAggregate)(nil), // 15: ethereum.eth.v1.SyncAggregate + (Version)(0), // 16: ethereum.eth.v2.Version } var file_proto_eth_v2_beacon_lightclient_proto_depIdxs = []int32{ - 8, // 0: ethereum.eth.v2.LightClientHeader.beacon:type_name -> ethereum.eth.v1.BeaconBlockHeader - 0, // 1: ethereum.eth.v2.LightClientBootstrap.header:type_name -> ethereum.eth.v2.LightClientHeader - 9, // 2: ethereum.eth.v2.LightClientBootstrap.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 0, // 3: ethereum.eth.v2.LightClientUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeader - 9, // 4: ethereum.eth.v2.LightClientUpdate.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 0, // 5: ethereum.eth.v2.LightClientUpdate.finalized_header:type_name -> ethereum.eth.v2.LightClientHeader - 10, // 6: ethereum.eth.v2.LightClientUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 11, // 7: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version - 4, // 8: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientFinalityUpdate - 0, // 9: ethereum.eth.v2.LightClientFinalityUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeader - 0, // 10: ethereum.eth.v2.LightClientFinalityUpdate.finalized_header:type_name -> ethereum.eth.v2.LightClientHeader - 10, // 11: ethereum.eth.v2.LightClientFinalityUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 11, // 12: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version - 6, // 13: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientOptimisticUpdate - 0, // 14: ethereum.eth.v2.LightClientOptimisticUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeader - 10, // 15: ethereum.eth.v2.LightClientOptimisticUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate - 11, // 16: ethereum.eth.v2.LightClientUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version - 2, // 17: ethereum.eth.v2.LightClientUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientUpdate - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 11, // 0: ethereum.eth.v2.LightClientHeader.beacon:type_name -> ethereum.eth.v1.BeaconBlockHeader + 11, // 1: ethereum.eth.v2.LightClientHeaderCapella.beacon:type_name -> ethereum.eth.v1.BeaconBlockHeader + 12, // 2: ethereum.eth.v2.LightClientHeaderCapella.execution:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 11, // 3: ethereum.eth.v2.LightClientHeaderDeneb.beacon:type_name -> ethereum.eth.v1.BeaconBlockHeader + 13, // 4: ethereum.eth.v2.LightClientHeaderDeneb.execution:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 0, // 5: ethereum.eth.v2.LightClientHeaderContainer.header_altair:type_name -> ethereum.eth.v2.LightClientHeader + 1, // 6: ethereum.eth.v2.LightClientHeaderContainer.header_capella:type_name -> ethereum.eth.v2.LightClientHeaderCapella + 2, // 7: ethereum.eth.v2.LightClientHeaderContainer.header_deneb:type_name -> ethereum.eth.v2.LightClientHeaderDeneb + 3, // 8: ethereum.eth.v2.LightClientBootstrap.header:type_name -> ethereum.eth.v2.LightClientHeaderContainer + 14, // 9: ethereum.eth.v2.LightClientBootstrap.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 3, // 10: ethereum.eth.v2.LightClientUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeaderContainer + 14, // 11: ethereum.eth.v2.LightClientUpdate.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 3, // 12: ethereum.eth.v2.LightClientUpdate.finalized_header:type_name -> ethereum.eth.v2.LightClientHeaderContainer + 15, // 13: ethereum.eth.v2.LightClientUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 16, // 14: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 7, // 15: ethereum.eth.v2.LightClientFinalityUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientFinalityUpdate + 3, // 16: ethereum.eth.v2.LightClientFinalityUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeaderContainer + 3, // 17: ethereum.eth.v2.LightClientFinalityUpdate.finalized_header:type_name -> ethereum.eth.v2.LightClientHeaderContainer + 15, // 18: ethereum.eth.v2.LightClientFinalityUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 16, // 19: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 9, // 20: ethereum.eth.v2.LightClientOptimisticUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientOptimisticUpdate + 3, // 21: ethereum.eth.v2.LightClientOptimisticUpdate.attested_header:type_name -> ethereum.eth.v2.LightClientHeaderContainer + 15, // 22: ethereum.eth.v2.LightClientOptimisticUpdate.sync_aggregate:type_name -> ethereum.eth.v1.SyncAggregate + 16, // 23: ethereum.eth.v2.LightClientUpdateWithVersion.version:type_name -> ethereum.eth.v2.Version + 5, // 24: ethereum.eth.v2.LightClientUpdateWithVersion.data:type_name -> ethereum.eth.v2.LightClientUpdate + 25, // [25:25] is the sub-list for method output_type + 25, // [25:25] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_proto_eth_v2_beacon_lightclient_proto_init() } @@ -762,7 +1045,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientBootstrap); i { + switch v := v.(*LightClientHeaderCapella); i { case 0: return &v.state case 1: @@ -774,7 +1057,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientUpdate); i { + switch v := v.(*LightClientHeaderDeneb); i { case 0: return &v.state case 1: @@ -786,7 +1069,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientFinalityUpdateWithVersion); i { + switch v := v.(*LightClientHeaderContainer); i { case 0: return &v.state case 1: @@ -798,7 +1081,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientFinalityUpdate); i { + switch v := v.(*LightClientBootstrap); i { case 0: return &v.state case 1: @@ -810,7 +1093,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientOptimisticUpdateWithVersion); i { + switch v := v.(*LightClientUpdate); i { case 0: return &v.state case 1: @@ -822,7 +1105,7 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightClientOptimisticUpdate); i { + switch v := v.(*LightClientFinalityUpdateWithVersion); i { case 0: return &v.state case 1: @@ -834,6 +1117,42 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } file_proto_eth_v2_beacon_lightclient_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientFinalityUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v2_beacon_lightclient_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientOptimisticUpdateWithVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v2_beacon_lightclient_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientOptimisticUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v2_beacon_lightclient_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LightClientUpdateWithVersion); i { case 0: return &v.state @@ -846,13 +1165,18 @@ func file_proto_eth_v2_beacon_lightclient_proto_init() { } } } + file_proto_eth_v2_beacon_lightclient_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*LightClientHeaderContainer_HeaderAltair)(nil), + (*LightClientHeaderContainer_HeaderCapella)(nil), + (*LightClientHeaderContainer_HeaderDeneb)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v2_beacon_lightclient_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/eth/v2/beacon_lightclient.proto b/proto/eth/v2/beacon_lightclient.proto index 6a3933daf99a..e52fe819dcca 100644 --- a/proto/eth/v2/beacon_lightclient.proto +++ b/proto/eth/v2/beacon_lightclient.proto @@ -19,6 +19,7 @@ import "proto/eth/ext/options.proto"; import "proto/eth/v1/beacon_block.proto"; import "proto/eth/v2/version.proto"; import "proto/eth/v2/sync_committee.proto"; +import "proto/engine/v1/execution_engine.proto"; option csharp_namespace = "Ethereum.Eth.V2"; option go_package = "github.com/prysmaticlabs/prysm/v5/proto/eth/v2;eth"; @@ -33,17 +34,38 @@ message LightClientHeader { v1.BeaconBlockHeader beacon = 1; } +message LightClientHeaderCapella { + v1.BeaconBlockHeader beacon = 1; + ethereum.engine.v1.ExecutionPayloadHeaderCapella execution = 2; + repeated bytes execution_branch = 3; +} + +message LightClientHeaderDeneb { + v1.BeaconBlockHeader beacon = 1; + ethereum.engine.v1.ExecutionPayloadHeaderDeneb execution = 2; + repeated bytes execution_branch = 3; +} + +message LightClientHeaderContainer { + oneof header { + LightClientHeader header_altair = 1; + LightClientHeaderCapella header_capella = 2; + LightClientHeaderDeneb header_deneb = 3; + } +} + + message LightClientBootstrap { - LightClientHeader header = 1; + LightClientHeaderContainer header = 1; SyncCommittee current_sync_committee = 2; repeated bytes current_sync_committee_branch = 3; } message LightClientUpdate { - LightClientHeader attested_header = 1; + LightClientHeaderContainer attested_header = 1; SyncCommittee next_sync_committee = 2; repeated bytes next_sync_committee_branch = 3; - LightClientHeader finalized_header = 4; + LightClientHeaderContainer finalized_header = 4; repeated bytes finality_branch = 5; v1.SyncAggregate sync_aggregate = 6; uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; @@ -55,8 +77,8 @@ message LightClientFinalityUpdateWithVersion { } message LightClientFinalityUpdate { - LightClientHeader attested_header = 1; - LightClientHeader finalized_header = 2; + LightClientHeaderContainer attested_header = 1; + LightClientHeaderContainer finalized_header = 2; repeated bytes finality_branch = 3; v1.SyncAggregate sync_aggregate = 4; uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; @@ -68,7 +90,7 @@ message LightClientOptimisticUpdateWithVersion { } message LightClientOptimisticUpdate { - LightClientHeader attested_header = 1; + LightClientHeaderContainer attested_header = 1; v1.SyncAggregate sync_aggregate = 2; uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; } diff --git a/proto/eth/v2/custom.go b/proto/eth/v2/custom.go index 9e7d97493fbc..9a9633db2df3 100644 --- a/proto/eth/v2/custom.go +++ b/proto/eth/v2/custom.go @@ -2,7 +2,10 @@ package eth import ( "bytes" + "fmt" "math/bits" + + v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ) const ( @@ -42,10 +45,23 @@ func isEmptyWithLength(bb [][]byte, length uint64) bool { return true } -func (x *LightClientUpdate) IsSyncCommiteeUpdate() bool { +func (x *LightClientUpdate) IsSyncCommitteeUpdate() bool { return !isEmptyWithLength(x.GetNextSyncCommitteeBranch(), NextSyncCommitteeIndex) } func (x *LightClientUpdate) IsFinalityUpdate() bool { return !isEmptyWithLength(x.GetFinalityBranch(), FinalizedRootIndex) } + +func (x *LightClientHeaderContainer) GetBeacon() (*v1.BeaconBlockHeader, error) { + switch input := x.Header.(type) { + case *LightClientHeaderContainer_HeaderAltair: + return input.HeaderAltair.Beacon, nil + case *LightClientHeaderContainer_HeaderCapella: + return input.HeaderCapella.Beacon, nil + case *LightClientHeaderContainer_HeaderDeneb: + return input.HeaderDeneb.Beacon, nil + default: + return nil, fmt.Errorf("unknown header type: %T", input) + } +} diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index 37cd8f26ffd1..dbdbaec9fb34 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -21,16 +21,17 @@ type TestLightClient struct { Block interfaces.ReadOnlySignedBeaconBlock AttestedState state.BeaconState AttestedHeader *ethpb.BeaconBlockHeader + FinalizedBlock interfaces.ReadOnlySignedBeaconBlock } func NewTestLightClient(t *testing.T) *TestLightClient { return &TestLightClient{T: t} } -func (l *TestLightClient) SetupTest() *TestLightClient { +func (l *TestLightClient) SetupTestCapella() *TestLightClient { ctx := context.Background() - slot := primitives.Slot(params.BeaconConfig().AltairForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + slot := primitives.Slot(params.BeaconConfig().CapellaForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) attestedState, err := NewBeaconStateCapella() require.NoError(l.T, err) @@ -98,15 +99,159 @@ func (l *TestLightClient) SetupTest() *TestLightClient { return l } +func (l *TestLightClient) SetupTestAltair() *TestLightClient { + ctx := context.Background() + + slot := primitives.Slot(params.BeaconConfig().AltairForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + attestedState, err := NewBeaconStateAltair() + require.NoError(l.T, err) + err = attestedState.SetSlot(slot) + require.NoError(l.T, err) + + parent := NewBeaconBlockAltair() + parent.Block.Slot = slot + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + parentHeader, err := signedParent.Header() + require.NoError(l.T, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(l.T, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + state, err := NewBeaconStateAltair() + require.NoError(l.T, err) + err = state.SetSlot(slot) + require.NoError(l.T, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(l.T, err) + + block := NewBeaconBlockAltair() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + l.State = state + l.AttestedState = attestedState + l.AttestedHeader = attestedHeader + l.Block = signedBlock + l.Ctx = ctx + + return l +} + +func (l *TestLightClient) SetupTestDeneb() *TestLightClient { + ctx := context.Background() + + slot := primitives.Slot(params.BeaconConfig().DenebForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + attestedState, err := NewBeaconStateDeneb() + require.NoError(l.T, err) + err = attestedState.SetSlot(slot) + require.NoError(l.T, err) + + parent := NewBeaconBlockDeneb() + parent.Block.Slot = slot + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + parentHeader, err := signedParent.Header() + require.NoError(l.T, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(l.T, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + state, err := NewBeaconStateDeneb() + require.NoError(l.T, err) + err = state.SetSlot(slot) + require.NoError(l.T, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(l.T, err) + + block := NewBeaconBlockDeneb() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err := blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + l.State = state + l.AttestedState = attestedState + l.AttestedHeader = attestedHeader + l.Block = signedBlock + l.Ctx = ctx + + return l +} + func (l *TestLightClient) CheckAttestedHeader(update *ethpbv2.LightClientUpdate) { - require.Equal(l.T, l.AttestedHeader.Slot, update.AttestedHeader.Beacon.Slot, "Attested header slot is not equal") - require.Equal(l.T, l.AttestedHeader.ProposerIndex, update.AttestedHeader.Beacon.ProposerIndex, "Attested header proposer index is not equal") - require.DeepSSZEqual(l.T, l.AttestedHeader.ParentRoot, update.AttestedHeader.Beacon.ParentRoot, "Attested header parent root is not equal") - require.DeepSSZEqual(l.T, l.AttestedHeader.BodyRoot, update.AttestedHeader.Beacon.BodyRoot, "Attested header body root is not equal") + updateAttestedHeaderBeacon, err := update.AttestedHeader.GetBeacon() + require.NoError(l.T, err) + require.Equal(l.T, l.AttestedHeader.Slot, updateAttestedHeaderBeacon.Slot, "Attested header slot is not equal") + require.Equal(l.T, l.AttestedHeader.ProposerIndex, updateAttestedHeaderBeacon.ProposerIndex, "Attested header proposer index is not equal") + require.DeepSSZEqual(l.T, l.AttestedHeader.ParentRoot, updateAttestedHeaderBeacon.ParentRoot, "Attested header parent root is not equal") + require.DeepSSZEqual(l.T, l.AttestedHeader.BodyRoot, updateAttestedHeaderBeacon.BodyRoot, "Attested header body root is not equal") attestedStateRoot, err := l.AttestedState.HashTreeRoot(l.Ctx) require.NoError(l.T, err) - require.DeepSSZEqual(l.T, attestedStateRoot[:], update.AttestedHeader.Beacon.StateRoot, "Attested header state root is not equal") + require.DeepSSZEqual(l.T, attestedStateRoot[:], updateAttestedHeaderBeacon.StateRoot, "Attested header state root is not equal") } func (l *TestLightClient) CheckSyncAggregate(update *ethpbv2.LightClientUpdate) { From 62b8e63a0acc1e8ac31321fc25e6d6055fb1aecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 6 Sep 2024 15:39:33 -0400 Subject: [PATCH 282/325] Compare with nil before invoking `IsNil()` on an interface (#14431) * Compare with nil before invoking `IsNil()` on an interface * changelog * review --- CHANGELOG.md | 1 + beacon-chain/blockchain/execution_engine.go | 2 +- beacon-chain/blockchain/pow_block.go | 2 +- beacon-chain/execution/engine_client.go | 2 +- beacon-chain/execution/payload_body.go | 2 +- .../rpc/prysm/v1alpha1/validator/proposer_bellatrix.go | 8 ++++---- beacon-chain/rpc/prysm/v1alpha1/validator/status.go | 7 ++----- beacon-chain/sync/validate_beacon_blocks.go | 2 +- consensus-types/blocks/getters.go | 2 +- testing/endtoend/evaluators/validator.go | 4 ++-- 10 files changed, 15 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d48ebdb7fca..c467c7d8fb4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - E2E: fixed gas limit at genesis - Light client support: use LightClientHeader instead of BeaconBlockHeader. - Core: Fix process effective balance update to safe copy validator for Electra. +- `== nil` checks before calling `IsNil()` on interfaces to prevent panics. ### Security diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 8cfcb385fdb7..387bc552e9cc 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -39,7 +39,7 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *fcuConfig) (* ctx, span := trace.StartSpan(ctx, "blockChain.notifyForkchoiceUpdate") defer span.End() - if arg.headBlock.IsNil() { + if arg.headBlock == nil || arg.headBlock.IsNil() { log.Error("Head block is nil") return nil, nil } diff --git a/beacon-chain/blockchain/pow_block.go b/beacon-chain/blockchain/pow_block.go index 00f929d3c19f..3018d31d413d 100644 --- a/beacon-chain/blockchain/pow_block.go +++ b/beacon-chain/blockchain/pow_block.go @@ -46,7 +46,7 @@ func (s *Service) validateMergeBlock(ctx context.Context, b interfaces.ReadOnlyS if err != nil { return err } - if payload.IsNil() { + if payload == nil || payload.IsNil() { return errors.New("nil execution payload") } ok, err := canUseValidatedTerminalBlockHash(b.Block().Slot(), payload) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 12fdd0393b98..ae069440f96d 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -526,7 +526,7 @@ func (s *Service) ReconstructFullBellatrixBlockBatch( func fullPayloadFromPayloadBody( header interfaces.ExecutionData, body *pb.ExecutionPayloadBody, bVersion int, ) (interfaces.ExecutionData, error) { - if header.IsNil() || body == nil { + if header == nil || header.IsNil() || body == nil { return nil, errors.New("execution block and header cannot be nil") } diff --git a/beacon-chain/execution/payload_body.go b/beacon-chain/execution/payload_body.go index a895044319f4..763cfd214501 100644 --- a/beacon-chain/execution/payload_body.go +++ b/beacon-chain/execution/payload_body.go @@ -67,7 +67,7 @@ func (r *blindedBlockReconstructor) addToBatch(b interfaces.ReadOnlySignedBeacon if err != nil { return err } - if header.IsNil() { + if header == nil || header.IsNil() { return errors.New("execution payload header in blinded block was nil") } r.orderedBlocks = append(r.orderedBlocks, &blockWithHeader{block: b, header: header}) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 23379cb2e000..8f8a95fea6ea 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -198,7 +198,7 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv if err != nil { return nil, err } - if signedBid.IsNil() { + if signedBid == nil || signedBid.IsNil() { return nil, errors.New("builder returned nil bid") } fork, err := forks.Fork(slots.ToEpoch(slot)) @@ -217,7 +217,7 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv if err != nil { return nil, errors.Wrap(err, "could not get bid") } - if bid.IsNil() { + if bid == nil || bid.IsNil() { return nil, errors.New("builder returned nil bid") } @@ -309,14 +309,14 @@ func validateBuilderSignature(signedBid builder.SignedBid) error { if err != nil { return err } - if signedBid.IsNil() { + if signedBid == nil || signedBid.IsNil() { return errors.New("nil builder bid") } bid, err := signedBid.Message() if err != nil { return errors.Wrap(err, "could not get bid") } - if bid.IsNil() { + if bid == nil || bid.IsNil() { return errors.New("builder returned nil bid") } return signing.VerifySigningRoot(bid, bid.Pubkey(), signedBid.Signature(), d) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go index 67a5799d65c7..6382fac75bf6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go @@ -402,16 +402,13 @@ func statusForPubKey(headState state.ReadOnlyBeaconState, pubKey []byte) (ethpb. func assignmentStatus(beaconState state.ReadOnlyBeaconState, validatorIndex primitives.ValidatorIndex) ethpb.ValidatorStatus { validator, err := beaconState.ValidatorAtIndexReadOnly(validatorIndex) - if err != nil { + if err != nil || validator.IsNil() { return ethpb.ValidatorStatus_UNKNOWN_STATUS } + currentEpoch := time.CurrentEpoch(beaconState) farFutureEpoch := params.BeaconConfig().FarFutureEpoch validatorBalance := validator.EffectiveBalance() - - if validator.IsNil() { - return ethpb.ValidatorStatus_UNKNOWN_STATUS - } if currentEpoch < validator.ActivationEligibilityEpoch() { return depositStatus(validatorBalance) } diff --git a/beacon-chain/sync/validate_beacon_blocks.go b/beacon-chain/sync/validate_beacon_blocks.go index 302107cbeb52..c12407e926f4 100644 --- a/beacon-chain/sync/validate_beacon_blocks.go +++ b/beacon-chain/sync/validate_beacon_blocks.go @@ -345,7 +345,7 @@ func (s *Service) validateBellatrixBeaconBlock(ctx context.Context, parentState if err != nil { return err } - if payload.IsNil() { + if payload == nil || payload.IsNil() { return errors.New("execution payload is nil") } if payload.Timestamp() != uint64(t.Unix()) { diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 410e53317d6b..eda1a420017d 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -276,7 +276,7 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e } func (b *SignedBeaconBlock) Unblind(e interfaces.ExecutionData) error { - if e.IsNil() { + if e == nil || e.IsNil() { return errors.New("cannot unblind with nil execution data") } if !b.IsBlinded() { diff --git a/testing/endtoend/evaluators/validator.go b/testing/endtoend/evaluators/validator.go index 02137d366d7a..e4c5c20b2422 100644 --- a/testing/endtoend/evaluators/validator.go +++ b/testing/endtoend/evaluators/validator.go @@ -233,7 +233,7 @@ func validatorsSyncParticipation(_ *types.EvaluationContext, conns ...*grpc.Clie return errors.Wrapf(err, "block type doesn't exist for block at epoch %d", lowestBound) } - if b.IsNil() { + if b == nil || b.IsNil() { return errors.New("nil block provided") } forkStartSlot, err := slots.EpochStart(params.BeaconConfig().AltairForkEpoch) @@ -274,7 +274,7 @@ func validatorsSyncParticipation(_ *types.EvaluationContext, conns ...*grpc.Clie return errors.Wrapf(err, "block type doesn't exist for block at epoch %d", lowestBound) } - if b.IsNil() { + if b == nil || b.IsNil() { return errors.New("nil block provided") } forkSlot, err := slots.EpochStart(params.BeaconConfig().AltairForkEpoch) From 4c14bd8be29c2ae42ed5a848c836661b267fb998 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:30:41 -0500 Subject: [PATCH 283/325] looking at ways to reduce validator registration calls (#14371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * looking at ways to reduce validator registration calls * small mistake, should be epoch start * adding more optimizations for reducing registration calls while covering more edgecases * linting * adding change log and force full push override * fixing bug and adding tests * changing if statement just to be safe * potuz feedback for easier readability * more review feedback for simplicity * more review suggestions from potuz * fix unit test * reduce redundancy * Update CHANGELOG.md Co-authored-by: Radosław Kapka * small nitpick * fixing typo * updating logs --------- Co-authored-by: Radosław Kapka --- CHANGELOG.md | 1 + api/client/builder/client.go | 6 +- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- validator/accounts/testing/mock.go | 4 +- validator/client/BUILD.bazel | 2 - validator/client/iface/validator.go | 4 +- validator/client/key_reload.go | 22 +- validator/client/key_reload_test.go | 3 + validator/client/registration.go | 8 +- validator/client/registration_test.go | 11 +- validator/client/runner.go | 6 +- validator/client/service.go | 2 +- validator/client/testutil/mock_validator.go | 6 +- validator/client/validator.go | 157 ++++--- validator/client/validator_test.go | 432 ++++++++++++++---- validator/client/wait_for_activation.go | 7 +- validator/client/wait_for_activation_test.go | 9 + 17 files changed, 456 insertions(+), 226 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c467c7d8fb4b..42fad7ce6f67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Electra: build blocks with blobs. - E2E: fixed gas limit at genesis - Light client support: use LightClientHeader instead of BeaconBlockHeader. +- validator registration log changed to debug, and the frequency of validator registration calls are reduced - Core: Fix process effective balance update to safe copy validator for Electra. - `== nil` checks before calling `IsNil()` on interfaces to prevent panics. diff --git a/api/client/builder/client.go b/api/client/builder/client.go index a6554c6eb9fb..6e2f52eeaa2a 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -278,7 +278,11 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid } _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body)) - return err + if err != nil { + return err + } + log.WithField("num_registrations", len(svr)).Info("successfully registered validator(s) on builder") + return nil } var errResponseVersionMismatch = errors.New("builder API response uses a different version than requested in " + api.VersionHeader + " header") diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 15111c24cdcc..660e26dd9add 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -429,7 +429,7 @@ func (vs *Server) PrepareBeaconProposer( if len(validatorIndices) != 0 { log.WithFields(logrus.Fields{ "validatorCount": len(validatorIndices), - }).Info("Updated fee recipient addresses for validator indices") + }).Debug("Updated fee recipient addresses for validator indices") } return &emptypb.Empty{}, nil } diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index e98a0592a12a..a95d5b77e6c7 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -204,7 +204,7 @@ func (*Validator) HasProposerSettings() bool { } // PushProposerSettings for mocking -func (_ *Validator) PushProposerSettings(_ context.Context, _ keymanager.IKeymanager, _ primitives.Slot) error { +func (_ *Validator) PushProposerSettings(_ context.Context, _ keymanager.IKeymanager, _ primitives.Slot, _ bool) error { panic("implement me") } @@ -214,7 +214,7 @@ func (_ *Validator) SetPubKeyToValidatorIndexMap(_ context.Context, _ keymanager } // SignValidatorRegistrationRequest for mocking -func (_ *Validator) SignValidatorRegistrationRequest(_ context.Context, _ iface2.SigningFunc, _ *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error) { +func (_ *Validator) SignValidatorRegistrationRequest(_ context.Context, _ iface2.SigningFunc, _ *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, bool, error) { panic("implement me") } diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index 28c9e410cf52..5f188018472c 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -175,9 +175,7 @@ go_test( "@com_github_wealdtech_go_eth2_util//:go_default_library", "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", - "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", - "@org_golang_google_grpc//status:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", "@org_uber_go_mock//gomock:go_default_library", ], diff --git a/validator/client/iface/validator.go b/validator/client/iface/validator.go index 647ef06a2faa..354e92a5bf4e 100644 --- a/validator/client/iface/validator.go +++ b/validator/client/iface/validator.go @@ -57,8 +57,8 @@ type Validator interface { Keymanager() (keymanager.IKeymanager, error) HandleKeyReload(ctx context.Context, currentKeys [][fieldparams.BLSPubkeyLength]byte) (bool, error) CheckDoppelGanger(ctx context.Context) error - PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot) error - SignValidatorRegistrationRequest(ctx context.Context, signer SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error) + PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, forceFullPush bool) error + SignValidatorRegistrationRequest(ctx context.Context, signer SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, bool /* isCached */, error) StartEventStream(ctx context.Context, topics []string, eventsChan chan<- *event.Event) EventStreamIsRunning() bool ProcessEvent(event *event.Event) diff --git a/validator/client/key_reload.go b/validator/client/key_reload.go index 99250bb2a370..8f2c3f8cb2a2 100644 --- a/validator/client/key_reload.go +++ b/validator/client/key_reload.go @@ -7,34 +7,18 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" - eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" ) // HandleKeyReload makes sure the validator keeps operating correctly after a change to the underlying keys. // It is also responsible for logging out information about the new state of keys. -func (v *validator) HandleKeyReload(ctx context.Context, currentKeys [][fieldparams.BLSPubkeyLength]byte) (anyActive bool, err error) { +func (v *validator) HandleKeyReload(ctx context.Context, currentKeys [][fieldparams.BLSPubkeyLength]byte) (bool, error) { ctx, span := trace.StartSpan(ctx, "validator.HandleKeyReload") defer span.End() - statusRequestKeys := make([][]byte, len(currentKeys)) - for i := range currentKeys { - statusRequestKeys[i] = currentKeys[i][:] - } - resp, err := v.validatorClient.MultipleValidatorStatus(ctx, ð.MultipleValidatorStatusRequest{ - PublicKeys: statusRequestKeys, - }) - if err != nil { + if err := v.updateValidatorStatusCache(ctx, currentKeys); err != nil { return false, err } - statuses := make([]*validatorStatus, len(resp.Statuses)) - for i, s := range resp.Statuses { - statuses[i] = &validatorStatus{ - publicKey: resp.PublicKeys[i], - status: s, - index: resp.Indices[i], - } - } // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 @@ -47,5 +31,5 @@ func (v *validator) HandleKeyReload(ctx context.Context, currentKeys [][fieldpar valCount = int64(valCounts[0].Count) } - return v.checkAndLogValidatorStatus(statuses, valCount), nil + return v.checkAndLogValidatorStatus(valCount), nil } diff --git a/validator/client/key_reload_test.go b/validator/client/key_reload_test.go index df8e0435e1a0..41fb4d2466cb 100644 --- a/validator/client/key_reload_test.go +++ b/validator/client/key_reload_test.go @@ -36,6 +36,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { genesisTime: 1, chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), } resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{inactive.pub[:], active.pub[:]}) @@ -73,6 +74,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { genesisTime: 1, chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), } resp := testutil.GenerateMultipleValidatorStatusResponse([][]byte{kp.pub[:]}) @@ -103,6 +105,7 @@ func TestValidator_HandleKeyReload(t *testing.T) { validatorClient: client, km: newMockKeymanager(t, kp), genesisTime: 1, + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), } client.EXPECT().MultipleValidatorStatus( diff --git a/validator/client/registration.go b/validator/client/registration.go index fb54d27eb1bc..63904183a4e4 100644 --- a/validator/client/registration.go +++ b/validator/client/registration.go @@ -93,24 +93,24 @@ func signValidatorRegistration(ctx context.Context, signer iface.SigningFunc, re } // SignValidatorRegistrationRequest compares and returns either the cached validator registration request or signs a new one. -func (v *validator) SignValidatorRegistrationRequest(ctx context.Context, signer iface.SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error) { +func (v *validator) SignValidatorRegistrationRequest(ctx context.Context, signer iface.SigningFunc, newValidatorRegistration *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, bool /* isCached */, error) { ctx, span := trace.StartSpan(ctx, "validator.SignValidatorRegistrationRequest") defer span.End() signedReg, ok := v.signedValidatorRegistrations[bytesutil.ToBytes48(newValidatorRegistration.Pubkey)] if ok && isValidatorRegistrationSame(signedReg.Message, newValidatorRegistration) { - return signedReg, nil + return signedReg, true, nil } else { sig, err := signValidatorRegistration(ctx, signer, newValidatorRegistration) if err != nil { - return nil, err + return nil, false, err } newRequest := ðpb.SignedValidatorRegistrationV1{ Message: newValidatorRegistration, Signature: sig, } v.signedValidatorRegistrations[bytesutil.ToBytes48(newValidatorRegistration.Pubkey)] = newRequest - return newRequest, nil + return newRequest, false, nil } } diff --git a/validator/client/registration_test.go b/validator/client/registration_test.go index f8c77b22494e..bd954317d202 100644 --- a/validator/client/registration_test.go +++ b/validator/client/registration_test.go @@ -10,7 +10,6 @@ import ( "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -172,7 +171,7 @@ func TestValidator_SignValidatorRegistrationRequest(t *testing.T) { }, validatorSetter: func(t *testing.T) *validator { v := validator{ - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, genesisTime: 0, @@ -200,7 +199,7 @@ func TestValidator_SignValidatorRegistrationRequest(t *testing.T) { }, validatorSetter: func(t *testing.T) *validator { v := validator{ - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, genesisTime: 0, @@ -228,7 +227,7 @@ func TestValidator_SignValidatorRegistrationRequest(t *testing.T) { }, validatorSetter: func(t *testing.T) *validator { v := validator{ - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, genesisTime: 0, @@ -256,7 +255,7 @@ func TestValidator_SignValidatorRegistrationRequest(t *testing.T) { }, validatorSetter: func(t *testing.T) *validator { v := validator{ - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, genesisTime: 0, @@ -272,7 +271,7 @@ func TestValidator_SignValidatorRegistrationRequest(t *testing.T) { startingReq, ok := v.signedValidatorRegistrations[bytesutil.ToBytes48(tt.arg.Pubkey)] - got, err := v.SignValidatorRegistrationRequest(ctx, m.signfunc, tt.arg) + got, _, err := v.SignValidatorRegistrationRequest(ctx, m.signfunc, tt.arg) require.NoError(t, err) if tt.isCached { require.DeepEqual(t, got, v.signedValidatorRegistrations[bytesutil.ToBytes48(tt.arg.Pubkey)]) diff --git a/validator/client/runner.go b/validator/client/runner.go index 1f42363116a7..7839c795e2f4 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -62,7 +62,7 @@ func run(ctx context.Context, v iface.Validator) { log.Warn("Validator client started without proposer settings such as fee recipient" + " and will continue to use settings provided in the beacon node.") } - if err := v.PushProposerSettings(ctx, km, headSlot); err != nil { + if err := v.PushProposerSettings(ctx, km, headSlot, true); err != nil { log.WithError(err).Fatal("Failed to update proposer settings") } for { @@ -97,7 +97,7 @@ func run(ctx context.Context, v iface.Validator) { // call push proposer settings often to account for the following edge cases: // proposer is activated at the start of epoch and tries to propose immediately // account has changed in the middle of an epoch - if err := v.PushProposerSettings(ctx, km, slot); err != nil { + if err := v.PushProposerSettings(ctx, km, slot, false); err != nil { log.WithError(err).Warn("Failed to update proposer settings") } @@ -316,7 +316,7 @@ func runHealthCheckRoutine(ctx context.Context, v iface.Validator, eventsChan ch log.WithError(err).Error("Could not get canonical head slot") return } - if err := v.PushProposerSettings(ctx, km, slot); err != nil { + if err := v.PushProposerSettings(ctx, km, slot, true); err != nil { log.WithError(err).Warn("Failed to update proposer settings") } } diff --git a/validator/client/service.go b/validator/client/service.go index 31c039cf5219..0997ea4b98f0 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -184,7 +184,7 @@ func (v *ValidatorService) Start() { startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), prevEpochBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), blacklistedPubkeys: slashablePublicKeys, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), wallet: v.wallet, walletInitializedChan: make(chan *wallet.Wallet, 1), walletInitializedFeed: v.walletInitializedFeed, diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index 0e462c1c6203..e6a48d5b91c5 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -254,7 +254,7 @@ func (*FakeValidator) HasProposerSettings() bool { } // PushProposerSettings for mocking -func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, _ primitives.Slot) error { +func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, _ primitives.Slot, _ bool) error { time.Sleep(fv.ProposerSettingWait) if errors.Is(ctx.Err(), context.DeadlineExceeded) { log.Error("deadline exceeded") @@ -276,8 +276,8 @@ func (*FakeValidator) SetPubKeyToValidatorIndexMap(_ context.Context, _ keymanag } // SignValidatorRegistrationRequest for mocking -func (*FakeValidator) SignValidatorRegistrationRequest(_ context.Context, _ iface.SigningFunc, _ *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, error) { - return nil, nil +func (*FakeValidator) SignValidatorRegistrationRequest(_ context.Context, _ iface.SigningFunc, _ *ethpb.ValidatorRegistrationV1) (*ethpb.SignedValidatorRegistrationV1, bool, error) { + return nil, false, nil } // ProposerSettings for mocking diff --git a/validator/client/validator.go b/validator/client/validator.go index 5b9f99ec270b..d6eca9ae6fee 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -40,7 +40,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" accountsiface "github.com/prysmaticlabs/prysm/v5/validator/accounts/iface" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" - beaconapi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/db" dbCommon "github.com/prysmaticlabs/prysm/v5/validator/db/common" @@ -49,9 +48,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/keymanager/local" remoteweb3signer "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer" "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/emptypb" ) @@ -77,7 +74,7 @@ type validator struct { startBalances map[[fieldparams.BLSPubkeyLength]byte]uint64 prevEpochBalances map[[fieldparams.BLSPubkeyLength]byte]uint64 blacklistedPubkeys map[[fieldparams.BLSPubkeyLength]byte]bool - pubkeyToValidatorIndex map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex + pubkeyToStatus map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus wallet *wallet.Wallet walletInitializedChan chan *wallet.Wallet walletInitializedFeed *event.Feed @@ -352,10 +349,10 @@ func (v *validator) WaitForSync(ctx context.Context) error { } } -func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, activeValCount int64) bool { +func (v *validator) checkAndLogValidatorStatus(activeValCount int64) bool { nonexistentIndex := primitives.ValidatorIndex(^uint64(0)) var validatorActivated bool - for _, s := range statuses { + for _, s := range v.pubkeyToStatus { fields := logrus.Fields{ "pubkey": fmt.Sprintf("%#x", bytesutil.Trunc(s.publicKey)), "status": s.status.Status.String(), @@ -1102,7 +1099,7 @@ func (v *validator) SetProposerSettings(ctx context.Context, settings *proposer. } // PushProposerSettings calls the prepareBeaconProposer RPC to set the fee recipient and also the register validator API if using a custom builder. -func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot) error { +func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, forceFullPush bool) error { ctx, span := trace.StartSpan(ctx, "validator.PushProposerSettings") defer span.End() @@ -1143,7 +1140,7 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey }); err != nil { return err } - signedRegReqs := v.buildSignedRegReqs(ctx, filteredKeys, km.Sign) + signedRegReqs := v.buildSignedRegReqs(ctx, filteredKeys, km.Sign, slot, forceFullPush) if len(signedRegReqs) > 0 { go func() { if err := SubmitValidatorRegistrations(ctx, v.validatorClient, signedRegReqs, v.validatorsRegBatchSize); err != nil { @@ -1212,44 +1209,31 @@ func (v *validator) ChangeHost() { func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fieldparams.BLSPubkeyLength]byte, slot primitives.Slot) ([][fieldparams.BLSPubkeyLength]byte, error) { ctx, span := trace.StartSpan(ctx, "validator.filterAndCacheActiveKeys") defer span.End() - + isEpochStart := slots.IsEpochStart(slot) filteredKeys := make([][fieldparams.BLSPubkeyLength]byte, 0) - statusRequestKeys := make([][]byte, 0) - for _, k := range pubkeys { - _, ok := v.pubkeyToValidatorIndex[k] - // Get validator index from RPC server if not found. - if !ok { - i, ok, err := v.validatorIndex(ctx, k) - if err != nil { - return nil, err - } - if !ok { // Nothing we can do if RPC server doesn't have validator index. - continue - } - v.pubkeyToValidatorIndex[k] = i - } - copiedk := k - statusRequestKeys = append(statusRequestKeys, copiedk[:]) + if len(pubkeys) == 0 { + return filteredKeys, nil } - resp, err := v.validatorClient.MultipleValidatorStatus(ctx, ðpb.MultipleValidatorStatusRequest{ - PublicKeys: statusRequestKeys, - }) - if err != nil { - return nil, err + var err error + // repopulate the statuses if epoch start or if a new key is added missing the cache + if isEpochStart || len(v.pubkeyToStatus) != len(pubkeys) /* cache not populated or updated correctly */ { + if err = v.updateValidatorStatusCache(ctx, pubkeys); err != nil { + return nil, errors.Wrap(err, "failed to update validator status cache") + } } - for i, s := range resp.Statuses { + for k, s := range v.pubkeyToStatus { currEpoch := primitives.Epoch(slot / params.BeaconConfig().SlotsPerEpoch) - currActivating := s.Status == ethpb.ValidatorStatus_PENDING && currEpoch >= s.ActivationEpoch + currActivating := s.status.Status == ethpb.ValidatorStatus_PENDING && currEpoch >= s.status.ActivationEpoch - active := s.Status == ethpb.ValidatorStatus_ACTIVE - exiting := s.Status == ethpb.ValidatorStatus_EXITING + active := s.status.Status == ethpb.ValidatorStatus_ACTIVE + exiting := s.status.Status == ethpb.ValidatorStatus_EXITING if currActivating || active || exiting { - filteredKeys = append(filteredKeys, bytesutil.ToBytes48(resp.PublicKeys[i])) + filteredKeys = append(filteredKeys, k) } else { log.WithFields(logrus.Fields{ - "pubkey": hexutil.Encode(resp.PublicKeys[i]), - "status": s.Status.String(), + "pubkey": hexutil.Encode(s.publicKey), + "status": s.status.Status.String(), }).Debugf("Skipping non-active status key.") } } @@ -1257,11 +1241,47 @@ func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fie return filteredKeys, nil } +// updateValidatorStatusCache updates the validator statuses cache, a map of keys currently used by the validator client +func (v *validator) updateValidatorStatusCache(ctx context.Context, pubkeys [][fieldparams.BLSPubkeyLength]byte) error { + statusRequestKeys := make([][]byte, 0) + for _, k := range pubkeys { + statusRequestKeys = append(statusRequestKeys, k[:]) + } + resp, err := v.validatorClient.MultipleValidatorStatus(ctx, ðpb.MultipleValidatorStatusRequest{ + PublicKeys: statusRequestKeys, + }) + if err != nil { + return err + } + if resp == nil { + return errors.New("response is nil") + } + if len(resp.Statuses) != len(resp.PublicKeys) { + return fmt.Errorf("expected %d pubkeys in status, received %d", len(resp.Statuses), len(resp.PublicKeys)) + } + if len(resp.Statuses) != len(resp.Indices) { + return fmt.Errorf("expected %d indices in status, received %d", len(resp.Statuses), len(resp.Indices)) + } + for i, s := range resp.Statuses { + v.pubkeyToStatus[bytesutil.ToBytes48(resp.PublicKeys[i])] = &validatorStatus{ + publicKey: resp.PublicKeys[i], + status: s, + index: resp.Indices[i], + } + } + return nil +} + func (v *validator) buildPrepProposerReqs(activePubkeys [][fieldparams.BLSPubkeyLength]byte) ([]*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer, error) { var prepareProposerReqs []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer for _, k := range activePubkeys { + s, ok := v.pubkeyToStatus[k] + if !ok { + continue + } + // Default case: Define fee recipient to burn address - var feeRecipient common.Address + feeRecipient := common.HexToAddress(params.BeaconConfig().EthBurnAddressHex) // If fee recipient is defined in default configuration, use it if v.ProposerSettings() != nil && v.ProposerSettings().DefaultConfig != nil && v.ProposerSettings().DefaultConfig.FeeRecipientConfig != nil { @@ -1277,13 +1297,8 @@ func (v *validator) buildPrepProposerReqs(activePubkeys [][fieldparams.BLSPubkey } } - validatorIndex, ok := v.pubkeyToValidatorIndex[k] - if !ok { - continue - } - prepareProposerReqs = append(prepareProposerReqs, ðpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ - ValidatorIndex: validatorIndex, + ValidatorIndex: s.index, FeeRecipient: feeRecipient[:], }) } @@ -1294,19 +1309,27 @@ func (v *validator) buildSignedRegReqs( ctx context.Context, activePubkeys [][fieldparams.BLSPubkeyLength]byte, signer iface.SigningFunc, + slot primitives.Slot, + forceFullPush bool, ) []*ethpb.SignedValidatorRegistrationV1 { ctx, span := trace.StartSpan(ctx, "validator.buildSignedRegReqs") defer span.End() - var signedValRegRegs []*ethpb.SignedValidatorRegistrationV1 + var signedValRegRequests []*ethpb.SignedValidatorRegistrationV1 if v.ProposerSettings() == nil { - return signedValRegRegs + return signedValRegRequests } // if the timestamp is pre-genesis, don't create registrations if v.genesisTime > uint64(time.Now().UTC().Unix()) { - return signedValRegRegs + return signedValRegRequests } for i, k := range activePubkeys { + // map is populated before this function in buildPrepProposerReq + _, ok := v.pubkeyToStatus[k] + if !ok { + continue + } + feeRecipient := common.HexToAddress(params.BeaconConfig().EthBurnAddressHex) gasLimit := params.BeaconConfig().DefaultBuilderGasLimit enabled := false @@ -1346,12 +1369,6 @@ func (v *validator) buildSignedRegReqs( continue } - // map is populated before this function in buildPrepProposerReq - _, ok := v.pubkeyToValidatorIndex[k] - if !ok { - continue - } - req := ðpb.ValidatorRegistrationV1{ FeeRecipient: feeRecipient[:], GasLimit: gasLimit, @@ -1359,7 +1376,7 @@ func (v *validator) buildSignedRegReqs( Pubkey: activePubkeys[i][:], } - signedReq, err := v.SignValidatorRegistrationRequest(ctx, signer, req) + signedRequest, isCached, err := v.SignValidatorRegistrationRequest(ctx, signer, req) if err != nil { log.WithFields(logrus.Fields{ "pubkey": fmt.Sprintf("%#x", req.Pubkey), @@ -1368,38 +1385,20 @@ func (v *validator) buildSignedRegReqs( continue } - signedValRegRegs = append(signedValRegRegs, signedReq) - if hexutil.Encode(feeRecipient.Bytes()) == params.BeaconConfig().EthBurnAddressHex { log.WithFields(logrus.Fields{ "pubkey": fmt.Sprintf("%#x", req.Pubkey), "feeRecipient": feeRecipient, }).Warn("Fee recipient is burn address") } - } - return signedValRegRegs -} -func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSPubkeyLength]byte) (primitives.ValidatorIndex, bool, error) { - ctx, span := trace.StartSpan(ctx, "validator.validatorIndex") - defer span.End() - - resp, err := v.validatorClient.ValidatorIndex(ctx, ðpb.ValidatorIndexRequest{PublicKey: pubkey[:]}) - switch { - case status.Code(err) == codes.NotFound: - log.Debugf("Could not find validator index for public key %#x. "+ - "Perhaps the validator is not yet active.", pubkey) - return 0, false, nil - case err != nil: - notFoundErr := &beaconapi.IndexNotFoundError{} - if errors.As(err, ¬FoundErr) { - log.Debugf("Could not find validator index for public key %#x. "+ - "Perhaps the validator is not yet active.", pubkey) - return 0, false, nil - } - return 0, false, err - } - return resp.Index, true, nil + if slots.IsEpochStart(slot) || forceFullPush || !isCached { + // if epoch start (or forced to) send all validator registrations + // otherwise if slot is not epoch start then only send new non cached values + signedValRegRequests = append(signedValRegRequests, signedRequest) + } + } + return signedValRegRequests } func (v *validator) aggregatedSelectionProofs(ctx context.Context, duties *ethpb.DutiesResponse) error { diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 2d9eca2ff3e9..679a2add8425 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -9,6 +9,7 @@ import ( "math" "os" "path/filepath" + "sort" "strings" "sync" "testing" @@ -45,8 +46,6 @@ import ( logTest "github.com/sirupsen/logrus/hooks/test" "github.com/urfave/cli/v2" "go.uber.org/mock/gomock" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" ) @@ -59,6 +58,8 @@ var _ iface.Validator = (*validator)(nil) const cancelledCtx = "context has been canceled" +var unknownIndex = primitives.ValidatorIndex(^uint64(0)) + func genMockKeymanager(t *testing.T, numKeys int) *mockKeymanager { pairs := make([]keypair, numKeys) for i := 0; i < numKeys; i++ { @@ -354,6 +355,7 @@ func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) { km: newMockKeymanager(t, kp), chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) @@ -937,9 +939,10 @@ func TestCheckAndLogValidatorStatus_OK(t *testing.T) { }, }, }, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } - - active := v.checkAndLogValidatorStatus([]*validatorStatus{test.status}, 100) + v.pubkeyToStatus[bytesutil.ToBytes48(test.status.publicKey)] = test.status + active := v.checkAndLogValidatorStatus(100) require.Equal(t, test.active, active) if test.log != "" { require.LogsContain(t, hook, test.log) @@ -1489,7 +1492,7 @@ func TestValidator_PushSettings(t *testing.T) { validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1504,14 +1507,23 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) - v.pubkeyToValidatorIndex[keys[1]] = primitives.ValidatorIndex(2) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } + v.pubkeyToStatus[keys[1]] = &validatorStatus{ + publicKey: keys[1][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(2), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:], keys[1][:]}, + Indices: []primitives.ValidatorIndex{1, 2}, }, nil) client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ @@ -1571,7 +1583,7 @@ func TestValidator_PushSettings(t *testing.T) { validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1586,14 +1598,23 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) - v.pubkeyToValidatorIndex[keys[1]] = primitives.ValidatorIndex(2) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } + v.pubkeyToStatus[keys[1]] = &validatorStatus{ + publicKey: keys[1][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(2), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:], keys[1][:]}, + Indices: []primitives.ValidatorIndex{1, 2}, }, nil) client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ @@ -1644,12 +1665,11 @@ func TestValidator_PushSettings(t *testing.T) { { name: " Happy Path default doesn't send any validator registrations", validatorSetter: func(t *testing.T) *validator { - v := validator{ validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1664,14 +1684,23 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) - v.pubkeyToValidatorIndex[keys[1]] = primitives.ValidatorIndex(2) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } + v.pubkeyToStatus[keys[1]] = &validatorStatus{ + publicKey: keys[1][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(2), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:], keys[1][:]}, + Indices: []primitives.ValidatorIndex{1, 2}, }, nil) client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ @@ -1710,7 +1739,7 @@ func TestValidator_PushSettings(t *testing.T) { validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1740,13 +1769,18 @@ func TestValidator_PushSettings(t *testing.T) { }, }) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:]}, + Indices: []primitives.ValidatorIndex{1}, }, nil) client.EXPECT().SubmitValidatorRegistrations( @@ -1778,7 +1812,7 @@ func TestValidator_PushSettings(t *testing.T) { validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1805,13 +1839,18 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:]}, + Indices: []primitives.ValidatorIndex{1}, }, nil) client.EXPECT().SubmitValidatorRegistrations( gomock.Any(), @@ -1842,7 +1881,7 @@ func TestValidator_PushSettings(t *testing.T) { validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1857,13 +1896,18 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:]}, + Indices: []primitives.ValidatorIndex{1}, }, nil) client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ @@ -1894,7 +1938,7 @@ func TestValidator_PushSettings(t *testing.T) { v := validator{ validatorClient: client, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1909,15 +1953,19 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - client.EXPECT().ValidatorIndex( - gomock.Any(), // ctx - ðpb.ValidatorIndexRequest{PublicKey: keys[0][:]}, - ).Return(nil, errors.New("could not find validator index for public key")) config[keys[0]] = &proposer.Option{ FeeRecipientConfig: &proposer.FeeRecipientConfig{ FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455043BFEBf6177F1D2e9738D9"), }, } + client.EXPECT().MultipleValidatorStatus( + gomock.Any(), + gomock.Any()).Return( + ðpb.MultipleValidatorStatusResponse{ + Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_UNKNOWN_STATUS}}, + PublicKeys: [][]byte{keys[0][:]}, + Indices: []primitives.ValidatorIndex{unknownIndex}, + }, nil) err = v.SetProposerSettings(context.Background(), &proposer.Settings{ ProposeConfig: config, DefaultConfig: &proposer.Option{ @@ -1937,7 +1985,7 @@ func TestValidator_PushSettings(t *testing.T) { validatorClient: client, nodeClient: nodeClient, db: db, - pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus), signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1), useWeb: false, interopKeysConfig: &local.InteropKeymanagerConfig{ @@ -1952,13 +2000,18 @@ func TestValidator_PushSettings(t *testing.T) { require.NoError(t, err) keys, err := km.FetchValidatingPublicKeys(ctx) require.NoError(t, err) - v.pubkeyToValidatorIndex[keys[0]] = primitives.ValidatorIndex(1) + v.pubkeyToStatus[keys[0]] = &validatorStatus{ + publicKey: keys[0][:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: primitives.ValidatorIndex(1), + } client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}}, PublicKeys: [][]byte{keys[0][:]}, + Indices: []primitives.ValidatorIndex{1}, }, nil) config[keys[0]] = &proposer.Option{ @@ -2009,7 +2062,7 @@ func TestValidator_PushSettings(t *testing.T) { if tt.feeRecipientMap != nil { feeRecipients, err := v.buildPrepProposerReqs(pubkeys) require.NoError(t, err) - signedRegisterValidatorRequests := v.buildSignedRegReqs(ctx, pubkeys, km.Sign) + signedRegisterValidatorRequests := v.buildSignedRegReqs(ctx, pubkeys, km.Sign, 0, false) for _, recipient := range feeRecipients { require.Equal(t, strings.ToLower(tt.feeRecipientMap[recipient.ValidatorIndex]), strings.ToLower(hexutil.Encode(recipient.FeeRecipient))) } @@ -2027,7 +2080,7 @@ func TestValidator_PushSettings(t *testing.T) { require.Equal(t, len(tt.mockExpectedRequests), len(signedRegisterValidatorRequests)) require.Equal(t, len(signedRegisterValidatorRequests), len(v.signedValidatorRegistrations)) } - if err := v.PushProposerSettings(ctx, km, 0); tt.err != "" { + if err := v.PushProposerSettings(ctx, km, 0, false); tt.err != "" { assert.ErrorContains(t, tt.err, err) } if len(tt.logMessages) > 0 { @@ -2091,28 +2144,14 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { ctx := context.Background() client := validatormock.NewMockValidatorClient(ctrl) - client.EXPECT().ValidatorIndex( - gomock.Any(), - ðpb.ValidatorIndexRequest{ - PublicKey: pubkey2[:], - }, - ).Return(ðpb.ValidatorIndexResponse{ - Index: 2, - }, nil) - - client.EXPECT().ValidatorIndex( - gomock.Any(), - ðpb.ValidatorIndexRequest{ - PublicKey: pubkey3[:], - }, - ).Return(nil, status.Error(codes.NotFound, "NOT_FOUND")) client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).Return( ðpb.MultipleValidatorStatusResponse{ - Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}}, - PublicKeys: [][]byte{pubkey1[:], pubkey2[:], pubkey4[:]}, + Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_UNKNOWN_STATUS}, {Status: ethpb.ValidatorStatus_ACTIVE}}, + PublicKeys: [][]byte{pubkey1[:], pubkey2[:], pubkey3[:], pubkey4[:]}, + Indices: []primitives.ValidatorIndex{1, 2, unknownIndex, 4}, }, nil) v := validator{ validatorClient: client, @@ -2141,9 +2180,17 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { }, }, }, - pubkeyToValidatorIndex: map[[48]byte]primitives.ValidatorIndex{ - pubkey1: 1, - pubkey4: 4, + pubkeyToStatus: map[[48]byte]*validatorStatus{ + pubkey1: { + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + }, + pubkey4: { + publicKey: pubkey4[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 4, + }, }, } @@ -2167,18 +2214,121 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { require.NoError(t, err) actual, err := v.buildPrepProposerReqs(filteredKeys) require.NoError(t, err) + sort.Slice(actual, func(i, j int) bool { + return actual[i].ValidatorIndex < actual[j].ValidatorIndex + }) assert.DeepEqual(t, expected, actual) } +func TestValidator_filterAndCacheActiveKeys(t *testing.T) { + // Public keys + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey4 := pubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") + + t.Run("refetch all keys at start of epoch", func(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ctx := context.Background() + client := validatormock.NewMockValidatorClient(ctrl) + + client.EXPECT().MultipleValidatorStatus( + gomock.Any(), + gomock.Any()).Return( + ðpb.MultipleValidatorStatusResponse{ + Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_UNKNOWN_STATUS}, {Status: ethpb.ValidatorStatus_ACTIVE}}, + PublicKeys: [][]byte{pubkey1[:], pubkey2[:], pubkey3[:], pubkey4[:]}, + Indices: []primitives.ValidatorIndex{1, 2, unknownIndex, 4}, + }, nil) + v := validator{ + validatorClient: client, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), + } + keys, err := v.filterAndCacheActiveKeys(ctx, [][48]byte{pubkey1, pubkey2, pubkey3, pubkey4}, 0) + require.NoError(t, err) + // one key is unknown status + require.Equal(t, 3, len(keys)) + }) + t.Run("refetch all keys at start of epoch, even with cache", func(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ctx := context.Background() + client := validatormock.NewMockValidatorClient(ctrl) + + client.EXPECT().MultipleValidatorStatus( + gomock.Any(), + gomock.Any()).Return( + ðpb.MultipleValidatorStatusResponse{ + Statuses: []*ethpb.ValidatorStatusResponse{{Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_ACTIVE}, {Status: ethpb.ValidatorStatus_UNKNOWN_STATUS}, {Status: ethpb.ValidatorStatus_ACTIVE}}, + PublicKeys: [][]byte{pubkey1[:], pubkey2[:], pubkey3[:], pubkey4[:]}, + Indices: []primitives.ValidatorIndex{1, 2, unknownIndex, 4}, + }, nil) + v := validator{ + validatorClient: client, + pubkeyToStatus: map[[48]byte]*validatorStatus{ + pubkey1: { + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + }, + pubkey2: { + publicKey: pubkey2[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 2, + }, + pubkey3: { + publicKey: pubkey3[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, // gets overridden + index: 3, + }, + pubkey4: { + publicKey: pubkey4[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 4, + }, + }, + } + keys, err := v.filterAndCacheActiveKeys(ctx, [][48]byte{pubkey1, pubkey2, pubkey3, pubkey4}, 0) + require.NoError(t, err) + // one key is unknown status + require.Equal(t, 3, len(keys)) + }) + t.Run("cache used mid epoch, no new keys added", func(t *testing.T) { + ctx := context.Background() + v := validator{ + pubkeyToStatus: map[[48]byte]*validatorStatus{ + pubkey1: { + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + }, + pubkey4: { + publicKey: pubkey4[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 4, + }, + }, + } + keys, err := v.filterAndCacheActiveKeys(ctx, [][48]byte{pubkey1, pubkey4}, 5) + require.NoError(t, err) + // one key is unknown status + require.Equal(t, 2, len(keys)) + }) + +} + func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { - // pubkey1 => feeRecipient1 - Status: active (already in `v.validatorIndex`) - // pubkey2 => feeRecipient2 - Status: active (NOT in `v.validatorIndex`, index found by beacon node) - // pubkey3 => feeRecipient3 - Status: active (NOT in `v.validatorIndex`, index NOT found by beacon node) - // pubkey4 => Nothing - Status: active (already in `v.validatorIndex`) - // pubkey5 => Nothing - Status: unknown (already in `v.validatorIndex`) - // pubkey6 => Nothing - Status: pending (already in `v.validatorIndex`) - ActivationEpoch: 35 (current slot: 641 - current epoch: 20) - // pubkey7 => Nothing - Status: pending (already in `v.validatorIndex`) - ActivationEpoch: 20 (current slot: 641 - current epoch: 20) - // pubkey8 => feeRecipient8 - Status: exiting (already in `v.validatorIndex`) + // pubkey1 => feeRecipient1 - Status: active + // pubkey2 => feeRecipient2 - Status: active + // pubkey3 => feeRecipient3 - Status: unknown + // pubkey4 => Nothing - Status: active + // pubkey5 => Nothing - Status: exited + // pubkey6 => Nothing - Status: pending - ActivationEpoch: 35 (current slot: 641 - current epoch: 20) + // pubkey7 => Nothing - Status: pending - ActivationEpoch: 20 (current slot: 641 - current epoch: 20) + // pubkey8 => feeRecipient8 - Status: exiting // Public keys pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") @@ -2201,9 +2351,9 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { pubkeyToStatus := map[[fieldparams.BLSPubkeyLength]byte]ethpb.ValidatorStatus{ pubkey1: ethpb.ValidatorStatus_ACTIVE, pubkey2: ethpb.ValidatorStatus_ACTIVE, - pubkey3: ethpb.ValidatorStatus_ACTIVE, + pubkey3: ethpb.ValidatorStatus_UNKNOWN_STATUS, pubkey4: ethpb.ValidatorStatus_ACTIVE, - pubkey5: ethpb.ValidatorStatus_UNKNOWN_STATUS, + pubkey5: ethpb.ValidatorStatus_EXITED, pubkey6: ethpb.ValidatorStatus_PENDING, pubkey7: ethpb.ValidatorStatus_PENDING, pubkey8: ethpb.ValidatorStatus_EXITING, @@ -2220,28 +2370,23 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { pubkey8: 0, } + pubkeyToIndex := map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex{ + pubkey1: 1, + pubkey2: 2, + pubkey3: unknownIndex, + pubkey4: 4, + pubkey5: 5, + pubkey6: 6, + pubkey7: 7, + pubkey8: 8, + } + ctrl := gomock.NewController(t) defer ctrl.Finish() ctx := context.Background() client := validatormock.NewMockValidatorClient(ctrl) - client.EXPECT().ValidatorIndex( - gomock.Any(), - ðpb.ValidatorIndexRequest{ - PublicKey: pubkey2[:], - }, - ).Return(ðpb.ValidatorIndexResponse{ - Index: 2, - }, nil) - - client.EXPECT().ValidatorIndex( - gomock.Any(), - ðpb.ValidatorIndexRequest{ - PublicKey: pubkey3[:], - }, - ).Return(nil, status.Error(codes.NotFound, "NOT_FOUND")) - client.EXPECT().MultipleValidatorStatus( gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, val *ethpb.MultipleValidatorStatusRequest) (*ethpb.MultipleValidatorStatusResponse, error) { @@ -2253,6 +2398,8 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { Status: pubkeyToStatus[bytesutil.ToBytes48(k)], ActivationEpoch: pubkeyToActivationEpoch[bytesutil.ToBytes48(k)], }) + index := pubkeyToIndex[bytesutil.ToBytes48(k)] + resp.Indices = append(resp.Indices, index) } return resp, nil }) @@ -2288,13 +2435,47 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { }, }, }, - pubkeyToValidatorIndex: map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex{ - pubkey1: 1, - pubkey4: 4, - pubkey5: 5, - pubkey6: 6, - pubkey7: 7, - pubkey8: 8, + pubkeyToStatus: map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus{ + pubkey1: { + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + }, + pubkey2: { + publicKey: pubkey2[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 2, + }, + pubkey3: { + publicKey: pubkey3[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_UNKNOWN_STATUS}, + index: unknownIndex, + }, + pubkey4: { + publicKey: pubkey4[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 4, + }, + pubkey5: { + publicKey: pubkey5[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 5, + }, + pubkey6: { + publicKey: pubkey6[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 6, + }, + pubkey7: { + publicKey: pubkey7[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 7, + }, + pubkey8: { + publicKey: pubkey8[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 8, + }, }, } @@ -2331,10 +2512,13 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { FeeRecipient: feeRecipient8[:], }, } - filteredKeys, err := v.filterAndCacheActiveKeys(ctx, pubkeys, 641) + filteredKeys, err := v.filterAndCacheActiveKeys(ctx, pubkeys, 640) require.NoError(t, err) actual, err := v.buildPrepProposerReqs(filteredKeys) require.NoError(t, err) + sort.Slice(actual, func(i, j int) bool { + return actual[i].ValidatorIndex < actual[j].ValidatorIndex + }) assert.DeepEqual(t, expected, actual) } @@ -2404,7 +2588,7 @@ func TestValidator_buildSignedRegReqs_DefaultConfigDisabled(t *testing.T) { }, }, }, - pubkeyToValidatorIndex: make(map[[48]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } pubkeys := [][fieldparams.BLSPubkeyLength]byte{pubkey1, pubkey2, pubkey3} @@ -2412,26 +2596,41 @@ func TestValidator_buildSignedRegReqs_DefaultConfigDisabled(t *testing.T) { var signer = func(_ context.Context, _ *validatorpb.SignRequest) (bls.Signature, error) { return signature, nil } - v.pubkeyToValidatorIndex[pubkey1] = primitives.ValidatorIndex(1) - v.pubkeyToValidatorIndex[pubkey2] = primitives.ValidatorIndex(2) - v.pubkeyToValidatorIndex[pubkey3] = primitives.ValidatorIndex(3) - actual := v.buildSignedRegReqs(ctx, pubkeys, signer) + v.pubkeyToStatus[pubkey1] = &validatorStatus{ + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + } + v.pubkeyToStatus[pubkey2] = &validatorStatus{ + publicKey: pubkey2[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 2, + } + v.pubkeyToStatus[pubkey3] = &validatorStatus{ + publicKey: pubkey3[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 3, + } + actual := v.buildSignedRegReqs(ctx, pubkeys, signer, 0, false) assert.Equal(t, 1, len(actual)) assert.DeepEqual(t, feeRecipient1[:], actual[0].Message.FeeRecipient) assert.Equal(t, uint64(1111), actual[0].Message.GasLimit) assert.DeepEqual(t, pubkey1[:], actual[0].Message.Pubkey) + } func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { // pubkey1 => feeRecipient1, builder enabled // pubkey2 => feeRecipient2, builder disabled // pubkey3 => Nothing, builder enabled + // pubkey4 => added after builder requests built once, used in mid epoch test // Public keys pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey4 := pubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") // Fee recipients feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") @@ -2446,8 +2645,7 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { client := validatormock.NewMockValidatorClient(ctrl) signature := blsmock.NewMockSignature(ctrl) - signature.EXPECT().Marshal().Return([]byte{}).Times(2) - + signature.EXPECT().Marshal().Return([]byte{}).AnyTimes() v := validator{ signedValidatorRegistrations: map[[48]byte]*ethpb.SignedValidatorRegistrationV1{}, validatorClient: client, @@ -2489,7 +2687,7 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { }, }, }, - pubkeyToValidatorIndex: make(map[[48]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } pubkeys := [][fieldparams.BLSPubkeyLength]byte{pubkey1, pubkey2, pubkey3} @@ -2497,10 +2695,22 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { var signer = func(_ context.Context, _ *validatorpb.SignRequest) (bls.Signature, error) { return signature, nil } - v.pubkeyToValidatorIndex[pubkey1] = primitives.ValidatorIndex(1) - v.pubkeyToValidatorIndex[pubkey2] = primitives.ValidatorIndex(2) - v.pubkeyToValidatorIndex[pubkey3] = primitives.ValidatorIndex(3) - actual := v.buildSignedRegReqs(ctx, pubkeys, signer) + v.pubkeyToStatus[pubkey1] = &validatorStatus{ + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + } + v.pubkeyToStatus[pubkey2] = &validatorStatus{ + publicKey: pubkey2[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 2, + } + v.pubkeyToStatus[pubkey3] = &validatorStatus{ + publicKey: pubkey3[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 3, + } + actual := v.buildSignedRegReqs(ctx, pubkeys, signer, 0, false) assert.Equal(t, 2, len(actual)) @@ -2511,6 +2721,26 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { assert.DeepEqual(t, defaultFeeRecipient[:], actual[1].Message.FeeRecipient) assert.Equal(t, uint64(9999), actual[1].Message.GasLimit) assert.DeepEqual(t, pubkey3[:], actual[1].Message.Pubkey) + + t.Run("mid epoch only pushes newly added key", func(t *testing.T) { + v.pubkeyToStatus[pubkey4] = &validatorStatus{ + publicKey: pubkey4[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 4, + } + pubkeys = append(pubkeys, pubkey4) + actual = v.buildSignedRegReqs(ctx, pubkeys, signer, 5, false) + assert.Equal(t, 1, len(actual)) + + assert.DeepEqual(t, defaultFeeRecipient[:], actual[0].Message.FeeRecipient) + assert.Equal(t, uint64(9999), actual[0].Message.GasLimit) + assert.DeepEqual(t, pubkey4[:], actual[0].Message.Pubkey) + }) + + t.Run("force push all keys mid epoch", func(t *testing.T) { + actual = v.buildSignedRegReqs(ctx, pubkeys, signer, 5, true) + assert.Equal(t, 3, len(actual)) + }) } func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) { @@ -2548,7 +2778,7 @@ func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) { return nil, errors.New("custom error") } - actual := v.buildSignedRegReqs(ctx, pubkeys, signer) + actual := v.buildSignedRegReqs(ctx, pubkeys, signer, 0, false) assert.Equal(t, 0, len(actual)) } @@ -2595,7 +2825,7 @@ func TestValidator_buildSignedRegReqs_TimestampBeforeGenesis(t *testing.T) { }, }, }, - pubkeyToValidatorIndex: make(map[[48]byte]primitives.ValidatorIndex), + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } pubkeys := [][fieldparams.BLSPubkeyLength]byte{pubkey1} @@ -2603,8 +2833,12 @@ func TestValidator_buildSignedRegReqs_TimestampBeforeGenesis(t *testing.T) { var signer = func(_ context.Context, _ *validatorpb.SignRequest) (bls.Signature, error) { return signature, nil } - v.pubkeyToValidatorIndex[pubkey1] = primitives.ValidatorIndex(1) - actual := v.buildSignedRegReqs(ctx, pubkeys, signer) + v.pubkeyToStatus[pubkey1] = &validatorStatus{ + publicKey: pubkey1[:], + status: ðpb.ValidatorStatusResponse{Status: ethpb.ValidatorStatus_ACTIVE}, + index: 1, + } + actual := v.buildSignedRegReqs(ctx, pubkeys, signer, 0, false) assert.Equal(t, 0, len(actual)) } diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index 28b3e048acb3..3051410272d6 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -109,9 +109,8 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang return v.internalWaitForActivation(incrementRetries(ctx), accountsChangedChan) } - statuses := make([]*validatorStatus, len(res.Statuses)) - for i, s := range res.Statuses { - statuses[i] = &validatorStatus{ + for _, s := range res.Statuses { + v.pubkeyToStatus[bytesutil.ToBytes48(s.PublicKey)] = &validatorStatus{ publicKey: s.PublicKey, status: s.Status, index: s.Index, @@ -129,7 +128,7 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang valCount = int64(valCounts[0].Count) } - someAreActive = v.checkAndLogValidatorStatus(statuses, valCount) + someAreActive = v.checkAndLogValidatorStatus(valCount) } } diff --git a/validator/client/wait_for_activation_test.go b/validator/client/wait_for_activation_test.go index e3e5f3392198..9e38b5db1445 100644 --- a/validator/client/wait_for_activation_test.go +++ b/validator/client/wait_for_activation_test.go @@ -37,6 +37,7 @@ func TestWaitActivation_ContextCanceled(t *testing.T) { validatorClient: validatorClient, km: newMockKeymanager(t, kp), chainClient: chainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) ctx, cancel := context.WithCancel(context.Background()) @@ -65,6 +66,7 @@ func TestWaitActivation_StreamSetupFails_AttemptsToReconnect(t *testing.T) { km: newMockKeymanager(t, kp), chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) validatorClient.EXPECT().WaitForActivation( @@ -96,6 +98,7 @@ func TestWaitForActivation_ReceiveErrorFromStream_AttemptsReconnection(t *testin km: newMockKeymanager(t, kp), chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } clientStream := mock.NewMockBeaconNodeValidator_WaitForActivationClient(ctrl) validatorClient.EXPECT().WaitForActivation( @@ -133,6 +136,7 @@ func TestWaitActivation_LogsActivationEpochOK(t *testing.T) { genesisTime: 1, chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE @@ -168,6 +172,7 @@ func TestWaitForActivation_Exiting(t *testing.T) { km: newMockKeymanager(t, kp), chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_EXITING @@ -211,6 +216,7 @@ func TestWaitForActivation_RefetchKeys(t *testing.T) { km: km, chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE @@ -264,6 +270,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { km: km, chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } inactiveResp := generateMockStatusResponse([][]byte{inactive.pub[:]}) inactiveResp.Statuses[0].Status.Status = ethpb.ValidatorStatus_UNKNOWN_STATUS @@ -355,6 +362,7 @@ func TestWaitForActivation_AccountsChanged(t *testing.T) { genesisTime: 1, chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } inactiveResp := generateMockStatusResponse([][]byte{inactivePubKey[:]}) @@ -423,6 +431,7 @@ func TestWaitActivation_NotAllValidatorsActivatedOK(t *testing.T) { km: newMockKeymanager(t, kp), chainClient: chainClient, prysmChainClient: prysmChainClient, + pubkeyToStatus: make(map[[48]byte]*validatorStatus), } resp := generateMockStatusResponse([][]byte{kp.pub[:]}) resp.Statuses[0].Status.Status = ethpb.ValidatorStatus_ACTIVE From a03b34af77045aaa1043c400a29784eff28da9d1 Mon Sep 17 00:00:00 2001 From: Potuz Date: Tue, 10 Sep 2024 08:34:42 -0300 Subject: [PATCH 284/325] Use read only validators on ApplyToEveryValidator (#14426) * Use read only validators on ApplyToEveryValidator * Use ReadFromEveryValidator on slashing * change changelog * Revert "Use ReadFromEveryValidator on slashing" This reverts commit 74c055bddb56e0573075c71df8a40f1c6a9bfdfd. --- CHANGELOG.md | 2 + .../core/electra/effective_balance_updates.go | 19 ++++--- beacon-chain/core/epoch/epoch_processing.go | 49 +++++++++---------- .../core/epoch/precompute/slashing.go | 15 +++--- beacon-chain/state/interfaces.go | 3 +- .../state/state-native/readonly_validator.go | 16 ++++++ .../state/state-native/references_test.go | 29 ++++++----- .../state/state-native/setters_validator.go | 25 +++++++--- .../validate_bls_to_execution_change_test.go | 8 +-- 9 files changed, 96 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42fad7ce6f67..b5858dcd9204 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `grpc-gateway-corsdomain` is renamed to http-cors-domain. The old name can still be used as an alias. - `api-timeout` is changed from int flag to duration flag, default value updated. - Light client support: abstracted out the light client headers with different versions. +- `ApplyToEveryValidator` has been changed to prevent misuse bugs, it takes a closure that takes a `ReadOnlyValidator` and returns a raw pointer to a `Validator`. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. @@ -48,6 +49,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - validator registration log changed to debug, and the frequency of validator registration calls are reduced - Core: Fix process effective balance update to safe copy validator for Electra. - `== nil` checks before calling `IsNil()` on interfaces to prevent panics. +- Core: Fixed slash processing causing extra hashing ### Security diff --git a/beacon-chain/core/electra/effective_balance_updates.go b/beacon-chain/core/electra/effective_balance_updates.go index bc5a73b9f11c..c87d232adb2b 100644 --- a/beacon-chain/core/electra/effective_balance_updates.go +++ b/beacon-chain/core/electra/effective_balance_updates.go @@ -30,21 +30,21 @@ import ( // or validator.effective_balance + UPWARD_THRESHOLD < balance // ): // validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, EFFECTIVE_BALANCE_LIMIT) -func ProcessEffectiveBalanceUpdates(state state.BeaconState) error { +func ProcessEffectiveBalanceUpdates(st state.BeaconState) error { effBalanceInc := params.BeaconConfig().EffectiveBalanceIncrement hysteresisInc := effBalanceInc / params.BeaconConfig().HysteresisQuotient downwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisDownwardMultiplier upwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisUpwardMultiplier - bals := state.Balances() + bals := st.Balances() // Update effective balances with hysteresis. - validatorFunc := func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { + validatorFunc := func(idx int, val state.ReadOnlyValidator) (newVal *ethpb.Validator, err error) { if val == nil { - return false, nil, fmt.Errorf("validator %d is nil in state", idx) + return nil, fmt.Errorf("validator %d is nil in state", idx) } if idx >= len(bals) { - return false, nil, fmt.Errorf("validator index exceeds validator length in state %d >= %d", idx, len(state.Balances())) + return nil, fmt.Errorf("validator index exceeds validator length in state %d >= %d", idx, len(st.Balances())) } balance := bals[idx] @@ -53,14 +53,13 @@ func ProcessEffectiveBalanceUpdates(state state.BeaconState) error { effectiveBalanceLimit = params.BeaconConfig().MaxEffectiveBalanceElectra } - if balance+downwardThreshold < val.EffectiveBalance || val.EffectiveBalance+upwardThreshold < balance { + if balance+downwardThreshold < val.EffectiveBalance() || val.EffectiveBalance()+upwardThreshold < balance { effectiveBal := min(balance-balance%effBalanceInc, effectiveBalanceLimit) - newVal := ethpb.CopyValidator(val) + newVal = val.Copy() newVal.EffectiveBalance = effectiveBal - return true, newVal, nil } - return false, val, nil + return newVal, nil } - return state.ApplyToEveryValidator(validatorFunc) + return st.ApplyToEveryValidator(validatorFunc) } diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 1fe1293b53b3..499b3baadaf3 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -153,9 +153,9 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) (state.Be // penalty_numerator = validator.effective_balance // increment * adjusted_total_slashing_balance // penalty = penalty_numerator // total_balance * increment // decrease_balance(state, ValidatorIndex(index), penalty) -func ProcessSlashings(state state.BeaconState, slashingMultiplier uint64) (state.BeaconState, error) { - currentEpoch := time.CurrentEpoch(state) - totalBalance, err := helpers.TotalActiveBalance(state) +func ProcessSlashings(st state.BeaconState, slashingMultiplier uint64) (state.BeaconState, error) { + currentEpoch := time.CurrentEpoch(st) + totalBalance, err := helpers.TotalActiveBalance(st) if err != nil { return nil, errors.Wrap(err, "could not get total active balance") } @@ -164,7 +164,7 @@ func ProcessSlashings(state state.BeaconState, slashingMultiplier uint64) (state exitLength := params.BeaconConfig().EpochsPerSlashingsVector // Compute the sum of state slashings - slashings := state.Slashings() + slashings := st.Slashings() totalSlashing := uint64(0) for _, slashing := range slashings { totalSlashing, err = math.Add64(totalSlashing, slashing) @@ -177,19 +177,18 @@ func ProcessSlashings(state state.BeaconState, slashingMultiplier uint64) (state // below equally. increment := params.BeaconConfig().EffectiveBalanceIncrement minSlashing := math.Min(totalSlashing*slashingMultiplier, totalBalance) - err = state.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - correctEpoch := (currentEpoch + exitLength/2) == val.WithdrawableEpoch - if val.Slashed && correctEpoch { - penaltyNumerator := val.EffectiveBalance / increment * minSlashing + err = st.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (newVal *ethpb.Validator, err error) { + correctEpoch := (currentEpoch + exitLength/2) == val.WithdrawableEpoch() + if val.Slashed() && correctEpoch { + penaltyNumerator := val.EffectiveBalance() / increment * minSlashing penalty := penaltyNumerator / totalBalance * increment - if err := helpers.DecreaseBalance(state, primitives.ValidatorIndex(idx), penalty); err != nil { - return false, val, err + if err = helpers.DecreaseBalance(st, primitives.ValidatorIndex(idx), penalty); err != nil { + return } - return true, val, nil } - return false, val, nil + return }) - return state, err + return st, err } // ProcessEth1DataReset processes updates to ETH1 data votes during epoch processing. @@ -231,45 +230,43 @@ func ProcessEth1DataReset(state state.BeaconState) (state.BeaconState, error) { // or validator.effective_balance + UPWARD_THRESHOLD < balance // ): // validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE) -func ProcessEffectiveBalanceUpdates(state state.BeaconState) (state.BeaconState, error) { +func ProcessEffectiveBalanceUpdates(st state.BeaconState) (state.BeaconState, error) { effBalanceInc := params.BeaconConfig().EffectiveBalanceIncrement maxEffBalance := params.BeaconConfig().MaxEffectiveBalance hysteresisInc := effBalanceInc / params.BeaconConfig().HysteresisQuotient downwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisDownwardMultiplier upwardThreshold := hysteresisInc * params.BeaconConfig().HysteresisUpwardMultiplier - bals := state.Balances() + bals := st.Balances() // Update effective balances with hysteresis. - validatorFunc := func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { + validatorFunc := func(idx int, val state.ReadOnlyValidator) (newVal *ethpb.Validator, err error) { if val == nil { - return false, nil, fmt.Errorf("validator %d is nil in state", idx) + return nil, fmt.Errorf("validator %d is nil in state", idx) } if idx >= len(bals) { - return false, nil, fmt.Errorf("validator index exceeds validator length in state %d >= %d", idx, len(state.Balances())) + return nil, fmt.Errorf("validator index exceeds validator length in state %d >= %d", idx, len(st.Balances())) } balance := bals[idx] - if balance+downwardThreshold < val.EffectiveBalance || val.EffectiveBalance+upwardThreshold < balance { + if balance+downwardThreshold < val.EffectiveBalance() || val.EffectiveBalance()+upwardThreshold < balance { effectiveBal := maxEffBalance if effectiveBal > balance-balance%effBalanceInc { effectiveBal = balance - balance%effBalanceInc } - if effectiveBal != val.EffectiveBalance { - newVal := ethpb.CopyValidator(val) + if effectiveBal != val.EffectiveBalance() { + newVal = val.Copy() newVal.EffectiveBalance = effectiveBal - return true, newVal, nil } - return false, val, nil } - return false, val, nil + return } - if err := state.ApplyToEveryValidator(validatorFunc); err != nil { + if err := st.ApplyToEveryValidator(validatorFunc); err != nil { return nil, err } - return state, nil + return st, nil } // ProcessSlashingsReset processes the total slashing balances updates during epoch processing. diff --git a/beacon-chain/core/epoch/precompute/slashing.go b/beacon-chain/core/epoch/precompute/slashing.go index 03e0cd6ef99b..69bf6d7147d5 100644 --- a/beacon-chain/core/epoch/precompute/slashing.go +++ b/beacon-chain/core/epoch/precompute/slashing.go @@ -44,17 +44,16 @@ func ProcessSlashingsPrecompute(s state.BeaconState, pBal *Balance) error { } increment := params.BeaconConfig().EffectiveBalanceIncrement - validatorFunc := func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - correctEpoch := epochToWithdraw == val.WithdrawableEpoch - if val.Slashed && correctEpoch { - penaltyNumerator := val.EffectiveBalance / increment * minSlashing + validatorFunc := func(idx int, val state.ReadOnlyValidator) (newVal *ethpb.Validator, err error) { + correctEpoch := epochToWithdraw == val.WithdrawableEpoch() + if val.Slashed() && correctEpoch { + penaltyNumerator := val.EffectiveBalance() / increment * minSlashing penalty := penaltyNumerator / pBal.ActiveCurrentEpoch * increment - if err := helpers.DecreaseBalance(s, primitives.ValidatorIndex(idx), penalty); err != nil { - return false, val, err + if err = helpers.DecreaseBalance(s, primitives.ValidatorIndex(idx), penalty); err != nil { + return } - return true, val, nil } - return false, val, nil + return } return s.ApplyToEveryValidator(validatorFunc) diff --git a/beacon-chain/state/interfaces.go b/beacon-chain/state/interfaces.go index e7b4915e1c14..ba7d00fdac88 100644 --- a/beacon-chain/state/interfaces.go +++ b/beacon-chain/state/interfaces.go @@ -117,6 +117,7 @@ type ReadOnlyValidator interface { ExitEpoch() primitives.Epoch PublicKey() [fieldparams.BLSPubkeyLength]byte GetWithdrawalCredentials() []byte + Copy() *ethpb.Validator Slashed() bool IsNil() bool } @@ -258,7 +259,7 @@ type WriteOnlyEth1Data interface { // WriteOnlyValidators defines a struct which only has write access to validators methods. type WriteOnlyValidators interface { SetValidators(val []*ethpb.Validator) error - ApplyToEveryValidator(f func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error)) error + ApplyToEveryValidator(f func(idx int, val ReadOnlyValidator) (*ethpb.Validator, error)) error UpdateValidatorAtIndex(idx primitives.ValidatorIndex, val *ethpb.Validator) error AppendValidator(val *ethpb.Validator) error } diff --git a/beacon-chain/state/state-native/readonly_validator.go b/beacon-chain/state/state-native/readonly_validator.go index f5029049eda9..c26b212ba820 100644 --- a/beacon-chain/state/state-native/readonly_validator.go +++ b/beacon-chain/state/state-native/readonly_validator.go @@ -92,3 +92,19 @@ func (v readOnlyValidator) Slashed() bool { func (v readOnlyValidator) IsNil() bool { return v.validator == nil } + +// Copy returns a new validator from the read only validator +func (v readOnlyValidator) Copy() *ethpb.Validator { + pubKey := v.PublicKey() + withdrawalCreds := v.GetWithdrawalCredentials() + return ðpb.Validator{ + PublicKey: pubKey[:], + WithdrawalCredentials: withdrawalCreds, + EffectiveBalance: v.EffectiveBalance(), + Slashed: v.Slashed(), + ActivationEligibilityEpoch: v.ActivationEligibilityEpoch(), + ActivationEpoch: v.ActivationEpoch(), + ExitEpoch: v.ExitEpoch(), + WithdrawableEpoch: v.WithdrawableEpoch(), + } +} diff --git a/beacon-chain/state/state-native/references_test.go b/beacon-chain/state/state-native/references_test.go index 82596e11ccf3..d58f43e99113 100644 --- a/beacon-chain/state/state-native/references_test.go +++ b/beacon-chain/state/state-native/references_test.go @@ -865,8 +865,8 @@ func TestValidatorReferences_RemainsConsistent_Phase0(t *testing.T) { assert.DeepNotEqual(t, a.Validators()[0], b.Validators()[0], "validators are equal when they are supposed to be different") // Modify all validators from copied state. - assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - return true, ðpb.Validator{PublicKey: []byte{'V'}}, nil + assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { + return ðpb.Validator{PublicKey: []byte{'V'}}, nil })) // Ensure reference is properly accounted for. @@ -900,8 +900,8 @@ func TestValidatorReferences_RemainsConsistent_Altair(t *testing.T) { assert.DeepNotEqual(t, a.Validators()[0], b.Validators()[0], "validators are equal when they are supposed to be different") // Modify all validators from copied state. - assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - return true, ðpb.Validator{PublicKey: []byte{'V'}}, nil + assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { + return ðpb.Validator{PublicKey: []byte{'V'}}, nil })) // Ensure reference is properly accounted for. @@ -935,8 +935,8 @@ func TestValidatorReferences_RemainsConsistent_Capella(t *testing.T) { assert.DeepNotEqual(t, a.Validators()[0], b.Validators()[0], "validators are equal when they are supposed to be different") // Modify all validators from copied state. - assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - return true, ðpb.Validator{PublicKey: []byte{'V'}}, nil + assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { + return ðpb.Validator{PublicKey: []byte{'V'}}, nil })) // Ensure reference is properly accounted for. @@ -970,8 +970,8 @@ func TestValidatorReferences_RemainsConsistent_Deneb(t *testing.T) { assert.DeepNotEqual(t, a.Validators()[0], b.Validators()[0], "validators are equal when they are supposed to be different") // Modify all validators from copied state. - assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - return true, ðpb.Validator{PublicKey: []byte{'V'}}, nil + assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { + return ðpb.Validator{PublicKey: []byte{'V'}}, nil })) // Ensure reference is properly accounted for. @@ -1005,8 +1005,8 @@ func TestValidatorReferences_RemainsConsistent_Bellatrix(t *testing.T) { assert.DeepNotEqual(t, a.Validators()[0], b.Validators()[0], "validators are equal when they are supposed to be different") // Modify all validators from copied state. - assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { - return true, ðpb.Validator{PublicKey: []byte{'V'}}, nil + assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { + return ðpb.Validator{PublicKey: []byte{'V'}}, nil })) // Ensure reference is properly accounted for. @@ -1041,15 +1041,14 @@ func TestValidatorReferences_ApplyValidator_BalancesRead(t *testing.T) { require.Equal(t, true, ok) // Modify all validators from copied state, it should not deadlock. - assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { + assert.NoError(t, b.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { b, err := b.BalanceAtIndex(0) if err != nil { - return false, nil, err + return nil, err } - newVal := ethpb.CopyValidator(val) + newVal := val.Copy() newVal.EffectiveBalance += b - val.EffectiveBalance += b - return true, val, nil + return newVal, nil })) } diff --git a/beacon-chain/state/state-native/setters_validator.go b/beacon-chain/state/state-native/setters_validator.go index a30986c9ccf3..6569a080653c 100644 --- a/beacon-chain/state/state-native/setters_validator.go +++ b/beacon-chain/state/state-native/setters_validator.go @@ -2,6 +2,7 @@ package state_native import ( "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native/types" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stateutil" "github.com/prysmaticlabs/prysm/v5/config/features" @@ -38,7 +39,7 @@ func (b *BeaconState) SetValidators(val []*ethpb.Validator) error { // ApplyToEveryValidator applies the provided callback function to each validator in the // validator registry. -func (b *BeaconState) ApplyToEveryValidator(f func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error)) error { +func (b *BeaconState) ApplyToEveryValidator(f func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error)) error { var changedVals []uint64 if features.Get().EnableExperimentalState { l := b.validatorsMultiValue.Len(b) @@ -47,11 +48,15 @@ func (b *BeaconState) ApplyToEveryValidator(f func(idx int, val *ethpb.Validator if err != nil { return err } - changed, newVal, err := f(i, v) + ro, err := NewValidator(v) if err != nil { return err } - if changed { + newVal, err := f(i, ro) + if err != nil { + return err + } + if newVal != nil { changedVals = append(changedVals, uint64(i)) if err = b.validatorsMultiValue.UpdateAt(b, uint64(i), newVal); err != nil { return errors.Wrapf(err, "could not update validator at index %d", i) @@ -71,11 +76,15 @@ func (b *BeaconState) ApplyToEveryValidator(f func(idx int, val *ethpb.Validator b.lock.Unlock() for i, val := range v { - changed, newVal, err := f(i, val) + ro, err := NewValidator(val) + if err != nil { + return err + } + newVal, err := f(i, ro) if err != nil { return err } - if changed { + if newVal != nil { changedVals = append(changedVals, uint64(i)) v[i] = newVal } @@ -89,8 +98,10 @@ func (b *BeaconState) ApplyToEveryValidator(f func(idx int, val *ethpb.Validator b.lock.Lock() defer b.lock.Unlock() - b.markFieldAsDirty(types.Validators) - b.addDirtyIndices(types.Validators, changedVals) + if len(changedVals) > 0 { + b.markFieldAsDirty(types.Validators) + b.addDirtyIndices(types.Validators, changedVals) + } return nil } diff --git a/beacon-chain/sync/validate_bls_to_execution_change_test.go b/beacon-chain/sync/validate_bls_to_execution_change_test.go index c6fb8d43c98d..255279048054 100644 --- a/beacon-chain/sync/validate_bls_to_execution_change_test.go +++ b/beacon-chain/sync/validate_bls_to_execution_change_test.go @@ -19,6 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" mockp2p "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" @@ -293,12 +294,13 @@ func TestService_ValidateBlsToExecutionChange(t *testing.T) { s.cfg.clock = startup.NewClock(time.Now(), [32]byte{'A'}) s.initCaches() st, keys := util.DeterministicGenesisStateCapella(t, 128) - assert.NoError(t, st.ApplyToEveryValidator(func(idx int, val *ethpb.Validator) (bool, *ethpb.Validator, error) { + assert.NoError(t, st.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (*ethpb.Validator, error) { newCreds := make([]byte, 32) newCreds[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte copy(newCreds[12:], wantedExecAddress) - val.WithdrawalCredentials = newCreds - return true, val, nil + newVal := val.Copy() + newVal.WithdrawalCredentials = newCreds + return newVal, nil })) s.cfg.chain = &mockChain.ChainService{ State: st, From 38b92c01714548c7d0d1b341f267abceda0c2330 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 11 Sep 2024 14:58:07 -0300 Subject: [PATCH 285/325] Avoid allocating in loops (#14439) * Avoid allocating in loops * change process slashings * add changelog * Kasey's review * Only marked trie dirty if changed --- CHANGELOG.md | 1 + beacon-chain/core/epoch/epoch_processing.go | 21 +++++++++++++------ .../core/epoch/precompute/slashing.go | 17 +++++++-------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5858dcd9204..12248dd99ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Core: Fix process effective balance update to safe copy validator for Electra. - `== nil` checks before calling `IsNil()` on interfaces to prevent panics. - Core: Fixed slash processing causing extra hashing +- Core: Fixed extra allocations when processing slashings ### Security diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 499b3baadaf3..e1adcc390237 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -177,18 +177,27 @@ func ProcessSlashings(st state.BeaconState, slashingMultiplier uint64) (state.Be // below equally. increment := params.BeaconConfig().EffectiveBalanceIncrement minSlashing := math.Min(totalSlashing*slashingMultiplier, totalBalance) - err = st.ApplyToEveryValidator(func(idx int, val state.ReadOnlyValidator) (newVal *ethpb.Validator, err error) { + bals := st.Balances() + changed := false + err = st.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error { correctEpoch := (currentEpoch + exitLength/2) == val.WithdrawableEpoch() if val.Slashed() && correctEpoch { penaltyNumerator := val.EffectiveBalance() / increment * minSlashing penalty := penaltyNumerator / totalBalance * increment - if err = helpers.DecreaseBalance(st, primitives.ValidatorIndex(idx), penalty); err != nil { - return - } + bals[idx] = helpers.DecreaseBalanceWithVal(bals[idx], penalty) + changed = true } - return + return nil }) - return st, err + if err != nil { + return nil, err + } + if changed { + if err := st.SetBalances(bals); err != nil { + return nil, err + } + } + return st, nil } // ProcessEth1DataReset processes updates to ETH1 data votes during epoch processing. diff --git a/beacon-chain/core/epoch/precompute/slashing.go b/beacon-chain/core/epoch/precompute/slashing.go index 69bf6d7147d5..02458f4a905b 100644 --- a/beacon-chain/core/epoch/precompute/slashing.go +++ b/beacon-chain/core/epoch/precompute/slashing.go @@ -5,9 +5,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/math" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // ProcessSlashingsPrecompute processes the slashed validators during epoch processing. @@ -44,17 +42,18 @@ func ProcessSlashingsPrecompute(s state.BeaconState, pBal *Balance) error { } increment := params.BeaconConfig().EffectiveBalanceIncrement - validatorFunc := func(idx int, val state.ReadOnlyValidator) (newVal *ethpb.Validator, err error) { + bals := s.Balances() + validatorFunc := func(idx int, val state.ReadOnlyValidator) error { correctEpoch := epochToWithdraw == val.WithdrawableEpoch() if val.Slashed() && correctEpoch { penaltyNumerator := val.EffectiveBalance() / increment * minSlashing penalty := penaltyNumerator / pBal.ActiveCurrentEpoch * increment - if err = helpers.DecreaseBalance(s, primitives.ValidatorIndex(idx), penalty); err != nil { - return - } + bals[idx] = helpers.DecreaseBalanceWithVal(bals[idx], penalty) } - return + return nil } - - return s.ApplyToEveryValidator(validatorFunc) + if err := s.ReadFromEveryValidator(validatorFunc); err != nil { + return err + } + return s.SetBalances(bals) } From a5317f81173038a1f7cc68eef271f7952cbabcae Mon Sep 17 00:00:00 2001 From: Md Amaan <114795592+Redidacove@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:09:05 +0530 Subject: [PATCH 286/325] Replaced mux with http.Servemux (#14416) * Replaced mux with http.Servmux * updated change log * james suggestions * lint * lint fix 2 * passed middlewares from validatorclient * gazelle fix * fixed issue * added middlewares field to rpc config * suggestions applied * updated godoc * fixed TestCors * refactor * godoc added * cli code removed and lint fixed --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- CHANGELOG.md | 1 + api/server/httprest/BUILD.bazel | 3 +- api/server/httprest/options.go | 14 +- api/server/httprest/server.go | 14 +- api/server/httprest/server_test.go | 15 +- api/server/middleware/BUILD.bazel | 5 +- api/server/middleware/middleware.go | 21 ++- beacon-chain/node/BUILD.bazel | 2 +- beacon-chain/node/node.go | 34 ++-- beacon-chain/node/node_test.go | 27 +-- beacon-chain/rpc/BUILD.bazel | 2 - beacon-chain/rpc/endpoints.go | 177 +++++++++--------- beacon-chain/rpc/eth/beacon/BUILD.bazel | 2 - beacon-chain/rpc/eth/beacon/handlers.go | 18 +- beacon-chain/rpc/eth/beacon/handlers_state.go | 7 +- .../rpc/eth/beacon/handlers_state_test.go | 33 ++-- beacon-chain/rpc/eth/beacon/handlers_test.go | 108 +++++------ .../rpc/eth/beacon/handlers_validator.go | 9 +- .../eth/beacon/handlers_validators_test.go | 79 ++++---- beacon-chain/rpc/eth/builder/BUILD.bazel | 2 - beacon-chain/rpc/eth/builder/handlers.go | 3 +- beacon-chain/rpc/eth/builder/handlers_test.go | 5 +- beacon-chain/rpc/eth/debug/BUILD.bazel | 2 - beacon-chain/rpc/eth/debug/handlers.go | 3 +- beacon-chain/rpc/eth/debug/handlers_test.go | 25 ++- beacon-chain/rpc/eth/light-client/BUILD.bazel | 2 - beacon-chain/rpc/eth/light-client/handlers.go | 3 +- .../rpc/eth/light-client/handlers_test.go | 13 +- beacon-chain/rpc/eth/node/BUILD.bazel | 2 - beacon-chain/rpc/eth/node/handlers_peers.go | 3 +- .../rpc/eth/node/handlers_peers_test.go | 7 +- beacon-chain/rpc/eth/shared/BUILD.bazel | 1 - beacon-chain/rpc/eth/shared/request.go | 5 +- beacon-chain/rpc/eth/validator/BUILD.bazel | 1 - .../rpc/eth/validator/handlers_test.go | 77 ++++---- beacon-chain/rpc/prysm/beacon/BUILD.bazel | 2 - .../rpc/prysm/beacon/validator_count.go | 3 +- .../rpc/prysm/beacon/validator_count_test.go | 5 +- beacon-chain/rpc/prysm/validator/BUILD.bazel | 2 - beacon-chain/rpc/prysm/validator/handlers.go | 5 +- .../rpc/prysm/validator/handlers_test.go | 11 +- beacon-chain/rpc/service.go | 15 +- beacon-chain/rpc/service_test.go | 6 +- deps.bzl | 6 - go.mod | 1 - go.sum | 1 - testing/middleware/builder/BUILD.bazel | 1 - testing/middleware/builder/builder.go | 15 +- validator/node/BUILD.bazel | 1 - validator/node/node.go | 34 ++-- validator/rpc/BUILD.bazel | 3 +- validator/rpc/handlers_keymanager_test.go | 39 ++-- validator/rpc/server.go | 90 ++++----- validator/rpc/server_test.go | 36 ++-- 54 files changed, 489 insertions(+), 512 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12248dd99ff3..9a9fc72870e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `api-timeout` is changed from int flag to duration flag, default value updated. - Light client support: abstracted out the light client headers with different versions. - `ApplyToEveryValidator` has been changed to prevent misuse bugs, it takes a closure that takes a `ReadOnlyValidator` and returns a raw pointer to a `Validator`. +- Removed gorilla mux library and replaced it with net/http updates in go 1.22 ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/api/server/httprest/BUILD.bazel b/api/server/httprest/BUILD.bazel index bef932abc364..f3c7465cf95a 100644 --- a/api/server/httprest/BUILD.bazel +++ b/api/server/httprest/BUILD.bazel @@ -10,8 +10,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/api/server/httprest", visibility = ["//visibility:public"], deps = [ + "//api/server/middleware:go_default_library", "//runtime:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", ], @@ -25,7 +25,6 @@ go_test( "//cmd/beacon-chain/flags:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", ], diff --git a/api/server/httprest/options.go b/api/server/httprest/options.go index 87b4764ae7aa..98f4dac25464 100644 --- a/api/server/httprest/options.go +++ b/api/server/httprest/options.go @@ -3,12 +3,22 @@ package httprest import ( "time" - "github.com/gorilla/mux" + "net/http" + + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" ) // Option is a http rest server functional parameter type. type Option func(g *Server) error +// WithMiddlewares sets the list of middlewares to be applied on routes. +func WithMiddlewares(mw []middleware.Middleware) Option { + return func(g *Server) error { + g.cfg.middlewares = mw + return nil + } +} + // WithHTTPAddr sets the full address ( host and port ) of the server. func WithHTTPAddr(addr string) Option { return func(g *Server) error { @@ -18,7 +28,7 @@ func WithHTTPAddr(addr string) Option { } // WithRouter sets the internal router of the server, this is required. -func WithRouter(r *mux.Router) Option { +func WithRouter(r *http.ServeMux) Option { return func(g *Server) error { g.cfg.router = r return nil diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 2e8f907a6478..84eb9fdc3b2e 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -5,8 +5,8 @@ import ( "net/http" "time" - "github.com/gorilla/mux" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/runtime" ) @@ -14,9 +14,10 @@ var _ runtime.Service = (*Server)(nil) // Config parameters for setting up the http-rest service. type config struct { - httpAddr string - router *mux.Router - timeout time.Duration + httpAddr string + middlewares []middleware.Middleware + router http.Handler + timeout time.Duration } // Server serves HTTP traffic. @@ -44,11 +45,10 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { } var handler http.Handler defaultReadHeaderTimeout := time.Second + handler = middleware.MiddlewareChain(g.cfg.router, g.cfg.middlewares) if g.cfg.timeout > 0*time.Second { defaultReadHeaderTimeout = g.cfg.timeout - handler = http.TimeoutHandler(g.cfg.router, g.cfg.timeout, "request timed out") - } else { - handler = g.cfg.router + handler = http.TimeoutHandler(handler, g.cfg.timeout, "request timed out") } g.server = &http.Server{ Addr: g.cfg.httpAddr, diff --git a/api/server/httprest/server_test.go b/api/server/httprest/server_test.go index 9e9d90a89559..106e3503af8e 100644 --- a/api/server/httprest/server_test.go +++ b/api/server/httprest/server_test.go @@ -4,12 +4,12 @@ import ( "context" "flag" "fmt" + "net" "net/http" "net/http/httptest" "net/url" "testing" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -25,12 +25,13 @@ func TestServer_StartStop(t *testing.T) { ctx := cli.NewContext(&app, set, nil) port := ctx.Int(flags.HTTPServerPort.Name) + portStr := fmt.Sprintf("%d", port) // Convert port to string host := ctx.String(flags.HTTPServerHost.Name) - address := fmt.Sprintf("%s:%d", host, port) - + address := net.JoinHostPort(host, portStr) + handler := http.NewServeMux() opts := []Option{ WithHTTPAddr(address), - WithRouter(mux.NewRouter()), + WithRouter(handler), } g, err := New(context.Background(), opts...) @@ -50,13 +51,15 @@ func TestServer_NilHandler_NotFoundHandlerRegistered(t *testing.T) { set := flag.NewFlagSet("test", 0) ctx := cli.NewContext(&app, set, nil) + handler := http.NewServeMux() port := ctx.Int(flags.HTTPServerPort.Name) + portStr := fmt.Sprintf("%d", port) // Convert port to string host := ctx.String(flags.HTTPServerHost.Name) - address := fmt.Sprintf("%s:%d", host, port) + address := net.JoinHostPort(host, portStr) opts := []Option{ WithHTTPAddr(address), - WithRouter(mux.NewRouter()), + WithRouter(handler), } g, err := New(context.Background(), opts...) diff --git a/api/server/middleware/BUILD.bazel b/api/server/middleware/BUILD.bazel index c210e5049dad..a57086f8bf5e 100644 --- a/api/server/middleware/BUILD.bazel +++ b/api/server/middleware/BUILD.bazel @@ -8,10 +8,7 @@ go_library( ], importpath = "github.com/prysmaticlabs/prysm/v5/api/server/middleware", visibility = ["//visibility:public"], - deps = [ - "@com_github_gorilla_mux//:go_default_library", - "@com_github_rs_cors//:go_default_library", - ], + deps = ["@com_github_rs_cors//:go_default_library"], ) go_test( diff --git a/api/server/middleware/middleware.go b/api/server/middleware/middleware.go index b85e59e895b6..72883372609c 100644 --- a/api/server/middleware/middleware.go +++ b/api/server/middleware/middleware.go @@ -5,10 +5,11 @@ import ( "net/http" "strings" - "github.com/gorilla/mux" "github.com/rs/cors" ) +type Middleware func(http.Handler) http.Handler + // NormalizeQueryValuesHandler normalizes an input query of "key=value1,value2,value3" to "key=value1&key=value2&key=value3" func NormalizeQueryValuesHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -21,7 +22,7 @@ func NormalizeQueryValuesHandler(next http.Handler) http.Handler { } // CorsHandler sets the cors settings on api endpoints -func CorsHandler(allowOrigins []string) mux.MiddlewareFunc { +func CorsHandler(allowOrigins []string) Middleware { c := cors.New(cors.Options{ AllowedOrigins: allowOrigins, AllowedMethods: []string{http.MethodPost, http.MethodGet, http.MethodDelete, http.MethodOptions}, @@ -34,7 +35,7 @@ func CorsHandler(allowOrigins []string) mux.MiddlewareFunc { } // ContentTypeHandler checks request for the appropriate media types otherwise returning a http.StatusUnsupportedMediaType error -func ContentTypeHandler(acceptedMediaTypes []string) mux.MiddlewareFunc { +func ContentTypeHandler(acceptedMediaTypes []string) Middleware { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // skip the GET request @@ -67,7 +68,7 @@ func ContentTypeHandler(acceptedMediaTypes []string) mux.MiddlewareFunc { } // AcceptHeaderHandler checks if the client's response preference is handled -func AcceptHeaderHandler(serverAcceptedTypes []string) mux.MiddlewareFunc { +func AcceptHeaderHandler(serverAcceptedTypes []string) Middleware { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { acceptHeader := r.Header.Get("Accept") @@ -110,3 +111,15 @@ func AcceptHeaderHandler(serverAcceptedTypes []string) mux.MiddlewareFunc { }) } } + +func MiddlewareChain(h http.Handler, mw []Middleware) http.Handler { + if len(mw) < 1 { + return h + } + + wrapped := h + for i := len(mw) - 1; i >= 0; i-- { + wrapped = mw[i](wrapped) + } + return wrapped +} diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 34255da7a159..a310daf40b26 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -65,7 +65,6 @@ go_library( "//runtime/prereqs:go_default_library", "//runtime/version:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", @@ -82,6 +81,7 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//api/server/middleware:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", "//beacon-chain/core/feed/state:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index be52d679a954..c6e6f510cea9 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "net" + "net/http" "os" "os/signal" "path/filepath" @@ -17,7 +18,6 @@ import ( "syscall" "github.com/ethereum/go-ethereum/common" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" @@ -361,7 +361,7 @@ func registerServices(cliCtx *cli.Context, beacon *BeaconNode, synchronizer *sta } log.Debugln("Registering RPC Service") - router := newRouter(cliCtx) + router := http.NewServeMux() if err := beacon.registerRPCService(router); err != nil { return errors.Wrap(err, "could not register RPC service") } @@ -397,19 +397,6 @@ func initSyncWaiter(ctx context.Context, complete chan struct{}) func() error { } } -func newRouter(cliCtx *cli.Context) *mux.Router { - var allowedOrigins []string - if cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") - } else { - allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") - } - r := mux.NewRouter() - r.Use(middleware.NormalizeQueryValuesHandler) - r.Use(middleware.CorsHandler(allowedOrigins)) - return r -} - // StateFeed implements statefeed.Notifier. func (b *BeaconNode) StateFeed() *event.Feed { return b.stateFeed @@ -916,7 +903,7 @@ func (b *BeaconNode) registerSlasherService() error { return b.services.RegisterService(slasherSrv) } -func (b *BeaconNode) registerRPCService(router *mux.Router) error { +func (b *BeaconNode) registerRPCService(router *http.ServeMux) error { var chainService *blockchain.Service if err := b.services.FetchService(&chainService); err != nil { return err @@ -1043,13 +1030,26 @@ func (b *BeaconNode) registerPrometheusService(_ *cli.Context) error { return b.services.RegisterService(service) } -func (b *BeaconNode) registerHTTPService(router *mux.Router) error { +func (b *BeaconNode) registerHTTPService(router *http.ServeMux) error { host := b.cliCtx.String(flags.HTTPServerHost.Name) port := b.cliCtx.Int(flags.HTTPServerPort.Name) address := net.JoinHostPort(host, strconv.Itoa(port)) + var allowedOrigins []string + if b.cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(b.cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") + } else { + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") + } + + middlewares := []middleware.Middleware{ + middleware.NormalizeQueryValuesHandler, + middleware.CorsHandler(allowedOrigins), + } + opts := []httprest.Option{ httprest.WithRouter(router), httprest.WithHTTPAddr(address), + httprest.WithMiddlewares(middlewares), } if b.cliCtx.IsSet(cmd.ApiTimeoutFlag.Name) { opts = append(opts, httprest.WithTimeout(b.cliCtx.Duration(cmd.ApiTimeoutFlag.Name))) diff --git a/beacon-chain/node/node_test.go b/beacon-chain/node/node_test.go index c27d0788e7d8..e8f72562b3d2 100644 --- a/beacon-chain/node/node_test.go +++ b/beacon-chain/node/node_test.go @@ -12,6 +12,7 @@ import ( "testing" "time" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" @@ -252,19 +253,19 @@ func Test_hasNetworkFlag(t *testing.T) { } func TestCORS(t *testing.T) { - // Mock CLI context with a test CORS domain - app := cli.App{} - set := flag.NewFlagSet("test", 0) - set.String(flags.HTTPServerCorsDomain.Name, "http://allowed-example.com", "") - cliCtx := cli.NewContext(&app, set, nil) - require.NoError(t, cliCtx.Set(flags.HTTPServerCorsDomain.Name, "http://allowed-example.com")) - - router := newRouter(cliCtx) - + router := http.NewServeMux() // Ensure a test route exists - router.HandleFunc("/some-path", func(w http.ResponseWriter, _ *http.Request) { - w.WriteHeader(http.StatusOK) - }).Methods(http.MethodGet) + router.HandleFunc("/some-path", func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodGet { + w.WriteHeader(http.StatusOK) + } else { + http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed) + } + }) + + // Register the CORS middleware on mux Router + allowedOrigins := []string{"http://allowed-example.com"} + handler := middleware.CorsHandler(allowedOrigins)(router) // Define test cases tests := []struct { @@ -285,7 +286,7 @@ func TestCORS(t *testing.T) { rr := httptest.NewRecorder() // Serve HTTP - router.ServeHTTP(rr, req) + handler.ServeHTTP(rr, req) // Check the CORS headers based on the expected outcome if tc.expectAllow && rr.Header().Get("Access-Control-Allow-Origin") != tc.origin { diff --git a/beacon-chain/rpc/BUILD.bazel b/beacon-chain/rpc/BUILD.bazel index b71d0ba51db5..55e44ed1240a 100644 --- a/beacon-chain/rpc/BUILD.bazel +++ b/beacon-chain/rpc/BUILD.bazel @@ -55,7 +55,6 @@ go_library( "//io/logs:go_default_library", "//monitoring/tracing:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//recovery:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//tracing/opentracing:go_default_library", @@ -88,7 +87,6 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", ], diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 622e6be9122b..3d99b2d291ee 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -3,7 +3,6 @@ package rpc import ( "net/http" - "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prysmaticlabs/prysm/v5/api" @@ -30,7 +29,7 @@ import ( type endpoint struct { template string name string - middleware []mux.MiddlewareFunc + middleware []middleware.Middleware handler http.HandlerFunc methods []string } @@ -93,7 +92,7 @@ func (s *Service) rewardsEndpoints(blocker lookup.Blocker, stater lookup.Stater, { template: "/eth/v1/beacon/rewards/blocks/{block_id}", name: namespace + ".BlockRewards", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.BlockRewards, @@ -102,7 +101,7 @@ func (s *Service) rewardsEndpoints(blocker lookup.Blocker, stater lookup.Stater, { template: "/eth/v1/beacon/rewards/attestations/{epoch}", name: namespace + ".AttestationRewards", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -112,7 +111,7 @@ func (s *Service) rewardsEndpoints(blocker lookup.Blocker, stater lookup.Stater, { template: "/eth/v1/beacon/rewards/sync_committee/{block_id}", name: namespace + ".SyncCommitteeRewards", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -134,7 +133,7 @@ func (s *Service) builderEndpoints(stater lookup.Stater) []endpoint { { template: "/eth/v1/builder/states/{state_id}/expected_withdrawals", name: namespace + ".ExpectedWithdrawals", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.ExpectedWithdrawals, @@ -153,7 +152,7 @@ func (*Service) blobEndpoints(blocker lookup.Blocker) []endpoint { { template: "/eth/v1/beacon/blob_sidecars/{block_id}", name: namespace + ".Blobs", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.Blobs, @@ -194,7 +193,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/aggregate_attestation", name: namespace + ".GetAggregateAttestation", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetAggregateAttestation, @@ -203,7 +202,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/contribution_and_proofs", name: namespace + ".SubmitContributionAndProofs", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -213,7 +212,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/aggregate_and_proofs", name: namespace + ".SubmitAggregateAndProofs", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -223,7 +222,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/sync_committee_contribution", name: namespace + ".ProduceSyncCommitteeContribution", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.ProduceSyncCommitteeContribution, @@ -232,7 +231,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/sync_committee_subscriptions", name: namespace + ".SubmitSyncCommitteeSubscription", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -242,7 +241,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/beacon_committee_subscriptions", name: namespace + ".SubmitBeaconCommitteeSubscription", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -252,7 +251,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/attestation_data", name: namespace + ".GetAttestationData", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetAttestationData, @@ -261,7 +260,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/register_validator", name: namespace + ".RegisterValidator", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -271,7 +270,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/duties/attester/{epoch}", name: namespace + ".GetAttesterDuties", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -281,7 +280,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/duties/proposer/{epoch}", name: namespace + ".GetProposerDuties", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetProposerDuties, @@ -290,7 +289,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/duties/sync/{epoch}", name: namespace + ".GetSyncCommitteeDuties", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -300,7 +299,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/prepare_beacon_proposer", name: namespace + ".PrepareBeaconProposer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -310,7 +309,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/liveness/{epoch}", name: namespace + ".GetLiveness", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -320,7 +319,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v2/validator/blocks/{slot}", name: namespace + ".ProduceBlockV2", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.ProduceBlockV2, @@ -329,7 +328,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/blinded_blocks/{slot}", name: namespace + ".ProduceBlindedBlock", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.ProduceBlindedBlock, @@ -338,7 +337,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v3/validator/blocks/{slot}", name: namespace + ".ProduceBlockV3", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.ProduceBlockV3, @@ -347,7 +346,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/beacon_committee_selections", name: namespace + ".BeaconCommitteeSelections", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), }, handler: server.BeaconCommitteeSelections, @@ -356,7 +355,7 @@ func (s *Service) validatorEndpoints( { template: "/eth/v1/validator/sync_committee_selections", name: namespace + ".SyncCommittee Selections", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), }, handler: server.SyncCommitteeSelections, @@ -384,7 +383,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/syncing", name: namespace + ".GetSyncStatus", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetSyncStatus, @@ -393,7 +392,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/identity", name: namespace + ".GetIdentity", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetIdentity, @@ -402,7 +401,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/peers/{peer_id}", name: namespace + ".GetPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetPeer, @@ -411,7 +410,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/peers", name: namespace + ".GetPeers", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetPeers, @@ -420,7 +419,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/peer_count", name: namespace + ".GetPeerCount", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetPeerCount, @@ -429,7 +428,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/version", name: namespace + ".GetVersion", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetVersion, @@ -438,7 +437,7 @@ func (s *Service) nodeEndpoints() []endpoint { { template: "/eth/v1/node/health", name: namespace + ".GetHealth", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetHealth, @@ -486,7 +485,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/committees", name: namespace + ".GetCommittees", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetCommittees, @@ -495,7 +494,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/fork", name: namespace + ".GetStateFork", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetStateFork, @@ -504,7 +503,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/root", name: namespace + ".GetStateRoot", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetStateRoot, @@ -513,7 +512,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/sync_committees", name: namespace + ".GetSyncCommittees", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetSyncCommittees, @@ -522,7 +521,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/randao", name: namespace + ".GetRandao", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetRandao, @@ -531,7 +530,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/blocks", name: namespace + ".PublishBlock", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -541,7 +540,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/blinded_blocks", name: namespace + ".PublishBlindedBlock", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -551,7 +550,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v2/beacon/blocks", name: namespace + ".PublishBlockV2", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -561,7 +560,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v2/beacon/blinded_blocks", name: namespace + ".PublishBlindedBlockV2", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -571,7 +570,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v2/beacon/blocks/{block_id}", name: namespace + ".GetBlockV2", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetBlockV2, @@ -580,7 +579,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/blocks/{block_id}/attestations", name: namespace + ".GetBlockAttestations", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetBlockAttestations, @@ -589,7 +588,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/blinded_blocks/{block_id}", name: namespace + ".GetBlindedBlock", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetBlindedBlock, @@ -598,7 +597,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/blocks/{block_id}/root", name: namespace + ".GetBlockRoot", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetBlockRoot, @@ -607,7 +606,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/attestations", name: namespace + ".ListAttestations", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.ListAttestations, @@ -616,7 +615,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/attestations", name: namespace + ".SubmitAttestations", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -626,7 +625,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/voluntary_exits", name: namespace + ".ListVoluntaryExits", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.ListVoluntaryExits, @@ -635,7 +634,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/voluntary_exits", name: namespace + ".SubmitVoluntaryExit", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -645,7 +644,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/sync_committees", name: namespace + ".SubmitSyncCommitteeSignatures", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -655,7 +654,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/bls_to_execution_changes", name: namespace + ".ListBLSToExecutionChanges", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.ListBLSToExecutionChanges, @@ -664,7 +663,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/bls_to_execution_changes", name: namespace + ".SubmitBLSToExecutionChanges", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -674,7 +673,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/attester_slashings", name: namespace + ".GetAttesterSlashings", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetAttesterSlashings, @@ -683,7 +682,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/attester_slashings", name: namespace + ".SubmitAttesterSlashing", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -693,7 +692,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/proposer_slashings", name: namespace + ".GetProposerSlashings", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetProposerSlashings, @@ -702,7 +701,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/pool/proposer_slashings", name: namespace + ".SubmitProposerSlashing", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -712,7 +711,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/headers", name: namespace + ".GetBlockHeaders", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetBlockHeaders, @@ -721,7 +720,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/headers/{block_id}", name: namespace + ".GetBlockHeader", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetBlockHeader, @@ -730,7 +729,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/genesis", name: namespace + ".GetGenesis", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetGenesis, @@ -739,7 +738,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/finality_checkpoints", name: namespace + ".GetFinalityCheckpoints", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetFinalityCheckpoints, @@ -748,7 +747,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/validators", name: namespace + ".GetValidators", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -758,7 +757,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/validators/{validator_id}", name: namespace + ".GetValidator", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetValidator, @@ -767,7 +766,7 @@ func (s *Service) beaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/validator_balances", name: namespace + ".GetValidatorBalances", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -783,7 +782,7 @@ func (*Service) configEndpoints() []endpoint { { template: "/eth/v1/config/deposit_contract", name: namespace + ".GetDepositContract", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: config.GetDepositContract, @@ -792,7 +791,7 @@ func (*Service) configEndpoints() []endpoint { { template: "/eth/v1/config/fork_schedule", name: namespace + ".GetForkSchedule", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: config.GetForkSchedule, @@ -801,7 +800,7 @@ func (*Service) configEndpoints() []endpoint { { template: "/eth/v1/config/spec", name: namespace + ".GetSpec", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: config.GetSpec, @@ -823,7 +822,7 @@ func (s *Service) lightClientEndpoints(blocker lookup.Blocker, stater lookup.Sta { template: "/eth/v1/beacon/light_client/bootstrap/{block_root}", name: namespace + ".GetLightClientBootstrap", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetLightClientBootstrap, @@ -832,7 +831,7 @@ func (s *Service) lightClientEndpoints(blocker lookup.Blocker, stater lookup.Sta { template: "/eth/v1/beacon/light_client/updates", name: namespace + ".GetLightClientUpdatesByRange", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetLightClientUpdatesByRange, @@ -841,7 +840,7 @@ func (s *Service) lightClientEndpoints(blocker lookup.Blocker, stater lookup.Sta { template: "/eth/v1/beacon/light_client/finality_update", name: namespace + ".GetLightClientFinalityUpdate", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetLightClientFinalityUpdate, @@ -850,7 +849,7 @@ func (s *Service) lightClientEndpoints(blocker lookup.Blocker, stater lookup.Sta { template: "/eth/v1/beacon/light_client/optimistic_update", name: namespace + ".GetLightClientOptimisticUpdate", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetLightClientOptimisticUpdate, @@ -876,7 +875,7 @@ func (s *Service) debugEndpoints(stater lookup.Stater) []endpoint { { template: "/eth/v2/debug/beacon/states/{state_id}", name: namespace + ".GetBeaconStateV2", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}), }, handler: server.GetBeaconStateV2, @@ -885,7 +884,7 @@ func (s *Service) debugEndpoints(stater lookup.Stater) []endpoint { { template: "/eth/v2/debug/beacon/heads", name: namespace + ".GetForkChoiceHeadsV2", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetForkChoiceHeadsV2, @@ -894,7 +893,7 @@ func (s *Service) debugEndpoints(stater lookup.Stater) []endpoint { { template: "/eth/v1/debug/fork_choice", name: namespace + ".GetForkChoice", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetForkChoice, @@ -917,7 +916,7 @@ func (s *Service) eventsEndpoints() []endpoint { { template: "/eth/v1/events", name: namespace + ".StreamEvents", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.EventStreamMediaType}), }, handler: server.StreamEvents, @@ -950,7 +949,7 @@ func (s *Service) prysmBeaconEndpoints( { template: "/prysm/v1/beacon/weak_subjectivity", name: namespace + ".GetWeakSubjectivity", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetWeakSubjectivity, @@ -959,7 +958,7 @@ func (s *Service) prysmBeaconEndpoints( { template: "/eth/v1/beacon/states/{state_id}/validator_count", name: namespace + ".GetValidatorCount", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetValidatorCount, @@ -968,7 +967,7 @@ func (s *Service) prysmBeaconEndpoints( { template: "/prysm/v1/beacon/states/{state_id}/validator_count", name: namespace + ".GetValidatorCount", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetValidatorCount, @@ -977,7 +976,7 @@ func (s *Service) prysmBeaconEndpoints( { template: "/prysm/v1/beacon/individual_votes", name: namespace + ".GetIndividualVotes", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -987,7 +986,7 @@ func (s *Service) prysmBeaconEndpoints( { template: "/prysm/v1/beacon/chain_head", name: namespace + ".GetChainHead", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetChainHead, @@ -1014,7 +1013,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/node/trusted_peers", name: namespace + ".ListTrustedPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.ListTrustedPeer, @@ -1023,7 +1022,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/v1/node/trusted_peers", name: namespace + ".ListTrustedPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.ListTrustedPeer, @@ -1032,7 +1031,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/node/trusted_peers", name: namespace + ".AddTrustedPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -1042,7 +1041,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/v1/node/trusted_peers", name: namespace + ".AddTrustedPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -1052,7 +1051,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/node/trusted_peers/{peer_id}", name: namespace + ".RemoveTrustedPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.RemoveTrustedPeer, @@ -1061,7 +1060,7 @@ func (s *Service) prysmNodeEndpoints() []endpoint { { template: "/prysm/v1/node/trusted_peers/{peer_id}", name: namespace + ".RemoveTrustedPeer", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.RemoveTrustedPeer, @@ -1082,7 +1081,7 @@ func (s *Service) prysmValidatorEndpoints(stater lookup.Stater, coreService *cor { template: "/prysm/validators/performance", name: namespace + ".GetPerformance", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -1092,7 +1091,7 @@ func (s *Service) prysmValidatorEndpoints(stater lookup.Stater, coreService *cor { template: "/prysm/v1/validators/performance", name: namespace + ".GetPerformance", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.ContentTypeHandler([]string{api.JsonMediaType}), middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, @@ -1102,7 +1101,7 @@ func (s *Service) prysmValidatorEndpoints(stater lookup.Stater, coreService *cor { template: "/prysm/v1/validators/participation", name: namespace + ".GetParticipation", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetParticipation, @@ -1111,7 +1110,7 @@ func (s *Service) prysmValidatorEndpoints(stater lookup.Stater, coreService *cor { template: "/prysm/v1/validators/active_set_changes", name: namespace + ".GetActiveSetChanges", - middleware: []mux.MiddlewareFunc{ + middleware: []middleware.Middleware{ middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), }, handler: server.GetActiveSetChanges, diff --git a/beacon-chain/rpc/eth/beacon/BUILD.bazel b/beacon-chain/rpc/eth/beacon/BUILD.bazel index d9a8037e3e71..cc40135b5dff 100644 --- a/beacon-chain/rpc/eth/beacon/BUILD.bazel +++ b/beacon-chain/rpc/eth/beacon/BUILD.bazel @@ -57,7 +57,6 @@ go_library( "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", @@ -120,7 +119,6 @@ go_test( "//testing/util:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 6f2c20d75bbb..a9c1bfb81389 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -11,7 +11,6 @@ import ( "strings" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" @@ -54,7 +53,7 @@ func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetBlockV2") defer span.End() - blockId := mux.Vars(r)["block_id"] + blockId := r.PathValue("block_id") if blockId == "" { httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest) return @@ -85,7 +84,7 @@ func (s *Server) GetBlindedBlock(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetBlindedBlock") defer span.End() - blockId := mux.Vars(r)["block_id"] + blockId := r.PathValue("block_id") if blockId == "" { httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest) return @@ -201,7 +200,7 @@ func (s *Server) GetBlockAttestations(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetBlockAttestations") defer span.End() - blockId := mux.Vars(r)["block_id"] + blockId := r.PathValue("block_id") if blockId == "" { httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest) return @@ -1037,7 +1036,7 @@ func (s *Server) GetBlockRoot(w http.ResponseWriter, r *http.Request) { var err error var root []byte - blockID := mux.Vars(r)["block_id"] + blockID := r.PathValue("block_id") if blockID == "" { httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest) return @@ -1149,7 +1148,8 @@ func (s *Server) GetBlockRoot(w http.ResponseWriter, r *http.Request) { func (s *Server) GetStateFork(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetStateFork") defer span.End() - stateId := mux.Vars(r)["state_id"] + + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return @@ -1189,7 +1189,7 @@ func (s *Server) GetCommittees(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetCommittees") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return @@ -1374,7 +1374,7 @@ func (s *Server) GetBlockHeader(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetBlockHeader") defer span.End() - blockID := mux.Vars(r)["block_id"] + blockID := r.PathValue("block_id") if blockID == "" { httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest) return @@ -1432,7 +1432,7 @@ func (s *Server) GetFinalityCheckpoints(w http.ResponseWriter, r *http.Request) ctx, span := trace.StartSpan(r.Context(), "beacon.GetFinalityCheckpoints") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return diff --git a/beacon-chain/rpc/eth/beacon/handlers_state.go b/beacon-chain/rpc/eth/beacon/handlers_state.go index 6ada905f6dae..5b41597a14be 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_state.go +++ b/beacon-chain/rpc/eth/beacon/handlers_state.go @@ -8,7 +8,6 @@ import ( "strconv" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" @@ -34,7 +33,7 @@ func (s *Server) GetStateRoot(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetStateRoot") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return @@ -85,7 +84,7 @@ func (s *Server) GetRandao(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetRandao") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return @@ -151,7 +150,7 @@ func (s *Server) GetSyncCommittees(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetSyncCommittees") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return diff --git a/beacon-chain/rpc/eth/beacon/handlers_state_test.go b/beacon-chain/rpc/eth/beacon/handlers_state_test.go index 066ab839ee5b..b889576d5cc3 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_state_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_state_test.go @@ -12,7 +12,6 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" @@ -56,7 +55,7 @@ func TestGetStateRoot(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/root", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -80,7 +79,7 @@ func TestGetStateRoot(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/root", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -111,7 +110,7 @@ func TestGetStateRoot(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/root", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -158,7 +157,7 @@ func TestGetRandao(t *testing.T) { t.Run("no epoch requested", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/randao", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -170,7 +169,7 @@ func TestGetRandao(t *testing.T) { }) t.Run("current epoch requested", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com//eth/v1/beacon/states/{state_id}/randao?epoch=%d", epochCurrent), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -182,7 +181,7 @@ func TestGetRandao(t *testing.T) { }) t.Run("old epoch requested", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com//eth/v1/beacon/states/{state_id}/randao?epoch=%d", epochOld), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -198,7 +197,7 @@ func TestGetRandao(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/randao", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -211,7 +210,7 @@ func TestGetRandao(t *testing.T) { t.Run("epoch too old", func(t *testing.T) { epochTooOld := primitives.Epoch(100000 - st.RandaoMixesLength()) request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com//eth/v1/beacon/states/{state_id}/randao?epoch=%d", epochTooOld), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -225,7 +224,7 @@ func TestGetRandao(t *testing.T) { t.Run("epoch in the future", func(t *testing.T) { futureEpoch := primitives.Epoch(100000 + 1) request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com//eth/v1/beacon/states/{state_id}/randao?epoch=%d", futureEpoch), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -257,7 +256,7 @@ func TestGetRandao(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/randao", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -294,7 +293,7 @@ func TestGetRandao(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/randao", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -453,7 +452,7 @@ func TestGetSyncCommittees(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/sync_committees", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": hexutil.Encode(stRoot[:])}) + request.SetPathValue("state_id", hexutil.Encode(stRoot[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -503,7 +502,7 @@ func TestGetSyncCommittees(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/sync_committees", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": hexutil.Encode(stRoot[:])}) + request.SetPathValue("state_id", hexutil.Encode(stRoot[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -547,7 +546,7 @@ func TestGetSyncCommittees(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com//eth/v1/beacon/states/{state_id}/sync_committees", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": hexutil.Encode(stRoot[:])}) + request.SetPathValue("state_id", hexutil.Encode(stRoot[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -613,7 +612,7 @@ func TestGetSyncCommittees_Future(t *testing.T) { epoch := 2 * params.BeaconConfig().EpochsPerSyncCommitteePeriod request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com//eth/v1/beacon/states/{state_id}/sync_committees?epoch=%d", epoch), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} s.GetSyncCommittees(writer, request) @@ -625,7 +624,7 @@ func TestGetSyncCommittees_Future(t *testing.T) { epoch = 2*params.BeaconConfig().EpochsPerSyncCommitteePeriod - 1 request = httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com//eth/v1/beacon/states/{state_id}/sync_committees?epoch=%d", epoch), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer = httptest.NewRecorder() writer.Body = &bytes.Buffer{} s.GetSyncCommittees(writer, request) diff --git a/beacon-chain/rpc/eth/beacon/handlers_test.go b/beacon-chain/rpc/eth/beacon/handlers_test.go index bd3fb3b1ec71..b7c170a005c6 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_test.go @@ -13,7 +13,6 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/api" @@ -96,7 +95,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "123552314"}) + request.SetPathValue("block_id", "123552314") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -118,7 +117,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -151,7 +150,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -185,7 +184,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -219,7 +218,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -253,7 +252,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -287,7 +286,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -314,7 +313,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": hexutil.Encode(r[:])}) + request.SetPathValue("block_id", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -333,7 +332,7 @@ func TestGetBlockV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": hexutil.Encode(r[:])}) + request.SetPathValue("block_id", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -358,7 +357,7 @@ func TestGetBlockSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -381,7 +380,7 @@ func TestGetBlockSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -404,7 +403,7 @@ func TestGetBlockSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -427,7 +426,7 @@ func TestGetBlockSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -450,7 +449,7 @@ func TestGetBlockSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -517,7 +516,7 @@ func TestGetBlockAttestations(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}/attestations", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -551,7 +550,7 @@ func TestGetBlockAttestations(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}/attestations", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -578,7 +577,7 @@ func TestGetBlockAttestations(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}/attestations", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -597,7 +596,7 @@ func TestGetBlockAttestations(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}/attestations", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -622,7 +621,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -651,7 +650,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -682,7 +681,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -713,7 +712,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -744,7 +743,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -777,7 +776,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -803,7 +802,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": hexutil.Encode(root[:])}) + request.SetPathValue("block_id", hexutil.Encode(root[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -829,7 +828,7 @@ func TestGetBlindedBlock(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": hexutil.Encode(root[:])}) + request.SetPathValue("block_id", hexutil.Encode(root[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -852,7 +851,7 @@ func TestGetBlindedBlockSSZ(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -874,7 +873,7 @@ func TestGetBlindedBlockSSZ(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -896,7 +895,7 @@ func TestGetBlindedBlockSSZ(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -918,7 +917,7 @@ func TestGetBlindedBlockSSZ(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -940,7 +939,7 @@ func TestGetBlindedBlockSSZ(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2803,8 +2802,9 @@ func TestServer_GetBlockRoot(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + blockID := tt.blockID request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, tt.blockID) + request.SetPathValue("block_id", blockID["block_id"]) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2847,7 +2847,7 @@ func TestServer_GetBlockRoot(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2882,7 +2882,7 @@ func TestServer_GetBlockRoot(t *testing.T) { } t.Run("true", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "32"}) + request.SetPathValue("block_id", "32") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2894,7 +2894,7 @@ func TestServer_GetBlockRoot(t *testing.T) { }) t.Run("false", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "64"}) + request.SetPathValue("block_id", "64") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2910,7 +2910,7 @@ func TestServer_GetBlockRoot(t *testing.T) { func TestGetStateFork(t *testing.T) { ctx := context.Background() request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/states/{state_id}/fork", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", "application/octet-stream") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2949,7 +2949,7 @@ func TestGetStateFork(t *testing.T) { assert.DeepEqual(t, hexutil.Encode(expectedFork.PreviousVersion), stateForkReponse.Data.PreviousVersion) t.Run("execution optimistic", func(t *testing.T) { request = httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/states/{state_id}/fork", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", "application/octet-stream") writer = httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2980,7 +2980,7 @@ func TestGetStateFork(t *testing.T) { t.Run("finalized", func(t *testing.T) { request = httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/states/{state_id}/fork", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", "application/octet-stream") writer = httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3038,7 +3038,7 @@ func TestGetCommittees(t *testing.T) { t.Run("Head all committees", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3059,7 +3059,7 @@ func TestGetCommittees(t *testing.T) { t.Run("Head all committees of epoch 10", func(t *testing.T) { query := url + "?epoch=10" request := httptest.NewRequest(http.MethodGet, query, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3076,7 +3076,7 @@ func TestGetCommittees(t *testing.T) { t.Run("Head all committees of slot 4", func(t *testing.T) { query := url + "?slot=4" request := httptest.NewRequest(http.MethodGet, query, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3102,7 +3102,7 @@ func TestGetCommittees(t *testing.T) { t.Run("Head all committees of index 1", func(t *testing.T) { query := url + "?index=1" request := httptest.NewRequest(http.MethodGet, query, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3128,7 +3128,7 @@ func TestGetCommittees(t *testing.T) { t.Run("Head all committees of slot 2, index 1", func(t *testing.T) { query := url + "?slot=2&index=1" request := httptest.NewRequest(http.MethodGet, query, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3171,7 +3171,7 @@ func TestGetCommittees(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3208,7 +3208,7 @@ func TestGetCommittees(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3481,7 +3481,7 @@ func TestServer_GetBlockHeader(t *testing.T) { t.Run("ok", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/headers/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3525,7 +3525,7 @@ func TestServer_GetBlockHeader(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/headers/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": "head"}) + request.SetPathValue("block_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3549,7 +3549,7 @@ func TestServer_GetBlockHeader(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/headers/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": hexutil.Encode(r[:])}) + request.SetPathValue("block_id", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3569,7 +3569,7 @@ func TestServer_GetBlockHeader(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/headers/{block_id}", nil) - request = mux.SetURLVars(request, map[string]string{"block_id": hexutil.Encode(r[:])}) + request.SetPathValue("block_id", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3621,7 +3621,7 @@ func TestGetFinalityCheckpoints(t *testing.T) { t.Run("ok", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "/eth/v1/beacon/states/{state_id}/finality_checkpoints", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3651,7 +3651,7 @@ func TestGetFinalityCheckpoints(t *testing.T) { }) t.Run("state not found", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "/eth/v1/beacon/states/{state_id}/finality_checkpoints", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "foobar"}) + request.SetPathValue("state_id", "foobar") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3674,7 +3674,7 @@ func TestGetFinalityCheckpoints(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "/eth/v1/beacon/states/{state_id}/finality_checkpoints", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -3702,7 +3702,7 @@ func TestGetFinalityCheckpoints(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "/eth/v1/beacon/states/{state_id}/finality_checkpoints", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/eth/beacon/handlers_validator.go b/beacon-chain/rpc/eth/beacon/handlers_validator.go index d14fd6bf87ea..82782415abe8 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_validator.go +++ b/beacon-chain/rpc/eth/beacon/handlers_validator.go @@ -9,7 +9,6 @@ import ( "strings" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" @@ -30,7 +29,7 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidators") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return @@ -179,12 +178,12 @@ func (s *Server) GetValidator(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidator") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return } - valId := mux.Vars(r)["validator_id"] + valId := r.PathValue("validator_id") if valId == "" { httputil.HandleError(w, "validator_id is required in URL params", http.StatusBadRequest) return @@ -244,7 +243,7 @@ func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidatorBalances") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return diff --git a/beacon-chain/rpc/eth/beacon/handlers_validators_test.go b/beacon-chain/rpc/eth/beacon/handlers_validators_test.go index 10f562f4d8ee..d6051a48a963 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_validators_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_validators_test.go @@ -11,7 +11,6 @@ import ( "testing" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" @@ -47,7 +46,7 @@ func TestGetValidators(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -86,7 +85,7 @@ func TestGetValidators(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators?id=0&id=1", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -118,7 +117,7 @@ func TestGetValidators(t *testing.T) { fmt.Sprintf("http://example.com/eth/v1/beacon/states/{state_id}/validators?id=%s&id=%s", hexPubkey1, hexPubkey2), nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -148,7 +147,7 @@ func TestGetValidators(t *testing.T) { fmt.Sprintf("http://example.com/eth/v1/beacon/states/{state_id}/validators?id=%s&id=1", hexPubkey), nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -197,7 +196,7 @@ func TestGetValidators(t *testing.T) { fmt.Sprintf("http://example.com/eth/v1/beacon/states/{state_id}/validators?id=%s&id=%s", hexPubkey, hexutil.Encode([]byte(strings.Repeat("x", fieldparams.BLSPubkeyLength)))), nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -220,7 +219,7 @@ func TestGetValidators(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators?id=1&id=99999", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -243,7 +242,7 @@ func TestGetValidators(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -271,7 +270,7 @@ func TestGetValidators(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -306,7 +305,7 @@ func TestGetValidators(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators", &body, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -342,7 +341,7 @@ func TestGetValidators(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators", &body, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -368,7 +367,7 @@ func TestGetValidators(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -398,7 +397,7 @@ func TestGetValidators(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators", &body, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -492,7 +491,7 @@ func TestGetValidators_FilterByStatus(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators?status=active", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -523,7 +522,7 @@ func TestGetValidators_FilterByStatus(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators?status=active_ongoing", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -553,7 +552,7 @@ func TestGetValidators_FilterByStatus(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators?status=exited", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -586,7 +585,7 @@ func TestGetValidators_FilterByStatus(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators?status=pending_initialized&status=exited_unslashed", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -619,7 +618,7 @@ func TestGetValidators_FilterByStatus(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validators?status=pending&status=exited_slashed", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -654,7 +653,8 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head", "validator_id": "0"}) + request.SetPathValue("state_id", "head") + request.SetPathValue("validator_id", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -689,7 +689,8 @@ func TestGetValidator(t *testing.T) { pubKey := st.PubkeyAtIndex(primitives.ValidatorIndex(0)) hexPubkey := hexutil.Encode(pubKey[:]) request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head", "validator_id": hexPubkey}) + request.SetPathValue("state_id", "head") + request.SetPathValue("validator_id", hexPubkey) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -708,7 +709,7 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"validator_id": "1"}) + request.SetPathValue("validator_id", "1") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -728,7 +729,7 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -748,7 +749,8 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head", "validator_id": "99999"}) + request.SetPathValue("state_id", "head") + request.SetPathValue("validator_id", "99999") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -768,7 +770,8 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head", "validator_id": hexutil.Encode([]byte(strings.Repeat("x", fieldparams.BLSPubkeyLength)))}) + request.SetPathValue("state_id", "head") + request.SetPathValue("validator_id", hexutil.Encode([]byte(strings.Repeat("x", fieldparams.BLSPubkeyLength)))) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -791,7 +794,8 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head", "validator_id": "0"}) + request.SetPathValue("state_id", "head") + request.SetPathValue("validator_id", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -819,7 +823,8 @@ func TestGetValidator(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validators/{validator_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head", "validator_id": "0"}) + request.SetPathValue("state_id", "head") + request.SetPathValue("validator_id", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -853,7 +858,7 @@ func TestGetValidatorBalances(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -882,7 +887,7 @@ func TestGetValidatorBalances(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances?id=0&id=1", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -914,7 +919,7 @@ func TestGetValidatorBalances(t *testing.T) { fmt.Sprintf("http://example.com/eth/v1/beacon/states/{state_id}/validator_balances?id=%s&id=%s", hexPubkey1, hexPubkey2), nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -944,7 +949,7 @@ func TestGetValidatorBalances(t *testing.T) { fmt.Sprintf("http://example.com/eth/v1/beacon/states/{state_id}/validators?id=%s&id=1", hexPubkey), nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -974,7 +979,7 @@ func TestGetValidatorBalances(t *testing.T) { fmt.Sprintf("http://example.com/eth/v1/beacon/states/{state_id}/validator_balances?id=%s&id=%s", hexPubkey, hexutil.Encode([]byte(strings.Repeat("x", fieldparams.BLSPubkeyLength)))), nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -997,7 +1002,7 @@ func TestGetValidatorBalances(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances?id=1&id=99999", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1043,7 +1048,7 @@ func TestGetValidatorBalances(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances?id=0", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1075,7 +1080,7 @@ func TestGetValidatorBalances(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances?id=0", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1108,7 +1113,7 @@ func TestGetValidatorBalances(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances", &body, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1136,7 +1141,7 @@ func TestGetValidatorBalances(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances", nil, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1166,7 +1171,7 @@ func TestGetValidatorBalances(t *testing.T) { "http://example.com/eth/v1/beacon/states/{state_id}/validator_balances", &body, ) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/eth/builder/BUILD.bazel b/beacon-chain/rpc/eth/builder/BUILD.bazel index 8d8f8d43f80c..dd0663e2dda0 100644 --- a/beacon-chain/rpc/eth/builder/BUILD.bazel +++ b/beacon-chain/rpc/eth/builder/BUILD.bazel @@ -20,7 +20,6 @@ go_library( "//proto/engine/v1:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", ], ) @@ -44,6 +43,5 @@ go_test( "//testing/util:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/builder/handlers.go b/beacon-chain/rpc/eth/builder/handlers.go index d175d798522b..de0ad592f402 100644 --- a/beacon-chain/rpc/eth/builder/handlers.go +++ b/beacon-chain/rpc/eth/builder/handlers.go @@ -6,7 +6,6 @@ import ( "strconv" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" @@ -21,7 +20,7 @@ import ( // ExpectedWithdrawals get the withdrawals computed from the specified state, that will be included in the block that gets built on the specified state. func (s *Server) ExpectedWithdrawals(w http.ResponseWriter, r *http.Request) { // Retrieve beacon state - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.WriteError(w, &httputil.DefaultJsonError{ Message: "state_id is required in URL params", diff --git a/beacon-chain/rpc/eth/builder/handlers_test.go b/beacon-chain/rpc/eth/builder/handlers_test.go index 120a3d3eab05..1a26384f5baa 100644 --- a/beacon-chain/rpc/eth/builder/handlers_test.go +++ b/beacon-chain/rpc/eth/builder/handlers_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" @@ -91,7 +90,7 @@ func TestExpectedWithdrawals_BadRequest(t *testing.T) { Stater: &testutil.MockStater{BeaconState: testCase.state}, } request := httptest.NewRequest("GET", testCase.path, nil) - request = mux.SetURLVars(request, testCase.urlParams) + request.SetPathValue("state_id", testCase.urlParams["state_id"]) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -172,7 +171,7 @@ func TestExpectedWithdrawals(t *testing.T) { request := httptest.NewRequest( "GET", "/eth/v1/builder/states/{state_id}/expected_withdrawals?proposal_slot="+ strconv.FormatUint(uint64(currentSlot+params.BeaconConfig().SlotsPerEpoch), 10), nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/eth/debug/BUILD.bazel b/beacon-chain/rpc/eth/debug/BUILD.bazel index 4ec4ce801693..9cedc643277d 100644 --- a/beacon-chain/rpc/eth/debug/BUILD.bazel +++ b/beacon-chain/rpc/eth/debug/BUILD.bazel @@ -19,7 +19,6 @@ go_library( "//network/httputil:go_default_library", "//runtime/version:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], ) @@ -42,6 +41,5 @@ go_test( "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/debug/handlers.go b/beacon-chain/rpc/eth/debug/handlers.go index 49741eb67439..f2199dc43ff5 100644 --- a/beacon-chain/rpc/eth/debug/handlers.go +++ b/beacon-chain/rpc/eth/debug/handlers.go @@ -7,7 +7,6 @@ import ( "net/http" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" @@ -24,7 +23,7 @@ func (s *Server) GetBeaconStateV2(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "debug.GetBeaconStateV2") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return diff --git a/beacon-chain/rpc/eth/debug/handlers_test.go b/beacon-chain/rpc/eth/debug/handlers_test.go index eee70e3e9994..35f83e593ba2 100644 --- a/beacon-chain/rpc/eth/debug/handlers_test.go +++ b/beacon-chain/rpc/eth/debug/handlers_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" blockchainmock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" @@ -43,7 +42,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -71,7 +70,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -99,7 +98,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -127,7 +126,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -155,7 +154,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -191,7 +190,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -230,7 +229,7 @@ func TestGetBeaconStateV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -255,7 +254,7 @@ func TestGetBeaconStateSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -279,7 +278,7 @@ func TestGetBeaconStateSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -303,7 +302,7 @@ func TestGetBeaconStateSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -327,7 +326,7 @@ func TestGetBeaconStateSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -351,7 +350,7 @@ func TestGetBeaconStateSSZV2(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index 04848190b738..4d41cdc89c09 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -32,7 +32,6 @@ go_library( "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_wealdtech_go_bytesutil//:go_default_library", "@io_opencensus_go//trace:go_default_library", @@ -66,6 +65,5 @@ go_test( "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 33f07cf214e2..410664dfc4aa 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -7,7 +7,6 @@ import ( "net/http" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" @@ -29,7 +28,7 @@ func (s *Server) GetLightClientBootstrap(w http.ResponseWriter, req *http.Reques defer span.End() // Get the block - blockRootParam, err := hexutil.Decode(mux.Vars(req)["block_root"]) + blockRootParam, err := hexutil.Decode(req.PathValue("block_root")) if err != nil { httputil.HandleError(w, "invalid block root: "+err.Error(), http.StatusBadRequest) return diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index 807afd578a8d..245def3d2218 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" @@ -61,10 +60,8 @@ func TestLightClientHandler_GetLightClientBootstrap_Altair(t *testing.T) { Blocker: mockBlocker, HeadFetcher: mockChainService, } - muxVars := make(map[string]string) - muxVars["block_root"] = hexutil.Encode(r[:]) request := httptest.NewRequest("GET", "http://foo.com/", nil) - request = mux.SetURLVars(request, muxVars) + request.SetPathValue("block_root", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -116,10 +113,8 @@ func TestLightClientHandler_GetLightClientBootstrap_Capella(t *testing.T) { Blocker: mockBlocker, HeadFetcher: mockChainService, } - muxVars := make(map[string]string) - muxVars["block_root"] = hexutil.Encode(r[:]) request := httptest.NewRequest("GET", "http://foo.com/", nil) - request = mux.SetURLVars(request, muxVars) + request.SetPathValue("block_root", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -171,10 +166,8 @@ func TestLightClientHandler_GetLightClientBootstrap_Deneb(t *testing.T) { Blocker: mockBlocker, HeadFetcher: mockChainService, } - muxVars := make(map[string]string) - muxVars["block_root"] = hexutil.Encode(r[:]) request := httptest.NewRequest("GET", "http://foo.com/", nil) - request = mux.SetURLVars(request, muxVars) + request.SetPathValue("block_root", hexutil.Encode(r[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/eth/node/BUILD.bazel b/beacon-chain/rpc/eth/node/BUILD.bazel index e0ee146f73c5..4f5b75990394 100644 --- a/beacon-chain/rpc/eth/node/BUILD.bazel +++ b/beacon-chain/rpc/eth/node/BUILD.bazel @@ -25,7 +25,6 @@ go_library( "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", @@ -58,7 +57,6 @@ go_test( "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enode:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enr:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_libp2p_go_libp2p//core/network:go_default_library", "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_libp2p_go_libp2p//p2p/host/peerstore/test:go_default_library", diff --git a/beacon-chain/rpc/eth/node/handlers_peers.go b/beacon-chain/rpc/eth/node/handlers_peers.go index 571a4c934000..9dbbcd5baf5f 100644 --- a/beacon-chain/rpc/eth/node/handlers_peers.go +++ b/beacon-chain/rpc/eth/node/handlers_peers.go @@ -5,7 +5,6 @@ import ( "strconv" "strings" - "github.com/gorilla/mux" "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" @@ -23,7 +22,7 @@ func (s *Server) GetPeer(w http.ResponseWriter, r *http.Request) { _, span := trace.StartSpan(r.Context(), "node.GetPeer") defer span.End() - rawId := mux.Vars(r)["peer_id"] + rawId := r.PathValue("peer_id") if rawId == "" { httputil.HandleError(w, "peer_id is required in URL params", http.StatusBadRequest) return diff --git a/beacon-chain/rpc/eth/node/handlers_peers_test.go b/beacon-chain/rpc/eth/node/handlers_peers_test.go index 753c1e5b3158..8aa04c0166dc 100644 --- a/beacon-chain/rpc/eth/node/handlers_peers_test.go +++ b/beacon-chain/rpc/eth/node/handlers_peers_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/gorilla/mux" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" libp2ptest "github.com/libp2p/go-libp2p/p2p/host/peerstore/test" @@ -43,7 +42,7 @@ func TestGetPeer(t *testing.T) { t.Run("OK", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/peers/{peer_id}", nil) - request = mux.SetURLVars(request, map[string]string{"peer_id": rawId}) + request.SetPathValue("peer_id", rawId) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -60,7 +59,7 @@ func TestGetPeer(t *testing.T) { t.Run("Invalid ID", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/peers/{peer_id}", nil) - request = mux.SetURLVars(request, map[string]string{"peer_id": "foo"}) + request.SetPathValue("peer_id", "foo") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -74,7 +73,7 @@ func TestGetPeer(t *testing.T) { t.Run("Peer not found", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/node/peers/{peer_id}", nil) - request = mux.SetURLVars(request, map[string]string{"peer_id": "16Uiu2HAmQqFdEcHbSmQTQuLoAhnMUrgoWoraKK4cUJT6FuuqHqTU"}) + request.SetPathValue("peer_id", "16Uiu2HAmQqFdEcHbSmQTQuLoAhnMUrgoWoraKK4cUJT6FuuqHqTU") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/eth/shared/BUILD.bazel b/beacon-chain/rpc/eth/shared/BUILD.bazel index 78c012169402..1fbfb4754f29 100644 --- a/beacon-chain/rpc/eth/shared/BUILD.bazel +++ b/beacon-chain/rpc/eth/shared/BUILD.bazel @@ -17,7 +17,6 @@ go_library( "//consensus-types/interfaces:go_default_library", "//network/httputil:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/shared/request.go b/beacon-chain/rpc/eth/shared/request.go index ad781fa7134a..1609c0d8f597 100644 --- a/beacon-chain/rpc/eth/shared/request.go +++ b/beacon-chain/rpc/eth/shared/request.go @@ -9,7 +9,6 @@ import ( "strings" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" @@ -29,7 +28,7 @@ func UintFromQuery(w http.ResponseWriter, r *http.Request, name string, required } func UintFromRoute(w http.ResponseWriter, r *http.Request, name string) (string, uint64, bool) { - raw := mux.Vars(r)[name] + raw := r.PathValue(name) v, valid := ValidateUint(w, name, raw) if !valid { return "", 0, false @@ -50,7 +49,7 @@ func HexFromQuery(w http.ResponseWriter, r *http.Request, name string, length in } func HexFromRoute(w http.ResponseWriter, r *http.Request, name string, length int) (string, []byte, bool) { - raw := mux.Vars(r)[name] + raw := r.PathValue(name) v, valid := ValidateHex(w, name, raw, length) if !valid { return "", nil, false diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 38b3dcabb96e..3d0a74174ddf 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -92,7 +92,6 @@ go_test( "//testing/util:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@org_uber_go_mock//gomock:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 47cfa9ba6cc0..0aa758fe48b8 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -13,7 +13,6 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" @@ -1464,7 +1463,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err = body.WriteString("[\"0\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1488,7 +1487,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err = body.WriteString("[\"0\",\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1500,7 +1499,7 @@ func TestGetAttesterDuties(t *testing.T) { }) t.Run("no body", func(t *testing.T) { request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1516,7 +1515,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err := body.WriteString("[]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1532,7 +1531,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err := body.WriteString("[\"foo\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1547,7 +1546,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err = body.WriteString("[\"0\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(slots.ToEpoch(bs.Slot())+1), 10)}) + request.SetPathValue("epoch", strconv.FormatUint(uint64(slots.ToEpoch(bs.Slot())+1), 10)) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1572,7 +1571,7 @@ func TestGetAttesterDuties(t *testing.T) { require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) currentEpoch := slots.ToEpoch(bs.Slot()) - request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(currentEpoch+2), 10)}) + request.SetPathValue("epoch", strconv.FormatUint(uint64(currentEpoch+2), 10)) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1588,7 +1587,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err = body.WriteString(fmt.Sprintf("[\"%d\"]", len(pubKeys))) require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1604,7 +1603,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err = body.WriteString(fmt.Sprintf("[\"%d\"]", len(pubKeys)-1)) require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1642,7 +1641,7 @@ func TestGetAttesterDuties(t *testing.T) { _, err = body.WriteString("[\"0\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1664,7 +1663,7 @@ func TestGetAttesterDuties(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1721,7 +1720,7 @@ func TestGetProposerDuties(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1763,7 +1762,7 @@ func TestGetProposerDuties(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "1"}) + request.SetPathValue("epoch", "1") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1807,7 +1806,7 @@ func TestGetProposerDuties(t *testing.T) { currentEpoch := slots.ToEpoch(bs.Slot()) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(currentEpoch+2), 10)}) + request.SetPathValue("epoch", strconv.FormatUint(uint64(currentEpoch+2), 10)) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1845,7 +1844,7 @@ func TestGetProposerDuties(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1867,7 +1866,7 @@ func TestGetProposerDuties(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1923,7 +1922,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1946,7 +1945,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"1\",\"2\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1958,7 +1957,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { }) t.Run("no body", func(t *testing.T) { request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1974,7 +1973,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -1990,7 +1989,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"foo\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2005,7 +2004,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"1\",\"10\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2021,7 +2020,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"0\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2038,7 +2037,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString(fmt.Sprintf("[\"%d\"]", numVals)) require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2054,7 +2053,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"5\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod), 10)}) + request.SetPathValue("epoch", strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod), 10)) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2111,7 +2110,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"8\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod), 10)}) + request.SetPathValue("epoch", strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod), 10)) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2131,7 +2130,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "1"}) + request.SetPathValue("epoch", "1") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2151,7 +2150,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err := body.WriteString("[\"5\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod*2), 10)}) + request.SetPathValue("epoch", strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod*2), 10)) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2207,7 +2206,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { _, err = body.WriteString("[\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "1"}) + request.SetPathValue("epoch", "1") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2229,7 +2228,7 @@ func TestGetSyncCommitteeDuties(t *testing.T) { } request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "1"}) + request.SetPathValue("epoch", "1") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2453,7 +2452,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[\"0\",\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2472,7 +2471,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[\"0\",\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "1"}) + request.SetPathValue("epoch", "1") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2491,7 +2490,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[\"0\",\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "2"}) + request.SetPathValue("epoch", "2") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2510,7 +2509,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[\"0\",\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "3"}) + request.SetPathValue("epoch", "3") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2541,7 +2540,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[\"0\",\"1\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "foo"}) + request.SetPathValue("epoch", "foo") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2554,7 +2553,7 @@ func TestGetLiveness(t *testing.T) { }) t.Run("no body", func(t *testing.T) { request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", nil) - request = mux.SetURLVars(request, map[string]string{"epoch": "3"}) + request.SetPathValue("epoch", "3") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2570,7 +2569,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "3"}) + request.SetPathValue("epoch", "3") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -2586,7 +2585,7 @@ func TestGetLiveness(t *testing.T) { _, err := body.WriteString("[\"0\",\"1\",\"2\"]") require.NoError(t, err) request := httptest.NewRequest(http.MethodPost, "http://example.com/eth/v1/validator/liveness/{epoch}", &body) - request = mux.SetURLVars(request, map[string]string{"epoch": "0"}) + request.SetPathValue("epoch", "0") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/prysm/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/beacon/BUILD.bazel index d92fb3f9516b..e6528e11d9b6 100644 --- a/beacon-chain/rpc/prysm/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/beacon/BUILD.bazel @@ -29,7 +29,6 @@ go_library( "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], @@ -67,7 +66,6 @@ go_test( "//testing/util:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/beacon/validator_count.go b/beacon-chain/rpc/prysm/beacon/validator_count.go index ba9b6f744f8a..b537532db874 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count.go @@ -7,7 +7,6 @@ import ( "strconv" "strings" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" @@ -53,7 +52,7 @@ func (s *Server) GetValidatorCount(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidatorCount") defer span.End() - stateID := mux.Vars(r)["state_id"] + stateID := r.PathValue("state_id") isOptimistic, err := helpers.IsOptimistic(ctx, []byte(stateID), s.OptimisticModeFetcher, s.Stater, s.ChainInfoFetcher, s.BeaconDB) if err != nil { diff --git a/beacon-chain/rpc/prysm/beacon/validator_count_test.go b/beacon-chain/rpc/prysm/beacon/validator_count_test.go index 7d4f9b330186..0a6fe91ca221 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count_test.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count_test.go @@ -12,7 +12,6 @@ import ( "strings" "testing" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" @@ -85,7 +84,7 @@ func TestGetValidatorCountInvalidRequest(t *testing.T) { Stater: test.stater, } - testRouter := mux.NewRouter() + testRouter := http.NewServeMux() testRouter.HandleFunc("/eth/v1/beacon/states/{state_id}/validator_count", server.GetValidatorCount) s := httptest.NewServer(testRouter) defer s.Close() @@ -465,7 +464,7 @@ func TestGetValidatorCount(t *testing.T) { }, } - testRouter := mux.NewRouter() + testRouter := http.NewServeMux() testRouter.HandleFunc("/eth/v1/beacon/states/{state_id}/validator_count", server.GetValidatorCount) s := httptest.NewServer(testRouter) defer s.Close() diff --git a/beacon-chain/rpc/prysm/validator/BUILD.bazel b/beacon-chain/rpc/prysm/validator/BUILD.bazel index 86cdf38192b0..f5db607d650e 100644 --- a/beacon-chain/rpc/prysm/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/validator/BUILD.bazel @@ -21,7 +21,6 @@ go_library( "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], @@ -64,7 +63,6 @@ go_test( "//time:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/validator/handlers.go b/beacon-chain/rpc/prysm/validator/handlers.go index 4c48a8708876..19feb7491b78 100644 --- a/beacon-chain/rpc/prysm/validator/handlers.go +++ b/beacon-chain/rpc/prysm/validator/handlers.go @@ -5,7 +5,6 @@ import ( "net/http" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" @@ -22,7 +21,7 @@ func (s *Server) GetParticipation(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.GetParticipation") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return @@ -67,7 +66,7 @@ func (s *Server) GetActiveSetChanges(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.GetActiveSetChanges") defer span.End() - stateId := mux.Vars(r)["state_id"] + stateId := r.PathValue("state_id") if stateId == "" { httputil.HandleError(w, "state_id is required in URL params", http.StatusBadRequest) return diff --git a/beacon-chain/rpc/prysm/validator/handlers_test.go b/beacon-chain/rpc/prysm/validator/handlers_test.go index 9956926e54e9..0d84df4c1b9e 100644 --- a/beacon-chain/rpc/prysm/validator/handlers_test.go +++ b/beacon-chain/rpc/prysm/validator/handlers_test.go @@ -13,7 +13,6 @@ import ( "time" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/api/server/structs" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" @@ -150,7 +149,7 @@ func TestServer_GetValidatorParticipation_CurrentAndPrevEpoch(t *testing.T) { url := "http://example.com" request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -250,7 +249,7 @@ func TestServer_GetValidatorParticipation_OrphanedUntilGenesis(t *testing.T) { url := "http://example.com" request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -380,7 +379,7 @@ func runGetValidatorParticipationCurrentEpoch(t *testing.T, genState state.Beaco url := "http://example.com" request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "head"}) + request.SetPathValue("state_id", "head") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -430,7 +429,7 @@ func TestServer_GetValidatorActiveSetChanges_NoState(t *testing.T) { url := "http://example.com" + fmt.Sprintf("%d", slots.ToEpoch(s.CoreService.GenesisTimeFetcher.CurrentSlot())+1) request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": ""}) + request.SetPathValue("state_id", "") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -507,7 +506,7 @@ func TestServer_GetValidatorActiveSetChanges(t *testing.T) { url := "http://example.com" request := httptest.NewRequest(http.MethodGet, url, nil) - request = mux.SetURLVars(request, map[string]string{"state_id": "genesis"}) + request.SetPathValue("state_id", "genesis") writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 335b60e0ad38..7ac82e1d3eaa 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -4,10 +4,11 @@ package rpc import ( "context" + "fmt" "net" + "net/http" "sync" - "github.com/gorilla/mux" middleware "github.com/grpc-ecosystem/go-grpc-middleware" recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" @@ -134,7 +135,7 @@ type Config struct { ExecutionEngineCaller execution.EngineCaller OptimisticModeFetcher blockchain.OptimisticModeFetcher BlockBuilder builder.BlockBuilder - Router *mux.Router + Router *http.ServeMux ClockWaiter startup.ClockWaiter BlobStorage *filesystem.BlobStorage TrackedValidatorsCache *cache.TrackedValidatorsCache @@ -309,10 +310,12 @@ func NewService(ctx context.Context, cfg *Config) *Service { endpoints := s.endpoints(s.cfg.EnableDebugRPCEndpoints, blocker, stater, rewardFetcher, validatorServer, coreService, ch) for _, e := range endpoints { - s.cfg.Router.HandleFunc( - e.template, - e.handlerWithMiddleware(), - ).Methods(e.methods...) + for i := range e.methods { + s.cfg.Router.HandleFunc( + fmt.Sprintf("%s %s", e.methods[i], e.template), + e.handlerWithMiddleware(), + ) + } } ethpbv1alpha1.RegisterNodeServer(s.grpcServer, nodeServer) diff --git a/beacon-chain/rpc/service_test.go b/beacon-chain/rpc/service_test.go index 13d8e2fde61f..4cd599c41913 100644 --- a/beacon-chain/rpc/service_test.go +++ b/beacon-chain/rpc/service_test.go @@ -4,10 +4,10 @@ import ( "context" "errors" "io" + "net/http" "testing" "time" - "github.com/gorilla/mux" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" @@ -49,7 +49,7 @@ func TestLifecycle_OK(t *testing.T) { GenesisTimeFetcher: chainService, ExecutionChainService: &mockExecution.Chain{}, StateNotifier: chainService.StateNotifier(), - Router: mux.NewRouter(), + Router: http.NewServeMux(), ClockWaiter: startup.NewClockSynchronizer(), }) @@ -91,7 +91,7 @@ func TestRPC_InsecureEndpoint(t *testing.T) { HeadFetcher: chainService, ExecutionChainService: &mockExecution.Chain{}, StateNotifier: chainService.StateNotifier(), - Router: mux.NewRouter(), + Router: http.NewServeMux(), ClockWaiter: startup.NewClockSynchronizer(), }) diff --git a/deps.bzl b/deps.bzl index cd363c82bf14..b1514e34561b 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1380,12 +1380,6 @@ def prysm_deps(): sum = "h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=", version = "v1.0.0", ) - go_repository( - name = "com_github_gorilla_mux", - importpath = "github.com/gorilla/mux", - sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", - version = "v1.8.0", - ) go_repository( name = "com_github_gorilla_websocket", importpath = "github.com/gorilla/websocket", diff --git a/go.mod b/go.mod index 19a28a16ffc1..d97112bd0420 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,6 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/google/uuid v1.4.0 - github.com/gorilla/mux v1.8.0 github.com/gostaticanalysis/comment v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 diff --git a/go.sum b/go.sum index 18b359a993ba..9554c497ba70 100644 --- a/go.sum +++ b/go.sum @@ -457,7 +457,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= diff --git a/testing/middleware/builder/BUILD.bazel b/testing/middleware/builder/BUILD.bazel index 349fd15d4fd8..29de48ea4450 100644 --- a/testing/middleware/builder/BUILD.bazel +++ b/testing/middleware/builder/BUILD.bazel @@ -28,7 +28,6 @@ go_library( "@com_github_ethereum_go_ethereum//core/types:go_default_library", "@com_github_ethereum_go_ethereum//rpc:go_default_library", "@com_github_ethereum_go_ethereum//trie:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", ], diff --git a/testing/middleware/builder/builder.go b/testing/middleware/builder/builder.go index a0ed717c0fd3..67c927edae4d 100644 --- a/testing/middleware/builder/builder.go +++ b/testing/middleware/builder/builder.go @@ -21,7 +21,6 @@ import ( gethTypes "github.com/ethereum/go-ethereum/core/types" gethRPC "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" - gMux "github.com/gorilla/mux" builderAPI "github.com/prysmaticlabs/prysm/v5/api/client/builder" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" @@ -111,7 +110,7 @@ type Builder struct { prevBeaconRoot []byte currPayload interfaces.ExecutionData blobBundle *v1.BlobsBundle - mux *gMux.Router + mux *http.ServeMux validatorMap map[string]*eth.ValidatorRegistrationV1 valLock sync.RWMutex srv *http.Server @@ -141,9 +140,8 @@ func New(opts ...Option) (*Builder, error) { if err != nil { return nil, err } - mux := http.NewServeMux() - mux.Handle("/", p) - router := gMux.NewRouter() + router := http.NewServeMux() + router.Handle("/", p) router.HandleFunc(statusPath, func(writer http.ResponseWriter, request *http.Request) { writer.WriteHeader(http.StatusOK) }) @@ -152,7 +150,7 @@ func New(opts ...Option) (*Builder, error) { router.HandleFunc(blindedPath, p.handleBlindedBlock) addr := net.JoinHostPort(p.cfg.builderHost, strconv.Itoa(p.cfg.builderPort)) srv := &http.Server{ - Handler: mux, + Handler: router, Addr: addr, ReadHeaderTimeout: time.Second, } @@ -303,13 +301,12 @@ func (p *Builder) registerValidators(w http.ResponseWriter, req *http.Request) { } func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request) { - urlParams := gMux.Vars(req) - pHash := urlParams["parent_hash"] + pHash := req.PathValue("parent_hash") if pHash == "" { http.Error(w, "no valid parent hash", http.StatusBadRequest) return } - reqSlot := urlParams["slot"] + reqSlot := req.PathValue("slot") if reqSlot == "" { http.Error(w, "no valid slot provided", http.StatusBadRequest) return diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 58c2016c79bd..8a27ab47fa31 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -60,7 +60,6 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/keymanager/remote-web3signer:go_default_library", "//validator/rpc:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index 7301057001d7..0e63087d7883 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -6,6 +6,7 @@ package node import ( "context" "fmt" + "net/http" "net/url" "os" "os/signal" @@ -16,7 +17,6 @@ import ( "syscall" "time" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" @@ -112,7 +112,7 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { } // initialize router used for endpoints - router := newRouter(cliCtx) + router := http.NewServeMux() // If the --web flag is enabled to administer the validator // client via a web portal, we start the validator client in a different way. // Change Web flag name to enable keymanager API, look at merging initializeFromCLI and initializeForWeb maybe after WebUI DEPRECATED. @@ -134,19 +134,6 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { return validatorClient, nil } -func newRouter(cliCtx *cli.Context) *mux.Router { - var allowedOrigins []string - if cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") - } else { - allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") - } - r := mux.NewRouter() - r.Use(middleware.NormalizeQueryValuesHandler) - r.Use(middleware.CorsHandler(allowedOrigins)) - return r -} - // Start every service in the validator client. func (c *ValidatorClient) Start() { c.lock.Lock() @@ -242,7 +229,7 @@ func (c *ValidatorClient) getLegacyDatabaseLocation( return dataDir, dataFile, nil } -func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Router) error { +func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *http.ServeMux) error { isInteropNumValidatorsSet := cliCtx.IsSet(flags.InteropNumValidators.Name) isWeb3SignerURLFlagSet := cliCtx.IsSet(flags.Web3SignerURLFlag.Name) @@ -286,7 +273,7 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Rou return nil } -func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context, router *mux.Router) error { +func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context, router *http.ServeMux) error { if cliCtx.IsSet(flags.Web3SignerURLFlag.Name) { // Custom Check For Web3Signer c.wallet = wallet.NewWalletForWeb3Signer(cliCtx) @@ -581,7 +568,7 @@ func proposerSettings(cliCtx *cli.Context, db iface.ValidatorDB) (*proposer.Sett return l.Load(cliCtx) } -func (c *ValidatorClient) registerRPCService(router *mux.Router) error { +func (c *ValidatorClient) registerRPCService(router *http.ServeMux) error { var vs *client.ValidatorService if err := c.services.FetchService(&vs); err != nil { return err @@ -604,7 +591,17 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { ) } port := c.cliCtx.Int(flags.HTTPServerPort.Name) + var allowedOrigins []string + if c.cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(c.cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") + } else { + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") + } + middlewares := []middleware.Middleware{ + middleware.NormalizeQueryValuesHandler, + middleware.CorsHandler(allowedOrigins), + } s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ HTTPHost: host, HTTPPort: port, @@ -622,6 +619,7 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { WalletInitializedFeed: c.walletInitializedFeed, ValidatorService: vs, AuthTokenPath: authTokenPath, + Middlewares: middlewares, Router: router, }) return c.services.RegisterService(s) diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 999c04e854ab..43c039ec9121 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -27,6 +27,7 @@ go_library( "//api/pagination:go_default_library", "//api/server:go_default_library", "//api/server/httprest:go_default_library", + "//api/server/middleware:go_default_library", "//api/server/structs:go_default_library", "//async/event:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", @@ -68,7 +69,6 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_fsnotify_fsnotify//:go_default_library", "@com_github_golang_jwt_jwt_v4//:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//retry:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//tracing/opentracing:go_default_library", @@ -141,7 +141,6 @@ go_test( "@com_github_golang_jwt_jwt_v4//:go_default_library", "@com_github_golang_protobuf//ptypes/empty", "@com_github_google_uuid//:go_default_library", - "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index e55b5b94d992..925775359909 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -16,7 +16,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" @@ -839,7 +838,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { require.NoError(t, tt.mockSetup(s)) } req := httptest.NewRequest("POST", fmt.Sprintf("/eth/v1/validator/{pubkey}/voluntary_exit?epoch=%s", tt.epoch), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": tt.pubkey}) + req.SetPathValue("pubkey", tt.pubkey) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} @@ -859,7 +858,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { tt.w.epoch, err = client.CurrentEpoch(genesisResponse.GenesisTime) require.NoError(t, err) req2 := httptest.NewRequest("POST", fmt.Sprintf("/eth/v1/validator/{pubkey}/voluntary_exit?epoch=%s", tt.epoch), nil) - req2 = mux.SetURLVars(req2, map[string]string{"pubkey": hexutil.Encode(pubKeys[0][:])}) + req2.SetPathValue("pubkey", hexutil.Encode(pubKeys[0][:])) w2 := httptest.NewRecorder() w2.Body = &bytes.Buffer{} s.SetVoluntaryExit(w2, req2) @@ -952,7 +951,7 @@ func TestServer_GetGasLimit(t *testing.T) { validatorService: vs, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/gas_limit"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": hexutil.Encode(tt.pubkey[:])}) + req.SetPathValue("pubkey", hexutil.Encode(tt.pubkey[:])) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.GetGasLimit(w, req) @@ -1130,7 +1129,7 @@ func TestServer_SetGasLimit(t *testing.T) { require.NoError(t, err) req := httptest.NewRequest(http.MethodPost, fmt.Sprintf("/eth/v1/validator/{pubkey}/gas_limit"), &buf) - req = mux.SetURLVars(req, map[string]string{"pubkey": hexutil.Encode(tt.pubkey)}) + req.SetPathValue("pubkey", hexutil.Encode(tt.pubkey)) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} @@ -1166,7 +1165,7 @@ func TestServer_SetGasLimit_InvalidPubKey(t *testing.T) { validatorService: &client.ValidatorService{}, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/gas_limit"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0x00"}) + req.SetPathValue("pubkey", "0x00") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} @@ -1304,7 +1303,7 @@ func TestServer_DeleteGasLimit(t *testing.T) { params.BeaconConfig().DefaultBuilderGasLimit = uint64(globalDefaultGasLimit) req := httptest.NewRequest(http.MethodDelete, fmt.Sprintf("/eth/v1/validator/{pubkey}/gas_limit"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": hexutil.Encode(tt.pubkey)}) + req.SetPathValue("pubkey", hexutil.Encode(tt.pubkey)) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} @@ -1557,7 +1556,7 @@ func TestServer_ListFeeRecipientByPubkey(t *testing.T) { validatorService: vs, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.ListFeeRecipientByPubkey(w, req) @@ -1581,7 +1580,7 @@ func TestServer_ListFeeRecipientByPubKey_NoFeeRecipientSet(t *testing.T) { validatorService: vs, } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493"}) + req.SetPathValue("pubkey", "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.ListFeeRecipientByPubkey(w, req) @@ -1592,7 +1591,7 @@ func TestServer_ListFeeRecipientByPubKey_NoFeeRecipientSet(t *testing.T) { func TestServer_ListFeeRecipientByPubkey_ValidatorServiceNil(t *testing.T) { s := &Server{} req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0x00"}) + req.SetPathValue("pubkey", "0x00") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.SetFeeRecipientByPubkey(w, req) @@ -1606,7 +1605,7 @@ func TestServer_ListFeeRecipientByPubkey_InvalidPubKey(t *testing.T) { } req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0x00"}) + req.SetPathValue("pubkey", "0x00") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.SetFeeRecipientByPubkey(w, req) @@ -1780,7 +1779,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) { require.NoError(t, err) req := httptest.NewRequest(http.MethodPost, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), &buf) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.SetFeeRecipientByPubkey(w, req) @@ -1797,7 +1796,7 @@ func TestServer_SetFeeRecipientByPubkey_InvalidPubKey(t *testing.T) { validatorService: &client.ValidatorService{}, } req := httptest.NewRequest(http.MethodPost, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0x00"}) + req.SetPathValue("pubkey", "0x00") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.SetFeeRecipientByPubkey(w, req) @@ -1819,7 +1818,7 @@ func TestServer_SetFeeRecipientByPubkey_InvalidFeeRecipient(t *testing.T) { err := json.NewEncoder(&buf).Encode(request) require.NoError(t, err) req := httptest.NewRequest(http.MethodPost, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), &buf) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.SetFeeRecipientByPubkey(w, req) @@ -1881,7 +1880,7 @@ func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { db: validatorDB, } req := httptest.NewRequest(http.MethodDelete, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.DeleteFeeRecipientByPubkey(w, req) @@ -1895,7 +1894,7 @@ func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { func TestServer_DeleteFeeRecipientByPubkey_ValidatorServiceNil(t *testing.T) { s := &Server{} req := httptest.NewRequest(http.MethodDelete, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0x1234567878903438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493"}) + req.SetPathValue("pubkey", "0x1234567878903438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.DeleteFeeRecipientByPubkey(w, req) @@ -1909,7 +1908,7 @@ func TestServer_DeleteFeeRecipientByPubkey_InvalidPubKey(t *testing.T) { } req := httptest.NewRequest(http.MethodDelete, fmt.Sprintf("/eth/v1/validator/{pubkey}/feerecipient"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": "0x123"}) + req.SetPathValue("pubkey", "0x123") w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.DeleteFeeRecipientByPubkey(w, req) @@ -1938,14 +1937,14 @@ func TestServer_Graffiti(t *testing.T) { err = json.NewEncoder(&buf).Encode(request) require.NoError(t, err) req := httptest.NewRequest(http.MethodPost, fmt.Sprintf("/eth/v1/validator/{pubkey}/graffiti"), &buf) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w := httptest.NewRecorder() w.Body = &bytes.Buffer{} s.SetGraffiti(w, req) require.Equal(t, http.StatusOK, w.Code) req = httptest.NewRequest(http.MethodGet, fmt.Sprintf("/eth/v1/validator/{pubkey}/graffiti"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w = httptest.NewRecorder() w.Body = &bytes.Buffer{} s.GetGraffiti(w, req) @@ -1956,7 +1955,7 @@ func TestServer_Graffiti(t *testing.T) { assert.Equal(t, resp.Data.Pubkey, pubkey) req = httptest.NewRequest(http.MethodDelete, fmt.Sprintf("/eth/v1/validator/{pubkey}/graffiti"), nil) - req = mux.SetURLVars(req, map[string]string{"pubkey": pubkey}) + req.SetPathValue("pubkey", pubkey) w = httptest.NewRecorder() w.Body = &bytes.Buffer{} s.DeleteGraffiti(w, req) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index 25ffe8c21a9e..f623faf06fb9 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -9,10 +9,10 @@ import ( "strings" "time" - "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/httprest" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/io/logs" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -41,7 +41,8 @@ type Config struct { WalletInitializedFeed *event.Feed ValidatorService *client.ValidatorService AuthTokenPath string - Router *mux.Router + Middlewares []middleware.Middleware + Router *http.ServeMux } // Server defining a HTTP server for the remote signer API and registering clients @@ -72,7 +73,7 @@ type Server struct { walletInitializedFeed *event.Feed walletInitialized bool validatorService *client.ValidatorService - router *mux.Router + router *http.ServeMux logStreamer logs.Streamer logStreamerBufferSize int startFailure error @@ -123,13 +124,16 @@ func NewServer(ctx context.Context, cfg *Config) *Server { log.WithError(err).Fatal("Could not register beacon chain gRPC or HTTP client") } - if err := server.InitializeRoutesWithWebHandler(); err != nil { - log.WithError(err).Fatal("Could not initialize routes with web handler") - } - + // Adding AuthTokenHandler to the list of middlewares + cfg.Middlewares = append(cfg.Middlewares, server.AuthTokenHandler) opts := []httprest.Option{ httprest.WithRouter(cfg.Router), httprest.WithHTTPAddr(net.JoinHostPort(server.httpHost, fmt.Sprintf("%d", server.httpPort))), + httprest.WithMiddlewares(cfg.Middlewares), + } + + if err := server.InitializeRoutesWithWebHandler(); err != nil { + log.WithError(err).Fatal("Could not initialize routes with web handler") } // create and set a new http server s, err := httprest.New(server.ctx, opts...) @@ -151,7 +155,7 @@ func (s *Server) InitializeRoutesWithWebHandler() error { if err := s.InitializeRoutes(); err != nil { return err } - s.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + s.router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, "/api") { r.URL.Path = strings.Replace(r.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs s.router.ServeHTTP(w, r) @@ -169,51 +173,49 @@ func (s *Server) InitializeRoutes() error { if s.router == nil { return errors.New("no router found on server") } - // Adding Auth Interceptor for the routes below - s.router.Use(s.AuthTokenHandler) // Register all services, HandleFunc calls, etc. // ... - s.router.HandleFunc("/eth/v1/keystores", s.ListKeystores).Methods(http.MethodGet) - s.router.HandleFunc("/eth/v1/keystores", s.ImportKeystores).Methods(http.MethodPost) - s.router.HandleFunc("/eth/v1/keystores", s.DeleteKeystores).Methods(http.MethodDelete) - s.router.HandleFunc("/eth/v1/remotekeys", s.ListRemoteKeys).Methods(http.MethodGet) - s.router.HandleFunc("/eth/v1/remotekeys", s.ImportRemoteKeys).Methods(http.MethodPost) - s.router.HandleFunc("/eth/v1/remotekeys", s.DeleteRemoteKeys).Methods(http.MethodDelete) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/gas_limit", s.GetGasLimit).Methods(http.MethodGet) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/gas_limit", s.SetGasLimit).Methods(http.MethodPost) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/gas_limit", s.DeleteGasLimit).Methods(http.MethodDelete) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/feerecipient", s.ListFeeRecipientByPubkey).Methods(http.MethodGet) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/feerecipient", s.SetFeeRecipientByPubkey).Methods(http.MethodPost) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/feerecipient", s.DeleteFeeRecipientByPubkey).Methods(http.MethodDelete) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/voluntary_exit", s.SetVoluntaryExit).Methods(http.MethodPost) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/graffiti", s.GetGraffiti).Methods(http.MethodGet) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/graffiti", s.SetGraffiti).Methods(http.MethodPost) - s.router.HandleFunc("/eth/v1/validator/{pubkey}/graffiti", s.DeleteGraffiti).Methods(http.MethodDelete) + s.router.HandleFunc("GET /eth/v1/keystores", s.ListKeystores) + s.router.HandleFunc("POST /eth/v1/keystores", s.ImportKeystores) + s.router.HandleFunc("DELETE /eth/v1/keystores", s.DeleteKeystores) + s.router.HandleFunc("GET /eth/v1/remotekeys", s.ListRemoteKeys) + s.router.HandleFunc("POST /eth/v1/remotekeys", s.ImportRemoteKeys) + s.router.HandleFunc("DELETE /eth/v1/remotekeys", s.DeleteRemoteKeys) + s.router.HandleFunc("GET /eth/v1/validator/{pubkey}/gas_limit", s.GetGasLimit) + s.router.HandleFunc("POST /eth/v1/validator/{pubkey}/gas_limit", s.SetGasLimit) + s.router.HandleFunc("DELETE /eth/v1/validator/{pubkey}/gas_limit", s.DeleteGasLimit) + s.router.HandleFunc("GET /eth/v1/validator/{pubkey}/feerecipient", s.ListFeeRecipientByPubkey) + s.router.HandleFunc("POST /eth/v1/validator/{pubkey}/feerecipient", s.SetFeeRecipientByPubkey) + s.router.HandleFunc("DELETE /eth/v1/validator/{pubkey}/feerecipient", s.DeleteFeeRecipientByPubkey) + s.router.HandleFunc("POST /eth/v1/validator/{pubkey}/voluntary_exit", s.SetVoluntaryExit) + s.router.HandleFunc("GET /eth/v1/validator/{pubkey}/graffiti", s.GetGraffiti) + s.router.HandleFunc("POST /eth/v1/validator/{pubkey}/graffiti", s.SetGraffiti) + s.router.HandleFunc("DELETE /eth/v1/validator/{pubkey}/graffiti", s.DeleteGraffiti) // auth endpoint - s.router.HandleFunc(api.WebUrlPrefix+"initialize", s.Initialize).Methods(http.MethodGet) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"initialize", s.Initialize) // accounts endpoints - s.router.HandleFunc(api.WebUrlPrefix+"accounts", s.ListAccounts).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"accounts/backup", s.BackupAccounts).Methods(http.MethodPost) - s.router.HandleFunc(api.WebUrlPrefix+"accounts/voluntary-exit", s.VoluntaryExit).Methods(http.MethodPost) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"accounts", s.ListAccounts) + s.router.HandleFunc("POST "+api.WebUrlPrefix+"accounts/backup", s.BackupAccounts) + s.router.HandleFunc("POST "+api.WebUrlPrefix+"accounts/voluntary-exit", s.VoluntaryExit) // web health endpoints - s.router.HandleFunc(api.WebUrlPrefix+"health/version", s.GetVersion).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"health/logs/validator/stream", s.StreamValidatorLogs).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"health/logs/beacon/stream", s.StreamBeaconLogs).Methods(http.MethodGet) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"health/version", s.GetVersion) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"health/logs/validator/stream", s.StreamValidatorLogs) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"health/logs/beacon/stream", s.StreamBeaconLogs) // Beacon calls - s.router.HandleFunc(api.WebUrlPrefix+"beacon/status", s.GetBeaconStatus).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"beacon/summary", s.GetValidatorPerformance).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"beacon/validators", s.GetValidators).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"beacon/balances", s.GetValidatorBalances).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"beacon/peers", s.GetPeers).Methods(http.MethodGet) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"beacon/status", s.GetBeaconStatus) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"beacon/summary", s.GetValidatorPerformance) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"beacon/validators", s.GetValidators) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"beacon/balances", s.GetValidatorBalances) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"beacon/peers", s.GetPeers) // web wallet endpoints - s.router.HandleFunc(api.WebUrlPrefix+"wallet", s.WalletConfig).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"wallet/create", s.CreateWallet).Methods(http.MethodPost) - s.router.HandleFunc(api.WebUrlPrefix+"wallet/keystores/validate", s.ValidateKeystores).Methods(http.MethodPost) - s.router.HandleFunc(api.WebUrlPrefix+"wallet/recover", s.RecoverWallet).Methods(http.MethodPost) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"wallet", s.WalletConfig) + s.router.HandleFunc("POST "+api.WebUrlPrefix+"wallet/create", s.CreateWallet) + s.router.HandleFunc("POST "+api.WebUrlPrefix+"wallet/keystores/validate", s.ValidateKeystores) + s.router.HandleFunc("POST "+api.WebUrlPrefix+"wallet/recover", s.RecoverWallet) // slashing protection endpoints - s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/export", s.ExportSlashingProtection).Methods(http.MethodGet) - s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/import", s.ImportSlashingProtection).Methods(http.MethodPost) + s.router.HandleFunc("GET "+api.WebUrlPrefix+"slashing-protection/export", s.ExportSlashingProtection) + s.router.HandleFunc("POST "+api.WebUrlPrefix+"slashing-protection/import", s.ImportSlashingProtection) log.Info("Initialized REST API routes") return nil diff --git a/validator/rpc/server_test.go b/validator/rpc/server_test.go index f285fc823068..fb97e2133c60 100644 --- a/validator/rpc/server_test.go +++ b/validator/rpc/server_test.go @@ -4,13 +4,12 @@ import ( "net/http" "testing" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/testing/require" ) func TestServer_InitializeRoutes(t *testing.T) { s := Server{ - router: mux.NewRouter(), + router: http.NewServeMux(), } err := s.InitializeRoutes() require.NoError(t, err) @@ -41,20 +40,23 @@ func TestServer_InitializeRoutes(t *testing.T) { "/v2/validator/beacon/validators": {http.MethodGet}, "/v2/validator/initialize": {http.MethodGet}, } - gotRouteList := make(map[string][]string) - err = s.router.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error { - tpl, err1 := route.GetPathTemplate() - require.NoError(t, err1) - met, err2 := route.GetMethods() - require.NoError(t, err2) - methods, ok := gotRouteList[tpl] - if !ok { - gotRouteList[tpl] = []string{met[0]} - } else { - gotRouteList[tpl] = append(methods, met[0]) + for route, methods := range wantRouteList { + for _, method := range methods { + r, err := http.NewRequest(method, route, nil) + require.NoError(t, err) + if method == http.MethodGet { + _, path := s.router.Handler(r) + require.Equal(t, "GET "+route, path) + } else if method == http.MethodPost { + _, path := s.router.Handler(r) + require.Equal(t, "POST "+route, path) + } else if method == http.MethodDelete { + _, path := s.router.Handler(r) + require.Equal(t, "DELETE "+route, path) + } else { + t.Errorf("Unsupported method %v", method) + } } - return nil - }) - require.NoError(t, err) - require.DeepEqual(t, wantRouteList, gotRouteList) + } + } From 875e3e5e7df16c810e63a497c28e015d5339d337 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:15:08 -0500 Subject: [PATCH 287/325] E2E: fixing builder route registration after gorilla mux removal (#14445) * fixing builder route registration afte gorilla mux removal * changelog --- CHANGELOG.md | 2 +- testing/middleware/builder/BUILD.bazel | 1 + testing/middleware/builder/builder.go | 24 ++++++++++++++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a9fc72870e8..e090683ffb92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `api-timeout` is changed from int flag to duration flag, default value updated. - Light client support: abstracted out the light client headers with different versions. - `ApplyToEveryValidator` has been changed to prevent misuse bugs, it takes a closure that takes a `ReadOnlyValidator` and returns a raw pointer to a `Validator`. -- Removed gorilla mux library and replaced it with net/http updates in go 1.22 +- Removed gorilla mux library and replaced it with net/http updates in go 1.22. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/testing/middleware/builder/BUILD.bazel b/testing/middleware/builder/BUILD.bazel index 29de48ea4450..90473fe94d1a 100644 --- a/testing/middleware/builder/BUILD.bazel +++ b/testing/middleware/builder/BUILD.bazel @@ -12,6 +12,7 @@ go_library( "//api/client/builder:go_default_library", "//api/server/structs:go_default_library", "//beacon-chain/core/signing:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", diff --git a/testing/middleware/builder/builder.go b/testing/middleware/builder/builder.go index 67c927edae4d..a09569301de0 100644 --- a/testing/middleware/builder/builder.go +++ b/testing/middleware/builder/builder.go @@ -24,6 +24,7 @@ import ( builderAPI "github.com/prysmaticlabs/prysm/v5/api/client/builder" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" @@ -38,10 +39,10 @@ import ( ) const ( - statusPath = "/eth/v1/builder/status" - registerPath = "/eth/v1/builder/validators" - headerPath = "/eth/v1/builder/header/{slot:[0-9]+}/{parent_hash:0x[a-fA-F0-9]+}/{pubkey:0x[a-fA-F0-9]+}" - blindedPath = "/eth/v1/builder/blinded_blocks" + statusPath = "GET /eth/v1/builder/status" + registerPath = "POST /eth/v1/builder/validators" + headerPath = "GET /eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}" + blindedPath = "POST /eth/v1/builder/blinded_blocks" // ForkchoiceUpdatedMethod v1 request string for JSON-RPC. ForkchoiceUpdatedMethod = "engine_forkchoiceUpdatedV1" @@ -306,6 +307,11 @@ func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request) http.Error(w, "no valid parent hash", http.StatusBadRequest) return } + _, err := bytesutil.DecodeHexWithLength(pHash, common.HashLength) + if err != nil { + http.Error(w, "invalid parent hash", http.StatusBadRequest) + return + } reqSlot := req.PathValue("slot") if reqSlot == "" { http.Error(w, "no valid slot provided", http.StatusBadRequest) @@ -316,6 +322,16 @@ func (p *Builder) handleHeaderRequest(w http.ResponseWriter, req *http.Request) http.Error(w, "invalid slot provided", http.StatusBadRequest) return } + reqPubkey := req.PathValue("pubkey") + if reqPubkey == "" { + http.Error(w, "no valid pubkey provided", http.StatusBadRequest) + return + } + _, err = bytesutil.DecodeHexWithLength(reqPubkey, fieldparams.BLSPubkeyLength) + if err != nil { + http.Error(w, "invalid pubkey", http.StatusBadRequest) + return + } ax := types.Slot(slot) currEpoch := types.Epoch(ax / params.BeaconConfig().SlotsPerEpoch) if currEpoch >= params.BeaconConfig().DenebForkEpoch { From df4ca54a7616f0975a76cdf122181dac5a60ed39 Mon Sep 17 00:00:00 2001 From: terence Date: Wed, 11 Sep 2024 18:28:22 -0700 Subject: [PATCH 288/325] Remove unused blobs bundle cache and usages (#14438) --- CHANGELOG.md | 1 + .../v1alpha1/validator/proposer_deneb.go | 47 ------------------- .../v1alpha1/validator/proposer_deneb_test.go | 33 ------------- .../rpc/prysm/v1alpha1/validator/server.go | 23 --------- beacon-chain/rpc/service.go | 1 - 5 files changed, 1 insertion(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e090683ffb92..1cdb0c5cb321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve ### Removed - removed gRPC Gateway +- Removed unused blobs bundle cache ### Fixed diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go index 589f100fd692..2f57f409bd88 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb.go @@ -2,60 +2,13 @@ package validator import ( "errors" - "sync" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" ) -var bundleCache = &blobsBundleCache{} - -// BlobsBundleCache holds the KZG commitments and other relevant sidecar data for a local beacon block. -type blobsBundleCache struct { - sync.Mutex - slot primitives.Slot - bundle *enginev1.BlobsBundle -} - -// add adds a blobs bundle to the cache. -// same slot overwrites the previous bundle. -func (c *blobsBundleCache) add(slot primitives.Slot, bundle *enginev1.BlobsBundle) { - c.Lock() - defer c.Unlock() - - if slot >= c.slot { - c.bundle = bundle - c.slot = slot - } -} - -// get gets a blobs bundle from the cache. -func (c *blobsBundleCache) get(slot primitives.Slot) *enginev1.BlobsBundle { - c.Lock() - defer c.Unlock() - - if c.slot == slot { - return c.bundle - } - - return nil -} - -// prune acquires the lock before pruning. -func (c *blobsBundleCache) prune(minSlot primitives.Slot) { - c.Lock() - defer c.Unlock() - - if minSlot > c.slot { - c.slot = 0 - c.bundle = nil - } -} - // BuildBlobSidecars given a block, builds the blob sidecars for the block. func BuildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProofs [][]byte) ([]*ethpb.BlobSidecar, error) { if blk.Version() < version.Deneb { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go index dd191d1d7dfc..a9f83e7ab386 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deneb_test.go @@ -6,44 +6,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestAdd(t *testing.T) { - slot := primitives.Slot(1) - bundle := &enginev1.BlobsBundle{KzgCommitments: [][]byte{{'a'}}} - bundleCache.add(slot, bundle) - require.Equal(t, bundleCache.bundle, bundle) - - slot = primitives.Slot(2) - bundle = &enginev1.BlobsBundle{KzgCommitments: [][]byte{{'b'}}} - bundleCache.add(slot, bundle) - require.Equal(t, bundleCache.bundle, bundle) -} - -func TestGet(t *testing.T) { - slot := primitives.Slot(3) - bundle := &enginev1.BlobsBundle{KzgCommitments: [][]byte{{'a'}}} - bundleCache.add(slot, bundle) - require.Equal(t, bundleCache.get(slot), bundle) -} - -func TestPrune(t *testing.T) { - slot1 := primitives.Slot(4) - bundle1 := &enginev1.BlobsBundle{KzgCommitments: [][]byte{{'a'}}} - - bundleCache.add(slot1, bundle1) - bundleCache.prune(slot1 + 1) - - if bundleCache.get(slot1) != nil { - t.Errorf("Prune did not remove the bundle at slot1") - } -} - func TestServer_buildBlobSidecars(t *testing.T) { kzgCommitments := [][]byte{bytesutil.PadTo([]byte{'a'}, 48), bytesutil.PadTo([]byte{'b'}, 48)} blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockDeneb()) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go index 5dc6190151f6..dce6972f442a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go @@ -32,7 +32,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/network/forks" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "github.com/prysmaticlabs/prysm/v5/time/slots" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" @@ -207,25 +206,3 @@ func (vs *Server) WaitForChainStart(_ *emptypb.Empty, stream ethpb.BeaconNodeVal } return stream.Send(res) } - -// PruneBlobsBundleCacheRoutine prunes the blobs bundle cache at 6s mark of the slot. -func (vs *Server) PruneBlobsBundleCacheRoutine() { - go func() { - clock, err := vs.ClockWaiter.WaitForClock(vs.Ctx) - if err != nil { - log.WithError(err).Error("PruneBlobsBundleCacheRoutine failed to receive genesis data") - return - } - - pruneInterval := time.Second * time.Duration(params.BeaconConfig().SecondsPerSlot/2) - ticker := slots.NewSlotTickerWithIntervals(clock.GenesisTime(), []time.Duration{pruneInterval}) - for { - select { - case <-vs.Ctx.Done(): - return - case slotInterval := <-ticker.C(): - bundleCache.prune(slotInterval.Slot) - } - } - }() -} diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 7ac82e1d3eaa..c7d29594600c 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -347,7 +347,6 @@ var _ stategen.CurrentSlotter = blockchain.ChainInfoFetcher(nil) // Start the gRPC server. func (s *Service) Start() { grpcprometheus.EnableHandlingTimeHistogram() - s.validatorServer.PruneBlobsBundleCacheRoutine() go func() { if s.listener != nil { if err := s.grpcServer.Serve(s.listener); err != nil { From 2f756b7ec4d5b5c0233307183d0bfeea355f8af7 Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 12 Sep 2024 07:08:10 -0700 Subject: [PATCH 289/325] Refactor logging proposed block (#14443) --- CHANGELOG.md | 1 + validator/client/propose.go | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cdb0c5cb321..2d09b94f7ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: abstracted out the light client headers with different versions. - `ApplyToEveryValidator` has been changed to prevent misuse bugs, it takes a closure that takes a `ReadOnlyValidator` and returns a raw pointer to a `Validator`. - Removed gorilla mux library and replaced it with net/http updates in go 1.22. +- Clean up `ProposeBlock` for validator client to reduce cognitive scoring and enable further changes. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/validator/client/propose.go b/validator/client/propose.go index 411d02bac7f1..1979a7797b34 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -177,11 +177,20 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK trace.Int64Attribute("numAttestations", int64(len(blk.Block().Body().Attestations()))), ) + if err := logProposedBlock(log, blk, blkResp.BlockRoot); err != nil { + log.WithError(err).Error("Failed to log proposed block") + } + + if v.emitAccountMetrics { + ValidatorProposeSuccessVec.WithLabelValues(fmtKey).Inc() + } +} + +func logProposedBlock(log *logrus.Entry, blk interfaces.SignedBeaconBlock, blkRoot []byte) error { if blk.Version() >= version.Bellatrix { p, err := blk.Block().Body().Execution() if err != nil { - log.WithError(err).Error("Failed to get execution payload") - return + return errors.Wrap(err, "failed to get execution payload") } log = log.WithFields(logrus.Fields{ "payloadHash": fmt.Sprintf("%#x", bytesutil.Trunc(p.BlockHash())), @@ -191,8 +200,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK if !blk.IsBlinded() { txs, err := p.Transactions() if err != nil { - log.WithError(err).Error("Failed to get execution payload transactions") - return + return errors.Wrap(err, "failed to get execution payload transactions") } log = log.WithField("txCount", len(txs)) } @@ -202,36 +210,32 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK if blk.Version() >= version.Capella && !blk.IsBlinded() { withdrawals, err := p.Withdrawals() if err != nil { - log.WithError(err).Error("Failed to get execution payload withdrawals") - return + return errors.Wrap(err, "failed to get execution payload withdrawals") } log = log.WithField("withdrawalCount", len(withdrawals)) } if blk.Version() >= version.Deneb { kzgs, err := blk.Block().Body().BlobKzgCommitments() if err != nil { - log.WithError(err).Error("Failed to get blob KZG commitments") - return + return errors.Wrap(err, "failed to get kzg commitments") } else if len(kzgs) != 0 { log = log.WithField("kzgCommitmentCount", len(kzgs)) } } } - blkRoot := fmt.Sprintf("%#x", bytesutil.Trunc(blkResp.BlockRoot)) + br := fmt.Sprintf("%#x", bytesutil.Trunc(blkRoot)) graffiti := blk.Block().Body().Graffiti() log.WithFields(logrus.Fields{ "slot": blk.Block().Slot(), - "blockRoot": blkRoot, + "blockRoot": br, "attestationCount": len(blk.Block().Body().Attestations()), "depositCount": len(blk.Block().Body().Deposits()), "graffiti": string(graffiti[:]), "fork": version.String(blk.Block().Version()), }).Info("Submitted new block") - if v.emitAccountMetrics { - ValidatorProposeSuccessVec.WithLabelValues(fmtKey).Inc() - } + return nil } func buildGenericSignedBlockDenebWithBlobs(pb proto.Message, b *ethpb.GenericBeaconBlock) (*ethpb.GenericSignedBeaconBlock, error) { From 28181710b05e9f960dbf153988f6224deab8d4aa Mon Sep 17 00:00:00 2001 From: hopinheimer <48147533+hopinheimer@users.noreply.github.com> Date: Thu, 12 Sep 2024 20:29:43 +0530 Subject: [PATCH 290/325] version bump on k8s io client-go and apimachinery (#14444) * version bump on k8s io client-go and apimachinery * bazel file served * fixing build issues * some changes in noops functions * Update CHANGELOG.md --------- Co-authored-by: Preston Van Loon Co-authored-by: Preston Van Loon --- CHANGELOG.md | 1 + beacon-chain/cache/common.go | 2 +- beacon-chain/execution/block_cache.go | 2 +- .../stategen/epoch_boundary_state_cache.go | 2 +- deps.bzl | 238 +++++++----------- go.mod | 21 +- go.sum | 113 +++------ 7 files changed, 140 insertions(+), 239 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d09b94f7ac7..396d3631bc82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `ApplyToEveryValidator` has been changed to prevent misuse bugs, it takes a closure that takes a `ReadOnlyValidator` and returns a raw pointer to a `Validator`. - Removed gorilla mux library and replaced it with net/http updates in go 1.22. - Clean up `ProposeBlock` for validator client to reduce cognitive scoring and enable further changes. +- Updated k8s-io/client-go to v0.30.4 and k8s-io/apimachinery to v0.30.4 ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/beacon-chain/cache/common.go b/beacon-chain/cache/common.go index be1950c16544..5eff08f49e23 100644 --- a/beacon-chain/cache/common.go +++ b/beacon-chain/cache/common.go @@ -17,6 +17,6 @@ func trim(queue *cache.FIFO, maxSize uint64) { } // popProcessNoopFunc is a no-op function that never returns an error. -func popProcessNoopFunc(_ interface{}) error { +func popProcessNoopFunc(_ interface{}, _ bool) error { return nil } diff --git a/beacon-chain/execution/block_cache.go b/beacon-chain/execution/block_cache.go index cdeb10186eed..4866ee75d1f1 100644 --- a/beacon-chain/execution/block_cache.go +++ b/beacon-chain/execution/block_cache.go @@ -164,6 +164,6 @@ func trim(queue *cache.FIFO, maxSize uint64) { } // popProcessNoopFunc is a no-op function that never returns an error. -func popProcessNoopFunc(_ interface{}) error { +func popProcessNoopFunc(_ interface{}, _ bool) error { return nil } diff --git a/beacon-chain/state/stategen/epoch_boundary_state_cache.go b/beacon-chain/state/stategen/epoch_boundary_state_cache.go index 9be422a87720..3ed39791d28e 100644 --- a/beacon-chain/state/stategen/epoch_boundary_state_cache.go +++ b/beacon-chain/state/stategen/epoch_boundary_state_cache.go @@ -184,7 +184,7 @@ func trim(queue *cache.FIFO, maxSize uint64) { } // popProcessNoopFunc is a no-op function that never returns an error. -func popProcessNoopFunc(_ interface{}) error { +func popProcessNoopFunc(_ interface{}, _ bool) error { return nil } diff --git a/deps.bzl b/deps.bzl index b1514e34561b..7356f1057f9c 100644 --- a/deps.bzl +++ b/deps.bzl @@ -142,18 +142,18 @@ def prysm_deps(): sum = "h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to=", version = "v0.0.0-20180808171621-7fddfc383310", ) + go_repository( + name = "com_github_armon_go_socks5", + importpath = "github.com/armon/go-socks5", + sum = "h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=", + version = "v0.0.0-20160902184237-e75332964ef5", + ) go_repository( name = "com_github_aryann_difflib", importpath = "github.com/aryann/difflib", sum = "h1:pv34s756C4pEXnjgPfGYgdhg/ZdajGhyOvzx8k+23nw=", version = "v0.0.0-20170710044230-e206f873d14a", ) - go_repository( - name = "com_github_asaskevich_govalidator", - importpath = "github.com/asaskevich/govalidator", - sum = "h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=", - version = "v0.0.0-20190424111038-f61b66f89f4a", - ) go_repository( name = "com_github_aws_aws_lambda_go", importpath = "github.com/aws/aws-lambda-go", @@ -268,48 +268,6 @@ def prysm_deps(): sum = "h1:gggzg0SUMs6SQbEw+3LoSsYf9YMjkupeAnHMX8O9mmY=", version = "v1.2.0", ) - go_repository( - name = "com_github_azure_go_autorest", - importpath = "github.com/Azure/go-autorest", - sum = "h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=", - version = "v14.2.0+incompatible", - ) - go_repository( - name = "com_github_azure_go_autorest_autorest", - importpath = "github.com/Azure/go-autorest/autorest", - sum = "h1:eVvIXUKiTgv++6YnWb42DUA1YL7qDugnKP0HljexdnQ=", - version = "v0.11.1", - ) - go_repository( - name = "com_github_azure_go_autorest_autorest_adal", - importpath = "github.com/Azure/go-autorest/autorest/adal", - sum = "h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0=", - version = "v0.9.5", - ) - go_repository( - name = "com_github_azure_go_autorest_autorest_date", - importpath = "github.com/Azure/go-autorest/autorest/date", - sum = "h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=", - version = "v0.3.0", - ) - go_repository( - name = "com_github_azure_go_autorest_autorest_mocks", - importpath = "github.com/Azure/go-autorest/autorest/mocks", - sum = "h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=", - version = "v0.4.1", - ) - go_repository( - name = "com_github_azure_go_autorest_logger", - importpath = "github.com/Azure/go-autorest/logger", - sum = "h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE=", - version = "v0.2.0", - ) - go_repository( - name = "com_github_azure_go_autorest_tracing", - importpath = "github.com/Azure/go-autorest/tracing", - sum = "h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=", - version = "v0.6.0", - ) go_repository( name = "com_github_bazelbuild_rules_go", importpath = "github.com/bazelbuild/rules_go", @@ -714,18 +672,6 @@ def prysm_deps(): sum = "h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=", version = "v0.5.0", ) - go_repository( - name = "com_github_docker_spdystream", - importpath = "github.com/docker/spdystream", - sum = "h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg=", - version = "v0.0.0-20160310174837-449fdfce4d96", - ) - go_repository( - name = "com_github_docopt_docopt_go", - importpath = "github.com/docopt/docopt-go", - sum = "h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=", - version = "v0.0.0-20180111231733-ee0de3bc6815", - ) go_repository( name = "com_github_dop251_goja", importpath = "github.com/dop251/goja", @@ -780,12 +726,6 @@ def prysm_deps(): sum = "h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=", version = "v0.14.2", ) - go_repository( - name = "com_github_elazarl_goproxy", - importpath = "github.com/elazarl/goproxy", - sum = "h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=", - version = "v0.0.0-20180725130230-947c36da3153", - ) go_repository( name = "com_github_emicklei_dot", importpath = "github.com/emicklei/dot", @@ -793,10 +733,10 @@ def prysm_deps(): version = "v0.11.0", ) go_repository( - name = "com_github_emicklei_go_restful", - importpath = "github.com/emicklei/go-restful", - sum = "h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=", - version = "v0.0.0-20170410110728-ff4f55a20633", + name = "com_github_emicklei_go_restful_v3", + importpath = "github.com/emicklei/go-restful/v3", + sum = "h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=", + version = "v3.11.0", ) go_repository( name = "com_github_envoyproxy_go_control_plane", @@ -837,8 +777,8 @@ def prysm_deps(): go_repository( name = "com_github_evanphx_json_patch", importpath = "github.com/evanphx/json-patch", - sum = "h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=", - version = "v4.9.0+incompatible", + sum = "h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=", + version = "v4.12.0+incompatible", ) go_repository( name = "com_github_fatih_color", @@ -894,12 +834,6 @@ def prysm_deps(): sum = "h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=", version = "v1.1.0", ) - go_repository( - name = "com_github_form3tech_oss_jwt_go", - importpath = "github.com/form3tech-oss/jwt-go", - sum = "h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=", - version = "v3.2.2+incompatible", - ) go_repository( name = "com_github_fortytw2_leaktest", importpath = "github.com/fortytw2/leaktest", @@ -936,6 +870,12 @@ def prysm_deps(): sum = "h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=", version = "v1.6.0", ) + go_repository( + name = "com_github_fxamacker_cbor_v2", + importpath = "github.com/fxamacker/cbor/v2", + sum = "h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA=", + version = "v2.6.0", + ) go_repository( name = "com_github_garslo_gogen", importpath = "github.com/garslo/gogen", @@ -1059,8 +999,8 @@ def prysm_deps(): go_repository( name = "com_github_go_logr_logr", importpath = "github.com/go-logr/logr", - sum = "h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=", - version = "v1.3.0", + sum = "h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=", + version = "v1.4.1", ) go_repository( name = "com_github_go_martini_martini", @@ -1077,26 +1017,20 @@ def prysm_deps(): go_repository( name = "com_github_go_openapi_jsonpointer", importpath = "github.com/go-openapi/jsonpointer", - sum = "h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=", - version = "v0.19.5", + sum = "h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=", + version = "v0.19.6", ) go_repository( name = "com_github_go_openapi_jsonreference", importpath = "github.com/go-openapi/jsonreference", - sum = "h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=", - version = "v0.19.3", - ) - go_repository( - name = "com_github_go_openapi_spec", - importpath = "github.com/go-openapi/spec", - sum = "h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc=", - version = "v0.19.3", + sum = "h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=", + version = "v0.20.2", ) go_repository( name = "com_github_go_openapi_swag", importpath = "github.com/go-openapi/swag", - sum = "h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=", - version = "v0.19.5", + sum = "h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=", + version = "v0.22.3", ) go_repository( name = "com_github_go_playground_assert_v2", @@ -1221,8 +1155,8 @@ def prysm_deps(): go_repository( name = "com_github_golang_groupcache", importpath = "github.com/golang/groupcache", - sum = "h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=", - version = "v0.0.0-20200121045136-8c9f03a8e57e", + sum = "h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=", + version = "v0.0.0-20210331224755-41bb18bfe9da", ) go_repository( name = "com_github_golang_jwt_jwt_v4", @@ -1265,8 +1199,14 @@ def prysm_deps(): go_repository( name = "com_github_google_btree", importpath = "github.com/google/btree", - sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=", - version = "v1.0.0", + sum = "h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_google_gnostic_models", + importpath = "github.com/google/gnostic-models", + sum = "h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=", + version = "v0.6.8", ) go_repository( name = "com_github_google_go_cmp", @@ -1346,16 +1286,6 @@ def prysm_deps(): sum = "h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=", version = "v2.0.5", ) - go_repository( - name = "com_github_googleapis_gnostic", - build_directives = [ - "gazelle:resolve go github.com/googleapis/gnostic/extensions //extensions:go_default_library", - ], - build_naming_convention = "go_default_library", - importpath = "github.com/googleapis/gnostic", - sum = "h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=", - version = "v0.4.1", - ) go_repository( name = "com_github_googleapis_google_cloud_go_testing", importpath = "github.com/googleapis/google-cloud-go-testing", @@ -1380,6 +1310,12 @@ def prysm_deps(): sum = "h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=", version = "v1.0.0", ) + go_repository( + name = "com_github_gorilla_mux", + importpath = "github.com/gorilla/mux", + sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", + version = "v1.8.0", + ) go_repository( name = "com_github_gorilla_websocket", importpath = "github.com/gorilla/websocket", @@ -1647,8 +1583,8 @@ def prysm_deps(): go_repository( name = "com_github_imdario_mergo", importpath = "github.com/imdario/mergo", - sum = "h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=", - version = "v0.3.5", + sum = "h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=", + version = "v0.3.6", ) go_repository( name = "com_github_inconshreveable_log15", @@ -1961,8 +1897,8 @@ def prysm_deps(): go_repository( name = "com_github_kr_pty", importpath = "github.com/kr/pty", - sum = "h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=", - version = "v1.1.5", + sum = "h1:/Um6a/ZmD5tF7peoOJ5oN5KMQ0DrGVQSXLNwyckutPk=", + version = "v1.1.3", ) go_repository( name = "com_github_kr_text", @@ -2323,6 +2259,12 @@ def prysm_deps(): sum = "h1:jhDmAqPyebOsVDOCICJoINoLb/AnLBaUw58nFzxWS2w=", version = "v0.1.1", ) + go_repository( + name = "com_github_moby_spdystream", + importpath = "github.com/moby/spdystream", + sum = "h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=", + version = "v0.2.0", + ) go_repository( name = "com_github_modern_go_concurrent", importpath = "github.com/modern-go/concurrent", @@ -2413,8 +2355,8 @@ def prysm_deps(): go_repository( name = "com_github_munnerz_goautoneg", importpath = "github.com/munnerz/goautoneg", - sum = "h1:7PxY7LVfSZm7PEeBTyK1rj1gABdCO2mbri6GKO1cMDs=", - version = "v0.0.0-20120707110453-a547fc61f48d", + sum = "h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=", + version = "v0.0.0-20191010083416-a7dc8b61c822", ) go_repository( name = "com_github_mwitkow_go_conntrack", @@ -2488,12 +2430,6 @@ def prysm_deps(): sum = "h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=", version = "v1.4.11", ) - go_repository( - name = "com_github_nytimes_gziphandler", - importpath = "github.com/NYTimes/gziphandler", - sum = "h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0=", - version = "v0.0.0-20170623195520-56545f4a5d46", - ) go_repository( name = "com_github_oklog_oklog", importpath = "github.com/oklog/oklog", @@ -2533,8 +2469,8 @@ def prysm_deps(): go_repository( name = "com_github_onsi_gomega", importpath = "github.com/onsi/gomega", - sum = "h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=", - version = "v1.30.0", + sum = "h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=", + version = "v1.31.0", ) go_repository( name = "com_github_op_go_logging", @@ -2896,18 +2832,6 @@ def prysm_deps(): sum = "h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU=", version = "v0.0.0-20230228205207-28762a7b9294", ) - go_repository( - name = "com_github_puerkitobio_purell", - importpath = "github.com/PuerkitoBio/purell", - sum = "h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=", - version = "v1.1.1", - ) - go_repository( - name = "com_github_puerkitobio_urlesc", - importpath = "github.com/PuerkitoBio/urlesc", - sum = "h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=", - version = "v0.0.0-20170810143723-de5bf2ad4578", - ) go_repository( name = "com_github_quic_go_qpack", build_directives = [ @@ -3528,6 +3452,12 @@ def prysm_deps(): sum = "h1:264/meVYWt1wFw6Mtn+xwkZkXjID42gNra4rycoiDXI=", version = "v2.8.2", ) + go_repository( + name = "com_github_x448_float16", + importpath = "github.com/x448/float16", + sum = "h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=", + version = "v0.8.4", + ) go_repository( name = "com_github_xdg_scram", importpath = "github.com/xdg/scram", @@ -4528,59 +4458,59 @@ def prysm_deps(): name = "io_k8s_api", build_file_proto_mode = "disable_global", importpath = "k8s.io/api", - sum = "h1:WwrYoZNM1W1aQEbyl8HNG+oWGzLpZQBlcerS9BQw9yI=", - version = "v0.20.0", + sum = "h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs=", + version = "v0.30.4", ) go_repository( name = "io_k8s_apimachinery", build_file_proto_mode = "disable_global", importpath = "k8s.io/apimachinery", - sum = "h1:jjzbTJRXk0unNS71L7h3lxGDH/2HPxMPaQY+MjECKL8=", - version = "v0.20.0", + sum = "h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY=", + version = "v0.30.4", ) go_repository( name = "io_k8s_client_go", build_extra_args = ["-exclude=vendor"], build_naming_convention = "go_default_library", importpath = "k8s.io/client-go", - sum = "h1:Xlax8PKbZsjX4gFvNtt4F5MoJ1V5prDvCuoq9B7iax0=", - version = "v0.20.0", - ) - go_repository( - name = "io_k8s_gengo", - importpath = "k8s.io/gengo", - sum = "h1:sAvhNk5RRuc6FNYGqe7Ygz3PSo/2wGWbulskmzRX8Vs=", - version = "v0.0.0-20200413195148-3a45101e95ac", + sum = "h1:eculUe+HPQoPbixfwmaSZGsKcOf7D288tH6hDAdd+wY=", + version = "v0.30.4", ) go_repository( name = "io_k8s_klog_v2", importpath = "k8s.io/klog/v2", - sum = "h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g=", - version = "v2.80.0", + sum = "h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=", + version = "v2.120.1", ) go_repository( name = "io_k8s_kube_openapi", importpath = "k8s.io/kube-openapi", - sum = "h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c=", - version = "v0.0.0-20201113171705-d219536bb9fd", + sum = "h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=", + version = "v0.0.0-20240228011516-70dd3763d340", + ) + go_repository( + name = "io_k8s_sigs_json", + importpath = "sigs.k8s.io/json", + sum = "h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=", + version = "v0.0.0-20221116044647-bc3834ca7abd", ) go_repository( name = "io_k8s_sigs_structured_merge_diff_v4", importpath = "sigs.k8s.io/structured-merge-diff/v4", - sum = "h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8=", - version = "v4.0.2", + sum = "h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=", + version = "v4.4.1", ) go_repository( name = "io_k8s_sigs_yaml", importpath = "sigs.k8s.io/yaml", - sum = "h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=", - version = "v1.2.0", + sum = "h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=", + version = "v1.3.0", ) go_repository( name = "io_k8s_utils", importpath = "k8s.io/utils", - sum = "h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=", - version = "v0.0.0-20201110183641-67b214c5f920", + sum = "h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=", + version = "v0.0.0-20230726121419-3b25d923346b", ) go_repository( name = "io_opencensus_go", diff --git a/go.mod b/go.mod index d97112bd0420..e2febeb23954 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prysmaticlabs/prysm/v5 -go 1.22 +go 1.22.0 toolchain go1.22.4 @@ -55,7 +55,7 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/multiformats/go-multiaddr v0.12.4 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.30.0 + github.com/onsi/gomega v1.31.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/paulbellamy/ratecounter v0.2.0 github.com/pborman/uuid v1.2.1 @@ -98,8 +98,8 @@ require ( gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 honnef.co/go/tools v0.5.0-0.dev.0.20231205170804-aef76f4feee2 - k8s.io/apimachinery v0.20.0 - k8s.io/client-go v0.20.0 + k8s.io/apimachinery v0.30.4 + k8s.io/client-go v0.30.4 ) require ( @@ -144,7 +144,7 @@ require ( github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.8.1 // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect github.com/gorilla/websocket v1.5.3 // indirect @@ -258,15 +258,16 @@ require ( gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect lukechampine.com/blake3 v1.2.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) require ( github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/fatih/color v1.13.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect @@ -274,8 +275,8 @@ require ( golang.org/x/sys v0.20.0 // indirect google.golang.org/api v0.44.0 // indirect google.golang.org/appengine v1.6.7 // indirect - k8s.io/klog/v2 v2.80.0 // indirect - k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect ) replace github.com/json-iterator/go => github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b diff --git a/go.sum b/go.sum index 9554c497ba70..27c215fd1908 100644 --- a/go.sum +++ b/go.sum @@ -49,15 +49,6 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -71,11 +62,8 @@ github.com/MariusVanDerWijden/tx-fuzz v1.3.3-0.20240227085032-f70dd7c85c97 h1:QD github.com/MariusVanDerWijden/tx-fuzz v1.3.3-0.20240227085032-f70dd7c85c97/go.mod h1:xcjGtET6+7KeDHcwLQp3sIfyFALtoTjzZgY8Y+RUozM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.26.1/go.mod h1:NbSGBSSndYaIhRcBtY9V0U7AyH+x71bG668AuWys/yU= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -103,7 +91,6 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -221,8 +208,6 @@ github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnm github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 h1:qwcF+vdFrvPSEUDSX5RVoRccG8a5DhOdWdQ4zN62zzo= github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= @@ -239,10 +224,10 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/dot v0.11.0 h1:Ase39UD9T9fRBOb5ptgpixrxfx8abVzNWZi2+lr53PI= github.com/emicklei/dot v0.11.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -254,7 +239,6 @@ github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -265,7 +249,6 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= @@ -285,7 +268,6 @@ github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -302,22 +284,19 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -359,8 +338,9 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20170918230701-e5d664eb928e/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -398,6 +378,8 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.1.1-0.20171103154506-982329095285/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -410,12 +392,12 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= @@ -441,7 +423,6 @@ github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0Z github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -451,7 +432,6 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -524,7 +504,6 @@ github.com/ianlancetaylor/cgosymbolizer v0.0.0-20200424224625-be1b05b0b279/go.mo github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb-client-go/v2 v2.4.0 h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k= @@ -551,6 +530,8 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d h1:k+SfYbN66Ev/GDVq39wYOXVW5RNd5kzzairbCe9dK5Q= github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d/go.mod h1:fS54ONkjDV71zS9CDx3V9K21gJg7byKSvI4ajuWFNJw= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -591,7 +572,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -641,6 +621,8 @@ github.com/magiconair/properties v1.7.4-0.20170902060319-8d7837e64d3c/go.mod h1: github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.7.0 h1:3l11YT8tm9MnwGFQ4kETwkzpAwY2Jt9lCrumCUW4+z4= github.com/manifoldco/promptui v0.7.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= @@ -746,10 +728,10 @@ github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dy github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -768,24 +750,21 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= +github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= @@ -821,7 +800,6 @@ github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.2.0 h1:w/UPXyl5GfahFxcTOz2j9wCIHNI+pUPr2laqpojKNCg= github.com/peterh/liner v1.2.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -1010,13 +988,11 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1029,7 +1005,6 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3 github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= @@ -1169,7 +1144,6 @@ golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -1250,7 +1224,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1343,7 +1316,6 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1384,7 +1356,6 @@ golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1460,7 +1431,6 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -1480,7 +1450,6 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1719,20 +1688,18 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.5.0-0.dev.0.20231205170804-aef76f4feee2 h1:VUeHARd+9362HPYyFWjsRa6jBIAf2xWbDv6QXMRztbQ= honnef.co/go/tools v0.5.0-0.dev.0.20231205170804-aef76f4feee2/go.mod h1:J8YyqAvNy0yWpeKUOCONA1m2G4hH2CqUSo/5ZO2/5UA= -k8s.io/api v0.20.0 h1:WwrYoZNM1W1aQEbyl8HNG+oWGzLpZQBlcerS9BQw9yI= -k8s.io/api v0.20.0/go.mod h1:HyLC5l5eoS/ygQYl1BXBgFzWNlkHiAuyNAbevIn+FKg= -k8s.io/apimachinery v0.20.0 h1:jjzbTJRXk0unNS71L7h3lxGDH/2HPxMPaQY+MjECKL8= -k8s.io/apimachinery v0.20.0/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/client-go v0.20.0 h1:Xlax8PKbZsjX4gFvNtt4F5MoJ1V5prDvCuoq9B7iax0= -k8s.io/client-go v0.20.0/go.mod h1:4KWh/g+Ocd8KkCwKF8vUNnmqgv+EVnQDK4MBF4oB5tY= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.80.0 h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g= -k8s.io/klog/v2 v2.80.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/api v0.30.4 h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs= +k8s.io/api v0.30.4/go.mod h1:ZqniWRKu7WIeLijbbzetF4U9qZ03cg5IRwl8YVs8mX0= +k8s.io/apimachinery v0.30.4 h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY= +k8s.io/apimachinery v0.30.4/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/client-go v0.30.4 h1:eculUe+HPQoPbixfwmaSZGsKcOf7D288tH6hDAdd+wY= +k8s.io/client-go v0.30.4/go.mod h1:IBS0R/Mt0LHkNHF4E6n+SUDPG7+m2po6RZU7YHeOpzc= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= @@ -1740,11 +1707,13 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= From b5cfd0d35da011c2d01f7ed17398cf9817ea31cf Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:23:51 +0530 Subject: [PATCH 291/325] feat: implement `block_to_light_client_header` (#14433) * implement `block_to_light_client_header` upto Deneb * update `CHANGELOG.md` * refactor: remove unnecessary variables * move functions to `core/light-client/lightclient.go` * feat: add tests * refactors * add blinded beacon block support to tests * revert "add blinded beacon block support to tests" * add tests for blinded beacon block * lint * refactor: move common code outside of if-else * fix dependencies --- CHANGELOG.md | 1 + beacon-chain/core/light-client/BUILD.bazel | 2 + beacon-chain/core/light-client/lightclient.go | 191 +++++++++++++ .../core/light-client/lightclient_test.go | 259 +++++++++++++++++- testing/util/lightclient.go | 130 ++++++--- 5 files changed, 541 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 396d3631bc82..0be10f964e98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: Implement `ComputeFieldRootsForBlockBody`. - Light client support: Add light client database changes. - Light client support: Implement capella and deneb changes. +- Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb ### Changed diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel index 094c8782a2f6..febad0829c55 100644 --- a/beacon-chain/core/light-client/BUILD.bazel +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -30,7 +30,9 @@ go_test( deps = [ ":go_default_library", "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", "//proto/eth/v2:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index c572a6325c29..d4d918a5f753 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" "github.com/prysmaticlabs/prysm/v5/proto/migration" @@ -551,3 +552,193 @@ func NewLightClientUpdateFromOptimisticUpdate(update *ethpbv2.LightClientOptimis SignatureSlot: update.SignatureSlot, } } + +func ComputeTransactionsRoot(payload interfaces.ExecutionData) ([]byte, error) { + transactionsRoot, err := payload.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payload.Transactions() + if err != nil { + return nil, errors.Wrap(err, "could not get transactions") + } + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + transactionsRoot = transactionsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get transactions root") + } + return transactionsRoot, nil +} + +func ComputeWithdrawalsRoot(payload interfaces.ExecutionData) ([]byte, error) { + withdrawalsRoot, err := payload.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payload.Withdrawals() + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals") + } + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + withdrawalsRoot = withdrawalsRootArray[:] + } else if err != nil { + return nil, errors.Wrap(err, "could not get withdrawals root") + } + return withdrawalsRoot, nil +} + +func BlockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeader, error) { + parentRoot := block.Block().ParentRoot() + stateRoot := block.Block().StateRoot() + bodyRoot, err := block.Block().Body().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get body root") + } + + return ðpbv2.LightClientHeader{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: block.Block().Slot(), + ProposerIndex: block.Block().ProposerIndex(), + ParentRoot: parentRoot[:], + StateRoot: stateRoot[:], + BodyRoot: bodyRoot[:], + }, + }, nil +} + +func BlockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderCapella, error) { + if block.Version() != version.Capella { + return nil, fmt.Errorf("creating Capella light client header is not supported before Capella, invalid slot %d", block.Block().Slot()) + } + + payload, err := block.Block().Body().Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload") + } + + transactionsRoot, err := ComputeTransactionsRoot(payload) + if err != nil { + return nil, err + } + withdrawalsRoot, err := ComputeWithdrawalsRoot(payload) + if err != nil { + return nil, err + } + + executionHeader := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + + parentRoot := block.Block().ParentRoot() + stateRoot := block.Block().StateRoot() + bodyRoot, err := block.Block().Body().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get body root") + } + + return ðpbv2.LightClientHeaderCapella{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: block.Block().Slot(), + ProposerIndex: block.Block().ProposerIndex(), + ParentRoot: parentRoot[:], + StateRoot: stateRoot[:], + BodyRoot: bodyRoot[:], + }, + Execution: executionHeader, + ExecutionBranch: executionPayloadProof, + }, nil +} + +func BlockToLightClientHeaderDeneb(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderDeneb, error) { + epoch := slots.ToEpoch(block.Block().Slot()) + if epoch < params.BeaconConfig().DenebForkEpoch { + return nil, fmt.Errorf("creating Deneb light client header is not supported before Deneb, invalid slot %d", block.Block().Slot()) + } + + payload, err := block.Block().Body().Execution() + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload") + } + + transactionsRoot, err := ComputeTransactionsRoot(payload) + if err != nil { + return nil, err + } + withdrawalsRoot, err := ComputeWithdrawalsRoot(payload) + if err != nil { + return nil, err + } + blobGasUsed, err := payload.BlobGasUsed() + if err != nil { + return nil, errors.Wrap(err, "could not get blob gas used") + } + excessBlobGas, err := payload.ExcessBlobGas() + if err != nil { + return nil, errors.Wrap(err, "could not get excess blob gas") + } + + executionHeader := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + + parentRoot := block.Block().ParentRoot() + stateRoot := block.Block().StateRoot() + bodyRoot, err := block.Block().Body().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get body root") + } + + return ðpbv2.LightClientHeaderDeneb{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: block.Block().Slot(), + ProposerIndex: block.Block().ProposerIndex(), + ParentRoot: parentRoot[:], + StateRoot: stateRoot[:], + BodyRoot: bodyRoot[:], + }, + Execution: executionHeader, + ExecutionBranch: executionPayloadProof, + }, nil +} diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index 51e706706d23..de4a6902d907 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -3,7 +3,11 @@ package light_client_test import ( "testing" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + lightClient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" + light_client "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" @@ -12,7 +16,7 @@ import ( ) func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateCapella(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella() + l := util.NewTestLightClient(t).SetupTestCapella(false) update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) require.NoError(t, err) @@ -44,7 +48,7 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateAltair(t *test } func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateDeneb(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb() + l := util.NewTestLightClient(t).SetupTestDeneb(false) update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) require.NoError(t, err) @@ -59,7 +63,7 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateDeneb(t *testi require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") } func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateCapella(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella() + l := util.NewTestLightClient(t).SetupTestCapella(false) update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -112,7 +116,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateAltair(t *testin } func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateDeneb(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb() + l := util.NewTestLightClient(t).SetupTestDeneb(false) update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) require.NoError(t, err) @@ -139,4 +143,251 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateDeneb(t *testing } } +func TestLightClient_BlockToLightClientHeaderAltair(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() + + header, err := lightClient.BlockToLightClientHeaderAltair(l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") +} + +func TestLightClient_BlockToLightClientHeaderCapella_NonBlindedBeaconBlock(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) + + header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) + require.NoError(t, err) + + withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") +} + +func TestLightClient_BlockToLightClientHeaderCapella_BlindedBeaconBlock(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(true) + + header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := payload.TransactionsRoot() + require.NoError(t, err) + + withdrawalsRoot, err := payload.WithdrawalsRoot() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") +} + +func TestLightClient_BlockToLightClientHeaderDeneb_NonBlindedBeaconBlock(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(false) + + header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) + require.NoError(t, err) + + withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) + require.NoError(t, err) + + blobGasUsed, err := payload.BlobGasUsed() + require.NoError(t, err) + + excessBlobGas, err := payload.ExcessBlobGas() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") +} + +func TestLightClient_BlockToLightClientHeaderDeneb_BlindedBeaconBlock(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(true) + + header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := payload.TransactionsRoot() + require.NoError(t, err) + + withdrawalsRoot, err := payload.WithdrawalsRoot() + require.NoError(t, err) + + blobGasUsed, err := payload.BlobGasUsed() + require.NoError(t, err) + + excessBlobGas, err := payload.ExcessBlobGas() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") +} + // TODO - add finality update tests with non-nil finalized block for different versions diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index dbdbaec9fb34..cece6018ed21 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -28,7 +28,7 @@ func NewTestLightClient(t *testing.T) *TestLightClient { return &TestLightClient{T: t} } -func (l *TestLightClient) SetupTestCapella() *TestLightClient { +func (l *TestLightClient) SetupTestCapella(blinded bool) *TestLightClient { ctx := context.Background() slot := primitives.Slot(params.BeaconConfig().CapellaForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) @@ -66,29 +66,56 @@ func (l *TestLightClient) SetupTestCapella() *TestLightClient { parentRoot, err := signedParent.Block().HashTreeRoot() require.NoError(l.T, err) - block := NewBeaconBlockCapella() - block.Block.Slot = slot - block.Block.ParentRoot = parentRoot[:] + var signedBlock interfaces.SignedBeaconBlock + if blinded { + block := NewBlindedBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] - for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { - block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) - } + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } - signedBlock, err := blocks.NewSignedBeaconBlock(block) - require.NoError(l.T, err) + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) - h, err := signedBlock.Header() - require.NoError(l.T, err) + h, err := signedBlock.Header() + require.NoError(l.T, err) - err = state.SetLatestBlockHeader(h.Header) - require.NoError(l.T, err) - stateRoot, err := state.HashTreeRoot(ctx) - require.NoError(l.T, err) + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) - // get a new signed block so the root is updated with the new state root - block.Block.StateRoot = stateRoot[:] - signedBlock, err = blocks.NewSignedBeaconBlock(block) - require.NoError(l.T, err) + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } else { + block := NewBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } l.State = state l.AttestedState = attestedState @@ -170,7 +197,7 @@ func (l *TestLightClient) SetupTestAltair() *TestLightClient { return l } -func (l *TestLightClient) SetupTestDeneb() *TestLightClient { +func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient { ctx := context.Background() slot := primitives.Slot(params.BeaconConfig().DenebForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) @@ -208,29 +235,56 @@ func (l *TestLightClient) SetupTestDeneb() *TestLightClient { parentRoot, err := signedParent.Block().HashTreeRoot() require.NoError(l.T, err) - block := NewBeaconBlockDeneb() - block.Block.Slot = slot - block.Block.ParentRoot = parentRoot[:] + var signedBlock interfaces.SignedBeaconBlock + if blinded { + block := NewBlindedBeaconBlockDeneb() + block.Message.Slot = slot + block.Message.ParentRoot = parentRoot[:] - for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { - block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) - } + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Message.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } - signedBlock, err := blocks.NewSignedBeaconBlock(block) - require.NoError(l.T, err) + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) - h, err := signedBlock.Header() - require.NoError(l.T, err) + h, err := signedBlock.Header() + require.NoError(l.T, err) - err = state.SetLatestBlockHeader(h.Header) - require.NoError(l.T, err) - stateRoot, err := state.HashTreeRoot(ctx) - require.NoError(l.T, err) + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) - // get a new signed block so the root is updated with the new state root - block.Block.StateRoot = stateRoot[:] - signedBlock, err = blocks.NewSignedBeaconBlock(block) - require.NoError(l.T, err) + // get a new signed block so the root is updated with the new state root + block.Message.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } else { + block := NewBeaconBlockDeneb() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } l.State = state l.AttestedState = attestedState From 170a864239a91b16b74d004fd70ff631e59630f9 Mon Sep 17 00:00:00 2001 From: Sammy Rosso <15244892+saolyn@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:00:20 -0700 Subject: [PATCH 292/325] Otel migration (#14424) * remove opencensus * gaz * update dependencies * add missing dependencies * fix test? * Fix note relevance * add otel http transport middleware * gaz * tidy up * gaz * changelog * feedback * gaz * fix merge issues --- CHANGELOG.md | 1 + api/client/builder/client.go | 4 +- beacon-chain/blockchain/BUILD.bazel | 1 - beacon-chain/blockchain/chain_info.go | 4 +- .../blockchain/forkchoice_update_execution.go | 2 +- .../blockchain/process_attestation.go | 2 +- beacon-chain/builder/BUILD.bazel | 2 +- beacon-chain/builder/service.go | 2 +- beacon-chain/cache/BUILD.bazel | 2 +- .../cache/depositsnapshot/BUILD.bazel | 2 +- .../cache/depositsnapshot/deposit_fetcher.go | 6 +- .../cache/depositsnapshot/deposit_inserter.go | 2 +- beacon-chain/cache/registration.go | 2 +- beacon-chain/cache/skip_slot_cache.go | 8 +- beacon-chain/core/electra/BUILD.bazel | 2 +- beacon-chain/core/electra/consolidations.go | 2 +- beacon-chain/core/electra/deposits.go | 2 +- beacon-chain/core/electra/transition.go | 2 +- beacon-chain/core/electra/withdrawals.go | 2 +- .../core/epoch/precompute/BUILD.bazel | 1 - beacon-chain/core/epoch/precompute/new.go | 2 +- beacon-chain/core/transition/BUILD.bazel | 2 +- beacon-chain/core/transition/transition.go | 24 +-- beacon-chain/db/kv/BUILD.bazel | 1 - beacon-chain/db/kv/archived_point.go | 2 +- beacon-chain/db/kv/backfill.go | 2 +- beacon-chain/db/kv/deposit_contract.go | 2 +- beacon-chain/db/kv/encoding.go | 2 +- beacon-chain/db/kv/lightclient.go | 2 +- beacon-chain/db/kv/state.go | 4 +- beacon-chain/db/slasherkv/BUILD.bazel | 2 +- beacon-chain/db/slasherkv/slasher.go | 2 +- beacon-chain/execution/block_reader.go | 8 +- beacon-chain/node/config.go | 4 +- .../operations/attestations/BUILD.bazel | 2 +- .../operations/attestations/kv/BUILD.bazel | 2 +- .../operations/attestations/kv/aggregated.go | 2 +- .../attestations/kv/unaggregated.go | 2 +- .../attestations/prepare_forkchoice.go | 2 +- beacon-chain/operations/slashings/BUILD.bazel | 2 +- beacon-chain/operations/slashings/service.go | 2 +- beacon-chain/p2p/BUILD.bazel | 1 - beacon-chain/p2p/broadcaster.go | 10 +- beacon-chain/p2p/dial_relay_node.go | 2 +- beacon-chain/p2p/sender.go | 4 +- beacon-chain/p2p/subnets.go | 2 +- beacon-chain/rpc/core/BUILD.bazel | 2 +- beacon-chain/rpc/core/validator.go | 2 +- beacon-chain/rpc/eth/beacon/BUILD.bazel | 2 +- beacon-chain/rpc/eth/beacon/handlers.go | 2 +- beacon-chain/rpc/eth/beacon/handlers_pool.go | 2 +- beacon-chain/rpc/eth/beacon/handlers_state.go | 2 +- .../rpc/eth/beacon/handlers_validator.go | 2 +- beacon-chain/rpc/eth/blob/BUILD.bazel | 2 +- beacon-chain/rpc/eth/blob/handlers.go | 2 +- beacon-chain/rpc/eth/config/BUILD.bazel | 2 +- beacon-chain/rpc/eth/config/handlers.go | 2 +- beacon-chain/rpc/eth/debug/BUILD.bazel | 2 +- beacon-chain/rpc/eth/debug/handlers.go | 2 +- beacon-chain/rpc/eth/light-client/BUILD.bazel | 2 +- beacon-chain/rpc/eth/light-client/handlers.go | 2 +- beacon-chain/rpc/eth/node/BUILD.bazel | 2 +- beacon-chain/rpc/eth/node/handlers.go | 2 +- beacon-chain/rpc/eth/node/handlers_peers.go | 2 +- beacon-chain/rpc/eth/rewards/BUILD.bazel | 2 +- beacon-chain/rpc/eth/rewards/handlers.go | 2 +- beacon-chain/rpc/eth/validator/BUILD.bazel | 1 - .../rpc/eth/validator/handlers_block.go | 2 +- beacon-chain/rpc/lookup/BUILD.bazel | 2 +- beacon-chain/rpc/lookup/stater.go | 2 +- beacon-chain/rpc/prysm/beacon/BUILD.bazel | 2 +- beacon-chain/rpc/prysm/beacon/handlers.go | 2 +- .../rpc/prysm/beacon/validator_count.go | 2 +- beacon-chain/rpc/prysm/node/BUILD.bazel | 2 +- beacon-chain/rpc/prysm/node/handlers.go | 2 +- .../rpc/prysm/v1alpha1/node/server_test.go | 5 +- .../prysm/v1alpha1/validator/aggregator.go | 4 +- .../rpc/prysm/v1alpha1/validator/attester.go | 2 +- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../v1alpha1/validator/proposer_bellatrix.go | 4 +- .../v1alpha1/validator/proposer_builder.go | 4 +- .../validator/proposer_execution_payload.go | 2 +- beacon-chain/rpc/prysm/validator/BUILD.bazel | 2 +- beacon-chain/rpc/prysm/validator/handlers.go | 2 +- .../prysm/validator/validator_performance.go | 2 +- beacon-chain/slasher/BUILD.bazel | 2 +- beacon-chain/slasher/detect_attestations.go | 2 +- beacon-chain/slasher/detect_blocks.go | 2 +- beacon-chain/state/state-native/BUILD.bazel | 1 - beacon-chain/state/state-native/hasher.go | 2 +- beacon-chain/state/state-native/state_trie.go | 2 +- beacon-chain/state/stategen/BUILD.bazel | 1 - beacon-chain/state/stategen/history.go | 2 +- beacon-chain/sync/BUILD.bazel | 2 +- beacon-chain/sync/pending_blocks_queue.go | 18 +- beacon-chain/sync/rpc.go | 4 +- .../sync/rpc_beacon_blocks_by_range.go | 2 +- .../sync/rpc_blob_sidecars_by_range.go | 2 +- .../sync/rpc_blob_sidecars_by_root.go | 2 +- beacon-chain/sync/subscriber.go | 4 +- .../sync/validate_attester_slashing.go | 2 +- .../validate_beacon_attestation_electra.go | 2 +- beacon-chain/sync/validate_beacon_blocks.go | 2 +- .../sync/validate_bls_to_execution_change.go | 2 +- .../sync/validate_proposer_slashing.go | 2 +- beacon-chain/sync/validate_voluntary_exit.go | 2 +- cmd/prysmctl/p2p/client.go | 2 +- consensus-types/blocks/BUILD.bazel | 2 +- consensus-types/blocks/proofs.go | 2 +- deps.bzl | 154 +++++++++++------- go.mod | 38 +++-- go.sum | 101 +++++------- monitoring/tracing/BUILD.bazel | 12 +- monitoring/tracing/errors.go | 12 +- .../tracing/recovery_interceptor_option.go | 4 +- monitoring/tracing/trace/BUILD.bazel | 7 +- monitoring/tracing/trace/span.go | 97 ++++------- monitoring/tracing/tracer.go | 55 ++++--- runtime/messagehandler/BUILD.bazel | 3 +- runtime/messagehandler/messagehandler.go | 13 +- validator/client/BUILD.bazel | 2 +- validator/client/aggregate.go | 2 +- validator/client/attest.go | 8 +- validator/client/propose.go | 6 +- validator/client/runner.go | 12 +- validator/client/sync_committee.go | 4 +- validator/db/kv/attester_protection.go | 2 +- .../remote-web3signer/internal/client.go | 2 +- validator/node/node.go | 4 +- 129 files changed, 417 insertions(+), 416 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0be10f964e98..9e29f3254800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Removed gorilla mux library and replaced it with net/http updates in go 1.22. - Clean up `ProposeBlock` for validator client to reduce cognitive scoring and enable further changes. - Updated k8s-io/client-go to v0.30.4 and k8s-io/apimachinery to v0.30.4 +- Migrated tracing library from opencensus to opentelemetry for both the beacon node and validator. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 6e2f52eeaa2a..098597ed705a 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -146,7 +146,7 @@ func (c *Client) do(ctx context.Context, method string, path string, body io.Rea u := c.baseURL.ResolveReference(&url.URL{Path: path}) - span.AddAttributes(trace.StringAttribute("url", u.String()), + span.SetAttributes(trace.StringAttribute("url", u.String()), trace.StringAttribute("method", method)) req, err := http.NewRequestWithContext(ctx, method, u.String(), body) @@ -259,7 +259,7 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValidatorRegistrationV1) error { ctx, span := trace.StartSpan(ctx, "builder.client.RegisterValidator") defer span.End() - span.AddAttributes(trace.Int64Attribute("num_reqs", int64(len(svr)))) + span.SetAttributes(trace.Int64Attribute("num_reqs", int64(len(svr)))) if len(svr) == 0 { err := errors.Wrap(errMalformedRequest, "empty validator registration list") diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index 818134b58f1b..c12a3d1340bd 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -97,7 +97,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_x_sync//errgroup:go_default_library", ], ) diff --git a/beacon-chain/blockchain/chain_info.go b/beacon-chain/blockchain/chain_info.go index 166f9e9c15ba..5cc2927206d2 100644 --- a/beacon-chain/blockchain/chain_info.go +++ b/beacon-chain/blockchain/chain_info.go @@ -203,7 +203,7 @@ func (s *Service) HeadState(ctx context.Context) (state.BeaconState, error) { defer s.headLock.RUnlock() ok := s.hasHeadState() - span.AddAttributes(trace.BoolAttribute("cache_hit", ok)) + span.SetAttributes(trace.BoolAttribute("cache_hit", ok)) if ok { return s.headState(ctx), nil @@ -225,7 +225,7 @@ func (s *Service) HeadStateReadOnly(ctx context.Context) (state.ReadOnlyBeaconSt defer s.headLock.RUnlock() ok := s.hasHeadState() - span.AddAttributes(trace.BoolAttribute("cache_hit", ok)) + span.SetAttributes(trace.BoolAttribute("cache_hit", ok)) if ok { return s.headStateReadOnly(ctx), nil diff --git a/beacon-chain/blockchain/forkchoice_update_execution.go b/beacon-chain/blockchain/forkchoice_update_execution.go index fd71f75d27a8..5739f5d2f1c2 100644 --- a/beacon-chain/blockchain/forkchoice_update_execution.go +++ b/beacon-chain/blockchain/forkchoice_update_execution.go @@ -12,9 +12,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" payloadattribute "github.com/prysmaticlabs/prysm/v5/consensus-types/payload-attribute" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) func (s *Service) isNewHead(r [32]byte) bool { diff --git a/beacon-chain/blockchain/process_attestation.go b/beacon-chain/blockchain/process_attestation.go index d4bd636b7783..540a4ba40047 100644 --- a/beacon-chain/blockchain/process_attestation.go +++ b/beacon-chain/blockchain/process_attestation.go @@ -7,10 +7,10 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // OnAttestation is called whenever an attestation is received, verifies the attestation is valid and saves diff --git a/beacon-chain/builder/BUILD.bazel b/beacon-chain/builder/BUILD.bazel index 3e14089a4b30..f115fbeb845b 100644 --- a/beacon-chain/builder/BUILD.bazel +++ b/beacon-chain/builder/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//monitoring/tracing:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -26,7 +27,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/builder/service.go b/beacon-chain/builder/service.go index 0f227d6b2e53..b2098193eba7 100644 --- a/beacon-chain/builder/service.go +++ b/beacon-chain/builder/service.go @@ -14,10 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // ErrNoBuilder is used when builder endpoint is not configured. diff --git a/beacon-chain/cache/BUILD.bazel b/beacon-chain/cache/BUILD.bazel index 8a0b9d7a99f0..3defcdfac58f 100644 --- a/beacon-chain/cache/BUILD.bazel +++ b/beacon-chain/cache/BUILD.bazel @@ -46,6 +46,7 @@ go_library( "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", @@ -56,7 +57,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_k8s_client_go//tools/cache:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/cache/depositsnapshot/BUILD.bazel b/beacon-chain/cache/depositsnapshot/BUILD.bazel index c300f81f31fa..de6e52e5ee90 100644 --- a/beacon-chain/cache/depositsnapshot/BUILD.bazel +++ b/beacon-chain/cache/depositsnapshot/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -26,7 +27,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_wealdtech_go_bytesutil//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/cache/depositsnapshot/deposit_fetcher.go b/beacon-chain/cache/depositsnapshot/deposit_fetcher.go index 2cf862765ea7..e7b9f089ad3e 100644 --- a/beacon-chain/cache/depositsnapshot/deposit_fetcher.go +++ b/beacon-chain/cache/depositsnapshot/deposit_fetcher.go @@ -10,10 +10,10 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" "github.com/wealdtech/go-bytesutil" - "go.opencensus.io/trace" ) var ( @@ -241,7 +241,7 @@ func (c *Cache) InsertPendingDeposit(ctx context.Context, d *ethpb.Deposit, bloc c.pendingDeposits = append(c.pendingDeposits, ðpb.DepositContainer{Deposit: d, Eth1BlockHeight: blockNum, Index: index, DepositRoot: depositRoot[:]}) pendingDepositsCount.Set(float64(len(c.pendingDeposits))) - span.AddAttributes(trace.Int64Attribute("count", int64(len(c.pendingDeposits)))) + span.SetAttributes(trace.Int64Attribute("count", int64(len(c.pendingDeposits)))) } // Deposits returns the cached internal deposit tree. @@ -304,7 +304,7 @@ func (c *Cache) PendingContainers(ctx context.Context, untilBlk *big.Int) []*eth return depositCntrs[i].Index < depositCntrs[j].Index }) - span.AddAttributes(trace.Int64Attribute("count", int64(len(depositCntrs)))) + span.SetAttributes(trace.Int64Attribute("count", int64(len(depositCntrs)))) return depositCntrs } diff --git a/beacon-chain/cache/depositsnapshot/deposit_inserter.go b/beacon-chain/cache/depositsnapshot/deposit_inserter.go index 990644e07d9a..59927bfe9e34 100644 --- a/beacon-chain/cache/depositsnapshot/deposit_inserter.go +++ b/beacon-chain/cache/depositsnapshot/deposit_inserter.go @@ -10,9 +10,9 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) var ( diff --git a/beacon-chain/cache/registration.go b/beacon-chain/cache/registration.go index 217b850c9f37..5e1c907b383a 100644 --- a/beacon-chain/cache/registration.go +++ b/beacon-chain/cache/registration.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // RegistrationCache is used to store the cached results of an Validator Registration request. diff --git a/beacon-chain/cache/skip_slot_cache.go b/beacon-chain/cache/skip_slot_cache.go index 4e9538b197e1..41f79d1f446f 100644 --- a/beacon-chain/cache/skip_slot_cache.go +++ b/beacon-chain/cache/skip_slot_cache.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) var ( @@ -92,17 +92,17 @@ func (c *SkipSlotCache) Get(ctx context.Context, r [32]byte) (state.BeaconState, delay *= delayFactor delay = math.Min(delay, maxDelay) } - span.AddAttributes(trace.BoolAttribute("inProgress", inProgress)) + span.SetAttributes(trace.BoolAttribute("inProgress", inProgress)) item, exists := c.cache.Get(r) if exists && item != nil { skipSlotCacheHit.Inc() - span.AddAttributes(trace.BoolAttribute("hit", true)) + span.SetAttributes(trace.BoolAttribute("hit", true)) return item.(state.BeaconState).Copy(), nil } skipSlotCacheMiss.Inc() - span.AddAttributes(trace.BoolAttribute("hit", false)) + span.SetAttributes(trace.BoolAttribute("hit", false)) return nil, nil } diff --git a/beacon-chain/core/electra/BUILD.bazel b/beacon-chain/core/electra/BUILD.bazel index 8e9da396597d..748f01272611 100644 --- a/beacon-chain/core/electra/BUILD.bazel +++ b/beacon-chain/core/electra/BUILD.bazel @@ -34,13 +34,13 @@ go_library( "//contracts/deposit:go_default_library", "//encoding/bytesutil:go_default_library", "//math:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/core/electra/consolidations.go b/beacon-chain/core/electra/consolidations.go index 0db8168e1cab..70d3ba4ee17d 100644 --- a/beacon-chain/core/electra/consolidations.go +++ b/beacon-chain/core/electra/consolidations.go @@ -11,10 +11,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // ProcessPendingConsolidations implements the spec definition below. This method makes mutating diff --git a/beacon-chain/core/electra/deposits.go b/beacon-chain/core/electra/deposits.go index 27733667115b..e9d753b5a3b9 100644 --- a/beacon-chain/core/electra/deposits.go +++ b/beacon-chain/core/electra/deposits.go @@ -13,12 +13,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/contracts/deposit" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // ProcessDeposits is one of the operations performed on each processed diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 97388eba7bcc..78be77ce467e 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) // Re-exports for methods that haven't changed in Electra. diff --git a/beacon-chain/core/electra/withdrawals.go b/beacon-chain/core/electra/withdrawals.go index 13ccbc08f204..e2b2cf88782c 100644 --- a/beacon-chain/core/electra/withdrawals.go +++ b/beacon-chain/core/electra/withdrawals.go @@ -12,11 +12,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // ProcessWithdrawalRequests processes the validator withdrawals from the provided execution payload diff --git a/beacon-chain/core/epoch/precompute/BUILD.bazel b/beacon-chain/core/epoch/precompute/BUILD.bazel index 73cca06e2840..d16cd58091bd 100644 --- a/beacon-chain/core/epoch/precompute/BUILD.bazel +++ b/beacon-chain/core/epoch/precompute/BUILD.bazel @@ -31,7 +31,6 @@ go_library( "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/core/epoch/precompute/new.go b/beacon-chain/core/epoch/precompute/new.go index b4f74900e352..2f77e82d8990 100644 --- a/beacon-chain/core/epoch/precompute/new.go +++ b/beacon-chain/core/epoch/precompute/new.go @@ -11,7 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) // New gets called at the beginning of process epoch cycle to return diff --git a/beacon-chain/core/transition/BUILD.bazel b/beacon-chain/core/transition/BUILD.bazel index dde088dd563f..be7d42ada04e 100644 --- a/beacon-chain/core/transition/BUILD.bazel +++ b/beacon-chain/core/transition/BUILD.bazel @@ -49,7 +49,7 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", + "@io_opentelemetry_go_otel_trace//:go_default_library", ], ) diff --git a/beacon-chain/core/transition/transition.go b/beacon-chain/core/transition/transition.go index e16b5c920e59..0ffe051795e7 100644 --- a/beacon-chain/core/transition/transition.go +++ b/beacon-chain/core/transition/transition.go @@ -25,9 +25,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" + prysmTrace "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" - goTrace "go.opencensus.io/trace" + "go.opentelemetry.io/otel/trace" ) type customProcessingFn func(context.Context, state.BeaconState) error @@ -63,7 +63,7 @@ func ExecuteStateTransition( return nil, err } - ctx, span := trace.StartSpan(ctx, "core.state.ExecuteStateTransition") + ctx, span := prysmTrace.StartSpan(ctx, "core.state.ExecuteStateTransition") defer span.End() var err error @@ -103,9 +103,9 @@ func ExecuteStateTransition( // previous_block_root = hash_tree_root(state.latest_block_header) // state.block_roots[state.slot % SLOTS_PER_HISTORICAL_ROOT] = previous_block_root func ProcessSlot(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { - ctx, span := trace.StartSpan(ctx, "core.state.ProcessSlot") + ctx, span := prysmTrace.StartSpan(ctx, "core.state.ProcessSlot") defer span.End() - span.AddAttributes(trace.Int64Attribute("slot", int64(state.Slot()))) // lint:ignore uintcast -- This is OK for tracing. + span.SetAttributes(prysmTrace.Int64Attribute("slot", int64(state.Slot()))) // lint:ignore uintcast -- This is OK for tracing. prevStateRoot, err := state.HashTreeRoot(ctx) if err != nil { @@ -148,7 +148,7 @@ func ProcessSlotsUsingNextSlotCache( parentState state.BeaconState, parentRoot []byte, slot primitives.Slot) (state.BeaconState, error) { - ctx, span := trace.StartSpan(ctx, "core.state.ProcessSlotsUsingNextSlotCache") + ctx, span := prysmTrace.StartSpan(ctx, "core.state.ProcessSlotsUsingNextSlotCache") defer span.End() nextSlotState := NextSlotState(parentRoot, slot) @@ -178,12 +178,12 @@ func ProcessSlotsIfPossible(ctx context.Context, state state.BeaconState, target // ProcessSlots includes core slot processing as well as a cache func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives.Slot) (state.BeaconState, error) { - ctx, span := trace.StartSpan(ctx, "core.state.ProcessSlots") + ctx, span := prysmTrace.StartSpan(ctx, "core.state.ProcessSlots") defer span.End() if state == nil || state.IsNil() { return nil, errors.New("nil state") } - span.AddAttributes(trace.Int64Attribute("slots", int64(slot)-int64(state.Slot()))) // lint:ignore uintcast -- This is OK for tracing. + span.SetAttributes(prysmTrace.Int64Attribute("slots", int64(slot)-int64(state.Slot()))) // lint:ignore uintcast -- This is OK for tracing. // The block must have a higher slot than parent state. if state.Slot() >= slot { @@ -259,7 +259,7 @@ func cacheBestBeaconStateOnErrFn(highestSlot primitives.Slot, key [32]byte) cust // if (state.slot + 1) % SLOTS_PER_EPOCH == 0: // process_epoch(state) // state.slot = Slot(state.slot + 1) -func ProcessSlotsCore(ctx context.Context, span *goTrace.Span, state state.BeaconState, slot primitives.Slot, fn customProcessingFn) (state.BeaconState, error) { +func ProcessSlotsCore(ctx context.Context, span trace.Span, state state.BeaconState, slot primitives.Slot, fn customProcessingFn) (state.BeaconState, error) { var err error for state.Slot() < slot { if fn != nil { @@ -318,7 +318,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta // UpgradeState upgrades the state to the next version if possible. func UpgradeState(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { - ctx, span := trace.StartSpan(ctx, "core.state.UpgradeState") + ctx, span := prysmTrace.StartSpan(ctx, "core.state.UpgradeState") defer span.End() var err error @@ -445,9 +445,9 @@ func VerifyOperationLengths(_ context.Context, state state.BeaconState, b interf // ProcessEpochPrecompute describes the per epoch operations that are performed on the beacon state. // It's optimized by pre computing validator attested info and epoch total/attested balances upfront. func ProcessEpochPrecompute(ctx context.Context, state state.BeaconState) (state.BeaconState, error) { - ctx, span := trace.StartSpan(ctx, "core.state.ProcessEpochPrecompute") + ctx, span := prysmTrace.StartSpan(ctx, "core.state.ProcessEpochPrecompute") defer span.End() - span.AddAttributes(trace.Int64Attribute("epoch", int64(time.CurrentEpoch(state)))) // lint:ignore uintcast -- This is OK for tracing. + span.SetAttributes(prysmTrace.Int64Attribute("epoch", int64(time.CurrentEpoch(state)))) // lint:ignore uintcast -- This is OK for tracing. if state == nil || state.IsNil() { return nil, errors.New("nil state") diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index 71b7f7ba4172..9de4f5c7b5f2 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -70,7 +70,6 @@ go_library( "@com_github_schollz_progressbar_v3//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_etcd_go_bbolt//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/db/kv/archived_point.go b/beacon-chain/db/kv/archived_point.go index 64394f5c54c8..64a0aaa35126 100644 --- a/beacon-chain/db/kv/archived_point.go +++ b/beacon-chain/db/kv/archived_point.go @@ -5,8 +5,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // LastArchivedSlot from the db. diff --git a/beacon-chain/db/kv/backfill.go b/beacon-chain/db/kv/backfill.go index ad2497b85814..1f34949a8b48 100644 --- a/beacon-chain/db/kv/backfill.go +++ b/beacon-chain/db/kv/backfill.go @@ -4,9 +4,9 @@ import ( "context" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/proto/dbval" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/beacon-chain/db/kv/deposit_contract.go b/beacon-chain/db/kv/deposit_contract.go index 3e67b1925b43..e747b149c505 100644 --- a/beacon-chain/db/kv/deposit_contract.go +++ b/beacon-chain/db/kv/deposit_contract.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // DepositContractAddress returns contract address is the address of diff --git a/beacon-chain/db/kv/encoding.go b/beacon-chain/db/kv/encoding.go index 8af8efa035d3..8149120fe2cb 100644 --- a/beacon-chain/db/kv/encoding.go +++ b/beacon-chain/db/kv/encoding.go @@ -7,8 +7,8 @@ import ( "github.com/golang/snappy" fastssz "github.com/prysmaticlabs/fastssz" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) diff --git a/beacon-chain/db/kv/lightclient.go b/beacon-chain/db/kv/lightclient.go index 4677dc6adbbe..3c7bef3ff5f1 100644 --- a/beacon-chain/db/kv/lightclient.go +++ b/beacon-chain/db/kv/lightclient.go @@ -6,9 +6,9 @@ import ( "fmt" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) func (s *Store) SaveLightClientUpdate(ctx context.Context, period uint64, update *ethpbv2.LightClientUpdateWithVersion) error { diff --git a/beacon-chain/db/kv/state.go b/beacon-chain/db/kv/state.go index 05ae8b978ecf..b78e45ab25bd 100644 --- a/beacon-chain/db/kv/state.go +++ b/beacon-chain/db/kv/state.go @@ -16,11 +16,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" ) // State returns the saved state using block's signing root, @@ -74,7 +74,7 @@ func (s *Store) GenesisState(ctx context.Context) (state.BeaconState, error) { tracing.AnnotateError(span, err) return nil, err } - span.AddAttributes(trace.BoolAttribute("cache_hit", cached != nil)) + span.SetAttributes(trace.BoolAttribute("cache_hit", cached != nil)) if cached != nil { return cached, nil } diff --git a/beacon-chain/db/slasherkv/BUILD.bazel b/beacon-chain/db/slasherkv/BUILD.bazel index 5cfdd142b48b..3c9fe389817f 100644 --- a/beacon-chain/db/slasherkv/BUILD.bazel +++ b/beacon-chain/db/slasherkv/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_golang_snappy//:go_default_library", @@ -29,7 +30,6 @@ go_library( "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_etcd_go_bbolt//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_x_sync//errgroup:go_default_library", ], ) diff --git a/beacon-chain/db/slasherkv/slasher.go b/beacon-chain/db/slasherkv/slasher.go index 2d52da30ee0e..9b7b57388a78 100644 --- a/beacon-chain/db/slasherkv/slasher.go +++ b/beacon-chain/db/slasherkv/slasher.go @@ -14,9 +14,9 @@ import ( slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" bolt "go.etcd.io/bbolt" - "go.opencensus.io/trace" "golang.org/x/sync/errgroup" ) diff --git a/beacon-chain/execution/block_reader.go b/beacon-chain/execution/block_reader.go index 985b92e90391..e3deacd422f0 100644 --- a/beacon-chain/execution/block_reader.go +++ b/beacon-chain/execution/block_reader.go @@ -31,10 +31,10 @@ func (s *Service) BlockExists(ctx context.Context, hash common.Hash) (bool, *big if err != nil { return false, nil, err } - span.AddAttributes(trace.BoolAttribute("blockCacheHit", true)) + span.SetAttributes(trace.BoolAttribute("blockCacheHit", true)) return true, hdrInfo.Number, nil } - span.AddAttributes(trace.BoolAttribute("blockCacheHit", false)) + span.SetAttributes(trace.BoolAttribute("blockCacheHit", false)) header, err := s.HeaderByHash(ctx, hash) if err != nil { return false, big.NewInt(0), errors.Wrap(err, "could not query block with given hash") @@ -56,10 +56,10 @@ func (s *Service) BlockHashByHeight(ctx context.Context, height *big.Int) (commo if err != nil { return [32]byte{}, err } - span.AddAttributes(trace.BoolAttribute("headerCacheHit", true)) + span.SetAttributes(trace.BoolAttribute("headerCacheHit", true)) return hInfo.Hash, nil } - span.AddAttributes(trace.BoolAttribute("headerCacheHit", false)) + span.SetAttributes(trace.BoolAttribute("headerCacheHit", false)) if s.rpcClient == nil { err := errors.New("nil rpc client") diff --git a/beacon-chain/node/config.go b/beacon-chain/node/config.go index f389cba98eae..eac5b90479f9 100644 --- a/beacon-chain/node/config.go +++ b/beacon-chain/node/config.go @@ -8,12 +8,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - tracing2 "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/urfave/cli/v2" ) func configureTracing(cliCtx *cli.Context) error { - return tracing2.Setup( + return tracing.Setup( "beacon-chain", // service name cliCtx.String(cmd.TracingProcessNameFlag.Name), cliCtx.String(cmd.TracingEndpointFlag.Name), diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index c1c42dd9d347..451b1cba93b0 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "//config/features:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", @@ -32,7 +33,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/operations/attestations/kv/BUILD.bazel b/beacon-chain/operations/attestations/kv/BUILD.bazel index b79625e8427e..ab66a61f7699 100644 --- a/beacon-chain/operations/attestations/kv/BUILD.bazel +++ b/beacon-chain/operations/attestations/kv/BUILD.bazel @@ -16,6 +16,7 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", @@ -24,7 +25,6 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index 8d6081f280e3..8df54183ecce 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -8,12 +8,12 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/runtime/version" log "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // AggregateUnaggregatedAttestations aggregates the unaggregated attestations and saves the diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index f49f666b561f..d4c1af2b47bc 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -6,10 +6,10 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) // SaveUnaggregatedAttestation saves an unaggregated attestation in cache. diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index 7eef4065c62f..0b2e8f7dbcf8 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -9,11 +9,11 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // This prepares fork choice attestations by running batchForkChoiceAtts diff --git a/beacon-chain/operations/slashings/BUILD.bazel b/beacon-chain/operations/slashings/BUILD.bazel index e8d40e847377..f4f21b7bb4a1 100644 --- a/beacon-chain/operations/slashings/BUILD.bazel +++ b/beacon-chain/operations/slashings/BUILD.bazel @@ -23,13 +23,13 @@ go_library( "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_trailofbits_go_mutexasserts//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/operations/slashings/service.go b/beacon-chain/operations/slashings/service.go index ef7370975efa..803d2530495a 100644 --- a/beacon-chain/operations/slashings/service.go +++ b/beacon-chain/operations/slashings/service.go @@ -13,9 +13,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/trailofbits/go-mutexasserts" - "go.opencensus.io/trace" ) // NewPool returns an initialized attester slashing and proposer slashing pool. diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index baa53ee11d1a..7d1798957d4a 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -105,7 +105,6 @@ go_library( "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index 2c274fb2a3df..4c3e6ed54f51 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -110,7 +110,7 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 hasPeer := s.hasPeerWithSubnet(attestationToTopic(subnet, forkDigest)) s.subnetLocker(subnet).RUnlock() - span.AddAttributes( + span.SetAttributes( trace.BoolAttribute("hasPeer", hasPeer), trace.Int64Attribute("slot", int64(att.GetData().Slot)), // lint:ignore uintcast -- It's safe to do this for tracing. trace.Int64Attribute("subnet", int64(subnet)), // lint:ignore uintcast -- It's safe to do this for tracing. @@ -169,7 +169,7 @@ func (s *Service) broadcastSyncCommittee(ctx context.Context, subnet uint64, sMs hasPeer := s.hasPeerWithSubnet(syncCommitteeToTopic(subnet, forkDigest)) s.subnetLocker(wrappedSubIdx).RUnlock() - span.AddAttributes( + span.SetAttributes( trace.BoolAttribute("hasPeer", hasPeer), trace.Int64Attribute("slot", int64(sMsg.Slot)), // lint:ignore uintcast -- It's safe to do this for tracing. trace.Int64Attribute("subnet", int64(subnet)), // lint:ignore uintcast -- It's safe to do this for tracing. @@ -273,7 +273,7 @@ func (s *Service) broadcastObject(ctx context.Context, obj ssz.Marshaler, topic ctx, span := trace.StartSpan(ctx, "p2p.broadcastObject") defer span.End() - span.AddAttributes(trace.StringAttribute("topic", topic)) + span.SetAttributes(trace.StringAttribute("topic", topic)) buf := new(bytes.Buffer) if _, err := s.Encoding().EncodeGossip(buf, obj); err != nil { @@ -282,12 +282,12 @@ func (s *Service) broadcastObject(ctx context.Context, obj ssz.Marshaler, topic return err } - if span.IsRecordingEvents() { + if span.IsRecording() { id := hash.FastSum64(buf.Bytes()) messageLen := int64(buf.Len()) // lint:ignore uintcast -- It's safe to do this for tracing. iid := int64(id) - span.AddMessageSendEvent(iid, messageLen /*uncompressed*/, messageLen /*compressed*/) + span = trace.AddMessageSendEvent(span, iid, messageLen /*uncompressed*/, messageLen /*compressed*/) } if err := s.PublishToTopic(ctx, topic+s.Encoding().ProtocolSuffix(), buf.Bytes()); err != nil { err := errors.Wrap(err, "could not publish message") diff --git a/beacon-chain/p2p/dial_relay_node.go b/beacon-chain/p2p/dial_relay_node.go index 91564f08ee6e..22b55367424b 100644 --- a/beacon-chain/p2p/dial_relay_node.go +++ b/beacon-chain/p2p/dial_relay_node.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) // MakePeer from multiaddress string. diff --git a/beacon-chain/p2p/sender.go b/beacon-chain/p2p/sender.go index cacf5da124ff..0a47345effa2 100644 --- a/beacon-chain/p2p/sender.go +++ b/beacon-chain/p2p/sender.go @@ -10,8 +10,8 @@ import ( "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // Send a message to a specific peer. The returned stream may be used for reading, but has been @@ -25,7 +25,7 @@ func (s *Service) Send(ctx context.Context, message interface{}, baseTopic strin return nil, err } topic := baseTopic + s.Encoding().ProtocolSuffix() - span.AddAttributes(trace.StringAttribute("topic", topic)) + span.SetAttributes(trace.StringAttribute("topic", topic)) log.WithFields(logrus.Fields{ "topic": topic, diff --git a/beacon-chain/p2p/subnets.go b/beacon-chain/p2p/subnets.go index 25c335a5421e..552d639a4c35 100644 --- a/beacon-chain/p2p/subnets.go +++ b/beacon-chain/p2p/subnets.go @@ -57,7 +57,7 @@ func (s *Service) FindPeersWithSubnet(ctx context.Context, topic string, ctx, span := trace.StartSpan(ctx, "p2p.FindPeersWithSubnet") defer span.End() - span.AddAttributes(trace.Int64Attribute("index", int64(index))) // lint:ignore uintcast -- It's safe to do this for tracing. + span.SetAttributes(trace.Int64Attribute("index", int64(index))) // lint:ignore uintcast -- It's safe to do this for tracing. if s.dv5Listener == nil { // return if discovery isn't set diff --git a/beacon-chain/rpc/core/BUILD.bazel b/beacon-chain/rpc/core/BUILD.bazel index 221b83286eb7..b59af8635330 100644 --- a/beacon-chain/rpc/core/BUILD.bazel +++ b/beacon-chain/rpc/core/BUILD.bazel @@ -36,13 +36,13 @@ go_library( "//consensus-types/validator:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_x_sync//errgroup:go_default_library", ], diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 171b55d57419..472eb8265293 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -25,12 +25,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" prysmTime "github.com/prysmaticlabs/prysm/v5/time" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "golang.org/x/sync/errgroup" ) diff --git a/beacon-chain/rpc/eth/beacon/BUILD.bazel b/beacon-chain/rpc/eth/beacon/BUILD.bazel index cc40135b5dff..3b44d87bb904 100644 --- a/beacon-chain/rpc/eth/beacon/BUILD.bazel +++ b/beacon-chain/rpc/eth/beacon/BUILD.bazel @@ -52,6 +52,7 @@ go_library( "//consensus-types/validator:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", @@ -60,7 +61,6 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index a9c1bfb81389..f657ab246b85 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -28,12 +28,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) const ( diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool.go b/beacon-chain/rpc/eth/beacon/handlers_pool.go index e78a91ca9aed..9af9a0320f85 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool.go @@ -23,11 +23,11 @@ import ( consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) const broadcastBLSChangesRateLimit = 128 diff --git a/beacon-chain/rpc/eth/beacon/handlers_state.go b/beacon-chain/rpc/eth/beacon/handlers_state.go index 5b41597a14be..ad1d2abdd526 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_state.go +++ b/beacon-chain/rpc/eth/beacon/handlers_state.go @@ -17,10 +17,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpbalpha "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) type syncCommitteeStateRequest struct { diff --git a/beacon-chain/rpc/eth/beacon/handlers_validator.go b/beacon-chain/rpc/eth/beacon/handlers_validator.go index 82782415abe8..77bc703bddc2 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_validator.go +++ b/beacon-chain/rpc/eth/beacon/handlers_validator.go @@ -19,9 +19,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // GetValidators returns filterable list of validators with their balance, status and index. diff --git a/beacon-chain/rpc/eth/blob/BUILD.bazel b/beacon-chain/rpc/eth/blob/BUILD.bazel index 438f8313daf7..396eeec6ed5d 100644 --- a/beacon-chain/rpc/eth/blob/BUILD.bazel +++ b/beacon-chain/rpc/eth/blob/BUILD.bazel @@ -13,10 +13,10 @@ go_library( "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//config/fieldparams:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/blob/handlers.go b/beacon-chain/rpc/eth/blob/handlers.go index dd40c4620135..0fcaef08a848 100644 --- a/beacon-chain/rpc/eth/blob/handlers.go +++ b/beacon-chain/rpc/eth/blob/handlers.go @@ -11,9 +11,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // Blobs is an HTTP handler for Beacon API getBlobs. diff --git a/beacon-chain/rpc/eth/config/BUILD.bazel b/beacon-chain/rpc/eth/config/BUILD.bazel index 92d73dcb8def..cbd920b5dec1 100644 --- a/beacon-chain/rpc/eth/config/BUILD.bazel +++ b/beacon-chain/rpc/eth/config/BUILD.bazel @@ -8,10 +8,10 @@ go_library( deps = [ "//api/server/structs:go_default_library", "//config/params:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/forks:go_default_library", "//network/httputil:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/config/handlers.go b/beacon-chain/rpc/eth/config/handlers.go index c0a9f769d1d4..b5f103c90222 100644 --- a/beacon-chain/rpc/eth/config/handlers.go +++ b/beacon-chain/rpc/eth/config/handlers.go @@ -10,9 +10,9 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/forks" "github.com/prysmaticlabs/prysm/v5/network/httputil" - "go.opencensus.io/trace" ) // GetDepositContract retrieves deposit contract address and genesis fork version. diff --git a/beacon-chain/rpc/eth/debug/BUILD.bazel b/beacon-chain/rpc/eth/debug/BUILD.bazel index 9cedc643277d..87b922c9bd29 100644 --- a/beacon-chain/rpc/eth/debug/BUILD.bazel +++ b/beacon-chain/rpc/eth/debug/BUILD.bazel @@ -16,10 +16,10 @@ go_library( "//beacon-chain/rpc/eth/helpers:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//runtime/version:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/debug/handlers.go b/beacon-chain/rpc/eth/debug/handlers.go index f2199dc43ff5..f3c88752c023 100644 --- a/beacon-chain/rpc/eth/debug/handlers.go +++ b/beacon-chain/rpc/eth/debug/handlers.go @@ -11,9 +11,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) const errMsgStateFromConsensus = "Could not convert consensus state to response" diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index 4d41cdc89c09..4b1aee2d28cd 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -25,6 +25,7 @@ go_library( "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/ssz:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", @@ -34,7 +35,6 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_wealdtech_go_bytesutil//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 410664dfc4aa..3137eda4cd2c 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -15,10 +15,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" types "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/wealdtech/go-bytesutil" - "go.opencensus.io/trace" ) // GetLightClientBootstrap - implements https://github.com/ethereum/beacon-APIs/blob/263f4ed6c263c967f13279c7a9f5629b51c5fc55/apis/beacon/light_client/bootstrap.yaml diff --git a/beacon-chain/rpc/eth/node/BUILD.bazel b/beacon-chain/rpc/eth/node/BUILD.bazel index 4f5b75990394..5b35395a1b34 100644 --- a/beacon-chain/rpc/eth/node/BUILD.bazel +++ b/beacon-chain/rpc/eth/node/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//beacon-chain/p2p/peers/peerdata:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/sync:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/migration:go_default_library", @@ -27,7 +28,6 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/node/handlers.go b/beacon-chain/rpc/eth/node/handlers.go index 7ccae43ed4ad..63c795316f5e 100644 --- a/beacon-chain/rpc/eth/node/handlers.go +++ b/beacon-chain/rpc/eth/node/handlers.go @@ -10,10 +10,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) var ( diff --git a/beacon-chain/rpc/eth/node/handlers_peers.go b/beacon-chain/rpc/eth/node/handlers_peers.go index 9dbbcd5baf5f..039b247bed8a 100644 --- a/beacon-chain/rpc/eth/node/handlers_peers.go +++ b/beacon-chain/rpc/eth/node/handlers_peers.go @@ -11,10 +11,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/peerdata" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/proto/migration" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // GetPeer retrieves data about the given peer. diff --git a/beacon-chain/rpc/eth/rewards/BUILD.bazel b/beacon-chain/rpc/eth/rewards/BUILD.bazel index a41bb4e7d562..7636fab75e54 100644 --- a/beacon-chain/rpc/eth/rewards/BUILD.bazel +++ b/beacon-chain/rpc/eth/rewards/BUILD.bazel @@ -27,11 +27,11 @@ go_library( "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_wealdtech_go_bytesutil//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/rewards/handlers.go b/beacon-chain/rpc/eth/rewards/handlers.go index 762a119bdac4..8c6520d62c30 100644 --- a/beacon-chain/rpc/eth/rewards/handlers.go +++ b/beacon-chain/rpc/eth/rewards/handlers.go @@ -16,11 +16,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/wealdtech/go-bytesutil" - "go.opencensus.io/trace" ) // BlockRewards is an HTTP handler for Beacon API getBlockRewards. diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 3d0a74174ddf..dc941ae72578 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -45,7 +45,6 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//status:go_default_library", "@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers_block.go b/beacon-chain/rpc/eth/validator/handlers_block.go index bf444aafa59c..32c67a971cd6 100644 --- a/beacon-chain/rpc/eth/validator/handlers_block.go +++ b/beacon-chain/rpc/eth/validator/handlers_block.go @@ -17,10 +17,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" "google.golang.org/protobuf/types/known/wrapperspb" ) diff --git a/beacon-chain/rpc/lookup/BUILD.bazel b/beacon-chain/rpc/lookup/BUILD.bazel index 0a70a9991612..59ae22c64afa 100644 --- a/beacon-chain/rpc/lookup/BUILD.bazel +++ b/beacon-chain/rpc/lookup/BUILD.bazel @@ -21,11 +21,11 @@ go_library( "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/lookup/stater.go b/beacon-chain/rpc/lookup/stater.go index f993fe2d3324..101f46ecdcb0 100644 --- a/beacon-chain/rpc/lookup/stater.go +++ b/beacon-chain/rpc/lookup/stater.go @@ -17,8 +17,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // StateIdParseError represents an error scenario where a state ID could not be parsed. diff --git a/beacon-chain/rpc/prysm/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/beacon/BUILD.bazel index e6528e11d9b6..e4f78cdfbbfa 100644 --- a/beacon-chain/rpc/prysm/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/beacon/BUILD.bazel @@ -24,13 +24,13 @@ go_library( "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/beacon/handlers.go b/beacon-chain/rpc/prysm/beacon/handlers.go index c6189334fec5..c98a6d5580e6 100644 --- a/beacon-chain/rpc/prysm/beacon/handlers.go +++ b/beacon-chain/rpc/prysm/beacon/handlers.go @@ -16,10 +16,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // GetWeakSubjectivity computes the starting epoch of the current weak subjectivity period, and then also diff --git a/beacon-chain/rpc/prysm/beacon/validator_count.go b/beacon-chain/rpc/prysm/beacon/validator_count.go index b537532db874..94c0d45c5939 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count.go @@ -13,11 +13,11 @@ import ( statenative "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // GetValidatorCount is a HTTP handler that serves the GET /eth/v1/beacon/states/{state_id}/validator_count endpoint. diff --git a/beacon-chain/rpc/prysm/node/BUILD.bazel b/beacon-chain/rpc/prysm/node/BUILD.bazel index 6911f88d1150..cea92902b96b 100644 --- a/beacon-chain/rpc/prysm/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/node/BUILD.bazel @@ -17,12 +17,12 @@ go_library( "//beacon-chain/p2p/peers:go_default_library", "//beacon-chain/p2p/peers/peerdata:go_default_library", "//beacon-chain/sync:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_libp2p_go_libp2p//core/network:go_default_library", "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/node/handlers.go b/beacon-chain/rpc/prysm/node/handlers.go index d0a8d00b9714..8fbe374937f1 100644 --- a/beacon-chain/rpc/prysm/node/handlers.go +++ b/beacon-chain/rpc/prysm/node/handlers.go @@ -13,9 +13,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/peerdata" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // ListTrustedPeer retrieves data about the node's trusted peers. diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index 0d6f2d04a328..cd5ed7813354 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -89,8 +89,9 @@ func TestNodeServer_GetImplementedServices(t *testing.T) { res, err := ns.ListImplementedServices(context.Background(), &emptypb.Empty{}) require.NoError(t, err) - // We verify the services include the node service + the 2 registered reflection services. - assert.Equal(t, 2, len(res.Services)) + // Expecting node service and Server reflect. As of grpc, v1.65.0, there are two version of server reflection + // Services: [ethereum.eth.v1alpha1.Node grpc.reflection.v1.ServerReflection grpc.reflection.v1alpha.ServerReflection] + assert.Equal(t, 3, len(res.Services)) } func TestNodeServer_GetHost(t *testing.T) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index 82fbce0ef92d..0d37de6e026a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -21,7 +21,7 @@ import ( func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb.AggregateSelectionRequest) (*ethpb.AggregateSelectionResponse, error) { ctx, span := trace.StartSpan(ctx, "AggregatorServer.SubmitAggregateSelectionProof") defer span.End() - span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) + span.SetAttributes(trace.Int64Attribute("slot", int64(req.Slot))) indexInCommittee, validatorIndex, err := vs.processAggregateSelection(ctx, req) if err != nil { @@ -53,7 +53,7 @@ func (vs *Server) SubmitAggregateSelectionProofElectra( ) (*ethpb.AggregateSelectionElectraResponse, error) { ctx, span := trace.StartSpan(ctx, "AggregatorServer.SubmitAggregateSelectionProofElectra") defer span.End() - span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) + span.SetAttributes(trace.Int64Attribute("slot", int64(req.Slot))) indexInCommittee, validatorIndex, err := vs.processAggregateSelection(ctx, req) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index d71beb5faf17..5dceed5703b5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -23,7 +23,7 @@ import ( func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { ctx, span := trace.StartSpan(ctx, "AttesterServer.RequestAttestation") defer span.End() - span.AddAttributes( + span.SetAttributes( trace.Int64Attribute("slot", int64(req.Slot)), trace.Int64Attribute("committeeIndex", int64(req.CommitteeIndex)), ) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 660e26dd9add..411428ef2b40 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -50,7 +50,7 @@ const ( func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.GetBeaconBlock") defer span.End() - span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) + span.SetAttributes(trace.Int64Attribute("slot", int64(req.Slot))) t, err := slots.ToTime(uint64(vs.TimeFetcher.GenesisTime().Unix()), req.Slot) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 8f8a95fea6ea..5380eb374a90 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -149,7 +149,7 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc "builderBoostFactor": builderBoostFactor, }).Warn("Proposer: using local execution payload because higher value") } - span.AddAttributes( + span.SetAttributes( trace.BoolAttribute("higherValueBuilder", higherValueBuilder), trace.Int64Attribute("localGweiValue", int64(localValueGwei)), // lint:ignore uintcast -- This is OK for tracing. trace.Int64Attribute("localBoostPercentage", int64(boost)), // lint:ignore uintcast -- This is OK for tracing. @@ -292,7 +292,7 @@ func (vs *Server) getPayloadHeaderFromBuilder(ctx context.Context, slot primitiv } l.Info("Received header with bid") - span.AddAttributes( + span.SetAttributes( trace.StringAttribute("value", primitives.WeiToBigInt(v).String()), trace.StringAttribute("builderPubKey", fmt.Sprintf("%#x", bid.Pubkey())), trace.StringAttribute("blockHash", fmt.Sprintf("%#x", header.BlockHash())), diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_builder.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_builder.go index b85244cadf13..660aea71425a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_builder.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_builder.go @@ -9,8 +9,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // Returns true if builder (ie outsourcing block construction) can be used. Both conditions have to meet: @@ -24,7 +24,7 @@ func (vs *Server) canUseBuilder(ctx context.Context, slot primitives.Slot, idx p return false, nil } activated, err := vs.circuitBreakBuilder(slot) - span.AddAttributes(trace.BoolAttribute("circuitBreakerActivated", activated)) + span.SetAttributes(trace.BoolAttribute("circuitBreakerActivated", activated)) if err != nil { tracing.AnnotateError(span, err) return false, err diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go index 631437fbcea6..56ba2798efcc 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_execution_payload.go @@ -251,7 +251,7 @@ func (vs *Server) getBuilderPayloadAndBlobs(ctx context.Context, if err != nil { return nil, errors.Wrap(err, "failed to check if we can use the builder") } - span.AddAttributes(trace.BoolAttribute("canUseBuilder", canUseBuilder)) + span.SetAttributes(trace.BoolAttribute("canUseBuilder", canUseBuilder)) if !canUseBuilder { return nil, nil } diff --git a/beacon-chain/rpc/prysm/validator/BUILD.bazel b/beacon-chain/rpc/prysm/validator/BUILD.bazel index f5db607d650e..22baf6da1d2c 100644 --- a/beacon-chain/rpc/prysm/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/validator/BUILD.bazel @@ -17,12 +17,12 @@ go_library( "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//consensus-types/primitives:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/rpc/prysm/validator/handlers.go b/beacon-chain/rpc/prysm/validator/handlers.go index 19feb7491b78..f7082a6d66d3 100644 --- a/beacon-chain/rpc/prysm/validator/handlers.go +++ b/beacon-chain/rpc/prysm/validator/handlers.go @@ -9,9 +9,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // GetParticipation retrieves the validator participation information for a given epoch, diff --git a/beacon-chain/rpc/prysm/validator/validator_performance.go b/beacon-chain/rpc/prysm/validator/validator_performance.go index faa8325a78b9..a924dc090607 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance.go @@ -8,9 +8,9 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // GetPerformance is an HTTP handler for GetPerformance. diff --git a/beacon-chain/slasher/BUILD.bazel b/beacon-chain/slasher/BUILD.bazel index 00bf4aaaeacc..b0f0391ac116 100644 --- a/beacon-chain/slasher/BUILD.bazel +++ b/beacon-chain/slasher/BUILD.bazel @@ -39,6 +39,7 @@ go_library( "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//encoding/bytesutil:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -46,7 +47,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_x_exp//maps:go_default_library", ], ) diff --git a/beacon-chain/slasher/detect_attestations.go b/beacon-chain/slasher/detect_attestations.go index 0817e12ce6ae..bbfc1238b20d 100644 --- a/beacon-chain/slasher/detect_attestations.go +++ b/beacon-chain/slasher/detect_attestations.go @@ -9,8 +9,8 @@ import ( slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" "golang.org/x/exp/maps" ) diff --git a/beacon-chain/slasher/detect_blocks.go b/beacon-chain/slasher/detect_blocks.go index 17d354d41962..144e0cdd1c0a 100644 --- a/beacon-chain/slasher/detect_blocks.go +++ b/beacon-chain/slasher/detect_blocks.go @@ -5,8 +5,8 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // detectProposerSlashings takes in signed block header wrappers and returns a list of proposer slashings detected. diff --git a/beacon-chain/state/state-native/BUILD.bazel b/beacon-chain/state/state-native/BUILD.bazel index 10adeab9263a..5404444d5a27 100644 --- a/beacon-chain/state/state-native/BUILD.bazel +++ b/beacon-chain/state/state-native/BUILD.bazel @@ -83,7 +83,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/state/state-native/hasher.go b/beacon-chain/state/state-native/hasher.go index c4e3254c49df..2ca5c74e193b 100644 --- a/beacon-chain/state/state-native/hasher.go +++ b/beacon-chain/state/state-native/hasher.go @@ -12,8 +12,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) // ComputeFieldRootsWithHasher hashes the provided state and returns its respective field roots. diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 648d18879eed..8668e4aee754 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -1179,7 +1179,7 @@ func (b *BeaconState) IsNil() bool { func (b *BeaconState) rootSelector(ctx context.Context, field types.FieldIndex) ([32]byte, error) { _, span := trace.StartSpan(ctx, "beaconState.rootSelector") defer span.End() - span.AddAttributes(trace.StringAttribute("field", field.String())) + span.SetAttributes(trace.StringAttribute("field", field.String())) switch field { case types.GenesisTime: diff --git a/beacon-chain/state/stategen/BUILD.bazel b/beacon-chain/state/stategen/BUILD.bazel index 896bab3d0f04..5905a0a5bdc2 100644 --- a/beacon-chain/state/stategen/BUILD.bazel +++ b/beacon-chain/state/stategen/BUILD.bazel @@ -44,7 +44,6 @@ go_library( "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_k8s_client_go//tools/cache:go_default_library", - "@io_opencensus_go//trace:go_default_library", ], ) diff --git a/beacon-chain/state/stategen/history.go b/beacon-chain/state/stategen/history.go index 5a4f2adfc511..6e33d8a480ae 100644 --- a/beacon-chain/state/stategen/history.go +++ b/beacon-chain/state/stategen/history.go @@ -11,7 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "go.opencensus.io/trace" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ) func WithCache(c CachedGetter) CanonicalHistoryOption { diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index c19ba7e4c4b0..1d83ac98ad6f 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -139,7 +139,7 @@ go_library( "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_trailofbits_go_mutexasserts//:go_default_library", - "@io_opencensus_go//trace:go_default_library", + "@io_opentelemetry_go_otel_trace//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/beacon-chain/sync/pending_blocks_queue.go b/beacon-chain/sync/pending_blocks_queue.go index a50179aed43c..5e639e042832 100644 --- a/beacon-chain/sync/pending_blocks_queue.go +++ b/beacon-chain/sync/pending_blocks_queue.go @@ -21,11 +21,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/ssz/equality" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" + prysmTrace "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" "github.com/trailofbits/go-mutexasserts" - goTrace "go.opencensus.io/trace" + "go.opentelemetry.io/otel/trace" ) var processPendingBlocksPeriod = slots.DivideSlotBy(3 /* times per slot */) @@ -53,7 +53,7 @@ func (s *Service) processPendingBlocksQueue() { // processPendingBlocks validates, processes, and broadcasts pending blocks. func (s *Service) processPendingBlocks(ctx context.Context) error { - ctx, span := trace.StartSpan(ctx, "processPendingBlocks") + ctx, span := prysmTrace.StartSpan(ctx, "processPendingBlocks") defer span.End() // Remove old blocks from our expiration cache. @@ -67,7 +67,7 @@ func (s *Service) processPendingBlocks(ctx context.Context) error { // Sort slots for ordered processing. sortedSlots := s.sortedPendingSlots() - span.AddAttributes(trace.Int64Attribute("numSlots", int64(len(sortedSlots))), trace.Int64Attribute("numPeers", int64(len(s.cfg.p2p.Peers().Connected())))) + span.SetAttributes(prysmTrace.Int64Attribute("numSlots", int64(len(sortedSlots))), prysmTrace.Int64Attribute("numPeers", int64(len(s.cfg.p2p.Peers().Connected())))) randGen := rand.NewGenerator() var parentRoots [][32]byte @@ -158,9 +158,9 @@ func (s *Service) processPendingBlocks(ctx context.Context) error { } // startInnerSpan starts a new tracing span for an inner loop and returns the new context and span. -func startInnerSpan(ctx context.Context, slot primitives.Slot) (context.Context, *goTrace.Span) { - ctx, span := trace.StartSpan(ctx, "processPendingBlocks.InnerLoop") - span.AddAttributes(trace.Int64Attribute("slot", int64(slot))) // lint:ignore uintcast -- This conversion is OK for tracing. +func startInnerSpan(ctx context.Context, slot primitives.Slot) (context.Context, trace.Span) { + ctx, span := prysmTrace.StartSpan(ctx, "processPendingBlocks.InnerLoop") + span.SetAttributes(prysmTrace.Int64Attribute("slot", int64(slot))) // lint:ignore uintcast -- This conversion is OK for tracing. return ctx, span } @@ -255,7 +255,7 @@ func (s *Service) getBestPeers() []core.PeerID { func (s *Service) checkIfBlockIsBad( ctx context.Context, - span *goTrace.Span, + span trace.Span, slot primitives.Slot, b interfaces.ReadOnlySignedBeaconBlock, blkRoot [32]byte, @@ -283,7 +283,7 @@ func (s *Service) checkIfBlockIsBad( } func (s *Service) sendBatchRootRequest(ctx context.Context, roots [][32]byte, randGen *rand.Rand) error { - ctx, span := trace.StartSpan(ctx, "sendBatchRootRequest") + ctx, span := prysmTrace.StartSpan(ctx, "sendBatchRootRequest") defer span.End() roots = dedupRoots(roots) diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index d2bc38f16c30..1c067036f5ee 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -156,8 +156,8 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { ctx, span := trace.StartSpan(ctx, "sync.rpc") defer span.End() - span.AddAttributes(trace.StringAttribute("topic", topic)) - span.AddAttributes(trace.StringAttribute("peer", stream.Conn().RemotePeer().String())) + span.SetAttributes(trace.StringAttribute("topic", topic)) + span.SetAttributes(trace.StringAttribute("peer", stream.Conn().RemotePeer().String())) log := log.WithField("peer", stream.Conn().RemotePeer().String()).WithField("topic", string(stream.Protocol())) // Check before hand that peer is valid. diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_range.go b/beacon-chain/sync/rpc_beacon_blocks_by_range.go index d60533c876f1..116187899fa2 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_range.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_range.go @@ -51,7 +51,7 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa return err } remainingBucketCapacity := blockLimiter.Remaining(stream.Conn().RemotePeer().String()) - span.AddAttributes( + span.SetAttributes( trace.Int64Attribute("start", int64(rp.start)), // lint:ignore uintcast -- This conversion is OK for tracing. trace.Int64Attribute("end", int64(rp.end)), // lint:ignore uintcast -- This conversion is OK for tracing. trace.Int64Attribute("count", int64(m.Count)), diff --git a/beacon-chain/sync/rpc_blob_sidecars_by_range.go b/beacon-chain/sync/rpc_blob_sidecars_by_range.go index 7de9ad03e5ad..7c60beb3234b 100644 --- a/beacon-chain/sync/rpc_blob_sidecars_by_range.go +++ b/beacon-chain/sync/rpc_blob_sidecars_by_range.go @@ -14,9 +14,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) func (s *Service) streamBlobBatch(ctx context.Context, batch blockBatch, wQuota uint64, stream libp2pcore.Stream) (uint64, error) { diff --git a/beacon-chain/sync/rpc_blob_sidecars_by_root.go b/beacon-chain/sync/rpc_blob_sidecars_by_root.go index 57ffa5754438..d49040776b32 100644 --- a/beacon-chain/sync/rpc_blob_sidecars_by_root.go +++ b/beacon-chain/sync/rpc_blob_sidecars_by_root.go @@ -15,8 +15,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // blobSidecarByRootRPCHandler handles the /eth2/beacon_chain/req/blob_sidecars_by_root/1/ RPC request. diff --git a/beacon-chain/sync/subscriber.go b/beacon-chain/sync/subscriber.go index 3b7f7def672c..5d2f054b83d6 100644 --- a/beacon-chain/sync/subscriber.go +++ b/beacon-chain/sync/subscriber.go @@ -24,12 +24,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/forks" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/messagehandler" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" "google.golang.org/protobuf/proto" ) @@ -208,7 +208,7 @@ func (s *Service) subscribeWithBase(topic string, validator wrappedVal, handle s } }() - span.AddAttributes(trace.StringAttribute("topic", topic)) + span.SetAttributes(trace.StringAttribute("topic", topic)) if msg.ValidatorData == nil { log.Error("Received nil message on pubsub") diff --git a/beacon-chain/sync/validate_attester_slashing.go b/beacon-chain/sync/validate_attester_slashing.go index d854a94c0e96..1b752bd55dd7 100644 --- a/beacon-chain/sync/validate_attester_slashing.go +++ b/beacon-chain/sync/validate_attester_slashing.go @@ -13,9 +13,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" - "go.opencensus.io/trace" ) // Clients who receive an attester slashing on this topic MUST validate the conditions within VerifyAttesterSlashing before diff --git a/beacon-chain/sync/validate_beacon_attestation_electra.go b/beacon-chain/sync/validate_beacon_attestation_electra.go index 8ceaee41b9a1..49c6fac2f5a4 100644 --- a/beacon-chain/sync/validate_beacon_attestation_electra.go +++ b/beacon-chain/sync/validate_beacon_attestation_electra.go @@ -6,8 +6,8 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // validateCommitteeIndexElectra implements the following checks from the spec: diff --git a/beacon-chain/sync/validate_beacon_blocks.go b/beacon-chain/sync/validate_beacon_blocks.go index c12407e926f4..06c6e3a7fe09 100644 --- a/beacon-chain/sync/validate_beacon_blocks.go +++ b/beacon-chain/sync/validate_beacon_blocks.go @@ -201,7 +201,7 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms } // Record attribute of valid block. - span.AddAttributes(trace.Int64Attribute("slotInEpoch", int64(blk.Block().Slot()%params.BeaconConfig().SlotsPerEpoch))) + span.SetAttributes(trace.Int64Attribute("slotInEpoch", int64(blk.Block().Slot()%params.BeaconConfig().SlotsPerEpoch))) blkPb, err := blk.Proto() if err != nil { log.WithError(err).WithFields(getBlockFields(blk)).Debug("Could not convert beacon block to protobuf type") diff --git a/beacon-chain/sync/validate_bls_to_execution_change.go b/beacon-chain/sync/validate_bls_to_execution_change.go index 009b2916b1db..76df5e466afb 100644 --- a/beacon-chain/sync/validate_bls_to_execution_change.go +++ b/beacon-chain/sync/validate_bls_to_execution_change.go @@ -7,8 +7,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) func (s *Service) validateBlsToExecutionChange(ctx context.Context, pid peer.ID, msg *pubsub.Message) (pubsub.ValidationResult, error) { diff --git a/beacon-chain/sync/validate_proposer_slashing.go b/beacon-chain/sync/validate_proposer_slashing.go index 88b231822cb1..729484ecb6e3 100644 --- a/beacon-chain/sync/validate_proposer_slashing.go +++ b/beacon-chain/sync/validate_proposer_slashing.go @@ -11,8 +11,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // Clients who receive a proposer slashing on this topic MUST validate the conditions within VerifyProposerSlashing before diff --git a/beacon-chain/sync/validate_voluntary_exit.go b/beacon-chain/sync/validate_voluntary_exit.go index 0426ba276378..7f46cdbcc1b3 100644 --- a/beacon-chain/sync/validate_voluntary_exit.go +++ b/beacon-chain/sync/validate_voluntary_exit.go @@ -11,8 +11,8 @@ import ( opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "go.opencensus.io/trace" ) // Clients who receive a voluntary exit on this topic MUST validate the conditions within process_voluntary_exit before diff --git a/cmd/prysmctl/p2p/client.go b/cmd/prysmctl/p2p/client.go index 470844194d8d..c6fe6e39b849 100644 --- a/cmd/prysmctl/p2p/client.go +++ b/cmd/prysmctl/p2p/client.go @@ -114,7 +114,7 @@ func (c *client) Send( ctx, span := trace.StartSpan(ctx, "p2p.Send") defer span.End() topic := baseTopic + c.Encoding().ProtocolSuffix() - span.AddAttributes(trace.StringAttribute("topic", topic)) + span.SetAttributes(trace.StringAttribute("topic", topic)) // Apply max dial timeout when opening a new stream. ctx, cancel := context.WithTimeout(ctx, 10*time.Minute) diff --git a/consensus-types/blocks/BUILD.bazel b/consensus-types/blocks/BUILD.bazel index 30b4ff0cc1f9..32ba9157fe49 100644 --- a/consensus-types/blocks/BUILD.bazel +++ b/consensus-types/blocks/BUILD.bazel @@ -28,6 +28,7 @@ go_library( "//crypto/hash/htr:go_default_library", "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", + "//monitoring/tracing/trace:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", @@ -35,7 +36,6 @@ go_library( "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_gohashtree//:go_default_library", - "@io_opencensus_go//trace:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/consensus-types/blocks/proofs.go b/consensus-types/blocks/proofs.go index 5b9c756a2b74..362f748b2081 100644 --- a/consensus-types/blocks/proofs.go +++ b/consensus-types/blocks/proofs.go @@ -12,8 +12,8 @@ import ( "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/hash/htr" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/runtime/version" - "go.opencensus.io/trace" ) const ( diff --git a/deps.bzl b/deps.bzl index 7356f1057f9c..47454080dd1e 100644 --- a/deps.bzl +++ b/deps.bzl @@ -373,8 +373,8 @@ def prysm_deps(): go_repository( name = "com_github_cespare_xxhash_v2", importpath = "github.com/cespare/xxhash/v2", - sum = "h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=", - version = "v2.2.0", + sum = "h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=", + version = "v2.3.0", ) go_repository( name = "com_github_chromedp_cdproto", @@ -451,14 +451,14 @@ def prysm_deps(): go_repository( name = "com_github_cncf_udpa_go", importpath = "github.com/cncf/udpa/go", - sum = "h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk=", - version = "v0.0.0-20220112060539-c52dc94e7fbe", + sum = "h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=", + version = "v0.0.0-20201120205902-5459f2c99403", ) go_repository( name = "com_github_cncf_xds_go", importpath = "github.com/cncf/xds/go", - sum = "h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=", - version = "v0.0.0-20230607035331-e9ce68804cb4", + sum = "h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw=", + version = "v0.0.0-20240423153145-555b57ec207b", ) go_repository( name = "com_github_cockroachdb_datadriven", @@ -741,14 +741,14 @@ def prysm_deps(): go_repository( name = "com_github_envoyproxy_go_control_plane", importpath = "github.com/envoyproxy/go-control-plane", - sum = "h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA=", - version = "v0.11.1-0.20230524094728-9239064ad72f", + sum = "h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI=", + version = "v0.12.0", ) go_repository( name = "com_github_envoyproxy_protoc_gen_validate", importpath = "github.com/envoyproxy/protoc-gen-validate", - sum = "h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=", - version = "v0.10.1", + sum = "h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=", + version = "v1.0.4", ) go_repository( name = "com_github_ethereum_c_kzg_4844", @@ -999,8 +999,14 @@ def prysm_deps(): go_repository( name = "com_github_go_logr_logr", importpath = "github.com/go-logr/logr", - sum = "h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=", - version = "v1.4.1", + sum = "h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_go_logr_stdr", + importpath = "github.com/go-logr/stdr", + sum = "h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=", + version = "v1.2.2", ) go_repository( name = "com_github_go_martini_martini", @@ -1149,8 +1155,8 @@ def prysm_deps(): go_repository( name = "com_github_golang_glog", importpath = "github.com/golang/glog", - sum = "h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=", - version = "v1.1.0", + sum = "h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4=", + version = "v1.2.1", ) go_repository( name = "com_github_golang_groupcache", @@ -1173,8 +1179,8 @@ def prysm_deps(): go_repository( name = "com_github_golang_mock", importpath = "github.com/golang/mock", - sum = "h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g=", - version = "v1.5.0", + sum = "h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=", + version = "v1.4.4", ) go_repository( name = "com_github_golang_protobuf", @@ -1271,8 +1277,8 @@ def prysm_deps(): go_repository( name = "com_github_google_uuid", importpath = "github.com/google/uuid", - sum = "h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=", - version = "v1.4.0", + sum = "h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=", + version = "v1.6.0", ) go_repository( name = "com_github_googleapis_gax_go", @@ -2894,8 +2900,8 @@ def prysm_deps(): go_repository( name = "com_github_rogpeppe_go_internal", importpath = "github.com/rogpeppe/go-internal", - sum = "h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=", - version = "v1.11.0", + sum = "h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=", + version = "v1.12.0", ) go_repository( name = "com_github_rs_cors", @@ -3329,12 +3335,6 @@ def prysm_deps(): sum = "h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=", version = "v1.1.0", ) - go_repository( - name = "com_github_uber_jaeger_client_go", - importpath = "github.com/uber/jaeger-client-go", - sum = "h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U=", - version = "v2.25.0+incompatible", - ) go_repository( name = "com_github_ugorji_go_codec", importpath = "github.com/ugorji/go/codec", @@ -3677,14 +3677,14 @@ def prysm_deps(): go_repository( name = "com_google_cloud_go_compute", importpath = "cloud.google.com/go/compute", - sum = "h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=", - version = "v1.20.1", + sum = "h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ=", + version = "v1.19.0", ) go_repository( name = "com_google_cloud_go_compute_metadata", importpath = "cloud.google.com/go/compute/metadata", - sum = "h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=", - version = "v0.2.3", + sum = "h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=", + version = "v0.3.0", ) go_repository( name = "com_google_cloud_go_contactcenterinsights", @@ -4310,6 +4310,12 @@ def prysm_deps(): sum = "h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c=", version = "v0.0.0-20180604144634-d3ebe8f20ae4", ) + go_repository( + name = "dev_cel_expr", + importpath = "cel.dev/expr", + sum = "h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w=", + version = "v0.15.0", + ) go_repository( name = "in_gopkg_alecthomas_kingpin_v2", importpath = "gopkg.in/alecthomas/kingpin.v2", @@ -4519,10 +4525,34 @@ def prysm_deps(): version = "v0.24.0", ) go_repository( - name = "io_opencensus_go_contrib_exporter_jaeger", - importpath = "contrib.go.opencensus.io/exporter/jaeger", - sum = "h1:yGBYzYMewVL0yO9qqJv3Z5+IRhPdU7e9o/2oKpX4YvI=", - version = "v0.2.1", + name = "io_opentelemetry_go_otel", + importpath = "go.opentelemetry.io/otel", + sum = "h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=", + version = "v1.29.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_jaeger", + importpath = "go.opentelemetry.io/otel/exporters/jaeger", + sum = "h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=", + version = "v1.17.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_metric", + importpath = "go.opentelemetry.io/otel/metric", + sum = "h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc=", + version = "v1.29.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_sdk", + importpath = "go.opentelemetry.io/otel/sdk", + sum = "h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo=", + version = "v1.29.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_trace", + importpath = "go.opentelemetry.io/otel/trace", + sum = "h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=", + version = "v1.29.0", ) go_repository( name = "io_rsc_binaryregexp", @@ -4569,8 +4599,8 @@ def prysm_deps(): go_repository( name = "org_golang_google_api", importpath = "google.golang.org/api", - sum = "h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA=", - version = "v0.44.0", + sum = "h1:uWrpz12dpVPn7cojP82mk02XDgTJLDPc2KbVTxrWb4A=", + version = "v0.40.0", ) go_repository( name = "org_golang_google_appengine", @@ -4584,18 +4614,30 @@ def prysm_deps(): sum = "h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=", version = "v0.0.0-20230410155749-daa745c078e1", ) + go_repository( + name = "org_golang_google_genproto_googleapis_api", + importpath = "google.golang.org/genproto/googleapis/api", + sum = "h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=", + version = "v0.0.0-20240528184218-531527333157", + ) + go_repository( + name = "org_golang_google_genproto_googleapis_rpc", + importpath = "google.golang.org/genproto/googleapis/rpc", + sum = "h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=", + version = "v0.0.0-20240528184218-531527333157", + ) go_repository( name = "org_golang_google_grpc", build_file_proto_mode = "disable", importpath = "google.golang.org/grpc", - sum = "h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=", - version = "v1.56.3", + sum = "h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=", + version = "v1.65.0", ) go_repository( name = "org_golang_google_protobuf", importpath = "google.golang.org/protobuf", - sum = "h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=", - version = "v1.34.1", + sum = "h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=", + version = "v1.34.2", ) go_repository( name = "org_golang_x_build", @@ -4606,8 +4648,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_crypto", importpath = "golang.org/x/crypto", - sum = "h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=", - version = "v0.23.0", + sum = "h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=", + version = "v0.26.0", ) go_repository( name = "org_golang_x_exp", @@ -4648,14 +4690,14 @@ def prysm_deps(): go_repository( name = "org_golang_x_net", importpath = "golang.org/x/net", - sum = "h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=", - version = "v0.25.0", + sum = "h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=", + version = "v0.28.0", ) go_repository( name = "org_golang_x_oauth2", importpath = "golang.org/x/oauth2", - sum = "h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=", - version = "v0.16.0", + sum = "h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=", + version = "v0.20.0", ) go_repository( name = "org_golang_x_perf", @@ -4666,14 +4708,14 @@ def prysm_deps(): go_repository( name = "org_golang_x_sync", importpath = "golang.org/x/sync", - sum = "h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=", - version = "v0.7.0", + sum = "h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=", + version = "v0.8.0", ) go_repository( name = "org_golang_x_sys", importpath = "golang.org/x/sys", - sum = "h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=", - version = "v0.20.0", + sum = "h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=", + version = "v0.24.0", ) go_repository( name = "org_golang_x_telemetry", @@ -4684,14 +4726,14 @@ def prysm_deps(): go_repository( name = "org_golang_x_term", importpath = "golang.org/x/term", - sum = "h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=", - version = "v0.20.0", + sum = "h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=", + version = "v0.23.0", ) go_repository( name = "org_golang_x_text", importpath = "golang.org/x/text", - sum = "h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=", - version = "v0.15.0", + sum = "h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=", + version = "v0.17.0", ) go_repository( name = "org_golang_x_time", @@ -4702,8 +4744,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", - sum = "h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=", - version = "v0.21.0", + sum = "h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=", + version = "v0.21.1-0.20240508182429-e35e4ccd0d2d", ) go_repository( name = "org_golang_x_xerrors", diff --git a/go.mod b/go.mod index e2febeb23954..f2a01cad02cc 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.22.0 toolchain go1.22.4 require ( - contrib.go.opencensus.io/exporter/jaeger v0.2.1 github.com/MariusVanDerWijden/FuzzyVM v0.0.0-20240209103030-ec53fa766bf8 github.com/MariusVanDerWijden/tx-fuzz v1.3.3-0.20240227085032-f70dd7c85c97 github.com/aristanetworks/goarista v0.0.0-20200805130819-fd197cf57d96 @@ -29,7 +28,7 @@ require ( github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.6.0 github.com/gostaticanalysis/comment v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 @@ -84,16 +83,20 @@ require ( github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3 go.etcd.io/bbolt v1.3.6 go.opencensus.io v0.24.0 + go.opentelemetry.io/otel v1.29.0 + go.opentelemetry.io/otel/exporters/jaeger v1.17.0 + go.opentelemetry.io/otel/sdk v1.29.0 + go.opentelemetry.io/otel/trace v1.29.0 go.uber.org/automaxprocs v1.5.2 go.uber.org/mock v0.4.0 - golang.org/x/crypto v0.23.0 + golang.org/x/crypto v0.26.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 golang.org/x/mod v0.17.0 - golang.org/x/sync v0.7.0 - golang.org/x/tools v0.21.0 + golang.org/x/sync v0.8.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.56.3 - google.golang.org/protobuf v1.34.1 + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 gopkg.in/d4l3k/messagediff.v1 v1.2.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -112,7 +115,7 @@ require ( github.com/bits-and-blooms/bitset v1.11.0 // indirect github.com/cespare/cp v1.1.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -137,6 +140,7 @@ require ( github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/getsentry/sentry-go v0.25.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect @@ -231,7 +235,7 @@ require ( github.com/quic-go/webtransport-go v0.8.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect @@ -239,19 +243,19 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect - github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect github.com/wealdtech/go-eth2-types/v2 v2.5.2 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect go.uber.org/dig v1.17.1 // indirect go.uber.org/fx v1.22.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect @@ -267,14 +271,12 @@ require ( github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/fatih/color v1.13.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/validator/v10 v10.13.0 github.com/peterh/liner v1.2.0 // indirect github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b - golang.org/x/sys v0.20.0 // indirect - google.golang.org/api v0.44.0 // indirect - google.golang.org/appengine v1.6.7 // indirect + golang.org/x/sys v0.24.0 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect ) diff --git a/go.sum b/go.sum index 27c215fd1908..90af6e2e4b5a 100644 --- a/go.sum +++ b/go.sum @@ -20,9 +20,6 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -41,8 +38,6 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -contrib.go.opencensus.io/exporter/jaeger v0.2.1 h1:yGBYzYMewVL0yO9qqJv3Z5+IRhPdU7e9o/2oKpX4YvI= -contrib.go.opencensus.io/exporter/jaeger v0.2.1/go.mod h1:Y8IsLgdxqh1QxYxPC5IgXVmBaeLUeQFfBeBi9PbeZd0= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= @@ -122,8 +117,9 @@ github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -284,8 +280,11 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -350,7 +349,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -366,7 +364,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -415,8 +412,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= @@ -426,8 +421,8 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -932,8 +927,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -1044,8 +1039,6 @@ github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279 h1:+Ly github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279/go.mod h1:GA3+Mq3kt3tYAfM0WZCu7ofy+GW9PuGysHfhr+6JX7s= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -1097,9 +1090,18 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= +go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= +go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1155,8 +1157,8 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1248,7 +1250,6 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -1260,8 +1261,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1274,11 +1275,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1294,8 +1292,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1363,14 +1361,9 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1394,8 +1387,8 @@ golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1407,8 +1400,8 @@ golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1424,8 +1417,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1499,8 +1492,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1529,10 +1522,6 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0 h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1541,7 +1530,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170918111702-1e559d0a00ee/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1587,12 +1575,7 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1619,10 +1602,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1635,8 +1616,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/monitoring/tracing/BUILD.bazel b/monitoring/tracing/BUILD.bazel index bfae1ed82732..f46310fe60d4 100644 --- a/monitoring/tracing/BUILD.bazel +++ b/monitoring/tracing/BUILD.bazel @@ -11,9 +11,15 @@ go_library( visibility = ["//visibility:public"], deps = [ "//monitoring/tracing/trace:go_default_library", - "//runtime/version:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", - "@io_opencensus_go_contrib_exporter_jaeger//:go_default_library", + "@io_opentelemetry_go_otel//:go_default_library", + "@io_opentelemetry_go_otel//attribute:go_default_library", + "@io_opentelemetry_go_otel//codes:go_default_library", + "@io_opentelemetry_go_otel//semconv/v1.17.0:go_default_library", + "@io_opentelemetry_go_otel_exporters_jaeger//:go_default_library", + "@io_opentelemetry_go_otel_sdk//resource:go_default_library", + "@io_opentelemetry_go_otel_sdk//trace:go_default_library", + "@io_opentelemetry_go_otel_trace//:go_default_library", + "@io_opentelemetry_go_otel_trace//noop:go_default_library", ], ) diff --git a/monitoring/tracing/errors.go b/monitoring/tracing/errors.go index 642573104623..9fc6c72fa3da 100644 --- a/monitoring/tracing/errors.go +++ b/monitoring/tracing/errors.go @@ -2,17 +2,15 @@ package tracing import ( - "go.opencensus.io/trace" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" ) // AnnotateError on span. This should be used any time a particular span experiences an error. -func AnnotateError(span *trace.Span, err error) { +func AnnotateError(span trace.Span, err error) { if err == nil { return } - span.AddAttributes(trace.BoolAttribute("error", true)) - span.SetStatus(trace.Status{ - Code: trace.StatusCodeUnknown, - Message: err.Error(), - }) + span.RecordError(err) + span.SetStatus(codes.Error, err.Error()) } diff --git a/monitoring/tracing/recovery_interceptor_option.go b/monitoring/tracing/recovery_interceptor_option.go index a93146981162..e4317455bc58 100644 --- a/monitoring/tracing/recovery_interceptor_option.go +++ b/monitoring/tracing/recovery_interceptor_option.go @@ -7,8 +7,8 @@ import ( "runtime" "runtime/debug" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" ) // RecoveryHandlerFunc is a function that recovers from the panic `p` by returning an `error`. @@ -16,7 +16,7 @@ import ( func RecoveryHandlerFunc(ctx context.Context, p interface{}) error { span := trace.FromContext(ctx) if span != nil { - span.AddAttributes(trace.StringAttribute("stack", string(debug.Stack()))) + span.SetAttributes(trace.StringAttribute("stack", string(debug.Stack()))) } var err error switch v := p.(type) { diff --git a/monitoring/tracing/trace/BUILD.bazel b/monitoring/tracing/trace/BUILD.bazel index f92aa2295380..ad876865aea0 100644 --- a/monitoring/tracing/trace/BUILD.bazel +++ b/monitoring/tracing/trace/BUILD.bazel @@ -5,5 +5,10 @@ go_library( srcs = ["span.go"], importpath = "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace", visibility = ["//visibility:public"], - deps = ["@io_opencensus_go//trace:go_default_library"], + deps = [ + "@io_opentelemetry_go_otel//:go_default_library", + "@io_opentelemetry_go_otel//attribute:go_default_library", + "@io_opentelemetry_go_otel_trace//:go_default_library", + "@io_opentelemetry_go_otel_trace//noop:go_default_library", + ], ) diff --git a/monitoring/tracing/trace/span.go b/monitoring/tracing/trace/span.go index e05ebc4d81bf..6f2c15019c92 100644 --- a/monitoring/tracing/trace/span.go +++ b/monitoring/tracing/trace/span.go @@ -3,95 +3,68 @@ package trace import ( "context" - "go.opencensus.io/trace" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/noop" ) -// TracingEnabled tracks whether tracing is enabled in prysm. +// TracingEnabled tracks whether tracing is enabled in your application. var TracingEnabled = false -// StartSpan is a wrapper over the opencensus package method. This is to allow us to skip +// StartSpan is a wrapper over the OpenTelemetry package method. This is to allow us to skip // calling that particular method if tracing has been disabled. -func StartSpan(ctx context.Context, name string, o ...trace.StartOption) (context.Context, *trace.Span) { +func StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { if !TracingEnabled { // Return an empty span if tracing has been disabled. - return ctx, trace.NewSpan(EmptySpan{}) + return ctx, noop.Span{} } - return trace.StartSpan(ctx, name, o...) + tracer := otel.Tracer("") + ctx, span := tracer.Start(ctx, name, opts...) + return ctx, span } // NewContext is a wrapper which returns back the parent context // if tracing is disabled. -func NewContext(parent context.Context, s *trace.Span) context.Context { +func NewContext(parent context.Context, s trace.Span) context.Context { if !TracingEnabled { return parent } - return trace.NewContext(parent, s) + return trace.ContextWithSpan(parent, s) } -// FromContext is a wrapper which returns a nil span +// FromContext is a wrapper which returns a no-op span // if tracing is disabled. -func FromContext(ctx context.Context) *trace.Span { +func FromContext(ctx context.Context) trace.Span { if !TracingEnabled { - return trace.NewSpan(EmptySpan{}) + return noop.Span{} } - return trace.FromContext(ctx) + span := trace.SpanFromContext(ctx) + return span +} + +// AddMessageSendEvent adds a message send event to the provided span. +// This function is useful for tracking the sending of messages within a trace. +func AddMessageSendEvent(span trace.Span, iid int64, uncompressedLen int64, compressedLen int64) trace.Span { + span.AddEvent("message_send", trace.WithAttributes( + attribute.Int64("message.id", iid), + attribute.Int64("message.uncompressed_size", uncompressedLen), + attribute.Int64("message.compressed_size", compressedLen), + )) + return span } // Int64Attribute -- -func Int64Attribute(key string, value int64) trace.Attribute { - return trace.Int64Attribute(key, value) +func Int64Attribute(key string, value int64) attribute.KeyValue { + return attribute.Int64(key, value) } // StringAttribute -- -func StringAttribute(key, value string) trace.Attribute { - return trace.StringAttribute(key, value) +func StringAttribute(key, value string) attribute.KeyValue { + return attribute.String(key, value) } // BoolAttribute -- -func BoolAttribute(key string, value bool) trace.Attribute { - return trace.BoolAttribute(key, value) -} - -type EmptySpan struct{} - -func (EmptySpan) IsRecordingEvents() bool { - return false -} - -func (EmptySpan) End() { -} - -func (EmptySpan) SpanContext() trace.SpanContext { - return trace.SpanContext{} -} - -func (EmptySpan) SetName(string) { - -} - -func (EmptySpan) SetStatus(trace.Status) { - -} - -func (EmptySpan) AddAttributes(...trace.Attribute) { -} - -func (EmptySpan) Annotate([]trace.Attribute, string) { - -} - -func (EmptySpan) Annotatef([]trace.Attribute, string, ...interface{}) { -} - -func (EmptySpan) AddMessageSendEvent(_, _, _ int64) { -} - -func (EmptySpan) AddMessageReceiveEvent(_, _, _ int64) { -} - -func (EmptySpan) AddLink(trace.Link) { -} - -func (EmptySpan) String() string { - return "" +func BoolAttribute(key string, value bool) attribute.KeyValue { + return attribute.Bool(key, value) } diff --git a/monitoring/tracing/tracer.go b/monitoring/tracing/tracer.go index 2fb5fc33b8ea..eddd84f3c946 100644 --- a/monitoring/tracing/tracer.go +++ b/monitoring/tracing/tracer.go @@ -4,20 +4,25 @@ package tracing import ( "errors" + "time" - "contrib.go.opencensus.io/exporter/jaeger" prysmTrace "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" - "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/exporters/jaeger" + "go.opentelemetry.io/otel/sdk/resource" + "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/trace/noop" ) var log = logrus.WithField("prefix", "tracing") -// Setup creates and initializes a new tracing configuration.. +// Setup creates and initializes a new Jaegar tracing configuration with opentelemetry. func Setup(serviceName, processName, endpoint string, sampleFraction float64, enable bool) error { if !enable { - trace.ApplyConfig(trace.Config{DefaultSampler: trace.NeverSample()}) + otel.SetTracerProvider(noop.NewTracerProvider()) return nil } prysmTrace.TracingEnabled = true @@ -26,30 +31,28 @@ func Setup(serviceName, processName, endpoint string, sampleFraction float64, en return errors.New("tracing service name cannot be empty") } - trace.ApplyConfig(trace.Config{ - DefaultSampler: trace.ProbabilitySampler(sampleFraction), - MaxMessageEventsPerSpan: 500, - }) - log.Infof("Starting Jaeger exporter endpoint at address = %s", endpoint) - exporter, err := jaeger.NewExporter(jaeger.Options{ - CollectorEndpoint: endpoint, - Process: jaeger.Process{ - ServiceName: serviceName, - Tags: []jaeger.Tag{ - jaeger.StringTag("process_name", processName), - jaeger.StringTag("version", version.Version()), - }, - }, - BufferMaxCount: 10000, - OnError: func(err error) { - log.WithError(err).Error("Could not process span") - }, - }) + exporter, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint))) if err != nil { return err } - trace.RegisterExporter(exporter) - + tp := trace.NewTracerProvider( + trace.WithSampler(trace.TraceIDRatioBased(sampleFraction)), + trace.WithBatcher( + exporter, + trace.WithMaxExportBatchSize(trace.DefaultMaxExportBatchSize), + trace.WithBatchTimeout(trace.DefaultScheduleDelay*time.Millisecond), + trace.WithMaxExportBatchSize(trace.DefaultMaxExportBatchSize), + ), + trace.WithResource( + resource.NewWithAttributes( + semconv.SchemaURL, + semconv.ServiceNameKey.String(serviceName), + attribute.String("process_name", processName), + ), + ), + ) + + otel.SetTracerProvider(tp) return nil } diff --git a/runtime/messagehandler/BUILD.bazel b/runtime/messagehandler/BUILD.bazel index d8edca3c50e7..1c5cbf4c227b 100644 --- a/runtime/messagehandler/BUILD.bazel +++ b/runtime/messagehandler/BUILD.bazel @@ -6,9 +6,10 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/runtime/messagehandler", visibility = ["//visibility:public"], deps = [ + "//monitoring/tracing/trace:go_default_library", "@com_github_libp2p_go_libp2p_pubsub//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", - "@io_opencensus_go//trace:go_default_library", + "@io_opentelemetry_go_otel//codes:go_default_library", ], ) diff --git a/runtime/messagehandler/messagehandler.go b/runtime/messagehandler/messagehandler.go index 6355bbe6106c..26d860c11cf5 100644 --- a/runtime/messagehandler/messagehandler.go +++ b/runtime/messagehandler/messagehandler.go @@ -8,8 +8,9 @@ import ( "runtime/debug" pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/sirupsen/logrus" - "go.opencensus.io/trace" + "go.opentelemetry.io/otel/codes" ) const noMsgData = "message contains no data" @@ -25,10 +26,7 @@ func SafelyHandleMessage(ctx context.Context, fn func(ctx context.Context, messa if err := fn(ctx, msg); err != nil { // Report any error on the span, if one exists. if span := trace.FromContext(ctx); span != nil { - span.SetStatus(trace.Status{ - Code: trace.StatusCodeInternal, - Message: err.Error(), - }) + span.SetStatus(codes.Error, err.Error()) } } } @@ -52,10 +50,7 @@ func HandlePanic(ctx context.Context, msg *pubsub.Message) { return } if span := trace.FromContext(ctx); span != nil { - span.SetStatus(trace.Status{ - Code: trace.StatusCodeInternal, - Message: fmt.Sprintf("Panic: %v", r), - }) + span.SetStatus(codes.Error, fmt.Sprintf("Panic: %v", r)) } } } diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index 5f188018472c..5187a36514df 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -86,7 +86,7 @@ go_library( "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//plugin/ocgrpc:go_default_library", - "@io_opencensus_go//trace:go_default_library", + "@io_opentelemetry_go_otel_trace//:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//credentials:go_default_library", diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index 0808f7028269..43e54475a39c 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -32,7 +32,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives ctx, span := trace.StartSpan(ctx, "validator.SubmitAggregateAndProof") defer span.End() - span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) + span.SetAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) fmtKey := fmt.Sprintf("%#x", pubKey[:]) duty, err := v.duty(pubKey) diff --git a/validator/client/attest.go b/validator/client/attest.go index b5996773f5eb..0c2f92a83cc6 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -35,7 +35,7 @@ var failedAttLocalProtectionErr = "attempted to make slashable attestation, reje func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte) { ctx, span := trace.StartSpan(ctx, "validator.SubmitAttestation") defer span.End() - span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) + span.SetAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) v.waitOneThirdOrValidBlock(ctx, slot) @@ -193,7 +193,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, return } - span.AddAttributes( + span.SetAttributes( trace.Int64Attribute("slot", int64(slot)), // lint:ignore uintcast -- This conversion is OK for tracing. trace.StringAttribute("attestationHash", fmt.Sprintf("%#x", attResp.AttestationDataRoot)), trace.StringAttribute("blockRoot", fmt.Sprintf("%#x", data.BeaconBlockRoot)), @@ -202,9 +202,9 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, trace.StringAttribute("aggregationBitfield", fmt.Sprintf("%#x", aggregationBitfield)), ) if postElectra { - span.AddAttributes(trace.StringAttribute("committeeBitfield", fmt.Sprintf("%#x", committeeBits))) + span.SetAttributes(trace.StringAttribute("committeeBitfield", fmt.Sprintf("%#x", committeeBits))) } else { - span.AddAttributes(trace.Int64Attribute("committeeIndex", int64(data.CommitteeIndex))) + span.SetAttributes(trace.Int64Attribute("committeeIndex", int64(data.CommitteeIndex))) } if v.emitAccountMetrics { diff --git a/validator/client/propose.go b/validator/client/propose.go index 1979a7797b34..3cf5a11fd1dc 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -56,7 +56,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK defer lock.Unlock() fmtKey := fmt.Sprintf("%#x", pubKey[:]) - span.AddAttributes(trace.StringAttribute("validator", fmtKey)) + span.SetAttributes(trace.StringAttribute("validator", fmtKey)) log := log.WithField("pubkey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:]))) // Sign randao reveal, it's used to request block from beacon node @@ -171,7 +171,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK return } - span.AddAttributes( + span.SetAttributes( trace.StringAttribute("blockRoot", fmt.Sprintf("%#x", blkResp.BlockRoot)), trace.Int64Attribute("numDeposits", int64(len(blk.Block().Body().Deposits()))), trace.Int64Attribute("numAttestations", int64(len(blk.Block().Body().Attestations()))), @@ -291,7 +291,7 @@ func ProposeExit( return errors.Wrap(err, "failed to propose voluntary exit") } - span.AddAttributes( + span.SetAttributes( trace.StringAttribute("exitRoot", fmt.Sprintf("%#x", exitResp.ExitRoot)), ) return nil diff --git a/validator/client/runner.go b/validator/client/runner.go index 7839c795e2f4..1a33b886ded1 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -14,10 +14,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" + prysmTrace "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - goTrace "go.opencensus.io/trace" + "go.opentelemetry.io/otel/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -66,7 +66,7 @@ func run(ctx context.Context, v iface.Validator) { log.WithError(err).Fatal("Failed to update proposer settings") } for { - ctx, span := trace.StartSpan(ctx, "validator.processSlot") + ctx, span := prysmTrace.StartSpan(ctx, "validator.processSlot") select { case <-ctx.Done(): log.Info("Context canceled, stopping validator") @@ -78,7 +78,7 @@ func run(ctx context.Context, v iface.Validator) { if !healthTracker.IsHealthy() { continue } - span.AddAttributes(trace.Int64Attribute("slot", int64(slot))) // lint:ignore uintcast -- This conversion is OK for tracing. + span.SetAttributes(prysmTrace.Int64Attribute("slot", int64(slot))) // lint:ignore uintcast -- This conversion is OK for tracing. deadline := v.SlotDeadline(slot) slotCtx, cancel := context.WithDeadline(ctx, deadline) @@ -151,7 +151,7 @@ func onAccountsChanged(ctx context.Context, v iface.Validator, current [][48]byt } func initializeValidatorAndGetHeadSlot(ctx context.Context, v iface.Validator) (primitives.Slot, error) { - ctx, span := trace.StartSpan(ctx, "validator.initializeValidatorAndGetHeadSlot") + ctx, span := prysmTrace.StartSpan(ctx, "validator.initializeValidatorAndGetHeadSlot") defer span.End() ticker := time.NewTicker(backOffPeriod) @@ -226,7 +226,7 @@ func initializeValidatorAndGetHeadSlot(ctx context.Context, v iface.Validator) ( return headSlot, nil } -func performRoles(slotCtx context.Context, allRoles map[[48]byte][]iface.ValidatorRole, v iface.Validator, slot primitives.Slot, wg *sync.WaitGroup, span *goTrace.Span) { +func performRoles(slotCtx context.Context, allRoles map[[48]byte][]iface.ValidatorRole, v iface.Validator, slot primitives.Slot, wg *sync.WaitGroup, span trace.Span) { for pubKey, roles := range allRoles { wg.Add(len(roles)) for _, role := range roles { diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index 6b7dbfdd9e64..0d67eedbd3d6 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -28,7 +28,7 @@ import ( func (v *validator) SubmitSyncCommitteeMessage(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte) { ctx, span := trace.StartSpan(ctx, "validator.SubmitSyncCommitteeMessage") defer span.End() - span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) + span.SetAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) v.waitOneThirdOrValidBlock(ctx, slot) @@ -98,7 +98,7 @@ func (v *validator) SubmitSyncCommitteeMessage(ctx context.Context, slot primiti func (v *validator) SubmitSignedContributionAndProof(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte) { ctx, span := trace.StartSpan(ctx, "validator.SubmitSignedContributionAndProof") defer span.End() - span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) + span.SetAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey))) duty, err := v.duty(pubKey) if err != nil { diff --git a/validator/db/kv/attester_protection.go b/validator/db/kv/attester_protection.go index 762f883f0286..89a2bdb189f9 100644 --- a/validator/db/kv/attester_protection.go +++ b/validator/db/kv/attester_protection.go @@ -419,7 +419,7 @@ func (s *Store) batchAttestationWrites(ctx context.Context) { _, span := trace.StartSpan(v.ctx, "batchAttestationWrites.handleBatchedAttestationSaveRequest") s.batchedAttestations.Append(v.record) - span.AddAttributes(trace.Int64Attribute("num_records", int64(s.batchedAttestations.Len()))) + span.SetAttributes(trace.Int64Attribute("num_records", int64(s.batchedAttestations.Len()))) if numRecords := s.batchedAttestations.Len(); numRecords >= attestationBatchCapacity { log.WithField("recordCount", numRecords).Debug( diff --git a/validator/keymanager/remote-web3signer/internal/client.go b/validator/keymanager/remote-web3signer/internal/client.go index 5ba892891c9b..1686cdb0d9dc 100644 --- a/validator/keymanager/remote-web3signer/internal/client.go +++ b/validator/keymanager/remote-web3signer/internal/client.go @@ -138,7 +138,7 @@ func (client *ApiClient) doRequest(ctx context.Context, httpMethod, fullPath str var requestDump []byte ctx, span := trace.StartSpan(ctx, "remote_web3signer.Client.doRequest") defer span.End() - span.AddAttributes( + span.SetAttributes( trace.StringAttribute("httpMethod", httpMethod), trace.StringAttribute("fullPath", fullPath), trace.BoolAttribute("hasBody", body != nil), diff --git a/validator/node/node.go b/validator/node/node.go index 0e63087d7883..65b84194498b 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -30,7 +30,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/io/file" "github.com/prysmaticlabs/prysm/v5/monitoring/backup" "github.com/prysmaticlabs/prysm/v5/monitoring/prometheus" - tracing2 "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" + "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/prysmaticlabs/prysm/v5/runtime" "github.com/prysmaticlabs/prysm/v5/runtime/debug" "github.com/prysmaticlabs/prysm/v5/runtime/prereqs" @@ -66,7 +66,7 @@ type ValidatorClient struct { // NewValidatorClient creates a new instance of the Prysm validator client. func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { // TODO(#9883) - Maybe we can pass in a new validator client config instead of the cliCTX to abstract away the use of flags here . - if err := tracing2.Setup( + if err := tracing.Setup( "validator", // service name cliCtx.String(cmd.TracingProcessNameFlag.Name), cliCtx.String(cmd.TracingEndpointFlag.Name), From 222b360c66c23b0c723509f0b989b1b791282261 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 12 Sep 2024 21:00:41 -0500 Subject: [PATCH 293/325] Electra: Remove signing domain for consolidations (#14437) * Electra: Remove signing domain for consolidations. See https://github.com/ethereum/consensus-specs/pull/3915 * Update changelog --- CHANGELOG.md | 2 ++ beacon-chain/rpc/eth/config/handlers_test.go | 8 +------- config/params/config.go | 1 - config/params/mainnet_config.go | 1 - 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e29f3254800..0184b8e22988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,8 +42,10 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `--enable-experimental-state` flag is deprecated. This feature is now on by default. Opt-out with `--disable-experimental-state`. ### Removed + - removed gRPC Gateway - Removed unused blobs bundle cache +- Removed consolidation signing domain from params. The Electra design changed such that EL handles consolidation signature verification. ### Fixed diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index b7bec05faada..f273f948133e 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -175,10 +175,6 @@ func TestGetSpec(t *testing.T) { var dam [4]byte copy(dam[:], []byte{'1', '0', '0', '0'}) config.DomainApplicationMask = dam - var dc [4]byte - copy(dc[:], []byte{'1', '1', '0', '0'}) - config.DomainConsolidation = dc - params.OverrideBeaconConfig(config) request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/config/spec", nil) @@ -192,7 +188,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 155, len(data)) + assert.Equal(t, 154, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -515,8 +511,6 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "86", v) case "MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD": assert.Equal(t, "87", v) - case "DOMAIN_CONSOLIDATION": - assert.Equal(t, "0x31313030", v) case "MAX_ATTESTER_SLASHINGS_ELECTRA": assert.Equal(t, "88", v) case "MAX_ATTESTATIONS_ELECTRA": diff --git a/config/params/config.go b/config/params/config.go index 5f9e37f0df34..7ed09964a168 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -125,7 +125,6 @@ type BeaconChainConfig struct { DomainApplicationMask [4]byte `yaml:"DOMAIN_APPLICATION_MASK" spec:"true"` // DomainApplicationMask defines the BLS signature domain for application mask. DomainApplicationBuilder [4]byte `yaml:"DOMAIN_APPLICATION_BUILDER" spec:"true"` // DomainApplicationBuilder defines the BLS signature domain for application builder. DomainBLSToExecutionChange [4]byte `yaml:"DOMAIN_BLS_TO_EXECUTION_CHANGE" spec:"true"` // DomainBLSToExecutionChange defines the BLS signature domain to change withdrawal addresses to ETH1 prefix - DomainConsolidation [4]byte `yaml:"DOMAIN_CONSOLIDATION" spec:"true"` // Prysm constants. GenesisValidatorsRoot [32]byte // GenesisValidatorsRoot is the root hash of the genesis validators. diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 334aec572c74..012a98f8d592 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -171,7 +171,6 @@ var mainnetBeaconConfig = &BeaconChainConfig{ DomainApplicationMask: bytesutil.Uint32ToBytes4(0x00000001), DomainApplicationBuilder: bytesutil.Uint32ToBytes4(0x00000001), DomainBLSToExecutionChange: bytesutil.Uint32ToBytes4(0x0A000000), - DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000), // Prysm constants. GenesisValidatorsRoot: [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149}, From ed6f69e868dfa49b15e030554359da176e1ac6d6 Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Fri, 13 Sep 2024 05:53:02 +0200 Subject: [PATCH 294/325] Upgrade LightClient DB (#14432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add kv tests for capella and deneb * test execution fields * Update proto/eth/v2/custom.go Co-authored-by: Radosław Kapka * Update proto/eth/v2/custom.go Co-authored-by: Radosław Kapka * Update proto/eth/v2/custom.go Co-authored-by: Radosław Kapka * refactor tests using deepEqual --------- Co-authored-by: Radosław Kapka Co-authored-by: Radosław Kapka --- beacon-chain/db/kv/BUILD.bazel | 1 + beacon-chain/db/kv/lightclient_test.go | 163 +++++++++++++++++++++++-- proto/eth/v2/custom.go | 30 +++++ 3 files changed, 183 insertions(+), 11 deletions(-) diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index 9de4f5c7b5f2..732da2fb5b2a 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -116,6 +116,7 @@ go_test( "//encoding/bytesutil:go_default_library", "//proto/dbval:go_default_library", "//proto/engine/v1:go_default_library", + "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/testing:go_default_library", diff --git a/beacon-chain/db/kv/lightclient_test.go b/beacon-chain/db/kv/lightclient_test.go index 528e55023d39..dd2df2acac8b 100644 --- a/beacon-chain/db/kv/lightclient_test.go +++ b/beacon-chain/db/kv/lightclient_test.go @@ -5,38 +5,179 @@ import ( "testing" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/require" ) -func TestStore_LightclientUpdate_CanSaveRetrieve(t *testing.T) { +func TestStore_LightClientUpdate_CanSaveRetrieveAltair(t *testing.T) { db := setupDB(t) ctx := context.Background() update := ðpbv2.LightClientUpdate{ - AttestedHeader: nil, - NextSyncCommittee: nil, + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: []byte{1, 1, 1}, + StateRoot: []byte{1, 1, 1}, + BodyRoot: []byte{1, 1, 1}, + }, + }, + }, + }, + NextSyncCommittee: ðpbv2.SyncCommittee{ + Pubkeys: nil, + AggregatePubkey: nil, + }, NextSyncCommitteeBranch: nil, - FinalizedHeader: nil, - FinalityBranch: nil, - SyncAggregate: nil, - SignatureSlot: 7, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: []byte{1, 1, 1}, + StateRoot: []byte{1, 1, 1}, + BodyRoot: []byte{1, 1, 1}, + }, + }, + }, + }, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, } + period := uint64(1) + err := db.SaveLightClientUpdate(ctx, period, ðpbv2.LightClientUpdateWithVersion{ + Version: version.Altair, + Data: update, + }) + require.NoError(t, err) + + retrievedUpdate, err := db.LightClientUpdate(ctx, period) + require.NoError(t, err) + require.DeepEqual(t, update, retrievedUpdate.Data, "retrieved update does not match saved update") +} +func TestStore_LightClientUpdate_CanSaveRetrieveCapella(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + update := ðpbv2.LightClientUpdate{ + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: []byte{1, 1, 1}, + StateRoot: []byte{1, 1, 1}, + BodyRoot: []byte{1, 1, 1}, + }, + Execution: &enginev1.ExecutionPayloadHeaderCapella{ + FeeRecipient: []byte{1, 2, 3}, + }, + ExecutionBranch: [][]byte{{1, 2, 3}, {4, 5, 6}}, + }, + }, + }, + NextSyncCommittee: ðpbv2.SyncCommittee{ + Pubkeys: nil, + AggregatePubkey: nil, + }, + NextSyncCommitteeBranch: nil, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: []byte{1, 1, 1}, + StateRoot: []byte{1, 1, 1}, + BodyRoot: []byte{1, 1, 1}, + }, + Execution: nil, + ExecutionBranch: nil, + }, + }, + }, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + } period := uint64(1) err := db.SaveLightClientUpdate(ctx, period, ðpbv2.LightClientUpdateWithVersion{ - Version: 1, + Version: version.Capella, Data: update, }) require.NoError(t, err) - // Retrieve the update retrievedUpdate, err := db.LightClientUpdate(ctx, period) require.NoError(t, err) - require.Equal(t, update.SignatureSlot, retrievedUpdate.Data.SignatureSlot, "retrieved update does not match saved update") + require.DeepEqual(t, update, retrievedUpdate.Data, "retrieved update does not match saved update") +} +func TestStore_LightClientUpdate_CanSaveRetrieveDeneb(t *testing.T) { + db := setupDB(t) + ctx := context.Background() + update := ðpbv2.LightClientUpdate{ + AttestedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: []byte{1, 1, 1}, + StateRoot: []byte{1, 1, 1}, + BodyRoot: []byte{1, 1, 1}, + }, + Execution: &enginev1.ExecutionPayloadHeaderDeneb{ + FeeRecipient: []byte{1, 2, 3}, + }, + ExecutionBranch: [][]byte{{1, 2, 3}, {4, 5, 6}}, + }, + }, + }, + NextSyncCommittee: ðpbv2.SyncCommittee{ + Pubkeys: nil, + AggregatePubkey: nil, + }, + NextSyncCommitteeBranch: nil, + FinalizedHeader: ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: ðpbv1.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: []byte{1, 1, 1}, + StateRoot: []byte{1, 1, 1}, + BodyRoot: []byte{1, 1, 1}, + }, + Execution: nil, + ExecutionBranch: nil, + }, + }, + }, + FinalityBranch: nil, + SyncAggregate: nil, + SignatureSlot: 7, + } + period := uint64(1) + err := db.SaveLightClientUpdate(ctx, period, ðpbv2.LightClientUpdateWithVersion{ + Version: version.Deneb, + Data: update, + }) + require.NoError(t, err) + + retrievedUpdate, err := db.LightClientUpdate(ctx, period) + require.NoError(t, err) + require.DeepEqual(t, update, retrievedUpdate.Data, "retrieved update does not match saved update") } -func TestStore_LightclientUpdates_canRetrieveRange(t *testing.T) { +func TestStore_LightClientUpdates_canRetrieveRange(t *testing.T) { db := setupDB(t) ctx := context.Background() updates := []*ethpbv2.LightClientUpdateWithVersion{ diff --git a/proto/eth/v2/custom.go b/proto/eth/v2/custom.go index 9a9633db2df3..f61e764614fa 100644 --- a/proto/eth/v2/custom.go +++ b/proto/eth/v2/custom.go @@ -3,6 +3,7 @@ package eth import ( "bytes" "fmt" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "math/bits" v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" @@ -65,3 +66,32 @@ func (x *LightClientHeaderContainer) GetBeacon() (*v1.BeaconBlockHeader, error) return nil, fmt.Errorf("unknown header type: %T", input) } } + +func (x *LightClientHeaderContainer) GetExecutionHeaderCapella() (*enginev1.ExecutionPayloadHeaderCapella, error) { + switch input := x.Header.(type) { + case *LightClientHeaderContainer_HeaderCapella: + return input.HeaderCapella.Execution, nil + default: + return nil, fmt.Errorf("header type %T not Capella", input) + } +} + +func (x *LightClientHeaderContainer) GetExecutionHeaderDeneb() (*enginev1.ExecutionPayloadHeaderDeneb, error) { + switch input := x.Header.(type) { + case *LightClientHeaderContainer_HeaderDeneb: + return input.HeaderDeneb.Execution, nil + default: + return nil, fmt.Errorf("header type %T not Deneb", input) + } +} + +func (x *LightClientHeaderContainer) GetExecutionBranch() ([][]byte, error) { + switch input := x.Header.(type) { + case *LightClientHeaderContainer_HeaderCapella: + return input.HeaderCapella.ExecutionBranch, nil + case *LightClientHeaderContainer_HeaderDeneb: + return input.HeaderDeneb.ExecutionBranch, nil + default: + return nil, fmt.Errorf("wrong header type %T", input) + } +} From 7ac3c01b5b74fc324f47b64411fb7051682e7987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 13 Sep 2024 18:08:28 -0400 Subject: [PATCH 295/325] Refactor light client functions (#14434) * Use correct types in light client functions * conversions * more refactoring * test fixes * changelog * error fix * revert test changes * revert test skip * Update api/server/structs/conversions_lightclient.go Co-authored-by: Rupam Dey <117000803+rupam-04@users.noreply.github.com> * use BlockToLightClientHeader * reviewer suggestion * Revert "use BlockToLightClientHeader" This reverts commit f3df56ded55151dba19b27d73f791c3874c0523d. --------- Co-authored-by: Rupam Dey <117000803+rupam-04@users.noreply.github.com> --- CHANGELOG.md | 1 + api/server/structs/BUILD.bazel | 3 + api/server/structs/conversions_lightclient.go | 121 ++++- api/server/structs/endpoints_events.go | 14 - api/server/structs/endpoints_lightclient.go | 38 +- .../blockchain/process_block_helpers.go | 4 +- beacon-chain/core/light-client/BUILD.bazel | 1 - beacon-chain/core/light-client/lightclient.go | 471 ++++++++++-------- .../core/light-client/lightclient_test.go | 53 +- beacon-chain/rpc/eth/events/events.go | 67 +-- beacon-chain/rpc/eth/light-client/BUILD.bazel | 2 - beacon-chain/rpc/eth/light-client/handlers.go | 93 ++-- .../rpc/eth/light-client/handlers_test.go | 16 +- beacon-chain/rpc/eth/light-client/helpers.go | 205 +------- testing/util/lightclient.go | 11 +- 15 files changed, 528 insertions(+), 572 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0184b8e22988..b99fcea6ee45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Clean up `ProposeBlock` for validator client to reduce cognitive scoring and enable further changes. - Updated k8s-io/client-go to v0.30.4 and k8s-io/apimachinery to v0.30.4 - Migrated tracing library from opencensus to opentelemetry for both the beacon node and validator. +- Refactored light client code to make it more readable and make future PRs easier. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/api/server/structs/BUILD.bazel b/api/server/structs/BUILD.bazel index cbe01272a175..f700ecb3cd04 100644 --- a/api/server/structs/BUILD.bazel +++ b/api/server/structs/BUILD.bazel @@ -34,6 +34,9 @@ go_library( "//encoding/bytesutil:go_default_library", "//math:go_default_library", "//proto/engine/v1:go_default_library", + "//proto/eth/v1:go_default_library", + "//proto/eth/v2:go_default_library", + "//proto/migration:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/api/server/structs/conversions_lightclient.go b/api/server/structs/conversions_lightclient.go index aa780a37ac30..83483bb53225 100644 --- a/api/server/structs/conversions_lightclient.go +++ b/api/server/structs/conversions_lightclient.go @@ -1,3 +1,122 @@ package structs -// +import ( + "encoding/json" + "fmt" + "strconv" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" + v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" + v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + "github.com/prysmaticlabs/prysm/v5/proto/migration" +) + +func LightClientUpdateFromConsensus(update *v2.LightClientUpdate) (*LightClientUpdate, error) { + attestedHeader, err := lightClientHeaderContainerToJSON(update.AttestedHeader) + if err != nil { + return nil, errors.Wrap(err, "could not marshal attested light client header") + } + finalizedHeader, err := lightClientHeaderContainerToJSON(update.FinalizedHeader) + if err != nil { + return nil, errors.Wrap(err, "could not marshal finalized light client header") + } + + return &LightClientUpdate{ + AttestedHeader: attestedHeader, + NextSyncCommittee: SyncCommitteeFromConsensus(migration.V2SyncCommitteeToV1Alpha1(update.NextSyncCommittee)), + NextSyncCommitteeBranch: branchToJSON(update.NextSyncCommitteeBranch), + FinalizedHeader: finalizedHeader, + FinalityBranch: branchToJSON(update.FinalityBranch), + SyncAggregate: syncAggregateToJSON(update.SyncAggregate), + SignatureSlot: strconv.FormatUint(uint64(update.SignatureSlot), 10), + }, nil +} + +func LightClientFinalityUpdateFromConsensus(update *v2.LightClientFinalityUpdate) (*LightClientFinalityUpdate, error) { + attestedHeader, err := lightClientHeaderContainerToJSON(update.AttestedHeader) + if err != nil { + return nil, errors.Wrap(err, "could not marshal attested light client header") + } + finalizedHeader, err := lightClientHeaderContainerToJSON(update.FinalizedHeader) + if err != nil { + return nil, errors.Wrap(err, "could not marshal finalized light client header") + } + + return &LightClientFinalityUpdate{ + AttestedHeader: attestedHeader, + FinalizedHeader: finalizedHeader, + FinalityBranch: branchToJSON(update.FinalityBranch), + SyncAggregate: syncAggregateToJSON(update.SyncAggregate), + SignatureSlot: strconv.FormatUint(uint64(update.SignatureSlot), 10), + }, nil +} + +func LightClientOptimisticUpdateFromConsensus(update *v2.LightClientOptimisticUpdate) (*LightClientOptimisticUpdate, error) { + attestedHeader, err := lightClientHeaderContainerToJSON(update.AttestedHeader) + if err != nil { + return nil, errors.Wrap(err, "could not marshal attested light client header") + } + + return &LightClientOptimisticUpdate{ + AttestedHeader: attestedHeader, + SyncAggregate: syncAggregateToJSON(update.SyncAggregate), + SignatureSlot: strconv.FormatUint(uint64(update.SignatureSlot), 10), + }, nil +} + +func branchToJSON(branchBytes [][]byte) []string { + if branchBytes == nil { + return nil + } + branch := make([]string, len(branchBytes)) + for i, root := range branchBytes { + branch[i] = hexutil.Encode(root) + } + return branch +} + +func syncAggregateToJSON(input *v1.SyncAggregate) *SyncAggregate { + return &SyncAggregate{ + SyncCommitteeBits: hexutil.Encode(input.SyncCommitteeBits), + SyncCommitteeSignature: hexutil.Encode(input.SyncCommitteeSignature), + } +} + +func lightClientHeaderContainerToJSON(container *v2.LightClientHeaderContainer) (json.RawMessage, error) { + beacon, err := container.GetBeacon() + if err != nil { + return nil, errors.Wrap(err, "could not get beacon block header") + } + + var header any + + switch t := (container.Header).(type) { + case *v2.LightClientHeaderContainer_HeaderAltair: + header = &LightClientHeader{Beacon: BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(beacon))} + case *v2.LightClientHeaderContainer_HeaderCapella: + execution, err := ExecutionPayloadHeaderCapellaFromConsensus(t.HeaderCapella.Execution) + if err != nil { + return nil, err + } + header = &LightClientHeaderCapella{ + Beacon: BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(beacon)), + Execution: execution, + ExecutionBranch: branchToJSON(t.HeaderCapella.ExecutionBranch), + } + case *v2.LightClientHeaderContainer_HeaderDeneb: + execution, err := ExecutionPayloadHeaderDenebFromConsensus(t.HeaderDeneb.Execution) + if err != nil { + return nil, err + } + header = &LightClientHeaderDeneb{ + Beacon: BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(beacon)), + Execution: execution, + ExecutionBranch: branchToJSON(t.HeaderDeneb.ExecutionBranch), + } + default: + return nil, fmt.Errorf("unsupported header type %T", t) + } + + return json.Marshal(header) +} diff --git a/api/server/structs/endpoints_events.go b/api/server/structs/endpoints_events.go index 5b6d30cf3f6b..275a94580383 100644 --- a/api/server/structs/endpoints_events.go +++ b/api/server/structs/endpoints_events.go @@ -96,21 +96,7 @@ type LightClientFinalityUpdateEvent struct { Data *LightClientFinalityUpdate `json:"data"` } -type LightClientFinalityUpdate struct { - AttestedHeader *BeaconBlockHeader `json:"attested_header"` - FinalizedHeader *BeaconBlockHeader `json:"finalized_header"` - FinalityBranch []string `json:"finality_branch"` - SyncAggregate *SyncAggregate `json:"sync_aggregate"` - SignatureSlot string `json:"signature_slot"` -} - type LightClientOptimisticUpdateEvent struct { Version string `json:"version"` Data *LightClientOptimisticUpdate `json:"data"` } - -type LightClientOptimisticUpdate struct { - AttestedHeader *BeaconBlockHeader `json:"attested_header"` - SyncAggregate *SyncAggregate `json:"sync_aggregate"` - SignatureSlot string `json:"signature_slot"` -} diff --git a/api/server/structs/endpoints_lightclient.go b/api/server/structs/endpoints_lightclient.go index 0abf361c44f0..197f0b019fee 100644 --- a/api/server/structs/endpoints_lightclient.go +++ b/api/server/structs/endpoints_lightclient.go @@ -24,11 +24,6 @@ type LightClientBootstrap struct { CurrentSyncCommitteeBranch []string `json:"current_sync_committee_branch"` } -type LightClientBootstrapResponse struct { - Version string `json:"version"` - Data *LightClientBootstrap `json:"data"` -} - type LightClientUpdate struct { AttestedHeader json.RawMessage `json:"attested_header"` NextSyncCommittee *SyncCommittee `json:"next_sync_committee,omitempty"` @@ -39,11 +34,40 @@ type LightClientUpdate struct { SignatureSlot string `json:"signature_slot"` } -type LightClientUpdateWithVersion struct { +type LightClientFinalityUpdate struct { + AttestedHeader json.RawMessage `json:"attested_header"` + FinalizedHeader json.RawMessage `json:"finalized_header"` + FinalityBranch []string `json:"finality_branch"` + SyncAggregate *SyncAggregate `json:"sync_aggregate"` + SignatureSlot string `json:"signature_slot"` +} + +type LightClientOptimisticUpdate struct { + AttestedHeader json.RawMessage `json:"attested_header"` + SyncAggregate *SyncAggregate `json:"sync_aggregate"` + SignatureSlot string `json:"signature_slot"` +} + +type LightClientBootstrapResponse struct { + Version string `json:"version"` + Data *LightClientBootstrap `json:"data"` +} + +type LightClientUpdateResponse struct { Version string `json:"version"` Data *LightClientUpdate `json:"data"` } +type LightClientFinalityUpdateResponse struct { + Version string `json:"version"` + Data *LightClientFinalityUpdate `json:"data"` +} + +type LightClientOptimisticUpdateResponse struct { + Version string `json:"version"` + Data *LightClientOptimisticUpdate `json:"data"` +} + type LightClientUpdatesByRangeResponse struct { - Updates []*LightClientUpdateWithVersion `json:"updates"` + Updates []*LightClientUpdateResponse `json:"updates"` } diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 19410068a36d..63bde32770b1 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -193,7 +193,7 @@ func (s *Service) sendLightClientFinalityUpdate(ctx context.Context, signed inte // Return the result result := ðpbv2.LightClientFinalityUpdateWithVersion{ Version: ethpbv2.Version(signed.Version()), - Data: lightclient.CreateLightClientFinalityUpdate(update), + Data: update, } // Send event @@ -227,7 +227,7 @@ func (s *Service) sendLightClientOptimisticUpdate(ctx context.Context, signed in // Return the result result := ðpbv2.LightClientOptimisticUpdateWithVersion{ Version: ethpbv2.Version(signed.Version()), - Data: lightclient.CreateLightClientOptimisticUpdate(update), + Data: update, } return s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel index febad0829c55..9bde03319096 100644 --- a/beacon-chain/core/light-client/BUILD.bazel +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -33,7 +33,6 @@ go_test( "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/engine/v1:go_default_library", - "//proto/eth/v2:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", ], diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index d4d918a5f753..3953843b8df8 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -2,6 +2,7 @@ package light_client import ( "bytes" + "context" "fmt" "github.com/pkg/errors" @@ -20,16 +21,15 @@ import ( "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - "context" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) const ( - FinalityBranchNumOfLeaves = 6 + FinalityBranchNumOfLeaves = 6 + executionBranchNumOfLeaves = 4 ) -// CreateLightClientFinalityUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_finality_update +// createLightClientFinalityUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_finality_update // def create_light_client_finality_update(update: LightClientUpdate) -> LightClientFinalityUpdate: // // return LightClientFinalityUpdate( @@ -39,7 +39,7 @@ const ( // sync_aggregate=update.sync_aggregate, // signature_slot=update.signature_slot, // ) -func CreateLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientFinalityUpdate { +func createLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientFinalityUpdate { finalityUpdate := ðpbv2.LightClientFinalityUpdate{ AttestedHeader: update.AttestedHeader, FinalizedHeader: update.FinalizedHeader, @@ -51,7 +51,7 @@ func CreateLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2 return finalityUpdate } -// CreateLightClientOptimisticUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_optimistic_update +// createLightClientOptimisticUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_optimistic_update // def create_light_client_optimistic_update(update: LightClientUpdate) -> LightClientOptimisticUpdate: // // return LightClientOptimisticUpdate( @@ -59,7 +59,7 @@ func CreateLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2 // sync_aggregate=update.sync_aggregate, // signature_slot=update.signature_slot, // ) -func CreateLightClientOptimisticUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientOptimisticUpdate { +func createLightClientOptimisticUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientOptimisticUpdate { optimisticUpdate := ðpbv2.LightClientOptimisticUpdate{ AttestedHeader: update.AttestedHeader, SyncAggregate: update.SyncAggregate, @@ -69,11 +69,98 @@ func CreateLightClientOptimisticUpdate(update *ethpbv2.LightClientUpdate) *ethpb return optimisticUpdate } +func NewLightClientFinalityUpdateFromBeaconState( + ctx context.Context, + state state.BeaconState, + block interfaces.ReadOnlySignedBeaconBlock, + attestedState state.BeaconState, + finalizedBlock interfaces.ReadOnlySignedBeaconBlock, +) (*ethpbv2.LightClientFinalityUpdate, error) { + update, err := NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + if err != nil { + return nil, err + } + + return createLightClientFinalityUpdate(update), nil +} + func NewLightClientOptimisticUpdateFromBeaconState( ctx context.Context, state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, - attestedState state.BeaconState) (*ethpbv2.LightClientUpdate, error) { + attestedState state.BeaconState, +) (*ethpbv2.LightClientOptimisticUpdate, error) { + update, err := NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, nil) + if err != nil { + return nil, err + } + + return createLightClientOptimisticUpdate(update), nil +} + +// NewLightClientUpdateFromBeaconState implements https://github.com/ethereum/consensus-specs/blob/d70dcd9926a4bbe987f1b4e65c3e05bd029fcfb8/specs/altair/light-client/full-node.md#create_light_client_update +// def create_light_client_update(state: BeaconState, +// +// block: SignedBeaconBlock, +// attested_state: BeaconState, +// finalized_block: Optional[SignedBeaconBlock]) -> LightClientUpdate: +// assert compute_epoch_at_slot(attested_state.slot) >= ALTAIR_FORK_EPOCH +// assert sum(block.message.body.sync_aggregate.sync_committee_bits) >= MIN_SYNC_COMMITTEE_PARTICIPANTS +// +// assert state.slot == state.latest_block_header.slot +// header = state.latest_block_header.copy() +// header.state_root = hash_tree_root(state) +// assert hash_tree_root(header) == hash_tree_root(block.message) +// update_signature_period = compute_sync_committee_period(compute_epoch_at_slot(block.message.slot)) +// +// assert attested_state.slot == attested_state.latest_block_header.slot +// attested_header = attested_state.latest_block_header.copy() +// attested_header.state_root = hash_tree_root(attested_state) +// assert hash_tree_root(attested_header) == block.message.parent_root +// update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) +// +// # `next_sync_committee` is only useful if the message is signed by the current sync committee +// if update_attested_period == update_signature_period: +// next_sync_committee = attested_state.next_sync_committee +// next_sync_committee_branch = compute_merkle_proof_for_state(attested_state, NEXT_SYNC_COMMITTEE_INDEX) +// else: +// next_sync_committee = SyncCommittee() +// next_sync_committee_branch = [Bytes32() for _ in range(floorlog2(NEXT_SYNC_COMMITTEE_INDEX))] +// +// # Indicate finality whenever possible +// if finalized_block is not None: +// if finalized_block.message.slot != GENESIS_SLOT: +// finalized_header = BeaconBlockHeader( +// slot=finalized_block.message.slot, +// proposer_index=finalized_block.message.proposer_index, +// parent_root=finalized_block.message.parent_root, +// state_root=finalized_block.message.state_root, +// body_root=hash_tree_root(finalized_block.message.body), +// ) +// assert hash_tree_root(finalized_header) == attested_state.finalized_checkpoint.root +// else: +// assert attested_state.finalized_checkpoint.root == Bytes32() +// finalized_header = BeaconBlockHeader() +// finality_branch = compute_merkle_proof_for_state(attested_state, FINALIZED_ROOT_INDEX) +// else: +// finalized_header = BeaconBlockHeader() +// finality_branch = [Bytes32() for _ in range(floorlog2(FINALIZED_ROOT_INDEX))] +// +// return LightClientUpdate( +// attested_header=attested_header, +// next_sync_committee=next_sync_committee, +// next_sync_committee_branch=next_sync_committee_branch, +// finalized_header=finalized_header, +// finality_branch=finality_branch, +// sync_aggregate=block.message.body.sync_aggregate, +// signature_slot=block.message.slot, +// ) +func NewLightClientUpdateFromBeaconState( + ctx context.Context, + state state.BeaconState, + block interfaces.ReadOnlySignedBeaconBlock, + attestedState state.BeaconState, + finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientUpdate, error) { // assert compute_epoch_at_slot(attested_state.slot) >= ALTAIR_FORK_EPOCH attestedEpoch := slots.ToEpoch(attestedState.Slot()) if attestedEpoch < params.BeaconConfig().AltairForkEpoch { @@ -85,7 +172,6 @@ func NewLightClientOptimisticUpdateFromBeaconState( if err != nil { return nil, errors.Wrap(err, "could not get sync aggregate") } - if syncAggregate.SyncCommitteeBits.Count() < params.BeaconConfig().MinSyncCommitteeParticipants { return nil, fmt.Errorf("invalid sync committee bits count %d", syncAggregate.SyncCommitteeBits.Count()) } @@ -102,21 +188,21 @@ func NewLightClientOptimisticUpdateFromBeaconState( return nil, errors.Wrap(err, "could not get state root") } header.StateRoot = stateRoot[:] - headerRoot, err := header.HashTreeRoot() if err != nil { return nil, errors.Wrap(err, "could not get header root") } - blockRoot, err := block.Block().HashTreeRoot() if err != nil { return nil, errors.Wrap(err, "could not get block root") } - if headerRoot != blockRoot { return nil, fmt.Errorf("header root %#x not equal to block root %#x", headerRoot, blockRoot) } + // update_signature_period = compute_sync_committee_period(compute_epoch_at_slot(block.message.slot)) + updateSignaturePeriod := slots.SyncCommitteePeriod(slots.ToEpoch(block.Block().Slot())) + // assert attested_state.slot == attested_state.latest_block_header.slot if attestedState.Slot() != attestedState.LatestBlockHeader().Slot { return nil, fmt.Errorf("attested state slot %d not equal to attested latest block header slot %d", attestedState.Slot(), attestedState.LatestBlockHeader().Slot) @@ -137,34 +223,32 @@ func NewLightClientOptimisticUpdateFromBeaconState( if err != nil { return nil, errors.Wrap(err, "could not get attested header root") } - if attestedHeaderRoot != block.Block().ParentRoot() { return nil, fmt.Errorf("attested header root %#x not equal to block parent root %#x", attestedHeaderRoot, block.Block().ParentRoot()) } - syncAggregateResult := ðpbv1.SyncAggregate{ - SyncCommitteeBits: syncAggregate.SyncCommitteeBits, - SyncCommitteeSignature: syncAggregate.SyncCommitteeSignature, - } + // update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) + updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(attestedHeader.Slot)) - result := ðpbv2.LightClientUpdate{ - SyncAggregate: syncAggregateResult, - SignatureSlot: block.Block().Slot(), + // update = LightClientUpdate() + result, err := createDefaultLightClientUpdate(block.Block().Version()) + if err != nil { + return nil, errors.Wrap(err, "could not create default light client update") } + // update.attested_header = block_to_light_client_header(attested_block) + blockHeader := ðpbv1.BeaconBlockHeader{ + Slot: attestedHeader.Slot, + ProposerIndex: attestedHeader.ProposerIndex, + ParentRoot: attestedHeader.ParentRoot, + StateRoot: attestedHeader.StateRoot, + BodyRoot: attestedHeader.BodyRoot, + } switch block.Block().Version() { case version.Altair, version.Bellatrix: result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ - HeaderAltair: ðpbv2.LightClientHeader{ - Beacon: ðpbv1.BeaconBlockHeader{ - Slot: attestedHeader.Slot, - ProposerIndex: attestedHeader.ProposerIndex, - ParentRoot: attestedHeader.ParentRoot, - StateRoot: attestedHeader.StateRoot, - BodyRoot: attestedHeader.BodyRoot, - }, - }, + HeaderAltair: ðpbv2.LightClientHeader{Beacon: blockHeader}, }, } case version.Capella: @@ -172,49 +256,32 @@ func NewLightClientOptimisticUpdateFromBeaconState( if err != nil { return nil, errors.Wrap(err, "could not get execution payload header") } - executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) if err != nil { return nil, errors.Wrap(err, "could not get execution payload proof") } - result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ HeaderCapella: ðpbv2.LightClientHeaderCapella{ - Beacon: ðpbv1.BeaconBlockHeader{ - Slot: attestedHeader.Slot, - ProposerIndex: attestedHeader.ProposerIndex, - ParentRoot: attestedHeader.ParentRoot, - StateRoot: attestedHeader.StateRoot, - BodyRoot: attestedHeader.BodyRoot, - }, + Beacon: blockHeader, Execution: executionPayloadHeader, ExecutionBranch: executionPayloadProof, }, }, } - - case version.Deneb, version.Electra: + case version.Deneb: executionPayloadHeader, err := getExecutionPayloadHeaderDeneb(block) if err != nil { return nil, errors.Wrap(err, "could not get execution payload header") } - executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) if err != nil { return nil, errors.Wrap(err, "could not get execution payload proof") } - result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ - Beacon: ðpbv1.BeaconBlockHeader{ - Slot: attestedHeader.Slot, - ProposerIndex: attestedHeader.ProposerIndex, - ParentRoot: attestedHeader.ParentRoot, - StateRoot: attestedHeader.StateRoot, - BodyRoot: attestedHeader.BodyRoot, - }, + Beacon: blockHeader, Execution: executionPayloadHeader, ExecutionBranch: executionPayloadProof, }, @@ -224,166 +291,196 @@ func NewLightClientOptimisticUpdateFromBeaconState( return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) } - return result, nil -} + // if update_attested_period == update_signature_period + if updateAttestedPeriod == updateSignaturePeriod { + tempNextSyncCommittee, err := attestedState.NextSyncCommittee() + if err != nil { + return nil, errors.Wrap(err, "could not get next sync committee") + } + nextSyncCommittee := ðpbv2.SyncCommittee{ + Pubkeys: tempNextSyncCommittee.Pubkeys, + AggregatePubkey: tempNextSyncCommittee.AggregatePubkey, + } + nextSyncCommitteeBranch, err := attestedState.NextSyncCommitteeProof(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get next sync committee proof") + } -func NewLightClientFinalityUpdateFromBeaconState( - ctx context.Context, - state state.BeaconState, - block interfaces.ReadOnlySignedBeaconBlock, - attestedState state.BeaconState, - finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientUpdate, error) { - result, err := NewLightClientOptimisticUpdateFromBeaconState( - ctx, - state, - block, - attestedState, - ) - if err != nil { - return nil, err - } + // update.next_sync_committee = attested_state.next_sync_committee + result.NextSyncCommittee = nextSyncCommittee - // Indicate finality whenever possible - var finalizedHeaderBeacon *ethpbv1.BeaconBlockHeader - var finalityBranch [][]byte + // update.next_sync_committee_branch = NextSyncCommitteeBranch( + // compute_merkle_proof(attested_state, next_sync_committee_gindex_at_slot(attested_state.slot))) + result.NextSyncCommitteeBranch = nextSyncCommitteeBranch + } + // if finalized_block is not None if finalizedBlock != nil && !finalizedBlock.IsNil() { + // if finalized_block.message.slot != GENESIS_SLOT if finalizedBlock.Block().Slot() != 0 { - tempFinalizedHeader, err := finalizedBlock.Header() + // update.finalized_header = block_to_light_client_header(finalized_block) + v1alpha1FinalizedHeader, err := finalizedBlock.Header() if err != nil { return nil, errors.Wrap(err, "could not get finalized header") } - finalizedHeaderBeacon := migration.V1Alpha1SignedHeaderToV1(tempFinalizedHeader).GetMessage() - - finalizedHeaderRoot, err := finalizedHeaderBeacon.HashTreeRoot() + finalizedHeader := migration.V1Alpha1SignedHeaderToV1(v1alpha1FinalizedHeader).GetMessage() + finalizedHeaderRoot, err := finalizedHeader.HashTreeRoot() if err != nil { return nil, errors.Wrap(err, "could not get finalized header root") } + switch block.Block().Version() { + case version.Altair, version.Bellatrix: + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: ðpbv2.LightClientHeader{Beacon: finalizedHeader}, + }, + } + case version.Capella: + executionPayloadHeader, err := getExecutionPayloadHeaderCapella(finalizedBlock) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload header") + } + executionPayloadProof, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: finalizedHeader, + Execution: executionPayloadHeader, + ExecutionBranch: executionPayloadProof, + }, + }, + } + case version.Deneb: + executionPayloadHeader, err := getExecutionPayloadHeaderDeneb(finalizedBlock) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload header") + } + executionPayloadProof, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) + if err != nil { + return nil, errors.Wrap(err, "could not get execution payload proof") + } + result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: finalizedHeader, + Execution: executionPayloadHeader, + ExecutionBranch: executionPayloadProof, + }, + }, + } + default: + return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) + } + // assert hash_tree_root(update.finalized_header.beacon) == attested_state.finalized_checkpoint.root if finalizedHeaderRoot != bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root) { - return nil, fmt.Errorf("finalized header root %#x not equal to attested finalized checkpoint root %#x", finalizedHeaderRoot, bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root)) + return nil, fmt.Errorf( + "finalized header root %#x not equal to attested finalized checkpoint root %#x", + finalizedHeaderRoot, + bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root), + ) } } else { + // assert attested_state.finalized_checkpoint.root == Bytes32() if !bytes.Equal(attestedState.FinalizedCheckpoint().Root, make([]byte, 32)) { return nil, fmt.Errorf("invalid finalized header root %v", attestedState.FinalizedCheckpoint().Root) } - - finalizedHeaderBeacon = ðpbv1.BeaconBlockHeader{ - Slot: 0, - ProposerIndex: 0, - ParentRoot: make([]byte, 32), - StateRoot: make([]byte, 32), - BodyRoot: make([]byte, 32), - } } - var bErr error - finalityBranch, bErr = attestedState.FinalizedRootProof(ctx) - if bErr != nil { - return nil, errors.Wrap(bErr, "could not get finalized root proof") - } - } else { - finalizedHeaderBeacon = ðpbv1.BeaconBlockHeader{ - Slot: 0, - ProposerIndex: 0, - ParentRoot: make([]byte, 32), - StateRoot: make([]byte, 32), - BodyRoot: make([]byte, 32), + // update.finality_branch = FinalityBranch( + // compute_merkle_proof(attested_state, finalized_root_gindex_at_slot(attested_state.slot))) + finalityBranch, err := attestedState.FinalizedRootProof(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get finalized root proof") } + result.FinalityBranch = finalityBranch + } - finalityBranch = make([][]byte, FinalityBranchNumOfLeaves) - for i := 0; i < FinalityBranchNumOfLeaves; i++ { - finalityBranch[i] = make([]byte, 32) - } + // update.sync_aggregate = block.message.body.sync_aggregate + result.SyncAggregate = ðpbv1.SyncAggregate{ + SyncCommitteeBits: syncAggregate.SyncCommitteeBits, + SyncCommitteeSignature: syncAggregate.SyncCommitteeSignature, } - switch block.Block().Version() { + // update.signature_slot = block.message.slot + result.SignatureSlot = block.Block().Slot() + + return result, nil +} + +func createDefaultLightClientUpdate(v int) (*ethpbv2.LightClientUpdate, error) { + syncCommitteeSize := params.BeaconConfig().SyncCommitteeSize + pubKeys := make([][]byte, syncCommitteeSize) + for i := uint64(0); i < syncCommitteeSize; i++ { + pubKeys[i] = make([]byte, fieldparams.BLSPubkeyLength) + } + nextSyncCommittee := ðpbv2.SyncCommittee{ + Pubkeys: pubKeys, + AggregatePubkey: make([]byte, fieldparams.BLSPubkeyLength), + } + nextSyncCommitteeBranch := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) + for i := 0; i < fieldparams.NextSyncCommitteeBranchDepth; i++ { + nextSyncCommitteeBranch[i] = make([]byte, fieldparams.RootLength) + } + executionBranch := make([][]byte, executionBranchNumOfLeaves) + for i := 0; i < executionBranchNumOfLeaves; i++ { + executionBranch[i] = make([]byte, 32) + } + finalizedBlockHeader := ðpbv1.BeaconBlockHeader{ + Slot: 0, + ProposerIndex: 0, + ParentRoot: make([]byte, 32), + StateRoot: make([]byte, 32), + BodyRoot: make([]byte, 32), + } + finalityBranch := make([][]byte, FinalityBranchNumOfLeaves) + for i := 0; i < FinalityBranchNumOfLeaves; i++ { + finalityBranch[i] = make([]byte, 32) + } + + var finalizedHeader *ethpbv2.LightClientHeaderContainer + switch v { case version.Altair, version.Bellatrix: - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ + finalizedHeader = ðpbv2.LightClientHeaderContainer{ Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ - HeaderAltair: ðpbv2.LightClientHeader{Beacon: finalizedHeaderBeacon}, + HeaderAltair: ðpbv2.LightClientHeader{ + Beacon: finalizedBlockHeader, + }, }, } - result.FinalityBranch = finalityBranch case version.Capella: - if finalizedBlock != nil && !finalizedBlock.IsNil() { - execution, err := getExecutionPayloadHeaderCapella(finalizedBlock) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload header") - } - executionBranch, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ - HeaderCapella: ðpbv2.LightClientHeaderCapella{ - Beacon: finalizedHeaderBeacon, - Execution: execution, - ExecutionBranch: executionBranch, - }, - }, - } - result.FinalityBranch = finalityBranch - } else { - execution := createEmptyExecutionPayloadHeaderCapella() - executionBranch := make([][]byte, 0) - - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ - HeaderCapella: ðpbv2.LightClientHeaderCapella{ - Beacon: finalizedHeaderBeacon, - Execution: execution, - ExecutionBranch: executionBranch, - }, + finalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: ðpbv2.LightClientHeaderCapella{ + Beacon: finalizedBlockHeader, + Execution: createEmptyExecutionPayloadHeaderCapella(), + ExecutionBranch: executionBranch, }, - } - - result.FinalityBranch = finalityBranch + }, } - case version.Deneb, version.Electra: - if finalizedBlock != nil && !finalizedBlock.IsNil() { - execution, err := getExecutionPayloadHeaderDeneb(finalizedBlock) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload header") - } - executionBranch, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ - HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ - Beacon: finalizedHeaderBeacon, - Execution: execution, - ExecutionBranch: executionBranch, - }, - }, - } - result.FinalityBranch = finalityBranch - } else { - execution := createEmptyExecutionPayloadHeaderDeneb() - executionBranch := make([][]byte, 0) - - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ - HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ - Beacon: finalizedHeaderBeacon, - Execution: execution, - ExecutionBranch: executionBranch, - }, + case version.Deneb: + finalizedHeader = ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ + Beacon: finalizedBlockHeader, + Execution: createEmptyExecutionPayloadHeaderDeneb(), + ExecutionBranch: executionBranch, }, - } - - result.FinalityBranch = finalityBranch + }, } default: - return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) + return nil, fmt.Errorf("unsupported block version %s", version.String(v)) } - return result, nil + return ðpbv2.LightClientUpdate{ + NextSyncCommittee: nextSyncCommittee, + NextSyncCommitteeBranch: nextSyncCommitteeBranch, + FinalizedHeader: finalizedHeader, + FinalityBranch: finalityBranch, + }, nil } func createEmptyExecutionPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella { @@ -535,23 +632,6 @@ func getExecutionPayloadHeaderDeneb(block interfaces.ReadOnlySignedBeaconBlock) return execution, nil } -func NewLightClientUpdateFromFinalityUpdate(update *ethpbv2.LightClientFinalityUpdate) *ethpbv2.LightClientUpdate { - return ðpbv2.LightClientUpdate{ - AttestedHeader: update.AttestedHeader, - FinalizedHeader: update.FinalizedHeader, - FinalityBranch: update.FinalityBranch, - SyncAggregate: update.SyncAggregate, - SignatureSlot: update.SignatureSlot, - } -} - -func NewLightClientUpdateFromOptimisticUpdate(update *ethpbv2.LightClientOptimisticUpdate) *ethpbv2.LightClientUpdate { - return ðpbv2.LightClientUpdate{ - AttestedHeader: update.AttestedHeader, - SyncAggregate: update.SyncAggregate, - SignatureSlot: update.SignatureSlot, - } -} func ComputeTransactionsRoot(payload interfaces.ExecutionData) ([]byte, error) { transactionsRoot, err := payload.TransactionsRoot() @@ -590,6 +670,10 @@ func ComputeWithdrawalsRoot(payload interfaces.ExecutionData) ([]byte, error) { } func BlockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeader, error) { + if block.Version() != version.Altair { + return nil, fmt.Errorf("block version is %s instead of Altair", version.String(block.Version())) + } + parentRoot := block.Block().ParentRoot() stateRoot := block.Block().StateRoot() bodyRoot, err := block.Block().Body().HashTreeRoot() @@ -610,7 +694,7 @@ func BlockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) func BlockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderCapella, error) { if block.Version() != version.Capella { - return nil, fmt.Errorf("creating Capella light client header is not supported before Capella, invalid slot %d", block.Block().Slot()) + return nil, fmt.Errorf("block version is %s instead of Capella", version.String(block.Version())) } payload, err := block.Block().Body().Execution() @@ -671,9 +755,8 @@ func BlockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadO } func BlockToLightClientHeaderDeneb(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderDeneb, error) { - epoch := slots.ToEpoch(block.Block().Slot()) - if epoch < params.BeaconConfig().DenebForkEpoch { - return nil, fmt.Errorf("creating Deneb light client header is not supported before Deneb, invalid slot %d", block.Block().Slot()) + if block.Version() != version.Deneb { + return nil, fmt.Errorf("block version is %s instead of Deneb", version.String(block.Version())) } payload, err := block.Block().Body().Execution() diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index de4a6902d907..513d3ff7beef 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -10,13 +10,12 @@ import ( light_client "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateCapella(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(false) +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateAltair(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) require.NoError(t, err) @@ -24,15 +23,12 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateCapella(t *tes require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update) - l.CheckAttestedHeader(update) - - require.Equal(t, (*v2.LightClientHeaderContainer)(nil), update.FinalizedHeader, "Finalized header is not nil") - require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) } -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateAltair(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestAltair() +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateCapella(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) require.NoError(t, err) @@ -40,11 +36,8 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateAltair(t *test require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update) - l.CheckAttestedHeader(update) - - require.Equal(t, (*v2.LightClientHeaderContainer)(nil), update.FinalizedHeader, "Finalized header is not nil") - require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) } func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateDeneb(t *testing.T) { @@ -56,22 +49,21 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateDeneb(t *testi require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update) - l.CheckAttestedHeader(update) - - require.Equal(t, (*v2.LightClientHeaderContainer)(nil), update.FinalizedHeader, "Finalized header is not nil") - require.DeepSSZEqual(t, ([][]byte)(nil), update.FinalityBranch, "Finality branch is not nil") + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) } -func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateCapella(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(false) + +func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateAltair(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) require.NoError(t, err) require.NotNil(t, update, "update is nil") require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update) - l.CheckAttestedHeader(update) + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) zeroHash := params.BeaconConfig().ZeroHash[:] require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") @@ -88,17 +80,16 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateCapella(t *testi } } -func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateAltair(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestAltair() - +func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateCapella(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) require.NoError(t, err) require.NotNil(t, update, "update is nil") require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update) - l.CheckAttestedHeader(update) + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) zeroHash := params.BeaconConfig().ZeroHash[:] require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") @@ -124,8 +115,8 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateDeneb(t *testing require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update) - l.CheckAttestedHeader(update) + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) zeroHash := params.BeaconConfig().ZeroHash[:] require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 980171cd9f2b..1c726be4591a 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -301,45 +301,15 @@ func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, f if !ok { return write(w, flusher, topicDataMismatch, event.Data, LightClientFinalityUpdateTopic) } - - var finalityBranch []string - for _, b := range updateData.Data.FinalityBranch { - finalityBranch = append(finalityBranch, hexutil.Encode(b)) - } - - attestedBeacon, err := updateData.Data.AttestedHeader.GetBeacon() + update, err := structs.LightClientFinalityUpdateFromConsensus(updateData.Data) if err != nil { - return errors.Wrap(err, "could not get attested header") + return err } - finalizedBeacon, err := updateData.Data.FinalizedHeader.GetBeacon() - if err != nil { - return errors.Wrap(err, "could not get finalized header") - } - update := &structs.LightClientFinalityUpdateEvent{ + updateEvent := &structs.LightClientFinalityUpdateEvent{ Version: version.String(int(updateData.Version)), - Data: &structs.LightClientFinalityUpdate{ - AttestedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", attestedBeacon.Slot), - ProposerIndex: fmt.Sprintf("%d", attestedBeacon.ProposerIndex), - ParentRoot: hexutil.Encode(attestedBeacon.ParentRoot), - StateRoot: hexutil.Encode(attestedBeacon.StateRoot), - BodyRoot: hexutil.Encode(attestedBeacon.BodyRoot), - }, - FinalizedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", finalizedBeacon.Slot), - ProposerIndex: fmt.Sprintf("%d", finalizedBeacon.ProposerIndex), - ParentRoot: hexutil.Encode(finalizedBeacon.ParentRoot), - StateRoot: hexutil.Encode(finalizedBeacon.StateRoot), - }, - FinalityBranch: finalityBranch, - SyncAggregate: &structs.SyncAggregate{ - SyncCommitteeBits: hexutil.Encode(updateData.Data.SyncAggregate.SyncCommitteeBits), - SyncCommitteeSignature: hexutil.Encode(updateData.Data.SyncAggregate.SyncCommitteeSignature), - }, - SignatureSlot: fmt.Sprintf("%d", updateData.Data.SignatureSlot), - }, - } - return send(w, flusher, LightClientFinalityUpdateTopic, update) + Data: update, + } + return send(w, flusher, LightClientFinalityUpdateTopic, updateEvent) case statefeed.LightClientOptimisticUpdate: if _, ok := requestedTopics[LightClientOptimisticUpdateTopic]; !ok { return nil @@ -348,28 +318,15 @@ func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, f if !ok { return write(w, flusher, topicDataMismatch, event.Data, LightClientOptimisticUpdateTopic) } - attestedBeacon, err := updateData.Data.AttestedHeader.GetBeacon() + update, err := structs.LightClientOptimisticUpdateFromConsensus(updateData.Data) if err != nil { - return errors.Wrap(err, "could not get attested header") + return err } - update := &structs.LightClientOptimisticUpdateEvent{ + updateEvent := &structs.LightClientOptimisticUpdateEvent{ Version: version.String(int(updateData.Version)), - Data: &structs.LightClientOptimisticUpdate{ - AttestedHeader: &structs.BeaconBlockHeader{ - Slot: fmt.Sprintf("%d", attestedBeacon.Slot), - ProposerIndex: fmt.Sprintf("%d", attestedBeacon.ProposerIndex), - ParentRoot: hexutil.Encode(attestedBeacon.ParentRoot), - StateRoot: hexutil.Encode(attestedBeacon.StateRoot), - BodyRoot: hexutil.Encode(attestedBeacon.BodyRoot), - }, - SyncAggregate: &structs.SyncAggregate{ - SyncCommitteeBits: hexutil.Encode(updateData.Data.SyncAggregate.SyncCommitteeBits), - SyncCommitteeSignature: hexutil.Encode(updateData.Data.SyncAggregate.SyncCommitteeSignature), - }, - SignatureSlot: fmt.Sprintf("%d", updateData.Data.SignatureSlot), - }, - } - return send(w, flusher, LightClientOptimisticUpdateTopic, update) + Data: update, + } + return send(w, flusher, LightClientOptimisticUpdateTopic, updateEvent) case statefeed.Reorg: if _, ok := requestedTopics[ChainReorgTopic]; !ok { return nil diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index 4b1aee2d28cd..930c701901a5 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -27,9 +27,7 @@ go_library( "//encoding/ssz:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", - "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", - "//proto/migration:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 3137eda4cd2c..49c28fa9379b 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -118,7 +118,7 @@ func (s *Server) GetLightClientUpdatesByRange(w http.ResponseWriter, req *http.R } // Populate updates - var updates []*structs.LightClientUpdateWithVersion + var updates []*structs.LightClientUpdateResponse for period := startPeriod; period <= endPeriod; period++ { // Get the last known state of the period, // 1. We wish the block has a parent in the same period if possible @@ -199,7 +199,7 @@ func (s *Server) GetLightClientUpdatesByRange(w http.ResponseWriter, req *http.R } } - update, err := createLightClientUpdate( + update, err := newLightClientUpdateFromBeaconState( ctx, state, block, @@ -208,7 +208,7 @@ func (s *Server) GetLightClientUpdatesByRange(w http.ResponseWriter, req *http.R ) if err == nil { - updates = append(updates, &structs.LightClientUpdateWithVersion{ + updates = append(updates, &structs.LightClientUpdateResponse{ Version: version.String(attestedState.Version()), Data: update, }) @@ -225,7 +225,6 @@ func (s *Server) GetLightClientUpdatesByRange(w http.ResponseWriter, req *http.R // GetLightClientFinalityUpdate - implements https://github.com/ethereum/beacon-APIs/blob/263f4ed6c263c967f13279c7a9f5629b51c5fc55/apis/beacon/light_client/finality_update.yaml func (s *Server) GetLightClientFinalityUpdate(w http.ResponseWriter, req *http.Request) { - // Prepare ctx, span := trace.StartSpan(req.Context(), "beacon.GetLightClientFinalityUpdate") defer span.End() @@ -233,56 +232,48 @@ func (s *Server) GetLightClientFinalityUpdate(w http.ResponseWriter, req *http.R minSyncCommitteeParticipants := float64(params.BeaconConfig().MinSyncCommitteeParticipants) minSignatures := uint64(math.Ceil(minSyncCommitteeParticipants * 2 / 3)) - block, err := s.getLightClientEventBlock(ctx, minSignatures) + block, err := s.suitableBlock(ctx, minSignatures) if !shared.WriteBlockFetchError(w, block, err) { return } - state, err := s.Stater.StateBySlot(ctx, block.Block().Slot()) + st, err := s.Stater.StateBySlot(ctx, block.Block().Slot()) if err != nil { - httputil.HandleError(w, "could not get state: "+err.Error(), http.StatusInternalServerError) + httputil.HandleError(w, "Could not get state: "+err.Error(), http.StatusInternalServerError) return } - // Get attested state attestedRoot := block.Block().ParentRoot() attestedBlock, err := s.Blocker.Block(ctx, attestedRoot[:]) - if err != nil || attestedBlock == nil { - httputil.HandleError(w, "could not get attested block: "+err.Error(), http.StatusInternalServerError) + if !shared.WriteBlockFetchError(w, block, errors.Wrap(err, "could not get attested block")) { return } - attestedSlot := attestedBlock.Block().Slot() attestedState, err := s.Stater.StateBySlot(ctx, attestedSlot) if err != nil { - httputil.HandleError(w, "could not get attested state: "+err.Error(), http.StatusInternalServerError) + httputil.HandleError(w, "Could not get attested state: "+err.Error(), http.StatusInternalServerError) return } - // Get finalized block var finalizedBlock interfaces.ReadOnlySignedBeaconBlock - finalizedCheckPoint := attestedState.FinalizedCheckpoint() - if finalizedCheckPoint != nil { - finalizedRoot := bytesutil.ToBytes32(finalizedCheckPoint.Root) - finalizedBlock, err = s.Blocker.Block(ctx, finalizedRoot[:]) - if err != nil { - finalizedBlock = nil - } + finalizedCheckpoint := attestedState.FinalizedCheckpoint() + if finalizedCheckpoint == nil { + httputil.HandleError(w, "Attested state does not have a finalized checkpoint", http.StatusInternalServerError) + return + } + finalizedRoot := bytesutil.ToBytes32(finalizedCheckpoint.Root) + finalizedBlock, err = s.Blocker.Block(ctx, finalizedRoot[:]) + if !shared.WriteBlockFetchError(w, block, errors.Wrap(err, "could not get finalized block")) { + return } - update, err := newLightClientFinalityUpdateFromBeaconState( - ctx, - state, - block, - attestedState, - finalizedBlock, - ) + update, err := newLightClientFinalityUpdateFromBeaconState(ctx, st, block, attestedState, finalizedBlock) if err != nil { - httputil.HandleError(w, "could not get light client finality update: "+err.Error(), http.StatusInternalServerError) + httputil.HandleError(w, "Could not get light client finality update: "+err.Error(), http.StatusInternalServerError) return } - response := &structs.LightClientUpdateWithVersion{ + response := &structs.LightClientFinalityUpdateResponse{ Version: version.String(attestedState.Version()), Data: update, } @@ -292,54 +283,42 @@ func (s *Server) GetLightClientFinalityUpdate(w http.ResponseWriter, req *http.R // GetLightClientOptimisticUpdate - implements https://github.com/ethereum/beacon-APIs/blob/263f4ed6c263c967f13279c7a9f5629b51c5fc55/apis/beacon/light_client/optimistic_update.yaml func (s *Server) GetLightClientOptimisticUpdate(w http.ResponseWriter, req *http.Request) { - // Prepare ctx, span := trace.StartSpan(req.Context(), "beacon.GetLightClientOptimisticUpdate") defer span.End() - minSignatures := params.BeaconConfig().MinSyncCommitteeParticipants - - block, err := s.getLightClientEventBlock(ctx, minSignatures) + block, err := s.suitableBlock(ctx, params.BeaconConfig().MinSyncCommitteeParticipants) if !shared.WriteBlockFetchError(w, block, err) { return } - - state, err := s.Stater.StateBySlot(ctx, block.Block().Slot()) + st, err := s.Stater.StateBySlot(ctx, block.Block().Slot()) if err != nil { httputil.HandleError(w, "could not get state: "+err.Error(), http.StatusInternalServerError) return } - - // Get attested state attestedRoot := block.Block().ParentRoot() attestedBlock, err := s.Blocker.Block(ctx, attestedRoot[:]) if err != nil { - httputil.HandleError(w, "could not get attested block: "+err.Error(), http.StatusInternalServerError) + httputil.HandleError(w, "Could not get attested block: "+err.Error(), http.StatusInternalServerError) return } if attestedBlock == nil { - httputil.HandleError(w, "attested block is nil", http.StatusInternalServerError) + httputil.HandleError(w, "Attested block is nil", http.StatusInternalServerError) return } - attestedSlot := attestedBlock.Block().Slot() attestedState, err := s.Stater.StateBySlot(ctx, attestedSlot) if err != nil { - httputil.HandleError(w, "could not get attested state: "+err.Error(), http.StatusInternalServerError) + httputil.HandleError(w, "Could not get attested state: "+err.Error(), http.StatusInternalServerError) return } - update, err := newLightClientOptimisticUpdateFromBeaconState( - ctx, - state, - block, - attestedState, - ) + update, err := newLightClientOptimisticUpdateFromBeaconState(ctx, st, block, attestedState) if err != nil { - httputil.HandleError(w, "could not get light client optimistic update: "+err.Error(), http.StatusInternalServerError) + httputil.HandleError(w, "Could not get light client optimistic update: "+err.Error(), http.StatusInternalServerError) return } - response := &structs.LightClientUpdateWithVersion{ + response := &structs.LightClientOptimisticUpdateResponse{ Version: version.String(attestedState.Version()), Data: update, } @@ -347,17 +326,15 @@ func (s *Server) GetLightClientOptimisticUpdate(w http.ResponseWriter, req *http httputil.WriteJson(w, response) } -// getLightClientEventBlock - returns the block that should be used for light client events, which satisfies the minimum number of signatures from sync committee -func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequired uint64) (interfaces.ReadOnlySignedBeaconBlock, error) { - // Get the current state - state, err := s.HeadFetcher.HeadState(ctx) +// suitableBlock returns the latest block that satisfies all criteria required for creating a new update +func (s *Server) suitableBlock(ctx context.Context, minSignaturesRequired uint64) (interfaces.ReadOnlySignedBeaconBlock, error) { + st, err := s.HeadFetcher.HeadState(ctx) if err != nil { return nil, errors.Wrap(err, "could not get head state") } - // Get the block - latestBlockHeader := *state.LatestBlockHeader() - stateRoot, err := state.HashTreeRoot(ctx) + latestBlockHeader := st.LatestBlockHeader() + stateRoot, err := st.HashTreeRoot(ctx) if err != nil { return nil, errors.Wrap(err, "could not get state root") } @@ -377,7 +354,7 @@ func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequ // Loop through the blocks until we find a block that satisfies minSignaturesRequired requirement var numOfSyncCommitteeSignatures uint64 - if syncAggregate, err := block.Block().Body().SyncAggregate(); err == nil && syncAggregate != nil { + if syncAggregate, err := block.Block().Body().SyncAggregate(); err == nil { numOfSyncCommitteeSignatures = syncAggregate.SyncCommitteeBits.Count() } @@ -394,7 +371,7 @@ func (s *Server) getLightClientEventBlock(ctx context.Context, minSignaturesRequ // Get the number of sync committee signatures numOfSyncCommitteeSignatures = 0 - if syncAggregate, err := block.Block().Body().SyncAggregate(); err == nil && syncAggregate != nil { + if syncAggregate, err := block.Block().Body().SyncAggregate(); err == nil { numOfSyncCommitteeSignatures = syncAggregate.SyncCommitteeBits.Count() } } diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index 245def3d2218..cac658e7aeed 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -1235,7 +1235,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdateAltair(t *testing.T) { s.GetLightClientFinalityUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp structs.LightClientUpdateWithVersion + var resp *structs.LightClientUpdateResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) var respHeader structs.LightClientHeader @@ -1345,7 +1345,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdateCapella(t *testing.T) { s.GetLightClientFinalityUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp structs.LightClientUpdateWithVersion + var resp *structs.LightClientUpdateResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) var respHeader structs.LightClientHeader @@ -1455,7 +1455,7 @@ func TestLightClientHandler_GetLightClientFinalityUpdateDeneb(t *testing.T) { s.GetLightClientFinalityUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp structs.LightClientUpdateWithVersion + var resp *structs.LightClientUpdateResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) var respHeader structs.LightClientHeaderDeneb @@ -1565,7 +1565,7 @@ func TestLightClientHandler_GetLightClientOptimisticUpdateAltair(t *testing.T) { s.GetLightClientOptimisticUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp structs.LightClientUpdateWithVersion + var resp *structs.LightClientUpdateResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) var respHeader structs.LightClientHeader @@ -1675,7 +1675,7 @@ func TestLightClientHandler_GetLightClientOptimisticUpdateCapella(t *testing.T) s.GetLightClientOptimisticUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp structs.LightClientUpdateWithVersion + var resp *structs.LightClientUpdateResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) var respHeader structs.LightClientHeaderCapella @@ -1785,7 +1785,7 @@ func TestLightClientHandler_GetLightClientOptimisticUpdateDeneb(t *testing.T) { s.GetLightClientOptimisticUpdate(writer, request) require.Equal(t, http.StatusOK, writer.Code) - var resp structs.LightClientUpdateWithVersion + var resp *structs.LightClientUpdateResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) var respHeader structs.LightClientHeaderDeneb @@ -1890,7 +1890,7 @@ func TestLightClientHandler_GetLightClientEventBlock(t *testing.T) { } minSignaturesRequired := uint64(100) - eventBlock, err := s.getLightClientEventBlock(ctx, minSignaturesRequired) + eventBlock, err := s.suitableBlock(ctx, minSignaturesRequired) require.NoError(t, err) require.NotNil(t, eventBlock) @@ -1997,7 +1997,7 @@ func TestLightClientHandler_GetLightClientEventBlock_NeedFetchParent(t *testing. } minSignaturesRequired := uint64(100) - eventBlock, err := s.getLightClientEventBlock(ctx, minSignaturesRequired) + eventBlock, err := s.suitableBlock(ctx, minSignaturesRequired) require.NoError(t, err) require.NotNil(t, eventBlock) diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index aa5f8a6b81dd..b30de84bce79 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "reflect" - "strconv" "github.com/pkg/errors" @@ -21,9 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" - v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" - "github.com/prysmaticlabs/prysm/v5/proto/migration" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -349,128 +346,19 @@ func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconStat return result, nil } -// createLightClientUpdate - implements https://github. -// com/ethereum/consensus-specs/blob/d70dcd9926a4bbe987f1b4e65c3e05bd029fcfb8/specs/altair/light-client/full-node.md#create_light_client_update -// def create_light_client_update(state: BeaconState, -// -// block: SignedBeaconBlock, -// attested_state: BeaconState, -// finalized_block: Optional[SignedBeaconBlock]) -> LightClientUpdate: -// assert compute_epoch_at_slot(attested_state.slot) >= ALTAIR_FORK_EPOCH -// assert sum(block.message.body.sync_aggregate.sync_committee_bits) >= MIN_SYNC_COMMITTEE_PARTICIPANTS -// -// assert state.slot == state.latest_block_header.slot -// header = state.latest_block_header.copy() -// header.state_root = hash_tree_root(state) -// assert hash_tree_root(header) == hash_tree_root(block.message) -// update_signature_period = compute_sync_committee_period(compute_epoch_at_slot(block.message.slot)) -// -// assert attested_state.slot == attested_state.latest_block_header.slot -// attested_header = attested_state.latest_block_header.copy() -// attested_header.state_root = hash_tree_root(attested_state) -// assert hash_tree_root(attested_header) == block.message.parent_root -// update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) -// -// # `next_sync_committee` is only useful if the message is signed by the current sync committee -// if update_attested_period == update_signature_period: -// next_sync_committee = attested_state.next_sync_committee -// next_sync_committee_branch = compute_merkle_proof_for_state(attested_state, NEXT_SYNC_COMMITTEE_INDEX) -// else: -// next_sync_committee = SyncCommittee() -// next_sync_committee_branch = [Bytes32() for _ in range(floorlog2(NEXT_SYNC_COMMITTEE_INDEX))] -// -// # Indicate finality whenever possible -// if finalized_block is not None: -// if finalized_block.message.slot != GENESIS_SLOT: -// finalized_header = BeaconBlockHeader( -// slot=finalized_block.message.slot, -// proposer_index=finalized_block.message.proposer_index, -// parent_root=finalized_block.message.parent_root, -// state_root=finalized_block.message.state_root, -// body_root=hash_tree_root(finalized_block.message.body), -// ) -// assert hash_tree_root(finalized_header) == attested_state.finalized_checkpoint.root -// else: -// assert attested_state.finalized_checkpoint.root == Bytes32() -// finalized_header = BeaconBlockHeader() -// finality_branch = compute_merkle_proof_for_state(attested_state, FINALIZED_ROOT_INDEX) -// else: -// finalized_header = BeaconBlockHeader() -// finality_branch = [Bytes32() for _ in range(floorlog2(FINALIZED_ROOT_INDEX))] -// -// return LightClientUpdate( -// attested_header=attested_header, -// next_sync_committee=next_sync_committee, -// next_sync_committee_branch=next_sync_committee_branch, -// finalized_header=finalized_header, -// finality_branch=finality_branch, -// sync_aggregate=block.message.body.sync_aggregate, -// signature_slot=block.message.slot, -// ) -func createLightClientUpdate( +func newLightClientUpdateFromBeaconState( ctx context.Context, state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, - finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientUpdate, error) { - result, err := lightclient.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + finalizedBlock interfaces.ReadOnlySignedBeaconBlock, +) (*structs.LightClientUpdate, error) { + result, err := lightclient.NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) if err != nil { return nil, err } - // Generate next sync committee and proof - var nextSyncCommittee *v2.SyncCommittee - var nextSyncCommitteeBranch [][]byte - - // update_signature_period = compute_sync_committee_period(compute_epoch_at_slot(block.message.slot)) - updateSignaturePeriod := slots.SyncCommitteePeriod(slots.ToEpoch(block.Block().Slot())) - - // update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) - resultAttestedHeaderBeacon, err := result.AttestedHeader.GetBeacon() - if err != nil { - return nil, errors.Wrap(err, "could not get attested header beacon") - } - updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(resultAttestedHeaderBeacon.Slot)) - - if updateAttestedPeriod == updateSignaturePeriod { - tempNextSyncCommittee, err := attestedState.NextSyncCommittee() - if err != nil { - return nil, errors.Wrap(err, "could not get next sync committee") - } - - nextSyncCommittee = &v2.SyncCommittee{ - Pubkeys: tempNextSyncCommittee.Pubkeys, - AggregatePubkey: tempNextSyncCommittee.AggregatePubkey, - } - - nextSyncCommitteeBranch, err = attestedState.NextSyncCommitteeProof(ctx) - if err != nil { - return nil, errors.Wrap(err, "could not get next sync committee proof") - } - } else { - syncCommitteeSize := params.BeaconConfig().SyncCommitteeSize - pubKeys := make([][]byte, syncCommitteeSize) - for i := uint64(0); i < syncCommitteeSize; i++ { - pubKeys[i] = make([]byte, fieldparams.BLSPubkeyLength) - } - nextSyncCommittee = &v2.SyncCommittee{ - Pubkeys: pubKeys, - AggregatePubkey: make([]byte, fieldparams.BLSPubkeyLength), - } - - nextSyncCommitteeBranch = make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) - for i := 0; i < fieldparams.NextSyncCommitteeBranchDepth; i++ { - nextSyncCommitteeBranch[i] = make([]byte, fieldparams.RootLength) - } - } - - result.NextSyncCommittee = nextSyncCommittee - result.NextSyncCommitteeBranch = nextSyncCommitteeBranch - res, err := newLightClientUpdateToJSON(result) - if err != nil { - return nil, errors.Wrap(err, "could not convert light client update to JSON") - } - return res, nil + return structs.LightClientUpdateFromConsensus(result) } func newLightClientFinalityUpdateFromBeaconState( @@ -478,99 +366,28 @@ func newLightClientFinalityUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, - finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientUpdate, error) { + finalizedBlock interfaces.ReadOnlySignedBeaconBlock, +) (*structs.LightClientFinalityUpdate, error) { result, err := lightclient.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) if err != nil { return nil, err } - res, err := newLightClientUpdateToJSON(result) - if err != nil { - return nil, errors.Wrap(err, "could not convert light client update to JSON") - } - return res, nil + return structs.LightClientFinalityUpdateFromConsensus(result) } func newLightClientOptimisticUpdateFromBeaconState( ctx context.Context, state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, - attestedState state.BeaconState) (*structs.LightClientUpdate, error) { + attestedState state.BeaconState, +) (*structs.LightClientOptimisticUpdate, error) { result, err := lightclient.NewLightClientOptimisticUpdateFromBeaconState(ctx, state, block, attestedState) if err != nil { return nil, err } - res, err := newLightClientUpdateToJSON(result) - if err != nil { - return nil, errors.Wrap(err, "could not convert light client update to JSON") - } - return res, nil -} - -func branchToJSON(branchBytes [][]byte) []string { - if branchBytes == nil { - return nil - } - branch := make([]string, len(branchBytes)) - for i, root := range branchBytes { - branch[i] = hexutil.Encode(root) - } - return branch -} - -func syncAggregateToJSON(input *v1.SyncAggregate) *structs.SyncAggregate { - if input == nil { - return nil - } - return &structs.SyncAggregate{ - SyncCommitteeBits: hexutil.Encode(input.SyncCommitteeBits), - SyncCommitteeSignature: hexutil.Encode(input.SyncCommitteeSignature), - } -} - -func newLightClientUpdateToJSON(input *v2.LightClientUpdate) (*structs.LightClientUpdate, error) { - if input == nil { - return nil, errors.New("input is nil") - } - - var nextSyncCommittee *structs.SyncCommittee - if input.NextSyncCommittee != nil { - nextSyncCommittee = structs.SyncCommitteeFromConsensus(migration.V2SyncCommitteeToV1Alpha1(input.NextSyncCommittee)) - } - - var finalizedHeader *structs.BeaconBlockHeader - if input.FinalizedHeader != nil { - inputFinalizedHeaderBeacon, err := input.FinalizedHeader.GetBeacon() - if err != nil { - return nil, errors.Wrap(err, "could not get finalized header beacon") - } - finalizedHeader = structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(inputFinalizedHeaderBeacon)) - } - - inputAttestedHeaderBeacon, err := input.AttestedHeader.GetBeacon() - if err != nil { - return nil, errors.Wrap(err, "could not get attested header beacon") - } - attestedHeaderJson, err := json.Marshal(&structs.LightClientHeader{Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(inputAttestedHeaderBeacon))}) - if err != nil { - return nil, errors.Wrap(err, "could not convert attested header to raw message") - } - finalizedHeaderJson, err := json.Marshal(&structs.LightClientHeader{Beacon: finalizedHeader}) - if err != nil { - return nil, errors.Wrap(err, "could not convert finalized header to raw message") - } - result := &structs.LightClientUpdate{ - AttestedHeader: attestedHeaderJson, - NextSyncCommittee: nextSyncCommittee, - NextSyncCommitteeBranch: branchToJSON(input.NextSyncCommitteeBranch), - FinalizedHeader: finalizedHeaderJson, - FinalityBranch: branchToJSON(input.FinalityBranch), - SyncAggregate: syncAggregateToJSON(input.SyncAggregate), - SignatureSlot: strconv.FormatUint(uint64(input.SignatureSlot), 10), - } - - return result, nil + return structs.LightClientOptimisticUpdateFromConsensus(result) } func IsSyncCommitteeUpdate(update *v2.LightClientUpdate) bool { diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index cece6018ed21..a4ca9b3e5abb 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -295,8 +296,8 @@ func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient { return l } -func (l *TestLightClient) CheckAttestedHeader(update *ethpbv2.LightClientUpdate) { - updateAttestedHeaderBeacon, err := update.AttestedHeader.GetBeacon() +func (l *TestLightClient) CheckAttestedHeader(container *ethpbv2.LightClientHeaderContainer) { + updateAttestedHeaderBeacon, err := container.GetBeacon() require.NoError(l.T, err) require.Equal(l.T, l.AttestedHeader.Slot, updateAttestedHeaderBeacon.Slot, "Attested header slot is not equal") require.Equal(l.T, l.AttestedHeader.ProposerIndex, updateAttestedHeaderBeacon.ProposerIndex, "Attested header proposer index is not equal") @@ -308,9 +309,9 @@ func (l *TestLightClient) CheckAttestedHeader(update *ethpbv2.LightClientUpdate) require.DeepSSZEqual(l.T, attestedStateRoot[:], updateAttestedHeaderBeacon.StateRoot, "Attested header state root is not equal") } -func (l *TestLightClient) CheckSyncAggregate(update *ethpbv2.LightClientUpdate) { +func (l *TestLightClient) CheckSyncAggregate(sa *ethpbv1.SyncAggregate) { syncAggregate, err := l.Block.Block().Body().SyncAggregate() require.NoError(l.T, err) - require.DeepSSZEqual(l.T, syncAggregate.SyncCommitteeBits, update.SyncAggregate.SyncCommitteeBits, "SyncAggregate bits is not equal") - require.DeepSSZEqual(l.T, syncAggregate.SyncCommitteeSignature, update.SyncAggregate.SyncCommitteeSignature, "SyncAggregate signature is not equal") + require.DeepSSZEqual(l.T, syncAggregate.SyncCommitteeBits, sa.SyncCommitteeBits, "SyncAggregate bits is not equal") + require.DeepSSZEqual(l.T, syncAggregate.SyncCommitteeSignature, sa.SyncCommitteeSignature, "SyncAggregate signature is not equal") } From bc9c7193a9dee0b8729b5c89819f368f702485ce Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:28:47 -0500 Subject: [PATCH 296/325] FIX: removing extra container for ssz blob sidecar response (#14451) * removing extra container for ssz blob sidecar response * gaz and changelog * gaz * fixing dependencies * fixing test * updating values based on feedback" --- CHANGELOG.md | 1 + beacon-chain/db/filesystem/cache.go | 2 +- beacon-chain/db/filesystem/pruner.go | 1 - beacon-chain/rpc/eth/blob/BUILD.bazel | 4 ++- beacon-chain/rpc/eth/blob/handlers.go | 33 +++++++++++++--------- beacon-chain/rpc/eth/blob/handlers_test.go | 28 +++++++++++++++++- config/fieldparams/mainnet.go | 1 + config/fieldparams/minimal.go | 1 + 8 files changed, 54 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b99fcea6ee45..d71b3efb074e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `== nil` checks before calling `IsNil()` on interfaces to prevent panics. - Core: Fixed slash processing causing extra hashing - Core: Fixed extra allocations when processing slashings +- remove unneeded container in blob sidecar ssz response ### Security diff --git a/beacon-chain/db/filesystem/cache.go b/beacon-chain/db/filesystem/cache.go index 46d1f694c8f9..98223f3779d5 100644 --- a/beacon-chain/db/filesystem/cache.go +++ b/beacon-chain/db/filesystem/cache.go @@ -114,5 +114,5 @@ func (s *blobStorageCache) evict(key [32]byte) { func (s *blobStorageCache) updateMetrics(delta float64) { s.nBlobs += delta blobDiskCount.Set(s.nBlobs) - blobDiskSize.Set(s.nBlobs * bytesPerSidecar) + blobDiskSize.Set(s.nBlobs * fieldparams.BlobSidecarSize) } diff --git a/beacon-chain/db/filesystem/pruner.go b/beacon-chain/db/filesystem/pruner.go index 5ac4ac50d6fa..74ca0966f2e8 100644 --- a/beacon-chain/db/filesystem/pruner.go +++ b/beacon-chain/db/filesystem/pruner.go @@ -21,7 +21,6 @@ import ( ) const retentionBuffer primitives.Epoch = 2 -const bytesPerSidecar = 131928 var ( errPruningFailures = errors.New("blobs could not be pruned for some roots") diff --git a/beacon-chain/rpc/eth/blob/BUILD.bazel b/beacon-chain/rpc/eth/blob/BUILD.bazel index 396eeec6ed5d..85f48f9bbc74 100644 --- a/beacon-chain/rpc/eth/blob/BUILD.bazel +++ b/beacon-chain/rpc/eth/blob/BUILD.bazel @@ -13,10 +13,11 @@ go_library( "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//config/fieldparams:go_default_library", + "//consensus-types/blocks:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_pkg_errors//:go_default_library", ], ) @@ -32,6 +33,7 @@ go_test( "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/verification:go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/rpc/eth/blob/handlers.go b/beacon-chain/rpc/eth/blob/handlers.go index 0fcaef08a848..4f4635372399 100644 --- a/beacon-chain/rpc/eth/blob/handlers.go +++ b/beacon-chain/rpc/eth/blob/handlers.go @@ -8,19 +8,19 @@ import ( "strings" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" - eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // Blobs is an HTTP handler for Beacon API getBlobs. func (s *Server) Blobs(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.Blobs") defer span.End() - var sidecars []*eth.BlobSidecar indices, err := parseIndices(r.URL) if err != nil { @@ -48,14 +48,9 @@ func (s *Server) Blobs(w http.ResponseWriter, r *http.Request) { return } } - for i := range verifiedBlobs { - sidecars = append(sidecars, verifiedBlobs[i].BlobSidecar) - } + if httputil.RespondWithSsz(r) { - sidecarResp := ð.BlobSidecars{ - Sidecars: sidecars, - } - sszResp, err := sidecarResp.MarshalSSZ() + sszResp, err := buildSidecarsSSZResponse(verifiedBlobs) if err != nil { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) return @@ -64,7 +59,7 @@ func (s *Server) Blobs(w http.ResponseWriter, r *http.Request) { return } - httputil.WriteJson(w, buildSidecarsResponse(sidecars)) + httputil.WriteJson(w, buildSidecarsJsonResponse(verifiedBlobs)) } // parseIndices filters out invalid and duplicate blob indices @@ -97,9 +92,9 @@ loop: return indices, nil } -func buildSidecarsResponse(sidecars []*eth.BlobSidecar) *structs.SidecarsResponse { - resp := &structs.SidecarsResponse{Data: make([]*structs.Sidecar, len(sidecars))} - for i, sc := range sidecars { +func buildSidecarsJsonResponse(verifiedBlobs []*blocks.VerifiedROBlob) *structs.SidecarsResponse { + resp := &structs.SidecarsResponse{Data: make([]*structs.Sidecar, len(verifiedBlobs))} + for i, sc := range verifiedBlobs { proofs := make([]string, len(sc.CommitmentInclusionProof)) for j := range sc.CommitmentInclusionProof { proofs[j] = hexutil.Encode(sc.CommitmentInclusionProof[j]) @@ -115,3 +110,15 @@ func buildSidecarsResponse(sidecars []*eth.BlobSidecar) *structs.SidecarsRespons } return resp } + +func buildSidecarsSSZResponse(verifiedBlobs []*blocks.VerifiedROBlob) ([]byte, error) { + ssz := make([]byte, field_params.BlobSidecarSize*len(verifiedBlobs)) + for i, sidecar := range verifiedBlobs { + sszrep, err := sidecar.MarshalSSZ() + if err != nil { + return nil, errors.Wrap(err, "failed to marshal sidecar ssz") + } + copy(ssz[i*field_params.BlobSidecarSize:(i+1)*field_params.BlobSidecarSize], sszrep) + } + return ssz, nil +} diff --git a/beacon-chain/rpc/eth/blob/handlers_test.go b/beacon-chain/rpc/eth/blob/handlers_test.go index 707cc567dd9f..1e66fbc8b487 100644 --- a/beacon-chain/rpc/eth/blob/handlers_test.go +++ b/beacon-chain/rpc/eth/blob/handlers_test.go @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" "github.com/prysmaticlabs/prysm/v5/beacon-chain/verification" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/network/httputil" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -366,7 +367,32 @@ func TestBlobs(t *testing.T) { } s.Blobs(writer, request) assert.Equal(t, http.StatusOK, writer.Code) - require.Equal(t, len(writer.Body.Bytes()), 131932) + require.Equal(t, len(writer.Body.Bytes()), fieldparams.BlobSidecarSize) // size of each sidecar + // can directly unmarshal to sidecar since there's only 1 + var sidecar eth.BlobSidecar + require.NoError(t, sidecar.UnmarshalSSZ(writer.Body.Bytes())) + require.NotNil(t, sidecar.Blob) + }) + t.Run("ssz multiple blobs", func(t *testing.T) { + u := "http://foo.example/finalized" + request := httptest.NewRequest("GET", u, nil) + request.Header.Add("Accept", "application/octet-stream") + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + blocker := &lookup.BeaconDbBlocker{ + ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockRoot[:]}}, + GenesisTimeFetcher: &testutil.MockGenesisTimeFetcher{ + Genesis: time.Now(), + }, + BeaconDB: db, + BlobStorage: bs, + } + s := &Server{ + Blocker: blocker, + } + s.Blobs(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + require.Equal(t, len(writer.Body.Bytes()), fieldparams.BlobSidecarSize*4) // size of each sidecar }) } diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index d66549e381d1..17aeed23f8ba 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -31,6 +31,7 @@ const ( LogMaxBlobCommitments = 12 // Log_2 of MaxBlobCommitmentsPerBlock BlobLength = 131072 // BlobLength defines the byte length of a blob. BlobSize = 131072 // defined to match blob.size in bazel ssz codegen + BlobSidecarSize = 131928 // defined to match blob sidecar size in bazel ssz codegen KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index ee48143e5262..ac022e5823ea 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -31,6 +31,7 @@ const ( LogMaxBlobCommitments = 4 // Log_2 of MaxBlobCommitmentsPerBlock BlobLength = 131072 // BlobLength defines the byte length of a blob. BlobSize = 131072 // defined to match blob.size in bazel ssz codegen + BlobSidecarSize = 131928 // defined to match blob sidecar size in bazel ssz codegen KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. From 1a1cc25bd1f827cf0ebb272ffc82635a238e0d58 Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Sat, 21 Sep 2024 02:18:17 +0900 Subject: [PATCH 297/325] Deprecate `pb.gw.go` files (#14464) * Clean pb.gw.go files * Deprecate pb.gw.go file support --- .policy.yml | 2 -- hack/README.md | 4 ++-- hack/common.sh | 2 +- hack/update-go-pbs.sh | 2 +- proto/eth/v1/attestation.pb.gw.go | 4 ---- proto/eth/v1/beacon_block.pb.gw.go | 4 ---- proto/eth/v1/beacon_chain.pb.gw.go | 4 ---- proto/eth/v1/events.pb.gw.go | 4 ---- proto/eth/v1/node.pb.gw.go | 4 ---- proto/eth/v1/validator.pb.gw.go | 4 ---- proto/eth/v2/beacon_block.pb.gw.go | 4 ---- proto/eth/v2/beacon_chain.pb.gw.go | 4 ---- proto/eth/v2/beacon_lightclient.pb.gw.go | 4 ---- proto/eth/v2/custom.go | 3 ++- proto/eth/v2/ssz.pb.gw.go | 4 ---- proto/eth/v2/sync_committee.pb.gw.go | 4 ---- proto/eth/v2/validator.pb.gw.go | 4 ---- proto/eth/v2/version.pb.gw.go | 4 ---- proto/eth/v2/withdrawals.pb.gw.go | 4 ---- 19 files changed, 6 insertions(+), 63 deletions(-) delete mode 100755 proto/eth/v1/attestation.pb.gw.go delete mode 100755 proto/eth/v1/beacon_block.pb.gw.go delete mode 100755 proto/eth/v1/beacon_chain.pb.gw.go delete mode 100755 proto/eth/v1/events.pb.gw.go delete mode 100755 proto/eth/v1/node.pb.gw.go delete mode 100755 proto/eth/v1/validator.pb.gw.go delete mode 100755 proto/eth/v2/beacon_block.pb.gw.go delete mode 100755 proto/eth/v2/beacon_chain.pb.gw.go delete mode 100755 proto/eth/v2/beacon_lightclient.pb.gw.go delete mode 100755 proto/eth/v2/ssz.pb.gw.go delete mode 100755 proto/eth/v2/sync_committee.pb.gw.go delete mode 100755 proto/eth/v2/validator.pb.gw.go delete mode 100755 proto/eth/v2/version.pb.gw.go delete mode 100755 proto/eth/v2/withdrawals.pb.gw.go diff --git a/.policy.yml b/.policy.yml index 4f76e4865d5a..5fed6dc23393 100644 --- a/.policy.yml +++ b/.policy.yml @@ -26,7 +26,6 @@ approval_rules: only_changed_files: paths: - "*pb.go" - - "*pb.gw.go" - "*.bazel" options: ignore_commits_by: @@ -69,7 +68,6 @@ approval_rules: changed_files: ignore: - "*pb.go" - - "*pb.gw.go" - "*.bazel" options: ignore_commits_by: diff --git a/hack/README.md b/hack/README.md index 6720654d82f4..5cf3ec3b0350 100644 --- a/hack/README.md +++ b/hack/README.md @@ -5,6 +5,6 @@ This subproject contains useful bash scripts for working with our repository. We ## update-go-pbs.sh -This script generates the *.pb.go and *.pb.gw.go files from the *.proto files. -After running `update-go-pbs.sh` keep only the *.pb.go and *pb.gw.go for the protos that have changed before checking in. +This script generates the *.pb.go files from the *.proto files. +After running `update-go-pbs.sh` keep only the *.pb.go for the protos that have changed before checking in. *Note*: the generated files may not have imports correctly linted and will need to be fixed to remote associated errors. \ No newline at end of file diff --git a/hack/common.sh b/hack/common.sh index c4f1bf32c19d..06a70ed7a16d 100644 --- a/hack/common.sh +++ b/hack/common.sh @@ -19,7 +19,7 @@ cygwin*) system="windows" ;; esac readonly system -# Get locations of pb.go and pb.gw.go files. +# Get locations of pb.go files. findutil="find" # On OSX `find` is not GNU find compatible, so require "findutils" package. if [ "$system" == "darwin" ]; then diff --git a/hack/update-go-pbs.sh b/hack/update-go-pbs.sh index 47a009eb9b10..6ab61ba22539 100755 --- a/hack/update-go-pbs.sh +++ b/hack/update-go-pbs.sh @@ -9,7 +9,7 @@ bazel query 'attr(testonly, 0, //proto/...)' | xargs bazel build $@ file_list=() while IFS= read -d $'\0' -r file; do file_list=("${file_list[@]}" "$file") -done < <($findutil -L "$(bazel info bazel-bin)"/proto -type f -regextype sed -regex ".*pb\.\(gw\.\)\?go$" -print0) +done < <($findutil -L "$(bazel info bazel-bin)"/proto -type f -regextype sed -regex ".*pb\.go$" -print0) arraylength=${#file_list[@]} searchstring="prysmaticlabs/prysm/v5/" diff --git a/proto/eth/v1/attestation.pb.gw.go b/proto/eth/v1/attestation.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/attestation.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/beacon_block.pb.gw.go b/proto/eth/v1/beacon_block.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/beacon_block.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/beacon_chain.pb.gw.go b/proto/eth/v1/beacon_chain.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/beacon_chain.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/events.pb.gw.go b/proto/eth/v1/events.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/events.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/node.pb.gw.go b/proto/eth/v1/node.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/node.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/validator.pb.gw.go b/proto/eth/v1/validator.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/validator.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/beacon_block.pb.gw.go b/proto/eth/v2/beacon_block.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/beacon_block.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/beacon_chain.pb.gw.go b/proto/eth/v2/beacon_chain.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/beacon_chain.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/beacon_lightclient.pb.gw.go b/proto/eth/v2/beacon_lightclient.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/beacon_lightclient.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/custom.go b/proto/eth/v2/custom.go index f61e764614fa..678b71a39ff5 100644 --- a/proto/eth/v2/custom.go +++ b/proto/eth/v2/custom.go @@ -3,9 +3,10 @@ package eth import ( "bytes" "fmt" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "math/bits" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ) diff --git a/proto/eth/v2/ssz.pb.gw.go b/proto/eth/v2/ssz.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/ssz.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/sync_committee.pb.gw.go b/proto/eth/v2/sync_committee.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/sync_committee.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/validator.pb.gw.go b/proto/eth/v2/validator.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/validator.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/version.pb.gw.go b/proto/eth/v2/version.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/version.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/withdrawals.pb.gw.go b/proto/eth/v2/withdrawals.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/withdrawals.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore From 98d8b50b0ed22c75d506758fddbbdc62902a35d7 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:15:47 -0500 Subject: [PATCH 298/325] deflake pushsettings test - custom pattern matcher (#14453) * adding custom matcher * changelog * removing unneeded map * fixing merge conflict --- CHANGELOG.md | 5 ++-- validator/client/validator_test.go | 47 ++++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71b3efb074e..61dd534091e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,9 +58,10 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - validator registration log changed to debug, and the frequency of validator registration calls are reduced - Core: Fix process effective balance update to safe copy validator for Electra. - `== nil` checks before calling `IsNil()` on interfaces to prevent panics. -- Core: Fixed slash processing causing extra hashing -- Core: Fixed extra allocations when processing slashings +- Core: Fixed slash processing causing extra hashing. +- Core: Fixed extra allocations when processing slashings. - remove unneeded container in blob sidecar ssz response +- Testing: added custom matcher for better push settings testing. ### Security diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 679a2add8425..56abfd651b6b 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -1,6 +1,7 @@ package client import ( + "bytes" "context" "errors" "flag" @@ -1456,6 +1457,40 @@ func TestValidator_WaitForKeymanagerInitialization_Interop(t *testing.T) { } } +type PrepareBeaconProposerRequestMatcher struct { + expectedRecipients []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer +} + +func (m *PrepareBeaconProposerRequestMatcher) Matches(x interface{}) bool { + req, ok := x.(*ethpb.PrepareBeaconProposerRequest) + if !ok { + return false + } + + if len(req.Recipients) != len(m.expectedRecipients) { + return false + } + + // Build maps for efficient comparison + expectedMap := make(map[primitives.ValidatorIndex][]byte) + for _, recipient := range m.expectedRecipients { + expectedMap[recipient.ValidatorIndex] = recipient.FeeRecipient + } + + // Compare the maps + for _, fc := range req.Recipients { + expectedFeeRecipient, exists := expectedMap[fc.ValidatorIndex] + if !exists || !bytes.Equal(expectedFeeRecipient, fc.FeeRecipient) { + return false + } + } + return true +} + +func (m *PrepareBeaconProposerRequestMatcher) String() string { + return fmt.Sprintf("matches PrepareBeaconProposerRequest with Recipients: %v", m.expectedRecipients) +} + func TestValidator_PushSettings(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { ctrl := gomock.NewController(t) @@ -1525,8 +1560,8 @@ func TestValidator_PushSettings(t *testing.T) { PublicKeys: [][]byte{keys[0][:], keys[1][:]}, Indices: []primitives.ValidatorIndex{1, 2}, }, nil) - client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ - Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ + client.EXPECT().PrepareBeaconProposer(gomock.Any(), &PrepareBeaconProposerRequestMatcher{ + expectedRecipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ {FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9").Bytes(), ValidatorIndex: 1}, {FeeRecipient: common.HexToAddress(defaultFeeHex).Bytes(), ValidatorIndex: 2}, }, @@ -1616,8 +1651,8 @@ func TestValidator_PushSettings(t *testing.T) { PublicKeys: [][]byte{keys[0][:], keys[1][:]}, Indices: []primitives.ValidatorIndex{1, 2}, }, nil) - client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ - Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ + client.EXPECT().PrepareBeaconProposer(gomock.Any(), &PrepareBeaconProposerRequestMatcher{ + expectedRecipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ {FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9").Bytes(), ValidatorIndex: 1}, {FeeRecipient: common.HexToAddress(defaultFeeHex).Bytes(), ValidatorIndex: 2}, }, @@ -1702,8 +1737,8 @@ func TestValidator_PushSettings(t *testing.T) { PublicKeys: [][]byte{keys[0][:], keys[1][:]}, Indices: []primitives.ValidatorIndex{1, 2}, }, nil) - client.EXPECT().PrepareBeaconProposer(gomock.Any(), ðpb.PrepareBeaconProposerRequest{ - Recipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ + client.EXPECT().PrepareBeaconProposer(gomock.Any(), &PrepareBeaconProposerRequestMatcher{ + expectedRecipients: []*ethpb.PrepareBeaconProposerRequest_FeeRecipientContainer{ {FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9").Bytes(), ValidatorIndex: 1}, {FeeRecipient: common.HexToAddress(defaultFeeHex).Bytes(), ValidatorIndex: 2}, }, From 3662cf60095dc91f45e567f5fa40a121b18e4c5d Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Sat, 21 Sep 2024 06:20:13 +0900 Subject: [PATCH 299/325] Add Electra case for GetBeaconStateV2 (#14466) * Add Electra case for GetBeaconStateV2 * Add CHANGELOG.md entry --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- CHANGELOG.md | 9 ++++--- beacon-chain/rpc/eth/debug/handlers.go | 6 +++++ beacon-chain/rpc/eth/debug/handlers_test.go | 28 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61dd534091e5..cd6fde78f1dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: Add light client database changes. - Light client support: Implement capella and deneb changes. - Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb +- GetBeaconStateV2: add Electra case. ### Changed @@ -2674,7 +2675,7 @@ on your validators. **Beacon chain node** | Metric | Description | References | -|--------------------------------------------------|-------------------------------------------------------------------------------------------------------|------------| +| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | ---------- | | `p2p_message_ignored_validation_total` | Count of messages that were ignored in validation | | | `beacon_current_active_validators` | Current total active validators | | | `beacon_processed_deposits_total` | Total number of deposits processed | | @@ -2725,9 +2726,9 @@ on your validators. #### Changed Metrics **Beacon chain node** -| Metric | Old Name | Description | References | -|-----------------------|----------------------|------------------------------------------------------|------------| -| `beacon_reorgs_total` | `beacon_reorg_total` | Count the number of times a beacon chain has a reorg | | +| Metric | Old Name | Description | References | +| --------------------- | -------------------- | ---------------------------------------------------- | ---------- | +| `beacon_reorgs_total` | `beacon_reorg_total` | Count the number of times a beacon chain has a reorg | | ### Deprecated diff --git a/beacon-chain/rpc/eth/debug/handlers.go b/beacon-chain/rpc/eth/debug/handlers.go index f3c88752c023..8f8b6b8f9601 100644 --- a/beacon-chain/rpc/eth/debug/handlers.go +++ b/beacon-chain/rpc/eth/debug/handlers.go @@ -88,6 +88,12 @@ func (s *Server) getBeaconStateV2(ctx context.Context, w http.ResponseWriter, id httputil.HandleError(w, errMsgStateFromConsensus+": "+err.Error(), http.StatusInternalServerError) return } + case version.Electra: + respSt, err = structs.BeaconStateElectraFromConsensus(st) + if err != nil { + httputil.HandleError(w, errMsgStateFromConsensus+": "+err.Error(), http.StatusInternalServerError) + return + } default: httputil.HandleError(w, "Unsupported state version", http.StatusInternalServerError) return diff --git a/beacon-chain/rpc/eth/debug/handlers_test.go b/beacon-chain/rpc/eth/debug/handlers_test.go index 35f83e593ba2..007a1d9c9d61 100644 --- a/beacon-chain/rpc/eth/debug/handlers_test.go +++ b/beacon-chain/rpc/eth/debug/handlers_test.go @@ -167,6 +167,34 @@ func TestGetBeaconStateV2(t *testing.T) { require.NoError(t, json.Unmarshal(resp.Data, st)) assert.Equal(t, "123", st.Slot) }) + t.Run("Electra", func(t *testing.T) { + fakeState, err := util.NewBeaconStateElectra() + require.NoError(t, err) + require.NoError(t, fakeState.SetSlot(123)) + chainService := &blockchainmock.ChainService{} + s := &Server{ + Stater: &testutil.MockStater{ + BeaconState: fakeState, + }, + HeadFetcher: chainService, + OptimisticModeFetcher: chainService, + FinalizationFetcher: chainService, + } + + request := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v2/debug/beacon/states/{state_id}", nil) + request.SetPathValue("state_id", "head") + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetBeaconStateV2(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + resp := &structs.GetBeaconStateV2Response{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) + assert.Equal(t, version.String(version.Electra), resp.Version) + st := &structs.BeaconStateElectra{} + require.NoError(t, json.Unmarshal(resp.Data, st)) + assert.Equal(t, "123", st.Slot) + }) t.Run("execution optimistic", func(t *testing.T) { parentRoot := [32]byte{'a'} blk := util.NewBeaconBlock() From 315c05b35105e988e7ee54958c2d8e483e522eb4 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 23 Sep 2024 14:57:04 -0500 Subject: [PATCH 300/325] async/event: Use geth's implementation of event/feed.go (#14362) * Use geth's event * run gazelle --- async/event/BUILD.bazel | 12 +- async/event/example_feed_test.go | 73 ----- async/event/feed.go | 236 +------------- async/event/feed_test.go | 509 ------------------------------- 4 files changed, 8 insertions(+), 822 deletions(-) delete mode 100644 async/event/example_feed_test.go delete mode 100644 async/event/feed_test.go diff --git a/async/event/BUILD.bazel b/async/event/BUILD.bazel index 1ceb12f4ff73..6d32b727adf6 100644 --- a/async/event/BUILD.bazel +++ b/async/event/BUILD.bazel @@ -8,22 +8,20 @@ go_library( ], importpath = "github.com/prysmaticlabs/prysm/v5/async/event", visibility = ["//visibility:public"], - deps = ["//time/mclock:go_default_library"], + deps = [ + "//time/mclock:go_default_library", + "@com_github_ethereum_go_ethereum//event:go_default_library", + ], ) go_test( name = "go_default_test", size = "small", srcs = [ - "example_feed_test.go", "example_scope_test.go", "example_subscription_test.go", - "feed_test.go", "subscription_test.go", ], embed = [":go_default_library"], - deps = [ - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - ], + deps = ["//testing/require:go_default_library"], ) diff --git a/async/event/example_feed_test.go b/async/event/example_feed_test.go deleted file mode 100644 index ddc3730e2202..000000000000 --- a/async/event/example_feed_test.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package event_test - -import ( - "fmt" - - "github.com/prysmaticlabs/prysm/v5/async/event" -) - -func ExampleFeed_acknowledgedEvents() { - // This example shows how the return value of Send can be used for request/reply - // interaction between event consumers and producers. - var feed event.Feed - type ackedEvent struct { - i int - ack chan<- struct{} - } - - // Consumers wait for events on the feed and acknowledge processing. - done := make(chan struct{}) - defer close(done) - for i := 0; i < 3; i++ { - ch := make(chan ackedEvent, 100) - sub := feed.Subscribe(ch) - go func() { - defer sub.Unsubscribe() - for { - select { - case ev := <-ch: - fmt.Println(ev.i) // "process" the event - ev.ack <- struct{}{} - case <-done: - return - } - } - }() - } - - // The producer sends values of type ackedEvent with increasing values of i. - // It waits for all consumers to acknowledge before sending the next event. - for i := 0; i < 3; i++ { - acksignal := make(chan struct{}) - n := feed.Send(ackedEvent{i, acksignal}) - for ack := 0; ack < n; ack++ { - <-acksignal - } - } - // Output: - // 0 - // 0 - // 0 - // 1 - // 1 - // 1 - // 2 - // 2 - // 2 -} diff --git a/async/event/feed.go b/async/event/feed.go index 46d7f77753c8..1ebb581c14b0 100644 --- a/async/event/feed.go +++ b/async/event/feed.go @@ -14,241 +14,11 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . -// Package event contains an event feed implementation for process communication. package event import ( - "errors" - "reflect" - "slices" - "sync" + geth_event "github.com/ethereum/go-ethereum/event" ) -var errBadChannel = errors.New("event: Subscribe argument does not have sendable channel type") - -// Feed implements one-to-many subscriptions where the carrier of events is a channel. -// Values sent to a Feed are delivered to all subscribed channels simultaneously. -// -// Feeds can only be used with a single type. The type is determined by the first Send or -// Subscribe operation. Subsequent calls to these methods panic if the type does not -// match. -// -// The zero value is ready to use. -type Feed struct { - once sync.Once // ensures that init only runs once - sendLock chan struct{} // sendLock has a one-element buffer and is empty when held.It protects sendCases. - removeSub chan interface{} // interrupts Send - sendCases caseList // the active set of select cases used by Send - - // The inbox holds newly subscribed channels until they are added to sendCases. - mu sync.Mutex - inbox caseList - etype reflect.Type -} - -// This is the index of the first actual subscription channel in sendCases. -// sendCases[0] is a SelectRecv case for the removeSub channel. -const firstSubSendCase = 1 - -type feedTypeError struct { - got, want reflect.Type - op string -} - -func (e feedTypeError) Error() string { - return "event: wrong type in " + e.op + " got " + e.got.String() + ", want " + e.want.String() -} - -func (f *Feed) init() { - f.removeSub = make(chan interface{}) - f.sendLock = make(chan struct{}, 1) - f.sendLock <- struct{}{} - f.sendCases = caseList{{Chan: reflect.ValueOf(f.removeSub), Dir: reflect.SelectRecv}} -} - -// Subscribe adds a channel to the feed. Future sends will be delivered on the channel -// until the subscription is canceled. All channels added must have the same element type. -// -// The channel should have ample buffer space to avoid blocking other subscribers. -// Slow subscribers are not dropped. -func (f *Feed) Subscribe(channel interface{}) Subscription { - f.once.Do(f.init) - - chanval := reflect.ValueOf(channel) - chantyp := chanval.Type() - if chantyp.Kind() != reflect.Chan || chantyp.ChanDir()&reflect.SendDir == 0 { - panic(errBadChannel) - } - sub := &feedSub{feed: f, channel: chanval, err: make(chan error, 1)} - - f.mu.Lock() - defer f.mu.Unlock() - if !f.typecheck(chantyp.Elem()) { - panic(feedTypeError{op: "Subscribe", got: chantyp, want: reflect.ChanOf(reflect.SendDir, f.etype)}) - } - // Add the select case to the inbox. - // The next Send will add it to f.sendCases. - cas := reflect.SelectCase{Dir: reflect.SelectSend, Chan: chanval} - f.inbox = append(f.inbox, cas) - return sub -} - -// note: callers must hold f.mu -func (f *Feed) typecheck(typ reflect.Type) bool { - if f.etype == nil { - f.etype = typ - return true - } - // In the event the feed's type is an actual interface, we - // perform an interface conformance check here. - if f.etype.Kind() == reflect.Interface && typ.Implements(f.etype) { - return true - } - return f.etype == typ -} - -func (f *Feed) remove(sub *feedSub) { - // Delete from inbox first, which covers channels - // that have not been added to f.sendCases yet. - ch := sub.channel.Interface() - f.mu.Lock() - index := f.inbox.find(ch) - if index != -1 { - f.inbox = f.inbox.delete(index) - f.mu.Unlock() - return - } - f.mu.Unlock() - - select { - case f.removeSub <- ch: - // Send will remove the channel from f.sendCases. - case <-f.sendLock: - // No Send is in progress, delete the channel now that we have the send lock. - f.sendCases = f.sendCases.delete(f.sendCases.find(ch)) - f.sendLock <- struct{}{} - } -} - -// Send delivers to all subscribed channels simultaneously. -// It returns the number of subscribers that the value was sent to. -func (f *Feed) Send(value interface{}) (nsent int) { - rvalue := reflect.ValueOf(value) - - f.once.Do(f.init) - <-f.sendLock - - // Add new cases from the inbox after taking the send lock. - f.mu.Lock() - f.sendCases = append(f.sendCases, f.inbox...) - f.inbox = nil - - if !f.typecheck(rvalue.Type()) { - f.sendLock <- struct{}{} - f.mu.Unlock() - panic(feedTypeError{op: "Send", got: rvalue.Type(), want: f.etype}) - } - f.mu.Unlock() - - // Set the sent value on all channels. - for i := firstSubSendCase; i < len(f.sendCases); i++ { - f.sendCases[i].Send = rvalue - } - - // Send until all channels except removeSub have been chosen. 'cases' tracks a prefix - // of sendCases. When a send succeeds, the corresponding case moves to the end of - // 'cases' and it shrinks by one element. - cases := f.sendCases - for { - // Fast path: try sending without blocking before adding to the select set. - // This should usually succeed if subscribers are fast enough and have free - // buffer space. - for i := firstSubSendCase; i < len(cases); i++ { - if cases[i].Chan.TrySend(rvalue) { - nsent++ - cases = cases.deactivate(i) - i-- - } - } - if len(cases) == firstSubSendCase { - break - } - // Select on all the receivers, waiting for them to unblock. - chosen, recv, _ := reflect.Select(cases) - if chosen == 0 /* <-f.removeSub */ { - index := f.sendCases.find(recv.Interface()) - f.sendCases = f.sendCases.delete(index) - if index >= 0 && index < len(cases) { - // Shrink 'cases' too because the removed case was still active. - cases = f.sendCases[:len(cases)-1] - } - } else { - cases = cases.deactivate(chosen) - nsent++ - } - } - - // Forget about the sent value and hand off the send lock. - for i := firstSubSendCase; i < len(f.sendCases); i++ { - f.sendCases[i].Send = reflect.Value{} - } - f.sendLock <- struct{}{} - return nsent -} - -type feedSub struct { - feed *Feed - channel reflect.Value - errOnce sync.Once - err chan error -} - -// Unsubscribe remove feed subscription. -func (sub *feedSub) Unsubscribe() { - sub.errOnce.Do(func() { - sub.feed.remove(sub) - close(sub.err) - }) -} - -// Err returns error channel. -func (sub *feedSub) Err() <-chan error { - return sub.err -} - -type caseList []reflect.SelectCase - -// find returns the index of a case containing the given channel. -func (cs caseList) find(channel interface{}) int { - return slices.IndexFunc(cs, func(selectCase reflect.SelectCase) bool { - return selectCase.Chan.Interface() == channel - }) -} - -// delete removes the given case from cs. -func (cs caseList) delete(index int) caseList { - return append(cs[:index], cs[index+1:]...) -} - -// deactivate moves the case at index into the non-accessible portion of the cs slice. -func (cs caseList) deactivate(index int) caseList { - last := len(cs) - 1 - cs[index], cs[last] = cs[last], cs[index] - return cs[:last] -} - -// func (cs caseList) String() string { -// s := "[" -// for i, cas := range cs { -// if i != 0 { -// s += ", " -// } -// switch cas.Dir { -// case reflect.SelectSend: -// s += fmt.Sprintf("%v<-", cas.Chan.Interface()) -// case reflect.SelectRecv: -// s += fmt.Sprintf("<-%v", cas.Chan.Interface()) -// } -// } -// return s + "]" -// } +// Feed is a re-export of the go-ethereum event feed. +type Feed = geth_event.Feed diff --git a/async/event/feed_test.go b/async/event/feed_test.go deleted file mode 100644 index 5ad594046b17..000000000000 --- a/async/event/feed_test.go +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright 2016 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package event - -import ( - "fmt" - "reflect" - "sync" - "testing" - "time" - - "github.com/prysmaticlabs/prysm/v5/testing/assert" -) - -func TestFeedPanics(t *testing.T) { - { - var f Feed - f.Send(2) - want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(0)} - assert.NoError(t, checkPanic(want, func() { f.Send(uint64(2)) })) - // Validate it doesn't deadlock. - assert.NoError(t, checkPanic(want, func() { f.Send(uint64(2)) })) - } - { - var f Feed - ch := make(chan int) - f.Subscribe(ch) - want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(0)} - assert.NoError(t, checkPanic(want, func() { f.Send(uint64(2)) })) - } - { - var f Feed - f.Send(2) - want := feedTypeError{op: "Subscribe", got: reflect.TypeOf(make(chan uint64)), want: reflect.TypeOf(make(chan<- int))} - assert.NoError(t, checkPanic(want, func() { f.Subscribe(make(chan uint64)) })) - } - { - var f Feed - assert.NoError(t, checkPanic(errBadChannel, func() { f.Subscribe(make(<-chan int)) })) - } - { - var f Feed - assert.NoError(t, checkPanic(errBadChannel, func() { f.Subscribe(0) })) - } -} - -func checkPanic(want error, fn func()) (err error) { - defer func() { - panicResult := recover() - if panicResult == nil { - err = fmt.Errorf("didn't panic") - } else if !reflect.DeepEqual(panicResult, want) { - err = fmt.Errorf("panicked with wrong error: got %q, want %q", panicResult, want) - } - }() - fn() - return nil -} - -func TestFeed(t *testing.T) { - var feed Feed - var done, subscribed sync.WaitGroup - subscriber := func(i int) { - defer done.Done() - - subchan := make(chan int) - sub := feed.Subscribe(subchan) - timeout := time.NewTimer(2 * time.Second) - subscribed.Done() - - select { - case v := <-subchan: - if v != 1 { - t.Errorf("%d: received value %d, want 1", i, v) - } - case <-timeout.C: - t.Errorf("%d: receive timeout", i) - } - - sub.Unsubscribe() - select { - case _, ok := <-sub.Err(): - if ok { - t.Errorf("%d: error channel not closed after unsubscribe", i) - } - case <-timeout.C: - t.Errorf("%d: unsubscribe timeout", i) - } - } - - const n = 1000 - done.Add(n) - subscribed.Add(n) - for i := 0; i < n; i++ { - go subscriber(i) - } - subscribed.Wait() - if nsent := feed.Send(1); nsent != n { - t.Errorf("first send delivered %d times, want %d", nsent, n) - } - if nsent := feed.Send(2); nsent != 0 { - t.Errorf("second send delivered %d times, want 0", nsent) - } - done.Wait() -} - -func TestFeedSubscribeSameChannel(t *testing.T) { - var ( - feed Feed - done sync.WaitGroup - ch = make(chan int) - sub1 = feed.Subscribe(ch) - sub2 = feed.Subscribe(ch) - _ = feed.Subscribe(ch) - ) - expectSends := func(value, n int) { - if nsent := feed.Send(value); nsent != n { - t.Errorf("send delivered %d times, want %d", nsent, n) - } - done.Done() - } - expectRecv := func(wantValue, n int) { - for i := 0; i < n; i++ { - if v := <-ch; v != wantValue { - t.Errorf("received %d, want %d", v, wantValue) - } - } - } - - done.Add(1) - go expectSends(1, 3) - expectRecv(1, 3) - done.Wait() - - sub1.Unsubscribe() - - done.Add(1) - go expectSends(2, 2) - expectRecv(2, 2) - done.Wait() - - sub2.Unsubscribe() - - done.Add(1) - go expectSends(3, 1) - expectRecv(3, 1) - done.Wait() -} - -func TestFeedSubscribeBlockedPost(_ *testing.T) { - var ( - feed Feed - nsends = 2000 - ch1 = make(chan int) - ch2 = make(chan int) - wg sync.WaitGroup - ) - defer wg.Wait() - - feed.Subscribe(ch1) - wg.Add(nsends) - for i := 0; i < nsends; i++ { - go func() { - feed.Send(99) - wg.Done() - }() - } - - sub2 := feed.Subscribe(ch2) - defer sub2.Unsubscribe() - - // We're done when ch1 has received N times. - // The number of receives on ch2 depends on scheduling. - for i := 0; i < nsends; { - select { - case <-ch1: - i++ - case <-ch2: - } - } -} - -func TestFeedUnsubscribeBlockedPost(_ *testing.T) { - var ( - feed Feed - nsends = 200 - chans = make([]chan int, 2000) - subs = make([]Subscription, len(chans)) - bchan = make(chan int) - bsub = feed.Subscribe(bchan) - wg sync.WaitGroup - ) - for i := range chans { - chans[i] = make(chan int, nsends) - } - - // Queue up some Sends. None of these can make progress while bchan isn't read. - wg.Add(nsends) - for i := 0; i < nsends; i++ { - go func() { - feed.Send(99) - wg.Done() - }() - } - // Subscribe the other channels. - for i, ch := range chans { - subs[i] = feed.Subscribe(ch) - } - // Unsubscribe them again. - for _, sub := range subs { - sub.Unsubscribe() - } - // Unblock the Sends. - bsub.Unsubscribe() - wg.Wait() -} - -// Checks that unsubscribing a channel during Send works even if that -// channel has already been sent on. -func TestFeedUnsubscribeSentChan(_ *testing.T) { - var ( - feed Feed - ch1 = make(chan int) - ch2 = make(chan int) - sub1 = feed.Subscribe(ch1) - sub2 = feed.Subscribe(ch2) - wg sync.WaitGroup - ) - defer sub2.Unsubscribe() - - wg.Add(1) - go func() { - feed.Send(0) - wg.Done() - }() - - // Wait for the value on ch1. - <-ch1 - // Unsubscribe ch1, removing it from the send cases. - sub1.Unsubscribe() - - // Receive ch2, finishing Send. - <-ch2 - wg.Wait() - - // Send again. This should send to ch2 only, so the wait group will unblock - // as soon as a value is received on ch2. - wg.Add(1) - go func() { - feed.Send(0) - wg.Done() - }() - <-ch2 - wg.Wait() -} - -func TestFeedUnsubscribeFromInbox(t *testing.T) { - var ( - feed Feed - ch1 = make(chan int) - ch2 = make(chan int) - sub1 = feed.Subscribe(ch1) - sub2 = feed.Subscribe(ch1) - sub3 = feed.Subscribe(ch2) - ) - assert.Equal(t, 3, len(feed.inbox)) - assert.Equal(t, 1, len(feed.sendCases), "sendCases is non-empty after unsubscribe") - - sub1.Unsubscribe() - sub2.Unsubscribe() - sub3.Unsubscribe() - assert.Equal(t, 0, len(feed.inbox), "Inbox is non-empty after unsubscribe") - assert.Equal(t, 1, len(feed.sendCases), "sendCases is non-empty after unsubscribe") -} - -func BenchmarkFeedSend1000(b *testing.B) { - var ( - done sync.WaitGroup - feed Feed - nsubs = 1000 - ) - subscriber := func(ch <-chan int) { - for i := 0; i < b.N; i++ { - <-ch - } - done.Done() - } - done.Add(nsubs) - for i := 0; i < nsubs; i++ { - ch := make(chan int, 200) - feed.Subscribe(ch) - go subscriber(ch) - } - - // The actual benchmark. - b.ResetTimer() - for i := 0; i < b.N; i++ { - if feed.Send(i) != nsubs { - panic("wrong number of sends") - } - } - - b.StopTimer() - done.Wait() -} - -func TestFeed_Send(t *testing.T) { - tests := []struct { - name string - evFeed *Feed - testSetup func(fd *Feed, t *testing.T, o interface{}) - obj interface{} - expectPanic bool - }{ - { - name: "normal struct", - evFeed: new(Feed), - testSetup: func(fd *Feed, t *testing.T, o interface{}) { - testChan := make(chan testFeedWithPointer, 1) - fd.Subscribe(testChan) - }, - obj: testFeedWithPointer{ - a: new(uint64), - b: new(string), - }, - expectPanic: false, - }, - { - name: "un-implemented interface", - evFeed: new(Feed), - testSetup: func(fd *Feed, t *testing.T, o interface{}) { - testChan := make(chan testFeedIface, 1) - fd.Subscribe(testChan) - }, - obj: testFeedWithPointer{ - a: new(uint64), - b: new(string), - }, - expectPanic: true, - }, - { - name: "semi-implemented interface", - evFeed: new(Feed), - testSetup: func(fd *Feed, t *testing.T, o interface{}) { - testChan := make(chan testFeedIface, 1) - fd.Subscribe(testChan) - }, - obj: testFeed2{ - a: 0, - b: "", - c: []byte{'A'}, - }, - expectPanic: true, - }, - { - name: "fully-implemented interface", - evFeed: new(Feed), - testSetup: func(fd *Feed, t *testing.T, o interface{}) { - testChan := make(chan testFeedIface) - // Make it unbuffered to allow message to - // pass through - go func() { - a := <-testChan - if !reflect.DeepEqual(a, o) { - t.Errorf("Got = %v, want = %v", a, o) - } - }() - fd.Subscribe(testChan) - }, - obj: testFeed{ - a: 0, - b: "", - }, - expectPanic: false, - }, - { - name: "fully-implemented interface with additional methods", - evFeed: new(Feed), - testSetup: func(fd *Feed, t *testing.T, o interface{}) { - testChan := make(chan testFeedIface) - // Make it unbuffered to allow message to - // pass through - go func() { - a := <-testChan - if !reflect.DeepEqual(a, o) { - t.Errorf("Got = %v, want = %v", a, o) - } - }() - fd.Subscribe(testChan) - }, - obj: testFeed3{ - a: 0, - b: "", - c: []byte{'A'}, - d: []byte{'B'}, - }, - expectPanic: false, - }, - { - name: "concrete types implementing the same interface", - evFeed: new(Feed), - testSetup: func(fd *Feed, t *testing.T, o interface{}) { - testChan := make(chan testFeed, 1) - // Make it unbuffered to allow message to - // pass through - go func() { - a := <-testChan - if !reflect.DeepEqual(a, o) { - t.Errorf("Got = %v, want = %v", a, o) - } - }() - fd.Subscribe(testChan) - }, - obj: testFeed3{ - a: 0, - b: "", - c: []byte{'A'}, - d: []byte{'B'}, - }, - expectPanic: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - defer func() { - if r := recover(); r != nil { - if !tt.expectPanic { - t.Errorf("panic triggered when unexpected: %v", r) - } - } else { - if tt.expectPanic { - t.Error("panic not triggered when expected") - } - } - }() - tt.testSetup(tt.evFeed, t, tt.obj) - if gotNsent := tt.evFeed.Send(tt.obj); gotNsent != 1 { - t.Errorf("Send() = %v, want %v", gotNsent, 1) - } - }) - } -} - -// The following objects below are a collection of different -// struct types to test with. -type testFeed struct { - a uint64 - b string -} - -func (testFeed) method1() { - -} - -func (testFeed) method2() { - -} - -type testFeedWithPointer struct { - a *uint64 - b *string -} - -type testFeed2 struct { - a uint64 - b string - c []byte -} - -func (testFeed2) method1() { - -} - -type testFeed3 struct { - a uint64 - b string - c, d []byte -} - -func (testFeed3) method1() { - -} - -func (testFeed3) method2() { - -} - -func (testFeed3) method3() { - -} - -type testFeedIface interface { - method1() - method2() -} From 7e5738bfcda71ea280f6fd0d39d0207f612e848f Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Wed, 25 Sep 2024 00:15:19 +0800 Subject: [PATCH 301/325] Update Pubsub Library To Use Gossipsub 1.2 (#14428) * Update Libp2p Packages * Update CHANGELOG * Finally Fix All Tests * Fix Build * Fix Build * Fix TestP2P Connection Initialization * Fix TestP2P Host Options * Fix Test By Removing WaitGroup --- CHANGELOG.md | 1 + beacon-chain/p2p/BUILD.bazel | 2 - beacon-chain/p2p/dial_relay_node_test.go | 10 +- beacon-chain/p2p/testing/BUILD.bazel | 5 +- beacon-chain/p2p/testing/p2p.go | 19 +- .../sync/rpc_beacon_blocks_by_range_test.go | 12 +- deps.bzl | 180 ++++++++---------- go.mod | 64 ++++--- go.sum | 147 +++++++------- 9 files changed, 207 insertions(+), 233 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd6fde78f1dc..7d3fe9a5828d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Updated k8s-io/client-go to v0.30.4 and k8s-io/apimachinery to v0.30.4 - Migrated tracing library from opencensus to opentelemetry for both the beacon node and validator. - Refactored light client code to make it more readable and make future PRs easier. +- Updated Libp2p Dependencies to allow prysm to use gossipsub v1.2 . ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index 7d1798957d4a..7cb7e5227117 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -179,8 +179,6 @@ go_test( "@com_github_libp2p_go_libp2p//core/network:go_default_library", "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_libp2p_go_libp2p//core/protocol:go_default_library", - "@com_github_libp2p_go_libp2p//p2p/host/blank:go_default_library", - "@com_github_libp2p_go_libp2p//p2p/net/swarm/testing:go_default_library", "@com_github_libp2p_go_libp2p//p2p/security/noise:go_default_library", "@com_github_libp2p_go_libp2p_pubsub//:go_default_library", "@com_github_libp2p_go_libp2p_pubsub//pb:go_default_library", diff --git a/beacon-chain/p2p/dial_relay_node_test.go b/beacon-chain/p2p/dial_relay_node_test.go index 96cc4892cf37..2971fa87fd4c 100644 --- a/beacon-chain/p2p/dial_relay_node_test.go +++ b/beacon-chain/p2p/dial_relay_node_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - bh "github.com/libp2p/go-libp2p/p2p/host/blank" - swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" + "github.com/libp2p/go-libp2p" + "github.com/libp2p/go-libp2p/core/network" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -29,8 +29,10 @@ func TestDialRelayNode_InvalidPeerString(t *testing.T) { func TestDialRelayNode_OK(t *testing.T) { ctx := context.Background() - relay := bh.NewBlankHost(swarmt.GenSwarm(t)) - host := bh.NewBlankHost(swarmt.GenSwarm(t)) + relay, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{})) + require.NoError(t, err) + host, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{})) + require.NoError(t, err) relayAddr := fmt.Sprintf("%s/p2p/%s", relay.Addrs()[0], relay.ID().String()) assert.NoError(t, dialRelayNode(ctx, host, relayAddr), "Unexpected error when dialing relay node") diff --git a/beacon-chain/p2p/testing/BUILD.bazel b/beacon-chain/p2p/testing/BUILD.bazel index e6c2e8fe9030..18765496b864 100644 --- a/beacon-chain/p2p/testing/BUILD.bazel +++ b/beacon-chain/p2p/testing/BUILD.bazel @@ -22,9 +22,11 @@ go_library( "//beacon-chain/p2p/peers/scorers:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/metadata:go_default_library", + "//testing/require:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enode:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enr:go_default_library", + "@com_github_libp2p_go_libp2p//:go_default_library", "@com_github_libp2p_go_libp2p//core:go_default_library", "@com_github_libp2p_go_libp2p//core/connmgr:go_default_library", "@com_github_libp2p_go_libp2p//core/control:go_default_library", @@ -34,8 +36,7 @@ go_library( "@com_github_libp2p_go_libp2p//core/peer:go_default_library", "@com_github_libp2p_go_libp2p//core/peerstore:go_default_library", "@com_github_libp2p_go_libp2p//core/protocol:go_default_library", - "@com_github_libp2p_go_libp2p//p2p/host/blank:go_default_library", - "@com_github_libp2p_go_libp2p//p2p/net/swarm/testing:go_default_library", + "@com_github_libp2p_go_libp2p//p2p/transport/tcp:go_default_library", "@com_github_libp2p_go_libp2p_pubsub//:go_default_library", "@com_github_multiformats_go_multiaddr//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", diff --git a/beacon-chain/p2p/testing/p2p.go b/beacon-chain/p2p/testing/p2p.go index 19a6c2c9aac3..cf31efb8432d 100644 --- a/beacon-chain/p2p/testing/p2p.go +++ b/beacon-chain/p2p/testing/p2p.go @@ -11,6 +11,7 @@ import ( "time" "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/libp2p/go-libp2p" pubsub "github.com/libp2p/go-libp2p-pubsub" core "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/control" @@ -18,8 +19,7 @@ import ( "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" - bhost "github.com/libp2p/go-libp2p/p2p/host/blank" - swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" + "github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/multiformats/go-multiaddr" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" @@ -27,6 +27,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/scorers" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" + "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/sirupsen/logrus" "google.golang.org/protobuf/proto" ) @@ -52,7 +53,8 @@ type TestP2P struct { // NewTestP2P initializes a new p2p test service. func NewTestP2P(t *testing.T) *TestP2P { ctx := context.Background() - h := bhost.NewBlankHost(swarmt.GenSwarm(t, swarmt.OptDisableQUIC)) + h, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{}), libp2p.Transport(tcp.NewTCPTransport), libp2p.DefaultListenAddrs) + require.NoError(t, err) ps, err := pubsub.NewFloodSub(ctx, h, pubsub.WithMessageSigning(false), pubsub.WithStrictSignatureVerification(false), @@ -86,13 +88,17 @@ func (p *TestP2P) Connect(b *TestP2P) { } func connect(a, b host.Host) error { - pinfo := b.Peerstore().PeerInfo(b.ID()) + pinfo := peer.AddrInfo{ + ID: b.ID(), + Addrs: b.Addrs(), + } return a.Connect(context.Background(), pinfo) } // ReceiveRPC simulates an incoming RPC. func (p *TestP2P) ReceiveRPC(topic string, msg proto.Message) { - h := bhost.NewBlankHost(swarmt.GenSwarm(p.t)) + h, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{})) + require.NoError(p.t, err) if err := connect(h, p.BHost); err != nil { p.t.Fatalf("Failed to connect two peers for RPC: %v", err) } @@ -122,7 +128,8 @@ func (p *TestP2P) ReceiveRPC(topic string, msg proto.Message) { // ReceivePubSub simulates an incoming message over pubsub on a given topic. func (p *TestP2P) ReceivePubSub(topic string, msg proto.Message) { - h := bhost.NewBlankHost(swarmt.GenSwarm(p.t)) + h, err := libp2p.New(libp2p.ResourceManager(&network.NullResourceManager{})) + require.NoError(p.t, err) ps, err := pubsub.NewFloodSub(context.Background(), h, pubsub.WithMessageSigning(false), pubsub.WithStrictSignatureVerification(false), diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go b/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go index 55e838718ab0..832940cedaa5 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go @@ -433,11 +433,12 @@ func TestRPCBeaconBlocksByRange_RPCHandlerRateLimitOverflow(t *testing.T) { } sendRequest := func(p1, p2 *p2ptest.TestP2P, r *Service, req *ethpb.BeaconBlocksByRangeRequest, validateBlocks bool, success bool) error { - var wg sync.WaitGroup - wg.Add(1) pcl := protocol.ID(p2p.RPCBlocksByRangeTopicV1) + reqAnswered := false p2.BHost.SetStreamHandler(pcl, func(stream network.Stream) { - defer wg.Done() + defer func() { + reqAnswered = true + }() if !validateBlocks { return } @@ -458,9 +459,8 @@ func TestRPCBeaconBlocksByRange_RPCHandlerRateLimitOverflow(t *testing.T) { if err := r.beaconBlocksByRangeRPCHandler(context.Background(), req, stream); err != nil { return err } - if util.WaitTimeout(&wg, 1*time.Second) { - t.Fatal("Did not receive stream within 1 sec") - } + time.Sleep(100 * time.Millisecond) + assert.Equal(t, reqAnswered, true) return nil } diff --git a/deps.bzl b/deps.bzl index 47454080dd1e..95addcea0567 100644 --- a/deps.bzl +++ b/deps.bzl @@ -376,24 +376,6 @@ def prysm_deps(): sum = "h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=", version = "v2.3.0", ) - go_repository( - name = "com_github_chromedp_cdproto", - importpath = "github.com/chromedp/cdproto", - sum = "h1:aPflPkRFkVwbW6dmcVqfgwp1i+UWGFH6VgR1Jim5Ygc=", - version = "v0.0.0-20230802225258-3cf4e6d46a89", - ) - go_repository( - name = "com_github_chromedp_chromedp", - importpath = "github.com/chromedp/chromedp", - sum = "h1:dKtNz4kApb06KuSXoTQIyUC2TrA0fhGDwNZf3bcgfKw=", - version = "v0.9.2", - ) - go_repository( - name = "com_github_chromedp_sysutil", - importpath = "github.com/chromedp/sysutil", - sum = "h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=", - version = "v1.0.0", - ) go_repository( name = "com_github_chzyer_logex", importpath = "github.com/chzyer/logex", @@ -723,8 +705,8 @@ def prysm_deps(): go_repository( name = "com_github_elastic_gosigar", importpath = "github.com/elastic/gosigar", - sum = "h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=", - version = "v0.14.2", + sum = "h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=", + version = "v0.14.3", ) go_repository( name = "com_github_emicklei_dot", @@ -1086,30 +1068,18 @@ def prysm_deps(): sum = "h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=", version = "v0.0.0-20230315185526-52ccab3ef572", ) + go_repository( + name = "com_github_go_task_slim_sprig_v3", + importpath = "github.com/go-task/slim-sprig/v3", + sum = "h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=", + version = "v3.0.0", + ) go_repository( name = "com_github_go_yaml_yaml", importpath = "github.com/go-yaml/yaml", sum = "h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=", version = "v2.1.0+incompatible", ) - go_repository( - name = "com_github_gobwas_httphead", - importpath = "github.com/gobwas/httphead", - sum = "h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=", - version = "v0.1.0", - ) - go_repository( - name = "com_github_gobwas_pool", - importpath = "github.com/gobwas/pool", - sum = "h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=", - version = "v0.2.1", - ) - go_repository( - name = "com_github_gobwas_ws", - importpath = "github.com/gobwas/ws", - sum = "h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk=", - version = "v1.2.1", - ) go_repository( name = "com_github_goccy_go_json", importpath = "github.com/goccy/go-json", @@ -1259,8 +1229,8 @@ def prysm_deps(): go_repository( name = "com_github_google_pprof", importpath = "github.com/google/pprof", - sum = "h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo=", - version = "v0.0.0-20240207164012-fb44976bdcd5", + sum = "h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=", + version = "v0.0.0-20240727154555-813a5fbdbec8", ) go_repository( name = "com_github_google_renameio", @@ -1583,8 +1553,8 @@ def prysm_deps(): go_repository( name = "com_github_ianlancetaylor_demangle", importpath = "github.com/ianlancetaylor/demangle", - sum = "h1:BA4a7pe6ZTd9F8kXETBoijjFJ/ntaa//1wiH9BZu4zU=", - version = "v0.0.0-20230524184225-eabc099b10ab", + sum = "h1:KwWnWVWCNtNq/ewIX7HIKnELmEx2nDP42yskD/pi7QE=", + version = "v0.0.0-20240312041847-bd984b5ce465", ) go_repository( name = "com_github_imdario_mergo", @@ -1837,8 +1807,8 @@ def prysm_deps(): go_repository( name = "com_github_klauspost_compress", importpath = "github.com/klauspost/compress", - sum = "h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=", - version = "v1.17.8", + sum = "h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=", + version = "v1.17.9", ) go_repository( name = "com_github_klauspost_cpuid", @@ -1849,8 +1819,8 @@ def prysm_deps(): go_repository( name = "com_github_klauspost_cpuid_v2", importpath = "github.com/klauspost/cpuid/v2", - sum = "h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=", - version = "v2.2.7", + sum = "h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=", + version = "v2.2.8", ) go_repository( name = "com_github_klauspost_reedsolomon", @@ -1961,8 +1931,8 @@ def prysm_deps(): ], build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p", - sum = "h1:287oHbuplkrLdAF+syB0n/qDgd50AUBtEODqS0e0HDs=", - version = "v0.35.2", + sum = "h1:BbqRkDaGC3/5xfaJakLV/BrpjlAuYqSB0lRvtzL3B/U=", + version = "v0.36.2", ) go_repository( name = "com_github_libp2p_go_libp2p_asn_util", @@ -1980,8 +1950,8 @@ def prysm_deps(): name = "com_github_libp2p_go_libp2p_pubsub", build_file_proto_mode = "disable_global", importpath = "github.com/libp2p/go-libp2p-pubsub", - sum = "h1:+JvS8Kty0OiyUiN0i8H5JbaCgjnJTRnTHe4rU88dLFc=", - version = "v0.11.0", + sum = "h1:PENNZjSfk8KYxANRlpipdS7+BfLmOl3L2E/6vSNjbdI=", + version = "v0.12.0", ) go_repository( name = "com_github_libp2p_go_libp2p_testing", @@ -2166,8 +2136,8 @@ def prysm_deps(): go_repository( name = "com_github_miekg_dns", importpath = "github.com/miekg/dns", - sum = "h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=", - version = "v1.1.58", + sum = "h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ=", + version = "v1.1.62", ) go_repository( name = "com_github_mikioh_tcp", @@ -2310,8 +2280,8 @@ def prysm_deps(): go_repository( name = "com_github_multiformats_go_multiaddr", importpath = "github.com/multiformats/go-multiaddr", - sum = "h1:rrKqpY9h+n80EwhhC/kkcunCZZ7URIF8yN1WEUt2Hvc=", - version = "v0.12.4", + sum = "h1:BCBzs61E3AGHcYYTv8dqRH43ZfyrqM8RXVPT8t13tLQ=", + version = "v0.13.0", ) go_repository( name = "com_github_multiformats_go_multiaddr_dns", @@ -2469,14 +2439,14 @@ def prysm_deps(): go_repository( name = "com_github_onsi_ginkgo_v2", importpath = "github.com/onsi/ginkgo/v2", - sum = "h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=", - version = "v2.15.0", + sum = "h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw=", + version = "v2.20.0", ) go_repository( name = "com_github_onsi_gomega", importpath = "github.com/onsi/gomega", - sum = "h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=", - version = "v1.31.0", + sum = "h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=", + version = "v1.34.1", ) go_repository( name = "com_github_op_go_logging", @@ -2631,26 +2601,26 @@ def prysm_deps(): go_repository( name = "com_github_pion_datachannel", importpath = "github.com/pion/datachannel", - sum = "h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg=", - version = "v1.5.6", + sum = "h1:ph1P1NsGkazkjrvyMfhRBUAWMxugJjq2HfQifaOoSNo=", + version = "v1.5.8", ) go_repository( name = "com_github_pion_dtls_v2", importpath = "github.com/pion/dtls/v2", - sum = "h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks=", - version = "v2.2.11", + sum = "h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk=", + version = "v2.2.12", ) go_repository( name = "com_github_pion_ice_v2", importpath = "github.com/pion/ice/v2", - sum = "h1:M5rJA07dqhi3nobJIg+uPtcVjFECTrhcR3n0ns8kDZs=", - version = "v2.3.25", + sum = "h1:Ic1ppYCj4tUOcPAp76U6F3fVrlSw8A9JtRXLqw6BbUM=", + version = "v2.3.34", ) go_repository( name = "com_github_pion_interceptor", importpath = "github.com/pion/interceptor", - sum = "h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M=", - version = "v0.1.29", + sum = "h1:au5rlVHsgmxNi+v/mjOPazbW1SHzfx7/hYOEYQnUcxA=", + version = "v0.1.30", ) go_repository( name = "com_github_pion_logging", @@ -2679,14 +2649,14 @@ def prysm_deps(): go_repository( name = "com_github_pion_rtp", importpath = "github.com/pion/rtp", - sum = "h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw=", - version = "v1.8.6", + sum = "h1:E2HX740TZKaqdcPmf4pw6ZZuG8u5RlMMt+l3dxeu6Wk=", + version = "v1.8.9", ) go_repository( name = "com_github_pion_sctp", importpath = "github.com/pion/sctp", - sum = "h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY=", - version = "v1.8.16", + sum = "h1:dSE4wX6uTJBcNm8+YlMg7lw1wqyKHggsP5uKbdj+NZw=", + version = "v1.8.33", ) go_repository( name = "com_github_pion_sdp_v3", @@ -2697,8 +2667,8 @@ def prysm_deps(): go_repository( name = "com_github_pion_srtp_v2", importpath = "github.com/pion/srtp/v2", - sum = "h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo=", - version = "v2.0.18", + sum = "h1:HNNny4s+OUmG280ETrCdgFndp4ufx3/uy85EawYEhTk=", + version = "v2.0.20", ) go_repository( name = "com_github_pion_stun", @@ -2709,14 +2679,14 @@ def prysm_deps(): go_repository( name = "com_github_pion_transport_v2", importpath = "github.com/pion/transport/v2", - sum = "h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc=", - version = "v2.2.5", + sum = "h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q=", + version = "v2.2.10", ) go_repository( name = "com_github_pion_transport_v3", importpath = "github.com/pion/transport/v3", - sum = "h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4=", - version = "v3.0.2", + sum = "h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0=", + version = "v3.0.7", ) go_repository( name = "com_github_pion_turn_v2", @@ -2727,8 +2697,8 @@ def prysm_deps(): go_repository( name = "com_github_pion_webrtc_v3", importpath = "github.com/pion/webrtc/v3", - sum = "h1:Wtfi6AZMQg+624cvCXUuSmrKWepSB7zfgYDOYqsSOVU=", - version = "v3.2.40", + sum = "h1:Rf4u6n6U5t5sUxhYPQk/samzU/oDv7jk6BA5hyO2F9I=", + version = "v3.3.0", ) go_repository( name = "com_github_pkg_diff", @@ -2775,8 +2745,8 @@ def prysm_deps(): go_repository( name = "com_github_prometheus_client_golang", importpath = "github.com/prometheus/client_golang", - sum = "h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=", - version = "v1.19.1", + sum = "h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI=", + version = "v1.20.0", ) go_repository( name = "com_github_prometheus_client_model", @@ -2787,14 +2757,14 @@ def prysm_deps(): go_repository( name = "com_github_prometheus_common", importpath = "github.com/prometheus/common", - sum = "h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=", - version = "v0.48.0", + sum = "h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=", + version = "v0.55.0", ) go_repository( name = "com_github_prometheus_procfs", importpath = "github.com/prometheus/procfs", - sum = "h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=", - version = "v0.12.0", + sum = "h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=", + version = "v0.15.1", ) go_repository( name = "com_github_prometheus_prom2json", @@ -2854,8 +2824,8 @@ def prysm_deps(): "gazelle:exclude tools.go", ], importpath = "github.com/quic-go/quic-go", - sum = "h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0=", - version = "v0.44.0", + sum = "h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7Y=", + version = "v0.46.0", ) go_repository( name = "com_github_quic_go_webtransport_go", @@ -3452,6 +3422,12 @@ def prysm_deps(): sum = "h1:264/meVYWt1wFw6Mtn+xwkZkXjID42gNra4rycoiDXI=", version = "v2.8.2", ) + go_repository( + name = "com_github_wlynxg_anet", + importpath = "github.com/wlynxg/anet", + sum = "h1:0de1OFQxnNqAu+x2FAKKCVIrnfGKQbs7FQz++tB0+Uw=", + version = "v0.0.4", + ) go_repository( name = "com_github_x448_float16", importpath = "github.com/x448/float16", @@ -4259,8 +4235,8 @@ def prysm_deps(): go_repository( name = "com_lukechampine_blake3", importpath = "lukechampine.com/blake3", - sum = "h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=", - version = "v1.2.1", + sum = "h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE=", + version = "v1.3.0", ) go_repository( name = "com_shuralyov_dmitri_app_changes", @@ -4654,8 +4630,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_exp", importpath = "golang.org/x/exp", - sum = "h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=", - version = "v0.0.0-20240506185415-9bf2ced13842", + sum = "h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI=", + version = "v0.0.0-20240808152545-0cdaa3abc0fa", ) go_repository( name = "org_golang_x_exp_typeparams", @@ -4684,8 +4660,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_mod", importpath = "golang.org/x/mod", - sum = "h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=", - version = "v0.17.0", + sum = "h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=", + version = "v0.20.0", ) go_repository( name = "org_golang_x_net", @@ -4696,8 +4672,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_oauth2", importpath = "golang.org/x/oauth2", - sum = "h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=", - version = "v0.20.0", + sum = "h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=", + version = "v0.21.0", ) go_repository( name = "org_golang_x_perf", @@ -4720,8 +4696,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_telemetry", importpath = "golang.org/x/telemetry", - sum = "h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY=", - version = "v0.0.0-20240228155512-f48c80bd79b2", + sum = "h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk=", + version = "v0.0.0-20240521205824-bda55230c457", ) go_repository( name = "org_golang_x_term", @@ -4744,8 +4720,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", - sum = "h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=", - version = "v0.21.1-0.20240508182429-e35e4ccd0d2d", + sum = "h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=", + version = "v0.24.0", ) go_repository( name = "org_golang_x_xerrors", @@ -4773,14 +4749,14 @@ def prysm_deps(): go_repository( name = "org_uber_go_dig", importpath = "go.uber.org/dig", - sum = "h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc=", - version = "v1.17.1", + sum = "h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw=", + version = "v1.18.0", ) go_repository( name = "org_uber_go_fx", importpath = "go.uber.org/fx", - sum = "h1:nvvln7mwyT5s1q201YE29V/BFrGor6vMiDNpU/78Mys=", - version = "v1.22.1", + sum = "h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw=", + version = "v1.22.2", ) go_repository( name = "org_uber_go_goleak", diff --git a/go.mod b/go.mod index f2a01cad02cc..c433d998461d 100644 --- a/go.mod +++ b/go.mod @@ -42,9 +42,9 @@ require ( github.com/json-iterator/go v1.1.12 github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 github.com/kr/pretty v0.3.1 - github.com/libp2p/go-libp2p v0.35.2 + github.com/libp2p/go-libp2p v0.36.2 github.com/libp2p/go-libp2p-mplex v0.9.0 - github.com/libp2p/go-libp2p-pubsub v0.11.0 + github.com/libp2p/go-libp2p-pubsub v0.12.0 github.com/libp2p/go-mplex v0.7.0 github.com/logrusorgru/aurora v2.0.3+incompatible github.com/manifoldco/promptui v0.7.0 @@ -52,14 +52,14 @@ require ( github.com/minio/highwayhash v1.0.2 github.com/minio/sha256-simd v1.0.1 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/multiformats/go-multiaddr v0.12.4 + github.com/multiformats/go-multiaddr v0.13.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.31.0 + github.com/onsi/gomega v1.34.1 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/paulbellamy/ratecounter v0.2.0 github.com/pborman/uuid v1.2.1 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/client_golang v1.20.0 github.com/prometheus/client_model v0.6.1 github.com/prometheus/prom2json v1.3.0 github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 @@ -90,10 +90,10 @@ require ( go.uber.org/automaxprocs v1.5.2 go.uber.org/mock v0.4.0 golang.org/x/crypto v0.26.0 - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 - golang.org/x/mod v0.17.0 + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa + golang.org/x/mod v0.20.0 golang.org/x/sync v0.8.0 - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d + golang.org/x/tools v0.24.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.34.2 @@ -134,7 +134,7 @@ require ( github.com/dlclark/regexp2 v1.7.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect - github.com/elastic/gosigar v0.14.2 // indirect + github.com/elastic/gosigar v0.14.3 // indirect github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/ferranbt/fastssz v0.0.0-20210120143747-11b9eff30ea9 // indirect github.com/flynn/noise v1.1.0 // indirect @@ -145,12 +145,12 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-stack/stack v1.8.1 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/gopacket v1.1.19 // indirect - github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect + github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/graph-gophers/graphql-go v1.3.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect @@ -167,8 +167,8 @@ require ( github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c // indirect - github.com/klauspost/compress v1.17.8 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/koron/go-ssdp v0.0.4 // indirect github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.3 // indirect @@ -186,7 +186,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/miekg/dns v1.1.58 // indirect + github.com/miekg/dns v1.1.62 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect @@ -205,33 +205,34 @@ require ( github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-varint v0.0.7 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.11 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo/v2 v2.15.0 // indirect + github.com/onsi/ginkgo/v2 v2.20.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect - github.com/pion/datachannel v1.5.6 // indirect - github.com/pion/dtls/v2 v2.2.11 // indirect - github.com/pion/ice/v2 v2.3.25 // indirect - github.com/pion/interceptor v0.1.29 // indirect + github.com/pion/datachannel v1.5.8 // indirect + github.com/pion/dtls/v2 v2.2.12 // indirect + github.com/pion/ice/v2 v2.3.34 // indirect + github.com/pion/interceptor v0.1.30 // indirect github.com/pion/logging v0.2.2 // indirect github.com/pion/mdns v0.0.12 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/rtcp v1.2.14 // indirect - github.com/pion/rtp v1.8.6 // indirect - github.com/pion/sctp v1.8.16 // indirect + github.com/pion/rtp v1.8.9 // indirect + github.com/pion/sctp v1.8.33 // indirect github.com/pion/sdp/v3 v3.0.9 // indirect - github.com/pion/srtp/v2 v2.0.18 // indirect + github.com/pion/srtp/v2 v2.0.20 // indirect github.com/pion/stun v0.6.1 // indirect - github.com/pion/transport/v2 v2.2.5 // indirect + github.com/pion/transport/v2 v2.2.10 // indirect github.com/pion/turn/v2 v2.1.6 // indirect - github.com/pion/webrtc/v3 v3.2.40 // indirect + github.com/pion/webrtc/v3 v3.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.44.0 // indirect + github.com/quic-go/quic-go v0.46.0 // indirect github.com/quic-go/webtransport-go v0.8.0 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect @@ -244,23 +245,24 @@ require ( github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect github.com/wealdtech/go-eth2-types/v2 v2.5.2 // indirect + github.com/wlynxg/anet v0.0.4 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.uber.org/dig v1.17.1 // indirect - go.uber.org/fx v1.22.1 // indirect + go.uber.org/dig v1.18.0 // indirect + go.uber.org/fx v1.22.2 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/term v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - lukechampine.com/blake3 v1.2.1 // indirect + lukechampine.com/blake3 v1.3.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index 90af6e2e4b5a..bf21aa4e0814 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= -github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo= +github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/emicklei/dot v0.11.0 h1:Ase39UD9T9fRBOb5ptgpixrxfx8abVzNWZi2+lr53PI= github.com/emicklei/dot v0.11.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= @@ -312,8 +312,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -413,8 +413,8 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= -github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -546,11 +546,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= -github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -582,14 +582,14 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= -github.com/libp2p/go-libp2p v0.35.2 h1:287oHbuplkrLdAF+syB0n/qDgd50AUBtEODqS0e0HDs= -github.com/libp2p/go-libp2p v0.35.2/go.mod h1:RKCDNt30IkFipGL0tl8wQW/3zVWEGFUZo8g2gAKxwjU= +github.com/libp2p/go-libp2p v0.36.2 h1:BbqRkDaGC3/5xfaJakLV/BrpjlAuYqSB0lRvtzL3B/U= +github.com/libp2p/go-libp2p v0.36.2/go.mod h1:XO3joasRE4Eup8yCTTP/+kX+g92mOgRaadk46LmPhHY= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8= github.com/libp2p/go-libp2p-mplex v0.9.0/go.mod h1:ro1i4kuwiFT+uMPbIDIFkcLs1KRbNp0QwnUXM+P64Og= -github.com/libp2p/go-libp2p-pubsub v0.11.0 h1:+JvS8Kty0OiyUiN0i8H5JbaCgjnJTRnTHe4rU88dLFc= -github.com/libp2p/go-libp2p-pubsub v0.11.0/go.mod h1:QEb+hEV9WL9wCiUAnpY29FZR6W3zK8qYlaml8R4q6gQ= +github.com/libp2p/go-libp2p-pubsub v0.12.0 h1:PENNZjSfk8KYxANRlpipdS7+BfLmOl3L2E/6vSNjbdI= +github.com/libp2p/go-libp2p-pubsub v0.12.0/go.mod h1:Oi0zw9aw8/Y5GC99zt+Ef2gYAl+0nZlwdJonDyOz/sE= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= @@ -654,8 +654,8 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyex github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= -github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= +github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= +github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= @@ -705,8 +705,8 @@ github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9 github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.12.4 h1:rrKqpY9h+n80EwhhC/kkcunCZZ7URIF8yN1WEUt2Hvc= -github.com/multiformats/go-multiaddr v0.12.4/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII= +github.com/multiformats/go-multiaddr v0.13.0 h1:BCBzs61E3AGHcYYTv8dqRH43ZfyrqM8RXVPT8t13tLQ= +github.com/multiformats/go-multiaddr v0.13.0/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= @@ -752,14 +752,14 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= +github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= -github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= @@ -802,15 +802,15 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pion/datachannel v1.5.6 h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg= -github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNIVb/NfGW4= +github.com/pion/datachannel v1.5.8 h1:ph1P1NsGkazkjrvyMfhRBUAWMxugJjq2HfQifaOoSNo= +github.com/pion/datachannel v1.5.8/go.mod h1:PgmdpoaNBLX9HNzNClmdki4DYW5JtI7Yibu8QzbL3tI= github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= -github.com/pion/dtls/v2 v2.2.11 h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks= -github.com/pion/dtls/v2 v2.2.11/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= -github.com/pion/ice/v2 v2.3.25 h1:M5rJA07dqhi3nobJIg+uPtcVjFECTrhcR3n0ns8kDZs= -github.com/pion/ice/v2 v2.3.25/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= -github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M= -github.com/pion/interceptor v0.1.29/go.mod h1:ri+LGNjRUc5xUNtDEPzfdkmSqISixVTBF/z/Zms/6T4= +github.com/pion/dtls/v2 v2.2.12 h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk= +github.com/pion/dtls/v2 v2.2.12/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= +github.com/pion/ice/v2 v2.3.34 h1:Ic1ppYCj4tUOcPAp76U6F3fVrlSw8A9JtRXLqw6BbUM= +github.com/pion/ice/v2 v2.3.34/go.mod h1:mBF7lnigdqgtB+YHkaY/Y6s6tsyRyo4u4rPGRuOjUBQ= +github.com/pion/interceptor v0.1.30 h1:au5rlVHsgmxNi+v/mjOPazbW1SHzfx7/hYOEYQnUcxA= +github.com/pion/interceptor v0.1.30/go.mod h1:RQuKT5HTdkP2Fi0cuOS5G5WNymTjzXaGF75J4k7z2nc= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= github.com/pion/mdns v0.0.12 h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8= @@ -821,31 +821,29 @@ github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9 github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE= github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/rtp v1.8.6 h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw= -github.com/pion/rtp v1.8.6/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/sctp v1.8.13/go.mod h1:YKSgO/bO/6aOMP9LCie1DuD7m+GamiK2yIiPM6vH+GA= -github.com/pion/sctp v1.8.16 h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY= -github.com/pion/sctp v1.8.16/go.mod h1:P6PbDVA++OJMrVNg2AL3XtYHV4uD6dvfyOovCgMs0PE= +github.com/pion/rtp v1.8.9 h1:E2HX740TZKaqdcPmf4pw6ZZuG8u5RlMMt+l3dxeu6Wk= +github.com/pion/rtp v1.8.9/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= +github.com/pion/sctp v1.8.33 h1:dSE4wX6uTJBcNm8+YlMg7lw1wqyKHggsP5uKbdj+NZw= +github.com/pion/sctp v1.8.33/go.mod h1:beTnqSzewI53KWoG3nqB282oDMGrhNxBdb+JZnkCwRM= github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY= github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M= -github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo= -github.com/pion/srtp/v2 v2.0.18/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA= +github.com/pion/srtp/v2 v2.0.20 h1:HNNny4s+OUmG280ETrCdgFndp4ufx3/uy85EawYEhTk= +github.com/pion/srtp/v2 v2.0.20/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA= github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= -github.com/pion/transport/v2 v2.2.2/go.mod h1:OJg3ojoBJopjEeECq2yJdXH9YVrUJ1uQ++NjXLOUorc= github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= -github.com/pion/transport/v2 v2.2.5 h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc= -github.com/pion/transport/v2 v2.2.5/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= +github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= +github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= -github.com/pion/transport/v3 v3.0.2 h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4= -github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37m0IlWa/D0= +github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= +github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= -github.com/pion/webrtc/v3 v3.2.40 h1:Wtfi6AZMQg+624cvCXUuSmrKWepSB7zfgYDOYqsSOVU= -github.com/pion/webrtc/v3 v3.2.40/go.mod h1:M1RAe3TNTD1tzyvqHrbVODfwdPGSXOUo/OgpoGGJqFY= +github.com/pion/webrtc/v3 v3.3.0 h1:Rf4u6n6U5t5sUxhYPQk/samzU/oDv7jk6BA5hyO2F9I= +github.com/pion/webrtc/v3 v3.3.0/go.mod h1:hVmrDJvwhEertRWObeb1xzulzHGeVUoPlWvxdGzcfU0= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -868,8 +866,8 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= +github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -885,8 +883,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -895,8 +893,8 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk= @@ -912,8 +910,8 @@ github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.44.0 h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0= -github.com/quic-go/quic-go v0.44.0/go.mod h1:z4cx/9Ny9UtGITIPzmPTXh1ULfOyWh4qGQlpnPcWmek= +github.com/quic-go/quic-go v0.46.0 h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7Y= +github.com/quic-go/quic-go v0.46.0/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI= github.com/quic-go/webtransport-go v0.8.0 h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg= github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YVSlwHohQsuac9WaM= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= @@ -1008,7 +1006,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -1061,6 +1058,9 @@ github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3 h1:SxrDVSr+oXuT1 github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3/go.mod h1:qiIimacW5NhVRy8o+YxWo9YrecXqDAKKbL0+sOa0SJ4= github.com/wealdtech/go-eth2-wallet-types/v2 v2.8.2 h1:264/meVYWt1wFw6Mtn+xwkZkXjID42gNra4rycoiDXI= github.com/wealdtech/go-eth2-wallet-types/v2 v2.8.2/go.mod h1:k6kmiKWSWBTd4OxFifTEkPaBLhZspnO2KFD5XJY9nqg= +github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= +github.com/wlynxg/anet v0.0.4 h1:0de1OFQxnNqAu+x2FAKKCVIrnfGKQbs7FQz++tB0+Uw= +github.com/wlynxg/anet v0.0.4/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -1108,10 +1108,10 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= -go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= -go.uber.org/fx v1.22.1 h1:nvvln7mwyT5s1q201YE29V/BFrGor6vMiDNpU/78Mys= -go.uber.org/fx v1.22.1/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= +go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= +go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= +go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= +go.uber.org/fx v1.22.2/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= @@ -1152,11 +1152,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1170,8 +1167,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -1201,8 +1198,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1256,11 +1253,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1275,8 +1269,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1381,12 +1375,9 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1395,11 +1386,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1414,7 +1402,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= @@ -1492,8 +1479,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1681,8 +1668,8 @@ k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7F k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= -lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= +lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From ddafedc2680ef5287cb4071c53880901501fcfca Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 25 Sep 2024 14:06:52 -0300 Subject: [PATCH 302/325] Implement consensus-specs/3875 (#14458) * WIP - beacon-chain builds * pass blockchain tests * pass beacon-chain/execution tests * Passing RPC tests * fix building * add changelog * fix linters * Spectests * copy requests on Copy() * Fix tests * Fix config test * fix verification tests * add aliases for Electra types * double import and unskip spectests * Remove unnecessary comment --- CHANGELOG.md | 1 + WORKSPACE | 10 +- api/server/structs/block.go | 54 +- api/server/structs/conversions_block.go | 212 +- api/server/structs/conversions_state.go | 2 +- beacon-chain/core/blocks/genesis.go | 5 + .../core/electra/transition_no_verify_sig.go | 14 +- beacon-chain/core/electra/upgrade.go | 38 +- beacon-chain/core/electra/upgrade_test.go | 34 +- beacon-chain/db/kv/state_test.go | 25 +- beacon-chain/execution/engine_client.go | 76 +- beacon-chain/execution/engine_client_test.go | 226 -- beacon-chain/execution/payload_body_test.go | 9 +- beacon-chain/rpc/eth/events/events_test.go | 2 +- beacon-chain/rpc/eth/shared/testing/json.go | 85 +- .../prysm/v1alpha1/validator/proposer_test.go | 74 +- .../state/state-native/beacon_state.go | 3 - .../state-native/getters_payload_header.go | 4 +- .../state/state-native/getters_state.go | 4 +- beacon-chain/state/state-native/hasher.go | 11 +- .../state-native/setters_payload_header.go | 26 +- .../setters_payload_header_test.go | 9 +- beacon-chain/state/state-native/state_trie.go | 79 +- .../state/state-native/types/types.go | 5 +- beacon-chain/sync/decode_pubsub_test.go | 2 +- config/params/loader_test.go | 1 + consensus-types/blocks/execution.go | 432 +-- consensus-types/blocks/factory.go | 112 +- consensus-types/blocks/getters.go | 77 +- consensus-types/blocks/getters_test.go | 36 +- consensus-types/blocks/kzg.go | 15 +- consensus-types/blocks/proofs.go | 14 +- consensus-types/blocks/proto.go | 12 + consensus-types/blocks/types.go | 2 + consensus-types/interfaces/beacon_block.go | 8 +- consensus-types/mock/BUILD.bazel | 1 + consensus-types/mock/block.go | 5 + proto/engine/v1/BUILD.bazel | 5 +- proto/engine/v1/electra.go | 4 + proto/engine/v1/electra.pb.go | 464 ++++ proto/engine/v1/electra.proto | 66 + proto/engine/v1/engine.ssz.go | 2273 +++++---------- proto/engine/v1/execution_engine.go | 59 - proto/engine/v1/execution_engine.pb.go | 1585 +++-------- proto/engine/v1/execution_engine.proto | 88 - proto/engine/v1/execution_engine_fuzz_test.go | 2 - proto/engine/v1/json_marshal_unmarshal.go | 244 -- .../engine/v1/json_marshal_unmarshal_test.go | 155 -- proto/eth/v1/gateway.ssz.go | 2 +- proto/eth/v2/grpc.ssz.go | 2 +- proto/eth/v2/version.pb.go | 24 +- proto/eth/v2/version.proto | 1 + proto/prysm/v1alpha1/altair.ssz.go | 2 +- proto/prysm/v1alpha1/beacon_block.go | 32 +- proto/prysm/v1alpha1/beacon_block.pb.go | 2435 +++++++++-------- proto/prysm/v1alpha1/beacon_block.proto | 9 +- proto/prysm/v1alpha1/beacon_state.pb.go | 239 +- proto/prysm/v1alpha1/beacon_state.proto | 2 +- proto/prysm/v1alpha1/bellatrix.ssz.go | 2 +- proto/prysm/v1alpha1/capella.ssz.go | 2 +- proto/prysm/v1alpha1/cloners_test.go | 62 +- proto/prysm/v1alpha1/deneb.ssz.go | 2 +- proto/prysm/v1alpha1/electra.ssz.go | 122 +- proto/prysm/v1alpha1/non-core.ssz.go | 2 +- proto/prysm/v1alpha1/phase0.ssz.go | 2 +- .../epoch_processing/slashings_test.go | 1 + .../epoch_processing/slashings_test.go | 1 + .../common/operations/consolidations.go | 8 +- .../common/operations/deposit_request.go | 8 +- .../common/operations/withdrawal_request.go | 6 +- .../electra/operations/consolidations.go | 5 +- .../electra/operations/deposit_request.go | 5 +- .../electra/operations/withdrawal_request.go | 9 +- .../shared/electra/ssz_static/ssz_static.go | 2 + testing/util/block.go | 70 +- testing/util/electra.go | 71 +- testing/util/electra_block.go | 37 +- testing/util/electra_state.go | 53 +- testing/util/state.go | 25 +- 79 files changed, 3766 insertions(+), 6147 deletions(-) create mode 100644 proto/engine/v1/electra.go create mode 100755 proto/engine/v1/electra.pb.go create mode 100644 proto/engine/v1/electra.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3fe9a5828d..9edf1f5ef977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: Implement capella and deneb changes. - Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb - GetBeaconStateV2: add Electra case. +- Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875) ### Changed diff --git a/WORKSPACE b/WORKSPACE index 03fef7769878..641d6ed81b18 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-alpha.5" +consensus_spec_version = "v1.5.0-alpha.6" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-R9vG5HEL5eGMOAmbkKfJ2jfelNqL5V0xBUPiXOiGM6U=", + integrity = "sha256-M7u/Ot/Vzorww+dFbHp0cxLyM2mezJjijCzq+LY3uvs=", 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-AEIiEOlf1XuxoRMCsN+kgJMo4LrS05+biTA1p/7Ro00=", + integrity = "sha256-deOSeLRsmHXvkRp8n2bs3HXdkGUJWWqu8KFM/QABbZg=", 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-LH/Xr20yrJRYnbpjRGupMWTIOWt3cpxZJWXgThwVDsk=", + integrity = "sha256-Zz7YCf6XVf57nzSEGq9ToflJFHM0lAGwhd18l9Rf3hA=", 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-mlytz4MPjKh0DwV7FMiAtnRbJw9B6o78/x66/vmnYc8=", + integrity = "sha256-BoXckDxXnDcEmAjg/dQgf/tLiJsb6CT0aZvmWHFijrY=", 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/api/server/structs/block.go b/api/server/structs/block.go index 43b3cc879758..c53ce6a663ae 100644 --- a/api/server/structs/block.go +++ b/api/server/structs/block.go @@ -365,6 +365,7 @@ type BeaconBlockBodyElectra struct { ExecutionPayload *ExecutionPayloadElectra `json:"execution_payload"` BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"` BlobKzgCommitments []string `json:"blob_kzg_commitments"` + ExecutionRequests *ExecutionRequests `json:"execution_requests"` } type BlindedBeaconBlockElectra struct { @@ -403,6 +404,7 @@ type BlindedBeaconBlockBodyElectra struct { ExecutionPayloadHeader *ExecutionPayloadHeaderElectra `json:"execution_payload_header"` BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"` BlobKzgCommitments []string `json:"blob_kzg_commitments"` + ExecutionRequests *ExecutionRequests `json:"execution_requests"` } type SignedBeaconBlockHeaderContainer struct { @@ -514,6 +516,8 @@ type ExecutionPayloadDeneb struct { ExcessBlobGas string `json:"excess_blob_gas"` } +type ExecutionPayloadElectra = ExecutionPayloadDeneb + type ExecutionPayloadHeaderDeneb struct { ParentHash string `json:"parent_hash"` FeeRecipient string `json:"fee_recipient"` @@ -534,48 +538,10 @@ type ExecutionPayloadHeaderDeneb struct { ExcessBlobGas string `json:"excess_blob_gas"` } -type ExecutionPayloadElectra struct { - ParentHash string `json:"parent_hash"` - FeeRecipient string `json:"fee_recipient"` - StateRoot string `json:"state_root"` - ReceiptsRoot string `json:"receipts_root"` - LogsBloom string `json:"logs_bloom"` - PrevRandao string `json:"prev_randao"` - BlockNumber string `json:"block_number"` - GasLimit string `json:"gas_limit"` - GasUsed string `json:"gas_used"` - Timestamp string `json:"timestamp"` - ExtraData string `json:"extra_data"` - BaseFeePerGas string `json:"base_fee_per_gas"` - BlockHash string `json:"block_hash"` - Transactions []string `json:"transactions"` - Withdrawals []*Withdrawal `json:"withdrawals"` - BlobGasUsed string `json:"blob_gas_used"` - ExcessBlobGas string `json:"excess_blob_gas"` - DepositRequests []*DepositRequest `json:"deposit_requests"` - WithdrawalRequests []*WithdrawalRequest `json:"withdrawal_requests"` - ConsolidationRequests []*ConsolidationRequest `json:"consolidation_requests"` -} - -type ExecutionPayloadHeaderElectra struct { - ParentHash string `json:"parent_hash"` - FeeRecipient string `json:"fee_recipient"` - StateRoot string `json:"state_root"` - ReceiptsRoot string `json:"receipts_root"` - LogsBloom string `json:"logs_bloom"` - PrevRandao string `json:"prev_randao"` - BlockNumber string `json:"block_number"` - GasLimit string `json:"gas_limit"` - GasUsed string `json:"gas_used"` - Timestamp string `json:"timestamp"` - ExtraData string `json:"extra_data"` - BaseFeePerGas string `json:"base_fee_per_gas"` - BlockHash string `json:"block_hash"` - TransactionsRoot string `json:"transactions_root"` - WithdrawalsRoot string `json:"withdrawals_root"` - BlobGasUsed string `json:"blob_gas_used"` - ExcessBlobGas string `json:"excess_blob_gas"` - DepositRequestsRoot string `json:"deposit_requests_root"` - WithdrawalRequestsRoot string `json:"withdrawal_requests_root"` - ConsolidationRequestsRoot string `json:"consolidation_requests_root"` +type ExecutionPayloadHeaderElectra = ExecutionPayloadHeaderDeneb + +type ExecutionRequests struct { + Deposits []*DepositRequest `json:"deposits"` + Withdrawals []*WithdrawalRequest `json:"withdrawals"` + Consolidations []*ConsolidationRequest `json:"consolidations"` } diff --git a/api/server/structs/conversions_block.go b/api/server/structs/conversions_block.go index df9c03710039..05bb0f2e0bcc 100644 --- a/api/server/structs/conversions_block.go +++ b/api/server/structs/conversions_block.go @@ -2088,27 +2088,31 @@ func (b *BeaconBlockElectra) ToConsensus() (*eth.BeaconBlockElectra, error) { return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas") } - depositRequests := make([]*enginev1.DepositRequest, len(b.Body.ExecutionPayload.DepositRequests)) - for i, d := range b.Body.ExecutionPayload.DepositRequests { + if b.Body.ExecutionRequests == nil { + return nil, server.NewDecodeError(errors.New("nil execution requests"), "Body.ExequtionRequests") + } + + depositRequests := make([]*enginev1.DepositRequest, len(b.Body.ExecutionRequests.Deposits)) + for i, d := range b.Body.ExecutionRequests.Deposits { depositRequests[i], err = d.ToConsensus() if err != nil { - return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.DepositRequests[%d]", i)) + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionRequests.Deposits[%d]", i)) } } - withdrawalRequests := make([]*enginev1.WithdrawalRequest, len(b.Body.ExecutionPayload.WithdrawalRequests)) - for i, w := range b.Body.ExecutionPayload.WithdrawalRequests { + withdrawalRequests := make([]*enginev1.WithdrawalRequest, len(b.Body.ExecutionRequests.Withdrawals)) + for i, w := range b.Body.ExecutionRequests.Withdrawals { withdrawalRequests[i], err = w.ToConsensus() if err != nil { - return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.WithdrawalRequests[%d]", i)) + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionRequests.Withdrawals[%d]", i)) } } - consolidationRequests := make([]*enginev1.ConsolidationRequest, len(b.Body.ExecutionPayload.ConsolidationRequests)) - for i, c := range b.Body.ExecutionPayload.ConsolidationRequests { + consolidationRequests := make([]*enginev1.ConsolidationRequest, len(b.Body.ExecutionRequests.Consolidations)) + for i, c := range b.Body.ExecutionRequests.Consolidations { consolidationRequests[i], err = c.ToConsensus() if err != nil { - return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionPayload.ConsolidationRequests[%d]", i)) + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionRequests.Consolidations[%d]", i)) } } @@ -2151,29 +2155,31 @@ func (b *BeaconBlockElectra) ToConsensus() (*eth.BeaconBlockElectra, error) { SyncCommitteeSignature: syncCommitteeSig, }, ExecutionPayload: &enginev1.ExecutionPayloadElectra{ - ParentHash: payloadParentHash, - FeeRecipient: payloadFeeRecipient, - StateRoot: payloadStateRoot, - ReceiptsRoot: payloadReceiptsRoot, - LogsBloom: payloadLogsBloom, - PrevRandao: payloadPrevRandao, - BlockNumber: payloadBlockNumber, - GasLimit: payloadGasLimit, - GasUsed: payloadGasUsed, - Timestamp: payloadTimestamp, - ExtraData: payloadExtraData, - BaseFeePerGas: payloadBaseFeePerGas, - BlockHash: payloadBlockHash, - Transactions: txs, - Withdrawals: withdrawals, - BlobGasUsed: payloadBlobGasUsed, - ExcessBlobGas: payloadExcessBlobGas, - DepositRequests: depositRequests, - WithdrawalRequests: withdrawalRequests, - ConsolidationRequests: consolidationRequests, + ParentHash: payloadParentHash, + FeeRecipient: payloadFeeRecipient, + StateRoot: payloadStateRoot, + ReceiptsRoot: payloadReceiptsRoot, + LogsBloom: payloadLogsBloom, + PrevRandao: payloadPrevRandao, + BlockNumber: payloadBlockNumber, + GasLimit: payloadGasLimit, + GasUsed: payloadGasUsed, + Timestamp: payloadTimestamp, + ExtraData: payloadExtraData, + BaseFeePerGas: payloadBaseFeePerGas, + BlockHash: payloadBlockHash, + Transactions: txs, + Withdrawals: withdrawals, + BlobGasUsed: payloadBlobGasUsed, + ExcessBlobGas: payloadExcessBlobGas, }, BlsToExecutionChanges: blsChanges, BlobKzgCommitments: blobKzgCommitments, + ExecutionRequests: &enginev1.ExecutionRequests{ + Deposits: depositRequests, + Withdrawals: withdrawalRequests, + Consolidations: consolidationRequests, + }, }, }, nil } @@ -2383,17 +2389,31 @@ func (b *BlindedBeaconBlockElectra) ToConsensus() (*eth.BlindedBeaconBlockElectr if err != nil { return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas") } - payloadDepositRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.DepositRequestsRoot, fieldparams.RootLength) - if err != nil { - return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.DepositRequestsRoot") + if b.Body.ExecutionRequests == nil { + return nil, server.NewDecodeError(errors.New("nil execution requests"), "Body.ExecutionRequests") } - payloadWithdrawalRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.WithdrawalRequestsRoot, fieldparams.RootLength) - if err != nil { - return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.WithdrawalRequestsRoot") + depositRequests := make([]*enginev1.DepositRequest, len(b.Body.ExecutionRequests.Deposits)) + for i, d := range b.Body.ExecutionRequests.Deposits { + depositRequests[i], err = d.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionRequests.Deposits[%d]", i)) + } } - payloadConsolidationRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.ConsolidationRequestsRoot, fieldparams.RootLength) - if err != nil { - return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.ConsolidationRequestsRoot") + + withdrawalRequests := make([]*enginev1.WithdrawalRequest, len(b.Body.ExecutionRequests.Withdrawals)) + for i, w := range b.Body.ExecutionRequests.Withdrawals { + withdrawalRequests[i], err = w.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionRequests.Withdrawals[%d]", i)) + } + } + + consolidationRequests := make([]*enginev1.ConsolidationRequest, len(b.Body.ExecutionRequests.Consolidations)) + for i, c := range b.Body.ExecutionRequests.Consolidations { + consolidationRequests[i], err = c.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, fmt.Sprintf("Body.ExecutionRequests.Consolidations[%d]", i)) + } } blsChanges, err := SignedBLSChangesToConsensus(b.Body.BLSToExecutionChanges) @@ -2436,29 +2456,31 @@ func (b *BlindedBeaconBlockElectra) ToConsensus() (*eth.BlindedBeaconBlockElectr SyncCommitteeSignature: syncCommitteeSig, }, ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: payloadParentHash, - FeeRecipient: payloadFeeRecipient, - StateRoot: payloadStateRoot, - ReceiptsRoot: payloadReceiptsRoot, - LogsBloom: payloadLogsBloom, - PrevRandao: payloadPrevRandao, - BlockNumber: payloadBlockNumber, - GasLimit: payloadGasLimit, - GasUsed: payloadGasUsed, - Timestamp: payloadTimestamp, - ExtraData: payloadExtraData, - BaseFeePerGas: payloadBaseFeePerGas, - BlockHash: payloadBlockHash, - TransactionsRoot: payloadTxsRoot, - WithdrawalsRoot: payloadWithdrawalsRoot, - BlobGasUsed: payloadBlobGasUsed, - ExcessBlobGas: payloadExcessBlobGas, - DepositRequestsRoot: payloadDepositRequestsRoot, - WithdrawalRequestsRoot: payloadWithdrawalRequestsRoot, - ConsolidationRequestsRoot: payloadConsolidationRequestsRoot, + ParentHash: payloadParentHash, + FeeRecipient: payloadFeeRecipient, + StateRoot: payloadStateRoot, + ReceiptsRoot: payloadReceiptsRoot, + LogsBloom: payloadLogsBloom, + PrevRandao: payloadPrevRandao, + BlockNumber: payloadBlockNumber, + GasLimit: payloadGasLimit, + GasUsed: payloadGasUsed, + Timestamp: payloadTimestamp, + ExtraData: payloadExtraData, + BaseFeePerGas: payloadBaseFeePerGas, + BlockHash: payloadBlockHash, + TransactionsRoot: payloadTxsRoot, + WithdrawalsRoot: payloadWithdrawalsRoot, + BlobGasUsed: payloadBlobGasUsed, + ExcessBlobGas: payloadExcessBlobGas, }, BlsToExecutionChanges: blsChanges, BlobKzgCommitments: blobKzgCommitments, + ExecutionRequests: &enginev1.ExecutionRequests{ + Deposits: depositRequests, + Withdrawals: withdrawalRequests, + Consolidations: consolidationRequests, + }, }, }, nil } @@ -2963,10 +2985,19 @@ func BlindedBeaconBlockElectraFromConsensus(b *eth.BlindedBeaconBlockElectra) (* ExecutionPayloadHeader: payload, BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), BlobKzgCommitments: blobKzgCommitments, + ExecutionRequests: ExecutionRequestsFromConsensus(b.Body.ExecutionRequests), }, }, nil } +func ExecutionRequestsFromConsensus(er *enginev1.ExecutionRequests) *ExecutionRequests { + return &ExecutionRequests{ + Deposits: DepositRequestsFromConsensus(er.Deposits), + Withdrawals: WithdrawalRequestsFromConsensus(er.Withdrawals), + Consolidations: ConsolidationRequestsFromConsensus(er.Consolidations), + } +} + func SignedBlindedBeaconBlockElectraFromConsensus(b *eth.SignedBlindedBeaconBlockElectra) (*SignedBlindedBeaconBlockElectra, error) { block, err := BlindedBeaconBlockElectraFromConsensus(b.Message) if err != nil { @@ -3009,6 +3040,7 @@ func BeaconBlockElectraFromConsensus(b *eth.BeaconBlockElectra) (*BeaconBlockEle ExecutionPayload: payload, BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), BlobKzgCommitments: blobKzgCommitments, + ExecutionRequests: ExecutionRequestsFromConsensus(b.Body.ExecutionRequests), }, }, nil } @@ -3112,39 +3144,7 @@ func ExecutionPayloadDenebFromConsensus(payload *enginev1.ExecutionPayloadDeneb) }, nil } -func ExecutionPayloadElectraFromConsensus(payload *enginev1.ExecutionPayloadElectra) (*ExecutionPayloadElectra, error) { - baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) - if err != nil { - return nil, err - } - transactions := make([]string, len(payload.Transactions)) - for i, tx := range payload.Transactions { - transactions[i] = hexutil.Encode(tx) - } - - return &ExecutionPayloadElectra{ - ParentHash: hexutil.Encode(payload.ParentHash), - FeeRecipient: hexutil.Encode(payload.FeeRecipient), - StateRoot: hexutil.Encode(payload.StateRoot), - ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), - LogsBloom: hexutil.Encode(payload.LogsBloom), - PrevRandao: hexutil.Encode(payload.PrevRandao), - BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), - GasLimit: fmt.Sprintf("%d", payload.GasLimit), - GasUsed: fmt.Sprintf("%d", payload.GasUsed), - Timestamp: fmt.Sprintf("%d", payload.Timestamp), - ExtraData: hexutil.Encode(payload.ExtraData), - BaseFeePerGas: baseFeePerGas, - BlockHash: hexutil.Encode(payload.BlockHash), - Transactions: transactions, - Withdrawals: WithdrawalsFromConsensus(payload.Withdrawals), - BlobGasUsed: fmt.Sprintf("%d", payload.BlobGasUsed), - ExcessBlobGas: fmt.Sprintf("%d", payload.ExcessBlobGas), - DepositRequests: DepositRequestsFromConsensus(payload.DepositRequests), - WithdrawalRequests: WithdrawalRequestsFromConsensus(payload.WithdrawalRequests), - ConsolidationRequests: ConsolidationRequestsFromConsensus(payload.ConsolidationRequests), - }, nil -} +var ExecutionPayloadElectraFromConsensus = ExecutionPayloadDenebFromConsensus func ExecutionPayloadHeaderFromConsensus(payload *enginev1.ExecutionPayloadHeader) (*ExecutionPayloadHeader, error) { baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) @@ -3222,32 +3222,4 @@ func ExecutionPayloadHeaderDenebFromConsensus(payload *enginev1.ExecutionPayload }, nil } -func ExecutionPayloadHeaderElectraFromConsensus(payload *enginev1.ExecutionPayloadHeaderElectra) (*ExecutionPayloadHeaderElectra, error) { - baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) - if err != nil { - return nil, err - } - - return &ExecutionPayloadHeaderElectra{ - ParentHash: hexutil.Encode(payload.ParentHash), - FeeRecipient: hexutil.Encode(payload.FeeRecipient), - StateRoot: hexutil.Encode(payload.StateRoot), - ReceiptsRoot: hexutil.Encode(payload.ReceiptsRoot), - LogsBloom: hexutil.Encode(payload.LogsBloom), - PrevRandao: hexutil.Encode(payload.PrevRandao), - BlockNumber: fmt.Sprintf("%d", payload.BlockNumber), - GasLimit: fmt.Sprintf("%d", payload.GasLimit), - GasUsed: fmt.Sprintf("%d", payload.GasUsed), - Timestamp: fmt.Sprintf("%d", payload.Timestamp), - ExtraData: hexutil.Encode(payload.ExtraData), - BaseFeePerGas: baseFeePerGas, - BlockHash: hexutil.Encode(payload.BlockHash), - TransactionsRoot: hexutil.Encode(payload.TransactionsRoot), - WithdrawalsRoot: hexutil.Encode(payload.WithdrawalsRoot), - BlobGasUsed: fmt.Sprintf("%d", payload.BlobGasUsed), - ExcessBlobGas: fmt.Sprintf("%d", payload.ExcessBlobGas), - DepositRequestsRoot: hexutil.Encode(payload.DepositRequestsRoot), - WithdrawalRequestsRoot: hexutil.Encode(payload.WithdrawalRequestsRoot), - ConsolidationRequestsRoot: hexutil.Encode(payload.ConsolidationRequestsRoot), - }, nil -} +var ExecutionPayloadHeaderElectraFromConsensus = ExecutionPayloadHeaderDenebFromConsensus diff --git a/api/server/structs/conversions_state.go b/api/server/structs/conversions_state.go index 885ff861e3e4..5c982c1d606b 100644 --- a/api/server/structs/conversions_state.go +++ b/api/server/structs/conversions_state.go @@ -674,7 +674,7 @@ func BeaconStateElectraFromConsensus(st beaconState.BeaconState) (*BeaconStateEl if err != nil { return nil, err } - srcPayload, ok := execData.Proto().(*enginev1.ExecutionPayloadHeaderElectra) + srcPayload, ok := execData.Proto().(*enginev1.ExecutionPayloadHeaderDeneb) if !ok { return nil, errPayloadHeaderNotFound } diff --git a/beacon-chain/core/blocks/genesis.go b/beacon-chain/core/blocks/genesis.go index 1099085cc2e9..d3d687faa534 100644 --- a/beacon-chain/core/blocks/genesis.go +++ b/beacon-chain/core/blocks/genesis.go @@ -213,6 +213,11 @@ func NewGenesisBlockForState(ctx context.Context, st state.BeaconState) (interfa }, BlsToExecutionChanges: make([]*ethpb.SignedBLSToExecutionChange, 0), BlobKzgCommitments: make([][]byte, 0), + ExecutionRequests: &enginev1.ExecutionRequests{ + Withdrawals: make([]*enginev1.WithdrawalRequest, 0), + Deposits: make([]*enginev1.DepositRequest, 0), + Consolidations: make([]*enginev1.ConsolidationRequest, 0), + }, }, }, Signature: params.BeaconConfig().EmptySignature[:], diff --git a/beacon-chain/core/electra/transition_no_verify_sig.go b/beacon-chain/core/electra/transition_no_verify_sig.go index 4f417f18ade0..c7b478b09857 100644 --- a/beacon-chain/core/electra/transition_no_verify_sig.go +++ b/beacon-chain/core/electra/transition_no_verify_sig.go @@ -78,23 +78,19 @@ func ProcessOperations( return nil, errors.Wrap(err, "could not process bls-to-execution changes") } // new in electra - e, err := bb.Execution() + requests, err := bb.ExecutionRequests() if err != nil { - return nil, errors.Wrap(err, "could not get execution data from block") + return nil, errors.Wrap(err, "could not get execution requests") } - exe, ok := e.(interfaces.ExecutionDataElectra) - if !ok { - return nil, errors.New("could not cast execution data to electra execution data") - } - st, err = ProcessDepositRequests(ctx, st, exe.DepositRequests()) + st, err = ProcessDepositRequests(ctx, st, requests.Deposits) if err != nil { return nil, errors.Wrap(err, "could not process deposit receipts") } - st, err = ProcessWithdrawalRequests(ctx, st, exe.WithdrawalRequests()) + st, err = ProcessWithdrawalRequests(ctx, st, requests.Withdrawals) if err != nil { return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") } - if err := ProcessConsolidationRequests(ctx, st, exe.ConsolidationRequests()); err != nil { + if err := ProcessConsolidationRequests(ctx, st, requests.Consolidations); err != nil { return nil, fmt.Errorf("could not process consolidation requests: %w", err) } return st, nil diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index e547df446c07..214a0fa5ac9a 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -10,7 +10,6 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -245,26 +244,23 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) CurrentSyncCommittee: currentSyncCommittee, NextSyncCommittee: nextSyncCommittee, LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: payloadHeader.ParentHash(), - FeeRecipient: payloadHeader.FeeRecipient(), - StateRoot: payloadHeader.StateRoot(), - ReceiptsRoot: payloadHeader.ReceiptsRoot(), - LogsBloom: payloadHeader.LogsBloom(), - PrevRandao: payloadHeader.PrevRandao(), - BlockNumber: payloadHeader.BlockNumber(), - GasLimit: payloadHeader.GasLimit(), - GasUsed: payloadHeader.GasUsed(), - Timestamp: payloadHeader.Timestamp(), - ExtraData: payloadHeader.ExtraData(), - BaseFeePerGas: payloadHeader.BaseFeePerGas(), - BlockHash: payloadHeader.BlockHash(), - TransactionsRoot: txRoot, - WithdrawalsRoot: wdRoot, - ExcessBlobGas: excessBlobGas, - BlobGasUsed: blobGasUsed, - DepositRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP6110] - WithdrawalRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7002] - ConsolidationRequestsRoot: bytesutil.Bytes32(0), // [New in Electra:EIP7251] + ParentHash: payloadHeader.ParentHash(), + FeeRecipient: payloadHeader.FeeRecipient(), + StateRoot: payloadHeader.StateRoot(), + ReceiptsRoot: payloadHeader.ReceiptsRoot(), + LogsBloom: payloadHeader.LogsBloom(), + PrevRandao: payloadHeader.PrevRandao(), + BlockNumber: payloadHeader.BlockNumber(), + GasLimit: payloadHeader.GasLimit(), + GasUsed: payloadHeader.GasUsed(), + Timestamp: payloadHeader.Timestamp(), + ExtraData: payloadHeader.ExtraData(), + BaseFeePerGas: payloadHeader.BaseFeePerGas(), + BlockHash: payloadHeader.BlockHash(), + TransactionsRoot: txRoot, + WithdrawalsRoot: wdRoot, + ExcessBlobGas: excessBlobGas, + BlobGasUsed: blobGasUsed, }, NextWithdrawalIndex: wi, NextWithdrawalValidatorIndex: vi, diff --git a/beacon-chain/core/electra/upgrade_test.go b/beacon-chain/core/electra/upgrade_test.go index 9e6e20c8dff0..2fa8d1ba43f9 100644 --- a/beacon-chain/core/electra/upgrade_test.go +++ b/beacon-chain/core/electra/upgrade_test.go @@ -8,7 +8,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -113,24 +112,21 @@ func TestUpgradeToElectra(t *testing.T) { wdRoot, err := prevHeader.WithdrawalsRoot() require.NoError(t, err) wanted := &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: prevHeader.ParentHash(), - FeeRecipient: prevHeader.FeeRecipient(), - StateRoot: prevHeader.StateRoot(), - ReceiptsRoot: prevHeader.ReceiptsRoot(), - LogsBloom: prevHeader.LogsBloom(), - PrevRandao: prevHeader.PrevRandao(), - BlockNumber: prevHeader.BlockNumber(), - GasLimit: prevHeader.GasLimit(), - GasUsed: prevHeader.GasUsed(), - Timestamp: prevHeader.Timestamp(), - ExtraData: prevHeader.ExtraData(), - BaseFeePerGas: prevHeader.BaseFeePerGas(), - BlockHash: prevHeader.BlockHash(), - TransactionsRoot: txRoot, - WithdrawalsRoot: wdRoot, - DepositRequestsRoot: bytesutil.Bytes32(0), - WithdrawalRequestsRoot: bytesutil.Bytes32(0), - ConsolidationRequestsRoot: bytesutil.Bytes32(0), + ParentHash: prevHeader.ParentHash(), + FeeRecipient: prevHeader.FeeRecipient(), + StateRoot: prevHeader.StateRoot(), + ReceiptsRoot: prevHeader.ReceiptsRoot(), + LogsBloom: prevHeader.LogsBloom(), + PrevRandao: prevHeader.PrevRandao(), + BlockNumber: prevHeader.BlockNumber(), + GasLimit: prevHeader.GasLimit(), + GasUsed: prevHeader.GasUsed(), + Timestamp: prevHeader.Timestamp(), + ExtraData: prevHeader.ExtraData(), + BaseFeePerGas: prevHeader.BaseFeePerGas(), + BlockHash: prevHeader.BlockHash(), + TransactionsRoot: txRoot, + WithdrawalsRoot: wdRoot, } require.DeepEqual(t, wanted, protoHeader) diff --git a/beacon-chain/db/kv/state_test.go b/beacon-chain/db/kv/state_test.go index f6f63593f8be..0083dc8b8858 100644 --- a/beacon-chain/db/kv/state_test.go +++ b/beacon-chain/db/kv/state_test.go @@ -138,20 +138,17 @@ func TestState_CanSaveRetrieve(t *testing.T) { require.NoError(t, err) require.NoError(t, st.SetSlot(100)) p, err := blocks.WrappedExecutionPayloadHeaderElectra(&enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: []byte("foo"), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - DepositRequestsRoot: make([]byte, 32), - WithdrawalRequestsRoot: make([]byte, 32), - ConsolidationRequestsRoot: make([]byte, 32), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: []byte("foo"), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), }) require.NoError(t, err) require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index ae069440f96d..07075ffa7d37 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -167,15 +167,6 @@ func (s *Service) NewPayload(ctx context.Context, payload interfaces.ExecutionDa if err != nil { return nil, handleRPCError(err) } - case *pb.ExecutionPayloadElectra: - payloadPb, ok := payload.Proto().(*pb.ExecutionPayloadElectra) - if !ok { - return nil, errors.New("execution data must be a Electra execution payload") - } - err := s.rpcClient.CallContext(ctx, result, NewPayloadMethodV4, payloadPb, versionedHashes, parentBlockRoot) - if err != nil { - return nil, handleRPCError(err) - } default: return nil, errors.New("unknown execution data type") } @@ -268,9 +259,6 @@ func (s *Service) ForkchoiceUpdated( func getPayloadMethodAndMessage(slot primitives.Slot) (string, proto.Message) { pe := slots.ToEpoch(slot) - if pe >= params.BeaconConfig().ElectraForkEpoch { - return GetPayloadMethodV4, &pb.ExecutionPayloadElectraWithValueAndBlobsBundle{} - } if pe >= params.BeaconConfig().DenebForkEpoch { return GetPayloadMethodV3, &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{} } @@ -566,7 +554,7 @@ func fullPayloadFromPayloadBody( Transactions: pb.RecastHexutilByteSlice(body.Transactions), Withdrawals: body.Withdrawals, }) // We can't get the block value and don't care about the block value for this instance - case version.Deneb: + case version.Deneb, version.Electra: ebg, err := header.ExcessBlobGas() if err != nil { return nil, errors.Wrap(err, "unable to extract ExcessBlobGas attribute from execution payload header") @@ -595,50 +583,6 @@ func fullPayloadFromPayloadBody( ExcessBlobGas: ebg, BlobGasUsed: bgu, }) // We can't get the block value and don't care about the block value for this instance - case version.Electra: - ebg, err := header.ExcessBlobGas() - if err != nil { - return nil, errors.Wrap(err, "unable to extract ExcessBlobGas attribute from execution payload header") - } - bgu, err := header.BlobGasUsed() - if err != nil { - return nil, errors.Wrap(err, "unable to extract BlobGasUsed attribute from execution payload header") - } - wr, err := pb.JsonWithdrawalRequestsToProto(body.WithdrawalRequests) - if err != nil { - return nil, err - } - dr, err := pb.JsonDepositRequestsToProto(body.DepositRequests) - if err != nil { - return nil, err - } - cr, err := pb.JsonConsolidationRequestsToProto(body.ConsolidationRequests) - if err != nil { - return nil, err - } - return blocks.WrappedExecutionPayloadElectra( - &pb.ExecutionPayloadElectra{ - ParentHash: header.ParentHash(), - FeeRecipient: header.FeeRecipient(), - StateRoot: header.StateRoot(), - ReceiptsRoot: header.ReceiptsRoot(), - LogsBloom: header.LogsBloom(), - PrevRandao: header.PrevRandao(), - BlockNumber: header.BlockNumber(), - GasLimit: header.GasLimit(), - GasUsed: header.GasUsed(), - Timestamp: header.Timestamp(), - ExtraData: header.ExtraData(), - BaseFeePerGas: header.BaseFeePerGas(), - BlockHash: header.BlockHash(), - Transactions: pb.RecastHexutilByteSlice(body.Transactions), - Withdrawals: body.Withdrawals, - ExcessBlobGas: ebg, - BlobGasUsed: bgu, - DepositRequests: dr, - WithdrawalRequests: wr, - ConsolidationRequests: cr, - }) // We can't get the block value and don't care about the block value for this instance default: return nil, fmt.Errorf("unknown execution block version for payload %d", bVersion) } @@ -761,7 +705,7 @@ func buildEmptyExecutionPayload(v int) (proto.Message, error) { Transactions: make([][]byte, 0), Withdrawals: make([]*pb.Withdrawal, 0), }, nil - case version.Deneb: + case version.Deneb, version.Electra: return &pb.ExecutionPayloadDeneb{ ParentHash: make([]byte, fieldparams.RootLength), FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), @@ -775,22 +719,6 @@ func buildEmptyExecutionPayload(v int) (proto.Message, error) { Transactions: make([][]byte, 0), Withdrawals: make([]*pb.Withdrawal, 0), }, nil - case version.Electra: - return &pb.ExecutionPayloadElectra{ - ParentHash: make([]byte, fieldparams.RootLength), - FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, fieldparams.LogsBloomLength), - PrevRandao: make([]byte, fieldparams.RootLength), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, fieldparams.RootLength), - BlockHash: make([]byte, fieldparams.RootLength), - Transactions: make([][]byte, 0), - Withdrawals: make([]*pb.Withdrawal, 0), - WithdrawalRequests: make([]*pb.WithdrawalRequest, 0), - DepositRequests: make([]*pb.DepositRequest, 0), - }, nil default: return nil, errors.Wrapf(ErrUnsupportedVersion, "version=%s", version.String(v)) } diff --git a/beacon-chain/execution/engine_client_test.go b/beacon-chain/execution/engine_client_test.go index 2e3e29b1defb..d0ec2a48feb4 100644 --- a/beacon-chain/execution/engine_client_test.go +++ b/beacon-chain/execution/engine_client_test.go @@ -320,72 +320,6 @@ func TestClient_HTTP(t *testing.T) { blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} require.DeepEqual(t, blobs, resp.BlobsBundle.Blobs) }) - t.Run(GetPayloadMethodV4, func(t *testing.T) { - payloadId := [8]byte{1} - want, ok := fix["ExecutionPayloadElectraWithValue"].(*pb.GetPayloadV4ResponseJson) - require.Equal(t, true, ok) - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - enc, err := io.ReadAll(r.Body) - require.NoError(t, err) - jsonRequestString := string(enc) - - reqArg, err := json.Marshal(pb.PayloadIDBytes(payloadId)) - require.NoError(t, err) - - // We expect the JSON string RPC request contains the right arguments. - require.Equal(t, true, strings.Contains( - jsonRequestString, string(reqArg), - )) - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": want, - } - err = json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - defer srv.Close() - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - defer rpcClient.Close() - - client := &Service{} - client.rpcClient = rpcClient - - // We call the RPC method via HTTP and expect a proper result. - resp, err := client.GetPayload(ctx, payloadId, 2*params.BeaconConfig().SlotsPerEpoch) - require.NoError(t, err) - require.Equal(t, true, resp.OverrideBuilder) - g, err := resp.ExecutionData.ExcessBlobGas() - require.NoError(t, err) - require.DeepEqual(t, uint64(3), g) - g, err = resp.ExecutionData.BlobGasUsed() - require.NoError(t, err) - require.DeepEqual(t, uint64(2), g) - - commitments := [][]byte{bytesutil.PadTo([]byte("commitment1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("commitment2"), fieldparams.BLSPubkeyLength)} - require.DeepEqual(t, commitments, resp.BlobsBundle.KzgCommitments) - proofs := [][]byte{bytesutil.PadTo([]byte("proof1"), fieldparams.BLSPubkeyLength), bytesutil.PadTo([]byte("proof2"), fieldparams.BLSPubkeyLength)} - require.DeepEqual(t, proofs, resp.BlobsBundle.Proofs) - blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} - require.DeepEqual(t, blobs, resp.BlobsBundle.Blobs) - ede, ok := resp.ExecutionData.(interfaces.ExecutionDataElectra) - require.Equal(t, true, ok) - require.NotNil(t, ede.WithdrawalRequests()) - wrequestsNotOverMax := len(ede.WithdrawalRequests()) <= int(params.BeaconConfig().MaxWithdrawalRequestsPerPayload) - require.Equal(t, true, wrequestsNotOverMax) - require.NotNil(t, ede.DepositRequests()) - drequestsNotOverMax := len(ede.DepositRequests()) <= int(params.BeaconConfig().MaxDepositRequestsPerPayload) - require.Equal(t, true, drequestsNotOverMax) - require.NotNil(t, ede.ConsolidationRequests()) - consolidationsNotOverMax := len(ede.ConsolidationRequests()) <= int(params.BeaconConfig().MaxConsolidationsRequestsPerPayload) - require.Equal(t, true, consolidationsNotOverMax) - }) t.Run(ForkchoiceUpdatedMethod+" VALID status", func(t *testing.T) { forkChoiceState := &pb.ForkchoiceState{ HeadBlockHash: []byte("head"), @@ -568,20 +502,6 @@ func TestClient_HTTP(t *testing.T) { require.NoError(t, err) require.DeepEqual(t, want.LatestValidHash, resp) }) - t.Run(NewPayloadMethodV4+" VALID status", func(t *testing.T) { - execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) - require.Equal(t, true, ok) - want, ok := fix["ValidPayloadStatus"].(*pb.PayloadStatus) - require.Equal(t, true, ok) - client := newPayloadV4Setup(t, want, execPayload) - - // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) - require.NoError(t, err) - resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) - require.NoError(t, err) - require.DeepEqual(t, want.LatestValidHash, resp) - }) t.Run(NewPayloadMethod+" SYNCING status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -624,20 +544,6 @@ func TestClient_HTTP(t *testing.T) { require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) require.DeepEqual(t, []uint8(nil), resp) }) - t.Run(NewPayloadMethodV4+" SYNCING status", func(t *testing.T) { - execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) - require.Equal(t, true, ok) - want, ok := fix["SyncingStatus"].(*pb.PayloadStatus) - require.Equal(t, true, ok) - client := newPayloadV4Setup(t, want, execPayload) - - // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) - require.NoError(t, err) - resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) - require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) - require.DeepEqual(t, []uint8(nil), resp) - }) t.Run(NewPayloadMethod+" INVALID_BLOCK_HASH status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -680,20 +586,6 @@ func TestClient_HTTP(t *testing.T) { require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) require.DeepEqual(t, []uint8(nil), resp) }) - t.Run(NewPayloadMethodV4+" INVALID_BLOCK_HASH status", func(t *testing.T) { - execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) - require.Equal(t, true, ok) - want, ok := fix["InvalidBlockHashStatus"].(*pb.PayloadStatus) - require.Equal(t, true, ok) - client := newPayloadV4Setup(t, want, execPayload) - - // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) - require.NoError(t, err) - resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) - require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) - require.DeepEqual(t, []uint8(nil), resp) - }) t.Run(NewPayloadMethod+" INVALID status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -736,20 +628,6 @@ func TestClient_HTTP(t *testing.T) { require.ErrorIs(t, ErrInvalidPayloadStatus, err) require.DeepEqual(t, want.LatestValidHash, resp) }) - t.Run(NewPayloadMethodV4+" INVALID status", func(t *testing.T) { - execPayload, ok := fix["ExecutionPayloadElectra"].(*pb.ExecutionPayloadElectra) - require.Equal(t, true, ok) - want, ok := fix["InvalidStatus"].(*pb.PayloadStatus) - require.Equal(t, true, ok) - client := newPayloadV4Setup(t, want, execPayload) - - // We call the RPC method via HTTP and expect a proper result. - wrappedPayload, err := blocks.WrappedExecutionPayloadElectra(execPayload) - require.NoError(t, err) - resp, err := client.NewPayload(ctx, wrappedPayload, []common.Hash{}, &common.Hash{'a'}) - require.ErrorIs(t, ErrInvalidPayloadStatus, err) - require.DeepEqual(t, want.LatestValidHash, resp) - }) t.Run(NewPayloadMethod+" UNKNOWN status", func(t *testing.T) { execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) require.Equal(t, true, ok) @@ -1417,10 +1295,8 @@ func fixtures() map[string]interface{} { "ExecutionPayload": s.ExecutionPayload, "ExecutionPayloadCapella": s.ExecutionPayloadCapella, "ExecutionPayloadDeneb": s.ExecutionPayloadDeneb, - "ExecutionPayloadElectra": s.ExecutionPayloadElectra, "ExecutionPayloadCapellaWithValue": s.ExecutionPayloadWithValueCapella, "ExecutionPayloadDenebWithValue": s.ExecutionPayloadWithValueDeneb, - "ExecutionPayloadElectraWithValue": s.ExecutionPayloadWithValueElectra, "ValidPayloadStatus": s.ValidPayloadStatus, "InvalidBlockHashStatus": s.InvalidBlockHashStatus, "AcceptedStatus": s.AcceptedStatus, @@ -1558,40 +1434,6 @@ func fixturesStruct() *payloadFixtures { TargetPubkey: &tPubkey, } } - dr, err := pb.JsonDepositRequestsToProto(depositRequests) - if err != nil { - panic(err) - } - wr, err := pb.JsonWithdrawalRequestsToProto(withdrawalRequests) - if err != nil { - panic(err) - } - cr, err := pb.JsonConsolidationRequestsToProto(consolidationRequests) - if err != nil { - panic(err) - } - executionPayloadFixtureElectra := &pb.ExecutionPayloadElectra{ - ParentHash: foo[:], - FeeRecipient: bar, - StateRoot: foo[:], - ReceiptsRoot: foo[:], - LogsBloom: baz, - PrevRandao: foo[:], - BlockNumber: 1, - GasLimit: 1, - GasUsed: 1, - Timestamp: 1, - ExtraData: foo[:], - BaseFeePerGas: bytesutil.PadTo(baseFeePerGas.Bytes(), fieldparams.RootLength), - BlockHash: foo[:], - Transactions: [][]byte{foo[:]}, - Withdrawals: []*pb.Withdrawal{}, - BlobGasUsed: 2, - ExcessBlobGas: 3, - DepositRequests: dr, - WithdrawalRequests: wr, - ConsolidationRequests: cr, - } hexUint := hexutil.Uint64(1) executionPayloadWithValueFixtureCapella := &pb.GetPayloadV2ResponseJson{ ExecutionPayload: &pb.ExecutionPayloadCapellaJSON{ @@ -1641,36 +1483,6 @@ func fixturesStruct() *payloadFixtures { Blobs: []hexutil.Bytes{{'a'}, {'b'}}, }, } - executionPayloadWithValueFixtureElectra := &pb.GetPayloadV4ResponseJson{ - ShouldOverrideBuilder: true, - ExecutionPayload: &pb.ExecutionPayloadElectraJSON{ - ParentHash: &common.Hash{'a'}, - FeeRecipient: &common.Address{'b'}, - StateRoot: &common.Hash{'c'}, - ReceiptsRoot: &common.Hash{'d'}, - LogsBloom: &hexutil.Bytes{'e'}, - PrevRandao: &common.Hash{'f'}, - BaseFeePerGas: "0x123", - BlockHash: &common.Hash{'g'}, - Transactions: []hexutil.Bytes{{'h'}}, - Withdrawals: []*pb.Withdrawal{}, - BlockNumber: &hexUint, - GasLimit: &hexUint, - GasUsed: &hexUint, - Timestamp: &hexUint, - BlobGasUsed: &bgu, - ExcessBlobGas: &ebg, - DepositRequests: depositRequests, - WithdrawalRequests: withdrawalRequests, - ConsolidationRequests: consolidationRequests, - }, - BlockValue: "0x11fffffffff", - BlobsBundle: &pb.BlobBundleJSON{ - Commitments: []hexutil.Bytes{[]byte("commitment1"), []byte("commitment2")}, - Proofs: []hexutil.Bytes{[]byte("proof1"), []byte("proof2")}, - Blobs: []hexutil.Bytes{{'a'}, {'b'}}, - }, - } parent := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) sha3Uncles := bytesutil.PadTo([]byte("sha3Uncles"), fieldparams.RootLength) miner := bytesutil.PadTo([]byte("miner"), fieldparams.FeeRecipientLength) @@ -1762,10 +1574,8 @@ func fixturesStruct() *payloadFixtures { ExecutionPayloadCapella: executionPayloadFixtureCapella, ExecutionPayloadDeneb: executionPayloadFixtureDeneb, EmptyExecutionPayloadDeneb: emptyExecutionPayloadDeneb, - ExecutionPayloadElectra: executionPayloadFixtureElectra, ExecutionPayloadWithValueCapella: executionPayloadWithValueFixtureCapella, ExecutionPayloadWithValueDeneb: executionPayloadWithValueFixtureDeneb, - ExecutionPayloadWithValueElectra: executionPayloadWithValueFixtureElectra, ValidPayloadStatus: validStatus, InvalidBlockHashStatus: inValidBlockHashStatus, AcceptedStatus: acceptedStatus, @@ -1787,10 +1597,8 @@ type payloadFixtures struct { ExecutionPayloadCapella *pb.ExecutionPayloadCapella EmptyExecutionPayloadDeneb *pb.ExecutionPayloadDeneb ExecutionPayloadDeneb *pb.ExecutionPayloadDeneb - ExecutionPayloadElectra *pb.ExecutionPayloadElectra ExecutionPayloadWithValueCapella *pb.GetPayloadV2ResponseJson ExecutionPayloadWithValueDeneb *pb.GetPayloadV3ResponseJson - ExecutionPayloadWithValueElectra *pb.GetPayloadV4ResponseJson ValidPayloadStatus *pb.PayloadStatus InvalidBlockHashStatus *pb.PayloadStatus AcceptedStatus *pb.PayloadStatus @@ -2149,40 +1957,6 @@ func newPayloadV3Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.Execu return service } -func newPayloadV4Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.ExecutionPayloadElectra) *Service { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - defer func() { - require.NoError(t, r.Body.Close()) - }() - enc, err := io.ReadAll(r.Body) - require.NoError(t, err) - jsonRequestString := string(enc) - - reqArg, err := json.Marshal(payload) - require.NoError(t, err) - - // We expect the JSON string RPC request contains the right arguments. - require.Equal(t, true, strings.Contains( - jsonRequestString, string(reqArg), - )) - resp := map[string]interface{}{ - "jsonrpc": "2.0", - "id": 1, - "result": status, - } - err = json.NewEncoder(w).Encode(resp) - require.NoError(t, err) - })) - - rpcClient, err := rpc.DialHTTP(srv.URL) - require.NoError(t, err) - - service := &Service{} - service.rpcClient = rpcClient - return service -} - func TestReconstructBlindedBlockBatch(t *testing.T) { t.Run("empty response works", func(t *testing.T) { ctx := context.Background() diff --git a/beacon-chain/execution/payload_body_test.go b/beacon-chain/execution/payload_body_test.go index ab447502c054..b4485499603a 100644 --- a/beacon-chain/execution/payload_body_test.go +++ b/beacon-chain/execution/payload_body_test.go @@ -64,12 +64,6 @@ func payloadToBody(t *testing.T, ed interfaces.ExecutionData) *pb.ExecutionPaylo for i := range txs { body.Transactions = append(body.Transactions, txs[i]) } - eed, isElectra := ed.(interfaces.ExecutionDataElectra) - if isElectra { - body.DepositRequests = pb.ProtoDepositRequestsToJson(eed.DepositRequests()) - body.WithdrawalRequests = pb.ProtoWithdrawalRequestsToJson(eed.WithdrawalRequests()) - body.ConsolidationRequests = pb.ProtoConsolidationRequestsToJson(eed.ConsolidationRequests()) - } return body } @@ -132,7 +126,7 @@ func testBlindedBlockFixtures(t *testing.T) *blindedBlockFixtures { afterSkipBlock, _ := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, denebSlot(t)+3, 0, util.WithPayloadSetter(afterSkip)) fx.afterSkipDeneb = blindedBlockWithHeader(t, afterSkipBlock) - electra := fixturesStruct().ExecutionPayloadElectra + electra := fixturesStruct().ExecutionPayloadDeneb electra.BlockHash = bytesutil.PadTo([]byte("electra"), 32) electra.BlockNumber = 5 electraBlock, _ := util.GenerateTestElectraBlockWithSidecar(t, [32]byte{}, electraSlot(t), 0, util.WithElectraPayload(electra)) @@ -164,6 +158,7 @@ func TestPayloadBodiesViaUnblinder(t *testing.T) { payload, err := bbr.payloadForHeader(fx.denebBlock.blinded.header, fx.denebBlock.blinded.block.Version()) require.NoError(t, err) + require.Equal(t, version.Deneb, fx.denebBlock.blinded.block.Version()) unblindFull, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(fx.denebBlock.blinded.block, payload) require.NoError(t, err) testAssertReconstructedEquivalent(t, fx.denebBlock.full, unblindFull) diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index d44ca7e04938..94b08b176d3c 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -472,6 +472,6 @@ data: {"version":"deneb","data":{"proposer_index":"0","proposal_slot":"1","paren const payloadAttributesElectraResultWithTVC = `: event: payload_attributes -data: {"version":"electra","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0xd2dbd02e4efe087d7d195de828b9dd25f19a89c9","withdrawals":[],"parent_beacon_block_root":"0x66d641f7eae038f2dd28081b09d2ba279462cc47655c7b7e1fd1159a50c8eb32"}}} +data: {"version":"electra","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0xd2dbd02e4efe087d7d195de828b9dd25f19a89c9","withdrawals":[],"parent_beacon_block_root":"0xf2110e448638f41cb34514ecdbb49c055536cd5f715f1cb259d1287bb900853e"}}} ` diff --git a/beacon-chain/rpc/eth/shared/testing/json.go b/beacon-chain/rpc/eth/shared/testing/json.go index bad370cea5e5..efff535b279d 100644 --- a/beacon-chain/rpc/eth/shared/testing/json.go +++ b/beacon-chain/rpc/eth/shared/testing/json.go @@ -1814,10 +1814,7 @@ var BlindedElectraBlock = fmt.Sprintf(`{ "blob_gas_used": "1", "excess_blob_gas": "2", "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "deposit_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "withdrawal_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "consolidation_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "bls_to_execution_changes": [ { @@ -1829,7 +1826,33 @@ var BlindedElectraBlock = fmt.Sprintf(`{ "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ], - "blob_kzg_commitments":["0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8000"] + "blob_kzg_commitments":["0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8000"], + "execution_requests": { + "deposits": [ + { + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "amount": "123", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "index": "123" + } + ], + "withdrawals": [ + { + "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "validator_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "amount": "123" + } + ], + "consolidations": [ + { + "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "source_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "target_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + } + ] + } + } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" @@ -2225,30 +2248,7 @@ var ElectraBlockContents = fmt.Sprintf(`{ "address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "amount": "1" } - ], - "deposit_requests": [ - { - "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "amount": "123", - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "index": "123" - } - ], - "withdrawal_requests": [ - { - "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "validator_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "amount": "123" - } - ], - "consolidation_requests": [ - { - "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "source_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "target_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" - } - ] + ] }, "bls_to_execution_changes": [ { @@ -2260,7 +2260,32 @@ var ElectraBlockContents = fmt.Sprintf(`{ "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ], - "blob_kzg_commitments":["0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8000"] + "blob_kzg_commitments":["0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8000"], + "execution_requests": { + "deposits": [ + { + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "amount": "123", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "index": "123" + } + ], + "withdrawals": [ + { + "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "validator_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "amount": "123" + } + ], + "consolidations": [ + { + "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "source_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "target_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + } + ] + } } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index b9e6caf89f9b..72060557591d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -586,6 +586,27 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { require.NoError(t, err) var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte + dr := []*enginev1.DepositRequest{{ + Pubkey: bytesutil.PadTo(privKeys[0].PublicKey().Marshal(), 48), + WithdrawalCredentials: bytesutil.PadTo([]byte("wc"), 32), + Amount: 123, + Signature: bytesutil.PadTo([]byte("sig"), 96), + Index: 456, + }} + wr := []*enginev1.WithdrawalRequest{ + { + SourceAddress: bytesutil.PadTo([]byte("sa"), 20), + ValidatorPubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), + Amount: 789, + }, + } + cr := []*enginev1.ConsolidationRequest{ + { + SourceAddress: bytesutil.PadTo([]byte("sa"), 20), + SourcePubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), + TargetPubkey: bytesutil.PadTo(privKeys[2].PublicKey().Marshal(), 48), + }, + } blk := ðpb.SignedBeaconBlockElectra{ Block: ðpb.BeaconBlockElectra{ Slot: electraSlot + 1, @@ -606,6 +627,11 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { BaseFeePerGas: make([]byte, fieldparams.RootLength), BlockHash: make([]byte, fieldparams.RootLength), }, + ExecutionRequests: &enginev1.ExecutionRequests{ + Withdrawals: wr, + Deposits: dr, + Consolidations: cr, + }, }, }, } @@ -620,42 +646,17 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { require.NoError(t, err) timeStamp, err := slots.ToTime(beaconState.GenesisTime(), electraSlot+1) require.NoError(t, err) - dr := []*enginev1.DepositRequest{{ - Pubkey: bytesutil.PadTo(privKeys[0].PublicKey().Marshal(), 48), - WithdrawalCredentials: bytesutil.PadTo([]byte("wc"), 32), - Amount: 123, - Signature: bytesutil.PadTo([]byte("sig"), 96), - Index: 456, - }} - wr := []*enginev1.WithdrawalRequest{ - { - SourceAddress: bytesutil.PadTo([]byte("sa"), 20), - ValidatorPubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), - Amount: 789, - }, - } - cr := []*enginev1.ConsolidationRequest{ - { - SourceAddress: bytesutil.PadTo([]byte("sa"), 20), - SourcePubkey: bytesutil.PadTo(privKeys[1].PublicKey().Marshal(), 48), - TargetPubkey: bytesutil.PadTo(privKeys[2].PublicKey().Marshal(), 48), - }, - } payload := &enginev1.ExecutionPayloadElectra{ - Timestamp: uint64(timeStamp.Unix()), - ParentHash: make([]byte, fieldparams.RootLength), - FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, fieldparams.LogsBloomLength), - PrevRandao: random, - BaseFeePerGas: make([]byte, fieldparams.RootLength), - BlockHash: make([]byte, fieldparams.RootLength), - DepositRequests: dr, - WithdrawalRequests: wr, - ConsolidationRequests: cr, + Timestamp: uint64(timeStamp.Unix()), + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: random, + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), } - proposerServer := getProposerServer(db, beaconState, parentRoot[:]) ed, err := blocks.NewWrappedExecutionData(payload) require.NoError(t, err) @@ -675,11 +676,8 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) { Graffiti: graffiti[:], } - got, err := proposerServer.GetBeaconBlock(ctx, req) + _, err = proposerServer.GetBeaconBlock(ctx, req) require.NoError(t, err) - p := got.GetElectra().Block.Body.ExecutionPayload - require.DeepEqual(t, dr, p.DepositRequests) - require.DeepEqual(t, wr, p.WithdrawalRequests) } func TestServer_GetBeaconBlock_Optimistic(t *testing.T) { diff --git a/beacon-chain/state/state-native/beacon_state.go b/beacon-chain/state/state-native/beacon_state.go index d10325929e34..916746b5916e 100644 --- a/beacon-chain/state/state-native/beacon_state.go +++ b/beacon-chain/state/state-native/beacon_state.go @@ -55,7 +55,6 @@ type BeaconState struct { latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb - latestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra nextWithdrawalIndex uint64 nextWithdrawalValidatorIndex primitives.ValidatorIndex @@ -114,7 +113,6 @@ type beaconStateMarshalable struct { LatestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader `json:"latest_execution_payload_header" yaml:"latest_execution_payload_header"` LatestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella `json:"latest_execution_payload_header_capella" yaml:"latest_execution_payload_header_capella"` LatestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb `json:"latest_execution_payload_header_deneb" yaml:"latest_execution_payload_header_deneb"` - LatestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra `json:"latest_execution_payload_header_electra" yaml:"latest_execution_payload_header_electra"` NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"` NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"` DepositRequestsStartIndex uint64 `json:"deposit_requests_start_index" yaml:"deposit_requests_start_index"` @@ -184,7 +182,6 @@ func (b *BeaconState) MarshalJSON() ([]byte, error) { LatestExecutionPayloadHeader: b.latestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb, - LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra, NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, DepositRequestsStartIndex: b.depositRequestsStartIndex, diff --git a/beacon-chain/state/state-native/getters_payload_header.go b/beacon-chain/state/state-native/getters_payload_header.go index 577105346c5a..a3b156b3ead8 100644 --- a/beacon-chain/state/state-native/getters_payload_header.go +++ b/beacon-chain/state/state-native/getters_payload_header.go @@ -22,10 +22,8 @@ func (b *BeaconState) LatestExecutionPayloadHeader() (interfaces.ExecutionData, return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeader.Copy()) case version.Capella: return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapella.Copy()) - case version.Deneb: + case version.Deneb, version.Electra: return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDeneb.Copy()) - case version.Electra: - return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectra.Copy()) default: return nil, fmt.Errorf("unsupported version (%s) for latest execution payload header", version.String(b.version)) } diff --git a/beacon-chain/state/state-native/getters_state.go b/beacon-chain/state/state-native/getters_state.go index 66f512369f9b..c55ad70e4b1f 100644 --- a/beacon-chain/state/state-native/getters_state.go +++ b/beacon-chain/state/state-native/getters_state.go @@ -198,7 +198,7 @@ func (b *BeaconState) ToProtoUnsafe() interface{} { InactivityScores: b.inactivityScoresVal(), CurrentSyncCommittee: b.currentSyncCommittee, NextSyncCommittee: b.nextSyncCommittee, - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectra, + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderDeneb, NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummaries, @@ -404,7 +404,7 @@ func (b *BeaconState) ToProto() interface{} { InactivityScores: b.inactivityScoresVal(), CurrentSyncCommittee: b.currentSyncCommitteeVal(), NextSyncCommittee: b.nextSyncCommitteeVal(), - LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectra.Copy(), + LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderDeneb.Copy(), NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, HistoricalSummaries: b.historicalSummariesVal(), diff --git a/beacon-chain/state/state-native/hasher.go b/beacon-chain/state/state-native/hasher.go index 2ca5c74e193b..60422707be72 100644 --- a/beacon-chain/state/state-native/hasher.go +++ b/beacon-chain/state/state-native/hasher.go @@ -243,7 +243,7 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b fieldRoots[types.LatestExecutionPayloadHeaderCapella.RealPosition()] = executionPayloadRoot[:] } - if state.version == version.Deneb { + if state.version >= version.Deneb { // Execution payload root. executionPayloadRoot, err := state.latestExecutionPayloadHeaderDeneb.HashTreeRoot() if err != nil { @@ -252,15 +252,6 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b fieldRoots[types.LatestExecutionPayloadHeaderDeneb.RealPosition()] = executionPayloadRoot[:] } - if state.version == version.Electra { - // Execution payload root. - executionPayloadRoot, err := state.latestExecutionPayloadHeaderElectra.HashTreeRoot() - if err != nil { - return nil, err - } - fieldRoots[types.LatestExecutionPayloadHeaderElectra.RealPosition()] = executionPayloadRoot[:] - } - if state.version >= version.Capella { // Next withdrawal index root. nextWithdrawalIndexRoot := make([]byte, 32) diff --git a/beacon-chain/state/state-native/setters_payload_header.go b/beacon-chain/state/state-native/setters_payload_header.go index 9187aec5ba0c..5011cb674867 100644 --- a/beacon-chain/state/state-native/setters_payload_header.go +++ b/beacon-chain/state/state-native/setters_payload_header.go @@ -45,7 +45,7 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella) return nil case *enginev1.ExecutionPayloadDeneb: - if b.version != version.Deneb { + if b.version != version.Deneb && b.version != version.Electra { return fmt.Errorf("wrong state version (%s) for deneb execution payload", version.String(b.version)) } latest, err := consensusblocks.PayloadToHeaderDeneb(val) @@ -55,21 +55,6 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa b.latestExecutionPayloadHeaderDeneb = latest b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb) return nil - case *enginev1.ExecutionPayloadElectra: - if b.version != version.Electra { - return fmt.Errorf("wrong state version (%s) for electra execution payload", version.String(b.version)) - } - eVal, ok := val.(interfaces.ExecutionDataElectra) - if !ok { - return fmt.Errorf("could not cast %T to ExecutionDataElectra: %w", val, interfaces.ErrInvalidCast) - } - latest, err := consensusblocks.PayloadToHeaderElectra(eVal) - if err != nil { - return errors.Wrap(err, "could not convert payload to header") - } - b.latestExecutionPayloadHeaderElectra = latest - b.markFieldAsDirty(types.LatestExecutionPayloadHeaderElectra) - return nil case *enginev1.ExecutionPayloadHeader: if b.version != version.Bellatrix { return fmt.Errorf("wrong state version (%s) for bellatrix execution payload header", version.String(b.version)) @@ -85,19 +70,12 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella) return nil case *enginev1.ExecutionPayloadHeaderDeneb: - if b.version != version.Deneb { + if b.version != version.Deneb && b.version != version.Electra { return fmt.Errorf("wrong state version (%s) for deneb execution payload header", version.String(b.version)) } b.latestExecutionPayloadHeaderDeneb = header b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb) return nil - case *enginev1.ExecutionPayloadHeaderElectra: - if b.version != version.Electra { - return fmt.Errorf("wrong state version (%s) for electra execution payload header", version.String(b.version)) - } - b.latestExecutionPayloadHeaderElectra = header - b.markFieldAsDirty(types.LatestExecutionPayloadHeaderElectra) - return nil default: return errors.New("value must be an execution payload header") } diff --git a/beacon-chain/state/state-native/setters_payload_header_test.go b/beacon-chain/state/state-native/setters_payload_header_test.go index 8e49ccdfb3ec..b9f806591815 100644 --- a/beacon-chain/state/state-native/setters_payload_header_test.go +++ b/beacon-chain/state/state-native/setters_payload_header_test.go @@ -62,7 +62,7 @@ func TestSetLatestExecutionPayloadHeader(t *testing.T) { }(), func() interfaces.ExecutionData { e := util.NewBlindedBeaconBlockElectra().Message.Body.ExecutionPayloadHeader - ee, err := blocks.WrappedExecutionPayloadHeaderElectra(e) + ee, err := blocks.WrappedExecutionPayloadHeaderDeneb(e) require.NoError(t, err) return ee }(), @@ -93,6 +93,13 @@ func TestSetLatestExecutionPayloadHeader(t *testing.T) { if i == j { continue } + // Skip Deneb-Electra combinations + if i == len(payloads)-1 && j == len(payloads)-2 { + continue + } + if i == len(payloads)-2 && j == len(payloads)-1 { + continue + } t.Run(fmt.Sprintf("%s state with %s payload", version.String(i+versionOffset), version.String(j+versionOffset)), func(t *testing.T) { s := state_native.EmptyStateFromVersion(t, i+versionOffset) p := payloads[j] diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 8668e4aee754..f995688bb082 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -99,7 +99,7 @@ var electraFields = append( types.NextWithdrawalIndex, types.NextWithdrawalValidatorIndex, types.HistoricalSummaries, - types.LatestExecutionPayloadHeaderElectra, + types.LatestExecutionPayloadHeaderDeneb, types.DepositRequestsStartIndex, types.DepositBalanceToConsume, types.ExitBalanceToConsume, @@ -726,38 +726,38 @@ func InitializeFromProtoUnsafeElectra(st *ethpb.BeaconStateElectra) (state.Beaco fieldCount := params.BeaconConfig().BeaconStateElectraFieldCount b := &BeaconState{ - version: version.Electra, - genesisTime: st.GenesisTime, - genesisValidatorsRoot: bytesutil.ToBytes32(st.GenesisValidatorsRoot), - slot: st.Slot, - fork: st.Fork, - latestBlockHeader: st.LatestBlockHeader, - historicalRoots: hRoots, - eth1Data: st.Eth1Data, - eth1DataVotes: st.Eth1DataVotes, - eth1DepositIndex: st.Eth1DepositIndex, - slashings: st.Slashings, - previousEpochParticipation: st.PreviousEpochParticipation, - currentEpochParticipation: st.CurrentEpochParticipation, - justificationBits: st.JustificationBits, - previousJustifiedCheckpoint: st.PreviousJustifiedCheckpoint, - currentJustifiedCheckpoint: st.CurrentJustifiedCheckpoint, - finalizedCheckpoint: st.FinalizedCheckpoint, - currentSyncCommittee: st.CurrentSyncCommittee, - nextSyncCommittee: st.NextSyncCommittee, - latestExecutionPayloadHeaderElectra: st.LatestExecutionPayloadHeader, - nextWithdrawalIndex: st.NextWithdrawalIndex, - nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex, - historicalSummaries: st.HistoricalSummaries, - depositRequestsStartIndex: st.DepositRequestsStartIndex, - depositBalanceToConsume: st.DepositBalanceToConsume, - exitBalanceToConsume: st.ExitBalanceToConsume, - earliestExitEpoch: st.EarliestExitEpoch, - consolidationBalanceToConsume: st.ConsolidationBalanceToConsume, - earliestConsolidationEpoch: st.EarliestConsolidationEpoch, - pendingBalanceDeposits: st.PendingBalanceDeposits, - pendingPartialWithdrawals: st.PendingPartialWithdrawals, - pendingConsolidations: st.PendingConsolidations, + version: version.Electra, + genesisTime: st.GenesisTime, + genesisValidatorsRoot: bytesutil.ToBytes32(st.GenesisValidatorsRoot), + slot: st.Slot, + fork: st.Fork, + latestBlockHeader: st.LatestBlockHeader, + historicalRoots: hRoots, + eth1Data: st.Eth1Data, + eth1DataVotes: st.Eth1DataVotes, + eth1DepositIndex: st.Eth1DepositIndex, + slashings: st.Slashings, + previousEpochParticipation: st.PreviousEpochParticipation, + currentEpochParticipation: st.CurrentEpochParticipation, + justificationBits: st.JustificationBits, + previousJustifiedCheckpoint: st.PreviousJustifiedCheckpoint, + currentJustifiedCheckpoint: st.CurrentJustifiedCheckpoint, + finalizedCheckpoint: st.FinalizedCheckpoint, + currentSyncCommittee: st.CurrentSyncCommittee, + nextSyncCommittee: st.NextSyncCommittee, + latestExecutionPayloadHeaderDeneb: st.LatestExecutionPayloadHeader, + nextWithdrawalIndex: st.NextWithdrawalIndex, + nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex, + historicalSummaries: st.HistoricalSummaries, + depositRequestsStartIndex: st.DepositRequestsStartIndex, + depositBalanceToConsume: st.DepositBalanceToConsume, + exitBalanceToConsume: st.ExitBalanceToConsume, + earliestExitEpoch: st.EarliestExitEpoch, + consolidationBalanceToConsume: st.ConsolidationBalanceToConsume, + earliestConsolidationEpoch: st.EarliestConsolidationEpoch, + pendingBalanceDeposits: st.PendingBalanceDeposits, + pendingPartialWithdrawals: st.PendingPartialWithdrawals, + pendingConsolidations: st.PendingConsolidations, dirtyFields: make(map[types.FieldIndex]bool, fieldCount), dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), @@ -818,11 +818,11 @@ func InitializeFromProtoUnsafeElectra(st *ethpb.BeaconStateElectra) (state.Beaco b.sharedFieldReferences[types.Slashings] = stateutil.NewRef(1) b.sharedFieldReferences[types.PreviousEpochParticipationBits] = stateutil.NewRef(1) b.sharedFieldReferences[types.CurrentEpochParticipationBits] = stateutil.NewRef(1) - b.sharedFieldReferences[types.LatestExecutionPayloadHeaderElectra] = stateutil.NewRef(1) // New in Electra. - b.sharedFieldReferences[types.HistoricalSummaries] = stateutil.NewRef(1) // New in Capella. - b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) // New in Electra. - b.sharedFieldReferences[types.PendingPartialWithdrawals] = stateutil.NewRef(1) // New in Electra. - b.sharedFieldReferences[types.PendingConsolidations] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.LatestExecutionPayloadHeaderDeneb] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.HistoricalSummaries] = stateutil.NewRef(1) // New in Capella. + b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.PendingPartialWithdrawals] = stateutil.NewRef(1) // New in Electra. + b.sharedFieldReferences[types.PendingConsolidations] = stateutil.NewRef(1) // New in Electra. if !features.Get().EnableExperimentalState { b.sharedFieldReferences[types.BlockRoots] = stateutil.NewRef(1) b.sharedFieldReferences[types.StateRoots] = stateutil.NewRef(1) @@ -916,7 +916,6 @@ func (b *BeaconState) Copy() state.BeaconState { latestExecutionPayloadHeader: b.latestExecutionPayloadHeader.Copy(), latestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella.Copy(), latestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb.Copy(), - latestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra.Copy(), id: types.Enumerator.Inc(), @@ -1284,8 +1283,6 @@ func (b *BeaconState) rootSelector(ctx context.Context, field types.FieldIndex) return b.latestExecutionPayloadHeaderCapella.HashTreeRoot() case types.LatestExecutionPayloadHeaderDeneb: return b.latestExecutionPayloadHeaderDeneb.HashTreeRoot() - case types.LatestExecutionPayloadHeaderElectra: - return b.latestExecutionPayloadHeaderElectra.HashTreeRoot() case types.NextWithdrawalIndex: return ssz.Uint64Root(b.nextWithdrawalIndex), nil case types.NextWithdrawalValidatorIndex: diff --git a/beacon-chain/state/state-native/types/types.go b/beacon-chain/state/state-native/types/types.go index 43cb57c6a76a..0fc23cfd363d 100644 --- a/beacon-chain/state/state-native/types/types.go +++ b/beacon-chain/state/state-native/types/types.go @@ -88,8 +88,6 @@ func (f FieldIndex) String() string { return "latestExecutionPayloadHeaderCapella" case LatestExecutionPayloadHeaderDeneb: return "latestExecutionPayloadHeaderDeneb" - case LatestExecutionPayloadHeaderElectra: - return "latestExecutionPayloadHeaderElectra" case NextWithdrawalIndex: return "nextWithdrawalIndex" case NextWithdrawalValidatorIndex: @@ -171,7 +169,7 @@ func (f FieldIndex) RealPosition() int { return 22 case NextSyncCommittee: return 23 - case LatestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb, LatestExecutionPayloadHeaderElectra: + case LatestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb: return 24 case NextWithdrawalIndex: return 25 @@ -249,7 +247,6 @@ const ( LatestExecutionPayloadHeader LatestExecutionPayloadHeaderCapella LatestExecutionPayloadHeaderDeneb - LatestExecutionPayloadHeaderElectra NextWithdrawalIndex NextWithdrawalValidatorIndex HistoricalSummaries diff --git a/beacon-chain/sync/decode_pubsub_test.go b/beacon-chain/sync/decode_pubsub_test.go index 1638a2305890..1ae8f0dd6ede 100644 --- a/beacon-chain/sync/decode_pubsub_test.go +++ b/beacon-chain/sync/decode_pubsub_test.go @@ -269,7 +269,7 @@ func TestExtractDataType(t *testing.T) { chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, }, wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { - wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: ðpb.BeaconBlockElectra{Body: ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{}}}}) + wsb, err := blocks.NewSignedBeaconBlock(ðpb.SignedBeaconBlockElectra{Block: ðpb.BeaconBlockElectra{Body: ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadDeneb{}}}}) require.NoError(t, err) return wsb }(), diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 3b20fcdeb7ea..1760f0bf223a 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -40,6 +40,7 @@ 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_REQUEST_PAYLOADS", // Compile time constant on BeaconBlockBody.ExecutionRequests "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. "REORG_HEAD_WEIGHT_THRESHOLD", "SAMPLES_PER_SLOT", diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index 6d47aa3c5a8f..ee74f18011b4 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -14,8 +14,6 @@ import ( "google.golang.org/protobuf/proto" ) -var _ interfaces.ExecutionDataElectra = (*executionPayloadElectra)(nil) - // executionPayload is a convenience wrapper around a beacon block body's execution payload data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -39,10 +37,6 @@ func NewWrappedExecutionData(v proto.Message) (interfaces.ExecutionData, error) return WrappedExecutionPayloadDeneb(pbStruct) case *enginev1.ExecutionPayloadDenebWithValueAndBlobsBundle: return WrappedExecutionPayloadDeneb(pbStruct.Payload) - case *enginev1.ExecutionPayloadElectra: - return WrappedExecutionPayloadElectra(pbStruct) - case *enginev1.ExecutionPayloadElectraWithValueAndBlobsBundle: - return WrappedExecutionPayloadElectra(pbStruct.Payload) default: return nil, ErrUnsupportedVersion } @@ -787,74 +781,7 @@ func PayloadToHeaderDeneb(payload interfaces.ExecutionData) (*enginev1.Execution }, nil } -// PayloadToHeaderElectra converts `payload` into execution payload header format. -func PayloadToHeaderElectra(payload interfaces.ExecutionDataElectra) (*enginev1.ExecutionPayloadHeaderElectra, error) { - txs, err := payload.Transactions() - if err != nil { - return nil, err - } - txRoot, err := ssz.TransactionsRoot(txs) - if err != nil { - return nil, err - } - withdrawals, err := payload.Withdrawals() - if err != nil { - return nil, err - } - withdrawalsRoot, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) - if err != nil { - return nil, err - } - blobGasUsed, err := payload.BlobGasUsed() - if err != nil { - return nil, err - } - excessBlobGas, err := payload.ExcessBlobGas() - if err != nil { - return nil, err - } - - depositRequests := payload.DepositRequests() - depositRequestsRoot, err := ssz.DepositRequestsSliceRoot(depositRequests, fieldparams.MaxDepositRequestsPerPayload) - if err != nil { - return nil, err - } - - withdrawalRequests := payload.WithdrawalRequests() - withdrawalRequestsRoot, err := ssz.WithdrawalRequestsSliceRoot(withdrawalRequests, fieldparams.MaxWithdrawalRequestsPerPayload) - if err != nil { - return nil, err - } - - consolidationRequests := payload.ConsolidationRequests() - consolidationRequestsRoot, err := ssz.ConsolidationRequestsSliceRoot(consolidationRequests, fieldparams.MaxConsolidationRequestsPerPayload) - if err != nil { - return nil, err - } - - return &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash()), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient()), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot()), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot()), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom()), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao()), - BlockNumber: payload.BlockNumber(), - GasLimit: payload.GasLimit(), - GasUsed: payload.GasUsed(), - Timestamp: payload.Timestamp(), - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData()), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas()), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash()), - TransactionsRoot: txRoot[:], - WithdrawalsRoot: withdrawalsRoot[:], - BlobGasUsed: blobGasUsed, - ExcessBlobGas: excessBlobGas, - DepositRequestsRoot: depositRequestsRoot[:], - WithdrawalRequestsRoot: withdrawalRequestsRoot[:], - ConsolidationRequestsRoot: consolidationRequestsRoot[:], - }, nil -} +var PayloadToHeaderElectra = PayloadToHeaderDeneb // IsEmptyExecutionData checks if an execution data is empty underneath. If a single field has // a non-zero value, this function will return false. @@ -913,20 +840,6 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { if data.Timestamp() != 0 { return false, nil } - - epe, postElectra := data.(interfaces.ExecutionDataElectra) - if postElectra { - drs := epe.DepositRequests() - if len(drs) != 0 { - return false, nil - } - - wrs := epe.WithdrawalRequests() - if len(wrs) != 0 { - return false, nil - } - } - return true, nil } @@ -948,6 +861,8 @@ func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb) return w, nil } +var WrappedExecutionPayloadHeaderElectra = WrappedExecutionPayloadHeaderDeneb + // IsNil checks if the underlying data is nil. func (e executionPayloadHeaderDeneb) IsNil() bool { return e.p == nil @@ -1106,6 +1021,8 @@ func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb) (interfaces return w, nil } +var WrappedExecutionPayloadElectra = WrappedExecutionPayloadDeneb + // IsNil checks if the underlying data is nil. func (e executionPayloadDeneb) IsNil() bool { return e.p == nil @@ -1243,342 +1160,3 @@ func (e executionPayloadDeneb) ExcessBlobGas() (uint64, error) { func (e executionPayloadDeneb) IsBlinded() bool { return false } - -// executionPayloadHeaderElectra is a convenience wrapper around a blinded beacon block body's execution header data structure. -// This wrapper allows us to conform to a common interface so that beacon -// blocks for future forks can also be applied across Prysm without issues. -type executionPayloadHeaderElectra struct { - p *enginev1.ExecutionPayloadHeaderElectra -} - -var _ interfaces.ExecutionData = &executionPayloadElectra{} - -// WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. -func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra) (interfaces.ExecutionData, error) { - w := executionPayloadHeaderElectra{p: p} - if w.IsNil() { - return nil, consensus_types.ErrNilObjectWrapped - } - return w, nil -} - -// IsNil checks if the underlying data is nil. -func (e executionPayloadHeaderElectra) IsNil() bool { - return e.p == nil -} - -// MarshalSSZ -- -func (e executionPayloadHeaderElectra) MarshalSSZ() ([]byte, error) { - return e.p.MarshalSSZ() -} - -// MarshalSSZTo -- -func (e executionPayloadHeaderElectra) MarshalSSZTo(dst []byte) ([]byte, error) { - return e.p.MarshalSSZTo(dst) -} - -// SizeSSZ -- -func (e executionPayloadHeaderElectra) SizeSSZ() int { - return e.p.SizeSSZ() -} - -// UnmarshalSSZ -- -func (e executionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { - return e.p.UnmarshalSSZ(buf) -} - -// HashTreeRoot -- -func (e executionPayloadHeaderElectra) HashTreeRoot() ([32]byte, error) { - return e.p.HashTreeRoot() -} - -// HashTreeRootWith -- -func (e executionPayloadHeaderElectra) HashTreeRootWith(hh *fastssz.Hasher) error { - return e.p.HashTreeRootWith(hh) -} - -// Proto -- -func (e executionPayloadHeaderElectra) Proto() proto.Message { - return e.p -} - -// ParentHash -- -func (e executionPayloadHeaderElectra) ParentHash() []byte { - return e.p.ParentHash -} - -// FeeRecipient -- -func (e executionPayloadHeaderElectra) FeeRecipient() []byte { - return e.p.FeeRecipient -} - -// StateRoot -- -func (e executionPayloadHeaderElectra) StateRoot() []byte { - return e.p.StateRoot -} - -// ReceiptsRoot -- -func (e executionPayloadHeaderElectra) ReceiptsRoot() []byte { - return e.p.ReceiptsRoot -} - -// LogsBloom -- -func (e executionPayloadHeaderElectra) LogsBloom() []byte { - return e.p.LogsBloom -} - -// PrevRandao -- -func (e executionPayloadHeaderElectra) PrevRandao() []byte { - return e.p.PrevRandao -} - -// BlockNumber -- -func (e executionPayloadHeaderElectra) BlockNumber() uint64 { - return e.p.BlockNumber -} - -// GasLimit -- -func (e executionPayloadHeaderElectra) GasLimit() uint64 { - return e.p.GasLimit -} - -// GasUsed -- -func (e executionPayloadHeaderElectra) GasUsed() uint64 { - return e.p.GasUsed -} - -// Timestamp -- -func (e executionPayloadHeaderElectra) Timestamp() uint64 { - return e.p.Timestamp -} - -// ExtraData -- -func (e executionPayloadHeaderElectra) ExtraData() []byte { - return e.p.ExtraData -} - -// BaseFeePerGas -- -func (e executionPayloadHeaderElectra) BaseFeePerGas() []byte { - return e.p.BaseFeePerGas -} - -// BlockHash -- -func (e executionPayloadHeaderElectra) BlockHash() []byte { - return e.p.BlockHash -} - -// Transactions -- -func (executionPayloadHeaderElectra) Transactions() ([][]byte, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// TransactionsRoot -- -func (e executionPayloadHeaderElectra) TransactionsRoot() ([]byte, error) { - return e.p.TransactionsRoot, nil -} - -// Withdrawals -- -func (e executionPayloadHeaderElectra) Withdrawals() ([]*enginev1.Withdrawal, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalsRoot -- -func (e executionPayloadHeaderElectra) WithdrawalsRoot() ([]byte, error) { - return e.p.WithdrawalsRoot, nil -} - -// BlobGasUsed -- -func (e executionPayloadHeaderElectra) BlobGasUsed() (uint64, error) { - return e.p.BlobGasUsed, nil -} - -// ExcessBlobGas -- -func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { - return e.p.ExcessBlobGas, nil -} - -// DepositRequests -- -func (e executionPayloadHeaderElectra) DepositRequests() ([]*enginev1.DepositRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// WithdrawalRequests -- -func (e executionPayloadHeaderElectra) WithdrawalRequests() ([]*enginev1.WithdrawalRequest, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// IsBlinded returns true if the underlying data is blinded. -func (e executionPayloadHeaderElectra) IsBlinded() bool { - return true -} - -// executionPayloadElectra is a convenience wrapper around a beacon block body's execution payload data structure -// This wrapper allows us to conform to a common interface so that beacon -// blocks for future forks can also be applied across Prysm without issues. -type executionPayloadElectra struct { - p *enginev1.ExecutionPayloadElectra -} - -// WrappedExecutionPayloadElectra is a constructor which wraps a protobuf execution payload into an interface. -func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra) (interfaces.ExecutionData, error) { - w := executionPayloadElectra{p: p} - if w.IsNil() { - return nil, consensus_types.ErrNilObjectWrapped - } - return w, nil -} - -var _ interfaces.ExecutionData = &executionPayloadElectra{} - -// IsNil checks if the underlying data is nil. -func (e executionPayloadElectra) IsNil() bool { - return e.p == nil -} - -// MarshalSSZ -- -func (e executionPayloadElectra) MarshalSSZ() ([]byte, error) { - return e.p.MarshalSSZ() -} - -// MarshalSSZTo -- -func (e executionPayloadElectra) MarshalSSZTo(dst []byte) ([]byte, error) { - return e.p.MarshalSSZTo(dst) -} - -// SizeSSZ -- -func (e executionPayloadElectra) SizeSSZ() int { - return e.p.SizeSSZ() -} - -// UnmarshalSSZ -- -func (e executionPayloadElectra) UnmarshalSSZ(buf []byte) error { - return e.p.UnmarshalSSZ(buf) -} - -// HashTreeRoot -- -func (e executionPayloadElectra) HashTreeRoot() ([32]byte, error) { - return e.p.HashTreeRoot() -} - -// HashTreeRootWith -- -func (e executionPayloadElectra) HashTreeRootWith(hh *fastssz.Hasher) error { - return e.p.HashTreeRootWith(hh) -} - -// Proto -- -func (e executionPayloadElectra) Proto() proto.Message { - return e.p -} - -// ParentHash -- -func (e executionPayloadElectra) ParentHash() []byte { - return e.p.ParentHash -} - -// FeeRecipient -- -func (e executionPayloadElectra) FeeRecipient() []byte { - return e.p.FeeRecipient -} - -// StateRoot -- -func (e executionPayloadElectra) StateRoot() []byte { - return e.p.StateRoot -} - -// ReceiptsRoot -- -func (e executionPayloadElectra) ReceiptsRoot() []byte { - return e.p.ReceiptsRoot -} - -// LogsBloom -- -func (e executionPayloadElectra) LogsBloom() []byte { - return e.p.LogsBloom -} - -// PrevRandao -- -func (e executionPayloadElectra) PrevRandao() []byte { - return e.p.PrevRandao -} - -// BlockNumber -- -func (e executionPayloadElectra) BlockNumber() uint64 { - return e.p.BlockNumber -} - -// GasLimit -- -func (e executionPayloadElectra) GasLimit() uint64 { - return e.p.GasLimit -} - -// GasUsed -- -func (e executionPayloadElectra) GasUsed() uint64 { - return e.p.GasUsed -} - -// Timestamp -- -func (e executionPayloadElectra) Timestamp() uint64 { - return e.p.Timestamp -} - -// ExtraData -- -func (e executionPayloadElectra) ExtraData() []byte { - return e.p.ExtraData -} - -// BaseFeePerGas -- -func (e executionPayloadElectra) BaseFeePerGas() []byte { - return e.p.BaseFeePerGas -} - -// BlockHash -- -func (e executionPayloadElectra) BlockHash() []byte { - return e.p.BlockHash -} - -// Transactions -- -func (e executionPayloadElectra) Transactions() ([][]byte, error) { - return e.p.Transactions, nil -} - -// TransactionsRoot -- -func (e executionPayloadElectra) TransactionsRoot() ([]byte, error) { - return nil, consensus_types.ErrUnsupportedField -} - -// Withdrawals -- -func (e executionPayloadElectra) Withdrawals() ([]*enginev1.Withdrawal, error) { - return e.p.Withdrawals, nil -} - -// WithdrawalsRoot -- -func (e executionPayloadElectra) WithdrawalsRoot() ([]byte, error) { - return nil, consensus_types.ErrUnsupportedField -} - -func (e executionPayloadElectra) BlobGasUsed() (uint64, error) { - return e.p.BlobGasUsed, nil -} - -func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { - return e.p.ExcessBlobGas, nil -} - -// DepositRequests -- -func (e executionPayloadElectra) DepositRequests() []*enginev1.DepositRequest { - return e.p.DepositRequests -} - -// WithdrawalRequests -- -func (e executionPayloadElectra) WithdrawalRequests() []*enginev1.WithdrawalRequest { - return e.p.WithdrawalRequests -} - -// ConsolidationRequests -- -func (e executionPayloadElectra) ConsolidationRequests() []*enginev1.ConsolidationRequest { - return e.p.ConsolidationRequests -} - -// IsBlinded returns true if the underlying data is blinded. -func (e executionPayloadElectra) IsBlinded() bool { - return false -} diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index 2de69c0c03be..37aa22a410dc 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -238,6 +238,46 @@ func BuildSignedBeaconBlock(blk interfaces.ReadOnlyBeaconBlock, signature []byte } } +func getWrappedPayload(payload interface{}) (wrappedPayload interfaces.ExecutionData, wrapErr error) { + switch p := payload.(type) { + case *enginev1.ExecutionPayload: + wrappedPayload, wrapErr = WrappedExecutionPayload(p) + case *enginev1.ExecutionPayloadCapella: + wrappedPayload, wrapErr = WrappedExecutionPayloadCapella(p) + case *enginev1.ExecutionPayloadDeneb: + wrappedPayload, wrapErr = WrappedExecutionPayloadDeneb(p) + default: + wrappedPayload, wrapErr = nil, fmt.Errorf("%T is not a type of execution payload", p) + } + return wrappedPayload, wrapErr +} + +func checkPayloadAgainstHeader(wrappedPayload, payloadHeader interfaces.ExecutionData) error { + empty, err := IsEmptyExecutionData(wrappedPayload) + if err != nil { + return err + } + if empty { + return nil + } + payloadRoot, err := wrappedPayload.HashTreeRoot() + if err != nil { + return errors.Wrap(err, "could not hash tree root execution payload") + } + payloadHeaderRoot, err := payloadHeader.HashTreeRoot() + if err != nil { + return errors.Wrap(err, "could not hash tree root payload header") + } + if payloadRoot != payloadHeaderRoot { + return fmt.Errorf( + "payload %#x and header %#x roots do not match", + payloadRoot, + payloadHeaderRoot, + ) + } + return nil +} + // BuildSignedBeaconBlockFromExecutionPayload takes a signed, blinded beacon block and converts into // a full, signed beacon block by specifying an execution payload. func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBeaconBlock, payload interface{}) (interfaces.SignedBeaconBlock, error) { // nolint:gocognit @@ -253,43 +293,12 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea return nil, errors.Wrap(err, "could not get execution payload header") } - var wrappedPayload interfaces.ExecutionData - var wrapErr error - switch p := payload.(type) { - case *enginev1.ExecutionPayload: - wrappedPayload, wrapErr = WrappedExecutionPayload(p) - case *enginev1.ExecutionPayloadCapella: - wrappedPayload, wrapErr = WrappedExecutionPayloadCapella(p) - case *enginev1.ExecutionPayloadDeneb: - wrappedPayload, wrapErr = WrappedExecutionPayloadDeneb(p) - case *enginev1.ExecutionPayloadElectra: - wrappedPayload, wrapErr = WrappedExecutionPayloadElectra(p) - default: - return nil, fmt.Errorf("%T is not a type of execution payload", p) - } - if wrapErr != nil { - return nil, wrapErr - } - empty, err := IsEmptyExecutionData(wrappedPayload) + wrappedPayload, err := getWrappedPayload(payload) if err != nil { return nil, err } - if !empty { - payloadRoot, err := wrappedPayload.HashTreeRoot() - if err != nil { - return nil, errors.Wrap(err, "could not hash tree root execution payload") - } - payloadHeaderRoot, err := payloadHeader.HashTreeRoot() - if err != nil { - return nil, errors.Wrap(err, "could not hash tree root payload header") - } - if payloadRoot != payloadHeaderRoot { - return nil, fmt.Errorf( - "payload %#x and header %#x roots do not match", - payloadRoot, - payloadHeaderRoot, - ) - } + if err := checkPayloadAgainstHeader(wrappedPayload, payloadHeader); err != nil { + return nil, err } syncAgg, err := b.Body().SyncAggregate() if err != nil { @@ -302,8 +311,12 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea sig := blk.Signature() var fullBlock interface{} - switch p := payload.(type) { - case *enginev1.ExecutionPayload: + switch blk.Version() { + case version.Bellatrix: + p, ok := payload.(*enginev1.ExecutionPayload) + if !ok { + return nil, errors.New("payload not of Bellatrix type") + } var atts []*eth.Attestation if b.Body().Attestations() != nil { atts = make([]*eth.Attestation, len(b.Body().Attestations())) @@ -347,7 +360,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea }, Signature: sig[:], } - case *enginev1.ExecutionPayloadCapella: + case version.Capella: + p, ok := payload.(*enginev1.ExecutionPayloadCapella) + if !ok { + return nil, errors.New("payload not of Capella type") + } blsToExecutionChanges, err := b.Body().BLSToExecutionChanges() if err != nil { return nil, err @@ -396,7 +413,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea }, Signature: sig[:], } - case *enginev1.ExecutionPayloadDeneb: + case version.Deneb: + p, ok := payload.(*enginev1.ExecutionPayloadDeneb) + if !ok { + return nil, errors.New("payload not of Deneb type") + } blsToExecutionChanges, err := b.Body().BLSToExecutionChanges() if err != nil { return nil, err @@ -450,7 +471,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea }, Signature: sig[:], } - case *enginev1.ExecutionPayloadElectra: + case version.Electra: + p, ok := payload.(*enginev1.ExecutionPayloadElectra) + if !ok { + return nil, errors.New("payload not of Electra type") + } blsToExecutionChanges, err := b.Body().BLSToExecutionChanges() if err != nil { return nil, err @@ -481,6 +506,12 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea attSlashings[i] = s } } + + er, err := b.Body().ExecutionRequests() + if err != nil { + return nil, err + } + fullBlock = ð.SignedBeaconBlockElectra{ Block: ð.BeaconBlockElectra{ Slot: b.Slot(), @@ -500,12 +531,13 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea ExecutionPayload: p, BlsToExecutionChanges: blsToExecutionChanges, BlobKzgCommitments: commitments, + ExecutionRequests: er, }, }, Signature: sig[:], } default: - return nil, fmt.Errorf("%T is not a type of execution payload", p) + return nil, errors.New("Block not of known type") } return NewSignedBeaconBlock(fullBlock) diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index eda1a420017d..4aef3478baef 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -152,6 +152,42 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e return nil, err } + if b.version >= version.Electra { + p, ok := payload.Proto().(*enginev1.ExecutionPayloadElectra) + if !ok { + return nil, fmt.Errorf("%T is not an execution payload header of Deneb version", p) + } + header, err := PayloadToHeaderElectra(payload) + if err != nil { + return nil, err + } + return initBlindedSignedBlockFromProtoElectra( + ð.SignedBlindedBeaconBlockElectra{ + Message: ð.BlindedBeaconBlockElectra{ + Slot: b.block.slot, + ProposerIndex: b.block.proposerIndex, + ParentRoot: b.block.parentRoot[:], + StateRoot: b.block.stateRoot[:], + Body: ð.BlindedBeaconBlockBodyElectra{ + 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[:], + }) + } + switch p := payload.Proto().(type) { case *enginev1.ExecutionPayload: header, err := PayloadToHeader(payload) @@ -237,39 +273,6 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e }, Signature: b.signature[:], }) - case *enginev1.ExecutionPayloadElectra: - pe, ok := payload.(interfaces.ExecutionDataElectra) - if !ok { - return nil, interfaces.ErrIncompatibleFork - } - header, err := PayloadToHeaderElectra(pe) - if err != nil { - return nil, err - } - return initBlindedSignedBlockFromProtoElectra( - ð.SignedBlindedBeaconBlockElectra{ - Message: ð.BlindedBeaconBlockElectra{ - Slot: b.block.slot, - ProposerIndex: b.block.proposerIndex, - ParentRoot: b.block.parentRoot[:], - StateRoot: b.block.stateRoot[:], - Body: ð.BlindedBeaconBlockBodyElectra{ - 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, - }, - }, - Signature: b.signature[:], - }) default: return nil, fmt.Errorf("%T is not an execution payload header", p) } @@ -1110,6 +1113,14 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { } } +// ExecutionRequests returns the execution requests +func (b *BeaconBlockBody) ExecutionRequests() (*enginev1.ExecutionRequests, error) { + if b.version < version.Electra { + return nil, consensus_types.ErrNotSupported("ExecutionRequests", b.version) + } + return b.executionRequests, nil +} + // Version returns the version of the beacon block body func (b *BeaconBlockBody) Version() int { return b.version diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index 22249ba54218..6be8940e7b6f 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -614,26 +614,22 @@ func hydrateBeaconBlockBodyElectra() *eth.BeaconBlockBodyElectra { SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), }, ExecutionPayload: &pb.ExecutionPayloadElectra{ - ParentHash: make([]byte, fieldparams.RootLength), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, fieldparams.RootLength), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, fieldparams.RootLength), - BlockHash: make([]byte, fieldparams.RootLength), - Transactions: make([][]byte, 0), - Withdrawals: make([]*pb.Withdrawal, 0), - DepositRequests: make([]*pb.DepositRequest, 0), - WithdrawalRequests: make([]*pb.WithdrawalRequest, 0), - ConsolidationRequests: make([]*pb.ConsolidationRequest, 0), + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*pb.Withdrawal, 0), + }, + ExecutionRequests: &pb.ExecutionRequests{ + Deposits: make([]*pb.DepositRequest, 0), + Withdrawals: make([]*pb.WithdrawalRequest, 0), + Consolidations: make([]*pb.ConsolidationRequest, 0), }, } } - -func TestPreElectraFailsInterfaceAssertion(t *testing.T) { - var epd interfaces.ExecutionData = &executionPayloadDeneb{} - _, ok := epd.(interfaces.ExecutionDataElectra) - require.Equal(t, false, ok) -} diff --git a/consensus-types/blocks/kzg.go b/consensus-types/blocks/kzg.go index b5e2800bf702..e33d4dd7e034 100644 --- a/consensus-types/blocks/kzg.go +++ b/consensus-types/blocks/kzg.go @@ -12,7 +12,7 @@ import ( ) const ( - bodyLength = 12 // The number of elements in the BeaconBlockBody Container + bodyLength = 13 // The number of elements in the BeaconBlockBody Container for Electra logBodyLength = 4 // The log 2 of bodyLength kzgPosition = 11 // The index of the KZG commitment list in the Body kzgRootIndex = 54 // The Merkle index of the KZG commitment list's root in the Body's Merkle tree @@ -229,5 +229,18 @@ func topLevelRoots(body interfaces.ReadOnlyBeaconBlockBody) ([][]byte, error) { copy(layer[10], root[:]) // KZG commitments is not needed + + // Execution requests + if body.Version() >= version.Electra { + er, err := body.ExecutionRequests() + if err != nil { + return nil, err + } + root, err = er.HashTreeRoot() + if err != nil { + return nil, err + } + copy(layer[12], root[:]) + } return layer, nil } diff --git a/consensus-types/blocks/proofs.go b/consensus-types/blocks/proofs.go index 362f748b2081..19d399a9c9b4 100644 --- a/consensus-types/blocks/proofs.go +++ b/consensus-types/blocks/proofs.go @@ -42,7 +42,7 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) case version.Deneb: fieldRoots = make([][]byte, 12) case version.Electra: - fieldRoots = make([][]byte, 12) + fieldRoots = make([][]byte, 13) default: return nil, fmt.Errorf("unknown block body version %s", version.String(blockBody.version)) } @@ -179,6 +179,18 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) copy(fieldRoots[11], root[:]) } + if blockBody.version >= version.Electra { + // Execution Requests + er, err := blockBody.ExecutionRequests() + if err != nil { + return nil, err + } + root, err := er.HashTreeRoot() + if err != nil { + return nil, err + } + copy(fieldRoots[12], root[:]) + } return fieldRoots, nil } diff --git a/consensus-types/blocks/proto.go b/consensus-types/blocks/proto.go index 4704c08ed4e0..1cb29d535e2d 100644 --- a/consensus-types/blocks/proto.go +++ b/consensus-types/blocks/proto.go @@ -531,6 +531,7 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) { ExecutionPayloadHeader: ph, BlsToExecutionChanges: b.blsToExecutionChanges, BlobKzgCommitments: b.blobKzgCommitments, + ExecutionRequests: b.executionRequests, }, nil } var p *enginev1.ExecutionPayloadElectra @@ -554,6 +555,7 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) { ExecutionPayload: p, BlsToExecutionChanges: b.blsToExecutionChanges, BlobKzgCommitments: b.blobKzgCommitments, + ExecutionRequests: b.executionRequests, }, nil default: @@ -1142,6 +1144,10 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } + er := pb.ExecutionRequests + if er == nil { + er = &enginev1.ExecutionRequests{} + } b := &BeaconBlockBody{ version: version.Electra, randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), @@ -1156,6 +1162,7 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock executionPayload: p, blsToExecutionChanges: pb.BlsToExecutionChanges, blobKzgCommitments: pb.BlobKzgCommitments, + executionRequests: er, } return b, nil } @@ -1170,6 +1177,10 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { return nil, err } + er := pb.ExecutionRequests + if er == nil { + er = &enginev1.ExecutionRequests{} + } b := &BeaconBlockBody{ version: version.Electra, randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), @@ -1184,6 +1195,7 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) executionPayloadHeader: ph, blsToExecutionChanges: pb.BlsToExecutionChanges, blobKzgCommitments: pb.BlobKzgCommitments, + executionRequests: er, } return b, nil } diff --git a/consensus-types/blocks/types.go b/consensus-types/blocks/types.go index 093be45a2cd6..350fbe915437 100644 --- a/consensus-types/blocks/types.go +++ b/consensus-types/blocks/types.go @@ -5,6 +5,7 @@ import ( field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -54,6 +55,7 @@ type BeaconBlockBody struct { executionPayloadHeader interfaces.ExecutionData blsToExecutionChanges []*eth.SignedBLSToExecutionChange blobKzgCommitments [][]byte + executionRequests *enginev1.ExecutionRequests } var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{} diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 42ad27d0a459..ff3e83e61fef 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -69,6 +69,7 @@ type ReadOnlyBeaconBlockBody interface { Execution() (ExecutionData, error) BLSToExecutionChanges() ([]*ethpb.SignedBLSToExecutionChange, error) BlobKzgCommitments() ([][]byte, error) + ExecutionRequests() (*enginev1.ExecutionRequests, error) } type SignedBeaconBlock interface { @@ -122,10 +123,3 @@ type ExecutionData interface { Withdrawals() ([]*enginev1.Withdrawal, error) WithdrawalsRoot() ([]byte, error) } - -type ExecutionDataElectra interface { - ExecutionData - DepositRequests() []*enginev1.DepositRequest - WithdrawalRequests() []*enginev1.WithdrawalRequest - ConsolidationRequests() []*enginev1.ConsolidationRequest -} diff --git a/consensus-types/mock/BUILD.bazel b/consensus-types/mock/BUILD.bazel index 08384eb05fcf..e7ce82febd6f 100644 --- a/consensus-types/mock/BUILD.bazel +++ b/consensus-types/mock/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "//config/fieldparams:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library", diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index dade8e41c734..9b855644a6dc 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -5,6 +5,7 @@ import ( field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" @@ -273,6 +274,10 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { panic("implement me") } +func (b *BeaconBlockBody) ExecutionRequests() (*enginev1.ExecutionRequests, error) { + panic("implement me") +} + func (b *BeaconBlockBody) Attestations() []eth.Att { panic("implement me") } diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index a7c1615015f8..f496c41b1814 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -42,14 +42,13 @@ ssz_gen_marshal( "ExecutionPayloadHeaderCapella", "ExecutionPayloadHeaderDeneb", "ExecutionPayloadDeneb", - "ExecutionPayloadHeaderElectra", - "ExecutionPayloadElectra", "BlindedBlobsBundle", "BlobsBundle", "Withdrawal", "WithdrawalRequest", "DepositRequest", "ConsolidationRequest", + "ExecutionRequests", ], ) @@ -75,6 +74,7 @@ go_proto_library( go_library( name = "go_default_library", srcs = [ + "electra.go", "execution_engine.go", "json_marshal_unmarshal.go", ":ssz_generated_files", # keep @@ -111,6 +111,7 @@ ssz_proto_files( name = "ssz_proto_files", srcs = [ "execution_engine.proto", + "electra.proto", ], config = select({ "//conditions:default": "mainnet", diff --git a/proto/engine/v1/electra.go b/proto/engine/v1/electra.go new file mode 100644 index 000000000000..386cce1bfe16 --- /dev/null +++ b/proto/engine/v1/electra.go @@ -0,0 +1,4 @@ +package enginev1 + +type ExecutionPayloadElectra = ExecutionPayloadDeneb +type ExecutionPayloadHeaderElectra = ExecutionPayloadHeaderDeneb diff --git a/proto/engine/v1/electra.pb.go b/proto/engine/v1/electra.pb.go new file mode 100755 index 000000000000..a23e9a678154 --- /dev/null +++ b/proto/engine/v1/electra.pb.go @@ -0,0 +1,464 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.1 +// source: proto/engine/v1/electra.proto + +package enginev1 + +import ( + reflect "reflect" + sync "sync" + + _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type WithdrawalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress []byte `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" ssz-size:"20"` + ValidatorPubkey []byte `protobuf:"bytes,2,opt,name=validator_pubkey,json=validatorPubkey,proto3" json:"validator_pubkey,omitempty" ssz-size:"48"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *WithdrawalRequest) Reset() { + *x = WithdrawalRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_electra_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawalRequest) ProtoMessage() {} + +func (x *WithdrawalRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_electra_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawalRequest.ProtoReflect.Descriptor instead. +func (*WithdrawalRequest) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_electra_proto_rawDescGZIP(), []int{0} +} + +func (x *WithdrawalRequest) GetSourceAddress() []byte { + if x != nil { + return x.SourceAddress + } + return nil +} + +func (x *WithdrawalRequest) GetValidatorPubkey() []byte { + if x != nil { + return x.ValidatorPubkey + } + return nil +} + +func (x *WithdrawalRequest) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +type DepositRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` + WithdrawalCredentials []byte `protobuf:"bytes,2,opt,name=withdrawal_credentials,json=withdrawalCredentials,proto3" json:"withdrawal_credentials,omitempty" ssz-size:"32"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` + Index uint64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *DepositRequest) Reset() { + *x = DepositRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_electra_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DepositRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DepositRequest) ProtoMessage() {} + +func (x *DepositRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_electra_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DepositRequest.ProtoReflect.Descriptor instead. +func (*DepositRequest) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_electra_proto_rawDescGZIP(), []int{1} +} + +func (x *DepositRequest) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +func (x *DepositRequest) GetWithdrawalCredentials() []byte { + if x != nil { + return x.WithdrawalCredentials + } + return nil +} + +func (x *DepositRequest) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *DepositRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *DepositRequest) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + +type ConsolidationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress []byte `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" ssz-size:"20"` + SourcePubkey []byte `protobuf:"bytes,2,opt,name=source_pubkey,json=sourcePubkey,proto3" json:"source_pubkey,omitempty" ssz-size:"48"` + TargetPubkey []byte `protobuf:"bytes,3,opt,name=target_pubkey,json=targetPubkey,proto3" json:"target_pubkey,omitempty" ssz-size:"48"` +} + +func (x *ConsolidationRequest) Reset() { + *x = ConsolidationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_electra_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConsolidationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsolidationRequest) ProtoMessage() {} + +func (x *ConsolidationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_electra_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConsolidationRequest.ProtoReflect.Descriptor instead. +func (*ConsolidationRequest) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_electra_proto_rawDescGZIP(), []int{2} +} + +func (x *ConsolidationRequest) GetSourceAddress() []byte { + if x != nil { + return x.SourceAddress + } + return nil +} + +func (x *ConsolidationRequest) GetSourcePubkey() []byte { + if x != nil { + return x.SourcePubkey + } + return nil +} + +func (x *ConsolidationRequest) GetTargetPubkey() []byte { + if x != nil { + return x.TargetPubkey + } + return nil +} + +type ExecutionRequests struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deposits []*DepositRequest `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty" ssz-max:"8192"` + Withdrawals []*WithdrawalRequest `protobuf:"bytes,2,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` + Consolidations []*ConsolidationRequest `protobuf:"bytes,3,rep,name=consolidations,proto3" json:"consolidations,omitempty" ssz-max:"1"` +} + +func (x *ExecutionRequests) Reset() { + *x = ExecutionRequests{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_electra_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecutionRequests) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionRequests) ProtoMessage() {} + +func (x *ExecutionRequests) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_electra_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionRequests.ProtoReflect.Descriptor instead. +func (*ExecutionRequests) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_electra_proto_rawDescGZIP(), []int{3} +} + +func (x *ExecutionRequests) GetDeposits() []*DepositRequest { + if x != nil { + return x.Deposits + } + return nil +} + +func (x *ExecutionRequests) GetWithdrawals() []*WithdrawalRequest { + if x != nil { + return x.Withdrawals + } + return nil +} + +func (x *ExecutionRequests) GetConsolidations() []*ConsolidationRequest { + if x != nil { + return x.Consolidations + } + return nil +} + +var File_proto_engine_v1_electra_proto protoreflect.FileDescriptor + +var file_proto_engine_v1_electra_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x12, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, + 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x73, 0x6f, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2d, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, + 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, + 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0c, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x0d, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x87, 0x02, 0x0a, 0x11, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x48, + 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x08, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x57, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x31, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x42, 0x8e, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_engine_v1_electra_proto_rawDescOnce sync.Once + file_proto_engine_v1_electra_proto_rawDescData = file_proto_engine_v1_electra_proto_rawDesc +) + +func file_proto_engine_v1_electra_proto_rawDescGZIP() []byte { + file_proto_engine_v1_electra_proto_rawDescOnce.Do(func() { + file_proto_engine_v1_electra_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_engine_v1_electra_proto_rawDescData) + }) + return file_proto_engine_v1_electra_proto_rawDescData +} + +var file_proto_engine_v1_electra_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_proto_engine_v1_electra_proto_goTypes = []interface{}{ + (*WithdrawalRequest)(nil), // 0: ethereum.engine.v1.WithdrawalRequest + (*DepositRequest)(nil), // 1: ethereum.engine.v1.DepositRequest + (*ConsolidationRequest)(nil), // 2: ethereum.engine.v1.ConsolidationRequest + (*ExecutionRequests)(nil), // 3: ethereum.engine.v1.ExecutionRequests +} +var file_proto_engine_v1_electra_proto_depIdxs = []int32{ + 1, // 0: ethereum.engine.v1.ExecutionRequests.deposits:type_name -> ethereum.engine.v1.DepositRequest + 0, // 1: ethereum.engine.v1.ExecutionRequests.withdrawals:type_name -> ethereum.engine.v1.WithdrawalRequest + 2, // 2: ethereum.engine.v1.ExecutionRequests.consolidations:type_name -> ethereum.engine.v1.ConsolidationRequest + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_proto_engine_v1_electra_proto_init() } +func file_proto_engine_v1_electra_proto_init() { + if File_proto_engine_v1_electra_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_engine_v1_electra_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawalRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_electra_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DepositRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_electra_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsolidationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_engine_v1_electra_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExecutionRequests); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_engine_v1_electra_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_engine_v1_electra_proto_goTypes, + DependencyIndexes: file_proto_engine_v1_electra_proto_depIdxs, + MessageInfos: file_proto_engine_v1_electra_proto_msgTypes, + }.Build() + File_proto_engine_v1_electra_proto = out.File + file_proto_engine_v1_electra_proto_rawDesc = nil + file_proto_engine_v1_electra_proto_goTypes = nil + file_proto_engine_v1_electra_proto_depIdxs = nil +} diff --git a/proto/engine/v1/electra.proto b/proto/engine/v1/electra.proto new file mode 100644 index 000000000000..5b77f682d475 --- /dev/null +++ b/proto/engine/v1/electra.proto @@ -0,0 +1,66 @@ +// Copyright 2024 Prysmatic Labs. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package ethereum.engine.v1; + +import "proto/eth/ext/options.proto"; + +option csharp_namespace = "Ethereum.Engine.V1"; +option go_package = "github.com/prysmaticlabs/prysm/v5/proto/engine/v1;enginev1"; +option java_multiple_files = true; +option java_outer_classname = "ElectraProto"; +option java_package = "org.ethereum.engine.v1"; +option php_namespace = "Ethereum\\Engine\\v1"; + +// WithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address +// new in Electra +message WithdrawalRequest { + // The execution address receiving the funds + bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; + + // 48 byte BLS public key of the validator. + bytes validator_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; + + // Deposit amount in gwei. + uint64 amount = 3; +} + +// DepositRequest is the message from the execution layer to trigger the deposit of a validator's balance to its balance +// new in Electra +message DepositRequest { + bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"]; + bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 amount = 3; + bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"]; + uint64 index = 5; +} + +// ConsolidationRequest is the message from the execution layer to trigger the consolidation of one +// validator to another validator. +message ConsolidationRequest { + // Source address of account which originated the request. + bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; + // Funds will be moved from this public key. + bytes source_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; + // Funds will be moved to this public key. + bytes target_pubkey = 3 [(ethereum.eth.ext.ssz_size) = "48"]; +} + +// ExecutionRequests is a container that contains all the requests from the execution layer to be included in a block +message ExecutionRequests { + repeated DepositRequest deposits = 1 [(ethereum.eth.ext.ssz_max) = "max_deposit_requests_per_payload.size"]; + repeated WithdrawalRequest withdrawals = 2 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; + repeated ConsolidationRequest consolidations = 3 [(ethereum.eth.ext.ssz_max) = "max_consolidation_requests_per_payload.size"]; +} diff --git a/proto/engine/v1/engine.ssz.go b/proto/engine/v1/engine.ssz.go index 0f5488b9bbc2..010bcef6856f 100644 --- a/proto/engine/v1/engine.ssz.go +++ b/proto/engine/v1/engine.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: d1cee811bee5b5cfcedf5be00dfff21d5e6caf432cd8fc42f551264f7b8e296c +// Hash: 8a6de344d09e1816df88ecbd15d95382cdc9872ebae99c397396da1ed2c83688 package enginev1 import ( @@ -7,409 +7,570 @@ import ( github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) -// MarshalSSZ ssz marshals the ExecutionPayload object -func (e *ExecutionPayload) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) +// MarshalSSZ ssz marshals the WithdrawalRequest object +func (w *WithdrawalRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(w) } -// MarshalSSZTo ssz marshals the ExecutionPayload object to a target array -func (e *ExecutionPayload) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the WithdrawalRequest object to a target array +func (w *WithdrawalRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(508) - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + // Field (0) 'SourceAddress' + if size := len(w.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) return } - dst = append(dst, e.ParentHash...) + dst = append(dst, w.SourceAddress...) - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + // Field (1) 'ValidatorPubkey' + if size := len(w.ValidatorPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) return } - dst = append(dst, e.FeeRecipient...) + dst = append(dst, w.ValidatorPubkey...) - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, e.StateRoot...) + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, w.Amount) - // Field (3) 'ReceiptsRoot' - if size := len(e.ReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) - return + return +} + +// UnmarshalSSZ ssz unmarshals the WithdrawalRequest object +func (w *WithdrawalRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 76 { + return ssz.ErrSize } - dst = append(dst, e.ReceiptsRoot...) - // Field (4) 'LogsBloom' - if size := len(e.LogsBloom); size != 256 { - err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) - return + // Field (0) 'SourceAddress' + if cap(w.SourceAddress) == 0 { + w.SourceAddress = make([]byte, 0, len(buf[0:20])) } - dst = append(dst, e.LogsBloom...) + w.SourceAddress = append(w.SourceAddress, buf[0:20]...) - // Field (5) 'PrevRandao' - if size := len(e.PrevRandao); size != 32 { - err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) - return + // Field (1) 'ValidatorPubkey' + if cap(w.ValidatorPubkey) == 0 { + w.ValidatorPubkey = make([]byte, 0, len(buf[20:68])) } - dst = append(dst, e.PrevRandao...) + w.ValidatorPubkey = append(w.ValidatorPubkey, buf[20:68]...) - // Field (6) 'BlockNumber' - dst = ssz.MarshalUint64(dst, e.BlockNumber) + // Field (2) 'Amount' + w.Amount = ssz.UnmarshallUint64(buf[68:76]) - // Field (7) 'GasLimit' - dst = ssz.MarshalUint64(dst, e.GasLimit) + return err +} - // Field (8) 'GasUsed' - dst = ssz.MarshalUint64(dst, e.GasUsed) +// SizeSSZ returns the ssz encoded size in bytes for the WithdrawalRequest object +func (w *WithdrawalRequest) SizeSSZ() (size int) { + size = 76 + return +} - // Field (9) 'Timestamp' - dst = ssz.MarshalUint64(dst, e.Timestamp) +// HashTreeRoot ssz hashes the WithdrawalRequest object +func (w *WithdrawalRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(w) +} - // Offset (10) 'ExtraData' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.ExtraData) +// HashTreeRootWith ssz hashes the WithdrawalRequest object with a hasher +func (w *WithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() - // Field (11) 'BaseFeePerGas' - if size := len(e.BaseFeePerGas); size != 32 { - err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + // Field (0) 'SourceAddress' + if size := len(w.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) return } - dst = append(dst, e.BaseFeePerGas...) + hh.PutBytes(w.SourceAddress) - // Field (12) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + // Field (1) 'ValidatorPubkey' + if size := len(w.ValidatorPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) return } - dst = append(dst, e.BlockHash...) + hh.PutBytes(w.ValidatorPubkey) - // Offset (13) 'Transactions' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(e.Transactions); ii++ { - offset += 4 - offset += len(e.Transactions[ii]) - } + // Field (2) 'Amount' + hh.PutUint64(w.Amount) - // Field (10) 'ExtraData' - if size := len(e.ExtraData); size > 32 { - err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the DepositRequest object +func (d *DepositRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DepositRequest object to a target array +func (d *DepositRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Pubkey' + if size := len(d.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } - dst = append(dst, e.ExtraData...) + dst = append(dst, d.Pubkey...) - // Field (13) 'Transactions' - if size := len(e.Transactions); size > 1048576 { - err = ssz.ErrListTooBigFn("--.Transactions", size, 1048576) + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } - { - offset = 4 * len(e.Transactions) - for ii := 0; ii < len(e.Transactions); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += len(e.Transactions[ii]) - } - } - for ii := 0; ii < len(e.Transactions); ii++ { - if size := len(e.Transactions[ii]); size > 1073741824 { - err = ssz.ErrBytesLengthFn("--.Transactions[ii]", size, 1073741824) - return - } - dst = append(dst, e.Transactions[ii]...) + dst = append(dst, d.WithdrawalCredentials...) + + // Field (2) 'Amount' + dst = ssz.MarshalUint64(dst, d.Amount) + + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return } + dst = append(dst, d.Signature...) + + // Field (4) 'Index' + dst = ssz.MarshalUint64(dst, d.Index) return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayload object -func (e *ExecutionPayload) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the DepositRequest object +func (d *DepositRequest) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 508 { + if size != 192 { return ssz.ErrSize } - tail := buf - var o10, o13 uint64 - - // Field (0) 'ParentHash' - if cap(e.ParentHash) == 0 { - e.ParentHash = make([]byte, 0, len(buf[0:32])) - } - e.ParentHash = append(e.ParentHash, buf[0:32]...) - - // Field (1) 'FeeRecipient' - if cap(e.FeeRecipient) == 0 { - e.FeeRecipient = make([]byte, 0, len(buf[32:52])) + // Field (0) 'Pubkey' + if cap(d.Pubkey) == 0 { + d.Pubkey = make([]byte, 0, len(buf[0:48])) } - e.FeeRecipient = append(e.FeeRecipient, buf[32:52]...) + d.Pubkey = append(d.Pubkey, buf[0:48]...) - // Field (2) 'StateRoot' - if cap(e.StateRoot) == 0 { - e.StateRoot = make([]byte, 0, len(buf[52:84])) + // Field (1) 'WithdrawalCredentials' + if cap(d.WithdrawalCredentials) == 0 { + d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) } - e.StateRoot = append(e.StateRoot, buf[52:84]...) + d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - // Field (3) 'ReceiptsRoot' - if cap(e.ReceiptsRoot) == 0 { - e.ReceiptsRoot = make([]byte, 0, len(buf[84:116])) - } - e.ReceiptsRoot = append(e.ReceiptsRoot, buf[84:116]...) + // Field (2) 'Amount' + d.Amount = ssz.UnmarshallUint64(buf[80:88]) - // Field (4) 'LogsBloom' - if cap(e.LogsBloom) == 0 { - e.LogsBloom = make([]byte, 0, len(buf[116:372])) + // Field (3) 'Signature' + if cap(d.Signature) == 0 { + d.Signature = make([]byte, 0, len(buf[88:184])) } - e.LogsBloom = append(e.LogsBloom, buf[116:372]...) + d.Signature = append(d.Signature, buf[88:184]...) - // Field (5) 'PrevRandao' - if cap(e.PrevRandao) == 0 { - e.PrevRandao = make([]byte, 0, len(buf[372:404])) - } - e.PrevRandao = append(e.PrevRandao, buf[372:404]...) + // Field (4) 'Index' + d.Index = ssz.UnmarshallUint64(buf[184:192]) - // Field (6) 'BlockNumber' - e.BlockNumber = ssz.UnmarshallUint64(buf[404:412]) + return err +} - // Field (7) 'GasLimit' - e.GasLimit = ssz.UnmarshallUint64(buf[412:420]) +// SizeSSZ returns the ssz encoded size in bytes for the DepositRequest object +func (d *DepositRequest) SizeSSZ() (size int) { + size = 192 + return +} - // Field (8) 'GasUsed' - e.GasUsed = ssz.UnmarshallUint64(buf[420:428]) +// HashTreeRoot ssz hashes the DepositRequest object +func (d *DepositRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} - // Field (9) 'Timestamp' - e.Timestamp = ssz.UnmarshallUint64(buf[428:436]) +// HashTreeRootWith ssz hashes the DepositRequest object with a hasher +func (d *DepositRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() - // Offset (10) 'ExtraData' - if o10 = ssz.ReadOffset(buf[436:440]); o10 > size { - return ssz.ErrOffset + // Field (0) 'Pubkey' + if size := len(d.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return } + hh.PutBytes(d.Pubkey) - if o10 != 508 { - return ssz.ErrInvalidVariableOffset - } - - // Field (11) 'BaseFeePerGas' - if cap(e.BaseFeePerGas) == 0 { - e.BaseFeePerGas = make([]byte, 0, len(buf[440:472])) - } - e.BaseFeePerGas = append(e.BaseFeePerGas, buf[440:472]...) - - // Field (12) 'BlockHash' - if cap(e.BlockHash) == 0 { - e.BlockHash = make([]byte, 0, len(buf[472:504])) - } - e.BlockHash = append(e.BlockHash, buf[472:504]...) - - // Offset (13) 'Transactions' - if o13 = ssz.ReadOffset(buf[504:508]); o13 > size || o10 > o13 { - return ssz.ErrOffset + // Field (1) 'WithdrawalCredentials' + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) + return } + hh.PutBytes(d.WithdrawalCredentials) - // Field (10) 'ExtraData' - { - buf = tail[o10:o13] - if len(buf) > 32 { - return ssz.ErrBytesLength - } - if cap(e.ExtraData) == 0 { - e.ExtraData = make([]byte, 0, len(buf)) - } - e.ExtraData = append(e.ExtraData, buf...) - } + // Field (2) 'Amount' + hh.PutUint64(d.Amount) - // Field (13) 'Transactions' - { - buf = tail[o13:] - num, err := ssz.DecodeDynamicLength(buf, 1048576) - if err != nil { - return err - } - e.Transactions = make([][]byte, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if len(buf) > 1073741824 { - return ssz.ErrBytesLength - } - if cap(e.Transactions[indx]) == 0 { - e.Transactions[indx] = make([]byte, 0, len(buf)) - } - e.Transactions[indx] = append(e.Transactions[indx], buf...) - return nil - }) - if err != nil { - return err - } + // Field (3) 'Signature' + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayload object -func (e *ExecutionPayload) SizeSSZ() (size int) { - size = 508 - - // Field (10) 'ExtraData' - size += len(e.ExtraData) + hh.PutBytes(d.Signature) - // Field (13) 'Transactions' - for ii := 0; ii < len(e.Transactions); ii++ { - size += 4 - size += len(e.Transactions[ii]) - } + // Field (4) 'Index' + hh.PutUint64(d.Index) + hh.Merkleize(indx) return } -// HashTreeRoot ssz hashes the ExecutionPayload object -func (e *ExecutionPayload) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) +// MarshalSSZ ssz marshals the ConsolidationRequest object +func (c *ConsolidationRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(c) } -// HashTreeRootWith ssz hashes the ExecutionPayload object with a hasher -func (e *ExecutionPayload) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() +// MarshalSSZTo ssz marshals the ConsolidationRequest object to a target array +func (c *ConsolidationRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + // Field (0) 'SourceAddress' + if size := len(c.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) return } - hh.PutBytes(e.ParentHash) + dst = append(dst, c.SourceAddress...) - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + // Field (1) 'SourcePubkey' + if size := len(c.SourcePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.SourcePubkey", size, 48) return } - hh.PutBytes(e.FeeRecipient) + dst = append(dst, c.SourcePubkey...) - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + // Field (2) 'TargetPubkey' + if size := len(c.TargetPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.TargetPubkey", size, 48) return } - hh.PutBytes(e.StateRoot) + dst = append(dst, c.TargetPubkey...) - // Field (3) 'ReceiptsRoot' - if size := len(e.ReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) - return + return +} + +// UnmarshalSSZ ssz unmarshals the ConsolidationRequest object +func (c *ConsolidationRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 116 { + return ssz.ErrSize } - hh.PutBytes(e.ReceiptsRoot) - // Field (4) 'LogsBloom' - if size := len(e.LogsBloom); size != 256 { - err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) - return + // Field (0) 'SourceAddress' + if cap(c.SourceAddress) == 0 { + c.SourceAddress = make([]byte, 0, len(buf[0:20])) } - hh.PutBytes(e.LogsBloom) + c.SourceAddress = append(c.SourceAddress, buf[0:20]...) - // Field (5) 'PrevRandao' - if size := len(e.PrevRandao); size != 32 { - err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) - return + // Field (1) 'SourcePubkey' + if cap(c.SourcePubkey) == 0 { + c.SourcePubkey = make([]byte, 0, len(buf[20:68])) } - hh.PutBytes(e.PrevRandao) + c.SourcePubkey = append(c.SourcePubkey, buf[20:68]...) - // Field (6) 'BlockNumber' - hh.PutUint64(e.BlockNumber) + // Field (2) 'TargetPubkey' + if cap(c.TargetPubkey) == 0 { + c.TargetPubkey = make([]byte, 0, len(buf[68:116])) + } + c.TargetPubkey = append(c.TargetPubkey, buf[68:116]...) - // Field (7) 'GasLimit' - hh.PutUint64(e.GasLimit) + return err +} - // Field (8) 'GasUsed' - hh.PutUint64(e.GasUsed) +// SizeSSZ returns the ssz encoded size in bytes for the ConsolidationRequest object +func (c *ConsolidationRequest) SizeSSZ() (size int) { + size = 116 + return +} - // Field (9) 'Timestamp' - hh.PutUint64(e.Timestamp) +// HashTreeRoot ssz hashes the ConsolidationRequest object +func (c *ConsolidationRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(c) +} - // Field (10) 'ExtraData' - { - elemIndx := hh.Index() - byteLen := uint64(len(e.ExtraData)) - if byteLen > 32 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(e.ExtraData) - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } +// HashTreeRootWith ssz hashes the ConsolidationRequest object with a hasher +func (c *ConsolidationRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() - // Field (11) 'BaseFeePerGas' - if size := len(e.BaseFeePerGas); size != 32 { - err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + // Field (0) 'SourceAddress' + if size := len(c.SourceAddress); size != 20 { + err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) return } - hh.PutBytes(e.BaseFeePerGas) + hh.PutBytes(c.SourceAddress) - // Field (12) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + // Field (1) 'SourcePubkey' + if size := len(c.SourcePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.SourcePubkey", size, 48) return } - hh.PutBytes(e.BlockHash) + hh.PutBytes(c.SourcePubkey) - // Field (13) 'Transactions' - { - subIndx := hh.Index() - num := uint64(len(e.Transactions)) - if num > 1048576 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.Transactions { - { - elemIndx := hh.Index() - byteLen := uint64(len(elem)) - if byteLen > 1073741824 { - err = ssz.ErrIncorrectListSize - return - } - hh.AppendBytes32(elem) - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } - } - hh.MerkleizeWithMixin(subIndx, num, 1048576) + // Field (2) 'TargetPubkey' + if size := len(c.TargetPubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.TargetPubkey", size, 48) + return } + hh.PutBytes(c.TargetPubkey) hh.Merkleize(indx) return } -// MarshalSSZ ssz marshals the ExecutionPayloadCapella object -func (e *ExecutionPayloadCapella) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the ExecutionRequests object +func (e *ExecutionRequests) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(e) } -// MarshalSSZTo ssz marshals the ExecutionPayloadCapella object to a target array -func (e *ExecutionPayloadCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ExecutionRequests object to a target array +func (e *ExecutionRequests) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(512) + offset := int(12) - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - dst = append(dst, e.ParentHash...) + // Offset (0) 'Deposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.Deposits) * 192 - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + // Offset (1) 'Withdrawals' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.Withdrawals) * 76 + + // Offset (2) 'Consolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(e.Consolidations) * 116 + + // Field (0) 'Deposits' + if size := len(e.Deposits); size > 8192 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 8192) return } - dst = append(dst, e.FeeRecipient...) + for ii := 0; ii < len(e.Deposits); ii++ { + if dst, err = e.Deposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + // Field (1) 'Withdrawals' + if size := len(e.Withdrawals); size > 16 { + err = ssz.ErrListTooBigFn("--.Withdrawals", size, 16) return } - dst = append(dst, e.StateRoot...) + for ii := 0; ii < len(e.Withdrawals); ii++ { + if dst, err = e.Withdrawals[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (2) 'Consolidations' + if size := len(e.Consolidations); size > 1 { + err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) + return + } + for ii := 0; ii < len(e.Consolidations); ii++ { + if dst, err = e.Consolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the ExecutionRequests object +func (e *ExecutionRequests) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 12 { + return ssz.ErrSize + } + + tail := buf + var o0, o1, o2 uint64 + + // Offset (0) 'Deposits' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 12 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'Withdrawals' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Offset (2) 'Consolidations' + if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Field (0) 'Deposits' + { + buf = tail[o0:o1] + num, err := ssz.DivideInt2(len(buf), 192, 8192) + if err != nil { + return err + } + e.Deposits = make([]*DepositRequest, num) + for ii := 0; ii < num; ii++ { + if e.Deposits[ii] == nil { + e.Deposits[ii] = new(DepositRequest) + } + if err = e.Deposits[ii].UnmarshalSSZ(buf[ii*192 : (ii+1)*192]); err != nil { + return err + } + } + } + + // Field (1) 'Withdrawals' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 76, 16) + if err != nil { + return err + } + e.Withdrawals = make([]*WithdrawalRequest, num) + for ii := 0; ii < num; ii++ { + if e.Withdrawals[ii] == nil { + e.Withdrawals[ii] = new(WithdrawalRequest) + } + if err = e.Withdrawals[ii].UnmarshalSSZ(buf[ii*76 : (ii+1)*76]); err != nil { + return err + } + } + } + + // Field (2) 'Consolidations' + { + buf = tail[o2:] + num, err := ssz.DivideInt2(len(buf), 116, 1) + if err != nil { + return err + } + e.Consolidations = make([]*ConsolidationRequest, num) + for ii := 0; ii < num; ii++ { + if e.Consolidations[ii] == nil { + e.Consolidations[ii] = new(ConsolidationRequest) + } + if err = e.Consolidations[ii].UnmarshalSSZ(buf[ii*116 : (ii+1)*116]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionRequests object +func (e *ExecutionRequests) SizeSSZ() (size int) { + size = 12 + + // Field (0) 'Deposits' + size += len(e.Deposits) * 192 + + // Field (1) 'Withdrawals' + size += len(e.Withdrawals) * 76 + + // Field (2) 'Consolidations' + size += len(e.Consolidations) * 116 + + return +} + +// HashTreeRoot ssz hashes the ExecutionRequests object +func (e *ExecutionRequests) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the ExecutionRequests object with a hasher +func (e *ExecutionRequests) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Deposits' + { + subIndx := hh.Index() + num := uint64(len(e.Deposits)) + if num > 8192 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.Deposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 8192) + } + + // Field (1) 'Withdrawals' + { + subIndx := hh.Index() + num := uint64(len(e.Withdrawals)) + if num > 16 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.Withdrawals { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16) + } + + // Field (2) 'Consolidations' + { + subIndx := hh.Index() + num := uint64(len(e.Consolidations)) + if num > 1 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range e.Consolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the ExecutionPayload object +func (e *ExecutionPayload) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ExecutionPayload object to a target array +func (e *ExecutionPayload) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(508) + + // Field (0) 'ParentHash' + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) + return + } + dst = append(dst, e.ParentHash...) + + // Field (1) 'FeeRecipient' + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) + return + } + dst = append(dst, e.FeeRecipient...) + + // Field (2) 'StateRoot' + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, e.StateRoot...) // Field (3) 'ReceiptsRoot' if size := len(e.ReceiptsRoot); size != 32 { @@ -469,10 +630,6 @@ func (e *ExecutionPayloadCapella) MarshalSSZTo(buf []byte) (dst []byte, err erro offset += len(e.Transactions[ii]) } - // Offset (14) 'Withdrawals' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.Withdrawals) * 44 - // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -500,30 +657,19 @@ func (e *ExecutionPayloadCapella) MarshalSSZTo(buf []byte) (dst []byte, err erro dst = append(dst, e.Transactions[ii]...) } - // Field (14) 'Withdrawals' - if size := len(e.Withdrawals); size > 16 { - err = ssz.ErrListTooBigFn("--.Withdrawals", size, 16) - return - } - for ii := 0; ii < len(e.Withdrawals); ii++ { - if dst, err = e.Withdrawals[ii].MarshalSSZTo(dst); err != nil { - return - } - } - return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadCapella object -func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ExecutionPayload object +func (e *ExecutionPayload) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 512 { + if size < 508 { return ssz.ErrSize } tail := buf - var o10, o13, o14 uint64 + var o10, o13 uint64 // Field (0) 'ParentHash' if cap(e.ParentHash) == 0 { @@ -578,7 +724,7 @@ func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 != 512 { + if o10 != 508 { return ssz.ErrInvalidVariableOffset } @@ -599,11 +745,6 @@ func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - // Offset (14) 'Withdrawals' - if o14 = ssz.ReadOffset(buf[508:512]); o14 > size || o13 > o14 { - return ssz.ErrOffset - } - // Field (10) 'ExtraData' { buf = tail[o10:o13] @@ -618,7 +759,7 @@ func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { // Field (13) 'Transactions' { - buf = tail[o13:o14] + buf = tail[o13:] num, err := ssz.DecodeDynamicLength(buf, 1048576) if err != nil { return err @@ -638,30 +779,12 @@ func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { return err } } - - // Field (14) 'Withdrawals' - { - buf = tail[o14:] - num, err := ssz.DivideInt2(len(buf), 44, 16) - if err != nil { - return err - } - e.Withdrawals = make([]*Withdrawal, num) - for ii := 0; ii < num; ii++ { - if e.Withdrawals[ii] == nil { - e.Withdrawals[ii] = new(Withdrawal) - } - if err = e.Withdrawals[ii].UnmarshalSSZ(buf[ii*44 : (ii+1)*44]); err != nil { - return err - } - } - } return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadCapella object -func (e *ExecutionPayloadCapella) SizeSSZ() (size int) { - size = 512 +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayload object +func (e *ExecutionPayload) SizeSSZ() (size int) { + size = 508 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -672,19 +795,16 @@ func (e *ExecutionPayloadCapella) SizeSSZ() (size int) { size += len(e.Transactions[ii]) } - // Field (14) 'Withdrawals' - size += len(e.Withdrawals) * 44 - return } -// HashTreeRoot ssz hashes the ExecutionPayloadCapella object -func (e *ExecutionPayloadCapella) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the ExecutionPayload object +func (e *ExecutionPayload) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(e) } -// HashTreeRootWith ssz hashes the ExecutionPayloadCapella object with a hasher -func (e *ExecutionPayloadCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ExecutionPayload object with a hasher +func (e *ExecutionPayload) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' @@ -790,35 +910,19 @@ func (e *ExecutionPayloadCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.MerkleizeWithMixin(subIndx, num, 1048576) } - // Field (14) 'Withdrawals' - { - subIndx := hh.Index() - num := uint64(len(e.Withdrawals)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.Withdrawals { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 16) - } - hh.Merkleize(indx) return } -// MarshalSSZ ssz marshals the ExecutionPayloadDeneb object -func (e *ExecutionPayloadDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) +// MarshalSSZ ssz marshals the ExecutionPayloadCapella object +func (e *ExecutionPayloadCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) } -// MarshalSSZTo ssz marshals the ExecutionPayloadDeneb object to a target array -func (e *ExecutionPayloadDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ExecutionPayloadCapella object to a target array +func (e *ExecutionPayloadCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(528) + offset := int(512) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -903,12 +1007,6 @@ func (e *ExecutionPayloadDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) dst = ssz.WriteOffset(dst, offset) offset += len(e.Withdrawals) * 44 - // Field (15) 'BlobGasUsed' - dst = ssz.MarshalUint64(dst, e.BlobGasUsed) - - // Field (16) 'ExcessBlobGas' - dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) - // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -950,11 +1048,11 @@ func (e *ExecutionPayloadDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadDeneb object -func (e *ExecutionPayloadDeneb) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadCapella object +func (e *ExecutionPayloadCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 528 { + if size < 512 { return ssz.ErrSize } @@ -1014,7 +1112,7 @@ func (e *ExecutionPayloadDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 != 528 { + if o10 != 512 { return ssz.ErrInvalidVariableOffset } @@ -1040,12 +1138,6 @@ func (e *ExecutionPayloadDeneb) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - // Field (15) 'BlobGasUsed' - e.BlobGasUsed = ssz.UnmarshallUint64(buf[512:520]) - - // Field (16) 'ExcessBlobGas' - e.ExcessBlobGas = ssz.UnmarshallUint64(buf[520:528]) - // Field (10) 'ExtraData' { buf = tail[o10:o13] @@ -1101,9 +1193,9 @@ func (e *ExecutionPayloadDeneb) UnmarshalSSZ(buf []byte) error { return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadDeneb object -func (e *ExecutionPayloadDeneb) SizeSSZ() (size int) { - size = 528 +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadCapella object +func (e *ExecutionPayloadCapella) SizeSSZ() (size int) { + size = 512 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -1120,13 +1212,13 @@ func (e *ExecutionPayloadDeneb) SizeSSZ() (size int) { return } -// HashTreeRoot ssz hashes the ExecutionPayloadDeneb object -func (e *ExecutionPayloadDeneb) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the ExecutionPayloadCapella object +func (e *ExecutionPayloadCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(e) } -// HashTreeRootWith ssz hashes the ExecutionPayloadDeneb object with a hasher -func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ExecutionPayloadCapella object with a hasher +func (e *ExecutionPayloadCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' @@ -1248,25 +1340,19 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.MerkleizeWithMixin(subIndx, num, 16) } - // Field (15) 'BlobGasUsed' - hh.PutUint64(e.BlobGasUsed) - - // Field (16) 'ExcessBlobGas' - hh.PutUint64(e.ExcessBlobGas) - hh.Merkleize(indx) return } -// MarshalSSZ ssz marshals the ExecutionPayloadElectra object -func (e *ExecutionPayloadElectra) MarshalSSZ() ([]byte, error) { +// MarshalSSZ ssz marshals the ExecutionPayloadDeneb object +func (e *ExecutionPayloadDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(e) } -// MarshalSSZTo ssz marshals the ExecutionPayloadElectra object to a target array -func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the ExecutionPayloadDeneb object to a target array +func (e *ExecutionPayloadDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(540) + offset := int(528) // Field (0) 'ParentHash' if size := len(e.ParentHash); size != 32 { @@ -1357,18 +1443,6 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro // Field (16) 'ExcessBlobGas' dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) - // Offset (17) 'DepositRequests' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.DepositRequests) * 192 - - // Offset (18) 'WithdrawalRequests' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.WithdrawalRequests) * 76 - - // Offset (19) 'ConsolidationRequests' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.ConsolidationRequests) * 116 - // Field (10) 'ExtraData' if size := len(e.ExtraData); size > 32 { err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) @@ -1407,52 +1481,19 @@ func (e *ExecutionPayloadElectra) MarshalSSZTo(buf []byte) (dst []byte, err erro } } - // Field (17) 'DepositRequests' - if size := len(e.DepositRequests); size > 8192 { - err = ssz.ErrListTooBigFn("--.DepositRequests", size, 8192) - return - } - for ii := 0; ii < len(e.DepositRequests); ii++ { - if dst, err = e.DepositRequests[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (18) 'WithdrawalRequests' - if size := len(e.WithdrawalRequests); size > 16 { - err = ssz.ErrListTooBigFn("--.WithdrawalRequests", size, 16) - return - } - for ii := 0; ii < len(e.WithdrawalRequests); ii++ { - if dst, err = e.WithdrawalRequests[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (19) 'ConsolidationRequests' - if size := len(e.ConsolidationRequests); size > 1 { - err = ssz.ErrListTooBigFn("--.ConsolidationRequests", size, 1) - return - } - for ii := 0; ii < len(e.ConsolidationRequests); ii++ { - if dst, err = e.ConsolidationRequests[ii].MarshalSSZTo(dst); err != nil { - return - } - } - return } -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadElectra object -func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadDeneb object +func (e *ExecutionPayloadDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 540 { + if size < 528 { return ssz.ErrSize } tail := buf - var o10, o13, o14, o17, o18, o19 uint64 + var o10, o13, o14 uint64 // Field (0) 'ParentHash' if cap(e.ParentHash) == 0 { @@ -1507,7 +1548,7 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o10 != 540 { + if o10 != 528 { return ssz.ErrInvalidVariableOffset } @@ -1539,21 +1580,6 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { // Field (16) 'ExcessBlobGas' e.ExcessBlobGas = ssz.UnmarshallUint64(buf[520:528]) - // Offset (17) 'DepositRequests' - if o17 = ssz.ReadOffset(buf[528:532]); o17 > size || o14 > o17 { - return ssz.ErrOffset - } - - // Offset (18) 'WithdrawalRequests' - if o18 = ssz.ReadOffset(buf[532:536]); o18 > size || o17 > o18 { - return ssz.ErrOffset - } - - // Offset (19) 'ConsolidationRequests' - if o19 = ssz.ReadOffset(buf[536:540]); o19 > size || o18 > o19 { - return ssz.ErrOffset - } - // Field (10) 'ExtraData' { buf = tail[o10:o13] @@ -1591,7 +1617,7 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { // Field (14) 'Withdrawals' { - buf = tail[o14:o17] + buf = tail[o14:] num, err := ssz.DivideInt2(len(buf), 44, 16) if err != nil { return err @@ -1606,66 +1632,12 @@ func (e *ExecutionPayloadElectra) UnmarshalSSZ(buf []byte) error { } } } - - // Field (17) 'DepositRequests' - { - buf = tail[o17:o18] - num, err := ssz.DivideInt2(len(buf), 192, 8192) - if err != nil { - return err - } - e.DepositRequests = make([]*DepositRequest, num) - for ii := 0; ii < num; ii++ { - if e.DepositRequests[ii] == nil { - e.DepositRequests[ii] = new(DepositRequest) - } - if err = e.DepositRequests[ii].UnmarshalSSZ(buf[ii*192 : (ii+1)*192]); err != nil { - return err - } - } - } - - // Field (18) 'WithdrawalRequests' - { - buf = tail[o18:o19] - num, err := ssz.DivideInt2(len(buf), 76, 16) - if err != nil { - return err - } - e.WithdrawalRequests = make([]*WithdrawalRequest, num) - for ii := 0; ii < num; ii++ { - if e.WithdrawalRequests[ii] == nil { - e.WithdrawalRequests[ii] = new(WithdrawalRequest) - } - if err = e.WithdrawalRequests[ii].UnmarshalSSZ(buf[ii*76 : (ii+1)*76]); err != nil { - return err - } - } - } - - // Field (19) 'ConsolidationRequests' - { - buf = tail[o19:] - num, err := ssz.DivideInt2(len(buf), 116, 1) - if err != nil { - return err - } - e.ConsolidationRequests = make([]*ConsolidationRequest, num) - for ii := 0; ii < num; ii++ { - if e.ConsolidationRequests[ii] == nil { - e.ConsolidationRequests[ii] = new(ConsolidationRequest) - } - if err = e.ConsolidationRequests[ii].UnmarshalSSZ(buf[ii*116 : (ii+1)*116]); err != nil { - return err - } - } - } return err } -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadElectra object -func (e *ExecutionPayloadElectra) SizeSSZ() (size int) { - size = 540 +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadDeneb object +func (e *ExecutionPayloadDeneb) SizeSSZ() (size int) { + size = 528 // Field (10) 'ExtraData' size += len(e.ExtraData) @@ -1679,25 +1651,16 @@ func (e *ExecutionPayloadElectra) SizeSSZ() (size int) { // Field (14) 'Withdrawals' size += len(e.Withdrawals) * 44 - // Field (17) 'DepositRequests' - size += len(e.DepositRequests) * 192 - - // Field (18) 'WithdrawalRequests' - size += len(e.WithdrawalRequests) * 76 - - // Field (19) 'ConsolidationRequests' - size += len(e.ConsolidationRequests) * 116 - return } -// HashTreeRoot ssz hashes the ExecutionPayloadElectra object -func (e *ExecutionPayloadElectra) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the ExecutionPayloadDeneb object +func (e *ExecutionPayloadDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(e) } -// HashTreeRootWith ssz hashes the ExecutionPayloadElectra object with a hasher -func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the ExecutionPayloadDeneb object with a hasher +func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' @@ -1825,54 +1788,6 @@ func (e *ExecutionPayloadElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (16) 'ExcessBlobGas' hh.PutUint64(e.ExcessBlobGas) - // Field (17) 'DepositRequests' - { - subIndx := hh.Index() - num := uint64(len(e.DepositRequests)) - if num > 8192 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.DepositRequests { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 8192) - } - - // Field (18) 'WithdrawalRequests' - { - subIndx := hh.Index() - num := uint64(len(e.WithdrawalRequests)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.WithdrawalRequests { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 16) - } - - // Field (19) 'ConsolidationRequests' - { - subIndx := hh.Index() - num := uint64(len(e.ConsolidationRequests)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.ConsolidationRequests { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 1) - } - hh.Merkleize(indx) return } @@ -2862,1040 +2777,320 @@ func (e *ExecutionPayloadHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } -// MarshalSSZ ssz marshals the ExecutionPayloadHeaderElectra object -func (e *ExecutionPayloadHeaderElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) +// MarshalSSZ ssz marshals the Withdrawal object +func (w *Withdrawal) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(w) } -// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderElectra object to a target array -func (e *ExecutionPayloadHeaderElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the Withdrawal object to a target array +func (w *Withdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(680) - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - dst = append(dst, e.ParentHash...) + // Field (0) 'Index' + dst = ssz.MarshalUint64(dst, w.Index) - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - dst = append(dst, e.FeeRecipient...) + // Field (1) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(w.ValidatorIndex)) - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + // Field (2) 'Address' + if size := len(w.Address); size != 20 { + err = ssz.ErrBytesLengthFn("--.Address", size, 20) return } - dst = append(dst, e.StateRoot...) + dst = append(dst, w.Address...) - // Field (3) 'ReceiptsRoot' - if size := len(e.ReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) - return - } - dst = append(dst, e.ReceiptsRoot...) + // Field (3) 'Amount' + dst = ssz.MarshalUint64(dst, w.Amount) - // Field (4) 'LogsBloom' - if size := len(e.LogsBloom); size != 256 { - err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) - return - } - dst = append(dst, e.LogsBloom...) + return +} - // Field (5) 'PrevRandao' - if size := len(e.PrevRandao); size != 32 { - err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) - return +// UnmarshalSSZ ssz unmarshals the Withdrawal object +func (w *Withdrawal) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 44 { + return ssz.ErrSize } - dst = append(dst, e.PrevRandao...) - // Field (6) 'BlockNumber' - dst = ssz.MarshalUint64(dst, e.BlockNumber) + // Field (0) 'Index' + w.Index = ssz.UnmarshallUint64(buf[0:8]) - // Field (7) 'GasLimit' - dst = ssz.MarshalUint64(dst, e.GasLimit) + // Field (1) 'ValidatorIndex' + w.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - // Field (8) 'GasUsed' - dst = ssz.MarshalUint64(dst, e.GasUsed) + // Field (2) 'Address' + if cap(w.Address) == 0 { + w.Address = make([]byte, 0, len(buf[16:36])) + } + w.Address = append(w.Address, buf[16:36]...) - // Field (9) 'Timestamp' - dst = ssz.MarshalUint64(dst, e.Timestamp) - - // Offset (10) 'ExtraData' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.ExtraData) - - // Field (11) 'BaseFeePerGas' - if size := len(e.BaseFeePerGas); size != 32 { - err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) - return - } - dst = append(dst, e.BaseFeePerGas...) - - // Field (12) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, e.BlockHash...) - - // Field (13) 'TransactionsRoot' - if size := len(e.TransactionsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.TransactionsRoot", size, 32) - return - } - dst = append(dst, e.TransactionsRoot...) - - // Field (14) 'WithdrawalsRoot' - if size := len(e.WithdrawalsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalsRoot", size, 32) - return - } - dst = append(dst, e.WithdrawalsRoot...) - - // Field (15) 'BlobGasUsed' - dst = ssz.MarshalUint64(dst, e.BlobGasUsed) - - // Field (16) 'ExcessBlobGas' - dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) - - // Field (17) 'DepositRequestsRoot' - if size := len(e.DepositRequestsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRequestsRoot", size, 32) - return - } - dst = append(dst, e.DepositRequestsRoot...) - - // Field (18) 'WithdrawalRequestsRoot' - if size := len(e.WithdrawalRequestsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalRequestsRoot", size, 32) - return - } - dst = append(dst, e.WithdrawalRequestsRoot...) - - // Field (19) 'ConsolidationRequestsRoot' - if size := len(e.ConsolidationRequestsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ConsolidationRequestsRoot", size, 32) - return - } - dst = append(dst, e.ConsolidationRequestsRoot...) - - // Field (10) 'ExtraData' - if size := len(e.ExtraData); size > 32 { - err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) - return - } - dst = append(dst, e.ExtraData...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderElectra object -func (e *ExecutionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 680 { - return ssz.ErrSize - } - - tail := buf - var o10 uint64 - - // Field (0) 'ParentHash' - if cap(e.ParentHash) == 0 { - e.ParentHash = make([]byte, 0, len(buf[0:32])) - } - e.ParentHash = append(e.ParentHash, buf[0:32]...) - - // Field (1) 'FeeRecipient' - if cap(e.FeeRecipient) == 0 { - e.FeeRecipient = make([]byte, 0, len(buf[32:52])) - } - e.FeeRecipient = append(e.FeeRecipient, buf[32:52]...) - - // Field (2) 'StateRoot' - if cap(e.StateRoot) == 0 { - e.StateRoot = make([]byte, 0, len(buf[52:84])) - } - e.StateRoot = append(e.StateRoot, buf[52:84]...) - - // Field (3) 'ReceiptsRoot' - if cap(e.ReceiptsRoot) == 0 { - e.ReceiptsRoot = make([]byte, 0, len(buf[84:116])) - } - e.ReceiptsRoot = append(e.ReceiptsRoot, buf[84:116]...) - - // Field (4) 'LogsBloom' - if cap(e.LogsBloom) == 0 { - e.LogsBloom = make([]byte, 0, len(buf[116:372])) - } - e.LogsBloom = append(e.LogsBloom, buf[116:372]...) - - // Field (5) 'PrevRandao' - if cap(e.PrevRandao) == 0 { - e.PrevRandao = make([]byte, 0, len(buf[372:404])) - } - e.PrevRandao = append(e.PrevRandao, buf[372:404]...) - - // Field (6) 'BlockNumber' - e.BlockNumber = ssz.UnmarshallUint64(buf[404:412]) - - // Field (7) 'GasLimit' - e.GasLimit = ssz.UnmarshallUint64(buf[412:420]) - - // Field (8) 'GasUsed' - e.GasUsed = ssz.UnmarshallUint64(buf[420:428]) - - // Field (9) 'Timestamp' - e.Timestamp = ssz.UnmarshallUint64(buf[428:436]) - - // Offset (10) 'ExtraData' - if o10 = ssz.ReadOffset(buf[436:440]); o10 > size { - return ssz.ErrOffset - } - - if o10 != 680 { - return ssz.ErrInvalidVariableOffset - } - - // Field (11) 'BaseFeePerGas' - if cap(e.BaseFeePerGas) == 0 { - e.BaseFeePerGas = make([]byte, 0, len(buf[440:472])) - } - e.BaseFeePerGas = append(e.BaseFeePerGas, buf[440:472]...) - - // Field (12) 'BlockHash' - if cap(e.BlockHash) == 0 { - e.BlockHash = make([]byte, 0, len(buf[472:504])) - } - e.BlockHash = append(e.BlockHash, buf[472:504]...) - - // Field (13) 'TransactionsRoot' - if cap(e.TransactionsRoot) == 0 { - e.TransactionsRoot = make([]byte, 0, len(buf[504:536])) - } - e.TransactionsRoot = append(e.TransactionsRoot, buf[504:536]...) - - // Field (14) 'WithdrawalsRoot' - if cap(e.WithdrawalsRoot) == 0 { - e.WithdrawalsRoot = make([]byte, 0, len(buf[536:568])) - } - e.WithdrawalsRoot = append(e.WithdrawalsRoot, buf[536:568]...) - - // Field (15) 'BlobGasUsed' - e.BlobGasUsed = ssz.UnmarshallUint64(buf[568:576]) - - // Field (16) 'ExcessBlobGas' - e.ExcessBlobGas = ssz.UnmarshallUint64(buf[576:584]) - - // Field (17) 'DepositRequestsRoot' - if cap(e.DepositRequestsRoot) == 0 { - e.DepositRequestsRoot = make([]byte, 0, len(buf[584:616])) - } - e.DepositRequestsRoot = append(e.DepositRequestsRoot, buf[584:616]...) - - // Field (18) 'WithdrawalRequestsRoot' - if cap(e.WithdrawalRequestsRoot) == 0 { - e.WithdrawalRequestsRoot = make([]byte, 0, len(buf[616:648])) - } - e.WithdrawalRequestsRoot = append(e.WithdrawalRequestsRoot, buf[616:648]...) - - // Field (19) 'ConsolidationRequestsRoot' - if cap(e.ConsolidationRequestsRoot) == 0 { - e.ConsolidationRequestsRoot = make([]byte, 0, len(buf[648:680])) - } - e.ConsolidationRequestsRoot = append(e.ConsolidationRequestsRoot, buf[648:680]...) - - // Field (10) 'ExtraData' - { - buf = tail[o10:] - if len(buf) > 32 { - return ssz.ErrBytesLength - } - if cap(e.ExtraData) == 0 { - e.ExtraData = make([]byte, 0, len(buf)) - } - e.ExtraData = append(e.ExtraData, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderElectra object -func (e *ExecutionPayloadHeaderElectra) SizeSSZ() (size int) { - size = 680 - - // Field (10) 'ExtraData' - size += len(e.ExtraData) - - return -} - -// HashTreeRoot ssz hashes the ExecutionPayloadHeaderElectra object -func (e *ExecutionPayloadHeaderElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderElectra object with a hasher -func (e *ExecutionPayloadHeaderElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - hh.PutBytes(e.ParentHash) - - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - hh.PutBytes(e.FeeRecipient) - - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(e.StateRoot) - - // Field (3) 'ReceiptsRoot' - if size := len(e.ReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) - return - } - hh.PutBytes(e.ReceiptsRoot) - - // Field (4) 'LogsBloom' - if size := len(e.LogsBloom); size != 256 { - err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) - return - } - hh.PutBytes(e.LogsBloom) - - // Field (5) 'PrevRandao' - if size := len(e.PrevRandao); size != 32 { - err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) - return - } - hh.PutBytes(e.PrevRandao) - - // Field (6) 'BlockNumber' - hh.PutUint64(e.BlockNumber) - - // Field (7) 'GasLimit' - hh.PutUint64(e.GasLimit) - - // Field (8) 'GasUsed' - hh.PutUint64(e.GasUsed) - - // Field (9) 'Timestamp' - hh.PutUint64(e.Timestamp) - - // Field (10) 'ExtraData' - { - elemIndx := hh.Index() - byteLen := uint64(len(e.ExtraData)) - if byteLen > 32 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(e.ExtraData) - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } - - // Field (11) 'BaseFeePerGas' - if size := len(e.BaseFeePerGas); size != 32 { - err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) - return - } - hh.PutBytes(e.BaseFeePerGas) - - // Field (12) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - hh.PutBytes(e.BlockHash) - - // Field (13) 'TransactionsRoot' - if size := len(e.TransactionsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.TransactionsRoot", size, 32) - return - } - hh.PutBytes(e.TransactionsRoot) - - // Field (14) 'WithdrawalsRoot' - if size := len(e.WithdrawalsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalsRoot", size, 32) - return - } - hh.PutBytes(e.WithdrawalsRoot) - - // Field (15) 'BlobGasUsed' - hh.PutUint64(e.BlobGasUsed) - - // Field (16) 'ExcessBlobGas' - hh.PutUint64(e.ExcessBlobGas) - - // Field (17) 'DepositRequestsRoot' - if size := len(e.DepositRequestsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRequestsRoot", size, 32) - return - } - hh.PutBytes(e.DepositRequestsRoot) - - // Field (18) 'WithdrawalRequestsRoot' - if size := len(e.WithdrawalRequestsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalRequestsRoot", size, 32) - return - } - hh.PutBytes(e.WithdrawalRequestsRoot) - - // Field (19) 'ConsolidationRequestsRoot' - if size := len(e.ConsolidationRequestsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ConsolidationRequestsRoot", size, 32) - return - } - hh.PutBytes(e.ConsolidationRequestsRoot) - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the Withdrawal object -func (w *Withdrawal) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(w) -} - -// MarshalSSZTo ssz marshals the Withdrawal object to a target array -func (w *Withdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, w.Index) - - // Field (1) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(w.ValidatorIndex)) - - // Field (2) 'Address' - if size := len(w.Address); size != 20 { - err = ssz.ErrBytesLengthFn("--.Address", size, 20) - return - } - dst = append(dst, w.Address...) - - // Field (3) 'Amount' - dst = ssz.MarshalUint64(dst, w.Amount) - - return -} - -// UnmarshalSSZ ssz unmarshals the Withdrawal object -func (w *Withdrawal) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 44 { - return ssz.ErrSize - } - - // Field (0) 'Index' - w.Index = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'ValidatorIndex' - w.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'Address' - if cap(w.Address) == 0 { - w.Address = make([]byte, 0, len(buf[16:36])) - } - w.Address = append(w.Address, buf[16:36]...) - - // Field (3) 'Amount' - w.Amount = ssz.UnmarshallUint64(buf[36:44]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Withdrawal object -func (w *Withdrawal) SizeSSZ() (size int) { - size = 44 - return -} - -// HashTreeRoot ssz hashes the Withdrawal object -func (w *Withdrawal) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(w) -} - -// HashTreeRootWith ssz hashes the Withdrawal object with a hasher -func (w *Withdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(w.Index) - - // Field (1) 'ValidatorIndex' - hh.PutUint64(uint64(w.ValidatorIndex)) - - // Field (2) 'Address' - if size := len(w.Address); size != 20 { - err = ssz.ErrBytesLengthFn("--.Address", size, 20) - return - } - hh.PutBytes(w.Address) - - // Field (3) 'Amount' - hh.PutUint64(w.Amount) - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the BlobsBundle object -func (b *BlobsBundle) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobsBundle object to a target array -func (b *BlobsBundle) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(12) - - // Offset (0) 'KzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.KzgCommitments) * 48 - - // Offset (1) 'Proofs' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Proofs) * 48 - - // Offset (2) 'Blobs' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Blobs) * 131072 - - // Field (0) 'KzgCommitments' - if size := len(b.KzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(b.KzgCommitments); ii++ { - if size := len(b.KzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitments[ii]", size, 48) - return - } - dst = append(dst, b.KzgCommitments[ii]...) - } - - // Field (1) 'Proofs' - if size := len(b.Proofs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Proofs", size, 4096) - return - } - for ii := 0; ii < len(b.Proofs); ii++ { - if size := len(b.Proofs[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.Proofs[ii]", size, 48) - return - } - dst = append(dst, b.Proofs[ii]...) - } - - // Field (2) 'Blobs' - if size := len(b.Blobs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) - return - } - for ii := 0; ii < len(b.Blobs); ii++ { - if size := len(b.Blobs[ii]); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) - return - } - dst = append(dst, b.Blobs[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobsBundle object -func (b *BlobsBundle) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 12 { - return ssz.ErrSize - } - - tail := buf - var o0, o1, o2 uint64 - - // Offset (0) 'KzgCommitments' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 != 12 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'Proofs' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Offset (2) 'Blobs' - if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { - return ssz.ErrOffset - } - - // Field (0) 'KzgCommitments' - { - buf = tail[o0:o1] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.KzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.KzgCommitments[ii]) == 0 { - b.KzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.KzgCommitments[ii] = append(b.KzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (1) 'Proofs' - { - buf = tail[o1:o2] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - b.Proofs = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.Proofs[ii]) == 0 { - b.Proofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - b.Proofs[ii] = append(b.Proofs[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (2) 'Blobs' - { - buf = tail[o2:] - num, err := ssz.DivideInt2(len(buf), 131072, 4096) - if err != nil { - return err - } - b.Blobs = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.Blobs[ii]) == 0 { - b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) - } - b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobsBundle object -func (b *BlobsBundle) SizeSSZ() (size int) { - size = 12 - - // Field (0) 'KzgCommitments' - size += len(b.KzgCommitments) * 48 - - // Field (1) 'Proofs' - size += len(b.Proofs) * 48 - - // Field (2) 'Blobs' - size += len(b.Blobs) * 131072 - - return -} - -// HashTreeRoot ssz hashes the BlobsBundle object -func (b *BlobsBundle) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobsBundle object with a hasher -func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'KzgCommitments' - { - if size := len(b.KzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.KzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.KzgCommitments)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - - // Field (1) 'Proofs' - { - if size := len(b.Proofs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Proofs", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.Proofs { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.Proofs)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - - // Field (2) 'Blobs' - { - if size := len(b.Blobs); size > 4096 { - err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range b.Blobs { - if len(i) != 131072 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(b.Blobs)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the WithdrawalRequest object -func (w *WithdrawalRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(w) -} - -// MarshalSSZTo ssz marshals the WithdrawalRequest object to a target array -func (w *WithdrawalRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SourceAddress' - if size := len(w.SourceAddress); size != 20 { - err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) - return - } - dst = append(dst, w.SourceAddress...) - - // Field (1) 'ValidatorPubkey' - if size := len(w.ValidatorPubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) - return - } - dst = append(dst, w.ValidatorPubkey...) - - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, w.Amount) - - return -} - -// UnmarshalSSZ ssz unmarshals the WithdrawalRequest object -func (w *WithdrawalRequest) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 76 { - return ssz.ErrSize - } - - // Field (0) 'SourceAddress' - if cap(w.SourceAddress) == 0 { - w.SourceAddress = make([]byte, 0, len(buf[0:20])) - } - w.SourceAddress = append(w.SourceAddress, buf[0:20]...) - - // Field (1) 'ValidatorPubkey' - if cap(w.ValidatorPubkey) == 0 { - w.ValidatorPubkey = make([]byte, 0, len(buf[20:68])) - } - w.ValidatorPubkey = append(w.ValidatorPubkey, buf[20:68]...) - - // Field (2) 'Amount' - w.Amount = ssz.UnmarshallUint64(buf[68:76]) + // Field (3) 'Amount' + w.Amount = ssz.UnmarshallUint64(buf[36:44]) return err } -// SizeSSZ returns the ssz encoded size in bytes for the WithdrawalRequest object -func (w *WithdrawalRequest) SizeSSZ() (size int) { - size = 76 +// SizeSSZ returns the ssz encoded size in bytes for the Withdrawal object +func (w *Withdrawal) SizeSSZ() (size int) { + size = 44 return } -// HashTreeRoot ssz hashes the WithdrawalRequest object -func (w *WithdrawalRequest) HashTreeRoot() ([32]byte, error) { +// HashTreeRoot ssz hashes the Withdrawal object +func (w *Withdrawal) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(w) } -// HashTreeRootWith ssz hashes the WithdrawalRequest object with a hasher -func (w *WithdrawalRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SourceAddress' - if size := len(w.SourceAddress); size != 20 { - err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) - return - } - hh.PutBytes(w.SourceAddress) - - // Field (1) 'ValidatorPubkey' - if size := len(w.ValidatorPubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.ValidatorPubkey", size, 48) - return - } - hh.PutBytes(w.ValidatorPubkey) - - // Field (2) 'Amount' - hh.PutUint64(w.Amount) - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the DepositRequest object -func (d *DepositRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DepositRequest object to a target array -func (d *DepositRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Pubkey' - if size := len(d.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, d.Pubkey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) - - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) - - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, d.Signature...) - - // Field (4) 'Index' - dst = ssz.MarshalUint64(dst, d.Index) - - return -} - -// UnmarshalSSZ ssz unmarshals the DepositRequest object -func (d *DepositRequest) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 192 { - return ssz.ErrSize - } - - // Field (0) 'Pubkey' - if cap(d.Pubkey) == 0 { - d.Pubkey = make([]byte, 0, len(buf[0:48])) - } - d.Pubkey = append(d.Pubkey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) - - // Field (3) 'Signature' - if cap(d.Signature) == 0 { - d.Signature = make([]byte, 0, len(buf[88:184])) - } - d.Signature = append(d.Signature, buf[88:184]...) - - // Field (4) 'Index' - d.Index = ssz.UnmarshallUint64(buf[184:192]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DepositRequest object -func (d *DepositRequest) SizeSSZ() (size int) { - size = 192 - return -} - -// HashTreeRoot ssz hashes the DepositRequest object -func (d *DepositRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DepositRequest object with a hasher -func (d *DepositRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the Withdrawal object with a hasher +func (w *Withdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'Pubkey' - if size := len(d.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(d.Pubkey) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(d.WithdrawalCredentials) + // Field (0) 'Index' + hh.PutUint64(w.Index) - // Field (2) 'Amount' - hh.PutUint64(d.Amount) + // Field (1) 'ValidatorIndex' + hh.PutUint64(uint64(w.ValidatorIndex)) - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + // Field (2) 'Address' + if size := len(w.Address); size != 20 { + err = ssz.ErrBytesLengthFn("--.Address", size, 20) return } - hh.PutBytes(d.Signature) + hh.PutBytes(w.Address) - // Field (4) 'Index' - hh.PutUint64(d.Index) + // Field (3) 'Amount' + hh.PutUint64(w.Amount) hh.Merkleize(indx) return } -// MarshalSSZ ssz marshals the ConsolidationRequest object -func (c *ConsolidationRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) +// MarshalSSZ ssz marshals the BlobsBundle object +func (b *BlobsBundle) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) } -// MarshalSSZTo ssz marshals the ConsolidationRequest object to a target array -func (c *ConsolidationRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { +// MarshalSSZTo ssz marshals the BlobsBundle object to a target array +func (b *BlobsBundle) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf + offset := int(12) - // Field (0) 'SourceAddress' - if size := len(c.SourceAddress); size != 20 { - err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) + // Offset (0) 'KzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.KzgCommitments) * 48 + + // Offset (1) 'Proofs' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Proofs) * 48 + + // Offset (2) 'Blobs' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Blobs) * 131072 + + // Field (0) 'KzgCommitments' + if size := len(b.KzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) return } - dst = append(dst, c.SourceAddress...) + for ii := 0; ii < len(b.KzgCommitments); ii++ { + if size := len(b.KzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgCommitments[ii]", size, 48) + return + } + dst = append(dst, b.KzgCommitments[ii]...) + } - // Field (1) 'SourcePubkey' - if size := len(c.SourcePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.SourcePubkey", size, 48) + // Field (1) 'Proofs' + if size := len(b.Proofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Proofs", size, 4096) return } - dst = append(dst, c.SourcePubkey...) + for ii := 0; ii < len(b.Proofs); ii++ { + if size := len(b.Proofs[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.Proofs[ii]", size, 48) + return + } + dst = append(dst, b.Proofs[ii]...) + } - // Field (2) 'TargetPubkey' - if size := len(c.TargetPubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.TargetPubkey", size, 48) + // Field (2) 'Blobs' + if size := len(b.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) return } - dst = append(dst, c.TargetPubkey...) + for ii := 0; ii < len(b.Blobs); ii++ { + if size := len(b.Blobs[ii]); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) + return + } + dst = append(dst, b.Blobs[ii]...) + } return } -// UnmarshalSSZ ssz unmarshals the ConsolidationRequest object -func (c *ConsolidationRequest) UnmarshalSSZ(buf []byte) error { +// UnmarshalSSZ ssz unmarshals the BlobsBundle object +func (b *BlobsBundle) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size != 116 { + if size < 12 { return ssz.ErrSize } - // Field (0) 'SourceAddress' - if cap(c.SourceAddress) == 0 { - c.SourceAddress = make([]byte, 0, len(buf[0:20])) + tail := buf + var o0, o1, o2 uint64 + + // Offset (0) 'KzgCommitments' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset } - c.SourceAddress = append(c.SourceAddress, buf[0:20]...) - // Field (1) 'SourcePubkey' - if cap(c.SourcePubkey) == 0 { - c.SourcePubkey = make([]byte, 0, len(buf[20:68])) + if o0 != 12 { + return ssz.ErrInvalidVariableOffset } - c.SourcePubkey = append(c.SourcePubkey, buf[20:68]...) - // Field (2) 'TargetPubkey' - if cap(c.TargetPubkey) == 0 { - c.TargetPubkey = make([]byte, 0, len(buf[68:116])) + // Offset (1) 'Proofs' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Offset (2) 'Blobs' + if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Field (0) 'KzgCommitments' + { + buf = tail[o0:o1] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.KzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.KzgCommitments[ii]) == 0 { + b.KzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.KzgCommitments[ii] = append(b.KzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (1) 'Proofs' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.Proofs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.Proofs[ii]) == 0 { + b.Proofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.Proofs[ii] = append(b.Proofs[ii], buf[ii*48:(ii+1)*48]...) + } } - c.TargetPubkey = append(c.TargetPubkey, buf[68:116]...) + // Field (2) 'Blobs' + { + buf = tail[o2:] + num, err := ssz.DivideInt2(len(buf), 131072, 4096) + if err != nil { + return err + } + b.Blobs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.Blobs[ii]) == 0 { + b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) + } + b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) + } + } return err } -// SizeSSZ returns the ssz encoded size in bytes for the ConsolidationRequest object -func (c *ConsolidationRequest) SizeSSZ() (size int) { - size = 116 +// SizeSSZ returns the ssz encoded size in bytes for the BlobsBundle object +func (b *BlobsBundle) SizeSSZ() (size int) { + size = 12 + + // Field (0) 'KzgCommitments' + size += len(b.KzgCommitments) * 48 + + // Field (1) 'Proofs' + size += len(b.Proofs) * 48 + + // Field (2) 'Blobs' + size += len(b.Blobs) * 131072 + return } -// HashTreeRoot ssz hashes the ConsolidationRequest object -func (c *ConsolidationRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) +// HashTreeRoot ssz hashes the BlobsBundle object +func (b *BlobsBundle) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) } -// HashTreeRootWith ssz hashes the ConsolidationRequest object with a hasher -func (c *ConsolidationRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { +// HashTreeRootWith ssz hashes the BlobsBundle object with a hasher +func (b *BlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'SourceAddress' - if size := len(c.SourceAddress); size != 20 { - err = ssz.ErrBytesLengthFn("--.SourceAddress", size, 20) - return + // Field (0) 'KzgCommitments' + { + if size := len(b.KzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.KzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.KzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - hh.PutBytes(c.SourceAddress) - // Field (1) 'SourcePubkey' - if size := len(c.SourcePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.SourcePubkey", size, 48) - return + // Field (1) 'Proofs' + { + if size := len(b.Proofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Proofs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.Proofs { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.Proofs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - hh.PutBytes(c.SourcePubkey) - // Field (2) 'TargetPubkey' - if size := len(c.TargetPubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.TargetPubkey", size, 48) - return + // Field (2) 'Blobs' + { + if size := len(b.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.Blobs { + if len(i) != 131072 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.Blobs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - hh.PutBytes(c.TargetPubkey) hh.Merkleize(indx) return diff --git a/proto/engine/v1/execution_engine.go b/proto/engine/v1/execution_engine.go index 5b9691184a5f..94aad2d9061d 100644 --- a/proto/engine/v1/execution_engine.go +++ b/proto/engine/v1/execution_engine.go @@ -67,35 +67,6 @@ func (cr *ConsolidationRequest) Copy() *ConsolidationRequest { } } -// Copy -- Electra -func (payload *ExecutionPayloadElectra) Copy() *ExecutionPayloadElectra { - if payload == nil { - return nil - } - return &ExecutionPayloadElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions), - Withdrawals: copySlice(payload.Withdrawals), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - DepositRequests: copySlice(payload.DepositRequests), - WithdrawalRequests: copySlice(payload.WithdrawalRequests), - ConsolidationRequests: copySlice(payload.ConsolidationRequests), - } -} - // Copy -- Deneb func (payload *ExecutionPayloadDeneb) Copy() *ExecutionPayloadDeneb { if payload == nil { @@ -171,36 +142,6 @@ func (payload *ExecutionPayload) Copy() *ExecutionPayload { } } -// Copy -- Electra -func (payload *ExecutionPayloadHeaderElectra) Copy() *ExecutionPayloadHeaderElectra { - if payload == nil { - return nil - } - - return &ExecutionPayloadHeaderElectra{ - ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash), - FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient), - StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot), - ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot), - LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom), - PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao), - BlockNumber: payload.BlockNumber, - GasLimit: payload.GasLimit, - GasUsed: payload.GasUsed, - Timestamp: payload.Timestamp, - ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData), - BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas), - BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash), - TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot), - WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot), - BlobGasUsed: payload.BlobGasUsed, - ExcessBlobGas: payload.ExcessBlobGas, - DepositRequestsRoot: bytesutil.SafeCopyBytes(payload.DepositRequestsRoot), - WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot), - ConsolidationRequestsRoot: bytesutil.SafeCopyBytes(payload.ConsolidationRequestsRoot), - } -} - // Copy -- Deneb func (payload *ExecutionPayloadHeaderDeneb) Copy() *ExecutionPayloadHeaderDeneb { if payload == nil { diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index f2edbf1c9597..8fb7f54a6a35 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -78,7 +78,7 @@ func (x PayloadStatus_Status) Number() protoreflect.EnumNumber { // Deprecated: Use PayloadStatus_Status.Descriptor instead. func (PayloadStatus_Status) EnumDescriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14, 0} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11, 0} } type ExecutionPayload struct { @@ -566,276 +566,6 @@ func (x *ExecutionPayloadDeneb) GetExcessBlobGas() uint64 { return 0 } -type ExecutionPayloadElectra struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` - FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` - ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` - LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` - PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` - BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` - BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` - Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` - BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` - ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - DepositRequests []*DepositRequest `protobuf:"bytes,18,rep,name=deposit_requests,json=depositRequests,proto3" json:"deposit_requests,omitempty" ssz-max:"8192"` - WithdrawalRequests []*WithdrawalRequest `protobuf:"bytes,19,rep,name=withdrawal_requests,json=withdrawalRequests,proto3" json:"withdrawal_requests,omitempty" ssz-max:"16"` - ConsolidationRequests []*ConsolidationRequest `protobuf:"bytes,20,rep,name=consolidation_requests,json=consolidationRequests,proto3" json:"consolidation_requests,omitempty" ssz-max:"1"` -} - -func (x *ExecutionPayloadElectra) Reset() { - *x = ExecutionPayloadElectra{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecutionPayloadElectra) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecutionPayloadElectra) ProtoMessage() {} - -func (x *ExecutionPayloadElectra) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecutionPayloadElectra.ProtoReflect.Descriptor instead. -func (*ExecutionPayloadElectra) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3} -} - -func (x *ExecutionPayloadElectra) GetParentHash() []byte { - if x != nil { - return x.ParentHash - } - return nil -} - -func (x *ExecutionPayloadElectra) GetFeeRecipient() []byte { - if x != nil { - return x.FeeRecipient - } - return nil -} - -func (x *ExecutionPayloadElectra) GetStateRoot() []byte { - if x != nil { - return x.StateRoot - } - return nil -} - -func (x *ExecutionPayloadElectra) GetReceiptsRoot() []byte { - if x != nil { - return x.ReceiptsRoot - } - return nil -} - -func (x *ExecutionPayloadElectra) GetLogsBloom() []byte { - if x != nil { - return x.LogsBloom - } - return nil -} - -func (x *ExecutionPayloadElectra) GetPrevRandao() []byte { - if x != nil { - return x.PrevRandao - } - return nil -} - -func (x *ExecutionPayloadElectra) GetBlockNumber() uint64 { - if x != nil { - return x.BlockNumber - } - return 0 -} - -func (x *ExecutionPayloadElectra) GetGasLimit() uint64 { - if x != nil { - return x.GasLimit - } - return 0 -} - -func (x *ExecutionPayloadElectra) GetGasUsed() uint64 { - if x != nil { - return x.GasUsed - } - return 0 -} - -func (x *ExecutionPayloadElectra) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *ExecutionPayloadElectra) GetExtraData() []byte { - if x != nil { - return x.ExtraData - } - return nil -} - -func (x *ExecutionPayloadElectra) GetBaseFeePerGas() []byte { - if x != nil { - return x.BaseFeePerGas - } - return nil -} - -func (x *ExecutionPayloadElectra) GetBlockHash() []byte { - if x != nil { - return x.BlockHash - } - return nil -} - -func (x *ExecutionPayloadElectra) GetTransactions() [][]byte { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *ExecutionPayloadElectra) GetWithdrawals() []*Withdrawal { - if x != nil { - return x.Withdrawals - } - return nil -} - -func (x *ExecutionPayloadElectra) GetBlobGasUsed() uint64 { - if x != nil { - return x.BlobGasUsed - } - return 0 -} - -func (x *ExecutionPayloadElectra) GetExcessBlobGas() uint64 { - if x != nil { - return x.ExcessBlobGas - } - return 0 -} - -func (x *ExecutionPayloadElectra) GetDepositRequests() []*DepositRequest { - if x != nil { - return x.DepositRequests - } - return nil -} - -func (x *ExecutionPayloadElectra) GetWithdrawalRequests() []*WithdrawalRequest { - if x != nil { - return x.WithdrawalRequests - } - return nil -} - -func (x *ExecutionPayloadElectra) GetConsolidationRequests() []*ConsolidationRequest { - if x != nil { - return x.ConsolidationRequests - } - return nil -} - -type ExecutionPayloadElectraWithValueAndBlobsBundle struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Payload *ExecutionPayloadElectra `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - BlobsBundle *BlobsBundle `protobuf:"bytes,3,opt,name=blobs_bundle,json=blobsBundle,proto3" json:"blobs_bundle,omitempty"` - ShouldOverrideBuilder bool `protobuf:"varint,4,opt,name=should_override_builder,json=shouldOverrideBuilder,proto3" json:"should_override_builder,omitempty"` -} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) Reset() { - *x = ExecutionPayloadElectraWithValueAndBlobsBundle{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoMessage() {} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecutionPayloadElectraWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. -func (*ExecutionPayloadElectraWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} -} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadElectra { - if x != nil { - return x.Payload - } - return nil -} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetBlobsBundle() *BlobsBundle { - if x != nil { - return x.BlobsBundle - } - return nil -} - -func (x *ExecutionPayloadElectraWithValueAndBlobsBundle) GetShouldOverrideBuilder() bool { - if x != nil { - return x.ShouldOverrideBuilder - } - return false -} - type ExecutionPayloadCapellaWithValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -848,7 +578,7 @@ type ExecutionPayloadCapellaWithValue struct { func (x *ExecutionPayloadCapellaWithValue) Reset() { *x = ExecutionPayloadCapellaWithValue{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -861,7 +591,7 @@ func (x *ExecutionPayloadCapellaWithValue) String() string { func (*ExecutionPayloadCapellaWithValue) ProtoMessage() {} func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -874,7 +604,7 @@ func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadCapellaWithValue.ProtoReflect.Descriptor instead. func (*ExecutionPayloadCapellaWithValue) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3} } func (x *ExecutionPayloadCapellaWithValue) GetPayload() *ExecutionPayloadCapella { @@ -905,7 +635,7 @@ type ExecutionPayloadDenebWithValueAndBlobsBundle struct { func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) Reset() { *x = ExecutionPayloadDenebWithValueAndBlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -918,7 +648,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) String() string { func (*ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoMessage() {} func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -931,7 +661,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protorefle // Deprecated: Use ExecutionPayloadDenebWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. func (*ExecutionPayloadDenebWithValueAndBlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} } func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadDeneb { @@ -986,7 +716,7 @@ type ExecutionPayloadHeader struct { func (x *ExecutionPayloadHeader) Reset() { *x = ExecutionPayloadHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -999,7 +729,7 @@ func (x *ExecutionPayloadHeader) String() string { func (*ExecutionPayloadHeader) ProtoMessage() {} func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1012,7 +742,7 @@ func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeader.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeader) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5} } func (x *ExecutionPayloadHeader) GetParentHash() []byte { @@ -1138,7 +868,7 @@ type ExecutionPayloadHeaderCapella struct { func (x *ExecutionPayloadHeaderCapella) Reset() { *x = ExecutionPayloadHeaderCapella{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1151,7 +881,7 @@ func (x *ExecutionPayloadHeaderCapella) String() string { func (*ExecutionPayloadHeaderCapella) ProtoMessage() {} func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1164,7 +894,7 @@ func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderCapella.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderCapella) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} } func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte { @@ -1299,7 +1029,7 @@ type ExecutionPayloadHeaderDeneb struct { func (x *ExecutionPayloadHeaderDeneb) Reset() { *x = ExecutionPayloadHeaderDeneb{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1312,7 +1042,7 @@ func (x *ExecutionPayloadHeaderDeneb) String() string { func (*ExecutionPayloadHeaderDeneb) ProtoMessage() {} func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1325,7 +1055,7 @@ func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderDeneb.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderDeneb) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} } func (x *ExecutionPayloadHeaderDeneb) GetParentHash() []byte { @@ -1447,50 +1177,33 @@ func (x *ExecutionPayloadHeaderDeneb) GetExcessBlobGas() uint64 { return 0 } -type ExecutionPayloadHeaderElectra struct { +type PayloadAttributes struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` - FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` - ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` - LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` - PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` - BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` - BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - TransactionsRoot []byte `protobuf:"bytes,14,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty" ssz-size:"32"` - WithdrawalsRoot []byte `protobuf:"bytes,15,opt,name=withdrawals_root,json=withdrawalsRoot,proto3" json:"withdrawals_root,omitempty" ssz-size:"32"` - BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` - ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - DepositRequestsRoot []byte `protobuf:"bytes,18,opt,name=deposit_requests_root,json=depositRequestsRoot,proto3" json:"deposit_requests_root,omitempty" ssz-size:"32"` - WithdrawalRequestsRoot []byte `protobuf:"bytes,19,opt,name=withdrawal_requests_root,json=withdrawalRequestsRoot,proto3" json:"withdrawal_requests_root,omitempty" ssz-size:"32"` - ConsolidationRequestsRoot []byte `protobuf:"bytes,20,opt,name=consolidation_requests_root,json=consolidationRequestsRoot,proto3" json:"consolidation_requests_root,omitempty" ssz-size:"32"` -} - -func (x *ExecutionPayloadHeaderElectra) Reset() { - *x = ExecutionPayloadHeaderElectra{} + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PrevRandao []byte `protobuf:"bytes,2,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` + SuggestedFeeRecipient []byte `protobuf:"bytes,3,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty" ssz-size:"20"` +} + +func (x *PayloadAttributes) Reset() { + *x = PayloadAttributes{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ExecutionPayloadHeaderElectra) String() string { +func (x *PayloadAttributes) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExecutionPayloadHeaderElectra) ProtoMessage() {} +func (*PayloadAttributes) ProtoMessage() {} -func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] +func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1501,201 +1214,19 @@ func (x *ExecutionPayloadHeaderElectra) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExecutionPayloadHeaderElectra.ProtoReflect.Descriptor instead. -func (*ExecutionPayloadHeaderElectra) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} +// Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead. +func (*PayloadAttributes) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8} } -func (x *ExecutionPayloadHeaderElectra) GetParentHash() []byte { +func (x *PayloadAttributes) GetTimestamp() uint64 { if x != nil { - return x.ParentHash + return x.Timestamp } - return nil + return 0 } -func (x *ExecutionPayloadHeaderElectra) GetFeeRecipient() []byte { - if x != nil { - return x.FeeRecipient - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetStateRoot() []byte { - if x != nil { - return x.StateRoot - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetReceiptsRoot() []byte { - if x != nil { - return x.ReceiptsRoot - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetLogsBloom() []byte { - if x != nil { - return x.LogsBloom - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetPrevRandao() []byte { - if x != nil { - return x.PrevRandao - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetBlockNumber() uint64 { - if x != nil { - return x.BlockNumber - } - return 0 -} - -func (x *ExecutionPayloadHeaderElectra) GetGasLimit() uint64 { - if x != nil { - return x.GasLimit - } - return 0 -} - -func (x *ExecutionPayloadHeaderElectra) GetGasUsed() uint64 { - if x != nil { - return x.GasUsed - } - return 0 -} - -func (x *ExecutionPayloadHeaderElectra) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *ExecutionPayloadHeaderElectra) GetExtraData() []byte { - if x != nil { - return x.ExtraData - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetBaseFeePerGas() []byte { - if x != nil { - return x.BaseFeePerGas - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetBlockHash() []byte { - if x != nil { - return x.BlockHash - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetTransactionsRoot() []byte { - if x != nil { - return x.TransactionsRoot - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetWithdrawalsRoot() []byte { - if x != nil { - return x.WithdrawalsRoot - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetBlobGasUsed() uint64 { - if x != nil { - return x.BlobGasUsed - } - return 0 -} - -func (x *ExecutionPayloadHeaderElectra) GetExcessBlobGas() uint64 { - if x != nil { - return x.ExcessBlobGas - } - return 0 -} - -func (x *ExecutionPayloadHeaderElectra) GetDepositRequestsRoot() []byte { - if x != nil { - return x.DepositRequestsRoot - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetWithdrawalRequestsRoot() []byte { - if x != nil { - return x.WithdrawalRequestsRoot - } - return nil -} - -func (x *ExecutionPayloadHeaderElectra) GetConsolidationRequestsRoot() []byte { - if x != nil { - return x.ConsolidationRequestsRoot - } - return nil -} - -type PayloadAttributes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PrevRandao []byte `protobuf:"bytes,2,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - SuggestedFeeRecipient []byte `protobuf:"bytes,3,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty" ssz-size:"20"` -} - -func (x *PayloadAttributes) Reset() { - *x = PayloadAttributes{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PayloadAttributes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PayloadAttributes) ProtoMessage() {} - -func (x *PayloadAttributes) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead. -func (*PayloadAttributes) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} -} - -func (x *PayloadAttributes) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *PayloadAttributes) GetPrevRandao() []byte { +func (x *PayloadAttributes) GetPrevRandao() []byte { if x != nil { return x.PrevRandao } @@ -1723,7 +1254,7 @@ type PayloadAttributesV2 struct { func (x *PayloadAttributesV2) Reset() { *x = PayloadAttributesV2{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1736,7 +1267,7 @@ func (x *PayloadAttributesV2) String() string { func (*PayloadAttributesV2) ProtoMessage() {} func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1749,7 +1280,7 @@ func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV2.ProtoReflect.Descriptor instead. func (*PayloadAttributesV2) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} } func (x *PayloadAttributesV2) GetTimestamp() uint64 { @@ -1795,7 +1326,7 @@ type PayloadAttributesV3 struct { func (x *PayloadAttributesV3) Reset() { *x = PayloadAttributesV3{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1808,7 +1339,7 @@ func (x *PayloadAttributesV3) String() string { func (*PayloadAttributesV3) ProtoMessage() {} func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1821,7 +1352,7 @@ func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV3.ProtoReflect.Descriptor instead. func (*PayloadAttributesV3) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} } func (x *PayloadAttributesV3) GetTimestamp() uint64 { @@ -1872,7 +1403,7 @@ type PayloadStatus struct { func (x *PayloadStatus) Reset() { *x = PayloadStatus{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1885,7 +1416,7 @@ func (x *PayloadStatus) String() string { func (*PayloadStatus) ProtoMessage() {} func (x *PayloadStatus) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1898,7 +1429,7 @@ func (x *PayloadStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadStatus.ProtoReflect.Descriptor instead. func (*PayloadStatus) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11} } func (x *PayloadStatus) GetStatus() PayloadStatus_Status { @@ -1935,7 +1466,7 @@ type ForkchoiceState struct { func (x *ForkchoiceState) Reset() { *x = ForkchoiceState{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1948,7 +1479,7 @@ func (x *ForkchoiceState) String() string { func (*ForkchoiceState) ProtoMessage() {} func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1961,7 +1492,7 @@ func (x *ForkchoiceState) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkchoiceState.ProtoReflect.Descriptor instead. func (*ForkchoiceState) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} } func (x *ForkchoiceState) GetHeadBlockHash() []byte { @@ -1999,7 +1530,7 @@ type Withdrawal struct { func (x *Withdrawal) Reset() { *x = Withdrawal{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2012,7 +1543,7 @@ func (x *Withdrawal) String() string { func (*Withdrawal) ProtoMessage() {} func (x *Withdrawal) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2025,7 +1556,7 @@ func (x *Withdrawal) ProtoReflect() protoreflect.Message { // Deprecated: Use Withdrawal.ProtoReflect.Descriptor instead. func (*Withdrawal) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} } func (x *Withdrawal) GetIndex() uint64 { @@ -2069,7 +1600,7 @@ type BlobsBundle struct { func (x *BlobsBundle) Reset() { *x = BlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2082,7 +1613,7 @@ func (x *BlobsBundle) String() string { func (*BlobsBundle) ProtoMessage() {} func (x *BlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2095,7 +1626,7 @@ func (x *BlobsBundle) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobsBundle.ProtoReflect.Descriptor instead. func (*BlobsBundle) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} } func (x *BlobsBundle) GetKzgCommitments() [][]byte { @@ -2130,7 +1661,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2143,7 +1674,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[18] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2156,7 +1687,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message { // Deprecated: Use Blob.ProtoReflect.Descriptor instead. func (*Blob) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{18} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} } func (x *Blob) GetData() []byte { @@ -2177,7 +1708,7 @@ type ExchangeCapabilities struct { func (x *ExchangeCapabilities) Reset() { *x = ExchangeCapabilities{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2190,7 +1721,7 @@ func (x *ExchangeCapabilities) String() string { func (*ExchangeCapabilities) ProtoMessage() {} func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[19] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2203,7 +1734,7 @@ func (x *ExchangeCapabilities) ProtoReflect() protoreflect.Message { // Deprecated: Use ExchangeCapabilities.ProtoReflect.Descriptor instead. func (*ExchangeCapabilities) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{19} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} } func (x *ExchangeCapabilities) GetSupportedMethods() []string { @@ -2213,212 +1744,7 @@ func (x *ExchangeCapabilities) GetSupportedMethods() []string { return nil } -type WithdrawalRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SourceAddress []byte `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" ssz-size:"20"` - ValidatorPubkey []byte `protobuf:"bytes,2,opt,name=validator_pubkey,json=validatorPubkey,proto3" json:"validator_pubkey,omitempty" ssz-size:"48"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *WithdrawalRequest) Reset() { - *x = WithdrawalRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WithdrawalRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WithdrawalRequest) ProtoMessage() {} - -func (x *WithdrawalRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WithdrawalRequest.ProtoReflect.Descriptor instead. -func (*WithdrawalRequest) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{20} -} - -func (x *WithdrawalRequest) GetSourceAddress() []byte { - if x != nil { - return x.SourceAddress - } - return nil -} - -func (x *WithdrawalRequest) GetValidatorPubkey() []byte { - if x != nil { - return x.ValidatorPubkey - } - return nil -} - -func (x *WithdrawalRequest) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -type DepositRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"` - WithdrawalCredentials []byte `protobuf:"bytes,2,opt,name=withdrawal_credentials,json=withdrawalCredentials,proto3" json:"withdrawal_credentials,omitempty" ssz-size:"32"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` - Index uint64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` -} - -func (x *DepositRequest) Reset() { - *x = DepositRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DepositRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DepositRequest) ProtoMessage() {} - -func (x *DepositRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DepositRequest.ProtoReflect.Descriptor instead. -func (*DepositRequest) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{21} -} - -func (x *DepositRequest) GetPubkey() []byte { - if x != nil { - return x.Pubkey - } - return nil -} - -func (x *DepositRequest) GetWithdrawalCredentials() []byte { - if x != nil { - return x.WithdrawalCredentials - } - return nil -} - -func (x *DepositRequest) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -func (x *DepositRequest) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *DepositRequest) GetIndex() uint64 { - if x != nil { - return x.Index - } - return 0 -} - -type ConsolidationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SourceAddress []byte `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty" ssz-size:"20"` - SourcePubkey []byte `protobuf:"bytes,2,opt,name=source_pubkey,json=sourcePubkey,proto3" json:"source_pubkey,omitempty" ssz-size:"48"` - TargetPubkey []byte `protobuf:"bytes,3,opt,name=target_pubkey,json=targetPubkey,proto3" json:"target_pubkey,omitempty" ssz-size:"48"` -} - -func (x *ConsolidationRequest) Reset() { - *x = ConsolidationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConsolidationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConsolidationRequest) ProtoMessage() {} - -func (x *ConsolidationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConsolidationRequest.ProtoReflect.Descriptor instead. -func (*ConsolidationRequest) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{22} -} - -func (x *ConsolidationRequest) GetSourceAddress() []byte { - if x != nil { - return x.SourceAddress - } - return nil -} - -func (x *ConsolidationRequest) GetSourcePubkey() []byte { - if x != nil { - return x.SourcePubkey - } - return nil -} - -func (x *ConsolidationRequest) GetTargetPubkey() []byte { - if x != nil { - return x.TargetPubkey - } - return nil -} - -var File_proto_engine_v1_execution_engine_proto protoreflect.FileDescriptor +var File_proto_engine_v1_execution_engine_proto protoreflect.FileDescriptor var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x0a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, @@ -2551,191 +1877,70 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x86, 0x08, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, - 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, - 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, - 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, - 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, - 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, - 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, - 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, - 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, - 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, - 0x03, 0x3f, 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, - 0x31, 0x30, 0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, - 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, - 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, - 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x12, 0x57, - 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x08, 0x92, 0xb5, - 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x13, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x13, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x73, 0x6f, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, - 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, - 0x89, 0x02, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, - 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, - 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x20, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, - 0x2c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, - 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, - 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, - 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, - 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, - 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, - 0x6c, 0x64, 0x65, 0x72, 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, - 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, - 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, - 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, - 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, - 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, - 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, - 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, - 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, - 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, - 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, - 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, - 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xc4, 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, + 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x7f, 0x0a, 0x20, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, + 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, + 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, + 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, + 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, + 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, + 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, + 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, + 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, + 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, + 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, + 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, + 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, + 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, @@ -2772,212 +1977,164 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, - 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, - 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x8c, 0x07, 0x0a, 0x1d, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x27, 0x0a, - 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, - 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, - 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, - 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, - 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, - 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, - 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, - 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, - 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, - 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, - 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, - 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, - 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, - 0x62, 0x47, 0x61, 0x73, 0x12, 0x3a, 0x0a, 0x15, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x40, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x13, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x16, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, - 0x6f, 0x74, 0x12, 0x46, 0x0a, 0x1b, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x19, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, - 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, - 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, - 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, - 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, - 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, - 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, - 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, - 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, - 0x22, 0xa7, 0x02, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, - 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, - 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, - 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, - 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, - 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, - 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, - 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, - 0xab, 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, - 0x0a, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, - 0x36, 0x52, 0x0e, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, - 0x30, 0x39, 0x36, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, - 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, - 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, - 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, - 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x43, 0x0a, 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x10, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, - 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x43, - 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x32, 0x30, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x75, 0x62, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, - 0x38, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, - 0x2b, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0c, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x42, 0x96, 0x01, 0x0a, - 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0xc4, 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, + 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, + 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, + 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, + 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, + 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, + 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, + 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, + 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, + 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, + 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, + 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, + 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, + 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, + 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, + 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, + 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, + 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, + 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xa7, 0x02, 0x0a, + 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, + 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x11, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x6c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, + 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, 0x4e, 0x43, + 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, + 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, + 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, 0xab, 0x01, 0x0a, 0x0f, + 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0a, 0x57, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x78, + 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, + 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, + 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x0e, 0x6b, + 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, + 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, + 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, + 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, + 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, + 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, + 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x14, 0x45, + 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, + 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, + 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -2993,53 +2150,41 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte { } var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{ - (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status - (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload - (*ExecutionPayloadCapella)(nil), // 2: ethereum.engine.v1.ExecutionPayloadCapella - (*ExecutionPayloadDeneb)(nil), // 3: ethereum.engine.v1.ExecutionPayloadDeneb - (*ExecutionPayloadElectra)(nil), // 4: ethereum.engine.v1.ExecutionPayloadElectra - (*ExecutionPayloadElectraWithValueAndBlobsBundle)(nil), // 5: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle - (*ExecutionPayloadCapellaWithValue)(nil), // 6: ethereum.engine.v1.ExecutionPayloadCapellaWithValue - (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 7: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle - (*ExecutionPayloadHeader)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeader - (*ExecutionPayloadHeaderCapella)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*ExecutionPayloadHeaderDeneb)(nil), // 10: ethereum.engine.v1.ExecutionPayloadHeaderDeneb - (*ExecutionPayloadHeaderElectra)(nil), // 11: ethereum.engine.v1.ExecutionPayloadHeaderElectra - (*PayloadAttributes)(nil), // 12: ethereum.engine.v1.PayloadAttributes - (*PayloadAttributesV2)(nil), // 13: ethereum.engine.v1.PayloadAttributesV2 - (*PayloadAttributesV3)(nil), // 14: ethereum.engine.v1.PayloadAttributesV3 - (*PayloadStatus)(nil), // 15: ethereum.engine.v1.PayloadStatus - (*ForkchoiceState)(nil), // 16: ethereum.engine.v1.ForkchoiceState - (*Withdrawal)(nil), // 17: ethereum.engine.v1.Withdrawal - (*BlobsBundle)(nil), // 18: ethereum.engine.v1.BlobsBundle - (*Blob)(nil), // 19: ethereum.engine.v1.Blob - (*ExchangeCapabilities)(nil), // 20: ethereum.engine.v1.ExchangeCapabilities - (*WithdrawalRequest)(nil), // 21: ethereum.engine.v1.WithdrawalRequest - (*DepositRequest)(nil), // 22: ethereum.engine.v1.DepositRequest - (*ConsolidationRequest)(nil), // 23: ethereum.engine.v1.ConsolidationRequest + (PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status + (*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload + (*ExecutionPayloadCapella)(nil), // 2: ethereum.engine.v1.ExecutionPayloadCapella + (*ExecutionPayloadDeneb)(nil), // 3: ethereum.engine.v1.ExecutionPayloadDeneb + (*ExecutionPayloadCapellaWithValue)(nil), // 4: ethereum.engine.v1.ExecutionPayloadCapellaWithValue + (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 5: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle + (*ExecutionPayloadHeader)(nil), // 6: ethereum.engine.v1.ExecutionPayloadHeader + (*ExecutionPayloadHeaderCapella)(nil), // 7: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*ExecutionPayloadHeaderDeneb)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*PayloadAttributes)(nil), // 9: ethereum.engine.v1.PayloadAttributes + (*PayloadAttributesV2)(nil), // 10: ethereum.engine.v1.PayloadAttributesV2 + (*PayloadAttributesV3)(nil), // 11: ethereum.engine.v1.PayloadAttributesV3 + (*PayloadStatus)(nil), // 12: ethereum.engine.v1.PayloadStatus + (*ForkchoiceState)(nil), // 13: ethereum.engine.v1.ForkchoiceState + (*Withdrawal)(nil), // 14: ethereum.engine.v1.Withdrawal + (*BlobsBundle)(nil), // 15: ethereum.engine.v1.BlobsBundle + (*Blob)(nil), // 16: ethereum.engine.v1.Blob + (*ExchangeCapabilities)(nil), // 17: ethereum.engine.v1.ExchangeCapabilities } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ - 17, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 1: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 2: ethereum.engine.v1.ExecutionPayloadElectra.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 22, // 3: ethereum.engine.v1.ExecutionPayloadElectra.deposit_requests:type_name -> ethereum.engine.v1.DepositRequest - 21, // 4: ethereum.engine.v1.ExecutionPayloadElectra.withdrawal_requests:type_name -> ethereum.engine.v1.WithdrawalRequest - 23, // 5: ethereum.engine.v1.ExecutionPayloadElectra.consolidation_requests:type_name -> ethereum.engine.v1.ConsolidationRequest - 4, // 6: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra - 18, // 7: ethereum.engine.v1.ExecutionPayloadElectraWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 2, // 8: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 3, // 9: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 18, // 10: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 17, // 11: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 17, // 12: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 0, // 13: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 14, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 14, // 1: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 2, // 2: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella + 3, // 3: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 15, // 4: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 14, // 5: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 14, // 6: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 0, // 7: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_proto_engine_v1_execution_engine_proto_init() } @@ -3085,30 +2230,6 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadElectra); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadElectraWithValueAndBlobsBundle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadCapellaWithValue); i { case 0: return &v.state @@ -3120,7 +2241,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { case 0: return &v.state @@ -3132,7 +2253,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeader); i { case 0: return &v.state @@ -3144,7 +2265,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderCapella); i { case 0: return &v.state @@ -3156,7 +2277,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderDeneb); i { case 0: return &v.state @@ -3168,19 +2289,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadHeaderElectra); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadAttributes); i { case 0: return &v.state @@ -3192,7 +2301,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadAttributesV2); i { case 0: return &v.state @@ -3204,7 +2313,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadAttributesV3); i { case 0: return &v.state @@ -3216,7 +2325,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadStatus); i { case 0: return &v.state @@ -3228,7 +2337,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ForkchoiceState); i { case 0: return &v.state @@ -3240,7 +2349,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Withdrawal); i { case 0: return &v.state @@ -3252,7 +2361,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlobsBundle); i { case 0: return &v.state @@ -3264,7 +2373,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Blob); i { case 0: return &v.state @@ -3276,7 +2385,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExchangeCapabilities); i { case 0: return &v.state @@ -3288,42 +2397,6 @@ func file_proto_engine_v1_execution_engine_proto_init() { return nil } } - file_proto_engine_v1_execution_engine_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WithdrawalRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_execution_engine_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DepositRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_execution_engine_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConsolidationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3331,7 +2404,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index 33e3464410eb..050848c0fb48 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -81,37 +81,6 @@ message ExecutionPayloadDeneb { uint64 excess_blob_gas = 17; } -message ExecutionPayloadElectra { - bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"]; - bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"]; - bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 block_number = 7; - uint64 gas_limit = 8; - uint64 gas_used = 9; - uint64 timestamp = 10; - bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"]; - bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; - repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"]; - // MAX_WITHDRAWALS_PER_PAYLOAD - repeated Withdrawal withdrawals = 15 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"]; - uint64 blob_gas_used = 16; - uint64 excess_blob_gas = 17; - repeated DepositRequest deposit_requests = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_requests_per_payload.size"]; // new in electra, eip6110 - repeated WithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251 - repeated ConsolidationRequest consolidation_requests = 20 [(ethereum.eth.ext.ssz_max) = "max_consolidation_requests_per_payload.size"]; // new in electra, eip6110 -} - -message ExecutionPayloadElectraWithValueAndBlobsBundle { - ExecutionPayloadElectra payload = 1; - bytes value = 2; - BlobsBundle blobs_bundle = 3; - bool should_override_builder = 4; -} - message ExecutionPayloadCapellaWithValue { ExecutionPayloadCapella payload = 1; bytes value = 2; @@ -180,29 +149,6 @@ message ExecutionPayloadHeaderDeneb { uint64 excess_blob_gas = 17; } -message ExecutionPayloadHeaderElectra { - bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"]; - bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"]; - bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 block_number = 7; - uint64 gas_limit = 8; - uint64 gas_used = 9; - uint64 timestamp = 10; - bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"]; - bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes transactions_root = 14 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes withdrawals_root = 15 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 blob_gas_used = 16; - uint64 excess_blob_gas = 17; - bytes deposit_requests_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110 - bytes withdrawal_requests_root = 19 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7002, eip7251 - bytes consolidation_requests_root = 20 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7251 -} - message PayloadAttributes { uint64 timestamp = 1; bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"]; @@ -281,37 +227,3 @@ message Blob { message ExchangeCapabilities { repeated string supported_methods = 1; } - -// WithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address -// new in Electra -message WithdrawalRequest { - // The execution address receiving the funds - bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; - - // 48 byte BLS public key of the validator. - bytes validator_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; - - // Deposit amount in gwei. - uint64 amount = 3; -} - -// DepositRequest is the message from the execution layer to trigger the deposit of a validator's balance to its balance -// new in Electra -message DepositRequest { - bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"]; - bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 amount = 3; - bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"]; - uint64 index = 5; -} - -// ConsolidationRequest is the message from the execution layer to trigger the consolidation of one -// validator to another validator. -message ConsolidationRequest { - // Source address of account which originated the request. - bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"]; - // Funds will be moved from this public key. - bytes source_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; - // Funds will be moved to this public key. - bytes target_pubkey = 3 [(ethereum.eth.ext.ssz_size) = "48"]; -} diff --git a/proto/engine/v1/execution_engine_fuzz_test.go b/proto/engine/v1/execution_engine_fuzz_test.go index fbed9d9b6141..1a39a4f13b1a 100644 --- a/proto/engine/v1/execution_engine_fuzz_test.go +++ b/proto/engine/v1/execution_engine_fuzz_test.go @@ -10,14 +10,12 @@ import ( ) func TestCopyExecutionPayload_Fuzz(t *testing.T) { - fuzzCopies(t, &enginev1.ExecutionPayloadElectra{}) fuzzCopies(t, &enginev1.ExecutionPayloadDeneb{}) fuzzCopies(t, &enginev1.ExecutionPayloadCapella{}) fuzzCopies(t, &enginev1.ExecutionPayload{}) } func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) { - fuzzCopies(t, &enginev1.ExecutionPayloadHeaderElectra{}) fuzzCopies(t, &enginev1.ExecutionPayloadHeaderDeneb{}) fuzzCopies(t, &enginev1.ExecutionPayloadHeaderCapella{}) fuzzCopies(t, &enginev1.ExecutionPayloadHeader{}) diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index 3a7de3a5efe4..13ed85726cad 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -297,37 +297,6 @@ type GetPayloadV3ResponseJson struct { ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"` } -type GetPayloadV4ResponseJson struct { - ExecutionPayload *ExecutionPayloadElectraJSON `json:"executionPayload"` - BlockValue string `json:"blockValue"` - BlobsBundle *BlobBundleJSON `json:"blobsBundle"` - ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"` -} - -// ExecutionPayloadElectraJSON represents the engine API ExecutionPayloadV4 type. -type ExecutionPayloadElectraJSON struct { - ParentHash *common.Hash `json:"parentHash"` - FeeRecipient *common.Address `json:"feeRecipient"` - StateRoot *common.Hash `json:"stateRoot"` - ReceiptsRoot *common.Hash `json:"receiptsRoot"` - LogsBloom *hexutil.Bytes `json:"logsBloom"` - PrevRandao *common.Hash `json:"prevRandao"` - BlockNumber *hexutil.Uint64 `json:"blockNumber"` - GasLimit *hexutil.Uint64 `json:"gasLimit"` - GasUsed *hexutil.Uint64 `json:"gasUsed"` - Timestamp *hexutil.Uint64 `json:"timestamp"` - ExtraData hexutil.Bytes `json:"extraData"` - BaseFeePerGas string `json:"baseFeePerGas"` - BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` - ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` - BlockHash *common.Hash `json:"blockHash"` - Transactions []hexutil.Bytes `json:"transactions"` - Withdrawals []*Withdrawal `json:"withdrawals"` - WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"` - DepositRequests []DepositRequestV1 `json:"depositRequests"` - ConsolidationRequests []ConsolidationRequestV1 `json:"consolidationRequests"` -} - // ExecutionPayloadBody represents the engine API ExecutionPayloadV1 or ExecutionPayloadV2 type. type ExecutionPayloadBody struct { Transactions []hexutil.Bytes `json:"transactions"` @@ -337,64 +306,6 @@ type ExecutionPayloadBody struct { ConsolidationRequests []ConsolidationRequestV1 `json:"consolidationRequests"` } -// Validate returns an error if key fields in GetPayloadV4ResponseJson are nil or invalid. -func (j *GetPayloadV4ResponseJson) Validate() error { - if j.ExecutionPayload == nil { - return errors.New("nil ExecutionPayload") - } - return j.ExecutionPayload.Validate() -} - -// Validate returns an error if key fields in ExecutionPayloadElectraJSON are nil or invalid. -func (j *ExecutionPayloadElectraJSON) Validate() error { - if j.ParentHash == nil { - return errors.New("missing required field 'parentHash' for ExecutionPayload") - } - if j.FeeRecipient == nil { - return errors.New("missing required field 'feeRecipient' for ExecutionPayload") - } - if j.StateRoot == nil { - return errors.New("missing required field 'stateRoot' for ExecutionPayload") - } - if j.ReceiptsRoot == nil { - return errors.New("missing required field 'receiptsRoot' for ExecutableDataV1") - } - if j.LogsBloom == nil { - return errors.New("missing required field 'logsBloom' for ExecutionPayload") - } - if j.PrevRandao == nil { - return errors.New("missing required field 'prevRandao' for ExecutionPayload") - } - if j.ExtraData == nil { - return errors.New("missing required field 'extraData' for ExecutionPayload") - } - if j.BlockHash == nil { - return errors.New("missing required field 'blockHash' for ExecutionPayload") - } - if j.Transactions == nil { - return errors.New("missing required field 'transactions' for ExecutionPayload") - } - if j.BlockNumber == nil { - return errors.New("missing required field 'blockNumber' for ExecutionPayload") - } - if j.Timestamp == nil { - return errors.New("missing required field 'timestamp' for ExecutionPayload") - } - if j.GasUsed == nil { - return errors.New("missing required field 'gasUsed' for ExecutionPayload") - } - if j.GasLimit == nil { - return errors.New("missing required field 'gasLimit' for ExecutionPayload") - } - if j.BlobGasUsed == nil { - return errors.New("missing required field 'blobGasUsed' for ExecutionPayload") - } - if j.ExcessBlobGas == nil { - return errors.New("missing required field 'excessBlobGas' for ExecutionPayload") - } - return nil -} - type ExecutionPayloadDenebJSON struct { ParentHash *common.Hash `json:"parentHash"` FeeRecipient *common.Address `json:"feeRecipient"` @@ -966,55 +877,6 @@ func (e *ExecutionPayloadDeneb) MarshalJSON() ([]byte, error) { }) } -func (e *ExecutionPayloadElectra) MarshalJSON() ([]byte, error) { - transactions := make([]hexutil.Bytes, len(e.Transactions)) - for i, tx := range e.Transactions { - transactions[i] = tx - } - baseFee := new(big.Int).SetBytes(bytesutil.ReverseByteOrder(e.BaseFeePerGas)) - baseFeeHex := hexutil.EncodeBig(baseFee) - pHash := common.BytesToHash(e.ParentHash) - sRoot := common.BytesToHash(e.StateRoot) - recRoot := common.BytesToHash(e.ReceiptsRoot) - prevRan := common.BytesToHash(e.PrevRandao) - bHash := common.BytesToHash(e.BlockHash) - blockNum := hexutil.Uint64(e.BlockNumber) - gasLimit := hexutil.Uint64(e.GasLimit) - gasUsed := hexutil.Uint64(e.GasUsed) - timeStamp := hexutil.Uint64(e.Timestamp) - recipient := common.BytesToAddress(e.FeeRecipient) - logsBloom := hexutil.Bytes(e.LogsBloom) - withdrawals := e.Withdrawals - if withdrawals == nil { - withdrawals = make([]*Withdrawal, 0) - } - blobGasUsed := hexutil.Uint64(e.BlobGasUsed) - excessBlobGas := hexutil.Uint64(e.ExcessBlobGas) - - return json.Marshal(ExecutionPayloadElectraJSON{ - ParentHash: &pHash, - FeeRecipient: &recipient, - StateRoot: &sRoot, - ReceiptsRoot: &recRoot, - LogsBloom: &logsBloom, - PrevRandao: &prevRan, - BlockNumber: &blockNum, - GasLimit: &gasLimit, - GasUsed: &gasUsed, - Timestamp: &timeStamp, - ExtraData: e.ExtraData, - BaseFeePerGas: baseFeeHex, - BlockHash: &bHash, - Transactions: transactions, - Withdrawals: withdrawals, - BlobGasUsed: &blobGasUsed, - ExcessBlobGas: &excessBlobGas, - WithdrawalRequests: ProtoWithdrawalRequestsToJson(e.WithdrawalRequests), - DepositRequests: ProtoDepositRequestsToJson(e.DepositRequests), - ConsolidationRequests: ProtoConsolidationRequestsToJson(e.ConsolidationRequests), - }) -} - func JsonDepositRequestsToProto(j []DepositRequestV1) ([]*DepositRequest, error) { reqs := make([]*DepositRequest, len(j)) @@ -1128,112 +990,6 @@ func ProtoConsolidationRequestsToJson(reqs []*ConsolidationRequest) []Consolidat return j } -func (j *ExecutionPayloadElectraJSON) ElectraPayload() (*ExecutionPayloadElectra, error) { - baseFeeBigEnd, err := hexutil.DecodeBig(j.BaseFeePerGas) - if err != nil { - return nil, err - } - baseFee := bytesutil.PadTo(bytesutil.ReverseByteOrder(baseFeeBigEnd.Bytes()), fieldparams.RootLength) - - transactions := make([][]byte, len(j.Transactions)) - for i, tx := range j.Transactions { - transactions[i] = tx - } - if j.Withdrawals == nil { - j.Withdrawals = make([]*Withdrawal, 0) - } - dr, err := JsonDepositRequestsToProto(j.DepositRequests) - if err != nil { - return nil, err - } - wr, err := JsonWithdrawalRequestsToProto(j.WithdrawalRequests) - if err != nil { - return nil, err - } - cr, err := JsonConsolidationRequestsToProto(j.ConsolidationRequests) - if err != nil { - return nil, err - } - return &ExecutionPayloadElectra{ - ParentHash: j.ParentHash.Bytes(), - FeeRecipient: j.FeeRecipient.Bytes(), - StateRoot: j.StateRoot.Bytes(), - ReceiptsRoot: j.ReceiptsRoot.Bytes(), - LogsBloom: *j.LogsBloom, - PrevRandao: j.PrevRandao.Bytes(), - BlockNumber: uint64(*j.BlockNumber), - GasLimit: uint64(*j.GasLimit), - GasUsed: uint64(*j.GasUsed), - Timestamp: uint64(*j.Timestamp), - ExtraData: j.ExtraData, - BaseFeePerGas: baseFee, - BlockHash: j.BlockHash.Bytes(), - Transactions: transactions, - Withdrawals: j.Withdrawals, - BlobGasUsed: uint64(*j.BlobGasUsed), - ExcessBlobGas: uint64(*j.ExcessBlobGas), - DepositRequests: dr, - WithdrawalRequests: wr, - ConsolidationRequests: cr, - }, nil -} - -func (j *BlobBundleJSON) ElectraBlobsBundle() *BlobsBundle { - if j == nil { - return nil - } - - commitments := make([][]byte, len(j.Commitments)) - for i, kzg := range j.Commitments { - k := kzg - commitments[i] = bytesutil.PadTo(k[:], fieldparams.BLSPubkeyLength) - } - - proofs := make([][]byte, len(j.Proofs)) - for i, proof := range j.Proofs { - p := proof - proofs[i] = bytesutil.PadTo(p[:], fieldparams.BLSPubkeyLength) - } - - blobs := make([][]byte, len(j.Blobs)) - for i, blob := range j.Blobs { - b := make([]byte, fieldparams.BlobLength) - copy(b, blob) - blobs[i] = b - } - - return &BlobsBundle{ - KzgCommitments: commitments, - Proofs: proofs, - Blobs: blobs, - } -} - -func (e *ExecutionPayloadElectraWithValueAndBlobsBundle) UnmarshalJSON(enc []byte) error { - dec := &GetPayloadV4ResponseJson{} - if err := json.Unmarshal(enc, dec); err != nil { - return err - } - if err := dec.Validate(); err != nil { - return err - } - - *e = ExecutionPayloadElectraWithValueAndBlobsBundle{Payload: &ExecutionPayloadElectra{}} - e.ShouldOverrideBuilder = dec.ShouldOverrideBuilder - blockValueBigEnd, err := hexutil.DecodeBig(dec.BlockValue) - if err != nil { - return errors.Wrapf(err, "failed to parse blockValue=%s", dec.BlockValue) - } - e.Value = bytesutil.PadTo(bytesutil.ReverseByteOrder(blockValueBigEnd.Bytes()), fieldparams.RootLength) - e.Payload, err = dec.ExecutionPayload.ElectraPayload() - if err != nil { - return err - } - e.BlobsBundle = dec.BlobsBundle.ElectraBlobsBundle() - - return nil -} - func (e *ExecutionPayloadDenebWithValueAndBlobsBundle) UnmarshalJSON(enc []byte) error { dec := GetPayloadV3ResponseJson{} if err := json.Unmarshal(enc, &dec); err != nil { diff --git a/proto/engine/v1/json_marshal_unmarshal_test.go b/proto/engine/v1/json_marshal_unmarshal_test.go index bc1d8dab6fd6..9ce48ac0b680 100644 --- a/proto/engine/v1/json_marshal_unmarshal_test.go +++ b/proto/engine/v1/json_marshal_unmarshal_test.go @@ -273,161 +273,6 @@ func TestJsonMarshalUnmarshal(t *testing.T) { bytesutil.PadTo([]byte{'k'}, 131072), bytesutil.PadTo([]byte{'l'}, 131072)}, pb.BlobsBundle.Blobs) }) - t.Run("execution payload electra", func(t *testing.T) { - parentHash := common.BytesToHash([]byte("parent")) - feeRecipient := common.BytesToAddress([]byte("feeRecipient")) - stateRoot := common.BytesToHash([]byte("stateRoot")) - receiptsRoot := common.BytesToHash([]byte("receiptsRoot")) - logsBloom := hexutil.Bytes(bytesutil.PadTo([]byte("logs"), fieldparams.LogsBloomLength)) - random := common.BytesToHash([]byte("random")) - extra := common.BytesToHash([]byte("extra")) - hash := common.BytesToHash([]byte("hash")) - bn := hexutil.Uint64(1) - gl := hexutil.Uint64(2) - gu := hexutil.Uint64(3) - ts := hexutil.Uint64(4) - bgu := hexutil.Uint64(5) - ebg := hexutil.Uint64(6) - - withdrawalReq := []*enginev1.WithdrawalRequest{ - { - SourceAddress: bytesutil.PadTo([]byte("sourceAddress-1"), 20), - ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-1"), 48), - Amount: 1, - }, - { - SourceAddress: bytesutil.PadTo([]byte("sourceAddress-2"), 20), - ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-2"), 48), - Amount: 2, - }, - { - SourceAddress: bytesutil.PadTo([]byte("sourceAddress-3"), 20), - ValidatorPubkey: bytesutil.PadTo([]byte("pubKey-3"), 48), - Amount: 3, - }, - } - depositReq := []*enginev1.DepositRequest{ - { - Pubkey: bytesutil.PadTo([]byte("pubKey-1"), 48), - WithdrawalCredentials: bytesutil.PadTo([]byte("creds-1"), 32), - Amount: 1, - Signature: bytesutil.PadTo([]byte("sig-1"), 96), - Index: 11, - }, - { - Pubkey: bytesutil.PadTo([]byte("pubKey-2"), 48), - WithdrawalCredentials: bytesutil.PadTo([]byte("creds-2"), 32), - Amount: 2, - Signature: bytesutil.PadTo([]byte("sig-2"), 96), - Index: 12, - }, - { - Pubkey: bytesutil.PadTo([]byte("pubKey-3"), 48), - WithdrawalCredentials: bytesutil.PadTo([]byte("creds-3"), 32), - Amount: 3, - Signature: bytesutil.PadTo([]byte("sig-3"), 96), - Index: 13, - }, - } - - consolidationReq := []*enginev1.ConsolidationRequest{ - { - SourceAddress: bytesutil.PadTo([]byte("sourceAddress-1"), 20), - SourcePubkey: bytesutil.PadTo([]byte("s-pubKey-1"), 48), - TargetPubkey: bytesutil.PadTo([]byte("t-pubKey-1"), 48), - }, - } - - resp := &enginev1.GetPayloadV4ResponseJson{ - BlobsBundle: &enginev1.BlobBundleJSON{ - Commitments: []hexutil.Bytes{{'a'}, {'b'}, {'c'}, {'d'}}, - Proofs: []hexutil.Bytes{{'e'}, {'f'}, {'g'}, {'h'}}, - Blobs: []hexutil.Bytes{{'i'}, {'j'}, {'k'}, {'l'}}, - }, - BlockValue: "0x123", - ExecutionPayload: &enginev1.ExecutionPayloadElectraJSON{ - ParentHash: &parentHash, - FeeRecipient: &feeRecipient, - StateRoot: &stateRoot, - ReceiptsRoot: &receiptsRoot, - LogsBloom: &logsBloom, - PrevRandao: &random, - BlockNumber: &bn, - GasLimit: &gl, - GasUsed: &gu, - Timestamp: &ts, - ExtraData: hexutil.Bytes(extra[:]), - BaseFeePerGas: "0x123", - BlockHash: &hash, - Transactions: []hexutil.Bytes{{}}, - Withdrawals: []*enginev1.Withdrawal{{ - Index: 1, - ValidatorIndex: 1, - Address: bytesutil.PadTo([]byte("address"), 20), - Amount: 1, - }}, - BlobGasUsed: &bgu, - ExcessBlobGas: &ebg, - WithdrawalRequests: enginev1.ProtoWithdrawalRequestsToJson(withdrawalReq), - DepositRequests: enginev1.ProtoDepositRequestsToJson(depositReq), - ConsolidationRequests: enginev1.ProtoConsolidationRequestsToJson(consolidationReq), - }, - } - enc, err := json.Marshal(resp) - require.NoError(t, err) - pb := &enginev1.ExecutionPayloadElectraWithValueAndBlobsBundle{} - require.NoError(t, json.Unmarshal(enc, pb)) - require.DeepEqual(t, parentHash.Bytes(), pb.Payload.ParentHash) - require.DeepEqual(t, feeRecipient.Bytes(), pb.Payload.FeeRecipient) - require.DeepEqual(t, stateRoot.Bytes(), pb.Payload.StateRoot) - require.DeepEqual(t, receiptsRoot.Bytes(), pb.Payload.ReceiptsRoot) - require.DeepEqual(t, logsBloom, hexutil.Bytes(pb.Payload.LogsBloom)) - require.DeepEqual(t, random.Bytes(), pb.Payload.PrevRandao) - require.DeepEqual(t, uint64(1), pb.Payload.BlockNumber) - require.DeepEqual(t, uint64(2), pb.Payload.GasLimit) - require.DeepEqual(t, uint64(3), pb.Payload.GasUsed) - require.DeepEqual(t, uint64(4), pb.Payload.Timestamp) - require.DeepEqual(t, uint64(5), pb.Payload.BlobGasUsed) - require.DeepEqual(t, uint64(6), pb.Payload.ExcessBlobGas) - require.DeepEqual(t, extra.Bytes(), pb.Payload.ExtraData) - feePerGas := new(big.Int).SetBytes(pb.Payload.BaseFeePerGas) - require.Equal(t, "15832716547479101977395928904157292820330083199902421483727713169783165812736", feePerGas.String()) - require.DeepEqual(t, hash.Bytes(), pb.Payload.BlockHash) - require.DeepEqual(t, [][]byte{{}}, pb.Payload.Transactions) - require.Equal(t, 1, len(pb.Payload.Withdrawals)) - withdrawal := pb.Payload.Withdrawals[0] - require.Equal(t, uint64(1), withdrawal.Index) - require.Equal(t, primitives.ValidatorIndex(1), withdrawal.ValidatorIndex) - require.DeepEqual(t, bytesutil.PadTo([]byte("address"), 20), withdrawal.Address) - require.Equal(t, uint64(1), withdrawal.Amount) - require.DeepEqual(t, [][]byte{ - bytesutil.PadTo([]byte{'e'}, 48), - bytesutil.PadTo([]byte{'f'}, 48), - bytesutil.PadTo([]byte{'g'}, 48), - bytesutil.PadTo([]byte{'h'}, 48)}, pb.BlobsBundle.Proofs) - require.DeepEqual(t, [][]byte{ - bytesutil.PadTo([]byte{'a'}, 48), - bytesutil.PadTo([]byte{'b'}, 48), - bytesutil.PadTo([]byte{'c'}, 48), - bytesutil.PadTo([]byte{'d'}, 48)}, pb.BlobsBundle.KzgCommitments) - require.DeepEqual(t, [][]byte{ - bytesutil.PadTo([]byte{'i'}, 131072), - bytesutil.PadTo([]byte{'j'}, 131072), - bytesutil.PadTo([]byte{'k'}, 131072), - bytesutil.PadTo([]byte{'l'}, 131072)}, pb.BlobsBundle.Blobs) - require.Equal(t, len(pb.Payload.WithdrawalRequests), len(withdrawalReq)) - for i := range pb.Payload.WithdrawalRequests { - require.DeepEqual(t, pb.Payload.WithdrawalRequests[i], withdrawalReq[i]) - } - require.Equal(t, len(pb.Payload.DepositRequests), len(depositReq)) - for i := range pb.Payload.DepositRequests { - require.DeepEqual(t, pb.Payload.DepositRequests[i], depositReq[i]) - } - require.Equal(t, len(pb.Payload.ConsolidationRequests), len(consolidationReq)) - for i := range pb.Payload.ConsolidationRequests { - require.DeepEqual(t, pb.Payload.ConsolidationRequests[i], consolidationReq[i]) - } - }) t.Run("execution block", func(t *testing.T) { baseFeePerGas := big.NewInt(1770307273) want := &gethtypes.Header{ diff --git a/proto/eth/v1/gateway.ssz.go b/proto/eth/v1/gateway.ssz.go index 630663138b11..9917b1fadc17 100644 --- a/proto/eth/v1/gateway.ssz.go +++ b/proto/eth/v1/gateway.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: dc11029a7f019f6c900b35f68bbe0a9ff6ca31ba1f7d8c18518cad810690300d +// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c package v1 import ( diff --git a/proto/eth/v2/grpc.ssz.go b/proto/eth/v2/grpc.ssz.go index af4fd70ce818..556abe7bbcdb 100644 --- a/proto/eth/v2/grpc.ssz.go +++ b/proto/eth/v2/grpc.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 +// Hash: bc8a0f7f6c8dadac6bcb0eaab2dea4888cc44c5b3f4fe9998a71e15f1a059399 package eth import ( diff --git a/proto/eth/v2/version.pb.go b/proto/eth/v2/version.pb.go index ca119f18a05e..00cc5f383e01 100755 --- a/proto/eth/v2/version.pb.go +++ b/proto/eth/v2/version.pb.go @@ -29,6 +29,7 @@ const ( Version_BELLATRIX Version = 2 Version_CAPELLA Version = 3 Version_DENEB Version = 4 + Version_ELECTRA Version = 5 ) // Enum value maps for Version. @@ -39,6 +40,7 @@ var ( 2: "BELLATRIX", 3: "CAPELLA", 4: "DENEB", + 5: "ELECTRA", } Version_value = map[string]int32{ "PHASE0": 0, @@ -46,6 +48,7 @@ var ( "BELLATRIX": 2, "CAPELLA": 3, "DENEB": 4, + "ELECTRA": 5, } ) @@ -81,20 +84,21 @@ var File_proto_eth_v2_version_proto protoreflect.FileDescriptor var file_proto_eth_v2_version_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2a, 0x48, 0x0a, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2a, 0x55, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x48, 0x41, 0x53, 0x45, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x4c, 0x54, 0x41, 0x49, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x45, 0x4c, 0x4c, 0x41, 0x54, 0x52, 0x49, 0x58, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x41, 0x50, 0x45, 0x4c, 0x4c, 0x41, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, - 0x44, 0x45, 0x4e, 0x45, 0x42, 0x10, 0x04, 0x42, 0x7d, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0c, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, - 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, - 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, - 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x44, 0x45, 0x4e, 0x45, 0x42, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4c, 0x45, 0x43, 0x54, + 0x52, 0x41, 0x10, 0x05, 0x42, 0x7d, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, + 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, + 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/eth/v2/version.proto b/proto/eth/v2/version.proto index 4489a15fc43c..6a16e9c77209 100644 --- a/proto/eth/v2/version.proto +++ b/proto/eth/v2/version.proto @@ -29,4 +29,5 @@ enum Version { BELLATRIX = 2; CAPELLA = 3; DENEB = 4; + ELECTRA = 5; } diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go index 45521fbe747e..166f17e1f1c8 100644 --- a/proto/prysm/v1alpha1/altair.ssz.go +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: c00c1be829cdae457076ef3e840f3af313626147927e503e90fb5585cf242d36 +// Hash: bb838fc0c2dfdadd4a8274dd1b438b1051f7b84d7c8e7470900621284dba8f43 package eth import ( diff --git a/proto/prysm/v1alpha1/beacon_block.go b/proto/prysm/v1alpha1/beacon_block.go index ddf48f5c2c5d..be4366b710d2 100644 --- a/proto/prysm/v1alpha1/beacon_block.go +++ b/proto/prysm/v1alpha1/beacon_block.go @@ -1,6 +1,9 @@ package eth -import "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" +import ( + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) // Copy -- func (sigBlock *SignedBeaconBlock) Copy() *SignedBeaconBlock { @@ -310,6 +313,7 @@ func (body *BlindedBeaconBlockBodyElectra) Copy() *BlindedBeaconBlockBodyElectra ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + ExecutionRequests: CopyExecutionRequests(body.ExecutionRequests), } } @@ -362,6 +366,31 @@ func CopyBlobKZGs(b [][]byte) [][]byte { return bytesutil.SafeCopy2dBytes(b) } +// CopyExecutionRequests copies the provided execution requests. +func CopyExecutionRequests(e *enginev1.ExecutionRequests) *enginev1.ExecutionRequests { + if e == nil { + return nil + } + dr := make([]*enginev1.DepositRequest, len(e.Deposits)) + for i, d := range e.Deposits { + dr[i] = d.Copy() + } + wr := make([]*enginev1.WithdrawalRequest, len(e.Withdrawals)) + for i, w := range e.Withdrawals { + wr[i] = w.Copy() + } + cr := make([]*enginev1.ConsolidationRequest, len(e.Consolidations)) + for i, c := range e.Consolidations { + cr[i] = c.Copy() + } + + return &enginev1.ExecutionRequests{ + Deposits: dr, + Withdrawals: wr, + Consolidations: cr, + } +} + // Copy -- func (sigBlock *SignedBeaconBlockDeneb) Copy() *SignedBeaconBlockDeneb { if sigBlock == nil { @@ -451,6 +480,7 @@ func (body *BeaconBlockBodyElectra) Copy() *BeaconBlockBodyElectra { ExecutionPayload: body.ExecutionPayload.Copy(), BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), + ExecutionRequests: CopyExecutionRequests(body.ExecutionRequests), } } diff --git a/proto/prysm/v1alpha1/beacon_block.pb.go b/proto/prysm/v1alpha1/beacon_block.pb.go index 15c3774b84a4..609020724f75 100755 --- a/proto/prysm/v1alpha1/beacon_block.pb.go +++ b/proto/prysm/v1alpha1/beacon_block.pb.go @@ -3591,9 +3591,10 @@ type BeaconBlockBodyElectra struct { Deposits []*Deposit `protobuf:"bytes,7,rep,name=deposits,proto3" json:"deposits,omitempty" ssz-max:"16"` VoluntaryExits []*SignedVoluntaryExit `protobuf:"bytes,8,rep,name=voluntary_exits,json=voluntaryExits,proto3" json:"voluntary_exits,omitempty" ssz-max:"16"` SyncAggregate *SyncAggregate `protobuf:"bytes,9,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` - ExecutionPayload *v1.ExecutionPayloadElectra `protobuf:"bytes,10,opt,name=execution_payload,json=executionPayload,proto3" json:"execution_payload,omitempty"` + ExecutionPayload *v1.ExecutionPayloadDeneb `protobuf:"bytes,10,opt,name=execution_payload,json=executionPayload,proto3" json:"execution_payload,omitempty"` BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + ExecutionRequests *v1.ExecutionRequests `protobuf:"bytes,13,opt,name=execution_requests,json=executionRequests,proto3" json:"execution_requests,omitempty"` } func (x *BeaconBlockBodyElectra) Reset() { @@ -3691,7 +3692,7 @@ func (x *BeaconBlockBodyElectra) GetSyncAggregate() *SyncAggregate { return nil } -func (x *BeaconBlockBodyElectra) GetExecutionPayload() *v1.ExecutionPayloadElectra { +func (x *BeaconBlockBodyElectra) GetExecutionPayload() *v1.ExecutionPayloadDeneb { if x != nil { return x.ExecutionPayload } @@ -3712,6 +3713,13 @@ func (x *BeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { return nil } +func (x *BeaconBlockBodyElectra) GetExecutionRequests() *v1.ExecutionRequests { + if x != nil { + return x.ExecutionRequests + } + return nil +} + type SignedBlindedBeaconBlockElectra struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3851,18 +3859,19 @@ type BlindedBeaconBlockBodyElectra struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RandaoReveal []byte `protobuf:"bytes,1,opt,name=randao_reveal,json=randaoReveal,proto3" json:"randao_reveal,omitempty" ssz-size:"96"` - Eth1Data *Eth1Data `protobuf:"bytes,2,opt,name=eth1_data,json=eth1Data,proto3" json:"eth1_data,omitempty"` - Graffiti []byte `protobuf:"bytes,3,opt,name=graffiti,proto3" json:"graffiti,omitempty" ssz-size:"32"` - ProposerSlashings []*ProposerSlashing `protobuf:"bytes,4,rep,name=proposer_slashings,json=proposerSlashings,proto3" json:"proposer_slashings,omitempty" ssz-max:"16"` - AttesterSlashings []*AttesterSlashingElectra `protobuf:"bytes,5,rep,name=attester_slashings,json=attesterSlashings,proto3" json:"attester_slashings,omitempty" ssz-max:"1"` - Attestations []*AttestationElectra `protobuf:"bytes,6,rep,name=attestations,proto3" json:"attestations,omitempty" ssz-max:"8"` - Deposits []*Deposit `protobuf:"bytes,7,rep,name=deposits,proto3" json:"deposits,omitempty" ssz-max:"16"` - VoluntaryExits []*SignedVoluntaryExit `protobuf:"bytes,8,rep,name=voluntary_exits,json=voluntaryExits,proto3" json:"voluntary_exits,omitempty" ssz-max:"16"` - SyncAggregate *SyncAggregate `protobuf:"bytes,9,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` - ExecutionPayloadHeader *v1.ExecutionPayloadHeaderElectra `protobuf:"bytes,10,opt,name=execution_payload_header,json=executionPayloadHeader,proto3" json:"execution_payload_header,omitempty"` - BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` - BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + RandaoReveal []byte `protobuf:"bytes,1,opt,name=randao_reveal,json=randaoReveal,proto3" json:"randao_reveal,omitempty" ssz-size:"96"` + Eth1Data *Eth1Data `protobuf:"bytes,2,opt,name=eth1_data,json=eth1Data,proto3" json:"eth1_data,omitempty"` + Graffiti []byte `protobuf:"bytes,3,opt,name=graffiti,proto3" json:"graffiti,omitempty" ssz-size:"32"` + ProposerSlashings []*ProposerSlashing `protobuf:"bytes,4,rep,name=proposer_slashings,json=proposerSlashings,proto3" json:"proposer_slashings,omitempty" ssz-max:"16"` + AttesterSlashings []*AttesterSlashingElectra `protobuf:"bytes,5,rep,name=attester_slashings,json=attesterSlashings,proto3" json:"attester_slashings,omitempty" ssz-max:"1"` + Attestations []*AttestationElectra `protobuf:"bytes,6,rep,name=attestations,proto3" json:"attestations,omitempty" ssz-max:"8"` + Deposits []*Deposit `protobuf:"bytes,7,rep,name=deposits,proto3" json:"deposits,omitempty" ssz-max:"16"` + VoluntaryExits []*SignedVoluntaryExit `protobuf:"bytes,8,rep,name=voluntary_exits,json=voluntaryExits,proto3" json:"voluntary_exits,omitempty" ssz-max:"16"` + SyncAggregate *SyncAggregate `protobuf:"bytes,9,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + ExecutionPayloadHeader *v1.ExecutionPayloadHeaderDeneb `protobuf:"bytes,10,opt,name=execution_payload_header,json=executionPayloadHeader,proto3" json:"execution_payload_header,omitempty"` + BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,11,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` + BlobKzgCommitments [][]byte `protobuf:"bytes,12,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + ExecutionRequests *v1.ExecutionRequests `protobuf:"bytes,13,opt,name=execution_requests,json=executionRequests,proto3" json:"execution_requests,omitempty"` } func (x *BlindedBeaconBlockBodyElectra) Reset() { @@ -3960,7 +3969,7 @@ func (x *BlindedBeaconBlockBodyElectra) GetSyncAggregate() *SyncAggregate { return nil } -func (x *BlindedBeaconBlockBodyElectra) GetExecutionPayloadHeader() *v1.ExecutionPayloadHeaderElectra { +func (x *BlindedBeaconBlockBodyElectra) GetExecutionPayloadHeader() *v1.ExecutionPayloadHeaderDeneb { if x != nil { return x.ExecutionPayloadHeader } @@ -3981,6 +3990,13 @@ func (x *BlindedBeaconBlockBodyElectra) GetBlobKzgCommitments() [][]byte { return nil } +func (x *BlindedBeaconBlockBodyElectra) GetExecutionRequests() *v1.ExecutionRequests { + if x != nil { + return x.ExecutionRequests + } + return nil +} + type ValidatorRegistrationV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4737,503 +4753,125 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x07, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, - 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x07, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, + 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, + 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, + 0x51, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, - 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, - 0x12, 0x51, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, - 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x12, 0x67, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x4b, 0x0a, 0x07, - 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x12, 0x67, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, - 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x4d, 0x0a, 0x05, - 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, - 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x5b, 0x0a, 0x0d, 0x62, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x53, 0x0a, 0x07, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x61, 0x0a, - 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, - 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x04, 0x08, 0x65, 0x10, 0x66, 0x22, 0x83, - 0x07, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, 0x68, 0x61, - 0x73, 0x65, 0x30, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, - 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x4b, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, - 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x12, 0x61, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, - 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, - 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, - 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x5b, - 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, 0x64, + 0x65, 0x64, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x4b, 0x0a, 0x07, 0x63, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, + 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x62, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x64, - 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x6e, 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x4d, 0x0a, 0x05, 0x64, + 0x65, 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, - 0x65, 0x6e, 0x65, 0x62, 0x12, 0x55, 0x0a, 0x0d, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, - 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x4d, 0x0a, 0x07, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, - 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x5b, 0x0a, 0x0f, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, - 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xec, 0x02, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, - 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x22, 0x73, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x38, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x11, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x59, - 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x22, 0x7f, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x3e, - 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x22, 0xd1, 0x04, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x5b, 0x0a, 0x0d, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, 0x69, 0x6e, 0x64, + 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x53, 0x0a, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, - 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, - 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x61, 0x0a, 0x0f, + 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, + 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, + 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x07, + 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4a, 0x04, 0x08, 0x65, 0x10, 0x66, 0x22, 0x83, 0x07, + 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x06, 0x70, 0x68, 0x61, 0x73, + 0x65, 0x30, 0x12, 0x42, 0x0a, 0x06, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x48, 0x00, 0x52, 0x06, + 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x4b, 0x0a, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, + 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, - 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, - 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, - 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x22, 0xa4, 0x05, 0x0a, 0x15, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, - 0x69, 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, - 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, - 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, - 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, - 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, + 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, + 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x09, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, + 0x72, 0x69, 0x78, 0x12, 0x61, 0x0a, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, + 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, - 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, - 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, - 0xa8, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x31, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x31, 0x12, - 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x22, 0xb2, 0x01, 0x0a, 0x10, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, - 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, - 0x4e, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, - 0xc7, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x55, 0x0a, 0x0d, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, - 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x31, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0x9a, 0x02, 0x0a, 0x07, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x33, 0x33, 0x2c, 0x33, 0x32, 0x52, - 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, - 0xb4, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x0d, 0x56, 0x6f, 0x6c, 0x75, 0x6e, - 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x22, 0x75, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, - 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x65, 0x78, 0x69, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x6f, - 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x52, 0x04, 0x65, 0x78, 0x69, - 0x74, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x45, 0x74, 0x68, 0x31, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xdb, 0x02, 0x0a, 0x11, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x08, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xad, 0x01, - 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, - 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xb6, 0x01, - 0x0a, 0x19, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x37, 0x0a, 0x11, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, - 0x37, 0x32, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0d, 0x53, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, - 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, - 0x36, 0x34, 0x52, 0x11, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x42, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x18, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, - 0x16, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, - 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, - 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0xfe, 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, - 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, - 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0xfa, 0x05, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, - 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, - 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, - 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, - 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, - 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, - 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, - 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, - 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x69, 0x78, 0x48, 0x00, 0x52, 0x10, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x6c, + 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x48, 0x00, 0x52, 0x07, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x5b, 0x0a, + 0x0f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x64, 0x65, + 0x6e, 0x65, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, - 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, - 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, - 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x51, 0x0a, 0x11, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x10, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x93, 0x01, - 0x0a, 0x21, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x12, 0x48, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, + 0x6e, 0x65, 0x62, 0x12, 0x55, 0x0a, 0x0d, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, + 0x65, 0x6e, 0x65, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x4d, 0x0a, 0x07, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, + 0x52, 0x07, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x5b, 0x0a, 0x0f, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, - 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, - 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x42, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x22, 0xec, 0x02, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, @@ -5251,210 +4889,89 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x22, 0x94, 0x06, 0x0a, 0x1f, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, - 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, - 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, - 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, - 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, - 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, - 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, - 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, - 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x22, 0x73, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x38, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x11, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x59, 0x0a, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x12, 0x64, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x1e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x43, 0x0a, 0x05, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, - 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, - 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xb6, - 0x01, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, - 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, - 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, - 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, - 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, - 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, - 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x7d, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf6, 0x02, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, - 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, - 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, - 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3f, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x22, 0x7f, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x3e, 0x0a, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, - 0xb3, 0x07, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x22, 0xd1, 0x04, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, - 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, - 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, - 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, - 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, - 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, - 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x10, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, - 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, - 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, - 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, - 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, - 0x6c, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xf3, 0x06, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, + 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x22, 0xa4, 0x05, 0x0a, 0x15, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x41, 0x6c, 0x74, 0x61, 0x69, + 0x72, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -5494,122 +5011,165 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, - 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x58, - 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, - 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, - 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, - 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, - 0x12, 0x46, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0xa8, + 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, + 0x69, 0x6e, 0x67, 0x12, 0x49, 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x31, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x31, 0x12, 0x49, + 0x0a, 0x08, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x22, 0xb2, 0x01, 0x0a, 0x10, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x4e, + 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x12, 0x4e, + 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0xc7, + 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, + 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x31, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, 0x9a, 0x02, 0x0a, 0x07, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x33, 0x33, 0x2c, 0x33, 0x32, 0x52, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb4, + 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, + 0x02, 0x34, 0x38, 0x9a, 0xb5, 0x18, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x16, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x0d, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, + 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, + 0x75, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x6c, + 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x52, 0x04, 0x65, 0x78, 0x69, 0x74, + 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x45, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, + 0x0a, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xdb, 0x02, 0x0a, 0x11, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, + 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, + 0x62, 0x6f, 0x64, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xad, 0x01, 0x0a, + 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, + 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, 0x34, 0x38, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, + 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xb6, 0x01, 0x0a, + 0x19, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x37, 0x0a, 0x11, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, + 0x32, 0x52, 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, + 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0d, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, + 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, + 0x34, 0x52, 0x11, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x42, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x18, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x16, + 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, - 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, - 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, - 0x6c, 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8d, 0x07, 0x0a, 0x1d, 0x42, 0x6c, - 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, - 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, - 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, - 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, - 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, - 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, - 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x16, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, - 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x48, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x84, 0x03, 0x0a, 0x17, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, + 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, @@ -5627,156 +5187,316 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x22, 0xcd, 0x07, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, - 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, - 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, - 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, - 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, + 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, + 0xfa, 0x05, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, + 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, + 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, + 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, + 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, + 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, + 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, + 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x51, 0x0a, 0x11, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x93, 0x01, 0x0a, + 0x21, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x12, 0x48, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, + 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, + 0x69, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, + 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x22, 0x94, 0x06, 0x0a, 0x1f, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x42, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, + 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, + 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, + 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, + 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, + 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, - 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, - 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, - 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, - 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x12, 0x64, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x43, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, - 0x69, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, - 0x65, 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, - 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, - 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, - 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, - 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x45, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, - 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, - 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, - 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, - 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, - 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x1a, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, + 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, + 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xb6, 0x01, + 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, - 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, - 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, - 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, - 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, - 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, - 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, - 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, - 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xc3, 0x07, 0x0a, 0x16, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, - 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, - 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, - 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, 0x67, + 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, + 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, + 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, + 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, + 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, + 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x7d, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x12, 0x3d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, - 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, - 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf6, 0x02, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, + 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, + 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x3f, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xb3, + 0x07, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, + 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, + 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, + 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, + 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, + 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xf3, 0x06, 0x0a, 0x16, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, + 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, + 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, + 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, @@ -5796,8 +5516,8 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, + 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, @@ -5805,227 +5525,535 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, - 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, - 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, - 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, - 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, - 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, - 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, - 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1f, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, + 0x46, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, + 0x0a, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, + 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, + 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8d, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, - 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0xdd, 0x07, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, - 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, - 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, - 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, - 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, - 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, - 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, 0x52, - 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, - 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, - 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x79, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, - 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, - 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, - 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, + 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, + 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, + 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, + 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, + 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, + 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, - 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, - 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, - 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, - 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, - 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, - 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, - 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, - 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, - 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, + 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x16, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, - 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, - 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, - 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, - 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x84, 0x03, 0x0a, 0x17, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x22, 0xcd, 0x07, 0x0a, 0x1b, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x3c, + 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x08, + 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, + 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x11, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x32, 0x52, 0x11, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x4f, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, + 0x32, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, + 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, + 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, + 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x69, + 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, + 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, + 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, + 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, + 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, + 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x45, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, + 0x0a, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, + 0x30, 0x39, 0x36, 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, + 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, + 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, + 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x1a, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x0a, 0x0a, 0x6b, 0x7a, + 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x09, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, + 0x3f, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, + 0x63, 0x74, 0x72, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x05, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfa, 0x02, 0x0a, 0x12, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, + 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, + 0x72, 0x61, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x97, 0x08, 0x0a, 0x16, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, + 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x31, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, + 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, - 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, - 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, - 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, - 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, - 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, - 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, - 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, - 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, - 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, - 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, + 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, - 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, - 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, - 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, - 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, - 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, - 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, - 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, - 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, - 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, + 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x38, + 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x42, + 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x5f, + 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6e, 0x74, + 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, + 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, + 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, + 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x11, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, + 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, + 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, + 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x54, 0x0a, 0x12, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, + 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x88, 0x03, 0x0a, 0x19, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x22, 0xb1, 0x08, 0x0a, 0x1d, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x45, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, + 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x74, + 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x22, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x74, 0x69, 0x12, 0x5e, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, + 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x05, 0x92, 0xb5, 0x18, + 0x01, 0x38, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x42, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, + 0x79, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x6f, 0x6c, 0x75, + 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, + 0x36, 0x52, 0x0e, 0x76, 0x6f, 0x6c, 0x75, 0x6e, 0x74, 0x61, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, + 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, + 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x69, + 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, + 0x62, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x72, 0x0a, 0x18, 0x62, 0x6c, 0x73, + 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x06, + 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x15, 0x62, 0x6c, 0x73, 0x54, 0x6f, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x42, 0x0a, + 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, + 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, + 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x54, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x31, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x06, 0x70, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x72, 0x0a, 0x1e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x12, 0x50, 0x0a, + 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, + 0x8f, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x31, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x56, 0x31, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0a, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, + 0x12, 0x42, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, + 0x65, 0x79, 0x22, 0x75, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x42, 0x75, + 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, + 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, + 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, + 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, + 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x75, + 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xdc, + 0x01, 0x0a, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, + 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x14, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, + 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, + 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x7f, 0x0a, + 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, + 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x69, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc0, + 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, + 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, + 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5e, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x09, 0x8a, 0xb5, + 0x18, 0x05, 0x31, 0x37, 0x2c, 0x33, 0x32, 0x52, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x22, 0x55, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, + 0x73, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, + 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, + 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, + 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6112,8 +6140,7 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_goTypes = []interface{}{ (*v1.ExecutionPayloadHeaderCapella)(nil), // 67: ethereum.engine.v1.ExecutionPayloadHeaderCapella (*v1.ExecutionPayloadHeaderDeneb)(nil), // 68: ethereum.engine.v1.ExecutionPayloadHeaderDeneb (*AttestationElectra)(nil), // 69: ethereum.eth.v1alpha1.AttestationElectra - (*v1.ExecutionPayloadElectra)(nil), // 70: ethereum.engine.v1.ExecutionPayloadElectra - (*v1.ExecutionPayloadHeaderElectra)(nil), // 71: ethereum.engine.v1.ExecutionPayloadHeaderElectra + (*v1.ExecutionRequests)(nil), // 70: ethereum.engine.v1.ExecutionRequests } var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 3, // 0: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.phase0:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock @@ -6241,34 +6268,36 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 11, // 122: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit 13, // 123: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit 19, // 124: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 70, // 125: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra + 64, // 125: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.execution_payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb 65, // 126: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 46, // 127: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra - 47, // 128: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra - 14, // 129: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data - 8, // 130: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing - 10, // 131: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashingElectra - 69, // 132: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra - 11, // 133: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit - 13, // 134: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit - 19, // 135: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate - 71, // 136: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra - 65, // 137: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange - 50, // 138: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 - 48, // 139: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 - 63, // 140: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 51, // 141: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid - 67, // 142: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 53, // 143: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella - 68, // 144: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb - 55, // 145: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb - 16, // 146: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader - 57, // 147: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar - 148, // [148:148] is the sub-list for method output_type - 148, // [148:148] is the sub-list for method input_type - 148, // [148:148] is the sub-list for extension type_name - 148, // [148:148] is the sub-list for extension extendee - 0, // [0:148] is the sub-list for field type_name + 70, // 127: ethereum.eth.v1alpha1.BeaconBlockBodyElectra.execution_requests:type_name -> ethereum.engine.v1.ExecutionRequests + 46, // 128: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra.message:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + 47, // 129: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra.body:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra + 14, // 130: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.eth1_data:type_name -> ethereum.eth.v1alpha1.Eth1Data + 8, // 131: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.proposer_slashings:type_name -> ethereum.eth.v1alpha1.ProposerSlashing + 10, // 132: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attester_slashings:type_name -> ethereum.eth.v1alpha1.AttesterSlashingElectra + 69, // 133: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.attestations:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 11, // 134: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.deposits:type_name -> ethereum.eth.v1alpha1.Deposit + 13, // 135: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.voluntary_exits:type_name -> ethereum.eth.v1alpha1.SignedVoluntaryExit + 19, // 136: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 68, // 137: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 65, // 138: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange + 70, // 139: ethereum.eth.v1alpha1.BlindedBeaconBlockBodyElectra.execution_requests:type_name -> ethereum.engine.v1.ExecutionRequests + 50, // 140: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1.messages:type_name -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1 + 48, // 141: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1.message:type_name -> ethereum.eth.v1alpha1.ValidatorRegistrationV1 + 63, // 142: ethereum.eth.v1alpha1.BuilderBid.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 51, // 143: ethereum.eth.v1alpha1.SignedBuilderBid.message:type_name -> ethereum.eth.v1alpha1.BuilderBid + 67, // 144: ethereum.eth.v1alpha1.BuilderBidCapella.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 53, // 145: ethereum.eth.v1alpha1.SignedBuilderBidCapella.message:type_name -> ethereum.eth.v1alpha1.BuilderBidCapella + 68, // 146: ethereum.eth.v1alpha1.BuilderBidDeneb.header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 55, // 147: ethereum.eth.v1alpha1.SignedBuilderBidDeneb.message:type_name -> ethereum.eth.v1alpha1.BuilderBidDeneb + 16, // 148: ethereum.eth.v1alpha1.BlobSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 57, // 149: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlobSidecar + 150, // [150:150] is the sub-list for method output_type + 150, // [150:150] is the sub-list for method input_type + 150, // [150:150] is the sub-list for extension type_name + 150, // [150:150] is the sub-list for extension extendee + 0, // [0:150] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_block_proto_init() } diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index 7b93a4ae1678..4afcd0cf6860 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -19,6 +19,7 @@ import "proto/eth/ext/options.proto"; import "proto/prysm/v1alpha1/attestation.proto"; import "proto/prysm/v1alpha1/withdrawals.proto"; import "proto/engine/v1/execution_engine.proto"; +import "proto/engine/v1/electra.proto"; option csharp_namespace = "Ethereum.Eth.v1alpha1"; option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; @@ -817,12 +818,14 @@ message BeaconBlockBodyElectra { SyncAggregate sync_aggregate = 9; // Execution payload from the execution chain. New in Bellatrix network upgrade. - ethereum.engine.v1.ExecutionPayloadElectra execution_payload = 10; + ethereum.engine.v1.ExecutionPayloadDeneb execution_payload = 10; // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade. repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; + + ethereum.engine.v1.ExecutionRequests execution_requests = 13; } message SignedBlindedBeaconBlockElectra { @@ -880,12 +883,14 @@ message BlindedBeaconBlockBodyElectra { SyncAggregate sync_aggregate = 9; // Execution payload header from the execution chain. New in Bellatrix network upgrade to accommodate MEV interaction. - ethereum.engine.v1.ExecutionPayloadHeaderElectra execution_payload_header = 10; + ethereum.engine.v1.ExecutionPayloadHeaderDeneb execution_payload_header = 10; // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade. repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"]; repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; + + ethereum.engine.v1.ExecutionRequests execution_requests = 13; } message ValidatorRegistrationV1 { diff --git a/proto/prysm/v1alpha1/beacon_state.pb.go b/proto/prysm/v1alpha1/beacon_state.pb.go index ef5a38848e47..33b8d1f9bd10 100755 --- a/proto/prysm/v1alpha1/beacon_state.pb.go +++ b/proto/prysm/v1alpha1/beacon_state.pb.go @@ -1863,7 +1863,7 @@ type BeaconStateElectra struct { InactivityScores []uint64 `protobuf:"varint,9001,rep,packed,name=inactivity_scores,json=inactivityScores,proto3" json:"inactivity_scores,omitempty" ssz-max:"1099511627776"` CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,9002,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` NextSyncCommittee *SyncCommittee `protobuf:"bytes,9003,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` - LatestExecutionPayloadHeader *v1.ExecutionPayloadHeaderElectra `protobuf:"bytes,10001,opt,name=latest_execution_payload_header,json=latestExecutionPayloadHeader,proto3" json:"latest_execution_payload_header,omitempty"` + LatestExecutionPayloadHeader *v1.ExecutionPayloadHeaderDeneb `protobuf:"bytes,10001,opt,name=latest_execution_payload_header,json=latestExecutionPayloadHeader,proto3" json:"latest_execution_payload_header,omitempty"` NextWithdrawalIndex uint64 `protobuf:"varint,11001,opt,name=next_withdrawal_index,json=nextWithdrawalIndex,proto3" json:"next_withdrawal_index,omitempty"` NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` @@ -2078,7 +2078,7 @@ func (x *BeaconStateElectra) GetNextSyncCommittee() *SyncCommittee { return nil } -func (x *BeaconStateElectra) GetLatestExecutionPayloadHeader() *v1.ExecutionPayloadHeaderElectra { +func (x *BeaconStateElectra) GetLatestExecutionPayloadHeader() *v1.ExecutionPayloadHeaderDeneb { if x != nil { return x.LatestExecutionPayloadHeader } @@ -3010,7 +3010,7 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x69, 0x65, 0x73, 0x22, 0xd1, 0x19, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x72, 0x69, 0x65, 0x73, 0x22, 0xcf, 0x19, 0x0a, 0x12, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, @@ -3119,130 +3119,130 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x1f, 0x6c, 0x61, + 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x77, 0x0a, 0x1f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, - 0x55, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, - 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, - 0x55, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, - 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, + 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, + 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, + 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x40, + 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xe1, + 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, + 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x17, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x7d, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, - 0x65, 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, + 0x65, 0x18, 0xe3, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, - 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, - 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x7d, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, + 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, + 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, + 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe4, 0x5d, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x65, 0x61, 0x72, + 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x8f, + 0x01, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, - 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, + 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, - 0x69, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, - 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, - 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe4, - 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x69, 0x52, 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, + 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0xe6, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x1a, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, 0x0a, 0x18, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x0d, 0x92, + 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x73, 0x18, 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, 0xb5, 0x18, + 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xe9, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, + 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, + 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x65, - 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x8f, 0x01, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, - 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, - 0x77, 0x65, 0x69, 0x52, 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, - 0x6d, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, - 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0xe6, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x1a, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, - 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, - 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, - 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, - 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, - 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xe9, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, - 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, - 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, - 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, - 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, - 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, - 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3285,10 +3285,9 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_goTypes = []interface{}{ (*v1.ExecutionPayloadHeader)(nil), // 23: ethereum.engine.v1.ExecutionPayloadHeader (*v1.ExecutionPayloadHeaderCapella)(nil), // 24: ethereum.engine.v1.ExecutionPayloadHeaderCapella (*v1.ExecutionPayloadHeaderDeneb)(nil), // 25: ethereum.engine.v1.ExecutionPayloadHeaderDeneb - (*v1.ExecutionPayloadHeaderElectra)(nil), // 26: ethereum.engine.v1.ExecutionPayloadHeaderElectra - (*PendingBalanceDeposit)(nil), // 27: ethereum.eth.v1alpha1.PendingBalanceDeposit - (*PendingPartialWithdrawal)(nil), // 28: ethereum.eth.v1alpha1.PendingPartialWithdrawal - (*PendingConsolidation)(nil), // 29: ethereum.eth.v1alpha1.PendingConsolidation + (*PendingBalanceDeposit)(nil), // 26: ethereum.eth.v1alpha1.PendingBalanceDeposit + (*PendingPartialWithdrawal)(nil), // 27: ethereum.eth.v1alpha1.PendingPartialWithdrawal + (*PendingConsolidation)(nil), // 28: ethereum.eth.v1alpha1.PendingConsolidation } var file_proto_prysm_v1alpha1_beacon_state_proto_depIdxs = []int32{ 2, // 0: ethereum.eth.v1alpha1.BeaconState.fork:type_name -> ethereum.eth.v1alpha1.Fork @@ -3358,11 +3357,11 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_depIdxs = []int32{ 21, // 64: ethereum.eth.v1alpha1.BeaconStateElectra.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 10, // 65: ethereum.eth.v1alpha1.BeaconStateElectra.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee 10, // 66: ethereum.eth.v1alpha1.BeaconStateElectra.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee - 26, // 67: ethereum.eth.v1alpha1.BeaconStateElectra.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderElectra + 25, // 67: ethereum.eth.v1alpha1.BeaconStateElectra.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb 17, // 68: ethereum.eth.v1alpha1.BeaconStateElectra.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary - 27, // 69: ethereum.eth.v1alpha1.BeaconStateElectra.pending_balance_deposits:type_name -> ethereum.eth.v1alpha1.PendingBalanceDeposit - 28, // 70: ethereum.eth.v1alpha1.BeaconStateElectra.pending_partial_withdrawals:type_name -> ethereum.eth.v1alpha1.PendingPartialWithdrawal - 29, // 71: ethereum.eth.v1alpha1.BeaconStateElectra.pending_consolidations:type_name -> ethereum.eth.v1alpha1.PendingConsolidation + 26, // 69: ethereum.eth.v1alpha1.BeaconStateElectra.pending_balance_deposits:type_name -> ethereum.eth.v1alpha1.PendingBalanceDeposit + 27, // 70: ethereum.eth.v1alpha1.BeaconStateElectra.pending_partial_withdrawals:type_name -> ethereum.eth.v1alpha1.PendingPartialWithdrawal + 28, // 71: ethereum.eth.v1alpha1.BeaconStateElectra.pending_consolidations:type_name -> ethereum.eth.v1alpha1.PendingConsolidation 72, // [72:72] is the sub-list for method output_type 72, // [72:72] is the sub-list for method input_type 72, // [72:72] is the sub-list for extension type_name diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index 8206df1d4ba7..d907c9941f20 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -388,7 +388,7 @@ message BeaconStateElectra { SyncCommittee next_sync_committee = 9003; // Fields introduced in Bellatrix fork [10001-11000] - ethereum.engine.v1.ExecutionPayloadHeaderElectra latest_execution_payload_header = 10001; // [New in Electra] + ethereum.engine.v1.ExecutionPayloadHeaderDeneb latest_execution_payload_header = 10001; // Fields introduced in Capella fork [11001-12000] uint64 next_withdrawal_index = 11001; diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index 6f1c86000129..f978ae3f9141 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 61890aa32d72c0c0325f0bf6dd44776068840a9d50a102e4c3c53ac46cf66567 +// Hash: 693cad07de8560b2681132d912aebb927e668fe15e5cb9f42e8a36bbac6e2c5e package eth import ( diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index 48057c5b2a16..ff1f01bad017 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 13b762a7d53ab6cf5d5ffb582d580edb05efc65de762692f09af914819d3bb3e +// Hash: a5507ef7d71897486989f37eb4dbb19fc2c49e7c47f244291a9f3122c9bfe546 package eth import ( diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index 2cd98fc7b7c8..294443afff8b 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -884,6 +884,8 @@ func genPayloadDeneb() *enginev1.ExecutionPayloadDeneb { } } +var genPayloadElectra = genPayloadDeneb + func genPayloadHeader() *enginev1.ExecutionPayloadHeader { return &enginev1.ExecutionPayloadHeader{ ParentHash: bytes(32), @@ -945,6 +947,8 @@ func genPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb { } } +var genPayloadHeaderElectra = genPayloadHeaderDeneb + func genWithdrawals(num int) []*enginev1.Withdrawal { ws := make([]*enginev1.Withdrawal, num) for i := 0; i < num; i++ { @@ -1049,34 +1053,10 @@ func genBlindedBeaconBlockBodyElectra() *v1alpha1.BlindedBeaconBlockBodyElectra Deposits: genDeposits(5), VoluntaryExits: genSignedVoluntaryExits(12), SyncAggregate: genSyncAggregate(), - ExecutionPayloadHeader: genExecutionPayloadHeaderElectra(), + ExecutionPayloadHeader: genPayloadHeaderElectra(), BlsToExecutionChanges: genBLSToExecutionChanges(10), BlobKzgCommitments: getKZGCommitments(4), - } -} - -func genExecutionPayloadHeaderElectra() *enginev1.ExecutionPayloadHeaderElectra { - return &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: bytes(32), - FeeRecipient: bytes(20), - StateRoot: bytes(32), - ReceiptsRoot: bytes(32), - LogsBloom: bytes(256), - PrevRandao: bytes(32), - BlockNumber: 1, - GasLimit: 2, - GasUsed: 3, - Timestamp: 4, - ExtraData: bytes(32), - BaseFeePerGas: bytes(32), - BlockHash: bytes(32), - TransactionsRoot: bytes(32), - WithdrawalsRoot: bytes(32), - BlobGasUsed: 5, - ExcessBlobGas: 6, - DepositRequestsRoot: bytes(32), - WithdrawalRequestsRoot: bytes(32), - ConsolidationRequestsRoot: bytes(32), + ExecutionRequests: genExecutionRequests(), } } @@ -1108,34 +1088,18 @@ func genBeaconBlockBodyElectra() *v1alpha1.BeaconBlockBodyElectra { Deposits: genDeposits(5), VoluntaryExits: genSignedVoluntaryExits(12), SyncAggregate: genSyncAggregate(), - ExecutionPayload: genExecutionPayloadElectra(), + ExecutionPayload: genPayloadElectra(), BlsToExecutionChanges: genBLSToExecutionChanges(10), BlobKzgCommitments: getKZGCommitments(4), + ExecutionRequests: genExecutionRequests(), } } -func genExecutionPayloadElectra() *enginev1.ExecutionPayloadElectra { - return &enginev1.ExecutionPayloadElectra{ - ParentHash: bytes(32), - FeeRecipient: bytes(20), - StateRoot: bytes(32), - ReceiptsRoot: bytes(32), - LogsBloom: bytes(256), - PrevRandao: bytes(32), - BlockNumber: 1, - GasLimit: 2, - GasUsed: 3, - Timestamp: 4, - ExtraData: bytes(32), - BaseFeePerGas: bytes(32), - BlockHash: bytes(32), - Transactions: [][]byte{{'a'}, {'b'}, {'c'}}, - Withdrawals: genWithdrawals(10), - BlobGasUsed: 5, - ExcessBlobGas: 6, - DepositRequests: genDepositRequests(10), - WithdrawalRequests: genWithdrawalRequests(10), - ConsolidationRequests: genConsolidationRequests(10), +func genExecutionRequests() *enginev1.ExecutionRequests { + return &enginev1.ExecutionRequests{ + Deposits: genDepositRequests(10), + Withdrawals: genWithdrawalRequests(10), + Consolidations: genConsolidationRequests(10), } } diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index deeeacdb81df..356ebb7780db 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: adfca9994daf736f0526568d87329503d997b98308a409e71cd510115380af5a +// Hash: 4c3e6932bf84838e8de21e5c121c14d03cbccb051c3990d3b924932f531f4d30 package eth import ( diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 585864c4ab44..58c9ca4bf77b 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 502599304fd370b8602d212eaf1956fe5bf034fe59c75d1a3a6e3db8bcde291a +// Hash: 6d900c40d922575c27ef51a244f7bf935f56aa440017288a3405a3025d7750a6 package eth import ( @@ -1126,7 +1126,7 @@ func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(392) + offset := int(396) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { @@ -1187,7 +1187,7 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error // Offset (9) 'ExecutionPayload' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) } offset += b.ExecutionPayload.SizeSSZ() @@ -1199,6 +1199,13 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error dst = ssz.WriteOffset(dst, offset) offset += len(b.BlobKzgCommitments) * 48 + // Offset (12) 'ExecutionRequests' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionRequests == nil { + b.ExecutionRequests = new(v1.ExecutionRequests) + } + offset += b.ExecutionRequests.SizeSSZ() + // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) @@ -1297,6 +1304,11 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error dst = append(dst, b.BlobKzgCommitments[ii]...) } + // Field (12) 'ExecutionRequests' + if dst, err = b.ExecutionRequests.MarshalSSZTo(dst); err != nil { + return + } + return } @@ -1304,12 +1316,12 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 392 { + if size < 396 { return ssz.ErrSize } tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11 uint64 + var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { @@ -1336,7 +1348,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 != 392 { + if o3 != 396 { return ssz.ErrInvalidVariableOffset } @@ -1383,6 +1395,11 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } + // Offset (12) 'ExecutionRequests' + if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] @@ -1485,7 +1502,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { { buf = tail[o9:o10] if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) } if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { return err @@ -1512,7 +1529,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { // Field (11) 'BlobKzgCommitments' { - buf = tail[o11:] + buf = tail[o11:o12] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err @@ -1525,12 +1542,23 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } + + // Field (12) 'ExecutionRequests' + { + buf = tail[o12:] + if b.ExecutionRequests == nil { + b.ExecutionRequests = new(v1.ExecutionRequests) + } + if err = b.ExecutionRequests.UnmarshalSSZ(buf); err != nil { + return err + } + } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 392 + size = 396 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 @@ -1555,7 +1583,7 @@ func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { // Field (9) 'ExecutionPayload' if b.ExecutionPayload == nil { - b.ExecutionPayload = new(v1.ExecutionPayloadElectra) + b.ExecutionPayload = new(v1.ExecutionPayloadDeneb) } size += b.ExecutionPayload.SizeSSZ() @@ -1565,6 +1593,12 @@ func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { // Field (11) 'BlobKzgCommitments' size += len(b.BlobKzgCommitments) * 48 + // Field (12) 'ExecutionRequests' + if b.ExecutionRequests == nil { + b.ExecutionRequests = new(v1.ExecutionRequests) + } + size += b.ExecutionRequests.SizeSSZ() + return } @@ -1721,6 +1755,11 @@ func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.MerkleizeWithMixin(subIndx, numItems, 4096) } + // Field (12) 'ExecutionRequests' + if err = b.ExecutionRequests.HashTreeRootWith(hh); err != nil { + return + } + hh.Merkleize(indx) return } @@ -1989,7 +2028,7 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(392) + offset := int(396) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { @@ -2050,7 +2089,7 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er // Offset (9) 'ExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } offset += b.ExecutionPayloadHeader.SizeSSZ() @@ -2062,6 +2101,13 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er dst = ssz.WriteOffset(dst, offset) offset += len(b.BlobKzgCommitments) * 48 + // Offset (12) 'ExecutionRequests' + dst = ssz.WriteOffset(dst, offset) + if b.ExecutionRequests == nil { + b.ExecutionRequests = new(v1.ExecutionRequests) + } + offset += b.ExecutionRequests.SizeSSZ() + // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) @@ -2160,6 +2206,11 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er dst = append(dst, b.BlobKzgCommitments[ii]...) } + // Field (12) 'ExecutionRequests' + if dst, err = b.ExecutionRequests.MarshalSSZTo(dst); err != nil { + return + } + return } @@ -2167,12 +2218,12 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 392 { + if size < 396 { return ssz.ErrSize } tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11 uint64 + var o3, o4, o5, o6, o7, o9, o10, o11, o12 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { @@ -2199,7 +2250,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o3 != 392 { + if o3 != 396 { return ssz.ErrInvalidVariableOffset } @@ -2246,6 +2297,11 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } + // Offset (12) 'ExecutionRequests' + if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] @@ -2348,7 +2404,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { { buf = tail[o9:o10] if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err @@ -2375,7 +2431,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { // Field (11) 'BlobKzgCommitments' { - buf = tail[o11:] + buf = tail[o11:o12] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err @@ -2388,12 +2444,23 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } + + // Field (12) 'ExecutionRequests' + { + buf = tail[o12:] + if b.ExecutionRequests == nil { + b.ExecutionRequests = new(v1.ExecutionRequests) + } + if err = b.ExecutionRequests.UnmarshalSSZ(buf); err != nil { + return err + } + } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 392 + size = 396 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 @@ -2418,7 +2485,7 @@ func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { // Field (9) 'ExecutionPayloadHeader' if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } size += b.ExecutionPayloadHeader.SizeSSZ() @@ -2428,6 +2495,12 @@ func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { // Field (11) 'BlobKzgCommitments' size += len(b.BlobKzgCommitments) * 48 + // Field (12) 'ExecutionRequests' + if b.ExecutionRequests == nil { + b.ExecutionRequests = new(v1.ExecutionRequests) + } + size += b.ExecutionRequests.SizeSSZ() + return } @@ -2584,6 +2657,11 @@ func (b *BlindedBeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err er hh.MerkleizeWithMixin(subIndx, numItems, 4096) } + // Field (12) 'ExecutionRequests' + if err = b.ExecutionRequests.HashTreeRootWith(hh); err != nil { + return + } + hh.Merkleize(indx) return } @@ -2764,7 +2842,7 @@ func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { // Offset (24) 'LatestExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } offset += b.LatestExecutionPayloadHeader.SizeSSZ() @@ -3250,7 +3328,7 @@ func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { { buf = tail[o24:o27] if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err @@ -3358,7 +3436,7 @@ func (b *BeaconStateElectra) SizeSSZ() (size int) { // Field (24) 'LatestExecutionPayloadHeader' if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) } size += b.LatestExecutionPayloadHeader.SizeSSZ() diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go index 2c720bc17b34..13bae739b5bc 100644 --- a/proto/prysm/v1alpha1/non-core.ssz.go +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6fe6b8a92c8bbb2fc95fc59fca0b73d1c787c00ec01137d73193b5b251e40c12 +// Hash: 4cb7a5705004491db2ef29a5080a4cc56a1b618de948a86f9e5275858b48e6c4 package eth import ( diff --git a/proto/prysm/v1alpha1/phase0.ssz.go b/proto/prysm/v1alpha1/phase0.ssz.go index d9d2b40cb253..6102d3713daa 100644 --- a/proto/prysm/v1alpha1/phase0.ssz.go +++ b/proto/prysm/v1alpha1/phase0.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 0858b1e553b943e9cbdba001604002341da98f82976954a2eafa7a97632f485c +// Hash: 0afa289ce68dc2913d8000d495c6069832f35b66a6c0cf1bb0d1299fcad7047a package eth import ( diff --git a/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go b/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go index f5d3d2f7b95a..22ebd4911e35 100644 --- a/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go +++ b/testing/spectest/mainnet/electra/epoch_processing/slashings_test.go @@ -7,5 +7,6 @@ import ( ) func TestMainnet_Electra_EpochProcessing_Slashings(t *testing.T) { + t.Skip("slashing processing missing") epoch_processing.RunSlashingsTests(t, "mainnet") } diff --git a/testing/spectest/minimal/electra/epoch_processing/slashings_test.go b/testing/spectest/minimal/electra/epoch_processing/slashings_test.go index 2271afdf262a..4e46fb557cdb 100644 --- a/testing/spectest/minimal/electra/epoch_processing/slashings_test.go +++ b/testing/spectest/minimal/electra/epoch_processing/slashings_test.go @@ -7,5 +7,6 @@ import ( ) func TestMinimal_Electra_EpochProcessing_Slashings(t *testing.T) { + t.Skip("slashing processing missing") epoch_processing.RunSlashingsTests(t, "minimal") } diff --git a/testing/spectest/shared/common/operations/consolidations.go b/testing/spectest/shared/common/operations/consolidations.go index ff833943f153..81bffa19fdf0 100644 --- a/testing/spectest/shared/common/operations/consolidations.go +++ b/testing/spectest/shared/common/operations/consolidations.go @@ -28,15 +28,11 @@ func RunConsolidationTest(t *testing.T, config string, fork string, block blockW blk, err := block(consolidationSSZ) require.NoError(t, err) RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - ed, err := b.Block().Body().Execution() + er, err := b.Block().Body().ExecutionRequests() if err != nil { return nil, err } - eed, ok := ed.(interfaces.ExecutionDataElectra) - if !ok { - t.Fatal("block does not have execution data for electra") - } - return s, electra.ProcessConsolidationRequests(ctx, s, eed.ConsolidationRequests()) + return s, electra.ProcessConsolidationRequests(ctx, s, er.Consolidations) }) }) } diff --git a/testing/spectest/shared/common/operations/deposit_request.go b/testing/spectest/shared/common/operations/deposit_request.go index ee1f51f677c7..8426033fc71a 100644 --- a/testing/spectest/shared/common/operations/deposit_request.go +++ b/testing/spectest/shared/common/operations/deposit_request.go @@ -27,11 +27,9 @@ func RunDepositRequestsTest(t *testing.T, config string, fork string, block bloc blk, err := block(depositRequestSSZ) require.NoError(t, err) RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { - e, err := b.Block().Body().Execution() - require.NoError(t, err, "Failed to get execution") - ee, ok := e.(interfaces.ExecutionDataElectra) - require.Equal(t, true, ok, "Invalid execution payload") - return electra.ProcessDepositRequests(ctx, s, ee.DepositRequests()) + e, err := b.Block().Body().ExecutionRequests() + require.NoError(t, err, "Failed to get execution requests") + return electra.ProcessDepositRequests(ctx, s, e.Deposits) }) }) } diff --git a/testing/spectest/shared/common/operations/withdrawal_request.go b/testing/spectest/shared/common/operations/withdrawal_request.go index fdb06b6809ef..f119c7cb6c04 100644 --- a/testing/spectest/shared/common/operations/withdrawal_request.go +++ b/testing/spectest/shared/common/operations/withdrawal_request.go @@ -31,11 +31,9 @@ func RunWithdrawalRequestTest(t *testing.T, config string, fork string, block bl require.NoError(t, err) RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { bod := b.Block().Body() - e, err := bod.Execution() + e, err := bod.ExecutionRequests() require.NoError(t, err) - exe, ok := e.(interfaces.ExecutionDataElectra) - require.Equal(t, true, ok) - return electra.ProcessWithdrawalRequests(ctx, s, exe.WithdrawalRequests()) + return electra.ProcessWithdrawalRequests(ctx, s, e.Withdrawals) }) }) } diff --git a/testing/spectest/shared/electra/operations/consolidations.go b/testing/spectest/shared/electra/operations/consolidations.go index 44ccf1b69d37..25522e61ccc2 100644 --- a/testing/spectest/shared/electra/operations/consolidations.go +++ b/testing/spectest/shared/electra/operations/consolidations.go @@ -17,8 +17,11 @@ func blockWithConsolidation(ssz []byte) (interfaces.SignedBeaconBlock, error) { if err := cr.UnmarshalSSZ(ssz); err != nil { return nil, err } + er := &enginev1.ExecutionRequests{ + Consolidations: []*enginev1.ConsolidationRequest{cr}, + } b := util.NewBeaconBlockElectra() - b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ConsolidationRequests: []*enginev1.ConsolidationRequest{cr}}} + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionRequests: er} return blocks.NewSignedBeaconBlock(b) } diff --git a/testing/spectest/shared/electra/operations/deposit_request.go b/testing/spectest/shared/electra/operations/deposit_request.go index 686ea39f754b..fbc5b2ff142d 100644 --- a/testing/spectest/shared/electra/operations/deposit_request.go +++ b/testing/spectest/shared/electra/operations/deposit_request.go @@ -17,8 +17,11 @@ func blockWithDepositRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) { if err := dr.UnmarshalSSZ(ssz); err != nil { return nil, err } + er := &enginev1.ExecutionRequests{ + Deposits: []*enginev1.DepositRequest{dr}, + } b := util.NewBeaconBlockElectra() - b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{DepositRequests: []*enginev1.DepositRequest{dr}}} + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionRequests: er} return blocks.NewSignedBeaconBlock(b) } diff --git a/testing/spectest/shared/electra/operations/withdrawal_request.go b/testing/spectest/shared/electra/operations/withdrawal_request.go index db594f586a3a..01aaa9472740 100644 --- a/testing/spectest/shared/electra/operations/withdrawal_request.go +++ b/testing/spectest/shared/electra/operations/withdrawal_request.go @@ -13,12 +13,15 @@ import ( ) func blockWithWithdrawalRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) { - dr := &enginev1.WithdrawalRequest{} - if err := dr.UnmarshalSSZ(ssz); err != nil { + wr := &enginev1.WithdrawalRequest{} + if err := wr.UnmarshalSSZ(ssz); err != nil { return nil, err } + er := &enginev1.ExecutionRequests{ + Withdrawals: []*enginev1.WithdrawalRequest{wr}, + } b := util.NewBeaconBlockElectra() - b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{WithdrawalRequests: []*enginev1.WithdrawalRequest{dr}}} + b.Block.Body = ðpb.BeaconBlockBodyElectra{ExecutionRequests: er} return blocks.NewSignedBeaconBlock(b) } diff --git a/testing/spectest/shared/electra/ssz_static/ssz_static.go b/testing/spectest/shared/electra/ssz_static/ssz_static.go index 86522ce4cdbf..d1060c922e44 100644 --- a/testing/spectest/shared/electra/ssz_static/ssz_static.go +++ b/testing/spectest/shared/electra/ssz_static/ssz_static.go @@ -153,6 +153,8 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i obj = &enginev1.DepositRequest{} case "ConsolidationRequest": obj = &enginev1.ConsolidationRequest{} + case "ExecutionRequests": + obj = &enginev1.ExecutionRequests{} default: return nil, errors.New("type not found") } diff --git a/testing/util/block.go b/testing/util/block.go index 372647b48699..bc6f21923133 100644 --- a/testing/util/block.go +++ b/testing/util/block.go @@ -1406,25 +1406,41 @@ func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.Beaco } if b.ExecutionPayload == nil { b.ExecutionPayload = &enginev1.ExecutionPayloadElectra{ - ParentHash: make([]byte, fieldparams.RootLength), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, fieldparams.RootLength), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, fieldparams.RootLength), - BlockHash: make([]byte, fieldparams.RootLength), - Transactions: make([][]byte, 0), - Withdrawals: make([]*enginev1.Withdrawal, 0), - DepositRequests: make([]*enginev1.DepositRequest, 0), - WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), - ConsolidationRequests: make([]*enginev1.ConsolidationRequest, 0), + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, fieldparams.RootLength), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), } } + b.ExecutionRequests = HydrateExecutionRequests(b.ExecutionRequests) return b } +// HydrateExecutionRequests fills the exectution requests with the correct field +// lengths +func HydrateExecutionRequests(e *enginev1.ExecutionRequests) *enginev1.ExecutionRequests { + if e == nil { + e = &enginev1.ExecutionRequests{} + } + if e.Deposits == nil { + e.Deposits = make([]*enginev1.DepositRequest, 0) + } + if e.Withdrawals == nil { + e.Withdrawals = make([]*enginev1.WithdrawalRequest, 0) + } + if e.Consolidations == nil { + e.Consolidations = make([]*enginev1.ConsolidationRequest, 0) + } + return e +} + // HydrateV2BeaconBlockBodyDeneb hydrates a v2 beacon block body with correct field length sizes // to comply with fssz marshalling and unmarshalling rules. func HydrateV2BeaconBlockBodyDeneb(b *v2.BeaconBlockBodyDeneb) *v2.BeaconBlockBodyDeneb { @@ -1613,22 +1629,20 @@ func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra } if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, fieldparams.RootLength), - ReceiptsRoot: make([]byte, fieldparams.RootLength), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, fieldparams.RootLength), - WithdrawalsRoot: make([]byte, fieldparams.RootLength), - WithdrawalRequestsRoot: make([]byte, fieldparams.RootLength), - DepositRequestsRoot: make([]byte, fieldparams.RootLength), - ConsolidationRequestsRoot: make([]byte, fieldparams.RootLength), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, fieldparams.RootLength), + WithdrawalsRoot: make([]byte, fieldparams.RootLength), } } + b.ExecutionRequests = HydrateExecutionRequests(b.ExecutionRequests) return b } diff --git a/testing/util/electra.go b/testing/util/electra.go index dc009427bac1..0c0959bdbd82 100644 --- a/testing/util/electra.go +++ b/testing/util/electra.go @@ -97,32 +97,23 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri receiptsRoot := bytesutil.PadTo([]byte("receiptsRoot"), fieldparams.RootLength) parentHash := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) g.payload = &enginev1.ExecutionPayloadElectra{ - ParentHash: parentHash, - FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), - StateRoot: stateRoot, - ReceiptsRoot: receiptsRoot, - LogsBloom: logsBloom, - PrevRandao: blockHash[:], - BlockNumber: 0, - GasLimit: 0, - GasUsed: 0, - Timestamp: 0, - ExtraData: make([]byte, 0), - BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength), - BlockHash: blockHash[:], - Transactions: encodedBinaryTxs, - Withdrawals: make([]*enginev1.Withdrawal, 0), - BlobGasUsed: 0, - ExcessBlobGas: 0, - DepositRequests: generateTestDepositRequests(uint64(g.slot), 4), - WithdrawalRequests: generateTestWithdrawalRequests(uint64(g.slot), 4), - ConsolidationRequests: []*enginev1.ConsolidationRequest{ - { - SourceAddress: make([]byte, 20), - SourcePubkey: make([]byte, 48), - TargetPubkey: make([]byte, 48), - }, - }, + ParentHash: parentHash, + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: stateRoot, + ReceiptsRoot: receiptsRoot, + LogsBloom: logsBloom, + PrevRandao: blockHash[:], + BlockNumber: 0, + GasLimit: 0, + GasUsed: 0, + Timestamp: 0, + ExtraData: make([]byte, 0), + BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength), + BlockHash: blockHash[:], + Transactions: encodedBinaryTxs, + Withdrawals: make([]*enginev1.Withdrawal, 0), + BlobGasUsed: 0, + ExcessBlobGas: 0, } } @@ -177,31 +168,3 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri require.NoError(t, err) return rob, sidecars } - -func generateTestDepositRequests(offset, n uint64) []*enginev1.DepositRequest { - r := make([]*enginev1.DepositRequest, n) - var i uint64 - for i = 0; i < n; i++ { - r[i] = &enginev1.DepositRequest{ - Pubkey: make([]byte, 48), - WithdrawalCredentials: make([]byte, 32), - Amount: offset + i, - Signature: make([]byte, 96), - Index: offset + i + 100, - } - } - return r -} - -func generateTestWithdrawalRequests(offset, n uint64) []*enginev1.WithdrawalRequest { - r := make([]*enginev1.WithdrawalRequest, n) - var i uint64 - for i = 0; i < n; i++ { - r[i] = &enginev1.WithdrawalRequest{ - SourceAddress: make([]byte, 20), - ValidatorPubkey: make([]byte, 48), - Amount: offset + i, - } - } - return r -} diff --git a/testing/util/electra_block.go b/testing/util/electra_block.go index d74bfefa3943..acd4f8c8146d 100644 --- a/testing/util/electra_block.go +++ b/testing/util/electra_block.go @@ -160,28 +160,32 @@ func GenerateFullBlockElectra( return nil, errors.Wrapf(err, "failed generating %d consolidation requests:", conf.NumConsolidationRequests) } } + + executionRequests := &v1.ExecutionRequests{ + Withdrawals: withdrawalRequests, + Deposits: depositRequests, + Consolidations: consolidationRequests, + } + parentExecution, err := stCopy.LatestExecutionPayloadHeader() if err != nil { return nil, err } blockHash := indexToHash(uint64(slot)) newExecutionPayloadElectra := &v1.ExecutionPayloadElectra{ - ParentHash: parentExecution.BlockHash(), - FeeRecipient: make([]byte, 20), - StateRoot: params.BeaconConfig().ZeroHash[:], - ReceiptsRoot: params.BeaconConfig().ZeroHash[:], - LogsBloom: make([]byte, 256), - PrevRandao: random, - BlockNumber: uint64(slot), - ExtraData: params.BeaconConfig().ZeroHash[:], - BaseFeePerGas: params.BeaconConfig().ZeroHash[:], - BlockHash: blockHash[:], - Timestamp: uint64(timestamp.Unix()), - Transactions: newTransactions, - Withdrawals: newWithdrawals, - DepositRequests: depositRequests, - WithdrawalRequests: withdrawalRequests, - ConsolidationRequests: consolidationRequests, + ParentHash: parentExecution.BlockHash(), + FeeRecipient: make([]byte, 20), + StateRoot: params.BeaconConfig().ZeroHash[:], + ReceiptsRoot: params.BeaconConfig().ZeroHash[:], + LogsBloom: make([]byte, 256), + PrevRandao: random, + BlockNumber: uint64(slot), + ExtraData: params.BeaconConfig().ZeroHash[:], + BaseFeePerGas: params.BeaconConfig().ZeroHash[:], + BlockHash: blockHash[:], + Timestamp: uint64(timestamp.Unix()), + Transactions: newTransactions, + Withdrawals: newWithdrawals, } var syncCommitteeBits []byte currSize := new(ethpb.SyncAggregate).SyncCommitteeBits.Len() @@ -247,6 +251,7 @@ func GenerateFullBlockElectra( SyncAggregate: newSyncAggregate, ExecutionPayload: newExecutionPayloadElectra, BlsToExecutionChanges: changes, + ExecutionRequests: executionRequests, }, } diff --git a/testing/util/electra_state.go b/testing/util/electra_state.go index 437d2e62d6f5..afb4497afd4c 100644 --- a/testing/util/electra_state.go +++ b/testing/util/electra_state.go @@ -227,19 +227,21 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta SyncCommitteeSignature: make([]byte, 96), }, ExecutionPayload: &enginev1.ExecutionPayloadElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - Transactions: make([][]byte, 0), - Withdrawals: make([]*enginev1.Withdrawal, 0), - DepositRequests: make([]*enginev1.DepositRequest, 0), - WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + Transactions: make([][]byte, 0), + }, + ExecutionRequests: &enginev1.ExecutionRequests{ + Deposits: make([]*enginev1.DepositRequest, 0), + Withdrawals: make([]*enginev1.WithdrawalRequest, 0), + Consolidations: make([]*enginev1.ConsolidationRequest, 0), }, }).HashTreeRoot() if err != nil { @@ -272,20 +274,17 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta } st.LatestExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - DepositRequestsRoot: make([]byte, 32), - WithdrawalRequestsRoot: make([]byte, 32), - ConsolidationRequestsRoot: make([]byte, 32), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), } return state_native.InitializeFromProtoElectra(st) diff --git a/testing/util/state.go b/testing/util/state.go index b0f4838860b4..2c1f08c756b8 100644 --- a/testing/util/state.go +++ b/testing/util/state.go @@ -425,20 +425,17 @@ func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) erro AggregatePubkey: make([]byte, 48), }, LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - ExtraData: make([]byte, 0), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - DepositRequestsRoot: make([]byte, 32), - WithdrawalRequestsRoot: make([]byte, 32), - ConsolidationRequestsRoot: make([]byte, 32), + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), }, } From 71edf96c7d7b3f08cba919154f46fc2b37448f17 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 26 Sep 2024 08:26:12 -0500 Subject: [PATCH 303/325] Add sepolia config.yaml check with eth-clients/sepolia (#14484) * Add sepolia config.yaml check with eth-clients/sepolia * Update CHANGELOG.md --- CHANGELOG.md | 1 + WORKSPACE | 16 +++++++++++ config/params/BUILD.bazel | 2 ++ config/params/testnet_sepolia_config_test.go | 28 ++++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 config/params/testnet_sepolia_config_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edf1f5ef977..963d28e98112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb - GetBeaconStateV2: add Electra case. - Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875) +- Tests to ensure sepolia config matches the official upstream yaml ### Changed diff --git a/WORKSPACE b/WORKSPACE index 641d6ed81b18..d7e10683fdb2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -342,6 +342,22 @@ filegroup( url = "https://github.com/eth-clients/holesky/archive/874c199423ccd180607320c38cbaca05d9a1573a.tar.gz", # 2024-06-18 ) +http_archive( + name = "sepolia_testnet", + build_file_content = """ +filegroup( + name = "configs", + srcs = [ + "metadata/config.yaml", + ], + visibility = ["//visibility:public"], +) +""", + integrity = "sha256-cY/UgpCcYEhQf7JefD65FI8tn/A+rAvKhcm2/qiVdqY=", + strip_prefix = "sepolia-f2c219a93c4491cee3d90c18f2f8e82aed850eab", + url = "https://github.com/eth-clients/sepolia/archive/f2c219a93c4491cee3d90c18f2f8e82aed850eab.tar.gz", # 2024-09-19 +) + http_archive( name = "com_google_protobuf", sha256 = "9bd87b8280ef720d3240514f884e56a712f2218f0d693b48050c836028940a42", diff --git a/config/params/BUILD.bazel b/config/params/BUILD.bazel index 35660c89b96f..eed7a596fe11 100644 --- a/config/params/BUILD.bazel +++ b/config/params/BUILD.bazel @@ -49,6 +49,7 @@ go_test( "mainnet_config_test.go", "testnet_config_test.go", "testnet_holesky_config_test.go", + "testnet_sepolia_config_test.go", ], data = glob(["*.yaml"]) + [ "testdata/e2e_config.yaml", @@ -57,6 +58,7 @@ go_test( "@consensus_spec_tests_minimal//:test_data", "@eth2_networks//:configs", "@holesky_testnet//:configs", + "@sepolia_testnet//:configs", ], embed = [":go_default_library"], gotags = ["develop"], diff --git a/config/params/testnet_sepolia_config_test.go b/config/params/testnet_sepolia_config_test.go new file mode 100644 index 000000000000..6b87f3385cc3 --- /dev/null +++ b/config/params/testnet_sepolia_config_test.go @@ -0,0 +1,28 @@ +package params_test + +import ( + "path" + "testing" + + "github.com/bazelbuild/rules_go/go/tools/bazel" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +func TestSepoliaConfigMatchesUpstreamYaml(t *testing.T) { + presetFPs := presetsFilePath(t, "mainnet") + mn, err := params.ByName(params.MainnetName) + require.NoError(t, err) + cfg := mn.Copy() + for _, fp := range presetFPs { + cfg, err = params.UnmarshalConfigFile(fp, cfg) + require.NoError(t, err) + } + fPath, err := bazel.Runfile("external/sepolia_testnet") + require.NoError(t, err) + configFP := path.Join(fPath, "metadata", "config.yaml") + pcfg, err := params.UnmarshalConfigFile(configFP, nil) + require.NoError(t, err) + fields := fieldsFromYamls(t, append(presetFPs, configFP)) + assertYamlFieldsMatch(t, "sepolia", fields, pcfg, params.SepoliaConfig()) +} From 003b70c34b04025e19afe7dffdd2b71350ad484c Mon Sep 17 00:00:00 2001 From: terence Date: Thu, 26 Sep 2024 16:28:36 -0700 Subject: [PATCH 304/325] Update sepolia bootnodes (#14485) * Add sepolia bootnodes * Change log --- CHANGELOG.md | 1 + config/params/testnet_sepolia_config.go | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 963d28e98112..2882c93d1cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Migrated tracing library from opencensus to opentelemetry for both the beacon node and validator. - Refactored light client code to make it more readable and make future PRs easier. - Updated Libp2p Dependencies to allow prysm to use gossipsub v1.2 . +- Updated Sepolia bootnodes. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/config/params/testnet_sepolia_config.go b/config/params/testnet_sepolia_config.go index 353c874be7ec..80a00cc96178 100644 --- a/config/params/testnet_sepolia_config.go +++ b/config/params/testnet_sepolia_config.go @@ -11,11 +11,15 @@ func UseSepoliaNetworkConfig() { cfg := BeaconNetworkConfig().Copy() cfg.ContractDeploymentBlock = 1273020 cfg.BootstrapNodes = []string{ - // EF boot nodes + "enr:-Ku4QDZ_rCowZFsozeWr60WwLgOfHzv1Fz2cuMvJqN5iJzLxKtVjoIURY42X_YTokMi3IGstW5v32uSYZyGUXj9Q_IECh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhIpEe5iJc2VjcDI1NmsxoQNHTpFdaNSCEWiN_QqT396nb0PzcUpLe3OVtLph-AciBYN1ZHCCIy0", + "enr:-Ku4QHRyRwEPT7s0XLYzJ_EeeWvZTXBQb4UCGy1F_3m-YtCNTtDlGsCMr4UTgo4uR89pv11uM-xq4w6GKfKhqU31hTgCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhIrFM7WJc2VjcDI1NmsxoQI4diTwChN3zAAkarf7smOHCdFb1q3DSwdiQ_Lc_FdzFIN1ZHCCIy0", + "enr:-Ku4QOkvvf0u5Hg4-HhY-SJmEyft77G5h3rUM8VF_e-Hag5cAma3jtmFoX4WElLAqdILCA-UWFRN1ZCDJJVuEHrFeLkDh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhJK-AWeJc2VjcDI1NmsxoQLFcT5VE_NMiIC8Ll7GypWDnQ4UEmuzD7hF_Hf4veDJwIN1ZHCCIy0", + "enr:-Ku4QH6tYsHKITYeHUu5kdfXgEZWI18EWk_2RtGOn1jBPlx2UlS_uF3Pm5Dx7tnjOvla_zs-wwlPgjnEOcQDWXey51QCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhIs7Mc6Jc2VjcDI1NmsxoQIET4Mlv9YzhrYhX_H9D7aWMemUrvki6W4J2Qo0YmFMp4N1ZHCCIy0", + "enr:-Ku4QDmz-4c1InchGitsgNk4qzorWMiFUoaPJT4G0IiF8r2UaevrekND1o7fdoftNucirj7sFFTTn2-JdC2Ej0p1Mn8Ch2F0dG5ldHOIAAAAAAAAAACEZXRoMpCo_ujukAAAaf__________gmlkgnY0gmlwhKpA-liJc2VjcDI1NmsxoQMpHP5U1DK8O_JQU6FadmWbE42qEdcGlllR8HcSkkfWq4N1ZHCCIy0", + "enr:-KO4QP7MmB3juk8rUjJHcUoxZDU9Np4FlW0HyDEGIjSO7GD9PbSsabu7713cWSUWKDkxIypIXg1A-6lG7ySRGOMZHeGCAmuEZXRoMpDTH2GRkAAAc___________gmlkgnY0gmlwhBSoyGOJc2VjcDI1NmsxoQNta5b_bexSSwwrGW2Re24MjfMntzFd0f2SAxQtMj3ueYN0Y3CCIyiDdWRwgiMo", + "enr:-KG4QJejf8KVtMeAPWFhN_P0c4efuwu1pZHELTveiXUeim6nKYcYcMIQpGxxdgT2Xp9h-M5pr9gn2NbbwEAtxzu50Y8BgmlkgnY0gmlwhEEVkQCDaXA2kCoBBPnAEJg4AAAAAAAAAAGJc2VjcDI1NmsxoQLEh_eVvk07AQABvLkTGBQTrrIOQkzouMgSBtNHIRUxOIN1ZHCCIyiEdWRwNoIjKA", "enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk", - "enr:-KG4QE5OIg5ThTjkzrlVF32WT_-XT14WeJtIz2zoTqLLjQhYAmJlnk4ItSoH41_2x0RX0wTFIe5GgjRzU2u7Q1fN4vADhGV0aDKQqP7o7pAAAHAyAAAAAAAAAIJpZIJ2NIJpcISlFsStiXNlY3AyNTZrMaEC-Rrd_bBZwhKpXzFCrStKp1q_HmGOewxY3KwM8ofAj_ODdGNwgiMog3VkcIIjKA", - // Teku boot node - "enr:-Ly4QFoZTWR8ulxGVsWydTNGdwEESueIdj-wB6UmmjUcm-AOPxnQi7wprzwcdo7-1jBW_JxELlUKJdJES8TDsbl1EdNlh2F0dG5ldHOI__78_v2bsV-EZXRoMpA2-lATkAAAcf__________gmlkgnY0gmlwhBLYJjGJc2VjcDI1NmsxoQI0gujXac9rMAb48NtMqtSTyHIeNYlpjkbYpWJw46PmYYhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA", + "enr:-L64QC9Hhov4DhQ7mRukTOz4_jHm4DHlGL726NWH4ojH1wFgEwSin_6H95Gs6nW2fktTWbPachHJ6rUFu0iJNgA0SB2CARqHYXR0bmV0c4j__________4RldGgykDb6UBOQAABx__________-CaWSCdjSCaXCEA-2vzolzZWNwMjU2azGhA17lsUg60R776rauYMdrAz383UUgESoaHEzMkvm4K6k6iHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo", } OverrideBeaconNetworkConfig(cfg) } From 7786cb5684b507868bc2102269f78c853de663bf Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:38:51 +0200 Subject: [PATCH 305/325] create lc finalized header based on finalized block version (#14457) * create finalized header based on finalized block version * changelog entry * refactor tests --- CHANGELOG.md | 1 + beacon-chain/core/light-client/BUILD.bazel | 4 + beacon-chain/core/light-client/lightclient.go | 2 +- .../core/light-client/lightclient_test.go | 998 ++++++++++++------ testing/util/lightclient.go | 266 +++++ 5 files changed, 918 insertions(+), 353 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2882c93d1cb1..4eda07f65687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Core: Fixed slash processing causing extra hashing. - Core: Fixed extra allocations when processing slashings. - remove unneeded container in blob sidecar ssz response +- Light client support: create finalized header based on finalizedBlock's version, not attestedBlock. - Testing: added custom matcher for better push settings testing. ### Security diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel index 9bde03319096..f6af7a3b9fe1 100644 --- a/beacon-chain/core/light-client/BUILD.bazel +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -29,11 +29,15 @@ go_test( srcs = ["lightclient_test.go"], deps = [ ":go_default_library", + "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", + "//encoding/ssz:go_default_library", "//proto/engine/v1:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index 3953843b8df8..c91c1dd50b37 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -328,7 +328,7 @@ func NewLightClientUpdateFromBeaconState( if err != nil { return nil, errors.Wrap(err, "could not get finalized header root") } - switch block.Block().Version() { + switch finalizedBlock.Block().Version() { case version.Altair, version.Bellatrix: result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index 513d3ff7beef..ff7b6ee94b0c 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -3,7 +3,11 @@ package light_client_test import ( "testing" + "github.com/pkg/errors" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" lightClient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" @@ -14,371 +18,661 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateAltair(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestAltair() +func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) { + t.Run("Altair", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() - update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) -} - -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateCapella(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(false) - - update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) -} - -func TestLightClient_NewLightClientOptimisticUpdateFromBeaconStateDeneb(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb(false) - - update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + }) - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) -} + t.Run("Capella", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) -func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateAltair(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestAltair() - - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() - require.NoError(t, err) - require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") - require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } -} + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") -func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateCapella(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(false) - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() - require.NoError(t, err) - require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") - require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } -} + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") -func TestLightClient_NewLightClientFinalityUpdateFromBeaconStateDeneb(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb(false) - - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() - require.NoError(t, err) - require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.GetHeaderDeneb().Execution.BlockHash, "Execution BlockHash is not zero") - require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } -} + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + }) -func TestLightClient_BlockToLightClientHeaderAltair(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestAltair() + t.Run("Deneb", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(false) - header, err := lightClient.BlockToLightClientHeaderAltair(l.Block) - require.NoError(t, err) - require.NotNil(t, header, "header is nil") + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") - parentRoot := l.Block.Block().ParentRoot() - stateRoot := l.Block.Block().StateRoot() - bodyRoot, err := l.Block.Block().Body().HashTreeRoot() - require.NoError(t, err) + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") - require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") - require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") - require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") - require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + }) } -func TestLightClient_BlockToLightClientHeaderCapella_NonBlindedBeaconBlock(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(false) - - header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) - require.NoError(t, err) - require.NotNil(t, header, "header is nil") - - parentRoot := l.Block.Block().ParentRoot() - stateRoot := l.Block.Block().StateRoot() - bodyRoot, err := l.Block.Block().Body().HashTreeRoot() - require.NoError(t, err) - - payload, err := l.Block.Block().Body().Execution() - require.NoError(t, err) - - transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) - require.NoError(t, err) - - withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) - require.NoError(t, err) - - executionHeader := &v11.ExecutionPayloadHeaderCapella{ - ParentHash: payload.ParentHash(), - FeeRecipient: payload.FeeRecipient(), - StateRoot: payload.StateRoot(), - ReceiptsRoot: payload.ReceiptsRoot(), - LogsBloom: payload.LogsBloom(), - PrevRandao: payload.PrevRandao(), - BlockNumber: payload.BlockNumber(), - GasLimit: payload.GasLimit(), - GasUsed: payload.GasUsed(), - Timestamp: payload.Timestamp(), - ExtraData: payload.ExtraData(), - BaseFeePerGas: payload.BaseFeePerGas(), - BlockHash: payload.BlockHash(), - TransactionsRoot: transactionsRoot, - WithdrawalsRoot: withdrawalsRoot, - } - - executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) - require.NoError(t, err) - - require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") - require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") - require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") - require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") - require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") - - require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") - - require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") +func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { + t.Run("Altair", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() + + t.Run("FinalizedBlock Nil", func(t *testing.T) { + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + for _, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") + } + }) + + t.Run("FinalizedBlock Not Nil", func(t *testing.T) { + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + finalizedBlockHeader, err := l.FinalizedBlock.Header() + require.NoError(t, err) + + //zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, finalizedBlockHeader.Header.Slot, updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not equal") + require.Equal(t, finalizedBlockHeader.Header.ProposerIndex, updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.ParentRoot, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.StateRoot, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.BodyRoot, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not equal") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + + finalityBranch, err := l.AttestedState.FinalizedRootProof(l.Ctx) + require.NoError(t, err) + for i, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, finalityBranch[i], leaf, "Leaf is not equal") + } + }) + }) + + t.Run("Capella", func(t *testing.T) { + t.Run("FinalizedBlock Nil", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + for _, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") + } + }) + + t.Run("FinalizedBlock Not Nil", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + finalizedBlockHeader, err := l.FinalizedBlock.Header() + require.NoError(t, err) + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, finalizedBlockHeader.Header.Slot, updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not equal") + require.Equal(t, finalizedBlockHeader.Header.ProposerIndex, updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.ParentRoot, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.StateRoot, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.BodyRoot, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not equal") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + finalityBranch, err := l.AttestedState.FinalizedRootProof(l.Ctx) + require.NoError(t, err) + for i, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, finalityBranch[i], leaf, "Leaf is not equal") + } + + // Check Execution BlockHash + payloadInterface, err := l.FinalizedBlock.Block().Body().Execution() + require.NoError(t, err) + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + require.NoError(t, err) + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + require.NoError(t, err) + transactionsRoot = transactionsRootArray[:] + } else { + require.NoError(t, err) + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + require.NoError(t, err) + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + require.NoError(t, err) + withdrawalsRoot = withdrawalsRootArray[:] + } else { + require.NoError(t, err) + } + execution := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + require.DeepSSZEqual(t, execution, update.FinalizedHeader.GetHeaderCapella().Execution, "Finalized Block Execution is not equal") + }) + + t.Run("FinalizedBlock In Previous Fork", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapellaFinalizedBlockAltair(false) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + finalizedBlockHeader, err := l.FinalizedBlock.Header() + require.NoError(t, err) + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, finalizedBlockHeader.Header.Slot, updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not equal") + require.Equal(t, finalizedBlockHeader.Header.ProposerIndex, updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.ParentRoot, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.StateRoot, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.BodyRoot, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not equal") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + finalityBranch, err := l.AttestedState.FinalizedRootProof(l.Ctx) + require.NoError(t, err) + for i, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, finalityBranch[i], leaf, "Leaf is not equal") + } + }) + }) + + t.Run("Deneb", func(t *testing.T) { + t.Run("FinalizedBlock Nil", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(false) + + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + zeroHash := params.BeaconConfig().ZeroHash[:] + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") + require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") + require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") + require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.GetHeaderDeneb().Execution.BlockHash, "Execution BlockHash is not zero") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + for _, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") + } + }) + + t.Run("FinalizedBlock Not Nil", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(false) + + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + //zeroHash := params.BeaconConfig().ZeroHash[:] + finalizedBlockHeader, err := l.FinalizedBlock.Header() + require.NoError(t, err) + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, finalizedBlockHeader.Header.Slot, updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not equal") + require.Equal(t, finalizedBlockHeader.Header.ProposerIndex, updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.ParentRoot, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.StateRoot, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.BodyRoot, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not equal") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + finalityBranch, err := l.AttestedState.FinalizedRootProof(l.Ctx) + require.NoError(t, err) + for i, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, finalityBranch[i], leaf, "Leaf is not equal") + } + + // Check Execution BlockHash + payloadInterface, err := l.FinalizedBlock.Block().Body().Execution() + require.NoError(t, err) + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + require.NoError(t, err) + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + require.NoError(t, err) + transactionsRoot = transactionsRootArray[:] + } else { + require.NoError(t, err) + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + require.NoError(t, err) + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + require.NoError(t, err) + withdrawalsRoot = withdrawalsRootArray[:] + } else { + require.NoError(t, err) + } + execution := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + require.DeepSSZEqual(t, execution, update.FinalizedHeader.GetHeaderDeneb().Execution, "Finalized Block Execution is not equal") + }) + + t.Run("FinalizedBlock In Previous Fork", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDenebFinalizedBlockCapella(false) + + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + require.NoError(t, err) + require.NotNil(t, update, "update is nil") + + require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") + + l.CheckSyncAggregate(update.SyncAggregate) + l.CheckAttestedHeader(update.AttestedHeader) + + finalizedBlockHeader, err := l.FinalizedBlock.Header() + require.NoError(t, err) + require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") + updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() + require.NoError(t, err) + require.Equal(t, finalizedBlockHeader.Header.Slot, updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not equal") + require.Equal(t, finalizedBlockHeader.Header.ProposerIndex, updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.ParentRoot, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.StateRoot, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not equal") + require.DeepSSZEqual(t, finalizedBlockHeader.Header.BodyRoot, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not equal") + require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") + finalityBranch, err := l.AttestedState.FinalizedRootProof(l.Ctx) + require.NoError(t, err) + for i, leaf := range update.FinalityBranch { + require.DeepSSZEqual(t, finalityBranch[i], leaf, "Leaf is not equal") + } + + // Check Execution BlockHash + payloadInterface, err := l.FinalizedBlock.Block().Body().Execution() + require.NoError(t, err) + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + require.NoError(t, err) + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + require.NoError(t, err) + transactionsRoot = transactionsRootArray[:] + } else { + require.NoError(t, err) + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + require.NoError(t, err) + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + require.NoError(t, err) + withdrawalsRoot = withdrawalsRootArray[:] + } else { + require.NoError(t, err) + } + execution := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + require.DeepSSZEqual(t, execution, update.FinalizedHeader.GetHeaderCapella().Execution, "Finalized Block Execution is not equal") + }) + }) } -func TestLightClient_BlockToLightClientHeaderCapella_BlindedBeaconBlock(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(true) - - header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) - require.NoError(t, err) - require.NotNil(t, header, "header is nil") - - parentRoot := l.Block.Block().ParentRoot() - stateRoot := l.Block.Block().StateRoot() - bodyRoot, err := l.Block.Block().Body().HashTreeRoot() - require.NoError(t, err) - - payload, err := l.Block.Block().Body().Execution() - require.NoError(t, err) - - transactionsRoot, err := payload.TransactionsRoot() - require.NoError(t, err) - - withdrawalsRoot, err := payload.WithdrawalsRoot() - require.NoError(t, err) - - executionHeader := &v11.ExecutionPayloadHeaderCapella{ - ParentHash: payload.ParentHash(), - FeeRecipient: payload.FeeRecipient(), - StateRoot: payload.StateRoot(), - ReceiptsRoot: payload.ReceiptsRoot(), - LogsBloom: payload.LogsBloom(), - PrevRandao: payload.PrevRandao(), - BlockNumber: payload.BlockNumber(), - GasLimit: payload.GasLimit(), - GasUsed: payload.GasUsed(), - Timestamp: payload.Timestamp(), - ExtraData: payload.ExtraData(), - BaseFeePerGas: payload.BaseFeePerGas(), - BlockHash: payload.BlockHash(), - TransactionsRoot: transactionsRoot, - WithdrawalsRoot: withdrawalsRoot, - } - - executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) - require.NoError(t, err) - - require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") - require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") - require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") - require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") - require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") - - require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") - - require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") +func TestLightClient_BlockToLightClientHeader(t *testing.T) { + t.Run("Altair", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestAltair() + + header, err := lightClient.BlockToLightClientHeaderAltair(l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + }) + + t.Run("Capella", func(t *testing.T) { + t.Run("Non-Blinded Beacon Block", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) + + header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) + require.NoError(t, err) + + withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") + }) + + t.Run("Blinded Beacon Block", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(true) + + header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := payload.TransactionsRoot() + require.NoError(t, err) + + withdrawalsRoot, err := payload.WithdrawalsRoot() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") + }) + }) + + t.Run("Deneb", func(t *testing.T) { + t.Run("Non-Blinded Beacon Block", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(false) + + header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) + require.NoError(t, err) + + withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) + require.NoError(t, err) + + blobGasUsed, err := payload.BlobGasUsed() + require.NoError(t, err) + + excessBlobGas, err := payload.ExcessBlobGas() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") + }) + + t.Run("Blinded Beacon Block", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(true) + + header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) + require.NoError(t, err) + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := payload.TransactionsRoot() + require.NoError(t, err) + + withdrawalsRoot, err := payload.WithdrawalsRoot() + require.NoError(t, err) + + blobGasUsed, err := payload.BlobGasUsed() + require.NoError(t, err) + + excessBlobGas, err := payload.ExcessBlobGas() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") + }) + }) } - -func TestLightClient_BlockToLightClientHeaderDeneb_NonBlindedBeaconBlock(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb(false) - - header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) - require.NoError(t, err) - require.NotNil(t, header, "header is nil") - - parentRoot := l.Block.Block().ParentRoot() - stateRoot := l.Block.Block().StateRoot() - bodyRoot, err := l.Block.Block().Body().HashTreeRoot() - require.NoError(t, err) - - payload, err := l.Block.Block().Body().Execution() - require.NoError(t, err) - - transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) - require.NoError(t, err) - - withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) - require.NoError(t, err) - - blobGasUsed, err := payload.BlobGasUsed() - require.NoError(t, err) - - excessBlobGas, err := payload.ExcessBlobGas() - require.NoError(t, err) - - executionHeader := &v11.ExecutionPayloadHeaderDeneb{ - ParentHash: payload.ParentHash(), - FeeRecipient: payload.FeeRecipient(), - StateRoot: payload.StateRoot(), - ReceiptsRoot: payload.ReceiptsRoot(), - LogsBloom: payload.LogsBloom(), - PrevRandao: payload.PrevRandao(), - BlockNumber: payload.BlockNumber(), - GasLimit: payload.GasLimit(), - GasUsed: payload.GasUsed(), - Timestamp: payload.Timestamp(), - ExtraData: payload.ExtraData(), - BaseFeePerGas: payload.BaseFeePerGas(), - BlockHash: payload.BlockHash(), - TransactionsRoot: transactionsRoot, - WithdrawalsRoot: withdrawalsRoot, - BlobGasUsed: blobGasUsed, - ExcessBlobGas: excessBlobGas, - } - - executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) - require.NoError(t, err) - - require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") - require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") - require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") - require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") - require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") - - require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") - - require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") -} - -func TestLightClient_BlockToLightClientHeaderDeneb_BlindedBeaconBlock(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb(true) - - header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) - require.NoError(t, err) - require.NotNil(t, header, "header is nil") - - parentRoot := l.Block.Block().ParentRoot() - stateRoot := l.Block.Block().StateRoot() - bodyRoot, err := l.Block.Block().Body().HashTreeRoot() - require.NoError(t, err) - - payload, err := l.Block.Block().Body().Execution() - require.NoError(t, err) - - transactionsRoot, err := payload.TransactionsRoot() - require.NoError(t, err) - - withdrawalsRoot, err := payload.WithdrawalsRoot() - require.NoError(t, err) - - blobGasUsed, err := payload.BlobGasUsed() - require.NoError(t, err) - - excessBlobGas, err := payload.ExcessBlobGas() - require.NoError(t, err) - - executionHeader := &v11.ExecutionPayloadHeaderDeneb{ - ParentHash: payload.ParentHash(), - FeeRecipient: payload.FeeRecipient(), - StateRoot: payload.StateRoot(), - ReceiptsRoot: payload.ReceiptsRoot(), - LogsBloom: payload.LogsBloom(), - PrevRandao: payload.PrevRandao(), - BlockNumber: payload.BlockNumber(), - GasLimit: payload.GasLimit(), - GasUsed: payload.GasUsed(), - Timestamp: payload.Timestamp(), - ExtraData: payload.ExtraData(), - BaseFeePerGas: payload.BaseFeePerGas(), - BlockHash: payload.BlockHash(), - TransactionsRoot: transactionsRoot, - WithdrawalsRoot: withdrawalsRoot, - BlobGasUsed: blobGasUsed, - ExcessBlobGas: excessBlobGas, - } - - executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) - require.NoError(t, err) - - require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") - require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") - require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") - require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") - require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") - - require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") - - require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") -} - -// TODO - add finality update tests with non-nil finalized block for different versions diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index a4ca9b3e5abb..63d85f961ff5 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -39,6 +39,131 @@ func (l *TestLightClient) SetupTestCapella(blinded bool) *TestLightClient { err = attestedState.SetSlot(slot) require.NoError(l.T, err) + finalizedBlock, err := blocks.NewSignedBeaconBlock(NewBeaconBlockCapella()) + require.NoError(l.T, err) + finalizedBlock.SetSlot(1) + finalizedHeader, err := finalizedBlock.Header() + require.NoError(l.T, err) + finalizedRoot, err := finalizedHeader.Header.HashTreeRoot() + require.NoError(l.T, err) + + require.NoError(l.T, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: params.BeaconConfig().CapellaForkEpoch - 10, + Root: finalizedRoot[:], + })) + + parent := NewBeaconBlockCapella() + parent.Block.Slot = slot + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + parentHeader, err := signedParent.Header() + require.NoError(l.T, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(l.T, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + state, err := NewBeaconStateCapella() + require.NoError(l.T, err) + err = state.SetSlot(slot) + require.NoError(l.T, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(l.T, err) + + var signedBlock interfaces.SignedBeaconBlock + if blinded { + block := NewBlindedBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } else { + block := NewBeaconBlockCapella() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } + + l.State = state + l.AttestedState = attestedState + l.AttestedHeader = attestedHeader + l.Block = signedBlock + l.Ctx = ctx + l.FinalizedBlock = finalizedBlock + + return l +} + +func (l *TestLightClient) SetupTestCapellaFinalizedBlockAltair(blinded bool) *TestLightClient { + ctx := context.Background() + + slot := primitives.Slot(params.BeaconConfig().CapellaForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + attestedState, err := NewBeaconStateCapella() + require.NoError(l.T, err) + err = attestedState.SetSlot(slot) + require.NoError(l.T, err) + + finalizedBlock, err := blocks.NewSignedBeaconBlock(NewBeaconBlockAltair()) + require.NoError(l.T, err) + finalizedBlock.SetSlot(1) + finalizedHeader, err := finalizedBlock.Header() + require.NoError(l.T, err) + finalizedRoot, err := finalizedHeader.Header.HashTreeRoot() + require.NoError(l.T, err) + + require.NoError(l.T, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: params.BeaconConfig().AltairForkEpoch - 10, + Root: finalizedRoot[:], + })) + parent := NewBeaconBlockCapella() parent.Block.Slot = slot @@ -123,6 +248,7 @@ func (l *TestLightClient) SetupTestCapella(blinded bool) *TestLightClient { l.AttestedHeader = attestedHeader l.Block = signedBlock l.Ctx = ctx + l.FinalizedBlock = finalizedBlock return l } @@ -137,6 +263,19 @@ func (l *TestLightClient) SetupTestAltair() *TestLightClient { err = attestedState.SetSlot(slot) require.NoError(l.T, err) + finalizedBlock, err := blocks.NewSignedBeaconBlock(NewBeaconBlockAltair()) + require.NoError(l.T, err) + finalizedBlock.SetSlot(1) + finalizedHeader, err := finalizedBlock.Header() + require.NoError(l.T, err) + finalizedRoot, err := finalizedHeader.Header.HashTreeRoot() + require.NoError(l.T, err) + + require.NoError(l.T, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: params.BeaconConfig().AltairForkEpoch - 10, + Root: finalizedRoot[:], + })) + parent := NewBeaconBlockAltair() parent.Block.Slot = slot @@ -194,6 +333,7 @@ func (l *TestLightClient) SetupTestAltair() *TestLightClient { l.AttestedHeader = attestedHeader l.Block = signedBlock l.Ctx = ctx + l.FinalizedBlock = finalizedBlock return l } @@ -208,6 +348,131 @@ func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient { err = attestedState.SetSlot(slot) require.NoError(l.T, err) + finalizedBlock, err := blocks.NewSignedBeaconBlock(NewBeaconBlockDeneb()) + require.NoError(l.T, err) + finalizedBlock.SetSlot(1) + finalizedHeader, err := finalizedBlock.Header() + require.NoError(l.T, err) + finalizedRoot, err := finalizedHeader.Header.HashTreeRoot() + require.NoError(l.T, err) + + require.NoError(l.T, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: params.BeaconConfig().DenebForkEpoch - 10, + Root: finalizedRoot[:], + })) + + parent := NewBeaconBlockDeneb() + parent.Block.Slot = slot + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + parentHeader, err := signedParent.Header() + require.NoError(l.T, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(l.T, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + state, err := NewBeaconStateDeneb() + require.NoError(l.T, err) + err = state.SetSlot(slot) + require.NoError(l.T, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(l.T, err) + + var signedBlock interfaces.SignedBeaconBlock + if blinded { + block := NewBlindedBeaconBlockDeneb() + block.Message.Slot = slot + block.Message.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Message.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Message.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } else { + block := NewBeaconBlockDeneb() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } + + l.State = state + l.AttestedState = attestedState + l.AttestedHeader = attestedHeader + l.Block = signedBlock + l.Ctx = ctx + l.FinalizedBlock = finalizedBlock + + return l +} + +func (l *TestLightClient) SetupTestDenebFinalizedBlockCapella(blinded bool) *TestLightClient { + ctx := context.Background() + + slot := primitives.Slot(params.BeaconConfig().DenebForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + attestedState, err := NewBeaconStateDeneb() + require.NoError(l.T, err) + err = attestedState.SetSlot(slot) + require.NoError(l.T, err) + + finalizedBlock, err := blocks.NewSignedBeaconBlock(NewBeaconBlockCapella()) + require.NoError(l.T, err) + finalizedBlock.SetSlot(1) + finalizedHeader, err := finalizedBlock.Header() + require.NoError(l.T, err) + finalizedRoot, err := finalizedHeader.Header.HashTreeRoot() + require.NoError(l.T, err) + + require.NoError(l.T, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: params.BeaconConfig().CapellaForkEpoch - 10, + Root: finalizedRoot[:], + })) + parent := NewBeaconBlockDeneb() parent.Block.Slot = slot @@ -292,6 +557,7 @@ func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient { l.AttestedHeader = attestedHeader l.Block = signedBlock l.Ctx = ctx + l.FinalizedBlock = finalizedBlock return l } From 6d499bc9fc99b7359c2a8729546aa8d278f671d7 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Tue, 1 Oct 2024 15:35:36 +0100 Subject: [PATCH 306/325] Enable electra interop genesis (#14465) * Add Electra hard fork to interop genesis * Update Changelog * Fix develop merge * gazelle --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: Preston Van Loon --- CHANGELOG.md | 1 + runtime/interop/BUILD.bazel | 4 ++ runtime/interop/premine-state.go | 72 +++++++++++++++++++++++++++ runtime/interop/premine-state_test.go | 26 ++++++++++ 4 files changed, 103 insertions(+) create mode 100644 runtime/interop/premine-state_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eda07f65687..2dca1f90236f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve ### Changed +- Electra: Updated interop genesis generator to support Electra. - `getLocalPayload` has been refactored to enable work in ePBS branch. - `TestNodeServer_GetPeer` and `TestNodeServer_ListPeers` test flakes resolved by iterating the whole peer list to find a match rather than taking the first peer in the map. diff --git a/runtime/interop/BUILD.bazel b/runtime/interop/BUILD.bazel index e82eda2dd5ea..454b309e009a 100644 --- a/runtime/interop/BUILD.bazel +++ b/runtime/interop/BUILD.bazel @@ -49,6 +49,7 @@ go_test( "generate_genesis_state_bellatrix_test.go", "generate_genesis_state_test.go", "generate_keys_test.go", + "premine-state_test.go", ], data = [ "keygen_test_vector.yaml", @@ -61,9 +62,12 @@ go_test( "//container/trie:go_default_library", "//proto/engine/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", + "//time:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", + "@com_github_ethereum_go_ethereum//core/types:go_default_library", "@com_github_go_yaml_yaml//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", ], diff --git a/runtime/interop/premine-state.go b/runtime/interop/premine-state.go index 235f8a1968e3..b34445a0076a 100644 --- a/runtime/interop/premine-state.go +++ b/runtime/interop/premine-state.go @@ -155,6 +155,11 @@ func (s *PremineGenesisConfig) empty() (state.BeaconState, error) { if err != nil { return nil, err } + case version.Electra: + e, err = state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{}) + if err != nil { + return nil, err + } default: return nil, errUnsupportedVersion } @@ -336,6 +341,8 @@ func (s *PremineGenesisConfig) setFork(g state.BeaconState) error { pv, cv = params.BeaconConfig().BellatrixForkVersion, params.BeaconConfig().CapellaForkVersion case version.Deneb: pv, cv = params.BeaconConfig().CapellaForkVersion, params.BeaconConfig().DenebForkVersion + case version.Electra: + pv, cv = params.BeaconConfig().ElectraForkVersion, params.BeaconConfig().ElectraForkVersion default: return errUnsupportedVersion } @@ -524,6 +531,39 @@ func (s *PremineGenesisConfig) setLatestBlockHeader(g state.BeaconState) error { BlsToExecutionChanges: make([]*ethpb.SignedBLSToExecutionChange, 0), BlobKzgCommitments: make([][]byte, 0), } + case version.Electra: + body = ðpb.BeaconBlockBodyElectra{ + RandaoReveal: make([]byte, 96), + Eth1Data: ðpb.Eth1Data{ + DepositRoot: make([]byte, 32), + BlockHash: make([]byte, 32), + }, + Graffiti: make([]byte, 32), + SyncAggregate: ðpb.SyncAggregate{ + SyncCommitteeBits: make([]byte, fieldparams.SyncCommitteeLength/8), + SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), + }, + ExecutionPayload: &enginev1.ExecutionPayloadElectra{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), + }, + BlsToExecutionChanges: make([]*ethpb.SignedBLSToExecutionChange, 0), + BlobKzgCommitments: make([][]byte, 0), + ExecutionRequests: &enginev1.ExecutionRequests{ + Deposits: make([]*enginev1.DepositRequest, 0), + Withdrawals: make([]*enginev1.WithdrawalRequest, 0), + Consolidations: make([]*enginev1.ConsolidationRequest, 0), + }, + } default: return errUnsupportedVersion } @@ -640,6 +680,38 @@ func (s *PremineGenesisConfig) setExecutionPayload(g state.BeaconState) error { if err != nil { return err } + case version.Electra: + payload := &enginev1.ExecutionPayloadElectra{ + ParentHash: gb.ParentHash().Bytes(), + FeeRecipient: gb.Coinbase().Bytes(), + StateRoot: gb.Root().Bytes(), + ReceiptsRoot: gb.ReceiptHash().Bytes(), + LogsBloom: gb.Bloom().Bytes(), + PrevRandao: params.BeaconConfig().ZeroHash[:], + BlockNumber: gb.NumberU64(), + GasLimit: gb.GasLimit(), + GasUsed: gb.GasUsed(), + Timestamp: gb.Time(), + ExtraData: gb.Extra()[:32], + BaseFeePerGas: bytesutil.PadTo(bytesutil.ReverseByteOrder(gb.BaseFee().Bytes()), fieldparams.RootLength), + BlockHash: gb.Hash().Bytes(), + Transactions: make([][]byte, 0), + Withdrawals: make([]*enginev1.Withdrawal, 0), + ExcessBlobGas: *gb.ExcessBlobGas(), + BlobGasUsed: *gb.BlobGasUsed(), + } + wep, err := blocks.WrappedExecutionPayloadElectra(payload) + if err != nil { + return err + } + eph, err := blocks.PayloadToHeaderElectra(wep) + if err != nil { + return err + } + ed, err = blocks.WrappedExecutionPayloadHeaderElectra(eph) + if err != nil { + return err + } default: return errUnsupportedVersion } diff --git a/runtime/interop/premine-state_test.go b/runtime/interop/premine-state_test.go new file mode 100644 index 000000000000..a296a1c196ae --- /dev/null +++ b/runtime/interop/premine-state_test.go @@ -0,0 +1,26 @@ +package interop + +import ( + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/time" +) + +func TestPremineGenesis_Electra(t *testing.T) { + one := uint64(1) + + genesis := types.NewBlockWithHeader(&types.Header{ + Time: uint64(time.Now().Unix()), + Extra: make([]byte, 32), + BaseFee: big.NewInt(1), + ExcessBlobGas: &one, + BlobGasUsed: &one, + }) + _, err := NewPreminedGenesis(context.Background(), genesis.Time(), 10, 10, version.Electra, genesis) + require.NoError(t, err) +} From 2e29164582c3665cdf5a472cd4ec9838655c9754 Mon Sep 17 00:00:00 2001 From: Owen <85877303+0w3n-d@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:13:41 +0100 Subject: [PATCH 307/325] allow users to publish blobs (#14442) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * allow users to publish blobs Allowing users to publish blobs before publishing blocks, gives the blobs a head start. They can begin to propagate around the network while the block is being validated. * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go * Update beacon-chain/rpc/prysm/beacon/handlers.go --------- Co-authored-by: Radosław Kapka --- CHANGELOG.md | 1 + api/server/structs/BUILD.bazel | 1 + api/server/structs/conversions_blob.go | 61 +++++ api/server/structs/conversions_block.go | 6 + api/server/structs/endpoints_blob.go | 9 + beacon-chain/rpc/endpoints.go | 12 + beacon-chain/rpc/endpoints_test.go | 1 + beacon-chain/rpc/prysm/beacon/BUILD.bazel | 6 + beacon-chain/rpc/prysm/beacon/handlers.go | 51 +++++ .../rpc/prysm/beacon/handlers_test.go | 163 ++++++++++++++ beacon-chain/rpc/prysm/beacon/server.go | 3 + beacon-chain/rpc/prysm/testing/BUILD.bazel | 9 + beacon-chain/rpc/prysm/testing/json.go | 210 ++++++++++++++++++ 13 files changed, 533 insertions(+) create mode 100644 api/server/structs/conversions_blob.go create mode 100644 beacon-chain/rpc/prysm/testing/BUILD.bazel create mode 100644 beacon-chain/rpc/prysm/testing/json.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dca1f90236f..9a5da0a4f444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - GetBeaconStateV2: add Electra case. - Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875) - Tests to ensure sepolia config matches the official upstream yaml +- HTTP endpoint for PublishBlobs ### Changed diff --git a/api/server/structs/BUILD.bazel b/api/server/structs/BUILD.bazel index f700ecb3cd04..c194d502ee02 100644 --- a/api/server/structs/BUILD.bazel +++ b/api/server/structs/BUILD.bazel @@ -5,6 +5,7 @@ go_library( srcs = [ "block.go", "conversions.go", + "conversions_blob.go", "conversions_block.go", "conversions_lightclient.go", "conversions_state.go", diff --git a/api/server/structs/conversions_blob.go b/api/server/structs/conversions_blob.go new file mode 100644 index 000000000000..3d153dc09c9e --- /dev/null +++ b/api/server/structs/conversions_blob.go @@ -0,0 +1,61 @@ +package structs + +import ( + "strconv" + + "github.com/prysmaticlabs/prysm/v5/api/server" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +func (sc *Sidecar) ToConsensus() (*eth.BlobSidecar, error) { + if sc == nil { + return nil, errNilValue + } + + index, err := strconv.ParseUint(sc.Index, 10, 64) + if err != nil { + return nil, server.NewDecodeError(err, "Index") + } + + blob, err := bytesutil.DecodeHexWithLength(sc.Blob, 131072) + if err != nil { + return nil, server.NewDecodeError(err, "Blob") + } + + kzgCommitment, err := bytesutil.DecodeHexWithLength(sc.KzgCommitment, 48) + if err != nil { + return nil, server.NewDecodeError(err, "KzgCommitment") + } + + kzgProof, err := bytesutil.DecodeHexWithLength(sc.KzgProof, 48) + if err != nil { + return nil, server.NewDecodeError(err, "KzgProof") + } + + header, err := sc.SignedBeaconBlockHeader.ToConsensus() + if err != nil { + return nil, server.NewDecodeError(err, "SignedBeaconBlockHeader") + } + + // decode the commitment inclusion proof + var commitmentInclusionProof [][]byte + for _, proof := range sc.CommitmentInclusionProof { + proofBytes, err := bytesutil.DecodeHexWithLength(proof, 32) + if err != nil { + return nil, server.NewDecodeError(err, "CommitmentInclusionProof") + } + commitmentInclusionProof = append(commitmentInclusionProof, proofBytes) + } + + bsc := ð.BlobSidecar{ + Index: index, + Blob: blob, + KzgCommitment: kzgCommitment, + KzgProof: kzgProof, + SignedBlockHeader: header, + CommitmentInclusionProof: commitmentInclusionProof, + } + + return bsc, nil +} diff --git a/api/server/structs/conversions_block.go b/api/server/structs/conversions_block.go index 05bb0f2e0bcc..961e7170316e 100644 --- a/api/server/structs/conversions_block.go +++ b/api/server/structs/conversions_block.go @@ -20,6 +20,9 @@ import ( var ErrUnsupportedConversion = errors.New("Could not determine api struct type to use for value") func (h *SignedBeaconBlockHeader) ToConsensus() (*eth.SignedBeaconBlockHeader, error) { + if h == nil { + return nil, errNilValue + } msg, err := h.Message.ToConsensus() if err != nil { return nil, server.NewDecodeError(err, "Message") @@ -36,6 +39,9 @@ func (h *SignedBeaconBlockHeader) ToConsensus() (*eth.SignedBeaconBlockHeader, e } func (h *BeaconBlockHeader) ToConsensus() (*eth.BeaconBlockHeader, error) { + if h == nil { + return nil, errNilValue + } s, err := strconv.ParseUint(h.Slot, 10, 64) if err != nil { return nil, server.NewDecodeError(err, "Slot") diff --git a/api/server/structs/endpoints_blob.go b/api/server/structs/endpoints_blob.go index 2ea737945e27..33fc59772537 100644 --- a/api/server/structs/endpoints_blob.go +++ b/api/server/structs/endpoints_blob.go @@ -12,3 +12,12 @@ type Sidecar struct { KzgProof string `json:"kzg_proof"` CommitmentInclusionProof []string `json:"kzg_commitment_inclusion_proof"` } + +type BlobSidecars struct { + Sidecars []*Sidecar `json:"sidecars"` +} + +type PublishBlobsRequest struct { + BlobSidecars *BlobSidecars `json:"blob_sidecars"` + BlockRoot string `json:"block_root"` +} diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 3d99b2d291ee..0f606ea5e9c7 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -942,6 +942,8 @@ func (s *Service) prysmBeaconEndpoints( ChainInfoFetcher: s.cfg.ChainInfoFetcher, FinalizationFetcher: s.cfg.FinalizationFetcher, CoreService: coreService, + Broadcaster: s.cfg.Broadcaster, + BlobReceiver: s.cfg.BlobReceiver, } const namespace = "prysm.beacon" @@ -992,6 +994,16 @@ func (s *Service) prysmBeaconEndpoints( handler: server.GetChainHead, methods: []string{http.MethodGet}, }, + { + template: "/prysm/v1/beacon/blobs", + name: namespace + ".PublishBlobs", + middleware: []middleware.Middleware{ + middleware.ContentTypeHandler([]string{api.JsonMediaType}), + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.PublishBlobs, + methods: []string{http.MethodPost}, + }, } } diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index 6b7799303f31..0218b4a30524 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -115,6 +115,7 @@ func Test_endpoints(t *testing.T) { "/eth/v1/beacon/states/{state_id}/validator_count": {http.MethodGet}, "/prysm/v1/beacon/states/{state_id}/validator_count": {http.MethodGet}, "/prysm/v1/beacon/chain_head": {http.MethodGet}, + "/prysm/v1/beacon/blobs": {http.MethodPost}, } prysmNodeRoutes := map[string][]string{ diff --git a/beacon-chain/rpc/prysm/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/beacon/BUILD.bazel index e4f78cdfbbfa..d750ef3bbe2d 100644 --- a/beacon-chain/rpc/prysm/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/beacon/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "//beacon-chain/blockchain:go_default_library", "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/db:go_default_library", + "//beacon-chain/p2p:go_default_library", "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/eth/helpers:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", @@ -22,8 +23,10 @@ go_library( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/sync:go_default_library", "//config/params:go_default_library", + "//consensus-types/blocks:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", + "//encoding/bytesutil:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", @@ -47,13 +50,16 @@ go_test( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/db/testing:go_default_library", "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", + "//beacon-chain/p2p/testing:go_default_library", "//beacon-chain/rpc/core:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", + "//beacon-chain/rpc/prysm/testing:go_default_library", "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/state/stategen/mock:go_default_library", + "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", diff --git a/beacon-chain/rpc/prysm/beacon/handlers.go b/beacon-chain/rpc/prysm/beacon/handlers.go index c98a6d5580e6..81bc7203e2d9 100644 --- a/beacon-chain/rpc/prysm/beacon/handlers.go +++ b/beacon-chain/rpc/prysm/beacon/handlers.go @@ -15,7 +15,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -183,3 +185,52 @@ func (s *Server) GetChainHead(w http.ResponseWriter, r *http.Request) { } httputil.WriteJson(w, response) } + +func (s *Server) PublishBlobs(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "beacon.PublishBlobs") + defer span.End() + if shared.IsSyncing(r.Context(), w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) { + return + } + + var req structs.PublishBlobsRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + httputil.HandleError(w, "Could not decode JSON request body", http.StatusBadRequest) + return + } + if req.BlobSidecars == nil { + httputil.HandleError(w, "Missing blob sidecars", http.StatusBadRequest) + return + } + + root, err := bytesutil.DecodeHexWithLength(req.BlockRoot, 32) + if err != nil { + httputil.HandleError(w, "Could not decode block root: "+err.Error(), http.StatusBadRequest) + return + } + + for _, blobSidecar := range req.BlobSidecars.Sidecars { + sc, err := blobSidecar.ToConsensus() + if err != nil { + httputil.HandleError(w, "Could not decode blob sidecar: "+err.Error(), http.StatusBadRequest) + return + } + + readOnlySc, err := blocks.NewROBlobWithRoot(sc, bytesutil.ToBytes32(root)) + if err != nil { + httputil.HandleError(w, "Could not create read-only blob: "+err.Error(), http.StatusInternalServerError) + return + } + + verifiedBlob := blocks.NewVerifiedROBlob(readOnlySc) + if err := s.BlobReceiver.ReceiveBlob(ctx, verifiedBlob); err != nil { + httputil.HandleError(w, "Could not receive blob: "+err.Error(), http.StatusInternalServerError) + return + } + + if err := s.Broadcaster.BroadcastBlob(ctx, sc.Index, sc); err != nil { + httputil.HandleError(w, "Failed to broadcast blob: "+err.Error(), http.StatusInternalServerError) + return + } + } +} diff --git a/beacon-chain/rpc/prysm/beacon/handlers_test.go b/beacon-chain/rpc/prysm/beacon/handlers_test.go index ec8a66511141..54e471924972 100644 --- a/beacon-chain/rpc/prysm/beacon/handlers_test.go +++ b/beacon-chain/rpc/prysm/beacon/handlers_test.go @@ -18,10 +18,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" + mockp2p "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" + rpctesting "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/prysm/testing" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" mockstategen "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen/mock" + mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -870,3 +873,163 @@ func TestServer_GetChainHead(t *testing.T) { assert.DeepEqual(t, hexutil.Encode(fRoot[:]), ch.FinalizedBlockRoot, "Unexpected FinalizedBlockRoot") assert.Equal(t, false, ch.OptimisticStatus) } + +func TestPublishBlobs_InvalidJson(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.InvalidJson))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Could not decode JSON request body", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_MissingBlob(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestMissingBlob))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Could not decode blob sidecar", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_MissingSignedBlockHeader(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestMissingSignedBlockHeader))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Could not decode blob sidecar", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_MissingSidecars(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestMissingSidecars))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Missing blob sidecars", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_EmptySidecarsList(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestEmptySidecarsList))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_NullSidecar(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestNullSidecar))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Could not decode blob sidecar", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_SeveralFieldsMissing(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestSeveralFieldsMissing))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Could not decode blob sidecar", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs_BadBlockRoot(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequestBadBlockRoot))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + assert.StringContains(t, "Could not decode block root", writer.Body.String()) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 0) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), false) +} + +func TestPublishBlobs(t *testing.T) { + server := &Server{ + BlobReceiver: &chainMock.ChainService{}, + Broadcaster: &mockp2p.MockBroadcaster{}, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.PublishBlobsRequest))) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.PublishBlobs(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + + assert.Equal(t, len(server.BlobReceiver.(*chainMock.ChainService).Blobs), 1) + assert.Equal(t, server.Broadcaster.(*mockp2p.MockBroadcaster).BroadcastCalled.Load(), true) +} diff --git a/beacon-chain/rpc/prysm/beacon/server.go b/beacon-chain/rpc/prysm/beacon/server.go index 5af654712f69..d62c95dcad5e 100644 --- a/beacon-chain/rpc/prysm/beacon/server.go +++ b/beacon-chain/rpc/prysm/beacon/server.go @@ -3,6 +3,7 @@ package beacon import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" beacondb "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" @@ -20,4 +21,6 @@ type Server struct { ChainInfoFetcher blockchain.ChainInfoFetcher FinalizationFetcher blockchain.FinalizationFetcher CoreService *core.Service + Broadcaster p2p.Broadcaster + BlobReceiver blockchain.BlobReceiver } diff --git a/beacon-chain/rpc/prysm/testing/BUILD.bazel b/beacon-chain/rpc/prysm/testing/BUILD.bazel new file mode 100644 index 000000000000..bddcbe7c22f1 --- /dev/null +++ b/beacon-chain/rpc/prysm/testing/BUILD.bazel @@ -0,0 +1,9 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["json.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/prysm/testing", + visibility = ["//visibility:public"], +) diff --git a/beacon-chain/rpc/prysm/testing/json.go b/beacon-chain/rpc/prysm/testing/json.go new file mode 100644 index 000000000000..549fc6b4fcd7 --- /dev/null +++ b/beacon-chain/rpc/prysm/testing/json.go @@ -0,0 +1,210 @@ +package testing + +import "fmt" + +var InvalidJson = `{ + "block_root" : "0x000000000000000 + ] + } + }` + +var PublishBlobsRequestMissingSidecars = `{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000" + }` + +var PublishBlobsRequestMissingBlob = `{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + { + "index" : "0", + "kzg_commitment" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "kzg_commitment_inclusion_proof" : [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "kzg_proof" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signed_block_header" : { + "message" : { + "body_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "parent_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "proposer_index" : "0", + "slot" : "0", + "state_root" : "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "signature" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + } + ] + } + }` + +var PublishBlobsRequestBadBlockRoot = fmt.Sprintf(`{ + "block_root" : "0x0000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + { + "blob" : "%s", + "index" : "0", + "kzg_commitment" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "kzg_commitment_inclusion_proof" : [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "kzg_proof" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signed_block_header" : { + "message" : { + "body_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "parent_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "proposer_index" : "0", + "slot" : "0", + "state_root" : "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "signature" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + } + ] + } + }`, Blob) + +var PublishBlobsRequestEmptySidecarsList = `{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + ] + } + }` + +var PublishBlobsRequestNullSidecar = `{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + null + ] + } + }` + +var PublishBlobsRequestMissingSignedBlockHeader = fmt.Sprintf(`{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + { + "blob" : "%s", + "index" : "0", + "kzg_commitment" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "kzg_commitment_inclusion_proof" : [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "kzg_proof" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ] + } + }`, Blob) + +var PublishBlobsRequestSeveralFieldsMissing = fmt.Sprintf(`{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + { + "blob" : "%s", + "index" : "0", + "kzg_commitment" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "kzg_proof" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signed_block_header" : { + "signature" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + } + ] + } +}`, Blob) + +var PublishBlobsRequest = fmt.Sprintf(`{ + "block_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "blob_sidecars" : { + "sidecars" : [ + { + "blob" : "%s", + "index" : "0", + "kzg_commitment" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "kzg_commitment_inclusion_proof" : [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "kzg_proof" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signed_block_header" : { + "message" : { + "body_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "parent_root" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "proposer_index" : "0", + "slot" : "0", + "state_root" : "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "signature" : "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + } + ] + } + }`, Blob) + +var Blob = `0xe3078ecee8c4625a862b8abab2e220be24d7bcbb6b72dbcf0a2afa6b6b5ea77afb84bfa2ec47e6fbce8f3d4fa8a46b70a1db8adaec6cb2bdd1c36cda64ecfc9128aecf2d1b73c7ffe75dbac4efb9e49a5f05bda1df6f7caad2ebcea7fe9919de9afefc6581f2b7bfeac8bcdbfbaec107fdcdaf3cbe765898c01ada724ebca0aaf356ba584aec7a9f2e44d07ae60ed29347dbe0930ee05ada11b861d24a7f1e5afbcca9eaea56e714eca0a54194e6da9e2a34dfa3d2cebe6c1c9eeed7fde1ce8af8ed66d9a63273df5240d20e0e2b3cdffcf6ae8aa1698fb2204adcdd1e79afc4a4fecc7e096edee38c9bb9980dfac02518ff88dc44b20a664dcbb34661da4df5af8f97ac41dfb7cdaec2acc91cb3bb7acceabb1db6f0cbe71fe2580ed83d056d7ebaf87e4a1dac19143d6b889782ae0c7aa65e4af3feb4c7da479a1a3b6f102cf7c1dfd26b6ee2baafc281297be1fcf5e032dbde78a67123a920bf5b6bfefdb8dd94a86b6eefde5e7f9d683acf6a0c3b1ea013a5dfdf54be6a6cb3ae262fecffeee90bff4f556bfc4e9dddffdd4756611f8facb8666637aa3dcefcf1bfca29dda307c349b0cef9f0ec40bfeb1cfd4aaa8a85570487c4f834ab12ecbbfe1bdf932abd1d484b7d9e7efdba6215d34c6201da6ed9f907a50197b5067f7cd7d01ba94b1af82efbc8e9ef5d781ff1efecececfff36fafb16957bbffad95fbafb14ccfe2a2bf570bf90a6f98fc660d80c712f13d0d630d4710eefcd27603bfb3cb1b2c1e3d6c7bcdc537d80f7eb31ed785de8b47a4119415c83b352cef30d23dad7f3c701162aa37db213da385785aacc79faa5f5f6ec4bff4cbf51e82f56ad33870ae74fdc7dd2dbd8d76ff92a8446f723a8e42c79bdfde1c6b61bdafa97a9cc25ae83a3d9b1e493f5fc5e5999fbfebe1c0879dbf4d64d14e0ca6abe8b0b7dda5b95fc65370aaded9086ab27d0e2fbdbe7eaebf0abfe0befb3aa844eec5c563275daae53daeefebf8ce92abec499becabcfdfc8dbbf60cebf00e45195dd8ba2e3bc1cfd80f1aabbcc0cd805e402addee1aaeb99d4dcef8b37d6767d96c671f1d9115fa5a69dc14603ea8db1aeee78cdccafcef8dc8e7dedc821dfd8a6ede6f15aa797dfb3f5ebb2bbff023eeddce3b3a2f4ea041aa07e513a928dbf7eed9184fb54fc12385c4e494cea1e6bf00bf6f1560edfd027f5c98bd1a4ee38a3b14e2f2ae07ebdcd663ae1aacd5b1aeba14bae9f14cbeb4bfed399e9b0285cf1efee8f2ab31dfdf33b5e3defbd6ae6ab5b18e9e19cc5a35a8b1d76f9f90ae38cb564fe386da0a586d0dde1c7c80f19a442c365aa1f1c10fdb1765f6bf21dac76aa1e8ecbc31f8909605456aa1bf5d10851cc6c6c9ecee8cce790e4fcaccaecdde7a4f5a40cc20d18de0978132cdc4e5aa53b97ac84d942dbcd23bf0c8bb3c02bc87d0f3ac518b482d87dfa411aa795aee85a5b55c3b4e136cfc43fed3dbdcf2def75309ddaf34bed3cfa1bed1ccf0b4c5b8dd14a69e3edfb5ec17a2affda52193c372cecfb1cceb8274edcc9e49576d629de561602880ebce92a68200a441bbd0c1556ccc2aeb16fcaa78db1fdd755acc6c762fecedba1f2b78e9b5bcbf494e6178b63ca8d4f40ffc7e3bd4a16dbfd7db2e4e6dfe10a47f0cd6196ca7a2f4b33efa514dee868d0a21c6dadb909aad1eeb05eb3fcc7d144b1eaabfadbe027e3cafb4e4c8d7e0d2cfbcfba535200478f33f6a04eaffdaaac1508ab6971ab84e6845a528bc91d5d9bbdd1c873589e896c300d069ffce5ceaad93e460d992ec6b1becff291aec8eed5dd9df92ff389dfecef3dedf41ddebfb7186cfaae9df2ba8eb9fb331cdfbfa5ca5040ade7cfbc6e6d9719e4626dbc66d9bc6ceb8cdf2cffff78fe2f077cfdd7320e6e2dfe44eabcbfedae887ecc8d55f7844983cf4ec54956aa6fcdb9cf0e37d9ecc77fe1f8e8cc5e568dcf5e2d83e1daea5cabf7fdd8bacc4996163a168bf28458eaaa39fecb4fae8cd0fcbdb09bc8f41fc5fe332ce455caddc4a8fa8594b5f0d0109acfadfaacacdca2c59fac1a20a414cfd9a4efeab415be18e9a18eaeeda0faceb64a2aaa58ddbbaafb29dbff8f4b52ced51bbac4ed67ccf4cb711ac14e8bf58f17d50e729bafc3be97bb4e6354f855feecb504fa2f35efb184abde5f29ee1ae2c394be8efa2cad872b624ac2de8febcc55da95aa5b3998de83dd4deb3acd3a9fa4aaac50fc6e7c15fba147f0cf0bb7c62d675559cc95e4abaedefe4e1cfeadfb71efb5deed5351c8c5f56e4b99b13de9ffe6fdb27f4e20fe325af01c8e5a949a0d9ddbbf9500506baab9b19a5fd7222dbe63cedcbbddcc6e8d66ab2b05273acb9bc04d48dae12d4fbca9ed26fdd93fa75e010dc5e388cf3d082ffe6bb3f55ac4703ec56fdd1700eef433bd601aff0f321aaf4d3cc6dff15c7c719a0e2f7fc6882c9d4b88b78f750cb7ba1ae67ccf19b61f55c3d236cd0c5dc0e9cfbe0bf903bbedb2bd9e2e88ee8ca61b3fedffb4bbeeba18a3eac0f4c087abfdcfa279e9b9672dea173ece706a1a1bb04e937d52ad3d2ed27c3be082dcca4eeac9a2adfafab1ccfb15b7ecefcbaaf6dfab4eedff1baa59be84eb1dca03d81f0c6befdeee1ef2bc4c343c1bcab0b6fa7481ae4d9db769bedbd5d94fdb41992c9cffeca918b6fbccefcec37d55a6efcc7c03cebf1180be704daf2d9bce12ab6e09acb84b8accec9d34ab83fa7281eddc2b6a3ddbca9eebbf535db14153faa7aca596c2daadef89ca3dcc8da4f96751a38235c83f6d87ab57c47e72be6d9aa410d4d7bcf9d6d563ce8cbeba7ad6827a1c71b5ce31c1ee2c80fce8ac7c9e6ec8fe5d6e1a1a81db61adaddbaae52d07db73cac7e5cbcab253ef1cc3b7494cca8beda70f6adff3c7b730ff00faa39d655fb447abe997fadcd298d9385ebcdba5cd9f97b53c0a0bdb7bddb5eecee609c8dfb12e001ce4aeada75e85e0ef8f6a1cea84bee6aaddca7876b79f1ebd639dfa3b9890fbe7d80f5cecadcf37daaaa5b6c5142f951eafd7c16c533ab826ae1ce236f7603b2bd23e6629de1dfcb17ddc52f42780eb333f04fd2149aaac49f258a0e4cbc97aae3943d8edbc646f3f4ec652a195ead95a3e1310cfa8dceddd187de4bbb369a7abae6e8d95333bee5a53e6e5ecff7b8849eace10e8cdfbf5a3e4fff70c4e638ef22c7bae4355caefa0fb7b36baca793ad5d1be0ce93ef35fec8eeb8fac83a5da4cea7ccbab2e5b1ed5acb22197b3a75eb1fcde1e3dcd0a51aaf655790e58fabdc3aadefebbaed828fdbfefa98baaabda5d5b203aca7fc5369b62364d4a57c7c3e3cd77ac0d3de428b5ce61e93c05d8f11db6e3b0adc9c1ffabaa998ca827d8d87b69fb12caf5c6b0f70c7f989044c3dc8c8baebaafe0ccacaebaaae6026e596bc92e1bd6dcdc524ab90f3ae0ff0d1d252bf37c777f3addd72dbdeb9e2a79b563110fc623bed79ade04aab96e319621e69fde576eef79cc0e6a7b292f8faadedd9fc720fcbccfb7fcec60f930e4fbee3b4a2f1a091894c5447666f15f8a2a3f2e2cff0d1630ab2e8cbce90b4ecd8eb18fe741e8abbca937b8a430afa8f1a18b2ccb966fb42fd7237b1a8ac23c085b9229c4ccd0589e7f7a636dbabb7b706afa1be145216caff4e56cbb04ed36005a65202e1fb8bf6d7d2065d2ab64fa45fdbfbda455aaa10ecf9a51fed69d784dac36833aabc47f9aa2a3e0c60d6cef59cacabde633735f5dba4d5b3aac7c8064d2a2adff84c2f9763c58cfe0c794ca5bfec7ec65e8e3930ed78bcdf8e2203b04ee8bdb69faf6ea94aea5496fcf8aadeb233da3ccd4bdeead54aeffd3f8cebf50fcaaf55ffadbae92ece813e3d83aecfcf0cfb9d16d4c9a2e7ad3f972fd69197b84e2915d8bd84d0ca98acb296da9dece7dac0b7f068e2aaaa6f1cdf8559fb57e09fdda81cb30ea8bbf58a4e6d42bd9bced5c32a0d1a834ef33d37a31e9d07febdfdfc211defa2c5d4deafcdd9efac0da96ac77f921f3f7eec06418f2c434c66cfa1242f21b247caf08bd33dc8f78ca9abbcafefbaf67ff7ae4bcb6924f1edc88761e70eba8dc2a97dc31cbde7932cffee930163f916db61bc2c793edddcaf4429857cee1be109cfbfaeadb0c49ba6c8dba6ff7a2f47c05d3c3c3bc5c434fb058a807b09b1a2e94fa9a8fa4e2fac6268665acbdcaeaf7ab05e5ec2ec0f48601150e7c7aefdbe97ddfc09eb2f1f22a50513d7dfefa60cbcd7e42dcce8bceb2feca4d0ee4143b8848df89ce121df5acda10fe45ef707aceaad6504edb2aaaf668aab4ed3f1a1bfc5f88a009c307dcc396f0e5ea51ef484fbdbccefd110fd85cafe5c78ec95b35d63d0fd9fbc4ccdee95055fb23accaa875bda9ffde534bb9dabeecaf3e90d7f5bc5dd15dffac15fd811300adfdc66573abe0869df8c3a495db6ddef7beda9d52c28f31a5afaee99c3f64ace76acd8812dce37be20d9f4cad7b56a6dfd1f0a1edab62b3eafd30aeaaa6cd02afe6bc04d3fa38ea79d5d8ecba5c04ffecfa13cde8e54ccffdd812c192fa9fdfaaadfaa2bafcc7b3debcc6d84bdcdae4b3aeda5bd0b9acbeb39fd7ebc2eff082ecde91e1eac63cfaf1d4efe94f6ad44acaf5fd3d5feaaab6ebace2cf5ced0c02bce1b933fd0aacdcc8eeee9fa60e2ad5991eac44cf86eaccdbcb5ede1bc89e346bddeaf6032197dac0ab0ce8cd1f2bbf19bcdc0eb6b098e3b62bbb3edb62a8aca92bb8d4d01aaf1fca82ea3a4efb927ac507cecb93ce14eda836cdd83bae1a4eab4cad9f6f975a56ab8ab0ada8faea40ffb9f1f4f2c6d574dc5f1e1defc5a9ab5e0deb735b49fb3b6d10fe8eb3f51f77fffffccc6a1c57b17bf10285bdac91abc9c993f403ece1b85e1df7ffcf7bddf486ea3e9ffb838dcecddb89afb85fe30874b0b8add794cf3344baf161b9baff96b08ea04ddfa7232a66e2a1decafcdeb4a26e3bbac8089c63bcc4fdf3d42ca5d6d454aebadddb7614c81f53f5eee7f6d82edb98e042afeabdedaf573de15bb0a25c48cb1cdd22e1517ffe370db7f6bb1d4eab8236ca466fede9cd3fbb88eb5e1dec8e994aef3cc80c346aafbaa25ccce5d9b5a4caceb5ea7fbf7e4d5bd16c21fb16ec7d7da21b3d7fdc31ec54be605eeb921fa6f5c998a4fc2ce1ec059c6a6faca7e10ec7dad9cccfc4c08c0dc69cae4b7aeec96e8d49becaba3f43dbfdd29a4dddf3bf0ecd2e4ea1a76f816f00c7cb12b51182420697fde6859b6a01aecbbfdb02fdc6cfcde4a6d1e98de70d5a6dbaf42f7a2ddf4d5412a8ed5f36c719bf22261d783abeec2ae6da933d04e4aace69194ad52654dc48a9bf49ab84d0a41c9dc6c6fde6647ef0e1cfe7e5cf05dc15ebd632bead5a385f6da2114faea1d88baaabb99f7adae24d3b0ecf1fc8c9d0b1fccec2d6b2ae4bfacedde489be4bca282a1a8cfafad7ff2eee628da39fcdcb34a123f66aa6cfc9efaabc3cd819d23c8abdfbab31adff1c5f7131ed6b8bbd5aec4bfbb9a2b8fce8aa7c70ceb7fa774b26dbaefa786e449aa3794f7b3558cc84b2fc2df1a2d311f9d429f4d91c2fcd9cd07c0dfd924cd5e495851ec7433353beddc94326dbadcef6e0ffde56b6351312b2a306d4f4eca6eb2bbd19980f3567c5b02ae822717adaeb90aa843bd90c6368157b2622fb1ae69baf7a1ee3dbbf9c5c295f825ddb25f1791b13a7dbd2cedbe1ceecfa0bcca3cf92b8c7f7f7ffce9e982dbe7ca9e6f4fdf3b852a1479fbfb263814ba75beebaa1af0ff4acdfbc225d4e281069acf20f03ddceada3b9ab42a92adeb72f52a0a2e2bbcca6ac35fc39e74e910fbf0dfeeafc3accbf2f4c3ff88ba31a469bec96daff2adf1232eb6fdeefa7b764793b46f291bc27669d57e5ff60ea4eb88dab8f2834c4d26b2940e60376f524b119fb9881c4ac9644fdfae5d6656d7cd25136714a94af50dffcfe9583143abe0ad3ac9ffe6b42c2a5ae2d3456e5bb9231ef6e15f0cf6ff413ec07bbacc26cbe7c8f33ddb7c1eeb407f382a44ed12cad18abbbbfb0add2bc81a078b54da80d90bdc50396a7171ee577efb9577caa460c1c8debcf669481f4bc67ca15888c94b8381cfad6beafcfac41eb7fc0a7eb521667dc80ef3fd0b10f6decd72af98dfeedbac2a7bde4b481da60bbd6e8ee09a9bfb59beee7900aefb2c89d7f0d2ef6f2706031d6e2da3dc95cde1caf4bcfc4fcba7071aecde8bf870aa67feeaf4a8caebaf7c31ee1afe69fcfa4ad66e9afd9434c0ff898a9d82ba8de1b7cfeeeadfaa0d5bf57ccdcdc3a5bcfb0ddfd14b14cd6ccaf94119ccb13c8ea02f6edf652ee0f8c8beeb496d5c1aaa5ba4aebd0eae4ba190e38bd80416ba4ace6e5ed1fee4bfd1cbcac618a3b2eaa9bcf6851c2400e2cf7ae2aa5e7dc1aa61badc0944d4aee7f2adaf7e87bd6d6abcae1ccfcfeb7ff75acfdbbdcbb5157d49b7bbba76b8aba0f4768cc0acb8c549777ed5caaa6263774fa1ceb5aab25a64a92cd0dc2e2ddb448c36c8bbcc2a5cce68ce9c17890538ccfefecdb58aefb3aeeaad745a80b8b0bf7e751c8bcee6d293ed1abafe46fec88fbaef4b28c220cb36dbb7fe01b856afa6d8b748bdbf5f13c6dbd0ac9f2fdc0bdbf8a1454cbefbf22761aaa4fb0564ab569c7f78a91ddbfcfca466e3de9a1d4c8d3b9fdf1eb352aef54bdbd03accbd8ab35cdfbde2abe80eafbf3f3e9d8c1b4deba76ddaaab8b6d486fa2b92817fdbaeb1ade398a7d6eae2349c04e8bdaca4a1410cdcb9277cbe3d414aa57f6d2bba4aef3f1c8564bae93b2b3cface3ddcf63c3dacd67bc4dbd6f9a2e09eec18723a5da60b47eaeaadaecdf4f48d6ccf9ad873cfbb3bf8a4d31abcf79ddac7f2bd8e55107e2ecea8c7fab1df7d1d5dcadcf62afff4cb7ceb32cdb6f319a55476cfeaf0d5e2301b4ccb4cf9d08ac909f42f0daff13b6f0a7b2a7eb9e0d4ff7e63819bfeb5e37d595f26abf92fdee8aa7a2ec674ee4ff9ec25e837b2e63aba21fbfc5eeaeaeef9906685b52bc4bdda5d2fd65957a0dde7c680ea5e6fb324da2fdd551ff2fbb9f911b84c5babafb7dbb032ed0b88ffb2cbd06eedbbdc9faf9fb8ce5afc19febcaeca9f99c448887b91dc55fd62768acfa81c5ecb5d1a0eeea963cd8cfa0f80dfe17c150ca0dea0c18130eeb1a88fdbd6a31123dcbcb015cfece7ed2f31f0aab6fbd2c82bf7f2c9b4e19ce613daf0e07b5bf37dcc9c3f4d09ae2fb55e212bdda94d1ead77aaf9ce4b0ff658fc1e5d69b97ae757bcbe4fcf85b984d92357b64bb21e6dd253e141be9441cdfb706cd7e7edf0d1d7a3defddb1ef27b1785a560fccb5cdbb26ad4ceaafe4bfc9471aeb2db61773f522fb5ebe17c5679bba785f7123a47b2babe2b45fbf4e1ec92c1400cb5c2d6b4b75c9cfa018bb1ad425ca1e5f1decab7dcec177450b952d84ed6d8e18a6844dc34eeaf30cdee4cbe0d4ec56c5dddf5fc36f2ba6bdbdf19a99eca8460feed3dcd9cbeb4cce7d1ed0d668ad8d86aa2d7fac046b0a51dbbdfeedacb56f0a5db7eeabcfad863e6ef1a4ce9219febff0cd9f9a5edcb5898addeec181f41faf7bc0e1c7aeb961473cc4eb8acac46b7db6c79cfbcecee17a01010697b1ca5380ce438c93fc4f0fd26cb114dadca528c32dabcbaebeb478e6cfd35dd95e67dd13dc2df6f8fdbd2d0f54edda6c73ea63cd7d9232ef760f40eb0895b14eb1d2b093f61908e5f2673d4bd7d9363aaddbea90f878fa7f9fdd6628f5e7adaec780f88e4cd4c8cd8fdea5c4cbd09caea7ebbaecae999aaec0ceffa6db6598720edb1145eb479fdacabfdfc58a8727ffd05a9515ac0dae0acdc082c1dddcbb6cba729d25f208b00bd03c7f36e44effbe6c1ca7c2b0daa46cdafad4c4d01afed1b4f2c2af6b3fcfccd33963de2e85a3ffe1cfefbc7b9dedc27fa153dabc462dad095fe800cf1e6990d03bf94deee2c0cfca5441f397c1bfbb6ffe90a13dbadaea22baf7878ee8ee6b9febcc9b95eac4a1dba1cc28a816bd1d37caff08bbffbee004b0bf200fa1c7f968fadbe49ab76fb0ebe475a7cadf943eb0cebf7df87bf9fbf8aee807d4bc9fc53d7fef5aff32f3eabfa5ddafcfeb4f4b0d9dc2e6fd50695f1fe3a0bba14cd2eb94b5d97c8bddf74e9a47208d21105e3ed92cd78afbd3ee13cbb1cfdbcda6bd8fe31ded1dd255d09cd8e9d616bfe3fc9ad2165e6d98571db8eb779d70bcdf3ab75cade3e7a4dcded77ca5a1ed77cd0b203f03755ee5fdec84f97af902ecefd2a122d0a0ea1ec267ce2be7f6bb331e632bddfcc1dc32a6ae8f5e6662afaf9f7ff430eb412c071fdce1bc8e908ee1e17bfc3e6ef1e6a77577efd302ea9bcc3b10e1ebf11eb2aa7bf663d2e8ea286daeedb1dad3115bd3edbaacfbf9deedecc28bedce2fbb19ec10df16d739b003efbadf50e94c5cb8ba8f5ae4b639b3f6bc7e7bdf416bee17d09b771bd9baea355d63c69fcb909af4d73de7b120c6dee5cfeabeeec2059fc69f06252caa9baef1c5d33bdc6334adac49dbb8f1fef2cdbf41c42f5ebcdfc54bbddf5841c8aeffb58a6f3db38f8c9ccf25d4e7f3fc89e177624c6b698d33af5eb3900efe830c94af8feacc7a2a363a58128fb9cbedf2b9b6bede41f6cdb70ff55e5bfbbae417c92fa6a84d4f30ffa83aa34796cb6ab1dffeef7df937dc490ea7c9ad34e5f70f67f1b3bfda319ca1ee65bdfd9aaa9f44b809bcbc09a4f3dc974dcdd87bd22a6acbaf0457b38d3add82be44748d7b00c9665bbf1aeef96e58e6d89f2c5d6ec3adab6a9fee16f29be5204a191bb3bfd5061fed19e5c69302be04d96e67bfffbf1dee44123fa6ad799cfd6955bceada21caafe9350e03a01704dd4f6ecd4ef9bbd35e6f3cad57c9db744dbc4ceaf5f0e5eebacc1f2d5b8ebec5d48aa39daffc9c7d1a3acaaa7d72d06c96441306bbdb81d9b951be4f1eda8f6fa1c0eacbedc71fd3d1439803ebba3b56e11ce2071ed6495a6fb69acc6dfcf1718afeabe6fbf7973f8e0acc117f220bd68fa0e7723cd4adc84eb7ba490cbed9eff0d0aeefe1a94ccf1dafdc8c65dcdadff8c1cf9ddecb9c09bada29caecdaee2cbedf8b780661ab4e696d1f69ff8cbefa9920e8cad924e8ba766bc8541cba6f7ca850d3f63e27e0ecb40bbdcb9b7cd7bfda9aa4d0efe1de4d06dac08606efc9c16accddc22aed4f2d53da35d8d241770c9b157d09216ec5e0f59edeef93c4bbf223e8b2c2c863ccc37ee2c2d07bfd964dfbfc66db44cc2a1cfbb5ba23aedca07c753b0a0cdb3be2e68c07b3546af624ad0f9d4f3d1fe0cda95c3de9db51f3aab1e90df5d1e2e30389fbf350eed613f3a1eac940bd77990975436f152abd7cdc0ae49642d0ca2958e8d8eee5a6cec4ab9d852b16a261a8af537fde21e59a970acd5d3c784efa2534056bd827df9aec046dbcc2ecccb5b0df9653ef4a7ad2c64ce3d4afcbeaf7fcfc1a8a6fef2a5afbdcd7f6dba58edc7168ef149a9bda5b2f9422deeeaace01db0eb4dc9c1fa8d5a89c3b8e92fd4c7b81e6e7df39e47617fdcebec9329d5bfd6078587b08a7d0890ac7a0f2a54b8e3e3f28f4ddbaaed0de2aaafc8f3e5e7f39ffbca28f5e1abfd9c5ffa1f7adc36a68edece08a66c1d3ecea56572b5c1abfd39709cb8decc0cddc54ff7dcb2eb93cfd7acccc5126cee21c3e4ea91cffb4e5182dee6bc11bd721dda301cf41e42d5abd8418e3e5af3df6d5acffd012faffbac88cf23d68ceafd3f0cceffd4809bcdad320211b7a032ee09e51da61d22448db0a590dfe3a97e892ebb3ab736d0aa6d6d96d6d2ad18b0fd6eae2d0ec374bad124aeb2b4a1adb0d7f3fbc740a0be9a12ef5da86ba5c3d40c9e203dc07f81a062c7acfd410a4e6bdfa19c8df1f1d8aa995679e7d493ce760edb1e8dad0c2adfcc62b0abaacbcd88ef90f5efa4e20adfe5fc7a1024b4eaf8d42e4cbd2dbbaa48e0bbd9a1761cb2e7ad119f3652da3181cb55f8ac9aff93cb8d23e361deeca4dae907acaf09dbaebcafacf4ae3ea78edfc3e1793dbcc0a8585b0352faa31c4cf60cef8483982afb0df1e7c5cbe270674c8ebcae667fea4cbd3ca8d7e112fdb96d7ff3ea3dedd909b1c28900a57a69bd5cbaccaff6bab2d8a7fbaaeda11f2ce6ff856ae51e029db6717bcadb79d73a99a56e5ef35dfc5af3af7f15f2f6fb7a91a08be9e8af979382337acab6d750638f0e9eabe5fe4820da5dce1bcbaefc3feefef2f6cbb664a5beda1bc702e7fc7c5f1fbf03236a8dab3fefbc05eababbbc97cb14bcaf7c8ba3a8de71639b9d4a9efb0f8f26dcc3bac5fc0b4497917e35eeae493ba6eb47fa1748c5e6aacd79940739fd11aaa91d9d9d3c17e1fddfe2cf1c14deae07545b71043be9ccc9deef6d4d947bc01ebb3dd9c09cafca4dea4f69f1e74bba0eda5e6c96ffc0f0b0a58bbfadff3ade7cecae0f1d419a3ad7e89e7bed01bccd3f449b0ef1fe4eb9ecb0fbdee65defaece4f1b1444842dcbaacdcffbaacb2c054aaa31f9dadd5ca22cfa367b5fae0c7fccb434c0a1ca4fa3eadd8f9ec0bccfeaeb94afb9eac9269df81cce3cef8424f8ee09afdf8bd346b9314b91ddf976cabaaff5d27ed4ffd9e4b53e63d68630d7e55afb8d6bcfc4c13bc89d2acefef68e82d5649a8cdcfd01baa129600511b3cf8ab0d94b68e98f42ffa60decb26720edaf50259afaaf4dedbe13e72e9fbea2e4943fbf777b72ac9a1caaca9eaf9267ab851dc44fa5a9add92e22ada4f0c6fcdff3eafbb842bf8d52d8cd57ee6def44b670eb46f08ad2f08fc9caeecbab6f928beb4aa4fcab5e6bcccda1e3c61aac6cd85a9b274dca9ebdafedd66dfd7bebabac13540a8cadd5c6b7c2bd0c043a625ba2d2ca6e7aa559e2aeebeedbe85b0d539679eb9df6fcc932d27984b25aaecba93f0c2c9cbed6419b56532d2e0c80ac4956da2bbe3bda939670c851a5cf55cd71b8cb810ae2d034ede81b9effaa4eab44bd0dc7c69ac96be4fa2d511fea982e6fce8aa9bb0fca304efff4c1261f2e0bc042bdbfe6299e1eeac2ba7400ebe8aecae85c5bdc24b6e102febcff721edcb2bef81f7cc1c8e2b4b4e544e2a37b081af96ef18eb6bbaa1dac3f73a53bf4aa8f68bf2f0bdbead885cfd25ac5bd53caa4ee4a433e528e8dd5eebcef375a7bcac7ddd4c4f9cfcb8f7a2aef0c5b66aeba577385e3a3ffcbf7d705cc4beaffedb0ccced0e0ccac5aef6c254f0ccc7d65ddedaa5a0d3cd7567c93f28a0e1c0af7ca738d7ab0d096dcdebbacefcc6bcc16ee1a1f224fd6a94e3b2c2d8b78f9ccccfde1edbf4fcbc065a3d08e1c19146ae556ee3e1d1b32daa5f1b4be2f80adfd06ee7ec24bd4dc8aa7cbae33bbfed50bbebe8603e474fde208cdb8bdcb93bc62c7bced97ebca1c01ac9bae23bfedc7d888b7fef3aa0c3949fcaf4b3ffea1b6e3da9defeb9ae99aafc94e97db56c704caebe845e5bdbc6faebda40fc206d48f09a339141fbbe6a38030dd52d2f0f5b9f09ddb12b8f0ecadfc545df243c028ada2a6c877f558deedabef2e4b97b3d2a36c6919bce4d8fbad0f5cb163bcabcaf6eb644665b0828d04acaba9be4c4dfdc4b59fbaa55f5d966a41884aa87f3f4af2ea27d8eca1781deeb44c32d3f5a833cfde73a9a0a75dfad0a5a2feded1bf075c0af3cb47f107f1ec347dbbbcd2e78dca630daa089c6c8eb69ce9adde2744b0dea5b3337db5abd1ddcbdffaed2fb0be24daf4714a8008189bd1c0a8e411e5b5eea346607ea60cead0289ac1bf334ac0afac94bfe762cde4aa21f2c5ff686a4a6dd9ecd8e27f00be2efe0801488cefdfc722599b1fa4ddfa94bbde8db9d5a430aee2a2bfda15fc86bcadead9679d41bff7f8fadbbcea3d9b829e8decde446f5efbfccbda815f4fbec66b3caab0bccbdd06a2aefecff4bddb2c9bf5898ae655cd4cbdd9ba9aedac7ec78b1fbffef51ec6db4ab28ae7e85b80bb7cfe586b8ec9abf6def036d78bacfabedd5aa2e1b1d9667f5aae46dadfd793a00bdeb7eeee164852064ad848761fc1bafcfaadc3c21dc7e57ee7fa844a8aa1d9ee32567cca3fd1a0e108f8f4cde3c50b6d80ddbebb493fa8d5ae324a6d229aaa8b81e7c5efb6ab3810dbbb30bfbbd6e4c3deb0c6cf8c5619c30c1dbfbac7c8925ac364e5d4f3066513912be3ad9aded8b1e73c95bffbea4bb2dcda7ebb5ce7bdbaae1d72e997ecf81f71bac1e3f6bfbaf51fddbfbcda79c02cbdfce0446efce69f72fd39ceba4af9cadadffee6cb52cb672ddfdfc0da4f46fdd6cdd0e68cc66e0a2de3f3d3afa1b70f42d49dbd3cf95f32eaeb936947f8de4a810eff41fcce901737cac73bee92db006b1735c0a0b919abea8f887322dcfed9e8ae6edde8e42e8da9a059c5eecdcad9caebffd9cbb916a21460eaf6eeb481ccc41377ffbeaeebf70833bfa2f9cc8f0dc3df4eab5eecd9d9d8ae66eacfa7c7bb2d51360ad7a7adccf7ac4401bc96a419bce85e98b0353ebe457cb6b228efb8dcfdfcceefea9d9ee485afc764af4baae67b88e8e9803bc7e6bed8c2ffcec4b210b9ac1b9a15fe6dccd63bcba0dc53e789d1b02acccb3d834b3bfd3d0cb8c80f4bf9da4ece4ff286e16c7a1d2eea31e82eedbd6fd3aae8c5031ea2914deebaefbf01fdf48d696a6ada8b13faf0bdd5126ea1bbc758bfcffd6d0fdc1fbadbcdfbbb5f7d947cbeaedfb3668ee788b631bca58c1db3c55e4de1ac571a6c1b9ce1af4d88f39c9abefba128e2ff40c48e7af841ebae6feb2eabe4fc5aef54a55fda0b94b1ad0ad9b6fc26e04a5c919cca9ba1aa5bfddc81deea0acf239164b55eccbdce674d467f2f3bebf05092daf6aac8a66dfe5efebce64e14dbbecdffdf645ae4aec2befec35f916ed9bb82b36a2ab5c1e8f266ddb1a70fef2a4bd3cf8f9e71cddc8c7be19a93ff8c6fc98a19f6a7c986d90f0d1ebc950497d8a0d6fd49dc9e6f237da1ed7cb4681b7305aeea80ffec7da2d4eed97ee8124caab90af7e0a3b0a0eaedbdc5efe5a89eeec22aedfc29ca1879e2ea813201cc7be594bfe9fdd7dabca37daf2cea9e3aa40ed2d22dd6653b63eabc5eedb2cbc6cceaeea49fadcc6aafa0837febce0d41ea4ff7befad7507a0f6afc92b8de1bcaecb3e11fc3266a60090ec342c3c0cc363d72e11a5eca95d4ef9b2badb813681af2e5bbf5aa1aa9bbbfed5dbfcee2adcec9abe161d4d6aec0ff743c7ef7d2fd95b7d27831ad863c48a0ce61ea801a7eb18e4ae454afef0d51ba55a719f0436aaaa8b26e1860ea5e4c8b11d1a258e5d4e9fc4f3c33e18b35fda7bdfddfebfe41c1ebdebd2bbedb34bffdccdecdcde6eaebc0cce76ec4a13c4a1c8ddcacd0adde2f4588aeef63f3fc33f613aa42831215cfde9c508a5cd2fee1e446cba942a19a2e8efc5adf6301aaf937301cbdaad38ab4ceac5bac7ae576f3aef98fcab97ffdf4fe81d2ffccd6bda2e28ce8e918dda98beb64fff100b1dc9a556133cac119c9ffeee4d4addeacafbbdabefe0db3cb48eb06f8d46526be73cfdd06607dfaba73a5ffaadddbf2ba23a14e6f2e2bbaf1a3bd4f5ceabcde119b7af89ed90e5c9ff88fb0a2f6f7d8eb1c3dafd3c8cfd52d7afbcbb1ce1debb84f9708eca3c37bcc14ab8b56ed62ed1a64decffffb69da0c09afacf2bbba2aaddcc0bcb51d274e8d2a5adfd367f0ba50ebdee7ecd07b4fadebd99dfbc7f1eca840a1d83b1f9b8cc6ac9f9b5f21eca2dd5cfb5af8a8b3dd9769e0ec7620f4cd23b2cd4fa0a8ec7cdfff8f451af1afa27f7fdf010a66a962f6fb015c32a6cd53ce7b35ebce4a6f6c7e868dbbbe21fa2ce8efb569d6b379bde7afb4bd6b4c5761d92ede1cbfe5af9bc42a114c21fde478d4c6d5a94edaf95efeec2d67d7f486b84f7b24eef5295eebcf3c3c1ece2cfd369cd4ccfeccb1edb04b162d899bdef35faee327ceece11b17cf3c3ec68e9dab88ffc9942efdce03bbfddd3e7421ed847d8577633c0fb8f0afd47c9b6eff791bde78c2f9bdb01d67aafbb861fae89ca2adfb51d8420db39101f16fed569a6edef3c92a4dbebf74fdc423a1dfdff13c5bcaa9a32c0dca986ca14ceb54dddaa40ea1b21d3bbf7a761aeadede77b6aba2cfb35eaadaa642edc03337c0eca213e8ae51c32ff61798378ca2ab370796daa38efa417860a740e27abce38c1ab8ce0bf0a1ab58cacd13330ff9c2fc74bf7de87b2103361c6d8dd09f5e45ce5edbbea819afbdda5f5782a1b8595feffcbf8e6cd10bdbd6a5dbcd486cbb99eab1c71bff7fadcfc78d31fba7efb15bb7f5e9e4391e4dc46fac8cecac692e97feeefbea85780dc834a8f9ddcb6a5ccc45f0ae5ee42914902d1c6916c78cf187cadd39fcba6a596e75fcd178607e3781beffacf76bf05d00cb70501fff494ebb0aa24c165e2ec8bd8fa91f8a8eac12b8e6aecfbb1418ca8713d0cfd0dc4f6ab1ab63ba39da63226cdcbac81cfca8f040dfbfdb6b1cdcf5e6a1335e56cbab72bbee3053f1f3a2bace8dfaeedc9daa6c9a2f8d77e35dcbd1fc29b61acfefba3dbce54cfc82ab881d6be35ac2bf5326fa6fefb2dbed80648e1b16bc0de51964f9bf5531c21aff09edca821fda33ba2c4ef179c87ace0b0b09bbabdf3f7e2d387e45a1cddf1a0f3853281f39b5cdde67a4eabbe6e38b800bca1faa8a3d545fdec553d62e57c0c3002f7b9c217edbbc4e6bb1f8bfea56c7ded8a7c981cfc4d6f9af03beaf5ddde4bff386ed5bb7eaa4218449bf3e5df2808b3a1dcaa8afaa3abe48b48b4044e1ed4c3c6cc5b1cfec50c5a22ba9dacd81140b6d374bdae09fff4aeaa0fcc7bd2b4b70bcbbf0dde3deaa4fc14bd17bfe0f5fdebe98a1e80d3c1a9ead8ac151fa8213269c3e67ebcfc6b115cfcdda44ad84ba9ecdab619f2831e4efdfacdc896aebf05fc5c4876c9bbbdd2eb61c2a502ca61eacb4d9a1a8ecf5fe6d4bd977cbccd91c97a7f4106d00dd1b4ed002477082722b26ab8a5caf316179422dda0c4af52efd6bd0ae9adf8f270432fde70ae5340a8d8022ed8f2bc5da7a7db667e85ddb2bf0dda0cdee42c8a91f6174e8f0dc9eb5d451fe5fd3b8aecf332cb204abb7afd90a150fe535d8ef4eb42b6fcee66a6e7a9e39d8e0b69ae8d4103ca6a3c2ae6cc28ffc5c4f1f40dafeedba0ca8f2daa8b7ca5e3da2c4dfb6fc44ca4a02dabff72acef98b1d031fb2c9ee421e722c064cec61bd92a4edc3b5d0e55d926a33dab2abce3fd31ed1c2009bb4b443c3753ca11edfaa4aa906fafe3c07ba12fa11fb44e3aabe131f7c95fdc3e20e27fbacbe3fbabfc1ac3a62d3e3d75b5bc8ff30001ecd3d23c80c3b4bb048d7e228ae10a7fcdaf9c3a4736cdd7bc57b2a612b7ec5e8d12b50abc4b2fd4ba8ba20b55cba48beecc0a6c8cd944202483faa9ac2605035bfb1fab98208d2a1908dcc3ce72d0d9c04ca6a8ce27cb0273e29bcf0cc4cf2ae79ff78ce64f6a4a047d788fac0fcf79406cbec24e7ad82b9bfed0d10119be2c23a1a9c02cc05591c99af789fcfc92be2eaf98faabaa058fda500afcab232600b3dacf1f17fcc45aff670b1deecfe9babb0552d46252d7edc794bbb0331d51fbc25e6a1a921b893baaae6575ae24d82cd527739feea0dfcf26ae9a4ed6644ac60f6108c7eb961c3acc5d007c0e2a0141b2da5b8f4e85fec3e2b7f275f47bf417e4bc5bbadd7632faeba32a0e481d7b8fed3ab9711cdd4c7dbdc716ffdb3af7a3e05ccc83564ca1fe5affdbf51a20fa7be4b85c8d9929d24bbfbe897cd67b1bf1fefbd9c7cbdbdf0a32fada822b7647a1c1510635cac979edf333164bfa2e7bc18e9eafcdaaabea4b95acc648eff2ffe45d352cf02a5a2e40cd2d2db5abb73e18fe16e4cf47c1b222dbb0848d5a5d12eff5bdf1aa52bff9f8aefaaff6ddaaceddac79bfd5eee7f2b18de2ad3deae8bb2245430ea2181fd49ee8419bda96eed1bcba93d30dde6b54ccaaa1c45de7cbcdbb977bad9fa42fda02ffe6c7aee7df14721b12a1eacb13dab90e18ceede8cc9ff6be49fd0e011ce467a5b5c9a49cc8f705fec8fd0284cad1ee1f1df34e8fb3e28de0631c6e7558a538af8eab7ad63b5e2bf009b73ac226c10a979b0d4ff47ccb71995523fd5cfe5bd96e94ec27a3da8dd8ccbea91fe5e8d4e8c9cbac75d01af11b8da4cfbcdd0fcbc515a4adfacbd2d6eefe7bde46f45892add4eccf8db4ac18bb6eeee7afb3ed5cd1b3c297ef34ba6b6ac8b1d1f117d56e2bb76c5b31f25ac0d4a0ddd46ac6dda8a5b8064ba1ca4cbeac1168f3a2a357bffe7eab9fdae7c3ca749cadbfdc8c965cd009f6ba3b6debaa4f16dfc006a4a76928affea2781cb2db7efcfadfabaee5b0f1596eaadc725fbe855d7069a5da0cf2c5b483f1ba4de1eb1fac7fda2dc70d84f17d47afa07968ab3b81dee22ecc0475ad7a061ac7193adea1a7df97eb28bba3d2342d6c3b4d0b3b0ad4c9afbb3dfc1850dd33ba6633ac5b8c34cfdf3dc317b77d02bdfdfa6e97d7fa184eaedb1948d62ab8cc35a1854499afd9161febd4a9b2f8cfec3ff9ad7f6faefa2ce65110d12cefaab7c462ba19d15a0acba85d4a9c79b1946fead2a580badd7dd0b00294a16cb2a4cde1e9f929796ba8333c45bfc2345b09bb0f4babc4dda29d971581da4ece8fa13962d9ffe9cefdfc5c8f3f62aabffe2cce9b1cc5cdf36defd055f5304bdce62bcf851a38209dbaf7ddaa07e4f4d0f445039fe8fff6ef6d1ae7ca48c62aaaad39afc9ddf6828b7428c684fe1b73465ebea95fed8d5ebd2dc7feafcde2b9ccd3e19bf5de98151efd60b93edfd1556dd7af3857bfc59bc37d029b2bea8a4a5a5efc0ddec401be106a5c9fd3abbafdb3ceb99c2b7b927212ec485d02e4af566a283cc5e7ac1b0a09cdea6e16edcd9be6f906d8e2e5ea5ed96d62eef84b5c95a710fea34b9bb693247bd5c27cded11e7bebcbdafd896a0ffc8cabb3ae8ccbbcbcd2f6c329e1df8fb7b7dcfbabd1daccf8a82dfecf707fb8d191ada048bb0fe7c8d90842e9d9eca1ed23aebfa812a7a89d51cd766cd6df8ecca7dc4dee178cb7de6e8efaafceaa77efcbec0b879de2ff56ecbfccbadad72d6d0dfa8eac1faf7bebb40d69bc47c4aed2e7aad7252a1ebff0eacf0b62718b605c9be9fabd0056086be5eebfdce5f6576f179deadda96dd8ae9fcb0dd5a80eed8bbbe2a07c5fd5a8e3ff6a0e4fa3bc285dba5cca3bd9bb84eebf3dff4e595fdaca57d97fae65b5e55f6dcf099ab33d5e6a57c43e9fb9dd5effef6fdf01e3e5d94d1a65dd64913fbf079ca4bfcff0fd7db64962911c9a0c9cf62a28fbe2b140f31c76bd85ab3d41b1d8f01c450dd4aaa39dd9cdb7dc0abe01e04eba3adbc43433cdbdcb9f1c0ce46aace9a2fdbc523f2c6ea7cdaa3dc475212adff2d3be0fcbec0e85ec41c1fae7a3accc6bce52e0d204f1622d94b37bafad7ddfe295bbd97ebf07ecc72f03b8aad80d709c72ac654fc4ba9f261dce83e4ec9fdd6a7eaecb4e2b64ccabd65a675c2ebaafea829fdbabcef881b1b2b0aeee16cbc722feb951dfecfc1da8f989fc5f14a829e2ed1fb1f21f8cb7d69031cfdc4d7a35c6fcf3f2fb4bbe5acedbaf5a701ad61b0c1662b3226b0ed7cd30228da85aec8dc096dab9dbfc9e39ef6016c75b328b50d032df87ebd8cda9cccb1e9f32d6bcdbecf2d8a679bc4b5c35bab3ebdbb9e86c133b8b185eb1fb3cafd20f558c8f27c15c6eb1f1fa7b2575b1fd3dd806c868d36bbba850065c18ee891bea9563dddfcba58dcbfbe3c4a86d9a4dfee92c7f1ba98fe1ea03c9deef2f5e2a95d740a00b525797b713bc05108293a1f55cb2adccd1cb375b7b50e5d8a5953fc3c7e0376cb36dffef0b1ab2cef57f6ca7f4db4d52eceedcdc1acc21c7da9efe2d79b7ebeb5abaeeaadbfba22dfdfdfc0d591cbcaeee480dfcaecfbc778c7ba8eb7faaf2fb067cf4c5a18ec51ec03aead9bd5ea20eedc6b062c2e7a8907d9cbc5a8a9cacd1aace7ecf255bad409d68b36564cf9bcf0ad0ce0be94d6bb6ead25cfcbcbe3d8711d6abac37d31fe20ec729ce20e6a54967b4d5d5c9739ca2ff7fd790eabd9ff4ce7df4ee4cded3ebcdcbbb9f2bbbc8bbdcf1b5df67e701059daecf8c4fedd0e63faed4bcbf0957e4b2f7f647efe79a5f7c6bab4b3a4f8af226dcbe4c37b37fbceb7fb4ace8d2adc4b6643a626cef76efbc653c4bd65dccdcbaac41dd48ae7aaeacddbcacf7d48e3b634bdbdbbcbccae8603becfd012c6e69dd63a9dea68c0389f91c0c4d8b2a05b9be57bb64d4ed7d5d6aae37b3aed5ab651e28b8dba7d3de68dcd7ae271fefd67b7632efbadcd73bdaaac3f93d913af2bf32791de8dee44c5cc2c863f1e5c7cafda2f1a9c9abeffd84fe0cb7fdd3af4512aaff9659e9d363caaf369ccaa98345f697c9fe650400a1e4538ccd1410d48d41a8178ad4a832f0c1f8cd1a41ef8110a5cee4a7045402a550bedc1df41d782fcbe562bf6ecfa163e97f34f712cfa9de08e831f3a7b6e888defb660081f47b1d7be4e9b2ff3e9ab9909e1acea7960c1fda0e295cf62acdf9adb02aef138bb0a0a998bfb61cf1611563d3a97e8bf9085dfaf8d84d86a81e89080d8ee6b6d6768bfde0aa9c7ceefc2accadc3eea5427bc276ab7edcaf6abd194f4cca9e57d20a748db2d8376ba30ce6daf0f1abcfa2cc3057532aefec0c78ec3dee2abaee5ff810fcbe701efc7cbe4dae6cdebba97bceb6a5f8e520f9e10bbefa5a9c1bff02802ed84faacde02aa0cdf926c314faed12ec9af1feacc3a59ccdab6d1cbc5edb78abcffebd7fa13fcc2caa959cc9c1adffd5c5dabfebafcfb6ef546d30077a5bcb0bad2b693e5b3152dd73ed9afc6bbc72faf63fe2fd39eff1ded9e5caefe2635707b03efe2eabc9bd8e5605faeaa2e9ef5dba2a2b659d2fbb0b8b4174fb22add0395b7f3b4a73b7e4d21ed6235a49f520790cc297f3cfb56abf19ffaea3f615ea11a086887f6bbf2d4fc2a4094cf9bcf5ecb1a35bb2f3055860ffefe9fcccc5bc6c4cfad10caaeda5fe85cfabd4ce66d3ab5c372243a6ab21ebcba9bb9ebab2cb86a7a4bf2ca0c82c05c0ed1bde4ee4f05812bf196870fe8d3ea0c417fd3973497dcbaccf1d661e0e8f05088837ba53fe54e1faa3e5bcc0ae5c6da613d3db3234eae6c90adbdfb9ffe56af0ad28cff7fbadadc7d7f589fa352ae18aab65f6cda97c5dba343c7cce4ce5be7c522c9b3fcce6ad10e04f95e2dcbf12bcdc292bdfcc6deda65c7cfea0112dfb2caaf8d54ee5ca4b5484db99ad7e71dee8d08b4fabbd14abc1a3f03541dde9f94efeaa6e1dfd90170cccacb69be7af2a7dbf86320ff5ab9ef5dd660ccaa9f261f96ca5f5e0e44f00b1fdb3083fc3aae6af65bcb71f3939b73a155aff8e2cfc7ebc02afa3fcf5965f3ba9f5ff3fcf7fcf2cf0e46b33cb0edbbf41cd6a94fddf3ba4be8bebca9b0efacbb8f2c5f59ca35befacc3f1b300da18b15abc9ef311b7c9b87cffc375072020525bb36bfbbefccf386fcc1b5feebd93cc713e544a9f3cc2005e5d4af971fba9b9ae1b74de70bf0cdedae5d6d22a825cd91bc63d2fafe5fb69ef9d3db9f412bd7f08adb5dc70ca56ce0ab6fd3fb2eea9c4b5b7d27cac3b8b4121a73e5eaf8f9eb5bef51eb7ddc87e19bfffadd87abadac2dea99ff0e6ca8af1db7ef0c048ce9f924fdb1def9f1bcea7e2deac0771cc0ccd7bfea3b3ea2fb98f03a4cdee954c6ee08acc033f5e08ba46f87eeb56f3c7349bff3e0cc7e54feb647beb4855713499bdffa2bfe4c6efaa1d6daf64dcb9e0495bb4b9fb0cf302ffe0ef92073cab9966bbfb7cbbabd95b5481e9d6d88b11d2efd3a25daaed08bc1cbfaceedca023ba7ffb102ffabdf878ee0fdcdecfa6ecaade06c29ae06036edde24a56ae1a28f22eda51b89ad6fdebf82f7075bbb5feae7bfc6a86e43fd974c5df6b07d5baae561f45fce35dd7bd8a308fefffb835ecb6d2044abd0f8ff3ba5dc80ffa45f26caecc2dff41ed0baf03f8325feace5b8cbaaed74c08386d14d77fc7eebe2a766b4c127c9ba412b6d6bae130a921cd3a2d9ec91fba1b4dcf24a82aeeb6a5cf479ccf46e75fa0ab514c4bef38fab6fd5f27a2ecbcefb9c87eaef2cd7cd01cfed9a72ed25a2eacfbed86e169d035b27cdadcce66e8cccbda1b83b5ab563f9b4a7adabede6bf5e92ed55d3eedc2a5ec3d4030a01cf0fff49c1bfcb9b5ba6013fec63ad2fcc18a8696ea7bbe9fcca8e18577b3bf4db546b2b039b416a13fc001ddcb19fbae5ccc4d6fec27f1f4cc1d77b271cbe5cbf5f0df595c1b12ca36ebbea3ad14dabb21368fa7a498fb9f2fdeaa5a4ae02ee34f0e292d8083dd00c22fedda603d05db8d291937fab444f9a5d2be0a8fc56cdf6daeea66d3fbb3a579a319f27ded0e7737c7c2f4e6fa8cce67119e9c03da176628f857ed0d7d5b09391b9be2fbcda45eb8bdefbbfcaab719a6babcbee8f7c13ad0e9d799ea514bacaecb37dfcfe0282b90ad90d4f85c8f5c2fc3ddee3f25aeeb74ad6abff8ef94073fa973f52e56c1fece3c9d7f32d2c30c31be3edd3a7a79ddbe0ee8eaf7fdcdef50d784c60ee115fa6bce8f6d3b0bf6a305e7df9406b6302538b55369bb900426dee2447ce9b00e9ba37ca91cc76f5d6a347edc82e11f348dfa971c5ad5bfc159f66e1b3abf03fc8c80b1ca7c173e87fa7ec1b5e32aebee07e0e817ddd6374dfcca4840ecf88c0acad4c25d3d35e3758eae98e386e3abc9fba3a46d4d094ed59ba9f75b9653d6bdacfffb2d394cecdb17e4e406592d33dfcaecce9af75bd9d4c674b9a7f2c4f9cdd6e67bcc1809fbde7fbcf40aeabfb853681b6332bbbfdce4c25f629ae2efa2376c3acedc0ebdd4cb03bdca881f64bee8c42eb9afa9b1e3bff67fa0d24fbf11fe0da152ab6befa4e3380f85b2ac4d0b6d1fbaa0f52b8feb4e41508a8892cf2e774d8cbcfa84931e7612e8bf1af167b627e9ada0d9d540bebb424b36bffffb9164ede7d19b28b46ace227d8d23a7e385d97dbd8e954dfdbbe046dc1735a3d946fcebaec41e977d3f8d4d996ca53fe588ecf7bd2fa7cbb5fdec788a4c0110feb67fea5befdd50c51eef50bd1ee84171671e49eefce10cd4fb38433a1167b8c60e3a503c50e2dd7ad2d0c8aaebef67b24f0f0e7d4cd8e3c9c25a25a82885f4aaebc4dd66cddcc36c6cd5b23147fa329af28fe9c8c974998ec4cd2abea72bbeafc8cabaa70db7e99dc3a28c7bfad2fdc4dcccee7fa8fff5dadfb31effc6a96ddcb60b4bfc0cc1fe96c3bef3dffd9a697e25ecadcbf9ea014ebdacaaed69b9a6bfaac043afac6d13cd11a0d2dfe36cdcc3569cd3d467bfc13edb4ccecf2fac8a2d81defba0629d767ce1e33f54de8ea17a2813b6e868fc9bddccca808cf101ed41c7a3b3fb05bbc0292fd6bacf031dda14cbb67ebd9fab292fddceffcafee49acbafb0d1d854b2ef5c9ad0ca5c57c3fac1cd7281affdb73e6418ba25efc3c8c721cacb0ad550fad8add55a2177bf536a0aab1cede6d36bd883da9db1c7adcbae540ebe9e7400b5e51f2eefec6fde68696d3d92b3eddeaf3b9d7aa5e2ee2bc1adf4c3746aac7f8ca6ed9dada76dcb5adca6e5dbc10eab4ad2eb4d903ce5d9adbaafb0bf554b27e54a8b2bdfa60090bc0238ea7c7d753341deedd4baecbb5accadc22dca9dad4fef3bec07c68192ad13f3f194d56c222e39b411b31ac4fcf7c0d8153d0c53ee857d93ec0e078e13754be6b7e9ff0ed966d0f1fc9bc63419d1cdfb0ab1a2f9f2ba13fe2ff71d8307b77fdb202fcb2bb6e4e3dafb8bd9e9de20be2decadf80294c5ec2e3e77ecce0a4ac9bd3dcd5a87a622e53b6a7cccddecad43acebdcbd4ad656d62ca7710a3a29e9430b09c9d5c7f437c41a3b486deeffbc7cfbf2bac16e7db5caaccc497f0c09d7b2f9c51ecacdfedddedda7f6eee0de4dc11afca8bffbd53371efccaff77e4aad9fab7fec58ddff6c4aba6ea214fadc6ced4e1047daaff4ab89a8f0aba4e6ea0f6b011023a5e53ef9e76c5f2f566ddfe4e2d62e1cf08e63baab61d9b5dea8c8d2ce3e18c2c3317d824a2a9cfb3c431d56e258dfafda81ee67a07ad80fb9af6916abece6d5c74fdcf2b8d10a61ab0c4eae03906fa610abc78a73adb7ea3cbfca035c00b64cd566d0367e5d85c05b1396fbb9adcb4fd81ae4197c9edd9c5b5cb6deac9afd6dab08decbed7ebdb03198ed234135338acd667db3e9d1e4403c0378136e21c81c0fbcf673f2851fcada0f128ad64c58ce8eb8dc713cb24ff1adbec4adbd40da2f5ebdcff4e1aeda7eede191d7fdeccdcce891ba3dc858be6a4cb22f3b9c09cbc4e28dde7c3d925fc5d31569b5a9c6ae85c41a8118daededce4b9a434ced2a311edb5955247c03b5f9be40d356ac0eda45588c8e027a1c4c1fe2f0f6beddafcaf3eab5e4faaa1a59fdacc0aefccafccbb03ca30eee36f220bbfadaaeed3cd5a8dc7b3f087e95de1d97f2efdb2dceaa0e6e02f689eed90a5abb8c934dad44f85123c21a1abd4e011f4dfd55839cceaa788419621fc082862501fddef8c54ffbdfea7b3d61b37e7dd9e7a18ad058e9edada1d8c0e8eeeae84ea6e938cfae4d7bcff42ce19b49badda1b45adcc80a73e0c38bc6cbe6bccf7aeeb65fe3ca8be8e7d8d84caceb27cbab4f1baccf5bf16fe0ca0a1b46ddbcebcdfb658ca9f92da4fc3cff201dca83ba3c971dc37bab15f44cf17ad7c4f0b72ba46bb169c1d8fdfd4f2f9e8c109d0dc14d29f39be60bfeacfa2fa473cd7c172afcddabb66cf089bccfefadef7c4e82a3f38db87ac7cad29bbb3bd02a0f57ddcac0c9b3bd80ba365bf976e08acbe3c5d8bfbdd320809b64dded39ac298a961e725fe5b13d8f496edcf6ab30e9fd4f94bfd97baf0fae02f81dba840efddd7d63fba91c7d7b6ac222ebeafd3ad1fbe6de5cfae0d1d08ac7b5fe435e5af9faa91c5d6b519cf3ad6bccad1cbb83ea52efc1d4fadcd1d906fdebcb35dd0df07ceabfd2e210a5bf60ad9c91cb9b18fc76a977bf4c9e2feacbe1c8fa98bfacaff4df61edeb9e1ebae3b3bf8d6dea5e9dc207bdf3f0e34ceeab41bbe00a7a3d56a5fff4feeb95b0effdbe4a8eb49c58b4ddcb0fbda2c4aaed35b066a44da5bfb7bd89bb70be33c6acac2bb1f65dcb3afc9da6bfbdacf7c8aef0d72fb900d4a6a0acd1c47393dafca1c5144f3bbebf6b228ee9e8ebd00e6e6c8af50fab33d0eaa7a60ed18507ed45ea88977461bdd8aa40faa889eab556dab7dedead49eac93cb50c89d7a6a97fcd4a17c5feb8ae6a42dcacde3305df43ab2e58c477baedd75d03bb2ccbc4d7edbfebbe3a3ead2ca4f3cfc850fcdfa2e84efc1e60c216abfeccb31a7dabc47ca6fbabb6f9ce559e7faf8bd9cebb88f0f296efcd6bd7bf0ddbbc9db9d8642abefa798b8e9988b9caa901f2d663acdcdb00efbe513cb9ab450bb50606efa1ea7ad21f3ad83cfdd0f2a6a271196a4642f712beb8be8bcebfb33d9ba8d133edbb9a5cbf92cce8a51fc8aefabbf47d2be91f5fdcdce76c6891fcf04d7fadfc9e709ac4cb6b7ff56529353bdd0fef1a150ff5d19b0db4d1a98a0be429c94fbf7ecc1a7ff0fffbb52bf9fffd7bfe7c1f7cd2c8f2e57063ebd7ebaed6b81d827dd3cdbe8a5e8805e44a3288301aebc83a555ac927be2fccceae74174a64467f4eaa91d2ac4fffa51d7ee4788a8fd6a10e8dc1b6e15b596a0476f449f9facc70ecec125aadca109ab8f66dbcdd7e856f3abdfcdd944edaa4bdd8fefe1ab5ecb6bb79fdeca5cf5190ba8da051ccba46ffddb7ff4ae695fefff8f8d2d0ec63b88e78ea7aebfbfef1fc5969df08700d0868175e27deeb270bbb1ab8fb6167fc32fadc5fb2b8ed3d0fd395e98afc81fdebe81bee01cb2ca385eca0d8f3afc5aacaefc9c1efbabdcecdc9ac3b62d893faef266de1edfe852b6da0ff6fa056e449dbdbfb3fb76fcd3c5c57eb2a26d79b1c5bfa6a39ed6bd8d975d534652e0dda60ddefaaadf0ea79f176ce0cef8aeffceb3d98cd51c8b9acc93cfa1fbe76db28ab6119f2d79bba1cc36010c1eda9549d2ab855d8ce1a9fa5e0faefb9eb408a7fec6176780b2d2e99450cc8dec1baddbaf9e2ef2a3ca4800de52dede2beaca2feccae663ecabffdd7cee1d5da5eeeada912d334a7ea3bc043c5cedecaaabfefedb0cd9a340a1e9c58d615b5a864ab3d0934b711ced0ebeb584163a48bca7f46aa8afd2480b5f8da39576facc9862e8716c20d43a5a8e92a13fc77b1ccadd2cfec6ee6a0388cbbaec6268dc11efff37ca3cffae90079fdfdd88bbe1bcd48e91577cfdec0512f8de4cd0ca5c3ce4ff56bb0ef9bdec88ab9e5cea18bcbcbb4bb4ffdf5e5a8da8fbfbb9eafb071da26feee46de7f6904236a13ceb796e66cf8ffb7e8b4fcba25b880e36db866ec709edbc84ff1288b0511e1bca2d078b8cf503877faad92f3ca02deab06a5cae0143b9b42d50b4af6b0d6f405bddea0035aba1614aa479eb810d8caceabaefbac2f769bf175ee4e9ab5f16d98d7d85c88d954e8d8810cbd13f3bbceef9b19bda0fbd9ca6be328fc2dd64bbe08922af37c32771fb83a628a1ae545ff8a4fa4b6f54bbbee5e612da18bdf21b1a5262f40d65fdb64ceb7e7cc4fef673ee3dfafe449d7355ac964148e61b08eb3ab71583b46fadbf48d8f0f4a9fd3b46a67ccffacfcbf7ee4aee9eae0dec3cd0fe7c7f8ddea140e9dfa86bddf39c5817cff6b3ddc2627c4df3dd83bce9bbd5d7880e99cb14cbbc079a2bc9e4eccdafb42c69315a8caa88055b691beabd2eaafadb9b8cf2cb240fb86be24d3de9f3df8fc7dd07e05bee2bed6eb757aff630464f604b0cf9a5d5db1e1bd7fb5bea897ba66809b7e2f4623f2d5a5df430b8aa3d23ee3514ba174bc95a0e343574fe5f4b11fb3f33d7443f1673e41180ad2bdbfdafefb3c9fbe232d9a6f16ca683c26203c5ed92aaf15b86eb1fdc2fbf84bde56e27ebddbf510aebf1cdd8be8caa9dff19ff72fd8ee7d3a8987efee2efcaf0cd80fbbb7cc3a2dad59b7bac6eccad7c1cbaefbfb9362141bbba8fbc2019ac6c5c6a6ccecff8acc359ea30d63f94c2bee5ca1450e47e0dcfeef526d6ecce580fca2bce9ecc755681de6748c50fa95b19531f1194b5c0ee1cdbb2afc6e604e5a03a910d7416c49c4d6eb128efcf2ac9ef4d015dedf044e54dfef007b5bfa1788c879410acbfd92e825dcab1e6a5acc0adacbcff1fd7b09cbc8f8ee3306559141ced65b913c9fea2d08c9da626dc1d4dd3edb8aa98eea527a5fc3ff936bfaf13cf289a5e3571f63fe75afabec6d1ad8e1d9133a0bcfc39f8b01ec281fca06ab61b23aeddbac5db8e4c51f6bbc7cef39bd0cedff0f2eb5cf244c00c6b80ff4f0ccf38e3e656ebbace5d0c4bde46c7f37b3b8ddf369ddcd4d8ead41d7dded53f803f25a1d84c925c25adcbdf78c25a6ef7e48bec7bbdeb2f5bfa6f8cee7d87d4383d161b1eabfac5e7cdcaf5ff92bbe37dff9f2bd0a6cc12b24343cdf3ea9f2c3f82fbe2bb18d31b997deeff386bec7ac727e9e9ff89dafacac4729cb6bb71878d639448cab52523bf81f0cdcd0d7af29df2deb5cbcbb44d1f6ca70eea7f32fe08a56d5dee46ecded5c03c61bdcc7cedc0ef0cbce142fde4998c4ef1414d0d8e3a913f0074c1ed73b1aa567f2ccba7da2bfec01ac8d9edba948962adcaf43205afddfb552bc0dfca42dbcbe676852da4daca619efbca48f298edeee8027ff58df6f3bb7f9fa5e9c8de688bcd31d7b77a978dacf5e31e8eca5e0cd2cbdc3df95d3ecde870ffcc7445bb3ee6f29bf4db19f65096fee9ac8ea4d1de50eb6ef15bfc01cceaad0064f656ef4c068a19a712dfcb64dcdde3442becb74475199d848af790c83c4dc45bfed3ec9c83cbb923ecef71c91c7dfbcbaf34daada3f9eacd322cfefc05c8000380c334c099aceec523dd8bd6bf6ce3105fdfcd7af9dedc50a8e7e1d10e0ff2f4a4f00ef8eb94fc35ed0cb9cdb3957af9a09bfaee30fbaec68aa1d50abdde5d2a6082cebb6f7bda1e377d618fd4cbf2b1a8ccbb4883f0a6ef87faaa8c4d57bea8bfd5e5fc3ce4cb4bca7bbeb9a03a9b725ebacda7d9991fe5c94dbe3a1647fdf1ecd9fffb2bdb0caa0b91ad760d837cc6bc69ca26d2ffb0165f4d73ca0f7e6889e9fc3fa5f36b56bfe75678e3db0cdacc3d577df0abd86a02e7dd8bd62f7f8b46f8cbfec2f250df025da3eca9397d83c73628afe769e74d0f8c88ca6b7eabf9c5f8bd4ffaeecfa94e04d36ae0f5decb4028ab1b954a4b4c33aa668c2efc3df320efffffa7b05deabe16be4afbb2ff612a66696a9ed929ca17ecaa7eeeef6ddea8445e5d1d0cdaba56e493cdfeca6dbbe12a8c056f0449cec5b4cebb45e6b2ba0eff80beb484d6fca94cbecd5f590c0782fecf87b4bed6ba2843ec6257de7f79dbd2b2edaa80d9d0ccceb924a59dfd9adbdc282f1a725d5dead258b2296d1adefdb3aa14e6542bfbfcd6af49490ce41bafd1d6ad6ffe9f0d70fccbba2541ed88938dff38ec5e57b856742bce12fdbea7f8a71a57653a3de397f6eb1294dcce2fd7f5c8d63ac3abea39b1adcd9abf6e432d4dad32eefd87bff88f2e78f546b1ce4c44b7ef2ef3d1afcd8e95dfde26b805bc36d85442e1aae65ea3c10e8d1d3db8bba0aedc4a229607dc5aba62da5294c6e1e52b132aa0acacd9a7eeee71a398a3eb1353d6a3f68b3f13cacd6dde33cc42d8f3febfec7df51b6beea4630e23ab2a5c93c106b9390f310e95b623535baaafb391d5cac87aa3cbc332e5ec8baeec343bdeca5bbc31ebe9d7bfad0ac8d4ef6e79302d94beeedcec5f12ed63dafe3fe0a3fc37f28b9ddd3315a9ab4b07f26e0ec4b4a5c2b7c55b6748e1efc585898c3e951af9dbf1821e0eab51187bbfb85c67ded1b9fcbcd4f8c1ceb87decaafb38bbc7aadfeab70e04fcc508f1d41dab6ad4ebffeadf0cdcece5c65a4edaca3fe372bedb0c3ebdb9b3cabd54fb93bdf5cdccf57476bbfe8f35df4f90ff16fd0eabead2b7a19d0f21107708a74df3b0dff55e4d928c8fcc55df73d8dbddacc77328d4df9ec59fc7ea576ce5cbb3e49bafd7159b3cef7fae2de0aaecdbce39d7faaf7cada1d7de988fbae416e3401209d0eb0e68ce11dba6de924faf1db0aefd2cff4eeb13601fbceedbbeedde2c5bddd7d4534dbfcddd09366bca6dfcfd0b3ddafaeccaefe953d18c85b05381f6dddc65381a81f51c89e2cad0a74d1e4de81588a9d27b1d2db4d3e245ae7271cc881aa5b8528b8acb9fc7814d71f766eb7fdb95c22ff3f2eaaece7bfbd112c115ddb369cdb20ee43e031d1a6b06cd1ad9a0e64bdd74bfddaeb6a8fb56082de6fcada2aff2bdb3af55cac6aed6bbfa3d33ea93d6ae4ddeb2d4e4e75bfa7cdcaedd1ffad2ab8a1ffacfdd7a9eecacafc82fefc6cbbaa8caaa60141ce4fccfa69a377d1522bbd55cbb1d071b2a7b1d5d5ff6d0d36d8b53924afb0c5bedf7eb14bd5fc169aefe5daf7b5f7b19af09e2f94682aab0ad4dbd3d68e0949e8fd4234adebb3299d309c3edd58abead53c3ba74791eddecea0a208c3da448f6052b21fee17e58633780fd654a1e9d8cd97fab5cbcb0fccd19ce94d872deac381b6ee7dbebec57aa3773ae1530376e7338a3baa2f1e8ebcb78a0f71dd37d04e77c3df497a5b5728cc7eade1e22c979708e904174b18b0be471c77df2a6ed4e0b99baffe5b1ddaec4ae4d1fb7d4cb7be6dd2ff4c57aa7cf659cf84ea7acb19816dcbb9a9fea8cbce5dea0a0c592dd0141ccab3cf12ee2bf45dbd64996736440632e46cf5eb1effa70fcc12a1aca0fc8ee05952c006f59a21755f94a1adcca46c292abeddeedec5c8c360fa9defe9a8dc6e1b2a625baafa81cb92f4aebef8af3afe2c1a686f3a19c307d5c112f0db99aadf2ad51d7b4c182cba4dcf768f9eb0b2fa0447a4b38fa9ae5358e6ebfadbb24754d70ea4bdafdaffefd22e723da5cb417ad9b9a19cab15b2e7b0254a3b24d1a71bc8d7b4ff6aaa5b4c6abdc85de065049268e7eaa2f0cabecf23fd540cdfcfa67faf46ff5bf062b1dcc3d370eaf70ddc7ccff407bd7e1dedeaecfcfffebd29d4c7a1ed2dd2c5869df28f1f33eca1ae0c5024a3dc7cd488e85e18f26275dfba76edbf0f82ace46c33b50bcb961eff3e8826a3bcfbdd85a2bc78e6debb50ac1401dcaed4dfdae7f161a9d841c69c35a58080781dbdbd93c1caf562a73fc44e8ca49cd8bce5bbcadc660e3da1a78d1a54dffdece5a76fbf4b292a0c58b3ba798ccc8eff4dfa4d73a4c3cf26499ad6181b5aa1ebdf8ccb2cec7ce030baee18aa3bcbccb16f574aa9f3a2b078ee8aea8f641dcfc40defe7c8a49b0af8d83542f0fcbfdb6c472a883ce457fef18eb4139cfe6403fbaefb88eaaaa3ed78dad23fcee71350b0d1b6c8b0e4287d3ff1edd22e81dc3d0e1e81e816ff0df0bbc3bfc3f250a7c55ee664f85cb3d040db8a7eac01a35667f2b2907e6ad85d279379d2af08a3af46c8af361eab5f7cdca6f93c71db1caf3067e8381cf4655a155bd60742b5aac8b09fc275fb0cbfc0ed6cfcd229dcacbe927796d20ef4efdb0ed4c4aee70e99cbfbbf624feac7cd0bf7edfd478ac1a509e4bd710bfdd2a4b1df2c8cf7ae86cd5e7f18a742c7dd2cdbeebff4c10be5e8bf8d0cafffb03548e65afdcac063c6c27d5e2e6dd6a40ce3aea32709cc999d8d8b31f1a65aacbc4daa8faaf68660e02efaddeaf9b6ac8bf9a61cade1ad10be6e552721aecfb599b8e61ff5c1f0fdb8f9de96212f5577cd1fe041762e6b7e3bb93d07a2c1ce1a8f4d333f9f62f9c9ee76052ff68efc7d4b46fa59a36dfa1cb1f871d8f0ad21f5ba9f8dcbafda38d2913837b6fcb944df83f9fcfdbeec6fa7e53d07b25ae0fe5dc64698af48c857df4038ecbc1bf3bf2a45b4da0c385c954f69c113e9b1dcfd59ce265cdf46cfef893cb3fcffaa04df3e08a80eb3c69a6d6bcaedeabe1ad9cc7d0dc5f880aff1ca1bcbcd16469efc4a9adc5b8077aa8adb1ec3a62216df650c8ae956a74f7c83bac1d871b1ada59a1d66ddd6c1e0ca8b923e4f3bc95b9eacdbe6ef9ccbeea2b3d2ffceccfa5dafb5ad37bb368d35db7d619a3380a773cc4bf5f625fad3dd0a3dd160bfbcb174aaf8b58f1dec2cf7137c55cbabf4e3c06bbbdaec3cd49dafdcd2bb9e1abcaab1dfd78fe4cdfa0feddeedaf0a27bfadf7d4d06ce7274f7f95ee50432deed16734cf0e049ed33f0ebfbfb2097bfeaa2cbfa35cb7bef55e72c3aea8aaf5f7e5c4cbcf62f5d2cf650da17784c49dffccf1d7aaab0b0616aadeca55beddcdb9eef714aa69cf6c8e3b6b5a4d4fdfc3c7dbf9ef0bf1ee8c88116255b71aeef98faaded31dded7e3db3e3ded6e0dd53d81c9658ee1d8279d2c4ff4eddcc5d94771e63fe44c45de96c2ea3393a17531bab6ef72bb9db1cdefcba1a8e62b04e62f5f3c553f3b6bb22f1ae5bffbb09b1aab3f0875efab62b3cad7c45fddebbb5b7fffdfb3e21ee2c53ca2cdc2c4baedcbbe5917e2b2d5b253bbaf5fbbf58cfde7eccd7db1ccc2dff91fc1de53aecfac87ace7cd16aed303cebbe8120cdc79071b98c1fdc0dfa7fca66124cf1be411e6f1bef8daed38ffb0b2100cc06e3351ae53b21ded32430d1c2046dfc3e4bdb1acf94f5cfc5cfa2a9c3a9bbd2fad5c8586fdae0ccbfdfbc7aafdf9c387b36ab3c1c5cd8042a6cb0e1cfa03dfeaceeaa9baae8df09c8fed13ccd1da15ee68f93c2c4acddc3efba62bf24aeed6db41920652cfb701dceee2aca659d5771e82efa9aef9bd9e31bcfc2f95dcc976c53079ec3dc481fc17b9cdedbaaacd6a5b7dd3c60964ac87560eb6a8ff2155eed39ec00e31b0d245bbf5952a31ffedc58ece4dc60ffc9cdaab8bda41b391b1c3a81badeb3db9fc437adbb8cfb2ceb8b0e2894ce369bd03aa96f8c4db11bb594aae65d6add9ad7ebab93c714ecb7eff2eb2b09d18de14f3da18bde2acbcccb95ba4cadbfb96effaae0cef013ae1897ac5ab4a94433f0be50ace8fc5c2ccd31f42b353a7b588f0befddad821250cf20acbf85effb9fe07c9fb6de77cfca68cf4ebab8b8df7adefeb0e59fb7f4afbc3f30e3af02ca5c1cec32cfdb4a5bcc30ddbb6ceecadb7ee595fbe4d3b60cad1aaaf318e440ebe44ebc83ecab729d0ddcf47ce1daf712c69d1e9afecc6d5c3538a34db0cef1ca0a51ede9e9f988dfbeb9afe63956ba6775e4ded809bdc3edafd1ddc9acfdcaf789fdbd1ded0bde966c2f34f600b3c959aaabcdb3f97ea2e94db92d87bd359e940df3a0334ecfa0dcf31d44d9cbb91fded625dcfe835e40e16aacb0b5be6fdca81dfdaad88fd8c86d09b1bc756d7e42cb50d5f390dc8005d166aa0036e3ac6cbb5a194140e7aa7792df7ef94c4db5c98ad0c2c99cf5cb43a7e7d25fba9b16a8be675bcfdbb9169fc78ddfc44cf85fc95ee21d9f0fde1bd2fd005c8dafca8401bd3847a433eefff5949f9fb4ffcef6da2fb5d3818acd70dccc4ee85dbeea9d2baf4343e412a42905449017b535a3e8eeee7c9d3fbcfa1e56cc9cffdef40eee40f33a8ea66d1abfe4addb1cd6adddb1ff8fa15ef34e05fdea2b3c4a6190d6efc3adfaf887d4e0d2fc1de7b22cd995bb63669ad2ebf32aa918a0cfd9da6b32ce9aa5f2fadec03dd02a03f3ff1c045d071ac0d1b6a2aeadddbc284ebea7f18345ffa3c2c2aecdbddac1ffcddfe788ee7af41498a631b84f1bd3fa8e9dfea5bafad439fa7eabe3b0f67f1e7f4aef2f0ec7dcaa6bffbe0b02bdac7bed83e4caeacad8e9b676bfe2bec80cea48a00b8aa599a1d1562494dea6ca2dacccdd8ae5fd55f8f4dca5ff6abec6cecf00a6cde4c26fdfac3cb3ce4bab290fffe10cf7ca6bd3dd45b07f4bceb7543fbf4ccb9a5b9a2bfe1f3dea5bfc23bf77c98caa4398e9818cbbbf2236f8142abdd682ba68e999cbc1bbfee79a5beace5b3815c0cd54b02040dfca8c99e8b6db6f98bfa6c7efcf3f6b5d5c3a722a3e3bdbfc277accd5bfa8c5873d489aedf5a3c93fe9a4c6a0c9eeead6ff3579fc422cdb55b02db715cbddbbcf5d0de6c2ac6da0f4fbb59b45e9acfeddf43edfddb03eb974e97adbed1db0cdaef657fc8e5a1abefee3f8bc670a0f8a5c790caba43529bcb7e2afdf283ab85af441fbbbd042a4eff8fb8568f75e5bbfab16de7d06d57a6b1208a1fa5a5da11ffb9f84be161ddd5ebe54e3dc0deb3b9ed1a430535188f23b65d53eda6faedb0bcdf4cfaab6adc11bec2c5c840f6323663bff0e46fca3eed7d8ac2c041cd4beb4a32678f33ecaaa21dc0d18fda5dbd2deee7bbf7dcbfe7ef5ed8e5ed2dfc6da17125d5bf6ab65a089aa63e7f9dccfddea9aad4eb31e7efdfc31a7ab6829ef1f11880c4ebbc8931bb727a6d5aaefbf65bce947c60ef37e6d50a9fbd4c93e8cee81e7a0f7ac04cd2fc0ec87cfe5cdbdaf1ef8f23c6e965d75a4528d5cdad89f1bffbbcc360da594f2c8ac3def9ae5fee9331fb3fe2983d02c9cb01e6a394fdd5e3ef5e0eef7addd3d0142bd8d3b60bc898de0cdc15bec9b794adc30f081aaeeb7e052663f793e7ade7fa024cf71ef92bfb2f8fc01dd93fbadb77ec07f2244b3dcbe095a24bdad5f10d51a99c4e246dddc2d2df8fffba34ded9f9fcf5dce0efd9cb9810c1a14e514cfbc7fadc923a601ed7ad191c76a3e9100bdcffc611bcf6adfdba9f2b591696e13a57ed7bef206a4ad8beee54fc03faa4a27b41f2d861dbb0dcff8ab9c12e762beca13874540ecb5d2767ebbeebbfeca8b32fe7aaf699b432c1792f82640bec6abdb87e3414505bc8db9708cc16fcfc19aaceae0fbcfcbe68e50a8b24b4dbff1d9dfecba7625e3445eecdade10adde3bf017ca68dd480efdaa7fbca1e7039f1e2f20ef061b02d08e5bf769e2ea23854d3a60f8074bea127d30e0ec39efcc53d1b4b10ac4d2aa4c56fe9f178fadba6b32bd79cfc6dcb482dda4bb15b3cd082bbee81b8bad4bbd4ab98ee679413d352cb221d7bd3a3e162a317b58df7e9cf5f10a1ef161fa54b9c0bb5b51efb1ca6846a000949a4f3ae0dea3badf1cacd763ffddeaf51f0bdde8ae3ce56f00b91a7d2bfc6eae142bbbedf0f4b2aade8f5e365ad29c753afa9c48e5fa6d77e6dd07aca9a922ba94fce8fb1122ffab3a744140a087b20edcab15e70599f677bb01aed9bdcc2ef10d5d2845b2a6d6c607cfe0dea4fefe1d3f96a280d2d4fcdc5d61bb5a7eb7f6dfa278bcddefba3c6f5a69738a0027b814bd84aee015a32fbdf5e267d62bfa31b809ae68fadd37dbf3bed6ddf71e999829bcf1fc7aeadad738c7ec02fefdd28f407c8cd498ed04d2bb1c5dbf18aefeae10da51be91afb7eda5f27eb7dedfbc32d70cb289ea0fbc8a4c2d26b8c0aa75ce355b26b6d7e3a2decf098ead7ec2ceae22c0ffea7b9a5a4246861d9e9ab1d9cfc9be31da595e7e0a1e5ccaaa574bbf3b5bff825264f18cc5bbeab317d6c6ac440efec6b80e8c74dc3a618bbc59bff1ea49a586afbec0fb6d9a0be61e72aabd4cbf3cea4c38ff7bbbbe7deaddcf28ec11a6a67efa823daf1bfd4ec9b4fc01e7a5ae58eefeba21c7c9ffc2eb675551cb6bb68d7fc9eef420b4e49dfaf4f6e714199751ccfb8218d169edc543c576a77ae8dbfbbb63a2cc7dc5cc95a1eae72f6ef2e42a8cc9a9f520ab8942ebde57b8cbc4285d5905e6adefb0bb3febd75003e0d584ee19b1121c1defbe2cacdcaefc78b0c6f35bda70cc31c24ebffdcbc1b6d68334ba02112b6dda8d226a565b45ae7cf6af45f8db31aa5ea3fbba699aabe9dbd1f2eb2bdded9f9d0d3cdffb92bbb5e42a80ddecc50c61ddfe80e670ea81bcef5cb87bceb3bf52cc064d0dacb565dbf26c2485abbbbda9baba4afb8de6efb5afdedce2e5bdb7d8be2076ed715fb485da8c0be420ebbf67f17bc2fb0caa23ad71ccfcbbee6ce8d2fa5eb1a86fa92edfb2c3636ce73b81a3326c1769b4ff5aea47efcd7fa2fbf8ecd0e15ae1dabd9873f7a2db18c44a780cb53bb811c5cf216f1b7a05ddc994c4bc4db7beebca6f0eaeaffeda50fadd047999e52df0b31d0fd6c7eee8fa653eef6bf8bcc27f7e6d1feec56bfc2b128bbf1cffced0a223ddc6acd3d8cbc1ee99cac922a8bcdaa72a51f4affcae18f7aaa7edfb41aae04f8daec40df6c5c2fbaa5ed5ae0ad8cb5ff015d985584a75ef6cabdb29385d6edfd96fdc6e9179454cf24beb4a2a0b063ccdcdeb4d2a9754ff8af7e5ea5a5f700dfacdcaab38ea48f4ddb94c3e929345a00c1caa76ceab040abc12e2e1c4ae905112959017fa07314f7bfc426452b2cab7d7e54d23acdcdeca564d6cf1b5effc4322be3b86bf05353facc5e040ac3cc5a911d606bcbccdce9feda748914eaece8cd0ba3a8df8bc36b81ab9cfd42aadd2394fcd6e62f9e75df50aaed2a1ddfb33b4dce982fadee1ade37a02fee36e8d19f7fdce7daddd4793fac5030c4d4a7abfcd0baaefadedea5a9e8dba95a8af26f3b693dae6c9caac0ba8bee62db4afef41b6bfd4a18cffffb94173bead55bfd84dacd2de2b0f15cbf3386bd6dfcd5da0cadab0befd278f4c39de66331e18c6daea1d3af5fca73ddfc7c642acea0433ebdf1c932e3e6db9da22866ee2dface2b0ffdcc7ce94accb413fdbf4206fe4d2c8d77af8b422bda45c46bcf2c3dfbd5ad20ef2abdc68dcd88e152ef884a32191ef5bca6de79ff8cd3a79c325ddbaabb561e8be555d6bbbf630982e9dedcfe84ffb5bf4d01a640baaba337a63ef7165b25e0bfb994ce8c7ddef6fceccc10adaebf73f3eeb9ea4173a696dad2c67e747ab2c9ca2573a41fb9a16c3cecffbb4913c3edb0daf71afa4becc53dfaef9fa1f2ecdb0b3fee46e34867f9a9c3fd7e9eea483a5bcdd7c401e8a2f0b35fc50e6afb6b84c5bb2dc0abff08aaad5efb9eb75e2b10f55e4a40c3d095bf19d89f4bf1808540aa833bff076667e445c0ec3de103bd156ca03cc1f02eac53c5a72aeb3b02e19b29c43ccbf8633a498bfbb80d61441ad92db9449d9b7114dacfdf3a46adadf19fabff8bc2a04b10cfbe14341ccb34c2c635ceb6dd2fabb5c6a0ebafc21f43fc5efdfe7665e157d29df6dccbba3dae73cfae01cc15d6945dfe5b18cc0a3a3bdccf30d7cda7e8c8c7cc66dab3931f35eccdcd7143b6182141c39ec45bb5d7f3ac0f7d88de7b1e6b37fab0a32bd4a456fe2c68fd0b113aaae5a08bdfaec4af9ec4be6d92a1463b4c4a44a4cd81d9e40d9a6ab5dddfdb4ef09c65a9cd67dbbf5c3ecceebff7e8a072fcfcac4d17cd256acc5bee307e5b69c88ed7fb7a6abb3dcedb67cd803b166ecd988fa67a9d1a0fd14e2fcae21324eeabcc8d9d4d03e8694e772e0b392bc66cc90dbc99416af0bf42ba50f6dfbacee8ebff5dcb7e118e8979b2e7e7cddcd4f64000d9ea8ff5a151f3b0d21ee970dc96e5fe8eae7eb181fbe3c8ece6deb3cbd3b3cf09cf12adaff2e22cbf2fce0bfdc99d25bff10ff21dab766d720c37edc8fa9bf6832fa790aacc85e3ebebf0eb8f00e14c2c35fed724fbb08ca6a05f8bb5c19684a90dab22f0cde34a4d0b7cc9cb4aa1f8bafea768ca4dbfafa7486ebca3bdfab46fd9cf13ad63c485e146b5fe2dfb84447ddefafb4cc4b2ae4bb5c995bed31cf0fd2dbeb3bea8f29629b3a71b10e8b428ce72ba642e1dbdc69c4b4ed02cd4d0fc7b72d4ece6c2ec8d8bf8ec7d65edd4573ac3aa6ee92dd166a1f4d5ebfdc4ecf915ecec2142ccfee4687d4b62acdc0d7c12fce1cf541c5fdebee2deecf3dfbd2bd231dead714cbe5df062523cd7abac3cceffbed5c14abfddc49d7fa9ec7b8fda9a63dfaef9dc137f0fa36958e286f5ca8f9ffe8304bfc3b71c06f704fd0ef59f863a5b4d01282a1cef7b0824dfd39c92379afe0acd9c7b9c5ed79cbf9b13ec78f5f7e86ba8e672cac6a0d70e3d5f9fcdddede59feddbecbdc64af3151dbb9bf6be15cdabda4deca957ba9afbe6ba68abbb2ff878fb8e30f10463c141f7baf253edceede72fc8b5b9f1d2ddb6eceb445ec0c013ab5c8c8af4bbe1d5422d0f7169a5d3aebe7a7380ea0d2d87decffdda94ef2b3346fdc718ba7214e0d3aadfc1b5f9a7b6023563d3fcecd01cf8fe52d867ff23dd6ee4ca72da3dfd1c1db01bf7766e3fae910c26d7ab4d32e4427d7b441cccafb4e1c8f70ce3286604caddebdadbbc3c99537e9df4ddb590c87b3c297f8deaa50ff5cebbffdcb28ad8dba6e7ec1a72b2a14bdbdec5da79af90e8befa72be518cffe2fcdf873e8e8ae1aafae8dab4854dca8210fce4f3c6b0ef86d8b5cbf2c584d7f9175c848eb157cd6e2bc64c62ebaa13ca1aa050027dc0abdb9f4c3e6a2d22c4bedda10e3d67bb0bffc9b8dfbf7ff4e0bbbdfabd00d7bfbeaafdce2b1087d2ac5221fd9b8da5f2c68884348daacafffc2a4075bcdbbcdebaab265befdceddfa8b27c43b49e12dfc786ef5eabc8abafa0c8dedaf9d60fdeaac7d8f0bbefadab673d5dcdaa2d0a735c5e3d69b3eb7ac2a3a70f441bce0d86bfdcac7db8df15aa5e5a5aae7fadbfaf7cf41a1aae6dbe2a26d73b570d60c51ba2befafe8bbaac0accd25f280ecedca06a2eea1b1ec1dd7975ccb516b91e3b68734badecd73daabbdfbbdfbceef85cbf0b58495c24fdfff81bfe880364fd841fe23dc8c1fafafd2dec2df68eae29acb9cee67daece5ed8f850d6ccc2ba0ae49df72df48d6d8caed6cd390df464be7c33ef2df7d7cfaa9d5f6a133f2ecef8afdbcaee34b1abcdbeda7f1dcfdb7af1dfdb4b9cecd7fc6c1bbd41604aa34302bb4b78ba3f170e6e510a01ae6f29edcd23065ebc13baec0efca3b65a4c32aa0d1ab6f0e0547cebedfd11897b5dda4edceb541db087141eb8c9d9dc2aa6facdd6ecb6c5df1be3bddbd429e2dddabdacc6495e63b3c4bed6c36bfc75f49fcdf44c9ddae0b1aecbe6ffebd0ed426d2bae3275bdbfee9a108efbe7eeccdd311daa3c685aafe9bc3cbe639de8cbc4dbff8780d1556677bbfedcc1a3d46629229fcaaa4bedba016eafaa4f91dcbe06e4129e0ca71e073d2aa9c3a6abc0ebb0ea40cc2c881ff8bafb6c161e21b7cfacc8bf5bdf6dffa2e0daa8eded8bccfce47dffddf39f99bd2d94cf5f1d6faf6a9d1cb654ba55d4bfdbbfdf56bde5ca9f19ab3c50e5dfd5edfe7ab1cdfa33b8c0dc4fd5b65e21d85e07d52eceb2747b11c21a64b5ce3cfabde9af4555e2a7c79c1538b31d2ed367a7c21fb7d27dcfbfc263c51f362e62fbb834de1d4e67c25116b4d39ea7bceadb95aad1c7c57adcf0aa6b3c5f1c8a0f4d9fa4fdf36ca894caccd3a2dacec7fc5b5961399c0bddecfbde4156aaf3b1c9f6a0c11affbbabdcfe1a93ed22aaa7cdbdfee4efbae7e8ad03cbcd7e0f7da8cbaebe4faa1abcfb029d82c0ab61daa5dce3930314ddeb31f58cf2bdf6c99afd6d89612bdf5aee4f9617b8ce7ec0fd08b42eca1dde36c4ebcd6295eddfdd81e9ac66eaaf5ef12d4c045a3a2873fcf946e9fb2bb45e30d4fb82efd97bf7d51ff8429d5445cf90e29c50ac4b2e7f0d960f8c9af23f7b61c3d3633e2e1dd8ab8a8aea7abbacbbe4b1dadaf9a0fea14ab9fde0dede3a07a28eafb9c0cbcbafada46bcdcc240aeb52dcca0ff98f6bcaa24ebca0e7208dfaeffcff4edbbe4a2dcd7184ba46c0ab0ab51ffc99fdf76d77b41fcdd7cff924b6d79fa6c315af7fe63dec5f0a1fa185323f1ba0c8ad523c0d34ddffeb1eee219a5e5caf05c9c4eabbda77aa3c8dd8aabdc7ebb4ebc7bdbf6dcab6294ccf9eb115afaa2ccca2c5fcdac4f1eef0aebcbfad427b9ebc26cba6ac91c449f3f106e0d55b088bffcaac5a6a2d9a3f9beec0d83db49beef02efadd8cb9df4bec8d14bba9fbfb89d85f43a2c1ebb100dfa97ef9fc3e3fe0dea5d5db1e79fdd4604dd0dc492a2509becc1d0cad7fb4c01daeb00f2d8518cf4ba23dfec5dc0defc0aec571decc9ede6bba5c3e36eb5a121a8faae6f21f6d41c49b4fabe806a5d174bf892f948ffaa35ede467c0eafacc9c884e165bd728e315b5cada2b20246bcec5de4a25ccfb17bddfbe2a3addd8ae34b6227f0f997de42fda5f5445fd4b2198aafc7b5b3681b80f3dbdbdcbe4b3f461e5f6a6838718acd4f3a5aefb5e0abdc2f2dba5eea97f5a702c4607fadd72befe75a1442bbba7dbdba5648ae5857b1bcfb243691be0d5a571cbb820f56ebbd0b87ee853c3e7b18a29c69b512abcef8acdc14d3fccc7bcc6ad7cbb2ef76d5fd8f6f031137868d9b25a41c535dd7bb83f84070ea6affbc0d9fbacee00402f0cbb0be18a5eaf76ee3baeccbbd7ecb1fd4a5d7cdca7eaa08901d955aaea26a5a7da9fd8deb5a3c7bebcb4b226a47f7efea4e15bacbbcb7ade0c9d4567b1ccf7fafbc11af4faef8db7a77e85a4be5e9bbfcde372decebd21ce0acd315ce0e3fe20cf2e54bdd407ec6c10983add9e38ea1cfb4d75fba90fdcfe5d6afcd1a568e9824a77a2830c3d87caca5aff818a36babde22adc38aedee0dda1b9e3bd253bcfdea08df97a7e03edd757ec0d2cbfaea01cbbe2da4d309df375ebab827e0bc2cab2e99b0d2d5b23afa8ad64ff19bcec32e36fcd66aaabba8980dab9cb1fe2943af57edab5f46affcb06cdb9ffd5a67e6feffb347dae9fdbd9f2b6a1001ea881fbabbff71a488fd4c4ced8f897bf08bff27c5c1adb7de6abeac1583bbeba7c02398abcccdd9b75cbadfc6565aeb0b580aed618ee896eacc7b1078a990dad5be017db207fc55bf31ae77edae07dcaadddc83aa746bae6d1ca4aff9effefc1ace18dc0ced2c6b3b3ec6ef85aed960d299df79ac97e1c3c3d3626c0b6fab33afeddfae21a6cd5ecbaa56c769d44f3d6b041a24a2af93e60d9d2270d848aeb4d1efa3b6fea42f5ba5e75cf27d993b490ae2cfcd65f0421b32d1db7ae5b99ccbc9eec9acaeec2e29f4171f844ecdedc9538eac0d65bfedd2bc3b3b9a4541b3e01f2af8f2266a004dc29ebdadffb9c866d5aa323cbbc7d6dbcceeca0dfd5e09dd5d82c88d5a09da5e8314bb79aadaf0e7b488abcdfbbdaa0b71de7c19d30215b6ddc4fbc0fb95fec129b04ae253a6bf5abc7df4b8d49ced8fcb19005a6deda1dfffd1f258a7f4ed16ebf27dd10dd83acafbd4e6f957e41cfbfe72aa417ab5f2cfeec61efc6c6cee9f6efb3ab79ca5dad5d8e48ffb9833f6d3166f2bf6bfefcd5addb7b4e1c60e9794ef7daa3fedaaba47b2c9ebd6ad67c2d6aa53752dcfda2c16a8ef28eda23c72c544fc1e4e7bad52a40a99fc7de0133af83959e360978ca5a41cec5c98a2f9bccd141daa8ccf682bcfc7366d2ab1ed9bbdac6a3811f3dcd4f43ccd273a278414131ed7b00fa7462eadb7ae3ba627a461daed8c8d49a4ff48adeff89ff6cbbddbe6883cddaf30414ca7fb7aaddf709dd6f667d7de02ccddebb5ebb14e3b7ed464e7bd6b01cf4bcddb694e2c725cd7fefacacf6e6cdb8efcfeabb5d4799f7277ef703c3d907c9eab3b0eec8ddf7cc264e583fb37ef4dace9734bfa7ef12cc51c53d238f0f1acfa8b4fcc90909ca43ae38f0f3c7daf3b58bc1cdb1f5abeb120dbecd90ce490c27bfab1220523bcc81f2a2ba3b7958d0fefc9af36faaa951873fbd0d487286d671a81974dbdcbddb8e8cc2fcc4c154f8f79ae2a9bc1ded7decdcacf89ea91bf6cddddcbeb6f174dceb4eb4df220aac298abf404d6be942ee7bbbf09ae21cbb34db23abaac228a895d072cece483ccf50f362eaf1f7488b0aca5dd0c5df5d5f0cdccb1db8ebeb84babd9b6d7133357cbf6a4b1f0cb89d02fe4172bd5755edaa03ff57af41ebe22f64c3bc2ddd935019eae27110c5e417bdd354c9d5daec2a29b04483f3fff36dc3c221f5d13e04f3fcadcffcefdadadcacada8abb93a63b6f5d328085f54c6bb4da6f5ceef3dea642adcb57efcfefafc3eed9d2babaa97c8acd80b083bcba6b0cbb2b0bbc6ffba2bde9dd60f533dbeabdeea16caf3a60f59fb5c0f068cf37e2d615713ae16a773e49a6d606cb2ae48d95bce6d16bb8cfe43e4286fb54cf6ed9fbd08a4a2b4119852daca099bebd99859e64bbdebb983c5bdbce07be5c996cfedfb688d24f1a25db333d1ff5e690ccbb0ad45a2ff26ffbbbe53dede918b220b4e3ef0adaad3c9aff04962dab1fbaf476c1b1c60b2eb7edd3c99fbebecb8fcac676a5350b9ebbafed40a4ebbd756bb99218a8b2dfbdcd55e6a71af128d8a2a443cee49e89defc60b1e8b8cb7a1acbf07ca3bcaca83dddf8f283eee9efc33db8c0da57d2bea6dc1d88ce03fc6fe4eeebcc7ab345e16c0115be0f8c3eabe598aafecbcfb71ef6032f509cda93edfb227ebfabef287cfb0c8239bca08dbd5d26cf65fe8380856538a1efbcbfd76e5fc6f8bd23bba43a8f6dd0cd408c9ec0820f9bbed2bc3b2640fabc51f3ce1dfc3bb6b3eefea5a5c5dbbccdb4d50fe2fb4febd2a15cdbcd0ae0edae6748bc9dd9e7883fd84eedcf4ccbf4ca6cba4af1a53b499bedbf8a32beddf1f48657c7674078b1b75b1dbf3af2e4aebbb5c24cfccd7cd651d84a5ab3a4c7bfbf206fe3bccad471e051eaf97aaf7dd7937f4089e3a72397ec4cf6ac32ea229b72ca4e761aec6dee10aecee7e3eea7a491aecfb2f89ebb2a2d2943a6ef10cef62dad58bdd48a27281abaeec15dbf4168cd481e0cbfd43cb45a8abf3965eee1986ada7e4ecd778ee000b3bdb02a2ef91ca5f455724aeac4dab4614e4aebdb5371effa4a285406d04c53db5f6faf1e0b7d7cb7becefbdcccdc09e2ddaccd34ed339fc0811a7572af47baeead5d47edbacecdf78d3cef99cd313cfaebd6b5b414dfbce6d4c3fbc5e95e508fff0fb5ac48c88eefac7aacd437d55bf975ca832fc50c1dbce7d7991f2eeb56c93a5ad7cebf94bad669730e084d1cbccbb47abea27b3dbc9d766aeee0f02682bd4c45b12a6f152e4ad04aba9b0a1bfd0cfd3d31fc7a684fcdfa48d341bf6dd8e3ac93e8737e77dbac6cbebeab1b8976f8ff4d2c22e692a7affcc730b706b69eacc0cdaa5efa76b3ae54ef8e24b988067abaecdc78882f6ca32f0bc1746abbd6c79f0e2dbcf7a9863f16a6bdb17c5fb85531744b36c6c6930d71a15ede1a2134a82c2e4f2fcf6aafb9c7dbcb768f3405a6c9eeffea9169cb6281c6fd52edb5a8bac8ae4839d8c7a09f2cecb7cbcc7fe37d1166acdbeafdddbdbaa1cdda9ce1c17e07fcda58bd9a8dfa87bf0ee8603e48fc5aeb0de0bdc872deedf7e50a14e1d99fb8a8e5e169ad17fccf34fdd4f44eb3e40ca3f96ceda4dc9dbcb423c1cb66b6f34f5bc029cbb9701999e81d9cf7d8fe34acefcaeb2ec92fd66ff2fb3873a48dbadf85dbcb5adf2a6edb904b3afebd67a2f63f33c2b5a998fa008fa8c8ccd64aeaf327dfe5cf5d8b5ec31c4c034c338016059f845d6333e4d2a71a12fea197baabdd3fbdc20c4cc8aa4e5d62ddeed1d46ffdbfd1a97f6ff56313cde61ce5e85738ddaa8fe4c26aabd8aaefd2cf26fccae9a7d5a4bbfee2fbecc87976425ce951af12ce4f8dcaa7ef4eb3ea040dfee294c52c1b5b57ed3813ea86aaf7cc8f4c2ef8f60c779ef949debdd2dbeec56aae2fa13be0e3a7a33ffe3bcbcbe67b01ca458ceeccd56e7849d8d44d2bff7daeedaead5ccde2d64985c2fb35a24af05fab1cb9c4e03ccd34c5bf6fb2f9df839e9baeac79c9cfef56d7bdbc4fb5eaca9eb9154e3ecf2dd6ef9b43c26f1f9b781af0c13a9fb996c949cc0e4acdf79dccc3a876daafb30892661354df158bbacff3b6fd2a3df0ec7357ae8d0332fabe39cecfd66733deadea0ad86e73fbaee9163f67edf75caeede1f8134bd2e456f8249a4d3efe5fcda62ee76afadb00ec5a6e9ea7ac5fef9e99fd8ccb4df88c8bb6a85c1cac6ef9acb9447eb6c9d9c3be438df3c4f87be93fc2efb67acbc9c3f16c7d8f84aff2c38a36b8c7f0efdb79f9a2af2230acfaaca9ef71ededf0ac53377f39f7b3102e11d928baaaabf513d2eff17db89b742bdcccbebda1a1f579abe45bf472ffaacbf25e6a6a0f0b98feafcfd39cba91a5de473b0ba6beb45c73ea59acba52ceed25dd68a0c64823ebed4b40edfe852baef23ffae21ea7b3c8d542cd7ed15e11fec1a1d9d2d6cfcbec8a625b1e5f1b4ebd6bf3e2e84bec9b78bef1bd7b8a0cacec4d852b2ccfa722ffdebbce9bc85ad68ae78ec0291ea2cbfdb9baafdd7fb54f9d4d03b12cedbedeec5c4a07baad005bbaa3ab575a1aff6a3ee5edecfea80fa522d31f23af24b6e4ebbff68d2c4f5e77e7e7dc4df1455fb0c05abe9eaf1edabe74e4ec84bf0f7861300f39bf9f8ab2b30d28e8fffd620aae06f9f2aba445ae8fb267bfed56ce97c5d83eac2a9c0d6cefafb53c45e82ecbb5f982038c05ff0f96f5ba31d9f4bb7e5fe8fe4a1bd8ddf194ad6dd1ef0121cd74eb6e8e3ed1e0d6ccccdb7043d1f505f7592f2aba19632aeb45bceedbdc74a8f5bda1de5dbfaf654b430deec051c0bdbc1dc0af74cd097fcab1e3dbfee671c274fd953afeb0aab63f5e53a3d5024ed814401cca6feda5ec1c3616cda9aacfd84d2ee1f54f240dc77b73194250648d08cb566cdaaa203aa75d2bffce43e5a70dc9e25ddf1a782714ecfbf2464c3ef63a71ddd4edacaf41d77ab6ea5ef98de5cfd5e52ffb0edc518d6cbbdb43076cf42ff4aadeebefd8d930709d21e2c26b2feb6fb5d908384ee5bcbfd34fcefed6a4571f90df1a1fd2cdf97db272378242f9f3205b7a2338a38a0cfeee8f26cb52a626b5c4c804b2bf50cbcecab1f916bad72372bbfefb9ee03fbefbaca4af83eec7b5ecca6e6ad55de7ab9a11edf5b8cad82781c0facbecad6f499c3ddfdd70002ea0d7cd8c561dcdcdf64d96750f92b7cc25df31d400ee4398831fbe536d4aeddccafce9ffdc9e4ba6ac7eabe439ebb64a45dfa09510041c86817bddebd48d6c5254fcbe0dfc893f53cf35a3bdb060d7a27c6dae1bbbf0bc8e7ddccc0bbe60be1fed361ca21e5e1df9cea1dc3ddeb4bad6fcadfccb77d8bf4ab6dfb7acaa8a1ecb1abec92ec7fe1afe86538be49db1e9ecadadd5d1eec5aa98513ce2f00b24213b39ce0a4dda27ef91b5ef630fa705fa2efbbeaca1670c26eeab1ec4149006a9f49a63e7da5aadd769dda7fe01d4ef62c78bef2aeabed234e5fa7f4deefe4a24b35a1cb6541ebad95efff3ecca7f49abb8fc9a9eacccac28c2f9ddd88aeeb8216d735afa8cf9ea1aed5c8cfeea4d5e79027eadcc963caa6c4abda89b11dea2224c6b34e7fb6e4ecfed67fbb75f06fb8c2e09eb2eccc716a526e1d63abe96effa4da10c0da6b2bdbb40826aa55149f625275b4dccfc8a9ff7ceaffb3ffde02bb663d32bf362c33cd94a6a1da977c8007adfab72fcdad7ec5c3aaeb5ef0fd5006fa831298d8df7cf1ffb620c98f38ca4d91c1e10c8f0ec6f7fc67e338acefacd9ddca8aafecc7aac05d4beed6fb35ef7bfdbe127795ddd78cd2a38c8d165bdfadb434c3cd4e0da4b24d2b8edca0d2cccc5f5c9ac081b4f0e06bb4bbcaf4c1c784c8e00b3a47dbc4ace4bd8c014ff402084a84cf94a1ec64feea15ebe8224a206eb3e2b7d2b4f72b069cda5fee46ddcf5013cc4a6e3f6addd8493533dae9cf3b97ba8ef8a58bdd599836bc7cdad0d3c1f3538022f43f3fc3dcacce045ebb5dabbbe8993acdd10409eb9fe3cd0c17729b77f8ecfa01dbdddf9bf18e827975a2aeeb09cb3eac2bce3d8a50ec6667a6688bf7aa0a52d3f32cf9f89d77bd414e7aa456fd90029a06b717d0b20eafd322bdbbef27af7d6722e9d20ce8c88eaa09c6eed3e17c769e7a9f05db1751e2cf03d37ddd3c8a6f8e752b527e64b73d432d39e18ca450ed53def9b8045be8d06a3be7af1dda36b1f8882a72b677fd29ae546bd2f98eafe26eb0a9f9072fd225d82b390f01e990a9f3f3de86c32bd7ad2dc16dc51eaa8dd3ede7390ec1691979bfbbfb530f8daaedaccdf003d753a8fb276dbcbef60baeebaf33db10a95fa61a7aa3eaafb86f5efbe1a417b45c405f55f25fcd48f6cfd1a0b3bbbaf43ac783d04838ef74ebd68c60fcd6cdcda7d9bf2b8bda835f88b96fffd8fdf5ffbf47bbc9a558a0af0d8a3d2320c2238e4d7dff4b00b39bf6d65ecb1dc5b295e5102ab1c75c1ce1edd3baeefc69c714be13645a5a6a4b43ec8df4a3bbdae57a2bae70d6c294cf4968e3bf74e59cf47af3e38b6f4ad5f83f9c3fd7adeee71def8c523e83de1aeee58d64ed11eef8aac1ed22dfffe369768de12bd3dc1baeadbf09dde7769e8d3d63a0fcc9b1aa5e47d0bccaab6d9e3ba68dabbc8cd1d4ddad0db6aec53d30f80d968e9b6deab4e9f4a3c1dff6c7aec62799cab772f993f2b9bc51da0adb07f5f330bddc470dfbfc021f6ec6e0a7b13cab9ad35c0ea29f6e05ae0adf2eafc1ffde233543cfcbd2c1f2db37df7acbdd5a3dfab13c0d251ebba5efc53b4893f4e53af4bd41d2340bccdffc0dd63bd5c2d1595314acd0a5dced8bc0b654dbdcea6e61d158daaa22bc3ea8ae3b547baba53e59dbd7c9f7e04a548da55322acb27cd584bcacafbebbb0609fbe5c7af5bfc0c1cdd33fdbefccc1aa6f453a6f56312c378eeac8adede3ce86cdaf440162abcba864cbfc27f5be07f5dbd50d4175eb1819783fbc231cb9f3ae1209bcef0c136fe21ed294a8495025f1c24f78dac55be00d1494dcc6d5dfeebf7f1ffbc2276dad3f8042cae73eba1e5cb135a06efff2a15a500456b36e190ce84a9daafdab570f9966dfbd0d6ee6fd5cc3e34cbeff5a81d000acce6f1bef0f0043c4ba7b55cbd972cab76698afd9b2edc0beacc42286fcdbfca90dfd6f693987d185efbea5bf860af4c4e95cdd97caba0ae7f699eea37f1f26f624feea96dc06fd8a1f6eef22f5c4d22d190be41ad03e8c049f74a042a1f452bdbafc1dbea9cc8bdcc2badd40d1c0f16daac3c2dc1cdec7e16fcae83adafdce8c6243ca5cb1d4d7da5cadf5d3741fcc032e824ddaa27bd23ee29506a24aabef432df5a4acfdb06a6038bd8501e427eaf2c87a7740a2fc7d9135f7ed171fbaad657c2d77dc5afbfc0a7acc37e575cb76aefa28abbf39c29cecea6bf1dddf0c4ee1bd7e503a3feb5233ea2cdbe05dbf1a7c1a29dfbe1b438bfddfa94b096a7a662d081cab540fc891d93b1cb8a09a0c3c2e7f8992fcc51adb20daf426956c6c8dc1774c96f80abe66eed32670ef0cc6e3cfd51eddbe49f14d8ac14ea4edc2dcb8ccea7beba8a88a76e53f65bddb282f54fad3f7a4badfe4c7865cf38de88760c0073f67c0ec4fe59f9ff4faf21a1facd4a6d2edfaa4e327185c17b0d97ebbb82ffa9818a83d0a438ec2d0edecd69134ea72ec73fab37a53acde2e8bbd0ceb7c5846d1ab4a139e2ff2f7de6e2c9c0b8e4daebfbcadf5e3bb6bb409adb5bdc5d966b4fea4fbfdcb71b5e02ac91fdc04cfebc396b5215fcaff2f3c8d651fe57df49cbdb0d979becf6b7c89693afc5c3ccefab36bd84d49c2e5aaf2cc9e75ded9e4da385c7afcacb728acafc26d6dbb2dcee18e626075fc2812aaa769d4fcfdeb3b74b28bfcc8ae3ec78cdac34f1fd80feacfbd858fbd6b6febeca51dffc36068fd47dea1c9f901ea2b5a0fff0ecfbcb25c0607c2b5d50550272d3ee6ae18b371eedeebddf2eab4221448edfa9a9c7c4ceaf732d1f7934051b59f3d2dca6e2a5a8151fde5f1c9bcc9ac585f7acefa9fc2dd9dd90eed1b092924d7882a1ca5fdeb0cf1cc0fd2b7aeeda4d6afe5dbd0782aed3d7bcdd7ba2e1f51b38befdae6dc76aacd3af6cd39c3fd920d7f950edf7aef3e4ea6fafbde4d8a1f88ff548d5e4fbefacbf95cc1f5ccbbde5e078da8c34f1ed9edad81f0da531adfc32444efc5bfb5e4ebadcfde2e2daaccf3ecd2deef5b0ee4dde15322c65bc52dca98c9c2a97f3c5dfd6da4cdb17b2b38b4b820e09e625ad03b0ca6fd85fdafdf1957afa16342fca26babac284c7c2ec0195b18fd594bc3d2ccdcaedbe5018ac3c9c434c81d853378add180caa7de953abf6efccfbbdbeaa0efccb996d9838c62a8d6e0eef98a538ffd295dfdeac71448f8ad5a7008325da56f2fc9dfcd9fd823eacc8fb1d00bb57df1b3bac10fe51c4be8df2fb5dee6b4f80be4ccc0bf17ad4aecf488d6d2dae0fd2e0aafff243fc717d0ab094aa1d620dd157acdbcacfdbc15f1c419cda295d94aeeed0f4adabe9e8532bac6b799f87dbfc1f7624b5bd74aa272f5efc2b395cdd187a5b36ceec1984cb16a2db4a7abfbb0c5afaa3ce4acabcf78afbfc9beab74faa4affbed6b74db11766a09dc2d33ad43a1d0f65b9ff0abeb86aa9e741b84abeabaf1badde5a077d9dd9502a39bde08bfea3b7f15f6def14482fdeb56eac528ab1ae866cbb1c0bb3d6f4bc9dad0f89faa3116d393ee9ffffbcadcb4dda200e599581c3c9b8e0f3275c3e7b9bca98abb0fa456d8e0dea8fa8f669a0901f1f50dda0356cbafbfee84486ddd4decf2bd54a7c4aa005db8dae6a6b8aab47dae598cab66cb2a9fa1ed6ba55fe345cac5f9a98abc6e4ae87559cd4c43f7f2edefcd88b0332ff7ec603e7986cdeacd28c95d1dad17d21b40e308ac4c550f353b3bb2d8ad84c4ee42975bfbcdad1dce5c5b28cbef3aff1e9bafce50cfeb76ffdc6d893fbec9c5f1fff7ea91fdf1bf1e7e20915c8eef2abfcdaae47c02aeb8f09aa5d63ea0dcf7cefd8c2d1bb63bfb1e9bea418ebe7ea0b5ac59a8ee23ef8adc49fe2a5439ec5efbdc28bd84be7e2d8b4cfb3e58839cc0aeb9b3409ae77f301a124472bfd6bcfd3eeecf8c9fc780ddd0d55efe35de4a04fb17d5d450cb24bd6106b75843fcc8573c3fdbea87dd7cc7b58eefa02aff1fc1bcdc957ac78ff31db760e1b040bad79c38b6fc07c9638beffc06f0bfbcce91737f0c9c6fd58bbfbdeaee9822d3bf65dfdeb7c6e5fca914b6cce008dbce2e6e2bd77aefdc0a3aecfaa28c4eb3afb3fb8aadd5699b7002a7265ef94c4bc7c76de3ba2aa0fddd9b87d9faa3e00a1e3ffefe8e819c88c1a36693c2f1cb4fe9a60a6cdc416cd62f7d3ab2b93735e6750eddfaf4bcafeecba7ace4f82c49e6fd2dd9b60fcfbf13fad7ac4c1bd4ed855add69444f664b58b16de6b3702a1fb54ae1e8c996cd739af71fb7c0f97d2452dabfd0faf1deb7ae1477041d8815957ae0a432b4ce0ec9acf0cdd5fec9c52b30adb4acbde4f8d6ce7aad2bab4c804c60aab1bcf8f7219eb3f2c5a247a81f9de26c8d6dbacf26bfbe74ac4b36cfe83849eab505efcca64a473c4dc5bfa5f35af295b2ca1fe39fcddc2e8d802b2eaee3539cfa15e1ee35c8cdef88bca55486762e2defcb1d8faa5e4142ec02f7c73dbfd484e7f3ae84fab4f4e2cdf0117d521cc65ffb2a3a61913be481ccccbd5d14283cab2e0c84e52e10836e61ccccfcacb384bef09fcc8ef80e80a84f0bfddeab14e1d6fd2e068b49bfd85eb663a5fbdada4cc54f77c1dffdfac3dfb69a21aa3c528ddf50e3ac34a7bcdc4aab0d1af5f35d22bf9ffb4a6cf38ae4a8d3bfc2d8ef5f43ac2f0beb46f5f89fb1aa7c0e1eb25c63df7ee04ca27d0fcc3ac6ebfba38becfbb3477fbd3d9fcc005ebfb5ea232caf1108a6591507fda282c407e5f04e5db6e0aca68d3fcdf8bf87cd1139f0bd30ab8a684b7a1ee37ba7e2de9ee5af328f0afb547aab1fdfbfef2fbf5bf7b5bd9d734e642dc4a784ab8af0a58b1e39323ae571a9f10baa6ab53054df3dde6def8f3bfad61ddd5ee3608137d7a6fadc64db0d8c67dccd099ad1e7c94acc895a096f37ec80dc64b19f0ab2b60cf4ec76fc941dd4deaf4f5f6d9adcfcecedc5aa46be759fc0aa4abdbaeb8a0b1b4c88f2b5ccd64cb19ffacf50dafcd4d4b3f60deaf4d1e7918df14ef6afa2b0fcc37d9c34c8fd0a0f81df320599dbd974dabfc1d217eabfb0dde14a9b8ddacf946dad46d2b12ebba7dfcbd8d2eb5abbd9d6ebd7110dbee0ea4a2c1d9ea194e96fc207abfe4f15cece67d4e3edb30200d0ee4b8f310daa2296aab0acbfab2f900298ea19390f7c2c30aa492e4e34db6cf7b4eeca02142eb3696ecad2dcdfb35107ba39d0caa2728bfa6656d3cb3edc8e5f6944c99edf8a0fd2daf08ba3edb0aad070dfac84e0adbb00ed375bc6f16d3ff173e71bab66af5020ddeb003e1f859070dca9d7cee57c63aebf68f7c3a3d3c82d3ceea5db3e6fb96e5ece2ecd05accac105aa88850f59ddd978ea3c8cd7e21dd2a09ff5bbdce8dca9db1bfb1dfc77bb1bce521dfebf91a9ffab91cc3daadf5237b49febc1ff6e4e316fbfceee9d4be9aaeef8f6a276bd73117df1c0aa0620d5d8d98be5dae10c8aaec72a8edfddada8ed75a5aa9ad55b4a29e9e0fdc7bcfa5ab026bb96a55aba4ed76d8aca87cac981fee42bbdfca8a3a5b9e7efbfcc00297c05dddcffcd19dffde6eaab9a3f2d2f8ccfd63345be1e792d3caaa68b6aae644cfb29d5e2b3e16bf3fa7d1bcb0f7a4da1ddf4a8db8594b9dda9bbbbc4abbdcdef8d7bfa37fe28d6aed917f1764d96b3e02a64ac6722fbebffce58ed7682c434fbff6adec73e4921d0aa67bb2e7b4afaff4fcec7facce5b638d0e647e25dff09ba0ed9f4edef4fe7e570ba50ec8b1bafdb19dde9cefebd6e20b127e57ecbecfb1dfc010e98ced25cfacce50d924263fe3931c65e44fe07ac673695d67dce58c26cecadc1b6f8eb8f4f6e74a26d4ffab614a8697f0f30dadcb263b0a4afbfe06c5d33adbcbd7cd0ee1fcf4ea69b2df6dddfdec42efafbb8bb8c7cadcfee8691c9e3564cbd8ce252e89bb5bcf927dc88a2d517caafd3714b1cbfcdcbef9ae383ea8abc83fdc93cba3aa72bcee257dbf8083a7582afddaf645f9c8d75df0b64eff05c1cfdafbecbe82aafaedddb7ed00490fa369f0ba2105bb4c86f76a8e0ffc77fb4918c60230bd4e69ae0f6fbcdadb3edb31b394b6aaf9cd98de3d3bcd416e9bc4b4ca715cf243e6adc7dadf477ad0ccdbdd9b11c049dcfa7f2afeaecfa8d75daa29a0c392dd1bc78abd5efb9faffa81aeef7dd77234f67d403e4cb5cde5fc44a284bc27f7c625bb31dd15aefacea675f2db0c29cd49d9caeb8dfad54c817deb732a2331386b3fe7ed9d1a61e23aaab23c6d86239bcb0e7d3e8b068426e5fcac1839ade17b2bfcf1e4151e4dcf20f64868ac62fd4fb2cf44d893991aebd3d29fc6072b0da10c349bcacab9acf68c9dbc3eee6c5cf9219c8acb67dfbec8dbff97fae99d2546b7babbbbf1bbcc2ca1ae0ea6deeedddd5a179a0ae76b7c6d8dbbdd6b5c400ebd34a1cfeefa9a244dadbadd88897b8785fbb9ecf02aa5b9c7baff9fae80eff5b65fb35abfd3abd41f65b656cc8ffafadfceb2d3bbc07a694cda81b83bccae96dba47ebcae3ba52f8f94bbe810466e29f9bbfdbc6bc730eebef226b08dbe00bf0e96031d848bd64d95cd39cee3b8b9df6a9fcf6b9e7a57b91f30aebcb655516e6bebdc92de2bd52e9fb9eb8df8d495edd14f1eab5a9ece6bcb9cbdefb54b54bc0f7c6f68d5ed1e9bd4dcbb873f1cb4e4caca3eef4aa12b068acfa0af99f37eb9abbfba4f1c9dcc1ee8c85da474a9f067d17459190f36be06accaa735da27fd9e21f0d073c2930cc9b51cddd81a12a46ef87eeee1f1aa94fb6a05eb8b7d8fdbf6da32cd62104fbaba68b3ec6f1b3c4ff9d3b2096cadd097124ffce3d0bb11cb3b102eeb55d58f416ccff4b10e32f64527bba1bd3594abf0775c283b93d4aace47dee1a040dba4e2411b36bca3f5cda62d1f7ab0b207ff3798de8dcfbb49f57073cdfeabcf5beeafbda781872583d6e9bfec143e1f3d962a4eb75f94abbff61289ebf0bbf4f6ebdeed64bd69a4a3fd83c2b4f211ad2c221aa946adf0e7ff0ad732bc3ca5be41ec12ec9a8a458fbe5956d3b6c72eb7dded5b32ff4eedcbc9c2ed4a6e4e7ea55bc0b328cdede49ac8593faea41bffaea7ae0ab7c2c6ae24f409accbe0e0fa82091f65eea6ffcbad85eff30d76d9f8c40bc8b0a9cf4c73cb879b3769f05a76c2bbb3eddeccb0efd787ac03dbaaba888a2c56abeaaace860df96b4fc81d8bac1d1ed18e8b30c6ed7cc83ed86a42a5e618a6a4beaf0341a66941fed10ec4bd7b40cef0cfb6f05deee39cb2029d0edf3aa961bee2fdcb9bab1e4faa62b4fc50a8abe2f6de3ded6bbcc612aafbc28b7b11f9dd7167ce91b7cfd2858a0db5e03ca2dd4fd4ce1b1a7ade5cfe2fd67070921587a76a6df54a2e589ae0b84a40dafb93d074ed3fdf5a1b2ace12d0a65ddcc5dc1891beeb1ab2dcfa6bee5aef2ab3a68224dad417023eebd3e4af66344c7ec0cde7bb5537f59caaeb2814fdafcd1cff8d745a9df36f5ebb9945f1dcfc7b1ee8bfeba17ecb87dacaebd6fcca1ff301bc0adea418d8fd2defb3bb43cf023d5cfddccf602ed7dd68e72da9e36f733ecd8fee8b66405abbad2edb3cadfeec9c98718343b7aaf53c71b7db55fb0cf1ff3fa0db7bbbfdc78bedad4f3ada02caf09e3a7dc2cced03e888e2ee20ab2a07a9a74a1afccdd84edefed40ad1abd62b7dedb954dc8e0d2dca88e31bd25aa2ba2c2bcddb0cfdef9ad614deb9eec159feab03392feb376b54e726adccd5666e8fdaf130b6f1e2e472de3ae16adfa205cd45e6c67776fbf6c75daddff6bdea24e3b7de7cf2afc54aa270d5a562480ac91fbaacbc7705eece6fc6116ec3b44ede8a1b261b1e4becdc594143f9cee740c599cec1ca81e2eecfcfee3aa0bcb72a8e7e3c6eed27e024d105ae7c5aaad45dc52e45dc0f253d77e47d9efaac6686fdca6ac9c52e0f32a9aefea089faaab0cb24a02ed3734ecbefe69ebee1e73a7e4f3cfe7f7cbfed33bd333fca5865ebeaa2bd8f7af0cd83b31e04f4ab6deecd56debce5aba93213e7f9cbd632cb7886bdb84eff7a0be63a857edd544ae9c3f89b4125c6cc3ebfe3cef3f7bcbb055a6ab22fe80c61ff96e0fcce0ec34ac1ec84d59689aff6f38cdacad66d7ab71c26d0b77ecc9576e5f4ea14f4c0dab7fd04d0da4eb7feb1fcc1c82f17e0f5bfaffb9b1a5104741f6f5cd6accada374a7cebe1859adc03cce17523e9beea0cc5541b0e0bc1ff7ee969abcc6a6299cafbca7606ef733d8b10676ddaa7d773cce6ec749df6a9359b4bdad99cfff931ff407edaa02733d1edffdc625db7002c21fdbb9e37e51a527c9cf93ad8d3d1f5244cf9b5b9fa58fd4a989ac6aaa4c5ed4b631eadbebfa3fa6b110deabccfdd7bf3cacba6b38b3c2d50ed33627dcc6eb576b15e13dee5dea5c3122b0bcfde7f5dce3bc12ea2fdbdd0ae2aaea6e3a2f3b9d1e4cf2bef0e5ffa12a66ee36384ffbdb15be5bcba1fedca17de8d60ebcd57cebb1ec4edcd7ff81c5aa5dc3bb721ab578ecbc234eaaba1b8aa7fec1db84ffab703ef207d4acdcdc0397a5dcea50bffae4cf5e2f55a0ba24afb1eafaabe0dedecba7fbe3b75b1df1caaaf384a57d94b0f9b1d4ccdbae72dcdca464a2ba26ae6cd1fcb7ebd6ba1dc6d01317fb25cb4ab419f059d956fdb26cdaa4db8a8383c91c0dd253887ca19aad7dfa2d29beba91b9122605b0134bb51484bc2db053cf1fe3f7ad5d7c4bf2b71bfb1bd35cfcc7a3ecce9c608fd3270cf8385f54e9a09cd7ced7b4f307ae9d4bcbcbcdf82c06c0cf8aba115e35fdacadb2e45f0bdb027afaed2af1efebd95bcecabda8efebd71e2be2c0d1f3c22d2cf91edc297592fec5fde8b038604baf25d5dd796c49d48d2e9f613bddced3baed86f48c9ac436cdda8f169cadbd06773cac934ded2cfbfeaccece39a50e09fcfc9cdd40a3c5f9483fe525e8b9d1d513dcc43cdac2ccccda79edb0c2e66abf94a8adafdcceadaaaabdc65fc1a88ac6dbebab0307dfbbd8d021f8dff58b9aa1e8b170b660ab5cee701a9c1eae505b623d065f30fcabceb41b69be1bcbecf051feea8f4f02c85fceaa4c0b2d77ffdeefe4ffb8eeaf6daa4f3d72bb6f6aed0ca1a32fbd03e5ae7cdb0ae3e60fee6e3dbd98c8a0afe9404f6adfc23c490f3ec473fc7ccbaedcecc15e6e243d94bf643a2fbd8e068d9e38898876116a4ead75f8693771cbbccf470b7e1eba9c4bc7eaeb37625c0e9ff6ef48d5fee72beddd8d0fae312dc6bb4b3e2b438cc11be4e88edd520cd252a45dbf0fa9b59fab9af14ee48deede7a41cc2151b51b30eca2ca1c5f7fdf0ba622d0d859c2dcc76b8a372a35adf6e2cca7a431ebb56379f9415be5ef8d37b1ac59ba95e6a5ddc82ba7ecbf1cbac1e47fcf32f3d9dfca331edeaeaacea846c8d666c8fa722320723b9ccf5abf0decbd5d1dbfdc63ef87e2b9e3faafe6311eeab031c6d5cfbd5e2fd4a4ecf2e7bc3aa35aa1fc13d9ece5ebbecf23ba66bed3deec69fab8ff857a7b46ccf89a2dadaf4935f7afaacbee46fc223f9c4f54af7eb5507fc1c45bddf97a18ff486aeb209602b92704e443fff5fe767cdfdfeadbbf3f2a421db7f331587cce7d175b1c94ae592f5db2ae1eba048cfb894c7b37bbd00ce2d1f0fa11abff5e00a4eb10eadf9f48bf91014e9a9edbabfebd035bca8be5e25c7c54f41bfed033ed6c063de4caeeb04be56acc109d14cbb5beac7e7b12febf39aba644b0f20460f57ed34cbab4f2d2db0dd5ab84af3600c1da1cc1c38a9a1c28d0fdcc9dc834bb899c5dfd656b15bf5a66f92da91692d4dce39c0b6f8ca5e8951af0ddb7da7fa8adcc9f7aca4bbc542fd87e348ad773fa51dc8b010aa459fbc77de433b38d8a99f7fd89a5b426d54eabbafc30d1bb8e73c25b6b8ef45bfcdf13d5c6dcb1d1dab8521cdf7ce6bbcba9d43d7392b62e18e3a6fdfef791971818b4ac2c61f1dd13dd780d3ebf82dd2814d4dababc379ffdfd4d1d5d1b5b892efaa9bebfaeca643ea36ff77e3f130831cbded1ff56ab6efa46e0b9af5c89dc9df2856850968d2b409a6444156e5827fda8d52efb1edd8b5dc0cc6b4358b1ccef13f3ffffeaa754fef89bbbb5f52285201cf948bccb741ac0cdbf0caa2e4cddffffdf352b15864836b5c0cb4ffeb9513255afcc55faccce9dd605118b899d38ce9bd8dff8e64a2bcdc7afbd380d2d3a9ddf3029a7a2157f6bc495d8bea93c7e17ab1ff28202cba2e8bfbe7c4982ffa7ca4d8fe62bb3d2b396fe83e7fbefefee62da9b6dd0a9fe5dec16b3cccfd7d6efdf0fce7f34efdaeae204bdcb611ccd1be4dd6f17b0afaf8ce323767b6de1e0aab3d88e862feee84afc1caeed5b591d9fde5a5cdc48481cbafa6ccfcd77c2b2e2d2bcedb9b04ec25eedaf79ae25c3f8608ffcf4cb7d2ec6a00bf94f2bfe4c9ac9ee36dfafdec929c3a29dde2b99f66abac702917de766e2f9637ec5bbfc3cb8cd631a3eddb08d8e31e6dd0ef6631cffb77f1fe3db1ec61da5626d9c2e76bdb6c1e3cc0488a79beeebd58ea545a284d4ee3d3c284d4eaef2deb7cdc971afaaaf8cbe39fe3e2aca0c1ef6dd0c53ca6bbbdf47dcbb57b36ac5543b103258ad867b22b790be343570b5fb39acc28b2cfc04c89efb46fecc4d236dbcfaead0c2341bd6c23c0ca741d6e6f868fb60ecabe04f8332d3c4c09c321596beeff5d6ae9d3e0079a9ec5e0eaf1aca1fc8534bc9d058ebb8c02c9b77c97976e71bb1eb9b68dfcf35a3941afaf9acccbdf40b7ddfd8ee78351e9539a3d2ed47c68f8c3946efecafe450d584fd5c123e6d27a123d80cad8adcf6eadf5fa09feacca4713fbafc285b4bfae8bafe4d28dfe7799d9faab7effcfcdd9f86e31ada737d4ced2786d37d0a5fe5b9651bcff3b131f7c7fae6385b0fa95d750d17f508189d115a4cc1f7cdcf0f5d7a01af59203a847ee422ed0e8cfc79a52adcdeafcee9f314db20a262cacfdeaba1bcebf37b9a9aa8bccabfdcdcb55086cafe1433e42aff35e70ff591282bd9d9e3dac7e8eecd399bab8adedce3ebedcd5ebcb96fdfd93c7c6073f57cf04efd83ce7c594e5fc0a0ba399fdfaa45513fc7dd32cc0cc2ecbaa98dddff646aeabad1c1a9a3eba964e5e4bb9c53ac9ea65af02dc7bfd3edbb97cf9eb0cffe531dfbf3eb5bd6b051c45d236ab24d5e8c2f8d8c89e3fcbb9d5110dd0ca1562b9dcbd809a2573b9abffabfd2d22a67a3a28f5e7849d2bb83a4fecdf83d06acfba0afe8b70f5e630baad1fbb9fa9b31dedb9bc5ffabebe7f4f36b0b7e05eba8cf4e121cd7b8ef4abdc22f0cfdcf1fe1bf1aaf39b68a788adf62cb1fca3c0fd975bc7918dfd98ed28ba143afbba6ace0baa7db29c25dddb0fe6a89e5dd43d8b2190c2a0f09fb2c25d729c2b16a8793e1b697cd4bbee879d446f4e87cd933faa0ced0dea7ec24bb9abd1edab58edd24c1ceacd771c7c5da7b20ec81c873a8eed4f5d5aeddd5cd043c41233bfbdfb1e0af0a663bdc06e2be9f02bb9bafde8cc9efac9b9478add0a92a87cc2d8bab313b24cfdcec2e8df6e9d5384d69ed40dc2dbc61736ac6df1f8dd1d7c9c4b3dec9aec7923fe73187c0a38bd5dfbb191bbc476eef3a8acf8b7dc22d8f27d7adfa8330b94cafbf1cafaf05bf936a5e887d246a8a4b9b568f777dd61feb886d76d9f06e0d83e6eba2d4eb4abd3eaa6acc81cbb89c7a09fac8bfbfc1da15c162f1deed7e0bfce2057200db2cfbdd9cfa00e839abdbfdbe2a5b3edee20b9c6cbad9ff5ac81c7259f5ccae5cd587cbd4ccdeabffccb4ffd7d10f0d0cdb6adca7d1302d1c39eaabba6c2cfbd5ec9a5e05ecac1d0eaabf97a29d5e8b00a415afc3a22d1fe0f375eafc6afa5da9c65bca27eee0d718fa2dcaecdadc0c6fb4cfaceaac19eabaebe6e2ce3a35747fa1fcf7eed0a3308c1ea8fefb00835ab10dc93a5bbe1bae99caec1c22c41fe9fd62bf400d91e07ebbebcaeeafeac902aaeac23fd516fd72bafd0c549eafaf5b70a978bb7aeab74cec0366ff8aa8e87a9f68eeedfc63f958d55e0dd0dfea421adaca729fddc4b2acdf8bbcd4267bd18a329d602bbc53a28c71da9ee1cf6eccefcf4aecec76ed64acbfcbbae3cefffe4cf8ddf6ad22f27fbdb39f23e8f73e3a3575dbaf76f45bf4dfbd5bbeb7c8b82f1d4ef50ef97d8dbaec38a3801bad96abeeec398b9da4f7a2b8a1b3ffbbfb50dfb0a6a4ba512eab0842ff05d9dd2104f3c208a09cdea09a5d74f9934d4e5dfadaacf4ab47baa828de7cdc6ce2ae28fe1faa9e30fdf5dea2520ae4ed6a653defc8c0bb56d6bbba2bf84482ecf573690aedc34ef2cebddf574b42b6ad6d44761ffa481f609ca42ebe493da2bebcac4dbc49a8ac1c3aea45c60fdca3b4acaaa219a53eb97bb7a3b6f1eb9cfdcdd8fd19846fc229b2bcb87df110d4030fc8bacdcffc64cdc285dafc498fb7ef4d2f1bdcf9ba9dfe137e4e3bbffffbe15fdefefaafdfbf3df8ec5cde99c3edd785f80a5a1eaa0f7fbf925e8a08e0dd111c8a9abc4e57ccc9dccbbdac15c0ebf609b46afa5d865bcfd01f6bcfdcc0a8eafb24f4b264ea63a2fed34f1dbb618cebbfaa22d8aefea7134cb804c6f5d693dfaeca6ef9a76b3eb2beeafc253b8230bbb8abfbd02c2cdfd5f6564efac9cfb6dec7e52848a1dc8dfcc400a190b6cddc1743255edb2dd0dcd3673bcbeaac0facfe941f59db2dce8ae180262062b69f1c69f77dd6a53256fe4ed75ae9bc06fddcadff024bc7ba1e832c2bd07e2f619afdd5bb0dcf37caabb0d3da0b2bd63cbf6dfb058c18df2aa5497daab75bf1ccd4657ca6e01ddfbe2c3f2f383ad3dbd3d4dfe82a7d0f92be5fabaeedfe9cbdf8d08fe4754f6eb48bee5a1c5cfd0cc1fe8dcbcffa5fd07509bd5803f50cddebaf1befcef4385d51e60f02aadcb85242ed55aaafa71bc4cfbcb28ac9112edffa0acbb29efefdc0e9ddb6d58aacabbaaa75e3fe0bf823ffff8a2d3755ea1aabf67e8a2ff1bcdbf4bffabfdb110b574448fecffb4fb08fa36c07fa0d5f2dda5bd9ab8d7ecaf4f6c540dfd76b8aefe81cdaa86f64dd406ad632311fde0feaa1d0fc2f3342d1de8dfbcf7b42a81aa6fa4edf493feb6cd237c3bb27b9a05badc40df0afa11797a737ff2f85bbe80dcacccfbbdca9df49c47bb5cd14dcff346d294b8fceb729686bbcfdabfb0d0eef57f592811cf7fcbac4ddff38bed58653d5d12cccbe6faacb03e2e88bc8db0fb1a8aa1c6e64cc09672caaefeea15cec89a0f4cf2158b2bd4cb01ef7c9a9733de4df1bde8271bdc4ba72ed8ffaaf2d1d255a4dcdc2b7eccbbcc22ef93edfd0b4c3edcc5dfbea1f5acecc8ea276a8c63f97d5dc46843c6d2d57a7ecdfd8d84d6beefc8e0f991ce39c70cef99b5ffbb86e6141bbccdba1837bcda43bd39fe3caa7d1eeccec8debcacb3a4a6df3fb6bbcc3866cfdbea514329b8e19bc0bb2efbee0bbb4a9eda7accfc1d55ffccceb0dda6ee8ded20fd9515bd53a4e525db6a2dce0092784560b17b710b9aa3ef2952bffec5a5dc99e3f52c0b5badfbd8acf4d5736ffe9995f4e3a3a4e6aec2bfcdbad9cbfdc51caf32befc6a15dc94a336debca3b410cafcb6e9abdcfbbfb837d953aaa07d2d6fe0e5dddaafde7cb696f5a8f3d0cbaf43bc5265fa3cf4e8cfe8d11afcb487dbdfccdfdc1511a3fff35b938df13ee9b5c9a6ad028a80600d4afecbbe0beba72aee4b0035ddca68d29c6c7a3fda9beb0f66b73e7cd3aa11d160d2b6471417e467e72abce0a1bf715fe9bcaa9faa0fa845414aebc2effcc17a6dfc1a06da2a8109b6da21aedacb8fff05974c25e6a6ac9f5ceaf1ddf28a32a75ab5a9df1afc01dac1f4b68cb2ebba2dc261e9a1d6fda3fbdb1b4b6bded2be1865f8c6cb5ce93e2cdfbfebb68eac9de60fbc503be7eff7afab362aee81cde7fb7556bcbba6ba9fe3bee5301fe342eac2a33ef0e4510de45182e3e3dbfbcbd953d5aeddda6fe0f51d5bdfb8b9d4f5ed4cdcb2a032ab02c5ce79a6d2cb7dbfeafd9dde4121f0357e1ddcb2daaa6b28d1fa65d5fa1db9e3bcefe1b0b795acb81acfdbddc6ea5626b3a3baa02a12df6fa74f1ecb42ce5c6f0eab6d4ff44601aa8bdf21fef6e21765dced297cebaadeeb2ebaaedec0caceea5ef0ab40d9002eeff4acac62f9dffee0b6ea4d53a2bc26cf38c714ea086a182099abb44d8ae3bfb4b4aba10a3e5a7bf179c3e22e437969ffd81aae83c6fece59afe97ff5beb5c4d3a7ed8b04fadbbedf004a2af07dfdaf5b7eccb825e5e1e6ab68cef1b95e0d3dca0b9b3386809e44cecdfdb50ef76c55125c6ad0a93bedac282f84efde455bf2bc94e26dcf2d1e5fdb7e40caad6bf01faea3fbffb315a588958e1dbfbb76fa1b4644af27a43ebf4607b3cb4cc01d8fa1d2db3d39e1eef1e3cacafdcdffad1887ac0e596e8ac8bdd0abfee1c4dbd5eef54f98d4575e42676eca83f1acd12af2abce9d4dcdbf1d31cd09b41deb577d265af3cddfe0397b5ab7f6dd9a1eb2c2fcbc5ecb36b0f05fa54838bdbd3e6e5cd96be09d9fbcf73ec964e6c19ad3949209be9b193df97fcb78bce9c8df790f41eca7e7d04b7b8422af2a34b27d87b51fcfcba1f2ad88d57b5dc525febda4beaffae63ee24c3767b3f22ba007bb3494ebfb15cbbf90bc090cd6d5bc951e1db607a533148d8c4d5aef4ce3a8841cb9ec6c459255ef00fb4167735070da5dffa5bdb8b85cd8cd0bffe99bc617d40152c9e74cdd3eac11e8072dcb5cf5e5ed7ef8a7f2e25020db8a82a59a362b599a1e3e63d9b845da3afcb1160bf227bfdabff2248602d1522c5fe993460cd1220de1dee42879dde457462051cb6c5a5dbbbade008ac9bb8f713fadfd92d13eaeae8cfde8cc4cfceed577ba31fff8aeb2aaeb02a5ce45c8adaaef7664548e088ddbc422d1c46cad2af5647df071060bfe95fc565ff744f2dcae5baec2b7dddfc1ccb06ce8f1d6e596bdc9ce51418a812a0359bcc4c16be6beb60cbf3876d42c91db3800e24aecb58a5a3e2e2edb4d7fe587d4848f53eace3cc0bc96be4fbbd0d13c63bebe198b0cfbcbf935cbded5a5ceacbf6994db248d04abed42688adbe83a3fcbfc4faeffcfc26a558baab9390db9fb68ac1df8721486c77c0fe375a25ebf9ccb44feacecf19c9b350fedbd7a4e77a2caacef4243b7b1f0b2effc18942ac4d7edbacf6aacedcdb389ebfcec63035c44ab09b3acefd0dcedaad37aceb92debf1fcda5afadf997d874ffc4b8bf3ac2bcf4effaca0daefe2ff2a496bf5a8dc4da4eeb93f08bdc9507b6128ed0c8751ed465cd653ded6ab7dfebbbb73edb69ae024d868f57a1f227d60568a9eacd39c4caef072f6b3c05eadf015fc06dff465bdca65ede49c3d30fcebadd0c9af7a0e177f81510ccc975470abf9a1a44693e798156b0c63efb3ddc744f457ea2be7d31eb5282db6298d4e6904029bbf9aecb43fb1f464aae391efe7cee6ceae7685d50503b9fcc7146b4befabab24cfb2b164aa3ec1e046b88e54dfadfdc86dfeaecfeab72fecc44fb6acd3f07cc9065c3afab0fbc6a0dc8bad5d4651c9adbfeb36e2b42ca60cbd4f30f4ee4770f1dfdcacab6f8eac52df6ac6649dabcb8de9c5ee5af6ea520debccc0f1b7ed599c96bed32d0ffc5d1e0862d79ba1d5d531bad85bbed588ffebfcf6b0ee0ba169df02ec1b6d6bc8bdb1fedb2abd0ae964fefbb5e3700ebf91d01bcef09cdfffc20e612ebd721017e6494d0a1dcf241cca2a43fc234c04b6bef7be779db6e6cafbf623eeffb776adff483c13ee2550fee6f874bf1bebb9843be55babbedc0bf0c5daa39bfc7429b07f675c707cb83d419c83d6f02d32531ddf23708fb68fdc61c96ac99eaa828de3d0cb02dd5fcaa9518adafbfa052fc6b9e8fe94a9e0eb420dcb320e6c5eea7faab2ea372cb1f90908f2d8c4d3d8a99a5dd6abbf90bbe610b5bebcb85d59d3b4184f474d86ed4ff7f1b9ee4ecbcff3eca267cb1adab3b00cb2e831cc283cefcf797ed8d3286b8b2241dc012e89c8ffeeea7c8e11bf9e9cabe6d1da00d5f5fac52cdc07a8028bbfaf911f0162e0aed492cb33ede16e59f0092b730d1b2c1b1cd63ead3e3a62e3eb1d5eced5a1e842da5df3bfdf5a12eabcd44c5968fbdee7c8b669d5fd7f7c3f44dd413e1f4c3b18d75aaccba743c1fd95fea324a25f2cdff8fbea9faee42c56aa42c56dd5989e625dff5075e87cf8ff626361cfce86faef41e0d7dcfed59aaec566f9be1c05cbfb74c6f3a3fac83dfacc74d9c91a02ef7aef08dff5e6ee95e5afed9b14ac7ad76f31afc2efeb632aada7524fdfe1aef8dcbf39aee3bc6fe553bb74adf4e03c1fdcc2a024a53ed08aadbefa8bf62803d52cbad6bfc97b2e9bf80fbd151b9161307e310efa6098a6f9bccb44d82d117c3ebfe6bbdcd6c4ef2fc1abe905c8cb87d5cd7dcc7bd32ca6dcdb44fcf78fac63df27afeefb23baaf665fe87a5135c05ca419ad028d2dcafa05bcdcdf5a0d451104876b4bae4ae3d60b4abb0cece374846a8bef74ddba62c788fccb63b7a9bbea5bff539bfcc6983e7fe55de49a81eceb3df786a9093bacedcb7f43a36aaa7acf57e7fe38153b4fb03dead5d3a9bac9b541da2dbbd15eab67192ed0bd135ad6cf58d8cbf661d63182c332bf25b1f95c13afa6bd7b6abc41d54e0fbf32e07717d7cb440e61cf671d1d64b066df1320757e73088fcfa22f863d0a8fcfdfbd0e670deecedd3f0085f16e6b55ca25dc0ef65c1adfaf5169a12dd0b96cafbdf956edaf7ab76fa35beb6e3d349c9fd3f8bba7f6eadeb1a5eb9f9b572f4afa06fd3ca2493f22d77ebad578ab184b96fffffb4a7b1f1aab05eb414f4d0aad5cb64b05f15e1d94b6b25afa42b76de2f9308ce0feebd810193e52b0acfdadebf16f04ab28d6eef27ac9bfb44bb72ac6d91f6b4b8ee2d96123af5b8ef191bcefedbebabaa2ccacedac0860ddeedcda6b5cc69b9fbcd2a16ff6cccbc10e1ecab1ca7622ccdd054b9cd7a3b7d400a38ff2a85ec5cd3ccd8ebf9bacefb1f351fc0dadeb271d44d946a01a85b6b3a0fd9d85245e7b67dff32fb1efcac7e70d8934eccd0a17b3c2a8764b2e7150efdfeed7f91b64c623b36f0bc67256fddf0cb2ac5de80342f2fee33dbac16f5a091c11bed1f28decbefefdbdb326ccd7b6a2e92a1b9dcd9245bdce72cb3bef2cebae3bd3adbce12ece60cfd2bff4acd61d93bbae5fe77cc3ae9dae6c24e46062df8c6d8fac39499403d52d0e6052d2402cac1aefcc3a5bff476fab60dda2bafaa3dd88d692cde151ec13dc2dd69d0285d9c439817cff3dc6d030c973cba7a7da475d2ed99f9bcced21faffcffebaa82bae4afba14f3727ca4b487cfa8eedb2bd4f81c3fa9de9359dcdb9b580faefc6f7e080baefce6c7fcb72ca12829fcf70ff7b691b17601ba7d2f9699fde7312b52cf80cef8ce247bef6b85fb0ee1a45db5d29af810acbe519adfb5abedeb8dedb400f299d6c6f6efe165940fbffafb852deba608b1d9fe76f4fda2cc053aba30c399d7dcb8344295eefddc99b7e9fc5ceead2ae1e0d071cdab5c5c7672cc6a690897d29110c6e67bc850546b5a16ef4f7dfab05bcefea207ca645bb70d95dff947c78ebf037082c743542ceedaeb6aeedfe2cabf9e0bd2dfff60ebe7a83dca3d307b2b92de270e415d7cca5d5d49c1b17c22a98b29493dde20c881c1c83d67ead3fdf6d8f0ca3cfbadd975cdf3aefa519cfe6d8b9997dec5afff36cdde81bbfc27d25fcaed0ef6edae22f05dabebbbffc8f839ccadac7aeb88ba1f0b951e0aac192bf0ce4879cae25d3d6ca7204fec273ac4fd66e66fbdba0c50ad44b1cd6dddd4b61d6e42c3bd2bab90dbbfa0b4ce849aeca95f1a032a1ec7606d52d446f1da8f6bf3bfcbf1e16f9f8668c27d2912947a6be4cd10495aea222532aa8ccaecded4fdafcef4d7c62d9b661211efd09bf1fd6c70cc76e986bbeeec4dfb80ea54dfefc0f3ab9e0d0e84713a8d716dd528f4e0fd67aadecd0ce6eabeed4eeef3a873c9fdaa8a7e280bfb96e6948c1ecea24405e45076fc4aa3c31dd449eef8aa1e3aea53ffa70353efdefd7eb670f39c38fafbabdc6d1d941fede5c42eccbac68ffc2d9fb34a50947d987e5e8cf90a7cf3a5f9f6ffb6cf5ad387ea7eb1b9bcccec8ed9acae8e4a0e51a5b3e2641fdf9f5bbeb523c56a735ece68ded252a0aaffc05bd2344d78e5cb8b5661fb0bb91aa32dca92ca7b9eb37c7e52f6e56f2bcbdba90daf01ebaaf3bafb2abfa8e5c6fac372861c42ce4d76fb4c2e5179d1b770e8a595b24b04d7d31e2ffcfbd0be0cdebfd72e81a66ef915ad757b42eb809ded69e718f4b31cdddfc7ad3586767f9936fabdcefcdbbd8bedc8d6dcb0bcd2ffceccce39fdfac276be263eaefc603a0ca5af1c2eba3b6b3c82fbb0badec90edbe7fab4aeddb35fb9eaafeffcd40c3e078df5a6e7abde4bb3d4cd3b894f560c59ffedb1fb9c67c4c534af9011294deca5ac1b9cd63a50224acc44194fd0ae7fbbcb8f4c8e7d43f6cb7aa2c821b17fea0560a4ad0c2b42d6cd8ff33cdcb4df5a6f88af5cff65ed81e5cf7c8bf57f536cb07a8fd78fee314f6f8b712a5efb4c75a0cae48a6759199036c3ddedcfde88a967f8eb9f2fb3bf52ebffdccf41bf2dba3afcca0b66ab3b6eec7dcd2fe0b194d53e6ed92b3adc22afaebaaccbdb6b81428cc56dcfc1f25b76cdcfbe2e4fca04831fe2acbd96da6afd1f5fadb3bd9e1bcf3a1bc02a63fefdc4369a4ecdf24f9707f81e0b1adbbbbbf6cdbb3dfbe8f2f2f21f5bd391ccddaa98af8ab8caa3e2a8af5ee91c39b2a4ff04ddd01684838df9eff7e422bf3070c9f3d83d0e32bab6d48c376f68348c40aa5cacbcec17ef3a3b9d4f6fe5aaecfddea602616bbaf2f1d1dd1ecc9dbcaea943c4faa55fa703dfd00e678ff279ec7b9be04adeebcbfcb3fbd2ea476dbd0b1e9b604ab4f3fc1fe4343adaa5aa1e9a5cf994eed6afeda5ccf5662dd4a11f6c3d42ea9fc6d7a1df6b974dcba5bf34ffb1f7bdf70adeb763ab40b5be3abed45dd4fad86bcebdd3dbaedd2ce0ba854e880737d93b24d7e8b2dc369cbfe0dffff86f7f83d4dcc4da4cba9a446344f10bad8faec7bbfd391e1b70e3dfc5e58ccb5f2009ce0a9cedfcbf24f917aa381f86f53fe8ad0f597b2dc8af24fc1511a7162fa68bee6d39faabbdf3cd9e5f2e2d7e8ac6fef9a8ec64d6c3c5cafb1dc4ebcab9cc1aab297a3ebfcffb0fe1bf2731f02a6bf64ab70a89345cbe45dd3b2aa68c0f2adf415abffbb72bd2f95b1bb26efca5d1ff5bdacad9db8dd8d77e9e787bb7a88ebedcac8cd0603f0187eac2ebcdad36bef9ba0e718a03bdda00fe0ad2bd3b1fb3a24fb6935645217b5edcf6b0f67f1b4ddd0a44aabf2e5cafd58aa4fb65cabe90bbf9d8ae68a4d3dc1cdbedf5ac42a3a1f994e4fa2290653bc9d18e0cb63145efb4cca20fc418b8ce8ff65fdcd326e5bbe1f02e8388c2af5aef14dfeb16283c2f3d82cfcdc6afb93f96e8ebec7a54da9f1cc9922ed25b8da19bbab3c8358f6fbb2fa675c2e07fd53a1b14bed6ba31ab54f5dd53d629fc6e754e24e8f67d5f73ec3a884becaa5f4ed85f2afd8afbdede830cb0ff1ec6ab1efaca4bafdacdefd310a4be3d193f9c8ac27b78abca1ccbff5849cea3ff500b9f4f4bea7d64dcff2de6cb1f8afbcdbfcabaaf667e817acc1ba5de80374ae1e9f62eba2e5b7ca153c2d3cbb58f4bdc8acdec5bcf33f1dbe5e10f5904ac850dbf8feee147efe15cfadef43def10393355da1bec348b570eada01cbeeae6ac0fc5ae20870df5afba1ba7b7c2cd7dbbbc248e36deae8e9e7ba36ebedefd45f81ef42413f9d4c7b1c246fb4db57e66e8dea4efce6d45ed1bfdef25cc0cc7a8a80b5270ec3d85bd8e9dcca5b6ed3efaf0c1eea1537ef1f4f3272e2ab03c9d382b14bcc945718cee341be34a0753e2f32dba7d3a35ccc5c452cc74d86d9342b73a5b033f0257222dcf9d2bf75a431c5d92bd8e5584d4aa8d642f366c7aa65bec5122ff9bd59c7cfaebac669bdced61fd5e04b24eecf4ff7f55ebb1bab01aa56d3a1327d43b593cffa5f2ec9fab8918aeacb34347a6f47ca95b427bdad7cf1cda2f3e358ffad12f26c18dbbb315c2d5ccaceab294ea118f9cece5cbafc1c53fafbae4faddd1dafe0d2e507af4b10eaf49d4c3baaa13eecf68d88fecdf37c0a4dec43daddce7e998bb4cc15cd8dd5c360b1e02b60a9dab3ed3c8feaafde6e18c0e17c38d3acb7ffa3d1350b0fd772430e9cc282ea7fcdb1cfc61d6cdc41fc0f33b2bf1dbed6ab42d559abaeeda38f2efd15a0aedbe73c13c46555fc1208de24c3c8ef20c9dc1cefd959c8305dfbbd7624c3bfa904c5889cc9cffa69d4eb7c5c4d9552293c1dbc5b4dab04063042eb7e6c25ecce02e3ae1fff1712656a5aa16ff62eadf61afbf56ddd9b72badb7d0c07cf38c338ec58eb4ffae2d0ad5dd9a31c664d5cacd06935339df476b9db9ee8dc9d8cf6d7532df2891b51a32dcba7c3c24a5dc4de9bec99fe24999c2fbef16cb3e9cbefbefea6eaaa0838534a09aba02ebec1bf319bef71c6de3bdf5ff4fdc9c93abc96a4b9b5341cab109db83ac4e07a2ee16bbb4f82b65e3ebcce7681fcbdc4b9d756fb09dae23b56b2d1ca261ead6972b5681f20b879f9b1db7ce559e2ac306633fa98c5fb9bdd24a6a0c54f4739ef7e462c2abde8fd047a78408ebc5c0a6dfe2fad8dd4da85f019d2f5fd4b3e57ff1e896dce2bfbbef0ffee7eabc117bfec2e0c0db639a5386bd74a0adfef759a1e0a9aa7644ae792e8d1ae40c6d3c2f6e7213c56a19d1ee8cf20acdefefd4fd8fdba20b44ab4a1ce3f0674e0f9dd231071efde77baa12ebeefafec5cc977cfcf5b9a4ac9e09bb39e77cff10ecfc722f5c1a69ec584aa4e4f3243c25ffbc1ee456c96e90efddb78155ec723d8b77ddc2f279eac4adbad030c9ef1c3aaa74e5efa6bfee6076a6cf8c2ccbd0c4a767eabc8ad3def8862eebd23ea401ff9625f20e4dcbf9482a006cc8fab7bfcacded3dde17ffdbfdaecfc2aaa64d0dcba201acc3fdfbe9b3c814cfcfbeefd3e071a9f5ab9bc93e91ea130234621b1dad19c946325b04a76d2a1d09de9b4ec5cc6c49ecbfacbba7fd4ecbc07ebcfce5bf8bb5615cace5b17ef09f04f8db9eb78c0b23c4eb1cbd3ca96bcbfff63da2f5fc5ee4bb37cacf5d29415eba5f2d9bcd9c095b16cfbdd08fedd6add82bf00eca2f9e8e902db8cc8ea6c32a171337e6e54276d3faa8ea8daacec316a71e037a52c0402bc90fddacf3e4dea6fa0edf9167cbd2b8bb0b2c99e964ec5cb9fe430ce4b953de6aff78eff328bcb1ccd48f7d5f0ba0aea36bde44b3aed023176bec2e49f36cebeafbb0bb9f0fcfbaef390bca2b1bdf012dffd6fa4c8fab91290ceea28965af132a08858c05e6eb20c5f1410cdae9d49b95ca113c74df6e4f09251bf9e1ec75eab3d6acf207ddd8fd7f6a5d793468c2b9f7fdd9d67c29c98dcc51566b5b42addec93cfca4d34c27df88f0d9abcb3bc4a0d3bc8f1adc9b27be28abf7dff2eeddd5825dfabccfcbc2f9e8c8bbfa09dbc7979330078d77c4effbdbbb4cdfccc0fbc8536b8eabf9f94acd8fb4d517b4b0eb5f17beb6b8fdaf2b3d9abe9becaadaaa080d06e2f332be85b4cf1ed73e8f55deb0ca3eab0b5c8beb5917a465e38bba23f6fb92cac4eeaaebc73993ebe9a14c9009f79b50ce178de1edbee612f39ee9b5d8ab1cfae783cbfee2daa86f7d5b5abafae7ae7c0ee7fb5e1129f28bce3e28ffadb8f3a0c03bdeb576bf497a6f66f61027bef1eab1bef346cfb5cc505ab2c2d0b356ffe4e1a1f0fabdd6f2d7c34474eac6a92e52c0dd82c14badd3db637d72f9bc7c3ede5cbebff76a92f36efcbbeab1e3be93db5edaafc3ac63b0893e6935ffb3b32fed183ef50c6162bb422fb69eaf9a856b1cc6a6b4e05a11484a2696b2ab3de1dfbfd6f6537ca129a522d6c1fb8c3dcfc0ae1bfbcbebb708dcecfaa717a36eec9f66a68ac2e7cdfdb7eff9d5033a58e9765efa0dbb9f8d4b0a28af72db8f0e3bf6bb180c3e190cead5abeedcfb067c3b78d018cb2e4abdf6d6ccd62818eca99d3fbedf628bed8ddaaceec8e65ebb566f41aeec83e5c7d7801d3ed0d073bdf3d52b1dc37536a161d52775e37c3dbc12e6e12dad8b31c5b69aeb0af3ea2bb164f4c9afa93dea6eaa9d652eb149a407583bdada35c1dca39a85ec1fcd3c69a7982324eeccc8d3cb92a5ebdeca7027a3f646bef7727faf4e3de3c668bd2edc86ca5b4c1fe87d4b5fe4e1afdbfc66dbeed9ce2f4d50aaadeeeed38baecf1fcfcfd7484c5eadd059c3caba457dbfc1ad58e1cbcded98e76aebcaff9c240eccdbaf7bb1cebadd7b67c95f260beacd5aebc2eef6f9dcaadaef6ebf67a01f90b8a54ee2fcd6f7e0256d1fca4e70f3913abbae674d2afe3bacebebe57efdbd3d2a4bb8f1ce6c0ef7cc6f673d20db99cbdd4b1c77d0b98fc92aac3b389dd8602aaa5df95bdf1646b1d70d07d81ef059cdb2af477ec02f5caa1bfe48f9baac14defdcc9bd337df9a2fc7c1addeb4ca44fa75dd0a7adba343eadb9f8ded3a89dbd010b5eb119eba9ded7b4bd8ec1e39bc7fcbaa0f5bdbb0c6f4ff780cfa67ab7a12e1e06e4e7ff9c8a113cc52ce5eaef2acbe8fa90483c5ba0f31fc15ace8a2d19b1dcef1dd0a2fadab8edc6b4cbe629bda98fa0be3b65aab6bb1e9f5dbde14def7cbd54e5affa5e45acb28a32bbefcde7c6d8012fb0f02b3ce0e0ea3ea9f5a3ba0f0fd1c2220b69dead21f6debee01b7fa6e73586fe83bf662e63088dfc65eace06ce34d01bbaa7d0e4caad9aee5ae9d08d32a5e9a023f0ac17a7efb3becf7f47287c6d7d8ba5019f726e2c7a09fb0fadccc76e6bebb56eccc3ae2c07c99a94edcceeb5384a60ed0bdc95dfb89e27209ef4bdc0d25cecdbba3bc83b5d7bce103da2f68dcd17a480fe6b0efa6f1c0caaabe316d3cbdf309f7c5e07d94fc65dc6c7a3b9763ce8452081acada2b8e20e37edcbbccafd0ffa3ea2121c62b5ba82f8b87b7ee5dd614a74acd6b867ce1ebeb9cd6c15f761ea6a2be83d3c18f98a899322debb666cbe1ddecdc8bfedce51e2fd2669436a058f081fb7f2ad53b3caabc9ecce5e7f3dcd9ab73ecc295b2720e38bf3f3b9a9ca20b6faf3c5161e45f0e5c0ebf8b0fb04fec61d54477fd3bbcd8c4e4bdd65a5cfd5e74cef02c17ffacdaa5d486f7e5a55cc2cf1d6e842eefaf7f27cae270ca30adf024deb81c8aedd86904deef543ef92eddff90f94acd1189ff8fda08ffff26c6ab292dc1be148ae0ed27eebd3aafde764a01521fb5428cbbeabacdcae18c841665ffbc1bf99f7ae98e66f3d0d8afa50f08c4bcc5ade311550f7a74c61adc70f4feac4ffdf24970ce6f7f2cf5a065c2eb3468fbdbf0f2aeacbb2bf33cefdc0dc9c6df37fe1369baf0d5b7a434fdd8da492e9e4434acebf9fb8de77cfe40fdb6fa6fe647ef1a393afc66fcf62ca8b8fccfeac0bfbf37b20d1d07bbd7cf0f730d2cb0d985d6ec5bfe04ca30c0d107ed0a382df9e1e2273aadcc3dc0dd5b6a0e59ad2f3e3eb6b74f074ddcf6fde9a2ecb99ed39a1bcaffea2bef46eaca1d7a8358dc7d8e3fdaa5abbfcd99b6114025a07d67fe9fe11ee783cdd309437d581358ccdda598fef581bbddd90f155a8af8b04efac2bd4b7728bdbbbadb2f17e4cc72f071c43da9c6ae691b1abc8c7ba8ba078db6dba25ff05cb41aa6befce5ae420a4d67ecffe5fadee749d5eef0ca8d1ffc1ec877caafad104abc32def2c8d0abad0eaecbe4afafc3d2bbe66cfe1e0a2aadb76db8647f9fba8a2fae3fcaa87cecbb12e05aef01dbfeccf0a9ad23596beafb1ffddbad084d93c1fccbbf37eadfb4b4ee57bdb634708cd11e99866e0bd1d78af79acabfbf7dabde55f15dc83c9cdec73f7bf50f4fa64be45aa7a19fcd1c3a499eaadeee8bc5d2284eff7882c2a5ecabbc5edcb18fc9cbcdaa6ad9dd391cbfeecc02ee68ee9ae0bceff42d17a62bed3faffecf63bfee3fc35e89d5915fc71a20fdfe9a7adc1a9adfeafadf1ff563fef8aa98751eeaccd0fce2bf239ec3e8abfef5ffe54bfd7a6f5bdb3b3349af68f629c38fedee5524de9e8abb646b60d8ebcee8c6dbd9543af8a55d0b1d5b0cce2405dcc49b9846da1a0ee60b5afdc6cc8fb1a2dcb592cf81905343ae69e57f556c551dad4ccc9b269ddd0bf171a03cd3d3f74eb75653dedac0fb5fa48e72cc40b5e11cd6eac66fae51393e80eabd89dabbf01d27dbf1d2c2ee5d1fba77deafe2effeabad8c9ffdcfabb2b7c969affdf0825dea7efb16a69b36d4f51cbbbfd7e1ce8b8a9f7ae210cb248aada0cf2e1880b5e2def03d4fcdac91f2a8da0ed63fdfa71afdeeacafa2fccbbde0ffdd6baefc60340f869140bebbaebef4ff55c1403746077df3e9e708e86b5d0b0fcfbcceea4dead13bdff874830b81beab92ddaad41e5d8bfae36ed7a8aab01eb615fce99bc2e1b84d32236cd2b8edc87b2f7ec4cc9fc8059eaaa763b0c939b3519bb1d3ddcfc39adf3dfe8717fd685bf3d02e3f8d458f5c0a88acefb2efee4e050ae14eef1cfe6180dbfcf6383dbf97edfed27729d0dbf06bbd69ecdaa0f5e03bc23ce99edacaa3d9e9fca97e4a8562c61d30f5abce1ffb95e2703781dad7b3388b7213ce32ff406ffdfdff98eeca14c51d3629bbb4243ca8e572ef24c346cacfa7904a2bd2aa4632e02235b4c626bd4cfdcf2874fcb78ec5778eba0da9af40dfffbb31ac2ecabea2ff707bbf91541c929d8daf0ced3ac489efcfb3caff8f82ba3b81dfbb9107a53c685aed9bdd86ddb4aba0e42ec02ee5ed3a4cecb032af062bfbb6db43de3bb4df763530ccacf9edcf2cdeb2ace05fc48769bed1f3354d4eb4adfdb5c3aa4c0e2cda638c126061303fac09deffde7d64d3934cca27c75ddfed7d6c90ffb5f3f2c5fab5724e7faffce693d983eb6dc7dfdd6d5fa11b1ecce15489a4cb5c4b01ffe667e1430906d3706e777dd7bbae95cc11be77debea8911af585aeb98c83acad0acf2b4add5ed9d4cddd9fbdcfdd8bf9e1accabcdd311248a3db3ca84ededeb5c7dc380aeae89ef8787a80ce2e82bba1a52a4a0ce4f43a30fa0bbaae3daa4e7a6c561205ca7f68bcee3eabbcb2328f54bd147ec7622bbafbd2eb527bd9dce8ccff94fc125b3cc509d3cfffc689c0fbee0ef0afc7164bf3f6baa676a9caafbc741fecca40ec47a1ae9150fd21777baacdf84cacd342d5f25a9bb7ccdcaeaedabeb54d26b337329bd1734bddbf2e4e6b5daec7e5bccb2ea77bf00b360a1ec131e5b8e93ac1b7f6b517481ec45ab7ceb88aec2c8e9d6afb65bd034a9faeb62391bad1cb5ddd921dc66de229b63cdb7dc5f36447162cdfeeafb123ebf5c3ceccc583b6d13e6e766bd78a7ab3cceefbff237c20329d196adfa43caaee2cd8e1fafefd8244fe7349d1e96c90dcfbafbc8d32aaeebaad04e8fe3f86f8cfe661ef7f153095a1e46ef2da5ea119c0537eb7b43f4728a4e8cba08da45373db482d9ce7b921da97e6c9e5fdbd9ecdfd9abced783b5f3cce034e7bed7be9e0277b82b9f7d7db7da7f25f998d4e1eb526d739a867d60293f6afe00bc74ac9cdbac62e7d3ad865f793cf0f0bb7c70a7bf48a78cd83c3ee5c1b66aed0c66ef7b0dacacb5abe5de549593601ebdca1ac76e04fcbccad43707cb3d9acacbfdbd9ae8de715fc20403bc402ca4e5e07f56edafee5fe5dbc0aff9cbbe91474cde7d3920f8a5c2b198f95e0badba508a7ef59d52ef8b41f9be70ecc30dcbcbf2f3db866d0f3ef7af1facadaef92e633efb4ba6a1f9b9e54031d5a0efec1bae8aadaea56d408e903c60e4e4fd83fb2debe4afcba236df92ccc639210068b4a19c64e83ec9a9d3c0c0addefec408fcb845bcdb5dc6e42d9feac1c26b0a4f1395bde69caee2f9faa28039d847ddeb6bd9f03fcac1a79e8efb88dbdee424e2ab1193aaa876c16fdc4bdd4caa9bee437b1ec60fcbe41ab9cbd04c1cede1f5ebdba9e70d68fbb97410da6d324f6b55442e12be6f5658fc54dafdfa8b3193cea845aaf784dfd925d61f1bb71dff2f4a5cd3aff3bd8d06e8717dd35dfc84203b7bbb8bde9c3d1e278fde76cbef6511048d8024f31f6be55be1d1effc51641cfabbaaadffae395218ec0facb1d25face54f2d17bbb597fe2dda8b644715cfd6b6e2f616978466feff76cf4ac44fddbeef5caa6ad7de28334dbff1a6bac5a9262aacfa10bd29c6f7ac1aeef138ee5fff82ffa6bd5a2bf9323c18b81df7c4bfead867dac2b3b064cef33e7ac7b05dfcc65d8c7c0ced21cb4d3aaeeff6f7d8033d2e5180dfbbcf6d8c2beddd7ff8aefc1cfce27cc7e8a8d5fa8a1596d5a655b3afc1281f6e65c0a0a4c91bc0ac6d546eeaaebccdf599aa29cfa06fa33fcb7cbfdfe87c8d4e0aacb13a71ec62deeccece7aeeaabbf5ccf3e8ee7cda1ba0c45ddf99cabfdf9da1c7c4aed86f9fbea2ca7caadfcc78c109cf6994a01f5aeefba25e8e614d67bca2fc550ae7edbfbd3d9deccf87dd10557a201f9a67b4acdadfd3ae43fa42d106cf8cda5fa4efd5cfff6f70eba48af7b89ef5f18044cf43adb21fd3ef9c3eaa70aa06e4efa07dbfebb29a8adf7aabbcb24bbe04152ca4cc920cafed6fa1f2eaddd2cfad3bbcef8f5a8bbba520c1d62dddc5e2b2f62aaa94d4f8cba4400bf2ff5c5fea7b6541aa6ca0afeb325cbd1bdab8db5a30d0fe46b62f242c2db17db28ade9f7bc3aad5e8c5d7f19cddbfdc7dba0abdfdb5336db5a6ed7db9107dcdba1e0df2ef3ae13cec69bedbec92fac984e4b09556e5c78beef5c6905f62fdbeed4b4f61a55a4aa86530eaa181aa4fac1c2cc84adc0a17dcc8e08a40d0df3862de7dfe93943aa2da1363ebfa1180f3cddc0af9fbf81ba4c0d4bcdc1ac8ccc1f770cc07c65b9a30fcabd9d4202ea0d7d831a0bdb9e97abbd7e19c1f66d0eaffdc66ea2b6fa1c11fb8ee6a00bde8add7f5a785a8cdcbaff0a55e902622cbbf33bbfff9bd6033aeafc8ecfbde0c5aaeeefe321c89b2e77fec88ed814b96178a5c5af3f9f60ef3c70bb5d8eafa4dd6ef940fbdccdaa1ee5eaa557c94fdc58af99d154333cba62e5da8ad90c37e7afdc5d3f8f573a84a2defbdf5dae490fbae4b5573a1916dde804b2be2af59f74cc6296b150bf4eaebbad8e2f1fdbb5bb19aaf460ae5d5ae7df49fd8fbd73debb6fcddabb1d60c3bd9f2f4b81c92ebcf7d15441ac96cddedcfece4ea997e43afbfc9e5d7c7819a0700a8acf5e83bb0e6915830a767a634e87beabdde3afbd56db740c36a24ddc5bba559cffc5cae5ad5a0b6abfadc5c7cdddaae109eaac69c1bd8cf0fb7573e22c5999ec2e18f66ab81bb3acd6d995bb5bc8cc20bff6fb23a5e1bc4cd9aa5fe3ef49f3fd4cec8fdd785be49b5b1b14c1bc309de4ad55beee34ff7c8ba2112ff7129cc638c09b6d8bfaac53e8783bd11e427e4e55ef81c9cfd5bfc4fa463ac8bdad90aa29fa1addbc29bcfb5f7f98bf2737cfa4caabbd6fbe68b92cf8a98ebae9ed8ee82feebe7f8e518fae0c6edf20ed315e743ec5ad17196aa0aff37839be1bedfe0cadebb2d309bbac0ce38c7c63dcd7cd4cb77ac9e5620fffccde589dda8eddac1cda1d5d895dbfb6bd1efd78676cde80c52ef59ad22ee3d42635bdddffa2b2d777bdcafae3d7476c14e7e2a08ebeaebd5f7ca8544c8dd61c5b5c2d11f0ec45ee56c701d0cfa404fdbee4d58cf6e4dcab8529ceabd2bddb5b0ad67a631310c401a987b0be5d7a26ce5ec7a894a42e1eb1fe6c5128aef2b779169efa2fc7d9f4adbb0bae1c2eff9ff8a4e11ebbc1ae28f8bcadcbf6657de18842bbb4abdd0ce1a6acf9357cfaaec47a4e8d5de9f04ccb33e75f3c719208edd92ccf4314ea2c58fa9f988fd2d3ec0cadf9b8be99cb5ad952893c3fa27c8c8a87d1e8d89e5002ddb686782cec4f492deff7b06dffe0cbda6d311bc9f63e118c2ff0eb894128fb7b8b9ea5360b9f05e4e750a9ecbf44eae76adaad064a6c06d5048cf99e603e1946e2b75cca0bfcc240bb2ed7dab8074eaa4d5c0cbc5ad53ca4642d2bcf0e62ba77aee9b6dc8be84dccfecdcd6ed1b0bcb8ac5ef2c6fdb7b18c1a0ed8c1dd6fb647f59d5dd07d2bf3116bb47bc752d144b1a4bafbdd2e6181dead3f2e6d2bdbf3fcae57aacaa9e188253cccf354c2b6efc2edf7208c5bb5294dbdedfadad1fd31f9cb4eb5c9eb19ebef8edebc1aebb73fbcad9bdb2dbdbca3431ba590df5122c33edc3f6ad2a557e3ced1a64f389bcf84d8abaee439e2d56d829bd9d63fba73f95fbdcfedea1b12eef08ec23c3c2fad4c0ecf9d1fe7e6b8c5aca8dabab4edece32596dde79f2bb78f30f3ce4f3f76adb8acafb1f8520f48b5c22348efb2ace3becd9ffd33f6cb1ab39976cec3281cd1dbf6fede6a3bdc2dd53e4a1d4b88e5be975be30122ed3611facc31c3eccfc4799c0eac595de390bc0c8f6de656eabd78929caab6bfcfc4ee25ec1badc2cebeaea8e3bee916ef2fc592cabefa7a5e227302fb6cdaff513bb3c2feb0e5182be6f35bf8fb0ccc3f0772dd7ee99d3acaea2d7fac3637ef5e3eb0eccc1ddffb068109882f36eeed1cc3ebe3acfcefc17b8bb5b312fbc67ee8dadee337f58fbdac4bada18aadfecfe2ed2fef051deccf2fd7ae3ee3fcfd793feb4fd3bd9c8fd19dded2fb1e96dafc9936d7c195b2d1ebeecdeb58dfd71cd7438dc91464c3d9a582bcbdccae52ac70c8a67baf346ecbfa1a9a8d662abba8baca4342efacd9a00bdc629cd49b91c4ea2883749b9b08be4497c4fbf83066fcb1eff606e6bfa2bd94c69c82dbd95374bf8dfdad46defc6f1b695ef5a5147ecafab1d6b8cffacfcd2c6343feefe6ddaff6ac5ecde4416bf2d279a66a7594ab3ef8dcf22efad52faf9de934c80387d9e5b0f35aead187770064da0dfedeee7d4289d56fe5f5cb106d4776705dac0c4fd6bb9eccaf5cc38750fc2c3e062dcb1bb835cd7c8ac0cfac3c2e5cb02ca3c7bbc3a7636eeabbceb45be5b52d20d6fa6fcc5daedbbd69a31a116cf8abaccbab3bda7fccffcdcd484f7fc39cdbf782db4760a57459e296245ebca63f51c2dccb7ad8caecff749efa51dbeca02dfaf6cffa49f4c8afb1b0ddabccc4cc3f99cacc68ec34a72bcb0cf6afea83f06fdfef5fcddcb3a5d3b2f4515edfffd26d58dd5bff5b823fbedf40b14afcaab09ba47d20f6caa010be294bcbc0c811ec1b87badb6a2be488b9c2f9a3e1bbe9b924b1aac2f962d7ecbd6c7cb1916aaf2d40fa6cc063dfcf5ad16edcd53ae63cc81bdbb6aeadb0dfeced3cf80a8de9e128c2f7fa61ebd608e26b3ec87490a76ca986768bbb9decedd8daa803c9b0d65608fd0dcc38e7a67de97d9ca6ce6d15cefe4aabdfb00d596acddafacce1ace22aaa6dfeced1c6acabdc3da20523b1d2e2ffffc71cc73c0e70ec531bc3eec8e6117add64ae4e1fcbebaacaf6af2e1cbbaac470e2ecfdcdcd04acec92cdefabbf143acccb3c8dd0b6aaa953da556d4f2eccdc4acc9fea1d95ab6ca1e8b8efc87e2e21b2df8f00af6654fd7dafb7f1c21cd550c9ce36d7b540fc37588bde64b242fec58cba11ca8efa2ab1f5bdcf8566e756e2b438f929ddc1bdc187aba83aceef15557efdbdbe51fbe71cf7ee747bedd34ff9eae68db79cfdeda98dcbaa8f6fd262cd0bb5e62b91bcfd8ffcfdc3ddacbf0f79566bcaaea0fc776cdc62babfa6340dfcd21a7ff354bff77c928ee2fffcf870bb9435374a08c203e391ebba6ed2bbbbfc08efba09abeafe5fa2a7da5a88d8093ee7ce0cdcd31bdb97acdfda88aebee7f6eecf434faead8c03516e3e141d0870b8ad6382dc5d358fedb12ed4d636d001bc87fea47825a6da588628d9fd5cd0a0fa15fef25cc7e7b50448c67571efcf1bf823b58241eaa816da415f8fc4e0ee1ade554d419aa6b01ccdee0d96a0b9ceeabed8bd55f0caee5d1adff12c44385d231abec8c8dbfa69fc7bddbc2fedbbf66cd9ef95c2c428461081fca89eddaedc8f83cbf5733154d2700f8c35f4be7dcf538b308b5349119baf24c248eb3b81db78524ca6d7cfcdc57acebfde03dfdae606cfd0e0baee8870decc22218f32db17bdbbe688ae4f65682dd12a9eb2dcf6f456652b2f38c99cf01606551f8ab4afcb0664d6ac66a9c34582d6cff71f0da32073caeefca7da63db39aafb0ab3ec70ba8bf34fdcdfa64975045b862768ed59a8c4ced5f97ffafacafa4850adefe4faa3e4ae3cd0b6714e15e1da5204eafe6c3e7fadc7adc12de3fad25aeb8796e6b70b8f0bf14f481daead7b53c825fea35d3ace4c4f28e2ad4dccb29680f9fd0c4c8aad6958ebfebe0c79aafceafdab355127d2a0c1d23cd2bc1ac9cedc483907ea808bf0e22baa6bffdcedf95dadabceb3f9aadafeb326ad84ea582dfc5e66aaea0e77d3dfbba0eb1e7bdd1452ffd8beaaacbaeca3521a84fdcefba1e3c24fc39c41e743be8de2caaf1f7ca1dc481eceb8ebdbe71a5e5f21b0ab4e48160d0e2f8b76cead0aa5fa77e14f6e8c92e36883a5d8bad3efdb832006589a48273b06f36eabdfa5bcb10ef2d0c77dbefed1add6abacea2b55db15c1eefbb548407d8c0c89ae70baf9c0c4fb02c124ad6bfb62171cafdc096cb0fbb3d4fdceae6adf61a163a3fae5a7cf21e5fd02dae96aa37dccbf8e10cd927daedfa0bc7bcbd7ee0aba6eefd69bd7bd8fbf67dc8f4b2e9395c020e1f46c7897fb1cf62c7c33f133f9264cffc70baa81c6bdfe272d9d3b4ecdda70ef1f8aebd0eeaac1ee04cceb1e8bbfc1266c9ccfc20fe1496b4faeefdfedfd15c49e178c4f04fcf5c160a0d5fccbff5192c4c45e6678fcd8fa27cef4efebbd5ade0eaaf27906d8b737acef5f32def9e1b0ea0141bae4aa6c32baa1d98fac2e1decabffcacd9ced63310f454e0ed47ced55dad98cb4eafcc4cedcc7dfaa08db075de937c1cee4addf74e74f28c7cd95f8db70efffebe23baa1aebebd7e37b9a60ae5960be698be8d3aec233cedbcb5a8acadaa6d17bcfeddb92c754aadfbbf5e611b3a4bb024108b17a600ee62cddde25bdebfd5ebedcecc8b74afbec0bec096fde1766c7a36bbffa9e95ef0355ba6a1cad9af405e8f8fd53fd072ad381befa8ede8c2fa3b1920619f1f93bacbb0b4aef7555bcce35d5b7de83b99c7b7e5db8cbc8afcfce0183eba1abc38379e7833e36c60cccc090f0feb2f9cdbefb479f4c62f06c501b0fbecbdc6d94ecbacdc1cf4cc83fa15ec38df9a0db13bc9b043e3718b21d8c1c05674f4c4ef5e1d6794d52f83cc1919a33de91a9c72fdbc8c6e4faa00a83be25bfafc96edaecd1e0f8adfbe83383f7a52a51ccbd3ea4e0f9ab39ee07fc1edf32adf2f8486d0efcf17bd26aeabb9f5d0d6bca988bebd2a95e07aeced2f27b36a12bcaf6bc7cef4fadcdb765e0a1b8aad3f47a8ae1ff3c0bdca14c1dbaf81d3a66daf7b9a0ba07ae5c64326eaf7108367ad0ecca5e6358a593f6221cb84dfecc05b9834a4db23dcf0a5ce0b1dfb321ddf8ab03f5a6aa7d15ec231b3adcacd7b8219ff899d58c73ad2dd0be2e0167f9fcade23904b2f7586a45f1bbaac037cf5cdf018fab812bf8aeda4fcdd2cfe3c38af9e85106efa5b2ca5cacde5486bea5fb5f2a2ce4a1ed1d69bd5e4bef83d4f14cba5de40acca62da2f492dcd7beebf201266cca9fa8f119e9b5edeb6eadfc74ab1aadfdcffbaa6a8cae4f59befdc5122ba7ce3a0f3a75ccbf5a4257edf73dc94cd0f2488fadef0c3545849ee12e9b506a62319c4a6ec608acd014edc01e9ac2c70dd1bfd6de16fed3f5c5b9eff6fcc9ddfcbd9137d9abdcffdeed5b622d1dadf2e588e65fd438d7857c6b6e4a75fd84ae9f96ca3d449d69f7f0bfa4dc808a4cb3dd1abff26bc71dc9a748bbe2ffb32eaf8946aa90fcceadd54a787fde34b1cc2627d88b9bb9aec03045e6f772fba805207ba99dcbfd1b0f6ae3b36cd655e6f7e3acc6ebd9e4cbacc35afb0b153ff4b404da73c127dd5e6a7cdf0ca2359e95ba32ddba568c6ba5f1bd4cf90951b6c3e45fc4abc84aeffbebda5e41adf03fba1ad1faa7cacb8cbd3de99a5e793bfbd257a34dd9bb3bc03ec8cfcd820fa87ba994214eb2ccacf8df4d2efbc9bafab565a33d02d11e3f9fb0a5dd4ec5affff7bebc020abcdf78753ffc08cef5fb41c339a590578c06b77bee7c5cb4ea453cef8b14db2f821839ebed31b39e837bbd3c4e5a22acefec9fbab6ae5ebf13bffe7a7f713a0dbf4ce1d7cc2fdf2111b7c11e6014c5d8938adee41e0caefe55d77bfeee12388d08344f3b21cd67b851975b1153a9cb1fe1af09daf28ebdf13bf547a1037bcc21ea49ac0e2725a981d23acc02da384726023cda8fadd82edd2dfe962e43ffd97eef4b3aa3b5be6c81cfc0caa9b0c6d6c39e8df12b84df11986dd661a0cad34cb745ef5aed8c913d63eeffd7b997f50dab1eedfbf2b4c3b0828daaaefe96aba24cd5d2573a632c2f57fd2a00ce65b6127afe1a9eebccdb8dffec1eeb62cf7f5d6dbfffdbd9c23bfc29917a5f3bbdf181771b6bc9e3fb0483abde0c0308afdebab9ce8e508f37507dfcebf3c3f2af7a2cce0df2f6bb71fafa1e2a17afaab6beacd5e9cd4feae7dfafd8d5286cbaa03155ee5d30c1d0addf2eb1c06cbfdc57f41ebfded4aae70b4a629f797ca7c2ff93b98ceaaf6ddfbdd1e10a14141ba9fc4bce7fa6e678f6a088bdbdeacbd897ceef8a7f1f0c59519b50cbaec2cda3f38349e95da28bed3af47beeda7a4ec6b8fbc0e7785aabc6df2edb435357a1ae0282acf04f1ff2e7f4ca809e76f0a69ea9f5a2b7ecdd3aeabfcf9f381ebb48a857a19daa19b4def106ebffaf7dadecfccab37ca45fdce899a6b56bd3e63fafdeee6cf396b1779fbfe95aed42c8fadadc0e31fc1cf51c2ac633fd73fe0d7cb17cbc6e8fb9e8bc3c8e44b9933cb2286f43e2d4e7bdba27aa8d5acbbf47d284c26ecfdefb6aeea1f27dda938ebe48ce39f7edf18bed5dbafc3bfffc3cb21166afe27e2a9fbcf4ab9353d080f36bc34e540fe720fdef339abafcc10dbc1ffb16ce5d7a2d416cb84ef636a3a40115522fd75ecf48f3b1f0582eb8b5ffca9fbeb9f93f2cac8ee8ddb62b56e826490abe4d8d3ba43f54a49fa670ea9bb0d7ee4c006c3eb9a3ec3a1dd72a2d8adac1c1cfa08bebe797aad5548c226adebbbb960dc4edbec9efaef18837a93c6dd6b8dcf2672ff5f1bd2fd89ac7cdd534fd2a3ae743863b855ceeeef0d2bd5c42369d8fa23ccafbed1453d790f95ac1af5df761a5784770e5e33aacc0ddbf57bd107b692dbbd33ddddcf7ebf7de24cebcc287f80eeae5e2c5f0bb06b6e7d3adcd6dedba252484dbcd56af6df1afa7cc2a92dfb43e935bacfbfbdeb3f7cc4e14d0bfb02baafddfccf578260bc3e73da1aafdf34bbd6e8bbb01ee8ccce491ceff4ca0bb5525fc34b9fceb1abb3f7fec33a6a8bc352fbb47e74e3aaa80cca0cbbe4d7b125f090feb095b6ebbe1bc7663e0576da63870aa3b31a2adfb416bdbd99cf3a6e933db3bf182c1c17d830a6efeaf1dc1aca7fe1b376fda2cae11ad095a7804a96b958fc065d7554ad65cfe7b572c50b71ee9569efede1698e55e2dd4efe0d8bda7fafe3fac2ab86edfa4c1cde7dee3b9e2decec8e4ce7a2b8408aaec521189977484b684a986ba17d71f111c91ebb1cbb1afd6ee6c8e649945bf748cacbc4cbf0dd4b0da1ed4ab35f21bdb05aee2dbbdc2b4f6a80ebc58d6432d171f6be3acbb7b3ba349408eba0e4ba14f63f7d908bfbe1c3f3fa03aeaa51d38ef7ffc7a97dadad45a65deef8031ea5d6ad97c0ec1fccbd4ea8ee6be78b7f8b8cfdc9c6d4536aeec3dd8beade1ce3bbeb6edf6eae9aff3bb6d2ed6cef22194cf6bbc1bea650f8fb06230ecef54ccf02f627cc72b6ace2a8536b0dd58821e963bdba6bfde51e8b551bdbcde27adfe03efa4ab33fceb2473df07e817442db37c62e1d6cdc8134e41bd5faecb730d3bfb9adb14060172eab1b8190375f5275b71a88d2913bc4ae2bee8aecce7eebaa88e7a8cb1272ba432c3efad3b3f0d3fa75569f754b2eb4a5e5afdbb560b7929e5f858acf3dd3eca3b6d374727a68eea5c5db7beb8f1ae9d8e2f1c25cfb74456e8d60dffb8cc2fa9acefb6cb141a13dfded6143e0288a78acbaebb1055d6b1a5eaf1e1cfdfc83f65cc2882f8cda58be0efacb200cd77d9b2e6e6b02cf47acc2b665eb4cebcc003a1ad947be5e6e2c9ba8ad73a22bbca7f3bdeb31c35a7c700006bfdfde2ca7f328eb1e3ccfabf3bec5dc33a45b83f9f6da1df346fcb53362ce8ad9115f2df7e49f07b09bd6ae85c04cbac8bea75fdd2ed40eccaf0bb3d6eb81292c169e1f99905ca3b3f843e04c8fdee57fdb072b4ecc976d64e1dbab7142c1d4b11aace50b1ec895ad78dfbabadc3418afd9bda37f8752b539e2d6e91e59af36227b77b468c5f6c47d53a51ba6ac97e9a5a2adc9f0bec65bf7eaebaf70bdd31108db31bce4ac9a0eacff5ebb2dfadeaacce059837d7bec8bd6f08a2bbcead1ae7dfd2ec1af744b1ed56f62d72e4adcb2dbbfbc304dc0e0b2b02afca0f8cef6be9b3d76a812dde6fcd8bf7a30aa1ad2acdfb8fd1bb7af7feb90ac03ebc3e534b25dc57d948b9b43eda1fef333fc1fa0608d0f31f74904fd15e8fa44cfbc7c282a8da97cb61d89c6e5dc9f40bc7c185dabeec0ffb8b2a296bed406ef09bcbbdeadaedaa2cdab9bf5e1fb2b1bc3beeea819c10cc5469510eeacca012bf1913ac88aec4abca7a93eaaee6363e2eada239fe6aa05c13cb7ebb0dc91a464bc9ea0e4ff461c51a5bfb47fc307c7fafc89feb8fad8c67aaa78dcbbaebbe95dedf0edaa7d113e805deaf049ddbe819e6b0a79d2245eac8c7f25a04eea3db5de7af814267e0f121e0b20c1eeee515bce8e7d23bc2b02ac94bf45bfbbc1adfa7de82c5cbadc27c62dda30f430bae4a1c761eaafc954b5bddc54dffdeba6718a1d17603c9f32c1b13ff4cdaa48e90a15caf42dd1dfddfdad4f54ce5bed7c07eab985c56e8e250d3bb50298ac52b0eddbf4deedfe7035e6fd41cf47c7ef7e01ed2ce889be7cdfa5d4eccaa7eabb3dcdcc1da68cfca1d3fcfb977bba497c517f95397d4dbe52dc00cf50e52c734ecab3ab948de4dbec238cc01bcca9d1bbd8f4eadbfceba2eb8e602374f7bcfcfcebfccfb12dcee69fcd24ec8549f5f0d92b5eadebea5dad077ad292c87aef16ebc14cd7377a0fdbedfe6fc15eebe07eea71bfde01601be36febaadb3ae2dca0acde6ca39b55fde11811959bbb69db19523b846b4b8d5d89e9cf94bc0b130cf7f12bbfc6aeadee99c2c4e44b66a6b1addfe136a9caca2cb4ebd7c8a8499d0581d1c5d13a9c50ddde1d76bf24ce407fecfcfd6b2c3afdd82ae1ac03bd2dbf8edecfd3f3c1afe4add4dcb2ea58df0cb8efdc07bf5baba2ddc4ca2730cc3e8dda2ecd712fcdac302f9f5bdebb00a783b9f7e2affbb12da52086ed9e66ee3fafd7100be224dd03c1e6ec5ce8c66ca440d4f2803ebbbae63dee4faf4da06bbca3f5d386cef9c1afe8fbad7c1ad5eea85eaeff21e8d4daa6bef5ea2d12fd94c54bb5e3dff3cb50bca988dc405e2fd2030dcf7afca9bc86bab364eed6acda2bd52ff1aac04d6ecaea77bad6ef854fb9923ad9dec11e88a6f0ff80228cb2d982514d5c223ddfb4a8a8450ebd2cf544a3bdedaba6a422faf78ca3c766dc8f6a7d69d9d79ddc19fdd8a145accb307cd1eef372dc0dd95dc75eec1d6db2efc34ab357ddd7aacf4de9b1adb4aa5d1f441ec107beefada59dbb70abdbfce2fcbf2f22dbad60c440eb2928dbdb0c63bdbbe866ced7dab7fb1f5b0485f4bdf69fa06ffe46cea14aefc7a9966afcc6b9c0d8afcf828e3b5afd5f6dffafbceaabf09e8e0f51ff0b4b100caeadffbdcd5666fccc3c28196d430ea15f9c6feadaecea47a1d92c36ec67aed7adcf2e1ca85dc64acb9a2d9a6d3015f4e8ff364d5ad1adfeb608145c9be926fe147ce92befddcbfc3ea016e1558f3e2baecf0af7c5cf6af55b934ffaeb5d9e1c8ddfd35cbbf77df6c2bdda10f42522e6fad9bfcbb51fb6fc98cf9c52d5fbe17a3ef7c2326cd6143b342daeed22ccf883d0fbcddbb81c4fed2d4cd36ebfecfeaccb1da648ebafc6944fccc8d7fbfdd152c4da527c3dc6e0ff200cbbd7c2d3e51758ddb03b66ae3eef6d7ddf888990770ffb92cf33efeaffb6b8de6948fd7cbcfa7b8cdeb3cb1a9dc3bcdff16a233809e70ae0e5d8073dfef14e21578bba77d4dcbb9704a4e74f98d40f2c4fdba6622a55d0ffcf538cff77b29f0abbf72db0c40ed6dcc0ce4f1cfb2941c183fdaabc93acc8ccecdfc2c9b73f9ac5b6adac316aaa0be45aaff08d8beefc8cb4eefc7ed707a6670d6ce02dfbfefa38e7a5d1a666b1b9eecc951f1e15bb5bbaeba5f4500d204d00055ebce66ab1c3a3cfc7001fd6df5fea2dedddcc0dec15f88a13dbf34bae60b2cd5cd449f8ade66fd5b9ab79c4174ec81b0b942cfab1861aea4b752b943be5bdeba02ff2d16c91fba3cbee04bca0ff7bb1ff3947d2d0d12fcdf7f96c048aedb33bce0addd3768ebcaeef4d5aee5ba46e87fd48aff3cb0eaeeaae8d7dc1d9bafa326b93d81df61a078b73bbdcf6b7eff382efa0eab9eb5dd6eafc9391ec99e245291674f82ae59943bfd5a48f4f775f8cf76b67ff6dd17a21d3679e1df1dc2dcbbc6484bafa5882191a1eb5eb3e7cb4ea3c8ab30c0463f630758d2bacc95d6d0acaaafcbd5c67c22a13db9a3a5e84b5aeea62ba6e0d0bdd0527ddcf0c4219f8138ed1c8c8d6b6f9d10b78f06f94a33790bfeb4b7112588792f01e9bbf549f35afffcc9cbf7a63b3ef5cf31d7f9e8fcc70aeb4d8ab61ee214929fb5c895f68cfb277dfc6a1eea0b1cdb89d914da9ebb34e6af54535a4b622f4daebad33ccff8ef1606dfffe8d82f2a40a65a9e90e58f65e0ce1e6b0976fdbcbb4ea05f37fda5ff4acc907bec9dd5a103ff0afce24daec68c9b8cadcb4c0ef98a5c8a4d5ff97cd0cdac6a1b7ee1fc78e8d70ad5209e3bc10af2046f4235a7b483c5cece6d1aedfada063d7d3df35fd4c4c3bfc58d84dc69a3bb3dfb0cf09bbf195beec088af73e1d2b7a3cbeaf5e78af5752031dd0feef4d6e262fff2fda6d772e1c7d9144877caa56ddfa93aa2272e6aa974d18dcde012a9ab2cc2cf47d23aaeed5b5bef5d34cab67b744c739d6ab0409fbaa878bebbdccd3446a0fd0ec51e1efbddfab82aeedf1ed885adafb49acbf8fa3cdb77419cda3db6d695b5be3c11f79502f14a94de45074dce9cb1130e8e8bec6ce8fa6c5d6e1abee081dd674ff407ce3b754bc8caacce449bab9abf9c7c5d3f9ebeef6f4ac16c98824ba2fa92bcc280ccf703afce8d634c5fc0b6e22fb96feadf9afa6ff4f33a63e3be45f3ff1bbf6d6c027faef7fe4eaf6e94fb5cdf30cbeacc2927d0e23e4abecdea1db8edccaccf76a0e8dbbe6fd013ee7fa5069e64cf3fb97faa7fe9ddcf76edaa51d4317242b437d273bffbe452897a0c7ed3bd0b2caffe3b94a1a3d5cb3a524baf119a9d8ba0b4b94a909fcb22a3efe7e4cf3ad0512d6ddfaaa942c984cbf91dd7ae1d3b336f377b2dcd9fe9c9c5654ccdc56aa9592fe3b9d338df8cd9db5eed7a50d3e48a1adfc41e0ba3f0053a5aaa504a8df43c8cdeab264d1159bcc3a5e5eb6647cb1917ef50b14aeead28ff6f9feca14301ce9fc4ee103ce328e0e0a9ef563325edd7ca5ece66c85affe200490fad170d8029b78dc722d9e1f6cf3cdbb1dc5ed3acba41fcb7cc4d66fe611fefedc95389e41181ffb33dab62ef7ddb6e51aae5d5ddf4e3bafabbd966daebda3dc56d54bddb67064cee3d8b998e4f031d41e3b5aeb30babffdac53f8fdceccd4c0ac829b5b0524f887c4e3ae22db06c1bfb75ca162b949f85d6060c35d3e48c3a4b32b0f52fa58dce4a5aae2a5bd1beb6b3135abf71ef476cfd5308c801face9f1cb7084fdabc63116d1abfabdcbd0eb0da5c364bcab8c1153e80dcf7a7bffddfbf867e5cfed1318be0fdcaedad0169faeea2cefc81724f8fb94888fbbc6d677cb4c2305dea7dceafc423e24dedfcc0cfa1339bb18b119f75e8109aeef70f8ff023da9856a710aef6aa884af54d9537b4ab04a1f4ff8f5b0adcc2ae5cef2ed5c6baa342edbf8ecf5cb5ea9ecfb176e5c3313d0e6eaa9d2fe198140fa92d571dbc04bc454bba18dad3bd90cf26118ffe020ce2bb0e1f3ec7d6bbba13fbab316de4bdc2fee20ea6958fc46531417e7e8e8eca7a7dcacf0d15ef0be9cd70f06fdc1ada3c1a3fd0590fcf704b8f1ecd5b38dbdedfaaaf4abeebefaebc4efaf90ccd3bce206bea9612d2e9acd5ac2c10ebca3710170ef32a82392c4b67e62edba3fe6e675e13513405ae1fadfff4f58f305b3104cc382ab4a38fbeddc3e9dceefa6be23cedb41eb22eecff193d8fefa3bfa4e5e3c69aab3e982ae9c016fed81e66bfe53aeeddf34053bd82385b6d1fd4378bcefea13017f9b76c73a2f507bfb7dcba264d5b6e8bc962ca52a991ff8bdbebda59e77fe9c62fcef1415a993ffe4cad9fa3a96984489bd9edcb1a4bb134735cbe7d6bbbc1df6dec8809a45aaecab1bcaebaf06fbfe90cbd8dab61f50bca34156b47f4de94cb3075d37e9c7ae8f7f540ed6cdd9ed7dcffb90d24add5dbfefd06ca1e6ebcc4ba52dd7dabc8106acccc7ad0a4dfff94d9ccc1b104bccfcdccb8e3d6c1dc3f88acc4e3fbcf5df561fd7a0b1eba7dd58f7c9b05d9eae7c5da7d5dbd4df7ffa1dfcb34f9fe0ef3bbaaba9cbabee477cdbc9f0f1064ee1c1fc1ebce136995bfb7c8cd22dee5fdcbdeb1f457dd7302caac50dc5d9ea07fe01cecc5a7cfebc915e8c7eedd68dc1178dbef71c9771f3c7e1febee6ddedf6cdcceccf2a3af1a93a3bb4eaa508f72adfa6d33b9b358cfca16d4f7dbe3ea07bb331dc552be2145932b6bf94deabf7aeb0efd59b7be6ca30ddcdad948a87b1044bad23cddd45abb2bae5bda00d4eededcfebc38525f58aab0c5c7dcafe8c6fcf0f44dfa44d38f4fd1faae2e6bff4cc205def25be1d1db0b50f2a57d9af0caddb95eee0ba96c435d2cb737b7aeb6d43ffa29882eaaf2ba84f9fe1a7bc10ef0ec856257a8a58d9dca1c47a6e214dcfedbfb2e4e5d8a5729fa2db9e61b2abdb5aa39addebc3e7a6ed4d24fdfbdd5edf21cb770df102c4edea8b6b0dedbe1e8aabe8cfb8cee5820e6bae44dd4d22a1e65fce8bbec9ebf7bab8db20e4e690068168732ade64edbfaa4164abcb5202dedc8e1fbae9551ac8c2f01a1ddda29fedbf45de5cff09b8bdcdc21bfa660ae5ad6deacbc0cabda1d63abfd5be47bf8e47babffd0ecfabbcdc99bef9f1d5c5a4ea0fbac9fc3c49e9f56640fa5afe6ede1d03ab98dc417adbf06aaafda17f4f5babc83e12cdedcdc92fc1bddc6007efaecf38a7ee3a231ab7e3fea538305e1d0aee81ad84b188fc4515da14ace9ae82471f2ee50cca0bad2f324e1eb88df5a55d8fb4faef71b9cbb50f8611d43cb9f83e40d562ddde15fbecdc0ead901df4f8aa25ad1dbba35ee4ff37da9d46eccbd51a4c03df52d42c1c2fe82f930c9dbbcace5c86d38a79b5fda30aca8c46ef7ba95cbacf11ae39e0d200de44c5ac6adf350eaeedc82d4cc8b7c37a67a3bacac95dab3eb4ac3dd83e5237ddea307ebebc9bfeb8d3b8c2a4020a67e19dfba305555f2c22f4db7c0707008257ead57d0fb9d01ed6bb5a84ee1afd86f1ceedf8cf2d59251c21222c67c86dcfdc92a21daeea401fa9cb7a165adb0e9cd739aa3ca7a145ddbfdfe8c5e2f2b1bbdf1cc3ffdae9e49f15f7cbc3bebdbb49acbaeb5abbcbbae7b891a5fe7a4b0b5c1d7ac26ec6ccce3bdb822cb5c41ea5ea06586f49fe08bfce04edb2306bcaf5f6ef1e987b343ef5dc10b6ad45bcd219cce26adff0d12bbae7c15b5bc5d5ad11b573b931beac50ac53f4ddfeed5de1dd5aeba82f7ffbd6dd5aaa6b7a1f3ded71c8b2a1ad9f337bbbf447ab2f4c7bf04ecb88b37b1c44efc3c12ce9daee28ffca447f388ddb5f9c0fcd4042d08241be3aea1e6dedb02fded70aab5c7c7843e990dcd2a93b3a9f208c9be3ffefc241a6daa9e6effc7d9d1ccd4ad11abb82dce281afbde2bfc3faef4500ae10e36fc90b6ee231f42e4de8d1bb67a5cb6502f26d2ad2fdcd379f0f0cfc29c0dcb33fba67ced17dbcb5ecf5afe7a4f505f5ecfb2e20e11adafd51dbb70dc63effbe81cbc67d5a38dfabfe66da42e8e09f420e4ef21d54ed112b6c51f9e6de590b4bea72581ddcafbcd2062a693addea977d8c6f42e44508cbf57e8d9b0bec9b5ed482c392d1d6b7bcbef16a3f89b446ea3dc90650dc3b0cfeb6f3edbcdd3c76fd694a268a4e15c6ec8c137cf9a9e76caa9c7edfb5203ced03ecff2cb7caaaa2abd5f77ee874ff7d4d7fc2cbc2875952c358bd4a1b1facae59ee83bfcebc5be7b6038b4d67794de3d4abc4cdacadfb0dc19e3daa42e4cfe26bdfa64a70a39f0e2eed5f7ca86fcea7ad4ab1d6faefbc24a9a3fdebf7ebabf0ca5ceb9270e4f7cbbe23b2fdfb0ec93dbf6f1daf5fc4cbcdeaadd8ced3032eb785cfed83605618cfeb20b74dbd9dbede9ddcdcbf6f1efc5d0e529ff24e3ffdd5ad0aab7b3bbd9a2f8c05bbee448a8ee8fb46afb3ea1905eabfdff3cc1c7ae65ba0ba2390160de6d9f75cc7daab2acd6659af93e291bb7a4e02853fad4adc0aeaedcb77fd672a65efdfc0aa57aaa2f15aaf6cd34fc60b1bba8f1d2bc96de82d7ee2a31b24bf7eae80430d7af2f0d883a0c8b3bc28bec8cc3ac6efe3c5353e211475cef82d2f1e7c53ef0ace6e0939ba59baf718b719f4e967cda08d0cbece3a60fbd9effb75cb52fcc0dad5bbefe4d1f7cfbfc0cca9c06f53fbaba19ac382f5a18bea27cd9d0cc1dece7dac3bc7ae63ce71aed6caa5a5ef6a4edb9e66dc6c3d489e17dab6f942566bf3f65fb45adb0f77f2cca8dd3b8cc5dde7196e193f2dc8fca15e272e2d0dae1a0c17fad5fa296f1a27a0eae8bfabc38c28c2d6dc0361f6bcec4f0bed6cab5726def4b564ecaa8b80dcc9e3c21c7839d54ccad2abdc88ea47f2127ae96e8f41d4674f46b04a6ff7eef3e5dcb4b7078cb6706bf8edec2f30bba58c96fc8e7b3dcf6dcb6acca40a42afaff3ea73dcd8ce2bddb55c65eef6c4f8b2c676b7e32e6f8d6fabcb5afcfe5c978c17091381911d4ffcdba7315abbed1f4dbf72dabd76053faeca562a2c9dc96fdf3a3a54adeeefbec36e2b1b4f4984ecc5ba7f1d34ba376ab4f0fcc4c72e887d6c33cbae1cc90f31b7d99d7f096f62f3ed9fbba88eef2cdb5feac0fd30c3be5efdfbade0eb4bcbab3f38cf42bb89dc4fbd0f8a7caf39f0dae4edededea17669bbaeae2fdfc231df5fa87dbf6deb41ad67ae813a1416b549050ed02acbfed8acb7cbeabf2a7a3c18602fa0dfadaedcf2bcfaa5dd0fdb9b39dfbd56ecc801ce078af6924f5ab76c1ac4b7daf34a6fd1aec4f9ffd13f8ec89f9f47c7dffc575d7ddaafff6ed18513a4d070776eccd33afb3b9ebd46ae7f3fde0821c8afa8de5eebafa7e55b85fac023ea3ccad1dcbdbb0e1d869707517c8fc0c45ce21dcdbfb1fc2757886739adbfacdc2bf7bd8d980996c05e17d87113c72e56a1eb2c1dabdf76549f2ffb882e5c6928ede090fad1abaf784ad28ad6ad292e98900ff982409ea707ebc6304ed79444c3ee059cb3e1ceeeacbd1e4ac23d5ae5a237bae75a8ddb11acc4d32e7af2bfa3382fbb921e6617f5ed4c3e9e3bf79def807efebdcfddbacda6bf4c0b76ccc28efe7aaf8cc4dcc4f1e00f8f96c05254fe86bbebbacde28ebdc0ef0c4c973469834b1a1e27dbdb5b9ed7dec79e187cfdc9fabcada8e7e3dfcc0cfdd2381e4ef2981a4c2975add70c2cfac327a09aef0fa7256bef58aa314cdfed5ad1bf8cec6fd48dee9a993e7cff4aff08bcaeda3dce8ff43cb2e54224317fcdebed4cfffe9e8acd4ee6bedfc4eb5755e375b9ed49ed4e9e00c7a2e931bcf90b1bbda4ebc73020c5c1367125b6aaaacb14aa3d6f210ab4c0baf89ea6f33e230be6eed9482debfbaad9cabeda3db6ce154dd9734adfb64c3d9defa84be5b35c01cdaab6c4eb782b4cbbbbabc61a7fbc1cb25ec46bb2affb50e3b536feafe6ea7eabd69fcd0e1fcacb14bfd7e1deb52c3fe6a61d78bce4e8ebdef6bbb210a5dee6fcba66bbca5fdffacea7dbece63ab42af9afeea3c2c9b1580fe2dec9c9606eababa2a7bafabbd6eccd34b0ece0d5efeb210288ceceadffe3c75dccda6a3983c8041ecb1fc65ae8edec9e63febe295dfadf6e4ffde29b31ff89ffec4de8fac4e9f260e1264a79f9628db94b419c69a4afeeb9ebadcf4cff5ed4ecbe5eaee4c2acb0fdc4a077e07aee9f92121f2a70234301ac7a733acd682749f83f13ed8537a21eb18bcfb65a28d44d5b5caa80c5c1d4deeaccabf6dda448b4bbf68c61bcc651a5ccc7aab9ecfcfc5acf8e12adee00efcce66a94099f05f9c3dfb0c9b0a89714c3d7e0bea874a2fdd0922fb0cbbbb9f0aa95a0caa0dacc0e497cb41fc41addfeac307bff7dadab0fbbdf4edad28ceffef943dc7a95f3b2f542b7ce0abda38df85db9828ac03c9d830f72ecddf6eed5d2dab0aabf82a12b32e9b9e8ccf9524dcf86eca50d7acbd9f2db07cb77d1bafe7bdcde9c2b6ebf78dd7cdc358bc5b712bbd8fb37ffc7fd4eaafefdb0bfdc1ee2f4da98ba7cfa0cae9cde79c5dc11e40dcb344a618bef5d0fddd938dac92493c5dc6ba1b6bf51c48bc0bd3c2a0eaeaf095c06e3f06ffaa9762ec5c3cfdfebe9e69fd6acae3f72cabc02c75b4bbef9fc4fb13abb9acd88fd5f3a5f7baee24beab3a6aebdfacafd9c7395fddd1484cbcadf68fcdcfc9c3757a1ba8a892ed5ab8646bb5c368b7661dd048a45fd2112679a28a058e2ebde8ecb4ce38bfdf4b740e72acdcd9ab6fcae4f8eef44adcbecc2ad91fd4c2aecbdee314bdfcb061b646daad0c3cc9a91370d22a00d66fb2892bab7bdcecfac6632d238fed80b6fee96513cc660ce1bf34b93bdb91af3e1d19f2cebabf5d5bbbaadb54cc269edefee4d4ddfcbecb5dafb588dd6cac3f2589eb3bfdbd0b99fed5aabfc9dbffa17f94cddadb505adca2012eede7560b2ccb264a8aacd2faaafb86abc44c77ec47e18e8c7bb1fc58f578bca6cc05be0ceedfbbd76b5d7a65fcc84bfceacb8dfcb3b0afffe97e63ba72bcdeac4790faba71179c6be75f018b0afb48db60750b41b596eb3d77e9adcbdef8eba5cdd1b8f2d4696073fbaf84eac07db07cedabff0e9d7fdd882f97f44ce77a8fa83ce34326dc7bf9e19bc7211d1e0fe5bcaea3385b22f09e1cfcaa01fd51dbcf9a8f35be67e2021a5a25a6eb9120deb0a0cac668e3545ff10bcbcdfe7ce641ddc7b2ed8cb0fe332c4dc73e7cbe63060ede4d7da3dfacc6b1ad70da4c58c70bc5b679c11e4bcac9e8fc7bb96af23eaeacc5469bfb3588abcc41de26a6740d8ae5aceb5e0d3c3e63362d6088aaa4fdc6e87bfe32a49e0ce78dcea26d9dbc2ab1c2255f8a094d86fcfc2fd4b7ad6a4232eecf870be3bdd9b5ded600d8443c73efbf21bcc1ec6d3e3ccc1b5b39babdfef125d225e31df8881dcfcbc12e0d7f5d7fbd1a29ce0effc61bdbbcd1e0d8ea44fe29fad05cfca4a67c9e24d59ba44def1f3f349130f2a66827c8a7020a3fdfe956bdda9fadfdabd2ea29cfb65d867f088dad8bb88f9a1c8ffeaa1689d7d4f8cce1439ff53b76eccbe1b2b655e3b8c9b3655964ce2b07cd76eeabab2ffcccbfdfe6f6bf92ca1c0bcc0ab1f8083bccef4bf52edcf34bc4b80dca3bdf7ba6cccdcb4f2d41dd554f9674a3fb8a4e4a643bc4b49bf2cda0abd20747c7dc8eb5f4ab0f7f7a0a1f9cfcb653ac34da8dfb88d485bf3f1021b853ffed4dcc9eba3bc8448b06d0fe8d3fe7b4fb7f20e21c8fbf45f2631e33c7dbfb8feaba089e4dbbecdca5277b2c89be7a1e9fbc750671ec2f4fe32b32de4a2465ddeeaacaace43d3ab74ccc6266d21bdbbd515f6edae53ebdf855f9dec0150f92e4cbc2d9e6bdbf77fe3e46facb2fa33acbf2cb3ab8bc8b2eab42323c6659d9bcfddf9ea87a5dd23339b02d9ab35ef84fdc42e22bd481d81ea4d33ae0561b6eadbdb6a130c49c5c1f6d7faddf6cd25b87baf49fffb9769b8adc316fced6fa8aa2edfa399adc7fbcea41544f7a8add3d023ecca3f17cae1977fefc23220f1f9a2ecb56c91ea625b9ee03cecfe58e4282520eeb91cfbdb18dce012bb7efacee73abaaa5ddc75beaabbb33ca2fb9eaaaec9d3e960eb88feee485cdfb9ffdac16bbbbf9c7b7a1ebc9b07fcefb88d6f6a47fe7c2a342d645f1acfec5c794c1cf36aeff35febfddb8eecf000ca81fbbdcb55b53a661ae5dcdabda28f3d04aaab37f279d37a1e82adf686a5b0bfcab3ec6b9fb0c484badfdea2ac9fbcaa9c3da53dddbcaba2d5bb9a15a7f4cf58673d29ce68899f87ee9dfddc0fddeecbbeb600f941f4ba6b1f8dcecc6bd9a5759cfdf688ada6c01df78d32aa6dbcd8145f5528e793f07fdd97ec777ec28ccb36de6edfeba35cce1358eeea17996795783c2ce5c2c23fca60171ac89b8c18ae4aa7fece5141a3bc34e2383932ffc73ecaaeecb05c617db2aaf4077f62cfdb4b9e05346fa9cb82ffde6d9f6a4e9fbb1e49dacffd94597e393bdf9efaf848fcfd3441bbd1a9dfe9e8bbd29a7efb9bbca9dcd1c7dc32fc026a9de74df70b8cacbbcbd5e4054a9dec5e80d0d9d7bcddacbacaefb9dcbf47cbbfbb503abc8411d6a7e7ccdc6fa90cfe8f8ad05cdca8ffa4e75fb9b81be08757c1dfb43dddf3ebcaf1bd4dd4f0c8962ec3c5bdca4c9bb0e4a951addce9d1ed87c0e39ffc3a7a189fd8a62dcb7bbe10d9248efb3de2758ab2ca0ab668fc8cc8cbbd5639aa7f2f3b802f3c699aea8e91ed8a58df11f2c4be4eb8a8eed5bd5ca9a225e8e8af37c2aec7d714be7ad0ac7ed64dbdc50251cf9ddb0c23af834ffe0892a8ebfbceea6f471cefecb3afe87f21debcd5010fd3bf79d3ee2af252f2612a2d78ce5d6e7cb0ad9b10edbaf07fa4c1caef66add93a0bfeedce38b17e6b2db88676c2c5cbaeb67f2d4facc925cb7b0efacddfe35ded7defe5e977e15c71997ef0479d97dacdffcbf2c0c06b3fe8d0bc9a71d7fdebbb2e910b1e3004b5ca88288f1a2bf84ceda3e5e1a66672cec6bb759db7faf6fffea4da7fa462f8b418157a90c14d8c1c75beadca0919043baea22dfc6b6d32aecebf7fdc1cf2ed5f7f58fc7c0c0ec55faf0da4ecdce7d1e97faf6af180412f5be6a44d9c64928ab33b6a2cac30def3389db95f7f32eb56ade3232dcab0c7b6a850d2afd70ed2bcfc0db9e0dbd46fbaf5d5bf31d97c6b26e3fa9908cd9aced2833ead9c2e4ec870d1e9b7fbf2233d1ec64aafde62ac0f8dc6b216afdd2b47b6caeeee40376ecbec0369aaca715dfdb77b99b0f7de8cc1cd6111ccc9e7ba81dfa16d36ad9cfbc8bd0b5df3b23dbfd91bc0a0debea0c1b7feef77eefbc1fa2f8eedb5f746f652c1f8639cbe67d30d9ba729dfebe41ddcc3ca1ff6cc4e7bba7c4fb2028b291b880f6aff9db3fbe8fc27f0150c408fa0eceef5ea736f8ade2b7d5fba43f487ae4980efacbcbd80dea9b2aa04ce4b8746ecc2fadfcbbc4122ab49f6d7a86341eedeae55c31748cafc29bbd4558949eff8724abf99ee54be6da344fecc8cf27ede8225a05fc5dafee1a131f060e92a2fbe83faf595bcebb6ba51eb2f6b2aa76a1f4cbcfa4c8ebdaa98a0a56151ad13ddda5aebfb2bbed57daab66a61ac77cbbed19ddc8a6537eafb4c86ca6dc2fd584a2ecd76abcafaa9866e81a8e5f5ecefd9bb5787f9d4aabefb83bef7abf597cbbfca8a932a6be19a28fb0a88eadfda2cdc342d14327506d094589eb95f4b6bba54e46741106f7211ef4c77df0ccfdcfadfa4995ea973f5f13ec1f9cdadbc1b6b48d2a11767d9ba5e7c807b0af2fa2fbbd03d69337ff17ccd63b0ac17d24a0de4dfe9aaee86bc7d0fdea34b52ca9ea66fdfde50e4d47bd71e10661ccbef40788d0e7d03eea42768a73f2ccc6badef6f6eb753eb6c03bd6acc1a420eb3c300afbfe8a3edceb02f6ebdfa7cabeafce6c0cad46dbea3a29587f0b068e389ae869b5ae47fafebfced6dea3a8b66dd4e6bca24cc3ffd1acec7a7fae6132dacbd9ec97f7d4b9f9cbdfefce60a9b6ffcfeb2effd62354b8f20c2b2dadbf0eec119edc74bed3aff645f51fd90621af8abb55d9cdc37e52dc90b3054bbc23a5fbc19dddd6c1e8f2d3fe57ad4cae2dae9fac15caa2ead9ee7e33be6c47ec516bce5fb6cf10e5ee4232ba8cebf5e7401f6c0b5bfe9b2804c9b92942e1fc8bba31bb26c404002284a2c58f583d8085cb97cce17e20ad7feeccceb478fec56c7aea01e8580eadbe8a65f5737cfb4d4d6d7ce30b16b6a2eb5fc5cfb36eff87fa1ddae6b8cfafcdb88d8de57e8e4c458af9df33ac57195af0bd40dfd4e09be761fd60faeb68d73fdbcf9edb1c27af0eb0e4993e4ed61bebcdc483eebb27aa36f2ecd2accb2d9d7edcd717be1cfe732fd7aedb4db28fa7ae12f1caae3c3f81aaf7dd6b0ed3566641aafc5be96e1304ddb48abb63e4ee0a316b699b66e6bbf2fcfde85dc9046c234edc8a9a987c687fa7a94e354f2f3c0230e109afbabe78d013cb015af289c49de59b8087eacb83ce50995eedc4b96d8e11c97c22d2f130b2afeb6f9d4dcedee4fc3fbcdb98165e11ccd6d5ddbe0f4cedcc8ce1ef012c3ddb3d17119a7bff8b1e9cffbafd0ab6bc5db68d5a2f50bebf92cf8df4cec32df1daf6f391b1bedfbd8f6cdddb5ae8a4afdbf05eba3f7f1b887a9994703edacf454d7bd6674baec2a0be83faf9862be5cacc8f6eab8d4323bf45d1fde09f4bce66b37c77763bd583f9a1e7cd3ddcee9adbabc58f304dce1aebccceaa24c23d9d09cbcd2ae3ad2ace95ab2adea70a9cfe5d5ce55d2cf1ccaeef7d371dfd75670cb9d4f3661ef2c5bb03946dc7cef49ebfb65df1ebdfafe26a82cfff1bc962fe277cfdbeb2d2fce36fa7c7ee1a6e75e0db68d6ae984abd55d0b80c2a3b3840c85a754819f56172da86ffffb6727bc5e1e832eaccf9082d5d903bb03ea96fab94c57cdafa9c9e4614a46adba4f09326eff20d63fc1f8fc5beec0f9f2ecdc3e7ed53deebb926df74abf1c50d82dd74a177cc271ea511af6363f8bd9bf9d4f08022029eba76acf7b617efbfb8ffa61a2663ce74c81956fb14f3a61dc6f8b80513ca9da0fa45ecde0ff980c83b5e8e8372dfbe50af0a6d26ebcde2cda6d7d0bc7bed0bd2184b8599ca626cc6170653e1e5f5cec15ac382e51bf61d21fcf7cbc9c8d49f66394332ec0ff2d80814f8aa5d06fbeddc31ef8b30ecbf74caa8b58fc8e49952ecedfa8675fac9ad5082cdb6dde939aaab7cf8bed96cbd4f1fe14916a79fbdfe5be6dd78f8a2ebfa6fcfe3de0b0b8bb4fb8f5dfc6ce8aedfecf7a5c9022f37aa98f08dc2e372b32ea18482b3def8a8ba8ae24aa1e63eea5174925982aa1b7d96e453bcd2e6370f9bfda23f1e1b2eea46bffcd97a47ae307d8da9ee8baf1b2eab8565da4dbefeaaa180bfcdbb580cf2002de1fe3c87b8ae6adccef1ca2f542bfdf8c8b1cfaefc4cbf9bbf0ccbadbf9f12b345cada0d98518daa4ddea459adbec72b07f9493bcee7fdf5a069eebb9f9dba86ed49fbd65e4faa04cd0696121609fe68e23ffe98f59b28b52a3263c57acbe5ccbeeed4a20df9aba219dba8fa5c72a7f478f61a1bbe51a7afd3bbf3a1cfe49ffa2ef285bcda6bf5e3f89657050e93a5648bac02ef8c3eec8250bb686a8f7895df53b4bf77d6f20649abc7b49ee9d3f4ddb696e04e36a2ce91abd907fc97eae5ff0baa9ee68eaa8cc4cd08fdcccc77c72d2b28f7cef4efde2a4538fca8cdc34fc77df7fe801add213c034fddab2c3c3bcdd55f7c046bf7d4f2f0df24a2bbed0fac12abaeeb23ebfaf5615eeca18cca7c52e43cef40b0fc5d3ecff55e9bcaa71cbd0aab6395183cbfdd4ef9b33dbbe3dce8bab3c0adf6a6ebcaaaf26c4bc8ce5cc183b6f0d620c3ebaad3ef3a5d3c2522d70fb50cafcbc744c3c3793aca5562b9edde573224afbc2abbba677131cfd5742ffb79b21c7b19f91703fd3bc5b4ce042619696d5c73d38e734c2bd37f8abca8c3c9cdcc842f57cb1aade81bd8f5caf5c767dd8b0dd74e5c3bf310e910fa6e69e9775ffc3373cb3ed6617fdb29f4deff3bfb02ecfe93cebdea82d7273d14fbaae400ba302fe3e0bea9b27ccbecc8de15acfd9b45c2d275e380acbdfa0c42199753346e38bbbdfacdbb5c63394e88c71ee1ee58496f7a7e3afda6e1f4e02e0ae70bbf0beb8de13ecdf0aabcf5fbc739ce088ad544cfa5c3aef3bffd4da900fb02672f32caddcbbf44e7cd0a4fed8f1bb3c37aef0b43df0d7e308e50bc9e2d1b6ebd5e5412f8cc325edf64a509c9a4deaefd580bda502c0e657f76edc8fa93967e0384acecddf9cf2918fbbffadddec7843cc4aeeb0e232ed7c9d0a5d6fec7bae7a09d6db9abeda3dff7e4764f456fcc194d2d23eecd29bb3ef2d1f6d1d99bcf09ef57dc89df82ee65ab5c1cb9e5fa30aad709087e15d9c95fb266fdfbfc9c625ac77ca4d3ca385cadecbdccee3fe6caf69ef8a5065a7ea25acb653ad5f98f2dbaefd9cad462b5141f5cf5df6b9fca0ebb79f50d9f9c818de557abbc7bd3baaada8abb4eb4a7a47eaeebe2d30ebec5ecfc75a49edcace722765da6daeaedd18dbfd3a4bebadcfade577beea1782b41f64e7a7ac878b6a356cae9ecb28af236bbef8dc79bbf6127f0abc657ed5b79ef93ecee98bf5705b5f92efc9a0ec847ddbc9b4668056861ef477b86cdae87289ab8dfb01fa03be29c4b7a1e600c444e96e888bb1eb46ff9abdafebac5a09a544eaaa427d654bfdd99e658aea82b8c7e3ebfe9284e49e1e8e9e8bbff199988e96ec4bf8bbe96ffeefa6d2849d5f0d4cacf7fae9dfb2ccc23d83caa3f1bb1aabdce8ebf4edcdecab7467bc3d0b2bf3baa40bbceabb9cbea5abbcf5bd03b2e8aebd3fcc7aabd5bcfed83da787c5ad57dd6f6d51be75dc5d5dcfc6d12206b0cbcabf6f82f0ecd9a355bc0a16fed9ee479c252931ea45be3becfd814ce6eaf536cbb9ba12ac42dbb7ac0f4327cf8e7afbe56dea9beb24cd6ae43dc21f5aed611dca9fbcd3dcf2e7d979cab801ae973d1dfdfdbf9cdaf9ac6198557b7a1c0cdcf46a03e022410e28d2abc0a71ce1329df61ee4cd3d19ed049cbb7a8d70bbefb617b633ff134ceeac2c667b53445c4a5df3a4ccd34b4efeebf921ffe7601aad3b0c04cffad3a8bbfaa5edacea6a7ede7ac7a8decdd917cbc9b59e2fea17e3c1fabf11d023d82edde8fbdf1e4fbeb221f1d7ca42835faf313dd9189dcf1212e4adba3b62b1e0d663e8d60c40ac02ed33fc8f063f8afb8beaa82eaab2fb6cfc43bdcda8902525cf11e7afca82c03b0e5bcdac4cd9c6fed46deddfd6b92ecddb21cc52a1d45fcb9faad3d7cddead6cd95bd52cf6031664cda0a715cf6c0bcebcf3fa41f3f0ac25ebbe8fc8af88f7afea2fcbbec4fbb2beb27f170e860b3ee1eae60e9fe43961af4f5a5cabfe3c15b49b74f28dcbf9ceed3dc27bb18da8e96b558a3b481ab2fd75ac084b102aa593ea32b80aefe4e3d3ac09fc5e7b09d84bf1e9ec81b4a1faa8ce0dbffeea0cf8833dacdf3020e3c9d07a693c62014e8bd37340cafabfde63f9b6275a3dbc1ac9cceebdd75bbbfba3e0b5c4cefbd60dfcba08c70dfe3ceeacc73f1cc7d70ecc9aab6faf3bfd574be8ac81cee7373512aa1a2fa36baadb8e08da0ab58dd92a1431da223454e4ccedad45881365b73c82cb789d7ec5c0a93dccb2d4aeb3692be46bfad952bbf4ec27c97c39e709b20330a169b7d5b90021e24e122bbadee24ca2a161f21a523dddef45bb3e13638a54ac7ade56b8f14b7bdcaad28efebac66b0ffed1e2eadd1ebc9b2ed6da78f610cc65faa75cedeabc4f614fbdfd070f52345f5b5c00af32fd2bee7c4a0b3025984d1892c0a72f36df7e1eeb1bd0b0fd448c9d99da65eb047dc772101efbe7e0da96ef1a9ee30a32863cfb8bc5c4e8eddfdbad4f4cad08facb1e6e08f3d9d4dacd73c41def737edcfda4cc5fb19980f667e107ca9cffbbe699d9efcdbaeeeff8d7f01dafba08af99fdfa36d7054e82094e09ade0b14cf238c6dfec95ad897a9dbbb2c859c829ecc8cf4d7d5c3a05805aafac51a95dbdfccd870a2c15bea1fb70fd408fddbddfbf05d3ad7e7cdbfb7c3c20a71a411ef3cf8abfbdf50fdab66cccfaf15fe20abcc8fae2b34f270e0202b1bbc91ccadafeec8c209edb35ccfb9469ca5d9adcfdfc9acb1c6defaf35a7fd8c54b1f9fffbbaebb294c089a70e9fbd5eb0b4eab7dd830c28a6d840bd7ba74719c5bc951dafbfe09c72d55fce7de4ea8a08fcb09276baf7cbefff6f0d043df03baecd7ba68f5bc3d9a0bc09f02fcef9e0abdd5a4184741ff1f8b5ed8d3eae388b9f9462e4371a8c680cba41f81f9dce07ecddd684ee5d532de00c5e9b58ab8cbc5cffcc6922756a0d064e84ea55a5baafcf29e272bd98bc4ae5d3eea799fda0e55e722b7c42bfca4cb2a0471e1ecdbbca0fe32ada9047c60d9ff5235cca6e8eb6ada43963cbcafdff2eb0e9c34e8b2dd3a4067ac65fe4acabfcb9d3aa5aad28cea0ee9bf2f603e5dfff47510ff3a796a3df2f3da0ebdffb87aeda03cce8febcc4ba13e8386fe30b1cebacc338b1aa52dba7bb880c72cf7ffd757097c6428dfeaf4134baf27bb5ea28dfbe39d31b64597d9cf462a2b860f2d3fed0167dee3f1ebb8f21bff9dcf6f9799265d9804dca3e4e1d36f7b5b02f95afa6f8cae923d82369f5d2fcacd33bbdbafeac5c26754baf14a04f046b8ac1e907a8fba0e0d80c0fc6bc768beadd41f39c1d111d2b6b2fe5d7dbbcdcabfbfacb04ebafdc0d7eb5e2fed249d8561f3cd6c1d5c57722ab2bc4af19efddafcfdf8fedfcbce06ba4d82e41fcb3bb9b70cc30b6accaab54aa912bdece76eeca6a2032ebbdf0aa9acbcace80bfeb2d9aaad0aabd3aaaec0fb5eea38eb7bddde50aaed84f439babab1de4c6b60b84965a23bb058edd5dcb0e4ba2dca3dce5afcc9fc11adcf18ac682aacdc8f575a53d3e6240794ebd59c10639ba7adf3322352d9ab9578bfc88d0cddbfba1ccbfc1dd88b78cc3e734ccde327cc14a2227b19aaa1af8bc9bacfd29c5eaf924cf8df6f60f87073fa0bb388a05f6e9b860ba5adaa3a62ced21d23cded375c939ec9c374e2c81cf0b4fb5ade8ca0b1ce0d7000edfe1bbfaf13cfe8fffbb64d1efcf41e3af85ccafc3bebb13ff8f48b3d0dcc3cfc5b5adbef8fbde5db73bcfdedccee7916d4acaa1a693edc81794a249c7ea9435efca5fba3e9ccfc839aeeead2c38c853796dc13ecbae8af00fc7fffeca4368cc1bcdc2e75f4fe88845c7db6cda266620cb9b1ae8abdadda4de8f221cfbd5d3cde76cce9ecaf93cc6dcb0ae3caea76da97dc876b8dd01fc8a703c6b2146c032e5be26df0dca0c5d0a953667c3ea67a08e6c4633878330d2caaca3e4e8b8e07efc67bfcf3945acfaffe011eabdbb2af5feb3da681a09041e8ccabb2abe094db6b0171ddedafe9cdea72a3ecae34c6f8e97b77f8961eaeb16bff9117946cbddfb236b7c066a4bbbcabc7cef13493b9bb828f5e7f34ce0387fb6e15ade89ddf8feffcb45476f20c21db85ab957fe98a2a8bb2f78266e48a91eb5f6a1079d9f1de9b726ba8ebb5f61ee5ded3e338c3b19ca1fb97f3d371acb9898fd6bae6cad3aaba2fce0aaa5cf7b44fd1054e0dfb26992ddb4220afb167463dc73aadbeffab58ef6ea33d4aab47e1ddefa7ddefaf744bd9638fc77a6abe39efac7a5a1ad9c30cf453668e8a15e8b02296ce6693abaff0d251084af3d3bafdaebfb1f1e0f617ca41ee0ea7c79f5c1b0e245efd81d16acd9f2bc7ebcfb3bbfac28908f7ad44b0de2a97dddad6398b1d31fece1dfca2b3f519334dd01c8a9f34a2cb9a4c7e493eae9e11a8ffc2e7747c56341b9c45bac253bcdfe8f28af1d5daeae19bbf8afcba7ca1c20eedefc1de223e6a8fbeda11af36ab10b08ceeb3223fc415a8aefba2c2e4ccb789b15ef5e31a823e3cbeaf04c48b98ab32e390da577fec2fa8bfb7d8a3efa5f90c68ffbcbc64e8fccefd4db75e9dff78baa6c8c6ac15bfe9e7bca8b2ef14a48dfaed511dd4a0ca1c4f74c1706e7ceb9edb584536cccdddf22a2dabf54f62dc5afdab64fcc1ebcde199fb4fcb4bae0d6daee54b3a3f4ae4af2fd33b13c27f3f97bbef0f6ee8218ef778c3bee130cfdd4ba33bd0a8db1659d69b0c741dcc3761330dacea70e4b6583bbcbbb4cdd13fd6c97d44543d9cbaca08fffe98df09ffffb732dcac6b4dcdafac0daeee0b6ab7b47a738a8df5d769fce9b4bac33135f793d9a476feaa65727b121a1d37cff8f370c5af086bc6b46e65aadcb9bbcbc066e4af1eb79c14c1b0c2c45a75f8ddb666c3967a299d0c5ac6e941cad0f01fd5bfecaa1be2fefcf19bba5d9331c54ea6bb1cdc051ecd762b876b775ef5bbc4ff6ec6ed09ba0ff386d4ef7f77aeceecc6dafdaf36cbab57ef0b3eb8a3aaffd72fa0bccdafaadbfc0bf90cffab9b02b094f0e8fc354d8caef66bbfebcd9eb03ec3dc1cbfecffad6edcb376f2e39c0dcdcbb08983aecb7bcdba61d7a43fcdaeeca2d45a4fdcc502a3ed19d7c8de028dd918874aef509adfd113afc7630900deca93de023bfaaacafb13fc28c35aadc9cc6c4cc85f02bbbd5bcb181cbdeecdc20be26fdd8c6acbfbfb1ba0b1f21e5ef1a8acb1b9c41eb4c8a4a2ecd8296dd62a0cc6c00e8cf124fd6e0c31ee63a7c068cd73db676f69d63652d9e8fdb7abdda6e6b6bbe635e5c9d5dbd8f93c6d2e1dfcd6494f5aefdb0608a6b3eecec11af63da9feacc77277bdedf4cc2f04908fa2e33aa3efcea30f94a63c3bb56bb494a6e5ecb17bd3ddbc76ba3db8ecf0feebdc5be94b0a79b8c85cc5d5ddaffdbae1edea1bfe1addfc5ca87ac7efd2a7d1db150acbee21f555de8cdac19bcaccde8bb3bbb7035e5a0d1c7edfea089e328ef8b0d614fe7f57d5cef094a97b9fc6fd211e97b7aa0beaccefdde1e80db9f18a59d4761bdaac34eca6c4bd7dcadf4c9c937c13cfbfe24ebfe82bef5b10f123bedb761a3ee96d247c2532bec66536fde332b0d62a0d13c3def3ab51e3e5e18f53ee06c48ebaa9302c274afe021caa1260b15ade3ecda6263ce37b5e2ede0c3eb043debff57212a2db2647bd4d6bc4027d2af3a488cf6d34df741b0ba448b36a8a6dfb9b3095bc7f13efcb42c92b5dc5e6ef2ca5b01acc0017b67ec7cfa8fee2b2bde0cb3baa1c18159edfd654977ae6afcff372e752fd032ba8e44e0b7be17ceaaabc7bdbbfe9f808daefc2d3db685e5ff7c50bf8289f2665da8409a4b312769629b8d19c02a7d379b260b3ecd771e6a7206caf5d5c9cd7fd4c8a1bed5db0b2fda8c9fe2734ecf656d0b92c87a5abadcb8f0ce8d559f7ae29efcc6d095f4aaff7a5ec7dbd5f73c84ec65aaf4fa5ebd3f7e5cacf7631867c1aea3ec4fe2ab47daf30c250b2f27c0de3753ca1cc0f9b8f38bafc4dd20dcef665aa3330a116744828da88eb5dfbbe2458b4dfdb77f07e1ddb2bc2ab88afa2d8f0dec6ebfe8ba45da27866d66b7ec2df85f4986742d82f2c302aa22ed722fba0cda3105b8ad84a3553c0dacd6d6f06efa0bbfe1bbcaca84c8adc047217aebb1e7f350aef9b5b71ac5f2f0ab2df0fc8baa04371c5ed363f5814adeac6efda6cfce0cdbd35acffbfbbb50ed181cb4bcecbf86bcac5e26d4bdcf13bfa97a4bcc1ed4eecdbe3bda42f24ec6beaa451ae66629bd3d162bea8a32aae81ff78c6d8d4a5a8ff6babbd1a0eaddeb2dfc4ce485335f27bc4a8f72e2681cd84fb37dca79bedc0fcf7dfafc6cd9b19afcd11c2d74f9de0ebdefd112cd0550d6143f4211c41e0e0552aafcf6cedfe3bee36eb37d40b75f3e2bf96adddbfdfaabcff2fd42de7df6f1dcc446d8ceff7b0ba0cd0ca7fcabfeddddbccbfa02faef728af4b23abe626fbc8c7d8a8dca5e5dfb0dfcf28af6a3e1d2baa4ba17bca54d901cbedcbd457cfefb4fa98d6d52c63addaaef9aaa670f78ecf28bf8f8ad64bd7fb88f3ceed27ff5b541ed0c6faa485bedefbb979cd16ae8a4d27222ac14dcce14a85bcbef1c8d28fefc760aa8a0ffdfedc5e32fc6aabcfeacdf3cf3f2a2dabb47e3ec6af9f4cbe399ad9e6df5a561d9dfd9e9835bc9ded628e85a0a2fe0e1dff5f5ad43e8cac01337dbd6e0cf619b886a73d487d770d107ab9e9eb2abb4c84f6ded10cdbdedd4dae27eaf2cb18c4847f8c3371c523f97dbd2efc3d65ebe619135b77ea7d13087b349f76e9deab9dd11ac46dd9bad419cef641535a112443efa3e0eecfef726cbefc5efad482cbcbcbea50fe72f053ddf686fbcd7ed2fcfe1dc015fb458a5ae2ec7f2caf783d23ffe116fe59a1cdbcaef68beeac2dc33abec19cb47c740cde8ebf230dfd9258e6adfef94c7668045ddbc0c8da1004ca9a10a773e3bfe6f19acae67ccbc0294fdfbc9cfef3337f6a48350b376ae56d73da8fe3a04b2d61b901e7dc3eff31bfce5db7ebaf87aecbaf2a6acfd21cbda520aacc4cdb47b4ff50ff344a52a5be31a61bccffdf4aca5c2a244bedd4ff02cfcf5d3156380a82fc0efd8504f94bdef2bddd71baeaeced03a52ecdea1bdbde2de4a2cece69d48edf2bee3a7f9ad66fe8eac3f12ddbcdcc7423f85495754d7dab41eaca58bb4ebdacdb1fafe46eaaf0fd1eddb4cfca39fdbf5d6d9babd3ed2b6138cf99a9eed8b48aa08cd48ad5dcea2aac1e7c7baf171dcecfcfa1dbe0dec877b10e2f530be8eaceea205c0490bbfcad6b0ddfaab776e18fcde0e895301b645ed6ccf0cfeee9ec5b86ea1baedbbadbd8133eb25fd71dbbbc7fb8ceffb2ebe2d4514ca0372eda63e70543daaeb9e806aacfef0bafe3d18dbbdf6f75f5dbeae3da2f8dbc7ec9a6aea855d42a0f5fe93aaabce77422a51cfefe31a40ff3ecbdb40ea2c9deed4b0ab4ba05f93b7cdb2618ebd9e64ed879cffbcc62cfddd5acdc1421adef7d044da9fdbdb03ca6704b6bee4fd267f2dbc5acfc87054dd74ee02fbc5b4ccaf90698cc2619c54239c2fd668d1a12bcc9eaeb0efc9b8c7d4d1adfbefa8ca5ee40ecaeb7afab52338037fd6fec1c74a68ef0e74efbbe7ae1efaea19f4aec79dabdb472ae0ea87ef2fa59e4b2bb4ace7f4a0ce8a7dcbc7bdef43ac2c8d74a76dfc20f4a5c7be8c38b9f7c9d9d1e1a95a0bff6dd2213d3f1f898bfbe7be2b5f2c6ddba884ca24a60ffedd0e9cefcfac4ffef89babf3aede783c565cdafcd6cf8ef17ad0ddd434ec8bfdbefcacf6aaec3f2fff1bf4bc26f42bb3d91cbed60a9fdedfcd91a2e3fdd3bbebaeeffad86edd6492d7cd1adbea47451d7fd270ea50c80ea6812112bc5bb1f9711be7a53ab32607b2bafaf564b1c5f1de0d4039f20c6fc67a5efac367a4dfa3e45edfe7561ddeb5ef7ecfcabccbe681ca62cb48faaea2c98f526ba15ef51aaecb2edaaac28ec5e8eb0cbfaacccc87bfc1433dee045ac2bd55bfb6cccccd236e722d5ac75ce3f682f7f87bd892e4edfbabef748bda9148ecac3bedff2bb023e76d03f9d507019ed06499eed0d353d2b4496bae4e41c92818fcfcdb1ed0bfb9f28bb49b6ebb5ac9ff8a46b694912f00cbc92266ba58a55968d5d404e058fdaf2efebccf4da6e1e1deabd910dfd5aa99f83501fbbb2fc145bc4aeefebb1afbdbd2b0b23dffd6db14fcf6a98160fa2ca69944428bde5cfa01b0d17fddfeb23116886ce3fea37868f5ba944f7ecc0d7d7df50ec6efb6efbf4edea0abd9940ad4c3af4afa568e50b3a2b4c24dbf1f81dd06221eec86aad2cafdc2aed2f2ca18310f7ace0adaec8da05124874095a1da54d6d2fde6e6fdd9c930fac9f71fae95a57bcf52e25a48f985dc2170ebbff76fd5c1bbc728f3dc2da27de173cee77db7f7adec0b9dce4c9ebef02097d6cc8da300d14caacac659dafdcee845fd0eb3e8deb895d7dd3abdfce3caf3656f0dcde0ebe47daa1ea593475a9edcc31583ae2e9c4356b357de1cfb8ba0d78f23caea5dffd664f117c8433064fb99eccd7be0cfb89adbfecc6d0e3ff0a2dda42daf11a363a43eff9c34a8ecbbeaa3c69b98dbf6b3fbcb68a5076e2a76ab46a00ffc0e07025fc4cef8b4b21f21f23610f909dccbaa61ad0af03cfb0cee9d0fedfcf02748fb2bdedf13b4da5ed3c0fabadddbb7f6f178004cd2f9096166d1ad3add4f8dcae646b7bfee74fa8cb7a2b94be1ffd52721ae23bb4571adebba99d5aa5b89f437cacc5040bcadcbedc14f2464dcb01345ac8fcfc7abfacd9afd0dc3719fab4cbbae4ceec6fe5e6e84cf1a6adee72cf131ad7eafd1f4c1f5e0e6cab4aeb7bd0607f6e0e5baae01c62d7c85cc644fb05f0f2e7bfc14d4361eb96e832bcaefec9ccccbbbb2effa87dbeeba7ecb2ddd49c71bbe119afed3c4d7cacf214297eacd58440a98633a6afd35fa6d7cfe292568dbb5db5ba55b48cdfa6ae9ef6c1d41024d8a4b1a0faa29a2ff613a10fd50bad1d3e968b40fb0aa388790098b9e24c26ebce9cec4a2baf9e1724b10ddd36b0492c9e8b0ccfa4c2ffde781ff4aa498ad7775c48e89660ced6dbbd9a4bed9f5a472fa5c0be019f5a1daae87c6f9dcaddba2582e3f6fabfdb67dbd3a0fce94f1ceaac333ae7ef5fc0a8a84ac36de6b3ed9caf46fce01ab3bd5c47e56ea5fb6ec3f1eb82dab9dffee24ad3a45a0debedd1dbdbfaadbaa0f5777eeebd44b89bdba45177abe7f6b99bab6b3b0fb1ef316369667ddbc5d0e67beea73775fe1bd8febb67dbd9edd6cdff43c3ca7645aba5d86e11db117a61ffab1e6d6c35c502eff35d58dbeb7a1c051fa00db8d237dddcaeffae31255c2fbbabca2fb541da6f9a3fbe0e1a354a74a5fec1d4aecbcffa86dd8c3a6b068fcf0ffcefc4a0191db69ca1c9aebbb5abe7c4f4eb8bc54e692bcdf93e8f4d181eefade07c976aa95a7387c6d7bb971ec96eb633cad97189e2aacedacf2207ee3a4c6e94a848c09af17dbcbdbe3bb8c4baa8287abf1b08d42c4868e5bf6ddc33feba308e4aa1e9abc3fd7cfc75fad65eb59b1da08db33cf05d5ede1bfb98bd8de88e37fc6653ef43cca9bcfa8c3b1cdecfb74d4c0e4b4cc69d6df3e0adeade4e2eb4c39f1cf4f2a1bffa27f3b1debda7c7231abc6aec5d389ae68ad1f1a9bcc73daaa1e5c6bdf14b6c2f3dbeafc2be73caeb0fca4c48538bf47039aa1a9d1a64105fea9fd7bdfdda767163dc4aa7fa47cdbfecf3bd1c8c84aef13fd8ff6d5e4353eb91e02ba129d7f8362ddbeade0fcc7838c60dce964ebdaa9b376bab23b39901b32da6837e7145cd025eeb61a304fce1da8d5ec90faf2f8c6b86b51be82161db91efe90bf2fff8bddf64681c3fcc61f2d4833b85ebbc4c8bd8b2aae61bfd21411235d71730967ae762bde90ac9f68dc0c7fbba28fd9e1a6dc7a67ffabce7ec57db8242eecaea79b00e8abbe2f7cb88f8c2ed71af0bcfeed279e8d94de582044e39ec87dca337cce68fbec558a6caf9366a2cd02aed1a1723b6caff6defedb006a00375e77fe205fe90ef73e6b18dcfafe645f5e9915ff4fb17ccdfca2f58291f5ffc258f66fdb5585e79222ddba6ce77ddf58114e85d0c66ddcabda5dd197ded01a3f6352def0f4ddabe0fa95e0d4bdfccdaccda3a948dfb19bfbcbcf9e9bccc003db64ef7dddd2253b239ebf2bed4ed580bd033c0fc55c6aa56ccd1651ec056e7e7bddb2ec42ca9da039cc0a397b2adaf0d9b13bc4ca5bcf26ab6a3ab5944fc563ba6d493eca8cdcbd1cc0eae45f1cafb57d059e7accd7cf49cd9efbffbd0ff431cab5baafb2714be5bc9ad622dcac0fac3abed804ee6f3051d35d6a58ae0dbcbe359bad67d5c9feba9efcfeadd51bafe1c3a3c541aa7bba51de4cba6e74aecf40ee07f509acef85db5dad6be0e3ad9c43ec19badf1fb879eb0cc0e8979c06f0ad40f1bdecc7720afee5c5258f10ddc0365504e66e9bded1facbabddfdc6abe0add1a31daaebeaed8ecedcd2fcef5fcc4c34dbdf387aad365dec0087cb0c987fa3543e25eccf7bec46a1cae24b66cfc987de2ceff2fe3d0bda1cadd4fb64610d3fb9e5ba345dd3337affa324d93c68eebf19de69ce5db4fd3aa95960fffc0dceecd96d04291c898ddd6a1eab388b9cd762cb0dacfaef83734bfbe0a3e5eb69cd63d834d4c92b00761fbebdd8c8e7281ad7ccf409aee7ccecbf3d1ac856115f1ada932547ef9ce85bcacad02dabf95ce4d4bbddaf8eb1f210f7b2c9e67daa0d81acefdd641a3ab0ecb1fdbc46488aee2bd582b831fe4dadeee4f6bf5fa6bac55454cca3e06edca197fcc8bb8e49dfdde1fcddd574f9e0fee1e66dfdc3f91f844ddefcdb3a9f452deeedc71f9dbbe4d19d0f1b9fcedf9a26cff71b05b942b24ddcfb178a1be3beba1d1e3010afd0f6cf8004eb5dbaa2b04d6aaceae505bdfa7504fddfec5ad6e48f8dce6e1003efd40dafefc1dee6ab9043cfb2f238bdf61e84adff9d6fbc68d9eca6bff7badb430af62e7fbf18b64f3a355affe9d28ffad0560305ebaaaf49e242567a2b47741dfffdda1dfcbccb790deaba3f30b4e447bf2703131dfd887bed1c6f3bcd0f4a2f807d17f89dd4130ed76aaecff700d6cb9cedb55b9fa0c8b86aeac804d88dc0ea42a9111efb9937d70fabe6ebd928893bbda6f7fcbe14db74cc07897b3605fec3459d2fa8fe13995cef09650a90e8ee14a8fcc2ef63f4ebdfffc372aed4847d684ad79dcec3ce2f8b3230e927c2dfe1ee01d987986f8bd48fda890cecadc4cbfc4565cd984dbcd21b3d44e8100a63d346632c7bc433b3eadf4bffc14b95be4f8fdfaaba31d010ed14df496167bbd5bc5abcec9551f38bb0ebbea126fed3a6ad31abbc98ce196d2a693cdd79c44909c406cfe8bccdcdeaa9fcdbb5b1f9ce7545a15f55f1fbcb35cbda56cae493f2daec8dea33ada56c4a6aa6ccf96f4db7fb6b35eeafcd2190fd1cddffc4c40194e0adff928ab89b1026ffce4c6aebc2e7fa5be19dc6d9ad3ef1f68d6bc22d46ed8aef60768f7b90a3234dc174c5c3b7694adcbfb273bdcfc5fad609dfaf7a99a9337defb0fa36cf09ccbd8de3f099dc07110ca2f8a74d7e2cdc67cbfe7ccfdaec7c2cebc66179f98ca793c8fddaaebce58edb1f8cbfa07bda6bf5f2d5bade395d6fbcd897dbefeebcb521ed4da90ce551dce57b552cdab0193ea1fc3b3ff1666db80b226d1e5c90ad2e4bff1cfed9a240c1188cae6627b889baeef2bbbdae72ab3adcbea16a14afb95acaaa8d304acb16c7bdc9e10addaae81f0fbf3005dfa02effbc72ce0e2c597803c9ddc64a18c0b6fb5b2be63cbbc8540bd5c56278fca7a4c017c89f57658bcd0089daac8ec84a499a6cb1f3cfec874f22b46057e773e24da1ead9cefbda9e9d08f8b7db9c45fa5ccd0ee956bcabce52dae07b9f7b9f7aaceb3971207ada3e4350ce7813b8ee3fc7dde2b4a62b911aa2bf25f1c2f4c7ad7a2be34c9b0a06a7daed124c4e2b22cdc115ffa91c3eff25d2ab6f61d3776bcc81ffbbe04aeb96175cb1dddfa9c84a7a9eef3ff7edcebb1e12afae66a85eaba5b9ef15bfd0cbdd60fe8dbf7dbf17df906caad7fc6a9cedafb8f2bd11f4eb37f88e07f8da43fffab03fba7dfce0d452ead84fdcdd4dacc28ca246a0d0fcdd1c7d85db8a36086aaeee2edb9b4ab9cabe14ede716deaef6c4f0e701b4ba85fe0b6769e52bbbdec72a3afd6e6fe040474b15a5dcfb38eafb69cb7e9caeec3bdc9deabd4f5aadf1603bc1adafee097cb9b3f4dfd540ac7ef6f1ca46aecdca942fc0c9e775f39a5f75fb7f1c0fcfeb7ea0d17bc180c355cfd2ecffad8ed0d0423a462b3cd6edbdf3f19fed4ad05999fc92f27bb0f1908878a3f5acac1aaf56ac3e3f233fbc75ff0fb0d6e81e22c4bdee4ba0ce9dc83334c4c9c9ee8650984c68df2af0d15fd6cde11aa85d9d55de0d0b446dfccbdf4dfce71aac4fafb9d0ee236d858928f28cfe4558c77c0a34f0fcd1ebdeeefe3034cbada5edadaab77f57b823bf7c23ea4afcbb9e9ed86aabdc985c967aa0026fea9df87ac3c99fce87bd9aaa5ea993d7d50b9af4c132caad98adb244b3c2df00cfdcba551c2a09df4efbab7cef3f264e49ea6ac5645dffc4077fdf854747bbcd7108638faaf198a7fca2bc24ef2abef429b0abdf592f1ee0ab3e92bd316b84f0c20f8fb33fe7ee7bb25dfea0d5f2bf440fbcaf4edaefcd6caf87faffeccedcac1faf7c6de7da0f56c314fabbdaa6acf1967b397ac509b33645b76ece1ea9ca41c68ae59a84b7be515fceefbd0cfbdb3ed7ed5ede4c7e79b1b2c7a7131cbef73ed8c5702ebbd241abea2afb8ce5fd4a435babaae81a74a23b1f545858aeceff66e7ccd7e49f0d31ffc2b92a4b8cb4aff5f290c25b8f0d8b7871af7b5e34e02b89aabe9ecd00dcaebcb6bbdc1e7adaa895527aa47c5a2a1dc0a27ba4ba4cedaa50fdecbbc0ee730ff30e78c44c5fdcfeccb6b2e25e9ebac07e32283addbabe41dcd1e4ebdff041a34b7c031dd9e1cdbbedfbeceb571959e40ebf204dcc54429daba62ccaf800b598e8d0064df6b5849e6cfcd22d3aefc38fadc07cf7e9d7031cf8ae11bfadd1e18beaeacb55ff161f26ee41ce3a6cda461c3bcc2b0c163a0b2ec927b795039aeaeaab9be1e2ca9ce2a532f5cfbc2b13ddf00fbbf4ef87c075c99eb96cf45fac35ac88e1b22f6ecbfeced7efb8ac26a3eecfe76a13ebd5d4086b571c53174c6a89255c4baff22aee409f26ef27981c27b4b67ce267ceaeab31b7eab8adf0bba24f5eb2192a5bef0a8522ef6e1c66f2fce2fc4aff2f5b1ee4a7abbf3ebc09ccc06c231ead4b4b04f8ef8ddf59a34acafcc42b3a99bf1bd33e3ffed458bccb79736dcbd2e15e0bcad23c3dcdeeebdffcefbccaead2cafaafa188463ca5f8cebdfe0c505c0cc4ebedd8caffcff1abed174c61dfab59ab3ed0067ba2ad39d7def88a53bc8dccbbba7a4ba8ce1fcb822edcdf224fd586da537a442281a23a6f1baa4b21873aa5344b3aea20d782543aeaedd1cb9a680cfe1c208a48a17eac9cbabcff6807f4948324afaf2cbfa19e0ee1edddca279a9e0a0aa5d99a1bd5b128c9baf0f83d7400a13dd5c268c2ac3aadedd67f7fa59256b7edd4386ece0ec1d1f2983adb25e0a9b0b1aa3d32ddb9dcb26d58ceec2f02d39fb4e232cad0fcce37ebfbc922dc11519cf9925c1b0de1152546c8d714e40dd4b1c1e3fadbd5fec452bad5b2fe362d6d358faf5e9afb666dee831dbfae690c1ab76ec6f6eaff7e3ffc225cfb426aedafd6fbb37dfe371b84a8e60d55ed1d8c64ef4f96d832d3fa69fb4cabf6fcaf8fe66fbcbbc3fffae6a39647be37c8a1bd3e946afdf17b644b2dc34928c98aa4d50ec70acdbf5ec041ab5fe389ed6877f274dddbade41e7eb1d5d7998e7a6e1ea7aaffeb42a44aaf0ce7f9bfcb6b9ddfd2c34f7cbb75331afd751bb2a8ebcebeaae394b388cf1f70cffe97f131dbcd3ccf419a63acaec620e4be7aa8db8df33e928f45f5b942c1ba0bf2fd0a6de9b36c947b05efda13cffd94a5c8b1b2c8ab1adfbb44d7affbacaf5f9d6f6e15b2df90ce3c0f9f53be10e69fe627a4d3ab4d79c99cf75fecdb3cc2f7cbdaa24c84cc07db5a21cbad482a2faffe24bdd2f0ace504436bb68edc30ae60efb3534baafed9ecd4112f1128c4216ae2551df29ba7158fcc278b19609cbcff0ae6daccd1b8cd1ccc3761ed8a6facd1dbf2cc72fb991afe70adbadf419ee1aedebc93b24bd28e2fefe2a2cfac38e78ac582cd60ed83e8f2de54dfadb3a52d4aaafaf3d3addbe13fa337a4d0f050eec96ce103aec5babdece9090e70d2b059da2aecabf9b79fb55ab65aab0bcd0d6aca7acdb665f04551b85ab14a080dbb40fffb69ace5ff0dfe3e5a79b3fadac524e910eadc1eca51459d6da1cef8d131fa95baead63af5e754ece737ec3d29e49d1becce4d62e9cc9ddcd753db0aacff5a9a4dd5b0ae8ce8c14bcfbce75a3be2d0f902cc3afd7b76db65bf4aab463643bff99dfb225dcceb71ed400de2d2eea4b7ddf5f5fadfff4742d9ccb81c4ab2b38f8fe3ad5abb8e3a31e28e6e691b74b51dfb40b99c8dccb3a63d3b21f1ab307354eebb0abe5cf45d2cd6eacb13f3c63a6aeab38f21ceeb78b85ae2c8f3f140336bc5eef6e62f4b55aaae9c6852d31739d8af9eed12a76387aa0826d9641eb1ccdb99cbec3dc3db4bfa69ab64713ce640e2db9524dd33ff6d2b82fc57a36f372ff6a637f3db1b7aad8aef38e8a2d4adb25df3c951dce141bee729ded992efb173ac25916be3cca2df3a05c4d0cf0bd5b05d1b0cf768addce3732e25b1e87ec79077e4bd6ea055e5c0f1c46d4dfa521afc7cd2fab9aa926d4fd60dfe5b79df25f7afff9b8d65bdac73ffdec4e0a69f66156bd51fdf42ecfdbcd67b5eba9dc433ed7dba89be4c3fe4fdd61ceebefe8278dfc16e7beb0820c1fbfed6c52ae23dcb736ee0982328b722464cd3b4d1e9906a27afa28b455eeb2b006e7fdff28e2e6cd9ff355f0dadc6e62ebfb6d35f2adbffab0dfc20be860c3ab70dccde11a801fe1cc9aac73b6d2abaf2c67fa265adfe3cc2bb7dac79aaa20f3df49b199db58abdf14e58ca7ab7ac07317d2fcf20f1d7bf8a2cbd3de6c9caf49e6f9e445abefc92d6b3edb6fbac9f75b6c0975bf9afdade5acbbeadbabd4aa017dc9de9d0d6ee7e5bc091924428bec8a6bcca2409b1afb68d2db804ce7a1eb9ef52bf0a6bab8e5bfbdcbeaaff68e5fdd2e3c4a04a542eafbcddda63eaf27d22b1b87b8b03ade75a7feeb2335cbbc77cacfcbf7a6ef4fef2db3eed8b697e5e06aca8d6a597ceef00acab7aaeaeac39c6bddd856b570eb62cb9103f2fadc5f2f31fdaefccdb57d5f36edacfbcbafbc9fb3c750ca95e882a5dfb9b00cddfcfbc54f5f9acf2f05f9c96baf3338d9fecc6fdeed239088f96390b91c1b44d6cd30beea87e429c432cb59fa1c3cac7c33f5f4d03bad2d5e27b2dba18bc37d9d687e650e4abbb4bd08307f06762a89a37a16ceba722cabe6fcfecc424acee6f8c2ef4b027010cdcfdb85afc8f41fdddfbdf9cf515cda3f7e9ccb1afba946f5267b0fcfa1d2eb12e4d1af40d661eac4cabdfba61b755c1cc0cbcda6e5cfde791fcb4b92e029ddc29abd6cc1ab955bfbdbc1cd04df5576810948eb4d76aaffd47ceae811ddb8dca2aa45c310ed9c25162c8ba0b7ab4f62b8c9edfac521e62bc8b4af88efc81be2facbdc438be8cfccde557ce3ab6adfeee56d6ac629cca87dafb2dd3cd8d6ededfbbef5e7533211afdad36d4faff3e0bd3bd97b41667fcfaf5fe8bdcfe93190d31e0abd6eec052c92520a962118e2ebc6017cd87fdaaa2ed8792cec40cb5608cf40fa8ba09dcec23d0d8ecdd08d7a8c1d2bc697dac9fc0513b30c585fffcfd77c3e6fbbad5c64cd38ee42cccf530edc3f0bb7fa7efb7d5a1d1cb5c497f4a4986febcfbaeef69b3ae05c282a45fe0ff1ca4dffc1a3b1dddd1a53cfd5a79b9ae62ddaebecc995ef5ade23691f8312a1c9f2176abda4ae8edba49e1e48caa31d7962bdda7ed2c7ff4bf58ce57ccd9f3bcbf5ebe211fb8b1f0cbd2e5b1343b7a1e2e34fad6dfadfb84417b13f993e91daadbb8f0dca76aff40e94be5acd294c7ffb1d77ebc4caa704fe0bf5868ba80bc5c7dc1fc260635c96ceea6beeea8d4ff0c1ddd6fe24fded9cadcca5db8e223bc7ca4ac1bb80dd6edd2aa4b0a20257ac5d9d5e1c3ffbf87d2e8c1744ea6061e3ef9aecdf55c48fdefc2bcff6319cebbcdabe751157be74abe66ecd3f3c939cdcd0cb88fca910a74df6c8fc6b48807eef5a2a34be217b5988f0da6df5114fcd52c6576eb7f3b0d9b8d4a8847deefbfcf4ec3cf2eff3fb6b0cc08d7db87ef9e9a7b8d76b2fbfebd546a26fc15dea6dc0cb6feaad34b0bc9bf8496adeefbaf2c0a86cd3f02b11a65f60acee041d87abef2f3bcfa01a06ae2295bbc02e7bbb9369d3fbbe147d0dfcbca367efbf4955cbf3b5d5ebe6b7f09d93e17ad8dce54e16e9ce8b95f9de0dd6582a9a35d5e9e00cbd7debdcafaf34ff7a25d18bf188dab605060d74e70cfb1ceedd18dafdf3a987e1278f0deff19bddab31e747b32ebf5d10ccaecc9a1bc4930dfaa76e6eccbc97c3defeb3ebd5240bd5aa86bd0a8a5d28b5fbece1a8b7d8e2e2fb8cc75cfc05fd97eafdaa61daea9d66bb7e089a2b2fdbeca04b1d1d9bdddfe0d0e0b7cff2bc12c2b9fd1615c80e3bca55e5dbcedca2f1ea65ebb7cdad1a69634b4c5c7ee752893e7545af2daa4c428a1ddc433516bad7914bf74a3a2f677802fdea38afdb77bb0dcfb4ddedaaaec80d9ea2ca3a7fd90deeeecafdffbb0cb77acce761ffe8bb4ff95bb7fdfd9eb31daea4ebfebd9a1aacaaadcef9d2bbf76e9bbe9e8198180eee0fa8abcdabd0375e7aded743b4035de8661068aa6fc13fcd1be7edf6f83d2d98f3804c553926cbcfef63daf131dea5c76dffa1e2c941ee27182d55cc10eb2df3acdbd33e41c2168ff5e3ebf1c7c4d2bd72311e2eb8087c57bdfbaacf5efc53bb9e6ebcfca5ccabdf8fdcbc946c7accb57c3be33b7fdb4fed4b2b81ca0abde6a2557c79aafedb4de59259b3c0f9779eaa9646a96d5808f6389fa3fb4a4169aeaccbbedb803673d35e6d3fbc1b66346bcc894e8beecbbfb88f5be05ab11dfbe6da7be2e271d190e47c36f56db1fa39fff5db44d9cdbad7e2f9406bf9a43cbeb9a7cfb162c2bad7f77c2d9bfed6307d2afada1402cdb0df6a5bc0e2af655fb102cff34afabd3a11c4cd9f015125ff04bcd1ea06bcddaedbb1fed6ba69c2aaf4634c0e8adfa02d73d04af849bfed278f1eadb6ec9fe26cbc4a8e69f44e4eefa4d8eeea4b3b8d94b241e3960c909a6ba1d8f4abb31cbeaf1321beafafaa8c126da47e6ad2a2ae6c79dffaf9dbf2c6f0f0e395afd0248c1bdb9f3bbbe4841c1f3589d906fa82deceef62ae8fb9952cac1b4eac99f5e1dbfdbdca21c9b6b7f7e25ccc8a2b7ce9dc2cde6607dabcb82e5dbfdf064de8b2b93ab785cc6bbdcafbe2ee7fb41066d8ef8a7d6e61bba979f36befe433afcadfdc85be0f526d980bbd9cf0bbbb40faeabdeac5f9b0decb1ec51da5e72d89290a5933bcb8b92cd738309bc9ef2effb643b54de300fc1ccfa7ffc13ff6ce8f87cfc246126c8f97d7fc1a0db572dee2eea377806bf08c2dec05cbe0d3c340e7dccae9796de6b7163ddac7efe5eec62ca8ebdd8bad5041cd8ed5aec1fa1ae48ae7db1ea37bbb2ddb7aedae0f4caaa4c48f22ae3957f2dec91b5ff6c1fa0feaa45e17eadbfc46bbd0cb9a77da0a1f2f4e7b2bec3a4d00c3c0c55dfb6deedba254406d27e1fb7faba1acbe6cc6dfe3d0ddb0b1e6edcd50ecbe56da59e9bd75befb76facbefa0dcde72acdef194a6c1b3aea4e9f5d2347aafe12fe4baf5318c3a9fd5f27f014cf0ccfedcd3d32f4a3af0fc784c2fcabddb0e9ecae3e0b48ee574e55e3e6a17d92b12ebdcc1b6cbfe71ae0cd02e9fd6a2d77c2a245eb0cef90dee0ac2aa6b422f69a87cbab5edc12db8a48df734a96b0b3e0c6772feaea12f87befe5ca5aea9e7a23df73c3073845c11ac5595cfa81ff9d2f4babe1fc82fa3ab6a20fe6643441397de2d4edee4838a812c63dfff9f7bdcefbf40c20e0e026d3f7b4befcc86a99f2a1ad6a73dffef4a74d124f3970fa78af5e19e690acfb7595b690fbb1d83a3e0f2feeccaed47451a99bde504c1abf8d0a36bffd0a2d7b051fc05dfeec82ed7fccb2dcbfffbabd9f9cfef5bfa2e2c5b7fbe1af8ee8b32ad3b8a7e7b0598b8dda06949d8f3dd9aa1fd5fa865cfbc0b1c2bedeb250df3f09deecc5ee65367df8f7c9eeee5bdaf251fffb05e10f3fd3bde3fd462dca3c8ce0a8fdae34ebe9812c4db23e51bcbbd1b9f53cd8d72e4b9cc15e79cacefa3ee4effd8ecfffbaaa141749ecadfccbe276aa9fa6dd6b1ab87ab4837bccfb2a4fcf4bfe9c3f0780c6f9f8b7bd6d812fe68d6aeac7dffaf8db8a85a45a2efc03b0eba8c3ab7edd9d191caa6b34ea7d45e9bebff43c18f868e71acdaff6be2be3c54b98ee47a16c10e4fcd5ba050ce9aaa50c57ec3ea592aaaf544ec6c2c8fdeccb3eb9bcb7cfea493cadaa5a7c44e061c58f8eb17bfa08a4dcc947d245ca09d43ce5f9f0a1c853ed3b5257cfcfb29dd5116ece5fc60baadbb9b37a55dec16ddfe2b9e11eee778bdaddbacbbcddb1fd0dec4dceccdaddc8b52ddbab92c2b73b8c6c4bb0c3df18ed9cfe03e169cb3bf90e7acada801bcae9ae84c913afa912851de811cae53cb5ecca2bdf11bf4ba8a82d10c653e2cfb3c50fe5ec25ed934156dbed11f37ed8bc3e6fed5c0f9540dcdfc1effb3cffc43ddbc394fc858bdbede4b9f431dc88f5dced31d14fbb902f9adaab02c219663fa8ebef97bd2fbe4e59b0fca3ddd8d988def23de6453f660a2eed74436d0a65dff2fbf6d3ab3a2fa7c7bbd8ce76cafc5a93686df1ccf3d30c1aecab544a0c25bea5bd8fdfcf72dba7e8cbea0af75fb39674ccf7eecc57e97894bcc0fea0f8c62b954bbb292d9c6ebc18a8f2d25cf4c645a2bc9eedbd68bdf90328cde89bd795a4b2c713b966dbb3164a59ef9c2e7c7fdce1fde1d258cb0cf27b0dce8ed4ef52ecffcb5fa2fcf354c8dfa6aa2e9ecc3aa3ea63dcd52a06a3732978a72a38d28d842c4bd9be06af9cdedf8218e7efed37ae38fc4572eac7d6eb2fdc8fd3520cbfaa845bb3d7fd715ff2d9c5fedfe9ba3dfca2aa41bcdabc18acc6d0eb50f22ac23ccd8911aa9750e26732da730c7ca9b8ebe440f77493aa09764c1bc156b5cefb8d7f2228dea0ee3edf5ec886a81cad57ec00be23fed3c4784d4bc0cdcf0ff8b0a27cdee0980eced60cfade29eebefd3f8ac25ee75d6cc37e499df3ef8a177e183fac1bebcbab3596c2fe87f3b5f8fbfec2657fc5f3ceb2850c772dad0bde75195949b770d03abffdae0ebcec369ab49ca1c1860e79f2e7c41e3dc8c71a601a37abfb932c11622cdebdb5fd3d4a5a31e60afb54def28f518d5fb9b5180602e20f3affbebfcb85ce60f3dcdaacdf5adfab167eedf3cbbd3d5caed8a83e4fe64d80adef39951e7bdf85ae6ab3e3d8a2cdb7cfb6f4e8cf9feacc4226e0667ec4bebae01d7b8d4c77f2ce396c6e19c4ecac58337948c3adff8cf0495b7bdb0bbbaaafaac9f90d6c207e8c65c15f6cda9d5f79dfea4ddb175f6bdfbbd1ac8bb4aba1c10c85f946f54e42c62dee4a2eaf2dc10b29ce60a6a46ebf4e8f1362bf3b1d445f32447866eddb695ac1ecaa6e49058d0fa70cabf77d1e5135f2ae198bd3fa040dedafe1b6ce4be4c0bd5ac6fb89c1552b076aac9cf9ed7ccfc28f0df009de130db5ed6018f733bd5ddcce88b8aa524e6dbcc905c796449e088cece75f11bbf0f240fbdcedffd1cc22a72de24ec60eacf7989a7dabf505939e3a0ae915e22ddcc05d2be031ccfaf3cab4f1ef1f95efc6bfc422b77be6dbade2e3da86ec137dc72bd9fcadf7ddf683c62bfd2c0fc35eebeb6aba6c8a2a1cf48a4f942c4a8ff2aea1a4c65facdfb904efce8dd4b7fbd08f3f487fecf9fcfb5d2eceb15ff1de11d21ce64cbae7a2c919e60c8fea9ad1bb79b6fc2dae5e6a5beb2dd677fcdd81f7be7cacafdfac318a4fccd61b5e0a4b1cb027cbfaedacab15f4b3d296b48f4cb8afbfbdd3e5899cfaf38acfe5e7e6d1f0f647358a57f3c7c410cb5e35cacf75ea0cfe9e82ffd2839edcfa7df6a0c7c38cbbc7e93e5be4f9d8c1ca2b87863eafefe4da342d1472faa1dbfdb0cbf741ca617da2f89df1df6ddadeee10d38e09e1bfa71db74adcfcd9ed644ba50fb153dca4dced46ecd5d2dd2a825d0e877edee7ae8c43a0197facd6fdad0c3fface83aadb4fe9e6cfc2f70a6972a76edebbed61bf8498ba081e7f7edcf64e4638341aa8c2bffe0f64e789ee4fb547b2eefe786a8025dffbb9ef1fcdcab20ccd91c6c1d99ca6accb1ae0d168fe7def12072fbdaeaf91b68e4d47b1dcaebeb7cb7f9754b8d742a3cfb73b4f520e6ddeda40ecfbd03513fcd53daeb4f782df72ea5ac8c9abe5b33cfb344b607ddff0c91bd088109c5e77aadeff68cc3144eb506e466f5bede4b90cbcef70baaebafb8cebcffc8cbddd309f3db424edf0eb5aa38e9a9722a3d4ebac1fa9cdd7c2f3f8dc0142fa2269a82ea3f7e1bf0c6abef10dbfff5bee9f0dd83d0dd6bf7fd4c8ff2c1a193beb5b4ec3ffc3a00afcff0ebcb5fdbf8a9eae5442a946efc9e0287ae52b5ca96d1bcf305eb22deb9662041aab35aaa91f5dba98c7ecd82ffc1f2a3459213f7cab23759fefa7e8f7dafeca18d0cb6b10a77bb3bcaffd7a7be3fa67e828eb1b1b5229e02dae56159a6b80fba0fc3f7c1bed9c8f53e7a2fe9bffaf6dd6043ccbdec7bab66aac25e6b8fa3fdb5eb18ef9aa6e04a3c8b4cd504e0bf9ad10ad118e0a0efcdfa052a8a0c7bf5be6a21b981b70e0daa9ae35abf2fce418ca3e9ffac8d4bae8df6215d3eb0fea1facebfee1d6cba54bd61236ce3b0b82bd614decc6904a36a4a3cce1e0da4fd4cfd44fee743d41ce433b027258aa8eaaae9cf4fc3e5544cbea4dcede808dd729db39cab725bbb60a42f3e4ff0f7ad51e260af41cff59422cb164390ccaa9ebdced979adb17cbc8c27deb8ea144e14935bfee1cfe8ef3f3c85ede816f5e4ff4b37d3a8bf93bc34b0ce027e4ddcea959bebcdaaec6bd540cf2b5ffc3deae0a49fafa2ad3aaba8b5c3d2ea1ca1c2b3d9df344b650edeaed7439415472c05dfca3e96ac64b0cc3ac3cf4bf3e697a35eedb0abebf15dbaea37b8ef4a5c4ca5dbcc1a17aade50fbd83bdb531ee16516dbc6ca3cfaab1deaaaffcb68afdea29e44f210b67fe2068a02f2212eaca9c1cdc129a98bcbe7df1cb070e50ef0e425ee6a5face2aeacab73ab2cdb2f6ef0ba21bb490add5abfbfb99fa32a7cca9efdfdeee9aabe229884fccf2838cd96a9fe7ba199da7bde1bdabad552dba4adf48655ac3df52eda1df119f2dc3a9fefa3cb61d7dc0665c4b2bfcebdd5fc67dcc1b03e5f8ae10d96feff41b2d9dd0b691733cecbc9e71075800e77fa7ceaef401a1a836a6a75582a19579ef44d0c9cf1eedf6dab35eea41bbed8eedf8d6ad08ddfeb4cafdcb1a96b838f12f7e4fdaff4df48feefc0c0bf3c79179dbd3ed7de1dd55ccb55de906b11854b19bc8e6d1c8b0d0c8c20fdc2e62bc5e96dbf76ca3386cd1e8f99b8a5a4ea240e6aa77008bade3a118dcaca7dfc5d435e9fc9dd7fa1ce2cdfacd7cc57d07adbb0b6c9b9817581d987c0fc7b1d6d0a7a52baa9b18c39114fcc2e71a9583143a60d63ab1e32c0f96c0aa44ad9190de9120d2ad3bb2f41ab422c9bfe11df049aeafee11e8a7b87faed87ad21d8e21bcd90dc8acaabf8e3eebfdab8ca15d9f8729f11c00b66bbfddbd741b85bfaadf9d3d8affd4ea44be7f10faeb67dedccbd1e8b7b8122c7aedac8e74fba4caeac0bf58aca0abc4247fd3ade7edddfadbe0ea328214eb5d25b8fe8d65dff90ec7b45f6ccd9e7fd4dcfce2d5009f6b5b845cabcfa3b7a6fe5d0f9be4dcdd4b8de60ea7ed540b1e5039ccf31ab14d9bfaedbfc14bccf94c4aedf6a13a7b2c7bc320ee60a99c755c7f0dd1d1151d8ab4cbdd76e2e610fefd2ffe16c2db11fccc96cf8cacae7ce8c96bddb5a48a84123581431afc84dffefbbbd621c96a58fde0afcdcf2f187fee518a53e5847ab2dab5757e756b1a3e8f1aadb77fedd6b4ad201601b0fcbc5b41e7dfe7e5d4a668df6482dea4f9c6ad0c01eb02e9c580defa98afaf74c9d69e15bbbb20f89086decadfaaffd6ebd7c41cd1af1412b5a914a4b2d2d1b37d1f6996cbdccdce472fded28bcdbded48acf1e3eb42d7eaade8fdcda88adaca5f9317cbbd42caf2fcffc1adaa8f22a897b6bbefebecb2e718aad4f2d0c8f7ea6e1f3ed1faabd253dc6e2ceb2d11a214f5d1dbc44dc234a3ffff9ede3b9adc57d0ddc8ff0dd2d38cfeb00ebfd57d3d54b4add9fd1b8e4e4f0c15c7e8a08deef5bc02b3accfdeee84c9a6205d38d6d7eebeed10fe8999ebf4dbcc77ba6bc718319cfd20b48feb9b05fc3c0dc56ac03f8a2ef90aed0fa3d7bd2678cc17bd8f0ef57b6a332c3da7b335b90b0d507bff4ca6ffbbff4ab58df0d83de64d71b5ede09ebafa7e0bc5b43611bbffa2eaa38adc648d6e98cbdd3cefaf40abfc865e6ac42befdfa1df41deb5eaead7014aedabcb54a620ad6db3f6c2a3cb3dfaebac6f9ee2cf5dfc4a7ccde270ebca77be3aa2ccea0b980aa96a07851f30be7e53729bbac8ef7db7aabef93dbcfe24752b8e1cb4db285a25fa0ba2aeadb2eb0333f7ebe0bc103206d965a0dbfeadacdc7a26b8cb487ca6ee77abd7f011dc2de2fcdeb3eb2dd6ade6b4fbd79e25fd6b84dbbc0e926a9e42d35dc6f9071ae0e1984adbc20012c1bebb4abaaf91f24ed24d5ddc02523ccd9ca4c0cdc5bcfdf85a972fd6b23a9c0270e1244a9cfbd7b6b81db55a5da92efba1a2ac9185fe5ed5e7bdbe1eedadf2d129f7ce98c2dc59fab7906e2baea57ad1952dcdd18beddec34e2aa575aea508cb3bba9e17762c81cfccd53b9dabde3a4aeadcb2aee5e9bf55b8f752ace04e929fdfd3d1ccc96dd9a45196e1b6b2dfe2082abb8eae545ee6a2ae3e77a70ea9dd5cc3fad6e0503b9acaa945afdc85afc62f40e77ebdf5a6c6de35df6eb15e65a47cfecf3a1fffce5e59adc328cbd25267a3594d0f0558aace9236a4bd1caa5109d7b5c3590a01cbddb527ddb469deb3dd4d88ac1c8ab39f6d6762def2e7ab193edb7c1ccaaf6aadcded2f1ecf92c5f16a94fb160ffa1c8a4f6aeaed799db2379ded0c6b56a54af6dbe4b6aa91343ace9ef8a36ac71cefbda4aa14769fdc0d3befeecab36dd08abb3836afebcadbe35fc0eba0d2beae44dc7ee48fc52a19932e0b84f97ea49aa0a257eb7cbabdef29937eeeab91fc9f8184a1d0eca34aeaebccbb6cfdda3df4af9eebcaa0a539feafdbcab3dbdceabda676aeefed8cffad6bfbf05dfafcade32954dfde24a0646fcfde0bbceb1fa6edfffbfef56871caa0467f52e65edb8b9ee7b4678f14ac2e0e28f9dac9e89dc708a24854084ceb6bf58dcc121a7adce1fd1fedfbc01fc9dfddc3dba47ab9eceffc6df2220e2b0eada9efc8e40fabcd25f0dbcc767deac43289e152ffe24b643c7aa9ff7be67724daaa299cf7df094b6cbb6abf55eade33dd2e23f76fe9235fef562333aeb7f158ed2aefe019584d32c8711ccdcdb7a925c695ca6ec35d0c23892dcc8cf69290b22cea1ac697dc9ec86a35ffca907ed48ec03b1ef5f73dca6de4f92191e3ed1edf2728dbbc85b3676f2b2afdb0cdec17e4dfede300166ba620c06cfa31ebfd3b8ca13b6337f6058e98b31ebf0b2bcf2ba9cf2d6fdb44e0f1e9e7e9aa7f3f5ebf0aa434aaddcda30f46dab4e9324c61bd76e88dead4024fe68c6872f3ff7bbc1b9eeca6723ee45dd4eef91de61df0fe4eee1fa385ec869ae7e5f6c8d8ead668ae67eceb03a4dd701bf1ca56bcae4478adee966eab2bbedf751d7b8f04d7edffadbc62fbdcb9ca353feabed9eddeb0c6db5a10eeee1d8aeafa340d1df7278a2d1dbeaf9666ed1ee4ae5f4bbddd7f8cb311bcfb32ac80e46b7b9567752abffad506c95b9c1badea1e597bdadd45a8ff1add93ddeee6fbe15caa230a9eaaa4d57e8bbbe37cee1ab4ac3f4feda5a08bdb9dacced1f4abdd8caa8affa9e00b4efc6bf4c94c22dcfb6d4e5fdad9f142a9d78ea9f0fbddc5de3720b131aec918e3aaea9cdc2f1daed79ee3bb0dd3e434cb17f78f56dbaf7996f8c4e7f37a5f298b5fdcaff2a659d51fa36fbe6fb5f3c69c24cc5b74b2ec0b8ceaddfb8cdfcc8229844088acc88e65a7f2daaebe224ad96d2fa6cd6ad2afddf53a023e2eebf63ddaefdeff5a696cf3b1c04e3ed79da5e24db7f956d87ebd68f2e815844dd54b3b2a181738dfbe6ae3d8f16c3d76a75c30b33083aa81654a0e695a41a3fbdfef98a86b47daecbe7fca7bf50d57b1dbbee7ed7d3c6debe9d1e3eeb967c9bc7f25f583339fadfc51d526f8469bea633eac9dc241da5e6dbc5d9dd6f7ba50267c2a734773809cde16f1fee7079afafbb1459bbd20ebcb554a23f8584ab8b3ab013cd8bd0ccca3f1066d018404ffc0a76c7dffb3faa16b3aaf6419af89ef69ee6cbaa6a9d9cf9850b9ab67b773a56ba16fa258b9e4aa0adce4921e5cfedfb9f146891dc47cdab2e3246f0daa47fbd70d963e29bd0b5b6fa3ffa9e87cbb8ccea5fe04b457903c9fd610bcff87d91fcc53b4f414ffca8d26d2f7ba75cb1aa2353b304a902fea6e856fafcaee09ef0456cb87eef7887d09a2472dbcfcf6bf75bad2dfd7948ec23e7cacbb070ac1cc6ac91845dbc6aadc8f4ffe1e31a6c1fe63f0bc0d7dc43061b8daedae2fdd315185cc4080738c53bae55f827f188b8ef9e0ff84aafbffcab25231ebfc0dcb2ecceb7aed44c75aabcb32488ffd5c5d1d9bc9f433f3e6c3eabbfd111ed5d4eef9fabf341d571a71d6c70cf69f2cec01ff345d1cbcf7cbed38f3ce59a13ac6cd1efbe65f711cba24b3a5f190b21ee37e5e9ca9b5ce0863dd59d8b9199feeb6d3db8dbd58eacb87ea288fff22791d6b892b124066bb88fb563535850cfb19bceeb1d9bdae139bbfeb85d0b279874228aaa25c9b9914bd98eefb6ee83eab666df2dffcca6abee58b5e4b37711a98bcf4db4a5563be13e4dcade7e7f38171eccf4a96a6510b9d3123a73ddf1c42dbcffa6498ecb3abf9facfced271ff6dc3b78dcdeece1ef3310fe199e02ede32fdafb3e0cb9d0ba06a542e6c3b71a4a209e23f1dcfca9bbfa5ffcf82b16bedeaf3cbdcaecb887eee8ecd08f132e57ebde3cf82f875b4013fee0aec399549177601bac38837e5ffcf35bcd1fe373cffc1c4679a60610cd4dd69e5a09b12fa3effe6ef67c923bfa7c2bceecfef9f190328a4d54b601bd3aa060cd21cd8c385da2bafeb9bbbaba74eced25ffa9cadd0d2ad5d32fb9ece569badacfeb595f1cbce2dc11fba389caca7aeedffed014f49f7c5dfed35eba9ea25dbb54dad3bcf1ac6dfc71d6415f35de1512b09cf1cb0273e3c4054410d8daa4bb93d8aa9cf6791e0a4eba803db270775d8519123b639fccef201dd0c3beccff0d3ae72abeabd5e95f52dfaf9a3bdec7e17ee921fc6935fa7555fbc2e7a05bff8bdcf5063d7b5edc3b8ffee39efa8ba6cc91e584dd098b8833f2dce3e4dfbbce7d0c31f9e70c1bcd8a3cb19d5ce8fce7542d6ce1756919c0b9bed46fa93caccbecbed8ed501cf0dfbefaab80f8bc0fa6eef1e4951fdb31463d82d48cbfbc929abc02ce13ca1cf8d0ec1fc88d8f1bbc94c0b9e3ed6e20e6c80d6bf06c2c8ce37a30920d1b96740889f72b0f26b2296af44383fedf26a7d0e639c8e5d7cac962f166d336c8c3ddd2ddefafc4ff8a73fc4da11daebbca2fcac86bac1f3870260b1a520d4d297ac22df60729e06ea2d03fd8f5b0d6649fa7ae2bb5c5cd2ef3aedfcc99ec5ed7acedc30b14af0beaacee58e28cefd3cb975da7df4207b278df3f767ff8927b3cd23783ad2bec11acedc1a6cb7b921751ba1f0eeb9c4160c39cbded3aaef77aef50d184835dcc5ad9d565a3eddaa0ac5fa1e8d34aadc9fff7e7fefd10c7f3c8caa0cae4220b5cef5ce5c59de3fb4483b2e0422afdea4fe6b622309ccef85dae5d9cb4bcfbcfe54d0311c5d90999cadc9bcdf61be0bdd479529b2c1eacd02f6b2f4f62c82ae2d1e2b3d9eac7cd00747ff8ceaf8bd077fcf1afdcfed05ae98b6be05f9acf1abf2da00ff7e7eec12b3c8dbb7a4cc55aefcfdc2e0adf2eabdb4ee47bbdbeefd8f19add88d4ce3fbb8eaef90d906acffdd5d394afe910870fe56ca6bb2dec361ffd50e2a280df38139cd122c8dadca2c3a9ebacd30bf3f1ed0ffe87baeeccab4d851d6fe2a6261e2ed3f0bac1c8833986e1cb28d4a2e3c81bf3cce4ba7bffafbd9d9db7ad04bed4a2da5c91dba8734990dbb2d3a194e324cf1f743ec1db0c5dacdda0a31af2b19dbbed8a8dcc0f7c5ccce9abffcfd9c0837e1c4da8facb19ecf62d0ed0d93be4e647eae8f39ba8fa693afacdcfdea4f46ee3b1fb05312eb52cda561ae9bf601fe1d562efdbb0cadfbd8baaaeacad8433cceeebead05ad53b32fef5e327dee5a34aa861ebaa9dc2a3a1ebb340ff9762f5ed7bf1fccc5b8d5535da5c5a4e3aa2dec9b59beeea90fbcc08db87df06dd4cdc7d582f0c0eba66e0c8d1afaf7c6bc4bc4cc9f08c30e662add5d3cf4d2ff41fdba8109d468cda5d8caae8567cfe313ebe721e9ec7c3b5333b0e6b6cffafa0c50fcec756ecd42e082e09a20fadb0703ae7d317488cfddacdfbd533e36a00cc89c1bd3724cec85637d5c1bb30ae52d878ef65ee5dd9cb46bbdedadfbecef8defee0583d64aeae32eccba5dd67bebbd93ea232075f625e984facdaaaeb0a3bd1edb5ee6afd5abaa4ef2b893ced39e948fd91e176548d6fdb0b01bdaa27bd7acb0e344fcb3e63a33e87e2edb3bd07414005ced37a3bd952aee5ce5dcddf9caaeebced344b4cd6cdf4cc3c33a679b67bd539c2108b25f5deaea964e3dcb3fcd9aaabbefd1bfe1de7a4b05dd9f5b63bf7bcceacdd766aef142a720a9c663cc839ade15401b72ea1908c37e7b6bcb168dcd2cfc3dadadcfe2cded8fcfb8de9cc1eff73eedfc29b63ca45471efccde89fbedff158bffab38d201ee4ceda6fe8cc5f76ca203c7de9a4ebca76f6eaf5a40f0ebeebefa05bda2a347e1451f4be0dc0d526abbcdcbeca5e873ade2faa5e54a09eaa43e203d77eadeba3cf8fd161fadf2c26b493c5d04ba4be6a307c6172a27ecf3aa09ea0e28bc53a8c55afb08bcff638cebdeecf48a88c1c8c2a352b9bfb53d2e28cd70c051fffbcf433e28067f63bbdafd7bbf129273ffd90e08ba2828ffad7ff8a5a1fae03252da8cd7ffa4fa46db5ba0b2796acdd4c5fdf311f0d7ad3140f732b4d0c583faffa72a3bbb5b91cb442c15fdae8d7f823fbbe384dbcea14c83efcc6ccebecd68af0c27e0829ddcb0a53b0811aedcec60d08ea7ea4ec88429bccf31677b4fcf73b2db6f4ea6de5d3aab79a782b414a11bbf54da2d412bbccf7fdb0f21f9b9aa0e4e1aeabf36ecc61fa4bfed1cb07e46612de1bf73cdac97d98e33eaad8488d610d852dd7ddb092ffddeb19f9de397add5deddbd77eefc3d6ba63c6fc7fb5df85fcb0a5decfca6fe1a1ce1ec9d8ebcffefc5d3a87c0acfc54c16389ea57ea857a6e8e8bbbbba7dff57fefa9e2b547f66106c28ec9d120de94b4aaac5116bc333cbd2b6fd345c30a2ec5f0bd0e344fa7f2e50faab8f4a941bd0cb09475312c21f26a8dd46ba86dcdedfbf3b76a86b4dee13e5e84ace0f15178c3c81cd0c100a537b2cf26ff6beffbbae36f0aadde36cfea0f5a9daed8d38f7facee9aac3d559ba0acdba3b053fefd31ab54154aaae71b6b6c7c5e4cb0aaa9e3ec299ba1ddda4e28d36faa8e7caa5ce4eec4b5d3cb38d83a94b0c75af6efff02292cdabfc7abdeb4e9cd511cb4bd486080e40c4cfebf1ced3a0de5cedab96c91cbf97faebddffdfa44a7f19f84bcd09018ae8ecedd02f3f0ab20818e3b4a08f71cfccce5bef15384be17eb65d0c4dd6cbb6acaf0f2efb58cc8cb1cee93bdb6d962bccaaceb6abea0c2a2a26debafbc1d8c83ededb5ca5455f10efe31735ba7cb88ecf46f4dc77dfbdfe58dacb994ea2d4bb74d06d1afcab8ebc5790f8ec9d9cbc8ccadd961dbd23b10f982fe1a52b9a6cc8bfeabc7b3c34f2dc8f7ed508d8fab44d3f89aa436942b4efde5b3f67dbac506a5b54d9a69fd1bad9ebe83acc4a666569ee3e4a82c0a921befc70b59cb78be00f31fda4a6ba89ab52cbab5befe3e56deaca58692a23dbcedee73175e6bbee72e6a6c3776cb81be4fb336bfd5ffe721660a58bbf81dde56e475a85c87eb97f165dc4ce5bbae6ee099f11daf43d8d35e1cf4bc30b2b5bccae1d533c580ecf1b7bb2eefb6ca8f5b405d3ef95ecccf5a054ac5c0d3dbabc987eea7575ebb1f000cce17258e5fdaf38afb98fd5ffddd14ca9f67b62c811e42c118bb7cce0bd0adcd5a3cfe7aeceadd6c5c5aa5a0f7d8dd3e37f939fdef8c1dc33ca14a5ed669bf53eab5dea64eefed1ec9cea6b5255c773bad3de3db42ee661deea90fdaf37a0dfdf6b55d15d82c98157be7edaa1baccfda5a1daba6fed5e0e05f556845384e9ac5f6a19ff1e2c8461ae11bbe1832efcdf92cdd5da3cddfe004d7287d389a2e2de52b9fbf926ee41f6fc116fcc5d2d6f078ac4bb1a31b6b6ceed98e26aab4f2875e07535419d28a5e3dd5d2cd104edd7685cf62dee3dfe2aebf097f76f938dfb6e1f84f99dacad7d84c1bc4a8491dcb99cdff8ff05edef9b6253f36298a705df4eee7ca6e52dfe5c81dfc3173fb9f969bfa56b4ae26dda7f3bbefc1cfdab9abacedc8dfc4ebafbf0fefbf07c8e3939feb4ed299e18b57fddbd9f8aa3ae5f28be5c0cc0cb8a2250ad2afd5a0fca411834eba3dbccbb4c17e2ebcdda1bd1d7da13cc7ec6289cec7bcc5d02d50d5e9a8abd3b87dd19d3def615ae1febaff132992bdcdac834aa6f79baf7df677bd8f3fa0ccf81cfd2f55204efea9dca829b80cb2bf4aa419fac1d998f20f70eadad3a4c5c7ab7fd4fed4cdf24d6912d7c9ba54c5aaed7ae3b4e1d85a6a9bf0aab5a6cf4aab17a1bdccfaddd552bb13aa674e69e93962e0dd6eaa1098a67a1939783aaacf6cce9feac6e62cf3c2dbdd1bc54f0eeca20dcde4fb651e1dac82eec3326de4410c7cddbceba2f42d6387838e69fef6c216ff9fcb6ee67cb9d6fdead79ecfddbaa6f6553e312de58ca6db83fa2b2fdadee8d9afeb0d4d179c640c626e9f38bddbf0cb50fe7ea02da34caed4e1dbf3a54aa9f1bb8e8d8f7dedcda546f5cff92ff00a50fff1a761e7b05a54eaeb4cdcbc014aadfbd0e5a5e722ccb3e385bca5ef54fa6a617722d5b8c783bef6c039f39d1db794b94dd87ee53adf6e30ea3ac64a10a08eecd64d2ff55c11c15bbaaf97d16c5d1a815c16eaa1a5ead84fddade697f5d50572637b09c3abe4400ab22e7f7cae55958f6c77f1b0e50aabde4f5c9d5966cfa572fcca64bb7e4dbc6e33e6fbb2fd4aafc6dd613a359efd1497f0a1bb5ddcac8baaeb25fc04cd4bb7bafe91deceb255b2f0f23fad924f86c4b29bcfdac793cbc7a2edce2cfeeaad255cfb6a653c6c95bede55ca51356bed0c63fc9bac31225b99cd699e0f4bcbe1fa3bf33dbd5d64e7f1aafddebffd1fad8efb5cd6b797b9fdde7fcbfa8e23eb90c6adc30af7291f054cee00fc8dcf9dd3e8c1bfbbdbac6d61ededf4f71bfdf330aec9df40484bb3038b1a1ea097e8f2dff1242b8afe039ddcad25e38406fef0a7e70a2f7d3d12fe82cb5a54ae8ca456ee51bcee3850d55ff64962f4cddeae7ee6d8a73a20065ff7eaa9ffbc28b35df8d0786bcf9bbf6e987b64edfb83b863471ffd3c6e028cdadadff2662aaef6dba9de67dcf29f32bfcda6a96e2c0667bf96ab90a3e0dbcc80fe5f5cc94201dd5c29d1c78505ad598a9ae0e527ecefad39eceff8d82fcd8ffe2d62bc322bfd0f40daf5d91fbdf99f4d53f95bf9e3e4fbf98dcde2a2d6fdfa719ded127ccfdecf1bca31adda8ac1be559ca10abf1ebfa09f44f3915cbcd8e9e9a1d4dc7d3e5032eab1d94968d5e5ac449756762d5127dd1df006c4a8a366c1cdc45c08fc0986e889afa652a8bfed0bbabaa3a4ff5254e4d409a807be0e80ee0142f690f0cf33dcaaff0d4f078334da53cbccfbc18a8fb22e798154310956938411ef9c5aeefeb1d12dbb6dc0bc7ad1cd3f8dbf25ec10ae4aeaab15e1965b648ea7e8ad8ffc33662e0cddce7e685aa940fdabddd86b9afa39ccdfeb3f4adfdfa6d8218515fac9e405fcdd8c7cbea2f4ee5c6fffda3cfcb5decf0c09fd4cdbf87a9f72bf5baaa3ffb746505f38c9d6889aa1f1c7cb63f3f3f329953ffcaddd9f0ed7fe32fefa023088036d2c632e70bb5cdebd6499626aaa76b87ad81d944d4dce23ab682bc3c361f5ce186bb4dd3eff92dbee55b019c654ff325466c8cf3a9186483f6ddd6dfb5f4f6d2039feaebbd4beefd684abe4f461640d5c5f1a1bfba8a91c2a2dadbb1d8a7d932b6eefed8ae82bad52ddac6464f141bb2dca9bb9de1becbdda521efcd9dfb0deb40cb02fb8e611bf8bbfdd3af813dc1d8682ad494ebeaef4cdd69edc3e2fc1ad76cdc223630fdd6acf77a40c47a24aa8cec6e24183f8816d588efdda4eb4aab5cbb1d8b5ec8ca34c470e6b26f26ebf7adf065e7fdeb1c1ecce359cdd7bbda1eb2d52ddaebb00cae323ebbbc04fd4a2c13b3dc0644dfacdae7bb62e1f5a158dfdfef4c4dd83c8da8b0adc1fdbc0eb05cc903becece082e907eedee574b760da9c1bb32e6d8af7e7adc7d800fb245ebf5ab04acd7e6d142ee6b0ebe78dc5f0ffe3fa4c7940eea5b9e06a3f8dfacc036ea66ed1ba5605c4b1b4075a54c852ce9912f9aed88cfeca7bd90e80efd3ce98627a233ce44ee56ad62e9e25fa0e2b8d1ab3f8579dbc47763ae138db4f190df1ed4dde7beb0b6a0dc2b20cfb3f7c9bcefd4b3fc158dcb3adb033123ccbdfdd3bb82ce27acf453da9aa1bf47df278b2f0289dbb876ba70cdaaa5207cf4dd267cec783bcd8d7cbd8fc62b4a0c3b2cad94dad8c1efaaed13cad639ceeffff860626fe836be4adfc6f667ca5bda34fbe74e5c36acd5c0fe3f624ccd27a70bed404243bf41beaadb4eef7d5eaa0eeb24bccdbad2f2513c8d08dbbd9f0da52e7ff0f7aca7da106de3ee9c2314f8f9161ec0cd5e0edae4f9dd4efe1bbf8cae18cbd90f12d0d787f8b446abef1d7567cf6193eb47eeaebd51cab93eab1a1da8172ffe768bcc355d97184efb0dbad7c91deacefd3a04c7b29aacbfcf0f03fc22d0f10bdbcfebcdc0993e1eb3208ac201a72029baedfdf9f68cbdc6310d3dad0d0acc774cc77de627dd9cd7cbfae4f7af3dad08fa5d20a8b3b41f8ead7cf5f2bce4cdd6d1daafdf5e2efd317abc94e6bea6dd8fd8b829e6ce2f4eb698bc26730febcc08ba83e413e9dacefd2ca48ddf39c17b3a3a1f6dbb0de8e96c394a281eaef6abdc3e4d7c594afc6f649b25df03aee61d7c90aab9fcaf3c41bd5fb4b7115ea1545ebf3d4a78ce2cc7dcdc4d730ad9f9aa7bc8f11ca5fdfa0ded8fabfd1d3cf5ee7cab3e9c8d2f53b6acb5dbb5ed88a7da1b8421926e57cf9a5c68aea5c5ac7ea7d00afe2a4bb4f5ecee11cf2d3e7d4fb3243969da441b6ff5ef3ad8eedefccbaa91cea73a6b808879de7fe2edbfd5afeefc2e7f3e68c1de1aa8d6ad3e1d6be2e48067d1da9ba9dd4cfb4efdebfeb8d0e9129bcb4ecbd8eb3cbcdefbea299beff1dfe36a0da4bfd4fd6ddcdd2c1f77a167ab1c0d3f4e0121324aa4e3a8f42e38d8b3cb2dee1bfbfbde6ed9441f7c10aac9a80fe4daeadae49dda18caf2f3fbc482eeac8cfeab7b3e7a6bba8fcde74f7dafe5e27a90fbaafeefbccac0bdef65a02b4cdafa394cac3e0dde31aad4cc0ddcfe9a2362e9edd2c9ae2be91767d4defdefef4a38d6ee07bd3fe06834e5c804cc3bb2bce2a0aefca7ac49a41d65cadbab78a90225ae6edf63bd713ed93c0ab7d35d8d00623494ca08eccb9171229c1cd3d1806d25157de19a0d1c53b3dfb9aed2e3f8e5d0e78bd91dfbdbb57ece8fcb7c65e56b30fb0b75acc4dc3c0bba809b96bbbd808a7a1c0fd5b9afc172134eceba0eedfa4a70ccecc3fc531b7d9325e34adb93bd7da26ca11ad4abe2c66c42b0d3cbc8ef455aebccc30cbfd3dff0a5693d38bfa4f23ecebf5e42ba8cc86decbbdabc7e833bae03ea1d567f0fabf0a0c54994af7cc80dcf684722f1bfa7a77e2b16ae6baafef4fef92eae55ebbf36aa0f404a1fdfbd1cd7d2752b6f6eeac4cb354f92735b9ca5e8cc8bcb03ac894aaacf97ead12fbecc5c423d8a86b4f41928fd537a2ecbe57d691ede7d0b8a3db6f70abbcef7f6ebf1cdc3434210181dec41bf5be76cfc52464f6bebef6ad168ae204ec06ead1e6e5dc7cecf21656bbcce8a9c9f6d5be7a1cd656c21628b6ceb28d3d65b5d8afeb7ecf04fbeeadff1dd4ba1c922ebb829ebebf5da85c1bbeb5565125ed4a6c36fa491f1bd42aa1fed8d1882a5b01af1ffb28c87a3349a0df1bac1bab6aeefdefc9f34debb16acefc1bee058fcbaa0d5138cbc54e7dbe7d766dcda34d9a51eeec89aadaa6aa2f75a75abce7ad0bea22b7b14b9a8efae9aa0088dbce0f321c70ccb1c6afe86d58dffa3dfad1c1aa9be035aeaa0ffafc0b68ffb6e9a6944ca46debada27ebe4bceafac44afc5d31af04cdeaac9c2c918beefb3c1bcc8bd8ae2ab32cc99ff4b37ac7a6ecd67551aae5f02cd58ff5eb543a907224ea4e73af32e837cbbeaa6bbd06a2ec9bf7c59828fe21d4faf2aece37fa09d3bba8274bf7d2bfcb71feefdebaffcfe0cdb2d942e1dd9b3d11ed6ffd66c87288f68ab651de675e28ccbea33b10de6ac405305772d616fca9e4e16e7cc522e09f14831d26c4fdaeac1f9fbeef6fd4e7cf7eda2caecdf6351af7b37ce070d9b2660b861509ee63dea3c38e71ef9b10ae28a93afdf26cf7bde48abeaeb5674cce0c08102cdbd09ec14c691fdec8bcee16f1dd87f5b31bef3a10dd0faccefce3caafe205fcbb9bcef34acb422ba7d3d5530fef5d5c04570b90e2a95b51c3e3c53da1b5237bdfccafb5dae469bfaba3fcfdfd06a8f0a5e7b66e2caa6b8d188cff7b5ada73ee9b97b7fcbbc3b9bdaf86b2b55a5b00f9e4c1bc8f460ac3feb0e7a1ade2ff5dd582bffde5a1fcc06beac2fa28f571eeb1f4f5cde2d35bb8ee1ee284ab181c5f049a6ee6633b5e0acad7f0eed50e38cdd78593b32538c13d6acf7fb346fbdd874bd8b094a42923ee1df64cfb6dcd0d87e33ccfaade48e619db94387f90775edaec161fad5c0748c01ace105cfacd81b03d51d7a60ccbf43775db638fbbda0c3e7cda6feeadee238a5fccb65896efdd3febaff5a2d0c1ddf746f4fea7d7c5dbbe335bd8befcf69b8ffd9ef35e23fff5e20443bb7fc0adef49aa23ac343fbe8b75cea4cd96a1bfb42abebbb53a4538f7de3f8c630d353cbea2747bd36d7debfba2091cc925bea8fa7b108c0d62bd3e2e983be4d0dd50afaffb8a8aa48b5a87dce9f82fbdf9ee82ee0c81eaeeea69ebf5defad85f66ff0dfbda6cefcdfb1ae8089e97d4d230ef17376a74b2dacefe5ac2a78d75a3f64a2bd2ec4438ba6adff0df21fdaa4b85fc91cfd2955e84dac8efcfab3d7fa7cfffaa0a7385f0fd4fafbef40a0b939d8521ea6da2c9dad97bdfff8f56bf8d24b0f2d1f4bc8b2ae21b43f8cfccaf4bd216d545f1dadde450d8c5360d2dd88b30a5afe2fcb1e9176a2f34c6f2c3f94e3f2ae6bc4bedae525d52e2ba2c4f9a1edddb50f1ed0bbccae2797c2ecfedf8f652df9d8f0fb50ddbdf920f884a59c01e964f30b1fecdc2c477ae4b2808d3de6f211eba7a8f8fddd601a0464fd08fdca5115f2a19d5ba809c7200cb3cacbecab52b28477fd59b55aaf4fec40ce0d82cda4def5ec556cf938847cafaad903f4c4ca3f7dd74dcfbc7b2a3eb770a0a6eb9c6bf9ebde5a38dedf4eae05f29ee121ecdee9690b1adaa6cbbbecaac402bcdfd4298be2bd5aa28ec78d0a42e4cbca0ec33e911ac5ff02aabb5fb6e48bfb879ca7cdb8e34e072bde6fad7ad02e0a5eb68b0fcafdbb2daedb36d1fb4f2ffdb1cfcb7ada54c0d9e276a428c5f1ac0b861629b4df756a6bb0fd68ad5cbbbce6feee8bb7ef8c540e88f7dee705aa7caf2bbe60afe1616bb4cadf4bcf5e4dd9d1ccc3ce4cdf5b3fc0a5ffb1f2945dc61f4f33342dcd386bcefccfc1b4c7bac78cce75a1efb243b5cce6df1c186a35c0d5c0bdb520ef8eeddfa57aebda316fece80e66ebdedcbd9ddff6efd32aa30aa0dfab5cd4febf3ecdafd2d0ade7d3aa20841ea9cc2dd5fc4fca914f36aa75bffc51df44ba396eb13909ff2b2d3b0c9bebe9bfdd4b6dc6e67a97ebecc47140fffeeecc0d31aebcefe465bf6fd138ffd993676a4b4fc5fbedb1fcfc8a48ab33878bf5db81e7aeffbcef5d11f51a3aadcc3bbe4bd42c87dde44a1a2e4fe2dcd8ebbbbe36ce1f68db0ccfd3adf8a9fb9fc4e3898c65b87a4ed3b5a3dea1bd06c879bbefce51ecf2f656d96cacf80cf3cb8cfc8a38ef6fc26faf26a2dadcbf6ce883cfcabdfbfc922d26dc61ce7ad2a8e2b091ef4f9685ea6de102441e194b53ec7ac8d4bc0df791b2e62bd9deeefc9dc6dca5a9fc23e70e3026fb3b1afafb375cc2b0269991cbe57b9c6bdc43d24d8ecf6bf9fff1eca07eb69feecae1c101ff50ff731cbe88e1b099a830ac51e231a1d3afb0caea381e697affd8255d83bde297ed8d6da4a7b1e8a40be96c69b28b19fd5df04babbc4c838ab0d39a4c2c2a2eceb9dabfbb9320516ecfe6bd24b970c9e5c7eeea59b8cfadf1a089da141fca3dab481aecaf3c32a1a1eae0b4db7c52c9ce2ddfb9b8cffffc51afc3ef3bd2cbe35f6e5a455da1d2fdbfa86f9fdef24baaee8b8790df17fa5e2825dd86ffeb796c3d8dcfeaeeab73e7bedbcad2e1cbed3d125eedbb34fcb4bf88dbcb07c4c4a2f7eaf9edc06527a22f34f7e0b62dc53c9393444d4aeef0a7c5f74ac38adea23b65a0d1da60138eedd6e5b7c78d3fee1da3d7d24e3e1ab1ee96131b5ba1c5ff719d3dc56f3bcebb0fda6562fccdda88cb2b985cc1b824c3c8873adcc1602f832b5dbcbba5d72e868c8dbd8d7ecaed1d7188a7a94ecca0dd3afa6ac8a8e1d8492b86b6140c91fe787a8e0f3cbfec5b0dadbed60ba62acefba9f11b41d5e39aefacba3a9647019e50909843af8ace879e27a62ff56c23525bfbe8884afdb570358fa5d47fdc4ff3c60da1714d0af0df0dcdca835d732aef6d7e62c36ee024dcee4ebef002a24cdcbaa9b10e62f3ff8acb0ecb2df501662daba3e1a3ae5d3d16157bf9186ee4a4ecc1ab990db14ad2bd903dca1c02dcee9a5a8c3eae6befe19ce4ecff5b9aa1e2e074aaedea695b9fddd1ad8b1fcb7d4b3bfbe4a6bdebdb1cbca8ada1c6cdeb9cfc083aebc34b6cc14daf6692cd7c5ac978c0f9bef08678ba99e4cdefe2561e9abfd3fc6c7cc216cb4f518a0fb69d1bfd300aec106af30dbcc6c7edca5fffd48dfd3b671f07bbd4ee1e6e1a6b5ee7ffeb9875aef52e4757bb0bd30d8cdc277b75bcf2df6307de6dfa69bbfc9a9c848c2f3ac0670de7b8abfd30e2bcabeef39aef1c7238679adabf1dfe9beec2d40abce00bcd0223ea079fdfe451d1c5aff985e83fcf492b3e92dd205faa3bfaa0efdcbe4efe8235ceafb674ee573b4a179ed021f8fbd2b91dfca6a81bd3df26e60ade0e0286eebb6dfec2e9abb47bfb9fafce1c38cfde2c595fc2d86d5f20c12c665cf5e4ef63d6eb3e8c77a4fd3f31da041abbbdcfd2b629cba2a4abe262daadbff62ecddcf0ce7ebaa9c071acdd1ebfab5da3abd2e7e84b75a7d9d7f13eedff7f5402ec048bb83a4e849dfdd6cc9bdab867d4aca9eaecedbdcf0ad5e0c56cb8ab2ac6b234bc9837e1d6438dcd9cbfade477bbe4f356f84af2052eac1f8af94afede79cc3ae2fdec11beb720f243efa2ef5763fe4fdebe55b162f765119baa2ed5f8d4eab8aed83fd3cbe9dc39454e7b631eefb0bcf60ca91e634ec5b9725f7deabad2ceebaab0eefbd8c22d02eafc2b6b2b3dee6836ad213cd7b79ce8fa25cfd1ebbfdee3cda770c7e604fe2f6ead2d4bc06cadeca1fea47e38af6a8cdef7d084470f1dba2f24df01649cefb74ba0de0c7b8d419e5f3ebbbb71acea1da2fc3d05bb64aaf7d0eea75b0efbef78dafcc943c35b2bd5fdcbccfbfe5c5cea08f4e55e74dafef2bbbaef20cafbbad7a205ca9be2eefec83b9e96a4fb8bb4eff86fdee05ce23bbed4d78e69f44a12e398929eabed23e0dbcca9ee57a566f1f01b7af6ed9d2a9a07bfa2bca7fda2ed19f0b37aa980fcecec78fabe1e3fa0ff61e5c3dbd4bcfb5e87857c3fda2db83e8a8dedcd1b6ddd0cbd9a13a12bede8969eddaae4dc228db628bddcd2eb3a0f9ffaaff8f4eada3cff7310cbe5a09c7c8595e6d9dffddbeea8e7cc6e4bc15fd7f8433cae29a5803979dbbe4cb6d0a0d36163b6904ee795216d4b82ef9bdb350fcbce8a33c1cbef932228dbc4ab447bb207b7cad2464df4ebaedefbade52dba7577e0ce5abe72e3fd851eed3f38de84f0115c1f5b8aec019e11fc486dfa00757eac2df2be90eea19cfbd9ed9ef5b8daeb2c6e53d9fded1780f603dffc3bfeadf036aac30138004e4f1f2ed6ab07eee54f57bacaadec4415ddcfbe080dcfdcdacab162ab97cec062bdcaaefebfac771e2e7cffeee45b95def2dcbbe8ac7c09615cb5022ef1daaa17fdbc4ccea8b99cfc9dcf9c7fbd8e7ea89daffcac39392d04521113140e7eefe23eac46cccffa0fa4828cc3d66f90af116fed91b0fcfd0c7e1d2bcf3b929fe5ecb24480af95abf30d3dbceae7dae8bc2e82ac6dbfebd6e0992ee2fe75b9326ac3e5ba39b35fd7eedc1cf6e3f09ab23cadddeeeff983702a3a9cef381a1182af2bdc3e29f5a96e58af1e11df3c504cf115c3dcdd44a4ff3fce7ccbbbb83b3f2d1fa4caefcc83eaf6ea161c74d58d1447579ebf27ecbdaa74c31fbd571d16a07ceccd4ecabf7e06b1a6d311d9e1abe13ec404fc64908aa64f10e8acd63bae4cad87be343aea7ce190cbef46db83210afdceb8eb11c7b8df2446ebc0869b0cfcfedb613bbabe6ac91fa2e159a8bfd5dfd12e5ffefc1ee54a6caedfdeda05e60b6a3f3fd9377eba68ddaff9b455b02be492bda4f0fbaffd346c04f766d2a4fb45ef4ca085d95ce6a71c8efbe2fbbb2ca7fe80a92da3e66dbebeedb0cd446cbc4be96db641abe9bdecf43a7ddcbbd15bdfebdd581d7fb34e7718a1ee56e5f7ad1d029735ade8ef01a8bad6fce919be607ec7bbade65e3ef38a78d9ea8fb3a9e80bdb4ec56ef3db8ff833ac84233302e2076ef9ccecdf46a50f4e462a306c972f3abffcec398cf59f836db1b9d0fc379487f12b87e04d57f72bea09ea8721a6ce3afd76e42d3fccf7a553c80f7e0ef5c6d2d35db98c0b6baa5fe781b55bc69a5a00ffb19f3bddd0b3fd9f9948bbfaeea9c3f7cbeae0b2feed116bdaaaeabfae7dced8a5dafd6fea20459e2fca01b6d6a7adc6dcddd09d8cf97dbeafcdf11aa4ec0481741ef0c110abdaabffb24ddb91138bf9c3b8b505df7fa6a4e88370ea7eaf518f6761b308d7e2aaf07bf65efb93e3f5f9ab087fa3fc690e5f25eeebfdfac625bf98b62bb7b0ce41bfbf2cf7582985dd8fbadddfd7e7cab2af95acf7b14040a072b14f80eef55757ebadba7bc2394fbc9d56b7fdab023c53fed92bbb6ad6a3e3a6439f2c226d8db7bdc77ad25cbae5b5a5848ea94c6eefdf8fc754afe94d6aa4a4db8bc4f0f5f4b607ac13bdd3b6ab4ccc2e8aafda4dcf08a4eadf3ddeebf3dcfa730c1bc5e7a574dc5bcef11cea71d4b3bd13e6b1dc3e3a436dd92ab4d96c2d5ceb4e7e2d26ecbe6ccce10d9ed64e0eff4c6fb8a58164c1f3790cbfcfe6efd891fc4dcf99a4bf4d0c3b5ff2b75a5750a976cecedb5c53dec9d1195abec8af2fcee5dfc7deaa4c9eeb428744a0ff0dcee574bed94f54c17cd70debc25cf7cfe489fa82b4bc3eab2eedbab58e6b9aeb8dfa4c3ae5bce37a1bbccf3acfbc5b7a76f73d49867b3fd0f8be83afdefcafde18c4aacb82e31ccbcb484e48ea27b5e0fe2acf8ee717cfba05152ae6c1ab7cfb959cc41dc218ad930ac89d44a1fa15daa4ceacac4aaa556c9038ff8ddd8c56984bf4a42c45495fdfd0b8c3fe4f9d7c44235721adcecb611e8a7ffb2f1b3cebd4dea8275b12a58fd849a5b7dbd0affef79cfd2ce10e697a66bd5a788b16173a49fe88eddeefbf6825bcd0aa74fd2e968bfdbb2f7bd7e1bc5dff9d0f27debb66bdd4d446c1a29ba6fee8ed53ff37d7d6ee170b6fedd5c40d60ddb208b6ac7da7e2ba129b7fef0e72addd1722b8026126b20c47f27fdb0fa2e9a309a093f9dec1f97c9a642be7cbdfe0f4f7ca4b855b35915248f39abfc7d381fcfd7fbc816bdccafceb7faf06c1ef9bc8b39dffe9a72ffca79e48a8cdd4463ca5d8aaaf238c60bb46c18bcd01ea3fcd9f0dbc9f39011b6cce7cc9eccb735b5ea9eecfc95e51aaab675cfdbbdb0bfc4a9cb742a3311acbedfc3d7ba307ef5faeafdcfccc533ab638272fc8c7bd8d477697e38ebce0e3c2cb924effdd4f55deaab6efecb12f70af41f2cb9fb2ab4bbe0e6aaceed5bd9ade8bbdf2c155eb49a7dfa366c9bb6ef0eb1980b8bbe8d1afa4451aa176749fb94ddd1bfb9e27c9bdd35ce5abfd8bd7edbbf70c29d6abcbc4a1b37a964acbb6ed31f9ec5ba9a06dc2c3235ab04bbaa0aeeef9dfbecbef3ac69a4697c1d7c8cf6dd20a7fe8efeed6d2cdb0506c53f41a2f1ad0e20a92df8bcaddec3b0a2a8d0bbf5bdcf2d1daf6f35cdb072285ecbcdb9539fc2cac4cbf1dc8fd22d0fbf8e4d99cb04aa2496b8fb51bcda9db114bbd63842c08dfa8b83a8d01f73f7f1509ee38ce75b7a5c0a5cad8b70e45ac6ef03c916cbd183f6caf8a3802cdc54fefed71a6df146429f4dd6d1aa4fe0fea27bf222d583ca40ae329b8e45c64fd6fac3f385265af1c023320df581da243b72c1dd5e17392dcd6c84ddefcddcd3cc0db3d3cca19ab0cac330d7bbabacf4d4f1216aac30ed09e8d1eefd1bac23535c4b5a7abd56baf0edb1f6cbf6d4ffc9cbf24a6adcbfb3ad48ee3299a6fc74fbbeefc1832ed673dac4e73db3ed7bd83072f38fd432a037d506bdd9590e780b6aedf1e88f04bd9ee0446ace6fbbfcd4d01db2406ae8ee8adcb67ff6a7f4e405bbcba08b68caadc37ff2da23d4bc8fbfb7aefa1ffe1a95fdb5a8c1d6bdbeae116f15dcfb5a80cbf5b9be1a7304f85a3dd71bc55fcbad6e58a2a9dda599dee2ed2bbfaf6b20dddbaf3dd663b17cbd65decea492adb265bf860aef9a3f8e5ffb61e40ee56dfbb145fafb08bb7abdbe17ccde650cac6c2dcdd26a2b85bb4eef0ef0d9cc067e8e286beca4cdbf445636aa7d3aecd5afbb009d9aa3fd7e20aee9dad7dadbbb40ab74f83e09fb1df77efff8b93556dffedefa7a5ab281b8f1920532aaab25852ef6acdfae5e4fdb0e5ecb7bd7ccffbeecedd7fb5791c06da5aee3af2ec7b224e526ad1fa953d3929aa6e72d85ad0858eb69cbee3662e861c2efd6ef141adb3bf5b001bceb8ef3afb3c7eb31c3ea3fd9ba1d1fbbbedb8199e0ccae23aafec73afffe1f0532a6fc32bda497382d11dbaf5ce1b97b0c2ebecc8d5e0b80cdb7eed98003f09b4730fe6acda7ec3f9728b68f54e3045abed53dddf699d3df85ef526df5cfa392d6febd864e0a1fb4fec047be6e06127ade6e1dc6dba31099964e76b024dbf4ce6e1ab46c5582a82aca4fac4edc1beafefd8cde38cbfcf5f18045db436ad2710ddc0dd3d0da7f43d28cb69a00fb3fc7847d50db20ccb7d2cbdc2e55c1f46c95f7d31cfa7ac86bef61d3ec04edbeef23d0ed9fd497cd3aae3ea9b91923a5fafe1accf3c3c90839cecc4a9cceeecfd3dfcfd799e2e6cb3a085aa6ebe97fb99caa1aafea41dfcf0afe2faad927ac3adc1dce3d4fe05474ccbe9b6d6e7d29f682ecd15f4ac6960dabeed1f6fb372cdcfe022e87d9a30fb10d317ea0df9d3dfabcfb8ad2cf96c59735add2e6dba6fd30ce8ed692021d0eadddee5aa6c3a4ea9e3be0aa2cfabaa5917b41b60b77f53fd10739636baeddd00c4ca0087d7ab931abcfec432947e165991efff3fd672d8ed4cda9f39bf7cb64da775acfdc41f7b407fe3bfed48a06ff2cb53d0ddadbccae57cbd58fbf9e39bdc464fa710fd3befb9c5b4f5bacc6ac8f62acfe0c2c44180efdbdd171318fd719f21720b07d1aa3839cfcc8ae708a3f6cbfa409faf5d69eea9f4cc58586d88ae81b1edbff470a1bcb9b1aadcb1e04ef0bbf99fad2a5edcb3f96bf0bf6ddaf7ccba9c325d3fdfcb1e8ffae6be22fbbb76b3cdf60cdaec82663a6b4cb6aede7c44cb9cde77a80b5c3c7a78beb2b082e4c8f6c79a5a53f01c18a421aceddcade937a7ea2c74c9fd22ae04933fcec9bb1a0c69dac5df52deca86fca964ecf4db7da793c5f034c3ceff121101fc6ab146bfbb15ac7bd7d2cb188488d5dae7a0dabba1ef9d1181158dcccbbaa75d75f2d8dbd76c162da74a71b1decd9f4332ad9cdde5cfe56cb66d166a7fbfae91f3ccd1c5e067bee59217cc2f2784cb6fcd081abf95ea6ca95edffbebede6b3eef0cfdf64ef1fce60c1cf33c9c3526adc0a9c9e9d33b8bd8e7eaf4f757deeda0b8a21b6cfd14a2cba8ae6816afcc59da26de4eb45faaa642597fac3b2b4cc0bfcb1152fa8d2a5acb962f8d8e9f80eece4c5b68cd11bd9f88a11c8af6c05be48df0953feced98421c93eefc1ad6c4f6eff0da930ee099c1bc28349f7a4a7c4d2ae919e3434ba1dc5f23cdda4c6b2bffe7d4d35df91eb7bb198d4deae7a8efe2aa9c5af2afeba4eb2cfedee37bfcdfea4c3d29afc9091fa2b2357cedf4c22e2af3358aa595f19e3bbf6d797fa5a39db99dcbfedd549b3dd8f7f6dff7c000d231a33a4e0dd7d749c9581c5feceb0acbfaafe63ee15a90da4d7a5baca25007ad9eba0efa5f7ba77a72b488a8e88a9a2cb1c2fb62afa633f0d1ec9e2de7b0087422b7bbd0a8e15bd03f5f191afd7ef3de5568f7ae0cfec9e737cd4dde6bdbf02da5bf8bebb98327c6117275e0fa57dce2eb9afeed3cbf1388cefdbda4ee05ddadfbbbeda55f5ac70b0bcacebba030a21d08fc044c9a37f2ef1949a8fef8c3bf1bfd91d43db1c45bee6717d016dd0f6f6ebfeef1c9cacfbb7c7e1fac24df4eea0bbd5de66bb27cfd678b2b14578944a72fa2214fe7c2da24a21b8fc0d5ccfc76f0d5cadabaaacfc1e63ebeb1a2ea4edc7c3efbcafafd74deacfe75cdecc63f0d91b95aa3dabdde54436c511c2fdc1e78dcba0eee9f0d2bba9df37eeb2aa2eceefccf2caa00f429cdab4ba9089db62f2e8ab19abc56a0a2a9e8c1afad27b58681f2c9d35fe08d3b7f05e0252abc0fc695fba2985fe011e4caf8bcfdb4e2517cac3e3e2ef1bdc5bab24fbccb94dbcaed99e64b8bdbdfc1e8efd319b7a2deee7d45fa7a05ce692699ecacbb72df0ef812bbdb614a63fcff7e3bfdec221245b6dbfd26573e61a12d5e3470dadb7df53fabddfdeae1a0e99f568ecaaa9f3e4ff8b1ef7546c1cacc6a6baadcc6f6e8ea8acbaaebb0cbb1eaccf269b1adad1eedfe64ecfd82b86004da812ba9a2c0af99cbf1c30a82d4167782b1325ec1ebb30409ffbf0bdff4fa8edc18982d0d1d03116b4e18ec9da1da8aa6a6fcb8d2eb5ddbbc3a5bb7fcb87bedfa4c98dcfa0bba8adcc5cfbfcb1dba6bd48b0f99fbe8a2ca48f1c2a6cf182ab5c0efbf509e33f5062df2dcc7959ca7d0fd1eba6ce72f9dcdab97e69944a7c5b283ec94d4aa01fcbdfb25abd50bae75a7fbba7c52d2cadbce4ffb2db1cc33fa6dfb3e173abc9467f0c4ff35dd0dcb1e550410013e0bead1ffb4ddcac617f14cdbb1515e77dbf19df0bb2efaedce3f2b0f992ba2c4d1a3cd1fa15c0b6bcba3fd2afdcded76290dcd3ce86bbdf125d93b08dfe8caca45efaa3d28a20b8ac1bcee1caf0dabb1ceb3a4d62691b2bec138d7a64fbcf7dcf2c066b742ee95e726299d9ed8f0aeaaeded85bfebe36f984ac3fc32ce05505dfb062beaf7229fed6eb5ea927c53edf2f49be35f4dccb2d4d9cac3d190137ecfd4ef5d55cc7bf79f867c8ae0c4b42fbed52c7a7b2cede341c68cd4cbb6756b594cd9dc3981dfcef559ef0fcb6bbec2c7fadc7dd8a9a49cec17ccb8b0e3cc5f5873d483fc1478b22dff3f6b4c2ceed48da03f7729435af2fd11738a40adafebb7d9ef2e010ccf601a51c7edbbbcb6d50de2ad04ee5e7f6c2aa89bcde90a931c1acaf14df3e3a9aef551bb14b93c047200bd9be9bfaf53daffbba4faabe9bb2caae83a0c1b5bff7ff0ea6aaddfc9f6eefa0bff67d4d82958aead9f3a9decd71cd93ff7eb4f41cbd005d0b9b1423fe6dcbdba599ae42faeefdcdcdda60249f77f7ae92294dbbe7b15b9dbc0d7ffb0a588cc45a1f40f7b354c659aa0bd5a4de8bacdffca47f3bdc22e2d38211e3cfbbdc1b6abb466b7e4eb9ab6e6e6e842ebd07fdcec520d2a3912c27f855d2dd0edf6f0c68ad0f4f9baef2debff579d7bf3b6d1f2bed9674dc7e7bbbbd84cddefdac5f48d3dccbad1b1cb6b8b8bf0daf3b871d40e6ae98cadbff525fbb9ff8ee47dcfc5f3af8e1aaeb286e1b0080ab5e8bac2fd3b1cba15f8a1b0a5d5e2f5ccae5f11d5b1be17adec6f1a819792de1ef47bef7a63a3836580e7d74a3a0fd792f6c311bb9e51dd83e994e1e4b0c1b32d73b797e4be806fd20c5df71c42b9771fcdbc05d44c73fca04e41ebdef620e3b8fac67c87feecc61fcfbc4f3a83f4b2a0f313c2848c0ecc4b1875aa09cc2ceefbc7fff64025aa21e6b384fdeaf6beb2c1ca5c3bb6dd0dadaa96bd26fa559a4204ff1bb1e5ebbcb2db60bb8fbe28da5f44562533aab2efbeca3aef2dab6bd22c6fecb41dbb3ddc5894ffec65f55df08d06ffb9904de867b954ebbe9b9c6b26c690fd509a4a6acfffd0ecac9ff601f1d1ccbd1f517ff98e823bdded4df4a039ab6ea4cb6bc442bda4efcb94bd3d850c046ee69e9e3bff4fe5fb2bed62bbfb7e0fed8876fecfcdd1de165ef282bbfa83e7bd8dfb5abb65fea4ba19a2dafa035f16fdfdb203b9fb8cf5ff7f04a2dcdcb1b2200e7d9604d5cb3ff8af9244a4847fe7dceed89feb03bec9f0faf0fd2daf013235ff9cbffc2cfb3abb0bfcd97fbc9739b2ef10ce673cf03f1c17d986a8f20bfcffd95fcd5dde4f4bae1eb94cabeff0b11ec15a63d9e8b38e1235b9a5c86eba5c64fe86de7475eb8c1ae8ab2c90b86ef37e3fab1d8caf57da857cea9abd9fdaf2bf5ada00b46a6fabf8a15ab20facacd67ac6326c0d159015c1bf5cc2dbe84e7f6cade4fdfcba094c1ec4245b31f5dc1facde44fc76665dfb10b4b6af7ff77a1db3c06eeebdb2732a4266287c6bafd73e596aec9edecd65ebc3bfbade740fa44f095acb128faa8fffc1d9fbaacf5bafa8758f05edf065c1ca37fbe2e1cc9c5d35a2a5e2e5b76dc5ac9929d25463079fab27a7af26ec41a1abf3c4f387e4e8cbffaccd5bc70a8d3cd4acaac5d456cfce69b8af9ba3cd0e03105b0ee68eedeed2fbb5ea8f0e140a561da71914c11703fcd8e8c6cd2d0eec0eeacd6f8bbf7420e6cf3dbb6575ef3eda77e7f0cb1df8a1a74cb4cdbbecb7dc0bddcaf49b94f2f6bdc6cd32ba36db8f24cedca9becce7f22620ad38cabcf39a2454fd2eb60ed4fbaa849a7d958b4ec9bed3ba901181fd2ffe551258ed30ba785d6b31910b76a97f8a3afd894e1d2ed01c72a0155a18d497bb91ad75c0ca52ae2be4caec92bbe0c77d5179d34e2571c74a9ede5cb2d31ab472bf33617bcb8338fa701dbd03e6a416b61cab1a28de778fcab8988cae3ffdbb56f1a0d857aecbb4330d3cda8a73dae8dd0d7caffbe1d50ee271a20223ec154dccc10a59bdbbfcc3ddbb0d73d6079d8ad5ebafdbfef8fccaefdfcd500b0cd458c647a714df0cde0c5cab4f0e5c15ef54af3fe5c5ad4a9fc5a6515db262dcfbf5f2987ab18caecb4f68cfab6dbcfb5e434cadb77eebe4b1dce4d5bfd580114c43177e8a6a1a0c39dcf480abe5f7d9bf20aaa1a92207cbf050eddefa61aa2dfbdf7ca8d5fdec5aece5cde3db8fc4549e77579cdb88d259f4813c16be92a67adb4837ea6e0d60d68f3c6f05eefcf8b1b271b1b26c74e63d8153c8b00799cbfc1cace5adeb5b5de3cf5b204efbb185ad09f267041bdb31c6a0ac09efaeef3b05fe630debcd69feff7e5459cfcf13f9e3c5db11e68936acfafdbdd276d9dd4f8cfa14253e84226871cae3cb5c9e5bac39ffe886df7ad06e57f408e39ce75f138ca4ad4d1f6aeee4bbb142eadb9c3dff123bd2f6c5009c6d417fbf0dccead0bbd3fede2ddcc0fcdac25e15e6c7ad34f20e3ceda39c89ed21f54f2e2a8c85c34f0c1d39ef6535bff2c6dc7ab6eead9ef0fe8ad1decb108975b4bde045c2ed0927e15bae71e4468ea3b875fb5e79caebd063d851048eedfaa4aaa5ad9f7b8b1f80ab2dceca58d380b1c977ac7d6996abb97b70ae558fd9dfd1b70aeac5c0936ddca99b2a5aaaace65f31bdffeb2def275a1ef4ffedb0feb110de61b72b14de6d02cadfccdc8cdccfa89f1c3bfecc39b184217dcf1b653b6ada63f60bb1c022e57ce8ba8a3bfe364eee1ad8907648dbbc5ac26c33e97e8ffdc2cead9356f7aea1bfa3bca1bfd06ee656c0ca9fbd7bbac1f85f4e5e1d4b5ac2d22afb9cdc208a56c8cbc5a7acc07fc68ac9dc9c8202bfdf5abebbed6cdedb4b4a5c52c503ccbc0abe0a5d665bdaeef7c126e62daf5eebed8af7c674f4daf6d8ff0b2be9344df201cc1b3efd5a62c7c278c69a4b03a1be04abfecfb5decafe938ad5950644a302dc86aa10ffaa21befeb9ef929a9df103bab7c7deb0ddf1e4f9e0b0c5cdaacfdaf1f1caf32dad438cecb8bd6e29e7a18bd5ffffb6630ba98d5a5ee6eced51130c6cbebf3e91a9da4ccdb5eed871d0bddcab06fd5bdd4f53c8ea3f17cbe5d0dca4dfebd383084be4b2992eefbff25654fe98687da5faeda9decba9eeaebfaafd1d9a21fbf7d6aa4b1665ca494f8efea8f3a5d0fbf1d9511cef7e5d79e2a29042eaa196bd48705d341dfcb7aeeee864efa0f764d37d2af07034a1c686abc9ff0dc6f6486d63afe82ebeee1d994cdd13ea7629b7be4ecd31d59bdda7520e6a28fdf7a38038dd758aa6a2a67af09e93fcf6dceecfa4dd945cfd19c5ae46bca7d0fd11f19e853df40f42bda163b532b76eacc1585cf7bbe9f1fbd610e5b6fc8cd8a3e6aac62b23790ba6bc6cedecd16fbfabb8bda806fea0ee4aabfda16abe4eae1bc5eadeb4dbfdb4f12439acc5b39ffbc37efda9d4df6a937384d2ef10b0c5ba5cdb8f5ecb3ac054d7656fe30caf90bd4436726f3abee83008ff53c03b9bdfee6cd7ceeea0c0a5800dc251692e2e3a4173dacaaaabfdf04c9924c14f5ab3955faffaff4f2c6bffbbca7806ee3f85d3dc920f0e3bad0ca43f958909dfa9ffc6e9fded0bacfce384ccaa7ffc5c6bc2cf13bedff3cad1cbdfbffbbedbb8fcf7ee5ce488cd9970648cfe4eeeccf302507afd9ececd361bffb5ec8f5a8bc5bae78b0cb8d744a861aea23f48436efe799c02fe6ef668f9709def8ea3217cefdec61bf15709c4dca269a8dbaee4afd7b955db7b59bb4ca2daac85dbe3ce4d5fcf12aa610f8b80f3ccf1cca87cf55eebfc4f31cc4da6bc6859b06fdeea7a3a019c04f44d8d84ef32b48db55a501be4369fea6e8f67aba5dd1b12c211a3b2ec2cf33cecadc5ac6b98f7ab08d1db75e49926c48c36cea4aa838ff0bb4a08adad3bbe4faa5f87bc6bc57ce04130cabcbefb7797c15c7616c2e1ce0de802d23b09f2e5fd2ec83c4dd1bbac9144adde8cba7a1257270f1fe4795392bddaa5daa981f817dddf770faac61b5da06b4d9c4f158fd11abce0cfebc950d5bccfacb26c2cf3e14caeb4edfa9aa7f9d4fabecedc204d85bce23c7e08dd0d9c7aad935a8482b0d311b4dd71d7ebe4b4db3bd6cbae7d7baa43d0a6ecc0e489da3d92dfdffa45899b48db10cabfecafe0b6df8e00f2d06538da5b18e2ee511d1f229bbf7cea949ecce68094d8c1ebeee31af3c3b01bc3a96aeb53ffc690a46b1c851af09c8d4aac1ae59ad4907412bfe1f9f7aebf605f24f77d2a3e2ac71257bbbac61a5dda8e934e0b4cfdcb56532e39fed67ba3b3ebaef7db7566b5d60cc16f470ff8e50a3713e15abc1cef7ac80556e4fffa4c4bb6288b4f0d6ea1a5e9bfda44fe619a8908d6be97da8bad6beaaaceeb2a2c4dedbecf0fec48f06bb0ef36cbfcb42fea0cde92aabbcf41d27824eaf6a3ec5ded2efcb454be14d193fb70bdc98db7c1261b1aeaf97db2e124ebda15b3e4ecd7e650bf45e31264a41dc62bf4f2bdfefcbd9fbe7eb5c3b565feba8d916c13191deb4637597eba1b2e9f807d06dbb6af8ea17dbbfe4bc4b2ddfc90ca83a60d46e644ff536a38fde4d917cea2cf722febdbe35ef455f77ccd4e78ff7fec38bf1aef5f73ebaf8fd7aed6dce05a4d0dd3ff0a9dcdd98c99dbc3edc30b176b0aaaab65daa5e22cafdc5d31b6e856c7d1ff1ab0dd8cf29cffaae5b6e235ed4e1ce0989fa74bdabc5d040cbe6ce9a7b4bcf82a1fe3ef5aede6ae348a63055b60449a864755d8f37c69ddffecb32a4db6c2a0677450682e3bc8504b7fc71bca9dcc22d84ed9e9128d08803b926d90b55cec4ff94d1bbbca4edefd969cc3619abafad06ce5bdeefc1d11caa03bdae66a41b2fe1dbbaebae038d91f6e0d6972ccd6c463bfadc7ddd526bc3c88e5a9aacbca8bbdaa2ceab0ea9483b613d6e03167ff39cdcebdd9c77bdf7aa8e4709fdebfebb15c6cae72cbcd104651f06f3cdb7c9e8762a691d7ef1ea11d67e693dce3b7abb2af7d850ffaf38a28ff7a75b225cfd0d8572b08048fae17fe58e9cd4471f168356aa859cdeead3bd56c8d289b17143aeafae523fb4e5f3b2a9d88fa8ecc455b62f29f0dcaa4cab54d0a768b12e1e3d3af6dbae4c9aac61ad2673f7bae0f9ac4389e7f84b35d5bdec8acaeebb1ab9af1a87d62457d5ad298ebe77bdda8ecd19fe1db1eb05af438b0457bcf3a78a0ddc029782133a0ee812af251e7a2ea1f707bf262b9bacc66d48a50c4ffbf8abd54ec1ed9abce0b004bf22fb3eedc4ccadbac16caff8d767f4a9db163aa45122b200bad8d8205aff7d5f8928bda82eecfc2b85a52f28ece6ff5acaf6907a1eb7a1bbdcff3e78faaeced98a7dfff46a7f9e41ad39aecaad4d9aacbbcdc3bd8b42b83bd8ad466dace828b3caf0972ebdbf3ca7ba2dc3a4fddb08c6bf451c317b9db99cd4c4dcbaeaa95c6f23a62bbd16123aa5eaf9f6ce4c5b3df68f964df0dd71edcac30ac7fb66e4f3aa98bfc7cd27a1d012ecbfaeb29ece06f2f8d5bc462da5d28b9f8a3e6cdcfa7c278dba56d189c6ffde85166e2caef5595c7b6293bfae7d3ab4d94bf3acb792307b4ae3860f1a75cfcebdeaeef8bcdee27c2abe5ab15c227c6ada15eda16b70ddec6433de467fd4beccb198b9cdcb04fa058720c402fafabfcac0cdf48cf4e5af064d1ab1c64c8c03a7bf78540cdfa82bdce948ff8cbac79e6edde3dafdaffdddf57de6fd01efffc7fb5c5ac066bd0e94d4dadffcbb2e8bcc7c1bc69de4d1d2766bdde4433ed7021385eab7ccb8656ce3a90f77de98d2d8db5cbc6a4650e3ba905a756be53a5e7abfa7fcf5987a976d5ebfdec3ffb42c031e346affcb7cd6ddd3eee9009d397002f4aadc4eb4167cf4ed4f7f25cfcd22c28bf0a32ccef39e71d09ec029419c4fd2b7e51e35cfcdabb9b5fda7fb344c288c27e377a8d9afb3d6e154bf9b2b2028ae2163edecba26d05b06a9c90c4b51f3ba5d9688c8194de2b70edfcbf0f7e53ca4b7bfb9d2d0e629f06a2fc71f9edcee5f7bbd8d0b415b4a32ae4f272cabaec470c8ac2a1afaf825338ac1cbe67ae2354dbdaecd4cb0d6e7d296aafc8ec7e09f27dcea01f4ffe1ead77ffcb4d630a11c10fe8b91e9f027daadc19bb2b4b860ff28c0cebded0ce86f1d60a513b58efbcb9e5ad7fee49bba98ed19cd960477fb3930e6dde8ecc04c68dbefe4ef8ead95f4ffd1acfefd1df174bd7518876e1a0a57e7eded9a4b3abbfafc9db5b695afda73b228bc21047a70e4a63b9bfb8f6bfc1a6ed9da25d94d0d5ff5d3f8765bc89cdec7e16a34e34ce1eb10a6ff429296bddf68adbd4bc52aaa61cdbcbdf1c44c9cd33a03caabcdb13568733e023fad3038c8b0b77f70abc7ebb80fdcec9dc8acac22b166c5011e987a80feae3a690b6dcb3402a56c06d0bb5a6abbbaba6df7beb579cde1e30aeeda5f04ada97f365f48cc249bdfdab05bebdbadb44ee09ccdedacab45b345b8fb89cacfdbdc92bfe3381edeeef8e9f7d7cc6125690acbcedb7dbedc414acada12dc646fa78fa77bbd6fbedf08a0e2bddcba9f5fae93eab1ec69c8e5f0ddbfedde5bf4392aa6e6f58a724caa6add8fce3f94483b0ebccce1b3e268b50b3e6da3ed12cf75eabe7af1cbbe5571daa5ffbc99b8f5aadbc7ddcca11bf5c5a4f0aa36c0a4085458a36c392edecde61477afcef98fbabdb0bf6050dac2fcfc3d414bc198bb8bf24bff7bbb7abc3f2fcdffc03da0f8356eca2f8178862f0ca4de83d9a350fca648894e2c7ccc352bd73b39eb9abe655ca7ffbf2defacdf008af328f9b75bb784ac8670af559ea2afb23dbfc462ec40f4f3469970bf1aa393cdad6348afc97ac92ca5d5dbfd1978cbb775977d2bacc48b1d0a834cfe35dadd4eac11c4490bbca9e4cf6e1eafcfcaf3cbad8a20eca3b0796bf3a9b2bbc47abcb2a404842be4aa76cc4abfec8a47a0aefffc44e9cacb8974469ddafee0d1b9b1b6bbedf587bf1e26da1d2c684c4bfff584e4282ae4424ddc141dd43dddb299a6a0ed8ef2f78fa7ab68af3e5ce99bb4aa9bfe18a901dadbdc6def93e51afa6f953f94ff121beddca6826fe8f20cc66147acec01dc75fcea0fd3efcc7eab03339cae22e1674ad6277acdf5b7a30e3fc5ca1a30c6ee5caaecea6c6ffce4cf2a92dd3f68dc51f6bb42c43b2f6ada70e27220eb4a6ebaea4ee9cd71bdb0be0bc9cefbe20bedc9b0f184b9eac8b56b0503bc22122a1c8f0d3af0b37cce0d24afce3ebcf3b983a56bfb12b1fbda5dae62188ff2cb7cd73d60a8e2bb1cbfbdbaaf8acb32a8ae23bddf5b062aa3fe79e13ebdbc1aebffcf3b1dad4a92304fd1c2dab614fd82b1febeeedebc202068b0fa1df850e5e5f9ac6bff24ed22daa90b6c44f2a3ad94e07ff35bfd9be25142ab6ad96b1b5e5efaaff58ffc1d34debef8cafcde6fdf9ee8cd2f4cec3af1d767d18eadecffd71f2ccbf169c49c1edfca8fe3faad1a67f0242ed5da471b97aee81ec5f5d6ef23ccd2ab3d5b85df0acfcc9edd9808bc5f8ac5c1ee4af6ebbc40f1ecad24d8c86aa54a14a54df7ee1aff2e66be66658aab9fcf2f1cc2b2c6c826df4ba6996ebddef910da513acbb46af6cb7aaebea6fa968cbfaf682c5204f80bce1f4cfea8d1edc24ebd1e1c1588a5e95e7fededdecbd3bad96ceb8b04ace74465d16b6ca0fcfed5e34d0ac70a394d1b379df40d787cc9dc439cac3ffab3f15c2f0bc1ba76b5d8a1fbedb07e5bf5accea409687abd7da060cd8bdbc3fffcdf027c9e544d16bfaaa9b72cc540c7dd3f5e06fc7dcacecebf79fed4f98d84af5c5fe22af4904f89cb01ad0bcafe4ac5a4bdb0843712ddeedda17bcace4407adfb4c5d1a26e65aa6a52c99f22c129c29669d25bff30c89edc1c9fe5bfe9ef8d7b75bb832bebd21344f25d8d3d28489b6fbe673eecf4e5fdcbd928dae29aead1c61ff642ab3c77737fdf4eee520b5ca0c99abebe1fd6068aa31667db3dca3e1da1cd63be50c6c6de5fdd9cd8f02ce58b48535d685b79f7fbf1e056cebd5a9ff8c7d39f2eda6fe7bbad5da21feff4dffd91ac573bead5d0ccb4dc8dab9ad37ecfa7cabcae6e9cd3bf8db65aabfa69358dde5a546bae25bb8ae80acace29f3bd209e60bb2bab407da849a14d6d7ed605f7c5a9f4dbcfd6edff1dcf8d5faafed0c5b6a3ade0bdb6d8dceab1bfdc3225ce045190eda0f01dcbf3c8eb4b33e42f01ee5cbca74fa07dc502c8fc23bcd25f35f4f0fb829907b3e90aaddfdeda3cfbb78cde2dc5a679edd60f0f4ed699ccacee226aab7aba8aabd94d65ea204c4a02d27cfce50ac9d4b054ef848b566a7a112b8ebdc947afba97f8962e6bab20ef02e7adcafdaaedab8ccbb2cb04de0acf888d1f0d9b7c51e03df0138d48d3eb53fb0816fa2dd75babc15202a30c6abab8bd212faafcac0e57d0c3ec8e7f6f97ec9e5f0bdf5c80b68aca327a1eb8f863965e2ddfe4f08a0f3be9fd58c72afcb6dd0b0c2e88b6a3d4353bed988783c9ad1f7dfa5cef1ecfeab87bb3b54c6385c2afacba7deed6ee11aa8df03f1bba0e5b46e9bfbbeabdac10233cc0a6acae9be1fd1ea6c19dde32e9f4b546aaec4763e7c3a5bf0689f09c5d8cf8c5375afdbd8f5e8eb90aaec1af812f1a13e4a9af0c6decfe7869465ceeebbb852c0ddace73d5fc00be92f01019f2cede12faeca1c9d8c6b310afad5e26ccb00a903f4f0573e8f0f43aacbfa793e01ce2fe1ddba7bbdc922431efcfdfddcca0ff9bff035c61ac8d8ef1914e9c15b2b1b1aebb3edbe6f5cb44349d65d65c03f0ab8abac6bff8c76f5a2fd9df3fbccd9ad31af2dcadd3ccc0a5d9e0efcebcaaf4bce0e9bd882826aa84088d3cebaef4dee0b0e6bcec60cb8cc8447d1fe7de81cc48c9d7a0d451ffd0cf2e0ac1a1f4ea631231fa4f6ed4baf37ac3848beaaf8ab53b45ddcc95b45c5ffdc3223cd8d9c7583fec8ebdd3586606a744bdbe25a537d1edd1faa58af91d39da9fefcced7c9bb8aa09cc1aad9e991fcd3fee8752e96d1ee5ba79c6c8458fa2d4faafbe7058dafe8fa3c4dbade4fecb6b1e03d76ef2abaca5da906f305ddce740ac152eeed95fb974c9cf57c2e489c9ac0ccc2e1d4f91da1bbc2e756f6f24eddcad7de2c998bcc4bfa0d5e02d0dbba33c152e2cbbf1cfd8aebfdbaa9eba29ea6776debecedce7b72bebfbaf2b8ddd64f07f7c28f79a6bb1fc6b8fdf44d5c4b51689dcb80f209741adeadb7e8c1626c3ef3d2d6ff0e1cb5ab80bb49947ce3abdabbb12cdd9eac9c0baea2bc281827ff9f6c8698cf47c61e1c07c373c3e1a766c679fccfe149b1b8e92befecd5ccf7f027ee9f25ac8b78bbb58a7c9545aabb68415a97a7154e9b4e1cdeebf1a30eaca39c703c913ba0e1dbdfef1646b3ec33baa40c9d0ddb0816b2c9c5dd9fb6f7a5d59eca7bddcc81283765bce6bc2a4f30a5abfdaeda0cd48f1736be5fb27e230bca7b9e92d00dc9ee2a7059b4eefcbfef29b4eacd03e976fce5e9fadb9d051cebbf7f941d8b640424a25afe369dc00f94bed4fa452feb1e5cea39cc3a57fac6badd8fa6c38feeb3fdbea187bcaaf0b5a1fb4b8e457fd6332802aa6dcc5dacfdefe47ec8b6e07a62dedcdf11db4eecaffc074eddcb56ef83eddd96217f6bebb8fef18bbef1ef7558e8bc3d215d9f22d854e5fe7f155f73db54a05f3e520efdaef5bed0aecb62aeca77bad1da97daecc852a049e2e9fe36fed729db7bfbffad5b91991aff1ed0c38c254ae1dfcae8fd58d3dab7eb50aee77539a231a7da89ddc2ec5ac18b2fd30db19fac28e1ebacba08ed6604b8caa47f71a9aefcdd9b4e107085ed76e0eb6c1c811dc203419b95d958be0f3be01cfa28aae4f5b1fbee7226b3502f3aeb6f575ab28a23bfdd53aba4dde47daafce1bcd5fc64fc71fe454779f809574bddd0cf20ea41af4ddf16b26cbf069465f7adf554d54c0489cf039b620953d78064cbaec8a41b7eadb1cbbd8fdff3e7da4c0a00ec5a470adec8b08793e9cfcb5f7eacb3e0a7ae8f7ec87adca242ff001fad0ffde9a9ece202eed62695d8a53af6ffa06e26b5b261658c49f3f9a1293eef40e10b7fffa68e4c6cc9b1cbd8e0fce8c2dae166d1bb12bcea9cc63f72e0bed0764efacaaafe4e1fc8feafc6e9d2faafe1f2f07dfeb8ab6fbe941e9f6acc1bde4cf11b5ca7fbbccb9ddff1dd92c347dcb914796b3ecaa24be9fa5bed7ee69516b8f9baea9f8e4573dbbf8e591ddb5bb18d63bd2f1ebefbda5dd778cb305ffb72e6b2a9ee7ebc0dc37f9d1caf6ec70d8d0bf05e82f82cb81a0ec0fab0fa92605373aac837cbb29f8f24bc3d94901ab7ded8bddb64f3ac7cedca7615dddcadcba645acfec371daef69201fbbebacbd30f3f298fc853edfcb24c86bc90425a36fdce4b5cab6ca4819daf0ef9decb0e18f0e4cbc52e9ef452583be8af61a09b3dfcd3a5f7d8cdadb2839de93f8f0c47feecad7da385fdab1f8f1f9c1cebe2f857ebaab354960bad4ffbda8dd24c5be72c5f8ba4dcc4b7a46d11ea3214f3b1a7ae66fcdfd2a21edeba9d66c4bbf76e2eadb8ee86deabdd4bc7eaddefea2862cfbe1bcda48058aeea6b10bdfbb5fa4aaeb5fafe935fc7dfa5676ae3e67bacb6a9b0d617686e98c2aff3cbc1963b316be68cbfd7afa6b2cac3488ad4e882bca6f67ca6e899cf324fbba45a78753bc58cd37efeeefe85db2ffc512ec8b1adba67c6b1f6dcac40a8fa1bc166a2ca2045e81e507da9f7be29ddad96d2f9f2dfc08e5f5ba4e06f7f579b7adc86f7750b20bf3c85fc4f2ab8721ef2521e0aa6cdbc7f504cdada5ca9bca03cb8d12acae474ae4c8c9cbea8eeee65ced81ff6a8de7ef8968dbacc108d9ef4d00bc174e1cfeb49edc8dff022bebace3dd70f1b92bfd6dbf5b3c3e759f289911090deb1cb51ccbc991ae42b0dfe528edfd5b12aaeaff4237d9cec8f15137a3f85dee0200a68c052dff96ddbaa4b662cf194c16fb35debdaaa115cb7ddd6b37cf33ef7ee8b93369ae183455daad9aa1d90d5dcf111cd175086d0bc9aef2a7feecdeb6607ac985cb2ae2dfeca9bbf85b35b044eb1ffbeec3f1ce193ed1fdc4d4ad6f0da1f9ae33c4ecedeabeb9c4f9f3e810c6bafa513c654ffacc4bad10bab9acf79d5ef43efba99ce5cfae68dddf0695c4acaad76d7be51bbb1dbb71fca50ecb049febef848efee4d04ea99c3bfebe91a5162ec3c6abbfc05d91b844b8d68ca527a0f11eb53ab3aea4b1affffafebfa23ffbd8ee04a5fea3cb0ab5bd39b45b0f9f0d1ccaddeca0ffb1618aea12485520fdbf01a6dcefaf1deddbfd31b3fd03a0d9bc02abbdbffcb1eddcd64fe8d5ad05d5a4effc9213b754afc7a5bca7382a53c5425eaeb5eec581c2e9ec92afea02105fac2404eb233de142bbb1d0aaaef6ad5c6893ee3acb7c33d2ebb1fffd504aee020f876f8822aaeffa2b6f6dd95babdbd2f5de1acf9b5e9efa1ceb782206e0bd24dd2ddc4d6637cf4129da46efe25f3e33277aab1bfc1eca13accee4abb478d8aa3cdd337e78cccd7fedcaa9dfab9ea35f2ab29a8122b7e9b9afcf7faeddeaec79dc860606fdc64c82709c35fb15cac88ad4bbefd971b6ffbd9ebfcd1cc7a4193ea6e68fe88f34601839b8abd08a64aeedeba32be321ac72c1ebccec8d8ccdfe46bacf6bb7ba05ea5d7d3b857efaa17ecf075f2721629d42e56d9d7e7a3cd2bea68f4ad022eebdc57e2cdd797e476d35546eed6ab2ffecaf80c65dbfadacb250caac5bb3b5dc5794c08fe7b65f5a6e822b1a8f7cb1214bbf900de29e25fceadbdbadc1aabd198da0d2dd4a94bdca4ecfa4875cebac62d9ebd3cf84da4dc3436dbd8426903cda63cffca5f5d9ca99fa9938db7a156c2ffbe82a7c918eb65dfc0241e7328cdc75f12fd5a6d10fa3ec77a83ccebaaff755b7cc8b03bb1dd7634d6e6c037c46a696a3bfcfc356e69ad5e5fed71fd02ce310fa9ed5a67e51df9f96cce4b8a3fbcdf2fbe9d4537633b43cedb58cdeacb3d45ac9a78f6cb90a9ec34cfc96b22ccca56a98a9d1aa1ace29c54fdf3eb05d4cdb90d5cffcaeb4d8b0ed0fe09f6786cf5f2d44dcca10febfcdb8c9f2fb03c058f4dd6f9a9ced931b98aaabd1a7abd889ac0adbcf08f0f310d57c3a4a18caaba6bb27f120ce2f01e57aaab3a7b7fdefeea4345af5c6cacebf07112a3557004dbccbe4bef9fbfdfad69fa993bfdbbbd8e4eee35baac56dbbb1ad04326cfedbcfed3badeabf8ccab2883f2a9cde0ebed7befc737bf48b8bcd84bed1b7fd0cdca8bd55fc2ec3a4cabcedd8a25cd5dd5ccdfab3bd664caa3e1ea6eebad9e3c8bca33293eabc78dbe109c99e29e6cbaf5d08e8e4a6108dca58fdf42da6e25bcdf0bafd9b3a76baf8be35dadf5ee3fee040cfdf2bc6ebf0ebd92d075ff9fddf3a8fca9b4b9eaa3baed2d3f93581fc5ecdff6ddbcdfd8ba27bb0d3cdfe263c3cabbcdec08e57cc6bca02a9c400bd0de7bf66d13dbee829aed0f5abe2cb60f459cb44b786fef739d074ec7f37bbf4ecf710388ea669eeee64fa8bcf1dcfbedac4baf6c2dc378f6e78f2eb82ec5abc1b87069666abc3d7b87f4bde2bdd1edfe7eabaae27cd34ed1aa77bb44b17053eac0617adbea9ecb2f252eb6ce83ba4cddfcaf5fefc9bdacf2d43b7dbd28b8c737ddb09f6bb99a3a0f1fe6b1baae1547c108040bdfaece48891c6ace9ecc60bfdeffea2dfbef4ef093dd9fe18f31cb6dbac3ffeebfb8bafa243ad2aa391cc3ea88cf11fca6e1cde97acb9dadfefbce53af0f91cfe5ba48ebdcdbb5a11a0fded6409f546afdfb638e3f5ffce7cdc3cecd9dcf505d5a3bafacb9fdcaab58eb6e577b48a1a3f75bddeb1abfebd5bd1ab7cdae8ac18eab824f9ffae9abe8cbfacdb6deac1c02e93defd5a625bdbfcede7efce4a8cf13bcdaeecafae7c74db0e2ac5d85d3b28fbb5bfd5bcdf6ad2dd1deaa429beccf5ff6ab5dce89a92dbbc5221aaa193b5dbcd4adaa1db1fffaef747ffcdf9cbccff7a7e20b3f3ceec08d2ae004f7402b6dcc5bf10d1dec0685de84cfb9ffbedbfdd2ed437092e460ade9bfbadbfdaa9d6413ada2d8cfbaac5d8496e9f3f00a0deac9448dfdcefb29e9e5c28a69d334ea0e8cc57ddea7cbc7c45497d59ebaae627e451d9faaf35251ca5e86afc61274c9d6bf4ebe3bfdcfecbec780c3f20a29b1bcebde5b35cbfeafb0ebcabf6865bb1fbd99cfd6683addcb4e885a3a7e08d9ecdb696ef0b90785e519ffb652fa75bfb8dbe5bbc4eca010cf2cfc98330cef9dcd56deaec3afe1bb8ace3018eb10b8fcc8ea7b2eca096183acff41dccbf1cdac4d64fae3ed0edfc20277ea97ff144a3f809ecec2e699f7ffbe5da54aac0ea39d3ea7102dbf226ac806d07a7cffc602dd5dca7a88e8eec18dcdacae10c3b3ef5c325be136923dd7fc62ccfdee0ef380a9be4d89dcdbdcdcec560febac1501f377abf5f3ddc57aaca2faaffa37c490bbd5339a9fb3a1d5a145bf40fc97ed8cae35da31bb121b8dfbcf4bde06c817c8df949af1e35ceed4c1b7248d4d25dfb75b4bcccfda6aa9ffe57cd985ea02fb0338de9a43daee2d028bc1b7f4b2cfc32266f1bef19b0c03f53fc62e2c58db9998ee7be0bde4ad5f8bac0eaa7a3bfc2edb79cfde1bcfc85aaea9bbc3ec0dda6398eefe5b6e1a440c94e3b8ae4ea3f4a16f29cdefdecf49ab9ac58f87d811b3dd6dbeff7d328bcded2a1cabcedfc3ae7d073501f6c877e2b6822efe46b1ea3b69fcfa29971ad938cfc34bd4dfdb3be3a7a7f7d54314dd2d13c87c4dcffc3be79ddedeae27544cdda357ab8cbdfec318abcdb84e3c82f6972f3f2e07df51ed8e969ed9dafa3230c8caef0f4438e19c3eb2d83bea9988dab37d19adad78cb31de21eb4a2a3fe7fef1d72409f4d2b0dbb2603b0279aabd7bff22206ea8b3178f4ffd25f2c2e1d11df9edeaec10bd4b8d178b0bcbc8cadb75f75e86bb3fe4dacbba0f40db5031750e5f6e2be91ee32dfbeaa11be7ca775d521ea1d7a2fc76f44ad0a038fd8db01463ee3aa6dab3456a1edbdc3bc241b1fa0ba537aa3ebfaea319ab97f269ddafff120dde3d91343ddefdc9dd1b5ff324cf9218d3627e741d165678afed7fd24cf1966b119b91c75adea6db2a3a106425ef7d6ed715964fa909dc2a4348b31e1db6f39d83c5f2db6eecc8ee4f1be24a8e7edafef6ee05a45d4a2a8f72f3858d5aeed865ccc2d82e4bff9deb9fd94ca212a3cd8e0afa7e2affa9806e325c24fe8fa2d80ba4e2cfb5f1b032fddcee7f3e14fcf2ddd6d666abeaaac488faab5d75e09dcfee436eecce2dc29fe1ed2577a5cdb3ab7c2bf34cca3b6bab8e6436f55ecd0c91d9958cc5d7aa06fdea3faee78af3edfed3acf1edf2f4edfbdb65bba4eae8c26fbbbb273f1cd2681b5d84eadf683c9e0bae26bd7ef3be3c1909bb49afeaff1265d5d1674f8fdb0d2d04ccf4657bbed3770fefc302ddaa46ec7e52ccef7ad9a8eb2e6fbf0b1d7f1ccdf3a7bfdfafdee8b8a67625bbee09aedb7719427af364502b7df114759b1d4c838f5f72fc76ec7bbabd06d49eecbf22f79732eeebb1b607068baa40fcf6bfb8e2225c9da6bb62dfd2a7f1f2bbbe48dbc357e6b2aedac8ae499bdee2eb4fdba528d59beff79ffbf67dafdb86ccc161c3fb0fddd9455da73e8b5aadfe0c9a3e2c29fcba27ddb1fa7a50ca84573b38e78daac2c42fbbfd2f1cfa98e9e130cfda262e0ab55703dbceaadcfc62ad29d95accecc0ad50dfee8ec449cbd8ebfbe0777977cfb35d3f3d38dffd53ff6d483f951bc5fb98bd46f57079f32bf8a1fff124f335a79d6d31feff9ce9fceecddf0ab1a8ba9339a5b5eee8c8eba416d3ceba25a2cbf577cdfbd8122a976cbdb4467f575d6dfcdabf50598db028909fcac21d7ccfcbf7fd4cb3e304beb2260ebcbb2fccaeab65b9d592cf4d1786a84db39887cbda0b5f14e17576124a696b9cc32f3786cbd90cf4ab4ec3ea5cfa78b5bbde7c53feeb8efcbc09bd5a4fe8bb8b4b4f6a77dd0ecde2354d9cee7bdfca0bcee282dbc25f5931cf5effcafb38862f8ded3ddedac0a71fdea23e50ff1f72ef273d80dff32afcfffa6f773dfade7ab1ccc828d6edfeccda0cda2af2ecd7f9b0d8fb5c81bfdf55aeae615bf6fe131f289d03a8fbcc891e348c3001dd69038804403ead326b3c335b7d3bfe6cf63efefd760c37caac5b2f1821cbfecdc97aa0e44b93ca9eff9ff38ab6fcf6f4fd1caf5188ad1ac2ae26d3b0cffa2cba0e6edccfef02eeedeea6e8ceaf2d8c1eebdaecfbec854fa42aead150fdd39d5de2c8b57d3ef51dfa5e1fecc5eaf2ccaf2effb32a17fad3c6b42d58c6cc6b33ddbcbdeda18bec057de5f9c88bd111de9ca2e78a5faddcc3a00dd4aa8d8bda6ffd72fa687edff606fe6d037fdbf6aeb355af2cfbdd0bedeac196f8bcc40b1ed3fd3c87f6a209b70bfbbbc3b5a7c13fcb502ada4b02cddb7dc9eebae2aa0ff94f8d7a7866bb43c4bcc7ddcbfffc4640654326fab4cd0ba0457cd3ecb74c07bc3ffd0dee632c3daeeafcac93c0d5edbe9c0a56fa68a677e5aaedc3ba5e2bbfdd06f7e03498c1fd3461cea9c9df0bc300ec6cd8ae1ff6c2cbfe0f8290e1739b8babbb91032fe7aab20c9ca431124592f357efc7a892605caf7af9f5ea39939fdb83f8cd42a8debbffb0fc3c5dbd72e9cf40720ba175db1eb68da563cb0aebedefecda1be6b0eb0affafd26b6fdd87aaf5a1e0ea4dcba2319cabab596ff9dde5da1a9e8dd04fbaeaddacbbfb62fffc991abee21a3c1facbe9f561f22aa1ffedb8a1eb672eccde22244eafef6ff1d8efcb50ec1c28635cbefaded98cf2c260817b6bcd2bdccf783a5d694a83303fda05fbced36033418c06ab9d9e20f179cd1d2b0fe4cc6cfaf04ced9e712c28d7ce6fd19f2b4a05bd3c216bfe6feda5fadfdddb5afac7de84dde9ccb474f18a1dd1f9a34bcab4ae1b9f6d3967d4fabc2f5a7adfceea5692bc2c8eaa6beaf6f127da5aa0ace539a5ff591cd7fdf543fb32fd976789ff7b9dcadccf4df77d9a5dcbd56bd7663e77afa8b4fd5eb9054f3f1dd710914a6a6de0d499cca39e4df1b157caa79b1f7b13d07618cde9adfd089fb4b1b304139b7c89d2f5674f0eb5ae9c6ecf32740af602f5c5ddca550baf7eb1f86a2b5bdde47cb9ca2a12e809f7034e3ad6c7fcc9742efc1eba7b9ba69d93f3f0d98b7fbfed64fbb0f3c7cc94348b090bacd7fe75c7b4f9d6a83bc40cc5e83e12fc2c33bf7dcce1731933d25bedcdd6f311c7f99dafa5ebf250cf24528b3e5b26ea07f7dd7fe5f9ee2efbd3abf55b9826179588feee6efdf6bacb9d69f8c39eda97f0d9ee28ad1ef1fe89cdeffecad2cea5c2604ac936f0ba04d1df0ffeb8fbc9b42627ec459cc1ea35eba8bdb299ae1aa29aec23f3fbdbe86affabc3de7cfaefff0bedff5a0e9ec4f08f288bf9d575bae1d2fef7332bbd5aaabc7af61b81b6a70a87fea1a430825feddb5f75d23ead515b53020dd2d3ffea9c12ad1a8667ebb8e1caa6fda8f6da2cc0af3261f86bd8defecd0f9dbf5e0cb3dab91d4d59fede9f612cfbdfe396e033ffa6dafb9ecda8de3de319ea0edb60dcb14fcded6eefbe2e0dbe41ad7ecedfc5cdc6afc7b7b0f1de3cd680bbec3c9f400db186ae5239ea2c5488eadf78b3a99ada5b857fc01946afab4ccae0e7db65a58183df5becd98a9b70ecbb709d4d2f4ac2e9899a8b71bbd34379abd126faee09fa428ab2bebebbbd4a3aafbcfd6b1bb0b05ec1a43cbddfb1d3b992369aa555a89a47e072a274ab53f02cf94a3da83daa81fc9e3bbf8fd9c0ab5bfa39a1ee72f87bd4396b6b12475a0ef8a68f5bea4b31efaac9c8fe3b1b49d78cfa39ced7dceecddbf8eea51ef8b2602aedeb02ad5597108b712c638d5e2d1ccbe3a6410b4983e52fb940abe4d3f3dfaa0adcfcdce252e3165bdadc071efea5b22ff5f1e51b0f8cb58065ef4ba7a1cdc6c2f033bd3538cab0e750fefa2b5a7127cbff6d58fd4839c43af579b5c82c114acaa5fad9dcf46ee3dbbfdb85410f1eee187652638ef733fbc5873751fcdad20240f23cc6a0bf5130f0cff5cbfd0c80fa2a5fc306fd0eeeb7afec8c8c6aedf806b01fe0a65a49960e5d5eb13fca1eebddddf3756e0d684fcde612c233aecca278b53f76a8b8e747a9cdd31f0adbf1d5fbe2a938e7aaff6cabacdd5aaa7f1ffaa6cbcbed4cdb37fbfa2d5bb9d6c150181e22ed40efe1c53c02b1aa9cfe3b68f4b353dc5caa5cfb9d5ebeff1e62b3ca8ba3b43bf0baa81fcda8cb06cf3be04cab9e2fccbefe5fa4f09be1bbcdf0dabe4af455c9bc9ded5370fc8a44fde8ec96ccf5ac3e0c20d2b9d69ed12b87e7eccd9e08f25f304cee5bbcd41b9beacc3ffbe3ec989d9faaa0a11ddfab47edd8e85e91b52bad037969ce1ae6bb4f28c4bf511751af591dbb317112ce691fdc2be1fceaa8481f6adc4fb43e68bebb0d4a93b77ef6a07d3edee5b20e56aa4abcfdcfdff31ef23f2a7160e00ffa3d8f8fdb7acd6dae3ddbaedf76c2d808eeee467e26e3f04b2a553deffcaf8a7fbd746925be42fe146a56063bf1feb33cdc28bbb0ddae9e8a2bead0f27b83efe8dc1aaa5f6aaafb6e6cf57dcb0c3f2ee49d4ccfc66b90b702ffccefa509bb62faca7bda316fc7aef9c9d86befadab0571bd6ccce31d0f93f7deab8bcc716b6c6bcb1b4dec6e92ed49cd9caa259ad62aaac6cbdaaedbba55b42ac90ad3c213fe0c59ff3d16ffb0fedea3f910a45f69a1c3dfa5ef63e8c3af12dfe5a9e211fa92d9ad9cd1fb580ab50d1afea6c2c3d3cff5ecccbce63d3bad3ac18ae50b0f166230bfc5a582aaf34adbfd05a9bc63aad7dec2e2dbe3337c96ca3d207de0aceaddcf304fffce4c7beda69d9ca7a19ceaffaccf3525aaab7f3a1bb3e6e62777e9cc67ffa4da4e1e52d5e89e4564fe4fc37dde6cbf1ca98cfbad509ef1df062f9ecec0ba27bbeedc6c947fe844049a3e8e97bb2166adab6118be875b3bbbe75cdd4a7f57828c6e0b35270f257e3fea36d65e51a45431c8995e15b78b35f7b1bb6faffdf6bebfbfecd3db007ede82d83fe6b81e73de58d93b6ac4a4a7bbb9d240fb80ffdbc9ec061eaabccf361fc5d3f322c8a5ccb6acc2c0c8bec5a2c5c341fca94bc0c5eecdc0b08707766bda0d0ce2fa10b0b31a9aecfbeb1be9c5192fdd5ecf683b1f69cdfb5fdf6c2725135deda035c9a8bec755af712c5dcbfc40deeb24f8324c06b2e7fdfc74127c3a4ade9666bbb115a05fad0516deb93bb9dfbe8828703cfe3f5b40fefe9d5514b06529ee306edd67edb32d0bcef9b027aac9dfdca24f1ffa62beb1d6ea3f77d264dfbdebfd82fcd92a9389d7dac3dbacfe3becdfd2a784f4390c4a65c8a6138485bff692c001dfcd1c6f87309fd9fa4bcae9eecab2692731df4e86a46263295ff174385ba9c1d6711bfcee99fcebb9c1cf5bcab1ee5f2345e6cbcefde444c8e0066e6fdd4e2e26aa5bb0dcec4ecbdacf4ee920ed19dee6ec62cfafd88ce278d12f9dc4fe42cca5dde597eea4cadeea986efecb2fd0fbb438e9f6c1aff99f41aa46937bada8a42da9ac31abb5edbdfabc3514defebf88dac9e22a2a5bd031fb3014b8c07be21b0bee5cfefdaf6acdf4df0c8d42fc0a3a0c9fdf67cda93cd5a6f181d724da2ef31726abbd7eb2de463905f3eab2ba995a1b55fd09da580f09cfd9a4bfbb45d742dd1da36c2dbef00af73c5beccfc6cdcf1d0afef03cfe3ee3daf0e7433b5ee5abbfab3570fce94c7921cc75dbab70d3a213f8bfa10c7af3bce8ef5aefb3adeddec4bde5abd41baacc1db6c6d24ae13b8245a1dc57eda5cde15daac8675bf3c2587adb1eac70772adb42a09061e3fcbbd6ed5e8c0d424fb2ac589ba7e4059835a95950bb25af3cee7edc15fcda8c31365bddcc22ac1bfe1cdd5cb22d5b27f1d0ba9eeabf84db0cf0e8cacaad7cd5eee4d59dddbb1f3f02ad6ddcccbce4c00e8ac7d559cfd72eeaa9b67c89dfdfdadcadff7ef23c0a75eab56f5f5890e80b37d943a87cd4d6f2ab383947c3db180bc9a0b10fea8ffff94a8398af31a2f3a9a058fb22dfbb3ec00b5bdfba5fee78b0d6f1ccca41c0e11d72de9ddf1ff6ae29b47503dee1d73b3badee1b3cac974a636e5a9ea8582fb25a2ac7444bf5b615821fb7ac7fcafc950ccf6a0b5a3543735b80ae527ded5e8996c3c9b8404a59f5a4decdf41aa076ee8a8b6fd26ea2cf01ae1edba3f46d32b3d8e7c2bc1c5b6a8fc1b5c6ba284c867dadecb19ac211fb25abcfdaddb2f9a481f42bcbbdd45f20feadbcfff8dd4c129221c8b9dd2daafce6ab72fbd15c9dc31ba63baddbfc17c94b003de1cb0faf9df5dac707e6f2efa5efda0ecebeea14a9cee696e9a5ecbd4298a24149ccc7aaafd7aedf62f613ea5c6c668eb505cd35d3d54bd1fcdd5a1c75bbecfecc6dbca88d8c844fdc842a12f9a6d29cebad1adb6a5acfdb0edc88deac1e02bf1a623df7aefd1d5b71ae42f72154906bb03b05c2bfd267bebe04c9aba47f58be8df8becdeab65c700ea96abef64ae7bbb1d364fdc0da6ea97db855efecba2cef2c388b4ef217753bec2ec0d88dc7a456fb9cee6beed1dcf7e6bfea51fade18a8af87bfe0b137ebc0e6c69a8b0b5b637d391cd839eccd889ec32ab0ec1e12dd8a8ecd85ded77adaaba9cec994bb6bb8ecf777b29dcaecb7dcbc2bd03b44cefd41c0fdfee32d0ec9d7ea39ee72fce9ff47c2e008eb51e5e134b7bf48a09be9a0bbe94dc5ca0debe599e9e5b3f79b3a10bcf6f0d95bebac6b30ab028e9b849854a79bfacba9a2911cfae2449d8ae015a720bcdb33fcde0aea4b87cc0c5abd62c51eb8e89454049d83efed6cec2f7fee544dacecebefc0acf6c6ed5dba9f4aa1320ade5eef6cc8aaec9a8db90765abe2cbdee02a4c9818fa52b1d23db8ac0d1e6c7de7b6247f6e7adcd12fc6b1df6d63d5dedae8710e42ea8176ffb2d41065e9baf54cb6ec499dbf4a2c76697ac9b0ff65e02f9f34cf4aa806a065e4f7e70a41668be5ebeb2bdf98dca4fbdb66855d5b1d8f6822f794efbdcc9e56fd2eeeaa3e1e9f07b22cf5a4ee1eafa2a7aeccd5b506dfca5eb0d4dff46ecf99db060aa0afcf8fc4d9e00ffb5ec2eff8e06681cfdae57ecd7b1f4be36b23ea5bea3b4d7aedb42c7c483c23d03e835dcfbc16ed9eba9fe7ba88ffacfcaf4d051a7c21b03621e7adad811afc34c7be8cb4beb96ad5a262bcb2c3d7883fc0f0afbfddaefa51edeb0fcc03e04b35d3e2c0df3c57d5d51fbe48e2aafbe9363ecf61ded37835b1e133bd4c6196827ceec7cfadf365b5adec722d4b45df8883abddcd3bbba9b3246d1cd0b5baa8d0f33afd0eab91c8fb9705d67b3081597f8ccbfdcdfe94a10ee9eafee2fbc9dbea077a10bcc6b7bb5a9cc6eee7abda39d7e00bfadf783772c98ef13f0cd2dca2a3ad332cdb4634e988b21aadb52d4b5c7ade2ee0c4d248855a7ab174bbefd396547d4eae4be0406a31fafcd2df2bab2c996ca7c1d0c01d15b6b15e3afe553dc1cd675e21ce8effbeaa8b0aa38461e6bdfe42f47caf4dad6033e0e6eb09d18b32fba1d5a5fdd39fd6ff612950c1a7f178f1119adda695bae8d86bdb0c0ea853e1add3e044bbc8cc5fc1df87f0bdd5a9fd07b34daac5aab1dbcc51e9bbc1ed5fb9e2a542eea0fbd2450ac5bd9d0b904172fb3dfb58cd77ccccdfdba6d2c9e38cf0a2fee5ff53c3ab50b78bafc475e00ce7e5186fddcef4cd6a9b5c2decfcdc3cac26d6c6cc0a5b19560ab4c4baaebeee34eaa3e8e5b8811decf8347abcd025ba81063370598a7589b445ab79f41b20bcacaae5bf6cbffa7d72ffccb2cbbb0c56e4860aefbf19d3e6a2bd567abf399d0df95aacf8e7ffb3ba3d3bdbb2fe2d4bb7dc604d4fddc81ae01d9e4bfcf0dd45ee7008d71b719fff55b379a8df907c53bb43c561bbdbd1e452afa7ba3c1a4d911ac2ff9b259eb243f72b816af0079e88ad20fb2eeabc14bf9ff8e6b1bb25ac9b2dd1ea958cd50aeaf59161caaff06cbdf9a4ccba4e18ee8a9ab7caff67b4e3b7855e9b5a558fd06167c962c58868a919a070ba4fac9cbdbd4af24cccd58208921bacb8743f17ba776c1bdd0bbbcafcf7d0cdbcbd7b009ad7d1ae88fff006fa365c5b1dbeba9fa9a0e9dacee3b164cac609ff0e0aef68e8fc3f16cdf6fcdafdbfaabd8abba1fe75fc7bf34eeadf8c64cd02d1ded5724da2154e9cd542a1ea907c673ad7ae7e37a9b4fb92aa976b84a39d09feec11a266bd5eeb9bb5d9ad07ee309dddabdd4dde0eb8cf12bccbdddc285cd23c22626976cc5967ea301adebb6e6eec3598dc863faeedb1df05be55c69c20bc7dda588fe8ff2bffde6e6c080acb9f83cbeada2cec1052aeb53ed35459c2063c98aef9c8feb04ff6ffcab9fc0d8cbdc2dac67c6f7d66db74abedfa2a61cf9a9fb11c3d228f8c1ed6823e3ffaeabc540f9006a0df8d1fba73397ec5f7c681ad8f16abfa4249da7df2dd0c67ff7bfa389c1eaad6c322be154e40faf13aaee6ed9d2b9804a82af2ee6eb17eccbf7a54b4e53ccdc4e0f7fd28c048ddb74ea91d9cbacbcada3beb82deb95efc095e0e9fcb2f4218f4f106be47bcb5d3ceec38edcb17a3e5fade27ebfc3b54d23a0ccef2aaaab9438f8efce0bbef1dbad649987e4906fddcbd9231af63bddcbffe0160edd8b4a3fa56f6df5b0b1e8eef9164cd5cdd71fa3fcbd5769ecd911aafb782c4b75e0dfc3caa36ce14ad7c3d6cefe2a25a6a8ac6ce7b7eb44fedaeecede51dbf7368baba94aabfbfeadc2775710bb57aab6d35c2d5c4634d04bfbcdf47ca161b2eb922c2deccecca67cbcf55ed6ec8ffee94c6c2a127b46274ed32e6dcb83ec81b9cc184aee1fa6c367f34ad35dc4dbb26f7a597b8bf6b0f18a9d72bf5d1bb8deeacfa88c30dee92ab68a0dcacddf3fbabaec3142b6501d4b6bf2503b79df6e4f8b311e42db5c8dd6bc1dbf7db6ee56c2ababadd2d28de719f1dcb93c4ebc71fca1be4c572cca51c72bcaf1b0d7c05177ec7af67894eed2eb04fdedf0d217e9ebc7ef47ded9cf27dd6a4b67328e82aeea20fc7fddfdb9b56faea9abe10fcea6a8c339030d2b518968fa2878dd4e1b133e9ba8e090760bd72ae17ff0dd0325ad3deecf81fa7f1e952696ba7ecc9e5edab3b971940d80ab5114bf6098b4ee90c04bbfedd2aaaab2dc7beeb3ebd802fdf1caee1a0a0cedf2a5dfa0ff3c2c67c83ffe1867a311dbd62ecb3795dcf5baa1ee2a4e63f9724e72deb9ff1ea472fa1fbbbacbef85afe9bae7e85b5acbcaafdbacee0aa8790d6f390fc0e1567aa16c56dbbf1fad6fcbc90aeb74eb61d7c09ee57a54c209bfd217eced632464b46e4c52b27dcd9aaacf0abaf69185f9bda253cf6d28c20f46cefa3bbc45ed79adbc9effd460fad4304a561ef0ad14fcf0bbd930c3deb1bf9cab7c1d5b9da8077bfbfc11e3ffdee5a88fc7c7dce5cdf1ab5ea22fae25476db59f88971b7a6dd8f14e7cf13aed9aaefb73e2ebba2cfae7bbd4a0d7cb2c1622c159b8dd43a75ed85140bda0afbd79dbc0c37e49243f0f63fec9aa1b1ed0e293b8abace3c4edc67bd9dcc5d2fffe4fcccbbd97d093c44e14dd428e9eea563134d6aed0b698bbcfa01feca297abefa8da4eccd8a6a5ad8ae99ceecdde3054a56caf77cece6d62ffabecaedbfeb0340036b4df96df166d4cbce4672bdafaadfe126cf9bf0aca7c7f1df89bdf1a194decb17e898a44efaec234ec72799850280ffc93aabf0bdbcfa3b0def135ebce2e62d6cd52dff7c23cb35996a8a4ba85bb6811377e7bd3c15162eddcac337f99b4e1c535e1565f92905767da2cbfab5af020443beed376571ad736beeccf3afce3ef5950b1f9a0b8792b948c2498d0e427e62a1c2c8781e93aa29ad13ea4ba24cf0220a5165b597e1edcb9c2ddb3a54471dfbcbde5d5dec198cfbb94f9dde8f5c9be9dddd5ff4bede64360f28558bbe6dcc8ecdfdba0b551b04d3fdd11629dc36cabe39dd8d8ddef0e71b4df2fa2aef383f0a334153411bfa8b7e34b24686faa04a4f5dc8cbeb0fd646ef4bb2f67baca4f150e2a16befddf3ba1fb9ababc022e0baf6353c30c8fe5050b21cc19bf4bac5e03cb3daa2e4f28f3acf932beff34e1adc86dd2f1580120dbeafbec08b1b0ee8b3a60f2cf2ecddea8dcbb5efc8bde1e481ae5885abab2b89c52918fa67c53a0a731cc787c04c1db2aa9dbd25e09ddc38cbd9eff7bef31a4a5c50adf9c8fbeeaef17d6dcd58a6a4eb4daef9ece1264adeba5b81ac0fcfb66ee6eafe5b0e0d23cb8e4bdf2cda2a8ab213effa000dac44e130bea89fe82ffd63dfff95ceafa2c2ece8cf3adcff3eb0b76c93121794a94dbfcbdfae0a7fed33fd1bdddbfdf5a9befa0d611a3db0dcccafb75bdef8234ffb88fda822ac495b4d3cdd2ea3b2ddd0ceda5a9cdf64ebd8e50fb66706dff86eaab0b492f6720d61feaccfbd95c6ac8f9744e1a18c7ddcaa6ea32d0eacdbeb5be490e509de9b29be0ebb6d5e8af0b9be99cbbec91f7494a425f5a44d0a9c660d1d5770ae6b1c1ced9112db0e0d04af2cf47aa49c1dba65de9f3c6428da3ae6fed68dd8e986dc4c1f950e4aa2cac88bdbc9b63dacf9de13dc73a9c006f4d79eecdacc196b74cd8cd05d5c282c90dabb3c1df19efed0c535dc96d0b8cd2dede98718a439efa6a3da062a2b75e49cec2bbc4cbe9d2bcac4237acb619f46b5423cefbcdfd7970b3b04fda46f31ecb4e8fb6dcccaf8fdd7896a1b55abedad7f1a72c3a3d6dc38b8dd95d69fae1a03ecd5e94dda05b1cbe869d777ee1eb9cfe64f5a07deea07f8f7ecd8da18c7bddb57b9f6ac998c8e1cc02c2ec6f6ba7c0a89abb0be3662612b4ac91a363f03795ca2defea0cae4d3436dad0af1bb9edddd422fdf4a8cfe9d57eced5ed7ebdf6b6b500baf93d848fd35ee3d66aaa383aae47d44f5cc5c97cbd0cc9cade59fdcfeba5ed5b6abf0d2aa2bdaeee9ba8bddecba3ac025c25c9e1dd5e60de5ea0bf4ee47edb43291e40d04660e8d66ea3d38bbffc724f1fff1dbc8fd9f476cdb1a4cedeac2c697c35cd8bbcefda60ded2ec9dcaada46f2eb903aad72914c750707bfbfb2bfb7808b6c2afdbd7bcb8ecddcfb376f898a89dd9f85a4e051ecac4acb859a9deb60afeadfbb61d7b0ae11eae23a981109221435cab68edaabd3ea4d83604664ad883bcbe25dfd1956b1e1153cf12deb53de212f69f2b55dad976a696badf9cc4a4a2d76e8daa63eae6e6810bcee294fc2bd4a81cf99cee83eeafed6e87bad0683e17fa8f20d12dc8baafbaf14ad8c1a1393a2bcceff332ccdf0cddecdd01a5c90e5cabbfee3ab50a92bafcebadbf3f012daf0dd3c8b5b9e0ee4d6471a1ea07fd3ddd3a87d7bef38a629f334cda74cb9f2195a5d4fea09e5054bfa9afda2ed2feee014aa47effc3bb68c24ef2af3e4afe57b51e3bdbda709df7dc5a39ccfb74fff40eecd96bd09ee10270bed9e08606cc304ddbfce8f7b16f180614e4f6fde58ffc5d5efdcc283e1fe3dc28b4ca5ccd4c234bddc3f5a5eb6ebb01c7bb8fe03c99717b00f93cee37c9d5c69e31e2bda86f48380f2ec3b9cf095feda3c158e4bc2b3dbba37ded177e016cd05b7d185e0c912bcd7bbcda5160efdb3e3f9ca176bfd7df91dc5a066afedc4d5cb9d3fac0d9b9d30158c239ebec81dbad34ea33bdca3eb1104f9912ff7d8f7a5ff2eaf3f0be4ccad26dbf3ccad9e0cef9cad4db9abb2afa4606eea3e6bca41ca5a0da6b4f9e52ba78d6f558caada5f3fe84bed8a2ef8668c65dde3229a2afbdaec71fd00ccb5a9bf6f7f7cd2e228ded13ac98713c0c0fb75fcdb3eebfbe5039bf8a844cdfab3b223afdbef96045593abaccffbeaffbe4e7a324f8bdaf6b4f1ed443b77246bfdef5fa7ce3e79ea6af844cf7232fd01f0bbbfc2583400c0e0bdab18fa0f10ef2bdb0d67a426387cd8afdfccbb83dbe40466098959aa334cb12be8baa2e9bedd48552aa8fbc9aaaf5ee106adf54f82a18aaaced0a88daeabfe4e9b3c76a39ab570ce77cebcf3dbf4d55065ebfeeaf7635c04bb1b1b1fbdf00a042835db1703ebbf4a984dcf3accaee812ac18b94ae2d05dd4df219cca71fd2bcd2eb470812d613fd4245bf4a28a4d6d1a6bc2a74d9bc8b88de49b90fbe8dc9d1ace77b1dc6aac69e595dacd83d3fc66df7db8926baad08b0490dfd897f3f0f0fd04a615e32dbfbc2fb2bcb2bd388c989bafb3cbaadd6bbdeca1d17ebe6b38dccdaca9b4a4bb8aa79efae78554b2597acaaeccefdccafbeda87fea159b25bb8fc2b2efdf395923df142ca1d3b29fab4d9d28bc692bb1f8d2f9be133cafb5f3dfc36da8accfcfd443d5b2fed6e0e16fcbdbd3a221000e10ce2286eafa9cedea9dffa625cfdb21bf6eaee51d9bb4ee3c4f56ef1ecac7aaada45eb27ac6fbdbd4cb1806f1067eaa4cbaa0fdcac7fffcc19ba1d9d8186ae7e2c3efee24fd2f6d57cf1e491add5f47cbe4bff68113d672bb4a7f355d2de0e6ce7c0fc97e4bd13eacefd5ca7d8cfeef5eef3c43dafcc3eb37dde9cbae1323de4ee1be6dbdab7cddd6c1e2e5eb8ecc8eacced9d7bed9c6ebb4cbe9cd112f4cc61cace8e3859afefe6e140bd5e5f8ecaeddd6f53ac4b0acdacc5bfbbb251bac28ceefd9322e3cea0ec2a1f9dbbbaed7dafb70c61ed7da69dd0437ebf0e40de5855e80cce32f4d718f67fc7353b62a550fa7af48b8db65460d18ed01a7e3f5acbada8db9e6f9e5eaaaec88c555efbbba0ffaed0ebdcdde7df87efecc9d61e3c225c14afcde95c6f1ea374f83e2aa9beb89aa3c980c8052bb3e81d0d3ad5f2cc8af8f1eba69ac62f83ae088b3bebb19945dfefbb5e52a4260ca8d4f2ded26bf78fd5f0ad8a369affe6499c6510ac9f3bc8bfb1192a8fc7cb3eebefd87a468b47fd8d5acebd6f0febfbdeea40dc1ff3dfa9faded33f8da6ffdcd9d395c9178edfe126cd329ccb6aa956cfebc877ae5733ead0d1eafb612da3dd4869da5fa8b23eba063fdde0bdd764ed0cd4d69e3beb24c7fdfe26e0e2ebfb54706abeced452f95875bbaf814e661b588e7188dfafba3eac4d50e68fcf41fdbd5468f9802f46cedcd9d3ded3ebe072ed2ff9bfad51cb04dacf06ce7ffa2d43b4182a6b0afebac91cc65fbd4a35c4ab2dc38e5bf0ab5b3b4de54aa3eb08a5fd2f64d78b57665b0fa2ace7cce7ee7da4bbdf329eeb7d8e4b0c9583adaf340fa1ecebbf8c6045ee6b9de3b26e85a1c8583c13cf9dde06eefd067350eec8e86b91bb4aa1f3a75ca9c8faca5cb0cf85b9a2cb6aa66e22d0386a3fdeffdfa6a5aedea8d5d1fad1b6fdbdeeceadbdef781d2ded915acf1a5a35baee0feb9dce54b4f6a492639654fbb6f2eadc45d42bb2dccdc83bf8584647da5f4daeff54a95bcfbd6e1324af6cd0df1cebcdb7f0caea8813cb164a2ce3ddcff8ee6cfc6acbb5c669bdbbd0fe08c959f9ecf5f89dfefcafdadfdd0addaecb9c63dfa37dcb28840299caed58fdcbbcb2d77df23f598aeb1d7512bfbdbe5941fc1ebd6bccf459be236129ab7db60e5adf04bdaaadbbd0cc8fe43ed6fb5e895ca8aebd8afdf3bc5aaef4dedc71c5264a7dc9c7b8fe206d0de68fdfeb5c48cdec1bade8abca552eece752a0ae6fb0a9d7ad152cccfdbcc3868f4181e9c4ecbbad5cb48f728d3cd5e4ee2bba75f7f8e111279a41acc5bdc7ea9e376518ddfaef5102920628ae2ea66f5e4da6f7850d241e95da3bf3fd5bb3bbe905b3bb8fcf2bdbd508ba6e3a3d28369dd4ec26d947be15b0f6a6a82e9d3b6cd35e6ea9bdeb2160d23d9f0e5ca91def929ecfc6c3c18829bfc2d539ddde8dc36effed5cad110467bef2e6c063bc30c3ff5e560ae084fc1dcd2d2b6cf5c420b83d5e8510afdbfb5b2c3e6cd13bd8a690fe5bcea2250409c4da99ef3ee7bb48c9fdf029dabae97a13d2073ae9bab7ecd6b24644cd5f07c6af5de57ec2336d7dcfdb0dedf90393cd307a8596edb6b3dce434e5e7cea5f32df923c39aaaf7a1f0aad2fe8a5e69be02d0a2384ccc9bf6b44e10765cfd11d2cb07c40f0d4d4efe439c3b02e55af2ceaecf71cef2674e2bfb2badd5ddc9ecaf8c2dde042ab7d624ba9d3a56b3b0ef916d3f0b6d2afd83c6b9c7a5295bb3e8989ac1aaf7a279aa7f78ce9f07b5f6dc6fd4731af4d45fac39efd2e2cfcffdc4d7b7affafbf6dfd9cd2baf8e7e6efbf5bc137f5fcc2540e789e4f77a6eaec93cac28830d9b4a7266eafbfaf95ad4eb2e8ad6f918225dccc0dbfaee801c2ced9daf9dc715868ecb80a1843fbe5880e16a6e6f9b555630a1add7f1231fcde3d3ef10cdeebeb39dcdce70ddfecc908aee6ab47c0c401e85e05dde4e38b39f3b26cf48cfbeeaeeefe313e0ef0bb64b0d4adcf7bbbf1a00bcd8ac47ff10b0decfdd14d4c6dedfd0cbd9d1131deafc68e3fb1749c74c8a68bad34538c2fd6a13d75dabc89f060c85bbcc60364cf8dfcba9bcb55bcd062f34e3d851198e760ca0ea2880a3b8004f77e8dcfade8d8e7a868d74dfb97fbafde5cae0b7baebda98f003c9dbf0da5bd5709b5a5edacbf0d1f2ac71a6dd5ce0e20de1fd53aaa84c2ec2f8ae08927f958edfc77cab8ae47a210c3fb1bd4cb33aed6b6cacf2b4f5cd0f24750ddcbd2771b0c199bb0fee9abb13cdf1a4f97352b355205f1a77ab06533af5cbd508dff5eea094bbafff7dc9bcb29fcb9aced92c0eb9f88d66ff1520cedeb98edc1cc0eeea7a9fbe1dbed7bcd861fcbc9fa5b1f39fa211c8d3ba54ee7dfa0aac9ea2e46b23aacbaf8339af4c2e7c06ae7facab3e79a7df5ea1b752ce1db74fed02b8fd06ccc1ad05ef1aad26b6aa1352eeb767d43d263d82e0e4ed2c4a9d2baa6288b91dd024fa39b8cc912ab07b61961b5d702fec16cbea0058d68fde1b0e6d3ae6a3898ff1eb705cfa1b1dc4bdd31b1c1cddbac2eff8def7faff7fa18cb8b5cab2ddc6eaa89fc118efdc5b4b2ce2eccdf9f5a626c5bef9fbca8d8507d836b86b58f22cf1bd70cfaefb3fec6cb7f63afb29bf541c1d3830beb300127cfc76bc4af4fa8fca2cb72da1db0f0750afd4def0fd716c6753439ea4d1d0cb48a9fc025c2b48dab7e3e6fcfc49aae8a7fc3d3e913cffa598a803bca6bcea25635b5cb79e107b543c55dcc78cfef2ad6926e1caabacca849ef052eaaa31aa3bb9e5babfdf9b50b44cddfea0de7d2e68bb8d5ba76bd7699be75d44bfbbbcfd39fa3a2cb8f15aae24bcf5b0a58fb06a5a2fe28fb8f5eaadc8eedddf9eeabd8d04db9febeb8cff9a34c1f8aa3b53d37d27ddac025f4302fc34e468997d6f0de7b74312153f0c20c3fc31d09b744e7fe4ac79dd5293b24480ef1f5a11ee1bcedf3ca6b7bea4ee69a17a2a2a984e5ee67235e2b681d68bc1429e8bc88d02e329ebaae6ffc049e29ded65e4c09b42a15407aded8386a8d9d3b06c5b7ffe07750b13b1eb8b5a2022afa255e79fe328d8bb1dd861dbdd776bfa53f782cedbf6db93d06d056ced3cbb6e8feadaabd7d3bb4fc3acb0a0b9abdce1975b40414e37a052cadeebfb9af7c3ba4b1c4e04b09b112dedb13e2cf5c64f65bd4dfedd0e9ced63c1aeb3712af38579b627c31b69a7ed44e84bface3c5bccea84f8c6e99d375ce82deebca014369e29c9ef0a1ff9ecdea351c1dcd51ca31651fe61ede6c0e9a4ac3b805ded4cecd59d72afd9d9817f9b6c9fcfecb53b66daf398f2fc2c4add912634d9df2bbdaa555d92bc81cc2fa1a9a3bfeebddac1a94fb7bde5ad36f7822d5fdfe5a13572b0f545dc67b925b5ecd4f54b45fad26beed5dce3ac0d352a3a3bcefaaf018c8abcfadcff4f9db496daaf98f5b3e0a106b5efbf7cc98babaf09ceaf8e8fca57acdf81fa5f6aba2b8b6c0f0058c9db32baa6ebef84ed7efbe988ec930bc0dc73d63f9ba9efcb737ffb14fcfb91f11a1ec8bf5adc7daba9fe223a7ad2fbfbca60e4ed962a4c2feffcae98445c56afec573bf1fdfc4c7bd24ddea5abb26de74e22b251a1591dded73deeaabc6bc6c5aaec28eeb13f444acb0e66fb7a0b1bff77a1d0dddcc6a409ebeb36d85eae6fd6af1b6272fc97bfffe50eef60e1f3b7f7c8bf67a09b25def45f631ce8c256bce7bf6ac00fd94bee85aac5aecc9471f3ed11e307fddcc7490f28e68546ae6cde624aa35af0c5a6f5620efaddce62bf6d9ddc1bedbd5dec9d0debe0f2acef6c33dda26f8fe97aa6269e20cc346ce870eb11dbd0dce2da0ed7bb72af865e5faf1a2cad5dab88bcadd813d02e0ed3fc042b8c69fdceb29bfe5de3e3f91eb7f0ead270e952bcc29afdadbc5c3fcdea06ceeaeba8c0abcf1ea10bbc7b4c9fa7e722b6cbc4bd9be1366f63c249ccade33dca1be5ff5cb64b2feadcad030a3cfcf2ff60c6df106a029de8e3a1def7fcecfd65ba3a81cda70780561a08c98d1fa6aafd7babfbbad6f87ca82beea7dc96bf240c77bbc7dfdeaa6728986b40bf78118ee4b9d0a32d3296daff380a9d6f9ef1c2c939e515b8cf0fef7c3faf690ca8e955c2f4407971afefd9bdbd740fdceadfa0dfab8afddcafc21deabe1ca7f1acfc6f9aafebe4e7dbca427fdcc2ac5ddf23f0c9b4c53f31edfcbd0e39f284202b4cbc46744157ab85b9d1f954baacd5e3fddc69363a6ea6ca7fe9cafdcfcdbe9f7adbec288cc9fabfd7b4d4dcac8838eecb9820ee40e6c8c3a84d795661ab1d0bbba256fa984c058e0025eaf5db92c2cbcddda9f4c2f8a71c51336b1c8e6b0a50eabdad1bce8082bfadeed1e60a6f673a1d1de1badebdb9732efbc3cbd6fbf7cc2f1d7ec44e64fedb8cecee1c5ec88e1b6fdc28216d400ccc2cda15f920aaebafd1941bd8832b91104e962e1a477fc4be0b0cf0a2c5ab2ab7013c2bfe96ca8c6f75dce0b9efaca88efac9a5e3933ff25bae70bc7b8bbc7d17da2b81275cd20df80bb79abfbf466ff87a3ba6b7ef4e5efb7c66c56e2c5b7802fd8eecbd9b2d2cce751a3e1d5ad5bb9e10a646d203a5e94cd86ae7e2d60b58bcc3e0d9e9dc5d4c89eb6aed965eee8893f3c6d9fe844ebfbafc4bff2c1aacb18b254f8490f50de5acd841c5d4dcb9cb73f2faa227a9efd67dbd15a92e21fd0ab3214e62a2e2c9d87da19cbea4bbaef5d0cecfa7844ef657db8b6fa2fcaddfedfbc52e89626a707fe78d4aec6c0fcd1f36b5e875ba10da1545d9c7d55d7e8cf95fdcf0507d30bd5d2af16663866e4ddff2e5a8efeb8a300a8c7acdebacf988bc214bd42a0d3aa86f70900a0ebec328c223eb7ff2d5c22db9daa1e7fa9dd71d875b52f94fb6afafeeeea2dc9cfe671c80de3d9dcfba1a31e4de1fdf208fad81634c112080f7ed1b1dae2d8e1edfdb77f64ccec545ed8bcd59fd6dbc5cea3f582262a4480dd08509e533c1aec85cd549ccf0e52f645cde8ecdf90dc1ce2b3aafb3dcdd94abeceedba043d215fb7c934dddf4f5fdedf26fabed1cfb9dd04a7c79cab23c7383d8bb4bede1c932e7fccbbaceac7c96d3153bdfc09b1beb9c3ffeedd168f8c152aee98bd3a6289fea78c1c4efe8efeb448aba125ddf8ad8fdbbdaa69cccf198ab02beb950cdda58cfe66a77294badc9c9c8bbb32993ddeec24840a66efcffc47e396b51b1e7edaafbf77101ddeb4b53c7fbd4f4ef3648f37beb5d1ec29ec6a83d477fbdfcb401cf91eabebbdf9c0c71e8ebecbdab240910fabe437bd781d9f5ed4d9e96d989418bbc1ecc9db2be8b3e46afff9c9f7e9ae10a43bdb8eb0ccc8d66fff1bf514597ffacf30fef13e5f9cc84dcedd99cd55e8d4db7e2c7ad0c78bd786314fa3785af8157e1aafe2210cc3d151a1efafeaea5bd5ca6aceeba7a1dba1e8b89b17ecee208cd90be9da9cf8daf5a76a236facb8f53d2472c24785789ab04eaea6f5fc4873ec02f8aa985c52df4f2ededdf09a4f76c290f0c1fefb20e11681b05aa3850e725bcadd51def2b8e71ddb81e88f6f38ece8d5cd7fc6d3f3738f349db92f15e312f9acd248a768fb4096ccffa8bbeb15ad5954bd9d6db6dbff2d86ccaf3cfe437f98815e76544a55e49e6ac539153beefc8ead4dd1a46d1cd4acf9ec75c68d831aad9e2f0a0bee0dfca631efabced47459fd0bbadefe1ff1c8ba1b0cc0bcdbfe219aee9fb2ff19a53a8dbbd79ffe181c7ab3d50d7beea81bd95b9188df5ecab141d56da594b66cff6818a4d0c58ae0ec69ba7cb35a7698fdef6fbc1cbc61a5ce7ef27bdfed901b3861a63dc26e8a6e9d9bfb95554ba3be4f46dc5efcc979b8ab332dbc29b78f50abf07ecfcb95120357d096922772dde74a6942c3ae80ec8451fc90d5cf6be27c53df9ac0bafa2f0aaec1dfe7aa3b21d5ff34f8509496a2a5c2fd39754dcef8afbbff5ce2bcdca7ef1c1c7bcab9ce0dbecbfccf1e7baedaac24eacc9100e7361c8c035fdf2aebc039ab4a5df5d93dc6ba83ed9d8703b6f79c34f66acae23bb2d6fd80a0dad3f4155716a5cc04af2a34fdcee92d2a70cb468b72d8b4a0fceaa8bb17a9bcafacc04c647a1877bb46113646e500cdfb6ea7e1d0b2cf89bacca0927ac7dedcd2d71fad80cb6b42fdb0b3a7e8dc68d9edebfc6adc13b4a4dfd7b4bfa3c751d003151b27ed63a09680e5adf762dffba1d1eed7ce8b50de884e4b2fab7afceba190fe020ac8dc7fccac5c96fbb79fb4ae30bb9f5d0f9dc1a7a65d82052f039fd38bd2fea7d4477478e9fa015f41c25e0f3696a1e3de69dac2b3ddc6645c1ecb8ecbe5ece0c5aada72fdc5be1ebecef38bfaba6a1710a8e776bbe3d3b2adb3dc9e4d6db5c95e5fb12fd3562c2980b44bfaa0de47cc2bcb45fdccb7b9be58aa530dc0ecfb08fdcf16201bea15fd56d8027a4cbcbeeefeb2f4f2ce32c976f9891d6d0cb00ffd65acdd6c494554db4dface8cf5d001bdd7308a67dd34e38b6298cec14b1841da47bdaeab6cbae042fcbaeb769843fab9d1848b331f47e1afd5cf07c5bb93f36be72fab893f5dda18dbfaaca9affc63e5cbbf4a92ce352f3b3ab0a4ce6d90d1c59aeffdc606f49a32f76caeb4f5e923cebbc2f444ae27d5ce318c7026cc2631f33fa581ffc0ba2a2eac90abcc9bbc7f0e4ad05a9bec86c8b1bbbac335afb8cc0c38ddb327dcdb2af778b6c29bb8fa5224dab2f5f298da139a1ac3d1177852fb58313cbcc9edcbdedfeda2b3efbc3a0a49fa67dbadb25cc2b997873b3bed40749a0c7ef9c7b64f41abf6c1dc8483ba4baf6ab80cddbeb1baeab526050dfef8afb7cac7ad017a4cbe3e50b9b03b6e4e6bb4ebb3a1ad256951a86d7fc5bafd8d4f8d4fbc389de4b47bbfde33a2fa5d1e6bd6d3a85b5c423b3005ff7eef3fc1eecdca50f703b8a4ebaa3621eda6fbaca7c8d7cb0e4c3fc70c4d0cc963189cbaffac7438a1dde650e7baafad87be1d1f1f514d1bf72ba16ade89de134aa7fde6bd774daaf65bfb90bf0529e3af0a9bda6eddfe6cceae18e775ba11eceaeeeb9cbb23aff4bcea71f79f2d63efb707fbcd9f6ad38baaaf9ada2b0ccb8d5139d44a465a2c408b43346beff70eab6df006b2efcc3cde4748d26ed4aabfbf022377fababcfd2eb17a7181acbfca0dfe2ed1df080e2beb30d981f7a8914d9804a6e3cfbcb2ee8caaf2ffe9dd795fb253a6bcb5a0d6bc257e4bc8c5e0fbf12ad0e1bcbba4742b2fd6db46bbcfda3ef173a70ae02beb621eb2efe473c79a7af8d8fcc61b8fdfdd4cc88c7b35716edfcabeea6cad93651c66a0abc5d25aa0e1f1feee678845bfa2acdc5dc0eedbfeed07be2ef4b1af4fbdc9ed98c00cceeed8b951a9ddfded61ec3d75a5dc05bd6c4c0cb2e3c0618ddaba7ff185f8ac270ab59be19ab02a84286664094ceff6810e1e505a0aa5cc273ea2cd8ebcffb6bcee63e0b4b8fe9d440c2ff98b7bca7cdd17946a8fb6d4ee9f5f9ee8fca65188cfe2afb0cfdcfd4ee552f2fabd4d1cba7097adaaab0a63d8cf4cd21db6206d55fabddcefc0fd454dd0feaf6889854eec2c0bdd03aa8bf8ba3cd6da4ab59dc1bdf1bec9576ce9e4509cf04ceb2bcc9a70e2aacbbe1eb6aaa384d63b04afac6b55a7df12ff17d7e0ec46e41fcc93d5fb970d031a0fce7ffef1af6f32db4af15e0ddbf3e4ee27b71edffc924ad99d5d35f60abe7b697f46ebedfc38d06f418871cefba3cb477bf2e9abbd4d35a887ea7dc9d22ba42cae1a96f5e0e3da20deeefbd4fde40c657e89fc0a1391a3c59e356bcceba90d1f0afab1af5af91f0cc24fe6dfeece2d1dd7eff25b51681dc2cbe49cc04d39cf1f0d3620a59a2621a80986ba4f76dfcfa1205a3f09045c0c450afd1cbcd2cc13afda5b05df30f43afad6cfe9c9986be1b91c6ee9ad79e13b7471fb0ad03333a8c36a60d296b1be5653ba6e6aea8d27fabccb3c1d5dc0bf6a05f4657a070a23f0f28aababc74ec5e509cd0c4df19e1be302ef3e9ee26429bb7a5f625469f1f109bafa8b3cbaef33f2d992ffbd15c4abe7b92943ad187c40ceebdbcd9a6cacaa7af752a4aaf108cc7cdc214694d2fc87f6fd70b9ced3d31f0810bc2a0cafdaa6e0e1b2c0ec667e6bc026ffad0d5efece3dab4636bfd4fdac60c6fea8d96fb4be1ef8fe3f72f4a57e8cf985ee7eed2f5c4cdff3a47ff6dbbff014a4a9aa9c7ff7dca5b59f1ffd6bf58eca77c2bb478857e8eab9267dfdef63aa5bfcf84ea74fbefa421eef8af7a8c0c2ded21461a7ec441ef6bbf4d8dd64901d0f12f1c85e857149079b83fca8d11302ac6f712eead7f6c71b13358af1df2d271e688f2aaf3c8fba5b4b87b01cb49e6dcfc7cfceb9fddd6298afdd4afccc0fccdabbcbef20027269d6cd7448dd5bfedd743c021fce76b50826ff21469b24bdea3bd8d4692decc4f82ecbd5cef45e1eadca6bd9df88ebdd1fef2c82ee3ee1e23a1c49b6a26b898de0b81ec109d6a26edb24e3e5a5d20a79cd32cc9badd8bcfb83cba0ba29f6b31cc3ee423d541eaeb4e4f3caefeacf949ee018294e0bcbdf16eee6ebaf554db9c47b2edbdb8adea3eaca247a340c6a0cf7f31ae4323ccc1daf1a91c9cf1481e6fa12affcaca80555717e1b1f1a8c32aae8cdec7fbeb2d5fdaf7eead5ad92a7567f32e13c85edbee3b5b1acf75bbb8fb30ccfbac028bb9d2ca9aa6d6b6c346b4bd1cc8b56bbc234916ef453fb099aa9fd2e5adaeedef8f2201a86de1ef26e56aa2d48c91d4ee5deb10671f00f8be8a4d1bbd71ad8df2f0b675fac6ae4fc0ecea8fa7b823d3bb6e04e8fffa8dedce13befd7192ee7a948e271db52fb71c4aab81e96a72b04ca4cdb805a119cc76f1fdc5ae72b41456ba9f10adac7dbf78e76ee33556b7cc2d32303f265d33da51c2f4caccdea414fabecee3f41fab490e2968f44e7efeacb42bbebaf053a94819fe6bbca190d8b4fc3d1eabfc62a2aac14feedfafc1cbdaade76355b529412fcc2e4c98fb687aab44ce00ceeffc312fac0df06c0af9c8febfcb5fec6aa1767f1ed5f000f6a6fb2deb377e2fbb0e33fbbe7c68ab92a79ed0fda2ccfdfce2ebfd644cfec44db1641083b3e5eae961a049dd2ab4bf0f33c6c26268b5632a3eadd70c3bc6018e68ac9b1bcbab8572ffeb78a1185de5f0cbaf3bb1dadd217c0cfb0693ca3bcd4eedfa7ed87feef1e4e3f62a5ae0f9c3d5fb6e55c1a18ddef5b6a0f2ddfafcb1b8961871d0bc9617ba2eb7d07d8efedc10e947fbbc44ab7dcbcd9f0a8db39ece959bdfda505bbeb3ceba788d04964e4746f16aad227ff6b0d1ea99cda3fcf3bfbf666832f8a49518d4e60ebd8dbafc1eedd6e09d7e1cc4f7c9ea1e7bddcbabba3a96eb348f3addeb31e5df2f4bc52ab9fd7eaebeedfd1f33d990967cf01841eff1d6cdccaee4852f428c2adf5a172dfc2ce4f3ff23edeadcd501093c8b33fcf07cbcbeb1ffcacf3a380f5ff66559b6be8adddacefa6651dfc8e6fcc3f273c6a8b6dfa5ef8efab66cbe67efe0441753f0d713b82eefd182b0cd144169c342bccb0c3bb122b73bff89bfeff27fef797ea14ffef5815a6eed6b9b605da3ee74c39fea7edff0cb78bc7da225e8af73bddcf7f6cc7aa6b91c2cb117755fee024fed9b2abab96e1aabdca772fd5fa56dc5be0dd26fb5f5d305c63ab1bc1c9239fbded94cae0a7777b0aaeea5034bc405c01b69e3b597ef7ad1bca7facbc1e3b590ab8dc6bfb5c205ff72ba10edadc17d8cb2a55fad702bad30fbdddbdc5cee42be8af9cf6df43abd08ba89758da5b0157ceeca08ee2ac885f9fb09c77df14cbd8e5f10a2058bc5bc211a421f64754a8fcbf0ff68d372644e2b841aa4af6d79c4fd0bdc47c0d42f21b2b81fee93a22714fecdddb38d4aac9cad621ca9ea6fcaa67eed2dfec95d38d229ad7c37960f0d8dab16f768d03ee604f8dfb31d4ca42ae05acbfdb3efe3caafc3df74a18afb5f03c4ecc2fc34aaadbbc8d187eb0e4eeb2c744affb2f75f03c8da6525c9fbc4f0b477e295990d8570dbee425acdb4a6dba73aaf59be82bccb3d5ff2eab0ca5e9a810dc8f6bb58a8d3f25a27af1bce95a4eea2fde0430a88d55328bbc70c9a8cfce7dadb0e7c0e9e5561d1059cabbdb1aae5c2d7f2ede3e1cba0dfcbb6818dcaffbd36f7dce0386e0e6b0dfc8fb5b59f7e06e39eca3ee953dfa4a0c506ee6bc2faad1a9e1f1b320cc0201104a6f39cf3a27c6e455de4df1d2f3f3c3191ab7ccc1eacbad070b2d9da4d0d81f3ce5dbb0f94fc9cec0cd0d0b3f2c828e6342c7e715dfac0fb890c17a3bf31b5adaf5cc6e3fe45fa1015a39f53dfd9dfadb8af6500e95a1eeb9e5d23dccfc3026da71ae588b3cbd472d1b122e6ea05ad5e730cb482fdc37a368a2ef74baa8faafebfc7acabd0cd70ba1c7aecc2ffcf0690bbdf5ddf533d7da0a3601fbd39aab1aa86ad2bd70eb46ea43486fd7abf196131c7f813f718a3b0b9eac9eb84ecd5cdb7f4ec337849b04abb9cc08464bf7ba8dd3bb01d7eede5b6764b1cf5b93cb83ef6f6040695c27f3ecbcfd6fddc72c4c8c0f9388172db3d40abb8df374dc3d5cae8562a06abafcfe0dec03b72f60fffc6acbd1e787fc71aa6deadea8b2bfff6a5f06b44b001a911eccd56cb8e95a1aeef4cebc6c42a9ef442c1bde98e75ae031e5963bbbcf6996b45721acf7d36c4d8b73ab5e6b3805325d13aa83daf12dc2d1d6cbdfc9f4c91bc8bfa5b0aae69effc41d3aacfabb25b772c40a9af058bfbfbbd5f9b19ee5f79a4db9f2bebfc6099e4aaa08bd82dfcc2de36cf0ded3cca8cafceefcebfa893adeaab8c5d6760cafaa9b7f4f7ae8960d2a62de48ed8aacaca00eee9b0e9daf01e83943f8c3bc755f18a875cbab6d481877a05da33ac7d9bad8daffc7551ad09a0c5ccbffe8bc506c1b3c1715a04758be51fd4fb4b9cf9a61cb246ca6affab96ced5f57c97aeacc4d2bf4ab9d1dde4146dfc2cf4c4259b4e74d1dfee1cd1d2bc2b70e4fda2b7e14b1ad000fabc93b6ad73b63de85fce8fb5b0e1bdb161ba91defebe2dbfc7bb56192b7bfa29e1efe85a84b87a1c1f7fd1e7a094488fc344e959ecdb2e98f510e958c1d39faafe348a5fdce0a81cc481f02e33de030efd37c53c6c27c6edd8e022169e556f8e8dbb61a15e05eafa06d7be683af4f8cf9cb4bb6f2c52eda28f9cf8ce55f92996eae1013326ddc1ddf7d47f20efb7a98f2d008c8c882dd5a69b46e8db4a9e3a8f233babfabaab9591f6b38f5b320a6f97a4ed3dcb3fea4e46c2facc8f4c8f23ef93c40b0b97a0bc4f305bc71e8faad8affb8d8f491dfefbcb42b37b1dcfcf4a51cfde72e7ad4d3b0a42df75d2f9bd85dd7e332c0e0e59cf29cd8df570eba6ad054dfaec3869ef63eaa4ab2f779cb5c2cf9fab789f9f5e6927c571acbc2bbd4ef8ac48ef2c45f0ddc6a3f8dc3bf64de5dce3dad35ffc3bff77dd76ff80aacc921bbed21aecb6b20fdfeba37cf2edc8b249bf0e38c05eef58e6075c77a7ccd4efa4cbdf5cbc7fbdc7eb705cc75fdb1ff0b304fa3da997b4f696a43f6b7f58ee0dadc7e6deeee8da075249ac4b4cb86f4eaea67d6b7be50be1e2bcdad74efbfb6dcfaefe6aa0b40b27ca6a99cec98e34439a5309bebfceedad616f2f6ceaf28bcb6bdcc48e996b5f5448dcca5ca9ee8c21afcfa390f9bf2253fce5835f595ba0bf1f5fe2e7b41252e6fb9d210f48ffb46e5680a7afb55afed9c11bfdad1d2e6eca509efbf9aec18fdea7ecccbfb9daad9e77fe3fdfb4b0e3a69a234d0aefcbaaf3fcbb45a37845661aa3a17e2e1f5d7f4715fda7b56d14cfce6ac33f7e3f4f6ba7deaadbaffdce9c1a10eefcc7fed0a50df109b4a1fe6e4d297f65c74cc4a32323cbecf86416435caa6e8ba7efdae91ccbc579a53ba8d4dcc5e95df1a463ae4af9ceb428c80f0d753caa39a02fc6c07baed19c47af079ad8b6f4abb3dcdd07fd5de291a17d032eb09dabea6ae97babf7680dc22aeb6ffabc7ea744d6cbe65e0cb14edae1dbbb628cf6e4ff5b43302edb273c8df730f4091c343f7f4df98fb4f6d5afed6ca4f025709e6cb875d4685c7ce7ffcc3b9fb44d4f25ff6bbd3ed4b0b5fa6ad6b98d4ec1eb063c8becbd1b7f4a8afdfcf4caec88b0c8306fbfeadd0e62dd625eed22d85ff5cb1660ddb77d12bf4db53abdb7dfd6b4fb6abe66f0497d019dffb64f7df13cd277a2f5fbe88c5e65d57a1c5f8ecdf271aeedf1d48b657dbce412ea7f0be7b4c87b296ac66b084a47ea2d3d23cdb410cd94ecaa3af15cfd868d3f64eaceb04c72150741688bba935616a88efe625801df06f2f9c0c582feebc49f94d27eb6ce8121ebd9f52865f2fc21ef6e0a25b01d0d1efdcd306ecef2edced4cb3cdacc044bcfdee81cd7d7d617c99e6bc77b7d50b1da1f42dace1df516eefa77dbac8ba5c6d28fc537e37cfe1d20a9ac8dba11e60a5ffb4dabfda3ae6a36b5aaa15ac8f2fc02bf9b534b7caace0e938fef1dbd75dffbffc143b1abce29fe0dfa9fdea7eed22ef6fec7e09ab2c59d7cf2d911363a9a3bde9bd174dcb9f69a1b1ef19ef0aea516f8acfc5ac1083f048fe9761331cfc6eebbadab3a359c05bddc85e03a777cda2e5a5473c61a91241b1dbd8dc0bcd4c24a6a430db2bfb33c3a1b4e3cce8eeb76ead99d733caf6a55ebf42ab89698fc51a5e46aa4f24c3ccfcf78d4c58d9adbf9a81ffd8ffeec3f6a5ce1eb2118fcfae9f8f2adadf38a77a1bdd0bd34c97ffcc4ca81a17ae51d45bfe15f0facdeb0f95b8841fb90adafe1eef1fbcdada91aed2d98dea825df783172acdbf8cd3cd6cf924c933a4c95c028cf31be9fd6d23cfcd352e1c699ef1cc574cd9f419441f2c07652da974abbe9f638ad2c0bb8042a49f4ba66add2cbfbccbe2f79577cacdf49baedb3b7feac0ddcf4aeb33a1e98a0f09491fa6bcff5ddd5da99ddf10c485b513aad48a66a072b7ddee7c58cf973fada8a4a66eff816b0b6ee06b9c46bb04bea9b2ccafeaf01edeacdddd81fedb104a65bca7bbbf1eadda6b9da84fceac5ab0de34ac28aaefdeea7da626b3bc2a58ad8f2edfc20a1f0deea31bbae13ea2f79593d8eceb8c1af0f122274fcb6d56beff9f68b07fdd15cfa81208ddad89bcb033af8eba826f66d51b1fef2fcb0abcabe4c717abee6fe71e9bab0a80fc4dd337dc8eddb7ee3d05aac0e3e8fb0cdf3a6d951a8dbc5b4f9ba4f712af0d35ae25866caab76ddde931c0aa037dfcfa202defdbbcdd94af3bfdff6eac1c37e7cdeeaddadbd18b59ed8de85e2ee8bf2fdc63bef0cab71a66f5cd26b81dcd6cdb001ebb4fa204da0ddaeccc5aeb0cc7b18c9322a6ff3a400b1bb0efd1a07e782a7d7dbf747d1fb40a792b56f63cc78728e08baf5d24ca06ddcefeea2c88d11eb26c8e7dca5d5b7cdfb30dbeb50d6d7b8c75cd94dbeee8a588c4465b6cf62d2fc7fee82f896566afd04edf21d2b8bcdf40eedfba2e3b0b15bbc980b4d4bc16b0ecc5cac5cf8eedeb3c34ffdceef064ff534da6ff1aac7b6fd8992ab2fa1d9bc5cfb71da6cee3a2c49adefdd7f67ede1cbbeea7fb3aba19cbbf6e8eda74c115d7b09bb5d5cde2fe8a6d537adedfebadc7bef3cf6f16f76bf6faf00f3217a47669eb2949ff107ccd2f16bcf9c963090d711bf1bdffc55f0b9250c0a7f121cde228dca1a0c0ace0bfee7ace128b0aaf096e25fc6bb4b1a01abef9bdedd47d02245f6af722c3ab8c97e47dbeba79a9e3abd448f8e5f12a220c134ebcabeace61dcfebeaea4ed4a2f95ead3aaacc74f56fbd9557bf23a31b0c9d0adcfac82e78f402e115d6cd2b9a6e79d4463eb2c8ca04be44c1006eb57e4ad7f0c1dc79e6aae16464c1ed776204176d8efcbc0be1b3c4741cceebdf60e5411e42a3025543ee7784ceeba9b79bb709c5cf00fafc9e4fdeb5c6ab8c1a81fb5d734bc1e0b2a0936dc8c7fc03bd11df6feb92fb0b488394e84988d05df90cdb31c3d39ee7bc5f0a4ccaa82012f1a8fbf2a5cd1baabadc9c6fd9d779a4b285ccf889aa1ef9f1f4d6b1c69717e77df50e4dcaadcdccea2afa82dadf705e26e7d4e20a8b16ac68c51752f2c4c5f8baafacfce0ce8bc6fb9eba1bae433dc8bf27bdae2c9b69c2b61e514abc2961c02c38e8c35754faeac49135a8bdc6591cd2ed7fe640fa342b2aac12fc3b1fd32593ebd8be22fe1addbca8dfe0b3aac1ac943ef98f5ac86ef2fb9ec60ba4fd16cbf3aee8d8479a3ffe9fad9b60a5be6d8fd58c4c7edaebdefeec9b67f96caa34dbc3534bda2dba6daf2a49c3b13de67bd8707ae48ca1cbbeb60a60d34b3fbad943eea03c7cb60672a1d84034054f856dbc6ad506dacf1b61acd9cc632f33bc1b9f4066efdc6b2897973cc1ac7cce0d4e360466dafbca24abc58e737313b6c8aab7a3dbee50bdf4c774fcaacafcfb8a63b47de2e6e4a9adf093ddca35fe8baebba4c4a3e0c66834308b6b2ab8bc7792226987a9db6b1cd915aa91c1ab3ad1dad37cbeaf157b8deaec0d7e5ed4befaed02787cfcafc5eed9c61cccaad6ae650ecdfd74e91ba89bddfdfa7c0f28e4ad4e00a7ca31ab4bec1f9c5add8afefd4a64f8b57e1ffc70c2c8ed699be8c7668bb61f4cd481ea6d35f74da4cdf4d1af51bd15efc50def32fa27811ef83e8979f9934be286f0b0fbe118fa3c5e71ecbbbc22d1ea101afacb01f247a0c7dd3bb684a4a3b69b0f0c7eb5b5c6c648da0c9271775f86aee3e3b93ceb8921ab96cca16c2caff5150ab47a4ce52020be07ba95e425bc4d8d6fd3a8d8513c6ba0b06cd5d979ce53aa15d518d937cd0ddb2e1bd5faa84e6ecccaae78114071d7ddf4733187c4774efbb06beecc4ba788bdd694baac5cad6fb68a1b9ddc8e2aa198ce2ffdf9ab2080fdafea22209e0a71aec928951a81a4b3ad02bfcbfa2c0db01d7dc00abcc5c8daacafca661a56dc8178f1b9f2aacbbc5de4bffcbdcb1b03b22fabdb8fcd3a12af7dff9b50f1dd02d966a2bd9dedc5a99dbe441bb9615f801b822cd527b3aafebf331542ced74a7ccff4d4e06cee120ca1a8d57eaa7fde42affbfa86e089eff12b1ace39b32379103ff62ae6cd605c43cf6abda17bc0eeefbb5c5eefbb28f42d254ad70efe2b92ab1d4a5ae38d68ce85dfdd64ab0f1cc9ca024c33e363b0fae78c5abf6fdd1addccabc0310dfdaafdce06d689f4dcd47c4cadaffad9f3e5fb852c0cdfef8adf7a4ba59266c43fae9129439f8907a1963a603aaefaa8af99cfdf2712e4fbccef23fe9e8eca8ad02d281ab85bbbff66e54f2d47bf9cf51beacac9564c51622fd8be7a88b4fd472bf7c8f8e3c0663fe4f8f8983da1cb05e1df4f2ccdeaaa2fa2ef0e701bf4cb40940dd15195434dea41aea9199bd1c502ad0ce00aef63fa1f0a6b4adb145dd3cac5d1fa0d3bed20bfc4d6d7736aac0dfdccbea4336d5ac0beaeb0f9d2eef08161ee743fce9effad23eeafe7575ecdbb40ebbdbfbe86cf1e1f6afb2acb8edd237a615fee06ca1c532bceed6f1e3a7da2a2c90d24129cc0bcbaa86fad8c9b6f3c5d78c5d5cf04f6b70ec4e2bfb6eca58952aba0cfe558afed4fa6ffffc26922afd6e0ba2e5ea2ece8cb3faf3fbf4cc2ccb885d885c0c3bc786fbdec5dac7bc3aed0ddee33cdeed9acbb92ebdeca23b511d7040bcfdc7682cbce176dadbd87b0808def6ca1aefab93fd7bcd3fc5d88bdbcbe0bb763bba817ce6c2b5a0067be7f9eea2bccdaff1dabd16de5a6c7075b4ba1f0aa702be412ee78a9d95ccbce5b899efe7cb5ff31a0c57eab3aef23adc3dccba0ca24e7bc5b9757cacbda8b01aff12a3bb9a06e1d0fee0290fab8a3dd9acf29cff3cc337fd10ff054c9f5c861e1c4007ba2a06aeff882440c27ba69dcabc24c3572f622f6cf22a2fd65e8dafa12b6dabf638eeb2c4f9d34ad44a90ddd3b92fee60b48ec865a3fe2d63495eac94d5830eaa294cb34dfacc5fdece0b5e7cfb4dafdc3b8edebf68ffae260adf5e5d7430da7bdaa49959ee90d49fee2fc34f707accb8ef4dc0dec897234f4ceeeab5eac034332b760f9adef0cfdbf2ff82ff6ac3dd8f0e6b0eb9dcf6c757aff7c7e8dafd50f41d32cd37f3e970c7dea84fdc72fbb132cbb91c7ebe85039d89c5d49ee7fccafa91f6ece4ef31ccab37ba7b08652b8a577bfdccee631d8da190ce5bf9ad81a6eb4abaca34ce82d480d5a0c2e711215d9b9bea90f4c13470b1f983aca0fd2f7d6fce71eab7d03e0aeeeef8d42413de67be5a752e3cf08ebca9a0196f54abab5d2ee50eaffd2daee4f9696fb8a8ba5efb98386f651dc5efaed6c606b2f6fc5496e876d3d6f6bae61b23fc1d4fcab0bca53c65a343eabbb0a3cac08bc9eceef30bac4aef2ad38cbbef9ffb75ae6dcaa764aeee35e144bfbccacec8f0be9a233366f8bf3b968fcca0275d0e37fd2adbbd568d08108eebfdc51ef57fea3ce9fcde6e4cdc5188b3eccfc5e9a30c4aebbd2c5e06f5a34ce1820ea2b594573d61c9e7a369c8ddf1fc4edd56ebc13972b39d7f80dcad3a29e93ef4c93ac4441ff4aaf72d155d486df610e7baee5df0bde22d6dae1bad86e2c9e361fbfe38eee10a019e1a923b9eef2eeecb05e826b4c9bdf3f7bf67f1dfb24fb73fffd76ef6c0a7e2f36caddb5d130c74eeccc8af2edcd0fd3dd3beeb9808d84d3a8cf1b92f4e8a54ea63edbd5aa615e58ce3b9fba60dceecef1591bfeed7f4d63baefda1de2cb02bd508ab7f0768e253b91ccfb2a172bd6bd5be2c60841aaa079ad4ae9427ecfcbb9d30a8ebf4ae4ba3ee69c2fc008f7f2f9e3235dfff1720e675fedab8c727defadeb2afd923ddb12e8777fbabcbb026f771dc086ddcb56ed567eb2dd7c8851c71895a06d1f32ebcd0d8eafcab3d0c5aea0bdbb60ce1c1bffaadbbfa6bf65306fc396e587c333ad799a05d74e81c885c707d16def101bcfee1ab6ab5394f1d82ba9ed08aeab3a671dc4f3309e5daf554eb5455a7cecba68a3dfeeacde124ce1e7e0fbbb74cd59e907ed68feae6c0ea1decec8db3eeed273aedad0c2caffae1a0cd8fe0fe0baad9caf3aeeb12f20fd64fa1baf23e5ed3a35f49c7decadeab9f69598dfc6e7f7bd56ecf07ad3985c0faef18f5cbab2dfb067ad674339a7b03244edf6abadf2a42bfa8b80edc4edceaec2be6cfcc8ad455f0dfb901ce0a3c03bfeadfc4884fe70e385cfacde31ad28acfcd9dfa1fe4a2b9becedd6f777d3cbdb93daeb57bccefe3fecabe06fac40ff0acdda2ec0dbd4f1fcb3def5d7df7f7d30f3e1a0ecdbf75d7251fabf513edf1cfa2a423b217d325dcf9beeb5aee4bf647eb18f347fd7fb97e4cc5cda21e0b7b349ddacbbe7b8081dc7d26e6fb88b3e45fe93ced2a8dc009fec5df3ac23dcf3e5c910bb5f9cb3b57ef541ceb6fe3e7e00c425ff4caeaba96495cd9ca062b76aea40ec33cddbeacf2ff6fbefabe9cbde8ab8cfd9ef5cad692e114ca5dcb01ab3fdb68f33f8d337e2fb12a5b7ed4adbed12af4ccffbc8fa0bae4e8eee7a9a16bbd5d2ef5551dad1821db3c9c903dbfd2b2ef2c2b37eeddfef9d7a64a51b7c3c0d2cbaa6f2d8aec40a779e7fa66654d1dae1c858165f8d38fcf3fe6ed409166f6acc958d2edcb0cc56c5afecf2239662e648f2286a8f2f7eed95aa4dd3fbb3b8f5e5ec0bcdd9fd2db8d7822c11c27d0e74f5446ac64f84bdecdde71e9f92dbac88df844e74aac57f5de6324d412f7bad2cae2ac2b80b9dab56435d874bdd5e6aafe5a25af4d499c0afabc22c4cdae95caaade2a226b9ae028f1beabb6ac0b7756d8963e2a52fc7fd1f39eccaacc90947a0c7e5634d4b43bd0dc472aba281aa4cb935eb2fe5a9b5b6efe8aa7d1e0ae3be19c9cbed82b238dc0ffdab50990a74a960da8dab45cd168c85494faaeea079eedec2bf8e6f69942f86cf596caed8d6eaa8d7274c86b6ceff2acc0258b6ad8fcd6fb5ac854d7d88f3a9698d6641ea37baf3295be1cac4a4e5f48a7ec02dc2f47d3fcf92eecc2fcfc1fae1dbd6095db51ee1d2d4d984e270bfdfc574d3b2ee58a86e05f11df6ecdde958def8a2afcd3d6c354f7be2cf38fae5a79e4f5ca72d1ad1ad1aa6ab7a777df9a5e943c434ca8b56044cd4f5eff66b45fdeefe045903fe10cfaf9be4dee56a9ad4c9a4e7511af82de48e7f0ebea718df3ac44ab6c4b297b18899ea0b16cf62f764c0a5e9c9f44bb6acb9ac89c8d2b954a5b52ccdaaeeeb4c5032fb38aae1c5c6caef0ecfa7a5ccefba75c01727aea21bedfa1a63f4e64db4fd7ad1dc22cc174fada1472ab1ad54d56abb3cb8f3acb321cec46d72f8f6df65aaef2d078ce7ee51ef2f5f86c08dc39c93a20adfbde28c20fbdb3532ee114eae7c6f9c4557cc32ff10dbed3ccdb02d30caf4c5d2bfba699cd8beb58e0bfcec2139c97efde025abd03cadcb7a64c98ccf3b7ddde44bdee12bba0948ff014ac5e0ef5fbc99d61aba2f619cdca73fd51f0a98ab102a0f235ec4e2fbf552092dbe67d2bfc6cf6ed754acd38ebe426f763324c3d7dde410bbb8d6beabb376f2a5a5498fbdb4fdd7af47b2ee6ad2dec91091f119bda2cd5d2bf9848dfee78addedec8ba91900bacda4f1e2ef8b20a9a96683d4ef55c7bafdec1dca6c6faf65eeb8bce7de6bd0fe90e68ccae7bacfa4ecef9ab3c406fe0cf513e89399cb2a0c2357aecfe0ca3f1cc5aaff3d0ad9952b04ba1ec10846dd6c3eeaae3fedf87c731af12c25cb44d4ad13cbdd0c8fc10e4a43dbcbd82f462ba6fc5da36f346d17f37d7e165a73df3dba87b6d6e0ba57faed68a041bafa9936c4dbcf4582dfb2acabeaeacefa9c9d0a5b2fdfffa2081f9cceea236d4bd1c90ce7ddeedfd8dc85d4c5c07afabe80c0698ca3d6fac77d5eebc29a1ff9c59ff8dea8fb6a73d3636942f2fb1f563b53ed671664f181de6a226c6ebb28ab819ca4b6c6f55b7211f7dde5f466e6ebdcd3e5cd225cccebab2ec9c2cfcc0deae3939efbe46d7b35c8e76d4cfe0a6edd7dcfa2bbcdceb42e7c4ee0c4a9ef92c3ed321d456ae1ade9cbefabaec2a27b4ec9ababa1d9719e78bdf94bdbdcd44a9a5e1eaddbcecff26fcb6e2f5ad27ef05ef89c406eeead13e05e9efddd5b878a77cfe20adec5bdf0a73fff2ba44fd7cdb46b5cde5f44bddeabcc67f18d8cefead27bfa6ccd6079eaafce606e2dfbbe843f6fbffb3d17f1f96b4fdae3d4daa99471bf671fccd705adda3107fd8f3cfb658aacfb5eca6f8423eabfa1fdbed6acf34bc8c533cc2ecee43abe76438caf17fbade2ecd3fa0aac9a48cf5e38b6ef10d029c32fc2bcb7bbff932c924e9cd6dfa049fbb8eb0dbcf2cb8c3cdf63aa5cb0ccaadcc09accf5e5b6b965dbad6640e647cc6ebea50e28c1a1beadd4bad401b1b500e5a4cfef0e48b3bc4da3a0b24cb6d56acee0cbd2497aecd35cc3bca02bbdafcd91ef8777b5db1d99e810f0d86123af73427adfda303fffff42cead85ce1cd05eeecce67bf1f6314deb0ed53ee94f2dba9ba7eae9dfa24efadce3c1cc02dd21a3f3c4a4b9dbb2eaab942643dcfea091a10189ab760b3af8a81c748afa9c2aff55c84cfd3b5767dcea8e2da678e86dba19dc59603646a7d359052a4faddde4be3bab7715dfba0acf5bb3d017b9ce5f965df6b1dd4a2cf0bfebaa1a12611822a69a3fe0bc2db5183cb4cb1ef5ef3d8dae9fbbcfd7b43adade85d2df0f5fd0a6cefe4beca56c24e3a0ab89ce615aca99d7d71f46fc2cd9378eec70cfe6b3c8dedbb989dac7ef08c8fd8eecd11b42cdd9f9d14eaef31bbb08bb29b47badb0b3ecb4edc86ebebf3b9dbdde145dad1667c5af4de0f25ddd58f63efadfc7aa61ccbf874afa2a5aabe4faaccd4e9bb91eecde6017fdacf6caa22ec9a45070fa354e9107cdc478a76c3ccc0c8427f00a3cef30bf46cb272cb9bccef7ad4cd89dfaf12a428f37d0c1eaf7afacb75f00ae276df7a4aae9f34aceab3ae4a68c1348e2d4cbde0efd0d5abf8ae7dd3bc903875db7aabd3deecbfeee0228c06231ffdb6612c255dc4c3f4511da28b50fde56bac35f94eabf1aef9cdb9d7cc016bcbcaf2bd8eda8baf4afafc852878156c214dfb4e67457d7cbded0baeedd047b26cde5ac736c010d4fb82ed6ebebea5ffc3ebcda8e79364e93aaba15ce57c5f32fb37736b8abd8f273cf6bcd16181bd8c6f8fda5f18f32e0baad1c37f9cdbe4b99349bbadb5bd8afb9e8aee071fbae73ba3dfddf130ee0b971857d3fe2ff85f6de9f5d7bcb24faf9b12d87d7fbe92d0fa2a45bc64c2ed3ac188a11adfbf154fccb9f22c6fc881201bd0a5eefecaa07ed1bfa77dc8cb2e275a6b75cace71540d9443f2baffdbd9884c09c31feccf4abbdaaaa8bac2dc2fd14ac0ca392b8bb5ce858bb2e464abf42cabbaed8cdab30a838ec7c21157c3bfad2a05f733e07bbc8ff3cb6be9eea5fcc9e77c86cdafdbcadc4ae2cf1f452e2819f66cc0aa9efededf23ab87dc75ecfc0c3ddce3f674dada6b3e37e62a9b30966fdaa0967398fd20f43f7991bd7becacdf272feba25c878fa636a57a1ce0aee70d2ba934578b86f83ff7ae85b2f94abe3ecf17b8504cb0cd69dabe7b9bc5fb2f3edd8a1f200e2bb1fa5dffe29dffda2874fecd8efeaca4bc146bfe900ad7bbee435b116d25dcc801db28bfb5f7dac6cb882dafddb4acc24b6fee943527dac3375b9fee8a740709f87dfcbbebbd13cfb4fd243ddeaa4b440eb00498ca38c2ec7c1f86f28cb81b978acd242a50abdd0c3e39c736bf6e943078f38fc9bbaac113d8b5a43c1bf9d8ebd49d0ff2c7e186e05e0eea9108bf0a88c4dabb18dc053b283bcaa4b58c09f2fc0b1cb3bef677c2b128fc1fd93cfef88b7cf4ed0f18ac4ffed5f51502e89cf23ef421caafe26ee075ec1caecb18ecefceaa08fae15825c3d45e7bbcefbe7e5c35ff7ba94cce0bff3a5ca4f0bb597cd4ccb8de3baf9b44bd450b1a9e4f7dd874bce3985cc96ecde6fcb2e061efefac5a25bb38efa5699aa80d6affede86c1ed7794644cd30a7bad204303b87ba6f4d5ca9fc311fd77f9fbd0c5208affcd8089f30ecff3fe0a0cda6ec24ab444bcde7c7afe2badeaea39d6bcebd4d4efd8f54bb8ddc956208f1de9bd7d6921d3aadce53bc76eec9b74461afeecf7c09e3f3abd3bfcc9453eb17afa5d067f7728fbd7ca50f43fc11871b7f3d9c2e4642cdea1a0b8bdc00228ee2db71cef84d9194c0f9b1ebf54d02044ba9b9e8cd789c57ace8270bb61ddda87dcf222ec2ada3b7ac4b2a596daa1067b3448fac30f9db7a6bf9ba5cc7fdb2b491d331fdccfafb53df5dcf805dff6f2ac3178845ab2f9ca4b8ebbc3acdccb9da668deee5aa06216ebd342b7815ff8d6cef7fe34ddad84480c6696a1b4a31cfe7bfde03c0fc1c39fa3e37aa12fca9dc705579b898e7ad30a2ac7cef9bc2dadd432ff74b49dbfa42e22cdc21d0fb587f6ae7af9edb418aeeeb8c4a5d27f7549c81e6aa5495fe1acf1ab1adadadcbd186eba0a944edcceeeb4abd7bdba0eea3cb5ecd6e97bb43a9e52af99ece9eed20be67c9b8e376de2aa50941b57be0d8ffe9e4df8126b1bc67b79aec42aeb5cdbdbe006b7e3e9a79facff2bd07643c23b0ce4dcff1046ab88cbdd859179a5c565e4b3d1eb0bb3d3c854fdbe56a2d7af8ed1ee324c9f1fa66fee7ff1b1a90eb028cbd4fe9fd5adbb1e7251f0bd22e7e0a9cdb73b1ab01b847bbe4097eabea04ebdcb2cbadaceefbcfb1da5fdff6cae580a1714e95c1e3c103ccbfc2efec917d9bc3e3c26f399bedc5ca0fbce7c8e6fbeedcecd54ddbf9db8feb6d2bccc3018850cfbd7d2ab1dcae13aa2c6bd79cc74e7fac36d2d3839a01cece2d3bd53b9ec5f56e4e6eb8fca39d688b6b58feec3823c0788ddbdebff5afbfcee08dbcde9bd9ec2e0c371822ca6dbc5ec51324f486fa7b11fdfb1c99ffdcb77caafce1875cbdfcabf5fba7263a8c76ff0992cc83fd5cad43fefccf10b39e5a7cedec434547eeb3e48a07ca02f5cd57be8efdefda83acdbbafbdbd13aafced4aea4feba4df3a882dbf41de4a5f4bbbe6474ce691e3ee0e0e05ac2958dbdfd7cf7e16eb7e037edf47dacb2b3b06bb35feefa4ee3c73eb833de77fcff321fb41bcedada3f1aab6cd85da62823faac1bc73bd3b8721f2eabc8bcadc0d5bc2de2e05ec3904a875e2a2a35805ff70a8eb4ff13eb04e49b0783d62beebb3241b1d1dad63ebc56d9079c56cd3ab2aeafa7c4ee0cf5ff3ff86c3e4e6df11e0acecaf3beb04bcc3d7053227698aa3ddaea1de08ad8776cdab372cc7bda6cbce3f65c97d013acad0eaa7981aebb5b5c36dcaf5f7cdc384f0aa302b35920a9dc075c3c2b3dff2ab004d1efe5a6b4def6eec08dfe7fc0fe0d3c9a9be84d98dc4ee6d2cbb6bc1b3c4c5646e372a06ba2ada9e3dec09cb007aab1da0e0d0f0787bbbfaadf104c1bf5c0ef9298e14fadeafdc856edc1be403edfda4c4aaa5f4eee2f5b177ba1dafa14faaddbeab7dc8f528baa4add34ebfdad9fe887edfbb9ced900afeecc9ceebac50ad774dfff47f6fa45449c05da2e85188b641ff9dc1ea3fb71fa4bbc568e5e63fec961f2a68afcd121fdbbda3fea7fec4d04cce24c62e62ccae67e620ca1ab88c460e60e10159540e145ead922ffd9a8a76ac02bdac4f98bf4a7fe54b755b52e4add8ac79fd6cfe0dab24efadff0aa8b7f92bcccd9e1ceeaae7bed7ec2e0d71cdc66cf08526240cffb806d43c7df4a29c56b2f2c3d2affe0bdfbe2bf9b6efe05785ffaabc1f5ebc5abad9ce69a003fd0f3a7094f9af3efb8ad21e02ed38d04d4d50ce54a3e3100cbb66deaff5d448f8f284a69f84b08eb23ea795d4ceefcab22faafa4876e87c57dbc5eae173c1d3b1ce85ccfd373b3af89aaf1907ece4abe154c7dd530edfb3caaefe3e77d63e833499a3decbe0ecd9e7e837a7d37dfccefbf4a45bde3cf130bfbee741b3cb0f7c820cecbfdedbb97c6b628d6fb32eeea2ee6adab6b15025fcd2a3bb464ea8abaadcfbfddffeca93ba6ec2facfdd7a39cfc3c01ae4eb194eebc02a5efcdf16926e2b7fceead06bf912aab96ff45ca0208aef52d5cde4948a22b9dace24c53b2300b24f94d98ac3648e4c1abab319a9704ae038e5d5c29c0f4763026da2320aca7aa7cc932b3bbadbad3dacd6703a77cdc1cdaa8f410e98adda8bcff366ce2bd5a3f48cbef7cfa3ec7b4ae8fd3d8b846977bc9e2e6abd9a4b177ed10ce7da4accce3ebfecfbf4e5ba6ff3ec66538e1d23f2ef671bc02f66ae05fb42a2fe2b71a015e3e2054efb6bc083d68e7afda378a8de0a67baf2a8594b8150dead75beaddbcef7eed251a582df825af31adfe580d0bce73b3ee81cb42f1d4acced00c7beba6a5e4b2bdeeccf6fcb84a1dccddc736b45d3e85bbe7b71fcadda47e4fdcba2352aa21845b51db45baac3f7f4cfaf1eacbd8fc0f5b9878f09f1454d0bfb76abdd2efb73d7bbdb5f72eef42fc84bcddabbbe33a7c4b4ac179a3d0aba775dadcdc2aaecfce54501581c01cc7180f3f0b9aff2ca6e9ad3fad5c867c4ce298ff31a9cdc5fa6cf8c1bb98dbd742c7a97fac9fa8ff3bad5da4eca0b9d1e6edbef15c07bb5ce6a7bbbd0d7c4558744703055b9db759f6fdf26996d07aaecfe997dd1efed6b4692fbfccf0fc1ecc01da64303b2bdccee8812ac556798cf9e6077fd591f1353ca1b894b6d12fb86ddefefd03fefc04aebf2124aeabdc16afecabe4d0ff3fdcb3deb66ecbff31acdacd9b46a2fcaf1d3bcc8f80b8c5a6b91bfce8d5649dadd90eadc00f30a755f8bebb2f79799f9effda4f680d21ae8dc0d725a17dae3ef29a15ee0ce865edaae4130ce438e36b0912d7d13edcbd9c0b2fbbff66947f84b8c7985f45c7c363adb467deec13ed8ee3c0cee67222b074cec9bed0593ca35215bd1bcdcb30ffe509df0d2a0b98ce9f67d5fade6a6417dee7eb53efc4db8dafa8dde7257ded0cafadb5abdc6c1aedf85b1de4b9ba0b414e3f75aaf2a061cfa1e0b473feafaec6c0aad06f1de57af1b24a452cee64bd20f65cd9c20d800d987c45281b72fbbfffa552fb7ec60fdbee0b5af07ddcd4f11bdca2ae651ea7e8b335816ccc05ec2ab334fe4dafccb8a26bef4cbeec91bbaaccd0aed2cc7cf57984fb1fe713cc9783defd94fb62088fabc6a78bf2d922a139c9faddef06e3f9332d0a33696e3cefcfce8e871f1be8a0c710084a74cc7fd51eed4ff7bc0ab02a6b2267fe5ac8afdde8d8ec695dac3d40eaa2247db93d87fad8c14a7c4fedaebeb7db1c1938e56436dfbc3ddae38e7df2fb0cc9f9581bc7adfbebd20eab369865e12e4f9aa71a0baf95dcbc46c6cfee2edc9eb220a8e4bbe28faab6e78aacb719fbb0332cdb36fa11a85abbceb45b8faa70f5d1dc66e8abba541e6bc2ffe823fb4ccfd967eedba10cbc740c6ac98aef2e2d346dfd27eed90bdfcaee33af6ed582a3f1df8d10e9cefe391dc3990cb4bf8d6a7ad3cdfd2faf01af4bb27a5ec3dedc325b8cdbeacfefe9c3bfefb9e3db4ae1a48de084e28dedbbfe8e4cf17ea8eb8a1e1d42dae8f934588beb1db67eea39b1bd42efca62957f23efedc41fe4c1c6bc85c06f587f7fcdfd7c0ab26ce90c03faffe6ea9dd603dbcf295b2a1ec4e27ad68975a5af3fdcb90b4bac46de6d90f6a6f6abc83b0cf75956d78fd1360d66bdb5fbc436f79c3c6605b952e6684f659bb1f4ddb5eeb5dfe51bf84b1b9fdd430700ec1b99bfab5e8124574ec46ee6c10eb7583ccd5c6dddf72455fd12facabacbca6d180cd7fecf723abae81bcbab6f9eb76475fad45c2056cebdfd176a5a5eac5c7c6eeec41edae47c6b1102f86c3cecbba6d6b2cedcecfb9cd200fee97fdfefef3ba9abef31f4c0fc6fa8e24eecf75ffde2d582beca15fd1ca913928ab83fa4b4e6e28cb62aa6bf80adbfb65b0a704c3fdbb1f0a8ac8bb1b6b6dffa6df2bd6d3efa39ec0952f5c3fecf437cc55711cbcc6ede7c7898b6ed447c08c8ede0ecde7fad90f678aed85cb0346cb1088c25c4b7eeae0d1e438f9bc5cb45425c8fddf8ba56ead6af77dc6bcd3e0daf5b948e59fbdc36b73177f04a4afeb4e6bdad1cdaafb40df2e6f1deece30c6117c508fef3534c1fb1f3aaceb39cbb74979384ed055b72a85dbaa3189ef6eeab5ffefe996de18ebd40b6a21de4fde8cf2f5e75898adf318fd96b3e01e3d8d6c5aad06cd0afa0ba82fe0f8ce6bf71ff9d17fcc59c64c15d2a0eb8dcee16e5972e8c40f1bbfdca8bc8dac94c8b428e5be1c7e7fde50d106bc7e7cd09dfcfdbdad09ecb5d0bb79ecc6b785e27a4ddfafa9ceedbcdd38ec603ba1a1bccceca68a097ee218be5a6f63a41dc8fa3ccf3f2d6b1b79f4b7a638a7f5aa0bbbac0b0200aa96ae47ccf6c7c10b78ebbaaa822a0a6323ec72943c3294bec0cf08ff6c6d4bed4adaaeac5be0a6df35870fcabd1d393ae8c5bd7c3f3f7f3d6519333daca54bbcaef804cf1fbbf1d7a3e556cdce4b57a5c91fcd0a95ddaae543fa5493cefafdcafb63f9a7850bd4cce63dea2e63febaee42dd3bddd6eedceab304bbcb3cb5e3a58fa3aa704ba23afb1cd7ed8ff9909b70a1613c1fffdaaa130e89cb12b597befa680c6ccbbdf1d2b9abf9eaf2ba697fc9e1a6340bb33fd6be11c08c5eacafe991bffe926f4d6e4de7ba94fdff5b8bb3cee0aeb6187c68d8cabc8bed77ff54a8ed3ba87ed96dd1098ed8481bfad3219dd096e1140b3eefb6c07bccb6f5d2a9f4ffcbf57cb1831ddf0db3b346f0dc4232a9a0fdc4ea3bfbbbe94cb49b4ab6a01c116e9f1c3322d3121fe69cca90c0fee37dce6d4fec6e9c2d6d25ccd466bd909e9d97e5ddde0b96d8adbfd6f332ad3c293af5dd9dad3e8ef688c63eb28d3a6f83afbf4babbcd716405f6e7edc143d0bfa0effb0d6ab915c859de5d81f3e4cbd9adfdcb4dcb890f37bc1c1b7ae9d1f2cdd432e2d72264d9ff07f67ceabdeceab22c50748e622ecae1d09cd1abcfd5fafd6ac363deaaa4bbfaabd961abbd9d0c4ee96dcfc2d822e51c9a825b57421afbbd628320a5ca8f0cbbeccebc625faef878fa7eef12f6fff1abe57fae1683675a9efceaead868ea073111a64cd5eeadc22bc6fd3fcfca1fa3bf96e3ee5c1895ada074d137da81aacabe458e20f50bcad7802eaacfcb88fb45438bdbfb486dc65f030fd276e2707befcbb52e73731eac048a15ec4f80f7a27ecedb56ece7ffb32cec16d2a1e3f063fd75ae27abb39cd3d22989acaa95e71838374ca6d53a3ab7deab3d9aea4b9ef9e8ca74fffea033baa4b6fc0dd4489ca20661f2c0f28deefbfb2ec5fce3f4beaeb43f3aa4bd1b9faac40ddb40ebcead9605ffefb11b2c4da67742fa6579e98fbbc23a22096ccc51927c94d0a755f305cddc442c1ce45dca3d9c611950dc4fb546daafa8c0bfacfcc552cc3bac230b3ab026caae8605b7cff6f3d0ad8edc443ef9c6c4a875dc1a686ebcdecfcafe8fca0af3d2b479a5ad3c02eca591b82c216cfa77ec77a5c12e2f6d9af38cfc9e0dc7d6cb32e1d9fcc0ada8f87ed40a0d4b2aba8c4b0aede373f6ee4cd971ed58eabbe4fc8df5443c0ee6ca316ba7dcdb74bfd2d68800faf06fe0dff116435acbd7ca6f6443dd29daad8ecad53f9dbe739a6c1b22f68764aab7d95cbf29d4fdcec6f9ba68e90edd2fdc909a81dd70c6efdfe17d40f64a91d1b6ce5f7c3cacba0eb4f3b76041e0d1c83e4c7040e74dea76b47fff1ba937eaeabd23db6aeacff59b27b3bf866b5fbceb13f746b04ecb558d8fce4aa5ceae865027f0ee5e0a58b81ac800f3103cabd47dd9ece5066bb9bc7a35ba29bb5ae533ac8bfc4d55b2fe3ba625e18ffb4c9ba17becd16bad2fc3fe49fa3cf1dc1a5cafdff89edfada53a7a42da1677e1c7caafdfad6eadfcf82bf3babaeeb5fba82cef5302cbdc733afae5ab95ef2cf806c1e623f5f9a027ded2dea55bddbef07ea8c339af3ad555a9c2de41b100fdd51fa3b1ab619a6c1db0a948a81927caefd167de40dacfe10eb00e41bdd70810e46c187d42360edeae4acbdccd31b5cf193662a7d96d149ae32bdeb42ebbabd4401b3fc5eb8e8f0371b1baf04b0edc8eaebfb3ca9acbabdf9bcb49bcc19bdfb4cdce9d3ef6ffdc8e5e2a99b4e7fbabfaaea8edd15df5aa1baa64bfef64120bdb6ea46f20f420e80951cfe7eaa8474be0abcdf7f6d5cdfe38ffc15fcff33cbea93a9c2befe4ead1a50c9e985feffc9ebabdc4dda9629c8ef77b6d9eb31a5b4b0784df9f579e9ac7dfdf7a71ff180b2dff4bbccfc6fc5e8b0c1e628d9dd20fed1206c1caf21efacbb290bfbe63b4ba3ce6abfb6a78fd2f6ccda6245d6743b8eb479eba54aefe5feededd05d0deb37a1c01e49a683efb59ed8c614dca9ddededcee87bb44de12aa95a4d15e4b3f7beb5ab1993f4ffaf4d0af5bed4e48b0faa5ebadffa17b6805f922b321bdd90fdfbdfa252f0a38a33f7ffab488dcb77beaec6da837c5dced7dad0bafe5ff2a8adcca702dbb9a161da47a75b2dd28cafd552801ddd17dd3e81eb9eea248dd5ffd24bdf11e31f077b4a14f509f3506abfb1a0d0ba73c43019a5c9ec3c14d9c225db893dcbe90eec0da2a943618fc0f8c8bd4fab3c8e8f78db7cf0577a2cd277feab5e3615eacb1fdb19b6dc87dcd416eaee3ded0b1b1eae6c7ec6ceb5af78aa450c6ac5bc1968c8ac7ef2e3d8bebad8b9b3b7917a8ba21adf791a6b64fa6fd7ccb4dbfc1879ebbbef81f3ecc2a572eecab07aa69e3c149f214226acefb2a2ecc9e1edef14f3b8b16ea25ec3dedb444e3c4ffd6f400baaa359cb1dbc5a6a53fc6f0ada76b82ec5e548f4a931dccc6222afb4e80f136f94a3c060add59acacfdc4681669ad630a1e2dc6ad80aa39f66bbf792b815ab81b1dcc3dab56cd9e63adfb6ddd657463b646febdbe6a2dfc0eef6a48b15facaa916a67276bd80acba49a94cc3f0dddde8bd4c145c0aabdf6dfeacfea4c28d48dbaecc5cc57cbeee9dbeef3fea8c690cd3a1ab186cd408fdad3933cb0a09e538e9bdbe74ddde4ee2f9092c48f02e1696f63996d5026fa0c7779e5fbdef855ccfdead6adfd1a607a4e1a57c6f224c37f2fccb6f7bfec4683d4437b9b2cc79f36c9f46f2f5fcff4fcc4c1838bd239a841c8d55a0621e3deb40cebee39c0dbcf449e700be94dbaf9f4f05df2b03fe4dd1b685e66db7f3caf1cedecdd59ecfa4d962322cb22b7d8c03dfbd6f6cb81ab59bf6b244cf44ae62f6d5acc1b63edd0fabf3009fb1ef628b3d93b8ccb21abefc56c80ea4fd11baf9312f89ebed4fbde84adfaddbca67d7aaedef4ecd4aa183dfcb9bdecae95bdf53f8fc2249f0a46ebacc4aa97b38deba4babfcbc46aec62cbbbfd00c8b495ae08f35ebd7b9c15ea1eb891d86eddf6a5d5ed35cdf9ff927dace9ded8552afbbc2ed0dfa529e2eac4035cd1baaf30da5ccd2bac641c3e3b1949e7f43ee0b87dae4041bec27ccdc9de3ef0a6d1ffd3d0fb90a7d928f34f8ad4ba9bcaf06a235cbf2daee3ebb51bffda3f9fb3dddc5ebacba70f6fcab975caa3aa4734e2903d1e5e4366eedea4f7ffeac7bebfe4149cf40ff2cdc891effe0a3e04df0ae8c8fa3eec8a454eedcad054ce9d9b7a53aa7a6e7abe1aabbe0e5a9cebdfe84ce2aadb032a6cbeaf1eba9cfdc3edbfefd9e7e1ce03b5df6b6a2c51ffcb418e55a6ef20ef90633a6d28feddbcea97cd7dfdc1e6e93ef4ce31f6aee4c5cd6bb32b182ecdaba0d4e45cebb891b577ddfcd2ba0fbdbfd299a7bbc6d59e9c9c097aa1101de62b5ba3b89bf377ab6f70e6ab7cef299e8dafb3e330d6eeaca2b46db67dad437c243afd8afeb1a0ead24537e4a9e9d2dbeda9c908ac67426a0d4acd17b7bc11c6080d552dc16cbb67f0db4ccd68553ae912ac939e9deba4c69ca738dcb12a8bcdbfe95ffec9f5f4dabffda121f99dfcacecfcc17d2abea440ec17b6793cc081d3aabc89fb661a0e57ec58dfd5bd5d0fbf66acfbbf26beaf3daaf0baab9cd7df7f5e7afefcb4704d7fb60467dc061fc214fed4b1c08f6d21aa802c0bf3cfe457d6fc2edc0ed0aedb3760afa8beb805f2c51ffea55bacdb4e86a909afdfe4db9b20cafddaa65c3f13da4ed20c45f7e7d39ecf5eab2b760def3bf6aac965e7c72ffd5e4aa0fbfbd869b36febfd82bc97a7e9dfffcd7450aed29d87b4bed8cae3f1147ad2bbe705bc97dcbd8ac712e165bc13f3cdc8ffd693f335b3dc332adc9ef0c0a05c2d271da6da5cceb2f4af6978f21bf5dafbd8f2bcae8d302ac5bddab528aaf1f3eac5ad45bafcfa36d0d0f2adebbccf13c09a4bbf1edbf` From 6af44a1466398fcfea5a8780fbdb9df10d52af6f Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:29:22 +0200 Subject: [PATCH 308/325] Fix lc execution header bug (#14468) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * create finalized header based on finalized block version * changelog entry * pass attested block from handlers * fix core tests * add test for attested header exectution fields * changelog entry * remove unused functions * Update beacon-chain/core/light-client/lightclient.go Co-authored-by: Radosław Kapka * Update beacon-chain/core/light-client/lightclient.go Co-authored-by: Radosław Kapka * Update beacon-chain/core/light-client/lightclient.go Co-authored-by: Radosław Kapka * remove finalized header from default update * remove unused functions * bazel deps --------- Co-authored-by: Radosław Kapka --- CHANGELOG.md | 1 + api/server/structs/conversions_lightclient.go | 5 + .../blockchain/process_block_helpers.go | 10 + beacon-chain/core/light-client/BUILD.bazel | 4 - beacon-chain/core/light-client/lightclient.go | 378 +++--------------- .../core/light-client/lightclient_test.go | 96 +---- beacon-chain/rpc/eth/light-client/handlers.go | 5 +- beacon-chain/rpc/eth/light-client/helpers.go | 9 +- testing/util/BUILD.bazel | 2 + testing/util/lightclient.go | 138 ++++++- 10 files changed, 223 insertions(+), 425 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a5da0a4f444..9e7022b471bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Core: Fixed extra allocations when processing slashings. - remove unneeded container in blob sidecar ssz response - Light client support: create finalized header based on finalizedBlock's version, not attestedBlock. +- Light client support: fix light client attested header execution fields' wrong version bug. - Testing: added custom matcher for better push settings testing. ### Security diff --git a/api/server/structs/conversions_lightclient.go b/api/server/structs/conversions_lightclient.go index 83483bb53225..50e6281ef9b9 100644 --- a/api/server/structs/conversions_lightclient.go +++ b/api/server/structs/conversions_lightclient.go @@ -84,6 +84,11 @@ func syncAggregateToJSON(input *v1.SyncAggregate) *SyncAggregate { } func lightClientHeaderContainerToJSON(container *v2.LightClientHeaderContainer) (json.RawMessage, error) { + // In the case that a finalizedHeader is nil. + if container == nil { + return nil, nil + } + beacon, err := container.GetBeacon() if err != nil { return nil, errors.Wrap(err, "could not get beacon block header") diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 63bde32770b1..8f3da0a4236c 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -162,6 +162,10 @@ func (s *Service) sendLightClientFinalityUpdate(ctx context.Context, signed inte postState state.BeaconState) (int, error) { // Get attested state attestedRoot := signed.Block().ParentRoot() + attestedBlock, err := s.cfg.BeaconDB.Block(ctx, attestedRoot) + if err != nil { + return 0, errors.Wrap(err, "could not get attested block") + } attestedState, err := s.cfg.StateGen.StateByRoot(ctx, attestedRoot) if err != nil { return 0, errors.Wrap(err, "could not get attested state") @@ -183,6 +187,7 @@ func (s *Service) sendLightClientFinalityUpdate(ctx context.Context, signed inte postState, signed, attestedState, + attestedBlock, finalizedBlock, ) @@ -208,6 +213,10 @@ func (s *Service) sendLightClientOptimisticUpdate(ctx context.Context, signed in postState state.BeaconState) (int, error) { // Get attested state attestedRoot := signed.Block().ParentRoot() + attestedBlock, err := s.cfg.BeaconDB.Block(ctx, attestedRoot) + if err != nil { + return 0, errors.Wrap(err, "could not get attested block") + } attestedState, err := s.cfg.StateGen.StateByRoot(ctx, attestedRoot) if err != nil { return 0, errors.Wrap(err, "could not get attested state") @@ -218,6 +227,7 @@ func (s *Service) sendLightClientOptimisticUpdate(ctx context.Context, signed in postState, signed, attestedState, + attestedBlock, ) if err != nil { diff --git a/beacon-chain/core/light-client/BUILD.bazel b/beacon-chain/core/light-client/BUILD.bazel index f6af7a3b9fe1..c7a264c71bb6 100644 --- a/beacon-chain/core/light-client/BUILD.bazel +++ b/beacon-chain/core/light-client/BUILD.bazel @@ -12,12 +12,10 @@ go_library( "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", - "//encoding/bytesutil:go_default_library", "//encoding/ssz:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", - "//proto/migration:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -30,10 +28,8 @@ go_test( deps = [ ":go_default_library", "//config/fieldparams:go_default_library", - "//config/params:go_default_library", "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", - "//consensus-types/primitives:go_default_library", "//encoding/ssz:go_default_library", "//proto/engine/v1:go_default_library", "//testing/require:go_default_library", diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index c91c1dd50b37..afcb5c56f9ed 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -13,15 +13,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" - "github.com/prysmaticlabs/prysm/v5/proto/migration" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" - - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ) const ( @@ -74,9 +70,10 @@ func NewLightClientFinalityUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, + attestedBlock interfaces.ReadOnlySignedBeaconBlock, finalizedBlock interfaces.ReadOnlySignedBeaconBlock, ) (*ethpbv2.LightClientFinalityUpdate, error) { - update, err := NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + update, err := NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, attestedBlock, finalizedBlock) if err != nil { return nil, err } @@ -89,8 +86,9 @@ func NewLightClientOptimisticUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, + attestedBlock interfaces.ReadOnlySignedBeaconBlock, ) (*ethpbv2.LightClientOptimisticUpdate, error) { - update, err := NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, nil) + update, err := NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, attestedBlock, nil) if err != nil { return nil, err } @@ -160,6 +158,7 @@ func NewLightClientUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, + attestedBlock interfaces.ReadOnlySignedBeaconBlock, finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientUpdate, error) { // assert compute_epoch_at_slot(attested_state.slot) >= ALTAIR_FORK_EPOCH attestedEpoch := slots.ToEpoch(attestedState.Slot()) @@ -223,73 +222,30 @@ func NewLightClientUpdateFromBeaconState( if err != nil { return nil, errors.Wrap(err, "could not get attested header root") } - if attestedHeaderRoot != block.Block().ParentRoot() { - return nil, fmt.Errorf("attested header root %#x not equal to block parent root %#x", attestedHeaderRoot, block.Block().ParentRoot()) + attestedBlockRoot, err := attestedBlock.Block().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get attested block root") + } + // assert hash_tree_root(attested_header) == hash_tree_root(attested_block.message) == block.message.parent_root + if attestedHeaderRoot != block.Block().ParentRoot() || attestedHeaderRoot != attestedBlockRoot { + return nil, fmt.Errorf("attested header root %#x not equal to block parent root %#x or attested block root %#x", attestedHeaderRoot, block.Block().ParentRoot(), attestedBlockRoot) } - // update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) - updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(attestedHeader.Slot)) + // update_attested_period = compute_sync_committee_period_at_slot(attested_block.message.slot) + updateAttestedPeriod := slots.SyncCommitteePeriod(slots.ToEpoch(attestedBlock.Block().Slot())) // update = LightClientUpdate() - result, err := createDefaultLightClientUpdate(block.Block().Version()) + result, err := createDefaultLightClientUpdate() if err != nil { return nil, errors.Wrap(err, "could not create default light client update") } // update.attested_header = block_to_light_client_header(attested_block) - blockHeader := ðpbv1.BeaconBlockHeader{ - Slot: attestedHeader.Slot, - ProposerIndex: attestedHeader.ProposerIndex, - ParentRoot: attestedHeader.ParentRoot, - StateRoot: attestedHeader.StateRoot, - BodyRoot: attestedHeader.BodyRoot, - } - switch block.Block().Version() { - case version.Altair, version.Bellatrix: - result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ - HeaderAltair: ðpbv2.LightClientHeader{Beacon: blockHeader}, - }, - } - case version.Capella: - executionPayloadHeader, err := getExecutionPayloadHeaderCapella(block) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload header") - } - executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ - HeaderCapella: ðpbv2.LightClientHeaderCapella{ - Beacon: blockHeader, - Execution: executionPayloadHeader, - ExecutionBranch: executionPayloadProof, - }, - }, - } - case version.Deneb: - executionPayloadHeader, err := getExecutionPayloadHeaderDeneb(block) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload header") - } - executionPayloadProof, err := blocks.PayloadProof(ctx, block.Block()) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - result.AttestedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ - HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ - Beacon: blockHeader, - Execution: executionPayloadHeader, - ExecutionBranch: executionPayloadProof, - }, - }, - } - default: - return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) + attestedLightClientHeader, err := BlockToLightClientHeader(attestedBlock) + if err != nil { + return nil, errors.Wrap(err, "could not get attested light client header") } + result.AttestedHeader = attestedLightClientHeader // if update_attested_period == update_signature_period if updateAttestedPeriod == updateSignaturePeriod { @@ -319,70 +275,11 @@ func NewLightClientUpdateFromBeaconState( // if finalized_block.message.slot != GENESIS_SLOT if finalizedBlock.Block().Slot() != 0 { // update.finalized_header = block_to_light_client_header(finalized_block) - v1alpha1FinalizedHeader, err := finalizedBlock.Header() + finalizedLightClientHeader, err := BlockToLightClientHeader(finalizedBlock) if err != nil { - return nil, errors.Wrap(err, "could not get finalized header") - } - finalizedHeader := migration.V1Alpha1SignedHeaderToV1(v1alpha1FinalizedHeader).GetMessage() - finalizedHeaderRoot, err := finalizedHeader.HashTreeRoot() - if err != nil { - return nil, errors.Wrap(err, "could not get finalized header root") - } - switch finalizedBlock.Block().Version() { - case version.Altair, version.Bellatrix: - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ - HeaderAltair: ðpbv2.LightClientHeader{Beacon: finalizedHeader}, - }, - } - case version.Capella: - executionPayloadHeader, err := getExecutionPayloadHeaderCapella(finalizedBlock) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload header") - } - executionPayloadProof, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ - HeaderCapella: ðpbv2.LightClientHeaderCapella{ - Beacon: finalizedHeader, - Execution: executionPayloadHeader, - ExecutionBranch: executionPayloadProof, - }, - }, - } - case version.Deneb: - executionPayloadHeader, err := getExecutionPayloadHeaderDeneb(finalizedBlock) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload header") - } - executionPayloadProof, err := blocks.PayloadProof(ctx, finalizedBlock.Block()) - if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - result.FinalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ - HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ - Beacon: finalizedHeader, - Execution: executionPayloadHeader, - ExecutionBranch: executionPayloadProof, - }, - }, - } - default: - return nil, fmt.Errorf("unsupported block version %s", version.String(block.Block().Version())) - } - - // assert hash_tree_root(update.finalized_header.beacon) == attested_state.finalized_checkpoint.root - if finalizedHeaderRoot != bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root) { - return nil, fmt.Errorf( - "finalized header root %#x not equal to attested finalized checkpoint root %#x", - finalizedHeaderRoot, - bytesutil.ToBytes32(attestedState.FinalizedCheckpoint().Root), - ) + return nil, errors.Wrap(err, "could not get finalized light client header") } + result.FinalizedHeader = finalizedLightClientHeader } else { // assert attested_state.finalized_checkpoint.root == Bytes32() if !bytes.Equal(attestedState.FinalizedCheckpoint().Root, make([]byte, 32)) { @@ -411,7 +308,7 @@ func NewLightClientUpdateFromBeaconState( return result, nil } -func createDefaultLightClientUpdate(v int) (*ethpbv2.LightClientUpdate, error) { +func createDefaultLightClientUpdate() (*ethpbv2.LightClientUpdate, error) { syncCommitteeSize := params.BeaconConfig().SyncCommitteeSize pubKeys := make([][]byte, syncCommitteeSize) for i := uint64(0); i < syncCommitteeSize; i++ { @@ -429,108 +326,22 @@ func createDefaultLightClientUpdate(v int) (*ethpbv2.LightClientUpdate, error) { for i := 0; i < executionBranchNumOfLeaves; i++ { executionBranch[i] = make([]byte, 32) } - finalizedBlockHeader := ðpbv1.BeaconBlockHeader{ - Slot: 0, - ProposerIndex: 0, - ParentRoot: make([]byte, 32), - StateRoot: make([]byte, 32), - BodyRoot: make([]byte, 32), - } finalityBranch := make([][]byte, FinalityBranchNumOfLeaves) for i := 0; i < FinalityBranchNumOfLeaves; i++ { finalityBranch[i] = make([]byte, 32) } - var finalizedHeader *ethpbv2.LightClientHeaderContainer - switch v { - case version.Altair, version.Bellatrix: - finalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ - HeaderAltair: ðpbv2.LightClientHeader{ - Beacon: finalizedBlockHeader, - }, - }, - } - case version.Capella: - finalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ - HeaderCapella: ðpbv2.LightClientHeaderCapella{ - Beacon: finalizedBlockHeader, - Execution: createEmptyExecutionPayloadHeaderCapella(), - ExecutionBranch: executionBranch, - }, - }, - } - case version.Deneb: - finalizedHeader = ðpbv2.LightClientHeaderContainer{ - Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ - HeaderDeneb: ðpbv2.LightClientHeaderDeneb{ - Beacon: finalizedBlockHeader, - Execution: createEmptyExecutionPayloadHeaderDeneb(), - ExecutionBranch: executionBranch, - }, - }, - } - default: - return nil, fmt.Errorf("unsupported block version %s", version.String(v)) - } - return ðpbv2.LightClientUpdate{ NextSyncCommittee: nextSyncCommittee, NextSyncCommitteeBranch: nextSyncCommitteeBranch, - FinalizedHeader: finalizedHeader, FinalityBranch: finalityBranch, }, nil } -func createEmptyExecutionPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella { - return &enginev1.ExecutionPayloadHeaderCapella{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - BlockNumber: 0, - GasLimit: 0, - GasUsed: 0, - Timestamp: 0, - ExtraData: make([]byte, 32), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - } -} - -func createEmptyExecutionPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb { - return &enginev1.ExecutionPayloadHeaderDeneb{ - ParentHash: make([]byte, 32), - FeeRecipient: make([]byte, 20), - StateRoot: make([]byte, 32), - ReceiptsRoot: make([]byte, 32), - LogsBloom: make([]byte, 256), - PrevRandao: make([]byte, 32), - BlockNumber: 0, - GasLimit: 0, - GasUsed: 0, - Timestamp: 0, - ExtraData: make([]byte, 32), - BaseFeePerGas: make([]byte, 32), - BlockHash: make([]byte, 32), - TransactionsRoot: make([]byte, 32), - WithdrawalsRoot: make([]byte, 32), - } -} - -func getExecutionPayloadHeaderCapella(block interfaces.ReadOnlySignedBeaconBlock) (*enginev1.ExecutionPayloadHeaderCapella, error) { - payloadInterface, err := block.Block().Body().Execution() - if err != nil { - return nil, errors.Wrap(err, "could not get execution data") - } - transactionsRoot, err := payloadInterface.TransactionsRoot() +func ComputeTransactionsRoot(payload interfaces.ExecutionData) ([]byte, error) { + transactionsRoot, err := payload.TransactionsRoot() if errors.Is(err, consensus_types.ErrUnsupportedField) { - transactions, err := payloadInterface.Transactions() + transactions, err := payload.Transactions() if err != nil { return nil, errors.Wrap(err, "could not get transactions") } @@ -542,64 +353,13 @@ func getExecutionPayloadHeaderCapella(block interfaces.ReadOnlySignedBeaconBlock } else if err != nil { return nil, errors.Wrap(err, "could not get transactions root") } - withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - withdrawals, err := payloadInterface.Withdrawals() - if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals") - } - withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) - if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals root") - } - withdrawalsRoot = withdrawalsRootArray[:] - } else if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals root") - } - - execution := &enginev1.ExecutionPayloadHeaderCapella{ - ParentHash: payloadInterface.ParentHash(), - FeeRecipient: payloadInterface.FeeRecipient(), - StateRoot: payloadInterface.StateRoot(), - ReceiptsRoot: payloadInterface.ReceiptsRoot(), - LogsBloom: payloadInterface.LogsBloom(), - PrevRandao: payloadInterface.PrevRandao(), - BlockNumber: payloadInterface.BlockNumber(), - GasLimit: payloadInterface.GasLimit(), - GasUsed: payloadInterface.GasUsed(), - Timestamp: payloadInterface.Timestamp(), - ExtraData: payloadInterface.ExtraData(), - BaseFeePerGas: payloadInterface.BaseFeePerGas(), - BlockHash: payloadInterface.BlockHash(), - TransactionsRoot: transactionsRoot, - WithdrawalsRoot: withdrawalsRoot, - } - - return execution, nil + return transactionsRoot, nil } -func getExecutionPayloadHeaderDeneb(block interfaces.ReadOnlySignedBeaconBlock) (*enginev1.ExecutionPayloadHeaderDeneb, error) { - payloadInterface, err := block.Block().Body().Execution() - if err != nil { - return nil, errors.Wrap(err, "could not get execution data") - } - transactionsRoot, err := payloadInterface.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - transactions, err := payloadInterface.Transactions() - if err != nil { - return nil, errors.Wrap(err, "could not get transactions") - } - transactionsRootArray, err := ssz.TransactionsRoot(transactions) - if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - transactionsRoot = transactionsRootArray[:] - } else if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() +func ComputeWithdrawalsRoot(payload interfaces.ExecutionData) ([]byte, error) { + withdrawalsRoot, err := payload.WithdrawalsRoot() if errors.Is(err, consensus_types.ErrUnsupportedField) { - withdrawals, err := payloadInterface.Withdrawals() + withdrawals, err := payload.Withdrawals() if err != nil { return nil, errors.Wrap(err, "could not get withdrawals") } @@ -611,64 +371,48 @@ func getExecutionPayloadHeaderDeneb(block interfaces.ReadOnlySignedBeaconBlock) } else if err != nil { return nil, errors.Wrap(err, "could not get withdrawals root") } - - execution := &enginev1.ExecutionPayloadHeaderDeneb{ - ParentHash: payloadInterface.ParentHash(), - FeeRecipient: payloadInterface.FeeRecipient(), - StateRoot: payloadInterface.StateRoot(), - ReceiptsRoot: payloadInterface.ReceiptsRoot(), - LogsBloom: payloadInterface.LogsBloom(), - PrevRandao: payloadInterface.PrevRandao(), - BlockNumber: payloadInterface.BlockNumber(), - GasLimit: payloadInterface.GasLimit(), - GasUsed: payloadInterface.GasUsed(), - Timestamp: payloadInterface.Timestamp(), - ExtraData: payloadInterface.ExtraData(), - BaseFeePerGas: payloadInterface.BaseFeePerGas(), - BlockHash: payloadInterface.BlockHash(), - TransactionsRoot: transactionsRoot, - WithdrawalsRoot: withdrawalsRoot, - } - - return execution, nil + return withdrawalsRoot, nil } -func ComputeTransactionsRoot(payload interfaces.ExecutionData) ([]byte, error) { - transactionsRoot, err := payload.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - transactions, err := payload.Transactions() +func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderContainer, error) { + switch block.Version() { + case version.Altair, version.Bellatrix: + altairHeader, err := BlockToLightClientHeaderAltair(block) if err != nil { - return nil, errors.Wrap(err, "could not get transactions") + return nil, errors.Wrap(err, "could not get header") } - transactionsRootArray, err := ssz.TransactionsRoot(transactions) - if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - transactionsRoot = transactionsRootArray[:] - } else if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - return transactionsRoot, nil -} - -func ComputeWithdrawalsRoot(payload interfaces.ExecutionData) ([]byte, error) { - withdrawalsRoot, err := payload.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - withdrawals, err := payload.Withdrawals() + return ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderAltair{ + HeaderAltair: altairHeader, + }, + }, nil + case version.Capella: + capellaHeader, err := BlockToLightClientHeaderCapella(context.Background(), block) if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals") + return nil, errors.Wrap(err, "could not get capella header") } - withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + return ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderCapella{ + HeaderCapella: capellaHeader, + }, + }, nil + case version.Deneb: + denebHeader, err := BlockToLightClientHeaderDeneb(context.Background(), block) if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals root") + return nil, errors.Wrap(err, "could not get deneb header") } - withdrawalsRoot = withdrawalsRootArray[:] - } else if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals root") + return ðpbv2.LightClientHeaderContainer{ + Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ + HeaderDeneb: denebHeader, + }, + }, nil + default: + return nil, fmt.Errorf("unsupported block version %s", version.String(block.Version())) } - return withdrawalsRoot, nil } +// TODO: make below functions private + func BlockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeader, error) { if block.Version() != version.Altair { return nil, fmt.Errorf("block version is %s instead of Altair", version.String(block.Version())) diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index ff7b6ee94b0c..4d2bbb5f4846 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -12,8 +12,6 @@ import ( lightClient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" light_client "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" - "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) @@ -22,10 +20,9 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) t.Run("Altair", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestAltair() - update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") l.CheckSyncAggregate(update.SyncAggregate) @@ -35,7 +32,7 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) t.Run("Capella", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestCapella(false) - update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -48,7 +45,7 @@ func TestLightClient_NewLightClientOptimisticUpdateFromBeaconState(t *testing.T) t.Run("Deneb", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestDeneb(false) - update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState) + update, err := lightClient.NewLightClientOptimisticUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -63,33 +60,8 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { t.Run("Altair", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestAltair() - t.Run("FinalizedBlock Nil", func(t *testing.T) { - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() - require.NoError(t, err) - require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") - require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } - }) - t.Run("FinalizedBlock Not Nil", func(t *testing.T) { - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock, l.FinalizedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -121,35 +93,10 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { }) t.Run("Capella", func(t *testing.T) { - t.Run("FinalizedBlock Nil", func(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestCapella(false) - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() - require.NoError(t, err) - require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") - require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } - }) t.Run("FinalizedBlock Not Nil", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestCapella(false) - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock, l.FinalizedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -220,7 +167,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { t.Run("FinalizedBlock In Previous Fork", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestCapellaFinalizedBlockAltair(false) - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock, l.FinalizedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -249,38 +196,11 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { }) t.Run("Deneb", func(t *testing.T) { - t.Run("FinalizedBlock Nil", func(t *testing.T) { - l := util.NewTestLightClient(t).SetupTestDeneb(false) - - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, nil) - require.NoError(t, err) - require.NotNil(t, update, "update is nil") - - require.Equal(t, l.Block.Block().Slot(), update.SignatureSlot, "Signature slot is not equal") - - l.CheckSyncAggregate(update.SyncAggregate) - l.CheckAttestedHeader(update.AttestedHeader) - - zeroHash := params.BeaconConfig().ZeroHash[:] - require.NotNil(t, update.FinalizedHeader, "Finalized header is nil") - updateFinalizedHeaderBeacon, err := update.FinalizedHeader.GetBeacon() - require.NoError(t, err) - require.Equal(t, primitives.Slot(0), updateFinalizedHeaderBeacon.Slot, "Finalized header slot is not zero") - require.Equal(t, primitives.ValidatorIndex(0), updateFinalizedHeaderBeacon.ProposerIndex, "Finalized header proposer index is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.ParentRoot, "Finalized header parent root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.StateRoot, "Finalized header state root is not zero") - require.DeepSSZEqual(t, zeroHash, updateFinalizedHeaderBeacon.BodyRoot, "Finalized header body root is not zero") - require.DeepSSZEqual(t, zeroHash, update.FinalizedHeader.GetHeaderDeneb().Execution.BlockHash, "Execution BlockHash is not zero") - require.Equal(t, lightClient.FinalityBranchNumOfLeaves, len(update.FinalityBranch), "Invalid finality branch leaves") - for _, leaf := range update.FinalityBranch { - require.DeepSSZEqual(t, zeroHash, leaf, "Leaf is not zero") - } - }) t.Run("FinalizedBlock Not Nil", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestDeneb(false) - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock, l.FinalizedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") @@ -353,7 +273,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { t.Run("FinalizedBlock In Previous Fork", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestDenebFinalizedBlockCapella(false) - update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.FinalizedBlock) + update, err := lightClient.NewLightClientFinalityUpdateFromBeaconState(l.Ctx, l.State, l.Block, l.AttestedState, l.AttestedBlock, l.FinalizedBlock) require.NoError(t, err) require.NotNil(t, update, "update is nil") diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 49c28fa9379b..4145d1cc7b2c 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -204,6 +204,7 @@ func (s *Server) GetLightClientUpdatesByRange(w http.ResponseWriter, req *http.R state, block, attestedState, + attestedBlock, finalizedBlock, ) @@ -267,7 +268,7 @@ func (s *Server) GetLightClientFinalityUpdate(w http.ResponseWriter, req *http.R return } - update, err := newLightClientFinalityUpdateFromBeaconState(ctx, st, block, attestedState, finalizedBlock) + update, err := newLightClientFinalityUpdateFromBeaconState(ctx, st, block, attestedState, attestedBlock, finalizedBlock) if err != nil { httputil.HandleError(w, "Could not get light client finality update: "+err.Error(), http.StatusInternalServerError) return @@ -312,7 +313,7 @@ func (s *Server) GetLightClientOptimisticUpdate(w http.ResponseWriter, req *http return } - update, err := newLightClientOptimisticUpdateFromBeaconState(ctx, st, block, attestedState) + update, err := newLightClientOptimisticUpdateFromBeaconState(ctx, st, block, attestedState, attestedBlock) if err != nil { httputil.HandleError(w, "Could not get light client optimistic update: "+err.Error(), http.StatusInternalServerError) return diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index b30de84bce79..81a551d15750 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -351,9 +351,10 @@ func newLightClientUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, + attestedBlock interfaces.ReadOnlySignedBeaconBlock, finalizedBlock interfaces.ReadOnlySignedBeaconBlock, ) (*structs.LightClientUpdate, error) { - result, err := lightclient.NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + result, err := lightclient.NewLightClientUpdateFromBeaconState(ctx, state, block, attestedState, attestedBlock, finalizedBlock) if err != nil { return nil, err } @@ -366,9 +367,10 @@ func newLightClientFinalityUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, + attestedBlock interfaces.ReadOnlySignedBeaconBlock, finalizedBlock interfaces.ReadOnlySignedBeaconBlock, ) (*structs.LightClientFinalityUpdate, error) { - result, err := lightclient.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, finalizedBlock) + result, err := lightclient.NewLightClientFinalityUpdateFromBeaconState(ctx, state, block, attestedState, attestedBlock, finalizedBlock) if err != nil { return nil, err } @@ -381,8 +383,9 @@ func newLightClientOptimisticUpdateFromBeaconState( state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock, attestedState state.BeaconState, + attestedBlock interfaces.ReadOnlySignedBeaconBlock, ) (*structs.LightClientOptimisticUpdate, error) { - result, err := lightclient.NewLightClientOptimisticUpdateFromBeaconState(ctx, state, block, attestedState) + result, err := lightclient.NewLightClientOptimisticUpdateFromBeaconState(ctx, state, block, attestedState, attestedBlock) if err != nil { return nil, err } diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index f41aa3bc2ef9..fb194bfc1093 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -43,6 +43,7 @@ go_library( "//beacon-chain/state/stateutil:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", @@ -51,6 +52,7 @@ go_library( "//crypto/hash:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", + "//encoding/ssz:go_default_library", "//network/forks:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index 63d85f961ff5..2cf668dac89b 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -4,14 +4,20 @@ import ( "context" "testing" + "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/encoding/ssz" + v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/testing/require" ) @@ -21,7 +27,7 @@ type TestLightClient struct { State state.BeaconState Block interfaces.ReadOnlySignedBeaconBlock AttestedState state.BeaconState - AttestedHeader *ethpb.BeaconBlockHeader + AttestedBlock interfaces.ReadOnlySignedBeaconBlock FinalizedBlock interfaces.ReadOnlySignedBeaconBlock } @@ -133,7 +139,7 @@ func (l *TestLightClient) SetupTestCapella(blinded bool) *TestLightClient { l.State = state l.AttestedState = attestedState - l.AttestedHeader = attestedHeader + l.AttestedBlock = signedParent l.Block = signedBlock l.Ctx = ctx l.FinalizedBlock = finalizedBlock @@ -245,7 +251,7 @@ func (l *TestLightClient) SetupTestCapellaFinalizedBlockAltair(blinded bool) *Te l.State = state l.AttestedState = attestedState - l.AttestedHeader = attestedHeader + l.AttestedBlock = signedParent l.Block = signedBlock l.Ctx = ctx l.FinalizedBlock = finalizedBlock @@ -330,10 +336,10 @@ func (l *TestLightClient) SetupTestAltair() *TestLightClient { l.State = state l.AttestedState = attestedState - l.AttestedHeader = attestedHeader l.Block = signedBlock l.Ctx = ctx l.FinalizedBlock = finalizedBlock + l.AttestedBlock = signedParent return l } @@ -442,7 +448,7 @@ func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient { l.State = state l.AttestedState = attestedState - l.AttestedHeader = attestedHeader + l.AttestedBlock = signedParent l.Block = signedBlock l.Ctx = ctx l.FinalizedBlock = finalizedBlock @@ -554,7 +560,7 @@ func (l *TestLightClient) SetupTestDenebFinalizedBlockCapella(blinded bool) *Tes l.State = state l.AttestedState = attestedState - l.AttestedHeader = attestedHeader + l.AttestedBlock = signedParent l.Block = signedBlock l.Ctx = ctx l.FinalizedBlock = finalizedBlock @@ -565,14 +571,124 @@ func (l *TestLightClient) SetupTestDenebFinalizedBlockCapella(blinded bool) *Tes func (l *TestLightClient) CheckAttestedHeader(container *ethpbv2.LightClientHeaderContainer) { updateAttestedHeaderBeacon, err := container.GetBeacon() require.NoError(l.T, err) - require.Equal(l.T, l.AttestedHeader.Slot, updateAttestedHeaderBeacon.Slot, "Attested header slot is not equal") - require.Equal(l.T, l.AttestedHeader.ProposerIndex, updateAttestedHeaderBeacon.ProposerIndex, "Attested header proposer index is not equal") - require.DeepSSZEqual(l.T, l.AttestedHeader.ParentRoot, updateAttestedHeaderBeacon.ParentRoot, "Attested header parent root is not equal") - require.DeepSSZEqual(l.T, l.AttestedHeader.BodyRoot, updateAttestedHeaderBeacon.BodyRoot, "Attested header body root is not equal") + testAttestedHeader, err := l.AttestedBlock.Header() + require.NoError(l.T, err) + require.Equal(l.T, l.AttestedBlock.Block().Slot(), updateAttestedHeaderBeacon.Slot, "Attested block slot is not equal") + require.Equal(l.T, testAttestedHeader.Header.ProposerIndex, updateAttestedHeaderBeacon.ProposerIndex, "Attested block proposer index is not equal") + require.DeepSSZEqual(l.T, testAttestedHeader.Header.ParentRoot, updateAttestedHeaderBeacon.ParentRoot, "Attested block parent root is not equal") + require.DeepSSZEqual(l.T, testAttestedHeader.Header.BodyRoot, updateAttestedHeaderBeacon.BodyRoot, "Attested block body root is not equal") attestedStateRoot, err := l.AttestedState.HashTreeRoot(l.Ctx) require.NoError(l.T, err) - require.DeepSSZEqual(l.T, attestedStateRoot[:], updateAttestedHeaderBeacon.StateRoot, "Attested header state root is not equal") + require.DeepSSZEqual(l.T, attestedStateRoot[:], updateAttestedHeaderBeacon.StateRoot, "Attested block state root is not equal") + + if l.AttestedBlock.Version() == version.Capella { + payloadInterface, err := l.AttestedBlock.Block().Body().Execution() + require.NoError(l.T, err) + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + require.NoError(l.T, err) + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + require.NoError(l.T, err) + transactionsRoot = transactionsRootArray[:] + } else { + require.NoError(l.T, err) + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + require.NoError(l.T, err) + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + require.NoError(l.T, err) + withdrawalsRoot = withdrawalsRootArray[:] + } else { + require.NoError(l.T, err) + } + execution := &v11.ExecutionPayloadHeaderCapella{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + updateAttestedHeaderExecution, err := container.GetExecutionHeaderCapella() + require.NoError(l.T, err) + require.DeepSSZEqual(l.T, execution, updateAttestedHeaderExecution, "Attested Block Execution is not equal") + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.AttestedBlock.Block()) + require.NoError(l.T, err) + updateAttestedHeaderExecutionBranch, err := container.GetExecutionBranch() + require.NoError(l.T, err) + for i, leaf := range updateAttestedHeaderExecutionBranch { + require.DeepSSZEqual(l.T, executionPayloadProof[i], leaf, "Leaf is not equal") + } + } + + if l.AttestedBlock.Version() == version.Deneb { + payloadInterface, err := l.AttestedBlock.Block().Body().Execution() + require.NoError(l.T, err) + transactionsRoot, err := payloadInterface.TransactionsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + transactions, err := payloadInterface.Transactions() + require.NoError(l.T, err) + transactionsRootArray, err := ssz.TransactionsRoot(transactions) + require.NoError(l.T, err) + transactionsRoot = transactionsRootArray[:] + } else { + require.NoError(l.T, err) + } + withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() + if errors.Is(err, consensus_types.ErrUnsupportedField) { + withdrawals, err := payloadInterface.Withdrawals() + require.NoError(l.T, err) + withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + require.NoError(l.T, err) + withdrawalsRoot = withdrawalsRootArray[:] + } else { + require.NoError(l.T, err) + } + execution := &v11.ExecutionPayloadHeaderDeneb{ + ParentHash: payloadInterface.ParentHash(), + FeeRecipient: payloadInterface.FeeRecipient(), + StateRoot: payloadInterface.StateRoot(), + ReceiptsRoot: payloadInterface.ReceiptsRoot(), + LogsBloom: payloadInterface.LogsBloom(), + PrevRandao: payloadInterface.PrevRandao(), + BlockNumber: payloadInterface.BlockNumber(), + GasLimit: payloadInterface.GasLimit(), + GasUsed: payloadInterface.GasUsed(), + Timestamp: payloadInterface.Timestamp(), + ExtraData: payloadInterface.ExtraData(), + BaseFeePerGas: payloadInterface.BaseFeePerGas(), + BlockHash: payloadInterface.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + } + + updateAttestedHeaderExecution, err := container.GetExecutionHeaderDeneb() + require.NoError(l.T, err) + require.DeepSSZEqual(l.T, execution, updateAttestedHeaderExecution, "Attested Block Execution is not equal") + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.AttestedBlock.Block()) + require.NoError(l.T, err) + updateAttestedHeaderExecutionBranch, err := container.GetExecutionBranch() + require.NoError(l.T, err) + for i, leaf := range updateAttestedHeaderExecutionBranch { + require.DeepSSZEqual(l.T, executionPayloadProof[i], leaf, "Leaf is not equal") + } + } } func (l *TestLightClient) CheckSyncAggregate(sa *ethpbv1.SyncAggregate) { From 21ca4e008fa0b300e75c55adb74c6f6dbb756293 Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Fri, 4 Oct 2024 02:22:21 +0530 Subject: [PATCH 309/325] Update lc functions to use the `dev` branch of CL specs (#14471) * create finalized header based on finalized block version * changelog entry * pass attested block from handlers * fix core tests * add test for attested header exectution fields * changelog entry * remove unused functions * update `createLightClientBootstrapXXX` functions * fix for getBootstrapAltair * fix for getBootstrapAltair * fix tests for Capella and Deneb * update `CHANGELOG.md` * remove Electra from `createLightClientBootstrap` switch case * update dependencies * minor fixes * remove unnecessary comments * replace `!reflect.DeepEqual` with `!=` * replace `%s` with `%#x` for `[32]byte` --------- Co-authored-by: Inspector-Butters Co-authored-by: Bastin <43618253+Inspector-Butters@users.noreply.github.com> --- CHANGELOG.md | 1 + beacon-chain/core/light-client/lightclient.go | 75 ----- beacon-chain/rpc/eth/light-client/BUILD.bazel | 5 +- beacon-chain/rpc/eth/light-client/handlers.go | 2 +- .../rpc/eth/light-client/handlers_test.go | 128 +++---- beacon-chain/rpc/eth/light-client/helpers.go | 313 ++++++------------ 6 files changed, 150 insertions(+), 374 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e7022b471bf..c3de04e900bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Updated k8s-io/client-go to v0.30.4 and k8s-io/apimachinery to v0.30.4 - Migrated tracing library from opencensus to opentelemetry for both the beacon node and validator. - Refactored light client code to make it more readable and make future PRs easier. +- Update light client helper functions to reference `dev` branch of CL specs - Updated Libp2p Dependencies to allow prysm to use gossipsub v1.2 . - Updated Sepolia bootnodes. diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index afcb5c56f9ed..3ae0a7fb2387 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -25,16 +25,6 @@ const ( executionBranchNumOfLeaves = 4 ) -// createLightClientFinalityUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_finality_update -// def create_light_client_finality_update(update: LightClientUpdate) -> LightClientFinalityUpdate: -// -// return LightClientFinalityUpdate( -// attested_header=update.attested_header, -// finalized_header=update.finalized_header, -// finality_branch=update.finality_branch, -// sync_aggregate=update.sync_aggregate, -// signature_slot=update.signature_slot, -// ) func createLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientFinalityUpdate { finalityUpdate := ðpbv2.LightClientFinalityUpdate{ AttestedHeader: update.AttestedHeader, @@ -47,14 +37,6 @@ func createLightClientFinalityUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2 return finalityUpdate } -// createLightClientOptimisticUpdate - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_optimistic_update -// def create_light_client_optimistic_update(update: LightClientUpdate) -> LightClientOptimisticUpdate: -// -// return LightClientOptimisticUpdate( -// attested_header=update.attested_header, -// sync_aggregate=update.sync_aggregate, -// signature_slot=update.signature_slot, -// ) func createLightClientOptimisticUpdate(update *ethpbv2.LightClientUpdate) *ethpbv2.LightClientOptimisticUpdate { optimisticUpdate := ðpbv2.LightClientOptimisticUpdate{ AttestedHeader: update.AttestedHeader, @@ -96,63 +78,6 @@ func NewLightClientOptimisticUpdateFromBeaconState( return createLightClientOptimisticUpdate(update), nil } -// NewLightClientUpdateFromBeaconState implements https://github.com/ethereum/consensus-specs/blob/d70dcd9926a4bbe987f1b4e65c3e05bd029fcfb8/specs/altair/light-client/full-node.md#create_light_client_update -// def create_light_client_update(state: BeaconState, -// -// block: SignedBeaconBlock, -// attested_state: BeaconState, -// finalized_block: Optional[SignedBeaconBlock]) -> LightClientUpdate: -// assert compute_epoch_at_slot(attested_state.slot) >= ALTAIR_FORK_EPOCH -// assert sum(block.message.body.sync_aggregate.sync_committee_bits) >= MIN_SYNC_COMMITTEE_PARTICIPANTS -// -// assert state.slot == state.latest_block_header.slot -// header = state.latest_block_header.copy() -// header.state_root = hash_tree_root(state) -// assert hash_tree_root(header) == hash_tree_root(block.message) -// update_signature_period = compute_sync_committee_period(compute_epoch_at_slot(block.message.slot)) -// -// assert attested_state.slot == attested_state.latest_block_header.slot -// attested_header = attested_state.latest_block_header.copy() -// attested_header.state_root = hash_tree_root(attested_state) -// assert hash_tree_root(attested_header) == block.message.parent_root -// update_attested_period = compute_sync_committee_period(compute_epoch_at_slot(attested_header.slot)) -// -// # `next_sync_committee` is only useful if the message is signed by the current sync committee -// if update_attested_period == update_signature_period: -// next_sync_committee = attested_state.next_sync_committee -// next_sync_committee_branch = compute_merkle_proof_for_state(attested_state, NEXT_SYNC_COMMITTEE_INDEX) -// else: -// next_sync_committee = SyncCommittee() -// next_sync_committee_branch = [Bytes32() for _ in range(floorlog2(NEXT_SYNC_COMMITTEE_INDEX))] -// -// # Indicate finality whenever possible -// if finalized_block is not None: -// if finalized_block.message.slot != GENESIS_SLOT: -// finalized_header = BeaconBlockHeader( -// slot=finalized_block.message.slot, -// proposer_index=finalized_block.message.proposer_index, -// parent_root=finalized_block.message.parent_root, -// state_root=finalized_block.message.state_root, -// body_root=hash_tree_root(finalized_block.message.body), -// ) -// assert hash_tree_root(finalized_header) == attested_state.finalized_checkpoint.root -// else: -// assert attested_state.finalized_checkpoint.root == Bytes32() -// finalized_header = BeaconBlockHeader() -// finality_branch = compute_merkle_proof_for_state(attested_state, FINALIZED_ROOT_INDEX) -// else: -// finalized_header = BeaconBlockHeader() -// finality_branch = [Bytes32() for _ in range(floorlog2(FINALIZED_ROOT_INDEX))] -// -// return LightClientUpdate( -// attested_header=attested_header, -// next_sync_committee=next_sync_committee, -// next_sync_committee_branch=next_sync_committee_branch, -// finalized_header=finalized_header, -// finality_branch=finality_branch, -// sync_aggregate=block.message.body.sync_aggregate, -// signature_slot=block.message.slot, -// ) func NewLightClientUpdateFromBeaconState( ctx context.Context, state state.BeaconState, diff --git a/beacon-chain/rpc/eth/light-client/BUILD.bazel b/beacon-chain/rpc/eth/light-client/BUILD.bazel index 930c701901a5..85b46a07ecc4 100644 --- a/beacon-chain/rpc/eth/light-client/BUILD.bazel +++ b/beacon-chain/rpc/eth/light-client/BUILD.bazel @@ -20,14 +20,12 @@ go_library( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", - "//consensus-types:go_default_library", - "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", - "//encoding/ssz:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v2:go_default_library", + "//proto/migration:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", @@ -55,7 +53,6 @@ go_test( "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", - "//encoding/bytesutil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/rpc/eth/light-client/handlers.go b/beacon-chain/rpc/eth/light-client/handlers.go index 4145d1cc7b2c..245d703eaafd 100644 --- a/beacon-chain/rpc/eth/light-client/handlers.go +++ b/beacon-chain/rpc/eth/light-client/handlers.go @@ -47,7 +47,7 @@ func (s *Server) GetLightClientBootstrap(w http.ResponseWriter, req *http.Reques return } - bootstrap, err := createLightClientBootstrap(ctx, state, blk.Block()) + bootstrap, err := createLightClientBootstrap(ctx, state, blk) if err != nil { httputil.HandleError(w, "could not get light client bootstrap: "+err.Error(), http.StatusInternalServerError) return diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index cac658e7aeed..0ca25649ccc2 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" "net/http/httptest" + "strconv" "testing" "github.com/ethereum/go-ethereum/common/hexutil" @@ -19,49 +20,29 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) func TestLightClientHandler_GetLightClientBootstrap_Altair(t *testing.T) { - helpers.ClearCache() - slot := primitives.Slot(params.BeaconConfig().AltairForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) - - b := util.NewBeaconBlockAltair() - b.Block.StateRoot = bytesutil.PadTo([]byte("foo"), 32) - b.Block.Slot = slot - - signedBlock, err := blocks.NewSignedBeaconBlock(b) - - require.NoError(t, err) - header, err := signedBlock.Header() - require.NoError(t, err) + l := util.NewTestLightClient(t).SetupTestAltair() - r, err := b.Block.HashTreeRoot() + slot := l.State.Slot() + stateRoot, err := l.State.HashTreeRoot(l.Ctx) require.NoError(t, err) - bs, err := util.NewBeaconStateAltair(func(state *ethpb.BeaconStateAltair) error { - state.BlockRoots[0] = r[:] - return nil - }) - require.NoError(t, err) - - require.NoError(t, bs.SetSlot(slot)) - require.NoError(t, bs.SetLatestBlockHeader(header.Header)) - - mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} + mockBlocker := &testutil.MockBlocker{BlockToReturn: l.Block} mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ - slot: bs, + slot: l.State, }}, Blocker: mockBlocker, HeadFetcher: mockChainService, } request := httptest.NewRequest("GET", "http://foo.com/", nil) - request.SetPathValue("block_root", hexutil.Encode(r[:])) + request.SetPathValue("block_root", hexutil.Encode(stateRoot[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -74,47 +55,35 @@ func TestLightClientHandler_GetLightClientBootstrap_Altair(t *testing.T) { err = json.Unmarshal(resp.Data.Header, &respHeader) require.NoError(t, err) require.Equal(t, "altair", resp.Version) - require.Equal(t, hexutil.Encode(header.Header.BodyRoot), respHeader.Beacon.BodyRoot) - require.NotNil(t, resp.Data) -} -func TestLightClientHandler_GetLightClientBootstrap_Capella(t *testing.T) { - helpers.ClearCache() - slot := primitives.Slot(params.BeaconConfig().CapellaForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) - - b := util.NewBeaconBlockCapella() - b.Block.StateRoot = bytesutil.PadTo([]byte("foo"), 32) - b.Block.Slot = slot + blockHeader, err := l.Block.Header() + require.NoError(t, err) + require.Equal(t, hexutil.Encode(blockHeader.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.Equal(t, strconv.FormatUint(uint64(blockHeader.Header.Slot), 10), respHeader.Beacon.Slot) - signedBlock, err := blocks.NewSignedBeaconBlock(b) + require.NotNil(t, resp.Data.CurrentSyncCommittee) + require.NotNil(t, resp.Data.CurrentSyncCommitteeBranch) - require.NoError(t, err) - header, err := signedBlock.Header() - require.NoError(t, err) +} - r, err := b.Block.HashTreeRoot() - require.NoError(t, err) +func TestLightClientHandler_GetLightClientBootstrap_Capella(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestCapella(false) // result is same for true and false - bs, err := util.NewBeaconStateCapella(func(state *ethpb.BeaconStateCapella) error { - state.BlockRoots[0] = r[:] - return nil - }) + slot := l.State.Slot() + stateRoot, err := l.State.HashTreeRoot(l.Ctx) require.NoError(t, err) - require.NoError(t, bs.SetSlot(slot)) - require.NoError(t, bs.SetLatestBlockHeader(header.Header)) - - mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} + mockBlocker := &testutil.MockBlocker{BlockToReturn: l.Block} mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ - slot: bs, + slot: l.State, }}, Blocker: mockBlocker, HeadFetcher: mockChainService, } request := httptest.NewRequest("GET", "http://foo.com/", nil) - request.SetPathValue("block_root", hexutil.Encode(r[:])) + request.SetPathValue("block_root", hexutil.Encode(stateRoot[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -123,51 +92,38 @@ func TestLightClientHandler_GetLightClientBootstrap_Capella(t *testing.T) { var resp structs.LightClientBootstrapResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) - var respHeader structs.LightClientHeaderCapella + var respHeader structs.LightClientHeader err = json.Unmarshal(resp.Data.Header, &respHeader) require.NoError(t, err) require.Equal(t, "capella", resp.Version) - require.Equal(t, hexutil.Encode(header.Header.BodyRoot), respHeader.Beacon.BodyRoot) - require.NotNil(t, resp.Data) -} - -func TestLightClientHandler_GetLightClientBootstrap_Deneb(t *testing.T) { - helpers.ClearCache() - slot := primitives.Slot(params.BeaconConfig().DenebForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) - - b := util.NewBeaconBlockDeneb() - b.Block.StateRoot = bytesutil.PadTo([]byte("foo"), 32) - b.Block.Slot = slot - - signedBlock, err := blocks.NewSignedBeaconBlock(b) + blockHeader, err := l.Block.Header() require.NoError(t, err) - header, err := signedBlock.Header() - require.NoError(t, err) + require.Equal(t, hexutil.Encode(blockHeader.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.Equal(t, strconv.FormatUint(uint64(blockHeader.Header.Slot), 10), respHeader.Beacon.Slot) - r, err := b.Block.HashTreeRoot() - require.NoError(t, err) + require.NotNil(t, resp.Data.CurrentSyncCommittee) + require.NotNil(t, resp.Data.CurrentSyncCommitteeBranch) +} - bs, err := util.NewBeaconStateDeneb(func(state *ethpb.BeaconStateDeneb) error { - state.BlockRoots[0] = r[:] - return nil - }) - require.NoError(t, err) +func TestLightClientHandler_GetLightClientBootstrap_Deneb(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestDeneb(false) // result is same for true and false - require.NoError(t, bs.SetSlot(slot)) - require.NoError(t, bs.SetLatestBlockHeader(header.Header)) + slot := l.State.Slot() + stateRoot, err := l.State.HashTreeRoot(l.Ctx) + require.NoError(t, err) - mockBlocker := &testutil.MockBlocker{BlockToReturn: signedBlock} + mockBlocker := &testutil.MockBlocker{BlockToReturn: l.Block} mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} s := &Server{ Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ - slot: bs, + slot: l.State, }}, Blocker: mockBlocker, HeadFetcher: mockChainService, } request := httptest.NewRequest("GET", "http://foo.com/", nil) - request.SetPathValue("block_root", hexutil.Encode(r[:])) + request.SetPathValue("block_root", hexutil.Encode(stateRoot[:])) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} @@ -176,12 +132,18 @@ func TestLightClientHandler_GetLightClientBootstrap_Deneb(t *testing.T) { var resp structs.LightClientBootstrapResponse err = json.Unmarshal(writer.Body.Bytes(), &resp) require.NoError(t, err) - var respHeader structs.LightClientHeaderDeneb + var respHeader structs.LightClientHeader err = json.Unmarshal(resp.Data.Header, &respHeader) require.NoError(t, err) require.Equal(t, "deneb", resp.Version) - require.Equal(t, hexutil.Encode(header.Header.BodyRoot), respHeader.Beacon.BodyRoot) - require.NotNil(t, resp.Data) + + blockHeader, err := l.Block.Header() + require.NoError(t, err) + require.Equal(t, hexutil.Encode(blockHeader.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.Equal(t, strconv.FormatUint(uint64(blockHeader.Header.Slot), 10), respHeader.Beacon.Slot) + + require.NotNil(t, resp.Data.CurrentSyncCommittee) + require.NotNil(t, resp.Data.CurrentSyncCommitteeBranch) } func TestLightClientHandler_GetLightClientUpdatesByRangeAltair(t *testing.T) { diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index 81a551d15750..a8b6632d4f40 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -7,10 +7,9 @@ import ( "reflect" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/proto/migration" lightclient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" - consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" - "github.com/prysmaticlabs/prysm/v5/encoding/ssz" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/ethereum/go-ethereum/common/hexutil" @@ -18,44 +17,26 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" - "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" v2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" "github.com/prysmaticlabs/prysm/v5/time/slots" ) -func createLightClientBootstrap(ctx context.Context, state state.BeaconState, blk interfaces.ReadOnlyBeaconBlock) (*structs.LightClientBootstrap, error) { +func createLightClientBootstrap(ctx context.Context, state state.BeaconState, blk interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientBootstrap, error) { switch blk.Version() { case version.Phase0: return nil, fmt.Errorf("light client bootstrap is not supported for phase0") case version.Altair, version.Bellatrix: - return createLightClientBootstrapAltair(ctx, state) + return createLightClientBootstrapAltair(ctx, state, blk) case version.Capella: return createLightClientBootstrapCapella(ctx, state, blk) - case version.Deneb, version.Electra: + case version.Deneb: return createLightClientBootstrapDeneb(ctx, state, blk) } return nil, fmt.Errorf("unsupported block version %s", version.String(blk.Version())) } -// createLightClientBootstrapAltair - implements https://github.com/ethereum/consensus-specs/blob/3d235740e5f1e641d3b160c8688f26e7dc5a1894/specs/altair/light-client/full-node.md#create_light_client_bootstrap -// def create_light_client_bootstrap(state: BeaconState) -> LightClientBootstrap: -// -// assert compute_epoch_at_slot(state.slot) >= ALTAIR_FORK_EPOCH -// assert state.slot == state.latest_block_header.slot -// -// return LightClientBootstrap( -// header=BeaconBlockHeader( -// slot=state.latest_block_header.slot, -// proposer_index=state.latest_block_header.proposer_index, -// parent_root=state.latest_block_header.parent_root, -// state_root=hash_tree_root(state), -// body_root=state.latest_block_header.body_root, -// ), -// current_sync_committee=state.current_sync_committee, -// current_sync_committee_branch=compute_merkle_proof_for_state(state, CURRENT_SYNC_COMMITTEE_INDEX) -// ) -func createLightClientBootstrapAltair(ctx context.Context, state state.BeaconState) (*structs.LightClientBootstrap, error) { +func createLightClientBootstrapAltair(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientBootstrap, error) { // assert compute_epoch_at_slot(state.slot) >= ALTAIR_FORK_EPOCH if slots.ToEpoch(state.Slot()) < params.BeaconConfig().AltairForkEpoch { return nil, fmt.Errorf("light client bootstrap is not supported before Altair, invalid slot %d", state.Slot()) @@ -67,55 +48,62 @@ func createLightClientBootstrapAltair(ctx context.Context, state state.BeaconSta return nil, fmt.Errorf("state slot %d not equal to latest block header slot %d", state.Slot(), latestBlockHeader.Slot) } - // Prepare data - currentSyncCommittee, err := state.CurrentSyncCommittee() + // header.state_root = hash_tree_root(state) + stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, errors.Wrap(err, "could not get current sync committee") + return nil, errors.Wrap(err, "could not get state root") } + latestBlockHeader.StateRoot = stateRoot[:] - committee := structs.SyncCommitteeFromConsensus(currentSyncCommittee) - - currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) + // assert hash_tree_root(header) == hash_tree_root(block.message) + latestBlockHeaderRoot, err := latestBlockHeader.HashTreeRoot() if err != nil { - return nil, errors.Wrap(err, "could not get current sync committee proof") + return nil, errors.Wrap(err, "could not get latest block header root") } - - branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) - for i, proof := range currentSyncCommitteeProof { - branch[i] = hexutil.Encode(proof) - } - - beacon := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) - if beacon == nil { - return nil, fmt.Errorf("could not get beacon block header") + beaconBlockRoot, err := block.Block().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get block root") } - header := &structs.LightClientHeader{ - Beacon: beacon, + if latestBlockHeaderRoot != beaconBlockRoot { + return nil, fmt.Errorf("latest block header root %#x not equal to block root %#x", latestBlockHeaderRoot, beaconBlockRoot) } - // Above shared util function won't calculate state root, so we need to do it manually - stateRoot, err := state.HashTreeRoot(ctx) + lightClientHeader, err := lightclient.BlockToLightClientHeaderAltair(block) if err != nil { - return nil, errors.Wrap(err, "could not get state root") + return nil, errors.Wrap(err, "could not convert block to light client header") } - header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) - headerJson, err := json.Marshal(header) + apiLightClientHeader := &structs.LightClientHeader{ + Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(lightClientHeader.Beacon)), + } + + headerJSON, err := json.Marshal(apiLightClientHeader) if err != nil { return nil, errors.Wrap(err, "could not convert header to raw message") } + currentSyncCommittee, err := state.CurrentSyncCommittee() + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee") + } + currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee proof") + } - // Return result + branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + for i, proof := range currentSyncCommitteeProof { + branch[i] = hexutil.Encode(proof) + } result := &structs.LightClientBootstrap{ - Header: headerJson, - CurrentSyncCommittee: committee, + Header: headerJSON, + CurrentSyncCommittee: structs.SyncCommitteeFromConsensus(currentSyncCommittee), CurrentSyncCommitteeBranch: branch, } return result, nil } -func createLightClientBootstrapCapella(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlyBeaconBlock) (*structs.LightClientBootstrap, error) { +func createLightClientBootstrapCapella(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientBootstrap, error) { // assert compute_epoch_at_slot(state.slot) >= CAPELLA_FORK_EPOCH if slots.ToEpoch(state.Slot()) < params.BeaconConfig().CapellaForkEpoch { return nil, fmt.Errorf("creating Capella light client bootstrap is not supported before Capella, invalid slot %d", state.Slot()) @@ -127,111 +115,62 @@ func createLightClientBootstrapCapella(ctx context.Context, state state.BeaconSt return nil, fmt.Errorf("state slot %d not equal to latest block header slot %d", state.Slot(), latestBlockHeader.Slot) } - // Prepare data - currentSyncCommittee, err := state.CurrentSyncCommittee() + // header.state_root = hash_tree_root(state) + stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, errors.Wrap(err, "could not get current sync committee") + return nil, errors.Wrap(err, "could not get state root") } + latestBlockHeader.StateRoot = stateRoot[:] - committee := structs.SyncCommitteeFromConsensus(currentSyncCommittee) - - currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) + // assert hash_tree_root(header) == hash_tree_root(block.message) + latestBlockHeaderRoot, err := latestBlockHeader.HashTreeRoot() if err != nil { - return nil, errors.Wrap(err, "could not get current sync committee proof") + return nil, errors.Wrap(err, "could not get latest block header root") + } + beaconBlockRoot, err := block.Block().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get block root") + } + if latestBlockHeaderRoot != beaconBlockRoot { + return nil, fmt.Errorf("latest block header root %#x not equal to block root %#x", latestBlockHeaderRoot, beaconBlockRoot) } - branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) - for i, proof := range currentSyncCommitteeProof { - branch[i] = hexutil.Encode(proof) + lightClientHeader, err := lightclient.BlockToLightClientHeaderCapella(ctx, block) + if err != nil { + return nil, errors.Wrap(err, "could not convert block to light client header") } - beacon := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) + apiLightClientHeader := &structs.LightClientHeader{ + Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(lightClientHeader.Beacon)), + } - payloadInterface, err := block.Body().Execution() + headerJSON, err := json.Marshal(apiLightClientHeader) if err != nil { - return nil, errors.Wrap(err, "could not get execution payload") + return nil, errors.Wrap(err, "could not convert header to raw message") } - transactionsRoot, err := payloadInterface.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - transactions, err := payloadInterface.Transactions() - if err != nil { - return nil, errors.Wrap(err, "could not get transactions") - } - transactionsRootArray, err := ssz.TransactionsRoot(transactions) - if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - transactionsRoot = transactionsRootArray[:] - } else if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - withdrawals, err := payloadInterface.Withdrawals() - if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals") - } - withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) - if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals root") - } - withdrawalsRoot = withdrawalsRootArray[:] - } - executionPayloadHeader := &structs.ExecutionPayloadHeaderCapella{ - ParentHash: hexutil.Encode(payloadInterface.ParentHash()), - FeeRecipient: hexutil.Encode(payloadInterface.FeeRecipient()), - StateRoot: hexutil.Encode(payloadInterface.StateRoot()), - ReceiptsRoot: hexutil.Encode(payloadInterface.ReceiptsRoot()), - LogsBloom: hexutil.Encode(payloadInterface.LogsBloom()), - PrevRandao: hexutil.Encode(payloadInterface.PrevRandao()), - BlockNumber: hexutil.EncodeUint64(payloadInterface.BlockNumber()), - GasLimit: hexutil.EncodeUint64(payloadInterface.GasLimit()), - GasUsed: hexutil.EncodeUint64(payloadInterface.GasUsed()), - Timestamp: hexutil.EncodeUint64(payloadInterface.Timestamp()), - ExtraData: hexutil.Encode(payloadInterface.ExtraData()), - BaseFeePerGas: hexutil.Encode(payloadInterface.BaseFeePerGas()), - BlockHash: hexutil.Encode(payloadInterface.BlockHash()), - TransactionsRoot: hexutil.Encode(transactionsRoot), - WithdrawalsRoot: hexutil.Encode(withdrawalsRoot), - } - - executionPayloadProof, err := blocks.PayloadProof(ctx, block) + currentSyncCommittee, err := state.CurrentSyncCommittee() if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - executionPayloadProofStr := make([]string, len(executionPayloadProof)) - for i, proof := range executionPayloadProof { - executionPayloadProofStr[i] = hexutil.Encode(proof) - } - header := &structs.LightClientHeaderCapella{ - Beacon: beacon, - Execution: executionPayloadHeader, - ExecutionBranch: executionPayloadProofStr, + return nil, errors.Wrap(err, "could not get current sync committee") } - - // Above shared util function won't calculate state root, so we need to do it manually - stateRoot, err := state.HashTreeRoot(ctx) + currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) if err != nil { - return nil, errors.Wrap(err, "could not get state root") + return nil, errors.Wrap(err, "could not get current sync committee proof") } - header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) - headerJson, err := json.Marshal(header) - if err != nil { - return nil, errors.Wrap(err, "could not convert header to raw message") + branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + for i, proof := range currentSyncCommitteeProof { + branch[i] = hexutil.Encode(proof) } - - // Return result result := &structs.LightClientBootstrap{ - Header: headerJson, - CurrentSyncCommittee: committee, + Header: headerJSON, + CurrentSyncCommittee: structs.SyncCommitteeFromConsensus(currentSyncCommittee), CurrentSyncCommitteeBranch: branch, } return result, nil } -func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlyBeaconBlock) (*structs.LightClientBootstrap, error) { +func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconState, block interfaces.ReadOnlySignedBeaconBlock) (*structs.LightClientBootstrap, error) { // assert compute_epoch_at_slot(state.slot) >= DENEB_FORK_EPOCH if slots.ToEpoch(state.Slot()) < params.BeaconConfig().DenebForkEpoch { return nil, fmt.Errorf("creating Deneb light client bootstrap is not supported before Deneb, invalid slot %d", state.Slot()) @@ -243,103 +182,55 @@ func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconStat return nil, fmt.Errorf("state slot %d not equal to latest block header slot %d", state.Slot(), latestBlockHeader.Slot) } - // Prepare data - currentSyncCommittee, err := state.CurrentSyncCommittee() + // header.state_root = hash_tree_root(state) + stateRoot, err := state.HashTreeRoot(ctx) if err != nil { - return nil, errors.Wrap(err, "could not get current sync committee") + return nil, errors.Wrap(err, "could not get state root") } + latestBlockHeader.StateRoot = stateRoot[:] - committee := structs.SyncCommitteeFromConsensus(currentSyncCommittee) - - currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) + // assert hash_tree_root(header) == hash_tree_root(block.message) + latestBlockHeaderRoot, err := latestBlockHeader.HashTreeRoot() if err != nil { - return nil, errors.Wrap(err, "could not get current sync committee proof") + return nil, errors.Wrap(err, "could not get latest block header root") + } + beaconBlockRoot, err := block.Block().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not get block root") + } + if latestBlockHeaderRoot != beaconBlockRoot { + return nil, fmt.Errorf("latest block header root %#x not equal to block root %#x", latestBlockHeaderRoot, beaconBlockRoot) } - branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) - for i, proof := range currentSyncCommitteeProof { - branch[i] = hexutil.Encode(proof) + lightClientHeader, err := lightclient.BlockToLightClientHeaderDeneb(ctx, block) + if err != nil { + return nil, errors.Wrap(err, "could not convert block to light client header") } - beacon := structs.BeaconBlockHeaderFromConsensus(latestBlockHeader) + apiLightClientHeader := &structs.LightClientHeader{ + Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(lightClientHeader.Beacon)), + } - payloadInterface, err := block.Body().Execution() + headerJSON, err := json.Marshal(apiLightClientHeader) if err != nil { - return nil, errors.Wrap(err, "could not get execution payload") + return nil, errors.Wrap(err, "could not convert header to raw message") } - transactionsRoot, err := payloadInterface.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - transactions, err := payloadInterface.Transactions() - if err != nil { - return nil, errors.Wrap(err, "could not get transactions") - } - transactionsRootArray, err := ssz.TransactionsRoot(transactions) - if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - transactionsRoot = transactionsRootArray[:] - } else if err != nil { - return nil, errors.Wrap(err, "could not get transactions root") - } - withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { - withdrawals, err := payloadInterface.Withdrawals() - if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals") - } - withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) - if err != nil { - return nil, errors.Wrap(err, "could not get withdrawals root") - } - withdrawalsRoot = withdrawalsRootArray[:] - } - executionPayloadHeader := &structs.ExecutionPayloadHeaderDeneb{ - ParentHash: hexutil.Encode(payloadInterface.ParentHash()), - FeeRecipient: hexutil.Encode(payloadInterface.FeeRecipient()), - StateRoot: hexutil.Encode(payloadInterface.StateRoot()), - ReceiptsRoot: hexutil.Encode(payloadInterface.ReceiptsRoot()), - LogsBloom: hexutil.Encode(payloadInterface.LogsBloom()), - PrevRandao: hexutil.Encode(payloadInterface.PrevRandao()), - BlockNumber: hexutil.EncodeUint64(payloadInterface.BlockNumber()), - GasLimit: hexutil.EncodeUint64(payloadInterface.GasLimit()), - GasUsed: hexutil.EncodeUint64(payloadInterface.GasUsed()), - Timestamp: hexutil.EncodeUint64(payloadInterface.Timestamp()), - ExtraData: hexutil.Encode(payloadInterface.ExtraData()), - BaseFeePerGas: hexutil.Encode(payloadInterface.BaseFeePerGas()), - BlockHash: hexutil.Encode(payloadInterface.BlockHash()), - TransactionsRoot: hexutil.Encode(transactionsRoot), - WithdrawalsRoot: hexutil.Encode(withdrawalsRoot), - } - - executionPayloadProof, err := blocks.PayloadProof(ctx, block) + currentSyncCommittee, err := state.CurrentSyncCommittee() if err != nil { - return nil, errors.Wrap(err, "could not get execution payload proof") - } - executionPayloadProofStr := make([]string, len(executionPayloadProof)) - for i, proof := range executionPayloadProof { - executionPayloadProofStr[i] = hexutil.Encode(proof) - } - header := &structs.LightClientHeaderDeneb{ - Beacon: beacon, - Execution: executionPayloadHeader, - ExecutionBranch: executionPayloadProofStr, + return nil, errors.Wrap(err, "could not get current sync committee") } - - // Above shared util function won't calculate state root, so we need to do it manually - stateRoot, err := state.HashTreeRoot(ctx) + currentSyncCommitteeProof, err := state.CurrentSyncCommitteeProof(ctx) if err != nil { - return nil, errors.Wrap(err, "could not get state root") + return nil, errors.Wrap(err, "could not get current sync committee proof") } - header.Beacon.StateRoot = hexutil.Encode(stateRoot[:]) - headerJson, err := json.Marshal(header) - if err != nil { - return nil, errors.Wrap(err, "could not convert header to raw message") + branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + for i, proof := range currentSyncCommitteeProof { + branch[i] = hexutil.Encode(proof) } - // Return result result := &structs.LightClientBootstrap{ - Header: headerJson, - CurrentSyncCommittee: committee, + Header: headerJSON, + CurrentSyncCommittee: structs.SyncCommitteeFromConsensus(currentSyncCommittee), CurrentSyncCommitteeBranch: branch, } From 3824e8a46333e68fd7dab7b8e2dfea094ebfa2a0 Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:59:07 +0200 Subject: [PATCH 310/325] Make block_to_lightclient_header_XXX functions private (#14502) * make block to lightclient header functions private * changelog * fix `helpers.go` --------- Co-authored-by: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Co-authored-by: rupam-04 --- CHANGELOG.md | 2 +- beacon-chain/core/light-client/lightclient.go | 14 +++---- .../core/light-client/lightclient_test.go | 38 ++++++++++--------- beacon-chain/rpc/eth/light-client/helpers.go | 9 +++-- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3de04e900bb..fb0680351875 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: Implement `ComputeFieldRootsForBlockBody`. - Light client support: Add light client database changes. - Light client support: Implement capella and deneb changes. -- Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb +- Light client support: Implement `BlockToLightClientHeader` function. - GetBeaconStateV2: add Electra case. - Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875) - Tests to ensure sepolia config matches the official upstream yaml diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index 3ae0a7fb2387..8af89d2b7893 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -302,7 +302,7 @@ func ComputeWithdrawalsRoot(payload interfaces.ExecutionData) ([]byte, error) { func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderContainer, error) { switch block.Version() { case version.Altair, version.Bellatrix: - altairHeader, err := BlockToLightClientHeaderAltair(block) + altairHeader, err := blockToLightClientHeaderAltair(block) if err != nil { return nil, errors.Wrap(err, "could not get header") } @@ -312,7 +312,7 @@ func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethp }, }, nil case version.Capella: - capellaHeader, err := BlockToLightClientHeaderCapella(context.Background(), block) + capellaHeader, err := blockToLightClientHeaderCapella(context.Background(), block) if err != nil { return nil, errors.Wrap(err, "could not get capella header") } @@ -322,7 +322,7 @@ func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethp }, }, nil case version.Deneb: - denebHeader, err := BlockToLightClientHeaderDeneb(context.Background(), block) + denebHeader, err := blockToLightClientHeaderDeneb(context.Background(), block) if err != nil { return nil, errors.Wrap(err, "could not get deneb header") } @@ -336,9 +336,7 @@ func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethp } } -// TODO: make below functions private - -func BlockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeader, error) { +func blockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeader, error) { if block.Version() != version.Altair { return nil, fmt.Errorf("block version is %s instead of Altair", version.String(block.Version())) } @@ -361,7 +359,7 @@ func BlockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) }, nil } -func BlockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderCapella, error) { +func blockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderCapella, error) { if block.Version() != version.Capella { return nil, fmt.Errorf("block version is %s instead of Capella", version.String(block.Version())) } @@ -423,7 +421,7 @@ func BlockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadO }, nil } -func BlockToLightClientHeaderDeneb(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderDeneb, error) { +func blockToLightClientHeaderDeneb(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderDeneb, error) { if block.Version() != version.Deneb { return nil, fmt.Errorf("block version is %s instead of Deneb", version.String(block.Version())) } diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index 4d2bbb5f4846..8c5623a83825 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -5,13 +5,12 @@ import ( "github.com/pkg/errors" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" - consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" + consensustypes "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/encoding/ssz" v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" lightClient "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" - light_client "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/light-client" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" ) @@ -126,7 +125,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { payloadInterface, err := l.FinalizedBlock.Block().Body().Execution() require.NoError(t, err) transactionsRoot, err := payloadInterface.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { + if errors.Is(err, consensustypes.ErrUnsupportedField) { transactions, err := payloadInterface.Transactions() require.NoError(t, err) transactionsRootArray, err := ssz.TransactionsRoot(transactions) @@ -136,7 +135,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { require.NoError(t, err) } withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { + if errors.Is(err, consensustypes.ErrUnsupportedField) { withdrawals, err := payloadInterface.Withdrawals() require.NoError(t, err) withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) @@ -231,7 +230,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { payloadInterface, err := l.FinalizedBlock.Block().Body().Execution() require.NoError(t, err) transactionsRoot, err := payloadInterface.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { + if errors.Is(err, consensustypes.ErrUnsupportedField) { transactions, err := payloadInterface.Transactions() require.NoError(t, err) transactionsRootArray, err := ssz.TransactionsRoot(transactions) @@ -241,7 +240,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { require.NoError(t, err) } withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { + if errors.Is(err, consensustypes.ErrUnsupportedField) { withdrawals, err := payloadInterface.Withdrawals() require.NoError(t, err) withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) @@ -303,7 +302,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { payloadInterface, err := l.FinalizedBlock.Block().Body().Execution() require.NoError(t, err) transactionsRoot, err := payloadInterface.TransactionsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { + if errors.Is(err, consensustypes.ErrUnsupportedField) { transactions, err := payloadInterface.Transactions() require.NoError(t, err) transactionsRootArray, err := ssz.TransactionsRoot(transactions) @@ -313,7 +312,7 @@ func TestLightClient_NewLightClientFinalityUpdateFromBeaconState(t *testing.T) { require.NoError(t, err) } withdrawalsRoot, err := payloadInterface.WithdrawalsRoot() - if errors.Is(err, consensus_types.ErrUnsupportedField) { + if errors.Is(err, consensustypes.ErrUnsupportedField) { withdrawals, err := payloadInterface.Withdrawals() require.NoError(t, err) withdrawalsRootArray, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) @@ -348,8 +347,9 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { t.Run("Altair", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestAltair() - header, err := lightClient.BlockToLightClientHeaderAltair(l.Block) + container, err := lightClient.BlockToLightClientHeader(l.Block) require.NoError(t, err) + header := container.GetHeaderAltair() require.NotNil(t, header, "header is nil") parentRoot := l.Block.Block().ParentRoot() @@ -368,8 +368,9 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { t.Run("Non-Blinded Beacon Block", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestCapella(false) - header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) + container, err := lightClient.BlockToLightClientHeader(l.Block) require.NoError(t, err) + header := container.GetHeaderCapella() require.NotNil(t, header, "header is nil") parentRoot := l.Block.Block().ParentRoot() @@ -380,10 +381,10 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { payload, err := l.Block.Block().Body().Execution() require.NoError(t, err) - transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) + transactionsRoot, err := lightClient.ComputeTransactionsRoot(payload) require.NoError(t, err) - withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) + withdrawalsRoot, err := lightClient.ComputeWithdrawalsRoot(payload) require.NoError(t, err) executionHeader := &v11.ExecutionPayloadHeaderCapella{ @@ -421,8 +422,9 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { t.Run("Blinded Beacon Block", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestCapella(true) - header, err := lightClient.BlockToLightClientHeaderCapella(l.Ctx, l.Block) + container, err := lightClient.BlockToLightClientHeader(l.Block) require.NoError(t, err) + header := container.GetHeaderCapella() require.NotNil(t, header, "header is nil") parentRoot := l.Block.Block().ParentRoot() @@ -476,8 +478,9 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { t.Run("Non-Blinded Beacon Block", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestDeneb(false) - header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) + container, err := lightClient.BlockToLightClientHeader(l.Block) require.NoError(t, err) + header := container.GetHeaderDeneb() require.NotNil(t, header, "header is nil") parentRoot := l.Block.Block().ParentRoot() @@ -488,10 +491,10 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { payload, err := l.Block.Block().Body().Execution() require.NoError(t, err) - transactionsRoot, err := light_client.ComputeTransactionsRoot(payload) + transactionsRoot, err := lightClient.ComputeTransactionsRoot(payload) require.NoError(t, err) - withdrawalsRoot, err := light_client.ComputeWithdrawalsRoot(payload) + withdrawalsRoot, err := lightClient.ComputeWithdrawalsRoot(payload) require.NoError(t, err) blobGasUsed, err := payload.BlobGasUsed() @@ -537,8 +540,9 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { t.Run("Blinded Beacon Block", func(t *testing.T) { l := util.NewTestLightClient(t).SetupTestDeneb(true) - header, err := lightClient.BlockToLightClientHeaderDeneb(l.Ctx, l.Block) + container, err := lightClient.BlockToLightClientHeader(l.Block) require.NoError(t, err) + header := container.GetHeaderDeneb() require.NotNil(t, header, "header is nil") parentRoot := l.Block.Block().ParentRoot() diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index a8b6632d4f40..c9750c448fa4 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -68,10 +68,11 @@ func createLightClientBootstrapAltair(ctx context.Context, state state.BeaconSta return nil, fmt.Errorf("latest block header root %#x not equal to block root %#x", latestBlockHeaderRoot, beaconBlockRoot) } - lightClientHeader, err := lightclient.BlockToLightClientHeaderAltair(block) + lightClientHeaderContainer, err := lightclient.BlockToLightClientHeader(block) if err != nil { return nil, errors.Wrap(err, "could not convert block to light client header") } + lightClientHeader := lightClientHeaderContainer.GetHeaderAltair() apiLightClientHeader := &structs.LightClientHeader{ Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(lightClientHeader.Beacon)), @@ -135,10 +136,11 @@ func createLightClientBootstrapCapella(ctx context.Context, state state.BeaconSt return nil, fmt.Errorf("latest block header root %#x not equal to block root %#x", latestBlockHeaderRoot, beaconBlockRoot) } - lightClientHeader, err := lightclient.BlockToLightClientHeaderCapella(ctx, block) + lightClientHeaderContainer, err := lightclient.BlockToLightClientHeader(block) if err != nil { return nil, errors.Wrap(err, "could not convert block to light client header") } + lightClientHeader := lightClientHeaderContainer.GetHeaderCapella() apiLightClientHeader := &structs.LightClientHeader{ Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(lightClientHeader.Beacon)), @@ -202,10 +204,11 @@ func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconStat return nil, fmt.Errorf("latest block header root %#x not equal to block root %#x", latestBlockHeaderRoot, beaconBlockRoot) } - lightClientHeader, err := lightclient.BlockToLightClientHeaderDeneb(ctx, block) + lightClientHeaderContainer, err := lightclient.BlockToLightClientHeader(block) if err != nil { return nil, errors.Wrap(err, "could not convert block to light client header") } + lightClientHeader := lightClientHeaderContainer.GetHeaderDeneb() apiLightClientHeader := &structs.LightClientHeader{ Beacon: structs.BeaconBlockHeaderFromConsensus(migration.V1HeaderToV1Alpha1(lightClientHeader.Beacon)), From cf4ffc97e23449624878d6b83654626cca723d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 4 Oct 2024 10:21:08 +0200 Subject: [PATCH 311/325] Update block Beacon APIs to Electra (#14488) * Update block Beacon APIs to Electra * CHANGELOG * Revert "Auxiliary commit to revert individual files from 9bf238279a696dbcd65440606b0e3173f3be5e05" This reverts commit a7ef57a2532f9ee02831d180926f7b84f5104a2b. * review --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- CHANGELOG.md | 1 + api/server/structs/conversions_block.go | 2 + beacon-chain/rpc/eth/beacon/handlers_test.go | 83 ++++ .../rpc/eth/validator/handlers_block.go | 83 ++++ .../rpc/eth/validator/handlers_block_test.go | 366 ++++++++++++++++++ proto/prysm/v1alpha1/BUILD.bazel | 3 +- proto/prysm/v1alpha1/electra.ssz.go | 211 +++++++++- 7 files changed, 747 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0680351875..d79ee496a887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875) - Tests to ensure sepolia config matches the official upstream yaml - HTTP endpoint for PublishBlobs +- GetBlockV2, GetBlindedBlock, ProduceBlockV2, ProduceBlockV3: add Electra case. ### Changed diff --git a/api/server/structs/conversions_block.go b/api/server/structs/conversions_block.go index 961e7170316e..de61ed3bda9a 100644 --- a/api/server/structs/conversions_block.go +++ b/api/server/structs/conversions_block.go @@ -2554,6 +2554,8 @@ func SignedBeaconBlockMessageJsoner(block interfaces.ReadOnlySignedBeaconBlock) return SignedBlindedBeaconBlockDenebFromConsensus(pbStruct) case *eth.SignedBeaconBlockDeneb: return SignedBeaconBlockDenebFromConsensus(pbStruct) + case *eth.SignedBlindedBeaconBlockElectra: + return SignedBlindedBeaconBlockElectraFromConsensus(pbStruct) case *eth.SignedBeaconBlockElectra: return SignedBeaconBlockElectraFromConsensus(pbStruct) default: diff --git a/beacon-chain/rpc/eth/beacon/handlers_test.go b/beacon-chain/rpc/eth/beacon/handlers_test.go index b7c170a005c6..fb96b950044c 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_test.go @@ -268,6 +268,38 @@ func TestGetBlockV2(t *testing.T) { require.NoError(t, err) assert.DeepEqual(t, blk, b) }) + t.Run("electra", func(t *testing.T) { + b := util.NewBeaconBlockElectra() + b.Block.Slot = 123 + sb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + mockBlockFetcher := &testutil.MockBlocker{BlockToReturn: sb} + mockChainService := &chainMock.ChainService{ + FinalizedRoots: map[[32]byte]bool{}, + } + s := &Server{ + OptimisticModeFetcher: mockChainService, + FinalizationFetcher: mockChainService, + Blocker: mockBlockFetcher, + } + + request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) + request.SetPathValue("block_id", "head") + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetBlockV2(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + resp := &structs.GetBlockV2Response{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) + assert.Equal(t, version.String(version.Electra), resp.Version) + sbb := &structs.SignedBeaconBlockElectra{Message: &structs.BeaconBlockElectra{}} + require.NoError(t, json.Unmarshal(resp.Data.Message, sbb.Message)) + sbb.Signature = resp.Data.Signature + blk, err := sbb.ToConsensus() + require.NoError(t, err) + assert.DeepEqual(t, blk, b) + }) t.Run("execution optimistic", func(t *testing.T) { b := util.NewBeaconBlockBellatrix() sb, err := blocks.NewSignedBeaconBlock(b) @@ -461,7 +493,29 @@ func TestGetBlockSSZV2(t *testing.T) { require.NoError(t, err) assert.DeepEqual(t, sszExpected, writer.Body.Bytes()) }) + t.Run("electra", func(t *testing.T) { + b := util.NewBeaconBlockElectra() + b.Block.Slot = 123 + sb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + + s := &Server{ + Blocker: &testutil.MockBlocker{BlockToReturn: sb}, + } + + request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil) + request.SetPathValue("block_id", "head") + request.Header.Set("Accept", api.OctetStreamMediaType) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + s.GetBlockV2(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + assert.Equal(t, version.String(version.Electra), writer.Header().Get(api.VersionHeader)) + sszExpected, err := b.MarshalSSZ() + require.NoError(t, err) + assert.DeepEqual(t, sszExpected, writer.Body.Bytes()) + }) } func TestGetBlockAttestations(t *testing.T) { @@ -759,6 +813,35 @@ func TestGetBlindedBlock(t *testing.T) { require.NoError(t, err) assert.DeepEqual(t, blk, b) }) + t.Run("electra", func(t *testing.T) { + b := util.NewBlindedBeaconBlockElectra() + sb, err := blocks.NewSignedBeaconBlock(b) + require.NoError(t, err) + + mockChainService := &chainMock.ChainService{} + s := &Server{ + OptimisticModeFetcher: mockChainService, + FinalizationFetcher: mockChainService, + Blocker: &testutil.MockBlocker{BlockToReturn: sb}, + } + + request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v1/beacon/blinded_blocks/{block_id}", nil) + request.SetPathValue("block_id", "head") + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetBlindedBlock(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + resp := &structs.GetBlockV2Response{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp)) + assert.Equal(t, version.String(version.Electra), resp.Version) + sbb := &structs.SignedBlindedBeaconBlockElectra{Message: &structs.BlindedBeaconBlockElectra{}} + require.NoError(t, json.Unmarshal(resp.Data.Message, sbb.Message)) + sbb.Signature = resp.Data.Signature + blk, err := sbb.ToConsensus() + require.NoError(t, err) + assert.DeepEqual(t, blk, b) + }) t.Run("execution optimistic", func(t *testing.T) { b := util.NewBlindedBeaconBlockBellatrix() sb, err := blocks.NewSignedBeaconBlock(b) diff --git a/beacon-chain/rpc/eth/validator/handlers_block.go b/beacon-chain/rpc/eth/validator/handlers_block.go index 32c67a971cd6..88ebda185fd3 100644 --- a/beacon-chain/rpc/eth/validator/handlers_block.go +++ b/beacon-chain/rpc/eth/validator/handlers_block.go @@ -287,6 +287,18 @@ func (s *Server) produceBlockV3(ctx context.Context, w http.ResponseWriter, r *h handleProduceDenebV3(w, isSSZ, denebBlockContents, v1alpha1resp.PayloadValue, consensusBlockValue) return } + blindedElectraBlockContents, ok := v1alpha1resp.Block.(*eth.GenericBeaconBlock_BlindedElectra) + if ok { + w.Header().Set(api.VersionHeader, version.String(version.Electra)) + handleProduceBlindedElectraV3(w, isSSZ, blindedElectraBlockContents, v1alpha1resp.PayloadValue, consensusBlockValue) + return + } + electraBlockContents, ok := v1alpha1resp.Block.(*eth.GenericBeaconBlock_Electra) + if ok { + w.Header().Set(api.VersionHeader, version.String(version.Electra)) + handleProduceElectraV3(w, isSSZ, electraBlockContents, v1alpha1resp.PayloadValue, consensusBlockValue) + return + } } func getConsensusBlockValue(ctx context.Context, blockRewardsFetcher rewards.BlockRewardsFetcher, i interface{} /* block as argument */) (string, *httputil.DefaultJsonError) { @@ -587,3 +599,74 @@ func handleProduceDenebV3( Data: jsonBytes, }) } + +func handleProduceBlindedElectraV3( + w http.ResponseWriter, + isSSZ bool, + blk *eth.GenericBeaconBlock_BlindedElectra, + executionPayloadValue string, + consensusPayloadValue string, +) { + if isSSZ { + sszResp, err := blk.BlindedElectra.MarshalSSZ() + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + httputil.WriteSsz(w, sszResp, "blindedElectraBlockContents.ssz") + return + } + blindedBlock, err := structs.BlindedBeaconBlockElectraFromConsensus(blk.BlindedElectra) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + jsonBytes, err := json.Marshal(blindedBlock) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + httputil.WriteJson(w, &structs.ProduceBlockV3Response{ + Version: version.String(version.Electra), + ExecutionPayloadBlinded: true, + ExecutionPayloadValue: executionPayloadValue, + ConsensusBlockValue: consensusPayloadValue, + Data: jsonBytes, + }) +} + +func handleProduceElectraV3( + w http.ResponseWriter, + isSSZ bool, + blk *eth.GenericBeaconBlock_Electra, + executionPayloadValue string, + consensusBlockValue string, +) { + if isSSZ { + sszResp, err := blk.Electra.MarshalSSZ() + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + httputil.WriteSsz(w, sszResp, "electraBlockContents.ssz") + return + } + + blockContents, err := structs.BeaconBlockContentsElectraFromConsensus(blk.Electra) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + jsonBytes, err := json.Marshal(blockContents) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusInternalServerError) + return + } + httputil.WriteJson(w, &structs.ProduceBlockV3Response{ + Version: version.String(version.Electra), + ExecutionPayloadBlinded: false, + ExecutionPayloadValue: executionPayloadValue, // mev not available at this point + ConsensusBlockValue: consensusBlockValue, + Data: jsonBytes, + }) +} diff --git a/beacon-chain/rpc/eth/validator/handlers_block_test.go b/beacon-chain/rpc/eth/validator/handlers_block_test.go index 9cfe0b485aa4..a87bc008b152 100644 --- a/beacon-chain/rpc/eth/validator/handlers_block_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_block_test.go @@ -308,6 +308,75 @@ func TestProduceBlockV2(t *testing.T) { assert.Equal(t, http.StatusInternalServerError, e.Code) assert.StringContains(t, "Prepared block is blinded", e.Message) }) + t.Run("Electra", func(t *testing.T) { + var block *structs.SignedBeaconBlockContentsElectra + err = json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &block) + require.NoError(t, err) + jsonBytes, err := json.Marshal(block.ToUnsigned()) + require.NoError(t, err) + + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: true, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + b, err := block.ToUnsigned().ToGeneric() + require.NoError(t, err) + b.PayloadValue = "2000" + return b, nil + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v2/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV2(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + want := fmt.Sprintf(`{"version":"electra","execution_payload_blinded":false,"execution_payload_value":"2000","consensus_block_value":"10000000000","data":%s}`, string(jsonBytes)) + body := strings.ReplaceAll(writer.Body.String(), "\n", "") + require.Equal(t, want, body) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + }) + t.Run("Blinded Electra", func(t *testing.T) { + var block *structs.SignedBlindedBeaconBlockElectra + err = json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &block) + require.NoError(t, err) + + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: true, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + return block.Message.ToGeneric() + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v2/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV2(writer, request) + assert.Equal(t, http.StatusInternalServerError, writer.Code) + e := &httputil.DefaultJsonError{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusInternalServerError, e.Code) + assert.StringContains(t, "Prepared block is blinded", e.Message) + }) t.Run("invalid query parameter slot empty", func(t *testing.T) { v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) server := &Server{ @@ -650,6 +719,76 @@ func TestProduceBlockV2SSZ(t *testing.T) { BlockRewardFetcher: rewardFetcher, } + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v2/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + request.Header.Set("Accept", api.OctetStreamMediaType) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV2(writer, request) + assert.Equal(t, http.StatusInternalServerError, writer.Code) + e := &httputil.DefaultJsonError{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusInternalServerError, e.Code) + assert.StringContains(t, "Prepared block is blinded", e.Message) + }) + t.Run("Electra", func(t *testing.T) { + var block *structs.SignedBeaconBlockContentsElectra + err = json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &block) + require.NoError(t, err) + + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: true, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + return block.ToUnsigned().ToGeneric() + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v2/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + request.Header.Set("Accept", api.OctetStreamMediaType) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV2(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + g, err := block.ToUnsigned().ToGeneric() + require.NoError(t, err) + bl, ok := g.Block.(*eth.GenericBeaconBlock_Electra) + require.Equal(t, true, ok) + ssz, err := bl.Electra.MarshalSSZ() + require.NoError(t, err) + require.Equal(t, string(ssz), writer.Body.String()) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + }) + t.Run("Blinded Electra", func(t *testing.T) { + var block *structs.SignedBlindedBeaconBlockElectra + err = json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &block) + require.NoError(t, err) + + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: true, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + return block.Message.ToGeneric() + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v2/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) request.Header.Set("Accept", api.OctetStreamMediaType) writer := httptest.NewRecorder() @@ -944,6 +1083,75 @@ func TestProduceBlindedBlock(t *testing.T) { require.Equal(t, want, body) require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader)) }) + t.Run("Electra", func(t *testing.T) { + var block *structs.SignedBeaconBlockContentsElectra + err = json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &block) + require.NoError(t, err) + + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: false, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + return block.ToUnsigned().ToGeneric() + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v1/validator/blinded_blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlindedBlock(writer, request) + assert.Equal(t, http.StatusInternalServerError, writer.Code) + e := &httputil.DefaultJsonError{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusInternalServerError, e.Code) + assert.StringContains(t, "Prepared block is not blinded", e.Message) + }) + t.Run("Blinded Electra", func(t *testing.T) { + var block *structs.SignedBlindedBeaconBlockElectra + err = json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &block) + require.NoError(t, err) + jsonBytes, err := json.Marshal(block.Message) + require.NoError(t, err) + + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: false, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + b, err := block.Message.ToGeneric() + require.NoError(t, err) + b.PayloadValue = "2000" + return b, nil + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v1/validator/blinded_blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlindedBlock(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + want := fmt.Sprintf(`{"version":"electra","execution_payload_blinded":true,"execution_payload_value":"2000","consensus_block_value":"10000000000","data":%s}`, string(jsonBytes)) + body := strings.ReplaceAll(writer.Body.String(), "\n", "") + require.Equal(t, want, body) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + }) t.Run("invalid query parameter slot empty", func(t *testing.T) { v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) server := &Server{ @@ -1309,6 +1517,82 @@ func TestProduceBlockV3(t *testing.T) { require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader)) require.Equal(t, "10000000000", writer.Header().Get(api.ConsensusBlockValueHeader)) }) + t.Run("Electra", func(t *testing.T) { + var block *structs.SignedBeaconBlockContentsElectra + err := json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &block) + require.NoError(t, err) + jsonBytes, err := json.Marshal(block.ToUnsigned()) + require.NoError(t, err) + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: false, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + b, err := block.ToUnsigned().ToGeneric() + require.NoError(t, err) + b.PayloadValue = "2000" + return b, nil + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v3/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV3(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + want := fmt.Sprintf(`{"version":"electra","execution_payload_blinded":false,"execution_payload_value":"2000","consensus_block_value":"10000000000","data":%s}`, string(jsonBytes)) + body := strings.ReplaceAll(writer.Body.String(), "\n", "") + require.Equal(t, want, body) + require.Equal(t, "false", writer.Header().Get(api.ExecutionPayloadBlindedHeader)) + require.Equal(t, "2000", writer.Header().Get(api.ExecutionPayloadValueHeader)) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + require.Equal(t, "10000000000", writer.Header().Get(api.ConsensusBlockValueHeader)) + }) + t.Run("Blinded Electra", func(t *testing.T) { + var block *structs.SignedBlindedBeaconBlockElectra + err := json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &block) + require.NoError(t, err) + jsonBytes, err := json.Marshal(block.Message) + require.NoError(t, err) + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: false, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + b, err := block.Message.ToGeneric() + require.NoError(t, err) + b.PayloadValue = "2000" + return b, nil + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v3/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV3(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + want := fmt.Sprintf(`{"version":"electra","execution_payload_blinded":true,"execution_payload_value":"2000","consensus_block_value":"10000000000","data":%s}`, string(jsonBytes)) + body := strings.ReplaceAll(writer.Body.String(), "\n", "") + require.Equal(t, want, body) + require.Equal(t, "true", writer.Header().Get(api.ExecutionPayloadBlindedHeader)) + require.Equal(t, "2000", writer.Header().Get(api.ExecutionPayloadValueHeader)) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + require.Equal(t, "10000000000", writer.Header().Get(api.ConsensusBlockValueHeader)) + }) t.Run("invalid query parameter slot empty", func(t *testing.T) { v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) server := &Server{ @@ -1697,4 +1981,86 @@ func TestProduceBlockV3SSZ(t *testing.T) { require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader)) require.Equal(t, "10000000000", writer.Header().Get(api.ConsensusBlockValueHeader)) }) + t.Run("Electra", func(t *testing.T) { + var block *structs.SignedBeaconBlockContentsElectra + err := json.Unmarshal([]byte(rpctesting.ElectraBlockContents), &block) + require.NoError(t, err) + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: false, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + b, err := block.ToUnsigned().ToGeneric() + require.NoError(t, err) + b.PayloadValue = "2000" + return b, nil + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v3/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + request.Header.Set("Accept", api.OctetStreamMediaType) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV3(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + g, err := block.ToUnsigned().ToGeneric() + require.NoError(t, err) + bl, ok := g.Block.(*eth.GenericBeaconBlock_Electra) + require.Equal(t, true, ok) + ssz, err := bl.Electra.MarshalSSZ() + require.NoError(t, err) + require.Equal(t, string(ssz), writer.Body.String()) + require.Equal(t, "false", writer.Header().Get(api.ExecutionPayloadBlindedHeader)) + require.Equal(t, "2000", writer.Header().Get(api.ExecutionPayloadValueHeader)) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + require.Equal(t, "10000000000", writer.Header().Get(api.ConsensusBlockValueHeader)) + }) + t.Run("Blinded Electra", func(t *testing.T) { + var block *structs.SignedBlindedBeaconBlockElectra + err := json.Unmarshal([]byte(rpctesting.BlindedElectraBlock), &block) + require.NoError(t, err) + v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl) + v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), ð.BlockRequest{ + Slot: 1, + RandaoReveal: bRandao, + Graffiti: bGraffiti, + SkipMevBoost: false, + }).Return( + func() (*eth.GenericBeaconBlock, error) { + b, err := block.Message.ToGeneric() + require.NoError(t, err) + b.PayloadValue = "2000" + return b, nil + }()) + server := &Server{ + V1Alpha1Server: v1alpha1Server, + SyncChecker: syncChecker, + OptimisticModeFetcher: chainService, + BlockRewardFetcher: rewardFetcher, + } + request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://foo.example/eth/v3/validator/blocks/1?randao_reveal=%s&graffiti=%s", randao, graffiti), nil) + request.Header.Set("Accept", api.OctetStreamMediaType) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + server.ProduceBlockV3(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + g, err := block.Message.ToGeneric() + require.NoError(t, err) + bl, ok := g.Block.(*eth.GenericBeaconBlock_BlindedElectra) + require.Equal(t, true, ok) + ssz, err := bl.BlindedElectra.MarshalSSZ() + require.NoError(t, err) + require.Equal(t, string(ssz), writer.Body.String()) + require.Equal(t, "true", writer.Header().Get(api.ExecutionPayloadBlindedHeader)) + require.Equal(t, "2000", writer.Header().Get(api.ExecutionPayloadValueHeader)) + require.Equal(t, "electra", writer.Header().Get(api.VersionHeader)) + require.Equal(t, "10000000000", writer.Header().Get(api.ConsensusBlockValueHeader)) + }) } diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index ddb843cddffa..a9a86e533354 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -136,7 +136,8 @@ ssz_electra_objs = [ "AggregateAttestationAndProofElectra", "AttestationElectra", "AttesterSlashingElectra", - "BeaconBlockElectra", + "BeaconBlockBodyElectra", + "BeaconBlockContentsElectra", "BeaconBlockElectra", "BeaconStateElectra", "BlindedBeaconBlockBodyElectra", diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 58c9ca4bf77b..bec6268275c2 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6d900c40d922575c27ef51a244f7bf935f56aa440017288a3405a3025d7750a6 +// Hash: 8009dff4967583f3039317182cf9c9f5c46922f00fe10c357d9d32b0a264e28b package eth import ( @@ -862,6 +862,215 @@ func (s *SignedBeaconBlockContentsElectra) HashTreeRootWith(hh *ssz.Hasher) (err return } +// MarshalSSZ ssz marshals the BeaconBlockContentsElectra object +func (b *BeaconBlockContentsElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockContentsElectra object to a target array +func (b *BeaconBlockContentsElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(12) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if b.Block == nil { + b.Block = new(BeaconBlockElectra) + } + offset += b.Block.SizeSSZ() + + // Offset (1) 'KzgProofs' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.KzgProofs) * 48 + + // Offset (2) 'Blobs' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Blobs) * 131072 + + // Field (0) 'Block' + if dst, err = b.Block.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'KzgProofs' + if size := len(b.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + for ii := 0; ii < len(b.KzgProofs); ii++ { + if size := len(b.KzgProofs[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) + return + } + dst = append(dst, b.KzgProofs[ii]...) + } + + // Field (2) 'Blobs' + if size := len(b.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + for ii := 0; ii < len(b.Blobs); ii++ { + if size := len(b.Blobs[ii]); size != 131072 { + err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) + return + } + dst = append(dst, b.Blobs[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockContentsElectra object +func (b *BeaconBlockContentsElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 12 { + return ssz.ErrSize + } + + tail := buf + var o0, o1, o2 uint64 + + // Offset (0) 'Block' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 12 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'KzgProofs' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Offset (2) 'Blobs' + if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Field (0) 'Block' + { + buf = tail[o0:o1] + if b.Block == nil { + b.Block = new(BeaconBlockElectra) + } + if err = b.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'KzgProofs' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + b.KzgProofs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.KzgProofs[ii]) == 0 { + b.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + b.KzgProofs[ii] = append(b.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (2) 'Blobs' + { + buf = tail[o2:] + num, err := ssz.DivideInt2(len(buf), 131072, 4096) + if err != nil { + return err + } + b.Blobs = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.Blobs[ii]) == 0 { + b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) + } + b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockContentsElectra object +func (b *BeaconBlockContentsElectra) SizeSSZ() (size int) { + size = 12 + + // Field (0) 'Block' + if b.Block == nil { + b.Block = new(BeaconBlockElectra) + } + size += b.Block.SizeSSZ() + + // Field (1) 'KzgProofs' + size += len(b.KzgProofs) * 48 + + // Field (2) 'Blobs' + size += len(b.Blobs) * 131072 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockContentsElectra object +func (b *BeaconBlockContentsElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockContentsElectra object with a hasher +func (b *BeaconBlockContentsElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = b.Block.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'KzgProofs' + { + if size := len(b.KzgProofs); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.KzgProofs { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.KzgProofs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (2) 'Blobs' + { + if size := len(b.Blobs); size > 4096 { + err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range b.Blobs { + if len(i) != 131072 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(b.Blobs)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the SignedBeaconBlockElectra object func (s *SignedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) From f498463843d9a7d8cb8da1c14d6a1997d16b9f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Fri, 4 Oct 2024 18:42:30 +0200 Subject: [PATCH 312/325] Register deposit snapshot endpoint (#14503) --- CHANGELOG.md | 1 + beacon-chain/rpc/BUILD.bazel | 1 + beacon-chain/rpc/endpoints.go | 9 +++++++ beacon-chain/rpc/endpoints_test.go | 32 +++++++++++-------------- beacon-chain/rpc/eth/beacon/handlers.go | 6 +---- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d79ee496a887..e9b42f0f3a67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: create finalized header based on finalizedBlock's version, not attestedBlock. - Light client support: fix light client attested header execution fields' wrong version bug. - Testing: added custom matcher for better push settings testing. +- Registered `GetDepositSnapshot` Beacon API endpoint. ### Security diff --git a/beacon-chain/rpc/BUILD.bazel b/beacon-chain/rpc/BUILD.bazel index 55e44ed1240a..dbb213a65597 100644 --- a/beacon-chain/rpc/BUILD.bazel +++ b/beacon-chain/rpc/BUILD.bazel @@ -89,5 +89,6 @@ go_test( "//testing/require:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", + "@org_golang_x_exp//maps:go_default_library", ], ) diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 0f606ea5e9c7..ff53041cc79f 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -773,6 +773,15 @@ func (s *Service) beaconEndpoints( handler: server.GetValidatorBalances, methods: []string{http.MethodGet, http.MethodPost}, }, + { + template: "/eth/v1/beacon/deposit_snapshot", + name: namespace + ".GetDepositSnapshot", + middleware: []middleware.Middleware{ + middleware.AcceptHeaderHandler([]string{api.JsonMediaType}), + }, + handler: server.GetDepositSnapshot, + methods: []string{http.MethodGet}, + }, } } diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index 0218b4a30524..ad26b9ba2e68 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -2,9 +2,11 @@ package rpc import ( "net/http" + "slices" "testing" "github.com/prysmaticlabs/prysm/v5/testing/assert" + "golang.org/x/exp/maps" ) func Test_endpoints(t *testing.T) { @@ -31,7 +33,6 @@ func Test_endpoints(t *testing.T) { "/eth/v2/beacon/blinded_blocks": {http.MethodPost}, "/eth/v1/beacon/blocks": {http.MethodPost}, "/eth/v2/beacon/blocks": {http.MethodPost}, - "/eth/v1/beacon/blocks/{block_id}": {http.MethodGet}, "/eth/v2/beacon/blocks/{block_id}": {http.MethodGet}, "/eth/v1/beacon/blocks/{block_id}/root": {http.MethodGet}, "/eth/v1/beacon/blocks/{block_id}/attestations": {http.MethodGet}, @@ -69,7 +70,6 @@ func Test_endpoints(t *testing.T) { } debugRoutes := map[string][]string{ - "/eth/v1/debug/beacon/states/{state_id}": {http.MethodGet}, "/eth/v2/debug/beacon/states/{state_id}": {http.MethodGet}, "/eth/v2/debug/beacon/heads": {http.MethodGet}, "/eth/v1/debug/fork_choice": {http.MethodGet}, @@ -134,22 +134,18 @@ func Test_endpoints(t *testing.T) { s := &Service{cfg: &Config{}} - routesMap := combineMaps(beaconRoutes, builderRoutes, configRoutes, debugRoutes, eventsRoutes, nodeRoutes, validatorRoutes, rewardsRoutes, lightClientRoutes, blobRoutes, prysmValidatorRoutes, prysmNodeRoutes, prysmBeaconRoutes) - actual := s.endpoints(true, nil, nil, nil, nil, nil, nil) - for _, e := range actual { - methods, ok := routesMap[e.template] - assert.Equal(t, true, ok, "endpoint "+e.template+" not found") - if ok { - for _, em := range e.methods { - methodFound := false - for _, m := range methods { - if m == em { - methodFound = true - break - } - } - assert.Equal(t, true, methodFound, "method "+em+" for endpoint "+e.template+" not found") - } + endpoints := s.endpoints(true, nil, nil, nil, nil, nil, nil) + actualRoutes := make(map[string][]string, len(endpoints)) + for _, e := range endpoints { + if _, ok := actualRoutes[e.template]; ok { + actualRoutes[e.template] = append(actualRoutes[e.template], e.methods...) + } else { + actualRoutes[e.template] = e.methods } } + expectedRoutes := combineMaps(beaconRoutes, builderRoutes, configRoutes, debugRoutes, eventsRoutes, nodeRoutes, validatorRoutes, rewardsRoutes, lightClientRoutes, blobRoutes, prysmValidatorRoutes, prysmNodeRoutes, prysmBeaconRoutes) + + assert.Equal(t, true, maps.EqualFunc(expectedRoutes, actualRoutes, func(actualMethods []string, expectedMethods []string) bool { + return slices.Equal(expectedMethods, actualMethods) + })) } diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index f657ab246b85..e5167752473b 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -1512,10 +1512,6 @@ func (s *Server) GetDepositSnapshot(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "beacon.GetDepositSnapshot") defer span.End() - if s.BeaconDB == nil { - httputil.HandleError(w, "Could not retrieve beaconDB", http.StatusInternalServerError) - return - } eth1data, err := s.BeaconDB.ExecutionChainData(ctx) if err != nil { httputil.HandleError(w, "Could not retrieve execution chain data: "+err.Error(), http.StatusInternalServerError) @@ -1527,7 +1523,7 @@ func (s *Server) GetDepositSnapshot(w http.ResponseWriter, r *http.Request) { } snapshot := eth1data.DepositSnapshot if snapshot == nil || len(snapshot.Finalized) == 0 { - httputil.HandleError(w, "No Finalized Snapshot Available", http.StatusNotFound) + httputil.HandleError(w, "No finalized snapshot available", http.StatusNotFound) return } if len(snapshot.Finalized) > depositsnapshot.DepositContractDepth { From c11e3392d49c154120ae655bf94da1b4f46ea4a0 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:18:17 -0500 Subject: [PATCH 313/325] SSE implementation that sheds stuck clients (#14413) * sse implementation that sheds stuck clients * Radek and James feedback * Refactor event streamer code for readability * less-flaky test signaling * test case where queue fills; fixes * add changelog entry * james and preston feedback * swap our Subscription interface with an alias * event.Data can be nil for the payload attr event * deepsource --------- Co-authored-by: Kasey Kirkham --- CHANGELOG.md | 1 + api/headers.go | 8 + api/server/structs/conversions.go | 35 + async/event/BUILD.bazel | 1 + async/event/feed.go | 1 + async/event/interface.go | 8 + async/event/subscription.go | 19 - beacon-chain/blockchain/setup_test.go | 2 +- beacon-chain/blockchain/testing/mock.go | 59 +- beacon-chain/core/feed/operation/notifier.go | 2 +- beacon-chain/core/feed/state/notifier.go | 2 +- beacon-chain/execution/service_test.go | 2 +- beacon-chain/node/node.go | 4 +- beacon-chain/rpc/eth/events/BUILD.bazel | 8 +- beacon-chain/rpc/eth/events/events.go | 739 +++++++++++-------- beacon-chain/rpc/eth/events/events_test.go | 466 ++++++------ beacon-chain/rpc/eth/events/http_test.go | 75 ++ beacon-chain/rpc/eth/events/server.go | 4 + deps.bzl | 12 + go.mod | 2 + go.sum | 5 + 21 files changed, 899 insertions(+), 556 deletions(-) create mode 100644 async/event/interface.go create mode 100644 beacon-chain/rpc/eth/events/http_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b42f0f3a67..eed6e3e46b60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Tests to ensure sepolia config matches the official upstream yaml - HTTP endpoint for PublishBlobs - GetBlockV2, GetBlindedBlock, ProduceBlockV2, ProduceBlockV3: add Electra case. +- SSE implementation that sheds stuck clients. [pr](https://github.com/prysmaticlabs/prysm/pull/14413) ### Changed diff --git a/api/headers.go b/api/headers.go index b3f7a29ab4be..69e279416c23 100644 --- a/api/headers.go +++ b/api/headers.go @@ -1,5 +1,7 @@ package api +import "net/http" + const ( VersionHeader = "Eth-Consensus-Version" ExecutionPayloadBlindedHeader = "Eth-Execution-Payload-Blinded" @@ -10,3 +12,9 @@ const ( EventStreamMediaType = "text/event-stream" KeepAlive = "keep-alive" ) + +// SetSSEHeaders sets the headers needed for a server-sent event response. +func SetSSEHeaders(w http.ResponseWriter) { + w.Header().Set("Content-Type", EventStreamMediaType) + w.Header().Set("Connection", KeepAlive) +} diff --git a/api/server/structs/conversions.go b/api/server/structs/conversions.go index b8bc72f136a7..d735910929a6 100644 --- a/api/server/structs/conversions.go +++ b/api/server/structs/conversions.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + ethv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -1508,3 +1509,37 @@ func PendingConsolidationsFromConsensus(cs []*eth.PendingConsolidation) []*Pendi } return consolidations } + +func HeadEventFromV1(event *ethv1.EventHead) *HeadEvent { + return &HeadEvent{ + Slot: fmt.Sprintf("%d", event.Slot), + Block: hexutil.Encode(event.Block), + State: hexutil.Encode(event.State), + EpochTransition: event.EpochTransition, + ExecutionOptimistic: event.ExecutionOptimistic, + PreviousDutyDependentRoot: hexutil.Encode(event.PreviousDutyDependentRoot), + CurrentDutyDependentRoot: hexutil.Encode(event.CurrentDutyDependentRoot), + } +} + +func FinalizedCheckpointEventFromV1(event *ethv1.EventFinalizedCheckpoint) *FinalizedCheckpointEvent { + return &FinalizedCheckpointEvent{ + Block: hexutil.Encode(event.Block), + State: hexutil.Encode(event.State), + Epoch: fmt.Sprintf("%d", event.Epoch), + ExecutionOptimistic: event.ExecutionOptimistic, + } +} + +func EventChainReorgFromV1(event *ethv1.EventChainReorg) *ChainReorgEvent { + return &ChainReorgEvent{ + Slot: fmt.Sprintf("%d", event.Slot), + Depth: fmt.Sprintf("%d", event.Depth), + OldHeadBlock: hexutil.Encode(event.OldHeadBlock), + NewHeadBlock: hexutil.Encode(event.NewHeadBlock), + OldHeadState: hexutil.Encode(event.OldHeadState), + NewHeadState: hexutil.Encode(event.NewHeadState), + Epoch: fmt.Sprintf("%d", event.Epoch), + ExecutionOptimistic: event.ExecutionOptimistic, + } +} diff --git a/async/event/BUILD.bazel b/async/event/BUILD.bazel index 6d32b727adf6..02ebe83ca95c 100644 --- a/async/event/BUILD.bazel +++ b/async/event/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "feed.go", + "interface.go", "subscription.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/async/event", diff --git a/async/event/feed.go b/async/event/feed.go index 1ebb581c14b0..0d44c7685750 100644 --- a/async/event/feed.go +++ b/async/event/feed.go @@ -22,3 +22,4 @@ import ( // Feed is a re-export of the go-ethereum event feed. type Feed = geth_event.Feed +type Subscription = geth_event.Subscription diff --git a/async/event/interface.go b/async/event/interface.go new file mode 100644 index 000000000000..d54f9fd32160 --- /dev/null +++ b/async/event/interface.go @@ -0,0 +1,8 @@ +package event + +// SubscriberSender is an abstract representation of an *event.Feed +// to use in describing types that accept or return an *event.Feed. +type SubscriberSender interface { + Subscribe(channel interface{}) Subscription + Send(value interface{}) (nsent int) +} diff --git a/async/event/subscription.go b/async/event/subscription.go index 087810b25d62..9ed0dfe1e854 100644 --- a/async/event/subscription.go +++ b/async/event/subscription.go @@ -28,25 +28,6 @@ import ( // request backoff time. const waitQuotient = 10 -// Subscription represents a stream of events. The carrier of the events is typically a -// channel, but isn't part of the interface. -// -// Subscriptions can fail while established. Failures are reported through an error -// channel. It receives a value if there is an issue with the subscription (e.g. the -// network connection delivering the events has been closed). Only one value will ever be -// sent. -// -// The error channel is closed when the subscription ends successfully (i.e. when the -// source of events is closed). It is also closed when Unsubscribe is called. -// -// The Unsubscribe method cancels the sending of events. You must call Unsubscribe in all -// cases to ensure that resources related to the subscription are released. It can be -// called any number of times. -type Subscription interface { - Err() <-chan error // returns the error channel - Unsubscribe() // cancels sending of events, closing the error channel -} - // NewSubscription runs a producer function as a subscription in a new goroutine. The // channel given to the producer is closed when Unsubscribe is called. If fn returns an // error, it is sent on the subscription's error channel. diff --git a/beacon-chain/blockchain/setup_test.go b/beacon-chain/blockchain/setup_test.go index 22acd22147c8..f21ddc69155d 100644 --- a/beacon-chain/blockchain/setup_test.go +++ b/beacon-chain/blockchain/setup_test.go @@ -32,7 +32,7 @@ type mockBeaconNode struct { } // StateFeed mocks the same method in the beacon node. -func (mbn *mockBeaconNode) StateFeed() *event.Feed { +func (mbn *mockBeaconNode) StateFeed() event.SubscriberSender { mbn.mu.Lock() defer mbn.mu.Unlock() if mbn.stateFeed == nil { diff --git a/beacon-chain/blockchain/testing/mock.go b/beacon-chain/blockchain/testing/mock.go index d0da4f0cd07b..0ba1be076529 100644 --- a/beacon-chain/blockchain/testing/mock.go +++ b/beacon-chain/blockchain/testing/mock.go @@ -98,6 +98,44 @@ func (s *ChainService) BlockNotifier() blockfeed.Notifier { return s.blockNotifier } +type EventFeedWrapper struct { + feed *event.Feed + subscribed chan struct{} // this channel is closed once a subscription is made +} + +func (w *EventFeedWrapper) Subscribe(channel interface{}) event.Subscription { + select { + case <-w.subscribed: + break // already closed + default: + close(w.subscribed) + } + return w.feed.Subscribe(channel) +} + +func (w *EventFeedWrapper) Send(value interface{}) int { + return w.feed.Send(value) +} + +// WaitForSubscription allows test to wait for the feed to have a subscription before beginning to send events. +func (w *EventFeedWrapper) WaitForSubscription(ctx context.Context) error { + select { + case <-w.subscribed: + return nil + case <-ctx.Done(): + return ctx.Err() + } +} + +var _ event.SubscriberSender = &EventFeedWrapper{} + +func NewEventFeedWrapper() *EventFeedWrapper { + return &EventFeedWrapper{ + feed: new(event.Feed), + subscribed: make(chan struct{}), + } +} + // MockBlockNotifier mocks the block notifier. type MockBlockNotifier struct { feed *event.Feed @@ -131,7 +169,7 @@ func (msn *MockStateNotifier) ReceivedEvents() []*feed.Event { } // StateFeed returns a state feed. -func (msn *MockStateNotifier) StateFeed() *event.Feed { +func (msn *MockStateNotifier) StateFeed() event.SubscriberSender { msn.feedLock.Lock() defer msn.feedLock.Unlock() @@ -159,6 +197,23 @@ func (msn *MockStateNotifier) StateFeed() *event.Feed { return msn.feed } +// NewSimpleStateNotifier makes a state feed without the custom mock feed machinery. +func NewSimpleStateNotifier() *MockStateNotifier { + return &MockStateNotifier{feed: new(event.Feed)} +} + +type SimpleNotifier struct { + Feed event.SubscriberSender +} + +func (n *SimpleNotifier) StateFeed() event.SubscriberSender { + return n.Feed +} + +func (n *SimpleNotifier) OperationFeed() event.SubscriberSender { + return n.Feed +} + // OperationNotifier mocks the same method in the chain service. func (s *ChainService) OperationNotifier() opfeed.Notifier { if s.opNotifier == nil { @@ -173,7 +228,7 @@ type MockOperationNotifier struct { } // OperationFeed returns an operation feed. -func (mon *MockOperationNotifier) OperationFeed() *event.Feed { +func (mon *MockOperationNotifier) OperationFeed() event.SubscriberSender { if mon.feed == nil { mon.feed = new(event.Feed) } diff --git a/beacon-chain/core/feed/operation/notifier.go b/beacon-chain/core/feed/operation/notifier.go index 798519ee848c..acfd5cf68c3b 100644 --- a/beacon-chain/core/feed/operation/notifier.go +++ b/beacon-chain/core/feed/operation/notifier.go @@ -4,5 +4,5 @@ import "github.com/prysmaticlabs/prysm/v5/async/event" // Notifier interface defines the methods of the service that provides beacon block operation updates to consumers. type Notifier interface { - OperationFeed() *event.Feed + OperationFeed() event.SubscriberSender } diff --git a/beacon-chain/core/feed/state/notifier.go b/beacon-chain/core/feed/state/notifier.go index 6ba795e73aee..f3487279ab78 100644 --- a/beacon-chain/core/feed/state/notifier.go +++ b/beacon-chain/core/feed/state/notifier.go @@ -4,5 +4,5 @@ import "github.com/prysmaticlabs/prysm/v5/async/event" // Notifier interface defines the methods of the service that provides state updates to consumers. type Notifier interface { - StateFeed() *event.Feed + StateFeed() event.SubscriberSender } diff --git a/beacon-chain/execution/service_test.go b/beacon-chain/execution/service_test.go index 32e8bc56dfa4..f32cdc54440c 100644 --- a/beacon-chain/execution/service_test.go +++ b/beacon-chain/execution/service_test.go @@ -73,7 +73,7 @@ type goodNotifier struct { MockStateFeed *event.Feed } -func (g *goodNotifier) StateFeed() *event.Feed { +func (g *goodNotifier) StateFeed() event.SubscriberSender { if g.MockStateFeed == nil { g.MockStateFeed = new(event.Feed) } diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index c6e6f510cea9..b5c735ba8957 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -398,7 +398,7 @@ func initSyncWaiter(ctx context.Context, complete chan struct{}) func() error { } // StateFeed implements statefeed.Notifier. -func (b *BeaconNode) StateFeed() *event.Feed { +func (b *BeaconNode) StateFeed() event.SubscriberSender { return b.stateFeed } @@ -408,7 +408,7 @@ func (b *BeaconNode) BlockFeed() *event.Feed { } // OperationFeed implements opfeed.Notifier. -func (b *BeaconNode) OperationFeed() *event.Feed { +func (b *BeaconNode) OperationFeed() event.SubscriberSender { return b.opFeed } diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index 640017b6b2b1..8a549d05f872 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -29,12 +29,16 @@ go_library( "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", ], ) go_test( name = "go_default_test", - srcs = ["events_test.go"], + srcs = [ + "events_test.go", + "http_test.go", + ], embed = [":go_default_library"], deps = [ "//beacon-chain/blockchain/testing:go_default_library", @@ -49,9 +53,9 @@ go_test( "//consensus-types/primitives:go_default_library", "//proto/eth/v1:go_default_library", "//proto/prysm/v1alpha1:go_default_library", - "//testing/assert:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", + "@com_github_r3labs_sse_v2//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 1c726be4591a..fe753d8714dd 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -1,11 +1,13 @@ package events import ( + "bytes" "context" "encoding/json" "fmt" + "io" "net/http" - time2 "time" + "time" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" @@ -16,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" + chaintime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" @@ -26,9 +28,13 @@ import ( eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" + log "github.com/sirupsen/logrus" ) +const DefaultEventFeedDepth = 1000 + const ( + InvalidTopic = "__invalid__" // HeadTopic represents a new chain head event topic. HeadTopic = "head" // BlockTopic represents a new produced block event topic. @@ -59,25 +65,83 @@ const ( LightClientOptimisticUpdateTopic = "light_client_optimistic_update" ) -const topicDataMismatch = "Event data type %T does not correspond to event topic %s" - -const chanBuffer = 1000 - -var casesHandled = map[string]bool{ - HeadTopic: true, - BlockTopic: true, - AttestationTopic: true, - VoluntaryExitTopic: true, - FinalizedCheckpointTopic: true, - ChainReorgTopic: true, - SyncCommitteeContributionTopic: true, - BLSToExecutionChangeTopic: true, - PayloadAttributesTopic: true, - BlobSidecarTopic: true, - ProposerSlashingTopic: true, - AttesterSlashingTopic: true, - LightClientFinalityUpdateTopic: true, - LightClientOptimisticUpdateTopic: true, +var ( + errInvalidTopicName = errors.New("invalid topic name") + errNoValidTopics = errors.New("no valid topics specified") + errSlowReader = errors.New("client failed to read fast enough to keep outgoing buffer below threshold") + errNotRequested = errors.New("event not requested by client") + errUnhandledEventData = errors.New("unable to represent event data in the event stream") +) + +// StreamingResponseWriter defines a type that can be used by the eventStreamer. +// This must be an http.ResponseWriter that supports flushing and hijacking. +type StreamingResponseWriter interface { + http.ResponseWriter + http.Flusher +} + +// The eventStreamer uses lazyReaders to defer serialization until the moment the value is ready to be written to the client. +type lazyReader func() io.Reader + +var opsFeedEventTopics = map[feed.EventType]string{ + operation.AggregatedAttReceived: AttestationTopic, + operation.UnaggregatedAttReceived: AttestationTopic, + operation.ExitReceived: VoluntaryExitTopic, + operation.SyncCommitteeContributionReceived: SyncCommitteeContributionTopic, + operation.BLSToExecutionChangeReceived: BLSToExecutionChangeTopic, + operation.BlobSidecarReceived: BlobSidecarTopic, + operation.AttesterSlashingReceived: AttesterSlashingTopic, + operation.ProposerSlashingReceived: ProposerSlashingTopic, +} + +var stateFeedEventTopics = map[feed.EventType]string{ + statefeed.NewHead: HeadTopic, + statefeed.MissedSlot: PayloadAttributesTopic, + statefeed.FinalizedCheckpoint: FinalizedCheckpointTopic, + statefeed.LightClientFinalityUpdate: LightClientFinalityUpdateTopic, + statefeed.LightClientOptimisticUpdate: LightClientOptimisticUpdateTopic, + statefeed.Reorg: ChainReorgTopic, + statefeed.BlockProcessed: BlockTopic, +} + +var topicsForStateFeed = topicsForFeed(stateFeedEventTopics) +var topicsForOpsFeed = topicsForFeed(opsFeedEventTopics) + +func topicsForFeed(em map[feed.EventType]string) map[string]bool { + topics := make(map[string]bool, len(em)) + for _, topic := range em { + topics[topic] = true + } + return topics +} + +type topicRequest struct { + topics map[string]bool + needStateFeed bool + needOpsFeed bool +} + +func (req *topicRequest) requested(topic string) bool { + return req.topics[topic] +} + +func newTopicRequest(topics []string) (*topicRequest, error) { + req := &topicRequest{topics: make(map[string]bool)} + for _, name := range topics { + if topicsForStateFeed[name] { + req.needStateFeed = true + } else if topicsForOpsFeed[name] { + req.needOpsFeed = true + } else { + return nil, errors.Wrapf(errInvalidTopicName, name) + } + req.topics[name] = true + } + if len(req.topics) == 0 || (!req.needStateFeed && !req.needOpsFeed) { + return nil, errNoValidTopics + } + + return req, nil } // StreamEvents provides an endpoint to subscribe to the beacon node Server-Sent-Events stream. @@ -88,326 +152,412 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "events.StreamEvents") defer span.End() - flusher, ok := w.(http.Flusher) - if !ok { - httputil.HandleError(w, "Streaming unsupported!", http.StatusInternalServerError) + topics, err := newTopicRequest(r.URL.Query()["topics"]) + if err != nil { + httputil.HandleError(w, err.Error(), http.StatusBadRequest) return } - topics := r.URL.Query()["topics"] - if len(topics) == 0 { - httputil.HandleError(w, "No topics specified to subscribe to", http.StatusBadRequest) + sw, ok := w.(StreamingResponseWriter) + if !ok { + msg := "beacon node misconfiguration: http stack may not support required response handling features, like flushing" + httputil.HandleError(w, msg, http.StatusInternalServerError) return } - topicsMap := make(map[string]bool) - for _, topic := range topics { - if _, ok := casesHandled[topic]; !ok { - httputil.HandleError(w, fmt.Sprintf("Invalid topic: %s", topic), http.StatusBadRequest) - return - } - topicsMap[topic] = true - } - - // Subscribe to event feeds from information received in the beacon node runtime. - opsChan := make(chan *feed.Event, chanBuffer) - opsSub := s.OperationNotifier.OperationFeed().Subscribe(opsChan) - stateChan := make(chan *feed.Event, chanBuffer) - stateSub := s.StateNotifier.StateFeed().Subscribe(stateChan) - defer opsSub.Unsubscribe() - defer stateSub.Unsubscribe() - - // Set up SSE response headers - w.Header().Set("Content-Type", api.EventStreamMediaType) - w.Header().Set("Connection", api.KeepAlive) - - // Handle each event received and context cancellation. - // We send a keepalive dummy message immediately to prevent clients - // stalling while waiting for the first response chunk. - // After that we send a keepalive dummy message every SECONDS_PER_SLOT - // to prevent anyone (e.g. proxy servers) from closing connections. - if err := sendKeepalive(w, flusher); err != nil { + depth := s.EventFeedDepth + if depth == 0 { + depth = DefaultEventFeedDepth + } + es, err := newEventStreamer(depth, s.KeepAliveInterval) + if err != nil { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) return } - keepaliveTicker := time2.NewTicker(time2.Duration(params.BeaconConfig().SecondsPerSlot) * time2.Second) + ctx, cancel := context.WithCancel(ctx) + defer cancel() + api.SetSSEHeaders(sw) + go es.outboxWriteLoop(ctx, cancel, sw) + if err := es.recvEventLoop(ctx, cancel, topics, s); err != nil { + log.WithError(err).Debug("Shutting down StreamEvents handler.") + } +} + +func newEventStreamer(buffSize int, ka time.Duration) (*eventStreamer, error) { + if ka == 0 { + ka = time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second + } + return &eventStreamer{ + outbox: make(chan lazyReader, buffSize), + keepAlive: ka, + }, nil +} + +type eventStreamer struct { + outbox chan lazyReader + keepAlive time.Duration +} + +func (es *eventStreamer) recvEventLoop(ctx context.Context, cancel context.CancelFunc, req *topicRequest, s *Server) error { + eventsChan := make(chan *feed.Event, len(es.outbox)) + if req.needOpsFeed { + opsSub := s.OperationNotifier.OperationFeed().Subscribe(eventsChan) + defer opsSub.Unsubscribe() + } + if req.needStateFeed { + stateSub := s.StateNotifier.StateFeed().Subscribe(eventsChan) + defer stateSub.Unsubscribe() + } for { select { - case event := <-opsChan: - if err := handleBlockOperationEvents(w, flusher, topicsMap, event); err != nil { - httputil.HandleError(w, err.Error(), http.StatusInternalServerError) - return - } - case event := <-stateChan: - if err := s.handleStateEvents(ctx, w, flusher, topicsMap, event); err != nil { - httputil.HandleError(w, err.Error(), http.StatusInternalServerError) - return + case <-ctx.Done(): + return ctx.Err() + case event := <-eventsChan: + lr, err := s.lazyReaderForEvent(ctx, event, req) + if err != nil { + if !errors.Is(err, errNotRequested) { + log.WithField("event_type", fmt.Sprintf("%v", event.Data)).WithError(err).Error("StreamEvents API endpoint received an event it was unable to handle.") + } + continue } - case <-keepaliveTicker.C: - if err := sendKeepalive(w, flusher); err != nil { - httputil.HandleError(w, err.Error(), http.StatusInternalServerError) - return + // If the client can't keep up, the outbox will eventually completely fill, at which + // safeWrite will error, and we'll hit the below return statement, at which point the deferred + // Unsuscribe calls will be made and the event feed will stop writing to this channel. + // Since the outbox and event stream channels are separately buffered, the event subscription + // channel should stay relatively empty, which gives this loop time to unsubscribe + // and cleanup before the event stream channel fills and disrupts other readers. + if err := es.safeWrite(ctx, lr); err != nil { + cancel() + // note: we could hijack the connection and close it here. Does that cause issues? What are the benefits? + // A benefit of hijack and close is that it may force an error on the remote end, however just closing the context of the + // http handler may be sufficient to cause the remote http response reader to close. + if errors.Is(err, errSlowReader) { + log.WithError(err).Warn("Client is unable to keep up with event stream, shutting down.") + } + return err } - case <-ctx.Done(): - return } } } -func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, requestedTopics map[string]bool, event *feed.Event) error { - switch event.Type { - case operation.AggregatedAttReceived: - if _, ok := requestedTopics[AttestationTopic]; !ok { - return nil - } - attData, ok := event.Data.(*operation.AggregatedAttReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) - } - att := structs.AttFromConsensus(attData.Attestation.Aggregate) - return send(w, flusher, AttestationTopic, att) - case operation.UnaggregatedAttReceived: - if _, ok := requestedTopics[AttestationTopic]; !ok { - return nil - } - attData, ok := event.Data.(*operation.UnAggregatedAttReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) - } - a, ok := attData.Attestation.(*eth.Attestation) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) - } - att := structs.AttFromConsensus(a) - return send(w, flusher, AttestationTopic, att) - case operation.ExitReceived: - if _, ok := requestedTopics[VoluntaryExitTopic]; !ok { - return nil - } - exitData, ok := event.Data.(*operation.ExitReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, VoluntaryExitTopic) - } - exit := structs.SignedExitFromConsensus(exitData.Exit) - return send(w, flusher, VoluntaryExitTopic, exit) - case operation.SyncCommitteeContributionReceived: - if _, ok := requestedTopics[SyncCommitteeContributionTopic]; !ok { - return nil - } - contributionData, ok := event.Data.(*operation.SyncCommitteeContributionReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, SyncCommitteeContributionTopic) - } - contribution := structs.SignedContributionAndProofFromConsensus(contributionData.Contribution) - return send(w, flusher, SyncCommitteeContributionTopic, contribution) - case operation.BLSToExecutionChangeReceived: - if _, ok := requestedTopics[BLSToExecutionChangeTopic]; !ok { - return nil - } - changeData, ok := event.Data.(*operation.BLSToExecutionChangeReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, BLSToExecutionChangeTopic) - } - return send(w, flusher, BLSToExecutionChangeTopic, structs.SignedBLSChangeFromConsensus(changeData.Change)) - case operation.BlobSidecarReceived: - if _, ok := requestedTopics[BlobSidecarTopic]; !ok { - return nil - } - blobData, ok := event.Data.(*operation.BlobSidecarReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, BlobSidecarTopic) - } - versionedHash := blockchain.ConvertKzgCommitmentToVersionedHash(blobData.Blob.KzgCommitment) - blobEvent := &structs.BlobSidecarEvent{ - BlockRoot: hexutil.Encode(blobData.Blob.BlockRootSlice()), - Index: fmt.Sprintf("%d", blobData.Blob.Index), - Slot: fmt.Sprintf("%d", blobData.Blob.Slot()), - VersionedHash: versionedHash.String(), - KzgCommitment: hexutil.Encode(blobData.Blob.KzgCommitment), - } - return send(w, flusher, BlobSidecarTopic, blobEvent) - case operation.AttesterSlashingReceived: - if _, ok := requestedTopics[AttesterSlashingTopic]; !ok { - return nil - } - attesterSlashingData, ok := event.Data.(*operation.AttesterSlashingReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, AttesterSlashingTopic) - } - slashing, ok := attesterSlashingData.AttesterSlashing.(*eth.AttesterSlashing) - if ok { - return send(w, flusher, AttesterSlashingTopic, structs.AttesterSlashingFromConsensus(slashing)) +func (es *eventStreamer) safeWrite(ctx context.Context, rf func() io.Reader) error { + if rf == nil { + return nil + } + select { + case <-ctx.Done(): + return ctx.Err() + case es.outbox <- rf: + return nil + default: + // If this is the case, the select case to write to the outbox could not proceed, meaning the outbox is full. + // If a reader can't keep up with the stream, we shut them down. + return errSlowReader + } +} + +// newlineReader is used to write keep-alives to the client. +// keep-alives in the sse protocol are a single ':' colon followed by 2 newlines. +func newlineReader() io.Reader { + return bytes.NewBufferString(":\n\n") +} + +// outboxWriteLoop runs in a separate goroutine. Its job is to write the values in the outbox to +// the client as fast as the client can read them. +func (es *eventStreamer) outboxWriteLoop(ctx context.Context, cancel context.CancelFunc, w StreamingResponseWriter) { + var err error + defer func() { + if err != nil { + log.WithError(err).Debug("Event streamer shutting down due to error.") } - // TODO: extend to Electra - case operation.ProposerSlashingReceived: - if _, ok := requestedTopics[ProposerSlashingTopic]; !ok { - return nil + }() + defer cancel() + // Write a keepalive at the start to test the connection and simplify test setup. + if err = es.writeOutbox(ctx, w, nil); err != nil { + return + } + + kaT := time.NewTimer(es.keepAlive) + // Ensure the keepalive timer is stopped and drained if it has fired. + defer func() { + if !kaT.Stop() { + <-kaT.C } - proposerSlashingData, ok := event.Data.(*operation.ProposerSlashingReceivedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, ProposerSlashingTopic) + }() + for { + select { + case <-ctx.Done(): + err = ctx.Err() + return + case <-kaT.C: + if err = es.writeOutbox(ctx, w, nil); err != nil { + return + } + // In this case the timer doesn't need to be Stopped before the Reset call after the select statement, + // because the timer has already fired. + case lr := <-es.outbox: + if err = es.writeOutbox(ctx, w, lr); err != nil { + return + } + // We don't know if the timer fired concurrently to this case being ready, so we need to check the return + // of Stop and drain the timer channel if it fired. We won't need to do this in go 1.23. + if !kaT.Stop() { + <-kaT.C + } } - return send(w, flusher, ProposerSlashingTopic, structs.ProposerSlashingFromConsensus(proposerSlashingData.ProposerSlashing)) + kaT.Reset(es.keepAlive) } - return nil } -func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, flusher http.Flusher, requestedTopics map[string]bool, event *feed.Event) error { - switch event.Type { - case statefeed.NewHead: - if _, ok := requestedTopics[HeadTopic]; ok { - headData, ok := event.Data.(*ethpb.EventHead) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, HeadTopic) +func (es *eventStreamer) writeOutbox(ctx context.Context, w StreamingResponseWriter, first lazyReader) error { + needKeepAlive := true + if first != nil { + if _, err := io.Copy(w, first()); err != nil { + return err + } + needKeepAlive = false + } + // While the first event was being read by the client, further events may be queued in the outbox. + // We can drain them right away rather than go back out to the outer select statement, where the keepAlive timer + // may have fired, triggering an unnecessary extra keep-alive write and flush. + for { + select { + case <-ctx.Done(): + return ctx.Err() + case rf := <-es.outbox: + if _, err := io.Copy(w, rf()); err != nil { + return err } - head := &structs.HeadEvent{ - Slot: fmt.Sprintf("%d", headData.Slot), - Block: hexutil.Encode(headData.Block), - State: hexutil.Encode(headData.State), - EpochTransition: headData.EpochTransition, - ExecutionOptimistic: headData.ExecutionOptimistic, - PreviousDutyDependentRoot: hexutil.Encode(headData.PreviousDutyDependentRoot), - CurrentDutyDependentRoot: hexutil.Encode(headData.CurrentDutyDependentRoot), + needKeepAlive = false + default: + if needKeepAlive { + if _, err := io.Copy(w, newlineReader()); err != nil { + return err + } } - return send(w, flusher, HeadTopic, head) - } - if _, ok := requestedTopics[PayloadAttributesTopic]; ok { - return s.sendPayloadAttributes(ctx, w, flusher) - } - case statefeed.MissedSlot: - if _, ok := requestedTopics[PayloadAttributesTopic]; ok { - return s.sendPayloadAttributes(ctx, w, flusher) - } - case statefeed.FinalizedCheckpoint: - if _, ok := requestedTopics[FinalizedCheckpointTopic]; !ok { - return nil - } - checkpointData, ok := event.Data.(*ethpb.EventFinalizedCheckpoint) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, FinalizedCheckpointTopic) - } - checkpoint := &structs.FinalizedCheckpointEvent{ - Block: hexutil.Encode(checkpointData.Block), - State: hexutil.Encode(checkpointData.State), - Epoch: fmt.Sprintf("%d", checkpointData.Epoch), - ExecutionOptimistic: checkpointData.ExecutionOptimistic, - } - return send(w, flusher, FinalizedCheckpointTopic, checkpoint) - case statefeed.LightClientFinalityUpdate: - if _, ok := requestedTopics[LightClientFinalityUpdateTopic]; !ok { + w.Flush() return nil } - updateData, ok := event.Data.(*ethpbv2.LightClientFinalityUpdateWithVersion) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, LightClientFinalityUpdateTopic) + } +} + +func jsonMarshalReader(name string, v any) io.Reader { + d, err := json.Marshal(v) + if err != nil { + log.WithError(err).WithField("type_name", fmt.Sprintf("%T", v)).Error("Could not marshal event data.") + return nil + } + return bytes.NewBufferString("event: " + name + "\ndata: " + string(d) + "\n\n") +} + +func topicForEvent(event *feed.Event) string { + switch event.Data.(type) { + case *operation.AggregatedAttReceivedData: + return AttestationTopic + case *operation.UnAggregatedAttReceivedData: + return AttestationTopic + case *operation.ExitReceivedData: + return VoluntaryExitTopic + case *operation.SyncCommitteeContributionReceivedData: + return SyncCommitteeContributionTopic + case *operation.BLSToExecutionChangeReceivedData: + return BLSToExecutionChangeTopic + case *operation.BlobSidecarReceivedData: + return BlobSidecarTopic + case *operation.AttesterSlashingReceivedData: + return AttesterSlashingTopic + case *operation.ProposerSlashingReceivedData: + return ProposerSlashingTopic + case *ethpb.EventHead: + return HeadTopic + case *ethpb.EventFinalizedCheckpoint: + return FinalizedCheckpointTopic + case *ethpbv2.LightClientFinalityUpdateWithVersion: + return LightClientFinalityUpdateTopic + case *ethpbv2.LightClientOptimisticUpdateWithVersion: + return LightClientOptimisticUpdateTopic + case *ethpb.EventChainReorg: + return ChainReorgTopic + case *statefeed.BlockProcessedData: + return BlockTopic + default: + if event.Type == statefeed.MissedSlot { + return PayloadAttributesTopic } - update, err := structs.LightClientFinalityUpdateFromConsensus(updateData.Data) + return InvalidTopic + } +} + +func (s *Server) lazyReaderForEvent(ctx context.Context, event *feed.Event, topics *topicRequest) (lazyReader, error) { + eventName := topicForEvent(event) + if !topics.requested(eventName) { + return nil, errNotRequested + } + if eventName == PayloadAttributesTopic { + return s.currentPayloadAttributes(ctx) + } + if event == nil || event.Data == nil { + return nil, errors.New("event or event data is nil") + } + switch v := event.Data.(type) { + case *ethpb.EventHead: + // The head event is a special case because, if the client requested the payload attributes topic, + // we send two event messages in reaction; the head event and the payload attributes. + headReader := func() io.Reader { + return jsonMarshalReader(eventName, structs.HeadEventFromV1(v)) + } + // Don't do the expensive attr lookup unless the client requested it. + if !topics.requested(PayloadAttributesTopic) { + return headReader, nil + } + // Since payload attributes could change before the outbox is written, we need to do a blocking operation to + // get the current payload attributes right here. + attrReader, err := s.currentPayloadAttributes(ctx) if err != nil { - return err - } - updateEvent := &structs.LightClientFinalityUpdateEvent{ - Version: version.String(int(updateData.Version)), - Data: update, - } - return send(w, flusher, LightClientFinalityUpdateTopic, updateEvent) - case statefeed.LightClientOptimisticUpdate: - if _, ok := requestedTopics[LightClientOptimisticUpdateTopic]; !ok { - return nil - } - updateData, ok := event.Data.(*ethpbv2.LightClientOptimisticUpdateWithVersion) + return nil, errors.Wrap(err, "could not get payload attributes for head event") + } + return func() io.Reader { + return io.MultiReader(headReader(), attrReader()) + }, nil + case *operation.AggregatedAttReceivedData: + return func() io.Reader { + att := structs.AttFromConsensus(v.Attestation.Aggregate) + return jsonMarshalReader(eventName, att) + }, nil + case *operation.UnAggregatedAttReceivedData: + att, ok := v.Attestation.(*eth.Attestation) if !ok { - return write(w, flusher, topicDataMismatch, event.Data, LightClientOptimisticUpdateTopic) - } - update, err := structs.LightClientOptimisticUpdateFromConsensus(updateData.Data) - if err != nil { - return err - } - updateEvent := &structs.LightClientOptimisticUpdateEvent{ - Version: version.String(int(updateData.Version)), - Data: update, - } - return send(w, flusher, LightClientOptimisticUpdateTopic, updateEvent) - case statefeed.Reorg: - if _, ok := requestedTopics[ChainReorgTopic]; !ok { - return nil - } - reorgData, ok := event.Data.(*ethpb.EventChainReorg) + return nil, errors.Wrapf(errUnhandledEventData, "Unexpected type %T for the .Attestation field of UnAggregatedAttReceivedData", v.Attestation) + } + return func() io.Reader { + att := structs.AttFromConsensus(att) + return jsonMarshalReader(eventName, att) + }, nil + case *operation.ExitReceivedData: + return func() io.Reader { + return jsonMarshalReader(eventName, structs.SignedExitFromConsensus(v.Exit)) + }, nil + case *operation.SyncCommitteeContributionReceivedData: + return func() io.Reader { + return jsonMarshalReader(eventName, structs.SignedContributionAndProofFromConsensus(v.Contribution)) + }, nil + case *operation.BLSToExecutionChangeReceivedData: + return func() io.Reader { + return jsonMarshalReader(eventName, structs.SignedBLSChangeFromConsensus(v.Change)) + }, nil + case *operation.BlobSidecarReceivedData: + return func() io.Reader { + versionedHash := blockchain.ConvertKzgCommitmentToVersionedHash(v.Blob.KzgCommitment) + return jsonMarshalReader(eventName, &structs.BlobSidecarEvent{ + BlockRoot: hexutil.Encode(v.Blob.BlockRootSlice()), + Index: fmt.Sprintf("%d", v.Blob.Index), + Slot: fmt.Sprintf("%d", v.Blob.Slot()), + VersionedHash: versionedHash.String(), + KzgCommitment: hexutil.Encode(v.Blob.KzgCommitment), + }) + }, nil + case *operation.AttesterSlashingReceivedData: + slashing, ok := v.AttesterSlashing.(*eth.AttesterSlashing) if !ok { - return write(w, flusher, topicDataMismatch, event.Data, ChainReorgTopic) - } - reorg := &structs.ChainReorgEvent{ - Slot: fmt.Sprintf("%d", reorgData.Slot), - Depth: fmt.Sprintf("%d", reorgData.Depth), - OldHeadBlock: hexutil.Encode(reorgData.OldHeadBlock), - NewHeadBlock: hexutil.Encode(reorgData.NewHeadBlock), - OldHeadState: hexutil.Encode(reorgData.OldHeadState), - NewHeadState: hexutil.Encode(reorgData.NewHeadState), - Epoch: fmt.Sprintf("%d", reorgData.Epoch), - ExecutionOptimistic: reorgData.ExecutionOptimistic, - } - return send(w, flusher, ChainReorgTopic, reorg) - case statefeed.BlockProcessed: - if _, ok := requestedTopics[BlockTopic]; !ok { - return nil + return nil, errors.Wrapf(errUnhandledEventData, "Unexpected type %T for the .AttesterSlashing field of AttesterSlashingReceivedData", v.AttesterSlashing) + } + return func() io.Reader { + return jsonMarshalReader(eventName, structs.AttesterSlashingFromConsensus(slashing)) + }, nil + case *operation.ProposerSlashingReceivedData: + return func() io.Reader { + return jsonMarshalReader(eventName, structs.ProposerSlashingFromConsensus(v.ProposerSlashing)) + }, nil + case *ethpb.EventFinalizedCheckpoint: + return func() io.Reader { + return jsonMarshalReader(eventName, structs.FinalizedCheckpointEventFromV1(v)) + }, nil + case *ethpbv2.LightClientFinalityUpdateWithVersion: + cv, err := structs.LightClientFinalityUpdateFromConsensus(v.Data) + if err != nil { + return nil, errors.Wrap(err, "LightClientFinalityUpdateWithVersion event conversion failure") } - blkData, ok := event.Data.(*statefeed.BlockProcessedData) - if !ok { - return write(w, flusher, topicDataMismatch, event.Data, BlockTopic) + ev := &structs.LightClientFinalityUpdateEvent{ + Version: version.String(int(v.Version)), + Data: cv, } - blockRoot, err := blkData.SignedBlock.Block().HashTreeRoot() + return func() io.Reader { + return jsonMarshalReader(eventName, ev) + }, nil + case *ethpbv2.LightClientOptimisticUpdateWithVersion: + cv, err := structs.LightClientOptimisticUpdateFromConsensus(v.Data) if err != nil { - return write(w, flusher, "Could not get block root: "+err.Error()) - } - blk := &structs.BlockEvent{ - Slot: fmt.Sprintf("%d", blkData.Slot), - Block: hexutil.Encode(blockRoot[:]), - ExecutionOptimistic: blkData.Optimistic, + return nil, errors.Wrap(err, "LightClientOptimisticUpdateWithVersion event conversion failure") + } + ev := &structs.LightClientOptimisticUpdateEvent{ + Version: version.String(int(v.Version)), + Data: cv, + } + return func() io.Reader { + return jsonMarshalReader(eventName, ev) + }, nil + case *ethpb.EventChainReorg: + return func() io.Reader { + return jsonMarshalReader(eventName, structs.EventChainReorgFromV1(v)) + }, nil + case *statefeed.BlockProcessedData: + blockRoot, err := v.SignedBlock.Block().HashTreeRoot() + if err != nil { + return nil, errors.Wrap(err, "could not compute block root for BlockProcessedData state feed event") } - return send(w, flusher, BlockTopic, blk) + return func() io.Reader { + blk := &structs.BlockEvent{ + Slot: fmt.Sprintf("%d", v.Slot), + Block: hexutil.Encode(blockRoot[:]), + ExecutionOptimistic: v.Optimistic, + } + return jsonMarshalReader(eventName, blk) + }, nil + default: + return nil, errors.Wrapf(errUnhandledEventData, "event data type %T unsupported", v) } - return nil } // This event stream is intended to be used by builders and relays. // Parent fields are based on state at N_{current_slot}, while the rest of fields are based on state of N_{current_slot + 1} -func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWriter, flusher http.Flusher) error { +func (s *Server) currentPayloadAttributes(ctx context.Context) (lazyReader, error) { headRoot, err := s.HeadFetcher.HeadRoot(ctx) if err != nil { - return write(w, flusher, "Could not get head root: "+err.Error()) + return nil, errors.Wrap(err, "could not get head root") } st, err := s.HeadFetcher.HeadState(ctx) if err != nil { - return write(w, flusher, "Could not get head state: "+err.Error()) + return nil, errors.Wrap(err, "could not get head state") } // advance the head state headState, err := transition.ProcessSlotsIfPossible(ctx, st, s.ChainInfoFetcher.CurrentSlot()+1) if err != nil { - return write(w, flusher, "Could not advance head state: "+err.Error()) + return nil, errors.Wrap(err, "could not advance head state") } headBlock, err := s.HeadFetcher.HeadBlock(ctx) if err != nil { - return write(w, flusher, "Could not get head block: "+err.Error()) + return nil, errors.Wrap(err, "could not get head block") } headPayload, err := headBlock.Block().Body().Execution() if err != nil { - return write(w, flusher, "Could not get execution payload: "+err.Error()) + return nil, errors.Wrap(err, "could not get execution payload") } t, err := slots.ToTime(headState.GenesisTime(), headState.Slot()) if err != nil { - return write(w, flusher, "Could not get head state slot time: "+err.Error()) + return nil, errors.Wrap(err, "could not get head state slot time") } - prevRando, err := helpers.RandaoMix(headState, time.CurrentEpoch(headState)) + prevRando, err := helpers.RandaoMix(headState, chaintime.CurrentEpoch(headState)) if err != nil { - return write(w, flusher, "Could not get head state randao mix: "+err.Error()) + return nil, errors.Wrap(err, "could not get head state randao mix") } proposerIndex, err := helpers.BeaconProposerIndex(ctx, headState) if err != nil { - return write(w, flusher, "Could not get head state proposer index: "+err.Error()) + return nil, errors.Wrap(err, "could not get head state proposer index") } feeRecipient := params.BeaconConfig().DefaultFeeRecipient.Bytes() tValidator, exists := s.TrackedValidatorsCache.Validator(proposerIndex) @@ -425,7 +575,7 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite case version.Capella: withdrawals, _, err := headState.ExpectedWithdrawals() if err != nil { - return write(w, flusher, "Could not get head state expected withdrawals: "+err.Error()) + return nil, errors.Wrap(err, "could not get head state expected withdrawals") } attributes = &structs.PayloadAttributesV2{ Timestamp: fmt.Sprintf("%d", t.Unix()), @@ -436,11 +586,11 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite case version.Deneb, version.Electra: withdrawals, _, err := headState.ExpectedWithdrawals() if err != nil { - return write(w, flusher, "Could not get head state expected withdrawals: "+err.Error()) + return nil, errors.Wrap(err, "could not get head state expected withdrawals") } parentRoot, err := headBlock.Block().HashTreeRoot() if err != nil { - return write(w, flusher, "Could not get head block root: "+err.Error()) + return nil, errors.Wrap(err, "could not get head block root") } attributes = &structs.PayloadAttributesV3{ Timestamp: fmt.Sprintf("%d", t.Unix()), @@ -450,12 +600,12 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite ParentBeaconBlockRoot: hexutil.Encode(parentRoot[:]), } default: - return write(w, flusher, "Payload version %s is not supported", version.String(headState.Version())) + return nil, errors.Wrapf(err, "Payload version %s is not supported", version.String(headState.Version())) } attributesBytes, err := json.Marshal(attributes) if err != nil { - return write(w, flusher, err.Error()) + return nil, errors.Wrap(err, "errors marshaling payload attributes to json") } eventData := structs.PayloadAttributesEventData{ ProposerIndex: fmt.Sprintf("%d", proposerIndex), @@ -467,31 +617,12 @@ func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWrite } eventDataBytes, err := json.Marshal(eventData) if err != nil { - return write(w, flusher, err.Error()) - } - return send(w, flusher, PayloadAttributesTopic, &structs.PayloadAttributesEvent{ - Version: version.String(headState.Version()), - Data: eventDataBytes, - }) -} - -func send(w http.ResponseWriter, flusher http.Flusher, name string, data interface{}) error { - j, err := json.Marshal(data) - if err != nil { - return write(w, flusher, "Could not marshal event to JSON: "+err.Error()) - } - return write(w, flusher, "event: %s\ndata: %s\n\n", name, string(j)) -} - -func sendKeepalive(w http.ResponseWriter, flusher http.Flusher) error { - return write(w, flusher, ":\n\n") -} - -func write(w http.ResponseWriter, flusher http.Flusher, format string, a ...any) error { - _, err := fmt.Fprintf(w, format, a...) - if err != nil { - return errors.Wrap(err, "could not write to response writer") + return nil, errors.Wrap(err, "errors marshaling payload attributes event data to json") } - flusher.Flush() - return nil + return func() io.Reader { + return jsonMarshalReader(PayloadAttributesTopic, &structs.PayloadAttributesEvent{ + Version: version.String(headState.Version()), + Data: eventDataBytes, + }) + }, nil } diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index 94b08b176d3c..420f34fdf96d 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -1,6 +1,7 @@ package events import ( + "context" "fmt" "io" "math" @@ -23,56 +24,99 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" + sse "github.com/r3labs/sse/v2" ) -type flushableResponseRecorder struct { - *httptest.ResponseRecorder - flushed bool -} +func requireAllEventsReceived(t *testing.T, stn, opn *mockChain.EventFeedWrapper, events []*feed.Event, req *topicRequest, s *Server, w *StreamingResponseWriterRecorder) { + // maxBufferSize param copied from sse lib client code + sseR := sse.NewEventStreamReader(w.Body(), 1<<24) + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + + expected := make(map[string]bool) + for i := range events { + ev := events[i] + // serialize the event the same way the server will so that we can compare expectation to results. + top := topicForEvent(ev) + eb, err := s.lazyReaderForEvent(context.Background(), ev, req) + require.NoError(t, err) + exb, err := io.ReadAll(eb()) + require.NoError(t, err) + exs := string(exb[0 : len(exb)-2]) // remove trailing double newline -func (f *flushableResponseRecorder) Flush() { - f.flushed = true + if topicsForOpsFeed[top] { + if err := opn.WaitForSubscription(ctx); err != nil { + t.Fatal(err) + } + // Send the event on the feed. + s.OperationNotifier.OperationFeed().Send(ev) + } else { + if err := stn.WaitForSubscription(ctx); err != nil { + t.Fatal(err) + } + // Send the event on the feed. + s.StateNotifier.StateFeed().Send(ev) + } + expected[exs] = true + } + done := make(chan struct{}) + go func() { + defer close(done) + for { + ev, err := sseR.ReadEvent() + if err == io.EOF { + return + } + require.NoError(t, err) + str := string(ev) + delete(expected, str) + if len(expected) == 0 { + return + } + } + }() + select { + case <-done: + break + case <-ctx.Done(): + t.Fatalf("context canceled / timed out waiting for events, err=%v", ctx.Err()) + } + require.Equal(t, 0, len(expected), "expected events not seen") } -func TestStreamEvents_OperationsEvents(t *testing.T) { - t.Run("operations", func(t *testing.T) { - s := &Server{ - StateNotifier: &mockChain.MockStateNotifier{}, - OperationNotifier: &mockChain.MockOperationNotifier{}, - } +func (tr *topicRequest) testHttpRequest(_ *testing.T) *http.Request { + tq := make([]string, 0, len(tr.topics)) + for topic := range tr.topics { + tq = append(tq, "topics="+topic) + } + return httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/events?%s", strings.Join(tq, "&")), nil) +} - topics := []string{ - AttestationTopic, - VoluntaryExitTopic, - SyncCommitteeContributionTopic, - BLSToExecutionChangeTopic, - BlobSidecarTopic, - AttesterSlashingTopic, - ProposerSlashingTopic, - } - for i, topic := range topics { - topics[i] = "topics=" + topic - } - request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/events?%s", strings.Join(topics, "&")), nil) - w := &flushableResponseRecorder{ - ResponseRecorder: httptest.NewRecorder(), - } +func operationEventsFixtures(t *testing.T) (*topicRequest, []*feed.Event) { + topics, err := newTopicRequest([]string{ + AttestationTopic, + VoluntaryExitTopic, + SyncCommitteeContributionTopic, + BLSToExecutionChangeTopic, + BlobSidecarTopic, + AttesterSlashingTopic, + ProposerSlashingTopic, + }) + require.NoError(t, err) + ro, err := blocks.NewROBlob(util.HydrateBlobSidecar(ð.BlobSidecar{})) + require.NoError(t, err) + vblob := blocks.NewVerifiedROBlob(ro) - go func() { - s.StreamEvents(w, request) - }() - // wait for initiation of StreamEvents - time.Sleep(100 * time.Millisecond) - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + return topics, []*feed.Event{ + &feed.Event{ Type: operation.UnaggregatedAttReceived, Data: &operation.UnAggregatedAttReceivedData{ Attestation: util.HydrateAttestation(ð.Attestation{}), }, - }) - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.AggregatedAttReceived, Data: &operation.AggregatedAttReceivedData{ Attestation: ð.AggregateAttestationAndProof{ @@ -81,8 +125,8 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { SelectionProof: make([]byte, 96), }, }, - }) - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.ExitReceived, Data: &operation.ExitReceivedData{ Exit: ð.SignedVoluntaryExit{ @@ -93,8 +137,8 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { Signature: make([]byte, 96), }, }, - }) - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.SyncCommitteeContributionReceived, Data: &operation.SyncCommitteeContributionReceivedData{ Contribution: ð.SignedContributionAndProof{ @@ -112,8 +156,8 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { Signature: make([]byte, 96), }, }, - }) - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.BLSToExecutionChangeReceived, Data: &operation.BLSToExecutionChangeReceivedData{ Change: ð.SignedBLSToExecutionChange{ @@ -125,18 +169,14 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { Signature: make([]byte, 96), }, }, - }) - ro, err := blocks.NewROBlob(util.HydrateBlobSidecar(ð.BlobSidecar{})) - require.NoError(t, err) - vblob := blocks.NewVerifiedROBlob(ro) - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.BlobSidecarReceived, Data: &operation.BlobSidecarReceivedData{ Blob: &vblob, }, - }) - - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.AttesterSlashingReceived, Data: &operation.AttesterSlashingReceivedData{ AttesterSlashing: ð.AttesterSlashing{ @@ -168,9 +208,8 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { }, }, }, - }) - - s.OperationNotifier.OperationFeed().Send(&feed.Event{ + }, + &feed.Event{ Type: operation.ProposerSlashingReceived, Data: &operation.ProposerSlashingReceivedData{ ProposerSlashing: ð.ProposerSlashing{ @@ -192,100 +231,107 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { }, }, }, - }) - - time.Sleep(1 * time.Second) - request.Context().Done() + }, + } +} - resp := w.Result() - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.NotNil(t, body) - assert.Equal(t, operationsResult, string(body)) - }) - t.Run("state", func(t *testing.T) { +func TestStreamEvents_OperationsEvents(t *testing.T) { + t.Run("operations", func(t *testing.T) { + stn := mockChain.NewEventFeedWrapper() + opn := mockChain.NewEventFeedWrapper() s := &Server{ - StateNotifier: &mockChain.MockStateNotifier{}, - OperationNotifier: &mockChain.MockOperationNotifier{}, + StateNotifier: &mockChain.SimpleNotifier{Feed: stn}, + OperationNotifier: &mockChain.SimpleNotifier{Feed: opn}, } - topics := []string{HeadTopic, FinalizedCheckpointTopic, ChainReorgTopic, BlockTopic} - for i, topic := range topics { - topics[i] = "topics=" + topic - } - request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/events?%s", strings.Join(topics, "&")), nil) - w := &flushableResponseRecorder{ - ResponseRecorder: httptest.NewRecorder(), - } + topics, events := operationEventsFixtures(t) + request := topics.testHttpRequest(t) + w := NewStreamingResponseWriterRecorder() go func() { s.StreamEvents(w, request) }() - // wait for initiation of StreamEvents - time.Sleep(100 * time.Millisecond) - s.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.NewHead, - Data: ðpb.EventHead{ - Slot: 0, - Block: make([]byte, 32), - State: make([]byte, 32), - EpochTransition: true, - PreviousDutyDependentRoot: make([]byte, 32), - CurrentDutyDependentRoot: make([]byte, 32), - ExecutionOptimistic: false, - }, - }) - s.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.FinalizedCheckpoint, - Data: ðpb.EventFinalizedCheckpoint{ - Block: make([]byte, 32), - State: make([]byte, 32), - Epoch: 0, - ExecutionOptimistic: false, - }, - }) - s.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.Reorg, - Data: ðpb.EventChainReorg{ - Slot: 0, - Depth: 0, - OldHeadBlock: make([]byte, 32), - NewHeadBlock: make([]byte, 32), - OldHeadState: make([]byte, 32), - NewHeadState: make([]byte, 32), - Epoch: 0, - ExecutionOptimistic: false, - }, + + requireAllEventsReceived(t, stn, opn, events, topics, s, w) + }) + t.Run("state", func(t *testing.T) { + stn := mockChain.NewEventFeedWrapper() + opn := mockChain.NewEventFeedWrapper() + s := &Server{ + StateNotifier: &mockChain.SimpleNotifier{Feed: stn}, + OperationNotifier: &mockChain.SimpleNotifier{Feed: opn}, + } + + topics, err := newTopicRequest([]string{ + HeadTopic, + FinalizedCheckpointTopic, + ChainReorgTopic, + BlockTopic, }) + require.NoError(t, err) + request := topics.testHttpRequest(t) + w := NewStreamingResponseWriterRecorder() + b, err := blocks.NewSignedBeaconBlock(util.HydrateSignedBeaconBlock(ð.SignedBeaconBlock{})) require.NoError(t, err) - s.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.BlockProcessed, - Data: &statefeed.BlockProcessedData{ - Slot: 0, - BlockRoot: [32]byte{}, - SignedBlock: b, - Verified: true, - Optimistic: false, + events := []*feed.Event{ + &feed.Event{ + Type: statefeed.BlockProcessed, + Data: &statefeed.BlockProcessedData{ + Slot: 0, + BlockRoot: [32]byte{}, + SignedBlock: b, + Verified: true, + Optimistic: false, + }, }, - }) + &feed.Event{ + Type: statefeed.NewHead, + Data: ðpb.EventHead{ + Slot: 0, + Block: make([]byte, 32), + State: make([]byte, 32), + EpochTransition: true, + PreviousDutyDependentRoot: make([]byte, 32), + CurrentDutyDependentRoot: make([]byte, 32), + ExecutionOptimistic: false, + }, + }, + &feed.Event{ + Type: statefeed.Reorg, + Data: ðpb.EventChainReorg{ + Slot: 0, + Depth: 0, + OldHeadBlock: make([]byte, 32), + NewHeadBlock: make([]byte, 32), + OldHeadState: make([]byte, 32), + NewHeadState: make([]byte, 32), + Epoch: 0, + ExecutionOptimistic: false, + }, + }, + &feed.Event{ + Type: statefeed.FinalizedCheckpoint, + Data: ðpb.EventFinalizedCheckpoint{ + Block: make([]byte, 32), + State: make([]byte, 32), + Epoch: 0, + ExecutionOptimistic: false, + }, + }, + } - // wait for feed - time.Sleep(1 * time.Second) - request.Context().Done() + go func() { + s.StreamEvents(w, request) + }() - resp := w.Result() - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.NotNil(t, body) - assert.Equal(t, stateResult, string(body)) + requireAllEventsReceived(t, stn, opn, events, topics, s, w) }) t.Run("payload attributes", func(t *testing.T) { type testCase struct { name string getState func() state.BeaconState getBlock func() interfaces.SignedBeaconBlock - expected string SetTrackedValidatorsCache func(*cache.TrackedValidatorsCache) } testCases := []testCase{ @@ -301,7 +347,6 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { require.NoError(t, err) return b }, - expected: payloadAttributesBellatrixResult, }, { name: "capella", @@ -315,7 +360,6 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { require.NoError(t, err) return b }, - expected: payloadAttributesCapellaResult, }, { name: "deneb", @@ -329,7 +373,6 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { require.NoError(t, err) return b }, - expected: payloadAttributesDenebResult, }, { name: "electra", @@ -343,7 +386,6 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { require.NoError(t, err) return b }, - expected: payloadAttributesElectraResultWithTVC, SetTrackedValidatorsCache: func(c *cache.TrackedValidatorsCache) { c.Set(cache.TrackedValidator{ Active: true, @@ -368,9 +410,11 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { Slot: ¤tSlot, } + stn := mockChain.NewEventFeedWrapper() + opn := mockChain.NewEventFeedWrapper() s := &Server{ - StateNotifier: &mockChain.MockStateNotifier{}, - OperationNotifier: &mockChain.MockOperationNotifier{}, + StateNotifier: &mockChain.SimpleNotifier{Feed: stn}, + OperationNotifier: &mockChain.SimpleNotifier{Feed: opn}, HeadFetcher: mockChainService, ChainInfoFetcher: mockChainService, TrackedValidatorsCache: cache.NewTrackedValidatorsCache(), @@ -378,100 +422,76 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { if tc.SetTrackedValidatorsCache != nil { tc.SetTrackedValidatorsCache(s.TrackedValidatorsCache) } - - request := httptest.NewRequest(http.MethodGet, fmt.Sprintf("http://example.com/eth/v1/events?topics=%s", PayloadAttributesTopic), nil) - w := &flushableResponseRecorder{ - ResponseRecorder: httptest.NewRecorder(), - } + topics, err := newTopicRequest([]string{PayloadAttributesTopic}) + require.NoError(t, err) + request := topics.testHttpRequest(t) + w := NewStreamingResponseWriterRecorder() + events := []*feed.Event{&feed.Event{Type: statefeed.MissedSlot}} go func() { s.StreamEvents(w, request) }() - // wait for initiation of StreamEvents - time.Sleep(100 * time.Millisecond) - s.StateNotifier.StateFeed().Send(&feed.Event{Type: statefeed.MissedSlot}) - - // wait for feed - time.Sleep(1 * time.Second) - request.Context().Done() - - resp := w.Result() - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.NotNil(t, body) - assert.Equal(t, tc.expected, string(body), "wrong result for "+tc.name) + requireAllEventsReceived(t, stn, opn, events, topics, s, w) } }) } -const operationsResult = `: - -event: attestation -data: {"aggregation_bits":"0x00","data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} - -event: attestation -data: {"aggregation_bits":"0x00","data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} - -event: voluntary_exit -data: {"message":{"epoch":"0","validator_index":"0"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} - -event: contribution_and_proof -data: {"message":{"aggregator_index":"0","contribution":{"slot":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","subcommittee_index":"0","aggregation_bits":"0x00000000000000000000000000000000","signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"selection_proof":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} - -event: bls_to_execution_change -data: {"message":{"validator_index":"0","from_bls_pubkey":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","to_execution_address":"0x0000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} - -event: blob_sidecar -data: {"block_root":"0xc78009fdf07fc56a11f122370658a353aaa542ed63e44c4bc15ff4cd105ab33c","index":"0","slot":"0","kzg_commitment":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","versioned_hash":"0x01b0761f87b081d5cf10757ccc89f12be355c70e2e29df288b65b30710dcbcd1"} - -event: attester_slashing -data: {"attestation_1":{"attesting_indices":["0","1"],"data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"attestation_2":{"attesting_indices":["0","1"],"data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}} - -event: proposer_slashing -data: {"signed_header_1":{"message":{"slot":"0","proposer_index":"0","parent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","body_root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"signed_header_2":{"message":{"slot":"0","proposer_index":"0","parent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","body_root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}} - -` - -const stateResult = `: - -event: head -data: {"slot":"0","block":"0x0000000000000000000000000000000000000000000000000000000000000000","state":"0x0000000000000000000000000000000000000000000000000000000000000000","epoch_transition":true,"execution_optimistic":false,"previous_duty_dependent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","current_duty_dependent_root":"0x0000000000000000000000000000000000000000000000000000000000000000"} - -event: finalized_checkpoint -data: {"block":"0x0000000000000000000000000000000000000000000000000000000000000000","state":"0x0000000000000000000000000000000000000000000000000000000000000000","epoch":"0","execution_optimistic":false} - -event: chain_reorg -data: {"slot":"0","depth":"0","old_head_block":"0x0000000000000000000000000000000000000000000000000000000000000000","old_head_state":"0x0000000000000000000000000000000000000000000000000000000000000000","new_head_block":"0x0000000000000000000000000000000000000000000000000000000000000000","new_head_state":"0x0000000000000000000000000000000000000000000000000000000000000000","epoch":"0","execution_optimistic":false} - -event: block -data: {"slot":"0","block":"0xeade62f0457b2fdf48e7d3fc4b60736688286be7c7a3ac4c9a16a5e0600bd9e4","execution_optimistic":false} - -` - -const payloadAttributesBellatrixResult = `: - -event: payload_attributes -data: {"version":"bellatrix","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0x0000000000000000000000000000000000000000"}}} - -` - -const payloadAttributesCapellaResult = `: - -event: payload_attributes -data: {"version":"capella","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0x0000000000000000000000000000000000000000","withdrawals":[]}}} - -` - -const payloadAttributesDenebResult = `: - -event: payload_attributes -data: {"version":"deneb","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0x0000000000000000000000000000000000000000","withdrawals":[],"parent_beacon_block_root":"0xbef96cb938fd48b2403d3e662664325abb0102ed12737cbb80d717520e50cf4a"}}} - -` - -const payloadAttributesElectraResultWithTVC = `: - -event: payload_attributes -data: {"version":"electra","data":{"proposer_index":"0","proposal_slot":"1","parent_block_number":"0","parent_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","parent_block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","payload_attributes":{"timestamp":"12","prev_randao":"0x0000000000000000000000000000000000000000000000000000000000000000","suggested_fee_recipient":"0xd2dbd02e4efe087d7d195de828b9dd25f19a89c9","withdrawals":[],"parent_beacon_block_root":"0xf2110e448638f41cb34514ecdbb49c055536cd5f715f1cb259d1287bb900853e"}}} - -` +func TestStuckReader(t *testing.T) { + topics, events := operationEventsFixtures(t) + require.Equal(t, 8, len(events)) + // set eventFeedDepth to a number lower than the events we intend to send to force the server to drop the reader. + stn := mockChain.NewEventFeedWrapper() + opn := mockChain.NewEventFeedWrapper() + s := &Server{ + StateNotifier: &mockChain.SimpleNotifier{Feed: stn}, + OperationNotifier: &mockChain.SimpleNotifier{Feed: opn}, + EventFeedDepth: len(events) - 1, + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + eventsWritten := make(chan struct{}) + go func() { + for i := range events { + ev := events[i] + top := topicForEvent(ev) + if topicsForOpsFeed[top] { + err := opn.WaitForSubscription(ctx) + require.NoError(t, err) + s.OperationNotifier.OperationFeed().Send(ev) + } else { + err := stn.WaitForSubscription(ctx) + require.NoError(t, err) + s.StateNotifier.StateFeed().Send(ev) + } + } + close(eventsWritten) + }() + + request := topics.testHttpRequest(t) + w := NewStreamingResponseWriterRecorder() + + handlerFinished := make(chan struct{}) + go func() { + s.StreamEvents(w, request) + close(handlerFinished) + }() + + // Make sure that the stream writer shut down when the reader failed to clear the write buffer. + select { + case <-handlerFinished: + // We expect the stream handler to max out the queue buffer and exit gracefully. + return + case <-ctx.Done(): + t.Fatalf("context canceled / timed out waiting for handler completion, err=%v", ctx.Err()) + } + + // Also make sure all the events were written. + select { + case <-eventsWritten: + // We expect the stream handler to max out the queue buffer and exit gracefully. + return + case <-ctx.Done(): + t.Fatalf("context canceled / timed out waiting to write all events, err=%v", ctx.Err()) + } +} diff --git a/beacon-chain/rpc/eth/events/http_test.go b/beacon-chain/rpc/eth/events/http_test.go new file mode 100644 index 000000000000..1bfaaa873da3 --- /dev/null +++ b/beacon-chain/rpc/eth/events/http_test.go @@ -0,0 +1,75 @@ +package events + +import ( + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/prysmaticlabs/prysm/v5/testing/require" +) + +type StreamingResponseWriterRecorder struct { + http.ResponseWriter + r io.Reader + w io.Writer + statusWritten *int + status chan int + bodyRecording []byte + flushed bool +} + +func (w *StreamingResponseWriterRecorder) StatusChan() chan int { + return w.status +} + +func NewStreamingResponseWriterRecorder() *StreamingResponseWriterRecorder { + r, w := io.Pipe() + return &StreamingResponseWriterRecorder{ + ResponseWriter: httptest.NewRecorder(), + r: r, + w: w, + status: make(chan int, 1), + } +} + +// Write implements http.ResponseWriter. +func (w *StreamingResponseWriterRecorder) Write(data []byte) (int, error) { + w.WriteHeader(http.StatusOK) + n, err := w.w.Write(data) + if err != nil { + return n, err + } + return w.ResponseWriter.Write(data) +} + +// WriteHeader implements http.ResponseWriter. +func (w *StreamingResponseWriterRecorder) WriteHeader(statusCode int) { + if w.statusWritten != nil { + return + } + w.statusWritten = &statusCode + w.status <- statusCode + w.ResponseWriter.WriteHeader(statusCode) +} + +func (w *StreamingResponseWriterRecorder) Body() io.Reader { + return w.r +} + +func (w *StreamingResponseWriterRecorder) RequireStatus(t *testing.T, status int) { + if w.statusWritten == nil { + t.Fatal("WriteHeader was not called") + } + require.Equal(t, status, *w.statusWritten) +} + +func (w *StreamingResponseWriterRecorder) Flush() { + fw, ok := w.ResponseWriter.(http.Flusher) + if ok { + fw.Flush() + } + w.flushed = true +} + +var _ http.ResponseWriter = &StreamingResponseWriterRecorder{} diff --git a/beacon-chain/rpc/eth/events/server.go b/beacon-chain/rpc/eth/events/server.go index 58cd671e9c4b..26e83454e5c4 100644 --- a/beacon-chain/rpc/eth/events/server.go +++ b/beacon-chain/rpc/eth/events/server.go @@ -4,6 +4,8 @@ package events import ( + "time" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" @@ -18,4 +20,6 @@ type Server struct { HeadFetcher blockchain.HeadFetcher ChainInfoFetcher blockchain.ChainInfoFetcher TrackedValidatorsCache *cache.TrackedValidatorsCache + KeepAliveInterval time.Duration + EventFeedDepth int } diff --git a/deps.bzl b/deps.bzl index 95addcea0567..0d971d392ca2 100644 --- a/deps.bzl +++ b/deps.bzl @@ -2833,6 +2833,12 @@ def prysm_deps(): sum = "h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg=", version = "v0.8.0", ) + go_repository( + name = "com_github_r3labs_sse_v2", + importpath = "github.com/r3labs/sse/v2", + sum = "h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=", + version = "v2.10.0", + ) go_repository( name = "com_github_raulk_go_watchdog", importpath = "github.com/raulk/go-watchdog", @@ -4304,6 +4310,12 @@ def prysm_deps(): sum = "h1:stTHdEoWg1pQ8riaP5ROrjS6zy6wewH/Q2iwnLCQUXY=", version = "v1.0.0-20160220154919-db14e161995a", ) + go_repository( + name = "in_gopkg_cenkalti_backoff_v1", + importpath = "gopkg.in/cenkalti/backoff.v1", + sum = "h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=", + version = "v1.1.0", + ) go_repository( name = "in_gopkg_check_v1", importpath = "gopkg.in/check.v1", diff --git a/go.mod b/go.mod index c433d998461d..138f1084a570 100644 --- a/go.mod +++ b/go.mod @@ -66,6 +66,7 @@ require ( github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 + github.com/r3labs/sse/v2 v2.10.0 github.com/rs/cors v1.7.0 github.com/schollz/progressbar/v3 v3.3.4 github.com/sirupsen/logrus v1.9.0 @@ -259,6 +260,7 @@ require ( golang.org/x/term v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect + gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index bf21aa4e0814..b53de69d2755 100644 --- a/go.sum +++ b/go.sum @@ -914,6 +914,8 @@ github.com/quic-go/quic-go v0.46.0 h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7 github.com/quic-go/quic-go v0.46.0/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI= github.com/quic-go/webtransport-go v0.8.0 h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg= github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YVSlwHohQsuac9WaM= +github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0= +github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1223,6 +1225,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1607,6 +1610,8 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= +gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y= +gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 0f1d16c59965723e96536c42bb60b0be85f53b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kapka?= Date: Mon, 7 Oct 2024 15:36:10 +0200 Subject: [PATCH 314/325] Flip committee aware packing flag (#14507) * Flip committee aware packing flag * changelog * fix deprecated flag name * test fixes * properly use feature in tests * Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --------- Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com> --- CHANGELOG.md | 1 + .../validator/proposer_attestations.go | 6 +-- .../validator/proposer_attestations_test.go | 54 ++----------------- config/features/config.go | 8 +-- config/features/deprecated_flags.go | 7 +++ config/features/flags.go | 8 +-- 6 files changed, 24 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eed6e3e46b60..6406fac571d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Update light client helper functions to reference `dev` branch of CL specs - Updated Libp2p Dependencies to allow prysm to use gossipsub v1.2 . - Updated Sepolia bootnodes. +- Make committee aware packing the default by deprecating `--enable-committee-aware-packing`. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index ca4785d34f55..4446f853f2e0 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -217,10 +217,10 @@ func (a proposerAtts) sort() (proposerAtts, error) { return a, nil } - if features.Get().EnableCommitteeAwarePacking { - return a.sortBySlotAndCommittee() + if features.Get().DisableCommitteeAwarePacking { + return a.sortByProfitabilityUsingMaxCover() } - return a.sortByProfitabilityUsingMaxCover() + return a.sortBySlotAndCommittee() } // Separate attestations by slot, as slot number takes higher precedence when sorting. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index d15cdfd7b1d9..a4f9668861f2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -21,6 +21,11 @@ import ( ) func TestProposer_ProposerAtts_sort(t *testing.T) { + feat := features.Get() + feat.DisableCommitteeAwarePacking = true + reset := features.InitWithReset(feat) + defer reset() + type testData struct { slot primitives.Slot bits bitfield.Bitlist @@ -186,11 +191,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { } t.Run("no atts", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - atts := getAtts([]testData{}) want := getAtts([]testData{}) atts, err := atts.sort() @@ -201,11 +201,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { }) t.Run("single att", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - atts := getAtts([]testData{ {4, bitfield.Bitlist{0b11100000, 0b1}}, }) @@ -220,11 +215,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { }) t.Run("single att per slot", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - atts := getAtts([]testData{ {1, bitfield.Bitlist{0b11000000, 0b1}}, {4, bitfield.Bitlist{0b11100000, 0b1}}, @@ -241,10 +231,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { }) t.Run("two atts on one of the slots", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() atts := getAtts([]testData{ {1, bitfield.Bitlist{0b11000000, 0b1}}, @@ -263,11 +249,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { }) t.Run("compare to native sort", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - // The max-cover based approach will select 0b00001100 instead, despite lower bit count // (since it has two new/unknown bits). t.Run("max-cover", func(t *testing.T) { @@ -289,11 +270,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { }) t.Run("multiple slots", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - atts := getAtts([]testData{ {2, bitfield.Bitlist{0b11100000, 0b1}}, {4, bitfield.Bitlist{0b11100000, 0b1}}, @@ -316,11 +292,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { }) t.Run("follows max-cover", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - // Items at slot 4 must be first split into two lists by max-cover, with // 0b10000011 being selected and 0b11100001 being leftover (despite naive bit count suggesting otherwise). atts := getAtts([]testData{ @@ -350,11 +321,6 @@ func TestProposer_ProposerAtts_committeeAwareSort(t *testing.T) { func TestProposer_sort_DifferentCommittees(t *testing.T) { t.Run("one att per committee", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 1}}) c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11100000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 2}}) atts := proposerAtts{c1_a1, c2_a1} @@ -364,11 +330,6 @@ func TestProposer_sort_DifferentCommittees(t *testing.T) { assert.DeepEqual(t, want, atts) }) t.Run("multiple atts per committee", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111100, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 1}}) c1_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b10000010, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 1}}) c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11110000, 0b1}, Data: ðpb.AttestationData{CommitteeIndex: 2}}) @@ -381,11 +342,6 @@ func TestProposer_sort_DifferentCommittees(t *testing.T) { assert.DeepEqual(t, want, atts) }) t.Run("multiple atts per committee, multiple slots", func(t *testing.T) { - feat := features.Get() - feat.EnableCommitteeAwarePacking = true - reset := features.InitWithReset(feat) - defer reset() - s2_c1_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11111100, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 1}}) s2_c1_a2 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b10000010, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 1}}) s2_c2_a1 := util.HydrateAttestation(ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b11110000, 0b1}, Data: ðpb.AttestationData{Slot: 2, CommitteeIndex: 2}}) diff --git a/config/features/config.go b/config/features/config.go index d342b499dd22..ce772e8a17d6 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -48,7 +48,7 @@ type Flags struct { EnableDoppelGanger bool // EnableDoppelGanger enables doppelganger protection on startup for the validator. EnableHistoricalSpaceRepresentation bool // EnableHistoricalSpaceRepresentation enables the saving of registry validators in separate buckets to save space EnableBeaconRESTApi bool // EnableBeaconRESTApi enables experimental usage of the beacon REST API by the validator when querying a beacon node - EnableCommitteeAwarePacking bool // EnableCommitteeAwarePacking TODO + DisableCommitteeAwarePacking bool // DisableCommitteeAwarePacking changes the attestation packing algorithm to one that is not aware of attesting committees. // Logging related toggles. DisableGRPCConnectionLogs bool // Disables logging when a new grpc client has connected. EnableFullSSZDataLogging bool // Enables logging for full ssz data on rejected gossip messages @@ -256,9 +256,9 @@ func ConfigureBeaconChain(ctx *cli.Context) error { logEnabled(EnableQUIC) cfg.EnableQUIC = true } - if ctx.IsSet(EnableCommitteeAwarePacking.Name) { - logEnabled(EnableCommitteeAwarePacking) - cfg.EnableCommitteeAwarePacking = true + if ctx.IsSet(DisableCommitteeAwarePacking.Name) { + logEnabled(DisableCommitteeAwarePacking) + cfg.DisableCommitteeAwarePacking = true } cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value} diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index d5754bcff61c..d9a6e67c4213 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -77,6 +77,12 @@ var ( Usage: deprecatedUsage, Hidden: true, } + + deprecatedEnableCommitteeAwarePacking = &cli.BoolFlag{ + Name: "enable-committee-aware-packing", + Usage: deprecatedUsage, + Hidden: true, + } ) // Deprecated flags for both the beacon node and validator client. @@ -94,6 +100,7 @@ var deprecatedFlags = []cli.Flag{ deprecatedBeaconRPCGatewayProviderFlag, deprecatedDisableGRPCGateway, deprecatedEnableExperimentalState, + deprecatedEnableCommitteeAwarePacking, } // deprecatedBeaconFlags contains flags that are still used by other components diff --git a/config/features/flags.go b/config/features/flags.go index 361bb66e02c6..2dc5b8473d70 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -166,9 +166,9 @@ var ( Name: "enable-quic", Usage: "Enables connection using the QUIC protocol for peers which support it.", } - EnableCommitteeAwarePacking = &cli.BoolFlag{ - Name: "enable-committee-aware-packing", - Usage: "Changes the attestation packing algorithm to one that is aware of attesting committees.", + DisableCommitteeAwarePacking = &cli.BoolFlag{ + Name: "disable-committee-aware-packing", + Usage: "Changes the attestation packing algorithm to one that is not aware of attesting committees.", } ) @@ -226,7 +226,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c EnableLightClient, BlobSaveFsync, EnableQUIC, - EnableCommitteeAwarePacking, + DisableCommitteeAwarePacking, }...)...) // E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E. From 884b663455aea917ba839ea7919219213867854d Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 7 Oct 2024 11:33:23 -0300 Subject: [PATCH 315/325] Move back ConvertKzgCommitmentToVersionedHash to primitives package (#14508) * Move back ConvertKzgCommitmentToVersionedHash to primitives package * Changelog --- CHANGELOG.md | 1 + beacon-chain/blockchain/execution_engine.go | 11 +---------- beacon-chain/rpc/eth/events/BUILD.bazel | 1 + beacon-chain/rpc/eth/events/events.go | 4 ++-- consensus-types/primitives/BUILD.bazel | 2 ++ consensus-types/primitives/kzg.go | 15 +++++++++++++++ 6 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 consensus-types/primitives/kzg.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6406fac571d4..ed4472c6efea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Updated Libp2p Dependencies to allow prysm to use gossipsub v1.2 . - Updated Sepolia bootnodes. - Make committee aware packing the default by deprecating `--enable-committee-aware-packing`. +- Moved `ConvertKzgCommitmentToVersionedHash` to the `primitives` package. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 387bc552e9cc..9e7e440718cf 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -2,7 +2,6 @@ package blockchain import ( "context" - "crypto/sha256" "fmt" "github.com/ethereum/go-ethereum/common" @@ -28,8 +27,6 @@ import ( "github.com/sirupsen/logrus" ) -const blobCommitmentVersionKZG uint8 = 0x01 - var defaultLatestValidHash = bytesutil.PadTo([]byte{0xff}, 32) // notifyForkchoiceUpdate signals execution engine the fork choice updates. Execution engine should: @@ -402,13 +399,7 @@ func kzgCommitmentsToVersionedHashes(body interfaces.ReadOnlyBeaconBlockBody) ([ versionedHashes := make([]common.Hash, len(commitments)) for i, commitment := range commitments { - versionedHashes[i] = ConvertKzgCommitmentToVersionedHash(commitment) + versionedHashes[i] = primitives.ConvertKzgCommitmentToVersionedHash(commitment) } return versionedHashes, nil } - -func ConvertKzgCommitmentToVersionedHash(commitment []byte) common.Hash { - versionedHash := sha256.Sum256(commitment) - versionedHash[0] = blobCommitmentVersionKZG - return versionedHash -} diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index 8a549d05f872..caa311b6b515 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//beacon-chain/core/time:go_default_library", "//beacon-chain/core/transition:go_default_library", "//config/params:go_default_library", + "//consensus-types/primitives:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index fe753d8714dd..28e31fc9840f 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -13,7 +13,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/server/structs" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" @@ -21,6 +20,7 @@ import ( chaintime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" @@ -447,7 +447,7 @@ func (s *Server) lazyReaderForEvent(ctx context.Context, event *feed.Event, topi }, nil case *operation.BlobSidecarReceivedData: return func() io.Reader { - versionedHash := blockchain.ConvertKzgCommitmentToVersionedHash(v.Blob.KzgCommitment) + versionedHash := primitives.ConvertKzgCommitmentToVersionedHash(v.Blob.KzgCommitment) return jsonMarshalReader(eventName, &structs.BlobSidecarEvent{ BlockRoot: hexutil.Encode(v.Blob.BlockRootSlice()), Index: fmt.Sprintf("%d", v.Blob.Index), diff --git a/consensus-types/primitives/BUILD.bazel b/consensus-types/primitives/BUILD.bazel index 96506f9315f3..f9258a41145c 100644 --- a/consensus-types/primitives/BUILD.bazel +++ b/consensus-types/primitives/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "domain.go", "epoch.go", "execution_address.go", + "kzg.go", "payload_id.go", "randao.go", "slot.go", @@ -21,6 +22,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//math:go_default_library", + "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", ], diff --git a/consensus-types/primitives/kzg.go b/consensus-types/primitives/kzg.go new file mode 100644 index 000000000000..c59b5557d52f --- /dev/null +++ b/consensus-types/primitives/kzg.go @@ -0,0 +1,15 @@ +package primitives + +import ( + "crypto/sha256" + + "github.com/ethereum/go-ethereum/common" +) + +const blobCommitmentVersionKZG uint8 = 0x01 + +func ConvertKzgCommitmentToVersionedHash(commitment []byte) common.Hash { + versionedHash := sha256.Sum256(commitment) + versionedHash[0] = blobCommitmentVersionKZG + return versionedHash +} From cfbfccb203eba6c41d21276dc88ef348dcb993ab Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:35:10 -0500 Subject: [PATCH 316/325] Fix: validator status cache does not clear upon key removal (#14504) * adding fix and unit test * Update validator.go Co-authored-by: Preston Van Loon * fixing linting --------- Co-authored-by: Preston Van Loon --- validator/client/validator.go | 5 ++- validator/client/validator_test.go | 60 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/validator/client/validator.go b/validator/client/validator.go index d6eca9ae6fee..b0b62f004d47 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -1262,13 +1262,16 @@ func (v *validator) updateValidatorStatusCache(ctx context.Context, pubkeys [][f if len(resp.Statuses) != len(resp.Indices) { return fmt.Errorf("expected %d indices in status, received %d", len(resp.Statuses), len(resp.Indices)) } + pubkeyToStatus := make(map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus, len(resp.Statuses)) for i, s := range resp.Statuses { - v.pubkeyToStatus[bytesutil.ToBytes48(resp.PublicKeys[i])] = &validatorStatus{ + pubkeyToStatus[bytesutil.ToBytes48(resp.PublicKeys[i])] = &validatorStatus{ publicKey: resp.PublicKeys[i], status: s, index: resp.Indices[i], } } + v.pubkeyToStatus = pubkeyToStatus + return nil } diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 56abfd651b6b..a707e0bcab48 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -2908,3 +2908,63 @@ func TestValidator_ChangeHost(t *testing.T) { v.ChangeHost() assert.Equal(t, uint64(0), v.currentHostIndex) } + +func TestUpdateValidatorStatusCache(t *testing.T) { + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + pubkeys := [][fieldparams.BLSPubkeyLength]byte{ + {0x01}, + {0x02}, + } + statusRequestKeys := [][]byte{ + pubkeys[0][:], + pubkeys[1][:], + } + + client := validatormock.NewMockValidatorClient(ctrl) + mockResponse := ðpb.MultipleValidatorStatusResponse{ + PublicKeys: statusRequestKeys, + Statuses: []*ethpb.ValidatorStatusResponse{ + { + Status: ethpb.ValidatorStatus_ACTIVE, + }, { + Status: ethpb.ValidatorStatus_EXITING, + }}, + Indices: []primitives.ValidatorIndex{1, 2}, + } + client.EXPECT().MultipleValidatorStatus( + gomock.Any(), + gomock.Any()).Return(mockResponse, nil) + + v := &validator{ + validatorClient: client, + beaconNodeHosts: []string{"http://localhost:8080", "http://localhost:8081"}, + currentHostIndex: 0, + pubkeyToStatus: map[[fieldparams.BLSPubkeyLength]byte]*validatorStatus{ + [fieldparams.BLSPubkeyLength]byte{0x03}: &validatorStatus{ // add non existant key and status to cache, should be fully removed on update + publicKey: []byte{0x03}, + status: ðpb.ValidatorStatusResponse{ + Status: ethpb.ValidatorStatus_ACTIVE, + }, + index: 3, + }, + }, + } + + err := v.updateValidatorStatusCache(ctx, pubkeys) + assert.NoError(t, err) + + // make sure the nonexistant key is fully removed + _, ok := v.pubkeyToStatus[[fieldparams.BLSPubkeyLength]byte{0x03}] + require.Equal(t, false, ok) + // make sure we only have the added values + assert.Equal(t, 2, len(v.pubkeyToStatus)) + for i, pk := range pubkeys { + status, exists := v.pubkeyToStatus[pk] + require.Equal(t, true, exists) + require.DeepEqual(t, pk[:], status.publicKey) + require.Equal(t, mockResponse.Statuses[i], status.status) + require.Equal(t, mockResponse.Indices[i], status.index) + } +} From 7fc5c714a162b86f9c90536e8ccc3fe392a549df Mon Sep 17 00:00:00 2001 From: Bastin <43618253+Inspector-Butters@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:07:56 +0200 Subject: [PATCH 317/325] Light Client consensus types (#14518) * protos/SSZ * interfaces * types * cleanup/dedup * changelog * use createBranch in headers * error handling --------- Co-authored-by: rkapka --- CHANGELOG.md | 1 + beacon-chain/core/light-client/lightclient.go | 4 +- beacon-chain/rpc/eth/light-client/helpers.go | 8 +- .../rpc/eth/light-client/helpers_test.go | 6 +- config/fieldparams/mainnet.go | 4 +- config/fieldparams/minimal.go | 4 +- consensus-types/interfaces/BUILD.bazel | 1 + consensus-types/interfaces/light_client.go | 58 + consensus-types/light-client/BUILD.bazel | 26 + consensus-types/light-client/bootstrap.go | 208 ++ .../light-client/finality_update.go | 251 +++ consensus-types/light-client/header.go | 192 ++ consensus-types/light-client/helpers.go | 30 + .../light-client/optimistic_update.go | 178 ++ consensus-types/light-client/update.go | 305 +++ proto/prysm/v1alpha1/BUILD.bazel | 16 + proto/prysm/v1alpha1/altair.ssz.go | 647 +++++- proto/prysm/v1alpha1/capella.ssz.go | 873 +++++++- proto/prysm/v1alpha1/deneb.ssz.go | 873 +++++++- proto/prysm/v1alpha1/light_client.pb.go | 1759 +++++++++++++++++ proto/prysm/v1alpha1/light_client.proto | 134 ++ 21 files changed, 5564 insertions(+), 14 deletions(-) create mode 100644 consensus-types/interfaces/light_client.go create mode 100644 consensus-types/light-client/BUILD.bazel create mode 100644 consensus-types/light-client/bootstrap.go create mode 100644 consensus-types/light-client/finality_update.go create mode 100644 consensus-types/light-client/header.go create mode 100644 consensus-types/light-client/helpers.go create mode 100644 consensus-types/light-client/optimistic_update.go create mode 100644 consensus-types/light-client/update.go create mode 100755 proto/prysm/v1alpha1/light_client.pb.go create mode 100644 proto/prysm/v1alpha1/light_client.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index ed4472c6efea..868c3a872fcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Light client support: Add light client database changes. - Light client support: Implement capella and deneb changes. - Light client support: Implement `BlockToLightClientHeader` function. +- Light client support: Consensus types. - GetBeaconStateV2: add Electra case. - Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875) - Tests to ensure sepolia config matches the official upstream yaml diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index 8af89d2b7893..3c1b8a552db1 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -243,8 +243,8 @@ func createDefaultLightClientUpdate() (*ethpbv2.LightClientUpdate, error) { Pubkeys: pubKeys, AggregatePubkey: make([]byte, fieldparams.BLSPubkeyLength), } - nextSyncCommitteeBranch := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) - for i := 0; i < fieldparams.NextSyncCommitteeBranchDepth; i++ { + nextSyncCommitteeBranch := make([][]byte, fieldparams.SyncCommitteeBranchDepth) + for i := 0; i < fieldparams.SyncCommitteeBranchDepth; i++ { nextSyncCommitteeBranch[i] = make([]byte, fieldparams.RootLength) } executionBranch := make([][]byte, executionBranchNumOfLeaves) diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index c9750c448fa4..251364c1d50b 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -91,7 +91,7 @@ func createLightClientBootstrapAltair(ctx context.Context, state state.BeaconSta return nil, errors.Wrap(err, "could not get current sync committee proof") } - branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + branch := make([]string, fieldparams.SyncCommitteeBranchDepth) for i, proof := range currentSyncCommitteeProof { branch[i] = hexutil.Encode(proof) } @@ -159,7 +159,7 @@ func createLightClientBootstrapCapella(ctx context.Context, state state.BeaconSt return nil, errors.Wrap(err, "could not get current sync committee proof") } - branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + branch := make([]string, fieldparams.SyncCommitteeBranchDepth) for i, proof := range currentSyncCommitteeProof { branch[i] = hexutil.Encode(proof) } @@ -227,7 +227,7 @@ func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconStat return nil, errors.Wrap(err, "could not get current sync committee proof") } - branch := make([]string, fieldparams.NextSyncCommitteeBranchDepth) + branch := make([]string, fieldparams.SyncCommitteeBranchDepth) for i, proof := range currentSyncCommitteeProof { branch[i] = hexutil.Encode(proof) } @@ -288,7 +288,7 @@ func newLightClientOptimisticUpdateFromBeaconState( } func IsSyncCommitteeUpdate(update *v2.LightClientUpdate) bool { - nextSyncCommitteeBranch := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) + nextSyncCommitteeBranch := make([][]byte, fieldparams.SyncCommitteeBranchDepth) return !reflect.DeepEqual(update.NextSyncCommitteeBranch, nextSyncCommitteeBranch) } diff --git a/beacon-chain/rpc/eth/light-client/helpers_test.go b/beacon-chain/rpc/eth/light-client/helpers_test.go index 726527ef8be4..9b27204fc22e 100644 --- a/beacon-chain/rpc/eth/light-client/helpers_test.go +++ b/beacon-chain/rpc/eth/light-client/helpers_test.go @@ -13,7 +13,7 @@ import ( // When the update has relevant sync committee func createNonEmptySyncCommitteeBranch() [][]byte { - res := make([][]byte, fieldparams.NextSyncCommitteeBranchDepth) + res := make([][]byte, fieldparams.SyncCommitteeBranchDepth) res[0] = []byte("xyz") return res } @@ -101,7 +101,7 @@ func TestIsBetterUpdate(t *testing.T) { }}, }, }, - NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), + NextSyncCommitteeBranch: make([][]byte, fieldparams.SyncCommitteeBranchDepth), SignatureSlot: 9999, }, newUpdate: ðpbv2.LightClientUpdate{ @@ -147,7 +147,7 @@ func TestIsBetterUpdate(t *testing.T) { }}, }, }, - NextSyncCommitteeBranch: make([][]byte, fieldparams.NextSyncCommitteeBranchDepth), + NextSyncCommitteeBranch: make([][]byte, fieldparams.SyncCommitteeBranchDepth), SignatureSlot: 9999, }, expectedResult: false, diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index 17aeed23f8ba..a773da403e95 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -33,7 +33,9 @@ const ( BlobSize = 131072 // defined to match blob.size in bazel ssz codegen BlobSidecarSize = 131928 // defined to match blob sidecar size in bazel ssz codegen KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item - NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. + ExecutionBranchDepth = 4 // ExecutionBranchDepth defines the number of leaves in a merkle proof of the execution payload header. + SyncCommitteeBranchDepth = 5 // SyncCommitteeBranchDepth defines the number of leaves in a merkle proof of a sync committee. + FinalityBranchDepth = 6 // FinalityBranchDepth defines the number of leaves in a merkle proof of the finalized checkpoint root. PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. PendingPartialWithdrawalsLimit = 134217728 // Maximum number of pending partial withdrawals in the beacon state. PendingConsolidationsLimit = 262144 // Maximum number of pending consolidations in the beacon state. diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index ac022e5823ea..5f135f639b43 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -33,7 +33,9 @@ const ( BlobSize = 131072 // defined to match blob.size in bazel ssz codegen BlobSidecarSize = 131928 // defined to match blob sidecar size in bazel ssz codegen KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item - NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. + ExecutionBranchDepth = 4 // ExecutionBranchDepth defines the number of leaves in a merkle proof of the execution payload header. + SyncCommitteeBranchDepth = 5 // SyncCommitteeBranchDepth defines the number of leaves in a merkle proof of a sync committee. + FinalityBranchDepth = 6 // FinalityBranchDepth defines the number of leaves in a merkle proof of the finalized checkpoint root. PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. PendingPartialWithdrawalsLimit = 64 // Maximum number of pending partial withdrawals in the beacon state. PendingConsolidationsLimit = 64 // Maximum number of pending consolidations in the beacon state. diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index 9e17fe3adf00..51b9c89816c0 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -5,6 +5,7 @@ go_library( srcs = [ "beacon_block.go", "error.go", + "light_client.go", "utils.go", "validator.go", ], diff --git a/consensus-types/interfaces/light_client.go b/consensus-types/interfaces/light_client.go new file mode 100644 index 000000000000..a0719b3a3729 --- /dev/null +++ b/consensus-types/interfaces/light_client.go @@ -0,0 +1,58 @@ +package interfaces + +import ( + ssz "github.com/prysmaticlabs/fastssz" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +type LightClientExecutionBranch = [fieldparams.ExecutionBranchDepth][fieldparams.RootLength]byte +type LightClientSyncCommitteeBranch = [fieldparams.SyncCommitteeBranchDepth][fieldparams.RootLength]byte +type LightClientFinalityBranch = [fieldparams.FinalityBranchDepth][fieldparams.RootLength]byte + +type LightClientHeader interface { + ssz.Marshaler + Version() int + Beacon() *pb.BeaconBlockHeader + Execution() (ExecutionData, error) + ExecutionBranch() (LightClientExecutionBranch, error) +} + +type LightClientBootstrap interface { + ssz.Marshaler + Version() int + Header() LightClientHeader + CurrentSyncCommittee() *pb.SyncCommittee + CurrentSyncCommitteeBranch() LightClientSyncCommitteeBranch +} + +type LightClientUpdate interface { + ssz.Marshaler + Version() int + AttestedHeader() LightClientHeader + NextSyncCommittee() *pb.SyncCommittee + NextSyncCommitteeBranch() LightClientSyncCommitteeBranch + FinalizedHeader() LightClientHeader + FinalityBranch() LightClientFinalityBranch + SyncAggregate() *pb.SyncAggregate + SignatureSlot() primitives.Slot +} + +type LightClientFinalityUpdate interface { + ssz.Marshaler + Version() int + AttestedHeader() LightClientHeader + FinalizedHeader() LightClientHeader + FinalityBranch() LightClientFinalityBranch + SyncAggregate() *pb.SyncAggregate + SignatureSlot() primitives.Slot +} + +type LightClientOptimisticUpdate interface { + ssz.Marshaler + Version() int + AttestedHeader() LightClientHeader + SyncAggregate() *pb.SyncAggregate + SignatureSlot() primitives.Slot +} diff --git a/consensus-types/light-client/BUILD.bazel b/consensus-types/light-client/BUILD.bazel new file mode 100644 index 000000000000..151f22b522f9 --- /dev/null +++ b/consensus-types/light-client/BUILD.bazel @@ -0,0 +1,26 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "bootstrap.go", + "finality_update.go", + "header.go", + "helpers.go", + "optimistic_update.go", + "update.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/consensus-types/light-client", + visibility = ["//visibility:public"], + deps = [ + "//config/fieldparams:go_default_library", + "//consensus-types:go_default_library", + "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", + "//consensus-types/primitives:go_default_library", + "//encoding/bytesutil:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", + ], +) diff --git a/consensus-types/light-client/bootstrap.go b/consensus-types/light-client/bootstrap.go new file mode 100644 index 000000000000..ec97de605877 --- /dev/null +++ b/consensus-types/light-client/bootstrap.go @@ -0,0 +1,208 @@ +package light_client + +import ( + "fmt" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensustypes "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +func NewWrappedBootstrap(m proto.Message) (interfaces.LightClientBootstrap, error) { + if m == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + switch t := m.(type) { + case *pb.LightClientBootstrapAltair: + return NewWrappedBootstrapAltair(t) + case *pb.LightClientBootstrapCapella: + return NewWrappedBootstrapCapella(t) + case *pb.LightClientBootstrapDeneb: + return NewWrappedBootstrapDeneb(t) + default: + return nil, fmt.Errorf("cannot construct light client bootstrap from type %T", t) + } +} + +type bootstrapAltair struct { + p *pb.LightClientBootstrapAltair + header interfaces.LightClientHeader + currentSyncCommitteeBranch interfaces.LightClientSyncCommitteeBranch +} + +var _ interfaces.LightClientBootstrap = &bootstrapAltair{} + +func NewWrappedBootstrapAltair(p *pb.LightClientBootstrapAltair) (interfaces.LightClientBootstrap, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + header, err := NewWrappedHeaderAltair(p.Header) + if err != nil { + return nil, err + } + branch, err := createBranch[interfaces.LightClientSyncCommitteeBranch]( + "sync committee", + p.CurrentSyncCommitteeBranch, + fieldparams.SyncCommitteeBranchDepth, + ) + if err != nil { + return nil, err + } + + return &bootstrapAltair{ + p: p, + header: header, + currentSyncCommitteeBranch: branch, + }, nil +} + +func (h *bootstrapAltair) MarshalSSZTo(dst []byte) ([]byte, error) { + return h.p.MarshalSSZTo(dst) +} + +func (h *bootstrapAltair) MarshalSSZ() ([]byte, error) { + return h.p.MarshalSSZ() +} + +func (h *bootstrapAltair) SizeSSZ() int { + return h.p.SizeSSZ() +} + +func (h *bootstrapAltair) Version() int { + return version.Altair +} + +func (h *bootstrapAltair) Header() interfaces.LightClientHeader { + return h.header +} + +func (h *bootstrapAltair) CurrentSyncCommittee() *pb.SyncCommittee { + return h.p.CurrentSyncCommittee +} + +func (h *bootstrapAltair) CurrentSyncCommitteeBranch() interfaces.LightClientSyncCommitteeBranch { + return h.currentSyncCommitteeBranch +} + +type bootstrapCapella struct { + p *pb.LightClientBootstrapCapella + header interfaces.LightClientHeader + currentSyncCommitteeBranch interfaces.LightClientSyncCommitteeBranch +} + +var _ interfaces.LightClientBootstrap = &bootstrapCapella{} + +func NewWrappedBootstrapCapella(p *pb.LightClientBootstrapCapella) (interfaces.LightClientBootstrap, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + header, err := NewWrappedHeaderCapella(p.Header) + if err != nil { + return nil, err + } + branch, err := createBranch[interfaces.LightClientSyncCommitteeBranch]( + "sync committee", + p.CurrentSyncCommitteeBranch, + fieldparams.SyncCommitteeBranchDepth, + ) + if err != nil { + return nil, err + } + + return &bootstrapCapella{ + p: p, + header: header, + currentSyncCommitteeBranch: branch, + }, nil +} + +func (h *bootstrapCapella) MarshalSSZTo(dst []byte) ([]byte, error) { + return h.p.MarshalSSZTo(dst) +} + +func (h *bootstrapCapella) MarshalSSZ() ([]byte, error) { + return h.p.MarshalSSZ() +} + +func (h *bootstrapCapella) SizeSSZ() int { + return h.p.SizeSSZ() +} + +func (h *bootstrapCapella) Version() int { + return version.Capella +} + +func (h *bootstrapCapella) Header() interfaces.LightClientHeader { + return h.header +} + +func (h *bootstrapCapella) CurrentSyncCommittee() *pb.SyncCommittee { + return h.p.CurrentSyncCommittee +} + +func (h *bootstrapCapella) CurrentSyncCommitteeBranch() interfaces.LightClientSyncCommitteeBranch { + return h.currentSyncCommitteeBranch +} + +type bootstrapDeneb struct { + p *pb.LightClientBootstrapDeneb + header interfaces.LightClientHeader + currentSyncCommitteeBranch interfaces.LightClientSyncCommitteeBranch +} + +var _ interfaces.LightClientBootstrap = &bootstrapDeneb{} + +func NewWrappedBootstrapDeneb(p *pb.LightClientBootstrapDeneb) (interfaces.LightClientBootstrap, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + header, err := NewWrappedHeaderDeneb(p.Header) + if err != nil { + return nil, err + } + branch, err := createBranch[interfaces.LightClientSyncCommitteeBranch]( + "sync committee", + p.CurrentSyncCommitteeBranch, + fieldparams.SyncCommitteeBranchDepth, + ) + if err != nil { + return nil, err + } + + return &bootstrapDeneb{ + p: p, + header: header, + currentSyncCommitteeBranch: branch, + }, nil +} + +func (h *bootstrapDeneb) MarshalSSZTo(dst []byte) ([]byte, error) { + return h.p.MarshalSSZTo(dst) +} + +func (h *bootstrapDeneb) MarshalSSZ() ([]byte, error) { + return h.p.MarshalSSZ() +} + +func (h *bootstrapDeneb) SizeSSZ() int { + return h.p.SizeSSZ() +} + +func (h *bootstrapDeneb) Version() int { + return version.Deneb +} + +func (h *bootstrapDeneb) Header() interfaces.LightClientHeader { + return h.header +} + +func (h *bootstrapDeneb) CurrentSyncCommittee() *pb.SyncCommittee { + return h.p.CurrentSyncCommittee +} + +func (h *bootstrapDeneb) CurrentSyncCommitteeBranch() interfaces.LightClientSyncCommitteeBranch { + return h.currentSyncCommitteeBranch +} diff --git a/consensus-types/light-client/finality_update.go b/consensus-types/light-client/finality_update.go new file mode 100644 index 000000000000..37de560e60ed --- /dev/null +++ b/consensus-types/light-client/finality_update.go @@ -0,0 +1,251 @@ +package light_client + +import ( + "fmt" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensustypes "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +func NewWrappedFinalityUpdate(m proto.Message) (interfaces.LightClientFinalityUpdate, error) { + if m == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + switch t := m.(type) { + case *pb.LightClientFinalityUpdateAltair: + return NewWrappedFinalityUpdateAltair(t) + case *pb.LightClientFinalityUpdateCapella: + return NewWrappedFinalityUpdateCapella(t) + case *pb.LightClientFinalityUpdateDeneb: + return NewWrappedFinalityUpdateDeneb(t) + default: + return nil, fmt.Errorf("cannot construct light client finality update from type %T", t) + } +} + +type finalityUpdateAltair struct { + p *pb.LightClientFinalityUpdateAltair + attestedHeader interfaces.LightClientHeader + finalizedHeader interfaces.LightClientHeader + finalityBranch interfaces.LightClientFinalityBranch +} + +var _ interfaces.LightClientFinalityUpdate = &finalityUpdateAltair{} + +func NewWrappedFinalityUpdateAltair(p *pb.LightClientFinalityUpdateAltair) (interfaces.LightClientFinalityUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderAltair(p.AttestedHeader) + if err != nil { + return nil, err + } + finalizedHeader, err := NewWrappedHeaderAltair(p.FinalizedHeader) + if err != nil { + return nil, err + } + branch, err := createBranch[interfaces.LightClientFinalityBranch]( + "finality", + p.FinalityBranch, + fieldparams.FinalityBranchDepth, + ) + if err != nil { + return nil, err + } + + return &finalityUpdateAltair{ + p: p, + attestedHeader: attestedHeader, + finalizedHeader: finalizedHeader, + finalityBranch: branch, + }, nil +} + +func (u *finalityUpdateAltair) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *finalityUpdateAltair) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *finalityUpdateAltair) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *finalityUpdateAltair) Version() int { + return version.Altair +} + +func (u *finalityUpdateAltair) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *finalityUpdateAltair) FinalizedHeader() interfaces.LightClientHeader { + return u.finalizedHeader +} + +func (u *finalityUpdateAltair) FinalityBranch() interfaces.LightClientFinalityBranch { + return u.finalityBranch +} + +func (u *finalityUpdateAltair) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *finalityUpdateAltair) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} + +type finalityUpdateCapella struct { + p *pb.LightClientFinalityUpdateCapella + attestedHeader interfaces.LightClientHeader + finalizedHeader interfaces.LightClientHeader + finalityBranch interfaces.LightClientFinalityBranch +} + +var _ interfaces.LightClientFinalityUpdate = &finalityUpdateCapella{} + +func NewWrappedFinalityUpdateCapella(p *pb.LightClientFinalityUpdateCapella) (interfaces.LightClientFinalityUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderCapella(p.AttestedHeader) + if err != nil { + return nil, err + } + finalizedHeader, err := NewWrappedHeaderCapella(p.FinalizedHeader) + if err != nil { + return nil, err + } + branch, err := createBranch[interfaces.LightClientFinalityBranch]( + "finality", + p.FinalityBranch, + fieldparams.FinalityBranchDepth, + ) + if err != nil { + return nil, err + } + + return &finalityUpdateCapella{ + p: p, + attestedHeader: attestedHeader, + finalizedHeader: finalizedHeader, + finalityBranch: branch, + }, nil +} + +func (u *finalityUpdateCapella) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *finalityUpdateCapella) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *finalityUpdateCapella) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *finalityUpdateCapella) Version() int { + return version.Capella +} + +func (u *finalityUpdateCapella) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *finalityUpdateCapella) FinalizedHeader() interfaces.LightClientHeader { + return u.finalizedHeader +} + +func (u *finalityUpdateCapella) FinalityBranch() interfaces.LightClientFinalityBranch { + return u.finalityBranch +} + +func (u *finalityUpdateCapella) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *finalityUpdateCapella) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} + +type finalityUpdateDeneb struct { + p *pb.LightClientFinalityUpdateDeneb + attestedHeader interfaces.LightClientHeader + finalizedHeader interfaces.LightClientHeader + finalityBranch interfaces.LightClientFinalityBranch +} + +var _ interfaces.LightClientFinalityUpdate = &finalityUpdateDeneb{} + +func NewWrappedFinalityUpdateDeneb(p *pb.LightClientFinalityUpdateDeneb) (interfaces.LightClientFinalityUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderDeneb(p.AttestedHeader) + if err != nil { + return nil, err + } + finalizedHeader, err := NewWrappedHeaderDeneb(p.FinalizedHeader) + if err != nil { + return nil, err + } + branch, err := createBranch[interfaces.LightClientFinalityBranch]( + "finality", + p.FinalityBranch, + fieldparams.FinalityBranchDepth, + ) + if err != nil { + return nil, err + } + + return &finalityUpdateDeneb{ + p: p, + attestedHeader: attestedHeader, + finalizedHeader: finalizedHeader, + finalityBranch: branch, + }, nil +} + +func (u *finalityUpdateDeneb) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *finalityUpdateDeneb) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *finalityUpdateDeneb) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *finalityUpdateDeneb) Version() int { + return version.Deneb +} + +func (u *finalityUpdateDeneb) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *finalityUpdateDeneb) FinalizedHeader() interfaces.LightClientHeader { + return u.finalizedHeader +} + +func (u *finalityUpdateDeneb) FinalityBranch() interfaces.LightClientFinalityBranch { + return u.finalityBranch +} + +func (u *finalityUpdateDeneb) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *finalityUpdateDeneb) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} diff --git a/consensus-types/light-client/header.go b/consensus-types/light-client/header.go new file mode 100644 index 000000000000..496a48424c7e --- /dev/null +++ b/consensus-types/light-client/header.go @@ -0,0 +1,192 @@ +package light_client + +import ( + "fmt" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensustypes "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +func NewWrappedHeader(m proto.Message) (interfaces.LightClientHeader, error) { + if m == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + switch t := m.(type) { + case *pb.LightClientHeaderAltair: + return NewWrappedHeaderAltair(t) + case *pb.LightClientHeaderCapella: + return NewWrappedHeaderCapella(t) + case *pb.LightClientHeaderDeneb: + return NewWrappedHeaderDeneb(t) + default: + return nil, fmt.Errorf("cannot construct light client header from type %T", t) + } +} + +type headerAltair struct { + p *pb.LightClientHeaderAltair +} + +var _ interfaces.LightClientHeader = &headerAltair{} + +func NewWrappedHeaderAltair(p *pb.LightClientHeaderAltair) (interfaces.LightClientHeader, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + return &headerAltair{p: p}, nil +} + +func (h *headerAltair) MarshalSSZTo(dst []byte) ([]byte, error) { + return h.p.MarshalSSZTo(dst) +} + +func (h *headerAltair) MarshalSSZ() ([]byte, error) { + return h.p.MarshalSSZ() +} + +func (h *headerAltair) SizeSSZ() int { + return h.p.SizeSSZ() +} + +func (h *headerAltair) Version() int { + return version.Altair +} + +func (h *headerAltair) Beacon() *pb.BeaconBlockHeader { + return h.p.Beacon +} + +func (h *headerAltair) Execution() (interfaces.ExecutionData, error) { + return nil, consensustypes.ErrNotSupported("Execution", version.Altair) +} + +func (h *headerAltair) ExecutionBranch() (interfaces.LightClientExecutionBranch, error) { + return interfaces.LightClientExecutionBranch{}, consensustypes.ErrNotSupported("ExecutionBranch", version.Altair) +} + +type headerCapella struct { + p *pb.LightClientHeaderCapella + execution interfaces.ExecutionData + executionBranch interfaces.LightClientExecutionBranch +} + +var _ interfaces.LightClientHeader = &headerCapella{} + +func NewWrappedHeaderCapella(p *pb.LightClientHeaderCapella) (interfaces.LightClientHeader, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + execution, err := blocks.WrappedExecutionPayloadHeaderCapella(p.Execution) + if err != nil { + return nil, err + } + + branch, err := createBranch[interfaces.LightClientExecutionBranch]( + "execution", + p.ExecutionBranch, + fieldparams.ExecutionBranchDepth, + ) + if err != nil { + return nil, err + } + + return &headerCapella{ + p: p, + execution: execution, + executionBranch: branch, + }, nil +} + +func (h *headerCapella) MarshalSSZTo(dst []byte) ([]byte, error) { + return h.p.MarshalSSZTo(dst) +} + +func (h *headerCapella) MarshalSSZ() ([]byte, error) { + return h.p.MarshalSSZ() +} + +func (h *headerCapella) SizeSSZ() int { + return h.p.SizeSSZ() +} + +func (h *headerCapella) Version() int { + return version.Capella +} + +func (h *headerCapella) Beacon() *pb.BeaconBlockHeader { + return h.p.Beacon +} + +func (h *headerCapella) Execution() (interfaces.ExecutionData, error) { + return h.execution, nil +} + +func (h *headerCapella) ExecutionBranch() (interfaces.LightClientExecutionBranch, error) { + return h.executionBranch, nil +} + +type headerDeneb struct { + p *pb.LightClientHeaderDeneb + execution interfaces.ExecutionData + executionBranch interfaces.LightClientExecutionBranch +} + +var _ interfaces.LightClientHeader = &headerDeneb{} + +func NewWrappedHeaderDeneb(p *pb.LightClientHeaderDeneb) (interfaces.LightClientHeader, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + execution, err := blocks.WrappedExecutionPayloadHeaderDeneb(p.Execution) + if err != nil { + return nil, err + } + + branch, err := createBranch[interfaces.LightClientExecutionBranch]( + "execution", + p.ExecutionBranch, + fieldparams.ExecutionBranchDepth, + ) + if err != nil { + return nil, err + } + + return &headerDeneb{ + p: p, + execution: execution, + executionBranch: branch, + }, nil +} + +func (h *headerDeneb) MarshalSSZTo(dst []byte) ([]byte, error) { + return h.p.MarshalSSZTo(dst) +} + +func (h *headerDeneb) MarshalSSZ() ([]byte, error) { + return h.p.MarshalSSZ() +} + +func (h *headerDeneb) SizeSSZ() int { + return h.p.SizeSSZ() +} + +func (h *headerDeneb) Version() int { + return version.Deneb +} + +func (h *headerDeneb) Beacon() *pb.BeaconBlockHeader { + return h.p.Beacon +} + +func (h *headerDeneb) Execution() (interfaces.ExecutionData, error) { + return h.execution, nil +} + +func (h *headerDeneb) ExecutionBranch() (interfaces.LightClientExecutionBranch, error) { + return h.executionBranch, nil +} diff --git a/consensus-types/light-client/helpers.go b/consensus-types/light-client/helpers.go new file mode 100644 index 000000000000..c2fc9b05922c --- /dev/null +++ b/consensus-types/light-client/helpers.go @@ -0,0 +1,30 @@ +package light_client + +import ( + "fmt" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" +) + +type branchConstraint interface { + ~interfaces.LightClientExecutionBranch | ~interfaces.LightClientSyncCommitteeBranch | ~interfaces.LightClientFinalityBranch +} + +func createBranch[T branchConstraint](name string, input [][]byte, depth int) (T, error) { + var zero T + + if len(input) != depth { + return zero, fmt.Errorf("%s branch has %d leaves instead of expected %d", name, len(input), depth) + } + var branch T + for i, leaf := range input { + if len(leaf) != fieldparams.RootLength { + return zero, fmt.Errorf("%s branch leaf at index %d has length %d instead of expected %d", name, i, len(leaf), fieldparams.RootLength) + } + branch[i] = bytesutil.ToBytes32(leaf) + } + + return branch, nil +} diff --git a/consensus-types/light-client/optimistic_update.go b/consensus-types/light-client/optimistic_update.go new file mode 100644 index 000000000000..f1f43d12cfa4 --- /dev/null +++ b/consensus-types/light-client/optimistic_update.go @@ -0,0 +1,178 @@ +package light_client + +import ( + "fmt" + + consensustypes "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +func NewWrappedOptimisticUpdate(m proto.Message) (interfaces.LightClientOptimisticUpdate, error) { + if m == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + switch t := m.(type) { + case *pb.LightClientOptimisticUpdateAltair: + return NewWrappedOptimisticUpdateAltair(t) + case *pb.LightClientOptimisticUpdateCapella: + return NewWrappedOptimisticUpdateCapella(t) + case *pb.LightClientOptimisticUpdateDeneb: + return NewWrappedOptimisticUpdateDeneb(t) + default: + return nil, fmt.Errorf("cannot construct light client optimistic update from type %T", t) + } +} + +type OptimisticUpdateAltair struct { + p *pb.LightClientOptimisticUpdateAltair + attestedHeader interfaces.LightClientHeader +} + +var _ interfaces.LightClientOptimisticUpdate = &OptimisticUpdateAltair{} + +func NewWrappedOptimisticUpdateAltair(p *pb.LightClientOptimisticUpdateAltair) (interfaces.LightClientOptimisticUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderAltair(p.AttestedHeader) + if err != nil { + return nil, err + } + + return &OptimisticUpdateAltair{ + p: p, + attestedHeader: attestedHeader, + }, nil +} + +func (u *OptimisticUpdateAltair) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *OptimisticUpdateAltair) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *OptimisticUpdateAltair) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *OptimisticUpdateAltair) Version() int { + return version.Altair +} + +func (u *OptimisticUpdateAltair) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *OptimisticUpdateAltair) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *OptimisticUpdateAltair) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} + +type OptimisticUpdateCapella struct { + p *pb.LightClientOptimisticUpdateCapella + attestedHeader interfaces.LightClientHeader +} + +var _ interfaces.LightClientOptimisticUpdate = &OptimisticUpdateCapella{} + +func NewWrappedOptimisticUpdateCapella(p *pb.LightClientOptimisticUpdateCapella) (interfaces.LightClientOptimisticUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderCapella(p.AttestedHeader) + if err != nil { + return nil, err + } + + return &OptimisticUpdateCapella{ + p: p, + attestedHeader: attestedHeader, + }, nil +} + +func (u *OptimisticUpdateCapella) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *OptimisticUpdateCapella) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *OptimisticUpdateCapella) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *OptimisticUpdateCapella) Version() int { + return version.Capella +} + +func (u *OptimisticUpdateCapella) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *OptimisticUpdateCapella) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *OptimisticUpdateCapella) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} + +type OptimisticUpdateDeneb struct { + p *pb.LightClientOptimisticUpdateDeneb + attestedHeader interfaces.LightClientHeader +} + +var _ interfaces.LightClientOptimisticUpdate = &OptimisticUpdateDeneb{} + +func NewWrappedOptimisticUpdateDeneb(p *pb.LightClientOptimisticUpdateDeneb) (interfaces.LightClientOptimisticUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderDeneb(p.AttestedHeader) + if err != nil { + return nil, err + } + + return &OptimisticUpdateDeneb{ + p: p, + attestedHeader: attestedHeader, + }, nil +} + +func (u *OptimisticUpdateDeneb) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *OptimisticUpdateDeneb) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *OptimisticUpdateDeneb) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *OptimisticUpdateDeneb) Version() int { + return version.Deneb +} + +func (u *OptimisticUpdateDeneb) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *OptimisticUpdateDeneb) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *OptimisticUpdateDeneb) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} diff --git a/consensus-types/light-client/update.go b/consensus-types/light-client/update.go new file mode 100644 index 000000000000..00430e393a98 --- /dev/null +++ b/consensus-types/light-client/update.go @@ -0,0 +1,305 @@ +package light_client + +import ( + "fmt" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + consensustypes "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +func NewWrappedUpdate(m proto.Message) (interfaces.LightClientUpdate, error) { + if m == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + switch t := m.(type) { + case *pb.LightClientUpdateAltair: + return NewWrappedUpdateAltair(t) + case *pb.LightClientUpdateCapella: + return NewWrappedUpdateCapella(t) + case *pb.LightClientUpdateDeneb: + return NewWrappedUpdateDeneb(t) + default: + return nil, fmt.Errorf("cannot construct light client update from type %T", t) + } +} + +type updateAltair struct { + p *pb.LightClientUpdateAltair + attestedHeader interfaces.LightClientHeader + nextSyncCommitteeBranch interfaces.LightClientSyncCommitteeBranch + finalizedHeader interfaces.LightClientHeader + finalityBranch interfaces.LightClientFinalityBranch +} + +var _ interfaces.LightClientUpdate = &updateAltair{} + +func NewWrappedUpdateAltair(p *pb.LightClientUpdateAltair) (interfaces.LightClientUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderAltair(p.AttestedHeader) + if err != nil { + return nil, err + } + finalizedHeader, err := NewWrappedHeaderAltair(p.FinalizedHeader) + if err != nil { + return nil, err + } + scBranch, err := createBranch[interfaces.LightClientSyncCommitteeBranch]( + "sync committee", + p.NextSyncCommitteeBranch, + fieldparams.SyncCommitteeBranchDepth, + ) + if err != nil { + return nil, err + } + finalityBranch, err := createBranch[interfaces.LightClientFinalityBranch]( + "finality", + p.FinalityBranch, + fieldparams.FinalityBranchDepth, + ) + if err != nil { + return nil, err + } + + return &updateAltair{ + p: p, + attestedHeader: attestedHeader, + nextSyncCommitteeBranch: scBranch, + finalizedHeader: finalizedHeader, + finalityBranch: finalityBranch, + }, nil +} + +func (u *updateAltair) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *updateAltair) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *updateAltair) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *updateAltair) Version() int { + return version.Altair +} + +func (u *updateAltair) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *updateAltair) NextSyncCommittee() *pb.SyncCommittee { + return u.p.NextSyncCommittee +} + +func (u *updateAltair) NextSyncCommitteeBranch() interfaces.LightClientSyncCommitteeBranch { + return u.nextSyncCommitteeBranch +} + +func (u *updateAltair) FinalizedHeader() interfaces.LightClientHeader { + return u.finalizedHeader +} + +func (u *updateAltair) FinalityBranch() interfaces.LightClientFinalityBranch { + return u.finalityBranch +} + +func (u *updateAltair) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *updateAltair) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} + +type updateCapella struct { + p *pb.LightClientUpdateCapella + attestedHeader interfaces.LightClientHeader + nextSyncCommitteeBranch interfaces.LightClientSyncCommitteeBranch + finalizedHeader interfaces.LightClientHeader + finalityBranch interfaces.LightClientFinalityBranch +} + +var _ interfaces.LightClientUpdate = &updateCapella{} + +func NewWrappedUpdateCapella(p *pb.LightClientUpdateCapella) (interfaces.LightClientUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderCapella(p.AttestedHeader) + if err != nil { + return nil, err + } + finalizedHeader, err := NewWrappedHeaderCapella(p.FinalizedHeader) + if err != nil { + return nil, err + } + scBranch, err := createBranch[interfaces.LightClientSyncCommitteeBranch]( + "sync committee", + p.NextSyncCommitteeBranch, + fieldparams.SyncCommitteeBranchDepth, + ) + if err != nil { + return nil, err + } + finalityBranch, err := createBranch[interfaces.LightClientFinalityBranch]( + "finality", + p.FinalityBranch, + fieldparams.FinalityBranchDepth, + ) + if err != nil { + return nil, err + } + + return &updateCapella{ + p: p, + attestedHeader: attestedHeader, + nextSyncCommitteeBranch: scBranch, + finalizedHeader: finalizedHeader, + finalityBranch: finalityBranch, + }, nil +} + +func (u *updateCapella) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *updateCapella) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *updateCapella) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *updateCapella) Version() int { + return version.Capella +} + +func (u *updateCapella) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *updateCapella) NextSyncCommittee() *pb.SyncCommittee { + return u.p.NextSyncCommittee +} + +func (u *updateCapella) NextSyncCommitteeBranch() interfaces.LightClientSyncCommitteeBranch { + return u.nextSyncCommitteeBranch +} + +func (u *updateCapella) FinalizedHeader() interfaces.LightClientHeader { + return u.finalizedHeader +} + +func (u *updateCapella) FinalityBranch() interfaces.LightClientFinalityBranch { + return u.finalityBranch +} + +func (u *updateCapella) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *updateCapella) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} + +type updateDeneb struct { + p *pb.LightClientUpdateDeneb + attestedHeader interfaces.LightClientHeader + nextSyncCommitteeBranch interfaces.LightClientSyncCommitteeBranch + finalizedHeader interfaces.LightClientHeader + finalityBranch interfaces.LightClientFinalityBranch +} + +var _ interfaces.LightClientUpdate = &updateDeneb{} + +func NewWrappedUpdateDeneb(p *pb.LightClientUpdateDeneb) (interfaces.LightClientUpdate, error) { + if p == nil { + return nil, consensustypes.ErrNilObjectWrapped + } + attestedHeader, err := NewWrappedHeaderDeneb(p.AttestedHeader) + if err != nil { + return nil, err + } + finalizedHeader, err := NewWrappedHeaderDeneb(p.FinalizedHeader) + if err != nil { + return nil, err + } + scBranch, err := createBranch[interfaces.LightClientSyncCommitteeBranch]( + "sync committee", + p.NextSyncCommitteeBranch, + fieldparams.SyncCommitteeBranchDepth, + ) + if err != nil { + return nil, err + } + finalityBranch, err := createBranch[interfaces.LightClientFinalityBranch]( + "finality", + p.FinalityBranch, + fieldparams.FinalityBranchDepth, + ) + if err != nil { + return nil, err + } + + return &updateDeneb{ + p: p, + attestedHeader: attestedHeader, + nextSyncCommitteeBranch: scBranch, + finalizedHeader: finalizedHeader, + finalityBranch: finalityBranch, + }, nil +} + +func (u *updateDeneb) MarshalSSZTo(dst []byte) ([]byte, error) { + return u.p.MarshalSSZTo(dst) +} + +func (u *updateDeneb) MarshalSSZ() ([]byte, error) { + return u.p.MarshalSSZ() +} + +func (u *updateDeneb) SizeSSZ() int { + return u.p.SizeSSZ() +} + +func (u *updateDeneb) Version() int { + return version.Deneb +} + +func (u *updateDeneb) AttestedHeader() interfaces.LightClientHeader { + return u.attestedHeader +} + +func (u *updateDeneb) NextSyncCommittee() *pb.SyncCommittee { + return u.p.NextSyncCommittee +} + +func (u *updateDeneb) NextSyncCommitteeBranch() interfaces.LightClientSyncCommitteeBranch { + return u.nextSyncCommitteeBranch +} + +func (u *updateDeneb) FinalizedHeader() interfaces.LightClientHeader { + return u.finalizedHeader +} + +func (u *updateDeneb) FinalityBranch() interfaces.LightClientFinalityBranch { + return u.finalityBranch +} + +func (u *updateDeneb) SyncAggregate() *pb.SyncAggregate { + return u.p.SyncAggregate +} + +func (u *updateDeneb) SignatureSlot() primitives.Slot { + return u.p.SignatureSlot +} diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index a9a86e533354..e1245051e02f 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -81,6 +81,11 @@ ssz_altair_objs = [ "BeaconBlockBodyAltair", "BeaconStateAltair", "ContributionAndProof", + "LightClientBootstrapAltair", + "LightClientFinalityUpdateAltair", + "LightClientHeaderAltair", + "LightClientOptimisticUpdateAltair", + "LightClientUpdateAltair", "SignedBeaconBlockAltair", "SignedContributionAndProof", "SyncAggregate", @@ -110,6 +115,11 @@ ssz_capella_objs = [ "BlindedBeaconBlockCapella", "BuilderBidCapella", "HistoricalSummary", + "LightClientBootstrapCapella", + "LightClientFinalityUpdateCapella", + "LightClientHeaderCapella", + "LightClientOptimisticUpdateCapella", + "LightClientUpdateCapella", "SignedBLSToExecutionChange", "SignedBeaconBlockCapella", "SignedBlindedBeaconBlockCapella", @@ -127,6 +137,11 @@ ssz_deneb_objs = [ "BlobSidecar", "BlobSidecars", "BuilderBidDeneb", + "LightClientBootstrapDeneb", + "LightClientFinalityUpdateDeneb", + "LightClientHeaderDeneb", + "LightClientOptimisticUpdateDeneb", + "LightClientUpdateDeneb", "SignedBeaconBlockContentsDeneb", "SignedBeaconBlockDeneb", "SignedBlindedBeaconBlockDeneb", @@ -334,6 +349,7 @@ ssz_proto_files( "beacon_block.proto", "beacon_state.proto", "blobs.proto", + "light_client.proto", "sync_committee.proto", "withdrawals.proto", ], diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go index 166f17e1f1c8..8700124222b5 100644 --- a/proto/prysm/v1alpha1/altair.ssz.go +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: bb838fc0c2dfdadd4a8274dd1b438b1051f7b84d7c8e7470900621284dba8f43 +// Hash: 54ff8b768faa21e2d838e9f6be78af4dfeb76d3d46b32072c09faa16bd2393ea package eth import ( @@ -1747,6 +1747,651 @@ func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err erro return } +// MarshalSSZ ssz marshals the LightClientHeaderAltair object +func (l *LightClientHeaderAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientHeaderAltair object to a target array +func (l *LightClientHeaderAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Beacon' + if l.Beacon == nil { + l.Beacon = new(BeaconBlockHeader) + } + if dst, err = l.Beacon.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientHeaderAltair object +func (l *LightClientHeaderAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 112 { + return ssz.ErrSize + } + + // Field (0) 'Beacon' + if l.Beacon == nil { + l.Beacon = new(BeaconBlockHeader) + } + if err = l.Beacon.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientHeaderAltair object +func (l *LightClientHeaderAltair) SizeSSZ() (size int) { + size = 112 + return +} + +// HashTreeRoot ssz hashes the LightClientHeaderAltair object +func (l *LightClientHeaderAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientHeaderAltair object with a hasher +func (l *LightClientHeaderAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Beacon' + if err = l.Beacon.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientBootstrapAltair object +func (l *LightClientBootstrapAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientBootstrapAltair object to a target array +func (l *LightClientBootstrapAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Header' + if l.Header == nil { + l.Header = new(LightClientHeaderAltair) + } + if dst, err = l.Header.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'CurrentSyncCommittee' + if l.CurrentSyncCommittee == nil { + l.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = l.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'CurrentSyncCommitteeBranch' + if size := len(l.CurrentSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5) + return + } + for ii := 0; ii < 5; ii++ { + if size := len(l.CurrentSyncCommitteeBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.CurrentSyncCommitteeBranch[ii]", size, 32) + return + } + dst = append(dst, l.CurrentSyncCommitteeBranch[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientBootstrapAltair object +func (l *LightClientBootstrapAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 24896 { + return ssz.ErrSize + } + + // Field (0) 'Header' + if l.Header == nil { + l.Header = new(LightClientHeaderAltair) + } + if err = l.Header.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Field (1) 'CurrentSyncCommittee' + if l.CurrentSyncCommittee == nil { + l.CurrentSyncCommittee = new(SyncCommittee) + } + if err = l.CurrentSyncCommittee.UnmarshalSSZ(buf[112:24736]); err != nil { + return err + } + + // Field (2) 'CurrentSyncCommitteeBranch' + l.CurrentSyncCommitteeBranch = make([][]byte, 5) + for ii := 0; ii < 5; ii++ { + if cap(l.CurrentSyncCommitteeBranch[ii]) == 0 { + l.CurrentSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24736:24896][ii*32:(ii+1)*32])) + } + l.CurrentSyncCommitteeBranch[ii] = append(l.CurrentSyncCommitteeBranch[ii], buf[24736:24896][ii*32:(ii+1)*32]...) + } + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapAltair object +func (l *LightClientBootstrapAltair) SizeSSZ() (size int) { + size = 24896 + return +} + +// HashTreeRoot ssz hashes the LightClientBootstrapAltair object +func (l *LightClientBootstrapAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientBootstrapAltair object with a hasher +func (l *LightClientBootstrapAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = l.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'CurrentSyncCommittee' + if err = l.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'CurrentSyncCommitteeBranch' + { + if size := len(l.CurrentSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5) + return + } + subIndx := hh.Index() + for _, i := range l.CurrentSyncCommitteeBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientUpdateAltair object +func (l *LightClientUpdateAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientUpdateAltair object to a target array +func (l *LightClientUpdateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderAltair) + } + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'NextSyncCommittee' + if l.NextSyncCommittee == nil { + l.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = l.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'NextSyncCommitteeBranch' + if size := len(l.NextSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5) + return + } + for ii := 0; ii < 5; ii++ { + if size := len(l.NextSyncCommitteeBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.NextSyncCommitteeBranch[ii]", size, 32) + return + } + dst = append(dst, l.NextSyncCommitteeBranch[ii]...) + } + + // Field (3) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderAltair) + } + if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'FinalityBranch' + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + for ii := 0; ii < 6; ii++ { + if size := len(l.FinalityBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32) + return + } + dst = append(dst, l.FinalityBranch[ii]...) + } + + // Field (5) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (6) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientUpdateAltair object +func (l *LightClientUpdateAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 25368 { + return ssz.ErrSize + } + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderAltair) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Field (1) 'NextSyncCommittee' + if l.NextSyncCommittee == nil { + l.NextSyncCommittee = new(SyncCommittee) + } + if err = l.NextSyncCommittee.UnmarshalSSZ(buf[112:24736]); err != nil { + return err + } + + // Field (2) 'NextSyncCommitteeBranch' + l.NextSyncCommitteeBranch = make([][]byte, 5) + for ii := 0; ii < 5; ii++ { + if cap(l.NextSyncCommitteeBranch[ii]) == 0 { + l.NextSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24736:24896][ii*32:(ii+1)*32])) + } + l.NextSyncCommitteeBranch[ii] = append(l.NextSyncCommitteeBranch[ii], buf[24736:24896][ii*32:(ii+1)*32]...) + } + + // Field (3) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderAltair) + } + if err = l.FinalizedHeader.UnmarshalSSZ(buf[24896:25008]); err != nil { + return err + } + + // Field (4) 'FinalityBranch' + l.FinalityBranch = make([][]byte, 6) + for ii := 0; ii < 6; ii++ { + if cap(l.FinalityBranch[ii]) == 0 { + l.FinalityBranch[ii] = make([]byte, 0, len(buf[25008:25200][ii*32:(ii+1)*32])) + } + l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[25008:25200][ii*32:(ii+1)*32]...) + } + + // Field (5) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[25200:25360]); err != nil { + return err + } + + // Field (6) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[25360:25368])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateAltair object +func (l *LightClientUpdateAltair) SizeSSZ() (size int) { + size = 25368 + return +} + +// HashTreeRoot ssz hashes the LightClientUpdateAltair object +func (l *LightClientUpdateAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientUpdateAltair object with a hasher +func (l *LightClientUpdateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'NextSyncCommittee' + if err = l.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'NextSyncCommitteeBranch' + { + if size := len(l.NextSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5) + return + } + subIndx := hh.Index() + for _, i := range l.NextSyncCommitteeBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (3) 'FinalizedHeader' + if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'FinalityBranch' + { + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + subIndx := hh.Index() + for _, i := range l.FinalityBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (5) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (6) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientFinalityUpdateAltair object +func (l *LightClientFinalityUpdateAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientFinalityUpdateAltair object to a target array +func (l *LightClientFinalityUpdateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderAltair) + } + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderAltair) + } + if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'FinalityBranch' + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + for ii := 0; ii < 6; ii++ { + if size := len(l.FinalityBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32) + return + } + dst = append(dst, l.FinalityBranch[ii]...) + } + + // Field (3) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateAltair object +func (l *LightClientFinalityUpdateAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 584 { + return ssz.ErrSize + } + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderAltair) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Field (1) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderAltair) + } + if err = l.FinalizedHeader.UnmarshalSSZ(buf[112:224]); err != nil { + return err + } + + // Field (2) 'FinalityBranch' + l.FinalityBranch = make([][]byte, 6) + for ii := 0; ii < 6; ii++ { + if cap(l.FinalityBranch[ii]) == 0 { + l.FinalityBranch[ii] = make([]byte, 0, len(buf[224:416][ii*32:(ii+1)*32])) + } + l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[224:416][ii*32:(ii+1)*32]...) + } + + // Field (3) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[416:576]); err != nil { + return err + } + + // Field (4) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[576:584])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateAltair object +func (l *LightClientFinalityUpdateAltair) SizeSSZ() (size int) { + size = 584 + return +} + +// HashTreeRoot ssz hashes the LightClientFinalityUpdateAltair object +func (l *LightClientFinalityUpdateAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientFinalityUpdateAltair object with a hasher +func (l *LightClientFinalityUpdateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'FinalizedHeader' + if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'FinalityBranch' + { + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + subIndx := hh.Index() + for _, i := range l.FinalityBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (3) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientOptimisticUpdateAltair object +func (l *LightClientOptimisticUpdateAltair) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientOptimisticUpdateAltair object to a target array +func (l *LightClientOptimisticUpdateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderAltair) + } + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateAltair object +func (l *LightClientOptimisticUpdateAltair) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 280 { + return ssz.ErrSize + } + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderAltair) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Field (1) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[112:272]); err != nil { + return err + } + + // Field (2) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[272:280])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateAltair object +func (l *LightClientOptimisticUpdateAltair) SizeSSZ() (size int) { + size = 280 + return +} + +// HashTreeRoot ssz hashes the LightClientOptimisticUpdateAltair object +func (l *LightClientOptimisticUpdateAltair) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientOptimisticUpdateAltair object with a hasher +func (l *LightClientOptimisticUpdateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the SyncCommitteeMessage object func (s *SyncCommitteeMessage) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index ff1f01bad017..5428e1e0b499 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: a5507ef7d71897486989f37eb4dbb19fc2c49e7c47f244291a9f3122c9bfe546 +// Hash: 7133c698cd96aab07bbef1347ea98e6ccbd2c5c30d1e7d0f32977b9a7335d9d3 package eth import ( @@ -2729,6 +2729,877 @@ func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the LightClientHeaderCapella object +func (l *LightClientHeaderCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientHeaderCapella object to a target array +func (l *LightClientHeaderCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(244) + + // Field (0) 'Beacon' + if l.Beacon == nil { + l.Beacon = new(BeaconBlockHeader) + } + if dst, err = l.Beacon.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (1) 'Execution' + dst = ssz.WriteOffset(dst, offset) + if l.Execution == nil { + l.Execution = new(v1.ExecutionPayloadHeaderCapella) + } + offset += l.Execution.SizeSSZ() + + // Field (2) 'ExecutionBranch' + if size := len(l.ExecutionBranch); size != 4 { + err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4) + return + } + for ii := 0; ii < 4; ii++ { + if size := len(l.ExecutionBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.ExecutionBranch[ii]", size, 32) + return + } + dst = append(dst, l.ExecutionBranch[ii]...) + } + + // Field (1) 'Execution' + if dst, err = l.Execution.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientHeaderCapella object +func (l *LightClientHeaderCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 244 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'Beacon' + if l.Beacon == nil { + l.Beacon = new(BeaconBlockHeader) + } + if err = l.Beacon.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Offset (1) 'Execution' + if o1 = ssz.ReadOffset(buf[112:116]); o1 > size { + return ssz.ErrOffset + } + + if o1 != 244 { + return ssz.ErrInvalidVariableOffset + } + + // Field (2) 'ExecutionBranch' + l.ExecutionBranch = make([][]byte, 4) + for ii := 0; ii < 4; ii++ { + if cap(l.ExecutionBranch[ii]) == 0 { + l.ExecutionBranch[ii] = make([]byte, 0, len(buf[116:244][ii*32:(ii+1)*32])) + } + l.ExecutionBranch[ii] = append(l.ExecutionBranch[ii], buf[116:244][ii*32:(ii+1)*32]...) + } + + // Field (1) 'Execution' + { + buf = tail[o1:] + if l.Execution == nil { + l.Execution = new(v1.ExecutionPayloadHeaderCapella) + } + if err = l.Execution.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientHeaderCapella object +func (l *LightClientHeaderCapella) SizeSSZ() (size int) { + size = 244 + + // Field (1) 'Execution' + if l.Execution == nil { + l.Execution = new(v1.ExecutionPayloadHeaderCapella) + } + size += l.Execution.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientHeaderCapella object +func (l *LightClientHeaderCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientHeaderCapella object with a hasher +func (l *LightClientHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Beacon' + if err = l.Beacon.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Execution' + if err = l.Execution.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'ExecutionBranch' + { + if size := len(l.ExecutionBranch); size != 4 { + err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4) + return + } + subIndx := hh.Index() + for _, i := range l.ExecutionBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientBootstrapCapella object +func (l *LightClientBootstrapCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientBootstrapCapella object to a target array +func (l *LightClientBootstrapCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(24788) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if l.Header == nil { + l.Header = new(LightClientHeaderCapella) + } + offset += l.Header.SizeSSZ() + + // Field (1) 'CurrentSyncCommittee' + if l.CurrentSyncCommittee == nil { + l.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = l.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'CurrentSyncCommitteeBranch' + if size := len(l.CurrentSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5) + return + } + for ii := 0; ii < 5; ii++ { + if size := len(l.CurrentSyncCommitteeBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.CurrentSyncCommitteeBranch[ii]", size, 32) + return + } + dst = append(dst, l.CurrentSyncCommitteeBranch[ii]...) + } + + // Field (0) 'Header' + if dst, err = l.Header.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientBootstrapCapella object +func (l *LightClientBootstrapCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 24788 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 24788 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'CurrentSyncCommittee' + if l.CurrentSyncCommittee == nil { + l.CurrentSyncCommittee = new(SyncCommittee) + } + if err = l.CurrentSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil { + return err + } + + // Field (2) 'CurrentSyncCommitteeBranch' + l.CurrentSyncCommitteeBranch = make([][]byte, 5) + for ii := 0; ii < 5; ii++ { + if cap(l.CurrentSyncCommitteeBranch[ii]) == 0 { + l.CurrentSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32])) + } + l.CurrentSyncCommitteeBranch[ii] = append(l.CurrentSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...) + } + + // Field (0) 'Header' + { + buf = tail[o0:] + if l.Header == nil { + l.Header = new(LightClientHeaderCapella) + } + if err = l.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapCapella object +func (l *LightClientBootstrapCapella) SizeSSZ() (size int) { + size = 24788 + + // Field (0) 'Header' + if l.Header == nil { + l.Header = new(LightClientHeaderCapella) + } + size += l.Header.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientBootstrapCapella object +func (l *LightClientBootstrapCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientBootstrapCapella object with a hasher +func (l *LightClientBootstrapCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = l.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'CurrentSyncCommittee' + if err = l.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'CurrentSyncCommitteeBranch' + { + if size := len(l.CurrentSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5) + return + } + subIndx := hh.Index() + for _, i := range l.CurrentSyncCommitteeBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientUpdateCapella object +func (l *LightClientUpdateCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientUpdateCapella object to a target array +func (l *LightClientUpdateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(25152) + + // Offset (0) 'AttestedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + offset += l.AttestedHeader.SizeSSZ() + + // Field (1) 'NextSyncCommittee' + if l.NextSyncCommittee == nil { + l.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = l.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'NextSyncCommitteeBranch' + if size := len(l.NextSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5) + return + } + for ii := 0; ii < 5; ii++ { + if size := len(l.NextSyncCommitteeBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.NextSyncCommitteeBranch[ii]", size, 32) + return + } + dst = append(dst, l.NextSyncCommitteeBranch[ii]...) + } + + // Offset (3) 'FinalizedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderCapella) + } + offset += l.FinalizedHeader.SizeSSZ() + + // Field (4) 'FinalityBranch' + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + for ii := 0; ii < 6; ii++ { + if size := len(l.FinalityBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32) + return + } + dst = append(dst, l.FinalityBranch[ii]...) + } + + // Field (5) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (6) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + // Field (0) 'AttestedHeader' + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (3) 'FinalizedHeader' + if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientUpdateCapella object +func (l *LightClientUpdateCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 25152 { + return ssz.ErrSize + } + + tail := buf + var o0, o3 uint64 + + // Offset (0) 'AttestedHeader' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 25152 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'NextSyncCommittee' + if l.NextSyncCommittee == nil { + l.NextSyncCommittee = new(SyncCommittee) + } + if err = l.NextSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil { + return err + } + + // Field (2) 'NextSyncCommitteeBranch' + l.NextSyncCommitteeBranch = make([][]byte, 5) + for ii := 0; ii < 5; ii++ { + if cap(l.NextSyncCommitteeBranch[ii]) == 0 { + l.NextSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32])) + } + l.NextSyncCommitteeBranch[ii] = append(l.NextSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...) + } + + // Offset (3) 'FinalizedHeader' + if o3 = ssz.ReadOffset(buf[24788:24792]); o3 > size || o0 > o3 { + return ssz.ErrOffset + } + + // Field (4) 'FinalityBranch' + l.FinalityBranch = make([][]byte, 6) + for ii := 0; ii < 6; ii++ { + if cap(l.FinalityBranch[ii]) == 0 { + l.FinalityBranch[ii] = make([]byte, 0, len(buf[24792:24984][ii*32:(ii+1)*32])) + } + l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[24792:24984][ii*32:(ii+1)*32]...) + } + + // Field (5) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[24984:25144]); err != nil { + return err + } + + // Field (6) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[25144:25152])) + + // Field (0) 'AttestedHeader' + { + buf = tail[o0:o3] + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (3) 'FinalizedHeader' + { + buf = tail[o3:] + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderCapella) + } + if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateCapella object +func (l *LightClientUpdateCapella) SizeSSZ() (size int) { + size = 25152 + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + size += l.AttestedHeader.SizeSSZ() + + // Field (3) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderCapella) + } + size += l.FinalizedHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientUpdateCapella object +func (l *LightClientUpdateCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientUpdateCapella object with a hasher +func (l *LightClientUpdateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'NextSyncCommittee' + if err = l.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'NextSyncCommitteeBranch' + { + if size := len(l.NextSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5) + return + } + subIndx := hh.Index() + for _, i := range l.NextSyncCommitteeBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (3) 'FinalizedHeader' + if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'FinalityBranch' + { + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + subIndx := hh.Index() + for _, i := range l.FinalityBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (5) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (6) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientFinalityUpdateCapella object +func (l *LightClientFinalityUpdateCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientFinalityUpdateCapella object to a target array +func (l *LightClientFinalityUpdateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(368) + + // Offset (0) 'AttestedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + offset += l.AttestedHeader.SizeSSZ() + + // Offset (1) 'FinalizedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderCapella) + } + offset += l.FinalizedHeader.SizeSSZ() + + // Field (2) 'FinalityBranch' + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + for ii := 0; ii < 6; ii++ { + if size := len(l.FinalityBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32) + return + } + dst = append(dst, l.FinalityBranch[ii]...) + } + + // Field (3) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + // Field (0) 'AttestedHeader' + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'FinalizedHeader' + if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateCapella object +func (l *LightClientFinalityUpdateCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 368 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'AttestedHeader' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 368 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'FinalizedHeader' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (2) 'FinalityBranch' + l.FinalityBranch = make([][]byte, 6) + for ii := 0; ii < 6; ii++ { + if cap(l.FinalityBranch[ii]) == 0 { + l.FinalityBranch[ii] = make([]byte, 0, len(buf[8:200][ii*32:(ii+1)*32])) + } + l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[8:200][ii*32:(ii+1)*32]...) + } + + // Field (3) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[200:360]); err != nil { + return err + } + + // Field (4) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[360:368])) + + // Field (0) 'AttestedHeader' + { + buf = tail[o0:o1] + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'FinalizedHeader' + { + buf = tail[o1:] + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderCapella) + } + if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateCapella object +func (l *LightClientFinalityUpdateCapella) SizeSSZ() (size int) { + size = 368 + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + size += l.AttestedHeader.SizeSSZ() + + // Field (1) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderCapella) + } + size += l.FinalizedHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientFinalityUpdateCapella object +func (l *LightClientFinalityUpdateCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientFinalityUpdateCapella object with a hasher +func (l *LightClientFinalityUpdateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'FinalizedHeader' + if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'FinalityBranch' + { + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + subIndx := hh.Index() + for _, i := range l.FinalityBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (3) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientOptimisticUpdateCapella object +func (l *LightClientOptimisticUpdateCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientOptimisticUpdateCapella object to a target array +func (l *LightClientOptimisticUpdateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(172) + + // Offset (0) 'AttestedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + offset += l.AttestedHeader.SizeSSZ() + + // Field (1) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + // Field (0) 'AttestedHeader' + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateCapella object +func (l *LightClientOptimisticUpdateCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 172 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AttestedHeader' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 172 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[4:164]); err != nil { + return err + } + + // Field (2) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[164:172])) + + // Field (0) 'AttestedHeader' + { + buf = tail[o0:] + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateCapella object +func (l *LightClientOptimisticUpdateCapella) SizeSSZ() (size int) { + size = 172 + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderCapella) + } + size += l.AttestedHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientOptimisticUpdateCapella object +func (l *LightClientOptimisticUpdateCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientOptimisticUpdateCapella object with a hasher +func (l *LightClientOptimisticUpdateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the BLSToExecutionChange object func (b *BLSToExecutionChange) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index 356ebb7780db..71356e7d8e34 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 4c3e6932bf84838e8de21e5c121c14d03cbccb051c3990d3b924932f531f4d30 +// Hash: b829ba09699058dc63b76a5eb5a03ce3d7d19b0d94b9e7fca06056f9f2f8b317 package eth import ( @@ -3593,3 +3593,874 @@ func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.Merkleize(indx) return } + +// MarshalSSZ ssz marshals the LightClientHeaderDeneb object +func (l *LightClientHeaderDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientHeaderDeneb object to a target array +func (l *LightClientHeaderDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(244) + + // Field (0) 'Beacon' + if l.Beacon == nil { + l.Beacon = new(BeaconBlockHeader) + } + if dst, err = l.Beacon.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (1) 'Execution' + dst = ssz.WriteOffset(dst, offset) + if l.Execution == nil { + l.Execution = new(v1.ExecutionPayloadHeaderDeneb) + } + offset += l.Execution.SizeSSZ() + + // Field (2) 'ExecutionBranch' + if size := len(l.ExecutionBranch); size != 4 { + err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4) + return + } + for ii := 0; ii < 4; ii++ { + if size := len(l.ExecutionBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.ExecutionBranch[ii]", size, 32) + return + } + dst = append(dst, l.ExecutionBranch[ii]...) + } + + // Field (1) 'Execution' + if dst, err = l.Execution.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientHeaderDeneb object +func (l *LightClientHeaderDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 244 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'Beacon' + if l.Beacon == nil { + l.Beacon = new(BeaconBlockHeader) + } + if err = l.Beacon.UnmarshalSSZ(buf[0:112]); err != nil { + return err + } + + // Offset (1) 'Execution' + if o1 = ssz.ReadOffset(buf[112:116]); o1 > size { + return ssz.ErrOffset + } + + if o1 != 244 { + return ssz.ErrInvalidVariableOffset + } + + // Field (2) 'ExecutionBranch' + l.ExecutionBranch = make([][]byte, 4) + for ii := 0; ii < 4; ii++ { + if cap(l.ExecutionBranch[ii]) == 0 { + l.ExecutionBranch[ii] = make([]byte, 0, len(buf[116:244][ii*32:(ii+1)*32])) + } + l.ExecutionBranch[ii] = append(l.ExecutionBranch[ii], buf[116:244][ii*32:(ii+1)*32]...) + } + + // Field (1) 'Execution' + { + buf = tail[o1:] + if l.Execution == nil { + l.Execution = new(v1.ExecutionPayloadHeaderDeneb) + } + if err = l.Execution.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientHeaderDeneb object +func (l *LightClientHeaderDeneb) SizeSSZ() (size int) { + size = 244 + + // Field (1) 'Execution' + if l.Execution == nil { + l.Execution = new(v1.ExecutionPayloadHeaderDeneb) + } + size += l.Execution.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientHeaderDeneb object +func (l *LightClientHeaderDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientHeaderDeneb object with a hasher +func (l *LightClientHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Beacon' + if err = l.Beacon.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Execution' + if err = l.Execution.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'ExecutionBranch' + { + if size := len(l.ExecutionBranch); size != 4 { + err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4) + return + } + subIndx := hh.Index() + for _, i := range l.ExecutionBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientBootstrapDeneb object +func (l *LightClientBootstrapDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientBootstrapDeneb object to a target array +func (l *LightClientBootstrapDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(24788) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if l.Header == nil { + l.Header = new(LightClientHeaderDeneb) + } + offset += l.Header.SizeSSZ() + + // Field (1) 'CurrentSyncCommittee' + if l.CurrentSyncCommittee == nil { + l.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = l.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'CurrentSyncCommitteeBranch' + if size := len(l.CurrentSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5) + return + } + for ii := 0; ii < 5; ii++ { + if size := len(l.CurrentSyncCommitteeBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.CurrentSyncCommitteeBranch[ii]", size, 32) + return + } + dst = append(dst, l.CurrentSyncCommitteeBranch[ii]...) + } + + // Field (0) 'Header' + if dst, err = l.Header.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientBootstrapDeneb object +func (l *LightClientBootstrapDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 24788 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 24788 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'CurrentSyncCommittee' + if l.CurrentSyncCommittee == nil { + l.CurrentSyncCommittee = new(SyncCommittee) + } + if err = l.CurrentSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil { + return err + } + + // Field (2) 'CurrentSyncCommitteeBranch' + l.CurrentSyncCommitteeBranch = make([][]byte, 5) + for ii := 0; ii < 5; ii++ { + if cap(l.CurrentSyncCommitteeBranch[ii]) == 0 { + l.CurrentSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32])) + } + l.CurrentSyncCommitteeBranch[ii] = append(l.CurrentSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...) + } + + // Field (0) 'Header' + { + buf = tail[o0:] + if l.Header == nil { + l.Header = new(LightClientHeaderDeneb) + } + if err = l.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapDeneb object +func (l *LightClientBootstrapDeneb) SizeSSZ() (size int) { + size = 24788 + + // Field (0) 'Header' + if l.Header == nil { + l.Header = new(LightClientHeaderDeneb) + } + size += l.Header.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientBootstrapDeneb object +func (l *LightClientBootstrapDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientBootstrapDeneb object with a hasher +func (l *LightClientBootstrapDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = l.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'CurrentSyncCommittee' + if err = l.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'CurrentSyncCommitteeBranch' + { + if size := len(l.CurrentSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5) + return + } + subIndx := hh.Index() + for _, i := range l.CurrentSyncCommitteeBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientUpdateDeneb object +func (l *LightClientUpdateDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientUpdateDeneb object to a target array +func (l *LightClientUpdateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(25152) + + // Offset (0) 'AttestedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + offset += l.AttestedHeader.SizeSSZ() + + // Field (1) 'NextSyncCommittee' + if l.NextSyncCommittee == nil { + l.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = l.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'NextSyncCommitteeBranch' + if size := len(l.NextSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5) + return + } + for ii := 0; ii < 5; ii++ { + if size := len(l.NextSyncCommitteeBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.NextSyncCommitteeBranch[ii]", size, 32) + return + } + dst = append(dst, l.NextSyncCommitteeBranch[ii]...) + } + + // Offset (3) 'FinalizedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderDeneb) + } + offset += l.FinalizedHeader.SizeSSZ() + + // Field (4) 'FinalityBranch' + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + for ii := 0; ii < 6; ii++ { + if size := len(l.FinalityBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32) + return + } + dst = append(dst, l.FinalityBranch[ii]...) + } + + // Field (5) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (6) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + // Field (0) 'AttestedHeader' + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (3) 'FinalizedHeader' + if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientUpdateDeneb object +func (l *LightClientUpdateDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 25152 { + return ssz.ErrSize + } + + tail := buf + var o0, o3 uint64 + + // Offset (0) 'AttestedHeader' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 25152 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'NextSyncCommittee' + if l.NextSyncCommittee == nil { + l.NextSyncCommittee = new(SyncCommittee) + } + if err = l.NextSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil { + return err + } + + // Field (2) 'NextSyncCommitteeBranch' + l.NextSyncCommitteeBranch = make([][]byte, 5) + for ii := 0; ii < 5; ii++ { + if cap(l.NextSyncCommitteeBranch[ii]) == 0 { + l.NextSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32])) + } + l.NextSyncCommitteeBranch[ii] = append(l.NextSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...) + } + + // Offset (3) 'FinalizedHeader' + if o3 = ssz.ReadOffset(buf[24788:24792]); o3 > size || o0 > o3 { + return ssz.ErrOffset + } + + // Field (4) 'FinalityBranch' + l.FinalityBranch = make([][]byte, 6) + for ii := 0; ii < 6; ii++ { + if cap(l.FinalityBranch[ii]) == 0 { + l.FinalityBranch[ii] = make([]byte, 0, len(buf[24792:24984][ii*32:(ii+1)*32])) + } + l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[24792:24984][ii*32:(ii+1)*32]...) + } + + // Field (5) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[24984:25144]); err != nil { + return err + } + + // Field (6) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[25144:25152])) + + // Field (0) 'AttestedHeader' + { + buf = tail[o0:o3] + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (3) 'FinalizedHeader' + { + buf = tail[o3:] + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderDeneb) + } + if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateDeneb object +func (l *LightClientUpdateDeneb) SizeSSZ() (size int) { + size = 25152 + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + size += l.AttestedHeader.SizeSSZ() + + // Field (3) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderDeneb) + } + size += l.FinalizedHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientUpdateDeneb object +func (l *LightClientUpdateDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientUpdateDeneb object with a hasher +func (l *LightClientUpdateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'NextSyncCommittee' + if err = l.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'NextSyncCommitteeBranch' + { + if size := len(l.NextSyncCommitteeBranch); size != 5 { + err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5) + return + } + subIndx := hh.Index() + for _, i := range l.NextSyncCommitteeBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (3) 'FinalizedHeader' + if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'FinalityBranch' + { + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + subIndx := hh.Index() + for _, i := range l.FinalityBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (5) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (6) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientFinalityUpdateDeneb object +func (l *LightClientFinalityUpdateDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientFinalityUpdateDeneb object to a target array +func (l *LightClientFinalityUpdateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(368) + + // Offset (0) 'AttestedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + offset += l.AttestedHeader.SizeSSZ() + + // Offset (1) 'FinalizedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderDeneb) + } + offset += l.FinalizedHeader.SizeSSZ() + + // Field (2) 'FinalityBranch' + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + for ii := 0; ii < 6; ii++ { + if size := len(l.FinalityBranch[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32) + return + } + dst = append(dst, l.FinalityBranch[ii]...) + } + + // Field (3) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + // Field (0) 'AttestedHeader' + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'FinalizedHeader' + if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateDeneb object +func (l *LightClientFinalityUpdateDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 368 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'AttestedHeader' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 368 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'FinalizedHeader' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (2) 'FinalityBranch' + l.FinalityBranch = make([][]byte, 6) + for ii := 0; ii < 6; ii++ { + if cap(l.FinalityBranch[ii]) == 0 { + l.FinalityBranch[ii] = make([]byte, 0, len(buf[8:200][ii*32:(ii+1)*32])) + } + l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[8:200][ii*32:(ii+1)*32]...) + } + + // Field (3) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[200:360]); err != nil { + return err + } + + // Field (4) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[360:368])) + + // Field (0) 'AttestedHeader' + { + buf = tail[o0:o1] + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'FinalizedHeader' + { + buf = tail[o1:] + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderDeneb) + } + if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateDeneb object +func (l *LightClientFinalityUpdateDeneb) SizeSSZ() (size int) { + size = 368 + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + size += l.AttestedHeader.SizeSSZ() + + // Field (1) 'FinalizedHeader' + if l.FinalizedHeader == nil { + l.FinalizedHeader = new(LightClientHeaderDeneb) + } + size += l.FinalizedHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientFinalityUpdateDeneb object +func (l *LightClientFinalityUpdateDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientFinalityUpdateDeneb object with a hasher +func (l *LightClientFinalityUpdateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'FinalizedHeader' + if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'FinalityBranch' + { + if size := len(l.FinalityBranch); size != 6 { + err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6) + return + } + subIndx := hh.Index() + for _, i := range l.FinalityBranch { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (3) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the LightClientOptimisticUpdateDeneb object +func (l *LightClientOptimisticUpdateDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(l) +} + +// MarshalSSZTo ssz marshals the LightClientOptimisticUpdateDeneb object to a target array +func (l *LightClientOptimisticUpdateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(172) + + // Offset (0) 'AttestedHeader' + dst = ssz.WriteOffset(dst, offset) + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + offset += l.AttestedHeader.SizeSSZ() + + // Field (1) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'SignatureSlot' + dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot)) + + // Field (0) 'AttestedHeader' + if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateDeneb object +func (l *LightClientOptimisticUpdateDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 172 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'AttestedHeader' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 172 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'SyncAggregate' + if l.SyncAggregate == nil { + l.SyncAggregate = new(SyncAggregate) + } + if err = l.SyncAggregate.UnmarshalSSZ(buf[4:164]); err != nil { + return err + } + + // Field (2) 'SignatureSlot' + l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[164:172])) + + // Field (0) 'AttestedHeader' + { + buf = tail[o0:] + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateDeneb object +func (l *LightClientOptimisticUpdateDeneb) SizeSSZ() (size int) { + size = 172 + + // Field (0) 'AttestedHeader' + if l.AttestedHeader == nil { + l.AttestedHeader = new(LightClientHeaderDeneb) + } + size += l.AttestedHeader.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the LightClientOptimisticUpdateDeneb object +func (l *LightClientOptimisticUpdateDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(l) +} + +// HashTreeRootWith ssz hashes the LightClientOptimisticUpdateDeneb object with a hasher +func (l *LightClientOptimisticUpdateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AttestedHeader' + if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'SyncAggregate' + if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SignatureSlot' + hh.PutUint64(uint64(l.SignatureSlot)) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/light_client.pb.go b/proto/prysm/v1alpha1/light_client.pb.go new file mode 100755 index 000000000000..8e342b43342b --- /dev/null +++ b/proto/prysm/v1alpha1/light_client.pb.go @@ -0,0 +1,1759 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.1 +// source: proto/prysm/v1alpha1/light_client.proto + +package eth + +import ( + reflect "reflect" + sync "sync" + + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type LightClientHeaderAltair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beacon *BeaconBlockHeader `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"` +} + +func (x *LightClientHeaderAltair) Reset() { + *x = LightClientHeaderAltair{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeaderAltair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeaderAltair) ProtoMessage() {} + +func (x *LightClientHeaderAltair) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeaderAltair.ProtoReflect.Descriptor instead. +func (*LightClientHeaderAltair) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{0} +} + +func (x *LightClientHeaderAltair) GetBeacon() *BeaconBlockHeader { + if x != nil { + return x.Beacon + } + return nil +} + +type LightClientHeaderCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beacon *BeaconBlockHeader `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"` + Execution *v1.ExecutionPayloadHeaderCapella `protobuf:"bytes,2,opt,name=execution,proto3" json:"execution,omitempty"` + ExecutionBranch [][]byte `protobuf:"bytes,3,rep,name=execution_branch,json=executionBranch,proto3" json:"execution_branch,omitempty" ssz-size:"4,32"` +} + +func (x *LightClientHeaderCapella) Reset() { + *x = LightClientHeaderCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeaderCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeaderCapella) ProtoMessage() {} + +func (x *LightClientHeaderCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeaderCapella.ProtoReflect.Descriptor instead. +func (*LightClientHeaderCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{1} +} + +func (x *LightClientHeaderCapella) GetBeacon() *BeaconBlockHeader { + if x != nil { + return x.Beacon + } + return nil +} + +func (x *LightClientHeaderCapella) GetExecution() *v1.ExecutionPayloadHeaderCapella { + if x != nil { + return x.Execution + } + return nil +} + +func (x *LightClientHeaderCapella) GetExecutionBranch() [][]byte { + if x != nil { + return x.ExecutionBranch + } + return nil +} + +type LightClientHeaderDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beacon *BeaconBlockHeader `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"` + Execution *v1.ExecutionPayloadHeaderDeneb `protobuf:"bytes,2,opt,name=execution,proto3" json:"execution,omitempty"` + ExecutionBranch [][]byte `protobuf:"bytes,3,rep,name=execution_branch,json=executionBranch,proto3" json:"execution_branch,omitempty" ssz-size:"4,32"` +} + +func (x *LightClientHeaderDeneb) Reset() { + *x = LightClientHeaderDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientHeaderDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientHeaderDeneb) ProtoMessage() {} + +func (x *LightClientHeaderDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientHeaderDeneb.ProtoReflect.Descriptor instead. +func (*LightClientHeaderDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{2} +} + +func (x *LightClientHeaderDeneb) GetBeacon() *BeaconBlockHeader { + if x != nil { + return x.Beacon + } + return nil +} + +func (x *LightClientHeaderDeneb) GetExecution() *v1.ExecutionPayloadHeaderDeneb { + if x != nil { + return x.Execution + } + return nil +} + +func (x *LightClientHeaderDeneb) GetExecutionBranch() [][]byte { + if x != nil { + return x.ExecutionBranch + } + return nil +} + +type LightClientBootstrapAltair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *LightClientHeaderAltair `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty" ssz-size:"5,32"` +} + +func (x *LightClientBootstrapAltair) Reset() { + *x = LightClientBootstrapAltair{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientBootstrapAltair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientBootstrapAltair) ProtoMessage() {} + +func (x *LightClientBootstrapAltair) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientBootstrapAltair.ProtoReflect.Descriptor instead. +func (*LightClientBootstrapAltair) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{3} +} + +func (x *LightClientBootstrapAltair) GetHeader() *LightClientHeaderAltair { + if x != nil { + return x.Header + } + return nil +} + +func (x *LightClientBootstrapAltair) GetCurrentSyncCommittee() *SyncCommittee { + if x != nil { + return x.CurrentSyncCommittee + } + return nil +} + +func (x *LightClientBootstrapAltair) GetCurrentSyncCommitteeBranch() [][]byte { + if x != nil { + return x.CurrentSyncCommitteeBranch + } + return nil +} + +type LightClientBootstrapCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *LightClientHeaderCapella `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty" ssz-size:"5,32"` +} + +func (x *LightClientBootstrapCapella) Reset() { + *x = LightClientBootstrapCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientBootstrapCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientBootstrapCapella) ProtoMessage() {} + +func (x *LightClientBootstrapCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientBootstrapCapella.ProtoReflect.Descriptor instead. +func (*LightClientBootstrapCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{4} +} + +func (x *LightClientBootstrapCapella) GetHeader() *LightClientHeaderCapella { + if x != nil { + return x.Header + } + return nil +} + +func (x *LightClientBootstrapCapella) GetCurrentSyncCommittee() *SyncCommittee { + if x != nil { + return x.CurrentSyncCommittee + } + return nil +} + +func (x *LightClientBootstrapCapella) GetCurrentSyncCommitteeBranch() [][]byte { + if x != nil { + return x.CurrentSyncCommitteeBranch + } + return nil +} + +type LightClientBootstrapDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *LightClientHeaderDeneb `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty" ssz-size:"5,32"` +} + +func (x *LightClientBootstrapDeneb) Reset() { + *x = LightClientBootstrapDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientBootstrapDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientBootstrapDeneb) ProtoMessage() {} + +func (x *LightClientBootstrapDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientBootstrapDeneb.ProtoReflect.Descriptor instead. +func (*LightClientBootstrapDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{5} +} + +func (x *LightClientBootstrapDeneb) GetHeader() *LightClientHeaderDeneb { + if x != nil { + return x.Header + } + return nil +} + +func (x *LightClientBootstrapDeneb) GetCurrentSyncCommittee() *SyncCommittee { + if x != nil { + return x.CurrentSyncCommittee + } + return nil +} + +func (x *LightClientBootstrapDeneb) GetCurrentSyncCommitteeBranch() [][]byte { + if x != nil { + return x.CurrentSyncCommitteeBranch + } + return nil +} + +type LightClientUpdateAltair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderAltair `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` + NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty" ssz-size:"5,32"` + FinalizedHeader *LightClientHeaderAltair `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"6,32"` + SyncAggregate *SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientUpdateAltair) Reset() { + *x = LightClientUpdateAltair{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientUpdateAltair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientUpdateAltair) ProtoMessage() {} + +func (x *LightClientUpdateAltair) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientUpdateAltair.ProtoReflect.Descriptor instead. +func (*LightClientUpdateAltair) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{6} +} + +func (x *LightClientUpdateAltair) GetAttestedHeader() *LightClientHeaderAltair { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientUpdateAltair) GetNextSyncCommittee() *SyncCommittee { + if x != nil { + return x.NextSyncCommittee + } + return nil +} + +func (x *LightClientUpdateAltair) GetNextSyncCommitteeBranch() [][]byte { + if x != nil { + return x.NextSyncCommitteeBranch + } + return nil +} + +func (x *LightClientUpdateAltair) GetFinalizedHeader() *LightClientHeaderAltair { + if x != nil { + return x.FinalizedHeader + } + return nil +} + +func (x *LightClientUpdateAltair) GetFinalityBranch() [][]byte { + if x != nil { + return x.FinalityBranch + } + return nil +} + +func (x *LightClientUpdateAltair) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientUpdateAltair) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientUpdateCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderCapella `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` + NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty" ssz-size:"5,32"` + FinalizedHeader *LightClientHeaderCapella `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"6,32"` + SyncAggregate *SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientUpdateCapella) Reset() { + *x = LightClientUpdateCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientUpdateCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientUpdateCapella) ProtoMessage() {} + +func (x *LightClientUpdateCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientUpdateCapella.ProtoReflect.Descriptor instead. +func (*LightClientUpdateCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{7} +} + +func (x *LightClientUpdateCapella) GetAttestedHeader() *LightClientHeaderCapella { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientUpdateCapella) GetNextSyncCommittee() *SyncCommittee { + if x != nil { + return x.NextSyncCommittee + } + return nil +} + +func (x *LightClientUpdateCapella) GetNextSyncCommitteeBranch() [][]byte { + if x != nil { + return x.NextSyncCommitteeBranch + } + return nil +} + +func (x *LightClientUpdateCapella) GetFinalizedHeader() *LightClientHeaderCapella { + if x != nil { + return x.FinalizedHeader + } + return nil +} + +func (x *LightClientUpdateCapella) GetFinalityBranch() [][]byte { + if x != nil { + return x.FinalityBranch + } + return nil +} + +func (x *LightClientUpdateCapella) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientUpdateCapella) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientUpdateDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderDeneb `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` + NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty" ssz-size:"5,32"` + FinalizedHeader *LightClientHeaderDeneb `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"6,32"` + SyncAggregate *SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientUpdateDeneb) Reset() { + *x = LightClientUpdateDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientUpdateDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientUpdateDeneb) ProtoMessage() {} + +func (x *LightClientUpdateDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientUpdateDeneb.ProtoReflect.Descriptor instead. +func (*LightClientUpdateDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{8} +} + +func (x *LightClientUpdateDeneb) GetAttestedHeader() *LightClientHeaderDeneb { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientUpdateDeneb) GetNextSyncCommittee() *SyncCommittee { + if x != nil { + return x.NextSyncCommittee + } + return nil +} + +func (x *LightClientUpdateDeneb) GetNextSyncCommitteeBranch() [][]byte { + if x != nil { + return x.NextSyncCommitteeBranch + } + return nil +} + +func (x *LightClientUpdateDeneb) GetFinalizedHeader() *LightClientHeaderDeneb { + if x != nil { + return x.FinalizedHeader + } + return nil +} + +func (x *LightClientUpdateDeneb) GetFinalityBranch() [][]byte { + if x != nil { + return x.FinalityBranch + } + return nil +} + +func (x *LightClientUpdateDeneb) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientUpdateDeneb) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientFinalityUpdateAltair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderAltair `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + FinalizedHeader *LightClientHeaderAltair `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"6,32"` + SyncAggregate *SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientFinalityUpdateAltair) Reset() { + *x = LightClientFinalityUpdateAltair{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientFinalityUpdateAltair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientFinalityUpdateAltair) ProtoMessage() {} + +func (x *LightClientFinalityUpdateAltair) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientFinalityUpdateAltair.ProtoReflect.Descriptor instead. +func (*LightClientFinalityUpdateAltair) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{9} +} + +func (x *LightClientFinalityUpdateAltair) GetAttestedHeader() *LightClientHeaderAltair { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientFinalityUpdateAltair) GetFinalizedHeader() *LightClientHeaderAltair { + if x != nil { + return x.FinalizedHeader + } + return nil +} + +func (x *LightClientFinalityUpdateAltair) GetFinalityBranch() [][]byte { + if x != nil { + return x.FinalityBranch + } + return nil +} + +func (x *LightClientFinalityUpdateAltair) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientFinalityUpdateAltair) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientFinalityUpdateCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderCapella `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + FinalizedHeader *LightClientHeaderCapella `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"6,32"` + SyncAggregate *SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientFinalityUpdateCapella) Reset() { + *x = LightClientFinalityUpdateCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientFinalityUpdateCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientFinalityUpdateCapella) ProtoMessage() {} + +func (x *LightClientFinalityUpdateCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientFinalityUpdateCapella.ProtoReflect.Descriptor instead. +func (*LightClientFinalityUpdateCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{10} +} + +func (x *LightClientFinalityUpdateCapella) GetAttestedHeader() *LightClientHeaderCapella { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientFinalityUpdateCapella) GetFinalizedHeader() *LightClientHeaderCapella { + if x != nil { + return x.FinalizedHeader + } + return nil +} + +func (x *LightClientFinalityUpdateCapella) GetFinalityBranch() [][]byte { + if x != nil { + return x.FinalityBranch + } + return nil +} + +func (x *LightClientFinalityUpdateCapella) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientFinalityUpdateCapella) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientFinalityUpdateDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderDeneb `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + FinalizedHeader *LightClientHeaderDeneb `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"` + FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"6,32"` + SyncAggregate *SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientFinalityUpdateDeneb) Reset() { + *x = LightClientFinalityUpdateDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientFinalityUpdateDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientFinalityUpdateDeneb) ProtoMessage() {} + +func (x *LightClientFinalityUpdateDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientFinalityUpdateDeneb.ProtoReflect.Descriptor instead. +func (*LightClientFinalityUpdateDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{11} +} + +func (x *LightClientFinalityUpdateDeneb) GetAttestedHeader() *LightClientHeaderDeneb { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientFinalityUpdateDeneb) GetFinalizedHeader() *LightClientHeaderDeneb { + if x != nil { + return x.FinalizedHeader + } + return nil +} + +func (x *LightClientFinalityUpdateDeneb) GetFinalityBranch() [][]byte { + if x != nil { + return x.FinalityBranch + } + return nil +} + +func (x *LightClientFinalityUpdateDeneb) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientFinalityUpdateDeneb) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientOptimisticUpdateAltair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderAltair `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + SyncAggregate *SyncAggregate `protobuf:"bytes,2,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientOptimisticUpdateAltair) Reset() { + *x = LightClientOptimisticUpdateAltair{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientOptimisticUpdateAltair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientOptimisticUpdateAltair) ProtoMessage() {} + +func (x *LightClientOptimisticUpdateAltair) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientOptimisticUpdateAltair.ProtoReflect.Descriptor instead. +func (*LightClientOptimisticUpdateAltair) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{12} +} + +func (x *LightClientOptimisticUpdateAltair) GetAttestedHeader() *LightClientHeaderAltair { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientOptimisticUpdateAltair) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientOptimisticUpdateAltair) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientOptimisticUpdateCapella struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderCapella `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + SyncAggregate *SyncAggregate `protobuf:"bytes,2,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientOptimisticUpdateCapella) Reset() { + *x = LightClientOptimisticUpdateCapella{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientOptimisticUpdateCapella) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientOptimisticUpdateCapella) ProtoMessage() {} + +func (x *LightClientOptimisticUpdateCapella) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientOptimisticUpdateCapella.ProtoReflect.Descriptor instead. +func (*LightClientOptimisticUpdateCapella) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{13} +} + +func (x *LightClientOptimisticUpdateCapella) GetAttestedHeader() *LightClientHeaderCapella { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientOptimisticUpdateCapella) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientOptimisticUpdateCapella) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +type LightClientOptimisticUpdateDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttestedHeader *LightClientHeaderDeneb `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"` + SyncAggregate *SyncAggregate `protobuf:"bytes,2,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` + SignatureSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` +} + +func (x *LightClientOptimisticUpdateDeneb) Reset() { + *x = LightClientOptimisticUpdateDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightClientOptimisticUpdateDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightClientOptimisticUpdateDeneb) ProtoMessage() {} + +func (x *LightClientOptimisticUpdateDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_light_client_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightClientOptimisticUpdateDeneb.ProtoReflect.Descriptor instead. +func (*LightClientOptimisticUpdateDeneb) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP(), []int{14} +} + +func (x *LightClientOptimisticUpdateDeneb) GetAttestedHeader() *LightClientHeaderDeneb { + if x != nil { + return x.AttestedHeader + } + return nil +} + +func (x *LightClientOptimisticUpdateDeneb) GetSyncAggregate() *SyncAggregate { + if x != nil { + return x.SyncAggregate + } + return nil +} + +func (x *LightClientOptimisticUpdateDeneb) GetSignatureSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.SignatureSlot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +var File_proto_prysm_v1alpha1_light_client_proto protoreflect.FileDescriptor + +var file_proto_prysm_v1alpha1_light_client_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x17, 0x4c, 0x69, 0x67, 0x68, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x62, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x22, 0xe2, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, + 0x61, 0x12, 0x40, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x62, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x09, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, + 0x8a, 0xb5, 0x18, 0x04, 0x34, 0x2c, 0x33, 0x32, 0x52, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0xde, 0x01, 0x0a, 0x16, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, + 0x65, 0x6e, 0x65, 0x62, 0x12, 0x40, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x09, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x34, 0x2c, 0x33, 0x32, 0x52, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x8d, 0x02, 0x0a, 0x1a, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, + 0x72, 0x61, 0x70, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x46, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x5a, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x4b, 0x0a, + 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, 0x2c, 0x33, 0x32, 0x52, 0x1a, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x8f, 0x02, 0x0a, 0x1b, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, + 0x72, 0x61, 0x70, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, + 0x4b, 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, 0x2c, 0x33, 0x32, + 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x8b, 0x02, 0x0a, + 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, + 0x73, 0x74, 0x72, 0x61, 0x70, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x45, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x5a, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, + 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x4b, 0x0a, + 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, 0x2c, 0x33, 0x32, 0x52, 0x1a, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0xd8, 0x04, 0x0a, 0x17, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, 0x57, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, + 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x54, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x45, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, + 0x2c, 0x33, 0x32, 0x52, 0x17, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x59, 0x0a, 0x10, + 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0xdb, 0x04, 0x0a, 0x18, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x70, 0x65, 0x6c, + 0x6c, 0x61, 0x12, 0x58, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x0e, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x13, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, + 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x12, 0x45, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, 0x2c, 0x33, 0x32, + 0x52, 0x17, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x5a, 0x0a, 0x10, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, + 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, + 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, + 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, + 0x8a, 0xb5, 0x18, 0x04, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x6c, 0x6f, 0x74, 0x22, 0xd5, 0x04, 0x0a, 0x16, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x56, + 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, + 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x45, 0x0a, 0x1a, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x35, 0x2c, 0x33, 0x32, 0x52, 0x17, 0x6e, 0x65, 0x78, 0x74, + 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x12, 0x58, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x0f, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x36, 0x2c, 0x33, 0x32, + 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, + 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, + 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0xc3, 0x03, 0x0a, 0x1f, + 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x12, + 0x57, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x59, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, + 0x69, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, + 0x18, 0x04, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, + 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, + 0x74, 0x22, 0xc6, 0x03, 0x0a, 0x20, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x58, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, + 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x5a, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x0f, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x0f, + 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x36, 0x2c, 0x33, 0x32, 0x52, + 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, + 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, + 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0xc0, 0x03, 0x0a, 0x1e, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x56, 0x0a, + 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x0f, + 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x36, 0x2c, + 0x33, 0x32, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, + 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0xb7, 0x02, + 0x0a, 0x21, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, + 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x74, + 0x61, 0x69, 0x72, 0x12, 0x57, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x52, 0x0e, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0e, + 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0xb9, 0x02, 0x0a, 0x22, 0x4c, 0x69, 0x67, 0x68, + 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x58, + 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x6c, 0x6f, 0x74, 0x22, 0xb5, 0x02, 0x0a, 0x20, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x56, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, + 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, + 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x99, 0x01, 0x0a, 0x19, + 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x4c, 0x69, 0x67, 0x68, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, + 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_prysm_v1alpha1_light_client_proto_rawDescOnce sync.Once + file_proto_prysm_v1alpha1_light_client_proto_rawDescData = file_proto_prysm_v1alpha1_light_client_proto_rawDesc +) + +func file_proto_prysm_v1alpha1_light_client_proto_rawDescGZIP() []byte { + file_proto_prysm_v1alpha1_light_client_proto_rawDescOnce.Do(func() { + file_proto_prysm_v1alpha1_light_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_prysm_v1alpha1_light_client_proto_rawDescData) + }) + return file_proto_prysm_v1alpha1_light_client_proto_rawDescData +} + +var file_proto_prysm_v1alpha1_light_client_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_proto_prysm_v1alpha1_light_client_proto_goTypes = []interface{}{ + (*LightClientHeaderAltair)(nil), // 0: ethereum.eth.v1alpha1.LightClientHeaderAltair + (*LightClientHeaderCapella)(nil), // 1: ethereum.eth.v1alpha1.LightClientHeaderCapella + (*LightClientHeaderDeneb)(nil), // 2: ethereum.eth.v1alpha1.LightClientHeaderDeneb + (*LightClientBootstrapAltair)(nil), // 3: ethereum.eth.v1alpha1.LightClientBootstrapAltair + (*LightClientBootstrapCapella)(nil), // 4: ethereum.eth.v1alpha1.LightClientBootstrapCapella + (*LightClientBootstrapDeneb)(nil), // 5: ethereum.eth.v1alpha1.LightClientBootstrapDeneb + (*LightClientUpdateAltair)(nil), // 6: ethereum.eth.v1alpha1.LightClientUpdateAltair + (*LightClientUpdateCapella)(nil), // 7: ethereum.eth.v1alpha1.LightClientUpdateCapella + (*LightClientUpdateDeneb)(nil), // 8: ethereum.eth.v1alpha1.LightClientUpdateDeneb + (*LightClientFinalityUpdateAltair)(nil), // 9: ethereum.eth.v1alpha1.LightClientFinalityUpdateAltair + (*LightClientFinalityUpdateCapella)(nil), // 10: ethereum.eth.v1alpha1.LightClientFinalityUpdateCapella + (*LightClientFinalityUpdateDeneb)(nil), // 11: ethereum.eth.v1alpha1.LightClientFinalityUpdateDeneb + (*LightClientOptimisticUpdateAltair)(nil), // 12: ethereum.eth.v1alpha1.LightClientOptimisticUpdateAltair + (*LightClientOptimisticUpdateCapella)(nil), // 13: ethereum.eth.v1alpha1.LightClientOptimisticUpdateCapella + (*LightClientOptimisticUpdateDeneb)(nil), // 14: ethereum.eth.v1alpha1.LightClientOptimisticUpdateDeneb + (*BeaconBlockHeader)(nil), // 15: ethereum.eth.v1alpha1.BeaconBlockHeader + (*v1.ExecutionPayloadHeaderCapella)(nil), // 16: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*v1.ExecutionPayloadHeaderDeneb)(nil), // 17: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*SyncCommittee)(nil), // 18: ethereum.eth.v1alpha1.SyncCommittee + (*SyncAggregate)(nil), // 19: ethereum.eth.v1alpha1.SyncAggregate +} +var file_proto_prysm_v1alpha1_light_client_proto_depIdxs = []int32{ + 15, // 0: ethereum.eth.v1alpha1.LightClientHeaderAltair.beacon:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 15, // 1: ethereum.eth.v1alpha1.LightClientHeaderCapella.beacon:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 16, // 2: ethereum.eth.v1alpha1.LightClientHeaderCapella.execution:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 15, // 3: ethereum.eth.v1alpha1.LightClientHeaderDeneb.beacon:type_name -> ethereum.eth.v1alpha1.BeaconBlockHeader + 17, // 4: ethereum.eth.v1alpha1.LightClientHeaderDeneb.execution:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 0, // 5: ethereum.eth.v1alpha1.LightClientBootstrapAltair.header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderAltair + 18, // 6: ethereum.eth.v1alpha1.LightClientBootstrapAltair.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 1, // 7: ethereum.eth.v1alpha1.LightClientBootstrapCapella.header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderCapella + 18, // 8: ethereum.eth.v1alpha1.LightClientBootstrapCapella.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 2, // 9: ethereum.eth.v1alpha1.LightClientBootstrapDeneb.header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderDeneb + 18, // 10: ethereum.eth.v1alpha1.LightClientBootstrapDeneb.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 0, // 11: ethereum.eth.v1alpha1.LightClientUpdateAltair.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderAltair + 18, // 12: ethereum.eth.v1alpha1.LightClientUpdateAltair.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 0, // 13: ethereum.eth.v1alpha1.LightClientUpdateAltair.finalized_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderAltair + 19, // 14: ethereum.eth.v1alpha1.LightClientUpdateAltair.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 1, // 15: ethereum.eth.v1alpha1.LightClientUpdateCapella.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderCapella + 18, // 16: ethereum.eth.v1alpha1.LightClientUpdateCapella.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 1, // 17: ethereum.eth.v1alpha1.LightClientUpdateCapella.finalized_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderCapella + 19, // 18: ethereum.eth.v1alpha1.LightClientUpdateCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 2, // 19: ethereum.eth.v1alpha1.LightClientUpdateDeneb.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderDeneb + 18, // 20: ethereum.eth.v1alpha1.LightClientUpdateDeneb.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee + 2, // 21: ethereum.eth.v1alpha1.LightClientUpdateDeneb.finalized_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderDeneb + 19, // 22: ethereum.eth.v1alpha1.LightClientUpdateDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 0, // 23: ethereum.eth.v1alpha1.LightClientFinalityUpdateAltair.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderAltair + 0, // 24: ethereum.eth.v1alpha1.LightClientFinalityUpdateAltair.finalized_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderAltair + 19, // 25: ethereum.eth.v1alpha1.LightClientFinalityUpdateAltair.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 1, // 26: ethereum.eth.v1alpha1.LightClientFinalityUpdateCapella.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderCapella + 1, // 27: ethereum.eth.v1alpha1.LightClientFinalityUpdateCapella.finalized_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderCapella + 19, // 28: ethereum.eth.v1alpha1.LightClientFinalityUpdateCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 2, // 29: ethereum.eth.v1alpha1.LightClientFinalityUpdateDeneb.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderDeneb + 2, // 30: ethereum.eth.v1alpha1.LightClientFinalityUpdateDeneb.finalized_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderDeneb + 19, // 31: ethereum.eth.v1alpha1.LightClientFinalityUpdateDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 0, // 32: ethereum.eth.v1alpha1.LightClientOptimisticUpdateAltair.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderAltair + 19, // 33: ethereum.eth.v1alpha1.LightClientOptimisticUpdateAltair.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 1, // 34: ethereum.eth.v1alpha1.LightClientOptimisticUpdateCapella.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderCapella + 19, // 35: ethereum.eth.v1alpha1.LightClientOptimisticUpdateCapella.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 2, // 36: ethereum.eth.v1alpha1.LightClientOptimisticUpdateDeneb.attested_header:type_name -> ethereum.eth.v1alpha1.LightClientHeaderDeneb + 19, // 37: ethereum.eth.v1alpha1.LightClientOptimisticUpdateDeneb.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate + 38, // [38:38] is the sub-list for method output_type + 38, // [38:38] is the sub-list for method input_type + 38, // [38:38] is the sub-list for extension type_name + 38, // [38:38] is the sub-list for extension extendee + 0, // [0:38] is the sub-list for field type_name +} + +func init() { file_proto_prysm_v1alpha1_light_client_proto_init() } +func file_proto_prysm_v1alpha1_light_client_proto_init() { + if File_proto_prysm_v1alpha1_light_client_proto != nil { + return + } + file_proto_prysm_v1alpha1_beacon_block_proto_init() + file_proto_prysm_v1alpha1_beacon_state_proto_init() + if !protoimpl.UnsafeEnabled { + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientHeaderAltair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientHeaderCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientHeaderDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientBootstrapAltair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientBootstrapCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientBootstrapDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientUpdateAltair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientUpdateCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientUpdateDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientFinalityUpdateAltair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientFinalityUpdateCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientFinalityUpdateDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientOptimisticUpdateAltair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientOptimisticUpdateCapella); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_light_client_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightClientOptimisticUpdateDeneb); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_prysm_v1alpha1_light_client_proto_rawDesc, + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_prysm_v1alpha1_light_client_proto_goTypes, + DependencyIndexes: file_proto_prysm_v1alpha1_light_client_proto_depIdxs, + MessageInfos: file_proto_prysm_v1alpha1_light_client_proto_msgTypes, + }.Build() + File_proto_prysm_v1alpha1_light_client_proto = out.File + file_proto_prysm_v1alpha1_light_client_proto_rawDesc = nil + file_proto_prysm_v1alpha1_light_client_proto_goTypes = nil + file_proto_prysm_v1alpha1_light_client_proto_depIdxs = nil +} diff --git a/proto/prysm/v1alpha1/light_client.proto b/proto/prysm/v1alpha1/light_client.proto new file mode 100644 index 000000000000..6e3ca511ba60 --- /dev/null +++ b/proto/prysm/v1alpha1/light_client.proto @@ -0,0 +1,134 @@ +// Copyright 2024 Prysmatic Labs. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package ethereum.eth.v1alpha1; + +import "proto/eth/ext/options.proto"; +import "proto/prysm/v1alpha1/beacon_block.proto"; +import "proto/engine/v1/execution_engine.proto"; +import "proto/prysm/v1alpha1/beacon_state.proto"; + +option csharp_namespace = "Ethereum.Eth.V1alpha1"; +option go_package = "github.com/prysmaticlabs/prysm/v5/proto/eth/v1alpha1;eth"; +option java_multiple_files = true; +option java_outer_classname = "LightClientProto"; +option java_package = "org.ethereum.eth.v1alpha1"; +option php_namespace = "Ethereum\\Eth\\v1alpha1"; + +message LightClientHeaderAltair { + BeaconBlockHeader beacon = 1; +} + +message LightClientHeaderCapella { + BeaconBlockHeader beacon = 1; + ethereum.engine.v1.ExecutionPayloadHeaderCapella execution = 2; + repeated bytes execution_branch = 3 [(ethereum.eth.ext.ssz_size) = "4,32"]; +} + +message LightClientHeaderDeneb { + BeaconBlockHeader beacon = 1; + ethereum.engine.v1.ExecutionPayloadHeaderDeneb execution = 2; + repeated bytes execution_branch = 3 [(ethereum.eth.ext.ssz_size) = "4,32"]; +} + +message LightClientBootstrapAltair { + LightClientHeaderAltair header = 1; + SyncCommittee current_sync_committee = 2; + repeated bytes current_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"]; +} + +message LightClientBootstrapCapella { + LightClientHeaderCapella header = 1; + SyncCommittee current_sync_committee = 2; + repeated bytes current_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"]; +} + +message LightClientBootstrapDeneb { + LightClientHeaderDeneb header = 1; + SyncCommittee current_sync_committee = 2; + repeated bytes current_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"]; +} + +message LightClientUpdateAltair { + LightClientHeaderAltair attested_header = 1; + SyncCommittee next_sync_committee = 2; + repeated bytes next_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"]; + LightClientHeaderAltair finalized_header = 4; + repeated bytes finality_branch = 5 [(ethereum.eth.ext.ssz_size) = "6,32"]; + SyncAggregate sync_aggregate = 6; + uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientUpdateCapella { + LightClientHeaderCapella attested_header = 1; + SyncCommittee next_sync_committee = 2; + repeated bytes next_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"]; + LightClientHeaderCapella finalized_header = 4; + repeated bytes finality_branch = 5 [(ethereum.eth.ext.ssz_size) = "6,32"]; + SyncAggregate sync_aggregate = 6; + uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientUpdateDeneb { + LightClientHeaderDeneb attested_header = 1; + SyncCommittee next_sync_committee = 2; + repeated bytes next_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"]; + LightClientHeaderDeneb finalized_header = 4; + repeated bytes finality_branch = 5 [(ethereum.eth.ext.ssz_size) = "6,32"]; + SyncAggregate sync_aggregate = 6; + uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientFinalityUpdateAltair { + LightClientHeaderAltair attested_header = 1; + LightClientHeaderAltair finalized_header = 2; + repeated bytes finality_branch = 3 [(ethereum.eth.ext.ssz_size) = "6,32"]; + SyncAggregate sync_aggregate = 4; + uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientFinalityUpdateCapella { + LightClientHeaderCapella attested_header = 1; + LightClientHeaderCapella finalized_header = 2; + repeated bytes finality_branch = 3 [(ethereum.eth.ext.ssz_size) = "6,32"]; + SyncAggregate sync_aggregate = 4; + uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientFinalityUpdateDeneb { + LightClientHeaderDeneb attested_header = 1; + LightClientHeaderDeneb finalized_header = 2; + repeated bytes finality_branch = 3 [(ethereum.eth.ext.ssz_size) = "6,32"]; + SyncAggregate sync_aggregate = 4; + uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientOptimisticUpdateAltair { + LightClientHeaderAltair attested_header = 1; + SyncAggregate sync_aggregate = 2; + uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientOptimisticUpdateCapella { + LightClientHeaderCapella attested_header = 1; + SyncAggregate sync_aggregate = 2; + uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} + +message LightClientOptimisticUpdateDeneb { + LightClientHeaderDeneb attested_header = 1; + SyncAggregate sync_aggregate = 2; + uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; +} \ No newline at end of file From 56f0eb1437128293b03b1239772bd6b7b12ae5b6 Mon Sep 17 00:00:00 2001 From: Rupam Dey <117000803+rupam-04@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:43:13 +0530 Subject: [PATCH 318/325] feat: add Electra support to light client functions (#14506) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add Electra to switch case in light client functions * replace `!=` with `<` in `blockToLightClientHeaderXXX` * add Electra tests * update `CHANGELOG.md` * add constant for Electra * add constant to `minimal.go` --------- Co-authored-by: Radosław Kapka --- CHANGELOG.md | 1 + beacon-chain/core/light-client/lightclient.go | 12 +- .../core/light-client/lightclient_test.go | 126 ++++++++++++++++++ .../rpc/eth/light-client/handlers_test.go | 40 ++++++ beacon-chain/rpc/eth/light-client/helpers.go | 11 +- config/fieldparams/mainnet.go | 1 + config/fieldparams/minimal.go | 1 + testing/util/lightclient.go | 112 ++++++++++++++++ 8 files changed, 295 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 868c3a872fcb..a59af76a6cbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Tests to ensure sepolia config matches the official upstream yaml - HTTP endpoint for PublishBlobs - GetBlockV2, GetBlindedBlock, ProduceBlockV2, ProduceBlockV3: add Electra case. +- Add Electra support and tests for light client functions - SSE implementation that sheds stuck clients. [pr](https://github.com/prysmaticlabs/prysm/pull/14413) ### Changed diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index 3c1b8a552db1..1173ec355331 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -321,10 +321,10 @@ func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethp HeaderCapella: capellaHeader, }, }, nil - case version.Deneb: + case version.Deneb, version.Electra: denebHeader, err := blockToLightClientHeaderDeneb(context.Background(), block) if err != nil { - return nil, errors.Wrap(err, "could not get deneb header") + return nil, errors.Wrap(err, "could not get header") } return ðpbv2.LightClientHeaderContainer{ Header: ðpbv2.LightClientHeaderContainer_HeaderDeneb{ @@ -337,7 +337,7 @@ func BlockToLightClientHeader(block interfaces.ReadOnlySignedBeaconBlock) (*ethp } func blockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeader, error) { - if block.Version() != version.Altair { + if block.Version() < version.Altair { return nil, fmt.Errorf("block version is %s instead of Altair", version.String(block.Version())) } @@ -360,7 +360,7 @@ func blockToLightClientHeaderAltair(block interfaces.ReadOnlySignedBeaconBlock) } func blockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderCapella, error) { - if block.Version() != version.Capella { + if block.Version() < version.Capella { return nil, fmt.Errorf("block version is %s instead of Capella", version.String(block.Version())) } @@ -422,8 +422,8 @@ func blockToLightClientHeaderCapella(ctx context.Context, block interfaces.ReadO } func blockToLightClientHeaderDeneb(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (*ethpbv2.LightClientHeaderDeneb, error) { - if block.Version() != version.Deneb { - return nil, fmt.Errorf("block version is %s instead of Deneb", version.String(block.Version())) + if block.Version() < version.Deneb { + return nil, fmt.Errorf("block version is %s instead of Deneb/Electra", version.String(block.Version())) } payload, err := block.Block().Body().Execution() diff --git a/beacon-chain/core/light-client/lightclient_test.go b/beacon-chain/core/light-client/lightclient_test.go index 8c5623a83825..bbfafa6a583d 100644 --- a/beacon-chain/core/light-client/lightclient_test.go +++ b/beacon-chain/core/light-client/lightclient_test.go @@ -599,4 +599,130 @@ func TestLightClient_BlockToLightClientHeader(t *testing.T) { require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") }) }) + + t.Run("Electra", func(t *testing.T) { + t.Run("Non-Blinded Beacon Block", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestElectra(false) + + container, err := lightClient.BlockToLightClientHeader(l.Block) + require.NoError(t, err) + header := container.GetHeaderDeneb() + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := lightClient.ComputeTransactionsRoot(payload) + require.NoError(t, err) + + withdrawalsRoot, err := lightClient.ComputeWithdrawalsRoot(payload) + require.NoError(t, err) + + blobGasUsed, err := payload.BlobGasUsed() + require.NoError(t, err) + + excessBlobGas, err := payload.ExcessBlobGas() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderElectra{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") + }) + + t.Run("Blinded Beacon Block", func(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestElectra(true) + + container, err := lightClient.BlockToLightClientHeader(l.Block) + require.NoError(t, err) + header := container.GetHeaderDeneb() + require.NotNil(t, header, "header is nil") + + parentRoot := l.Block.Block().ParentRoot() + stateRoot := l.Block.Block().StateRoot() + bodyRoot, err := l.Block.Block().Body().HashTreeRoot() + require.NoError(t, err) + + payload, err := l.Block.Block().Body().Execution() + require.NoError(t, err) + + transactionsRoot, err := payload.TransactionsRoot() + require.NoError(t, err) + + withdrawalsRoot, err := payload.WithdrawalsRoot() + require.NoError(t, err) + + blobGasUsed, err := payload.BlobGasUsed() + require.NoError(t, err) + + excessBlobGas, err := payload.ExcessBlobGas() + require.NoError(t, err) + + executionHeader := &v11.ExecutionPayloadHeaderElectra{ + ParentHash: payload.ParentHash(), + FeeRecipient: payload.FeeRecipient(), + StateRoot: payload.StateRoot(), + ReceiptsRoot: payload.ReceiptsRoot(), + LogsBloom: payload.LogsBloom(), + PrevRandao: payload.PrevRandao(), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: payload.ExtraData(), + BaseFeePerGas: payload.BaseFeePerGas(), + BlockHash: payload.BlockHash(), + TransactionsRoot: transactionsRoot, + WithdrawalsRoot: withdrawalsRoot, + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + } + + executionPayloadProof, err := blocks.PayloadProof(l.Ctx, l.Block.Block()) + require.NoError(t, err) + + require.Equal(t, l.Block.Block().Slot(), header.Beacon.Slot, "Slot is not equal") + require.Equal(t, l.Block.Block().ProposerIndex(), header.Beacon.ProposerIndex, "Proposer index is not equal") + require.DeepSSZEqual(t, parentRoot[:], header.Beacon.ParentRoot, "Parent root is not equal") + require.DeepSSZEqual(t, stateRoot[:], header.Beacon.StateRoot, "State root is not equal") + require.DeepSSZEqual(t, bodyRoot[:], header.Beacon.BodyRoot, "Body root is not equal") + + require.DeepSSZEqual(t, executionHeader, header.Execution, "Execution headers are not equal") + + require.DeepSSZEqual(t, executionPayloadProof, header.ExecutionBranch, "Execution payload proofs are not equal") + }) + }) } diff --git a/beacon-chain/rpc/eth/light-client/handlers_test.go b/beacon-chain/rpc/eth/light-client/handlers_test.go index 0ca25649ccc2..774997d336ee 100644 --- a/beacon-chain/rpc/eth/light-client/handlers_test.go +++ b/beacon-chain/rpc/eth/light-client/handlers_test.go @@ -146,6 +146,46 @@ func TestLightClientHandler_GetLightClientBootstrap_Deneb(t *testing.T) { require.NotNil(t, resp.Data.CurrentSyncCommitteeBranch) } +func TestLightClientHandler_GetLightClientBootstrap_Electra(t *testing.T) { + l := util.NewTestLightClient(t).SetupTestElectra(false) // result is same for true and false + + slot := l.State.Slot() + stateRoot, err := l.State.HashTreeRoot(l.Ctx) + require.NoError(t, err) + + mockBlocker := &testutil.MockBlocker{BlockToReturn: l.Block} + mockChainService := &mock.ChainService{Optimistic: true, Slot: &slot} + s := &Server{ + Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{ + slot: l.State, + }}, + Blocker: mockBlocker, + HeadFetcher: mockChainService, + } + request := httptest.NewRequest("GET", "http://foo.com/", nil) + request.SetPathValue("block_root", hexutil.Encode(stateRoot[:])) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.GetLightClientBootstrap(writer, request) + require.Equal(t, http.StatusOK, writer.Code) + var resp structs.LightClientBootstrapResponse + err = json.Unmarshal(writer.Body.Bytes(), &resp) + require.NoError(t, err) + var respHeader structs.LightClientHeader + err = json.Unmarshal(resp.Data.Header, &respHeader) + require.NoError(t, err) + require.Equal(t, "electra", resp.Version) + + blockHeader, err := l.Block.Header() + require.NoError(t, err) + require.Equal(t, hexutil.Encode(blockHeader.Header.BodyRoot), respHeader.Beacon.BodyRoot) + require.Equal(t, strconv.FormatUint(uint64(blockHeader.Header.Slot), 10), respHeader.Beacon.Slot) + + require.NotNil(t, resp.Data.CurrentSyncCommittee) + require.NotNil(t, resp.Data.CurrentSyncCommitteeBranch) +} + func TestLightClientHandler_GetLightClientUpdatesByRangeAltair(t *testing.T) { helpers.ClearCache() ctx := context.Background() diff --git a/beacon-chain/rpc/eth/light-client/helpers.go b/beacon-chain/rpc/eth/light-client/helpers.go index 251364c1d50b..ce989a7d5672 100644 --- a/beacon-chain/rpc/eth/light-client/helpers.go +++ b/beacon-chain/rpc/eth/light-client/helpers.go @@ -30,7 +30,7 @@ func createLightClientBootstrap(ctx context.Context, state state.BeaconState, bl return createLightClientBootstrapAltair(ctx, state, blk) case version.Capella: return createLightClientBootstrapCapella(ctx, state, blk) - case version.Deneb: + case version.Deneb, version.Electra: return createLightClientBootstrapDeneb(ctx, state, blk) } return nil, fmt.Errorf("unsupported block version %s", version.String(blk.Version())) @@ -226,8 +226,13 @@ func createLightClientBootstrapDeneb(ctx context.Context, state state.BeaconStat if err != nil { return nil, errors.Wrap(err, "could not get current sync committee proof") } - - branch := make([]string, fieldparams.SyncCommitteeBranchDepth) + var branch []string + switch block.Version() { + case version.Deneb: + branch = make([]string, fieldparams.SyncCommitteeBranchDepth) + case version.Electra: + branch = make([]string, fieldparams.SyncCommitteeBranchDepthElectra) + } for i, proof := range currentSyncCommitteeProof { branch[i] = hexutil.Encode(proof) } diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index a773da403e95..db16f6f6edf2 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -35,6 +35,7 @@ const ( KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item ExecutionBranchDepth = 4 // ExecutionBranchDepth defines the number of leaves in a merkle proof of the execution payload header. SyncCommitteeBranchDepth = 5 // SyncCommitteeBranchDepth defines the number of leaves in a merkle proof of a sync committee. + SyncCommitteeBranchDepthElectra = 6 // SyncCommitteeBranchDepthElectra defines the number of leaves in a merkle proof of a sync committee. FinalityBranchDepth = 6 // FinalityBranchDepth defines the number of leaves in a merkle proof of the finalized checkpoint root. PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. PendingPartialWithdrawalsLimit = 134217728 // Maximum number of pending partial withdrawals in the beacon state. diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index 5f135f639b43..1eeadbb1b0a5 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -35,6 +35,7 @@ const ( KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item ExecutionBranchDepth = 4 // ExecutionBranchDepth defines the number of leaves in a merkle proof of the execution payload header. SyncCommitteeBranchDepth = 5 // SyncCommitteeBranchDepth defines the number of leaves in a merkle proof of a sync committee. + SyncCommitteeBranchDepthElectra = 6 // SyncCommitteeBranchDepthElectra defines the number of leaves in a merkle proof of a sync committee. FinalityBranchDepth = 6 // FinalityBranchDepth defines the number of leaves in a merkle proof of the finalized checkpoint root. PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state. PendingPartialWithdrawalsLimit = 64 // Maximum number of pending partial withdrawals in the beacon state. diff --git a/testing/util/lightclient.go b/testing/util/lightclient.go index 2cf668dac89b..8e6a768ae413 100644 --- a/testing/util/lightclient.go +++ b/testing/util/lightclient.go @@ -456,6 +456,118 @@ func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient { return l } +func (l *TestLightClient) SetupTestElectra(blinded bool) *TestLightClient { + ctx := context.Background() + + slot := primitives.Slot(params.BeaconConfig().ElectraForkEpoch * primitives.Epoch(params.BeaconConfig().SlotsPerEpoch)).Add(1) + + attestedState, err := NewBeaconStateElectra() + require.NoError(l.T, err) + err = attestedState.SetSlot(slot) + require.NoError(l.T, err) + + finalizedBlock, err := blocks.NewSignedBeaconBlock(NewBeaconBlockElectra()) + require.NoError(l.T, err) + finalizedBlock.SetSlot(1) + finalizedHeader, err := finalizedBlock.Header() + require.NoError(l.T, err) + finalizedRoot, err := finalizedHeader.Header.HashTreeRoot() + require.NoError(l.T, err) + + require.NoError(l.T, attestedState.SetFinalizedCheckpoint(ðpb.Checkpoint{ + Epoch: params.BeaconConfig().ElectraForkEpoch - 10, + Root: finalizedRoot[:], + })) + + parent := NewBeaconBlockElectra() + parent.Block.Slot = slot + + signedParent, err := blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + parentHeader, err := signedParent.Header() + require.NoError(l.T, err) + attestedHeader := parentHeader.Header + + err = attestedState.SetLatestBlockHeader(attestedHeader) + require.NoError(l.T, err) + attestedStateRoot, err := attestedState.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + parent.Block.StateRoot = attestedStateRoot[:] + signedParent, err = blocks.NewSignedBeaconBlock(parent) + require.NoError(l.T, err) + + state, err := NewBeaconStateElectra() + require.NoError(l.T, err) + err = state.SetSlot(slot) + require.NoError(l.T, err) + + parentRoot, err := signedParent.Block().HashTreeRoot() + require.NoError(l.T, err) + + var signedBlock interfaces.SignedBeaconBlock + if blinded { + block := NewBlindedBeaconBlockElectra() + block.Message.Slot = slot + block.Message.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Message.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Message.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } else { + block := NewBeaconBlockElectra() + block.Block.Slot = slot + block.Block.ParentRoot = parentRoot[:] + + for i := uint64(0); i < params.BeaconConfig().MinSyncCommitteeParticipants; i++ { + block.Block.Body.SyncAggregate.SyncCommitteeBits.SetBitAt(i, true) + } + + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + + h, err := signedBlock.Header() + require.NoError(l.T, err) + + err = state.SetLatestBlockHeader(h.Header) + require.NoError(l.T, err) + stateRoot, err := state.HashTreeRoot(ctx) + require.NoError(l.T, err) + + // get a new signed block so the root is updated with the new state root + block.Block.StateRoot = stateRoot[:] + signedBlock, err = blocks.NewSignedBeaconBlock(block) + require.NoError(l.T, err) + } + + l.State = state + l.AttestedState = attestedState + l.AttestedBlock = signedParent + l.Block = signedBlock + l.Ctx = ctx + l.FinalizedBlock = finalizedBlock + + return l +} + func (l *TestLightClient) SetupTestDenebFinalizedBlockCapella(blinded bool) *TestLightClient { ctx := context.Background() From 3fa6d3bd9d15962afda9ac8016bc27fba1d77d1f Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:24:50 -0500 Subject: [PATCH 319/325] update to latest version of our fastssz fork (#14519) Co-authored-by: Kasey Kirkham --- CHANGELOG.md | 1 + deps.bzl | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- proto/eth/v1/gateway.ssz.go | 7 +++++-- proto/eth/v2/grpc.ssz.go | 2 +- proto/prysm/v1alpha1/altair.ssz.go | 2 +- proto/prysm/v1alpha1/bellatrix.ssz.go | 2 +- proto/prysm/v1alpha1/capella.ssz.go | 2 +- proto/prysm/v1alpha1/deneb.ssz.go | 2 +- proto/prysm/v1alpha1/electra.ssz.go | 2 +- proto/prysm/v1alpha1/non-core.ssz.go | 2 +- proto/prysm/v1alpha1/phase0.ssz.go | 7 +++++-- 13 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a59af76a6cbc..f667ec6a0739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - HTTP endpoint for PublishBlobs - GetBlockV2, GetBlindedBlock, ProduceBlockV2, ProduceBlockV3: add Electra case. - Add Electra support and tests for light client functions +- fastssz version bump (better error messages). - SSE implementation that sheds stuck clients. [pr](https://github.com/prysmaticlabs/prysm/pull/14413) ### Changed diff --git a/deps.bzl b/deps.bzl index 0d971d392ca2..0a341df4a79c 100644 --- a/deps.bzl +++ b/deps.bzl @@ -2781,8 +2781,8 @@ def prysm_deps(): go_repository( name = "com_github_prysmaticlabs_fastssz", importpath = "github.com/prysmaticlabs/fastssz", - sum = "h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk=", - version = "v0.0.0-20240620202422-a981b8ef89d3", + sum = "h1:xuVAdtz5ShYblG2sPyb4gw01DF8InbOI/kBCQjk7NiM=", + version = "v0.0.0-20241008181541-518c4ce73516", ) go_repository( name = "com_github_prysmaticlabs_go_bitfield", diff --git a/go.mod b/go.mod index 138f1084a570..152be1170b89 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/prometheus/client_golang v1.20.0 github.com/prometheus/client_model v0.6.1 github.com/prometheus/prom2json v1.3.0 - github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 + github.com/prysmaticlabs/fastssz v0.0.0-20241008181541-518c4ce73516 github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 diff --git a/go.sum b/go.sum index b53de69d2755..ee0cb046dd9a 100644 --- a/go.sum +++ b/go.sum @@ -897,8 +897,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= -github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk= -github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2OlIZD/M6wFvV3YMZbW16lFgh3Rsye00G44J2cwLyU= +github.com/prysmaticlabs/fastssz v0.0.0-20241008181541-518c4ce73516 h1:xuVAdtz5ShYblG2sPyb4gw01DF8InbOI/kBCQjk7NiM= +github.com/prysmaticlabs/fastssz v0.0.0-20241008181541-518c4ce73516/go.mod h1:h2OlIZD/M6wFvV3YMZbW16lFgh3Rsye00G44J2cwLyU= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= diff --git a/proto/eth/v1/gateway.ssz.go b/proto/eth/v1/gateway.ssz.go index 9917b1fadc17..373b08c76407 100644 --- a/proto/eth/v1/gateway.ssz.go +++ b/proto/eth/v1/gateway.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c +// Hash: 2874e1dadeb47411763f48fe31e5daaa91ac663e796933d9a508c2e7be94fa5e package v1 import ( @@ -2395,7 +2395,10 @@ func (v *Validator) UnmarshalSSZ(buf []byte) error { v.EffectiveBalance = ssz.UnmarshallUint64(buf[80:88]) // Field (3) 'Slashed' - v.Slashed = ssz.UnmarshalBool(buf[88:89]) + v.Slashed, err = ssz.DecodeBool(buf[88:89]) + if err != nil { + return err + } // Field (4) 'ActivationEligibilityEpoch' v.ActivationEligibilityEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[89:97])) diff --git a/proto/eth/v2/grpc.ssz.go b/proto/eth/v2/grpc.ssz.go index 556abe7bbcdb..3d0855382373 100644 --- a/proto/eth/v2/grpc.ssz.go +++ b/proto/eth/v2/grpc.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: bc8a0f7f6c8dadac6bcb0eaab2dea4888cc44c5b3f4fe9998a71e15f1a059399 +// Hash: 298a6e797d2a244a4eee0e60b198b11fd30b4b8596a8a5b911dd2e14fafebdad package eth import ( diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go index 8700124222b5..40c8b601cf31 100644 --- a/proto/prysm/v1alpha1/altair.ssz.go +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 54ff8b768faa21e2d838e9f6be78af4dfeb76d3d46b32072c09faa16bd2393ea +// Hash: 18a07a11eb3d1daaafe0b6b1ac8934e9333ea6eceed7d5ef30166b9c2fb50d39 package eth import ( diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index f978ae3f9141..c2fafaaa073d 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 693cad07de8560b2681132d912aebb927e668fe15e5cb9f42e8a36bbac6e2c5e +// Hash: c6614861443f105e2d5445ca29187cc78c2a929161d0a15b36ce2f0e6517a0ea package eth import ( diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index 5428e1e0b499..80fa1e074f3f 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 7133c698cd96aab07bbef1347ea98e6ccbd2c5c30d1e7d0f32977b9a7335d9d3 +// Hash: 6bee0cf7c5707af68be518a221b248ce37edd4b0b1e6fec9703c6152a5107a1d package eth import ( diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index 71356e7d8e34..d5b8cf461aba 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: b829ba09699058dc63b76a5eb5a03ce3d7d19b0d94b9e7fca06056f9f2f8b317 +// Hash: dc56f26fb2603482588d88426187e889583abce2eeb7556ac0dc1ebaa891c455 package eth import ( diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index bec6268275c2..15aabf461d03 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 8009dff4967583f3039317182cf9c9f5c46922f00fe10c357d9d32b0a264e28b +// Hash: 3a2dbf56ebf4e81fbf961840a4cd2addac9047b17c12bad04e60879df5b69277 package eth import ( diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go index 13bae739b5bc..2630eec1ccb2 100644 --- a/proto/prysm/v1alpha1/non-core.ssz.go +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 4cb7a5705004491db2ef29a5080a4cc56a1b618de948a86f9e5275858b48e6c4 +// Hash: bfd7d6b556134c3bd236b880245717aa01ae79573b33f2746a08c165ba5dcedb package eth import ( diff --git a/proto/prysm/v1alpha1/phase0.ssz.go b/proto/prysm/v1alpha1/phase0.ssz.go index 6102d3713daa..96748fccc31e 100644 --- a/proto/prysm/v1alpha1/phase0.ssz.go +++ b/proto/prysm/v1alpha1/phase0.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 0afa289ce68dc2913d8000d495c6069832f35b66a6c0cf1bb0d1299fcad7047a +// Hash: 5797213d138ec1a089f9dae2198cab6f4f829ac0cc1f0bda2633fff544db4e68 package eth import ( @@ -3979,7 +3979,10 @@ func (v *Validator) UnmarshalSSZ(buf []byte) error { v.EffectiveBalance = ssz.UnmarshallUint64(buf[80:88]) // Field (3) 'Slashed' - v.Slashed = ssz.UnmarshalBool(buf[88:89]) + v.Slashed, err = ssz.DecodeBool(buf[88:89]) + if err != nil { + return err + } // Field (4) 'ActivationEligibilityEpoch' v.ActivationEligibilityEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[89:97])) From 944f94a9bf6cbd19699b319917499fd7262e2f73 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:14:20 -0500 Subject: [PATCH 320/325] recover from panics when writing the event stream (#14545) * recover from panics when writing the event stream --------- Co-authored-by: Kasey Kirkham (cherry picked from commit 1086bdf2b39946cc587660d0c165eec29cec34de) --- beacon-chain/rpc/eth/events/events.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 28e31fc9840f..7698d2fb9017 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -71,6 +71,7 @@ var ( errSlowReader = errors.New("client failed to read fast enough to keep outgoing buffer below threshold") errNotRequested = errors.New("event not requested by client") errUnhandledEventData = errors.New("unable to represent event data in the event stream") + errWriterUnusable = errors.New("http response writer is unusable") ) // StreamingResponseWriter defines a type that can be used by the eventStreamer. @@ -309,10 +310,21 @@ func (es *eventStreamer) outboxWriteLoop(ctx context.Context, cancel context.Can } } +func writeLazyReaderWithRecover(w StreamingResponseWriter, lr lazyReader) (err error) { + defer func() { + if r := recover(); r != nil { + log.WithField("panic", r).Error("Recovered from panic while writing event to client.") + err = errWriterUnusable + } + }() + _, err = io.Copy(w, lr()) + return err +} + func (es *eventStreamer) writeOutbox(ctx context.Context, w StreamingResponseWriter, first lazyReader) error { needKeepAlive := true if first != nil { - if _, err := io.Copy(w, first()); err != nil { + if err := writeLazyReaderWithRecover(w, first); err != nil { return err } needKeepAlive = false @@ -325,13 +337,13 @@ func (es *eventStreamer) writeOutbox(ctx context.Context, w StreamingResponseWri case <-ctx.Done(): return ctx.Err() case rf := <-es.outbox: - if _, err := io.Copy(w, rf()); err != nil { + if err := writeLazyReaderWithRecover(w, rf); err != nil { return err } needKeepAlive = false default: if needKeepAlive { - if _, err := io.Copy(w, newlineReader()); err != nil { + if err := writeLazyReaderWithRecover(w, newlineReader); err != nil { return err } } From 569ea8cb909486195897518372db608c27f0b12e Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Fri, 22 Mar 2024 13:17:40 +0100 Subject: [PATCH 321/325] Add ProbeLab Dockerfile --- .gitignore | 3 +++ probelab/Dockerfile | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 probelab/Dockerfile diff --git a/.gitignore b/.gitignore index 40aebe42b636..22ac76ffcf15 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ tmp # spectest coverage reports report.txt + +# pre-compiled binary +probelab/beacon-chain diff --git a/probelab/Dockerfile b/probelab/Dockerfile new file mode 100644 index 000000000000..35ea304be026 --- /dev/null +++ b/probelab/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:latest + +RUN adduser --system --no-create-home --disabled-login --group prysm +WORKDIR /home/prysm +USER prysm + +COPY ./beacon-chain beacon-chain + +CMD ["beacon-chain"] From 507253f241e7ab46513f8d318c627853403c27fd Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Thu, 21 Mar 2024 12:28:06 +0100 Subject: [PATCH 322/325] Add Kinesis Producer to Prysm --- beacon-chain/node/node.go | 58 +++- beacon-chain/p2p/config.go | 2 + beacon-chain/p2p/handshake.go | 35 +++ beacon-chain/p2p/pubsub.go | 8 +- beacon-chain/p2p/pubsub_tracer.go | 267 +++++++++++++++++- beacon-chain/sync/options.go | 8 + beacon-chain/sync/rpc.go | 91 +++++- .../sync/rpc_beacon_blocks_by_range.go | 25 +- .../sync/rpc_beacon_blocks_by_root.go | 19 +- .../sync/rpc_blob_sidecars_by_range.go | 16 +- .../sync/rpc_blob_sidecars_by_root.go | 18 +- beacon-chain/sync/rpc_goodbye.go | 12 +- beacon-chain/sync/rpc_metadata.go | 24 +- beacon-chain/sync/rpc_ping.go | 25 +- beacon-chain/sync/rpc_status.go | 53 ++-- beacon-chain/sync/service.go | 2 + beacon-chain/sync/subscriber.go | 17 ++ cmd/beacon-chain/main.go | 2 + cmd/flags.go | 11 + go.mod | 17 ++ go.sum | 36 +++ 21 files changed, 666 insertions(+), 80 deletions(-) diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index b5c735ba8957..3a27754981ba 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -7,6 +7,8 @@ import ( "bytes" "context" "fmt" + "github.com/urfave/cli/v2" + "log/slog" "net" "net/http" "os" @@ -16,7 +18,11 @@ import ( "strings" "sync" "syscall" + "time" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/kinesis" + gk "github.com/dennis-tra/go-kinesis" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api/server/httprest" @@ -68,7 +74,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/runtime/prereqs" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" ) const testSkipPowFlag = "test-skip-pow" @@ -121,6 +126,7 @@ type BeaconNode struct { BlobStorageOptions []filesystem.BlobStorageOption verifyInitWaiter *verification.InitializerWaiter syncChecker *initialsync.SyncChecker + kinesisProducer *gk.Producer } // New creates a new node instance, sets up configuration options, and registers @@ -287,6 +293,11 @@ func startBaseServices(cliCtx *cli.Context, beacon *BeaconNode, depositAddress s } beacon.BlobStorage.WarmCache() + log.Debugln("Starting Kinesis Producer") + if err := beacon.initKinesisProducer(cliCtx); err != nil { + return nil, err + } + log.Debugln("Starting Slashing DB") if err := beacon.startSlasherDB(cliCtx); err != nil { return nil, errors.Wrap(err, "could not start slashing DB") @@ -420,6 +431,17 @@ func (b *BeaconNode) Start() { "version": version.Version(), }).Info("Starting beacon node") + go func() { + if err := b.kinesisProducer.Start(b.ctx); err != nil { + log.WithError(err).Warn("Kinesis producer failed to start") + } + }() + + if err := b.kinesisProducer.WaitIdle(b.ctx); err != nil { + log.WithError(err).Warn("Kinesis producer failed to become idle") + return + } + b.services.StartAll() stop := b.stop @@ -444,6 +466,12 @@ func (b *BeaconNode) Start() { // Wait for stop channel to be closed. <-stop + + shutdownCtx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + if err := b.kinesisProducer.WaitStopped(shutdownCtx); err != nil { + log.WithError(err).Warn("failed waiting for kinesis producer to stop") + } } // Close handles graceful shutdown of the system. @@ -632,6 +660,32 @@ func (b *BeaconNode) startSlasherDB(cliCtx *cli.Context) error { return nil } +func (b *BeaconNode) initKinesisProducer(cliCtx *cli.Context) error { + region := cliCtx.String(cmd.KinesisRegion.Name) + if region == "" { + return fmt.Errorf("no kinesis data stream region given") + } + + streamName := cliCtx.String(cmd.KinesisStream.Name) + if streamName == "" { + return fmt.Errorf("no kinesis data stream name given") + } + + awsConfig, err := config.LoadDefaultConfig(cliCtx.Context, config.WithDefaultRegion(region)) + if err != nil { + return fmt.Errorf("load aws config: %w", err) + } + client := kinesis.NewFromConfig(awsConfig) + kinesisCfg := gk.DefaultProducerConfig() + kinesisCfg.Log = slog.Default() + b.kinesisProducer, err = gk.NewProducer(client, streamName, kinesisCfg) + if err != nil { + return fmt.Errorf("new kinesis producer: %w", err) + } + + return nil +} + func (b *BeaconNode) startStateGen(ctx context.Context, bfs coverage.AvailableBlocker, fc forkchoice.ForkChoicer) error { opts := []stategen.Option{stategen.WithAvailableBlocker(bfs)} sg := stategen.New(b.db, fc, opts...) @@ -693,6 +747,7 @@ func (b *BeaconNode) registerP2P(cliCtx *cli.Context) error { EnableUPnP: cliCtx.Bool(cmd.EnableUPnPFlag.Name), StateNotifier: b, DB: b.db, + KinesisProducer: b.kinesisProducer, ClockWaiter: b.clockWaiter, }) if err != nil { @@ -845,6 +900,7 @@ func (b *BeaconNode) registerSyncService(initialSyncComplete chan struct{}, bFil regularsync.WithBlobStorage(b.BlobStorage), regularsync.WithVerifierWaiter(b.verifyInitWaiter), regularsync.WithAvailableBlocker(bFillStore), + regularsync.WithKinesisProducer(b.kinesisProducer), ) return b.services.RegisterService(rs) } diff --git a/beacon-chain/p2p/config.go b/beacon-chain/p2p/config.go index 3da7d055cbb2..021cd188b5e7 100644 --- a/beacon-chain/p2p/config.go +++ b/beacon-chain/p2p/config.go @@ -1,6 +1,7 @@ package p2p import ( + gk "github.com/dennis-tra/go-kinesis" statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" @@ -33,6 +34,7 @@ type Config struct { DenyListCIDR []string StateNotifier statefeed.Notifier DB db.ReadOnlyDatabase + KinesisProducer *gk.Producer ClockWaiter startup.ClockWaiter } diff --git a/beacon-chain/p2p/handshake.go b/beacon-chain/p2p/handshake.go index 97d2af8eed72..0b522df8762a 100644 --- a/beacon-chain/p2p/handshake.go +++ b/beacon-chain/p2p/handshake.go @@ -10,6 +10,7 @@ import ( "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" + ma "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/peerdata" prysmTime "github.com/prysmaticlabs/prysm/v5/time" @@ -56,8 +57,39 @@ func (s *Service) AddConnectionHandler(reqFunc, goodByeFunc func(ctx context.Con delete(peerMap, id) } + eventHandler := func(n network.Network, c network.Conn, evtType string) { + evt := &traceEvent{ + Type: evtType, + PeerID: s.host.ID(), + Timestamp: time.Now(), + Payload: struct { + RemotePeer string + RemoteMaddrs ma.Multiaddr + AgentVersion string + Direction string + Opened time.Time + Transient bool + }{ + RemotePeer: c.RemotePeer().String(), + RemoteMaddrs: c.RemoteMultiaddr(), + AgentVersion: agentFromPid(c.RemotePeer(), s.host.Peerstore()), + Direction: c.Stat().Direction.String(), + Opened: c.Stat().Opened, + Transient: c.Stat().Transient, + }, + } + + go func() { + if err := s.cfg.KinesisProducer.PutRecord(s.ctx, evt); err != nil { + log.WithError(err).Warn("Failed to put event payload") + } + }() + } + s.host.Network().Notify(&network.NotifyBundle{ ConnectedF: func(net network.Network, conn network.Conn) { + eventHandler(net, conn, "CONNECTED") + remotePeer := conn.RemotePeer() disconnectFromPeer := func() { s.peers.SetConnectionState(remotePeer, peers.PeerDisconnecting) @@ -146,6 +178,9 @@ func (s *Service) AddConnectionHandler(reqFunc, goodByeFunc func(ctx context.Con validPeerConnection() }() }, + DisconnectedF: func(net network.Network, conn network.Conn) { + eventHandler(net, conn, "DISCONNECTED") + }, }) } diff --git a/beacon-chain/p2p/pubsub.go b/beacon-chain/p2p/pubsub.go index 3549841c9034..a40d0167610a 100644 --- a/beacon-chain/p2p/pubsub.go +++ b/beacon-chain/p2p/pubsub.go @@ -133,6 +133,11 @@ func (s *Service) peerInspector(peerMap map[peer.ID]*pubsub.PeerScoreSnapshot) { // pubsubOptions creates a list of options to configure our router with. func (s *Service) pubsubOptions() []pubsub.Option { + tracer := gossipTracer{ + host: s.host, + producer: s.cfg.KinesisProducer, + } + psOpts := []pubsub.Option{ pubsub.WithMessageSignaturePolicy(pubsub.StrictNoSign), pubsub.WithNoAuthor(), @@ -146,7 +151,8 @@ func (s *Service) pubsubOptions() []pubsub.Option { pubsub.WithPeerScore(peerScoringParams()), pubsub.WithPeerScoreInspect(s.peerInspector, time.Minute), pubsub.WithGossipSubParams(pubsubGossipParam()), - pubsub.WithRawTracer(gossipTracer{host: s.host}), + pubsub.WithRawTracer(tracer), + pubsub.WithEventTracer(tracer), } if len(s.cfg.StaticPeers) > 0 { diff --git a/beacon-chain/p2p/pubsub_tracer.go b/beacon-chain/p2p/pubsub_tracer.go index 84ed1b1240f6..f32fbe47faa2 100644 --- a/beacon-chain/p2p/pubsub_tracer.go +++ b/beacon-chain/p2p/pubsub_tracer.go @@ -1,13 +1,51 @@ package p2p import ( + "context" + "encoding/hex" + "encoding/json" + "time" + + gk "github.com/dennis-tra/go-kinesis" + "github.com/google/uuid" pubsub "github.com/libp2p/go-libp2p-pubsub" + pubsubpb "github.com/libp2p/go-libp2p-pubsub/pb" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/prometheus/client_golang/prometheus" ) +type traceEvent struct { + Type string + PeerID peer.ID + Timestamp time.Time + Payload any `json:"Data"` // cannot use field "Data" because of gk.Record method +} + +var _ gk.Record = (*traceEvent)(nil) + +func (t *traceEvent) PartitionKey() string { + u, err := uuid.NewUUID() + if err != nil { + return t.PeerID.String() + } + return u.String() +} + +func (t *traceEvent) ExplicitHashKey() *string { + return nil +} + +func (t *traceEvent) Data() []byte { + data, err := json.Marshal(t) + if err != nil { + log.WithError(err).Warn("Failed to marshal trace event") + return nil + } + return data +} + var _ = pubsub.RawTracer(gossipTracer{}) // Initializes the values for the pubsub rpc action. @@ -22,68 +60,131 @@ const ( // This tracer is used to implement metrics collection for messages received // and broadcasted through gossipsub. type gossipTracer struct { - host host.Host + host host.Host + producer *gk.Producer } // AddPeer . func (g gossipTracer) AddPeer(p peer.ID, proto protocol.ID) { - // no-op + g.flushTrace(pubsubpb.TraceEvent_ADD_PEER.String(), map[string]any{ + "PeerID": p, + "Protocol": proto, + }) } // RemovePeer . func (g gossipTracer) RemovePeer(p peer.ID) { + g.flushTrace(pubsubpb.TraceEvent_REMOVE_PEER.String(), map[string]any{ + "PeerID": p, + }) // no-op } // Join . func (g gossipTracer) Join(topic string) { pubsubTopicsActive.WithLabelValues(topic).Set(1) + g.flushTrace(pubsubpb.TraceEvent_JOIN.String(), map[string]any{ + "Topic": topic, + }) } // Leave . func (g gossipTracer) Leave(topic string) { pubsubTopicsActive.WithLabelValues(topic).Set(0) + g.flushTrace(pubsubpb.TraceEvent_LEAVE.String(), map[string]any{ + "Topic": topic, + }) } // Graft . func (g gossipTracer) Graft(p peer.ID, topic string) { pubsubTopicsGraft.WithLabelValues(topic).Inc() + g.flushTrace(pubsubpb.TraceEvent_GRAFT.String(), map[string]any{ + "PeerID": p, + "Topic": topic, + }) } // Prune . func (g gossipTracer) Prune(p peer.ID, topic string) { pubsubTopicsPrune.WithLabelValues(topic).Inc() + g.flushTrace(pubsubpb.TraceEvent_PRUNE.String(), map[string]any{ + "PeerID": p, + "Topic": topic, + }) } // ValidateMessage . func (g gossipTracer) ValidateMessage(msg *pubsub.Message) { pubsubMessageValidate.WithLabelValues(*msg.Topic).Inc() + g.flushTrace("VALIDATE_MESSAGE", map[string]any{ + "PeerID": msg.ReceivedFrom, + "Topic": msg.GetTopic(), + "MsgID": hex.EncodeToString([]byte(msg.ID)), + "Local": msg.Local, + "MsgBytes": msg.Size(), + "SeqNo": hex.EncodeToString(msg.GetSeqno()), + }) } // DeliverMessage . func (g gossipTracer) DeliverMessage(msg *pubsub.Message) { pubsubMessageDeliver.WithLabelValues(*msg.Topic).Inc() + g.flushTrace(pubsubpb.TraceEvent_DELIVER_MESSAGE.String(), map[string]any{ + "PeerID": msg.ReceivedFrom, + "Topic": msg.GetTopic(), + "MsgID": hex.EncodeToString([]byte(msg.ID)), + "Local": msg.Local, + "MsgBytes": msg.Size(), + "Seq": hex.EncodeToString(msg.GetSeqno()), + }) } // RejectMessage . func (g gossipTracer) RejectMessage(msg *pubsub.Message, reason string) { pubsubMessageReject.WithLabelValues(*msg.Topic, reason).Inc() + g.flushTrace(pubsubpb.TraceEvent_REJECT_MESSAGE.String(), map[string]any{ + "PeerID": msg.ReceivedFrom, + "Topic": msg.GetTopic(), + "MsgID": hex.EncodeToString([]byte(msg.ID)), + "Reason": reason, + "Local": msg.Local, + "MsgBytes": msg.Size(), + "Seq": hex.EncodeToString(msg.GetSeqno()), + }) } // DuplicateMessage . func (g gossipTracer) DuplicateMessage(msg *pubsub.Message) { pubsubMessageDuplicate.WithLabelValues(*msg.Topic).Inc() + g.flushTrace(pubsubpb.TraceEvent_DUPLICATE_MESSAGE.String(), map[string]any{ + "PeerID": msg.ReceivedFrom, + "Topic": msg.GetTopic(), + "MsgID": hex.EncodeToString([]byte(msg.ID)), + "Local": msg.Local, + "MsgBytes": msg.Size(), + "Seq": hex.EncodeToString(msg.GetSeqno()), + }) } // UndeliverableMessage . func (g gossipTracer) UndeliverableMessage(msg *pubsub.Message) { pubsubMessageUndeliverable.WithLabelValues(*msg.Topic).Inc() + g.flushTrace("UNDELIVERABLE_MESSAGE", map[string]any{ + "PeerID": msg.ReceivedFrom, + "Topic": msg.GetTopic(), + "MsgID": hex.EncodeToString([]byte(msg.ID)), + "Local": msg.Local, + }) } // ThrottlePeer . func (g gossipTracer) ThrottlePeer(p peer.ID) { agent := agentFromPid(p, g.host.Peerstore()) pubsubPeerThrottle.WithLabelValues(agent).Inc() + g.flushTrace("THROTTLE_PEER", map[string]any{ + "PeerID": p, + }) } // RecvRPC . @@ -118,3 +219,165 @@ func (g gossipTracer) setMetricFromRPC(act action, subCtr prometheus.Counter, pu pubCtr.WithLabelValues(*msg.Topic).Inc() } } + +func (g gossipTracer) flushTrace(evtType string, payload any) { + evt := &traceEvent{ + Type: evtType, + PeerID: g.host.ID(), + Timestamp: time.Now(), + Payload: payload, + } + + ctx, cancel := context.WithTimeout(context.TODO(), 10*time.Second) + defer cancel() + + if err := g.producer.PutRecord(ctx, evt); err != nil { + log.WithError(err).Warn("Failed to put trace event payload") + return + } +} + +func (g gossipTracer) Trace(evt *pubsubpb.TraceEvent) { + switch evt.GetType() { + case pubsubpb.TraceEvent_RECV_RPC: + payload := newRPCMeta(evt.GetRecvRPC().GetReceivedFrom(), evt.GetRecvRPC().GetMeta()) + g.flushTrace(pubsubpb.TraceEvent_RECV_RPC.String(), payload) + case pubsubpb.TraceEvent_SEND_RPC: + payload := newRPCMeta(evt.GetSendRPC().GetSendTo(), evt.GetSendRPC().GetMeta()) + g.flushTrace(pubsubpb.TraceEvent_SEND_RPC.String(), payload) + case pubsubpb.TraceEvent_DROP_RPC: + payload := newRPCMeta(evt.GetDropRPC().GetSendTo(), evt.GetDropRPC().GetMeta()) + g.flushTrace(pubsubpb.TraceEvent_DROP_RPC.String(), payload) + } +} + +type rpcMeta struct { + PeerID peer.ID + Subscriptions []rpcMetaSub `json:"Subs,omitempty"` + Messages []rpcMetaMsg `json:"Msgs,omitempty"` + Control *rpcMetaControl `json:"Control,omitempty"` +} + +type rpcMetaSub struct { + Subscribe bool + TopicID string +} + +type rpcMetaMsg struct { + MsgID string `json:"MsgID,omitempty"` + Topic string `json:"Topic,omitempty"` +} + +type rpcMetaControl struct { + IHave []rpcControlIHave `json:"IHave,omitempty"` + IWant []rpcControlIWant `json:"IWant,omitempty"` + Graft []rpcControlGraft `json:"Graft,omitempty"` + Prune []rpcControlPrune `json:"Prune,omitempty"` +} + +type rpcControlIHave struct { + TopicID string + MsgIDs []string +} + +type rpcControlIWant struct { + MsgIDs []string +} + +type rpcControlGraft struct { + TopicID string +} + +type rpcControlPrune struct { + TopicID string + PeerIDs []peer.ID +} + +func newRPCMeta(pidBytes []byte, meta *pubsubpb.TraceEvent_RPCMeta) *rpcMeta { + subs := make([]rpcMetaSub, len(meta.GetSubscription())) + for i, subMeta := range meta.GetSubscription() { + subs[i] = rpcMetaSub{ + Subscribe: subMeta.GetSubscribe(), + TopicID: subMeta.GetTopic(), + } + } + + msgs := make([]rpcMetaMsg, len(meta.GetMessages())) + for i, msg := range meta.GetMessages() { + msgs[i] = rpcMetaMsg{ + MsgID: hex.EncodeToString(msg.GetMessageID()), + Topic: msg.GetTopic(), + } + } + + controlMsg := &rpcMetaControl{ + IHave: make([]rpcControlIHave, len(meta.GetControl().GetIhave())), + IWant: make([]rpcControlIWant, len(meta.GetControl().GetIwant())), + Graft: make([]rpcControlGraft, len(meta.GetControl().GetGraft())), + Prune: make([]rpcControlPrune, len(meta.GetControl().GetPrune())), + } + + for i, ihave := range meta.GetControl().GetIhave() { + msgIDs := make([]string, len(ihave.GetMessageIDs())) + for j, msgID := range ihave.GetMessageIDs() { + msgIDs[j] = hex.EncodeToString(msgID) + } + + controlMsg.IHave[i] = rpcControlIHave{ + TopicID: ihave.GetTopic(), + MsgIDs: msgIDs, + } + } + + for i, iwant := range meta.GetControl().GetIwant() { + msgIDs := make([]string, len(iwant.GetMessageIDs())) + for j, msgID := range iwant.GetMessageIDs() { + msgIDs[j] = hex.EncodeToString(msgID) + } + + controlMsg.IWant[i] = rpcControlIWant{ + MsgIDs: msgIDs, + } + } + + for i, graft := range meta.GetControl().GetGraft() { + controlMsg.Graft[i] = rpcControlGraft{ + TopicID: graft.GetTopic(), + } + } + + for i, prune := range meta.GetControl().GetPrune() { + + peerIDs := make([]peer.ID, len(prune.GetPeers())) + for j, peerIDBytes := range prune.GetPeers() { + peerID, err := peer.IDFromBytes(peerIDBytes) + if err != nil { + log.WithError(err).Warn("failed parsing peer ID from prune msg") + continue + } + + peerIDs[j] = peerID + } + + controlMsg.Prune[i] = rpcControlPrune{ + TopicID: prune.GetTopic(), + PeerIDs: peerIDs, + } + } + + if len(controlMsg.IWant) == 0 && len(controlMsg.IHave) == 0 && len(controlMsg.Prune) == 0 && len(controlMsg.Graft) == 0 { + controlMsg = nil + } + + pid, err := peer.IDFromBytes(pidBytes) + if err != nil { + log.WithError(err).Warn("Failed parsing peer ID") + } + + return &rpcMeta{ + PeerID: pid, + Subscriptions: subs, + Messages: msgs, + Control: controlMsg, + } +} diff --git a/beacon-chain/sync/options.go b/beacon-chain/sync/options.go index 9b0281ea667f..70fd51e31749 100644 --- a/beacon-chain/sync/options.go +++ b/beacon-chain/sync/options.go @@ -1,6 +1,7 @@ package sync import ( + gk "github.com/dennis-tra/go-kinesis" "github.com/prysmaticlabs/prysm/v5/async/event" blockfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/block" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" @@ -180,3 +181,10 @@ func WithAvailableBlocker(avb coverage.AvailableBlocker) Option { return nil } } + +func WithKinesisProducer(prod *gk.Producer) Option { + return func(s *Service) error { + s.kinprod = prod + return nil + } +} diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index 1c067036f5ee..d6f068669b36 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -2,13 +2,18 @@ package sync import ( "context" + "encoding/json" + "maps" "reflect" "runtime/debug" "strings" "time" + gk "github.com/dennis-tra/go-kinesis" + "github.com/google/uuid" libp2pcore "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" @@ -31,7 +36,7 @@ var respTimeout = params.BeaconConfig().RespTimeoutDuration() // rpcHandler is responsible for handling and responding to any incoming message. // This method may return an error to internal monitoring, but the error will // not be relayed to the peer. -type rpcHandler func(context.Context, interface{}, libp2pcore.Stream) error +type rpcHandler func(context.Context, interface{}, libp2pcore.Stream) (map[string]any, error) // registerRPCHandlers for p2p RPC. func (s *Service) registerRPCHandlers() { @@ -138,6 +143,31 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { ctx, cancel := context.WithTimeout(s.ctx, ttfbTimeout) defer cancel() + traceType := "HANDLE_STREAM" + // Usual protocol string: /eth2/beacon_chain/req/metadata/2/ssz_snappy + parts := strings.Split(string(stream.Protocol()), "/") + if len(parts) > 4 { + traceType = "HANDLE_" + strings.ToUpper(parts[4]) + } + + commonData := map[string]any{ + "PeerID": stream.Conn().RemotePeer(), + "ProtocolID": stream.Protocol(), + } + + defer func() { + traceEvt := &traceEvent{ + Type: traceType, + PeerID: s.cfg.p2p.Host().ID(), + Timestamp: time.Now(), + Payload: commonData, + } + + if err := s.kinprod.PutRecord(ctx, traceEvt); err != nil { + log.WithError(err).Warn("failed to put record") + } + }() + // Resetting after closing is a no-op so defer a reset in case something goes wrong. // It's up to the handler to Close the stream (send an EOF) if // it successfully writes a response. We don't blindly call @@ -162,6 +192,7 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { // Check before hand that peer is valid. if s.cfg.p2p.Peers().IsBad(stream.Conn().RemotePeer()) { + commonData["Error"] = "bad peer" if err := s.sendGoodByeAndDisconnect(ctx, p2ptypes.GoodbyeCodeBanned, stream.Conn().RemotePeer()); err != nil { log.WithError(err).Debug("Could not disconnect from peer") } @@ -170,6 +201,7 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { // Validate request according to peer limits. if err := s.rateLimiter.validateRawRpcRequest(stream); err != nil { log.WithError(err).Debug("Could not validate rpc request from peer") + commonData["Error"] = "rpc request validation failed" return } s.rateLimiter.addRawStream(stream) @@ -194,7 +226,14 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { // since metadata requests do not have any data in the payload, we // do not decode anything. if baseTopic == p2p.RPCMetaDataTopicV1 || baseTopic == p2p.RPCMetaDataTopicV2 { - if err := handle(ctx, base, stream); err != nil { + traceData, err := handle(ctx, base, stream) + if err != nil { + traceData["Error"] = err.Error() + } else { + traceData["Error"] = nil + } + maps.Copy(commonData, traceData) + if err != nil { messageFailedProcessingCounter.WithLabelValues(topic).Inc() if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") @@ -219,7 +258,14 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) return } - if err := handle(ctx, msg, stream); err != nil { + traceData, err := handle(ctx, msg, stream) + if err != nil { + traceData["Error"] = err.Error() + } else { + traceData["Error"] = nil + } + maps.Copy(commonData, traceData) + if err != nil { messageFailedProcessingCounter.WithLabelValues(topic).Inc() if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") @@ -239,7 +285,14 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) return } - if err := handle(ctx, nTyp.Elem().Interface(), stream); err != nil { + traceData, err := handle(ctx, nTyp.Elem().Interface(), stream) + if err != nil { + traceData["Error"] = err.Error() + } else { + traceData["Error"] = nil + } + maps.Copy(commonData, traceData) + if err != nil { messageFailedProcessingCounter.WithLabelValues(topic).Inc() if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) { log.WithError(err).Debug("Could not handle p2p RPC") @@ -260,3 +313,33 @@ func logStreamErrors(err error, topic string) { } log.WithError(err).WithField("topic", topic).Debug("Could not decode stream message") } + +type traceEvent struct { + Type string + PeerID peer.ID + Timestamp time.Time + Payload any `json:"Data"` // cannot use field "Data" because of gk.Record method +} + +var _ gk.Record = (*traceEvent)(nil) + +func (t *traceEvent) PartitionKey() string { + u, err := uuid.NewUUID() + if err != nil { + return t.PeerID.String() + } + return u.String() +} + +func (t *traceEvent) ExplicitHashKey() *string { + return nil +} + +func (t *traceEvent) Data() []byte { + data, err := json.Marshal(t) + if err != nil { + log.WithError(err).Warn("Failed to marshal trace event") + return nil + } + return data +} diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_range.go b/beacon-chain/sync/rpc_beacon_blocks_by_range.go index 116187899fa2..bf6285d982d7 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_range.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_range.go @@ -19,7 +19,7 @@ import ( ) // beaconBlocksByRangeRPCHandler looks up the request blocks from the database from a given start block. -func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { ctx, span := trace.StartSpan(ctx, "sync.BeaconBlocksByRangeHandler") defer span.End() ctx, cancel := context.WithTimeout(ctx, respTimeout) @@ -28,7 +28,12 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa m, ok := msg.(*pb.BeaconBlocksByRangeRequest) if !ok { - return errors.New("message is not type *pb.BeaconBlockByRangeRequest") + return nil, errors.New("message is not type *pb.BeaconBlockByRangeRequest") + } + traceData := map[string]any{ + "Start": m.GetStartSlot(), + "Count": m.GetCount(), + "Step": m.GetStep(), } log.WithField("startSlot", m.StartSlot).WithField("count", m.Count).Debug("Serving block by range request") rp, err := validateRangeRequest(m, s.cfg.clock.CurrentSlot()) @@ -36,19 +41,19 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa s.writeErrorResponseToStream(responseCodeInvalidRequest, err.Error(), stream) s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) tracing.AnnotateError(span, err) - return err + return traceData, err } available := s.validateRangeAvailability(rp) if !available { log.Debug("error in validating range availability") s.writeErrorResponseToStream(responseCodeResourceUnavailable, p2ptypes.ErrResourceUnavailable.Error(), stream) tracing.AnnotateError(span, err) - return nil + return traceData, nil } blockLimiter, err := s.rateLimiter.topicCollector(string(stream.Protocol())) if err != nil { - return err + return traceData, err } remainingBucketCapacity := blockLimiter.Remaining(stream.Conn().RemotePeer().String()) span.SetAttributes( @@ -67,10 +72,10 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa log.WithError(err).Info("error in BlocksByRange batch") s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream) tracing.AnnotateError(span, err) - return err + return traceData, err } - // prevRoot is used to ensure that returned chains are strictly linear for singular steps + // prevRoot is used to ensure that return ed chains are strictly linear for singular steps // by comparing the previous root of the block in the list with the current block's parent. var batch blockBatch var more bool @@ -78,7 +83,7 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa batchStart := time.Now() if err := s.writeBlockBatchToStream(ctx, batch, stream); err != nil { s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream) - return err + return traceData, err } rpcBlocksByRangeResponseLatency.Observe(float64(time.Since(batchStart).Milliseconds())) } @@ -86,10 +91,10 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa log.WithError(err).Debug("error in BlocksByRange batch") s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream) tracing.AnnotateError(span, err) - return err + return traceData, err } closeStream(stream, log) - return nil + return traceData, nil } type rangeParams struct { diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_root.go b/beacon-chain/sync/rpc_beacon_blocks_by_root.go index ad1ffe83d292..5e9587fe18e0 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_root.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_root.go @@ -70,7 +70,7 @@ func (s *Service) sendRecentBeaconBlocksRequest(ctx context.Context, requests *t } // beaconBlocksRootRPCHandler looks up the request blocks from the database from the given block roots. -func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { ctx, cancel := context.WithTimeout(ctx, ttfbTimeout) defer cancel() SetRPCStreamDeadlines(stream) @@ -78,25 +78,26 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{ rawMsg, ok := msg.(*types.BeaconBlockByRootsReq) if !ok { - return errors.New("message is not type BeaconBlockByRootsReq") + return nil, errors.New("message is not type BeaconBlockByRootsReq") } blockRoots := *rawMsg if err := s.rateLimiter.validateRequest(stream, uint64(len(blockRoots))); err != nil { - return err + return nil, err } + if len(blockRoots) == 0 { // Add to rate limiter in the event no // roots are requested. s.rateLimiter.add(stream, 1) s.writeErrorResponseToStream(responseCodeInvalidRequest, "no block roots provided in request", stream) - return errors.New("no block roots provided") + return nil, errors.New("no block roots provided") } currentEpoch := slots.ToEpoch(s.cfg.clock.CurrentSlot()) if uint64(len(blockRoots)) > params.MaxRequestBlock(currentEpoch) { s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) s.writeErrorResponseToStream(responseCodeInvalidRequest, "requested more than the max block limit", stream) - return errors.New("requested more than the max block limit") + return nil, errors.New("requested more than the max block limit") } s.rateLimiter.add(stream, int64(len(blockRoots))) @@ -105,7 +106,7 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{ if err != nil { log.WithError(err).Debug("Could not fetch block") s.writeErrorResponseToStream(responseCodeServerError, types.ErrGeneric.Error(), stream) - return err + return nil, err } if err := blocks.BeaconBlockIsNil(blk); err != nil { continue @@ -120,17 +121,17 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{ log.WithError(err).Error("Could not get reconstruct full block from blinded body") } s.writeErrorResponseToStream(responseCodeServerError, types.ErrGeneric.Error(), stream) - return err + return nil, err } } if err := s.chunkBlockWriter(stream, blk); err != nil { - return err + return nil, err } } closeStream(stream, log) - return nil + return nil, nil } // sendAndSaveBlobSidecars sends the blob request and saves received sidecars. diff --git a/beacon-chain/sync/rpc_blob_sidecars_by_range.go b/beacon-chain/sync/rpc_blob_sidecars_by_range.go index 7c60beb3234b..c9ba67e666eb 100644 --- a/beacon-chain/sync/rpc_blob_sidecars_by_range.go +++ b/beacon-chain/sync/rpc_blob_sidecars_by_range.go @@ -63,7 +63,7 @@ func (s *Service) streamBlobBatch(ctx context.Context, batch blockBatch, wQuota } // blobsSidecarsByRangeRPCHandler looks up the request blobs from the database from a given start slot index -func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { var err error ctx, span := trace.StartSpan(ctx, "sync.BlobsSidecarsByRangeHandler") defer span.End() @@ -74,17 +74,17 @@ func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interfa r, ok := msg.(*pb.BlobSidecarsByRangeRequest) if !ok { - return errors.New("message is not type *pb.BlobsSidecarsByRangeRequest") + return nil, errors.New("message is not type *pb.BlobsSidecarsByRangeRequest") } if err := s.rateLimiter.validateRequest(stream, 1); err != nil { - return err + return nil, err } rp, err := validateBlobsByRange(r, s.cfg.chain.CurrentSlot()) if err != nil { s.writeErrorResponseToStream(responseCodeInvalidRequest, err.Error(), stream) s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) tracing.AnnotateError(span, err) - return err + return nil, err } // Ticker to stagger out large requests. @@ -95,7 +95,7 @@ func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interfa log.WithError(err).Info("error in BlobSidecarsByRange batch") s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream) tracing.AnnotateError(span, err) - return err + return nil, err } var batch blockBatch @@ -105,7 +105,7 @@ func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interfa wQuota, err = s.streamBlobBatch(ctx, batch, wQuota, stream) rpcBlobsByRangeResponseLatency.Observe(float64(time.Since(batchStart).Milliseconds())) if err != nil { - return err + return nil, err } // once we have written MAX_REQUEST_BLOB_SIDECARS, we're done serving the request if wQuota == 0 { @@ -116,11 +116,11 @@ func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interfa log.WithError(err).Debug("error in BlobSidecarsByRange batch") s.writeErrorResponseToStream(responseCodeServerError, p2ptypes.ErrGeneric.Error(), stream) tracing.AnnotateError(span, err) - return err + return nil, err } closeStream(stream, log) - return nil + return nil, nil } // BlobRPCMinValidSlot returns the lowest slot that we should expect peers to respect as the diff --git a/beacon-chain/sync/rpc_blob_sidecars_by_root.go b/beacon-chain/sync/rpc_blob_sidecars_by_root.go index d49040776b32..1f3f26039378 100644 --- a/beacon-chain/sync/rpc_blob_sidecars_by_root.go +++ b/beacon-chain/sync/rpc_blob_sidecars_by_root.go @@ -21,7 +21,7 @@ import ( // blobSidecarByRootRPCHandler handles the /eth2/beacon_chain/req/blob_sidecars_by_root/1/ RPC request. // spec: https://github.com/ethereum/consensus-specs/blob/a7e45db9ac2b60a33e144444969ad3ac0aae3d4c/specs/deneb/p2p-interface.md#blobsidecarsbyroot-v1 -func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { ctx, span := trace.StartSpan(ctx, "sync.blobSidecarByRootRPCHandler") defer span.End() ctx, cancel := context.WithTimeout(ctx, ttfbTimeout) @@ -30,14 +30,14 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface log := log.WithField("handler", p2p.BlobSidecarsByRootName[1:]) // slice the leading slash off the name var ref, ok := msg.(*types.BlobSidecarsByRootReq) if !ok { - return errors.New("message is not type BlobSidecarsByRootReq") + return nil, errors.New("message is not type BlobSidecarsByRootReq") } blobIdents := *ref if err := validateBlobByRootRequest(blobIdents); err != nil { s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) s.writeErrorResponseToStream(responseCodeInvalidRequest, err.Error(), stream) - return err + return nil, err } // Sort the identifiers so that requests for the same blob root will be adjacent, minimizing db lookups. sort.Sort(blobIdents) @@ -52,13 +52,13 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface cs := s.cfg.clock.CurrentSlot() minReqSlot, err := BlobRPCMinValidSlot(cs) if err != nil { - return errors.Wrapf(err, "unexpected error computing min valid blob request slot, current_slot=%d", cs) + return nil, errors.Wrapf(err, "unexpected error computing min valid blob request slot, current_slot=%d", cs) } for i := range blobIdents { if err := ctx.Err(); err != nil { closeStream(stream, log) - return err + return nil, err } // Throttle request processing to no more than batchSize/sec. @@ -78,7 +78,7 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface } log.WithError(err).Errorf("unexpected db error retrieving BlobSidecar, root=%x, index=%d", root, idx) s.writeErrorResponseToStream(responseCodeServerError, types.ErrGeneric.Error(), stream) - return err + return nil, err } // If any root in the request content references a block earlier than minimum_request_epoch, @@ -89,7 +89,7 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface s.writeErrorResponseToStream(responseCodeResourceUnavailable, types.ErrBlobLTMinRequest.Error(), stream) log.WithError(types.ErrBlobLTMinRequest). Debugf("requested blob for block %#x before minimum_request_epoch", blobIdents[i].BlockRoot) - return types.ErrBlobLTMinRequest + return nil, types.ErrBlobLTMinRequest } SetStreamWriteDeadline(stream, defaultWriteDuration) @@ -97,11 +97,11 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface log.WithError(chunkErr).Debug("Could not send a chunked response") s.writeErrorResponseToStream(responseCodeServerError, types.ErrGeneric.Error(), stream) tracing.AnnotateError(span, chunkErr) - return chunkErr + return nil, chunkErr } } closeStream(stream, log) - return nil + return nil, nil } func validateBlobByRootRequest(blobIdents types.BlobSidecarsByRootReq) error { diff --git a/beacon-chain/sync/rpc_goodbye.go b/beacon-chain/sync/rpc_goodbye.go index 4c27e0b55cf8..39cee578725c 100644 --- a/beacon-chain/sync/rpc_goodbye.go +++ b/beacon-chain/sync/rpc_goodbye.go @@ -34,13 +34,19 @@ var backOffTime = map[primitives.SSZUint64]time.Duration{ } // goodbyeRPCHandler reads the incoming goodbye rpc message from the peer. -func (s *Service) goodbyeRPCHandler(_ context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) goodbyeRPCHandler(_ context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { SetRPCStreamDeadlines(stream) m, ok := msg.(*primitives.SSZUint64) if !ok { - return fmt.Errorf("wrong message type for goodbye, got %T, wanted *uint64", msg) + return nil, fmt.Errorf("wrong message type for goodbye, got %T, wanted *uint64", msg) } + + traceData := map[string]any{ + "Code": m, + "Reason": p2ptypes.GoodbyeCodeMessages[*m], + } + if err := s.rateLimiter.validateRequest(stream, 1); err != nil { log.WithError(err).Debug("Goodbye message from rate-limited peer.") } else { @@ -50,7 +56,7 @@ func (s *Service) goodbyeRPCHandler(_ context.Context, msg interface{}, stream l log.WithField("peer", stream.Conn().RemotePeer()).Trace("Peer has sent a goodbye message") s.cfg.p2p.Peers().SetNextValidTime(stream.Conn().RemotePeer(), goodByeBackoff(*m)) // closes all streams with the peer - return s.cfg.p2p.Disconnect(stream.Conn().RemotePeer()) + return traceData, s.cfg.p2p.Disconnect(stream.Conn().RemotePeer()) } // disconnectBadPeer checks whether peer is considered bad by some scorer, and tries to disconnect diff --git a/beacon-chain/sync/rpc_metadata.go b/beacon-chain/sync/rpc_metadata.go index 65fb0003d896..5d18af5a0b8a 100644 --- a/beacon-chain/sync/rpc_metadata.go +++ b/beacon-chain/sync/rpc_metadata.go @@ -2,7 +2,7 @@ package sync import ( "context" - + "encoding/hex" libp2pcore "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" @@ -18,11 +18,11 @@ import ( ) // metaDataHandler reads the incoming metadata rpc request from the peer. -func (s *Service) metaDataHandler(_ context.Context, _ interface{}, stream libp2pcore.Stream) error { +func (s *Service) metaDataHandler(_ context.Context, _ interface{}, stream libp2pcore.Stream) (map[string]any, error) { SetRPCStreamDeadlines(stream) if err := s.rateLimiter.validateRequest(stream, 1); err != nil { - return err + return nil, err } s.rateLimiter.add(stream, 1) @@ -34,7 +34,7 @@ func (s *Service) metaDataHandler(_ context.Context, _ interface{}, stream libp2 } else if _, err := stream.Write(resp); err != nil { log.WithError(err).Debug("Could not write to stream") } - return nilErr + return nil, nilErr } _, _, streamVersion, err := p2p.TopicDeconstructor(string(stream.Protocol())) if err != nil { @@ -44,9 +44,15 @@ func (s *Service) metaDataHandler(_ context.Context, _ interface{}, stream libp2 } else if _, wErr := stream.Write(resp); wErr != nil { log.WithError(wErr).Debug("Could not write to stream") } - return err + return nil, err } currMd := s.cfg.p2p.Metadata() + + traceData := map[string]any{ + "SeqNumber": currMd.SequenceNumber(), + "Attnets": hex.EncodeToString(currMd.AttnetsBitfield().Bytes()), + } + switch streamVersion { case p2p.SchemaVersionV1: // We have a v1 metadata object saved locally, so we @@ -68,17 +74,19 @@ func (s *Service) metaDataHandler(_ context.Context, _ interface{}, stream libp2 SeqNumber: currMd.SequenceNumber(), Syncnets: bitfield.Bitvector4{byte(0x00)}, }) + traceData["Syncnets"] = hex.EncodeToString(bitfield.Bitvector4{byte(0x00)}) } } + if _, err := stream.Write([]byte{responseCodeSuccess}); err != nil { - return err + return traceData, err } _, err = s.cfg.p2p.Encoding().EncodeWithMaxLength(stream, currMd) if err != nil { - return err + return traceData, err } closeStream(stream, log) - return nil + return traceData, nil } func (s *Service) sendMetaDataRequest(ctx context.Context, id peer.ID) (metadata.Metadata, error) { diff --git a/beacon-chain/sync/rpc_ping.go b/beacon-chain/sync/rpc_ping.go index e082b5cbab63..6131a936c789 100644 --- a/beacon-chain/sync/rpc_ping.go +++ b/beacon-chain/sync/rpc_ping.go @@ -16,16 +16,21 @@ import ( ) // pingHandler reads the incoming ping rpc message from the peer. -func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { SetRPCStreamDeadlines(stream) m, ok := msg.(*primitives.SSZUint64) if !ok { - return fmt.Errorf("wrong message type for ping, got %T, wanted *uint64", msg) + return nil, fmt.Errorf("wrong message type for ping, got %T, wanted *uint64", msg) } if err := s.rateLimiter.validateRequest(stream, 1); err != nil { - return err + return nil, err + } + + traceData := map[string]any{ + "ReceivedSeq": m, } + s.rateLimiter.add(stream, 1) valid, err := s.validateSequenceNum(*m, stream.Conn().RemotePeer()) if err != nil { @@ -34,21 +39,23 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) s.writeErrorResponseToStream(responseCodeInvalidRequest, p2ptypes.ErrInvalidSequenceNum.Error(), stream) } - return err + return traceData, err } + seq := s.cfg.p2p.MetadataSeq() + traceData["SentSeq"] = seq if _, err := stream.Write([]byte{responseCodeSuccess}); err != nil { - return err + return traceData, err } - sq := primitives.SSZUint64(s.cfg.p2p.MetadataSeq()) + sq := primitives.SSZUint64(seq) if _, err := s.cfg.p2p.Encoding().EncodeWithMaxLength(stream, &sq); err != nil { - return err + return traceData, err } closeStream(stream, log) if valid { // If the sequence number was valid we're done. - return nil + return traceData, nil } // The sequence number was not valid. Start our own ping back to the peer. @@ -70,7 +77,7 @@ func (s *Service) pingHandler(_ context.Context, msg interface{}, stream libp2pc s.cfg.p2p.Peers().SetMetadata(stream.Conn().RemotePeer(), md) }() - return nil + return traceData, nil } func (s *Service) sendPingRequest(ctx context.Context, id peer.ID) error { diff --git a/beacon-chain/sync/rpc_status.go b/beacon-chain/sync/rpc_status.go index e688301d66de..39ba73fdc386 100644 --- a/beacon-chain/sync/rpc_status.go +++ b/beacon-chain/sync/rpc_status.go @@ -3,6 +3,7 @@ package sync import ( "bytes" "context" + "encoding/hex" "fmt" "sync" "time" @@ -189,17 +190,32 @@ func (s *Service) reValidatePeer(ctx context.Context, id peer.ID) error { // statusRPCHandler reads the incoming Status RPC from the peer and responds with our version of a status message. // This handler will disconnect any peer that does not match our fork version. -func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) error { +func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream libp2pcore.Stream) (map[string]any, error) { + statusTraceData := func(status *pb.Status) map[string]any { + return map[string]any{ + "ForkDigest": hex.EncodeToString(status.ForkDigest), + "HeadRoot": hex.EncodeToString(status.HeadRoot), + "HeadSlot": status.HeadSlot, + "FinalizedRoot": hex.EncodeToString(status.FinalizedRoot), + "FinalizedEpoch": status.FinalizedEpoch, + } + } + ctx, cancel := context.WithTimeout(ctx, ttfbTimeout) defer cancel() SetRPCStreamDeadlines(stream) log := log.WithField("handler", "status") m, ok := msg.(*pb.Status) if !ok { - return errors.New("message is not type *pb.Status") + return nil, errors.New("message is not type *pb.Status") + } + + traceData := map[string]any{ + "Request": statusTraceData(m), } + if err := s.rateLimiter.validateRequest(stream, 1); err != nil { - return err + return traceData, err } s.rateLimiter.add(stream, 1) @@ -217,15 +233,17 @@ func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream case errors.Is(err, p2ptypes.ErrWrongForkDigestVersion): // Respond with our status and disconnect with the peer. s.cfg.p2p.Peers().SetChainState(remotePeer, m) - if err := s.respondWithStatus(ctx, stream); err != nil { - return err + resp, err := s.respondWithStatus(ctx, stream) + if err != nil { + return traceData, err } + traceData["Response"] = statusTraceData(resp) // Close before disconnecting, and wait for the other end to ack our response. closeStreamAndWait(stream, log) if err := s.sendGoodByeAndDisconnect(ctx, p2ptypes.GoodbyeCodeWrongNetwork, remotePeer); err != nil { - return err + return traceData, err } - return nil + return traceData, nil default: respCode = responseCodeInvalidRequest s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(remotePeer) @@ -241,28 +259,31 @@ func (s *Service) statusRPCHandler(ctx context.Context, msg interface{}, stream } closeStreamAndWait(stream, log) if err := s.sendGoodByeAndDisconnect(ctx, p2ptypes.GoodbyeCodeGenericError, remotePeer); err != nil { - return err + return traceData, err } - return originalErr + return traceData, originalErr } s.cfg.p2p.Peers().SetChainState(remotePeer, m) - if err := s.respondWithStatus(ctx, stream); err != nil { - return err + resp, err := s.respondWithStatus(ctx, stream) + if err != nil { + return traceData, err } + traceData["Response"] = statusTraceData(resp) + closeStream(stream, log) - return nil + return traceData, nil } -func (s *Service) respondWithStatus(ctx context.Context, stream network.Stream) error { +func (s *Service) respondWithStatus(ctx context.Context, stream network.Stream) (*pb.Status, error) { headRoot, err := s.cfg.chain.HeadRoot(ctx) if err != nil { - return err + return nil, err } forkDigest, err := s.currentForkDigest() if err != nil { - return err + return nil, err } cp := s.cfg.chain.FinalizedCheckpt() resp := &pb.Status{ @@ -277,7 +298,7 @@ func (s *Service) respondWithStatus(ctx context.Context, stream network.Stream) log.WithError(err).Debug("Could not write to stream") } _, err = s.cfg.p2p.Encoding().EncodeWithMaxLength(stream, resp) - return err + return resp, err } func (s *Service) validateStatusMessage(ctx context.Context, msg *pb.Status) error { diff --git a/beacon-chain/sync/service.go b/beacon-chain/sync/service.go index 15196bf6ca74..ed237fbe3dbf 100644 --- a/beacon-chain/sync/service.go +++ b/beacon-chain/sync/service.go @@ -9,6 +9,7 @@ import ( "sync" "time" + gk "github.com/dennis-tra/go-kinesis" lru "github.com/hashicorp/golang-lru" pubsub "github.com/libp2p/go-libp2p-pubsub" libp2pcore "github.com/libp2p/go-libp2p/core" @@ -158,6 +159,7 @@ type Service struct { newBlobVerifier verification.NewBlobVerifier availableBlocker coverage.AvailableBlocker ctxMap ContextByteVersions + kinprod *gk.Producer } // NewService initializes new regular sync service. diff --git a/beacon-chain/sync/subscriber.go b/beacon-chain/sync/subscriber.go index 5d2f054b83d6..76280e6a3ea3 100644 --- a/beacon-chain/sync/subscriber.go +++ b/beacon-chain/sync/subscriber.go @@ -216,6 +216,23 @@ func (s *Service) subscribeWithBase(topic string, validator wrappedVal, handle s return } + evt := &traceEvent{ + Type: "HANDLE_MESSAGE", + PeerID: s.cfg.p2p.Host().ID(), + Timestamp: time.Now(), + Payload: map[string]any{ + "PeerID": msg.ReceivedFrom.String(), + "MsgID": msg.ID, + "MsgBytes": len(msg.Data), + "Topic": msg.GetTopic(), + "Seq": msg.GetSeqno(), + }, + } + + if err := s.kinprod.PutRecord(s.ctx, evt); err != nil { + log.WithError(err).Warn("failed putting pubsub event") + } + if err := handle(ctx, msg.ValidatorData.(proto.Message)); err != nil { tracing.AnnotateError(span, err) log.WithError(err).Error("Could not handle p2p pubsub") diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 57eb8928ac41..037247cc0938 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -148,6 +148,8 @@ var appFlags = []cli.Flag{ bflags.BackfillBatchSize, bflags.BackfillWorkerCount, bflags.BackfillOldestSlot, + cmd.KinesisRegion, + cmd.KinesisStream, } func init() { diff --git a/cmd/flags.go b/cmd/flags.go index 6c1c44e8d947..c1e6d6e9e070 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -279,6 +279,17 @@ var ( Usage: "Target file path for outputting a generated JWT secret to be used for JSON-RPC authentication", Aliases: []string{"o"}, } + // KinesisRegion specifies the Kinesis Data Stream Region + KinesisRegion = &cli.StringFlag{ + Name: "kinesis-region", + Usage: "The Kinesis Data Stream Region", + Value: "us-east-1", + } + // KinesisStream specifies the Kinesis Data Stream Name + KinesisStream = &cli.StringFlag{ + Name: "kinesis-stream", + Usage: "The Kinesis Data Stream Name", + } ) // LoadFlagsFromConfig sets flags values from config file if ConfigFileFlag is set. diff --git a/go.mod b/go.mod index 152be1170b89..f3b4cccd06ea 100644 --- a/go.mod +++ b/go.mod @@ -8,11 +8,14 @@ require ( github.com/MariusVanDerWijden/FuzzyVM v0.0.0-20240209103030-ec53fa766bf8 github.com/MariusVanDerWijden/tx-fuzz v1.3.3-0.20240227085032-f70dd7c85c97 github.com/aristanetworks/goarista v0.0.0-20200805130819-fd197cf57d96 + github.com/aws/aws-sdk-go-v2/config v1.27.8 + github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.3 github.com/bazelbuild/rules_go v0.23.2 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/consensys/gnark-crypto v0.12.1 github.com/crate-crypto/go-kzg-4844 v0.7.0 github.com/d4l3k/messagediff v1.2.1 + github.com/dennis-tra/go-kinesis v0.0.0-20240320162313-c4a69517b813 github.com/dgraph-io/ristretto v0.0.4-0.20210318174700-74754f61e018 github.com/dustin/go-humanize v1.0.0 github.com/emicklei/dot v0.11.0 @@ -111,6 +114,19 @@ require ( github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.2 // indirect + github.com/aws/aws-sdk-go-v2 v1.26.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.8 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 // indirect + github.com/aws/smithy-go v1.20.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.11.0 // indirect @@ -166,6 +182,7 @@ require ( github.com/ipfs/go-cid v0.4.1 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c // indirect github.com/klauspost/compress v1.17.9 // indirect diff --git a/go.sum b/go.sum index ee0cb046dd9a..7415476437e8 100644 --- a/go.sum +++ b/go.sum @@ -89,6 +89,36 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.26.0 h1:/Ce4OCiM3EkpW7Y+xUnfAFpchU78K7/Ug01sZni9PgA= +github.com/aws/aws-sdk-go-v2 v1.26.0/go.mod h1:35hUlJVYd+M++iLI3ALmVwMOyRYMmRqUXpTtRGW+K9I= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1/go.mod h1:sxpLb+nZk7tIfCWChfd+h4QwHNUR57d8hA1cleTkjJo= +github.com/aws/aws-sdk-go-v2/config v1.27.8 h1:0r8epOsiJ7YJz65MGcb8i91ehFp4kvvFe2qkq5oYeRI= +github.com/aws/aws-sdk-go-v2/config v1.27.8/go.mod h1:XsmYKxYNuIhLsFddpNds+j9H5XKzjWDdg/SZngiwFio= +github.com/aws/aws-sdk-go-v2/credentials v1.17.8 h1:WUdNLXbyNbU07V/WFrSOBXqZTDgmmMNMgUFzpYOKJhw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.8/go.mod h1:iPZzLpaBIfhyvVS/XGD3JvR1GP3YdHTqpySKDlqkfs8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.4 h1:S+L2QSKhUuShih3aq9P/mkzDBiOO5tTyVg+vXREfsfg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.4/go.mod h1:nQ3how7DMnFMWiU1SpECohgC82fpn4cKZ875NDMmwtA= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 h1:0ScVK/4qZ8CIW0k8jOeFVsyS/sAiXpYxRBLolMkuLQM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4/go.mod h1:84KyjNZdHC6QZW08nfHI6yZgPd+qRgaWcYsyLUo3QY8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 h1:sHmMWWX5E7guWEFQ9SVo6A3S4xpPrWnd77a6y4WM6PU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4/go.mod h1:WjpDrhWisWOIoS9n3nk67A3Ll1vfULJ9Kq6h29HTD48= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 h1:b+E7zIUHMmcB4Dckjpkapoy47W6C9QBv/zoUP+Hn8Kc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6/go.mod h1:S2fNV0rxrP78NhPbCZeQgY8H9jdDMeGtwcfZIRxzBqU= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.3 h1:F6ZNgFuVyS5c5XX/hzZOvCaU1s0lClTBOjALo4YZX+0= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.27.3/go.mod h1:ysLqYFh1A4ozKdp9t7WF0xZGPh2Xc9OC7rTjNALEwXg= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 h1:mnbuWHOcM70/OFUlZZ5rcdfA8PflGXXiefU/O+1S3+8= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.3/go.mod h1:5HFu51Elk+4oRBZVxmHrSds5jFXmFj8C3w7DVF2gnrs= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 h1:uLq0BKatTmDzWa/Nu4WO0M1AaQDaPpwTKAeByEc6WFM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3/go.mod h1:b+qdhjnxj8GSR6t5YfphOffeoQSQ1KmpoVVuBn+PWxs= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 h1:J/PpTf/hllOjx8Xu9DMflff3FajfLxqM5+tepvVXmxg= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.5/go.mod h1:0ih0Z83YDH/QeQ6Ori2yGE2XvWYv/Xm+cZc01LC6oK0= +github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= +github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/bazelbuild/rules_go v0.23.2 h1:Wxu7JjqnF78cKZbsBsARLSXx/jlGaSLCnUV3mTlyHvM= github.com/bazelbuild/rules_go v0.23.2/go.mod h1:MC23Dc/wkXEyk3Wpq6lCqz0ZAYOZDw2DR5y3N1q2i7M= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -193,6 +223,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3 github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= +github.com/dennis-tra/go-kinesis v0.0.0-20240320162313-c4a69517b813 h1:yg9JgtcdsqKU8X6WZHZHAM98TC8GSvq7BJL0qO1LZlU= +github.com/dennis-tra/go-kinesis v0.0.0-20240320162313-c4a69517b813/go.mod h1:5Hm3EOeNP1/lYm9qcFwWgYgjixQilwcZA+hZ05bUz54= github.com/dgraph-io/ristretto v0.0.4-0.20210318174700-74754f61e018 h1:cNcG4c2n5xanQzp2hMyxDxPYVQmZ91y4WN6fJFlndLo= github.com/dgraph-io/ristretto v0.0.4-0.20210318174700-74754f61e018/go.mod h1:MIonLggsKgZLUSt414ExgwNtlOL5MuEoAJP514mwGe8= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -522,6 +554,10 @@ github.com/jedib0t/go-pretty/v6 v6.5.4 h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/ github.com/jedib0t/go-pretty/v6 v6.5.4/go.mod h1:5LQIxa52oJ/DlDSLv0HEkWOFMDGoWkJb9ss5KqPpJBg= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d h1:k+SfYbN66Ev/GDVq39wYOXVW5RNd5kzzairbCe9dK5Q= github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d/go.mod h1:fS54ONkjDV71zS9CDx3V9K21gJg7byKSvI4ajuWFNJw= From 170fdca47ba7c3948d3d7f65b8c5c72db1fae0ec Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Mon, 25 Mar 2024 08:54:59 +0000 Subject: [PATCH 323/325] Add explicit dependencies --- beacon-chain/node/BUILD.bazel | 6 +++ beacon-chain/p2p/BUILD.bazel | 2 + beacon-chain/sync/BUILD.bazel | 2 + deps.bzl | 78 ++++++++++++++++++++++++----------- 4 files changed, 64 insertions(+), 24 deletions(-) diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index a310daf40b26..f365e3fb0a78 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -69,6 +69,9 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", + "@com_github_aws_aws_sdk_go_v2_config//:go_default_library", + "@com_github_aws_aws_sdk_go_v2_service_kinesis//:go_default_library", + "@com_github_dennis_tra_go_kinesis//:go_default_library", ], ) @@ -103,5 +106,8 @@ go_test( "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", + "@com_github_aws_aws_sdk_go_v2_config//:go_default_library", + "@com_github_aws_aws_sdk_go_v2_service_kinesis//:go_default_library", + "@com_github_dennis_tra_go_kinesis//:go_default_library", ], ) diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index 7cb7e5227117..72f23cf692df 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -106,6 +106,8 @@ go_library( "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@com_github_dennis_tra_go_kinesis//:go_default_library", + "@com_github_google_uuid//:go_default_library", ], ) diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index 1d83ac98ad6f..d7ec5724be83 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -141,6 +141,8 @@ go_library( "@com_github_trailofbits_go_mutexasserts//:go_default_library", "@io_opentelemetry_go_otel_trace//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@com_github_dennis_tra_go_kinesis//:go_default_library", + "@com_github_google_uuid//:go_default_library", ], ) diff --git a/deps.bzl b/deps.bzl index 0a341df4a79c..38234b19521f 100644 --- a/deps.bzl +++ b/deps.bzl @@ -169,50 +169,68 @@ def prysm_deps(): go_repository( name = "com_github_aws_aws_sdk_go_v2", importpath = "github.com/aws/aws-sdk-go-v2", - sum = "h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA=", - version = "v1.21.2", + sum = "h1:/Ce4OCiM3EkpW7Y+xUnfAFpchU78K7/Ug01sZni9PgA=", + version = "v1.26.0", + ) + go_repository( + name = "com_github_aws_aws_sdk_go_v2_aws_protocol_eventstream", + importpath = "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream", + sum = "h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU=", + version = "v1.6.1", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_config", importpath = "github.com/aws/aws-sdk-go-v2/config", - sum = "h1:Aka9bI7n8ysuwPeFdm77nfbyHCAKQ3z9ghB3S/38zes=", - version = "v1.18.45", + sum = "h1:0r8epOsiJ7YJz65MGcb8i91ehFp4kvvFe2qkq5oYeRI=", + version = "v1.27.8", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_credentials", importpath = "github.com/aws/aws-sdk-go-v2/credentials", - sum = "h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8=", - version = "v1.13.43", + sum = "h1:WUdNLXbyNbU07V/WFrSOBXqZTDgmmMNMgUFzpYOKJhw=", + version = "v1.17.8", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_feature_ec2_imds", importpath = "github.com/aws/aws-sdk-go-v2/feature/ec2/imds", - sum = "h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ=", - version = "v1.13.13", + sum = "h1:S+L2QSKhUuShih3aq9P/mkzDBiOO5tTyVg+vXREfsfg=", + version = "v1.15.4", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_internal_configsources", importpath = "github.com/aws/aws-sdk-go-v2/internal/configsources", - sum = "h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y=", - version = "v1.1.43", + sum = "h1:0ScVK/4qZ8CIW0k8jOeFVsyS/sAiXpYxRBLolMkuLQM=", + version = "v1.3.4", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_internal_endpoints_v2", importpath = "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2", - sum = "h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc=", - version = "v2.4.37", + sum = "h1:sHmMWWX5E7guWEFQ9SVo6A3S4xpPrWnd77a6y4WM6PU=", + version = "v2.6.4", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_internal_ini", importpath = "github.com/aws/aws-sdk-go-v2/internal/ini", - sum = "h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4=", - version = "v1.3.45", + sum = "h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_aws_aws_sdk_go_v2_service_internal_accept_encoding", + importpath = "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding", + sum = "h1:EyBZibRTVAs6ECHZOw5/wlylS9OcTzwyjeQMudmREjE=", + version = "v1.11.1", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_service_internal_presigned_url", importpath = "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url", - sum = "h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k=", - version = "v1.9.37", + sum = "h1:b+E7zIUHMmcB4Dckjpkapoy47W6C9QBv/zoUP+Hn8Kc=", + version = "v1.11.6", + ) + go_repository( + name = "com_github_aws_aws_sdk_go_v2_service_kinesis", + importpath = "github.com/aws/aws-sdk-go-v2/service/kinesis", + sum = "h1:F6ZNgFuVyS5c5XX/hzZOvCaU1s0lClTBOjALo4YZX+0=", + version = "v1.27.3", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_service_route53", @@ -223,26 +241,26 @@ def prysm_deps(): go_repository( name = "com_github_aws_aws_sdk_go_v2_service_sso", importpath = "github.com/aws/aws-sdk-go-v2/service/sso", - sum = "h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k=", - version = "v1.15.2", + sum = "h1:mnbuWHOcM70/OFUlZZ5rcdfA8PflGXXiefU/O+1S3+8=", + version = "v1.20.3", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_service_ssooidc", importpath = "github.com/aws/aws-sdk-go-v2/service/ssooidc", - sum = "h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk=", - version = "v1.17.3", + sum = "h1:uLq0BKatTmDzWa/Nu4WO0M1AaQDaPpwTKAeByEc6WFM=", + version = "v1.23.3", ) go_repository( name = "com_github_aws_aws_sdk_go_v2_service_sts", importpath = "github.com/aws/aws-sdk-go-v2/service/sts", - sum = "h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU=", - version = "v1.23.2", + sum = "h1:J/PpTf/hllOjx8Xu9DMflff3FajfLxqM5+tepvVXmxg=", + version = "v1.28.5", ) go_repository( name = "com_github_aws_smithy_go", importpath = "github.com/aws/smithy-go", - sum = "h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8=", - version = "v1.15.0", + sum = "h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw=", + version = "v1.20.1", ) go_repository( name = "com_github_aymerick_douceur", @@ -618,6 +636,12 @@ def prysm_deps(): sum = "h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU=", version = "v1.8.2", ) + go_repository( + name = "com_github_dennis_tra_go_kinesis", + importpath = "github.com/dennis-tra/go-kinesis", + sum = "h1:yg9JgtcdsqKU8X6WZHZHAM98TC8GSvq7BJL0qO1LZlU=", + version = "v0.0.0-20240320162313-c4a69517b813", + ) go_repository( name = "com_github_dgraph_io_badger", importpath = "github.com/dgraph-io/badger", @@ -1677,6 +1701,12 @@ def prysm_deps(): sum = "h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=", version = "v0.4.0", ) + go_repository( + name = "com_github_jmespath_go_jmespath_internal_testify", + importpath = "github.com/jmespath/go-jmespath/internal/testify", + sum = "h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=", + version = "v1.5.1", + ) go_repository( name = "com_github_joker_jade", importpath = "github.com/Joker/jade", From fa4d0e467056d9c1fe99b23d1549a370e6208959 Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Mon, 25 Mar 2024 11:45:37 +0100 Subject: [PATCH 324/325] fix: NPE when no trace data given --- beacon-chain/sync/rpc.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index d6f068669b36..afb484c53265 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -258,7 +258,12 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) return } + traceData, err := handle(ctx, msg, stream) + if traceData == nil { + traceData = map[string]any{} + } + if err != nil { traceData["Error"] = err.Error() } else { @@ -286,6 +291,10 @@ func (s *Service) registerRPC(baseTopic string, handle rpcHandler) { return } traceData, err := handle(ctx, nTyp.Elem().Interface(), stream) + if traceData == nil { + traceData = map[string]any{} + } + if err != nil { traceData["Error"] = err.Error() } else { From c7e2d1e35d954716ce21654884691ef80afd5e37 Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Mon, 25 Mar 2024 11:45:48 +0100 Subject: [PATCH 325/325] remove: ProbeLab subfolder --- probelab/Dockerfile | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 probelab/Dockerfile diff --git a/probelab/Dockerfile b/probelab/Dockerfile deleted file mode 100644 index 35ea304be026..000000000000 --- a/probelab/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM debian:latest - -RUN adduser --system --no-create-home --disabled-login --group prysm -WORKDIR /home/prysm -USER prysm - -COPY ./beacon-chain beacon-chain - -CMD ["beacon-chain"]